History

Merge 5.8-rc6 into tty-next

We need the serial/tty fixes in here as well.

Greg Kroah-Hartman committed 6 years ago

Commit 6f2c6592 parents ea1be1e ba47d841395 files · +12287 −6522Browse files

Unified · Split

1395 files
  1. .gitignore +3 −0
  2. .mailmap +5 −0
  3. Documentation/ABI/testing/dev-kmsg +0 −5
  4. Documentation/ABI/testing/sysfs-platform-chipidea-usb-otg +4 −4
  5. Documentation/admin-guide/README.rst +1 −1
  6. Documentation/admin-guide/cgroup-v2.rst +2 −2
  7. Documentation/admin-guide/device-mapper/index.rst +1 −0
  8. Documentation/admin-guide/mm/transhuge.rst +1 −2
  9. Documentation/arm64/cpu-feature-registers.rst +2 −0
  10. Documentation/arm64/silicon-errata.rst +8 −0
  11. Documentation/block/bfq-iosched.rst +1 −8
  12. Documentation/bpf/prog_cgroup_sockopt.rst +14 −0
  13. Documentation/core-api/dma-api.rst +8 −0
  14. Documentation/core-api/pin_user_pages.rst +1 −1
  15. Documentation/dev-tools/kcsan.rst +0 −6
  16. Documentation/dev-tools/kunit/faq.rst +40 −0
  17. Documentation/devicetree/bindings/Makefile +28 −10
  18. Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +1 −1
  19. Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml +2 −2
  20. Documentation/devicetree/bindings/clock/imx27-clock.yaml +1 −1
  21. Documentation/devicetree/bindings/clock/imx31-clock.yaml +1 −1
  22. Documentation/devicetree/bindings/clock/imx5-clock.yaml +1 −1
  23. Documentation/devicetree/bindings/display/bridge/sii902x.txt +1 −1
  24. Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt +2 −2
  25. Documentation/devicetree/bindings/display/imx/ldb.txt +2 −2
  26. Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.yaml +1 −1
  27. Documentation/devicetree/bindings/display/rockchip/rockchip-drm.yaml +1 −1
  28. Documentation/devicetree/bindings/gpio/mediatek,mt7621-gpio.txt +1 −1
  29. Documentation/devicetree/bindings/interrupt-controller/csky,mpintc.txt +1 −1
  30. Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt +1 −1
  31. Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.txt +1 −1
  32. Documentation/devicetree/bindings/net/mediatek-bluetooth.txt +1 −1
  33. Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +1 −1
  34. Documentation/devicetree/bindings/sound/audio-graph-card.txt +1 −1
  35. Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt +1 −1
  36. Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml +17 −9
  37. Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.txt +1 −1
  38. Documentation/devicetree/bindings/thermal/thermal-sensor.yaml +1 −1
  39. Documentation/devicetree/bindings/thermal/thermal-zones.yaml +1 −1
  40. Documentation/devicetree/bindings/thermal/ti,am654-thermal.yaml +1 −1
  41. Documentation/devicetree/bindings/timer/csky,mptimer.txt +1 −1
  42. Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml +2 −2
  43. Documentation/devicetree/writing-schema.rst +6 −3
  44. Documentation/filesystems/overlayfs.rst +2 −2
  45. Documentation/i2c/slave-eeprom-backend.rst +17 −5
  46. Documentation/kbuild/modules.rst +4 −3
  47. Documentation/kbuild/reproducible-builds.rst +1 −1
  48. Documentation/mips/ingenic-tcu.rst +1 −1
  49. Documentation/networking/arcnet.rst +1 −1
  50. Documentation/networking/ax25.rst +1 −1
  51. Documentation/networking/can_ucan_protocol.rst +2 −2
  52. Documentation/networking/dsa/dsa.rst +1 −1
  53. Documentation/networking/ieee802154.rst +2 −2
  54. Documentation/networking/ip-sysctl.rst +1 −1
  55. Documentation/networking/ipvs-sysctl.rst +1 −1
  56. Documentation/networking/rxrpc.rst +1 −1
  57. Documentation/powerpc/vas-api.rst +1 −1
  58. Documentation/process/changes.rst +1 −1
  59. Documentation/process/coding-style.rst +20 −0
  60. Documentation/virt/kvm/api.rst +3 −2
  61. MAINTAINERS +20 −18
  62. Makefile +3 −3
  63. arch/arc/Kconfig +15 −0
  64. arch/arc/Makefile +19 −2
  65. arch/arc/include/asm/elf.h +1 −1
  66. arch/arc/include/asm/irqflags-compact.h +4 −1
  67. arch/arc/kernel/entry.S +5 −11
  68. arch/arc/kernel/head.S +8 −0
  69. arch/arc/kernel/setup.c +7 −12
  70. arch/arm/boot/dts/am335x-baltos.dtsi +1 −1
  71. arch/arm/boot/dts/am335x-boneblack-common.dtsi +1 −0
  72. arch/arm/boot/dts/am335x-boneblack-wireless.dts +0 −1
  73. arch/arm/boot/dts/am335x-boneblue.dts +0 −1
  74. arch/arm/boot/dts/am335x-bonegreen-wireless.dts +0 −1
  75. arch/arm/boot/dts/am335x-evm.dts +1 −2
  76. arch/arm/boot/dts/am335x-evmsk.dts +1 −1
  77. arch/arm/boot/dts/am335x-lxm.dts +1 −1
  78. arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi +1 −1
  79. arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts +1 −1
  80. arch/arm/boot/dts/am335x-pepper.dts +2 −2
  81. arch/arm/boot/dts/am335x-phycore-som.dtsi +1 −1
  82. arch/arm/boot/dts/am335x-pocketbeagle.dts +0 −1
  83. arch/arm/boot/dts/am33xx-l4.dtsi +2 −4
  84. arch/arm/boot/dts/am33xx.dtsi +4 −3
  85. arch/arm/boot/dts/am4372.dtsi +2 −1
  86. arch/arm/boot/dts/am437x-cm-t43.dts +1 −1
  87. arch/arm/boot/dts/am437x-gp-evm.dts +2 −18
  88. arch/arm/boot/dts/am437x-l4.dtsi +12 −7
  89. arch/arm/boot/dts/am437x-sk-evm.dts +1 −17
  90. arch/arm/boot/dts/am43x-epos-evm.dts +0 −16
  91. arch/arm/boot/dts/am5729-beagleboneai.dts +1 −1
  92. arch/arm/boot/dts/bcm-nsp.dtsi +6 −4
  93. arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +1 −0
  94. arch/arm/boot/dts/bcm958522er.dts +4 −0
  95. arch/arm/boot/dts/bcm958525er.dts +4 −0
  96. arch/arm/boot/dts/bcm958525xmc.dts +4 −0
  97. arch/arm/boot/dts/bcm958622hr.dts +4 −0
  98. arch/arm/boot/dts/bcm958623hr.dts +4 −0
  99. arch/arm/boot/dts/bcm958625hr.dts +4 −0
  100. arch/arm/boot/dts/bcm958625k.dts +4 −0
  101. arch/arm/boot/dts/dra7-evm-common.dtsi +0 −20
  102. arch/arm/boot/dts/dra7-l4.dtsi +16 −18
  103. arch/arm/boot/dts/imx6qdl-gw551x.dtsi +1 −1
  104. arch/arm/boot/dts/imx6ul-kontron-n6x1x-s.dtsi +0 −13
  105. arch/arm/boot/dts/imx6ul-kontron-n6x1x-som-common.dtsi +13 −0
  106. arch/arm/boot/dts/meson.dtsi +1 −1
  107. arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +3 −1
  108. arch/arm/boot/dts/omap3-n900.dts +8 −4
  109. arch/arm/boot/dts/omap4-duovero-parlor.dts +1 −1
  110. arch/arm/boot/dts/omap4.dtsi +1 −1
  111. arch/arm/boot/dts/socfpga.dtsi +1 −1
  112. arch/arm/boot/dts/socfpga_arria10.dtsi +1 −1
  113. arch/arm/boot/dts/vexpress-v2m-rs1.dtsi +73 −73
  114. arch/arm/include/asm/efi.h +7 −0
  115. arch/arm/kernel/asm-offsets.c +0 −9
  116. arch/arm/mach-bcm/Kconfig +1 −0
  117. arch/arm/mach-imx/devices/devices-common.h +1 −1
  118. arch/arm/mach-imx/devices/platform-gpio-mxc.c +3 −2
  119. arch/arm/mach-imx/devices/platform-imx-dma.c +1 −5
  120. arch/arm/mach-imx/mm-imx21.c +1 −2
  121. arch/arm/mach-imx/mm-imx27.c +1 −2
  122. arch/arm/mach-imx/pm-imx5.c +4 −2
  123. arch/arm/mach-imx/pm-imx6.c +6 −4
  124. arch/arm/mach-omap2/omap_hwmod.c +12 −4
  125. arch/arm/mach-sti/board-dt.c +0 −9
  126. arch/arm/xen/enlighten.c +0 −1
  127. arch/arm64/Kconfig +2 −2
  128. arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +4 −4
  129. arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts +1 −0
  130. arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_nand.dts +4 −3
  131. arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts +1 −1
  132. arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts +1 −1
  133. arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi +24 −0
  134. arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +5 −0
  135. arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi +2 −2
  136. arch/arm64/boot/dts/freescale/imx8mm-evk.dts +2 −2
  137. arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts +2 −2
  138. arch/arm64/boot/dts/intel/socfpga_agilex_socdk.dts +1 −0
  139. arch/arm64/configs/defconfig +1 −1
  140. arch/arm64/include/asm/alternative.h +8 −8
  141. arch/arm64/include/asm/arch_gicv3.h +1 −1
  142. arch/arm64/include/asm/arch_timer.h +1 −0
  143. arch/arm64/include/asm/cpufeature.h +1 −1
  144. arch/arm64/include/asm/cputype.h +2 −0
  145. arch/arm64/include/asm/debug-monitors.h +2 −0
  146. arch/arm64/include/asm/linkage.h +0 −6
  147. arch/arm64/include/asm/mmu.h +3 −0
  148. arch/arm64/include/asm/pgtable-prot.h +1 −1
  149. arch/arm64/include/asm/syscall.h +11 −1
  150. arch/arm64/include/asm/thread_info.h +1 −0
  151. arch/arm64/include/asm/vdso/clocksource.h +5 −2
  152. arch/arm64/include/asm/vdso/compat_gettimeofday.h +7 −1
  153. arch/arm64/kernel/Makefile +0 −2
  154. arch/arm64/kernel/alternative.c +2 −14
  155. arch/arm64/kernel/cpu_errata.c +18 −6
  156. arch/arm64/kernel/cpufeature.c +4 −0
  157. arch/arm64/kernel/debug-monitors.c +18 −6
  158. arch/arm64/kernel/entry-common.c +1 −1
  159. arch/arm64/kernel/entry.S +31 −21
  160. arch/arm64/kernel/kgdb.c +1 −1
  161. arch/arm64/kernel/perf_regs.c +22 −3
  162. arch/arm64/kernel/probes/kprobes.c +3 −9
  163. arch/arm64/kernel/ptrace.c +37 −12
  164. arch/arm64/kernel/signal.c +2 −9
  165. arch/arm64/kernel/signal32.c +1 −26
  166. arch/arm64/kernel/syscall.c +19 −2
  167. arch/arm64/kernel/vdso.c +28 −33
  168. arch/arm64/kernel/vdso/Makefile +4 −3
  169. arch/arm64/kernel/vdso/sigreturn.S +34 −20
  170. arch/arm64/kernel/vdso32/Makefile +0 −1
  171. arch/arm64/kernel/vdso32/sigreturn.S +0 −58
  172. arch/arm64/kernel/vdso32/vdso.lds.S +0 −12
  173. arch/arm64/kernel/vmlinux.lds.S +0 −3
  174. arch/arm64/kvm/hyp-init.S +7 −4
  175. arch/arm64/kvm/pmu.c +6 −1
  176. arch/arm64/kvm/pvtime.c +12 −3
  177. arch/arm64/kvm/reset.c +7 −3
  178. arch/arm64/kvm/vgic/vgic-v4.c +8 −0
  179. arch/m68k/kernel/setup_no.c +2 −1
  180. arch/m68k/mm/mcfmmu.c +1 −1
  181. arch/mips/boot/dts/ingenic/gcw0.dts +1 −1
  182. arch/mips/include/asm/unroll.h +3 −5
  183. arch/mips/kernel/traps.c +6 −3
  184. arch/mips/kvm/emulate.c +4 −0
  185. arch/mips/kvm/mips.c +2 −0
  186. arch/mips/lantiq/xway/sysctrl.c +4 −4
  187. arch/mips/pci/pci-xtalk-bridge.c +3 −2
  188. arch/openrisc/kernel/dma.c +5 −0
  189. arch/powerpc/include/asm/icswx.h +2 −0
  190. arch/powerpc/kernel/exceptions-64s.S +1 −1
  191. arch/powerpc/kernel/paca.c +1 −1
  192. arch/powerpc/kvm/book3s_64_mmu_radix.c +2 −1
  193. arch/powerpc/mm/book3s64/pkeys.c +7 −8
  194. arch/powerpc/mm/nohash/kaslr_booke.c +1 −0
  195. arch/powerpc/platforms/powernv/vas-fault.c +1 −1
  196. arch/riscv/Kconfig +2 −0
  197. arch/riscv/include/asm/barrier.h +9 −1
  198. arch/riscv/include/asm/gdb_xml.h +1 −2
  199. arch/riscv/include/asm/kgdb.h +3 −2
  200. arch/riscv/include/asm/thread_info.h +4 −0
  201. arch/riscv/kernel/kgdb.c +5 −5
  202. arch/riscv/kernel/vdso/Makefile +4 −1
  203. arch/riscv/kernel/vdso/vgettimeofday.c +6 −0
  204. arch/s390/configs/debug_defconfig +35 −9
  205. arch/s390/configs/defconfig +33 −10
  206. arch/s390/configs/zfcpdump_defconfig +5 −0
  207. arch/s390/include/asm/kvm_host.h +4 −4
  208. arch/s390/kernel/debug.c +2 −1
  209. arch/s390/kernel/early.c +2 −0
  210. arch/s390/kernel/entry.S +1 −1
  211. arch/s390/kernel/perf_cpum_sf.c +10 −1
  212. arch/s390/kernel/setup.c +1 −0
  213. arch/s390/mm/hugetlbpage.c +1 −1
  214. arch/s390/mm/maccess.c +9 −5
  215. arch/s390/pci/pci_event.c +12 −1
  216. arch/x86/Kconfig +1 −1
  217. arch/x86/boot/compressed/Makefile +2 −2
  218. arch/x86/boot/compressed/head_64.S +10 −1
  219. arch/x86/entry/Makefile +11 −3
  220. arch/x86/entry/common.c +47 −4
  221. arch/x86/entry/entry_32.S +2 −3
  222. arch/x86/entry/entry_64_compat.S +16 −15
  223. arch/x86/events/Makefile +1 −1
  224. arch/x86/hyperv/hv_init.c +4 −1
  225. arch/x86/include/asm/bitops.h +1 −5
  226. arch/x86/include/asm/bug.h +6 −0
  227. arch/x86/include/asm/cpu.h +5 −0
  228. arch/x86/include/asm/cpumask.h +18 −0
  229. arch/x86/include/asm/fpu/internal.h +5 −0
  230. arch/x86/include/asm/idtentry.h +27 −38
  231. arch/x86/include/asm/io_bitmap.h +16 −0
  232. arch/x86/include/asm/kvm_host.h +2 −2
  233. arch/x86/include/asm/mwait.h +0 −2
  234. arch/x86/include/asm/paravirt.h +5 −0
  235. arch/x86/include/asm/paravirt_types.h +1 −0
  236. arch/x86/include/asm/pgtable_types.h +2 −0
  237. arch/x86/include/asm/processor.h +1 −1
  238. arch/x86/include/uapi/asm/kvm.h +3 −2
  239. arch/x86/kernel/apic/io_apic.c +5 −5
  240. arch/x86/kernel/apic/msi.c +12 −6
  241. arch/x86/kernel/apic/vector.c +5 −18
  242. arch/x86/kernel/cpu/centaur.c +1 −0
  243. arch/x86/kernel/cpu/common.c +12 −12
  244. arch/x86/kernel/cpu/cpu.h +0 −4
  245. arch/x86/kernel/cpu/intel.c +10 −1
  246. arch/x86/kernel/cpu/mce/core.c +4 −2
  247. arch/x86/kernel/cpu/resctrl/core.c +4 −4
  248. arch/x86/kernel/cpu/resctrl/internal.h +1 −0
  249. arch/x86/kernel/cpu/resctrl/rdtgroup.c +1 −0
  250. arch/x86/kernel/cpu/umwait.c +0 −6
  251. arch/x86/kernel/cpu/zhaoxin.c +1 −0
  252. arch/x86/kernel/fpu/core.c +6 −0
  253. arch/x86/kernel/ldt.c +25 −1
  254. arch/x86/kernel/nmi.c +1 −1
  255. arch/x86/kernel/paravirt.c +2 −1
  256. arch/x86/kernel/process.c +2 −16
  257. arch/x86/kernel/traps.c +56 −38
  258. arch/x86/kvm/kvm_cache_regs.h +1 −1
  259. arch/x86/kvm/lapic.c +31 −19
  260. arch/x86/kvm/mmu.h +1 −1
  261. arch/x86/kvm/mmu/mmu.c +3 −3
  262. arch/x86/kvm/mmu/paging_tmpl.h +7 −9
  263. arch/x86/kvm/svm/svm.c +1 −1
  264. arch/x86/kvm/vmx/nested.c +3 −2
  265. arch/x86/kvm/vmx/vmcs.h +20 −12
  266. arch/x86/kvm/vmx/vmx.c +9 −31
  267. arch/x86/kvm/vmx/vmx.h +0 −2
  268. arch/x86/kvm/x86.c +9 −3
  269. arch/x86/lib/memcpy_64.S +4 −0
  270. arch/x86/lib/usercopy_64.c +1 −0
  271. arch/x86/math-emu/wm_sqrt.S +1 −1
  272. arch/x86/platform/uv/uv_irq.c +2 −1
  273. arch/x86/power/cpu.c +6 −0
  274. arch/x86/xen/enlighten_pv.c +36 −4
  275. arch/x86/xen/xen-asm_64.S +18 −7
  276. arch/xtensa/kernel/perf_event.c +1 −3
  277. arch/xtensa/kernel/setup.c +2 −1
  278. arch/xtensa/kernel/xtensa_ksyms.c +2 −2
  279. block/bio-integrity.c +15 −9
  280. block/blk-mq-debugfs.c +3 −0
  281. block/blk-mq.c +2 −2
  282. block/keyslot-manager.c +1 −2
  283. crypto/af_alg.c +11 −15
  284. crypto/algif_aead.c +3 −6
  285. crypto/algif_hash.c +3 −6
  286. crypto/algif_skcipher.c +3 −6
  287. crypto/asymmetric_keys/public_key.c +1 −0
  288. drivers/acpi/acpi_configfs.c +5 −1
  289. drivers/acpi/dptf/dptf_power.c +1 −0
  290. drivers/acpi/fan.c +1 −1
  291. drivers/acpi/sysfs.c +2 −2
  292. drivers/android/binder.c +7 −7
  293. drivers/base/base.h +0 −1
  294. drivers/base/core.c +32 −12
  295. drivers/base/dd.c +0 −5
  296. drivers/base/power/trace.c +2 −2
  297. drivers/base/regmap/Kconfig +1 −1
  298. drivers/base/regmap/regmap-debugfs.c +29 −23
  299. drivers/base/regmap/regmap.c +51 −57
  300. drivers/block/nbd.c +15 −10
  301. drivers/block/virtio_blk.c +1 −0
  302. drivers/block/zram/zram_drv.c +2 −1
  303. drivers/bus/ti-sysc.c +79 −28
  304. drivers/char/tpm/st33zp24/i2c.c +1 −1
  305. drivers/char/tpm/st33zp24/spi.c +2 −2
  306. drivers/char/tpm/st33zp24/st33zp24.c +1 −1
  307. drivers/char/tpm/tpm-dev-common.c +9 −10
  308. drivers/char/tpm/tpm_ibmvtpm.c +7 −7
  309. drivers/char/tpm/tpm_tis.c +7 −0
  310. drivers/char/tpm/tpm_tis_core.c +1 −1
  311. drivers/char/tpm/tpm_tis_spi_main.c +5 −5
  312. drivers/char/virtio_console.c +2 −1
  313. drivers/clk/Kconfig +1 −0
  314. drivers/clk/clk-ast2600.c +41 −8
  315. drivers/clk/mvebu/Kconfig +1 −0
  316. drivers/clk/sifive/fu540-prci.c +4 −1
  317. drivers/clocksource/arm_arch_timer.c +11 −0
  318. drivers/counter/104-quad-8.c +19 −3
  319. drivers/cpufreq/intel_pstate.c +11 −4
  320. drivers/cpuidle/cpuidle.c +3 −2
  321. drivers/dma-buf/dma-buf.c +32 −33
  322. drivers/dma/dmatest.c +2 −0
  323. drivers/dma/dw/core.c +0 −12
  324. drivers/dma/fsl-edma-common.c +16 −12
  325. drivers/dma/fsl-edma-common.h +1 −1
  326. drivers/dma/fsl-edma.c +7 −0
  327. drivers/dma/idxd/cdev.c +16 −3
  328. drivers/dma/idxd/device.c +25 −0
  329. drivers/dma/idxd/idxd.h +1 −0
  330. drivers/dma/idxd/irq.c +2 −1
  331. drivers/dma/idxd/sysfs.c +5 −0
  332. drivers/dma/imx-sdma.c +4 −7
  333. drivers/dma/ioat/dma.c +12 −0
  334. drivers/dma/ioat/dma.h +0 −2
  335. drivers/dma/mcf-edma.c +7 −0
  336. drivers/dma/sh/usb-dmac.c +2 −0
  337. drivers/dma/tegra210-adma.c +4 −1
  338. drivers/dma/ti/k3-udma-private.c +1 −0
  339. drivers/dma/ti/k3-udma.c +19 −20
  340. drivers/edac/amd64_edac.c +2 −0
  341. drivers/firmware/efi/Kconfig +11 −0
  342. drivers/firmware/efi/arm-init.c +36 −4
  343. drivers/firmware/efi/efi.c +3 −2
  344. drivers/firmware/efi/esrt.c +1 −1
  345. drivers/firmware/efi/libstub/Makefile +2 −1
  346. drivers/firmware/efi/libstub/arm32-stub.c +53 −1
  347. drivers/firmware/efi/libstub/arm64-stub.c +14 −11
  348. drivers/firmware/efi/libstub/efi-stub-helper.c +68 −12
  349. drivers/firmware/efi/libstub/efi-stub.c +3 −0
  350. drivers/firmware/efi/libstub/efistub.h +10 −2
  351. drivers/firmware/efi/libstub/file.c +12 −4
  352. drivers/firmware/efi/libstub/skip_spaces.c +1 −0
  353. drivers/firmware/psci/psci_checker.c +5 −3
  354. drivers/firmware/raspberrypi.c +4 −1
  355. drivers/fpga/Kconfig +1 −1
  356. drivers/gpio/gpio-arizona.c +6 −1
  357. drivers/gpio/gpio-pca953x.c +94 −5
  358. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +1 −0
  359. drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +15 −5
  360. drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +2 −1
  361. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 −2
  362. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +59 −4
  363. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +8 −1
  364. drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +13 −19
  365. drivers/gpu/drm/amd/amdkfd/kfd_process.c +1 −0
  366. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +17 −2
  367. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +10 −1
  368. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +3 −1
  369. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +4 −2
  370. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +26 −27
  371. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +3 −0
  372. drivers/gpu/drm/amd/display/dc/core/dc.c +6 −4
  373. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +16 −3
  374. drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1 −1
  375. drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c +7 −4
  376. drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1 −2
  377. drivers/gpu/drm/drm_fb_helper.c +49 −14
  378. drivers/gpu/drm/drm_panel_orientation_quirks.c +7 −7
  379. drivers/gpu/drm/exynos/exynos_drm_dma.c +2 −2
  380. drivers/gpu/drm/exynos/exynos_drm_g2d.c +0 −1
  381. drivers/gpu/drm/exynos/exynos_drm_mic.c +3 −1
  382. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +3 −2
  383. drivers/gpu/drm/i915/display/intel_display.c +11 −0
  384. drivers/gpu/drm/i915/display/intel_display.h +1 −0
  385. drivers/gpu/drm/i915/display/intel_fbc.c +36 −29
  386. drivers/gpu/drm/i915/display/intel_hdmi.c +2 −8
  387. drivers/gpu/drm/i915/gt/intel_context.c +6 −6
  388. drivers/gpu/drm/i915/gt/intel_lrc.c +5 −14
  389. drivers/gpu/drm/i915/gt/selftest_rps.c +4 −4
  390. drivers/gpu/drm/i915/gt/shaders/README +46 −0
  391. drivers/gpu/drm/i915/gt/shaders/clear_kernel/hsw.asm +119 −0
  392. drivers/gpu/drm/i915/gt/shaders/clear_kernel/ivb.asm +117 −0
  393. drivers/gpu/drm/i915/gvt/debugfs.c +1 −1
  394. drivers/gpu/drm/i915/gvt/handlers.c +13 −11
  395. drivers/gpu/drm/i915/gvt/mmio_context.h +3 −3
  396. drivers/gpu/drm/i915/gvt/reg.h +5 −0
  397. drivers/gpu/drm/i915/i915_debugfs.c +1 −1
  398. drivers/gpu/drm/i915/i915_drv.h +4 −3
  399. drivers/gpu/drm/i915/i915_perf.c +1 −0
  400. drivers/gpu/drm/i915/i915_vma.c +6 −9
  401. drivers/gpu/drm/mcde/mcde_display.c +1 −1
  402. drivers/gpu/drm/mcde/mcde_drv.c +2 −1
  403. drivers/gpu/drm/mediatek/Kconfig +1 −1
  404. drivers/gpu/drm/mediatek/mtk_drm_crtc.c +2 −6
  405. drivers/gpu/drm/mediatek/mtk_drm_drv.c +2 −4
  406. drivers/gpu/drm/mediatek/mtk_drm_plane.c +15 −10
  407. drivers/gpu/drm/mediatek/mtk_dsi.c +1 −4
  408. drivers/gpu/drm/mediatek/mtk_hdmi.c +1 −11
  409. drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c +0 −52
  410. drivers/gpu/drm/meson/meson_registers.h +6 −0
  411. drivers/gpu/drm/meson/meson_viu.c +2 −9
  412. drivers/gpu/drm/msm/adreno/a2xx_gpu.c +1 −1
  413. drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 −1
  414. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 −1
  415. drivers/gpu/drm/msm/adreno/adreno_gpu.c +1 −1
  416. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +11 −7
  417. drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 −1
  418. drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +1 −1
  419. drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1 −1
  420. drivers/gpu/drm/msm/msm_submitqueue.c +3 −1
  421. drivers/gpu/drm/nouveau/dispnv50/disp.c +3 −0
  422. drivers/gpu/drm/nouveau/nouveau_dmem.c +1 −1
  423. drivers/gpu/drm/nouveau/nouveau_svm.c +1 −0
  424. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +2 −2
  425. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +2 −2
  426. drivers/gpu/drm/panel/panel-simple.c +2 −0
  427. drivers/gpu/drm/radeon/ci_dpm.c +3 −4
  428. drivers/gpu/drm/radeon/ni_dpm.c +1 −1
  429. drivers/gpu/drm/rcar-du/Kconfig +1 −0
  430. drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +2 −3
  431. drivers/gpu/drm/sun4i/sun8i_mixer.c +13 −0
  432. drivers/gpu/drm/tegra/dc.c +1 −0
  433. drivers/gpu/drm/tegra/hub.c +15 −2
  434. drivers/gpu/drm/ttm/ttm_bo.c +3 −1
  435. drivers/gpu/drm/ttm/ttm_bo_vm.c +2 −0
  436. drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +4 −4
  437. drivers/gpu/host1x/bus.c +9 −0
  438. drivers/gpu/host1x/dev.c +9 −2
  439. drivers/hid/hid-alps.c +2 −0
  440. drivers/hid/hid-apple.c +18 −0
  441. drivers/hid/hid-ids.h +3 −0
  442. drivers/hid/hid-logitech-dj.c +3 −3
  443. drivers/hid/hid-logitech-hidpp.c +1 −1
  444. drivers/hid/hid-magicmouse.c +6 −0
  445. drivers/hid/hid-quirks.c +2 −0
  446. drivers/hid/hid-steam.c +4 −2
  447. drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +8 −0
  448. drivers/hv/vmbus_drv.c +1 −1
  449. drivers/hwmon/acpi_power_meter.c +3 −1
  450. drivers/hwmon/amd_energy.c +1 −1
  451. drivers/hwmon/aspeed-pwm-tacho.c +2 −0
  452. drivers/hwmon/bt1-pvt.c +6 −6
  453. drivers/hwmon/drivetemp.c +43 −0
  454. drivers/hwmon/emc2103.c +1 −1
  455. drivers/hwmon/max6697.c +4 −3
  456. drivers/hwmon/nct6775.c +3 −3
  457. drivers/hwmon/pmbus/Kconfig +1 −1
  458. drivers/hwmon/pmbus/adm1275.c +8 −2
  459. drivers/hwmon/pmbus/pmbus_core.c +4 −4
  460. drivers/hwmon/scmi-hwmon.c +1 −1
  461. drivers/hwtracing/coresight/coresight-cti.c +54 −42
  462. drivers/hwtracing/coresight/coresight-etm4x.c +53 −29
  463. drivers/hwtracing/intel_th/core.c +18 −3
  464. drivers/hwtracing/intel_th/pci.c +15 −0
  465. drivers/hwtracing/intel_th/sth.c +1 −3
  466. drivers/i2c/Kconfig +7 −0
  467. drivers/i2c/algos/i2c-algo-pca.c +2 −1
  468. drivers/i2c/busses/i2c-designware-common.c +17 −8
  469. drivers/i2c/busses/i2c-designware-core.h +1 −2
  470. drivers/i2c/busses/i2c-designware-pcidrv.c +1 −1
  471. drivers/i2c/busses/i2c-designware-platdrv.c +15 −2
  472. drivers/i2c/busses/i2c-eg20t.c +1 −0
  473. drivers/i2c/busses/i2c-fsi.c +1 −1
  474. drivers/i2c/busses/i2c-mlxcpld.c +2 −2
  475. drivers/i2c/i2c-core-smbus.c +7 −0
  476. drivers/iio/accel/mma8452.c +4 −1
  477. drivers/iio/adc/ad7780.c +1 −1
  478. drivers/iio/adc/adi-axi-adc.c +2 −2
  479. drivers/iio/health/afe4403.c +6 −3
  480. drivers/iio/health/afe4404.c +5 −3
  481. drivers/iio/humidity/hdc100x.c +7 −3
  482. drivers/iio/humidity/hts221.h +5 −2
  483. drivers/iio/humidity/hts221_buffer.c +5 −4
  484. drivers/iio/industrialio-core.c +2 −0
  485. drivers/iio/magnetometer/ak8974.c +17 −12
  486. drivers/iio/pressure/ms5611_core.c +8 −3
  487. drivers/iio/pressure/zpa2326.c +3 −1
  488. drivers/infiniband/core/cm.c +1 −0
  489. drivers/infiniband/core/cma.c +18 −0
  490. drivers/infiniband/core/counters.c +3 −1
  491. drivers/infiniband/core/mad.c +2 −1
  492. drivers/infiniband/core/rdma_core.c +21 −15
  493. drivers/infiniband/core/sa_query.c +17 −21
  494. drivers/infiniband/hw/efa/efa_verbs.c +1 −0
  495. drivers/infiniband/hw/hfi1/debugfs.c +2 −17
  496. drivers/infiniband/hw/hfi1/init.c +28 −9
  497. drivers/infiniband/hw/hfi1/iowait.h +1 −1
  498. drivers/infiniband/hw/hfi1/ipoib.h +6 −0
  499. drivers/infiniband/hw/hfi1/ipoib_tx.c +66 −38
  500. drivers/infiniband/hw/hfi1/netdev_rx.c +1 −1
  501. drivers/infiniband/hw/hfi1/qp.c +5 −2
  502. drivers/infiniband/hw/hfi1/tid_rdma.c +4 −1
  503. drivers/infiniband/hw/hfi1/verbs_txreq.h +1 −1
  504. drivers/infiniband/hw/hns/hns_roce_device.h +4 −3
  505. drivers/infiniband/hw/hns/hns_roce_hw_v1.c +2 −2
  506. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +9 −8
  507. drivers/infiniband/hw/hns/hns_roce_mr.c +3 −2
  508. drivers/infiniband/hw/mlx5/main.c +1 −1
  509. drivers/infiniband/hw/mlx5/qp.c +30 −25
  510. drivers/infiniband/hw/mlx5/qpc.c +8 −0
  511. drivers/infiniband/hw/qedr/qedr_iw_cm.c +11 −2
  512. drivers/infiniband/sw/rdmavt/qp.c +4 −2
  513. drivers/infiniband/sw/siw/siw_main.c +2 −1
  514. drivers/infiniband/sw/siw/siw_qp_rx.c +2 −1
  515. drivers/input/mouse/elan_i2c_core.c +5 −4
  516. drivers/input/mouse/synaptics.c +1 −0
  517. drivers/input/serio/i8042-x86ia64io.h +7 −0
  518. drivers/input/touchscreen/elants_i2c.c +0 −1
  519. drivers/iommu/Kconfig +2 −1
  520. drivers/iommu/amd/amd_iommu.h +1 −1
  521. drivers/iommu/amd/iommu.c +3 −2
  522. drivers/iommu/arm-smmu-qcom.c +1 −1
  523. drivers/iommu/hyperv-iommu.c +4 −1
  524. drivers/iommu/intel/dmar.c +2 −1
  525. drivers/iommu/intel/iommu.c +52 −7
  526. drivers/iommu/intel/irq_remapping.c +1 −1
  527. drivers/iommu/iommu.c +1 −1
  528. drivers/iommu/sun50i-iommu.c +3 −5
  529. drivers/irqchip/Kconfig +1 −1
  530. drivers/irqchip/irq-gic-v3-its.c +12 −4
  531. drivers/irqchip/irq-gic.c +3 −11
  532. drivers/irqchip/irq-riscv-intc.c +1 −1
  533. drivers/md/dm-ioctl.c +1 −1
  534. drivers/md/dm-rq.c +0 −4
  535. drivers/md/dm-writecache.c +14 −2
  536. drivers/md/dm-zoned-metadata.c +39 −12
  537. drivers/md/dm-zoned-reclaim.c +4 −7
  538. drivers/md/dm-zoned-target.c +2 −10
  539. drivers/md/dm.c +66 −31
  540. drivers/media/platform/omap3isp/isp.c +0 −2
  541. drivers/media/platform/omap3isp/ispvideo.c +0 −1
  542. drivers/message/fusion/mptbase.c +20 −21
  543. drivers/message/fusion/mptscsih.c +1 −3
  544. drivers/mfd/ioc3.c +3 −2
  545. drivers/misc/atmel-ssc.c +12 −12
  546. drivers/misc/habanalabs/command_submission.c +13 −0
  547. drivers/misc/habanalabs/debugfs.c +2 −2
  548. drivers/misc/habanalabs/gaudi/gaudi.c +35 −2
  549. drivers/misc/habanalabs/gaudi/gaudiP.h +3 −0
  550. drivers/misc/habanalabs/include/gaudi/gaudi_packets.h +3 −0
  551. drivers/misc/mei/bus.c +1 −2
  552. drivers/misc/mei/hw-me-regs.h +3 −0
  553. drivers/misc/mei/hw-me.c +64 −6
  554. drivers/misc/mei/hw-me.h +13 −4
  555. drivers/misc/mei/pci-me.c +9 −8
  556. drivers/mmc/host/meson-gx-mmc.c +4 −2
  557. drivers/mmc/host/owl-mmc.c +1 −1
  558. drivers/mmc/host/sdhci-msm.c +3 −2
  559. drivers/mtd/mtdcore.c +2 −2
  560. drivers/mtd/nand/raw/nandsim.c +1 −1
  561. drivers/mtd/nand/raw/xway_nand.c +1 −1
  562. drivers/net/bareudp.c +3 −0
  563. drivers/net/dsa/bcm_sf2.c +2 −0
  564. drivers/net/dsa/microchip/ksz8795.c +3 −0
  565. drivers/net/dsa/microchip/ksz9477.c +3 −0
  566. drivers/net/dsa/microchip/ksz9477_i2c.c +1 −0
  567. drivers/net/dsa/sja1105/sja1105_vl.c +173 −166
  568. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c +2 −2
  569. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h +1 −1
  570. drivers/net/ethernet/broadcom/bnxt/bnxt.c +29 −7
  571. drivers/net/ethernet/broadcom/bnxt/bnxt.h +5 −0
  572. drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +1 −1
  573. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +13 −8
  574. drivers/net/ethernet/broadcom/genet/bcmgenet.c +5 −83
  575. drivers/net/ethernet/broadcom/tg3.c +2 −2
  576. drivers/net/ethernet/cadence/macb_main.c +101 −58
  577. drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +4 −2
  578. drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h +3 −0
  579. drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +0 −1
  580. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +1 −1
  581. drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +16 −9
  582. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +6 −5
  583. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +2 −1
  584. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +10 −20
  585. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c +9 −9
  586. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h +82 −40
  587. drivers/net/ethernet/chelsio/cxgb4/l2t.c +25 −28
  588. drivers/net/ethernet/chelsio/cxgb4/sched.c +1 −1
  589. drivers/net/ethernet/chelsio/cxgb4/sge.c +24 −23
  590. drivers/net/ethernet/chelsio/cxgb4/smt.c +2 −0
  591. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +22 −22
  592. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 −2
  593. drivers/net/ethernet/chelsio/cxgb4vf/sge.c +4 −3
  594. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +3 −6
  595. drivers/net/ethernet/freescale/enetc/enetc.c +28 −2
  596. drivers/net/ethernet/freescale/enetc/enetc_hw.h +8 −8
  597. drivers/net/ethernet/freescale/enetc/enetc_pf.c +0 −8
  598. drivers/net/ethernet/freescale/fec.h +0 −5
  599. drivers/net/ethernet/freescale/fec_main.c +31 −63
  600. drivers/net/ethernet/hisilicon/hns/hns_enet.c +1 −1
  601. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +1 −2
  602. drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +6 −3
  603. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +1 −1
  604. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +5 −0
  605. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +2 −0
  606. drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +72 −19
  607. drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h +16 −0
  608. drivers/net/ethernet/ibm/ibmveth.c +1 −1
  609. drivers/net/ethernet/ibm/ibmvnic.c +7 −2
  610. drivers/net/ethernet/intel/i40e/i40e_ethtool.c +3 −0
  611. drivers/net/ethernet/intel/i40e/i40e_main.c +19 −10
  612. drivers/net/ethernet/intel/ice/ice_lib.c +4 −4
  613. drivers/net/ethernet/intel/ice/ice_main.c +1 −1
  614. drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +6 −6
  615. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +11 −3
  616. drivers/net/ethernet/marvell/mvneta.c +54 −24
  617. drivers/net/ethernet/marvell/sky2.c +1 −1
  618. drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h +1 −0
  619. drivers/net/ethernet/mellanox/mlx5/core/en/port.c +18 −3
  620. drivers/net/ethernet/mellanox/mlx5/core/en/port.h +1 −1
  621. drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c +29 −24
  622. drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h +0 −1
  623. drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c +0 −1
  624. drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +16 −8
  625. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +1 −0
  626. drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +19 −0
  627. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +4 −4
  628. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +8 −7
  629. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +9 −5
  630. drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c +0 −1
  631. drivers/net/ethernet/mellanox/mlx5/core/port.c +77 −16
  632. drivers/net/ethernet/mellanox/mlxsw/pci.c +38 −16
  633. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +2 −2
  634. drivers/net/ethernet/mellanox/mlxsw/spectrum.h +3 −5
  635. drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +1 −1
  636. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +1 −1
  637. drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +1 −1
  638. drivers/net/ethernet/neterion/vxge/vxge-config.h +1 −1
  639. drivers/net/ethernet/netronome/nfp/flower/main.c +1 −1
  640. drivers/net/ethernet/netronome/nfp/flower/main.h +4 −3
  641. drivers/net/ethernet/netronome/nfp/flower/offload.c +14 −10
  642. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +1 −1
  643. drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +17 −35
  644. drivers/net/ethernet/pensando/ionic/ionic_lif.c +30 −12
  645. drivers/net/ethernet/pensando/ionic/ionic_lif.h +3 −1
  646. drivers/net/ethernet/qlogic/qed/qed.h +2 −0
  647. drivers/net/ethernet/qlogic/qed/qed_cxt.c +20 −1
  648. drivers/net/ethernet/qlogic/qed/qed_debug.c +18 −2
  649. drivers/net/ethernet/qlogic/qed/qed_dev.c +11 −12
  650. drivers/net/ethernet/qlogic/qed/qed_iwarp.c +0 −2
  651. drivers/net/ethernet/qlogic/qed/qed_mcp.c +7 −0
  652. drivers/net/ethernet/qlogic/qed/qed_mcp.h +7 −0
  653. drivers/net/ethernet/qlogic/qed/qed_roce.c +0 −1
  654. drivers/net/ethernet/qlogic/qed/qed_vf.c +18 −5
  655. drivers/net/ethernet/qlogic/qede/qede_main.c +2 −1
  656. drivers/net/ethernet/qlogic/qede/qede_ptp.c +13 −18
  657. drivers/net/ethernet/qlogic/qede/qede_ptp.h +1 −1
  658. drivers/net/ethernet/qlogic/qede/qede_rdma.c +2 −1
  659. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +13 −5
  660. drivers/net/ethernet/realtek/r8169_main.c +4 −1
  661. drivers/net/ethernet/socionext/netsec.c +3 −2
  662. drivers/net/geneve.c +1 −0
  663. drivers/net/ipa/gsi.c +7 −9
  664. drivers/net/ipa/ipa_cmd.c +15 −0
  665. drivers/net/ipa/ipa_cmd.h +8 −0
  666. drivers/net/ipa/ipa_data-sdm845.c +0 −1
  667. drivers/net/ipa/ipa_endpoint.c +2 −0
  668. drivers/net/ipa/ipa_gsi.c +1 −0
  669. drivers/net/ipa/ipa_gsi.h +2 −0
  670. drivers/net/ipa/ipa_qmi_msg.c +3 −3
  671. drivers/net/macsec.c +2 −3
  672. drivers/net/macvlan.c +2 −3
  673. drivers/net/phy/Kconfig +1 −2
  674. drivers/net/phy/mscc/mscc_macsec.c +9 −31
  675. drivers/net/phy/phy.c +1 −1
  676. drivers/net/phy/phy_device.c +8 −2
  677. drivers/net/phy/phylink.c +32 −13
  678. drivers/net/phy/smsc.c +7 −4
  679. drivers/net/tun.c +2 −0
  680. drivers/net/usb/ax88179_178a.c +6 −5
  681. drivers/net/usb/qmi_wwan.c +1 −0
  682. drivers/net/usb/smsc95xx.c +9 −2
  683. drivers/net/vxlan.c +4 −0
  684. drivers/net/wan/lapbether.c +8 −1
  685. drivers/net/wireguard/device.c +28 −31
  686. drivers/net/wireguard/device.h +1 −2
  687. drivers/net/wireguard/netlink.c +9 −5
  688. drivers/net/wireguard/noise.c +2 −2
  689. drivers/net/wireguard/queueing.h +2 −17
  690. drivers/net/wireguard/receive.c +3 −9
  691. drivers/net/wireguard/socket.c +18 −7
  692. drivers/net/wireless/ath/wil6210/txrx.c +11 −28
  693. drivers/nvdimm/security.c +1 −1
  694. drivers/nvme/host/core.c +11 −4
  695. drivers/nvme/host/multipath.c +33 −20
  696. drivers/nvme/host/nvme.h +15 −0
  697. drivers/nvme/host/pci.c +4 −2
  698. drivers/nvme/host/rdma.c +1 −1
  699. drivers/nvme/host/tcp.c +2 −2
  700. drivers/nvme/target/loop.c +2 −2
  701. drivers/of/of_mdio.c +7 −2
  702. drivers/opp/of.c +4 −0
  703. drivers/pci/controller/vmd.c +3 −2
  704. drivers/perf/arm-cci.c +1 −0
  705. drivers/perf/arm-ccn.c +1 −0
  706. drivers/perf/arm_dsu_pmu.c +1 −0
  707. drivers/perf/arm_smmuv3_pmu.c +2 −0
  708. drivers/perf/arm_spe_pmu.c +1 −0
  709. drivers/perf/fsl_imx8_ddr_perf.c +2 −0
  710. drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +2 −0
  711. drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +2 −0
  712. drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +2 −0
  713. drivers/perf/qcom_l2_pmu.c +1 −0
  714. drivers/perf/qcom_l3_pmu.c +1 −0
  715. drivers/perf/thunderx2_pmu.c +1 −0
  716. drivers/perf/xgene_pmu.c +1 −0
  717. drivers/phy/allwinner/phy-sun4i-usb.c +3 −2
  718. drivers/phy/intel/phy-intel-combo.c +8 −6
  719. drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +2 −2
  720. drivers/phy/ti/phy-am654-serdes.c +1 −1
  721. drivers/phy/ti/phy-j721e-wiz.c +5 −5
  722. drivers/pinctrl/intel/pinctrl-baytrail.c +53 −14
  723. drivers/pinctrl/pinctrl-amd.h +1 −1
  724. drivers/platform/x86/asus-wmi.c +1 −0
  725. drivers/platform/x86/intel_speed_select_if/isst_if_common.h +3 −0
  726. drivers/platform/x86/intel_speed_select_if/isst_if_mbox_pci.c +1 −0
  727. drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c +1 −0
  728. drivers/platform/x86/thinkpad_acpi.c +11 −3
  729. drivers/regulator/Kconfig +1 −1
  730. drivers/regulator/Makefile +1 −1
  731. drivers/regulator/da903x-regulator.c +0 −0
  732. drivers/regulator/da9063-regulator.c +0 −1
  733. drivers/regulator/helpers.c +1 −1
  734. drivers/regulator/pfuze100-regulator.c +39 −21
  735. drivers/regulator/qcom_smd-regulator.c +1 −1
  736. drivers/s390/cio/vfio_ccw_chp.c +1 −0
  737. drivers/s390/net/qeth_core_main.c +5 −6
  738. drivers/s390/scsi/zfcp_erp.c +11 −2
  739. drivers/scsi/libfc/fc_rport.c +8 −5
  740. drivers/scsi/libiscsi.c +1 −1
  741. drivers/scsi/lpfc/lpfc_init.c +2 −1
  742. drivers/scsi/megaraid/megaraid_sas_fusion.c +0 −2
  743. drivers/scsi/mpt3sas/mpt3sas_ctl.c +7 −5
  744. drivers/scsi/qla2xxx/qla_gs.c +3 −1
  745. drivers/scsi/qla2xxx/qla_init.c +1 −1
  746. drivers/scsi/qla2xxx/qla_nvme.c +2 −1
  747. drivers/scsi/scsi_devinfo.c +1 −0
  748. drivers/scsi/scsi_dh.c +1 −0
  749. drivers/scsi/scsi_transport_iscsi.c +1 −1
  750. drivers/scsi/scsi_transport_spi.c +1 −1
  751. drivers/soc/amlogic/meson-gx-socinfo.c +5 −3
  752. drivers/soc/imx/soc-imx.c +3 −0
  753. drivers/soc/imx/soc-imx8m.c +7 −3
  754. drivers/soc/ti/omap_prm.c +4 −4
  755. drivers/soundwire/intel.c +3 −2
  756. drivers/spi/spi-fsl-dspi.c +26 −21
  757. drivers/spi/spi-mt65xx.c +8 −7
  758. drivers/spi/spi-pxa2xx.c +5 −0
  759. drivers/spi/spi-rspi.c +21 −7
  760. drivers/spi/spi-sprd-adi.c +1 −1
  761. drivers/spi/spi-stm32-qspi.c +26 −20
  762. drivers/spi/spi-sun6i.c +6 −8
  763. drivers/spi/spidev.c +12 −12
  764. drivers/staging/comedi/drivers/addi_apci_1500.c +7 −3
  765. drivers/staging/rtl8723bs/core/rtw_wlan_util.c +3 −1
  766. drivers/staging/wfx/hif_tx.c +4 −2
  767. drivers/staging/wfx/hif_tx.h +1 −1
  768. drivers/staging/wfx/queue.c +9 −12
  769. drivers/staging/wfx/scan.c +3 −3
  770. drivers/thermal/cpufreq_cooling.c +3 −3
  771. drivers/thermal/imx_thermal.c +4 −3
  772. drivers/thermal/intel/int340x_thermal/int3400_thermal.c +6 −1
  773. drivers/thermal/intel/int340x_thermal/int3403_thermal.c +1 −1
  774. drivers/thermal/mtk_thermal.c +6 −5
  775. drivers/thermal/qcom/tsens.c +5 −5
  776. drivers/thermal/rcar_gen3_thermal.c +1 −1
  777. drivers/thermal/sprd_thermal.c +2 −2
  778. drivers/thunderbolt/tunnel.c +6 −6
  779. drivers/tty/serial/cpm_uart/cpm_uart_core.c +8 −1
  780. drivers/tty/serial/kgdb_nmi.c +1 −1
  781. drivers/tty/serial/kgdboc.c +16 −16
  782. drivers/tty/serial/mxs-auart.c +8 −4
  783. drivers/tty/serial/serial_core.c +17 −98
  784. drivers/tty/serial/sh-sci.c +3 −0
  785. drivers/tty/serial/xilinx_uartps.c +0 −1
  786. drivers/uio/uio_pdrv_genirq.c +2 −2
  787. drivers/usb/c67x00/c67x00-sched.c +1 −1
  788. drivers/usb/cdns3/ep0.c +21 −19
  789. drivers/usb/cdns3/trace.h +4 −4
  790. drivers/usb/chipidea/core.c +24 −0
  791. drivers/usb/class/cdc-acm.c +2 −0
  792. drivers/usb/core/quirks.c +2 −1
  793. drivers/usb/dwc2/gadget.c +0 −6
  794. drivers/usb/dwc2/platform.c +13 −1
  795. drivers/usb/dwc3/dwc3-exynos.c +0 −9
  796. drivers/usb/dwc3/dwc3-pci.c +11 −1
  797. drivers/usb/early/ehci-dbgp.c +2 −1
  798. drivers/usb/gadget/function/f_uac1_legacy.c +2 −0
  799. drivers/usb/gadget/udc/atmel_usba_udc.c +2 −8
  800. drivers/usb/gadget/udc/gr_udc.c +5 −2
  801. drivers/usb/gadget/udc/mv_udc_core.c +2 −1
  802. drivers/usb/gadget/usbstring.c +1 −1
  803. drivers/usb/host/ehci-exynos.c +2 −3
  804. drivers/usb/host/ehci-pci.c +7 −0
  805. drivers/usb/host/ohci-sm501.c +1 −0
  806. drivers/usb/host/xhci-mtk.c +3 −2
  807. drivers/usb/host/xhci.c +8 −1
  808. drivers/usb/host/xhci.h +1 −1
  809. drivers/usb/misc/usbtest.c +1 −0
  810. drivers/usb/phy/phy-tegra-usb.c +1 −5
  811. drivers/usb/renesas_usbhs/fifo.c +13 −10
  812. drivers/usb/renesas_usbhs/fifo.h +1 −1
  813. drivers/usb/serial/ch341.c +1 −0
  814. drivers/usb/serial/cypress_m8.c +2 −0
  815. drivers/usb/serial/cypress_m8.h +3 −0
  816. drivers/usb/serial/iuu_phoenix.c +5 −3
  817. drivers/usb/serial/option.c +6 −0
  818. drivers/usb/typec/mux/intel_pmc_mux.c +11 −2
  819. drivers/usb/typec/tcpm/tcpci_rt1711h.c +10 −21
  820. drivers/vdpa/vdpa.c +1 −1
  821. drivers/vfio/pci/vfio_pci.c +6 −2
  822. drivers/vfio/pci/vfio_pci_config.c +16 −1
  823. drivers/vhost/test.c +57 −0
  824. drivers/vhost/test.h +1 −0
  825. drivers/vhost/vdpa.c +1 −1
  826. drivers/video/fbdev/core/fbcon.c +2 −1
  827. drivers/video/fbdev/uvesafb.c +1 −1
  828. drivers/virt/vboxguest/vboxguest_core.c +4 −2
  829. drivers/virt/vboxguest/vboxguest_core.h +15 −0
  830. drivers/virt/vboxguest/vboxguest_linux.c +2 −1
  831. drivers/virt/vboxguest/vmmdev.h +2 −0
  832. drivers/virtio/virtio_mem.c +23 −4
  833. drivers/xen/xenbus/xenbus_client.c +82 −89
  834. fs/afs/cell.c +9 −0
  835. fs/afs/fs_operation.c +2 −2
  836. fs/afs/internal.h +1 −1
  837. fs/afs/write.c +1 −0
  838. fs/autofs/waitq.c +1 −1
  839. fs/btrfs/block-group.c +27 −17
  840. fs/btrfs/ctree.c +1 −1
  841. fs/btrfs/ctree.h +2 −0
  842. fs/btrfs/discard.c +1 −0
  843. fs/btrfs/disk-io.c +4 −2
  844. fs/btrfs/extent_io.c +24 −16
  845. fs/btrfs/file.c +38 −9
  846. fs/btrfs/inode.c +31 −17
  847. fs/btrfs/ioctl.c +1 −1
  848. fs/btrfs/ref-verify.c +1 −1
  849. fs/btrfs/space-info.c +1 −1
  850. fs/btrfs/super.c +3 −3
  851. fs/btrfs/tree-log.c +5 −0
  852. fs/btrfs/volumes.h +1 −1
  853. fs/cachefiles/rdwr.c +1 −1
  854. fs/cifs/cifs_debug.c +5 −1
  855. fs/cifs/cifsfs.h +1 −1
  856. fs/cifs/connect.c +6 −4
  857. fs/cifs/file.c +13 −17
  858. fs/cifs/inode.c +17 −2
  859. fs/cifs/ioctl.c +8 −1
  860. fs/cifs/misc.c +7 −9
  861. fs/cifs/smb2misc.c +6 −2
  862. fs/cifs/smb2ops.c +13 −1
  863. fs/cifs/transport.c +1 −1
  864. fs/efivarfs/file.c +3 −4
  865. fs/erofs/zdata.h +10 −10
  866. fs/exfat/dir.c +7 −5
  867. fs/exfat/exfat_fs.h +1 −0
  868. fs/exfat/file.c +18 −1
  869. fs/exfat/namei.c +11 −3
  870. fs/exfat/super.c +10 −0
  871. fs/fuse/file.c +78 −54
  872. fs/fuse/inode.c +16 −3
  873. fs/gfs2/aops.c +1 −44
  874. fs/gfs2/file.c +50 −2
  875. fs/gfs2/glock.c +4 −1
  876. fs/gfs2/glops.c +6 −4
  877. fs/gfs2/incore.h +0 −1
  878. fs/gfs2/inode.c +2 −1
  879. fs/gfs2/log.c +19 −6
  880. fs/gfs2/log.h +2 −2
  881. fs/gfs2/main.c +1 −0
  882. fs/gfs2/ops_fstype.c +12 −1
  883. fs/gfs2/recovery.c +2 −2
  884. fs/gfs2/super.c +10 −10
  885. fs/io_uring.c +85 −24
  886. fs/namespace.c +1 −0
  887. fs/nfs/flexfilelayout/flexfilelayout.c +7 −4
  888. fs/nfs/nfs4namespace.c +1 −0
  889. fs/nfs/nfs4proc.c +18 −2
  890. fs/nfsd/nfs4state.c +7 −1
  891. fs/nfsd/nfsctl.c +13 −10
  892. fs/nfsd/nfsd.h +3 −0
  893. fs/nfsd/vfs.c +6 −0
  894. fs/ocfs2/dlmglue.c +16 −1
  895. fs/ocfs2/ocfs2.h +1 −0
  896. fs/ocfs2/ocfs2_fs.h +2 −2
  897. fs/ocfs2/suballoc.c +6 −3
  898. fs/overlayfs/copy_up.c +1 −1
  899. fs/overlayfs/export.c +1 −1
  900. fs/overlayfs/file.c +6 −4
  901. fs/overlayfs/namei.c +6 −9
  902. fs/overlayfs/overlayfs.h +0 −1
  903. fs/overlayfs/super.c +49 −24
  904. fs/proc/proc_sysctl.c +3 −3
  905. fs/read_write.c +75 −56
  906. fs/xfs/xfs_log_cil.c +5 −5
  907. fs/xfs/xfs_log_priv.h +1 −1
  908. include/asm-generic/cacheflush.h +5 −0
  909. include/asm-generic/mmiowb.h +4 −2
  910. include/crypto/if_alg.h +2 −2
  911. include/linux/atomic-fallback.h +235 −1
  912. include/linux/bits.h +1 −2
  913. include/linux/blkdev.h +1 −0
  914. include/linux/bpf-netns.h +3 −2
  915. include/linux/bpf.h +11 −2
  916. include/linux/btf.h +5 −0
  917. include/linux/cgroup-defs.h +6 −2
  918. include/linux/cgroup.h +3 −1
  919. include/linux/compiler-clang.h +8 −0
  920. include/linux/compiler-gcc.h +7 −1
  921. include/linux/compiler.h +1 −1
  922. include/linux/compiler_attributes.h +1 −0
  923. include/linux/compiler_types.h +7 −34
  924. include/linux/device.h +3 −2
  925. include/linux/dma-buf.h +1 −0
  926. include/linux/dma-direct.h +2 −2
  927. include/linux/dma-mapping.h +5 −0
  928. include/linux/efi.h +3 −5
  929. include/linux/filter.h +2 −2
  930. include/linux/fs.h +2 −1
  931. include/linux/fs_context.h +1 −0
  932. include/linux/host1x.h +3 −0
  933. include/linux/ieee80211.h +4 −0
  934. include/linux/if_vlan.h +22 −7
  935. include/linux/input/elan-i2c-ids.h +7 −0
  936. include/linux/intel-iommu.h +1 −0
  937. include/linux/irq_work.h +8 −18
  938. include/linux/kallsyms.h +3 −2
  939. include/linux/kgdb.h +14 −3
  940. include/linux/libata.h +1 −1
  941. include/linux/lsm_hook_defs.h +2 −2
  942. include/linux/mlx5/driver.h +1 −0
  943. include/linux/mlx5/mlx5_ifc.h +34 −4
  944. include/linux/mmzone.h +2 −2
  945. include/linux/mod_devicetable.h +1 −1
  946. include/linux/netdevice.h +1 −1
  947. include/linux/netfilter_ipv4/ip_tables.h +6 −0
  948. include/linux/netfilter_ipv6/ip6_tables.h +3 −0
  949. include/linux/pci.h +5 −6
  950. include/linux/phy.h +1 −0
  951. include/linux/qed/qed_chain.h +16 −10
  952. include/linux/scatterlist.h +4 −4
  953. include/linux/sched.h +1 −6
  954. include/linux/sched/jobctl.h +3 −1
  955. include/linux/serial_core.h +98 −4
  956. include/linux/skmsg.h +13 −0
  957. include/linux/smp.h +8 −15
  958. include/linux/smp_types.h +66 −0
  959. include/linux/swap.h +1 −0
  960. include/linux/syscalls.h +1 −1
  961. include/linux/task_work.h +4 −1
  962. include/linux/timekeeping.h +7 −7
  963. include/linux/tpm_eventlog.h +13 −1
  964. include/linux/vmalloc.h +0 −1
  965. include/net/dst.h +9 −1
  966. include/net/flow_dissector.h +2 −1
  967. include/net/flow_offload.h +19 −2
  968. include/net/genetlink.h +0 −10
  969. include/net/gue.h +1 −1
  970. include/net/inet_ecn.h +17 −8
  971. include/net/ip_tunnels.h +3 −0
  972. include/net/netns/bpf.h +5 −2
  973. include/net/pkt_sched.h +0 −11
  974. include/net/sctp/constants.h +5 −3
  975. include/net/sock.h +2 −2
  976. include/net/xfrm.h +1 −0
  977. include/net/xsk_buff_pool.h +3 −3
  978. include/sound/compress_driver.h +9 −1
  979. include/sound/dmaengine_pcm.h +11 −0
  980. include/sound/soc.h +6 −0
  981. include/trace/events/rxrpc.h +1 −1
  982. include/uapi/linux/bpf.h +22 −21
  983. include/uapi/linux/fb.h +1 −0
  984. include/uapi/linux/idxd.h +3 −0
  985. include/uapi/linux/input-event-codes.h +2 −1
  986. include/uapi/linux/io_uring.h +1 −0
  987. include/uapi/linux/mrp_bridge.h +0 −1
  988. include/uapi/linux/rds.h +3 −1
  989. include/uapi/linux/spi/spidev.h +4 −0
  990. include/uapi/linux/vboxguest.h +2 −2
  991. include/uapi/linux/vfio.h +1 −1
  992. init/Kconfig +4 −4
  993. kernel/bpf/btf.c +2 −2
  994. kernel/bpf/cgroup.c +33 −20
  995. kernel/bpf/devmap.c +6 −4
  996. kernel/bpf/net_namespace.c +134 −60
  997. kernel/bpf/reuseport_array.c +10 −4
  998. kernel/bpf/ringbuf.c +8 −10
  999. kernel/bpf/syscall.c +24 −21
  1000. kernel/bpf/verifier.c +10 −3
  1001. kernel/cgroup/cgroup.c +19 −12
  1002. kernel/debug/debug_core.c +4 −0
  1003. kernel/debug/gdbstub.c +13 −0
  1004. kernel/debug/kdb/kdb_io.c +43 −29
  1005. kernel/dma/Kconfig +2 −1
  1006. kernel/dma/direct.c +41 −26
  1007. kernel/dma/mapping.c +10 −0
  1008. kernel/dma/pool.c +56 −31
  1009. kernel/dma/remap.c +3 −2
  1010. kernel/fork.c +1 −1
  1011. kernel/irq/manage.c +35 −2
  1012. kernel/kallsyms.c +11 −6
  1013. kernel/kexec_file.c +6 −28
  1014. kernel/kprobes.c +2 −2
  1015. kernel/module.c +30 −25
  1016. kernel/nsproxy.c +1 −1
  1017. kernel/padata.c +2 −2
  1018. kernel/printk/printk.c +0 −10
  1019. kernel/rcu/rcuperf.c +1 −1
  1020. kernel/rcu/tree.c +25 −7
  1021. kernel/sched/core.c +87 −26
  1022. kernel/sched/deadline.c +1 −0
  1023. kernel/sched/fair.c +14 −3
  1024. kernel/sched/idle.c +11 −4
  1025. kernel/sched/sched.h +1 −1
  1026. kernel/signal.c +7 −3
  1027. kernel/smp.c +0 −18
  1028. kernel/task_work.c +14 −2
  1029. kernel/time/timer.c +16 −5
  1030. kernel/trace/bpf_trace.c +1 −1
  1031. kernel/trace/ring_buffer.c +1 −1
  1032. kernel/trace/trace_boot.c +7 −3
  1033. kernel/trace/trace_events_trigger.c +19 −2
  1034. lib/Kconfig.kasan +4 −0
  1035. lib/Kconfig.kgdb +5 −0
  1036. lib/packing.c +1 −0
  1037. lib/test_hmm.c +1 −2
  1038. mm/cma.c +2 −2
  1039. mm/compaction.c +14 −3
  1040. mm/debug_vm_pgtable.c +2 −2
  1041. mm/filemap.c +21 −2
  1042. mm/hugetlb.c +1 −1
  1043. mm/memcontrol.c +13 −5
  1044. mm/memory.c +22 −11
  1045. mm/memory_hotplug.c +11 −2
  1046. mm/migrate.c +1 −12
  1047. mm/mremap.c +21 −2
  1048. mm/nommu.c +0 −17
  1049. mm/page_alloc.c +1 −1
  1050. mm/slab.h +2 −2
  1051. mm/slab_common.c +1 −1
  1052. mm/slub.c +4 −15
  1053. mm/swap.c +1 −2
  1054. mm/swap_state.c +2 −2
  1055. mm/vmalloc.c +0 −21
  1056. mm/vmscan.c +3 −0
  1057. mm/workingset.c +27 −19
  1058. net/8021q/vlan_dev.c +4 −5
  1059. net/9p/mod.c +1 −0
  1060. net/bpf/test_run.c +18 −1
  1061. net/bpfilter/bpfilter_kern.c +1 −1
  1062. net/bridge/br_mrp.c +9 −3
  1063. net/bridge/br_multicast.c +1 −1
  1064. net/bridge/br_private.h +2 −2
  1065. net/bridge/br_private_mrp.h +1 −1
  1066. net/bridge/netfilter/nft_meta_bridge.c +1 −0
  1067. net/bridge/netfilter/nft_reject_bridge.c +1 −0
  1068. net/core/dev.c +9 −0
  1069. net/core/dev_addr_lists.c +10 −0
  1070. net/core/drop_monitor.c +1 −0
  1071. net/core/filter.c +7 −3
  1072. net/core/flow_dissector.c +12 −20
  1073. net/core/flow_offload.c +26 −21
  1074. net/core/skmsg.c +15 −8
  1075. net/core/sock.c +4 −2
  1076. net/core/sock_map.c +48 −5
  1077. net/core/sysctl_net_core.c +1 −1
  1078. net/core/xdp.c +1 −0
  1079. net/dsa/tag_edsa.c +34 −3
  1080. net/ethtool/cabletest.c +9 −8
  1081. net/ethtool/common.c +2 −0
  1082. net/ethtool/ioctl.c +1 −1
  1083. net/ethtool/linkstate.c +5 −6
  1084. net/ethtool/netlink.c +13 −14
  1085. net/hsr/hsr_device.c +8 −24
  1086. net/hsr/hsr_device.h +1 −1
  1087. net/hsr/hsr_main.c +6 −3
  1088. net/hsr/hsr_netlink.c +17 −0
  1089. net/ipv4/Kconfig +18 −16
  1090. net/ipv4/esp4_offload.c +1 −0
  1091. net/ipv4/fib_semantics.c +1 −1
  1092. net/ipv4/fou.c +1 −0
  1093. net/ipv4/icmp.c +2 −2
  1094. net/ipv4/ip_output.c +1 −1
  1095. net/ipv4/ip_tunnel.c +8 −6
  1096. net/ipv4/ip_tunnel_core.c +18 −0
  1097. net/ipv4/ip_vti.c +1 −0
  1098. net/ipv4/ipip.c +1 −0
  1099. net/ipv4/netfilter/ip_tables.c +14 −1
  1100. net/ipv4/netfilter/ipt_SYNPROXY.c +1 −0
  1101. net/ipv4/netfilter/iptable_filter.c +9 −1
  1102. net/ipv4/netfilter/iptable_mangle.c +9 −1
  1103. net/ipv4/netfilter/iptable_nat.c +8 −2
  1104. net/ipv4/netfilter/iptable_raw.c +9 −1
  1105. net/ipv4/netfilter/iptable_security.c +9 −2
  1106. net/ipv4/netfilter/nf_flow_table_ipv4.c +1 −0
  1107. net/ipv4/netfilter/nft_dup_ipv4.c +1 −0
  1108. net/ipv4/netfilter/nft_fib_ipv4.c +1 −0
  1109. net/ipv4/netfilter/nft_reject_ipv4.c +1 −0
  1110. net/ipv4/ping.c +3 −0
  1111. net/ipv4/route.c +1 −1
  1112. net/ipv4/tcp.c +10 −7
  1113. net/ipv4/tcp_cong.c +1 −1
  1114. net/ipv4/tcp_cubic.c +2 −3
  1115. net/ipv4/tcp_input.c +13 −3
  1116. net/ipv4/tcp_ipv4.c +16 −4
  1117. net/ipv4/tcp_output.c +5 −3
  1118. net/ipv6/Kconfig +18 −16
  1119. net/ipv6/esp6_offload.c +1 −0
  1120. net/ipv6/fou6.c +1 −0
  1121. net/ipv6/icmp.c +2 −2
  1122. net/ipv6/ila/ila_main.c +1 −0
  1123. net/ipv6/ip6_gre.c +6 −3
  1124. net/ipv6/ip6_tunnel.c +1 −0
  1125. net/ipv6/ip6_vti.c +1 −0
  1126. net/ipv6/netfilter/ip6_tables.c +14 −1
  1127. net/ipv6/netfilter/ip6t_SYNPROXY.c +1 −0
  1128. net/ipv6/netfilter/ip6table_filter.c +9 −1
  1129. net/ipv6/netfilter/ip6table_mangle.c +9 −1
  1130. net/ipv6/netfilter/ip6table_nat.c +8 −2
  1131. net/ipv6/netfilter/ip6table_raw.c +9 −1
  1132. net/ipv6/netfilter/ip6table_security.c +9 −1
  1133. net/ipv6/netfilter/nf_flow_table_ipv6.c +1 −0
  1134. net/ipv6/netfilter/nft_dup_ipv6.c +1 −0
  1135. net/ipv6/netfilter/nft_fib_ipv6.c +1 −0
  1136. net/ipv6/netfilter/nft_reject_ipv6.c +1 −0
  1137. net/ipv6/route.c +5 −2
  1138. net/ipv6/sit.c +1 −0
  1139. net/l2tp/l2tp_core.c +1 −4
  1140. net/llc/af_llc.c +7 −3
  1141. net/mac80211/mesh_hwmp.c +2 −5
  1142. net/mac80211/rx.c +26 −0
  1143. net/mac80211/status.c +15 −7
  1144. net/mac80211/tx.c +6 −2
  1145. net/mptcp/options.c +3 −5
  1146. net/mptcp/protocol.h +1 −0
  1147. net/mptcp/subflow.c +27 −30
  1148. net/netfilter/ipset/ip_set_bitmap_ip.c +1 −1
  1149. net/netfilter/ipset/ip_set_bitmap_ipmac.c +1 −1
  1150. net/netfilter/ipset/ip_set_bitmap_port.c +1 −1
  1151. net/netfilter/ipset/ip_set_core.c +2 −0
  1152. net/netfilter/ipset/ip_set_hash_gen.h +2 −2
  1153. net/netfilter/nf_conntrack_core.c +2 −0
  1154. net/netfilter/nf_dup_netdev.c +1 −0
  1155. net/netfilter/nf_flow_table_core.c +1 −0
  1156. net/netfilter/nf_flow_table_inet.c +1 −0
  1157. net/netfilter/nf_flow_table_offload.c +1 −0
  1158. net/netfilter/nf_synproxy_core.c +1 −0
  1159. net/netfilter/nf_tables_offload.c +1 −0
  1160. net/netfilter/nfnetlink.c +1 −0
  1161. net/netfilter/nft_compat.c +1 −0
  1162. net/netfilter/nft_connlimit.c +1 −0
  1163. net/netfilter/nft_counter.c +1 −0
  1164. net/netfilter/nft_ct.c +1 −0
  1165. net/netfilter/nft_dup_netdev.c +1 −0
  1166. net/netfilter/nft_fib_inet.c +1 −0
  1167. net/netfilter/nft_fib_netdev.c +1 −0
  1168. net/netfilter/nft_flow_offload.c +1 −0
  1169. net/netfilter/nft_hash.c +1 −0
  1170. net/netfilter/nft_limit.c +1 −0
  1171. net/netfilter/nft_log.c +1 −0
  1172. net/netfilter/nft_masq.c +1 −0
  1173. net/netfilter/nft_nat.c +1 −0
  1174. net/netfilter/nft_numgen.c +1 −0
  1175. net/netfilter/nft_objref.c +1 −0
  1176. net/netfilter/nft_osf.c +1 −0
  1177. net/netfilter/nft_queue.c +1 −0
  1178. net/netfilter/nft_quota.c +1 −0
  1179. net/netfilter/nft_redir.c +1 −0
  1180. net/netfilter/nft_reject.c +1 −0
  1181. net/netfilter/nft_reject_inet.c +1 −0
  1182. net/netfilter/nft_synproxy.c +1 −0
  1183. net/netfilter/nft_tunnel.c +1 −0
  1184. net/netfilter/xt_nat.c +1 −0
  1185. net/netlink/genetlink.c +13 −84
  1186. net/openvswitch/actions.c +7 −2
  1187. net/qrtr/qrtr.c +8 −2
  1188. net/rds/connection.c +11 −0
  1189. net/rds/rds.h +7 −0
  1190. net/rds/send.c +2 −1
  1191. net/rds/transport.c +17 −9
  1192. net/rxrpc/call_accept.c +7 −0
  1193. net/rxrpc/call_event.c +1 −1
  1194. net/rxrpc/input.c +3 −4
  1195. net/sched/act_connmark.c +6 −3
  1196. net/sched/act_csum.c +1 −1
  1197. net/sched/act_ct.c +6 −5
  1198. net/sched/act_ctinfo.c +6 −3
  1199. net/sched/act_gate.c +68 −58
  1200. net/sched/act_mpls.c +1 −1
  1201. net/sched/act_skbedit.c +1 −1
  1202. net/sched/cls_api.c +16 −11
  1203. net/sched/cls_flow.c +4 −4
  1204. net/sched/cls_flower.c +1 −1
  1205. net/sched/em_ipset.c +1 −1
  1206. net/sched/em_ipt.c +1 −1
  1207. net/sched/em_meta.c +1 −1
  1208. net/sched/sch_atm.c +4 −4
  1209. net/sched/sch_cake.c +43 −19
  1210. net/sched/sch_dsmark.c +3 −3
  1211. net/sched/sch_fq.c +1 −0
  1212. net/sched/sch_fq_codel.c +1 −0
  1213. net/sched/sch_hhf.c +1 −0
  1214. net/sched/sch_teql.c +1 −1
  1215. net/sctp/associola.c +4 −1
  1216. net/sctp/bind_addr.c +1 −0
  1217. net/sctp/protocol.c +2 −1
  1218. net/smc/smc_clc.c +32 −13
  1219. net/smc/smc_clc.h +2 −0
  1220. net/smc/smc_core.c +29 −22
  1221. net/smc/smc_core.h +3 −1
  1222. net/smc/smc_ib.c +6 −5
  1223. net/smc/smc_ib.h +2 −1
  1224. net/smc/smc_ism.c +6 −5
  1225. net/smc/smc_ism.h +2 −1
  1226. net/smc/smc_llc.c +56 −35
  1227. net/smc/smc_pnet.c +19 −18
  1228. net/smc/smc_wr.c +6 −4
  1229. net/sunrpc/rpc_pipe.c +1 −0
  1230. net/sunrpc/svcsock.c +1 −0
  1231. net/sunrpc/xdr.c +4 −0
  1232. net/sunrpc/xprtrdma/frwr_ops.c +4 −4
  1233. net/sunrpc/xprtrdma/rpc_rdma.c +5 −8
  1234. net/sunrpc/xprtrdma/transport.c +6 −1
  1235. net/sunrpc/xprtrdma/verbs.c +58 −48
  1236. net/sunrpc/xprtrdma/xprt_rdma.h +2 −1
  1237. net/tipc/link.c +18 −8
  1238. net/wireless/nl80211.c +3 −2
  1239. net/xdp/xsk_buff_pool.c +4 −50
  1240. net/xfrm/Kconfig +24 −0
  1241. net/xfrm/xfrm_device.c +3 −1
  1242. net/xfrm/xfrm_interface.c +2 −0
  1243. net/xfrm/xfrm_output.c +0 −4
  1244. samples/bpf/xdp_monitor_user.c +2 −6
  1245. samples/bpf/xdp_redirect_cpu_user.c +2 −5
  1246. samples/bpf/xdp_rxq_info_user.c +3 −10
  1247. samples/vfs/test-statx.c +2 −0
  1248. scripts/Makefile.extrawarn +2 −0
  1249. scripts/Makefile.lib +6 −1
  1250. scripts/atomic/gen-atomic-fallback.sh +31 −0
  1251. scripts/dtc/checks.c +36 −3
  1252. scripts/dtc/dtc.h +31 −0
  1253. scripts/dtc/flattree.c +1 −1
  1254. scripts/dtc/libfdt/fdt_rw.c +1 −1
  1255. scripts/dtc/libfdt/fdt_sw.c +1 −1
  1256. scripts/dtc/libfdt/libfdt.h +8 −0
  1257. scripts/dtc/treesource.c +4 −4
  1258. scripts/dtc/version_gen.h +1 −1
  1259. scripts/dtc/yamltree.c +3 −3
  1260. scripts/gcc-plugins/Kconfig +1 −1
  1261. scripts/kconfig/qconf.cc +106 −67
  1262. scripts/kconfig/qconf.h +15 −8
  1263. security/integrity/iint.c +1 −13
  1264. security/integrity/ima/ima.h +1 −1
  1265. security/integrity/ima/ima_crypto.c +14 −1
  1266. security/security.c +16 −1
  1267. sound/core/compress_offload.c +4 −0
  1268. sound/drivers/opl3/opl3_synth.c +2 −0
  1269. sound/hda/intel-dsp-config.c +1 −3
  1270. sound/pci/hda/hda_auto_parser.c +6 −0
  1271. sound/pci/hda/hda_intel.c +8 −0
  1272. sound/pci/hda/patch_hdmi.c +31 −15
  1273. sound/pci/hda/patch_realtek.c +65 −4
  1274. sound/soc/amd/raven/acp3x-pcm-dma.c +23 −7
  1275. sound/soc/amd/renoir/Makefile +4 −3
  1276. sound/soc/codecs/hdac_hda.c +10 −6
  1277. sound/soc/codecs/max98390.c +3 −3
  1278. sound/soc/codecs/rt1015.c +75 −49
  1279. sound/soc/codecs/rt1015.h +14 −1
  1280. sound/soc/codecs/rt5682.c +14 −6
  1281. sound/soc/fsl/fsl_asrc_common.h +2 −0
  1282. sound/soc/fsl/fsl_asrc_dma.c +33 −14
  1283. sound/soc/fsl/fsl_mqs.c +14 −9
  1284. sound/soc/fsl/fsl_ssi.c +9 −4
  1285. sound/soc/intel/boards/Kconfig +2 −2
  1286. sound/soc/qcom/common.c +12 −2
  1287. sound/soc/qcom/qdsp6/q6afe.c +8 −0
  1288. sound/soc/qcom/qdsp6/q6afe.h +1 −0
  1289. sound/soc/qcom/qdsp6/q6asm.c +4 −3
  1290. sound/soc/rockchip/rockchip_pdm.c +3 −1
  1291. sound/soc/soc-core.c +2 −1
  1292. sound/soc/soc-devres.c +37 −0
  1293. sound/soc/soc-generic-dmaengine-pcm.c +0 −12
  1294. sound/soc/soc-pcm.c +3 −3
  1295. sound/soc/soc-topology.c +1 −2
  1296. sound/soc/sof/intel/Kconfig +8 −21
  1297. sound/soc/sof/intel/hda-stream.c +7 −2
  1298. sound/soc/sof/sof-pci-dev.c +14 −10
  1299. sound/usb/card.h +3 −3
  1300. sound/usb/endpoint.c +9 −9
  1301. sound/usb/format.c +4 −2
  1302. sound/usb/line6/capture.c +2 −0
  1303. sound/usb/line6/driver.c +1 −1
  1304. sound/usb/line6/playback.c +2 −0
  1305. sound/usb/midi.c +12 −5
  1306. sound/usb/mixer.c +11 −4
  1307. sound/usb/mixer.h +7 −2
  1308. sound/usb/mixer_quirks.c +2 −1
  1309. sound/usb/pcm.c +3 −0
  1310. sound/usb/quirks-table.h +52 −0
  1311. sound/usb/quirks.c +10 −0
  1312. tools/arch/x86/include/uapi/asm/kvm.h +3 −2
  1313. tools/arch/x86/lib/memcpy_64.S +4 −0
  1314. tools/bpf/bpftool/Documentation/bpftool-map.rst +1 −1
  1315. tools/bpf/bpftool/map.c +2 −1
  1316. tools/include/linux/bits.h +1 −2
  1317. tools/include/uapi/linux/bpf.h +22 −21
  1318. tools/lib/bpf/bpf.h +2 −0
  1319. tools/lib/bpf/hashmap.h +8 −4
  1320. tools/lib/bpf/libbpf.c +8 −2
  1321. tools/lib/subcmd/parse-options.c +3 −0
  1322. tools/lib/traceevent/kbuffer-parse.c +37 −6
  1323. tools/lib/traceevent/kbuffer.h +2 −0
  1324. tools/objtool/arch.h +2 −0
  1325. tools/objtool/arch/x86/decode.c +18 −0
  1326. tools/objtool/arch/x86/include/arch_elf.h +6 −0
  1327. tools/objtool/check.c +50 −3
  1328. tools/objtool/elf.c +50 −3
  1329. tools/objtool/elf.h +9 −3
  1330. tools/objtool/orc_gen.c +1 −1
  1331. tools/perf/arch/x86/util/intel-pt.c +1 −0
  1332. tools/perf/builtin-record.c +9 −9
  1333. tools/perf/builtin-script.c +1 −1
  1334. tools/perf/scripts/python/export-to-postgresql.py +1 −1
  1335. tools/perf/scripts/python/exported-sql-viewer.py +9 −2
  1336. tools/perf/scripts/python/flamegraph.py +5 −3
  1337. tools/perf/ui/browsers/hists.c +29 −7
  1338. tools/perf/util/evlist.c +12 −0
  1339. tools/perf/util/evlist.h +1 −0
  1340. tools/perf/util/evsel.c +3 −9
  1341. tools/perf/util/evsel.h +6 −0
  1342. tools/perf/util/hashmap.h +8 −4
  1343. tools/perf/util/intel-pt.c +3 −2
  1344. tools/spi/spidev_test.c +5 −5
  1345. tools/testing/kunit/kunit.py +3 −1
  1346. tools/testing/kunit/kunit_config.py +1 −1
  1347. tools/testing/kunit/kunit_parser.py +4 −4
  1348. tools/testing/kunit/kunit_tool_test.py +11 −0
  1349. tools/testing/kunit/test_data/test_insufficient_memory.log +0 −0
  1350. tools/testing/selftests/arm64/signal/Makefile +0 −4
  1351. tools/testing/selftests/bpf/prog_tests/fentry_fexit.c +1 −1
  1352. tools/testing/selftests/bpf/prog_tests/flow_dissector.c +2 −2
  1353. tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach.c +34 −10
  1354. tools/testing/selftests/bpf/prog_tests/sockopt_sk.c +39 −7
  1355. tools/testing/selftests/bpf/progs/bpf_cubic.c +2 −3
  1356. tools/testing/selftests/bpf/progs/bpf_iter_netlink.c +1 −1
  1357. tools/testing/selftests/bpf/progs/fentry_test.c +22 −0
  1358. tools/testing/selftests/bpf/progs/fexit_test.c +22 −0
  1359. tools/testing/selftests/bpf/progs/sockopt_sk.c +52 −2
  1360. tools/testing/selftests/bpf/progs/test_sockmap_kern.h +7 −1
  1361. tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c +1 −1
  1362. tools/testing/selftests/bpf/test_maps.c +6 −6
  1363. tools/testing/selftests/bpf/test_sockmap.c +18 −0
  1364. tools/testing/selftests/kmod/kmod.sh +36 −0
  1365. tools/testing/selftests/kselftest.h +1 −1
  1366. tools/testing/selftests/net/fib_nexthops.sh +13 −0
  1367. tools/testing/selftests/net/so_txtime.c +26 −7
  1368. tools/testing/selftests/netfilter/Makefile +1 −1
  1369. tools/testing/selftests/netfilter/nft_conntrack_helper.sh +175 −0
  1370. tools/testing/selftests/pidfd/pidfd.h +5 −0
  1371. tools/testing/selftests/pidfd/pidfd_getfd_test.c +0 −5
  1372. tools/testing/selftests/pidfd/pidfd_setns_test.c +12 −0
  1373. tools/testing/selftests/powerpc/nx-gzip/gunz_test.c +2 −2
  1374. tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c +2 −2
  1375. tools/testing/selftests/powerpc/pmu/ebb/Makefile +1 −1
  1376. tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json +2 −2
  1377. tools/testing/selftests/tc-testing/tc-tests/actions/csum.json +2 −2
  1378. tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json +10 −10
  1379. tools/testing/selftests/tpm2/test_smoke.sh +4 −9
  1380. tools/testing/selftests/tpm2/test_space.sh +3 −3
  1381. tools/testing/selftests/tpm2/tpm2.py +29 −27
  1382. tools/testing/selftests/tpm2/tpm2_tests.py +20 −19
  1383. tools/testing/selftests/wireguard/netns.sh +12 −1
  1384. tools/testing/selftests/x86/Makefile +2 −2
  1385. tools/testing/selftests/x86/helpers.h +41 −0
  1386. tools/testing/selftests/x86/single_step_syscall.c +2 −15
  1387. tools/testing/selftests/x86/syscall_arg_fault.c +1 −20
  1388. tools/testing/selftests/x86/syscall_nt.c +28 −19
  1389. tools/testing/selftests/x86/test_vsyscall.c +2 −13
  1390. tools/testing/selftests/x86/unwind_vdso.c +2 −21
  1391. tools/virtio/linux/kernel.h +1 −6
  1392. tools/virtio/linux/virtio.h +2 −3
  1393. tools/virtio/virtio_test.c +119 −20
  1394. tools/virtio/vringh_test.c +2 −0
  1395. virt/kvm/kvm_main.c +2 −1
.gitignore+3−0
@@ -143,6 +143,9 @@ x509.genkey · 142 unmodified lines
143143 /allrandom.config
144144 /allyes.config
145145
146+# Kconfig savedefconfig output
147+/defconfig
148+
146149 # Kdevelop4
147150 *.kdev4
148151
.mailmap+5−0
@@ -90,11 +90,16 @@ Frank Rowand <frowand.list@gmail.com> <frank.rowand@sonymobile.com> · 89 unmodified lines
9090 Frank Zago <fzago@systemfabricworks.com>
9191 Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com>
9292 Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com>
93+Gerald Schaefer <gerald.schaefer@linux.ibm.com> <gerald.schaefer@de.ibm.com>
94+Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@de.ibm.com>
95+Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@linux.vnet.ibm.com>
9396 Greg Kroah-Hartman <greg@echidna.(none)>
9497 Greg Kroah-Hartman <gregkh@suse.de>
9598 Greg Kroah-Hartman <greg@kroah.com>
9699 Gregory CLEMENT <gregory.clement@bootlin.com> <gregory.clement@free-electrons.com>
97100 Hanjun Guo <guohanjun@huawei.com> <hanjun.guo@linaro.org>
101+Heiko Carstens <hca@linux.ibm.com> <h.carstens@de.ibm.com>
102+Heiko Carstens <hca@linux.ibm.com> <heiko.carstens@de.ibm.com>
98103 Henk Vergonet <Henk.Vergonet@gmail.com>
99104 Henrik Kretzschmar <henne@nachtwindheim.de>
100105 Henrik Rydberg <rydberg@bitmath.org>
Documentation/ABI/testing/dev-kmsg+0−5
@@ -56,11 +56,6 @@ Description: The /dev/kmsg character device node provides userspace access · 55 unmodified lines
5656 seek after the last record available at the time
5757 the last SYSLOG_ACTION_CLEAR was issued.
5858
59− Due to the record nature of this interface with a "read all"
60− behavior and the specific positions each seek operation sets,
61− SEEK_CUR is not supported, returning -ESPIPE (invalid seek) to
62− errno whenever requested.
63−
6459 The output format consists of a prefix carrying the syslog
6560 prefix including priority and facility, the 64 bit message
6661 sequence number and the monotonic timestamp in microseconds,
Documentation/ABI/testing/sysfs-platform-chipidea-usb-otg+4−4
@@ -1,6 +1,6 @@
11 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
22 Date: Feb 2014
3−Contact: Li Jun <b47624@freescale.com>
3+Contact: Li Jun <jun.li@nxp.com>
44 Description:
55 Can be set and read.
66 Set a_bus_req(A-device bus request) input to be 1 if
@@ -17,7 +17,7 @@ Description: · 10 unmodified lines
1717
1818 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop
1919 Date: Feb 2014
20−Contact: Li Jun <b47624@freescale.com>
20+Contact: Li Jun <jun.li@nxp.com>
2121 Description:
2222 Can be set and read
2323 The a_bus_drop(A-device bus drop) input is 1 when the
@@ -32,7 +32,7 @@ Description: · 8 unmodified lines
3232
3333 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
3434 Date: Feb 2014
35−Contact: Li Jun <b47624@freescale.com>
35+Contact: Li Jun <jun.li@nxp.com>
3636 Description:
3737 Can be set and read.
3838 The b_bus_req(B-device bus request) input is 1 during the time
@@ -47,7 +47,7 @@ Description: · 8 unmodified lines
4747
4848 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/a_clr_err
4949 Date: Feb 2014
50−Contact: Li Jun <b47624@freescale.com>
50+Contact: Li Jun <jun.li@nxp.com>
5151 Description:
5252 Only can be set.
5353 The a_clr_err(A-device Vbus error clear) input is used to clear
Documentation/admin-guide/README.rst+1−1
@@ -258,7 +258,7 @@ Configuring the kernel · 257 unmodified lines
258258 Compiling the kernel
259259 --------------------
260260
261− - Make sure you have at least gcc 4.6 available.
261+ - Make sure you have at least gcc 4.9 available.
262262 For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
263263
264264 Please note that you can still run a.out user programs with this kernel.
Documentation/admin-guide/cgroup-v2.rst+2−2
@@ -1356,8 +1356,8 @@ PAGE_SIZE multiple when read back. · 1355 unmodified lines
13561356
13571357 thp_fault_alloc
13581358 Number of transparent hugepages which were allocated to satisfy
1359− a page fault, including COW faults. This counter is not present
1360− when CONFIG_TRANSPARENT_HUGEPAGE is not set.
1359+ a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE
1360+ is not set.
13611361
13621362 thp_collapse_alloc
13631363 Number of transparent hugepages which were allocated to allow
Documentation/admin-guide/device-mapper/index.rst+1−0
@@ -11,6 +11,7 @@ Device Mapper · 10 unmodified lines
1111 dm-clone
1212 dm-crypt
1313 dm-dust
14+ dm-ebs
1415 dm-flakey
1516 dm-init
1617 dm-integrity
Documentation/admin-guide/mm/transhuge.rst+1−2
@@ -305,8 +305,7 @@ monitor how successfully the system is providing huge pages for use. · 304 unmodified lines
305305
306306 thp_fault_alloc
307307 is incremented every time a huge page is successfully
308− allocated to handle a page fault. This applies to both the
309− first time a page is faulted and for COW faults.
308+ allocated to handle a page fault.
310309
311310 thp_collapse_alloc
312311 is incremented by khugepaged when it has found
Documentation/arm64/cpu-feature-registers.rst+2−0
@@ -171,6 +171,7 @@ infrastructure: · 170 unmodified lines
171171
172172
173173 3) ID_AA64PFR1_EL1 - Processor Feature Register 1
174+
174175 +------------------------------+---------+---------+
175176 | Name | bits | visible |
176177 +------------------------------+---------+---------+
@@ -181,6 +182,7 @@ infrastructure: · 4 unmodified lines
181182
182183
183184 4) MIDR_EL1 - Main ID Register
185+
184186 +------------------------------+---------+---------+
185187 | Name | bits | visible |
186188 +------------------------------+---------+---------+
Documentation/arm64/silicon-errata.rst+8−0
@@ -147,6 +147,14 @@ stable kernels. · 146 unmodified lines
147147 +----------------+-----------------+-----------------+-----------------------------+
148148 | Qualcomm Tech. | Falkor v{1,2} | E1041 | QCOM_FALKOR_ERRATUM_1041 |
149149 +----------------+-----------------+-----------------+-----------------------------+
150+| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1463225 |
151++----------------+-----------------+-----------------+-----------------------------+
152+| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1418040 |
153++----------------+-----------------+-----------------+-----------------------------+
154+| Qualcomm Tech. | Kryo4xx Silver | N/A | ARM64_ERRATUM_1530923 |
155++----------------+-----------------+-----------------+-----------------------------+
156+| Qualcomm Tech. | Kryo4xx Silver | N/A | ARM64_ERRATUM_1024718 |
157++----------------+-----------------+-----------------+-----------------------------+
150158 +----------------+-----------------+-----------------+-----------------------------+
151159 | Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 |
152160 +----------------+-----------------+-----------------+-----------------------------+
Documentation/block/bfq-iosched.rst+1−8
@@ -492,13 +492,6 @@ set max_budget to higher values than those to which BFQ would have set · 491 unmodified lines
492492 it with auto-tuning. An alternative way to achieve this goal is to
493493 just increase the value of timeout_sync, leaving max_budget equal to 0.
494494
495−weights
496−-------
497−
498−Read-only parameter, used to show the weights of the currently active
499−BFQ queues.
500−
501−
502495 4. Group scheduling with BFQ
503496 ============================
504497
@@ -566,7 +559,7 @@ Parameters to set · 61 unmodified lines
566559 For each group, there is only the following parameter to set.
567560
568561 weight (namely blkio.bfq.weight or io.bfq-weight): the weight of the
569−group inside its parent. Available values: 1..10000 (default 100). The
562+group inside its parent. Available values: 1..1000 (default 100). The
570563 linear mapping between ioprio and weights, described at the beginning
571564 of the tunable section, is still valid, but all weights higher than
572565 IOPRIO_BE_NR*10 are mapped to ioprio 0.
Documentation/bpf/prog_cgroup_sockopt.rst+14−0
@@ -86,6 +86,20 @@ then the next program in the chain (A) will see those changes, · 85 unmodified lines
8686 *not* the original input ``setsockopt`` arguments. The potentially
8787 modified values will be then passed down to the kernel.
8888
89+Large optval
90+============
91+When the ``optval`` is greater than the ``PAGE_SIZE``, the BPF program
92+can access only the first ``PAGE_SIZE`` of that data. So it has to options:
93+
94+* Set ``optlen`` to zero, which indicates that the kernel should
95+ use the original buffer from the userspace. Any modifications
96+ done by the BPF program to the ``optval`` are ignored.
97+* Set ``optlen`` to the value less than ``PAGE_SIZE``, which
98+ indicates that the kernel should use BPF's trimmed ``optval``.
99+
100+When the BPF program returns with the ``optlen`` greater than
101+``PAGE_SIZE``, the userspace will receive ``EFAULT`` errno.
102+
89103 Example
90104 =======
91105
Documentation/core-api/dma-api.rst+8−0
@@ -204,6 +204,14 @@ Returns the maximum size of a mapping for the device. The size parameter · 203 unmodified lines
204204 of the mapping functions like dma_map_single(), dma_map_page() and
205205 others should not be larger than the returned value.
206206
207+::
208+
209+ bool
210+ dma_need_sync(struct device *dev, dma_addr_t dma_addr);
211+
212+Returns %true if dma_sync_single_for_{device,cpu} calls are required to
213+transfer memory ownership. Returns %false if those calls can be skipped.
214+
207215 ::
208216
209217 unsigned long
Documentation/core-api/pin_user_pages.rst+1−1
@@ -33,7 +33,7 @@ all combinations of get*(), pin*(), FOLL_LONGTERM, and more. Also, the · 32 unmodified lines
3333 pin_user_pages*() APIs are clearly distinct from the get_user_pages*() APIs, so
3434 that's a natural dividing line, and a good point to make separate wrapper calls.
3535 In other words, use pin_user_pages*() for DMA-pinned pages, and
36−get_user_pages*() for other cases. There are four cases described later on in
36+get_user_pages*() for other cases. There are five cases described later on in
3737 this document, to further clarify that concept.
3838
3939 FOLL_PIN and FOLL_GET are mutually exclusive for a given gup call. However,
Documentation/dev-tools/kcsan.rst+0−6
@@ -114,12 +114,6 @@ the below options are available: · 113 unmodified lines
114114 To dynamically limit for which functions to generate reports, see the
115115 `DebugFS interface`_ blacklist/whitelist feature.
116116
117− For ``__always_inline`` functions, replace ``__always_inline`` with
118− ``__no_kcsan_or_inline`` (which implies ``__always_inline``)::
119−
120− static __no_kcsan_or_inline void foo(void) {
121− ...
122−
123117 * To disable data race detection for a particular compilation unit, add to the
124118 ``Makefile``::
125119
Documentation/dev-tools/kunit/faq.rst+40−0
@@ -61,3 +61,43 @@ test, or an end-to-end test. · 60 unmodified lines
6161 kernel by installing a production configuration of the kernel on production
6262 hardware with a production userspace and then trying to exercise some behavior
6363 that depends on interactions between the hardware, the kernel, and userspace.
64+
65+KUnit isn't working, what should I do?
66+======================================
67+
68+Unfortunately, there are a number of things which can break, but here are some
69+things to try.
70+
71+1. Try running ``./tools/testing/kunit/kunit.py run`` with the ``--raw_output``
72+ parameter. This might show details or error messages hidden by the kunit_tool
73+ parser.
74+2. Instead of running ``kunit.py run``, try running ``kunit.py config``,
75+ ``kunit.py build``, and ``kunit.py exec`` independently. This can help track
76+ down where an issue is occurring. (If you think the parser is at fault, you
77+ can run it manually against stdin or a file with ``kunit.py parse``.)
78+3. Running the UML kernel directly can often reveal issues or error messages
79+ kunit_tool ignores. This should be as simple as running ``./vmlinux`` after
80+ building the UML kernel (e.g., by using ``kunit.py build``). Note that UML
81+ has some unusual requirements (such as the host having a tmpfs filesystem
82+ mounted), and has had issues in the past when built statically and the host
83+ has KASLR enabled. (On older host kernels, you may need to run ``setarch
84+ `uname -m` -R ./vmlinux`` to disable KASLR.)
85+4. Make sure the kernel .config has ``CONFIG_KUNIT=y`` and at least one test
86+ (e.g. ``CONFIG_KUNIT_EXAMPLE_TEST=y``). kunit_tool will keep its .config
87+ around, so you can see what config was used after running ``kunit.py run``.
88+ It also preserves any config changes you might make, so you can
89+ enable/disable things with ``make ARCH=um menuconfig`` or similar, and then
90+ re-run kunit_tool.
91+5. Try to run ``make ARCH=um defconfig`` before running ``kunit.py run``. This
92+ may help clean up any residual config items which could be causing problems.
93+6. Finally, try running KUnit outside UML. KUnit and KUnit tests can run be
94+ built into any kernel, or can be built as a module and loaded at runtime.
95+ Doing so should allow you to determine if UML is causing the issue you're
96+ seeing. When tests are built-in, they will execute when the kernel boots, and
97+ modules will automatically execute associated tests when loaded. Test results
98+ can be collected from ``/sys/kernel/debug/kunit/<test suite>/results``, and
99+ can be parsed with ``kunit.py parse``. For more details, see "KUnit on
100+ non-UML architectures" in :doc:`usage`.
101+
102+If none of the above tricks help, you are always welcome to email any issues to
103+kunit-dev@googlegroups.com.
Documentation/devicetree/bindings/Makefile+28−10
@@ -2,7 +2,6 @@ · 1 unmodified line
22 DT_DOC_CHECKER ?= dt-doc-validate
33 DT_EXTRACT_EX ?= dt-extract-example
44 DT_MK_SCHEMA ?= dt-mk-schema
5−DT_MK_SCHEMA_USERONLY_FLAG := $(if $(DT_SCHEMA_FILES), -u)
65
76 DT_SCHEMA_MIN_VERSION = 2020.5
87
@@ -35,21 +34,40 @@ quiet_cmd_mk_schema = SCHEMA $@ · 26 unmodified lines
3534
3635 DT_DOCS = $(shell $(find_cmd) | sed -e 's|^$(srctree)/||')
3736
38−DT_SCHEMA_FILES ?= $(DT_DOCS)
39−
40−extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
41−extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
42−extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml
43−
4437 override DTC_FLAGS := \
4538 -Wno-avoid_unnecessary_addr_size \
46− -Wno-graph_child_address
39+ -Wno-graph_child_address \
40+ -Wno-interrupt_provider
4741
4842 $(obj)/processed-schema-examples.yaml: $(DT_DOCS) check_dtschema_version FORCE
4943 $(call if_changed,mk_schema)
5044
51−$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := $(DT_MK_SCHEMA_USERONLY_FLAG)
45+ifeq ($(DT_SCHEMA_FILES),)
46+
47+# Unless DT_SCHEMA_FILES is specified, use the full schema for dtbs_check too.
48+# Just copy processed-schema-examples.yaml
49+
50+$(obj)/processed-schema.yaml: $(obj)/processed-schema-examples.yaml FORCE
51+ $(call if_changed,copy)
52+
53+DT_SCHEMA_FILES = $(DT_DOCS)
54+
55+else
56+
57+# If DT_SCHEMA_FILES is specified, use it for processed-schema.yaml
58+
59+$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u
5260 $(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) check_dtschema_version FORCE
5361 $(call if_changed,mk_schema)
5462
55−extra-y += processed-schema.yaml
63+endif
64+
65+extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
66+extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
67+extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml
68+extra-$(CHECK_DTBS) += processed-schema.yaml
69+
70+# Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of
71+# build artifacts here before they are processed by scripts/Makefile.clean
72+clean-files = $(shell find $(obj) \( -name '*.example.dts' -o \
73+ -name '*.example.dt.yaml' \) -delete 2>/dev/null)
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt+1−1
@@ -47,7 +47,7 @@ Required properties: · 46 unmodified lines
4747 &lsio_mu1 1 2
4848 &lsio_mu1 1 3
4949 &lsio_mu1 3 3>;
50− See Documentation/devicetree/bindings/mailbox/fsl,mu.txt
50+ See Documentation/devicetree/bindings/mailbox/fsl,mu.yaml
5151 for detailed mailbox binding.
5252
5353 Note: Each mu which supports general interrupt should have an alias correctly
Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml+2−2
@@ -80,14 +80,14 @@ examples: · 79 unmodified lines
8080 ranges = <1 0x00000000 0x42000000 0x02000000>,
8181 <5 0x00000000 0x46000000 0x01000000>;
8282
83− ethernet@1,01f00000 {
83+ ethernet@1,1f00000 {
8484 compatible = "smsc,lan9115";
8585 reg = <1 0x01f00000 0x1000>;
8686 interrupts = <0 48 4>;
8787 phy-mode = "mii";
8888 };
8989
90− uart@5,00200000 {
90+ serial@5,200000 {
9191 compatible = "ns16550a";
9292 reg = <5 0x00200000 0x20>;
9393 interrupts = <0 49 4>;
Documentation/devicetree/bindings/clock/imx27-clock.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Clock bindings for Freescale i.MX27
88
99 maintainers:
10− - Fabio Estevam <fabio.estevam@freescale.com>
10+ - Fabio Estevam <fabio.estevam@nxp.com>
1111
1212 description: |
1313 The clock consumer should specify the desired clock by having the clock
Documentation/devicetree/bindings/clock/imx31-clock.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Clock bindings for Freescale i.MX31
88
99 maintainers:
10− - Fabio Estevam <fabio.estevam@freescale.com>
10+ - Fabio Estevam <fabio.estevam@nxp.com>
1111
1212 description: |
1313 The clock consumer should specify the desired clock by having the clock
Documentation/devicetree/bindings/clock/imx5-clock.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Clock bindings for Freescale i.MX5
88
99 maintainers:
10− - Fabio Estevam <fabio.estevam@freescale.com>
10+ - Fabio Estevam <fabio.estevam@nxp.com>
1111
1212 description: |
1313 The clock consumer should specify the desired clock by having the clock
Documentation/devicetree/bindings/display/bridge/sii902x.txt+1−1
@@ -37,7 +37,7 @@ Optional properties: · 36 unmodified lines
3737 simple-card or audio-graph-card binding. See their binding
3838 documents on how to describe the way the sii902x device is
3939 connected to the rest of the audio system:
40− Documentation/devicetree/bindings/sound/simple-card.txt
40+ Documentation/devicetree/bindings/sound/simple-card.yaml
4141 Documentation/devicetree/bindings/sound/audio-graph-card.txt
4242 Note: In case of the audio-graph-card binding the used port
4343 index should be 3.
Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt+2−2
@@ -68,7 +68,7 @@ Required properties: · 67 unmodified lines
6868 datasheet
6969 - clocks : phandle to the PRE axi clock input, as described
7070 in Documentation/devicetree/bindings/clock/clock-bindings.txt and
71− Documentation/devicetree/bindings/clock/imx6q-clock.txt.
71+ Documentation/devicetree/bindings/clock/imx6q-clock.yaml.
7272 - clock-names: should be "axi"
7373 - interrupts: should contain the PRE interrupt
7474 - fsl,iram: phandle pointing to the mmio-sram device node, that should be
@@ -94,7 +94,7 @@ Required properties: · 19 unmodified lines
9494 datasheet
9595 - clocks : phandles to the PRG ipg and axi clock inputs, as described
9696 in Documentation/devicetree/bindings/clock/clock-bindings.txt and
97− Documentation/devicetree/bindings/clock/imx6q-clock.txt.
97+ Documentation/devicetree/bindings/clock/imx6q-clock.yaml.
9898 - clock-names: should be "ipg" and "axi"
9999 - fsl,pres: phandles to the PRE units attached to this PRG, with the fixed
100100 PRE as the first entry and the muxable PREs following.
Documentation/devicetree/bindings/display/imx/ldb.txt+2−2
@@ -30,8 +30,8 @@ Required properties: · 29 unmodified lines
3030 "di2_sel" - IPU2 DI0 mux
3131 "di3_sel" - IPU2 DI1 mux
3232 The needed clock numbers for each are documented in
33− Documentation/devicetree/bindings/clock/imx5-clock.txt, and in
34− Documentation/devicetree/bindings/clock/imx6q-clock.txt.
33+ Documentation/devicetree/bindings/clock/imx5-clock.yaml, and in
34+ Documentation/devicetree/bindings/clock/imx6q-clock.yaml.
3535
3636 Optional properties:
3737 - pinctrl-names : should be "default" on i.MX53, not used on i.MX6q
Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.yaml+1−1
@@ -33,7 +33,7 @@ additionalProperties: false · 32 unmodified lines
3333
3434 examples:
3535 - |
36− sysreg {
36+ sysreg@0 {
3737 compatible = "arm,versatile-sysreg", "syscon", "simple-mfd";
3838 reg = <0x00000 0x1000>;
3939
Documentation/devicetree/bindings/display/rockchip/rockchip-drm.yaml+1−1
@@ -24,7 +24,7 @@ properties: · 23 unmodified lines
2424 description: |
2525 Should contain a list of phandles pointing to display interface port
2626 of vop devices. vop definitions as defined in
27− Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt
27+ Documentation/devicetree/bindings/display/rockchip/rockchip-vop.yaml
2828
2929 required:
3030 - compatible
Documentation/devicetree/bindings/gpio/mediatek,mt7621-gpio.txt+1−1
@@ -12,7 +12,7 @@ Required properties for the top level node: · 11 unmodified lines
1212 Only the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
1313 - #interrupt-cells : Specifies the number of cells needed to encode an
1414 interrupt. Should be 2. The first cell defines the interrupt number,
15− the second encodes the triger flags encoded as described in
15+ the second encodes the trigger flags encoded as described in
1616 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
1717 - compatible:
1818 - "mediatek,mt7621-gpio" for Mediatek controllers
Documentation/devicetree/bindings/interrupt-controller/csky,mpintc.txt+1−1
@@ -10,7 +10,7 @@ Interrupt number definition: · 9 unmodified lines
1010 16-31 : private irq, and we use 16 as the co-processor timer.
1111 31-1024: common irq for soc ip.
1212
13−Interrupt triger mode: (Defined in dt-bindings/interrupt-controller/irq.h)
13+Interrupt trigger mode: (Defined in dt-bindings/interrupt-controller/irq.h)
1414 IRQ_TYPE_LEVEL_HIGH (default)
1515 IRQ_TYPE_LEVEL_LOW
1616 IRQ_TYPE_EDGE_RISING
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt+1−1
@@ -87,7 +87,7 @@ Example: · 86 unmodified lines
8787 ranges;
8888
8989 /* APU<->RPU0 IPI mailbox controller */
90− ipi_mailbox_rpu0: mailbox@ff90400 {
90+ ipi_mailbox_rpu0: mailbox@ff990400 {
9191 reg = <0xff990400 0x20>,
9292 <0xff990420 0x20>,
9393 <0xff990080 0x20>,
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.txt+1−1
@@ -8,7 +8,7 @@ The embedded controller requires the SPI controller driver to signal readiness · 7 unmodified lines
88 to receive a transfer (that is, when TX FIFO contains the response data) by
99 strobing the ACK pin with the ready signal. See the "ready-gpios" property of the
1010 SSP binding as documented in:
11−<Documentation/devicetree/bindings/spi/spi-pxa2xx.txt>.
11+<Documentation/devicetree/bindings/spi/marvell,mmp2-ssp.yaml>.
1212
1313 Example:
1414 &ssp3 {
Documentation/devicetree/bindings/net/mediatek-bluetooth.txt+1−1
@@ -3,7 +3,7 @@ MediaTek SoC built-in Bluetooth Devices · 2 unmodified lines
33
44 This device is a serial attached device to BTIF device and thus it must be a
55 child node of the serial node with BTIF. The dt-bindings details for BTIF
6−device can be known via Documentation/devicetree/bindings/serial/8250.txt.
6+device can be known via Documentation/devicetree/bindings/serial/8250.yaml.
77
88 Required properties:
99
Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt+1−1
@@ -114,7 +114,7 @@ with values derived from the SoC user manual. · 113 unmodified lines
114114 [flags]>
115115
116116 On other mach-shmobile platforms GPIO is handled by the gpio-rcar driver.
117−Please refer to Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
117+Please refer to Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
118118 for documentation of the GPIO device tree bindings on those platforms.
119119
120120
Documentation/devicetree/bindings/sound/audio-graph-card.txt+1−1
@@ -5,7 +5,7 @@ It is based on common bindings for device graphs. · 4 unmodified lines
55 see ${LINUX}/Documentation/devicetree/bindings/graph.txt
66
77 Basically, Audio Graph Card property is same as Simple Card.
8−see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.txt
8+see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.yaml
99
1010 Below are same as Simple-Card.
1111
Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt+1−1
@@ -5,7 +5,7 @@ codec or external codecs. · 4 unmodified lines
55
66 sti sound drivers allows to expose sti SoC audio interface through the
77 generic ASoC simple card. For details about sound card declaration please refer to
8−Documentation/devicetree/bindings/sound/simple-card.txt.
8+Documentation/devicetree/bindings/sound/simple-card.yaml.
99
1010 1) sti-uniperiph-dai: audio dai device.
1111 ---------------------------------------
Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml+17−9
@@ -34,12 +34,15 @@ properties: · 33 unmodified lines
3434 maxItems: 1
3535
3636 clocks:
37− maxItems: 1
37+ minItems: 1
38+ maxItems: 2
39+ items:
40+ - description: controller register bus clock
41+ - description: baud rate generator and delay control clock
3842
3943 clock-names:
40− description: input clock for the baud rate generator
41− items:
42− - const: core
44+ minItems: 1
45+ maxItems: 2
4346
4447 if:
4548 properties:
@@ -51,17 +54,22 @@ if: · 5 unmodified lines
5154 then:
5255 properties:
5356 clocks:
54− contains:
55− items:
56− - description: controller register bus clock
57− - description: baud rate generator and delay control clock
57+ minItems: 2
5858
5959 clock-names:
60− minItems: 2
6160 items:
6261 - const: core
6362 - const: pclk
6463
64+else:
65+ properties:
66+ clocks:
67+ maxItems: 1
68+
69+ clock-names:
70+ items:
71+ - const: core
72+
6573 required:
6674 - compatible
6775 - reg
Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.txt+1−1
@@ -19,7 +19,7 @@ Required properties: · 18 unmodified lines
1919
2020 SPI Controller nodes must be child of GENI based Qualcomm Universal
2121 Peripharal. Please refer GENI based QUP wrapper controller node bindings
22−described in Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt.
22+described in Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml.
2323
2424 SPI slave nodes must be children of the SPI master node and conform to SPI bus
2525 binding as described in Documentation/devicetree/bindings/spi/spi-bus.txt.
Documentation/devicetree/bindings/thermal/thermal-sensor.yaml+1−1
@@ -41,7 +41,7 @@ examples: · 40 unmodified lines
4141 #include <dt-bindings/interrupt-controller/arm-gic.h>
4242
4343 // Example 1: SDM845 TSENS
44− soc: soc@0 {
44+ soc: soc {
4545 #address-cells = <2>;
4646 #size-cells = <2>;
4747
Documentation/devicetree/bindings/thermal/thermal-zones.yaml+1−1
@@ -224,7 +224,7 @@ examples: · 223 unmodified lines
224224 #include <dt-bindings/thermal/thermal.h>
225225
226226 // Example 1: SDM845 TSENS
227− soc: soc@0 {
227+ soc {
228228 #address-cells = <2>;
229229 #size-cells = <2>;
230230
Documentation/devicetree/bindings/thermal/ti,am654-thermal.yaml+1−1
@@ -35,7 +35,7 @@ examples: · 34 unmodified lines
3535 #include <dt-bindings/soc/ti,sci_pm_domain.h>
3636 vtm: thermal@42050000 {
3737 compatible = "ti,am654-vtm";
38− reg = <0x0 0x42050000 0x0 0x25c>;
38+ reg = <0x42050000 0x25c>;
3939 power-domains = <&k3_pds 80 TI_SCI_PD_EXCLUSIVE>;
4040 #thermal-sensor-cells = <1>;
4141 };
Documentation/devicetree/bindings/timer/csky,mptimer.txt+1−1
@@ -8,7 +8,7 @@ regs is accessed by cpu co-processor 4 registers with mtcr/mfcr. · 7 unmodified lines
88 - PTIM_CTLR "cr<0, 14>" Control reg to start reset timer.
99 - PTIM_TSR "cr<1, 14>" Interrupt cleanup status reg.
1010 - PTIM_CCVR "cr<3, 14>" Current counter value reg.
11− - PTIM_LVR "cr<6, 14>" Window value reg to triger next event.
11+ - PTIM_LVR "cr<6, 14>" Window value reg to trigger next event.
1212
1313 ==============================
1414 timer node bindings definition
Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml+2−2
@@ -127,8 +127,8 @@ examples: · 126 unmodified lines
127127 #address-cells = <1>;
128128 #size-cells = <0>;
129129
130− string@0409 {
131− reg = <0x0409>;
130+ string@409 {
131+ reg = <0x409>;
132132 manufacturer = "ASPEED";
133133 product = "USB Virtual Hub";
134134 serial-number = "0000";
Documentation/devicetree/writing-schema.rst+6−3
@@ -1,4 +1,4 @@
1−:orphan:
1+.. SPDX-License-Identifier: GPL-2.0
22
33 Writing DeviceTree Bindings in json-schema
44 ==========================================
@@ -124,9 +124,12 @@ dtc must also be built with YAML output support enabled. This requires that · 119 unmodified lines
124124 libyaml and its headers be installed on the host system. For some distributions
125125 that involves installing the development package, such as:
126126
127−Debian:
127+Debian::
128+
128129 apt-get install libyaml-dev
129−Fedora:
130+
131+Fedora::
132+
130133 dnf -y install libyaml-devel
131134
132135 Running checks
Documentation/filesystems/overlayfs.rst+2−2
@@ -560,8 +560,8 @@ When the NFS export feature is enabled, all directory index entries are · 559 unmodified lines
560560 verified on mount time to check that upper file handles are not stale.
561561 This verification may cause significant overhead in some cases.
562562
563−Note: the mount options index=off,nfs_export=on are conflicting and will
564−result in an error.
563+Note: the mount options index=off,nfs_export=on are conflicting for a
564+read-write mount and will result in an error.
565565
566566
567567 Testsuite
Documentation/i2c/slave-eeprom-backend.rst+17−5
@@ -1,14 +1,26 @@
11 ==============================
2−Linux I2C slave eeprom backend
2+Linux I2C slave EEPROM backend
33 ==============================
44
5−by Wolfram Sang <wsa@sang-engineering.com> in 2014-15
5+by Wolfram Sang <wsa@sang-engineering.com> in 2014-20
66
7−This is a proof-of-concept backend which acts like an EEPROM on the connected
8−I2C bus. The memory contents can be modified from userspace via this file
9−located in sysfs::
7+This backend simulates an EEPROM on the connected I2C bus. Its memory contents
8+can be accessed from userspace via this file located in sysfs::
109
1110 /sys/bus/i2c/devices/<device-directory>/slave-eeprom
1211
12+The following types are available: 24c02, 24c32, 24c64, and 24c512. Read-only
13+variants are also supported. The name needed for instantiating has the form
14+'slave-<type>[ro]'. Examples follow:
15+
16+24c02, read/write, address 0x64:
17+ # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device
18+
19+24c512, read-only, address 0x42:
20+ # echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device
21+
22+You can also preload data during boot if a device-property named
23+'firmware-name' contains a valid filename (DT or ACPI only).
24+
1325 As of 2015, Linux doesn't support poll on binary sysfs files, so there is no
1426 notification when another master changed the content.
Documentation/kbuild/modules.rst+4−3
@@ -182,7 +182,8 @@ module 8123.ko, which is built from the following files:: · 181 unmodified lines
182182 8123_pci.c
183183 8123_bin.o_shipped <= Binary blob
184184
185−--- 3.1 Shared Makefile
185+3.1 Shared Makefile
186+-------------------
186187
187188 An external module always includes a wrapper makefile that
188189 supports building the module using "make" with no arguments.
@@ -470,9 +471,9 @@ build. · 281 unmodified lines
470471
471472 The syntax of the Module.symvers file is::
472473
473− <CRC> <Symbol> <Module> <Export Type> <Namespace>
474+ <CRC> <Symbol> <Module> <Export Type> <Namespace>
474475
475− 0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
476+ 0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
476477
477478 The fields are separated by tabs and values may be empty (e.g.
478479 if no namespace is defined for an exported symbol).
Documentation/kbuild/reproducible-builds.rst+1−1
@@ -101,7 +101,7 @@ Structure randomisation · 100 unmodified lines
101101
102102 If you enable ``CONFIG_GCC_PLUGIN_RANDSTRUCT``, you will need to
103103 pre-generate the random seed in
104−``scripts/gcc-plgins/randomize_layout_seed.h`` so the same value
104+``scripts/gcc-plugins/randomize_layout_seed.h`` so the same value
105105 is used in rebuilds.
106106
107107 Debug info conflicts
Documentation/mips/ingenic-tcu.rst+1−1
@@ -68,4 +68,4 @@ and frameworks can be controlled from the same registers, all of these · 67 unmodified lines
6868 drivers access their registers through the same regmap.
6969
7070 For more information regarding the devicetree bindings of the TCU drivers,
71−have a look at Documentation/devicetree/bindings/timer/ingenic,tcu.txt.
71+have a look at Documentation/devicetree/bindings/timer/ingenic,tcu.yaml.
Documentation/networking/arcnet.rst+1−1
@@ -434,7 +434,7 @@ can set up your network then: · 433 unmodified lines
434434 ifconfig arc0 insight
435435 route add insight arc0
436436 route add freedom arc0 /* I would use the subnet here (like I said
437− to to in "single protocol" above),
437+ to in "single protocol" above),
438438 but the rest of the subnet
439439 unfortunately lies across the PPP
440440 link on freedom, which confuses
Documentation/networking/ax25.rst+1−1
@@ -6,7 +6,7 @@ AX.25 · 5 unmodified lines
66
77 To use the amateur radio protocols within Linux you will need to get a
88 suitable copy of the AX.25 Utilities. More detailed information about
9−AX.25, NET/ROM and ROSE, associated programs and and utilities can be
9+AX.25, NET/ROM and ROSE, associated programs and utilities can be
1010 found on http://www.linux-ax25.org.
1111
1212 There is an active mailing list for discussing Linux amateur radio matters
Documentation/networking/can_ucan_protocol.rst+2−2
@@ -144,7 +144,7 @@ UCAN_COMMAND_SET_BITTIMING · 143 unmodified lines
144144
145145 *Host2Dev; mandatory*
146146
147−Setup bittiming by sending the the structure
147+Setup bittiming by sending the structure
148148 ``ucan_ctl_payload_t.cmd_set_bittiming`` (see ``struct bittiming`` for
149149 details)
150150
@@ -232,7 +232,7 @@ UCAN_IN_TX_COMPLETE · 81 unmodified lines
232232 zero
233233
234234 The CAN device has sent a message to the CAN bus. It answers with a
235−list of of tuples <echo-ids, flags>.
235+list of tuples <echo-ids, flags>.
236236
237237 The echo-id identifies the frame from (echos the id from a previous
238238 UCAN_OUT_TX message). The flag indicates the result of the
Documentation/networking/dsa/dsa.rst+1−1
@@ -95,7 +95,7 @@ Ethernet switch. · 94 unmodified lines
9595 Networking stack hooks
9696 ----------------------
9797
98−When a master netdev is used with DSA, a small hook is placed in in the
98+When a master netdev is used with DSA, a small hook is placed in the
9999 networking stack is in order to have the DSA subsystem process the Ethernet
100100 switch specific tagging protocol. DSA accomplishes this by registering a
101101 specific (and fake) Ethernet type (later becoming ``skb->protocol``) with the
Documentation/networking/ieee802154.rst+2−2
@@ -30,8 +30,8 @@ Socket API · 29 unmodified lines
3030
3131 The address family, socket addresses etc. are defined in the
3232 include/net/af_ieee802154.h header or in the special header
33−in the userspace package (see either http://wpan.cakelab.org/ or the
34−git tree at https://github.com/linux-wpan/wpan-tools).
33+in the userspace package (see either https://linux-wpan.org/wpan-tools.html
34+or the git tree at https://github.com/linux-wpan/wpan-tools).
3535
3636 6LoWPAN Linux implementation
3737 ============================
Documentation/networking/ip-sysctl.rst+1−1
@@ -741,7 +741,7 @@ tcp_fastopen - INTEGER · 740 unmodified lines
741741
742742 Default: 0x1
743743
744− Note that that additional client or server features are only
744+ Note that additional client or server features are only
745745 effective if the basic support (0x1 and 0x2) are enabled respectively.
746746
747747 tcp_fastopen_blackhole_timeout_sec - INTEGER
Documentation/networking/ipvs-sysctl.rst+1−1
@@ -114,7 +114,7 @@ drop_entry - INTEGER · 113 unmodified lines
114114 modes (when there is no enough available memory, the strategy
115115 is enabled and the variable is automatically set to 2,
116116 otherwise the strategy is disabled and the variable is set to
117− 1), and 3 means that that the strategy is always enabled.
117+ 1), and 3 means that the strategy is always enabled.
118118
119119 drop_packet - INTEGER
120120 - 0 - disabled (default)
Documentation/networking/rxrpc.rst+1−1
@@ -186,7 +186,7 @@ About the AF_RXRPC driver: · 185 unmodified lines
186186 time [tunable] after the last connection using it discarded, in case a new
187187 connection is made that could use it.
188188
189− (#) A client-side connection is only shared between calls if they have have
189+ (#) A client-side connection is only shared between calls if they have
190190 the same key struct describing their security (and assuming the calls
191191 would otherwise share the connection). Non-secured calls would also be
192192 able to share connections with each other.
Documentation/powerpc/vas-api.rst+1−1
@@ -213,7 +213,7 @@ request buffers are not in memory. The operating system handles the fault by · 212 unmodified lines
213213 updating CSB with the following data:
214214
215215 csb.flags = CSB_V;
216− csb.cc = CSB_CC_TRANSLATION;
216+ csb.cc = CSB_CC_FAULT_ADDRESS;
217217 csb.ce = CSB_CE_TERMINATION;
218218 csb.address = fault_address;
219219
Documentation/process/changes.rst+1−1
@@ -29,7 +29,7 @@ you probably needn't concern yourself with pcmciautils. · 28 unmodified lines
2929 ====================== =============== ========================================
3030 Program Minimal version Command to check the version
3131 ====================== =============== ========================================
32−GNU C 4.8 gcc --version
32+GNU C 4.9 gcc --version
3333 GNU make 3.81 make --version
3434 binutils 2.23 ld -v
3535 flex 2.5.35 flex --version
Documentation/process/coding-style.rst+20−0
@@ -319,6 +319,26 @@ If you are afraid to mix up your local variable names, you have another · 318 unmodified lines
319319 problem, which is called the function-growth-hormone-imbalance syndrome.
320320 See chapter 6 (Functions).
321321
322+For symbol names and documentation, avoid introducing new usage of
323+'master / slave' (or 'slave' independent of 'master') and 'blacklist /
324+whitelist'.
325+
326+Recommended replacements for 'master / slave' are:
327+ '{primary,main} / {secondary,replica,subordinate}'
328+ '{initiator,requester} / {target,responder}'
329+ '{controller,host} / {device,worker,proxy}'
330+ 'leader / follower'
331+ 'director / performer'
332+
333+Recommended replacements for 'blacklist/whitelist' are:
334+ 'denylist / allowlist'
335+ 'blocklist / passlist'
336+
337+Exceptions for introducing new usage is to maintain a userspace ABI/API,
338+or when updating code for an existing (as of 2020) hardware or protocol
339+specification that mandates those terms. For new specifications
340+translate specification usage of the terminology to the kernel coding
341+standard where possible.
322342
323343 5) Typedefs
324344 -----------
Documentation/virt/kvm/api.rst+3−2
@@ -4339,14 +4339,15 @@ Errors: · 4338 unmodified lines
43394339 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
43404340
43414341 struct kvm_vmx_nested_state_hdr {
4342− __u32 flags;
43434342 __u64 vmxon_pa;
43444343 __u64 vmcs12_pa;
4345− __u64 preemption_timer_deadline;
43464344
43474345 struct {
43484346 __u16 flags;
43494347 } smm;
4348+
4349+ __u32 flags;
4350+ __u64 preemption_timer_deadline;
43504351 };
43514352
43524353 struct kvm_vmx_nested_state_data {
MAINTAINERS+20−18
@@ -2929,6 +2929,7 @@ F: include/uapi/linux/atm* · 2928 unmodified lines
29292929
29302930 ATMEL MACB ETHERNET DRIVER
29312931 M: Nicolas Ferre <nicolas.ferre@microchip.com>
2932+M: Claudiu Beznea <claudiu.beznea@microchip.com>
29322933 S: Supported
29332934 F: drivers/net/ethernet/cadence/
29342935
@@ -3306,7 +3307,7 @@ X: arch/riscv/net/bpf_jit_comp32.c · 371 unmodified lines
33063307
33073308 BPF JIT for S390
33083309 M: Ilya Leoshkevich <iii@linux.ibm.com>
3309−M: Heiko Carstens <heiko.carstens@de.ibm.com>
3310+M: Heiko Carstens <hca@linux.ibm.com>
33103311 M: Vasily Gorbik <gor@linux.ibm.com>
33113312 L: netdev@vger.kernel.org
33123313 L: bpf@vger.kernel.org
@@ -3946,7 +3947,7 @@ L: linux-crypto@vger.kernel.org · 633 unmodified lines
39463947 S: Supported
39473948 F: drivers/char/hw_random/cctrng.c
39483949 F: drivers/char/hw_random/cctrng.h
3949−F: Documentation/devicetree/bindings/rng/arm-cctrng.txt
3950+F: Documentation/devicetree/bindings/rng/arm-cctrng.yaml
39503951 W: https://developer.arm.com/products/system-ip/trustzone-cryptocell/cryptocell-700-family
39513952
39523953 CEC FRAMEWORK
@@ -5021,7 +5022,6 @@ F: drivers/mfd/da91??-*.c · 1068 unmodified lines
50215022 F: drivers/pinctrl/pinctrl-da90??.c
50225023 F: drivers/power/supply/da9052-battery.c
50235024 F: drivers/power/supply/da91??-*.c
5024−F: drivers/regulator/da903x.c
50255025 F: drivers/regulator/da9???-regulator.[ch]
50265026 F: drivers/regulator/slg51000-regulator.[ch]
50275027 F: drivers/rtc/rtc-da90??.c
@@ -5111,7 +5111,7 @@ M: Vinod Koul <vkoul@kernel.org> · 83 unmodified lines
51115111 L: dmaengine@vger.kernel.org
51125112 S: Maintained
51135113 Q: https://patchwork.kernel.org/project/linux-dmaengine/list/
5114−T: git git://git.infradead.org/users/vkoul/slave-dma.git
5114+T: git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git
51155115 F: Documentation/devicetree/bindings/dma/
51165116 F: Documentation/driver-api/dmaengine/
51175117 F: drivers/dma/
@@ -5490,7 +5490,7 @@ F: include/uapi/drm/r128_drm.h · 372 unmodified lines
54905490 DRM DRIVER FOR RAYDIUM RM67191 PANELS
54915491 M: Robert Chiras <robert.chiras@nxp.com>
54925492 S: Maintained
5493−F: Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
5493+F: Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml
54945494 F: drivers/gpu/drm/panel/panel-raydium-rm67191.c
54955495
54965496 DRM DRIVER FOR ROCKTECH JH057N00900 PANELS
@@ -8333,7 +8333,7 @@ M: Alexander Aring <alex.aring@gmail.com> · 2836 unmodified lines
83338333 M: Stefan Schmidt <stefan@datenfreihafen.org>
83348334 L: linux-wpan@vger.kernel.org
83358335 S: Maintained
8336−W: http://wpan.cakelab.org/
8336+W: https://linux-wpan.org/
83378337 T: git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
83388338 T: git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next.git
83398339 F: Documentation/networking/ieee802154.rst
@@ -10808,7 +10808,7 @@ F: Documentation/devicetree/bindings/dma/mtk-* · 2468 unmodified lines
1080810808 F: drivers/dma/mediatek/
1080910809
1081010810 MEDIATEK ETHERNET DRIVER
10811−M: Felix Fietkau <nbd@openwrt.org>
10811+M: Felix Fietkau <nbd@nbd.name>
1081210812 M: John Crispin <john@phrozen.org>
1081310813 M: Sean Wang <sean.wang@mediatek.com>
1081410814 M: Mark Lee <Mark-MC.Lee@mediatek.com>
@@ -12695,13 +12695,13 @@ F: arch/mips/boot/dts/ralink/omega2p.dts · 1880 unmodified lines
1269512695
1269612696 OP-TEE DRIVER
1269712697 M: Jens Wiklander <jens.wiklander@linaro.org>
12698−L: tee-dev@lists.linaro.org
12698+L: op-tee@lists.trustedfirmware.org
1269912699 S: Maintained
1270012700 F: drivers/tee/optee/
1270112701
1270212702 OP-TEE RANDOM NUMBER GENERATOR (RNG) DRIVER
1270312703 M: Sumit Garg <sumit.garg@linaro.org>
12704−L: tee-dev@lists.linaro.org
12704+L: op-tee@lists.trustedfirmware.org
1270512705 S: Maintained
1270612706 F: drivers/char/hw_random/optee-rng.c
1270712707
@@ -14574,8 +14574,8 @@ RENESAS R-CAR THERMAL DRIVERS · 1866 unmodified lines
1457414574 M: Niklas Söderlund <niklas.soderlund@ragnatech.se>
1457514575 L: linux-renesas-soc@vger.kernel.org
1457614576 S: Supported
14577−F: Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
14578−F: Documentation/devicetree/bindings/thermal/rcar-thermal.txt
14577+F: Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
14578+F: Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
1457914579 F: drivers/thermal/rcar_gen3_thermal.c
1458014580 F: drivers/thermal/rcar_thermal.c
1458114581
@@ -14831,7 +14831,7 @@ S: Maintained · 249 unmodified lines
1483114831 F: drivers/video/fbdev/savage/
1483214832
1483314833 S390
14834−M: Heiko Carstens <heiko.carstens@de.ibm.com>
14834+M: Heiko Carstens <hca@linux.ibm.com>
1483514835 M: Vasily Gorbik <gor@linux.ibm.com>
1483614836 M: Christian Borntraeger <borntraeger@de.ibm.com>
1483714837 L: linux-s390@vger.kernel.org
@@ -14862,7 +14862,7 @@ F: drivers/s390/block/dasd* · 24 unmodified lines
1486214862 F: include/linux/dasd_mod.h
1486314863
1486414864 S390 IOMMU (PCI)
14865−M: Gerald Schaefer <gerald.schaefer@de.ibm.com>
14865+M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
1486614866 L: linux-s390@vger.kernel.org
1486714867 S: Supported
1486814868 W: http://www.ibm.com/developerworks/linux/linux390/
@@ -14890,7 +14890,7 @@ F: drivers/s390/net/ · 21 unmodified lines
1489014890
1489114891 S390 PCI SUBSYSTEM
1489214892 M: Niklas Schnelle <schnelle@linux.ibm.com>
14893−M: Gerald Schaefer <gerald.schaefer@de.ibm.com>
14893+M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
1489414894 L: linux-s390@vger.kernel.org
1489514895 S: Supported
1489614896 W: http://www.ibm.com/developerworks/linux/linux390/
@@ -16058,8 +16058,10 @@ SPARSE CHECKER · 1161 unmodified lines
1605816058 M: "Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>
1605916059 L: linux-sparse@vger.kernel.org
1606016060 S: Maintained
16061−W: https://sparse.wiki.kernel.org/
16061+W: https://sparse.docs.kernel.org/
1606216062 T: git git://git.kernel.org/pub/scm/devel/sparse/sparse.git
16063+Q: https://patchwork.kernel.org/project/linux-sparse/list/
16064+B: https://bugzilla.kernel.org/enter_bug.cgi?component=Sparse&product=Tools
1606316065 F: include/linux/compiler.h
1606416066
1606516067 SPEAR CLOCK FRAMEWORK SUPPORT
@@ -16772,7 +16774,7 @@ F: include/media/i2c/tw9910.h · 706 unmodified lines
1677216774
1677316775 TEE SUBSYSTEM
1677416776 M: Jens Wiklander <jens.wiklander@linaro.org>
16775−L: tee-dev@lists.linaro.org
16777+L: op-tee@lists.trustedfirmware.org
1677616778 S: Maintained
1677716779 F: Documentation/tee.txt
1677816780 F: drivers/tee/
@@ -17511,7 +17513,7 @@ F: Documentation/admin-guide/ufs.rst · 732 unmodified lines
1751117513 F: fs/ufs/
1751217514
1751317515 UHID USERSPACE HID IO DRIVER
17514−M: David Herrmann <dh.herrmann@googlemail.com>
17516+M: David Rheinsberg <david.rheinsberg@gmail.com>
1751517517 L: linux-input@vger.kernel.org
1751617518 S: Maintained
1751717519 F: drivers/hid/uhid.c
@@ -18470,7 +18472,7 @@ S: Maintained · 952 unmodified lines
1847018472 F: drivers/rtc/rtc-sd3078.c
1847118473
1847218474 WIIMOTE HID DRIVER
18473−M: David Herrmann <dh.herrmann@googlemail.com>
18475+M: David Rheinsberg <david.rheinsberg@gmail.com>
1847418476 L: linux-input@vger.kernel.org
1847518477 S: Maintained
1847618478 F: drivers/hid/hid-wiimote*
Makefile+3−3
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 8
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
5+EXTRAVERSION = -rc6
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
@@ -970,8 +970,8 @@ LDFLAGS_vmlinux += --pack-dyn-relocs=relr · 961 unmodified lines
970970 endif
971971
972972 # Align the bit size of userspace programs with the kernel
973−KBUILD_USERCFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
974−KBUILD_USERLDFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
973+KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
974+KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
975975
976976 # make the checker run with the right architecture
977977 CHECKFLAGS += --arch=$(ARCH)
arch/arc/Kconfig+15−0
@@ -170,6 +170,15 @@ config ARC_CPU_HS · 169 unmodified lines
170170
171171 endchoice
172172
173+config ARC_TUNE_MCPU
174+ string "Override default -mcpu compiler flag"
175+ default ""
176+ help
177+ Override default -mcpu=xxx compiler flag (which is set depending on
178+ the ISA version) with the specified value.
179+ NOTE: If specified flag isn't supported by current compiler the
180+ ISA default value will be used as a fallback.
181+
173182 config CPU_BIG_ENDIAN
174183 bool "Enable Big Endian Mode"
175184 help
@@ -465,6 +474,12 @@ config ARC_IRQ_NO_AUTOSAVE · 289 unmodified lines
465474 This is programmable and can be optionally disabled in which case
466475 software INTERRUPT_PROLOGUE/EPILGUE do the needed work
467476
477+config ARC_LPB_DISABLE
478+ bool "Disable loop buffer (LPB)"
479+ help
480+ On HS cores, loop buffer (LPB) is programmable in runtime and can
481+ be optionally disabled.
482+
468483 endif # ISA_ARCV2
469484
470485 endmenu # "ARC CPU Configuration"
arch/arc/Makefile+19−2
@@ -10,8 +10,25 @@ CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-) · 9 unmodified lines
1010 endif
1111
1212 cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
13−cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
14−cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs38
13+
14+tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT) := -mcpu=arc700
15+tune-mcpu-def-$(CONFIG_ISA_ARCV2) := -mcpu=hs38
16+
17+ifeq ($(CONFIG_ARC_TUNE_MCPU),"")
18+cflags-y += $(tune-mcpu-def-y)
19+else
20+tune-mcpu := $(shell echo $(CONFIG_ARC_TUNE_MCPU))
21+tune-mcpu-ok := $(call cc-option-yn, $(tune-mcpu))
22+ifeq ($(tune-mcpu-ok),y)
23+cflags-y += $(tune-mcpu)
24+else
25+# The flag provided by 'CONFIG_ARC_TUNE_MCPU' option isn't known by this compiler
26+# (probably the compiler is too old). Use ISA default mcpu flag instead as a safe option.
27+$(warning ** WARNING ** CONFIG_ARC_TUNE_MCPU flag '$(tune-mcpu)' is unknown, fallback to '$(tune-mcpu-def-y)')
28+cflags-y += $(tune-mcpu-def-y)
29+endif
30+endif
31+
1532
1633 ifdef CONFIG_ARC_CURR_IN_REG
1734 # For a global register defintion, make sure it gets passed to every file
arch/arc/include/asm/elf.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #define R_ARC_32_PCREL 0x31
2020
2121 /*to set parameters in the core dumps */
22−#define ELF_ARCH EM_ARCOMPACT
22+#define ELF_ARCH EM_ARC_INUSE
2323 #define ELF_CLASS ELFCLASS32
2424
2525 #ifdef CONFIG_CPU_BIG_ENDIAN
arch/arc/include/asm/irqflags-compact.h+4−1
@@ -90,6 +90,9 @@ static inline void arch_local_irq_restore(unsigned long flags) · 89 unmodified lines
9090 /*
9191 * Unconditionally Enable IRQs
9292 */
93+#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS
94+extern void arch_local_irq_enable(void);
95+#else
9396 static inline void arch_local_irq_enable(void)
9497 {
9598 unsigned long temp;
@@ -102,7 +105,7 @@ static inline void arch_local_irq_enable(void) · 6 unmodified lines
102105 : "n"((STATUS_E1_MASK | STATUS_E2_MASK))
103106 : "cc", "memory");
104107 }
105−
108+#endif
106109
107110 /*
108111 * Unconditionally Disable IRQs
arch/arc/kernel/entry.S+5−11
@@ -165,7 +165,6 @@ END(EV_Extension) · 164 unmodified lines
165165 tracesys:
166166 ; save EFA in case tracer wants the PC of traced task
167167 ; using ERET won't work since next-PC has already committed
168− lr r12, [efa]
169168 GET_CURR_TASK_FIELD_PTR TASK_THREAD, r11
170169 st r12, [r11, THREAD_FAULT_ADDR] ; thread.fault_address
171170
@@ -208,15 +207,9 @@ tracesys_exit: · 36 unmodified lines
208207 ; Breakpoint TRAP
209208 ; ---------------------------------------------
210209 trap_with_param:
211−
212− ; stop_pc info by gdb needs this info
213− lr r0, [efa]
210+ mov r0, r12 ; EFA in case ptracer/gdb wants stop_pc
214211 mov r1, sp
215212
216− ; Now that we have read EFA, it is safe to do "fake" rtie
217− ; and get out of CPU exception mode
218− FAKE_RET_FROM_EXCPN
219−
220213 ; Save callee regs in case gdb wants to have a look
221214 ; SP will grow up by size of CALLEE Reg-File
222215 ; NOTE: clobbers r12
@@ -243,6 +236,10 @@ ENTRY(EV_Trap) · 20 unmodified lines
243236
244237 EXCEPTION_PROLOGUE
245238
239+ lr r12, [efa]
240+
241+ FAKE_RET_FROM_EXCPN
242+
246243 ;============ TRAP 1 :breakpoints
247244 ; Check ECR for trap with arg (PROLOGUE ensures r10 has ECR)
248245 bmsk.f 0, r10, 7
@@ -250,9 +247,6 @@ ENTRY(EV_Trap) · 1 unmodified line
250247
251248 ;============ TRAP (no param): syscall top level
252249
253− ; First return from Exception to pure K mode (Exception/IRQs renabled)
254− FAKE_RET_FROM_EXCPN
255−
256250 ; If syscall tracing ongoing, invoke pre-post-hooks
257251 GET_CURR_THR_INFO_FLAGS r10
258252 btst r10, TIF_SYSCALL_TRACE
arch/arc/kernel/head.S+8−0
@@ -59,6 +59,14 @@ · 58 unmodified lines
5959 bclr r5, r5, STATUS_AD_BIT
6060 #endif
6161 kflag r5
62+
63+#ifdef CONFIG_ARC_LPB_DISABLE
64+ lr r5, [ARC_REG_LPB_BUILD]
65+ breq r5, 0, 1f ; LPB doesn't exist
66+ mov r5, 1
67+ sr r5, [ARC_REG_LPB_CTRL]
68+1:
69+#endif /* CONFIG_ARC_LPB_DISABLE */
6270 #endif
6371 ; Config DSP_CTRL properly, so kernel may use integer multiply,
6472 ; multiply-accumulate, and divide operations
arch/arc/kernel/setup.c+7−12
@@ -58,10 +58,12 @@ static const struct id_to_str arc_legacy_rel[] = { · 57 unmodified lines
5858 { 0x00, NULL }
5959 };
6060
61−static const struct id_to_str arc_cpu_rel[] = {
61+static const struct id_to_str arc_hs_ver54_rel[] = {
6262 /* UARCH.MAJOR, Release */
6363 { 0, "R3.10a"},
6464 { 1, "R3.50a"},
65+ { 2, "R3.60a"},
66+ { 3, "R4.00a"},
6567 { 0xFF, NULL }
6668 };
6769
@@ -117,12 +119,6 @@ static void decode_arc_core(struct cpuinfo_arc *cpu) · 49 unmodified lines
117119 struct bcr_uarch_build_arcv2 uarch;
118120 const struct id_to_str *tbl;
119121
120− /*
121− * Up until (including) the first core4 release (0x54) things were
122− * simple: AUX IDENTITY.ARCVER was sufficient to identify arc family
123− * and release: 0x50 to 0x53 was HS38, 0x54 was HS48 (dual issue)
124− */
125−
126122 if (cpu->core.family < 0x54) { /* includes arc700 */
127123
128124 for (tbl = &arc_legacy_rel[0]; tbl->id != 0; tbl++) {
@@ -143,11 +139,10 @@ static void decode_arc_core(struct cpuinfo_arc *cpu) · 14 unmodified lines
143139 }
144140
145141 /*
146− * However the subsequent HS release (same 0x54) allow HS38 or HS48
147− * configurations and encode this info in a different BCR.
148− * The BCR was introduced in 0x54 so can't be read unconditionally.
142+ * Initial HS cores bumped AUX IDENTITY.ARCVER for each release until
143+ * ARCVER 0x54 which introduced AUX MICRO_ARCH_BUILD and subsequent
144+ * releases only update it.
149145 */
150−
151146 READ_BCR(ARC_REG_MICRO_ARCH_BCR, uarch);
152147
153148 if (uarch.prod == 4) {
@@ -158,7 +153,7 @@ static void decode_arc_core(struct cpuinfo_arc *cpu) · 4 unmodified lines
158153 cpu->name = "HS38";
159154 }
160155
161− for (tbl = &arc_cpu_rel[0]; tbl->id != 0xFF; tbl++) {
156+ for (tbl = &arc_hs_ver54_rel[0]; tbl->id != 0xFF; tbl++) {
162157 if (uarch.maj == tbl->id) {
163158 cpu->release = tbl->str;
164159 break;
arch/arm/boot/dts/am335x-baltos.dtsi+1−1
@@ -369,7 +369,7 @@ · 368 unmodified lines
369369 &mmc2 {
370370 status = "okay";
371371 vmmc-supply = <&wl12xx_vmmc>;
372− ti,non-removable;
372+ non-removable;
373373 bus-width = <4>;
374374 cap-power-off-card;
375375 pinctrl-names = "default";
arch/arm/boot/dts/am335x-boneblack-common.dtsi+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 pinctrl-0 = <&emmc_pins>;
2323 bus-width = <8>;
2424 status = "okay";
25+ non-removable;
2526 };
2627
2728 &am33xx_pinmux {
arch/arm/boot/dts/am335x-boneblack-wireless.dts+0−1
@@ -75,7 +75,6 @@ · 74 unmodified lines
7575 bus-width = <4>;
7676 non-removable;
7777 cap-power-off-card;
78− ti,needs-special-hs-handling;
7978 keep-power-in-suspend;
8079 pinctrl-names = "default";
8180 pinctrl-0 = <&mmc3_pins &wl18xx_pins>;
arch/arm/boot/dts/am335x-boneblue.dts+0−1
@@ -367,7 +367,6 @@ · 366 unmodified lines
367367 bus-width = <4>;
368368 non-removable;
369369 cap-power-off-card;
370− ti,needs-special-hs-handling;
371370 keep-power-in-suspend;
372371 pinctrl-names = "default";
373372 pinctrl-0 = <&mmc3_pins &wl18xx_pins>;
arch/arm/boot/dts/am335x-bonegreen-wireless.dts+0−1
@@ -75,7 +75,6 @@ · 74 unmodified lines
7575 bus-width = <4>;
7676 non-removable;
7777 cap-power-off-card;
78− ti,needs-special-hs-handling;
7978 keep-power-in-suspend;
8079 pinctrl-names = "default";
8180 pinctrl-0 = <&mmc3_pins &wl18xx_pins>;
arch/arm/boot/dts/am335x-evm.dts+1−2
@@ -743,8 +743,7 @@ · 742 unmodified lines
743743 bus-width = <4>;
744744 pinctrl-names = "default";
745745 pinctrl-0 = <&mmc3_pins &wlan_pins>;
746− ti,non-removable;
747− ti,needs-special-hs-handling;
746+ non-removable;
748747 cap-power-off-card;
749748 keep-power-in-suspend;
750749
arch/arm/boot/dts/am335x-evmsk.dts+1−1
@@ -655,7 +655,7 @@ · 654 unmodified lines
655655 &mmc2 {
656656 status = "okay";
657657 vmmc-supply = <&wl12xx_vmmc>;
658− ti,non-removable;
658+ non-removable;
659659 bus-width = <4>;
660660 cap-power-off-card;
661661 keep-power-in-suspend;
arch/arm/boot/dts/am335x-lxm.dts+1−1
@@ -339,7 +339,7 @@ · 338 unmodified lines
339339 pinctrl-0 = <&emmc_pins>;
340340 vmmc-supply = <&vmmcsd_fixed>;
341341 bus-width = <8>;
342− ti,non-removable;
342+ non-removable;
343343 status = "okay";
344344 };
345345
arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi+1−1
@@ -159,7 +159,7 @@ · 158 unmodified lines
159159 vmmc-supply = <&vmmcsd_fixed>;
160160 bus-width = <8>;
161161 pinctrl-0 = <&mmc1_pins_default>;
162− ti,non-removable;
162+ non-removable;
163163 status = "okay";
164164 };
165165
arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts+1−1
@@ -451,7 +451,7 @@ · 450 unmodified lines
451451 vmmc-supply = <&vmmcsd_fixed>;
452452 bus-width = <8>;
453453 pinctrl-0 = <&mmc2_pins_default>;
454− ti,non-removable;
454+ non-removable;
455455 status = "okay";
456456 };
457457
arch/arm/boot/dts/am335x-pepper.dts+2−2
@@ -341,7 +341,7 @@ · 340 unmodified lines
341341 pinctrl-0 = <&emmc_pins>;
342342 vmmc-supply = <&ldo3_reg>;
343343 bus-width = <8>;
344− ti,non-removable;
344+ non-removable;
345345 };
346346
347347 &mmc3 {
@@ -351,7 +351,7 @@ · 3 unmodified lines
351351 pinctrl-0 = <&wireless_pins>;
352352 vmmmc-supply = <&v3v3c_reg>;
353353 bus-width = <4>;
354− ti,non-removable;
354+ non-removable;
355355 dmas = <&edma_xbar 12 0 1
356356 &edma_xbar 13 0 2>;
357357 dma-names = "tx", "rx";
arch/arm/boot/dts/am335x-phycore-som.dtsi+1−1
@@ -69,7 +69,7 @@ · 68 unmodified lines
6969 pinctrl-0 = <&emmc_pins>;
7070 vmmc-supply = <&vmmc_reg>;
7171 bus-width = <8>;
72− ti,non-removable;
72+ non-removable;
7373 status = "disabled";
7474 };
7575
arch/arm/boot/dts/am335x-pocketbeagle.dts+0−1
@@ -88,7 +88,6 @@ · 87 unmodified lines
8888 AM33XX_PADCONF(AM335X_PIN_MMC0_DAT3, PIN_INPUT_PULLUP, MUX_MODE0)
8989 AM33XX_PADCONF(AM335X_PIN_MMC0_CMD, PIN_INPUT_PULLUP, MUX_MODE0)
9090 AM33XX_PADCONF(AM335X_PIN_MMC0_CLK, PIN_INPUT_PULLUP, MUX_MODE0)
91− AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKR, PIN_INPUT, MUX_MODE4) /* (B12) mcasp0_aclkr.mmc0_sdwp */
9291 >;
9392 };
9493
arch/arm/boot/dts/am33xx-l4.dtsi+2−4
@@ -1335,10 +1335,8 @@ · 1334 unmodified lines
13351335 ranges = <0x0 0x60000 0x1000>;
13361336
13371337 mmc1: mmc@0 {
1338− compatible = "ti,omap4-hsmmc";
1339− ti,dual-volt;
1338+ compatible = "ti,am335-sdhci";
13401339 ti,needs-special-reset;
1341− ti,needs-special-hs-handling;
13421340 dmas = <&edma_xbar 24 0 0
13431341 &edma_xbar 25 0 0>;
13441342 dma-names = "tx", "rx";
@@ -1816,7 +1814,7 @@ · 471 unmodified lines
18161814 ranges = <0x0 0xd8000 0x1000>;
18171815
18181816 mmc2: mmc@0 {
1819− compatible = "ti,omap4-hsmmc";
1817+ compatible = "ti,am335-sdhci";
18201818 ti,needs-special-reset;
18211819 dmas = <&edma 2 0
18221820 &edma 3 0>;
arch/arm/boot/dts/am33xx.dtsi+4−3
@@ -322,10 +322,11 @@ · 321 unmodified lines
322322 ranges = <0x0 0x47810000 0x1000>;
323323
324324 mmc3: mmc@0 {
325− compatible = "ti,omap4-hsmmc";
325+ compatible = "ti,am335-sdhci";
326326 ti,needs-special-reset;
327327 interrupts = <29>;
328328 reg = <0x0 0x1000>;
329+ status = "disabled";
329330 };
330331 };
331332
@@ -335,7 +336,7 @@ · 3 unmodified lines
335336 <0x47400010 0x4>;
336337 reg-names = "rev", "sysc";
337338 ti,sysc-mask = <(SYSC_OMAP4_FREEEMU |
338− SYSC_OMAP2_SOFTRESET)>;
339+ SYSC_OMAP4_SOFTRESET)>;
339340 ti,sysc-midle = <SYSC_IDLE_FORCE>,
340341 <SYSC_IDLE_NO>,
341342 <SYSC_IDLE_SMART>;
@@ -347,7 +348,7 @@ · 5 unmodified lines
347348 clock-names = "fck";
348349 #address-cells = <1>;
349350 #size-cells = <1>;
350− ranges = <0x0 0x47400000 0x5000>;
351+ ranges = <0x0 0x47400000 0x8000>;
351352
352353 usb0_phy: usb-phy@1300 {
353354 compatible = "ti,am335x-usb-phy";
arch/arm/boot/dts/am4372.dtsi+2−1
@@ -316,10 +316,11 @@ · 315 unmodified lines
316316 ranges = <0x0 0x47810000 0x1000>;
317317
318318 mmc3: mmc@0 {
319− compatible = "ti,omap4-hsmmc";
319+ compatible = "ti,am437-sdhci";
320320 ti,needs-special-reset;
321321 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
322322 reg = <0x0 0x1000>;
323+ status = "disabled";
323324 };
324325 };
325326
arch/arm/boot/dts/am437x-cm-t43.dts+1−1
@@ -291,7 +291,7 @@ · 290 unmodified lines
291291 pinctrl-0 = <&emmc_pins>;
292292 vmmc-supply = <&vmmc_3v3>;
293293 bus-width = <8>;
294− ti,non-removable;
294+ non-removable;
295295 };
296296
297297 &spi0 {
arch/arm/boot/dts/am437x-gp-evm.dts+2−18
@@ -91,22 +91,6 @@ · 90 unmodified lines
9191
9292 backlight = <&lcd_bl>;
9393
94− panel-timing {
95− clock-frequency = <33000000>;
96− hactive = <800>;
97− vactive = <480>;
98− hfront-porch = <210>;
99− hback-porch = <16>;
100− hsync-len = <30>;
101− vback-porch = <10>;
102− vfront-porch = <22>;
103− vsync-len = <13>;
104− hsync-active = <0>;
105− vsync-active = <0>;
106− de-active = <1>;
107− pixelclk-active = <1>;
108− };
109−
11094 port {
11195 lcd_in: endpoint {
11296 remote-endpoint = <&dpi_out>;
@@ -869,7 +853,7 @@ · 756 unmodified lines
869853 pinctrl-names = "default", "sleep";
870854 pinctrl-0 = <&emmc_pins_default>;
871855 pinctrl-1 = <&emmc_pins_sleep>;
872− ti,non-removable;
856+ non-removable;
873857 };
874858
875859 &mmc3 {
@@ -886,7 +870,7 @@ · 10 unmodified lines
886870 pinctrl-1 = <&mmc3_pins_sleep>;
887871 cap-power-off-card;
888872 keep-power-in-suspend;
889− ti,non-removable;
873+ non-removable;
890874
891875 #address-cells = <1>;
892876 #size-cells = <0>;
arch/arm/boot/dts/am437x-l4.dtsi+12−7
@@ -1083,9 +1083,8 @@ · 1082 unmodified lines
10831083 ranges = <0x0 0x60000 0x1000>;
10841084
10851085 mmc1: mmc@0 {
1086− compatible = "ti,omap4-hsmmc";
1086+ compatible = "ti,am437-sdhci";
10871087 reg = <0x0 0x1000>;
1088− ti,dual-volt;
10891088 ti,needs-special-reset;
10901089 dmas = <&edma 24 0>,
10911090 <&edma 25 0>;
@@ -1541,8 +1540,9 @@ · 449 unmodified lines
15411540 reg = <0xcc020 0x4>;
15421541 reg-names = "rev";
15431542 /* Domains (P, C): per_pwrdm, l4ls_clkdm */
1544− clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>;
1545− clock-names = "fck";
1543+ clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>,
1544+ <&dcan0_fck>;
1545+ clock-names = "fck", "osc";
15461546 #address-cells = <1>;
15471547 #size-cells = <1>;
15481548 ranges = <0x0 0xcc000 0x2000>;
@@ -1550,6 +1550,8 @@ · 1 unmodified line
15501550 dcan0: can@0 {
15511551 compatible = "ti,am4372-d_can", "ti,am3352-d_can";
15521552 reg = <0x0 0x2000>;
1553+ clocks = <&dcan0_fck>;
1554+ clock-names = "fck";
15531555 syscon-raminit = <&scm_conf 0x644 0>;
15541556 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
15551557 status = "disabled";
@@ -1561,8 +1563,9 @@ · 5 unmodified lines
15611563 reg = <0xd0020 0x4>;
15621564 reg-names = "rev";
15631565 /* Domains (P, C): per_pwrdm, l4ls_clkdm */
1564− clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>;
1565− clock-names = "fck";
1566+ clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>,
1567+ <&dcan1_fck>;
1568+ clock-names = "fck", "osc";
15661569 #address-cells = <1>;
15671570 #size-cells = <1>;
15681571 ranges = <0x0 0xd0000 0x2000>;
@@ -1570,6 +1573,8 @@ · 1 unmodified line
15701573 dcan1: can@0 {
15711574 compatible = "ti,am4372-d_can", "ti,am3352-d_can";
15721575 reg = <0x0 0x2000>;
1576+ clocks = <&dcan1_fck>;
1577+ clock-name = "fck";
15731578 syscon-raminit = <&scm_conf 0x644 1>;
15741579 interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
15751580 status = "disabled";
@@ -1598,7 +1603,7 @@ · 22 unmodified lines
15981603 ranges = <0x0 0xd8000 0x1000>;
15991604
16001605 mmc2: mmc@0 {
1601− compatible = "ti,omap4-hsmmc";
1606+ compatible = "ti,am437-sdhci";
16021607 reg = <0x0 0x1000>;
16031608 ti,needs-special-reset;
16041609 dmas = <&edma 2 0>,
arch/arm/boot/dts/am437x-sk-evm.dts+1−17
@@ -134,22 +134,6 @@ · 133 unmodified lines
134134
135135 enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
136136
137− panel-timing {
138− clock-frequency = <9000000>;
139− hactive = <480>;
140− vactive = <272>;
141− hfront-porch = <2>;
142− hback-porch = <2>;
143− hsync-len = <41>;
144− vfront-porch = <2>;
145− vback-porch = <2>;
146− vsync-len = <10>;
147− hsync-active = <0>;
148− vsync-active = <0>;
149− de-active = <1>;
150− pixelclk-active = <1>;
151− };
152−
153137 port {
154138 lcd_in: endpoint {
155139 remote-endpoint = <&dpi_out>;
@@ -719,7 +703,7 @@ · 563 unmodified lines
719703 pinctrl-1 = <&mmc3_pins_sleep>;
720704 cap-power-off-card;
721705 keep-power-in-suspend;
722− ti,non-removable;
706+ non-removable;
723707
724708 #address-cells = <1>;
725709 #size-cells = <0>;
arch/arm/boot/dts/am43x-epos-evm.dts+0−16
@@ -47,22 +47,6 @@ · 46 unmodified lines
4747
4848 backlight = <&lcd_bl>;
4949
50− panel-timing {
51− clock-frequency = <33000000>;
52− hactive = <800>;
53− vactive = <480>;
54− hfront-porch = <210>;
55− hback-porch = <16>;
56− hsync-len = <30>;
57− vback-porch = <10>;
58− vfront-porch = <22>;
59− vsync-len = <13>;
60− hsync-active = <0>;
61− vsync-active = <0>;
62− de-active = <1>;
63− pixelclk-active = <1>;
64− };
65−
6650 port {
6751 lcd_in: endpoint {
6852 remote-endpoint = <&dpi_out>;
arch/arm/boot/dts/am5729-beagleboneai.dts+1−1
@@ -505,7 +505,7 @@ · 504 unmodified lines
505505
506506 &cpsw_emac0 {
507507 phy-handle = <&phy0>;
508− phy-mode = "rgmii";
508+ phy-mode = "rgmii-rxid";
509509 };
510510
511511 &ocp {
arch/arm/boot/dts/bcm-nsp.dtsi+6−4
@@ -200,7 +200,7 @@ · 199 unmodified lines
200200 status = "disabled";
201201 };
202202
203− dma@20000 {
203+ dma: dma@20000 {
204204 compatible = "arm,pl330", "arm,primecell";
205205 reg = <0x20000 0x1000>;
206206 interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
@@ -215,6 +215,8 @@ · 8 unmodified lines
215215 clocks = <&iprocslow>;
216216 clock-names = "apb_pclk";
217217 #dma-cells = <1>;
218+ dma-coherent;
219+ status = "disabled";
218220 };
219221
220222 sdio: sdhci@21000 {
@@ -257,10 +259,10 @@ · 36 unmodified lines
257259 status = "disabled";
258260 };
259261
260− mailbox: mailbox@25000 {
262+ mailbox: mailbox@25c00 {
261263 compatible = "brcm,iproc-fa2-mbox";
262− reg = <0x25000 0x445>;
263− interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
264+ reg = <0x25c00 0x400>;
265+ interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
264266 #mbox-cells = <1>;
265267 brcm,rx-status-len = <32>;
266268 brcm,use-bcm-hdr;
arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 };
1818
1919 memory {
20+ device_type = "memory";
2021 reg = <0x00000000 0x08000000
2122 0x88000000 0x18000000>;
2223 };
arch/arm/boot/dts/bcm958522er.dts+4−0
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858
5959 /* USB 3 support needed to be complete */
6060
61+&dma {
62+ status = "okay";
63+};
64+
6165 &amac0 {
6266 status = "okay";
6367 };
arch/arm/boot/dts/bcm958525er.dts+4−0
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858
5959 /* USB 3 support needed to be complete */
6060
61+&dma {
62+ status = "okay";
63+};
64+
6165 &amac0 {
6266 status = "okay";
6367 };
arch/arm/boot/dts/bcm958525xmc.dts+4−0
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858
5959 /* XHCI support needed to be complete */
6060
61+&dma {
62+ status = "okay";
63+};
64+
6165 &amac0 {
6266 status = "okay";
6367 };
arch/arm/boot/dts/bcm958622hr.dts+4−0
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858
5959 /* USB 3 and SLIC support needed to be complete */
6060
61+&dma {
62+ status = "okay";
63+};
64+
6165 &amac0 {
6266 status = "okay";
6367 };
arch/arm/boot/dts/bcm958623hr.dts+4−0
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858
5959 /* USB 3 and SLIC support needed to be complete */
6060
61+&dma {
62+ status = "okay";
63+};
64+
6165 &amac0 {
6266 status = "okay";
6367 };
arch/arm/boot/dts/bcm958625hr.dts+4−0
@@ -69,6 +69,10 @@ · 68 unmodified lines
6969 status = "okay";
7070 };
7171
72+&dma {
73+ status = "okay";
74+};
75+
7276 &amac0 {
7377 status = "okay";
7478 };
arch/arm/boot/dts/bcm958625k.dts+4−0
@@ -48,6 +48,10 @@ · 47 unmodified lines
4848 };
4949 };
5050
51+&dma {
52+ status = "okay";
53+};
54+
5155 &amac0 {
5256 status = "okay";
5357 };
arch/arm/boot/dts/dra7-evm-common.dtsi+0−20
@@ -245,26 +245,6 @@ · 244 unmodified lines
245245 rx-num-evt = <32>;
246246 };
247247
248−&mailbox5 {
249− status = "okay";
250− mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
251− status = "okay";
252− };
253− mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
254− status = "okay";
255− };
256−};
257−
258−&mailbox6 {
259− status = "okay";
260− mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
261− status = "okay";
262− };
263− mbox_dsp2_ipc3x: mbox_dsp2_ipc3x {
264− status = "okay";
265− };
266−};
267−
268248 &pcie1_rc {
269249 status = "okay";
270250 };
arch/arm/boot/dts/dra7-l4.dtsi+16−18
@@ -1207,9 +1207,8 @@ · 1206 unmodified lines
12071207 <SYSC_IDLE_SMART>,
12081208 <SYSC_IDLE_SMART_WKUP>;
12091209 /* Domains (P, C): l4per_pwrdm, l4per_clkdm */
1210− clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 0>,
1211− <&timer_sys_clk_div>;
1212− clock-names = "fck", "timer_sys_ck";
1210+ clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 0>;
1211+ clock-names = "fck";
12131212 #address-cells = <1>;
12141213 #size-cells = <1>;
12151214 ranges = <0x0 0x36000 0x1000>;
@@ -3352,8 +3351,8 @@ · 2136 unmodified lines
33523351 <SYSC_IDLE_SMART>,
33533352 <SYSC_IDLE_SMART_WKUP>;
33543353 /* Domains (P, C): ipu_pwrdm, ipu_clkdm */
3355− clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 0>, <&timer_sys_clk_div>;
3356− clock-names = "fck", "timer_sys_ck";
3354+ clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 0>;
3355+ clock-names = "fck";
33573356 #address-cells = <1>;
33583357 #size-cells = <1>;
33593358 ranges = <0x0 0x20000 0x1000>;
@@ -3361,8 +3360,8 @@ · 1 unmodified line
33613360 timer5: timer@0 {
33623361 compatible = "ti,omap5430-timer";
33633362 reg = <0x0 0x80>;
3364− clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 24>;
3365− clock-names = "fck";
3363+ clocks = <&ipu_clkctrl DRA7_IPU_TIMER5_CLKCTRL 24>, <&timer_sys_clk_div>;
3364+ clock-names = "fck", "timer_sys_ck";
33663365 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
33673366 };
33683367 };
@@ -3379,9 +3378,8 @@ · 10 unmodified lines
33793378 <SYSC_IDLE_SMART>,
33803379 <SYSC_IDLE_SMART_WKUP>;
33813380 /* Domains (P, C): ipu_pwrdm, ipu_clkdm */
3382− clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 0>,
3383− <&timer_sys_clk_div>;
3384− clock-names = "fck", "timer_sys_ck";
3381+ clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 0>;
3382+ clock-names = "fck";
33853383 #address-cells = <1>;
33863384 #size-cells = <1>;
33873385 ranges = <0x0 0x22000 0x1000>;
@@ -3389,8 +3387,8 @@ · 1 unmodified line
33893387 timer6: timer@0 {
33903388 compatible = "ti,omap5430-timer";
33913389 reg = <0x0 0x80>;
3392− clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 24>;
3393− clock-names = "fck";
3390+ clocks = <&ipu_clkctrl DRA7_IPU_TIMER6_CLKCTRL 24>, <&timer_sys_clk_div>;
3391+ clock-names = "fck", "timer_sys_ck";
33943392 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
33953393 };
33963394 };
@@ -3498,8 +3496,8 @@ · 101 unmodified lines
34983496 timer14: timer@0 {
34993497 compatible = "ti,omap5430-timer";
35003498 reg = <0x0 0x80>;
3501− clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER14_CLKCTRL 24>;
3502− clock-names = "fck";
3499+ clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER14_CLKCTRL 24>, <&timer_sys_clk_div>;
3500+ clock-names = "fck", "timer_sys_ck";
35033501 interrupts = <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>;
35043502 ti,timer-pwm;
35053503 };
@@ -3526,8 +3524,8 @@ · 20 unmodified lines
35263524 timer15: timer@0 {
35273525 compatible = "ti,omap5430-timer";
35283526 reg = <0x0 0x80>;
3529− clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>;
3530− clock-names = "fck";
3527+ clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>, <&timer_sys_clk_div>;
3528+ clock-names = "fck", "timer_sys_ck";
35313529 interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>;
35323530 ti,timer-pwm;
35333531 };
@@ -3554,8 +3552,8 @@ · 20 unmodified lines
35543552 timer16: timer@0 {
35553553 compatible = "ti,omap5430-timer";
35563554 reg = <0x0 0x80>;
3557− clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>;
3558− clock-names = "fck";
3555+ clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>, <&timer_sys_clk_div>;
3556+ clock-names = "fck", "timer_sys_ck";
35593557 interrupts = <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH>;
35603558 ti,timer-pwm;
35613559 };
arch/arm/boot/dts/imx6qdl-gw551x.dtsi+1−1
@@ -110,7 +110,7 @@ · 109 unmodified lines
110110 simple-audio-card,frame-master = <&sound_codec>;
111111
112112 sound_cpu: simple-audio-card,cpu {
113− sound-dai = <&ssi2>;
113+ sound-dai = <&ssi1>;
114114 };
115115
116116 sound_codec: simple-audio-card,codec {
arch/arm/boot/dts/imx6ul-kontron-n6x1x-s.dtsi+0−13
@@ -232,13 +232,6 @@ · 231 unmodified lines
232232 status = "okay";
233233 };
234234
235−&wdog1 {
236− pinctrl-names = "default";
237− pinctrl-0 = <&pinctrl_wdog>;
238− fsl,ext-reset-output;
239− status = "okay";
240−};
241−
242235 &iomuxc {
243236 pinctrl-0 = <&pinctrl_reset_out &pinctrl_gpio>;
244237
@@ -409,10 +402,4 @@ · 164 unmodified lines
409402 MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x170f9
410403 >;
411404 };
412−
413− pinctrl_wdog: wdoggrp {
414− fsl,pins = <
415− MX6UL_PAD_GPIO1_IO09__WDOG1_WDOG_ANY 0x30b0
416− >;
417− };
418405 };
arch/arm/boot/dts/imx6ul-kontron-n6x1x-som-common.dtsi+13−0
@@ -57,6 +57,13 @@ · 56 unmodified lines
5757 status = "okay";
5858 };
5959
60+&wdog1 {
61+ pinctrl-names = "default";
62+ pinctrl-0 = <&pinctrl_wdog>;
63+ fsl,ext-reset-output;
64+ status = "okay";
65+};
66+
6067 &iomuxc {
6168 pinctrl-names = "default";
6269 pinctrl-0 = <&pinctrl_reset_out>;
@@ -106,4 +113,10 @@ · 43 unmodified lines
106113 MX6UL_PAD_SNVS_TAMPER9__GPIO5_IO09 0x1b0b0
107114 >;
108115 };
116+
117+ pinctrl_wdog: wdoggrp {
118+ fsl,pins = <
119+ MX6UL_PAD_GPIO1_IO09__WDOG1_WDOG_ANY 0x18b0
120+ >;
121+ };
109122 };
arch/arm/boot/dts/meson.dtsi+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 #size-cells = <1>;
1212 interrupt-parent = <&gic>;
1313
14− L2: l2-cache-controller@c4200000 {
14+ L2: cache-controller@c4200000 {
1515 compatible = "arm,pl310-cache";
1616 reg = <0xc4200000 0x1000>;
1717 cache-unified;
arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi+3−1
@@ -13,8 +13,10 @@ · 12 unmodified lines
1313 #interrupt-cells = <2>;
1414 #address-cells = <1>;
1515 #size-cells = <0>;
16− spi-max-frequency = <3000000>;
16+ spi-max-frequency = <9600000>;
1717 spi-cs-high;
18+ spi-cpol;
19+ spi-cpha;
1820
1921 cpcap_adc: adc {
2022 compatible = "motorola,mapphone-cpcap-adc";
arch/arm/boot/dts/omap3-n900.dts+8−4
@@ -105,6 +105,14 @@ · 104 unmodified lines
105105 linux,code = <SW_FRONT_PROXIMITY>;
106106 linux,can-disable;
107107 };
108+
109+ machine_cover {
110+ label = "Machine Cover";
111+ gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */
112+ linux,input-type = <EV_SW>;
113+ linux,code = <SW_MACHINE_COVER>;
114+ linux,can-disable;
115+ };
108116 };
109117
110118 isp1707: isp1707 {
@@ -819,10 +827,6 @@ · 708 unmodified lines
819827 pinctrl-0 = <&mmc1_pins>;
820828 vmmc-supply = <&vmmc1>;
821829 bus-width = <4>;
822− /* For debugging, it is often good idea to remove this GPIO.
823− It means you can remove back cover (to reboot by removing
824− battery) and still use the MMC card. */
825− cd-gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */
826830 };
827831
828832 /* most boards use vaux3, only some old versions use vmmc2 instead */
arch/arm/boot/dts/omap4-duovero-parlor.dts+1−1
@@ -139,7 +139,7 @@ · 138 unmodified lines
139139 ethernet@gpmc {
140140 reg = <5 0 0xff>;
141141 interrupt-parent = <&gpio2>;
142− interrupts = <12 IRQ_TYPE_EDGE_FALLING>; /* gpio_44 */
142+ interrupts = <12 IRQ_TYPE_LEVEL_LOW>; /* gpio_44 */
143143
144144 phy-mode = "mii";
145145
arch/arm/boot/dts/omap4.dtsi+1−1
@@ -662,6 +662,6 @@ · 661 unmodified lines
662662 ti,no-idle;
663663 timer@0 {
664664 assigned-clocks = <&l4_wkup_clkctrl OMAP4_TIMER1_CLKCTRL 24>;
665− assigned-clock-parents = <&sys_clkin_ck>;
665+ assigned-clock-parents = <&sys_32k_ck>;
666666 };
667667 };
arch/arm/boot/dts/socfpga.dtsi+1−1
@@ -726,7 +726,7 @@ · 725 unmodified lines
726726 };
727727 };
728728
729− L2: l2-cache@fffef000 {
729+ L2: cache-controller@fffef000 {
730730 compatible = "arm,pl310-cache";
731731 reg = <0xfffef000 0x1000>;
732732 interrupts = <0 38 0x04>;
arch/arm/boot/dts/socfpga_arria10.dtsi+1−1
@@ -636,7 +636,7 @@ · 635 unmodified lines
636636 reg = <0xffcfb100 0x80>;
637637 };
638638
639− L2: l2-cache@fffff000 {
639+ L2: cache-controller@fffff000 {
640640 compatible = "arm,pl310-cache";
641641 reg = <0xfffff000 0x1000>;
642642 interrupts = <0 18 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi+73−73
@@ -100,79 +100,6 @@ · 99 unmodified lines
100100 };
101101 };
102102
103− mcc {
104− compatible = "arm,vexpress,config-bus";
105− arm,vexpress,config-bridge = <&v2m_sysreg>;
106−
107− oscclk0 {
108− /* MCC static memory clock */
109− compatible = "arm,vexpress-osc";
110− arm,vexpress-sysreg,func = <1 0>;
111− freq-range = <25000000 60000000>;
112− #clock-cells = <0>;
113− clock-output-names = "v2m:oscclk0";
114− };
115−
116− v2m_oscclk1: oscclk1 {
117− /* CLCD clock */
118− compatible = "arm,vexpress-osc";
119− arm,vexpress-sysreg,func = <1 1>;
120− freq-range = <23750000 65000000>;
121− #clock-cells = <0>;
122− clock-output-names = "v2m:oscclk1";
123− };
124−
125− v2m_oscclk2: oscclk2 {
126− /* IO FPGA peripheral clock */
127− compatible = "arm,vexpress-osc";
128− arm,vexpress-sysreg,func = <1 2>;
129− freq-range = <24000000 24000000>;
130− #clock-cells = <0>;
131− clock-output-names = "v2m:oscclk2";
132− };
133−
134− volt-vio {
135− /* Logic level voltage */
136− compatible = "arm,vexpress-volt";
137− arm,vexpress-sysreg,func = <2 0>;
138− regulator-name = "VIO";
139− regulator-always-on;
140− label = "VIO";
141− };
142−
143− temp-mcc {
144− /* MCC internal operating temperature */
145− compatible = "arm,vexpress-temp";
146− arm,vexpress-sysreg,func = <4 0>;
147− label = "MCC";
148− };
149−
150− reset {
151− compatible = "arm,vexpress-reset";
152− arm,vexpress-sysreg,func = <5 0>;
153− };
154−
155− muxfpga {
156− compatible = "arm,vexpress-muxfpga";
157− arm,vexpress-sysreg,func = <7 0>;
158− };
159−
160− shutdown {
161− compatible = "arm,vexpress-shutdown";
162− arm,vexpress-sysreg,func = <8 0>;
163− };
164−
165− reboot {
166− compatible = "arm,vexpress-reboot";
167− arm,vexpress-sysreg,func = <9 0>;
168− };
169−
170− dvimode {
171− compatible = "arm,vexpress-dvimode";
172− arm,vexpress-sysreg,func = <11 0>;
173− };
174− };
175−
176103 bus@8000000 {
177104 motherboard-bus {
178105 model = "V2M-P1";
@@ -435,6 +362,79 @@ · 256 unmodified lines
435362 };
436363 };
437364 };
365+
366+ mcc {
367+ compatible = "arm,vexpress,config-bus";
368+ arm,vexpress,config-bridge = <&v2m_sysreg>;
369+
370+ oscclk0 {
371+ /* MCC static memory clock */
372+ compatible = "arm,vexpress-osc";
373+ arm,vexpress-sysreg,func = <1 0>;
374+ freq-range = <25000000 60000000>;
375+ #clock-cells = <0>;
376+ clock-output-names = "v2m:oscclk0";
377+ };
378+
379+ v2m_oscclk1: oscclk1 {
380+ /* CLCD clock */
381+ compatible = "arm,vexpress-osc";
382+ arm,vexpress-sysreg,func = <1 1>;
383+ freq-range = <23750000 65000000>;
384+ #clock-cells = <0>;
385+ clock-output-names = "v2m:oscclk1";
386+ };
387+
388+ v2m_oscclk2: oscclk2 {
389+ /* IO FPGA peripheral clock */
390+ compatible = "arm,vexpress-osc";
391+ arm,vexpress-sysreg,func = <1 2>;
392+ freq-range = <24000000 24000000>;
393+ #clock-cells = <0>;
394+ clock-output-names = "v2m:oscclk2";
395+ };
396+
397+ volt-vio {
398+ /* Logic level voltage */
399+ compatible = "arm,vexpress-volt";
400+ arm,vexpress-sysreg,func = <2 0>;
401+ regulator-name = "VIO";
402+ regulator-always-on;
403+ label = "VIO";
404+ };
405+
406+ temp-mcc {
407+ /* MCC internal operating temperature */
408+ compatible = "arm,vexpress-temp";
409+ arm,vexpress-sysreg,func = <4 0>;
410+ label = "MCC";
411+ };
412+
413+ reset {
414+ compatible = "arm,vexpress-reset";
415+ arm,vexpress-sysreg,func = <5 0>;
416+ };
417+
418+ muxfpga {
419+ compatible = "arm,vexpress-muxfpga";
420+ arm,vexpress-sysreg,func = <7 0>;
421+ };
422+
423+ shutdown {
424+ compatible = "arm,vexpress-shutdown";
425+ arm,vexpress-sysreg,func = <8 0>;
426+ };
427+
428+ reboot {
429+ compatible = "arm,vexpress-reboot";
430+ arm,vexpress-sysreg,func = <9 0>;
431+ };
432+
433+ dvimode {
434+ compatible = "arm,vexpress-dvimode";
435+ arm,vexpress-sysreg,func = <11 0>;
436+ };
437+ };
438438 };
439439 };
440440 };
arch/arm/include/asm/efi.h+7−0
@@ -87,4 +87,11 @@ static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base, · 86 unmodified lines
8787 return dram_base + SZ_512M;
8888 }
8989
90+struct efi_arm_entry_state {
91+ u32 cpsr_before_ebs;
92+ u32 sctlr_before_ebs;
93+ u32 cpsr_after_ebs;
94+ u32 sctlr_after_ebs;
95+};
96+
9097 #endif /* _ASM_ARM_EFI_H */
arch/arm/kernel/asm-offsets.c+0−9
@@ -31,15 +31,6 @@ · 30 unmodified lines
3131 #if defined(__APCS_26__)
3232 #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32
3333 #endif
34−/*
35− * GCC 4.8.0-4.8.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
36− * miscompiles find_get_entry(), and can result in EXT3 and EXT4
37− * filesystem corruption (possibly other FS too).
38− */
39−#if defined(GCC_VERSION) && GCC_VERSION >= 40800 && GCC_VERSION < 40803
40−#error Your compiler is too buggy; it is known to miscompile kernels
41−#error and result in filesystem corruption and oopses.
42−#endif
4334
4435 int main(void)
4536 {
arch/arm/mach-bcm/Kconfig+1−0
@@ -53,6 +53,7 @@ config ARCH_BCM_NSP · 52 unmodified lines
5353 select ARM_ERRATA_754322
5454 select ARM_ERRATA_775420
5555 select ARM_ERRATA_764369 if SMP
56+ select ARM_TIMER_SP804
5657 select THERMAL
5758 select THERMAL_OF
5859 help
arch/arm/mach-imx/devices/devices-common.h+1−1
@@ -289,6 +289,6 @@ struct platform_device *__init imx_add_spi_imx( · 288 unmodified lines
289289 const struct spi_imx_master *pdata);
290290
291291 struct platform_device *imx_add_imx_dma(char *name, resource_size_t iobase,
292− int irq, int irq_err);
292+ int irq);
293293 struct platform_device *imx_add_imx_sdma(char *name,
294294 resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
arch/arm/mach-imx/devices/platform-gpio-mxc.c+3−2
@@ -24,7 +24,8 @@ struct platform_device *__init mxc_register_gpio(char *name, int id, · 23 unmodified lines
2424 .flags = IORESOURCE_IRQ,
2525 },
2626 };
27+ unsigned int nres;
2728
28− return platform_device_register_resndata(&mxc_aips_bus,
29− name, id, res, ARRAY_SIZE(res), NULL, 0);
29+ nres = irq_high ? ARRAY_SIZE(res) : ARRAY_SIZE(res) - 1;
30+ return platform_device_register_resndata(&mxc_aips_bus, name, id, res, nres, NULL, 0);
3031 }
arch/arm/mach-imx/devices/platform-imx-dma.c+1−5
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include "devices-common.h"
77
88 struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
9− resource_size_t iobase, int irq, int irq_err)
9+ resource_size_t iobase, int irq)
1010 {
1111 struct resource res[] = {
1212 {
@@ -17,10 +17,6 @@ struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name, · 4 unmodified lines
1717 .start = irq,
1818 .end = irq,
1919 .flags = IORESOURCE_IRQ,
20− }, {
21− .start = irq_err,
22− .end = irq_err,
23− .flags = IORESOURCE_IRQ,
2420 },
2521 };
2622
arch/arm/mach-imx/mm-imx21.c+1−2
@@ -78,8 +78,7 @@ void __init imx21_soc_init(void) · 77 unmodified lines
7878 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
7979
8080 pinctrl_provide_dummies();
81− imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR,
82− MX21_INT_DMACH0, 0); /* No ERR irq */
81+ imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR, MX21_INT_DMACH0);
8382 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
8483 ARRAY_SIZE(imx21_audmux_res));
8584 }
arch/arm/mach-imx/mm-imx27.c+1−2
@@ -79,8 +79,7 @@ void __init imx27_soc_init(void) · 78 unmodified lines
7979 mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
8080
8181 pinctrl_provide_dummies();
82− imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR,
83− MX27_INT_DMACH0, 0); /* No ERR irq */
82+ imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR, MX27_INT_DMACH0);
8483 /* imx27 has the imx21 type audmux */
8584 platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
8685 ARRAY_SIZE(imx27_audmux_res));
arch/arm/mach-imx/pm-imx5.c+4−2
@@ -295,14 +295,14 @@ static int __init imx_suspend_alloc_ocram( · 294 unmodified lines
295295 if (!ocram_pool) {
296296 pr_warn("%s: ocram pool unavailable!\n", __func__);
297297 ret = -ENODEV;
298− goto put_node;
298+ goto put_device;
299299 }
300300
301301 ocram_base = gen_pool_alloc(ocram_pool, size);
302302 if (!ocram_base) {
303303 pr_warn("%s: unable to alloc ocram!\n", __func__);
304304 ret = -ENOMEM;
305− goto put_node;
305+ goto put_device;
306306 }
307307
308308 phys = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -312,6 +312,8 @@ static int __init imx_suspend_alloc_ocram( · 3 unmodified lines
312312 if (virt_out)
313313 *virt_out = virt;
314314
315+put_device:
316+ put_device(&pdev->dev);
315317 put_node:
316318 of_node_put(node);
317319
arch/arm/mach-imx/pm-imx6.c+6−4
@@ -493,14 +493,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) · 492 unmodified lines
493493 if (!ocram_pool) {
494494 pr_warn("%s: ocram pool unavailable!\n", __func__);
495495 ret = -ENODEV;
496− goto put_node;
496+ goto put_device;
497497 }
498498
499499 ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
500500 if (!ocram_base) {
501501 pr_warn("%s: unable to alloc ocram!\n", __func__);
502502 ret = -ENOMEM;
503− goto put_node;
503+ goto put_device;
504504 }
505505
506506 ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -523,7 +523,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) · 16 unmodified lines
523523 ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
524524 if (ret) {
525525 pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
526− goto put_node;
526+ goto put_device;
527527 }
528528
529529 ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
@@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) · 40 unmodified lines
570570 &imx6_suspend,
571571 MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
572572
573− goto put_node;
573+ goto put_device;
574574
575575 pl310_cache_map_failed:
576576 iounmap(pm_info->gpc_base.vbase);
@@ -580,6 +580,8 @@ iomuxc_map_failed: · 3 unmodified lines
580580 iounmap(pm_info->src_base.vbase);
581581 src_map_failed:
582582 iounmap(pm_info->mmdc_base.vbase);
583+put_device:
584+ put_device(&pdev->dev);
583585 put_node:
584586 of_node_put(node);
585587
arch/arm/mach-omap2/omap_hwmod.c+12−4
@@ -3435,7 +3435,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, · 3434 unmodified lines
34353435 regs = ioremap(data->module_pa,
34363436 data->module_size);
34373437 if (!regs)
3438− return -ENOMEM;
3438+ goto out_free_sysc;
34393439 }
34403440
34413441 /*
@@ -3445,13 +3445,13 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, · 3 unmodified lines
34453445 if (oh->class->name && strcmp(oh->class->name, data->name)) {
34463446 class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL);
34473447 if (!class)
3448− return -ENOMEM;
3448+ goto out_unmap;
34493449 }
34503450
34513451 if (list_empty(&oh->slave_ports)) {
34523452 oi = kcalloc(1, sizeof(*oi), GFP_KERNEL);
34533453 if (!oi)
3454− return -ENOMEM;
3454+ goto out_free_class;
34553455
34563456 /*
34573457 * Note that we assume interconnect interface clocks will be
@@ -3478,6 +3478,14 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, · 20 unmodified lines
34783478 spin_unlock_irqrestore(&oh->_lock, flags);
34793479
34803480 return 0;
3481+
3482+out_free_class:
3483+ kfree(class);
3484+out_unmap:
3485+ iounmap(regs);
3486+out_free_sysc:
3487+ kfree(sysc);
3488+ return -ENOMEM;
34813489 }
34823490
34833491 static const struct omap_hwmod_reset omap24xx_reset_quirks[] = {
@@ -3489,7 +3497,7 @@ static const struct omap_hwmod_reset dra7_reset_quirks[] = { · 5 unmodified lines
34893497 };
34903498
34913499 static const struct omap_hwmod_reset omap_reset_quirks[] = {
3492− { .match = "dss", .len = 3, .reset = omap_dss_reset, },
3500+ { .match = "dss_core", .len = 8, .reset = omap_dss_reset, },
34933501 { .match = "hdq1w", .len = 5, .reset = omap_hdq1w_reset, },
34943502 { .match = "i2c", .len = 3, .reset = omap_i2c_reset, },
34953503 { .match = "wd_timer", .len = 8, .reset = omap2_wd_timer_reset, },
arch/arm/mach-sti/board-dt.c+0−9
@@ -20,14 +20,6 @@ static const char *const stih41x_dt_match[] __initconst = { · 19 unmodified lines
2020 NULL
2121 };
2222
23−static void sti_l2_write_sec(unsigned long val, unsigned reg)
24−{
25− /*
26− * We can't write to secure registers as we are in non-secure
27− * mode, until we have some SMI service available.
28− */
29−}
30−
3123 DT_MACHINE_START(STM, "STi SoC with Flattened Device Tree")
3224 .dt_compat = stih41x_dt_match,
3325 .l2c_aux_val = L2C_AUX_CTRL_SHARED_OVERRIDE |
@@ -36,5 +28,4 @@ DT_MACHINE_START(STM, "STi SoC with Flattened Device Tree") · 2 unmodified lines
3628 L2C_AUX_CTRL_WAY_SIZE(4),
3729 .l2c_aux_mask = 0xc0000fff,
3830 .smp = smp_ops(sti_smp_ops),
39− .l2c_write_sec = sti_l2_write_sec,
4031 MACHINE_END
arch/arm/xen/enlighten.c+0−1
@@ -241,7 +241,6 @@ static int __init fdt_find_hyper_node(unsigned long node, const char *uname, · 240 unmodified lines
241241 * see Documentation/devicetree/bindings/arm/xen.txt for the
242242 * documentation of the Xen Device Tree format.
243243 */
244−#define GRANT_TABLE_PHYSADDR 0
245244 void __init xen_early_init(void)
246245 {
247246 of_scan_flat_dt(fdt_find_hyper_node, NULL);
arch/arm64/Kconfig+2−2
@@ -1518,9 +1518,9 @@ config ARM64_PTR_AUTH · 1517 unmodified lines
15181518 default y
15191519 depends on !KVM || ARM64_VHE
15201520 depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1521− # GCC 9.1 and later inserts a .note.gnu.property section note for PAC
1521+ # Modern compilers insert a .note.gnu.property section note for PAC
15221522 # which is only understood by binutils starting with version 2.33.1.
1523− depends on !CC_IS_GCC || GCC_VERSION < 90100 || LD_VERSION >= 233010000
1523+ depends on LD_IS_LLD || LD_VERSION >= 233010000 || (CC_IS_GCC && GCC_VERSION < 90100)
15241524 depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
15251525 depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
15261526 help
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi+4−4
@@ -77,7 +77,7 @@ · 76 unmodified lines
7777 method = "smc";
7878 };
7979
80− intc: intc@fffc1000 {
80+ intc: interrupt-controller@fffc1000 {
8181 compatible = "arm,gic-400", "arm,cortex-a15-gic";
8282 #interrupt-cells = <3>;
8383 interrupt-controller;
@@ -302,7 +302,7 @@ · 218 unmodified lines
302302 status = "disabled";
303303 };
304304
305− nand: nand@ffb90000 {
305+ nand: nand-controller@ffb90000 {
306306 #address-cells = <1>;
307307 #size-cells = <0>;
308308 compatible = "altr,socfpga-denali-nand";
@@ -445,7 +445,7 @@ · 136 unmodified lines
445445 clock-names = "timer";
446446 };
447447
448− uart0: serial0@ffc02000 {
448+ uart0: serial@ffc02000 {
449449 compatible = "snps,dw-apb-uart";
450450 reg = <0xffc02000 0x100>;
451451 interrupts = <0 108 4>;
@@ -456,7 +456,7 @@ · 4 unmodified lines
456456 status = "disabled";
457457 };
458458
459− uart1: serial1@ffc02100 {
459+ uart1: serial@ffc02100 {
460460 compatible = "snps,dw-apb-uart";
461461 reg = <0xffc02100 0x100>;
462462 interrupts = <0 109 4>;
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts+1−0
@@ -155,6 +155,7 @@ · 154 unmodified lines
155155 };
156156
157157 &qspi {
158+ status = "okay";
158159 flash@0 {
159160 #address-cells = <1>;
160161 #size-cells = <1>;
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_nand.dts+4−3
@@ -188,6 +188,7 @@ · 187 unmodified lines
188188 };
189189
190190 &qspi {
191+ status = "okay";
191192 flash@0 {
192193 #address-cells = <1>;
193194 #size-cells = <1>;
@@ -211,12 +212,12 @@ · 17 unmodified lines
211212
212213 qspi_boot: partition@0 {
213214 label = "Boot and fpga data";
214− reg = <0x0 0x034B0000>;
215+ reg = <0x0 0x03FE0000>;
215216 };
216217
217− qspi_rootfs: partition@4000000 {
218+ qspi_rootfs: partition@3FE0000 {
218219 label = "Root Filesystem - JFFS2";
219− reg = <0x034B0000 0x0EB50000>;
220+ reg = <0x03FE0000 0x0C020000>;
220221 };
221222 };
222223 };
arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <dt-bindings/input/input.h>
1111 #include <dt-bindings/sound/meson-aiu.h>
1212
13−#include "meson-gxl-s905x.dtsi"
13+#include "meson-gxl-s805x.dtsi"
1414
1515 / {
1616 compatible = "libretech,aml-s805x-ac", "amlogic,s805x",
arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99
1010 #include <dt-bindings/input/input.h>
1111
12−#include "meson-gxl-s905x.dtsi"
12+#include "meson-gxl-s805x.dtsi"
1313
1414 / {
1515 compatible = "amlogic,p241", "amlogic,s805x", "amlogic,meson-gxl";
arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi+24−0
@@ -0,0 +1,24 @@
1+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+/*
3+ * Copyright (c) 2020 BayLibre SAS
4+ * Author: Neil Armstrong <narmstrong@baylibre.com>
5+ */
6+
7+#include "meson-gxl-s905x.dtsi"
8+
9+/ {
10+ compatible = "amlogic,s805x", "amlogic,meson-gxl";
11+};
12+
13+/* The S805X Package doesn't seem to handle the 744MHz OPP correctly */
14+&mali {
15+ assigned-clocks = <&clkc CLKID_MALI_0_SEL>,
16+ <&clkc CLKID_MALI_0>,
17+ <&clkc CLKID_MALI>; /* Glitch free mux */
18+ assigned-clock-parents = <&clkc CLKID_FCLK_DIV3>,
19+ <0>, /* Do Nothing */
20+ <&clkc CLKID_MALI_0>;
21+ assigned-clock-rates = <0>, /* Do Nothing */
22+ <666666666>,
23+ <0>; /* Do Nothing */
24+};
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi+5−0
@@ -337,6 +337,11 @@ · 336 unmodified lines
337337 };
338338 };
339339
340+&hwrng {
341+ clocks = <&clkc CLKID_RNG0>;
342+ clock-names = "core";
343+};
344+
340345 &i2c_A {
341346 clocks = <&clkc CLKID_I2C>;
342347 };
arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi+2−2
@@ -136,7 +136,7 @@ · 135 unmodified lines
136136
137137 ldo1_reg: LDO1 {
138138 regulator-name = "LDO1";
139− regulator-min-microvolt = <3000000>;
139+ regulator-min-microvolt = <1600000>;
140140 regulator-max-microvolt = <3300000>;
141141 regulator-boot-on;
142142 regulator-always-on;
@@ -144,7 +144,7 @@ · 1 unmodified line
144144
145145 ldo2_reg: LDO2 {
146146 regulator-name = "LDO2";
147− regulator-min-microvolt = <900000>;
147+ regulator-min-microvolt = <800000>;
148148 regulator-max-microvolt = <900000>;
149149 regulator-boot-on;
150150 regulator-always-on;
arch/arm64/boot/dts/freescale/imx8mm-evk.dts+2−2
@@ -208,7 +208,7 @@ · 207 unmodified lines
208208
209209 ldo1_reg: LDO1 {
210210 regulator-name = "LDO1";
211− regulator-min-microvolt = <3000000>;
211+ regulator-min-microvolt = <1600000>;
212212 regulator-max-microvolt = <3300000>;
213213 regulator-boot-on;
214214 regulator-always-on;
@@ -216,7 +216,7 @@ · 1 unmodified line
216216
217217 ldo2_reg: LDO2 {
218218 regulator-name = "LDO2";
219− regulator-min-microvolt = <900000>;
219+ regulator-min-microvolt = <800000>;
220220 regulator-max-microvolt = <900000>;
221221 regulator-boot-on;
222222 regulator-always-on;
arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts+2−2
@@ -113,7 +113,7 @@ · 112 unmodified lines
113113
114114 ldo1_reg: LDO1 {
115115 regulator-name = "LDO1";
116− regulator-min-microvolt = <3000000>;
116+ regulator-min-microvolt = <1600000>;
117117 regulator-max-microvolt = <3300000>;
118118 regulator-boot-on;
119119 regulator-always-on;
@@ -121,7 +121,7 @@ · 1 unmodified line
121121
122122 ldo2_reg: LDO2 {
123123 regulator-name = "LDO2";
124− regulator-min-microvolt = <900000>;
124+ regulator-min-microvolt = <800000>;
125125 regulator-max-microvolt = <900000>;
126126 regulator-boot-on;
127127 regulator-always-on;
arch/arm64/boot/dts/intel/socfpga_agilex_socdk.dts+1−0
@@ -98,6 +98,7 @@ · 97 unmodified lines
9898 };
9999
100100 &qspi {
101+ status = "okay";
101102 flash@0 {
102103 #address-cells = <1>;
103104 #size-cells = <1>;
arch/arm64/configs/defconfig+1−1
@@ -194,7 +194,7 @@ CONFIG_HOTPLUG_PCI=y · 193 unmodified lines
194194 CONFIG_HOTPLUG_PCI_ACPI=y
195195 CONFIG_PCI_AARDVARK=y
196196 CONFIG_PCI_TEGRA=y
197−CONFIG_PCIE_RCAR=y
197+CONFIG_PCIE_RCAR_HOST=y
198198 CONFIG_PCI_HOST_GENERIC=y
199199 CONFIG_PCI_XGENE=y
200200 CONFIG_PCIE_ALTERA=y
arch/arm64/include/asm/alternative.h+8−8
@@ -73,11 +73,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { } · 72 unmodified lines
7373 ".pushsection .altinstructions,\"a\"\n" \
7474 ALTINSTR_ENTRY(feature) \
7575 ".popsection\n" \
76− ".pushsection .altinstr_replacement, \"a\"\n" \
76+ ".subsection 1\n" \
7777 "663:\n\t" \
7878 newinstr "\n" \
7979 "664:\n\t" \
80− ".popsection\n\t" \
80+ ".previous\n\t" \
8181 ".org . - (664b-663b) + (662b-661b)\n\t" \
8282 ".org . - (662b-661b) + (664b-663b)\n" \
8383 ".endif\n"
@@ -117,9 +117,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } · 33 unmodified lines
117117 662: .pushsection .altinstructions, "a"
118118 altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f
119119 .popsection
120− .pushsection .altinstr_replacement, "ax"
120+ .subsection 1
121121 663: \insn2
122−664: .popsection
122+664: .previous
123123 .org . - (664b-663b) + (662b-661b)
124124 .org . - (662b-661b) + (664b-663b)
125125 .endif
@@ -160,7 +160,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } · 34 unmodified lines
160160 .pushsection .altinstructions, "a"
161161 altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f
162162 .popsection
163− .pushsection .altinstr_replacement, "ax"
163+ .subsection 1
164164 .align 2 /* So GAS knows label 661 is suitably aligned */
165165 661:
166166 .endm
@@ -179,9 +179,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } · 12 unmodified lines
179179 .macro alternative_else
180180 662:
181181 .if .Lasm_alt_mode==0
182− .pushsection .altinstr_replacement, "ax"
182+ .subsection 1
183183 .else
184− .popsection
184+ .previous
185185 .endif
186186 663:
187187 .endm
@@ -192,7 +192,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } · 4 unmodified lines
192192 .macro alternative_endif
193193 664:
194194 .if .Lasm_alt_mode==0
195− .popsection
195+ .previous
196196 .endif
197197 .org . - (664b-663b) + (662b-661b)
198198 .org . - (662b-661b) + (664b-663b)
arch/arm64/include/asm/arch_gicv3.h+1−1
@@ -109,7 +109,7 @@ static inline u32 gic_read_pmr(void) · 108 unmodified lines
109109 return read_sysreg_s(SYS_ICC_PMR_EL1);
110110 }
111111
112−static inline void gic_write_pmr(u32 val)
112+static __always_inline void gic_write_pmr(u32 val)
113113 {
114114 write_sysreg_s(val, SYS_ICC_PMR_EL1);
115115 }
arch/arm64/include/asm/arch_timer.h+1−0
@@ -58,6 +58,7 @@ struct arch_timer_erratum_workaround { · 57 unmodified lines
5858 u64 (*read_cntvct_el0)(void);
5959 int (*set_next_event_phys)(unsigned long, struct clock_event_device *);
6060 int (*set_next_event_virt)(unsigned long, struct clock_event_device *);
61+ bool disable_compat_vdso;
6162 };
6263
6364 DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *,
arch/arm64/include/asm/cpufeature.h+1−1
@@ -675,7 +675,7 @@ static inline bool system_supports_generic_auth(void) · 674 unmodified lines
675675 cpus_have_const_cap(ARM64_HAS_GENERIC_AUTH);
676676 }
677677
678−static inline bool system_uses_irq_prio_masking(void)
678+static __always_inline bool system_uses_irq_prio_masking(void)
679679 {
680680 return IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) &&
681681 cpus_have_const_cap(ARM64_HAS_IRQ_PRIO_MASKING);
arch/arm64/include/asm/cputype.h+2−0
@@ -86,6 +86,7 @@ · 85 unmodified lines
8686 #define QCOM_CPU_PART_FALKOR 0xC00
8787 #define QCOM_CPU_PART_KRYO 0x200
8888 #define QCOM_CPU_PART_KRYO_3XX_SILVER 0x803
89+#define QCOM_CPU_PART_KRYO_4XX_GOLD 0x804
8990 #define QCOM_CPU_PART_KRYO_4XX_SILVER 0x805
9091
9192 #define NVIDIA_CPU_PART_DENVER 0x003
@@ -114,6 +115,7 @@ · 22 unmodified lines
114115 #define MIDR_QCOM_FALKOR MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR)
115116 #define MIDR_QCOM_KRYO MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO)
116117 #define MIDR_QCOM_KRYO_3XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_3XX_SILVER)
118+#define MIDR_QCOM_KRYO_4XX_GOLD MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_4XX_GOLD)
117119 #define MIDR_QCOM_KRYO_4XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_4XX_SILVER)
118120 #define MIDR_NVIDIA_DENVER MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_DENVER)
119121 #define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL)
arch/arm64/include/asm/debug-monitors.h+2−0
@@ -109,6 +109,8 @@ void disable_debug_monitors(enum dbg_active_el el); · 108 unmodified lines
109109
110110 void user_rewind_single_step(struct task_struct *task);
111111 void user_fastforward_single_step(struct task_struct *task);
112+void user_regs_reset_single_step(struct user_pt_regs *regs,
113+ struct task_struct *task);
112114
113115 void kernel_enable_single_step(struct pt_regs *regs);
114116 void kernel_disable_single_step(void);
arch/arm64/include/asm/linkage.h+0−6
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 * instead.
1313 */
1414 #define BTI_C hint 34 ;
15−#define BTI_J hint 36 ;
1615
1716 /*
1817 * When using in-kernel BTI we need to ensure that PCS-conformant assembly
@@ -43,11 +42,6 @@ · 24 unmodified lines
4342 SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
4443 BTI_C
4544
46−#define SYM_INNER_LABEL(name, linkage) \
47− .type name SYM_T_NONE ASM_NL \
48− SYM_ENTRY(name, linkage, SYM_A_NONE) \
49− BTI_J
50−
5145 #endif
5246
5347 /*
arch/arm64/include/asm/mmu.h+3−0
@@ -19,6 +19,9 @@ · 18 unmodified lines
1919
2020 typedef struct {
2121 atomic64_t id;
22+#ifdef CONFIG_COMPAT
23+ void *sigpage;
24+#endif
2225 void *vdso;
2326 unsigned long flags;
2427 } mm_context_t;
arch/arm64/include/asm/pgtable-prot.h+1−1
@@ -67,7 +67,7 @@ extern bool arm64_use_ng_mappings; · 66 unmodified lines
6767 #define PAGE_HYP __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
6868 #define PAGE_HYP_EXEC __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
6969 #define PAGE_HYP_RO __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
70−#define PAGE_HYP_DEVICE __pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
70+#define PAGE_HYP_DEVICE __pgprot(_PROT_DEFAULT | PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_HYP | PTE_HYP_XN)
7171
7272 #define PAGE_S2_MEMATTR(attr) \
7373 ({ \
arch/arm64/include/asm/syscall.h+11−1
@@ -34,6 +34,10 @@ static inline long syscall_get_error(struct task_struct *task, · 33 unmodified lines
3434 struct pt_regs *regs)
3535 {
3636 unsigned long error = regs->regs[0];
37+
38+ if (is_compat_thread(task_thread_info(task)))
39+ error = sign_extend64(error, 31);
40+
3741 return IS_ERR_VALUE(error) ? error : 0;
3842 }
3943
@@ -47,7 +51,13 @@ static inline void syscall_set_return_value(struct task_struct *task, · 7 unmodified lines
4751 struct pt_regs *regs,
4852 int error, long val)
4953 {
50− regs->regs[0] = (long) error ? error : val;
54+ if (error)
55+ val = error;
56+
57+ if (is_compat_thread(task_thread_info(task)))
58+ val = lower_32_bits(val);
59+
60+ regs->regs[0] = val;
5161 }
5262
5363 #define SYSCALL_MAX_ARGS 6
arch/arm64/include/asm/thread_info.h+1−0
@@ -93,6 +93,7 @@ void arch_release_task_struct(struct task_struct *tsk); · 92 unmodified lines
9393 #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
9494 #define _TIF_UPROBE (1 << TIF_UPROBE)
9595 #define _TIF_FSCHECK (1 << TIF_FSCHECK)
96+#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
9697 #define _TIF_32BIT (1 << TIF_32BIT)
9798 #define _TIF_SVE (1 << TIF_SVE)
9899
arch/arm64/include/asm/vdso/clocksource.h+5−2
@@ -2,7 +2,10 @@ · 1 unmodified line
22 #ifndef __ASM_VDSOCLOCKSOURCE_H
33 #define __ASM_VDSOCLOCKSOURCE_H
44
5−#define VDSO_ARCH_CLOCKMODES \
6− VDSO_CLOCKMODE_ARCHTIMER
5+#define VDSO_ARCH_CLOCKMODES \
6+ /* vdso clocksource for both 32 and 64bit tasks */ \
7+ VDSO_CLOCKMODE_ARCHTIMER, \
8+ /* vdso clocksource for 64bit tasks only */ \
9+ VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT
710
811 #endif
arch/arm64/include/asm/vdso/compat_gettimeofday.h+7−1
@@ -111,7 +111,7 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode) · 110 unmodified lines
111111 * update. Return something. Core will do another round and then
112112 * see the mode change and fallback to the syscall.
113113 */
114− if (clock_mode == VDSO_CLOCKMODE_NONE)
114+ if (clock_mode != VDSO_CLOCKMODE_ARCHTIMER)
115115 return 0;
116116
117117 /*
@@ -152,6 +152,12 @@ static __always_inline const struct vdso_data *__arch_get_vdso_data(void) · 34 unmodified lines
152152 return ret;
153153 }
154154
155+static inline bool vdso_clocksource_ok(const struct vdso_data *vd)
156+{
157+ return vd->clock_mode == VDSO_CLOCKMODE_ARCHTIMER;
158+}
159+#define vdso_clocksource_ok vdso_clocksource_ok
160+
155161 #endif /* !__ASSEMBLY__ */
156162
157163 #endif /* __ASM_VDSO_GETTIMEOFDAY_H */
arch/arm64/kernel/Makefile+0−2
@@ -29,9 +29,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE · 28 unmodified lines
2929
3030 obj-$(CONFIG_COMPAT) += sys32.o signal32.o \
3131 sys_compat.o
32−ifneq ($(CONFIG_COMPAT_VDSO), y)
3332 obj-$(CONFIG_COMPAT) += sigreturn32.o
34−endif
3533 obj-$(CONFIG_KUSER_HELPERS) += kuser32.o
3634 obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o
3735 obj-$(CONFIG_MODULES) += module.o
arch/arm64/kernel/alternative.c+2−14
@@ -43,20 +43,8 @@ bool alternative_is_applied(u16 cpufeature) · 42 unmodified lines
4343 */
4444 static bool branch_insn_requires_update(struct alt_instr *alt, unsigned long pc)
4545 {
46− unsigned long replptr;
47−
48− if (kernel_text_address(pc))
49− return true;
50−
51− replptr = (unsigned long)ALT_REPL_PTR(alt);
52− if (pc >= replptr && pc <= (replptr + alt->alt_len))
53− return false;
54−
55− /*
56− * Branching into *another* alternate sequence is doomed, and
57− * we're not even trying to fix it up.
58− */
59− BUG();
46+ unsigned long replptr = (unsigned long)ALT_REPL_PTR(alt);
47+ return !(pc >= replptr && pc <= (replptr + alt->alt_len));
6048 }
6149
6250 #define align_down(x, a) ((unsigned long)(x) & ~(((unsigned long)(a)) - 1))
arch/arm64/kernel/cpu_errata.c+18−6
@@ -460,6 +460,8 @@ static const struct midr_range arm64_ssb_cpus[] = { · 459 unmodified lines
460460 MIDR_ALL_VERSIONS(MIDR_CORTEX_A53),
461461 MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
462462 MIDR_ALL_VERSIONS(MIDR_BRAHMA_B53),
463+ MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_3XX_SILVER),
464+ MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_SILVER),
463465 {},
464466 };
465467
@@ -470,12 +472,7 @@ static bool · 4 unmodified lines
470472 has_cortex_a76_erratum_1463225(const struct arm64_cpu_capabilities *entry,
471473 int scope)
472474 {
473− u32 midr = read_cpuid_id();
474− /* Cortex-A76 r0p0 - r3p1 */
475− struct midr_range range = MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1);
476−
477− WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
478− return is_midr_in_range(midr, &range) && is_kernel_in_hyp_mode();
475+ return is_affected_midr_range_list(entry, scope) && is_kernel_in_hyp_mode();
479476 }
480477 #endif
481478
@@ -726,6 +723,8 @@ static const struct midr_range erratum_1418040_list[] = { · 244 unmodified lines
726723 MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1),
727724 /* Neoverse-N1 r0p0 to r3p1 */
728725 MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 0, 3, 1),
726+ /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */
727+ MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf),
729728 {},
730729 };
731730 #endif
@@ -770,11 +769,23 @@ static const struct midr_range erratum_speculative_at_list[] = { · 38 unmodified lines
770769 #ifdef CONFIG_ARM64_ERRATUM_1530923
771770 /* Cortex A55 r0p0 to r2p0 */
772771 MIDR_RANGE(MIDR_CORTEX_A55, 0, 0, 2, 0),
772+ /* Kryo4xx Silver (rdpe => r1p0) */
773+ MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe),
773774 #endif
774775 {},
775776 };
776777 #endif
777778
779+#ifdef CONFIG_ARM64_ERRATUM_1463225
780+static const struct midr_range erratum_1463225[] = {
781+ /* Cortex-A76 r0p0 - r3p1 */
782+ MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1),
783+ /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */
784+ MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf),
785+ {},
786+};
787+#endif
788+
778789 const struct arm64_cpu_capabilities arm64_errata[] = {
779790 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
780791 {
@@ -914,6 +925,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { · 133 unmodified lines
914925 .capability = ARM64_WORKAROUND_1463225,
915926 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
916927 .matches = has_cortex_a76_erratum_1463225,
928+ .midr_range_list = erratum_1463225,
917929 },
918930 #endif
919931 #ifdef CONFIG_CAVIUM_TX2_ERRATUM_219
arch/arm64/kernel/cpufeature.c+4−0
@@ -1290,6 +1290,8 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, · 1289 unmodified lines
12901290 MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
12911291 MIDR_ALL_VERSIONS(MIDR_HISI_TSV110),
12921292 MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
1293+ MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_3XX_SILVER),
1294+ MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_SILVER),
12931295 { /* sentinel */ }
12941296 };
12951297 char const *str = "kpti command line option";
@@ -1406,6 +1408,8 @@ static bool cpu_has_broken_dbm(void) · 110 unmodified lines
14061408 static const struct midr_range cpus[] = {
14071409 #ifdef CONFIG_ARM64_ERRATUM_1024718
14081410 MIDR_RANGE(MIDR_CORTEX_A55, 0, 0, 1, 0), // A55 r0p0 -r1p0
1411+ /* Kryo4xx Silver (rdpe => r1p0) */
1412+ MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe),
14091413 #endif
14101414 {},
14111415 };
arch/arm64/kernel/debug-monitors.c+18−6
@@ -141,17 +141,20 @@ postcore_initcall(debug_monitors_init); · 140 unmodified lines
141141 /*
142142 * Single step API and exception handling.
143143 */
144−static void set_regs_spsr_ss(struct pt_regs *regs)
144+static void set_user_regs_spsr_ss(struct user_pt_regs *regs)
145145 {
146146 regs->pstate |= DBG_SPSR_SS;
147147 }
148−NOKPROBE_SYMBOL(set_regs_spsr_ss);
148+NOKPROBE_SYMBOL(set_user_regs_spsr_ss);
149149
150−static void clear_regs_spsr_ss(struct pt_regs *regs)
150+static void clear_user_regs_spsr_ss(struct user_pt_regs *regs)
151151 {
152152 regs->pstate &= ~DBG_SPSR_SS;
153153 }
154−NOKPROBE_SYMBOL(clear_regs_spsr_ss);
154+NOKPROBE_SYMBOL(clear_user_regs_spsr_ss);
155+
156+#define set_regs_spsr_ss(r) set_user_regs_spsr_ss(&(r)->user_regs)
157+#define clear_regs_spsr_ss(r) clear_user_regs_spsr_ss(&(r)->user_regs)
155158
156159 static DEFINE_SPINLOCK(debug_hook_lock);
157160 static LIST_HEAD(user_step_hook);
@@ -391,17 +394,26 @@ void user_rewind_single_step(struct task_struct *task) · 233 unmodified lines
391394 * If single step is active for this thread, then set SPSR.SS
392395 * to 1 to avoid returning to the active-pending state.
393396 */
394− if (test_ti_thread_flag(task_thread_info(task), TIF_SINGLESTEP))
397+ if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
395398 set_regs_spsr_ss(task_pt_regs(task));
396399 }
397400 NOKPROBE_SYMBOL(user_rewind_single_step);
398401
399402 void user_fastforward_single_step(struct task_struct *task)
400403 {
401− if (test_ti_thread_flag(task_thread_info(task), TIF_SINGLESTEP))
404+ if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
402405 clear_regs_spsr_ss(task_pt_regs(task));
403406 }
404407
408+void user_regs_reset_single_step(struct user_pt_regs *regs,
409+ struct task_struct *task)
410+{
411+ if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
412+ set_user_regs_spsr_ss(regs);
413+ else
414+ clear_user_regs_spsr_ss(regs);
415+}
416+
405417 /* Kernel API */
406418 void kernel_enable_single_step(struct pt_regs *regs)
407419 {
arch/arm64/kernel/entry-common.c+1−1
@@ -57,7 +57,7 @@ static void notrace el1_dbg(struct pt_regs *regs, unsigned long esr) · 56 unmodified lines
5757 /*
5858 * The CPU masked interrupts, and we are leaving them masked during
5959 * do_debug_exception(). Update PMR as if we had called
60− * local_mask_daif().
60+ * local_daif_mask().
6161 */
6262 if (system_uses_irq_prio_masking())
6363 gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
arch/arm64/kernel/entry.S+31−21
@@ -126,8 +126,10 @@ alternative_else_nop_endif · 125 unmodified lines
126126 add \dst, \dst, #(\sym - .entry.tramp.text)
127127 .endm
128128
129− // This macro corrupts x0-x3. It is the caller's duty
130− // to save/restore them if required.
129+ /*
130+ * This macro corrupts x0-x3. It is the caller's duty to save/restore
131+ * them if required.
132+ */
131133 .macro apply_ssbd, state, tmp1, tmp2
132134 #ifdef CONFIG_ARM64_SSBD
133135 alternative_cb arm64_enable_wa2_handling
@@ -167,13 +169,28 @@ alternative_cb_end · 33 unmodified lines
167169 stp x28, x29, [sp, #16 * 14]
168170
169171 .if \el == 0
172+ .if \regsize == 32
173+ /*
174+ * If we're returning from a 32-bit task on a system affected by
175+ * 1418040 then re-enable userspace access to the virtual counter.
176+ */
177+#ifdef CONFIG_ARM64_ERRATUM_1418040
178+alternative_if ARM64_WORKAROUND_1418040
179+ mrs x0, cntkctl_el1
180+ orr x0, x0, #2 // ARCH_TIMER_USR_VCT_ACCESS_EN
181+ msr cntkctl_el1, x0
182+alternative_else_nop_endif
183+#endif
184+ .endif
170185 clear_gp_regs
171186 mrs x21, sp_el0
172187 ldr_this_cpu tsk, __entry_task, x20
173188 msr sp_el0, tsk
174189
175− // Ensure MDSCR_EL1.SS is clear, since we can unmask debug exceptions
176− // when scheduling.
190+ /*
191+ * Ensure MDSCR_EL1.SS is clear, since we can unmask debug exceptions
192+ * when scheduling.
193+ */
177194 ldr x19, [tsk, #TSK_TI_FLAGS]
178195 disable_step_tsk x19, x20
179196
@@ -320,6 +337,14 @@ alternative_else_nop_endif · 140 unmodified lines
320337 tst x22, #PSR_MODE32_BIT // native task?
321338 b.eq 3f
322339
340+#ifdef CONFIG_ARM64_ERRATUM_1418040
341+alternative_if ARM64_WORKAROUND_1418040
342+ mrs x0, cntkctl_el1
343+ bic x0, x0, #2 // ARCH_TIMER_USR_VCT_ACCESS_EN
344+ msr cntkctl_el1, x0
345+alternative_else_nop_endif
346+#endif
347+
323348 #ifdef CONFIG_ARM64_ERRATUM_845719
324349 alternative_if ARM64_WORKAROUND_845719
325350 #ifdef CONFIG_PID_IN_CONTEXTIDR
@@ -331,21 +356,6 @@ alternative_if ARM64_WORKAROUND_845719 · 5 unmodified lines
331356 alternative_else_nop_endif
332357 #endif
333358 3:
334−#ifdef CONFIG_ARM64_ERRATUM_1418040
335−alternative_if_not ARM64_WORKAROUND_1418040
336− b 4f
337−alternative_else_nop_endif
338− /*
339− * if (x22.mode32 == cntkctl_el1.el0vcten)
340− * cntkctl_el1.el0vcten = ~cntkctl_el1.el0vcten
341− */
342− mrs x1, cntkctl_el1
343− eon x0, x1, x22, lsr #3
344− tbz x0, #1, 4f
345− eor x1, x1, #2 // ARCH_TIMER_USR_VCT_ACCESS_EN
346− msr cntkctl_el1, x1
347−4:
348−#endif
349359 scs_save tsk, x0
350360
351361 /* No kernel C function calls after this as user keys are set. */
@@ -377,11 +387,11 @@ alternative_else_nop_endif · 25 unmodified lines
377387 .if \el == 0
378388 alternative_insn eret, nop, ARM64_UNMAP_KERNEL_AT_EL0
379389 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
380− bne 5f
390+ bne 4f
381391 msr far_el1, x30
382392 tramp_alias x30, tramp_exit_native
383393 br x30
384−5:
394+4:
385395 tramp_alias x30, tramp_exit_compat
386396 br x30
387397 #endif
arch/arm64/kernel/kgdb.c+1−1
@@ -252,7 +252,7 @@ static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr) · 251 unmodified lines
252252 if (!kgdb_single_step)
253253 return DBG_HOOK_ERROR;
254254
255− kgdb_handle_exception(1, SIGTRAP, 0, regs);
255+ kgdb_handle_exception(0, SIGTRAP, 0, regs);
256256 return DBG_HOOK_HANDLED;
257257 }
258258 NOKPROBE_SYMBOL(kgdb_step_brk_fn);
arch/arm64/kernel/perf_regs.c+22−3
@@ -15,15 +15,34 @@ u64 perf_reg_value(struct pt_regs *regs, int idx) · 14 unmodified lines
1515 return 0;
1616
1717 /*
18− * Compat (i.e. 32 bit) mode:
19− * - PC has been set in the pt_regs struct in kernel_entry,
20− * - Handle SP and LR here.
18+ * Our handling of compat tasks (PERF_SAMPLE_REGS_ABI_32) is weird, but
19+ * we're stuck with it for ABI compatability reasons.
20+ *
21+ * For a 32-bit consumer inspecting a 32-bit task, then it will look at
22+ * the first 16 registers (see arch/arm/include/uapi/asm/perf_regs.h).
23+ * These correspond directly to a prefix of the registers saved in our
24+ * 'struct pt_regs', with the exception of the PC, so we copy that down
25+ * (x15 corresponds to SP_hyp in the architecture).
26+ *
27+ * So far, so good.
28+ *
29+ * The oddity arises when a 64-bit consumer looks at a 32-bit task and
30+ * asks for registers beyond PERF_REG_ARM_MAX. In this case, we return
31+ * SP_usr, LR_usr and PC in the positions where the AArch64 SP, LR and
32+ * PC registers would normally live. The initial idea was to allow a
33+ * 64-bit unwinder to unwind a 32-bit task and, although it's not clear
34+ * how well that works in practice, somebody might be relying on it.
35+ *
36+ * At the time we make a sample, we don't know whether the consumer is
37+ * 32-bit or 64-bit, so we have to cater for both possibilities.
2138 */
2239 if (compat_user_mode(regs)) {
2340 if ((u32)idx == PERF_REG_ARM64_SP)
2441 return regs->compat_sp;
2542 if ((u32)idx == PERF_REG_ARM64_LR)
2643 return regs->compat_lr;
44+ if (idx == 15)
45+ return regs->pc;
2746 }
2847
2948 if ((u32)idx == PERF_REG_ARM64_SP)
arch/arm64/kernel/probes/kprobes.c+3−9
@@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) · 119 unmodified lines
120120
121121 void *alloc_insn_page(void)
122122 {
123− void *page;
124−
125− page = vmalloc_exec(PAGE_SIZE);
126− if (page) {
127− set_memory_ro((unsigned long)page, 1);
128− set_vm_flush_reset_perms(page);
129− }
130−
131− return page;
123+ return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
124+ GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
125+ NUMA_NO_NODE, __builtin_return_address(0));
132126 }
133127
134128 /* arm kprobe: install breakpoint in text */
arch/arm64/kernel/ptrace.c+37−12
@@ -1811,19 +1811,42 @@ static void tracehook_report_syscall(struct pt_regs *regs, · 1810 unmodified lines
18111811 unsigned long saved_reg;
18121812
18131813 /*
1814− * A scratch register (ip(r12) on AArch32, x7 on AArch64) is
1815− * used to denote syscall entry/exit:
1814+ * We have some ABI weirdness here in the way that we handle syscall
1815+ * exit stops because we indicate whether or not the stop has been
1816+ * signalled from syscall entry or syscall exit by clobbering a general
1817+ * purpose register (ip/r12 for AArch32, x7 for AArch64) in the tracee
1818+ * and restoring its old value after the stop. This means that:
1819+ *
1820+ * - Any writes by the tracer to this register during the stop are
1821+ * ignored/discarded.
1822+ *
1823+ * - The actual value of the register is not available during the stop,
1824+ * so the tracer cannot save it and restore it later.
1825+ *
1826+ * - Syscall stops behave differently to seccomp and pseudo-step traps
1827+ * (the latter do not nobble any registers).
18161828 */
18171829 regno = (is_compat_task() ? 12 : 7);
18181830 saved_reg = regs->regs[regno];
18191831 regs->regs[regno] = dir;
18201832
1821− if (dir == PTRACE_SYSCALL_EXIT)
1833+ if (dir == PTRACE_SYSCALL_ENTER) {
1834+ if (tracehook_report_syscall_entry(regs))
1835+ forget_syscall(regs);
1836+ regs->regs[regno] = saved_reg;
1837+ } else if (!test_thread_flag(TIF_SINGLESTEP)) {
18221838 tracehook_report_syscall_exit(regs, 0);
1823− else if (tracehook_report_syscall_entry(regs))
1824− forget_syscall(regs);
1839+ regs->regs[regno] = saved_reg;
1840+ } else {
1841+ regs->regs[regno] = saved_reg;
18251842
1826− regs->regs[regno] = saved_reg;
1843+ /*
1844+ * Signal a pseudo-step exception since we are stepping but
1845+ * tracer modifications to the registers may have rewound the
1846+ * state machine.
1847+ */
1848+ tracehook_report_syscall_exit(regs, 1);
1849+ }
18271850 }
18281851
18291852 int syscall_trace_enter(struct pt_regs *regs)
@@ -1833,12 +1856,12 @@ int syscall_trace_enter(struct pt_regs *regs) · 3 unmodified lines
18331856 if (flags & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
18341857 tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
18351858 if (!in_syscall(regs) || (flags & _TIF_SYSCALL_EMU))
1836− return -1;
1859+ return NO_SYSCALL;
18371860 }
18381861
18391862 /* Do the secure computing after ptrace; failures should be fast. */
18401863 if (secure_computing() == -1)
1841− return -1;
1864+ return NO_SYSCALL;
18421865
18431866 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
18441867 trace_sys_enter(regs, regs->syscallno);
@@ -1851,12 +1874,14 @@ int syscall_trace_enter(struct pt_regs *regs) · 6 unmodified lines
18511874
18521875 void syscall_trace_exit(struct pt_regs *regs)
18531876 {
1877+ unsigned long flags = READ_ONCE(current_thread_info()->flags);
1878+
18541879 audit_syscall_exit(regs);
18551880
1856− if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
1881+ if (flags & _TIF_SYSCALL_TRACEPOINT)
18571882 trace_sys_exit(regs, regs_return_value(regs));
18581883
1859− if (test_thread_flag(TIF_SYSCALL_TRACE))
1884+ if (flags & (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP))
18601885 tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT);
18611886
18621887 rseq_syscall(regs);
@@ -1934,8 +1959,8 @@ static int valid_native_regs(struct user_pt_regs *regs) · 71 unmodified lines
19341959 */
19351960 int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task)
19361961 {
1937− if (!test_tsk_thread_flag(task, TIF_SINGLESTEP))
1938− regs->pstate &= ~DBG_SPSR_SS;
1962+ /* https://lore.kernel.org/lkml/20191118131525.GA4180@willie-the-truck */
1963+ user_regs_reset_single_step(regs, task);
19391964
19401965 if (is_compat_thread(task_thread_info(task)))
19411966 return valid_compat_regs(regs);
arch/arm64/kernel/signal.c+2−9
@@ -800,7 +800,6 @@ static void setup_restart_syscall(struct pt_regs *regs) · 799 unmodified lines
800800 */
801801 static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
802802 {
803− struct task_struct *tsk = current;
804803 sigset_t *oldset = sigmask_to_save();
805804 int usig = ksig->sig;
806805 int ret;
@@ -824,14 +823,8 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 17 unmodified lines
824823 */
825824 ret |= !valid_user_regs(&regs->user_regs, current);
826825
827− /*
828− * Fast forward the stepping logic so we step into the signal
829− * handler.
830− */
831− if (!ret)
832− user_fastforward_single_step(tsk);
833−
834− signal_setup_done(ret, ksig, 0);
826+ /* Step into the signal handler if we are stepping */
827+ signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP));
835828 }
836829
837830 /*
arch/arm64/kernel/signal32.c+1−26
@@ -342,38 +342,13 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka, · 341 unmodified lines
342342 retcode = ptr_to_compat(ka->sa.sa_restorer);
343343 } else {
344344 /* Set up sigreturn pointer */
345−#ifdef CONFIG_COMPAT_VDSO
346− void *vdso_base = current->mm->context.vdso;
347− void *vdso_trampoline;
348−
349− if (ka->sa.sa_flags & SA_SIGINFO) {
350− if (thumb) {
351− vdso_trampoline = VDSO_SYMBOL(vdso_base,
352− compat_rt_sigreturn_thumb);
353− } else {
354− vdso_trampoline = VDSO_SYMBOL(vdso_base,
355− compat_rt_sigreturn_arm);
356− }
357− } else {
358− if (thumb) {
359− vdso_trampoline = VDSO_SYMBOL(vdso_base,
360− compat_sigreturn_thumb);
361− } else {
362− vdso_trampoline = VDSO_SYMBOL(vdso_base,
363− compat_sigreturn_arm);
364− }
365− }
366−
367− retcode = ptr_to_compat(vdso_trampoline) + thumb;
368−#else
369345 unsigned int idx = thumb << 1;
370346
371347 if (ka->sa.sa_flags & SA_SIGINFO)
372348 idx += 3;
373349
374− retcode = (unsigned long)current->mm->context.vdso +
350+ retcode = (unsigned long)current->mm->context.sigpage +
375351 (idx << 2) + thumb;
376−#endif
377352 }
378353
379354 regs->regs[0] = usig;
arch/arm64/kernel/syscall.c+19−2
@@ -50,6 +50,9 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, · 49 unmodified lines
5050 ret = do_ni_syscall(regs, scno);
5151 }
5252
53+ if (is_compat_task())
54+ ret = lower_32_bits(ret);
55+
5356 regs->regs[0] = ret;
5457 }
5558
@@ -121,7 +124,21 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, · 65 unmodified lines
121124 user_exit();
122125
123126 if (has_syscall_work(flags)) {
124− /* set default errno for user-issued syscall(-1) */
127+ /*
128+ * The de-facto standard way to skip a system call using ptrace
129+ * is to set the system call to -1 (NO_SYSCALL) and set x0 to a
130+ * suitable error code for consumption by userspace. However,
131+ * this cannot be distinguished from a user-issued syscall(-1)
132+ * and so we must set x0 to -ENOSYS here in case the tracer doesn't
133+ * issue the skip and we fall into trace_exit with x0 preserved.
134+ *
135+ * This is slightly odd because it also means that if a tracer
136+ * sets the system call number to -1 but does not initialise x0,
137+ * then x0 will be preserved for all system calls apart from a
138+ * user-issued syscall(-1). However, requesting a skip and not
139+ * setting the return value is unlikely to do anything sensible
140+ * anyway.
141+ */
125142 if (scno == NO_SYSCALL)
126143 regs->regs[0] = -ENOSYS;
127144 scno = syscall_trace_enter(regs);
@@ -139,7 +156,7 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, · 11 unmodified lines
139156 if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
140157 local_daif_mask();
141158 flags = current_thread_info()->flags;
142− if (!has_syscall_work(flags)) {
159+ if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) {
143160 /*
144161 * We're off to userspace, where interrupts are
145162 * always enabled after we restore the flags from
arch/arm64/kernel/vdso.c+28−33
@@ -191,15 +191,12 @@ enum aarch32_map { · 190 unmodified lines
191191 #ifdef CONFIG_COMPAT_VDSO
192192 AA32_MAP_VVAR,
193193 AA32_MAP_VDSO,
194−#else
195− AA32_MAP_SIGPAGE
196194 #endif
195+ AA32_MAP_SIGPAGE
197196 };
198197
199198 static struct page *aarch32_vectors_page __ro_after_init;
200−#ifndef CONFIG_COMPAT_VDSO
201199 static struct page *aarch32_sig_page __ro_after_init;
202−#endif
203200
204201 static struct vm_special_mapping aarch32_vdso_maps[] = {
205202 [AA32_MAP_VECTORS] = {
@@ -214,12 +211,11 @@ static struct vm_special_mapping aarch32_vdso_maps[] = { · 8 unmodified lines
214211 .name = "[vdso]",
215212 .mremap = aarch32_vdso_mremap,
216213 },
217−#else
214+#endif /* CONFIG_COMPAT_VDSO */
218215 [AA32_MAP_SIGPAGE] = {
219216 .name = "[sigpage]", /* ABI */
220217 .pages = &aarch32_sig_page,
221218 },
222−#endif /* CONFIG_COMPAT_VDSO */
223219 };
224220
225221 static int aarch32_alloc_kuser_vdso_page(void)
@@ -242,27 +238,11 @@ static int aarch32_alloc_kuser_vdso_page(void) · 16 unmodified lines
242238 return 0;
243239 }
244240
245−#ifdef CONFIG_COMPAT_VDSO
246−static int __aarch32_alloc_vdso_pages(void)
247−{
248− int ret;
249−
250− vdso_info[VDSO_ABI_AA32].dm = &aarch32_vdso_maps[AA32_MAP_VVAR];
251− vdso_info[VDSO_ABI_AA32].cm = &aarch32_vdso_maps[AA32_MAP_VDSO];
252−
253− ret = __vdso_init(VDSO_ABI_AA32);
254− if (ret)
255− return ret;
256−
257− return aarch32_alloc_kuser_vdso_page();
258−}
259−#else
260−static int __aarch32_alloc_vdso_pages(void)
241+static int aarch32_alloc_sigpage(void)
261242 {
262243 extern char __aarch32_sigret_code_start[], __aarch32_sigret_code_end[];
263244 int sigret_sz = __aarch32_sigret_code_end - __aarch32_sigret_code_start;
264245 unsigned long sigpage;
265− int ret;
266246
267247 sigpage = get_zeroed_page(GFP_ATOMIC);
268248 if (!sigpage)
@@ -271,18 +251,34 @@ static int __aarch32_alloc_vdso_pages(void) · 2 unmodified lines
271251 memcpy((void *)sigpage, __aarch32_sigret_code_start, sigret_sz);
272252 aarch32_sig_page = virt_to_page(sigpage);
273253 flush_dcache_page(aarch32_sig_page);
254+ return 0;
255+}
274256
275− ret = aarch32_alloc_kuser_vdso_page();
276− if (ret)
277− free_page(sigpage);
257+#ifdef CONFIG_COMPAT_VDSO
258+static int __aarch32_alloc_vdso_pages(void)
259+{
260+ vdso_info[VDSO_ABI_AA32].dm = &aarch32_vdso_maps[AA32_MAP_VVAR];
261+ vdso_info[VDSO_ABI_AA32].cm = &aarch32_vdso_maps[AA32_MAP_VDSO];
278262
279− return ret;
263+ return __vdso_init(VDSO_ABI_AA32);
280264 }
281265 #endif /* CONFIG_COMPAT_VDSO */
282266
283267 static int __init aarch32_alloc_vdso_pages(void)
284268 {
285− return __aarch32_alloc_vdso_pages();
269+ int ret;
270+
271+#ifdef CONFIG_COMPAT_VDSO
272+ ret = __aarch32_alloc_vdso_pages();
273+ if (ret)
274+ return ret;
275+#endif
276+
277+ ret = aarch32_alloc_sigpage();
278+ if (ret)
279+ return ret;
280+
281+ return aarch32_alloc_kuser_vdso_page();
286282 }
287283 arch_initcall(aarch32_alloc_vdso_pages);
288284
@@ -305,7 +301,6 @@ static int aarch32_kuser_helpers_setup(struct mm_struct *mm) · 16 unmodified lines
305301 return PTR_ERR_OR_ZERO(ret);
306302 }
307303
308−#ifndef CONFIG_COMPAT_VDSO
309304 static int aarch32_sigreturn_setup(struct mm_struct *mm)
310305 {
311306 unsigned long addr;
@@ -328,12 +323,11 @@ static int aarch32_sigreturn_setup(struct mm_struct *mm) · 16 unmodified lines
328323 if (IS_ERR(ret))
329324 goto out;
330325
331− mm->context.vdso = (void *)addr;
326+ mm->context.sigpage = (void *)addr;
332327
333328 out:
334329 return PTR_ERR_OR_ZERO(ret);
335330 }
336−#endif /* !CONFIG_COMPAT_VDSO */
337331
338332 int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
339333 {
@@ -352,10 +346,11 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) · 12 unmodified lines
352346 mm,
353347 bprm,
354348 uses_interp);
355−#else
356− ret = aarch32_sigreturn_setup(mm);
349+ if (ret)
350+ goto out;
357351 #endif /* CONFIG_COMPAT_VDSO */
358352
353+ ret = aarch32_sigreturn_setup(mm);
359354 out:
360355 mmap_write_unlock(mm);
361356 return ret;
arch/arm64/kernel/vdso/Makefile+4−3
@@ -23,13 +23,14 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti · 22 unmodified lines
2323 # potential future proofing if we end up with internal calls to the exported
2424 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
2525 # preparation in build-time C")).
26−ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
27− -Bsymbolic --eh-frame-hdr --build-id -n $(btildflags-y) -T
26+ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
27+ -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id -n \
28+ $(btildflags-y) -T
2829
2930 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
3031 ccflags-y += -DDISABLE_BRANCH_PROFILING
3132
32−CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS)
33+CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) $(GCC_PLUGINS_CFLAGS)
3334 KBUILD_CFLAGS += $(DISABLE_LTO)
3435 KASAN_SANITIZE := n
3536 UBSAN_SANITIZE := n
arch/arm64/kernel/vdso/sigreturn.S+34−20
@@ -18,29 +18,40 @@ · 17 unmodified lines
1818
1919 .text
2020
21+/*
22+ * NOTE!!! You may notice that all of the .cfi directives in this file have
23+ * been commented out. This is because they have been shown to trigger segfaults
24+ * in libgcc when unwinding out of a SIGCANCEL handler to invoke pthread
25+ * cleanup handlers during the thread cancellation dance. By omitting the
26+ * directives, we trigger an arm64-specific fallback path in the unwinder which
27+ * recognises the signal frame and restores many of the registers directly from
28+ * the sigcontext. Re-enabling the cfi directives here therefore needs to be
29+ * much more comprehensive to reduce the risk of further regressions.
30+ */
31+
2132 /* Ensure that the mysterious NOP can be associated with a function. */
22− .cfi_startproc
33+// .cfi_startproc
2334
2435 /*
25− * .cfi_signal_frame causes the corresponding Frame Description Entry in the
26− * .eh_frame section to be annotated as a signal frame. This allows DWARF
27− * unwinders (e.g. libstdc++) to implement _Unwind_GetIPInfo(), which permits
28− * unwinding out of the signal trampoline without the need for the mysterious
29− * NOP.
36+ * .cfi_signal_frame causes the corresponding Frame Description Entry (FDE) in
37+ * the .eh_frame section to be annotated as a signal frame. This allows DWARF
38+ * unwinders (e.g. libstdc++) to implement _Unwind_GetIPInfo() and identify
39+ * the next frame using the unmodified return address instead of subtracting 1,
40+ * which may yield the wrong FDE.
3041 */
31− .cfi_signal_frame
42+// .cfi_signal_frame
3243
3344 /*
3445 * Tell the unwinder where to locate the frame record linking back to the
35− * interrupted context. We don't provide unwind info for registers other
36− * than the frame pointer and the link register here; in practice, this
37− * is sufficient for unwinding in C/C++ based runtimes and the values in
38− * the sigcontext may have been modified by this point anyway. Debuggers
46+ * interrupted context. We don't provide unwind info for registers other than
47+ * the frame pointer and the link register here; in practice, this is likely to
48+ * be insufficient for unwinding in C/C++ based runtimes, especially without a
49+ * means to restore the stack pointer. Thankfully, unwinders and debuggers
3950 * already have baked-in strategies for attempting to unwind out of signals.
4051 */
41− .cfi_def_cfa x29, 0
42− .cfi_offset x29, 0 * 8
43− .cfi_offset x30, 1 * 8
52+// .cfi_def_cfa x29, 0
53+// .cfi_offset x29, 0 * 8
54+// .cfi_offset x30, 1 * 8
4455
4556 /*
4657 * This mysterious NOP is required for some unwinders (e.g. libc++) that
@@ -51,16 +62,19 @@ · 4 unmodified lines
5162 nop // Mysterious NOP
5263
5364 /*
54− * GDB relies on being able to identify the sigreturn instruction sequence to
55− * unwind from signal handlers. We cannot, therefore, use SYM_FUNC_START()
56− * here, as it will emit a BTI C instruction and break the unwinder. Thankfully,
57− * this function is only ever called from a RET and so omitting the landing pad
58− * is perfectly fine.
65+ * GDB, libgcc and libunwind rely on being able to identify the sigreturn
66+ * instruction sequence to unwind from signal handlers. We cannot, therefore,
67+ * use SYM_FUNC_START() here, as it will emit a BTI C instruction and break the
68+ * unwinder. Thankfully, this function is only ever called from a RET and so
69+ * omitting the landing pad is perfectly fine.
5970 */
6071 SYM_CODE_START(__kernel_rt_sigreturn)
72+// PLEASE DO NOT MODIFY
6173 mov x8, #__NR_rt_sigreturn
74+// PLEASE DO NOT MODIFY
6275 svc #0
63− .cfi_endproc
76+// PLEASE DO NOT MODIFY
77+// .cfi_endproc
6478 SYM_CODE_END(__kernel_rt_sigreturn)
6579
6680 emit_aarch64_feature_1_and
arch/arm64/kernel/vdso32/Makefile+0−1
@@ -140,7 +140,6 @@ hostprogs := $(munge) · 139 unmodified lines
140140
141141 c-obj-vdso := note.o
142142 c-obj-vdso-gettimeofday := vgettimeofday.o
143−asm-obj-vdso := sigreturn.o
144143
145144 ifneq ($(c-gettimeofday-y),)
146145 VDSO_CFLAGS_gettimeofday_o += -include $(c-gettimeofday-y)
arch/arm64/kernel/vdso32/sigreturn.S+0−58
@@ -1,58 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−/*
3− * This file provides both A32 and T32 versions, in accordance with the
4− * arm sigreturn code.
5− *
6− * Please read the comments in arch/arm64/kernel/vdso/sigreturn.S to
7− * understand some of the craziness in here.
8− *
9− * Copyright (C) 2018 ARM Limited
10− */
11−
12−#include <linux/linkage.h>
13−#include <asm/asm-offsets.h>
14−#include <asm/unistd.h>
15−
16− .text
17−
18− .arm
19− .fnstart
20− .save {r0-r15}
21− .pad #COMPAT_SIGFRAME_REGS_OFFSET
22− nop
23−SYM_CODE_START(__kernel_sigreturn_arm)
24− mov r7, #__NR_compat_sigreturn
25− svc #0
26− .fnend
27−SYM_CODE_END(__kernel_sigreturn_arm)
28−
29− .fnstart
30− .save {r0-r15}
31− .pad #COMPAT_RT_SIGFRAME_REGS_OFFSET
32− nop
33−SYM_CODE_START(__kernel_rt_sigreturn_arm)
34− mov r7, #__NR_compat_rt_sigreturn
35− svc #0
36− .fnend
37−SYM_CODE_END(__kernel_rt_sigreturn_arm)
38−
39− .thumb
40− .fnstart
41− .save {r0-r15}
42− .pad #COMPAT_SIGFRAME_REGS_OFFSET
43− nop
44−SYM_CODE_START(__kernel_sigreturn_thumb)
45− mov r7, #__NR_compat_sigreturn
46− svc #0
47− .fnend
48−SYM_CODE_END(__kernel_sigreturn_thumb)
49−
50− .fnstart
51− .save {r0-r15}
52− .pad #COMPAT_RT_SIGFRAME_REGS_OFFSET
53− nop
54−SYM_CODE_START(__kernel_rt_sigreturn_thumb)
55− mov r7, #__NR_compat_rt_sigreturn
56− svc #0
57− .fnend
58−SYM_CODE_END(__kernel_rt_sigreturn_thumb)
arch/arm64/kernel/vdso32/vdso.lds.S+0−12
@@ -64,19 +64,7 @@ VERSION · 63 unmodified lines
6464 __vdso_clock_gettime;
6565 __vdso_gettimeofday;
6666 __vdso_clock_getres;
67− __kernel_sigreturn_arm;
68− __kernel_sigreturn_thumb;
69− __kernel_rt_sigreturn_arm;
70− __kernel_rt_sigreturn_thumb;
7167 __vdso_clock_gettime64;
7268 local: *;
7369 };
7470 }
75−
76−/*
77− * Make the sigreturn code visible to the kernel.
78− */
79−VDSO_compat_sigreturn_arm = __kernel_sigreturn_arm;
80−VDSO_compat_sigreturn_thumb = __kernel_sigreturn_thumb;
81−VDSO_compat_rt_sigreturn_arm = __kernel_rt_sigreturn_arm;
82−VDSO_compat_rt_sigreturn_thumb = __kernel_rt_sigreturn_thumb;
arch/arm64/kernel/vmlinux.lds.S+0−3
@@ -165,9 +165,6 @@ SECTIONS · 164 unmodified lines
165165 *(.altinstructions)
166166 __alt_instructions_end = .;
167167 }
168− .altinstr_replacement : {
169− *(.altinstr_replacement)
170− }
171168
172169 . = ALIGN(SEGMENT_ALIGN);
173170 __inittext_end = .;
arch/arm64/kvm/hyp-init.S+7−4
@@ -136,11 +136,15 @@ SYM_CODE_START(__kvm_handle_stub_hvc) · 135 unmodified lines
136136
137137 1: cmp x0, #HVC_RESET_VECTORS
138138 b.ne 1f
139−reset:
139+
140140 /*
141− * Reset kvm back to the hyp stub. Do not clobber x0-x4 in
142− * case we coming via HVC_SOFT_RESTART.
141+ * Set the HVC_RESET_VECTORS return code before entering the common
142+ * path so that we do not clobber x0-x2 in case we are coming via
143+ * HVC_SOFT_RESTART.
143144 */
145+ mov x0, xzr
146+reset:
147+ /* Reset kvm back to the hyp stub. */
144148 mrs x5, sctlr_el2
145149 mov_q x6, SCTLR_ELx_FLAGS
146150 bic x5, x5, x6 // Clear SCTL_M and etc
@@ -151,7 +155,6 @@ reset: · 4 unmodified lines
151155 /* Install stub vectors */
152156 adr_l x5, __hyp_stub_vectors
153157 msr vbar_el2, x5
154− mov x0, xzr
155158 eret
156159
157160 1: /* Bad stub call */
arch/arm64/kvm/pmu.c+6−1
@@ -159,7 +159,10 @@ static void kvm_vcpu_pmu_disable_el0(unsigned long events) · 158 unmodified lines
159159 }
160160
161161 /*
162− * On VHE ensure that only guest events have EL0 counting enabled
162+ * On VHE ensure that only guest events have EL0 counting enabled.
163+ * This is called from both vcpu_{load,put} and the sysreg handling.
164+ * Since the latter is preemptible, special care must be taken to
165+ * disable preemption.
163166 */
164167 void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu)
165168 {
@@ -169,12 +172,14 @@ void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) · 3 unmodified lines
169172 if (!has_vhe())
170173 return;
171174
175+ preempt_disable();
172176 host = this_cpu_ptr(&kvm_host_data);
173177 events_guest = host->pmu_events.events_guest;
174178 events_host = host->pmu_events.events_host;
175179
176180 kvm_vcpu_pmu_enable_el0(events_guest);
177181 kvm_vcpu_pmu_disable_el0(events_host);
182+ preempt_enable();
178183 }
179184
180185 /*
arch/arm64/kvm/pvtime.c+12−3
@@ -3,6 +3,7 @@ · 2 unmodified lines
33
44 #include <linux/arm-smccc.h>
55 #include <linux/kvm_host.h>
6+#include <linux/sched/stat.h>
67
78 #include <asm/kvm_mmu.h>
89 #include <asm/pvclock-abi.h>
@@ -73,6 +74,11 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu) · 64 unmodified lines
7374 return base;
7475 }
7576
77+static bool kvm_arm_pvtime_supported(void)
78+{
79+ return !!sched_info_on();
80+}
81+
7682 int kvm_arm_pvtime_set_attr(struct kvm_vcpu *vcpu,
7783 struct kvm_device_attr *attr)
7884 {
@@ -82,7 +88,8 @@ int kvm_arm_pvtime_set_attr(struct kvm_vcpu *vcpu, · 3 unmodified lines
8288 int ret = 0;
8389 int idx;
8490
85− if (attr->attr != KVM_ARM_VCPU_PVTIME_IPA)
91+ if (!kvm_arm_pvtime_supported() ||
92+ attr->attr != KVM_ARM_VCPU_PVTIME_IPA)
8693 return -ENXIO;
8794
8895 if (get_user(ipa, user))
@@ -110,7 +117,8 @@ int kvm_arm_pvtime_get_attr(struct kvm_vcpu *vcpu, · 21 unmodified lines
110117 u64 __user *user = (u64 __user *)attr->addr;
111118 u64 ipa;
112119
113− if (attr->attr != KVM_ARM_VCPU_PVTIME_IPA)
120+ if (!kvm_arm_pvtime_supported() ||
121+ attr->attr != KVM_ARM_VCPU_PVTIME_IPA)
114122 return -ENXIO;
115123
116124 ipa = vcpu->arch.steal.base;
@@ -125,7 +133,8 @@ int kvm_arm_pvtime_has_attr(struct kvm_vcpu *vcpu, · 8 unmodified lines
125133 {
126134 switch (attr->attr) {
127135 case KVM_ARM_VCPU_PVTIME_IPA:
128− return 0;
136+ if (kvm_arm_pvtime_supported())
137+ return 0;
129138 }
130139 return -ENXIO;
131140 }
arch/arm64/kvm/reset.c+7−3
@@ -245,7 +245,7 @@ static int kvm_vcpu_enable_ptrauth(struct kvm_vcpu *vcpu) · 244 unmodified lines
245245 */
246246 int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
247247 {
248− int ret = -EINVAL;
248+ int ret;
249249 bool loaded;
250250 u32 pstate;
251251
@@ -269,15 +269,19 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) · 17 unmodified lines
269269
270270 if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) ||
271271 test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) {
272− if (kvm_vcpu_enable_ptrauth(vcpu))
272+ if (kvm_vcpu_enable_ptrauth(vcpu)) {
273+ ret = -EINVAL;
273274 goto out;
275+ }
274276 }
275277
276278 switch (vcpu->arch.target) {
277279 default:
278280 if (test_bit(KVM_ARM_VCPU_EL1_32BIT, vcpu->arch.features)) {
279− if (!cpus_have_const_cap(ARM64_HAS_32BIT_EL1))
281+ if (!cpus_have_const_cap(ARM64_HAS_32BIT_EL1)) {
282+ ret = -EINVAL;
280283 goto out;
284+ }
281285 pstate = VCPU_RESET_PSTATE_SVC;
282286 } else {
283287 pstate = VCPU_RESET_PSTATE_EL1;
arch/arm64/kvm/vgic/vgic-v4.c+8−0
@@ -90,7 +90,15 @@ static irqreturn_t vgic_v4_doorbell_handler(int irq, void *info) · 89 unmodified lines
9090 !irqd_irq_disabled(&irq_to_desc(irq)->irq_data))
9191 disable_irq_nosync(irq);
9292
93+ /*
94+ * The v4.1 doorbell can fire concurrently with the vPE being
95+ * made non-resident. Ensure we only update pending_last
96+ * *after* the non-residency sequence has completed.
97+ */
98+ raw_spin_lock(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vpe_lock);
9399 vcpu->arch.vgic_cpu.vgic_v3.its_vpe.pending_last = true;
100+ raw_spin_unlock(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vpe_lock);
101+
94102 kvm_make_request(KVM_REQ_IRQ_PENDING, vcpu);
95103 kvm_vcpu_kick(vcpu);
96104
arch/m68k/kernel/setup_no.c+2−1
@@ -138,7 +138,8 @@ void __init setup_arch(char **cmdline_p) · 137 unmodified lines
138138 pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ",
139139 __bss_stop, memory_start, memory_start, memory_end);
140140
141− memblock_add(memory_start, memory_end - memory_start);
141+ memblock_add(_rambase, memory_end - _rambase);
142+ memblock_reserve(_rambase, memory_start - _rambase);
142143
143144 /* Keep a copy of command line */
144145 *cmdline_p = &command_line[0];
arch/m68k/mm/mcfmmu.c+1−1
@@ -174,7 +174,7 @@ void __init cf_bootmem_alloc(void) · 173 unmodified lines
174174 m68k_memory[0].addr = _rambase;
175175 m68k_memory[0].size = _ramend - _rambase;
176176
177− memblock_add(m68k_memory[0].addr, m68k_memory[0].size);
177+ memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0);
178178
179179 /* compute total pages in system */
180180 num_pages = PFN_DOWN(_ramend - _rambase);
arch/mips/boot/dts/ingenic/gcw0.dts+1−1
@@ -92,7 +92,7 @@ · 91 unmodified lines
9292 "MIC1N", "Built-in Mic";
9393 simple-audio-card,pin-switches = "Speaker", "Headphones";
9494
95− simple-audio-card,hp-det-gpio = <&gpf 21 GPIO_ACTIVE_HIGH>;
95+ simple-audio-card,hp-det-gpio = <&gpf 21 GPIO_ACTIVE_LOW>;
9696 simple-audio-card,aux-devs = <&speaker_amp>, <&headphones_amp>;
9797
9898 simple-audio-card,bitclock-master = <&dai_codec>;
arch/mips/include/asm/unroll.h+3−5
@@ -19,15 +19,13 @@ · 18 unmodified lines
1919 \
2020 /* \
2121 * We can't unroll if the number of iterations isn't \
22− * compile-time constant. Unfortunately GCC versions \
23− * up until 4.6 tend to miss obvious constants & cause \
22+ * compile-time constant. Unfortunately clang versions \
23+ * up until 8.0 tend to miss obvious constants & cause \
2424 * this check to fail, even though they go on to \
2525 * generate reasonable code for the switch statement, \
2626 * so we skip the sanity check for those compilers. \
2727 */ \
28− BUILD_BUG_ON((CONFIG_GCC_VERSION >= 40700 || \
29− CONFIG_CLANG_VERSION >= 80000) && \
30− !__builtin_constant_p(times)); \
28+ BUILD_BUG_ON(!__builtin_constant_p(times)); \
3129 \
3230 switch (times) { \
3331 case 32: fn(__VA_ARGS__); /* fall through */ \
arch/mips/kernel/traps.c+6−3
@@ -723,12 +723,14 @@ static int simulate_loongson3_cpucfg(struct pt_regs *regs, · 722 unmodified lines
723723 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);
724724
725725 /* Do not emulate on unsupported core models. */
726− if (!loongson3_cpucfg_emulation_enabled(&current_cpu_data))
726+ preempt_disable();
727+ if (!loongson3_cpucfg_emulation_enabled(&current_cpu_data)) {
728+ preempt_enable();
727729 return -1;
728−
730+ }
729731 regs->regs[rd] = loongson3_cpucfg_read_synthesized(
730732 &current_cpu_data, sel);
731−
733+ preempt_enable();
732734 return 0;
733735 }
734736
@@ -2169,6 +2171,7 @@ static void configure_status(void) · 1434 unmodified lines
21692171
21702172 change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
21712173 status_set);
2174+ back_to_back_c0_hazard();
21722175 }
21732176
21742177 unsigned int hwrena;
arch/mips/kvm/emulate.c+4−0
@@ -1722,6 +1722,7 @@ enum emulation_result kvm_mips_emulate_store(union mips_instruction inst, · 1721 unmodified lines
17221722 vcpu->arch.gprs[rt], *(u32 *)data);
17231723 break;
17241724
1725+#if defined(CONFIG_64BIT) && defined(CONFIG_KVM_MIPS_VZ)
17251726 case sdl_op:
17261727 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
17271728 vcpu->arch.host_cp0_badvaddr) & (~0x7);
@@ -1815,6 +1816,7 @@ enum emulation_result kvm_mips_emulate_store(union mips_instruction inst, · 87 unmodified lines
18151816 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
18161817 vcpu->arch.gprs[rt], *(u64 *)data);
18171818 break;
1819+#endif
18181820
18191821 #ifdef CONFIG_CPU_LOONGSON64
18201822 case sdc2_op:
@@ -2002,6 +2004,7 @@ enum emulation_result kvm_mips_emulate_load(union mips_instruction inst, · 181 unmodified lines
20022004 }
20032005 break;
20042006
2007+#if defined(CONFIG_64BIT) && defined(CONFIG_KVM_MIPS_VZ)
20052008 case ldl_op:
20062009 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
20072010 vcpu->arch.host_cp0_badvaddr) & (~0x7);
@@ -2073,6 +2076,7 @@ enum emulation_result kvm_mips_emulate_load(union mips_instruction inst, · 65 unmodified lines
20732076 break;
20742077 }
20752078 break;
2079+#endif
20762080
20772081 #ifdef CONFIG_CPU_LOONGSON64
20782082 case ldc2_op:
arch/mips/kvm/mips.c+2−0
@@ -67,7 +67,9 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { · 66 unmodified lines
6767 VCPU_STAT("vz_ghfc", vz_ghfc_exits),
6868 VCPU_STAT("vz_gpa", vz_gpa_exits),
6969 VCPU_STAT("vz_resvd", vz_resvd_exits),
70+#ifdef CONFIG_CPU_LOONGSON64
7071 VCPU_STAT("vz_cpucfg", vz_cpucfg_exits),
72+#endif
7173 #endif
7274 VCPU_STAT("halt_successful_poll", halt_successful_poll),
7375 VCPU_STAT("halt_attempted_poll", halt_attempted_poll),
arch/mips/lantiq/xway/sysctrl.c+4−4
@@ -514,8 +514,8 @@ void __init ltq_soc_init(void) · 513 unmodified lines
514514 clkdev_add_pmu("1e10b308.eth", NULL, 0, 0, PMU_SWITCH |
515515 PMU_PPE_DP | PMU_PPE_TC);
516516 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
517− clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY);
518− clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY);
517+ clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY);
518+ clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY);
519519 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
520520 clkdev_add_pmu("1e116000.mei", "afe", 1, 2, PMU_ANALOG_DSL_AFE);
521521 clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
@@ -538,8 +538,8 @@ void __init ltq_soc_init(void) · 16 unmodified lines
538538 PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM |
539539 PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 |
540540 PMU_PPE_QSB | PMU_PPE_TOP);
541− clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY);
542− clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY);
541+ clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY);
542+ clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY);
543543 clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO);
544544 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
545545 clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
arch/mips/pci/pci-xtalk-bridge.c+3−2
@@ -627,9 +627,10 @@ static int bridge_probe(struct platform_device *pdev) · 626 unmodified lines
627627 return -ENOMEM;
628628 domain = irq_domain_create_hierarchy(parent, 0, 8, fn,
629629 &bridge_domain_ops, NULL);
630− irq_domain_free_fwnode(fn);
631− if (!domain)
630+ if (!domain) {
631+ irq_domain_free_fwnode(fn);
632632 return -ENOMEM;
633+ }
633634
634635 pci_set_flags(PCI_PROBE_ONLY);
635636
arch/openrisc/kernel/dma.c+5−0
@@ -74,8 +74,11 @@ void *arch_dma_set_uncached(void *cpu_addr, size_t size) · 73 unmodified lines
7474 * We need to iterate through the pages, clearing the dcache for
7575 * them and setting the cache-inhibit bit.
7676 */
77+ mmap_read_lock(&init_mm);
7778 error = walk_page_range(&init_mm, va, va + size, &set_nocache_walk_ops,
7879 NULL);
80+ mmap_read_unlock(&init_mm);
81+
7982 if (error)
8083 return ERR_PTR(error);
8184 return cpu_addr;
@@ -85,9 +88,11 @@ void arch_dma_clear_uncached(void *cpu_addr, size_t size) · 3 unmodified lines
8588 {
8689 unsigned long va = (unsigned long)cpu_addr;
8790
91+ mmap_read_lock(&init_mm);
8892 /* walk_page_range shouldn't be able to fail here */
8993 WARN_ON(walk_page_range(&init_mm, va, va + size,
9094 &clear_nocache_walk_ops, NULL));
95+ mmap_read_unlock(&init_mm);
9196 }
9297
9398 void arch_sync_dma_for_device(phys_addr_t addr, size_t size,
arch/powerpc/include/asm/icswx.h+2−0
@@ -77,6 +77,8 @@ struct coprocessor_completion_block { · 76 unmodified lines
7777 #define CSB_CC_CHAIN (37)
7878 #define CSB_CC_SEQUENCE (38)
7979 #define CSB_CC_HW (39)
80+/* P9 DD2 NX Workbook 3.2 (Table 4-36): Address translation fault */
81+#define CSB_CC_FAULT_ADDRESS (250)
8082
8183 #define CSB_SIZE (0x10)
8284 #define CSB_ALIGN CSB_SIZE
arch/powerpc/kernel/exceptions-64s.S+1−1
@@ -2551,7 +2551,7 @@ EXC_VIRT_NONE(0x5400, 0x100) · 2550 unmodified lines
25512551 INT_DEFINE_BEGIN(denorm_exception)
25522552 IVEC=0x1500
25532553 IHSRR=1
2554− IBRANCH_COMMON=0
2554+ IBRANCH_TO_COMMON=0
25552555 IKVM_REAL=1
25562556 INT_DEFINE_END(denorm_exception)
25572557
arch/powerpc/kernel/paca.c+1−1
@@ -87,7 +87,7 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align, · 86 unmodified lines
8787 * This is very early in boot, so no harm done if the kernel crashes at
8888 * this point.
8989 */
90− BUG_ON(shared_lppaca_size >= shared_lppaca_total_size);
90+ BUG_ON(shared_lppaca_size > shared_lppaca_total_size);
9191
9292 return ptr;
9393 }
arch/powerpc/kvm/book3s_64_mmu_radix.c+2−1
@@ -40,7 +40,8 @@ unsigned long __kvmhv_copy_tofrom_guest_radix(int lpid, int pid, · 39 unmodified lines
4040 /* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */
4141 if (kvmhv_on_pseries())
4242 return plpar_hcall_norets(H_COPY_TOFROM_GUEST, lpid, pid, eaddr,
43− __pa(to), __pa(from), n);
43+ (to != NULL) ? __pa(to): 0,
44+ (from != NULL) ? __pa(from): 0, n);
4445
4546 quadrant = 1;
4647 if (!pid)
arch/powerpc/mm/book3s64/pkeys.c+7−8
@@ -353,16 +353,15 @@ static bool pkey_access_permitted(int pkey, bool write, bool execute) · 352 unmodified lines
353353 int pkey_shift;
354354 u64 amr;
355355
356− if (!is_pkey_enabled(pkey))
357− return true;
358−
359356 pkey_shift = pkeyshift(pkey);
360− if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift)))
361− return true;
357+ if (execute)
358+ return !(read_iamr() & (IAMR_EX_BIT << pkey_shift));
359+
360+ amr = read_amr();
361+ if (write)
362+ return !(amr & (AMR_WR_BIT << pkey_shift));
362363
363− amr = read_amr(); /* Delay reading amr until absolutely needed */
364− return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) ||
365− (write && !(amr & (AMR_WR_BIT << pkey_shift))));
364+ return !(amr & (AMR_RD_BIT << pkey_shift));
366365 }
367366
368367 bool arch_pte_access_permitted(u64 pte, bool write, bool execute)
arch/powerpc/mm/nohash/kaslr_booke.c+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/memblock.h>
1515 #include <linux/libfdt.h>
1616 #include <linux/crash_core.h>
17+#include <asm/cacheflush.h>
1718 #include <asm/pgalloc.h>
1819 #include <asm/prom.h>
1920 #include <asm/kdump.h>
arch/powerpc/platforms/powernv/vas-fault.c+1−1
@@ -79,7 +79,7 @@ static void update_csb(struct vas_window *window, · 78 unmodified lines
7979 csb_addr = (void __user *)be64_to_cpu(crb->csb_addr);
8080
8181 memset(&csb, 0, sizeof(csb));
82− csb.cc = CSB_CC_TRANSLATION;
82+ csb.cc = CSB_CC_FAULT_ADDRESS;
8383 csb.ce = CSB_CE_TERMINATION;
8484 csb.cs = 0;
8585 csb.count = 0;
arch/riscv/Kconfig+2−0
@@ -23,6 +23,8 @@ config RISCV · 22 unmodified lines
2323 select ARCH_HAS_SET_DIRECT_MAP
2424 select ARCH_HAS_SET_MEMORY
2525 select ARCH_HAS_STRICT_KERNEL_RWX if MMU
26+ select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
27+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
2628 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
2729 select ARCH_WANT_FRAME_POINTERS
2830 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
arch/riscv/include/asm/barrier.h+9−1
@@ -58,8 +58,16 @@ do { \ · 57 unmodified lines
5858 * The AQ/RL pair provides a RCpc critical section, but there's not really any
5959 * way we can take advantage of that here because the ordering is only enforced
6060 * on that one lock. Thus, we're just doing a full fence.
61+ *
62+ * Since we allow writeX to be called from preemptive regions we need at least
63+ * an "o" in the predecessor set to ensure device writes are visible before the
64+ * task is marked as available for scheduling on a new hart. While I don't see
65+ * any concrete reason we need a full IO fence, it seems safer to just upgrade
66+ * this in order to avoid any IO crossing a scheduling boundary. In both
67+ * instances the scheduler pairs this with an mb(), so nothing is necessary on
68+ * the new hart.
6169 */
62−#define smp_mb__after_spinlock() RISCV_FENCE(rw,rw)
70+#define smp_mb__after_spinlock() RISCV_FENCE(iorw,iorw)
6371
6472 #include <asm-generic/barrier.h>
6573
arch/riscv/include/asm/gdb_xml.h+1−2
@@ -3,8 +3,7 @@ · 2 unmodified lines
33 #ifndef __ASM_GDB_XML_H_
44 #define __ASM_GDB_XML_H_
55
6−#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
7−static const char riscv_gdb_stub_feature[64] =
6+const char riscv_gdb_stub_feature[64] =
87 "PacketSize=800;qXfer:features:read+;";
98
109 static const char gdb_xfer_read_target[31] = "qXfer:features:read:target.xml:";
arch/riscv/include/asm/kgdb.h+3−2
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919
2020 #ifndef __ASSEMBLY__
2121
22−extern int kgdb_has_hit_break(unsigned long addr);
2322 extern unsigned long kgdb_compiled_break;
2423
2524 static inline void arch_kgdb_breakpoint(void)
@@ -106,7 +105,9 @@ static inline void arch_kgdb_breakpoint(void) · 80 unmodified lines
106105 #define DBG_REG_BADADDR_OFF 34
107106 #define DBG_REG_CAUSE_OFF 35
108107
109−#include <asm/gdb_xml.h>
108+extern const char riscv_gdb_stub_feature[64];
109+
110+#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
110111
111112 #endif
112113 #endif
arch/riscv/include/asm/thread_info.h+4−0
@@ -12,7 +12,11 @@ · 11 unmodified lines
1212 #include <linux/const.h>
1313
1414 /* thread information allocation */
15+#ifdef CONFIG_64BIT
16+#define THREAD_SIZE_ORDER (2)
17+#else
1518 #define THREAD_SIZE_ORDER (1)
19+#endif
1620 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
1721
1822 #ifndef __ASSEMBLY__
arch/riscv/kernel/kgdb.c+5−5
@@ -44,18 +44,18 @@ DECLARE_INSN(c_beqz, MATCH_C_BEQZ, MASK_C_BEQZ) · 43 unmodified lines
4444 DECLARE_INSN(c_bnez, MATCH_C_BNEZ, MASK_C_BNEZ)
4545 DECLARE_INSN(sret, MATCH_SRET, MASK_SRET)
4646
47−int decode_register_index(unsigned long opcode, int offset)
47+static int decode_register_index(unsigned long opcode, int offset)
4848 {
4949 return (opcode >> offset) & 0x1F;
5050 }
5151
52−int decode_register_index_short(unsigned long opcode, int offset)
52+static int decode_register_index_short(unsigned long opcode, int offset)
5353 {
5454 return ((opcode >> offset) & 0x7) + 8;
5555 }
5656
5757 /* Calculate the new address for after a step */
58−int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
58+static int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
5959 {
6060 unsigned long pc = regs->epc;
6161 unsigned long *regs_ptr = (unsigned long *)regs;
@@ -136,7 +136,7 @@ int get_step_address(struct pt_regs *regs, unsigned long *next_addr) · 74 unmodified lines
136136 return 0;
137137 }
138138
139−int do_single_step(struct pt_regs *regs)
139+static int do_single_step(struct pt_regs *regs)
140140 {
141141 /* Determine where the target instruction will send us to */
142142 unsigned long addr = 0;
@@ -320,7 +320,7 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code, · 177 unmodified lines
320320 return err;
321321 }
322322
323−int kgdb_riscv_kgdbbreak(unsigned long addr)
323+static int kgdb_riscv_kgdbbreak(unsigned long addr)
324324 {
325325 if (stepped_address == addr)
326326 return KGDB_SW_SINGLE_STEP;
arch/riscv/kernel/vdso/Makefile+4−1
@@ -17,7 +17,7 @@ vdso-syms += flush_icache · 16 unmodified lines
1717 obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1818
1919 ifneq ($(c-gettimeofday-y),)
20− CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
20+ CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
2121 endif
2222
2323 # Build rules
@@ -27,6 +27,9 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) · 3 unmodified lines
2727 obj-y += vdso.o vdso-syms.o
2828 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
2929
30+# Disable -pg to prevent insert call site
31+CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
32+
3033 # Disable gcov profiling for VDSO code
3134 GCOV_PROFILE := n
3235
arch/riscv/kernel/vdso/vgettimeofday.c+6−0
@@ -9,16 +9,22 @@ · 8 unmodified lines
99 #include <linux/time.h>
1010 #include <linux/types.h>
1111
12+extern
13+int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
1214 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
1315 {
1416 return __cvdso_clock_gettime(clock, ts);
1517 }
1618
19+extern
20+int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
1721 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
1822 {
1923 return __cvdso_gettimeofday(tv, tz);
2024 }
2125
26+extern
27+int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
2228 int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
2329 {
2430 return __cvdso_clock_getres(clock_id, res);
arch/s390/configs/debug_defconfig+35−9
@@ -1,5 +1,6 @@
11 CONFIG_SYSVIPC=y
22 CONFIG_POSIX_MQUEUE=y
3+CONFIG_WATCH_QUEUE=y
34 CONFIG_AUDIT=y
45 CONFIG_NO_HZ_IDLE=y
56 CONFIG_HIGH_RES_TIMERS=y
@@ -14,7 +15,6 @@ CONFIG_IKCONFIG=y · 8 unmodified lines
1415 CONFIG_IKCONFIG_PROC=y
1516 CONFIG_NUMA_BALANCING=y
1617 CONFIG_MEMCG=y
17−CONFIG_MEMCG_SWAP=y
1818 CONFIG_BLK_CGROUP=y
1919 CONFIG_CFS_BANDWIDTH=y
2020 CONFIG_RT_GROUP_SCHED=y
@@ -31,9 +31,9 @@ CONFIG_NAMESPACES=y · 10 unmodified lines
3131 CONFIG_USER_NS=y
3232 CONFIG_CHECKPOINT_RESTORE=y
3333 CONFIG_SCHED_AUTOGROUP=y
34−CONFIG_BLK_DEV_INITRD=y
3534 CONFIG_EXPERT=y
3635 # CONFIG_SYSFS_SYSCALL is not set
36+CONFIG_BPF_LSM=y
3737 CONFIG_BPF_SYSCALL=y
3838 CONFIG_USERFAULTFD=y
3939 # CONFIG_COMPAT_BRK is not set
@@ -51,14 +51,11 @@ CONFIG_CHSC_SCH=y · 11 unmodified lines
5151 CONFIG_VFIO_CCW=m
5252 CONFIG_VFIO_AP=m
5353 CONFIG_CRASH_DUMP=y
54−CONFIG_HIBERNATION=y
55−CONFIG_PM_DEBUG=y
5654 CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
5755 CONFIG_CMM=m
5856 CONFIG_APPLDATA_BASE=y
5957 CONFIG_KVM=m
60−CONFIG_VHOST_NET=m
61−CONFIG_VHOST_VSOCK=m
58+CONFIG_S390_UNWIND_SELFTEST=y
6259 CONFIG_OPROFILE=m
6360 CONFIG_KPROBES=y
6461 CONFIG_JUMP_LABEL=y
@@ -77,6 +74,8 @@ CONFIG_BLK_DEV_THROTTLING=y · 12 unmodified lines
7774 CONFIG_BLK_WBT=y
7875 CONFIG_BLK_CGROUP_IOLATENCY=y
7976 CONFIG_BLK_CGROUP_IOCOST=y
77+CONFIG_BLK_INLINE_ENCRYPTION=y
78+CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK=y
8079 CONFIG_PARTITION_ADVANCED=y
8180 CONFIG_IBM_PARTITION=y
8281 CONFIG_BSD_DISKLABEL=y
@@ -96,7 +95,6 @@ CONFIG_CMA_DEBUG=y · 13 unmodified lines
9695 CONFIG_CMA_DEBUGFS=y
9796 CONFIG_MEM_SOFT_DIRTY=y
9897 CONFIG_ZSWAP=y
99−CONFIG_ZBUD=m
10098 CONFIG_ZSMALLOC=m
10199 CONFIG_ZSMALLOC_STAT=y
102100 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
@@ -130,6 +128,7 @@ CONFIG_SYN_COOKIES=y · 27 unmodified lines
130128 CONFIG_NET_IPVTI=m
131129 CONFIG_INET_AH=m
132130 CONFIG_INET_ESP=m
131+CONFIG_INET_ESPINTCP=y
133132 CONFIG_INET_IPCOMP=m
134133 CONFIG_INET_DIAG=m
135134 CONFIG_INET_UDP_DIAG=m
@@ -144,6 +143,7 @@ CONFIG_TCP_CONG_ILLINOIS=m · 8 unmodified lines
144143 CONFIG_IPV6_ROUTER_PREF=y
145144 CONFIG_INET6_AH=m
146145 CONFIG_INET6_ESP=m
146+CONFIG_INET6_ESPINTCP=y
147147 CONFIG_INET6_IPCOMP=m
148148 CONFIG_IPV6_MIP6=m
149149 CONFIG_IPV6_VTI=m
@@ -151,7 +151,10 @@ CONFIG_IPV6_SIT=m · 1 unmodified line
151151 CONFIG_IPV6_GRE=m
152152 CONFIG_IPV6_MULTIPLE_TABLES=y
153153 CONFIG_IPV6_SUBTREES=y
154+CONFIG_IPV6_RPL_LWTUNNEL=y
155+CONFIG_MPTCP=y
154156 CONFIG_NETFILTER=y
157+CONFIG_BRIDGE_NETFILTER=m
155158 CONFIG_NF_CONNTRACK=m
156159 CONFIG_NF_CONNTRACK_SECMARK=y
157160 CONFIG_NF_CONNTRACK_EVENTS=y
@@ -317,6 +320,7 @@ CONFIG_L2TP_V3=y · 159 unmodified lines
317320 CONFIG_L2TP_IP=m
318321 CONFIG_L2TP_ETH=m
319322 CONFIG_BRIDGE=m
323+CONFIG_BRIDGE_MRP=y
320324 CONFIG_VLAN_8021Q=m
321325 CONFIG_VLAN_8021Q_GVRP=y
322326 CONFIG_NET_SCHED=y
@@ -341,6 +345,7 @@ CONFIG_NET_SCH_CODEL=m · 18 unmodified lines
341345 CONFIG_NET_SCH_FQ_CODEL=m
342346 CONFIG_NET_SCH_INGRESS=m
343347 CONFIG_NET_SCH_PLUG=m
348+CONFIG_NET_SCH_ETS=m
344349 CONFIG_NET_CLS_BASIC=m
345350 CONFIG_NET_CLS_TCINDEX=m
346351 CONFIG_NET_CLS_ROUTE4=m
@@ -364,6 +369,7 @@ CONFIG_NET_ACT_PEDIT=m · 17 unmodified lines
364369 CONFIG_NET_ACT_SIMP=m
365370 CONFIG_NET_ACT_SKBEDIT=m
366371 CONFIG_NET_ACT_CSUM=m
372+CONFIG_NET_ACT_GATE=m
367373 CONFIG_DNS_RESOLVER=y
368374 CONFIG_OPENVSWITCH=m
369375 CONFIG_VSOCKETS=m
@@ -374,6 +380,7 @@ CONFIG_BPF_JIT=y · 4 unmodified lines
374380 CONFIG_NET_PKTGEN=m
375381 # CONFIG_NET_DROP_MONITOR is not set
376382 CONFIG_PCI=y
383+# CONFIG_PCIEASPM is not set
377384 CONFIG_PCI_DEBUG=y
378385 CONFIG_HOTPLUG_PCI=y
379386 CONFIG_HOTPLUG_PCI_S390=y
@@ -435,6 +442,7 @@ CONFIG_DM_ZERO=m · 55 unmodified lines
435442 CONFIG_DM_MULTIPATH=m
436443 CONFIG_DM_MULTIPATH_QL=m
437444 CONFIG_DM_MULTIPATH_ST=m
445+CONFIG_DM_MULTIPATH_HST=m
438446 CONFIG_DM_DELAY=m
439447 CONFIG_DM_UEVENT=y
440448 CONFIG_DM_FLAKEY=m
@@ -448,6 +456,8 @@ CONFIG_EQUALIZER=m · 7 unmodified lines
448456 CONFIG_IFB=m
449457 CONFIG_MACVLAN=m
450458 CONFIG_MACVTAP=m
459+CONFIG_VXLAN=m
460+CONFIG_BAREUDP=m
451461 CONFIG_TUN=m
452462 CONFIG_VETH=m
453463 CONFIG_VIRTIO_NET=m
@@ -481,7 +491,6 @@ CONFIG_NLMON=m · 27 unmodified lines
481491 CONFIG_MLX4_EN=m
482492 CONFIG_MLX5_CORE=m
483493 CONFIG_MLX5_CORE_EN=y
484−# CONFIG_MLXFW is not set
485494 # CONFIG_NET_VENDOR_MICREL is not set
486495 # CONFIG_NET_VENDOR_MICROCHIP is not set
487496 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -514,6 +523,7 @@ CONFIG_MLX5_CORE_EN=y · 26 unmodified lines
514523 # CONFIG_NET_VENDOR_TI is not set
515524 # CONFIG_NET_VENDOR_VIA is not set
516525 # CONFIG_NET_VENDOR_WIZNET is not set
526+# CONFIG_NET_VENDOR_XILINX is not set
517527 CONFIG_PPP=m
518528 CONFIG_PPP_BSDCOMP=m
519529 CONFIG_PPP_DEFLATE=m
@@ -561,6 +571,8 @@ CONFIG_VFIO_MDEV_DEVICE=m · 41 unmodified lines
561571 CONFIG_VIRTIO_PCI=m
562572 CONFIG_VIRTIO_BALLOON=m
563573 CONFIG_VIRTIO_INPUT=y
574+CONFIG_VHOST_NET=m
575+CONFIG_VHOST_VSOCK=m
564576 CONFIG_S390_CCW_IOMMU=y
565577 CONFIG_S390_AP_IOMMU=y
566578 CONFIG_EXT4_FS=y
@@ -608,6 +620,7 @@ CONFIG_ZISOFS=y · 41 unmodified lines
608620 CONFIG_UDF_FS=m
609621 CONFIG_MSDOS_FS=m
610622 CONFIG_VFAT_FS=m
623+CONFIG_EXFAT_FS=m
611624 CONFIG_NTFS_FS=m
612625 CONFIG_NTFS_RW=y
613626 CONFIG_PROC_KCORE=y
@@ -650,8 +663,8 @@ CONFIG_NLS_UTF8=m · 36 unmodified lines
650663 CONFIG_DLM=m
651664 CONFIG_UNICODE=y
652665 CONFIG_PERSISTENT_KEYRINGS=y
653−CONFIG_BIG_KEYS=y
654666 CONFIG_ENCRYPTED_KEYS=m
667+CONFIG_KEY_NOTIFICATIONS=y
655668 CONFIG_SECURITY=y
656669 CONFIG_SECURITY_NETWORK=y
657670 CONFIG_FORTIFY_SOURCE=y
@@ -675,8 +688,11 @@ CONFIG_CRYPTO_TEST=m · 17 unmodified lines
675688 CONFIG_CRYPTO_DH=m
676689 CONFIG_CRYPTO_ECDH=m
677690 CONFIG_CRYPTO_ECRDSA=m
691+CONFIG_CRYPTO_CURVE25519=m
692+CONFIG_CRYPTO_GCM=y
678693 CONFIG_CRYPTO_CHACHA20POLY1305=m
679694 CONFIG_CRYPTO_AEGIS128=m
695+CONFIG_CRYPTO_SEQIV=y
680696 CONFIG_CRYPTO_CFB=m
681697 CONFIG_CRYPTO_LRW=m
682698 CONFIG_CRYPTO_PCBC=m
@@ -685,6 +701,7 @@ CONFIG_CRYPTO_ADIANTUM=m · 2 unmodified lines
685701 CONFIG_CRYPTO_XCBC=m
686702 CONFIG_CRYPTO_VMAC=m
687703 CONFIG_CRYPTO_CRC32=m
704+CONFIG_CRYPTO_BLAKE2S=m
688705 CONFIG_CRYPTO_MICHAEL_MIC=m
689706 CONFIG_CRYPTO_RMD128=m
690707 CONFIG_CRYPTO_RMD160=m
@@ -701,6 +718,7 @@ CONFIG_CRYPTO_BLOWFISH=m · 10 unmodified lines
701718 CONFIG_CRYPTO_CAMELLIA=m
702719 CONFIG_CRYPTO_CAST5=m
703720 CONFIG_CRYPTO_CAST6=m
721+CONFIG_CRYPTO_DES=m
704722 CONFIG_CRYPTO_FCRYPT=m
705723 CONFIG_CRYPTO_KHAZAD=m
706724 CONFIG_CRYPTO_SALSA20=m
@@ -719,6 +737,9 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 12 unmodified lines
719737 CONFIG_CRYPTO_USER_API_RNG=m
720738 CONFIG_CRYPTO_USER_API_AEAD=m
721739 CONFIG_CRYPTO_STATS=y
740+CONFIG_CRYPTO_LIB_BLAKE2S=m
741+CONFIG_CRYPTO_LIB_CURVE25519=m
742+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
722743 CONFIG_ZCRYPT=m
723744 CONFIG_PKEY=m
724745 CONFIG_CRYPTO_PAES_S390=m
@@ -774,6 +795,7 @@ CONFIG_DEBUG_SHIRQ=y · 49 unmodified lines
774795 CONFIG_PANIC_ON_OOPS=y
775796 CONFIG_DETECT_HUNG_TASK=y
776797 CONFIG_WQ_WATCHDOG=y
798+CONFIG_TEST_LOCKUP=m
777799 CONFIG_DEBUG_TIMEKEEPING=y
778800 CONFIG_PROVE_LOCKING=y
779801 CONFIG_LOCK_STAT=y
@@ -786,7 +808,9 @@ CONFIG_BUG_ON_DATA_CORRUPTION=y · 6 unmodified lines
786808 CONFIG_DEBUG_CREDENTIALS=y
787809 CONFIG_RCU_TORTURE_TEST=m
788810 CONFIG_RCU_CPU_STALL_TIMEOUT=300
811+# CONFIG_RCU_TRACE is not set
789812 CONFIG_LATENCYTOP=y
813+CONFIG_BOOTTIME_TRACING=y
790814 CONFIG_FUNCTION_PROFILER=y
791815 CONFIG_STACK_TRACER=y
792816 CONFIG_IRQSOFF_TRACER=y
@@ -808,10 +832,12 @@ CONFIG_FAULT_INJECTION_DEBUG_FS=y · 15 unmodified lines
808832 CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
809833 CONFIG_LKDTM=m
810834 CONFIG_TEST_LIST_SORT=y
835+CONFIG_TEST_MIN_HEAP=y
811836 CONFIG_TEST_SORT=y
812837 CONFIG_KPROBES_SANITY_TEST=y
813838 CONFIG_RBTREE_TEST=y
814839 CONFIG_INTERVAL_TREE_TEST=m
815840 CONFIG_PERCPU_TEST=m
816841 CONFIG_ATOMIC64_SELFTEST=y
842+CONFIG_TEST_BITOPS=m
817843 CONFIG_TEST_BPF=m
arch/s390/configs/defconfig+33−10
@@ -1,5 +1,6 @@
11 CONFIG_SYSVIPC=y
22 CONFIG_POSIX_MQUEUE=y
3+CONFIG_WATCH_QUEUE=y
34 CONFIG_AUDIT=y
45 CONFIG_NO_HZ_IDLE=y
56 CONFIG_HIGH_RES_TIMERS=y
@@ -13,7 +14,6 @@ CONFIG_IKCONFIG=y · 7 unmodified lines
1314 CONFIG_IKCONFIG_PROC=y
1415 CONFIG_NUMA_BALANCING=y
1516 CONFIG_MEMCG=y
16−CONFIG_MEMCG_SWAP=y
1717 CONFIG_BLK_CGROUP=y
1818 CONFIG_CFS_BANDWIDTH=y
1919 CONFIG_RT_GROUP_SCHED=y
@@ -30,9 +30,9 @@ CONFIG_NAMESPACES=y · 10 unmodified lines
3030 CONFIG_USER_NS=y
3131 CONFIG_CHECKPOINT_RESTORE=y
3232 CONFIG_SCHED_AUTOGROUP=y
33−CONFIG_BLK_DEV_INITRD=y
3433 CONFIG_EXPERT=y
3534 # CONFIG_SYSFS_SYSCALL is not set
35+CONFIG_BPF_LSM=y
3636 CONFIG_BPF_SYSCALL=y
3737 CONFIG_USERFAULTFD=y
3838 # CONFIG_COMPAT_BRK is not set
@@ -41,7 +41,6 @@ CONFIG_LIVEPATCH=y · 2 unmodified lines
4141 CONFIG_TUNE_ZEC12=y
4242 CONFIG_NR_CPUS=512
4343 CONFIG_NUMA=y
44−# CONFIG_NUMA_EMU is not set
4544 CONFIG_HZ_100=y
4645 CONFIG_KEXEC_FILE=y
4746 CONFIG_KEXEC_SIG=y
@@ -51,14 +50,11 @@ CONFIG_CHSC_SCH=y · 3 unmodified lines
5150 CONFIG_VFIO_CCW=m
5251 CONFIG_VFIO_AP=m
5352 CONFIG_CRASH_DUMP=y
54−CONFIG_HIBERNATION=y
55−CONFIG_PM_DEBUG=y
5653 CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
5754 CONFIG_CMM=m
5855 CONFIG_APPLDATA_BASE=y
5956 CONFIG_KVM=m
60−CONFIG_VHOST_NET=m
61−CONFIG_VHOST_VSOCK=m
57+CONFIG_S390_UNWIND_SELFTEST=m
6258 CONFIG_OPROFILE=m
6359 CONFIG_KPROBES=y
6460 CONFIG_JUMP_LABEL=y
@@ -74,6 +70,8 @@ CONFIG_BLK_DEV_THROTTLING=y · 9 unmodified lines
7470 CONFIG_BLK_WBT=y
7571 CONFIG_BLK_CGROUP_IOLATENCY=y
7672 CONFIG_BLK_CGROUP_IOCOST=y
73+CONFIG_BLK_INLINE_ENCRYPTION=y
74+CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK=y
7775 CONFIG_PARTITION_ADVANCED=y
7876 CONFIG_IBM_PARTITION=y
7977 CONFIG_BSD_DISKLABEL=y
@@ -91,7 +89,6 @@ CONFIG_CLEANCACHE=y · 11 unmodified lines
9189 CONFIG_FRONTSWAP=y
9290 CONFIG_MEM_SOFT_DIRTY=y
9391 CONFIG_ZSWAP=y
94−CONFIG_ZBUD=m
9592 CONFIG_ZSMALLOC=m
9693 CONFIG_ZSMALLOC_STAT=y
9794 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
@@ -125,6 +122,7 @@ CONFIG_SYN_COOKIES=y · 27 unmodified lines
125122 CONFIG_NET_IPVTI=m
126123 CONFIG_INET_AH=m
127124 CONFIG_INET_ESP=m
125+CONFIG_INET_ESPINTCP=y
128126 CONFIG_INET_IPCOMP=m
129127 CONFIG_INET_DIAG=m
130128 CONFIG_INET_UDP_DIAG=m
@@ -139,6 +137,7 @@ CONFIG_TCP_CONG_ILLINOIS=m · 8 unmodified lines
139137 CONFIG_IPV6_ROUTER_PREF=y
140138 CONFIG_INET6_AH=m
141139 CONFIG_INET6_ESP=m
140+CONFIG_INET6_ESPINTCP=y
142141 CONFIG_INET6_IPCOMP=m
143142 CONFIG_IPV6_MIP6=m
144143 CONFIG_IPV6_VTI=m
@@ -146,7 +145,10 @@ CONFIG_IPV6_SIT=m · 1 unmodified line
146145 CONFIG_IPV6_GRE=m
147146 CONFIG_IPV6_MULTIPLE_TABLES=y
148147 CONFIG_IPV6_SUBTREES=y
148+CONFIG_IPV6_RPL_LWTUNNEL=y
149+CONFIG_MPTCP=y
149150 CONFIG_NETFILTER=y
151+CONFIG_BRIDGE_NETFILTER=m
150152 CONFIG_NF_CONNTRACK=m
151153 CONFIG_NF_CONNTRACK_SECMARK=y
152154 CONFIG_NF_CONNTRACK_EVENTS=y
@@ -311,6 +313,7 @@ CONFIG_L2TP_V3=y · 158 unmodified lines
311313 CONFIG_L2TP_IP=m
312314 CONFIG_L2TP_ETH=m
313315 CONFIG_BRIDGE=m
316+CONFIG_BRIDGE_MRP=y
314317 CONFIG_VLAN_8021Q=m
315318 CONFIG_VLAN_8021Q_GVRP=y
316319 CONFIG_NET_SCHED=y
@@ -335,6 +338,7 @@ CONFIG_NET_SCH_CODEL=m · 18 unmodified lines
335338 CONFIG_NET_SCH_FQ_CODEL=m
336339 CONFIG_NET_SCH_INGRESS=m
337340 CONFIG_NET_SCH_PLUG=m
341+CONFIG_NET_SCH_ETS=m
338342 CONFIG_NET_CLS_BASIC=m
339343 CONFIG_NET_CLS_TCINDEX=m
340344 CONFIG_NET_CLS_ROUTE4=m
@@ -358,6 +362,7 @@ CONFIG_NET_ACT_PEDIT=m · 17 unmodified lines
358362 CONFIG_NET_ACT_SIMP=m
359363 CONFIG_NET_ACT_SKBEDIT=m
360364 CONFIG_NET_ACT_CSUM=m
365+CONFIG_NET_ACT_GATE=m
361366 CONFIG_DNS_RESOLVER=y
362367 CONFIG_OPENVSWITCH=m
363368 CONFIG_VSOCKETS=m
@@ -368,6 +373,7 @@ CONFIG_BPF_JIT=y · 4 unmodified lines
368373 CONFIG_NET_PKTGEN=m
369374 # CONFIG_NET_DROP_MONITOR is not set
370375 CONFIG_PCI=y
376+# CONFIG_PCIEASPM is not set
371377 CONFIG_HOTPLUG_PCI=y
372378 CONFIG_HOTPLUG_PCI_S390=y
373379 CONFIG_UEVENT_HELPER=y
@@ -430,6 +436,7 @@ CONFIG_DM_ZERO=m · 56 unmodified lines
430436 CONFIG_DM_MULTIPATH=m
431437 CONFIG_DM_MULTIPATH_QL=m
432438 CONFIG_DM_MULTIPATH_ST=m
439+CONFIG_DM_MULTIPATH_HST=m
433440 CONFIG_DM_DELAY=m
434441 CONFIG_DM_UEVENT=y
435442 CONFIG_DM_FLAKEY=m
@@ -444,6 +451,8 @@ CONFIG_EQUALIZER=m · 8 unmodified lines
444451 CONFIG_IFB=m
445452 CONFIG_MACVLAN=m
446453 CONFIG_MACVTAP=m
454+CONFIG_VXLAN=m
455+CONFIG_BAREUDP=m
447456 CONFIG_TUN=m
448457 CONFIG_VETH=m
449458 CONFIG_VIRTIO_NET=m
@@ -477,7 +486,6 @@ CONFIG_NLMON=m · 27 unmodified lines
477486 CONFIG_MLX4_EN=m
478487 CONFIG_MLX5_CORE=m
479488 CONFIG_MLX5_CORE_EN=y
480−# CONFIG_MLXFW is not set
481489 # CONFIG_NET_VENDOR_MICREL is not set
482490 # CONFIG_NET_VENDOR_MICROCHIP is not set
483491 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -510,6 +518,7 @@ CONFIG_MLX5_CORE_EN=y · 26 unmodified lines
510518 # CONFIG_NET_VENDOR_TI is not set
511519 # CONFIG_NET_VENDOR_VIA is not set
512520 # CONFIG_NET_VENDOR_WIZNET is not set
521+# CONFIG_NET_VENDOR_XILINX is not set
513522 CONFIG_PPP=m
514523 CONFIG_PPP_BSDCOMP=m
515524 CONFIG_PPP_DEFLATE=m
@@ -557,6 +566,8 @@ CONFIG_VFIO_MDEV_DEVICE=m · 41 unmodified lines
557566 CONFIG_VIRTIO_PCI=m
558567 CONFIG_VIRTIO_BALLOON=m
559568 CONFIG_VIRTIO_INPUT=y
569+CONFIG_VHOST_NET=m
570+CONFIG_VHOST_VSOCK=m
560571 CONFIG_S390_CCW_IOMMU=y
561572 CONFIG_S390_AP_IOMMU=y
562573 CONFIG_EXT4_FS=y
@@ -600,6 +611,7 @@ CONFIG_ZISOFS=y · 37 unmodified lines
600611 CONFIG_UDF_FS=m
601612 CONFIG_MSDOS_FS=m
602613 CONFIG_VFAT_FS=m
614+CONFIG_EXFAT_FS=m
603615 CONFIG_NTFS_FS=m
604616 CONFIG_NTFS_RW=y
605617 CONFIG_PROC_KCORE=y
@@ -642,8 +654,8 @@ CONFIG_NLS_UTF8=m · 36 unmodified lines
642654 CONFIG_DLM=m
643655 CONFIG_UNICODE=y
644656 CONFIG_PERSISTENT_KEYRINGS=y
645−CONFIG_BIG_KEYS=y
646657 CONFIG_ENCRYPTED_KEYS=m
658+CONFIG_KEY_NOTIFICATIONS=y
647659 CONFIG_SECURITY=y
648660 CONFIG_SECURITY_NETWORK=y
649661 CONFIG_SECURITY_SELINUX=y
@@ -667,8 +679,11 @@ CONFIG_CRYPTO_TEST=m · 17 unmodified lines
667679 CONFIG_CRYPTO_DH=m
668680 CONFIG_CRYPTO_ECDH=m
669681 CONFIG_CRYPTO_ECRDSA=m
682+CONFIG_CRYPTO_CURVE25519=m
683+CONFIG_CRYPTO_GCM=y
670684 CONFIG_CRYPTO_CHACHA20POLY1305=m
671685 CONFIG_CRYPTO_AEGIS128=m
686+CONFIG_CRYPTO_SEQIV=y
672687 CONFIG_CRYPTO_CFB=m
673688 CONFIG_CRYPTO_LRW=m
674689 CONFIG_CRYPTO_OFB=m
@@ -678,6 +693,7 @@ CONFIG_CRYPTO_ADIANTUM=m · 3 unmodified lines
678693 CONFIG_CRYPTO_XCBC=m
679694 CONFIG_CRYPTO_VMAC=m
680695 CONFIG_CRYPTO_CRC32=m
696+CONFIG_CRYPTO_BLAKE2S=m
681697 CONFIG_CRYPTO_MICHAEL_MIC=m
682698 CONFIG_CRYPTO_RMD128=m
683699 CONFIG_CRYPTO_RMD160=m
@@ -694,6 +710,7 @@ CONFIG_CRYPTO_BLOWFISH=m · 10 unmodified lines
694710 CONFIG_CRYPTO_CAMELLIA=m
695711 CONFIG_CRYPTO_CAST5=m
696712 CONFIG_CRYPTO_CAST6=m
713+CONFIG_CRYPTO_DES=m
697714 CONFIG_CRYPTO_FCRYPT=m
698715 CONFIG_CRYPTO_KHAZAD=m
699716 CONFIG_CRYPTO_SALSA20=m
@@ -712,6 +729,9 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 12 unmodified lines
712729 CONFIG_CRYPTO_USER_API_RNG=m
713730 CONFIG_CRYPTO_USER_API_AEAD=m
714731 CONFIG_CRYPTO_STATS=y
732+CONFIG_CRYPTO_LIB_BLAKE2S=m
733+CONFIG_CRYPTO_LIB_CURVE25519=m
734+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
715735 CONFIG_ZCRYPT=m
716736 CONFIG_PKEY=m
717737 CONFIG_CRYPTO_PAES_S390=m
@@ -725,6 +745,7 @@ CONFIG_CRYPTO_AES_S390=m · 7 unmodified lines
725745 CONFIG_CRYPTO_GHASH_S390=m
726746 CONFIG_CRYPTO_CRC32_S390=y
727747 CONFIG_CORDIC=m
748+CONFIG_PRIME_NUMBERS=m
728749 CONFIG_CRC4=m
729750 CONFIG_CRC7=m
730751 CONFIG_CRC8=m
@@ -739,10 +760,12 @@ CONFIG_DEBUG_SECTION_MISMATCH=y · 8 unmodified lines
739760 CONFIG_MAGIC_SYSRQ=y
740761 CONFIG_DEBUG_MEMORY_INIT=y
741762 CONFIG_PANIC_ON_OOPS=y
763+CONFIG_TEST_LOCKUP=m
742764 CONFIG_BUG_ON_DATA_CORRUPTION=y
743765 CONFIG_RCU_TORTURE_TEST=m
744766 CONFIG_RCU_CPU_STALL_TIMEOUT=60
745767 CONFIG_LATENCYTOP=y
768+CONFIG_BOOTTIME_TRACING=y
746769 CONFIG_FUNCTION_PROFILER=y
747770 CONFIG_STACK_TRACER=y
748771 CONFIG_SCHED_TRACER=y
arch/s390/configs/zfcpdump_defconfig+5−0
@@ -30,6 +30,7 @@ CONFIG_IBM_PARTITION=y · 29 unmodified lines
3030 # CONFIG_BOUNCE is not set
3131 CONFIG_NET=y
3232 # CONFIG_IUCV is not set
33+# CONFIG_ETHTOOL_NETLINK is not set
3334 CONFIG_DEVTMPFS=y
3435 CONFIG_BLK_DEV_RAM=y
3536 # CONFIG_BLK_DEV_XPRAM is not set
@@ -55,6 +56,8 @@ CONFIG_RAW_DRIVER=y · 19 unmodified lines
5556 # CONFIG_MONWRITER is not set
5657 # CONFIG_S390_VMUR is not set
5758 # CONFIG_HID is not set
59+# CONFIG_VIRTIO_MENU is not set
60+# CONFIG_VHOST_MENU is not set
5861 # CONFIG_IOMMU_SUPPORT is not set
5962 # CONFIG_DNOTIFY is not set
6063 # CONFIG_INOTIFY_USER is not set
@@ -62,7 +65,9 @@ CONFIG_CONFIGFS_FS=y · 1 unmodified line
6265 # CONFIG_MISC_FILESYSTEMS is not set
6366 # CONFIG_NETWORK_FILESYSTEMS is not set
6467 CONFIG_LSM="yama,loadpin,safesetid,integrity"
68+# CONFIG_ZLIB_DFLTCC is not set
6569 CONFIG_PRINTK_TIME=y
70+# CONFIG_SYMBOLIC_ERRNAME is not set
6671 CONFIG_DEBUG_INFO=y
6772 CONFIG_DEBUG_FS=y
6873 CONFIG_DEBUG_KERNEL=y
arch/s390/include/asm/kvm_host.h+4−4
@@ -31,12 +31,12 @@ · 30 unmodified lines
3131 #define KVM_USER_MEM_SLOTS 32
3232
3333 /*
34− * These seem to be used for allocating ->chip in the routing table,
35− * which we don't use. 4096 is an out-of-thin-air value. If we need
36− * to look at ->chip later on, we'll need to revisit this.
34+ * These seem to be used for allocating ->chip in the routing table, which we
35+ * don't use. 1 is as small as we can get to reduce the needed memory. If we
36+ * need to look at ->chip later on, we'll need to revisit this.
3737 */
3838 #define KVM_NR_IRQCHIPS 1
39−#define KVM_IRQCHIP_NUM_PINS 4096
39+#define KVM_IRQCHIP_NUM_PINS 1
4040 #define KVM_HALT_POLL_NS_DEFAULT 50000
4141
4242 /* s390-specific vcpu->requests bit members */
arch/s390/kernel/debug.c+2−1
@@ -198,9 +198,10 @@ static debug_entry_t ***debug_areas_alloc(int pages_per_area, int nr_areas) · 197 unmodified lines
198198 if (!areas)
199199 goto fail_malloc_areas;
200200 for (i = 0; i < nr_areas; i++) {
201+ /* GFP_NOWARN to avoid user triggerable WARN, we handle fails */
201202 areas[i] = kmalloc_array(pages_per_area,
202203 sizeof(debug_entry_t *),
203− GFP_KERNEL);
204+ GFP_KERNEL | __GFP_NOWARN);
204205 if (!areas[i])
205206 goto fail_malloc_areas2;
206207 for (j = 0; j < pages_per_area; j++) {
arch/s390/kernel/early.c+2−0
@@ -170,6 +170,8 @@ static noinline __init void setup_lowcore_early(void) · 169 unmodified lines
170170 psw_t psw;
171171
172172 psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA;
173+ if (IS_ENABLED(CONFIG_KASAN))
174+ psw.mask |= PSW_MASK_DAT;
173175 psw.addr = (unsigned long) s390_base_ext_handler;
174176 S390_lowcore.external_new_psw = psw;
175177 psw.addr = (unsigned long) s390_base_pgm_handler;
arch/s390/kernel/entry.S+1−1
@@ -378,9 +378,9 @@ ENTRY(system_call) · 377 unmodified lines
378378 stmg %r8,%r15,__LC_SAVE_AREA_SYNC
379379 BPOFF
380380 lg %r12,__LC_CURRENT
381− lghi %r13,__TASK_thread
382381 lghi %r14,_PIF_SYSCALL
383382 .Lsysc_per:
383+ lghi %r13,__TASK_thread
384384 lg %r15,__LC_KERNEL_STACK
385385 la %r11,STACK_FRAME_OVERHEAD(%r15) # pointer to pt_regs
386386 UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER
arch/s390/kernel/perf_cpum_sf.c+10−1
@@ -881,12 +881,21 @@ out: · 880 unmodified lines
881881 return err;
882882 }
883883
884+static bool is_callchain_event(struct perf_event *event)
885+{
886+ u64 sample_type = event->attr.sample_type;
887+
888+ return sample_type & (PERF_SAMPLE_CALLCHAIN | PERF_SAMPLE_REGS_USER |
889+ PERF_SAMPLE_STACK_USER);
890+}
891+
884892 static int cpumsf_pmu_event_init(struct perf_event *event)
885893 {
886894 int err;
887895
888896 /* No support for taken branch sampling */
889− if (has_branch_stack(event))
897+ /* No support for callchain, stacks and registers */
898+ if (has_branch_stack(event) || is_callchain_event(event))
890899 return -EOPNOTSUPP;
891900
892901 switch (event->attr.type) {
arch/s390/kernel/setup.c+1−0
@@ -1100,6 +1100,7 @@ void __init setup_arch(char **cmdline_p) · 1099 unmodified lines
11001100 if (IS_ENABLED(CONFIG_EXPOLINE_AUTO))
11011101 nospec_auto_detect();
11021102
1103+ jump_label_init();
11031104 parse_early_param();
11041105 #ifdef CONFIG_CRASH_DUMP
11051106 /* Deactivate elfcorehdr= kernel parameter */
arch/s390/mm/hugetlbpage.c+1−1
@@ -117,7 +117,7 @@ static inline pte_t __rste_to_pte(unsigned long rste) · 116 unmodified lines
117117 _PAGE_YOUNG);
118118 #ifdef CONFIG_MEM_SOFT_DIRTY
119119 pte_val(pte) |= move_set_bit(rste, _SEGMENT_ENTRY_SOFT_DIRTY,
120− _PAGE_DIRTY);
120+ _PAGE_SOFT_DIRTY);
121121 #endif
122122 pte_val(pte) |= move_set_bit(rste, _SEGMENT_ENTRY_NOEXEC,
123123 _PAGE_NOEXEC);
arch/s390/mm/maccess.c+9−5
@@ -62,11 +62,15 @@ notrace void *s390_kernel_write(void *dst, const void *src, size_t size) · 61 unmodified lines
6262 long copied;
6363
6464 spin_lock_irqsave(&s390_kernel_write_lock, flags);
65− while (size) {
66− copied = s390_kernel_write_odd(tmp, src, size);
67− tmp += copied;
68− src += copied;
69− size -= copied;
65+ if (!(flags & PSW_MASK_DAT)) {
66+ memcpy(dst, src, size);
67+ } else {
68+ while (size) {
69+ copied = s390_kernel_write_odd(tmp, src, size);
70+ tmp += copied;
71+ src += copied;
72+ size -= copied;
73+ }
7074 }
7175 spin_unlock_irqrestore(&s390_kernel_write_lock, flags);
7276
arch/s390/pci/pci_event.c+12−1
@@ -94,7 +94,18 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 93 unmodified lines
9494 }
9595 zdev->fh = ccdf->fh;
9696 zdev->state = ZPCI_FN_STATE_CONFIGURED;
97− zpci_create_device(zdev);
97+ ret = zpci_enable_device(zdev);
98+ if (ret)
99+ break;
100+
101+ pdev = pci_scan_single_device(zdev->zbus->bus, zdev->devfn);
102+ if (!pdev)
103+ break;
104+
105+ pci_bus_add_device(pdev);
106+ pci_lock_rescan_remove();
107+ pci_bus_add_devices(zdev->zbus->bus);
108+ pci_unlock_rescan_remove();
98109 break;
99110 case 0x0302: /* Reserved -> Standby */
100111 if (!zdev) {
arch/x86/Kconfig+1−1
@@ -67,7 +67,7 @@ config X86 · 66 unmodified lines
6767 select ARCH_HAS_FILTER_PGPROT
6868 select ARCH_HAS_FORTIFY_SOURCE
6969 select ARCH_HAS_GCOV_PROFILE_ALL
70− select ARCH_HAS_KCOV if X86_64
70+ select ARCH_HAS_KCOV if X86_64 && STACK_VALIDATION
7171 select ARCH_HAS_MEM_ENCRYPT
7272 select ARCH_HAS_MEMBARRIER_SYNC_CORE
7373 select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
arch/x86/boot/compressed/Makefile+2−2
@@ -90,8 +90,8 @@ endif · 89 unmodified lines
9090
9191 vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o
9292
93−vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
9493 vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
94+efi-obj-$(CONFIG_EFI_STUB) = $(objtree)/drivers/firmware/efi/libstub/lib.a
9595
9696 # The compressed kernel is built with -fPIC/-fPIE so that a boot loader
9797 # can place it anywhere in memory and it will still run. However, since
@@ -115,7 +115,7 @@ endef · 17 unmodified lines
115115 quiet_cmd_check-and-link-vmlinux = LD $@
116116 cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
117117
118−$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
118+$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE
119119 $(call if_changed,check-and-link-vmlinux)
120120
121121 OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
arch/x86/boot/compressed/head_64.S+10−1
@@ -213,7 +213,6 @@ SYM_FUNC_START(startup_32) · 212 unmodified lines
213213 * We place all of the values on our mini stack so lret can
214214 * used to perform that far jump.
215215 */
216− pushl $__KERNEL_CS
217216 leal startup_64(%ebp), %eax
218217 #ifdef CONFIG_EFI_MIXED
219218 movl efi32_boot_args(%ebp), %edi
@@ -224,11 +223,20 @@ SYM_FUNC_START(startup_32) · 4 unmodified lines
224223 movl efi32_boot_args+8(%ebp), %edx // saved bootparams pointer
225224 cmpl $0, %edx
226225 jnz 1f
226+ /*
227+ * efi_pe_entry uses MS calling convention, which requires 32 bytes of
228+ * shadow space on the stack even if all arguments are passed in
229+ * registers. We also need an additional 8 bytes for the space that
230+ * would be occupied by the return address, and this also results in
231+ * the correct stack alignment for entry.
232+ */
233+ subl $40, %esp
227234 leal efi_pe_entry(%ebp), %eax
228235 movl %edi, %ecx // MS calling convention
229236 movl %esi, %edx
230237 1:
231238 #endif
239+ pushl $__KERNEL_CS
232240 pushl %eax
233241
234242 /* Enter paged protected Mode, activating Long Mode */
@@ -784,6 +792,7 @@ SYM_DATA_LOCAL(boot_heap, .fill BOOT_HEAP_SIZE, 1, 0) · 549 unmodified lines
784792
785793 SYM_DATA_START_LOCAL(boot_stack)
786794 .fill BOOT_STACK_SIZE, 1, 0
795+ .balign 16
787796 SYM_DATA_END_LABEL(boot_stack, SYM_L_LOCAL, boot_stack_end)
788797
789798 /*
arch/x86/entry/Makefile+11−3
@@ -7,12 +7,20 @@ KASAN_SANITIZE := n · 6 unmodified lines
77 UBSAN_SANITIZE := n
88 KCOV_INSTRUMENT := n
99
10−CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) -fstack-protector -fstack-protector-strong
11−CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE) -fstack-protector -fstack-protector-strong
12−CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE) -fstack-protector -fstack-protector-strong
10+CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
11+CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE)
12+CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE)
13+CFLAGS_REMOVE_syscall_x32.o = $(CC_FLAGS_FTRACE)
14+
15+CFLAGS_common.o += -fno-stack-protector
16+CFLAGS_syscall_64.o += -fno-stack-protector
17+CFLAGS_syscall_32.o += -fno-stack-protector
18+CFLAGS_syscall_x32.o += -fno-stack-protector
1319
1420 CFLAGS_syscall_64.o += $(call cc-option,-Wno-override-init,)
1521 CFLAGS_syscall_32.o += $(call cc-option,-Wno-override-init,)
22+CFLAGS_syscall_x32.o += $(call cc-option,-Wno-override-init,)
23+
1624 obj-y := entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
1725 obj-y += common.o
1826
arch/x86/entry/common.c+47−4
@@ -45,6 +45,32 @@ · 44 unmodified lines
4545 #define CREATE_TRACE_POINTS
4646 #include <trace/events/syscalls.h>
4747
48+/* Check that the stack and regs on entry from user mode are sane. */
49+static noinstr void check_user_regs(struct pt_regs *regs)
50+{
51+ if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) {
52+ /*
53+ * Make sure that the entry code gave us a sensible EFLAGS
54+ * register. Native because we want to check the actual CPU
55+ * state, not the interrupt state as imagined by Xen.
56+ */
57+ unsigned long flags = native_save_fl();
58+ WARN_ON_ONCE(flags & (X86_EFLAGS_AC | X86_EFLAGS_DF |
59+ X86_EFLAGS_NT));
60+
61+ /* We think we came from user mode. Make sure pt_regs agrees. */
62+ WARN_ON_ONCE(!user_mode(regs));
63+
64+ /*
65+ * All entries from user mode (except #DF) should be on the
66+ * normal thread stack and should have user pt_regs in the
67+ * correct location.
68+ */
69+ WARN_ON_ONCE(!on_thread_stack());
70+ WARN_ON_ONCE(regs != task_pt_regs(current));
71+ }
72+}
73+
4874 #ifdef CONFIG_CONTEXT_TRACKING
4975 /**
5076 * enter_from_user_mode - Establish state when coming from user mode
@@ -127,9 +153,6 @@ static long syscall_trace_enter(struct pt_regs *regs) · 76 unmodified lines
127153 unsigned long ret = 0;
128154 u32 work;
129155
130− if (IS_ENABLED(CONFIG_DEBUG_ENTRY))
131− BUG_ON(regs != task_pt_regs(current));
132−
133156 work = READ_ONCE(ti->flags);
134157
135158 if (work & (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU)) {
@@ -271,7 +294,7 @@ static void __prepare_exit_to_usermode(struct pt_regs *regs) · 135 unmodified lines
271294 #endif
272295 }
273296
274−__visible noinstr void prepare_exit_to_usermode(struct pt_regs *regs)
297+static noinstr void prepare_exit_to_usermode(struct pt_regs *regs)
275298 {
276299 instrumentation_begin();
277300 __prepare_exit_to_usermode(regs);
@@ -346,6 +369,8 @@ __visible noinstr void do_syscall_64(unsigned long nr, struct pt_regs *regs) · 68 unmodified lines
346369 {
347370 struct thread_info *ti;
348371
372+ check_user_regs(regs);
373+
349374 enter_from_user_mode();
350375 instrumentation_begin();
351376
@@ -409,6 +434,8 @@ static void do_syscall_32_irqs_on(struct pt_regs *regs) · 57 unmodified lines
409434 /* Handles int $0x80 */
410435 __visible noinstr void do_int80_syscall_32(struct pt_regs *regs)
411436 {
437+ check_user_regs(regs);
438+
412439 enter_from_user_mode();
413440 instrumentation_begin();
414441
@@ -460,6 +487,8 @@ __visible noinstr long do_fast_syscall_32(struct pt_regs *regs) · 45 unmodified lines
460487 vdso_image_32.sym_int80_landing_pad;
461488 bool success;
462489
490+ check_user_regs(regs);
491+
463492 /*
464493 * SYSENTER loses EIP, and even SYSCALL32 needs us to skip forward
465494 * so that 'regs->ip -= 2' lands back on an int $0x80 instruction.
@@ -510,6 +539,18 @@ __visible noinstr long do_fast_syscall_32(struct pt_regs *regs) · 44 unmodified lines
510539 (regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF | X86_EFLAGS_VM)) == 0;
511540 #endif
512541 }
542+
543+/* Returns 0 to return using IRET or 1 to return using SYSEXIT/SYSRETL. */
544+__visible noinstr long do_SYSENTER_32(struct pt_regs *regs)
545+{
546+ /* SYSENTER loses RSP, but the vDSO saved it in RBP. */
547+ regs->sp = regs->bp;
548+
549+ /* SYSENTER clobbers EFLAGS.IF. Assume it was set in usermode. */
550+ regs->flags |= X86_EFLAGS_IF;
551+
552+ return do_fast_syscall_32(regs);
553+}
513554 #endif
514555
515556 SYSCALL_DEFINE0(ni_syscall)
@@ -553,6 +594,7 @@ SYSCALL_DEFINE0(ni_syscall) · 37 unmodified lines
553594 bool noinstr idtentry_enter_cond_rcu(struct pt_regs *regs)
554595 {
555596 if (user_mode(regs)) {
597+ check_user_regs(regs);
556598 enter_from_user_mode();
557599 return false;
558600 }
@@ -686,6 +728,7 @@ void noinstr idtentry_exit_cond_rcu(struct pt_regs *regs, bool rcu_exit) · 127 unmodified lines
686728 */
687729 void noinstr idtentry_enter_user(struct pt_regs *regs)
688730 {
731+ check_user_regs(regs);
689732 enter_from_user_mode();
690733 }
691734
arch/x86/entry/entry_32.S+2−3
@@ -933,9 +933,8 @@ SYM_FUNC_START(entry_SYSENTER_32) · 932 unmodified lines
933933
934934 .Lsysenter_past_esp:
935935 pushl $__USER_DS /* pt_regs->ss */
936− pushl %ebp /* pt_regs->sp (stashed in bp) */
936+ pushl $0 /* pt_regs->sp (placeholder) */
937937 pushfl /* pt_regs->flags (except IF = 0) */
938− orl $X86_EFLAGS_IF, (%esp) /* Fix IF */
939938 pushl $__USER_CS /* pt_regs->cs */
940939 pushl $0 /* pt_regs->ip = 0 (placeholder) */
941940 pushl %eax /* pt_regs->orig_ax */
@@ -965,7 +964,7 @@ SYM_FUNC_START(entry_SYSENTER_32) · 23 unmodified lines
965964 .Lsysenter_flags_fixed:
966965
967966 movl %esp, %eax
968− call do_fast_syscall_32
967+ call do_SYSENTER_32
969968 /* XEN PV guests always use IRET path */
970969 ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \
971970 "jmp .Lsyscall_32_done", X86_FEATURE_XENPV
arch/x86/entry/entry_64_compat.S+16−15
@@ -57,29 +57,30 @@ SYM_CODE_START(entry_SYSENTER_compat) · 56 unmodified lines
5757
5858 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
5959
60− /*
61− * User tracing code (ptrace or signal handlers) might assume that
62− * the saved RAX contains a 32-bit number when we're invoking a 32-bit
63− * syscall. Just in case the high bits are nonzero, zero-extend
64− * the syscall number. (This could almost certainly be deleted
65− * with no ill effects.)
66− */
67− movl %eax, %eax
68−
6960 /* Construct struct pt_regs on stack */
7061 pushq $__USER32_DS /* pt_regs->ss */
71− pushq %rbp /* pt_regs->sp (stashed in bp) */
62+ pushq $0 /* pt_regs->sp = 0 (placeholder) */
7263
7364 /*
7465 * Push flags. This is nasty. First, interrupts are currently
75− * off, but we need pt_regs->flags to have IF set. Second, even
76− * if TF was set when SYSENTER started, it's clear by now. We fix
77− * that later using TIF_SINGLESTEP.
66+ * off, but we need pt_regs->flags to have IF set. Second, if TS
67+ * was set in usermode, it's still set, and we're singlestepping
68+ * through this code. do_SYSENTER_32() will fix up IF.
7869 */
7970 pushfq /* pt_regs->flags (except IF = 0) */
80− orl $X86_EFLAGS_IF, (%rsp) /* Fix saved flags */
8171 pushq $__USER32_CS /* pt_regs->cs */
8272 pushq $0 /* pt_regs->ip = 0 (placeholder) */
73+SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL)
74+
75+ /*
76+ * User tracing code (ptrace or signal handlers) might assume that
77+ * the saved RAX contains a 32-bit number when we're invoking a 32-bit
78+ * syscall. Just in case the high bits are nonzero, zero-extend
79+ * the syscall number. (This could almost certainly be deleted
80+ * with no ill effects.)
81+ */
82+ movl %eax, %eax
83+
8384 pushq %rax /* pt_regs->orig_ax */
8485 pushq %rdi /* pt_regs->di */
8586 pushq %rsi /* pt_regs->si */
@@ -135,7 +136,7 @@ SYM_CODE_START(entry_SYSENTER_compat) · 49 unmodified lines
135136 .Lsysenter_flags_fixed:
136137
137138 movq %rsp, %rdi
138− call do_fast_syscall_32
139+ call do_SYSENTER_32
139140 /* XEN PV guests always use IRET path */
140141 ALTERNATIVE "testl %eax, %eax; jz swapgs_restore_regs_and_return_to_usermode", \
141142 "jmp swapgs_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV
arch/x86/events/Makefile+1−1
@@ -1,6 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 obj-y += core.o probe.o
3−obj-$(PERF_EVENTS_INTEL_RAPL) += rapl.o
3+obj-$(CONFIG_PERF_EVENTS_INTEL_RAPL) += rapl.o
44 obj-y += amd/
55 obj-$(CONFIG_X86_LOCAL_APIC) += msr.o
66 obj-$(CONFIG_CPU_SUP_INTEL) += intel/
arch/x86/hyperv/hv_init.c+4−1
@@ -375,7 +375,10 @@ void __init hyperv_init(void) · 374 unmodified lines
375375 guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0);
376376 wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);
377377
378− hv_hypercall_pg = vmalloc_exec(PAGE_SIZE);
378+ hv_hypercall_pg = __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START,
379+ VMALLOC_END, GFP_KERNEL, PAGE_KERNEL_ROX,
380+ VM_FLUSH_RESET_PERMS, NUMA_NO_NODE,
381+ __builtin_return_address(0));
379382 if (hv_hypercall_pg == NULL) {
380383 wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
381384 goto remove_cpuhp_state;
arch/x86/include/asm/bitops.h+1−5
@@ -201,12 +201,8 @@ arch_test_and_change_bit(long nr, volatile unsigned long *addr) · 200 unmodified lines
201201 return GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btc), *addr, c, "Ir", nr);
202202 }
203203
204−static __no_kcsan_or_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
204+static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
205205 {
206− /*
207− * Because this is a plain access, we need to disable KCSAN here to
208− * avoid double instrumentation via instrumented bitops.
209− */
210206 return ((1UL << (nr & (BITS_PER_LONG-1))) &
211207 (addr[nr >> _BITOPS_LONG_SHIFT])) != 0;
212208 }
arch/x86/include/asm/bug.h+6−0
@@ -75,6 +75,12 @@ do { \ · 74 unmodified lines
7575 unreachable(); \
7676 } while (0)
7777
78+/*
79+ * This instrumentation_begin() is strictly speaking incorrect; but it
80+ * suppresses the complaints from WARN()s in noinstr code. If such a WARN()
81+ * were to trigger, we'd rather wreck the machine in an attempt to get the
82+ * message out than not know about it.
83+ */
7884 #define __WARN_FLAGS(flags) \
7985 do { \
8086 instrumentation_begin(); \
arch/x86/include/asm/cpu.h+5−0
@@ -58,4 +58,9 @@ static inline bool handle_guest_split_lock(unsigned long ip) · 57 unmodified lines
5858 return false;
5959 }
6060 #endif
61+#ifdef CONFIG_IA32_FEAT_CTL
62+void init_ia32_feat_ctl(struct cpuinfo_x86 *c);
63+#else
64+static inline void init_ia32_feat_ctl(struct cpuinfo_x86 *c) {}
65+#endif
6166 #endif /* _ASM_X86_CPU_H */
arch/x86/include/asm/cpumask.h+18−0
@@ -11,5 +11,23 @@ extern cpumask_var_t cpu_sibling_setup_mask; · 10 unmodified lines
1111
1212 extern void setup_cpu_local_masks(void);
1313
14+/*
15+ * NMI and MCE exceptions need cpu_is_offline() _really_ early,
16+ * provide an arch_ special for them to avoid instrumentation.
17+ */
18+#if NR_CPUS > 1
19+static __always_inline bool arch_cpu_online(int cpu)
20+{
21+ return arch_test_bit(cpu, cpumask_bits(cpu_online_mask));
22+}
23+#else
24+static __always_inline bool arch_cpu_online(int cpu)
25+{
26+ return cpu == 0;
27+}
28+#endif
29+
30+#define arch_cpu_is_offline(cpu) unlikely(!arch_cpu_online(cpu))
31+
1432 #endif /* __ASSEMBLY__ */
1533 #endif /* _ASM_X86_CPUMASK_H */
arch/x86/include/asm/fpu/internal.h+5−0
@@ -623,6 +623,11 @@ static inline void switch_fpu_finish(struct fpu *new_fpu) · 622 unmodified lines
623623 * MXCSR and XCR definitions:
624624 */
625625
626+static inline void ldmxcsr(u32 mxcsr)
627+{
628+ asm volatile("ldmxcsr %0" :: "m" (mxcsr));
629+}
630+
626631 extern unsigned int mxcsr_feature_mask;
627632
628633 #define XCR_XFEATURE_ENABLED_MASK 0x00000000
arch/x86/include/asm/idtentry.h+27−38
@@ -353,10 +353,6 @@ static __always_inline void __##func(struct pt_regs *regs) · 352 unmodified lines
353353
354354 #else /* CONFIG_X86_64 */
355355
356−/* Maps to a regular IDTENTRY on 32bit for now */
357−# define DECLARE_IDTENTRY_IST DECLARE_IDTENTRY
358−# define DEFINE_IDTENTRY_IST DEFINE_IDTENTRY
359−
360356 /**
361357 * DECLARE_IDTENTRY_DF - Declare functions for double fault 32bit variant
362358 * @vector: Vector number (ignored for C)
@@ -387,28 +383,18 @@ __visible noinstr void func(struct pt_regs *regs, \ · 24 unmodified lines
387383 #endif /* !CONFIG_X86_64 */
388384
389385 /* C-Code mapping */
386+#define DECLARE_IDTENTRY_NMI DECLARE_IDTENTRY_RAW
387+#define DEFINE_IDTENTRY_NMI DEFINE_IDTENTRY_RAW
388+
389+#ifdef CONFIG_X86_64
390390 #define DECLARE_IDTENTRY_MCE DECLARE_IDTENTRY_IST
391391 #define DEFINE_IDTENTRY_MCE DEFINE_IDTENTRY_IST
392392 #define DEFINE_IDTENTRY_MCE_USER DEFINE_IDTENTRY_NOIST
393393
394−#define DECLARE_IDTENTRY_NMI DECLARE_IDTENTRY_RAW
395−#define DEFINE_IDTENTRY_NMI DEFINE_IDTENTRY_RAW
396−
397394 #define DECLARE_IDTENTRY_DEBUG DECLARE_IDTENTRY_IST
398395 #define DEFINE_IDTENTRY_DEBUG DEFINE_IDTENTRY_IST
399396 #define DEFINE_IDTENTRY_DEBUG_USER DEFINE_IDTENTRY_NOIST
400−
401−/**
402− * DECLARE_IDTENTRY_XEN - Declare functions for XEN redirect IDT entry points
403− * @vector: Vector number (ignored for C)
404− * @func: Function name of the entry point
405− *
406− * Used for xennmi and xendebug redirections. No DEFINE as this is all ASM
407− * indirection magic.
408− */
409−#define DECLARE_IDTENTRY_XEN(vector, func) \
410− asmlinkage void xen_asm_exc_xen##func(void); \
411− asmlinkage void asm_exc_xen##func(void)
397+#endif
412398
413399 #else /* !__ASSEMBLY__ */
414400
@@ -455,9 +441,6 @@ __visible noinstr void func(struct pt_regs *regs, \ · 40 unmodified lines
455441 # define DECLARE_IDTENTRY_MCE(vector, func) \
456442 DECLARE_IDTENTRY(vector, func)
457443
458−# define DECLARE_IDTENTRY_DEBUG(vector, func) \
459− DECLARE_IDTENTRY(vector, func)
460−
461444 /* No ASM emitted for DF as this goes through a C shim */
462445 # define DECLARE_IDTENTRY_DF(vector, func)
463446
@@ -469,10 +452,6 @@ __visible noinstr void func(struct pt_regs *regs, \ · 5 unmodified lines
469452 /* No ASM code emitted for NMI */
470453 #define DECLARE_IDTENTRY_NMI(vector, func)
471454
472−/* XEN NMI and DB wrapper */
473−#define DECLARE_IDTENTRY_XEN(vector, func) \
474− idtentry vector asm_exc_xen##func exc_##func has_error_code=0
475−
476455 /*
477456 * ASM code to emit the common vector entry stubs where each stub is
478457 * packed into 8 bytes.
@@ -490,16 +469,15 @@ __visible noinstr void func(struct pt_regs *regs, \ · 11 unmodified lines
490469 .align 8
491470 SYM_CODE_START(irq_entries_start)
492471 vector=FIRST_EXTERNAL_VECTOR
493− pos = .
494472 .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
495473 UNWIND_HINT_IRET_REGS
474+0 :
496475 .byte 0x6a, vector
497476 jmp asm_common_interrupt
498477 nop
499478 /* Ensure that the above is 8 bytes max */
500− . = pos + 8
501− pos=pos+8
502− vector=vector+1
479+ . = 0b + 8
480+ vector = vector+1
503481 .endr
504482 SYM_CODE_END(irq_entries_start)
505483
@@ -507,16 +485,15 @@ SYM_CODE_END(irq_entries_start) · 1 unmodified line
507485 .align 8
508486 SYM_CODE_START(spurious_entries_start)
509487 vector=FIRST_SYSTEM_VECTOR
510− pos = .
511488 .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR)
512489 UNWIND_HINT_IRET_REGS
490+0 :
513491 .byte 0x6a, vector
514492 jmp asm_spurious_interrupt
515493 nop
516494 /* Ensure that the above is 8 bytes max */
517− . = pos + 8
518− pos=pos+8
519− vector=vector+1
495+ . = 0b + 8
496+ vector = vector+1
520497 .endr
521498 SYM_CODE_END(spurious_entries_start)
522499 #endif
@@ -565,16 +542,28 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_BP, exc_int3); · 42 unmodified lines
565542 DECLARE_IDTENTRY_RAW_ERRORCODE(X86_TRAP_PF, exc_page_fault);
566543
567544 #ifdef CONFIG_X86_MCE
545+#ifdef CONFIG_X86_64
568546 DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check);
547+#else
548+DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check);
549+#endif
569550 #endif
570551
571552 /* NMI */
572553 DECLARE_IDTENTRY_NMI(X86_TRAP_NMI, exc_nmi);
573−DECLARE_IDTENTRY_XEN(X86_TRAP_NMI, nmi);
554+#if defined(CONFIG_XEN_PV) && defined(CONFIG_X86_64)
555+DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, xenpv_exc_nmi);
556+#endif
574557
575558 /* #DB */
559+#ifdef CONFIG_X86_64
576560 DECLARE_IDTENTRY_DEBUG(X86_TRAP_DB, exc_debug);
577−DECLARE_IDTENTRY_XEN(X86_TRAP_DB, debug);
561+#else
562+DECLARE_IDTENTRY_RAW(X86_TRAP_DB, exc_debug);
563+#endif
564+#if defined(CONFIG_XEN_PV) && defined(CONFIG_X86_64)
565+DECLARE_IDTENTRY_RAW(X86_TRAP_DB, xenpv_exc_debug);
566+#endif
578567
579568 /* #DF */
580569 DECLARE_IDTENTRY_DF(X86_TRAP_DF, exc_double_fault);
@@ -635,8 +624,8 @@ DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_NESTED_VECTOR, sysvec_kvm_posted_intr_nested · 54 unmodified lines
635624
636625 #if IS_ENABLED(CONFIG_HYPERV)
637626 DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_hyperv_callback);
638−DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment);
639−DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_STIMER0_VECTOR, sysvec_hyperv_stimer0);
627+DECLARE_IDTENTRY_SYSVEC(HYPERV_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment);
628+DECLARE_IDTENTRY_SYSVEC(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0);
640629 #endif
641630
642631 #if IS_ENABLED(CONFIG_ACRN_GUEST)
arch/x86/include/asm/io_bitmap.h+16−0
@@ -19,12 +19,28 @@ struct task_struct; · 18 unmodified lines
1919 void io_bitmap_share(struct task_struct *tsk);
2020 void io_bitmap_exit(struct task_struct *tsk);
2121
22+static inline void native_tss_invalidate_io_bitmap(void)
23+{
24+ /*
25+ * Invalidate the I/O bitmap by moving io_bitmap_base outside the
26+ * TSS limit so any subsequent I/O access from user space will
27+ * trigger a #GP.
28+ *
29+ * This is correct even when VMEXIT rewrites the TSS limit
30+ * to 0x67 as the only requirement is that the base points
31+ * outside the limit.
32+ */
33+ this_cpu_write(cpu_tss_rw.x86_tss.io_bitmap_base,
34+ IO_BITMAP_OFFSET_INVALID);
35+}
36+
2237 void native_tss_update_io_bitmap(void);
2338
2439 #ifdef CONFIG_PARAVIRT_XXL
2540 #include <asm/paravirt.h>
2641 #else
2742 #define tss_update_io_bitmap native_tss_update_io_bitmap
43+#define tss_invalidate_io_bitmap native_tss_invalidate_io_bitmap
2844 #endif
2945
3046 #else
arch/x86/include/asm/kvm_host.h+2−2
@@ -943,7 +943,7 @@ struct kvm_arch { · 942 unmodified lines
943943 atomic_t vapics_in_nmi_mode;
944944 struct mutex apic_map_lock;
945945 struct kvm_apic_map *apic_map;
946− bool apic_map_dirty;
946+ atomic_t apic_map_dirty;
947947
948948 bool apic_access_page_done;
949949 unsigned long apicv_inhibit_reasons;
@@ -1220,7 +1220,7 @@ struct kvm_x86_ops { · 270 unmodified lines
12201220 void (*enable_log_dirty_pt_masked)(struct kvm *kvm,
12211221 struct kvm_memory_slot *slot,
12221222 gfn_t offset, unsigned long mask);
1223− int (*write_log_dirty)(struct kvm_vcpu *vcpu);
1223+ int (*write_log_dirty)(struct kvm_vcpu *vcpu, gpa_t l2_gpa);
12241224
12251225 /* pmu operations of sub-arch */
12261226 const struct kvm_pmu_ops *pmu_ops;
arch/x86/include/asm/mwait.h+0−2
@@ -25,8 +25,6 @@ · 24 unmodified lines
2525 #define TPAUSE_C01_STATE 1
2626 #define TPAUSE_C02_STATE 0
2727
28−u32 get_umwait_control_msr(void);
29−
3028 static inline void __monitor(const void *eax, unsigned long ecx,
3129 unsigned long edx)
3230 {
arch/x86/include/asm/paravirt.h+5−0
@@ -302,6 +302,11 @@ static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) · 301 unmodified lines
302302 }
303303
304304 #ifdef CONFIG_X86_IOPL_IOPERM
305+static inline void tss_invalidate_io_bitmap(void)
306+{
307+ PVOP_VCALL0(cpu.invalidate_io_bitmap);
308+}
309+
305310 static inline void tss_update_io_bitmap(void)
306311 {
307312 PVOP_VCALL0(cpu.update_io_bitmap);
arch/x86/include/asm/paravirt_types.h+1−0
@@ -141,6 +141,7 @@ struct pv_cpu_ops { · 140 unmodified lines
141141 void (*load_sp0)(unsigned long sp0);
142142
143143 #ifdef CONFIG_X86_IOPL_IOPERM
144+ void (*invalidate_io_bitmap)(void);
144145 void (*update_io_bitmap)(void);
145146 #endif
146147
arch/x86/include/asm/pgtable_types.h+2−0
@@ -194,6 +194,7 @@ enum page_cache_mode { · 193 unmodified lines
194194 #define _PAGE_TABLE_NOENC (__PP|__RW|_USR|___A| 0|___D| 0| 0)
195195 #define _PAGE_TABLE (__PP|__RW|_USR|___A| 0|___D| 0| 0| _ENC)
196196 #define __PAGE_KERNEL_RO (__PP| 0| 0|___A|__NX|___D| 0|___G)
197+#define __PAGE_KERNEL_ROX (__PP| 0| 0|___A| 0|___D| 0|___G)
197198 #define __PAGE_KERNEL_NOCACHE (__PP|__RW| 0|___A|__NX|___D| 0|___G| __NC)
198199 #define __PAGE_KERNEL_VVAR (__PP| 0|_USR|___A|__NX|___D| 0|___G)
199200 #define __PAGE_KERNEL_LARGE (__PP|__RW| 0|___A|__NX|___D|_PSE|___G)
@@ -219,6 +220,7 @@ enum page_cache_mode { · 19 unmodified lines
219220 #define PAGE_KERNEL_RO __pgprot_mask(__PAGE_KERNEL_RO | _ENC)
220221 #define PAGE_KERNEL_EXEC __pgprot_mask(__PAGE_KERNEL_EXEC | _ENC)
221222 #define PAGE_KERNEL_EXEC_NOENC __pgprot_mask(__PAGE_KERNEL_EXEC | 0)
223+#define PAGE_KERNEL_ROX __pgprot_mask(__PAGE_KERNEL_ROX | _ENC)
222224 #define PAGE_KERNEL_NOCACHE __pgprot_mask(__PAGE_KERNEL_NOCACHE | _ENC)
223225 #define PAGE_KERNEL_LARGE __pgprot_mask(__PAGE_KERNEL_LARGE | _ENC)
224226 #define PAGE_KERNEL_LARGE_EXEC __pgprot_mask(__PAGE_KERNEL_LARGE_EXEC | _ENC)
arch/x86/include/asm/processor.h+1−1
@@ -370,7 +370,7 @@ struct x86_hw_tss { · 369 unmodified lines
370370 #define IO_BITMAP_OFFSET_INVALID (__KERNEL_TSS_LIMIT + 1)
371371
372372 struct entry_stack {
373− unsigned long words[64];
373+ char stack[PAGE_SIZE];
374374 };
375375
376376 struct entry_stack_page {
arch/x86/include/uapi/asm/kvm.h+3−2
@@ -408,14 +408,15 @@ struct kvm_vmx_nested_state_data { · 407 unmodified lines
408408 };
409409
410410 struct kvm_vmx_nested_state_hdr {
411− __u32 flags;
412411 __u64 vmxon_pa;
413412 __u64 vmcs12_pa;
414− __u64 preemption_timer_deadline;
415413
416414 struct {
417415 __u16 flags;
418416 } smm;
417+
418+ __u32 flags;
419+ __u64 preemption_timer_deadline;
419420 };
420421
421422 struct kvm_svm_nested_state_data {
arch/x86/kernel/apic/io_apic.c+5−5
@@ -2316,12 +2316,12 @@ static int mp_irqdomain_create(int ioapic) · 2315 unmodified lines
23162316 ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops,
23172317 (void *)(long)ioapic);
23182318
2319− /* Release fw handle if it was allocated above */
2320− if (!cfg->dev)
2321− irq_domain_free_fwnode(fn);
2322−
2323− if (!ip->irqdomain)
2319+ if (!ip->irqdomain) {
2320+ /* Release fw handle if it was allocated above */
2321+ if (!cfg->dev)
2322+ irq_domain_free_fwnode(fn);
23242323 return -ENOMEM;
2324+ }
23252325
23262326 ip->irqdomain->parent = parent;
23272327
arch/x86/kernel/apic/msi.c+12−6
@@ -263,12 +263,13 @@ void __init arch_init_msi_domain(struct irq_domain *parent) · 262 unmodified lines
263263 msi_default_domain =
264264 pci_msi_create_irq_domain(fn, &pci_msi_domain_info,
265265 parent);
266− irq_domain_free_fwnode(fn);
267266 }
268− if (!msi_default_domain)
267+ if (!msi_default_domain) {
268+ irq_domain_free_fwnode(fn);
269269 pr_warn("failed to initialize irqdomain for MSI/MSI-x.\n");
270− else
270+ } else {
271271 msi_default_domain->flags |= IRQ_DOMAIN_MSI_NOMASK_QUIRK;
272+ }
272273 }
273274
274275 #ifdef CONFIG_IRQ_REMAP
@@ -301,7 +302,8 @@ struct irq_domain *arch_create_remap_msi_irq_domain(struct irq_domain *parent, · 26 unmodified lines
301302 if (!fn)
302303 return NULL;
303304 d = pci_msi_create_irq_domain(fn, &pci_msi_ir_domain_info, parent);
304− irq_domain_free_fwnode(fn);
305+ if (!d)
306+ irq_domain_free_fwnode(fn);
305307 return d;
306308 }
307309 #endif
@@ -364,7 +366,8 @@ static struct irq_domain *dmar_get_irq_domain(void) · 56 unmodified lines
364366 if (fn) {
365367 dmar_domain = msi_create_irq_domain(fn, &dmar_msi_domain_info,
366368 x86_vector_domain);
367− irq_domain_free_fwnode(fn);
369+ if (!dmar_domain)
370+ irq_domain_free_fwnode(fn);
368371 }
369372 out:
370373 mutex_unlock(&dmar_lock);
@@ -489,7 +492,10 @@ struct irq_domain *hpet_create_irq_domain(int hpet_id) · 118 unmodified lines
489492 }
490493
491494 d = msi_create_irq_domain(fn, domain_info, parent);
492− irq_domain_free_fwnode(fn);
495+ if (!d) {
496+ irq_domain_free_fwnode(fn);
497+ kfree(domain_info);
498+ }
493499 return d;
494500 }
495501
arch/x86/kernel/apic/vector.c+5−18
@@ -446,12 +446,10 @@ static int x86_vector_activate(struct irq_domain *dom, struct irq_data *irqd, · 445 unmodified lines
446446 trace_vector_activate(irqd->irq, apicd->is_managed,
447447 apicd->can_reserve, reserve);
448448
449− /* Nothing to do for fixed assigned vectors */
450− if (!apicd->can_reserve && !apicd->is_managed)
451− return 0;
452−
453449 raw_spin_lock_irqsave(&vector_lock, flags);
454− if (reserve || irqd_is_managed_and_shutdown(irqd))
450+ if (!apicd->can_reserve && !apicd->is_managed)
451+ assign_irq_vector_any_locked(irqd);
452+ else if (reserve || irqd_is_managed_and_shutdown(irqd))
455453 vector_assign_managed_shutdown(irqd);
456454 else if (apicd->is_managed)
457455 ret = activate_managed(irqd);
@@ -709,7 +707,6 @@ int __init arch_early_irq_init(void) · 251 unmodified lines
709707 x86_vector_domain = irq_domain_create_tree(fn, &x86_vector_domain_ops,
710708 NULL);
711709 BUG_ON(x86_vector_domain == NULL);
712− irq_domain_free_fwnode(fn);
713710 irq_set_default_host(x86_vector_domain);
714711
715712 arch_init_msi_domain(x86_vector_domain);
@@ -775,20 +772,10 @@ void lapic_offline(void) · 59 unmodified lines
775772 static int apic_set_affinity(struct irq_data *irqd,
776773 const struct cpumask *dest, bool force)
777774 {
778− struct apic_chip_data *apicd = apic_chip_data(irqd);
779775 int err;
780776
781− /*
782− * Core code can call here for inactive interrupts. For inactive
783− * interrupts which use managed or reservation mode there is no
784− * point in going through the vector assignment right now as the
785− * activation will assign a vector which fits the destination
786− * cpumask. Let the core code store the destination mask and be
787− * done with it.
788− */
789− if (!irqd_is_activated(irqd) &&
790− (apicd->is_managed || apicd->can_reserve))
791− return IRQ_SET_MASK_OK;
777+ if (WARN_ON_ONCE(!irqd_is_activated(irqd)))
778+ return -EIO;
792779
793780 raw_spin_lock(&vector_lock);
794781 cpumask_and(vector_searchmask, dest, cpu_online_mask);
arch/x86/kernel/cpu/centaur.c+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <linux/sched.h>
44 #include <linux/sched/clock.h>
55
6+#include <asm/cpu.h>
67 #include <asm/cpufeature.h>
78 #include <asm/e820/api.h>
89 #include <asm/mtrr.h>
arch/x86/kernel/cpu/common.c+12−12
@@ -347,6 +347,9 @@ out: · 346 unmodified lines
347347 cr4_clear_bits(X86_CR4_UMIP);
348348 }
349349
350+/* These bits should not change their value after CPU init is finished. */
351+static const unsigned long cr4_pinned_mask =
352+ X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP | X86_CR4_FSGSBASE;
350353 static DEFINE_STATIC_KEY_FALSE_RO(cr_pinning);
351354 static unsigned long cr4_pinned_bits __ro_after_init;
352355
@@ -371,20 +374,20 @@ EXPORT_SYMBOL(native_write_cr0); · 18 unmodified lines
371374
372375 void native_write_cr4(unsigned long val)
373376 {
374− unsigned long bits_missing = 0;
377+ unsigned long bits_changed = 0;
375378
376379 set_register:
377380 asm volatile("mov %0,%%cr4": "+r" (val), "+m" (cr4_pinned_bits));
378381
379382 if (static_branch_likely(&cr_pinning)) {
380− if (unlikely((val & cr4_pinned_bits) != cr4_pinned_bits)) {
381− bits_missing = ~val & cr4_pinned_bits;
382− val |= bits_missing;
383+ if (unlikely((val & cr4_pinned_mask) != cr4_pinned_bits)) {
384+ bits_changed = (val & cr4_pinned_mask) ^ cr4_pinned_bits;
385+ val = (val & ~cr4_pinned_mask) | cr4_pinned_bits;
383386 goto set_register;
384387 }
385− /* Warn after we've set the missing bits. */
386− WARN_ONCE(bits_missing, "CR4 bits went missing: %lx!?\n",
387− bits_missing);
388+ /* Warn after we've corrected the changed bits. */
389+ WARN_ONCE(bits_changed, "pinned CR4 bits changed: 0x%lx!?\n",
390+ bits_changed);
388391 }
389392 }
390393 #if IS_MODULE(CONFIG_LKDTM)
@@ -419,7 +422,7 @@ void cr4_init(void) · 28 unmodified lines
419422 if (boot_cpu_has(X86_FEATURE_PCID))
420423 cr4 |= X86_CR4_PCIDE;
421424 if (static_branch_likely(&cr_pinning))
422− cr4 |= cr4_pinned_bits;
425+ cr4 = (cr4 & ~cr4_pinned_mask) | cr4_pinned_bits;
423426
424427 __write_cr4(cr4);
425428
@@ -434,10 +437,7 @@ void cr4_init(void) · 8 unmodified lines
434437 */
435438 static void __init setup_cr_pinning(void)
436439 {
437− unsigned long mask;
438−
439− mask = (X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP);
440− cr4_pinned_bits = this_cpu_read(cpu_tlbstate.cr4) & mask;
440+ cr4_pinned_bits = this_cpu_read(cpu_tlbstate.cr4) & cr4_pinned_mask;
441441 static_key_enable(&cr_pinning.key);
442442 }
443443
arch/x86/kernel/cpu/cpu.h+0−4
@@ -81,8 +81,4 @@ extern void update_srbds_msr(void); · 80 unmodified lines
8181
8282 extern u64 x86_read_arch_cap_msr(void);
8383
84−#ifdef CONFIG_IA32_FEAT_CTL
85−void init_ia32_feat_ctl(struct cpuinfo_x86 *c);
86−#endif
87−
8884 #endif /* ARCH_X86_CPU_H */
arch/x86/kernel/cpu/intel.c+10−1
@@ -49,6 +49,13 @@ enum split_lock_detect_state { · 48 unmodified lines
4949 static enum split_lock_detect_state sld_state __ro_after_init = sld_off;
5050 static u64 msr_test_ctrl_cache __ro_after_init;
5151
52+/*
53+ * With a name like MSR_TEST_CTL it should go without saying, but don't touch
54+ * MSR_TEST_CTL unless the CPU is one of the whitelisted models. Writing it
55+ * on CPUs that do not support SLD can cause fireworks, even when writing '0'.
56+ */
57+static bool cpu_model_supports_sld __ro_after_init;
58+
5259 /*
5360 * Processors which have self-snooping capability can handle conflicting
5461 * memory type across CPUs by snooping its own cache. However, there exists
@@ -1071,7 +1078,8 @@ static void sld_update_msr(bool on) · 1016 unmodified lines
10711078
10721079 static void split_lock_init(void)
10731080 {
1074− split_lock_verify_msr(sld_state != sld_off);
1081+ if (cpu_model_supports_sld)
1082+ split_lock_verify_msr(sld_state != sld_off);
10751083 }
10761084
10771085 static void split_lock_warn(unsigned long ip)
@@ -1177,5 +1185,6 @@ void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c) · 99 unmodified lines
11771185 return;
11781186 }
11791187
1188+ cpu_model_supports_sld = true;
11801189 split_lock_setup();
11811190 }
arch/x86/kernel/cpu/mce/core.c+4−2
@@ -1083,7 +1083,7 @@ static noinstr bool mce_check_crashing_cpu(void) · 1082 unmodified lines
10831083 {
10841084 unsigned int cpu = smp_processor_id();
10851085
1086− if (cpu_is_offline(cpu) ||
1086+ if (arch_cpu_is_offline(cpu) ||
10871087 (crashing_cpu != -1 && crashing_cpu != cpu)) {
10881088 u64 mcgstatus;
10891089
@@ -1901,6 +1901,8 @@ void (*machine_check_vector)(struct pt_regs *) = unexpected_machine_check; · 811 unmodified lines
19011901
19021902 static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
19031903 {
1904+ WARN_ON_ONCE(user_mode(regs));
1905+
19041906 /*
19051907 * Only required when from kernel mode. See
19061908 * mce_check_crashing_cpu() for details.
@@ -1954,7 +1956,7 @@ DEFINE_IDTENTRY_MCE_USER(exc_machine_check) · 47 unmodified lines
19541956 }
19551957 #else
19561958 /* 32bit unified entry point */
1957−DEFINE_IDTENTRY_MCE(exc_machine_check)
1959+DEFINE_IDTENTRY_RAW(exc_machine_check)
19581960 {
19591961 unsigned long dr7;
19601962
arch/x86/kernel/cpu/resctrl/core.c+4−4
@@ -981,10 +981,10 @@ void resctrl_cpu_detect(struct cpuinfo_x86 *c) · 980 unmodified lines
981981
982982 c->x86_cache_max_rmid = ecx;
983983 c->x86_cache_occ_scale = ebx;
984− if (c->x86_vendor == X86_VENDOR_INTEL)
985− c->x86_cache_mbm_width_offset = eax & 0xff;
986− else
987− c->x86_cache_mbm_width_offset = -1;
984+ c->x86_cache_mbm_width_offset = eax & 0xff;
985+
986+ if (c->x86_vendor == X86_VENDOR_AMD && !c->x86_cache_mbm_width_offset)
987+ c->x86_cache_mbm_width_offset = MBM_CNTR_WIDTH_OFFSET_AMD;
988988 }
989989 }
990990
arch/x86/kernel/cpu/resctrl/internal.h+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #define MBA_IS_LINEAR 0x4
3838 #define MBA_MAX_MBPS U32_MAX
3939 #define MAX_MBA_BW_AMD 0x800
40+#define MBM_CNTR_WIDTH_OFFSET_AMD 20
4041
4142 #define RMID_VAL_ERROR BIT_ULL(63)
4243 #define RMID_VAL_UNAVAIL BIT_ULL(62)
arch/x86/kernel/cpu/resctrl/rdtgroup.c+1−0
@@ -1117,6 +1117,7 @@ static int rdt_cdp_peer_get(struct rdt_resource *r, struct rdt_domain *d, · 1116 unmodified lines
11171117 _d_cdp = rdt_find_domain(_r_cdp, d->id, NULL);
11181118 if (WARN_ON(IS_ERR_OR_NULL(_d_cdp))) {
11191119 _r_cdp = NULL;
1120+ _d_cdp = NULL;
11201121 ret = -EINVAL;
11211122 }
11221123
arch/x86/kernel/cpu/umwait.c+0−6
@@ -18,12 +18,6 @@ · 17 unmodified lines
1818 */
1919 static u32 umwait_control_cached = UMWAIT_CTRL_VAL(100000, UMWAIT_C02_ENABLE);
2020
21−u32 get_umwait_control_msr(void)
22−{
23− return umwait_control_cached;
24−}
25−EXPORT_SYMBOL_GPL(get_umwait_control_msr);
26−
2721 /*
2822 * Cache the original IA32_UMWAIT_CONTROL MSR value which is configured by
2923 * hardware or BIOS before kernel boot.
arch/x86/kernel/cpu/zhaoxin.c+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 #include <linux/sched.h>
33 #include <linux/sched/clock.h>
44
5+#include <asm/cpu.h>
56 #include <asm/cpufeature.h>
67
78 #include "cpu.h"
arch/x86/kernel/fpu/core.c+6−0
@@ -101,6 +101,12 @@ void kernel_fpu_begin(void) · 100 unmodified lines
101101 copy_fpregs_to_fpstate(&current->thread.fpu);
102102 }
103103 __cpu_invalidate_fpregs_state();
104+
105+ if (boot_cpu_has(X86_FEATURE_XMM))
106+ ldmxcsr(MXCSR_DEFAULT);
107+
108+ if (boot_cpu_has(X86_FEATURE_FPU))
109+ asm volatile ("fninit");
104110 }
105111 EXPORT_SYMBOL_GPL(kernel_fpu_begin);
106112
arch/x86/kernel/ldt.c+25−1
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929 #include <asm/mmu_context.h>
3030 #include <asm/pgtable_areas.h>
3131
32+#include <xen/xen.h>
33+
3234 /* This is a multiple of PAGE_SIZE. */
3335 #define LDT_SLOT_STRIDE (LDT_ENTRIES * LDT_ENTRY_SIZE)
3436
@@ -543,6 +545,28 @@ static int read_default_ldt(void __user *ptr, unsigned long bytecount) · 508 unmodified lines
543545 return bytecount;
544546 }
545547
548+static bool allow_16bit_segments(void)
549+{
550+ if (!IS_ENABLED(CONFIG_X86_16BIT))
551+ return false;
552+
553+#ifdef CONFIG_XEN_PV
554+ /*
555+ * Xen PV does not implement ESPFIX64, which means that 16-bit
556+ * segments will not work correctly. Until either Xen PV implements
557+ * ESPFIX64 and can signal this fact to the guest or unless someone
558+ * provides compelling evidence that allowing broken 16-bit segments
559+ * is worthwhile, disallow 16-bit segments under Xen PV.
560+ */
561+ if (xen_pv_domain()) {
562+ pr_info_once("Warning: 16-bit segments do not work correctly in a Xen PV guest\n");
563+ return false;
564+ }
565+#endif
566+
567+ return true;
568+}
569+
546570 static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
547571 {
548572 struct mm_struct *mm = current->mm;
@@ -574,7 +598,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) · 25 unmodified lines
574598 /* The user wants to clear the entry. */
575599 memset(&ldt, 0, sizeof(ldt));
576600 } else {
577− if (!IS_ENABLED(CONFIG_X86_16BIT) && !ldt_info.seg_32bit) {
601+ if (!ldt_info.seg_32bit && !allow_16bit_segments()) {
578602 error = -EINVAL;
579603 goto out;
580604 }
arch/x86/kernel/nmi.c+1−1
@@ -478,7 +478,7 @@ static DEFINE_PER_CPU(unsigned long, nmi_dr7); · 477 unmodified lines
478478
479479 DEFINE_IDTENTRY_RAW(exc_nmi)
480480 {
481− if (IS_ENABLED(CONFIG_SMP) && cpu_is_offline(smp_processor_id()))
481+ if (IS_ENABLED(CONFIG_SMP) && arch_cpu_is_offline(smp_processor_id()))
482482 return;
483483
484484 if (this_cpu_read(nmi_state) != NMI_NOT_RUNNING) {
arch/x86/kernel/paravirt.c+2−1
@@ -324,7 +324,8 @@ struct paravirt_patch_template pv_ops = { · 323 unmodified lines
324324 .cpu.swapgs = native_swapgs,
325325
326326 #ifdef CONFIG_X86_IOPL_IOPERM
327− .cpu.update_io_bitmap = native_tss_update_io_bitmap,
327+ .cpu.invalidate_io_bitmap = native_tss_invalidate_io_bitmap,
328+ .cpu.update_io_bitmap = native_tss_update_io_bitmap,
328329 #endif
329330
330331 .cpu.start_context_switch = paravirt_nop,
arch/x86/kernel/process.c+2−16
@@ -322,20 +322,6 @@ void arch_setup_new_exec(void) · 321 unmodified lines
322322 }
323323
324324 #ifdef CONFIG_X86_IOPL_IOPERM
325−static inline void tss_invalidate_io_bitmap(struct tss_struct *tss)
326−{
327− /*
328− * Invalidate the I/O bitmap by moving io_bitmap_base outside the
329− * TSS limit so any subsequent I/O access from user space will
330− * trigger a #GP.
331− *
332− * This is correct even when VMEXIT rewrites the TSS limit
333− * to 0x67 as the only requirement is that the base points
334− * outside the limit.
335− */
336− tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET_INVALID;
337−}
338−
339325 static inline void switch_to_bitmap(unsigned long tifp)
340326 {
341327 /*
@@ -346,7 +332,7 @@ static inline void switch_to_bitmap(unsigned long tifp) · 4 unmodified lines
346332 * user mode.
347333 */
348334 if (tifp & _TIF_IO_BITMAP)
349− tss_invalidate_io_bitmap(this_cpu_ptr(&cpu_tss_rw));
335+ tss_invalidate_io_bitmap();
350336 }
351337
352338 static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm)
@@ -380,7 +366,7 @@ void native_tss_update_io_bitmap(void) · 27 unmodified lines
380366 u16 *base = &tss->x86_tss.io_bitmap_base;
381367
382368 if (!test_thread_flag(TIF_IO_BITMAP)) {
383− tss_invalidate_io_bitmap(tss);
369+ native_tss_invalidate_io_bitmap();
384370 return;
385371 }
386372
arch/x86/kernel/traps.c+56−38
@@ -84,17 +84,16 @@ static inline void cond_local_irq_disable(struct pt_regs *regs) · 83 unmodified lines
8484 local_irq_disable();
8585 }
8686
87−int is_valid_bugaddr(unsigned long addr)
87+__always_inline int is_valid_bugaddr(unsigned long addr)
8888 {
89− unsigned short ud;
90−
9189 if (addr < TASK_SIZE_MAX)
9290 return 0;
9391
94− if (get_kernel_nofault(ud, (unsigned short *)addr))
95− return 0;
96−
97− return ud == INSN_UD0 || ud == INSN_UD2;
92+ /*
93+ * We got #UD, if the text isn't readable we'd have gotten
94+ * a different exception.
95+ */
96+ return *(unsigned short *)addr == INSN_UD2;
9897 }
9998
10099 static nokprobe_inline int
@@ -216,40 +215,45 @@ static inline void handle_invalid_op(struct pt_regs *regs) · 115 unmodified lines
216215 ILL_ILLOPN, error_get_trap_addr(regs));
217216 }
218217
219−DEFINE_IDTENTRY_RAW(exc_invalid_op)
218+static noinstr bool handle_bug(struct pt_regs *regs)
220219 {
221− bool rcu_exit;
220+ bool handled = false;
221+
222+ if (!is_valid_bugaddr(regs->ip))
223+ return handled;
222224
223225 /*
224− * Handle BUG/WARN like NMIs instead of like normal idtentries:
225− * if we bugged/warned in a bad RCU context, for example, the last
226− * thing we want is to BUG/WARN again in the idtentry code, ad
227− * infinitum.
226+ * All lies, just get the WARN/BUG out.
227+ */
228+ instrumentation_begin();
229+ /*
230+ * Since we're emulating a CALL with exceptions, restore the interrupt
231+ * state to what it was at the exception site.
228232 */
229− if (!user_mode(regs) && is_valid_bugaddr(regs->ip)) {
230− enum bug_trap_type type;
233+ if (regs->flags & X86_EFLAGS_IF)
234+ raw_local_irq_enable();
235+ if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
236+ regs->ip += LEN_UD2;
237+ handled = true;
238+ }
239+ if (regs->flags & X86_EFLAGS_IF)
240+ raw_local_irq_disable();
241+ instrumentation_end();
231242
232− nmi_enter();
233− instrumentation_begin();
234− trace_hardirqs_off_finish();
235− type = report_bug(regs->ip, regs);
236− if (regs->flags & X86_EFLAGS_IF)
237− trace_hardirqs_on_prepare();
238− instrumentation_end();
239− nmi_exit();
243+ return handled;
244+}
240245
241− if (type == BUG_TRAP_TYPE_WARN) {
242− /* Skip the ud2. */
243− regs->ip += LEN_UD2;
244− return;
245− }
246+DEFINE_IDTENTRY_RAW(exc_invalid_op)
247+{
248+ bool rcu_exit;
246249
247− /*
248− * Else, if this was a BUG and report_bug returns or if this
249− * was just a normal #UD, we want to continue onward and
250− * crash.
251− */
252− }
250+ /*
251+ * We use UD2 as a short encoding for 'CALL __WARN', as such
252+ * handle it before exception entry to avoid recursive WARN
253+ * in case exception entry is the one triggering WARNs.
254+ */
255+ if (!user_mode(regs) && handle_bug(regs))
256+ return;
253257
254258 rcu_exit = idtentry_enter_cond_rcu(regs);
255259 instrumentation_begin();
@@ -299,6 +303,8 @@ DEFINE_IDTENTRY_ERRORCODE(exc_alignment_check) · 43 unmodified lines
299303
300304 do_trap(X86_TRAP_AC, SIGBUS, "alignment check", regs,
301305 error_code, BUS_ADRALN, NULL);
306+
307+ local_irq_disable();
302308 }
303309
304310 #ifdef CONFIG_VMAP_STACK
@@ -691,13 +697,13 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s) · 386 unmodified lines
691697 (struct bad_iret_stack *)__this_cpu_read(cpu_tss_rw.x86_tss.sp0) - 1;
692698
693699 /* Copy the IRET target to the temporary storage. */
694− memcpy(&tmp.regs.ip, (void *)s->regs.sp, 5*8);
700+ __memcpy(&tmp.regs.ip, (void *)s->regs.sp, 5*8);
695701
696702 /* Copy the remainder of the stack from the current stack. */
697− memcpy(&tmp, s, offsetof(struct bad_iret_stack, regs.ip));
703+ __memcpy(&tmp, s, offsetof(struct bad_iret_stack, regs.ip));
698704
699705 /* Update the entry stack */
700− memcpy(new_stack, &tmp, sizeof(tmp));
706+ __memcpy(new_stack, &tmp, sizeof(tmp));
701707
702708 BUG_ON(!user_mode(&new_stack->regs));
703709 return new_stack;
@@ -865,6 +871,12 @@ static __always_inline void exc_debug_kernel(struct pt_regs *regs, · 161 unmodified lines
865871 instrumentation_begin();
866872 trace_hardirqs_off_finish();
867873
874+ /*
875+ * If something gets miswired and we end up here for a user mode
876+ * #DB, we will malfunction.
877+ */
878+ WARN_ON_ONCE(user_mode(regs));
879+
868880 /*
869881 * Catch SYSENTER with TF set and clear DR_STEP. If this hit a
870882 * watchpoint at the same time then that will still be handled.
@@ -883,6 +895,12 @@ static __always_inline void exc_debug_kernel(struct pt_regs *regs, · 12 unmodified lines
883895 static __always_inline void exc_debug_user(struct pt_regs *regs,
884896 unsigned long dr6)
885897 {
898+ /*
899+ * If something gets miswired and we end up here for a kernel mode
900+ * #DB, we will malfunction.
901+ */
902+ WARN_ON_ONCE(!user_mode(regs));
903+
886904 idtentry_enter_user(regs);
887905 instrumentation_begin();
888906
@@ -913,7 +931,7 @@ DEFINE_IDTENTRY_DEBUG_USER(exc_debug) · 24 unmodified lines
913931 }
914932 #else
915933 /* 32 bit does not have separate entry points. */
916−DEFINE_IDTENTRY_DEBUG(exc_debug)
934+DEFINE_IDTENTRY_RAW(exc_debug)
917935 {
918936 unsigned long dr6, dr7;
919937
arch/x86/kvm/kvm_cache_regs.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 #define KVM_POSSIBLE_CR0_GUEST_BITS X86_CR0_TS
88 #define KVM_POSSIBLE_CR4_GUEST_BITS \
99 (X86_CR4_PVI | X86_CR4_DE | X86_CR4_PCE | X86_CR4_OSFXSR \
10− | X86_CR4_OSXMMEXCPT | X86_CR4_LA57 | X86_CR4_PGE)
10+ | X86_CR4_OSXMMEXCPT | X86_CR4_LA57 | X86_CR4_PGE | X86_CR4_TSD)
1111
1212 #define BUILD_KVM_GPR_ACCESSORS(lname, uname) \
1313 static __always_inline unsigned long kvm_##lname##_read(struct kvm_vcpu *vcpu)\
arch/x86/kvm/lapic.c+31−19
@@ -169,6 +169,18 @@ static void kvm_apic_map_free(struct rcu_head *rcu) · 168 unmodified lines
169169 kvfree(map);
170170 }
171171
172+/*
173+ * CLEAN -> DIRTY and UPDATE_IN_PROGRESS -> DIRTY changes happen without a lock.
174+ *
175+ * DIRTY -> UPDATE_IN_PROGRESS and UPDATE_IN_PROGRESS -> CLEAN happen with
176+ * apic_map_lock_held.
177+ */
178+enum {
179+ CLEAN,
180+ UPDATE_IN_PROGRESS,
181+ DIRTY
182+};
183+
172184 void kvm_recalculate_apic_map(struct kvm *kvm)
173185 {
174186 struct kvm_apic_map *new, *old = NULL;
@@ -176,17 +188,17 @@ void kvm_recalculate_apic_map(struct kvm *kvm) · 1 unmodified line
176188 int i;
177189 u32 max_id = 255; /* enough space for any xAPIC ID */
178190
179− if (!kvm->arch.apic_map_dirty) {
180− /*
181− * Read kvm->arch.apic_map_dirty before
182− * kvm->arch.apic_map
183− */
184− smp_rmb();
191+ /* Read kvm->arch.apic_map_dirty before kvm->arch.apic_map. */
192+ if (atomic_read_acquire(&kvm->arch.apic_map_dirty) == CLEAN)
185193 return;
186− }
187194
188195 mutex_lock(&kvm->arch.apic_map_lock);
189− if (!kvm->arch.apic_map_dirty) {
196+ /*
197+ * Read kvm->arch.apic_map_dirty before kvm->arch.apic_map
198+ * (if clean) or the APIC registers (if dirty).
199+ */
200+ if (atomic_cmpxchg_acquire(&kvm->arch.apic_map_dirty,
201+ DIRTY, UPDATE_IN_PROGRESS) == CLEAN) {
190202 /* Someone else has updated the map. */
191203 mutex_unlock(&kvm->arch.apic_map_lock);
192204 return;
@@ -256,11 +268,11 @@ out: · 63 unmodified lines
256268 lockdep_is_held(&kvm->arch.apic_map_lock));
257269 rcu_assign_pointer(kvm->arch.apic_map, new);
258270 /*
259− * Write kvm->arch.apic_map before
260− * clearing apic->apic_map_dirty
271+ * Write kvm->arch.apic_map before clearing apic->apic_map_dirty.
272+ * If another update has come in, leave it DIRTY.
261273 */
262− smp_wmb();
263− kvm->arch.apic_map_dirty = false;
274+ atomic_cmpxchg_release(&kvm->arch.apic_map_dirty,
275+ UPDATE_IN_PROGRESS, CLEAN);
264276 mutex_unlock(&kvm->arch.apic_map_lock);
265277
266278 if (old)
@@ -282,20 +294,20 @@ static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val) · 15 unmodified lines
282294 else
283295 static_key_slow_inc(&apic_sw_disabled.key);
284296
285− apic->vcpu->kvm->arch.apic_map_dirty = true;
297+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
286298 }
287299 }
288300
289301 static inline void kvm_apic_set_xapic_id(struct kvm_lapic *apic, u8 id)
290302 {
291303 kvm_lapic_set_reg(apic, APIC_ID, id << 24);
292− apic->vcpu->kvm->arch.apic_map_dirty = true;
304+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
293305 }
294306
295307 static inline void kvm_apic_set_ldr(struct kvm_lapic *apic, u32 id)
296308 {
297309 kvm_lapic_set_reg(apic, APIC_LDR, id);
298− apic->vcpu->kvm->arch.apic_map_dirty = true;
310+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
299311 }
300312
301313 static inline u32 kvm_apic_calc_x2apic_ldr(u32 id)
@@ -311,7 +323,7 @@ static inline void kvm_apic_set_x2apic_id(struct kvm_lapic *apic, u32 id) · 9 unmodified lines
311323
312324 kvm_lapic_set_reg(apic, APIC_ID, id);
313325 kvm_lapic_set_reg(apic, APIC_LDR, ldr);
314− apic->vcpu->kvm->arch.apic_map_dirty = true;
326+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
315327 }
316328
317329 static inline int apic_lvt_enabled(struct kvm_lapic *apic, int lvt_type)
@@ -1976,7 +1988,7 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val) · 1658 unmodified lines
19761988 case APIC_DFR:
19771989 if (!apic_x2apic_mode(apic)) {
19781990 kvm_lapic_set_reg(apic, APIC_DFR, val | 0x0FFFFFFF);
1979− apic->vcpu->kvm->arch.apic_map_dirty = true;
1991+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
19801992 } else
19811993 ret = 1;
19821994 break;
@@ -2232,7 +2244,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value) · 249 unmodified lines
22322244 static_key_slow_dec_deferred(&apic_hw_disabled);
22332245 } else {
22342246 static_key_slow_inc(&apic_hw_disabled.key);
2235− vcpu->kvm->arch.apic_map_dirty = true;
2247+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
22362248 }
22372249 }
22382250
@@ -2273,7 +2285,6 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) · 34 unmodified lines
22732285 if (!apic)
22742286 return;
22752287
2276− vcpu->kvm->arch.apic_map_dirty = false;
22772288 /* Stop the timer in case it's a reset to an active apic */
22782289 hrtimer_cancel(&apic->lapic_timer.timer);
22792290
@@ -2567,6 +2578,7 @@ int kvm_apic_set_state(struct kvm_vcpu *vcpu, struct kvm_lapic_state *s) · 287 unmodified lines
25672578 }
25682579 memcpy(vcpu->arch.apic->regs, s->regs, sizeof(*s));
25692580
2581+ atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
25702582 kvm_recalculate_apic_map(vcpu->kvm);
25712583 kvm_apic_set_version(vcpu);
25722584
arch/x86/kvm/mmu.h+1−1
@@ -222,7 +222,7 @@ void kvm_mmu_gfn_disallow_lpage(struct kvm_memory_slot *slot, gfn_t gfn); · 221 unmodified lines
222222 void kvm_mmu_gfn_allow_lpage(struct kvm_memory_slot *slot, gfn_t gfn);
223223 bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
224224 struct kvm_memory_slot *slot, u64 gfn);
225−int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu);
225+int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu, gpa_t l2_gpa);
226226
227227 int kvm_mmu_post_init_vm(struct kvm *kvm);
228228 void kvm_mmu_pre_destroy_vm(struct kvm *kvm);
arch/x86/kvm/mmu/mmu.c+3−3
@@ -1745,10 +1745,10 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm, · 1744 unmodified lines
17451745 * Emulate arch specific page modification logging for the
17461746 * nested hypervisor
17471747 */
1748−int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu)
1748+int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu, gpa_t l2_gpa)
17491749 {
17501750 if (kvm_x86_ops.write_log_dirty)
1751− return kvm_x86_ops.write_log_dirty(vcpu);
1751+ return kvm_x86_ops.write_log_dirty(vcpu, l2_gpa);
17521752
17531753 return 0;
17541754 }
@@ -4449,7 +4449,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, · 2694 unmodified lines
44494449 nonleaf_bit8_rsvd | rsvd_bits(7, 7) |
44504450 rsvd_bits(maxphyaddr, 51);
44514451 rsvd_check->rsvd_bits_mask[0][2] = exb_bit_rsvd |
4452− nonleaf_bit8_rsvd | gbpages_bit_rsvd |
4452+ gbpages_bit_rsvd |
44534453 rsvd_bits(maxphyaddr, 51);
44544454 rsvd_check->rsvd_bits_mask[0][1] = exb_bit_rsvd |
44554455 rsvd_bits(maxphyaddr, 51);
arch/x86/kvm/mmu/paging_tmpl.h+7−9
@@ -235,7 +235,7 @@ static inline unsigned FNAME(gpte_access)(u64 gpte) · 234 unmodified lines
235235 static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
236236 struct kvm_mmu *mmu,
237237 struct guest_walker *walker,
238− int write_fault)
238+ gpa_t addr, int write_fault)
239239 {
240240 unsigned level, index;
241241 pt_element_t pte, orig_pte;
@@ -260,7 +260,7 @@ static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu, · 18 unmodified lines
260260 !(pte & PT_GUEST_DIRTY_MASK)) {
261261 trace_kvm_mmu_set_dirty_bit(table_gfn, index, sizeof(pte));
262262 #if PTTYPE == PTTYPE_EPT
263− if (kvm_arch_write_log_dirty(vcpu))
263+ if (kvm_arch_write_log_dirty(vcpu, addr))
264264 return -EINVAL;
265265 #endif
266266 pte |= PT_GUEST_DIRTY_MASK;
@@ -360,7 +360,6 @@ retry_walk: · 93 unmodified lines
360360 ++walker->level;
361361
362362 do {
363− gfn_t real_gfn;
364363 unsigned long host_addr;
365364
366365 pt_access = pte_access;
@@ -375,7 +374,7 @@ retry_walk: · 8 unmodified lines
375374 walker->table_gfn[walker->level - 1] = table_gfn;
376375 walker->pte_gpa[walker->level - 1] = pte_gpa;
377376
378− real_gfn = mmu->translate_gpa(vcpu, gfn_to_gpa(table_gfn),
377+ real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(table_gfn),
379378 nested_access,
380379 &walker->fault);
381380
@@ -389,12 +388,10 @@ retry_walk: · 7 unmodified lines
389388 * information to fix the exit_qualification or exit_info_1
390389 * fields.
391390 */
392− if (unlikely(real_gfn == UNMAPPED_GVA))
391+ if (unlikely(real_gpa == UNMAPPED_GVA))
393392 return 0;
394393
395− real_gfn = gpa_to_gfn(real_gfn);
396−
397− host_addr = kvm_vcpu_gfn_to_hva_prot(vcpu, real_gfn,
394+ host_addr = kvm_vcpu_gfn_to_hva_prot(vcpu, gpa_to_gfn(real_gpa),
398395 &walker->pte_writable[walker->level - 1]);
399396 if (unlikely(kvm_is_error_hva(host_addr)))
400397 goto error;
@@ -457,7 +454,8 @@ retry_walk: · 56 unmodified lines
457454 (PT_GUEST_DIRTY_SHIFT - PT_GUEST_ACCESSED_SHIFT);
458455
459456 if (unlikely(!accessed_dirty)) {
460− ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker, write_fault);
457+ ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker,
458+ addr, write_fault);
461459 if (unlikely(ret < 0))
462460 goto error;
463461 else if (ret)
arch/x86/kvm/svm/svm.c+1−1
@@ -3344,7 +3344,7 @@ static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu) · 3343 unmodified lines
33443344
33453345 void __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
33463346
3347−static fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
3347+static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
33483348 {
33493349 fastpath_t exit_fastpath;
33503350 struct vcpu_svm *svm = to_svm(vcpu);
arch/x86/kvm/vmx/nested.c+3−2
@@ -4109,7 +4109,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, · 4108 unmodified lines
41094109 * CR0_GUEST_HOST_MASK is already set in the original vmcs01
41104110 * (KVM doesn't change it);
41114111 */
4112− vcpu->arch.cr0_guest_owned_bits = X86_CR0_TS;
4112+ vcpu->arch.cr0_guest_owned_bits = KVM_POSSIBLE_CR0_GUEST_BITS;
41134113 vmx_set_cr0(vcpu, vmcs12->host_cr0);
41144114
41154115 /* Same as above - no reason to call set_cr4_guest_host_mask(). */
@@ -4259,7 +4259,7 @@ static void nested_vmx_restore_host_state(struct kvm_vcpu *vcpu) · 143 unmodified lines
42594259 */
42604260 vmx_set_efer(vcpu, nested_vmx_get_vmcs01_guest_efer(vmx));
42614261
4262− vcpu->arch.cr0_guest_owned_bits = X86_CR0_TS;
4262+ vcpu->arch.cr0_guest_owned_bits = KVM_POSSIBLE_CR0_GUEST_BITS;
42634263 vmx_set_cr0(vcpu, vmcs_readl(CR0_READ_SHADOW));
42644264
42654265 vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
@@ -6176,6 +6176,7 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 1910 unmodified lines
61766176 goto error_guest_mode;
61776177 }
61786178
6179+ vmx->nested.has_preemption_timer_deadline = false;
61796180 if (kvm_state->hdr.vmx.flags & KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE) {
61806181 vmx->nested.has_preemption_timer_deadline = true;
61816182 vmx->nested.preemption_timer_deadline =
arch/x86/kvm/vmx/vmcs.h+20−12
@@ -72,11 +72,24 @@ struct loaded_vmcs { · 71 unmodified lines
7272 struct vmcs_controls_shadow controls_shadow;
7373 };
7474
75+static inline bool is_intr_type(u32 intr_info, u32 type)
76+{
77+ const u32 mask = INTR_INFO_VALID_MASK | INTR_INFO_INTR_TYPE_MASK;
78+
79+ return (intr_info & mask) == (INTR_INFO_VALID_MASK | type);
80+}
81+
82+static inline bool is_intr_type_n(u32 intr_info, u32 type, u8 vector)
83+{
84+ const u32 mask = INTR_INFO_VALID_MASK | INTR_INFO_INTR_TYPE_MASK |
85+ INTR_INFO_VECTOR_MASK;
86+
87+ return (intr_info & mask) == (INTR_INFO_VALID_MASK | type | vector);
88+}
89+
7590 static inline bool is_exception_n(u32 intr_info, u8 vector)
7691 {
77− return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
78− INTR_INFO_VALID_MASK)) ==
79− (INTR_TYPE_HARD_EXCEPTION | vector | INTR_INFO_VALID_MASK);
92+ return is_intr_type_n(intr_info, INTR_TYPE_HARD_EXCEPTION, vector);
8093 }
8194
8295 static inline bool is_debug(u32 intr_info)
@@ -106,28 +119,23 @@ static inline bool is_gp_fault(u32 intr_info) · 23 unmodified lines
106119
107120 static inline bool is_machine_check(u32 intr_info)
108121 {
109− return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
110− INTR_INFO_VALID_MASK)) ==
111− (INTR_TYPE_HARD_EXCEPTION | MC_VECTOR | INTR_INFO_VALID_MASK);
122+ return is_exception_n(intr_info, MC_VECTOR);
112123 }
113124
114125 /* Undocumented: icebp/int1 */
115126 static inline bool is_icebp(u32 intr_info)
116127 {
117− return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK))
118− == (INTR_TYPE_PRIV_SW_EXCEPTION | INTR_INFO_VALID_MASK);
128+ return is_intr_type(intr_info, INTR_TYPE_PRIV_SW_EXCEPTION);
119129 }
120130
121131 static inline bool is_nmi(u32 intr_info)
122132 {
123− return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK))
124− == (INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK);
133+ return is_intr_type(intr_info, INTR_TYPE_NMI_INTR);
125134 }
126135
127136 static inline bool is_external_intr(u32 intr_info)
128137 {
129− return (intr_info & (INTR_INFO_VALID_MASK | INTR_INFO_INTR_TYPE_MASK))
130− == (INTR_INFO_VALID_MASK | INTR_TYPE_EXT_INTR);
138+ return is_intr_type(intr_info, INTR_TYPE_EXT_INTR);
131139 }
132140
133141 enum vmcs_field_width {
arch/x86/kvm/vmx/vmx.c+9−31
@@ -133,9 +133,6 @@ module_param_named(preemption_timer, enable_preemption_timer, bool, S_IRUGO); · 132 unmodified lines
133133 #define KVM_VM_CR0_ALWAYS_ON \
134134 (KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST | \
135135 X86_CR0_WP | X86_CR0_PG | X86_CR0_PE)
136−#define KVM_CR4_GUEST_OWNED_BITS \
137− (X86_CR4_PVI | X86_CR4_DE | X86_CR4_PCE | X86_CR4_OSFXSR \
138− | X86_CR4_OSXMMEXCPT | X86_CR4_LA57 | X86_CR4_TSD)
139136
140137 #define KVM_VM_CR4_ALWAYS_ON_UNRESTRICTED_GUEST X86_CR4_VMXE
141138 #define KVM_PMODE_VM_CR4_ALWAYS_ON (X86_CR4_PAE | X86_CR4_VMXE)
@@ -4034,9 +4031,9 @@ void vmx_set_constant_host_state(struct vcpu_vmx *vmx) · 3892 unmodified lines
40344031
40354032 void set_cr4_guest_host_mask(struct vcpu_vmx *vmx)
40364033 {
4037− vmx->vcpu.arch.cr4_guest_owned_bits = KVM_CR4_GUEST_OWNED_BITS;
4038− if (enable_ept)
4039− vmx->vcpu.arch.cr4_guest_owned_bits |= X86_CR4_PGE;
4034+ vmx->vcpu.arch.cr4_guest_owned_bits = KVM_POSSIBLE_CR4_GUEST_BITS;
4035+ if (!enable_ept)
4036+ vmx->vcpu.arch.cr4_guest_owned_bits &= ~X86_CR4_PGE;
40404037 if (is_guest_mode(&vmx->vcpu))
40414038 vmx->vcpu.arch.cr4_guest_owned_bits &=
40424039 ~get_vmcs12(&vmx->vcpu)->cr4_guest_host_mask;
@@ -4333,8 +4330,8 @@ static void init_vmcs(struct vcpu_vmx *vmx) · 290 unmodified lines
43334330 /* 22.2.1, 20.8.1 */
43344331 vm_entry_controls_set(vmx, vmx_vmentry_ctrl());
43354332
4336− vmx->vcpu.arch.cr0_guest_owned_bits = X86_CR0_TS;
4337− vmcs_writel(CR0_GUEST_HOST_MASK, ~X86_CR0_TS);
4333+ vmx->vcpu.arch.cr0_guest_owned_bits = KVM_POSSIBLE_CR0_GUEST_BITS;
4334+ vmcs_writel(CR0_GUEST_HOST_MASK, ~vmx->vcpu.arch.cr0_guest_owned_bits);
43384335
43394336 set_cr4_guest_host_mask(vmx);
43404337
@@ -6606,23 +6603,6 @@ static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx) · 2265 unmodified lines
66066603 msrs[i].host, false);
66076604 }
66086605
6609−static void atomic_switch_umwait_control_msr(struct vcpu_vmx *vmx)
6610−{
6611− u32 host_umwait_control;
6612−
6613− if (!vmx_has_waitpkg(vmx))
6614− return;
6615−
6616− host_umwait_control = get_umwait_control_msr();
6617−
6618− if (vmx->msr_ia32_umwait_control != host_umwait_control)
6619− add_atomic_switch_msr(vmx, MSR_IA32_UMWAIT_CONTROL,
6620− vmx->msr_ia32_umwait_control,
6621− host_umwait_control, false);
6622− else
6623− clear_atomic_switch_msr(vmx, MSR_IA32_UMWAIT_CONTROL);
6624−}
6625−
66266606 static void vmx_update_hv_timer(struct kvm_vcpu *vcpu)
66276607 {
66286608 struct vcpu_vmx *vmx = to_vmx(vcpu);
@@ -6728,9 +6708,7 @@ reenter_guest: · 99 unmodified lines
67286708
67296709 pt_guest_enter(vmx);
67306710
6731− if (vcpu_to_pmu(vcpu)->version)
6732− atomic_switch_perf_msrs(vmx);
6733− atomic_switch_umwait_control_msr(vmx);
6711+ atomic_switch_perf_msrs(vmx);
67346712
67356713 if (enable_preemption_timer)
67366714 vmx_update_hv_timer(vcpu);
@@ -7501,11 +7479,11 @@ static void vmx_flush_log_dirty(struct kvm *kvm) · 764 unmodified lines
75017479 kvm_flush_pml_buffers(kvm);
75027480 }
75037481
7504−static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
7482+static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu, gpa_t gpa)
75057483 {
75067484 struct vmcs12 *vmcs12;
75077485 struct vcpu_vmx *vmx = to_vmx(vcpu);
7508− gpa_t gpa, dst;
7486+ gpa_t dst;
75097487
75107488 if (is_guest_mode(vcpu)) {
75117489 WARN_ON_ONCE(vmx->nested.pml_full);
@@ -7524,7 +7502,7 @@ static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu) · 12 unmodified lines
75247502 return 1;
75257503 }
75267504
7527− gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS) & ~0xFFFull;
7505+ gpa &= ~0xFFFull;
75287506 dst = vmcs12->pml_address + sizeof(u64) * vmcs12->guest_pml_index;
75297507
75307508 if (kvm_write_guest_page(vcpu->kvm, gpa_to_gfn(dst), &gpa,
arch/x86/kvm/vmx/vmx.h+0−2
@@ -288,8 +288,6 @@ struct vcpu_vmx { · 287 unmodified lines
288288
289289 u64 current_tsc_ratio;
290290
291− u32 host_pkru;
292−
293291 unsigned long host_debugctlmsr;
294292
295293 /*
arch/x86/kvm/x86.c+9−3
@@ -975,6 +975,8 @@ int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) · 974 unmodified lines
975975 if (is_long_mode(vcpu)) {
976976 if (!(cr4 & X86_CR4_PAE))
977977 return 1;
978+ if ((cr4 ^ old_cr4) & X86_CR4_LA57)
979+ return 1;
978980 } else if (is_paging(vcpu) && (cr4 & X86_CR4_PAE)
979981 && ((cr4 ^ old_cr4) & pdptr_bits)
980982 && !load_pdptrs(vcpu, vcpu->arch.walk_mmu,
@@ -2693,6 +2695,9 @@ static int kvm_pv_enable_async_pf(struct kvm_vcpu *vcpu, u64 data) · 1712 unmodified lines
26932695 if (data & 0x30)
26942696 return 1;
26952697
2698+ if (!lapic_in_kernel(vcpu))
2699+ return 1;
2700+
26962701 vcpu->arch.apf.msr_en_val = data;
26972702
26982703 if (!kvm_pv_async_pf_enabled(vcpu)) {
@@ -2856,7 +2861,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 157 unmodified lines
28562861 return kvm_mtrr_set_msr(vcpu, msr, data);
28572862 case MSR_IA32_APICBASE:
28582863 return kvm_set_apic_base(vcpu, msr_info);
2859− case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
2864+ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
28602865 return kvm_x2apic_msr_write(vcpu, msr, data);
28612866 case MSR_IA32_TSCDEADLINE:
28622867 kvm_set_lapic_tscdeadline_msr(vcpu, data);
@@ -3196,7 +3201,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 333 unmodified lines
31963201 case MSR_IA32_APICBASE:
31973202 msr_info->data = kvm_get_apic_base(vcpu);
31983203 break;
3199− case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
3204+ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
32003205 return kvm_x2apic_msr_read(vcpu, msr_info->index, &msr_info->data);
32013206 case MSR_IA32_TSCDEADLINE:
32023207 msr_info->data = kvm_get_lapic_tscdeadline_msr(vcpu);
@@ -4603,7 +4608,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp, · 1400 unmodified lines
46034608 r = -EINVAL;
46044609 user_tsc_khz = (u32)arg;
46054610
4606− if (user_tsc_khz >= kvm_max_guest_tsc_khz)
4611+ if (kvm_has_tsc_control &&
4612+ user_tsc_khz >= kvm_max_guest_tsc_khz)
46074613 goto out;
46084614
46094615 if (user_tsc_khz == 0)
arch/x86/lib/memcpy_64.S+4−0
@@ -8,6 +8,8 @@ · 7 unmodified lines
88 #include <asm/alternative-asm.h>
99 #include <asm/export.h>
1010
11+.pushsection .noinstr.text, "ax"
12+
1113 /*
1214 * We build a jump to memcpy_orig by default which gets NOPped out on
1315 * the majority of x86 CPUs which set REP_GOOD. In addition, CPUs which
@@ -184,6 +186,8 @@ SYM_FUNC_START_LOCAL(memcpy_orig) · 170 unmodified lines
184186 retq
185187 SYM_FUNC_END(memcpy_orig)
186188
189+.popsection
190+
187191 #ifndef CONFIG_UML
188192
189193 MCSAFE_TEST_CTL
arch/x86/lib/usercopy_64.c+1−0
@@ -24,6 +24,7 @@ unsigned long __clear_user(void __user *addr, unsigned long size) · 23 unmodified lines
2424 asm volatile(
2525 " testq %[size8],%[size8]\n"
2626 " jz 4f\n"
27+ " .align 16\n"
2728 "0: movq $0,(%[dst])\n"
2829 " addq $8,%[dst]\n"
2930 " decl %%ecx ; jnz 0b\n"
arch/x86/math-emu/wm_sqrt.S+1−1
@@ -209,7 +209,7 @@ sqrt_stage_2_finish: · 208 unmodified lines
209209
210210 #ifdef PARANOID
211211 /* It should be possible to get here only if the arg is ffff....ffff */
212− cmp $0xffffffff,FPU_fsqrt_arg_1
212+ cmpl $0xffffffff,FPU_fsqrt_arg_1
213213 jnz sqrt_stage_2_error
214214 #endif /* PARANOID */
215215
arch/x86/platform/uv/uv_irq.c+2−1
@@ -167,9 +167,10 @@ static struct irq_domain *uv_get_irq_domain(void) · 166 unmodified lines
167167 goto out;
168168
169169 uv_domain = irq_domain_create_tree(fn, &uv_domain_ops, NULL);
170− irq_domain_free_fwnode(fn);
171170 if (uv_domain)
172171 uv_domain->parent = x86_vector_domain;
172+ else
173+ irq_domain_free_fwnode(fn);
173174 out:
174175 mutex_unlock(&uv_lock);
175176
arch/x86/power/cpu.c+6−0
@@ -193,6 +193,8 @@ static void fix_processor_context(void) · 192 unmodified lines
193193 */
194194 static void notrace __restore_processor_state(struct saved_context *ctxt)
195195 {
196+ struct cpuinfo_x86 *c;
197+
196198 if (ctxt->misc_enable_saved)
197199 wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable);
198200 /*
@@ -263,6 +265,10 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) · 64 unmodified lines
263265 mtrr_bp_restore();
264266 perf_restore_debug_store();
265267 msr_restore_context(ctxt);
268+
269+ c = &cpu_data(smp_processor_id());
270+ if (cpu_has(c, X86_FEATURE_MSR_IA32_FEAT_CTL))
271+ init_ia32_feat_ctl(c);
266272 }
267273
268274 /* Needed by apm.c */
arch/x86/xen/enlighten_pv.c+36−4
@@ -598,6 +598,26 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum, · 597 unmodified lines
598598 }
599599
600600 #ifdef CONFIG_X86_64
601+void noist_exc_debug(struct pt_regs *regs);
602+
603+DEFINE_IDTENTRY_RAW(xenpv_exc_nmi)
604+{
605+ /* On Xen PV, NMI doesn't use IST. The C part is the sane as native. */
606+ exc_nmi(regs);
607+}
608+
609+DEFINE_IDTENTRY_RAW(xenpv_exc_debug)
610+{
611+ /*
612+ * There's no IST on Xen PV, but we still need to dispatch
613+ * to the correct handler.
614+ */
615+ if (user_mode(regs))
616+ noist_exc_debug(regs);
617+ else
618+ exc_debug(regs);
619+}
620+
601621 struct trap_array_entry {
602622 void (*orig)(void);
603623 void (*xen)(void);
@@ -609,18 +629,18 @@ struct trap_array_entry { · 5 unmodified lines
609629 .xen = xen_asm_##func, \
610630 .ist_okay = ist_ok }
611631
612−#define TRAP_ENTRY_REDIR(func, xenfunc, ist_ok) { \
632+#define TRAP_ENTRY_REDIR(func, ist_ok) { \
613633 .orig = asm_##func, \
614− .xen = xen_asm_##xenfunc, \
634+ .xen = xen_asm_xenpv_##func, \
615635 .ist_okay = ist_ok }
616636
617637 static struct trap_array_entry trap_array[] = {
618− TRAP_ENTRY_REDIR(exc_debug, exc_xendebug, true ),
638+ TRAP_ENTRY_REDIR(exc_debug, true ),
619639 TRAP_ENTRY(exc_double_fault, true ),
620640 #ifdef CONFIG_X86_MCE
621641 TRAP_ENTRY(exc_machine_check, true ),
622642 #endif
623− TRAP_ENTRY_REDIR(exc_nmi, exc_xennmi, true ),
643+ TRAP_ENTRY_REDIR(exc_nmi, true ),
624644 TRAP_ENTRY(exc_int3, false ),
625645 TRAP_ENTRY(exc_overflow, false ),
626646 #ifdef CONFIG_IA32_EMULATION
@@ -850,6 +870,17 @@ static void xen_load_sp0(unsigned long sp0) · 223 unmodified lines
850870 }
851871
852872 #ifdef CONFIG_X86_IOPL_IOPERM
873+static void xen_invalidate_io_bitmap(void)
874+{
875+ struct physdev_set_iobitmap iobitmap = {
876+ .bitmap = 0,
877+ .nr_ports = 0,
878+ };
879+
880+ native_tss_invalidate_io_bitmap();
881+ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap);
882+}
883+
853884 static void xen_update_io_bitmap(void)
854885 {
855886 struct physdev_set_iobitmap iobitmap;
@@ -1079,6 +1110,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { · 223 unmodified lines
10791110 .load_sp0 = xen_load_sp0,
10801111
10811112 #ifdef CONFIG_X86_IOPL_IOPERM
1113+ .invalidate_io_bitmap = xen_invalidate_io_bitmap,
10821114 .update_io_bitmap = xen_update_io_bitmap,
10831115 #endif
10841116 .io_delay = xen_io_delay,
arch/x86/xen/xen-asm_64.S+18−7
@@ -29,10 +29,9 @@ _ASM_NOKPROBE(xen_\name) · 28 unmodified lines
2929 .endm
3030
3131 xen_pv_trap asm_exc_divide_error
32−xen_pv_trap asm_exc_debug
33−xen_pv_trap asm_exc_xendebug
32+xen_pv_trap asm_xenpv_exc_debug
3433 xen_pv_trap asm_exc_int3
35−xen_pv_trap asm_exc_xennmi
34+xen_pv_trap asm_xenpv_exc_nmi
3635 xen_pv_trap asm_exc_overflow
3736 xen_pv_trap asm_exc_bounds
3837 xen_pv_trap asm_exc_invalid_op
@@ -161,10 +160,22 @@ SYM_FUNC_END(xen_syscall32_target) · 122 unmodified lines
161160
162161 /* 32-bit compat sysenter target */
163162 SYM_FUNC_START(xen_sysenter_target)
164− mov 0*8(%rsp), %rcx
165− mov 1*8(%rsp), %r11
166− mov 5*8(%rsp), %rsp
167− jmp entry_SYSENTER_compat
163+ /*
164+ * NB: Xen is polite and clears TF from EFLAGS for us. This means
165+ * that we don't need to guard against single step exceptions here.
166+ */
167+ popq %rcx
168+ popq %r11
169+
170+ /*
171+ * Neither Xen nor the kernel really knows what the old SS and
172+ * CS were. The kernel expects __USER32_DS and __USER32_CS, so
173+ * report those values even though Xen will guess its own values.
174+ */
175+ movq $__USER32_DS, 4*8(%rsp)
176+ movq $__USER32_CS, 1*8(%rsp)
177+
178+ jmp entry_SYSENTER_compat_after_hwframe
168179 SYM_FUNC_END(xen_sysenter_target)
169180
170181 #else /* !CONFIG_IA32_EMULATION */
arch/xtensa/kernel/perf_event.c+1−3
@@ -362,9 +362,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id) · 361 unmodified lines
362362 struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events);
363363 unsigned i;
364364
365− for (i = find_first_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS);
366− i < XCHAL_NUM_PERF_COUNTERS;
367− i = find_next_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS, i + 1)) {
365+ for_each_set_bit(i, ev->used_mask, XCHAL_NUM_PERF_COUNTERS) {
368366 uint32_t v = get_er(XTENSA_PMU_PMSTAT(i));
369367 struct perf_event *event = ev->event[i];
370368 struct hw_perf_event *hwc = &event->hw;
arch/xtensa/kernel/setup.c+2−1
@@ -724,7 +724,8 @@ c_start(struct seq_file *f, loff_t *pos) · 723 unmodified lines
724724 static void *
725725 c_next(struct seq_file *f, void *v, loff_t *pos)
726726 {
727− return NULL;
727+ ++*pos;
728+ return c_start(f, pos);
728729 }
729730
730731 static void
arch/xtensa/kernel/xtensa_ksyms.c+2−2
@@ -87,13 +87,13 @@ void __xtensa_libgcc_window_spill(void) · 86 unmodified lines
8787 }
8888 EXPORT_SYMBOL(__xtensa_libgcc_window_spill);
8989
90−unsigned long __sync_fetch_and_and_4(unsigned long *p, unsigned long v)
90+unsigned int __sync_fetch_and_and_4(volatile void *p, unsigned int v)
9191 {
9292 BUG();
9393 }
9494 EXPORT_SYMBOL(__sync_fetch_and_and_4);
9595
96−unsigned long __sync_fetch_and_or_4(unsigned long *p, unsigned long v)
96+unsigned int __sync_fetch_and_or_4(volatile void *p, unsigned int v)
9797 {
9898 BUG();
9999 }
block/bio-integrity.c+15−9
@@ -24,6 +24,19 @@ void blk_flush_integrity(void) · 23 unmodified lines
2424 flush_workqueue(kintegrityd_wq);
2525 }
2626
27+static void __bio_integrity_free(struct bio_set *bs,
28+ struct bio_integrity_payload *bip)
29+{
30+ if (bs && mempool_initialized(&bs->bio_integrity_pool)) {
31+ if (bip->bip_vec)
32+ bvec_free(&bs->bvec_integrity_pool, bip->bip_vec,
33+ bip->bip_slab);
34+ mempool_free(bip, &bs->bio_integrity_pool);
35+ } else {
36+ kfree(bip);
37+ }
38+}
39+
2740 /**
2841 * bio_integrity_alloc - Allocate integrity payload and attach it to bio
2942 * @bio: bio to attach integrity metadata to
@@ -78,7 +91,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, · 48 unmodified lines
7891
7992 return bip;
8093 err:
81− mempool_free(bip, &bs->bio_integrity_pool);
94+ __bio_integrity_free(bs, bip);
8295 return ERR_PTR(-ENOMEM);
8396 }
8497 EXPORT_SYMBOL(bio_integrity_alloc);
@@ -99,14 +112,7 @@ void bio_integrity_free(struct bio *bio) · 14 unmodified lines
99112 kfree(page_address(bip->bip_vec->bv_page) +
100113 bip->bip_vec->bv_offset);
101114
102− if (bs && mempool_initialized(&bs->bio_integrity_pool)) {
103− bvec_free(&bs->bvec_integrity_pool, bip->bip_vec, bip->bip_slab);
104−
105− mempool_free(bip, &bs->bio_integrity_pool);
106− } else {
107− kfree(bip);
108− }
109−
115+ __bio_integrity_free(bs, bip);
110116 bio->bi_integrity = NULL;
111117 bio->bi_opf &= ~REQ_INTEGRITY;
112118 }
block/blk-mq-debugfs.c+3−0
@@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = { · 124 unmodified lines
125125 QUEUE_FLAG_NAME(REGISTERED),
126126 QUEUE_FLAG_NAME(SCSI_PASSTHROUGH),
127127 QUEUE_FLAG_NAME(QUIESCED),
128+ QUEUE_FLAG_NAME(PCI_P2PDMA),
129+ QUEUE_FLAG_NAME(ZONE_RESETALL),
130+ QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
128131 };
129132 #undef QUEUE_FLAG_NAME
130133
block/blk-mq.c+2−2
@@ -828,10 +828,10 @@ static bool blk_mq_rq_inflight(struct blk_mq_hw_ctx *hctx, struct request *rq, · 827 unmodified lines
828828 void *priv, bool reserved)
829829 {
830830 /*
831− * If we find a request that is inflight and the queue matches,
831+ * If we find a request that isn't idle and the queue matches,
832832 * we know the queue is busy. Return false to stop the iteration.
833833 */
834− if (rq->state == MQ_RQ_IN_FLIGHT && rq->q == hctx->queue) {
834+ if (blk_mq_request_started(rq) && rq->q == hctx->queue) {
835835 bool *busy = priv;
836836
837837 *busy = true;
block/keyslot-manager.c+1−2
@@ -374,8 +374,7 @@ void blk_ksm_destroy(struct blk_keyslot_manager *ksm) · 373 unmodified lines
374374 if (!ksm)
375375 return;
376376 kvfree(ksm->slot_hashtable);
377− memzero_explicit(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
378− kvfree(ksm->slots);
377+ kvfree_sensitive(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
379378 memzero_explicit(ksm, sizeof(*ksm));
380379 }
381380 EXPORT_SYMBOL_GPL(blk_ksm_destroy);
crypto/af_alg.c+11−15
@@ -128,21 +128,15 @@ EXPORT_SYMBOL_GPL(af_alg_release); · 127 unmodified lines
128128 void af_alg_release_parent(struct sock *sk)
129129 {
130130 struct alg_sock *ask = alg_sk(sk);
131− unsigned int nokey = ask->nokey_refcnt;
132− bool last = nokey && !ask->refcnt;
131+ unsigned int nokey = atomic_read(&ask->nokey_refcnt);
133132
134133 sk = ask->parent;
135134 ask = alg_sk(sk);
136135
137− local_bh_disable();
138− bh_lock_sock(sk);
139− ask->nokey_refcnt -= nokey;
140− if (!last)
141− last = !--ask->refcnt;
142− bh_unlock_sock(sk);
143− local_bh_enable();
136+ if (nokey)
137+ atomic_dec(&ask->nokey_refcnt);
144138
145− if (last)
139+ if (atomic_dec_and_test(&ask->refcnt))
146140 sock_put(sk);
147141 }
148142 EXPORT_SYMBOL_GPL(af_alg_release_parent);
@@ -187,7 +181,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) · 38 unmodified lines
187181
188182 err = -EBUSY;
189183 lock_sock(sk);
190− if (ask->refcnt | ask->nokey_refcnt)
184+ if (atomic_read(&ask->refcnt))
191185 goto unlock;
192186
193187 swap(ask->type, type);
@@ -236,7 +230,7 @@ static int alg_setsockopt(struct socket *sock, int level, int optname, · 42 unmodified lines
236230 int err = -EBUSY;
237231
238232 lock_sock(sk);
239− if (ask->refcnt)
233+ if (atomic_read(&ask->refcnt) != atomic_read(&ask->nokey_refcnt))
240234 goto unlock;
241235
242236 type = ask->type;
@@ -301,12 +295,14 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern) · 58 unmodified lines
301295 if (err)
302296 goto unlock;
303297
304− if (nokey || !ask->refcnt++)
298+ if (atomic_inc_return_relaxed(&ask->refcnt) == 1)
305299 sock_hold(sk);
306− ask->nokey_refcnt += nokey;
300+ if (nokey) {
301+ atomic_inc(&ask->nokey_refcnt);
302+ atomic_set(&alg_sk(sk2)->nokey_refcnt, 1);
303+ }
307304 alg_sk(sk2)->parent = sk;
308305 alg_sk(sk2)->type = type;
309− alg_sk(sk2)->nokey_refcnt = nokey;
310306
311307 newsock->ops = type->ops;
312308 newsock->state = SS_CONNECTED;
crypto/algif_aead.c+3−6
@@ -384,7 +384,7 @@ static int aead_check_key(struct socket *sock) · 383 unmodified lines
384384 struct alg_sock *ask = alg_sk(sk);
385385
386386 lock_sock(sk);
387− if (ask->refcnt)
387+ if (!atomic_read(&ask->nokey_refcnt))
388388 goto unlock_child;
389389
390390 psk = ask->parent;
@@ -396,11 +396,8 @@ static int aead_check_key(struct socket *sock) · 5 unmodified lines
396396 if (crypto_aead_get_flags(tfm->aead) & CRYPTO_TFM_NEED_KEY)
397397 goto unlock;
398398
399− if (!pask->refcnt++)
400− sock_hold(psk);
401−
402− ask->refcnt = 1;
403− sock_put(psk);
399+ atomic_dec(&pask->nokey_refcnt);
400+ atomic_set(&ask->nokey_refcnt, 0);
404401
405402 err = 0;
406403
crypto/algif_hash.c+3−6
@@ -301,7 +301,7 @@ static int hash_check_key(struct socket *sock) · 300 unmodified lines
301301 struct alg_sock *ask = alg_sk(sk);
302302
303303 lock_sock(sk);
304− if (ask->refcnt)
304+ if (!atomic_read(&ask->nokey_refcnt))
305305 goto unlock_child;
306306
307307 psk = ask->parent;
@@ -313,11 +313,8 @@ static int hash_check_key(struct socket *sock) · 5 unmodified lines
313313 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
314314 goto unlock;
315315
316− if (!pask->refcnt++)
317− sock_hold(psk);
318−
319− ask->refcnt = 1;
320− sock_put(psk);
316+ atomic_dec(&pask->nokey_refcnt);
317+ atomic_set(&ask->nokey_refcnt, 0);
321318
322319 err = 0;
323320
crypto/algif_skcipher.c+3−6
@@ -211,7 +211,7 @@ static int skcipher_check_key(struct socket *sock) · 210 unmodified lines
211211 struct alg_sock *ask = alg_sk(sk);
212212
213213 lock_sock(sk);
214− if (ask->refcnt)
214+ if (!atomic_read(&ask->nokey_refcnt))
215215 goto unlock_child;
216216
217217 psk = ask->parent;
@@ -223,11 +223,8 @@ static int skcipher_check_key(struct socket *sock) · 5 unmodified lines
223223 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
224224 goto unlock;
225225
226− if (!pask->refcnt++)
227− sock_hold(psk);
228−
229− ask->refcnt = 1;
230− sock_put(psk);
226+ atomic_dec(&pask->nokey_refcnt);
227+ atomic_set(&ask->nokey_refcnt, 0);
231228
232229 err = 0;
233230
crypto/asymmetric_keys/public_key.c+1−0
@@ -119,6 +119,7 @@ static int software_key_query(const struct kernel_pkey_params *params, · 118 unmodified lines
119119 if (IS_ERR(tfm))
120120 return PTR_ERR(tfm);
121121
122+ ret = -ENOMEM;
122123 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen,
123124 GFP_KERNEL);
124125 if (!key)
drivers/acpi/acpi_configfs.c+5−1
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/module.h>
1212 #include <linux/configfs.h>
1313 #include <linux/acpi.h>
14+#include <linux/security.h>
1415
1516 #include "acpica/accommon.h"
1617 #include "acpica/actables.h"
@@ -28,7 +29,10 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg, · 11 unmodified lines
2829 {
2930 const struct acpi_table_header *header = data;
3031 struct acpi_table *table;
31− int ret;
32+ int ret = security_locked_down(LOCKDOWN_ACPI_TABLES);
33+
34+ if (ret)
35+ return ret;
3236
3337 table = container_of(cfg, struct acpi_table, cfg);
3438
drivers/acpi/dptf/dptf_power.c+1−0
@@ -228,6 +228,7 @@ static const struct acpi_device_id int3407_device_ids[] = { · 227 unmodified lines
228228 {"INT3407", 0},
229229 {"INT3532", 0},
230230 {"INTC1047", 0},
231+ {"INTC1050", 0},
231232 {"", 0},
232233 };
233234 MODULE_DEVICE_TABLE(acpi, int3407_device_ids);
drivers/acpi/fan.c+1−1
@@ -25,8 +25,8 @@ static int acpi_fan_remove(struct platform_device *pdev); · 24 unmodified lines
2525
2626 static const struct acpi_device_id fan_device_ids[] = {
2727 {"PNP0C0B", 0},
28− {"INT1044", 0},
2928 {"INT3404", 0},
29+ {"INTC1044", 0},
3030 {"", 0},
3131 };
3232 MODULE_DEVICE_TABLE(acpi, fan_device_ids);
drivers/acpi/sysfs.c+2−2
@@ -938,13 +938,13 @@ static void __exit interrupt_stats_exit(void) · 937 unmodified lines
938938 }
939939
940940 static ssize_t
941−acpi_show_profile(struct device *dev, struct device_attribute *attr,
941+acpi_show_profile(struct kobject *kobj, struct kobj_attribute *attr,
942942 char *buf)
943943 {
944944 return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
945945 }
946946
947−static const struct device_attribute pm_profile_attr =
947+static const struct kobj_attribute pm_profile_attr =
948948 __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);
949949
950950 static ssize_t hotplug_enabled_show(struct kobject *kobj,
drivers/android/binder.c+7−7
@@ -4686,8 +4686,15 @@ static struct binder_thread *binder_get_thread(struct binder_proc *proc) · 4685 unmodified lines
46864686
46874687 static void binder_free_proc(struct binder_proc *proc)
46884688 {
4689+ struct binder_device *device;
4690+
46894691 BUG_ON(!list_empty(&proc->todo));
46904692 BUG_ON(!list_empty(&proc->delivered_death));
4693+ device = container_of(proc->context, struct binder_device, context);
4694+ if (refcount_dec_and_test(&device->ref)) {
4695+ kfree(proc->context->name);
4696+ kfree(device);
4697+ }
46914698 binder_alloc_deferred_release(&proc->alloc);
46924699 put_task_struct(proc->tsk);
46934700 binder_stats_deleted(BINDER_STAT_PROC);
@@ -5406,7 +5413,6 @@ static int binder_node_release(struct binder_node *node, int refs) · 712 unmodified lines
54065413 static void binder_deferred_release(struct binder_proc *proc)
54075414 {
54085415 struct binder_context *context = proc->context;
5409− struct binder_device *device;
54105416 struct rb_node *n;
54115417 int threads, nodes, incoming_refs, outgoing_refs, active_transactions;
54125418
@@ -5423,12 +5429,6 @@ static void binder_deferred_release(struct binder_proc *proc) · 10 unmodified lines
54235429 context->binder_context_mgr_node = NULL;
54245430 }
54255431 mutex_unlock(&context->context_mgr_node_lock);
5426− device = container_of(proc->context, struct binder_device, context);
5427− if (refcount_dec_and_test(&device->ref)) {
5428− kfree(context->name);
5429− kfree(device);
5430− }
5431− proc->context = NULL;
54325432 binder_inner_proc_lock(proc);
54335433 /*
54345434 * Make sure proc stays alive after we
drivers/base/base.h+0−1
@@ -153,7 +153,6 @@ extern char *make_class_name(const char *name, struct kobject *kobj); · 152 unmodified lines
153153 extern int devres_release_all(struct device *dev);
154154 extern void device_block_probing(void);
155155 extern void device_unblock_probing(void);
156−extern void driver_deferred_probe_force_trigger(void);
157156
158157 /* /sys/devices directory */
159158 extern struct kset *devices_kset;
drivers/base/core.c+32−12
@@ -50,6 +50,7 @@ static DEFINE_MUTEX(wfs_lock); · 49 unmodified lines
5050 static LIST_HEAD(deferred_sync);
5151 static unsigned int defer_sync_state_count = 1;
5252 static unsigned int defer_fw_devlink_count;
53+static LIST_HEAD(deferred_fw_devlink);
5354 static DEFINE_MUTEX(defer_fw_devlink_lock);
5455 static bool fw_devlink_is_permissive(void);
5556
@@ -754,11 +755,11 @@ static void __device_links_queue_sync_state(struct device *dev, · 698 unmodified lines
754755 */
755756 dev->state_synced = true;
756757
757− if (WARN_ON(!list_empty(&dev->links.defer_sync)))
758+ if (WARN_ON(!list_empty(&dev->links.defer_hook)))
758759 return;
759760
760761 get_device(dev);
761− list_add_tail(&dev->links.defer_sync, list);
762+ list_add_tail(&dev->links.defer_hook, list);
762763 }
763764
764765 /**
@@ -776,8 +777,8 @@ static void device_links_flush_sync_list(struct list_head *list, · 11 unmodified lines
776777 {
777778 struct device *dev, *tmp;
778779
779− list_for_each_entry_safe(dev, tmp, list, links.defer_sync) {
780− list_del_init(&dev->links.defer_sync);
780+ list_for_each_entry_safe(dev, tmp, list, links.defer_hook) {
781+ list_del_init(&dev->links.defer_hook);
781782
782783 if (dev != dont_lock_dev)
783784 device_lock(dev);
@@ -815,12 +816,12 @@ void device_links_supplier_sync_state_resume(void) · 31 unmodified lines
815816 if (defer_sync_state_count)
816817 goto out;
817818
818− list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_sync) {
819+ list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_hook) {
819820 /*
820821 * Delete from deferred_sync list before queuing it to
821− * sync_list because defer_sync is used for both lists.
822+ * sync_list because defer_hook is used for both lists.
822823 */
823− list_del_init(&dev->links.defer_sync);
824+ list_del_init(&dev->links.defer_hook);
824825 __device_links_queue_sync_state(dev, &sync_list);
825826 }
826827 out:
@@ -838,8 +839,8 @@ late_initcall(sync_state_resume_initcall); · 11 unmodified lines
838839
839840 static void __device_links_supplier_defer_sync(struct device *sup)
840841 {
841− if (list_empty(&sup->links.defer_sync) && dev_has_sync_state(sup))
842− list_add_tail(&sup->links.defer_sync, &deferred_sync);
842+ if (list_empty(&sup->links.defer_hook) && dev_has_sync_state(sup))
843+ list_add_tail(&sup->links.defer_hook, &deferred_sync);
843844 }
844845
845846 static void device_link_drop_managed(struct device_link *link)
@@ -1052,7 +1053,7 @@ void device_links_driver_cleanup(struct device *dev) · 206 unmodified lines
10521053 WRITE_ONCE(link->status, DL_STATE_DORMANT);
10531054 }
10541055
1055− list_del_init(&dev->links.defer_sync);
1056+ list_del_init(&dev->links.defer_hook);
10561057 __device_links_no_driver(dev);
10571058
10581059 device_links_write_unlock();
@@ -1244,6 +1245,12 @@ static void fw_devlink_link_device(struct device *dev) · 185 unmodified lines
12441245 fw_ret = -EAGAIN;
12451246 } else {
12461247 fw_ret = -ENODEV;
1248+ /*
1249+ * defer_hook is not used to add device to deferred_sync list
1250+ * until device is bound. Since deferred fw devlink also blocks
1251+ * probing, same list hook can be used for deferred_fw_devlink.
1252+ */
1253+ list_add_tail(&dev->links.defer_hook, &deferred_fw_devlink);
12471254 }
12481255
12491256 if (fw_ret == -ENODEV)
@@ -1312,6 +1319,9 @@ void fw_devlink_pause(void) · 62 unmodified lines
13121319 */
13131320 void fw_devlink_resume(void)
13141321 {
1322+ struct device *dev, *tmp;
1323+ LIST_HEAD(probe_list);
1324+
13151325 mutex_lock(&defer_fw_devlink_lock);
13161326 if (!defer_fw_devlink_count) {
13171327 WARN(true, "Unmatched fw_devlink pause/resume!");
@@ -1323,9 +1333,19 @@ void fw_devlink_resume(void) · 5 unmodified lines
13231333 goto out;
13241334
13251335 device_link_add_missing_supplier_links();
1326− driver_deferred_probe_force_trigger();
1336+ list_splice_tail_init(&deferred_fw_devlink, &probe_list);
13271337 out:
13281338 mutex_unlock(&defer_fw_devlink_lock);
1339+
1340+ /*
1341+ * bus_probe_device() can cause new devices to get added and they'll
1342+ * try to grab defer_fw_devlink_lock. So, this needs to be done outside
1343+ * the defer_fw_devlink_lock.
1344+ */
1345+ list_for_each_entry_safe(dev, tmp, &probe_list, links.defer_hook) {
1346+ list_del_init(&dev->links.defer_hook);
1347+ bus_probe_device(dev);
1348+ }
13291349 }
13301350 /* Device links support end. */
13311351
@@ -2172,7 +2192,7 @@ void device_initialize(struct device *dev) · 840 unmodified lines
21722192 INIT_LIST_HEAD(&dev->links.consumers);
21732193 INIT_LIST_HEAD(&dev->links.suppliers);
21742194 INIT_LIST_HEAD(&dev->links.needs_suppliers);
2175− INIT_LIST_HEAD(&dev->links.defer_sync);
2195+ INIT_LIST_HEAD(&dev->links.defer_hook);
21762196 dev->links.status = DL_DEV_NO_DRIVER;
21772197 }
21782198 EXPORT_SYMBOL_GPL(device_initialize);
drivers/base/dd.c+0−5
@@ -164,11 +164,6 @@ static void driver_deferred_probe_trigger(void) · 163 unmodified lines
164164 if (!driver_deferred_probe_enable)
165165 return;
166166
167− driver_deferred_probe_force_trigger();
168−}
169−
170−void driver_deferred_probe_force_trigger(void)
171−{
172167 /*
173168 * A successful probe means that all the devices in the pending list
174169 * should be triggered to be reprobed. Move all the deferred devices
drivers/base/power/trace.c+2−2
@@ -265,14 +265,14 @@ static struct notifier_block pm_trace_nb = { · 264 unmodified lines
265265 .notifier_call = pm_trace_notify,
266266 };
267267
268−static int early_resume_init(void)
268+static int __init early_resume_init(void)
269269 {
270270 hash_value_early_read = read_magic_time();
271271 register_pm_notifier(&pm_trace_nb);
272272 return 0;
273273 }
274274
275−static int late_resume_init(void)
275+static int __init late_resume_init(void)
276276 {
277277 unsigned int val = hash_value_early_read;
278278 unsigned int user, file, dev;
drivers/base/regmap/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 # subsystems should select the appropriate symbols.
55
66 config REGMAP
7− default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SCCB || REGMAP_I3C)
7+ default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SCCB || REGMAP_I3C)
88 select IRQ_DOMAIN if REGMAP_IRQ
99 bool
1010
drivers/base/regmap/regmap-debugfs.c+29−23
@@ -463,29 +463,31 @@ static ssize_t regmap_cache_only_write_file(struct file *file, · 462 unmodified lines
463463 {
464464 struct regmap *map = container_of(file->private_data,
465465 struct regmap, cache_only);
466− ssize_t result;
467− bool was_enabled, require_sync = false;
466+ bool new_val, require_sync = false;
468467 int err;
469468
470− map->lock(map->lock_arg);
469+ err = kstrtobool_from_user(user_buf, count, &new_val);
470+ /* Ignore malforned data like debugfs_write_file_bool() */
471+ if (err)
472+ return count;
471473
472− was_enabled = map->cache_only;
474+ err = debugfs_file_get(file->f_path.dentry);
475+ if (err)
476+ return err;
473477
474− result = debugfs_write_file_bool(file, user_buf, count, ppos);
475− if (result < 0) {
476− map->unlock(map->lock_arg);
477− return result;
478− }
478+ map->lock(map->lock_arg);
479479
480− if (map->cache_only && !was_enabled) {
480+ if (new_val && !map->cache_only) {
481481 dev_warn(map->dev, "debugfs cache_only=Y forced\n");
482482 add_taint(TAINT_USER, LOCKDEP_STILL_OK);
483− } else if (!map->cache_only && was_enabled) {
483+ } else if (!new_val && map->cache_only) {
484484 dev_warn(map->dev, "debugfs cache_only=N forced: syncing cache\n");
485485 require_sync = true;
486486 }
487+ map->cache_only = new_val;
487488
488489 map->unlock(map->lock_arg);
490+ debugfs_file_put(file->f_path.dentry);
489491
490492 if (require_sync) {
491493 err = regcache_sync(map);
@@ -493,7 +495,7 @@ static ssize_t regmap_cache_only_write_file(struct file *file, · 1 unmodified line
493495 dev_err(map->dev, "Failed to sync cache %d\n", err);
494496 }
495497
496− return result;
498+ return count;
497499 }
498500
499501 static const struct file_operations regmap_cache_only_fops = {
@@ -508,28 +510,32 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file, · 8 unmodified lines
508510 {
509511 struct regmap *map = container_of(file->private_data,
510512 struct regmap, cache_bypass);
511− ssize_t result;
512− bool was_enabled;
513+ bool new_val;
514+ int err;
513515
514− map->lock(map->lock_arg);
516+ err = kstrtobool_from_user(user_buf, count, &new_val);
517+ /* Ignore malforned data like debugfs_write_file_bool() */
518+ if (err)
519+ return count;
515520
516− was_enabled = map->cache_bypass;
521+ err = debugfs_file_get(file->f_path.dentry);
522+ if (err)
523+ return err;
517524
518− result = debugfs_write_file_bool(file, user_buf, count, ppos);
519− if (result < 0)
520− goto out;
525+ map->lock(map->lock_arg);
521526
522− if (map->cache_bypass && !was_enabled) {
527+ if (new_val && !map->cache_bypass) {
523528 dev_warn(map->dev, "debugfs cache_bypass=Y forced\n");
524529 add_taint(TAINT_USER, LOCKDEP_STILL_OK);
525− } else if (!map->cache_bypass && was_enabled) {
530+ } else if (!new_val && map->cache_bypass) {
526531 dev_warn(map->dev, "debugfs cache_bypass=N forced\n");
527532 }
533+ map->cache_bypass = new_val;
528534
529−out:
530535 map->unlock(map->lock_arg);
536+ debugfs_file_put(file->f_path.dentry);
531537
532− return result;
538+ return count;
533539 }
534540
535541 static const struct file_operations regmap_cache_bypass_fops = {
drivers/base/regmap/regmap.c+51−57
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/delay.h>
1818 #include <linux/log2.h>
1919 #include <linux/hwspinlock.h>
20+#include <asm/unaligned.h>
2021
2122 #define CREATE_TRACE_POINTS
2223 #include "trace.h"
@@ -249,22 +250,20 @@ static void regmap_format_8(void *buf, unsigned int val, unsigned int shift) · 226 unmodified lines
249250
250251 static void regmap_format_16_be(void *buf, unsigned int val, unsigned int shift)
251252 {
252− __be16 *b = buf;
253−
254− b[0] = cpu_to_be16(val << shift);
253+ put_unaligned_be16(val << shift, buf);
255254 }
256255
257256 static void regmap_format_16_le(void *buf, unsigned int val, unsigned int shift)
258257 {
259− __le16 *b = buf;
260−
261− b[0] = cpu_to_le16(val << shift);
258+ put_unaligned_le16(val << shift, buf);
262259 }
263260
264261 static void regmap_format_16_native(void *buf, unsigned int val,
265262 unsigned int shift)
266263 {
267− *(u16 *)buf = val << shift;
264+ u16 v = val << shift;
265+
266+ memcpy(buf, &v, sizeof(v));
268267 }
269268
270269 static void regmap_format_24(void *buf, unsigned int val, unsigned int shift)
@@ -280,43 +279,39 @@ static void regmap_format_24(void *buf, unsigned int val, unsigned int shift) · 9 unmodified lines
280279
281280 static void regmap_format_32_be(void *buf, unsigned int val, unsigned int shift)
282281 {
283− __be32 *b = buf;
284−
285− b[0] = cpu_to_be32(val << shift);
282+ put_unaligned_be32(val << shift, buf);
286283 }
287284
288285 static void regmap_format_32_le(void *buf, unsigned int val, unsigned int shift)
289286 {
290− __le32 *b = buf;
291−
292− b[0] = cpu_to_le32(val << shift);
287+ put_unaligned_le32(val << shift, buf);
293288 }
294289
295290 static void regmap_format_32_native(void *buf, unsigned int val,
296291 unsigned int shift)
297292 {
298− *(u32 *)buf = val << shift;
293+ u32 v = val << shift;
294+
295+ memcpy(buf, &v, sizeof(v));
299296 }
300297
301298 #ifdef CONFIG_64BIT
302299 static void regmap_format_64_be(void *buf, unsigned int val, unsigned int shift)
303300 {
304− __be64 *b = buf;
305−
306− b[0] = cpu_to_be64((u64)val << shift);
301+ put_unaligned_be64((u64) val << shift, buf);
307302 }
308303
309304 static void regmap_format_64_le(void *buf, unsigned int val, unsigned int shift)
310305 {
311− __le64 *b = buf;
312−
313− b[0] = cpu_to_le64((u64)val << shift);
306+ put_unaligned_le64((u64) val << shift, buf);
314307 }
315308
316309 static void regmap_format_64_native(void *buf, unsigned int val,
317310 unsigned int shift)
318311 {
319− *(u64 *)buf = (u64)val << shift;
312+ u64 v = (u64) val << shift;
313+
314+ memcpy(buf, &v, sizeof(v));
320315 }
321316 #endif
322317
@@ -333,35 +328,34 @@ static unsigned int regmap_parse_8(const void *buf) · 10 unmodified lines
333328
334329 static unsigned int regmap_parse_16_be(const void *buf)
335330 {
336− const __be16 *b = buf;
337−
338− return be16_to_cpu(b[0]);
331+ return get_unaligned_be16(buf);
339332 }
340333
341334 static unsigned int regmap_parse_16_le(const void *buf)
342335 {
343− const __le16 *b = buf;
344−
345− return le16_to_cpu(b[0]);
336+ return get_unaligned_le16(buf);
346337 }
347338
348339 static void regmap_parse_16_be_inplace(void *buf)
349340 {
350− __be16 *b = buf;
341+ u16 v = get_unaligned_be16(buf);
351342
352− b[0] = be16_to_cpu(b[0]);
343+ memcpy(buf, &v, sizeof(v));
353344 }
354345
355346 static void regmap_parse_16_le_inplace(void *buf)
356347 {
357− __le16 *b = buf;
348+ u16 v = get_unaligned_le16(buf);
358349
359− b[0] = le16_to_cpu(b[0]);
350+ memcpy(buf, &v, sizeof(v));
360351 }
361352
362353 static unsigned int regmap_parse_16_native(const void *buf)
363354 {
364− return *(u16 *)buf;
355+ u16 v;
356+
357+ memcpy(&v, buf, sizeof(v));
358+ return v;
365359 }
366360
367361 static unsigned int regmap_parse_24(const void *buf)
@@ -376,69 +370,67 @@ static unsigned int regmap_parse_24(const void *buf) · 8 unmodified lines
376370
377371 static unsigned int regmap_parse_32_be(const void *buf)
378372 {
379− const __be32 *b = buf;
380−
381− return be32_to_cpu(b[0]);
373+ return get_unaligned_be32(buf);
382374 }
383375
384376 static unsigned int regmap_parse_32_le(const void *buf)
385377 {
386− const __le32 *b = buf;
387−
388− return le32_to_cpu(b[0]);
378+ return get_unaligned_le32(buf);
389379 }
390380
391381 static void regmap_parse_32_be_inplace(void *buf)
392382 {
393− __be32 *b = buf;
383+ u32 v = get_unaligned_be32(buf);
394384
395− b[0] = be32_to_cpu(b[0]);
385+ memcpy(buf, &v, sizeof(v));
396386 }
397387
398388 static void regmap_parse_32_le_inplace(void *buf)
399389 {
400− __le32 *b = buf;
390+ u32 v = get_unaligned_le32(buf);
401391
402− b[0] = le32_to_cpu(b[0]);
392+ memcpy(buf, &v, sizeof(v));
403393 }
404394
405395 static unsigned int regmap_parse_32_native(const void *buf)
406396 {
407− return *(u32 *)buf;
397+ u32 v;
398+
399+ memcpy(&v, buf, sizeof(v));
400+ return v;
408401 }
409402
410403 #ifdef CONFIG_64BIT
411404 static unsigned int regmap_parse_64_be(const void *buf)
412405 {
413− const __be64 *b = buf;
414−
415− return be64_to_cpu(b[0]);
406+ return get_unaligned_be64(buf);
416407 }
417408
418409 static unsigned int regmap_parse_64_le(const void *buf)
419410 {
420− const __le64 *b = buf;
421−
422− return le64_to_cpu(b[0]);
411+ return get_unaligned_le64(buf);
423412 }
424413
425414 static void regmap_parse_64_be_inplace(void *buf)
426415 {
427− __be64 *b = buf;
416+ u64 v = get_unaligned_be64(buf);
428417
429− b[0] = be64_to_cpu(b[0]);
418+ memcpy(buf, &v, sizeof(v));
430419 }
431420
432421 static void regmap_parse_64_le_inplace(void *buf)
433422 {
434− __le64 *b = buf;
423+ u64 v = get_unaligned_le64(buf);
435424
436− b[0] = le64_to_cpu(b[0]);
425+ memcpy(buf, &v, sizeof(v));
437426 }
438427
439428 static unsigned int regmap_parse_64_native(const void *buf)
440429 {
441− return *(u64 *)buf;
430+ u64 v;
431+
432+ memcpy(&v, buf, sizeof(v));
433+ return v;
442434 }
443435 #endif
444436
@@ -1357,6 +1349,7 @@ void regmap_exit(struct regmap *map) · 912 unmodified lines
13571349 if (map->hwlock)
13581350 hwspin_lock_free(map->hwlock);
13591351 kfree_const(map->name);
1352+ kfree(map->patch);
13601353 kfree(map);
13611354 }
13621355 EXPORT_SYMBOL_GPL(regmap_exit);
@@ -1371,7 +1364,7 @@ static int dev_get_regmap_match(struct device *dev, void *res, void *data) · 8 unmodified lines
13711364
13721365 /* If the user didn't specify a name match any */
13731366 if (data)
1374− return (*r)->name == data;
1367+ return !strcmp((*r)->name, data);
13751368 else
13761369 return 1;
13771370 }
@@ -2944,8 +2937,9 @@ EXPORT_SYMBOL_GPL(regmap_update_bits_base); · 1566 unmodified lines
29442937 * @reg: Register to read from
29452938 * @bits: Bits to test
29462939 *
2947− * Returns -1 if the underlying regmap_read() fails, 0 if at least one of the
2948− * tested bits is not set and 1 if all tested bits are set.
2940+ * Returns 0 if at least one of the tested bits is not set, 1 if all tested
2941+ * bits are set and a negative error number if the underlying regmap_read()
2942+ * fails.
29492943 */
29502944 int regmap_test_bits(struct regmap *map, unsigned int reg, unsigned int bits)
29512945 {
drivers/block/nbd.c+15−10
@@ -1033,25 +1033,26 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, · 1032 unmodified lines
10331033 test_bit(NBD_RT_BOUND, &config->runtime_flags))) {
10341034 dev_err(disk_to_dev(nbd->disk),
10351035 "Device being setup by another task");
1036− sockfd_put(sock);
1037− return -EBUSY;
1036+ err = -EBUSY;
1037+ goto put_socket;
1038+ }
1039+
1040+ nsock = kzalloc(sizeof(*nsock), GFP_KERNEL);
1041+ if (!nsock) {
1042+ err = -ENOMEM;
1043+ goto put_socket;
10381044 }
10391045
10401046 socks = krealloc(config->socks, (config->num_connections + 1) *
10411047 sizeof(struct nbd_sock *), GFP_KERNEL);
10421048 if (!socks) {
1043− sockfd_put(sock);
1044− return -ENOMEM;
1049+ kfree(nsock);
1050+ err = -ENOMEM;
1051+ goto put_socket;
10451052 }
10461053
10471054 config->socks = socks;
10481055
1049− nsock = kzalloc(sizeof(struct nbd_sock), GFP_KERNEL);
1050− if (!nsock) {
1051− sockfd_put(sock);
1052− return -ENOMEM;
1053− }
1054−
10551056 nsock->fallback_index = -1;
10561057 nsock->dead = false;
10571058 mutex_init(&nsock->tx_lock);
@@ -1063,6 +1064,10 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, · 5 unmodified lines
10631064 atomic_inc(&config->live_connections);
10641065
10651066 return 0;
1067+
1068+put_socket:
1069+ sockfd_put(sock);
1070+ return err;
10661071 }
10671072
10681073 static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
drivers/block/virtio_blk.c+1−0
@@ -878,6 +878,7 @@ out_put_disk: · 877 unmodified lines
878878 put_disk(vblk->disk);
879879 out_free_vq:
880880 vdev->config->del_vqs(vdev);
881+ kfree(vblk->vqs);
881882 out_free_vblk:
882883 kfree(vblk);
883884 out_free_index:
drivers/block/zram/zram_drv.c+2−1
@@ -2021,7 +2021,8 @@ static ssize_t hot_add_show(struct class *class, · 2020 unmodified lines
20212021 return ret;
20222022 return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
20232023 }
2024−static CLASS_ATTR_RO(hot_add);
2024+static struct class_attribute class_attr_hot_add =
2025+ __ATTR(hot_add, 0400, hot_add_show, NULL);
20252026
20262027 static ssize_t hot_remove_store(struct class *class,
20272028 struct class_attribute *attr,
drivers/bus/ti-sysc.c+79−28
@@ -221,6 +221,34 @@ static u32 sysc_read_sysstatus(struct sysc *ddata) · 220 unmodified lines
221221 return sysc_read(ddata, offset);
222222 }
223223
224+/* Poll on reset status */
225+static int sysc_wait_softreset(struct sysc *ddata)
226+{
227+ u32 sysc_mask, syss_done, rstval;
228+ int syss_offset, error = 0;
229+
230+ syss_offset = ddata->offsets[SYSC_SYSSTATUS];
231+ sysc_mask = BIT(ddata->cap->regbits->srst_shift);
232+
233+ if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED)
234+ syss_done = 0;
235+ else
236+ syss_done = ddata->cfg.syss_mask;
237+
238+ if (syss_offset >= 0) {
239+ error = readx_poll_timeout_atomic(sysc_read_sysstatus, ddata,
240+ rstval, (rstval & ddata->cfg.syss_mask) ==
241+ syss_done, 100, MAX_MODULE_SOFTRESET_WAIT);
242+
243+ } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) {
244+ error = readx_poll_timeout_atomic(sysc_read_sysconfig, ddata,
245+ rstval, !(rstval & sysc_mask),
246+ 100, MAX_MODULE_SOFTRESET_WAIT);
247+ }
248+
249+ return error;
250+}
251+
224252 static int sysc_add_named_clock_from_child(struct sysc *ddata,
225253 const char *name,
226254 const char *optfck_name)
@@ -925,18 +953,47 @@ static int sysc_enable_module(struct device *dev) · 698 unmodified lines
925953 struct sysc *ddata;
926954 const struct sysc_regbits *regbits;
927955 u32 reg, idlemodes, best_mode;
956+ int error;
928957
929958 ddata = dev_get_drvdata(dev);
959+
960+ /*
961+ * Some modules like DSS reset automatically on idle. Enable optional
962+ * reset clocks and wait for OCP softreset to complete.
963+ */
964+ if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) {
965+ error = sysc_enable_opt_clocks(ddata);
966+ if (error) {
967+ dev_err(ddata->dev,
968+ "Optional clocks failed for enable: %i\n",
969+ error);
970+ return error;
971+ }
972+ }
973+ error = sysc_wait_softreset(ddata);
974+ if (error)
975+ dev_warn(ddata->dev, "OCP softreset timed out\n");
976+ if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET)
977+ sysc_disable_opt_clocks(ddata);
978+
979+ /*
980+ * Some subsystem private interconnects, like DSS top level module,
981+ * need only the automatic OCP softreset handling with no sysconfig
982+ * register bits to configure.
983+ */
930984 if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV)
931985 return 0;
932986
933987 regbits = ddata->cap->regbits;
934988 reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
935989
936− /* Set CLOCKACTIVITY, we only use it for ick */
990+ /*
991+ * Set CLOCKACTIVITY, we only use it for ick. And we only configure it
992+ * based on the SYSC_QUIRK_USE_CLOCKACT flag, not based on the hardware
993+ * capabilities. See the old HWMOD_SET_DEFAULT_CLOCKACT flag.
994+ */
937995 if (regbits->clkact_shift >= 0 &&
938− (ddata->cfg.quirks & SYSC_QUIRK_USE_CLOCKACT ||
939− ddata->cfg.sysc_val & BIT(regbits->clkact_shift)))
996+ (ddata->cfg.quirks & SYSC_QUIRK_USE_CLOCKACT))
940997 reg |= SYSC_CLOCACT_ICK << regbits->clkact_shift;
941998
942999 /* Set SIDLE mode */
@@ -991,6 +1048,9 @@ set_autoidle: · 48 unmodified lines
9911048 sysc_write_sysconfig(ddata, reg);
9921049 }
9931050
1051+ /* Flush posted write */
1052+ sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
1053+
9941054 if (ddata->module_enable_quirk)
9951055 ddata->module_enable_quirk(ddata);
9961056
@@ -1071,6 +1131,9 @@ set_sidle: · 74 unmodified lines
10711131 reg |= 1 << regbits->autoidle_shift;
10721132 sysc_write_sysconfig(ddata, reg);
10731133
1134+ /* Flush posted write */
1135+ sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
1136+
10741137 return 0;
10751138 }
10761139
@@ -1215,7 +1278,8 @@ static int __maybe_unused sysc_noirq_suspend(struct device *dev) · 138 unmodified lines
12151278
12161279 ddata = dev_get_drvdata(dev);
12171280
1218− if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE)
1281+ if (ddata->cfg.quirks &
1282+ (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
12191283 return 0;
12201284
12211285 return pm_runtime_force_suspend(dev);
@@ -1227,7 +1291,8 @@ static int __maybe_unused sysc_noirq_resume(struct device *dev) · 5 unmodified lines
12271291
12281292 ddata = dev_get_drvdata(dev);
12291293
1230− if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE)
1294+ if (ddata->cfg.quirks &
1295+ (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
12311296 return 0;
12321297
12331298 return pm_runtime_force_resume(dev);
@@ -1488,7 +1553,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, · 254 unmodified lines
14881553 bool lcd_en, digit_en, lcd2_en = false, lcd3_en = false;
14891554 const int lcd_en_mask = BIT(0), digit_en_mask = BIT(1);
14901555 int manager_count;
1491− bool framedonetv_irq;
1556+ bool framedonetv_irq = true;
14921557 u32 val, irq_mask = 0;
14931558
14941559 switch (sysc_soc->soc) {
@@ -1505,6 +1570,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, · 10 unmodified lines
15051570 break;
15061571 case SOC_AM4:
15071572 manager_count = 1;
1573+ framedonetv_irq = false;
15081574 break;
15091575 case SOC_UNKNOWN:
15101576 default:
@@ -1663,8 +1729,8 @@ static void sysc_quirk_rtc(struct sysc *ddata, bool lock) · 152 unmodified lines
16631729
16641730 local_irq_save(flags);
16651731 /* RTC_STATUS BUSY bit may stay active for 1/32768 seconds (~30 usec) */
1666− error = readl_poll_timeout(ddata->module_va + 0x44, val,
1667− !(val & BIT(0)), 100, 50);
1732+ error = readl_poll_timeout_atomic(ddata->module_va + 0x44, val,
1733+ !(val & BIT(0)), 100, 50);
16681734 if (error)
16691735 dev_warn(ddata->dev, "rtc busy timeout\n");
16701736 /* Now we have ~15 microseconds to read/write various registers */
@@ -1822,11 +1888,10 @@ static int sysc_legacy_init(struct sysc *ddata) · 151 unmodified lines
18221888 */
18231889 static int sysc_reset(struct sysc *ddata)
18241890 {
1825− int sysc_offset, syss_offset, sysc_val, rstval, error = 0;
1826− u32 sysc_mask, syss_done;
1891+ int sysc_offset, sysc_val, error;
1892+ u32 sysc_mask;
18271893
18281894 sysc_offset = ddata->offsets[SYSC_SYSCONFIG];
1829− syss_offset = ddata->offsets[SYSC_SYSSTATUS];
18301895
18311896 if (ddata->legacy_mode ||
18321897 ddata->cap->regbits->srst_shift < 0 ||
@@ -1835,11 +1900,6 @@ static int sysc_reset(struct sysc *ddata) · 2 unmodified lines
18351900
18361901 sysc_mask = BIT(ddata->cap->regbits->srst_shift);
18371902
1838− if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED)
1839− syss_done = 0;
1840− else
1841− syss_done = ddata->cfg.syss_mask;
1842−
18431903 if (ddata->pre_reset_quirk)
18441904 ddata->pre_reset_quirk(ddata);
18451905
@@ -1856,18 +1916,9 @@ static int sysc_reset(struct sysc *ddata) · 10 unmodified lines
18561916 if (ddata->post_reset_quirk)
18571917 ddata->post_reset_quirk(ddata);
18581918
1859− /* Poll on reset status */
1860− if (syss_offset >= 0) {
1861− error = readx_poll_timeout(sysc_read_sysstatus, ddata, rstval,
1862− (rstval & ddata->cfg.syss_mask) ==
1863− syss_done,
1864− 100, MAX_MODULE_SOFTRESET_WAIT);
1865−
1866− } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) {
1867− error = readx_poll_timeout(sysc_read_sysconfig, ddata, rstval,
1868− !(rstval & sysc_mask),
1869− 100, MAX_MODULE_SOFTRESET_WAIT);
1870− }
1919+ error = sysc_wait_softreset(ddata);
1920+ if (error)
1921+ dev_warn(ddata->dev, "OCP softreset timed out\n");
18711922
18721923 if (ddata->reset_done_quirk)
18731924 ddata->reset_done_quirk(ddata);
drivers/char/tpm/st33zp24/i2c.c+1−1
@@ -210,7 +210,7 @@ static int st33zp24_i2c_request_resources(struct i2c_client *client) · 209 unmodified lines
210210
211211 /*
212212 * st33zp24_i2c_probe initialize the TPM device
213− * @param: client, the i2c_client drescription (TPM I2C description).
213+ * @param: client, the i2c_client description (TPM I2C description).
214214 * @param: id, the i2c_device_id struct.
215215 * @return: 0 in case of success.
216216 * -1 in other case.
drivers/char/tpm/st33zp24/spi.c+2−2
@@ -329,7 +329,7 @@ static int st33zp24_spi_request_resources(struct spi_device *dev) · 328 unmodified lines
329329
330330 /*
331331 * st33zp24_spi_probe initialize the TPM device
332− * @param: dev, the spi_device drescription (TPM SPI description).
332+ * @param: dev, the spi_device description (TPM SPI description).
333333 * @return: 0 in case of success.
334334 * or a negative value describing the error.
335335 */
@@ -378,7 +378,7 @@ static int st33zp24_spi_probe(struct spi_device *dev) · 42 unmodified lines
378378
379379 /*
380380 * st33zp24_spi_remove remove the TPM device
381− * @param: client, the spi_device drescription (TPM SPI description).
381+ * @param: client, the spi_device description (TPM SPI description).
382382 * @return: 0 in case of success.
383383 */
384384 static int st33zp24_spi_remove(struct spi_device *dev)
drivers/char/tpm/st33zp24/st33zp24.c+1−1
@@ -502,7 +502,7 @@ static const struct tpm_class_ops st33zp24_tpm = { · 501 unmodified lines
502502
503503 /*
504504 * st33zp24_probe initialize the TPM device
505− * @param: client, the i2c_client drescription (TPM I2C description).
505+ * @param: client, the i2c_client description (TPM I2C description).
506506 * @param: id, the i2c_device_id struct.
507507 * @return: 0 in case of success.
508508 * -1 in other case.
drivers/char/tpm/tpm-dev-common.c+9−10
@@ -189,15 +189,6 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf, · 188 unmodified lines
189189 goto out;
190190 }
191191
192− /* atomic tpm command send and result receive. We only hold the ops
193− * lock during this period so that the tpm can be unregistered even if
194− * the char dev is held open.
195− */
196− if (tpm_try_get_ops(priv->chip)) {
197− ret = -EPIPE;
198− goto out;
199− }
200−
201192 priv->response_length = 0;
202193 priv->response_read = false;
203194 *off = 0;
@@ -211,11 +202,19 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf, · 7 unmodified lines
211202 if (file->f_flags & O_NONBLOCK) {
212203 priv->command_enqueued = true;
213204 queue_work(tpm_dev_wq, &priv->async_work);
214− tpm_put_ops(priv->chip);
215205 mutex_unlock(&priv->buffer_mutex);
216206 return size;
217207 }
218208
209+ /* atomic tpm command send and result receive. We only hold the ops
210+ * lock during this period so that the tpm can be unregistered even if
211+ * the char dev is held open.
212+ */
213+ if (tpm_try_get_ops(priv->chip)) {
214+ ret = -EPIPE;
215+ goto out;
216+ }
217+
219218 ret = tpm_dev_transmit(priv->chip, priv->space, priv->data_buffer,
220219 sizeof(priv->data_buffer));
221220 tpm_put_ops(priv->chip);
drivers/char/tpm/tpm_ibmvtpm.c+7−7
@@ -683,13 +683,6 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, · 682 unmodified lines
683683 if (rc)
684684 goto init_irq_cleanup;
685685
686− if (!strcmp(id->compat, "IBM,vtpm20")) {
687− chip->flags |= TPM_CHIP_FLAG_TPM2;
688− rc = tpm2_get_cc_attrs_tbl(chip);
689− if (rc)
690− goto init_irq_cleanup;
691− }
692−
693686 if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
694687 ibmvtpm->rtce_buf != NULL,
695688 HZ)) {
@@ -697,6 +690,13 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, · 1 unmodified line
697690 goto init_irq_cleanup;
698691 }
699692
693+ if (!strcmp(id->compat, "IBM,vtpm20")) {
694+ chip->flags |= TPM_CHIP_FLAG_TPM2;
695+ rc = tpm2_get_cc_attrs_tbl(chip);
696+ if (rc)
697+ goto init_irq_cleanup;
698+ }
699+
700700 return tpm_chip_register(chip);
701701 init_irq_cleanup:
702702 do {
drivers/char/tpm/tpm_tis.c+7−0
@@ -235,6 +235,13 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev, · 234 unmodified lines
235235 return tpm_tis_init(&pnp_dev->dev, &tpm_info);
236236 }
237237
238+/*
239+ * There is a known bug caused by 93e1b7d42e1e ("[PATCH] tpm: add HID module
240+ * parameter"). This commit added IFX0102 device ID, which is also used by
241+ * tpm_infineon but ignored to add quirks to probe which driver ought to be
242+ * used.
243+ */
244+
238245 static struct pnp_device_id tpm_pnp_tbl[] = {
239246 {"PNP0C31", 0}, /* TPM */
240247 {"ATM1200", 0}, /* Atmel */
drivers/char/tpm/tpm_tis_core.c+1−1
@@ -1085,7 +1085,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, · 1084 unmodified lines
10851085
10861086 return 0;
10871087 out_err:
1088− if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
1088+ if (chip->ops->clk_enable != NULL)
10891089 chip->ops->clk_enable(chip, false);
10901090
10911091 tpm_tis_remove(chip);
drivers/char/tpm/tpm_tis_spi_main.c+5−5
@@ -53,8 +53,6 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy, · 52 unmodified lines
5353
5454 if ((phy->iobuf[3] & 0x01) == 0) {
5555 // handle SPI wait states
56− phy->iobuf[0] = 0;
57−
5856 for (i = 0; i < TPM_RETRY; i++) {
5957 spi_xfer->len = 1;
6058 spi_message_init(&m);
@@ -104,6 +102,8 @@ int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len, · 43 unmodified lines
104102 if (ret < 0)
105103 goto exit;
106104
105+ /* Flow control transfers are receive only */
106+ spi_xfer.tx_buf = NULL;
107107 ret = phy->flow_control(phy, &spi_xfer);
108108 if (ret < 0)
109109 goto exit;
@@ -113,9 +113,8 @@ int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len, · 3 unmodified lines
113113 spi_xfer.delay.value = 5;
114114 spi_xfer.delay.unit = SPI_DELAY_UNIT_USECS;
115115
116− if (in) {
117− spi_xfer.tx_buf = NULL;
118− } else if (out) {
116+ if (out) {
117+ spi_xfer.tx_buf = phy->iobuf;
119118 spi_xfer.rx_buf = NULL;
120119 memcpy(phy->iobuf, out, transfer_len);
121120 out += transfer_len;
@@ -288,6 +287,7 @@ static struct spi_driver tpm_tis_spi_driver = { · 166 unmodified lines
288287 .pm = &tpm_tis_pm,
289288 .of_match_table = of_match_ptr(of_tis_spi_match),
290289 .acpi_match_table = ACPI_PTR(acpi_tis_spi_match),
290+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
291291 },
292292 .probe = tpm_tis_spi_driver_probe,
293293 .remove = tpm_tis_spi_remove,
drivers/char/virtio_console.c+2−1
@@ -2116,6 +2116,7 @@ static struct virtio_device_id id_table[] = { · 2115 unmodified lines
21162116 { VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID },
21172117 { 0 },
21182118 };
2119+MODULE_DEVICE_TABLE(virtio, id_table);
21192120
21202121 static unsigned int features[] = {
21212122 VIRTIO_CONSOLE_F_SIZE,
@@ -2128,6 +2129,7 @@ static struct virtio_device_id rproc_serial_id_table[] = { · 6 unmodified lines
21282129 #endif
21292130 { 0 },
21302131 };
2132+MODULE_DEVICE_TABLE(virtio, rproc_serial_id_table);
21312133
21322134 static unsigned int rproc_serial_features[] = {
21332135 };
@@ -2280,6 +2282,5 @@ static void __exit fini(void) · 146 unmodified lines
22802282 module_init(init);
22812283 module_exit(fini);
22822284
2283−MODULE_DEVICE_TABLE(virtio, id_table);
22842285 MODULE_DESCRIPTION("Virtio console driver");
22852286 MODULE_LICENSE("GPL");
drivers/clk/Kconfig+1−0
@@ -50,6 +50,7 @@ source "drivers/clk/versatile/Kconfig" · 49 unmodified lines
5050 config CLK_HSDK
5151 bool "PLL Driver for HSDK platform"
5252 depends on OF || COMPILE_TEST
53+ depends on IOMEM
5354 help
5455 This driver supports the HSDK core, system, ddr, tunnel and hdmi PLLs
5556 control.
drivers/clk/clk-ast2600.c+41−8
@@ -131,6 +131,18 @@ static const struct clk_div_table ast2600_eclk_div_table[] = { · 130 unmodified lines
131131 { 0 }
132132 };
133133
134+static const struct clk_div_table ast2600_emmc_extclk_div_table[] = {
135+ { 0x0, 2 },
136+ { 0x1, 4 },
137+ { 0x2, 6 },
138+ { 0x3, 8 },
139+ { 0x4, 10 },
140+ { 0x5, 12 },
141+ { 0x6, 14 },
142+ { 0x7, 16 },
143+ { 0 }
144+};
145+
134146 static const struct clk_div_table ast2600_mac_div_table[] = {
135147 { 0x0, 4 },
136148 { 0x1, 4 },
@@ -390,6 +402,11 @@ static struct clk_hw *aspeed_g6_clk_hw_register_gate(struct device *dev, · 253 unmodified lines
390402 return hw;
391403 }
392404
405+static const char *const emmc_extclk_parent_names[] = {
406+ "emmc_extclk_hpll_in",
407+ "mpll",
408+};
409+
393410 static const char * const vclk_parent_names[] = {
394411 "dpll",
395412 "d1pll",
@@ -459,16 +476,32 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev) · 63 unmodified lines
459476 return PTR_ERR(hw);
460477 aspeed_g6_clk_data->hws[ASPEED_CLK_UARTX] = hw;
461478
462− /* EMMC ext clock divider */
463− hw = clk_hw_register_gate(dev, "emmc_extclk_gate", "hpll", 0,
464− scu_g6_base + ASPEED_G6_CLK_SELECTION1, 15, 0,
465− &aspeed_g6_clk_lock);
479+ /* EMMC ext clock */
480+ hw = clk_hw_register_fixed_factor(dev, "emmc_extclk_hpll_in", "hpll",
481+ 0, 1, 2);
466482 if (IS_ERR(hw))
467483 return PTR_ERR(hw);
468− hw = clk_hw_register_divider_table(dev, "emmc_extclk", "emmc_extclk_gate", 0,
469− scu_g6_base + ASPEED_G6_CLK_SELECTION1, 12, 3, 0,
470− ast2600_div_table,
471− &aspeed_g6_clk_lock);
484+
485+ hw = clk_hw_register_mux(dev, "emmc_extclk_mux",
486+ emmc_extclk_parent_names,
487+ ARRAY_SIZE(emmc_extclk_parent_names), 0,
488+ scu_g6_base + ASPEED_G6_CLK_SELECTION1, 11, 1,
489+ 0, &aspeed_g6_clk_lock);
490+ if (IS_ERR(hw))
491+ return PTR_ERR(hw);
492+
493+ hw = clk_hw_register_gate(dev, "emmc_extclk_gate", "emmc_extclk_mux",
494+ 0, scu_g6_base + ASPEED_G6_CLK_SELECTION1,
495+ 15, 0, &aspeed_g6_clk_lock);
496+ if (IS_ERR(hw))
497+ return PTR_ERR(hw);
498+
499+ hw = clk_hw_register_divider_table(dev, "emmc_extclk",
500+ "emmc_extclk_gate", 0,
501+ scu_g6_base +
502+ ASPEED_G6_CLK_SELECTION1, 12,
503+ 3, 0, ast2600_emmc_extclk_div_table,
504+ &aspeed_g6_clk_lock);
472505 if (IS_ERR(hw))
473506 return PTR_ERR(hw);
474507 aspeed_g6_clk_data->hws[ASPEED_CLK_EMMC] = hw;
drivers/clk/mvebu/Kconfig+1−0
@@ -42,6 +42,7 @@ config ARMADA_AP806_SYSCON · 41 unmodified lines
4242
4343 config ARMADA_AP_CPU_CLK
4444 bool
45+ select ARMADA_AP_CP_HELPER
4546
4647 config ARMADA_CP110_SYSCON
4748 bool
drivers/clk/sifive/fu540-prci.c+4−1
@@ -586,7 +586,10 @@ static int sifive_fu540_prci_probe(struct platform_device *pdev) · 585 unmodified lines
586586 struct __prci_data *pd;
587587 int r;
588588
589− pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
589+ pd = devm_kzalloc(dev,
590+ struct_size(pd, hw_clks.hws,
591+ ARRAY_SIZE(__prci_init_clocks)),
592+ GFP_KERNEL);
590593 if (!pd)
591594 return -ENOMEM;
592595
drivers/clocksource/arm_arch_timer.c+11−0
@@ -480,6 +480,14 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = { · 479 unmodified lines
480480 .set_next_event_virt = erratum_set_next_event_tval_virt,
481481 },
482482 #endif
483+#ifdef CONFIG_ARM64_ERRATUM_1418040
484+ {
485+ .match_type = ate_match_local_cap_id,
486+ .id = (void *)ARM64_WORKAROUND_1418040,
487+ .desc = "ARM erratum 1418040",
488+ .disable_compat_vdso = true,
489+ },
490+#endif
483491 };
484492
485493 typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *,
@@ -566,6 +574,9 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa · 80 unmodified lines
566574 if (wa->read_cntvct_el0) {
567575 clocksource_counter.vdso_clock_mode = VDSO_CLOCKMODE_NONE;
568576 vdso_default = VDSO_CLOCKMODE_NONE;
577+ } else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) {
578+ vdso_default = VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT;
579+ clocksource_counter.vdso_clock_mode = vdso_default;
569580 }
570581 }
571582
drivers/counter/104-quad-8.c+19−3
@@ -1274,18 +1274,26 @@ static ssize_t quad8_signal_cable_fault_read(struct counter_device *counter, · 1273 unmodified lines
12741274 struct counter_signal *signal,
12751275 void *private, char *buf)
12761276 {
1277− const struct quad8_iio *const priv = counter->priv;
1277+ struct quad8_iio *const priv = counter->priv;
12781278 const size_t channel_id = signal->id / 2;
1279− const bool disabled = !(priv->cable_fault_enable & BIT(channel_id));
1279+ bool disabled;
12801280 unsigned int status;
12811281 unsigned int fault;
12821282
1283− if (disabled)
1283+ mutex_lock(&priv->lock);
1284+
1285+ disabled = !(priv->cable_fault_enable & BIT(channel_id));
1286+
1287+ if (disabled) {
1288+ mutex_unlock(&priv->lock);
12841289 return -EINVAL;
1290+ }
12851291
12861292 /* Logic 0 = cable fault */
12871293 status = inb(priv->base + QUAD8_DIFF_ENCODER_CABLE_STATUS);
12881294
1295+ mutex_unlock(&priv->lock);
1296+
12891297 /* Mask respective channel and invert logic */
12901298 fault = !(status & BIT(channel_id));
12911299
@@ -1317,6 +1325,8 @@ static ssize_t quad8_signal_cable_fault_enable_write( · 25 unmodified lines
13171325 if (ret)
13181326 return ret;
13191327
1328+ mutex_lock(&priv->lock);
1329+
13201330 if (enable)
13211331 priv->cable_fault_enable |= BIT(channel_id);
13221332 else
@@ -1327,6 +1337,8 @@ static ssize_t quad8_signal_cable_fault_enable_write( · 4 unmodified lines
13271337
13281338 outb(cable_fault_enable, priv->base + QUAD8_DIFF_ENCODER_CABLE_STATUS);
13291339
1340+ mutex_unlock(&priv->lock);
1341+
13301342 return len;
13311343 }
13321344
@@ -1353,6 +1365,8 @@ static ssize_t quad8_signal_fck_prescaler_write(struct counter_device *counter, · 20 unmodified lines
13531365 if (ret)
13541366 return ret;
13551367
1368+ mutex_lock(&priv->lock);
1369+
13561370 priv->fck_prescaler[channel_id] = prescaler;
13571371
13581372 /* Reset Byte Pointer */
@@ -1363,6 +1377,8 @@ static ssize_t quad8_signal_fck_prescaler_write(struct counter_device *counter, · 4 unmodified lines
13631377 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP | QUAD8_RLD_PRESET_PSC,
13641378 base_offset + 1);
13651379
1380+ mutex_unlock(&priv->lock);
1381+
13661382 return len;
13671383 }
13681384
drivers/cpufreq/intel_pstate.c+11−4
@@ -2464,7 +2464,7 @@ static struct cpufreq_driver intel_cpufreq = { · 2463 unmodified lines
24642464 .name = "intel_cpufreq",
24652465 };
24662466
2467−static struct cpufreq_driver *default_driver = &intel_pstate;
2467+static struct cpufreq_driver *default_driver;
24682468
24692469 static void intel_pstate_driver_cleanup(void)
24702470 {
@@ -2677,6 +2677,8 @@ static struct acpi_platform_list plat_info[] __initdata = { · 206 unmodified lines
26772677 { } /* End */
26782678 };
26792679
2680+#define BITMASK_OOB (BIT(8) | BIT(18))
2681+
26802682 static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
26812683 {
26822684 const struct x86_cpu_id *id;
@@ -2686,8 +2688,9 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void) · 3 unmodified lines
26862688 id = x86_match_cpu(intel_pstate_cpu_oob_ids);
26872689 if (id) {
26882690 rdmsrl(MSR_MISC_PWR_MGMT, misc_pwr);
2689− if (misc_pwr & (1 << 8)) {
2690− pr_debug("Bit 8 in the MISC_PWR_MGMT MSR set\n");
2691+ if (misc_pwr & BITMASK_OOB) {
2692+ pr_debug("Bit 8 or 18 in the MISC_PWR_MGMT MSR set\n");
2693+ pr_debug("P states are controlled in Out of Band mode by the firmware/hardware\n");
26912694 return true;
26922695 }
26932696 }
@@ -2755,6 +2758,7 @@ static int __init intel_pstate_init(void) · 61 unmodified lines
27552758 hwp_active++;
27562759 hwp_mode_bdw = id->driver_data;
27572760 intel_pstate.attr = hwp_cpufreq_attrs;
2761+ default_driver = &intel_pstate;
27582762 goto hwp_cpu_matched;
27592763 }
27602764 } else {
@@ -2772,7 +2776,8 @@ static int __init intel_pstate_init(void) · 11 unmodified lines
27722776 return -ENODEV;
27732777 }
27742778 /* Without HWP start in the passive mode. */
2775− default_driver = &intel_cpufreq;
2779+ if (!default_driver)
2780+ default_driver = &intel_cpufreq;
27762781
27772782 hwp_cpu_matched:
27782783 /*
@@ -2817,6 +2822,8 @@ static int __init intel_pstate_setup(char *str) · 38 unmodified lines
28172822
28182823 if (!strcmp(str, "disable")) {
28192824 no_load = 1;
2825+ } else if (!strcmp(str, "active")) {
2826+ default_driver = &intel_pstate;
28202827 } else if (!strcmp(str, "passive")) {
28212828 default_driver = &intel_cpufreq;
28222829 no_hwp = 1;
drivers/cpuidle/cpuidle.c+3−2
@@ -186,9 +186,10 @@ int cpuidle_enter_s2idle(struct cpuidle_driver *drv, struct cpuidle_device *dev) · 185 unmodified lines
186186 * be frozen safely.
187187 */
188188 index = find_deepest_state(drv, dev, U64_MAX, 0, true);
189− if (index > 0)
189+ if (index > 0) {
190190 enter_s2idle_proper(drv, dev, index);
191−
191+ local_irq_enable();
192+ }
192193 return index;
193194 }
194195 #endif /* CONFIG_SUSPEND */
drivers/dma-buf/dma-buf.c+32−33
@@ -45,46 +45,20 @@ static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen) · 44 unmodified lines
4545 size_t ret = 0;
4646
4747 dmabuf = dentry->d_fsdata;
48− dma_resv_lock(dmabuf->resv, NULL);
48+ spin_lock(&dmabuf->name_lock);
4949 if (dmabuf->name)
5050 ret = strlcpy(name, dmabuf->name, DMA_BUF_NAME_LEN);
51− dma_resv_unlock(dmabuf->resv);
51+ spin_unlock(&dmabuf->name_lock);
5252
5353 return dynamic_dname(dentry, buffer, buflen, "/%s:%s",
5454 dentry->d_name.name, ret > 0 ? name : "");
5555 }
5656
57−static const struct dentry_operations dma_buf_dentry_ops = {
58− .d_dname = dmabuffs_dname,
59−};
60−
61−static struct vfsmount *dma_buf_mnt;
62−
63−static int dma_buf_fs_init_context(struct fs_context *fc)
64−{
65− struct pseudo_fs_context *ctx;
66−
67− ctx = init_pseudo(fc, DMA_BUF_MAGIC);
68− if (!ctx)
69− return -ENOMEM;
70− ctx->dops = &dma_buf_dentry_ops;
71− return 0;
72−}
73−
74−static struct file_system_type dma_buf_fs_type = {
75− .name = "dmabuf",
76− .init_fs_context = dma_buf_fs_init_context,
77− .kill_sb = kill_anon_super,
78−};
79−
80−static int dma_buf_release(struct inode *inode, struct file *file)
57+static void dma_buf_release(struct dentry *dentry)
8158 {
8259 struct dma_buf *dmabuf;
8360
84− if (!is_dma_buf_file(file))
85− return -EINVAL;
86−
87− dmabuf = file->private_data;
61+ dmabuf = dentry->d_fsdata;
8862
8963 BUG_ON(dmabuf->vmapping_counter);
9064
@@ -110,9 +84,32 @@ static int dma_buf_release(struct inode *inode, struct file *file) · 19 unmodified lines
11084 module_put(dmabuf->owner);
11185 kfree(dmabuf->name);
11286 kfree(dmabuf);
87+}
88+
89+static const struct dentry_operations dma_buf_dentry_ops = {
90+ .d_dname = dmabuffs_dname,
91+ .d_release = dma_buf_release,
92+};
93+
94+static struct vfsmount *dma_buf_mnt;
95+
96+static int dma_buf_fs_init_context(struct fs_context *fc)
97+{
98+ struct pseudo_fs_context *ctx;
99+
100+ ctx = init_pseudo(fc, DMA_BUF_MAGIC);
101+ if (!ctx)
102+ return -ENOMEM;
103+ ctx->dops = &dma_buf_dentry_ops;
113104 return 0;
114105 }
115106
107+static struct file_system_type dma_buf_fs_type = {
108+ .name = "dmabuf",
109+ .init_fs_context = dma_buf_fs_init_context,
110+ .kill_sb = kill_anon_super,
111+};
112+
116113 static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma)
117114 {
118115 struct dma_buf *dmabuf;
@@ -341,8 +338,10 @@ static long dma_buf_set_name(struct dma_buf *dmabuf, const char __user *buf) · 222 unmodified lines
341338 kfree(name);
342339 goto out_unlock;
343340 }
341+ spin_lock(&dmabuf->name_lock);
344342 kfree(dmabuf->name);
345343 dmabuf->name = name;
344+ spin_unlock(&dmabuf->name_lock);
346345
347346 out_unlock:
348347 dma_resv_unlock(dmabuf->resv);
@@ -405,14 +404,13 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) · 56 unmodified lines
405404 /* Don't count the temporary reference taken inside procfs seq_show */
406405 seq_printf(m, "count:\t%ld\n", file_count(dmabuf->file) - 1);
407406 seq_printf(m, "exp_name:\t%s\n", dmabuf->exp_name);
408− dma_resv_lock(dmabuf->resv, NULL);
407+ spin_lock(&dmabuf->name_lock);
409408 if (dmabuf->name)
410409 seq_printf(m, "name:\t%s\n", dmabuf->name);
411− dma_resv_unlock(dmabuf->resv);
410+ spin_unlock(&dmabuf->name_lock);
412411 }
413412
414413 static const struct file_operations dma_buf_fops = {
415− .release = dma_buf_release,
416414 .mmap = dma_buf_mmap_internal,
417415 .llseek = dma_buf_llseek,
418416 .poll = dma_buf_poll,
@@ -546,6 +544,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) · 127 unmodified lines
546544 dmabuf->size = exp_info->size;
547545 dmabuf->exp_name = exp_info->exp_name;
548546 dmabuf->owner = exp_info->owner;
547+ spin_lock_init(&dmabuf->name_lock);
549548 init_waitqueue_head(&dmabuf->poll);
550549 dmabuf->cb_excl.poll = dmabuf->cb_shared.poll = &dmabuf->poll;
551550 dmabuf->cb_excl.active = dmabuf->cb_shared.active = 0;
drivers/dma/dmatest.c+2−0
@@ -1176,6 +1176,8 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp) · 1175 unmodified lines
11761176 } else if (dmatest_run) {
11771177 if (!is_threaded_test_pending(info)) {
11781178 pr_info("No channels configured, continue with any\n");
1179+ if (!is_threaded_test_run(info))
1180+ stop_threaded_test(info);
11791181 add_threaded_test(info);
11801182 }
11811183 start_threaded_tests(info);
drivers/dma/dw/core.c+0−12
@@ -118,16 +118,11 @@ static void dwc_initialize(struct dw_dma_chan *dwc) · 117 unmodified lines
118118 {
119119 struct dw_dma *dw = to_dw_dma(dwc->chan.device);
120120
121− if (test_bit(DW_DMA_IS_INITIALIZED, &dwc->flags))
122− return;
123−
124121 dw->initialize_chan(dwc);
125122
126123 /* Enable interrupts */
127124 channel_set_bit(dw, MASK.XFER, dwc->mask);
128125 channel_set_bit(dw, MASK.ERROR, dwc->mask);
129−
130− set_bit(DW_DMA_IS_INITIALIZED, &dwc->flags);
131126 }
132127
133128 /*----------------------------------------------------------------------*/
@@ -954,8 +949,6 @@ static void dwc_issue_pending(struct dma_chan *chan) · 820 unmodified lines
954949
955950 void do_dw_dma_off(struct dw_dma *dw)
956951 {
957− unsigned int i;
958−
959952 dma_writel(dw, CFG, 0);
960953
961954 channel_clear_bit(dw, MASK.XFER, dw->all_chan_mask);
@@ -966,9 +959,6 @@ void do_dw_dma_off(struct dw_dma *dw) · 4 unmodified lines
966959
967960 while (dma_readl(dw, CFG) & DW_CFG_DMA_EN)
968961 cpu_relax();
969−
970− for (i = 0; i < dw->dma.chancnt; i++)
971− clear_bit(DW_DMA_IS_INITIALIZED, &dw->chan[i].flags);
972962 }
973963
974964 void do_dw_dma_on(struct dw_dma *dw)
@@ -1032,8 +1022,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan) · 57 unmodified lines
10321022 /* Clear custom channel configuration */
10331023 memset(&dwc->dws, 0, sizeof(struct dw_dma_slave));
10341024
1035− clear_bit(DW_DMA_IS_INITIALIZED, &dwc->flags);
1036−
10371025 /* Disable interrupts */
10381026 channel_clear_bit(dw, MASK.XFER, dwc->mask);
10391027 channel_clear_bit(dw, MASK.BLOCK, dwc->mask);
drivers/dma/fsl-edma-common.c+16−12
@@ -352,26 +352,28 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, · 351 unmodified lines
352352 /*
353353 * TCD parameters are stored in struct fsl_edma_hw_tcd in little
354354 * endian format. However, we need to load the TCD registers in
355− * big- or little-endian obeying the eDMA engine model endian.
355+ * big- or little-endian obeying the eDMA engine model endian,
356+ * and this is performed from specific edma_write functions
356357 */
357358 edma_writew(edma, 0, &regs->tcd[ch].csr);
358− edma_writel(edma, le32_to_cpu(tcd->saddr), &regs->tcd[ch].saddr);
359− edma_writel(edma, le32_to_cpu(tcd->daddr), &regs->tcd[ch].daddr);
360359
361− edma_writew(edma, le16_to_cpu(tcd->attr), &regs->tcd[ch].attr);
362− edma_writew(edma, le16_to_cpu(tcd->soff), &regs->tcd[ch].soff);
360+ edma_writel(edma, (s32)tcd->saddr, &regs->tcd[ch].saddr);
361+ edma_writel(edma, (s32)tcd->daddr, &regs->tcd[ch].daddr);
363362
364− edma_writel(edma, le32_to_cpu(tcd->nbytes), &regs->tcd[ch].nbytes);
365− edma_writel(edma, le32_to_cpu(tcd->slast), &regs->tcd[ch].slast);
363+ edma_writew(edma, (s16)tcd->attr, &regs->tcd[ch].attr);
364+ edma_writew(edma, tcd->soff, &regs->tcd[ch].soff);
366365
367− edma_writew(edma, le16_to_cpu(tcd->citer), &regs->tcd[ch].citer);
368− edma_writew(edma, le16_to_cpu(tcd->biter), &regs->tcd[ch].biter);
369− edma_writew(edma, le16_to_cpu(tcd->doff), &regs->tcd[ch].doff);
366+ edma_writel(edma, (s32)tcd->nbytes, &regs->tcd[ch].nbytes);
367+ edma_writel(edma, (s32)tcd->slast, &regs->tcd[ch].slast);
370368
371− edma_writel(edma, le32_to_cpu(tcd->dlast_sga),
369+ edma_writew(edma, (s16)tcd->citer, &regs->tcd[ch].citer);
370+ edma_writew(edma, (s16)tcd->biter, &regs->tcd[ch].biter);
371+ edma_writew(edma, (s16)tcd->doff, &regs->tcd[ch].doff);
372+
373+ edma_writel(edma, (s32)tcd->dlast_sga,
372374 &regs->tcd[ch].dlast_sga);
373375
374− edma_writew(edma, le16_to_cpu(tcd->csr), &regs->tcd[ch].csr);
376+ edma_writew(edma, (s16)tcd->csr, &regs->tcd[ch].csr);
375377 }
376378
377379 static inline
@@ -589,6 +591,8 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) · 211 unmodified lines
589591 {
590592 struct virt_dma_desc *vdesc;
591593
594+ lockdep_assert_held(&fsl_chan->vchan.lock);
595+
592596 vdesc = vchan_next_desc(&fsl_chan->vchan);
593597 if (!vdesc)
594598 return;
drivers/dma/fsl-edma-common.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #define EDMA_TCD_ATTR_DSIZE_16BIT BIT(0)
3434 #define EDMA_TCD_ATTR_DSIZE_32BIT BIT(1)
3535 #define EDMA_TCD_ATTR_DSIZE_64BIT (BIT(0) | BIT(1))
36−#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(3) | BIT(0))
36+#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(2) | BIT(0))
3737 #define EDMA_TCD_ATTR_SSIZE_8BIT 0
3838 #define EDMA_TCD_ATTR_SSIZE_16BIT (EDMA_TCD_ATTR_DSIZE_16BIT << 8)
3939 #define EDMA_TCD_ATTR_SSIZE_32BIT (EDMA_TCD_ATTR_DSIZE_32BIT << 8)
drivers/dma/fsl-edma.c+7−0
@@ -45,6 +45,13 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) · 44 unmodified lines
4545 fsl_chan = &fsl_edma->chans[ch];
4646
4747 spin_lock(&fsl_chan->vchan.lock);
48+
49+ if (!fsl_chan->edesc) {
50+ /* terminate_all called before */
51+ spin_unlock(&fsl_chan->vchan.lock);
52+ continue;
53+ }
54+
4855 if (!fsl_chan->edesc->iscyclic) {
4956 list_del(&fsl_chan->edesc->vdesc.node);
5057 vchan_cookie_complete(&fsl_chan->edesc->vdesc);
drivers/dma/idxd/cdev.c+16−3
@@ -74,6 +74,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp) · 73 unmodified lines
7474 struct idxd_device *idxd;
7575 struct idxd_wq *wq;
7676 struct device *dev;
77+ int rc = 0;
7778
7879 wq = inode_wq(inode);
7980 idxd = wq->idxd;
@@ -81,17 +82,27 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp) · 1 unmodified line
8182
8283 dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq));
8384
84− if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq))
85− return -EBUSY;
86−
8785 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
8886 if (!ctx)
8987 return -ENOMEM;
9088
89+ mutex_lock(&wq->wq_lock);
90+
91+ if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq)) {
92+ rc = -EBUSY;
93+ goto failed;
94+ }
95+
9196 ctx->wq = wq;
9297 filp->private_data = ctx;
9398 idxd_wq_get(wq);
99+ mutex_unlock(&wq->wq_lock);
94100 return 0;
101+
102+ failed:
103+ mutex_unlock(&wq->wq_lock);
104+ kfree(ctx);
105+ return rc;
95106 }
96107
97108 static int idxd_cdev_release(struct inode *node, struct file *filep)
@@ -105,7 +116,9 @@ static int idxd_cdev_release(struct inode *node, struct file *filep) · 7 unmodified lines
105116 filep->private_data = NULL;
106117
107118 kfree(ctx);
119+ mutex_lock(&wq->wq_lock);
108120 idxd_wq_put(wq);
121+ mutex_unlock(&wq->wq_lock);
109122 return 0;
110123 }
111124
drivers/dma/idxd/device.c+25−0
@@ -320,6 +320,31 @@ void idxd_wq_unmap_portal(struct idxd_wq *wq) · 319 unmodified lines
320320 devm_iounmap(dev, wq->dportal);
321321 }
322322
323+void idxd_wq_disable_cleanup(struct idxd_wq *wq)
324+{
325+ struct idxd_device *idxd = wq->idxd;
326+ struct device *dev = &idxd->pdev->dev;
327+ int i, wq_offset;
328+
329+ lockdep_assert_held(&idxd->dev_lock);
330+ memset(&wq->wqcfg, 0, sizeof(wq->wqcfg));
331+ wq->type = IDXD_WQT_NONE;
332+ wq->size = 0;
333+ wq->group = NULL;
334+ wq->threshold = 0;
335+ wq->priority = 0;
336+ clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
337+ memset(wq->name, 0, WQ_NAME_SIZE);
338+
339+ for (i = 0; i < 8; i++) {
340+ wq_offset = idxd->wqcfg_offset + wq->id * 32 + i * sizeof(u32);
341+ iowrite32(0, idxd->reg_base + wq_offset);
342+ dev_dbg(dev, "WQ[%d][%d][%#x]: %#x\n",
343+ wq->id, i, wq_offset,
344+ ioread32(idxd->reg_base + wq_offset));
345+ }
346+}
347+
323348 /* Device control bits */
324349 static inline bool idxd_is_enabled(struct idxd_device *idxd)
325350 {
drivers/dma/idxd/idxd.h+1−0
@@ -290,6 +290,7 @@ int idxd_wq_enable(struct idxd_wq *wq); · 289 unmodified lines
290290 int idxd_wq_disable(struct idxd_wq *wq);
291291 int idxd_wq_map_portal(struct idxd_wq *wq);
292292 void idxd_wq_unmap_portal(struct idxd_wq *wq);
293+void idxd_wq_disable_cleanup(struct idxd_wq *wq);
293294
294295 /* submission */
295296 int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc);
drivers/dma/idxd/irq.c+2−1
@@ -141,7 +141,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data) · 140 unmodified lines
141141
142142 iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
143143 if (!err)
144− return IRQ_HANDLED;
144+ goto out;
145145
146146 gensts.bits = ioread32(idxd->reg_base + IDXD_GENSTATS_OFFSET);
147147 if (gensts.state == IDXD_DEVICE_STATE_HALT) {
@@ -162,6 +162,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data) · 14 unmodified lines
162162 spin_unlock_bh(&idxd->dev_lock);
163163 }
164164
165+ out:
165166 idxd_unmask_msix_vector(idxd, irq_entry->id);
166167 return IRQ_HANDLED;
167168 }
drivers/dma/idxd/sysfs.c+5−0
@@ -315,6 +315,11 @@ static int idxd_config_bus_remove(struct device *dev) · 314 unmodified lines
315315 idxd_unregister_dma_device(idxd);
316316 spin_lock_irqsave(&idxd->dev_lock, flags);
317317 rc = idxd_device_disable(idxd);
318+ for (i = 0; i < idxd->max_wqs; i++) {
319+ struct idxd_wq *wq = &idxd->wqs[i];
320+
321+ idxd_wq_disable_cleanup(wq);
322+ }
318323 spin_unlock_irqrestore(&idxd->dev_lock, flags);
319324 module_put(THIS_MODULE);
320325 if (rc < 0)
drivers/dma/imx-sdma.c+4−7
@@ -1331,8 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan) · 1330 unmodified lines
13311331
13321332 sdma_channel_synchronize(chan);
13331333
1334− if (sdmac->event_id0 >= 0)
1335− sdma_event_disable(sdmac, sdmac->event_id0);
1334+ sdma_event_disable(sdmac, sdmac->event_id0);
13361335 if (sdmac->event_id1)
13371336 sdma_event_disable(sdmac, sdmac->event_id1);
13381337
@@ -1632,11 +1631,9 @@ static int sdma_config(struct dma_chan *chan, · 293 unmodified lines
16321631 memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
16331632
16341633 /* Set ENBLn earlier to make sure dma request triggered after that */
1635− if (sdmac->event_id0 >= 0) {
1636− if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
1637− return -EINVAL;
1638− sdma_event_enable(sdmac, sdmac->event_id0);
1639− }
1634+ if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
1635+ return -EINVAL;
1636+ sdma_event_enable(sdmac, sdmac->event_id0);
16401637
16411638 if (sdmac->event_id1) {
16421639 if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)
drivers/dma/ioat/dma.c+12−0
@@ -26,6 +26,18 @@ · 25 unmodified lines
2626
2727 #include "../dmaengine.h"
2828
29+int completion_timeout = 200;
30+module_param(completion_timeout, int, 0644);
31+MODULE_PARM_DESC(completion_timeout,
32+ "set ioat completion timeout [msec] (default 200 [msec])");
33+int idle_timeout = 2000;
34+module_param(idle_timeout, int, 0644);
35+MODULE_PARM_DESC(idle_timeout,
36+ "set ioat idel timeout [msec] (default 2000 [msec])");
37+
38+#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout)
39+#define COMPLETION_TIMEOUT msecs_to_jiffies(completion_timeout)
40+
2941 static char *chanerr_str[] = {
3042 "DMA Transfer Source Address Error",
3143 "DMA Transfer Destination Address Error",
drivers/dma/ioat/dma.h+0−2
@@ -104,8 +104,6 @@ struct ioatdma_chan { · 103 unmodified lines
104104 #define IOAT_RUN 5
105105 #define IOAT_CHAN_ACTIVE 6
106106 struct timer_list timer;
107− #define COMPLETION_TIMEOUT msecs_to_jiffies(100)
108− #define IDLE_TIMEOUT msecs_to_jiffies(2000)
109107 #define RESET_DELAY msecs_to_jiffies(100)
110108 struct ioatdma_device *ioat_dma;
111109 dma_addr_t completion_dma;
drivers/dma/mcf-edma.c+7−0
@@ -35,6 +35,13 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) · 34 unmodified lines
3535 mcf_chan = &mcf_edma->chans[ch];
3636
3737 spin_lock(&mcf_chan->vchan.lock);
38+
39+ if (!mcf_chan->edesc) {
40+ /* terminate_all called before */
41+ spin_unlock(&mcf_chan->vchan.lock);
42+ continue;
43+ }
44+
3845 if (!mcf_chan->edesc->iscyclic) {
3946 list_del(&mcf_chan->edesc->vdesc.node);
4047 vchan_cookie_complete(&mcf_chan->edesc->vdesc);
drivers/dma/sh/usb-dmac.c+2−0
@@ -586,6 +586,8 @@ static void usb_dmac_isr_transfer_end(struct usb_dmac_chan *chan) · 585 unmodified lines
586586 desc->residue = usb_dmac_get_current_residue(chan, desc,
587587 desc->sg_index - 1);
588588 desc->done_cookie = desc->vd.tx.cookie;
589+ desc->vd.tx_result.result = DMA_TRANS_NOERROR;
590+ desc->vd.tx_result.residue = desc->residue;
589591 vchan_cookie_complete(&desc->vd);
590592
591593 /* Restart the next transfer if this driver has a next desc */
drivers/dma/tegra210-adma.c+4−1
@@ -658,6 +658,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc) · 657 unmodified lines
658658
659659 ret = pm_runtime_get_sync(tdc2dev(tdc));
660660 if (ret < 0) {
661+ pm_runtime_put_noidle(tdc2dev(tdc));
661662 free_irq(tdc->irq, tdc);
662663 return ret;
663664 }
@@ -869,8 +870,10 @@ static int tegra_adma_probe(struct platform_device *pdev) · 205 unmodified lines
869870 pm_runtime_enable(&pdev->dev);
870871
871872 ret = pm_runtime_get_sync(&pdev->dev);
872− if (ret < 0)
873+ if (ret < 0) {
874+ pm_runtime_put_noidle(&pdev->dev);
873875 goto rpm_disable;
876+ }
874877
875878 ret = tegra_adma_init(tdma);
876879 if (ret)
drivers/dma/ti/k3-udma-private.c+1−0
@@ -42,6 +42,7 @@ struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property) · 41 unmodified lines
4242 ud = platform_get_drvdata(pdev);
4343 if (!ud) {
4444 pr_debug("UDMA has not been probed\n");
45+ put_device(&pdev->dev);
4546 return ERR_PTR(-EPROBE_DEFER);
4647 }
4748
drivers/dma/ti/k3-udma.c+19−20
@@ -1753,7 +1753,8 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 1752 unmodified lines
17531753 dev_err(ud->ddev.dev,
17541754 "Descriptor pool allocation failed\n");
17551755 uc->use_dma_pool = false;
1756− return -ENOMEM;
1756+ ret = -ENOMEM;
1757+ goto err_cleanup;
17571758 }
17581759 }
17591760
@@ -1773,16 +1774,18 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 13 unmodified lines
17731774
17741775 ret = udma_get_chan_pair(uc);
17751776 if (ret)
1776− return ret;
1777+ goto err_cleanup;
17771778
17781779 ret = udma_alloc_tx_resources(uc);
1779− if (ret)
1780− return ret;
1780+ if (ret) {
1781+ udma_put_rchan(uc);
1782+ goto err_cleanup;
1783+ }
17811784
17821785 ret = udma_alloc_rx_resources(uc);
17831786 if (ret) {
17841787 udma_free_tx_resources(uc);
1785− return ret;
1788+ goto err_cleanup;
17861789 }
17871790
17881791 uc->config.src_thread = ud->psil_base + uc->tchan->id;
@@ -1800,10 +1803,8 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 11 unmodified lines
18001803 uc->id);
18011804
18021805 ret = udma_alloc_tx_resources(uc);
1803− if (ret) {
1804− uc->config.remote_thread_id = -1;
1805− return ret;
1806− }
1806+ if (ret)
1807+ goto err_cleanup;
18071808
18081809 uc->config.src_thread = ud->psil_base + uc->tchan->id;
18091810 uc->config.dst_thread = uc->config.remote_thread_id;
@@ -1820,10 +1821,8 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 10 unmodified lines
18201821 uc->id);
18211822
18221823 ret = udma_alloc_rx_resources(uc);
1823− if (ret) {
1824− uc->config.remote_thread_id = -1;
1825− return ret;
1826− }
1824+ if (ret)
1825+ goto err_cleanup;
18271826
18281827 uc->config.src_thread = uc->config.remote_thread_id;
18291828 uc->config.dst_thread = (ud->psil_base + uc->rchan->id) |
@@ -1838,7 +1837,9 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 8 unmodified lines
18381837 /* Can not happen */
18391838 dev_err(uc->ud->dev, "%s: chan%d invalid direction (%u)\n",
18401839 __func__, uc->id, uc->config.dir);
1841− return -EINVAL;
1840+ ret = -EINVAL;
1841+ goto err_cleanup;
1842+
18421843 }
18431844
18441845 /* check if the channel configuration was successful */
@@ -1847,7 +1848,7 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 2 unmodified lines
18471848
18481849 if (udma_is_chan_running(uc)) {
18491850 dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
1850− udma_stop(uc);
1851+ udma_reset_chan(uc, false);
18511852 if (udma_is_chan_running(uc)) {
18521853 dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
18531854 ret = -EBUSY;
@@ -1906,8 +1907,6 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 52 unmodified lines
19061907
19071908 udma_reset_rings(uc);
19081909
1909− INIT_DELAYED_WORK_ONSTACK(&uc->tx_drain.work,
1910− udma_check_tx_completion);
19111910 return 0;
19121911
19131912 err_irq_free:
@@ -1919,7 +1918,7 @@ err_psi_free: · 5 unmodified lines
19191918 err_res_free:
19201919 udma_free_tx_resources(uc);
19211920 udma_free_rx_resources(uc);
1922−
1921+err_cleanup:
19231922 udma_reset_uchan(uc);
19241923
19251924 if (uc->use_dma_pool) {
@@ -3019,7 +3018,6 @@ static void udma_free_chan_resources(struct dma_chan *chan) · 1093 unmodified lines
30193018 }
30203019
30213020 cancel_delayed_work_sync(&uc->tx_drain.work);
3022− destroy_delayed_work_on_stack(&uc->tx_drain.work);
30233021
30243022 if (uc->irq_num_ring > 0) {
30253023 free_irq(uc->irq_num_ring, uc);
@@ -3593,7 +3591,7 @@ static int udma_probe(struct platform_device *pdev) · 567 unmodified lines
35933591 return ret;
35943592 }
35953593
3596− ret = of_property_read_u32(navss_node, "ti,udma-atype", &ud->atype);
3594+ ret = of_property_read_u32(dev->of_node, "ti,udma-atype", &ud->atype);
35973595 if (!ret && ud->atype > 2) {
35983596 dev_err(dev, "Invalid atype: %u\n", ud->atype);
35993597 return -EINVAL;
@@ -3711,6 +3709,7 @@ static int udma_probe(struct platform_device *pdev) · 111 unmodified lines
37113709 tasklet_init(&uc->vc.task, udma_vchan_complete,
37123710 (unsigned long)&uc->vc);
37133711 init_completion(&uc->teardown_completed);
3712+ INIT_DELAYED_WORK(&uc->tx_drain.work, udma_check_tx_completion);
37143713 }
37153714
37163715 ret = dma_async_device_register(&ud->ddev);
drivers/edac/amd64_edac.c+2−0
@@ -269,6 +269,8 @@ static int get_scrub_rate(struct mem_ctl_info *mci) · 268 unmodified lines
269269
270270 if (pvt->model == 0x60)
271271 amd64_read_pci_cfg(pvt->F2, F15H_M60H_SCRCTRL, &scrubval);
272+ else
273+ amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
272274 } else {
273275 amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
274276 }
drivers/firmware/efi/Kconfig+11−0
@@ -278,3 +278,14 @@ config EFI_EARLYCON · 277 unmodified lines
278278 depends on SERIAL_EARLYCON && !ARM && !IA64
279279 select FONT_SUPPORT
280280 select ARCH_USE_MEMREMAP_PROT
281+
282+config EFI_CUSTOM_SSDT_OVERLAYS
283+ bool "Load custom ACPI SSDT overlay from an EFI variable"
284+ depends on EFI_VARS && ACPI
285+ default ACPI_TABLE_UPGRADE
286+ help
287+ Allow loading of an ACPI SSDT overlay from an EFI variable specified
288+ by a kernel command line option.
289+
290+ See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
291+ information.
drivers/firmware/efi/arm-init.c+36−4
@@ -52,9 +52,11 @@ static phys_addr_t __init efi_to_phys(unsigned long addr) · 51 unmodified lines
5252 }
5353
5454 static __initdata unsigned long screen_info_table = EFI_INVALID_TABLE_ADDR;
55+static __initdata unsigned long cpu_state_table = EFI_INVALID_TABLE_ADDR;
5556
5657 static const efi_config_table_type_t arch_tables[] __initconst = {
5758 {LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID, &screen_info_table},
59+ {LINUX_EFI_ARM_CPU_STATE_TABLE_GUID, &cpu_state_table},
5860 {}
5961 };
6062
@@ -62,7 +64,8 @@ static void __init init_screen_info(void) · 1 unmodified line
6264 {
6365 struct screen_info *si;
6466
65− if (screen_info_table != EFI_INVALID_TABLE_ADDR) {
67+ if (IS_ENABLED(CONFIG_ARM) &&
68+ screen_info_table != EFI_INVALID_TABLE_ADDR) {
6669 si = early_memremap_ro(screen_info_table, sizeof(*si));
6770 if (!si) {
6871 pr_err("Could not map screen_info config table\n");
@@ -116,7 +119,8 @@ static int __init uefi_init(u64 efi_system_table) · 47 unmodified lines
116119 goto out;
117120 }
118121 retval = efi_config_parse_tables(config_tables, systab->nr_tables,
119− arch_tables);
122+ IS_ENABLED(CONFIG_ARM) ? arch_tables
123+ : NULL);
120124
121125 early_memunmap(config_tables, table_size);
122126 out:
@@ -238,9 +242,37 @@ void __init efi_init(void) · 115 unmodified lines
238242
239243 init_screen_info();
240244
245+#ifdef CONFIG_ARM
241246 /* ARM does not permit early mappings to persist across paging_init() */
242− if (IS_ENABLED(CONFIG_ARM))
243− efi_memmap_unmap();
247+ efi_memmap_unmap();
248+
249+ if (cpu_state_table != EFI_INVALID_TABLE_ADDR) {
250+ struct efi_arm_entry_state *state;
251+ bool dump_state = true;
252+
253+ state = early_memremap_ro(cpu_state_table,
254+ sizeof(struct efi_arm_entry_state));
255+ if (state == NULL) {
256+ pr_warn("Unable to map CPU entry state table.\n");
257+ return;
258+ }
259+
260+ if ((state->sctlr_before_ebs & 1) == 0)
261+ pr_warn(FW_BUG "EFI stub was entered with MMU and Dcache disabled, please fix your firmware!\n");
262+ else if ((state->sctlr_after_ebs & 1) == 0)
263+ pr_warn(FW_BUG "ExitBootServices() returned with MMU and Dcache disabled, please fix your firmware!\n");
264+ else
265+ dump_state = false;
266+
267+ if (dump_state || efi_enabled(EFI_DBG)) {
268+ pr_info("CPSR at EFI stub entry : 0x%08x\n", state->cpsr_before_ebs);
269+ pr_info("SCTLR at EFI stub entry : 0x%08x\n", state->sctlr_before_ebs);
270+ pr_info("CPSR after ExitBootServices() : 0x%08x\n", state->cpsr_after_ebs);
271+ pr_info("SCTLR after ExitBootServices(): 0x%08x\n", state->sctlr_after_ebs);
272+ }
273+ early_memunmap(state, sizeof(struct efi_arm_entry_state));
274+ }
275+#endif
244276 }
245277
246278 static bool efifb_overlaps_pci_range(const struct of_pci_range *range)
drivers/firmware/efi/efi.c+3−2
@@ -189,7 +189,7 @@ static void generic_ops_unregister(void) · 188 unmodified lines
189189 efivars_unregister(&generic_efivars);
190190 }
191191
192−#if IS_ENABLED(CONFIG_ACPI)
192+#ifdef CONFIG_EFI_CUSTOM_SSDT_OVERLAYS
193193 #define EFIVAR_SSDT_NAME_MAX 16
194194 static char efivar_ssdt[EFIVAR_SSDT_NAME_MAX] __initdata;
195195 static int __init efivar_ssdt_setup(char *str)
@@ -622,7 +622,8 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables, · 426 unmodified lines
622622 rsv = (void *)(p + prsv % PAGE_SIZE);
623623
624624 /* reserve the entry itself */
625− memblock_reserve(prsv, EFI_MEMRESERVE_SIZE(rsv->size));
625+ memblock_reserve(prsv,
626+ struct_size(rsv, entry, rsv->size));
626627
627628 for (i = 0; i < atomic_read(&rsv->count); i++) {
628629 memblock_reserve(rsv->entry[i].base,
drivers/firmware/efi/esrt.c+1−1
@@ -181,7 +181,7 @@ static int esre_create_sysfs_entry(void *esre, int entry_num) · 180 unmodified lines
181181 rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL,
182182 "entry%d", entry_num);
183183 if (rc) {
184− kfree(entry);
184+ kobject_put(&entry->kobj);
185185 return rc;
186186 }
187187 }
drivers/firmware/efi/libstub/Makefile+2−1
@@ -6,7 +6,8 @@ · 5 unmodified lines
66 # enabled, even if doing so doesn't break the build.
77 #
88 cflags-$(CONFIG_X86_32) := -march=i386
9−cflags-$(CONFIG_X86_64) := -mcmodel=small
9+cflags-$(CONFIG_X86_64) := -mcmodel=small \
10+ $(call cc-option,-maccumulate-outgoing-args)
1011 cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
1112 -fPIC -fno-strict-aliasing -mno-red-zone \
1213 -mno-mmx -mno-sse -fshort-wchar \
drivers/firmware/efi/libstub/arm32-stub.c+53−1
@@ -7,10 +7,49 @@ · 6 unmodified lines
77
88 #include "efistub.h"
99
10+static efi_guid_t cpu_state_guid = LINUX_EFI_ARM_CPU_STATE_TABLE_GUID;
11+
12+struct efi_arm_entry_state *efi_entry_state;
13+
14+static void get_cpu_state(u32 *cpsr, u32 *sctlr)
15+{
16+ asm("mrs %0, cpsr" : "=r"(*cpsr));
17+ if ((*cpsr & MODE_MASK) == HYP_MODE)
18+ asm("mrc p15, 4, %0, c1, c0, 0" : "=r"(*sctlr));
19+ else
20+ asm("mrc p15, 0, %0, c1, c0, 0" : "=r"(*sctlr));
21+}
22+
1023 efi_status_t check_platform_features(void)
1124 {
25+ efi_status_t status;
26+ u32 cpsr, sctlr;
1227 int block;
1328
29+ get_cpu_state(&cpsr, &sctlr);
30+
31+ efi_info("Entering in %s mode with MMU %sabled\n",
32+ ((cpsr & MODE_MASK) == HYP_MODE) ? "HYP" : "SVC",
33+ (sctlr & 1) ? "en" : "dis");
34+
35+ status = efi_bs_call(allocate_pool, EFI_LOADER_DATA,
36+ sizeof(*efi_entry_state),
37+ (void **)&efi_entry_state);
38+ if (status != EFI_SUCCESS) {
39+ efi_err("allocate_pool() failed\n");
40+ return status;
41+ }
42+
43+ efi_entry_state->cpsr_before_ebs = cpsr;
44+ efi_entry_state->sctlr_before_ebs = sctlr;
45+
46+ status = efi_bs_call(install_configuration_table, &cpu_state_guid,
47+ efi_entry_state);
48+ if (status != EFI_SUCCESS) {
49+ efi_err("install_configuration_table() failed\n");
50+ goto free_state;
51+ }
52+
1453 /* non-LPAE kernels can run anywhere */
1554 if (!IS_ENABLED(CONFIG_ARM_LPAE))
1655 return EFI_SUCCESS;
@@ -19,9 +58,22 @@ efi_status_t check_platform_features(void) · 2 unmodified lines
1958 block = cpuid_feature_extract(CPUID_EXT_MMFR0, 0);
2059 if (block < 5) {
2160 efi_err("This LPAE kernel is not supported by your CPU\n");
22− return EFI_UNSUPPORTED;
61+ status = EFI_UNSUPPORTED;
62+ goto drop_table;
2363 }
2464 return EFI_SUCCESS;
65+
66+drop_table:
67+ efi_bs_call(install_configuration_table, &cpu_state_guid, NULL);
68+free_state:
69+ efi_bs_call(free_pool, efi_entry_state);
70+ return status;
71+}
72+
73+void efi_handle_post_ebs_state(void)
74+{
75+ get_cpu_state(&efi_entry_state->cpsr_after_ebs,
76+ &efi_entry_state->sctlr_after_ebs);
2577 }
2678
2779 static efi_guid_t screen_info_guid = LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID;
drivers/firmware/efi/libstub/arm64-stub.c+14−11
@@ -35,13 +35,16 @@ efi_status_t check_platform_features(void) · 34 unmodified lines
3535 }
3636
3737 /*
38− * Relocatable kernels can fix up the misalignment with respect to
39− * MIN_KIMG_ALIGN, so they only require a minimum alignment of EFI_KIMG_ALIGN
40− * (which accounts for the alignment of statically allocated objects such as
41− * the swapper stack.)
38+ * Although relocatable kernels can fix up the misalignment with respect to
39+ * MIN_KIMG_ALIGN, the resulting virtual text addresses are subtly out of
40+ * sync with those recorded in the vmlinux when kaslr is disabled but the
41+ * image required relocation anyway. Therefore retain 2M alignment unless
42+ * KASLR is in use.
4243 */
43−static const u64 min_kimg_align = IS_ENABLED(CONFIG_RELOCATABLE) ? EFI_KIMG_ALIGN
44− : MIN_KIMG_ALIGN;
44+static u64 min_kimg_align(void)
45+{
46+ return efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN;
47+}
4548
4649 efi_status_t handle_kernel_image(unsigned long *image_addr,
4750 unsigned long *image_size,
@@ -74,21 +77,21 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 26 unmodified lines
7477
7578 kernel_size = _edata - _text;
7679 kernel_memsize = kernel_size + (_end - _edata);
77− *reserve_size = kernel_memsize + TEXT_OFFSET % min_kimg_align;
80+ *reserve_size = kernel_memsize + TEXT_OFFSET % min_kimg_align();
7881
7982 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && phys_seed != 0) {
8083 /*
8184 * If KASLR is enabled, and we have some randomness available,
8285 * locate the kernel at a randomized offset in physical memory.
8386 */
84− status = efi_random_alloc(*reserve_size, min_kimg_align,
87+ status = efi_random_alloc(*reserve_size, min_kimg_align(),
8588 reserve_addr, phys_seed);
8689 } else {
8790 status = EFI_OUT_OF_RESOURCES;
8891 }
8992
9093 if (status != EFI_SUCCESS) {
91− if (IS_ALIGNED((u64)_text - TEXT_OFFSET, min_kimg_align)) {
94+ if (IS_ALIGNED((u64)_text - TEXT_OFFSET, min_kimg_align())) {
9295 /*
9396 * Just execute from wherever we were loaded by the
9497 * UEFI PE/COFF loader if the alignment is suitable.
@@ -99,7 +102,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 4 unmodified lines
99102 }
100103
101104 status = efi_allocate_pages_aligned(*reserve_size, reserve_addr,
102− ULONG_MAX, min_kimg_align);
105+ ULONG_MAX, min_kimg_align());
103106
104107 if (status != EFI_SUCCESS) {
105108 efi_err("Failed to relocate kernel\n");
@@ -108,7 +111,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 2 unmodified lines
108111 }
109112 }
110113
111− *image_addr = *reserve_addr + TEXT_OFFSET % min_kimg_align;
114+ *image_addr = *reserve_addr + TEXT_OFFSET % min_kimg_align();
112115 memcpy((void *)*image_addr, _text, kernel_size);
113116
114117 return EFI_SUCCESS;
drivers/firmware/efi/libstub/efi-stub-helper.c+68−12
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include "efistub.h"
2020
2121 bool efi_nochunk;
22−bool efi_nokaslr;
22+bool efi_nokaslr = !IS_ENABLED(CONFIG_RANDOMIZE_BASE);
2323 bool efi_noinitrd;
2424 int efi_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
2525 bool efi_novamap;
@@ -32,6 +32,10 @@ bool __pure __efi_soft_reserve_enabled(void) · 6 unmodified lines
3232 return !efi_nosoftreserve;
3333 }
3434
35+/**
36+ * efi_char16_puts() - Write a UCS-2 encoded string to the console
37+ * @str: UCS-2 encoded string
38+ */
3539 void efi_char16_puts(efi_char16_t *str)
3640 {
3741 efi_call_proto(efi_table_attr(efi_system_table, con_out),
@@ -83,6 +87,10 @@ u32 utf8_to_utf32(const u8 **s8) · 45 unmodified lines
8387 return c32;
8488 }
8589
90+/**
91+ * efi_puts() - Write a UTF-8 encoded string to the console
92+ * @str: UTF-8 encoded string
93+ */
8694 void efi_puts(const char *str)
8795 {
8896 efi_char16_t buf[128];
@@ -113,6 +121,16 @@ void efi_puts(const char *str) · 24 unmodified lines
113121 }
114122 }
115123
124+/**
125+ * efi_printk() - Print a kernel message
126+ * @fmt: format string
127+ *
128+ * The first letter of the format string is used to determine the logging level
129+ * of the message. If the level is less then the current EFI logging level, the
130+ * message is suppressed. The message will be truncated to 255 bytes.
131+ *
132+ * Return: number of printed characters
133+ */
116134 int efi_printk(const char *fmt, ...)
117135 {
118136 char printf_buf[256];
@@ -154,13 +172,18 @@ int efi_printk(const char *fmt, ...) · 35 unmodified lines
154172 return printed;
155173 }
156174
157−/*
158− * Parse the ASCII string 'cmdline' for EFI options, denoted by the efi=
175+/**
176+ * efi_parse_options() - Parse EFI command line options
177+ * @cmdline: kernel command line
178+ *
179+ * Parse the ASCII string @cmdline for EFI options, denoted by the efi=
159180 * option, e.g. efi=nochunk.
160181 *
161182 * It should be noted that efi= is parsed in two very different
162183 * environments, first in the early boot environment of the EFI boot
163184 * stub, and subsequently during the kernel boot.
185+ *
186+ * Return: status code
164187 */
165188 efi_status_t efi_parse_options(char const *cmdline)
166189 {
@@ -286,13 +309,21 @@ char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len) · 119 unmodified lines
286309 return (char *)cmdline_addr;
287310 }
288311
289−/*
312+/**
313+ * efi_exit_boot_services() - Exit boot services
314+ * @handle: handle of the exiting image
315+ * @map: pointer to receive the memory map
316+ * @priv: argument to be passed to @priv_func
317+ * @priv_func: function to process the memory map before exiting boot services
318+ *
290319 * Handle calling ExitBootServices according to the requirements set out by the
291320 * spec. Obtains the current memory map, and returns that info after calling
292321 * ExitBootServices. The client must specify a function to perform any
293322 * processing of the memory map data prior to ExitBootServices. A client
294323 * specific structure may be passed to the function via priv. The client
295324 * function may be called multiple times.
325+ *
326+ * Return: status code
296327 */
297328 efi_status_t efi_exit_boot_services(void *handle,
298329 struct efi_boot_memmap *map,
@@ -361,6 +392,11 @@ fail: · 62 unmodified lines
361392 return status;
362393 }
363394
395+/**
396+ * get_efi_config_table() - retrieve UEFI configuration table
397+ * @guid: GUID of the configuration table to be retrieved
398+ * Return: pointer to the configuration table or NULL
399+ */
364400 void *get_efi_config_table(efi_guid_t guid)
365401 {
366402 unsigned long tables = efi_table_attr(efi_system_table, tables);
@@ -408,17 +444,18 @@ static const struct { · 41 unmodified lines
408444 };
409445
410446 /**
411− * efi_load_initrd_dev_path - load the initrd from the Linux initrd device path
447+ * efi_load_initrd_dev_path() - load the initrd from the Linux initrd device path
412448 * @load_addr: pointer to store the address where the initrd was loaded
413449 * @load_size: pointer to store the size of the loaded initrd
414450 * @max: upper limit for the initrd memory allocation
415− * @return: %EFI_SUCCESS if the initrd was loaded successfully, in which
416− * case @load_addr and @load_size are assigned accordingly
417− * %EFI_NOT_FOUND if no LoadFile2 protocol exists on the initrd
418− * device path
419− * %EFI_INVALID_PARAMETER if load_addr == NULL or load_size == NULL
420− * %EFI_OUT_OF_RESOURCES if memory allocation failed
421− * %EFI_LOAD_ERROR in all other cases
451+ *
452+ * Return:
453+ * * %EFI_SUCCESS if the initrd was loaded successfully, in which
454+ * case @load_addr and @load_size are assigned accordingly
455+ * * %EFI_NOT_FOUND if no LoadFile2 protocol exists on the initrd device path
456+ * * %EFI_INVALID_PARAMETER if load_addr == NULL or load_size == NULL
457+ * * %EFI_OUT_OF_RESOURCES if memory allocation failed
458+ * * %EFI_LOAD_ERROR in all other cases
422459 */
423460 static
424461 efi_status_t efi_load_initrd_dev_path(unsigned long *load_addr,
@@ -481,6 +518,16 @@ efi_status_t efi_load_initrd_cmdline(efi_loaded_image_t *image, · 56 unmodified lines
481518 load_addr, load_size);
482519 }
483520
521+/**
522+ * efi_load_initrd() - Load initial RAM disk
523+ * @image: EFI loaded image protocol
524+ * @load_addr: pointer to loaded initrd
525+ * @load_size: size of loaded initrd
526+ * @soft_limit: preferred size of allocated memory for loading the initrd
527+ * @hard_limit: minimum size of allocated memory
528+ *
529+ * Return: status code
530+ */
484531 efi_status_t efi_load_initrd(efi_loaded_image_t *image,
485532 unsigned long *load_addr,
486533 unsigned long *load_size,
@@ -505,6 +552,15 @@ efi_status_t efi_load_initrd(efi_loaded_image_t *image, · 18 unmodified lines
505552 return status;
506553 }
507554
555+/**
556+ * efi_wait_for_key() - Wait for key stroke
557+ * @usec: number of microseconds to wait for key stroke
558+ * @key: key entered
559+ *
560+ * Wait for up to @usec microseconds for a key stroke.
561+ *
562+ * Return: status code, EFI_SUCCESS if key received
563+ */
508564 efi_status_t efi_wait_for_key(unsigned long usec, efi_input_key_t *key)
509565 {
510566 efi_event_t events[2], timer;
drivers/firmware/efi/libstub/efi-stub.c+3−0
@@ -329,6 +329,9 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 328 unmodified lines
329329 if (status != EFI_SUCCESS)
330330 goto fail_free_initrd;
331331
332+ if (IS_ENABLED(CONFIG_ARM))
333+ efi_handle_post_ebs_state();
334+
332335 efi_enter_kernel(image_addr, fdt_addr, fdt_totalsize((void *)fdt_addr));
333336 /* not reached */
334337
drivers/firmware/efi/libstub/efistub.h+10−2
@@ -157,8 +157,14 @@ typedef void (__efiapi *efi_event_notify_t)(efi_event_t, void *); · 156 unmodified lines
157157 #define EFI_EVT_NOTIFY_WAIT 0x00000100U
158158 #define EFI_EVT_NOTIFY_SIGNAL 0x00000200U
159159
160−/*
161− * boottime->wait_for_event takes an array of events as input.
160+/**
161+ * efi_set_event_at() - add event to events array
162+ *
163+ * @events: array of UEFI events
164+ * @ids: index where to put the event in the array
165+ * @event: event to add to the aray
166+ *
167+ * boottime->wait_for_event() takes an array of events as input.
162168 * Provide a helper to set it up correctly for mixed mode.
163169 */
164170 static inline
@@ -771,4 +777,6 @@ efi_status_t efi_load_initrd(efi_loaded_image_t *image, · 606 unmodified lines
771777 unsigned long soft_limit,
772778 unsigned long hard_limit);
773779
780+void efi_handle_post_ebs_state(void);
781+
774782 #endif
drivers/firmware/efi/libstub/file.c+12−4
@@ -102,12 +102,20 @@ static int find_file_option(const efi_char16_t *cmdline, int cmdline_len, · 101 unmodified lines
102102 if (!found)
103103 return 0;
104104
105+ /* Skip any leading slashes */
106+ while (cmdline[i] == L'/' || cmdline[i] == L'\\')
107+ i++;
108+
105109 while (--result_len > 0 && i < cmdline_len) {
106− if (cmdline[i] == L'\0' ||
107− cmdline[i] == L'\n' ||
108− cmdline[i] == L' ')
110+ efi_char16_t c = cmdline[i++];
111+
112+ if (c == L'\0' || c == L'\n' || c == L' ')
109113 break;
110− *result++ = cmdline[i++];
114+ else if (c == L'/')
115+ /* Replace UNIX dir separators with EFI standard ones */
116+ *result++ = L'\\';
117+ else
118+ *result++ = c;
111119 }
112120 *result = L'\0';
113121 return i;
drivers/firmware/efi/libstub/skip_spaces.c+1−0
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22
33 #include <linux/ctype.h>
4+#include <linux/string.h>
45 #include <linux/types.h>
56
67 char *skip_spaces(const char *str)
drivers/firmware/psci/psci_checker.c+5−3
@@ -157,8 +157,10 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) · 156 unmodified lines
157157
158158 cpu_groups = kcalloc(nb_available_cpus, sizeof(cpu_groups),
159159 GFP_KERNEL);
160− if (!cpu_groups)
160+ if (!cpu_groups) {
161+ free_cpumask_var(tmp);
161162 return -ENOMEM;
163+ }
162164
163165 cpumask_copy(tmp, cpu_online_mask);
164166
@@ -167,6 +169,7 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) · 2 unmodified lines
167169 topology_core_cpumask(cpumask_any(tmp));
168170
169171 if (!alloc_cpumask_var(&cpu_groups[num_groups], GFP_KERNEL)) {
172+ free_cpumask_var(tmp);
170173 free_cpu_groups(num_groups, &cpu_groups);
171174 return -ENOMEM;
172175 }
@@ -196,13 +199,12 @@ static int hotplug_tests(void) · 23 unmodified lines
196199 if (!page_buf)
197200 goto out_free_cpu_groups;
198201
199− err = 0;
200202 /*
201203 * Of course the last CPU cannot be powered down and cpu_down() should
202204 * refuse doing that.
203205 */
204206 pr_info("Trying to turn off and on again all CPUs\n");
205− err += down_and_up_cpus(cpu_online_mask, offlined_cpus);
207+ err = down_and_up_cpus(cpu_online_mask, offlined_cpus);
206208
207209 /*
208210 * Take down CPUs by cpu group this time. When the last CPU is turned
drivers/firmware/raspberrypi.c+4−1
@@ -181,6 +181,7 @@ EXPORT_SYMBOL_GPL(rpi_firmware_property); · 180 unmodified lines
181181 static void
182182 rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
183183 {
184+ time64_t date_and_time;
184185 u32 packet;
185186 int ret = rpi_firmware_property(fw,
186187 RPI_FIRMWARE_GET_FIRMWARE_REVISION,
@@ -189,7 +190,9 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) · 2 unmodified lines
189190 if (ret)
190191 return;
191192
192− dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &packet);
193+ /* This is not compatible with y2038 */
194+ date_and_time = packet;
195+ dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &date_and_time);
193196 }
194197
195198 static void
drivers/fpga/Kconfig+1−1
@@ -208,7 +208,7 @@ config FPGA_DFL_PCI · 207 unmodified lines
208208
209209 config FPGA_MGR_ZYNQMP_FPGA
210210 tristate "Xilinx ZynqMP FPGA"
211− depends on ARCH_ZYNQMP || COMPILE_TEST
211+ depends on ZYNQMP_FIRMWARE || (!ZYNQMP_FIRMWARE && COMPILE_TEST)
212212 help
213213 FPGA manager driver support for Xilinx ZynqMP FPGAs.
214214 This driver uses the processor configuration port(PCAP)
drivers/gpio/gpio-arizona.c+6−1
@@ -64,6 +64,7 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset) · 63 unmodified lines
6464 ret = pm_runtime_get_sync(chip->parent);
6565 if (ret < 0) {
6666 dev_err(chip->parent, "Failed to resume: %d\n", ret);
67+ pm_runtime_put_autosuspend(chip->parent);
6768 return ret;
6869 }
6970
@@ -72,12 +73,15 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset) · 2 unmodified lines
7273 if (ret < 0) {
7374 dev_err(chip->parent, "Failed to drop cache: %d\n",
7475 ret);
76+ pm_runtime_put_autosuspend(chip->parent);
7577 return ret;
7678 }
7779
7880 ret = regmap_read(arizona->regmap, reg, &val);
79− if (ret < 0)
81+ if (ret < 0) {
82+ pm_runtime_put_autosuspend(chip->parent);
8083 return ret;
84+ }
8185
8286 pm_runtime_mark_last_busy(chip->parent);
8387 pm_runtime_put_autosuspend(chip->parent);
@@ -106,6 +110,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip, · 22 unmodified lines
106110 ret = pm_runtime_get_sync(chip->parent);
107111 if (ret < 0) {
108112 dev_err(chip->parent, "Failed to resume: %d\n", ret);
113+ pm_runtime_put(chip->parent);
109114 return ret;
110115 }
111116 }
drivers/gpio/gpio-pca953x.c+94−5
@@ -107,6 +107,84 @@ static const struct i2c_device_id pca953x_id[] = { · 106 unmodified lines
107107 };
108108 MODULE_DEVICE_TABLE(i2c, pca953x_id);
109109
110+#ifdef CONFIG_GPIO_PCA953X_IRQ
111+
112+#include <linux/dmi.h>
113+#include <linux/gpio.h>
114+#include <linux/list.h>
115+
116+static const struct dmi_system_id pca953x_dmi_acpi_irq_info[] = {
117+ {
118+ /*
119+ * On Intel Galileo Gen 2 board the IRQ pin of one of
120+ * the I²C GPIO expanders, which has GpioInt() resource,
121+ * is provided as an absolute number instead of being
122+ * relative. Since first controller (gpio-sch.c) and
123+ * second (gpio-dwapb.c) are at the fixed bases, we may
124+ * safely refer to the number in the global space to get
125+ * an IRQ out of it.
126+ */
127+ .matches = {
128+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"),
129+ },
130+ },
131+ {}
132+};
133+
134+#ifdef CONFIG_ACPI
135+static int pca953x_acpi_get_pin(struct acpi_resource *ares, void *data)
136+{
137+ struct acpi_resource_gpio *agpio;
138+ int *pin = data;
139+
140+ if (acpi_gpio_get_irq_resource(ares, &agpio))
141+ *pin = agpio->pin_table[0];
142+ return 1;
143+}
144+
145+static int pca953x_acpi_find_pin(struct device *dev)
146+{
147+ struct acpi_device *adev = ACPI_COMPANION(dev);
148+ int pin = -ENOENT, ret;
149+ LIST_HEAD(r);
150+
151+ ret = acpi_dev_get_resources(adev, &r, pca953x_acpi_get_pin, &pin);
152+ acpi_dev_free_resource_list(&r);
153+ if (ret < 0)
154+ return ret;
155+
156+ return pin;
157+}
158+#else
159+static inline int pca953x_acpi_find_pin(struct device *dev) { return -ENXIO; }
160+#endif
161+
162+static int pca953x_acpi_get_irq(struct device *dev)
163+{
164+ int pin, ret;
165+
166+ pin = pca953x_acpi_find_pin(dev);
167+ if (pin < 0)
168+ return pin;
169+
170+ dev_info(dev, "Applying ACPI interrupt quirk (GPIO %d)\n", pin);
171+
172+ if (!gpio_is_valid(pin))
173+ return -EINVAL;
174+
175+ ret = gpio_request(pin, "pca953x interrupt");
176+ if (ret)
177+ return ret;
178+
179+ ret = gpio_to_irq(pin);
180+
181+ /* When pin is used as an IRQ, no need to keep it requested */
182+ gpio_free(pin);
183+
184+ return ret;
185+}
186+#endif
187+
110188 static const struct acpi_device_id pca953x_acpi_ids[] = {
111189 { "INT3491", 16 | PCA953X_TYPE | PCA_LATCH_INT, },
112190 { }
@@ -322,6 +400,7 @@ static const struct regmap_config pca953x_ai_i2c_regmap = { · 209 unmodified lines
322400 .writeable_reg = pca953x_writeable_register,
323401 .volatile_reg = pca953x_volatile_register,
324402
403+ .disable_locking = true,
325404 .cache_type = REGCACHE_RBTREE,
326405 .max_register = 0x7f,
327406 };
@@ -623,8 +702,6 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d) · 295 unmodified lines
623702 DECLARE_BITMAP(reg_direction, MAX_LINE);
624703 int level;
625704
626− pca953x_read_regs(chip, chip->regs->direction, reg_direction);
627−
628705 if (chip->driver_data & PCA_PCAL) {
629706 /* Enable latch on interrupt-enabled inputs */
630707 pca953x_write_regs(chip, PCAL953X_IN_LATCH, chip->irq_mask);
@@ -635,7 +712,11 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d) · 4 unmodified lines
635712 pca953x_write_regs(chip, PCAL953X_INT_MASK, irq_mask);
636713 }
637714
715+ /* Switch direction to input if needed */
716+ pca953x_read_regs(chip, chip->regs->direction, reg_direction);
717+
638718 bitmap_or(irq_mask, chip->irq_trig_fall, chip->irq_trig_raise, gc->ngpio);
719+ bitmap_complement(reg_direction, reg_direction, gc->ngpio);
639720 bitmap_and(irq_mask, irq_mask, reg_direction, gc->ngpio);
640721
641722 /* Look for any newly setup interrupt */
@@ -734,14 +815,16 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid) · 92 unmodified lines
734815 struct gpio_chip *gc = &chip->gpio_chip;
735816 DECLARE_BITMAP(pending, MAX_LINE);
736817 int level;
818+ bool ret;
737819
738− if (!pca953x_irq_pending(chip, pending))
739− return IRQ_NONE;
820+ mutex_lock(&chip->i2c_lock);
821+ ret = pca953x_irq_pending(chip, pending);
822+ mutex_unlock(&chip->i2c_lock);
740823
741824 for_each_set_bit(level, pending, gc->ngpio)
742825 handle_nested_irq(irq_find_mapping(gc->irq.domain, level));
743826
744− return IRQ_HANDLED;
827+ return IRQ_RETVAL(ret);
745828 }
746829
747830 static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
@@ -752,6 +835,12 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base) · 4 unmodified lines
752835 DECLARE_BITMAP(irq_stat, MAX_LINE);
753836 int ret;
754837
838+ if (dmi_first_match(pca953x_dmi_acpi_irq_info)) {
839+ ret = pca953x_acpi_get_irq(&client->dev);
840+ if (ret > 0)
841+ client->irq = ret;
842+ }
843+
755844 if (!client->irq)
756845 return 0;
757846
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c+1−0
@@ -204,6 +204,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, · 203 unmodified lines
204204 (mode_info->atom_context->bios + data_offset);
205205 switch (crev) {
206206 case 11:
207+ case 12:
207208 mem_channel_number = igp_info->v11.umachannelnumber;
208209 /* channel width is 64 */
209210 if (vram_width)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c+15−5
@@ -1295,27 +1295,37 @@ static void amdgpu_ib_preempt_job_recovery(struct drm_gpu_scheduler *sched) · 1294 unmodified lines
12951295 static void amdgpu_ib_preempt_mark_partial_job(struct amdgpu_ring *ring)
12961296 {
12971297 struct amdgpu_job *job;
1298− struct drm_sched_job *s_job;
1298+ struct drm_sched_job *s_job, *tmp;
12991299 uint32_t preempt_seq;
13001300 struct dma_fence *fence, **ptr;
13011301 struct amdgpu_fence_driver *drv = &ring->fence_drv;
13021302 struct drm_gpu_scheduler *sched = &ring->sched;
1303+ bool preempted = true;
13031304
13041305 if (ring->funcs->type != AMDGPU_RING_TYPE_GFX)
13051306 return;
13061307
13071308 preempt_seq = le32_to_cpu(*(drv->cpu_addr + 2));
1308− if (preempt_seq <= atomic_read(&drv->last_seq))
1309− return;
1309+ if (preempt_seq <= atomic_read(&drv->last_seq)) {
1310+ preempted = false;
1311+ goto no_preempt;
1312+ }
13101313
13111314 preempt_seq &= drv->num_fences_mask;
13121315 ptr = &drv->fences[preempt_seq];
13131316 fence = rcu_dereference_protected(*ptr, 1);
13141317
1318+no_preempt:
13151319 spin_lock(&sched->job_list_lock);
1316− list_for_each_entry(s_job, &sched->ring_mirror_list, node) {
1320+ list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
1321+ if (dma_fence_is_signaled(&s_job->s_fence->finished)) {
1322+ /* remove job from ring_mirror_list */
1323+ list_del_init(&s_job->node);
1324+ sched->ops->free_job(s_job);
1325+ continue;
1326+ }
13171327 job = to_amdgpu_job(s_job);
1318− if (job->fence == fence)
1328+ if (preempted && job->fence == fence)
13191329 /* mark the job as preempted */
13201330 job->preemption_status |= AMDGPU_IB_PREEMPTED;
13211331 }
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c+2−1
@@ -37,7 +37,8 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job) · 36 unmodified lines
3737
3838 memset(&ti, 0, sizeof(struct amdgpu_task_info));
3939
40− if (amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) {
40+ if (amdgpu_gpu_recovery &&
41+ amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) {
4142 DRM_ERROR("ring %s timeout, but soft recovered\n",
4243 s_job->sched->name);
4344 return;
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c+2−2
@@ -2784,7 +2784,7 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev, · 2783 unmodified lines
27842784 if (r)
27852785 return r;
27862786
2787− return snprintf(buf, PAGE_SIZE, "%d\n", sclk * 10 * 1000);
2787+ return snprintf(buf, PAGE_SIZE, "%u\n", sclk * 10 * 1000);
27882788 }
27892789
27902790 static ssize_t amdgpu_hwmon_show_sclk_label(struct device *dev,
@@ -2819,7 +2819,7 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev, · 28 unmodified lines
28192819 if (r)
28202820 return r;
28212821
2822− return snprintf(buf, PAGE_SIZE, "%d\n", mclk * 10 * 1000);
2822+ return snprintf(buf, PAGE_SIZE, "%u\n", mclk * 10 * 1000);
28232823 }
28242824
28252825 static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+59−4
@@ -372,6 +372,52 @@ static int psp_tmr_load(struct psp_context *psp) · 371 unmodified lines
372372 return ret;
373373 }
374374
375+static void psp_prep_tmr_unload_cmd_buf(struct psp_context *psp,
376+ struct psp_gfx_cmd_resp *cmd)
377+{
378+ if (amdgpu_sriov_vf(psp->adev))
379+ cmd->cmd_id = GFX_CMD_ID_DESTROY_VMR;
380+ else
381+ cmd->cmd_id = GFX_CMD_ID_DESTROY_TMR;
382+}
383+
384+static int psp_tmr_unload(struct psp_context *psp)
385+{
386+ int ret;
387+ struct psp_gfx_cmd_resp *cmd;
388+
389+ cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
390+ if (!cmd)
391+ return -ENOMEM;
392+
393+ psp_prep_tmr_unload_cmd_buf(psp, cmd);
394+ DRM_INFO("free PSP TMR buffer\n");
395+
396+ ret = psp_cmd_submit_buf(psp, NULL, cmd,
397+ psp->fence_buf_mc_addr);
398+
399+ kfree(cmd);
400+
401+ return ret;
402+}
403+
404+static int psp_tmr_terminate(struct psp_context *psp)
405+{
406+ int ret;
407+ void *tmr_buf;
408+ void **pptr;
409+
410+ ret = psp_tmr_unload(psp);
411+ if (ret)
412+ return ret;
413+
414+ /* free TMR memory buffer */
415+ pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
416+ amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr);
417+
418+ return 0;
419+}
420+
375421 static void psp_prep_asd_load_cmd_buf(struct psp_gfx_cmd_resp *cmd,
376422 uint64_t asd_mc, uint32_t size)
377423 {
@@ -1779,8 +1825,6 @@ static int psp_hw_fini(void *handle) · 1401 unmodified lines
17791825 {
17801826 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
17811827 struct psp_context *psp = &adev->psp;
1782− void *tmr_buf;
1783− void **pptr;
17841828
17851829 if (psp->adev->psp.ta_fw) {
17861830 psp_ras_terminate(psp);
@@ -1790,10 +1834,9 @@ static int psp_hw_fini(void *handle) · 3 unmodified lines
17901834
17911835 psp_asd_unload(psp);
17921836
1837+ psp_tmr_terminate(psp);
17931838 psp_ring_destroy(psp, PSP_RING_TYPE__KM);
17941839
1795− pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
1796− amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr);
17971840 amdgpu_bo_free_kernel(&psp->fw_pri_bo,
17981841 &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
17991842 amdgpu_bo_free_kernel(&psp->fence_buf_bo,
@@ -1840,6 +1883,18 @@ static int psp_suspend(void *handle) · 40 unmodified lines
18401883 }
18411884 }
18421885
1886+ ret = psp_asd_unload(psp);
1887+ if (ret) {
1888+ DRM_ERROR("Failed to unload asd\n");
1889+ return ret;
1890+ }
1891+
1892+ ret = psp_tmr_terminate(psp);
1893+ if (ret) {
1894+ DRM_ERROR("Falied to terminate tmr\n");
1895+ return ret;
1896+ }
1897+
18431898 ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
18441899 if (ret) {
18451900 DRM_ERROR("PSP ring stop failed\n");
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+8−1
@@ -7513,12 +7513,17 @@ static int gfx_v10_0_ring_preempt_ib(struct amdgpu_ring *ring) · 7512 unmodified lines
75137513 struct amdgpu_device *adev = ring->adev;
75147514 struct amdgpu_kiq *kiq = &adev->gfx.kiq;
75157515 struct amdgpu_ring *kiq_ring = &kiq->ring;
7516+ unsigned long flags;
75167517
75177518 if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
75187519 return -EINVAL;
75197520
7520− if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size))
7521+ spin_lock_irqsave(&kiq->ring_lock, flags);
7522+
7523+ if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size)) {
7524+ spin_unlock_irqrestore(&kiq->ring_lock, flags);
75217525 return -ENOMEM;
7526+ }
75227527
75237528 /* assert preemption condition */
75247529 amdgpu_ring_set_preempt_cond_exec(ring, false);
@@ -7529,6 +7534,8 @@ static int gfx_v10_0_ring_preempt_ib(struct amdgpu_ring *ring) · 4 unmodified lines
75297534 ++ring->trail_seq);
75307535 amdgpu_ring_commit(kiq_ring);
75317536
7537+ spin_unlock_irqrestore(&kiq->ring_lock, flags);
7538+
75327539 /* poll the trailing fence */
75337540 for (i = 0; i < adev->usec_timeout; i++) {
75347541 if (ring->trail_seq ==
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c+13−19
@@ -314,30 +314,20 @@ static uint64_t sdma_v5_0_ring_get_rptr(struct amdgpu_ring *ring) · 313 unmodified lines
314314 static uint64_t sdma_v5_0_ring_get_wptr(struct amdgpu_ring *ring)
315315 {
316316 struct amdgpu_device *adev = ring->adev;
317− u64 *wptr = NULL;
318− uint64_t local_wptr = 0;
317+ u64 wptr;
319318
320319 if (ring->use_doorbell) {
321320 /* XXX check if swapping is necessary on BE */
322− wptr = ((u64 *)&adev->wb.wb[ring->wptr_offs]);
323− DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", *wptr);
324− *wptr = (*wptr) >> 2;
325− DRM_DEBUG("wptr/doorbell after shift == 0x%016llx\n", *wptr);
321+ wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs]));
322+ DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr);
326323 } else {
327− u32 lowbit, highbit;
328−
329− wptr = &local_wptr;
330− lowbit = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR)) >> 2;
331− highbit = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI)) >> 2;
332−
333− DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n",
334− ring->me, highbit, lowbit);
335− *wptr = highbit;
336− *wptr = (*wptr) << 32;
337− *wptr |= lowbit;
324+ wptr = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI));
325+ wptr = wptr << 32;
326+ wptr |= RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR));
327+ DRM_DEBUG("wptr before shift [%i] wptr == 0x%016llx\n", ring->me, wptr);
338328 }
339329
340− return *wptr;
330+ return wptr >> 2;
341331 }
342332
343333 /**
@@ -1298,8 +1288,12 @@ static int sdma_v5_0_sw_fini(void *handle) · 954 unmodified lines
12981288 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
12991289 int i;
13001290
1301− for (i = 0; i < adev->sdma.num_instances; i++)
1291+ for (i = 0; i < adev->sdma.num_instances; i++) {
1292+ if (adev->sdma.instance[i].fw != NULL)
1293+ release_firmware(adev->sdma.instance[i].fw);
1294+
13021295 amdgpu_ring_fini(&adev->sdma.instance[i].ring);
1296+ }
13031297
13041298 return 0;
13051299 }
drivers/gpu/drm/amd/amdkfd/kfd_process.c+1−0
@@ -428,6 +428,7 @@ struct kfd_process *kfd_create_process(struct file *filep) · 427 unmodified lines
428428 (int)process->lead_thread->pid);
429429 if (ret) {
430430 pr_warn("Creating procfs pid directory failed");
431+ kobject_put(process->kobj);
431432 goto out;
432433 }
433434
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+17−2
@@ -974,6 +974,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 973 unmodified lines
974974 /* Update the actual used number of crtc */
975975 adev->mode_info.num_crtc = adev->dm.display_indexes_num;
976976
977+ /* create fake encoders for MST */
978+ dm_dp_create_fake_mst_encoders(adev);
979+
977980 /* TODO: Add_display_info? */
978981
979982 /* TODO use dynamic cursor width */
@@ -997,6 +1000,12 @@ error: · 17 unmodified lines
9971000
9981001 static void amdgpu_dm_fini(struct amdgpu_device *adev)
9991002 {
1003+ int i;
1004+
1005+ for (i = 0; i < adev->dm.display_indexes_num; i++) {
1006+ drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
1007+ }
1008+
10001009 amdgpu_dm_audio_fini(adev);
10011010
10021011 amdgpu_dm_destroy_drm_device(&adev->dm);
@@ -1358,7 +1367,7 @@ static int dm_late_init(void *handle) · 355 unmodified lines
13581367 struct dmcu *dmcu = NULL;
13591368 bool ret;
13601369
1361− if (!adev->dm.fw_dmcu)
1370+ if (!adev->dm.fw_dmcu && !adev->dm.dmub_fw)
13621371 return detect_mst_link_for_all_connectors(adev->ddev);
13631372
13641373 dmcu = adev->dm.dc->res_pool->dmcu;
@@ -2010,6 +2019,7 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 645 unmodified lines
20102019 struct amdgpu_display_manager *dm;
20112020 struct drm_connector *conn_base;
20122021 struct amdgpu_device *adev;
2022+ struct dc_link *link = NULL;
20132023 static const u8 pre_computed_values[] = {
20142024 50, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 63, 65, 66, 68, 69,
20152025 71, 72, 74, 75, 77, 79, 81, 82, 84, 86, 88, 90, 92, 94, 96, 98};
@@ -2017,6 +2027,10 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 1 unmodified line
20172027 if (!aconnector || !aconnector->dc_link)
20182028 return;
20192029
2030+ link = aconnector->dc_link;
2031+ if (link->connector_signal != SIGNAL_TYPE_EDP)
2032+ return;
2033+
20202034 conn_base = &aconnector->base;
20212035 adev = conn_base->dev->dev_private;
20222036 dm = &adev->dm;
@@ -5024,7 +5038,8 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, · 3001 unmodified lines
50245038 struct drm_connector *connector = &aconnector->base;
50255039 struct amdgpu_device *adev = connector->dev->dev_private;
50265040 struct dc_stream_state *stream;
5027− int requested_bpc = connector->state ? connector->state->max_requested_bpc : 8;
5041+ const struct drm_connector_state *drm_state = dm_state ? &dm_state->base : NULL;
5042+ int requested_bpc = drm_state ? drm_state->max_requested_bpc : 8;
50285043 enum dc_status dc_result = DC_OK;
50295044
50305045 do {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+10−1
@@ -43,6 +43,9 @@ · 42 unmodified lines
4343 */
4444
4545 #define AMDGPU_DM_MAX_DISPLAY_INDEX 31
46+
47+#define AMDGPU_DM_MAX_CRTC 6
48+
4649 /*
4750 #include "include/amdgpu_dal_power_if.h"
4851 #include "amdgpu_dm_irq.h"
@@ -328,6 +331,13 @@ struct amdgpu_display_manager { · 279 unmodified lines
328331 * available in FW
329332 */
330333 const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
334+
335+ /**
336+ * @mst_encoders:
337+ *
338+ * fake encoders used for DP MST.
339+ */
340+ struct amdgpu_encoder mst_encoders[AMDGPU_DM_MAX_CRTC];
331341 };
332342
333343 struct amdgpu_dm_connector {
@@ -356,7 +366,6 @@ struct amdgpu_dm_connector { · 22 unmodified lines
356366 struct amdgpu_dm_dp_aux dm_dp_aux;
357367 struct drm_dp_mst_port *port;
358368 struct amdgpu_dm_connector *mst_port;
359− struct amdgpu_encoder *mst_encoder;
360369 struct drm_dp_aux *dsc_aux;
361370
362371 /* TODO see if we can merge with ddc_bus or make a dm_connector */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c+3−1
@@ -1058,7 +1058,6 @@ static const struct { · 1057 unmodified lines
10581058 {"link_settings", &dp_link_settings_debugfs_fops},
10591059 {"phy_settings", &dp_phy_settings_debugfs_fop},
10601060 {"test_pattern", &dp_phy_test_pattern_fops},
1061− {"output_bpc", &output_bpc_fops},
10621061 {"vrr_range", &vrr_range_fops},
10631062 #ifdef CONFIG_DRM_AMD_DC_HDCP
10641063 {"hdcp_sink_capability", &hdcp_sink_capability_fops},
@@ -1142,6 +1141,9 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector) · 77 unmodified lines
11421141 debugfs_create_file_unsafe("force_yuv420_output", 0644, dir, connector,
11431142 &force_yuv420_output_fops);
11441143
1144+ debugfs_create_file("output_bpc", 0644, dir, connector,
1145+ &output_bpc_fops);
1146+
11451147 connector->debugfs_dpcd_address = 0;
11461148 connector->debugfs_dpcd_size = 0;
11471149
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c+4−2
@@ -510,8 +510,10 @@ static ssize_t srm_data_read(struct file *filp, struct kobject *kobj, struct bin · 509 unmodified lines
510510
511511 srm = psp_get_srm(work->hdcp.config.psp.handle, &srm_version, &srm_size);
512512
513− if (!srm)
514− return -EINVAL;
513+ if (!srm) {
514+ ret = -EINVAL;
515+ goto ret;
516+ }
515517
516518 if (pos >= srm_size)
517519 ret = 0;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+26−27
@@ -95,7 +95,6 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) · 94 unmodified lines
9595 {
9696 struct amdgpu_dm_connector *aconnector =
9797 to_amdgpu_dm_connector(connector);
98− struct amdgpu_encoder *amdgpu_encoder = aconnector->mst_encoder;
9998
10099 if (aconnector->dc_sink) {
101100 dc_link_remove_remote_sink(aconnector->dc_link,
@@ -105,8 +104,6 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) · 3 unmodified lines
105104
106105 kfree(aconnector->edid);
107106
108− drm_encoder_cleanup(&amdgpu_encoder->base);
109− kfree(amdgpu_encoder);
110107 drm_connector_cleanup(connector);
111108 drm_dp_mst_put_port_malloc(aconnector->port);
112109 kfree(aconnector);
@@ -243,7 +240,11 @@ static struct drm_encoder * · 130 unmodified lines
243240 dm_mst_atomic_best_encoder(struct drm_connector *connector,
244241 struct drm_connector_state *connector_state)
245242 {
246− return &to_amdgpu_dm_connector(connector)->mst_encoder->base;
243+ struct drm_device *dev = connector->dev;
244+ struct amdgpu_device *adev = dev->dev_private;
245+ struct amdgpu_crtc *acrtc = to_amdgpu_crtc(connector_state->crtc);
246+
247+ return &adev->dm.mst_encoders[acrtc->crtc_id].base;
247248 }
248249
249250 static int
@@ -306,31 +307,27 @@ static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = { · 56 unmodified lines
306307 .destroy = amdgpu_dm_encoder_destroy,
307308 };
308309
309−static struct amdgpu_encoder *
310−dm_dp_create_fake_mst_encoder(struct amdgpu_dm_connector *connector)
310+void
311+dm_dp_create_fake_mst_encoders(struct amdgpu_device *adev)
311312 {
312− struct drm_device *dev = connector->base.dev;
313− struct amdgpu_device *adev = dev->dev_private;
314− struct amdgpu_encoder *amdgpu_encoder;
315− struct drm_encoder *encoder;
316−
317− amdgpu_encoder = kzalloc(sizeof(*amdgpu_encoder), GFP_KERNEL);
318− if (!amdgpu_encoder)
319− return NULL;
313+ struct drm_device *dev = adev->ddev;
314+ int i;
320315
321− encoder = &amdgpu_encoder->base;
322− encoder->possible_crtcs = amdgpu_dm_get_encoder_crtc_mask(adev);
316+ for (i = 0; i < adev->dm.display_indexes_num; i++) {
317+ struct amdgpu_encoder *amdgpu_encoder = &adev->dm.mst_encoders[i];
318+ struct drm_encoder *encoder = &amdgpu_encoder->base;
323319
324− drm_encoder_init(
325− dev,
326− &amdgpu_encoder->base,
327− &amdgpu_dm_encoder_funcs,
328− DRM_MODE_ENCODER_DPMST,
329− NULL);
320+ encoder->possible_crtcs = amdgpu_dm_get_encoder_crtc_mask(adev);
330321
331− drm_encoder_helper_add(encoder, &amdgpu_dm_encoder_helper_funcs);
322+ drm_encoder_init(
323+ dev,
324+ &amdgpu_encoder->base,
325+ &amdgpu_dm_encoder_funcs,
326+ DRM_MODE_ENCODER_DPMST,
327+ NULL);
332328
333− return amdgpu_encoder;
329+ drm_encoder_helper_add(encoder, &amdgpu_dm_encoder_helper_funcs);
330+ }
334331 }
335332
336333 static struct drm_connector *
@@ -343,6 +340,7 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, · 6 unmodified lines
343340 struct amdgpu_device *adev = dev->dev_private;
344341 struct amdgpu_dm_connector *aconnector;
345342 struct drm_connector *connector;
343+ int i;
346344
347345 aconnector = kzalloc(sizeof(*aconnector), GFP_KERNEL);
348346 if (!aconnector)
@@ -369,9 +367,10 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, · 20 unmodified lines
369367 master->dc_link,
370368 master->connector_id);
371369
372− aconnector->mst_encoder = dm_dp_create_fake_mst_encoder(master);
373− drm_connector_attach_encoder(&aconnector->base,
374− &aconnector->mst_encoder->base);
370+ for (i = 0; i < adev->dm.display_indexes_num; i++) {
371+ drm_connector_attach_encoder(&aconnector->base,
372+ &adev->dm.mst_encoders[i].base);
373+ }
375374
376375 connector->max_bpc_property = master->base.max_bpc_property;
377376 if (connector->max_bpc_property)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h+3−0
@@ -35,6 +35,9 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, · 34 unmodified lines
3535 struct amdgpu_dm_connector *aconnector,
3636 int link_index);
3737
38+void
39+dm_dp_create_fake_mst_encoders(struct amdgpu_device *adev);
40+
3841 #if defined(CONFIG_DRM_AMD_DC_DCN)
3942 bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
4043 struct dc_state *dc_state);
drivers/gpu/drm/amd/display/dc/core/dc.c+6−4
@@ -2538,10 +2538,12 @@ void dc_commit_updates_for_stream(struct dc *dc, · 2537 unmodified lines
25382538
25392539 copy_stream_update_to_stream(dc, context, stream, stream_update);
25402540
2541− if (!dc->res_pool->funcs->validate_bandwidth(dc, context, false)) {
2542− DC_ERROR("Mode validation failed for stream update!\n");
2543− dc_release_state(context);
2544− return;
2541+ if (update_type > UPDATE_TYPE_FAST) {
2542+ if (!dc->res_pool->funcs->validate_bandwidth(dc, context, false)) {
2543+ DC_ERROR("Mode validation failed for stream update!\n");
2544+ dc_release_state(context);
2545+ return;
2546+ }
25452547 }
25462548
25472549 commit_planes_for_stream(
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+16−3
@@ -56,7 +56,7 @@ void update_stream_signal(struct dc_stream_state *stream, struct dc_sink *sink) · 55 unmodified lines
5656 }
5757 }
5858
59−static void dc_stream_construct(struct dc_stream_state *stream,
59+static bool dc_stream_construct(struct dc_stream_state *stream,
6060 struct dc_sink *dc_sink_data)
6161 {
6262 uint32_t i = 0;
@@ -118,11 +118,17 @@ static void dc_stream_construct(struct dc_stream_state *stream, · 55 unmodified lines
118118 update_stream_signal(stream, dc_sink_data);
119119
120120 stream->out_transfer_func = dc_create_transfer_func();
121+ if (stream->out_transfer_func == NULL) {
122+ dc_sink_release(dc_sink_data);
123+ return false;
124+ }
121125 stream->out_transfer_func->type = TF_TYPE_BYPASS;
122126 stream->out_transfer_func->ctx = stream->ctx;
123127
124128 stream->stream_id = stream->ctx->dc_stream_id_count;
125129 stream->ctx->dc_stream_id_count++;
130+
131+ return true;
126132 }
127133
128134 static void dc_stream_destruct(struct dc_stream_state *stream)
@@ -164,13 +170,20 @@ struct dc_stream_state *dc_create_stream_for_sink( · 35 unmodified lines
164170
165171 stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
166172 if (stream == NULL)
167− return NULL;
173+ goto alloc_fail;
168174
169− dc_stream_construct(stream, sink);
175+ if (dc_stream_construct(stream, sink) == false)
176+ goto construct_fail;
170177
171178 kref_init(&stream->refcount);
172179
173180 return stream;
181+
182+construct_fail:
183+ kfree(stream);
184+
185+alloc_fail:
186+ return NULL;
174187 }
175188
176189 struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c+1−1
@@ -689,7 +689,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u · 688 unmodified lines
689689 return -EINVAL;
690690 }
691691
692− ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetWorkloadMask,
692+ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_ActiveProcessNotify,
693693 1 << workload_type,
694694 NULL);
695695 if (ret) {
drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c+7−4
@@ -522,9 +522,11 @@ static int vega20_smu_init(struct pp_hwmgr *hwmgr) · 521 unmodified lines
522522 priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].version = 0x01;
523523 priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].size = sizeof(DpmActivityMonitorCoeffInt_t);
524524
525− ret = smu_v11_0_i2c_eeprom_control_init(&adev->pm.smu_i2c);
526− if (ret)
527− goto err4;
525+ if (adev->psp.ras.ras) {
526+ ret = smu_v11_0_i2c_eeprom_control_init(&adev->pm.smu_i2c);
527+ if (ret)
528+ goto err4;
529+ }
528530
529531 return 0;
530532
@@ -560,7 +562,8 @@ static int vega20_smu_fini(struct pp_hwmgr *hwmgr) · 29 unmodified lines
560562 (struct vega20_smumgr *)(hwmgr->smu_backend);
561563 struct amdgpu_device *adev = hwmgr->adev;
562564
563− smu_v11_0_i2c_eeprom_control_fini(&adev->pm.smu_i2c);
565+ if (adev->psp.ras.ras)
566+ smu_v11_0_i2c_eeprom_control_fini(&adev->pm.smu_i2c);
564567
565568 if (priv) {
566569 amdgpu_bo_free_kernel(&priv->smu_tables.entry[TABLE_PPTABLE].handle,
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c+1−2
@@ -173,8 +173,6 @@ static int aspeed_gfx_load(struct drm_device *drm) · 172 unmodified lines
173173
174174 drm_mode_config_reset(drm);
175175
176− drm_fbdev_generic_setup(drm, 32);
177−
178176 return 0;
179177 }
180178
@@ -225,6 +223,7 @@ static int aspeed_gfx_probe(struct platform_device *pdev) · 44 unmodified lines
225223 if (ret)
226224 goto err_unload;
227225
226+ drm_fbdev_generic_setup(&priv->drm, 32);
228227 return 0;
229228
230229 err_unload:
drivers/gpu/drm/drm_fb_helper.c+49−14
@@ -227,18 +227,9 @@ int drm_fb_helper_debug_leave(struct fb_info *info) · 226 unmodified lines
227227 }
228228 EXPORT_SYMBOL(drm_fb_helper_debug_leave);
229229
230−/**
231− * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration
232− * @fb_helper: driver-allocated fbdev helper, can be NULL
233− *
234− * This should be called from driver's drm &drm_driver.lastclose callback
235− * when implementing an fbcon on top of kms using this helper. This ensures that
236− * the user isn't greeted with a black screen when e.g. X dies.
237− *
238− * RETURNS:
239− * Zero if everything went ok, negative error code otherwise.
240− */
241−int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
230+static int
231+__drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper,
232+ bool force)
242233 {
243234 bool do_delayed;
244235 int ret;
@@ -250,7 +241,16 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper) · 5 unmodified lines
250241 return 0;
251242
252243 mutex_lock(&fb_helper->lock);
253− ret = drm_client_modeset_commit(&fb_helper->client);
244+ if (force) {
245+ /*
246+ * Yes this is the _locked version which expects the master lock
247+ * to be held. But for forced restores we're intentionally
248+ * racing here, see drm_fb_helper_set_par().
249+ */
250+ ret = drm_client_modeset_commit_locked(&fb_helper->client);
251+ } else {
252+ ret = drm_client_modeset_commit(&fb_helper->client);
253+ }
254254
255255 do_delayed = fb_helper->delayed_hotplug;
256256 if (do_delayed)
@@ -262,6 +262,22 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper) · 5 unmodified lines
262262
263263 return ret;
264264 }
265+
266+/**
267+ * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration
268+ * @fb_helper: driver-allocated fbdev helper, can be NULL
269+ *
270+ * This should be called from driver's drm &drm_driver.lastclose callback
271+ * when implementing an fbcon on top of kms using this helper. This ensures that
272+ * the user isn't greeted with a black screen when e.g. X dies.
273+ *
274+ * RETURNS:
275+ * Zero if everything went ok, negative error code otherwise.
276+ */
277+int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
278+{
279+ return __drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper, false);
280+}
265281 EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode_unlocked);
266282
267283 #ifdef CONFIG_MAGIC_SYSRQ
@@ -1318,6 +1334,7 @@ int drm_fb_helper_set_par(struct fb_info *info) · 1050 unmodified lines
13181334 {
13191335 struct drm_fb_helper *fb_helper = info->par;
13201336 struct fb_var_screeninfo *var = &info->var;
1337+ bool force;
13211338
13221339 if (oops_in_progress)
13231340 return -EBUSY;
@@ -1327,7 +1344,25 @@ int drm_fb_helper_set_par(struct fb_info *info) · 3 unmodified lines
13271344 return -EINVAL;
13281345 }
13291346
1330− drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
1347+ /*
1348+ * Normally we want to make sure that a kms master takes precedence over
1349+ * fbdev, to avoid fbdev flickering and occasionally stealing the
1350+ * display status. But Xorg first sets the vt back to text mode using
1351+ * the KDSET IOCTL with KD_TEXT, and only after that drops the master
1352+ * status when exiting.
1353+ *
1354+ * In the past this was caught by drm_fb_helper_lastclose(), but on
1355+ * modern systems where logind always keeps a drm fd open to orchestrate
1356+ * the vt switching, this doesn't work.
1357+ *
1358+ * To not break the userspace ABI we have this special case here, which
1359+ * is only used for the above case. Everything else uses the normal
1360+ * commit function, which ensures that we never steal the display from
1361+ * an active drm master.
1362+ */
1363+ force = var->activate & FB_ACTIVATE_KD_TEXT;
1364+
1365+ __drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper, force);
13311366
13321367 return 0;
13331368 }
drivers/gpu/drm/drm_panel_orientation_quirks.c+7−7
@@ -30,12 +30,6 @@ struct drm_dmi_panel_orientation_data { · 29 unmodified lines
3030 int orientation;
3131 };
3232
33−static const struct drm_dmi_panel_orientation_data acer_s1003 = {
34− .width = 800,
35− .height = 1280,
36− .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
37−};
38−
3933 static const struct drm_dmi_panel_orientation_data asus_t100ha = {
4034 .width = 800,
4135 .height = 1280,
@@ -114,13 +108,19 @@ static const struct dmi_system_id orientation_data[] = { · 72 unmodified lines
114108 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"),
115109 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"),
116110 },
117− .driver_data = (void *)&acer_s1003,
111+ .driver_data = (void *)&lcd800x1280_rightside_up,
118112 }, { /* Asus T100HA */
119113 .matches = {
120114 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
121115 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"),
122116 },
123117 .driver_data = (void *)&asus_t100ha,
118+ }, { /* Asus T101HA */
119+ .matches = {
120+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
121+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"),
122+ },
123+ .driver_data = (void *)&lcd800x1280_rightside_up,
124124 }, { /* GPD MicroPC (generic strings, also match on bios date) */
125125 .matches = {
126126 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"),
drivers/gpu/drm/exynos/exynos_drm_dma.c+2−2
@@ -61,7 +61,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, · 60 unmodified lines
6161 struct device *subdrv_dev, void **dma_priv)
6262 {
6363 struct exynos_drm_private *priv = drm_dev->dev_private;
64− int ret;
64+ int ret = 0;
6565
6666 if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
6767 DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
@@ -92,7 +92,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, · 24 unmodified lines
9292 if (ret)
9393 clear_dma_max_seg_size(subdrv_dev);
9494
95− return 0;
95+ return ret;
9696 }
9797
9898 /*
drivers/gpu/drm/exynos/exynos_drm_g2d.c+0−1
@@ -1498,7 +1498,6 @@ static int g2d_probe(struct platform_device *pdev) · 1497 unmodified lines
14981498
14991499 g2d->irq = platform_get_irq(pdev, 0);
15001500 if (g2d->irq < 0) {
1501− dev_err(dev, "failed to get irq\n");
15021501 ret = g2d->irq;
15031502 goto err_put_clk;
15041503 }
drivers/gpu/drm/exynos/exynos_drm_mic.c+3−1
@@ -269,8 +269,10 @@ static void mic_pre_enable(struct drm_bridge *bridge) · 268 unmodified lines
269269 goto unlock;
270270
271271 ret = pm_runtime_get_sync(mic->dev);
272− if (ret < 0)
272+ if (ret < 0) {
273+ pm_runtime_put_noidle(mic->dev);
273274 goto unlock;
275+ }
274276
275277 mic_set_path(mic, 1);
276278
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c+3−2
@@ -307,8 +307,6 @@ static int hibmc_load(struct drm_device *dev) · 306 unmodified lines
307307 /* reset all the states of crtc/plane/encoder/connector */
308308 drm_mode_config_reset(dev);
309309
310− drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
311−
312310 return 0;
313311
314312 err:
@@ -355,6 +353,9 @@ static int hibmc_pci_probe(struct pci_dev *pdev, · 40 unmodified lines
355353 ret);
356354 goto err_unload;
357355 }
356+
357+ drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
358+
358359 return 0;
359360
360361 err_unload:
drivers/gpu/drm/i915/display/intel_display.c+11−0
@@ -3822,6 +3822,17 @@ skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state, · 3821 unmodified lines
38223822 return true;
38233823 }
38243824
3825+unsigned int
3826+intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
3827+{
3828+ int x = 0, y = 0;
3829+
3830+ intel_plane_adjust_aligned_offset(&x, &y, plane_state, 0,
3831+ plane_state->color_plane[0].offset, 0);
3832+
3833+ return y;
3834+}
3835+
38253836 static int skl_check_main_surface(struct intel_plane_state *plane_state)
38263837 {
38273838 struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
drivers/gpu/drm/i915/display/intel_display.h+1−0
@@ -608,6 +608,7 @@ unsigned int i9xx_plane_max_stride(struct intel_plane *plane, · 607 unmodified lines
608608 u32 pixel_format, u64 modifier,
609609 unsigned int rotation);
610610 int bdw_get_pipemisc_bpp(struct intel_crtc *crtc);
611+unsigned int intel_plane_fence_y_offset(const struct intel_plane_state *plane_state);
611612
612613 struct intel_display_error_state *
613614 intel_display_capture_error_state(struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/display/intel_fbc.c+36−29
@@ -47,19 +47,6 @@ · 46 unmodified lines
4747 #include "intel_fbc.h"
4848 #include "intel_frontbuffer.h"
4949
50−/*
51− * In some platforms where the CRTC's x:0/y:0 coordinates doesn't match the
52− * frontbuffer's x:0/y:0 coordinates we lie to the hardware about the plane's
53− * origin so the x and y offsets can actually fit the registers. As a
54− * consequence, the fence doesn't really start exactly at the display plane
55− * address we program because it starts at the real start of the buffer, so we
56− * have to take this into consideration here.
57− */
58−static unsigned int get_crtc_fence_y_offset(struct intel_fbc *fbc)
59−{
60− return fbc->state_cache.plane.y - fbc->state_cache.plane.adjusted_y;
61−}
62−
6350 /*
6451 * For SKL+, the plane source size used by the hardware is based on the value we
6552 * write to the PLANE_SIZE register. For BDW-, the hardware looks at the value
@@ -141,7 +128,7 @@ static void i8xx_fbc_activate(struct drm_i915_private *dev_priv) · 75 unmodified lines
141128 fbc_ctl2 |= FBC_CTL_CPU_FENCE;
142129 intel_de_write(dev_priv, FBC_CONTROL2, fbc_ctl2);
143130 intel_de_write(dev_priv, FBC_FENCE_OFF,
144− params->crtc.fence_y_offset);
131+ params->fence_y_offset);
145132 }
146133
147134 /* enable it... */
@@ -175,7 +162,7 @@ static void g4x_fbc_activate(struct drm_i915_private *dev_priv) · 27 unmodified lines
175162 if (params->fence_id >= 0) {
176163 dpfc_ctl |= DPFC_CTL_FENCE_EN | params->fence_id;
177164 intel_de_write(dev_priv, DPFC_FENCE_YOFF,
178− params->crtc.fence_y_offset);
165+ params->fence_y_offset);
179166 } else {
180167 intel_de_write(dev_priv, DPFC_FENCE_YOFF, 0);
181168 }
@@ -243,7 +230,7 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv) · 61 unmodified lines
243230 intel_de_write(dev_priv, SNB_DPFC_CTL_SA,
244231 SNB_CPU_FENCE_ENABLE | params->fence_id);
245232 intel_de_write(dev_priv, DPFC_CPU_FENCE_OFFSET,
246− params->crtc.fence_y_offset);
233+ params->fence_y_offset);
247234 }
248235 } else {
249236 if (IS_GEN(dev_priv, 6)) {
@@ -253,7 +240,7 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv) · 3 unmodified lines
253240 }
254241
255242 intel_de_write(dev_priv, ILK_DPFC_FENCE_YOFF,
256− params->crtc.fence_y_offset);
243+ params->fence_y_offset);
257244 /* enable it... */
258245 intel_de_write(dev_priv, ILK_DPFC_CONTROL, dpfc_ctl | DPFC_CTL_EN);
259246
@@ -320,7 +307,7 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv) · 60 unmodified lines
320307 intel_de_write(dev_priv, SNB_DPFC_CTL_SA,
321308 SNB_CPU_FENCE_ENABLE | params->fence_id);
322309 intel_de_write(dev_priv, DPFC_CPU_FENCE_OFFSET,
323− params->crtc.fence_y_offset);
310+ params->fence_y_offset);
324311 } else if (dev_priv->ggtt.num_fences) {
325312 intel_de_write(dev_priv, SNB_DPFC_CTL_SA, 0);
326313 intel_de_write(dev_priv, DPFC_CPU_FENCE_OFFSET, 0);
@@ -631,8 +618,8 @@ static bool rotation_is_valid(struct drm_i915_private *dev_priv, · 304 unmodified lines
631618 /*
632619 * For some reason, the hardware tracking starts looking at whatever we
633620 * programmed as the display plane base address register. It does not look at
634− * the X and Y offset registers. That's why we look at the crtc->adjusted{x,y}
635− * variables instead of just looking at the pipe/plane size.
621+ * the X and Y offset registers. That's why we include the src x/y offsets
622+ * instead of just looking at the plane size.
636623 */
637624 static bool intel_fbc_hw_tracking_covers_screen(struct intel_crtc *crtc)
638625 {
@@ -705,7 +692,6 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, · 66 unmodified lines
705692 cache->plane.src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
706693 cache->plane.adjusted_x = plane_state->color_plane[0].x;
707694 cache->plane.adjusted_y = plane_state->color_plane[0].y;
708− cache->plane.y = plane_state->uapi.src.y1 >> 16;
709695
710696 cache->plane.pixel_blend_mode = plane_state->hw.pixel_blend_mode;
711697
@@ -713,6 +699,8 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, · 1 unmodified line
713699 cache->fb.stride = fb->pitches[0];
714700 cache->fb.modifier = fb->modifier;
715701
702+ cache->fence_y_offset = intel_plane_fence_y_offset(plane_state);
703+
716704 drm_WARN_ON(&dev_priv->drm, plane_state->flags & PLANE_HAS_FENCE &&
717705 !plane_state->vma->fence);
718706
@@ -731,6 +719,25 @@ static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv) · 12 unmodified lines
731719 fbc->compressed_fb.size * fbc->threshold;
732720 }
733721
722+static u16 intel_fbc_gen9_wa_cfb_stride(struct drm_i915_private *dev_priv)
723+{
724+ struct intel_fbc *fbc = &dev_priv->fbc;
725+ struct intel_fbc_state_cache *cache = &fbc->state_cache;
726+
727+ if ((IS_GEN9_BC(dev_priv) || IS_BROXTON(dev_priv)) &&
728+ cache->fb.modifier != I915_FORMAT_MOD_X_TILED)
729+ return DIV_ROUND_UP(cache->plane.src_w, 32 * fbc->threshold) * 8;
730+ else
731+ return 0;
732+}
733+
734+static bool intel_fbc_gen9_wa_cfb_stride_changed(struct drm_i915_private *dev_priv)
735+{
736+ struct intel_fbc *fbc = &dev_priv->fbc;
737+
738+ return fbc->params.gen9_wa_cfb_stride != intel_fbc_gen9_wa_cfb_stride(dev_priv);
739+}
740+
734741 static bool intel_fbc_can_enable(struct drm_i915_private *dev_priv)
735742 {
736743 struct intel_fbc *fbc = &dev_priv->fbc;
@@ -883,12 +890,13 @@ static void intel_fbc_get_reg_params(struct intel_crtc *crtc, · 146 unmodified lines
883890 memset(params, 0, sizeof(*params));
884891
885892 params->fence_id = cache->fence_id;
893+ params->fence_y_offset = cache->fence_y_offset;
886894
887895 params->crtc.pipe = crtc->pipe;
888896 params->crtc.i9xx_plane = to_intel_plane(crtc->base.primary)->i9xx_plane;
889− params->crtc.fence_y_offset = get_crtc_fence_y_offset(fbc);
890897
891898 params->fb.format = cache->fb.format;
899+ params->fb.modifier = cache->fb.modifier;
892900 params->fb.stride = cache->fb.stride;
893901
894902 params->cfb_size = intel_fbc_calculate_cfb_size(dev_priv, cache);
@@ -918,6 +926,9 @@ static bool intel_fbc_can_flip_nuke(const struct intel_crtc_state *crtc_state) · 23 unmodified lines
918926 if (params->fb.format != cache->fb.format)
919927 return false;
920928
929+ if (params->fb.modifier != cache->fb.modifier)
930+ return false;
931+
921932 if (params->fb.stride != cache->fb.stride)
922933 return false;
923934
@@ -1197,7 +1208,8 @@ void intel_fbc_enable(struct intel_atomic_state *state, · 273 unmodified lines
11971208
11981209 if (fbc->crtc) {
11991210 if (fbc->crtc != crtc ||
1200− !intel_fbc_cfb_size_changed(dev_priv))
1211+ (!intel_fbc_cfb_size_changed(dev_priv) &&
1212+ !intel_fbc_gen9_wa_cfb_stride_changed(dev_priv)))
12011213 goto out;
12021214
12031215 __intel_fbc_disable(dev_priv);
@@ -1219,12 +1231,7 @@ void intel_fbc_enable(struct intel_atomic_state *state, · 15 unmodified lines
12191231 goto out;
12201232 }
12211233
1222− if ((IS_GEN9_BC(dev_priv) || IS_BROXTON(dev_priv)) &&
1223− plane_state->hw.fb->modifier != I915_FORMAT_MOD_X_TILED)
1224− cache->gen9_wa_cfb_stride =
1225− DIV_ROUND_UP(cache->plane.src_w, 32 * fbc->threshold) * 8;
1226− else
1227− cache->gen9_wa_cfb_stride = 0;
1234+ cache->gen9_wa_cfb_stride = intel_fbc_gen9_wa_cfb_stride(dev_priv);
12281235
12291236 drm_dbg_kms(&dev_priv->drm, "Enabling FBC on pipe %c\n",
12301237 pipe_name(crtc->pipe));
drivers/gpu/drm/i915/display/intel_hdmi.c+2−8
@@ -2867,19 +2867,13 @@ intel_hdmi_connector_register(struct drm_connector *connector) · 2866 unmodified lines
28672867 return ret;
28682868 }
28692869
2870−static void intel_hdmi_destroy(struct drm_connector *connector)
2870+static void intel_hdmi_connector_unregister(struct drm_connector *connector)
28712871 {
28722872 struct cec_notifier *n = intel_attached_hdmi(to_intel_connector(connector))->cec_notifier;
28732873
28742874 cec_notifier_conn_unregister(n);
28752875
2876− intel_connector_destroy(connector);
2877−}
2878−
2879−static void intel_hdmi_connector_unregister(struct drm_connector *connector)
2880−{
28812876 intel_hdmi_remove_i2c_symlink(connector);
2882−
28832877 intel_connector_unregister(connector);
28842878 }
28852879
@@ -2891,7 +2885,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { · 5 unmodified lines
28912885 .atomic_set_property = intel_digital_connector_atomic_set_property,
28922886 .late_register = intel_hdmi_connector_register,
28932887 .early_unregister = intel_hdmi_connector_unregister,
2894− .destroy = intel_hdmi_destroy,
2888+ .destroy = intel_connector_destroy,
28952889 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
28962890 .atomic_duplicate_state = intel_digital_connector_duplicate_state,
28972891 };
drivers/gpu/drm/i915/gt/intel_context.c+6−6
@@ -204,25 +204,25 @@ static int __ring_active(struct intel_ring *ring) · 203 unmodified lines
204204 {
205205 int err;
206206
207− err = i915_active_acquire(&ring->vma->active);
207+ err = intel_ring_pin(ring);
208208 if (err)
209209 return err;
210210
211− err = intel_ring_pin(ring);
211+ err = i915_active_acquire(&ring->vma->active);
212212 if (err)
213− goto err_active;
213+ goto err_pin;
214214
215215 return 0;
216216
217−err_active:
218− i915_active_release(&ring->vma->active);
217+err_pin:
218+ intel_ring_unpin(ring);
219219 return err;
220220 }
221221
222222 static void __ring_retire(struct intel_ring *ring)
223223 {
224− intel_ring_unpin(ring);
225224 i915_active_release(&ring->vma->active);
225+ intel_ring_unpin(ring);
226226 }
227227
228228 __i915_active_call
drivers/gpu/drm/i915/gt/intel_lrc.c+5−14
@@ -5396,13 +5396,8 @@ static void virtual_engine_initial_hint(struct virtual_engine *ve) · 5395 unmodified lines
53965396 * typically be the first we inspect for submission.
53975397 */
53985398 swp = prandom_u32_max(ve->num_siblings);
5399− if (!swp)
5400− return;
5401−
5402− swap(ve->siblings[swp], ve->siblings[0]);
5403− if (!intel_engine_has_relative_mmio(ve->siblings[0]))
5404− virtual_update_register_offsets(ve->context.lrc_reg_state,
5405− ve->siblings[0]);
5399+ if (swp)
5400+ swap(ve->siblings[swp], ve->siblings[0]);
54065401 }
54075402
54085403 static int virtual_context_alloc(struct intel_context *ce)
@@ -5415,15 +5410,9 @@ static int virtual_context_alloc(struct intel_context *ce) · 6 unmodified lines
54155410 static int virtual_context_pin(struct intel_context *ce)
54165411 {
54175412 struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
5418− int err;
54195413
54205414 /* Note: we must use a real engine class for setting up reg state */
5421− err = __execlists_context_pin(ce, ve->siblings[0]);
5422− if (err)
5423− return err;
5424−
5425− virtual_engine_initial_hint(ve);
5426− return 0;
5415+ return __execlists_context_pin(ce, ve->siblings[0]);
54275416 }
54285417
54295418 static void virtual_context_enter(struct intel_context *ce)
@@ -5688,6 +5677,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, · 258 unmodified lines
56885677 intel_engine_init_active(&ve->base, ENGINE_VIRTUAL);
56895678 intel_engine_init_breadcrumbs(&ve->base);
56905679 intel_engine_init_execlists(&ve->base);
5680+ ve->base.breadcrumbs.irq_armed = true; /* fake HW, used for irq_work */
56915681
56925682 ve->base.cops = &virtual_context_ops;
56935683 ve->base.request_alloc = execlists_request_alloc;
@@ -5769,6 +5759,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, · 75 unmodified lines
57695759
57705760 ve->base.flags |= I915_ENGINE_IS_VIRTUAL;
57715761
5762+ virtual_engine_initial_hint(ve);
57725763 return &ve->context;
57735764
57745765 err_put:
drivers/gpu/drm/i915/gt/selftest_rps.c+4−4
@@ -44,9 +44,9 @@ static int cmp_u64(const void *A, const void *B) · 43 unmodified lines
4444 {
4545 const u64 *a = A, *b = B;
4646
47− if (a < b)
47+ if (*a < *b)
4848 return -1;
49− else if (a > b)
49+ else if (*a > *b)
5050 return 1;
5151 else
5252 return 0;
@@ -56,9 +56,9 @@ static int cmp_u32(const void *A, const void *B) · 3 unmodified lines
5656 {
5757 const u32 *a = A, *b = B;
5858
59− if (a < b)
59+ if (*a < *b)
6060 return -1;
61− else if (a > b)
61+ else if (*a > *b)
6262 return 1;
6363 else
6464 return 0;
drivers/gpu/drm/i915/gt/shaders/README+46−0
@@ -0,0 +1,46 @@
1+ASM sources for auto generated shaders
2+======================================
3+
4+The i915/gt/hsw_clear_kernel.c and i915/gt/ivb_clear_kernel.c files contain
5+pre-compiled batch chunks that will clear any residual render cache during
6+context switch.
7+
8+They are generated from their respective platform ASM files present on
9+i915/gt/shaders/clear_kernel directory.
10+
11+The generated .c files should never be modified directly. Instead, any modification
12+needs to be done on the on their respective ASM files and build instructions below
13+needes to be followed.
14+
15+Building
16+========
17+
18+Environment
19+-----------
20+
21+IGT GPU tool scripts and the Mesa's i965 instruction assembler tool are used
22+on building.
23+
24+Please make sure your Mesa tool is compiled with "-Dtools=intel" and
25+"-Ddri-drivers=i965", and run this script from IGT source root directory"
26+
27+The instructions bellow assume:
28+ * IGT gpu tools source code is located on your home directory (~) as ~/igt
29+ * Mesa source code is located on your home directory (~) as ~/mesa
30+ and built under the ~/mesa/build directory
31+ * Linux kernel source code is under your home directory (~) as ~/linux
32+
33+Instructions
34+------------
35+
36+~ $ cp ~/linux/drivers/gpu/drm/i915/gt/shaders/clear_kernel/ivb.asm \
37+ ~/igt/lib/i915/shaders/clear_kernel/ivb.asm
38+~ $ cd ~/igt
39+igt $ ./scripts/generate_clear_kernel.sh -g ivb \
40+ -m ~/mesa/build/src/intel/tools/i965_asm
41+
42+~ $ cp ~/linux/drivers/gpu/drm/i915/gt/shaders/clear_kernel/hsw.asm \
43+ ~/igt/lib/i915/shaders/clear_kernel/hsw.asm
44+~ $ cd ~/igt
45+igt $ ./scripts/generate_clear_kernel.sh -g hsw \
46+ -m ~/mesa/build/src/intel/tools/i965_asm
drivers/gpu/drm/i915/gt/shaders/clear_kernel/hsw.asm+119−0
@@ -0,0 +1,119 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright © 2020 Intel Corporation
4+ */
5+
6+/*
7+ * Kernel for PAVP buffer clear.
8+ *
9+ * 1. Clear all 64 GRF registers assigned to the kernel with designated value;
10+ * 2. Write 32x16 block of all "0" to render target buffer which indirectly clears
11+ * 512 bytes of Render Cache.
12+ */
13+
14+/* Store designated "clear GRF" value */
15+mov(1) f0.1<1>UW g1.2<0,1,0>UW { align1 1N };
16+
17+/**
18+ * Curbe Format
19+ *
20+ * DW 1.0 - Block Offset to write Render Cache
21+ * DW 1.1 [15:0] - Clear Word
22+ * DW 1.2 - Delay iterations
23+ * DW 1.3 - Enable Instrumentation (only for debug)
24+ * DW 1.4 - Rsvd (intended for context ID)
25+ * DW 1.5 - [31:16]:SliceCount, [15:0]:SubSlicePerSliceCount
26+ * DW 1.6 - Rsvd MBZ (intended for Enable Wait on Total Thread Count)
27+ * DW 1.7 - Rsvd MBZ (inteded for Total Thread Count)
28+ *
29+ * Binding Table
30+ *
31+ * BTI 0: 2D Surface to help clear L3 (Render/Data Cache)
32+ * BTI 1: Wait/Instrumentation Buffer
33+ * Size : (SliceCount * SubSliceCount * 16 EUs/SubSlice) rows * (16 threads/EU) cols (Format R32_UINT)
34+ * Expected to be initialized to 0 by driver/another kernel
35+ * Layout:
36+ * RowN: Histogram for EU-N: (SliceID*SubSlicePerSliceCount + SSID)*16 + EUID [assume max 16 EUs / SS]
37+ * Col-k[DW-k]: Threads Executed on ThreadID-k for EU-N
38+ */
39+add(1) g1.2<1>UD g1.2<0,1,0>UD 0x00000001UD { align1 1N }; /* Loop count to delay kernel: Init to (g1.2 + 1) */
40+cmp.z.f0.0(1) null<1>UD g1.3<0,1,0>UD 0x00000000UD { align1 1N };
41+(+f0.0) jmpi(1) 352D { align1 WE_all 1N };
42+
43+/**
44+ * State Register has info on where this thread is running
45+ * IVB: sr0.0 :: [15:13]: MBZ, 12: HSID (Half-Slice ID), [11:8]EUID, [2:0] ThreadSlotID
46+ * HSW: sr0.0 :: 15: MBZ, [14:13]: SliceID, 12: HSID (Half-Slice ID), [11:8]EUID, [2:0] ThreadSlotID
47+ */
48+mov(8) g3<1>UD 0x00000000UD { align1 1Q };
49+shr(1) g3<1>D sr0<0,1,0>D 12D { align1 1N };
50+and(1) g3<1>D g3<0,1,0>D 1D { align1 1N }; /* g3 has HSID */
51+shr(1) g3.1<1>D sr0<0,1,0>D 13D { align1 1N };
52+and(1) g3.1<1>D g3.1<0,1,0>D 3D { align1 1N }; /* g3.1 has sliceID */
53+mul(1) g3.5<1>D g3.1<0,1,0>D g1.10<0,1,0>UW { align1 1N };
54+add(1) g3<1>D g3<0,1,0>D g3.5<0,1,0>D { align1 1N }; /* g3 = sliceID * SubSlicePerSliceCount + HSID */
55+shr(1) g3.2<1>D sr0<0,1,0>D 8D { align1 1N };
56+and(1) g3.2<1>D g3.2<0,1,0>D 15D { align1 1N }; /* g3.2 = EUID */
57+mul(1) g3.4<1>D g3<0,1,0>D 16D { align1 1N };
58+add(1) g3.2<1>D g3.2<0,1,0>D g3.4<0,1,0>D { align1 1N }; /* g3.2 now points to EU row number (Y-pixel = V address ) in instrumentation surf */
59+
60+mov(8) g5<1>UD 0x00000000UD { align1 1Q };
61+and(1) g3.3<1>D sr0<0,1,0>D 7D { align1 1N };
62+mul(1) g3.3<1>D g3.3<0,1,0>D 4D { align1 1N };
63+
64+mov(8) g4<1>UD g0<8,8,1>UD { align1 1Q }; /* Initialize message header with g0 */
65+mov(1) g4<1>UD g3.3<0,1,0>UD { align1 1N }; /* Block offset */
66+mov(1) g4.1<1>UD g3.2<0,1,0>UD { align1 1N }; /* Block offset */
67+mov(1) g4.2<1>UD 0x00000003UD { align1 1N }; /* Block size (1 row x 4 bytes) */
68+and(1) g4.3<1>UD g4.3<0,1,0>UW 0xffffffffUD { align1 1N };
69+
70+/* Media block read to fetch current value at specified location in instrumentation buffer */
71+sendc(8) g5<1>UD g4<8,8,1>F 0x02190001
72+
73+ render MsgDesc: media block read MsgCtrl = 0x0 Surface = 1 mlen 1 rlen 1 { align1 1Q };
74+add(1) g5<1>D g5<0,1,0>D 1D { align1 1N };
75+
76+/* Media block write for updated value at specified location in instrumentation buffer */
77+sendc(8) g5<1>UD g4<8,8,1>F 0x040a8001
78+ render MsgDesc: media block write MsgCtrl = 0x0 Surface = 1 mlen 2 rlen 0 { align1 1Q };
79+
80+/* Delay thread for specified parameter */
81+add.nz.f0.0(1) g1.2<1>UD g1.2<0,1,0>UD -1D { align1 1N };
82+(+f0.0) jmpi(1) -32D { align1 WE_all 1N };
83+
84+/* Store designated "clear GRF" value */
85+mov(1) f0.1<1>UW g1.2<0,1,0>UW { align1 1N };
86+
87+/* Initialize looping parameters */
88+mov(1) a0<1>D 0D { align1 1N }; /* Initialize a0.0:w=0 */
89+mov(1) a0.4<1>W 127W { align1 1N }; /* Loop count. Each loop contains 16 GRF's */
90+
91+/* Write 32x16 all "0" block */
92+mov(8) g2<1>UD g0<8,8,1>UD { align1 1Q };
93+mov(8) g127<1>UD g0<8,8,1>UD { align1 1Q };
94+mov(2) g2<1>UD g1<2,2,1>UW { align1 1N };
95+mov(1) g2.2<1>UD 0x000f000fUD { align1 1N }; /* Block size (16x16) */
96+and(1) g2.3<1>UD g2.3<0,1,0>UW 0xffffffefUD { align1 1N };
97+mov(16) g3<1>UD 0x00000000UD { align1 1H };
98+mov(16) g4<1>UD 0x00000000UD { align1 1H };
99+mov(16) g5<1>UD 0x00000000UD { align1 1H };
100+mov(16) g6<1>UD 0x00000000UD { align1 1H };
101+mov(16) g7<1>UD 0x00000000UD { align1 1H };
102+mov(16) g8<1>UD 0x00000000UD { align1 1H };
103+mov(16) g9<1>UD 0x00000000UD { align1 1H };
104+mov(16) g10<1>UD 0x00000000UD { align1 1H };
105+sendc(8) null<1>UD g2<8,8,1>F 0x120a8000
106+ render MsgDesc: media block write MsgCtrl = 0x0 Surface = 0 mlen 9 rlen 0 { align1 1Q };
107+add(1) g2<1>UD g1<0,1,0>UW 0x0010UW { align1 1N };
108+sendc(8) null<1>UD g2<8,8,1>F 0x120a8000
109+ render MsgDesc: media block write MsgCtrl = 0x0 Surface = 0 mlen 9 rlen 0 { align1 1Q };
110+
111+/* Now, clear all GRF registers */
112+add.nz.f0.0(1) a0.4<1>W a0.4<0,1,0>W -1W { align1 1N };
113+mov(16) g[a0]<1>UW f0.1<0,1,0>UW { align1 1H };
114+add(1) a0<1>D a0<0,1,0>D 32D { align1 1N };
115+(+f0.0) jmpi(1) -64D { align1 WE_all 1N };
116+
117+/* Terminante the thread */
118+sendc(8) null<1>UD g127<8,8,1>F 0x82000010
119+ thread_spawner MsgDesc: mlen 1 rlen 0 { align1 1Q EOT };
drivers/gpu/drm/i915/gt/shaders/clear_kernel/ivb.asm+117−0
@@ -0,0 +1,117 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright © 2020 Intel Corporation
4+ */
5+
6+/*
7+ * Kernel for PAVP buffer clear.
8+ *
9+ * 1. Clear all 64 GRF registers assigned to the kernel with designated value;
10+ * 2. Write 32x16 block of all "0" to render target buffer which indirectly clears
11+ * 512 bytes of Render Cache.
12+ */
13+
14+/* Store designated "clear GRF" value */
15+mov(1) f0.1<1>UW g1.2<0,1,0>UW { align1 1N };
16+
17+/**
18+ * Curbe Format
19+ *
20+ * DW 1.0 - Block Offset to write Render Cache
21+ * DW 1.1 [15:0] - Clear Word
22+ * DW 1.2 - Delay iterations
23+ * DW 1.3 - Enable Instrumentation (only for debug)
24+ * DW 1.4 - Rsvd (intended for context ID)
25+ * DW 1.5 - [31:16]:SliceCount, [15:0]:SubSlicePerSliceCount
26+ * DW 1.6 - Rsvd MBZ (intended for Enable Wait on Total Thread Count)
27+ * DW 1.7 - Rsvd MBZ (inteded for Total Thread Count)
28+ *
29+ * Binding Table
30+ *
31+ * BTI 0: 2D Surface to help clear L3 (Render/Data Cache)
32+ * BTI 1: Wait/Instrumentation Buffer
33+ * Size : (SliceCount * SubSliceCount * 16 EUs/SubSlice) rows * (16 threads/EU) cols (Format R32_UINT)
34+ * Expected to be initialized to 0 by driver/another kernel
35+ * Layout :
36+ * RowN: Histogram for EU-N: (SliceID*SubSlicePerSliceCount + SSID)*16 + EUID [assume max 16 EUs / SS]
37+ * Col-k[DW-k]: Threads Executed on ThreadID-k for EU-N
38+ */
39+add(1) g1.2<1>UD g1.2<0,1,0>UD 0x00000001UD { align1 1N }; /* Loop count to delay kernel: Init to (g1.2 + 1) */
40+cmp.z.f0.0(1) null<1>UD g1.3<0,1,0>UD 0x00000000UD { align1 1N };
41+(+f0.0) jmpi(1) 44D { align1 WE_all 1N };
42+
43+/**
44+ * State Register has info on where this thread is running
45+ * IVB: sr0.0 :: [15:13]: MBZ, 12: HSID (Half-Slice ID), [11:8]EUID, [2:0] ThreadSlotID
46+ * HSW: sr0.0 :: 15: MBZ, [14:13]: SliceID, 12: HSID (Half-Slice ID), [11:8]EUID, [2:0] ThreadSlotID
47+ */
48+mov(8) g3<1>UD 0x00000000UD { align1 1Q };
49+shr(1) g3<1>D sr0<0,1,0>D 12D { align1 1N };
50+and(1) g3<1>D g3<0,1,0>D 1D { align1 1N }; /* g3 has HSID */
51+shr(1) g3.1<1>D sr0<0,1,0>D 13D { align1 1N };
52+and(1) g3.1<1>D g3.1<0,1,0>D 3D { align1 1N }; /* g3.1 has sliceID */
53+mul(1) g3.5<1>D g3.1<0,1,0>D g1.10<0,1,0>UW { align1 1N };
54+add(1) g3<1>D g3<0,1,0>D g3.5<0,1,0>D { align1 1N }; /* g3 = sliceID * SubSlicePerSliceCount + HSID */
55+shr(1) g3.2<1>D sr0<0,1,0>D 8D { align1 1N };
56+and(1) g3.2<1>D g3.2<0,1,0>D 15D { align1 1N }; /* g3.2 = EUID */
57+mul(1) g3.4<1>D g3<0,1,0>D 16D { align1 1N };
58+add(1) g3.2<1>D g3.2<0,1,0>D g3.4<0,1,0>D { align1 1N }; /* g3.2 now points to EU row number (Y-pixel = V address ) in instrumentation surf */
59+
60+mov(8) g5<1>UD 0x00000000UD { align1 1Q };
61+and(1) g3.3<1>D sr0<0,1,0>D 7D { align1 1N };
62+mul(1) g3.3<1>D g3.3<0,1,0>D 4D { align1 1N };
63+
64+mov(8) g4<1>UD g0<8,8,1>UD { align1 1Q }; /* Initialize message header with g0 */
65+mov(1) g4<1>UD g3.3<0,1,0>UD { align1 1N }; /* Block offset */
66+mov(1) g4.1<1>UD g3.2<0,1,0>UD { align1 1N }; /* Block offset */
67+mov(1) g4.2<1>UD 0x00000003UD { align1 1N }; /* Block size (1 row x 4 bytes) */
68+and(1) g4.3<1>UD g4.3<0,1,0>UW 0xffffffffUD { align1 1N };
69+
70+/* Media block read to fetch current value at specified location in instrumentation buffer */
71+sendc(8) g5<1>UD g4<8,8,1>F 0x02190001
72+ render MsgDesc: media block read MsgCtrl = 0x0 Surface = 1 mlen 1 rlen 1 { align1 1Q };
73+add(1) g5<1>D g5<0,1,0>D 1D { align1 1N };
74+
75+/* Media block write for updated value at specified location in instrumentation buffer */
76+sendc(8) g5<1>UD g4<8,8,1>F 0x040a8001
77+ render MsgDesc: media block write MsgCtrl = 0x0 Surface = 1 mlen 2 rlen 0 { align1 1Q };
78+/* Delay thread for specified parameter */
79+add.nz.f0.0(1) g1.2<1>UD g1.2<0,1,0>UD -1D { align1 1N };
80+(+f0.0) jmpi(1) -4D { align1 WE_all 1N };
81+
82+/* Store designated "clear GRF" value */
83+mov(1) f0.1<1>UW g1.2<0,1,0>UW { align1 1N };
84+
85+/* Initialize looping parameters */
86+mov(1) a0<1>D 0D { align1 1N }; /* Initialize a0.0:w=0 */
87+mov(1) a0.4<1>W 127W { align1 1N }; /* Loop count. Each loop contains 16 GRF's */
88+
89+/* Write 32x16 all "0" block */
90+mov(8) g2<1>UD g0<8,8,1>UD { align1 1Q };
91+mov(8) g127<1>UD g0<8,8,1>UD { align1 1Q };
92+mov(2) g2<1>UD g1<2,2,1>UW { align1 1N };
93+mov(1) g2.2<1>UD 0x000f000fUD { align1 1N }; /* Block size (16x16) */
94+and(1) g2.3<1>UD g2.3<0,1,0>UW 0xffffffefUD { align1 1N };
95+mov(16) g3<1>UD 0x00000000UD { align1 1H };
96+mov(16) g4<1>UD 0x00000000UD { align1 1H };
97+mov(16) g5<1>UD 0x00000000UD { align1 1H };
98+mov(16) g6<1>UD 0x00000000UD { align1 1H };
99+mov(16) g7<1>UD 0x00000000UD { align1 1H };
100+mov(16) g8<1>UD 0x00000000UD { align1 1H };
101+mov(16) g9<1>UD 0x00000000UD { align1 1H };
102+mov(16) g10<1>UD 0x00000000UD { align1 1H };
103+sendc(8) null<1>UD g2<8,8,1>F 0x120a8000
104+ render MsgDesc: media block write MsgCtrl = 0x0 Surface = 0 mlen 9 rlen 0 { align1 1Q };
105+add(1) g2<1>UD g1<0,1,0>UW 0x0010UW { align1 1N };
106+sendc(8) null<1>UD g2<8,8,1>F 0x120a8000
107+ render MsgDesc: media block write MsgCtrl = 0x0 Surface = 0 mlen 9 rlen 0 { align1 1Q };
108+
109+/* Now, clear all GRF registers */
110+add.nz.f0.0(1) a0.4<1>W a0.4<0,1,0>W -1W { align1 1N };
111+mov(16) g[a0]<1>UW f0.1<0,1,0>UW { align1 1H };
112+add(1) a0<1>D a0<0,1,0>D 32D { align1 1N };
113+(+f0.0) jmpi(1) -8D { align1 WE_all 1N };
114+
115+/* Terminante the thread */
116+sendc(8) null<1>UD g127<8,8,1>F 0x82000010
117+ thread_spawner MsgDesc: mlen 1 rlen 0 { align1 1Q EOT };
drivers/gpu/drm/i915/gvt/debugfs.c+1−1
@@ -66,7 +66,7 @@ static inline int mmio_diff_handler(struct intel_gvt *gvt, · 65 unmodified lines
6666 vreg = vgpu_vreg(param->vgpu, offset);
6767
6868 if (preg != vreg) {
69− node = kmalloc(sizeof(*node), GFP_KERNEL);
69+ node = kmalloc(sizeof(*node), GFP_ATOMIC);
7070 if (!node)
7171 return -ENOMEM;
7272
drivers/gpu/drm/i915/gvt/handlers.c+13−11
@@ -1726,13 +1726,13 @@ static int ring_mode_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, · 1725 unmodified lines
17261726 (*(u32 *)p_data) &= ~_MASKED_BIT_ENABLE(2);
17271727 write_vreg(vgpu, offset, p_data, bytes);
17281728
1729− if (data & _MASKED_BIT_ENABLE(1)) {
1729+ if (IS_MASKED_BITS_ENABLED(data, 1)) {
17301730 enter_failsafe_mode(vgpu, GVT_FAILSAFE_UNSUPPORTED_GUEST);
17311731 return 0;
17321732 }
17331733
17341734 if (IS_COFFEELAKE(vgpu->gvt->gt->i915) &&
1735− data & _MASKED_BIT_ENABLE(2)) {
1735+ IS_MASKED_BITS_ENABLED(data, 2)) {
17361736 enter_failsafe_mode(vgpu, GVT_FAILSAFE_UNSUPPORTED_GUEST);
17371737 return 0;
17381738 }
@@ -1741,14 +1741,14 @@ static int ring_mode_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, · 2 unmodified lines
17411741 * pvinfo, if not, we will treat this guest as non-gvtg-aware
17421742 * guest, and stop emulating its cfg space, mmio, gtt, etc.
17431743 */
1744− if (((data & _MASKED_BIT_ENABLE(GFX_PPGTT_ENABLE)) ||
1745− (data & _MASKED_BIT_ENABLE(GFX_RUN_LIST_ENABLE)))
1746− && !vgpu->pv_notified) {
1744+ if ((IS_MASKED_BITS_ENABLED(data, GFX_PPGTT_ENABLE) ||
1745+ IS_MASKED_BITS_ENABLED(data, GFX_RUN_LIST_ENABLE)) &&
1746+ !vgpu->pv_notified) {
17471747 enter_failsafe_mode(vgpu, GVT_FAILSAFE_UNSUPPORTED_GUEST);
17481748 return 0;
17491749 }
1750− if ((data & _MASKED_BIT_ENABLE(GFX_RUN_LIST_ENABLE))
1751− || (data & _MASKED_BIT_DISABLE(GFX_RUN_LIST_ENABLE))) {
1750+ if (IS_MASKED_BITS_ENABLED(data, GFX_RUN_LIST_ENABLE) ||
1751+ IS_MASKED_BITS_DISABLED(data, GFX_RUN_LIST_ENABLE)) {
17521752 enable_execlist = !!(data & GFX_RUN_LIST_ENABLE);
17531753
17541754 gvt_dbg_core("EXECLIST %s on ring %s\n",
@@ -1809,7 +1809,7 @@ static int ring_reset_ctl_write(struct intel_vgpu *vgpu, · 54 unmodified lines
18091809 write_vreg(vgpu, offset, p_data, bytes);
18101810 data = vgpu_vreg(vgpu, offset);
18111811
1812− if (data & _MASKED_BIT_ENABLE(RESET_CTL_REQUEST_RESET))
1812+ if (IS_MASKED_BITS_ENABLED(data, RESET_CTL_REQUEST_RESET))
18131813 data |= RESET_CTL_READY_TO_RESET;
18141814 else if (data & _MASKED_BIT_DISABLE(RESET_CTL_REQUEST_RESET))
18151815 data &= ~RESET_CTL_READY_TO_RESET;
@@ -1827,7 +1827,8 @@ static int csfe_chicken1_mmio_write(struct intel_vgpu *vgpu, · 11 unmodified lines
18271827 (*(u32 *)p_data) &= ~_MASKED_BIT_ENABLE(0x18);
18281828 write_vreg(vgpu, offset, p_data, bytes);
18291829
1830− if (data & _MASKED_BIT_ENABLE(0x10) || data & _MASKED_BIT_ENABLE(0x8))
1830+ if (IS_MASKED_BITS_ENABLED(data, 0x10) ||
1831+ IS_MASKED_BITS_ENABLED(data, 0x8))
18311832 enter_failsafe_mode(vgpu, GVT_FAILSAFE_UNSUPPORTED_GUEST);
18321833
18331834 return 0;
@@ -3055,6 +3056,7 @@ static int init_skl_mmio_info(struct intel_gvt *gvt) · 1221 unmodified lines
30553056 MMIO_D(_MMIO(0x72380), D_SKL_PLUS);
30563057 MMIO_D(_MMIO(0x7239c), D_SKL_PLUS);
30573058 MMIO_D(_MMIO(_PLANE_SURF_3_A), D_SKL_PLUS);
3059+ MMIO_D(_MMIO(_PLANE_SURF_3_B), D_SKL_PLUS);
30583060
30593061 MMIO_D(CSR_SSP_BASE, D_SKL_PLUS);
30603062 MMIO_D(CSR_HTP_SKL, D_SKL_PLUS);
@@ -3131,8 +3133,8 @@ static int init_skl_mmio_info(struct intel_gvt *gvt) · 70 unmodified lines
31313133 MMIO_DFH(GEN9_WM_CHICKEN3, D_SKL_PLUS, F_MODE_MASK | F_CMD_ACCESS,
31323134 NULL, NULL);
31333135
3134− MMIO_D(GAMT_CHKN_BIT_REG, D_KBL);
3135− MMIO_D(GEN9_CTX_PREEMPT_REG, D_KBL | D_SKL);
3136+ MMIO_D(GAMT_CHKN_BIT_REG, D_KBL | D_CFL);
3137+ MMIO_D(GEN9_CTX_PREEMPT_REG, D_SKL_PLUS);
31363138
31373139 return 0;
31383140 }
drivers/gpu/drm/i915/gvt/mmio_context.h+3−3
@@ -54,8 +54,8 @@ bool is_inhibit_context(struct intel_context *ce); · 53 unmodified lines
5454
5555 int intel_vgpu_restore_inhibit_context(struct intel_vgpu *vgpu,
5656 struct i915_request *req);
57−#define IS_RESTORE_INHIBIT(a) \
58− (_MASKED_BIT_ENABLE(CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT) == \
59− ((a) & _MASKED_BIT_ENABLE(CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT)))
57+
58+#define IS_RESTORE_INHIBIT(a) \
59+ IS_MASKED_BITS_ENABLED(a, CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT)
6060
6161 #endif
drivers/gpu/drm/i915/gvt/reg.h+5−0
@@ -94,6 +94,11 @@ · 93 unmodified lines
9494 #define GFX_MODE_BIT_SET_IN_MASK(val, bit) \
9595 ((((bit) & 0xffff0000) == 0) && !!((val) & (((bit) << 16))))
9696
97+#define IS_MASKED_BITS_ENABLED(_val, _b) \
98+ (((_val) & _MASKED_BIT_ENABLE(_b)) == _MASKED_BIT_ENABLE(_b))
99+#define IS_MASKED_BITS_DISABLED(_val, _b) \
100+ ((_val) & _MASKED_BIT_DISABLE(_b))
101+
97102 #define FORCEWAKE_RENDER_GEN9_REG 0xa278
98103 #define FORCEWAKE_ACK_RENDER_GEN9_REG 0x0D84
99104 #define FORCEWAKE_BLITTER_GEN9_REG 0xa188
drivers/gpu/drm/i915/i915_debugfs.c+1−1
@@ -230,7 +230,7 @@ static int per_file_stats(int id, void *ptr, void *data) · 229 unmodified lines
230230 struct file_stats *stats = data;
231231 struct i915_vma *vma;
232232
233− if (!kref_get_unless_zero(&obj->base.refcount))
233+ if (IS_ERR_OR_NULL(obj) || !kref_get_unless_zero(&obj->base.refcount))
234234 return 0;
235235
236236 stats->count++;
drivers/gpu/drm/i915/i915_drv.h+4−3
@@ -410,8 +410,6 @@ struct intel_fbc { · 409 unmodified lines
410410 int adjusted_x;
411411 int adjusted_y;
412412
413− int y;
414−
415413 u16 pixel_blend_mode;
416414 } plane;
417415
@@ -420,6 +418,8 @@ struct intel_fbc { · 2 unmodified lines
420418 unsigned int stride;
421419 u64 modifier;
422420 } fb;
421+
422+ unsigned int fence_y_offset;
423423 u16 gen9_wa_cfb_stride;
424424 s8 fence_id;
425425 } state_cache;
@@ -435,15 +435,16 @@ struct intel_fbc { · 9 unmodified lines
435435 struct {
436436 enum pipe pipe;
437437 enum i9xx_plane_id i9xx_plane;
438− unsigned int fence_y_offset;
439438 } crtc;
440439
441440 struct {
442441 const struct drm_format_info *format;
443442 unsigned int stride;
443+ u64 modifier;
444444 } fb;
445445
446446 int cfb_size;
447+ unsigned int fence_y_offset;
447448 u16 gen9_wa_cfb_stride;
448449 s8 fence_id;
449450 bool plane_visible;
drivers/gpu/drm/i915/i915_perf.c+1−0
@@ -1592,6 +1592,7 @@ static u32 *save_restore_register(struct i915_perf_stream *stream, u32 *cs, · 1591 unmodified lines
15921592 u32 d;
15931593
15941594 cmd = save ? MI_STORE_REGISTER_MEM : MI_LOAD_REGISTER_MEM;
1595+ cmd |= MI_SRM_LRM_GLOBAL_GTT;
15951596 if (INTEL_GEN(stream->perf->i915) >= 8)
15961597 cmd++;
15971598
drivers/gpu/drm/i915/i915_vma.c+6−9
@@ -104,6 +104,7 @@ vma_create(struct drm_i915_gem_object *obj, · 103 unmodified lines
104104 struct i915_address_space *vm,
105105 const struct i915_ggtt_view *view)
106106 {
107+ struct i915_vma *pos = ERR_PTR(-E2BIG);
107108 struct i915_vma *vma;
108109 struct rb_node *rb, **p;
109110
@@ -184,7 +185,6 @@ vma_create(struct drm_i915_gem_object *obj, · 74 unmodified lines
184185 rb = NULL;
185186 p = &obj->vma.tree.rb_node;
186187 while (*p) {
187− struct i915_vma *pos;
188188 long cmp;
189189
190190 rb = *p;
@@ -196,16 +196,12 @@ vma_create(struct drm_i915_gem_object *obj, · 5 unmodified lines
196196 * and dispose of ours.
197197 */
198198 cmp = i915_vma_compare(pos, vm, view);
199− if (cmp == 0) {
200− spin_unlock(&obj->vma.lock);
201− i915_vma_free(vma);
202− return pos;
203− }
204−
205199 if (cmp < 0)
206200 p = &rb->rb_right;
207− else
201+ else if (cmp > 0)
208202 p = &rb->rb_left;
203+ else
204+ goto err_unlock;
209205 }
210206 rb_link_node(&vma->obj_node, rb, p);
211207 rb_insert_color(&vma->obj_node, &obj->vma.tree);
@@ -228,8 +224,9 @@ vma_create(struct drm_i915_gem_object *obj, · 16 unmodified lines
228224 err_unlock:
229225 spin_unlock(&obj->vma.lock);
230226 err_vma:
227+ i915_vm_put(vm);
231228 i915_vma_free(vma);
232− return ERR_PTR(-E2BIG);
229+ return pos;
233230 }
234231
235232 static struct i915_vma *
drivers/gpu/drm/mcde/mcde_display.c+1−1
@@ -812,7 +812,7 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe, · 811 unmodified lines
812812 struct drm_crtc *crtc = &pipe->crtc;
813813 struct drm_plane *plane = &pipe->plane;
814814 struct drm_device *drm = crtc->dev;
815− struct mcde *mcde = drm->dev_private;
815+ struct mcde *mcde = to_mcde(drm);
816816 const struct drm_display_mode *mode = &cstate->mode;
817817 struct drm_framebuffer *fb = plane->state->fb;
818818 u32 format = fb->format->format;
drivers/gpu/drm/mcde/mcde_drv.c+2−1
@@ -209,7 +209,6 @@ static int mcde_modeset_init(struct drm_device *drm) · 208 unmodified lines
209209
210210 drm_mode_config_reset(drm);
211211 drm_kms_helper_poll_init(drm);
212− drm_fbdev_generic_setup(drm, 32);
213212
214213 return 0;
215214 }
@@ -264,6 +263,8 @@ static int mcde_drm_bind(struct device *dev) · 48 unmodified lines
264263 if (ret < 0)
265264 goto unbind;
266265
266+ drm_fbdev_generic_setup(drm, 32);
267+
267268 return 0;
268269
269270 unbind:
drivers/gpu/drm/mediatek/Kconfig+1−1
@@ -6,12 +6,12 @@ config DRM_MEDIATEK · 5 unmodified lines
66 depends on COMMON_CLK
77 depends on HAVE_ARM_SMCCC
88 depends on OF
9+ depends on MTK_MMSYS
910 select DRM_GEM_CMA_HELPER
1011 select DRM_KMS_HELPER
1112 select DRM_MIPI_DSI
1213 select DRM_PANEL
1314 select MEMORY
14− select MTK_MMSYS
1515 select MTK_SMI
1616 select VIDEOMODE_HELPERS
1717 help
drivers/gpu/drm/mediatek/mtk_drm_crtc.c+2−6
@@ -193,7 +193,6 @@ static int mtk_crtc_ddp_clk_enable(struct mtk_drm_crtc *mtk_crtc) · 192 unmodified lines
193193 int ret;
194194 int i;
195195
196− DRM_DEBUG_DRIVER("%s\n", __func__);
197196 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
198197 ret = clk_prepare_enable(mtk_crtc->ddp_comp[i]->clk);
199198 if (ret) {
@@ -213,7 +212,6 @@ static void mtk_crtc_ddp_clk_disable(struct mtk_drm_crtc *mtk_crtc) · 13 unmodified lines
213212 {
214213 int i;
215214
216− DRM_DEBUG_DRIVER("%s\n", __func__);
217215 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++)
218216 clk_disable_unprepare(mtk_crtc->ddp_comp[i]->clk);
219217 }
@@ -258,7 +256,6 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) · 38 unmodified lines
258256 int ret;
259257 int i;
260258
261− DRM_DEBUG_DRIVER("%s\n", __func__);
262259 if (WARN_ON(!crtc->state))
263260 return -EINVAL;
264261
@@ -299,7 +296,6 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) · 34 unmodified lines
299296 goto err_mutex_unprepare;
300297 }
301298
302− DRM_DEBUG_DRIVER("mediatek_ddp_ddp_path_setup\n");
303299 for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
304300 mtk_mmsys_ddp_connect(mtk_crtc->mmsys_dev,
305301 mtk_crtc->ddp_comp[i]->id,
@@ -349,7 +345,6 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc) · 43 unmodified lines
349345 struct drm_crtc *crtc = &mtk_crtc->base;
350346 int i;
351347
352− DRM_DEBUG_DRIVER("%s\n", __func__);
353348 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
354349 mtk_ddp_comp_stop(mtk_crtc->ddp_comp[i]);
355350 if (i == 1)
@@ -831,7 +826,8 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, · 475 unmodified lines
831826
832827 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
833828 mtk_crtc->cmdq_client =
834− cmdq_mbox_create(dev, drm_crtc_index(&mtk_crtc->base),
829+ cmdq_mbox_create(mtk_crtc->mmsys_dev,
830+ drm_crtc_index(&mtk_crtc->base),
835831 2000);
836832 if (IS_ERR(mtk_crtc->cmdq_client)) {
837833 dev_dbg(dev, "mtk_crtc %d failed to create mailbox client, writing register by CPU now\n",
drivers/gpu/drm/mediatek/mtk_drm_drv.c+2−4
@@ -444,7 +444,6 @@ static int mtk_drm_probe(struct platform_device *pdev) · 443 unmodified lines
444444 if (!private)
445445 return -ENOMEM;
446446
447− private->data = of_device_get_match_data(dev);
448447 private->mmsys_dev = dev->parent;
449448 if (!private->mmsys_dev) {
450449 dev_err(dev, "Failed to get MMSYS device\n");
@@ -514,7 +513,8 @@ static int mtk_drm_probe(struct platform_device *pdev) · 63 unmodified lines
514513 goto err_node;
515514 }
516515
517− ret = mtk_ddp_comp_init(dev, node, comp, comp_id, NULL);
516+ ret = mtk_ddp_comp_init(dev->parent, node, comp,
517+ comp_id, NULL);
518518 if (ret) {
519519 of_node_put(node);
520520 goto err_node;
@@ -571,7 +571,6 @@ static int mtk_drm_sys_suspend(struct device *dev) · 50 unmodified lines
571571 int ret;
572572
573573 ret = drm_mode_config_helper_suspend(drm);
574− DRM_DEBUG_DRIVER("mtk_drm_sys_suspend\n");
575574
576575 return ret;
577576 }
@@ -583,7 +582,6 @@ static int mtk_drm_sys_resume(struct device *dev) · 5 unmodified lines
583582 int ret;
584583
585584 ret = drm_mode_config_helper_resume(drm);
586− DRM_DEBUG_DRIVER("mtk_drm_sys_resume\n");
587585
588586 return ret;
589587 }
drivers/gpu/drm/mediatek/mtk_drm_plane.c+15−10
@@ -164,6 +164,16 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, · 163 unmodified lines
164164 true, true);
165165 }
166166
167+static void mtk_plane_atomic_disable(struct drm_plane *plane,
168+ struct drm_plane_state *old_state)
169+{
170+ struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
171+
172+ state->pending.enable = false;
173+ wmb(); /* Make sure the above parameter is set before update */
174+ state->pending.dirty = true;
175+}
176+
167177 static void mtk_plane_atomic_update(struct drm_plane *plane,
168178 struct drm_plane_state *old_state)
169179 {
@@ -178,6 +188,11 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, · 8 unmodified lines
178188 if (!crtc || WARN_ON(!fb))
179189 return;
180190
191+ if (!plane->state->visible) {
192+ mtk_plane_atomic_disable(plane, old_state);
193+ return;
194+ }
195+
181196 gem = fb->obj[0];
182197 mtk_gem = to_mtk_gem_obj(gem);
183198 addr = mtk_gem->dma_addr;
@@ -200,16 +215,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, · 16 unmodified lines
200215 state->pending.dirty = true;
201216 }
202217
203−static void mtk_plane_atomic_disable(struct drm_plane *plane,
204− struct drm_plane_state *old_state)
205−{
206− struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
207−
208− state->pending.enable = false;
209− wmb(); /* Make sure the above parameter is set before update */
210− state->pending.dirty = true;
211−}
212−
213218 static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = {
214219 .prepare_fb = drm_gem_fb_prepare_fb,
215220 .atomic_check = mtk_plane_atomic_check,
drivers/gpu/drm/mediatek/mtk_dsi.c+1−4
@@ -316,10 +316,7 @@ static void mtk_dsi_lane0_ulp_mode_leave(struct mtk_dsi *dsi) · 315 unmodified lines
316316
317317 static bool mtk_dsi_clk_hs_state(struct mtk_dsi *dsi)
318318 {
319− u32 tmp_reg1;
320−
321− tmp_reg1 = readl(dsi->regs + DSI_PHY_LCCON);
322− return ((tmp_reg1 & LC_HS_TX_EN) == 1) ? true : false;
319+ return readl(dsi->regs + DSI_PHY_LCCON) & LC_HS_TX_EN;
323320 }
324321
325322 static void mtk_dsi_clk_hs_mode(struct mtk_dsi *dsi, bool enter)
drivers/gpu/drm/mediatek/mtk_hdmi.c+1−11
@@ -1630,8 +1630,6 @@ static int mtk_hdmi_audio_startup(struct device *dev, void *data) · 1629 unmodified lines
16301630 {
16311631 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16321632
1633− dev_dbg(dev, "%s\n", __func__);
1634−
16351633 mtk_hdmi_audio_enable(hdmi);
16361634
16371635 return 0;
@@ -1641,8 +1639,6 @@ static void mtk_hdmi_audio_shutdown(struct device *dev, void *data) · 3 unmodified lines
16411639 {
16421640 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16431641
1644− dev_dbg(dev, "%s\n", __func__);
1645−
16461642 mtk_hdmi_audio_disable(hdmi);
16471643 }
16481644
@@ -1651,8 +1647,6 @@ mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable) · 2 unmodified lines
16511647 {
16521648 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16531649
1654− dev_dbg(dev, "%s(%d)\n", __func__, enable);
1655−
16561650 if (enable)
16571651 mtk_hdmi_hw_aud_mute(hdmi);
16581652 else
@@ -1665,8 +1659,6 @@ static int mtk_hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, · 6 unmodified lines
16651659 {
16661660 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16671661
1668− dev_dbg(dev, "%s\n", __func__);
1669−
16701662 memcpy(buf, hdmi->conn.eld, min(sizeof(hdmi->conn.eld), len));
16711663
16721664 return 0;
@@ -1766,7 +1758,6 @@ static int mtk_drm_hdmi_probe(struct platform_device *pdev) · 93 unmodified lines
17661758 goto err_bridge_remove;
17671759 }
17681760
1769− dev_dbg(dev, "mediatek hdmi probe success\n");
17701761 return 0;
17711762
17721763 err_bridge_remove:
@@ -1789,7 +1780,7 @@ static int mtk_hdmi_suspend(struct device *dev) · 16 unmodified lines
17891780 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
17901781
17911782 mtk_hdmi_clk_disable_audio(hdmi);
1792− dev_dbg(dev, "hdmi suspend success!\n");
1783+
17931784 return 0;
17941785 }
17951786
@@ -1804,7 +1795,6 @@ static int mtk_hdmi_resume(struct device *dev) · 8 unmodified lines
18041795 return ret;
18051796 }
18061797
1807− dev_dbg(dev, "hdmi resume success!\n");
18081798 return 0;
18091799 }
18101800 #endif
drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c+0−52
@@ -107,60 +107,10 @@ · 106 unmodified lines
107107 #define RGS_HDMITX_5T1_EDG (0xf << 4)
108108 #define RGS_HDMITX_PLUG_TST BIT(0)
109109
110−static const u8 PREDIV[3][4] = {
111− {0x0, 0x0, 0x0, 0x0}, /* 27Mhz */
112− {0x1, 0x1, 0x1, 0x1}, /* 74Mhz */
113− {0x1, 0x1, 0x1, 0x1} /* 148Mhz */
114−};
115−
116−static const u8 TXDIV[3][4] = {
117− {0x3, 0x3, 0x3, 0x2}, /* 27Mhz */
118− {0x2, 0x1, 0x1, 0x1}, /* 74Mhz */
119− {0x1, 0x0, 0x0, 0x0} /* 148Mhz */
120−};
121−
122−static const u8 FBKSEL[3][4] = {
123− {0x1, 0x1, 0x1, 0x1}, /* 27Mhz */
124− {0x1, 0x0, 0x1, 0x1}, /* 74Mhz */
125− {0x1, 0x0, 0x1, 0x1} /* 148Mhz */
126−};
127−
128−static const u8 FBKDIV[3][4] = {
129− {19, 24, 29, 19}, /* 27Mhz */
130− {19, 24, 14, 19}, /* 74Mhz */
131− {19, 24, 14, 19} /* 148Mhz */
132−};
133−
134−static const u8 DIVEN[3][4] = {
135− {0x2, 0x1, 0x1, 0x2}, /* 27Mhz */
136− {0x2, 0x2, 0x2, 0x2}, /* 74Mhz */
137− {0x2, 0x2, 0x2, 0x2} /* 148Mhz */
138−};
139−
140−static const u8 HTPLLBP[3][4] = {
141− {0xc, 0xc, 0x8, 0xc}, /* 27Mhz */
142− {0xc, 0xf, 0xf, 0xc}, /* 74Mhz */
143− {0xc, 0xf, 0xf, 0xc} /* 148Mhz */
144−};
145−
146−static const u8 HTPLLBC[3][4] = {
147− {0x2, 0x3, 0x3, 0x2}, /* 27Mhz */
148− {0x2, 0x3, 0x3, 0x2}, /* 74Mhz */
149− {0x2, 0x3, 0x3, 0x2} /* 148Mhz */
150−};
151−
152−static const u8 HTPLLBR[3][4] = {
153− {0x1, 0x1, 0x0, 0x1}, /* 27Mhz */
154− {0x1, 0x2, 0x2, 0x1}, /* 74Mhz */
155− {0x1, 0x2, 0x2, 0x1} /* 148Mhz */
156−};
157−
158110 static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
159111 {
160112 struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
161113
162− dev_dbg(hdmi_phy->dev, "%s\n", __func__);
163−
164114 mtk_hdmi_phy_set_bits(hdmi_phy, HDMI_CON1, RG_HDMITX_PLL_AUTOK_EN);
165115 mtk_hdmi_phy_set_bits(hdmi_phy, HDMI_CON0, RG_HDMITX_PLL_POSDIV);
166116 mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON3, RG_HDMITX_MHLCK_EN);
@@ -178,8 +128,6 @@ static void mtk_hdmi_pll_unprepare(struct clk_hw *hw) · 11 unmodified lines
178128 {
179129 struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
180130
181− dev_dbg(hdmi_phy->dev, "%s\n", __func__);
182−
183131 mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON1, RG_HDMITX_PLL_TXDIV_EN);
184132 mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON1, RG_HDMITX_PLL_BIAS_LPF_EN);
185133 usleep_range(100, 150);
drivers/gpu/drm/meson/meson_registers.h+6−0
@@ -261,6 +261,12 @@ · 260 unmodified lines
261261 #define VIU_OSD_FIFO_DEPTH_VAL(val) ((val & 0x7f) << 12)
262262 #define VIU_OSD_WORDS_PER_BURST(words) (((words & 0x4) >> 1) << 22)
263263 #define VIU_OSD_FIFO_LIMITS(size) ((size & 0xf) << 24)
264+#define VIU_OSD_BURST_LENGTH_24 (0x0 << 31 | 0x0 << 10)
265+#define VIU_OSD_BURST_LENGTH_32 (0x0 << 31 | 0x1 << 10)
266+#define VIU_OSD_BURST_LENGTH_48 (0x0 << 31 | 0x2 << 10)
267+#define VIU_OSD_BURST_LENGTH_64 (0x0 << 31 | 0x3 << 10)
268+#define VIU_OSD_BURST_LENGTH_96 (0x1 << 31 | 0x0 << 10)
269+#define VIU_OSD_BURST_LENGTH_128 (0x1 << 31 | 0x1 << 10)
264270
265271 #define VD1_IF0_GEN_REG 0x1a50
266272 #define VD1_IF0_CANVAS0 0x1a51
drivers/gpu/drm/meson/meson_viu.c+2−9
@@ -411,13 +411,6 @@ void meson_viu_gxm_disable_osd1_afbc(struct meson_drm *priv) · 410 unmodified lines
411411 priv->io_base + _REG(VIU_MISC_CTRL1));
412412 }
413413
414−static inline uint32_t meson_viu_osd_burst_length_reg(uint32_t length)
415−{
416− uint32_t val = (((length & 0x80) % 24) / 12);
417−
418− return (((val & 0x3) << 10) | (((val & 0x4) >> 2) << 31));
419−}
420−
421414 void meson_viu_init(struct meson_drm *priv)
422415 {
423416 uint32_t reg;
@@ -444,9 +437,9 @@ void meson_viu_init(struct meson_drm *priv) · 20 unmodified lines
444437 VIU_OSD_FIFO_LIMITS(2); /* fifo_lim: 2*16=32 */
445438
446439 if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A))
447− reg |= meson_viu_osd_burst_length_reg(32);
440+ reg |= VIU_OSD_BURST_LENGTH_32;
448441 else
449− reg |= meson_viu_osd_burst_length_reg(64);
442+ reg |= VIU_OSD_BURST_LENGTH_64;
450443
451444 writel_relaxed(reg, priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT));
452445 writel_relaxed(reg, priv->io_base + _REG(VIU_OSD2_FIFO_CTRL_STAT));
drivers/gpu/drm/msm/adreno/a2xx_gpu.c+1−1
@@ -408,7 +408,7 @@ a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev) · 407 unmodified lines
408408 struct msm_gem_address_space *aspace;
409409
410410 aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
411− SZ_16M + 0xfff * SZ_64K);
411+ 0xfff * SZ_64K);
412412
413413 if (IS_ERR(aspace) && !IS_ERR(mmu))
414414 mmu->funcs->destroy(mmu);
drivers/gpu/drm/msm/adreno/a6xx_gmu.c+1−1
@@ -1121,7 +1121,7 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu) · 1120 unmodified lines
11211121 return -ENODEV;
11221122
11231123 mmu = msm_iommu_new(gmu->dev, domain);
1124− gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x7fffffff);
1124+ gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x80000000);
11251125 if (IS_ERR(gmu->aspace)) {
11261126 iommu_domain_free(domain);
11271127 return PTR_ERR(gmu->aspace);
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+1−1
@@ -893,8 +893,8 @@ static const struct adreno_gpu_funcs funcs = { · 892 unmodified lines
893893 #if defined(CONFIG_DRM_MSM_GPU_STATE)
894894 .gpu_state_get = a6xx_gpu_state_get,
895895 .gpu_state_put = a6xx_gpu_state_put,
896− .create_address_space = adreno_iommu_create_address_space,
897896 #endif
897+ .create_address_space = adreno_iommu_create_address_space,
898898 },
899899 .get_timestamp = a6xx_get_timestamp,
900900 };
drivers/gpu/drm/msm/adreno/adreno_gpu.c+1−1
@@ -194,7 +194,7 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 193 unmodified lines
194194 struct msm_gem_address_space *aspace;
195195
196196 aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
197− 0xfffffff);
197+ 0xffffffff - SZ_16M);
198198
199199 if (IS_ERR(aspace) && !IS_ERR(mmu))
200200 mmu->funcs->destroy(mmu);
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c+11−7
@@ -521,7 +521,7 @@ static struct msm_display_topology dpu_encoder_get_topology( · 520 unmodified lines
521521 struct dpu_kms *dpu_kms,
522522 struct drm_display_mode *mode)
523523 {
524− struct msm_display_topology topology;
524+ struct msm_display_topology topology = {0};
525525 int i, intf_count = 0;
526526
527527 for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
@@ -537,7 +537,8 @@ static struct msm_display_topology dpu_encoder_get_topology( · 9 unmodified lines
537537 * 1 LM, 1 INTF
538538 * 2 LM, 1 INTF (stream merge to support high resolution interfaces)
539539 *
540− * Adding color blocks only to primary interface
540+ * Adding color blocks only to primary interface if available in
541+ * sufficient number
541542 */
542543 if (intf_count == 2)
543544 topology.num_lm = 2;
@@ -546,8 +547,11 @@ static struct msm_display_topology dpu_encoder_get_topology( · 2 unmodified lines
546547 else
547548 topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
548549
549− if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI)
550− topology.num_dspp = topology.num_lm;
550+ if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
551+ if (dpu_kms->catalog->dspp &&
552+ (dpu_kms->catalog->dspp_count >= topology.num_lm))
553+ topology.num_dspp = topology.num_lm;
554+ }
551555
552556 topology.num_enc = 0;
553557 topology.num_intf = intf_count;
@@ -2136,7 +2140,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, · 1582 unmodified lines
21362140
21372141 dpu_enc = to_dpu_encoder_virt(enc);
21382142
2139− mutex_init(&dpu_enc->enc_lock);
21402143 ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
21412144 if (ret)
21422145 goto fail;
@@ -2151,7 +2154,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, · 8 unmodified lines
21512154 0);
21522155
21532156
2154− mutex_init(&dpu_enc->rc_lock);
21552157 INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
21562158 dpu_encoder_off_work);
21572159 dpu_enc->idle_timeout = IDLE_TIMEOUT;
@@ -2183,7 +2185,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, · 25 unmodified lines
21832185
21842186 dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL);
21852187 if (!dpu_enc)
2186− return ERR_PTR(ENOMEM);
2188+ return ERR_PTR(-ENOMEM);
21872189
21882190 rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs,
21892191 drm_enc_mode, NULL);
@@ -2196,6 +2198,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, · 6 unmodified lines
21962198
21972199 spin_lock_init(&dpu_enc->enc_spinlock);
21982200 dpu_enc->enabled = false;
2201+ mutex_init(&dpu_enc->enc_lock);
2202+ mutex_init(&dpu_enc->rc_lock);
21992203
22002204 return &dpu_enc->base;
22012205 }
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c+1−1
@@ -780,7 +780,7 @@ static int _dpu_kms_mmu_init(struct dpu_kms *dpu_kms) · 779 unmodified lines
780780
781781 mmu = msm_iommu_new(dpu_kms->dev->dev, domain);
782782 aspace = msm_gem_address_space_create(mmu, "dpu1",
783− 0x1000, 0xfffffff);
783+ 0x1000, 0x100000000 - 0x1000);
784784
785785 if (IS_ERR(aspace)) {
786786 mmu->funcs->destroy(mmu);
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c+1−1
@@ -514,7 +514,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev) · 513 unmodified lines
514514 config->iommu);
515515
516516 aspace = msm_gem_address_space_create(mmu,
517− "mdp4", 0x1000, 0xffffffff);
517+ "mdp4", 0x1000, 0x100000000 - 0x1000);
518518
519519 if (IS_ERR(aspace)) {
520520 if (!IS_ERR(mmu))
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c+1−1
@@ -633,7 +633,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev) · 632 unmodified lines
633633 mmu = msm_iommu_new(iommu_dev, config->platform.iommu);
634634
635635 aspace = msm_gem_address_space_create(mmu, "mdp5",
636− 0x1000, 0xffffffff);
636+ 0x1000, 0x100000000 - 0x1000);
637637
638638 if (IS_ERR(aspace)) {
639639 if (!IS_ERR(mmu))
drivers/gpu/drm/msm/msm_submitqueue.c+3−1
@@ -71,8 +71,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, · 70 unmodified lines
7171 queue->flags = flags;
7272
7373 if (priv->gpu) {
74− if (prio >= priv->gpu->nr_rings)
74+ if (prio >= priv->gpu->nr_rings) {
75+ kfree(queue);
7576 return -EINVAL;
77+ }
7678
7779 queue->prio = prio;
7880 }
drivers/gpu/drm/nouveau/dispnv50/disp.c+3−0
@@ -601,6 +601,9 @@ nv50_audio_disable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc) · 600 unmodified lines
601601 (0x0100 << nv_crtc->index),
602602 };
603603
604+ if (!nv_encoder->audio)
605+ return;
606+
604607 nv_encoder->audio = false;
605608 nvif_mthd(&disp->disp->object, 0, &args, sizeof(args));
606609
drivers/gpu/drm/nouveau/nouveau_dmem.c+1−1
@@ -550,7 +550,7 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, · 549 unmodified lines
550550 DMA_BIDIRECTIONAL);
551551 if (dma_mapping_error(dev, *dma_addr))
552552 goto out_free_page;
553− if (drm->dmem->migrate.copy_func(drm, page_size(spage),
553+ if (drm->dmem->migrate.copy_func(drm, 1,
554554 NOUVEAU_APER_VRAM, paddr, NOUVEAU_APER_HOST, *dma_addr))
555555 goto out_dma_unmap;
556556 } else {
drivers/gpu/drm/nouveau/nouveau_svm.c+1−0
@@ -562,6 +562,7 @@ static int nouveau_range_fault(struct nouveau_svmm *svmm, · 561 unmodified lines
562562 .end = notifier->notifier.interval_tree.last + 1,
563563 .pfn_flags_mask = HMM_PFN_REQ_FAULT | HMM_PFN_REQ_WRITE,
564564 .hmm_pfns = hmm_pfns,
565+ .dev_private_owner = drm->dev,
565566 };
566567 struct mm_struct *mm = notifier->notifier.mm;
567568 int ret;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c+2−2
@@ -118,10 +118,10 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 117 unmodified lines
118118 if (retries)
119119 udelay(400);
120120
121− /* transaction request, wait up to 1ms for it to complete */
121+ /* transaction request, wait up to 2ms for it to complete */
122122 nvkm_wr32(device, 0x00e4e4 + base, 0x00010000 | ctrl);
123123
124− timeout = 1000;
124+ timeout = 2000;
125125 do {
126126 ctrl = nvkm_rd32(device, 0x00e4e4 + base);
127127 udelay(1);
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c+2−2
@@ -118,10 +118,10 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 117 unmodified lines
118118 if (retries)
119119 udelay(400);
120120
121− /* transaction request, wait up to 1ms for it to complete */
121+ /* transaction request, wait up to 2ms for it to complete */
122122 nvkm_wr32(device, 0x00d954 + base, 0x00010000 | ctrl);
123123
124− timeout = 1000;
124+ timeout = 2000;
125125 do {
126126 ctrl = nvkm_rd32(device, 0x00d954 + base);
127127 udelay(1);
drivers/gpu/drm/panel/panel-simple.c+2−0
@@ -2495,6 +2495,7 @@ static const struct panel_desc logicpd_type_28 = { · 2494 unmodified lines
24952495 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
24962496 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
24972497 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
2498+ .connector_type = DRM_MODE_CONNECTOR_DPI,
24982499 };
24992500
25002501 static const struct panel_desc mitsubishi_aa070mc01 = {
@@ -2663,6 +2664,7 @@ static const struct panel_desc newhaven_nhd_43_480272ef_atxl = { · 162 unmodified lines
26632664 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
26642665 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
26652666 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
2667+ .connector_type = DRM_MODE_CONNECTOR_DPI,
26662668 };
26672669
26682670 static const struct display_timing nlt_nl192108ac18_02d_timing = {
drivers/gpu/drm/radeon/ci_dpm.c+3−4
@@ -5563,6 +5563,7 @@ static int ci_parse_power_table(struct radeon_device *rdev) · 5562 unmodified lines
55635563 if (!rdev->pm.dpm.ps)
55645564 return -ENOMEM;
55655565 power_state_offset = (u8 *)state_array->states;
5566+ rdev->pm.dpm.num_ps = 0;
55665567 for (i = 0; i < state_array->ucNumEntries; i++) {
55675568 u8 *idx;
55685569 power_state = (union pplib_power_state *)power_state_offset;
@@ -5572,10 +5573,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) · 3 unmodified lines
55725573 if (!rdev->pm.power_state[i].clock_info)
55735574 return -EINVAL;
55745575 ps = kzalloc(sizeof(struct ci_ps), GFP_KERNEL);
5575− if (ps == NULL) {
5576− kfree(rdev->pm.dpm.ps);
5576+ if (ps == NULL)
55775577 return -ENOMEM;
5578− }
55795578 rdev->pm.dpm.ps[i].ps_priv = ps;
55805579 ci_parse_pplib_non_clock_info(rdev, &rdev->pm.dpm.ps[i],
55815580 non_clock_info,
@@ -5597,8 +5596,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) · 15 unmodified lines
55975596 k++;
55985597 }
55995598 power_state_offset += 2 + power_state->v2.ucNumDPMLevels;
5599+ rdev->pm.dpm.num_ps = i + 1;
56005600 }
5601− rdev->pm.dpm.num_ps = state_array->ucNumEntries;
56025601
56035602 /* fill in the vce power states */
56045603 for (i = 0; i < RADEON_MAX_VCE_LEVELS; i++) {
drivers/gpu/drm/radeon/ni_dpm.c+1−1
@@ -2127,7 +2127,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev) · 2126 unmodified lines
21272127 if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT))
21282128 ret = -EINVAL;
21292129
2130− if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT))
2130+ if (fb_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT))
21312131 ret = -EINVAL;
21322132
21332133 if (clk_v & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT))
drivers/gpu/drm/rcar-du/Kconfig+1−0
@@ -31,6 +31,7 @@ config DRM_RCAR_DW_HDMI · 30 unmodified lines
3131 config DRM_RCAR_LVDS
3232 tristate "R-Car DU LVDS Encoder Support"
3333 depends on DRM && DRM_BRIDGE && OF
34+ select DRM_KMS_HELPER
3435 select DRM_PANEL
3536 select OF_FLATTREE
3637 select OF_OVERLAY
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c+2−3
@@ -259,9 +259,8 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force) · 258 unmodified lines
259259 struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
260260 unsigned long reg;
261261
262− if (readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg,
263− reg & SUN4I_HDMI_HPD_HIGH,
264− 0, 500000)) {
262+ reg = readl(hdmi->base + SUN4I_HDMI_HPD_REG);
263+ if (reg & SUN4I_HDMI_HPD_HIGH) {
265264 cec_phys_addr_invalidate(hdmi->cec_adap);
266265 return connector_status_disconnected;
267266 }
drivers/gpu/drm/sun4i/sun8i_mixer.c+13−0
@@ -363,6 +363,19 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, · 362 unmodified lines
363363 mixer->engine.ops = &sun8i_engine_ops;
364364 mixer->engine.node = dev->of_node;
365365
366+ if (of_find_property(dev->of_node, "iommus", NULL)) {
367+ /*
368+ * This assume we have the same DMA constraints for
369+ * all our the mixers in our pipeline. This sounds
370+ * bad, but it has always been the case for us, and
371+ * DRM doesn't do per-device allocation either, so we
372+ * would need to fix DRM first...
373+ */
374+ ret = of_dma_configure(drm->dev, dev->of_node, true);
375+ if (ret)
376+ return ret;
377+ }
378+
366379 /*
367380 * While this function can fail, we shouldn't do anything
368381 * if this happens. Some early DE2 DT entries don't provide
drivers/gpu/drm/tegra/dc.c+1−0
@@ -957,6 +957,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm, · 956 unmodified lines
957957 }
958958
959959 drm_plane_helper_add(&plane->base, &tegra_cursor_plane_helper_funcs);
960+ drm_plane_create_zpos_immutable_property(&plane->base, 255);
960961
961962 return &plane->base;
962963 }
drivers/gpu/drm/tegra/hub.c+15−2
@@ -149,7 +149,9 @@ int tegra_display_hub_prepare(struct tegra_display_hub *hub) · 148 unmodified lines
149149 for (i = 0; i < hub->soc->num_wgrps; i++) {
150150 struct tegra_windowgroup *wgrp = &hub->wgrps[i];
151151
152− tegra_windowgroup_enable(wgrp);
152+ /* Skip orphaned window group whose parent DC is disabled */
153+ if (wgrp->parent)
154+ tegra_windowgroup_enable(wgrp);
153155 }
154156
155157 return 0;
@@ -166,7 +168,9 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub) · 10 unmodified lines
166168 for (i = 0; i < hub->soc->num_wgrps; i++) {
167169 struct tegra_windowgroup *wgrp = &hub->wgrps[i];
168170
169− tegra_windowgroup_disable(wgrp);
171+ /* Skip orphaned window group whose parent DC is disabled */
172+ if (wgrp->parent)
173+ tegra_windowgroup_disable(wgrp);
170174 }
171175 }
172176
@@ -944,6 +948,15 @@ static int tegra_display_hub_probe(struct platform_device *pdev) · 771 unmodified lines
944948 dev_err(&pdev->dev, "failed to register host1x client: %d\n",
945949 err);
946950
951+ err = devm_of_platform_populate(&pdev->dev);
952+ if (err < 0)
953+ goto unregister;
954+
955+ return err;
956+
957+unregister:
958+ host1x_client_unregister(&hub->client);
959+ pm_runtime_disable(&pdev->dev);
947960 return err;
948961 }
949962
drivers/gpu/drm/ttm/ttm_bo.c+3−1
@@ -883,8 +883,10 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo, · 882 unmodified lines
883883 if (!fence)
884884 return 0;
885885
886− if (no_wait_gpu)
886+ if (no_wait_gpu) {
887+ dma_fence_put(fence);
887888 return -EBUSY;
889+ }
888890
889891 dma_resv_add_shared_fence(bo->base.resv, fence);
890892
drivers/gpu/drm/ttm/ttm_bo_vm.c+2−0
@@ -300,8 +300,10 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf, · 299 unmodified lines
300300 break;
301301 case -EBUSY:
302302 case -ERESTARTSYS:
303+ dma_fence_put(moving);
303304 return VM_FAULT_NOPAGE;
304305 default:
306+ dma_fence_put(moving);
305307 return VM_FAULT_SIGBUS;
306308 }
307309
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c+4−4
@@ -1069,10 +1069,6 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, · 1068 unmodified lines
10691069 if (new_content_type != SAME_AS_DISPLAY) {
10701070 struct vmw_surface_metadata metadata = {0};
10711071
1072− metadata.base_size.width = hdisplay;
1073− metadata.base_size.height = vdisplay;
1074− metadata.base_size.depth = 1;
1075−
10761072 /*
10771073 * If content buffer is a buffer object, then we have to
10781074 * construct surface info
@@ -1104,6 +1100,10 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, · 25 unmodified lines
11041100 metadata = new_vfbs->surface->metadata;
11051101 }
11061102
1103+ metadata.base_size.width = hdisplay;
1104+ metadata.base_size.height = vdisplay;
1105+ metadata.base_size.depth = 1;
1106+
11071107 if (vps->surf) {
11081108 struct drm_vmw_size cur_base_size =
11091109 vps->surf->metadata.base_size;
drivers/gpu/host1x/bus.c+9−0
@@ -686,8 +686,17 @@ EXPORT_SYMBOL(host1x_driver_register_full); · 685 unmodified lines
686686 */
687687 void host1x_driver_unregister(struct host1x_driver *driver)
688688 {
689+ struct host1x *host1x;
690+
689691 driver_unregister(&driver->driver);
690692
693+ mutex_lock(&devices_lock);
694+
695+ list_for_each_entry(host1x, &devices, list)
696+ host1x_detach_driver(host1x, driver);
697+
698+ mutex_unlock(&devices_lock);
699+
691700 mutex_lock(&drivers_lock);
692701 list_del_init(&driver->list);
693702 mutex_unlock(&drivers_lock);
drivers/gpu/host1x/dev.c+9−2
@@ -468,11 +468,18 @@ static int host1x_probe(struct platform_device *pdev) · 467 unmodified lines
468468
469469 err = host1x_register(host);
470470 if (err < 0)
471− goto deinit_intr;
471+ goto deinit_debugfs;
472+
473+ err = devm_of_platform_populate(&pdev->dev);
474+ if (err < 0)
475+ goto unregister;
472476
473477 return 0;
474478
475−deinit_intr:
479+unregister:
480+ host1x_unregister(host);
481+deinit_debugfs:
482+ host1x_debug_deinit(host);
476483 host1x_intr_deinit(host);
477484 deinit_syncpt:
478485 host1x_syncpt_deinit(host);
drivers/hid/hid-alps.c+2−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #define U1_MOUSE_REPORT_ID 0x01 /* Mouse data ReportID */
2727 #define U1_ABSOLUTE_REPORT_ID 0x03 /* Absolute data ReportID */
28+#define U1_ABSOLUTE_REPORT_ID_SECD 0x02 /* FW-PTP Absolute data ReportID */
2829 #define U1_FEATURE_REPORT_ID 0x05 /* Feature ReportID */
2930 #define U1_SP_ABSOLUTE_REPORT_ID 0x06 /* Feature ReportID */
3031
@@ -368,6 +369,7 @@ static int u1_raw_event(struct alps_dev *hdata, u8 *data, int size) · 337 unmodified lines
368369 case U1_FEATURE_REPORT_ID:
369370 break;
370371 case U1_ABSOLUTE_REPORT_ID:
372+ case U1_ABSOLUTE_REPORT_ID_SECD:
371373 for (i = 0; i < hdata->max_fingers; i++) {
372374 u8 *contact = &data[i * 5];
373375
drivers/hid/hid-apple.c+18−0
@@ -60,6 +60,7 @@ MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. " · 59 unmodified lines
6060 struct apple_sc {
6161 unsigned long quirks;
6262 unsigned int fn_on;
63+ unsigned int fn_found;
6364 DECLARE_BITMAP(pressed_numlock, KEY_CNT);
6465 };
6566
@@ -365,12 +366,15 @@ static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 299 unmodified lines
365366 struct hid_field *field, struct hid_usage *usage,
366367 unsigned long **bit, int *max)
367368 {
369+ struct apple_sc *asc = hid_get_drvdata(hdev);
370+
368371 if (usage->hid == (HID_UP_CUSTOM | 0x0003) ||
369372 usage->hid == (HID_UP_MSVENDOR | 0x0003) ||
370373 usage->hid == (HID_UP_HPVENDOR2 | 0x0003)) {
371374 /* The fn key on Apple USB keyboards */
372375 set_bit(EV_REP, hi->input->evbit);
373376 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN);
377+ asc->fn_found = true;
374378 apple_setup_input(hi->input);
375379 return 1;
376380 }
@@ -397,6 +401,19 @@ static int apple_input_mapped(struct hid_device *hdev, struct hid_input *hi, · 20 unmodified lines
397401 return 0;
398402 }
399403
404+static int apple_input_configured(struct hid_device *hdev,
405+ struct hid_input *hidinput)
406+{
407+ struct apple_sc *asc = hid_get_drvdata(hdev);
408+
409+ if ((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) {
410+ hid_info(hdev, "Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling\n");
411+ asc->quirks = 0;
412+ }
413+
414+ return 0;
415+}
416+
400417 static int apple_probe(struct hid_device *hdev,
401418 const struct hid_device_id *id)
402419 {
@@ -611,6 +628,7 @@ static struct hid_driver apple_driver = { · 208 unmodified lines
611628 .event = apple_event,
612629 .input_mapping = apple_input_mapping,
613630 .input_mapped = apple_input_mapped,
631+ .input_configured = apple_input_configured,
614632 };
615633 module_hid_driver(apple_driver);
616634
drivers/hid/hid-ids.h+3−0
@@ -618,6 +618,7 @@ · 617 unmodified lines
618618 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081
619619 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2 0xa0c2
620620 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096
621+#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293 0xa293
621622
622623 #define USB_VENDOR_ID_IMATION 0x0718
623624 #define USB_DEVICE_ID_DISC_STAKKA 0xd000
@@ -998,6 +999,8 @@ · 374 unmodified lines
998999 #define USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO 0x3232
9991000 #define USB_DEVICE_ID_ROCCAT_SAVU 0x2d5a
10001001
1002+#define USB_VENDOR_ID_SAI 0x17dd
1003+
10011004 #define USB_VENDOR_ID_SAITEK 0x06a3
10021005 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17
10031006 #define USB_DEVICE_ID_SAITEK_PS1000 0x0621
drivers/hid/hid-logitech-dj.c+3−3
@@ -1153,7 +1153,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) · 1152 unmodified lines
11531153 if (!dj_report)
11541154 return -ENOMEM;
11551155 dj_report->report_id = REPORT_ID_DJ_SHORT;
1156− dj_report->device_index = 0xFF;
1156+ dj_report->device_index = HIDPP_RECEIVER_INDEX;
11571157 dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
11581158 retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
11591159 kfree(dj_report);
@@ -1175,7 +1175,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, · 15 unmodified lines
11751175
11761176 if (djrcv_dev->type == recvr_type_dj) {
11771177 dj_report->report_id = REPORT_ID_DJ_SHORT;
1178− dj_report->device_index = 0xFF;
1178+ dj_report->device_index = HIDPP_RECEIVER_INDEX;
11791179 dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
11801180 dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
11811181 dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] =
@@ -1204,7 +1204,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, · 22 unmodified lines
12041204 memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH);
12051205
12061206 buf[0] = REPORT_ID_HIDPP_SHORT;
1207− buf[1] = 0xFF;
1207+ buf[1] = HIDPP_RECEIVER_INDEX;
12081208 buf[2] = 0x80;
12091209 buf[3] = 0x00;
12101210 buf[4] = 0x00;
drivers/hid/hid-logitech-hidpp.c+1−1
@@ -3146,7 +3146,7 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp) · 3145 unmodified lines
31463146 multiplier = 1;
31473147
31483148 hidpp->vertical_wheel_counter.wheel_multiplier = multiplier;
3149− hid_info(hidpp->hid_dev, "multiplier = %d\n", multiplier);
3149+ hid_dbg(hidpp->hid_dev, "wheel multiplier = %d\n", multiplier);
31503150 return 0;
31513151 }
31523152
drivers/hid/hid-magicmouse.c+6−0
@@ -535,6 +535,12 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd · 534 unmodified lines
535535 __set_bit(MSC_RAW, input->mscbit);
536536 }
537537
538+ /*
539+ * hid-input may mark device as using autorepeat, but neither
540+ * the trackpad, nor the mouse actually want it.
541+ */
542+ __clear_bit(EV_REP, input->evbit);
543+
538544 return 0;
539545 }
540546
drivers/hid/hid-quirks.c+2−0
@@ -88,6 +88,7 @@ static const struct hid_device_id hid_quirks[] = { · 87 unmodified lines
8888 { HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
8989 { HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
9090 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096), HID_QUIRK_NO_INIT_REPORTS },
91+ { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293), HID_QUIRK_ALWAYS_POLL },
9192 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A), HID_QUIRK_ALWAYS_POLL },
9293 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL },
9394 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
@@ -832,6 +833,7 @@ static const struct hid_device_id hid_ignore_list[] = { · 738 unmodified lines
832833 { HID_USB_DEVICE(USB_VENDOR_ID_PETZL, USB_DEVICE_ID_PETZL_HEADLAMP) },
833834 { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) },
834835 { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
836+ { HID_USB_DEVICE(USB_VENDOR_ID_SAI, USB_DEVICE_ID_CYPRESS_HIDCOM) },
835837 #if IS_ENABLED(CONFIG_MOUSE_SYNAPTICS_USB)
836838 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP) },
837839 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_INT_TP) },
drivers/hid/hid-steam.c+4−2
@@ -526,7 +526,8 @@ static int steam_register(struct steam_device *steam) · 525 unmodified lines
526526 steam_battery_register(steam);
527527
528528 mutex_lock(&steam_devices_lock);
529− list_add(&steam->list, &steam_devices);
529+ if (list_empty(&steam->list))
530+ list_add(&steam->list, &steam_devices);
530531 mutex_unlock(&steam_devices_lock);
531532 }
532533
@@ -552,7 +553,7 @@ static void steam_unregister(struct steam_device *steam) · 19 unmodified lines
552553 hid_info(steam->hdev, "Steam Controller '%s' disconnected",
553554 steam->serial_no);
554555 mutex_lock(&steam_devices_lock);
555− list_del(&steam->list);
556+ list_del_init(&steam->list);
556557 mutex_unlock(&steam_devices_lock);
557558 steam->serial_no[0] = 0;
558559 }
@@ -738,6 +739,7 @@ static int steam_probe(struct hid_device *hdev, · 179 unmodified lines
738739 mutex_init(&steam->mutex);
739740 steam->quirks = id->driver_data;
740741 INIT_WORK(&steam->work_connect, steam_work_connect_cb);
742+ INIT_LIST_HEAD(&steam->list);
741743
742744 steam->client_hdev = steam_create_client_hid(hdev);
743745 if (IS_ERR(steam->client_hdev)) {
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c+8−0
@@ -373,6 +373,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { · 372 unmodified lines
373373 },
374374 .driver_data = (void *)&sipodev_desc
375375 },
376+ {
377+ .ident = "Mediacom FlexBook edge 13",
378+ .matches = {
379+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
380+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FlexBook_edge13-M-FBE13"),
381+ },
382+ .driver_data = (void *)&sipodev_desc
383+ },
376384 {
377385 .ident = "Odys Winbook 13",
378386 .matches = {
drivers/hv/vmbus_drv.c+1−1
@@ -1368,7 +1368,7 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper, · 1367 unmodified lines
13681368 * Write dump contents to the page. No need to synchronize; panic should
13691369 * be single-threaded.
13701370 */
1371− kmsg_dump_get_buffer(dumper, true, hv_panic_page, HV_HYP_PAGE_SIZE,
1371+ kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE,
13721372 &bytes_written);
13731373 if (bytes_written)
13741374 hyperv_report_panic_msg(panic_pa, bytes_written);
drivers/hwmon/acpi_power_meter.c+3−1
@@ -883,7 +883,7 @@ static int acpi_power_meter_add(struct acpi_device *device) · 882 unmodified lines
883883
884884 res = setup_attrs(resource);
885885 if (res)
886− goto exit_free;
886+ goto exit_free_capability;
887887
888888 resource->hwmon_dev = hwmon_device_register(&device->dev);
889889 if (IS_ERR(resource->hwmon_dev)) {
@@ -896,6 +896,8 @@ static int acpi_power_meter_add(struct acpi_device *device) · 6 unmodified lines
896896
897897 exit_remove:
898898 remove_attrs(resource);
899+exit_free_capability:
900+ free_capabilities(resource);
899901 exit_free:
900902 kfree(resource);
901903 exit:
drivers/hwmon/amd_energy.c+1−1
@@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = { · 361 unmodified lines
362362 static struct platform_device *amd_energy_platdev;
363363
364364 static const struct x86_cpu_id cpu_ids[] __initconst = {
365− X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
365+ X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
366366 {}
367367 };
368368 MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
drivers/hwmon/aspeed-pwm-tacho.c+2−0
@@ -851,6 +851,8 @@ static int aspeed_create_fan(struct device *dev, · 850 unmodified lines
851851 ret = of_property_read_u32(child, "reg", &pwm_port);
852852 if (ret)
853853 return ret;
854+ if (pwm_port >= ARRAY_SIZE(pwm_port_params))
855+ return -EINVAL;
854856 aspeed_create_pwm_port(priv, (u8)pwm_port);
855857
856858 ret = of_property_count_u8_elems(child, "cooling-levels");
drivers/hwmon/bt1-pvt.c+6−6
@@ -64,7 +64,7 @@ static const struct pvt_sensor_info pvt_info[] = { · 63 unmodified lines
6464 * 48380,
6565 * where T = [-48380, 147438] mC and N = [0, 1023].
6666 */
67−static const struct pvt_poly poly_temp_to_N = {
67+static const struct pvt_poly __maybe_unused poly_temp_to_N = {
6868 .total_divider = 10000,
6969 .terms = {
7070 {4, 18322, 10000, 10000},
@@ -96,7 +96,7 @@ static const struct pvt_poly poly_N_to_temp = { · 25 unmodified lines
9696 * N = (18658e-3*V - 11572) / 10,
9797 * V = N * 10^5 / 18658 + 11572 * 10^4 / 18658.
9898 */
99−static const struct pvt_poly poly_volt_to_N = {
99+static const struct pvt_poly __maybe_unused poly_volt_to_N = {
100100 .total_divider = 10,
101101 .terms = {
102102 {1, 18658, 1000, 1},
@@ -300,12 +300,12 @@ static irqreturn_t pvt_soft_isr(int irq, void *data) · 197 unmodified lines
300300 return IRQ_HANDLED;
301301 }
302302
303−inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
303+static inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
304304 {
305305 return 0644;
306306 }
307307
308−inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
308+static inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
309309 {
310310 return 0444;
311311 }
@@ -462,12 +462,12 @@ static irqreturn_t pvt_hard_isr(int irq, void *data) · 150 unmodified lines
462462
463463 #define pvt_soft_isr NULL
464464
465−inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
465+static inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
466466 {
467467 return 0;
468468 }
469469
470−inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
470+static inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
471471 {
472472 return 0;
473473 }
drivers/hwmon/drivetemp.c+43−0
@@ -285,6 +285,42 @@ static int drivetemp_get_scttemp(struct drivetemp_data *st, u32 attr, long *val) · 284 unmodified lines
285285 return err;
286286 }
287287
288+static const char * const sct_avoid_models[] = {
289+/*
290+ * These drives will have WRITE FPDMA QUEUED command timeouts and sometimes just
291+ * freeze until power-cycled under heavy write loads when their temperature is
292+ * getting polled in SCT mode. The SMART mode seems to be fine, though.
293+ *
294+ * While only the 3 TB model (DT01ACA3) was actually caught exhibiting the
295+ * problem let's play safe here to avoid data corruption and ban the whole
296+ * DT01ACAx family.
297+
298+ * The models from this array are prefix-matched.
299+ */
300+ "TOSHIBA DT01ACA",
301+};
302+
303+static bool drivetemp_sct_avoid(struct drivetemp_data *st)
304+{
305+ struct scsi_device *sdev = st->sdev;
306+ unsigned int ctr;
307+
308+ if (!sdev->model)
309+ return false;
310+
311+ /*
312+ * The "model" field contains just the raw SCSI INQUIRY response
313+ * "product identification" field, which has a width of 16 bytes.
314+ * This field is space-filled, but is NOT NULL-terminated.
315+ */
316+ for (ctr = 0; ctr < ARRAY_SIZE(sct_avoid_models); ctr++)
317+ if (!strncmp(sdev->model, sct_avoid_models[ctr],
318+ strlen(sct_avoid_models[ctr])))
319+ return true;
320+
321+ return false;
322+}
323+
288324 static int drivetemp_identify_sata(struct drivetemp_data *st)
289325 {
290326 struct scsi_device *sdev = st->sdev;
@@ -326,6 +362,13 @@ static int drivetemp_identify_sata(struct drivetemp_data *st) · 35 unmodified lines
326362 /* bail out if this is not a SATA device */
327363 if (!is_ata || !is_sata)
328364 return -ENODEV;
365+
366+ if (have_sct && drivetemp_sct_avoid(st)) {
367+ dev_notice(&sdev->sdev_gendev,
368+ "will avoid using SCT for temperature monitoring\n");
369+ have_sct = false;
370+ }
371+
329372 if (!have_sct)
330373 goto skip_sct;
331374
drivers/hwmon/emc2103.c+1−1
@@ -443,7 +443,7 @@ static ssize_t pwm1_enable_store(struct device *dev, · 442 unmodified lines
443443 }
444444
445445 result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg);
446− if (result) {
446+ if (result < 0) {
447447 count = result;
448448 goto err;
449449 }
drivers/hwmon/max6697.c+4−3
@@ -38,8 +38,9 @@ static const u8 MAX6697_REG_CRIT[] = { · 37 unmodified lines
3838 * Map device tree / platform data register bit map to chip bit map.
3939 * Applies to alert register and over-temperature register.
4040 */
41−#define MAX6697_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \
41+#define MAX6697_ALERT_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \
4242 (((reg) & 0x01) << 6) | ((reg) & 0x80))
43+#define MAX6697_OVERT_MAP_BITS(reg) (((reg) >> 1) | (((reg) & 0x01) << 7))
4344
4445 #define MAX6697_REG_STAT(n) (0x44 + (n))
4546
@@ -562,12 +563,12 @@ static int max6697_init_chip(struct max6697_data *data, · 516 unmodified lines
562563 return ret;
563564
564565 ret = i2c_smbus_write_byte_data(client, MAX6697_REG_ALERT_MASK,
565− MAX6697_MAP_BITS(pdata->alert_mask));
566+ MAX6697_ALERT_MAP_BITS(pdata->alert_mask));
566567 if (ret < 0)
567568 return ret;
568569
569570 ret = i2c_smbus_write_byte_data(client, MAX6697_REG_OVERT_MASK,
570− MAX6697_MAP_BITS(pdata->over_temperature_mask));
571+ MAX6697_OVERT_MAP_BITS(pdata->over_temperature_mask));
571572 if (ret < 0)
572573 return ret;
573574
drivers/hwmon/nct6775.c+3−3
@@ -786,13 +786,13 @@ static const char *const nct6798_temp_label[] = { · 785 unmodified lines
786786 "Agent1 Dimm1",
787787 "BYTE_TEMP0",
788788 "BYTE_TEMP1",
789− "",
790− "",
789+ "PECI Agent 0 Calibration", /* undocumented */
790+ "PECI Agent 1 Calibration", /* undocumented */
791791 "",
792792 "Virtual_TEMP"
793793 };
794794
795−#define NCT6798_TEMP_MASK 0x8fff0ffe
795+#define NCT6798_TEMP_MASK 0xbfff0ffe
796796 #define NCT6798_VIRT_TEMP_MASK 0x80000c00
797797
798798 /* NCT6102D/NCT6106D specific data */
drivers/hwmon/pmbus/Kconfig+1−1
@@ -71,7 +71,7 @@ config SENSORS_IR35221 · 70 unmodified lines
7171 Infineon IR35221 controller.
7272
7373 This driver can also be built as a module. If so, the module will
74− be called ir35521.
74+ be called ir35221.
7575
7676 config SENSORS_IR38064
7777 tristate "Infineon IR38064"
drivers/hwmon/pmbus/adm1275.c+8−2
@@ -465,6 +465,7 @@ MODULE_DEVICE_TABLE(i2c, adm1275_id); · 464 unmodified lines
465465 static int adm1275_probe(struct i2c_client *client,
466466 const struct i2c_device_id *id)
467467 {
468+ s32 (*config_read_fn)(const struct i2c_client *client, u8 reg);
468469 u8 block_buffer[I2C_SMBUS_BLOCK_MAX + 1];
469470 int config, device_config;
470471 int ret;
@@ -510,11 +511,16 @@ static int adm1275_probe(struct i2c_client *client, · 39 unmodified lines
510511 "Device mismatch: Configured %s, detected %s\n",
511512 id->name, mid->name);
512513
513− config = i2c_smbus_read_byte_data(client, ADM1275_PMON_CONFIG);
514+ if (mid->driver_data == adm1272 || mid->driver_data == adm1278 ||
515+ mid->driver_data == adm1293 || mid->driver_data == adm1294)
516+ config_read_fn = i2c_smbus_read_word_data;
517+ else
518+ config_read_fn = i2c_smbus_read_byte_data;
519+ config = config_read_fn(client, ADM1275_PMON_CONFIG);
514520 if (config < 0)
515521 return config;
516522
517− device_config = i2c_smbus_read_byte_data(client, ADM1275_DEVICE_CONFIG);
523+ device_config = config_read_fn(client, ADM1275_DEVICE_CONFIG);
518524 if (device_config < 0)
519525 return device_config;
520526
drivers/hwmon/pmbus/pmbus_core.c+4−4
@@ -1869,7 +1869,7 @@ static int pmbus_add_fan_ctrl(struct i2c_client *client, · 1868 unmodified lines
18691869 struct pmbus_sensor *sensor;
18701870
18711871 sensor = pmbus_add_sensor(data, "fan", "target", index, page,
1872− PMBUS_VIRT_FAN_TARGET_1 + id, 0xff, PSC_FAN,
1872+ 0xff, PMBUS_VIRT_FAN_TARGET_1 + id, PSC_FAN,
18731873 false, false, true);
18741874
18751875 if (!sensor)
@@ -1880,14 +1880,14 @@ static int pmbus_add_fan_ctrl(struct i2c_client *client, · 4 unmodified lines
18801880 return 0;
18811881
18821882 sensor = pmbus_add_sensor(data, "pwm", NULL, index, page,
1883− PMBUS_VIRT_PWM_1 + id, 0xff, PSC_PWM,
1883+ 0xff, PMBUS_VIRT_PWM_1 + id, PSC_PWM,
18841884 false, false, true);
18851885
18861886 if (!sensor)
18871887 return -ENOMEM;
18881888
18891889 sensor = pmbus_add_sensor(data, "pwm", "enable", index, page,
1890− PMBUS_VIRT_PWM_ENABLE_1 + id, 0xff, PSC_PWM,
1890+ 0xff, PMBUS_VIRT_PWM_ENABLE_1 + id, PSC_PWM,
18911891 true, false, false);
18921892
18931893 if (!sensor)
@@ -1929,7 +1929,7 @@ static int pmbus_add_fan_attributes(struct i2c_client *client, · 35 unmodified lines
19291929 continue;
19301930
19311931 if (pmbus_add_sensor(data, "fan", "input", index,
1932− page, pmbus_fan_registers[f], 0xff,
1932+ page, 0xff, pmbus_fan_registers[f],
19331933 PSC_FAN, true, true, true) == NULL)
19341934 return -ENOMEM;
19351935
drivers/hwmon/scmi-hwmon.c+1−1
@@ -147,7 +147,7 @@ static enum hwmon_sensor_types scmi_types[] = { · 146 unmodified lines
147147 [ENERGY] = hwmon_energy,
148148 };
149149
150−static u32 hwmon_attributes[] = {
150+static u32 hwmon_attributes[hwmon_max] = {
151151 [hwmon_chip] = HWMON_C_REGISTER_TZ,
152152 [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL,
153153 [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL,
drivers/hwtracing/coresight/coresight-cti.c+54−42
@@ -747,17 +747,50 @@ static int cti_dying_cpu(unsigned int cpu) · 746 unmodified lines
747747 return 0;
748748 }
749749
750+static int cti_pm_setup(struct cti_drvdata *drvdata)
751+{
752+ int ret;
753+
754+ if (drvdata->ctidev.cpu == -1)
755+ return 0;
756+
757+ if (nr_cti_cpu)
758+ goto done;
759+
760+ cpus_read_lock();
761+ ret = cpuhp_setup_state_nocalls_cpuslocked(
762+ CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
763+ "arm/coresight_cti:starting",
764+ cti_starting_cpu, cti_dying_cpu);
765+ if (ret) {
766+ cpus_read_unlock();
767+ return ret;
768+ }
769+
770+ ret = cpu_pm_register_notifier(&cti_cpu_pm_nb);
771+ cpus_read_unlock();
772+ if (ret) {
773+ cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
774+ return ret;
775+ }
776+
777+done:
778+ nr_cti_cpu++;
779+ cti_cpu_drvdata[drvdata->ctidev.cpu] = drvdata;
780+
781+ return 0;
782+}
783+
750784 /* release PM registrations */
751785 static void cti_pm_release(struct cti_drvdata *drvdata)
752786 {
753− if (drvdata->ctidev.cpu >= 0) {
754− if (--nr_cti_cpu == 0) {
755− cpu_pm_unregister_notifier(&cti_cpu_pm_nb);
787+ if (drvdata->ctidev.cpu == -1)
788+ return;
756789
757− cpuhp_remove_state_nocalls(
758− CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
759− }
760− cti_cpu_drvdata[drvdata->ctidev.cpu] = NULL;
790+ cti_cpu_drvdata[drvdata->ctidev.cpu] = NULL;
791+ if (--nr_cti_cpu == 0) {
792+ cpu_pm_unregister_notifier(&cti_cpu_pm_nb);
793+ cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
761794 }
762795 }
763796
@@ -823,19 +856,14 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 59 unmodified lines
823856
824857 /* driver data*/
825858 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
826− if (!drvdata) {
827− ret = -ENOMEM;
828− dev_info(dev, "%s, mem err\n", __func__);
829− goto err_out;
830− }
859+ if (!drvdata)
860+ return -ENOMEM;
831861
832862 /* Validity for the resource is already checked by the AMBA core */
833863 base = devm_ioremap_resource(dev, res);
834− if (IS_ERR(base)) {
835− ret = PTR_ERR(base);
836− dev_err(dev, "%s, remap err\n", __func__);
837− goto err_out;
838− }
864+ if (IS_ERR(base))
865+ return PTR_ERR(base);
866+
839867 drvdata->base = base;
840868
841869 dev_set_drvdata(dev, drvdata);
@@ -854,8 +882,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 12 unmodified lines
854882 pdata = coresight_cti_get_platform_data(dev);
855883 if (IS_ERR(pdata)) {
856884 dev_err(dev, "coresight_cti_get_platform_data err\n");
857− ret = PTR_ERR(pdata);
858− goto err_out;
885+ return PTR_ERR(pdata);
859886 }
860887
861888 /* default to powered - could change on PM notifications */
@@ -867,35 +894,20 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 5 unmodified lines
867894 drvdata->ctidev.cpu);
868895 else
869896 cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev);
870− if (!cti_desc.name) {
871− ret = -ENOMEM;
872− goto err_out;
873− }
897+ if (!cti_desc.name)
898+ return -ENOMEM;
874899
875900 /* setup CPU power management handling for CPU bound CTI devices. */
876− if (drvdata->ctidev.cpu >= 0) {
877− cti_cpu_drvdata[drvdata->ctidev.cpu] = drvdata;
878− if (!nr_cti_cpu++) {
879− cpus_read_lock();
880− ret = cpuhp_setup_state_nocalls_cpuslocked(
881− CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
882− "arm/coresight_cti:starting",
883− cti_starting_cpu, cti_dying_cpu);
884−
885− if (!ret)
886− ret = cpu_pm_register_notifier(&cti_cpu_pm_nb);
887− cpus_read_unlock();
888− if (ret)
889− goto err_out;
890− }
891− }
901+ ret = cti_pm_setup(drvdata);
902+ if (ret)
903+ return ret;
892904
893905 /* create dynamic attributes for connections */
894906 ret = cti_create_cons_sysfs(dev, drvdata);
895907 if (ret) {
896908 dev_err(dev, "%s: create dynamic sysfs entries failed\n",
897909 cti_desc.name);
898− goto err_out;
910+ goto pm_release;
899911 }
900912
901913 /* set up coresight component description */
@@ -908,7 +920,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 6 unmodified lines
908920 drvdata->csdev = coresight_register(&cti_desc);
909921 if (IS_ERR(drvdata->csdev)) {
910922 ret = PTR_ERR(drvdata->csdev);
911− goto err_out;
923+ goto pm_release;
912924 }
913925
914926 /* add to list of CTI devices */
@@ -927,7 +939,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 12 unmodified lines
927939 dev_info(&drvdata->csdev->dev, "CTI initialized\n");
928940 return 0;
929941
930−err_out:
942+pm_release:
931943 cti_pm_release(drvdata);
932944 return ret;
933945 }
drivers/hwtracing/coresight/coresight-etm4x.c+53−29
@@ -1388,18 +1388,57 @@ static struct notifier_block etm4_cpu_pm_nb = { · 1387 unmodified lines
13881388 .notifier_call = etm4_cpu_pm_notify,
13891389 };
13901390
1391−static int etm4_cpu_pm_register(void)
1391+/* Setup PM. Called with cpus locked. Deals with error conditions and counts */
1392+static int etm4_pm_setup_cpuslocked(void)
13921393 {
1393− if (IS_ENABLED(CONFIG_CPU_PM))
1394− return cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1394+ int ret;
13951395
1396− return 0;
1396+ if (etm4_count++)
1397+ return 0;
1398+
1399+ ret = cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1400+ if (ret)
1401+ goto reduce_count;
1402+
1403+ ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
1404+ "arm/coresight4:starting",
1405+ etm4_starting_cpu, etm4_dying_cpu);
1406+
1407+ if (ret)
1408+ goto unregister_notifier;
1409+
1410+ ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
1411+ "arm/coresight4:online",
1412+ etm4_online_cpu, NULL);
1413+
1414+ /* HP dyn state ID returned in ret on success */
1415+ if (ret > 0) {
1416+ hp_online = ret;
1417+ return 0;
1418+ }
1419+
1420+ /* failed dyn state - remove others */
1421+ cpuhp_remove_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING);
1422+
1423+unregister_notifier:
1424+ cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1425+
1426+reduce_count:
1427+ --etm4_count;
1428+ return ret;
13971429 }
13981430
1399−static void etm4_cpu_pm_unregister(void)
1431+static void etm4_pm_clear(void)
14001432 {
1401− if (IS_ENABLED(CONFIG_CPU_PM))
1402− cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1433+ if (--etm4_count != 0)
1434+ return;
1435+
1436+ cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1437+ cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING);
1438+ if (hp_online) {
1439+ cpuhp_remove_state_nocalls(hp_online);
1440+ hp_online = 0;
1441+ }
14031442 }
14041443
14051444 static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
@@ -1453,24 +1492,15 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) · 47 unmodified lines
14531492 etm4_init_arch_data, drvdata, 1))
14541493 dev_err(dev, "ETM arch init failed\n");
14551494
1456− if (!etm4_count++) {
1457− cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
1458− "arm/coresight4:starting",
1459− etm4_starting_cpu, etm4_dying_cpu);
1460− ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
1461− "arm/coresight4:online",
1462− etm4_online_cpu, NULL);
1463− if (ret < 0)
1464− goto err_arch_supported;
1465− hp_online = ret;
1495+ ret = etm4_pm_setup_cpuslocked();
1496+ cpus_read_unlock();
14661497
1467− ret = etm4_cpu_pm_register();
1468− if (ret)
1469− goto err_arch_supported;
1498+ /* etm4_pm_setup_cpuslocked() does its own cleanup - exit on error */
1499+ if (ret) {
1500+ etmdrvdata[drvdata->cpu] = NULL;
1501+ return ret;
14701502 }
14711503
1472− cpus_read_unlock();
1473−
14741504 if (etm4_arch_supported(drvdata->arch) == false) {
14751505 ret = -EINVAL;
14761506 goto err_arch_supported;
@@ -1517,13 +1547,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) · 40 unmodified lines
15171547
15181548 err_arch_supported:
15191549 etmdrvdata[drvdata->cpu] = NULL;
1520− if (--etm4_count == 0) {
1521− etm4_cpu_pm_unregister();
1522−
1523− cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING);
1524− if (hp_online)
1525− cpuhp_remove_state_nocalls(hp_online);
1526− }
1550+ etm4_pm_clear();
15271551 return ret;
15281552 }
15291553
drivers/hwtracing/intel_th/core.c+18−3
@@ -1021,15 +1021,30 @@ int intel_th_set_output(struct intel_th_device *thdev, · 1020 unmodified lines
10211021 {
10221022 struct intel_th_device *hub = to_intel_th_hub(thdev);
10231023 struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
1024+ int ret;
10241025
10251026 /* In host mode, this is up to the external debugger, do nothing. */
10261027 if (hub->host_mode)
10271028 return 0;
10281029
1029− if (!hubdrv->set_output)
1030− return -ENOTSUPP;
1030+ /*
1031+ * hub is instantiated together with the source device that
1032+ * calls here, so guaranteed to be present.
1033+ */
1034+ hubdrv = to_intel_th_driver(hub->dev.driver);
1035+ if (!hubdrv || !try_module_get(hubdrv->driver.owner))
1036+ return -EINVAL;
1037+
1038+ if (!hubdrv->set_output) {
1039+ ret = -ENOTSUPP;
1040+ goto out;
1041+ }
1042+
1043+ ret = hubdrv->set_output(hub, master);
10311044
1032− return hubdrv->set_output(hub, master);
1045+out:
1046+ module_put(hubdrv->driver.owner);
1047+ return ret;
10331048 }
10341049 EXPORT_SYMBOL_GPL(intel_th_set_output);
10351050
drivers/hwtracing/intel_th/pci.c+15−0
@@ -233,11 +233,21 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 232 unmodified lines
233233 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
234234 .driver_data = (kernel_ulong_t)&intel_th_2x,
235235 },
236+ {
237+ /* Tiger Lake PCH-H */
238+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x43a6),
239+ .driver_data = (kernel_ulong_t)&intel_th_2x,
240+ },
236241 {
237242 /* Jasper Lake PCH */
238243 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6),
239244 .driver_data = (kernel_ulong_t)&intel_th_2x,
240245 },
246+ {
247+ /* Jasper Lake CPU */
248+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4e29),
249+ .driver_data = (kernel_ulong_t)&intel_th_2x,
250+ },
241251 {
242252 /* Elkhart Lake CPU */
243253 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4529),
@@ -248,6 +258,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 4 unmodified lines
248258 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26),
249259 .driver_data = (kernel_ulong_t)&intel_th_2x,
250260 },
261+ {
262+ /* Emmitsburg PCH */
263+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1bcc),
264+ .driver_data = (kernel_ulong_t)&intel_th_2x,
265+ },
251266 { 0 },
252267 };
253268
drivers/hwtracing/intel_th/sth.c+1−3
@@ -161,9 +161,7 @@ static int sth_stm_link(struct stm_data *stm_data, unsigned int master, · 160 unmodified lines
161161 {
162162 struct sth_device *sth = container_of(stm_data, struct sth_device, stm);
163163
164− intel_th_set_output(to_intel_th_device(sth->dev), master);
165−
166− return 0;
164+ return intel_th_set_output(to_intel_th_device(sth->dev), master);
167165 }
168166
169167 static int intel_th_sw_init(struct sth_device *sth)
drivers/i2c/Kconfig+7−0
@@ -113,11 +113,18 @@ config I2C_STUB · 112 unmodified lines
113113
114114 config I2C_SLAVE
115115 bool "I2C slave support"
116+ help
117+ This enables Linux to act as an I2C slave device. Note that your I2C
118+ bus master driver also needs to support this functionality. Please
119+ read Documentation/i2c/slave-interface.rst for further details.
116120
117121 if I2C_SLAVE
118122
119123 config I2C_SLAVE_EEPROM
120124 tristate "I2C eeprom slave driver"
125+ help
126+ This backend makes Linux behave like an I2C EEPROM. Please read
127+ Documentation/i2c/slave-eeprom-backend.rst for further details.
121128
122129 endif
123130
drivers/i2c/algos/i2c-algo-pca.c+2−1
@@ -314,7 +314,8 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, · 313 unmodified lines
314314 DEB2("BUS ERROR - SDA Stuck low\n");
315315 pca_reset(adap);
316316 goto out;
317− case 0x90: /* Bus error - SCL stuck low */
317+ case 0x78: /* Bus error - SCL stuck low (PCA9665) */
318+ case 0x90: /* Bus error - SCL stuck low (PCA9564) */
318319 DEB2("BUS ERROR - SCL Stuck low\n");
319320 pca_reset(adap);
320321 goto out;
drivers/i2c/busses/i2c-designware-common.c+17−8
@@ -286,10 +286,8 @@ int i2c_dw_acpi_configure(struct device *device) · 285 unmodified lines
286286 }
287287 EXPORT_SYMBOL_GPL(i2c_dw_acpi_configure);
288288
289−void i2c_dw_acpi_adjust_bus_speed(struct device *device)
289+static u32 i2c_dw_acpi_round_bus_speed(struct device *device)
290290 {
291− struct dw_i2c_dev *dev = dev_get_drvdata(device);
292− struct i2c_timings *t = &dev->timings;
293291 u32 acpi_speed;
294292 int i;
295293
@@ -300,9 +298,22 @@ void i2c_dw_acpi_adjust_bus_speed(struct device *device) · 4 unmodified lines
300298 */
301299 for (i = 0; i < ARRAY_SIZE(supported_speeds); i++) {
302300 if (acpi_speed >= supported_speeds[i])
303− break;
301+ return supported_speeds[i];
304302 }
305− acpi_speed = i < ARRAY_SIZE(supported_speeds) ? supported_speeds[i] : 0;
303+
304+ return 0;
305+}
306+
307+#else /* CONFIG_ACPI */
308+
309+static inline u32 i2c_dw_acpi_round_bus_speed(struct device *device) { return 0; }
310+
311+#endif /* CONFIG_ACPI */
312+
313+void i2c_dw_adjust_bus_speed(struct dw_i2c_dev *dev)
314+{
315+ u32 acpi_speed = i2c_dw_acpi_round_bus_speed(dev->dev);
316+ struct i2c_timings *t = &dev->timings;
306317
307318 /*
308319 * Find bus speed from the "clock-frequency" device property, ACPI
@@ -315,9 +326,7 @@ void i2c_dw_acpi_adjust_bus_speed(struct device *device) · 6 unmodified lines
315326 else
316327 t->bus_freq_hz = I2C_MAX_FAST_MODE_FREQ;
317328 }
318−EXPORT_SYMBOL_GPL(i2c_dw_acpi_adjust_bus_speed);
319−
320−#endif /* CONFIG_ACPI */
329+EXPORT_SYMBOL_GPL(i2c_dw_adjust_bus_speed);
321330
322331 u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset)
323332 {
drivers/i2c/busses/i2c-designware-core.h+1−2
@@ -361,11 +361,10 @@ static inline int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev) { return 0; · 360 unmodified lines
361361 #endif
362362
363363 int i2c_dw_validate_speed(struct dw_i2c_dev *dev);
364+void i2c_dw_adjust_bus_speed(struct dw_i2c_dev *dev);
364365
365366 #if IS_ENABLED(CONFIG_ACPI)
366367 int i2c_dw_acpi_configure(struct device *device);
367−void i2c_dw_acpi_adjust_bus_speed(struct device *device);
368368 #else
369369 static inline int i2c_dw_acpi_configure(struct device *device) { return -ENODEV; }
370−static inline void i2c_dw_acpi_adjust_bus_speed(struct device *device) {}
371370 #endif
drivers/i2c/busses/i2c-designware-pcidrv.c+1−1
@@ -240,7 +240,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, · 239 unmodified lines
240240 }
241241 }
242242
243− i2c_dw_acpi_adjust_bus_speed(&pdev->dev);
243+ i2c_dw_adjust_bus_speed(dev);
244244
245245 if (has_acpi_companion(&pdev->dev))
246246 i2c_dw_acpi_configure(&pdev->dev);
drivers/i2c/busses/i2c-designware-platdrv.c+15−2
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/clk-provider.h>
1313 #include <linux/clk.h>
1414 #include <linux/delay.h>
15+#include <linux/dmi.h>
1516 #include <linux/err.h>
1617 #include <linux/errno.h>
1718 #include <linux/i2c.h>
@@ -191,6 +192,17 @@ static int dw_i2c_plat_request_regs(struct dw_i2c_dev *dev) · 173 unmodified lines
191192 return ret;
192193 }
193194
195+static const struct dmi_system_id dw_i2c_hwmon_class_dmi[] = {
196+ {
197+ .ident = "Qtechnology QT5222",
198+ .matches = {
199+ DMI_MATCH(DMI_SYS_VENDOR, "Qtechnology"),
200+ DMI_MATCH(DMI_PRODUCT_NAME, "QT5222"),
201+ },
202+ },
203+ { } /* terminate list */
204+};
205+
194206 static int dw_i2c_plat_probe(struct platform_device *pdev)
195207 {
196208 struct dw_i2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
@@ -228,7 +240,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) · 31 unmodified lines
228240 else
229241 i2c_parse_fw_timings(&pdev->dev, t, false);
230242
231− i2c_dw_acpi_adjust_bus_speed(&pdev->dev);
243+ i2c_dw_adjust_bus_speed(dev);
232244
233245 if (pdev->dev.of_node)
234246 dw_i2c_of_configure(pdev);
@@ -267,7 +279,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) · 32 unmodified lines
267279
268280 adap = &dev->adapter;
269281 adap->owner = THIS_MODULE;
270− adap->class = I2C_CLASS_DEPRECATED;
282+ adap->class = dmi_check_system(dw_i2c_hwmon_class_dmi) ?
283+ I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED;
271284 ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
272285 adap->dev.of_node = pdev->dev.of_node;
273286 adap->nr = -1;
drivers/i2c/busses/i2c-eg20t.c+1−0
@@ -180,6 +180,7 @@ static const struct pci_device_id pch_pcidev_id[] = { · 179 unmodified lines
180180 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), 1, },
181181 {0,}
182182 };
183+MODULE_DEVICE_TABLE(pci, pch_pcidev_id);
183184
184185 static irqreturn_t pch_i2c_handler(int irq, void *pData);
185186
drivers/i2c/busses/i2c-fsi.c+1−1
@@ -98,7 +98,7 @@ · 97 unmodified lines
9898 #define I2C_STAT_DAT_REQ BIT(25)
9999 #define I2C_STAT_CMD_COMP BIT(24)
100100 #define I2C_STAT_STOP_ERR BIT(23)
101−#define I2C_STAT_MAX_PORT GENMASK(19, 16)
101+#define I2C_STAT_MAX_PORT GENMASK(22, 16)
102102 #define I2C_STAT_ANY_INT BIT(15)
103103 #define I2C_STAT_SCL_IN BIT(11)
104104 #define I2C_STAT_SDA_IN BIT(10)
drivers/i2c/busses/i2c-mlxcpld.c+2−2
@@ -337,9 +337,9 @@ static int mlxcpld_i2c_wait_for_tc(struct mlxcpld_i2c_priv *priv) · 336 unmodified lines
337337 if (priv->smbus_block && (val & MLXCPLD_I2C_SMBUS_BLK_BIT)) {
338338 mlxcpld_i2c_read_comm(priv, MLXCPLD_LPCI2C_NUM_DAT_REG,
339339 &datalen, 1);
340− if (unlikely(datalen > (I2C_SMBUS_BLOCK_MAX + 1))) {
340+ if (unlikely(datalen > I2C_SMBUS_BLOCK_MAX)) {
341341 dev_err(priv->dev, "Incorrect smbus block read message len\n");
342− return -E2BIG;
342+ return -EPROTO;
343343 }
344344 } else {
345345 datalen = priv->xfer.data_len;
drivers/i2c/i2c-core-smbus.c+7−0
@@ -495,6 +495,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 494 unmodified lines
495495 break;
496496 case I2C_SMBUS_BLOCK_DATA:
497497 case I2C_SMBUS_BLOCK_PROC_CALL:
498+ if (msg[1].buf[0] > I2C_SMBUS_BLOCK_MAX) {
499+ dev_err(&adapter->dev,
500+ "Invalid block size returned: %d\n",
501+ msg[1].buf[0]);
502+ status = -EPROTO;
503+ goto cleanup;
504+ }
498505 for (i = 0; i < msg[1].buf[0] + 1; i++)
499506 data->block[i] = msg[1].buf[i];
500507 break;
drivers/iio/accel/mma8452.c+4−1
@@ -1685,10 +1685,13 @@ static int mma8452_probe(struct i2c_client *client, · 1684 unmodified lines
16851685
16861686 ret = mma8452_set_freefall_mode(data, false);
16871687 if (ret < 0)
1688− goto buffer_cleanup;
1688+ goto unregister_device;
16891689
16901690 return 0;
16911691
1692+unregister_device:
1693+ iio_device_unregister(indio_dev);
1694+
16921695 buffer_cleanup:
16931696 iio_triggered_buffer_cleanup(indio_dev);
16941697
drivers/iio/adc/ad7780.c+1−1
@@ -329,7 +329,7 @@ static int ad7780_probe(struct spi_device *spi) · 328 unmodified lines
329329
330330 ret = ad7780_init_gpios(&spi->dev, st);
331331 if (ret)
332− goto error_cleanup_buffer_and_trigger;
332+ return ret;
333333
334334 st->reg = devm_regulator_get(&spi->dev, "avdd");
335335 if (IS_ERR(st->reg))
drivers/iio/adc/adi-axi-adc.c+2−2
@@ -332,12 +332,12 @@ static struct adi_axi_adc_client *adi_axi_adc_attach_client(struct device *dev) · 331 unmodified lines
332332 if (cl->dev->of_node != cln)
333333 continue;
334334
335− if (!try_module_get(dev->driver->owner)) {
335+ if (!try_module_get(cl->dev->driver->owner)) {
336336 mutex_unlock(&registered_clients_lock);
337337 return ERR_PTR(-ENODEV);
338338 }
339339
340− get_device(dev);
340+ get_device(cl->dev);
341341 cl->info = info;
342342 mutex_unlock(&registered_clients_lock);
343343 return cl;
drivers/iio/health/afe4403.c+6−3
@@ -65,6 +65,7 @@ static const struct reg_field afe4403_reg_fields[] = { · 64 unmodified lines
6565 * @regulator: Pointer to the regulator for the IC
6666 * @trig: IIO trigger for this device
6767 * @irq: ADC_RDY line interrupt number
68+ * @buffer: Used to construct data layout to push into IIO buffer.
6869 */
6970 struct afe4403_data {
7071 struct device *dev;
@@ -74,6 +75,8 @@ struct afe4403_data { · 3 unmodified lines
7475 struct regulator *regulator;
7576 struct iio_trigger *trig;
7677 int irq;
78+ /* Ensure suitable alignment for timestamp */
79+ s32 buffer[8] __aligned(8);
7780 };
7881
7982 enum afe4403_chan_id {
@@ -309,7 +312,6 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) · 229 unmodified lines
309312 struct iio_dev *indio_dev = pf->indio_dev;
310313 struct afe4403_data *afe = iio_priv(indio_dev);
311314 int ret, bit, i = 0;
312− s32 buffer[8];
313315 u8 tx[4] = {AFE440X_CONTROL0, 0x0, 0x0, AFE440X_CONTROL0_READ};
314316 u8 rx[3];
315317
@@ -326,7 +328,7 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) · 10 unmodified lines
326328 if (ret)
327329 goto err;
328330
329− buffer[i++] = get_unaligned_be24(&rx[0]);
331+ afe->buffer[i++] = get_unaligned_be24(&rx[0]);
330332 }
331333
332334 /* Disable reading from the device */
@@ -335,7 +337,8 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) · 2 unmodified lines
335337 if (ret)
336338 goto err;
337339
338− iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp);
340+ iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer,
341+ pf->timestamp);
339342 err:
340343 iio_trigger_notify_done(indio_dev->trig);
341344
drivers/iio/health/afe4404.c+5−3
@@ -83,6 +83,7 @@ static const struct reg_field afe4404_reg_fields[] = { · 82 unmodified lines
8383 * @regulator: Pointer to the regulator for the IC
8484 * @trig: IIO trigger for this device
8585 * @irq: ADC_RDY line interrupt number
86+ * @buffer: Used to construct a scan to push to the iio buffer.
8687 */
8788 struct afe4404_data {
8889 struct device *dev;
@@ -91,6 +92,7 @@ struct afe4404_data { · 2 unmodified lines
9192 struct regulator *regulator;
9293 struct iio_trigger *trig;
9394 int irq;
95+ s32 buffer[10] __aligned(8);
9496 };
9597
9698 enum afe4404_chan_id {
@@ -328,17 +330,17 @@ static irqreturn_t afe4404_trigger_handler(int irq, void *private) · 231 unmodified lines
328330 struct iio_dev *indio_dev = pf->indio_dev;
329331 struct afe4404_data *afe = iio_priv(indio_dev);
330332 int ret, bit, i = 0;
331− s32 buffer[10];
332333
333334 for_each_set_bit(bit, indio_dev->active_scan_mask,
334335 indio_dev->masklength) {
335336 ret = regmap_read(afe->regmap, afe4404_channel_values[bit],
336− &buffer[i++]);
337+ &afe->buffer[i++]);
337338 if (ret)
338339 goto err;
339340 }
340341
341− iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp);
342+ iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer,
343+ pf->timestamp);
342344 err:
343345 iio_trigger_notify_done(indio_dev->trig);
344346
drivers/iio/humidity/hdc100x.c+7−3
@@ -38,6 +38,11 @@ struct hdc100x_data { · 37 unmodified lines
3838
3939 /* integration time of the sensor */
4040 int adc_int_us[2];
41+ /* Ensure natural alignment of timestamp */
42+ struct {
43+ __be16 channels[2];
44+ s64 ts __aligned(8);
45+ } scan;
4146 };
4247
4348 /* integration time in us */
@@ -322,7 +327,6 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) · 278 unmodified lines
322327 struct i2c_client *client = data->client;
323328 int delay = data->adc_int_us[0] + data->adc_int_us[1];
324329 int ret;
325− s16 buf[8]; /* 2x s16 + padding + 8 byte timestamp */
326330
327331 /* dual read starts at temp register */
328332 mutex_lock(&data->lock);
@@ -333,13 +337,13 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) · 4 unmodified lines
333337 }
334338 usleep_range(delay, delay + 1000);
335339
336− ret = i2c_master_recv(client, (u8 *)buf, 4);
340+ ret = i2c_master_recv(client, (u8 *)data->scan.channels, 4);
337341 if (ret < 0) {
338342 dev_err(&client->dev, "cannot read sensor data\n");
339343 goto err;
340344 }
341345
342− iio_push_to_buffers_with_timestamp(indio_dev, buf,
346+ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
343347 iio_get_time_ns(indio_dev));
344348 err:
345349 mutex_unlock(&data->lock);
drivers/iio/humidity/hts221.h+5−2
@@ -14,8 +14,6 @@ · 13 unmodified lines
1414
1515 #include <linux/iio/iio.h>
1616
17−#define HTS221_DATA_SIZE 2
18−
1917 enum hts221_sensor_type {
2018 HTS221_SENSOR_H,
2119 HTS221_SENSOR_T,
@@ -39,6 +37,11 @@ struct hts221_hw { · 17 unmodified lines
3937
4038 bool enabled;
4139 u8 odr;
40+ /* Ensure natural alignment of timestamp */
41+ struct {
42+ __le16 channels[2];
43+ s64 ts __aligned(8);
44+ } scan;
4245 };
4346
4447 extern const struct dev_pm_ops hts221_pm_ops;
drivers/iio/humidity/hts221_buffer.c+5−4
@@ -160,7 +160,6 @@ static const struct iio_buffer_setup_ops hts221_buffer_ops = { · 159 unmodified lines
160160
161161 static irqreturn_t hts221_buffer_handler_thread(int irq, void *p)
162162 {
163− u8 buffer[ALIGN(2 * HTS221_DATA_SIZE, sizeof(s64)) + sizeof(s64)];
164163 struct iio_poll_func *pf = p;
165164 struct iio_dev *iio_dev = pf->indio_dev;
166165 struct hts221_hw *hw = iio_priv(iio_dev);
@@ -170,18 +169,20 @@ static irqreturn_t hts221_buffer_handler_thread(int irq, void *p) · 3 unmodified lines
170169 /* humidity data */
171170 ch = &iio_dev->channels[HTS221_SENSOR_H];
172171 err = regmap_bulk_read(hw->regmap, ch->address,
173− buffer, HTS221_DATA_SIZE);
172+ &hw->scan.channels[0],
173+ sizeof(hw->scan.channels[0]));
174174 if (err < 0)
175175 goto out;
176176
177177 /* temperature data */
178178 ch = &iio_dev->channels[HTS221_SENSOR_T];
179179 err = regmap_bulk_read(hw->regmap, ch->address,
180− buffer + HTS221_DATA_SIZE, HTS221_DATA_SIZE);
180+ &hw->scan.channels[1],
181+ sizeof(hw->scan.channels[1]));
181182 if (err < 0)
182183 goto out;
183184
184− iio_push_to_buffers_with_timestamp(iio_dev, buffer,
185+ iio_push_to_buffers_with_timestamp(iio_dev, &hw->scan,
185186 iio_get_time_ns(iio_dev));
186187
187188 out:
drivers/iio/industrialio-core.c+2−0
@@ -130,6 +130,8 @@ static const char * const iio_modifier_names[] = { · 129 unmodified lines
130130 [IIO_MOD_PM2P5] = "pm2p5",
131131 [IIO_MOD_PM4] = "pm4",
132132 [IIO_MOD_PM10] = "pm10",
133+ [IIO_MOD_ETHANOL] = "ethanol",
134+ [IIO_MOD_H2] = "h2",
133135 };
134136
135137 /* relies on pairs of these shared then separate */
drivers/iio/magnetometer/ak8974.c+17−12
@@ -192,6 +192,11 @@ struct ak8974 { · 191 unmodified lines
192192 bool drdy_irq;
193193 struct completion drdy_complete;
194194 bool drdy_active_low;
195+ /* Ensure timestamp is naturally aligned */
196+ struct {
197+ __le16 channels[3];
198+ s64 ts __aligned(8);
199+ } scan;
195200 };
196201
197202 static const char ak8974_reg_avdd[] = "avdd";
@@ -657,7 +662,6 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) · 459 unmodified lines
657662 {
658663 struct ak8974 *ak8974 = iio_priv(indio_dev);
659664 int ret;
660− __le16 hw_values[8]; /* Three axes + 64bit padding */
661665
662666 pm_runtime_get_sync(&ak8974->i2c->dev);
663667 mutex_lock(&ak8974->lock);
@@ -667,13 +671,13 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) · 3 unmodified lines
667671 dev_err(&ak8974->i2c->dev, "error triggering measure\n");
668672 goto out_unlock;
669673 }
670− ret = ak8974_getresult(ak8974, hw_values);
674+ ret = ak8974_getresult(ak8974, ak8974->scan.channels);
671675 if (ret) {
672676 dev_err(&ak8974->i2c->dev, "error getting measures\n");
673677 goto out_unlock;
674678 }
675679
676− iio_push_to_buffers_with_timestamp(indio_dev, hw_values,
680+ iio_push_to_buffers_with_timestamp(indio_dev, &ak8974->scan,
677681 iio_get_time_ns(indio_dev));
678682
679683 out_unlock:
@@ -862,19 +866,21 @@ static int ak8974_probe(struct i2c_client *i2c, · 182 unmodified lines
862866 ak8974->map = devm_regmap_init_i2c(i2c, &ak8974_regmap_config);
863867 if (IS_ERR(ak8974->map)) {
864868 dev_err(&i2c->dev, "failed to allocate register map\n");
869+ pm_runtime_put_noidle(&i2c->dev);
870+ pm_runtime_disable(&i2c->dev);
865871 return PTR_ERR(ak8974->map);
866872 }
867873
868874 ret = ak8974_set_power(ak8974, AK8974_PWR_ON);
869875 if (ret) {
870876 dev_err(&i2c->dev, "could not power on\n");
871− goto power_off;
877+ goto disable_pm;
872878 }
873879
874880 ret = ak8974_detect(ak8974);
875881 if (ret) {
876882 dev_err(&i2c->dev, "neither AK8974 nor AMI30x found\n");
877− goto power_off;
883+ goto disable_pm;
878884 }
879885
880886 ret = ak8974_selftest(ak8974);
@@ -884,14 +890,9 @@ static int ak8974_probe(struct i2c_client *i2c, · 3 unmodified lines
884890 ret = ak8974_reset(ak8974);
885891 if (ret) {
886892 dev_err(&i2c->dev, "AK8974 reset failed\n");
887− goto power_off;
893+ goto disable_pm;
888894 }
889895
890− pm_runtime_set_autosuspend_delay(&i2c->dev,
891− AK8974_AUTOSUSPEND_DELAY);
892− pm_runtime_use_autosuspend(&i2c->dev);
893− pm_runtime_put(&i2c->dev);
894−
895896 indio_dev->dev.parent = &i2c->dev;
896897 switch (ak8974->variant) {
897898 case AK8974_WHOAMI_VALUE_AMI306:
@@ -957,6 +958,11 @@ no_irq: · 59 unmodified lines
957958 goto cleanup_buffer;
958959 }
959960
961+ pm_runtime_set_autosuspend_delay(&i2c->dev,
962+ AK8974_AUTOSUSPEND_DELAY);
963+ pm_runtime_use_autosuspend(&i2c->dev);
964+ pm_runtime_put(&i2c->dev);
965+
960966 return 0;
961967
962968 cleanup_buffer:
@@ -965,7 +971,6 @@ disable_pm: · 2 unmodified lines
965971 pm_runtime_put_noidle(&i2c->dev);
966972 pm_runtime_disable(&i2c->dev);
967973 ak8974_set_power(ak8974, AK8974_PWR_OFF);
968−power_off:
969974 regulator_bulk_disable(ARRAY_SIZE(ak8974->regs), ak8974->regs);
970975
971976 return ret;
drivers/iio/pressure/ms5611_core.c+8−3
@@ -212,16 +212,21 @@ static irqreturn_t ms5611_trigger_handler(int irq, void *p) · 211 unmodified lines
212212 struct iio_poll_func *pf = p;
213213 struct iio_dev *indio_dev = pf->indio_dev;
214214 struct ms5611_state *st = iio_priv(indio_dev);
215− s32 buf[4]; /* s32 (pressure) + s32 (temp) + 2 * s32 (timestamp) */
215+ /* Ensure buffer elements are naturally aligned */
216+ struct {
217+ s32 channels[2];
218+ s64 ts __aligned(8);
219+ } scan;
216220 int ret;
217221
218222 mutex_lock(&st->lock);
219− ret = ms5611_read_temp_and_pressure(indio_dev, &buf[1], &buf[0]);
223+ ret = ms5611_read_temp_and_pressure(indio_dev, &scan.channels[1],
224+ &scan.channels[0]);
220225 mutex_unlock(&st->lock);
221226 if (ret < 0)
222227 goto err;
223228
224− iio_push_to_buffers_with_timestamp(indio_dev, buf,
229+ iio_push_to_buffers_with_timestamp(indio_dev, &scan,
225230 iio_get_time_ns(indio_dev));
226231
227232 err:
drivers/iio/pressure/zpa2326.c+3−1
@@ -665,8 +665,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev) · 664 unmodified lines
665665 int err;
666666
667667 err = pm_runtime_get_sync(indio_dev->dev.parent);
668− if (err < 0)
668+ if (err < 0) {
669+ pm_runtime_put(indio_dev->dev.parent);
669670 return err;
671+ }
670672
671673 if (err > 0) {
672674 /*
drivers/infiniband/core/cm.c+1−0
@@ -918,6 +918,7 @@ static void cm_free_work(struct cm_work *work) · 917 unmodified lines
918918
919919 static void cm_queue_work_unlock(struct cm_id_private *cm_id_priv,
920920 struct cm_work *work)
921+ __releases(&cm_id_priv->lock)
921922 {
922923 bool immediate;
923924
drivers/infiniband/core/cma.c+18−0
@@ -1624,6 +1624,8 @@ static struct rdma_id_private *cma_find_listener( · 1623 unmodified lines
16241624 {
16251625 struct rdma_id_private *id_priv, *id_priv_dev;
16261626
1627+ lockdep_assert_held(&lock);
1628+
16271629 if (!bind_list)
16281630 return ERR_PTR(-EINVAL);
16291631
@@ -1670,6 +1672,7 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id, · 40 unmodified lines
16701672 }
16711673 }
16721674
1675+ mutex_lock(&lock);
16731676 /*
16741677 * Net namespace might be getting deleted while route lookup,
16751678 * cm_id lookup is in progress. Therefore, perform netdevice
@@ -1711,6 +1714,7 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id, · 35 unmodified lines
17111714 id_priv = cma_find_listener(bind_list, cm_id, ib_event, req, *net_dev);
17121715 err:
17131716 rcu_read_unlock();
1717+ mutex_unlock(&lock);
17141718 if (IS_ERR(id_priv) && *net_dev) {
17151719 dev_put(*net_dev);
17161720 *net_dev = NULL;
@@ -2492,6 +2496,8 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv, · 775 unmodified lines
24922496 struct net *net = id_priv->id.route.addr.dev_addr.net;
24932497 int ret;
24942498
2499+ lockdep_assert_held(&lock);
2500+
24952501 if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1))
24962502 return;
24972503
@@ -3342,6 +3348,8 @@ static void cma_bind_port(struct rdma_bind_list *bind_list, · 844 unmodified lines
33423348 u64 sid, mask;
33433349 __be16 port;
33443350
3351+ lockdep_assert_held(&lock);
3352+
33453353 addr = cma_src_addr(id_priv);
33463354 port = htons(bind_list->port);
33473355
@@ -3370,6 +3378,8 @@ static int cma_alloc_port(enum rdma_ucm_port_space ps, · 22 unmodified lines
33703378 struct rdma_bind_list *bind_list;
33713379 int ret;
33723380
3381+ lockdep_assert_held(&lock);
3382+
33733383 bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
33743384 if (!bind_list)
33753385 return -ENOMEM;
@@ -3396,6 +3406,8 @@ static int cma_port_is_unique(struct rdma_bind_list *bind_list, · 20 unmodified lines
33963406 struct sockaddr *saddr = cma_src_addr(id_priv);
33973407 __be16 dport = cma_port(daddr);
33983408
3409+ lockdep_assert_held(&lock);
3410+
33993411 hlist_for_each_entry(cur_id, &bind_list->owners, node) {
34003412 struct sockaddr *cur_daddr = cma_dst_addr(cur_id);
34013413 struct sockaddr *cur_saddr = cma_src_addr(cur_id);
@@ -3435,6 +3447,8 @@ static int cma_alloc_any_port(enum rdma_ucm_port_space ps, · 33 unmodified lines
34353447 unsigned int rover;
34363448 struct net *net = id_priv->id.route.addr.dev_addr.net;
34373449
3450+ lockdep_assert_held(&lock);
3451+
34383452 inet_get_local_port_range(net, &low, &high);
34393453 remaining = (high - low) + 1;
34403454 rover = prandom_u32() % remaining + low;
@@ -3482,6 +3496,8 @@ static int cma_check_port(struct rdma_bind_list *bind_list, · 41 unmodified lines
34823496 struct rdma_id_private *cur_id;
34833497 struct sockaddr *addr, *cur_addr;
34843498
3499+ lockdep_assert_held(&lock);
3500+
34853501 addr = cma_src_addr(id_priv);
34863502 hlist_for_each_entry(cur_id, &bind_list->owners, node) {
34873503 if (id_priv == cur_id)
@@ -3512,6 +3528,8 @@ static int cma_use_port(enum rdma_ucm_port_space ps, · 24 unmodified lines
35123528 unsigned short snum;
35133529 int ret;
35143530
3531+ lockdep_assert_held(&lock);
3532+
35153533 snum = ntohs(cma_port(cma_src_addr(id_priv)));
35163534 if (snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
35173535 return -EACCES;
drivers/infiniband/core/counters.c+3−1
@@ -202,7 +202,7 @@ static int __rdma_counter_unbind_qp(struct ib_qp *qp) · 201 unmodified lines
202202 return ret;
203203 }
204204
205−static void counter_history_stat_update(const struct rdma_counter *counter)
205+static void counter_history_stat_update(struct rdma_counter *counter)
206206 {
207207 struct ib_device *dev = counter->device;
208208 struct rdma_port_counter *port_counter;
@@ -212,6 +212,8 @@ static void counter_history_stat_update(const struct rdma_counter *counter) · 3 unmodified lines
212212 if (!port_counter->hstats)
213213 return;
214214
215+ rdma_counter_query_stats(counter);
216+
215217 for (i = 0; i < counter->stats->num_counters; i++)
216218 port_counter->hstats->value[i] += counter->stats->value[i];
217219 }
drivers/infiniband/core/mad.c+2−1
@@ -509,10 +509,10 @@ static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv) · 508 unmodified lines
509509 xa_erase(&ib_mad_clients, mad_agent_priv->agent.hi_tid);
510510
511511 flush_workqueue(port_priv->wq);
512− ib_cancel_rmpp_recvs(mad_agent_priv);
513512
514513 deref_mad_agent(mad_agent_priv);
515514 wait_for_completion(&mad_agent_priv->comp);
515+ ib_cancel_rmpp_recvs(mad_agent_priv);
516516
517517 ib_mad_agent_security_cleanup(&mad_agent_priv->agent);
518518
@@ -2718,6 +2718,7 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, · 2199 unmodified lines
27182718 DMA_FROM_DEVICE);
27192719 if (unlikely(ib_dma_mapping_error(qp_info->port_priv->device,
27202720 sg_list.addr))) {
2721+ kfree(mad_priv);
27212722 ret = -ENOMEM;
27222723 break;
27232724 }
drivers/infiniband/core/rdma_core.c+21−15
@@ -470,40 +470,46 @@ static struct ib_uobject * · 469 unmodified lines
470470 alloc_begin_fd_uobject(const struct uverbs_api_object *obj,
471471 struct uverbs_attr_bundle *attrs)
472472 {
473− const struct uverbs_obj_fd_type *fd_type =
474− container_of(obj->type_attrs, struct uverbs_obj_fd_type, type);
473+ const struct uverbs_obj_fd_type *fd_type;
475474 int new_fd;
476− struct ib_uobject *uobj;
475+ struct ib_uobject *uobj, *ret;
477476 struct file *filp;
478477
478+ uobj = alloc_uobj(attrs, obj);
479+ if (IS_ERR(uobj))
480+ return uobj;
481+
482+ fd_type =
483+ container_of(obj->type_attrs, struct uverbs_obj_fd_type, type);
479484 if (WARN_ON(fd_type->fops->release != &uverbs_uobject_fd_release &&
480− fd_type->fops->release != &uverbs_async_event_release))
481− return ERR_PTR(-EINVAL);
485+ fd_type->fops->release != &uverbs_async_event_release)) {
486+ ret = ERR_PTR(-EINVAL);
487+ goto err_fd;
488+ }
482489
483490 new_fd = get_unused_fd_flags(O_CLOEXEC);
484− if (new_fd < 0)
485− return ERR_PTR(new_fd);
486−
487− uobj = alloc_uobj(attrs, obj);
488− if (IS_ERR(uobj))
491+ if (new_fd < 0) {
492+ ret = ERR_PTR(new_fd);
489493 goto err_fd;
494+ }
490495
491496 /* Note that uverbs_uobject_fd_release() is called during abort */
492497 filp = anon_inode_getfile(fd_type->name, fd_type->fops, NULL,
493498 fd_type->flags);
494499 if (IS_ERR(filp)) {
495− uverbs_uobject_put(uobj);
496− uobj = ERR_CAST(filp);
497− goto err_fd;
500+ ret = ERR_CAST(filp);
501+ goto err_getfile;
498502 }
499503 uobj->object = filp;
500504
501505 uobj->id = new_fd;
502506 return uobj;
503507
504−err_fd:
508+err_getfile:
505509 put_unused_fd(new_fd);
506− return uobj;
510+err_fd:
511+ uverbs_uobject_put(uobj);
512+ return ret;
507513 }
508514
509515 struct ib_uobject *rdma_alloc_begin_uobject(const struct uverbs_api_object *obj,
drivers/infiniband/core/sa_query.c+17−21
@@ -829,13 +829,20 @@ static int ib_nl_get_path_rec_attrs_len(ib_sa_comp_mask comp_mask) · 828 unmodified lines
829829 return len;
830830 }
831831
832−static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask)
832+static int ib_nl_make_request(struct ib_sa_query *query, gfp_t gfp_mask)
833833 {
834834 struct sk_buff *skb = NULL;
835835 struct nlmsghdr *nlh;
836836 void *data;
837837 struct ib_sa_mad *mad;
838838 int len;
839+ unsigned long flags;
840+ unsigned long delay;
841+ gfp_t gfp_flag;
842+ int ret;
843+
844+ INIT_LIST_HEAD(&query->list);
845+ query->seq = (u32)atomic_inc_return(&ib_nl_sa_request_seq);
839846
840847 mad = query->mad_buf->mad;
841848 len = ib_nl_get_path_rec_attrs_len(mad->sa_hdr.comp_mask);
@@ -860,36 +867,25 @@ static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask) · 18 unmodified lines
860867 /* Repair the nlmsg header length */
861868 nlmsg_end(skb, nlh);
862869
863− return rdma_nl_multicast(&init_net, skb, RDMA_NL_GROUP_LS, gfp_mask);
864−}
870+ gfp_flag = ((gfp_mask & GFP_ATOMIC) == GFP_ATOMIC) ? GFP_ATOMIC :
871+ GFP_NOWAIT;
865872
866−static int ib_nl_make_request(struct ib_sa_query *query, gfp_t gfp_mask)
867−{
868− unsigned long flags;
869− unsigned long delay;
870− int ret;
873+ spin_lock_irqsave(&ib_nl_request_lock, flags);
874+ ret = rdma_nl_multicast(&init_net, skb, RDMA_NL_GROUP_LS, gfp_flag);
871875
872− INIT_LIST_HEAD(&query->list);
873− query->seq = (u32)atomic_inc_return(&ib_nl_sa_request_seq);
876+ if (ret)
877+ goto out;
874878
875− /* Put the request on the list first.*/
876− spin_lock_irqsave(&ib_nl_request_lock, flags);
879+ /* Put the request on the list.*/
877880 delay = msecs_to_jiffies(sa_local_svc_timeout_ms);
878881 query->timeout = delay + jiffies;
879882 list_add_tail(&query->list, &ib_nl_request_list);
880883 /* Start the timeout if this is the only request */
881884 if (ib_nl_request_list.next == &query->list)
882885 queue_delayed_work(ib_nl_wq, &ib_nl_timed_work, delay);
883− spin_unlock_irqrestore(&ib_nl_request_lock, flags);
884886
885− ret = ib_nl_send_msg(query, gfp_mask);
886− if (ret) {
887− ret = -EIO;
888− /* Remove the request */
889− spin_lock_irqsave(&ib_nl_request_lock, flags);
890− list_del(&query->list);
891− spin_unlock_irqrestore(&ib_nl_request_lock, flags);
892− }
887+out:
888+ spin_unlock_irqrestore(&ib_nl_request_lock, flags);
893889
894890 return ret;
895891 }
drivers/infiniband/hw/efa/efa_verbs.c+1−0
@@ -212,6 +212,7 @@ int efa_query_device(struct ib_device *ibdev, · 211 unmodified lines
212212 props->max_send_sge = dev_attr->max_sq_sge;
213213 props->max_recv_sge = dev_attr->max_rq_sge;
214214 props->max_sge_rd = dev_attr->max_wr_rdma_sge;
215+ props->max_pkeys = 1;
215216
216217 if (udata && udata->outlen) {
217218 resp.max_sq_sge = dev_attr->max_sq_sge;
drivers/infiniband/hw/hfi1/debugfs.c+2−17
@@ -985,15 +985,10 @@ static ssize_t qsfp2_debugfs_read(struct file *file, char __user *buf, · 984 unmodified lines
985985 static int __i2c_debugfs_open(struct inode *in, struct file *fp, u32 target)
986986 {
987987 struct hfi1_pportdata *ppd;
988− int ret;
989988
990989 ppd = private2ppd(fp);
991990
992− ret = acquire_chip_resource(ppd->dd, i2c_target(target), 0);
993− if (ret) /* failed - release the module */
994− module_put(THIS_MODULE);
995−
996− return ret;
991+ return acquire_chip_resource(ppd->dd, i2c_target(target), 0);
997992 }
998993
999994 static int i2c1_debugfs_open(struct inode *in, struct file *fp)
@@ -1013,7 +1008,6 @@ static int __i2c_debugfs_release(struct inode *in, struct file *fp, u32 target) · 13 unmodified lines
10131008 ppd = private2ppd(fp);
10141009
10151010 release_chip_resource(ppd->dd, i2c_target(target));
1016− module_put(THIS_MODULE);
10171011
10181012 return 0;
10191013 }
@@ -1031,18 +1025,10 @@ static int i2c2_debugfs_release(struct inode *in, struct file *fp) · 11 unmodified lines
10311025 static int __qsfp_debugfs_open(struct inode *in, struct file *fp, u32 target)
10321026 {
10331027 struct hfi1_pportdata *ppd;
1034− int ret;
1035−
1036− if (!try_module_get(THIS_MODULE))
1037− return -ENODEV;
10381028
10391029 ppd = private2ppd(fp);
10401030
1041− ret = acquire_chip_resource(ppd->dd, i2c_target(target), 0);
1042− if (ret) /* failed - release the module */
1043− module_put(THIS_MODULE);
1044−
1045− return ret;
1031+ return acquire_chip_resource(ppd->dd, i2c_target(target), 0);
10461032 }
10471033
10481034 static int qsfp1_debugfs_open(struct inode *in, struct file *fp)
@@ -1062,7 +1048,6 @@ static int __qsfp_debugfs_release(struct inode *in, struct file *fp, u32 target) · 13 unmodified lines
10621048 ppd = private2ppd(fp);
10631049
10641050 release_chip_resource(ppd->dd, i2c_target(target));
1065− module_put(THIS_MODULE);
10661051
10671052 return 0;
10681053 }
drivers/infiniband/hw/hfi1/init.c+28−9
@@ -830,6 +830,29 @@ wq_error: · 829 unmodified lines
830830 return -ENOMEM;
831831 }
832832
833+/**
834+ * destroy_workqueues - destroy per port workqueues
835+ * @dd: the hfi1_ib device
836+ */
837+static void destroy_workqueues(struct hfi1_devdata *dd)
838+{
839+ int pidx;
840+ struct hfi1_pportdata *ppd;
841+
842+ for (pidx = 0; pidx < dd->num_pports; ++pidx) {
843+ ppd = dd->pport + pidx;
844+
845+ if (ppd->hfi1_wq) {
846+ destroy_workqueue(ppd->hfi1_wq);
847+ ppd->hfi1_wq = NULL;
848+ }
849+ if (ppd->link_wq) {
850+ destroy_workqueue(ppd->link_wq);
851+ ppd->link_wq = NULL;
852+ }
853+ }
854+}
855+
833856 /**
834857 * enable_general_intr() - Enable the IRQs that will be handled by the
835858 * general interrupt handler.
@@ -1103,15 +1126,10 @@ static void shutdown_device(struct hfi1_devdata *dd) · 267 unmodified lines
11031126 * We can't count on interrupts since we are stopping.
11041127 */
11051128 hfi1_quiet_serdes(ppd);
1106−
1107− if (ppd->hfi1_wq) {
1108− destroy_workqueue(ppd->hfi1_wq);
1109− ppd->hfi1_wq = NULL;
1110− }
1111− if (ppd->link_wq) {
1112− destroy_workqueue(ppd->link_wq);
1113− ppd->link_wq = NULL;
1114− }
1129+ if (ppd->hfi1_wq)
1130+ flush_workqueue(ppd->hfi1_wq);
1131+ if (ppd->link_wq)
1132+ flush_workqueue(ppd->link_wq);
11151133 }
11161134 sdma_exit(dd);
11171135 }
@@ -1756,6 +1774,7 @@ static void remove_one(struct pci_dev *pdev) · 638 unmodified lines
17561774 * clear dma engines, etc.
17571775 */
17581776 shutdown_device(dd);
1777+ destroy_workqueues(dd);
17591778
17601779 stop_timers(dd);
17611780
drivers/infiniband/hw/hfi1/iowait.h+1−1
@@ -399,7 +399,7 @@ static inline void iowait_get_priority(struct iowait *w) · 398 unmodified lines
399399 * @wait_head: the wait queue
400400 *
401401 * This function is called to insert an iowait struct into a
402− * wait queue after a resource (eg, sdma decriptor or pio
402+ * wait queue after a resource (eg, sdma descriptor or pio
403403 * buffer) is run out.
404404 */
405405 static inline void iowait_queue(bool pkts_sent, struct iowait *w,
drivers/infiniband/hw/hfi1/ipoib.h+6−0
@@ -67,6 +67,9 @@ struct hfi1_ipoib_circ_buf { · 66 unmodified lines
6767 * @sde: sdma engine
6868 * @tx_list: tx request list
6969 * @sent_txreqs: count of txreqs posted to sdma
70+ * @stops: count of stops of queue
71+ * @ring_full: ring has been filled
72+ * @no_desc: descriptor shortage seen
7073 * @flow: tracks when list needs to be flushed for a flow change
7174 * @q_idx: ipoib Tx queue index
7275 * @pkts_sent: indicator packets have been sent from this queue
@@ -80,6 +83,9 @@ struct hfi1_ipoib_txq { · 7 unmodified lines
8083 struct sdma_engine *sde;
8184 struct list_head tx_list;
8285 u64 sent_txreqs;
86+ atomic_t stops;
87+ atomic_t ring_full;
88+ atomic_t no_desc;
8389 union hfi1_ipoib_flow flow;
8490 u8 q_idx;
8591 bool pkts_sent;
drivers/infiniband/hw/hfi1/ipoib_tx.c+66−38
@@ -55,23 +55,48 @@ static u64 hfi1_ipoib_txreqs(const u64 sent, const u64 completed) · 54 unmodified lines
5555 return sent - completed;
5656 }
5757
58−static void hfi1_ipoib_check_queue_depth(struct hfi1_ipoib_txq *txq)
58+static u64 hfi1_ipoib_used(struct hfi1_ipoib_txq *txq)
5959 {
60− if (unlikely(hfi1_ipoib_txreqs(++txq->sent_txreqs,
61− atomic64_read(&txq->complete_txreqs)) >=
62− min_t(unsigned int, txq->priv->netdev->tx_queue_len,
63− txq->tx_ring.max_items - 1)))
60+ return hfi1_ipoib_txreqs(txq->sent_txreqs,
61+ atomic64_read(&txq->complete_txreqs));
62+}
63+
64+static void hfi1_ipoib_stop_txq(struct hfi1_ipoib_txq *txq)
65+{
66+ if (atomic_inc_return(&txq->stops) == 1)
6467 netif_stop_subqueue(txq->priv->netdev, txq->q_idx);
6568 }
6669
70+static void hfi1_ipoib_wake_txq(struct hfi1_ipoib_txq *txq)
71+{
72+ if (atomic_dec_and_test(&txq->stops))
73+ netif_wake_subqueue(txq->priv->netdev, txq->q_idx);
74+}
75+
76+static uint hfi1_ipoib_ring_hwat(struct hfi1_ipoib_txq *txq)
77+{
78+ return min_t(uint, txq->priv->netdev->tx_queue_len,
79+ txq->tx_ring.max_items - 1);
80+}
81+
82+static uint hfi1_ipoib_ring_lwat(struct hfi1_ipoib_txq *txq)
83+{
84+ return min_t(uint, txq->priv->netdev->tx_queue_len,
85+ txq->tx_ring.max_items) >> 1;
86+}
87+
88+static void hfi1_ipoib_check_queue_depth(struct hfi1_ipoib_txq *txq)
89+{
90+ ++txq->sent_txreqs;
91+ if (hfi1_ipoib_used(txq) >= hfi1_ipoib_ring_hwat(txq) &&
92+ !atomic_xchg(&txq->ring_full, 1))
93+ hfi1_ipoib_stop_txq(txq);
94+}
95+
6796 static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq)
6897 {
6998 struct net_device *dev = txq->priv->netdev;
7099
71− /* If the queue is already running just return */
72− if (likely(!__netif_subqueue_stopped(dev, txq->q_idx)))
73− return;
74−
75100 /* If shutting down just return as queue state is irrelevant */
76101 if (unlikely(dev->reg_state != NETREG_REGISTERED))
77102 return;
@@ -86,11 +111,9 @@ static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq) · 8 unmodified lines
86111 * Use the minimum of the current tx_queue_len or the rings max txreqs
87112 * to protect against ring overflow.
88113 */
89− if (hfi1_ipoib_txreqs(txq->sent_txreqs,
90− atomic64_read(&txq->complete_txreqs))
91− < min_t(unsigned int, dev->tx_queue_len,
92− txq->tx_ring.max_items) >> 1)
93− netif_wake_subqueue(dev, txq->q_idx);
114+ if (hfi1_ipoib_used(txq) < hfi1_ipoib_ring_lwat(txq) &&
115+ atomic_xchg(&txq->ring_full, 0))
116+ hfi1_ipoib_wake_txq(txq);
94117 }
95118
96119 static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget)
@@ -364,11 +387,12 @@ static struct ipoib_txreq *hfi1_ipoib_send_dma_common(struct net_device *dev, · 267 unmodified lines
364387 if (unlikely(!tx))
365388 return ERR_PTR(-ENOMEM);
366389
367− /* so that we can test if the sdma decriptors are there */
390+ /* so that we can test if the sdma descriptors are there */
368391 tx->txreq.num_desc = 0;
369392 tx->priv = priv;
370393 tx->txq = txp->txq;
371394 tx->skb = skb;
395+ INIT_LIST_HEAD(&tx->txreq.list);
372396
373397 hfi1_ipoib_build_ib_tx_headers(tx, txp);
374398
@@ -469,6 +493,7 @@ static int hfi1_ipoib_send_dma_single(struct net_device *dev, · 94 unmodified lines
469493
470494 ret = hfi1_ipoib_submit_tx(txq, tx);
471495 if (likely(!ret)) {
496+tx_ok:
472497 trace_sdma_output_ibhdr(tx->priv->dd,
473498 &tx->sdma_hdr.hdr,
474499 ib_is_sc5(txp->flow.sc5));
@@ -478,20 +503,8 @@ static int hfi1_ipoib_send_dma_single(struct net_device *dev, · 3 unmodified lines
478503
479504 txq->pkts_sent = false;
480505
481− if (ret == -EBUSY) {
482− list_add_tail(&tx->txreq.list, &txq->tx_list);
483−
484− trace_sdma_output_ibhdr(tx->priv->dd,
485− &tx->sdma_hdr.hdr,
486− ib_is_sc5(txp->flow.sc5));
487− hfi1_ipoib_check_queue_depth(txq);
488− return NETDEV_TX_OK;
489− }
490−
491− if (ret == -ECOMM) {
492− hfi1_ipoib_check_queue_depth(txq);
493− return NETDEV_TX_OK;
494− }
506+ if (ret == -EBUSY || ret == -ECOMM)
507+ goto tx_ok;
495508
496509 sdma_txclean(priv->dd, &tx->txreq);
497510 dev_kfree_skb_any(skb);
@@ -509,9 +522,17 @@ static int hfi1_ipoib_send_dma_list(struct net_device *dev, · 11 unmodified lines
509522 struct ipoib_txreq *tx;
510523
511524 /* Has the flow change ? */
512− if (txq->flow.as_int != txp->flow.as_int)
513− (void)hfi1_ipoib_flush_tx_list(dev, txq);
514−
525+ if (txq->flow.as_int != txp->flow.as_int) {
526+ int ret;
527+
528+ ret = hfi1_ipoib_flush_tx_list(dev, txq);
529+ if (unlikely(ret)) {
530+ if (ret == -EBUSY)
531+ ++dev->stats.tx_dropped;
532+ dev_kfree_skb_any(skb);
533+ return NETDEV_TX_OK;
534+ }
535+ }
515536 tx = hfi1_ipoib_send_dma_common(dev, skb, txp);
516537 if (IS_ERR(tx)) {
517538 int ret = PTR_ERR(tx);
@@ -610,10 +631,14 @@ static int hfi1_ipoib_sdma_sleep(struct sdma_engine *sde, · 92 unmodified lines
610631 return -EAGAIN;
611632 }
612633
613− netif_stop_subqueue(txq->priv->netdev, txq->q_idx);
614−
615− if (list_empty(&txq->wait.list))
634+ if (list_empty(&txreq->list))
635+ /* came from non-list submit */
636+ list_add_tail(&txreq->list, &txq->tx_list);
637+ if (list_empty(&txq->wait.list)) {
638+ if (!atomic_xchg(&txq->no_desc, 1))
639+ hfi1_ipoib_stop_txq(txq);
616640 iowait_queue(pkts_sent, wait->iow, &sde->dmawait);
641+ }
617642
618643 write_sequnlock(&sde->waitlock);
619644 return -EBUSY;
@@ -648,9 +673,9 @@ static void hfi1_ipoib_flush_txq(struct work_struct *work) · 28 unmodified lines
648673 struct net_device *dev = txq->priv->netdev;
649674
650675 if (likely(dev->reg_state == NETREG_REGISTERED) &&
651− likely(__netif_subqueue_stopped(dev, txq->q_idx)) &&
652676 likely(!hfi1_ipoib_flush_tx_list(dev, txq)))
653− netif_wake_subqueue(dev, txq->q_idx);
677+ if (atomic_xchg(&txq->no_desc, 0))
678+ hfi1_ipoib_wake_txq(txq);
654679 }
655680
656681 int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv)
@@ -704,6 +729,9 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) · 47 unmodified lines
704729 txq->sde = NULL;
705730 INIT_LIST_HEAD(&txq->tx_list);
706731 atomic64_set(&txq->complete_txreqs, 0);
732+ atomic_set(&txq->stops, 0);
733+ atomic_set(&txq->ring_full, 0);
734+ atomic_set(&txq->no_desc, 0);
707735 txq->q_idx = i;
708736 txq->flow.tx_queue = 0xff;
709737 txq->flow.sc5 = 0xff;
@@ -769,7 +797,7 @@ static void hfi1_ipoib_drain_tx_list(struct hfi1_ipoib_txq *txq) · 59 unmodified lines
769797 atomic64_inc(complete_txreqs);
770798 }
771799
772− if (hfi1_ipoib_txreqs(txq->sent_txreqs, atomic64_read(complete_txreqs)))
800+ if (hfi1_ipoib_used(txq))
773801 dd_dev_warn(txq->priv->dd,
774802 "txq %d not empty found %llu requests\n",
775803 txq->q_idx,
drivers/infiniband/hw/hfi1/netdev_rx.c+1−1
@@ -373,7 +373,7 @@ void hfi1_netdev_free(struct hfi1_devdata *dd) · 372 unmodified lines
373373 {
374374 if (dd->dummy_netdev) {
375375 dd_dev_info(dd, "hfi1 netdev freed\n");
376− free_netdev(dd->dummy_netdev);
376+ kfree(dd->dummy_netdev);
377377 dd->dummy_netdev = NULL;
378378 }
379379 }
drivers/infiniband/hw/hfi1/qp.c+5−2
@@ -195,7 +195,7 @@ static inline int verbs_mtu_enum_to_int(struct ib_device *dev, enum ib_mtu mtu) · 194 unmodified lines
195195 {
196196 /* Constraining 10KB packets to 8KB packets */
197197 if (mtu == (enum ib_mtu)OPA_MTU_10240)
198− mtu = OPA_MTU_8192;
198+ mtu = (enum ib_mtu)OPA_MTU_8192;
199199 return opa_mtu_enum_to_int((enum opa_mtu)mtu);
200200 }
201201
@@ -367,7 +367,10 @@ bool _hfi1_schedule_send(struct rvt_qp *qp) · 165 unmodified lines
367367 struct hfi1_ibport *ibp =
368368 to_iport(qp->ibqp.device, qp->port_num);
369369 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
370− struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device);
370+ struct hfi1_devdata *dd = ppd->dd;
371+
372+ if (dd->flags & HFI1_SHUTDOWN)
373+ return true;
371374
372375 return iowait_schedule(&priv->s_iowait, ppd->hfi1_wq,
373376 priv->s_sde ?
drivers/infiniband/hw/hfi1/tid_rdma.c+4−1
@@ -5406,7 +5406,10 @@ static bool _hfi1_schedule_tid_send(struct rvt_qp *qp) · 5405 unmodified lines
54065406 struct hfi1_ibport *ibp =
54075407 to_iport(qp->ibqp.device, qp->port_num);
54085408 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
5409− struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device);
5409+ struct hfi1_devdata *dd = ppd->dd;
5410+
5411+ if ((dd->flags & HFI1_SHUTDOWN))
5412+ return true;
54105413
54115414 return iowait_tid_schedule(&priv->s_iowait, ppd->hfi1_wq,
54125415 priv->s_sde ?
drivers/infiniband/hw/hfi1/verbs_txreq.h+1−1
@@ -91,7 +91,7 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, · 90 unmodified lines
9191 tx->mr = NULL;
9292 tx->sde = priv->s_sde;
9393 tx->psc = priv->s_sendcontext;
94− /* so that we can test if the sdma decriptors are there */
94+ /* so that we can test if the sdma descriptors are there */
9595 tx->txreq.num_desc = 0;
9696 /* Set the header type */
9797 tx->phdr.hdr.hdr_type = priv->hdr_type;
drivers/infiniband/hw/hns/hns_roce_device.h+4−3
@@ -898,13 +898,14 @@ struct hns_roce_hw { · 897 unmodified lines
898898 int (*set_mac)(struct hns_roce_dev *hr_dev, u8 phy_port, u8 *addr);
899899 void (*set_mtu)(struct hns_roce_dev *hr_dev, u8 phy_port,
900900 enum ib_mtu mtu);
901− int (*write_mtpt)(void *mb_buf, struct hns_roce_mr *mr,
902− unsigned long mtpt_idx);
901+ int (*write_mtpt)(struct hns_roce_dev *hr_dev, void *mb_buf,
902+ struct hns_roce_mr *mr, unsigned long mtpt_idx);
903903 int (*rereg_write_mtpt)(struct hns_roce_dev *hr_dev,
904904 struct hns_roce_mr *mr, int flags, u32 pdn,
905905 int mr_access_flags, u64 iova, u64 size,
906906 void *mb_buf);
907− int (*frmr_write_mtpt)(void *mb_buf, struct hns_roce_mr *mr);
907+ int (*frmr_write_mtpt)(struct hns_roce_dev *hr_dev, void *mb_buf,
908+ struct hns_roce_mr *mr);
908909 int (*mw_write_mtpt)(void *mb_buf, struct hns_roce_mw *mw);
909910 void (*write_cqc)(struct hns_roce_dev *hr_dev,
910911 struct hns_roce_cq *hr_cq, void *mb_buf, u64 *mtts,
drivers/infiniband/hw/hns/hns_roce_hw_v1.c+2−2
@@ -1756,10 +1756,10 @@ static void hns_roce_v1_set_mtu(struct hns_roce_dev *hr_dev, u8 phy_port, · 1755 unmodified lines
17561756 val);
17571757 }
17581758
1759−static int hns_roce_v1_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
1759+static int hns_roce_v1_write_mtpt(struct hns_roce_dev *hr_dev, void *mb_buf,
1760+ struct hns_roce_mr *mr,
17601761 unsigned long mtpt_idx)
17611762 {
1762− struct hns_roce_dev *hr_dev = to_hr_dev(mr->ibmr.device);
17631763 u64 pages[HNS_ROCE_MAX_INNER_MTPT_NUM] = { 0 };
17641764 struct ib_device *ibdev = &hr_dev->ib_dev;
17651765 struct hns_roce_v1_mpt_entry *mpt_entry;
drivers/infiniband/hw/hns/hns_roce_hw_v2.c+9−8
@@ -910,7 +910,7 @@ static int hns_roce_v2_rst_process_cmd(struct hns_roce_dev *hr_dev) · 909 unmodified lines
910910 instance_stage = handle->rinfo.instance_state;
911911 reset_stage = handle->rinfo.reset_state;
912912 reset_cnt = ops->ae_dev_reset_cnt(handle);
913− hw_resetting = ops->get_hw_reset_stat(handle);
913+ hw_resetting = ops->get_cmdq_stat(handle);
914914 sw_resetting = ops->ae_dev_resetting(handle);
915915
916916 if (reset_cnt != hr_dev->reset_cnt)
@@ -2529,10 +2529,10 @@ static int hns_roce_v2_set_mac(struct hns_roce_dev *hr_dev, u8 phy_port, · 1612 unmodified lines
25292529 return hns_roce_cmq_send(hr_dev, &desc, 1);
25302530 }
25312531
2532−static int set_mtpt_pbl(struct hns_roce_v2_mpt_entry *mpt_entry,
2532+static int set_mtpt_pbl(struct hns_roce_dev *hr_dev,
2533+ struct hns_roce_v2_mpt_entry *mpt_entry,
25332534 struct hns_roce_mr *mr)
25342535 {
2535− struct hns_roce_dev *hr_dev = to_hr_dev(mr->ibmr.device);
25362536 u64 pages[HNS_ROCE_V2_MAX_INNER_MTPT_NUM] = { 0 };
25372537 struct ib_device *ibdev = &hr_dev->ib_dev;
25382538 dma_addr_t pbl_ba;
@@ -2571,7 +2571,8 @@ static int set_mtpt_pbl(struct hns_roce_v2_mpt_entry *mpt_entry, · 32 unmodified lines
25712571 return 0;
25722572 }
25732573
2574−static int hns_roce_v2_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
2574+static int hns_roce_v2_write_mtpt(struct hns_roce_dev *hr_dev,
2575+ void *mb_buf, struct hns_roce_mr *mr,
25752576 unsigned long mtpt_idx)
25762577 {
25772578 struct hns_roce_v2_mpt_entry *mpt_entry;
@@ -2620,7 +2621,7 @@ static int hns_roce_v2_write_mtpt(void *mb_buf, struct hns_roce_mr *mr, · 42 unmodified lines
26202621 if (mr->type == MR_TYPE_DMA)
26212622 return 0;
26222623
2623− ret = set_mtpt_pbl(mpt_entry, mr);
2624+ ret = set_mtpt_pbl(hr_dev, mpt_entry, mr);
26242625
26252626 return ret;
26262627 }
@@ -2666,15 +2667,15 @@ static int hns_roce_v2_rereg_write_mtpt(struct hns_roce_dev *hr_dev, · 39 unmodified lines
26662667 mr->iova = iova;
26672668 mr->size = size;
26682669
2669− ret = set_mtpt_pbl(mpt_entry, mr);
2670+ ret = set_mtpt_pbl(hr_dev, mpt_entry, mr);
26702671 }
26712672
26722673 return ret;
26732674 }
26742675
2675−static int hns_roce_v2_frmr_write_mtpt(void *mb_buf, struct hns_roce_mr *mr)
2676+static int hns_roce_v2_frmr_write_mtpt(struct hns_roce_dev *hr_dev,
2677+ void *mb_buf, struct hns_roce_mr *mr)
26762678 {
2677− struct hns_roce_dev *hr_dev = to_hr_dev(mr->ibmr.device);
26782679 struct ib_device *ibdev = &hr_dev->ib_dev;
26792680 struct hns_roce_v2_mpt_entry *mpt_entry;
26802681 dma_addr_t pbl_ba = 0;
drivers/infiniband/hw/hns/hns_roce_mr.c+3−2
@@ -180,9 +180,10 @@ static int hns_roce_mr_enable(struct hns_roce_dev *hr_dev, · 179 unmodified lines
180180 }
181181
182182 if (mr->type != MR_TYPE_FRMR)
183− ret = hr_dev->hw->write_mtpt(mailbox->buf, mr, mtpt_idx);
183+ ret = hr_dev->hw->write_mtpt(hr_dev, mailbox->buf, mr,
184+ mtpt_idx);
184185 else
185− ret = hr_dev->hw->frmr_write_mtpt(mailbox->buf, mr);
186+ ret = hr_dev->hw->frmr_write_mtpt(hr_dev, mailbox->buf, mr);
186187 if (ret) {
187188 dev_err(dev, "Write mtpt fail!\n");
188189 goto err_page;
drivers/infiniband/hw/mlx5/main.c+1−1
@@ -511,7 +511,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, · 510 unmodified lines
511511 mdev_port_num);
512512 if (err)
513513 goto out;
514− ext = MLX5_CAP_PCAM_FEATURE(dev->mdev, ptys_extended_ethernet);
514+ ext = !!MLX5_GET_ETH_PROTO(ptys_reg, out, true, eth_proto_capability);
515515 eth_prot_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper);
516516
517517 props->active_width = IB_WIDTH_4X;
drivers/infiniband/hw/mlx5/qp.c+30−25
@@ -1862,7 +1862,7 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 1861 unmodified lines
18621862 if (!in)
18631863 return -ENOMEM;
18641864
1865− if (MLX5_CAP_GEN(mdev, ece_support))
1865+ if (MLX5_CAP_GEN(mdev, ece_support) && ucmd)
18661866 MLX5_SET(create_qp_in, in, ece, ucmd->ece_options);
18671867 qpc = MLX5_ADDR_OF(create_qp_in, in, qpc);
18681868
@@ -2341,18 +2341,18 @@ static void destroy_qp_common(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 472 unmodified lines
23412341 unsigned long flags;
23422342 int err;
23432343
2344− if (qp->ibqp.rwq_ind_tbl) {
2344+ if (qp->is_rss) {
23452345 destroy_rss_raw_qp_tir(dev, qp);
23462346 return;
23472347 }
23482348
2349− base = (qp->ibqp.qp_type == IB_QPT_RAW_PACKET ||
2349+ base = (qp->type == IB_QPT_RAW_PACKET ||
23502350 qp->flags & IB_QP_CREATE_SOURCE_QPN) ?
2351− &qp->raw_packet_qp.rq.base :
2352− &qp->trans_qp.base;
2351+ &qp->raw_packet_qp.rq.base :
2352+ &qp->trans_qp.base;
23532353
23542354 if (qp->state != IB_QPS_RESET) {
2355− if (qp->ibqp.qp_type != IB_QPT_RAW_PACKET &&
2355+ if (qp->type != IB_QPT_RAW_PACKET &&
23562356 !(qp->flags & IB_QP_CREATE_SOURCE_QPN)) {
23572357 err = mlx5_core_qp_modify(dev, MLX5_CMD_OP_2RST_QP, 0,
23582358 NULL, &base->mqp, NULL);
@@ -2368,8 +2368,8 @@ static void destroy_qp_common(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 9 unmodified lines
23682368 base->mqp.qpn);
23692369 }
23702370
2371− get_cqs(qp->ibqp.qp_type, qp->ibqp.send_cq, qp->ibqp.recv_cq,
2372− &send_cq, &recv_cq);
2371+ get_cqs(qp->type, qp->ibqp.send_cq, qp->ibqp.recv_cq, &send_cq,
2372+ &recv_cq);
23732373
23742374 spin_lock_irqsave(&dev->reset_flow_resource_lock, flags);
23752375 mlx5_ib_lock_cqs(send_cq, recv_cq);
@@ -2391,7 +2391,7 @@ static void destroy_qp_common(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 15 unmodified lines
23912391 mlx5_ib_unlock_cqs(send_cq, recv_cq);
23922392 spin_unlock_irqrestore(&dev->reset_flow_resource_lock, flags);
23932393
2394− if (qp->ibqp.qp_type == IB_QPT_RAW_PACKET ||
2394+ if (qp->type == IB_QPT_RAW_PACKET ||
23952395 qp->flags & IB_QP_CREATE_SOURCE_QPN) {
23962396 destroy_raw_packet_qp(dev, qp);
23972397 } else {
@@ -2668,6 +2668,13 @@ static int process_create_flags(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 270 unmodified lines
26682668 if (qp_type == IB_QPT_RAW_PACKET && attr->rwq_ind_tbl)
26692669 return (create_flags) ? -EINVAL : 0;
26702670
2671+ process_create_flag(dev, &create_flags, IB_QP_CREATE_NETIF_QP,
2672+ mlx5_get_flow_namespace(dev->mdev,
2673+ MLX5_FLOW_NAMESPACE_BYPASS),
2674+ qp);
2675+ process_create_flag(dev, &create_flags,
2676+ IB_QP_CREATE_INTEGRITY_EN,
2677+ MLX5_CAP_GEN(mdev, sho), qp);
26712678 process_create_flag(dev, &create_flags,
26722679 IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK,
26732680 MLX5_CAP_GEN(mdev, block_lb_mc), qp);
@@ -2873,7 +2880,6 @@ static int mlx5_ib_destroy_dct(struct mlx5_ib_qp *mqp) · 199 unmodified lines
28732880 static int check_ucmd_data(struct mlx5_ib_dev *dev,
28742881 struct mlx5_create_qp_params *params)
28752882 {
2876− struct ib_qp_init_attr *attr = params->attr;
28772883 struct ib_udata *udata = params->udata;
28782884 size_t size, last;
28792885 int ret;
@@ -2885,14 +2891,7 @@ static int check_ucmd_data(struct mlx5_ib_dev *dev, · 5 unmodified lines
28852891 */
28862892 last = sizeof(struct mlx5_ib_create_qp_rss);
28872893 else
2888− /* IB_QPT_RAW_PACKET doesn't have ECE data */
2889− switch (attr->qp_type) {
2890− case IB_QPT_RAW_PACKET:
2891− last = offsetof(struct mlx5_ib_create_qp, ece_options);
2892− break;
2893− default:
2894− last = offsetof(struct mlx5_ib_create_qp, reserved);
2895− }
2894+ last = offsetof(struct mlx5_ib_create_qp, reserved);
28962895
28972896 if (udata->inlen <= last)
28982897 return 0;
@@ -2907,7 +2906,7 @@ static int check_ucmd_data(struct mlx5_ib_dev *dev, · 8 unmodified lines
29072906 if (!ret)
29082907 mlx5_ib_dbg(
29092908 dev,
2910− "udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lu\n",
2909+ "udata is not cleared, inlen = %zu, ucmd = %zu, last = %zu, size = %zu\n",
29112910 udata->inlen, params->ucmd_size, last, size);
29122911 return ret ? 0 : -EINVAL;
29132912 }
@@ -3002,10 +3001,19 @@ struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attr, · 88 unmodified lines
30023001 return &qp->ibqp;
30033002
30043003 destroy_qp:
3005− if (qp->type == MLX5_IB_QPT_DCT)
3004+ if (qp->type == MLX5_IB_QPT_DCT) {
30063005 mlx5_ib_destroy_dct(qp);
3007− else
3006+ } else {
3007+ /*
3008+ * These lines below are temp solution till QP allocation
3009+ * will be moved to be under IB/core responsiblity.
3010+ */
3011+ qp->ibqp.send_cq = attr->send_cq;
3012+ qp->ibqp.recv_cq = attr->recv_cq;
3013+ qp->ibqp.pd = pd;
30083014 destroy_qp_common(dev, qp, udata);
3015+ }
3016+
30093017 qp = NULL;
30103018 free_qp:
30113019 kfree(qp);
@@ -4162,8 +4170,6 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr, · 1150 unmodified lines
41624170
41634171 if (udata->outlen < min_resp_len)
41644172 return -EINVAL;
4165− resp.response_length = min_resp_len;
4166−
41674173 /*
41684174 * If we don't have enough space for the ECE options,
41694175 * simply indicate it with resp.response_length.
@@ -4384,8 +4390,7 @@ static void to_rdma_ah_attr(struct mlx5_ib_dev *ibdev, · 214 unmodified lines
43844390 MLX5_GET(ads, path, src_addr_index),
43854391 MLX5_GET(ads, path, hop_limit),
43864392 MLX5_GET(ads, path, tclass));
4387− memcpy(ah_attr, MLX5_ADDR_OF(ads, path, rgid_rip),
4388− MLX5_FLD_SZ_BYTES(ads, rgid_rip));
4393+ rdma_ah_set_dgid_raw(ah_attr, MLX5_ADDR_OF(ads, path, rgid_rip));
43894394 }
43904395 }
43914396
drivers/infiniband/hw/mlx5/qpc.c+8−0
@@ -346,6 +346,9 @@ static int get_ece_from_mbox(void *out, u16 opcode) · 345 unmodified lines
346346 int ece = 0;
347347
348348 switch (opcode) {
349+ case MLX5_CMD_OP_INIT2INIT_QP:
350+ ece = MLX5_GET(init2init_qp_out, out, ece);
351+ break;
349352 case MLX5_CMD_OP_INIT2RTR_QP:
350353 ece = MLX5_GET(init2rtr_qp_out, out, ece);
351354 break;
@@ -355,6 +358,9 @@ static int get_ece_from_mbox(void *out, u16 opcode) · 3 unmodified lines
355358 case MLX5_CMD_OP_RTS2RTS_QP:
356359 ece = MLX5_GET(rts2rts_qp_out, out, ece);
357360 break;
361+ case MLX5_CMD_OP_RST2INIT_QP:
362+ ece = MLX5_GET(rst2init_qp_out, out, ece);
363+ break;
358364 default:
359365 break;
360366 }
@@ -406,6 +412,7 @@ static int modify_qp_mbox_alloc(struct mlx5_core_dev *dev, u16 opcode, int qpn, · 45 unmodified lines
406412 return -ENOMEM;
407413 MOD_QP_IN_SET_QPC(rst2init_qp, mbox->in, opcode, qpn,
408414 opt_param_mask, qpc, uid);
415+ MLX5_SET(rst2init_qp_in, mbox->in, ece, ece);
409416 break;
410417 case MLX5_CMD_OP_INIT2RTR_QP:
411418 if (MBOX_ALLOC(mbox, init2rtr_qp))
@@ -439,6 +446,7 @@ static int modify_qp_mbox_alloc(struct mlx5_core_dev *dev, u16 opcode, int qpn, · 27 unmodified lines
439446 return -ENOMEM;
440447 MOD_QP_IN_SET_QPC(init2init_qp, mbox->in, opcode, qpn,
441448 opt_param_mask, qpc, uid);
449+ MLX5_SET(init2init_qp_in, mbox->in, ece, ece);
442450 break;
443451 default:
444452 return -EINVAL;
drivers/infiniband/hw/qedr/qedr_iw_cm.c+11−2
@@ -150,8 +150,17 @@ qedr_iw_issue_event(void *context, · 149 unmodified lines
150150 if (params->cm_info) {
151151 event.ird = params->cm_info->ird;
152152 event.ord = params->cm_info->ord;
153− event.private_data_len = params->cm_info->private_data_len;
154− event.private_data = (void *)params->cm_info->private_data;
153+ /* Only connect_request and reply have valid private data
154+ * the rest of the events this may be left overs from
155+ * connection establishment. CONNECT_REQUEST is issued via
156+ * qedr_iw_mpa_request
157+ */
158+ if (event_type == IW_CM_EVENT_CONNECT_REPLY) {
159+ event.private_data_len =
160+ params->cm_info->private_data_len;
161+ event.private_data =
162+ (void *)params->cm_info->private_data;
163+ }
155164 }
156165
157166 if (ep->cm_id)
drivers/infiniband/sw/rdmavt/qp.c+4−2
@@ -1204,7 +1204,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd, · 1203 unmodified lines
12041204 err = alloc_ud_wq_attr(qp, rdi->dparms.node);
12051205 if (err) {
12061206 ret = (ERR_PTR(err));
1207− goto bail_driver_priv;
1207+ goto bail_rq_rvt;
12081208 }
12091209
12101210 if (init_attr->create_flags & IB_QP_CREATE_NETDEV_USE)
@@ -1314,9 +1314,11 @@ bail_qpn: · 103 unmodified lines
13141314 rvt_free_qpn(&rdi->qp_dev->qpn_table, qp->ibqp.qp_num);
13151315
13161316 bail_rq_wq:
1317− rvt_free_rq(&qp->r_rq);
13181317 free_ud_wq_attr(qp);
13191318
1319+bail_rq_rvt:
1320+ rvt_free_rq(&qp->r_rq);
1321+
13201322 bail_driver_priv:
13211323 rdi->driver_f.qp_priv_free(rdi, qp);
13221324
drivers/infiniband/sw/siw/siw_main.c+2−1
@@ -67,12 +67,13 @@ static int siw_device_register(struct siw_device *sdev, const char *name) · 66 unmodified lines
6767 static int dev_id = 1;
6868 int rv;
6969
70+ sdev->vendor_part_id = dev_id++;
71+
7072 rv = ib_register_device(base_dev, name);
7173 if (rv) {
7274 pr_warn("siw: device registration error %d\n", rv);
7375 return rv;
7476 }
75− sdev->vendor_part_id = dev_id++;
7677
7778 siw_dbg(base_dev, "HWaddr=%pM\n", sdev->netdev->dev_addr);
7879
drivers/infiniband/sw/siw/siw_qp_rx.c+2−1
@@ -139,7 +139,8 @@ static int siw_rx_pbl(struct siw_rx_stream *srx, int *pbl_idx, · 138 unmodified lines
139139 break;
140140
141141 bytes = min(bytes, len);
142− if (siw_rx_kva(srx, (void *)buf_addr, bytes) == bytes) {
142+ if (siw_rx_kva(srx, (void *)(uintptr_t)buf_addr, bytes) ==
143+ bytes) {
143144 copied += bytes;
144145 offset += bytes;
145146 len -= bytes;
drivers/input/mouse/elan_i2c_core.c+5−4
@@ -951,6 +951,8 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) · 950 unmodified lines
951951 u8 hover_info = packet[ETP_HOVER_INFO_OFFSET];
952952 bool contact_valid, hover_event;
953953
954+ pm_wakeup_event(&data->client->dev, 0);
955+
954956 hover_event = hover_info & 0x40;
955957 for (i = 0; i < ETP_MAX_FINGERS; i++) {
956958 contact_valid = tp_info & (1U << (3 + i));
@@ -974,6 +976,8 @@ static void elan_report_trackpoint(struct elan_tp_data *data, u8 *report) · 17 unmodified lines
974976 u8 *packet = &report[ETP_REPORT_ID_OFFSET + 1];
975977 int x, y;
976978
979+ pm_wakeup_event(&data->client->dev, 0);
980+
977981 if (!data->tp_input) {
978982 dev_warn_once(&data->client->dev,
979983 "received a trackpoint report while no trackpoint device has been created. Please report upstream.\n");
@@ -998,7 +1002,6 @@ static void elan_report_trackpoint(struct elan_tp_data *data, u8 *report) · 18 unmodified lines
9981002 static irqreturn_t elan_isr(int irq, void *dev_id)
9991003 {
10001004 struct elan_tp_data *data = dev_id;
1001− struct device *dev = &data->client->dev;
10021005 int error;
10031006 u8 report[ETP_MAX_REPORT_LEN];
10041007
@@ -1016,8 +1019,6 @@ static irqreturn_t elan_isr(int irq, void *dev_id) · 11 unmodified lines
10161019 if (error)
10171020 goto out;
10181021
1019− pm_wakeup_event(dev, 0);
1020−
10211022 switch (report[ETP_REPORT_ID_OFFSET]) {
10221023 case ETP_REPORT_ID:
10231024 elan_report_absolute(data, report);
@@ -1026,7 +1027,7 @@ static irqreturn_t elan_isr(int irq, void *dev_id) · 2 unmodified lines
10261027 elan_report_trackpoint(data, report);
10271028 break;
10281029 default:
1029− dev_err(dev, "invalid report id data (%x)\n",
1030+ dev_err(&data->client->dev, "invalid report id data (%x)\n",
10301031 report[ETP_REPORT_ID_OFFSET]);
10311032 }
10321033
drivers/input/mouse/synaptics.c+1−0
@@ -179,6 +179,7 @@ static const char * const smbus_pnp_ids[] = { · 178 unmodified lines
179179 "LEN0093", /* T480 */
180180 "LEN0096", /* X280 */
181181 "LEN0097", /* X280 -> ALPS trackpoint */
182+ "LEN0099", /* X1 Extreme 1st */
182183 "LEN009b", /* T580 */
183184 "LEN200f", /* T450s */
184185 "LEN2044", /* L470 */
drivers/input/serio/i8042-x86ia64io.h+7−0
@@ -425,6 +425,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { · 424 unmodified lines
425425 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
426426 },
427427 },
428+ {
429+ /* Lenovo XiaoXin Air 12 */
430+ .matches = {
431+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
432+ DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
433+ },
434+ },
428435 {
429436 .matches = {
430437 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
drivers/input/touchscreen/elants_i2c.c+0−1
@@ -1325,7 +1325,6 @@ static int elants_i2c_probe(struct i2c_client *client, · 1324 unmodified lines
13251325 0, MT_TOOL_PALM, 0, 0);
13261326 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);
13271327 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
1328− input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
13291328
13301329 touchscreen_parse_properties(ts->input, true, &ts->prop);
13311330
drivers/iommu/Kconfig+2−1
@@ -211,7 +211,7 @@ config INTEL_IOMMU_DEBUGFS · 210 unmodified lines
211211
212212 config INTEL_IOMMU_SVM
213213 bool "Support for Shared Virtual Memory with Intel IOMMU"
214− depends on INTEL_IOMMU && X86
214+ depends on INTEL_IOMMU && X86_64
215215 select PCI_PASID
216216 select PCI_PRI
217217 select MMU_NOTIFIER
@@ -305,6 +305,7 @@ config ROCKCHIP_IOMMU · 87 unmodified lines
305305
306306 config SUN50I_IOMMU
307307 bool "Allwinner H6 IOMMU Support"
308+ depends on HAS_DMA
308309 depends on ARCH_SUNXI || COMPILE_TEST
309310 select ARM_DMA_USE_IOMMU
310311 select IOMMU_API
drivers/iommu/amd/amd_iommu.h+1−1
@@ -102,7 +102,7 @@ extern int __init add_special_device(u8 type, u8 id, u16 *devid, · 101 unmodified lines
102102 #ifdef CONFIG_DMI
103103 void amd_iommu_apply_ivrs_quirks(void);
104104 #else
105−static void amd_iommu_apply_ivrs_quirks(void) { }
105+static inline void amd_iommu_apply_ivrs_quirks(void) { }
106106 #endif
107107
108108 #endif
drivers/iommu/amd/iommu.c+3−2
@@ -3985,9 +3985,10 @@ int amd_iommu_create_irq_domain(struct amd_iommu *iommu) · 3984 unmodified lines
39853985 if (!fn)
39863986 return -ENOMEM;
39873987 iommu->ir_domain = irq_domain_create_tree(fn, &amd_ir_domain_ops, iommu);
3988− irq_domain_free_fwnode(fn);
3989− if (!iommu->ir_domain)
3988+ if (!iommu->ir_domain) {
3989+ irq_domain_free_fwnode(fn);
39903990 return -ENOMEM;
3991+ }
39913992
39923993 iommu->ir_domain->parent = arch_get_ir_parent_domain();
39933994 iommu->msi_domain = arch_create_remap_msi_irq_domain(iommu->ir_domain,
drivers/iommu/arm-smmu-qcom.c+1−1
@@ -12,7 +12,7 @@ struct qcom_smmu { · 11 unmodified lines
1212 struct arm_smmu_device smmu;
1313 };
1414
15−static const struct of_device_id qcom_smmu_client_of_match[] = {
15+static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = {
1616 { .compatible = "qcom,adreno" },
1717 { .compatible = "qcom,mdp4" },
1818 { .compatible = "qcom,mdss" },
drivers/iommu/hyperv-iommu.c+4−1
@@ -155,7 +155,10 @@ static int __init hyperv_prepare_irq_remapping(void) · 154 unmodified lines
155155 0, IOAPIC_REMAPPING_ENTRY, fn,
156156 &hyperv_ir_domain_ops, NULL);
157157
158− irq_domain_free_fwnode(fn);
158+ if (!ioapic_ir_domain) {
159+ irq_domain_free_fwnode(fn);
160+ return -ENOMEM;
161+ }
159162
160163 /*
161164 * Hyper-V doesn't provide irq remapping function for
drivers/iommu/intel/dmar.c+2−1
@@ -898,7 +898,8 @@ int __init detect_intel_iommu(void) · 897 unmodified lines
898898 if (!ret)
899899 ret = dmar_walk_dmar_table((struct acpi_table_dmar *)dmar_tbl,
900900 &validate_drhd_cb);
901− if (!ret && !no_iommu && !iommu_detected && !dmar_disabled) {
901+ if (!ret && !no_iommu && !iommu_detected &&
902+ (!dmar_disabled || dmar_platform_optin())) {
902903 iommu_detected = 1;
903904 /* Make sure ACS will be enabled */
904905 pci_request_acs();
drivers/iommu/intel/iommu.c+52−7
@@ -612,6 +612,12 @@ struct intel_iommu *domain_get_iommu(struct dmar_domain *domain) · 611 unmodified lines
612612 return g_iommus[iommu_id];
613613 }
614614
615+static inline bool iommu_paging_structure_coherency(struct intel_iommu *iommu)
616+{
617+ return sm_supported(iommu) ?
618+ ecap_smpwc(iommu->ecap) : ecap_coherent(iommu->ecap);
619+}
620+
615621 static void domain_update_iommu_coherency(struct dmar_domain *domain)
616622 {
617623 struct dmar_drhd_unit *drhd;
@@ -623,7 +629,7 @@ static void domain_update_iommu_coherency(struct dmar_domain *domain) · 5 unmodified lines
623629
624630 for_each_domain_iommu(i, domain) {
625631 found = true;
626− if (!ecap_coherent(g_iommus[i]->ecap)) {
632+ if (!iommu_paging_structure_coherency(g_iommus[i])) {
627633 domain->iommu_coherency = 0;
628634 break;
629635 }
@@ -634,7 +640,7 @@ static void domain_update_iommu_coherency(struct dmar_domain *domain) · 4 unmodified lines
634640 /* No hardware attached; use lowest common denominator */
635641 rcu_read_lock();
636642 for_each_active_iommu(iommu, drhd) {
637− if (!ecap_coherent(iommu->ecap)) {
643+ if (!iommu_paging_structure_coherency(iommu)) {
638644 domain->iommu_coherency = 0;
639645 break;
640646 }
@@ -921,7 +927,7 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, · 280 unmodified lines
921927 domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE);
922928 pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE;
923929 if (domain_use_first_level(domain))
924− pteval |= DMA_FL_PTE_XD;
930+ pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US;
925931 if (cmpxchg64(&pte->val, 0ULL, pteval))
926932 /* Someone else set it while we were thinking; use theirs. */
927933 free_pgtable_page(tmp_page);
@@ -1951,7 +1957,6 @@ static inline void · 1023 unmodified lines
19511957 context_set_sm_rid2pasid(struct context_entry *context, unsigned long pasid)
19521958 {
19531959 context->hi |= pasid & ((1 << 20) - 1);
1954− context->hi |= (1 << 20);
19551960 }
19561961
19571962 /*
@@ -2095,7 +2100,8 @@ static int domain_context_mapping_one(struct dmar_domain *domain, · 137 unmodified lines
20952100
20962101 context_set_fault_enable(context);
20972102 context_set_present(context);
2098− domain_flush_cache(domain, context, sizeof(*context));
2103+ if (!ecap_coherent(iommu->ecap))
2104+ clflush_cache_range(context, sizeof(*context));
20992105
21002106 /*
21012107 * It's a non-present to present mapping. If hardware doesn't cache
@@ -2243,7 +2249,7 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, · 141 unmodified lines
22432249
22442250 attr = prot & (DMA_PTE_READ | DMA_PTE_WRITE | DMA_PTE_SNP);
22452251 if (domain_use_first_level(domain))
2246− attr |= DMA_FL_PTE_PRESENT | DMA_FL_PTE_XD;
2252+ attr |= DMA_FL_PTE_PRESENT | DMA_FL_PTE_XD | DMA_FL_PTE_US;
22472253
22482254 if (!sg) {
22492255 sg_res = nr_pages;
@@ -2695,7 +2701,9 @@ static int __init si_domain_init(int hw) · 445 unmodified lines
26952701 end >> agaw_to_width(si_domain->agaw)))
26962702 continue;
26972703
2698− ret = iommu_domain_identity_map(si_domain, start, end);
2704+ ret = iommu_domain_identity_map(si_domain,
2705+ mm_to_dma_pfn(start >> PAGE_SHIFT),
2706+ mm_to_dma_pfn(end >> PAGE_SHIFT));
26992707 if (ret)
27002708 return ret;
27012709 }
@@ -6021,6 +6029,23 @@ intel_iommu_domain_set_attr(struct iommu_domain *domain, · 3319 unmodified lines
60216029 return ret;
60226030 }
60236031
6032+/*
6033+ * Check that the device does not live on an external facing PCI port that is
6034+ * marked as untrusted. Such devices should not be able to apply quirks and
6035+ * thus not be able to bypass the IOMMU restrictions.
6036+ */
6037+static bool risky_device(struct pci_dev *pdev)
6038+{
6039+ if (pdev->untrusted) {
6040+ pci_info(pdev,
6041+ "Skipping IOMMU quirk for dev [%04X:%04X] on untrusted PCI link\n",
6042+ pdev->vendor, pdev->device);
6043+ pci_info(pdev, "Please check with your BIOS/Platform vendor about this\n");
6044+ return true;
6045+ }
6046+ return false;
6047+}
6048+
60246049 const struct iommu_ops intel_iommu_ops = {
60256050 .capable = intel_iommu_capable,
60266051 .domain_alloc = intel_iommu_domain_alloc,
@@ -6060,6 +6085,9 @@ const struct iommu_ops intel_iommu_ops = { · 33 unmodified lines
60606085
60616086 static void quirk_iommu_igfx(struct pci_dev *dev)
60626087 {
6088+ if (risky_device(dev))
6089+ return;
6090+
60636091 pci_info(dev, "Disabling IOMMU for graphics on this chipset\n");
60646092 dmar_map_gfx = 0;
60656093 }
@@ -6101,6 +6129,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163D, quirk_iommu_igfx); · 35 unmodified lines
61016129
61026130 static void quirk_iommu_rwbf(struct pci_dev *dev)
61036131 {
6132+ if (risky_device(dev))
6133+ return;
6134+
61046135 /*
61056136 * Mobile 4 Series Chipset neglects to set RWBF capability,
61066137 * but needs it. Same seems to hold for the desktop versions.
@@ -6131,6 +6162,9 @@ static void quirk_calpella_no_shadow_gtt(struct pci_dev *dev) · 24 unmodified lines
61316162 {
61326163 unsigned short ggc;
61336164
6165+ if (risky_device(dev))
6166+ return;
6167+
61346168 if (pci_read_config_word(dev, GGC, &ggc))
61356169 return;
61366170
@@ -6164,6 +6198,12 @@ static void __init check_tylersburg_isoch(void) · 27 unmodified lines
61646198 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x3a3e, NULL);
61656199 if (!pdev)
61666200 return;
6201+
6202+ if (risky_device(pdev)) {
6203+ pci_dev_put(pdev);
6204+ return;
6205+ }
6206+
61676207 pci_dev_put(pdev);
61686208
61696209 /* System Management Registers. Might be hidden, in which case
@@ -6173,6 +6213,11 @@ static void __init check_tylersburg_isoch(void) · 3 unmodified lines
61736213 if (!pdev)
61746214 return;
61756215
6216+ if (risky_device(pdev)) {
6217+ pci_dev_put(pdev);
6218+ return;
6219+ }
6220+
61766221 if (pci_read_config_dword(pdev, 0x188, &vtisochctrl)) {
61776222 pci_dev_put(pdev);
61786223 return;
drivers/iommu/intel/irq_remapping.c+1−1
@@ -563,8 +563,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) · 562 unmodified lines
563563 0, INTR_REMAP_TABLE_ENTRIES,
564564 fn, &intel_ir_domain_ops,
565565 iommu);
566− irq_domain_free_fwnode(fn);
567566 if (!iommu->ir_domain) {
567+ irq_domain_free_fwnode(fn);
568568 pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id);
569569 goto out_free_bitmap;
570570 }
drivers/iommu/iommu.c+1−1
@@ -295,10 +295,10 @@ void iommu_release_device(struct device *dev) · 294 unmodified lines
295295 return;
296296
297297 iommu_device_unlink(dev->iommu->iommu_dev, dev);
298− iommu_group_remove_device(dev);
299298
300299 ops->release_device(dev);
301300
301+ iommu_group_remove_device(dev);
302302 module_put(ops->owner);
303303 dev_iommu_free(dev);
304304 }
drivers/iommu/sun50i-iommu.c+3−5
@@ -313,9 +313,9 @@ static int sun50i_iommu_flush_all_tlb(struct sun50i_iommu *iommu) · 312 unmodified lines
313313 IOMMU_TLB_FLUSH_MICRO_TLB(1) |
314314 IOMMU_TLB_FLUSH_MICRO_TLB(0));
315315
316− ret = readl_poll_timeout(iommu->base + IOMMU_TLB_FLUSH_REG,
317− reg, !reg,
318− 1, 2000);
316+ ret = readl_poll_timeout_atomic(iommu->base + IOMMU_TLB_FLUSH_REG,
317+ reg, !reg,
318+ 1, 2000);
319319 if (ret)
320320 dev_warn(iommu->dev, "TLB Flush timed out!\n");
321321
@@ -556,7 +556,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova · 234 unmodified lines
556556 {
557557 struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
558558 phys_addr_t pt_phys;
559− dma_addr_t pte_dma;
560559 u32 *pte_addr;
561560 u32 dte;
562561
@@ -566,7 +565,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova · 3 unmodified lines
566565
567566 pt_phys = sun50i_dte_get_pt_address(dte);
568567 pte_addr = (u32 *)phys_to_virt(pt_phys) + sun50i_iova_get_pte_index(iova);
569− pte_dma = pt_phys + sun50i_iova_get_pte_index(iova) * PT_ENTRY_SIZE;
570568
571569 if (!sun50i_pte_is_page_valid(*pte_addr))
572570 return 0;
drivers/irqchip/Kconfig+1−1
@@ -563,7 +563,7 @@ config LOONGSON_PCH_PIC · 562 unmodified lines
563563 Support for the Loongson PCH PIC Controller.
564564
565565 config LOONGSON_PCH_MSI
566− bool "Loongson PCH PIC Controller"
566+ bool "Loongson PCH MSI Controller"
567567 depends on MACH_LOONGSON64 || COMPILE_TEST
568568 depends on PCI
569569 default MACH_LOONGSON64
drivers/irqchip/irq-gic-v3-its.c+12−4
@@ -3797,10 +3797,10 @@ static void its_wait_vpt_parse_complete(void) · 3796 unmodified lines
37973797 if (!gic_rdists->has_vpend_valid_dirty)
37983798 return;
37993799
3800− WARN_ON_ONCE(readq_relaxed_poll_timeout(vlpi_base + GICR_VPENDBASER,
3801− val,
3802− !(val & GICR_VPENDBASER_Dirty),
3803− 10, 500));
3800+ WARN_ON_ONCE(readq_relaxed_poll_timeout_atomic(vlpi_base + GICR_VPENDBASER,
3801+ val,
3802+ !(val & GICR_VPENDBASER_Dirty),
3803+ 10, 500));
38043804 }
38053805
38063806 static void its_vpe_schedule(struct its_vpe *vpe)
@@ -4054,16 +4054,24 @@ static void its_vpe_4_1_deschedule(struct its_vpe *vpe, · 247 unmodified lines
40544054 u64 val;
40554055
40564056 if (info->req_db) {
4057+ unsigned long flags;
4058+
40574059 /*
40584060 * vPE is going to block: make the vPE non-resident with
40594061 * PendingLast clear and DB set. The GIC guarantees that if
40604062 * we read-back PendingLast clear, then a doorbell will be
40614063 * delivered when an interrupt comes.
4064+ *
4065+ * Note the locking to deal with the concurrent update of
4066+ * pending_last from the doorbell interrupt handler that can
4067+ * run concurrently.
40624068 */
4069+ raw_spin_lock_irqsave(&vpe->vpe_lock, flags);
40634070 val = its_clear_vpend_valid(vlpi_base,
40644071 GICR_VPENDBASER_PendingLast,
40654072 GICR_VPENDBASER_4_1_DB);
40664073 vpe->pending_last = !!(val & GICR_VPENDBASER_PendingLast);
4074+ raw_spin_unlock_irqrestore(&vpe->vpe_lock, flags);
40674075 } else {
40684076 /*
40694077 * We're not blocking, so just make the vPE non-resident
drivers/irqchip/irq-gic.c+3−11
@@ -329,10 +329,8 @@ static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu) · 328 unmodified lines
329329 static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
330330 bool force)
331331 {
332− void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
333− unsigned int cpu, shift = (gic_irq(d) % 4) * 8;
334− u32 val, mask, bit;
335− unsigned long flags;
332+ void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + gic_irq(d);
333+ unsigned int cpu;
336334
337335 if (!force)
338336 cpu = cpumask_any_and(mask_val, cpu_online_mask);
@@ -342,13 +340,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, · 3 unmodified lines
342340 if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
343341 return -EINVAL;
344342
345− gic_lock_irqsave(flags);
346− mask = 0xff << shift;
347− bit = gic_cpu_map[cpu] << shift;
348− val = readl_relaxed(reg) & ~mask;
349− writel_relaxed(val | bit, reg);
350− gic_unlock_irqrestore(flags);
351−
343+ writeb_relaxed(gic_cpu_map[cpu], reg);
352344 irq_data_update_effective_affinity(d, cpumask_of(cpu));
353345
354346 return IRQ_SET_MASK_OK_DONE;
drivers/irqchip/irq-riscv-intc.c+1−1
@@ -99,7 +99,7 @@ static int __init riscv_intc_init(struct device_node *node, · 98 unmodified lines
9999
100100 hartid = riscv_of_parent_hartid(node);
101101 if (hartid < 0) {
102− pr_warn("unable to fine hart id for %pOF\n", node);
102+ pr_warn("unable to find hart id for %pOF\n", node);
103103 return 0;
104104 }
105105
drivers/md/dm-ioctl.c+1−1
@@ -1471,7 +1471,7 @@ static void retrieve_deps(struct dm_table *table, · 1470 unmodified lines
14711471 /*
14721472 * Check we have enough space.
14731473 */
1474− needed = sizeof(*deps) + (sizeof(*deps->dev) * count);
1474+ needed = struct_size(deps, dev, count);
14751475 if (len < needed) {
14761476 param->flags |= DM_BUFFER_FULL_FLAG;
14771477 return;
drivers/md/dm-rq.c+0−4
@@ -146,10 +146,6 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig) · 145 unmodified lines
146146 */
147147 static void rq_completed(struct mapped_device *md)
148148 {
149− /* nudge anyone waiting on suspend queue */
150− if (unlikely(wq_has_sleeper(&md->wait)))
151− wake_up(&md->wait);
152−
153149 /*
154150 * dm_put() must be at the end of this function. See the comment above
155151 */
drivers/md/dm-writecache.c+14−2
@@ -282,6 +282,8 @@ static int persistent_memory_claim(struct dm_writecache *wc) · 281 unmodified lines
282282 while (daa-- && i < p) {
283283 pages[i++] = pfn_t_to_page(pfn);
284284 pfn.val++;
285+ if (!(i & 15))
286+ cond_resched();
285287 }
286288 } while (i < p);
287289 wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);
@@ -849,10 +851,14 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_ · 561 unmodified lines
849851
850852 if (likely(!e->write_in_progress)) {
851853 if (!discarded_something) {
852− writecache_wait_for_ios(wc, READ);
853− writecache_wait_for_ios(wc, WRITE);
854+ if (!WC_MODE_PMEM(wc)) {
855+ writecache_wait_for_ios(wc, READ);
856+ writecache_wait_for_ios(wc, WRITE);
857+ }
854858 discarded_something = true;
855859 }
860+ if (!writecache_entry_is_committed(wc, e))
861+ wc->uncommitted_blocks--;
856862 writecache_free_entry(wc, e);
857863 }
858864
@@ -2260,6 +2266,12 @@ invalid_optional: · 1401 unmodified lines
22602266 }
22612267
22622268 if (WC_MODE_PMEM(wc)) {
2269+ if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
2270+ r = -EOPNOTSUPP;
2271+ ti->error = "Asynchronous persistent memory not supported as pmem cache";
2272+ goto bad;
2273+ }
2274+
22632275 r = persistent_memory_claim(wc);
22642276 if (r) {
22652277 ti->error = "Unable to map persistent memory for cache";
drivers/md/dm-zoned-metadata.c+39−12
@@ -1078,7 +1078,8 @@ static int dmz_check_sb(struct dmz_metadata *zmd, struct dmz_sb *dsb, · 1077 unmodified lines
10781078 nr_meta_zones = (le32_to_cpu(sb->nr_meta_blocks) + zmd->zone_nr_blocks - 1)
10791079 >> zmd->zone_nr_blocks_shift;
10801080 if (!nr_meta_zones ||
1081− nr_meta_zones >= zmd->nr_rnd_zones) {
1081+ (zmd->nr_devs <= 1 && nr_meta_zones >= zmd->nr_rnd_zones) ||
1082+ (zmd->nr_devs > 1 && nr_meta_zones >= zmd->nr_cache_zones)) {
10821083 dmz_dev_err(dev, "Invalid number of metadata blocks");
10831084 return -ENXIO;
10841085 }
@@ -1949,7 +1950,7 @@ static struct dm_zone *dmz_get_rnd_zone_for_reclaim(struct dmz_metadata *zmd, · 864 unmodified lines
19491950 unsigned int idx, bool idle)
19501951 {
19511952 struct dm_zone *dzone = NULL;
1952− struct dm_zone *zone, *last = NULL;
1953+ struct dm_zone *zone, *maxw_z = NULL;
19531954 struct list_head *zone_list;
19541955
19551956 /* If we have cache zones select from the cache zone list */
@@ -1961,18 +1962,37 @@ static struct dm_zone *dmz_get_rnd_zone_for_reclaim(struct dmz_metadata *zmd, · 5 unmodified lines
19611962 } else
19621963 zone_list = &zmd->dev[idx].map_rnd_list;
19631964
1965+ /*
1966+ * Find the buffer zone with the heaviest weight or the first (oldest)
1967+ * data zone that can be reclaimed.
1968+ */
19641969 list_for_each_entry(zone, zone_list, link) {
19651970 if (dmz_is_buf(zone)) {
19661971 dzone = zone->bzone;
1967− if (dzone->dev->dev_idx != idx)
1968− continue;
1969− if (!last) {
1970− last = dzone;
1972+ if (dmz_is_rnd(dzone) && dzone->dev->dev_idx != idx)
19711973 continue;
1972− }
1973− if (last->weight < dzone->weight)
1974+ if (!maxw_z || maxw_z->weight < dzone->weight)
1975+ maxw_z = dzone;
1976+ } else {
1977+ dzone = zone;
1978+ if (dmz_lock_zone_reclaim(dzone))
1979+ return dzone;
1980+ }
1981+ }
1982+
1983+ if (maxw_z && dmz_lock_zone_reclaim(maxw_z))
1984+ return maxw_z;
1985+
1986+ /*
1987+ * If we come here, none of the zones inspected could be locked for
1988+ * reclaim. Try again, being more aggressive, that is, find the
1989+ * first zone that can be reclaimed regardless of its weitght.
1990+ */
1991+ list_for_each_entry(zone, zone_list, link) {
1992+ if (dmz_is_buf(zone)) {
1993+ dzone = zone->bzone;
1994+ if (dmz_is_rnd(dzone) && dzone->dev->dev_idx != idx)
19741995 continue;
1975− dzone = last;
19761996 } else
19771997 dzone = zone;
19781998 if (dmz_lock_zone_reclaim(dzone))
@@ -2006,7 +2026,7 @@ static struct dm_zone *dmz_get_seq_zone_for_reclaim(struct dmz_metadata *zmd, · 27 unmodified lines
20062026 struct dm_zone *dmz_get_zone_for_reclaim(struct dmz_metadata *zmd,
20072027 unsigned int dev_idx, bool idle)
20082028 {
2009− struct dm_zone *zone;
2029+ struct dm_zone *zone = NULL;
20102030
20112031 /*
20122032 * Search for a zone candidate to reclaim: 2 cases are possible.
@@ -2019,7 +2039,7 @@ struct dm_zone *dmz_get_zone_for_reclaim(struct dmz_metadata *zmd, · 6 unmodified lines
20192039 dmz_lock_map(zmd);
20202040 if (list_empty(&zmd->reserved_seq_zones_list))
20212041 zone = dmz_get_seq_zone_for_reclaim(zmd, dev_idx);
2022− else
2042+ if (!zone)
20232043 zone = dmz_get_rnd_zone_for_reclaim(zmd, dev_idx, idle);
20242044 dmz_unlock_map(zmd);
20252045
@@ -2197,8 +2217,15 @@ struct dm_zone *dmz_alloc_zone(struct dmz_metadata *zmd, unsigned int dev_idx, · 171 unmodified lines
21972217 {
21982218 struct list_head *list;
21992219 struct dm_zone *zone;
2200− int i = 0;
2220+ int i;
2221+
2222+ /* Schedule reclaim to ensure free zones are available */
2223+ if (!(flags & DMZ_ALLOC_RECLAIM)) {
2224+ for (i = 0; i < zmd->nr_devs; i++)
2225+ dmz_schedule_reclaim(zmd->dev[i].reclaim);
2226+ }
22012227
2228+ i = 0;
22022229 again:
22032230 if (flags & DMZ_ALLOC_CACHE)
22042231 list = &zmd->unmap_cache_list;
drivers/md/dm-zoned-reclaim.c+4−7
@@ -377,6 +377,7 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc) · 376 unmodified lines
377377 dmz_metadata_label(zmd), zrc->dev_idx);
378378 return -EBUSY;
379379 }
380+ rzone = dzone;
380381
381382 start = jiffies;
382383 if (dmz_is_cache(dzone) || dmz_is_rnd(dzone)) {
@@ -391,8 +392,6 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc) · 8 unmodified lines
391392 */
392393 ret = dmz_reclaim_rnd_data(zrc, dzone);
393394 }
394− rzone = dzone;
395−
396395 } else {
397396 struct dm_zone *bzone = dzone->bzone;
398397 sector_t chunk_block = 0;
@@ -415,7 +414,6 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc) · 16 unmodified lines
415414 * be later reclaimed.
416415 */
417416 ret = dmz_reclaim_seq_data(zrc, dzone);
418− rzone = dzone;
419417 }
420418 }
421419 out:
@@ -458,6 +456,8 @@ static unsigned int dmz_reclaim_percentage(struct dmz_reclaim *zrc) · 36 unmodified lines
458456 nr_zones = dmz_nr_rnd_zones(zmd, zrc->dev_idx);
459457 nr_unmap = dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx);
460458 }
459+ if (nr_unmap <= 1)
460+ return 0;
461461 return nr_unmap * 100 / nr_zones;
462462 }
463463
@@ -503,7 +503,7 @@ static void dmz_reclaim_work(struct work_struct *work) · 39 unmodified lines
503503 {
504504 struct dmz_reclaim *zrc = container_of(work, struct dmz_reclaim, work.work);
505505 struct dmz_metadata *zmd = zrc->metadata;
506− unsigned int p_unmap, nr_unmap_rnd = 0, nr_rnd = 0;
506+ unsigned int p_unmap;
507507 int ret;
508508
509509 if (dmz_dev_is_dying(zmd))
@@ -529,9 +529,6 @@ static void dmz_reclaim_work(struct work_struct *work) · 19 unmodified lines
529529 zrc->kc_throttle.throttle = min(75U, 100U - p_unmap / 2);
530530 }
531531
532− nr_unmap_rnd = dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx);
533− nr_rnd = dmz_nr_rnd_zones(zmd, zrc->dev_idx);
534−
535532 DMDEBUG("(%s/%u): Reclaim (%u): %s, %u%% free zones (%u/%u cache %u/%u random)",
536533 dmz_metadata_label(zmd), zrc->dev_idx,
537534 zrc->kc_throttle.throttle,
drivers/md/dm-zoned-target.c+2−10
@@ -400,15 +400,7 @@ static void dmz_handle_bio(struct dmz_target *dmz, struct dm_chunk_work *cw, · 399 unmodified lines
400400 dm_per_bio_data(bio, sizeof(struct dmz_bioctx));
401401 struct dmz_metadata *zmd = dmz->metadata;
402402 struct dm_zone *zone;
403− int i, ret;
404−
405− /*
406− * Write may trigger a zone allocation. So make sure the
407− * allocation can succeed.
408− */
409− if (bio_op(bio) == REQ_OP_WRITE)
410− for (i = 0; i < dmz->nr_ddevs; i++)
411− dmz_schedule_reclaim(dmz->dev[i].reclaim);
403+ int ret;
412404
413405 dmz_lock_metadata(zmd);
414406
@@ -890,7 +882,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 475 unmodified lines
890882 }
891883
892884 /* Set target (no write same support) */
893− ti->max_io_len = dmz_zone_nr_sectors(dmz->metadata) << 9;
885+ ti->max_io_len = dmz_zone_nr_sectors(dmz->metadata);
894886 ti->num_flush_bios = 1;
895887 ti->num_discard_bios = 1;
896888 ti->num_write_zeroes_bios = 1;
drivers/md/dm.c+66−31
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/init.h>
1313 #include <linux/module.h>
1414 #include <linux/mutex.h>
15+#include <linux/sched/mm.h>
1516 #include <linux/sched/signal.h>
1617 #include <linux/blkpg.h>
1718 #include <linux/bio.h>
@@ -654,28 +655,6 @@ static void free_tio(struct dm_target_io *tio) · 636 unmodified lines
654655 bio_put(&tio->clone);
655656 }
656657
657−static bool md_in_flight_bios(struct mapped_device *md)
658−{
659− int cpu;
660− struct hd_struct *part = &dm_disk(md)->part0;
661− long sum = 0;
662−
663− for_each_possible_cpu(cpu) {
664− sum += part_stat_local_read_cpu(part, in_flight[0], cpu);
665− sum += part_stat_local_read_cpu(part, in_flight[1], cpu);
666− }
667−
668− return sum != 0;
669−}
670−
671−static bool md_in_flight(struct mapped_device *md)
672−{
673− if (queue_is_mq(md->queue))
674− return blk_mq_queue_inflight(md->queue);
675− else
676− return md_in_flight_bios(md);
677−}
678−
679658 u64 dm_start_time_ns_from_clone(struct bio *bio)
680659 {
681660 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
@@ -1009,6 +988,7 @@ static void clone_endio(struct bio *bio) · 327 unmodified lines
1009988 struct dm_io *io = tio->io;
1010989 struct mapped_device *md = tio->io->md;
1011990 dm_endio_fn endio = tio->ti->type->end_io;
991+ struct bio *orig_bio = io->orig_bio;
1012992
1013993 if (unlikely(error == BLK_STS_TARGET) && md->type != DM_TYPE_NVME_BIO_BASED) {
1014994 if (bio_op(bio) == REQ_OP_DISCARD &&
@@ -1022,6 +1002,18 @@ static void clone_endio(struct bio *bio) · 7 unmodified lines
10221002 disable_write_zeroes(md);
10231003 }
10241004
1005+ /*
1006+ * For zone-append bios get offset in zone of the written
1007+ * sector and add that to the original bio sector pos.
1008+ */
1009+ if (bio_op(orig_bio) == REQ_OP_ZONE_APPEND) {
1010+ sector_t written_sector = bio->bi_iter.bi_sector;
1011+ struct request_queue *q = orig_bio->bi_disk->queue;
1012+ u64 mask = (u64)blk_queue_zone_sectors(q) - 1;
1013+
1014+ orig_bio->bi_iter.bi_sector += written_sector & mask;
1015+ }
1016+
10251017 if (endio) {
10261018 int r = endio(tio->ti, bio, &error);
10271019 switch (r) {
@@ -1452,9 +1444,6 @@ static int __send_empty_flush(struct clone_info *ci) · 424 unmodified lines
14521444 BUG_ON(bio_has_data(ci->bio));
14531445 while ((ti = dm_table_get_target(ci->map, target_nr++)))
14541446 __send_duplicate_bios(ci, ti, ti->num_flush_bios, NULL);
1455−
1456− bio_disassociate_blkg(ci->bio);
1457−
14581447 return 0;
14591448 }
14601449
@@ -1642,6 +1631,7 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 181 unmodified lines
16421631 ci.bio = &flush_bio;
16431632 ci.sector_count = 0;
16441633 error = __send_empty_flush(&ci);
1634+ bio_uninit(ci.bio);
16451635 /* dec_pending submits any data associated with flush */
16461636 } else if (op_is_zone_mgmt(bio_op(bio))) {
16471637 ci.bio = bio;
@@ -1716,6 +1706,7 @@ static blk_qc_t __process_bio(struct mapped_device *md, struct dm_table *map, · 68 unmodified lines
17161706 ci.bio = &flush_bio;
17171707 ci.sector_count = 0;
17181708 error = __send_empty_flush(&ci);
1709+ bio_uninit(ci.bio);
17191710 /* dec_pending submits any data associated with flush */
17201711 } else {
17211712 struct dm_target_io *tio;
@@ -2457,15 +2448,29 @@ void dm_put(struct mapped_device *md) · 735 unmodified lines
24572448 }
24582449 EXPORT_SYMBOL_GPL(dm_put);
24592450
2460−static int dm_wait_for_completion(struct mapped_device *md, long task_state)
2451+static bool md_in_flight_bios(struct mapped_device *md)
2452+{
2453+ int cpu;
2454+ struct hd_struct *part = &dm_disk(md)->part0;
2455+ long sum = 0;
2456+
2457+ for_each_possible_cpu(cpu) {
2458+ sum += part_stat_local_read_cpu(part, in_flight[0], cpu);
2459+ sum += part_stat_local_read_cpu(part, in_flight[1], cpu);
2460+ }
2461+
2462+ return sum != 0;
2463+}
2464+
2465+static int dm_wait_for_bios_completion(struct mapped_device *md, long task_state)
24612466 {
24622467 int r = 0;
24632468 DEFINE_WAIT(wait);
24642469
2465− while (1) {
2470+ while (true) {
24662471 prepare_to_wait(&md->wait, &wait, task_state);
24672472
2468− if (!md_in_flight(md))
2473+ if (!md_in_flight_bios(md))
24692474 break;
24702475
24712476 if (signal_pending_state(task_state, current)) {
@@ -2480,6 +2485,28 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state) · 8 unmodified lines
24802485 return r;
24812486 }
24822487
2488+static int dm_wait_for_completion(struct mapped_device *md, long task_state)
2489+{
2490+ int r = 0;
2491+
2492+ if (!queue_is_mq(md->queue))
2493+ return dm_wait_for_bios_completion(md, task_state);
2494+
2495+ while (true) {
2496+ if (!blk_mq_queue_inflight(md->queue))
2497+ break;
2498+
2499+ if (signal_pending_state(task_state, current)) {
2500+ r = -EINTR;
2501+ break;
2502+ }
2503+
2504+ msleep(5);
2505+ }
2506+
2507+ return r;
2508+}
2509+
24832510 /*
24842511 * Process the deferred bios
24852512 */
@@ -2913,17 +2940,25 @@ EXPORT_SYMBOL_GPL(dm_internal_resume_fast); · 427 unmodified lines
29132940 int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
29142941 unsigned cookie)
29152942 {
2943+ int r;
2944+ unsigned noio_flag;
29162945 char udev_cookie[DM_COOKIE_LENGTH];
29172946 char *envp[] = { udev_cookie, NULL };
29182947
2948+ noio_flag = memalloc_noio_save();
2949+
29192950 if (!cookie)
2920− return kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
2951+ r = kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
29212952 else {
29222953 snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u",
29232954 DM_COOKIE_ENV_VAR_NAME, cookie);
2924− return kobject_uevent_env(&disk_to_dev(md->disk)->kobj,
2925− action, envp);
2955+ r = kobject_uevent_env(&disk_to_dev(md->disk)->kobj,
2956+ action, envp);
29262957 }
2958+
2959+ memalloc_noio_restore(noio_flag);
2960+
2961+ return r;
29272962 }
29282963
29292964 uint32_t dm_next_uevent_seq(struct mapped_device *md)
drivers/media/platform/omap3isp/isp.c+0−2
@@ -39,8 +39,6 @@ · 38 unmodified lines
3939 * Troy Laramy <t-laramy@ti.com>
4040 */
4141
42−#include <asm/cacheflush.h>
43−
4442 #include <linux/clk.h>
4543 #include <linux/clkdev.h>
4644 #include <linux/delay.h>
drivers/media/platform/omap3isp/ispvideo.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #include <linux/sched.h>
1919 #include <linux/slab.h>
2020 #include <linux/vmalloc.h>
21−#include <asm/cacheflush.h>
2221
2322 #include <media/v4l2-dev.h>
2423 #include <media/v4l2-ioctl.h>
drivers/message/fusion/mptbase.c+20−21
@@ -1324,13 +1324,13 @@ mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init) · 1323 unmodified lines
13241324 return 0; /* fw doesn't need any host buffers */
13251325
13261326 /* spin till we get enough memory */
1327− while(host_page_buffer_sz > 0) {
1328−
1329− if((ioc->HostPageBuffer = pci_alloc_consistent(
1330− ioc->pcidev,
1331− host_page_buffer_sz,
1332− &ioc->HostPageBuffer_dma)) != NULL) {
1333−
1327+ while (host_page_buffer_sz > 0) {
1328+ ioc->HostPageBuffer =
1329+ dma_alloc_coherent(&ioc->pcidev->dev,
1330+ host_page_buffer_sz,
1331+ &ioc->HostPageBuffer_dma,
1332+ GFP_KERNEL);
1333+ if (ioc->HostPageBuffer) {
13341334 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
13351335 "host_page_buffer @ %p, dma @ %x, sz=%d bytes\n",
13361336 ioc->name, ioc->HostPageBuffer,
@@ -2741,8 +2741,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) · 1404 unmodified lines
27412741 sz = ioc->alloc_sz;
27422742 dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "free @ %p, sz=%d bytes\n",
27432743 ioc->name, ioc->alloc, ioc->alloc_sz));
2744− pci_free_consistent(ioc->pcidev, sz,
2745− ioc->alloc, ioc->alloc_dma);
2744+ dma_free_coherent(&ioc->pcidev->dev, sz, ioc->alloc,
2745+ ioc->alloc_dma);
27462746 ioc->reply_frames = NULL;
27472747 ioc->req_frames = NULL;
27482748 ioc->alloc = NULL;
@@ -2751,8 +2751,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) · 2 unmodified lines
27512751
27522752 if (ioc->sense_buf_pool != NULL) {
27532753 sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC);
2754− pci_free_consistent(ioc->pcidev, sz,
2755− ioc->sense_buf_pool, ioc->sense_buf_pool_dma);
2754+ dma_free_coherent(&ioc->pcidev->dev, sz, ioc->sense_buf_pool,
2755+ ioc->sense_buf_pool_dma);
27562756 ioc->sense_buf_pool = NULL;
27572757 ioc->alloc_total -= sz;
27582758 }
@@ -2802,7 +2802,7 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) · 43 unmodified lines
28022802 "HostPageBuffer free @ %p, sz=%d bytes\n",
28032803 ioc->name, ioc->HostPageBuffer,
28042804 ioc->HostPageBuffer_sz));
2805− pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz,
2805+ dma_free_coherent(&ioc->pcidev->dev, ioc->HostPageBuffer_sz,
28062806 ioc->HostPageBuffer, ioc->HostPageBuffer_dma);
28072807 ioc->HostPageBuffer = NULL;
28082808 ioc->HostPageBuffer_sz = 0;
@@ -4497,7 +4497,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc) · 1688 unmodified lines
44974497 ioc->name, sz, sz, num_chain));
44984498
44994499 total_size += sz;
4500− mem = pci_alloc_consistent(ioc->pcidev, total_size, &alloc_dma);
4500+ mem = dma_alloc_coherent(&ioc->pcidev->dev, total_size,
4501+ &alloc_dma, GFP_KERNEL);
45014502 if (mem == NULL) {
45024503 printk(MYIOC_s_ERR_FMT "Unable to allocate Reply, Request, Chain Buffers!\n",
45034504 ioc->name);
@@ -4574,8 +4575,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc) · 70 unmodified lines
45744575 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
45754576
45764577 sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC);
4577− ioc->sense_buf_pool =
4578− pci_alloc_consistent(ioc->pcidev, sz, &ioc->sense_buf_pool_dma);
4578+ ioc->sense_buf_pool = dma_alloc_coherent(&ioc->pcidev->dev, sz,
4579+ &ioc->sense_buf_pool_dma, GFP_KERNEL);
45794580 if (ioc->sense_buf_pool == NULL) {
45804581 printk(MYIOC_s_ERR_FMT "Unable to allocate Sense Buffers!\n",
45814582 ioc->name);
@@ -4613,18 +4614,16 @@ out_fail: · 31 unmodified lines
46134614
46144615 if (ioc->alloc != NULL) {
46154616 sz = ioc->alloc_sz;
4616− pci_free_consistent(ioc->pcidev,
4617− sz,
4618− ioc->alloc, ioc->alloc_dma);
4617+ dma_free_coherent(&ioc->pcidev->dev, sz, ioc->alloc,
4618+ ioc->alloc_dma);
46194619 ioc->reply_frames = NULL;
46204620 ioc->req_frames = NULL;
46214621 ioc->alloc_total -= sz;
46224622 }
46234623 if (ioc->sense_buf_pool != NULL) {
46244624 sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC);
4625− pci_free_consistent(ioc->pcidev,
4626− sz,
4627− ioc->sense_buf_pool, ioc->sense_buf_pool_dma);
4625+ dma_free_coherent(&ioc->pcidev->dev, sz, ioc->sense_buf_pool,
4626+ ioc->sense_buf_pool_dma);
46284627 ioc->sense_buf_pool = NULL;
46294628 }
46304629
drivers/message/fusion/mptscsih.c+1−3
@@ -118,8 +118,6 @@ int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); · 117 unmodified lines
118118 int mptscsih_resume(struct pci_dev *pdev);
119119 #endif
120120
121−#define SNS_LEN(scp) SCSI_SENSE_BUFFERSIZE
122−
123121
124122 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
125123 /*
@@ -2422,7 +2420,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR · 2296 unmodified lines
24222420 /* Copy the sense received into the scsi command block. */
24232421 req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
24242422 sense_data = ((u8 *)ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC));
2425− memcpy(sc->sense_buffer, sense_data, SNS_LEN(sc));
2423+ memcpy(sc->sense_buffer, sense_data, MPT_SENSE_BUFFER_ALLOC);
24262424
24272425 /* Log SMART data (asc = 0x5D, non-IM case only) if required.
24282426 */
drivers/mfd/ioc3.c+3−2
@@ -142,10 +142,11 @@ static int ioc3_irq_domain_setup(struct ioc3_priv_data *ipd, int irq) · 141 unmodified lines
142142 goto err;
143143
144144 domain = irq_domain_create_linear(fn, 24, &ioc3_irq_domain_ops, ipd);
145− if (!domain)
145+ if (!domain) {
146+ irq_domain_free_fwnode(fn);
146147 goto err;
148+ }
147149
148− irq_domain_free_fwnode(fn);
149150 ipd->domain = domain;
150151
151152 irq_set_chained_handler_and_data(irq, ioc3_irq_handler, domain);
drivers/misc/atmel-ssc.c+12−12
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <linux/clk.h>
1111 #include <linux/err.h>
1212 #include <linux/io.h>
13−#include <linux/spinlock.h>
13+#include <linux/mutex.h>
1414 #include <linux/atmel-ssc.h>
1515 #include <linux/slab.h>
1616 #include <linux/module.h>
@@ -20,7 +20,7 @@ · 3 unmodified lines
2020 #include "../../sound/soc/atmel/atmel_ssc_dai.h"
2121
2222 /* Serialize access to ssc_list and user count */
23−static DEFINE_SPINLOCK(user_lock);
23+static DEFINE_MUTEX(user_lock);
2424 static LIST_HEAD(ssc_list);
2525
2626 struct ssc_device *ssc_request(unsigned int ssc_num)
@@ -28,7 +28,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) · 1 unmodified line
2828 int ssc_valid = 0;
2929 struct ssc_device *ssc;
3030
31− spin_lock(&user_lock);
31+ mutex_lock(&user_lock);
3232 list_for_each_entry(ssc, &ssc_list, list) {
3333 if (ssc->pdev->dev.of_node) {
3434 if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
@@ -44,18 +44,18 @@ struct ssc_device *ssc_request(unsigned int ssc_num) · 9 unmodified lines
4444 }
4545
4646 if (!ssc_valid) {
47− spin_unlock(&user_lock);
47+ mutex_unlock(&user_lock);
4848 pr_err("ssc: ssc%d platform device is missing\n", ssc_num);
4949 return ERR_PTR(-ENODEV);
5050 }
5151
5252 if (ssc->user) {
53− spin_unlock(&user_lock);
53+ mutex_unlock(&user_lock);
5454 dev_dbg(&ssc->pdev->dev, "module busy\n");
5555 return ERR_PTR(-EBUSY);
5656 }
5757 ssc->user++;
58− spin_unlock(&user_lock);
58+ mutex_unlock(&user_lock);
5959
6060 clk_prepare(ssc->clk);
6161
@@ -67,14 +67,14 @@ void ssc_free(struct ssc_device *ssc) · 5 unmodified lines
6767 {
6868 bool disable_clk = true;
6969
70− spin_lock(&user_lock);
70+ mutex_lock(&user_lock);
7171 if (ssc->user)
7272 ssc->user--;
7373 else {
7474 disable_clk = false;
7575 dev_dbg(&ssc->pdev->dev, "device already free\n");
7676 }
77− spin_unlock(&user_lock);
77+ mutex_unlock(&user_lock);
7878
7979 if (disable_clk)
8080 clk_unprepare(ssc->clk);
@@ -237,9 +237,9 @@ static int ssc_probe(struct platform_device *pdev) · 156 unmodified lines
237237 return -ENXIO;
238238 }
239239
240− spin_lock(&user_lock);
240+ mutex_lock(&user_lock);
241241 list_add_tail(&ssc->list, &ssc_list);
242− spin_unlock(&user_lock);
242+ mutex_unlock(&user_lock);
243243
244244 platform_set_drvdata(pdev, ssc);
245245
@@ -258,9 +258,9 @@ static int ssc_remove(struct platform_device *pdev) · 12 unmodified lines
258258
259259 ssc_sound_dai_remove(ssc);
260260
261− spin_lock(&user_lock);
261+ mutex_lock(&user_lock);
262262 list_del(&ssc->list);
263− spin_unlock(&user_lock);
263+ mutex_unlock(&user_lock);
264264
265265 return 0;
266266 }
drivers/misc/habanalabs/command_submission.c+13−0
@@ -62,6 +62,12 @@ static void hl_fence_release(struct dma_fence *fence) · 61 unmodified lines
6262 container_of(fence, struct hl_cs_compl, base_fence);
6363 struct hl_device *hdev = hl_cs_cmpl->hdev;
6464
65+ /* EBUSY means the CS was never submitted and hence we don't have
66+ * an attached hw_sob object that we should handle here
67+ */
68+ if (fence->error == -EBUSY)
69+ goto free;
70+
6571 if ((hl_cs_cmpl->type == CS_TYPE_SIGNAL) ||
6672 (hl_cs_cmpl->type == CS_TYPE_WAIT)) {
6773
@@ -92,6 +98,7 @@ static void hl_fence_release(struct dma_fence *fence) · 24 unmodified lines
9298 kref_put(&hl_cs_cmpl->hw_sob->kref, hl_sob_reset);
9399 }
94100
101+free:
95102 kfree_rcu(hl_cs_cmpl, base_fence.rcu);
96103 }
97104
@@ -328,10 +335,16 @@ static void cs_do_release(struct kref *ref) · 230 unmodified lines
328335
329336 hl_ctx_put(cs->ctx);
330337
338+ /* We need to mark an error for not submitted because in that case
339+ * the dma fence release flow is different. Mainly, we don't need
340+ * to handle hw_sob for signal/wait
341+ */
331342 if (cs->timedout)
332343 dma_fence_set_error(cs->fence, -ETIMEDOUT);
333344 else if (cs->aborted)
334345 dma_fence_set_error(cs->fence, -EIO);
346+ else if (!cs->submitted)
347+ dma_fence_set_error(cs->fence, -EBUSY);
335348
336349 dma_fence_signal(cs->fence);
337350 dma_fence_put(cs->fence);
drivers/misc/habanalabs/debugfs.c+2−2
@@ -480,7 +480,7 @@ out: · 479 unmodified lines
480480 return 0;
481481 }
482482
483−static ssize_t mmu_write(struct file *file, const char __user *buf,
483+static ssize_t mmu_asid_va_write(struct file *file, const char __user *buf,
484484 size_t count, loff_t *f_pos)
485485 {
486486 struct seq_file *s = file->private_data;
@@ -1125,7 +1125,7 @@ static const struct hl_info_list hl_debugfs_list[] = { · 638 unmodified lines
11251125 {"command_submission_jobs", command_submission_jobs_show, NULL},
11261126 {"userptr", userptr_show, NULL},
11271127 {"vm", vm_show, NULL},
1128− {"mmu", mmu_show, mmu_write},
1128+ {"mmu", mmu_show, mmu_asid_va_write},
11291129 {"engines", engines_show, NULL}
11301130 };
11311131
drivers/misc/habanalabs/gaudi/gaudi.c+35−2
@@ -96,7 +96,7 @@ · 95 unmodified lines
9696
9797 #define GAUDI_NUM_OF_QM_ARB_ERR_CAUSE 3
9898
99−#define GAUDI_ARB_WDT_TIMEOUT 0x400000
99+#define GAUDI_ARB_WDT_TIMEOUT 0x1000000
100100
101101 static const char gaudi_irq_name[GAUDI_MSI_ENTRIES][GAUDI_MAX_STRING_LEN] = {
102102 "gaudi cq 0_0", "gaudi cq 0_1", "gaudi cq 0_2", "gaudi cq 0_3",
@@ -1893,6 +1893,8 @@ static void gaudi_init_pci_dma_qman(struct hl_device *hdev, int dma_id, · 1790 unmodified lines
18931893 WREG32(mmDMA0_QM_CP_MSG_BASE3_ADDR_LO_0 + q_off, so_base_ws_lo);
18941894 WREG32(mmDMA0_QM_CP_MSG_BASE3_ADDR_HI_0 + q_off, so_base_ws_hi);
18951895
1896+ WREG32(mmDMA0_QM_CP_BARRIER_CFG_0 + q_off, 0x100);
1897+
18961898 /* The following configuration is needed only once per QMAN */
18971899 if (qman_id == 0) {
18981900 /* Configure RAZWI IRQ */
@@ -2725,6 +2727,12 @@ static int gaudi_mmu_init(struct hl_device *hdev) · 826 unmodified lines
27252727 WREG32(mmSTLB_HOP_CONFIGURATION,
27262728 hdev->mmu_huge_page_opt ? 0x30440 : 0x40440);
27272729
2730+ /*
2731+ * The H/W expects the first PI after init to be 1. After wraparound
2732+ * we'll write 0.
2733+ */
2734+ gaudi->mmu_cache_inv_pi = 1;
2735+
27282736 gaudi->hw_cap_initialized |= HW_CAP_MMU;
27292737
27302738 return 0;
@@ -3790,6 +3798,25 @@ static int gaudi_validate_dma_pkt_no_mmu(struct hl_device *hdev, · 1059 unmodified lines
37903798 src_in_host);
37913799 }
37923800
3801+static int gaudi_validate_load_and_exe_pkt(struct hl_device *hdev,
3802+ struct hl_cs_parser *parser,
3803+ struct packet_load_and_exe *user_pkt)
3804+{
3805+ u32 cfg;
3806+
3807+ cfg = le32_to_cpu(user_pkt->cfg);
3808+
3809+ if (cfg & GAUDI_PKT_LOAD_AND_EXE_CFG_DST_MASK) {
3810+ dev_err(hdev->dev,
3811+ "User not allowed to use Load and Execute\n");
3812+ return -EPERM;
3813+ }
3814+
3815+ parser->patched_cb_size += sizeof(struct packet_load_and_exe);
3816+
3817+ return 0;
3818+}
3819+
37933820 static int gaudi_validate_cb(struct hl_device *hdev,
37943821 struct hl_cs_parser *parser, bool is_mmu)
37953822 {
@@ -3838,6 +3865,11 @@ static int gaudi_validate_cb(struct hl_device *hdev, · 42 unmodified lines
38383865 rc = -EPERM;
38393866 break;
38403867
3868+ case PACKET_LOAD_AND_EXE:
3869+ rc = gaudi_validate_load_and_exe_pkt(hdev, parser,
3870+ (struct packet_load_and_exe *) user_pkt);
3871+ break;
3872+
38413873 case PACKET_LIN_DMA:
38423874 parser->contains_dma_pkt = true;
38433875 if (is_mmu)
@@ -3855,7 +3887,6 @@ static int gaudi_validate_cb(struct hl_device *hdev, · 11 unmodified lines
38553887 case PACKET_FENCE:
38563888 case PACKET_NOP:
38573889 case PACKET_ARB_POINT:
3858− case PACKET_LOAD_AND_EXE:
38593890 parser->patched_cb_size += pkt_size;
38603891 break;
38613892
@@ -5994,6 +6025,8 @@ static int gaudi_mmu_invalidate_cache(struct hl_device *hdev, bool is_hard, · 2132 unmodified lines
59946025 mutex_lock(&hdev->mmu_cache_lock);
59956026
59966027 /* L0 & L1 invalidation */
6028+ WREG32(mmSTLB_INV_PS, 3);
6029+ WREG32(mmSTLB_CACHE_INV, gaudi->mmu_cache_inv_pi++);
59976030 WREG32(mmSTLB_INV_PS, 2);
59986031
59996032 rc = hl_poll_timeout(
drivers/misc/habanalabs/gaudi/gaudiP.h+3−0
@@ -229,6 +229,8 @@ struct gaudi_internal_qman_info { · 228 unmodified lines
229229 * @multi_msi_mode: whether we are working in multi MSI single MSI mode.
230230 * Multi MSI is possible only with IOMMU enabled.
231231 * @ext_queue_idx: helper index for external queues initialization.
232+ * @mmu_cache_inv_pi: PI for MMU cache invalidation flow. The H/W expects an
233+ * 8-bit value so use u8.
232234 */
233235 struct gaudi_device {
234236 int (*armcp_info_get)(struct hl_device *hdev);
@@ -248,6 +250,7 @@ struct gaudi_device { · 13 unmodified lines
248250 u32 hw_cap_initialized;
249251 u8 multi_msi_mode;
250252 u8 ext_queue_idx;
253+ u8 mmu_cache_inv_pi;
251254 };
252255
253256 void gaudi_init_security(struct hl_device *hdev);
drivers/misc/habanalabs/include/gaudi/gaudi_packets.h+3−0
@@ -197,6 +197,9 @@ struct packet_wait { · 196 unmodified lines
197197 __le32 ctl;
198198 };
199199
200+#define GAUDI_PKT_LOAD_AND_EXE_CFG_DST_SHIFT 0
201+#define GAUDI_PKT_LOAD_AND_EXE_CFG_DST_MASK 0x00000001
202+
200203 struct packet_load_and_exe {
201204 __le32 cfg;
202205 __le32 ctl;
drivers/misc/mei/bus.c+1−2
@@ -745,9 +745,8 @@ static int mei_cl_device_remove(struct device *dev) · 744 unmodified lines
745745
746746 mei_cl_bus_module_put(cldev);
747747 module_put(THIS_MODULE);
748− dev->driver = NULL;
749− return ret;
750748
749+ return ret;
751750 }
752751
753752 static ssize_t name_show(struct device *dev, struct device_attribute *a,
drivers/misc/mei/hw-me-regs.h+3−0
@@ -94,6 +94,7 @@ · 93 unmodified lines
9494 #define MEI_DEV_ID_JSP_N 0x4DE0 /* Jasper Lake Point N */
9595
9696 #define MEI_DEV_ID_TGP_LP 0xA0E0 /* Tiger Lake Point LP */
97+#define MEI_DEV_ID_TGP_H 0x43E0 /* Tiger Lake Point H */
9798
9899 #define MEI_DEV_ID_MCC 0x4B70 /* Mule Creek Canyon (EHL) */
99100 #define MEI_DEV_ID_MCC_4 0x4B75 /* Mule Creek Canyon 4 (EHL) */
@@ -107,6 +108,8 @@ · 7 unmodified lines
107108 # define PCI_CFG_HFS_1_D0I3_MSK 0x80000000
108109 #define PCI_CFG_HFS_2 0x48
109110 #define PCI_CFG_HFS_3 0x60
111+# define PCI_CFG_HFS_3_FW_SKU_MSK 0x00000070
112+# define PCI_CFG_HFS_3_FW_SKU_SPS 0x00000060
110113 #define PCI_CFG_HFS_4 0x64
111114 #define PCI_CFG_HFS_5 0x68
112115 #define PCI_CFG_HFS_6 0x6C
drivers/misc/mei/hw-me.c+64−6
@@ -1366,7 +1366,7 @@ static bool mei_me_fw_type_nm(struct pci_dev *pdev) · 1365 unmodified lines
13661366 #define MEI_CFG_FW_NM \
13671367 .quirk_probe = mei_me_fw_type_nm
13681368
1369−static bool mei_me_fw_type_sps(struct pci_dev *pdev)
1369+static bool mei_me_fw_type_sps_4(struct pci_dev *pdev)
13701370 {
13711371 u32 reg;
13721372 unsigned int devfn;
@@ -1382,7 +1382,36 @@ static bool mei_me_fw_type_sps(struct pci_dev *pdev) · 9 unmodified lines
13821382 return (reg & 0xf0000) == 0xf0000;
13831383 }
13841384
1385−#define MEI_CFG_FW_SPS \
1385+#define MEI_CFG_FW_SPS_4 \
1386+ .quirk_probe = mei_me_fw_type_sps_4
1387+
1388+/**
1389+ * mei_me_fw_sku_sps() - check for sps sku
1390+ *
1391+ * Read ME FW Status register to check for SPS Firmware.
1392+ * The SPS FW is only signaled in pci function 0
1393+ *
1394+ * @pdev: pci device
1395+ *
1396+ * Return: true in case of SPS firmware
1397+ */
1398+static bool mei_me_fw_type_sps(struct pci_dev *pdev)
1399+{
1400+ u32 reg;
1401+ u32 fw_type;
1402+ unsigned int devfn;
1403+
1404+ devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0);
1405+ pci_bus_read_config_dword(pdev->bus, devfn, PCI_CFG_HFS_3, &reg);
1406+ trace_mei_pci_cfg_read(&pdev->dev, "PCI_CFG_HFS_3", PCI_CFG_HFS_3, reg);
1407+ fw_type = (reg & PCI_CFG_HFS_3_FW_SKU_MSK);
1408+
1409+ dev_dbg(&pdev->dev, "fw type is %d\n", fw_type);
1410+
1411+ return fw_type == PCI_CFG_HFS_3_FW_SKU_SPS;
1412+}
1413+
1414+#define MEI_CFG_FW_SPS \
13861415 .quirk_probe = mei_me_fw_type_sps
13871416
13881417 #define MEI_CFG_FW_VER_SUPP \
@@ -1452,10 +1481,17 @@ static const struct mei_cfg mei_me_pch8_cfg = { · 63 unmodified lines
14521481 };
14531482
14541483 /* PCH8 Lynx Point with quirk for SPS Firmware exclusion */
1455−static const struct mei_cfg mei_me_pch8_sps_cfg = {
1484+static const struct mei_cfg mei_me_pch8_sps_4_cfg = {
14561485 MEI_CFG_PCH8_HFS,
14571486 MEI_CFG_FW_VER_SUPP,
1458− MEI_CFG_FW_SPS,
1487+ MEI_CFG_FW_SPS_4,
1488+};
1489+
1490+/* LBG with quirk for SPS (4.0) Firmware exclusion */
1491+static const struct mei_cfg mei_me_pch12_sps_4_cfg = {
1492+ MEI_CFG_PCH8_HFS,
1493+ MEI_CFG_FW_VER_SUPP,
1494+ MEI_CFG_FW_SPS_4,
14591495 };
14601496
14611497 /* Cannon Lake and newer devices */
@@ -1465,8 +1501,18 @@ static const struct mei_cfg mei_me_pch12_cfg = { · 3 unmodified lines
14651501 MEI_CFG_DMA_128,
14661502 };
14671503
1468−/* LBG with quirk for SPS Firmware exclusion */
1504+/* Cannon Lake with quirk for SPS 5.0 and newer Firmware exclusion */
14691505 static const struct mei_cfg mei_me_pch12_sps_cfg = {
1506+ MEI_CFG_PCH8_HFS,
1507+ MEI_CFG_FW_VER_SUPP,
1508+ MEI_CFG_DMA_128,
1509+ MEI_CFG_FW_SPS,
1510+};
1511+
1512+/* Cannon Lake with quirk for SPS 5.0 and newer Firmware exclusion
1513+ * w/o DMA support
1514+ */
1515+static const struct mei_cfg mei_me_pch12_nodma_sps_cfg = {
14701516 MEI_CFG_PCH8_HFS,
14711517 MEI_CFG_FW_VER_SUPP,
14721518 MEI_CFG_FW_SPS,
@@ -1480,6 +1526,15 @@ static const struct mei_cfg mei_me_pch15_cfg = { · 7 unmodified lines
14801526 MEI_CFG_TRC,
14811527 };
14821528
1529+/* Tiger Lake with quirk for SPS 5.0 and newer Firmware exclusion */
1530+static const struct mei_cfg mei_me_pch15_sps_cfg = {
1531+ MEI_CFG_PCH8_HFS,
1532+ MEI_CFG_FW_VER_SUPP,
1533+ MEI_CFG_DMA_128,
1534+ MEI_CFG_TRC,
1535+ MEI_CFG_FW_SPS,
1536+};
1537+
14831538 /*
14841539 * mei_cfg_list - A list of platform platform specific configurations.
14851540 * Note: has to be synchronized with enum mei_cfg_idx.
@@ -1492,10 +1547,13 @@ static const struct mei_cfg *const mei_cfg_list[] = { · 6 unmodified lines
14921547 [MEI_ME_PCH7_CFG] = &mei_me_pch7_cfg,
14931548 [MEI_ME_PCH_CPT_PBG_CFG] = &mei_me_pch_cpt_pbg_cfg,
14941549 [MEI_ME_PCH8_CFG] = &mei_me_pch8_cfg,
1495− [MEI_ME_PCH8_SPS_CFG] = &mei_me_pch8_sps_cfg,
1550+ [MEI_ME_PCH8_SPS_4_CFG] = &mei_me_pch8_sps_4_cfg,
14961551 [MEI_ME_PCH12_CFG] = &mei_me_pch12_cfg,
1552+ [MEI_ME_PCH12_SPS_4_CFG] = &mei_me_pch12_sps_4_cfg,
14971553 [MEI_ME_PCH12_SPS_CFG] = &mei_me_pch12_sps_cfg,
1554+ [MEI_ME_PCH12_SPS_NODMA_CFG] = &mei_me_pch12_nodma_sps_cfg,
14981555 [MEI_ME_PCH15_CFG] = &mei_me_pch15_cfg,
1556+ [MEI_ME_PCH15_SPS_CFG] = &mei_me_pch15_sps_cfg,
14991557 };
15001558
15011559 const struct mei_cfg *mei_me_get_cfg(kernel_ulong_t idx)
drivers/misc/mei/hw-me.h+13−4
@@ -1,6 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 /*
3− * Copyright (c) 2012-2019, Intel Corporation. All rights reserved.
3+ * Copyright (c) 2012-2020, Intel Corporation. All rights reserved.
44 * Intel Management Engine Interface (Intel MEI) Linux driver
55 */
66
@@ -76,14 +76,20 @@ struct mei_me_hw { · 69 unmodified lines
7676 * with quirk for Node Manager exclusion.
7777 * @MEI_ME_PCH8_CFG: Platform Controller Hub Gen8 and newer
7878 * client platforms.
79− * @MEI_ME_PCH8_SPS_CFG: Platform Controller Hub Gen8 and newer
79+ * @MEI_ME_PCH8_SPS_4_CFG: Platform Controller Hub Gen8 and newer
8080 * servers platforms with quirk for
8181 * SPS firmware exclusion.
8282 * @MEI_ME_PCH12_CFG: Platform Controller Hub Gen12 and newer
83− * @MEI_ME_PCH12_SPS_CFG: Platform Controller Hub Gen12 and newer
83+ * @MEI_ME_PCH12_SPS_4_CFG:Platform Controller Hub Gen12 up to 4.0
84+ * servers platforms with quirk for
85+ * SPS firmware exclusion.
86+ * @MEI_ME_PCH12_SPS_CFG: Platform Controller Hub Gen12 5.0 and newer
8487 * servers platforms with quirk for
8588 * SPS firmware exclusion.
8689 * @MEI_ME_PCH15_CFG: Platform Controller Hub Gen15 and newer
90+ * @MEI_ME_PCH15_SPS_CFG: Platform Controller Hub Gen15 and newer
91+ * servers platforms with quirk for
92+ * SPS firmware exclusion.
8793 * @MEI_ME_NUM_CFG: Upper Sentinel.
8894 */
8995 enum mei_cfg_idx {
@@ -94,10 +100,13 @@ enum mei_cfg_idx { · 4 unmodified lines
94100 MEI_ME_PCH7_CFG,
95101 MEI_ME_PCH_CPT_PBG_CFG,
96102 MEI_ME_PCH8_CFG,
97− MEI_ME_PCH8_SPS_CFG,
103+ MEI_ME_PCH8_SPS_4_CFG,
98104 MEI_ME_PCH12_CFG,
105+ MEI_ME_PCH12_SPS_4_CFG,
99106 MEI_ME_PCH12_SPS_CFG,
107+ MEI_ME_PCH12_SPS_NODMA_CFG,
100108 MEI_ME_PCH15_CFG,
109+ MEI_ME_PCH15_SPS_CFG,
101110 MEI_ME_NUM_CFG,
102111 };
103112
drivers/misc/mei/pci-me.c+9−8
@@ -59,18 +59,18 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 58 unmodified lines
5959 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, MEI_ME_PCH7_CFG)},
6060 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, MEI_ME_PCH7_CFG)},
6161 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, MEI_ME_PCH7_CFG)},
62− {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, MEI_ME_PCH8_SPS_CFG)},
63− {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, MEI_ME_PCH8_SPS_CFG)},
62+ {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, MEI_ME_PCH8_SPS_4_CFG)},
63+ {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, MEI_ME_PCH8_SPS_4_CFG)},
6464 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, MEI_ME_PCH8_CFG)},
65− {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, MEI_ME_PCH8_SPS_CFG)},
65+ {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, MEI_ME_PCH8_SPS_4_CFG)},
6666 {MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP, MEI_ME_PCH8_CFG)},
6767 {MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP_2, MEI_ME_PCH8_CFG)},
6868
6969 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT, MEI_ME_PCH8_CFG)},
7070 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, MEI_ME_PCH8_CFG)},
71− {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_CFG)},
72− {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_CFG)},
73− {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_SPS_CFG)},
71+ {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_4_CFG)},
72+ {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_4_CFG)},
73+ {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_SPS_4_CFG)},
7474
7575 {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, MEI_ME_PCH8_CFG)},
7676 {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, MEI_ME_PCH8_CFG)},
@@ -84,8 +84,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 7 unmodified lines
8484
8585 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH12_CFG)},
8686 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_3, MEI_ME_PCH8_CFG)},
87− {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH12_CFG)},
88− {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_3, MEI_ME_PCH8_CFG)},
87+ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH12_SPS_CFG)},
88+ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_3, MEI_ME_PCH12_SPS_NODMA_CFG)},
8989
9090 {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP, MEI_ME_PCH12_CFG)},
9191 {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP_3, MEI_ME_PCH8_CFG)},
@@ -96,6 +96,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 4 unmodified lines
9696 {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)},
9797
9898 {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)},
99+ {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_H, MEI_ME_PCH15_SPS_CFG)},
99100
100101 {MEI_PCI_DEVICE(MEI_DEV_ID_JSP_N, MEI_ME_PCH15_CFG)},
101102
drivers/mmc/host/meson-gx-mmc.c+4−2
@@ -1146,9 +1146,11 @@ static int meson_mmc_probe(struct platform_device *pdev) · 1145 unmodified lines
11461146
11471147 mmc->caps |= MMC_CAP_CMD23;
11481148 if (host->dram_access_quirk) {
1149+ /* Limit segments to 1 due to low available sram memory */
1150+ mmc->max_segs = 1;
11491151 /* Limit to the available sram memory */
1150− mmc->max_segs = SD_EMMC_SRAM_DATA_BUF_LEN / mmc->max_blk_size;
1151− mmc->max_blk_count = mmc->max_segs;
1152+ mmc->max_blk_count = SD_EMMC_SRAM_DATA_BUF_LEN /
1153+ mmc->max_blk_size;
11521154 } else {
11531155 mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
11541156 mmc->max_segs = SD_EMMC_DESC_BUF_LEN /
drivers/mmc/host/owl-mmc.c+1−1
@@ -689,7 +689,7 @@ MODULE_DEVICE_TABLE(of, owl_mmc_of_match); · 688 unmodified lines
689689 static struct platform_driver owl_mmc_driver = {
690690 .driver = {
691691 .name = "owl_mmc",
692− .of_match_table = of_match_ptr(owl_mmc_of_match),
692+ .of_match_table = owl_mmc_of_match,
693693 },
694694 .probe = owl_mmc_probe,
695695 .remove = owl_mmc_remove,
drivers/mmc/host/sdhci-msm.c+3−2
@@ -618,8 +618,9 @@ static int msm_init_cm_dll(struct sdhci_host *host) · 617 unmodified lines
618618 config &= ~CORE_CLK_PWRSAVE;
619619 writel_relaxed(config, host->ioaddr + msm_offset->core_vendor_spec);
620620
621− config = msm_host->dll_config;
622− writel_relaxed(config, host->ioaddr + msm_offset->core_dll_config);
621+ if (msm_host->dll_config)
622+ writel_relaxed(msm_host->dll_config,
623+ host->ioaddr + msm_offset->core_dll_config);
623624
624625 if (msm_host->use_14lpp_dll_reset) {
625626 config = readl_relaxed(host->ioaddr +
drivers/mtd/mtdcore.c+2−2
@@ -1273,8 +1273,8 @@ int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, · 1272 unmodified lines
12731273 return -EROFS;
12741274 if (!len)
12751275 return 0;
1276− if (!mtd->oops_panic_write)
1277− mtd->oops_panic_write = true;
1276+ if (!master->oops_panic_write)
1277+ master->oops_panic_write = true;
12781278
12791279 return master->_panic_write(master, mtd_get_master_ofs(mtd, to), len,
12801280 retlen, buf);
drivers/mtd/nand/raw/nandsim.c+1−1
@@ -1761,7 +1761,7 @@ static void ns_switch_state(struct nandsim *ns) · 1760 unmodified lines
17611761
17621762 NS_DBG("switch_state: operation is unknown, try to find it\n");
17631763
1764− if (!ns_find_operation(ns, 0))
1764+ if (ns_find_operation(ns, 0))
17651765 return;
17661766
17671767 if ((ns->state & ACTION_MASK) &&
drivers/mtd/nand/raw/xway_nand.c+1−1
@@ -224,7 +224,7 @@ static int xway_nand_remove(struct platform_device *pdev) · 223 unmodified lines
224224 struct nand_chip *chip = &data->chip;
225225 int ret;
226226
227− ret = mtd_device_unregister(mtd);
227+ ret = mtd_device_unregister(nand_to_mtd(chip));
228228 WARN_ON(ret);
229229 nand_cleanup(chip);
230230
drivers/net/bareudp.c+3−0
@@ -572,6 +572,9 @@ static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf, · 571 unmodified lines
572572 if (data[IFLA_BAREUDP_SRCPORT_MIN])
573573 conf->sport_min = nla_get_u16(data[IFLA_BAREUDP_SRCPORT_MIN]);
574574
575+ if (data[IFLA_BAREUDP_MULTIPROTO_MODE])
576+ conf->multi_proto_mode = true;
577+
575578 return 0;
576579 }
577580
drivers/net/dsa/bcm_sf2.c+2−0
@@ -1147,6 +1147,8 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) · 1146 unmodified lines
11471147 set_bit(0, priv->cfp.used);
11481148 set_bit(0, priv->cfp.unique);
11491149
1150+ /* Balance of_node_put() done by of_find_node_by_name() */
1151+ of_node_get(dn);
11501152 ports = of_find_node_by_name(dn, "ports");
11511153 if (ports) {
11521154 bcm_sf2_identify_ports(priv, ports);
drivers/net/dsa/microchip/ksz8795.c+3−0
@@ -1268,6 +1268,9 @@ static int ksz8795_switch_init(struct ksz_device *dev) · 1267 unmodified lines
12681268 return -ENOMEM;
12691269 }
12701270
1271+ /* set the real number of ports */
1272+ dev->ds->num_ports = dev->port_cnt;
1273+
12711274 return 0;
12721275 }
12731276
drivers/net/dsa/microchip/ksz9477.c+3−0
@@ -1588,6 +1588,9 @@ static int ksz9477_switch_init(struct ksz_device *dev) · 1587 unmodified lines
15881588 return -ENOMEM;
15891589 }
15901590
1591+ /* set the real number of ports */
1592+ dev->ds->num_ports = dev->port_cnt;
1593+
15911594 return 0;
15921595 }
15931596
drivers/net/dsa/microchip/ksz9477_i2c.c+1−0
@@ -79,6 +79,7 @@ MODULE_DEVICE_TABLE(i2c, ksz9477_i2c_id); · 78 unmodified lines
7979 static const struct of_device_id ksz9477_dt_ids[] = {
8080 { .compatible = "microchip,ksz9477" },
8181 { .compatible = "microchip,ksz9897" },
82+ { .compatible = "microchip,ksz9893" },
8283 { .compatible = "microchip,ksz9567" },
8384 {},
8485 };
drivers/net/dsa/sja1105/sja1105_vl.c+173−166
@@ -7,6 +7,165 @@ · 6 unmodified lines
77
88 #define SJA1105_SIZE_VL_STATUS 8
99
10+/* Insert into the global gate list, sorted by gate action time. */
11+static int sja1105_insert_gate_entry(struct sja1105_gating_config *gating_cfg,
12+ struct sja1105_rule *rule,
13+ u8 gate_state, s64 entry_time,
14+ struct netlink_ext_ack *extack)
15+{
16+ struct sja1105_gate_entry *e;
17+ int rc;
18+
19+ e = kzalloc(sizeof(*e), GFP_KERNEL);
20+ if (!e)
21+ return -ENOMEM;
22+
23+ e->rule = rule;
24+ e->gate_state = gate_state;
25+ e->interval = entry_time;
26+
27+ if (list_empty(&gating_cfg->entries)) {
28+ list_add(&e->list, &gating_cfg->entries);
29+ } else {
30+ struct sja1105_gate_entry *p;
31+
32+ list_for_each_entry(p, &gating_cfg->entries, list) {
33+ if (p->interval == e->interval) {
34+ NL_SET_ERR_MSG_MOD(extack,
35+ "Gate conflict");
36+ rc = -EBUSY;
37+ goto err;
38+ }
39+
40+ if (e->interval < p->interval)
41+ break;
42+ }
43+ list_add(&e->list, p->list.prev);
44+ }
45+
46+ gating_cfg->num_entries++;
47+
48+ return 0;
49+err:
50+ kfree(e);
51+ return rc;
52+}
53+
54+/* The gate entries contain absolute times in their e->interval field. Convert
55+ * that to proper intervals (i.e. "0, 5, 10, 15" to "5, 5, 5, 5").
56+ */
57+static void
58+sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
59+ u64 cycle_time)
60+{
61+ struct sja1105_gate_entry *last_e;
62+ struct sja1105_gate_entry *e;
63+ struct list_head *prev;
64+
65+ list_for_each_entry(e, &gating_cfg->entries, list) {
66+ struct sja1105_gate_entry *p;
67+
68+ prev = e->list.prev;
69+
70+ if (prev == &gating_cfg->entries)
71+ continue;
72+
73+ p = list_entry(prev, struct sja1105_gate_entry, list);
74+ p->interval = e->interval - p->interval;
75+ }
76+ last_e = list_last_entry(&gating_cfg->entries,
77+ struct sja1105_gate_entry, list);
78+ last_e->interval = cycle_time - last_e->interval;
79+}
80+
81+static void sja1105_free_gating_config(struct sja1105_gating_config *gating_cfg)
82+{
83+ struct sja1105_gate_entry *e, *n;
84+
85+ list_for_each_entry_safe(e, n, &gating_cfg->entries, list) {
86+ list_del(&e->list);
87+ kfree(e);
88+ }
89+}
90+
91+static int sja1105_compose_gating_subschedule(struct sja1105_private *priv,
92+ struct netlink_ext_ack *extack)
93+{
94+ struct sja1105_gating_config *gating_cfg = &priv->tas_data.gating_cfg;
95+ struct sja1105_rule *rule;
96+ s64 max_cycle_time = 0;
97+ s64 its_base_time = 0;
98+ int i, rc = 0;
99+
100+ sja1105_free_gating_config(gating_cfg);
101+
102+ list_for_each_entry(rule, &priv->flow_block.rules, list) {
103+ if (rule->type != SJA1105_RULE_VL)
104+ continue;
105+ if (rule->vl.type != SJA1105_VL_TIME_TRIGGERED)
106+ continue;
107+
108+ if (max_cycle_time < rule->vl.cycle_time) {
109+ max_cycle_time = rule->vl.cycle_time;
110+ its_base_time = rule->vl.base_time;
111+ }
112+ }
113+
114+ if (!max_cycle_time)
115+ return 0;
116+
117+ dev_dbg(priv->ds->dev, "max_cycle_time %lld its_base_time %lld\n",
118+ max_cycle_time, its_base_time);
119+
120+ gating_cfg->base_time = its_base_time;
121+ gating_cfg->cycle_time = max_cycle_time;
122+ gating_cfg->num_entries = 0;
123+
124+ list_for_each_entry(rule, &priv->flow_block.rules, list) {
125+ s64 time;
126+ s64 rbt;
127+
128+ if (rule->type != SJA1105_RULE_VL)
129+ continue;
130+ if (rule->vl.type != SJA1105_VL_TIME_TRIGGERED)
131+ continue;
132+
133+ /* Calculate the difference between this gating schedule's
134+ * base time, and the base time of the gating schedule with the
135+ * longest cycle time. We call it the relative base time (rbt).
136+ */
137+ rbt = future_base_time(rule->vl.base_time, rule->vl.cycle_time,
138+ its_base_time);
139+ rbt -= its_base_time;
140+
141+ time = rbt;
142+
143+ for (i = 0; i < rule->vl.num_entries; i++) {
144+ u8 gate_state = rule->vl.entries[i].gate_state;
145+ s64 entry_time = time;
146+
147+ while (entry_time < max_cycle_time) {
148+ rc = sja1105_insert_gate_entry(gating_cfg, rule,
149+ gate_state,
150+ entry_time,
151+ extack);
152+ if (rc)
153+ goto err;
154+
155+ entry_time += rule->vl.cycle_time;
156+ }
157+ time += rule->vl.entries[i].interval;
158+ }
159+ }
160+
161+ sja1105_gating_cfg_time_to_interval(gating_cfg, max_cycle_time);
162+
163+ return 0;
164+err:
165+ sja1105_free_gating_config(gating_cfg);
166+ return rc;
167+}
168+
10169 /* The switch flow classification core implements TTEthernet, which 'thinks' in
11170 * terms of Virtual Links (VL), a concept borrowed from ARINC 664 part 7.
12171 * However it also has one other operating mode (VLLUPFORMAT=0) where it acts
@@ -342,7 +501,9 @@ int sja1105_vl_redirect(struct sja1105_private *priv, int port, · 329 unmodified lines
342501 NL_SET_ERR_MSG_MOD(extack,
343502 "Can only redirect based on DMAC");
344503 return -EOPNOTSUPP;
345− } else if (key->type != SJA1105_KEY_VLAN_AWARE_VL) {
504+ } else if ((priv->vlan_state == SJA1105_VLAN_BEST_EFFORT ||
505+ priv->vlan_state == SJA1105_VLAN_FILTERING_FULL) &&
506+ key->type != SJA1105_KEY_VLAN_AWARE_VL) {
346507 NL_SET_ERR_MSG_MOD(extack,
347508 "Can only redirect based on {DMAC, VID, PCP}");
348509 return -EOPNOTSUPP;
@@ -388,171 +549,19 @@ int sja1105_vl_delete(struct sja1105_private *priv, int port, · 39 unmodified lines
388549 kfree(rule);
389550 }
390551
391− rc = sja1105_init_virtual_links(priv, extack);
552+ rc = sja1105_compose_gating_subschedule(priv, extack);
392553 if (rc)
393554 return rc;
394555
395− return sja1105_static_config_reload(priv, SJA1105_VIRTUAL_LINKS);
396−}
397−
398−/* Insert into the global gate list, sorted by gate action time. */
399−static int sja1105_insert_gate_entry(struct sja1105_gating_config *gating_cfg,
400− struct sja1105_rule *rule,
401− u8 gate_state, s64 entry_time,
402− struct netlink_ext_ack *extack)
403−{
404− struct sja1105_gate_entry *e;
405− int rc;
406−
407− e = kzalloc(sizeof(*e), GFP_KERNEL);
408− if (!e)
409− return -ENOMEM;
410−
411− e->rule = rule;
412− e->gate_state = gate_state;
413− e->interval = entry_time;
414−
415− if (list_empty(&gating_cfg->entries)) {
416− list_add(&e->list, &gating_cfg->entries);
417− } else {
418− struct sja1105_gate_entry *p;
419−
420− list_for_each_entry(p, &gating_cfg->entries, list) {
421− if (p->interval == e->interval) {
422− NL_SET_ERR_MSG_MOD(extack,
423− "Gate conflict");
424− rc = -EBUSY;
425− goto err;
426− }
427−
428− if (e->interval < p->interval)
429− break;
430− }
431− list_add(&e->list, p->list.prev);
432− }
433−
434− gating_cfg->num_entries++;
435−
436− return 0;
437−err:
438− kfree(e);
439− return rc;
440−}
441−
442−/* The gate entries contain absolute times in their e->interval field. Convert
443− * that to proper intervals (i.e. "0, 5, 10, 15" to "5, 5, 5, 5").
444− */
445−static void
446−sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
447− u64 cycle_time)
448−{
449− struct sja1105_gate_entry *last_e;
450− struct sja1105_gate_entry *e;
451− struct list_head *prev;
452−
453− list_for_each_entry(e, &gating_cfg->entries, list) {
454− struct sja1105_gate_entry *p;
455−
456− prev = e->list.prev;
457−
458− if (prev == &gating_cfg->entries)
459− continue;
460−
461− p = list_entry(prev, struct sja1105_gate_entry, list);
462− p->interval = e->interval - p->interval;
463− }
464− last_e = list_last_entry(&gating_cfg->entries,
465− struct sja1105_gate_entry, list);
466− if (last_e->list.prev != &gating_cfg->entries)
467− last_e->interval = cycle_time - last_e->interval;
468−}
469−
470−static void sja1105_free_gating_config(struct sja1105_gating_config *gating_cfg)
471−{
472− struct sja1105_gate_entry *e, *n;
473−
474− list_for_each_entry_safe(e, n, &gating_cfg->entries, list) {
475− list_del(&e->list);
476− kfree(e);
477− }
478−}
479−
480−static int sja1105_compose_gating_subschedule(struct sja1105_private *priv,
481− struct netlink_ext_ack *extack)
482−{
483− struct sja1105_gating_config *gating_cfg = &priv->tas_data.gating_cfg;
484− struct sja1105_rule *rule;
485− s64 max_cycle_time = 0;
486− s64 its_base_time = 0;
487− int i, rc = 0;
488−
489− list_for_each_entry(rule, &priv->flow_block.rules, list) {
490− if (rule->type != SJA1105_RULE_VL)
491− continue;
492− if (rule->vl.type != SJA1105_VL_TIME_TRIGGERED)
493− continue;
494−
495− if (max_cycle_time < rule->vl.cycle_time) {
496− max_cycle_time = rule->vl.cycle_time;
497− its_base_time = rule->vl.base_time;
498− }
499− }
500−
501− if (!max_cycle_time)
502− return 0;
503−
504− dev_dbg(priv->ds->dev, "max_cycle_time %lld its_base_time %lld\n",
505− max_cycle_time, its_base_time);
506−
507− sja1105_free_gating_config(gating_cfg);
508−
509− gating_cfg->base_time = its_base_time;
510− gating_cfg->cycle_time = max_cycle_time;
511− gating_cfg->num_entries = 0;
512−
513− list_for_each_entry(rule, &priv->flow_block.rules, list) {
514− s64 time;
515− s64 rbt;
516−
517− if (rule->type != SJA1105_RULE_VL)
518− continue;
519− if (rule->vl.type != SJA1105_VL_TIME_TRIGGERED)
520− continue;
521−
522− /* Calculate the difference between this gating schedule's
523− * base time, and the base time of the gating schedule with the
524− * longest cycle time. We call it the relative base time (rbt).
525− */
526− rbt = future_base_time(rule->vl.base_time, rule->vl.cycle_time,
527− its_base_time);
528− rbt -= its_base_time;
529−
530− time = rbt;
531−
532− for (i = 0; i < rule->vl.num_entries; i++) {
533− u8 gate_state = rule->vl.entries[i].gate_state;
534− s64 entry_time = time;
535−
536− while (entry_time < max_cycle_time) {
537− rc = sja1105_insert_gate_entry(gating_cfg, rule,
538− gate_state,
539− entry_time,
540− extack);
541− if (rc)
542− goto err;
543−
544− entry_time += rule->vl.cycle_time;
545− }
546− time += rule->vl.entries[i].interval;
547− }
548− }
556+ rc = sja1105_init_virtual_links(priv, extack);
557+ if (rc)
558+ return rc;
549559
550− sja1105_gating_cfg_time_to_interval(gating_cfg, max_cycle_time);
560+ rc = sja1105_init_scheduling(priv);
561+ if (rc < 0)
562+ return rc;
551563
552− return 0;
553−err:
554− sja1105_free_gating_config(gating_cfg);
555− return rc;
564+ return sja1105_static_config_reload(priv, SJA1105_VIRTUAL_LINKS);
556565 }
557566
558567 int sja1105_vl_gate(struct sja1105_private *priv, int port,
@@ -588,14 +597,12 @@ int sja1105_vl_gate(struct sja1105_private *priv, int port, · 29 unmodified lines
588597
589598 if (priv->vlan_state == SJA1105_VLAN_UNAWARE &&
590599 key->type != SJA1105_KEY_VLAN_UNAWARE_VL) {
591− dev_err(priv->ds->dev, "1: vlan state %d key type %d\n",
592− priv->vlan_state, key->type);
593600 NL_SET_ERR_MSG_MOD(extack,
594601 "Can only gate based on DMAC");
595602 return -EOPNOTSUPP;
596− } else if (key->type != SJA1105_KEY_VLAN_AWARE_VL) {
597− dev_err(priv->ds->dev, "2: vlan state %d key type %d\n",
598− priv->vlan_state, key->type);
603+ } else if ((priv->vlan_state == SJA1105_VLAN_BEST_EFFORT ||
604+ priv->vlan_state == SJA1105_VLAN_FILTERING_FULL) &&
605+ key->type != SJA1105_KEY_VLAN_AWARE_VL) {
599606 NL_SET_ERR_MSG_MOD(extack,
600607 "Can only gate based on {DMAC, VID, PCP}");
601608 return -EOPNOTSUPP;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c+2−2
@@ -1700,7 +1700,7 @@ void hw_atl_rpfl3l4_ipv6_src_addr_set(struct aq_hw_s *aq_hw, u8 location, · 1699 unmodified lines
17001700 for (i = 0; i < 4; ++i)
17011701 aq_hw_write_reg(aq_hw,
17021702 HW_ATL_RPF_L3_SRCA_ADR(location + i),
1703− ipv6_src[i]);
1703+ ipv6_src[3 - i]);
17041704 }
17051705
17061706 void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location,
@@ -1711,7 +1711,7 @@ void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location, · 4 unmodified lines
17111711 for (i = 0; i < 4; ++i)
17121712 aq_hw_write_reg(aq_hw,
17131713 HW_ATL_RPF_L3_DSTA_ADR(location + i),
1714− ipv6_dest[i]);
1714+ ipv6_dest[3 - i]);
17151715 }
17161716
17171717 u32 hw_atl_sem_ram_get(struct aq_hw_s *self)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h+1−1
@@ -1360,7 +1360,7 @@ · 1359 unmodified lines
13601360 */
13611361
13621362 /* Register address for bitfield pif_rpf_l3_da0_i[31:0] */
1363−#define HW_ATL_RPF_L3_DSTA_ADR(filter) (0x000053B0 + (filter) * 0x4)
1363+#define HW_ATL_RPF_L3_DSTA_ADR(filter) (0x000053D0 + (filter) * 0x4)
13641364 /* Bitmask for bitfield l3_da0[1F:0] */
13651365 #define HW_ATL_RPF_L3_DSTA_MSK 0xFFFFFFFFu
13661366 /* Inverted bitmask for bitfield l3_da0[1F:0] */
drivers/net/ethernet/broadcom/bnxt/bnxt.c+29−7
@@ -6292,6 +6292,7 @@ int bnxt_hwrm_set_coal(struct bnxt *bp) · 6291 unmodified lines
62926292
62936293 static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
62946294 {
6295+ struct hwrm_stat_ctx_clr_stats_input req0 = {0};
62956296 struct hwrm_stat_ctx_free_input req = {0};
62966297 int i;
62976298
@@ -6301,6 +6302,7 @@ static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp) · 3 unmodified lines
63016302 if (BNXT_CHIP_TYPE_NITRO_A0(bp))
63026303 return;
63036304
6305+ bnxt_hwrm_cmd_hdr_init(bp, &req0, HWRM_STAT_CTX_CLR_STATS, -1, -1);
63046306 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_STAT_CTX_FREE, -1, -1);
63056307
63066308 mutex_lock(&bp->hwrm_cmd_lock);
@@ -6310,7 +6312,11 @@ static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp) · 3 unmodified lines
63106312
63116313 if (cpr->hw_stats_ctx_id != INVALID_STATS_CTX_ID) {
63126314 req.stat_ctx_id = cpu_to_le32(cpr->hw_stats_ctx_id);
6313−
6315+ if (BNXT_FW_MAJ(bp) <= 20) {
6316+ req0.stat_ctx_id = req.stat_ctx_id;
6317+ _hwrm_send_message(bp, &req0, sizeof(req0),
6318+ HWRM_CMD_TIMEOUT);
6319+ }
63146320 _hwrm_send_message(bp, &req, sizeof(req),
63156321 HWRM_CMD_TIMEOUT);
63166322
@@ -6976,7 +6982,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) · 659 unmodified lines
69766982 bp->fw_cap |= BNXT_FW_CAP_ERR_RECOVER_RELOAD;
69776983
69786984 bp->tx_push_thresh = 0;
6979− if (flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED)
6985+ if ((flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED) &&
6986+ BNXT_FW_MAJ(bp) > 217)
69806987 bp->tx_push_thresh = BNXT_TX_PUSH_THRESH;
69816988
69826989 hw_resc->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
@@ -7240,8 +7247,9 @@ static int __bnxt_hwrm_ver_get(struct bnxt *bp, bool silent) · 257 unmodified lines
72407247 static int bnxt_hwrm_ver_get(struct bnxt *bp)
72417248 {
72427249 struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr;
7250+ u16 fw_maj, fw_min, fw_bld, fw_rsv;
72437251 u32 dev_caps_cfg, hwrm_ver;
7244− int rc;
7252+ int rc, len;
72457253
72467254 bp->hwrm_max_req_len = HWRM_MAX_REQ_LEN;
72477255 mutex_lock(&bp->hwrm_cmd_lock);
@@ -7273,9 +7281,22 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp) · 25 unmodified lines
72737281 resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b,
72747282 resp->hwrm_intf_upd_8b);
72757283
7276− snprintf(bp->fw_ver_str, BC_HWRM_STR_LEN, "%d.%d.%d.%d",
7277− resp->hwrm_fw_maj_8b, resp->hwrm_fw_min_8b,
7278− resp->hwrm_fw_bld_8b, resp->hwrm_fw_rsvd_8b);
7284+ fw_maj = le16_to_cpu(resp->hwrm_fw_major);
7285+ if (bp->hwrm_spec_code > 0x10803 && fw_maj) {
7286+ fw_min = le16_to_cpu(resp->hwrm_fw_minor);
7287+ fw_bld = le16_to_cpu(resp->hwrm_fw_build);
7288+ fw_rsv = le16_to_cpu(resp->hwrm_fw_patch);
7289+ len = FW_VER_STR_LEN;
7290+ } else {
7291+ fw_maj = resp->hwrm_fw_maj_8b;
7292+ fw_min = resp->hwrm_fw_min_8b;
7293+ fw_bld = resp->hwrm_fw_bld_8b;
7294+ fw_rsv = resp->hwrm_fw_rsvd_8b;
7295+ len = BC_HWRM_STR_LEN;
7296+ }
7297+ bp->fw_ver_code = BNXT_FW_VER_CODE(fw_maj, fw_min, fw_bld, fw_rsv);
7298+ snprintf(bp->fw_ver_str, len, "%d.%d.%d.%d", fw_maj, fw_min, fw_bld,
7299+ fw_rsv);
72797300
72807301 if (strlen(resp->active_pkg_name)) {
72817302 int fw_ver_len = strlen(bp->fw_ver_str);
@@ -11892,7 +11913,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 4610 unmodified lines
1189211913 dev->ethtool_ops = &bnxt_ethtool_ops;
1189311914 pci_set_drvdata(pdev, dev);
1189411915
11895− bnxt_vpd_read_info(bp);
11916+ if (BNXT_PF(bp))
11917+ bnxt_vpd_read_info(bp);
1189611918
1189711919 rc = bnxt_alloc_hwrm_resources(bp);
1189811920 if (rc)
drivers/net/ethernet/broadcom/bnxt/bnxt.h+5−0
@@ -1746,6 +1746,11 @@ struct bnxt { · 1745 unmodified lines
17461746 #define PHY_VER_STR_LEN (FW_VER_STR_LEN - BC_HWRM_STR_LEN)
17471747 char fw_ver_str[FW_VER_STR_LEN];
17481748 char hwrm_ver_supp[FW_VER_STR_LEN];
1749+ u64 fw_ver_code;
1750+#define BNXT_FW_VER_CODE(maj, min, bld, rsv) \
1751+ ((u64)(maj) << 48 | (u64)(min) << 32 | (u64)(bld) << 16 | (rsv))
1752+#define BNXT_FW_MAJ(bp) ((bp)->fw_ver_code >> 48)
1753+
17491754 __be16 vxlan_port;
17501755 u8 vxlan_port_cnt;
17511756 __le16 vxlan_fw_dst_port_id;
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c+1−1
@@ -396,6 +396,7 @@ static void bnxt_free_vf_resources(struct bnxt *bp) · 395 unmodified lines
396396 }
397397 }
398398
399+ bp->pf.active_vfs = 0;
399400 kfree(bp->pf.vf);
400401 bp->pf.vf = NULL;
401402 }
@@ -835,7 +836,6 @@ void bnxt_sriov_disable(struct bnxt *bp) · 433 unmodified lines
835836
836837 bnxt_free_vf_resources(bp);
837838
838− bp->pf.active_vfs = 0;
839839 /* Reclaim all resources for the PF. */
840840 rtnl_lock();
841841 bnxt_restore_pf_fw_resources(bp);
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c+13−8
@@ -1889,7 +1889,8 @@ static void bnxt_tc_setup_indr_rel(void *cb_priv) · 1888 unmodified lines
18891889 }
18901890
18911891 static int bnxt_tc_setup_indr_block(struct net_device *netdev, struct bnxt *bp,
1892− struct flow_block_offload *f)
1892+ struct flow_block_offload *f, void *data,
1893+ void (*cleanup)(struct flow_block_cb *block_cb))
18931894 {
18941895 struct bnxt_flower_indr_block_cb_priv *cb_priv;
18951896 struct flow_block_cb *block_cb;
@@ -1907,9 +1908,10 @@ static int bnxt_tc_setup_indr_block(struct net_device *netdev, struct bnxt *bp, · 11 unmodified lines
19071908 cb_priv->bp = bp;
19081909 list_add(&cb_priv->list, &bp->tc_indr_block_list);
19091910
1910− block_cb = flow_block_cb_alloc(bnxt_tc_setup_indr_block_cb,
1911− cb_priv, cb_priv,
1912− bnxt_tc_setup_indr_rel);
1911+ block_cb = flow_indr_block_cb_alloc(bnxt_tc_setup_indr_block_cb,
1912+ cb_priv, cb_priv,
1913+ bnxt_tc_setup_indr_rel, f,
1914+ netdev, data, bp, cleanup);
19131915 if (IS_ERR(block_cb)) {
19141916 list_del(&cb_priv->list);
19151917 kfree(cb_priv);
@@ -1930,7 +1932,7 @@ static int bnxt_tc_setup_indr_block(struct net_device *netdev, struct bnxt *bp, · 14 unmodified lines
19301932 if (!block_cb)
19311933 return -ENOENT;
19321934
1933− flow_block_cb_remove(block_cb, f);
1935+ flow_indr_block_cb_remove(block_cb, f);
19341936 list_del(&block_cb->driver_list);
19351937 break;
19361938 default:
@@ -1945,14 +1947,17 @@ static bool bnxt_is_netdev_indr_offload(struct net_device *netdev) · 8 unmodified lines
19451947 }
19461948
19471949 static int bnxt_tc_setup_indr_cb(struct net_device *netdev, void *cb_priv,
1948− enum tc_setup_type type, void *type_data)
1950+ enum tc_setup_type type, void *type_data,
1951+ void *data,
1952+ void (*cleanup)(struct flow_block_cb *block_cb))
19491953 {
19501954 if (!bnxt_is_netdev_indr_offload(netdev))
19511955 return -EOPNOTSUPP;
19521956
19531957 switch (type) {
19541958 case TC_SETUP_BLOCK:
1955− return bnxt_tc_setup_indr_block(netdev, cb_priv, type_data);
1959+ return bnxt_tc_setup_indr_block(netdev, cb_priv, type_data, data,
1960+ cleanup);
19561961 default:
19571962 break;
19581963 }
@@ -2074,7 +2079,7 @@ void bnxt_shutdown_tc(struct bnxt *bp) · 115 unmodified lines
20742079 return;
20752080
20762081 flow_indr_dev_unregister(bnxt_tc_setup_indr_cb, bp,
2077− bnxt_tc_setup_indr_block_cb);
2082+ bnxt_tc_setup_indr_rel);
20782083 rhashtable_destroy(&tc_info->flow_table);
20792084 rhashtable_destroy(&tc_info->l2_table);
20802085 rhashtable_destroy(&tc_info->decap_l2_table);
drivers/net/ethernet/broadcom/genet/bcmgenet.c+5−83
@@ -459,17 +459,6 @@ static inline void bcmgenet_rdma_ring_writel(struct bcmgenet_priv *priv, · 458 unmodified lines
459459 genet_dma_ring_regs[r]);
460460 }
461461
462−static bool bcmgenet_hfb_is_filter_enabled(struct bcmgenet_priv *priv,
463− u32 f_index)
464−{
465− u32 offset;
466− u32 reg;
467−
468− offset = HFB_FLT_ENABLE_V3PLUS + (f_index < 32) * sizeof(u32);
469− reg = bcmgenet_hfb_reg_readl(priv, offset);
470− return !!(reg & (1 << (f_index % 32)));
471−}
472−
473462 static void bcmgenet_hfb_enable_filter(struct bcmgenet_priv *priv, u32 f_index)
474463 {
475464 u32 offset;
@@ -533,19 +522,6 @@ static void bcmgenet_hfb_set_filter_length(struct bcmgenet_priv *priv, · 57 unmodified lines
533522 bcmgenet_hfb_reg_writel(priv, reg, offset);
534523 }
535524
536−static int bcmgenet_hfb_find_unused_filter(struct bcmgenet_priv *priv)
537−{
538− u32 f_index;
539−
540− /* First MAX_NUM_OF_FS_RULES are reserved for Rx NFC filters */
541− for (f_index = MAX_NUM_OF_FS_RULES;
542− f_index < priv->hw_params->hfb_filter_cnt; f_index++)
543− if (!bcmgenet_hfb_is_filter_enabled(priv, f_index))
544− return f_index;
545−
546− return -ENOMEM;
547−}
548−
549525 static int bcmgenet_hfb_validate_mask(void *mask, size_t size)
550526 {
551527 while (size) {
@@ -634,8 +610,9 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 82 unmodified lines
634610 {
635611 struct ethtool_rx_flow_spec *fs = &rule->fs;
636612 int err = 0, offset = 0, f_length = 0;
637− u16 val_16, mask_16;
638613 u8 val_8, mask_8;
614+ __be16 val_16;
615+ u16 mask_16;
639616 size_t size;
640617 u32 *f_data;
641618
@@ -744,59 +721,6 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 102 unmodified lines
744721 return err;
745722 }
746723
747−/* bcmgenet_hfb_add_filter
748− *
749− * Add new filter to Hardware Filter Block to match and direct Rx traffic to
750− * desired Rx queue.
751− *
752− * f_data is an array of unsigned 32-bit integers where each 32-bit integer
753− * provides filter data for 2 bytes (4 nibbles) of Rx frame:
754− *
755− * bits 31:20 - unused
756− * bit 19 - nibble 0 match enable
757− * bit 18 - nibble 1 match enable
758− * bit 17 - nibble 2 match enable
759− * bit 16 - nibble 3 match enable
760− * bits 15:12 - nibble 0 data
761− * bits 11:8 - nibble 1 data
762− * bits 7:4 - nibble 2 data
763− * bits 3:0 - nibble 3 data
764− *
765− * Example:
766− * In order to match:
767− * - Ethernet frame type = 0x0800 (IP)
768− * - IP version field = 4
769− * - IP protocol field = 0x11 (UDP)
770− *
771− * The following filter is needed:
772− * u32 hfb_filter_ipv4_udp[] = {
773− * Rx frame offset 0x00: 0x00000000, 0x00000000, 0x00000000, 0x00000000,
774− * Rx frame offset 0x08: 0x00000000, 0x00000000, 0x000F0800, 0x00084000,
775− * Rx frame offset 0x10: 0x00000000, 0x00000000, 0x00000000, 0x00030011,
776− * };
777− *
778− * To add the filter to HFB and direct the traffic to Rx queue 0, call:
779− * bcmgenet_hfb_add_filter(priv, hfb_filter_ipv4_udp,
780− * ARRAY_SIZE(hfb_filter_ipv4_udp), 0);
781− */
782−int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
783− u32 f_length, u32 rx_queue)
784−{
785− int f_index;
786−
787− f_index = bcmgenet_hfb_find_unused_filter(priv);
788− if (f_index < 0)
789− return -ENOMEM;
790−
791− if (f_length > priv->hw_params->hfb_filter_size)
792− return -EINVAL;
793−
794− bcmgenet_hfb_set_filter(priv, f_data, f_length, rx_queue, f_index);
795− bcmgenet_hfb_enable_filter(priv, f_index);
796−
797− return 0;
798−}
799−
800724 /* bcmgenet_hfb_clear
801725 *
802726 * Clear Hardware Filter Block and disable all filtering.
@@ -2118,11 +2042,6 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) · 1315 unmodified lines
21182042 goto out;
21192043 }
21202044
2121− if (skb_padto(skb, ETH_ZLEN)) {
2122− ret = NETDEV_TX_OK;
2123− goto out;
2124− }
2125−
21262045 /* Retain how many bytes will be sent on the wire, without TSB inserted
21272046 * by transmit checksum offload
21282047 */
@@ -2169,6 +2088,9 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) · 40 unmodified lines
21692088 len_stat = (size << DMA_BUFLENGTH_SHIFT) |
21702089 (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT);
21712090
2091+ /* Note: if we ever change from DMA_TX_APPEND_CRC below we
2092+ * will need to restore software padding of "runt" packets
2093+ */
21722094 if (!i) {
21732095 len_stat |= DMA_TX_APPEND_CRC | DMA_SOP;
21742096 if (skb->ip_summed == CHECKSUM_PARTIAL)
drivers/net/ethernet/broadcom/tg3.c+2−2
@@ -18168,8 +18168,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev, · 18167 unmodified lines
1816818168
1816918169 rtnl_lock();
1817018170
18171− /* We probably don't have netdev yet */
18172− if (!netdev || !netif_running(netdev))
18171+ /* Could be second call or maybe we don't have netdev yet */
18172+ if (!netdev || tp->pcierr_recovery || !netif_running(netdev))
1817318173 goto done;
1817418174
1817518175 /* We needn't recover from permanent error */
drivers/net/ethernet/cadence/macb_main.c+101−58
@@ -2558,7 +2558,7 @@ static int macb_open(struct net_device *dev) · 2557 unmodified lines
25582558
25592559 err = macb_phylink_connect(bp);
25602560 if (err)
2561− goto napi_exit;
2561+ goto reset_hw;
25622562
25632563 netif_tx_start_all_queues(dev);
25642564
@@ -2567,9 +2567,11 @@ static int macb_open(struct net_device *dev) · 2 unmodified lines
25672567
25682568 return 0;
25692569
2570−napi_exit:
2570+reset_hw:
2571+ macb_reset_hw(bp);
25712572 for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
25722573 napi_disable(&queue->napi);
2574+ macb_free_consistent(bp);
25732575 pm_exit:
25742576 pm_runtime_put_sync(&bp->pdev->dev);
25752577 return err;
@@ -2819,11 +2821,13 @@ static void macb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) · 243 unmodified lines
28192821 {
28202822 struct macb *bp = netdev_priv(netdev);
28212823
2822− wol->supported = 0;
2823− wol->wolopts = 0;
2824−
2825− if (bp->wol & MACB_WOL_HAS_MAGIC_PACKET)
2824+ if (bp->wol & MACB_WOL_HAS_MAGIC_PACKET) {
28262825 phylink_ethtool_get_wol(bp->phylink, wol);
2826+ wol->supported |= WAKE_MAGIC;
2827+
2828+ if (bp->wol & MACB_WOL_ENABLED)
2829+ wol->wolopts |= WAKE_MAGIC;
2830+ }
28272831 }
28282832
28292833 static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
@@ -2831,9 +2835,13 @@ static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) · 1 unmodified line
28312835 struct macb *bp = netdev_priv(netdev);
28322836 int ret;
28332837
2838+ /* Pass the order to phylink layer */
28342839 ret = phylink_ethtool_set_wol(bp->phylink, wol);
2835− if (!ret)
2836− return 0;
2840+ /* Don't manage WoL on MAC if handled by the PHY
2841+ * or if there's a failure in talking to the PHY
2842+ */
2843+ if (!ret || ret != -EOPNOTSUPP)
2844+ return ret;
28372845
28382846 if (!(bp->wol & MACB_WOL_HAS_MAGIC_PACKET) ||
28392847 (wol->wolopts & ~WAKE_MAGIC))
@@ -3760,15 +3768,9 @@ static int macb_init(struct platform_device *pdev) · 920 unmodified lines
37603768
37613769 static struct sifive_fu540_macb_mgmt *mgmt;
37623770
3763−/* Initialize and start the Receiver and Transmit subsystems */
3764−static int at91ether_start(struct net_device *dev)
3771+static int at91ether_alloc_coherent(struct macb *lp)
37653772 {
3766− struct macb *lp = netdev_priv(dev);
37673773 struct macb_queue *q = &lp->queues[0];
3768− struct macb_dma_desc *desc;
3769− dma_addr_t addr;
3770− u32 ctl;
3771− int i;
37723774
37733775 q->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
37743776 (AT91ETHER_MAX_RX_DESCR *
@@ -3790,6 +3792,43 @@ static int at91ether_start(struct net_device *dev) · 15 unmodified lines
37903792 return -ENOMEM;
37913793 }
37923794
3795+ return 0;
3796+}
3797+
3798+static void at91ether_free_coherent(struct macb *lp)
3799+{
3800+ struct macb_queue *q = &lp->queues[0];
3801+
3802+ if (q->rx_ring) {
3803+ dma_free_coherent(&lp->pdev->dev,
3804+ AT91ETHER_MAX_RX_DESCR *
3805+ macb_dma_desc_get_size(lp),
3806+ q->rx_ring, q->rx_ring_dma);
3807+ q->rx_ring = NULL;
3808+ }
3809+
3810+ if (q->rx_buffers) {
3811+ dma_free_coherent(&lp->pdev->dev,
3812+ AT91ETHER_MAX_RX_DESCR *
3813+ AT91ETHER_MAX_RBUFF_SZ,
3814+ q->rx_buffers, q->rx_buffers_dma);
3815+ q->rx_buffers = NULL;
3816+ }
3817+}
3818+
3819+/* Initialize and start the Receiver and Transmit subsystems */
3820+static int at91ether_start(struct macb *lp)
3821+{
3822+ struct macb_queue *q = &lp->queues[0];
3823+ struct macb_dma_desc *desc;
3824+ dma_addr_t addr;
3825+ u32 ctl;
3826+ int i, ret;
3827+
3828+ ret = at91ether_alloc_coherent(lp);
3829+ if (ret)
3830+ return ret;
3831+
37933832 addr = q->rx_buffers_dma;
37943833 for (i = 0; i < AT91ETHER_MAX_RX_DESCR; i++) {
37953834 desc = macb_rx_desc(q, i);
@@ -3811,9 +3850,39 @@ static int at91ether_start(struct net_device *dev) · 15 unmodified lines
38113850 ctl = macb_readl(lp, NCR);
38123851 macb_writel(lp, NCR, ctl | MACB_BIT(RE) | MACB_BIT(TE));
38133852
3853+ /* Enable MAC interrupts */
3854+ macb_writel(lp, IER, MACB_BIT(RCOMP) |
3855+ MACB_BIT(RXUBR) |
3856+ MACB_BIT(ISR_TUND) |
3857+ MACB_BIT(ISR_RLE) |
3858+ MACB_BIT(TCOMP) |
3859+ MACB_BIT(ISR_ROVR) |
3860+ MACB_BIT(HRESP));
3861+
38143862 return 0;
38153863 }
38163864
3865+static void at91ether_stop(struct macb *lp)
3866+{
3867+ u32 ctl;
3868+
3869+ /* Disable MAC interrupts */
3870+ macb_writel(lp, IDR, MACB_BIT(RCOMP) |
3871+ MACB_BIT(RXUBR) |
3872+ MACB_BIT(ISR_TUND) |
3873+ MACB_BIT(ISR_RLE) |
3874+ MACB_BIT(TCOMP) |
3875+ MACB_BIT(ISR_ROVR) |
3876+ MACB_BIT(HRESP));
3877+
3878+ /* Disable Receiver and Transmitter */
3879+ ctl = macb_readl(lp, NCR);
3880+ macb_writel(lp, NCR, ctl & ~(MACB_BIT(TE) | MACB_BIT(RE)));
3881+
3882+ /* Free resources. */
3883+ at91ether_free_coherent(lp);
3884+}
3885+
38173886 /* Open the ethernet interface */
38183887 static int at91ether_open(struct net_device *dev)
38193888 {
@@ -3833,63 +3902,36 @@ static int at91ether_open(struct net_device *dev) · 13 unmodified lines
38333902
38343903 macb_set_hwaddr(lp);
38353904
3836− ret = at91ether_start(dev);
3905+ ret = at91ether_start(lp);
38373906 if (ret)
3838− return ret;
3839−
3840− /* Enable MAC interrupts */
3841− macb_writel(lp, IER, MACB_BIT(RCOMP) |
3842− MACB_BIT(RXUBR) |
3843− MACB_BIT(ISR_TUND) |
3844− MACB_BIT(ISR_RLE) |
3845− MACB_BIT(TCOMP) |
3846− MACB_BIT(ISR_ROVR) |
3847− MACB_BIT(HRESP));
3907+ goto pm_exit;
38483908
38493909 ret = macb_phylink_connect(lp);
38503910 if (ret)
3851− return ret;
3911+ goto stop;
38523912
38533913 netif_start_queue(dev);
38543914
38553915 return 0;
3916+
3917+stop:
3918+ at91ether_stop(lp);
3919+pm_exit:
3920+ pm_runtime_put_sync(&lp->pdev->dev);
3921+ return ret;
38563922 }
38573923
38583924 /* Close the interface */
38593925 static int at91ether_close(struct net_device *dev)
38603926 {
38613927 struct macb *lp = netdev_priv(dev);
3862− struct macb_queue *q = &lp->queues[0];
3863− u32 ctl;
3864−
3865− /* Disable Receiver and Transmitter */
3866− ctl = macb_readl(lp, NCR);
3867− macb_writel(lp, NCR, ctl & ~(MACB_BIT(TE) | MACB_BIT(RE)));
3868−
3869− /* Disable MAC interrupts */
3870− macb_writel(lp, IDR, MACB_BIT(RCOMP) |
3871− MACB_BIT(RXUBR) |
3872− MACB_BIT(ISR_TUND) |
3873− MACB_BIT(ISR_RLE) |
3874− MACB_BIT(TCOMP) |
3875− MACB_BIT(ISR_ROVR) |
3876− MACB_BIT(HRESP));
38773928
38783929 netif_stop_queue(dev);
38793930
38803931 phylink_stop(lp->phylink);
38813932 phylink_disconnect_phy(lp->phylink);
38823933
3883− dma_free_coherent(&lp->pdev->dev,
3884− AT91ETHER_MAX_RX_DESCR *
3885− macb_dma_desc_get_size(lp),
3886− q->rx_ring, q->rx_ring_dma);
3887− q->rx_ring = NULL;
3888−
3889− dma_free_coherent(&lp->pdev->dev,
3890− AT91ETHER_MAX_RX_DESCR * AT91ETHER_MAX_RBUFF_SZ,
3891− q->rx_buffers, q->rx_buffers_dma);
3892− q->rx_buffers = NULL;
3934+ at91ether_stop(lp);
38933935
38943936 return pm_runtime_put(&lp->pdev->dev);
38953937 }
@@ -4386,7 +4428,7 @@ static int macb_probe(struct platform_device *pdev) · 490 unmodified lines
43864428 bp->wol = 0;
43874429 if (of_get_property(np, "magic-packet", NULL))
43884430 bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
4389− device_init_wakeup(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
4431+ device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
43904432
43914433 spin_lock_init(&bp->lock);
43924434
@@ -4562,10 +4604,10 @@ static int __maybe_unused macb_suspend(struct device *dev) · 169 unmodified lines
45624604 bp->pm_data.scrt2 = gem_readl_n(bp, ETHT, SCRT2_ETHT);
45634605 }
45644606
4565− netif_carrier_off(netdev);
45664607 if (bp->ptp_info)
45674608 bp->ptp_info->ptp_remove(netdev);
4568− pm_runtime_force_suspend(dev);
4609+ if (!device_may_wakeup(dev))
4610+ pm_runtime_force_suspend(dev);
45694611
45704612 return 0;
45714613 }
@@ -4580,7 +4622,8 @@ static int __maybe_unused macb_resume(struct device *dev) · 8 unmodified lines
45804622 if (!netif_running(netdev))
45814623 return 0;
45824624
4583− pm_runtime_force_resume(dev);
4625+ if (!device_may_wakeup(dev))
4626+ pm_runtime_force_resume(dev);
45844627
45854628 if (bp->wol & MACB_WOL_ENABLED) {
45864629 macb_writel(bp, IDR, MACB_BIT(WOL));
@@ -4618,7 +4661,7 @@ static int __maybe_unused macb_runtime_suspend(struct device *dev) · 31 unmodified lines
46184661 struct net_device *netdev = dev_get_drvdata(dev);
46194662 struct macb *bp = netdev_priv(netdev);
46204663
4621− if (!(device_may_wakeup(&bp->dev->dev))) {
4664+ if (!(device_may_wakeup(dev))) {
46224665 clk_disable_unprepare(bp->tx_clk);
46234666 clk_disable_unprepare(bp->hclk);
46244667 clk_disable_unprepare(bp->pclk);
@@ -4634,7 +4677,7 @@ static int __maybe_unused macb_runtime_resume(struct device *dev) · 9 unmodified lines
46344677 struct net_device *netdev = dev_get_drvdata(dev);
46354678 struct macb *bp = netdev_priv(netdev);
46364679
4637− if (!(device_may_wakeup(&bp->dev->dev))) {
4680+ if (!(device_may_wakeup(dev))) {
46384681 clk_prepare_enable(bp->pclk);
46394682 clk_prepare_enable(bp->hclk);
46404683 clk_prepare_enable(bp->tx_clk);
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c+4−2
@@ -1975,7 +1975,6 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init, · 1974 unmodified lines
19751975 u8 mem_type[CTXT_INGRESS + 1] = { 0 };
19761976 struct cudbg_buffer temp_buff = { 0 };
19771977 struct cudbg_ch_cntxt *buff;
1978− u64 *dst_off, *src_off;
19791978 u8 *ctx_buf;
19801979 u8 i, k;
19811980 int rc;
@@ -2044,8 +2043,11 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init, · 62 unmodified lines
20442043 }
20452044
20462045 for (j = 0; j < max_ctx_qid; j++) {
2046+ __be64 *dst_off;
2047+ u64 *src_off;
2048+
20472049 src_off = (u64 *)(ctx_buf + j * SGE_CTXT_SIZE);
2048− dst_off = (u64 *)buff->data;
2050+ dst_off = (__be64 *)buff->data;
20492051
20502052 /* The data is stored in 64-bit cpu order. Convert it
20512053 * to big endian before parsing.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h+3−0
@@ -136,6 +136,9 @@ static inline __u8 bitswap_1(unsigned char val) · 135 unmodified lines
136136 ((val & 0x02) << 5) |
137137 ((val & 0x01) << 7);
138138 }
139+
140+extern const char * const dcb_ver_array[];
141+
139142 #define CXGB4_DCB_ENABLED true
140143
141144 #else /* !CONFIG_CHELSIO_T4_DCB */
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c+0−1
@@ -2379,7 +2379,6 @@ static const struct file_operations rss_vf_config_debugfs_fops = { · 2378 unmodified lines
23792379 };
23802380
23812381 #ifdef CONFIG_CHELSIO_T4_DCB
2382−extern char *dcb_ver_array[];
23832382
23842383 /* Data Center Briging information for each port.
23852384 */
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c+1−1
@@ -588,7 +588,7 @@ static void fw_caps_to_lmm(enum fw_port_type port_type, · 587 unmodified lines
588588 /**
589589 * lmm_to_fw_caps - translate ethtool Link Mode Mask to Firmware
590590 * capabilities
591− * @et_lmm: ethtool Link Mode Mask
591+ * @link_mode_mask: ethtool Link Mode Mask
592592 *
593593 * Translate ethtool Link Mode Mask into a Firmware Port capabilities
594594 * value.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c+16−9
@@ -165,6 +165,9 @@ static void set_nat_params(struct adapter *adap, struct filter_entry *f, · 164 unmodified lines
165165 unsigned int tid, bool dip, bool sip, bool dp,
166166 bool sp)
167167 {
168+ u8 *nat_lp = (u8 *)&f->fs.nat_lport;
169+ u8 *nat_fp = (u8 *)&f->fs.nat_fport;
170+
168171 if (dip) {
169172 if (f->fs.type) {
170173 set_tcb_field(adap, f, tid, TCB_SND_UNA_RAW_W,
@@ -236,8 +239,9 @@ static void set_nat_params(struct adapter *adap, struct filter_entry *f, · 65 unmodified lines
236239 }
237240
238241 set_tcb_field(adap, f, tid, TCB_PDU_HDR_LEN_W, WORD_MASK,
239− (dp ? f->fs.nat_lport : 0) |
240− (sp ? f->fs.nat_fport << 16 : 0), 1);
242+ (dp ? (nat_lp[1] | nat_lp[0] << 8) : 0) |
243+ (sp ? (nat_fp[1] << 16 | nat_fp[0] << 24) : 0),
244+ 1);
241245 }
242246
243247 /* Validate filter spec against configuration done on the card. */
@@ -909,6 +913,9 @@ int set_filter_wr(struct adapter *adapter, int fidx) · 665 unmodified lines
909913 fwr->fpm = htons(f->fs.mask.fport);
910914
911915 if (adapter->params.filter2_wr_support) {
916+ u8 *nat_lp = (u8 *)&f->fs.nat_lport;
917+ u8 *nat_fp = (u8 *)&f->fs.nat_fport;
918+
912919 fwr->natmode_to_ulp_type =
913920 FW_FILTER2_WR_ULP_TYPE_V(f->fs.nat_mode ?
914921 ULP_MODE_TCPDDP :
@@ -916,8 +923,8 @@ int set_filter_wr(struct adapter *adapter, int fidx) · 1 unmodified line
916923 FW_FILTER2_WR_NATMODE_V(f->fs.nat_mode);
917924 memcpy(fwr->newlip, f->fs.nat_lip, sizeof(fwr->newlip));
918925 memcpy(fwr->newfip, f->fs.nat_fip, sizeof(fwr->newfip));
919− fwr->newlport = htons(f->fs.nat_lport);
920− fwr->newfport = htons(f->fs.nat_fport);
926+ fwr->newlport = htons(nat_lp[1] | nat_lp[0] << 8);
927+ fwr->newfport = htons(nat_fp[1] | nat_fp[0] << 8);
921928 }
922929
923930 /* Mark the filter as "pending" and ship off the Filter Work Request.
@@ -1105,16 +1112,16 @@ static bool is_addr_all_mask(u8 *ipmask, int family) · 181 unmodified lines
11051112 struct in_addr *addr;
11061113
11071114 addr = (struct in_addr *)ipmask;
1108− if (addr->s_addr == 0xffffffff)
1115+ if (addr->s_addr == htonl(0xffffffff))
11091116 return true;
11101117 } else if (family == AF_INET6) {
11111118 struct in6_addr *addr6;
11121119
11131120 addr6 = (struct in6_addr *)ipmask;
1114− if (addr6->s6_addr32[0] == 0xffffffff &&
1115− addr6->s6_addr32[1] == 0xffffffff &&
1116− addr6->s6_addr32[2] == 0xffffffff &&
1117− addr6->s6_addr32[3] == 0xffffffff)
1121+ if (addr6->s6_addr32[0] == htonl(0xffffffff) &&
1122+ addr6->s6_addr32[1] == htonl(0xffffffff) &&
1123+ addr6->s6_addr32[2] == htonl(0xffffffff) &&
1124+ addr6->s6_addr32[3] == htonl(0xffffffff))
11181125 return true;
11191126 }
11201127 return false;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+6−5
@@ -449,7 +449,7 @@ static int set_rxmode(struct net_device *dev, int mtu, bool sleep_ok) · 448 unmodified lines
449449 * or -1
450450 * @addr: the new MAC address value
451451 * @persist: whether a new MAC allocation should be persistent
452− * @add_smt: if true also add the address to the HW SMT
452+ * @smt_idx: the destination to store the new SMT index.
453453 *
454454 * Modifies an MPS filter and sets it to the new MAC address if
455455 * @tcam_idx >= 0, or adds the MAC address to a new filter if
@@ -1615,6 +1615,7 @@ static int tid_init(struct tid_info *t) · 1159 unmodified lines
16151615 * @stid: the server TID
16161616 * @sip: local IP address to bind server to
16171617 * @sport: the server's TCP port
1618+ * @vlan: the VLAN header information
16181619 * @queue: queue to direct messages from this server to
16191620 *
16201621 * Create an IP server for the given port and address.
@@ -2609,7 +2610,7 @@ int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid, · 988 unmodified lines
26092610
26102611 /* Clear out filter specifications */
26112612 memset(&f->fs, 0, sizeof(struct ch_filter_specification));
2612− f->fs.val.lport = cpu_to_be16(sport);
2613+ f->fs.val.lport = be16_to_cpu(sport);
26132614 f->fs.mask.lport = ~0;
26142615 val = (u8 *)&sip;
26152616 if ((val[0] | val[1] | val[2] | val[3]) != 0) {
@@ -5377,10 +5378,10 @@ static inline bool is_x_10g_port(const struct link_config *lc) · 2761 unmodified lines
53775378 static int cfg_queues(struct adapter *adap)
53785379 {
53795380 u32 avail_qsets, avail_eth_qsets, avail_uld_qsets;
5380− u32 i, n10g = 0, qidx = 0, n1g = 0;
53815381 u32 ncpus = num_online_cpus();
53825382 u32 niqflint, neq, num_ulds;
53835383 struct sge *s = &adap->sge;
5384+ u32 i, n10g = 0, qidx = 0;
53845385 u32 q10g = 0, q1g;
53855386
53865387 /* Reduce memory usage in kdump environment, disable all offload. */
@@ -5426,7 +5427,6 @@ static int cfg_queues(struct adapter *adap) · 39 unmodified lines
54265427 if (n10g)
54275428 q10g = (avail_eth_qsets - (adap->params.nports - n10g)) / n10g;
54285429
5429− n1g = adap->params.nports - n10g;
54305430 #ifdef CONFIG_CHELSIO_T4_DCB
54315431 /* For Data Center Bridging support we need to be able to support up
54325432 * to 8 Traffic Priorities; each of which will be assigned to its
@@ -5444,7 +5444,8 @@ static int cfg_queues(struct adapter *adap) · 11 unmodified lines
54445444 else
54455445 q10g = max(8U, q10g);
54465446
5447− while ((q10g * n10g) > (avail_eth_qsets - n1g * q1g))
5447+ while ((q10g * n10g) >
5448+ (avail_eth_qsets - (adap->params.nports - n10g) * q1g))
54485449 q10g--;
54495450
54505451 #else /* !CONFIG_CHELSIO_T4_DCB */
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c+2−1
@@ -194,6 +194,7 @@ int cxgb4_ptp_redirect_rx_packet(struct adapter *adapter, struct port_info *pi) · 193 unmodified lines
194194 }
195195
196196 /**
197+ * cxgb4_ptp_adjfreq - Adjust frequency of PHC cycle counter
197198 * @ptp: ptp clock structure
198199 * @ppb: Desired frequency change in parts per billion
199200 *
@@ -229,7 +230,7 @@ static int cxgb4_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb) · 29 unmodified lines
229230
230231 /**
231232 * cxgb4_ptp_fineadjtime - Shift the time of the hardware clock
232− * @ptp: ptp clock structure
233+ * @adapter: board private structure
233234 * @delta: Desired change in nanoseconds
234235 *
235236 * Adjust the timer by resetting the timecounter structure.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c+10−20
@@ -58,10 +58,6 @@ static struct ch_tc_pedit_fields pedits[] = { · 57 unmodified lines
5858 PEDIT_FIELDS(IP6_, DST_63_32, 4, nat_lip, 4),
5959 PEDIT_FIELDS(IP6_, DST_95_64, 4, nat_lip, 8),
6060 PEDIT_FIELDS(IP6_, DST_127_96, 4, nat_lip, 12),
61− PEDIT_FIELDS(TCP_, SPORT, 2, nat_fport, 0),
62− PEDIT_FIELDS(TCP_, DPORT, 2, nat_lport, 0),
63− PEDIT_FIELDS(UDP_, SPORT, 2, nat_fport, 0),
64− PEDIT_FIELDS(UDP_, DPORT, 2, nat_lport, 0),
6561 };
6662
6763 static struct ch_tc_flower_entry *allocate_flower_entry(void)
@@ -156,14 +152,14 @@ static void cxgb4_process_flow_match(struct net_device *dev, · 88 unmodified lines
156152 struct flow_match_ports match;
157153
158154 flow_rule_match_ports(rule, &match);
159− fs->val.lport = cpu_to_be16(match.key->dst);
160− fs->mask.lport = cpu_to_be16(match.mask->dst);
161− fs->val.fport = cpu_to_be16(match.key->src);
162− fs->mask.fport = cpu_to_be16(match.mask->src);
155+ fs->val.lport = be16_to_cpu(match.key->dst);
156+ fs->mask.lport = be16_to_cpu(match.mask->dst);
157+ fs->val.fport = be16_to_cpu(match.key->src);
158+ fs->mask.fport = be16_to_cpu(match.mask->src);
163159
164160 /* also initialize nat_lport/fport to same values */
165− fs->nat_lport = cpu_to_be16(match.key->dst);
166− fs->nat_fport = cpu_to_be16(match.key->src);
161+ fs->nat_lport = fs->val.lport;
162+ fs->nat_fport = fs->val.fport;
167163 }
168164
169165 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IP)) {
@@ -354,12 +350,9 @@ static void process_pedit_field(struct ch_filter_specification *fs, u32 val, · 184 unmodified lines
354350 switch (offset) {
355351 case PEDIT_TCP_SPORT_DPORT:
356352 if (~mask & PEDIT_TCP_UDP_SPORT_MASK)
357− offload_pedit(fs, cpu_to_be32(val) >> 16,
358− cpu_to_be32(mask) >> 16,
359− TCP_SPORT);
353+ fs->nat_fport = val;
360354 else
361− offload_pedit(fs, cpu_to_be32(val),
362− cpu_to_be32(mask), TCP_DPORT);
355+ fs->nat_lport = val >> 16;
363356 }
364357 fs->nat_mode = NAT_MODE_ALL;
365358 break;
@@ -367,12 +360,9 @@ static void process_pedit_field(struct ch_filter_specification *fs, u32 val, · 1 unmodified line
367360 switch (offset) {
368361 case PEDIT_UDP_SPORT_DPORT:
369362 if (~mask & PEDIT_TCP_UDP_SPORT_MASK)
370− offload_pedit(fs, cpu_to_be32(val) >> 16,
371− cpu_to_be32(mask) >> 16,
372− UDP_SPORT);
363+ fs->nat_fport = val;
373364 else
374− offload_pedit(fs, cpu_to_be32(val),
375− cpu_to_be32(mask), UDP_DPORT);
365+ fs->nat_lport = val >> 16;
376366 }
377367 fs->nat_mode = NAT_MODE_ALL;
378368 }
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c+9−9
@@ -48,7 +48,7 @@ static int fill_match_fields(struct adapter *adap, · 47 unmodified lines
4848 bool next_header)
4949 {
5050 unsigned int i, j;
51− u32 val, mask;
51+ __be32 val, mask;
5252 int off, err;
5353 bool found;
5454
@@ -228,7 +228,7 @@ int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls) · 173 unmodified lines
228228 const struct cxgb4_next_header *next;
229229 bool found = false;
230230 unsigned int i, j;
231− u32 val, mask;
231+ __be32 val, mask;
232232 int off;
233233
234234 if (t->table[link_uhtid - 1].link_handle) {
@@ -242,10 +242,10 @@ int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls) · 7 unmodified lines
242242
243243 /* Try to find matches that allow jumps to next header. */
244244 for (i = 0; next[i].jump; i++) {
245− if (next[i].offoff != cls->knode.sel->offoff ||
246− next[i].shift != cls->knode.sel->offshift ||
247− next[i].mask != cls->knode.sel->offmask ||
248− next[i].offset != cls->knode.sel->off)
245+ if (next[i].sel.offoff != cls->knode.sel->offoff ||
246+ next[i].sel.offshift != cls->knode.sel->offshift ||
247+ next[i].sel.offmask != cls->knode.sel->offmask ||
248+ next[i].sel.off != cls->knode.sel->off)
249249 continue;
250250
251251 /* Found a possible candidate. Find a key that
@@ -257,9 +257,9 @@ int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls) · 5 unmodified lines
257257 val = cls->knode.sel->keys[j].val;
258258 mask = cls->knode.sel->keys[j].mask;
259259
260− if (next[i].match_off == off &&
261− next[i].match_val == val &&
262− next[i].match_mask == mask) {
260+ if (next[i].key.off == off &&
261+ next[i].key.val == val &&
262+ next[i].key.mask == mask) {
263263 found = true;
264264 break;
265265 }
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h+82−40
@@ -38,12 +38,12 @@ · 37 unmodified lines
3838 struct cxgb4_match_field {
3939 int off; /* Offset from the beginning of the header to match */
4040 /* Fill the value/mask pair in the spec if matched */
41− int (*val)(struct ch_filter_specification *f, u32 val, u32 mask);
41+ int (*val)(struct ch_filter_specification *f, __be32 val, __be32 mask);
4242 };
4343
4444 /* IPv4 match fields */
4545 static inline int cxgb4_fill_ipv4_tos(struct ch_filter_specification *f,
46− u32 val, u32 mask)
46+ __be32 val, __be32 mask)
4747 {
4848 f->val.tos = (ntohl(val) >> 16) & 0x000000FF;
4949 f->mask.tos = (ntohl(mask) >> 16) & 0x000000FF;
@@ -52,7 +52,7 @@ static inline int cxgb4_fill_ipv4_tos(struct ch_filter_specification *f, · 2 unmodified lines
5252 }
5353
5454 static inline int cxgb4_fill_ipv4_frag(struct ch_filter_specification *f,
55− u32 val, u32 mask)
55+ __be32 val, __be32 mask)
5656 {
5757 u32 mask_val;
5858 u8 frag_val;
@@ -74,7 +74,7 @@ static inline int cxgb4_fill_ipv4_frag(struct ch_filter_specification *f, · 15 unmodified lines
7474 }
7575
7676 static inline int cxgb4_fill_ipv4_proto(struct ch_filter_specification *f,
77− u32 val, u32 mask)
77+ __be32 val, __be32 mask)
7878 {
7979 f->val.proto = (ntohl(val) >> 16) & 0x000000FF;
8080 f->mask.proto = (ntohl(mask) >> 16) & 0x000000FF;
@@ -83,7 +83,7 @@ static inline int cxgb4_fill_ipv4_proto(struct ch_filter_specification *f, · 2 unmodified lines
8383 }
8484
8585 static inline int cxgb4_fill_ipv4_src_ip(struct ch_filter_specification *f,
86− u32 val, u32 mask)
86+ __be32 val, __be32 mask)
8787 {
8888 memcpy(&f->val.fip[0], &val, sizeof(u32));
8989 memcpy(&f->mask.fip[0], &mask, sizeof(u32));
@@ -92,7 +92,7 @@ static inline int cxgb4_fill_ipv4_src_ip(struct ch_filter_specification *f, · 2 unmodified lines
9292 }
9393
9494 static inline int cxgb4_fill_ipv4_dst_ip(struct ch_filter_specification *f,
95− u32 val, u32 mask)
95+ __be32 val, __be32 mask)
9696 {
9797 memcpy(&f->val.lip[0], &val, sizeof(u32));
9898 memcpy(&f->mask.lip[0], &mask, sizeof(u32));
@@ -111,7 +111,7 @@ static const struct cxgb4_match_field cxgb4_ipv4_fields[] = { · 12 unmodified lines
111111
112112 /* IPv6 match fields */
113113 static inline int cxgb4_fill_ipv6_tos(struct ch_filter_specification *f,
114− u32 val, u32 mask)
114+ __be32 val, __be32 mask)
115115 {
116116 f->val.tos = (ntohl(val) >> 20) & 0x000000FF;
117117 f->mask.tos = (ntohl(mask) >> 20) & 0x000000FF;
@@ -120,7 +120,7 @@ static inline int cxgb4_fill_ipv6_tos(struct ch_filter_specification *f, · 2 unmodified lines
120120 }
121121
122122 static inline int cxgb4_fill_ipv6_proto(struct ch_filter_specification *f,
123− u32 val, u32 mask)
123+ __be32 val, __be32 mask)
124124 {
125125 f->val.proto = (ntohl(val) >> 8) & 0x000000FF;
126126 f->mask.proto = (ntohl(mask) >> 8) & 0x000000FF;
@@ -129,7 +129,7 @@ static inline int cxgb4_fill_ipv6_proto(struct ch_filter_specification *f, · 2 unmodified lines
129129 }
130130
131131 static inline int cxgb4_fill_ipv6_src_ip0(struct ch_filter_specification *f,
132− u32 val, u32 mask)
132+ __be32 val, __be32 mask)
133133 {
134134 memcpy(&f->val.fip[0], &val, sizeof(u32));
135135 memcpy(&f->mask.fip[0], &mask, sizeof(u32));
@@ -138,7 +138,7 @@ static inline int cxgb4_fill_ipv6_src_ip0(struct ch_filter_specification *f, · 2 unmodified lines
138138 }
139139
140140 static inline int cxgb4_fill_ipv6_src_ip1(struct ch_filter_specification *f,
141− u32 val, u32 mask)
141+ __be32 val, __be32 mask)
142142 {
143143 memcpy(&f->val.fip[4], &val, sizeof(u32));
144144 memcpy(&f->mask.fip[4], &mask, sizeof(u32));
@@ -147,7 +147,7 @@ static inline int cxgb4_fill_ipv6_src_ip1(struct ch_filter_specification *f, · 2 unmodified lines
147147 }
148148
149149 static inline int cxgb4_fill_ipv6_src_ip2(struct ch_filter_specification *f,
150− u32 val, u32 mask)
150+ __be32 val, __be32 mask)
151151 {
152152 memcpy(&f->val.fip[8], &val, sizeof(u32));
153153 memcpy(&f->mask.fip[8], &mask, sizeof(u32));
@@ -156,7 +156,7 @@ static inline int cxgb4_fill_ipv6_src_ip2(struct ch_filter_specification *f, · 2 unmodified lines
156156 }
157157
158158 static inline int cxgb4_fill_ipv6_src_ip3(struct ch_filter_specification *f,
159− u32 val, u32 mask)
159+ __be32 val, __be32 mask)
160160 {
161161 memcpy(&f->val.fip[12], &val, sizeof(u32));
162162 memcpy(&f->mask.fip[12], &mask, sizeof(u32));
@@ -165,7 +165,7 @@ static inline int cxgb4_fill_ipv6_src_ip3(struct ch_filter_specification *f, · 2 unmodified lines
165165 }
166166
167167 static inline int cxgb4_fill_ipv6_dst_ip0(struct ch_filter_specification *f,
168− u32 val, u32 mask)
168+ __be32 val, __be32 mask)
169169 {
170170 memcpy(&f->val.lip[0], &val, sizeof(u32));
171171 memcpy(&f->mask.lip[0], &mask, sizeof(u32));
@@ -174,7 +174,7 @@ static inline int cxgb4_fill_ipv6_dst_ip0(struct ch_filter_specification *f, · 2 unmodified lines
174174 }
175175
176176 static inline int cxgb4_fill_ipv6_dst_ip1(struct ch_filter_specification *f,
177− u32 val, u32 mask)
177+ __be32 val, __be32 mask)
178178 {
179179 memcpy(&f->val.lip[4], &val, sizeof(u32));
180180 memcpy(&f->mask.lip[4], &mask, sizeof(u32));
@@ -183,7 +183,7 @@ static inline int cxgb4_fill_ipv6_dst_ip1(struct ch_filter_specification *f, · 2 unmodified lines
183183 }
184184
185185 static inline int cxgb4_fill_ipv6_dst_ip2(struct ch_filter_specification *f,
186− u32 val, u32 mask)
186+ __be32 val, __be32 mask)
187187 {
188188 memcpy(&f->val.lip[8], &val, sizeof(u32));
189189 memcpy(&f->mask.lip[8], &mask, sizeof(u32));
@@ -192,7 +192,7 @@ static inline int cxgb4_fill_ipv6_dst_ip2(struct ch_filter_specification *f, · 2 unmodified lines
192192 }
193193
194194 static inline int cxgb4_fill_ipv6_dst_ip3(struct ch_filter_specification *f,
195− u32 val, u32 mask)
195+ __be32 val, __be32 mask)
196196 {
197197 memcpy(&f->val.lip[12], &val, sizeof(u32));
198198 memcpy(&f->mask.lip[12], &mask, sizeof(u32));
@@ -216,7 +216,7 @@ static const struct cxgb4_match_field cxgb4_ipv6_fields[] = { · 17 unmodified lines
216216
217217 /* TCP/UDP match */
218218 static inline int cxgb4_fill_l4_ports(struct ch_filter_specification *f,
219− u32 val, u32 mask)
219+ __be32 val, __be32 mask)
220220 {
221221 f->val.fport = ntohl(val) >> 16;
222222 f->mask.fport = ntohl(mask) >> 16;
@@ -237,19 +237,13 @@ static const struct cxgb4_match_field cxgb4_udp_fields[] = { · 14 unmodified lines
237237 };
238238
239239 struct cxgb4_next_header {
240− unsigned int offset; /* Offset to next header */
241− /* offset, shift, and mask added to offset above
240+ /* Offset, shift, and mask added to beginning of the header
242241 * to get to next header. Useful when using a header
243242 * field's value to jump to next header such as IHL field
244243 * in IPv4 header.
245244 */
246− unsigned int offoff;
247− u32 shift;
248− u32 mask;
249− /* match criteria to make this jump */
250− unsigned int match_off;
251− u32 match_val;
252− u32 match_mask;
245+ struct tc_u32_sel sel;
246+ struct tc_u32_key key;
253247 /* location of jump to make */
254248 const struct cxgb4_match_field *jump;
255249 };
@@ -258,26 +252,74 @@ struct cxgb4_next_header { · 2 unmodified lines
258252 * IPv4 header.
259253 */
260254 static const struct cxgb4_next_header cxgb4_ipv4_jumps[] = {
261− { .offset = 0, .offoff = 0, .shift = 6, .mask = 0xF,
262− .match_off = 8, .match_val = 0x600, .match_mask = 0xFF00,
263− .jump = cxgb4_tcp_fields },
264− { .offset = 0, .offoff = 0, .shift = 6, .mask = 0xF,
265− .match_off = 8, .match_val = 0x1100, .match_mask = 0xFF00,
266− .jump = cxgb4_udp_fields },
267− { .jump = NULL }
255+ {
256+ /* TCP Jump */
257+ .sel = {
258+ .off = 0,
259+ .offoff = 0,
260+ .offshift = 6,
261+ .offmask = cpu_to_be16(0x0f00),
262+ },
263+ .key = {
264+ .off = 8,
265+ .val = cpu_to_be32(0x00060000),
266+ .mask = cpu_to_be32(0x00ff0000),
267+ },
268+ .jump = cxgb4_tcp_fields,
269+ },
270+ {
271+ /* UDP Jump */
272+ .sel = {
273+ .off = 0,
274+ .offoff = 0,
275+ .offshift = 6,
276+ .offmask = cpu_to_be16(0x0f00),
277+ },
278+ .key = {
279+ .off = 8,
280+ .val = cpu_to_be32(0x00110000),
281+ .mask = cpu_to_be32(0x00ff0000),
282+ },
283+ .jump = cxgb4_udp_fields,
284+ },
285+ { .jump = NULL },
268286 };
269287
270288 /* Accept a rule with a jump directly past the 40 Bytes of IPv6 fixed header
271289 * to get to transport layer header.
272290 */
273291 static const struct cxgb4_next_header cxgb4_ipv6_jumps[] = {
274− { .offset = 0x28, .offoff = 0, .shift = 0, .mask = 0,
275− .match_off = 4, .match_val = 0x60000, .match_mask = 0xFF0000,
276− .jump = cxgb4_tcp_fields },
277− { .offset = 0x28, .offoff = 0, .shift = 0, .mask = 0,
278− .match_off = 4, .match_val = 0x110000, .match_mask = 0xFF0000,
279− .jump = cxgb4_udp_fields },
280− { .jump = NULL }
292+ {
293+ /* TCP Jump */
294+ .sel = {
295+ .off = 40,
296+ .offoff = 0,
297+ .offshift = 0,
298+ .offmask = 0,
299+ },
300+ .key = {
301+ .off = 4,
302+ .val = cpu_to_be32(0x00000600),
303+ .mask = cpu_to_be32(0x0000ff00),
304+ },
305+ .jump = cxgb4_tcp_fields,
306+ },
307+ {
308+ /* UDP Jump */
309+ .sel = {
310+ .off = 40,
311+ .offoff = 0,
312+ .offshift = 0,
313+ .offmask = 0,
314+ },
315+ .key = {
316+ .off = 4,
317+ .val = cpu_to_be32(0x00001100),
318+ .mask = cpu_to_be32(0x0000ff00),
319+ },
320+ .jump = cxgb4_udp_fields,
321+ },
322+ { .jump = NULL },
281323 };
282324
283325 struct cxgb4_link {
drivers/net/ethernet/chelsio/cxgb4/l2t.c+25−28
@@ -502,41 +502,20 @@ u64 cxgb4_select_ntuple(struct net_device *dev, · 501 unmodified lines
502502 }
503503 EXPORT_SYMBOL(cxgb4_select_ntuple);
504504
505−/*
506− * Called when address resolution fails for an L2T entry to handle packets
507− * on the arpq head. If a packet specifies a failure handler it is invoked,
508− * otherwise the packet is sent to the device.
509− */
510−static void handle_failed_resolution(struct adapter *adap, struct l2t_entry *e)
511−{
512− struct sk_buff *skb;
513−
514− while ((skb = __skb_dequeue(&e->arpq)) != NULL) {
515− const struct l2t_skb_cb *cb = L2T_SKB_CB(skb);
516−
517− spin_unlock(&e->lock);
518− if (cb->arp_err_handler)
519− cb->arp_err_handler(cb->handle, skb);
520− else
521− t4_ofld_send(adap, skb);
522− spin_lock(&e->lock);
523− }
524−}
525−
526505 /*
527506 * Called when the host's neighbor layer makes a change to some entry that is
528507 * loaded into the HW L2 table.
529508 */
530509 void t4_l2t_update(struct adapter *adap, struct neighbour *neigh)
531510 {
532− struct l2t_entry *e;
533− struct sk_buff_head *arpq = NULL;
534− struct l2t_data *d = adap->l2t;
535511 unsigned int addr_len = neigh->tbl->key_len;
536512 u32 *addr = (u32 *) neigh->primary_key;
537− int ifidx = neigh->dev->ifindex;
538− int hash = addr_hash(d, addr, addr_len, ifidx);
513+ int hash, ifidx = neigh->dev->ifindex;
514+ struct sk_buff_head *arpq = NULL;
515+ struct l2t_data *d = adap->l2t;
516+ struct l2t_entry *e;
539517
518+ hash = addr_hash(d, addr, addr_len, ifidx);
540519 read_lock_bh(&d->lock);
541520 for (e = d->l2tab[hash].first; e; e = e->next)
542521 if (!addreq(e, addr) && e->ifindex == ifidx) {
@@ -569,8 +548,25 @@ void t4_l2t_update(struct adapter *adap, struct neighbour *neigh) · 26 unmodified lines
569548 write_l2e(adap, e, 0);
570549 }
571550
572− if (arpq)
573− handle_failed_resolution(adap, e);
551+ if (arpq) {
552+ struct sk_buff *skb;
553+
554+ /* Called when address resolution fails for an L2T
555+ * entry to handle packets on the arpq head. If a
556+ * packet specifies a failure handler it is invoked,
557+ * otherwise the packet is sent to the device.
558+ */
559+ while ((skb = __skb_dequeue(&e->arpq)) != NULL) {
560+ const struct l2t_skb_cb *cb = L2T_SKB_CB(skb);
561+
562+ spin_unlock(&e->lock);
563+ if (cb->arp_err_handler)
564+ cb->arp_err_handler(cb->handle, skb);
565+ else
566+ t4_ofld_send(adap, skb);
567+ spin_lock(&e->lock);
568+ }
569+ }
574570 spin_unlock_bh(&e->lock);
575571 }
576572
@@ -613,6 +609,7 @@ struct l2t_entry *t4_l2t_alloc_switching(struct adapter *adap, u16 vlan, · 36 unmodified lines
613609 }
614610
615611 /**
612+ * cxgb4_l2t_alloc_switching - Allocates an L2T entry for switch filters
616613 * @dev: net_device pointer
617614 * @vlan: VLAN Id
618615 * @port: Associated port
drivers/net/ethernet/chelsio/cxgb4/sched.c+1−1
@@ -598,7 +598,7 @@ struct sched_class *cxgb4_sched_class_alloc(struct net_device *dev, · 597 unmodified lines
598598 /**
599599 * cxgb4_sched_class_free - free a scheduling class
600600 * @dev: net_device pointer
601− * @e: scheduling class
601+ * @classid: scheduling class id to free
602602 *
603603 * Frees a scheduling class if there are no users.
604604 */
drivers/net/ethernet/chelsio/cxgb4/sge.c+24−23
@@ -302,7 +302,7 @@ static void deferred_unmap_destructor(struct sk_buff *skb) · 301 unmodified lines
302302
303303 /**
304304 * free_tx_desc - reclaims Tx descriptors and their buffers
305− * @adapter: the adapter
305+ * @adap: the adapter
306306 * @q: the Tx queue to reclaim descriptors from
307307 * @n: the number of descriptors to reclaim
308308 * @unmap: whether the buffers should be unmapped for DMA
@@ -722,6 +722,7 @@ static inline unsigned int flits_to_desc(unsigned int n) · 413 unmodified lines
722722 /**
723723 * is_eth_imm - can an Ethernet packet be sent as immediate data?
724724 * @skb: the packet
725+ * @chip_ver: chip version
725726 *
726727 * Returns whether an Ethernet packet is small enough to fit as
727728 * immediate data. Return value corresponds to headroom required.
@@ -749,6 +750,7 @@ static inline int is_eth_imm(const struct sk_buff *skb, unsigned int chip_ver) · 21 unmodified lines
749750 /**
750751 * calc_tx_flits - calculate the number of flits for a packet Tx WR
751752 * @skb: the packet
753+ * @chip_ver: chip version
752754 *
753755 * Returns the number of flits needed for a Tx WR for the given Ethernet
754756 * packet, including the needed WR and CPL headers.
@@ -804,6 +806,7 @@ static inline unsigned int calc_tx_flits(const struct sk_buff *skb, · 49 unmodified lines
804806 /**
805807 * calc_tx_descs - calculate the number of Tx descriptors for a packet
806808 * @skb: the packet
809+ * @chip_ver: chip version
807810 *
808811 * Returns the number of Tx descriptors needed for the given Ethernet
809812 * packet, including the needed WR and CPL headers.
@@ -1425,12 +1428,10 @@ static netdev_tx_t cxgb4_eth_xmit(struct sk_buff *skb, struct net_device *dev) · 615 unmodified lines
14251428
14261429 qidx = skb_get_queue_mapping(skb);
14271430 if (ptp_enabled) {
1428− spin_lock(&adap->ptp_lock);
14291431 if (!(adap->ptp_tx_skb)) {
14301432 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
14311433 adap->ptp_tx_skb = skb_get(skb);
14321434 } else {
1433− spin_unlock(&adap->ptp_lock);
14341435 goto out_free;
14351436 }
14361437 q = &adap->sge.ptptxq;
@@ -1444,11 +1445,8 @@ static netdev_tx_t cxgb4_eth_xmit(struct sk_buff *skb, struct net_device *dev) · 7 unmodified lines
14441445
14451446 #ifdef CONFIG_CHELSIO_T4_FCOE
14461447 ret = cxgb_fcoe_offload(skb, adap, pi, &cntrl);
1447− if (unlikely(ret == -ENOTSUPP)) {
1448− if (ptp_enabled)
1449− spin_unlock(&adap->ptp_lock);
1448+ if (unlikely(ret == -EOPNOTSUPP))
14501449 goto out_free;
1451− }
14521450 #endif /* CONFIG_CHELSIO_T4_FCOE */
14531451
14541452 chip_ver = CHELSIO_CHIP_VERSION(adap->params.chip);
@@ -1461,8 +1459,6 @@ static netdev_tx_t cxgb4_eth_xmit(struct sk_buff *skb, struct net_device *dev) · 6 unmodified lines
14611459 dev_err(adap->pdev_dev,
14621460 "%s: Tx ring %u full while queue awake!\n",
14631461 dev->name, qidx);
1464− if (ptp_enabled)
1465− spin_unlock(&adap->ptp_lock);
14661462 return NETDEV_TX_BUSY;
14671463 }
14681464
@@ -1481,8 +1477,6 @@ static netdev_tx_t cxgb4_eth_xmit(struct sk_buff *skb, struct net_device *dev) · 12 unmodified lines
14811477 unlikely(cxgb4_map_skb(adap->pdev_dev, skb, sgl_sdesc->addr) < 0)) {
14821478 memset(sgl_sdesc->addr, 0, sizeof(sgl_sdesc->addr));
14831479 q->mapping_err++;
1484− if (ptp_enabled)
1485− spin_unlock(&adap->ptp_lock);
14861480 goto out_free;
14871481 }
14881482
@@ -1533,8 +1527,7 @@ static netdev_tx_t cxgb4_eth_xmit(struct sk_buff *skb, struct net_device *dev) · 44 unmodified lines
15331527 if (iph->version == 4) {
15341528 iph->check = 0;
15351529 iph->tot_len = 0;
1536− iph->check = (u16)(~ip_fast_csum((u8 *)iph,
1537− iph->ihl));
1530+ iph->check = ~ip_fast_csum((u8 *)iph, iph->ihl);
15381531 }
15391532 if (skb->ip_summed == CHECKSUM_PARTIAL)
15401533 cntrl = hwcsum(adap->params.chip, skb);
@@ -1630,8 +1623,6 @@ static netdev_tx_t cxgb4_eth_xmit(struct sk_buff *skb, struct net_device *dev) · 89 unmodified lines
16301623 txq_advance(&q->q, ndesc);
16311624
16321625 cxgb4_ring_tx_db(adap, &q->q, ndesc);
1633− if (ptp_enabled)
1634− spin_unlock(&adap->ptp_lock);
16351626 return NETDEV_TX_OK;
16361627
16371628 out_free:
@@ -2377,6 +2368,16 @@ netdev_tx_t t4_start_xmit(struct sk_buff *skb, struct net_device *dev) · 739 unmodified lines
23772368 if (unlikely(qid >= pi->nqsets))
23782369 return cxgb4_ethofld_xmit(skb, dev);
23792370
2371+ if (is_ptp_enabled(skb, dev)) {
2372+ struct adapter *adap = netdev2adap(dev);
2373+ netdev_tx_t ret;
2374+
2375+ spin_lock(&adap->ptp_lock);
2376+ ret = cxgb4_eth_xmit(skb, dev);
2377+ spin_unlock(&adap->ptp_lock);
2378+ return ret;
2379+ }
2380+
23802381 return cxgb4_eth_xmit(skb, dev);
23812382 }
23822383
@@ -2410,9 +2411,9 @@ static void eosw_txq_flush_pending_skbs(struct sge_eosw_txq *eosw_txq) · 27 unmodified lines
24102411
24112412 /**
24122413 * cxgb4_ethofld_send_flowc - Send ETHOFLD flowc request to bind eotid to tc.
2413− * @dev - netdevice
2414− * @eotid - ETHOFLD tid to bind/unbind
2415− * @tc - traffic class. If set to FW_SCHED_CLS_NONE, then unbinds the @eotid
2414+ * @dev: netdevice
2415+ * @eotid: ETHOFLD tid to bind/unbind
2416+ * @tc: traffic class. If set to FW_SCHED_CLS_NONE, then unbinds the @eotid
24162417 *
24172418 * Send a FLOWC work request to bind an ETHOFLD TID to a traffic class.
24182419 * If @tc is set to FW_SCHED_CLS_NONE, then the @eotid is unbound from
@@ -2691,7 +2692,6 @@ static inline unsigned int calc_tx_flits_ofld(const struct sk_buff *skb) · 272 unmodified lines
26912692
26922693 /**
26932694 * txq_stop_maperr - stop a Tx queue due to I/O MMU exhaustion
2694− * @adap: the adapter
26952695 * @q: the queue to stop
26962696 *
26972697 * Mark a Tx queue stopped due to I/O MMU exhaustion and resulting
@@ -3286,7 +3286,7 @@ enum { · 588 unmodified lines
32863286
32873287 /**
32883288 * t4_systim_to_hwstamp - read hardware time stamp
3289− * @adap: the adapter
3289+ * @adapter: the adapter
32903290 * @skb: the packet
32913291 *
32923292 * Read Time Stamp from MPS packet and insert in skb which
@@ -3313,15 +3313,16 @@ static noinline int t4_systim_to_hwstamp(struct adapter *adapter, · 20 unmodified lines
33133313
33143314 hwtstamps = skb_hwtstamps(skb);
33153315 memset(hwtstamps, 0, sizeof(*hwtstamps));
3316− hwtstamps->hwtstamp = ns_to_ktime(be64_to_cpu(*((u64 *)data)));
3316+ hwtstamps->hwtstamp = ns_to_ktime(get_unaligned_be64(data));
33173317
33183318 return RX_PTP_PKT_SUC;
33193319 }
33203320
33213321 /**
33223322 * t4_rx_hststamp - Recv PTP Event Message
3323− * @adap: the adapter
3323+ * @adapter: the adapter
33243324 * @rsp: the response queue descriptor holding the RX_PKT message
3325+ * @rxq: the response queue holding the RX_PKT message
33253326 * @skb: the packet
33263327 *
33273328 * PTP enabled and MPS packet, read HW timestamp
@@ -3345,7 +3346,7 @@ static int t4_rx_hststamp(struct adapter *adapter, const __be64 *rsp, · 17 unmodified lines
33453346
33463347 /**
33473348 * t4_tx_hststamp - Loopback PTP Transmit Event Message
3348− * @adap: the adapter
3349+ * @adapter: the adapter
33493350 * @skb: the packet
33503351 * @dev: the ingress net device
33513352 *
drivers/net/ethernet/chelsio/cxgb4/smt.c+2−0
@@ -103,6 +103,7 @@ static void t4_smte_free(struct smt_entry *e) · 102 unmodified lines
103103 }
104104
105105 /**
106+ * cxgb4_smt_release - Release SMT entry
106107 * @e: smt entry to release
107108 *
108109 * Releases ref count and frees up an smt entry from SMT table
@@ -231,6 +232,7 @@ static struct smt_entry *t4_smt_alloc_switching(struct adapter *adap, u16 pfvf, · 122 unmodified lines
231232 }
232233
233234 /**
235+ * cxgb4_smt_alloc_switching - Allocates an SMT entry for switch filters.
234236 * @dev: net_device pointer
235237 * @smac: MAC address to add to SMT
236238 * Returns pointer to the SMT entry created
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+22−22
@@ -3163,7 +3163,7 @@ int t4_get_tp_version(struct adapter *adapter, u32 *vers) · 3162 unmodified lines
31633163
31643164 /**
31653165 * t4_get_exprom_version - return the Expansion ROM version (if any)
3166− * @adapter: the adapter
3166+ * @adap: the adapter
31673167 * @vers: where to place the version
31683168 *
31693169 * Reads the Expansion ROM header from FLASH and returns the version
@@ -3493,7 +3493,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, · 323 unmodified lines
34933493 drv_fw = &fw_info->fw_hdr;
34943494
34953495 /* Read the header of the firmware on the card */
3496− ret = -t4_read_flash(adap, FLASH_FW_START,
3496+ ret = t4_read_flash(adap, FLASH_FW_START,
34973497 sizeof(*card_fw) / sizeof(uint32_t),
34983498 (uint32_t *)card_fw, 1);
34993499 if (ret == 0) {
@@ -3522,8 +3522,8 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, · 22 unmodified lines
35223522 should_install_fs_fw(adap, card_fw_usable,
35233523 be32_to_cpu(fs_fw->fw_ver),
35243524 be32_to_cpu(card_fw->fw_ver))) {
3525− ret = -t4_fw_upgrade(adap, adap->mbox, fw_data,
3526− fw_size, 0);
3525+ ret = t4_fw_upgrade(adap, adap->mbox, fw_data,
3526+ fw_size, 0);
35273527 if (ret != 0) {
35283528 dev_err(adap->pdev_dev,
35293529 "failed to install firmware: %d\n", ret);
@@ -3554,7 +3554,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, · 24 unmodified lines
35543554 FW_HDR_FW_VER_MICRO_G(c), FW_HDR_FW_VER_BUILD_G(c),
35553555 FW_HDR_FW_VER_MAJOR_G(k), FW_HDR_FW_VER_MINOR_G(k),
35563556 FW_HDR_FW_VER_MICRO_G(k), FW_HDR_FW_VER_BUILD_G(k));
3557− ret = EINVAL;
3557+ ret = -EINVAL;
35583558 goto bye;
35593559 }
35603560
@@ -5310,7 +5310,7 @@ static unsigned int t4_use_ldst(struct adapter *adap) · 1749 unmodified lines
53105310 * @cmd: TP fw ldst address space type
53115311 * @vals: where the indirect register values are stored/written
53125312 * @nregs: how many indirect registers to read/write
5313− * @start_idx: index of first indirect register to read/write
5313+ * @start_index: index of first indirect register to read/write
53145314 * @rw: Read (1) or Write (0)
53155315 * @sleep_ok: if true we may sleep while awaiting command completion
53165316 *
@@ -6115,7 +6115,7 @@ void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) · 798 unmodified lines
61156115
61166116 /**
61176117 * compute_mps_bg_map - compute the MPS Buffer Group Map for a Port
6118− * @adap: the adapter
6118+ * @adapter: the adapter
61196119 * @pidx: the port index
61206120 *
61216121 * Computes and returns a bitmap indicating which MPS buffer groups are
@@ -6252,7 +6252,7 @@ static unsigned int t4_get_tp_e2c_map(struct adapter *adapter, int pidx) · 130 unmodified lines
62526252
62536253 /**
62546254 * t4_get_tp_ch_map - return TP ingress channels associated with a port
6255− * @adapter: the adapter
6255+ * @adap: the adapter
62566256 * @pidx: the port index
62576257 *
62586258 * Returns a bitmap indicating which TP Ingress Channels are associated
@@ -6589,7 +6589,7 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, · 330 unmodified lines
65896589 * @phy_addr: the PHY address
65906590 * @mmd: the PHY MMD to access (0 for clause 22 PHYs)
65916591 * @reg: the register to write
6592− * @valp: value to write
6592+ * @val: value to write
65936593 *
65946594 * Issues a FW command through the given mailbox to write a PHY register.
65956595 */
@@ -6615,7 +6615,7 @@ int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, · 19 unmodified lines
66156615
66166616 /**
66176617 * t4_sge_decode_idma_state - decode the idma state
6618− * @adap: the adapter
6618+ * @adapter: the adapter
66196619 * @state: the state idma is stuck in
66206620 */
66216621 void t4_sge_decode_idma_state(struct adapter *adapter, int state)
@@ -6782,7 +6782,7 @@ void t4_sge_decode_idma_state(struct adapter *adapter, int state) · 160 unmodified lines
67826782 * t4_sge_ctxt_flush - flush the SGE context cache
67836783 * @adap: the adapter
67846784 * @mbox: mailbox to use for the FW command
6785− * @ctx_type: Egress or Ingress
6785+ * @ctxt_type: Egress or Ingress
67866786 *
67876787 * Issues a FW command through the given mailbox to flush the
67886788 * SGE context cache.
@@ -6809,7 +6809,7 @@ int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type) · 20 unmodified lines
68096809
68106810 /**
68116811 * t4_read_sge_dbqtimers - read SGE Doorbell Queue Timer values
6812− * @adap - the adapter
6812+ * @adap: the adapter
68136813 * @ndbqtimers: size of the provided SGE Doorbell Queue Timer table
68146814 * @dbqtimers: SGE Doorbell Queue Timer table
68156815 *
@@ -7092,6 +7092,7 @@ static int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force) · 276 unmodified lines
70927092 /**
70937093 * t4_fw_restart - restart the firmware by taking the uP out of RESET
70947094 * @adap: the adapter
7095+ * @mbox: mailbox to use for the FW command
70957096 * @reset: if we want to do a RESET to restart things
70967097 *
70977098 * Restart firmware previously halted by t4_fw_halt(). On successful
@@ -7630,6 +7631,8 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf, · 532 unmodified lines
76307631 * @nmac: number of MAC addresses needed (1 to 5)
76317632 * @mac: the MAC addresses of the VI
76327633 * @rss_size: size of RSS table slice associated with this VI
7634+ * @vivld: the destination to store the VI Valid value.
7635+ * @vin: the destination to store the VIN value.
76337636 *
76347637 * Allocates a virtual interface for the given physical port. If @mac is
76357638 * not %NULL it contains the MAC addresses of the VI as assigned by FW.
@@ -7848,7 +7851,7 @@ int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid, · 212 unmodified lines
78487851 * t4_alloc_encap_mac_filt - Adds a mac entry in mps tcam with VNI support
78497852 * @adap: the adapter
78507853 * @viid: the VI id
7851− * @mac: the MAC address
7854+ * @addr: the MAC address
78527855 * @mask: the mask
78537856 * @vni: the VNI id for the tunnel protocol
78547857 * @vni_mask: mask for the VNI id
@@ -7897,11 +7900,11 @@ int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid, · 42 unmodified lines
78977900 * t4_alloc_raw_mac_filt - Adds a mac entry in mps tcam
78987901 * @adap: the adapter
78997902 * @viid: the VI id
7900− * @mac: the MAC address
7903+ * @addr: the MAC address
79017904 * @mask: the mask
79027905 * @idx: index at which to add this entry
7903− * @port_id: the port index
79047906 * @lookup_type: MAC address for inner (1) or outer (0) header
7907+ * @port_id: the port index
79057908 * @sleep_ok: call is allowed to sleep
79067909 *
79077910 * Adds the mac entry at the specified index using raw mac interface.
@@ -8126,7 +8129,7 @@ int t4_free_mac_filt(struct adapter *adap, unsigned int mbox, · 218 unmodified lines
81268129 * @idx: index of existing filter for old value of MAC address, or -1
81278130 * @addr: the new MAC address value
81288131 * @persist: whether a new MAC allocation should be persistent
8129− * @add_smt: if true also add the address to the HW SMT
8132+ * @smt_idx: the destination to store the new SMT index.
81308133 *
81318134 * Modifies an exact-match filter and sets it to the new MAC address.
81328135 * Note that in general it is not possible to modify the value of a given
@@ -8448,7 +8451,6 @@ int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, · 315 unmodified lines
84488451
84498452 /**
84508453 * t4_link_down_rc_str - return a string for a Link Down Reason Code
8451− * @adap: the adapter
84528454 * @link_down_rc: Link Down Reason Code
84538455 *
84548456 * Returns a string representation of the Link Down Reason Code.
@@ -8472,9 +8474,7 @@ static const char *t4_link_down_rc_str(unsigned char link_down_rc) · 17 unmodified lines
84728474 return reason[link_down_rc];
84738475 }
84748476
8475−/**
8476− * Return the highest speed set in the port capabilities, in Mb/s.
8477− */
8477+/* Return the highest speed set in the port capabilities, in Mb/s. */
84788478 static unsigned int fwcap_to_speed(fw_port_cap32_t caps)
84798479 {
84808480 #define TEST_SPEED_RETURN(__caps_speed, __speed) \
@@ -9110,7 +9110,6 @@ found: · 629 unmodified lines
91109110 /**
91119111 * t4_prep_adapter - prepare SW and HW for operation
91129112 * @adapter: the adapter
9113− * @reset: if true perform a HW reset
91149113 *
91159114 * Initialize adapter SW state for the various HW modules, set initial
91169115 * values for some adapter tunables, take PHYs out of reset, and
@@ -10395,6 +10394,7 @@ int t4_sched_params(struct adapter *adapter, u8 type, u8 level, u8 mode, · 1278 unmodified lines
1039510394 /**
1039610395 * t4_i2c_rd - read I2C data from adapter
1039710396 * @adap: the adapter
10397+ * @mbox: mailbox to use for the FW command
1039810398 * @port: Port number if per-port device; <0 if not
1039910399 * @devid: per-port device ID or absolute device ID
1040010400 * @offset: byte offset into device I2C space
@@ -10450,7 +10450,7 @@ int t4_i2c_rd(struct adapter *adap, unsigned int mbox, int port, · 49 unmodified lines
1045010450
1045110451 /**
1045210452 * t4_set_vlan_acl - Set a VLAN id for the specified VF
10453− * @adapter: the adapter
10453+ * @adap: the adapter
1045410454 * @mbox: mailbox to use for the FW command
1045510455 * @vf: one of the VFs instantiated by the specified PF
1045610456 * @vlan: The vlanid to be set
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c+1−2
@@ -260,8 +260,7 @@ static int cxgb4vf_set_addr_hash(struct port_info *pi) · 259 unmodified lines
260260 * @tcam_idx: TCAM index of existing filter for old value of MAC address,
261261 * or -1
262262 * @addr: the new MAC address value
263− * @persist: whether a new MAC allocation should be persistent
264− * @add_smt: if true also add the address to the HW SMT
263+ * @persistent: whether a new MAC allocation should be persistent
265264 *
266265 * Modifies an MPS filter and sets it to the new MAC address if
267266 * @tcam_idx >= 0, or adds the MAC address to a new filter if
drivers/net/ethernet/chelsio/cxgb4vf/sge.c+4−3
@@ -1692,7 +1692,7 @@ static inline bool is_new_response(const struct rsp_ctrl *rc, · 1691 unmodified lines
16921692 * restore_rx_bufs - put back a packet's RX buffers
16931693 * @gl: the packet gather list
16941694 * @fl: the SGE Free List
1695− * @nfrags: how many fragments in @si
1695+ * @frags: how many fragments in @si
16961696 *
16971697 * Called when we find out that the current packet, @si, can't be
16981698 * processed right away for some reason. This is a very rare event and
@@ -2054,7 +2054,7 @@ irq_handler_t t4vf_intr_handler(struct adapter *adapter) · 355 unmodified lines
20542054
20552055 /**
20562056 * sge_rx_timer_cb - perform periodic maintenance of SGE RX queues
2057− * @data: the adapter
2057+ * @t: Rx timer
20582058 *
20592059 * Runs periodically from a timer to perform maintenance of SGE RX queues.
20602060 *
@@ -2113,7 +2113,7 @@ static void sge_rx_timer_cb(struct timer_list *t) · 52 unmodified lines
21132113
21142114 /**
21152115 * sge_tx_timer_cb - perform periodic maintenance of SGE Tx queues
2116− * @data: the adapter
2116+ * @t: Tx timer
21172117 *
21182118 * Runs periodically from a timer to perform maintenance of SGE TX queues.
21192119 *
@@ -2405,6 +2405,7 @@ err: · 285 unmodified lines
24052405 * t4vf_sge_alloc_eth_txq - allocate an SGE Ethernet TX Queue
24062406 * @adapter: the adapter
24072407 * @txq: pointer to the new txq to be filled in
2408+ * @dev: the network device
24082409 * @devq: the network TX queue associated with the new txq
24092410 * @iqid: the relative ingress queue ID to which events relating to
24102411 * the new txq should be directed
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c+3−6
@@ -389,9 +389,7 @@ static inline enum cc_fec fwcap_to_cc_fec(fw_port_cap32_t fw_fec) · 388 unmodified lines
389389 return cc_fec;
390390 }
391391
392−/**
393− * Return the highest speed set in the port capabilities, in Mb/s.
394− */
392+/* Return the highest speed set in the port capabilities, in Mb/s. */
395393 static unsigned int fwcap_to_speed(fw_port_cap32_t caps)
396394 {
397395 #define TEST_SPEED_RETURN(__caps_speed, __speed) \
@@ -1467,6 +1465,7 @@ int t4vf_identify_port(struct adapter *adapter, unsigned int viid, · 1069 unmodified lines
14671465 * @bcast: 1 to enable broadcast Rx, 0 to disable it, -1 no change
14681466 * @vlanex: 1 to enable hardware VLAN Tag extraction, 0 to disable it,
14691467 * -1 no change
1468+ * @sleep_ok: call is allowed to sleep
14701469 *
14711470 * Sets Rx properties of a virtual interface.
14721471 */
@@ -1906,7 +1905,7 @@ static const char *t4vf_link_down_rc_str(unsigned char link_down_rc) · 433 unmodified lines
19061905 /**
19071906 * t4vf_handle_get_port_info - process a FW reply message
19081907 * @pi: the port info
1909− * @rpl: start of the FW message
1908+ * @cmd: start of the FW message
19101909 *
19111910 * Processes a GET_PORT_INFO FW reply message.
19121911 */
@@ -2137,8 +2136,6 @@ int t4vf_handle_fw_rpl(struct adapter *adapter, const __be64 *rpl) · 224 unmodified lines
21372136 return 0;
21382137 }
21392138
2140−/**
2141− */
21422139 int t4vf_prep_adapter(struct adapter *adapter)
21432140 {
21442141 int err;
drivers/net/ethernet/freescale/enetc/enetc.c+28−2
@@ -266,7 +266,7 @@ static irqreturn_t enetc_msix(int irq, void *data) · 265 unmodified lines
266266 /* disable interrupts */
267267 enetc_wr_reg(v->rbier, 0);
268268
269− for_each_set_bit(i, &v->tx_rings_map, v->count_tx_rings)
269+ for_each_set_bit(i, &v->tx_rings_map, ENETC_MAX_NUM_TXQS)
270270 enetc_wr_reg(v->tbier_base + ENETC_BDR_OFF(i), 0);
271271
272272 napi_schedule_irqoff(&v->napi);
@@ -302,7 +302,7 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 29 unmodified lines
302302 /* enable interrupts */
303303 enetc_wr_reg(v->rbier, ENETC_RBIER_RXTIE);
304304
305− for_each_set_bit(i, &v->tx_rings_map, v->count_tx_rings)
305+ for_each_set_bit(i, &v->tx_rings_map, ENETC_MAX_NUM_TXQS)
306306 enetc_wr_reg(v->tbier_base + ENETC_BDR_OFF(i),
307307 ENETC_TBIER_TXTIE);
308308
@@ -1595,6 +1595,24 @@ static int enetc_set_psfp(struct net_device *ndev, int en) · 1286 unmodified lines
15951595 return 0;
15961596 }
15971597
1598+static void enetc_enable_rxvlan(struct net_device *ndev, bool en)
1599+{
1600+ struct enetc_ndev_priv *priv = netdev_priv(ndev);
1601+ int i;
1602+
1603+ for (i = 0; i < priv->num_rx_rings; i++)
1604+ enetc_bdr_enable_rxvlan(&priv->si->hw, i, en);
1605+}
1606+
1607+static void enetc_enable_txvlan(struct net_device *ndev, bool en)
1608+{
1609+ struct enetc_ndev_priv *priv = netdev_priv(ndev);
1610+ int i;
1611+
1612+ for (i = 0; i < priv->num_tx_rings; i++)
1613+ enetc_bdr_enable_txvlan(&priv->si->hw, i, en);
1614+}
1615+
15981616 int enetc_set_features(struct net_device *ndev,
15991617 netdev_features_t features)
16001618 {
@@ -1604,6 +1622,14 @@ int enetc_set_features(struct net_device *ndev, · 3 unmodified lines
16041622 if (changed & NETIF_F_RXHASH)
16051623 enetc_set_rss(ndev, !!(features & NETIF_F_RXHASH));
16061624
1625+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
1626+ enetc_enable_rxvlan(ndev,
1627+ !!(features & NETIF_F_HW_VLAN_CTAG_RX));
1628+
1629+ if (changed & NETIF_F_HW_VLAN_CTAG_TX)
1630+ enetc_enable_txvlan(ndev,
1631+ !!(features & NETIF_F_HW_VLAN_CTAG_TX));
1632+
16071633 if (changed & NETIF_F_HW_TC)
16081634 err = enetc_set_psfp(ndev, !!(features & NETIF_F_HW_TC));
16091635
drivers/net/ethernet/freescale/enetc/enetc_hw.h+8−8
@@ -531,22 +531,22 @@ struct enetc_msg_cmd_header { · 530 unmodified lines
531531
532532 /* Common H/W utility functions */
533533
534−static inline void enetc_enable_rxvlan(struct enetc_hw *hw, int si_idx,
535− bool en)
534+static inline void enetc_bdr_enable_rxvlan(struct enetc_hw *hw, int idx,
535+ bool en)
536536 {
537− u32 val = enetc_rxbdr_rd(hw, si_idx, ENETC_RBMR);
537+ u32 val = enetc_rxbdr_rd(hw, idx, ENETC_RBMR);
538538
539539 val = (val & ~ENETC_RBMR_VTE) | (en ? ENETC_RBMR_VTE : 0);
540− enetc_rxbdr_wr(hw, si_idx, ENETC_RBMR, val);
540+ enetc_rxbdr_wr(hw, idx, ENETC_RBMR, val);
541541 }
542542
543−static inline void enetc_enable_txvlan(struct enetc_hw *hw, int si_idx,
544− bool en)
543+static inline void enetc_bdr_enable_txvlan(struct enetc_hw *hw, int idx,
544+ bool en)
545545 {
546− u32 val = enetc_txbdr_rd(hw, si_idx, ENETC_TBMR);
546+ u32 val = enetc_txbdr_rd(hw, idx, ENETC_TBMR);
547547
548548 val = (val & ~ENETC_TBMR_VIH) | (en ? ENETC_TBMR_VIH : 0);
549− enetc_txbdr_wr(hw, si_idx, ENETC_TBMR, val);
549+ enetc_txbdr_wr(hw, idx, ENETC_TBMR, val);
550550 }
551551
552552 static inline void enetc_set_bdr_prio(struct enetc_hw *hw, int bdr_idx,
drivers/net/ethernet/freescale/enetc/enetc_pf.c+0−8
@@ -649,14 +649,6 @@ static int enetc_pf_set_features(struct net_device *ndev, · 648 unmodified lines
649649 netdev_features_t changed = ndev->features ^ features;
650650 struct enetc_ndev_priv *priv = netdev_priv(ndev);
651651
652− if (changed & NETIF_F_HW_VLAN_CTAG_RX)
653− enetc_enable_rxvlan(&priv->si->hw, 0,
654− !!(features & NETIF_F_HW_VLAN_CTAG_RX));
655−
656− if (changed & NETIF_F_HW_VLAN_CTAG_TX)
657− enetc_enable_txvlan(&priv->si->hw, 0,
658− !!(features & NETIF_F_HW_VLAN_CTAG_TX));
659−
660652 if (changed & NETIF_F_HW_VLAN_CTAG_FILTER) {
661653 struct enetc_pf *pf = enetc_si_priv(priv->si);
662654
drivers/net/ethernet/freescale/fec.h+0−5
@@ -525,11 +525,6 @@ struct fec_enet_private { · 524 unmodified lines
525525 unsigned int total_tx_ring_size;
526526 unsigned int total_rx_ring_size;
527527
528− unsigned long work_tx;
529− unsigned long work_rx;
530− unsigned long work_ts;
531− unsigned long work_mdio;
532−
533528 struct platform_device *pdev;
534529
535530 int dev_id;
drivers/net/ethernet/freescale/fec_main.c+31−63
@@ -75,8 +75,6 @@ static void fec_enet_itr_coal_init(struct net_device *ndev); · 74 unmodified lines
7575
7676 #define DRIVER_NAME "fec"
7777
78−#define FEC_ENET_GET_QUQUE(_x) ((_x == 0) ? 1 : ((_x == 1) ? 2 : 0))
79−
8078 /* Pause frame feild and FIFO threshold */
8179 #define FEC_ENET_FCE (1 << 5)
8280 #define FEC_ENET_RSEM_V 0x84
@@ -1248,8 +1246,6 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) · 1165 unmodified lines
12481246
12491247 fep = netdev_priv(ndev);
12501248
1251− queue_id = FEC_ENET_GET_QUQUE(queue_id);
1252−
12531249 txq = fep->tx_queue[queue_id];
12541250 /* get next bdp of dirty_tx */
12551251 nq = netdev_get_tx_queue(ndev, queue_id);
@@ -1340,17 +1336,14 @@ skb_done: · 84 unmodified lines
13401336 writel(0, txq->bd.reg_desc_active);
13411337 }
13421338
1343−static void
1344−fec_enet_tx(struct net_device *ndev)
1339+static void fec_enet_tx(struct net_device *ndev)
13451340 {
13461341 struct fec_enet_private *fep = netdev_priv(ndev);
1347− u16 queue_id;
1348− /* First process class A queue, then Class B and Best Effort queue */
1349− for_each_set_bit(queue_id, &fep->work_tx, FEC_ENET_MAX_TX_QS) {
1350− clear_bit(queue_id, &fep->work_tx);
1351− fec_enet_tx_queue(ndev, queue_id);
1352− }
1353− return;
1342+ int i;
1343+
1344+ /* Make sure that AVB queues are processed first. */
1345+ for (i = fep->num_tx_queues - 1; i >= 0; i--)
1346+ fec_enet_tx_queue(ndev, i);
13541347 }
13551348
13561349 static int
@@ -1426,7 +1419,6 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) · 69 unmodified lines
14261419 #ifdef CONFIG_M532x
14271420 flush_cache_all();
14281421 #endif
1429− queue_id = FEC_ENET_GET_QUQUE(queue_id);
14301422 rxq = fep->rx_queue[queue_id];
14311423
14321424 /* First, grab all of the stats for the incoming packet.
@@ -1550,6 +1542,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) · 117 unmodified lines
15501542 htons(ETH_P_8021Q),
15511543 vlan_tag);
15521544
1545+ skb_record_rx_queue(skb, queue_id);
15531546 napi_gro_receive(&fep->napi, skb);
15541547
15551548 if (is_copybreak) {
@@ -1595,48 +1588,30 @@ rx_processing_done: · 39 unmodified lines
15951588 return pkt_received;
15961589 }
15971590
1598−static int
1599−fec_enet_rx(struct net_device *ndev, int budget)
1591+static int fec_enet_rx(struct net_device *ndev, int budget)
16001592 {
1601− int pkt_received = 0;
1602− u16 queue_id;
16031593 struct fec_enet_private *fep = netdev_priv(ndev);
1594+ int i, done = 0;
16041595
1605− for_each_set_bit(queue_id, &fep->work_rx, FEC_ENET_MAX_RX_QS) {
1606− int ret;
1607−
1608− ret = fec_enet_rx_queue(ndev,
1609− budget - pkt_received, queue_id);
1596+ /* Make sure that AVB queues are processed first. */
1597+ for (i = fep->num_rx_queues - 1; i >= 0; i--)
1598+ done += fec_enet_rx_queue(ndev, budget - done, i);
16101599
1611− if (ret < budget - pkt_received)
1612− clear_bit(queue_id, &fep->work_rx);
1613−
1614− pkt_received += ret;
1615− }
1616− return pkt_received;
1600+ return done;
16171601 }
16181602
1619−static bool
1620−fec_enet_collect_events(struct fec_enet_private *fep, uint int_events)
1603+static bool fec_enet_collect_events(struct fec_enet_private *fep)
16211604 {
1622− if (int_events == 0)
1623− return false;
1605+ uint int_events;
1606+
1607+ int_events = readl(fep->hwp + FEC_IEVENT);
16241608
1625− if (int_events & FEC_ENET_RXF_0)
1626− fep->work_rx |= (1 << 2);
1627− if (int_events & FEC_ENET_RXF_1)
1628− fep->work_rx |= (1 << 0);
1629− if (int_events & FEC_ENET_RXF_2)
1630− fep->work_rx |= (1 << 1);
1609+ /* Don't clear MDIO events, we poll for those */
1610+ int_events &= ~FEC_ENET_MII;
16311611
1632− if (int_events & FEC_ENET_TXF_0)
1633− fep->work_tx |= (1 << 2);
1634− if (int_events & FEC_ENET_TXF_1)
1635− fep->work_tx |= (1 << 0);
1636− if (int_events & FEC_ENET_TXF_2)
1637− fep->work_tx |= (1 << 1);
1612+ writel(int_events, fep->hwp + FEC_IEVENT);
16381613
1639− return true;
1614+ return int_events != 0;
16401615 }
16411616
16421617 static irqreturn_t
@@ -1644,18 +1619,9 @@ fec_enet_interrupt(int irq, void *dev_id) · 1 unmodified line
16441619 {
16451620 struct net_device *ndev = dev_id;
16461621 struct fec_enet_private *fep = netdev_priv(ndev);
1647− uint int_events;
16481622 irqreturn_t ret = IRQ_NONE;
16491623
1650− int_events = readl(fep->hwp + FEC_IEVENT);
1651−
1652− /* Don't clear MDIO events, we poll for those */
1653− int_events &= ~FEC_ENET_MII;
1654−
1655− writel(int_events, fep->hwp + FEC_IEVENT);
1656− fec_enet_collect_events(fep, int_events);
1657−
1658− if ((fep->work_tx || fep->work_rx) && fep->link) {
1624+ if (fec_enet_collect_events(fep) && fep->link) {
16591625 ret = IRQ_HANDLED;
16601626
16611627 if (napi_schedule_prep(&fep->napi)) {
@@ -1672,17 +1638,19 @@ static int fec_enet_rx_napi(struct napi_struct *napi, int budget) · 10 unmodified lines
16721638 {
16731639 struct net_device *ndev = napi->dev;
16741640 struct fec_enet_private *fep = netdev_priv(ndev);
1675− int pkts;
1641+ int done = 0;
16761642
1677− pkts = fec_enet_rx(ndev, budget);
1678−
1679− fec_enet_tx(ndev);
1643+ do {
1644+ done += fec_enet_rx(ndev, budget - done);
1645+ fec_enet_tx(ndev);
1646+ } while ((done < budget) && fec_enet_collect_events(fep));
16801647
1681− if (pkts < budget) {
1682− napi_complete_done(napi, pkts);
1648+ if (done < budget) {
1649+ napi_complete_done(napi, done);
16831650 writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
16841651 }
1685− return pkts;
1652+
1653+ return done;
16861654 }
16871655
16881656 /* ------------------------------------------------------------------------- */
drivers/net/ethernet/hisilicon/hns/hns_enet.c+1−1
@@ -699,7 +699,7 @@ static void hns_nic_rx_up_pro(struct hns_nic_ring_data *ring_data, · 698 unmodified lines
699699 struct net_device *ndev = ring_data->napi.dev;
700700
701701 skb->protocol = eth_type_trans(skb, ndev);
702− (void)napi_gro_receive(&ring_data->napi, skb);
702+ napi_gro_receive(&ring_data->napi, skb);
703703 }
704704
705705 static int hns_desc_unused(struct hnae_ring *ring)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+1−2
@@ -4127,9 +4127,8 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset) · 4126 unmodified lines
41274127
41284128 hns3_put_ring_config(priv);
41294129
4130− hns3_dbg_uninit(handle);
4131−
41324130 out_netdev_free:
4131+ hns3_dbg_uninit(handle);
41334132 free_netdev(netdev);
41344133 }
41354134
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c+6−3
@@ -180,18 +180,21 @@ static void hns3_lb_check_skb_data(struct hns3_enet_ring *ring, · 179 unmodified lines
180180 {
181181 struct hns3_enet_tqp_vector *tqp_vector = ring->tqp_vector;
182182 unsigned char *packet = skb->data;
183+ u32 len = skb_headlen(skb);
183184 u32 i;
184185
185− for (i = 0; i < skb->len; i++)
186+ len = min_t(u32, len, HNS3_NIC_LB_TEST_PACKET_SIZE);
187+
188+ for (i = 0; i < len; i++)
186189 if (packet[i] != (unsigned char)(i & 0xff))
187190 break;
188191
189192 /* The packet is correctly received */
190− if (i == skb->len)
193+ if (i == HNS3_NIC_LB_TEST_PACKET_SIZE)
191194 tqp_vector->rx_group.total_packets++;
192195 else
193196 print_hex_dump(KERN_ERR, "selftest:", DUMP_PREFIX_OFFSET, 16, 1,
194− skb->data, skb->len, true);
197+ skb->data, len, true);
195198
196199 dev_kfree_skb_any(skb);
197200 }
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+1−1
@@ -9859,7 +9859,7 @@ retry: · 9858 unmodified lines
98599859 set_bit(HCLGE_STATE_RST_HANDLING, &hdev->state);
98609860 hdev->reset_type = HNAE3_FLR_RESET;
98619861 ret = hclge_reset_prepare(hdev);
9862− if (ret) {
9862+ if (ret || hdev->reset_pending) {
98639863 dev_err(&hdev->pdev->dev, "fail to prepare FLR, ret=%d\n",
98649864 ret);
98659865 if (hdev->reset_pending ||
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+5−0
@@ -1793,6 +1793,11 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev) · 1792 unmodified lines
17931793 if (hdev->reset_type == HNAE3_VF_FUNC_RESET) {
17941794 hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0);
17951795 ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0);
1796+ if (ret) {
1797+ dev_err(&hdev->pdev->dev,
1798+ "failed to assert VF reset, ret = %d\n", ret);
1799+ return ret;
1800+ }
17961801 hdev->rst_stats.vf_func_rst_cnt++;
17971802 }
17981803
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c+2−0
@@ -814,6 +814,8 @@ err_aeqs_init: · 813 unmodified lines
814814 err_init_msix:
815815 err_pfhwdev_alloc:
816816 hinic_free_hwif(hwif);
817+ if (err > 0)
818+ err = -EIO;
817819 return ERR_PTR(err);
818820 }
819821
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c+72−19
@@ -370,48 +370,89 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt, · 369 unmodified lines
370370 MSG_NOT_RESP, timeout);
371371 }
372372
373−/**
374− * mgmt_recv_msg_handler - handler for message from mgmt cpu
375− * @pf_to_mgmt: PF to MGMT channel
376− * @recv_msg: received message details
377− **/
378−static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt,
379− struct hinic_recv_msg *recv_msg)
373+static void recv_mgmt_msg_work_handler(struct work_struct *work)
380374 {
381− struct hinic_hwif *hwif = pf_to_mgmt->hwif;
382− struct pci_dev *pdev = hwif->pdev;
383− u8 *buf_out = recv_msg->buf_out;
375+ struct hinic_mgmt_msg_handle_work *mgmt_work =
376+ container_of(work, struct hinic_mgmt_msg_handle_work, work);
377+ struct hinic_pf_to_mgmt *pf_to_mgmt = mgmt_work->pf_to_mgmt;
378+ struct pci_dev *pdev = pf_to_mgmt->hwif->pdev;
379+ u8 *buf_out = pf_to_mgmt->mgmt_ack_buf;
384380 struct hinic_mgmt_cb *mgmt_cb;
385381 unsigned long cb_state;
386382 u16 out_size = 0;
387383
388− if (recv_msg->mod >= HINIC_MOD_MAX) {
384+ memset(buf_out, 0, MAX_PF_MGMT_BUF_SIZE);
385+
386+ if (mgmt_work->mod >= HINIC_MOD_MAX) {
389387 dev_err(&pdev->dev, "Unknown MGMT MSG module = %d\n",
390− recv_msg->mod);
388+ mgmt_work->mod);
389+ kfree(mgmt_work->msg);
390+ kfree(mgmt_work);
391391 return;
392392 }
393393
394− mgmt_cb = &pf_to_mgmt->mgmt_cb[recv_msg->mod];
394+ mgmt_cb = &pf_to_mgmt->mgmt_cb[mgmt_work->mod];
395395
396396 cb_state = cmpxchg(&mgmt_cb->state,
397397 HINIC_MGMT_CB_ENABLED,
398398 HINIC_MGMT_CB_ENABLED | HINIC_MGMT_CB_RUNNING);
399399
400400 if ((cb_state == HINIC_MGMT_CB_ENABLED) && (mgmt_cb->cb))
401− mgmt_cb->cb(mgmt_cb->handle, recv_msg->cmd,
402− recv_msg->msg, recv_msg->msg_len,
401+ mgmt_cb->cb(mgmt_cb->handle, mgmt_work->cmd,
402+ mgmt_work->msg, mgmt_work->msg_len,
403403 buf_out, &out_size);
404404 else
405405 dev_err(&pdev->dev, "No MGMT msg handler, mod: %d, cmd: %d\n",
406− recv_msg->mod, recv_msg->cmd);
406+ mgmt_work->mod, mgmt_work->cmd);
407407
408408 mgmt_cb->state &= ~HINIC_MGMT_CB_RUNNING;
409409
410− if (!recv_msg->async_mgmt_to_pf)
410+ if (!mgmt_work->async_mgmt_to_pf)
411411 /* MGMT sent sync msg, send the response */
412− msg_to_mgmt_async(pf_to_mgmt, recv_msg->mod, recv_msg->cmd,
412+ msg_to_mgmt_async(pf_to_mgmt, mgmt_work->mod, mgmt_work->cmd,
413413 buf_out, out_size, MGMT_RESP,
414− recv_msg->msg_id);
414+ mgmt_work->msg_id);
415+
416+ kfree(mgmt_work->msg);
417+ kfree(mgmt_work);
418+}
419+
420+/**
421+ * mgmt_recv_msg_handler - handler for message from mgmt cpu
422+ * @pf_to_mgmt: PF to MGMT channel
423+ * @recv_msg: received message details
424+ **/
425+static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt,
426+ struct hinic_recv_msg *recv_msg)
427+{
428+ struct hinic_mgmt_msg_handle_work *mgmt_work = NULL;
429+ struct pci_dev *pdev = pf_to_mgmt->hwif->pdev;
430+
431+ mgmt_work = kzalloc(sizeof(*mgmt_work), GFP_KERNEL);
432+ if (!mgmt_work) {
433+ dev_err(&pdev->dev, "Allocate mgmt work memory failed\n");
434+ return;
435+ }
436+
437+ if (recv_msg->msg_len) {
438+ mgmt_work->msg = kzalloc(recv_msg->msg_len, GFP_KERNEL);
439+ if (!mgmt_work->msg) {
440+ dev_err(&pdev->dev, "Allocate mgmt msg memory failed\n");
441+ kfree(mgmt_work);
442+ return;
443+ }
444+ }
445+
446+ mgmt_work->pf_to_mgmt = pf_to_mgmt;
447+ mgmt_work->msg_len = recv_msg->msg_len;
448+ memcpy(mgmt_work->msg, recv_msg->msg, recv_msg->msg_len);
449+ mgmt_work->msg_id = recv_msg->msg_id;
450+ mgmt_work->mod = recv_msg->mod;
451+ mgmt_work->cmd = recv_msg->cmd;
452+ mgmt_work->async_mgmt_to_pf = recv_msg->async_mgmt_to_pf;
453+
454+ INIT_WORK(&mgmt_work->work, recv_mgmt_msg_work_handler);
455+ queue_work(pf_to_mgmt->workq, &mgmt_work->work);
415456 }
416457
417458 /**
@@ -546,6 +587,12 @@ static int alloc_msg_buf(struct hinic_pf_to_mgmt *pf_to_mgmt) · 128 unmodified lines
546587 if (!pf_to_mgmt->sync_msg_buf)
547588 return -ENOMEM;
548589
590+ pf_to_mgmt->mgmt_ack_buf = devm_kzalloc(&pdev->dev,
591+ MAX_PF_MGMT_BUF_SIZE,
592+ GFP_KERNEL);
593+ if (!pf_to_mgmt->mgmt_ack_buf)
594+ return -ENOMEM;
595+
549596 return 0;
550597 }
551598
@@ -571,6 +618,11 @@ int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt, · 19 unmodified lines
571618 return 0;
572619
573620 sema_init(&pf_to_mgmt->sync_msg_lock, 1);
621+ pf_to_mgmt->workq = create_singlethread_workqueue("hinic_mgmt");
622+ if (!pf_to_mgmt->workq) {
623+ dev_err(&pdev->dev, "Failed to initialize MGMT workqueue\n");
624+ return -ENOMEM;
625+ }
574626 pf_to_mgmt->sync_msg_id = 0;
575627
576628 err = alloc_msg_buf(pf_to_mgmt);
@@ -605,4 +657,5 @@ void hinic_pf_to_mgmt_free(struct hinic_pf_to_mgmt *pf_to_mgmt) · 28 unmodified lines
605657
606658 hinic_aeq_unregister_hw_cb(&hwdev->aeqs, HINIC_MSG_FROM_MGMT_CPU);
607659 hinic_api_cmd_free(pf_to_mgmt->cmd_chain);
660+ destroy_workqueue(pf_to_mgmt->workq);
608661 }
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h+16−0
@@ -119,6 +119,7 @@ struct hinic_pf_to_mgmt { · 118 unmodified lines
119119 struct semaphore sync_msg_lock;
120120 u16 sync_msg_id;
121121 u8 *sync_msg_buf;
122+ void *mgmt_ack_buf;
122123
123124 struct hinic_recv_msg recv_resp_msg_from_mgmt;
124125 struct hinic_recv_msg recv_msg_from_mgmt;
@@ -126,6 +127,21 @@ struct hinic_pf_to_mgmt { · 1 unmodified line
126127 struct hinic_api_cmd_chain *cmd_chain[HINIC_API_CMD_MAX];
127128
128129 struct hinic_mgmt_cb mgmt_cb[HINIC_MOD_MAX];
130+
131+ struct workqueue_struct *workq;
132+};
133+
134+struct hinic_mgmt_msg_handle_work {
135+ struct work_struct work;
136+ struct hinic_pf_to_mgmt *pf_to_mgmt;
137+
138+ void *msg;
139+ u16 msg_len;
140+
141+ enum hinic_mod_type mod;
142+ u8 cmd;
143+ u16 msg_id;
144+ int async_mgmt_to_pf;
129145 };
130146
131147 void hinic_register_mgmt_msg_cb(struct hinic_pf_to_mgmt *pf_to_mgmt,
drivers/net/ethernet/ibm/ibmveth.c+1−1
@@ -1715,7 +1715,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) · 1714 unmodified lines
17151715 }
17161716
17171717 netdev->min_mtu = IBMVETH_MIN_MTU;
1718− netdev->max_mtu = ETH_MAX_MTU;
1718+ netdev->max_mtu = ETH_MAX_MTU - IBMVETH_BUFF_OH;
17191719
17201720 memcpy(netdev->dev_addr, mac_addr_p, ETH_ALEN);
17211721
drivers/net/ethernet/ibm/ibmvnic.c+7−2
@@ -1971,13 +1971,18 @@ static int do_reset(struct ibmvnic_adapter *adapter, · 1970 unmodified lines
19711971 release_sub_crqs(adapter, 1);
19721972 } else {
19731973 rc = ibmvnic_reset_crq(adapter);
1974− if (!rc)
1974+ if (rc == H_CLOSED || rc == H_SUCCESS) {
19751975 rc = vio_enable_interrupts(adapter->vdev);
1976+ if (rc)
1977+ netdev_err(adapter->netdev,
1978+ "Reset failed to enable interrupts. rc=%d\n",
1979+ rc);
1980+ }
19761981 }
19771982
19781983 if (rc) {
19791984 netdev_err(adapter->netdev,
1980− "Couldn't initialize crq. rc=%d\n", rc);
1985+ "Reset couldn't initialize crq. rc=%d\n", rc);
19811986 goto out;
19821987 }
19831988
drivers/net/ethernet/intel/i40e/i40e_ethtool.c+3−0
@@ -2070,6 +2070,9 @@ static int i40e_set_ringparam(struct net_device *netdev, · 2069 unmodified lines
20702070 */
20712071 rx_rings[i].tail = hw->hw_addr + I40E_PRTGEN_STATUS;
20722072 err = i40e_setup_rx_descriptors(&rx_rings[i]);
2073+ if (err)
2074+ goto rx_unwind;
2075+ err = i40e_alloc_rx_bi(&rx_rings[i]);
20732076 if (err)
20742077 goto rx_unwind;
20752078
drivers/net/ethernet/intel/i40e/i40e_main.c+19−10
@@ -439,11 +439,15 @@ static void i40e_get_netdev_stats_struct(struct net_device *netdev, · 438 unmodified lines
439439 i40e_get_netdev_stats_struct_tx(ring, stats);
440440
441441 if (i40e_enabled_xdp_vsi(vsi)) {
442− ring++;
442+ ring = READ_ONCE(vsi->xdp_rings[i]);
443+ if (!ring)
444+ continue;
443445 i40e_get_netdev_stats_struct_tx(ring, stats);
444446 }
445447
446− ring++;
448+ ring = READ_ONCE(vsi->rx_rings[i]);
449+ if (!ring)
450+ continue;
447451 do {
448452 start = u64_stats_fetch_begin_irq(&ring->syncp);
449453 packets = ring->stats.packets;
@@ -787,6 +791,8 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) · 337 unmodified lines
787791 for (q = 0; q < vsi->num_queue_pairs; q++) {
788792 /* locate Tx ring */
789793 p = READ_ONCE(vsi->tx_rings[q]);
794+ if (!p)
795+ continue;
790796
791797 do {
792798 start = u64_stats_fetch_begin_irq(&p->syncp);
@@ -800,8 +806,11 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) · 7 unmodified lines
800806 tx_linearize += p->tx_stats.tx_linearize;
801807 tx_force_wb += p->tx_stats.tx_force_wb;
802808
803− /* Rx queue is part of the same block as Tx queue */
804− p = &p[1];
809+ /* locate Rx ring */
810+ p = READ_ONCE(vsi->rx_rings[q]);
811+ if (!p)
812+ continue;
813+
805814 do {
806815 start = u64_stats_fetch_begin_irq(&p->syncp);
807816 packets = p->stats.packets;
@@ -10824,10 +10833,10 @@ static void i40e_vsi_clear_rings(struct i40e_vsi *vsi) · 10016 unmodified lines
1082410833 if (vsi->tx_rings && vsi->tx_rings[0]) {
1082510834 for (i = 0; i < vsi->alloc_queue_pairs; i++) {
1082610835 kfree_rcu(vsi->tx_rings[i], rcu);
10827− vsi->tx_rings[i] = NULL;
10828− vsi->rx_rings[i] = NULL;
10836+ WRITE_ONCE(vsi->tx_rings[i], NULL);
10837+ WRITE_ONCE(vsi->rx_rings[i], NULL);
1082910838 if (vsi->xdp_rings)
10830− vsi->xdp_rings[i] = NULL;
10839+ WRITE_ONCE(vsi->xdp_rings[i], NULL);
1083110840 }
1083210841 }
1083310842 }
@@ -10861,7 +10870,7 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi) · 27 unmodified lines
1086110870 if (vsi->back->hw_features & I40E_HW_WB_ON_ITR_CAPABLE)
1086210871 ring->flags = I40E_TXR_FLAGS_WB_ON_ITR;
1086310872 ring->itr_setting = pf->tx_itr_default;
10864− vsi->tx_rings[i] = ring++;
10873+ WRITE_ONCE(vsi->tx_rings[i], ring++);
1086510874
1086610875 if (!i40e_enabled_xdp_vsi(vsi))
1086710876 goto setup_rx;
@@ -10879,7 +10888,7 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi) · 11 unmodified lines
1087910888 ring->flags = I40E_TXR_FLAGS_WB_ON_ITR;
1088010889 set_ring_xdp(ring);
1088110890 ring->itr_setting = pf->tx_itr_default;
10882− vsi->xdp_rings[i] = ring++;
10891+ WRITE_ONCE(vsi->xdp_rings[i], ring++);
1088310892
1088410893 setup_rx:
1088510894 ring->queue_index = i;
@@ -10892,7 +10901,7 @@ setup_rx: · 6 unmodified lines
1089210901 ring->size = 0;
1089310902 ring->dcb_tc = 0;
1089410903 ring->itr_setting = pf->rx_itr_default;
10895− vsi->rx_rings[i] = ring;
10904+ WRITE_ONCE(vsi->rx_rings[i], ring);
1089610905 }
1089710906
1089810907 return 0;
drivers/net/ethernet/intel/ice/ice_lib.c+4−4
@@ -1194,7 +1194,7 @@ static void ice_vsi_clear_rings(struct ice_vsi *vsi) · 1193 unmodified lines
11941194 for (i = 0; i < vsi->alloc_txq; i++) {
11951195 if (vsi->tx_rings[i]) {
11961196 kfree_rcu(vsi->tx_rings[i], rcu);
1197− vsi->tx_rings[i] = NULL;
1197+ WRITE_ONCE(vsi->tx_rings[i], NULL);
11981198 }
11991199 }
12001200 }
@@ -1202,7 +1202,7 @@ static void ice_vsi_clear_rings(struct ice_vsi *vsi) · 1 unmodified line
12021202 for (i = 0; i < vsi->alloc_rxq; i++) {
12031203 if (vsi->rx_rings[i]) {
12041204 kfree_rcu(vsi->rx_rings[i], rcu);
1205− vsi->rx_rings[i] = NULL;
1205+ WRITE_ONCE(vsi->rx_rings[i], NULL);
12061206 }
12071207 }
12081208 }
@@ -1235,7 +1235,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) · 26 unmodified lines
12351235 ring->vsi = vsi;
12361236 ring->dev = dev;
12371237 ring->count = vsi->num_tx_desc;
1238− vsi->tx_rings[i] = ring;
1238+ WRITE_ONCE(vsi->tx_rings[i], ring);
12391239 }
12401240
12411241 /* Allocate Rx rings */
@@ -1254,7 +1254,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) · 12 unmodified lines
12541254 ring->netdev = vsi->netdev;
12551255 ring->dev = dev;
12561256 ring->count = vsi->num_rx_desc;
1257− vsi->rx_rings[i] = ring;
1257+ WRITE_ONCE(vsi->rx_rings[i], ring);
12581258 }
12591259
12601260 return 0;
drivers/net/ethernet/intel/ice/ice_main.c+1−1
@@ -1702,7 +1702,7 @@ static int ice_xdp_alloc_setup_rings(struct ice_vsi *vsi) · 1701 unmodified lines
17021702 xdp_ring->netdev = NULL;
17031703 xdp_ring->dev = dev;
17041704 xdp_ring->count = vsi->num_tx_desc;
1705− vsi->xdp_rings[i] = xdp_ring;
1705+ WRITE_ONCE(vsi->xdp_rings[i], xdp_ring);
17061706 if (ice_setup_tx_ring(xdp_ring))
17071707 goto free_xdp_rings;
17081708 ice_set_ring_xdp(xdp_ring);
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c+6−6
@@ -921,7 +921,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, · 920 unmodified lines
921921 ring->queue_index = txr_idx;
922922
923923 /* assign ring to adapter */
924− adapter->tx_ring[txr_idx] = ring;
924+ WRITE_ONCE(adapter->tx_ring[txr_idx], ring);
925925
926926 /* update count and index */
927927 txr_count--;
@@ -948,7 +948,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, · 20 unmodified lines
948948 set_ring_xdp(ring);
949949
950950 /* assign ring to adapter */
951− adapter->xdp_ring[xdp_idx] = ring;
951+ WRITE_ONCE(adapter->xdp_ring[xdp_idx], ring);
952952
953953 /* update count and index */
954954 xdp_count--;
@@ -991,7 +991,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, · 36 unmodified lines
991991 ring->queue_index = rxr_idx;
992992
993993 /* assign ring to adapter */
994− adapter->rx_ring[rxr_idx] = ring;
994+ WRITE_ONCE(adapter->rx_ring[rxr_idx], ring);
995995
996996 /* update count and index */
997997 rxr_count--;
@@ -1020,13 +1020,13 @@ static void ixgbe_free_q_vector(struct ixgbe_adapter *adapter, int v_idx) · 22 unmodified lines
10201020
10211021 ixgbe_for_each_ring(ring, q_vector->tx) {
10221022 if (ring_is_xdp(ring))
1023− adapter->xdp_ring[ring->queue_index] = NULL;
1023+ WRITE_ONCE(adapter->xdp_ring[ring->queue_index], NULL);
10241024 else
1025− adapter->tx_ring[ring->queue_index] = NULL;
1025+ WRITE_ONCE(adapter->tx_ring[ring->queue_index], NULL);
10261026 }
10271027
10281028 ixgbe_for_each_ring(ring, q_vector->rx)
1029− adapter->rx_ring[ring->queue_index] = NULL;
1029+ WRITE_ONCE(adapter->rx_ring[ring->queue_index], NULL);
10301030
10311031 adapter->q_vector[v_idx] = NULL;
10321032 napi_hash_del(&q_vector->napi);
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+11−3
@@ -7051,7 +7051,10 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) · 7050 unmodified lines
70517051 }
70527052
70537053 for (i = 0; i < adapter->num_rx_queues; i++) {
7054− struct ixgbe_ring *rx_ring = adapter->rx_ring[i];
7054+ struct ixgbe_ring *rx_ring = READ_ONCE(adapter->rx_ring[i]);
7055+
7056+ if (!rx_ring)
7057+ continue;
70557058 non_eop_descs += rx_ring->rx_stats.non_eop_descs;
70567059 alloc_rx_page += rx_ring->rx_stats.alloc_rx_page;
70577060 alloc_rx_page_failed += rx_ring->rx_stats.alloc_rx_page_failed;
@@ -7072,15 +7075,20 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) · 14 unmodified lines
70727075 packets = 0;
70737076 /* gather some stats to the adapter struct that are per queue */
70747077 for (i = 0; i < adapter->num_tx_queues; i++) {
7075− struct ixgbe_ring *tx_ring = adapter->tx_ring[i];
7078+ struct ixgbe_ring *tx_ring = READ_ONCE(adapter->tx_ring[i]);
7079+
7080+ if (!tx_ring)
7081+ continue;
70767082 restart_queue += tx_ring->tx_stats.restart_queue;
70777083 tx_busy += tx_ring->tx_stats.tx_busy;
70787084 bytes += tx_ring->stats.bytes;
70797085 packets += tx_ring->stats.packets;
70807086 }
70817087 for (i = 0; i < adapter->num_xdp_queues; i++) {
7082− struct ixgbe_ring *xdp_ring = adapter->xdp_ring[i];
7088+ struct ixgbe_ring *xdp_ring = READ_ONCE(adapter->xdp_ring[i]);
70837089
7090+ if (!xdp_ring)
7091+ continue;
70847092 restart_queue += xdp_ring->tx_stats.restart_queue;
70857093 tx_busy += xdp_ring->tx_stats.tx_busy;
70867094 bytes += xdp_ring->stats.bytes;
drivers/net/ethernet/marvell/mvneta.c+54−24
@@ -106,9 +106,11 @@ · 105 unmodified lines
106106 #define MVNETA_TX_IN_PRGRS BIT(1)
107107 #define MVNETA_TX_FIFO_EMPTY BIT(8)
108108 #define MVNETA_RX_MIN_FRAME_SIZE 0x247c
109+/* Only exists on Armada XP and Armada 370 */
109110 #define MVNETA_SERDES_CFG 0x24A0
110111 #define MVNETA_SGMII_SERDES_PROTO 0x0cc7
111112 #define MVNETA_QSGMII_SERDES_PROTO 0x0667
113+#define MVNETA_HSGMII_SERDES_PROTO 0x1107
112114 #define MVNETA_TYPE_PRIO 0x24bc
113115 #define MVNETA_FORCE_UNI BIT(21)
114116 #define MVNETA_TXQ_CMD_1 0x24e4
@@ -3529,26 +3531,60 @@ static int mvneta_setup_txqs(struct mvneta_port *pp) · 3414 unmodified lines
35293531 return 0;
35303532 }
35313533
3532−static int mvneta_comphy_init(struct mvneta_port *pp)
3534+static int mvneta_comphy_init(struct mvneta_port *pp, phy_interface_t interface)
35333535 {
35343536 int ret;
35353537
3536− if (!pp->comphy)
3537− return 0;
3538−
3539− ret = phy_set_mode_ext(pp->comphy, PHY_MODE_ETHERNET,
3540− pp->phy_interface);
3538+ ret = phy_set_mode_ext(pp->comphy, PHY_MODE_ETHERNET, interface);
35413539 if (ret)
35423540 return ret;
35433541
35443542 return phy_power_on(pp->comphy);
35453543 }
35463544
3545+static int mvneta_config_interface(struct mvneta_port *pp,
3546+ phy_interface_t interface)
3547+{
3548+ int ret = 0;
3549+
3550+ if (pp->comphy) {
3551+ if (interface == PHY_INTERFACE_MODE_SGMII ||
3552+ interface == PHY_INTERFACE_MODE_1000BASEX ||
3553+ interface == PHY_INTERFACE_MODE_2500BASEX) {
3554+ ret = mvneta_comphy_init(pp, interface);
3555+ }
3556+ } else {
3557+ switch (interface) {
3558+ case PHY_INTERFACE_MODE_QSGMII:
3559+ mvreg_write(pp, MVNETA_SERDES_CFG,
3560+ MVNETA_QSGMII_SERDES_PROTO);
3561+ break;
3562+
3563+ case PHY_INTERFACE_MODE_SGMII:
3564+ case PHY_INTERFACE_MODE_1000BASEX:
3565+ mvreg_write(pp, MVNETA_SERDES_CFG,
3566+ MVNETA_SGMII_SERDES_PROTO);
3567+ break;
3568+
3569+ case PHY_INTERFACE_MODE_2500BASEX:
3570+ mvreg_write(pp, MVNETA_SERDES_CFG,
3571+ MVNETA_HSGMII_SERDES_PROTO);
3572+ break;
3573+ default:
3574+ break;
3575+ }
3576+ }
3577+
3578+ pp->phy_interface = interface;
3579+
3580+ return ret;
3581+}
3582+
35473583 static void mvneta_start_dev(struct mvneta_port *pp)
35483584 {
35493585 int cpu;
35503586
3551− WARN_ON(mvneta_comphy_init(pp));
3587+ WARN_ON(mvneta_config_interface(pp, pp->phy_interface));
35523588
35533589 mvneta_max_rx_size_set(pp, pp->pkt_size);
35543590 mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
@@ -3923,17 +3959,13 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode, · 368 unmodified lines
39233959 /* When at 2.5G, the link partner can send frames with shortened
39243960 * preambles.
39253961 */
3926− if (state->speed == SPEED_2500)
3962+ if (state->interface == PHY_INTERFACE_MODE_2500BASEX)
39273963 new_ctrl4 |= MVNETA_GMAC4_SHORT_PREAMBLE_ENABLE;
39283964
3929− if (pp->comphy && pp->phy_interface != state->interface &&
3930− (state->interface == PHY_INTERFACE_MODE_SGMII ||
3931− state->interface == PHY_INTERFACE_MODE_1000BASEX ||
3932− state->interface == PHY_INTERFACE_MODE_2500BASEX)) {
3933− pp->phy_interface = state->interface;
3934−
3935− WARN_ON(phy_power_off(pp->comphy));
3936− WARN_ON(mvneta_comphy_init(pp));
3965+ if (pp->phy_interface != state->interface) {
3966+ if (pp->comphy)
3967+ WARN_ON(phy_power_off(pp->comphy));
3968+ WARN_ON(mvneta_config_interface(pp, state->interface));
39373969 }
39383970
39393971 if (new_ctrl0 != gmac_ctrl0)
@@ -4982,12 +5014,10 @@ static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) · 1042 unmodified lines
49825014 /* MAC Cause register should be cleared */
49835015 mvreg_write(pp, MVNETA_UNIT_INTR_CAUSE, 0);
49845016
4985− if (phy_mode == PHY_INTERFACE_MODE_QSGMII)
4986− mvreg_write(pp, MVNETA_SERDES_CFG, MVNETA_QSGMII_SERDES_PROTO);
4987− else if (phy_mode == PHY_INTERFACE_MODE_SGMII ||
4988− phy_interface_mode_is_8023z(phy_mode))
4989− mvreg_write(pp, MVNETA_SERDES_CFG, MVNETA_SGMII_SERDES_PROTO);
4990− else if (!phy_interface_mode_is_rgmii(phy_mode))
5017+ if (phy_mode != PHY_INTERFACE_MODE_QSGMII &&
5018+ phy_mode != PHY_INTERFACE_MODE_SGMII &&
5019+ !phy_interface_mode_is_8023z(phy_mode) &&
5020+ !phy_interface_mode_is_rgmii(phy_mode))
49915021 return -EINVAL;
49925022
49935023 return 0;
@@ -5176,10 +5206,10 @@ static int mvneta_probe(struct platform_device *pdev) · 182 unmodified lines
51765206 if (err < 0)
51775207 goto err_netdev;
51785208
5179− err = mvneta_port_power_up(pp, phy_mode);
5209+ err = mvneta_port_power_up(pp, pp->phy_interface);
51805210 if (err < 0) {
51815211 dev_err(&pdev->dev, "can't power up port\n");
5182− goto err_netdev;
5212+ return err;
51835213 }
51845214
51855215 /* Armada3700 network controller does not support per-cpu
drivers/net/ethernet/marvell/sky2.c+1−1
@@ -203,7 +203,7 @@ io_error: · 202 unmodified lines
203203
204204 static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg)
205205 {
206− u16 v;
206+ u16 v = 0;
207207 __gm_phy_read(hw, port, reg, &v);
208208 return v;
209209 }
drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h+1−0
@@ -29,6 +29,7 @@ struct mlx5e_dcbx { · 28 unmodified lines
2929 bool manual_buffer;
3030 u32 cable_len;
3131 u32 xoff;
32+ u16 port_buff_cell_sz;
3233 };
3334
3435 #define MLX5E_MAX_DSCP (64)
drivers/net/ethernet/mellanox/mlx5/core/en/port.c+18−3
@@ -78,11 +78,26 @@ static const u32 mlx5e_ext_link_speed[MLX5E_EXT_LINK_MODES_NUMBER] = { · 77 unmodified lines
7878 [MLX5E_400GAUI_8] = 400000,
7979 };
8080
81+bool mlx5e_ptys_ext_supported(struct mlx5_core_dev *mdev)
82+{
83+ struct mlx5e_port_eth_proto eproto;
84+ int err;
85+
86+ if (MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet))
87+ return true;
88+
89+ err = mlx5_port_query_eth_proto(mdev, 1, true, &eproto);
90+ if (err)
91+ return false;
92+
93+ return !!eproto.cap;
94+}
95+
8196 static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev,
8297 const u32 **arr, u32 *size,
8398 bool force_legacy)
8499 {
85− bool ext = force_legacy ? false : MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
100+ bool ext = force_legacy ? false : mlx5e_ptys_ext_supported(mdev);
86101
87102 *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) :
88103 ARRAY_SIZE(mlx5e_link_speed);
@@ -177,7 +192,7 @@ int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 88 unmodified lines
177192 bool ext;
178193 int err;
179194
180− ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
195+ ext = mlx5e_ptys_ext_supported(mdev);
181196 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
182197 if (err)
183198 goto out;
@@ -205,7 +220,7 @@ int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 21 unmodified lines
205220 int err;
206221 int i;
207222
208− ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
223+ ext = mlx5e_ptys_ext_supported(mdev);
209224 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
210225 if (err)
211226 return err;
drivers/net/ethernet/mellanox/mlx5/core/en/port.h+1−1
@@ -54,7 +54,7 @@ int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed); · 53 unmodified lines
5454 int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
5555 u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed,
5656 bool force_legacy);
57−
57+bool mlx5e_ptys_ext_supported(struct mlx5_core_dev *mdev);
5858 int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out);
5959 int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in);
6060 int mlx5e_port_query_priority2buffer(struct mlx5_core_dev *mdev, u8 *buffer);
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c+29−24
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 int mlx5e_port_query_buffer(struct mlx5e_priv *priv,
3535 struct mlx5e_port_buffer *port_buffer)
3636 {
37+ u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz;
3738 struct mlx5_core_dev *mdev = priv->mdev;
3839 int sz = MLX5_ST_SZ_BYTES(pbmc_reg);
3940 u32 total_used = 0;
@@ -57,11 +58,11 @@ int mlx5e_port_query_buffer(struct mlx5e_priv *priv, · 17 unmodified lines
5758 port_buffer->buffer[i].epsb =
5859 MLX5_GET(bufferx_reg, buffer, epsb);
5960 port_buffer->buffer[i].size =
60− MLX5_GET(bufferx_reg, buffer, size) << MLX5E_BUFFER_CELL_SHIFT;
61+ MLX5_GET(bufferx_reg, buffer, size) * port_buff_cell_sz;
6162 port_buffer->buffer[i].xon =
62− MLX5_GET(bufferx_reg, buffer, xon_threshold) << MLX5E_BUFFER_CELL_SHIFT;
63+ MLX5_GET(bufferx_reg, buffer, xon_threshold) * port_buff_cell_sz;
6364 port_buffer->buffer[i].xoff =
64− MLX5_GET(bufferx_reg, buffer, xoff_threshold) << MLX5E_BUFFER_CELL_SHIFT;
65+ MLX5_GET(bufferx_reg, buffer, xoff_threshold) * port_buff_cell_sz;
6566 total_used += port_buffer->buffer[i].size;
6667
6768 mlx5e_dbg(HW, priv, "buffer %d: size=%d, xon=%d, xoff=%d, epsb=%d, lossy=%d\n", i,
@@ -73,7 +74,7 @@ int mlx5e_port_query_buffer(struct mlx5e_priv *priv, · 5 unmodified lines
7374 }
7475
7576 port_buffer->port_buffer_size =
76− MLX5_GET(pbmc_reg, out, port_buffer_size) << MLX5E_BUFFER_CELL_SHIFT;
77+ MLX5_GET(pbmc_reg, out, port_buffer_size) * port_buff_cell_sz;
7778 port_buffer->spare_buffer_size =
7879 port_buffer->port_buffer_size - total_used;
7980
@@ -88,9 +89,9 @@ out: · 8 unmodified lines
8889 static int port_set_buffer(struct mlx5e_priv *priv,
8990 struct mlx5e_port_buffer *port_buffer)
9091 {
92+ u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz;
9193 struct mlx5_core_dev *mdev = priv->mdev;
9294 int sz = MLX5_ST_SZ_BYTES(pbmc_reg);
93− void *buffer;
9495 void *in;
9596 int err;
9697 int i;
@@ -104,16 +105,18 @@ static int port_set_buffer(struct mlx5e_priv *priv, · 7 unmodified lines
104105 goto out;
105106
106107 for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
107− buffer = MLX5_ADDR_OF(pbmc_reg, in, buffer[i]);
108−
109− MLX5_SET(bufferx_reg, buffer, size,
110− port_buffer->buffer[i].size >> MLX5E_BUFFER_CELL_SHIFT);
111− MLX5_SET(bufferx_reg, buffer, lossy,
112− port_buffer->buffer[i].lossy);
113− MLX5_SET(bufferx_reg, buffer, xoff_threshold,
114− port_buffer->buffer[i].xoff >> MLX5E_BUFFER_CELL_SHIFT);
115− MLX5_SET(bufferx_reg, buffer, xon_threshold,
116− port_buffer->buffer[i].xon >> MLX5E_BUFFER_CELL_SHIFT);
108+ void *buffer = MLX5_ADDR_OF(pbmc_reg, in, buffer[i]);
109+ u64 size = port_buffer->buffer[i].size;
110+ u64 xoff = port_buffer->buffer[i].xoff;
111+ u64 xon = port_buffer->buffer[i].xon;
112+
113+ do_div(size, port_buff_cell_sz);
114+ do_div(xoff, port_buff_cell_sz);
115+ do_div(xon, port_buff_cell_sz);
116+ MLX5_SET(bufferx_reg, buffer, size, size);
117+ MLX5_SET(bufferx_reg, buffer, lossy, port_buffer->buffer[i].lossy);
118+ MLX5_SET(bufferx_reg, buffer, xoff_threshold, xoff);
119+ MLX5_SET(bufferx_reg, buffer, xon_threshold, xon);
117120 }
118121
119122 err = mlx5e_port_set_pbmc(mdev, in);
@@ -143,7 +146,7 @@ static u32 calculate_xoff(struct mlx5e_priv *priv, unsigned int mtu) · 23 unmodified lines
143146 }
144147
145148 static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer,
146− u32 xoff, unsigned int max_mtu)
149+ u32 xoff, unsigned int max_mtu, u16 port_buff_cell_sz)
147150 {
148151 int i;
149152
@@ -155,7 +158,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, · 5 unmodified lines
155158 }
156159
157160 if (port_buffer->buffer[i].size <
158− (xoff + max_mtu + (1 << MLX5E_BUFFER_CELL_SHIFT))) {
161+ (xoff + max_mtu + port_buff_cell_sz)) {
159162 pr_err("buffer_size[%d]=%d is not enough for lossless buffer\n",
160163 i, port_buffer->buffer[i].size);
161164 return -ENOMEM;
@@ -175,6 +178,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, · 13 unmodified lines
175178 * @pfc_en: <input> current pfc configuration
176179 * @buffer: <input> current prio to buffer mapping
177180 * @xoff: <input> xoff value
181+ * @port_buff_cell_sz: <input> port buffer cell_size
178182 * @port_buffer: <output> port receive buffer configuration
179183 * @change: <output>
180184 *
@@ -189,7 +193,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, · 8 unmodified lines
189193 * sets change to true if buffer configuration was modified.
190194 */
191195 static int update_buffer_lossy(unsigned int max_mtu,
192− u8 pfc_en, u8 *buffer, u32 xoff,
196+ u8 pfc_en, u8 *buffer, u32 xoff, u16 port_buff_cell_sz,
193197 struct mlx5e_port_buffer *port_buffer,
194198 bool *change)
195199 {
@@ -225,7 +229,7 @@ static int update_buffer_lossy(unsigned int max_mtu, · 29 unmodified lines
225229 }
226230
227231 if (changed) {
228− err = update_xoff_threshold(port_buffer, xoff, max_mtu);
232+ err = update_xoff_threshold(port_buffer, xoff, max_mtu, port_buff_cell_sz);
229233 if (err)
230234 return err;
231235
@@ -262,6 +266,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 30 unmodified lines
262266 u32 *buffer_size,
263267 u8 *prio2buffer)
264268 {
269+ u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz;
265270 struct mlx5e_port_buffer port_buffer;
266271 u32 xoff = calculate_xoff(priv, mtu);
267272 bool update_prio2buffer = false;
@@ -282,7 +287,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 14 unmodified lines
282287
283288 if (change & MLX5E_PORT_BUFFER_CABLE_LEN) {
284289 update_buffer = true;
285− err = update_xoff_threshold(&port_buffer, xoff, max_mtu);
290+ err = update_xoff_threshold(&port_buffer, xoff, max_mtu, port_buff_cell_sz);
286291 if (err)
287292 return err;
288293 }
@@ -292,7 +297,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 3 unmodified lines
292297 if (err)
293298 return err;
294299
295− err = update_buffer_lossy(max_mtu, pfc->pfc_en, buffer, xoff,
300+ err = update_buffer_lossy(max_mtu, pfc->pfc_en, buffer, xoff, port_buff_cell_sz,
296301 &port_buffer, &update_buffer);
297302 if (err)
298303 return err;
@@ -304,7 +309,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 5 unmodified lines
304309 if (err)
305310 return err;
306311
307− err = update_buffer_lossy(max_mtu, curr_pfc_en, prio2buffer,
312+ err = update_buffer_lossy(max_mtu, curr_pfc_en, prio2buffer, port_buff_cell_sz,
308313 xoff, &port_buffer, &update_buffer);
309314 if (err)
310315 return err;
@@ -329,7 +334,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 18 unmodified lines
329334 return -EINVAL;
330335
331336 update_buffer = true;
332− err = update_xoff_threshold(&port_buffer, xoff, max_mtu);
337+ err = update_xoff_threshold(&port_buffer, xoff, max_mtu, port_buff_cell_sz);
333338 if (err)
334339 return err;
335340 }
@@ -337,7 +342,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 1 unmodified line
337342 /* Need to update buffer configuration if xoff value is changed */
338343 if (!update_buffer && xoff != priv->dcbx.xoff) {
339344 update_buffer = true;
340− err = update_xoff_threshold(&port_buffer, xoff, max_mtu);
345+ err = update_xoff_threshold(&port_buffer, xoff, max_mtu, port_buff_cell_sz);
341346 if (err)
342347 return err;
343348 }
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h+0−1
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636 #include "port.h"
3737
3838 #define MLX5E_MAX_BUFFER 8
39−#define MLX5E_BUFFER_CELL_SHIFT 7
4039 #define MLX5E_DEFAULT_CABLE_LEN 7 /* 7 meters */
4140
4241 #define MLX5_BUFFER_SUPPORTED(mdev) (MLX5_CAP_GEN(mdev, pcam_reg) && \
drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/rculist.h>
77 #include <linux/rtnetlink.h>
88 #include <linux/workqueue.h>
9−#include <linux/rwlock.h>
109 #include <linux/spinlock.h>
1110 #include <linux/notifier.h>
1211 #include <net/netevent.h>
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c+16−8
@@ -407,7 +407,9 @@ static int · 406 unmodified lines
407407 mlx5e_rep_indr_setup_block(struct net_device *netdev,
408408 struct mlx5e_rep_priv *rpriv,
409409 struct flow_block_offload *f,
410− flow_setup_cb_t *setup_cb)
410+ flow_setup_cb_t *setup_cb,
411+ void *data,
412+ void (*cleanup)(struct flow_block_cb *block_cb))
411413 {
412414 struct mlx5e_priv *priv = netdev_priv(rpriv->netdev);
413415 struct mlx5e_rep_indr_block_priv *indr_priv;
@@ -438,8 +440,10 @@ mlx5e_rep_indr_setup_block(struct net_device *netdev, · 24 unmodified lines
438440 list_add(&indr_priv->list,
439441 &rpriv->uplink_priv.tc_indr_block_priv_list);
440442
441− block_cb = flow_block_cb_alloc(setup_cb, indr_priv, indr_priv,
442− mlx5e_rep_indr_block_unbind);
443+ block_cb = flow_indr_block_cb_alloc(setup_cb, indr_priv, indr_priv,
444+ mlx5e_rep_indr_block_unbind,
445+ f, netdev, data, rpriv,
446+ cleanup);
443447 if (IS_ERR(block_cb)) {
444448 list_del(&indr_priv->list);
445449 kfree(indr_priv);
@@ -458,7 +462,7 @@ mlx5e_rep_indr_setup_block(struct net_device *netdev, · 12 unmodified lines
458462 if (!block_cb)
459463 return -ENOENT;
460464
461− flow_block_cb_remove(block_cb, f);
465+ flow_indr_block_cb_remove(block_cb, f);
462466 list_del(&block_cb->driver_list);
463467 return 0;
464468 default:
@@ -469,15 +473,19 @@ mlx5e_rep_indr_setup_block(struct net_device *netdev, · 4 unmodified lines
469473
470474 static
471475 int mlx5e_rep_indr_setup_cb(struct net_device *netdev, void *cb_priv,
472− enum tc_setup_type type, void *type_data)
476+ enum tc_setup_type type, void *type_data,
477+ void *data,
478+ void (*cleanup)(struct flow_block_cb *block_cb))
473479 {
474480 switch (type) {
475481 case TC_SETUP_BLOCK:
476482 return mlx5e_rep_indr_setup_block(netdev, cb_priv, type_data,
477− mlx5e_rep_indr_setup_tc_cb);
483+ mlx5e_rep_indr_setup_tc_cb,
484+ data, cleanup);
478485 case TC_SETUP_FT:
479486 return mlx5e_rep_indr_setup_block(netdev, cb_priv, type_data,
480− mlx5e_rep_indr_setup_ft_cb);
487+ mlx5e_rep_indr_setup_ft_cb,
488+ data, cleanup);
481489 default:
482490 return -EOPNOTSUPP;
483491 }
@@ -496,7 +504,7 @@ int mlx5e_rep_tc_netdevice_event_register(struct mlx5e_rep_priv *rpriv) · 12 unmodified lines
496504 void mlx5e_rep_tc_netdevice_event_unregister(struct mlx5e_rep_priv *rpriv)
497505 {
498506 flow_indr_dev_unregister(mlx5e_rep_indr_setup_cb, rpriv,
499− mlx5e_rep_indr_setup_tc_cb);
507+ mlx5e_rep_indr_block_unbind);
500508 }
501509
502510 #if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+1−0
@@ -1097,6 +1097,7 @@ mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg) · 1096 unmodified lines
10971097 struct mlx5_ct_entry *entry = ptr;
10981098
10991099 mlx5_tc_ct_entry_del_rules(ct_priv, entry);
1100+ kfree(entry);
11001101 }
11011102
11021103 static void
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c+19−0
@@ -1217,6 +1217,24 @@ static int mlx5e_trust_initialize(struct mlx5e_priv *priv) · 1216 unmodified lines
12171217 return 0;
12181218 }
12191219
1220+#define MLX5E_BUFFER_CELL_SHIFT 7
1221+
1222+static u16 mlx5e_query_port_buffers_cell_size(struct mlx5e_priv *priv)
1223+{
1224+ struct mlx5_core_dev *mdev = priv->mdev;
1225+ u32 out[MLX5_ST_SZ_DW(sbcam_reg)] = {};
1226+ u32 in[MLX5_ST_SZ_DW(sbcam_reg)] = {};
1227+
1228+ if (!MLX5_CAP_GEN(mdev, sbcam_reg))
1229+ return (1 << MLX5E_BUFFER_CELL_SHIFT);
1230+
1231+ if (mlx5_core_access_reg(mdev, in, sizeof(in), out, sizeof(out),
1232+ MLX5_REG_SBCAM, 0, 0))
1233+ return (1 << MLX5E_BUFFER_CELL_SHIFT);
1234+
1235+ return MLX5_GET(sbcam_reg, out, cap_cell_size);
1236+}
1237+
12201238 void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv)
12211239 {
12221240 struct mlx5e_dcbx *dcbx = &priv->dcbx;
@@ -1234,6 +1252,7 @@ void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) · 11 unmodified lines
12341252 if (priv->dcbx.mode == MLX5E_DCBX_PARAM_VER_OPER_HOST)
12351253 priv->dcbx.cap |= DCB_CAP_DCBX_HOST;
12361254
1255+ priv->dcbx.port_buff_cell_sz = mlx5e_query_port_buffers_cell_size(priv);
12371256 priv->dcbx.manual_buffer = false;
12381257 priv->dcbx.cable_len = MLX5E_DEFAULT_CABLE_LEN;
12391258
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+4−4
@@ -200,7 +200,7 @@ static void mlx5e_ethtool_get_speed_arr(struct mlx5_core_dev *mdev, · 199 unmodified lines
200200 struct ptys2ethtool_config **arr,
201201 u32 *size)
202202 {
203− bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
203+ bool ext = mlx5e_ptys_ext_supported(mdev);
204204
205205 *arr = ext ? ptys2ext_ethtool_table : ptys2legacy_ethtool_table;
206206 *size = ext ? ARRAY_SIZE(ptys2ext_ethtool_table) :
@@ -883,7 +883,7 @@ static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp, · 676 unmodified lines
883883 struct ethtool_link_ksettings *link_ksettings)
884884 {
885885 unsigned long *lp_advertising = link_ksettings->link_modes.lp_advertising;
886− bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
886+ bool ext = mlx5e_ptys_ext_supported(mdev);
887887
888888 ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext);
889889 }
@@ -913,7 +913,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 23 unmodified lines
913913 __func__, err);
914914 goto err_query_regs;
915915 }
916− ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
916+ ext = !!MLX5_GET_ETH_PROTO(ptys_reg, out, true, eth_proto_capability);
917917 eth_proto_cap = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
918918 eth_proto_capability);
919919 eth_proto_admin = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
@@ -1066,7 +1066,7 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 146 unmodified lines
10661066 autoneg = link_ksettings->base.autoneg;
10671067 speed = link_ksettings->base.speed;
10681068
1069− ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
1069+ ext_supported = mlx5e_ptys_ext_supported(mdev);
10701070 ext = ext_requested(autoneg, adver, ext_supported);
10711071 if (!ext_supported && ext)
10721072 return -EOPNOTSUPP;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+8−7
@@ -3104,9 +3104,6 @@ int mlx5e_open(struct net_device *netdev) · 3103 unmodified lines
31043104 mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP);
31053105 mutex_unlock(&priv->state_lock);
31063106
3107− if (mlx5_vxlan_allowed(priv->mdev->vxlan))
3108− udp_tunnel_get_rx_info(netdev);
3109−
31103107 return err;
31113108 }
31123109
@@ -5121,6 +5118,10 @@ static int mlx5e_init_nic_rx(struct mlx5e_priv *priv) · 2008 unmodified lines
51215118 if (err)
51225119 goto err_destroy_flow_steering;
51235120
5121+#ifdef CONFIG_MLX5_EN_ARFS
5122+ priv->netdev->rx_cpu_rmap = mlx5_eq_table_get_rmap(priv->mdev);
5123+#endif
5124+
51245125 return 0;
51255126
51265127 err_destroy_flow_steering:
@@ -5202,6 +5203,8 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) · 75 unmodified lines
52025203 rtnl_lock();
52035204 if (netif_running(netdev))
52045205 mlx5e_open(netdev);
5206+ if (mlx5_vxlan_allowed(priv->mdev->vxlan))
5207+ udp_tunnel_get_rx_info(netdev);
52055208 netif_device_attach(netdev);
52065209 rtnl_unlock();
52075210 }
@@ -5216,6 +5219,8 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) · 8 unmodified lines
52165219 rtnl_lock();
52175220 if (netif_running(priv->netdev))
52185221 mlx5e_close(priv->netdev);
5222+ if (mlx5_vxlan_allowed(priv->mdev->vxlan))
5223+ udp_tunnel_drop_rx_info(priv->netdev);
52195224 netif_device_detach(priv->netdev);
52205225 rtnl_unlock();
52215226
@@ -5288,10 +5293,6 @@ int mlx5e_netdev_init(struct net_device *netdev, · 66 unmodified lines
52885293 /* netdev init */
52895294 netif_carrier_off(netdev);
52905295
5291−#ifdef CONFIG_MLX5_EN_ARFS
5292− netdev->rx_cpu_rmap = mlx5_eq_table_get_rmap(mdev);
5293−#endif
5294−
52955296 return 0;
52965297
52975298 err_free_cpumask:
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+9−5
@@ -4670,9 +4670,10 @@ static bool is_flow_rule_duplicate_allowed(struct net_device *dev, · 4669 unmodified lines
46704670 struct mlx5e_rep_priv *rpriv)
46714671 {
46724672 /* Offloaded flow rule is allowed to duplicate on non-uplink representor
4673− * sharing tc block with other slaves of a lag device.
4673+ * sharing tc block with other slaves of a lag device. Rpriv can be NULL if this
4674+ * function is called from NIC mode.
46744675 */
4675− return netif_is_lag_port(dev) && rpriv->rep->vport != MLX5_VPORT_UPLINK;
4676+ return netif_is_lag_port(dev) && rpriv && rpriv->rep->vport != MLX5_VPORT_UPLINK;
46764677 }
46774678
46784679 int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
@@ -4686,13 +4687,12 @@ int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv, · 7 unmodified lines
46864687
46874688 rcu_read_lock();
46884689 flow = rhashtable_lookup(tc_ht, &f->cookie, tc_ht_params);
4689− rcu_read_unlock();
46904690 if (flow) {
46914691 /* Same flow rule offloaded to non-uplink representor sharing tc block,
46924692 * just return 0.
46934693 */
46944694 if (is_flow_rule_duplicate_allowed(dev, rpriv) && flow->orig_dev != dev)
4695− goto out;
4695+ goto rcu_unlock;
46964696
46974697 NL_SET_ERR_MSG_MOD(extack,
46984698 "flow cookie already exists, ignoring");
@@ -4700,8 +4700,12 @@ int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv, · 1 unmodified line
47004700 "flow cookie %lx already exists, ignoring\n",
47014701 f->cookie);
47024702 err = -EEXIST;
4703− goto out;
4703+ goto rcu_unlock;
47044704 }
4705+rcu_unlock:
4706+ rcu_read_unlock();
4707+ if (flow)
4708+ goto out;
47054709
47064710 trace_mlx5e_configure_flower(f);
47074711 err = mlx5e_tc_add_flow(priv, f, flags, dev, &flow);
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c+0−1
@@ -217,7 +217,6 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, · 216 unmodified lines
217217 }
218218
219219 /* Create ingress allow rule */
220− memset(spec, 0, sizeof(*spec));
221220 spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
222221 flow_act.action = MLX5_FLOW_CONTEXT_ACTION_ALLOW;
223222 vport->ingress.allow_rule = mlx5_add_flow_rules(vport->ingress.acl, spec,
drivers/net/ethernet/mellanox/mlx5/core/port.c+77−16
@@ -293,7 +293,40 @@ static int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num) · 292 unmodified lines
293293 return 0;
294294 }
295295
296−static int mlx5_eeprom_page(int offset)
296+static int mlx5_query_module_id(struct mlx5_core_dev *dev, int module_num,
297+ u8 *module_id)
298+{
299+ u32 in[MLX5_ST_SZ_DW(mcia_reg)] = {};
300+ u32 out[MLX5_ST_SZ_DW(mcia_reg)];
301+ int err, status;
302+ u8 *ptr;
303+
304+ MLX5_SET(mcia_reg, in, i2c_device_address, MLX5_I2C_ADDR_LOW);
305+ MLX5_SET(mcia_reg, in, module, module_num);
306+ MLX5_SET(mcia_reg, in, device_address, 0);
307+ MLX5_SET(mcia_reg, in, page_number, 0);
308+ MLX5_SET(mcia_reg, in, size, 1);
309+ MLX5_SET(mcia_reg, in, l, 0);
310+
311+ err = mlx5_core_access_reg(dev, in, sizeof(in), out,
312+ sizeof(out), MLX5_REG_MCIA, 0, 0);
313+ if (err)
314+ return err;
315+
316+ status = MLX5_GET(mcia_reg, out, status);
317+ if (status) {
318+ mlx5_core_err(dev, "query_mcia_reg failed: status: 0x%x\n",
319+ status);
320+ return -EIO;
321+ }
322+ ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
323+
324+ *module_id = ptr[0];
325+
326+ return 0;
327+}
328+
329+static int mlx5_qsfp_eeprom_page(u16 offset)
297330 {
298331 if (offset < MLX5_EEPROM_PAGE_LENGTH)
299332 /* Addresses between 0-255 - page 00 */
@@ -307,7 +340,7 @@ static int mlx5_eeprom_page(int offset) · 7 unmodified lines
307340 MLX5_EEPROM_HIGH_PAGE_LENGTH);
308341 }
309342
310−static int mlx5_eeprom_high_page_offset(int page_num)
343+static int mlx5_qsfp_eeprom_high_page_offset(int page_num)
311344 {
312345 if (!page_num) /* Page 0 always start from low page */
313346 return 0;
@@ -316,35 +349,62 @@ static int mlx5_eeprom_high_page_offset(int page_num) · 2 unmodified lines
316349 return page_num * MLX5_EEPROM_HIGH_PAGE_LENGTH;
317350 }
318351
352+static void mlx5_qsfp_eeprom_params_set(u16 *i2c_addr, int *page_num, u16 *offset)
353+{
354+ *i2c_addr = MLX5_I2C_ADDR_LOW;
355+ *page_num = mlx5_qsfp_eeprom_page(*offset);
356+ *offset -= mlx5_qsfp_eeprom_high_page_offset(*page_num);
357+}
358+
359+static void mlx5_sfp_eeprom_params_set(u16 *i2c_addr, int *page_num, u16 *offset)
360+{
361+ *i2c_addr = MLX5_I2C_ADDR_LOW;
362+ *page_num = 0;
363+
364+ if (*offset < MLX5_EEPROM_PAGE_LENGTH)
365+ return;
366+
367+ *i2c_addr = MLX5_I2C_ADDR_HIGH;
368+ *offset -= MLX5_EEPROM_PAGE_LENGTH;
369+}
370+
319371 int mlx5_query_module_eeprom(struct mlx5_core_dev *dev,
320372 u16 offset, u16 size, u8 *data)
321373 {
322− int module_num, page_num, status, err;
374+ int module_num, status, err, page_num = 0;
375+ u32 in[MLX5_ST_SZ_DW(mcia_reg)] = {};
323376 u32 out[MLX5_ST_SZ_DW(mcia_reg)];
324− u32 in[MLX5_ST_SZ_DW(mcia_reg)];
325− u16 i2c_addr;
326− void *ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
377+ u16 i2c_addr = 0;
378+ u8 module_id;
379+ void *ptr;
327380
328381 err = mlx5_query_module_num(dev, &module_num);
329382 if (err)
330383 return err;
331384
332− memset(in, 0, sizeof(in));
333− size = min_t(int, size, MLX5_EEPROM_MAX_BYTES);
334−
335− /* Get the page number related to the given offset */
336− page_num = mlx5_eeprom_page(offset);
385+ err = mlx5_query_module_id(dev, module_num, &module_id);
386+ if (err)
387+ return err;
337388
338− /* Set the right offset according to the page number,
339− * For page_num > 0, relative offset is always >= 128 (high page).
340− */
341− offset -= mlx5_eeprom_high_page_offset(page_num);
389+ switch (module_id) {
390+ case MLX5_MODULE_ID_SFP:
391+ mlx5_sfp_eeprom_params_set(&i2c_addr, &page_num, &offset);
392+ break;
393+ case MLX5_MODULE_ID_QSFP:
394+ case MLX5_MODULE_ID_QSFP_PLUS:
395+ case MLX5_MODULE_ID_QSFP28:
396+ mlx5_qsfp_eeprom_params_set(&i2c_addr, &page_num, &offset);
397+ break;
398+ default:
399+ mlx5_core_err(dev, "Module ID not recognized: 0x%x\n", module_id);
400+ return -EINVAL;
401+ }
342402
343403 if (offset + size > MLX5_EEPROM_PAGE_LENGTH)
344404 /* Cross pages read, read until offset 256 in low page */
345405 size -= offset + size - MLX5_EEPROM_PAGE_LENGTH;
346406
347− i2c_addr = MLX5_I2C_ADDR_LOW;
407+ size = min_t(int, size, MLX5_EEPROM_MAX_BYTES);
348408
349409 MLX5_SET(mcia_reg, in, l, 0);
350410 MLX5_SET(mcia_reg, in, module, module_num);
@@ -365,6 +425,7 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev, · 14 unmodified lines
365425 return -EIO;
366426 }
367427
428+ ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
368429 memcpy(data, ptr, size);
369430
370431 return size;
drivers/net/ethernet/mellanox/mlxsw/pci.c+38−16
@@ -1414,23 +1414,12 @@ static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, · 1413 unmodified lines
14141414 u16 num_pages;
14151415 int err;
14161416
1417− mutex_init(&mlxsw_pci->cmd.lock);
1418− init_waitqueue_head(&mlxsw_pci->cmd.wait);
1419−
14201417 mlxsw_pci->core = mlxsw_core;
14211418
14221419 mbox = mlxsw_cmd_mbox_alloc();
14231420 if (!mbox)
14241421 return -ENOMEM;
14251422
1426− err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1427− if (err)
1428− goto mbox_put;
1429−
1430− err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1431− if (err)
1432− goto err_out_mbox_alloc;
1433−
14341423 err = mlxsw_pci_sw_reset(mlxsw_pci, mlxsw_pci->id);
14351424 if (err)
14361425 goto err_sw_reset;
@@ -1537,9 +1526,6 @@ err_query_fw: · 100 unmodified lines
15371526 mlxsw_pci_free_irq_vectors(mlxsw_pci);
15381527 err_alloc_irq:
15391528 err_sw_reset:
1540− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1541−err_out_mbox_alloc:
1542− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
15431529 mbox_put:
15441530 mlxsw_cmd_mbox_free(mbox);
15451531 return err;
@@ -1553,8 +1539,6 @@ static void mlxsw_pci_fini(void *bus_priv) · 7 unmodified lines
15531539 mlxsw_pci_aqs_fini(mlxsw_pci);
15541540 mlxsw_pci_fw_area_fini(mlxsw_pci);
15551541 mlxsw_pci_free_irq_vectors(mlxsw_pci);
1556− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1557− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
15581542 }
15591543
15601544 static struct mlxsw_pci_queue *
@@ -1776,6 +1760,37 @@ static const struct mlxsw_bus mlxsw_pci_bus = { · 215 unmodified lines
17761760 .features = MLXSW_BUS_F_TXRX | MLXSW_BUS_F_RESET,
17771761 };
17781762
1763+static int mlxsw_pci_cmd_init(struct mlxsw_pci *mlxsw_pci)
1764+{
1765+ int err;
1766+
1767+ mutex_init(&mlxsw_pci->cmd.lock);
1768+ init_waitqueue_head(&mlxsw_pci->cmd.wait);
1769+
1770+ err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1771+ if (err)
1772+ goto err_in_mbox_alloc;
1773+
1774+ err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1775+ if (err)
1776+ goto err_out_mbox_alloc;
1777+
1778+ return 0;
1779+
1780+err_out_mbox_alloc:
1781+ mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1782+err_in_mbox_alloc:
1783+ mutex_destroy(&mlxsw_pci->cmd.lock);
1784+ return err;
1785+}
1786+
1787+static void mlxsw_pci_cmd_fini(struct mlxsw_pci *mlxsw_pci)
1788+{
1789+ mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1790+ mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1791+ mutex_destroy(&mlxsw_pci->cmd.lock);
1792+}
1793+
17791794 static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17801795 {
17811796 const char *driver_name = pdev->driver->name;
@@ -1831,6 +1846,10 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 49 unmodified lines
18311846 mlxsw_pci->pdev = pdev;
18321847 pci_set_drvdata(pdev, mlxsw_pci);
18331848
1849+ err = mlxsw_pci_cmd_init(mlxsw_pci);
1850+ if (err)
1851+ goto err_pci_cmd_init;
1852+
18341853 mlxsw_pci->bus_info.device_kind = driver_name;
18351854 mlxsw_pci->bus_info.device_name = pci_name(mlxsw_pci->pdev);
18361855 mlxsw_pci->bus_info.dev = &pdev->dev;
@@ -1848,6 +1867,8 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 11 unmodified lines
18481867 return 0;
18491868
18501869 err_bus_device_register:
1870+ mlxsw_pci_cmd_fini(mlxsw_pci);
1871+err_pci_cmd_init:
18511872 iounmap(mlxsw_pci->hw_addr);
18521873 err_ioremap:
18531874 err_pci_resource_len_check:
@@ -1865,6 +1886,7 @@ static void mlxsw_pci_remove(struct pci_dev *pdev) · 11 unmodified lines
18651886 struct mlxsw_pci *mlxsw_pci = pci_get_drvdata(pdev);
18661887
18671888 mlxsw_core_bus_device_unregister(mlxsw_pci->core, false);
1889+ mlxsw_pci_cmd_fini(mlxsw_pci);
18681890 iounmap(mlxsw_pci->hw_addr);
18691891 pci_release_regions(mlxsw_pci->pdev);
18701892 pci_disable_device(mlxsw_pci->pdev);
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+2−2
@@ -978,10 +978,10 @@ int __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu, · 977 unmodified lines
978978
979979 lossy = !(pfc || pause_en);
980980 thres_cells = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu);
981− mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, &thres_cells);
981+ thres_cells = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, thres_cells);
982982 delay_cells = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay,
983983 pfc, pause_en);
984− mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, &delay_cells);
984+ delay_cells = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, delay_cells);
985985 total_cells = thres_cells + delay_cells;
986986
987987 taken_headroom_cells += total_cells;
drivers/net/ethernet/mellanox/mlxsw/spectrum.h+3−5
@@ -374,17 +374,15 @@ mlxsw_sp_port_vlan_find_by_vid(const struct mlxsw_sp_port *mlxsw_sp_port, · 373 unmodified lines
374374 return NULL;
375375 }
376376
377−static inline void
377+static inline u32
378378 mlxsw_sp_port_headroom_8x_adjust(const struct mlxsw_sp_port *mlxsw_sp_port,
379− u16 *p_size)
379+ u32 size_cells)
380380 {
381381 /* Ports with eight lanes use two headroom buffers between which the
382382 * configured headroom size is split. Therefore, multiply the calculated
383383 * headroom size by two.
384384 */
385− if (mlxsw_sp_port->mapping.width != 8)
386− return;
387− *p_size *= 2;
385+ return mlxsw_sp_port->mapping.width == 8 ? 2 * size_cells : size_cells;
388386 }
389387
390388 enum mlxsw_sp_flood_type {
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c+1−1
@@ -312,7 +312,7 @@ static int mlxsw_sp_port_pb_init(struct mlxsw_sp_port *mlxsw_sp_port) · 311 unmodified lines
312312
313313 if (i == MLXSW_SP_PB_UNUSED)
314314 continue;
315− mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, &size);
315+ size = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, size);
316316 mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl, i, size);
317317 }
318318 mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+1−1
@@ -6262,7 +6262,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, · 6261 unmodified lines
62626262 }
62636263
62646264 fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);
6265− if (WARN_ON(!fib_work))
6265+ if (!fib_work)
62666266 return NOTIFY_BAD;
62676267
62686268 fib_work->mlxsw_sp = router->mlxsw_sp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+1−1
@@ -782,7 +782,7 @@ mlxsw_sp_span_port_buffer_update(struct mlxsw_sp_port *mlxsw_sp_port, u16 mtu) · 781 unmodified lines
782782 speed = 0;
783783
784784 buffsize = mlxsw_sp_span_buffsize_get(mlxsw_sp, speed, mtu);
785− mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, (u16 *) &buffsize);
785+ buffsize = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, buffsize);
786786 mlxsw_reg_sbib_pack(sbib_pl, mlxsw_sp_port->local_port, buffsize);
787787 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbib), sbib_pl);
788788 }
drivers/net/ethernet/neterion/vxge/vxge-config.h+1−1
@@ -297,7 +297,7 @@ struct vxge_hw_fifo_config { · 296 unmodified lines
297297 * @greedy_return: If Set it forces the device to return absolutely all RxD
298298 * that are consumed and still on board when a timer interrupt
299299 * triggers. If Clear, then if the device has already returned
300− * RxD before current timer interrupt trigerred and after the
300+ * RxD before current timer interrupt triggered and after the
301301 * previous timer interrupt triggered, then the device is not
302302 * forced to returned the rest of the consumed RxD that it has
303303 * on board which account for a byte count less than the one
drivers/net/ethernet/netronome/nfp/flower/main.c+1−1
@@ -861,7 +861,7 @@ static void nfp_flower_clean(struct nfp_app *app) · 860 unmodified lines
861861 flush_work(&app_priv->cmsg_work);
862862
863863 flow_indr_dev_unregister(nfp_flower_indr_setup_tc_cb, app,
864− nfp_flower_setup_indr_block_cb);
864+ nfp_flower_setup_indr_tc_release);
865865
866866 if (app_priv->flower_ext_feats & NFP_FL_FEATS_VF_RLIM)
867867 nfp_flower_qos_cleanup(app);
drivers/net/ethernet/netronome/nfp/flower/main.h+4−3
@@ -459,9 +459,10 @@ int nfp_flower_setup_qos_offload(struct nfp_app *app, struct net_device *netdev, · 458 unmodified lines
459459 struct tc_cls_matchall_offload *flow);
460460 void nfp_flower_stats_rlim_reply(struct nfp_app *app, struct sk_buff *skb);
461461 int nfp_flower_indr_setup_tc_cb(struct net_device *netdev, void *cb_priv,
462− enum tc_setup_type type, void *type_data);
463−int nfp_flower_setup_indr_block_cb(enum tc_setup_type type, void *type_data,
464− void *cb_priv);
462+ enum tc_setup_type type, void *type_data,
463+ void *data,
464+ void (*cleanup)(struct flow_block_cb *block_cb));
465+void nfp_flower_setup_indr_tc_release(void *cb_priv);
465466
466467 void
467468 __nfp_flower_non_repr_priv_get(struct nfp_flower_non_repr_priv *non_repr_priv);
drivers/net/ethernet/netronome/nfp/flower/offload.c+14−10
@@ -1619,8 +1619,8 @@ nfp_flower_indr_block_cb_priv_lookup(struct nfp_app *app, · 1618 unmodified lines
16191619 return NULL;
16201620 }
16211621
1622−int nfp_flower_setup_indr_block_cb(enum tc_setup_type type,
1623− void *type_data, void *cb_priv)
1622+static int nfp_flower_setup_indr_block_cb(enum tc_setup_type type,
1623+ void *type_data, void *cb_priv)
16241624 {
16251625 struct nfp_flower_indr_block_cb_priv *priv = cb_priv;
16261626 struct flow_cls_offload *flower = type_data;
@@ -1637,7 +1637,7 @@ int nfp_flower_setup_indr_block_cb(enum tc_setup_type type, · 10 unmodified lines
16371637 }
16381638 }
16391639
1640−static void nfp_flower_setup_indr_tc_release(void *cb_priv)
1640+void nfp_flower_setup_indr_tc_release(void *cb_priv)
16411641 {
16421642 struct nfp_flower_indr_block_cb_priv *priv = cb_priv;
16431643
@@ -1647,7 +1647,8 @@ static void nfp_flower_setup_indr_tc_release(void *cb_priv) · 3 unmodified lines
16471647
16481648 static int
16491649 nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
1650− struct flow_block_offload *f)
1650+ struct flow_block_offload *f, void *data,
1651+ void (*cleanup)(struct flow_block_cb *block_cb))
16511652 {
16521653 struct nfp_flower_indr_block_cb_priv *cb_priv;
16531654 struct nfp_flower_priv *priv = app->priv;
@@ -1676,9 +1677,10 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app, · 22 unmodified lines
16761677 cb_priv->app = app;
16771678 list_add(&cb_priv->list, &priv->indr_block_cb_priv);
16781679
1679− block_cb = flow_block_cb_alloc(nfp_flower_setup_indr_block_cb,
1680− cb_priv, cb_priv,
1681− nfp_flower_setup_indr_tc_release);
1680+ block_cb = flow_indr_block_cb_alloc(nfp_flower_setup_indr_block_cb,
1681+ cb_priv, cb_priv,
1682+ nfp_flower_setup_indr_tc_release,
1683+ f, netdev, data, app, cleanup);
16821684 if (IS_ERR(block_cb)) {
16831685 list_del(&cb_priv->list);
16841686 kfree(cb_priv);
@@ -1699,7 +1701,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app, · 14 unmodified lines
16991701 if (!block_cb)
17001702 return -ENOENT;
17011703
1702− flow_block_cb_remove(block_cb, f);
1704+ flow_indr_block_cb_remove(block_cb, f);
17031705 list_del(&block_cb->driver_list);
17041706 return 0;
17051707 default:
@@ -1710,7 +1712,9 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app, · 4 unmodified lines
17101712
17111713 int
17121714 nfp_flower_indr_setup_tc_cb(struct net_device *netdev, void *cb_priv,
1713− enum tc_setup_type type, void *type_data)
1715+ enum tc_setup_type type, void *type_data,
1716+ void *data,
1717+ void (*cleanup)(struct flow_block_cb *block_cb))
17141718 {
17151719 if (!nfp_fl_is_netdev_to_offload(netdev))
17161720 return -EOPNOTSUPP;
@@ -1718,7 +1722,7 @@ nfp_flower_indr_setup_tc_cb(struct net_device *netdev, void *cb_priv, · 1 unmodified line
17181722 switch (type) {
17191723 case TC_SETUP_BLOCK:
17201724 return nfp_flower_setup_indr_tc_block(netdev, cb_priv,
1721− type_data);
1725+ type_data, data, cleanup);
17221726 default:
17231727 return -EOPNOTSUPP;
17241728 }
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h+1−1
@@ -147,7 +147,7 @@ struct pch_gbe_regs { · 146 unmodified lines
147147 #define PCH_GBE_RH_ALM_FULL_8 0x00001000 /* 8 words */
148148 #define PCH_GBE_RH_ALM_FULL_16 0x00002000 /* 16 words */
149149 #define PCH_GBE_RH_ALM_FULL_32 0x00003000 /* 32 words */
150−/* RX FIFO Read Triger Threshold */
150+/* RX FIFO Read Trigger Threshold */
151151 #define PCH_GBE_RH_RD_TRG_4 0x00000000 /* 4 words */
152152 #define PCH_GBE_RH_RD_TRG_8 0x00000200 /* 8 words */
153153 #define PCH_GBE_RH_RD_TRG_16 0x00000400 /* 16 words */
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c+17−35
@@ -468,12 +468,18 @@ static void ionic_get_ringparam(struct net_device *netdev, · 467 unmodified lines
468468 ring->rx_pending = lif->nrxq_descs;
469469 }
470470
471+static void ionic_set_ringsize(struct ionic_lif *lif, void *arg)
472+{
473+ struct ethtool_ringparam *ring = arg;
474+
475+ lif->ntxq_descs = ring->tx_pending;
476+ lif->nrxq_descs = ring->rx_pending;
477+}
478+
471479 static int ionic_set_ringparam(struct net_device *netdev,
472480 struct ethtool_ringparam *ring)
473481 {
474482 struct ionic_lif *lif = netdev_priv(netdev);
475− bool running;
476− int err;
477483
478484 if (ring->rx_mini_pending || ring->rx_jumbo_pending) {
479485 netdev_info(netdev, "Changing jumbo or mini descriptors not supported\n");
@@ -491,22 +497,7 @@ static int ionic_set_ringparam(struct net_device *netdev, · 11 unmodified lines
491497 ring->rx_pending == lif->nrxq_descs)
492498 return 0;
493499
494− err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
495− if (err)
496− return err;
497−
498− running = test_bit(IONIC_LIF_F_UP, lif->state);
499− if (running)
500− ionic_stop(netdev);
501−
502− lif->ntxq_descs = ring->tx_pending;
503− lif->nrxq_descs = ring->rx_pending;
504−
505− if (running)
506− ionic_open(netdev);

50 more lines aren’t shown here.

drivers/net/ethernet/pensando/ionic/ionic_lif.c+30−12

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

drivers/net/ethernet/pensando/ionic/ionic_lif.h+3−1

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

drivers/net/ethernet/qlogic/qed/qed.h+2−0

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

drivers/net/ethernet/qlogic/qed/qed_cxt.c+20−1

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

drivers/net/ethernet/qlogic/qed/qed_debug.c+18−2

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

drivers/net/ethernet/qlogic/qed/qed_dev.c+11−12

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

drivers/net/ethernet/qlogic/qed/qed_iwarp.c+0−2

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

drivers/net/ethernet/qlogic/qed/qed_mcp.c+7−0

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

drivers/net/ethernet/qlogic/qed/qed_mcp.h+7−0

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

drivers/net/ethernet/qlogic/qed/qed_roce.c+0−1

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

drivers/net/ethernet/qlogic/qed/qed_vf.c+18−5

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

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

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

drivers/net/ethernet/qlogic/qede/qede_ptp.c+13−18

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

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

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

drivers/net/ethernet/qlogic/qede/qede_rdma.c+2−1

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

drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c+13−5

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

drivers/net/ethernet/realtek/r8169_main.c+4−1

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

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

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

drivers/net/geneve.c+1−0

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

drivers/net/ipa/gsi.c+7−9

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

drivers/net/ipa/ipa_cmd.c+15−0

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

drivers/net/ipa/ipa_cmd.h+8−0

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

drivers/net/ipa/ipa_data-sdm845.c+0−1

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

drivers/net/ipa/ipa_endpoint.c+2−0

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

drivers/net/ipa/ipa_gsi.c+1−0

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

drivers/net/ipa/ipa_gsi.h+2−0

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

drivers/net/ipa/ipa_qmi_msg.c+3−3

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

drivers/net/macsec.c+2−3

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

drivers/net/macvlan.c+2−3

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

drivers/net/phy/Kconfig+1−2

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

drivers/net/phy/mscc/mscc_macsec.c+9−31

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

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

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

drivers/net/phy/phy_device.c+8−2

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

drivers/net/phy/phylink.c+32−13

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

drivers/net/phy/smsc.c+7−4

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

drivers/net/tun.c+2−0

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

drivers/net/usb/ax88179_178a.c+6−5

This diff is large: its 26 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/usb/smsc95xx.c+9−2

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

drivers/net/vxlan.c+4−0

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

drivers/net/wan/lapbether.c+8−1

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

drivers/net/wireguard/device.c+28−31

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

drivers/net/wireguard/device.h+1−2

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

drivers/net/wireguard/netlink.c+9−5

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

drivers/net/wireguard/noise.c+2−2

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

drivers/net/wireguard/queueing.h+2−17

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

drivers/net/wireguard/receive.c+3−9

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

drivers/net/wireguard/socket.c+18−7

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

drivers/net/wireless/ath/wil6210/txrx.c+11−28

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

drivers/nvdimm/security.c+1−1

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

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

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

drivers/nvme/host/multipath.c+33−20

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

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

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

drivers/nvme/host/pci.c+4−2

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

drivers/nvme/host/rdma.c+1−1

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

drivers/nvme/host/tcp.c+2−2

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

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

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

drivers/of/of_mdio.c+7−2

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

drivers/opp/of.c+4−0

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

drivers/pci/controller/vmd.c+3−2

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

drivers/perf/arm-cci.c+1−0

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

drivers/perf/arm-ccn.c+1−0

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

drivers/perf/arm_dsu_pmu.c+1−0

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

drivers/perf/arm_smmuv3_pmu.c+2−0

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

drivers/perf/arm_spe_pmu.c+1−0

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

drivers/perf/fsl_imx8_ddr_perf.c+2−0

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

drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c+2−0

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

drivers/perf/hisilicon/hisi_uncore_hha_pmu.c+2−0

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

drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c+2−0

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

drivers/perf/qcom_l2_pmu.c+1−0

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

drivers/perf/qcom_l3_pmu.c+1−0

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

drivers/perf/thunderx2_pmu.c+1−0

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

drivers/perf/xgene_pmu.c+1−0

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

drivers/phy/allwinner/phy-sun4i-usb.c+3−2

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

drivers/phy/intel/phy-intel-combo.c+8−6

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

drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c+2−2

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

drivers/phy/ti/phy-am654-serdes.c+1−1

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

drivers/phy/ti/phy-j721e-wiz.c+5−5

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

drivers/pinctrl/intel/pinctrl-baytrail.c+53−14

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

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

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

drivers/platform/x86/asus-wmi.c+1−0

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

drivers/platform/x86/intel_speed_select_if/isst_if_common.h+3−0

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

drivers/platform/x86/intel_speed_select_if/isst_if_mbox_pci.c+1−0

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

drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c+1−0

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

drivers/platform/x86/thinkpad_acpi.c+11−3

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

drivers/regulator/Kconfig+1−1

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

drivers/regulator/Makefile+1−1

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

drivers/regulator/da903x-regulator.crenamed from drivers/regulator/da903x.c+0−0

File renamed without changes.

drivers/regulator/da9063-regulator.c+0−1

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

drivers/regulator/helpers.c+1−1

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

drivers/regulator/pfuze100-regulator.c+39−21

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

drivers/regulator/qcom_smd-regulator.c+1−1

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

drivers/s390/cio/vfio_ccw_chp.c+1−0

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

drivers/s390/net/qeth_core_main.c+5−6

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

drivers/s390/scsi/zfcp_erp.c+11−2

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

drivers/scsi/libfc/fc_rport.c+8−5

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

drivers/scsi/libiscsi.c+1−1

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

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

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

drivers/scsi/megaraid/megaraid_sas_fusion.c+0−2

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

drivers/scsi/mpt3sas/mpt3sas_ctl.c+7−5

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

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

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

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

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

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

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

drivers/scsi/scsi_devinfo.c+1−0

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

drivers/scsi/scsi_dh.c+1−0

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

drivers/scsi/scsi_transport_iscsi.c+1−1

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

drivers/scsi/scsi_transport_spi.c+1−1

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

drivers/soc/amlogic/meson-gx-socinfo.c+5−3

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

drivers/soc/imx/soc-imx.c+3−0

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

drivers/soc/imx/soc-imx8m.c+7−3

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

drivers/soc/ti/omap_prm.c+4−4

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

drivers/soundwire/intel.c+3−2

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

drivers/spi/spi-fsl-dspi.c+26−21

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

drivers/spi/spi-mt65xx.c+8−7

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

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

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

drivers/spi/spi-rspi.c+21−7

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

drivers/spi/spi-sprd-adi.c+1−1

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

drivers/spi/spi-stm32-qspi.c+26−20

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

drivers/spi/spi-sun6i.c+6−8

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

drivers/spi/spidev.c+12−12

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

drivers/staging/comedi/drivers/addi_apci_1500.c+7−3

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

drivers/staging/rtl8723bs/core/rtw_wlan_util.c+3−1

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

drivers/staging/wfx/hif_tx.c+4−2

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

drivers/staging/wfx/hif_tx.h+1−1

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

drivers/staging/wfx/queue.c+9−12

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

drivers/staging/wfx/scan.c+3−3

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

drivers/thermal/cpufreq_cooling.c+3−3

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

drivers/thermal/imx_thermal.c+4−3

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

drivers/thermal/intel/int340x_thermal/int3400_thermal.c+6−1

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

drivers/thermal/intel/int340x_thermal/int3403_thermal.c+1−1

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

drivers/thermal/mtk_thermal.c+6−5

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

drivers/thermal/qcom/tsens.c+5−5

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

drivers/thermal/rcar_gen3_thermal.c+1−1

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

drivers/thermal/sprd_thermal.c+2−2

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

drivers/thunderbolt/tunnel.c+6−6

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

drivers/tty/serial/cpm_uart/cpm_uart_core.c+8−1

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

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

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

drivers/tty/serial/kgdboc.c+16−16

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

drivers/tty/serial/mxs-auart.c+8−4

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

drivers/tty/serial/serial_core.c+17−98

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

drivers/tty/serial/sh-sci.c+3−0

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

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

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

drivers/uio/uio_pdrv_genirq.c+2−2

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

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

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

drivers/usb/cdns3/ep0.c+21−19

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

drivers/usb/cdns3/trace.h+4−4

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

drivers/usb/chipidea/core.c+24−0

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

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

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

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

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

drivers/usb/dwc2/gadget.c+0−6

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

drivers/usb/dwc2/platform.c+13−1

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

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

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

drivers/usb/dwc3/dwc3-pci.c+11−1

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

drivers/usb/early/ehci-dbgp.c+2−1

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

drivers/usb/gadget/function/f_uac1_legacy.c+2−0

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

drivers/usb/gadget/udc/atmel_usba_udc.c+2−8

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

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

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

drivers/usb/gadget/udc/mv_udc_core.c+2−1

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

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

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

drivers/usb/host/ehci-exynos.c+2−3

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

drivers/usb/host/ehci-pci.c+7−0

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

drivers/usb/host/ohci-sm501.c+1−0

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

drivers/usb/host/xhci-mtk.c+3−2

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

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

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

drivers/usb/host/xhci.h+1−1

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

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

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

drivers/usb/phy/phy-tegra-usb.c+1−5

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

drivers/usb/renesas_usbhs/fifo.c+13−10

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

drivers/usb/renesas_usbhs/fifo.h+1−1

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

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

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

drivers/usb/serial/cypress_m8.c+2−0

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

drivers/usb/serial/cypress_m8.h+3−0

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

drivers/usb/serial/iuu_phoenix.c+5−3

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

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

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

drivers/usb/typec/mux/intel_pmc_mux.c+11−2

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

drivers/usb/typec/tcpm/tcpci_rt1711h.c+10−21

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

drivers/vdpa/vdpa.c+1−1

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

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

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

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

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

drivers/vhost/test.c+57−0

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

drivers/vhost/test.h+1−0

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

drivers/vhost/vdpa.c+1−1

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

drivers/video/fbdev/core/fbcon.c+2−1

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

drivers/video/fbdev/uvesafb.c+1−1

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

drivers/virt/vboxguest/vboxguest_core.c+4−2

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

drivers/virt/vboxguest/vboxguest_core.h+15−0

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

drivers/virt/vboxguest/vboxguest_linux.c+2−1

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

drivers/virt/vboxguest/vmmdev.h+2−0

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

drivers/virtio/virtio_mem.c+23−4

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

drivers/xen/xenbus/xenbus_client.c+82−89

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

fs/afs/cell.c+9−0

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

fs/afs/fs_operation.c+2−2

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

fs/afs/internal.h+1−1

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

fs/afs/write.c+1−0

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

fs/autofs/waitq.c+1−1

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

fs/btrfs/block-group.c+27−17

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

fs/btrfs/ctree.c+1−1

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

fs/btrfs/ctree.h+2−0

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

fs/btrfs/discard.c+1−0

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

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

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

fs/btrfs/extent_io.c+24−16

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

fs/btrfs/file.c+38−9

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

fs/btrfs/inode.c+31−17

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

fs/btrfs/ioctl.c+1−1

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

fs/btrfs/ref-verify.c+1−1

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

fs/btrfs/space-info.c+1−1

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

fs/btrfs/super.c+3−3

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

fs/btrfs/tree-log.c+5−0

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

fs/btrfs/volumes.h+1−1

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

fs/cachefiles/rdwr.c+1−1

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

fs/cifs/cifs_debug.c+5−1

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

fs/cifs/cifsfs.h+1−1

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

fs/cifs/connect.c+6−4

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

fs/cifs/file.c+13−17

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

fs/cifs/inode.c+17−2

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

fs/cifs/ioctl.c+8−1

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

fs/cifs/misc.c+7−9

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

fs/cifs/smb2misc.c+6−2

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

fs/cifs/smb2ops.c+13−1

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

fs/cifs/transport.c+1−1

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

fs/efivarfs/file.c+3−4

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

fs/erofs/zdata.h+10−10

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

fs/exfat/dir.c+7−5

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

fs/exfat/exfat_fs.h+1−0

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

fs/exfat/file.c+18−1

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

fs/exfat/namei.c+11−3

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

fs/exfat/super.c+10−0

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

fs/fuse/file.c+78−54

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

fs/fuse/inode.c+16−3

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

fs/gfs2/aops.c+1−44

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

fs/gfs2/file.c+50−2

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

fs/gfs2/glock.c+4−1

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

fs/gfs2/glops.c+6−4

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

fs/gfs2/incore.h+0−1

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

fs/gfs2/inode.c+2−1

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

fs/gfs2/log.c+19−6

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

fs/gfs2/log.h+2−2

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

fs/gfs2/main.c+1−0

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

fs/gfs2/ops_fstype.c+12−1

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

fs/gfs2/recovery.c+2−2

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

fs/gfs2/super.c+10−10

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

fs/io_uring.c+85−24

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

fs/namespace.c+1−0

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

fs/nfs/flexfilelayout/flexfilelayout.c+7−4

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

fs/nfs/nfs4namespace.c+1−0

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

fs/nfs/nfs4proc.c+18−2

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

fs/nfsd/nfs4state.c+7−1

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

fs/nfsd/nfsctl.c+13−10

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

fs/nfsd/nfsd.h+3−0

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

fs/nfsd/vfs.c+6−0

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

fs/ocfs2/dlmglue.c+16−1

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

fs/ocfs2/ocfs2.h+1−0

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

fs/ocfs2/ocfs2_fs.h+2−2

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

fs/ocfs2/suballoc.c+6−3

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

fs/overlayfs/copy_up.c+1−1

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

fs/overlayfs/export.c+1−1

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

fs/overlayfs/file.c+6−4

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

fs/overlayfs/namei.c+6−9

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

fs/overlayfs/overlayfs.h+0−1

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

fs/overlayfs/super.c+49−24

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

fs/proc/proc_sysctl.c+3−3

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

fs/read_write.c+75−56

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

fs/xfs/xfs_log_cil.c+5−5

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

fs/xfs/xfs_log_priv.h+1−1

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

include/asm-generic/cacheflush.h+5−0

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

include/asm-generic/mmiowb.h+4−2

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

include/crypto/if_alg.h+2−2

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

include/linux/atomic-fallback.h+235−1

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

include/linux/bits.h+1−2

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

include/linux/blkdev.h+1−0

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

include/linux/bpf-netns.h+3−2

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

include/linux/bpf.h+11−2

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

include/linux/btf.h+5−0

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

include/linux/cgroup-defs.h+6−2

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

include/linux/cgroup.h+3−1

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

include/linux/compiler-clang.h+8−0

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

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

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

include/linux/compiler.h+1−1

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

include/linux/compiler_attributes.h+1−0

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

include/linux/compiler_types.h+7−34

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

include/linux/device.h+3−2

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

include/linux/dma-buf.h+1−0

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

include/linux/dma-direct.h+2−2

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

include/linux/dma-mapping.h+5−0

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

include/linux/efi.h+3−5

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

include/linux/filter.h+2−2

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

include/linux/fs.h+2−1

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

include/linux/fs_context.h+1−0

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

include/linux/host1x.h+3−0

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

include/linux/ieee80211.h+4−0

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

include/linux/if_vlan.h+22−7

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

include/linux/input/elan-i2c-ids.h+7−0

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

include/linux/intel-iommu.h+1−0

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

include/linux/irq_work.h+8−18

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

include/linux/kallsyms.h+3−2

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

include/linux/kgdb.h+14−3

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

include/linux/libata.h+1−1

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

include/linux/lsm_hook_defs.h+2−2

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

include/linux/mlx5/driver.h+1−0

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

include/linux/mlx5/mlx5_ifc.h+34−4

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

include/linux/mmzone.h+2−2

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

include/linux/mod_devicetable.h+1−1

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

include/linux/netdevice.h+1−1

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

include/linux/netfilter_ipv4/ip_tables.h+6−0

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

include/linux/netfilter_ipv6/ip6_tables.h+3−0

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

include/linux/pci.h+5−6

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

include/linux/phy.h+1−0

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

include/linux/qed/qed_chain.h+16−10

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

include/linux/scatterlist.h+4−4

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

include/linux/sched.h+1−6

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

include/linux/sched/jobctl.h+3−1

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

include/linux/serial_core.h+98−4

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

include/linux/skmsg.h+13−0

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

include/linux/smp.h+8−15

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

include/linux/smp_types.h+66−0

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

include/linux/swap.h+1−0

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

include/linux/syscalls.h+1−1

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

include/linux/task_work.h+4−1

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

include/linux/timekeeping.h+7−7

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

include/linux/tpm_eventlog.h+13−1

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

include/linux/vmalloc.h+0−1

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

include/net/dst.h+9−1

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

include/net/flow_dissector.h+2−1

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

include/net/flow_offload.h+19−2

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

include/net/genetlink.h+0−10

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

include/net/gue.h+1−1

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

include/net/inet_ecn.h+17−8

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

include/net/ip_tunnels.h+3−0

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

include/net/netns/bpf.h+5−2

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

include/net/pkt_sched.h+0−11

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

include/net/sctp/constants.h+5−3

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

include/net/sock.h+2−2

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

include/net/xfrm.h+1−0

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

include/net/xsk_buff_pool.h+3−3

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

include/sound/compress_driver.h+9−1

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

include/sound/dmaengine_pcm.h+11−0

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

include/sound/soc.h+6−0

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

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

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

include/uapi/linux/bpf.h+22−21

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

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

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

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

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

include/uapi/linux/input-event-codes.h+2−1

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

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

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

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

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

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

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

include/uapi/linux/spi/spidev.h+4−0

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

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

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

include/uapi/linux/vfio.h+1−1

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

init/Kconfig+4−4

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

kernel/bpf/btf.c+2−2

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

kernel/bpf/cgroup.c+33−20

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

kernel/bpf/devmap.c+6−4

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

kernel/bpf/net_namespace.c+134−60

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

kernel/bpf/reuseport_array.c+10−4

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

kernel/bpf/ringbuf.c+8−10

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

kernel/bpf/syscall.c+24−21

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

kernel/bpf/verifier.c+10−3

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

kernel/cgroup/cgroup.c+19−12

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

kernel/debug/debug_core.c+4−0

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

kernel/debug/gdbstub.c+13−0

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

kernel/debug/kdb/kdb_io.c+43−29

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

kernel/dma/Kconfig+2−1

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

kernel/dma/direct.c+41−26

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

kernel/dma/mapping.c+10−0

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

kernel/dma/pool.c+56−31

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

kernel/dma/remap.c+3−2

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

kernel/fork.c+1−1

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

kernel/irq/manage.c+35−2

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

kernel/kallsyms.c+11−6

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

kernel/kexec_file.c+6−28

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

kernel/kprobes.c+2−2

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

kernel/module.c+30−25

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

kernel/nsproxy.c+1−1

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

kernel/padata.c+2−2

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

kernel/printk/printk.c+0−10

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

kernel/rcu/rcuperf.c+1−1

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

kernel/rcu/tree.c+25−7

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

kernel/sched/core.c+87−26

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

kernel/sched/deadline.c+1−0

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

kernel/sched/fair.c+14−3

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

kernel/sched/idle.c+11−4

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

kernel/sched/sched.h+1−1

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

kernel/signal.c+7−3

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

kernel/smp.c+0−18

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

kernel/task_work.c+14−2

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

kernel/time/timer.c+16−5

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

kernel/trace/bpf_trace.c+1−1

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

kernel/trace/ring_buffer.c+1−1

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

kernel/trace/trace_boot.c+7−3

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

kernel/trace/trace_events_trigger.c+19−2

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

lib/Kconfig.kasan+4−0

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

lib/Kconfig.kgdb+5−0

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

lib/packing.c+1−0

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

lib/test_hmm.c+1−2

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

mm/cma.c+2−2

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

mm/compaction.c+14−3

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

mm/debug_vm_pgtable.c+2−2

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

mm/filemap.c+21−2

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

mm/hugetlb.c+1−1

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

mm/memcontrol.c+13−5

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

mm/memory.c+22−11

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

mm/memory_hotplug.c+11−2

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

mm/migrate.c+1−12

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

mm/mremap.c+21−2

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

mm/nommu.c+0−17

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

mm/page_alloc.c+1−1

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

mm/slab.h+2−2

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

mm/slab_common.c+1−1

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

mm/slub.c+4−15

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

mm/swap.c+1−2

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

mm/swap_state.c+2−2

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

mm/vmalloc.c+0−21

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

mm/vmscan.c+3−0

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

mm/workingset.c+27−19

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

net/8021q/vlan_dev.c+4−5

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

net/9p/mod.c+1−0

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

net/bpf/test_run.c+18−1

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

net/bpfilter/bpfilter_kern.c+1−1

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

net/bridge/br_mrp.c+9−3

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

net/bridge/br_multicast.c+1−1

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

net/bridge/br_private.h+2−2

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

net/bridge/br_private_mrp.h+1−1

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

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

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

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

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

net/core/dev.c+9−0

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

net/core/dev_addr_lists.c+10−0

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

net/core/drop_monitor.c+1−0

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

net/core/filter.c+7−3

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

net/core/flow_dissector.c+12−20

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

net/core/flow_offload.c+26−21

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

net/core/skmsg.c+15−8

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

net/core/sock.c+4−2

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

net/core/sock_map.c+48−5

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

net/core/sysctl_net_core.c+1−1

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

net/core/xdp.c+1−0

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

net/dsa/tag_edsa.c+34−3

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

net/ethtool/cabletest.c+9−8

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

net/ethtool/common.c+2−0

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

net/ethtool/ioctl.c+1−1

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

net/ethtool/linkstate.c+5−6

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

net/ethtool/netlink.c+13−14

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

net/hsr/hsr_device.c+8−24

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

net/hsr/hsr_device.h+1−1

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

net/hsr/hsr_main.c+6−3

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

net/hsr/hsr_netlink.c+17−0

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

net/ipv4/Kconfig+18−16

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

net/ipv4/esp4_offload.c+1−0

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

net/ipv4/fib_semantics.c+1−1

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

net/ipv4/fou.c+1−0

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

net/ipv4/icmp.c+2−2

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

net/ipv4/ip_output.c+1−1

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

net/ipv4/ip_tunnel.c+8−6

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

net/ipv4/ip_tunnel_core.c+18−0

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

net/ipv4/ip_vti.c+1−0

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

net/ipv4/ipip.c+1−0

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

net/ipv4/netfilter/ip_tables.c+14−1

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

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

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

net/ipv4/netfilter/iptable_filter.c+9−1

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

net/ipv4/netfilter/iptable_mangle.c+9−1

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

net/ipv4/netfilter/iptable_nat.c+8−2

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

net/ipv4/netfilter/iptable_raw.c+9−1

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

net/ipv4/netfilter/iptable_security.c+9−2

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

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

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

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

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

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

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

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

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

net/ipv4/ping.c+3−0

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

net/ipv4/route.c+1−1

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

net/ipv4/tcp.c+10−7

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

net/ipv4/tcp_cong.c+1−1

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

net/ipv4/tcp_cubic.c+2−3

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

net/ipv4/tcp_input.c+13−3

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

net/ipv4/tcp_ipv4.c+16−4

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

net/ipv4/tcp_output.c+5−3

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

net/ipv6/Kconfig+18−16

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

net/ipv6/esp6_offload.c+1−0

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

net/ipv6/fou6.c+1−0

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

net/ipv6/icmp.c+2−2

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

net/ipv6/ila/ila_main.c+1−0

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

net/ipv6/ip6_gre.c+6−3

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

net/ipv6/ip6_tunnel.c+1−0

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

net/ipv6/ip6_vti.c+1−0

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

net/ipv6/netfilter/ip6_tables.c+14−1

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

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

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

net/ipv6/netfilter/ip6table_filter.c+9−1

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

net/ipv6/netfilter/ip6table_mangle.c+9−1

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

net/ipv6/netfilter/ip6table_nat.c+8−2

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

net/ipv6/netfilter/ip6table_raw.c+9−1

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

net/ipv6/netfilter/ip6table_security.c+9−1

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

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

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

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

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

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

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

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

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

net/ipv6/route.c+5−2

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

net/ipv6/sit.c+1−0

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

net/l2tp/l2tp_core.c+1−4

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

net/llc/af_llc.c+7−3

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

net/mac80211/mesh_hwmp.c+2−5

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

net/mac80211/rx.c+26−0

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

net/mac80211/status.c+15−7

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

net/mac80211/tx.c+6−2

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

net/mptcp/options.c+3−5

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

net/mptcp/protocol.h+1−0

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

net/mptcp/subflow.c+27−30

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

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

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

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

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

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

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

net/netfilter/ipset/ip_set_core.c+2−0

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

net/netfilter/ipset/ip_set_hash_gen.h+2−2

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

net/netfilter/nf_conntrack_core.c+2−0

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

net/netfilter/nf_dup_netdev.c+1−0

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

net/netfilter/nf_flow_table_core.c+1−0

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

net/netfilter/nf_flow_table_inet.c+1−0

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

net/netfilter/nf_flow_table_offload.c+1−0

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

net/netfilter/nf_synproxy_core.c+1−0

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

net/netfilter/nf_tables_offload.c+1−0

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

net/netfilter/nfnetlink.c+1−0

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

net/netfilter/nft_compat.c+1−0

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

net/netfilter/nft_connlimit.c+1−0

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

net/netfilter/nft_counter.c+1−0

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

net/netfilter/nft_ct.c+1−0

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

net/netfilter/nft_dup_netdev.c+1−0

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

net/netfilter/nft_fib_inet.c+1−0

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

net/netfilter/nft_fib_netdev.c+1−0

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

net/netfilter/nft_flow_offload.c+1−0

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

net/netfilter/nft_hash.c+1−0

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

net/netfilter/nft_limit.c+1−0

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

net/netfilter/nft_log.c+1−0

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

net/netfilter/nft_masq.c+1−0

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

net/netfilter/nft_nat.c+1−0

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

net/netfilter/nft_numgen.c+1−0

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

net/netfilter/nft_objref.c+1−0

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

net/netfilter/nft_osf.c+1−0

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

net/netfilter/nft_queue.c+1−0

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

net/netfilter/nft_quota.c+1−0

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

net/netfilter/nft_redir.c+1−0

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

net/netfilter/nft_reject.c+1−0

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

net/netfilter/nft_reject_inet.c+1−0

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

net/netfilter/nft_synproxy.c+1−0

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

net/netfilter/nft_tunnel.c+1−0

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

net/netfilter/xt_nat.c+1−0

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

net/netlink/genetlink.c+13−84

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

net/openvswitch/actions.c+7−2

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

net/qrtr/qrtr.c+8−2

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

net/rds/connection.c+11−0

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

net/rds/rds.h+7−0

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

net/rds/send.c+2−1

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

net/rds/transport.c+17−9

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

net/rxrpc/call_accept.c+7−0

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

net/rxrpc/call_event.c+1−1

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

net/rxrpc/input.c+3−4

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

net/sched/act_connmark.c+6−3

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

net/sched/act_csum.c+1−1

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

net/sched/act_ct.c+6−5

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

net/sched/act_ctinfo.c+6−3

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

net/sched/act_gate.c+68−58

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

net/sched/act_mpls.c+1−1

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

net/sched/act_skbedit.c+1−1

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

net/sched/cls_api.c+16−11

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

net/sched/cls_flow.c+4−4

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

net/sched/cls_flower.c+1−1

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

net/sched/em_ipset.c+1−1

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

net/sched/em_ipt.c+1−1

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

net/sched/em_meta.c+1−1

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

net/sched/sch_atm.c+4−4

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

net/sched/sch_cake.c+43−19

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

net/sched/sch_dsmark.c+3−3

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

net/sched/sch_fq.c+1−0

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

net/sched/sch_fq_codel.c+1−0

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

net/sched/sch_hhf.c+1−0

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

net/sched/sch_teql.c+1−1

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

net/sctp/associola.c+4−1

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

net/sctp/bind_addr.c+1−0

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

net/sctp/protocol.c+2−1

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

net/smc/smc_clc.c+32−13

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

net/smc/smc_clc.h+2−0

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

net/smc/smc_core.c+29−22

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

net/smc/smc_core.h+3−1

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

net/smc/smc_ib.c+6−5

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

net/smc/smc_ib.h+2−1

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

net/smc/smc_ism.c+6−5

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

net/smc/smc_ism.h+2−1

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

net/smc/smc_llc.c+56−35

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

net/smc/smc_pnet.c+19−18

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

net/smc/smc_wr.c+6−4

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

net/sunrpc/rpc_pipe.c+1−0

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

net/sunrpc/svcsock.c+1−0

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

net/sunrpc/xdr.c+4−0

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

net/sunrpc/xprtrdma/frwr_ops.c+4−4

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

net/sunrpc/xprtrdma/rpc_rdma.c+5−8

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

net/sunrpc/xprtrdma/transport.c+6−1

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

net/sunrpc/xprtrdma/verbs.c+58−48

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

net/sunrpc/xprtrdma/xprt_rdma.h+2−1

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

net/tipc/link.c+18−8

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

net/wireless/nl80211.c+3−2

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

net/xdp/xsk_buff_pool.c+4−50

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

net/xfrm/Kconfig+24−0

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

net/xfrm/xfrm_device.c+3−1

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

net/xfrm/xfrm_interface.c+2−0

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

net/xfrm/xfrm_output.c+0−4

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

samples/bpf/xdp_monitor_user.c+2−6

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

samples/bpf/xdp_redirect_cpu_user.c+2−5

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

samples/bpf/xdp_rxq_info_user.c+3−10

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

samples/vfs/test-statx.c+2−0

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

scripts/Makefile.extrawarn+2−0

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

scripts/Makefile.lib+6−1

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

scripts/atomic/gen-atomic-fallback.sh+31−0

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

scripts/dtc/checks.c+36−3

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

scripts/dtc/dtc.h+31−0

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

scripts/dtc/flattree.c+1−1

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

scripts/dtc/libfdt/fdt_rw.c+1−1

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

scripts/dtc/libfdt/fdt_sw.c+1−1

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

scripts/dtc/libfdt/libfdt.h+8−0

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

scripts/dtc/treesource.c+4−4

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

scripts/dtc/version_gen.h+1−1

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

scripts/dtc/yamltree.c+3−3

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

scripts/gcc-plugins/Kconfig+1−1

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

scripts/kconfig/qconf.cc+106−67

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

scripts/kconfig/qconf.h+15−8

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

security/integrity/iint.c+1−13

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

security/integrity/ima/ima.h+1−1

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

security/integrity/ima/ima_crypto.c+14−1

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

security/security.c+16−1

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

sound/core/compress_offload.c+4−0

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

sound/drivers/opl3/opl3_synth.c+2−0

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

sound/hda/intel-dsp-config.c+1−3

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

sound/pci/hda/hda_auto_parser.c+6−0

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

sound/pci/hda/hda_intel.c+8−0

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

sound/pci/hda/patch_hdmi.c+31−15

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

sound/pci/hda/patch_realtek.c+65−4

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

sound/soc/amd/raven/acp3x-pcm-dma.c+23−7

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

sound/soc/amd/renoir/Makefile+4−3

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

sound/soc/codecs/hdac_hda.c+10−6

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

sound/soc/codecs/max98390.c+3−3

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

sound/soc/codecs/rt1015.c+75−49

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

sound/soc/codecs/rt1015.h+14−1

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

sound/soc/codecs/rt5682.c+14−6

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

sound/soc/fsl/fsl_asrc_common.h+2−0

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

sound/soc/fsl/fsl_asrc_dma.c+33−14

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

sound/soc/fsl/fsl_mqs.c+14−9

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

sound/soc/fsl/fsl_ssi.c+9−4

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

sound/soc/intel/boards/Kconfig+2−2

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

sound/soc/qcom/common.c+12−2

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

sound/soc/qcom/qdsp6/q6afe.c+8−0

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

sound/soc/qcom/qdsp6/q6afe.h+1−0

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

sound/soc/qcom/qdsp6/q6asm.c+4−3

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

sound/soc/rockchip/rockchip_pdm.c+3−1

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

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

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

sound/soc/soc-devres.c+37−0

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

sound/soc/soc-generic-dmaengine-pcm.c+0−12

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

sound/soc/soc-pcm.c+3−3

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

sound/soc/soc-topology.c+1−2

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

sound/soc/sof/intel/Kconfig+8−21

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

sound/soc/sof/intel/hda-stream.c+7−2

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

sound/soc/sof/sof-pci-dev.c+14−10

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

sound/usb/card.h+3−3

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

sound/usb/endpoint.c+9−9

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

sound/usb/format.c+4−2

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

sound/usb/line6/capture.c+2−0

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

sound/usb/line6/driver.c+1−1

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

sound/usb/line6/playback.c+2−0

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

sound/usb/midi.c+12−5

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

sound/usb/mixer.c+11−4

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

sound/usb/mixer.h+7−2

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

sound/usb/mixer_quirks.c+2−1

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

sound/usb/pcm.c+3−0

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

sound/usb/quirks-table.h+52−0

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

sound/usb/quirks.c+10−0

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

tools/arch/x86/include/uapi/asm/kvm.h+3−2

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

tools/arch/x86/lib/memcpy_64.S+4−0

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

tools/bpf/bpftool/Documentation/bpftool-map.rst+1−1

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

tools/bpf/bpftool/map.c+2−1

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

tools/include/linux/bits.h+1−2

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

tools/include/uapi/linux/bpf.h+22−21

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

tools/lib/bpf/bpf.h+2−0

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

tools/lib/bpf/hashmap.h+8−4

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

tools/lib/bpf/libbpf.c+8−2

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

tools/lib/subcmd/parse-options.c+3−0

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

tools/lib/traceevent/kbuffer-parse.c+37−6

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

tools/lib/traceevent/kbuffer.h+2−0

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

tools/objtool/arch.h+2−0

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

tools/objtool/arch/x86/decode.c+18−0

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

tools/objtool/arch/x86/include/arch_elf.h+6−0

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

tools/objtool/check.c+50−3

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

tools/objtool/elf.c+50−3

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

tools/objtool/elf.h+9−3

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

tools/objtool/orc_gen.c+1−1

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

tools/perf/arch/x86/util/intel-pt.c+1−0

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

tools/perf/builtin-record.c+9−9

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

tools/perf/builtin-script.c+1−1

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

tools/perf/scripts/python/export-to-postgresql.py+1−1

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

tools/perf/scripts/python/exported-sql-viewer.py+9−2

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

tools/perf/scripts/python/flamegraph.py+5−3

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

tools/perf/ui/browsers/hists.c+29−7

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

tools/perf/util/evlist.c+12−0

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

tools/perf/util/evlist.h+1−0

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

tools/perf/util/evsel.c+3−9

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

tools/perf/util/evsel.h+6−0

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

tools/perf/util/hashmap.h+8−4

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

tools/perf/util/intel-pt.c+3−2

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

tools/spi/spidev_test.c+5−5

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

tools/testing/kunit/kunit.py+3−1

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

tools/testing/kunit/kunit_config.py+1−1

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

tools/testing/kunit/kunit_parser.py+4−4

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

tools/testing/kunit/kunit_tool_test.py+11−0

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

tools/testing/kunit/test_data/test_insufficient_memory.log+0−0

Empty file added.

tools/testing/selftests/arm64/signal/Makefile+0−4

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

tools/testing/selftests/bpf/prog_tests/fentry_fexit.c+1−1

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

tools/testing/selftests/bpf/prog_tests/flow_dissector.c+2−2

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

tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach.c+34−10

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

tools/testing/selftests/bpf/prog_tests/sockopt_sk.c+39−7

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

tools/testing/selftests/bpf/progs/bpf_cubic.c+2−3

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

tools/testing/selftests/bpf/progs/bpf_iter_netlink.c+1−1

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

tools/testing/selftests/bpf/progs/fentry_test.c+22−0

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

tools/testing/selftests/bpf/progs/fexit_test.c+22−0

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

tools/testing/selftests/bpf/progs/sockopt_sk.c+52−2

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

tools/testing/selftests/bpf/progs/test_sockmap_kern.h+7−1

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

tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c+1−1

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

tools/testing/selftests/bpf/test_maps.c+6−6

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

tools/testing/selftests/bpf/test_sockmap.c+18−0

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

tools/testing/selftests/kmod/kmod.sh+36−0

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

tools/testing/selftests/kselftest.h+1−1

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

tools/testing/selftests/net/fib_nexthops.sh+13−0

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

tools/testing/selftests/net/so_txtime.c+26−7

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

tools/testing/selftests/netfilter/Makefile+1−1

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

tools/testing/selftests/netfilter/nft_conntrack_helper.sh+175−0

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

tools/testing/selftests/pidfd/pidfd.h+5−0

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

tools/testing/selftests/pidfd/pidfd_getfd_test.c+0−5

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

tools/testing/selftests/pidfd/pidfd_setns_test.c+12−0

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

tools/testing/selftests/powerpc/nx-gzip/gunz_test.c+2−2

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

tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c+2−2

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

tools/testing/selftests/powerpc/pmu/ebb/Makefile+1−1

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

tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json+2−2

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

tools/testing/selftests/tc-testing/tc-tests/actions/csum.json+2−2

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

tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json+10−10

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

tools/testing/selftests/tpm2/test_smoke.sh+4−9

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

tools/testing/selftests/tpm2/test_space.sh+3−3

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

tools/testing/selftests/tpm2/tpm2.py+29−27

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

tools/testing/selftests/tpm2/tpm2_tests.py+20−19

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

tools/testing/selftests/wireguard/netns.sh+12−1

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

tools/testing/selftests/x86/Makefile+2−2

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

tools/testing/selftests/x86/helpers.h+41−0

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

tools/testing/selftests/x86/single_step_syscall.c+2−15

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

tools/testing/selftests/x86/syscall_arg_fault.c+1−20

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

tools/testing/selftests/x86/syscall_nt.c+28−19

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

tools/testing/selftests/x86/test_vsyscall.c+2−13

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

tools/testing/selftests/x86/unwind_vdso.c+2−21

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

tools/virtio/linux/kernel.h+1−6

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

tools/virtio/linux/virtio.h+2−3

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

tools/virtio/virtio_test.c+119−20

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

tools/virtio/vringh_test.c+2−0

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

virt/kvm/kvm_main.c+2−1

This diff is large: its 10 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