History

Merge branch 'sched/urgent'

Peter Zijlstra committed 6 years ago

Commit faa2fd72 parents 01e377c ce3614d1250 files · +11132 −6391Browse files

Unified · Split

1250 files
  1. .gitignore +3 −0
  2. Documentation/ABI/testing/dev-kmsg +0 −5
  3. Documentation/ABI/testing/sysfs-bus-papr-pmem +27 −0
  4. Documentation/ABI/testing/sysfs-platform-chipidea-usb-otg +4 −4
  5. Documentation/admin-guide/cgroup-v2.rst +2 −2
  6. Documentation/admin-guide/device-mapper/index.rst +1 −0
  7. Documentation/admin-guide/mm/transhuge.rst +1 −2
  8. Documentation/arm64/silicon-errata.rst +8 −0
  9. Documentation/arm64/sve.rst +3 −3
  10. Documentation/bpf/prog_cgroup_sockopt.rst +14 −0
  11. Documentation/core-api/pin_user_pages.rst +1 −1
  12. Documentation/dev-tools/kcsan.rst +0 −6
  13. Documentation/dev-tools/kunit/faq.rst +40 −0
  14. Documentation/devicetree/bindings/Makefile +28 −10
  15. Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +1 −1
  16. Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml +2 −2
  17. Documentation/devicetree/bindings/clock/imx27-clock.yaml +1 −1
  18. Documentation/devicetree/bindings/clock/imx31-clock.yaml +1 −1
  19. Documentation/devicetree/bindings/clock/imx5-clock.yaml +1 −1
  20. Documentation/devicetree/bindings/display/bridge/sii902x.txt +1 −1
  21. Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt +2 −2
  22. Documentation/devicetree/bindings/display/imx/ldb.txt +2 −2
  23. Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.yaml +1 −1
  24. Documentation/devicetree/bindings/display/rockchip/rockchip-drm.yaml +1 −1
  25. Documentation/devicetree/bindings/gpio/mediatek,mt7621-gpio.txt +1 −1
  26. Documentation/devicetree/bindings/interrupt-controller/csky,mpintc.txt +1 −1
  27. Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt +1 −1
  28. Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.txt +1 −1
  29. Documentation/devicetree/bindings/net/mediatek-bluetooth.txt +1 −1
  30. Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +1 −1
  31. Documentation/devicetree/bindings/sound/audio-graph-card.txt +1 −1
  32. Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt +1 −1
  33. Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml +17 −9
  34. Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.txt +1 −1
  35. Documentation/devicetree/bindings/thermal/thermal-sensor.yaml +1 −1
  36. Documentation/devicetree/bindings/thermal/thermal-zones.yaml +1 −1
  37. Documentation/devicetree/bindings/thermal/ti,am654-thermal.yaml +1 −1
  38. Documentation/devicetree/bindings/timer/csky,mptimer.txt +1 −1
  39. Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml +2 −2
  40. Documentation/devicetree/writing-schema.rst +6 −3
  41. Documentation/driver-api/media/v4l2-subdev.rst +1 −1
  42. Documentation/filesystems/dax.txt +3 −3
  43. Documentation/filesystems/ext4/verity.rst +3 −0
  44. Documentation/gpu/amdgpu.rst +6 −3
  45. Documentation/i2c/slave-eeprom-backend.rst +17 −5
  46. Documentation/i2c/smbus-protocol.rst +1 −1
  47. Documentation/kbuild/modules.rst +4 −3
  48. Documentation/kbuild/reproducible-builds.rst +1 −1
  49. Documentation/mips/ingenic-tcu.rst +1 −1
  50. Documentation/networking/ieee802154.rst +2 −2
  51. Documentation/powerpc/papr_hcalls.rst +42 −4
  52. Documentation/sh/index.rst +0 −12
  53. Documentation/userspace-api/media/conf_nitpick.py +1 −1
  54. MAINTAINERS +34 −27
  55. Makefile +7 −15
  56. arch/arm/boot/dts/am335x-baltos.dtsi +1 −1
  57. arch/arm/boot/dts/am335x-boneblack-common.dtsi +1 −0
  58. arch/arm/boot/dts/am335x-boneblack-wireless.dts +0 −1
  59. arch/arm/boot/dts/am335x-boneblue.dts +0 −1
  60. arch/arm/boot/dts/am335x-bonegreen-wireless.dts +0 −1
  61. arch/arm/boot/dts/am335x-evm.dts +1 −2
  62. arch/arm/boot/dts/am335x-evmsk.dts +1 −1
  63. arch/arm/boot/dts/am335x-lxm.dts +1 −1
  64. arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi +1 −1
  65. arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts +1 −1
  66. arch/arm/boot/dts/am335x-pepper.dts +2 −2
  67. arch/arm/boot/dts/am335x-phycore-som.dtsi +1 −1
  68. arch/arm/boot/dts/am335x-pocketbeagle.dts +0 −1
  69. arch/arm/boot/dts/am33xx-l4.dtsi +2 −4
  70. arch/arm/boot/dts/am33xx.dtsi +4 −3
  71. arch/arm/boot/dts/am4372.dtsi +2 −1
  72. arch/arm/boot/dts/am437x-cm-t43.dts +1 −1
  73. arch/arm/boot/dts/am437x-gp-evm.dts +2 −18
  74. arch/arm/boot/dts/am437x-l4.dtsi +2 −3
  75. arch/arm/boot/dts/am437x-sk-evm.dts +1 −17
  76. arch/arm/boot/dts/am43x-epos-evm.dts +0 −16
  77. arch/arm/boot/dts/am5729-beagleboneai.dts +1 −1
  78. arch/arm/boot/dts/bcm-nsp.dtsi +6 −4
  79. arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +1 −0
  80. arch/arm/boot/dts/bcm958522er.dts +4 −0
  81. arch/arm/boot/dts/bcm958525er.dts +4 −0
  82. arch/arm/boot/dts/bcm958525xmc.dts +4 −0
  83. arch/arm/boot/dts/bcm958622hr.dts +4 −0
  84. arch/arm/boot/dts/bcm958623hr.dts +4 −0
  85. arch/arm/boot/dts/bcm958625hr.dts +4 −0
  86. arch/arm/boot/dts/bcm958625k.dts +4 −0
  87. arch/arm/boot/dts/dra7-evm-common.dtsi +0 −20
  88. arch/arm/boot/dts/dra7-l4.dtsi +16 −18
  89. arch/arm/boot/dts/imx6ul-kontron-n6x1x-s.dtsi +0 −13
  90. arch/arm/boot/dts/imx6ul-kontron-n6x1x-som-common.dtsi +13 −0
  91. arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +3 −1
  92. arch/arm/boot/dts/omap4-duovero-parlor.dts +1 −1
  93. arch/arm/boot/dts/omap4.dtsi +1 −1
  94. arch/arm/boot/dts/vexpress-v2m-rs1.dtsi +73 −73
  95. arch/arm/include/asm/efi.h +7 −0
  96. arch/arm/kernel/ftrace.c +2 −1
  97. arch/arm/kernel/kgdb.c +1 −1
  98. arch/arm/kernel/traps.c +1 −1
  99. arch/arm/mach-bcm/Kconfig +1 −0
  100. arch/arm/mach-imx/pm-imx5.c +4 −2
  101. arch/arm/mach-imx/pm-imx6.c +6 −4
  102. arch/arm/mach-omap2/omap_hwmod.c +1 −1
  103. arch/arm/mach-sti/board-dt.c +0 −9
  104. arch/arm/mm/alignment.c +2 −2
  105. arch/arm/xen/enlighten.c +0 −1
  106. arch/arm64/Kconfig +5 −3
  107. arch/arm64/Kconfig.debug +0 −15
  108. arch/arm64/Makefile +0 −6
  109. arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi +2 −2
  110. arch/arm64/boot/dts/freescale/imx8mm-evk.dts +2 −2
  111. arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts +2 −2
  112. arch/arm64/include/asm/alternative.h +8 −8
  113. arch/arm64/include/asm/cputype.h +2 −0
  114. arch/arm64/include/asm/linkage.h +0 −6
  115. arch/arm64/include/asm/mmu.h +3 −0
  116. arch/arm64/include/asm/pgtable.h +1 −1
  117. arch/arm64/kernel/Makefile +0 −2
  118. arch/arm64/kernel/cpu_errata.c +17 −6
  119. arch/arm64/kernel/cpufeature.c +4 −0
  120. arch/arm64/kernel/fpsimd.c +21 −10
  121. arch/arm64/kernel/hw_breakpoint.c +26 −18
  122. arch/arm64/kernel/insn.c +2 −2
  123. arch/arm64/kernel/machine_kexec_file.c +1 −2
  124. arch/arm64/kernel/perf_regs.c +22 −3
  125. arch/arm64/kernel/probes/kprobes.c +3 −9
  126. arch/arm64/kernel/signal32.c +1 −26
  127. arch/arm64/kernel/traps.c +2 −1
  128. arch/arm64/kernel/vdso.c +28 −33
  129. arch/arm64/kernel/vdso/Makefile +4 −3
  130. arch/arm64/kernel/vdso/sigreturn.S +34 −20
  131. arch/arm64/kernel/vdso32/Makefile +0 −1
  132. arch/arm64/kernel/vdso32/sigreturn.S +0 −58
  133. arch/arm64/kernel/vdso32/vdso.lds.S +0 −12
  134. arch/arm64/kernel/vmlinux.lds.S +0 −3
  135. arch/arm64/mm/init.c +10 −5
  136. arch/arm64/mm/mmu.c +1 −0
  137. arch/csky/kernel/ftrace.c +3 −2
  138. arch/ia64/include/asm/sections.h +1 −1
  139. arch/ia64/kernel/ftrace.c +3 −3
  140. arch/ia64/kernel/unwind_i.h +1 −1
  141. arch/m68k/kernel/setup_no.c +2 −1
  142. arch/m68k/mm/mcfmmu.c +1 −1
  143. arch/mips/boot/dts/ingenic/gcw0.dts +1 −1
  144. arch/mips/kernel/kprobes.c +3 −3
  145. arch/mips/kernel/traps.c +6 −3
  146. arch/mips/kvm/mips.c +2 −0
  147. arch/mips/lantiq/xway/sysctrl.c +4 −4
  148. arch/nds32/kernel/ftrace.c +3 −2
  149. arch/openrisc/kernel/dma.c +5 −0
  150. arch/parisc/kernel/ftrace.c +1 −1
  151. arch/parisc/kernel/kgdb.c +2 −2
  152. arch/parisc/kernel/process.c +1 −1
  153. arch/parisc/lib/memcpy.c +1 −1
  154. arch/powerpc/include/asm/nohash/32/pgtable.h +13 −5
  155. arch/powerpc/include/asm/sections.h +1 −1
  156. arch/powerpc/include/uapi/asm/papr_pdsm.h +132 −0
  157. arch/powerpc/kernel/exceptions-64s.S +2 −2
  158. arch/powerpc/kernel/kgdb.c +1 −1
  159. arch/powerpc/kernel/kprobes.c +1 −1
  160. arch/powerpc/kernel/module_64.c +4 −2
  161. arch/powerpc/kernel/process.c +14 −11
  162. arch/powerpc/kernel/trace/ftrace.c +2 −2
  163. arch/powerpc/kvm/book3s_64_mmu_radix.c +4 −3
  164. arch/powerpc/lib/inst.c +6 −6
  165. arch/powerpc/mm/book3s64/pkeys.c +0 −3
  166. arch/powerpc/mm/nohash/kaslr_booke.c +1 −0
  167. arch/powerpc/oprofile/backtrace.c +4 −2
  168. arch/powerpc/perf/callchain_32.c +1 −1
  169. arch/powerpc/perf/callchain_64.c +1 −1
  170. arch/powerpc/perf/core-book3s.c +4 −2
  171. arch/powerpc/platforms/cell/spu_callbacks.c +1 −1
  172. arch/powerpc/platforms/pseries/papr_scm.c +413 −7
  173. arch/powerpc/sysdev/fsl_pci.c +3 −3
  174. arch/riscv/include/asm/cmpxchg.h +4 −4
  175. arch/riscv/kernel/ftrace.c +2 −1
  176. arch/riscv/kernel/kgdb.c +4 −4
  177. arch/riscv/kernel/patch.c +2 −2
  178. arch/riscv/kernel/sys_riscv.c +6 −0
  179. arch/riscv/kernel/traps.c +2 −2
  180. arch/riscv/kernel/vdso/Makefile +4 −1
  181. arch/riscv/kernel/vdso/vgettimeofday.c +6 −0
  182. arch/riscv/mm/pageattr.c +12 −2
  183. arch/s390/Kconfig +1 −0
  184. arch/s390/crypto/prng.c +7 −7
  185. arch/s390/include/asm/syscall.h +11 −1
  186. arch/s390/include/asm/vdso.h +1 −0
  187. arch/s390/kernel/asm-offsets.c +1 −1
  188. arch/s390/kernel/debug.c +2 −1
  189. arch/s390/kernel/early.c +2 −0
  190. arch/s390/kernel/entry.S +2 −2
  191. arch/s390/kernel/ftrace.c +2 −2
  192. arch/s390/kernel/ipl.c +1 −1
  193. arch/s390/kernel/ptrace.c +69 −14
  194. arch/s390/kernel/time.c +1 −0
  195. arch/s390/kernel/uv.c +4 −4
  196. arch/s390/kernel/vdso64/Makefile +4 −6
  197. arch/s390/kernel/vdso64/clock_getres.S +5 −5
  198. arch/s390/mm/fault.c +1 −1
  199. arch/sh/kernel/ftrace.c +3 −3
  200. arch/sh/kernel/traps.c +1 −1
  201. arch/um/kernel/maccess.c +1 −1
  202. arch/x86/Kconfig +1 −1
  203. arch/x86/boot/compressed/head_64.S +10 −1
  204. arch/x86/entry/common.c +46 −3
  205. arch/x86/entry/entry_32.S +2 −3
  206. arch/x86/entry/entry_64_compat.S +16 −15
  207. arch/x86/events/Makefile +1 −1
  208. arch/x86/hyperv/hv_init.c +4 −1
  209. arch/x86/include/asm/bitops.h +1 −5
  210. arch/x86/include/asm/bug.h +6 −0
  211. arch/x86/include/asm/cpu.h +5 −0
  212. arch/x86/include/asm/cpumask.h +18 −0
  213. arch/x86/include/asm/fpu/internal.h +5 −0
  214. arch/x86/include/asm/idtentry.h +19 −28
  215. arch/x86/include/asm/kvm_host.h +2 −2
  216. arch/x86/include/asm/mwait.h +0 −2
  217. arch/x86/include/asm/pgtable_types.h +2 −0
  218. arch/x86/include/asm/processor.h +1 −1
  219. arch/x86/include/asm/ptrace.h +2 −2
  220. arch/x86/kernel/cpu/centaur.c +1 −0
  221. arch/x86/kernel/cpu/common.c +12 −12
  222. arch/x86/kernel/cpu/cpu.h +0 −4
  223. arch/x86/kernel/cpu/intel.c +10 −1
  224. arch/x86/kernel/cpu/mce/core.c +4 −2
  225. arch/x86/kernel/cpu/resctrl/core.c +4 −4
  226. arch/x86/kernel/cpu/resctrl/internal.h +1 −0
  227. arch/x86/kernel/cpu/resctrl/rdtgroup.c +1 −0
  228. arch/x86/kernel/cpu/umwait.c +0 −6
  229. arch/x86/kernel/cpu/zhaoxin.c +1 −0
  230. arch/x86/kernel/dumpstack.c +1 −1
  231. arch/x86/kernel/fpu/core.c +6 −0
  232. arch/x86/kernel/ftrace.c +5 −5
  233. arch/x86/kernel/kgdb.c +3 −3
  234. arch/x86/kernel/kprobes/core.c +6 −15
  235. arch/x86/kernel/kprobes/opt.c +1 −1
  236. arch/x86/kernel/ldt.c +25 −1
  237. arch/x86/kernel/nmi.c +1 −1
  238. arch/x86/kernel/probe_roms.c +12 −12
  239. arch/x86/kernel/traps.c +56 −39
  240. arch/x86/kvm/lapic.c +31 −19
  241. arch/x86/kvm/mmu.h +1 −1
  242. arch/x86/kvm/mmu/mmu.c +2 −2
  243. arch/x86/kvm/mmu/paging_tmpl.h +7 −9
  244. arch/x86/kvm/svm/svm.c +1 −1
  245. arch/x86/kvm/vmx/vmcs.h +20 −12
  246. arch/x86/kvm/vmx/vmx.c +4 −23
  247. arch/x86/kvm/vmx/vmx.h +0 −2
  248. arch/x86/kvm/x86.c +4 −3
  249. arch/x86/lib/memcpy_64.S +4 −0
  250. arch/x86/lib/usercopy_64.c +1 −0
  251. arch/x86/mm/fault.c +4 −4
  252. arch/x86/mm/init_32.c +1 −1
  253. arch/x86/mm/maccess.c +2 −2
  254. arch/x86/pci/pcbios.c +1 −1
  255. arch/x86/platform/intel-mid/sfi.c +2 −2
  256. arch/x86/power/cpu.c +6 −0
  257. arch/x86/purgatory/Makefile +1 −0
  258. arch/x86/xen/enlighten_pv.c +25 −5
  259. arch/x86/xen/xen-asm_64.S +18 −7
  260. block/bio-integrity.c +15 −9
  261. block/blk-mq-debugfs.c +3 −0
  262. block/blk-mq-tag.c +1 −1
  263. block/blk-mq.c +3 −1
  264. block/keyslot-manager.c +1 −2
  265. block/partitions/ldm.c +1 −1
  266. block/partitions/ldm.h +1 −1
  267. crypto/af_alg.c +11 −15
  268. crypto/algboss.c +0 −2
  269. crypto/algif_aead.c +3 −6
  270. crypto/algif_hash.c +3 −6
  271. crypto/algif_skcipher.c +4 −11
  272. crypto/drbg.c +4 −2
  273. drivers/acpi/acpi_configfs.c +5 −1
  274. drivers/acpi/dptf/dptf_power.c +1 −0
  275. drivers/acpi/fan.c +1 −1
  276. drivers/acpi/sysfs.c +2 −2
  277. drivers/amba/tegra-ahb.c +1 −1
  278. drivers/android/binder.c +7 −7
  279. drivers/ata/libata-core.c +5 −6
  280. drivers/ata/libata-scsi.c +6 −3
  281. drivers/ata/sata_rcar.c +7 −4
  282. drivers/base/power/trace.c +2 −2
  283. drivers/base/regmap/regmap.c +50 −56
  284. drivers/block/drbd/drbd_int.h +1 −1
  285. drivers/block/drbd/drbd_protocol.h +4 −4
  286. drivers/block/loop.c +4 −4
  287. drivers/block/rbd.c +3 −1
  288. drivers/block/virtio_blk.c +1 −0
  289. drivers/bus/ti-sysc.c +74 −24
  290. drivers/char/hw_random/ks-sa-rng.c +1 −0
  291. drivers/char/mem.c +1 −1
  292. drivers/char/tpm/st33zp24/i2c.c +1 −1
  293. drivers/char/tpm/st33zp24/spi.c +2 −2
  294. drivers/char/tpm/st33zp24/st33zp24.c +1 −1
  295. drivers/char/tpm/tpm-dev-common.c +9 −10
  296. drivers/char/tpm/tpm_ibmvtpm.c +7 −7
  297. drivers/char/tpm/tpm_tis.c +0 −1
  298. drivers/char/tpm/tpm_tis_core.c +1 −1
  299. drivers/char/tpm/tpm_tis_spi_main.c +5 −5
  300. drivers/clk/sifive/fu540-prci.c +4 −1
  301. drivers/cpufreq/intel_pstate.c +5 −2
  302. drivers/cpuidle/cpuidle.c +3 −2
  303. drivers/crypto/caam/Kconfig +1 −1
  304. drivers/crypto/caam/ctrl.c +9 −9
  305. drivers/crypto/caam/desc.h +2 −2
  306. drivers/crypto/caam/pdb.h +1 −1
  307. drivers/crypto/ccp/sev-dev.c +16 −7
  308. drivers/crypto/chelsio/chcr_crypto.h +4 −4
  309. drivers/crypto/hisilicon/sgl.c +2 −1
  310. drivers/crypto/marvell/octeontx/otx_cptvf_algs.c +7 −4
  311. drivers/dio/dio.c +4 −2
  312. drivers/dma-buf/dma-buf.c +25 −29
  313. drivers/dma/milbeaut-hdmac.c +1 −1
  314. drivers/dma/milbeaut-xdmac.c +1 −1
  315. drivers/dma/moxart-dma.c +1 −1
  316. drivers/dma/tegra20-apb-dma.c +1 −1
  317. drivers/dma/ti/edma.c +1 −1
  318. drivers/dma/ti/k3-udma.c +1 −1
  319. drivers/dma/timb_dma.c +1 −1
  320. drivers/edac/amd64_edac.c +2 −0
  321. drivers/firewire/core-cdev.c +1 −1
  322. drivers/firewire/core-transaction.c +1 −1
  323. drivers/firewire/core.h +1 −1
  324. drivers/firewire/nosy.c +1 −1
  325. drivers/firewire/ohci.c +1 −1
  326. drivers/firmware/dmi-sysfs.c +1 −1
  327. drivers/firmware/efi/Kconfig +11 −0
  328. drivers/firmware/efi/arm-init.c +36 −4
  329. drivers/firmware/efi/efi.c +3 −2
  330. drivers/firmware/efi/esrt.c +1 −1
  331. drivers/firmware/efi/libstub/Makefile +2 −1
  332. drivers/firmware/efi/libstub/arm32-stub.c +53 −1
  333. drivers/firmware/efi/libstub/efi-stub-helper.c +67 −11
  334. drivers/firmware/efi/libstub/efi-stub.c +3 −0
  335. drivers/firmware/efi/libstub/efistub.h +10 −2
  336. drivers/firmware/efi/libstub/file.c +12 −4
  337. drivers/firmware/efi/libstub/skip_spaces.c +1 −0
  338. drivers/firmware/google/memconsole-coreboot.c +1 −1
  339. drivers/firmware/google/vpd.c +1 −1
  340. drivers/firmware/iscsi_ibft.c +1 −1
  341. drivers/firmware/pcdp.h +1 −1
  342. drivers/firmware/raspberrypi.c +4 −1
  343. drivers/fpga/Kconfig +1 −1
  344. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +1 −0
  345. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +4 −4
  346. drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +5 −1
  347. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +2 −1
  348. drivers/gpu/drm/amd/amdkfd/kfd_process.c +1 −0
  349. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 −1
  350. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +3 −1
  351. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +4 −2
  352. drivers/gpu/drm/amd/display/dc/core/dc.c +6 −4
  353. drivers/gpu/drm/amd/display/dc/dsc/Makefile +0 −2
  354. drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +2 −16
  355. drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +145 −6
  356. drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h +4 −1
  357. drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c +2 −25
  358. drivers/gpu/drm/amd/display/modules/color/color_gamma.c +2 −2
  359. drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c +1 −1
  360. drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c +7 −4
  361. drivers/gpu/drm/drm_encoder_slave.c +5 −10
  362. drivers/gpu/drm/drm_fb_helper.c +49 −14
  363. drivers/gpu/drm/drm_panel_orientation_quirks.c +7 −7
  364. drivers/gpu/drm/exynos/exynos_drm_dma.c +2 −2
  365. drivers/gpu/drm/exynos/exynos_drm_g2d.c +0 −1
  366. drivers/gpu/drm/exynos/exynos_drm_mic.c +3 −1
  367. drivers/gpu/drm/i915/display/intel_ddi.c +7 −5
  368. drivers/gpu/drm/i915/display/intel_dp_mst.c +8 −0
  369. drivers/gpu/drm/i915/gt/intel_engine_cs.c +3 −1
  370. drivers/gpu/drm/i915/gt/intel_lrc.c +45 −7
  371. drivers/gpu/drm/i915/gt/intel_ring.c +4 −0
  372. drivers/gpu/drm/i915/gt/intel_workarounds.c +241 −0
  373. drivers/gpu/drm/i915/gt/selftest_hangcheck.c +10 −15
  374. drivers/gpu/drm/i915/gt/selftest_lrc.c +140 −45
  375. drivers/gpu/drm/i915/gt/selftest_mocs.c +16 −2
  376. drivers/gpu/drm/i915/gt/selftest_ring.c +110 −0
  377. drivers/gpu/drm/i915/gt/selftest_rps.c +28 −41
  378. drivers/gpu/drm/i915/gt/selftest_timeline.c +6 −9
  379. drivers/gpu/drm/i915/gt/selftest_workarounds.c +2 −0
  380. drivers/gpu/drm/i915/gt/shaders/README +46 −0
  381. drivers/gpu/drm/i915/gt/shaders/clear_kernel/hsw.asm +119 −0
  382. drivers/gpu/drm/i915/gt/shaders/clear_kernel/ivb.asm +117 −0
  383. drivers/gpu/drm/i915/gvt/debugfs.c +1 −1
  384. drivers/gpu/drm/i915/gvt/handlers.c +13 −11
  385. drivers/gpu/drm/i915/gvt/mmio_context.h +3 −3
  386. drivers/gpu/drm/i915/gvt/reg.h +5 −0
  387. drivers/gpu/drm/i915/i915_irq.c +1 −0
  388. drivers/gpu/drm/i915/i915_pmu.c +42 −42
  389. drivers/gpu/drm/i915/i915_priolist_types.h +1 −1
  390. drivers/gpu/drm/i915/i915_reg.h +1 −1
  391. drivers/gpu/drm/i915/intel_pm.c +2 −204
  392. drivers/gpu/drm/i915/selftests/i915_mock_selftests.h +1 −0
  393. drivers/gpu/drm/mcde/mcde_display.c +1 −1
  394. drivers/gpu/drm/mcde/mcde_drv.c +2 −1
  395. drivers/gpu/drm/msm/adreno/a2xx_gpu.c +1 −1
  396. drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 −1
  397. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 −1
  398. drivers/gpu/drm/msm/adreno/adreno_gpu.c +1 −1
  399. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +11 −7
  400. drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 −1
  401. drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +1 −1
  402. drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1 −1
  403. drivers/gpu/drm/msm/msm_submitqueue.c +3 −1
  404. drivers/gpu/drm/panel/panel-simple.c +2 −0
  405. drivers/gpu/drm/radeon/ni_dpm.c +1 −1
  406. drivers/gpu/drm/rcar-du/Kconfig +1 −0
  407. drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +2 −3
  408. drivers/gpu/drm/sun4i/sun8i_mixer.c +13 −0
  409. drivers/gpu/drm/tegra/dc.c +1 −0
  410. drivers/gpu/drm/tegra/hub.c +15 −2
  411. drivers/gpu/drm/ttm/ttm_bo.c +3 −1
  412. drivers/gpu/drm/ttm/ttm_bo_vm.c +2 −0
  413. drivers/gpu/host1x/bus.c +9 −0
  414. drivers/gpu/host1x/dev.c +9 −2
  415. drivers/hv/vmbus_drv.c +1 −1
  416. drivers/hwmon/acpi_power_meter.c +3 −1
  417. drivers/hwmon/bt1-pvt.c +6 −6
  418. drivers/hwmon/max6697.c +4 −3
  419. drivers/hwmon/pmbus/Kconfig +1 −1
  420. drivers/hwmon/pmbus/pmbus_core.c +4 −4
  421. drivers/hwtracing/stm/policy.c +1 −1
  422. drivers/hwtracing/stm/stm.h +2 −2
  423. drivers/i2c/Kconfig +7 −0
  424. drivers/i2c/algos/i2c-algo-pca.c +2 −1
  425. drivers/i2c/busses/i2c-designware-common.c +17 −8
  426. drivers/i2c/busses/i2c-designware-core.h +1 −2
  427. drivers/i2c/busses/i2c-designware-pcidrv.c +1 −1
  428. drivers/i2c/busses/i2c-designware-platdrv.c +15 −2
  429. drivers/i2c/busses/i2c-eg20t.c +1 −0
  430. drivers/i2c/busses/i2c-fsi.c +1 −1
  431. drivers/i2c/busses/i2c-mlxcpld.c +2 −2
  432. drivers/i2c/i2c-core-base.c +0 −25
  433. drivers/i2c/i2c-core-smbus.c +8 −1
  434. drivers/infiniband/core/cm.c +1 −0
  435. drivers/infiniband/core/cma.c +18 −0
  436. drivers/infiniband/core/counters.c +3 −1
  437. drivers/infiniband/core/mad.c +2 −1
  438. drivers/infiniband/core/rdma_core.c +21 −15
  439. drivers/infiniband/hw/efa/efa_verbs.c +1 −0
  440. drivers/infiniband/hw/hfi1/debugfs.c +2 −17
  441. drivers/infiniband/hw/hfi1/iowait.h +1 −1
  442. drivers/infiniband/hw/hfi1/ipoib.h +6 −0
  443. drivers/infiniband/hw/hfi1/ipoib_tx.c +66 −38
  444. drivers/infiniband/hw/hfi1/netdev_rx.c +1 −1
  445. drivers/infiniband/hw/hfi1/verbs_txreq.h +1 −1
  446. drivers/infiniband/hw/hns/hns_roce_device.h +4 −3
  447. drivers/infiniband/hw/hns/hns_roce_hw_v1.c +2 −2
  448. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +9 −8
  449. drivers/infiniband/hw/hns/hns_roce_mr.c +3 −2
  450. drivers/infiniband/hw/mlx5/qp.c +25 −25
  451. drivers/infiniband/hw/mlx5/qpc.c +8 −0
  452. drivers/infiniband/hw/qedr/qedr_iw_cm.c +11 −2
  453. drivers/infiniband/sw/rdmavt/qp.c +4 −2
  454. drivers/infiniband/sw/siw/siw_qp_rx.c +2 −1
  455. drivers/input/serio/hp_sdc.c +1 −1
  456. drivers/iommu/Kconfig +1 −1
  457. drivers/iommu/intel/dmar.c +2 −1
  458. drivers/iommu/intel/iommu.c +52 −7
  459. drivers/irqchip/Kconfig +1 −1
  460. drivers/irqchip/irq-gic-v3-its.c +4 −4
  461. drivers/irqchip/irq-gic.c +3 −11
  462. drivers/irqchip/irq-riscv-intc.c +1 −1
  463. drivers/md/bcache/btree.c +6 −2
  464. drivers/md/bcache/super.c +26 −9
  465. drivers/md/dm-ioctl.c +1 −1
  466. drivers/md/dm-writecache.c +8 −2
  467. drivers/md/dm-zoned-metadata.c +31 −11
  468. drivers/md/dm-zoned-reclaim.c +1 −3
  469. drivers/md/dm-zoned-target.c +1 −1
  470. drivers/md/dm.c +13 −0
  471. drivers/media/platform/omap3isp/isp.c +0 −2
  472. drivers/media/platform/omap3isp/ispvideo.c +0 −1
  473. drivers/media/usb/pwc/pwc.h +1 −1
  474. drivers/message/fusion/mptbase.c +20 −21
  475. drivers/message/fusion/mptscsih.c +1 −3
  476. drivers/mfd/mt6360-core.c +1 −0
  477. drivers/misc/habanalabs/command_submission.c +13 −0
  478. drivers/misc/habanalabs/debugfs.c +2 −2
  479. drivers/misc/habanalabs/gaudi/gaudi.c +35 −2
  480. drivers/misc/habanalabs/gaudi/gaudiP.h +3 −0
  481. drivers/misc/habanalabs/include/gaudi/gaudi_packets.h +3 −0
  482. drivers/misc/kgdbts.c +3 −3
  483. drivers/misc/mei/hw-me-regs.h +3 −0
  484. drivers/misc/mei/hw-me.c +64 −6
  485. drivers/misc/mei/hw-me.h +13 −4
  486. drivers/misc/mei/pci-me.c +9 −8
  487. drivers/net/bareudp.c +5 −0
  488. drivers/net/can/peak_canfd/peak_pciefd_main.c +2 −2
  489. drivers/net/dsa/bcm_sf2.c +2 −0
  490. drivers/net/dsa/sja1105/sja1105_ptp.c +4 −4
  491. drivers/net/dsa/sja1105/sja1105_vl.c +173 −166
  492. drivers/net/ethernet/atheros/alx/main.c +5 −4
  493. drivers/net/ethernet/broadcom/bnxt/bnxt.c +46 −25
  494. drivers/net/ethernet/broadcom/bnxt/bnxt.h +5 −0
  495. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +13 −8
  496. drivers/net/ethernet/broadcom/genet/bcmgenet.c +5 −83
  497. drivers/net/ethernet/broadcom/tg3.c +2 −2
  498. drivers/net/ethernet/cadence/macb_main.c +86 −51
  499. drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +4 −2
  500. drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h +3 −0
  501. drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +0 −1
  502. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +1 −1
  503. drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +16 −9
  504. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +6 −5
  505. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +2 −1
  506. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +10 −20
  507. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c +9 −9
  508. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h +82 −40
  509. drivers/net/ethernet/chelsio/cxgb4/l2t.c +25 −28
  510. drivers/net/ethernet/chelsio/cxgb4/sched.c +1 −1
  511. drivers/net/ethernet/chelsio/cxgb4/sge.c +24 −23
  512. drivers/net/ethernet/chelsio/cxgb4/smt.c +2 −0
  513. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +18 −18
  514. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 −2
  515. drivers/net/ethernet/chelsio/cxgb4vf/sge.c +4 −3
  516. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +3 −6
  517. drivers/net/ethernet/freescale/enetc/enetc.c +26 −0
  518. drivers/net/ethernet/freescale/enetc/enetc_hw.h +8 −8
  519. drivers/net/ethernet/freescale/enetc/enetc_pf.c +0 −8
  520. drivers/net/ethernet/hisilicon/hns/hns_enet.c +1 −1
  521. drivers/net/ethernet/ibm/ibmveth.c +1 −1
  522. drivers/net/ethernet/ibm/ibmvnic.c +24 −6
  523. drivers/net/ethernet/intel/e1000/e1000_main.c +13 −36
  524. drivers/net/ethernet/intel/e1000e/netdev.c +15 −15
  525. drivers/net/ethernet/intel/i40e/i40e_ethtool.c +3 −0
  526. drivers/net/ethernet/intel/i40e/i40e_main.c +19 −10
  527. drivers/net/ethernet/intel/ice/ice_lib.c +4 −4
  528. drivers/net/ethernet/intel/ice/ice_main.c +1 −1
  529. drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +6 −6
  530. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +11 −3
  531. drivers/net/ethernet/marvell/mvneta.c +53 −23
  532. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +7 −4
  533. drivers/net/ethernet/mediatek/mtk_star_emac.c +29 −89
  534. drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +16 −8
  535. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +2 −0
  536. drivers/net/ethernet/mellanox/mlxsw/spectrum.h +11 −0
  537. drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +1 −0
  538. drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +1 −0
  539. drivers/net/ethernet/microchip/lan743x_main.c +2 −0
  540. drivers/net/ethernet/neterion/vxge/vxge-config.h +1 −1
  541. drivers/net/ethernet/netronome/nfp/flower/main.c +1 −1
  542. drivers/net/ethernet/netronome/nfp/flower/main.h +4 −3
  543. drivers/net/ethernet/netronome/nfp/flower/offload.c +14 −10
  544. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +1 −1
  545. drivers/net/ethernet/pensando/ionic/ionic_lif.c +11 −8
  546. drivers/net/ethernet/qlogic/qed/qed_cxt.c +20 −1
  547. drivers/net/ethernet/qlogic/qed/qed_debug.c +2 −1
  548. drivers/net/ethernet/qlogic/qed/qed_dev.c +8 −3
  549. drivers/net/ethernet/qlogic/qed/qed_iwarp.c +0 −2
  550. drivers/net/ethernet/qlogic/qed/qed_roce.c +0 −1
  551. drivers/net/ethernet/qlogic/qed/qed_vf.c +18 −5
  552. drivers/net/ethernet/qlogic/qede/qede_main.c +2 −1
  553. drivers/net/ethernet/qlogic/qede/qede_ptp.c +13 −18
  554. drivers/net/ethernet/qlogic/qede/qede_ptp.h +1 −1
  555. drivers/net/ethernet/qlogic/qede/qede_rdma.c +2 −1
  556. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +17 −17
  557. drivers/net/ethernet/realtek/r8169_main.c +4 −1
  558. drivers/net/ethernet/rocker/rocker_main.c +2 −2
  559. drivers/net/ethernet/socionext/netsec.c +3 −2
  560. drivers/net/ethernet/xilinx/xilinx_axienet.h +1 −1
  561. drivers/net/geneve.c +1 −0
  562. drivers/net/phy/Kconfig +1 −2
  563. drivers/net/phy/mscc/mscc_macsec.c +9 −31
  564. drivers/net/phy/phy.c +1 −1
  565. drivers/net/phy/phy_device.c +8 −2
  566. drivers/net/phy/phylink.c +32 −13
  567. drivers/net/phy/smsc.c +7 −4
  568. drivers/net/usb/ax88179_178a.c +6 −5
  569. drivers/net/usb/smsc95xx.c +1 −1
  570. drivers/net/vxlan.c +4 −0
  571. drivers/net/wireguard/device.c +27 −31
  572. drivers/net/wireguard/device.h +1 −2
  573. drivers/net/wireguard/netlink.c +9 −5
  574. drivers/net/wireguard/noise.c +2 −2
  575. drivers/net/wireguard/receive.c +2 −8
  576. drivers/net/wireguard/socket.c +18 −7
  577. drivers/net/wireless/ath/wil6210/txrx.c +11 −28
  578. drivers/nvdimm/region_devs.c +2 −12
  579. drivers/nvme/host/core.c +10 −4
  580. drivers/nvme/host/multipath.c +33 −20
  581. drivers/nvme/host/nvme.h +2 −0
  582. drivers/nvme/host/pci.c +4 −2
  583. drivers/nvme/host/rdma.c +1 −1
  584. drivers/nvme/host/tcp.c +2 −2
  585. drivers/nvme/target/loop.c +2 −2
  586. drivers/of/of_mdio.c +7 −2
  587. drivers/oprofile/cpu_buffer.h +1 −1
  588. drivers/phy/samsung/phy-samsung-usb2.h +1 −1
  589. drivers/pinctrl/freescale/pinctrl-imx.c +3 −4
  590. drivers/pinctrl/pinctrl-mcp23s08_spi.c +1 −4
  591. drivers/pinctrl/pinctrl-single.c +1 −1
  592. drivers/pinctrl/qcom/pinctrl-ipq6018.c +2 −1
  593. drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +10 −11
  594. drivers/pinctrl/tegra/pinctrl-tegra.c +2 −2
  595. drivers/rapidio/rio-scan.c +1 −1
  596. drivers/regulator/Kconfig +1 −1
  597. drivers/regulator/da9063-regulator.c +0 −1
  598. drivers/regulator/helpers.c +1 −1
  599. drivers/regulator/pfuze100-regulator.c +39 −21
  600. drivers/s390/cio/qdio.h +3 −4
  601. drivers/s390/cio/qdio_debug.c +2 −2
  602. drivers/s390/cio/qdio_main.c +41 −60
  603. drivers/s390/crypto/zcrypt_ep11misc.c +1 −2
  604. drivers/s390/net/qeth_core_main.c +5 −6
  605. drivers/s390/scsi/zfcp_erp.c +11 −2
  606. drivers/s390/virtio/virtio_ccw.c +0 −26
  607. drivers/scsi/aic94xx/aic94xx_init.c +1 −0
  608. drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +1 −0
  609. drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +1 −0
  610. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 −0
  611. drivers/scsi/ipr.c +1 −0
  612. drivers/scsi/isci/init.c +1 −0
  613. drivers/scsi/libfc/fc_rport.c +8 −5
  614. drivers/scsi/lpfc/lpfc_init.c +2 −1
  615. drivers/scsi/mvsas/mv_init.c +1 −0
  616. drivers/scsi/pm8001/pm8001_init.c +1 −0
  617. drivers/scsi/qla2xxx/qla_gs.c +3 −1
  618. drivers/scsi/qla2xxx/qla_init.c +1 −1
  619. drivers/scsi/qla2xxx/qla_nvme.c +2 −1
  620. drivers/scsi/ufs/ufs_bsg.c +3 −1
  621. drivers/soc/imx/soc-imx8m.c +7 −3
  622. drivers/soc/ti/knav_qmss.h +1 −1
  623. drivers/soc/ti/omap_prm.c +4 −4
  624. drivers/spi/spi-fsl-dspi.c +26 −21
  625. drivers/spi/spi-pxa2xx.c +5 −0
  626. drivers/spi/spi-rspi.c +21 −7
  627. drivers/spi/spi-sprd-adi.c +1 −1
  628. drivers/spi/spi-stm32-qspi.c +26 −20
  629. drivers/spi/spidev.c +12 −12
  630. drivers/staging/rtl8723bs/core/rtw_wlan_util.c +3 −1
  631. drivers/staging/wfx/hif_tx.c +4 −2
  632. drivers/staging/wfx/hif_tx.h +1 −1
  633. drivers/staging/wfx/queue.c +9 −12
  634. drivers/staging/wfx/scan.c +3 −3
  635. drivers/thermal/cpufreq_cooling.c +3 −3
  636. drivers/thermal/imx_thermal.c +4 −3
  637. drivers/thermal/mtk_thermal.c +4 −1
  638. drivers/thermal/qcom/tsens.c +5 −5
  639. drivers/thermal/rcar_gen3_thermal.c +1 −1
  640. drivers/thermal/sprd_thermal.c +2 −2
  641. drivers/tty/serial/kgdb_nmi.c +1 −1
  642. drivers/tty/serial/kgdboc.c +16 −16
  643. drivers/usb/cdns3/ep0.c +6 −4
  644. drivers/usb/cdns3/trace.h +1 −1
  645. drivers/usb/class/cdc-acm.c +2 −0
  646. drivers/usb/core/quirks.c +2 −1
  647. drivers/usb/dwc2/gadget.c +0 −6
  648. drivers/usb/dwc2/platform.c +11 −0
  649. drivers/usb/dwc3/dwc3-exynos.c +0 −9
  650. drivers/usb/dwc3/dwc3-pci.c +3 −1
  651. drivers/usb/early/ehci-dbgp.c +2 −1
  652. drivers/usb/gadget/udc/mv_udc_core.c +2 −1
  653. drivers/usb/host/ehci-exynos.c +2 −3
  654. drivers/usb/host/ehci-pci.c +7 −0
  655. drivers/usb/host/ohci-sm501.c +1 −0
  656. drivers/usb/host/xhci-mtk.c +3 −2
  657. drivers/usb/host/xhci.c +8 −1
  658. drivers/usb/host/xhci.h +1 −1
  659. drivers/usb/misc/usbtest.c +1 −0
  660. drivers/usb/phy/phy-tegra-usb.c +1 −5
  661. drivers/usb/renesas_usbhs/fifo.c +13 −10
  662. drivers/usb/renesas_usbhs/fifo.h +1 −1
  663. drivers/usb/typec/mux/intel_pmc_mux.c +11 −2
  664. drivers/usb/typec/tcpm/tcpci_rt1711h.c +10 −21
  665. drivers/vdpa/vdpa.c +1 −1
  666. drivers/vfio/pci/vfio_pci.c +6 −2
  667. drivers/vfio/pci/vfio_pci_config.c +16 −1
  668. drivers/vhost/test.c +57 −0
  669. drivers/vhost/test.h +1 −0
  670. drivers/vhost/vdpa.c +1 −1
  671. drivers/video/backlight/tosa_lcd.c +2 −2
  672. drivers/video/fbdev/core/fbcon.c +2 −1
  673. drivers/video/fbdev/hpfb.c +1 −1
  674. drivers/video/fbdev/uvesafb.c +1 −1
  675. drivers/virtio/virtio_mem.c +23 −4
  676. drivers/w1/w1_netlink.h +2 −2
  677. drivers/xen/xenbus/xenbus_client.c +81 −86
  678. fs/afs/cell.c +9 −0
  679. fs/afs/dir.c +56 −8
  680. fs/afs/dir_silly.c +28 −10
  681. fs/afs/file.c +1 −1
  682. fs/afs/flock.c +1 −3
  683. fs/afs/fs_operation.c +9 −1
  684. fs/afs/fs_probe.c +10 −1
  685. fs/afs/inode.c +71 −20
  686. fs/afs/internal.h +25 −14
  687. fs/afs/main.c +3 −0
  688. fs/afs/misc.c +1 −0
  689. fs/afs/server.c +2 −1
  690. fs/afs/write.c +10 −2
  691. fs/afs/yfsclient.c +26 −67
  692. fs/aio.c +1 −1
  693. fs/block_dev.c +9 −8
  694. fs/btrfs/block-group.c +27 −17
  695. fs/btrfs/ctree.h +2 −0
  696. fs/btrfs/file.c +37 −9
  697. fs/btrfs/inode.c +30 −9
  698. fs/btrfs/ioctl.c +1 −1
  699. fs/btrfs/tree-log.c +5 −0
  700. fs/cifs/cifs_debug.c +5 −1
  701. fs/cifs/connect.c +6 −4
  702. fs/cifs/file.c +7 −4
  703. fs/cifs/inode.c +17 −2
  704. fs/cifs/misc.c +7 −9
  705. fs/cifs/smb2ops.c +12 −0
  706. fs/cifs/transport.c +1 −1
  707. fs/efivarfs/file.c +3 −4
  708. fs/erofs/zdata.h +10 −10
  709. fs/exfat/dir.c +7 −5
  710. fs/exfat/exfat_fs.h +1 −0
  711. fs/exfat/file.c +18 −1
  712. fs/exfat/namei.c +11 −3
  713. fs/exfat/super.c +10 −0
  714. fs/ext4/Makefile +2 −1
  715. fs/ext4/dir.c +16 −0
  716. fs/ext4/ext4.h +20 −7
  717. fs/ext4/extents.c +1 −1
  718. fs/ext4/ialloc.c +1 −1
  719. fs/ext4/inode.c +20 −6
  720. fs/ext4/ioctl.c +54 −11
  721. fs/ext4/mballoc.c +1 −1
  722. fs/ext4/super.c +89 −35
  723. fs/ext4/verity.c +4 −1
  724. fs/ext4/xattr.c +2 −0
  725. fs/ext4/xattr.h +1 −0
  726. fs/ext4/xattr_hurd.c +51 −0
  727. fs/gfs2/glock.c +4 −1
  728. fs/gfs2/glops.c +6 −4
  729. fs/gfs2/incore.h +0 −1
  730. fs/gfs2/inode.c +2 −1
  731. fs/gfs2/log.c +19 −6
  732. fs/gfs2/log.h +2 −2
  733. fs/gfs2/main.c +1 −0
  734. fs/gfs2/ops_fstype.c +12 −1
  735. fs/gfs2/recovery.c +2 −2
  736. fs/gfs2/super.c +10 −10
  737. fs/io-wq.c +56 −52
  738. fs/io-wq.h +1 −3
  739. fs/io_uring.c +167 −69
  740. fs/jbd2/journal.c +12 −5
  741. fs/jffs2/nodelist.h +1 −1
  742. fs/jffs2/summary.h +2 −2
  743. fs/nfs/direct.c +9 −4
  744. fs/nfs/file.c +1 −0
  745. fs/nfs/flexfilelayout/flexfilelayout.c +7 −4
  746. fs/nfs/nfs4namespace.c +1 −0
  747. fs/nfsd/nfs4state.c +7 −1
  748. fs/nfsd/nfsctl.c +13 −10
  749. fs/nfsd/nfsd.h +3 −0
  750. fs/nfsd/vfs.c +6 −0
  751. fs/ocfs2/dlmglue.c +16 −1
  752. fs/ocfs2/ocfs2.h +1 −0
  753. fs/ocfs2/ocfs2_fs.h +2 −2
  754. fs/ocfs2/suballoc.c +6 −3
  755. fs/proc/bootconfig.c +10 −5
  756. fs/proc/kcore.c +2 −1
  757. fs/proc/proc_sysctl.c +3 −3
  758. fs/squashfs/squashfs_fs.h +8 −8
  759. fs/xfs/xfs_log_cil.c +5 −5
  760. fs/xfs/xfs_log_priv.h +1 −1
  761. include/asm-generic/cacheflush.h +5 −0
  762. include/asm-generic/hugetlb.h +1 −1
  763. include/crypto/if_alg.h +2 −2
  764. include/drm/drm_displayid.h +1 −1
  765. include/keys/encrypted-type.h +1 −1
  766. include/keys/rxrpc-type.h +2 −2
  767. include/linux/atomic-fallback.h +235 −1
  768. include/linux/blkdev.h +1 −0
  769. include/linux/can/skb.h +1 −1
  770. include/linux/cb710.h +1 −1
  771. include/linux/ceph/libceph.h +2 −2
  772. include/linux/compiler-clang.h +8 −0
  773. include/linux/compiler-gcc.h +6 −0
  774. include/linux/compiler.h +1 −1
  775. include/linux/compiler_attributes.h +1 −0
  776. include/linux/compiler_types.h +10 −12
  777. include/linux/dma-direct.h +0 −2
  778. include/linux/dmaengine.h +2 −2
  779. include/linux/efi.h +3 −5
  780. include/linux/fs.h +0 −2
  781. include/linux/fscache-cache.h +1 −1
  782. include/linux/host1x.h +3 −0
  783. include/linux/i2c.h +3 −5
  784. include/linux/intel-iommu.h +1 −0
  785. include/linux/irq_work.h +8 −18
  786. include/linux/jbd2.h +5 −1
  787. include/linux/kexec.h +1 −1
  788. include/linux/kgdb.h +2 −3
  789. include/linux/kprobes.h +5 −1
  790. include/linux/kvm_host.h +1 −1
  791. include/linux/libata.h +8 −1
  792. include/linux/lsm_hook_defs.h +2 −2
  793. include/linux/mlx5/mlx5_ifc.h +6 −4
  794. include/linux/mmzone.h +2 −2
  795. include/linux/netdevice.h +1 −1
  796. include/linux/netfilter_ipv4/ip_tables.h +6 −0
  797. include/linux/netfilter_ipv6/ip6_tables.h +3 −0
  798. include/linux/overflow.h +21 −4
  799. include/linux/pci.h +5 −6
  800. include/linux/pgtable.h +7 −0
  801. include/linux/phy.h +1 −0
  802. include/linux/psp-sev.h +1 −1
  803. include/linux/qed/qed_chain.h +16 −10
  804. include/linux/sched.h +1 −6
  805. include/linux/sched/jobctl.h +3 −1
  806. include/linux/sctp.h +18 −18
  807. include/linux/smp.h +8 −15
  808. include/linux/smp_types.h +66 −0
  809. include/linux/swap.h +1 −0
  810. include/linux/syscalls.h +1 −1
  811. include/linux/task_work.h +4 −1
  812. include/linux/tifm.h +1 −1
  813. include/linux/timekeeping.h +7 −7
  814. include/linux/tpm_eventlog.h +13 −1
  815. include/linux/uaccess.h +13 −10
  816. include/linux/vmalloc.h +0 −1
  817. include/net/flow_offload.h +19 −2
  818. include/net/gue.h +1 −1
  819. include/net/netfilter/nf_flow_table.h +45 −4
  820. include/net/sctp/constants.h +5 −3
  821. include/net/sock.h +0 −1
  822. include/net/tc_act/tc_ct.h +10 −1
  823. include/net/xfrm.h +1 −0
  824. include/sound/dmaengine_pcm.h +11 −0
  825. include/sound/soc.h +6 −0
  826. include/trace/events/block.h +0 −1
  827. include/trace/events/rxrpc.h +1 −1
  828. include/uapi/linux/bpf.h +1 −1
  829. include/uapi/linux/fb.h +1 −0
  830. include/uapi/linux/fs.h +1 −0
  831. include/uapi/linux/mrp_bridge.h +0 −1
  832. include/uapi/linux/ndctl.h +1 −0
  833. include/uapi/linux/rds.h +3 −1
  834. include/uapi/linux/spi/spidev.h +4 −0
  835. include/uapi/linux/vfio.h +1 −1
  836. include/uapi/linux/xattr.h +4 −0
  837. init/Kconfig +4 −4
  838. kernel/bpf/cgroup.c +33 −20
  839. kernel/bpf/devmap.c +6 −4
  840. kernel/debug/debug_core.c +7 −3
  841. kernel/debug/gdbstub.c +3 −3
  842. kernel/debug/kdb/kdb_io.c +43 −29
  843. kernel/debug/kdb/kdb_main.c +2 −1
  844. kernel/debug/kdb/kdb_support.c +4 −3
  845. kernel/dma/Kconfig +6 −5
  846. kernel/dma/direct.c +34 −25
  847. kernel/dma/pool.c +3 −4
  848. kernel/dma/remap.c +3 −2
  849. kernel/fork.c +1 −1
  850. kernel/kexec_file.c +6 −28
  851. kernel/kprobes.c +48 −13
  852. kernel/kthread.c +1 −1
  853. kernel/module.c +3 −1
  854. kernel/nsproxy.c +1 −1
  855. kernel/padata.c +2 −2
  856. kernel/printk/printk.c +0 −10
  857. kernel/rcu/rcuperf.c +1 −1
  858. kernel/rcu/tree.c +25 −7
  859. kernel/sched/core.c +87 −26
  860. kernel/sched/deadline.c +1 −0
  861. kernel/sched/fair.c +1 −1
  862. kernel/sched/idle.c +11 −4
  863. kernel/sched/sched.h +1 −1
  864. kernel/signal.c +7 −3
  865. kernel/smp.c +0 −18
  866. kernel/task_work.c +14 −2
  867. kernel/trace/blktrace.c +20 −10
  868. kernel/trace/bpf_trace.c +5 −5
  869. kernel/trace/ftrace.c +10 −2
  870. kernel/trace/ring_buffer.c +1 −1
  871. kernel/trace/trace.c +1 −2
  872. kernel/trace/trace.h +3 −0
  873. kernel/trace/trace_boot.c +7 −3
  874. kernel/trace/trace_entries.h +7 −7
  875. kernel/trace/trace_events_trigger.c +19 −2
  876. kernel/trace/trace_export.c +16 −0
  877. kernel/trace/trace_functions.c +1 −1
  878. kernel/trace/trace_kprobe.c +3 −3
  879. kernel/trace/trace_probe.c +2 −2
  880. kernel/trace/trace_probe.h +1 −1
  881. kernel/workqueue.c +5 −5
  882. lib/Kconfig.debug +0 −1
  883. lib/Kconfig.kasan +4 −0
  884. lib/seq_buf.c +1 −0
  885. lib/test_hmm.c +1 −2
  886. lib/test_lockup.c +3 −3
  887. lib/test_objagg.c +2 −2
  888. mm/cma.c +2 −2
  889. mm/compaction.c +14 −3
  890. mm/debug.c +4 −4
  891. mm/debug_vm_pgtable.c +2 −2
  892. mm/gup.c +2 −2
  893. mm/hugetlb.c +1 −1
  894. mm/maccess.c +31 −30
  895. mm/memcontrol.c +13 −5
  896. mm/memory.c +22 −11
  897. mm/memory_hotplug.c +11 −2
  898. mm/nommu.c +0 −17
  899. mm/page_alloc.c +1 −1
  900. mm/rodata_test.c +1 −1
  901. mm/slab.h +2 −2
  902. mm/slab_common.c +1 −1
  903. mm/slub.c +5 −16
  904. mm/swap.c +1 −2
  905. mm/swap_state.c +2 −2
  906. mm/vmalloc.c +0 −21
  907. mm/vmscan.c +3 −0
  908. mm/workingset.c +27 −19
  909. net/9p/mod.c +1 −0
  910. net/bridge/br_mrp.c +8 −2
  911. net/bridge/br_private.h +1 −1
  912. net/bridge/netfilter/nft_meta_bridge.c +1 −0
  913. net/bridge/netfilter/nft_reject_bridge.c +1 −0
  914. net/ceph/ceph_common.c +6 −8
  915. net/ceph/osd_client.c +4 −5
  916. net/core/dev.c +9 −0
  917. net/core/drop_monitor.c +1 −0
  918. net/core/flow_offload.c +26 −21
  919. net/core/sock.c +3 −1
  920. net/core/xdp.c +1 −0
  921. net/dsa/tag_edsa.c +34 −3
  922. net/ethtool/cabletest.c +9 −8
  923. net/ethtool/common.c +2 −0
  924. net/ethtool/ioctl.c +1 −1
  925. net/ethtool/linkstate.c +5 −6
  926. net/hsr/hsr_device.c +1 −20
  927. net/hsr/hsr_device.h +1 −1
  928. net/hsr/hsr_main.c +6 −3
  929. net/hsr/hsr_netlink.c +17 −0
  930. net/ipv4/Kconfig +18 −16
  931. net/ipv4/esp4_offload.c +1 −0
  932. net/ipv4/fib_semantics.c +1 −1
  933. net/ipv4/fou.c +1 −0
  934. net/ipv4/ip_tunnel.c +8 −6
  935. net/ipv4/netfilter/ip_tables.c +14 −1
  936. net/ipv4/netfilter/ipt_SYNPROXY.c +1 −0
  937. net/ipv4/netfilter/iptable_filter.c +9 −1
  938. net/ipv4/netfilter/iptable_mangle.c +9 −1
  939. net/ipv4/netfilter/iptable_nat.c +8 −2
  940. net/ipv4/netfilter/iptable_raw.c +9 −1
  941. net/ipv4/netfilter/iptable_security.c +9 −2
  942. net/ipv4/netfilter/nf_flow_table_ipv4.c +1 −0
  943. net/ipv4/netfilter/nft_dup_ipv4.c +1 −0
  944. net/ipv4/netfilter/nft_fib_ipv4.c +1 −0
  945. net/ipv4/netfilter/nft_reject_ipv4.c +1 −0
  946. net/ipv4/tcp_cubic.c +2 −3
  947. net/ipv4/tcp_input.c +21 −5
  948. net/ipv6/Kconfig +18 −16
  949. net/ipv6/esp6_offload.c +1 −0
  950. net/ipv6/fou6.c +1 −0
  951. net/ipv6/ila/ila_main.c +1 −0
  952. net/ipv6/ip6_gre.c +6 −3
  953. net/ipv6/mcast.c +1 −0
  954. net/ipv6/netfilter/ip6_tables.c +14 −1
  955. net/ipv6/netfilter/ip6t_SYNPROXY.c +1 −0
  956. net/ipv6/netfilter/ip6table_filter.c +9 −1
  957. net/ipv6/netfilter/ip6table_mangle.c +9 −1
  958. net/ipv6/netfilter/ip6table_nat.c +8 −2
  959. net/ipv6/netfilter/ip6table_raw.c +9 −1
  960. net/ipv6/netfilter/ip6table_security.c +9 −1
  961. net/ipv6/netfilter/nf_flow_table_ipv6.c +1 −0
  962. net/ipv6/netfilter/nft_dup_ipv6.c +1 −0
  963. net/ipv6/netfilter/nft_fib_ipv6.c +1 −0
  964. net/ipv6/netfilter/nft_reject_ipv6.c +1 −0
  965. net/mptcp/options.c +0 −2
  966. net/mptcp/protocol.h +2 −6
  967. net/mptcp/subflow.c +30 −31
  968. net/netfilter/ipset/ip_set_core.c +2 −0
  969. net/netfilter/nf_conntrack_netlink.c +22 −10
  970. net/netfilter/nf_dup_netdev.c +1 −0
  971. net/netfilter/nf_flow_table_core.c +1 −45
  972. net/netfilter/nf_flow_table_inet.c +1 −0
  973. net/netfilter/nf_flow_table_offload.c +1 −0
  974. net/netfilter/nf_synproxy_core.c +1 −0
  975. net/netfilter/nf_tables_api.c +24 −7
  976. net/netfilter/nf_tables_offload.c +1 −0
  977. net/netfilter/nfnetlink.c +1 −0
  978. net/netfilter/nft_compat.c +1 −0
  979. net/netfilter/nft_connlimit.c +1 −0
  980. net/netfilter/nft_counter.c +1 −0
  981. net/netfilter/nft_ct.c +1 −0
  982. net/netfilter/nft_dup_netdev.c +1 −0
  983. net/netfilter/nft_fib_inet.c +1 −0
  984. net/netfilter/nft_fib_netdev.c +1 −0
  985. net/netfilter/nft_flow_offload.c +1 −0
  986. net/netfilter/nft_hash.c +1 −0
  987. net/netfilter/nft_limit.c +1 −0
  988. net/netfilter/nft_log.c +1 −0
  989. net/netfilter/nft_masq.c +1 −0
  990. net/netfilter/nft_nat.c +1 −0
  991. net/netfilter/nft_numgen.c +1 −0
  992. net/netfilter/nft_objref.c +1 −0
  993. net/netfilter/nft_osf.c +1 −0
  994. net/netfilter/nft_queue.c +1 −0
  995. net/netfilter/nft_quota.c +1 −0
  996. net/netfilter/nft_redir.c +1 −0
  997. net/netfilter/nft_reject.c +1 −0
  998. net/netfilter/nft_reject_inet.c +1 −0
  999. net/netfilter/nft_set_pipapo.c +5 −1
  1000. net/netfilter/nft_set_rbtree.c +14 −7
  1001. net/netfilter/nft_synproxy.c +1 −0
  1002. net/netfilter/nft_tunnel.c +1 −0
  1003. net/netfilter/xt_nat.c +1 −0
  1004. net/openvswitch/actions.c +7 −2
  1005. net/rds/ib.h +7 −1
  1006. net/rds/transport.c +17 −9
  1007. net/rxrpc/call_accept.c +7 −0
  1008. net/rxrpc/call_event.c +1 −1
  1009. net/rxrpc/input.c +3 −4
  1010. net/sched/act_ct.c +0 −11
  1011. net/sched/act_gate.c +68 −58
  1012. net/sched/cls_api.c +15 −10
  1013. net/sched/sch_cake.c +41 −17
  1014. net/sched/sch_fq.c +1 −0
  1015. net/sched/sch_fq_codel.c +1 −0
  1016. net/sched/sch_hhf.c +1 −0
  1017. net/sctp/associola.c +4 −1
  1018. net/sctp/bind_addr.c +1 −0
  1019. net/sctp/protocol.c +2 −1
  1020. net/sunrpc/rpc_pipe.c +1 −0
  1021. net/sunrpc/svcsock.c +1 −0
  1022. net/sunrpc/xdr.c +4 −0
  1023. net/sunrpc/xprtrdma/frwr_ops.c +4 −4
  1024. net/sunrpc/xprtrdma/rpc_rdma.c +3 −6
  1025. net/sunrpc/xprtrdma/transport.c +1 −1
  1026. net/sunrpc/xprtrdma/verbs.c +42 −29
  1027. net/sunrpc/xprtrdma/xprt_rdma.h +2 −1
  1028. net/xfrm/Kconfig +24 −0
  1029. net/xfrm/xfrm_device.c +3 −1
  1030. net/xfrm/xfrm_output.c +0 −4
  1031. samples/Kconfig +1 −1
  1032. samples/bpf/xdp_monitor_user.c +2 −6
  1033. samples/bpf/xdp_redirect_cpu_user.c +2 −5
  1034. samples/bpf/xdp_rxq_info_user.c +3 −10
  1035. samples/ftrace/sample-trace-array.c +18 −6
  1036. samples/mei/mei-amt-version.c +1 −1
  1037. samples/vfs/test-statx.c +2 −0
  1038. samples/watch_queue/Makefile +4 −6
  1039. scripts/Kbuild.include +6 −5
  1040. scripts/Kconfig.include +1 −7
  1041. scripts/Makefile.lib +6 −1
  1042. scripts/atomic/gen-atomic-fallback.sh +31 −0
  1043. scripts/decode_stacktrace.sh +4 −1
  1044. scripts/dtc/checks.c +36 −3
  1045. scripts/dtc/dtc.h +31 −0
  1046. scripts/dtc/flattree.c +1 −1
  1047. scripts/dtc/libfdt/fdt_rw.c +1 −1
  1048. scripts/dtc/libfdt/fdt_sw.c +1 −1
  1049. scripts/dtc/libfdt/libfdt.h +8 −0
  1050. scripts/dtc/treesource.c +4 −4
  1051. scripts/dtc/version_gen.h +1 −1
  1052. scripts/dtc/yamltree.c +3 −3
  1053. scripts/gcc-plugins/Kconfig +1 −1
  1054. scripts/headers_install.sh +1 −1
  1055. scripts/kconfig/qconf.cc +106 −67
  1056. scripts/kconfig/qconf.h +15 −8
  1057. scripts/recordmcount.h +92 −6
  1058. security/integrity/ima/ima.h +1 −1
  1059. security/integrity/ima/ima_crypto.c +14 −1
  1060. security/integrity/integrity.h +2 −2
  1061. security/security.c +16 −1
  1062. security/selinux/ss/conditional.c +8 −13
  1063. security/selinux/ss/services.c +4 −0
  1064. sound/hda/intel-dsp-config.c +1 −3
  1065. sound/pci/hda/hda_intel.c +8 −0
  1066. sound/pci/hda/patch_hdmi.c +5 −0
  1067. sound/pci/hda/patch_realtek.c +3 −0
  1068. sound/soc/amd/raven/acp3x-pcm-dma.c +23 −7
  1069. sound/soc/codecs/hdac_hda.c +10 −6
  1070. sound/soc/codecs/max98390.c +3 −3
  1071. sound/soc/codecs/rt1015.c +75 −49
  1072. sound/soc/codecs/rt1015.h +14 −1
  1073. sound/soc/codecs/rt5682.c +6 −5
  1074. sound/soc/fsl/fsl_asrc_common.h +2 −0
  1075. sound/soc/fsl/fsl_asrc_dma.c +33 −14
  1076. sound/soc/fsl/fsl_ssi.c +9 −4
  1077. sound/soc/intel/boards/Kconfig +2 −2
  1078. sound/soc/qcom/common.c +12 −2
  1079. sound/soc/qcom/qdsp6/q6afe.c +8 −0
  1080. sound/soc/qcom/qdsp6/q6afe.h +1 −0
  1081. sound/soc/qcom/qdsp6/q6asm.c +4 −3
  1082. sound/soc/rockchip/rockchip_pdm.c +3 −1
  1083. sound/soc/soc-core.c +2 −1
  1084. sound/soc/soc-devres.c +37 −0
  1085. sound/soc/soc-generic-dmaengine-pcm.c +0 −12
  1086. sound/soc/soc-pcm.c +3 −3
  1087. sound/soc/soc-topology.c +1 −2
  1088. sound/soc/sof/intel/Kconfig +8 −21
  1089. sound/soc/sof/intel/hda-stream.c +7 −2
  1090. sound/soc/sof/probe.h +4 −4
  1091. sound/soc/sof/sof-pci-dev.c +14 −10
  1092. sound/usb/format.c +4 −2
  1093. sound/usb/mixer.c +11 −4
  1094. sound/usb/mixer.h +7 −2
  1095. sound/usb/mixer_quirks.c +2 −1
  1096. sound/usb/pcm.c +2 −0
  1097. sound/usb/quirks.c +10 −0
  1098. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  1099. tools/arch/x86/include/asm/msr-index.h +4 −0
  1100. tools/arch/x86/include/uapi/asm/kvm.h +19 −2
  1101. tools/arch/x86/include/uapi/asm/unistd.h +8 −1
  1102. tools/arch/x86/include/uapi/asm/vmx.h +3 −0
  1103. tools/bootconfig/main.c +14 −10
  1104. tools/bootconfig/test-bootconfig.sh +10 −0
  1105. tools/bpf/bpftool/Documentation/bpftool-map.rst +1 −1
  1106. tools/bpf/bpftool/map.c +2 −1
  1107. tools/include/uapi/asm-generic/unistd.h +3 −1
  1108. tools/include/uapi/drm/i915_drm.h +24 −0
  1109. tools/include/uapi/linux/bpf.h +1 −1
  1110. tools/include/uapi/linux/fcntl.h +10 −0
  1111. tools/include/uapi/linux/fs.h +1 −0
  1112. tools/include/uapi/linux/fscrypt.h +2 −1
  1113. tools/include/uapi/linux/kvm.h +14 −0
  1114. tools/include/uapi/linux/stat.h +7 −1
  1115. tools/include/uapi/linux/vhost.h +4 −0
  1116. tools/lib/traceevent/event-parse.c +111 −57
  1117. tools/objtool/arch.h +2 −0
  1118. tools/objtool/arch/x86/decode.c +18 −0
  1119. tools/objtool/arch/x86/include/arch_elf.h +6 −0
  1120. tools/objtool/check.c +50 −3
  1121. tools/objtool/elf.c +50 −3
  1122. tools/objtool/elf.h +9 −3
  1123. tools/objtool/orc_gen.c +1 −1
  1124. tools/perf/Makefile.config +12 −0
  1125. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +1 −0
  1126. tools/perf/builtin-report.c +1 −2
  1127. tools/perf/builtin-script.c +3 −0
  1128. tools/perf/trace/beauty/statx.c +1 −0
  1129. tools/perf/util/bpf-prologue.c +10 −4
  1130. tools/perf/util/parse-events.y +2 −2
  1131. tools/perf/util/pmu.h +0 −1
  1132. tools/perf/util/probe-event.c +5 −2
  1133. tools/perf/util/probe-file.c +1 −1
  1134. tools/perf/util/stat-display.c +2 −2
  1135. tools/spi/spidev_test.c +5 −5
  1136. tools/testing/kunit/kunit.py +3 −1
  1137. tools/testing/kunit/kunit_config.py +1 −1
  1138. tools/testing/kunit/kunit_parser.py +4 −4
  1139. tools/testing/kunit/kunit_tool_test.py +11 −0
  1140. tools/testing/kunit/test_data/test_insufficient_memory.log +0 −0
  1141. tools/testing/nvdimm/test/nfit_test.h +3 −3
  1142. tools/testing/selftests/arm64/signal/Makefile +0 −4
  1143. tools/testing/selftests/bpf/prog_tests/sockopt_sk.c +39 −7
  1144. tools/testing/selftests/bpf/progs/bpf_cubic.c +2 −3
  1145. tools/testing/selftests/bpf/progs/sockopt_sk.c +52 −2
  1146. tools/testing/selftests/ftrace/ftracetest +9 −2
  1147. tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc +1 −2
  1148. tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc +1 −2
  1149. tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc +1 −5
  1150. tools/testing/selftests/ftrace/test.d/dynevent/add_remove_kprobe.tc +1 −5
  1151. tools/testing/selftests/ftrace/test.d/dynevent/add_remove_synth.tc +1 −4
  1152. tools/testing/selftests/ftrace/test.d/dynevent/clear_select_events.tc +1 −10
  1153. tools/testing/selftests/ftrace/test.d/dynevent/generic_clear_event.tc +1 −7
  1154. tools/testing/selftests/ftrace/test.d/event/event-enable.tc +1 −5
  1155. tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc +1 −10
  1156. tools/testing/selftests/ftrace/test.d/event/event-pid.tc +1 −10
  1157. tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc +1 −5
  1158. tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc +1 −5
  1159. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc +1 −13
  1160. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc +1 −7
  1161. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc +1 −7
  1162. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-notrace-pid.tc +1 −12
  1163. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc +1 −12
  1164. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc +1 −2
  1165. tools/testing/selftests/ftrace/test.d/ftrace/func_cpumask.tc +1 −5
  1166. tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +3 −4
  1167. tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc +1 −2
  1168. tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc +1 −2
  1169. tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc +1 −11
  1170. tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +3 −3
  1171. tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc +1 −7
  1172. tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc +3 −3
  1173. tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc +3 −9
  1174. tools/testing/selftests/ftrace/test.d/functions +21 −7
  1175. tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +1 −5
  1176. tools/testing/selftests/ftrace/test.d/instances/instance.tc +1 −5
  1177. tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc +1 −2
  1178. tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc +1 −2
  1179. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc +1 −2
  1180. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc +1 −2
  1181. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc +1 −2
  1182. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_symbol.tc +1 −2
  1183. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc +1 −4
  1184. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc +1 −4
  1185. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_user.tc +1 −3
  1186. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +1 −2
  1187. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc +1 −5
  1188. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc +1 −2
  1189. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_multiprobe.tc +1 −4
  1190. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc +1 −4
  1191. tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc +1 −2
  1192. tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc +1 −3
  1193. tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +1 −2
  1194. tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc +1 −2
  1195. tools/testing/selftests/ftrace/test.d/kprobe/profile.tc +1 −2
  1196. tools/testing/selftests/ftrace/test.d/kprobe/uprobe_syntax_errors.tc +1 −4
  1197. tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc +1 −3
  1198. tools/testing/selftests/ftrace/test.d/template +4 −0
  1199. tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc +1 −5
  1200. tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc +1 −5
  1201. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-action-hist-xfail.tc +1 −12
  1202. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc +1 −15
  1203. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc +1 −15
  1204. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc +1 −15
  1205. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc +1 −7
  1206. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc +1 −15
  1207. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc +1 −15
  1208. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc +1 −15
  1209. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc +1 −19
  1210. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc +1 −10
  1211. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc +1 −10
  1212. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc +1 −17
  1213. tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc +1 −10
  1214. tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc +1 −10
  1215. tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc +1 −15
  1216. tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-syntax-errors.tc +1 −17
  1217. tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc +2 −16
  1218. tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc +1 −15
  1219. tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc +1 −15
  1220. tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc +2 −11
  1221. tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc +2 −21
  1222. tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc +2 −21
  1223. tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic-kernel.tc +1 −30
  1224. tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic.tc +1 −25
  1225. tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc +1 −10
  1226. tools/testing/selftests/net/so_txtime.c +26 −7
  1227. tools/testing/selftests/netfilter/Makefile +1 −1
  1228. tools/testing/selftests/netfilter/nft_conntrack_helper.sh +175 −0
  1229. tools/testing/selftests/pidfd/pidfd.h +5 −0
  1230. tools/testing/selftests/pidfd/pidfd_getfd_test.c +0 −5
  1231. tools/testing/selftests/pidfd/pidfd_setns_test.c +12 −0
  1232. tools/testing/selftests/powerpc/pmu/ebb/Makefile +1 −1
  1233. tools/testing/selftests/seccomp/seccomp_bpf.c +1 −0
  1234. tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json +2 −2
  1235. tools/testing/selftests/tc-testing/tc-tests/actions/csum.json +2 −2
  1236. tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json +10 −10
  1237. tools/testing/selftests/tpm2/test_smoke.sh +2 −7
  1238. tools/testing/selftests/tpm2/test_space.sh +2 −2
  1239. tools/testing/selftests/wireguard/netns.sh +12 −1
  1240. tools/testing/selftests/x86/Makefile +2 −2
  1241. tools/testing/selftests/x86/helpers.h +41 −0
  1242. tools/testing/selftests/x86/single_step_syscall.c +2 −15
  1243. tools/testing/selftests/x86/syscall_arg_fault.c +1 −20
  1244. tools/testing/selftests/x86/syscall_nt.c +28 −19
  1245. tools/testing/selftests/x86/test_vsyscall.c +2 −13
  1246. tools/testing/selftests/x86/unwind_vdso.c +2 −21
  1247. tools/virtio/linux/kernel.h +1 −6
  1248. tools/virtio/linux/virtio.h +2 −3
  1249. tools/virtio/virtio_test.c +119 −20
  1250. tools/virtio/vringh_test.c +2 −0
.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
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-bus-papr-pmem+27−0
@@ -0,0 +1,27 @@
1+What: /sys/bus/nd/devices/nmemX/papr/flags
2+Date: Apr, 2020
3+KernelVersion: v5.8
4+Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, linux-nvdimm@lists.01.org,
5+Description:
6+ (RO) Report flags indicating various states of a
7+ papr-pmem NVDIMM device. Each flag maps to a one or
8+ more bits set in the dimm-health-bitmap retrieved in
9+ response to H_SCM_HEALTH hcall. The details of the bit
10+ flags returned in response to this hcall is available
11+ at 'Documentation/powerpc/papr_hcalls.rst' . Below are
12+ the flags reported in this sysfs file:
13+
14+ * "not_armed" : Indicates that NVDIMM contents will not
15+ survive a power cycle.
16+ * "flush_fail" : Indicates that NVDIMM contents
17+ couldn't be flushed during last
18+ shut-down event.
19+ * "restore_fail": Indicates that NVDIMM contents
20+ couldn't be restored during NVDIMM
21+ initialization.
22+ * "encrypted" : NVDIMM contents are encrypted.
23+ * "smart_notify": There is health event for the NVDIMM.
24+ * "scrubbed" : Indicating that contents of the
25+ NVDIMM have been scrubbed.
26+ * "locked" : Indicating that NVDIMM contents cant
27+ be modified until next power cycle.
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/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/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/arm64/sve.rst+3−3
@@ -186,7 +186,7 @@ prctl(PR_SVE_SET_VL, unsigned long arg) · 185 unmodified lines
186186
187187 flags:
188188
189− PR_SVE_SET_VL_INHERIT
189+ PR_SVE_VL_INHERIT
190190
191191 Inherit the current vector length across execve(). Otherwise, the
192192 vector length is reset to the system default at execve(). (See
@@ -247,7 +247,7 @@ prctl(PR_SVE_GET_VL) · 54 unmodified lines
247247
248248 The following flag may be OR-ed into the result:
249249
250− PR_SVE_SET_VL_INHERIT
250+ PR_SVE_VL_INHERIT
251251
252252 Vector length will be inherited across execve().
253253
@@ -393,7 +393,7 @@ The regset data starts with struct user_sve_header, containing: · 139 unmodified lines
393393 * At every execve() call, the new vector length of the new process is set to
394394 the system default vector length, unless
395395
396− * PR_SVE_SET_VL_INHERIT (or equivalently SVE_PT_VL_INHERIT) is set for the
396+ * PR_SVE_VL_INHERIT (or equivalently SVE_PT_VL_INHERIT) is set for the
397397 calling thread, or
398398
399399 * a deferred vector length change is pending, established via the
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/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/driver-api/media/v4l2-subdev.rst+1−1
@@ -451,7 +451,7 @@ The bridge driver also has some helper functions it can use: · 450 unmodified lines
451451 "module_foo", "chipid", 0x36, NULL);
452452
453453 This loads the given module (can be ``NULL`` if no module needs to be loaded)
454−and calls :c:func:`i2c_new_device` with the given ``i2c_adapter`` and
454+and calls :c:func:`i2c_new_client_device` with the given ``i2c_adapter`` and
455455 chip/address arguments. If all goes well, then it registers the subdev with
456456 the v4l2_device.
457457
Documentation/filesystems/dax.txt+3−3
@@ -25,7 +25,7 @@ size when creating the filesystem. · 24 unmodified lines
2525 Currently 3 filesystems support DAX: ext2, ext4 and xfs. Enabling DAX on them
2626 is different.
2727
28−Enabling DAX on ext4 and ext2
28+Enabling DAX on ext2
2929 -----------------------------
3030
3131 When mounting the filesystem, use the "-o dax" option on the command line or
@@ -33,8 +33,8 @@ add 'dax' to the options in /etc/fstab. This works to enable DAX on all files · 1 unmodified line
3333 within the filesystem. It is equivalent to the '-o dax=always' behavior below.
3434
3535
36−Enabling DAX on xfs
37−-------------------
36+Enabling DAX on xfs and ext4
37+----------------------------
3838
3939 Summary
4040 -------
Documentation/filesystems/ext4/verity.rst+3−0
@@ -39,3 +39,6 @@ is encrypted as well as the data itself. · 38 unmodified lines
3939
4040 Verity files cannot have blocks allocated past the end of the verity
4141 metadata.
42+
43+Verity and DAX are not compatible and attempts to set both of these flags
44+on a file will fail.
Documentation/gpu/amdgpu.rst+6−3
@@ -197,11 +197,14 @@ pp_power_profile_mode · 196 unmodified lines
197197 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
198198 :doc: pp_power_profile_mode
199199
200−busy_percent
201−~~~~~~~~~~~~
200+*_busy_percent
201+~~~~~~~~~~~~~~
202202
203203 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
204− :doc: busy_percent
204+ :doc: gpu_busy_percent
205+
206+.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
207+ :doc: mem_busy_percent
205208
206209 GPU Product Information
207210 =======================
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/i2c/smbus-protocol.rst+1−1
@@ -57,7 +57,7 @@ SMBus Quick Command · 56 unmodified lines
5757
5858 This sends a single bit to the device, at the place of the Rd/Wr bit::
5959
60− A Addr Rd/Wr [A] P
60+ S Addr Rd/Wr [A] P
6161
6262 Functionality flag: I2C_FUNC_SMBUS_QUICK
6363
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/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/powerpc/papr_hcalls.rst+42−4
@@ -220,13 +220,51 @@ from the LPAR memory. · 219 unmodified lines
220220 **H_SCM_HEALTH**
221221
222222 | Input: drcIndex
223−| Out: *health-bitmap, health-bit-valid-bitmap*
223+| Out: *health-bitmap (r4), health-bit-valid-bitmap (r5)*
224224 | Return Value: *H_Success, H_Parameter, H_Hardware*
225225
226226 Given a DRC Index return the info on predictive failure and overall health of
227−the NVDIMM. The asserted bits in the health-bitmap indicate a single predictive
228−failure and health-bit-valid-bitmap indicate which bits in health-bitmap are
229−valid.
227+the PMEM device. The asserted bits in the health-bitmap indicate one or more states
228+(described in table below) of the PMEM device and health-bit-valid-bitmap indicate
229+which bits in health-bitmap are valid. The bits are reported in
230+reverse bit ordering for example a value of 0xC400000000000000
231+indicates bits 0, 1, and 5 are valid.
232+
233+Health Bitmap Flags:
234+
235++------+-----------------------------------------------------------------------+
236+| Bit | Definition |
237++======+=======================================================================+
238+| 00 | PMEM device is unable to persist memory contents. |
239+| | If the system is powered down, nothing will be saved. |
240++------+-----------------------------------------------------------------------+
241+| 01 | PMEM device failed to persist memory contents. Either contents were |
242+| | not saved successfully on power down or were not restored properly on |
243+| | power up. |
244++------+-----------------------------------------------------------------------+
245+| 02 | PMEM device contents are persisted from previous IPL. The data from |
246+| | the last boot were successfully restored. |
247++------+-----------------------------------------------------------------------+
248+| 03 | PMEM device contents are not persisted from previous IPL. There was no|
249+| | data to restore from the last boot. |
250++------+-----------------------------------------------------------------------+
251+| 04 | PMEM device memory life remaining is critically low |
252++------+-----------------------------------------------------------------------+
253+| 05 | PMEM device will be garded off next IPL due to failure |
254++------+-----------------------------------------------------------------------+
255+| 06 | PMEM device contents cannot persist due to current platform health |
256+| | status. A hardware failure may prevent data from being saved or |
257+| | restored. |
258++------+-----------------------------------------------------------------------+
259+| 07 | PMEM device is unable to persist memory contents in certain conditions|
260++------+-----------------------------------------------------------------------+
261+| 08 | PMEM device is encrypted |
262++------+-----------------------------------------------------------------------+
263+| 09 | PMEM device has successfully completed a requested erase or secure |
264+| | erase procedure. |
265++------+-----------------------------------------------------------------------+
266+|10:63 | Reserved / Unused |
267++------+-----------------------------------------------------------------------+
230268
231269 **H_SCM_PERFORMANCE_STATS**
232270
Documentation/sh/index.rst+0−12
@@ -16,18 +16,6 @@ Store Queue API · 15 unmodified lines
1616 .. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
1717 :export:
1818
19−SH-5
20−----
21−
22−TLB Interfaces
23−~~~~~~~~~~~~~~
24−
25−.. kernel-doc:: arch/sh/mm/tlb-sh5.c
26− :internal:
27−
28−.. kernel-doc:: arch/sh/include/asm/tlb_64.h
29− :internal:
30−
3119 Machine Specific Interfaces
3220 ===========================
3321
Documentation/userspace-api/media/conf_nitpick.py+1−1
@@ -27,7 +27,7 @@ nitpick_ignore = [ · 26 unmodified lines
2727 ("c:func", "copy_to_user"),
2828 ("c:func", "determine_valid_ioctls"),
2929 ("c:func", "ERR_PTR"),
30− ("c:func", "i2c_new_device"),
30+ ("c:func", "i2c_new_client_device"),
3131 ("c:func", "ioctl"),
3232 ("c:func", "IS_ERR"),
3333 ("c:func", "KERNEL_VERSION"),
MAINTAINERS+34−27
@@ -3946,7 +3946,7 @@ L: linux-crypto@vger.kernel.org · 3945 unmodified lines
39463946 S: Supported
39473947 F: drivers/char/hw_random/cctrng.c
39483948 F: drivers/char/hw_random/cctrng.h
3949−F: Documentation/devicetree/bindings/rng/arm-cctrng.txt
3949+F: Documentation/devicetree/bindings/rng/arm-cctrng.yaml
39503950 W: https://developer.arm.com/products/system-ip/trustzone-cryptocell/cryptocell-700-family
39513951
39523952 CEC FRAMEWORK
@@ -5490,7 +5490,7 @@ F: include/uapi/drm/r128_drm.h · 1537 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>
@@ -11369,14 +11369,6 @@ L: dmaengine@vger.kernel.org · 554 unmodified lines
1136911369 S: Supported
1137011370 F: drivers/dma/at_xdmac.c
1137111371
11372−MICROSEMI ETHERNET SWITCH DRIVER
11373−M: Alexandre Belloni <alexandre.belloni@bootlin.com>
11374−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11375−L: netdev@vger.kernel.org
11376−S: Supported
11377−F: drivers/net/ethernet/mscc/
11378−F: include/soc/mscc/ocelot*
11379−
1138011372 MICROSEMI MIPS SOCS
1138111373 M: Alexandre Belloni <alexandre.belloni@bootlin.com>
1138211374 M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
@@ -12335,6 +12327,18 @@ M: Peter Zijlstra <peterz@infradead.org> · 952 unmodified lines
1233512327 S: Supported
1233612328 F: tools/objtool/
1233712329
12330+OCELOT ETHERNET SWITCH DRIVER
12331+M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
12332+M: Vladimir Oltean <vladimir.oltean@nxp.com>
12333+M: Claudiu Manoil <claudiu.manoil@nxp.com>
12334+M: Alexandre Belloni <alexandre.belloni@bootlin.com>
12335+L: netdev@vger.kernel.org
12336+S: Supported
12337+F: drivers/net/dsa/ocelot/*
12338+F: drivers/net/ethernet/mscc/
12339+F: include/soc/mscc/ocelot*
12340+F: net/dsa/tag_ocelot.c
12341+
1233812342 OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER
1233912343 M: Frederic Barrat <fbarrat@linux.ibm.com>
1234012344 M: Andrew Donnellan <ajd@linux.ibm.com>
@@ -12691,13 +12695,13 @@ F: arch/mips/boot/dts/ralink/omega2p.dts · 350 unmodified lines
1269112695
1269212696 OP-TEE DRIVER
1269312697 M: Jens Wiklander <jens.wiklander@linaro.org>
12694−L: tee-dev@lists.linaro.org
12698+L: op-tee@lists.trustedfirmware.org
1269512699 S: Maintained
1269612700 F: drivers/tee/optee/
1269712701
1269812702 OP-TEE RANDOM NUMBER GENERATOR (RNG) DRIVER
1269912703 M: Sumit Garg <sumit.garg@linaro.org>
12700−L: tee-dev@lists.linaro.org
12704+L: op-tee@lists.trustedfirmware.org
1270112705 S: Maintained
1270212706 F: drivers/char/hw_random/optee-rng.c
1270312707
@@ -14192,6 +14196,15 @@ L: dmaengine@vger.kernel.org · 1488 unmodified lines
1419214196 S: Supported
1419314197 F: drivers/dma/qcom/hidma*
1419414198
14199+QUALCOMM I2C CCI DRIVER
14200+M: Loic Poulain <loic.poulain@linaro.org>
14201+M: Robert Foss <robert.foss@linaro.org>
14202+L: linux-i2c@vger.kernel.org
14203+L: linux-arm-msm@vger.kernel.org
14204+S: Maintained
14205+F: Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
14206+F: drivers/i2c/busses/i2c-qcom-cci.c
14207+
1419514208 QUALCOMM IOMMU
1419614209 M: Rob Clark <robdclark@gmail.com>
1419714210 L: iommu@lists.linux-foundation.org
@@ -14534,7 +14547,7 @@ F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.txt · 336 unmodified lines
1453414547 F: drivers/i2c/busses/i2c-emev2.c
1453514548
1453614549 RENESAS ETHERNET DRIVERS
14537−R: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
14550+R: Sergei Shtylyov <sergei.shtylyov@gmail.com>
1453814551 L: netdev@vger.kernel.org
1453914552 L: linux-renesas-soc@vger.kernel.org
1454014553 F: Documentation/devicetree/bindings/net/renesas,*.txt
@@ -14561,8 +14574,8 @@ RENESAS R-CAR THERMAL DRIVERS · 20 unmodified lines
1456114574 M: Niklas Söderlund <niklas.soderlund@ragnatech.se>
1456214575 L: linux-renesas-soc@vger.kernel.org
1456314576 S: Supported
14564−F: Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
14565−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
1456614579 F: drivers/thermal/rcar_gen3_thermal.c
1456714580 F: drivers/thermal/rcar_thermal.c
1456814581
@@ -16045,8 +16058,10 @@ SPARSE CHECKER · 1476 unmodified lines
1604516058 M: "Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>
1604616059 L: linux-sparse@vger.kernel.org
1604716060 S: Maintained
16048−W: https://sparse.wiki.kernel.org/
16061+W: https://sparse.docs.kernel.org/
1604916062 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
1605016065 F: include/linux/compiler.h
1605116066
1605216067 SPEAR CLOCK FRAMEWORK SUPPORT
@@ -16759,7 +16774,7 @@ F: include/media/i2c/tw9910.h · 706 unmodified lines
1675916774
1676016775 TEE SUBSYSTEM
1676116776 M: Jens Wiklander <jens.wiklander@linaro.org>
16762−L: tee-dev@lists.linaro.org
16777+L: op-tee@lists.trustedfirmware.org
1676316778 S: Maintained
1676416779 F: Documentation/tee.txt
1676516780 F: drivers/tee/
@@ -18254,14 +18269,6 @@ S: Maintained · 1488 unmodified lines
1825418269 F: drivers/input/serio/userio.c
1825518270 F: include/uapi/linux/userio.h
1825618271
18257−VITESSE FELIX ETHERNET SWITCH DRIVER
18258−M: Vladimir Oltean <vladimir.oltean@nxp.com>
18259−M: Claudiu Manoil <claudiu.manoil@nxp.com>
18260−L: netdev@vger.kernel.org
18261−S: Maintained
18262−F: drivers/net/dsa/ocelot/*
18263−F: net/dsa/tag_ocelot.c
18264−
1826518272 VIVID VIRTUAL VIDEO DRIVER
1826618273 M: Hans Verkuil <hverkuil@xs4all.nl>
1826718274 L: linux-media@vger.kernel.org
Makefile+7−15
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 8
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc4
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
@@ -828,7 +828,7 @@ endif · 819 unmodified lines
828828
829829 ifdef CONFIG_DEBUG_INFO_COMPRESSED
830830 DEBUG_CFLAGS += -gz=zlib
831−KBUILD_AFLAGS += -Wa,--compress-debug-sections=zlib
831+KBUILD_AFLAGS += -gz=zlib
832832 KBUILD_LDFLAGS += --compress-debug-sections=zlib
833833 endif
834834
@@ -970,8 +970,8 @@ LDFLAGS_vmlinux += --pack-dyn-relocs=relr · 135 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)
@@ -1336,16 +1336,6 @@ dt_binding_check: scripts_dtc · 358 unmodified lines
13361336 # ---------------------------------------------------------------------------
13371337 # Modules
13381338
1339−# install modules.builtin regardless of CONFIG_MODULES
1340−PHONY += _builtin_inst_
1341−_builtin_inst_:
1342− @mkdir -p $(MODLIB)/
1343− @cp -f modules.builtin $(MODLIB)/
1344− @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
1345−
1346−PHONY += install
1347−install: _builtin_inst_
1348−
13491339 ifdef CONFIG_MODULES
13501340
13511341 # By default, build modules as well
@@ -1389,7 +1379,7 @@ PHONY += modules_install · 37 unmodified lines
13891379 modules_install: _modinst_ _modinst_post
13901380
13911381 PHONY += _modinst_
1392−_modinst_: _builtin_inst_
1382+_modinst_:
13931383 @rm -rf $(MODLIB)/kernel
13941384 @rm -f $(MODLIB)/source
13951385 @mkdir -p $(MODLIB)/kernel
@@ -1399,6 +1389,8 @@ _modinst_: _builtin_inst_ · 3 unmodified lines
13991389 ln -s $(CURDIR) $(MODLIB)/build ; \
14001390 fi
14011391 @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
1392+ @cp -f modules.builtin $(MODLIB)/
1393+ @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
14021394 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
14031395
14041396 # This depmod is only for convenience to give the initial
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+2−3
@@ -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>;
@@ -1598,7 +1597,7 @@ · 506 unmodified lines
15981597 ranges = <0x0 0xd8000 0x1000>;
15991598
16001599 mmc2: mmc@0 {
1601− compatible = "ti,omap4-hsmmc";
1600+ compatible = "ti,am437-sdhci";
16021601 reg = <0x0 0x1000>;
16031602 ti,needs-special-reset;
16041603 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/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/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/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/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/ftrace.c+2−1
@@ -84,7 +84,8 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old, · 83 unmodified lines
8484 old = __opcode_to_mem_arm(old);
8585
8686 if (validate) {
87− if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))
87+ if (copy_from_kernel_nofault(&replaced, (void *)pc,
88+ MCOUNT_INSN_SIZE))
8889 return -EFAULT;
8990
9091 if (replaced != old)
arch/arm/kernel/kgdb.c+1−1
@@ -236,7 +236,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) · 235 unmodified lines
236236 /* patch_text() only supports int-sized breakpoints */
237237 BUILD_BUG_ON(sizeof(int) != BREAK_INSTR_SIZE);
238238
239− err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
239+ err = copy_from_kernel_nofault(bpt->saved_instr, (char *)bpt->bpt_addr,
240240 BREAK_INSTR_SIZE);
241241 if (err)
242242 return err;
arch/arm/kernel/traps.c+1−1
@@ -396,7 +396,7 @@ int is_valid_bugaddr(unsigned long pc) · 395 unmodified lines
396396 u32 insn = __opcode_to_mem_arm(BUG_INSTR_VALUE);
397397 #endif
398398
399− if (probe_kernel_address((unsigned *)pc, bkpt))
399+ if (get_kernel_nofault(bkpt, (void *)pc))
400400 return 0;
401401
402402 return bkpt == insn;
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/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+1−1
@@ -3489,7 +3489,7 @@ static const struct omap_hwmod_reset dra7_reset_quirks[] = { · 3488 unmodified lines
34893489 };
34903490
34913491 static const struct omap_hwmod_reset omap_reset_quirks[] = {
3492− { .match = "dss", .len = 3, .reset = omap_dss_reset, },
3492+ { .match = "dss_core", .len = 8, .reset = omap_dss_reset, },
34933493 { .match = "hdq1w", .len = 5, .reset = omap_hdq1w_reset, },
34943494 { .match = "i2c", .len = 3, .reset = omap_i2c_reset, },
34953495 { .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/mm/alignment.c+2−2
@@ -774,7 +774,7 @@ static int alignment_get_arm(struct pt_regs *regs, u32 *ip, u32 *inst) · 773 unmodified lines
774774 if (user_mode(regs))
775775 fault = get_user(instr, ip);
776776 else
777− fault = probe_kernel_address(ip, instr);
777+ fault = get_kernel_nofault(instr, ip);
778778
779779 *inst = __mem_to_opcode_arm(instr);
780780
@@ -789,7 +789,7 @@ static int alignment_get_thumb(struct pt_regs *regs, u16 *ip, u16 *inst) · 8 unmodified lines
789789 if (user_mode(regs))
790790 fault = get_user(instr, ip);
791791 else
792− fault = probe_kernel_address(ip, instr);
792+ fault = get_kernel_nofault(instr, ip);
793793
794794 *inst = __mem_to_opcode_thumb16(instr);
795795
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+5−3
@@ -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
@@ -1564,7 +1564,7 @@ config CC_HAS_SIGN_RETURN_ADDRESS · 37 unmodified lines
15641564 def_bool $(cc-option,-msign-return-address=all)
15651565
15661566 config AS_HAS_PAC
1567− def_bool $(as-option,-Wa$(comma)-march=armv8.3-a)
1567+ def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
15681568
15691569 config AS_HAS_CFI_NEGATE_RA_STATE
15701570 def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
@@ -1630,6 +1630,8 @@ config ARM64_BTI_KERNEL · 59 unmodified lines
16301630 depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
16311631 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
16321632 depends on !CC_IS_GCC || GCC_VERSION >= 100100
1633+ # https://reviews.llvm.org/rGb8ae3fdfa579dbf366b1bb1cbfdbf8c51db7fa55
1634+ depends on !CC_IS_CLANG || CLANG_VERSION >= 100001
16331635 depends on !(CC_IS_CLANG && GCOV_KERNEL)
16341636 depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
16351637 help
arch/arm64/Kconfig.debug+0−15
@@ -8,21 +8,6 @@ config PID_IN_CONTEXTIDR · 7 unmodified lines
88 instructions during context switch. Say Y here only if you are
99 planning to use hardware trace tools with this kernel.
1010
11−config ARM64_RANDOMIZE_TEXT_OFFSET
12− bool "Randomize TEXT_OFFSET at build time"
13− help
14− Say Y here if you want the image load offset (AKA TEXT_OFFSET)
15− of the kernel to be randomized at build-time. When selected,
16− this option will cause TEXT_OFFSET to be randomized upon any
17− build of the kernel, and the offset will be reflected in the
18− text_offset field of the resulting Image. This can be used to
19− fuzz-test bootloaders which respect text_offset.
20−
21− This option is intended for bootloader and/or kernel testing
22− only. Bootloaders must make no assumptions regarding the value
23− of TEXT_OFFSET and platforms must not require a specific
24− value.
25−
2611 config DEBUG_EFI
2712 depends on EFI && DEBUG_INFO
2813 bool "UEFI debugging"
arch/arm64/Makefile+0−6
@@ -121,13 +121,7 @@ endif · 120 unmodified lines
121121 head-y := arch/arm64/kernel/head.o
122122
123123 # The byte offset of the kernel image in RAM from the start of RAM.
124−ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
125−TEXT_OFFSET := $(shell awk "BEGIN {srand(); printf \"0x%06x\n\", \
126− int(2 * 1024 * 1024 / (2 ^ $(CONFIG_ARM64_PAGE_SHIFT)) * \
127− rand()) * (2 ^ $(CONFIG_ARM64_PAGE_SHIFT))}")
128−else
129124 TEXT_OFFSET := 0x0
130−endif
131125
132126 ifeq ($(CONFIG_KASAN_SW_TAGS), y)
133127 KASAN_SHADOW_SCALE_SHIFT := 4
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/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/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/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.h+1−1
@@ -416,7 +416,7 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd) · 415 unmodified lines
416416 __pgprot((pgprot_val(prot) & ~(mask)) | (bits))
417417
418418 #define pgprot_nx(prot) \
419− __pgprot_modify(prot, 0, PTE_PXN)
419+ __pgprot_modify(prot, PTE_MAYBE_GP, PTE_PXN)
420420
421421 /*
422422 * Mark the prot value as uncacheable and unbufferable.
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/cpu_errata.c+17−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,22 @@ 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+#endif
787+
778788 const struct arm64_cpu_capabilities arm64_errata[] = {
779789 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
780790 {
@@ -914,6 +924,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { · 133 unmodified lines
914924 .capability = ARM64_WORKAROUND_1463225,
915925 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
916926 .matches = has_cortex_a76_erratum_1463225,
927+ .midr_range_list = erratum_1463225,
917928 },
918929 #endif
919930 #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/fpsimd.c+21−10
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/bug.h>
1313 #include <linux/cache.h>
1414 #include <linux/compat.h>
15+#include <linux/compiler.h>
1516 #include <linux/cpu.h>
1617 #include <linux/cpu_pm.h>
1718 #include <linux/kernel.h>
@@ -119,10 +120,20 @@ struct fpsimd_last_state_struct { · 101 unmodified lines
119120 static DEFINE_PER_CPU(struct fpsimd_last_state_struct, fpsimd_last_state);
120121
121122 /* Default VL for tasks that don't set it explicitly: */
122−static int sve_default_vl = -1;
123+static int __sve_default_vl = -1;
124+
125+static int get_sve_default_vl(void)
126+{
127+ return READ_ONCE(__sve_default_vl);
128+}
123129
124130 #ifdef CONFIG_ARM64_SVE
125131
132+static void set_sve_default_vl(int val)
133+{
134+ WRITE_ONCE(__sve_default_vl, val);
135+}
136+
126137 /* Maximum supported vector length across all CPUs (initially poisoned) */
127138 int __ro_after_init sve_max_vl = SVE_VL_MIN;
128139 int __ro_after_init sve_max_virtualisable_vl = SVE_VL_MIN;
@@ -338,13 +349,13 @@ static unsigned int find_supported_vector_length(unsigned int vl) · 209 unmodified lines
338349 return sve_vl_from_vq(__bit_to_vq(bit));
339350 }
340351
341−#ifdef CONFIG_SYSCTL
352+#if defined(CONFIG_ARM64_SVE) && defined(CONFIG_SYSCTL)
342353
343354 static int sve_proc_do_default_vl(struct ctl_table *table, int write,
344355 void *buffer, size_t *lenp, loff_t *ppos)
345356 {
346357 int ret;
347− int vl = sve_default_vl;
358+ int vl = get_sve_default_vl();
348359 struct ctl_table tmp_table = {
349360 .data = &vl,
350361 .maxlen = sizeof(vl),
@@ -361,7 +372,7 @@ static int sve_proc_do_default_vl(struct ctl_table *table, int write, · 10 unmodified lines
361372 if (!sve_vl_valid(vl))
362373 return -EINVAL;
363374
364− sve_default_vl = find_supported_vector_length(vl);
375+ set_sve_default_vl(find_supported_vector_length(vl));
365376 return 0;
366377 }
367378
@@ -383,9 +394,9 @@ static int __init sve_sysctl_init(void) · 15 unmodified lines
383394 return 0;
384395 }
385396
386−#else /* ! CONFIG_SYSCTL */
397+#else /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */
387398 static int __init sve_sysctl_init(void) { return 0; }
388−#endif /* ! CONFIG_SYSCTL */
399+#endif /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */
389400
390401 #define ZREG(sve_state, vq, n) ((char *)(sve_state) + \
391402 (SVE_SIG_ZREG_OFFSET(vq, n) - SVE_SIG_REGS_OFFSET))
@@ -868,7 +879,7 @@ void __init sve_setup(void) · 476 unmodified lines
868879 * For the default VL, pick the maximum supported value <= 64.
869880 * VL == 64 is guaranteed not to grow the signal frame.
870881 */
871− sve_default_vl = find_supported_vector_length(64);
882+ set_sve_default_vl(find_supported_vector_length(64));
872883
873884 bitmap_andnot(tmp_map, sve_vq_partial_map, sve_vq_map,
874885 SVE_VQ_MAX);
@@ -889,7 +900,7 @@ void __init sve_setup(void) · 14 unmodified lines
889900 pr_info("SVE: maximum available vector length %u bytes per vector\n",
890901 sve_max_vl);
891902 pr_info("SVE: default vector length %u bytes per vector\n",
892− sve_default_vl);
903+ get_sve_default_vl());
893904
894905 /* KVM decides whether to support mismatched systems. Just warn here: */
895906 if (sve_max_virtualisable_vl < sve_max_vl)
@@ -1029,13 +1040,13 @@ void fpsimd_flush_thread(void) · 133 unmodified lines
10291040 * vector length configured: no kernel task can become a user
10301041 * task without an exec and hence a call to this function.
10311042 * By the time the first call to this function is made, all
1032− * early hardware probing is complete, so sve_default_vl
1043+ * early hardware probing is complete, so __sve_default_vl
10331044 * should be valid.
10341045 * If a bug causes this to go wrong, we make some noise and
10351046 * try to fudge thread.sve_vl to a safe value here.
10361047 */
10371048 vl = current->thread.sve_vl_onexec ?
1038− current->thread.sve_vl_onexec : sve_default_vl;
1049+ current->thread.sve_vl_onexec : get_sve_default_vl();
10391050
10401051 if (WARN_ON(!sve_vl_valid(vl)))
10411052 vl = SVE_VL_MIN;
arch/arm64/kernel/hw_breakpoint.c+26−18
@@ -730,6 +730,27 @@ static u64 get_distance_from_watchpoint(unsigned long addr, u64 val, · 729 unmodified lines
730730 return 0;
731731 }
732732
733+static int watchpoint_report(struct perf_event *wp, unsigned long addr,
734+ struct pt_regs *regs)
735+{
736+ int step = is_default_overflow_handler(wp);
737+ struct arch_hw_breakpoint *info = counter_arch_bp(wp);
738+
739+ info->trigger = addr;
740+
741+ /*
742+ * If we triggered a user watchpoint from a uaccess routine, then
743+ * handle the stepping ourselves since userspace really can't help
744+ * us with this.
745+ */
746+ if (!user_mode(regs) && info->ctrl.privilege == AARCH64_BREAKPOINT_EL0)
747+ step = 1;
748+ else
749+ perf_bp_event(wp, regs);
750+
751+ return step;
752+}
753+
733754 static int watchpoint_handler(unsigned long addr, unsigned int esr,
734755 struct pt_regs *regs)
735756 {
@@ -739,7 +760,6 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr, · 3 unmodified lines
739760 u64 val;
740761 struct perf_event *wp, **slots;
741762 struct debug_info *debug_info;
742− struct arch_hw_breakpoint *info;
743763 struct arch_hw_breakpoint_ctrl ctrl;
744764
745765 slots = this_cpu_ptr(wp_on_reg);
@@ -777,25 +797,13 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr, · 31 unmodified lines
777797 if (dist != 0)
778798 continue;
779799
780− info = counter_arch_bp(wp);
781− info->trigger = addr;
782− perf_bp_event(wp, regs);
783−
784− /* Do we need to handle the stepping? */
785− if (is_default_overflow_handler(wp))
786− step = 1;
800+ step = watchpoint_report(wp, addr, regs);
787801 }
788− if (min_dist > 0 && min_dist != -1) {
789− /* No exact match found. */
790− wp = slots[closest_match];
791− info = counter_arch_bp(wp);
792− info->trigger = addr;
793− perf_bp_event(wp, regs);
794802
795− /* Do we need to handle the stepping? */
796− if (is_default_overflow_handler(wp))
797− step = 1;
798− }
803+ /* No exact match found? */
804+ if (min_dist > 0 && min_dist != -1)
805+ step = watchpoint_report(slots[closest_match], addr, regs);
806+
799807 rcu_read_unlock();
800808
801809 if (!step)
arch/arm64/kernel/insn.c+2−2
@@ -135,7 +135,7 @@ int __kprobes aarch64_insn_read(void *addr, u32 *insnp) · 134 unmodified lines
135135 int ret;
136136 __le32 val;
137137
138− ret = probe_kernel_read(&val, addr, AARCH64_INSN_SIZE);
138+ ret = copy_from_kernel_nofault(&val, addr, AARCH64_INSN_SIZE);
139139 if (!ret)
140140 *insnp = le32_to_cpu(val);
141141
@@ -151,7 +151,7 @@ static int __kprobes __aarch64_insn_write(void *addr, __le32 insn) · 9 unmodified lines
151151 raw_spin_lock_irqsave(&patch_lock, flags);
152152 waddr = patch_map(addr, FIX_TEXT_POKE0);
153153
154− ret = probe_kernel_write(waddr, &insn, AARCH64_INSN_SIZE);
154+ ret = copy_to_kernel_nofault(waddr, &insn, AARCH64_INSN_SIZE);
155155
156156 patch_unmap(FIX_TEXT_POKE0);
157157 raw_spin_unlock_irqrestore(&patch_lock, flags);
arch/arm64/kernel/machine_kexec_file.c+1−2
@@ -219,8 +219,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz) · 218 unmodified lines
219219 MEMBLOCK_NONE, &start, &end, NULL)
220220 nr_ranges++;
221221
222− cmem = kmalloc(sizeof(struct crash_mem) +
223− sizeof(struct crash_mem_range) * nr_ranges, GFP_KERNEL);
222+ cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL);
224223 if (!cmem)
225224 return -ENOMEM;
226225
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/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/traps.c+2−1
@@ -376,7 +376,7 @@ static int call_undef_hook(struct pt_regs *regs) · 375 unmodified lines
376376
377377 if (!user_mode(regs)) {
378378 __le32 instr_le;
379− if (probe_kernel_address((__force __le32 *)pc, instr_le))
379+ if (get_kernel_nofault(instr_le, (__force __le32 *)pc))
380380 goto exit;
381381 instr = le32_to_cpu(instr_le);
382382 } else if (compat_thumb_mode(regs)) {
@@ -813,6 +813,7 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) · 430 unmodified lines
813813 handler[reason], smp_processor_id(), esr,
814814 esr_get_class_string(esr));
815815
816+ __show_regs(regs);
816817 local_daif_mask();
817818 panic("bad mode");
818819 }
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/mm/init.c+10−5
@@ -404,11 +404,6 @@ void __init arm64_memblock_init(void) · 403 unmodified lines
404404 high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
405405
406406 dma_contiguous_reserve(arm64_dma32_phys_limit);
407−
408−#ifdef CONFIG_ARM64_4K_PAGES
409− hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);
410−#endif
411−
412407 }
413408
414409 void __init bootmem_init(void)
@@ -424,6 +419,16 @@ void __init bootmem_init(void) · 9 unmodified lines
424419 min_low_pfn = min;
425420
426421 arm64_numa_init();
422+
423+ /*
424+ * must be done after arm64_numa_init() which calls numa_init() to
425+ * initialize node_online_map that gets used in hugetlb_cma_reserve()
426+ * while allocating required CMA size across online nodes.
427+ */
428+#ifdef CONFIG_ARM64_4K_PAGES
429+ hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);
430+#endif
431+
427432 /*
428433 * Sparsemem tries to allocate bootmem in memory_present(), so must be
429434 * done after the fixed reservations.
arch/arm64/mm/mmu.c+1−0
@@ -723,6 +723,7 @@ int kern_addr_valid(unsigned long addr) · 722 unmodified lines
723723 pmd_t *pmdp, pmd;
724724 pte_t *ptep, pte;
725725
726+ addr = arch_kasan_reset_tag(addr);
726727 if ((((long)addr) >> VA_BITS) != -1UL)
727728 return 0;
728729
arch/csky/kernel/ftrace.c+3−2
@@ -72,7 +72,8 @@ static int ftrace_check_current_nop(unsigned long hook) · 71 unmodified lines
7272 uint16_t olds[7];
7373 unsigned long hook_pos = hook - 2;
7474
75− if (probe_kernel_read((void *)olds, (void *)hook_pos, sizeof(nops)))
75+ if (copy_from_kernel_nofault((void *)olds, (void *)hook_pos,
76+ sizeof(nops)))
7677 return -EFAULT;
7778
7879 if (memcmp((void *)nops, (void *)olds, sizeof(nops))) {
@@ -97,7 +98,7 @@ static int ftrace_modify_code(unsigned long hook, unsigned long target, · 18 unmodified lines
9798
9899 make_jbsr(target, hook, call, nolr);
99100
100− ret = probe_kernel_write((void *)hook_pos, enable ? call : nops,
101+ ret = copy_to_kernel_nofault((void *)hook_pos, enable ? call : nops,
101102 sizeof(nops));
102103 if (ret)
103104 return -EPERM;
arch/ia64/include/asm/sections.h+1−1
@@ -35,7 +35,7 @@ static inline void *dereference_function_descriptor(void *ptr) · 34 unmodified lines
3535 struct fdesc *desc = ptr;
3636 void *p;
3737
38− if (!probe_kernel_address(&desc->ip, p))
38+ if (!get_kernel_nofault(p, (void *)&desc->ip))
3939 ptr = p;
4040 return ptr;
4141 }
arch/ia64/kernel/ftrace.c+3−3
@@ -108,7 +108,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, · 107 unmodified lines
108108 goto skip_check;
109109
110110 /* read the text we want to modify */
111− if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
111+ if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
112112 return -EFAULT;
113113
114114 /* Make sure it is what we expect it to be */
@@ -117,7 +117,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, · 2 unmodified lines
117117
118118 skip_check:
119119 /* replace the text with the new text */
120− if (probe_kernel_write(((void *)ip), new_code, MCOUNT_INSN_SIZE))
120+ if (copy_to_kernel_nofault(((void *)ip), new_code, MCOUNT_INSN_SIZE))
121121 return -EPERM;
122122 flush_icache_range(ip, ip + MCOUNT_INSN_SIZE);
123123
@@ -129,7 +129,7 @@ static int ftrace_make_nop_check(struct dyn_ftrace *rec, unsigned long addr) · 5 unmodified lines
129129 unsigned char __attribute__((aligned(8))) replaced[MCOUNT_INSN_SIZE];
130130 unsigned long ip = rec->ip;
131131
132− if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
132+ if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
133133 return -EFAULT;
134134 if (rec->flags & FTRACE_FL_CONVERTED) {
135135 struct ftrace_call_insn *call_insn, *tmp_call;
arch/ia64/kernel/unwind_i.h+1−1
@@ -42,7 +42,7 @@ enum unw_register_index { · 41 unmodified lines
4242
4343 struct unw_info_block {
4444 u64 header;
45− u64 desc[0]; /* unwind descriptors */
45+ u64 desc[]; /* unwind descriptors */
4646 /* personality routine and language-specific data follow behind descriptors */
4747 };
4848
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/kernel/kprobes.c+3−3
@@ -86,9 +86,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) · 85 unmodified lines
8686 goto out;
8787 }
8888
89− if ((probe_kernel_read(&prev_insn, p->addr - 1,
90− sizeof(mips_instruction)) == 0) &&
91− insn_has_delayslot(prev_insn)) {
89+ if (copy_from_kernel_nofault(&prev_insn, p->addr - 1,
90+ sizeof(mips_instruction)) == 0 &&
91+ insn_has_delayslot(prev_insn)) {
9292 pr_notice("Kprobes for branch delayslot are not supported\n");
9393 ret = -EINVAL;
9494 goto out;
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/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/nds32/kernel/ftrace.c+3−2
@@ -131,13 +131,14 @@ static int __ftrace_modify_code(unsigned long pc, unsigned long *old_insn, · 130 unmodified lines
131131 unsigned long orig_insn[3];
132132
133133 if (validate) {
134− if (probe_kernel_read(orig_insn, (void *)pc, MCOUNT_INSN_SIZE))
134+ if (copy_from_kernel_nofault(orig_insn, (void *)pc,
135+ MCOUNT_INSN_SIZE))
135136 return -EFAULT;
136137 if (memcmp(orig_insn, old_insn, MCOUNT_INSN_SIZE))
137138 return -EINVAL;
138139 }
139140
140− if (probe_kernel_write((void *)pc, new_insn, MCOUNT_INSN_SIZE))
141+ if (copy_to_kernel_nofault((void *)pc, new_insn, MCOUNT_INSN_SIZE))
141142 return -EPERM;
142143
143144 return 0;
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/parisc/kernel/ftrace.c+1−1
@@ -172,7 +172,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) · 171 unmodified lines
172172
173173 ip = (void *)(rec->ip + 4 - size);
174174
175− ret = probe_kernel_read(insn, ip, size);
175+ ret = copy_from_kernel_nofault(insn, ip, size);
176176 if (ret)
177177 return ret;
178178
arch/parisc/kernel/kgdb.c+2−2
@@ -154,8 +154,8 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) · 153 unmodified lines
154154
155155 int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
156156 {
157− int ret = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
158− BREAK_INSTR_SIZE);
157+ int ret = copy_from_kernel_nofault(bpt->saved_instr,
158+ (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
159159 if (ret)
160160 return ret;
161161
arch/parisc/kernel/process.c+1−1
@@ -293,7 +293,7 @@ void *dereference_function_descriptor(void *ptr) · 292 unmodified lines
293293 Elf64_Fdesc *desc = ptr;
294294 void *p;
295295
296− if (!probe_kernel_address(&desc->addr, p))
296+ if (!get_kernel_nofault(p, (void *)&desc->addr))
297297 ptr = p;
298298 return ptr;
299299 }
arch/parisc/lib/memcpy.c+1−1
@@ -57,7 +57,7 @@ void * memcpy(void * dst,const void *src, size_t count) · 56 unmodified lines
5757 EXPORT_SYMBOL(raw_copy_in_user);
5858 EXPORT_SYMBOL(memcpy);
5959
60−bool probe_kernel_read_allowed(const void *unsafe_src, size_t size)
60+bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
6161 {
6262 if ((unsigned long)unsafe_src < PAGE_SIZE)
6363 return false;
arch/powerpc/include/asm/nohash/32/pgtable.h+13−5
@@ -205,10 +205,6 @@ static inline void pmd_clear(pmd_t *pmdp) · 204 unmodified lines
205205 *pmdp = __pmd(0);
206206 }
207207
208−/* to find an entry in a page-table-directory */
209−#define pgd_index(address) ((address) >> PGDIR_SHIFT)
210−#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
211−
212208 /*
213209 * PTE updates. This function is called whenever an existing
214210 * valid PTE is updated. This does -not- include set_pte_at()
@@ -230,6 +226,8 @@ static inline void pmd_clear(pmd_t *pmdp) · 15 unmodified lines
230226 * For other page sizes, we have a single entry in the table.
231227 */
232228 #ifdef CONFIG_PPC_8xx
229+static pmd_t *pmd_off(struct mm_struct *mm, unsigned long addr);
230+
233231 static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, pte_t *p,
234232 unsigned long clr, unsigned long set, int huge)
235233 {
@@ -237,7 +235,7 @@ static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, p · 1 unmodified line
237235 pte_basic_t old = pte_val(*p);
238236 pte_basic_t new = (old & ~(pte_basic_t)clr) | set;
239237 int num, i;
240− pmd_t *pmd = pmd_offset(pud_offset(p4d_offset(pgd_offset(mm, addr), addr), addr), addr);
238+ pmd_t *pmd = pmd_off(mm, addr);
241239
242240 if (!huge)
243241 num = PAGE_SIZE / SZ_4K;
@@ -286,6 +284,16 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, · 42 unmodified lines
286284 return __pte(pte_update(mm, addr, ptep, ~0, 0, 0));
287285 }
288286
287+#if defined(CONFIG_PPC_8xx) && defined(CONFIG_PPC_16K_PAGES)
288+#define __HAVE_ARCH_PTEP_GET
289+static inline pte_t ptep_get(pte_t *ptep)
290+{
291+ pte_t pte = {READ_ONCE(ptep->pte), 0, 0, 0};
292+
293+ return pte;
294+}
295+#endif
296+
289297 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
290298 static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
291299 pte_t *ptep)
arch/powerpc/include/asm/sections.h+1−1
@@ -85,7 +85,7 @@ static inline void *dereference_function_descriptor(void *ptr) · 84 unmodified lines
8585 struct ppc64_opd_entry *desc = ptr;
8686 void *p;
8787
88− if (!probe_kernel_address(&desc->funcaddr, p))
88+ if (!get_kernel_nofault(p, (void *)&desc->funcaddr))
8989 ptr = p;
9090 return ptr;
9191 }
arch/powerpc/include/uapi/asm/papr_pdsm.h+132−0
@@ -0,0 +1,132 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+/*
3+ * PAPR nvDimm Specific Methods (PDSM) and structs for libndctl
4+ *
5+ * (C) Copyright IBM 2020
6+ *
7+ * Author: Vaibhav Jain <vaibhav at linux.ibm.com>
8+ */
9+
10+#ifndef _UAPI_ASM_POWERPC_PAPR_PDSM_H_
11+#define _UAPI_ASM_POWERPC_PAPR_PDSM_H_
12+
13+#include <linux/types.h>
14+#include <linux/ndctl.h>
15+
16+/*
17+ * PDSM Envelope:
18+ *
19+ * The ioctl ND_CMD_CALL exchange data between user-space and kernel via
20+ * envelope which consists of 2 headers sections and payload sections as
21+ * illustrated below:
22+ * +-----------------+---------------+---------------------------+
23+ * | 64-Bytes | 8-Bytes | Max 184-Bytes |
24+ * +-----------------+---------------+---------------------------+
25+ * | ND-HEADER | PDSM-HEADER | PDSM-PAYLOAD |
26+ * +-----------------+---------------+---------------------------+
27+ * | nd_family | | |
28+ * | nd_size_out | cmd_status | |
29+ * | nd_size_in | reserved | nd_pdsm_payload |
30+ * | nd_command | payload --> | |
31+ * | nd_fw_size | | |
32+ * | nd_payload ---> | | |
33+ * +---------------+-----------------+---------------------------+
34+ *
35+ * ND Header:
36+ * This is the generic libnvdimm header described as 'struct nd_cmd_pkg'
37+ * which is interpreted by libnvdimm before passed on to papr_scm. Important
38+ * member fields used are:
39+ * 'nd_family' : (In) NVDIMM_FAMILY_PAPR_SCM
40+ * 'nd_size_in' : (In) PDSM-HEADER + PDSM-IN-PAYLOAD (usually 0)
41+ * 'nd_size_out' : (In) PDSM-HEADER + PDSM-RETURN-PAYLOAD
42+ * 'nd_command' : (In) One of PAPR_PDSM_XXX
43+ * 'nd_fw_size' : (Out) PDSM-HEADER + size of actual payload returned
44+ *
45+ * PDSM Header:
46+ * This is papr-scm specific header that precedes the payload. This is defined
47+ * as nd_cmd_pdsm_pkg. Following fields aare available in this header:
48+ *
49+ * 'cmd_status' : (Out) Errors if any encountered while servicing PDSM.
50+ * 'reserved' : Not used, reserved for future and should be set to 0.
51+ * 'payload' : A union of all the possible payload structs
52+ *
53+ * PDSM Payload:
54+ *
55+ * The layout of the PDSM Payload is defined by various structs shared between
56+ * papr_scm and libndctl so that contents of payload can be interpreted. As such
57+ * its defined as a union of all possible payload structs as
58+ * 'union nd_pdsm_payload'. Based on the value of 'nd_cmd_pkg.nd_command'
59+ * appropriate member of the union is accessed.
60+ */
61+
62+/* Max payload size that we can handle */
63+#define ND_PDSM_PAYLOAD_MAX_SIZE 184
64+
65+/* Max payload size that we can handle */
66+#define ND_PDSM_HDR_SIZE \
67+ (sizeof(struct nd_pkg_pdsm) - ND_PDSM_PAYLOAD_MAX_SIZE)
68+
69+/* Various nvdimm health indicators */
70+#define PAPR_PDSM_DIMM_HEALTHY 0
71+#define PAPR_PDSM_DIMM_UNHEALTHY 1
72+#define PAPR_PDSM_DIMM_CRITICAL 2
73+#define PAPR_PDSM_DIMM_FATAL 3
74+
75+/*
76+ * Struct exchanged between kernel & ndctl in for PAPR_PDSM_HEALTH
77+ * Various flags indicate the health status of the dimm.
78+ *
79+ * extension_flags : Any extension fields present in the struct.
80+ * dimm_unarmed : Dimm not armed. So contents wont persist.
81+ * dimm_bad_shutdown : Previous shutdown did not persist contents.
82+ * dimm_bad_restore : Contents from previous shutdown werent restored.
83+ * dimm_scrubbed : Contents of the dimm have been scrubbed.
84+ * dimm_locked : Contents of the dimm cant be modified until CEC reboot
85+ * dimm_encrypted : Contents of dimm are encrypted.
86+ * dimm_health : Dimm health indicator. One of PAPR_PDSM_DIMM_XXXX
87+ */
88+struct nd_papr_pdsm_health {
89+ union {
90+ struct {
91+ __u32 extension_flags;
92+ __u8 dimm_unarmed;
93+ __u8 dimm_bad_shutdown;
94+ __u8 dimm_bad_restore;
95+ __u8 dimm_scrubbed;
96+ __u8 dimm_locked;
97+ __u8 dimm_encrypted;
98+ __u16 dimm_health;
99+ };
100+ __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
101+ };
102+};
103+
104+/*
105+ * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
106+ * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
107+ */
108+enum papr_pdsm {
109+ PAPR_PDSM_MIN = 0x0,
110+ PAPR_PDSM_HEALTH,
111+ PAPR_PDSM_MAX,
112+};
113+
114+/* Maximal union that can hold all possible payload types */
115+union nd_pdsm_payload {
116+ struct nd_papr_pdsm_health health;
117+ __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
118+} __packed;
119+
120+/*
121+ * PDSM-header + payload expected with ND_CMD_CALL ioctl from libnvdimm
122+ * Valid member of union 'payload' is identified via 'nd_cmd_pkg.nd_command'
123+ * that should always precede this struct when sent to papr_scm via CMD_CALL
124+ * interface.
125+ */
126+struct nd_pkg_pdsm {
127+ __s32 cmd_status; /* Out: Sub-cmd status returned back */
128+ __u16 reserved[2]; /* Ignored and to be set as '0' */
129+ union nd_pdsm_payload payload;
130+} __packed;
131+
132+#endif /* _UAPI_ASM_POWERPC_PAPR_PDSM_H_ */
arch/powerpc/kernel/exceptions-64s.S+2−2
@@ -270,7 +270,7 @@ BEGIN_FTR_SECTION · 269 unmodified lines
270270 END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
271271 .endif
272272
273− ld r10,PACA_EXGEN+EX_CTR(r13)
273+ ld r10,IAREA+EX_CTR(r13)
274274 mtctr r10
275275 BEGIN_FTR_SECTION
276276 ld r10,IAREA+EX_PPR(r13)
@@ -298,7 +298,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) · 21 unmodified lines
298298
299299 .if IKVM_SKIP
300300 89: mtocrf 0x80,r9
301− ld r10,PACA_EXGEN+EX_CTR(r13)
301+ ld r10,IAREA+EX_CTR(r13)
302302 mtctr r10
303303 ld r9,IAREA+EX_R9(r13)
304304 ld r10,IAREA+EX_R10(r13)
arch/powerpc/kernel/kgdb.c+1−1
@@ -421,7 +421,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) · 420 unmodified lines
421421 unsigned int instr;
422422 struct ppc_inst *addr = (struct ppc_inst *)bpt->bpt_addr;
423423
424− err = probe_kernel_address(addr, instr);
424+ err = get_kernel_nofault(instr, (unsigned *) addr);
425425 if (err)
426426 return err;
427427
arch/powerpc/kernel/kprobes.c+1−1
@@ -289,7 +289,7 @@ int kprobe_handler(struct pt_regs *regs) · 288 unmodified lines
289289 if (!p) {
290290 unsigned int instr;
291291
292− if (probe_kernel_address(addr, instr))
292+ if (get_kernel_nofault(instr, addr))
293293 goto no_kprobe;
294294
295295 if (instr != BREAKPOINT_INSTRUCTION) {
arch/powerpc/kernel/module_64.c+4−2
@@ -756,7 +756,8 @@ int module_trampoline_target(struct module *mod, unsigned long addr, · 755 unmodified lines
756756
757757 stub = (struct ppc64_stub_entry *)addr;
758758
759− if (probe_kernel_read(&magic, &stub->magic, sizeof(magic))) {
759+ if (copy_from_kernel_nofault(&magic, &stub->magic,
760+ sizeof(magic))) {
760761 pr_err("%s: fault reading magic for stub %lx for %s\n", __func__, addr, mod->name);
761762 return -EFAULT;
762763 }
@@ -766,7 +767,8 @@ int module_trampoline_target(struct module *mod, unsigned long addr, · 3 unmodified lines
766767 return -EFAULT;
767768 }
768769
769− if (probe_kernel_read(&funcdata, &stub->funcdata, sizeof(funcdata))) {
770+ if (copy_from_kernel_nofault(&funcdata, &stub->funcdata,
771+ sizeof(funcdata))) {
770772 pr_err("%s: fault reading funcdata for stub %lx for %s\n", __func__, addr, mod->name);
771773 return -EFAULT;
772774 }
arch/powerpc/kernel/process.c+14−11
@@ -1252,29 +1252,31 @@ struct task_struct *__switch_to(struct task_struct *prev, · 1251 unmodified lines
12521252 static void show_instructions(struct pt_regs *regs)
12531253 {
12541254 int i;
1255+ unsigned long nip = regs->nip;
12551256 unsigned long pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int));
12561257
12571258 printk("Instruction dump:");
12581259
1260+ /*
1261+ * If we were executing with the MMU off for instructions, adjust pc
1262+ * rather than printing XXXXXXXX.
1263+ */
1264+ if (!IS_ENABLED(CONFIG_BOOKE) && !(regs->msr & MSR_IR)) {
1265+ pc = (unsigned long)phys_to_virt(pc);
1266+ nip = (unsigned long)phys_to_virt(regs->nip);
1267+ }
1268+
12591269 for (i = 0; i < NR_INSN_TO_PRINT; i++) {
12601270 int instr;
12611271
12621272 if (!(i % 8))
12631273 pr_cont("\n");
12641274
1265−#if !defined(CONFIG_BOOKE)
1266− /* If executing with the IMMU off, adjust pc rather
1267− * than print XXXXXXXX.
1268− */
1269− if (!(regs->msr & MSR_IR))
1270− pc = (unsigned long)phys_to_virt(pc);
1271−#endif
1272−
12731275 if (!__kernel_text_address(pc) ||
1274− probe_kernel_address((const void *)pc, instr)) {
1276+ get_kernel_nofault(instr, (const void *)pc)) {
12751277 pr_cont("XXXXXXXX ");
12761278 } else {
1277− if (regs->nip == pc)
1279+ if (nip == pc)
12781280 pr_cont("<%08x> ", instr);
12791281 else
12801282 pr_cont("%08x ", instr);
@@ -1305,7 +1307,8 @@ void show_user_instructions(struct pt_regs *regs) · 24 unmodified lines
13051307 for (i = 0; i < 8 && n; i++, n--, pc += sizeof(int)) {
13061308 int instr;
13071309
1308− if (probe_user_read(&instr, (void __user *)pc, sizeof(instr))) {
1310+ if (copy_from_user_nofault(&instr, (void __user *)pc,
1311+ sizeof(instr))) {
13091312 seq_buf_printf(&s, "XXXXXXXX ");
13101313 continue;
13111314 }
arch/powerpc/kernel/trace/ftrace.c+2−2
@@ -226,7 +226,7 @@ __ftrace_make_nop(struct module *mod, · 225 unmodified lines
226226 unsigned long ip = rec->ip;
227227 unsigned long tramp;
228228
229− if (probe_kernel_read(&op, (void *)ip, MCOUNT_INSN_SIZE))
229+ if (copy_from_kernel_nofault(&op, (void *)ip, MCOUNT_INSN_SIZE))
230230 return -EFAULT;
231231
232232 /* Make sure that that this is still a 24bit jump */
@@ -249,7 +249,7 @@ __ftrace_make_nop(struct module *mod, · 16 unmodified lines
249249 pr_devel("ip:%lx jumps to %lx", ip, tramp);
250250
251251 /* Find where the trampoline jumps to */
252− if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) {
252+ if (copy_from_kernel_nofault(jmp, (void *)tramp, sizeof(jmp))) {
253253 pr_err("Failed to read %lx\n", tramp);
254254 return -EFAULT;
255255 }
arch/powerpc/kvm/book3s_64_mmu_radix.c+4−3
@@ -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)
@@ -64,9 +65,9 @@ unsigned long __kvmhv_copy_tofrom_guest_radix(int lpid, int pid, · 17 unmodified lines
6465 isync();
6566
6667 if (is_load)
67− ret = probe_user_read(to, (const void __user *)from, n);
68+ ret = copy_from_user_nofault(to, (const void __user *)from, n);
6869 else
69− ret = probe_user_write((void __user *)to, from, n);
70+ ret = copy_to_user_nofault((void __user *)to, from, n);
7071
7172 /* switch the pid first to avoid running host with unallocated pid */
7273 if (quadrant == 1 && pid != old_pid)
arch/powerpc/lib/inst.c+6−6
@@ -15,11 +15,11 @@ int probe_user_read_inst(struct ppc_inst *inst, · 14 unmodified lines
1515 unsigned int val, suffix;
1616 int err;
1717
18− err = probe_user_read(&val, nip, sizeof(val));
18+ err = copy_from_user_nofault(&val, nip, sizeof(val));
1919 if (err)
2020 return err;
2121 if (get_op(val) == OP_PREFIX) {
22− err = probe_user_read(&suffix, (void __user *)nip + 4, 4);
22+ err = copy_from_user_nofault(&suffix, (void __user *)nip + 4, 4);
2323 *inst = ppc_inst_prefix(val, suffix);
2424 } else {
2525 *inst = ppc_inst(val);
@@ -33,11 +33,11 @@ int probe_kernel_read_inst(struct ppc_inst *inst, · 7 unmodified lines
3333 unsigned int val, suffix;
3434 int err;
3535
36− err = probe_kernel_read(&val, src, sizeof(val));
36+ err = copy_from_kernel_nofault(&val, src, sizeof(val));
3737 if (err)
3838 return err;
3939 if (get_op(val) == OP_PREFIX) {
40− err = probe_kernel_read(&suffix, (void *)src + 4, 4);
40+ err = copy_from_kernel_nofault(&suffix, (void *)src + 4, 4);
4141 *inst = ppc_inst_prefix(val, suffix);
4242 } else {
4343 *inst = ppc_inst(val);
@@ -51,7 +51,7 @@ int probe_user_read_inst(struct ppc_inst *inst, · 7 unmodified lines
5151 unsigned int val;
5252 int err;
5353
54− err = probe_user_read(&val, nip, sizeof(val));
54+ err = copy_from_user_nofault(&val, nip, sizeof(val));
5555 if (!err)
5656 *inst = ppc_inst(val);
5757
@@ -64,7 +64,7 @@ int probe_kernel_read_inst(struct ppc_inst *inst, · 6 unmodified lines
6464 unsigned int val;
6565 int err;
6666
67− err = probe_kernel_read(&val, src, sizeof(val));
67+ err = copy_from_kernel_nofault(&val, src, sizeof(val));
6868 if (!err)
6969 *inst = ppc_inst(val);
7070
arch/powerpc/mm/book3s64/pkeys.c+0−3
@@ -353,9 +353,6 @@ 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);
360357 if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift)))
361358 return true;
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/oprofile/backtrace.c+4−2
@@ -33,7 +33,8 @@ static unsigned int user_getsp32(unsigned int sp, int is_first) · 32 unmodified lines
3333 * which means that we've done all that we can do from
3434 * interrupt context.
3535 */
36− if (probe_user_read(stack_frame, (void __user *)p, sizeof(stack_frame)))
36+ if (copy_from_user_nofault(stack_frame, (void __user *)p,
37+ sizeof(stack_frame)))
3738 return 0;
3839
3940 if (!is_first)
@@ -51,7 +52,8 @@ static unsigned long user_getsp64(unsigned long sp, int is_first) · 11 unmodified lines
5152 {
5253 unsigned long stack_frame[3];
5354
54− if (probe_user_read(stack_frame, (void __user *)sp, sizeof(stack_frame)))
55+ if (copy_from_user_nofault(stack_frame, (void __user *)sp,
56+ sizeof(stack_frame)))
5557 return 0;
5658
5759 if (!is_first)
arch/powerpc/perf/callchain_32.c+1−1
@@ -44,7 +44,7 @@ static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret) · 43 unmodified lines
4444 ((unsigned long)ptr & 3))
4545 return -EFAULT;
4646
47− rc = probe_user_read(ret, ptr, sizeof(*ret));
47+ rc = copy_from_user_nofault(ret, ptr, sizeof(*ret));
4848
4949 if (IS_ENABLED(CONFIG_PPC64) && rc)
5050 return read_user_stack_slow(ptr, ret, 4);
arch/powerpc/perf/callchain_64.c+1−1
@@ -50,7 +50,7 @@ static int read_user_stack_64(unsigned long __user *ptr, unsigned long *ret) · 49 unmodified lines
5050 ((unsigned long)ptr & 7))
5151 return -EFAULT;
5252
53− if (!probe_user_read(ret, ptr, sizeof(*ret)))
53+ if (!copy_from_user_nofault(ret, ptr, sizeof(*ret)))
5454 return 0;
5555
5656 return read_user_stack_slow(ptr, ret, 8);
arch/powerpc/perf/core-book3s.c+4−2
@@ -418,14 +418,16 @@ static __u64 power_pmu_bhrb_to(u64 addr) · 417 unmodified lines
418418 __u64 target;
419419
420420 if (is_kernel_addr(addr)) {
421− if (probe_kernel_read(&instr, (void *)addr, sizeof(instr)))
421+ if (copy_from_kernel_nofault(&instr, (void *)addr,
422+ sizeof(instr)))
422423 return 0;
423424
424425 return branch_target((struct ppc_inst *)&instr);
425426 }
426427
427428 /* Userspace: need copy instruction here then translate it */
428− if (probe_user_read(&instr, (unsigned int __user *)addr, sizeof(instr)))
429+ if (copy_from_user_nofault(&instr, (unsigned int __user *)addr,
430+ sizeof(instr)))
429431 return 0;
430432
431433 target = branch_target((struct ppc_inst *)&instr);
arch/powerpc/platforms/cell/spu_callbacks.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 */
3636
3737 static void *spu_syscall_table[] = {
38−#define __SYSCALL(nr, entry) entry,
38+#define __SYSCALL(nr, entry) [nr] = entry,
3939 #include <asm/syscall_table_spu.h>
4040 #undef __SYSCALL
4141 };
arch/powerpc/platforms/pseries/papr_scm.c+413−7
@@ -12,16 +12,57 @@ · 11 unmodified lines
1212 #include <linux/libnvdimm.h>
1313 #include <linux/platform_device.h>
1414 #include <linux/delay.h>
15+#include <linux/seq_buf.h>
1516
1617 #include <asm/plpar_wrappers.h>
18+#include <asm/papr_pdsm.h>
1719
1820 #define BIND_ANY_ADDR (~0ul)
1921
2022 #define PAPR_SCM_DIMM_CMD_MASK \
2123 ((1ul << ND_CMD_GET_CONFIG_SIZE) | \
2224 (1ul << ND_CMD_GET_CONFIG_DATA) | \
23− (1ul << ND_CMD_SET_CONFIG_DATA))
24−
25+ (1ul << ND_CMD_SET_CONFIG_DATA) | \
26+ (1ul << ND_CMD_CALL))
27+
28+/* DIMM health bitmap bitmap indicators */
29+/* SCM device is unable to persist memory contents */
30+#define PAPR_PMEM_UNARMED (1ULL << (63 - 0))
31+/* SCM device failed to persist memory contents */
32+#define PAPR_PMEM_SHUTDOWN_DIRTY (1ULL << (63 - 1))
33+/* SCM device contents are persisted from previous IPL */
34+#define PAPR_PMEM_SHUTDOWN_CLEAN (1ULL << (63 - 2))
35+/* SCM device contents are not persisted from previous IPL */
36+#define PAPR_PMEM_EMPTY (1ULL << (63 - 3))
37+/* SCM device memory life remaining is critically low */
38+#define PAPR_PMEM_HEALTH_CRITICAL (1ULL << (63 - 4))
39+/* SCM device will be garded off next IPL due to failure */
40+#define PAPR_PMEM_HEALTH_FATAL (1ULL << (63 - 5))
41+/* SCM contents cannot persist due to current platform health status */
42+#define PAPR_PMEM_HEALTH_UNHEALTHY (1ULL << (63 - 6))
43+/* SCM device is unable to persist memory contents in certain conditions */
44+#define PAPR_PMEM_HEALTH_NON_CRITICAL (1ULL << (63 - 7))
45+/* SCM device is encrypted */
46+#define PAPR_PMEM_ENCRYPTED (1ULL << (63 - 8))
47+/* SCM device has been scrubbed and locked */
48+#define PAPR_PMEM_SCRUBBED_AND_LOCKED (1ULL << (63 - 9))
49+
50+/* Bits status indicators for health bitmap indicating unarmed dimm */
51+#define PAPR_PMEM_UNARMED_MASK (PAPR_PMEM_UNARMED | \
52+ PAPR_PMEM_HEALTH_UNHEALTHY)
53+
54+/* Bits status indicators for health bitmap indicating unflushed dimm */
55+#define PAPR_PMEM_BAD_SHUTDOWN_MASK (PAPR_PMEM_SHUTDOWN_DIRTY)
56+
57+/* Bits status indicators for health bitmap indicating unrestored dimm */
58+#define PAPR_PMEM_BAD_RESTORE_MASK (PAPR_PMEM_EMPTY)
59+
60+/* Bit status indicators for smart event notification */
61+#define PAPR_PMEM_SMART_EVENT_MASK (PAPR_PMEM_HEALTH_CRITICAL | \
62+ PAPR_PMEM_HEALTH_FATAL | \
63+ PAPR_PMEM_HEALTH_UNHEALTHY)
64+
65+/* private struct associated with each region */
2566 struct papr_scm_priv {
2667 struct platform_device *pdev;
2768 struct device_node *dn;
@@ -39,6 +80,15 @@ struct papr_scm_priv { · 11 unmodified lines
3980 struct resource res;
4081 struct nd_region *region;
4182 struct nd_interleave_set nd_set;
83+
84+ /* Protect dimm health data from concurrent read/writes */
85+ struct mutex health_mutex;
86+
87+ /* Last time the health information of the dimm was updated */
88+ unsigned long lasthealth_jiffies;
89+
90+ /* Health information for the dimm */
91+ u64 health_bitmap;
4292 };
4393
4494 static int drc_pmem_bind(struct papr_scm_priv *p)
@@ -144,6 +194,61 @@ err_out: · 99 unmodified lines
144194 return drc_pmem_bind(p);
145195 }
146196
197+/*
198+ * Issue hcall to retrieve dimm health info and populate papr_scm_priv with the
199+ * health information.
200+ */
201+static int __drc_pmem_query_health(struct papr_scm_priv *p)
202+{
203+ unsigned long ret[PLPAR_HCALL_BUFSIZE];
204+ long rc;
205+
206+ /* issue the hcall */
207+ rc = plpar_hcall(H_SCM_HEALTH, ret, p->drc_index);
208+ if (rc != H_SUCCESS) {
209+ dev_err(&p->pdev->dev,
210+ "Failed to query health information, Err:%ld\n", rc);
211+ return -ENXIO;
212+ }
213+
214+ p->lasthealth_jiffies = jiffies;
215+ p->health_bitmap = ret[0] & ret[1];
216+
217+ dev_dbg(&p->pdev->dev,
218+ "Queried dimm health info. Bitmap:0x%016lx Mask:0x%016lx\n",
219+ ret[0], ret[1]);
220+
221+ return 0;
222+}
223+
224+/* Min interval in seconds for assuming stable dimm health */
225+#define MIN_HEALTH_QUERY_INTERVAL 60
226+
227+/* Query cached health info and if needed call drc_pmem_query_health */
228+static int drc_pmem_query_health(struct papr_scm_priv *p)
229+{
230+ unsigned long cache_timeout;
231+ int rc;
232+
233+ /* Protect concurrent modifications to papr_scm_priv */
234+ rc = mutex_lock_interruptible(&p->health_mutex);
235+ if (rc)
236+ return rc;
237+
238+ /* Jiffies offset for which the health data is assumed to be same */
239+ cache_timeout = p->lasthealth_jiffies +
240+ msecs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL * 1000);
241+
242+ /* Fetch new health info is its older than MIN_HEALTH_QUERY_INTERVAL */
243+ if (time_after(jiffies, cache_timeout))
244+ rc = __drc_pmem_query_health(p);
245+ else
246+ /* Assume cached health data is valid */
247+ rc = 0;
248+
249+ mutex_unlock(&p->health_mutex);
250+ return rc;
251+}
147252
148253 static int papr_scm_meta_get(struct papr_scm_priv *p,
149254 struct nd_cmd_get_config_data_hdr *hdr)
@@ -246,16 +351,250 @@ static int papr_scm_meta_set(struct papr_scm_priv *p, · 96 unmodified lines
246351 return 0;
247352 }
248353
354+/*
355+ * Do a sanity checks on the inputs args to dimm-control function and return
356+ * '0' if valid. Validation of PDSM payloads happens later in
357+ * papr_scm_service_pdsm.
358+ */
359+static int is_cmd_valid(struct nvdimm *nvdimm, unsigned int cmd, void *buf,
360+ unsigned int buf_len)
361+{
362+ unsigned long cmd_mask = PAPR_SCM_DIMM_CMD_MASK;
363+ struct nd_cmd_pkg *nd_cmd;
364+ struct papr_scm_priv *p;
365+ enum papr_pdsm pdsm;
366+
367+ /* Only dimm-specific calls are supported atm */
368+ if (!nvdimm)
369+ return -EINVAL;
370+
371+ /* get the provider data from struct nvdimm */
372+ p = nvdimm_provider_data(nvdimm);
373+
374+ if (!test_bit(cmd, &cmd_mask)) {
375+ dev_dbg(&p->pdev->dev, "Unsupported cmd=%u\n", cmd);
376+ return -EINVAL;
377+ }
378+
379+ /* For CMD_CALL verify pdsm request */
380+ if (cmd == ND_CMD_CALL) {
381+ /* Verify the envelope and envelop size */
382+ if (!buf ||
383+ buf_len < (sizeof(struct nd_cmd_pkg) + ND_PDSM_HDR_SIZE)) {
384+ dev_dbg(&p->pdev->dev, "Invalid pkg size=%u\n",
385+ buf_len);
386+ return -EINVAL;
387+ }
388+
389+ /* Verify that the nd_cmd_pkg.nd_family is correct */
390+ nd_cmd = (struct nd_cmd_pkg *)buf;
391+
392+ if (nd_cmd->nd_family != NVDIMM_FAMILY_PAPR) {
393+ dev_dbg(&p->pdev->dev, "Invalid pkg family=0x%llx\n",
394+ nd_cmd->nd_family);
395+ return -EINVAL;
396+ }
397+
398+ pdsm = (enum papr_pdsm)nd_cmd->nd_command;
399+
400+ /* Verify if the pdsm command is valid */
401+ if (pdsm <= PAPR_PDSM_MIN || pdsm >= PAPR_PDSM_MAX) {
402+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Invalid PDSM\n",
403+ pdsm);
404+ return -EINVAL;
405+ }
406+
407+ /* Have enough space to hold returned 'nd_pkg_pdsm' header */
408+ if (nd_cmd->nd_size_out < ND_PDSM_HDR_SIZE) {
409+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Invalid payload\n",
410+ pdsm);
411+ return -EINVAL;
412+ }
413+ }
414+
415+ /* Let the command be further processed */
416+ return 0;
417+}
418+
419+/* Fetch the DIMM health info and populate it in provided package. */
420+static int papr_pdsm_health(struct papr_scm_priv *p,
421+ union nd_pdsm_payload *payload)
422+{
423+ int rc;
424+
425+ /* Ensure dimm health mutex is taken preventing concurrent access */
426+ rc = mutex_lock_interruptible(&p->health_mutex);
427+ if (rc)
428+ goto out;
429+
430+ /* Always fetch upto date dimm health data ignoring cached values */
431+ rc = __drc_pmem_query_health(p);
432+ if (rc) {
433+ mutex_unlock(&p->health_mutex);
434+ goto out;
435+ }
436+
437+ /* update health struct with various flags derived from health bitmap */
438+ payload->health = (struct nd_papr_pdsm_health) {
439+ .extension_flags = 0,
440+ .dimm_unarmed = !!(p->health_bitmap & PAPR_PMEM_UNARMED_MASK),
441+ .dimm_bad_shutdown = !!(p->health_bitmap & PAPR_PMEM_BAD_SHUTDOWN_MASK),
442+ .dimm_bad_restore = !!(p->health_bitmap & PAPR_PMEM_BAD_RESTORE_MASK),
443+ .dimm_scrubbed = !!(p->health_bitmap & PAPR_PMEM_SCRUBBED_AND_LOCKED),
444+ .dimm_locked = !!(p->health_bitmap & PAPR_PMEM_SCRUBBED_AND_LOCKED),
445+ .dimm_encrypted = !!(p->health_bitmap & PAPR_PMEM_ENCRYPTED),
446+ .dimm_health = PAPR_PDSM_DIMM_HEALTHY,
447+ };
448+
449+ /* Update field dimm_health based on health_bitmap flags */
450+ if (p->health_bitmap & PAPR_PMEM_HEALTH_FATAL)
451+ payload->health.dimm_health = PAPR_PDSM_DIMM_FATAL;
452+ else if (p->health_bitmap & PAPR_PMEM_HEALTH_CRITICAL)
453+ payload->health.dimm_health = PAPR_PDSM_DIMM_CRITICAL;
454+ else if (p->health_bitmap & PAPR_PMEM_HEALTH_UNHEALTHY)
455+ payload->health.dimm_health = PAPR_PDSM_DIMM_UNHEALTHY;
456+
457+ /* struct populated hence can release the mutex now */
458+ mutex_unlock(&p->health_mutex);
459+ rc = sizeof(struct nd_papr_pdsm_health);
460+
461+out:
462+ return rc;
463+}
464+
465+/*
466+ * 'struct pdsm_cmd_desc'
467+ * Identifies supported PDSMs' expected length of in/out payloads
468+ * and pdsm service function.
469+ *
470+ * size_in : Size of input payload if any in the PDSM request.
471+ * size_out : Size of output payload if any in the PDSM request.
472+ * service : Service function for the PDSM request. Return semantics:
473+ * rc < 0 : Error servicing PDSM and rc indicates the error.
474+ * rc >=0 : Serviced successfully and 'rc' indicate number of
475+ * bytes written to payload.
476+ */
477+struct pdsm_cmd_desc {
478+ u32 size_in;
479+ u32 size_out;
480+ int (*service)(struct papr_scm_priv *dimm,
481+ union nd_pdsm_payload *payload);
482+};
483+
484+/* Holds all supported PDSMs' command descriptors */
485+static const struct pdsm_cmd_desc __pdsm_cmd_descriptors[] = {
486+ [PAPR_PDSM_MIN] = {
487+ .size_in = 0,
488+ .size_out = 0,
489+ .service = NULL,
490+ },
491+ /* New PDSM command descriptors to be added below */
492+
493+ [PAPR_PDSM_HEALTH] = {
494+ .size_in = 0,
495+ .size_out = sizeof(struct nd_papr_pdsm_health),
496+ .service = papr_pdsm_health,
497+ },
498+ /* Empty */
499+ [PAPR_PDSM_MAX] = {
500+ .size_in = 0,
501+ .size_out = 0,
502+ .service = NULL,
503+ },
504+};
505+
506+/* Given a valid pdsm cmd return its command descriptor else return NULL */
507+static inline const struct pdsm_cmd_desc *pdsm_cmd_desc(enum papr_pdsm cmd)
508+{
509+ if (cmd >= 0 || cmd < ARRAY_SIZE(__pdsm_cmd_descriptors))
510+ return &__pdsm_cmd_descriptors[cmd];
511+
512+ return NULL;
513+}
514+
515+/*
516+ * For a given pdsm request call an appropriate service function.
517+ * Returns errors if any while handling the pdsm command package.
518+ */
519+static int papr_scm_service_pdsm(struct papr_scm_priv *p,
520+ struct nd_cmd_pkg *pkg)
521+{
522+ /* Get the PDSM header and PDSM command */
523+ struct nd_pkg_pdsm *pdsm_pkg = (struct nd_pkg_pdsm *)pkg->nd_payload;
524+ enum papr_pdsm pdsm = (enum papr_pdsm)pkg->nd_command;
525+ const struct pdsm_cmd_desc *pdsc;
526+ int rc;
527+
528+ /* Fetch corresponding pdsm descriptor for validation and servicing */
529+ pdsc = pdsm_cmd_desc(pdsm);
530+
531+ /* Validate pdsm descriptor */
532+ /* Ensure that reserved fields are 0 */
533+ if (pdsm_pkg->reserved[0] || pdsm_pkg->reserved[1]) {
534+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Invalid reserved field\n",
535+ pdsm);
536+ return -EINVAL;
537+ }
538+
539+ /* If pdsm expects some input, then ensure that the size_in matches */
540+ if (pdsc->size_in &&
541+ pkg->nd_size_in != (pdsc->size_in + ND_PDSM_HDR_SIZE)) {
542+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Mismatched size_in=%d\n",
543+ pdsm, pkg->nd_size_in);
544+ return -EINVAL;
545+ }
546+
547+ /* If pdsm wants to return data, then ensure that size_out matches */
548+ if (pdsc->size_out &&
549+ pkg->nd_size_out != (pdsc->size_out + ND_PDSM_HDR_SIZE)) {
550+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Mismatched size_out=%d\n",
551+ pdsm, pkg->nd_size_out);
552+ return -EINVAL;
553+ }
554+
555+ /* Service the pdsm */
556+ if (pdsc->service) {
557+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Servicing..\n", pdsm);
558+
559+ rc = pdsc->service(p, &pdsm_pkg->payload);
560+
561+ if (rc < 0) {
562+ /* error encountered while servicing pdsm */
563+ pdsm_pkg->cmd_status = rc;
564+ pkg->nd_fw_size = ND_PDSM_HDR_SIZE;
565+ } else {
566+ /* pdsm serviced and 'rc' bytes written to payload */
567+ pdsm_pkg->cmd_status = 0;
568+ pkg->nd_fw_size = ND_PDSM_HDR_SIZE + rc;
569+ }
570+ } else {
571+ dev_dbg(&p->pdev->dev, "PDSM[0x%x]: Unsupported PDSM request\n",
572+ pdsm);
573+ pdsm_pkg->cmd_status = -ENOENT;
574+ pkg->nd_fw_size = ND_PDSM_HDR_SIZE;
575+ }
576+
577+ return pdsm_pkg->cmd_status;
578+}
579+
249580 static int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc,
250581 struct nvdimm *nvdimm, unsigned int cmd, void *buf,
251582 unsigned int buf_len, int *cmd_rc)
252583 {
253584 struct nd_cmd_get_config_size *get_size_hdr;
585+ struct nd_cmd_pkg *call_pkg = NULL;
254586 struct papr_scm_priv *p;
587+ int rc;
255588
256− /* Only dimm-specific calls are supported atm */
257− if (!nvdimm)
258− return -EINVAL;
589+ rc = is_cmd_valid(nvdimm, cmd, buf, buf_len);
590+ if (rc) {
591+ pr_debug("Invalid cmd=0x%x. Err=%d\n", cmd, rc);
592+ return rc;
593+ }
594+
595+ /* Use a local variable in case cmd_rc pointer is NULL */
596+ if (!cmd_rc)
597+ cmd_rc = &rc;
259598
260599 p = nvdimm_provider_data(nvdimm);
261600
@@ -277,7 +616,13 @@ static int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc, · 15 unmodified lines
277616 *cmd_rc = papr_scm_meta_set(p, buf);
278617 break;
279618
619+ case ND_CMD_CALL:
620+ call_pkg = (struct nd_cmd_pkg *)buf;
621+ *cmd_rc = papr_scm_service_pdsm(p, call_pkg);
622+ break;
623+
280624 default:
625+ dev_dbg(&p->pdev->dev, "Unknown command = %d\n", cmd);
281626 return -EINVAL;
282627 }
283628
@@ -286,6 +631,64 @@ static int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc, · 2 unmodified lines
286631 return 0;
287632 }
288633
634+static ssize_t flags_show(struct device *dev,
635+ struct device_attribute *attr, char *buf)
636+{
637+ struct nvdimm *dimm = to_nvdimm(dev);
638+ struct papr_scm_priv *p = nvdimm_provider_data(dimm);
639+ struct seq_buf s;
640+ u64 health;
641+ int rc;
642+
643+ rc = drc_pmem_query_health(p);
644+ if (rc)
645+ return rc;
646+
647+ /* Copy health_bitmap locally, check masks & update out buffer */
648+ health = READ_ONCE(p->health_bitmap);
649+
650+ seq_buf_init(&s, buf, PAGE_SIZE);
651+ if (health & PAPR_PMEM_UNARMED_MASK)
652+ seq_buf_printf(&s, "not_armed ");
653+
654+ if (health & PAPR_PMEM_BAD_SHUTDOWN_MASK)
655+ seq_buf_printf(&s, "flush_fail ");
656+
657+ if (health & PAPR_PMEM_BAD_RESTORE_MASK)
658+ seq_buf_printf(&s, "restore_fail ");
659+
660+ if (health & PAPR_PMEM_ENCRYPTED)
661+ seq_buf_printf(&s, "encrypted ");
662+
663+ if (health & PAPR_PMEM_SMART_EVENT_MASK)
664+ seq_buf_printf(&s, "smart_notify ");
665+
666+ if (health & PAPR_PMEM_SCRUBBED_AND_LOCKED)
667+ seq_buf_printf(&s, "scrubbed locked ");
668+
669+ if (seq_buf_used(&s))
670+ seq_buf_printf(&s, "\n");
671+
672+ return seq_buf_used(&s);
673+}
674+DEVICE_ATTR_RO(flags);
675+
676+/* papr_scm specific dimm attributes */
677+static struct attribute *papr_nd_attributes[] = {
678+ &dev_attr_flags.attr,
679+ NULL,
680+};
681+
682+static struct attribute_group papr_nd_attribute_group = {
683+ .name = "papr",
684+ .attrs = papr_nd_attributes,
685+};
686+
687+static const struct attribute_group *papr_nd_attr_groups[] = {
688+ &papr_nd_attribute_group,
689+ NULL,
690+};
691+
289692 static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
290693 {
291694 struct device *dev = &p->pdev->dev;
@@ -312,8 +715,8 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) · 20 unmodified lines
312715 dimm_flags = 0;
313716 set_bit(NDD_LABELING, &dimm_flags);
314717
315− p->nvdimm = nvdimm_create(p->bus, p, NULL, dimm_flags,
316− PAPR_SCM_DIMM_CMD_MASK, 0, NULL);
718+ p->nvdimm = nvdimm_create(p->bus, p, papr_nd_attr_groups,
719+ dimm_flags, PAPR_SCM_DIMM_CMD_MASK, 0, NULL);
317720 if (!p->nvdimm) {
318721 dev_err(dev, "Error creating DIMM object for %pOF\n", p->dn);
319722 goto err;
@@ -399,6 +802,9 @@ static int papr_scm_probe(struct platform_device *pdev) · 79 unmodified lines
399802 if (!p)
400803 return -ENOMEM;
401804
805+ /* Initialize the dimm mutex */
806+ mutex_init(&p->health_mutex);
807+
402808 /* optional DT properties */
403809 of_property_read_u32(dn, "ibm,metadata-size", &metadata_size);
404810
arch/powerpc/sysdev/fsl_pci.c+3−3
@@ -1066,10 +1066,10 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs) · 1065 unmodified lines
10661066
10671067 if (is_in_pci_mem_space(addr)) {
10681068 if (user_mode(regs))
1069− ret = probe_user_read(&inst, (void __user *)regs->nip,
1070− sizeof(inst));
1069+ ret = copy_from_user_nofault(&inst,
1070+ (void __user *)regs->nip, sizeof(inst));
10711071 else
1072− ret = probe_kernel_address((void *)regs->nip, inst);
1072+ ret = get_kernel_nofault(inst, (void *)regs->nip);
10731073
10741074 if (!ret && mcheck_handle_load(regs, inst)) {
10751075 regs->nip += 4;
arch/riscv/include/asm/cmpxchg.h+4−4
@@ -179,7 +179,7 @@ · 178 unmodified lines
179179 " bnez %1, 0b\n" \
180180 "1:\n" \
181181 : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
182− : "rJ" (__old), "rJ" (__new) \
182+ : "rJ" ((long)__old), "rJ" (__new) \
183183 : "memory"); \
184184 break; \
185185 case 8: \
@@ -224,7 +224,7 @@ · 38 unmodified lines
224224 RISCV_ACQUIRE_BARRIER \
225225 "1:\n" \
226226 : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
227− : "rJ" (__old), "rJ" (__new) \
227+ : "rJ" ((long)__old), "rJ" (__new) \
228228 : "memory"); \
229229 break; \
230230 case 8: \
@@ -270,7 +270,7 @@ · 39 unmodified lines
270270 " bnez %1, 0b\n" \
271271 "1:\n" \
272272 : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
273− : "rJ" (__old), "rJ" (__new) \
273+ : "rJ" ((long)__old), "rJ" (__new) \
274274 : "memory"); \
275275 break; \
276276 case 8: \
@@ -316,7 +316,7 @@ · 39 unmodified lines
316316 " fence rw, rw\n" \
317317 "1:\n" \
318318 : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
319− : "rJ" (__old), "rJ" (__new) \
319+ : "rJ" ((long)__old), "rJ" (__new) \
320320 : "memory"); \
321321 break; \
322322 case 8: \
arch/riscv/kernel/ftrace.c+2−1
@@ -38,7 +38,8 @@ static int ftrace_check_current_call(unsigned long hook_pos, · 37 unmodified lines
3838 * Read the text we want to modify;
3939 * return must be -EFAULT on read error
4040 */
41− if (probe_kernel_read(replaced, (void *)hook_pos, MCOUNT_INSN_SIZE))
41+ if (copy_from_kernel_nofault(replaced, (void *)hook_pos,
42+ MCOUNT_INSN_SIZE))
4243 return -EFAULT;
4344
4445 /*
arch/riscv/kernel/kgdb.c+4−4
@@ -62,7 +62,7 @@ int get_step_address(struct pt_regs *regs, unsigned long *next_addr) · 61 unmodified lines
6262 unsigned int rs1_num, rs2_num;
6363 int op_code;
6464
65− if (probe_kernel_address((void *)pc, op_code))
65+ if (get_kernel_nofault(op_code, (void *)pc))
6666 return -EINVAL;
6767 if ((op_code & __INSN_LENGTH_MASK) != __INSN_LENGTH_GE_32) {
6868 if (is_c_jalr_insn(op_code) || is_c_jr_insn(op_code)) {
@@ -146,14 +146,14 @@ int do_single_step(struct pt_regs *regs) · 77 unmodified lines
146146 return error;
147147
148148 /* Store the op code in the stepped address */
149− error = probe_kernel_address((void *)addr, stepped_opcode);
149+ error = get_kernel_nofault(stepped_opcode, (void *)addr);
150150 if (error)
151151 return error;
152152
153153 stepped_address = addr;
154154
155155 /* Replace the op code with the break instruction */
156− error = probe_kernel_write((void *)stepped_address,
156+ error = copy_to_kernel_nofault((void *)stepped_address,
157157 arch_kgdb_ops.gdb_bpt_instr,
158158 BREAK_INSTR_SIZE);
159159 /* Flush and return */
@@ -173,7 +173,7 @@ int do_single_step(struct pt_regs *regs) · 13 unmodified lines
173173 static void undo_single_step(struct pt_regs *regs)
174174 {
175175 if (stepped_opcode != 0) {
176− probe_kernel_write((void *)stepped_address,
176+ copy_to_kernel_nofault((void *)stepped_address,
177177 (void *)&stepped_opcode, BREAK_INSTR_SIZE);
178178 flush_icache_range(stepped_address,
179179 stepped_address + BREAK_INSTR_SIZE);
arch/riscv/kernel/patch.c+2−2
@@ -63,7 +63,7 @@ static int patch_insn_write(void *addr, const void *insn, size_t len) · 62 unmodified lines
6363
6464 waddr = patch_map(addr, FIX_TEXT_POKE0);
6565
66− ret = probe_kernel_write(waddr, insn, len);
66+ ret = copy_to_kernel_nofault(waddr, insn, len);
6767
6868 patch_unmap(FIX_TEXT_POKE0);
6969
@@ -76,7 +76,7 @@ NOKPROBE_SYMBOL(patch_insn_write); · 6 unmodified lines
7676 #else
7777 static int patch_insn_write(void *addr, const void *insn, size_t len)
7878 {
79− return probe_kernel_write(addr, insn, len);
79+ return copy_to_kernel_nofault(addr, insn, len);
8080 }
8181 NOKPROBE_SYMBOL(patch_insn_write);
8282 #endif /* CONFIG_MMU */
arch/riscv/kernel/sys_riscv.c+6−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/syscalls.h>
99 #include <asm/unistd.h>
1010 #include <asm/cacheflush.h>
11+#include <asm-generic/mman-common.h>
1112
1213 static long riscv_sys_mmap(unsigned long addr, unsigned long len,
1314 unsigned long prot, unsigned long flags,
@@ -16,6 +17,11 @@ static long riscv_sys_mmap(unsigned long addr, unsigned long len, · 2 unmodified lines
1617 {
1718 if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
1819 return -EINVAL;
20+
21+ if ((prot & PROT_WRITE) && (prot & PROT_EXEC))
22+ if (unlikely(!(prot & PROT_READ)))
23+ return -EINVAL;
24+
1925 return ksys_mmap_pgoff(addr, len, prot, flags, fd,
2026 offset >> (PAGE_SHIFT - page_shift_offset));
2127 }
arch/riscv/kernel/traps.c+2−2
@@ -137,7 +137,7 @@ static inline unsigned long get_break_insn_length(unsigned long pc) · 136 unmodified lines
137137 {
138138 bug_insn_t insn;
139139
140− if (probe_kernel_address((bug_insn_t *)pc, insn))
140+ if (get_kernel_nofault(insn, (bug_insn_t *)pc))
141141 return 0;
142142
143143 return GET_INSN_LENGTH(insn);
@@ -165,7 +165,7 @@ int is_valid_bugaddr(unsigned long pc) · 21 unmodified lines
165165
166166 if (pc < VMALLOC_START)
167167 return 0;
168− if (probe_kernel_address((bug_insn_t *)pc, insn))
168+ if (get_kernel_nofault(insn, (bug_insn_t *)pc))
169169 return 0;
170170 if ((insn & __INSN_LENGTH_MASK) == __INSN_LENGTH_32)
171171 return (insn == __BUG_INSN_32);
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/riscv/mm/pageattr.c+12−2
@@ -151,6 +151,7 @@ int set_memory_nx(unsigned long addr, int numpages) · 150 unmodified lines
151151
152152 int set_direct_map_invalid_noflush(struct page *page)
153153 {
154+ int ret;
154155 unsigned long start = (unsigned long)page_address(page);
155156 unsigned long end = start + PAGE_SIZE;
156157 struct pageattr_masks masks = {
@@ -158,11 +159,16 @@ int set_direct_map_invalid_noflush(struct page *page) · 1 unmodified line
158159 .clear_mask = __pgprot(_PAGE_PRESENT)
159160 };
160161
161− return walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
162+ mmap_read_lock(&init_mm);
163+ ret = walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
164+ mmap_read_unlock(&init_mm);
165+
166+ return ret;
162167 }
163168
164169 int set_direct_map_default_noflush(struct page *page)
165170 {
171+ int ret;
166172 unsigned long start = (unsigned long)page_address(page);
167173 unsigned long end = start + PAGE_SIZE;
168174 struct pageattr_masks masks = {
@@ -170,7 +176,11 @@ int set_direct_map_default_noflush(struct page *page) · 1 unmodified line
170176 .clear_mask = __pgprot(0)
171177 };
172178
173− return walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
179+ mmap_read_lock(&init_mm);
180+ ret = walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
181+ mmap_read_unlock(&init_mm);
182+
183+ return ret;
174184 }
175185
176186 void __kernel_map_pages(struct page *page, int numpages, int enable)
arch/s390/Kconfig+1−0
@@ -462,6 +462,7 @@ config NUMA · 461 unmodified lines
462462
463463 config NODES_SHIFT
464464 int
465+ depends on NEED_MULTIPLE_NODES
465466 default "1"
466467
467468 config SCHED_SMT
arch/s390/crypto/prng.c+7−7
@@ -693,7 +693,7 @@ static ssize_t prng_chunksize_show(struct device *dev, · 692 unmodified lines
693693 struct device_attribute *attr,
694694 char *buf)
695695 {
696− return snprintf(buf, PAGE_SIZE, "%u\n", prng_chunk_size);
696+ return scnprintf(buf, PAGE_SIZE, "%u\n", prng_chunk_size);
697697 }
698698 static DEVICE_ATTR(chunksize, 0444, prng_chunksize_show, NULL);
699699
@@ -712,7 +712,7 @@ static ssize_t prng_counter_show(struct device *dev, · 12 unmodified lines
712712 counter = prng_data->prngws.byte_counter;
713713 mutex_unlock(&prng_data->mutex);
714714
715− return snprintf(buf, PAGE_SIZE, "%llu\n", counter);
715+ return scnprintf(buf, PAGE_SIZE, "%llu\n", counter);
716716 }
717717 static DEVICE_ATTR(byte_counter, 0444, prng_counter_show, NULL);
718718
@@ -721,7 +721,7 @@ static ssize_t prng_errorflag_show(struct device *dev, · 2 unmodified lines
721721 struct device_attribute *attr,
722722 char *buf)
723723 {
724− return snprintf(buf, PAGE_SIZE, "%d\n", prng_errorflag);
724+ return scnprintf(buf, PAGE_SIZE, "%d\n", prng_errorflag);
725725 }
726726 static DEVICE_ATTR(errorflag, 0444, prng_errorflag_show, NULL);
727727
@@ -731,9 +731,9 @@ static ssize_t prng_mode_show(struct device *dev, · 3 unmodified lines
731731 char *buf)
732732 {
733733 if (prng_mode == PRNG_MODE_TDES)
734− return snprintf(buf, PAGE_SIZE, "TDES\n");
734+ return scnprintf(buf, PAGE_SIZE, "TDES\n");
735735 else
736− return snprintf(buf, PAGE_SIZE, "SHA512\n");
736+ return scnprintf(buf, PAGE_SIZE, "SHA512\n");
737737 }
738738 static DEVICE_ATTR(mode, 0444, prng_mode_show, NULL);
739739
@@ -756,7 +756,7 @@ static ssize_t prng_reseed_limit_show(struct device *dev, · 16 unmodified lines
756756 struct device_attribute *attr,
757757 char *buf)
758758 {
759− return snprintf(buf, PAGE_SIZE, "%u\n", prng_reseed_limit);
759+ return scnprintf(buf, PAGE_SIZE, "%u\n", prng_reseed_limit);
760760 }
761761 static ssize_t prng_reseed_limit_store(struct device *dev,
762762 struct device_attribute *attr,
@@ -787,7 +787,7 @@ static ssize_t prng_strength_show(struct device *dev, · 24 unmodified lines
787787 struct device_attribute *attr,
788788 char *buf)
789789 {
790− return snprintf(buf, PAGE_SIZE, "256\n");
790+ return scnprintf(buf, PAGE_SIZE, "256\n");
791791 }
792792 static DEVICE_ATTR(strength, 0444, prng_strength_show, NULL);
793793
arch/s390/include/asm/syscall.h+11−1
@@ -33,7 +33,17 @@ static inline void syscall_rollback(struct task_struct *task, · 32 unmodified lines
3333 static inline long syscall_get_error(struct task_struct *task,
3434 struct pt_regs *regs)
3535 {
36− return IS_ERR_VALUE(regs->gprs[2]) ? regs->gprs[2] : 0;
36+ unsigned long error = regs->gprs[2];
37+#ifdef CONFIG_COMPAT
38+ if (test_tsk_thread_flag(task, TIF_31BIT)) {
39+ /*
40+ * Sign-extend the value so (int)-EFOO becomes (long)-EFOO
41+ * and will match correctly in comparisons.
42+ */
43+ error = (long)(int)error;
44+ }
45+#endif
46+ return IS_ERR_VALUE(error) ? error : 0;
3747 }
3848
3949 static inline long syscall_get_return_value(struct task_struct *task,
arch/s390/include/asm/vdso.h+1−0
@@ -36,6 +36,7 @@ struct vdso_data { · 35 unmodified lines
3636 __u32 tk_shift; /* Shift used for xtime_nsec 0x60 */
3737 __u32 ts_dir; /* TOD steering direction 0x64 */
3838 __u64 ts_end; /* TOD steering end 0x68 */
39+ __u32 hrtimer_res; /* hrtimer resolution 0x70 */
3940 };
4041
4142 struct vdso_per_cpu_data {
arch/s390/kernel/asm-offsets.c+1−1
@@ -76,6 +76,7 @@ int main(void) · 75 unmodified lines
7676 OFFSET(__VDSO_TK_SHIFT, vdso_data, tk_shift);
7777 OFFSET(__VDSO_TS_DIR, vdso_data, ts_dir);
7878 OFFSET(__VDSO_TS_END, vdso_data, ts_end);
79+ OFFSET(__VDSO_CLOCK_REALTIME_RES, vdso_data, hrtimer_res);
7980 OFFSET(__VDSO_ECTG_BASE, vdso_per_cpu_data, ectg_timer_base);
8081 OFFSET(__VDSO_ECTG_USER, vdso_per_cpu_data, ectg_user_time);
8182 OFFSET(__VDSO_GETCPU_VAL, vdso_per_cpu_data, getcpu_val);
@@ -86,7 +87,6 @@ int main(void) · 4 unmodified lines
8687 DEFINE(__CLOCK_REALTIME_COARSE, CLOCK_REALTIME_COARSE);
8788 DEFINE(__CLOCK_MONOTONIC_COARSE, CLOCK_MONOTONIC_COARSE);
8889 DEFINE(__CLOCK_THREAD_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID);
89− DEFINE(__CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
9090 DEFINE(__CLOCK_COARSE_RES, LOW_RES_NSEC);
9191 BLANK();
9292 /* idle data offsets */
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+2−2
@@ -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
@@ -401,9 +401,9 @@ ENTRY(system_call) · 14 unmodified lines
401401 jnz .Lsysc_nr_ok
402402 # svc 0: system call number in %r1
403403 llgfr %r1,%r1 # clear high word in r1
404+ sth %r1,__PT_INT_CODE+2(%r11)
404405 cghi %r1,NR_syscalls
405406 jnl .Lsysc_nr_ok
406− sth %r1,__PT_INT_CODE+2(%r11)
407407 slag %r8,%r1,3
408408 .Lsysc_nr_ok:
409409 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
arch/s390/kernel/ftrace.c+2−2
@@ -83,7 +83,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, · 82 unmodified lines
8383 {
8484 struct ftrace_insn orig, new, old;
8585
86− if (probe_kernel_read(&old, (void *) rec->ip, sizeof(old)))
86+ if (copy_from_kernel_nofault(&old, (void *) rec->ip, sizeof(old)))
8787 return -EFAULT;
8888 if (addr == MCOUNT_ADDR) {
8989 /* Initial code replacement */
@@ -105,7 +105,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) · 15 unmodified lines
105105 {
106106 struct ftrace_insn orig, new, old;
107107
108− if (probe_kernel_read(&old, (void *) rec->ip, sizeof(old)))
108+ if (copy_from_kernel_nofault(&old, (void *) rec->ip, sizeof(old)))
109109 return -EFAULT;
110110 /* Replace nop with an ftrace call. */
111111 ftrace_generate_nop_insn(&orig);
arch/s390/kernel/ipl.c+1−1
@@ -181,7 +181,7 @@ static ssize_t sys_##_prefix##_##_name##_show(struct kobject *kobj, \ · 180 unmodified lines
181181 struct kobj_attribute *attr, \
182182 char *page) \
183183 { \
184− return snprintf(page, PAGE_SIZE, _format, ##args); \
184+ return scnprintf(page, PAGE_SIZE, _format, ##args); \
185185 }
186186
187187 #define IPL_ATTR_CCW_STORE_FN(_prefix, _name, _ipl_blk) \
arch/s390/kernel/ptrace.c+69−14
@@ -323,6 +323,25 @@ static inline void __poke_user_per(struct task_struct *child, · 322 unmodified lines
323323 child->thread.per_user.end = data;
324324 }
325325
326+static void fixup_int_code(struct task_struct *child, addr_t data)
327+{
328+ struct pt_regs *regs = task_pt_regs(child);
329+ int ilc = regs->int_code >> 16;
330+ u16 insn;
331+
332+ if (ilc > 6)
333+ return;
334+
335+ if (ptrace_access_vm(child, regs->psw.addr - (regs->int_code >> 16),
336+ &insn, sizeof(insn), FOLL_FORCE) != sizeof(insn))
337+ return;
338+
339+ /* double check that tracee stopped on svc instruction */
340+ if ((insn >> 8) != 0xa)
341+ return;
342+
343+ regs->int_code = 0x20000 | (data & 0xffff);
344+}
326345 /*
327346 * Write a word to the user area of a process at location addr. This
328347 * operation does have an additional problem compared to peek_user.
@@ -334,7 +353,9 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) · 5 unmodified lines
334353 struct user *dummy = NULL;
335354 addr_t offset;
336355
356+
337357 if (addr < (addr_t) &dummy->regs.acrs) {
358+ struct pt_regs *regs = task_pt_regs(child);
338359 /*
339360 * psw and gprs are stored on the stack
340361 */
@@ -352,7 +373,11 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) · 11 unmodified lines
352373 /* Invalid addressing mode bits */
353374 return -EINVAL;
354375 }
355− *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
376+
377+ if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
378+ addr == offsetof(struct user, regs.gprs[2]))
379+ fixup_int_code(child, data);
380+ *(addr_t *)((addr_t) &regs->psw + addr) = data;
356381
357382 } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
358383 /*
@@ -718,6 +743,10 @@ static int __poke_user_compat(struct task_struct *child, · 359 unmodified lines
718743 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
719744 (__u64)(tmp & PSW32_ADDR_AMODE);
720745 } else {
746+
747+ if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
748+ addr == offsetof(struct compat_user, regs.gprs[2]))
749+ fixup_int_code(child, data);
721750 /* gpr 0-15 */
722751 *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
723752 }
@@ -837,40 +866,66 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, · 113 unmodified lines
837866 asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
838867 {
839868 unsigned long mask = -1UL;
869+ long ret = -1;
870+
871+ if (is_compat_task())
872+ mask = 0xffffffff;
840873
841874 /*
842875 * The sysc_tracesys code in entry.S stored the system
843876 * call number to gprs[2].
844877 */
845878 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
846− (tracehook_report_syscall_entry(regs) ||
847− regs->gprs[2] >= NR_syscalls)) {
879+ tracehook_report_syscall_entry(regs)) {
848880 /*
849− * Tracing decided this syscall should not happen or the
850− * debugger stored an invalid system call number. Skip
881+ * Tracing decided this syscall should not happen. Skip
851882 * the system call and the system call restart handling.
852883 */
853− clear_pt_regs_flag(regs, PIF_SYSCALL);
854− return -1;
884+ goto skip;
855885 }
856886
887+#ifdef CONFIG_SECCOMP
857888 /* Do the secure computing check after ptrace. */
858− if (secure_computing()) {
859− /* seccomp failures shouldn't expose any additional code. */
860− return -1;
889+ if (unlikely(test_thread_flag(TIF_SECCOMP))) {
890+ struct seccomp_data sd;
891+
892+ if (is_compat_task()) {
893+ sd.instruction_pointer = regs->psw.addr & 0x7fffffff;
894+ sd.arch = AUDIT_ARCH_S390;
895+ } else {
896+ sd.instruction_pointer = regs->psw.addr;
897+ sd.arch = AUDIT_ARCH_S390X;
898+ }
899+
900+ sd.nr = regs->int_code & 0xffff;
901+ sd.args[0] = regs->orig_gpr2 & mask;
902+ sd.args[1] = regs->gprs[3] & mask;
903+ sd.args[2] = regs->gprs[4] & mask;
904+ sd.args[3] = regs->gprs[5] & mask;
905+ sd.args[4] = regs->gprs[6] & mask;
906+ sd.args[5] = regs->gprs[7] & mask;
907+
908+ if (__secure_computing(&sd) == -1)
909+ goto skip;
861910 }
911+#endif /* CONFIG_SECCOMP */
862912
863913 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
864− trace_sys_enter(regs, regs->gprs[2]);
914+ trace_sys_enter(regs, regs->int_code & 0xffff);
865915
866− if (is_compat_task())
867− mask = 0xffffffff;
868916
869− audit_syscall_entry(regs->gprs[2], regs->orig_gpr2 & mask,
917+ audit_syscall_entry(regs->int_code & 0xffff, regs->orig_gpr2 & mask,
870918 regs->gprs[3] &mask, regs->gprs[4] &mask,
871919 regs->gprs[5] &mask);
872920
921+ if ((signed long)regs->gprs[2] >= NR_syscalls) {
922+ regs->gprs[2] = -ENOSYS;
923+ ret = -ENOSYS;
924+ }
873925 return regs->gprs[2];
926+skip:
927+ clear_pt_regs_flag(regs, PIF_SYSCALL);
928+ return ret;
874929 }
875930
876931 asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
arch/s390/kernel/time.c+1−0
@@ -301,6 +301,7 @@ void update_vsyscall(struct timekeeper *tk) · 300 unmodified lines
301301
302302 vdso_data->tk_mult = tk->tkr_mono.mult;
303303 vdso_data->tk_shift = tk->tkr_mono.shift;
304+ vdso_data->hrtimer_res = hrtimer_resolution;
304305 smp_wmb();
305306 ++vdso_data->tb_update_count;
306307 }
arch/s390/kernel/uv.c+4−4
@@ -331,7 +331,7 @@ EXPORT_SYMBOL_GPL(arch_make_page_accessible); · 330 unmodified lines
331331 static ssize_t uv_query_facilities(struct kobject *kobj,
332332 struct kobj_attribute *attr, char *page)
333333 {
334− return snprintf(page, PAGE_SIZE, "%lx\n%lx\n%lx\n%lx\n",
334+ return scnprintf(page, PAGE_SIZE, "%lx\n%lx\n%lx\n%lx\n",
335335 uv_info.inst_calls_list[0],
336336 uv_info.inst_calls_list[1],
337337 uv_info.inst_calls_list[2],
@@ -344,7 +344,7 @@ static struct kobj_attribute uv_query_facilities_attr = · 6 unmodified lines
344344 static ssize_t uv_query_max_guest_cpus(struct kobject *kobj,
345345 struct kobj_attribute *attr, char *page)
346346 {
347− return snprintf(page, PAGE_SIZE, "%d\n",
347+ return scnprintf(page, PAGE_SIZE, "%d\n",
348348 uv_info.max_guest_cpus);
349349 }
350350
@@ -354,7 +354,7 @@ static struct kobj_attribute uv_query_max_guest_cpus_attr = · 3 unmodified lines
354354 static ssize_t uv_query_max_guest_vms(struct kobject *kobj,
355355 struct kobj_attribute *attr, char *page)
356356 {
357− return snprintf(page, PAGE_SIZE, "%d\n",
357+ return scnprintf(page, PAGE_SIZE, "%d\n",
358358 uv_info.max_num_sec_conf);
359359 }
360360
@@ -364,7 +364,7 @@ static struct kobj_attribute uv_query_max_guest_vms_attr = · 3 unmodified lines
364364 static ssize_t uv_query_max_guest_addr(struct kobject *kobj,
365365 struct kobj_attribute *attr, char *page)
366366 {
367− return snprintf(page, PAGE_SIZE, "%lx\n",
367+ return scnprintf(page, PAGE_SIZE, "%lx\n",
368368 uv_info.max_sec_stor_addr);
369369 }
370370
arch/s390/kernel/vdso64/Makefile+4−6
@@ -18,8 +18,8 @@ KBUILD_AFLAGS_64 += -m64 -s · 17 unmodified lines
1818
1919 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
2020 KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin
21−KBUILD_CFLAGS_64 += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
22− -Wl,--hash-style=both
21+ldflags-y := -fPIC -shared -nostdlib -soname=linux-vdso64.so.1 \
22+ --hash-style=both --build-id -T
2323
2424 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
2525 $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64)
@@ -37,8 +37,8 @@ KASAN_SANITIZE := n · 11 unmodified lines
3737 $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
3838
3939 # link rule for the .so file, .lds has to be first
40−$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) FORCE
41− $(call if_changed,vdso64ld)
40+$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) FORCE
41+ $(call if_changed,ld)
4242
4343 # strip rule for the .so file
4444 $(obj)/%.so: OBJCOPYFLAGS := -S
@@ -50,8 +50,6 @@ $(obj-vdso64): %.o: %.S FORCE · 5 unmodified lines
5050 $(call if_changed_dep,vdso64as)
5151
5252 # actual build commands
53−quiet_cmd_vdso64ld = VDSO64L $@
54− cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@
5553 quiet_cmd_vdso64as = VDSO64A $@
5654 cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
5755
arch/s390/kernel/vdso64/clock_getres.S+5−5
@@ -17,12 +17,14 @@ · 16 unmodified lines
1717 .type __kernel_clock_getres,@function
1818 __kernel_clock_getres:
1919 CFI_STARTPROC
20− larl %r1,4f
20+ larl %r1,3f
21+ lg %r0,0(%r1)
2122 cghi %r2,__CLOCK_REALTIME_COARSE
2223 je 0f
2324 cghi %r2,__CLOCK_MONOTONIC_COARSE
2425 je 0f
25− larl %r1,3f
26+ larl %r1,_vdso_data
27+ llgf %r0,__VDSO_CLOCK_REALTIME_RES(%r1)
2628 cghi %r2,__CLOCK_REALTIME
2729 je 0f
2830 cghi %r2,__CLOCK_MONOTONIC
@@ -36,7 +38,6 @@ __kernel_clock_getres: · 7 unmodified lines
3638 jz 2f
3739 0: ltgr %r3,%r3
3840 jz 1f /* res == NULL */
39− lg %r0,0(%r1)
4041 xc 0(8,%r3),0(%r3) /* set tp->tv_sec to zero */
4142 stg %r0,8(%r3) /* store tp->tv_usec */
4243 1: lghi %r2,0
@@ -45,6 +46,5 @@ __kernel_clock_getres: · 2 unmodified lines
4546 svc 0
4647 br %r14
4748 CFI_ENDPROC
48−3: .quad __CLOCK_REALTIME_RES
49−4: .quad __CLOCK_COARSE_RES
49+3: .quad __CLOCK_COARSE_RES
5050 .size __kernel_clock_getres,.-__kernel_clock_getres
arch/s390/mm/fault.c+1−1
@@ -105,7 +105,7 @@ static int bad_address(void *p) · 104 unmodified lines
105105 {
106106 unsigned long dummy;
107107
108− return probe_kernel_address((unsigned long *)p, dummy);
108+ return get_kernel_nofault(dummy, (unsigned long *)p);
109109 }
110110
111111 static void dump_pagetable(unsigned long asce, unsigned long address)
arch/sh/kernel/ftrace.c+3−3
@@ -119,7 +119,7 @@ static void ftrace_mod_code(void) · 118 unmodified lines
119119 * But if one were to fail, then they all should, and if one were
120120 * to succeed, then they all should.
121121 */
122− mod_code_status = probe_kernel_write(mod_code_ip, mod_code_newcode,
122+ mod_code_status = copy_to_kernel_nofault(mod_code_ip, mod_code_newcode,
123123 MCOUNT_INSN_SIZE);
124124
125125 /* if we fail, then kill any new writers */
@@ -203,7 +203,7 @@ static int ftrace_modify_code(unsigned long ip, unsigned char *old_code, · 77 unmodified lines
203203 */
204204
205205 /* read the text we want to modify */
206− if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
206+ if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
207207 return -EFAULT;
208208
209209 /* Make sure it is what we expect it to be */
@@ -268,7 +268,7 @@ static int ftrace_mod(unsigned long ip, unsigned long old_addr, · 58 unmodified lines
268268 {
269269 unsigned char code[MCOUNT_INSN_SIZE];
270270
271− if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE))
271+ if (copy_from_kernel_nofault(code, (void *)ip, MCOUNT_INSN_SIZE))
272272 return -EFAULT;
273273
274274 if (old_addr != __raw_readl((unsigned long *)code))
arch/sh/kernel/traps.c+1−1
@@ -118,7 +118,7 @@ int is_valid_bugaddr(unsigned long addr) · 117 unmodified lines
118118
119119 if (addr < PAGE_OFFSET)
120120 return 0;
121− if (probe_kernel_address((insn_size_t *)addr, opcode))
121+ if (get_kernel_nofault(opcode, (insn_size_t *)addr))
122122 return 0;
123123 if (opcode == TRAPA_BUG_OPCODE)
124124 return 1;
arch/um/kernel/maccess.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 #include <linux/kernel.h>
88 #include <os.h>
99
10−bool probe_kernel_read_allowed(const void *src, size_t size)
10+bool copy_from_kernel_nofault_allowed(const void *src, size_t size)
1111 {
1212 void *psrc = (void *)rounddown((unsigned long)src, PAGE_SIZE);
1313
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/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/common.c+46−3
@@ -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 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)) {
@@ -346,6 +369,8 @@ __visible noinstr void do_syscall_64(unsigned long nr, struct pt_regs *regs) · 210 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+19−28
@@ -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.
@@ -565,16 +544,28 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_BP, exc_int3); · 86 unmodified lines
565544 DECLARE_IDTENTRY_RAW_ERRORCODE(X86_TRAP_PF, exc_page_fault);
566545
567546 #ifdef CONFIG_X86_MCE
547+#ifdef CONFIG_X86_64
568548 DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check);
549+#else
550+DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check);
551+#endif
569552 #endif
570553
571554 /* NMI */
572555 DECLARE_IDTENTRY_NMI(X86_TRAP_NMI, exc_nmi);
573−DECLARE_IDTENTRY_XEN(X86_TRAP_NMI, nmi);
556+#ifdef CONFIG_XEN_PV
557+DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, xenpv_exc_nmi);
558+#endif
574559
575560 /* #DB */
561+#ifdef CONFIG_X86_64
576562 DECLARE_IDTENTRY_DEBUG(X86_TRAP_DB, exc_debug);
577−DECLARE_IDTENTRY_XEN(X86_TRAP_DB, debug);
563+#else
564+DECLARE_IDTENTRY_RAW(X86_TRAP_DB, exc_debug);
565+#endif
566+#ifdef CONFIG_XEN_PV
567+DECLARE_IDTENTRY_RAW(X86_TRAP_DB, xenpv_exc_debug);
568+#endif
578569
579570 /* #DF */
580571 DECLARE_IDTENTRY_DF(X86_TRAP_DF, exc_double_fault);
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/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/asm/ptrace.h+2−2
@@ -278,7 +278,7 @@ static inline unsigned long *regs_get_kernel_stack_nth_addr(struct pt_regs *regs · 277 unmodified lines
278278 }
279279
280280 /* To avoid include hell, we can't include uaccess.h */
281−extern long probe_kernel_read(void *dst, const void *src, size_t size);
281+extern long copy_from_kernel_nofault(void *dst, const void *src, size_t size);
282282
283283 /**
284284 * regs_get_kernel_stack_nth() - get Nth entry of the stack
@@ -298,7 +298,7 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, · 13 unmodified lines
298298
299299 addr = regs_get_kernel_stack_nth_addr(regs, n);
300300 if (addr) {
301− ret = probe_kernel_read(&val, addr, sizeof(val));
301+ ret = copy_from_kernel_nofault(&val, addr, sizeof(val));
302302 if (!ret)
303303 return val;
304304 }
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/dumpstack.c+1−1
@@ -106,7 +106,7 @@ void show_opcodes(struct pt_regs *regs, const char *loglvl) · 105 unmodified lines
106106 bad_ip = user_mode(regs) &&
107107 __chk_range_not_ok(prologue, OPCODE_BUFSIZE, TASK_SIZE_MAX);
108108
109− if (bad_ip || probe_kernel_read(opcodes, (u8 *)prologue,
109+ if (bad_ip || copy_from_kernel_nofault(opcodes, (u8 *)prologue,
110110 OPCODE_BUFSIZE)) {
111111 printk("%sCode: Bad RIP value.\n", loglvl);
112112 } else {
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/ftrace.c+5−5
@@ -86,7 +86,7 @@ static int ftrace_verify_code(unsigned long ip, const char *old_code) · 85 unmodified lines
8686 * sure what we read is what we expected it to be before modifying it.
8787 */
8888 /* read the text we want to modify */
89− if (probe_kernel_read(cur_code, (void *)ip, MCOUNT_INSN_SIZE)) {
89+ if (copy_from_kernel_nofault(cur_code, (void *)ip, MCOUNT_INSN_SIZE)) {
9090 WARN_ON(1);
9191 return -EFAULT;
9292 }
@@ -355,7 +355,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) · 262 unmodified lines
355355 npages = DIV_ROUND_UP(*tramp_size, PAGE_SIZE);
356356
357357 /* Copy ftrace_caller onto the trampoline memory */
358− ret = probe_kernel_read(trampoline, (void *)start_offset, size);
358+ ret = copy_from_kernel_nofault(trampoline, (void *)start_offset, size);
359359 if (WARN_ON(ret < 0))
360360 goto fail;
361361
@@ -363,13 +363,13 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) · 1 unmodified line
363363
364364 /* The trampoline ends with ret(q) */
365365 retq = (unsigned long)ftrace_stub;
366− ret = probe_kernel_read(ip, (void *)retq, RET_SIZE);
366+ ret = copy_from_kernel_nofault(ip, (void *)retq, RET_SIZE);
367367 if (WARN_ON(ret < 0))
368368 goto fail;
369369
370370 if (ops->flags & FTRACE_OPS_FL_SAVE_REGS) {
371371 ip = trampoline + (ftrace_regs_caller_ret - ftrace_regs_caller);
372− ret = probe_kernel_read(ip, (void *)retq, RET_SIZE);
372+ ret = copy_from_kernel_nofault(ip, (void *)retq, RET_SIZE);
373373 if (WARN_ON(ret < 0))
374374 goto fail;
375375 }
@@ -506,7 +506,7 @@ static void *addr_from_call(void *ptr) · 130 unmodified lines
506506 union text_poke_insn call;
507507 int ret;
508508
509− ret = probe_kernel_read(&call, ptr, CALL_INSN_SIZE);
509+ ret = copy_from_kernel_nofault(&call, ptr, CALL_INSN_SIZE);
510510 if (WARN_ON_ONCE(ret < 0))
511511 return NULL;
512512
arch/x86/kernel/kgdb.c+3−3
@@ -732,11 +732,11 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) · 731 unmodified lines
732732 int err;
733733
734734 bpt->type = BP_BREAKPOINT;
735− err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
735+ err = copy_from_kernel_nofault(bpt->saved_instr, (char *)bpt->bpt_addr,
736736 BREAK_INSTR_SIZE);
737737 if (err)
738738 return err;
739− err = probe_kernel_write((char *)bpt->bpt_addr,
739+ err = copy_to_kernel_nofault((char *)bpt->bpt_addr,
740740 arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
741741 if (!err)
742742 return err;
@@ -768,7 +768,7 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) · 25 unmodified lines
768768 return 0;
769769
770770 knl_write:
771− return probe_kernel_write((char *)bpt->bpt_addr,
771+ return copy_to_kernel_nofault((char *)bpt->bpt_addr,
772772 (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
773773 }
774774
arch/x86/kernel/kprobes/core.c+6−15
@@ -243,7 +243,7 @@ __recover_probed_insn(kprobe_opcode_t *buf, unsigned long addr) · 242 unmodified lines
243243 * Fortunately, we know that the original code is the ideal 5-byte
244244 * long NOP.
245245 */
246− if (probe_kernel_read(buf, (void *)addr,
246+ if (copy_from_kernel_nofault(buf, (void *)addr,
247247 MAX_INSN_SIZE * sizeof(kprobe_opcode_t)))
248248 return 0UL;
249249
@@ -346,7 +346,8 @@ int __copy_instruction(u8 *dest, u8 *src, u8 *real, struct insn *insn) · 96 unmodified lines
346346 return 0;
347347
348348 /* This can access kernel text if given address is not recovered */
349− if (probe_kernel_read(dest, (void *)recovered_insn, MAX_INSN_SIZE))
349+ if (copy_from_kernel_nofault(dest, (void *)recovered_insn,
350+ MAX_INSN_SIZE))
350351 return 0;
351352
352353 kernel_insn_init(insn, dest, MAX_INSN_SIZE);
@@ -753,16 +754,11 @@ asm( · 400 unmodified lines
753754 NOKPROBE_SYMBOL(kretprobe_trampoline);
754755 STACK_FRAME_NON_STANDARD(kretprobe_trampoline);
755756
756−static struct kprobe kretprobe_kprobe = {
757− .addr = (void *)kretprobe_trampoline,
758−};
759−
760757 /*
761758 * Called from kretprobe_trampoline
762759 */
763760 __used __visible void *trampoline_handler(struct pt_regs *regs)
764761 {
765− struct kprobe_ctlblk *kcb;
766762 struct kretprobe_instance *ri = NULL;
767763 struct hlist_head *head, empty_rp;
768764 struct hlist_node *tmp;
@@ -772,16 +768,12 @@ __used __visible void *trampoline_handler(struct pt_regs *regs) · 3 unmodified lines
772768 void *frame_pointer;
773769 bool skipped = false;
774770
775− preempt_disable();
776−
777771 /*
778772 * Set a dummy kprobe for avoiding kretprobe recursion.
779773 * Since kretprobe never run in kprobe handler, kprobe must not
780774 * be running at this point.
781775 */
782− kcb = get_kprobe_ctlblk();
783− __this_cpu_write(current_kprobe, &kretprobe_kprobe);
784− kcb->kprobe_status = KPROBE_HIT_ACTIVE;
776+ kprobe_busy_begin();
785777
786778 INIT_HLIST_HEAD(&empty_rp);
787779 kretprobe_hash_lock(current, &head, &flags);
@@ -857,7 +849,7 @@ __used __visible void *trampoline_handler(struct pt_regs *regs) · 69 unmodified lines
857849 __this_cpu_write(current_kprobe, &ri->rp->kp);
858850 ri->ret_addr = correct_ret_addr;
859851 ri->rp->handler(ri, regs);
860− __this_cpu_write(current_kprobe, &kretprobe_kprobe);
852+ __this_cpu_write(current_kprobe, &kprobe_busy);
861853 }
862854
863855 recycle_rp_inst(ri, &empty_rp);
@@ -873,8 +865,7 @@ __used __visible void *trampoline_handler(struct pt_regs *regs) · 9 unmodified lines
873865
874866 kretprobe_hash_unlock(current, &flags);
875867
876− __this_cpu_write(current_kprobe, NULL);
877− preempt_enable();
868+ kprobe_busy_end();
878869
879870 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
880871 hlist_del(&ri->hlist);
arch/x86/kernel/kprobes/opt.c+1−1
@@ -56,7 +56,7 @@ found: · 55 unmodified lines
5656 * overwritten by jump destination address. In this case, original
5757 * bytes must be recovered from op->optinsn.copied_insn buffer.
5858 */
59− if (probe_kernel_read(buf, (void *)addr,
59+ if (copy_from_kernel_nofault(buf, (void *)addr,
6060 MAX_INSN_SIZE * sizeof(kprobe_opcode_t)))
6161 return 0UL;
6262
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/probe_roms.c+12−12
@@ -94,12 +94,12 @@ static bool match_id(struct pci_dev *pdev, unsigned short vendor, unsigned short · 93 unmodified lines
9494 }
9595
9696 static bool probe_list(struct pci_dev *pdev, unsigned short vendor,
97− const unsigned char *rom_list)
97+ const void *rom_list)
9898 {
9999 unsigned short device;
100100
101101 do {
102− if (probe_kernel_address(rom_list, device) != 0)
102+ if (get_kernel_nofault(device, rom_list) != 0)
103103 device = 0;
104104
105105 if (device && match_id(pdev, vendor, device))
@@ -119,19 +119,19 @@ static struct resource *find_oprom(struct pci_dev *pdev) · 13 unmodified lines
119119 for (i = 0; i < ARRAY_SIZE(adapter_rom_resources); i++) {
120120 struct resource *res = &adapter_rom_resources[i];
121121 unsigned short offset, vendor, device, list, rev;
122− const unsigned char *rom;
122+ const void *rom;
123123
124124 if (res->end == 0)
125125 break;
126126
127127 rom = isa_bus_to_virt(res->start);
128− if (probe_kernel_address(rom + 0x18, offset) != 0)
128+ if (get_kernel_nofault(offset, rom + 0x18) != 0)
129129 continue;
130130
131− if (probe_kernel_address(rom + offset + 0x4, vendor) != 0)
131+ if (get_kernel_nofault(vendor, rom + offset + 0x4) != 0)
132132 continue;
133133
134− if (probe_kernel_address(rom + offset + 0x6, device) != 0)
134+ if (get_kernel_nofault(device, rom + offset + 0x6) != 0)
135135 continue;
136136
137137 if (match_id(pdev, vendor, device)) {
@@ -139,8 +139,8 @@ static struct resource *find_oprom(struct pci_dev *pdev) · 1 unmodified line
139139 break;
140140 }
141141
142− if (probe_kernel_address(rom + offset + 0x8, list) == 0 &&
143− probe_kernel_address(rom + offset + 0xc, rev) == 0 &&
142+ if (get_kernel_nofault(list, rom + offset + 0x8) == 0 &&
143+ get_kernel_nofault(rev, rom + offset + 0xc) == 0 &&
144144 rev >= 3 && list &&
145145 probe_list(pdev, vendor, rom + offset + list)) {
146146 oprom = res;
@@ -183,14 +183,14 @@ static int __init romsignature(const unsigned char *rom) · 36 unmodified lines
183183 const unsigned short * const ptr = (const unsigned short *)rom;
184184 unsigned short sig;
185185
186− return probe_kernel_address(ptr, sig) == 0 && sig == ROMSIGNATURE;
186+ return get_kernel_nofault(sig, ptr) == 0 && sig == ROMSIGNATURE;
187187 }
188188
189189 static int __init romchecksum(const unsigned char *rom, unsigned long length)
190190 {
191191 unsigned char sum, c;
192192
193− for (sum = 0; length && probe_kernel_address(rom++, c) == 0; length--)
193+ for (sum = 0; length && get_kernel_nofault(c, rom++) == 0; length--)
194194 sum += c;
195195 return !length && !sum;
196196 }
@@ -211,7 +211,7 @@ void __init probe_roms(void) · 14 unmodified lines
211211
212212 video_rom_resource.start = start;
213213
214− if (probe_kernel_address(rom + 2, c) != 0)
214+ if (get_kernel_nofault(c, rom + 2) != 0)
215215 continue;
216216
217217 /* 0 < length <= 0x7f * 512, historically */
@@ -249,7 +249,7 @@ void __init probe_roms(void) · 31 unmodified lines
249249 if (!romsignature(rom))
250250 continue;
251251
252− if (probe_kernel_address(rom + 2, c) != 0)
252+ if (get_kernel_nofault(c, rom + 2) != 0)
253253 continue;
254254
255255 /* 0 < length <= 0x7f * 512, historically */
arch/x86/kernel/traps.c+56−39
@@ -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 (probe_kernel_address((unsigned short *)addr, ud))
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();
@@ -488,7 +492,8 @@ static enum kernel_gp_hint get_kernel_gp_address(struct pt_regs *regs, · 232 unmodified lines
488492 u8 insn_buf[MAX_INSN_SIZE];
489493 struct insn insn;
490494
491− if (probe_kernel_read(insn_buf, (void *)regs->ip, MAX_INSN_SIZE))
495+ if (copy_from_kernel_nofault(insn_buf, (void *)regs->ip,
496+ MAX_INSN_SIZE))
492497 return GP_NO_HINT;
493498
494499 kernel_insn_init(&insn, insn_buf, MAX_INSN_SIZE);
@@ -690,13 +695,13 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s) · 195 unmodified lines
690695 (struct bad_iret_stack *)__this_cpu_read(cpu_tss_rw.x86_tss.sp0) - 1;
691696
692697 /* Copy the IRET target to the temporary storage. */
693− memcpy(&tmp.regs.ip, (void *)s->regs.sp, 5*8);
698+ __memcpy(&tmp.regs.ip, (void *)s->regs.sp, 5*8);
694699
695700 /* Copy the remainder of the stack from the current stack. */
696− memcpy(&tmp, s, offsetof(struct bad_iret_stack, regs.ip));
701+ __memcpy(&tmp, s, offsetof(struct bad_iret_stack, regs.ip));
697702
698703 /* Update the entry stack */
699− memcpy(new_stack, &tmp, sizeof(tmp));
704+ __memcpy(new_stack, &tmp, sizeof(tmp));
700705
701706 BUG_ON(!user_mode(&new_stack->regs));
702707 return new_stack;
@@ -864,6 +869,12 @@ static __always_inline void exc_debug_kernel(struct pt_regs *regs, · 161 unmodified lines
864869 instrumentation_begin();
865870 trace_hardirqs_off_finish();
866871
872+ /*
873+ * If something gets miswired and we end up here for a user mode
874+ * #DB, we will malfunction.
875+ */
876+ WARN_ON_ONCE(user_mode(regs));
877+
867878 /*
868879 * Catch SYSENTER with TF set and clear DR_STEP. If this hit a
869880 * watchpoint at the same time then that will still be handled.
@@ -882,6 +893,12 @@ static __always_inline void exc_debug_kernel(struct pt_regs *regs, · 12 unmodified lines
882893 static __always_inline void exc_debug_user(struct pt_regs *regs,
883894 unsigned long dr6)
884895 {
896+ /*
897+ * If something gets miswired and we end up here for a kernel mode
898+ * #DB, we will malfunction.
899+ */
900+ WARN_ON_ONCE(!user_mode(regs));
901+
885902 idtentry_enter_user(regs);
886903 instrumentation_begin();
887904
@@ -912,7 +929,7 @@ DEFINE_IDTENTRY_DEBUG_USER(exc_debug) · 24 unmodified lines
912929 }
913930 #else
914931 /* 32 bit does not have separate entry points. */
915−DEFINE_IDTENTRY_DEBUG(exc_debug)
932+DEFINE_IDTENTRY_RAW(exc_debug)
916933 {
917934 unsigned long dr6, dr7;
918935
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+2−2
@@ -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 }
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/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+4−23
@@ -6606,23 +6606,6 @@ static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx) · 6605 unmodified lines
66066606 msrs[i].host, false);
66076607 }
66086608
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−
66266609 static void vmx_update_hv_timer(struct kvm_vcpu *vcpu)
66276610 {
66286611 struct vcpu_vmx *vmx = to_vmx(vcpu);
@@ -6728,9 +6711,7 @@ reenter_guest: · 99 unmodified lines
67286711
67296712 pt_guest_enter(vmx);
67306713
6731− if (vcpu_to_pmu(vcpu)->version)
6732− atomic_switch_perf_msrs(vmx);
6733− atomic_switch_umwait_control_msr(vmx);
6714+ atomic_switch_perf_msrs(vmx);
67346715
67356716 if (enable_preemption_timer)
67366717 vmx_update_hv_timer(vcpu);
@@ -7501,11 +7482,11 @@ static void vmx_flush_log_dirty(struct kvm *kvm) · 764 unmodified lines
75017482 kvm_flush_pml_buffers(kvm);
75027483 }
75037484
7504−static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
7485+static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu, gpa_t gpa)
75057486 {
75067487 struct vmcs12 *vmcs12;
75077488 struct vcpu_vmx *vmx = to_vmx(vcpu);
7508− gpa_t gpa, dst;
7489+ gpa_t dst;
75097490
75107491 if (is_guest_mode(vcpu)) {
75117492 WARN_ON_ONCE(vmx->nested.pml_full);
@@ -7524,7 +7505,7 @@ static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu) · 12 unmodified lines
75247505 return 1;
75257506 }
75267507
7527− gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS) & ~0xFFFull;
7508+ gpa &= ~0xFFFull;
75287509 dst = vmcs12->pml_address + sizeof(u64) * vmcs12->guest_pml_index;
75297510
75307511 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+4−3
@@ -2856,7 +2856,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 2855 unmodified lines
28562856 return kvm_mtrr_set_msr(vcpu, msr, data);
28572857 case MSR_IA32_APICBASE:
28582858 return kvm_set_apic_base(vcpu, msr_info);
2859− case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
2859+ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
28602860 return kvm_x2apic_msr_write(vcpu, msr, data);
28612861 case MSR_IA32_TSCDEADLINE:
28622862 kvm_set_lapic_tscdeadline_msr(vcpu, data);
@@ -3196,7 +3196,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 333 unmodified lines
31963196 case MSR_IA32_APICBASE:
31973197 msr_info->data = kvm_get_apic_base(vcpu);
31983198 break;
3199− case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
3199+ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
32003200 return kvm_x2apic_msr_read(vcpu, msr_info->index, &msr_info->data);
32013201 case MSR_IA32_TSCDEADLINE:
32023202 msr_info->data = kvm_get_lapic_tscdeadline_msr(vcpu);
@@ -4603,7 +4603,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp, · 1400 unmodified lines
46034603 r = -EINVAL;
46044604 user_tsc_khz = (u32)arg;
46054605
4606− if (user_tsc_khz >= kvm_max_guest_tsc_khz)
4606+ if (kvm_has_tsc_control &&
4607+ user_tsc_khz >= kvm_max_guest_tsc_khz)
46074608 goto out;
46084609
46094610 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/mm/fault.c+4−4
@@ -99,7 +99,7 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr, · 98 unmodified lines
9999 return !instr_lo || (instr_lo>>1) == 1;
100100 case 0x00:
101101 /* Prefetch instruction is 0x0F0D or 0x0F18 */
102− if (probe_kernel_address(instr, opcode))
102+ if (get_kernel_nofault(opcode, instr))
103103 return 0;
104104
105105 *prefetch = (instr_lo == 0xF) &&
@@ -133,7 +133,7 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) · 27 unmodified lines
133133 while (instr < max_instr) {
134134 unsigned char opcode;
135135
136− if (probe_kernel_address(instr, opcode))
136+ if (get_kernel_nofault(opcode, instr))
137137 break;
138138
139139 instr++;
@@ -301,7 +301,7 @@ static int bad_address(void *p) · 161 unmodified lines
301301 {
302302 unsigned long dummy;
303303
304− return probe_kernel_address((unsigned long *)p, dummy);
304+ return get_kernel_nofault(dummy, (unsigned long *)p);
305305 }
306306
307307 static void dump_pagetable(unsigned long address)
@@ -442,7 +442,7 @@ static void show_ldttss(const struct desc_ptr *gdt, const char *name, u16 index) · 134 unmodified lines
442442 return;
443443 }
444444
445− if (probe_kernel_read(&desc, (void *)(gdt->address + offset),
445+ if (copy_from_kernel_nofault(&desc, (void *)(gdt->address + offset),
446446 sizeof(struct ldttss_desc))) {
447447 pr_alert("%s: 0x%hx -- GDT entry is not readable\n",
448448 name, index);
arch/x86/mm/init_32.c+1−1
@@ -737,7 +737,7 @@ static void __init test_wp_bit(void) · 736 unmodified lines
737737
738738 __set_fixmap(FIX_WP_TEST, __pa_symbol(empty_zero_page), PAGE_KERNEL_RO);
739739
740− if (probe_kernel_write((char *)fix_to_virt(FIX_WP_TEST), &z, 1)) {
740+ if (copy_to_kernel_nofault((char *)fix_to_virt(FIX_WP_TEST), &z, 1)) {
741741 clear_fixmap(FIX_WP_TEST);
742742 printk(KERN_CONT "Ok.\n");
743743 return;
arch/x86/mm/maccess.c+2−2
@@ -9,7 +9,7 @@ static __always_inline u64 canonical_address(u64 vaddr, u8 vaddr_bits) · 8 unmodified lines
99 return ((s64)vaddr << (64 - vaddr_bits)) >> (64 - vaddr_bits);
1010 }
1111
12−bool probe_kernel_read_allowed(const void *unsafe_src, size_t size)
12+bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
1313 {
1414 unsigned long vaddr = (unsigned long)unsafe_src;
1515
@@ -22,7 +22,7 @@ bool probe_kernel_read_allowed(const void *unsafe_src, size_t size) · 6 unmodified lines
2222 canonical_address(vaddr, boot_cpu_data.x86_virt_bits) == vaddr;
2323 }
2424 #else
25−bool probe_kernel_read_allowed(const void *unsafe_src, size_t size)
25+bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
2626 {
2727 return (unsigned long)unsafe_src >= TASK_SIZE_MAX;
2828 }
arch/x86/pci/pcbios.c+1−1
@@ -302,7 +302,7 @@ static const struct pci_raw_ops *__init pci_find_bios(void) · 301 unmodified lines
302302 check <= (union bios32 *) __va(0xffff0);
303303 ++check) {
304304 long sig;
305− if (probe_kernel_address(&check->fields.signature, sig))
305+ if (get_kernel_nofault(sig, &check->fields.signature))
306306 continue;
307307
308308 if (check->fields.signature != BIOS32_SIGNATURE)
arch/x86/platform/intel-mid/sfi.c+2−2
@@ -287,8 +287,8 @@ void intel_scu_devices_create(void) · 286 unmodified lines
287287
288288 adapter = i2c_get_adapter(i2c_bus[i]);
289289 if (adapter) {
290− client = i2c_new_device(adapter, i2c_devs[i]);
291− if (!client)
290+ client = i2c_new_client_device(adapter, i2c_devs[i]);
291+ if (IS_ERR(client))
292292 pr_err("can't create i2c device %s\n",
293293 i2c_devs[i]->type);
294294 } else
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/purgatory/Makefile+1−0
@@ -34,6 +34,7 @@ KCOV_INSTRUMENT := n · 33 unmodified lines
3434 PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
3535 PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss
3636 PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING
37+PURGATORY_CFLAGS += $(call cc-option,-fno-stack-protector)
3738
3839 # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
3940 # in turn leaves some undefined symbols like __fentry__ in purgatory and not
arch/x86/xen/enlighten_pv.c+25−5
@@ -386,7 +386,7 @@ static void set_aliased_prot(void *v, pgprot_t prot) · 385 unmodified lines
386386
387387 preempt_disable();
388388
389− probe_kernel_read(&dummy, v, 1);
389+ copy_from_kernel_nofault(&dummy, v, 1);
390390
391391 if (HYPERVISOR_update_va_mapping((unsigned long)v, pte, 0))
392392 BUG();
@@ -598,6 +598,26 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum, · 205 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
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 */
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-tag.c+1−1
@@ -376,7 +376,7 @@ static void __blk_mq_all_tag_iter(struct blk_mq_tags *tags, · 375 unmodified lines
376376 void blk_mq_all_tag_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
377377 void *priv)
378378 {
379− return __blk_mq_all_tag_iter(tags, fn, priv, BT_TAG_ITER_STATIC_RQS);
379+ __blk_mq_all_tag_iter(tags, fn, priv, BT_TAG_ITER_STATIC_RQS);
380380 }
381381
382382 /**
block/blk-mq.c+3−1
@@ -3479,7 +3479,9 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, · 3478 unmodified lines
34793479
34803480 if (set->nr_maps == 1 && nr_hw_queues > nr_cpu_ids)
34813481 nr_hw_queues = nr_cpu_ids;
3482− if (nr_hw_queues < 1 || nr_hw_queues == set->nr_hw_queues)
3482+ if (nr_hw_queues < 1)
3483+ return;
3484+ if (set->nr_maps == 1 && nr_hw_queues == set->nr_hw_queues)
34833485 return;
34843486
34853487 list_for_each_entry(q, &set->tag_list, tag_set_list)
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);
block/partitions/ldm.c+1−1
@@ -910,7 +910,7 @@ static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb) · 909 unmodified lines
910910 return false;
911911
912912 disk = &vb->vblk.disk;
913− uuid_copy(&disk->disk_id, (uuid_t *)(buffer + 0x18 + r_name));
913+ import_uuid(&disk->disk_id, buffer + 0x18 + r_name);
914914 return true;
915915 }
916916
block/partitions/ldm.h+1−1
@@ -93,7 +93,7 @@ struct frag { /* VBLK Fragment handling */ · 92 unmodified lines
9393 u8 num; /* Total number of records */
9494 u8 rec; /* This is record number n */
9595 u8 map; /* Which portions are in use */
96− u8 data[0];
96+ u8 data[];
9797 };
9898
9999 /* In memory LDM database structures. */
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/algboss.c+0−2
@@ -178,8 +178,6 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) · 177 unmodified lines
178178 if (IS_ERR(thread))
179179 goto err_put_larval;
180180
181− wait_for_completion_interruptible(&larval->completion);
182−
183181 return NOTIFY_STOP;
184182
185183 err_put_larval:
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+4−11
@@ -74,14 +74,10 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg, · 73 unmodified lines
7474 return PTR_ERR(areq);
7575
7676 /* convert iovecs of output buffers into RX SGL */
77− err = af_alg_get_rsgl(sk, msg, flags, areq, -1, &len);
77+ err = af_alg_get_rsgl(sk, msg, flags, areq, ctx->used, &len);
7878 if (err)
7979 goto free;
8080
81− /* Process only as much RX buffers for which we have TX data */
82− if (len > ctx->used)
83− len = ctx->used;
84−
8581 /*
8682 * If more buffers are to be expected to be processed, process only
8783 * full block size buffers.
@@ -215,7 +211,7 @@ static int skcipher_check_key(struct socket *sock) · 127 unmodified lines
215211 struct alg_sock *ask = alg_sk(sk);
216212
217213 lock_sock(sk);
218− if (ask->refcnt)
214+ if (!atomic_read(&ask->nokey_refcnt))
219215 goto unlock_child;
220216
221217 psk = ask->parent;
@@ -227,11 +223,8 @@ static int skcipher_check_key(struct socket *sock) · 5 unmodified lines
227223 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
228224 goto unlock;
229225
230− if (!pask->refcnt++)
231− sock_hold(psk);
232−
233− ask->refcnt = 1;
234− sock_put(psk);
226+ atomic_dec(&pask->nokey_refcnt);
227+ atomic_set(&ask->nokey_refcnt, 0);
235228
236229 err = 0;
237230
crypto/drbg.c+4−2
@@ -1631,10 +1631,12 @@ static int drbg_uninstantiate(struct drbg_state *drbg) · 1630 unmodified lines
16311631 if (drbg->random_ready.func) {
16321632 del_random_ready_callback(&drbg->random_ready);
16331633 cancel_work_sync(&drbg->seed_work);
1634− crypto_free_rng(drbg->jent);
1635− drbg->jent = NULL;
16361634 }
16371635
1636+ if (!IS_ERR_OR_NULL(drbg->jent))
1637+ crypto_free_rng(drbg->jent);
1638+ drbg->jent = NULL;
1639+
16381640 if (drbg->d_ops)
16391641 drbg->d_ops->crypto_fini(drbg);
16401642 drbg_dealloc_state(drbg);
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/amba/tegra-ahb.c+1−1
@@ -120,7 +120,7 @@ static const u32 tegra_ahb_gizmo[] = { · 119 unmodified lines
120120 struct tegra_ahb {
121121 void __iomem *regs;
122122 struct device *dev;
123− u32 ctx[0];
123+ u32 ctx[];
124124 };
125125
126126 static inline u32 gizmo_readl(struct tegra_ahb *ahb, u32 offset)
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/ata/libata-core.c+5−6
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #include <linux/workqueue.h>
4343 #include <linux/scatterlist.h>
4444 #include <linux/io.h>
45−#include <linux/async.h>
4645 #include <linux/log2.h>
4746 #include <linux/slab.h>
4847 #include <linux/glob.h>
@@ -5778,7 +5777,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) · 5729 unmodified lines
57785777 /* perform each probe asynchronously */
57795778 for (i = 0; i < host->n_ports; i++) {
57805779 struct ata_port *ap = host->ports[i];
5781− async_schedule(async_port_probe, ap);
5780+ ap->cookie = async_schedule(async_port_probe, ap);
57825781 }
57835782
57845783 return 0;
@@ -5920,11 +5919,11 @@ void ata_host_detach(struct ata_host *host) · 135 unmodified lines
59205919 {
59215920 int i;
59225921
5923− /* Ensure ata_port probe has completed */
5924− async_synchronize_full();
5925−
5926− for (i = 0; i < host->n_ports; i++)
5922+ for (i = 0; i < host->n_ports; i++) {
5923+ /* Ensure ata_port probe has completed */
5924+ async_synchronize_cookie(host->ports[i]->cookie + 1);
59275925 ata_port_detach(host->ports[i]);
5926+ }
59285927
59295928 /* the host is dead now, dissociate ACPI */
59305929 ata_acpi_dissociate(host);
drivers/ata/libata-scsi.c+6−3
@@ -3684,12 +3684,13 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc) · 3683 unmodified lines
36843684 {
36853685 struct scsi_cmnd *scmd = qc->scsicmd;
36863686 const u8 *cdb = scmd->cmnd;
3687− const u8 *p;
36883687 u8 pg, spg;
36893688 unsigned six_byte, pg_len, hdr_len, bd_len;
36903689 int len;
36913690 u16 fp = (u16)-1;
36923691 u8 bp = 0xff;
3692+ u8 buffer[64];
3693+ const u8 *p = buffer;
36933694
36943695 VPRINTK("ENTER\n");
36953696
@@ -3723,12 +3724,14 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc) · 27 unmodified lines
37233724 if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len)
37243725 goto invalid_param_len;
37253726
3726− p = page_address(sg_page(scsi_sglist(scmd)));
3727−
37283727 /* Move past header and block descriptors. */
37293728 if (len < hdr_len)
37303729 goto invalid_param_len;
37313730
3731+ if (!sg_copy_to_buffer(scsi_sglist(scmd), scsi_sg_count(scmd),
3732+ buffer, sizeof(buffer)))
3733+ goto invalid_param_len;
3734+
37323735 if (six_byte)
37333736 bd_len = p[3];
37343737 else
drivers/ata/sata_rcar.c+7−4
@@ -907,7 +907,7 @@ static int sata_rcar_probe(struct platform_device *pdev) · 906 unmodified lines
907907 pm_runtime_enable(dev);
908908 ret = pm_runtime_get_sync(dev);
909909 if (ret < 0)
910− goto err_pm_disable;
910+ goto err_pm_put;
911911
912912 host = ata_host_alloc(dev, 1);
913913 if (!host) {
@@ -937,7 +937,6 @@ static int sata_rcar_probe(struct platform_device *pdev) · 23 unmodified lines
937937
938938 err_pm_put:
939939 pm_runtime_put(dev);
940−err_pm_disable:
941940 pm_runtime_disable(dev);
942941 return ret;
943942 }
@@ -991,8 +990,10 @@ static int sata_rcar_resume(struct device *dev) · 47 unmodified lines
991990 int ret;
992991
993992 ret = pm_runtime_get_sync(dev);
994− if (ret < 0)
993+ if (ret < 0) {
994+ pm_runtime_put(dev);
995995 return ret;
996+ }
996997
997998 if (priv->type == RCAR_GEN3_SATA) {
998999 sata_rcar_init_module(priv);
@@ -1017,8 +1018,10 @@ static int sata_rcar_restore(struct device *dev) · 18 unmodified lines
10171018 int ret;
10181019
10191020 ret = pm_runtime_get_sync(dev);
1020− if (ret < 0)
1021+ if (ret < 0) {
1022+ pm_runtime_put(dev);
10211023 return ret;
1024+ }
10221025
10231026 sata_rcar_setup_port(host);
10241027
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/regmap.c+50−56
@@ -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);
@@ -2944,8 +2937,9 @@ EXPORT_SYMBOL_GPL(regmap_update_bits_base); · 1581 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/drbd/drbd_int.h+1−1
@@ -620,7 +620,7 @@ struct fifo_buffer { · 619 unmodified lines
620620 unsigned int head_index;
621621 unsigned int size;
622622 int total; /* sum of all values */
623− int values[0];
623+ int values[];
624624 };
625625 extern struct fifo_buffer *fifo_alloc(unsigned int fifo_size);
626626
drivers/block/drbd/drbd_protocol.h+4−4
@@ -271,7 +271,7 @@ struct p_rs_param { · 270 unmodified lines
271271 u32 resync_rate;
272272
273273 /* Since protocol version 88 and higher. */
274− char verify_alg[0];
274+ char verify_alg[];
275275 } __packed;
276276
277277 struct p_rs_param_89 {
@@ -305,7 +305,7 @@ struct p_protocol { · 27 unmodified lines
305305 u32 two_primaries;
306306
307307 /* Since protocol version 87 and higher. */
308− char integrity_alg[0];
308+ char integrity_alg[];
309309
310310 } __packed;
311311
@@ -360,7 +360,7 @@ struct p_sizes { · 48 unmodified lines
360360 u16 dds_flags; /* use enum dds_flags here. */
361361
362362 /* optional queue_limits if (agreed_features & DRBD_FF_WSAME) */
363− struct o_qlim qlim[0];
363+ struct o_qlim qlim[];
364364 } __packed;
365365
366366 struct p_state {
@@ -409,7 +409,7 @@ struct p_compressed_bm { · 42 unmodified lines
409409 */
410410 u8 encoding;
411411
412− u8 code[0];
412+ u8 code[];
413413 } __packed;
414414
415415 struct p_delay_probe93 {
drivers/block/loop.c+4−4
@@ -1368,14 +1368,14 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) · 1367 unmodified lines
13681368 lo->lo_sizelimit != info->lo_sizelimit) {
13691369 size_changed = true;
13701370 sync_blockdev(lo->lo_device);
1371− kill_bdev(lo->lo_device);
1371+ invalidate_bdev(lo->lo_device);
13721372 }
13731373
13741374 /* I/O need to be drained during transfer transition */
13751375 blk_mq_freeze_queue(lo->lo_queue);
13761376
13771377 if (size_changed && lo->lo_device->bd_inode->i_mapping->nrpages) {
1378− /* If any pages were dirtied after kill_bdev(), try again */
1378+ /* If any pages were dirtied after invalidate_bdev(), try again */
13791379 err = -EAGAIN;
13801380 pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
13811381 __func__, lo->lo_number, lo->lo_file_name,
@@ -1615,11 +1615,11 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg) · 233 unmodified lines
16151615 return 0;
16161616
16171617 sync_blockdev(lo->lo_device);
1618− kill_bdev(lo->lo_device);
1618+ invalidate_bdev(lo->lo_device);
16191619
16201620 blk_mq_freeze_queue(lo->lo_queue);
16211621
1622− /* kill_bdev should have truncated all the pages */
1622+ /* invalidate_bdev should have truncated all the pages */
16231623 if (lo->lo_device->bd_inode->i_mapping->nrpages) {
16241624 err = -EAGAIN;
16251625 pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
drivers/block/rbd.c+3−1
@@ -1451,8 +1451,10 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req) · 1450 unmodified lines
14511451 static void rbd_osd_format_read(struct ceph_osd_request *osd_req)
14521452 {
14531453 struct rbd_obj_request *obj_request = osd_req->r_priv;
1454+ struct rbd_device *rbd_dev = obj_request->img_request->rbd_dev;
1455+ struct ceph_options *opt = rbd_dev->rbd_client->client->options;
14541456
1455− osd_req->r_flags = CEPH_OSD_FLAG_READ;
1457+ osd_req->r_flags = CEPH_OSD_FLAG_READ | opt->read_from_replica;
14561458 osd_req->r_snapid = obj_request->img_request->snap_id;
14571459 }
14581460
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/bus/ti-sysc.c+74−24
@@ -221,6 +221,35 @@ 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(sysc_read_sysstatus, ddata, rstval,
240+ (rstval & ddata->cfg.syss_mask) ==
241+ syss_done,
242+ 100, MAX_MODULE_SOFTRESET_WAIT);
243+
244+ } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) {
245+ error = readx_poll_timeout(sysc_read_sysconfig, ddata, rstval,
246+ !(rstval & sysc_mask),
247+ 100, MAX_MODULE_SOFTRESET_WAIT);
248+ }
249+
250+ return error;
251+}
252+
224253 static int sysc_add_named_clock_from_child(struct sysc *ddata,
225254 const char *name,
226255 const char *optfck_name)
@@ -925,18 +954,47 @@ static int sysc_enable_module(struct device *dev) · 698 unmodified lines
925954 struct sysc *ddata;
926955 const struct sysc_regbits *regbits;
927956 u32 reg, idlemodes, best_mode;
957+ int error;
928958
929959 ddata = dev_get_drvdata(dev);
960+
961+ /*
962+ * Some modules like DSS reset automatically on idle. Enable optional
963+ * reset clocks and wait for OCP softreset to complete.
964+ */
965+ if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) {
966+ error = sysc_enable_opt_clocks(ddata);
967+ if (error) {
968+ dev_err(ddata->dev,
969+ "Optional clocks failed for enable: %i\n",
970+ error);
971+ return error;
972+ }
973+ }
974+ error = sysc_wait_softreset(ddata);
975+ if (error)
976+ dev_warn(ddata->dev, "OCP softreset timed out\n");
977+ if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET)
978+ sysc_disable_opt_clocks(ddata);
979+
980+ /*
981+ * Some subsystem private interconnects, like DSS top level module,
982+ * need only the automatic OCP softreset handling with no sysconfig
983+ * register bits to configure.
984+ */
930985 if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV)
931986 return 0;
932987
933988 regbits = ddata->cap->regbits;
934989 reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
935990
936− /* Set CLOCKACTIVITY, we only use it for ick */
991+ /*
992+ * Set CLOCKACTIVITY, we only use it for ick. And we only configure it
993+ * based on the SYSC_QUIRK_USE_CLOCKACT flag, not based on the hardware
994+ * capabilities. See the old HWMOD_SET_DEFAULT_CLOCKACT flag.
995+ */
937996 if (regbits->clkact_shift >= 0 &&
938− (ddata->cfg.quirks & SYSC_QUIRK_USE_CLOCKACT ||
939− ddata->cfg.sysc_val & BIT(regbits->clkact_shift)))
997+ (ddata->cfg.quirks & SYSC_QUIRK_USE_CLOCKACT))
940998 reg |= SYSC_CLOCACT_ICK << regbits->clkact_shift;
941999
9421000 /* Set SIDLE mode */
@@ -991,6 +1049,9 @@ set_autoidle: · 48 unmodified lines
9911049 sysc_write_sysconfig(ddata, reg);
9921050 }
9931051
1052+ /* Flush posted write */
1053+ sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
1054+
9941055 if (ddata->module_enable_quirk)
9951056 ddata->module_enable_quirk(ddata);
9961057
@@ -1071,6 +1132,9 @@ set_sidle: · 74 unmodified lines
10711132 reg |= 1 << regbits->autoidle_shift;
10721133 sysc_write_sysconfig(ddata, reg);
10731134
1135+ /* Flush posted write */
1136+ sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
1137+
10741138 return 0;
10751139 }
10761140
@@ -1488,7 +1552,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, · 411 unmodified lines
14881552 bool lcd_en, digit_en, lcd2_en = false, lcd3_en = false;
14891553 const int lcd_en_mask = BIT(0), digit_en_mask = BIT(1);
14901554 int manager_count;
1491− bool framedonetv_irq;
1555+ bool framedonetv_irq = true;
14921556 u32 val, irq_mask = 0;
14931557
14941558 switch (sysc_soc->soc) {
@@ -1505,6 +1569,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, · 10 unmodified lines
15051569 break;
15061570 case SOC_AM4:
15071571 manager_count = 1;
1572+ framedonetv_irq = false;
15081573 break;
15091574 case SOC_UNKNOWN:
15101575 default:
@@ -1822,11 +1887,10 @@ static int sysc_legacy_init(struct sysc *ddata) · 311 unmodified lines
18221887 */
18231888 static int sysc_reset(struct sysc *ddata)
18241889 {
1825− int sysc_offset, syss_offset, sysc_val, rstval, error = 0;
1826− u32 sysc_mask, syss_done;
1890+ int sysc_offset, sysc_val, error;
1891+ u32 sysc_mask;
18271892
18281893 sysc_offset = ddata->offsets[SYSC_SYSCONFIG];
1829− syss_offset = ddata->offsets[SYSC_SYSSTATUS];
18301894
18311895 if (ddata->legacy_mode ||
18321896 ddata->cap->regbits->srst_shift < 0 ||
@@ -1835,11 +1899,6 @@ static int sysc_reset(struct sysc *ddata) · 2 unmodified lines
18351899
18361900 sysc_mask = BIT(ddata->cap->regbits->srst_shift);
18371901
1838− if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED)
1839− syss_done = 0;
1840− else
1841− syss_done = ddata->cfg.syss_mask;
1842−
18431902 if (ddata->pre_reset_quirk)
18441903 ddata->pre_reset_quirk(ddata);
18451904
@@ -1856,18 +1915,9 @@ static int sysc_reset(struct sysc *ddata) · 10 unmodified lines
18561915 if (ddata->post_reset_quirk)
18571916 ddata->post_reset_quirk(ddata);
18581917
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− }
1918+ error = sysc_wait_softreset(ddata);
1919+ if (error)
1920+ dev_warn(ddata->dev, "OCP softreset timed out\n");
18711921
18721922 if (ddata->reset_done_quirk)
18731923 ddata->reset_done_quirk(ddata);
drivers/char/hw_random/ks-sa-rng.c+1−0
@@ -244,6 +244,7 @@ static int ks_sa_rng_probe(struct platform_device *pdev) · 243 unmodified lines
244244 ret = pm_runtime_get_sync(dev);
245245 if (ret < 0) {
246246 dev_err(dev, "Failed to enable SA power-domain\n");
247+ pm_runtime_put_noidle(dev);
247248 pm_runtime_disable(dev);
248249 return ret;
249250 }
drivers/char/mem.c+1−1
@@ -171,7 +171,7 @@ static ssize_t read_mem(struct file *file, char __user *buf, · 170 unmodified lines
171171 if (!ptr)
172172 goto failed;
173173
174− probe = probe_kernel_read(bounce, ptr, sz);
174+ probe = copy_from_kernel_nofault(bounce, ptr, sz);
175175 unxlate_dev_mem_ptr(p, ptr);
176176 if (probe)
177177 goto failed;
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+0−1
@@ -238,7 +238,6 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev, · 237 unmodified lines
238238 static struct pnp_device_id tpm_pnp_tbl[] = {
239239 {"PNP0C31", 0}, /* TPM */
240240 {"ATM1200", 0}, /* Atmel */
241− {"IFX0102", 0}, /* Infineon */
242241 {"BCM0101", 0}, /* Broadcom */
243242 {"BCM0102", 0}, /* Broadcom */
244243 {"NSC1200", 0}, /* National */
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/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/cpufreq/intel_pstate.c+5−2
@@ -2677,6 +2677,8 @@ static struct acpi_platform_list plat_info[] __initdata = { · 2676 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 }
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/crypto/caam/Kconfig+1−1
@@ -147,7 +147,7 @@ config CRYPTO_DEV_FSL_CAAM_RNG_API · 146 unmodified lines
147147 select HW_RANDOM
148148 help
149149 Selecting this will register the SEC4 hardware rng to
150− the hw_random API for suppying the kernel entropy pool.
150+ the hw_random API for supplying the kernel entropy pool.
151151
152152 endif # CRYPTO_DEV_FSL_CAAM_JR
153153
drivers/crypto/caam/ctrl.c+9−9
@@ -54,7 +54,7 @@ static void build_instantiation_desc(u32 *desc, int handle, int do_sk) · 53 unmodified lines
5454
5555 /*
5656 * load 1 to clear written reg:
57− * resets the done interrrupt and returns the RNG to idle.
57+ * resets the done interrupt and returns the RNG to idle.
5858 */
5959 append_load_imm_u32(desc, 1, LDST_SRCDST_WORD_CLRW);
6060
@@ -156,7 +156,7 @@ static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc, · 95 unmodified lines
156156 DESC_DER_DECO_STAT_SHIFT;
157157
158158 /*
159− * If an error occured in the descriptor, then
159+ * If an error occurred in the descriptor, then
160160 * the DECO status field will be set to 0x0D
161161 */
162162 if (deco_state == DECO_STAT_HOST_ERR)
@@ -264,7 +264,7 @@ static void devm_deinstantiate_rng(void *data) · 101 unmodified lines
264264 * - -ENODEV if DECO0 couldn't be acquired
265265 * - -EAGAIN if an error occurred when executing the descriptor
266266 * f.i. there was a RNG hardware error due to not "good enough"
267− * entropy being aquired.
267+ * entropy being acquired.
268268 */
269269 static int instantiate_rng(struct device *ctrldev, int state_handle_mask,
270270 int gen_sk)
@@ -733,8 +733,8 @@ static int caam_probe(struct platform_device *pdev) · 462 unmodified lines
733733 handle_imx6_err005766(&ctrl->mcr);
734734
735735 /*
736− * Read the Compile Time paramters and SCFGR to determine
737− * if Virtualization is enabled for this platform
736+ * Read the Compile Time parameters and SCFGR to determine
737+ * if virtualization is enabled for this platform
738738 */
739739 scfgr = rd_reg32(&ctrl->scfgr);
740740
@@ -863,9 +863,9 @@ static int caam_probe(struct platform_device *pdev) · 122 unmodified lines
863863 }
864864 /*
865865 * if instantiate_rng(...) fails, the loop will rerun
866− * and the kick_trng(...) function will modfiy the
866+ * and the kick_trng(...) function will modify the
867867 * upper and lower limits of the entropy sampling
868− * interval, leading to a sucessful initialization of
868+ * interval, leading to a successful initialization of
869869 * the RNG.
870870 */
871871 ret = instantiate_rng(dev, inst_handles,
@@ -882,8 +882,8 @@ static int caam_probe(struct platform_device *pdev) · 10 unmodified lines
882882 return ret;
883883 }
884884 /*
885− * Set handles init'ed by this module as the complement of the
886− * already initialized ones
885+ * Set handles initialized by this module as the complement of
886+ * the already initialized ones
887887 */
888888 ctrlpriv->rng4_sh_init = ~ctrlpriv->rng4_sh_init & RDSTA_MASK;
889889
drivers/crypto/caam/desc.h+2−2
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 */
1919
2020 #define SEC4_SG_LEN_EXT 0x80000000 /* Entry points to table */
21−#define SEC4_SG_LEN_FIN 0x40000000 /* Last ent in table */
21+#define SEC4_SG_LEN_FIN 0x40000000 /* Last entry in table */
2222 #define SEC4_SG_BPID_MASK 0x000000ff
2323 #define SEC4_SG_BPID_SHIFT 16
2424 #define SEC4_SG_LEN_MASK 0x3fffffff /* Excludes EXT and FINAL */
@@ -113,7 +113,7 @@ · 88 unmodified lines
113113 */
114114 #define HDR_REVERSE 0x00000800
115115
116−/* Propogate DNR property to SharedDesc */
116+/* Propagate DNR property to SharedDesc */
117117 #define HDR_PROP_DNR 0x00000800
118118
119119 /* JobDesc/SharedDesc share property */
drivers/crypto/caam/pdb.h+1−1
@@ -453,7 +453,7 @@ struct srtp_decap_pdb { · 452 unmodified lines
453453 #define DSA_PDB_N_MASK 0x7f
454454
455455 struct dsa_sign_pdb {
456− u32 sgf_ln; /* Use DSA_PDB_ defintions per above */
456+ u32 sgf_ln; /* Use DSA_PDB_ definitions per above */
457457 u8 *q;
458458 u8 *r;
459459 u8 *g; /* or Gx,y */
drivers/crypto/ccp/sev-dev.c+16−7
@@ -376,6 +376,7 @@ static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp, bool writable) · 375 unmodified lines
376376 struct sev_device *sev = psp_master->sev_data;
377377 struct sev_user_data_pek_csr input;
378378 struct sev_data_pek_csr *data;
379+ void __user *input_address;
379380 void *blob = NULL;
380381 int ret;
381382
@@ -394,6 +395,7 @@ static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp, bool writable) · 12 unmodified lines
394395 goto cmd;
395396
396397 /* allocate a physically contiguous buffer to store the CSR blob */
398+ input_address = (void __user *)input.address;
397399 if (input.length > SEV_FW_BLOB_MAX_SIZE) {
398400 ret = -EFAULT;
399401 goto e_free;
@@ -426,7 +428,7 @@ cmd: · 26 unmodified lines
426428 }
427429
428430 if (blob) {
429− if (copy_to_user((void __user *)input.address, blob, input.length))
431+ if (copy_to_user(input_address, blob, input.length))
430432 ret = -EFAULT;
431433 }
432434
@@ -437,7 +439,7 @@ e_free: · 4 unmodified lines
437439 return ret;
438440 }
439441
440−void *psp_copy_user_blob(u64 __user uaddr, u32 len)
442+void *psp_copy_user_blob(u64 uaddr, u32 len)
441443 {
442444 if (!uaddr || !len)
443445 return ERR_PTR(-EINVAL);
@@ -446,7 +448,7 @@ void *psp_copy_user_blob(u64 __user uaddr, u32 len) · 2 unmodified lines
446448 if (len > SEV_FW_BLOB_MAX_SIZE)
447449 return ERR_PTR(-EINVAL);
448450
449− return memdup_user((void __user *)(uintptr_t)uaddr, len);
451+ return memdup_user((void __user *)uaddr, len);
450452 }
451453 EXPORT_SYMBOL_GPL(psp_copy_user_blob);
452454
@@ -621,6 +623,7 @@ static int sev_ioctl_do_get_id2(struct sev_issue_cmd *argp) · 168 unmodified lines
621623 {
622624 struct sev_user_data_get_id2 input;
623625 struct sev_data_get_id *data;
626+ void __user *input_address;
624627 void *id_blob = NULL;
625628 int ret;
626629
@@ -631,6 +634,8 @@ static int sev_ioctl_do_get_id2(struct sev_issue_cmd *argp) · 4 unmodified lines
631634 if (copy_from_user(&input, (void __user *)argp->data, sizeof(input)))
632635 return -EFAULT;
633636
637+ input_address = (void __user *)input.address;
638+
634639 data = kzalloc(sizeof(*data), GFP_KERNEL);
635640 if (!data)
636641 return -ENOMEM;
@@ -660,8 +665,7 @@ static int sev_ioctl_do_get_id2(struct sev_issue_cmd *argp) · 23 unmodified lines
660665 }
661666
662667 if (id_blob) {
663− if (copy_to_user((void __user *)input.address,
664− id_blob, data->len)) {
668+ if (copy_to_user(input_address, id_blob, data->len)) {
665669 ret = -EFAULT;
666670 goto e_free;
667671 }
@@ -720,6 +724,8 @@ static int sev_ioctl_do_pdh_export(struct sev_issue_cmd *argp, bool writable) · 52 unmodified lines
720724 struct sev_user_data_pdh_cert_export input;
721725 void *pdh_blob = NULL, *cert_blob = NULL;
722726 struct sev_data_pdh_cert_export *data;
727+ void __user *input_cert_chain_address;
728+ void __user *input_pdh_cert_address;
723729 int ret;
724730
725731 /* If platform is not in INIT state then transition it to INIT. */
@@ -745,6 +751,9 @@ static int sev_ioctl_do_pdh_export(struct sev_issue_cmd *argp, bool writable) · 19 unmodified lines
745751 !input.cert_chain_address)
746752 goto cmd;
747753
754+ input_pdh_cert_address = (void __user *)input.pdh_cert_address;
755+ input_cert_chain_address = (void __user *)input.cert_chain_address;
756+
748757 /* Allocate a physically contiguous buffer to store the PDH blob. */
749758 if (input.pdh_cert_len > SEV_FW_BLOB_MAX_SIZE) {
750759 ret = -EFAULT;
@@ -788,7 +797,7 @@ cmd: · 37 unmodified lines
788797 }
789798
790799 if (pdh_blob) {
791− if (copy_to_user((void __user *)input.pdh_cert_address,
800+ if (copy_to_user(input_pdh_cert_address,
792801 pdh_blob, input.pdh_cert_len)) {
793802 ret = -EFAULT;
794803 goto e_free_cert;
@@ -796,7 +805,7 @@ cmd: · 1 unmodified line
796805 }
797806
798807 if (cert_blob) {
799− if (copy_to_user((void __user *)input.cert_chain_address,
808+ if (copy_to_user(input_cert_chain_address,
800809 cert_blob, input.cert_chain_len))
801810 ret = -EFAULT;
802811 }
drivers/crypto/chelsio/chcr_crypto.h+4−4
@@ -223,7 +223,7 @@ struct chcr_authenc_ctx { · 222 unmodified lines
223223
224224 struct __aead_ctx {
225225 struct chcr_gcm_ctx gcm[0];
226− struct chcr_authenc_ctx authenc[0];
226+ struct chcr_authenc_ctx authenc[];
227227 };
228228
229229 struct chcr_aead_ctx {
@@ -235,7 +235,7 @@ struct chcr_aead_ctx { · 5 unmodified lines
235235 u8 nonce[4];
236236 u16 hmac_ctrl;
237237 u16 mayverify;
238− struct __aead_ctx ctx[0];
238+ struct __aead_ctx ctx[];
239239 };
240240
241241 struct hmac_ctx {
@@ -247,7 +247,7 @@ struct hmac_ctx { · 5 unmodified lines
247247 struct __crypto_ctx {
248248 struct hmac_ctx hmacctx[0];
249249 struct ablk_ctx ablkctx[0];
250− struct chcr_aead_ctx aeadctx[0];
250+ struct chcr_aead_ctx aeadctx[];
251251 };
252252
253253 struct chcr_context {
@@ -257,7 +257,7 @@ struct chcr_context { · 3 unmodified lines
257257 unsigned int ntxq;
258258 unsigned int nrxq;
259259 struct completion cbc_aes_aio_done;
260− struct __crypto_ctx crypto_ctx[0];
260+ struct __crypto_ctx crypto_ctx[];
261261 };
262262
263263 struct chcr_hctx_per_wr {
drivers/crypto/hisilicon/sgl.c+2−1
@@ -66,7 +66,8 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev, · 65 unmodified lines
6666
6767 sgl_size = sizeof(struct acc_hw_sge) * sge_nr +
6868 sizeof(struct hisi_acc_hw_sgl);
69− block_size = PAGE_SIZE * (1 << (MAX_ORDER - 1));
69+ block_size = 1 << (PAGE_SHIFT + MAX_ORDER <= 32 ?
70+ PAGE_SHIFT + MAX_ORDER - 1 : 31);
7071 sgl_num_per_block = block_size / sgl_size;
7172 block_num = count / sgl_num_per_block;
7273 remain_sgl = count % sgl_num_per_block;
drivers/crypto/marvell/octeontx/otx_cptvf_algs.c+7−4
@@ -118,6 +118,9 @@ static void otx_cpt_aead_callback(int status, void *arg1, void *arg2) · 117 unmodified lines
118118 struct otx_cpt_req_info *cpt_req;
119119 struct pci_dev *pdev;
120120
121+ if (!cpt_info)
122+ goto complete;
123+
121124 cpt_req = cpt_info->req;
122125 if (!status) {
123126 /*
@@ -129,10 +132,10 @@ static void otx_cpt_aead_callback(int status, void *arg1, void *arg2) · 5 unmodified lines
129132 !cpt_req->is_enc)
130133 status = validate_hmac_cipher_null(cpt_req);
131134 }
132− if (cpt_info) {
133− pdev = cpt_info->pdev;
134− do_request_cleanup(pdev, cpt_info);
135− }
135+ pdev = cpt_info->pdev;
136+ do_request_cleanup(pdev, cpt_info);
137+
138+complete:
136139 if (areq)
137140 areq->complete(areq, status);
138141 }
drivers/dio/dio.c+4−2
@@ -135,7 +135,8 @@ int __init dio_find(int deviceid) · 134 unmodified lines
135135 else
136136 va = ioremap(pa, PAGE_SIZE);
137137
138− if (probe_kernel_read(&i, (unsigned char *)va + DIO_IDOFF, 1)) {
138+ if (copy_from_kernel_nofault(&i,
139+ (unsigned char *)va + DIO_IDOFF, 1)) {
139140 if (scode >= DIOII_SCBASE)
140141 iounmap(va);
141142 continue; /* no board present at that select code */
@@ -208,7 +209,8 @@ static int __init dio_init(void) · 66 unmodified lines
208209 else
209210 va = ioremap(pa, PAGE_SIZE);
210211
211− if (probe_kernel_read(&i, (unsigned char *)va + DIO_IDOFF, 1)) {
212+ if (copy_from_kernel_nofault(&i,
213+ (unsigned char *)va + DIO_IDOFF, 1)) {
212214 if (scode >= DIOII_SCBASE)
213215 iounmap(va);
214216 continue; /* no board present at that select code */
drivers/dma-buf/dma-buf.c+25−29
@@ -54,37 +54,11 @@ static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen) · 53 unmodified lines
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;
@@ -412,7 +409,6 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) · 293 unmodified lines
412409 }
413410
414411 static const struct file_operations dma_buf_fops = {
415− .release = dma_buf_release,
416412 .mmap = dma_buf_mmap_internal,
417413 .llseek = dma_buf_llseek,
418414 .poll = dma_buf_poll,
drivers/dma/milbeaut-hdmac.c+1−1
@@ -77,7 +77,7 @@ struct milbeaut_hdmac_device { · 76 unmodified lines
7777 struct dma_device ddev;
7878 struct clk *clk;
7979 void __iomem *reg_base;
80− struct milbeaut_hdmac_chan channels[0];
80+ struct milbeaut_hdmac_chan channels[];
8181 };
8282
8383 static struct milbeaut_hdmac_chan *
drivers/dma/milbeaut-xdmac.c+1−1
@@ -74,7 +74,7 @@ struct milbeaut_xdmac_chan { · 73 unmodified lines
7474 struct milbeaut_xdmac_device {
7575 struct dma_device ddev;
7676 void __iomem *reg_base;
77− struct milbeaut_xdmac_chan channels[0];
77+ struct milbeaut_xdmac_chan channels[];
7878 };
7979
8080 static struct milbeaut_xdmac_chan *
drivers/dma/moxart-dma.c+1−1
@@ -127,7 +127,7 @@ struct moxart_desc { · 126 unmodified lines
127127 unsigned int dma_cycles;
128128 struct virt_dma_desc vd;
129129 uint8_t es;
130− struct moxart_sg sg[0];
130+ struct moxart_sg sg[];
131131 };
132132
133133 struct moxart_chan {
drivers/dma/tegra20-apb-dma.c+1−1
@@ -225,7 +225,7 @@ struct tegra_dma { · 224 unmodified lines
225225 u32 global_pause_count;
226226
227227 /* Last member of the structure */
228− struct tegra_dma_channel channels[0];
228+ struct tegra_dma_channel channels[];
229229 };
230230
231231 static inline void tdma_write(struct tegra_dma *tdma, u32 reg, u32 val)
drivers/dma/ti/edma.c+1−1
@@ -211,7 +211,7 @@ struct edma_desc { · 210 unmodified lines
211211 u32 residue;
212212 u32 residue_stat;
213213
214− struct edma_pset pset[0];
214+ struct edma_pset pset[];
215215 };
216216
217217 struct edma_cc;
drivers/dma/ti/k3-udma.c+1−1
@@ -170,7 +170,7 @@ struct udma_desc { · 169 unmodified lines
170170 void *metadata; /* pointer to provided metadata buffer (EPIP, PSdata) */
171171
172172 unsigned int hwdesc_count;
173− struct udma_hwdesc hwdesc[0];
173+ struct udma_hwdesc hwdesc[];
174174 };
175175
176176 enum udma_chan_state {
drivers/dma/timb_dma.c+1−1
@@ -88,7 +88,7 @@ struct timb_dma { · 87 unmodified lines
8888 struct dma_device dma;
8989 void __iomem *membase;
9090 struct tasklet_struct tasklet;
91− struct timb_dma_chan channels[0];
91+ struct timb_dma_chan channels[];
9292 };
9393
9494 static struct device *chan2dev(struct dma_chan *chan)
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/firewire/core-cdev.c+1−1
@@ -117,7 +117,7 @@ struct inbound_transaction_resource { · 116 unmodified lines
117117 struct descriptor_resource {
118118 struct client_resource resource;
119119 struct fw_descriptor descriptor;
120− u32 data[0];
120+ u32 data[];
121121 };
122122
123123 struct iso_resource {
drivers/firewire/core-transaction.c+1−1
@@ -620,7 +620,7 @@ struct fw_request { · 619 unmodified lines
620620 u32 request_header[4];
621621 int ack;
622622 u32 length;
623− u32 data[0];
623+ u32 data[];
624624 };
625625
626626 static void free_response_callback(struct fw_packet *packet,
drivers/firewire/core.h+1−1
@@ -191,7 +191,7 @@ struct fw_node { · 190 unmodified lines
191191 /* Upper layer specific data. */
192192 void *data;
193193
194− struct fw_node *ports[0];
194+ struct fw_node *ports[];
195195 };
196196
197197 static inline struct fw_node *fw_node_get(struct fw_node *node)
drivers/firewire/nosy.c+1−1
@@ -52,7 +52,7 @@ struct pcl { · 51 unmodified lines
5252
5353 struct packet {
5454 unsigned int length;
55− char data[0];
55+ char data[];
5656 };
5757
5858 struct packet_buffer {
drivers/firewire/ohci.c+1−1
@@ -111,7 +111,7 @@ struct descriptor_buffer { · 110 unmodified lines
111111 dma_addr_t buffer_bus;
112112 size_t buffer_size;
113113 size_t used;
114− struct descriptor buffer[0];
114+ struct descriptor buffer[];
115115 };
116116
117117 struct context {
drivers/firmware/dmi-sysfs.c+1−1
@@ -262,7 +262,7 @@ struct dmi_system_event_log { · 261 unmodified lines
262262 u8 header_format;
263263 u8 type_descriptors_supported_count;
264264 u8 per_log_type_descriptor_length;
265− u8 supported_log_type_descriptos[0];
265+ u8 supported_log_type_descriptos[];
266266 } __packed;
267267
268268 #define DMI_SYSFS_SEL_FIELD(_field) \
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/efi-stub-helper.c+67−11
@@ -32,6 +32,10 @@ bool __pure __efi_soft_reserve_enabled(void) · 31 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/google/memconsole-coreboot.c+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 struct cbmem_cons {
2222 u32 size_dont_access_after_boot;
2323 u32 cursor;
24− u8 body[0];
24+ u8 body[];
2525 } __packed;
2626
2727 #define CURSOR_MASK ((1 << 28) - 1)
drivers/firmware/google/vpd.c+1−1
@@ -32,7 +32,7 @@ struct vpd_cbmem { · 31 unmodified lines
3232 u32 version;
3333 u32 ro_size;
3434 u32 rw_size;
35− u8 blob[0];
35+ u8 blob[];
3636 };
3737
3838 struct vpd_section {
drivers/firmware/iscsi_ibft.c+1−1
@@ -104,7 +104,7 @@ struct ibft_control { · 103 unmodified lines
104104 u16 tgt0_off;
105105 u16 nic1_off;
106106 u16 tgt1_off;
107− u16 expansion[0];
107+ u16 expansion[];
108108 } __attribute__((__packed__));
109109
110110 struct ibft_initiator {
drivers/firmware/pcdp.h+1−1
@@ -103,6 +103,6 @@ struct pcdp { · 102 unmodified lines
103103 u8 creator_id[4];
104104 u32 creator_rev;
105105 u32 num_uarts;
106− struct pcdp_uart uart[0]; /* actual size is num_uarts */
106+ struct pcdp_uart uart[]; /* actual size is num_uarts */
107107 /* remainder of table is pcdp_device structures */
108108 } __attribute__((packed));
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/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_pm.c+4−4
@@ -696,7 +696,7 @@ static ssize_t amdgpu_set_pp_table(struct device *dev, · 695 unmodified lines
696696 * default power levels, write "r" (reset) to the file to reset them.
697697 *
698698 *
699− * < For Vega20 >
699+ * < For Vega20 and newer ASICs >
700700 *
701701 * Reading the file will display:
702702 *
@@ -1668,7 +1668,7 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, · 965 unmodified lines
16681668 }
16691669
16701670 /**
1671− * DOC: busy_percent
1671+ * DOC: gpu_busy_percent
16721672 *
16731673 * The amdgpu driver provides a sysfs API for reading how busy the GPU
16741674 * is as a percentage. The file gpu_busy_percent is used for this.
@@ -2784,7 +2784,7 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev, · 1109 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/sdma_v5_0.c+5−1
@@ -1298,8 +1298,12 @@ static int sdma_v5_0_sw_fini(void *handle) · 1297 unmodified lines
12981298 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
12991299 int i;
13001300
1301− for (i = 0; i < adev->sdma.num_instances; i++)
1301+ for (i = 0; i < adev->sdma.num_instances; i++) {
1302+ if (adev->sdma.instance[i].fw != NULL)
1303+ release_firmware(adev->sdma.instance[i].fw);
1304+
13021305 amdgpu_ring_fini(&adev->sdma.instance[i].ring);
1306+ }
13031307
13041308 return 0;
13051309 }
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+2−1
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 #include <drm/drm_file.h>
4141 #include <drm/drm_drv.h>
4242 #include <drm/drm_device.h>
43+#include <drm/drm_ioctl.h>
4344 #include <kgd_kfd_interface.h>
4445 #include <linux/swap.h>
4546
@@ -1076,7 +1077,7 @@ static inline int kfd_devcgroup_check_permission(struct kfd_dev *kfd) · 1030 unmodified lines
10761077 #if defined(CONFIG_CGROUP_DEVICE) || defined(CONFIG_CGROUP_BPF)
10771078 struct drm_device *ddev = kfd->ddev;
10781079
1079− return devcgroup_check_permission(DEVCG_DEV_CHAR, ddev->driver->major,
1080+ return devcgroup_check_permission(DEVCG_DEV_CHAR, DRM_MAJOR,
10801081 ddev->render->index,
10811082 DEVCG_ACC_WRITE | DEVCG_ACC_READ);
10821083 #else
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+2−1
@@ -5024,7 +5024,8 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, · 5023 unmodified lines
50245024 struct drm_connector *connector = &aconnector->base;
50255025 struct amdgpu_device *adev = connector->dev->dev_private;
50265026 struct dc_stream_state *stream;
5027− int requested_bpc = connector->state ? connector->state->max_requested_bpc : 8;
5027+ const struct drm_connector_state *drm_state = dm_state ? &dm_state->base : NULL;
5028+ int requested_bpc = drm_state ? drm_state->max_requested_bpc : 8;
50285029 enum dc_status dc_result = DC_OK;
50295030
50305031 do {
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/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/dsc/Makefile+0−2
@@ -28,8 +28,6 @@ endif · 27 unmodified lines
2828 endif
2929
3030 CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_ccflags)
31−CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc_dpi.o := $(dsc_ccflags)
32−CFLAGS_$(AMDDALPATH)/dc/dsc/dc_dsc.o := $(dsc_ccflags)
3331
3432 DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o
3533
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c+2−16
@@ -22,10 +22,12 @@ · 21 unmodified lines
2222 * Author: AMD
2323 */
2424
25+#include <drm/drm_dsc.h>
2526 #include "dc_hw_types.h"
2627 #include "dsc.h"
2728 #include <drm/drm_dp_helper.h>
2829 #include "dc.h"
30+#include "rc_calc.h"
2931
3032 /* This module's internal functions */
3133
@@ -304,22 +306,6 @@ static inline uint32_t dsc_div_by_10_round_up(uint32_t value) · 272 unmodified lines
304306 return (value + 9) / 10;
305307 }
306308
307−static inline uint32_t calc_dsc_bpp_x16(uint32_t stream_bandwidth_kbps, uint32_t pix_clk_100hz, uint32_t bpp_increment_div)
308−{
309− uint32_t dsc_target_bpp_x16;
310− float f_dsc_target_bpp;
311− float f_stream_bandwidth_100bps = stream_bandwidth_kbps * 10.0f;
312− uint32_t precision = bpp_increment_div; // bpp_increment_div is actually precision
313−
314− f_dsc_target_bpp = f_stream_bandwidth_100bps / pix_clk_100hz;
315−
316− // Round down to the nearest precision stop to bring it into DSC spec range
317− dsc_target_bpp_x16 = (uint32_t)(f_dsc_target_bpp * precision);
318− dsc_target_bpp_x16 = (dsc_target_bpp_x16 * 16) / precision;
319−
320− return dsc_target_bpp_x16;
321−}
322−
323309 /* Get DSC bandwidth range based on [min_bpp, max_bpp] target bitrate range, and timing's pixel clock
324310 * and uncompressed bandwidth.
325311 */
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c+145−6
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 * Authors: AMD
2424 *
2525 */
26+#include <drm/drm_dsc.h>
2627
2728 #include "os_types.h"
2829 #include "rc_calc.h"
@@ -40,7 +41,8 @@ · 11 unmodified lines
4041 break
4142
4243
43−void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc, enum max_min max_min, float bpp)
44+static void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc,
45+ enum max_min max_min, float bpp)
4446 {
4547 int mode = MODE_SELECT(444, 422, 420);
4648 int sel = table_hash(mode, bpc, max_min);
@@ -85,7 +87,7 @@ void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc, enum ma · 38 unmodified lines
8587 memcpy(qps, table[index].qps, sizeof(qp_set));
8688 }
8789
88−double dsc_roundf(double num)
90+static double dsc_roundf(double num)
8991 {
9092 if (num < 0.0)
9193 num = num - 0.5;
@@ -95,7 +97,7 @@ double dsc_roundf(double num) · 3 unmodified lines
9597 return (int)(num);
9698 }
9799
98−double dsc_ceil(double num)
100+static double dsc_ceil(double num)
99101 {
100102 double retval = (int)num;
101103
@@ -105,7 +107,7 @@ double dsc_ceil(double num) · 3 unmodified lines
105107 return (int)retval;
106108 }
107109
108−void get_ofs_set(qp_set ofs, enum colour_mode mode, float bpp)
110+static void get_ofs_set(qp_set ofs, enum colour_mode mode, float bpp)
109111 {
110112 int *p = ofs;
111113
@@ -160,7 +162,7 @@ void get_ofs_set(qp_set ofs, enum colour_mode mode, float bpp) · 48 unmodified lines
160162 }
161163 }
162164
163−int median3(int a, int b, int c)
165+static int median3(int a, int b, int c)
164166 {
165167 if (a > b)
166168 swap(a, b);
@@ -172,13 +174,25 @@ int median3(int a, int b, int c) · 5 unmodified lines
172174 return b;
173175 }
174176
175−void calc_rc_params(struct rc_params *rc, enum colour_mode cm, enum bits_per_comp bpc, float bpp, int slice_width, int slice_height, int minor_version)
177+static void _do_calc_rc_params(struct rc_params *rc, enum colour_mode cm,
178+ enum bits_per_comp bpc, u8 drm_bpp,
179+ bool is_navite_422_or_420,
180+ int slice_width, int slice_height,
181+ int minor_version)
176182 {
183+ float bpp;
177184 float bpp_group;
178185 float initial_xmit_delay_factor;
179186 int padding_pixels;
180187 int i;
181188
189+ bpp = ((float)drm_bpp / 16.0);
190+ /* in native_422 or native_420 modes, the bits_per_pixel is double the
191+ * target bpp (the latter is what calc_rc_params expects)
192+ */
193+ if (is_navite_422_or_420)
194+ bpp /= 2.0;
195+
182196 rc->rc_quant_incr_limit0 = ((bpc == BPC_8) ? 11 : (bpc == BPC_10 ? 15 : 19)) - ((minor_version == 1 && cm == CM_444) ? 1 : 0);
183197 rc->rc_quant_incr_limit1 = ((bpc == BPC_8) ? 11 : (bpc == BPC_10 ? 15 : 19)) - ((minor_version == 1 && cm == CM_444) ? 1 : 0);
184198
@@ -251,3 +265,128 @@ void calc_rc_params(struct rc_params *rc, enum colour_mode cm, enum bits_per_com · 66 unmodified lines
251265 rc->rc_buf_thresh[13] = 8064;
252266 }
253267
268+static u32 _do_bytes_per_pixel_calc(int slice_width, u8 drm_bpp,
269+ bool is_navite_422_or_420)
270+{
271+ float bpp;
272+ u32 bytes_per_pixel;
273+ double d_bytes_per_pixel;
274+
275+ bpp = ((float)drm_bpp / 16.0);
276+ d_bytes_per_pixel = dsc_ceil(bpp * slice_width / 8.0) / slice_width;
277+ // TODO: Make sure the formula for calculating this is precise (ceiling
278+ // vs. floor, and at what point they should be applied)
279+ if (is_navite_422_or_420)
280+ d_bytes_per_pixel /= 2;
281+
282+ bytes_per_pixel = (u32)dsc_ceil(d_bytes_per_pixel * 0x10000000);
283+
284+ return bytes_per_pixel;
285+}
286+
287+static u32 _do_calc_dsc_bpp_x16(u32 stream_bandwidth_kbps, u32 pix_clk_100hz,
288+ u32 bpp_increment_div)
289+{
290+ u32 dsc_target_bpp_x16;
291+ float f_dsc_target_bpp;
292+ float f_stream_bandwidth_100bps;
293+ // bpp_increment_div is actually precision
294+ u32 precision = bpp_increment_div;
295+
296+ f_stream_bandwidth_100bps = stream_bandwidth_kbps * 10.0f;
297+ f_dsc_target_bpp = f_stream_bandwidth_100bps / pix_clk_100hz;
298+
299+ // Round down to the nearest precision stop to bring it into DSC spec
300+ // range
301+ dsc_target_bpp_x16 = (u32)(f_dsc_target_bpp * precision);
302+ dsc_target_bpp_x16 = (dsc_target_bpp_x16 * 16) / precision;
303+
304+ return dsc_target_bpp_x16;
305+}
306+
307+/**
308+ * calc_rc_params - reads the user's cmdline mode
309+ * @rc: DC internal DSC parameters
310+ * @pps: DRM struct with all required DSC values
311+ *
312+ * This function expects a drm_dsc_config data struct with all the required DSC
313+ * values previously filled out by our driver and based on this information it
314+ * computes some of the DSC values.
315+ *
316+ * @note This calculation requires float point operation, most of it executes
317+ * under kernel_fpu_{begin,end}.
318+ */
319+void calc_rc_params(struct rc_params *rc, const struct drm_dsc_config *pps)
320+{
321+ enum colour_mode mode;
322+ enum bits_per_comp bpc;
323+ bool is_navite_422_or_420;
324+ u8 drm_bpp = pps->bits_per_pixel;
325+ int slice_width = pps->slice_width;
326+ int slice_height = pps->slice_height;
327+
328+ mode = pps->convert_rgb ? CM_RGB : (pps->simple_422 ? CM_444 :
329+ (pps->native_422 ? CM_422 :
330+ pps->native_420 ? CM_420 : CM_444));
331+ bpc = (pps->bits_per_component == 8) ? BPC_8 : (pps->bits_per_component == 10)
332+ ? BPC_10 : BPC_12;
333+
334+ is_navite_422_or_420 = pps->native_422 || pps->native_420;
335+
336+ DC_FP_START();
337+ _do_calc_rc_params(rc, mode, bpc, drm_bpp, is_navite_422_or_420,
338+ slice_width, slice_height,
339+ pps->dsc_version_minor);
340+ DC_FP_END();
341+}
342+
343+/**
344+ * calc_dsc_bytes_per_pixel - calculate bytes per pixel
345+ * @pps: DRM struct with all required DSC values
346+ *
347+ * Based on the information inside drm_dsc_config, this function calculates the
348+ * total of bytes per pixel.
349+ *
350+ * @note This calculation requires float point operation, most of it executes
351+ * under kernel_fpu_{begin,end}.
352+ *
353+ * Return:
354+ * Return the number of bytes per pixel
355+ */
356+u32 calc_dsc_bytes_per_pixel(const struct drm_dsc_config *pps)
357+
358+{
359+ u32 ret;
360+ u8 drm_bpp = pps->bits_per_pixel;
361+ int slice_width = pps->slice_width;
362+ bool is_navite_422_or_420 = pps->native_422 || pps->native_420;
363+
364+ DC_FP_START();
365+ ret = _do_bytes_per_pixel_calc(slice_width, drm_bpp,
366+ is_navite_422_or_420);
367+ DC_FP_END();
368+ return ret;
369+}
370+
371+/**
372+ * calc_dsc_bpp_x16 - retrieve the dsc bits per pixel
373+ * @stream_bandwidth_kbps:
374+ * @pix_clk_100hz:
375+ * @bpp_increment_div:
376+ *
377+ * Calculate the total of bits per pixel for DSC configuration.
378+ *
379+ * @note This calculation requires float point operation, most of it executes
380+ * under kernel_fpu_{begin,end}.
381+ */
382+u32 calc_dsc_bpp_x16(u32 stream_bandwidth_kbps, u32 pix_clk_100hz,
383+ u32 bpp_increment_div)
384+{
385+ u32 dsc_bpp;
386+
387+ DC_FP_START();
388+ dsc_bpp = _do_calc_dsc_bpp_x16(stream_bandwidth_kbps, pix_clk_100hz,
389+ bpp_increment_div);
390+ DC_FP_END();
391+ return dsc_bpp;
392+}
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h+4−1
@@ -77,7 +77,10 @@ struct qp_entry { · 76 unmodified lines
7777
7878 typedef struct qp_entry qp_table[];
7979
80−void calc_rc_params(struct rc_params *rc, enum colour_mode cm, enum bits_per_comp bpc, float bpp, int slice_width, int slice_height, int minor_version);
80+void calc_rc_params(struct rc_params *rc, const struct drm_dsc_config *pps);
81+u32 calc_dsc_bytes_per_pixel(const struct drm_dsc_config *pps);
82+u32 calc_dsc_bpp_x16(u32 stream_bandwidth_kbps, u32 pix_clk_100hz,
83+ u32 bpp_increment_div);
8184
8285 #endif
8386
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c+2−25
@@ -27,8 +27,6 @@ · 26 unmodified lines
2727 #include "dscc_types.h"
2828 #include "rc_calc.h"
2929
30−double dsc_ceil(double num);
31−
3230 static void copy_pps_fields(struct drm_dsc_config *to, const struct drm_dsc_config *from)
3331 {
3432 to->line_buf_depth = from->line_buf_depth;
@@ -100,34 +98,13 @@ static void copy_rc_to_cfg(struct drm_dsc_config *dsc_cfg, const struct rc_param · 65 unmodified lines
10098
10199 int dscc_compute_dsc_parameters(const struct drm_dsc_config *pps, struct dsc_parameters *dsc_params)
102100 {
103− enum colour_mode mode = pps->convert_rgb ? CM_RGB :
104− (pps->simple_422 ? CM_444 :
105− (pps->native_422 ? CM_422 :
106− pps->native_420 ? CM_420 : CM_444));
107− enum bits_per_comp bpc = (pps->bits_per_component == 8) ? BPC_8 :
108− (pps->bits_per_component == 10) ? BPC_10 : BPC_12;
109− float bpp = ((float) pps->bits_per_pixel / 16.0);
110− int slice_width = pps->slice_width;
111− int slice_height = pps->slice_height;
112101 int ret;
113102 struct rc_params rc;
114103 struct drm_dsc_config dsc_cfg;
115104
116− double d_bytes_per_pixel = dsc_ceil(bpp * slice_width / 8.0) / slice_width;
117−
118− // TODO: Make sure the formula for calculating this is precise (ceiling vs. floor, and at what point they should be applied)
119− if (pps->native_422 || pps->native_420)
120− d_bytes_per_pixel /= 2;
121−
122− dsc_params->bytes_per_pixel = (uint32_t)dsc_ceil(d_bytes_per_pixel * 0x10000000);
123−
124− /* in native_422 or native_420 modes, the bits_per_pixel is double the target bpp
125− * (the latter is what calc_rc_params expects)
126− */
127− if (pps->native_422 || pps->native_420)
128− bpp /= 2.0;
105+ dsc_params->bytes_per_pixel = calc_dsc_bytes_per_pixel(pps);
129106
130− calc_rc_params(&rc, mode, bpc, bpp, slice_width, slice_height, pps->dsc_version_minor);
107+ calc_rc_params(&rc, pps);
131108 dsc_params->pps = *pps;
132109 dsc_params->pps.initial_scale_value = 8 * rc.rc_model_size / (rc.rc_model_size - rc.initial_fullness_offset);
133110
drivers/gpu/drm/amd/display/modules/color/color_gamma.c+2−2
@@ -843,7 +843,7 @@ static bool build_regamma(struct pwl_float_data_ex *rgb_regamma, · 842 unmodified lines
843843 pow_buffer_ptr = -1; // reset back to no optimize
844844 ret = true;
845845 release:
846− kfree(coeff);
846+ kvfree(coeff);
847847 return ret;
848848 }
849849
@@ -1777,7 +1777,7 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf, · 927 unmodified lines
17771777
17781778 kfree(rgb_regamma);
17791779 rgb_regamma_alloc_fail:
1780− kvfree(rgb_user);
1780+ kfree(rgb_user);
17811781 rgb_user_alloc_fail:
17821782 return ret;
17831783 }
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c+1−1
@@ -239,7 +239,7 @@ static void ci_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr) · 238 unmodified lines
239239
240240 switch (dev_id) {
241241 case 0x67BA:
242− case 0x66B1:
242+ case 0x67B1:
243243 smu_data->power_tune_defaults = &defaults_hawaii_pro;
244244 break;
245245 case 0x67B8:
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/drm_encoder_slave.c+5−10
@@ -61,13 +61,8 @@ int drm_i2c_encoder_init(struct drm_device *dev, · 60 unmodified lines
6161
6262 request_module("%s%s", I2C_MODULE_PREFIX, info->type);
6363
64− client = i2c_new_device(adap, info);
65− if (!client) {
66− err = -ENOMEM;
67− goto fail;
68− }
69−
70− if (!client->dev.driver) {
64+ client = i2c_new_client_device(adap, info);
65+ if (!i2c_client_has_driver(client)) {
7166 err = -ENODEV;
7267 goto fail_unregister;
7368 }
@@ -84,7 +79,7 @@ int drm_i2c_encoder_init(struct drm_device *dev, · 10 unmodified lines
8479
8580 err = encoder_drv->encoder_init(client, dev, encoder);
8681 if (err)
87− goto fail_unregister;
82+ goto fail_module_put;
8883
8984 if (info->platform_data)
9085 encoder->slave_funcs->set_config(&encoder->base,
@@ -92,10 +87,10 @@ int drm_i2c_encoder_init(struct drm_device *dev, · 1 unmodified line
9287
9388 return 0;
9489
90+fail_module_put:
91+ module_put(module);
9592 fail_unregister:
9693 i2c_unregister_device(client);
97− module_put(module);
98−fail:
9994 return err;
10095 }
10196 EXPORT_SYMBOL(drm_i2c_encoder_init);
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/i915/display/intel_ddi.c+7−5
@@ -2579,14 +2579,14 @@ static void icl_ddi_vswing_sequence(struct intel_encoder *encoder, · 2578 unmodified lines
25792579
25802580 static void
25812581 tgl_dkl_phy_ddi_vswing_sequence(struct intel_encoder *encoder, int link_clock,
2582− u32 level)
2582+ u32 level, enum intel_output_type type)
25832583 {
25842584 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
25852585 enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port);
25862586 const struct tgl_dkl_phy_ddi_buf_trans *ddi_translations;
25872587 u32 n_entries, val, ln, dpcnt_mask, dpcnt_val;
25882588
2589− if (encoder->type == INTEL_OUTPUT_HDMI) {
2589+ if (type == INTEL_OUTPUT_HDMI) {
25902590 n_entries = ARRAY_SIZE(tgl_dkl_phy_hdmi_ddi_trans);
25912591 ddi_translations = tgl_dkl_phy_hdmi_ddi_trans;
25922592 } else {
@@ -2638,7 +2638,7 @@ static void tgl_ddi_vswing_sequence(struct intel_encoder *encoder, · 45 unmodified lines
26382638 if (intel_phy_is_combo(dev_priv, phy))
26392639 icl_combo_phy_ddi_vswing_sequence(encoder, level, type);
26402640 else
2641− tgl_dkl_phy_ddi_vswing_sequence(encoder, link_clock, level);
2641+ tgl_dkl_phy_ddi_vswing_sequence(encoder, link_clock, level, type);
26422642 }
26432643
26442644 static u32 translate_signal_level(struct intel_dp *intel_dp, int signal_levels)
@@ -2987,7 +2987,7 @@ icl_program_mg_dp_mode(struct intel_digital_port *intel_dig_port, · 342 unmodified lines
29872987 ln1 = intel_de_read(dev_priv, MG_DP_MODE(1, tc_port));
29882988 }
29892989
2990− ln0 &= ~(MG_DP_MODE_CFG_DP_X1_MODE | MG_DP_MODE_CFG_DP_X1_MODE);
2990+ ln0 &= ~(MG_DP_MODE_CFG_DP_X1_MODE | MG_DP_MODE_CFG_DP_X2_MODE);
29912991 ln1 &= ~(MG_DP_MODE_CFG_DP_X1_MODE | MG_DP_MODE_CFG_DP_X2_MODE);
29922992
29932993 /* DPPATC */
@@ -3472,7 +3472,9 @@ static void intel_ddi_post_disable_dp(struct intel_atomic_state *state, · 478 unmodified lines
34723472 INTEL_OUTPUT_DP_MST);
34733473 enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
34743474
3475− intel_dp_set_infoframes(encoder, false, old_crtc_state, old_conn_state);
3475+ if (!is_mst)
3476+ intel_dp_set_infoframes(encoder, false,
3477+ old_crtc_state, old_conn_state);
34763478
34773479 /*
34783480 * Power down sink before disabling the port, otherwise we end
drivers/gpu/drm/i915/display/intel_dp_mst.c+8−0
@@ -397,6 +397,14 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, · 396 unmodified lines
397397 */
398398 drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
399399 false);
400+
401+ /*
402+ * BSpec 4287: disable DIP after the transcoder is disabled and before
403+ * the transcoder clock select is set to none.
404+ */
405+ if (last_mst_stream)
406+ intel_dp_set_infoframes(&intel_dig_port->base, false,
407+ old_crtc_state, NULL);
400408 /*
401409 * From TGL spec: "If multi-stream slave transcoder: Configure
402410 * Transcoder Clock Select to direct no clock to the transcoder"
drivers/gpu/drm/i915/gt/intel_engine_cs.c+3−1
@@ -646,7 +646,7 @@ static int engine_setup_common(struct intel_engine_cs *engine) · 645 unmodified lines
646646 struct measure_breadcrumb {
647647 struct i915_request rq;
648648 struct intel_ring ring;
649− u32 cs[1024];
649+ u32 cs[2048];
650650 };
651651
652652 static int measure_breadcrumb_dw(struct intel_context *ce)
@@ -668,6 +668,8 @@ static int measure_breadcrumb_dw(struct intel_context *ce) · 15 unmodified lines
668668
669669 frame->ring.vaddr = frame->cs;
670670 frame->ring.size = sizeof(frame->cs);
671+ frame->ring.wrap =
672+ BITS_PER_TYPE(frame->ring.size) - ilog2(frame->ring.size);
671673 frame->ring.effective_size = frame->ring.size;
672674 intel_ring_update_space(&frame->ring);
673675 frame->rq.ring = &frame->ring;
drivers/gpu/drm/i915/gt/intel_lrc.c+45−7
@@ -1134,6 +1134,13 @@ __unwind_incomplete_requests(struct intel_engine_cs *engine) · 1133 unmodified lines
11341134 list_move(&rq->sched.link, pl);
11351135 set_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);
11361136
1137+ /* Check in case we rollback so far we wrap [size/2] */
1138+ if (intel_ring_direction(rq->ring,
1139+ intel_ring_wrap(rq->ring,
1140+ rq->tail),
1141+ rq->ring->tail) > 0)
1142+ rq->context->lrc.desc |= CTX_DESC_FORCE_RESTORE;
1143+
11371144 active = rq;
11381145 } else {
11391146 struct intel_engine_cs *owner = rq->context->engine;
@@ -1498,8 +1505,9 @@ static u64 execlists_update_context(struct i915_request *rq) · 358 unmodified lines
14981505 * HW has a tendency to ignore us rewinding the TAIL to the end of
14991506 * an earlier request.
15001507 */
1508+ GEM_BUG_ON(ce->lrc_reg_state[CTX_RING_TAIL] != rq->ring->tail);
1509+ prev = rq->ring->tail;
15011510 tail = intel_ring_set_tail(rq->ring, rq->tail);
1502− prev = ce->lrc_reg_state[CTX_RING_TAIL];
15031511 if (unlikely(intel_ring_direction(rq->ring, tail, prev) <= 0))
15041512 desc |= CTX_DESC_FORCE_RESTORE;
15051513 ce->lrc_reg_state[CTX_RING_TAIL] = tail;
@@ -1895,7 +1903,8 @@ static void defer_active(struct intel_engine_cs *engine) · 389 unmodified lines
18951903
18961904 static bool
18971905 need_timeslice(const struct intel_engine_cs *engine,
1898− const struct i915_request *rq)
1906+ const struct i915_request *rq,
1907+ const struct rb_node *rb)
18991908 {
19001909 int hint;
19011910
@@ -1903,9 +1912,28 @@ need_timeslice(const struct intel_engine_cs *engine, · 1 unmodified line
19031912 return false;
19041913
19051914 hint = engine->execlists.queue_priority_hint;
1915+
1916+ if (rb) {
1917+ const struct virtual_engine *ve =
1918+ rb_entry(rb, typeof(*ve), nodes[engine->id].rb);
1919+ const struct intel_engine_cs *inflight =
1920+ intel_context_inflight(&ve->context);
1921+
1922+ if (!inflight || inflight == engine) {
1923+ struct i915_request *next;
1924+
1925+ rcu_read_lock();
1926+ next = READ_ONCE(ve->request);
1927+ if (next)
1928+ hint = max(hint, rq_prio(next));
1929+ rcu_read_unlock();
1930+ }
1931+ }
1932+
19061933 if (!list_is_last(&rq->sched.link, &engine->active.requests))
19071934 hint = max(hint, rq_prio(list_next_entry(rq, sched.link)));
19081935
1936+ GEM_BUG_ON(hint >= I915_PRIORITY_UNPREEMPTABLE);
19091937 return hint >= effective_prio(rq);
19101938 }
19111939
@@ -1977,10 +2005,9 @@ static void set_timeslice(struct intel_engine_cs *engine) · 65 unmodified lines
19772005 set_timer_ms(&engine->execlists.timer, duration);
19782006 }
19792007
1980−static void start_timeslice(struct intel_engine_cs *engine)
2008+static void start_timeslice(struct intel_engine_cs *engine, int prio)
19812009 {
19822010 struct intel_engine_execlists *execlists = &engine->execlists;
1983− const int prio = queue_prio(execlists);
19842011 unsigned long duration;
19852012
19862013 if (!intel_engine_has_timeslices(engine))
@@ -2140,7 +2167,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 153 unmodified lines
21402167 __unwind_incomplete_requests(engine);
21412168
21422169 last = NULL;
2143− } else if (need_timeslice(engine, last) &&
2170+ } else if (need_timeslice(engine, last, rb) &&
21442171 timeslice_expired(execlists, last)) {
21452172 if (i915_request_completed(last)) {
21462173 tasklet_hi_schedule(&execlists->tasklet);
@@ -2188,7 +2215,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 41 unmodified lines
21882215 * Even if ELSP[1] is occupied and not worthy
21892216 * of timeslices, our queue might be.
21902217 */
2191− start_timeslice(engine);
2218+ start_timeslice(engine, queue_prio(execlists));
21922219 return;
21932220 }
21942221 }
@@ -2223,7 +2250,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 28 unmodified lines
22232250
22242251 if (last && !can_merge_rq(last, rq)) {
22252252 spin_unlock(&ve->base.active.lock);
2226− start_timeslice(engine);
2253+ start_timeslice(engine, rq_prio(rq));
22272254 return; /* leave this for another sibling */
22282255 }
22292256
@@ -4739,6 +4766,14 @@ static int gen12_emit_flush(struct i915_request *request, u32 mode) · 2509 unmodified lines
47394766 return 0;
47404767 }
47414768
4769+static void assert_request_valid(struct i915_request *rq)
4770+{
4771+ struct intel_ring *ring __maybe_unused = rq->ring;
4772+
4773+ /* Can we unwind this request without appearing to go forwards? */
4774+ GEM_BUG_ON(intel_ring_direction(ring, rq->wa_tail, rq->head) <= 0);
4775+}
4776+
47424777 /*
47434778 * Reserve space for 2 NOOPs at the end of each request to be
47444779 * used as a workaround for not being allowed to do lite
@@ -4751,6 +4786,9 @@ static u32 *gen8_emit_wa_tail(struct i915_request *request, u32 *cs) · 6 unmodified lines
47514786 *cs++ = MI_NOOP;
47524787 request->wa_tail = intel_ring_offset(request, cs);
47534788
4789+ /* Check that entire request is less than half the ring */
4790+ assert_request_valid(request);
4791+
47544792 return cs;
47554793 }
47564794
drivers/gpu/drm/i915/gt/intel_ring.c+4−0
@@ -315,3 +315,7 @@ int intel_ring_cacheline_align(struct i915_request *rq) · 314 unmodified lines
315315 GEM_BUG_ON(rq->ring->emit & (CACHELINE_BYTES - 1));
316316 return 0;
317317 }
318+
319+#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
320+#include "selftest_ring.c"
321+#endif
drivers/gpu/drm/i915/gt/intel_workarounds.c+241−0
@@ -178,6 +178,12 @@ wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 set) · 177 unmodified lines
178178 wa_write_masked_or(wal, reg, set, set);
179179 }
180180
181+static void
182+wa_write_clr(struct i915_wa_list *wal, i915_reg_t reg, u32 clr)
183+{
184+ wa_write_masked_or(wal, reg, clr, 0);
185+}
186+
181187 static void
182188 wa_masked_en(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
183189 {
@@ -686,6 +692,227 @@ int intel_engine_emit_ctx_wa(struct i915_request *rq) · 502 unmodified lines
686692 return 0;
687693 }
688694
695+static void
696+gen4_gt_workarounds_init(struct drm_i915_private *i915,
697+ struct i915_wa_list *wal)
698+{
699+ /* WaDisable_RenderCache_OperationalFlush:gen4,ilk */
700+ wa_masked_dis(wal, CACHE_MODE_0, RC_OP_FLUSH_ENABLE);
701+}
702+
703+static void
704+g4x_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
705+{
706+ gen4_gt_workarounds_init(i915, wal);
707+
708+ /* WaDisableRenderCachePipelinedFlush:g4x,ilk */
709+ wa_masked_en(wal, CACHE_MODE_0, CM0_PIPELINED_RENDER_FLUSH_DISABLE);
710+}
711+
712+static void
713+ilk_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
714+{
715+ g4x_gt_workarounds_init(i915, wal);
716+
717+ wa_masked_en(wal, _3D_CHICKEN2, _3D_CHICKEN2_WM_READ_PIPELINED);
718+}
719+
720+static void
721+snb_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
722+{
723+ /* WaDisableHiZPlanesWhenMSAAEnabled:snb */
724+ wa_masked_en(wal,
725+ _3D_CHICKEN,
726+ _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB);
727+
728+ /* WaDisable_RenderCache_OperationalFlush:snb */
729+ wa_masked_dis(wal, CACHE_MODE_0, RC_OP_FLUSH_ENABLE);
730+
731+ /*
732+ * BSpec recommends 8x4 when MSAA is used,
733+ * however in practice 16x4 seems fastest.
734+ *
735+ * Note that PS/WM thread counts depend on the WIZ hashing
736+ * disable bit, which we don't touch here, but it's good
737+ * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
738+ */
739+ wa_add(wal,
740+ GEN6_GT_MODE, 0,
741+ _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4),
742+ GEN6_WIZ_HASHING_16x4);
743+
744+ wa_masked_dis(wal, CACHE_MODE_0, CM0_STC_EVICT_DISABLE_LRA_SNB);
745+
746+ wa_masked_en(wal,
747+ _3D_CHICKEN3,
748+ /* WaStripsFansDisableFastClipPerformanceFix:snb */
749+ _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL |
750+ /*
751+ * Bspec says:
752+ * "This bit must be set if 3DSTATE_CLIP clip mode is set
753+ * to normal and 3DSTATE_SF number of SF output attributes
754+ * is more than 16."
755+ */
756+ _3D_CHICKEN3_SF_DISABLE_PIPELINED_ATTR_FETCH);
757+}
758+
759+static void
760+ivb_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
761+{
762+ /* WaDisableEarlyCull:ivb */
763+ wa_masked_en(wal, _3D_CHICKEN3, _3D_CHICKEN_SF_DISABLE_OBJEND_CULL);
764+
765+ /* WaDisablePSDDualDispatchEnable:ivb */
766+ if (IS_IVB_GT1(i915))
767+ wa_masked_en(wal,
768+ GEN7_HALF_SLICE_CHICKEN1,
769+ GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE);
770+
771+ /* WaDisable_RenderCache_OperationalFlush:ivb */
772+ wa_masked_dis(wal, CACHE_MODE_0_GEN7, RC_OP_FLUSH_ENABLE);
773+
774+ /* Apply the WaDisableRHWOOptimizationForRenderHang:ivb workaround. */
775+ wa_masked_dis(wal,
776+ GEN7_COMMON_SLICE_CHICKEN1,
777+ GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
778+
779+ /* WaApplyL3ControlAndL3ChickenMode:ivb */
780+ wa_write(wal, GEN7_L3CNTLREG1, GEN7_WA_FOR_GEN7_L3_CONTROL);
781+ wa_write(wal, GEN7_L3_CHICKEN_MODE_REGISTER, GEN7_WA_L3_CHICKEN_MODE);
782+
783+ /* WaForceL3Serialization:ivb */
784+ wa_write_clr(wal, GEN7_L3SQCREG4, L3SQ_URB_READ_CAM_MATCH_DISABLE);
785+
786+ /*
787+ * WaVSThreadDispatchOverride:ivb,vlv
788+ *
789+ * This actually overrides the dispatch
790+ * mode for all thread types.
791+ */
792+ wa_write_masked_or(wal, GEN7_FF_THREAD_MODE,
793+ GEN7_FF_SCHED_MASK,
794+ GEN7_FF_TS_SCHED_HW |
795+ GEN7_FF_VS_SCHED_HW |
796+ GEN7_FF_DS_SCHED_HW);
797+
798+ if (0) { /* causes HiZ corruption on ivb:gt1 */
799+ /* enable HiZ Raw Stall Optimization */
800+ wa_masked_dis(wal, CACHE_MODE_0_GEN7, HIZ_RAW_STALL_OPT_DISABLE);
801+ }
802+
803+ /* WaDisable4x2SubspanOptimization:ivb */
804+ wa_masked_en(wal, CACHE_MODE_1, PIXEL_SUBSPAN_COLLECT_OPT_DISABLE);
805+
806+ /*
807+ * BSpec recommends 8x4 when MSAA is used,
808+ * however in practice 16x4 seems fastest.
809+ *
810+ * Note that PS/WM thread counts depend on the WIZ hashing
811+ * disable bit, which we don't touch here, but it's good
812+ * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
813+ */
814+ wa_add(wal, GEN7_GT_MODE, 0,
815+ _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4),
816+ GEN6_WIZ_HASHING_16x4);
817+}
818+
819+static void
820+vlv_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
821+{
822+ /* WaDisableEarlyCull:vlv */
823+ wa_masked_en(wal, _3D_CHICKEN3, _3D_CHICKEN_SF_DISABLE_OBJEND_CULL);
824+
825+ /* WaPsdDispatchEnable:vlv */
826+ /* WaDisablePSDDualDispatchEnable:vlv */
827+ wa_masked_en(wal,
828+ GEN7_HALF_SLICE_CHICKEN1,
829+ GEN7_MAX_PS_THREAD_DEP |
830+ GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE);
831+
832+ /* WaDisable_RenderCache_OperationalFlush:vlv */
833+ wa_masked_dis(wal, CACHE_MODE_0_GEN7, RC_OP_FLUSH_ENABLE);
834+
835+ /* WaForceL3Serialization:vlv */
836+ wa_write_clr(wal, GEN7_L3SQCREG4, L3SQ_URB_READ_CAM_MATCH_DISABLE);
837+
838+ /*
839+ * WaVSThreadDispatchOverride:ivb,vlv
840+ *
841+ * This actually overrides the dispatch
842+ * mode for all thread types.
843+ */
844+ wa_write_masked_or(wal,
845+ GEN7_FF_THREAD_MODE,
846+ GEN7_FF_SCHED_MASK,
847+ GEN7_FF_TS_SCHED_HW |
848+ GEN7_FF_VS_SCHED_HW |
849+ GEN7_FF_DS_SCHED_HW);
850+
851+ /*
852+ * BSpec says this must be set, even though
853+ * WaDisable4x2SubspanOptimization isn't listed for VLV.
854+ */
855+ wa_masked_en(wal, CACHE_MODE_1, PIXEL_SUBSPAN_COLLECT_OPT_DISABLE);
856+
857+ /*
858+ * BSpec recommends 8x4 when MSAA is used,
859+ * however in practice 16x4 seems fastest.
860+ *
861+ * Note that PS/WM thread counts depend on the WIZ hashing
862+ * disable bit, which we don't touch here, but it's good
863+ * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
864+ */
865+ wa_add(wal, GEN7_GT_MODE, 0,
866+ _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4),
867+ GEN6_WIZ_HASHING_16x4);
868+
869+ /*
870+ * WaIncreaseL3CreditsForVLVB0:vlv
871+ * This is the hardware default actually.
872+ */
873+ wa_write(wal, GEN7_L3SQCREG1, VLV_B0_WA_L3SQCREG1_VALUE);
874+}
875+
876+static void
877+hsw_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
878+{
879+ /* L3 caching of data atomics doesn't work -- disable it. */
880+ wa_write(wal, HSW_SCRATCH1, HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE);
881+
882+ wa_add(wal,
883+ HSW_ROW_CHICKEN3, 0,
884+ _MASKED_BIT_ENABLE(HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE),
885+ 0 /* XXX does this reg exist? */);
886+
887+ /* WaVSRefCountFullforceMissDisable:hsw */
888+ wa_write_clr(wal, GEN7_FF_THREAD_MODE, GEN7_FF_VS_REF_CNT_FFME);
889+
890+ wa_masked_dis(wal,
891+ CACHE_MODE_0_GEN7,
892+ /* WaDisable_RenderCache_OperationalFlush:hsw */
893+ RC_OP_FLUSH_ENABLE |
894+ /* enable HiZ Raw Stall Optimization */
895+ HIZ_RAW_STALL_OPT_DISABLE);
896+
897+ /* WaDisable4x2SubspanOptimization:hsw */
898+ wa_masked_en(wal, CACHE_MODE_1, PIXEL_SUBSPAN_COLLECT_OPT_DISABLE);
899+
900+ /*
901+ * BSpec recommends 8x4 when MSAA is used,
902+ * however in practice 16x4 seems fastest.
903+ *
904+ * Note that PS/WM thread counts depend on the WIZ hashing
905+ * disable bit, which we don't touch here, but it's good
906+ * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
907+ */
908+ wa_add(wal, GEN7_GT_MODE, 0,
909+ _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4),
910+ GEN6_WIZ_HASHING_16x4);
911+
912+ /* WaSampleCChickenBitEnable:hsw */
913+ wa_masked_en(wal, HALF_SLICE_CHICKEN3, HSW_SAMPLE_C_PERFORMANCE);
914+}
915+
689916 static void
690917 gen9_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
691918 {
@@ -963,6 +1190,20 @@ gt_init_workarounds(struct drm_i915_private *i915, struct i915_wa_list *wal) · 271 unmodified lines
9631190 bxt_gt_workarounds_init(i915, wal);
9641191 else if (IS_SKYLAKE(i915))
9651192 skl_gt_workarounds_init(i915, wal);
1193+ else if (IS_HASWELL(i915))
1194+ hsw_gt_workarounds_init(i915, wal);
1195+ else if (IS_VALLEYVIEW(i915))
1196+ vlv_gt_workarounds_init(i915, wal);
1197+ else if (IS_IVYBRIDGE(i915))
1198+ ivb_gt_workarounds_init(i915, wal);
1199+ else if (IS_GEN(i915, 6))
1200+ snb_gt_workarounds_init(i915, wal);
1201+ else if (IS_GEN(i915, 5))
1202+ ilk_gt_workarounds_init(i915, wal);
1203+ else if (IS_G4X(i915))
1204+ g4x_gt_workarounds_init(i915, wal);
1205+ else if (IS_GEN(i915, 4))
1206+ gen4_gt_workarounds_init(i915, wal);
9661207 else if (INTEL_GEN(i915) <= 8)
9671208 return;
9681209 else
drivers/gpu/drm/i915/gt/selftest_hangcheck.c+10−15
@@ -310,22 +310,20 @@ static bool wait_until_running(struct hang *h, struct i915_request *rq) · 309 unmodified lines
310310 1000));
311311 }
312312
313−static void engine_heartbeat_disable(struct intel_engine_cs *engine,
314− unsigned long *saved)
313+static void engine_heartbeat_disable(struct intel_engine_cs *engine)
315314 {
316− *saved = engine->props.heartbeat_interval_ms;
317315 engine->props.heartbeat_interval_ms = 0;
318316
319317 intel_engine_pm_get(engine);
320318 intel_engine_park_heartbeat(engine);
321319 }
322320
323−static void engine_heartbeat_enable(struct intel_engine_cs *engine,
324− unsigned long saved)
321+static void engine_heartbeat_enable(struct intel_engine_cs *engine)
325322 {
326323 intel_engine_pm_put(engine);
327324
328− engine->props.heartbeat_interval_ms = saved;
325+ engine->props.heartbeat_interval_ms =
326+ engine->defaults.heartbeat_interval_ms;
329327 }
330328
331329 static int igt_hang_sanitycheck(void *arg)
@@ -473,7 +471,6 @@ static int igt_reset_nop_engine(void *arg) · 141 unmodified lines
473471 for_each_engine(engine, gt, id) {
474472 unsigned int reset_count, reset_engine_count, count;
475473 struct intel_context *ce;
476− unsigned long heartbeat;
477474 IGT_TIMEOUT(end_time);
478475 int err;
479476
@@ -485,7 +482,7 @@ static int igt_reset_nop_engine(void *arg) · 5 unmodified lines
485482 reset_engine_count = i915_reset_engine_count(global, engine);
486483 count = 0;
487484
488− engine_heartbeat_disable(engine, &heartbeat);
485+ engine_heartbeat_disable(engine);
489486 set_bit(I915_RESET_ENGINE + id, &gt->reset.flags);
490487 do {
491488 int i;
@@ -529,7 +526,7 @@ static int igt_reset_nop_engine(void *arg) · 37 unmodified lines
529526 }
530527 } while (time_before(jiffies, end_time));
531528 clear_bit(I915_RESET_ENGINE + id, &gt->reset.flags);
532− engine_heartbeat_enable(engine, heartbeat);
529+ engine_heartbeat_enable(engine);
533530
534531 pr_info("%s(%s): %d resets\n", __func__, engine->name, count);
535532
@@ -564,7 +561,6 @@ static int __igt_reset_engine(struct intel_gt *gt, bool active) · 28 unmodified lines
564561
565562 for_each_engine(engine, gt, id) {
566563 unsigned int reset_count, reset_engine_count;
567− unsigned long heartbeat;
568564 IGT_TIMEOUT(end_time);
569565
570566 if (active && !intel_engine_can_store_dword(engine))
@@ -580,7 +576,7 @@ static int __igt_reset_engine(struct intel_gt *gt, bool active) · 9 unmodified lines
580576 reset_count = i915_reset_count(global);
581577 reset_engine_count = i915_reset_engine_count(global, engine);
582578
583− engine_heartbeat_disable(engine, &heartbeat);
579+ engine_heartbeat_disable(engine);
584580 set_bit(I915_RESET_ENGINE + id, &gt->reset.flags);
585581 do {
586582 if (active) {
@@ -632,7 +628,7 @@ static int __igt_reset_engine(struct intel_gt *gt, bool active) · 45 unmodified lines
632628 }
633629 } while (time_before(jiffies, end_time));
634630 clear_bit(I915_RESET_ENGINE + id, &gt->reset.flags);
635− engine_heartbeat_enable(engine, heartbeat);
631+ engine_heartbeat_enable(engine);
636632
637633 if (err)
638634 break;
@@ -789,7 +785,6 @@ static int __igt_reset_engines(struct intel_gt *gt, · 150 unmodified lines
789785 struct active_engine threads[I915_NUM_ENGINES] = {};
790786 unsigned long device = i915_reset_count(global);
791787 unsigned long count = 0, reported;
792− unsigned long heartbeat;
793788 IGT_TIMEOUT(end_time);
794789
795790 if (flags & TEST_ACTIVE &&
@@ -832,7 +827,7 @@ static int __igt_reset_engines(struct intel_gt *gt, · 36 unmodified lines
832827
833828 yield(); /* start all threads before we begin */
834829
835− engine_heartbeat_disable(engine, &heartbeat);
830+ engine_heartbeat_disable(engine);
836831 set_bit(I915_RESET_ENGINE + id, &gt->reset.flags);
837832 do {
838833 struct i915_request *rq = NULL;
@@ -906,7 +901,7 @@ static int __igt_reset_engines(struct intel_gt *gt, · 67 unmodified lines
906901 }
907902 } while (time_before(jiffies, end_time));
908903 clear_bit(I915_RESET_ENGINE + id, &gt->reset.flags);
909− engine_heartbeat_enable(engine, heartbeat);
904+ engine_heartbeat_enable(engine);
910905
911906 pr_info("i915_reset_engine(%s:%s): %lu resets\n",
912907 engine->name, test_name, count);
drivers/gpu/drm/i915/gt/selftest_lrc.c+140−45
@@ -51,22 +51,20 @@ static struct i915_vma *create_scratch(struct intel_gt *gt) · 50 unmodified lines
5151 return vma;
5252 }
5353
54−static void engine_heartbeat_disable(struct intel_engine_cs *engine,
55− unsigned long *saved)
54+static void engine_heartbeat_disable(struct intel_engine_cs *engine)
5655 {
57− *saved = engine->props.heartbeat_interval_ms;
5856 engine->props.heartbeat_interval_ms = 0;
5957
6058 intel_engine_pm_get(engine);
6159 intel_engine_park_heartbeat(engine);
6260 }
6361
64−static void engine_heartbeat_enable(struct intel_engine_cs *engine,
65− unsigned long saved)
62+static void engine_heartbeat_enable(struct intel_engine_cs *engine)
6663 {
6764 intel_engine_pm_put(engine);
6865
69− engine->props.heartbeat_interval_ms = saved;
66+ engine->props.heartbeat_interval_ms =
67+ engine->defaults.heartbeat_interval_ms;
7068 }
7169
7270 static bool is_active(struct i915_request *rq)
@@ -224,7 +222,6 @@ static int live_unlite_restore(struct intel_gt *gt, int prio) · 151 unmodified lines
224222 struct intel_context *ce[2] = {};
225223 struct i915_request *rq[2];
226224 struct igt_live_test t;
227− unsigned long saved;
228225 int n;
229226
230227 if (prio && !intel_engine_has_preemption(engine))
@@ -237,7 +234,7 @@ static int live_unlite_restore(struct intel_gt *gt, int prio) · 6 unmodified lines
237234 err = -EIO;
238235 break;
239236 }
240− engine_heartbeat_disable(engine, &saved);
237+ engine_heartbeat_disable(engine);
241238
242239 for (n = 0; n < ARRAY_SIZE(ce); n++) {
243240 struct intel_context *tmp;
@@ -345,7 +342,7 @@ err_ce: · 101 unmodified lines
345342 intel_context_put(ce[n]);
346343 }
347344
348− engine_heartbeat_enable(engine, saved);
345+ engine_heartbeat_enable(engine);
349346 if (igt_live_test_end(&t))
350347 err = -EIO;
351348 if (err)
@@ -466,7 +463,6 @@ static int live_hold_reset(void *arg) · 114 unmodified lines
466463
467464 for_each_engine(engine, gt, id) {
468465 struct intel_context *ce;
469− unsigned long heartbeat;
470466 struct i915_request *rq;
471467
472468 ce = intel_context_create(engine);
@@ -475,7 +471,7 @@ static int live_hold_reset(void *arg) · 2 unmodified lines
475471 break;
476472 }
477473
478− engine_heartbeat_disable(engine, &heartbeat);
474+ engine_heartbeat_disable(engine);
479475
480476 rq = igt_spinner_create_request(&spin, ce, MI_ARB_CHECK);
481477 if (IS_ERR(rq)) {
@@ -535,7 +531,7 @@ static int live_hold_reset(void *arg) · 53 unmodified lines
535531 i915_request_put(rq);
536532
537533 out:
538− engine_heartbeat_enable(engine, heartbeat);
534+ engine_heartbeat_enable(engine);
539535 intel_context_put(ce);
540536 if (err)
541537 break;
@@ -580,10 +576,9 @@ static int live_error_interrupt(void *arg) · 38 unmodified lines
580576
581577 for_each_engine(engine, gt, id) {
582578 const struct error_phase *p;
583− unsigned long heartbeat;
584579 int err = 0;
585580
586− engine_heartbeat_disable(engine, &heartbeat);
581+ engine_heartbeat_disable(engine);
587582
588583 for (p = phases; p->error[0] != GOOD; p++) {
589584 struct i915_request *client[ARRAY_SIZE(phases->error)];
@@ -682,7 +677,7 @@ out: · 92 unmodified lines
682677 }
683678 }
684679
685− engine_heartbeat_enable(engine, heartbeat);
680+ engine_heartbeat_enable(engine);
686681 if (err) {
687682 intel_gt_set_wedged(gt);
688683 return err;
@@ -828,7 +823,7 @@ slice_semaphore_queue(struct intel_engine_cs *outer, · 139 unmodified lines
828823 }
829824 }
830825
831− err = release_queue(outer, vma, n, INT_MAX);
826+ err = release_queue(outer, vma, n, I915_PRIORITY_BARRIER);
832827 if (err)
833828 goto out;
834829
@@ -895,16 +890,14 @@ static int live_timeslice_preempt(void *arg) · 60 unmodified lines
895890 enum intel_engine_id id;
896891
897892 for_each_engine(engine, gt, id) {
898− unsigned long saved;
899−
900893 if (!intel_engine_has_preemption(engine))
901894 continue;
902895
903896 memset(vaddr, 0, PAGE_SIZE);
904897
905− engine_heartbeat_disable(engine, &saved);
898+ engine_heartbeat_disable(engine);
906899 err = slice_semaphore_queue(engine, vma, count);
907− engine_heartbeat_enable(engine, saved);
900+ engine_heartbeat_enable(engine);
908901 if (err)
909902 goto err_pin;
910903
@@ -1009,7 +1002,6 @@ static int live_timeslice_rewind(void *arg) · 98 unmodified lines
10091002 enum { X = 1, Z, Y };
10101003 struct i915_request *rq[3] = {};
10111004 struct intel_context *ce;
1012− unsigned long heartbeat;
10131005 unsigned long timeslice;
10141006 int i, err = 0;
10151007 u32 *slot;
@@ -1028,7 +1020,7 @@ static int live_timeslice_rewind(void *arg) · 12 unmodified lines
10281020 * Expect execution/evaluation order XZY
10291021 */
10301022
1031− engine_heartbeat_disable(engine, &heartbeat);
1023+ engine_heartbeat_disable(engine);
10321024 timeslice = xchg(&engine->props.timeslice_duration_ms, 1);
10331025
10341026 slot = memset32(engine->status_page.addr + 1000, 0, 4);
@@ -1122,7 +1114,7 @@ err: · 87 unmodified lines
11221114 wmb();
11231115
11241116 engine->props.timeslice_duration_ms = timeslice;
1125− engine_heartbeat_enable(engine, heartbeat);
1117+ engine_heartbeat_enable(engine);
11261118 for (i = 0; i < 3; i++)
11271119 i915_request_put(rq[i]);
11281120 if (igt_flush_test(gt->i915))
@@ -1202,12 +1194,11 @@ static int live_timeslice_queue(void *arg) · 73 unmodified lines
12021194 .priority = I915_USER_PRIORITY(I915_PRIORITY_MAX),
12031195 };
12041196 struct i915_request *rq, *nop;
1205− unsigned long saved;
12061197
12071198 if (!intel_engine_has_preemption(engine))
12081199 continue;
12091200
1210− engine_heartbeat_disable(engine, &saved);
1201+ engine_heartbeat_disable(engine);
12111202 memset(vaddr, 0, PAGE_SIZE);
12121203
12131204 /* ELSP[0]: semaphore wait */
@@ -1284,7 +1275,7 @@ static int live_timeslice_queue(void *arg) · 70 unmodified lines
12841275 err_rq:
12851276 i915_request_put(rq);
12861277 err_heartbeat:
1287− engine_heartbeat_enable(engine, saved);
1278+ engine_heartbeat_enable(engine);
12881279 if (err)
12891280 break;
12901281 }
@@ -1298,6 +1289,121 @@ err_obj: · 7 unmodified lines
12981289 return err;
12991290 }
13001291
1292+static int live_timeslice_nopreempt(void *arg)
1293+{
1294+ struct intel_gt *gt = arg;
1295+ struct intel_engine_cs *engine;
1296+ enum intel_engine_id id;
1297+ struct igt_spinner spin;
1298+ int err = 0;
1299+
1300+ /*
1301+ * We should not timeslice into a request that is marked with
1302+ * I915_REQUEST_NOPREEMPT.
1303+ */
1304+ if (!IS_ACTIVE(CONFIG_DRM_I915_TIMESLICE_DURATION))
1305+ return 0;
1306+
1307+ if (igt_spinner_init(&spin, gt))
1308+ return -ENOMEM;
1309+
1310+ for_each_engine(engine, gt, id) {
1311+ struct intel_context *ce;
1312+ struct i915_request *rq;
1313+ unsigned long timeslice;
1314+
1315+ if (!intel_engine_has_preemption(engine))
1316+ continue;
1317+
1318+ ce = intel_context_create(engine);
1319+ if (IS_ERR(ce)) {
1320+ err = PTR_ERR(ce);
1321+ break;
1322+ }
1323+
1324+ engine_heartbeat_disable(engine);
1325+ timeslice = xchg(&engine->props.timeslice_duration_ms, 1);
1326+
1327+ /* Create an unpreemptible spinner */
1328+
1329+ rq = igt_spinner_create_request(&spin, ce, MI_ARB_CHECK);
1330+ intel_context_put(ce);
1331+ if (IS_ERR(rq)) {
1332+ err = PTR_ERR(rq);
1333+ goto out_heartbeat;
1334+ }
1335+
1336+ i915_request_get(rq);
1337+ i915_request_add(rq);
1338+
1339+ if (!igt_wait_for_spinner(&spin, rq)) {
1340+ i915_request_put(rq);
1341+ err = -ETIME;
1342+ goto out_spin;
1343+ }
1344+
1345+ set_bit(I915_FENCE_FLAG_NOPREEMPT, &rq->fence.flags);
1346+ i915_request_put(rq);
1347+
1348+ /* Followed by a maximum priority barrier (heartbeat) */
1349+
1350+ ce = intel_context_create(engine);
1351+ if (IS_ERR(ce)) {
1352+ err = PTR_ERR(rq);
1353+ goto out_spin;
1354+ }
1355+
1356+ rq = intel_context_create_request(ce);
1357+ intel_context_put(ce);
1358+ if (IS_ERR(rq)) {
1359+ err = PTR_ERR(rq);
1360+ goto out_spin;
1361+ }
1362+
1363+ rq->sched.attr.priority = I915_PRIORITY_BARRIER;
1364+ i915_request_get(rq);
1365+ i915_request_add(rq);
1366+
1367+ /*
1368+ * Wait until the barrier is in ELSP, and we know timeslicing
1369+ * will have been activated.
1370+ */
1371+ if (wait_for_submit(engine, rq, HZ / 2)) {
1372+ i915_request_put(rq);
1373+ err = -ETIME;
1374+ goto out_spin;
1375+ }
1376+
1377+ /*
1378+ * Since the ELSP[0] request is unpreemptible, it should not
1379+ * allow the maximum priority barrier through. Wait long
1380+ * enough to see if it is timesliced in by mistake.
1381+ */
1382+ if (i915_request_wait(rq, 0, timeslice_threshold(engine)) >= 0) {
1383+ pr_err("%s: I915_PRIORITY_BARRIER request completed, bypassing no-preempt request\n",
1384+ engine->name);
1385+ err = -EINVAL;
1386+ }
1387+ i915_request_put(rq);
1388+
1389+out_spin:
1390+ igt_spinner_end(&spin);
1391+out_heartbeat:
1392+ xchg(&engine->props.timeslice_duration_ms, timeslice);
1393+ engine_heartbeat_enable(engine);
1394+ if (err)
1395+ break;
1396+
1397+ if (igt_flush_test(gt->i915)) {
1398+ err = -EIO;
1399+ break;
1400+ }
1401+ }
1402+
1403+ igt_spinner_fini(&spin);
1404+ return err;
1405+}
1406+
13011407 static int live_busywait_preempt(void *arg)
13021408 {
13031409 struct intel_gt *gt = arg;
@@ -4153,7 +4259,6 @@ static int reset_virtual_engine(struct intel_gt *gt, · 2849 unmodified lines
41534259 {
41544260 struct intel_engine_cs *engine;
41554261 struct intel_context *ve;
4156− unsigned long *heartbeat;
41574262 struct igt_spinner spin;
41584263 struct i915_request *rq;
41594264 unsigned int n;
@@ -4165,15 +4270,9 @@ static int reset_virtual_engine(struct intel_gt *gt, · 5 unmodified lines
41654270 * descendents are not executed while the capture is in progress.
41664271 */
41674272
4168− heartbeat = kmalloc_array(nsibling, sizeof(*heartbeat), GFP_KERNEL);
4169− if (!heartbeat)
4273+ if (igt_spinner_init(&spin, gt))
41704274 return -ENOMEM;
41714275
4172− if (igt_spinner_init(&spin, gt)) {
4173− err = -ENOMEM;
4174− goto out_free;
4175− }
4176−
41774276 ve = intel_execlists_create_virtual(siblings, nsibling);
41784277 if (IS_ERR(ve)) {
41794278 err = PTR_ERR(ve);
@@ -4181,7 +4280,7 @@ static int reset_virtual_engine(struct intel_gt *gt, · 1 unmodified line
41814280 }
41824281
41834282 for (n = 0; n < nsibling; n++)
4184− engine_heartbeat_disable(siblings[n], &heartbeat[n]);
4283+ engine_heartbeat_disable(siblings[n]);
41854284
41864285 rq = igt_spinner_create_request(&spin, ve, MI_ARB_CHECK);
41874286 if (IS_ERR(rq)) {
@@ -4252,13 +4351,11 @@ out_rq: · 64 unmodified lines
42524351 i915_request_put(rq);
42534352 out_heartbeat:
42544353 for (n = 0; n < nsibling; n++)
4255− engine_heartbeat_enable(siblings[n], heartbeat[n]);
4354+ engine_heartbeat_enable(siblings[n]);
42564355
42574356 intel_context_put(ve);
42584357 out_spin:
42594358 igt_spinner_fini(&spin);
4260−out_free:
4261− kfree(heartbeat);
42624359 return err;
42634360 }
42644361
@@ -4314,6 +4411,7 @@ int intel_execlists_live_selftests(struct drm_i915_private *i915) · 49 unmodified lines
43144411 SUBTEST(live_timeslice_preempt),
43154412 SUBTEST(live_timeslice_rewind),
43164413 SUBTEST(live_timeslice_queue),
4414+ SUBTEST(live_timeslice_nopreempt),
43174415 SUBTEST(live_busywait_preempt),
43184416 SUBTEST(live_preempt),
43194417 SUBTEST(live_late_preempt),
@@ -4932,9 +5030,7 @@ static int live_lrc_gpr(void *arg) · 612 unmodified lines
49325030 return PTR_ERR(scratch);
49335031
49345032 for_each_engine(engine, gt, id) {
4935− unsigned long heartbeat;
4936−
4937− engine_heartbeat_disable(engine, &heartbeat);
5033+ engine_heartbeat_disable(engine);
49385034
49395035 err = __live_lrc_gpr(engine, scratch, false);
49405036 if (err)
@@ -4945,7 +5041,7 @@ static int live_lrc_gpr(void *arg) · 4 unmodified lines
49455041 goto err;
49465042
49475043 err:
4948− engine_heartbeat_enable(engine, heartbeat);
5044+ engine_heartbeat_enable(engine);
49495045 if (igt_flush_test(gt->i915))
49505046 err = -EIO;
49515047 if (err)
@@ -5092,10 +5188,9 @@ static int live_lrc_timestamp(void *arg) · 140 unmodified lines
50925188 */
50935189
50945190 for_each_engine(data.engine, gt, id) {
5095− unsigned long heartbeat;
50965191 int i, err = 0;
50975192
5098− engine_heartbeat_disable(data.engine, &heartbeat);
5193+ engine_heartbeat_disable(data.engine);
50995194
51005195 for (i = 0; i < ARRAY_SIZE(data.ce); i++) {
51015196 struct intel_context *tmp;
@@ -5128,7 +5223,7 @@ static int live_lrc_timestamp(void *arg) · 26 unmodified lines
51285223 }
51295224
51305225 err:
5131− engine_heartbeat_enable(data.engine, heartbeat);
5226+ engine_heartbeat_enable(data.engine);
51325227 for (i = 0; i < ARRAY_SIZE(data.ce); i++) {
51335228 if (!data.ce[i])
51345229 break;
drivers/gpu/drm/i915/gt/selftest_mocs.c+16−2
@@ -18,6 +18,20 @@ struct live_mocs { · 17 unmodified lines
1818 void *vaddr;
1919 };
2020
21+static struct intel_context *mocs_context_create(struct intel_engine_cs *engine)
22+{
23+ struct intel_context *ce;
24+
25+ ce = intel_context_create(engine);
26+ if (IS_ERR(ce))
27+ return ce;
28+
29+ /* We build large requests to read the registers from the ring */
30+ ce->ring = __intel_context_ring_size(SZ_16K);
31+
32+ return ce;
33+}
34+
2135 static int request_add_sync(struct i915_request *rq, int err)
2236 {
2337 i915_request_get(rq);
@@ -301,7 +315,7 @@ static int live_mocs_clean(void *arg) · 277 unmodified lines
301315 for_each_engine(engine, gt, id) {
302316 struct intel_context *ce;
303317
304− ce = intel_context_create(engine);
318+ ce = mocs_context_create(engine);
305319 if (IS_ERR(ce)) {
306320 err = PTR_ERR(ce);
307321 break;
@@ -395,7 +409,7 @@ static int live_mocs_reset(void *arg) · 87 unmodified lines
395409 for_each_engine(engine, gt, id) {
396410 struct intel_context *ce;
397411
398− ce = intel_context_create(engine);
412+ ce = mocs_context_create(engine);
399413 if (IS_ERR(ce)) {
400414 err = PTR_ERR(ce);
401415 break;
drivers/gpu/drm/i915/gt/selftest_ring.c+110−0
@@ -0,0 +1,110 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Copyright © 2020 Intel Corporation
4+ */
5+
6+static struct intel_ring *mock_ring(unsigned long sz)
7+{
8+ struct intel_ring *ring;
9+
10+ ring = kzalloc(sizeof(*ring) + sz, GFP_KERNEL);
11+ if (!ring)
12+ return NULL;
13+
14+ kref_init(&ring->ref);
15+ ring->size = sz;
16+ ring->wrap = BITS_PER_TYPE(ring->size) - ilog2(sz);
17+ ring->effective_size = sz;
18+ ring->vaddr = (void *)(ring + 1);
19+ atomic_set(&ring->pin_count, 1);
20+
21+ intel_ring_update_space(ring);
22+
23+ return ring;
24+}
25+
26+static void mock_ring_free(struct intel_ring *ring)
27+{
28+ kfree(ring);
29+}
30+
31+static int check_ring_direction(struct intel_ring *ring,
32+ u32 next, u32 prev,
33+ int expected)
34+{
35+ int result;
36+
37+ result = intel_ring_direction(ring, next, prev);
38+ if (result < 0)
39+ result = -1;
40+ else if (result > 0)
41+ result = 1;
42+
43+ if (result != expected) {
44+ pr_err("intel_ring_direction(%u, %u):%d != %d\n",
45+ next, prev, result, expected);
46+ return -EINVAL;
47+ }
48+
49+ return 0;
50+}
51+
52+static int check_ring_step(struct intel_ring *ring, u32 x, u32 step)
53+{
54+ u32 prev = x, next = intel_ring_wrap(ring, x + step);
55+ int err = 0;
56+
57+ err |= check_ring_direction(ring, next, next, 0);
58+ err |= check_ring_direction(ring, prev, prev, 0);
59+ err |= check_ring_direction(ring, next, prev, 1);
60+ err |= check_ring_direction(ring, prev, next, -1);
61+
62+ return err;
63+}
64+
65+static int check_ring_offset(struct intel_ring *ring, u32 x, u32 step)
66+{
67+ int err = 0;
68+
69+ err |= check_ring_step(ring, x, step);
70+ err |= check_ring_step(ring, intel_ring_wrap(ring, x + 1), step);
71+ err |= check_ring_step(ring, intel_ring_wrap(ring, x - 1), step);
72+
73+ return err;
74+}
75+
76+static int igt_ring_direction(void *dummy)
77+{
78+ struct intel_ring *ring;
79+ unsigned int half = 2048;
80+ int step, err = 0;
81+
82+ ring = mock_ring(2 * half);
83+ if (!ring)
84+ return -ENOMEM;
85+
86+ GEM_BUG_ON(ring->size != 2 * half);
87+
88+ /* Precision of wrap detection is limited to ring->size / 2 */
89+ for (step = 1; step < half; step <<= 1) {
90+ err |= check_ring_offset(ring, 0, step);
91+ err |= check_ring_offset(ring, half, step);
92+ }
93+ err |= check_ring_step(ring, 0, half - 64);
94+
95+ /* And check unwrapped handling for good measure */
96+ err |= check_ring_offset(ring, 0, 2 * half + 64);
97+ err |= check_ring_offset(ring, 3 * half, 1);
98+
99+ mock_ring_free(ring);
100+ return err;
101+}
102+
103+int intel_ring_mock_selftests(void)
104+{
105+ static const struct i915_subtest tests[] = {
106+ SUBTEST(igt_ring_direction),
107+ };
108+
109+ return i915_subtests(tests, NULL);
110+}
drivers/gpu/drm/i915/gt/selftest_rps.c+28−41
@@ -20,24 +20,20 @@ · 19 unmodified lines
2020 /* Try to isolate the impact of cstates from determing frequency response */
2121 #define CPU_LATENCY 0 /* -1 to disable pm_qos, 0 to disable cstates */
2222
23−static unsigned long engine_heartbeat_disable(struct intel_engine_cs *engine)
23+static void engine_heartbeat_disable(struct intel_engine_cs *engine)
2424 {
25− unsigned long old;
26−
27− old = fetch_and_zero(&engine->props.heartbeat_interval_ms);
25+ engine->props.heartbeat_interval_ms = 0;
2826
2927 intel_engine_pm_get(engine);
3028 intel_engine_park_heartbeat(engine);
31−
32− return old;
3329 }
3430
35−static void engine_heartbeat_enable(struct intel_engine_cs *engine,
36− unsigned long saved)
31+static void engine_heartbeat_enable(struct intel_engine_cs *engine)
3732 {
3833 intel_engine_pm_put(engine);
3934
40− engine->props.heartbeat_interval_ms = saved;
35+ engine->props.heartbeat_interval_ms =
36+ engine->defaults.heartbeat_interval_ms;
4137 }
4238
4339 static void dummy_rps_work(struct work_struct *wrk)
@@ -246,7 +242,6 @@ int live_rps_clock_interval(void *arg) · 202 unmodified lines
246242 intel_gt_check_clock_frequency(gt);
247243
248244 for_each_engine(engine, gt, id) {
249− unsigned long saved_heartbeat;
250245 struct i915_request *rq;
251246 u32 cycles;
252247 u64 dt;
@@ -254,13 +249,13 @@ int live_rps_clock_interval(void *arg) · 1 unmodified line
254249 if (!intel_engine_can_store_dword(engine))
255250 continue;
256251
257− saved_heartbeat = engine_heartbeat_disable(engine);
252+ engine_heartbeat_disable(engine);
258253
259254 rq = igt_spinner_create_request(&spin,
260255 engine->kernel_context,
261256 MI_NOOP);
262257 if (IS_ERR(rq)) {
263− engine_heartbeat_enable(engine, saved_heartbeat);
258+ engine_heartbeat_enable(engine);
264259 err = PTR_ERR(rq);
265260 break;
266261 }
@@ -271,7 +266,7 @@ int live_rps_clock_interval(void *arg) · 4 unmodified lines
271266 pr_err("%s: RPS spinner did not start\n",
272267 engine->name);
273268 igt_spinner_end(&spin);
274− engine_heartbeat_enable(engine, saved_heartbeat);
269+ engine_heartbeat_enable(engine);
275270 intel_gt_set_wedged(engine->gt);
276271 err = -EIO;
277272 break;
@@ -327,7 +322,7 @@ int live_rps_clock_interval(void *arg) · 49 unmodified lines
327322 intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_ALL);
328323
329324 igt_spinner_end(&spin);
330− engine_heartbeat_enable(engine, saved_heartbeat);
325+ engine_heartbeat_enable(engine);
331326
332327 if (err == 0) {
333328 u64 time = intel_gt_pm_interval_to_ns(gt, cycles);
@@ -405,7 +400,6 @@ int live_rps_control(void *arg) · 71 unmodified lines
405400
406401 intel_gt_pm_get(gt);
407402 for_each_engine(engine, gt, id) {
408− unsigned long saved_heartbeat;
409403 struct i915_request *rq;
410404 ktime_t min_dt, max_dt;
411405 int f, limit;
@@ -414,7 +408,7 @@ int live_rps_control(void *arg) · 2 unmodified lines
414408 if (!intel_engine_can_store_dword(engine))
415409 continue;
416410
417− saved_heartbeat = engine_heartbeat_disable(engine);
411+ engine_heartbeat_disable(engine);
418412
419413 rq = igt_spinner_create_request(&spin,
420414 engine->kernel_context,
@@ -430,7 +424,7 @@ int live_rps_control(void *arg) · 9 unmodified lines
430424 pr_err("%s: RPS spinner did not start\n",
431425 engine->name);
432426 igt_spinner_end(&spin);
433− engine_heartbeat_enable(engine, saved_heartbeat);
427+ engine_heartbeat_enable(engine);
434428 intel_gt_set_wedged(engine->gt);
435429 err = -EIO;
436430 break;
@@ -440,7 +434,7 @@ int live_rps_control(void *arg) · 3 unmodified lines
440434 pr_err("%s: could not set minimum frequency [%x], only %x!\n",
441435 engine->name, rps->min_freq, read_cagf(rps));
442436 igt_spinner_end(&spin);
443− engine_heartbeat_enable(engine, saved_heartbeat);
437+ engine_heartbeat_enable(engine);
444438 show_pstate_limits(rps);
445439 err = -EINVAL;
446440 break;
@@ -457,7 +451,7 @@ int live_rps_control(void *arg) · 10 unmodified lines
457451 pr_err("%s: could not restore minimum frequency [%x], only %x!\n",
458452 engine->name, rps->min_freq, read_cagf(rps));
459453 igt_spinner_end(&spin);
460− engine_heartbeat_enable(engine, saved_heartbeat);
454+ engine_heartbeat_enable(engine);
461455 show_pstate_limits(rps);
462456 err = -EINVAL;
463457 break;
@@ -472,7 +466,7 @@ int live_rps_control(void *arg) · 8 unmodified lines
472466 min_dt = ktime_sub(ktime_get(), min_dt);
473467
474468 igt_spinner_end(&spin);
475− engine_heartbeat_enable(engine, saved_heartbeat);
469+ engine_heartbeat_enable(engine);
476470
477471 pr_info("%s: range:[%x:%uMHz, %x:%uMHz] limit:[%x:%uMHz], %x:%x response %lluns:%lluns\n",
478472 engine->name,
@@ -635,7 +629,6 @@ int live_rps_frequency_cs(void *arg) · 156 unmodified lines
635629 rps->work.func = dummy_rps_work;
636630
637631 for_each_engine(engine, gt, id) {
638− unsigned long saved_heartbeat;
639632 struct i915_request *rq;
640633 struct i915_vma *vma;
641634 u32 *cancel, *cntr;
@@ -644,14 +637,14 @@ int live_rps_frequency_cs(void *arg) · 2 unmodified lines
644637 int freq;
645638 } min, max;
646639
647− saved_heartbeat = engine_heartbeat_disable(engine);
640+ engine_heartbeat_disable(engine);
648641
649642 vma = create_spin_counter(engine,
650643 engine->kernel_context->vm, false,
651644 &cancel, &cntr);
652645 if (IS_ERR(vma)) {
653646 err = PTR_ERR(vma);
654− engine_heartbeat_enable(engine, saved_heartbeat);
647+ engine_heartbeat_enable(engine);
655648 break;
656649 }
657650
@@ -732,7 +725,7 @@ err_vma: · 74 unmodified lines
732725 i915_vma_unpin(vma);
733726 i915_vma_put(vma);
734727
735− engine_heartbeat_enable(engine, saved_heartbeat);
728+ engine_heartbeat_enable(engine);
736729 if (igt_flush_test(gt->i915))
737730 err = -EIO;
738731 if (err)
@@ -778,7 +771,6 @@ int live_rps_frequency_srm(void *arg) · 39 unmodified lines
778771 rps->work.func = dummy_rps_work;
779772
780773 for_each_engine(engine, gt, id) {
781− unsigned long saved_heartbeat;
782774 struct i915_request *rq;
783775 struct i915_vma *vma;
784776 u32 *cancel, *cntr;
@@ -787,14 +779,14 @@ int live_rps_frequency_srm(void *arg) · 2 unmodified lines
787779 int freq;
788780 } min, max;
789781
790− saved_heartbeat = engine_heartbeat_disable(engine);
782+ engine_heartbeat_disable(engine);
791783
792784 vma = create_spin_counter(engine,
793785 engine->kernel_context->vm, true,
794786 &cancel, &cntr);
795787 if (IS_ERR(vma)) {
796788 err = PTR_ERR(vma);
797− engine_heartbeat_enable(engine, saved_heartbeat);
789+ engine_heartbeat_enable(engine);
798790 break;
799791 }
800792
@@ -874,7 +866,7 @@ err_vma: · 73 unmodified lines
874866 i915_vma_unpin(vma);
875867 i915_vma_put(vma);
876868
877− engine_heartbeat_enable(engine, saved_heartbeat);
869+ engine_heartbeat_enable(engine);
878870 if (igt_flush_test(gt->i915))
879871 err = -EIO;
880872 if (err)
@@ -1066,16 +1058,14 @@ int live_rps_interrupt(void *arg) · 185 unmodified lines
10661058 for_each_engine(engine, gt, id) {
10671059 /* Keep the engine busy with a spinner; expect an UP! */
10681060 if (pm_events & GEN6_PM_RP_UP_THRESHOLD) {
1069− unsigned long saved_heartbeat;
1070−
10711061 intel_gt_pm_wait_for_idle(engine->gt);
10721062 GEM_BUG_ON(intel_rps_is_active(rps));
10731063
1074− saved_heartbeat = engine_heartbeat_disable(engine);
1064+ engine_heartbeat_disable(engine);
10751065
10761066 err = __rps_up_interrupt(rps, engine, &spin);
10771067
1078− engine_heartbeat_enable(engine, saved_heartbeat);
1068+ engine_heartbeat_enable(engine);
10791069 if (err)
10801070 goto out;
10811071
@@ -1084,15 +1074,13 @@ int live_rps_interrupt(void *arg) · 2 unmodified lines
10841074
10851075 /* Keep the engine awake but idle and check for DOWN */
10861076 if (pm_events & GEN6_PM_RP_DOWN_THRESHOLD) {
1087− unsigned long saved_heartbeat;
1088−
1089− saved_heartbeat = engine_heartbeat_disable(engine);
1077+ engine_heartbeat_disable(engine);
10901078 intel_rc6_disable(&gt->rc6);
10911079
10921080 err = __rps_down_interrupt(rps, engine);
10931081
10941082 intel_rc6_enable(&gt->rc6);
1095− engine_heartbeat_enable(engine, saved_heartbeat);
1083+ engine_heartbeat_enable(engine);
10961084 if (err)
10971085 goto out;
10981086 }
@@ -1168,7 +1156,6 @@ int live_rps_power(void *arg) · 69 unmodified lines
11681156 rps->work.func = dummy_rps_work;
11691157
11701158 for_each_engine(engine, gt, id) {
1171− unsigned long saved_heartbeat;
11721159 struct i915_request *rq;
11731160 struct {
11741161 u64 power;
@@ -1178,13 +1165,13 @@ int live_rps_power(void *arg) · 3 unmodified lines
11781165 if (!intel_engine_can_store_dword(engine))
11791166 continue;
11801167
1181− saved_heartbeat = engine_heartbeat_disable(engine);
1168+ engine_heartbeat_disable(engine);
11821169
11831170 rq = igt_spinner_create_request(&spin,
11841171 engine->kernel_context,
11851172 MI_NOOP);
11861173 if (IS_ERR(rq)) {
1187− engine_heartbeat_enable(engine, saved_heartbeat);
1174+ engine_heartbeat_enable(engine);
11881175 err = PTR_ERR(rq);
11891176 break;
11901177 }
@@ -1195,7 +1182,7 @@ int live_rps_power(void *arg) · 4 unmodified lines
11951182 pr_err("%s: RPS spinner did not start\n",
11961183 engine->name);
11971184 igt_spinner_end(&spin);
1198− engine_heartbeat_enable(engine, saved_heartbeat);
1185+ engine_heartbeat_enable(engine);
11991186 intel_gt_set_wedged(engine->gt);
12001187 err = -EIO;
12011188 break;
@@ -1208,7 +1195,7 @@ int live_rps_power(void *arg) · 6 unmodified lines
12081195 min.power = measure_power_at(rps, &min.freq);
12091196
12101197 igt_spinner_end(&spin);
1211− engine_heartbeat_enable(engine, saved_heartbeat);
1198+ engine_heartbeat_enable(engine);
12121199
12131200 pr_info("%s: min:%llumW @ %uMHz, max:%llumW @ %uMHz\n",
12141201 engine->name,
drivers/gpu/drm/i915/gt/selftest_timeline.c+6−9
@@ -751,22 +751,20 @@ out_free: · 750 unmodified lines
751751 return err;
752752 }
753753
754−static void engine_heartbeat_disable(struct intel_engine_cs *engine,
755− unsigned long *saved)
754+static void engine_heartbeat_disable(struct intel_engine_cs *engine)
756755 {
757− *saved = engine->props.heartbeat_interval_ms;
758756 engine->props.heartbeat_interval_ms = 0;
759757
760758 intel_engine_pm_get(engine);
761759 intel_engine_park_heartbeat(engine);
762760 }
763761
764−static void engine_heartbeat_enable(struct intel_engine_cs *engine,
765− unsigned long saved)
762+static void engine_heartbeat_enable(struct intel_engine_cs *engine)
766763 {
767764 intel_engine_pm_put(engine);
768765
769− engine->props.heartbeat_interval_ms = saved;
766+ engine->props.heartbeat_interval_ms =
767+ engine->defaults.heartbeat_interval_ms;
770768 }
771769
772770 static int live_hwsp_rollover_kernel(void *arg)
@@ -785,10 +783,9 @@ static int live_hwsp_rollover_kernel(void *arg) · 12 unmodified lines
785783 struct intel_context *ce = engine->kernel_context;
786784 struct intel_timeline *tl = ce->timeline;
787785 struct i915_request *rq[3] = {};
788− unsigned long heartbeat;
789786 int i;
790787
791− engine_heartbeat_disable(engine, &heartbeat);
788+ engine_heartbeat_disable(engine);
792789 if (intel_gt_wait_for_idle(gt, HZ / 2)) {
793790 err = -EIO;
794791 goto out;
@@ -839,7 +836,7 @@ static int live_hwsp_rollover_kernel(void *arg) · 44 unmodified lines
839836 out:
840837 for (i = 0; i < ARRAY_SIZE(rq); i++)
841838 i915_request_put(rq[i]);
842− engine_heartbeat_enable(engine, heartbeat);
839+ engine_heartbeat_enable(engine);
843840 if (err)
844841 break;
845842 }
drivers/gpu/drm/i915/gt/selftest_workarounds.c+2−0
@@ -623,6 +623,8 @@ err_request: · 622 unmodified lines
623623 err = -EINVAL;
624624 goto out_unpin;
625625 }
626+ } else {
627+ rsvd = 0;
626628 }
627629
628630 expect = results[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_irq.c+1−0
@@ -3125,6 +3125,7 @@ static void gen11_hpd_irq_setup(struct drm_i915_private *dev_priv) · 3124 unmodified lines
31253125
31263126 val = I915_READ(GEN11_DE_HPD_IMR);
31273127 val &= ~hotplug_irqs;
3128+ val |= ~enabled_irqs & hotplug_irqs;
31283129 I915_WRITE(GEN11_DE_HPD_IMR, val);
31293130 POSTING_READ(GEN11_DE_HPD_IMR);
31303131
drivers/gpu/drm/i915/i915_pmu.c+42−42
@@ -269,12 +269,48 @@ static bool exclusive_mmio_access(const struct drm_i915_private *i915) · 268 unmodified lines
269269 return IS_GEN(i915, 7);
270270 }
271271
272+static void engine_sample(struct intel_engine_cs *engine, unsigned int period_ns)
273+{
274+ struct intel_engine_pmu *pmu = &engine->pmu;
275+ bool busy;
276+ u32 val;
277+
278+ val = ENGINE_READ_FW(engine, RING_CTL);
279+ if (val == 0) /* powerwell off => engine idle */
280+ return;
281+
282+ if (val & RING_WAIT)
283+ add_sample(&pmu->sample[I915_SAMPLE_WAIT], period_ns);
284+ if (val & RING_WAIT_SEMAPHORE)
285+ add_sample(&pmu->sample[I915_SAMPLE_SEMA], period_ns);
286+
287+ /* No need to sample when busy stats are supported. */
288+ if (intel_engine_supports_stats(engine))
289+ return;
290+
291+ /*
292+ * While waiting on a semaphore or event, MI_MODE reports the
293+ * ring as idle. However, previously using the seqno, and with
294+ * execlists sampling, we account for the ring waiting as the
295+ * engine being busy. Therefore, we record the sample as being
296+ * busy if either waiting or !idle.
297+ */
298+ busy = val & (RING_WAIT_SEMAPHORE | RING_WAIT);
299+ if (!busy) {
300+ val = ENGINE_READ_FW(engine, RING_MI_MODE);
301+ busy = !(val & MODE_IDLE);
302+ }
303+ if (busy)
304+ add_sample(&pmu->sample[I915_SAMPLE_BUSY], period_ns);
305+}
306+
272307 static void
273308 engines_sample(struct intel_gt *gt, unsigned int period_ns)
274309 {
275310 struct drm_i915_private *i915 = gt->i915;
276311 struct intel_engine_cs *engine;
277312 enum intel_engine_id id;
313+ unsigned long flags;
278314
279315 if ((i915->pmu.enable & ENGINE_SAMPLE_MASK) == 0)
280316 return;
@@ -283,53 +319,17 @@ engines_sample(struct intel_gt *gt, unsigned int period_ns) · 2 unmodified lines
283319 return;
284320
285321 for_each_engine(engine, gt, id) {
286− struct intel_engine_pmu *pmu = &engine->pmu;
287− spinlock_t *mmio_lock;
288− unsigned long flags;
289− bool busy;
290− u32 val;
291−
292322 if (!intel_engine_pm_get_if_awake(engine))
293323 continue;
294324
295− mmio_lock = NULL;
296− if (exclusive_mmio_access(i915))
297− mmio_lock = &engine->uncore->lock;
298−
299− if (unlikely(mmio_lock))
300− spin_lock_irqsave(mmio_lock, flags);
301−
302− val = ENGINE_READ_FW(engine, RING_CTL);
303− if (val == 0) /* powerwell off => engine idle */
304− goto skip;
305−
306− if (val & RING_WAIT)
307− add_sample(&pmu->sample[I915_SAMPLE_WAIT], period_ns);
308− if (val & RING_WAIT_SEMAPHORE)
309− add_sample(&pmu->sample[I915_SAMPLE_SEMA], period_ns);
310−
311− /* No need to sample when busy stats are supported. */
312− if (intel_engine_supports_stats(engine))
313− goto skip;
314−
315− /*
316− * While waiting on a semaphore or event, MI_MODE reports the
317− * ring as idle. However, previously using the seqno, and with
318− * execlists sampling, we account for the ring waiting as the
319− * engine being busy. Therefore, we record the sample as being
320− * busy if either waiting or !idle.
321− */
322− busy = val & (RING_WAIT_SEMAPHORE | RING_WAIT);
323− if (!busy) {
324− val = ENGINE_READ_FW(engine, RING_MI_MODE);
325− busy = !(val & MODE_IDLE);
325+ if (exclusive_mmio_access(i915)) {
326+ spin_lock_irqsave(&engine->uncore->lock, flags);
327+ engine_sample(engine, period_ns);
328+ spin_unlock_irqrestore(&engine->uncore->lock, flags);
329+ } else {
330+ engine_sample(engine, period_ns);
326331 }
327− if (busy)
328− add_sample(&pmu->sample[I915_SAMPLE_BUSY], period_ns);
329332
330−skip:
331− if (unlikely(mmio_lock))
332− spin_unlock_irqrestore(mmio_lock, flags);
333333 intel_engine_pm_put_async(engine);
334334 }
335335 }
drivers/gpu/drm/i915/i915_priolist_types.h+1−1
@@ -42,7 +42,7 @@ enum { · 41 unmodified lines
4242 * active request.
4343 */
4444 #define I915_PRIORITY_UNPREEMPTABLE INT_MAX
45−#define I915_PRIORITY_BARRIER INT_MAX
45+#define I915_PRIORITY_BARRIER (I915_PRIORITY_UNPREEMPTABLE - 1)
4646
4747 struct i915_priolist {
4848 struct list_head requests[I915_PRIORITY_COUNT];
drivers/gpu/drm/i915/i915_reg.h+1−1
@@ -7896,7 +7896,7 @@ enum { · 7895 unmodified lines
78967896
78977897 /* GEN7 chicken */
78987898 #define GEN7_COMMON_SLICE_CHICKEN1 _MMIO(0x7010)
7899− #define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1 << 10) | (1 << 26))
7899+ #define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC (1 << 10)
79007900 #define GEN9_RHWO_OPTIMIZATION_DISABLE (1 << 14)
79017901
79027902 #define COMMON_SLICE_CHICKEN2 _MMIO(0x7014)
drivers/gpu/drm/i915/intel_pm.c+2−204
@@ -6830,16 +6830,6 @@ static void ilk_init_clock_gating(struct drm_i915_private *dev_priv) · 6829 unmodified lines
68306830 I915_WRITE(ILK_DISPLAY_CHICKEN2,
68316831 I915_READ(ILK_DISPLAY_CHICKEN2) |
68326832 ILK_ELPIN_409_SELECT);
6833− I915_WRITE(_3D_CHICKEN2,
6834− _3D_CHICKEN2_WM_READ_PIPELINED << 16 |
6835− _3D_CHICKEN2_WM_READ_PIPELINED);
6836−
6837− /* WaDisableRenderCachePipelinedFlush:ilk */
6838− I915_WRITE(CACHE_MODE_0,
6839− _MASKED_BIT_ENABLE(CM0_PIPELINED_RENDER_FLUSH_DISABLE));
6840−
6841− /* WaDisable_RenderCache_OperationalFlush:ilk */
6842− I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
68436833
68446834 g4x_disable_trickle_feed(dev_priv);
68456835
@@ -6902,27 +6892,6 @@ static void gen6_init_clock_gating(struct drm_i915_private *dev_priv) · 56 unmodified lines
69026892 I915_READ(ILK_DISPLAY_CHICKEN2) |
69036893 ILK_ELPIN_409_SELECT);
69046894
6905− /* WaDisableHiZPlanesWhenMSAAEnabled:snb */
6906− I915_WRITE(_3D_CHICKEN,
6907− _MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB));
6908−
6909− /* WaDisable_RenderCache_OperationalFlush:snb */
6910− I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
6911−
6912− /*
6913− * BSpec recoomends 8x4 when MSAA is used,
6914− * however in practice 16x4 seems fastest.
6915− *
6916− * Note that PS/WM thread counts depend on the WIZ hashing
6917− * disable bit, which we don't touch here, but it's good
6918− * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
6919− */
6920− I915_WRITE(GEN6_GT_MODE,
6921− _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4));
6922−
6923− I915_WRITE(CACHE_MODE_0,
6924− _MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
6925−
69266895 I915_WRITE(GEN6_UCGCTL1,
69276896 I915_READ(GEN6_UCGCTL1) |
69286897 GEN6_BLBUNIT_CLOCK_GATE_DISABLE |
@@ -6945,18 +6914,6 @@ static void gen6_init_clock_gating(struct drm_i915_private *dev_priv) · 16 unmodified lines
69456914 GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
69466915 GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
69476916
6948− /* WaStripsFansDisableFastClipPerformanceFix:snb */
6949− I915_WRITE(_3D_CHICKEN3,
6950− _MASKED_BIT_ENABLE(_3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL));
6951−
6952− /*
6953− * Bspec says:
6954− * "This bit must be set if 3DSTATE_CLIP clip mode is set to normal and
6955− * 3DSTATE_SF number of SF output attributes is more than 16."
6956− */
6957− I915_WRITE(_3D_CHICKEN3,
6958− _MASKED_BIT_ENABLE(_3D_CHICKEN3_SF_DISABLE_PIPELINED_ATTR_FETCH));
6959−
69606917 /*
69616918 * According to the spec the following bits should be
69626919 * set in order to enable memory self-refresh and fbc:
@@ -6986,24 +6943,6 @@ static void gen6_init_clock_gating(struct drm_i915_private *dev_priv) · 23 unmodified lines
69866943 gen6_check_mch_setup(dev_priv);
69876944 }
69886945
6989−static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
6990−{
6991− u32 reg = I915_READ(GEN7_FF_THREAD_MODE);
6992−
6993− /*
6994− * WaVSThreadDispatchOverride:ivb,vlv
6995− *
6996− * This actually overrides the dispatch
6997− * mode for all thread types.
6998− */
6999− reg &= ~GEN7_FF_SCHED_MASK;
7000− reg |= GEN7_FF_TS_SCHED_HW;
7001− reg |= GEN7_FF_VS_SCHED_HW;
7002− reg |= GEN7_FF_DS_SCHED_HW;
7003−
7004− I915_WRITE(GEN7_FF_THREAD_MODE, reg);
7005−}
7006−
70076946 static void lpt_init_clock_gating(struct drm_i915_private *dev_priv)
70086947 {
70096948 /*
@@ -7230,45 +7169,10 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 220 unmodified lines
72307169
72317170 static void hsw_init_clock_gating(struct drm_i915_private *dev_priv)
72327171 {
7233− /* L3 caching of data atomics doesn't work -- disable it. */
7234− I915_WRITE(HSW_SCRATCH1, HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE);
7235− I915_WRITE(HSW_ROW_CHICKEN3,
7236− _MASKED_BIT_ENABLE(HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE));
7237−
72387172 /* This is required by WaCatErrorRejectionIssue:hsw */
72397173 I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
7240− I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
7241− GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
7242−
7243− /* WaVSRefCountFullforceMissDisable:hsw */
7244− I915_WRITE(GEN7_FF_THREAD_MODE,
7245− I915_READ(GEN7_FF_THREAD_MODE) & ~GEN7_FF_VS_REF_CNT_FFME);
7246−
7247− /* WaDisable_RenderCache_OperationalFlush:hsw */
7248− I915_WRITE(CACHE_MODE_0_GEN7, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
7249−
7250− /* enable HiZ Raw Stall Optimization */
7251− I915_WRITE(CACHE_MODE_0_GEN7,
7252− _MASKED_BIT_DISABLE(HIZ_RAW_STALL_OPT_DISABLE));
7253−
7254− /* WaDisable4x2SubspanOptimization:hsw */
7255− I915_WRITE(CACHE_MODE_1,
7256− _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));
7257−
7258− /*
7259− * BSpec recommends 8x4 when MSAA is used,
7260− * however in practice 16x4 seems fastest.
7261− *
7262− * Note that PS/WM thread counts depend on the WIZ hashing
7263− * disable bit, which we don't touch here, but it's good
7264− * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
7265− */
7266− I915_WRITE(GEN7_GT_MODE,
7267− _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4));
7268−
7269− /* WaSampleCChickenBitEnable:hsw */
7270− I915_WRITE(HALF_SLICE_CHICKEN3,
7271− _MASKED_BIT_ENABLE(HSW_SAMPLE_C_PERFORMANCE));
7174+ I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
7175+ GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
72727176
72737177 /* WaSwitchSolVfFArbitrationPriority:hsw */
72747178 I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
@@ -7282,32 +7186,11 @@ static void ivb_init_clock_gating(struct drm_i915_private *dev_priv) · 7 unmodified lines
72827186
72837187 I915_WRITE(ILK_DSPCLK_GATE_D, ILK_VRHUNIT_CLOCK_GATE_DISABLE);
72847188
7285− /* WaDisableEarlyCull:ivb */
7286− I915_WRITE(_3D_CHICKEN3,
7287− _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_DISABLE_OBJEND_CULL));
7288−
72897189 /* WaDisableBackToBackFlipFix:ivb */
72907190 I915_WRITE(IVB_CHICKEN3,
72917191 CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
72927192 CHICKEN3_DGMG_DONE_FIX_DISABLE);
72937193
7294− /* WaDisablePSDDualDispatchEnable:ivb */
7295− if (IS_IVB_GT1(dev_priv))
7296− I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
7297− _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
7298−
7299− /* WaDisable_RenderCache_OperationalFlush:ivb */
7300− I915_WRITE(CACHE_MODE_0_GEN7, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
7301−
7302− /* Apply the WaDisableRHWOOptimizationForRenderHang:ivb workaround. */
7303− I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
7304− GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
7305−
7306− /* WaApplyL3ControlAndL3ChickenMode:ivb */
7307− I915_WRITE(GEN7_L3CNTLREG1,
7308− GEN7_WA_FOR_GEN7_L3_CONTROL);
7309− I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
7310− GEN7_WA_L3_CHICKEN_MODE);
73117194 if (IS_IVB_GT1(dev_priv))
73127195 I915_WRITE(GEN7_ROW_CHICKEN2,
73137196 _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
@@ -7319,10 +7202,6 @@ static void ivb_init_clock_gating(struct drm_i915_private *dev_priv) · 5 unmodified lines
73197202 _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
73207203 }
73217204
7322− /* WaForceL3Serialization:ivb */
7323− I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
7324− ~L3SQ_URB_READ_CAM_MATCH_DISABLE);
7325−
73267205 /*
73277206 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
73287207 * This implements the WaDisableRCZUnitClockGating:ivb workaround.
@@ -7337,29 +7216,6 @@ static void ivb_init_clock_gating(struct drm_i915_private *dev_priv) · 8 unmodified lines
73377216
73387217 g4x_disable_trickle_feed(dev_priv);
73397218
7340− gen7_setup_fixed_func_scheduler(dev_priv);
7341−
7342− if (0) { /* causes HiZ corruption on ivb:gt1 */
7343− /* enable HiZ Raw Stall Optimization */
7344− I915_WRITE(CACHE_MODE_0_GEN7,
7345− _MASKED_BIT_DISABLE(HIZ_RAW_STALL_OPT_DISABLE));
7346− }
7347−
7348− /* WaDisable4x2SubspanOptimization:ivb */
7349− I915_WRITE(CACHE_MODE_1,
7350− _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));
7351−
7352− /*
7353− * BSpec recommends 8x4 when MSAA is used,
7354− * however in practice 16x4 seems fastest.
7355− *
7356− * Note that PS/WM thread counts depend on the WIZ hashing
7357− * disable bit, which we don't touch here, but it's good
7358− * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
7359− */
7360− I915_WRITE(GEN7_GT_MODE,
7361− _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4));
7362−
73637219 snpcr = I915_READ(GEN6_MBCUNIT_SNPCR);
73647220 snpcr &= ~GEN6_MBC_SNPCR_MASK;
73657221 snpcr |= GEN6_MBC_SNPCR_MED;
@@ -7373,28 +7229,11 @@ static void ivb_init_clock_gating(struct drm_i915_private *dev_priv) · 7 unmodified lines
73737229
73747230 static void vlv_init_clock_gating(struct drm_i915_private *dev_priv)
73757231 {
7376− /* WaDisableEarlyCull:vlv */
7377− I915_WRITE(_3D_CHICKEN3,
7378− _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_DISABLE_OBJEND_CULL));
7379−
73807232 /* WaDisableBackToBackFlipFix:vlv */
73817233 I915_WRITE(IVB_CHICKEN3,
73827234 CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
73837235 CHICKEN3_DGMG_DONE_FIX_DISABLE);
73847236
7385− /* WaPsdDispatchEnable:vlv */
7386− /* WaDisablePSDDualDispatchEnable:vlv */
7387− I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
7388− _MASKED_BIT_ENABLE(GEN7_MAX_PS_THREAD_DEP |
7389− GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
7390−
7391− /* WaDisable_RenderCache_OperationalFlush:vlv */
7392− I915_WRITE(CACHE_MODE_0_GEN7, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
7393−
7394− /* WaForceL3Serialization:vlv */
7395− I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
7396− ~L3SQ_URB_READ_CAM_MATCH_DISABLE);
7397−
73987237 /* WaDisableDopClockGating:vlv */
73997238 I915_WRITE(GEN7_ROW_CHICKEN2,
74007239 _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
@@ -7404,8 +7243,6 @@ static void vlv_init_clock_gating(struct drm_i915_private *dev_priv) · 3 unmodified lines
74047243 I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
74057244 GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
74067245
7407− gen7_setup_fixed_func_scheduler(dev_priv);
7408−
74097246 /*
74107247 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
74117248 * This implements the WaDisableRCZUnitClockGating:vlv workaround.
@@ -7419,30 +7256,6 @@ static void vlv_init_clock_gating(struct drm_i915_private *dev_priv) · 7 unmodified lines
74197256 I915_WRITE(GEN7_UCGCTL4,
74207257 I915_READ(GEN7_UCGCTL4) | GEN7_L3BANK2X_CLOCK_GATE_DISABLE);
74217258
7422− /*
7423− * BSpec says this must be set, even though
7424− * WaDisable4x2SubspanOptimization isn't listed for VLV.
7425− */
7426− I915_WRITE(CACHE_MODE_1,
7427− _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));
7428−
7429− /*
7430− * BSpec recommends 8x4 when MSAA is used,
7431− * however in practice 16x4 seems fastest.
7432− *
7433− * Note that PS/WM thread counts depend on the WIZ hashing
7434− * disable bit, which we don't touch here, but it's good
7435− * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
7436− */
7437− I915_WRITE(GEN7_GT_MODE,
7438− _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4));
7439−
7440− /*
7441− * WaIncreaseL3CreditsForVLVB0:vlv
7442− * This is the hardware default actually.
7443− */
7444− I915_WRITE(GEN7_L3SQCREG1, VLV_B0_WA_L3SQCREG1_VALUE);
7445−
74467259 /*
74477260 * WaDisableVLVClockGating_VBIIssue:vlv
74487261 * Disable clock gating on th GCFG unit to prevent a delay
@@ -7495,13 +7308,6 @@ static void g4x_init_clock_gating(struct drm_i915_private *dev_priv) · 46 unmodified lines
74957308 dspclk_gate |= DSSUNIT_CLOCK_GATE_DISABLE;
74967309 I915_WRITE(DSPCLK_GATE_D, dspclk_gate);
74977310
7498− /* WaDisableRenderCachePipelinedFlush */
7499− I915_WRITE(CACHE_MODE_0,
7500− _MASKED_BIT_ENABLE(CM0_PIPELINED_RENDER_FLUSH_DISABLE));
7501−
7502− /* WaDisable_RenderCache_OperationalFlush:g4x */
7503− I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
7504−
75057311 g4x_disable_trickle_feed(dev_priv);
75067312 }
75077313
@@ -7517,11 +7323,6 @@ static void i965gm_init_clock_gating(struct drm_i915_private *dev_priv) · 9 unmodified lines
75177323 intel_uncore_write(uncore,
75187324 MI_ARB_STATE,
75197325 _MASKED_BIT_ENABLE(MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE));
7520−
7521− /* WaDisable_RenderCache_OperationalFlush:gen4 */
7522− intel_uncore_write(uncore,
7523− CACHE_MODE_0,
7524− _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
75257326 }
75267327
75277328 static void i965g_init_clock_gating(struct drm_i915_private *dev_priv)
@@ -7534,9 +7335,6 @@ static void i965g_init_clock_gating(struct drm_i915_private *dev_priv) · 6 unmodified lines
75347335 I915_WRITE(RENCLK_GATE_D2, 0);
75357336 I915_WRITE(MI_ARB_STATE,
75367337 _MASKED_BIT_ENABLE(MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE));
7537−
7538− /* WaDisable_RenderCache_OperationalFlush:gen4 */
7539− I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
75407338 }
75417339
75427340 static void gen3_init_clock_gating(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h+1−0
@@ -21,6 +21,7 @@ selftest(fence, i915_sw_fence_mock_selftests) · 20 unmodified lines
2121 selftest(scatterlist, scatterlist_mock_selftests)
2222 selftest(syncmap, i915_syncmap_mock_selftests)
2323 selftest(uncore, intel_uncore_mock_selftests)
24+selftest(ring, intel_ring_mock_selftests)
2425 selftest(engine, intel_engine_cs_mock_selftests)
2526 selftest(timelines, intel_timeline_mock_selftests)
2627 selftest(requests, i915_request_mock_selftests)
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/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/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/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/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/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/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/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/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/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/hwtracing/stm/policy.c+1−1
@@ -34,7 +34,7 @@ struct stp_policy_node { · 33 unmodified lines
3434 unsigned int first_channel;
3535 unsigned int last_channel;
3636 /* this is the one that's exposed to the attributes */
37− unsigned char priv[0];
37+ unsigned char priv[];
3838 };
3939
4040 void *stp_policy_node_priv(struct stp_policy_node *pn)
drivers/hwtracing/stm/stm.h+2−2
@@ -23,7 +23,7 @@ void *stp_policy_node_priv(struct stp_policy_node *pn); · 22 unmodified lines
2323
2424 struct stp_master {
2525 unsigned int nr_free;
26− unsigned long chan_map[0];
26+ unsigned long chan_map[];
2727 };
2828
2929 struct stm_device {
@@ -42,7 +42,7 @@ struct stm_device { · 12 unmodified lines
4242 const struct config_item_type *pdrv_node_type;
4343 /* master allocation */
4444 spinlock_t mc_lock;
45− struct stp_master *masters[0];
45+ struct stp_master *masters[];
4646 };
4747
4848 #define to_stm_device(_d) \
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-base.c+0−25
@@ -815,31 +815,6 @@ out_err_silent: · 814 unmodified lines
815815 }
816816 EXPORT_SYMBOL_GPL(i2c_new_client_device);
817817
818−/**
819− * i2c_new_device - instantiate an i2c device
820− * @adap: the adapter managing the device
821− * @info: describes one I2C device; bus_num is ignored
822− * Context: can sleep
823− *
824− * This deprecated function has the same functionality as
825− * @i2c_new_client_device, it just returns NULL instead of an ERR_PTR in case of
826− * an error for compatibility with current I2C API. It will be removed once all
827− * users are converted.
828− *
829− * This returns the new i2c client, which may be saved for later use with
830− * i2c_unregister_device(); or NULL to indicate an error.
831− */
832−struct i2c_client *
833−i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
834−{
835− struct i2c_client *ret;
836−
837− ret = i2c_new_client_device(adap, info);
838− return IS_ERR(ret) ? NULL : ret;
839−}
840−EXPORT_SYMBOL_GPL(i2c_new_device);
841−
842−
843818 /**
844819 * i2c_unregister_device - reverse effect of i2c_new_*_device()
845820 * @client: value returned from i2c_new_*_device()
drivers/i2c/i2c-core-smbus.c+8−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * This file contains the SMBus functions which are always included in the I2C
66 * core because they can be emulated via I2C. SMBus specific extensions
7− * (e.g. smbalert) are handled in a seperate i2c-smbus module.
7+ * (e.g. smbalert) are handled in a separate i2c-smbus module.
88 *
99 * All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>
1010 * SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> and
@@ -495,6 +495,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 484 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/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/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/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/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/qp.c+25−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,9 @@ 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,
2672+ IB_QP_CREATE_INTEGRITY_EN,
2673+ MLX5_CAP_GEN(mdev, sho), qp);
26712674 process_create_flag(dev, &create_flags,
26722675 IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK,
26732676 MLX5_CAP_GEN(mdev, block_lb_mc), qp);
@@ -2873,7 +2876,6 @@ static int mlx5_ib_destroy_dct(struct mlx5_ib_qp *mqp) · 199 unmodified lines
28732876 static int check_ucmd_data(struct mlx5_ib_dev *dev,
28742877 struct mlx5_create_qp_params *params)
28752878 {
2876− struct ib_qp_init_attr *attr = params->attr;
28772879 struct ib_udata *udata = params->udata;
28782880 size_t size, last;
28792881 int ret;
@@ -2885,14 +2887,7 @@ static int check_ucmd_data(struct mlx5_ib_dev *dev, · 5 unmodified lines
28852887 */
28862888 last = sizeof(struct mlx5_ib_create_qp_rss);
28872889 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− }
2890+ last = offsetof(struct mlx5_ib_create_qp, reserved);
28962891
28972892 if (udata->inlen <= last)
28982893 return 0;
@@ -2907,7 +2902,7 @@ static int check_ucmd_data(struct mlx5_ib_dev *dev, · 8 unmodified lines
29072902 if (!ret)
29082903 mlx5_ib_dbg(
29092904 dev,
2910− "udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lu\n",
2905+ "udata is not cleared, inlen = %zu, ucmd = %zu, last = %zu, size = %zu\n",
29112906 udata->inlen, params->ucmd_size, last, size);
29122907 return ret ? 0 : -EINVAL;
29132908 }
@@ -3002,10 +2997,18 @@ struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attr, · 88 unmodified lines
30022997 return &qp->ibqp;
30032998
30042999 destroy_qp:
3005− if (qp->type == MLX5_IB_QPT_DCT)
3000+ if (qp->type == MLX5_IB_QPT_DCT) {
30063001 mlx5_ib_destroy_dct(qp);
3007− else
3002+ } else {
3003+ /*
3004+ * The two lines below are temp solution till QP allocation
3005+ * will be moved to be under IB/core responsiblity.
3006+ */
3007+ qp->ibqp.send_cq = attr->send_cq;
3008+ qp->ibqp.recv_cq = attr->recv_cq;
30083009 destroy_qp_common(dev, qp, udata);
3010+ }
3011+
30093012 qp = NULL;
30103013 free_qp:
30113014 kfree(qp);
@@ -4162,8 +4165,6 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr, · 1150 unmodified lines
41624165
41634166 if (udata->outlen < min_resp_len)
41644167 return -EINVAL;
4165− resp.response_length = min_resp_len;
4166−
41674168 /*
41684169 * If we don't have enough space for the ECE options,
41694170 * simply indicate it with resp.response_length.
@@ -4384,8 +4385,7 @@ static void to_rdma_ah_attr(struct mlx5_ib_dev *ibdev, · 214 unmodified lines
43844385 MLX5_GET(ads, path, src_addr_index),
43854386 MLX5_GET(ads, path, hop_limit),
43864387 MLX5_GET(ads, path, tclass));
4387− memcpy(ah_attr, MLX5_ADDR_OF(ads, path, rgid_rip),
4388− MLX5_FLD_SZ_BYTES(ads, rgid_rip));
4388+ rdma_ah_set_dgid_raw(ah_attr, MLX5_ADDR_OF(ads, path, rgid_rip));
43894389 }
43904390 }
43914391
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_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/serio/hp_sdc.c+1−1
@@ -1021,7 +1021,7 @@ static int __init hp_sdc_register(void) · 1020 unmodified lines
10211021 hp_sdc.base_io = (unsigned long) 0xf0428000;
10221022 hp_sdc.data_io = (unsigned long) hp_sdc.base_io + 1;
10231023 hp_sdc.status_io = (unsigned long) hp_sdc.base_io + 3;
1024− if (!probe_kernel_read(&i, (unsigned char *)hp_sdc.data_io, 1))
1024+ if (!copy_from_kernel_nofault(&i, (unsigned char *)hp_sdc.data_io, 1))
10251025 hp_sdc.dev = (void *)1;
10261026 hp_sdc.dev_err = hp_sdc_init();
10271027 #endif
drivers/iommu/Kconfig+1−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
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/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+4−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)
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/bcache/btree.c+6−2
@@ -1389,7 +1389,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, · 1388 unmodified lines
13891389 if (__set_blocks(n1, n1->keys + n2->keys,
13901390 block_bytes(b->c)) >
13911391 btree_blocks(new_nodes[i]))
1392− goto out_nocoalesce;
1392+ goto out_unlock_nocoalesce;
13931393
13941394 keys = n2->keys;
13951395 /* Take the key of the node we're getting rid of */
@@ -1418,7 +1418,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, · 22 unmodified lines
14181418
14191419 if (__bch_keylist_realloc(&keylist,
14201420 bkey_u64s(&new_nodes[i]->key)))
1421− goto out_nocoalesce;
1421+ goto out_unlock_nocoalesce;
14221422
14231423 bch_btree_node_write(new_nodes[i], &cl);
14241424 bch_keylist_add(&keylist, &new_nodes[i]->key);
@@ -1464,6 +1464,10 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, · 39 unmodified lines
14641464 /* Invalidated our iterator */
14651465 return -EINTR;
14661466
1467+out_unlock_nocoalesce:
1468+ for (i = 0; i < nodes; i++)
1469+ mutex_unlock(&new_nodes[i]->write_lock);
1470+
14671471 out_nocoalesce:
14681472 closure_sync(&cl);
14691473
drivers/md/bcache/super.c+26−9
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/genhd.h>
2020 #include <linux/idr.h>
2121 #include <linux/kthread.h>
22+#include <linux/workqueue.h>
2223 #include <linux/module.h>
2324 #include <linux/random.h>
2425 #include <linux/reboot.h>
@@ -819,7 +820,8 @@ static void bcache_device_free(struct bcache_device *d) · 794 unmodified lines
819820 }
820821
821822 static int bcache_device_init(struct bcache_device *d, unsigned int block_size,
822− sector_t sectors, make_request_fn make_request_fn)
823+ sector_t sectors, make_request_fn make_request_fn,
824+ struct block_device *cached_bdev)
823825 {
824826 struct request_queue *q;
825827 const size_t max_stripes = min_t(size_t, INT_MAX,
@@ -885,6 +887,20 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, · 59 unmodified lines
885887 q->limits.io_min = block_size;
886888 q->limits.logical_block_size = block_size;
887889 q->limits.physical_block_size = block_size;
890+
891+ if (q->limits.logical_block_size > PAGE_SIZE && cached_bdev) {
892+ /*
893+ * This should only happen with BCACHE_SB_VERSION_BDEV.
894+ * Block/page size is checked for BCACHE_SB_VERSION_CDEV.
895+ */
896+ pr_info("%s: sb/logical block size (%u) greater than page size (%lu) falling back to device logical block size (%u)\n",
897+ d->disk->disk_name, q->limits.logical_block_size,
898+ PAGE_SIZE, bdev_logical_block_size(cached_bdev));
899+
900+ /* This also adjusts physical block size/min io size if needed */
901+ blk_queue_logical_block_size(q, bdev_logical_block_size(cached_bdev));
902+ }
903+
888904 blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue);
889905 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue);
890906 blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue);
@@ -1340,7 +1356,7 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size) · 449 unmodified lines
13401356
13411357 ret = bcache_device_init(&dc->disk, block_size,
13421358 dc->bdev->bd_part->nr_sects - dc->sb.data_offset,
1343− cached_dev_make_request);
1359+ cached_dev_make_request, dc->bdev);
13441360 if (ret)
13451361 return ret;
13461362
@@ -1453,7 +1469,7 @@ static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) · 106 unmodified lines
14531469 kobject_init(&d->kobj, &bch_flash_dev_ktype);
14541470
14551471 if (bcache_device_init(d, block_bytes(c), u->sectors,
1456− flash_dev_make_request))
1472+ flash_dev_make_request, NULL))
14571473 goto err;
14581474
14591475 bcache_device_attach(d, c, u - c->uuids);
@@ -2364,7 +2380,7 @@ static bool bch_is_open(struct block_device *bdev) · 904 unmodified lines
23642380 }
23652381
23662382 struct async_reg_args {
2367− struct work_struct reg_work;
2383+ struct delayed_work reg_work;
23682384 char *path;
23692385 struct cache_sb *sb;
23702386 struct cache_sb_disk *sb_disk;
@@ -2375,7 +2391,7 @@ static void register_bdev_worker(struct work_struct *work) · 4 unmodified lines
23752391 {
23762392 int fail = false;
23772393 struct async_reg_args *args =
2378− container_of(work, struct async_reg_args, reg_work);
2394+ container_of(work, struct async_reg_args, reg_work.work);
23792395 struct cached_dev *dc;
23802396
23812397 dc = kzalloc(sizeof(*dc), GFP_KERNEL);
@@ -2405,7 +2421,7 @@ static void register_cache_worker(struct work_struct *work) · 23 unmodified lines
24052421 {
24062422 int fail = false;
24072423 struct async_reg_args *args =
2408− container_of(work, struct async_reg_args, reg_work);
2424+ container_of(work, struct async_reg_args, reg_work.work);
24092425 struct cache *ca;
24102426
24112427 ca = kzalloc(sizeof(*ca), GFP_KERNEL);
@@ -2433,11 +2449,12 @@ out: · 21 unmodified lines
24332449 static void register_device_aync(struct async_reg_args *args)
24342450 {
24352451 if (SB_IS_BDEV(args->sb))
2436− INIT_WORK(&args->reg_work, register_bdev_worker);
2452+ INIT_DELAYED_WORK(&args->reg_work, register_bdev_worker);
24372453 else
2438− INIT_WORK(&args->reg_work, register_cache_worker);
2454+ INIT_DELAYED_WORK(&args->reg_work, register_cache_worker);
24392455
2440− queue_work(system_wq, &args->reg_work);
2456+ /* 10 jiffies is enough for a delay */
2457+ queue_delayed_work(system_wq, &args->reg_work, 10);
24412458 }
24422459
24432460 static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
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-writecache.c+8−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
drivers/md/dm-zoned-metadata.c+31−11
@@ -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
drivers/md/dm-zoned-reclaim.c+1−3
@@ -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:
drivers/md/dm-zoned-target.c+1−1
@@ -890,7 +890,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 889 unmodified lines
890890 }
891891
892892 /* Set target (no write same support) */
893− ti->max_io_len = dmz_zone_nr_sectors(dmz->metadata) << 9;
893+ ti->max_io_len = dmz_zone_nr_sectors(dmz->metadata);
894894 ti->num_flush_bios = 1;
895895 ti->num_discard_bios = 1;
896896 ti->num_write_zeroes_bios = 1;
drivers/md/dm.c+13−0
@@ -1009,6 +1009,7 @@ static void clone_endio(struct bio *bio) · 1008 unmodified lines
10091009 struct dm_io *io = tio->io;
10101010 struct mapped_device *md = tio->io->md;
10111011 dm_endio_fn endio = tio->ti->type->end_io;
1012+ struct bio *orig_bio = io->orig_bio;
10121013
10131014 if (unlikely(error == BLK_STS_TARGET) && md->type != DM_TYPE_NVME_BIO_BASED) {
10141015 if (bio_op(bio) == REQ_OP_DISCARD &&
@@ -1022,6 +1023,18 @@ static void clone_endio(struct bio *bio) · 7 unmodified lines
10221023 disable_write_zeroes(md);
10231024 }
10241025
1026+ /*
1027+ * For zone-append bios get offset in zone of the written
1028+ * sector and add that to the original bio sector pos.
1029+ */
1030+ if (bio_op(orig_bio) == REQ_OP_ZONE_APPEND) {
1031+ sector_t written_sector = bio->bi_iter.bi_sector;
1032+ struct request_queue *q = orig_bio->bi_disk->queue;
1033+ u64 mask = (u64)blk_queue_zone_sectors(q) - 1;
1034+
1035+ orig_bio->bi_iter.bi_sector += written_sector & mask;
1036+ }
1037+
10251038 if (endio) {
10261039 int r = endio(tio->ti, bio, &error);
10271040 switch (r) {
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/media/usb/pwc/pwc.h+1−1
@@ -193,7 +193,7 @@ struct pwc_raw_frame { · 192 unmodified lines
193193 decompressor) */
194194 __u8 cmd[4]; /* the four byte of the command (in case of
195195 nala, only the first 3 bytes is filled) */
196− __u8 rawframe[0]; /* frame_size = H / 4 * vbandlength */
196+ __u8 rawframe[]; /* frame_size = H / 4 * vbandlength */
197197 } __packed;
198198
199199 /* intermediate buffers with raw data from the USB cam */
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/mt6360-core.c+1−0
@@ -412,6 +412,7 @@ MODULE_DEVICE_TABLE(of, mt6360_pmu_of_id); · 411 unmodified lines
412412
413413 static struct i2c_driver mt6360_pmu_driver = {
414414 .driver = {
415+ .name = "mt6360_pmu",
415416 .pm = &mt6360_pmu_pm_ops,
416417 .of_match_table = of_match_ptr(mt6360_pmu_of_id),
417418 },
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/kgdbts.c+3−3
@@ -828,7 +828,7 @@ static void run_plant_and_detach_test(int is_early) · 827 unmodified lines
828828 char before[BREAK_INSTR_SIZE];
829829 char after[BREAK_INSTR_SIZE];
830830
831− probe_kernel_read(before, (char *)kgdbts_break_test,
831+ copy_from_kernel_nofault(before, (char *)kgdbts_break_test,
832832 BREAK_INSTR_SIZE);
833833 init_simple_test();
834834 ts.tst = plant_and_detach_test;
@@ -836,8 +836,8 @@ static void run_plant_and_detach_test(int is_early) · 1 unmodified line
836836 /* Activate test with initial breakpoint */
837837 if (!is_early)
838838 kgdb_breakpoint();
839− probe_kernel_read(after, (char *)kgdbts_break_test,
840− BREAK_INSTR_SIZE);
839+ copy_from_kernel_nofault(after, (char *)kgdbts_break_test,
840+ BREAK_INSTR_SIZE);
841841 if (memcmp(before, after, BREAK_INSTR_SIZE)) {
842842 printk(KERN_CRIT "kgdbts: ERROR kgdb corrupted memory\n");
843843 panic("kgdb memory corruption");
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/net/bareudp.c+5−0
@@ -552,6 +552,8 @@ static int bareudp_validate(struct nlattr *tb[], struct nlattr *data[], · 551 unmodified lines
552552 static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf,
553553 struct netlink_ext_ack *extack)
554554 {
555+ memset(conf, 0, sizeof(*conf));
556+
555557 if (!data[IFLA_BAREUDP_PORT]) {
556558 NL_SET_ERR_MSG(extack, "port not specified");
557559 return -EINVAL;
@@ -570,6 +572,9 @@ static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf, · 12 unmodified lines
570572 if (data[IFLA_BAREUDP_SRCPORT_MIN])
571573 conf->sport_min = nla_get_u16(data[IFLA_BAREUDP_SRCPORT_MIN]);
572574
575+ if (data[IFLA_BAREUDP_MULTIPROTO_MODE])
576+ conf->multi_proto_mode = true;
577+
573578 return 0;
574579 }
575580
drivers/net/can/peak_canfd/peak_pciefd_main.c+2−2
@@ -146,7 +146,7 @@ struct pciefd_rx_dma { · 145 unmodified lines
146146 __le32 irq_status;
147147 __le32 sys_time_low;
148148 __le32 sys_time_high;
149− struct pucan_rx_msg msg[0];
149+ struct pucan_rx_msg msg[];
150150 } __packed __aligned(4);
151151
152152 /* Tx Link record */
@@ -194,7 +194,7 @@ struct pciefd_board { · 41 unmodified lines
194194 struct pci_dev *pci_dev;
195195 int can_count;
196196 spinlock_t cmd_lock; /* 64-bits cmds must be atomic */
197− struct pciefd_can *can[0]; /* array of network devices */
197+ struct pciefd_can *can[]; /* array of network devices */
198198 };
199199
200200 /* supported device ids. */
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/sja1105/sja1105_ptp.c+4−4
@@ -891,16 +891,16 @@ void sja1105_ptp_txtstamp_skb(struct dsa_switch *ds, int port, · 890 unmodified lines
891891
892892 mutex_lock(&ptp_data->lock);
893893
894− rc = sja1105_ptpclkval_read(priv, &ticks, NULL);
894+ rc = sja1105_ptpegr_ts_poll(ds, port, &ts);
895895 if (rc < 0) {
896− dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc);
896+ dev_err(ds->dev, "timed out polling for tstamp\n");
897897 kfree_skb(skb);
898898 goto out;
899899 }
900900
901− rc = sja1105_ptpegr_ts_poll(ds, port, &ts);
901+ rc = sja1105_ptpclkval_read(priv, &ticks, NULL);
902902 if (rc < 0) {
903− dev_err(ds->dev, "timed out polling for tstamp\n");
903+ dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc);
904904 kfree_skb(skb);
905905 goto out;
906906 }
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/atheros/alx/main.c+5−4
@@ -1249,8 +1249,12 @@ out_disable_adv_intr: · 1248 unmodified lines
12491249
12501250 static void __alx_stop(struct alx_priv *alx)
12511251 {
1252− alx_halt(alx);
12531252 alx_free_irq(alx);
1253+
1254+ cancel_work_sync(&alx->link_check_wk);
1255+ cancel_work_sync(&alx->reset_wk);
1256+
1257+ alx_halt(alx);
12541258 alx_free_rings(alx);
12551259 alx_free_napis(alx);
12561260 }
@@ -1855,9 +1859,6 @@ static void alx_remove(struct pci_dev *pdev) · 598 unmodified lines
18551859 struct alx_priv *alx = pci_get_drvdata(pdev);
18561860 struct alx_hw *hw = &alx->hw;
18571861
1858− cancel_work_sync(&alx->link_check_wk);
1859− cancel_work_sync(&alx->reset_wk);
1860−
18611862 /* restore permanent mac address */
18621863 alx_set_macaddr(hw, hw->perm_addr);
18631864
drivers/net/ethernet/broadcom/bnxt/bnxt.c+46−25
@@ -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);
@@ -10037,7 +10058,7 @@ static void bnxt_timer(struct timer_list *t) · 2755 unmodified lines
1003710058 struct bnxt *bp = from_timer(bp, t, timer);
1003810059 struct net_device *dev = bp->dev;
1003910060
10040− if (!netif_running(dev))
10061+ if (!netif_running(dev) || !test_bit(BNXT_STATE_OPEN, &bp->state))
1004110062 return;
1004210063
1004310064 if (atomic_read(&bp->intr_sem) != 0)
@@ -11892,7 +11913,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1848 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)
@@ -12133,19 +12155,9 @@ static int bnxt_resume(struct device *device) · 234 unmodified lines
1213312155 goto resume_exit;
1213412156 }
1213512157
12136− if (bnxt_hwrm_queue_qportcfg(bp)) {
12137− rc = -ENODEV;
12158+ rc = bnxt_hwrm_func_qcaps(bp);
12159+ if (rc)
1213812160 goto resume_exit;
12139− }
12140−
12141− if (bp->hwrm_spec_code >= 0x10803) {
12142− if (bnxt_alloc_ctx_mem(bp)) {
12143− rc = -ENODEV;
12144− goto resume_exit;
12145− }
12146− }
12147− if (BNXT_NEW_RM(bp))
12148− bnxt_hwrm_func_resc_qcaps(bp, false);
1214912161
1215012162 if (bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, false)) {
1215112163 rc = -ENODEV;
@@ -12161,6 +12173,8 @@ static int bnxt_resume(struct device *device) · 9 unmodified lines
1216112173
1216212174 resume_exit:
1216312175 bnxt_ulp_start(bp, rc);
12176+ if (!rc)
12177+ bnxt_reenable_sriov(bp);
1216412178 rtnl_unlock();
1216512179 return rc;
1216612180 }
@@ -12204,6 +12218,9 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, · 37 unmodified lines
1220412218 bnxt_close(netdev);
1220512219
1220612220 pci_disable_device(pdev);
12221+ bnxt_free_ctx_mem(bp);
12222+ kfree(bp->ctx);
12223+ bp->ctx = NULL;
1220712224 rtnl_unlock();
1220812225
1220912226 /* Request a slot slot reset. */
@@ -12237,12 +12254,16 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) · 27 unmodified lines
1223712254 pci_set_master(pdev);
1223812255
1223912256 err = bnxt_hwrm_func_reset(bp);
12240− if (!err && netif_running(netdev))
12241− err = bnxt_open(netdev);
12242−
12243− if (!err)
12244− result = PCI_ERS_RESULT_RECOVERED;
12257+ if (!err) {
12258+ err = bnxt_hwrm_func_qcaps(bp);
12259+ if (!err && netif_running(netdev))
12260+ err = bnxt_open(netdev);
12261+ }
1224512262 bnxt_ulp_start(bp, err);
12263+ if (!err) {
12264+ bnxt_reenable_sriov(bp);
12265+ result = PCI_ERS_RESULT_RECOVERED;
12266+ }
1224612267 }
1224712268
1224812269 if (result != PCI_ERS_RESULT_RECOVERED) {
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_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+86−51
@@ -2558,22 +2558,23 @@ 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
25652565 if (bp->ptp_info)
25662566 bp->ptp_info->ptp_init(dev);
25672567
2568−napi_exit:
2568+ return 0;
2569+
2570+reset_hw:
2571+ macb_reset_hw(bp);
25692572 for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
25702573 napi_disable(&queue->napi);
2574+ macb_free_consistent(bp);
25712575 pm_exit:
2572− if (err) {
2573− pm_runtime_put_sync(&bp->pdev->dev);
2574− return err;
2575− }
2576− return 0;
2576+ pm_runtime_put_sync(&bp->pdev->dev);
2577+ return err;
25772578 }
25782579
25792580 static int macb_close(struct net_device *dev)
@@ -3761,15 +3762,9 @@ static int macb_init(struct platform_device *pdev) · 1181 unmodified lines
37613762
37623763 static struct sifive_fu540_macb_mgmt *mgmt;
37633764
3764−/* Initialize and start the Receiver and Transmit subsystems */
3765−static int at91ether_start(struct net_device *dev)
3765+static int at91ether_alloc_coherent(struct macb *lp)
37663766 {
3767− struct macb *lp = netdev_priv(dev);
37683767 struct macb_queue *q = &lp->queues[0];
3769− struct macb_dma_desc *desc;
3770− dma_addr_t addr;
3771− u32 ctl;
3772− int i;
37733768
37743769 q->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
37753770 (AT91ETHER_MAX_RX_DESCR *
@@ -3791,6 +3786,43 @@ static int at91ether_start(struct net_device *dev) · 15 unmodified lines
37913786 return -ENOMEM;
37923787 }
37933788
3789+ return 0;
3790+}
3791+
3792+static void at91ether_free_coherent(struct macb *lp)
3793+{
3794+ struct macb_queue *q = &lp->queues[0];
3795+
3796+ if (q->rx_ring) {
3797+ dma_free_coherent(&lp->pdev->dev,
3798+ AT91ETHER_MAX_RX_DESCR *
3799+ macb_dma_desc_get_size(lp),
3800+ q->rx_ring, q->rx_ring_dma);
3801+ q->rx_ring = NULL;
3802+ }
3803+
3804+ if (q->rx_buffers) {
3805+ dma_free_coherent(&lp->pdev->dev,
3806+ AT91ETHER_MAX_RX_DESCR *
3807+ AT91ETHER_MAX_RBUFF_SZ,
3808+ q->rx_buffers, q->rx_buffers_dma);
3809+ q->rx_buffers = NULL;
3810+ }
3811+}
3812+
3813+/* Initialize and start the Receiver and Transmit subsystems */
3814+static int at91ether_start(struct macb *lp)
3815+{
3816+ struct macb_queue *q = &lp->queues[0];
3817+ struct macb_dma_desc *desc;
3818+ dma_addr_t addr;
3819+ u32 ctl;
3820+ int i, ret;
3821+
3822+ ret = at91ether_alloc_coherent(lp);
3823+ if (ret)
3824+ return ret;
3825+
37943826 addr = q->rx_buffers_dma;
37953827 for (i = 0; i < AT91ETHER_MAX_RX_DESCR; i++) {
37963828 desc = macb_rx_desc(q, i);
@@ -3812,9 +3844,39 @@ static int at91ether_start(struct net_device *dev) · 15 unmodified lines
38123844 ctl = macb_readl(lp, NCR);
38133845 macb_writel(lp, NCR, ctl | MACB_BIT(RE) | MACB_BIT(TE));
38143846
3847+ /* Enable MAC interrupts */
3848+ macb_writel(lp, IER, MACB_BIT(RCOMP) |
3849+ MACB_BIT(RXUBR) |
3850+ MACB_BIT(ISR_TUND) |
3851+ MACB_BIT(ISR_RLE) |
3852+ MACB_BIT(TCOMP) |
3853+ MACB_BIT(ISR_ROVR) |
3854+ MACB_BIT(HRESP));
3855+
38153856 return 0;
38163857 }
38173858
3859+static void at91ether_stop(struct macb *lp)
3860+{
3861+ u32 ctl;
3862+
3863+ /* Disable MAC interrupts */
3864+ macb_writel(lp, IDR, MACB_BIT(RCOMP) |
3865+ MACB_BIT(RXUBR) |
3866+ MACB_BIT(ISR_TUND) |
3867+ MACB_BIT(ISR_RLE) |
3868+ MACB_BIT(TCOMP) |
3869+ MACB_BIT(ISR_ROVR) |
3870+ MACB_BIT(HRESP));
3871+
3872+ /* Disable Receiver and Transmitter */
3873+ ctl = macb_readl(lp, NCR);
3874+ macb_writel(lp, NCR, ctl & ~(MACB_BIT(TE) | MACB_BIT(RE)));
3875+
3876+ /* Free resources. */
3877+ at91ether_free_coherent(lp);
3878+}
3879+
38183880 /* Open the ethernet interface */
38193881 static int at91ether_open(struct net_device *dev)
38203882 {
@@ -3834,63 +3896,36 @@ static int at91ether_open(struct net_device *dev) · 13 unmodified lines
38343896
38353897 macb_set_hwaddr(lp);
38363898
3837− ret = at91ether_start(dev);
3899+ ret = at91ether_start(lp);
38383900 if (ret)
3839− return ret;
3840−
3841− /* Enable MAC interrupts */
3842− macb_writel(lp, IER, MACB_BIT(RCOMP) |
3843− MACB_BIT(RXUBR) |
3844− MACB_BIT(ISR_TUND) |
3845− MACB_BIT(ISR_RLE) |
3846− MACB_BIT(TCOMP) |
3847− MACB_BIT(ISR_ROVR) |
3848− MACB_BIT(HRESP));
3901+ goto pm_exit;
38493902
38503903 ret = macb_phylink_connect(lp);
38513904 if (ret)
3852− return ret;
3905+ goto stop;
38533906
38543907 netif_start_queue(dev);
38553908
38563909 return 0;
3910+
3911+stop:
3912+ at91ether_stop(lp);
3913+pm_exit:
3914+ pm_runtime_put_sync(&lp->pdev->dev);
3915+ return ret;
38573916 }
38583917
38593918 /* Close the interface */
38603919 static int at91ether_close(struct net_device *dev)
38613920 {
38623921 struct macb *lp = netdev_priv(dev);
3863− struct macb_queue *q = &lp->queues[0];
3864− u32 ctl;
3865−
3866− /* Disable Receiver and Transmitter */
3867− ctl = macb_readl(lp, NCR);
3868− macb_writel(lp, NCR, ctl & ~(MACB_BIT(TE) | MACB_BIT(RE)));
3869−
3870− /* Disable MAC interrupts */
3871− macb_writel(lp, IDR, MACB_BIT(RCOMP) |
3872− MACB_BIT(RXUBR) |
3873− MACB_BIT(ISR_TUND) |
3874− MACB_BIT(ISR_RLE) |
3875− MACB_BIT(TCOMP) |
3876− MACB_BIT(ISR_ROVR) |
3877− MACB_BIT(HRESP));
38783922
38793923 netif_stop_queue(dev);
38803924
38813925 phylink_stop(lp->phylink);
38823926 phylink_disconnect_phy(lp->phylink);
38833927
3884− dma_free_coherent(&lp->pdev->dev,
3885− AT91ETHER_MAX_RX_DESCR *
3886− macb_dma_desc_get_size(lp),
3887− q->rx_ring, q->rx_ring_dma);
3888− q->rx_ring = NULL;
3889−
3890− dma_free_coherent(&lp->pdev->dev,
3891− AT91ETHER_MAX_RX_DESCR * AT91ETHER_MAX_RBUFF_SZ,
3892− q->rx_buffers, q->rx_buffers_dma);
3893− q->rx_buffers = NULL;
3928+ at91ether_stop(lp);
38943929
38953930 return pm_runtime_put(&lp->pdev->dev);
38963931 }
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 (ntohl(addr->s_addr) == 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 (ntohl(addr6->s6_addr32[0]) == 0xffffffff &&
1122+ ntohl(addr6->s6_addr32[1]) == 0xffffffff &&
1123+ ntohl(addr6->s6_addr32[2]) == 0xffffffff &&
1124+ ntohl(addr6->s6_addr32[3]) == 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+18−18
@@ -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
@@ -5310,7 +5310,7 @@ static unsigned int t4_use_ldst(struct adapter *adap) · 2140 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+26−0
@@ -1595,6 +1595,24 @@ static int enetc_set_psfp(struct net_device *ndev, int en) · 1594 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/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/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+24−6
@@ -842,12 +842,13 @@ static int ibmvnic_login(struct net_device *netdev) · 841 unmodified lines
842842 struct ibmvnic_adapter *adapter = netdev_priv(netdev);
843843 unsigned long timeout = msecs_to_jiffies(30000);
844844 int retry_count = 0;
845+ int retries = 10;
845846 bool retry;
846847 int rc;
847848
848849 do {
849850 retry = false;
850− if (retry_count > IBMVNIC_MAX_QUEUES) {
851+ if (retry_count > retries) {
851852 netdev_warn(netdev, "Login attempts exceeded\n");
852853 return -1;
853854 }
@@ -862,11 +863,23 @@ static int ibmvnic_login(struct net_device *netdev) · 8 unmodified lines
862863
863864 if (!wait_for_completion_timeout(&adapter->init_done,
864865 timeout)) {
865− netdev_warn(netdev, "Login timed out\n");
866− return -1;
866+ netdev_warn(netdev, "Login timed out, retrying...\n");
867+ retry = true;
868+ adapter->init_done_rc = 0;
869+ retry_count++;
870+ continue;
867871 }
868872
869− if (adapter->init_done_rc == PARTIALSUCCESS) {
873+ if (adapter->init_done_rc == ABORTED) {
874+ netdev_warn(netdev, "Login aborted, retrying...\n");
875+ retry = true;
876+ adapter->init_done_rc = 0;
877+ retry_count++;
878+ /* FW or device may be busy, so
879+ * wait a bit before retrying login
880+ */
881+ msleep(500);
882+ } else if (adapter->init_done_rc == PARTIALSUCCESS) {
870883 retry_count++;
871884 release_sub_crqs(adapter, 1);
872885
@@ -1958,13 +1971,18 @@ static int do_reset(struct ibmvnic_adapter *adapter, · 1085 unmodified lines
19581971 release_sub_crqs(adapter, 1);
19591972 } else {
19601973 rc = ibmvnic_reset_crq(adapter);
1961− if (!rc)
1974+ if (rc == H_CLOSED || rc == H_SUCCESS) {
19621975 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+ }
19631981 }
19641982
19651983 if (rc) {
19661984 netdev_err(adapter->netdev,
1967− "Couldn't initialize crq. rc=%d\n", rc);
1985+ "Reset couldn't initialize crq. rc=%d\n", rc);
19681986 goto out;
19691987 }
19701988
drivers/net/ethernet/intel/e1000/e1000_main.c+13−36
@@ -151,10 +151,8 @@ static int e1000_vlan_rx_kill_vid(struct net_device *netdev, · 150 unmodified lines
151151 __be16 proto, u16 vid);
152152 static void e1000_restore_vlan(struct e1000_adapter *adapter);
153153
154−#ifdef CONFIG_PM
155−static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
156−static int e1000_resume(struct pci_dev *pdev);
157−#endif
154+static int __maybe_unused e1000_suspend(struct device *dev);
155+static int __maybe_unused e1000_resume(struct device *dev);
158156 static void e1000_shutdown(struct pci_dev *pdev);
159157
160158 #ifdef CONFIG_NET_POLL_CONTROLLER
@@ -179,16 +177,16 @@ static const struct pci_error_handlers e1000_err_handler = { · 18 unmodified lines
179177 .resume = e1000_io_resume,
180178 };
181179
180+static SIMPLE_DEV_PM_OPS(e1000_pm_ops, e1000_suspend, e1000_resume);
181+
182182 static struct pci_driver e1000_driver = {
183183 .name = e1000_driver_name,
184184 .id_table = e1000_pci_tbl,
185185 .probe = e1000_probe,
186186 .remove = e1000_remove,
187−#ifdef CONFIG_PM
188− /* Power Management Hooks */
189− .suspend = e1000_suspend,
190− .resume = e1000_resume,
191−#endif
187+ .driver = {
188+ .pm = &e1000_pm_ops,
189+ },
192190 .shutdown = e1000_shutdown,
193191 .err_handler = &e1000_err_handler
194192 };
@@ -5060,9 +5058,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) · 4865 unmodified lines
50605058 struct e1000_hw *hw = &adapter->hw;
50615059 u32 ctrl, ctrl_ext, rctl, status;
50625060 u32 wufc = adapter->wol;
5063−#ifdef CONFIG_PM
5064− int retval = 0;
5065−#endif
50665061
50675062 netif_device_detach(netdev);
50685063
@@ -5076,12 +5071,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) · 7 unmodified lines
50765071 e1000_down(adapter);
50775072 }
50785073
5079−#ifdef CONFIG_PM
5080− retval = pci_save_state(pdev);
5081− if (retval)
5082− return retval;
5083−#endif
5084−
50855074 status = er32(STATUS);
50865075 if (status & E1000_STATUS_LU)
50875076 wufc &= ~E1000_WUFC_LNKC;
@@ -5142,37 +5131,26 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) · 54 unmodified lines
51425131 return 0;
51435132 }
51445133
5145−#ifdef CONFIG_PM
5146−static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
5134+static int __maybe_unused e1000_suspend(struct device *dev)
51475135 {
51485136 int retval;
5137+ struct pci_dev *pdev = to_pci_dev(dev);
51495138 bool wake;
51505139
51515140 retval = __e1000_shutdown(pdev, &wake);
5152− if (retval)
5153− return retval;
5154−
5155− if (wake) {
5156− pci_prepare_to_sleep(pdev);
5157− } else {
5158− pci_wake_from_d3(pdev, false);
5159− pci_set_power_state(pdev, PCI_D3hot);
5160− }
5141+ device_set_wakeup_enable(dev, wake);
51615142
5162− return 0;
5143+ return retval;
51635144 }
51645145
5165−static int e1000_resume(struct pci_dev *pdev)
5146+static int __maybe_unused e1000_resume(struct device *dev)
51665147 {
5148+ struct pci_dev *pdev = to_pci_dev(dev);
51675149 struct net_device *netdev = pci_get_drvdata(pdev);
51685150 struct e1000_adapter *adapter = netdev_priv(netdev);
51695151 struct e1000_hw *hw = &adapter->hw;
51705152 u32 err;
51715153
5172− pci_set_power_state(pdev, PCI_D0);
5173− pci_restore_state(pdev);
5174− pci_save_state(pdev);
5175−
51765154 if (adapter->need_ioport)
51775155 err = pci_enable_device(pdev);
51785156 else
@@ -5209,7 +5187,6 @@ static int e1000_resume(struct pci_dev *pdev) · 30 unmodified lines
52095187
52105188 return 0;
52115189 }
5212−#endif
52135190
52145191 static void e1000_shutdown(struct pci_dev *pdev)
52155192 {
drivers/net/ethernet/intel/e1000e/netdev.c+15−15
@@ -6349,7 +6349,6 @@ fl_out: · 6348 unmodified lines
63496349 pm_runtime_put_sync(netdev->dev.parent);
63506350 }
63516351
6352−#ifdef CONFIG_PM_SLEEP
63536352 /* S0ix implementation */
63546353 static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter)
63556354 {
@@ -6571,7 +6570,6 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter) · 215 unmodified lines
65716570 mac_data &= ~E1000_CTRL_EXT_FORCE_SMBUS;
65726571 ew32(CTRL_EXT, mac_data);
65736572 }
6574−#endif /* CONFIG_PM_SLEEP */
65756573
65766574 static int e1000e_pm_freeze(struct device *dev)
65776575 {
@@ -6611,11 +6609,17 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) · 33 unmodified lines
66116609 struct net_device *netdev = pci_get_drvdata(pdev);
66126610 struct e1000_adapter *adapter = netdev_priv(netdev);
66136611 struct e1000_hw *hw = &adapter->hw;
6614− u32 ctrl, ctrl_ext, rctl, status;
6615− /* Runtime suspend should only enable wakeup for link changes */
6616− u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
6612+ u32 ctrl, ctrl_ext, rctl, status, wufc;
66176613 int retval = 0;
66186614
6615+ /* Runtime suspend should only enable wakeup for link changes */
6616+ if (runtime)
6617+ wufc = E1000_WUFC_LNKC;
6618+ else if (device_may_wakeup(&pdev->dev))
6619+ wufc = adapter->wol;
6620+ else
6621+ wufc = 0;
6622+
66196623 status = er32(STATUS);
66206624 if (status & E1000_STATUS_LU)
66216625 wufc &= ~E1000_WUFC_LNKC;
@@ -6672,7 +6676,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) · 50 unmodified lines
66726676 if (adapter->hw.phy.type == e1000_phy_igp_3) {
66736677 e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
66746678 } else if (hw->mac.type >= e1000_pch_lpt) {
6675− if (!(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
6679+ if (wufc && !(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
66766680 /* ULP does not support wake from unicast, multicast
66776681 * or broadcast.
66786682 */
@@ -6869,7 +6873,6 @@ err_irq: · 190 unmodified lines
68696873 return rc;
68706874 }
68716875
6872−#ifdef CONFIG_PM
68736876 static int __e1000_resume(struct pci_dev *pdev)
68746877 {
68756878 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -6935,8 +6938,7 @@ static int __e1000_resume(struct pci_dev *pdev) · 59 unmodified lines
69356938 return 0;
69366939 }
69376940
6938−#ifdef CONFIG_PM_SLEEP
6939−static int e1000e_pm_suspend(struct device *dev)
6941+static __maybe_unused int e1000e_pm_suspend(struct device *dev)
69406942 {
69416943 struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
69426944 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -6960,7 +6962,7 @@ static int e1000e_pm_suspend(struct device *dev) · 17 unmodified lines
69606962 return rc;
69616963 }
69626964
6963−static int e1000e_pm_resume(struct device *dev)
6965+static __maybe_unused int e1000e_pm_resume(struct device *dev)
69646966 {
69656967 struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
69666968 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -6979,9 +6981,8 @@ static int e1000e_pm_resume(struct device *dev) · 12 unmodified lines
69796981
69806982 return e1000e_pm_thaw(dev);
69816983 }
6982−#endif /* CONFIG_PM_SLEEP */
69836984
6984−static int e1000e_pm_runtime_idle(struct device *dev)
6985+static __maybe_unused int e1000e_pm_runtime_idle(struct device *dev)
69856986 {
69866987 struct net_device *netdev = dev_get_drvdata(dev);
69876988 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -6997,7 +6998,7 @@ static int e1000e_pm_runtime_idle(struct device *dev) · 9 unmodified lines
69976998 return -EBUSY;
69986999 }
69997000
7000−static int e1000e_pm_runtime_resume(struct device *dev)
7001+static __maybe_unused int e1000e_pm_runtime_resume(struct device *dev)
70017002 {
70027003 struct pci_dev *pdev = to_pci_dev(dev);
70037004 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -7014,7 +7015,7 @@ static int e1000e_pm_runtime_resume(struct device *dev) · 10 unmodified lines
70147015 return rc;
70157016 }
70167017
7017−static int e1000e_pm_runtime_suspend(struct device *dev)
7018+static __maybe_unused int e1000e_pm_runtime_suspend(struct device *dev)
70187019 {
70197020 struct pci_dev *pdev = to_pci_dev(dev);
70207021 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -7039,7 +7040,6 @@ static int e1000e_pm_runtime_suspend(struct device *dev) · 18 unmodified lines
70397040
70407041 return 0;
70417042 }
7042−#endif /* CONFIG_PM */
70437043
70447044 static void e1000_shutdown(struct pci_dev *pdev)
70457045 {
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+53−23
@@ -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);
@@ -3926,14 +3962,10 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode, · 371 unmodified lines
39263962 if (state->speed == SPEED_2500)
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/mvpp2/mvpp2_main.c+7−4
@@ -1544,7 +1544,7 @@ static void mvpp2_read_stats(struct mvpp2_port *port) · 1543 unmodified lines
15441544 for (q = 0; q < port->ntxqs; q++)
15451545 for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_txq_regs); i++)
15461546 *pstats++ += mvpp2_read_index(port->priv,
1547− MVPP22_CTRS_TX_CTR(port->id, i),
1547+ MVPP22_CTRS_TX_CTR(port->id, q),
15481548 mvpp2_ethtool_txq_regs[i].offset);
15491549
15501550 /* Rxqs are numbered from 0 from the user standpoint, but not from the
@@ -1553,7 +1553,7 @@ static void mvpp2_read_stats(struct mvpp2_port *port) · 2 unmodified lines
15531553 for (q = 0; q < port->nrxqs; q++)
15541554 for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_rxq_regs); i++)
15551555 *pstats++ += mvpp2_read_index(port->priv,
1556− port->first_rxq + i,
1556+ port->first_rxq + q,
15571557 mvpp2_ethtool_rxq_regs[i].offset);
15581558 }
15591559
@@ -5983,8 +5983,8 @@ static int mvpp2_remove(struct platform_device *pdev) · 4423 unmodified lines
59835983 {
59845984 struct mvpp2 *priv = platform_get_drvdata(pdev);
59855985 struct fwnode_handle *fwnode = pdev->dev.fwnode;
5986+ int i = 0, poolnum = MVPP2_BM_POOLS_NUM;
59865987 struct fwnode_handle *port_fwnode;
5987− int i = 0;
59885988
59895989 mvpp2_dbgfs_cleanup(priv);
59905990
@@ -5998,7 +5998,10 @@ static int mvpp2_remove(struct platform_device *pdev) · 7 unmodified lines
59985998
59995999 destroy_workqueue(priv->stats_queue);
60006000
6001− for (i = 0; i < MVPP2_BM_POOLS_NUM; i++) {
6001+ if (priv->percpu_pools)
6002+ poolnum = mvpp2_get_nrxqs(priv) * 2;
6003+
6004+ for (i = 0; i < poolnum; i++) {
60026005 struct mvpp2_bm_pool *bm_pool = &priv->bm_pools[i];
60036006
60046007 mvpp2_bm_pool_destroy(&pdev->dev, priv, bm_pool);
drivers/net/ethernet/mediatek/mtk_star_emac.c+29−89
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #include <linux/regmap.h>
2525 #include <linux/skbuff.h>
2626 #include <linux/spinlock.h>
27−#include <linux/workqueue.h>
2827
2928 #define MTK_STAR_DRVNAME "mtk_star_emac"
3029
@@ -262,7 +261,6 @@ struct mtk_star_priv { · 231 unmodified lines
262261 spinlock_t lock;
263262
264263 struct rtnl_link_stats64 stats;
265− struct work_struct stats_work;
266264 };
267265
268266 static struct device *mtk_star_get_dev(struct mtk_star_priv *priv)
@@ -432,42 +430,6 @@ static void mtk_star_intr_disable(struct mtk_star_priv *priv) · 163 unmodified lines
432430 regmap_write(priv->regs, MTK_STAR_REG_INT_MASK, ~0);
433431 }
434432
435−static void mtk_star_intr_enable_tx(struct mtk_star_priv *priv)
436−{
437− regmap_clear_bits(priv->regs, MTK_STAR_REG_INT_MASK,
438− MTK_STAR_BIT_INT_STS_TNTC);
439−}
440−
441−static void mtk_star_intr_enable_rx(struct mtk_star_priv *priv)
442−{
443− regmap_clear_bits(priv->regs, MTK_STAR_REG_INT_MASK,
444− MTK_STAR_BIT_INT_STS_FNRC);
445−}
446−
447−static void mtk_star_intr_enable_stats(struct mtk_star_priv *priv)
448−{
449− regmap_clear_bits(priv->regs, MTK_STAR_REG_INT_MASK,
450− MTK_STAR_REG_INT_STS_MIB_CNT_TH);
451−}
452−
453−static void mtk_star_intr_disable_tx(struct mtk_star_priv *priv)
454−{
455− regmap_set_bits(priv->regs, MTK_STAR_REG_INT_MASK,
456− MTK_STAR_BIT_INT_STS_TNTC);
457−}
458−
459−static void mtk_star_intr_disable_rx(struct mtk_star_priv *priv)
460−{
461− regmap_set_bits(priv->regs, MTK_STAR_REG_INT_MASK,
462− MTK_STAR_BIT_INT_STS_FNRC);
463−}
464−
465−static void mtk_star_intr_disable_stats(struct mtk_star_priv *priv)
466−{
467− regmap_set_bits(priv->regs, MTK_STAR_REG_INT_MASK,
468− MTK_STAR_REG_INT_STS_MIB_CNT_TH);
469−}
470−
471433 static unsigned int mtk_star_intr_read(struct mtk_star_priv *priv)
472434 {
473435 unsigned int val;
@@ -663,20 +625,6 @@ static void mtk_star_update_stats(struct mtk_star_priv *priv) · 189 unmodified lines
663625 stats->rx_errors += stats->rx_fifo_errors;
664626 }
665627
666−/* This runs in process context and parallel TX and RX paths executing in
667− * napi context may result in losing some stats data but this should happen
668− * seldom enough to be acceptable.
669− */
670−static void mtk_star_update_stats_work(struct work_struct *work)
671−{
672− struct mtk_star_priv *priv = container_of(work, struct mtk_star_priv,
673− stats_work);
674−
675− mtk_star_update_stats(priv);
676− mtk_star_reset_counters(priv);
677− mtk_star_intr_enable_stats(priv);
678−}
679−
680628 static struct sk_buff *mtk_star_alloc_skb(struct net_device *ndev)
681629 {
682630 uintptr_t tail, offset;
@@ -767,42 +715,25 @@ static void mtk_star_free_tx_skbs(struct mtk_star_priv *priv) · 84 unmodified lines
767715 mtk_star_ring_free_skbs(priv, ring, mtk_star_dma_unmap_tx);
768716 }
769717
770−/* All processing for TX and RX happens in the napi poll callback. */
718+/* All processing for TX and RX happens in the napi poll callback.
719+ *
720+ * FIXME: The interrupt handling should be more fine-grained with each
721+ * interrupt enabled/disabled independently when needed. Unfortunatly this
722+ * turned out to impact the driver's stability and until we have something
723+ * working properly, we're disabling all interrupts during TX & RX processing
724+ * or when resetting the counter registers.
725+ */
771726 static irqreturn_t mtk_star_handle_irq(int irq, void *data)
772727 {
773728 struct mtk_star_priv *priv;
774729 struct net_device *ndev;
775− bool need_napi = false;
776− unsigned int status;
777730
778731 ndev = data;
779732 priv = netdev_priv(ndev);
780733
781734 if (netif_running(ndev)) {
782− status = mtk_star_intr_read(priv);
783−
784− if (status & MTK_STAR_BIT_INT_STS_TNTC) {
785− mtk_star_intr_disable_tx(priv);
786− need_napi = true;
787− }
788−
789− if (status & MTK_STAR_BIT_INT_STS_FNRC) {
790− mtk_star_intr_disable_rx(priv);
791− need_napi = true;
792− }
793−
794− if (need_napi)
795− napi_schedule(&priv->napi);
796−
797− /* One of the counters reached 0x8000000 - update stats and
798− * reset all counters.
799− */
800− if (unlikely(status & MTK_STAR_REG_INT_STS_MIB_CNT_TH)) {
801− mtk_star_intr_disable_stats(priv);
802− schedule_work(&priv->stats_work);
803− }
804−
805− mtk_star_intr_ack_all(priv);
735+ mtk_star_intr_disable(priv);
736+ napi_schedule(&priv->napi);
806737 }
807738
808739 return IRQ_HANDLED;
@@ -1169,8 +1100,6 @@ static void mtk_star_tx_complete_all(struct mtk_star_priv *priv) · 360 unmodified lines
11691100 if (wake && netif_queue_stopped(ndev))
11701101 netif_wake_queue(ndev);
11711102
1172− mtk_star_intr_enable_tx(priv);
1173−
11741103 spin_unlock(&priv->lock);
11751104 }
11761105
@@ -1332,20 +1261,32 @@ static int mtk_star_process_rx(struct mtk_star_priv *priv, int budget) · 155 unmodified lines
13321261 static int mtk_star_poll(struct napi_struct *napi, int budget)
13331262 {
13341263 struct mtk_star_priv *priv;
1264+ unsigned int status;
13351265 int received = 0;
13361266
13371267 priv = container_of(napi, struct mtk_star_priv, napi);
13381268
1339− /* Clean-up all TX descriptors. */
1340− mtk_star_tx_complete_all(priv);
1341− /* Receive up to $budget packets. */
1342− received = mtk_star_process_rx(priv, budget);
1269+ status = mtk_star_intr_read(priv);
1270+ mtk_star_intr_ack_all(priv);
13431271
1344− if (received < budget) {
1345− napi_complete_done(napi, received);
1346− mtk_star_intr_enable_rx(priv);
1272+ if (status & MTK_STAR_BIT_INT_STS_TNTC)
1273+ /* Clean-up all TX descriptors. */
1274+ mtk_star_tx_complete_all(priv);
1275+
1276+ if (status & MTK_STAR_BIT_INT_STS_FNRC)
1277+ /* Receive up to $budget packets. */
1278+ received = mtk_star_process_rx(priv, budget);
1279+
1280+ if (unlikely(status & MTK_STAR_REG_INT_STS_MIB_CNT_TH)) {
1281+ mtk_star_update_stats(priv);
1282+ mtk_star_reset_counters(priv);
13471283 }
13481284
1285+ if (received < budget)
1286+ napi_complete_done(napi, received);
1287+
1288+ mtk_star_intr_enable(priv);
1289+
13491290 return received;
13501291 }
13511292
@@ -1532,7 +1473,6 @@ static int mtk_star_probe(struct platform_device *pdev) · 180 unmodified lines
15321473 ndev->max_mtu = MTK_STAR_MAX_FRAME_SIZE;
15331474
15341475 spin_lock_init(&priv->lock);
1535− INIT_WORK(&priv->stats_work, mtk_star_update_stats_work);
15361476
15371477 base = devm_platform_ioremap_resource(pdev, 0);
15381478 if (IS_ERR(base))
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/mlxsw/spectrum.c+2−0
@@ -978,8 +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+ thres_cells = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, thres_cells);
981982 delay_cells = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay,
982983 pfc, pause_en);
984+ delay_cells = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, delay_cells);
983985 total_cells = thres_cells + delay_cells;
984986
985987 taken_headroom_cells += total_cells;
drivers/net/ethernet/mellanox/mlxsw/spectrum.h+11−0
@@ -374,6 +374,17 @@ 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 u32
378+mlxsw_sp_port_headroom_8x_adjust(const struct mlxsw_sp_port *mlxsw_sp_port,
379+ u32 size_cells)
380+{
381+ /* Ports with eight lanes use two headroom buffers between which the
382+ * configured headroom size is split. Therefore, multiply the calculated
383+ * headroom size by two.
384+ */
385+ return mlxsw_sp_port->mapping.width == 8 ? 2 * size_cells : size_cells;
386+}
387+
377388 enum mlxsw_sp_flood_type {
378389 MLXSW_SP_FLOOD_TYPE_UC,
379390 MLXSW_SP_FLOOD_TYPE_BC,
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c+1−0
@@ -312,6 +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+ size = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, size);
315316 mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl, i, size);
316317 }
317318 mlxsw_reg_pbmc_lossy_buffer_pack(pbmc_pl,
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+1−0
@@ -782,6 +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+ buffsize = mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, buffsize);
785786 mlxsw_reg_sbib_pack(sbib_pl, mlxsw_sp_port->local_port, buffsize);
786787 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbib), sbib_pl);
787788 }
drivers/net/ethernet/microchip/lan743x_main.c+2−0
@@ -3091,6 +3091,8 @@ static const struct pci_device_id lan743x_pcidev_tbl[] = { · 3090 unmodified lines
30913091 { 0, }
30923092 };
30933093
3094+MODULE_DEVICE_TABLE(pci, lan743x_pcidev_tbl);
3095+
30943096 static struct pci_driver lan743x_pcidev_driver = {
30953097 .name = DRIVER_NAME,
30963098 .id_table = lan743x_pcidev_tbl,
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_lif.c+11−8
@@ -96,7 +96,8 @@ static void ionic_link_status_check(struct ionic_lif *lif) · 95 unmodified lines
9696 u16 link_status;
9797 bool link_up;
9898
99− if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state))
99+ if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state) ||
100+ test_bit(IONIC_LIF_F_QUEUE_RESET, lif->state))
100101 return;
101102
102103 link_status = le16_to_cpu(lif->info->status.link_status);
@@ -1245,6 +1246,7 @@ static int ionic_init_nic_features(struct ionic_lif *lif) · 1142 unmodified lines
12451246
12461247 netdev->hw_features |= netdev->hw_enc_features;
12471248 netdev->features |= netdev->hw_features;
1249+ netdev->vlan_features |= netdev->features & ~NETIF_F_VLAN_FEATURES;
12481250
12491251 netdev->priv_flags |= IFF_UNICAST_FLT |
12501252 IFF_LIVE_ADDR_CHANGE;
@@ -1692,15 +1694,15 @@ static void ionic_stop_queues(struct ionic_lif *lif) · 441 unmodified lines
16921694 if (!test_and_clear_bit(IONIC_LIF_F_UP, lif->state))
16931695 return;
16941696
1695− ionic_txrx_disable(lif);
16961697 netif_tx_disable(lif->netdev);
1698+ ionic_txrx_disable(lif);
16971699 }
16981700
16991701 int ionic_stop(struct net_device *netdev)
17001702 {
17011703 struct ionic_lif *lif = netdev_priv(netdev);
17021704
1703− if (!netif_device_present(netdev))
1705+ if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
17041706 return 0;
17051707
17061708 ionic_stop_queues(lif);
@@ -1983,18 +1985,19 @@ int ionic_reset_queues(struct ionic_lif *lif) · 276 unmodified lines
19831985 bool running;
19841986 int err = 0;
19851987
1986− /* Put off the next watchdog timeout */
1987− netif_trans_update(lif->netdev);
1988−
19891988 err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
19901989 if (err)
19911990 return err;
19921991
19931992 running = netif_running(lif->netdev);
1994− if (running)
1993+ if (running) {
1994+ netif_device_detach(lif->netdev);
19951995 err = ionic_stop(lif->netdev);
1996− if (!err && running)
1996+ }
1997+ if (!err && running) {
19971998 ionic_open(lif->netdev);
1999+ netif_device_attach(lif->netdev);
2000+ }
19982001
19992002 clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state);
20002003
drivers/net/ethernet/qlogic/qed/qed_cxt.c+20−1
@@ -271,7 +271,7 @@ static void qed_cxt_qm_iids(struct qed_hwfn *p_hwfn, · 270 unmodified lines
271271 vf_tids += segs[NUM_TASK_PF_SEGMENTS].count;
272272 }
273273
274− iids->vf_cids += vf_cids * p_mngr->vf_count;
274+ iids->vf_cids = vf_cids;
275275 iids->tids += vf_tids * p_mngr->vf_count;
276276
277277 DP_VERBOSE(p_hwfn, QED_MSG_ILT,
@@ -465,6 +465,20 @@ static struct qed_ilt_cli_blk *qed_cxt_set_blk(struct qed_ilt_cli_blk *p_blk) · 187 unmodified lines
465465 return p_blk;
466466 }
467467
468+static void qed_cxt_ilt_blk_reset(struct qed_hwfn *p_hwfn)
469+{
470+ struct qed_ilt_client_cfg *clients = p_hwfn->p_cxt_mngr->clients;
471+ u32 cli_idx, blk_idx;
472+
473+ for (cli_idx = 0; cli_idx < MAX_ILT_CLIENTS; cli_idx++) {
474+ for (blk_idx = 0; blk_idx < ILT_CLI_PF_BLOCKS; blk_idx++)
475+ clients[cli_idx].pf_blks[blk_idx].total_size = 0;
476+
477+ for (blk_idx = 0; blk_idx < ILT_CLI_VF_BLOCKS; blk_idx++)
478+ clients[cli_idx].vf_blks[blk_idx].total_size = 0;
479+ }
480+}
481+
468482 int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn, u32 *line_count)
469483 {
470484 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr;
@@ -484,6 +498,11 @@ int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn, u32 *line_count) · 13 unmodified lines
484498
485499 p_mngr->pf_start_line = RESC_START(p_hwfn, QED_ILT);
486500
501+ /* Reset all ILT blocks at the beginning of ILT computing in order
502+ * to prevent memory allocation for irrelevant blocks afterwards.
503+ */
504+ qed_cxt_ilt_blk_reset(p_hwfn);
505+
487506 DP_VERBOSE(p_hwfn, QED_MSG_ILT,
488507 "hwfn [%d] - Set context manager starting line to be 0x%08x\n",
489508 p_hwfn->my_id, p_hwfn->p_cxt_mngr->pf_start_line);
drivers/net/ethernet/qlogic/qed/qed_debug.c+2−1
@@ -5568,7 +5568,8 @@ static const char * const s_status_str[] = { · 5567 unmodified lines
55685568
55695569 /* DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS */
55705570 "The filter/trigger constraint dword offsets are not enabled for recording",
5571−
5571+ /* DBG_STATUS_NO_MATCHING_FRAMING_MODE */
5572+ "No matching framing mode",
55725573
55735574 /* DBG_STATUS_VFC_READ_ERROR */
55745575 "Error reading from VFC",
drivers/net/ethernet/qlogic/qed/qed_dev.c+8−3
@@ -980,7 +980,7 @@ int qed_llh_add_mac_filter(struct qed_dev *cdev, · 979 unmodified lines
980980 struct qed_hwfn *p_hwfn = QED_LEADING_HWFN(cdev);
981981 struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn);
982982 union qed_llh_filter filter = {};
983− u8 filter_idx, abs_ppfid;
983+ u8 filter_idx, abs_ppfid = 0;
984984 u32 high, low, ref_cnt;
985985 int rc = 0;
986986
@@ -1368,6 +1368,8 @@ static void qed_dbg_user_data_free(struct qed_hwfn *p_hwfn) · 381 unmodified lines
13681368
13691369 void qed_resc_free(struct qed_dev *cdev)
13701370 {
1371+ struct qed_rdma_info *rdma_info;
1372+ struct qed_hwfn *p_hwfn;
13711373 int i;
13721374
13731375 if (IS_VF(cdev)) {
@@ -1385,7 +1387,8 @@ void qed_resc_free(struct qed_dev *cdev) · 11 unmodified lines
13851387 qed_llh_free(cdev);
13861388
13871389 for_each_hwfn(cdev, i) {
1388− struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
1390+ p_hwfn = cdev->hwfns + i;
1391+ rdma_info = p_hwfn->p_rdma_info;
13891392
13901393 qed_cxt_mngr_free(p_hwfn);
13911394 qed_qm_info_free(p_hwfn);
@@ -1404,8 +1407,10 @@ void qed_resc_free(struct qed_dev *cdev) · 12 unmodified lines
14041407 qed_ooo_free(p_hwfn);
14051408 }
14061409
1407− if (QED_IS_RDMA_PERSONALITY(p_hwfn))
1410+ if (QED_IS_RDMA_PERSONALITY(p_hwfn) && rdma_info) {
1411+ qed_spq_unregister_async_cb(p_hwfn, rdma_info->proto);
14081412 qed_rdma_info_free(p_hwfn);
1413+ }
14091414
14101415 qed_iov_free(p_hwfn);
14111416 qed_l2_free(p_hwfn);
drivers/net/ethernet/qlogic/qed/qed_iwarp.c+0−2
@@ -2836,8 +2836,6 @@ int qed_iwarp_stop(struct qed_hwfn *p_hwfn) · 2835 unmodified lines
28362836 if (rc)
28372837 return rc;
28382838
2839− qed_spq_unregister_async_cb(p_hwfn, PROTOCOLID_IWARP);
2840−
28412839 return qed_iwarp_ll2_stop(p_hwfn);
28422840 }
28432841
drivers/net/ethernet/qlogic/qed/qed_roce.c+0−1
@@ -113,7 +113,6 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn) · 112 unmodified lines
113113 break;
114114 }
115115 }
116− qed_spq_unregister_async_cb(p_hwfn, PROTOCOLID_ROCE);
117116 }
118117
119118 static void qed_rdma_copy_gids(struct qed_rdma_qp *qp, __le32 *src_gid,
drivers/net/ethernet/qlogic/qed/qed_vf.c+18−5
@@ -81,12 +81,17 @@ static void qed_vf_pf_req_end(struct qed_hwfn *p_hwfn, int req_status) · 80 unmodified lines
8181 mutex_unlock(&(p_hwfn->vf_iov_info->mutex));
8282 }
8383
84+#define QED_VF_CHANNEL_USLEEP_ITERATIONS 90
85+#define QED_VF_CHANNEL_USLEEP_DELAY 100
86+#define QED_VF_CHANNEL_MSLEEP_ITERATIONS 10
87+#define QED_VF_CHANNEL_MSLEEP_DELAY 25
88+
8489 static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
8590 {
8691 union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;
8792 struct ustorm_trigger_vf_zone trigger;
8893 struct ustorm_vf_zone *zone_data;
89− int rc = 0, time = 100;
94+ int iter, rc = 0;
9095
9196 zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B;
9297
@@ -126,11 +131,19 @@ static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size) · 33 unmodified lines
126131 REG_WR(p_hwfn, (uintptr_t)&zone_data->trigger, *((u32 *)&trigger));
127132
128133 /* When PF would be done with the response, it would write back to the
129− * `done' address. Poll until then.
134+ * `done' address from a coherent DMA zone. Poll until then.
130135 */
131− while ((!*done) && time) {
132− msleep(25);
133− time--;
136+
137+ iter = QED_VF_CHANNEL_USLEEP_ITERATIONS;
138+ while (!*done && iter--) {
139+ udelay(QED_VF_CHANNEL_USLEEP_DELAY);
140+ dma_rmb();
141+ }
142+
143+ iter = QED_VF_CHANNEL_MSLEEP_ITERATIONS;
144+ while (!*done && iter--) {
145+ msleep(QED_VF_CHANNEL_MSLEEP_DELAY);
146+ dma_rmb();
134147 }
135148
136149 if (!*done) {
drivers/net/ethernet/qlogic/qede/qede_main.c+2−1
@@ -1229,7 +1229,7 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level, · 1228 unmodified lines
12291229
12301230 /* PTP not supported on VFs */
12311231 if (!is_vf)
1232− qede_ptp_enable(edev, (mode == QEDE_PROBE_NORMAL));
1232+ qede_ptp_enable(edev);
12331233
12341234 edev->ops->register_ops(cdev, &qede_ll_ops, edev);
12351235
@@ -1318,6 +1318,7 @@ static void __qede_remove(struct pci_dev *pdev, enum qede_remove_mode mode) · 82 unmodified lines
13181318 if (system_state == SYSTEM_POWER_OFF)
13191319 return;
13201320 qed_ops->common->remove(cdev);
1321+ edev->cdev = NULL;
13211322
13221323 /* Since this can happen out-of-sync with other flows,
13231324 * don't release the netdevice until after slowpath stop
drivers/net/ethernet/qlogic/qede/qede_ptp.c+13−18
@@ -412,6 +412,7 @@ void qede_ptp_disable(struct qede_dev *edev) · 411 unmodified lines
412412 if (ptp->tx_skb) {
413413 dev_kfree_skb_any(ptp->tx_skb);
414414 ptp->tx_skb = NULL;
415+ clear_bit_unlock(QEDE_FLAGS_PTP_TX_IN_PRORGESS, &edev->flags);
415416 }
416417
417418 /* Disable PTP in HW */
@@ -423,7 +424,7 @@ void qede_ptp_disable(struct qede_dev *edev) · 5 unmodified lines
423424 edev->ptp = NULL;
424425 }
425426
426−static int qede_ptp_init(struct qede_dev *edev, bool init_tc)
427+static int qede_ptp_init(struct qede_dev *edev)
427428 {
428429 struct qede_ptp *ptp;
429430 int rc;
@@ -444,25 +445,19 @@ static int qede_ptp_init(struct qede_dev *edev, bool init_tc) · 14 unmodified lines
444445 /* Init work queue for Tx timestamping */
445446 INIT_WORK(&ptp->work, qede_ptp_task);
446447
447− /* Init cyclecounter and timecounter. This is done only in the first
448− * load. If done in every load, PTP application will fail when doing
449− * unload / load (e.g. MTU change) while it is running.
450− */
451− if (init_tc) {
452− memset(&ptp->cc, 0, sizeof(ptp->cc));
453− ptp->cc.read = qede_ptp_read_cc;
454− ptp->cc.mask = CYCLECOUNTER_MASK(64);
455− ptp->cc.shift = 0;
456− ptp->cc.mult = 1;
457−
458− timecounter_init(&ptp->tc, &ptp->cc,
459− ktime_to_ns(ktime_get_real()));
460− }
448+ /* Init cyclecounter and timecounter */
449+ memset(&ptp->cc, 0, sizeof(ptp->cc));
450+ ptp->cc.read = qede_ptp_read_cc;
451+ ptp->cc.mask = CYCLECOUNTER_MASK(64);
452+ ptp->cc.shift = 0;
453+ ptp->cc.mult = 1;
461454
462− return rc;
455+ timecounter_init(&ptp->tc, &ptp->cc, ktime_to_ns(ktime_get_real()));
456+
457+ return 0;
463458 }
464459
465−int qede_ptp_enable(struct qede_dev *edev, bool init_tc)
460+int qede_ptp_enable(struct qede_dev *edev)
466461 {
467462 struct qede_ptp *ptp;
468463 int rc;
@@ -483,7 +478,7 @@ int qede_ptp_enable(struct qede_dev *edev, bool init_tc) · 14 unmodified lines
483478
484479 edev->ptp = ptp;
485480
486− rc = qede_ptp_init(edev, init_tc);
481+ rc = qede_ptp_init(edev);
487482 if (rc)
488483 goto err1;
489484
drivers/net/ethernet/qlogic/qede/qede_ptp.h+1−1
@@ -41,7 +41,7 @@ void qede_ptp_rx_ts(struct qede_dev *edev, struct sk_buff *skb); · 40 unmodified lines
4141 void qede_ptp_tx_ts(struct qede_dev *edev, struct sk_buff *skb);
4242 int qede_ptp_hw_ts(struct qede_dev *edev, struct ifreq *req);
4343 void qede_ptp_disable(struct qede_dev *edev);
44−int qede_ptp_enable(struct qede_dev *edev, bool init_tc);
44+int qede_ptp_enable(struct qede_dev *edev);
4545 int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *ts);
4646
4747 static inline void qede_ptp_record_rx_ts(struct qede_dev *edev,
drivers/net/ethernet/qlogic/qede/qede_rdma.c+2−1
@@ -105,6 +105,7 @@ static void qede_rdma_destroy_wq(struct qede_dev *edev) · 104 unmodified lines
105105
106106 qede_rdma_cleanup_event(edev);
107107 destroy_workqueue(edev->rdma_info.rdma_wq);
108+ edev->rdma_info.rdma_wq = NULL;
108109 }
109110
110111 int qede_rdma_dev_add(struct qede_dev *edev, bool recovery)
@@ -325,7 +326,7 @@ static void qede_rdma_add_event(struct qede_dev *edev, · 214 unmodified lines
325326 if (edev->rdma_info.exp_recovery)
326327 return;
327328
328− if (!edev->rdma_info.qedr_dev)
329+ if (!edev->rdma_info.qedr_dev || !edev->rdma_info.rdma_wq)
329330 return;
330331
331332 /* We don't want the cleanup flow to start while we're allocating and
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c+17−17
@@ -269,7 +269,7 @@ static ssize_t qlcnic_sysfs_read_crb(struct file *filp, struct kobject *kobj, · 268 unmodified lines
269269 struct bin_attribute *attr, char *buf,
270270 loff_t offset, size_t size)
271271 {
272− struct device *dev = container_of(kobj, struct device, kobj);
272+ struct device *dev = kobj_to_dev(kobj);
273273 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
274274 int ret;
275275
@@ -286,7 +286,7 @@ static ssize_t qlcnic_sysfs_write_crb(struct file *filp, struct kobject *kobj, · 10 unmodified lines
286286 struct bin_attribute *attr, char *buf,
287287 loff_t offset, size_t size)
288288 {
289− struct device *dev = container_of(kobj, struct device, kobj);
289+ struct device *dev = kobj_to_dev(kobj);
290290 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
291291 int ret;
292292
@@ -315,7 +315,7 @@ static ssize_t qlcnic_sysfs_read_mem(struct file *filp, struct kobject *kobj, · 22 unmodified lines
315315 struct bin_attribute *attr, char *buf,
316316 loff_t offset, size_t size)
317317 {
318− struct device *dev = container_of(kobj, struct device, kobj);
318+ struct device *dev = kobj_to_dev(kobj);
319319 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
320320 u64 data;
321321 int ret;
@@ -337,7 +337,7 @@ static ssize_t qlcnic_sysfs_write_mem(struct file *filp, struct kobject *kobj, · 15 unmodified lines
337337 struct bin_attribute *attr, char *buf,
338338 loff_t offset, size_t size)
339339 {
340− struct device *dev = container_of(kobj, struct device, kobj);
340+ struct device *dev = kobj_to_dev(kobj);
341341 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
342342 u64 data;
343343 int ret;
@@ -402,7 +402,7 @@ static ssize_t qlcnic_sysfs_write_pm_config(struct file *filp, · 58 unmodified lines
402402 char *buf, loff_t offset,
403403 size_t size)
404404 {
405− struct device *dev = container_of(kobj, struct device, kobj);
405+ struct device *dev = kobj_to_dev(kobj);
406406 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
407407 struct qlcnic_pm_func_cfg *pm_cfg;
408408 u32 id, action, pci_func;
@@ -452,7 +452,7 @@ static ssize_t qlcnic_sysfs_read_pm_config(struct file *filp, · 43 unmodified lines
452452 char *buf, loff_t offset,
453453 size_t size)
454454 {
455− struct device *dev = container_of(kobj, struct device, kobj);
455+ struct device *dev = kobj_to_dev(kobj);
456456 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
457457 struct qlcnic_pm_func_cfg *pm_cfg;
458458 u8 pci_func;
@@ -545,7 +545,7 @@ static ssize_t qlcnic_sysfs_write_esw_config(struct file *file, · 86 unmodified lines
545545 char *buf, loff_t offset,
546546 size_t size)
547547 {
548− struct device *dev = container_of(kobj, struct device, kobj);
548+ struct device *dev = kobj_to_dev(kobj);
549549 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
550550 struct qlcnic_esw_func_cfg *esw_cfg;
551551 struct qlcnic_npar_info *npar;
@@ -629,7 +629,7 @@ static ssize_t qlcnic_sysfs_read_esw_config(struct file *file, · 77 unmodified lines
629629 char *buf, loff_t offset,
630630 size_t size)
631631 {
632− struct device *dev = container_of(kobj, struct device, kobj);
632+ struct device *dev = kobj_to_dev(kobj);
633633 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
634634 struct qlcnic_esw_func_cfg *esw_cfg;
635635 u8 pci_func;
@@ -681,7 +681,7 @@ static ssize_t qlcnic_sysfs_write_npar_config(struct file *file, · 45 unmodified lines
681681 char *buf, loff_t offset,
682682 size_t size)
683683 {
684− struct device *dev = container_of(kobj, struct device, kobj);
684+ struct device *dev = kobj_to_dev(kobj);
685685 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
686686 struct qlcnic_info nic_info;
687687 struct qlcnic_npar_func_cfg *np_cfg;
@@ -728,7 +728,7 @@ static ssize_t qlcnic_sysfs_read_npar_config(struct file *file, · 40 unmodified lines
728728 char *buf, loff_t offset,
729729 size_t size)
730730 {
731− struct device *dev = container_of(kobj, struct device, kobj);
731+ struct device *dev = kobj_to_dev(kobj);
732732 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
733733 struct qlcnic_npar_func_cfg *np_cfg;
734734 struct qlcnic_info nic_info;
@@ -775,7 +775,7 @@ static ssize_t qlcnic_sysfs_get_port_stats(struct file *file, · 40 unmodified lines
775775 char *buf, loff_t offset,
776776 size_t size)
777777 {
778− struct device *dev = container_of(kobj, struct device, kobj);
778+ struct device *dev = kobj_to_dev(kobj);
779779 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
780780 struct qlcnic_esw_statistics port_stats;
781781 int ret;
@@ -810,7 +810,7 @@ static ssize_t qlcnic_sysfs_get_esw_stats(struct file *file, · 28 unmodified lines
810810 char *buf, loff_t offset,
811811 size_t size)
812812 {
813− struct device *dev = container_of(kobj, struct device, kobj);
813+ struct device *dev = kobj_to_dev(kobj);
814814 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
815815 struct qlcnic_esw_statistics esw_stats;
816816 int ret;
@@ -845,7 +845,7 @@ static ssize_t qlcnic_sysfs_clear_esw_stats(struct file *file, · 28 unmodified lines
845845 char *buf, loff_t offset,
846846 size_t size)
847847 {
848− struct device *dev = container_of(kobj, struct device, kobj);
848+ struct device *dev = kobj_to_dev(kobj);
849849 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
850850 int ret;
851851
@@ -875,7 +875,7 @@ static ssize_t qlcnic_sysfs_clear_port_stats(struct file *file, · 23 unmodified lines
875875 size_t size)
876876 {
877877
878− struct device *dev = container_of(kobj, struct device, kobj);
878+ struct device *dev = kobj_to_dev(kobj);
879879 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
880880 int ret;
881881
@@ -904,7 +904,7 @@ static ssize_t qlcnic_sysfs_read_pci_config(struct file *file, · 22 unmodified lines
904904 char *buf, loff_t offset,
905905 size_t size)
906906 {
907− struct device *dev = container_of(kobj, struct device, kobj);
907+ struct device *dev = kobj_to_dev(kobj);
908908 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
909909 struct qlcnic_pci_func_cfg *pci_cfg;
910910 struct qlcnic_pci_info *pci_info;
@@ -946,7 +946,7 @@ static ssize_t qlcnic_83xx_sysfs_flash_read_handler(struct file *filp, · 35 unmodified lines
946946 {
947947 unsigned char *p_read_buf;
948948 int ret, count;
949− struct device *dev = container_of(kobj, struct device, kobj);
949+ struct device *dev = kobj_to_dev(kobj);
950950 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
951951
952952 if (!size)
@@ -1124,7 +1124,7 @@ static ssize_t qlcnic_83xx_sysfs_flash_write_handler(struct file *filp, · 171 unmodified lines
11241124 int ret;
11251125 static int flash_mode;
11261126 unsigned long data;
1127− struct device *dev = container_of(kobj, struct device, kobj);
1127+ struct device *dev = kobj_to_dev(kobj);
11281128 struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
11291129
11301130 ret = kstrtoul(buf, 16, &data);
drivers/net/ethernet/realtek/r8169_main.c+4−1
@@ -2114,8 +2114,11 @@ static void rtl_release_firmware(struct rtl8169_private *tp) · 2113 unmodified lines
21142114 void r8169_apply_firmware(struct rtl8169_private *tp)
21152115 {
21162116 /* TODO: release firmware if rtl_fw_write_firmware signals failure. */
2117− if (tp->rtl_fw)
2117+ if (tp->rtl_fw) {
21182118 rtl_fw_write_firmware(tp, tp->rtl_fw);
2119+ /* At least one firmware doesn't reset tp->ocp_base. */
2120+ tp->ocp_base = OCP_STD_PHY_BASE;
2121+ }
21192122 }
21202123
21212124 static void rtl8168_config_eee_mac(struct rtl8169_private *tp)
drivers/net/ethernet/rocker/rocker_main.c+2−2
@@ -647,10 +647,10 @@ static int rocker_dma_rings_init(struct rocker *rocker) · 646 unmodified lines
647647 err_dma_event_ring_bufs_alloc:
648648 rocker_dma_ring_destroy(rocker, &rocker->event_ring);
649649 err_dma_event_ring_create:
650+ rocker_dma_cmd_ring_waits_free(rocker);
651+err_dma_cmd_ring_waits_alloc:
650652 rocker_dma_ring_bufs_free(rocker, &rocker->cmd_ring,
651653 PCI_DMA_BIDIRECTIONAL);
652−err_dma_cmd_ring_waits_alloc:
653− rocker_dma_cmd_ring_waits_free(rocker);
654654 err_dma_cmd_ring_bufs_alloc:
655655 rocker_dma_ring_destroy(rocker, &rocker->cmd_ring);
656656 return err;
drivers/net/ethernet/socionext/netsec.c+3−2
@@ -1044,8 +1044,9 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) · 1043 unmodified lines
10441044 skb->ip_summed = CHECKSUM_UNNECESSARY;
10451045
10461046 next:
1047− if ((skb && napi_gro_receive(&priv->napi, skb) != GRO_DROP) ||
1048− xdp_result) {
1047+ if (skb)
1048+ napi_gro_receive(&priv->napi, skb);
1049+ if (skb || xdp_result) {
10491050 ndev->stats.rx_packets++;
10501051 ndev->stats.rx_bytes += xdp.data_end - xdp.data;
10511052 }
drivers/net/ethernet/xilinx/xilinx_axienet.h+1−1
@@ -186,7 +186,7 @@ · 185 unmodified lines
186186 #define XAE_RAF_TXVSTRPMODE_MASK 0x00000180 /* Tx VLAN STRIP mode */
187187 #define XAE_RAF_RXVSTRPMODE_MASK 0x00000600 /* Rx VLAN STRIP mode */
188188 #define XAE_RAF_NEWFNCENBL_MASK 0x00000800 /* New function mode */
189−/* Exteneded Multicast Filtering mode */
189+/* Extended Multicast Filtering mode */
190190 #define XAE_RAF_EMULTIFLTRENBL_MASK 0x00001000
191191 #define XAE_RAF_STATSRST_MASK 0x00002000 /* Stats. Counter Reset */
192192 #define XAE_RAF_RXBADFRMEN_MASK 0x00004000 /* Recv Bad Frame Enable */
drivers/net/geneve.c+1−0
@@ -1649,6 +1649,7 @@ static int geneve_changelink(struct net_device *dev, struct nlattr *tb[], · 1648 unmodified lines
16491649 geneve->collect_md = metadata;
16501650 geneve->use_udp6_rx_checksums = use_udp6_rx_checksums;
16511651 geneve->ttl_inherit = ttl_inherit;
1652+ geneve->df = df;
16521653 geneve_unquiesce(geneve, gs4, gs6);
16531654
16541655 return 0;
drivers/net/phy/Kconfig+1−2
@@ -480,8 +480,7 @@ config MICROCHIP_T1_PHY · 479 unmodified lines
480480 config MICROSEMI_PHY
481481 tristate "Microsemi PHYs"
482482 depends on MACSEC || MACSEC=n
483− select CRYPTO_AES
484− select CRYPTO_ECB
483+ select CRYPTO_LIB_AES if MACSEC
485484 help
486485 Currently supports VSC8514, VSC8530, VSC8531, VSC8540 and VSC8541 PHYs
487486
drivers/net/phy/mscc/mscc_macsec.c+9−31
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <linux/phy.h>
1111 #include <dt-bindings/net/mscc-phy-vsc8531.h>
1212
13−#include <crypto/skcipher.h>
13+#include <crypto/aes.h>
1414
1515 #include <net/macsec.h>
1616
@@ -500,39 +500,17 @@ static u32 vsc8584_macsec_flow_context_id(struct macsec_flow *flow) · 483 unmodified lines
500500 static int vsc8584_macsec_derive_key(const u8 key[MACSEC_KEYID_LEN],
501501 u16 key_len, u8 hkey[16])
502502 {
503− struct crypto_skcipher *tfm = crypto_alloc_skcipher("ecb(aes)", 0, 0);
504− struct skcipher_request *req = NULL;
505− struct scatterlist src, dst;
506− DECLARE_CRYPTO_WAIT(wait);
507− u32 input[4] = {0};
503+ const u8 input[AES_BLOCK_SIZE] = {0};
504+ struct crypto_aes_ctx ctx;
508505 int ret;
509506
510− if (IS_ERR(tfm))
511− return PTR_ERR(tfm);
512−
513− req = skcipher_request_alloc(tfm, GFP_KERNEL);
514− if (!req) {
515− ret = -ENOMEM;
516− goto out;
517− }
518−
519− skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG |
520− CRYPTO_TFM_REQ_MAY_SLEEP, crypto_req_done,
521− &wait);
522− ret = crypto_skcipher_setkey(tfm, key, key_len);
523− if (ret < 0)
524− goto out;
525−
526− sg_init_one(&src, input, 16);
527− sg_init_one(&dst, hkey, 16);
528− skcipher_request_set_crypt(req, &src, &dst, 16, NULL);
529−
530− ret = crypto_wait_req(crypto_skcipher_encrypt(req), &wait);
507+ ret = aes_expandkey(&ctx, key, key_len);
508+ if (ret)
509+ return ret;
531510
532−out:
533− skcipher_request_free(req);
534− crypto_free_skcipher(tfm);
535− return ret;
511+ aes_encrypt(&ctx, hkey, input);
512+ memzero_explicit(&ctx, sizeof(ctx));
513+ return 0;
536514 }
537515
538516 static int vsc8584_macsec_transformation(struct phy_device *phydev,
drivers/net/phy/phy.c+1−1
@@ -840,7 +840,7 @@ static void phy_error(struct phy_device *phydev) · 839 unmodified lines
840840 * phy_disable_interrupts - Disable the PHY interrupts from the PHY side
841841 * @phydev: target phy_device struct
842842 */
843−static int phy_disable_interrupts(struct phy_device *phydev)
843+int phy_disable_interrupts(struct phy_device *phydev)
844844 {
845845 int err;
846846
drivers/net/phy/phy_device.c+8−2
@@ -794,8 +794,10 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, · 793 unmodified lines
794794
795795 /* Grab the bits from PHYIR2, and put them in the lower half */
796796 phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
797− if (phy_reg < 0)
798− return -EIO;
797+ if (phy_reg < 0) {
798+ /* returning -ENODEV doesn't stop bus scanning */
799+ return (phy_reg == -EIO || phy_reg == -ENODEV) ? -ENODEV : -EIO;
800+ }
799801
800802 *phy_id |= phy_reg;
801803
@@ -1090,6 +1092,10 @@ int phy_init_hw(struct phy_device *phydev) · 288 unmodified lines
10901092 if (ret < 0)
10911093 return ret;
10921094
1095+ ret = phy_disable_interrupts(phydev);
1096+ if (ret)
1097+ return ret;
1098+
10931099 if (phydev->drv->config_init)
10941100 ret = phydev->drv->config_init(phydev);
10951101
drivers/net/phy/phylink.c+32−13
@@ -1463,6 +1463,8 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl, · 1462 unmodified lines
14631463 struct ethtool_pauseparam *pause)
14641464 {
14651465 struct phylink_link_state *config = &pl->link_config;
1466+ bool manual_changed;
1467+ int pause_state;
14661468
14671469 ASSERT_RTNL();
14681470
@@ -1477,15 +1479,15 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl, · 8 unmodified lines
14771479 !pause->autoneg && pause->rx_pause != pause->tx_pause)
14781480 return -EINVAL;
14791481
1480− mutex_lock(&pl->state_mutex);
1481− config->pause = 0;
1482+ pause_state = 0;
14821483 if (pause->autoneg)
1483− config->pause |= MLO_PAUSE_AN;
1484+ pause_state |= MLO_PAUSE_AN;
14841485 if (pause->rx_pause)
1485− config->pause |= MLO_PAUSE_RX;
1486+ pause_state |= MLO_PAUSE_RX;
14861487 if (pause->tx_pause)
1487− config->pause |= MLO_PAUSE_TX;
1488+ pause_state |= MLO_PAUSE_TX;
14881489
1490+ mutex_lock(&pl->state_mutex);
14891491 /*
14901492 * See the comments for linkmode_set_pause(), wrt the deficiencies
14911493 * with the current implementation. A solution to this issue would
@@ -1502,18 +1504,35 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl, · 10 unmodified lines
15021504 linkmode_set_pause(config->advertising, pause->tx_pause,
15031505 pause->rx_pause);
15041506
1505− /* If we have a PHY, phylib will call our link state function if the
1506− * mode has changed, which will trigger a resolve and update the MAC
1507− * configuration.
1507+ manual_changed = (config->pause ^ pause_state) & MLO_PAUSE_AN ||
1508+ (!(pause_state & MLO_PAUSE_AN) &&
1509+ (config->pause ^ pause_state) & MLO_PAUSE_TXRX_MASK);
1510+
1511+ config->pause = pause_state;
1512+
1513+ if (!pl->phydev && !test_bit(PHYLINK_DISABLE_STOPPED,
1514+ &pl->phylink_disable_state))
1515+ phylink_pcs_config(pl, true, &pl->link_config);
1516+
1517+ mutex_unlock(&pl->state_mutex);
1518+
1519+ /* If we have a PHY, a change of the pause frame advertisement will
1520+ * cause phylib to renegotiate (if AN is enabled) which will in turn
1521+ * call our phylink_phy_change() and trigger a resolve. Note that
1522+ * we can't hold our state mutex while calling phy_set_asym_pause().
15081523 */
1509− if (pl->phydev) {
1524+ if (pl->phydev)
15101525 phy_set_asym_pause(pl->phydev, pause->rx_pause,
15111526 pause->tx_pause);
1512− } else if (!test_bit(PHYLINK_DISABLE_STOPPED,
1513− &pl->phylink_disable_state)) {
1514− phylink_pcs_config(pl, true, &pl->link_config);
1527+
1528+ /* If the manual pause settings changed, make sure we trigger a
1529+ * resolve to update their state; we can not guarantee that the
1530+ * link will cycle.
1531+ */
1532+ if (manual_changed) {
1533+ pl->mac_link_dropped = true;
1534+ phylink_run_resolve(pl);
15151535 }
1516− mutex_unlock(&pl->state_mutex);
15171536
15181537 return 0;
15191538 }
drivers/net/phy/smsc.c+7−4
@@ -122,10 +122,13 @@ static int lan87xx_read_status(struct phy_device *phydev) · 121 unmodified lines
122122 if (rc < 0)
123123 return rc;
124124
125− /* Wait max 640 ms to detect energy */
126− phy_read_poll_timeout(phydev, MII_LAN83C185_CTRL_STATUS, rc,
127− rc & MII_LAN83C185_ENERGYON, 10000,
128− 640000, true);
125+ /* Wait max 640 ms to detect energy and the timeout is not
126+ * an actual error.
127+ */
128+ read_poll_timeout(phy_read, rc,
129+ rc & MII_LAN83C185_ENERGYON || rc < 0,
130+ 10000, 640000, true, phydev,
131+ MII_LAN83C185_CTRL_STATUS);
129132 if (rc < 0)
130133 return rc;
131134
drivers/net/usb/ax88179_178a.c+6−5
@@ -1491,10 +1491,10 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) · 1490 unmodified lines
14911491 }
14921492
14931493 if (pkt_cnt == 0) {
1494− /* Skip IP alignment psudo header */
1495− skb_pull(skb, 2);
14961494 skb->len = pkt_len;
1497− skb_set_tail_pointer(skb, pkt_len);
1495+ /* Skip IP alignment pseudo header */
1496+ skb_pull(skb, 2);
1497+ skb_set_tail_pointer(skb, skb->len);
14981498 skb->truesize = pkt_len + sizeof(struct sk_buff);
14991499 ax88179_rx_checksum(skb, pkt_hdr);
15001500 return 1;
@@ -1503,8 +1503,9 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) · 2 unmodified lines
15031503 ax_skb = skb_clone(skb, GFP_ATOMIC);
15041504 if (ax_skb) {
15051505 ax_skb->len = pkt_len;
1506− ax_skb->data = skb->data + 2;
1507− skb_set_tail_pointer(ax_skb, pkt_len);
1506+ /* Skip IP alignment pseudo header */
1507+ skb_pull(ax_skb, 2);
1508+ skb_set_tail_pointer(ax_skb, ax_skb->len);
15081509 ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
15091510 ax88179_rx_checksum(ax_skb, pkt_hdr);
15101511 usbnet_skb_return(dev, ax_skb);
drivers/net/usb/smsc95xx.c+1−1
@@ -1324,7 +1324,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) · 1323 unmodified lines
13241324 struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
13251325
13261326 if (pdata) {
1327− cancel_delayed_work(&pdata->carrier_check);
1327+ cancel_delayed_work_sync(&pdata->carrier_check);
13281328 netif_dbg(dev, ifdown, dev->net, "free pdata\n");
13291329 kfree(pdata);
13301330 pdata = NULL;
drivers/net/vxlan.c+4−0
@@ -1380,6 +1380,8 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, · 1379 unmodified lines
13801380 struct vxlan_rdst *rd;
13811381
13821382 if (rcu_access_pointer(f->nh)) {
1383+ if (*idx < cb->args[2])
1384+ goto skip_nh;
13831385 err = vxlan_fdb_info(skb, vxlan, f,
13841386 NETLINK_CB(cb->skb).portid,
13851387 cb->nlh->nlmsg_seq,
@@ -1387,6 +1389,8 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, · 1 unmodified line
13871389 NLM_F_MULTI, NULL);
13881390 if (err < 0)
13891391 goto out;
1392+skip_nh:
1393+ *idx += 1;
13901394 continue;
13911395 }
13921396
drivers/net/wireguard/device.c+27−31
@@ -45,17 +45,18 @@ static int wg_open(struct net_device *dev) · 44 unmodified lines
4545 if (dev_v6)
4646 dev_v6->cnf.addr_gen_mode = IN6_ADDR_GEN_MODE_NONE;
4747
48+ mutex_lock(&wg->device_update_lock);
4849 ret = wg_socket_init(wg, wg->incoming_port);
4950 if (ret < 0)
50− return ret;
51− mutex_lock(&wg->device_update_lock);
51+ goto out;
5252 list_for_each_entry(peer, &wg->peer_list, peer_list) {
5353 wg_packet_send_staged_packets(peer);
5454 if (peer->persistent_keepalive_interval)
5555 wg_packet_send_keepalive(peer);
5656 }
57+out:
5758 mutex_unlock(&wg->device_update_lock);
58− return 0;
59+ return ret;
5960 }
6061
6162 #ifdef CONFIG_PM_SLEEP
@@ -225,6 +226,7 @@ static void wg_destruct(struct net_device *dev) · 163 unmodified lines
225226 list_del(&wg->device_list);
226227 rtnl_unlock();
227228 mutex_lock(&wg->device_update_lock);
229+ rcu_assign_pointer(wg->creating_net, NULL);
228230 wg->incoming_port = 0;
229231 wg_socket_reinit(wg, NULL, NULL);
230232 /* The final references are cleared in the below calls to destroy_workqueue. */
@@ -240,13 +242,11 @@ static void wg_destruct(struct net_device *dev) · 9 unmodified lines
240242 skb_queue_purge(&wg->incoming_handshakes);
241243 free_percpu(dev->tstats);
242244 free_percpu(wg->incoming_handshakes_worker);
243− if (wg->have_creating_net_ref)
244− put_net(wg->creating_net);
245245 kvfree(wg->index_hashtable);
246246 kvfree(wg->peer_hashtable);
247247 mutex_unlock(&wg->device_update_lock);
248248
249− pr_debug("%s: Interface deleted\n", dev->name);
249+ pr_debug("%s: Interface destroyed\n", dev->name);
250250 free_netdev(dev);
251251 }
252252
@@ -292,7 +292,7 @@ static int wg_newlink(struct net *src_net, struct net_device *dev, · 39 unmodified lines
292292 struct wg_device *wg = netdev_priv(dev);
293293 int ret = -ENOMEM;
294294
295− wg->creating_net = src_net;
295+ rcu_assign_pointer(wg->creating_net, src_net);
296296 init_rwsem(&wg->static_identity.lock);
297297 mutex_init(&wg->socket_update_lock);
298298 mutex_init(&wg->device_update_lock);
@@ -393,30 +393,26 @@ static struct rtnl_link_ops link_ops __read_mostly = { · 94 unmodified lines
393393 .newlink = wg_newlink,
394394 };
395395
396−static int wg_netdevice_notification(struct notifier_block *nb,
397− unsigned long action, void *data)
396+static void wg_netns_pre_exit(struct net *net)
398397 {
399− struct net_device *dev = ((struct netdev_notifier_info *)data)->dev;
400− struct wg_device *wg = netdev_priv(dev);
401−
402− ASSERT_RTNL();
403−
404− if (action != NETDEV_REGISTER || dev->netdev_ops != &netdev_ops)
405− return 0;
398+ struct wg_device *wg;
406399
407− if (dev_net(dev) == wg->creating_net && wg->have_creating_net_ref) {
408− put_net(wg->creating_net);
409− wg->have_creating_net_ref = false;
410− } else if (dev_net(dev) != wg->creating_net &&
411− !wg->have_creating_net_ref) {
412− wg->have_creating_net_ref = true;
413− get_net(wg->creating_net);
400+ rtnl_lock();
401+ list_for_each_entry(wg, &device_list, device_list) {
402+ if (rcu_access_pointer(wg->creating_net) == net) {
403+ pr_debug("%s: Creating namespace exiting\n", wg->dev->name);
404+ netif_carrier_off(wg->dev);
405+ mutex_lock(&wg->device_update_lock);
406+ rcu_assign_pointer(wg->creating_net, NULL);
407+ wg_socket_reinit(wg, NULL, NULL);
408+ mutex_unlock(&wg->device_update_lock);
409+ }
414410 }
415− return 0;
411+ rtnl_unlock();
416412 }
417413
418−static struct notifier_block netdevice_notifier = {
419− .notifier_call = wg_netdevice_notification
414+static struct pernet_operations pernet_ops = {
415+ .pre_exit = wg_netns_pre_exit
420416 };
421417
422418 int __init wg_device_init(void)
@@ -429,18 +425,18 @@ int __init wg_device_init(void) · 6 unmodified lines
429425 return ret;
430426 #endif
431427
432− ret = register_netdevice_notifier(&netdevice_notifier);
428+ ret = register_pernet_device(&pernet_ops);
433429 if (ret)
434430 goto error_pm;
435431
436432 ret = rtnl_link_register(&link_ops);
437433 if (ret)
438− goto error_netdevice;
434+ goto error_pernet;
439435
440436 return 0;
441437
442−error_netdevice:
443− unregister_netdevice_notifier(&netdevice_notifier);
438+error_pernet:
439+ unregister_pernet_device(&pernet_ops);
444440 error_pm:
445441 #ifdef CONFIG_PM_SLEEP
446442 unregister_pm_notifier(&pm_notifier);
@@ -451,7 +447,7 @@ error_pm: · 4 unmodified lines
451447 void wg_device_uninit(void)
452448 {
453449 rtnl_link_unregister(&link_ops);
454− unregister_netdevice_notifier(&netdevice_notifier);
450+ unregister_pernet_device(&pernet_ops);
455451 #ifdef CONFIG_PM_SLEEP
456452 unregister_pm_notifier(&pm_notifier);
457453 #endif
drivers/net/wireguard/device.h+1−2
@@ -40,7 +40,7 @@ struct wg_device { · 39 unmodified lines
4040 struct net_device *dev;
4141 struct crypt_queue encrypt_queue, decrypt_queue;
4242 struct sock __rcu *sock4, *sock6;
43− struct net *creating_net;
43+ struct net __rcu *creating_net;
4444 struct noise_static_identity static_identity;
4545 struct workqueue_struct *handshake_receive_wq, *handshake_send_wq;
4646 struct workqueue_struct *packet_crypt_wq;
@@ -56,7 +56,6 @@ struct wg_device { · 9 unmodified lines
5656 unsigned int num_peers, device_update_gen;
5757 u32 fwmark;
5858 u16 incoming_port;
59− bool have_creating_net_ref;
6059 };
6160
6261 int wg_device_init(void);
drivers/net/wireguard/netlink.c+9−5
@@ -511,11 +511,15 @@ static int wg_set_device(struct sk_buff *skb, struct genl_info *info) · 510 unmodified lines
511511 if (flags & ~__WGDEVICE_F_ALL)
512512 goto out;
513513
514− ret = -EPERM;
515− if ((info->attrs[WGDEVICE_A_LISTEN_PORT] ||
516− info->attrs[WGDEVICE_A_FWMARK]) &&
517− !ns_capable(wg->creating_net->user_ns, CAP_NET_ADMIN))
518− goto out;
514+ if (info->attrs[WGDEVICE_A_LISTEN_PORT] || info->attrs[WGDEVICE_A_FWMARK]) {
515+ struct net *net;
516+ rcu_read_lock();
517+ net = rcu_dereference(wg->creating_net);
518+ ret = !net || !ns_capable(net->user_ns, CAP_NET_ADMIN) ? -EPERM : 0;
519+ rcu_read_unlock();
520+ if (ret)
521+ goto out;
522+ }
519523
520524 ++wg->device_update_gen;
521525
drivers/net/wireguard/noise.c+2−2
@@ -617,8 +617,8 @@ wg_noise_handshake_consume_initiation(struct message_handshake_initiation *src, · 616 unmodified lines
617617 memcpy(handshake->hash, hash, NOISE_HASH_LEN);
618618 memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN);
619619 handshake->remote_index = src->sender_index;
620− if ((s64)(handshake->last_initiation_consumption -
621− (initiation_consumption = ktime_get_coarse_boottime_ns())) < 0)
620+ initiation_consumption = ktime_get_coarse_boottime_ns();
621+ if ((s64)(handshake->last_initiation_consumption - initiation_consumption) < 0)
622622 handshake->last_initiation_consumption = initiation_consumption;
623623 handshake->state = HANDSHAKE_CONSUMED_INITIATION;
624624 up_write(&handshake->lock);
drivers/net/wireguard/receive.c+2−8
@@ -414,14 +414,8 @@ static void wg_packet_consume_data_done(struct wg_peer *peer, · 413 unmodified lines
414414 if (unlikely(routed_peer != peer))
415415 goto dishonest_packet_peer;
416416
417− if (unlikely(napi_gro_receive(&peer->napi, skb) == GRO_DROP)) {
418− ++dev->stats.rx_dropped;
419− net_dbg_ratelimited("%s: Failed to give packet to userspace from peer %llu (%pISpfsc)\n",
420− dev->name, peer->internal_id,
421− &peer->endpoint.addr);
422− } else {
423− update_rx_stats(peer, message_data_len(len_before_trim));
424− }
417+ napi_gro_receive(&peer->napi, skb);
418+ update_rx_stats(peer, message_data_len(len_before_trim));
425419 return;
426420
427421 dishonest_packet_peer:
drivers/net/wireguard/socket.c+18−7
@@ -347,6 +347,7 @@ static void set_sock_opts(struct socket *sock) · 346 unmodified lines
347347
348348 int wg_socket_init(struct wg_device *wg, u16 port)
349349 {
350+ struct net *net;
350351 int ret;
351352 struct udp_tunnel_sock_cfg cfg = {
352353 .sk_user_data = wg,
@@ -371,37 +372,47 @@ int wg_socket_init(struct wg_device *wg, u16 port) · 18 unmodified lines
371372 };
372373 #endif
373374
375+ rcu_read_lock();
376+ net = rcu_dereference(wg->creating_net);
377+ net = net ? maybe_get_net(net) : NULL;
378+ rcu_read_unlock();
379+ if (unlikely(!net))
380+ return -ENONET;
381+
374382 #if IS_ENABLED(CONFIG_IPV6)
375383 retry:
376384 #endif
377385
378− ret = udp_sock_create(wg->creating_net, &port4, &new4);
386+ ret = udp_sock_create(net, &port4, &new4);
379387 if (ret < 0) {
380388 pr_err("%s: Could not create IPv4 socket\n", wg->dev->name);
381− return ret;
389+ goto out;
382390 }
383391 set_sock_opts(new4);
384− setup_udp_tunnel_sock(wg->creating_net, new4, &cfg);
392+ setup_udp_tunnel_sock(net, new4, &cfg);
385393
386394 #if IS_ENABLED(CONFIG_IPV6)
387395 if (ipv6_mod_enabled()) {
388396 port6.local_udp_port = inet_sk(new4->sk)->inet_sport;
389− ret = udp_sock_create(wg->creating_net, &port6, &new6);
397+ ret = udp_sock_create(net, &port6, &new6);
390398 if (ret < 0) {
391399 udp_tunnel_sock_release(new4);
392400 if (ret == -EADDRINUSE && !port && retries++ < 100)
393401 goto retry;
394402 pr_err("%s: Could not create IPv6 socket\n",
395403 wg->dev->name);
396− return ret;
404+ goto out;
397405 }
398406 set_sock_opts(new6);
399− setup_udp_tunnel_sock(wg->creating_net, new6, &cfg);
407+ setup_udp_tunnel_sock(net, new6, &cfg);
400408 }
401409 #endif
402410
403411 wg_socket_reinit(wg, new4->sk, new6 ? new6->sk : NULL);
404− return 0;
412+ ret = 0;
413+out:
414+ put_net(net);
415+ return ret;
405416 }
406417
407418 void wg_socket_reinit(struct wg_device *wg, struct sock *new4,
drivers/net/wireless/ath/wil6210/txrx.c+11−28
@@ -897,7 +897,6 @@ static void wil_rx_handle_eapol(struct wil6210_vif *vif, struct sk_buff *skb) · 896 unmodified lines
897897 void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid,
898898 struct wil_net_stats *stats, bool gro)
899899 {
900− gro_result_t rc = GRO_NORMAL;
901900 struct wil6210_vif *vif = ndev_to_vif(ndev);
902901 struct wil6210_priv *wil = ndev_to_wil(ndev);
903902 struct wireless_dev *wdev = vif_to_wdev(vif);
@@ -908,22 +907,16 @@ void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid, · 4 unmodified lines
908907 */
909908 int mcast = is_multicast_ether_addr(da);
910909 struct sk_buff *xmit_skb = NULL;
911− static const char * const gro_res_str[] = {
912− [GRO_MERGED] = "GRO_MERGED",
913− [GRO_MERGED_FREE] = "GRO_MERGED_FREE",
914− [GRO_HELD] = "GRO_HELD",
915− [GRO_NORMAL] = "GRO_NORMAL",
916− [GRO_DROP] = "GRO_DROP",
917− [GRO_CONSUMED] = "GRO_CONSUMED",
918− };
919910
920911 if (wdev->iftype == NL80211_IFTYPE_STATION) {
921912 sa = wil_skb_get_sa(skb);
922913 if (mcast && ether_addr_equal(sa, ndev->dev_addr)) {
923914 /* mcast packet looped back to us */
924− rc = GRO_DROP;
925915 dev_kfree_skb(skb);
926− goto stats;
916+ ndev->stats.rx_dropped++;
917+ stats->rx_dropped++;
918+ wil_dbg_txrx(wil, "Rx drop %d bytes\n", len);
919+ return;
927920 }
928921 } else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) {
929922 if (mcast) {
@@ -967,26 +960,16 @@ void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid, · 37 unmodified lines
967960 wil_rx_handle_eapol(vif, skb);
968961
969962 if (gro)
970− rc = napi_gro_receive(&wil->napi_rx, skb);
963+ napi_gro_receive(&wil->napi_rx, skb);
971964 else
972965 netif_rx_ni(skb);
973− wil_dbg_txrx(wil, "Rx complete %d bytes => %s\n",
974− len, gro_res_str[rc]);
975− }
976−stats:
977− /* statistics. rc set to GRO_NORMAL for AP bridging */
978− if (unlikely(rc == GRO_DROP)) {
979− ndev->stats.rx_dropped++;
980− stats->rx_dropped++;
981− wil_dbg_txrx(wil, "Rx drop %d bytes\n", len);
982− } else {
983− ndev->stats.rx_packets++;
984− stats->rx_packets++;
985− ndev->stats.rx_bytes += len;
986− stats->rx_bytes += len;
987− if (mcast)
988− ndev->stats.multicast++;
989966 }
967+ ndev->stats.rx_packets++;
968+ stats->rx_packets++;
969+ ndev->stats.rx_bytes += len;
970+ stats->rx_bytes += len;
971+ if (mcast)
972+ ndev->stats.multicast++;
990973 }
991974
992975 void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
drivers/nvdimm/region_devs.c+2−12
@@ -679,18 +679,8 @@ static umode_t region_visible(struct kobject *kobj, struct attribute *a, int n) · 678 unmodified lines
679679 return a->mode;
680680 }
681681
682− if (a == &dev_attr_align.attr) {
683− int i;
684−
685− for (i = 0; i < nd_region->ndr_mappings; i++) {
686− struct nd_mapping *nd_mapping = &nd_region->mapping[i];
687− struct nvdimm *nvdimm = nd_mapping->nvdimm;
688−
689− if (test_bit(NDD_LABELING, &nvdimm->flags))
690− return a->mode;
691− }
692− return 0;
693− }
682+ if (a == &dev_attr_align.attr)
683+ return a->mode;
694684
695685 if (a != &dev_attr_set_cookie.attr
696686 && a != &dev_attr_available_size.attr)
drivers/nvme/host/core.c+10−4
@@ -1116,10 +1116,16 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, · 1115 unmodified lines
11161116 dev_warn(ctrl->device,
11171117 "Identify Descriptors failed (%d)\n", status);
11181118 /*
1119− * Don't treat an error as fatal, as we potentially already
1120− * have a NGUID or EUI-64.
1119+ * Don't treat non-retryable errors as fatal, as we potentially
1120+ * already have a NGUID or EUI-64. If we failed with DNR set,
1121+ * we want to silently ignore the error as we can still
1122+ * identify the device, but if the status has DNR set, we want
1123+ * to propagate the error back specifically for the disk
1124+ * revalidation flow to make sure we don't abandon the
1125+ * device just because of a temporal retry-able error (such
1126+ * as path of transport errors).
11211127 */
1122− if (status > 0 && !(status & NVME_SC_DNR))
1128+ if (status > 0 && (status & NVME_SC_DNR))
11231129 status = 0;
11241130 goto free_data;
11251131 }
@@ -1974,7 +1980,6 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) · 848 unmodified lines
19741980 if (ns->head->disk) {
19751981 nvme_update_disk_info(ns->head->disk, ns, id);
19761982 blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
1977− revalidate_disk(ns->head->disk);
19781983 }
19791984 #endif
19801985 return 0;
@@ -4174,6 +4179,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev, · 2193 unmodified lines
41744179 ctrl->dev = dev;
41754180 ctrl->ops = ops;
41764181 ctrl->quirks = quirks;
4182+ ctrl->numa_node = NUMA_NO_NODE;
41774183 INIT_WORK(&ctrl->scan_work, nvme_scan_work);
41784184 INIT_WORK(&ctrl->async_event_work, nvme_async_event_work);
41794185 INIT_WORK(&ctrl->fw_act_work, nvme_fw_act_work);
drivers/nvme/host/multipath.c+33−20
@@ -409,15 +409,14 @@ static void nvme_mpath_set_live(struct nvme_ns *ns) · 408 unmodified lines
409409 {
410410 struct nvme_ns_head *head = ns->head;
411411
412− lockdep_assert_held(&ns->head->lock);
413−
414412 if (!head->disk)
415413 return;
416414
417− if (!(head->disk->flags & GENHD_FL_UP))
415+ if (!test_and_set_bit(NVME_NSHEAD_DISK_LIVE, &head->flags))
418416 device_add_disk(&head->subsys->dev, head->disk,
419417 nvme_ns_id_attr_groups);
420418
419+ mutex_lock(&head->lock);
421420 if (nvme_path_is_optimized(ns)) {
422421 int node, srcu_idx;
423422
@@ -426,9 +425,10 @@ static void nvme_mpath_set_live(struct nvme_ns *ns) · 2 unmodified lines
426425 __nvme_find_path(head, node);
427426 srcu_read_unlock(&head->srcu, srcu_idx);
428427 }
428+ mutex_unlock(&head->lock);
429429
430− synchronize_srcu(&ns->head->srcu);
431− kblockd_schedule_work(&ns->head->requeue_work);
430+ synchronize_srcu(&head->srcu);
431+ kblockd_schedule_work(&head->requeue_work);
432432 }
433433
434434 static int nvme_parse_ana_log(struct nvme_ctrl *ctrl, void *data,
@@ -483,14 +483,12 @@ static inline bool nvme_state_is_live(enum nvme_ana_state state) · 48 unmodified lines
483483 static void nvme_update_ns_ana_state(struct nvme_ana_group_desc *desc,
484484 struct nvme_ns *ns)
485485 {
486− mutex_lock(&ns->head->lock);
487486 ns->ana_grpid = le32_to_cpu(desc->grpid);
488487 ns->ana_state = desc->state;
489488 clear_bit(NVME_NS_ANA_PENDING, &ns->flags);
490489
491490 if (nvme_state_is_live(ns->ana_state))
492491 nvme_mpath_set_live(ns);
493− mutex_unlock(&ns->head->lock);
494492 }
495493
496494 static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
@@ -640,38 +638,45 @@ static ssize_t ana_state_show(struct device *dev, struct device_attribute *attr, · 143 unmodified lines
640638 }
641639 DEVICE_ATTR_RO(ana_state);
642640
643−static int nvme_set_ns_ana_state(struct nvme_ctrl *ctrl,
641+static int nvme_lookup_ana_group_desc(struct nvme_ctrl *ctrl,
644642 struct nvme_ana_group_desc *desc, void *data)
645643 {
646− struct nvme_ns *ns = data;
644+ struct nvme_ana_group_desc *dst = data;
647645
648− if (ns->ana_grpid == le32_to_cpu(desc->grpid)) {
649− nvme_update_ns_ana_state(desc, ns);
650− return -ENXIO; /* just break out of the loop */
651− }
646+ if (desc->grpid != dst->grpid)
647+ return 0;
652648
653− return 0;
649+ *dst = *desc;
650+ return -ENXIO; /* just break out of the loop */
654651 }
655652
656653 void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id)
657654 {
658655 if (nvme_ctrl_use_ana(ns->ctrl)) {
656+ struct nvme_ana_group_desc desc = {
657+ .grpid = id->anagrpid,
658+ .state = 0,
659+ };
660+
659661 mutex_lock(&ns->ctrl->ana_lock);
660662 ns->ana_grpid = le32_to_cpu(id->anagrpid);
661− nvme_parse_ana_log(ns->ctrl, ns, nvme_set_ns_ana_state);
663+ nvme_parse_ana_log(ns->ctrl, &desc, nvme_lookup_ana_group_desc);
662664 mutex_unlock(&ns->ctrl->ana_lock);
665+ if (desc.state) {
666+ /* found the group desc: update */
667+ nvme_update_ns_ana_state(&desc, ns);
668+ }
663669 } else {
664− mutex_lock(&ns->head->lock);
665670 ns->ana_state = NVME_ANA_OPTIMIZED;
666671 nvme_mpath_set_live(ns);
667− mutex_unlock(&ns->head->lock);
668672 }
669673
670674 if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
671− struct backing_dev_info *info =
672− ns->head->disk->queue->backing_dev_info;
675+ struct gendisk *disk = ns->head->disk;
673676
674− info->capabilities |= BDI_CAP_STABLE_WRITES;
677+ if (disk)
678+ disk->queue->backing_dev_info->capabilities |=
679+ BDI_CAP_STABLE_WRITES;
675680 }
676681 }
677682
@@ -686,6 +691,14 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head) · 8 unmodified lines
686691 kblockd_schedule_work(&head->requeue_work);
687692 flush_work(&head->requeue_work);
688693 blk_cleanup_queue(head->disk->queue);
694+ if (!test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
695+ /*
696+ * if device_add_disk wasn't called, prevent
697+ * disk release to put a bogus reference on the
698+ * request queue
699+ */
700+ head->disk->queue = NULL;
701+ }
689702 put_disk(head->disk);
690703 }
691704
drivers/nvme/host/nvme.h+2−0
@@ -364,6 +364,8 @@ struct nvme_ns_head { · 363 unmodified lines
364364 spinlock_t requeue_lock;
365365 struct work_struct requeue_work;
366366 struct mutex lock;
367+ unsigned long flags;
368+#define NVME_NSHEAD_DISK_LIVE 0
367369 struct nvme_ns __rcu *current_path[];
368370 #endif
369371 };
drivers/nvme/host/pci.c+4−2
@@ -1593,7 +1593,7 @@ static int nvme_alloc_admin_tags(struct nvme_dev *dev) · 1592 unmodified lines
15931593
15941594 dev->admin_tagset.queue_depth = NVME_AQ_MQ_TAG_DEPTH;
15951595 dev->admin_tagset.timeout = ADMIN_TIMEOUT;
1596− dev->admin_tagset.numa_node = dev_to_node(dev->dev);
1596+ dev->admin_tagset.numa_node = dev->ctrl.numa_node;
15971597 dev->admin_tagset.cmd_size = sizeof(struct nvme_iod);
15981598 dev->admin_tagset.flags = BLK_MQ_F_NO_SCHED;
15991599 dev->admin_tagset.driver_data = dev;
@@ -1669,6 +1669,8 @@ static int nvme_pci_configure_admin_queue(struct nvme_dev *dev) · 69 unmodified lines
16691669 if (result)
16701670 return result;
16711671
1672+ dev->ctrl.numa_node = dev_to_node(dev->dev);
1673+
16721674 nvmeq = &dev->queues[0];
16731675 aqa = nvmeq->q_depth - 1;
16741676 aqa |= aqa << 16;
@@ -2257,7 +2259,7 @@ static void nvme_dev_add(struct nvme_dev *dev) · 582 unmodified lines
22572259 if (dev->io_queues[HCTX_TYPE_POLL])
22582260 dev->tagset.nr_maps++;
22592261 dev->tagset.timeout = NVME_IO_TIMEOUT;
2260− dev->tagset.numa_node = dev_to_node(dev->dev);
2262+ dev->tagset.numa_node = dev->ctrl.numa_node;
22612263 dev->tagset.queue_depth =
22622264 min_t(int, dev->q_depth, BLK_MQ_MAX_DEPTH) - 1;
22632265 dev->tagset.cmd_size = sizeof(struct nvme_iod);
drivers/nvme/host/rdma.c+1−1
@@ -470,7 +470,7 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue) · 469 unmodified lines
470470 * Spread I/O queues completion vectors according their queue index.
471471 * Admin queues can always go on completion vector 0.
472472 */
473− comp_vector = idx == 0 ? idx : idx - 1;
473+ comp_vector = (idx == 0 ? idx : idx - 1) % ibdev->num_comp_vectors;
474474
475475 /* Polling queues need direct cq polling context */
476476 if (nvme_rdma_poll_queue(queue))
drivers/nvme/host/tcp.c+2−2
@@ -1532,7 +1532,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, · 1531 unmodified lines
15321532 set->ops = &nvme_tcp_admin_mq_ops;
15331533 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;
15341534 set->reserved_tags = 2; /* connect + keep-alive */
1535− set->numa_node = NUMA_NO_NODE;
1535+ set->numa_node = nctrl->numa_node;
15361536 set->flags = BLK_MQ_F_BLOCKING;
15371537 set->cmd_size = sizeof(struct nvme_tcp_request);
15381538 set->driver_data = ctrl;
@@ -1544,7 +1544,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, · 5 unmodified lines
15441544 set->ops = &nvme_tcp_mq_ops;
15451545 set->queue_depth = nctrl->sqsize + 1;
15461546 set->reserved_tags = 1; /* fabric connect */
1547− set->numa_node = NUMA_NO_NODE;
1547+ set->numa_node = nctrl->numa_node;
15481548 set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;
15491549 set->cmd_size = sizeof(struct nvme_tcp_request);
15501550 set->driver_data = ctrl;
drivers/nvme/target/loop.c+2−2
@@ -340,7 +340,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl) · 339 unmodified lines
340340 ctrl->admin_tag_set.ops = &nvme_loop_admin_mq_ops;
341341 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;
342342 ctrl->admin_tag_set.reserved_tags = 2; /* connect + keep-alive */
343− ctrl->admin_tag_set.numa_node = NUMA_NO_NODE;
343+ ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;
344344 ctrl->admin_tag_set.cmd_size = sizeof(struct nvme_loop_iod) +
345345 NVME_INLINE_SG_CNT * sizeof(struct scatterlist);
346346 ctrl->admin_tag_set.driver_data = ctrl;
@@ -512,7 +512,7 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl) · 165 unmodified lines
512512 ctrl->tag_set.ops = &nvme_loop_mq_ops;
513513 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size;
514514 ctrl->tag_set.reserved_tags = 1; /* fabric connect */
515− ctrl->tag_set.numa_node = NUMA_NO_NODE;
515+ ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;
516516 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
517517 ctrl->tag_set.cmd_size = sizeof(struct nvme_loop_iod) +
518518 NVME_INLINE_SG_CNT * sizeof(struct scatterlist);
drivers/of/of_mdio.c+7−2
@@ -314,10 +314,15 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) · 313 unmodified lines
314314 child, addr);
315315
316316 if (of_mdiobus_child_is_phy(child)) {
317+ /* -ENODEV is the return code that PHYLIB has
318+ * standardized on to indicate that bus
319+ * scanning should continue.
320+ */
317321 rc = of_mdiobus_register_phy(mdio, child, addr);
318− if (rc && rc != -ENODEV)
322+ if (!rc)
323+ break;
324+ if (rc != -ENODEV)
319325 goto unregister;
320− break;
321326 }
322327 }
323328 }
drivers/oprofile/cpu_buffer.h+1−1
@@ -33,7 +33,7 @@ void flush_cpu_work(void); · 32 unmodified lines
3333 struct op_sample {
3434 unsigned long eip;
3535 unsigned long event;
36− unsigned long data[0];
36+ unsigned long data[];
3737 };
3838
3939 struct op_entry;
drivers/phy/samsung/phy-samsung-usb2.h+1−1
@@ -43,7 +43,7 @@ struct samsung_usb2_phy_driver { · 42 unmodified lines
4343 struct regmap *reg_pmu;
4444 struct regmap *reg_sys;
4545 spinlock_t lock;
46− struct samsung_usb2_phy_instance instances[0];
46+ struct samsung_usb2_phy_instance instances[];
4747 };
4848
4949 struct samsung_usb2_common_phy {
drivers/pinctrl/freescale/pinctrl-imx.c+3−4
@@ -824,13 +824,12 @@ int imx_pinctrl_probe(struct platform_device *pdev, · 823 unmodified lines
824824 return -EINVAL;
825825 }
826826
827− ipctl->input_sel_base = devm_of_iomap(&pdev->dev, np,
828− 0, NULL);
827+ ipctl->input_sel_base = of_iomap(np, 0);
829828 of_node_put(np);
830− if (IS_ERR(ipctl->input_sel_base)) {
829+ if (!ipctl->input_sel_base) {
831830 dev_err(&pdev->dev,
832831 "iomuxc input select base address not found\n");
833− return PTR_ERR(ipctl->input_sel_base);
832+ return -ENOMEM;
834833 }
835834 }
836835 }
drivers/pinctrl/pinctrl-mcp23s08_spi.c+1−4
@@ -126,10 +126,7 @@ static int mcp23s08_spi_regmap_init(struct mcp23s08 *mcp, struct device *dev, · 125 unmodified lines
126126 copy->name = name;
127127
128128 mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, copy);
129− if (IS_ERR(mcp->regmap))
130− return PTR_ERR(mcp->regmap);
131−
132− return 0;
129+ return PTR_ERR_OR_ZERO(mcp->regmap);
133130 }
134131
135132 static int mcp23s08_probe(struct spi_device *spi)
drivers/pinctrl/pinctrl-single.c+1−1
@@ -958,7 +958,7 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np, · 957 unmodified lines
958958 }
959959
960960 /**
961− * smux_parse_one_pinctrl_entry() - parses a device tree mux entry
961+ * pcs_parse_one_pinctrl_entry() - parses a device tree mux entry
962962 * @pctldev: pin controller device
963963 * @pcs: pinctrl driver instance
964964 * @np: device node of the mux entry
drivers/pinctrl/qcom/pinctrl-ipq6018.c+2−1
@@ -367,7 +367,8 @@ static const char * const wci20_groups[] = { · 366 unmodified lines
367367
368368 static const char * const qpic_pad_groups[] = {
369369 "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio9", "gpio10",
370− "gpio11", "gpio17",
370+ "gpio11", "gpio17", "gpio15", "gpio12", "gpio13", "gpio14", "gpio5",
371+ "gpio6", "gpio7", "gpio8",
371372 };
372373
373374 static const char * const burn0_groups[] = {
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c+10−11
@@ -170,6 +170,7 @@ struct pmic_gpio_state { · 169 unmodified lines
170170 struct regmap *map;
171171 struct pinctrl_dev *ctrl;
172172 struct gpio_chip chip;
173+ struct irq_chip irq;
173174 };
174175
175176 static const struct pinconf_generic_params pmic_gpio_bindings[] = {
@@ -917,16 +918,6 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state, · 741 unmodified lines
917918 return 0;
918919 }
919920
920−static struct irq_chip pmic_gpio_irq_chip = {
921− .name = "spmi-gpio",
922− .irq_ack = irq_chip_ack_parent,
923− .irq_mask = irq_chip_mask_parent,
924− .irq_unmask = irq_chip_unmask_parent,
925− .irq_set_type = irq_chip_set_type_parent,
926− .irq_set_wake = irq_chip_set_wake_parent,
927− .flags = IRQCHIP_MASK_ON_SUSPEND,
928−};
929−
930921 static int pmic_gpio_domain_translate(struct irq_domain *domain,
931922 struct irq_fwspec *fwspec,
932923 unsigned long *hwirq,
@@ -1053,8 +1044,16 @@ static int pmic_gpio_probe(struct platform_device *pdev) · 120 unmodified lines
10531044 if (!parent_domain)
10541045 return -ENXIO;
10551046
1047+ state->irq.name = "spmi-gpio",
1048+ state->irq.irq_ack = irq_chip_ack_parent,
1049+ state->irq.irq_mask = irq_chip_mask_parent,
1050+ state->irq.irq_unmask = irq_chip_unmask_parent,
1051+ state->irq.irq_set_type = irq_chip_set_type_parent,
1052+ state->irq.irq_set_wake = irq_chip_set_wake_parent,
1053+ state->irq.flags = IRQCHIP_MASK_ON_SUSPEND,
1054+
10561055 girq = &state->chip.irq;
1057− girq->chip = &pmic_gpio_irq_chip;
1056+ girq->chip = &state->irq;
10581057 girq->default_type = IRQ_TYPE_NONE;
10591058 girq->handler = handle_level_irq;
10601059 girq->fwnode = of_node_to_fwnode(state->dev->of_node);
drivers/pinctrl/tegra/pinctrl-tegra.c+2−2
@@ -731,8 +731,8 @@ static int tegra_pinctrl_resume(struct device *dev) · 730 unmodified lines
731731 }
732732
733733 const struct dev_pm_ops tegra_pinctrl_pm = {
734− .suspend = &tegra_pinctrl_suspend,
735− .resume = &tegra_pinctrl_resume
734+ .suspend_noirq = &tegra_pinctrl_suspend,
735+ .resume_noirq = &tegra_pinctrl_resume
736736 };
737737
738738 static bool tegra_pinctrl_gpio_node_has_range(struct tegra_pmx *pmx)
drivers/rapidio/rio-scan.c+1−1
@@ -39,7 +39,7 @@ struct rio_id_table { · 38 unmodified lines
3939 u16 start; /* logical minimal id */
4040 u32 max; /* max number of IDs in table */
4141 spinlock_t lock;
42− unsigned long table[0];
42+ unsigned long table[];
4343 };
4444
4545 static int next_destid = 0;
drivers/regulator/Kconfig+1−1
@@ -684,7 +684,7 @@ config REGULATOR_MT6323 · 683 unmodified lines
684684
685685 config REGULATOR_MT6358
686686 tristate "MediaTek MT6358 PMIC"
687− depends on MFD_MT6397 && BROKEN
687+ depends on MFD_MT6397
688688 help
689689 Say y here to select this option to enable the power regulator of
690690 MediaTek MT6358 PMIC.
drivers/regulator/da9063-regulator.c+0−1
@@ -512,7 +512,6 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { · 511 unmodified lines
512512 },
513513 {
514514 DA9063_LDO(DA9063, LDO9, 950, 50, 3600),
515− .suspend = BFIELD(DA9063_REG_LDO9_CONT, DA9063_VLDO9_SEL),
516515 },
517516 {
518517 DA9063_LDO(DA9063, LDO11, 900, 50, 3600),
drivers/regulator/helpers.c+1−1
@@ -486,7 +486,7 @@ int regulator_map_voltage_pickable_linear_range(struct regulator_dev *rdev, · 485 unmodified lines
486486 continue;
487487 }
488488
489− ret = selector + sel;
489+ ret = selector + sel - range->min_sel;
490490
491491 voltage = rdev->desc->ops->list_voltage(rdev, ret);
492492
drivers/regulator/pfuze100-regulator.c+39−21
@@ -209,6 +209,19 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = { · 208 unmodified lines
209209
210210 };
211211
212+static const struct regulator_ops pfuze3000_sw_regulator_ops = {
213+ .enable = regulator_enable_regmap,
214+ .disable = regulator_disable_regmap,
215+ .is_enabled = regulator_is_enabled_regmap,
216+ .list_voltage = regulator_list_voltage_table,
217+ .map_voltage = regulator_map_voltage_ascend,
218+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
219+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
220+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
221+ .set_ramp_delay = pfuze100_set_ramp_delay,
222+
223+};
224+
212225 #define PFUZE100_FIXED_REG(_chip, _name, base, voltage) \
213226 [_chip ## _ ## _name] = { \
214227 .desc = { \
@@ -318,23 +331,28 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = { · 103 unmodified lines
318331 .stby_mask = 0x20, \
319332 }
320333
321−
322−#define PFUZE3000_SW2_REG(_chip, _name, base, min, max, step) { \
323− .desc = { \
324− .name = #_name,\
325− .n_voltages = ((max) - (min)) / (step) + 1, \
326− .ops = &pfuze100_sw_regulator_ops, \
327− .type = REGULATOR_VOLTAGE, \
328− .id = _chip ## _ ## _name, \
329− .owner = THIS_MODULE, \
330− .min_uV = (min), \
331− .uV_step = (step), \
332− .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
333− .vsel_mask = 0x7, \
334− }, \
335− .stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \
336− .stby_mask = 0x7, \
337−}
334+/* No linar case for the some switches of PFUZE3000 */
335+#define PFUZE3000_SW_REG(_chip, _name, base, mask, voltages) \
336+ [_chip ## _ ## _name] = { \
337+ .desc = { \
338+ .name = #_name, \
339+ .n_voltages = ARRAY_SIZE(voltages), \
340+ .ops = &pfuze3000_sw_regulator_ops, \
341+ .type = REGULATOR_VOLTAGE, \
342+ .id = _chip ## _ ## _name, \
343+ .owner = THIS_MODULE, \
344+ .volt_table = voltages, \
345+ .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
346+ .vsel_mask = (mask), \
347+ .enable_reg = (base) + PFUZE100_MODE_OFFSET, \
348+ .enable_mask = 0xf, \
349+ .enable_val = 0x8, \
350+ .enable_time = 500, \
351+ }, \
352+ .stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \
353+ .stby_mask = (mask), \
354+ .sw_reg = true, \
355+ }
338356
339357 #define PFUZE3000_SW3_REG(_chip, _name, base, min, max, step) { \
340358 .desc = { \
@@ -391,9 +409,9 @@ static struct pfuze_regulator pfuze200_regulators[] = { · 50 unmodified lines
391409 };
392410
393411 static struct pfuze_regulator pfuze3000_regulators[] = {
394− PFUZE100_SWB_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
412+ PFUZE3000_SW_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
395413 PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000),
396− PFUZE100_SWB_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
414+ PFUZE3000_SW_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
397415 PFUZE3000_SW3_REG(PFUZE3000, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),
398416 PFUZE100_SWB_REG(PFUZE3000, SWBST, PFUZE100_SWBSTCON1, 0x3, pfuze100_swbst),
399417 PFUZE100_SWB_REG(PFUZE3000, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
@@ -407,8 +425,8 @@ static struct pfuze_regulator pfuze3000_regulators[] = { · 7 unmodified lines
407425 };
408426
409427 static struct pfuze_regulator pfuze3001_regulators[] = {
410− PFUZE100_SWB_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
411− PFUZE100_SWB_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
428+ PFUZE3000_SW_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
429+ PFUZE3000_SW_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
412430 PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),
413431 PFUZE100_SWB_REG(PFUZE3001, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
414432 PFUZE100_VGEN_REG(PFUZE3001, VLDO1, PFUZE100_VGEN1VOL, 1800000, 3300000, 100000),
drivers/s390/cio/qdio.h+3−4
@@ -182,10 +182,9 @@ enum qdio_irq_poll_states { · 181 unmodified lines
182182 };
183183
184184 struct qdio_input_q {
185− /* first ACK'ed buffer */
186− int ack_start;
187− /* how many SBALs are acknowledged */
188− int ack_count;
185+ /* Batch of SBALs that we processed while polling the queue: */
186+ unsigned int batch_start;
187+ unsigned int batch_count;
189188 /* last time of noticing incoming data */
190189 u64 timestamp;
191190 };
drivers/s390/cio/qdio_debug.c+2−2
@@ -110,8 +110,8 @@ static int qstat_show(struct seq_file *m, void *v) · 109 unmodified lines
110110 seq_printf(m, "nr_used: %d ftc: %d\n",
111111 atomic_read(&q->nr_buf_used), q->first_to_check);
112112 if (q->is_input_q) {
113− seq_printf(m, "ack start: %d ack count: %d\n",
114− q->u.in.ack_start, q->u.in.ack_count);
113+ seq_printf(m, "batch start: %u batch count: %u\n",
114+ q->u.in.batch_start, q->u.in.batch_count);
115115 seq_printf(m, "DSCI: %x IRQs disabled: %u\n",
116116 *(u8 *)q->irq_ptr->dsci,
117117 test_bit(QDIO_IRQ_DISABLED,
drivers/s390/cio/qdio_main.c+41−60
@@ -254,10 +254,17 @@ static inline int set_buf_states(struct qdio_q *q, int bufnr, · 253 unmodified lines
254254 if (is_qebsm(q))
255255 return qdio_do_sqbs(q, state, bufnr, count);
256256
257+ /* Ensure that all preceding changes to the SBALs are visible: */
258+ mb();
259+
257260 for (i = 0; i < count; i++) {
258− xchg(&q->slsb.val[bufnr], state);
261+ WRITE_ONCE(q->slsb.val[bufnr], state);
259262 bufnr = next_buf(bufnr);
260263 }
264+
265+ /* Make our SLSB changes visible: */
266+ mb();
267+
261268 return count;
262269 }
263270
@@ -393,15 +400,15 @@ int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr, · 129 unmodified lines
393400
394401 static inline void qdio_stop_polling(struct qdio_q *q)
395402 {
396− if (!q->u.in.ack_count)
403+ if (!q->u.in.batch_count)
397404 return;
398405
399406 qperf_inc(q, stop_polling);
400407
401408 /* show the card that we are not polling anymore */
402− set_buf_states(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT,
403− q->u.in.ack_count);
404− q->u.in.ack_count = 0;
409+ set_buf_states(q, q->u.in.batch_start, SLSB_P_INPUT_NOT_INIT,
410+ q->u.in.batch_count);
411+ q->u.in.batch_count = 0;
405412 }
406413
407414 static inline void account_sbals(struct qdio_q *q, unsigned int count)
@@ -441,42 +448,13 @@ static void process_buffer_error(struct qdio_q *q, unsigned int start, · 33 unmodified lines
441448 static inline void inbound_handle_work(struct qdio_q *q, unsigned int start,
442449 int count, bool auto_ack)
443450 {
444− int new;
445−
446− if (auto_ack) {
447− if (!q->u.in.ack_count) {
448− q->u.in.ack_count = count;
449− q->u.in.ack_start = start;
450− return;
451− }
452−
453− /* delete the previous ACK's */
454− set_buf_states(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT,
455− q->u.in.ack_count);
456− q->u.in.ack_count = count;
457− q->u.in.ack_start = start;
458− return;
459− }
460−
461− /*
462− * ACK the newest buffer. The ACK will be removed in qdio_stop_polling
463− * or by the next inbound run.
464− */
465− new = add_buf(start, count - 1);
466− set_buf_state(q, new, SLSB_P_INPUT_ACK);
467−
468− /* delete the previous ACKs */
469− if (q->u.in.ack_count)
470− set_buf_states(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT,
471− q->u.in.ack_count);
451+ /* ACK the newest SBAL: */
452+ if (!auto_ack)
453+ set_buf_state(q, add_buf(start, count - 1), SLSB_P_INPUT_ACK);
472454
473− q->u.in.ack_count = 1;
474− q->u.in.ack_start = new;
475− count--;
476− if (!count)
477− return;
478− /* need to change ALL buffers to get more interrupts */
479− set_buf_states(q, start, SLSB_P_INPUT_NOT_INIT, count);
455+ if (!q->u.in.batch_count)
456+ q->u.in.batch_start = start;
457+ q->u.in.batch_count += count;
480458 }
481459
482460 static int get_inbound_buffer_frontier(struct qdio_q *q, unsigned int start)
@@ -525,15 +503,18 @@ static int get_inbound_buffer_frontier(struct qdio_q *q, unsigned int start) · 42 unmodified lines
525503 account_sbals_error(q, count);
526504 return count;
527505 case SLSB_CU_INPUT_EMPTY:
528− case SLSB_P_INPUT_NOT_INIT:
529− case SLSB_P_INPUT_ACK:
530506 if (q->irq_ptr->perf_stat_enabled)
531507 q->q_stats.nr_sbal_nop++;
532508 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in nop:%1d %#02x",
533509 q->nr, start);
534510 return 0;
511+ case SLSB_P_INPUT_NOT_INIT:
512+ case SLSB_P_INPUT_ACK:
513+ /* We should never see this state, throw a WARN: */
535514 default:
536− WARN_ON_ONCE(1);
515+ dev_WARN_ONCE(&q->irq_ptr->cdev->dev, 1,
516+ "found state %#x at index %u on queue %u\n",
517+ state, start, q->nr);
537518 return 0;
538519 }
539520 }
@@ -738,11 +719,14 @@ static int get_outbound_buffer_frontier(struct qdio_q *q, unsigned int start) · 198 unmodified lines
738719 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out primed:%1d",
739720 q->nr);
740721 return 0;
741− case SLSB_P_OUTPUT_NOT_INIT:
742722 case SLSB_P_OUTPUT_HALTED:
743723 return 0;
724+ case SLSB_P_OUTPUT_NOT_INIT:
725+ /* We should never see this state, throw a WARN: */
744726 default:
745− WARN_ON_ONCE(1);
727+ dev_WARN_ONCE(&q->irq_ptr->cdev->dev, 1,
728+ "found state %#x at index %u on queue %u\n",
729+ state, start, q->nr);
746730 return 0;
747731 }
748732 }
@@ -938,10 +922,10 @@ static void qdio_int_handler_pci(struct qdio_irq *irq_ptr) · 189 unmodified lines
938922 }
939923 }
940924
941−static void qdio_handle_activate_check(struct ccw_device *cdev,
942− unsigned long intparm, int cstat, int dstat)
925+static void qdio_handle_activate_check(struct qdio_irq *irq_ptr,
926+ unsigned long intparm, int cstat,
927+ int dstat)
943928 {
944− struct qdio_irq *irq_ptr = cdev->private->qdio_data;
945929 struct qdio_q *q;
946930
947931 DBF_ERROR("%4x ACT CHECK", irq_ptr->schid.sch_no);
@@ -968,11 +952,9 @@ no_handler: · 20 unmodified lines
968952 lgr_info_log();
969953 }
970954
971−static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat,
955+static void qdio_establish_handle_irq(struct qdio_irq *irq_ptr, int cstat,
972956 int dstat)
973957 {
974− struct qdio_irq *irq_ptr = cdev->private->qdio_data;
975−
976958 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq");
977959
978960 if (cstat)
@@ -1019,7 +1001,7 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, · 40 unmodified lines
10191001
10201002 switch (irq_ptr->state) {
10211003 case QDIO_IRQ_STATE_INACTIVE:
1022− qdio_establish_handle_irq(cdev, cstat, dstat);
1004+ qdio_establish_handle_irq(irq_ptr, cstat, dstat);
10231005 break;
10241006 case QDIO_IRQ_STATE_CLEANUP:
10251007 qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE);
@@ -1031,7 +1013,7 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, · 5 unmodified lines
10311013 return;
10321014 }
10331015 if (cstat || dstat)
1034− qdio_handle_activate_check(cdev, intparm, cstat,
1016+ qdio_handle_activate_check(irq_ptr, intparm, cstat,
10351017 dstat);
10361018 break;
10371019 case QDIO_IRQ_STATE_STOPPED:
@@ -1446,12 +1428,12 @@ static int handle_inbound(struct qdio_q *q, unsigned int callflags, · 408 unmodified lines
14461428
14471429 qperf_inc(q, inbound_call);
14481430
1449− /* If any ACKed SBALs are returned to HW, adjust ACK tracking: */
1450− overlap = min(count - sub_buf(q->u.in.ack_start, bufnr),
1451− q->u.in.ack_count);
1431+ /* If any processed SBALs are returned to HW, adjust our tracking: */
1432+ overlap = min_t(int, count - sub_buf(q->u.in.batch_start, bufnr),
1433+ q->u.in.batch_count);
14521434 if (overlap > 0) {
1453− q->u.in.ack_start = add_buf(q->u.in.ack_start, overlap);
1454− q->u.in.ack_count -= overlap;
1435+ q->u.in.batch_start = add_buf(q->u.in.batch_start, overlap);
1436+ q->u.in.batch_count -= overlap;
14551437 }
14561438
14571439 count = set_buf_states(q, bufnr, SLSB_CU_INPUT_EMPTY, count);
@@ -1535,12 +1517,11 @@ static int handle_outbound(struct qdio_q *q, unsigned int callflags, · 77 unmodified lines
15351517 int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
15361518 int q_nr, unsigned int bufnr, unsigned int count)
15371519 {
1538− struct qdio_irq *irq_ptr;
1520+ struct qdio_irq *irq_ptr = cdev->private->qdio_data;
15391521
15401522 if (bufnr >= QDIO_MAX_BUFFERS_PER_Q || count > QDIO_MAX_BUFFERS_PER_Q)
15411523 return -EINVAL;
15421524
1543− irq_ptr = cdev->private->qdio_data;
15441525 if (!irq_ptr)
15451526 return -ENODEV;
15461527
drivers/s390/crypto/zcrypt_ep11misc.c+1−2
@@ -195,11 +195,10 @@ static inline struct ep11_cprb *alloc_cprb(size_t payload_len) · 194 unmodified lines
195195 size_t len = sizeof(struct ep11_cprb) + payload_len;
196196 struct ep11_cprb *cprb;
197197
198− cprb = kmalloc(len, GFP_KERNEL);
198+ cprb = kzalloc(len, GFP_KERNEL);
199199 if (!cprb)
200200 return NULL;
201201
202− memset(cprb, 0, len);
203202 cprb->cprb_len = sizeof(struct ep11_cprb);
204203 cprb->cprb_ver_id = 0x04;
205204 memcpy(cprb->func_id, "T4", 2);
drivers/s390/net/qeth_core_main.c+5−6
@@ -4544,9 +4544,6 @@ static int qeth_setadpparms_set_access_ctrl_cb(struct qeth_card *card, · 4543 unmodified lines
45444544 int fallback = *(int *)reply->param;
45454545
45464546 QETH_CARD_TEXT(card, 4, "setaccb");
4547− if (cmd->hdr.return_code)
4548− return -EIO;
4549− qeth_setadpparms_inspect_rc(cmd);
45504547
45514548 access_ctrl_req = &cmd->data.setadapterparms.data.set_access_ctrl;
45524549 QETH_CARD_TEXT_(card, 2, "rc=%d",
@@ -4556,7 +4553,7 @@ static int qeth_setadpparms_set_access_ctrl_cb(struct qeth_card *card, · 3 unmodified lines
45564553 QETH_DBF_MESSAGE(3, "ERR:SET_ACCESS_CTRL(%#x) on device %x: %#x\n",
45574554 access_ctrl_req->subcmd_code, CARD_DEVID(card),
45584555 cmd->data.setadapterparms.hdr.return_code);
4559− switch (cmd->data.setadapterparms.hdr.return_code) {
4556+ switch (qeth_setadpparms_inspect_rc(cmd)) {
45604557 case SET_ACCESS_CTRL_RC_SUCCESS:
45614558 if (card->options.isolation == ISOLATION_MODE_NONE) {
45624559 dev_info(&card->gdev->dev,
@@ -6840,9 +6837,11 @@ netdev_features_t qeth_features_check(struct sk_buff *skb, · 2277 unmodified lines
68406837 struct net_device *dev,
68416838 netdev_features_t features)
68426839 {
6840+ struct qeth_card *card = dev->ml_priv;
6841+
68436842 /* Traffic with local next-hop is not eligible for some offloads: */
6844− if (skb->ip_summed == CHECKSUM_PARTIAL) {
6845− struct qeth_card *card = dev->ml_priv;
6843+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
6844+ card->options.isolation != ISOLATION_MODE_FWD) {
68466845 netdev_features_t restricted = 0;
68476846
68486847 if (skb_is_gso(skb) && !netif_needs_gso(skb, features))
drivers/s390/scsi/zfcp_erp.c+11−2
@@ -577,7 +577,10 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) · 576 unmodified lines
577577 ZFCP_STATUS_ERP_TIMEDOUT)) {
578578 req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
579579 zfcp_dbf_rec_run("erscf_1", act);
580− req->erp_action = NULL;
580+ /* lock-free concurrent access with
581+ * zfcp_erp_timeout_handler()
582+ */
583+ WRITE_ONCE(req->erp_action, NULL);
581584 }
582585 if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
583586 zfcp_dbf_rec_run("erscf_2", act);
@@ -613,8 +616,14 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask) · 29 unmodified lines
613616 void zfcp_erp_timeout_handler(struct timer_list *t)
614617 {
615618 struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer);
616− struct zfcp_erp_action *act = fsf_req->erp_action;
619+ struct zfcp_erp_action *act;
617620
621+ if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED)
622+ return;
623+ /* lock-free concurrent access with zfcp_erp_strategy_check_fsfreq() */
624+ act = READ_ONCE(fsf_req->erp_action);
625+ if (!act)
626+ return;
618627 zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT);
619628 }
620629
drivers/s390/virtio/virtio_ccw.c+0−26
@@ -1372,27 +1372,6 @@ static struct ccw_device_id virtio_ids[] = { · 1371 unmodified lines
13721372 {},
13731373 };
13741374
1375−#ifdef CONFIG_PM_SLEEP
1376−static int virtio_ccw_freeze(struct ccw_device *cdev)
1377−{
1378− struct virtio_ccw_device *vcdev = dev_get_drvdata(&cdev->dev);
1379−
1380− return virtio_device_freeze(&vcdev->vdev);
1381−}
1382−
1383−static int virtio_ccw_restore(struct ccw_device *cdev)
1384−{
1385− struct virtio_ccw_device *vcdev = dev_get_drvdata(&cdev->dev);
1386− int ret;
1387−
1388− ret = virtio_ccw_set_transport_rev(vcdev);
1389− if (ret)
1390− return ret;
1391−
1392− return virtio_device_restore(&vcdev->vdev);
1393−}
1394−#endif
1395−
13961375 static struct ccw_driver virtio_ccw_driver = {
13971376 .driver = {
13981377 .owner = THIS_MODULE,
@@ -1405,11 +1384,6 @@ static struct ccw_driver virtio_ccw_driver = { · 6 unmodified lines
14051384 .set_online = virtio_ccw_online,
14061385 .notify = virtio_ccw_cio_notify,
14071386 .int_class = IRQIO_VIR,
1408−#ifdef CONFIG_PM_SLEEP
1409− .freeze = virtio_ccw_freeze,
1410− .thaw = virtio_ccw_restore,
1411− .restore = virtio_ccw_restore,
1412−#endif
14131387 };
14141388
14151389 static int __init pure_hex(char **cp, unsigned int *val, int min_digit,
drivers/scsi/aic94xx/aic94xx_init.c+1−0
@@ -40,6 +40,7 @@ static struct scsi_host_template aic94xx_sht = { · 39 unmodified lines
4040 /* .name is initialized */
4141 .name = "aic94xx",
4242 .queuecommand = sas_queuecommand,
43+ .dma_need_drain = ata_scsi_dma_need_drain,
4344 .target_alloc = sas_target_alloc,
4445 .slave_configure = sas_slave_configure,
4546 .scan_finished = asd_scan_finished,
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c+1−0
@@ -1756,6 +1756,7 @@ static struct scsi_host_template sht_v1_hw = { · 1755 unmodified lines
17561756 .proc_name = DRV_NAME,
17571757 .module = THIS_MODULE,
17581758 .queuecommand = sas_queuecommand,
1759+ .dma_need_drain = ata_scsi_dma_need_drain,
17591760 .target_alloc = sas_target_alloc,
17601761 .slave_configure = hisi_sas_slave_configure,
17611762 .scan_finished = hisi_sas_scan_finished,
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c+1−0
@@ -3532,6 +3532,7 @@ static struct scsi_host_template sht_v2_hw = { · 3531 unmodified lines
35323532 .proc_name = DRV_NAME,
35333533 .module = THIS_MODULE,
35343534 .queuecommand = sas_queuecommand,
3535+ .dma_need_drain = ata_scsi_dma_need_drain,
35353536 .target_alloc = sas_target_alloc,
35363537 .slave_configure = hisi_sas_slave_configure,
35373538 .scan_finished = hisi_sas_scan_finished,
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+1−0
@@ -3075,6 +3075,7 @@ static struct scsi_host_template sht_v3_hw = { · 3074 unmodified lines
30753075 .proc_name = DRV_NAME,
30763076 .module = THIS_MODULE,
30773077 .queuecommand = sas_queuecommand,
3078+ .dma_need_drain = ata_scsi_dma_need_drain,
30783079 .target_alloc = sas_target_alloc,
30793080 .slave_configure = hisi_sas_slave_configure,
30803081 .scan_finished = hisi_sas_scan_finished,
drivers/scsi/ipr.c+1−0
@@ -6731,6 +6731,7 @@ static struct scsi_host_template driver_template = { · 6730 unmodified lines
67316731 .compat_ioctl = ipr_ioctl,
67326732 #endif
67336733 .queuecommand = ipr_queuecommand,
6734+ .dma_need_drain = ata_scsi_dma_need_drain,
67346735 .eh_abort_handler = ipr_eh_abort,
67356736 .eh_device_reset_handler = ipr_eh_dev_reset,
67366737 .eh_host_reset_handler = ipr_eh_host_reset,
drivers/scsi/isci/init.c+1−0
@@ -153,6 +153,7 @@ static struct scsi_host_template isci_sht = { · 152 unmodified lines
153153 .name = DRV_NAME,
154154 .proc_name = DRV_NAME,
155155 .queuecommand = sas_queuecommand,
156+ .dma_need_drain = ata_scsi_dma_need_drain,
156157 .target_alloc = sas_target_alloc,
157158 .slave_configure = sas_slave_configure,
158159 .scan_finished = isci_host_scan_finished,
drivers/scsi/libfc/fc_rport.c+8−5
@@ -133,8 +133,10 @@ struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id) · 132 unmodified lines
133133 lockdep_assert_held(&lport->disc.disc_mutex);
134134
135135 rdata = fc_rport_lookup(lport, port_id);
136− if (rdata)
136+ if (rdata) {
137+ kref_put(&rdata->kref, fc_rport_destroy);
137138 return rdata;
139+ }
138140
139141 if (lport->rport_priv_size > 0)
140142 rport_priv_size = lport->rport_priv_size;
@@ -481,10 +483,11 @@ static void fc_rport_enter_delete(struct fc_rport_priv *rdata, · 340 unmodified lines
481483
482484 fc_rport_state_enter(rdata, RPORT_ST_DELETE);
483485
484− kref_get(&rdata->kref);
485− if (rdata->event == RPORT_EV_NONE &&
486− !queue_work(rport_event_queue, &rdata->event_work))
487− kref_put(&rdata->kref, fc_rport_destroy);
486+ if (rdata->event == RPORT_EV_NONE) {
487+ kref_get(&rdata->kref);
488+ if (!queue_work(rport_event_queue, &rdata->event_work))
489+ kref_put(&rdata->kref, fc_rport_destroy);
490+ }
488491
489492 rdata->event = event;
490493 }
drivers/scsi/lpfc/lpfc_init.c+2−1
@@ -11878,7 +11878,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba) · 11877 unmodified lines
1187811878 lpfc_sli4_xri_exchange_busy_wait(phba);
1187911879
1188011880 /* per-phba callback de-registration for hotplug event */
11881− lpfc_cpuhp_remove(phba);
11881+ if (phba->pport)
11882+ lpfc_cpuhp_remove(phba);
1188211883
1188311884 /* Disable PCI subsystem interrupt */
1188411885 lpfc_sli4_disable_intr(phba);
drivers/scsi/mvsas/mv_init.c+1−0
@@ -33,6 +33,7 @@ static struct scsi_host_template mvs_sht = { · 32 unmodified lines
3333 .module = THIS_MODULE,
3434 .name = DRV_NAME,
3535 .queuecommand = sas_queuecommand,
36+ .dma_need_drain = ata_scsi_dma_need_drain,
3637 .target_alloc = sas_target_alloc,
3738 .slave_configure = sas_slave_configure,
3839 .scan_finished = mvs_scan_finished,
drivers/scsi/pm8001/pm8001_init.c+1−0
@@ -87,6 +87,7 @@ static struct scsi_host_template pm8001_sht = { · 86 unmodified lines
8787 .module = THIS_MODULE,
8888 .name = DRV_NAME,
8989 .queuecommand = sas_queuecommand,
90+ .dma_need_drain = ata_scsi_dma_need_drain,
9091 .target_alloc = sas_target_alloc,
9192 .slave_configure = sas_slave_configure,
9293 .scan_finished = pm8001_scan_finished,
drivers/scsi/qla2xxx/qla_gs.c+3−1
@@ -3496,7 +3496,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) · 3495 unmodified lines
34963496 qla2x00_clear_loop_id(fcport);
34973497 fcport->flags |= FCF_FABRIC_DEVICE;
34983498 } else if (fcport->d_id.b24 != rp->id.b24 ||
3499− fcport->scan_needed) {
3499+ (fcport->scan_needed &&

5 more 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/ufs/ufs_bsg.c+3−1

This diff is large: its 12 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/knav_qmss.h+1−1

This diff is large: its 9 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/spi/spi-fsl-dspi.c+26−21

This diff is large: its 118 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/spidev.c+12−12

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

This diff is large: its 19 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/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/usb/cdns3/ep0.c+6−4

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

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

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

This diff is large: its 18 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+3−1

This diff is large: its 12 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/udc/mv_udc_core.c+2−1

This diff is large: its 10 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/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/backlight/tosa_lcd.c+2−2

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

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

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

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/w1/w1_netlink.h+2−2

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

drivers/xen/xenbus/xenbus_client.c+81−86

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

fs/afs/cell.c+9−0

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

fs/afs/dir.c+56−8

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

fs/afs/dir_silly.c+28−10

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

fs/afs/file.c+1−1

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

fs/afs/flock.c+1−3

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

fs/afs/fs_operation.c+9−1

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

fs/afs/fs_probe.c+10−1

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

fs/afs/inode.c+71−20

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

fs/afs/internal.h+25−14

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

fs/afs/main.c+3−0

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

fs/afs/misc.c+1−0

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

fs/afs/server.c+2−1

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

fs/afs/write.c+10−2

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

fs/afs/yfsclient.c+26−67

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

fs/aio.c+1−1

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

fs/block_dev.c+9−8

This diff is large: its 61 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.h+2−0

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

fs/btrfs/file.c+37−9

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

fs/btrfs/inode.c+30−9

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

fs/btrfs/ioctl.c+1−1

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

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

This diff is large: its 26 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/connect.c+6−4

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

fs/cifs/file.c+7−4

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

fs/cifs/inode.c+17−2

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

fs/cifs/misc.c+7−9

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

fs/cifs/smb2ops.c+12−0

This diff is large: its 33 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/ext4/Makefile+2−1

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

fs/ext4/dir.c+16−0

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

fs/ext4/ext4.h+20−7

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

fs/ext4/extents.c+1−1

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

fs/ext4/ialloc.c+1−1

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

fs/ext4/inode.c+20−6

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

fs/ext4/ioctl.c+54−11

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

fs/ext4/mballoc.c+1−1

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

fs/ext4/super.c+89−35

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

fs/ext4/verity.c+4−1

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

fs/ext4/xattr.c+2−0

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

fs/ext4/xattr.h+1−0

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

fs/ext4/xattr_hurd.c+51−0

This diff is large: its 52 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-wq.c+56−52

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

fs/io-wq.h+1−3

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

fs/io_uring.c+167−69

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

fs/jbd2/journal.c+12−5

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

fs/jffs2/nodelist.h+1−1

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

fs/jffs2/summary.h+2−2

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

fs/nfs/direct.c+9−4

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

fs/nfs/file.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/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/proc/bootconfig.c+10−5

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

fs/proc/kcore.c+2−1

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

fs/proc/proc_sysctl.c+3−3

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

fs/squashfs/squashfs_fs.h+8−8

This diff is large: its 69 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/hugetlb.h+1−1

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

include/crypto/if_alg.h+2−2

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

include/drm/drm_displayid.h+1−1

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

include/keys/encrypted-type.h+1−1

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

include/keys/rxrpc-type.h+2−2

This diff is large: its 18 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/blkdev.h+1−0

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

include/linux/can/skb.h+1−1

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

include/linux/cb710.h+1−1

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

include/linux/ceph/libceph.h+2−2

This diff is large: its 18 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+6−0

This diff is large: its 13 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+10−12

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

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

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

include/linux/dmaengine.h+2−2

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

include/linux/efi.h+3−5

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

include/linux/fs.h+0−2

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

include/linux/fscache-cache.h+1−1

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

include/linux/host1x.h+3−0

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

include/linux/i2c.h+3−5

This diff is large: its 25 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/jbd2.h+5−1

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

include/linux/kexec.h+1−1

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

include/linux/kgdb.h+2−3

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

include/linux/kprobes.h+5−1

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

include/linux/kvm_host.h+1−1

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

include/linux/libata.h+8−1

This diff is large: its 38 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/mlx5_ifc.h+6−4

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

include/linux/mmzone.h+2−2

This diff is large: its 11 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/overflow.h+21−4

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

include/linux/pci.h+5−6

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

include/linux/pgtable.h+7−0

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

include/linux/phy.h+1−0

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

include/linux/psp-sev.h+1−1

This diff is large: its 9 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/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/sctp.h+18−18

This diff is large: its 152 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/tifm.h+1−1

This diff is large: its 9 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/uaccess.h+13−10

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

include/linux/vmalloc.h+0−1

This diff is large: its 8 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/gue.h+1−1

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

include/net/netfilter/nf_flow_table.h+45−4

This diff is large: its 56 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+0−1

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

include/net/tc_act/tc_ct.h+10−1

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/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/block.h+0−1

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

This diff is large: its 9 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/fs.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/ndctl.h+1−0

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/vfio.h+1−1

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

include/uapi/linux/xattr.h+4−0

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

init/Kconfig+4−4

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/debug/debug_core.c+7−3

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

kernel/debug/gdbstub.c+3−3

This diff is large: its 27 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/debug/kdb/kdb_main.c+2−1

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

kernel/debug/kdb/kdb_support.c+4−3

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

kernel/dma/Kconfig+6−5

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

kernel/dma/direct.c+34−25

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

kernel/dma/pool.c+3−4

This diff is large: its 14 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/kexec_file.c+6−28

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

kernel/kprobes.c+48−13

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

kernel/kthread.c+1−1

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

kernel/module.c+3−1

This diff is large: its 11 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+1−1

This diff is large: its 9 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/trace/blktrace.c+20−10

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

kernel/trace/bpf_trace.c+5−5

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

kernel/trace/ftrace.c+10−2

This diff is large: its 40 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.c+1−2

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

kernel/trace/trace.h+3−0

This diff is large: its 10 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_entries.h+7−7

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.

kernel/trace/trace_export.c+16−0

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

kernel/trace/trace_functions.c+1−1

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

kernel/trace/trace_kprobe.c+3−3

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

kernel/trace/trace_probe.c+2−2

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

kernel/trace/trace_probe.h+1−1

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

kernel/workqueue.c+5−5

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

lib/Kconfig.debug+0−1

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

lib/Kconfig.kasan+4−0

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

lib/seq_buf.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.

lib/test_lockup.c+3−3

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

lib/test_objagg.c+2−2

This diff is large: its 13 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.c+4−4

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/gup.c+2−2

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

mm/hugetlb.c+1−1

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

mm/maccess.c+31−30

This diff is large: its 188 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/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/rodata_test.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+5−16

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

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

net/bridge/br_mrp.c+8−2

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

net/bridge/br_private.h+1−1

This diff is large: its 10 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/ceph/ceph_common.c+6−8

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

net/ceph/osd_client.c+4−5

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

net/core/dev.c+9−0

This diff is large: its 27 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/flow_offload.c+26−21

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

net/core/sock.c+3−1

This diff is large: its 25 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/hsr/hsr_device.c+1−20

This diff is large: its 41 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/ip_tunnel.c+8−6

This diff is large: its 37 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/tcp_cubic.c+2−3

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

net/ipv4/tcp_input.c+21−5

This diff is large: its 61 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/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/mcast.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/mptcp/options.c+0−2

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

net/mptcp/protocol.h+2−6

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

net/mptcp/subflow.c+30−31

This diff is large: its 170 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/nf_conntrack_netlink.c+22−10

This diff is large: its 70 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−45

This diff is large: its 57 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_api.c+24−7

This diff is large: its 71 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_set_pipapo.c+5−1

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

net/netfilter/nft_set_rbtree.c+14−7

This diff is large: its 53 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/openvswitch/actions.c+7−2

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

net/rds/ib.h+7−1

This diff is large: its 15 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_ct.c+0−11

This diff is large: its 18 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/cls_api.c+15−10

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

net/sched/sch_cake.c+41−17

This diff is large: its 112 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/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/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+3−6

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

net/sunrpc/xprtrdma/transport.c+1−1

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

net/sunrpc/xprtrdma/verbs.c+42−29

This diff is large: its 195 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/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_output.c+0−4

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

samples/Kconfig+1−1

This diff is large: its 9 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/ftrace/sample-trace-array.c+18−6

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

samples/mei/mei-amt-version.c+1−1

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

samples/vfs/test-statx.c+2−0

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

samples/watch_queue/Makefile+4−6

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

scripts/Kbuild.include+6−5

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

scripts/Kconfig.include+1−7

This diff is large: its 20 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/decode_stacktrace.sh+4−1

This diff is large: its 12 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/headers_install.sh+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.

scripts/recordmcount.h+92−6

This diff is large: its 197 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/integrity/integrity.h+2−2

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

security/security.c+16−1

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

security/selinux/ss/conditional.c+8−13

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

security/selinux/ss/services.c+4−0

This diff is large: its 13 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_intel.c+8−0

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

sound/pci/hda/patch_hdmi.c+5−0

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

sound/pci/hda/patch_realtek.c+3−0

This diff is large: its 17 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/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+6−5

This diff is large: its 19 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_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/probe.h+4−4

This diff is large: its 32 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/format.c+4−2

This diff is large: its 20 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+2−0

This diff is large: its 16 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/asm/cpufeatures.h+2−0

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

tools/arch/x86/include/asm/msr-index.h+4−0

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

tools/arch/x86/include/uapi/asm/kvm.h+19−2

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

tools/arch/x86/include/uapi/asm/unistd.h+8−1

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

tools/arch/x86/include/uapi/asm/vmx.h+3−0

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

tools/bootconfig/main.c+14−10

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

tools/bootconfig/test-bootconfig.sh+10−0

This diff is large: its 24 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/uapi/asm-generic/unistd.h+3−1

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

tools/include/uapi/drm/i915_drm.h+24−0

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

tools/include/uapi/linux/bpf.h+1−1

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

tools/include/uapi/linux/fcntl.h+10−0

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

tools/include/uapi/linux/fs.h+1−0

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

tools/include/uapi/linux/fscrypt.h+2−1

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

tools/include/uapi/linux/kvm.h+14−0

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

tools/include/uapi/linux/stat.h+7−1

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

tools/include/uapi/linux/vhost.h+4−0

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

tools/lib/traceevent/event-parse.c+111−57

This diff is large: its 291 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/Makefile.config+12−0

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

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+1−0

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

tools/perf/builtin-report.c+1−2

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

tools/perf/builtin-script.c+3−0

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

tools/perf/trace/beauty/statx.c+1−0

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

tools/perf/util/bpf-prologue.c+10−4

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

tools/perf/util/parse-events.y+2−2

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

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

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

tools/perf/util/probe-event.c+5−2

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

tools/perf/util/probe-file.c+1−1

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

tools/perf/util/stat-display.c+2−2

This diff is large: its 18 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/nvdimm/test/nfit_test.h+3−3

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

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/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/sockopt_sk.c+52−2

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

tools/testing/selftests/ftrace/ftracetest+9−2

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

tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc+1−2

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

tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc+1−2

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

tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc+1−5

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

tools/testing/selftests/ftrace/test.d/dynevent/add_remove_kprobe.tc+1−5

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

tools/testing/selftests/ftrace/test.d/dynevent/add_remove_synth.tc+1−4

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

tools/testing/selftests/ftrace/test.d/dynevent/clear_select_events.tc+1−10

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

tools/testing/selftests/ftrace/test.d/dynevent/generic_clear_event.tc+1−7

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

tools/testing/selftests/ftrace/test.d/event/event-enable.tc+1−5

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

tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc+1−10

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

tools/testing/selftests/ftrace/test.d/event/event-pid.tc+1−10

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

tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc+1−5

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

tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc+1−5

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

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc+1−13

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

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc+1−7

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc+1−7

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-notrace-pid.tc+1−12

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc+1−12

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc+1−2

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

tools/testing/selftests/ftrace/test.d/ftrace/func_cpumask.tc+1−5

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

tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc+3−4

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

tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc+1−2

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

tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc+1−2

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

tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc+1−11

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

tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc+3−3

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

tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc+1−7

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

tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc+3−3

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

tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc+3−9

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

tools/testing/selftests/ftrace/test.d/functions+21−7

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

tools/testing/selftests/ftrace/test.d/instances/instance-event.tc+1−5

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

tools/testing/selftests/ftrace/test.d/instances/instance.tc+1−5

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

tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_symbol.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc+1−4

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc+1−4

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_user.tc+1−3

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc+1−5

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_multiprobe.tc+1−4

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc+1−4

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

tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc+1−3

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

tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/profile.tc+1−2

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

tools/testing/selftests/ftrace/test.d/kprobe/uprobe_syntax_errors.tc+1−4

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

tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc+1−3

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

tools/testing/selftests/ftrace/test.d/template+4−0

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

tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc+1−5

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

tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc+1−5

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-action-hist-xfail.tc+1−12

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc+1−7

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc+1−19

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc+1−10

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc+1−10

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc+1−17

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc+1−10

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc+1−10

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-syntax-errors.tc+1−17

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc+2−16

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc+1−15

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc+2−11

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc+2−21

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc+2−21

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic-kernel.tc+1−30

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic.tc+1−25

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

tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc+1−10

This diff is large: its 24 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/pmu/ebb/Makefile+1−1

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

tools/testing/selftests/seccomp/seccomp_bpf.c+1−0

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

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

tools/testing/selftests/tpm2/test_space.sh+2−2

This diff is large: its 12 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.

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