History

Merge remote-tracking branch 'torvalds/master' into perf/core

To pick up fixes.

Arnaldo Carvalho de Melo committed 5 years ago

Commit cd07e532 parents 47fddcb 45dfb8a872 files · +9357 −5038Browse files

Unified · Split

872 files
  1. CREDITS +24 −0
  2. Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst +4 −4
  3. Documentation/RCU/Design/Requirements/Requirements.rst +10 −10
  4. Documentation/admin-guide/binfmt-misc.rst +2 −2
  5. Documentation/admin-guide/bootconfig.rst +1 −1
  6. Documentation/admin-guide/kernel-parameters.rst +2 −2
  7. Documentation/admin-guide/kernel-parameters.txt +10 −6
  8. Documentation/admin-guide/mm/concepts.rst +1 −1
  9. Documentation/core-api/index.rst +0 −1
  10. Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +3 −1
  11. Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml +3 −1
  12. Documentation/devicetree/bindings/dma/ti/k3-udma.yaml +3 −1
  13. Documentation/devicetree/bindings/net/renesas,etheravb.yaml +1 −0
  14. Documentation/devicetree/bindings/net/snps,dwmac.yaml +6 −2
  15. Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml +4 −2
  16. Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt +1 −0
  17. Documentation/devicetree/bindings/sound/ti,j721e-cpb-audio.yaml +3 −1
  18. Documentation/devicetree/bindings/sound/ti,j721e-cpb-ivi-audio.yaml +3 −1
  19. Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml +5 −1
  20. Documentation/doc-guide/sphinx.rst +16 −16
  21. Documentation/firmware-guide/acpi/apei/einj.rst +2 −2
  22. Documentation/hwmon/sbtsi_temp.rst +1 −1
  23. Documentation/kbuild/makefiles.rst +1 −1
  24. Documentation/kernel-hacking/locking.rst +4 −4
  25. Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst +36 −26
  26. Documentation/networking/netdev-FAQ.rst +59 −67
  27. Documentation/networking/netdevices.rst +167 −8
  28. Documentation/networking/packet_mmap.rst +5 −6
  29. Documentation/networking/tls-offload.rst +1 −1
  30. Documentation/process/4.Coding.rst +2 −4
  31. Documentation/sound/alsa-configuration.rst +1 −1
  32. Documentation/sound/kernel-api/writing-an-alsa-driver.rst +8 −8
  33. Documentation/virt/kvm/api.rst +7 −2
  34. MAINTAINERS +42 −35
  35. Makefile +1 −1
  36. arch/Kconfig +6 −0
  37. arch/alpha/include/asm/local64.h +0 −1
  38. arch/arc/Makefile +13 −7
  39. arch/arc/boot/Makefile +4 −14
  40. arch/arc/include/asm/Kbuild +0 −1
  41. arch/arc/include/asm/page.h +1 −0
  42. arch/arc/kernel/entry.S +1 −1
  43. arch/arc/plat-hsdk/Kconfig +1 −0
  44. arch/arm/boot/dts/omap3-n950-n9.dtsi +8 −0
  45. arch/arm/boot/dts/picoxcell-pc3x2.dtsi +4 −0
  46. arch/arm/boot/dts/ste-ux500-samsung-golden.dts +1 −0
  47. arch/arm/configs/omap2plus_defconfig +1 −1
  48. arch/arm/crypto/chacha-glue.c +1 −0
  49. arch/arm/include/asm/Kbuild +0 −1
  50. arch/arm/mach-omap2/omap_device.c +5 −3
  51. arch/arm/mach-omap2/pmic-cpcap.c +1 −1
  52. arch/arm/xen/enlighten.c +1 −1
  53. arch/arm64/Kconfig +0 −2
  54. arch/arm64/Makefile +7 −3
  55. arch/arm64/boot/dts/bitmain/bm1880.dtsi +3 −3
  56. arch/arm64/include/asm/Kbuild +0 −1
  57. arch/arm64/include/asm/atomic.h +5 −5
  58. arch/arm64/include/asm/kvm_host.h +23 −0
  59. arch/arm64/include/asm/uaccess.h +13 −3
  60. arch/arm64/kernel/asm-offsets.c +1 −1
  61. arch/arm64/kernel/cpufeature.c +1 −1
  62. arch/arm64/kernel/entry-ftrace.S +6 −6
  63. arch/arm64/kernel/entry.S +8 −8
  64. arch/arm64/kernel/perf_event.c +2 −39
  65. arch/arm64/kernel/probes/kprobes_trampoline.S +3 −3
  66. arch/arm64/kernel/signal.c +0 −7
  67. arch/arm64/kernel/smp.c +1 −2
  68. arch/arm64/kernel/syscall.c +2 −8
  69. arch/arm64/kernel/traps.c +0 −1
  70. arch/arm64/kernel/vdso/Makefile +1 −2
  71. arch/arm64/kernel/vdso/vdso.lds.S +1 −4
  72. arch/arm64/kvm/Kconfig +0 −8
  73. arch/arm64/kvm/Makefile +1 −1
  74. arch/arm64/kvm/arch_timer.c +4 −3
  75. arch/arm64/kvm/arm.c +18 −14
  76. arch/arm64/kvm/hyp/include/hyp/adjust_pc.h +9 −0
  77. arch/arm64/kvm/hyp/nvhe/hyp-main.c +2 −10
  78. arch/arm64/kvm/hyp/nvhe/hyp-smp.c +3 −3
  79. arch/arm64/kvm/hyp/nvhe/psci-relay.c +22 −37
  80. arch/arm64/kvm/pmu-emul.c +0 −2
  81. arch/arm64/kvm/sys_regs.c +5 −1
  82. arch/arm64/kvm/va_layout.c +3 −4
  83. arch/arm64/kvm/vgic/vgic-init.c +10 −1
  84. arch/arm64/kvm/vgic/vgic-v2.c +6 −14
  85. arch/arm64/kvm/vgic/vgic-v3.c +6 −15
  86. arch/arm64/mm/init.c +18 −15
  87. arch/arm64/mm/proc.S +1 −1
  88. arch/csky/include/asm/Kbuild +0 −1
  89. arch/h8300/include/asm/Kbuild +0 −1
  90. arch/hexagon/include/asm/Kbuild +0 −1
  91. arch/ia64/include/asm/local64.h +0 −1
  92. arch/ia64/include/asm/sparsemem.h +1 −0
  93. arch/ia64/mm/init.c +2 −2
  94. arch/m68k/include/asm/Kbuild +0 −1
  95. arch/microblaze/include/asm/Kbuild +0 −1
  96. arch/mips/boot/compressed/decompress.c +2 −1
  97. arch/mips/cavium-octeon/octeon-irq.c +1 −1
  98. arch/mips/include/asm/Kbuild +0 −1
  99. arch/mips/kernel/binfmt_elfn32.c +7 −0
  100. arch/mips/kernel/binfmt_elfo32.c +7 −0
  101. arch/mips/kernel/relocate.c +8 −2
  102. arch/nds32/include/asm/Kbuild +0 −1
  103. arch/openrisc/include/asm/Kbuild +0 −1
  104. arch/parisc/include/asm/Kbuild +0 −1
  105. arch/powerpc/include/asm/Kbuild +0 −1
  106. arch/powerpc/include/asm/vdso/gettimeofday.h +15 −1
  107. arch/powerpc/kernel/head_book3s_32.S +9 −0
  108. arch/powerpc/kernel/vmlinux.lds.S +9 −1
  109. arch/riscv/Kconfig +4 −2
  110. arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +2 −0
  111. arch/riscv/configs/defconfig +2 −0
  112. arch/riscv/include/asm/Kbuild +0 −1
  113. arch/riscv/include/asm/pgtable.h +0 −1
  114. arch/riscv/include/asm/vdso.h +1 −1
  115. arch/riscv/kernel/cacheinfo.c +10 −1
  116. arch/riscv/kernel/entry.S +13 −11
  117. arch/riscv/kernel/setup.c +13 −11
  118. arch/riscv/kernel/stacktrace.c +2 −3
  119. arch/riscv/kernel/time.c +3 −0
  120. arch/riscv/kernel/vdso.c +1 −1
  121. arch/riscv/mm/init.c +14 −2
  122. arch/riscv/mm/kasan_init.c +2 −2
  123. arch/s390/Kconfig +17 −14
  124. arch/s390/configs/debug_defconfig +9 −3
  125. arch/s390/configs/defconfig +7 −4
  126. arch/s390/configs/zfcpdump_defconfig +2 −0
  127. arch/s390/include/asm/Kbuild +0 −1
  128. arch/sh/include/asm/Kbuild +0 −1
  129. arch/sparc/include/asm/Kbuild +0 −1
  130. arch/x86/Kconfig +1 −0
  131. arch/x86/hyperv/hv_init.c +30 −3
  132. arch/x86/hyperv/mmu.c +9 −3
  133. arch/x86/include/asm/kvm_host.h +17 −2
  134. arch/x86/include/asm/local64.h +0 −1
  135. arch/x86/include/asm/mshyperv.h +2 −0
  136. arch/x86/kernel/cpu/mshyperv.c +18 −0
  137. arch/x86/kernel/cpu/mtrr/generic.c +3 −3
  138. arch/x86/kernel/cpu/resctrl/rdtgroup.c +49 −68
  139. arch/x86/kernel/sev-es-shared.c +2 −2
  140. arch/x86/kvm/lapic.c +2 −2
  141. arch/x86/kvm/mmu.h +1 −1
  142. arch/x86/kvm/mmu/mmu.c +30 −23
  143. arch/x86/kvm/mmu/tdp_mmu.c +54 −59
  144. arch/x86/kvm/mmu/tdp_mmu.h +3 −1
  145. arch/x86/kvm/svm/nested.c +8 −0
  146. arch/x86/kvm/svm/sev.c +23 −1
  147. arch/x86/kvm/svm/svm.c +10 −2
  148. arch/x86/kvm/svm/svm.h +2 −0
  149. arch/x86/kvm/vmx/nested.c +2 −0
  150. arch/x86/kvm/vmx/vmx.c +2 −0
  151. arch/x86/kvm/x86.c +24 −6
  152. arch/x86/mm/pgtable.c +2 −0
  153. arch/x86/xen/enlighten_hvm.c +12 −3
  154. arch/x86/xen/smp_hvm.c +17 −10
  155. arch/xtensa/include/asm/Kbuild +0 −1
  156. block/bfq-iosched.c +4 −4
  157. block/blk-core.c +7 −6
  158. block/blk-iocost.c +11 −5
  159. block/blk-mq-debugfs.c +2 −1
  160. block/blk-mq.c +2 −2
  161. block/blk-pm.c +9 −6
  162. block/blk-pm.h +9 −5
  163. block/genhd.c +7 −4
  164. crypto/asymmetric_keys/asym_tpm.c +1 −1
  165. crypto/ecdh.c +2 −1
  166. crypto/xor.c +2 −0
  167. drivers/acpi/Kconfig +0 −6
  168. drivers/acpi/internal.h +1 −1
  169. drivers/acpi/scan.c +14 −1
  170. drivers/acpi/x86/s2idle.c +1 −13
  171. drivers/atm/idt77252.c +1 −1
  172. drivers/base/core.c +8 −1
  173. drivers/base/regmap/regmap-debugfs.c +7 −2
  174. drivers/block/Kconfig +1 −0
  175. drivers/block/rnbd/Kconfig +1 −0
  176. drivers/block/rnbd/README +1 −0
  177. drivers/block/rnbd/rnbd-clt.c +9 −9
  178. drivers/block/rnbd/rnbd-srv.c +5 −3
  179. drivers/clk/tegra/clk-tegra30.c +2 −0
  180. drivers/cpufreq/intel_pstate.c +3 −13
  181. drivers/cpufreq/powernow-k8.c +3 −6
  182. drivers/crypto/Kconfig +1 −0
  183. drivers/dma-buf/dma-buf.c +17 −4
  184. drivers/dma-buf/heaps/cma_heap.c +3 −0
  185. drivers/dma/dw-edma/dw-edma-core.c +2 −2
  186. drivers/dma/idxd/sysfs.c +2 −2
  187. drivers/dma/mediatek/mtk-hsdma.c +1 −0
  188. drivers/dma/milbeaut-xdmac.c +3 −1
  189. drivers/dma/qcom/bam_dma.c +1 −5
  190. drivers/dma/qcom/gpi.c +5 −5
  191. drivers/dma/stm32-mdma.c +1 −1
  192. drivers/dma/ti/k3-udma.c +3 −3
  193. drivers/dma/xilinx/xilinx_dma.c +8 −3
  194. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +36 −17
  195. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 −3
  196. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 −0
  197. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +17 −8
  198. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 −4
  199. drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +7 −1
  200. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +46 −2
  201. drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c +1 −1
  202. drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h +1 −1
  203. drivers/gpu/drm/amd/amdgpu/soc15.c +2 −1
  204. drivers/gpu/drm/amd/amdkfd/kfd_crat.c +7 −4
  205. drivers/gpu/drm/amd/display/Kconfig +1 −1
  206. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 −136
  207. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +0 −38
  208. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1 −53
  209. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h +0 −3
  210. drivers/gpu/drm/amd/display/dc/calcs/Makefile +0 −4
  211. drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +0 −21
  212. drivers/gpu/drm/amd/display/dc/core/dc_link.c +6 −1
  213. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 −1
  214. drivers/gpu/drm/amd/display/dc/dcn10/Makefile +0 −7
  215. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +1 −1
  216. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 −9
  217. drivers/gpu/drm/amd/display/dc/dcn20/Makefile +0 −4
  218. drivers/gpu/drm/amd/display/dc/dcn21/Makefile +0 −4
  219. drivers/gpu/drm/amd/display/dc/dcn30/Makefile +0 −5
  220. drivers/gpu/drm/amd/display/dc/dcn301/Makefile +0 −4
  221. drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1 −0
  222. drivers/gpu/drm/amd/display/dc/dcn302/Makefile +0 −4
  223. drivers/gpu/drm/amd/display/dc/dml/Makefile +0 −4
  224. drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c +6 −5
  225. drivers/gpu/drm/amd/display/dc/dsc/Makefile +0 −4
  226. drivers/gpu/drm/amd/display/dc/os_types.h +0 −4
  227. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +151 −15
  228. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.h +3 −0
  229. drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1 −1
  230. drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +2 −1
  231. drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +1 −0
  232. drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +1 −0
  233. drivers/gpu/drm/drm_plane.c +8 −1
  234. drivers/gpu/drm/i915/Makefile +1 −0
  235. drivers/gpu/drm/i915/display/icl_dsi.c +0 −4
  236. drivers/gpu/drm/i915/display/intel_display_types.h +3 −0
  237. drivers/gpu/drm/i915/display/intel_dp.c +6 −2
  238. drivers/gpu/drm/i915/display/intel_panel.c +5 −4
  239. drivers/gpu/drm/i915/display/vlv_dsi.c +13 −3
  240. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +3 −1
  241. drivers/gpu/drm/i915/gt/gen7_renderclear.c +94 −63
  242. drivers/gpu/drm/i915/gt/intel_ring_submission.c +4 −2
  243. drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +1 −0
  244. drivers/gpu/drm/i915/gvt/display.c +57 −24
  245. drivers/gpu/drm/i915/gvt/vgpu.c +2 −3
  246. drivers/gpu/drm/i915/i915_cmd_parser.c +9 −18
  247. drivers/gpu/drm/i915/i915_drv.c +4 −5
  248. drivers/gpu/drm/i915/i915_drv.h +0 −3
  249. drivers/gpu/drm/i915/i915_mitigations.c +146 −0
  250. drivers/gpu/drm/i915/i915_mitigations.h +13 −0
  251. drivers/gpu/drm/msm/adreno/a2xx_gpu.c +4 −2
  252. drivers/gpu/drm/msm/adreno/a3xx_gpu.c +4 −2
  253. drivers/gpu/drm/msm/adreno/a4xx_gpu.c +4 −2
  254. drivers/gpu/drm/msm/adreno/adreno_device.c +4 −0
  255. drivers/gpu/drm/msm/adreno/adreno_gpu.c +12 −9
  256. drivers/gpu/drm/msm/adreno/adreno_gpu.h +6 −0
  257. drivers/gpu/drm/msm/dp/dp_display.c +7 −0
  258. drivers/gpu/drm/msm/dp/dp_panel.c +9 −3
  259. drivers/gpu/drm/msm/msm_drv.c +4 −4
  260. drivers/gpu/drm/msm/msm_gem.c +9 −4
  261. drivers/gpu/drm/nouveau/dispnv50/Kbuild +1 −0
  262. drivers/gpu/drm/nouveau/dispnv50/core.c +1 −0
  263. drivers/gpu/drm/nouveau/dispnv50/curs.c +1 −0
  264. drivers/gpu/drm/nouveau/dispnv50/disp.c +2 −2
  265. drivers/gpu/drm/nouveau/dispnv50/disp.h +1 −1
  266. drivers/gpu/drm/nouveau/dispnv50/wimm.c +1 −0
  267. drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c +1 −1
  268. drivers/gpu/drm/nouveau/dispnv50/wndw.c +1 −0
  269. drivers/gpu/drm/nouveau/dispnv50/wndw.h +8 −0
  270. drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c +5 −5
  271. drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c +106 −0
  272. drivers/gpu/drm/nouveau/include/nvif/cl0080.h +1 −0
  273. drivers/gpu/drm/nouveau/include/nvif/class.h +5 −0
  274. drivers/gpu/drm/nouveau/include/nvkm/core/device.h +1 −0
  275. drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h +1 −0
  276. drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h +1 −0
  277. drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h +2 −0
  278. drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h +1 −0
  279. drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h +1 −0
  280. drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h +1 −0
  281. drivers/gpu/drm/nouveau/nouveau_backlight.c +1 −0
  282. drivers/gpu/drm/nouveau/nvif/disp.c +1 −0
  283. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +78 −9
  284. drivers/gpu/drm/nouveau/nvkm/engine/device/user.c +1 −0
  285. drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild +3 −0
  286. drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +27 −6
  287. drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c +46 −0
  288. drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h +4 −0
  289. drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h +2 −0
  290. drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c +52 −0
  291. drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h +1 −0
  292. drivers/gpu/drm/nouveau/nvkm/engine/disp/sorga102.c +140 −0
  293. drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c +1 −1
  294. drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c +1 −1
  295. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c +1 −1
  296. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c +3 −0
  297. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild +1 −0
  298. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/ga100.c +76 −0
  299. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h +1 −0
  300. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +1 −1
  301. drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild +3 −0
  302. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga100.c +40 −0
  303. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c +40 −0
  304. drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c +1 −1
  305. drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h +2 −0
  306. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h +1 −0
  307. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c +40 −0
  308. drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild +1 −0
  309. drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c +118 −0
  310. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild +1 −0
  311. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h +7 −0
  312. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +7 −3
  313. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +11 −6
  314. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gk110.c +45 −0
  315. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gm200.c +7 −0
  316. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h +1 −1
  317. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h +4 −0
  318. drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c +7 −3
  319. drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c +7 −3
  320. drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild +1 −0
  321. drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c +74 −0
  322. drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c +3 −3
  323. drivers/gpu/drm/radeon/radeon_ttm.c +0 −3
  324. drivers/gpu/drm/ttm/ttm_pool.c +11 −13
  325. drivers/hid/Kconfig +1 −0
  326. drivers/hid/amd-sfh-hid/amd_sfh_client.c +4 −4
  327. drivers/hid/amd-sfh-hid/amd_sfh_hid.h +1 −1
  328. drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +1 −1
  329. drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +1 −1
  330. drivers/hid/hid-ids.h +1 −0
  331. drivers/hid/hid-input.c +2 −0
  332. drivers/hid/hid-logitech-dj.c +4 −0
  333. drivers/hid/hid-logitech-hidpp.c +2 −0
  334. drivers/hid/hid-multitouch.c +4 −0
  335. drivers/hid/hid-uclogic-params.c +1 −1
  336. drivers/hid/hid-wiimote-core.c +1 −1
  337. drivers/hid/wacom_sys.c +32 −3
  338. drivers/hv/vmbus_drv.c +0 −2
  339. drivers/hwmon/amd_energy.c +2 −1
  340. drivers/hwmon/pwm-fan.c +11 −1
  341. drivers/i2c/busses/i2c-i801.c +1 −1
  342. drivers/i2c/busses/i2c-mt65xx.c +22 −5
  343. drivers/i2c/busses/i2c-sprd.c +7 −1
  344. drivers/ide/ide-atapi.c +0 −1
  345. drivers/ide/ide-io.c +1 −6
  346. drivers/ide/ide-pm.c +1 −1
  347. drivers/idle/intel_idle.c +40 −1
  348. drivers/infiniband/core/cma_configfs.c +3 −1
  349. drivers/infiniband/core/restrack.c +1 −0
  350. drivers/infiniband/core/ucma.c +72 −63
  351. drivers/infiniband/core/umem.c +1 −1
  352. drivers/infiniband/hw/mlx5/main.c +2 −2
  353. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 −1
  354. drivers/infiniband/hw/usnic/usnic_ib_verbs.c +3 −0
  355. drivers/interconnect/imx/imx.c +2 −1
  356. drivers/interconnect/imx/imx8mq.c +2 −0
  357. drivers/interconnect/qcom/Kconfig +15 −8
  358. drivers/iommu/amd/init.c +1 −2
  359. drivers/iommu/amd/iommu.c +3 −0
  360. drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +4 −0
  361. drivers/iommu/dma-iommu.c +0 −27
  362. drivers/iommu/intel/dmar.c +2 −2
  363. drivers/iommu/intel/iommu.c +108 −41
  364. drivers/iommu/intel/irq_remapping.c +2 −0
  365. drivers/iommu/intel/svm.c +33 −12
  366. drivers/iommu/iova.c +4 −4
  367. drivers/isdn/mISDN/Kconfig +1 −0
  368. drivers/lightnvm/Kconfig +1 −0
  369. drivers/md/Kconfig +2 −0
  370. drivers/md/bcache/features.c +1 −1
  371. drivers/md/bcache/features.h +25 −5
  372. drivers/md/bcache/super.c +49 −4
  373. drivers/md/dm-bufio.c +6 −0
  374. drivers/md/dm-crypt.c +155 −22
  375. drivers/md/dm-integrity.c +50 −12
  376. drivers/md/dm-raid.c +3 −3
  377. drivers/md/dm-snap.c +24 −0
  378. drivers/md/dm.c +1 −1
  379. drivers/misc/habanalabs/common/command_submission.c +58 −19
  380. drivers/misc/habanalabs/common/device.c +5 −3
  381. drivers/misc/habanalabs/common/firmware_if.c +44 −16
  382. drivers/misc/habanalabs/common/habanalabs.h +3 −1
  383. drivers/misc/habanalabs/common/habanalabs_drv.c +1 −0
  384. drivers/misc/habanalabs/common/habanalabs_ioctl.c +6 −1
  385. drivers/misc/habanalabs/common/hw_queue.c +4 −1
  386. drivers/misc/habanalabs/common/pci.c +17 −11
  387. drivers/misc/habanalabs/gaudi/gaudi.c +83 −108
  388. drivers/misc/habanalabs/gaudi/gaudiP.h +0 −7
  389. drivers/misc/habanalabs/gaudi/gaudi_coresight.c +2 −1
  390. drivers/misc/habanalabs/goya/goya.c +45 −30
  391. drivers/misc/habanalabs/include/common/hl_boot_if.h +8 −1
  392. drivers/misc/pvpanic.c +15 −4
  393. drivers/net/bareudp.c +16 −9
  394. drivers/net/can/Kconfig +1 −0
  395. drivers/net/can/m_can/m_can.c +0 −2
  396. drivers/net/can/m_can/tcan4x5x.c +0 −26
  397. drivers/net/can/rcar/Kconfig +2 −2
  398. drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +9 −10
  399. drivers/net/dsa/hirschmann/Kconfig +1 −0
  400. drivers/net/dsa/lantiq_gswip.c +11 −23
  401. drivers/net/ethernet/aquantia/Kconfig +0 −1
  402. drivers/net/ethernet/broadcom/bcmsysport.c +1 −0
  403. drivers/net/ethernet/broadcom/bnxt/bnxt.c +19 −19
  404. drivers/net/ethernet/broadcom/bnxt/bnxt.h +6 −1
  405. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 −1
  406. drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +6 −2
  407. drivers/net/ethernet/cadence/macb_main.c +1 −1
  408. drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h +7 −0
  409. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h +4 −0
  410. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +54 −49
  411. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c +41 −0
  412. drivers/net/ethernet/ethoc.c +2 −1
  413. drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c +1 −0
  414. drivers/net/ethernet/freescale/fs_enet/mii-fec.c +1 −0
  415. drivers/net/ethernet/freescale/ucc_geth.c +2 −1
  416. drivers/net/ethernet/freescale/ucc_geth.h +8 −1
  417. drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +4 −0
  418. drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h +2 −2
  419. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +6 −3
  420. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +2 −0
  421. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +6 −3
  422. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +2 −0
  423. drivers/net/ethernet/ibm/ibmvnic.c +5 −5
  424. drivers/net/ethernet/intel/e1000e/e1000.h +1 −0
  425. drivers/net/ethernet/intel/e1000e/ethtool.c +46 −0
  426. drivers/net/ethernet/intel/e1000e/ich8lan.c +14 −3
  427. drivers/net/ethernet/intel/e1000e/netdev.c +10 −49
  428. drivers/net/ethernet/intel/i40e/i40e.h +3 −0
  429. drivers/net/ethernet/intel/i40e/i40e_main.c +10 −0
  430. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 −2
  431. drivers/net/ethernet/intel/i40e/i40e_xsk.c +1 −1
  432. drivers/net/ethernet/intel/iavf/iavf_main.c +1 −3
  433. drivers/net/ethernet/marvell/mvneta.c +2 −2
  434. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +20 −9
  435. drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +36 −2
  436. drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h +1 −1
  437. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +11 −3
  438. drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +5 −0
  439. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +49 −28
  440. drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +9 −0
  441. drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h +5 −3
  442. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +18 −6
  443. drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +3 −0
  444. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +2 −1
  445. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +5 −4
  446. drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c +13 −14
  447. drivers/net/ethernet/mellanox/mlx5/core/lag.c +5 −6
  448. drivers/net/ethernet/mellanox/mlx5/core/main.c +5 −2
  449. drivers/net/ethernet/mellanox/mlx5/core/rdma.c +1 −1
  450. drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +8 −5
  451. drivers/net/ethernet/natsemi/macsonic.c +10 −2
  452. drivers/net/ethernet/natsemi/xtsonic.c +5 −2
  453. drivers/net/ethernet/pensando/ionic/ionic_txrx.c +1 −1
  454. drivers/net/ethernet/qlogic/Kconfig +1 −0
  455. drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +1 −6
  456. drivers/net/ethernet/qlogic/qede/qede_fp.c +5 −0
  457. drivers/net/ethernet/realtek/r8169_main.c +4 −2
  458. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +4 −0
  459. drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +1 −1
  460. drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +82 −47
  461. drivers/net/ethernet/stmicro/stmmac/dwmac5.c +4 −48
  462. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 −3
  463. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +18 −2
  464. drivers/net/ethernet/ti/cpts.c +2 −0
  465. drivers/net/ipa/gsi.c +69 −58
  466. drivers/net/ipa/ipa_clock.c +2 −2
  467. drivers/net/ipa/ipa_modem.c +1 −0
  468. drivers/net/phy/smsc.c +2 −1
  469. drivers/net/ppp/ppp_generic.c +9 −3
  470. drivers/net/tun.c +1 −1
  471. drivers/net/usb/Kconfig +0 −1
  472. drivers/net/usb/cdc_ether.c +7 −0
  473. drivers/net/usb/cdc_ncm.c +6 −5
  474. drivers/net/usb/qmi_wwan.c +1 −0
  475. drivers/net/usb/r8152.c +1 −0
  476. drivers/net/usb/r8153_ecm.c +8 −0
  477. drivers/net/usb/rndis_host.c +1 −1
  478. drivers/net/virtio_net.c +7 −5
  479. drivers/net/wan/Kconfig +1 −0
  480. drivers/net/wan/hdlc_ppp.c +7 −0
  481. drivers/net/wireless/ath/ath11k/core.c +1 −1
  482. drivers/net/wireless/ath/ath11k/dp_rx.c +7 −3
  483. drivers/net/wireless/ath/ath11k/mac.c +6 −2
  484. drivers/net/wireless/ath/ath11k/pci.c +40 −4
  485. drivers/net/wireless/ath/ath11k/pci.h +2 −0
  486. drivers/net/wireless/ath/ath11k/peer.c +17 −0
  487. drivers/net/wireless/ath/ath11k/peer.h +2 −0
  488. drivers/net/wireless/ath/ath11k/qmi.c +22 −2
  489. drivers/net/wireless/ath/ath11k/qmi.h +1 −0
  490. drivers/net/wireless/ath/ath11k/wmi.c +3 −0
  491. drivers/net/wireless/ath/wil6210/Kconfig +1 −0
  492. drivers/net/wireless/mediatek/mt76/mt7915/init.c +2 −2
  493. drivers/net/wireless/mediatek/mt76/sdio.c +7 −12
  494. drivers/net/wireless/mediatek/mt76/usb.c +2 −7
  495. drivers/net/wireless/realtek/rtlwifi/core.c +5 −3
  496. drivers/nvme/host/core.c +11 −8
  497. drivers/nvme/host/fc.c +14 −1
  498. drivers/nvme/host/nvme.h +2 −7
  499. drivers/nvme/host/pci.c +6 −4
  500. drivers/nvme/host/tcp.c +13 −3
  501. drivers/nvme/target/fcloop.c +4 −3
  502. drivers/nvme/target/rdma.c +18 −8
  503. drivers/opp/core.c +7 −2
  504. drivers/perf/arm_pmu.c +0 −5
  505. drivers/ptp/Kconfig +2 −0
  506. drivers/regulator/Kconfig +1 −0
  507. drivers/regulator/bd718x7-regulator.c +57 −0
  508. drivers/regulator/pf8x00-regulator.c +6 −2
  509. drivers/regulator/qcom-rpmh-regulator.c +1 −1
  510. drivers/s390/net/qeth_core.h +2 −1
  511. drivers/s390/net/qeth_core_main.c +25 −13
  512. drivers/s390/net/qeth_l2_main.c +1 −1
  513. drivers/s390/net/qeth_l3_main.c +2 −2
  514. drivers/scsi/cxgbi/cxgb4i/Kconfig +1 −0
  515. drivers/scsi/hisi_sas/hisi_sas.h +4 −0
  516. drivers/scsi/hisi_sas/hisi_sas_main.c +11 −0
  517. drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +53 −13
  518. drivers/scsi/megaraid/megaraid_sas_base.c +39 −0
  519. drivers/scsi/megaraid/megaraid_sas_fusion.c +16 −13
  520. drivers/scsi/mpt3sas/Kconfig +1 −1
  521. drivers/scsi/mpt3sas/mpt3sas_base.c +1 −1
  522. drivers/scsi/qedi/qedi_main.c +2 −2
  523. drivers/scsi/scsi_debug.c +3 −2
  524. drivers/scsi/scsi_lib.c +14 −13
  525. drivers/scsi/scsi_transport_spi.c +19 −8
  526. drivers/scsi/sd.c +3 −3
  527. drivers/scsi/ufs/ufs-mediatek-trace.h +1 −1
  528. drivers/scsi/ufs/ufs-mediatek.c +21 −0
  529. drivers/scsi/ufs/ufs-mediatek.h +1 −0
  530. drivers/scsi/ufs/ufs.h +1 −1
  531. drivers/scsi/ufs/ufshcd-pci.c +71 −2
  532. drivers/scsi/ufs/ufshcd.c +39 −30
  533. drivers/scsi/ufs/ufshcd.h +5 −9
  534. drivers/spi/spi-altera.c +14 −12
  535. drivers/spi/spi-cadence.c +4 −2
  536. drivers/spi/spi-fsl-spi.c +2 −3
  537. drivers/spi/spi-geni-qcom.c +80 −4
  538. drivers/spi/spi-stm32.c +2 −2
  539. drivers/spi/spi.c +8 −3
  540. drivers/staging/comedi/comedi_fops.c +3 −1
  541. drivers/staging/hikey9xx/hisi-spmi-controller.c +15 −6
  542. drivers/staging/media/atomisp/pci/atomisp_subdev.c +0 −20
  543. drivers/staging/mt7621-dma/mtk-hsdma.c +3 −1
  544. drivers/target/target_core_xcopy.c +70 −49
  545. drivers/target/target_core_xcopy.h +1 −0
  546. drivers/tty/Kconfig +14 −0
  547. drivers/tty/Makefile +2 −1
  548. drivers/tty/serial/sifive.c +1 −0
  549. drivers/tty/ttynull.c +0 −18
  550. drivers/usb/chipidea/ci_hdrc_imx.c +5 −1
  551. drivers/usb/class/cdc-acm.c +4 −0
  552. drivers/usb/class/cdc-wdm.c +13 −3
  553. drivers/usb/class/usblp.c +19 −2
  554. drivers/usb/core/hcd.c +3 −5
  555. drivers/usb/dwc3/core.h +1 −0
  556. drivers/usb/dwc3/dwc3-meson-g12a.c +1 −1
  557. drivers/usb/dwc3/gadget.c +5 −11
  558. drivers/usb/dwc3/ulpi.c +21 −17
  559. drivers/usb/gadget/Kconfig +2 −0
  560. drivers/usb/gadget/composite.c +8 −2
  561. drivers/usb/gadget/configfs.c +13 −6
  562. drivers/usb/gadget/function/f_printer.c +1 −0
  563. drivers/usb/gadget/function/f_uac2.c +55 −14
  564. drivers/usb/gadget/function/u_ether.c +5 −4
  565. drivers/usb/gadget/legacy/acm_ms.c +3 −1
  566. drivers/usb/gadget/udc/Kconfig +1 −1
  567. drivers/usb/gadget/udc/Makefile +0 −1
  568. drivers/usb/gadget/udc/core.c +1 −2
  569. drivers/usb/gadget/udc/dummy_hcd.c +23 −12
  570. drivers/usb/gadget/udc/fsl_mxc_udc.c +0 −122
  571. drivers/usb/host/xhci.c +12 −12
  572. drivers/usb/misc/yurex.c +3 −0
  573. drivers/usb/serial/iuu_phoenix.c +15 −5
  574. drivers/usb/serial/option.c +3 −0
  575. drivers/usb/storage/unusual_uas.h +7 −0
  576. drivers/usb/typec/altmodes/Kconfig +1 −1
  577. drivers/usb/typec/class.c +2 −0
  578. drivers/usb/typec/mux/intel_pmc_mux.c +11 −0
  579. drivers/usb/usbip/vhci_hcd.c +2 −0
  580. drivers/vhost/net.c +3 −3
  581. drivers/vhost/vsock.c +65 −3
  582. drivers/xen/events/events_base.c +0 −10
  583. drivers/xen/platform-pci.c +7 −1
  584. drivers/xen/privcmd.c +19 −6
  585. drivers/xen/xenbus/xenbus.h +1 −0
  586. drivers/xen/xenbus/xenbus_comms.c +0 −8
  587. drivers/xen/xenbus/xenbus_probe.c +67 −14
  588. fs/afs/dir.c +26 −23
  589. fs/afs/dir_edit.c +2 −4
  590. fs/afs/xdr_fs.h +21 −4
  591. fs/block_dev.c +6 −3
  592. fs/btrfs/btrfs_inode.h +9 −0
  593. fs/btrfs/ctree.c +22 −2
  594. fs/btrfs/ctree.h +27 −2
  595. fs/btrfs/dev-replace.c +1 −1
  596. fs/btrfs/discard.c +36 −34
  597. fs/btrfs/disk-io.c +9 −6
  598. fs/btrfs/extent-tree.c +2 −0
  599. fs/btrfs/extent_io.c +1 −3
  600. fs/btrfs/file-item.c +2 −0
  601. fs/btrfs/inode.c +51 −18
  602. fs/btrfs/ioctl.c +1 −1
  603. fs/btrfs/print-tree.c +5 −5
  604. fs/btrfs/print-tree.h +1 −1
  605. fs/btrfs/qgroup.c +30 −13
  606. fs/btrfs/reflink.c +15 −0
  607. fs/btrfs/relocation.c +6 −1
  608. fs/btrfs/send.c +31 −18
  609. fs/btrfs/space-info.c +3 −1
  610. fs/btrfs/super.c +37 −3
  611. fs/btrfs/tests/btrfs-tests.c +8 −2
  612. fs/btrfs/tests/inode-tests.c +0 −9
  613. fs/btrfs/tree-checker.c +7 −0
  614. fs/btrfs/volumes.c +2 −2
  615. fs/ceph/mds_client.c +22 −31
  616. fs/cifs/connect.c +1 −1
  617. fs/cifs/dfs_cache.c +2 −1
  618. fs/cifs/fs_context.c +1 −3
  619. fs/cifs/smb2pdu.c +1 −1
  620. fs/cifs/smb2pdu.h +1 −1
  621. fs/ext4/ext4_jbd2.c +0 −17
  622. fs/ext4/ext4_jbd2.h +0 −5
  623. fs/ext4/fast_commit.c +18 −17
  624. fs/ext4/file.c +5 −2
  625. fs/ext4/inode.c +5 −1
  626. fs/ext4/ioctl.c +3 −0
  627. fs/ext4/namei.c +17 −10
  628. fs/ext4/resize.c +16 −4
  629. fs/ext4/super.c +118 −72
  630. fs/ext4/xattr.c +4 −1
  631. fs/file.c +0 −2
  632. fs/io_uring.c +248 −112
  633. fs/namespace.c +5 −2
  634. fs/nfs/delegation.c +7 −5
  635. fs/nfs/internal.h +30 −8
  636. fs/nfs/nfs4proc.c +11 −17
  637. fs/nfs/nfs4super.c +2 −2
  638. fs/nfs/pnfs.c +35 −32
  639. fs/nfs/pnfs.h +3 −5
  640. fs/nfs/pnfs_nfs.c +10 −12
  641. fs/nfsd/nfs3xdr.c +6 −1
  642. fs/nfsd/nfs4proc.c +5 −0
  643. fs/nfsd/nfs4xdr.c +36 −20
  644. fs/nfsd/nfssvc.c +0 −6
  645. fs/nfsd/xdr4.h +0 −1
  646. fs/notify/fanotify/fanotify_user.c +7 −10
  647. fs/proc/task_mmu.c +30 −23
  648. fs/select.c +11 −3
  649. fs/zonefs/Kconfig +1 −0
  650. include/asm-generic/Kbuild +1 −0
  651. include/asm-generic/bitops/atomic.h +3 −3
  652. include/kvm/arm_pmu.h +1 −1
  653. include/linux/acpi.h +7 −0
  654. include/linux/blk-mq.h +2 −2
  655. include/linux/blkdev.h +13 −5
  656. include/linux/build_bug.h +0 −5
  657. include/linux/ceph/msgr.h +2 −2
  658. include/linux/compiler-gcc.h +6 −0
  659. include/linux/compiler_attributes.h +6 −0
  660. include/linux/compiler_types.h +0 −6
  661. include/linux/console.h +0 −3
  662. include/linux/dm-bufio.h +1 −0
  663. include/linux/intel-iommu.h +12 −6
  664. include/linux/kasan.h +5 −1
  665. include/linux/kcov.h +21 −0
  666. include/linux/kdev_t.h +11 −11
  667. include/linux/memcontrol.h +1 −1
  668. include/linux/mlx5/mlx5_ifc.h +2 −1
  669. include/linux/mm.h +10 −2
  670. include/linux/perf/arm_pmu.h +0 −2
  671. include/linux/rcupdate.h +6 −0
  672. include/linux/sizes.h +3 −0
  673. include/linux/skbuff.h +2 −1
  674. include/linux/syscalls.h +24 −0
  675. include/net/red.h +3 −1
  676. include/net/xdp_sock.h +0 −4
  677. include/net/xsk_buff_pool.h +5 −0
  678. include/soc/nps/common.h +0 −172
  679. include/soc/nps/mtm.h +0 −59
  680. include/trace/events/afs.h +2 −0
  681. include/trace/events/sunrpc.h +53 −6
  682. include/uapi/linux/bcache.h +1 −1
  683. include/uapi/linux/if_link.h +3 −2
  684. include/uapi/linux/kvm.h +2 −0
  685. include/uapi/linux/netfilter/nf_tables.h +3 −0
  686. include/uapi/linux/ppp-ioctl.h +1 −1
  687. include/uapi/misc/habanalabs.h +5 −0
  688. include/xen/xenbus.h +1 −1
  689. init/main.c +3 −8
  690. kernel/bpf/hashtab.c +1 −0
  691. kernel/bpf/syscall.c +0 −1
  692. kernel/bpf/task_iter.c +9 −8
  693. kernel/cgroup/cgroup-v1.c +2 −0
  694. kernel/cgroup/cgroup.c +15 −15
  695. kernel/configs/android-recommended.config +0 −1
  696. kernel/exit.c +2 −0
  697. kernel/rcu/tasks.h +21 −4
  698. kernel/signal.c +3 −0
  699. kernel/trace/Kconfig +1 −1
  700. kernel/trace/trace_kprobe.c +1 −1
  701. kernel/workqueue.c +10 −3
  702. lib/Kconfig.debug +0 −8
  703. lib/fonts/font_ter16x32.c +3 −3
  704. lib/genalloc.c +13 −12
  705. lib/iov_iter.c +1 −1
  706. lib/raid6/Makefile +1 −1
  707. lib/zlib_dfltcc/Makefile +1 −1
  708. lib/zlib_dfltcc/dfltcc.c +5 −1
  709. lib/zlib_dfltcc/dfltcc_deflate.c +3 −0
  710. lib/zlib_dfltcc/dfltcc_inflate.c +2 −2
  711. lib/zlib_dfltcc/dfltcc_syms.c +0 −17
  712. mm/hugetlb.c +22 −2
  713. mm/kasan/generic.c +2 −0
  714. mm/kasan/init.c +2 −1
  715. mm/memory-failure.c +1 −1
  716. mm/memory.c +5 −3
  717. mm/memory_hotplug.c +1 −1
  718. mm/mempolicy.c +1 −1
  719. mm/mremap.c +3 −1
  720. mm/page-writeback.c +1 −1
  721. mm/page_alloc.c +21 −18
  722. mm/process_vm_access.c +1 −0
  723. mm/slub.c +3 −4
  724. mm/vmalloc.c +3 −1
  725. mm/vmscan.c +2 −0
  726. net/8021q/vlan.c +1 −2
  727. net/can/isotp.c +1 −0
  728. net/ceph/messenger_v2.c +12 −3
  729. net/core/dev.c +24 −13
  730. net/core/neighbour.c +2 −4
  731. net/core/net-sysfs.c +53 −12
  732. net/core/rtnetlink.c +6 −17
  733. net/core/skbuff.c +49 −8
  734. net/core/sock_reuseport.c +1 −1
  735. net/dcb/dcbnl.c +2 −0
  736. net/dsa/dsa2.c +4 −0
  737. net/dsa/master.c +10 −0
  738. net/ipv4/esp4.c +1 −6
  739. net/ipv4/fib_frontend.c +1 −1
  740. net/ipv4/gre_demux.c +1 −1
  741. net/ipv4/ip_output.c +1 −1
  742. net/ipv4/ip_tunnel.c +5 −6
  743. net/ipv4/netfilter/arp_tables.c +1 −1
  744. net/ipv4/netfilter/ip_tables.c +1 −1
  745. net/ipv4/nexthop.c +4 −2
  746. net/ipv6/esp6.c +1 −6
  747. net/ipv6/ip6_fib.c +2 −3
  748. net/ipv6/ip6_output.c +40 −1
  749. net/ipv6/netfilter/ip6_tables.c +1 −1
  750. net/ipv6/sit.c +4 −1
  751. net/lapb/lapb_iface.c +1 −0
  752. net/mptcp/protocol.c +27 −47
  753. net/ncsi/ncsi-rsp.c +1 −1
  754. net/netfilter/ipset/ip_set_hash_gen.h +18 −24
  755. net/netfilter/nf_conntrack_standalone.c +3 −0
  756. net/netfilter/nf_nat_core.c +1 −0
  757. net/netfilter/nf_tables_api.c +7 −3
  758. net/netfilter/nft_dynset.c +10 −5
  759. net/netfilter/xt_RATEEST.c +3 −0
  760. net/packet/af_packet.c +3 −1
  761. net/qrtr/ns.c +4 −3
  762. net/qrtr/qrtr.c +11 −5
  763. net/qrtr/qrtr.h +1 −1
  764. net/rxrpc/input.c +1 −1
  765. net/rxrpc/key.c +4 −2
  766. net/sched/sch_choke.c +1 −1
  767. net/sched/sch_gred.c +1 −1
  768. net/sched/sch_red.c +1 −1
  769. net/sched/sch_sfq.c +1 −1
  770. net/sched/sch_taprio.c +4 −3
  771. net/smc/smc_core.c +13 −7
  772. net/smc/smc_ib.c +3 −3
  773. net/smc/smc_ism.c +2 −1
  774. net/sunrpc/addr.c +1 −1
  775. net/sunrpc/svc_xprt.c +2 −2
  776. net/sunrpc/svcsock.c +85 −1
  777. net/tipc/link.c +8 −3
  778. net/tipc/node.c +1 −1
  779. net/wireless/Kconfig +1 −0
  780. net/xdp/xsk.c +13 −3
  781. net/xdp/xsk_buff_pool.c +1 −2
  782. net/xdp/xsk_queue.h +5 −0
  783. scripts/checkpatch.pl +6 −0
  784. scripts/config +1 −0
  785. scripts/depmod.sh +2 −0
  786. scripts/gcc-plugins/Makefile +2 −2
  787. scripts/kconfig/Makefile +0 −10
  788. scripts/kconfig/mconf-cfg.sh +3 −1
  789. security/lsm_audit.c +5 −2
  790. sound/firewire/fireface/ff-transaction.c +1 −1
  791. sound/firewire/tascam/tascam-transaction.c +1 −1
  792. sound/pci/hda/hda_intel.c +6 −5
  793. sound/pci/hda/hda_tegra.c +1 −1
  794. sound/pci/hda/patch_conexant.c +1 −0
  795. sound/pci/hda/patch_hdmi.c +1 −1
  796. sound/pci/hda/patch_realtek.c +15 −1
  797. sound/pci/hda/patch_via.c +13 −0
  798. sound/soc/amd/raven/pci-acp3x.c +3 −13
  799. sound/soc/amd/renoir/rn-pci-acp3x.c +14 −0
  800. sound/soc/atmel/Kconfig +2 −2
  801. sound/soc/codecs/Kconfig +1 −1
  802. sound/soc/codecs/max98373-i2c.c +20 −0
  803. sound/soc/codecs/max98373-sdw.c +20 −0
  804. sound/soc/codecs/max98373.c +31 −3
  805. sound/soc/codecs/max98373.h +8 −0
  806. sound/soc/codecs/rt711.c +6 −0
  807. sound/soc/fsl/imx-hdmi.c +1 −0
  808. sound/soc/intel/boards/haswell.c +1 −0
  809. sound/soc/intel/skylake/cnl-sst.c +1 −0
  810. sound/soc/meson/axg-tdm-interface.c +13 −1
  811. sound/soc/meson/axg-tdmin.c +2 −11
  812. sound/soc/qcom/lpass-cpu.c +2 −18
  813. sound/soc/qcom/lpass-platform.c +35 −15
  814. sound/soc/sh/rcar/adg.c +10 −8
  815. sound/soc/soc-dapm.c +1 −0
  816. sound/soc/sof/Kconfig +1 −1
  817. sound/usb/card.c +2 −3
  818. sound/usb/card.h +3 −0
  819. sound/usb/endpoint.c +72 −12
  820. sound/usb/endpoint.h +1 −1
  821. sound/usb/implicit.c +46 −15
  822. sound/usb/midi.c +4 −0
  823. sound/usb/quirks-table.h +6 −0
  824. sound/usb/quirks.c +46 −12
  825. sound/usb/usbaudio.h +1 −0
  826. tools/bootconfig/scripts/bconf2ftrace.sh +1 −0
  827. tools/bootconfig/scripts/ftrace2bconf.sh +4 −0
  828. tools/bpf/bpftool/net.c +0 −1
  829. tools/bpf/resolve_btfids/main.c +12 −5
  830. tools/include/linux/build_bug.h +0 −5
  831. tools/include/uapi/linux/kvm.h +2 −0
  832. tools/lib/perf/tests/test-cpumap.c +1 −1
  833. tools/lib/perf/tests/test-evlist.c +4 −3
  834. tools/lib/perf/tests/test-evsel.c +1 −1
  835. tools/lib/perf/tests/test-threadmap.c +1 −1
  836. tools/perf/examples/bpf/5sec.c +1 −1
  837. tools/perf/tests/shell/stat+shadow_stat.sh +14 −16
  838. tools/perf/util/header.c +8 −0
  839. tools/perf/util/machine.c +2 −2
  840. tools/perf/util/session.c +1 −1
  841. tools/perf/util/stat-shadow.c +189 −177
  842. tools/testing/kunit/kunit_kernel.py +1 −1
  843. tools/testing/selftests/Makefile +4 −2
  844. tools/testing/selftests/arm64/fp/fpsimd-test.S +1 −1
  845. tools/testing/selftests/arm64/fp/sve-test.S +1 −1
  846. tools/testing/selftests/bpf/Makefile +3 −0
  847. tools/testing/selftests/bpf/progs/bprm_opts.c +1 −1
  848. tools/testing/selftests/bpf/test_maps.c +42 −6
  849. tools/testing/selftests/bpf/xdpxceiver.c +2 −2
  850. tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh +1 −1
  851. tools/testing/selftests/kvm/Makefile +1 −1
  852. tools/testing/selftests/kvm/demand_paging_test.c +32 −86
  853. tools/testing/selftests/kvm/dirty_log_perf_test.c +46 −99
  854. tools/testing/selftests/kvm/dirty_log_test.c +37 −88
  855. tools/testing/selftests/kvm/include/guest_modes.h +21 −0
  856. tools/testing/selftests/kvm/include/kvm_util.h +9 −0
  857. tools/testing/selftests/kvm/include/perf_test_util.h +12 −155
  858. tools/testing/selftests/kvm/lib/guest_modes.c +70 −0
  859. tools/testing/selftests/kvm/lib/kvm_util.c +1 −8
  860. tools/testing/selftests/kvm/lib/perf_test_util.c +134 −0
  861. tools/testing/selftests/net/fib_nexthops.sh +1 −1
  862. tools/testing/selftests/net/pmtu.sh +69 −2
  863. tools/testing/selftests/net/tls.c +2 −2
  864. tools/testing/selftests/net/udpgro.sh +34 −0
  865. tools/testing/selftests/netfilter/Makefile +2 −1
  866. tools/testing/selftests/netfilter/ipip-conntrack-mtu.sh +206 −0
  867. tools/testing/selftests/netfilter/nft_conntrack_helper.sh +9 −3
  868. tools/testing/selftests/vDSO/.gitignore +3 −0
  869. tools/testing/selftests/vDSO/vdso_test_correctness.c +1 −1
  870. tools/testing/selftests/vm/Makefile +5 −5
  871. tools/testing/selftests/wireguard/qemu/debug.config +0 −1
  872. virt/kvm/kvm_main.c +1 −2
CREDITS+24−0
@@ -710,6 +710,10 @@ S: Las Cuevas 2385 - Bo Guemes · 709 unmodified lines
710710 S: Las Heras, Mendoza CP 5539
711711 S: Argentina
712712
713+N: Jay Cliburn
714+E: jcliburn@gmail.com
715+D: ATLX Ethernet drivers
716+
713717 N: Steven P. Cole
714718 E: scole@lanl.gov
715719 E: elenstev@mesatop.com
@@ -1284,6 +1288,10 @@ D: Major kbuild rework during the 2.5 cycle · 568 unmodified lines
12841288 D: ISDN Maintainer
12851289 S: USA
12861290
1291+N: Gerrit Renker
1292+E: gerrit@erg.abdn.ac.uk
1293+D: DCCP protocol support.
1294+
12871295 N: Philip Gladstone
12881296 E: philip@gladstonefamily.net
12891297 D: Kernel / timekeeping stuff
@@ -2138,6 +2146,10 @@ E: seasons@falcon.sch.bme.hu · 848 unmodified lines
21382146 E: seasons@makosteszta.sote.hu
21392147 D: Original author of software suspend
21402148
2149+N: Alexey Kuznetsov
2150+E: kuznet@ms2.inr.ac.ru
2151+D: Author and maintainer of large parts of the networking stack
2152+
21412153 N: Jaroslav Kysela
21422154 E: perex@perex.cz
21432155 W: https://www.perex.cz
@@ -2696,6 +2708,10 @@ N: Wolfgang Muees · 552 unmodified lines
26962708 E: wolfgang@iksw-muees.de
26972709 D: Auerswald USB driver
26982710
2711+N: Shrijeet Mukherjee
2712+E: shrijeet@gmail.com
2713+D: Network routing domains (VRF).
2714+
26992715 N: Paul Mundt
27002716 E: paul.mundt@gmail.com
27012717 D: SuperH maintainer
@@ -4110,6 +4126,10 @@ S: B-1206 Jingmao Guojigongyu · 1408 unmodified lines
41104126 S: 16 Baliqiao Nanjie, Beijing 101100
41114127 S: People's Repulic of China
41124128
4129+N: Aviad Yehezkel
4130+E: aviadye@nvidia.com
4131+D: Kernel TLS implementation and offload support.
4132+
41134133 N: Victor Yodaiken
41144134 E: yodaiken@fsmlabs.com
41154135 D: RTLinux (RealTime Linux)
@@ -4167,6 +4187,10 @@ S: 1507 145th Place SE #B5 · 51 unmodified lines
41674187 S: Bellevue, Washington 98007
41684188 S: USA
41694189
4190+N: Wensong Zhang
4191+E: wensong@linux-vs.org
4192+D: IP virtual server (IPVS).
4193+
41704194 N: Haojian Zhuang
41714195 E: haojian.zhuang@gmail.com
41724196 D: MMP support
Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst+4−4
@@ -473,7 +473,7 @@ read-side critical sections that follow the idle period (the oval near · 472 unmodified lines
473473 the bottom of the diagram above).
474474
475475 Plumbing this into the full grace-period execution is described
476−`below <#Forcing%20Quiescent%20States>`__.
476+`below <Forcing Quiescent States_>`__.
477477
478478 CPU-Hotplug Interface
479479 ^^^^^^^^^^^^^^^^^^^^^
@@ -494,7 +494,7 @@ mask to detect CPUs having gone offline since the beginning of this · 14 unmodified lines
494494 grace period.
495495
496496 Plumbing this into the full grace-period execution is described
497−`below <#Forcing%20Quiescent%20States>`__.
497+`below <Forcing Quiescent States_>`__.
498498
499499 Forcing Quiescent States
500500 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -532,7 +532,7 @@ from other CPUs. · 31 unmodified lines
532532 | RCU. But this diagram is complex enough as it is, so simplicity |
533533 | overrode accuracy. You can think of it as poetic license, or you can |
534534 | think of it as misdirection that is resolved in the |
535−| `stitched-together diagram <#Putting%20It%20All%20Together>`__. |
535+| `stitched-together diagram <Putting It All Together_>`__. |
536536 +-----------------------------------------------------------------------+
537537
538538 Grace-Period Cleanup
@@ -596,7 +596,7 @@ maintain ordering. For example, if the callback function wakes up a task · 57 unmodified lines
596596 that runs on some other CPU, proper ordering must in place in both the
597597 callback function and the task being awakened. To see why this is
598598 important, consider the top half of the `grace-period
599−cleanup <#Grace-Period%20Cleanup>`__ diagram. The callback might be
599+cleanup`_ diagram. The callback might be
600600 running on a CPU corresponding to the leftmost leaf ``rcu_node``
601601 structure, and awaken a task that is to run on a CPU corresponding to
602602 the rightmost leaf ``rcu_node`` structure, and the grace-period kernel
Documentation/RCU/Design/Requirements/Requirements.rst+10−10
@@ -45,7 +45,7 @@ requirements: · 44 unmodified lines
4545 #. `Other RCU Flavors`_
4646 #. `Possible Future Changes`_
4747
48−This is followed by a `summary <#Summary>`__, however, the answers to
48+This is followed by a summary_, however, the answers to
4949 each quick quiz immediately follows the quiz. Select the big white space
5050 with your mouse to see the answer.
5151
@@ -1096,7 +1096,7 @@ memory barriers. · 1044 unmodified lines
10961096 | case, voluntary context switch) within an RCU read-side critical |
10971097 | section. However, sleeping locks may be used within userspace RCU |
10981098 | read-side critical sections, and also within Linux-kernel sleepable |
1099−| RCU `(SRCU) <#Sleepable%20RCU>`__ read-side critical sections. In |
1099+| RCU `(SRCU) <Sleepable RCU_>`__ read-side critical sections. In |
11001100 | addition, the -rt patchset turns spinlocks into a sleeping locks so |
11011101 | that the corresponding critical sections can be preempted, which also |
11021102 | means that these sleeplockified spinlocks (but not other sleeping |
@@ -1186,7 +1186,7 @@ non-preemptible (``CONFIG_PREEMPT=n``) kernels, and thus `tiny · 83 unmodified lines
11861186 RCU <https://lkml.kernel.org/g/20090113221724.GA15307@linux.vnet.ibm.com>`__
11871187 was born. Josh Triplett has since taken over the small-memory banner
11881188 with his `Linux kernel tinification <https://tiny.wiki.kernel.org/>`__
1189−project, which resulted in `SRCU <#Sleepable%20RCU>`__ becoming optional
1189+project, which resulted in `SRCU <Sleepable RCU_>`__ becoming optional
11901190 for those kernels not needing it.
11911191
11921192 The remaining performance requirements are, for the most part,
@@ -1457,8 +1457,8 @@ will vary as the value of ``HZ`` varies, and can also be changed using · 264 unmodified lines
14571457 the relevant Kconfig options and kernel boot parameters. RCU currently
14581458 does not do much sanity checking of these parameters, so please use
14591459 caution when changing them. Note that these forward-progress measures
1460−are provided only for RCU, not for `SRCU <#Sleepable%20RCU>`__ or `Tasks
1461−RCU <#Tasks%20RCU>`__.
1460+are provided only for RCU, not for `SRCU <Sleepable RCU_>`__ or `Tasks
1461+RCU`_.
14621462
14631463 RCU takes the following steps in ``call_rcu()`` to encourage timely
14641464 invocation of callbacks when any given non-\ ``rcu_nocbs`` CPU has
@@ -1477,8 +1477,8 @@ encouragement was provided: · 12 unmodified lines
14771477
14781478 Again, these are default values when running at ``HZ=1000``, and can be
14791479 overridden. Again, these forward-progress measures are provided only for
1480−RCU, not for `SRCU <#Sleepable%20RCU>`__ or `Tasks
1481−RCU <#Tasks%20RCU>`__. Even for RCU, callback-invocation forward
1480+RCU, not for `SRCU <Sleepable RCU_>`__ or `Tasks
1481+RCU`_. Even for RCU, callback-invocation forward
14821482 progress for ``rcu_nocbs`` CPUs is much less well-developed, in part
14831483 because workloads benefiting from ``rcu_nocbs`` CPUs tend to invoke
14841484 ``call_rcu()`` relatively infrequently. If workloads emerge that need
@@ -1920,7 +1920,7 @@ Hotplug CPU · 435 unmodified lines
19201920
19211921 The Linux kernel supports CPU hotplug, which means that CPUs can come
19221922 and go. It is of course illegal to use any RCU API member from an
1923−offline CPU, with the exception of `SRCU <#Sleepable%20RCU>`__ read-side
1923+offline CPU, with the exception of `SRCU <Sleepable RCU_>`__ read-side
19241924 critical sections. This requirement was present from day one in
19251925 DYNIX/ptx, but on the other hand, the Linux kernel's CPU-hotplug
19261926 implementation is “interesting.”
@@ -2177,7 +2177,7 @@ handles these states differently: · 250 unmodified lines
21772177 However, RCU must be reliably informed as to whether any given CPU is
21782178 currently in the idle loop, and, for ``NO_HZ_FULL``, also whether that
21792179 CPU is executing in usermode, as discussed
2180−`earlier <#Energy%20Efficiency>`__. It also requires that the
2180+`earlier <Energy Efficiency_>`__. It also requires that the
21812181 scheduling-clock interrupt be enabled when RCU needs it to be:
21822182
21832183 #. If a CPU is either idle or executing in usermode, and RCU believes it
@@ -2294,7 +2294,7 @@ Performance, Scalability, Response Time, and Reliability · 110 unmodified lines
22942294 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22952295
22962296 Expanding on the `earlier
2297−discussion <#Performance%20and%20Scalability>`__, RCU is used heavily by
2297+discussion <Performance and Scalability_>`__, RCU is used heavily by
22982298 hot code paths in performance-critical portions of the Linux kernel's
22992299 networking, security, virtualization, and scheduling code paths. RCU
23002300 must therefore use efficient implementations, especially in its
Documentation/admin-guide/binfmt-misc.rst+2−2
@@ -23,7 +23,7 @@ Here is what the fields mean: · 22 unmodified lines
2323
2424 - ``name``
2525 is an identifier string. A new /proc file will be created with this
26− ``name below /proc/sys/fs/binfmt_misc``; cannot contain slashes ``/`` for
26+ name below ``/proc/sys/fs/binfmt_misc``; cannot contain slashes ``/`` for
2727 obvious reasons.
2828 - ``type``
2929 is the type of recognition. Give ``M`` for magic and ``E`` for extension.
@@ -83,7 +83,7 @@ Here is what the fields mean: · 53 unmodified lines
8383 ``F`` - fix binary
8484 The usual behaviour of binfmt_misc is to spawn the
8585 binary lazily when the misc format file is invoked. However,
86− this doesn``t work very well in the face of mount namespaces and
86+ this doesn't work very well in the face of mount namespaces and
8787 changeroots, so the ``F`` mode opens the binary as soon as the
8888 emulation is installed and uses the opened image to spawn the
8989 emulator, meaning it is always available once installed,
Documentation/admin-guide/bootconfig.rst+1−1
@@ -154,7 +154,7 @@ get the boot configuration data. · 153 unmodified lines
154154 Because of this "piggyback" method, there is no need to change or
155155 update the boot loader and the kernel image itself as long as the boot
156156 loader passes the correct initrd file size. If by any chance, the boot
157−loader passes a longer size, the kernel feils to find the bootconfig data.
157+loader passes a longer size, the kernel fails to find the bootconfig data.
158158
159159 To do this operation, Linux kernel provides "bootconfig" command under
160160 tools/bootconfig, which allows admin to apply or delete the config file
Documentation/admin-guide/kernel-parameters.rst+2−2
@@ -3,8 +3,8 @@ · 2 unmodified lines
33 The kernel's command-line parameters
44 ====================================
55
6−The following is a consolidated list of the kernel parameters as
7−implemented by the __setup(), core_param() and module_param() macros
6+The following is a consolidated list of the kernel parameters as implemented
7+by the __setup(), early_param(), core_param() and module_param() macros
88 and sorted into English Dictionary order (defined as ignoring all
99 punctuation and sorting digits before letters in a case insensitive
1010 manner), and with descriptions where known.
Documentation/admin-guide/kernel-parameters.txt+10−6
@@ -1385,7 +1385,7 @@ · 1384 unmodified lines
13851385
13861386 ftrace_filter=[function-list]
13871387 [FTRACE] Limit the functions traced by the function
1388− tracer at boot up. function-list is a comma separated
1388+ tracer at boot up. function-list is a comma-separated
13891389 list of functions. This list can be changed at run
13901390 time by the set_ftrace_filter file in the debugfs
13911391 tracing directory.
@@ -1399,13 +1399,13 @@ · 7 unmodified lines
13991399 ftrace_graph_filter=[function-list]
14001400 [FTRACE] Limit the top level callers functions traced
14011401 by the function graph tracer at boot up.
1402− function-list is a comma separated list of functions
1402+ function-list is a comma-separated list of functions
14031403 that can be changed at run time by the
14041404 set_graph_function file in the debugfs tracing directory.
14051405
14061406 ftrace_graph_notrace=[function-list]
14071407 [FTRACE] Do not trace from the functions specified in
1408− function-list. This list is a comma separated list of
1408+ function-list. This list is a comma-separated list of
14091409 functions that can be changed at run time by the
14101410 set_graph_notrace file in the debugfs tracing directory.
14111411
@@ -2421,7 +2421,7 @@ · 1009 unmodified lines
24212421 when set.
24222422 Format: <int>
24232423
2424− libata.force= [LIBATA] Force configurations. The format is comma
2424+ libata.force= [LIBATA] Force configurations. The format is comma-
24252425 separated list of "[ID:]VAL" where ID is
24262426 PORT[.DEVICE]. PORT and DEVICE are decimal numbers
24272427 matching port, link or device. Basically, it matches
@@ -5145,7 +5145,7 @@ · 2717 unmodified lines
51455145
51465146 stacktrace_filter=[function-list]
51475147 [FTRACE] Limit the functions that the stack tracer
5148− will trace at boot up. function-list is a comma separated
5148+ will trace at boot up. function-list is a comma-separated
51495149 list of functions. This list can be changed at run
51505150 time by the stack_trace_filter file in the debugfs
51515151 tracing directory. Note, this enables stack tracing
@@ -5348,7 +5348,7 @@ · 196 unmodified lines
53485348 trace_event=[event-list]
53495349 [FTRACE] Set and start specified trace events in order
53505350 to facilitate early boot debugging. The event-list is a
5351− comma separated list of trace events to enable. See
5351+ comma-separated list of trace events to enable. See
53525352 also Documentation/trace/events.rst
53535353
53545354 trace_options=[option-list]
@@ -5972,6 +5972,10 @@ · 617 unmodified lines
59725972 This option is obsoleted by the "nopv" option, which
59735973 has equivalent effect for XEN platform.
59745974
5975+ xen_no_vector_callback
5976+ [KNL,X86,XEN] Disable the vector callback for Xen
5977+ event channel interrupts.
5978+
59755979 xen_scrub_pages= [XEN]
59765980 Boolean option to control scrubbing pages before giving them back
59775981 to Xen, for use by other domains. Can be also changed at runtime
Documentation/admin-guide/mm/concepts.rst+1−1
@@ -184,7 +184,7 @@ pages either asynchronously or synchronously, depending on the state · 183 unmodified lines
184184 of the system. When the system is not loaded, most of the memory is free
185185 and allocation requests will be satisfied immediately from the free
186186 pages supply. As the load increases, the amount of the free pages goes
187−down and when it reaches a certain threshold (high watermark), an
187+down and when it reaches a certain threshold (low watermark), an
188188 allocation request will awaken the ``kswapd`` daemon. It will
189189 asynchronously scan memory pages and either just free them if the data
190190 they contain is available elsewhere, or evict to the backing storage
Documentation/core-api/index.rst+0−1
@@ -53,7 +53,6 @@ How Linux keeps everything from happening at the same time. See · 52 unmodified lines
5353 .. toctree::
5454 :maxdepth: 1
5555
56− atomic_ops
5756 refcount-vs-atomic
5857 irq/index
5958 local_ops
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/dma/ti/k3-bcdma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments K3 DMSS BCDMA Device Tree Bindings
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The Block Copy DMA (BCDMA) is intended to perform similar functions as the TR
Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/dma/ti/k3-pktdma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments K3 DMSS PKTDMA Device Tree Bindings
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The Packet DMA (PKTDMA) is intended to perform similar functions as the packet
Documentation/devicetree/bindings/dma/ti/k3-udma.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2019 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/dma/ti/k3-udma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments K3 NAVSS Unified DMA Device Tree Bindings
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The UDMA-P is intended to perform similar (but significantly upgraded)
Documentation/devicetree/bindings/net/renesas,etheravb.yaml+1−0
@@ -163,6 +163,7 @@ allOf: · 162 unmodified lines
163163 enum:
164164 - renesas,etheravb-r8a774a1
165165 - renesas,etheravb-r8a774b1
166+ - renesas,etheravb-r8a774e1
166167 - renesas,etheravb-r8a7795
167168 - renesas,etheravb-r8a7796
168169 - renesas,etheravb-r8a77961
Documentation/devicetree/bindings/net/snps,dwmac.yaml+6−2
@@ -161,7 +161,8 @@ properties: · 160 unmodified lines
161161 * snps,route-dcbcp, DCB Control Packets
162162 * snps,route-up, Untagged Packets
163163 * snps,route-multi-broad, Multicast & Broadcast Packets
164− * snps,priority, RX queue priority (Range 0x0 to 0xF)
164+ * snps,priority, bitmask of the tagged frames priorities assigned to
165+ the queue
165166
166167 snps,mtl-tx-config:
167168 $ref: /schemas/types.yaml#/definitions/phandle
@@ -188,7 +189,10 @@ properties: · 20 unmodified lines
188189 * snps,idle_slope, unlock on WoL
189190 * snps,high_credit, max write outstanding req. limit
190191 * snps,low_credit, max read outstanding req. limit
191− * snps,priority, TX queue priority (Range 0x0 to 0xF)
192+ * snps,priority, bitmask of the priorities assigned to the queue.
193+ When a PFC frame is received with priorities matching the bitmask,
194+ the queue is blocked from transmitting for the pause time specified
195+ in the PFC frame.
192196
193197 snps,reset-gpio:
194198 deprecated: true
Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml+4−2
@@ -19,7 +19,9 @@ description: | · 18 unmodified lines
1919 properties:
2020 compatible:
2121 enum:
22− - nxp,pf8x00
22+ - nxp,pf8100
23+ - nxp,pf8121a
24+ - nxp,pf8200
2325
2426 reg:
2527 maxItems: 1
@@ -118,7 +120,7 @@ examples: · 92 unmodified lines
118120 #size-cells = <0>;
119121
120122 pmic@8 {
121− compatible = "nxp,pf8x00";
123+ compatible = "nxp,pf8100";
122124 reg = <0x08>;
123125
124126 regulators {
Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt+1−0
@@ -44,6 +44,7 @@ First Level Nodes - PMIC · 43 unmodified lines
4444 Definition: Must be one of below:
4545 "qcom,pm8005-rpmh-regulators"
4646 "qcom,pm8009-rpmh-regulators"
47+ "qcom,pm8009-1-rpmh-regulators"
4748 "qcom,pm8150-rpmh-regulators"
4849 "qcom,pm8150l-rpmh-regulators"
4950 "qcom,pm8350-rpmh-regulators"
Documentation/devicetree/bindings/sound/ti,j721e-cpb-audio.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/sound/ti,j721e-cpb-audio.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments J721e Common Processor Board Audio Support
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The audio support on the board is using pcm3168a codec connected to McASP10
Documentation/devicetree/bindings/sound/ti,j721e-cpb-ivi-audio.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/sound/ti,j721e-cpb-ivi-audio.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments J721e Common Processor Board Audio Support
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The Infotainment board plugs into the Common Processor Board, the support of the
Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml+5−1
@@ -11,8 +11,12 @@ maintainers: · 10 unmodified lines
1111
1212 properties:
1313 compatible:
14− items:
14+ oneOf:
1515 - const: ti,j721e-usb
16+ - const: ti,am64-usb
17+ - items:
18+ - const: ti,j721e-usb
19+ - const: ti,am64-usb
1620
1721 reg:
1822 description: module registers
Documentation/doc-guide/sphinx.rst+16−16
@@ -48,12 +48,12 @@ or ``virtualenv``, depending on how your distribution packaged Python 3. · 47 unmodified lines
4848 those versions, you should run ``pip install 'docutils==0.12'``.
4949
5050 #) It is recommended to use the RTD theme for html output. Depending
51− on the Sphinx version, it should be installed in separate,
51+ on the Sphinx version, it should be installed separately,
5252 with ``pip install sphinx_rtd_theme``.
5353
54− #) Some ReST pages contain math expressions. Due to the way Sphinx work,
54+ #) Some ReST pages contain math expressions. Due to the way Sphinx works,
5555 those expressions are written using LaTeX notation. It needs texlive
56− installed with amdfonts and amsmath in order to evaluate them.
56+ installed with amsfonts and amsmath in order to evaluate them.
5757
5858 In summary, if you want to install Sphinx version 1.7.9, you should do::
5959
@@ -128,7 +128,7 @@ Sphinx Build · 68 unmodified lines
128128 ============
129129
130130 The usual way to generate the documentation is to run ``make htmldocs`` or
131−``make pdfdocs``. There are also other formats available, see the documentation
131+``make pdfdocs``. There are also other formats available: see the documentation
132132 section of ``make help``. The generated documentation is placed in
133133 format-specific subdirectories under ``Documentation/output``.
134134
@@ -303,17 +303,17 @@ and *targets* (e.g. a ref to ``:ref:`last row <last row>``` / :ref:`last row · 168 unmodified lines
303303 - head col 3
304304 - head col 4
305305
306− * - column 1
306+ * - row 1
307307 - field 1.1
308308 - field 1.2 with autospan
309309
310− * - column 2
310+ * - row 2
311311 - field 2.1
312312 - :rspan:`1` :cspan:`1` field 2.2 - 3.3
313313
314314 * .. _`last row`:
315315
316− - column 3
316+ - row 3
317317
318318 Rendered as:
319319
@@ -325,17 +325,17 @@ Rendered as: · 5 unmodified lines
325325 - head col 3
326326 - head col 4
327327
328− * - column 1
328+ * - row 1
329329 - field 1.1
330330 - field 1.2 with autospan
331331
332− * - column 2
332+ * - row 2
333333 - field 2.1
334334 - :rspan:`1` :cspan:`1` field 2.2 - 3.3
335335
336336 * .. _`last row`:
337337
338− - column 3
338+ - row 3
339339
340340 Cross-referencing
341341 -----------------
@@ -361,7 +361,7 @@ Figures & Images · 19 unmodified lines
361361
362362 If you want to add an image, you should use the ``kernel-figure`` and
363363 ``kernel-image`` directives. E.g. to insert a figure with a scalable
364−image format use SVG (:ref:`svg_image_example`)::
364+image format, use SVG (:ref:`svg_image_example`)::
365365
366366 .. kernel-figure:: svg_image.svg
367367 :alt: simple SVG image
@@ -375,7 +375,7 @@ image format use SVG (:ref:`svg_image_example`):: · 7 unmodified lines
375375
376376 SVG image example
377377
378−The kernel figure (and image) directive support **DOT** formatted files, see
378+The kernel figure (and image) directive supports **DOT** formatted files, see
379379
380380 * DOT: http://graphviz.org/pdf/dotguide.pdf
381381 * Graphviz: http://www.graphviz.org/content/dot-language
@@ -394,7 +394,7 @@ A simple example (:ref:`hello_dot_file`):: · 12 unmodified lines
394394
395395 DOT's hello world example
396396
397−Embed *render* markups (or languages) like Graphviz's **DOT** is provided by the
397+Embedded *render* markups (or languages) like Graphviz's **DOT** are provided by the
398398 ``kernel-render`` directives.::
399399
400400 .. kernel-render:: DOT
@@ -406,7 +406,7 @@ Embed *render* markups (or languages) like Graphviz's **DOT** is provided by the · 5 unmodified lines
406406 }
407407
408408 How this will be rendered depends on the installed tools. If Graphviz is
409−installed, you will see an vector image. If not the raw markup is inserted as
409+installed, you will see a vector image. If not, the raw markup is inserted as
410410 *literal-block* (:ref:`hello_dot_render`).
411411
412412 .. _hello_dot_render:
@@ -421,8 +421,8 @@ installed, you will see an vector image. If not the raw markup is inserted as · 8 unmodified lines
421421
422422 The *render* directive has all the options known from the *figure* directive,
423423 plus option ``caption``. If ``caption`` has a value, a *figure* node is
424−inserted. If not, a *image* node is inserted. A ``caption`` is also needed, if
425−you want to refer it (:ref:`hello_svg_render`).
424+inserted. If not, an *image* node is inserted. A ``caption`` is also needed, if
425+you want to refer to it (:ref:`hello_svg_render`).
426426
427427 Embedded **SVG**::
428428
Documentation/firmware-guide/acpi/apei/einj.rst+2−2
@@ -50,8 +50,8 @@ The following files belong to it: · 49 unmodified lines
5050 0x00000010 Memory Uncorrectable non-fatal
5151 0x00000020 Memory Uncorrectable fatal
5252 0x00000040 PCI Express Correctable
53− 0x00000080 PCI Express Uncorrectable fatal
54− 0x00000100 PCI Express Uncorrectable non-fatal
53+ 0x00000080 PCI Express Uncorrectable non-fatal
54+ 0x00000100 PCI Express Uncorrectable fatal
5555 0x00000200 Platform Correctable
5656 0x00000400 Platform Uncorrectable non-fatal
5757 0x00000800 Platform Uncorrectable fatal
Documentation/hwmon/sbtsi_temp.rst+1−1
@@ -1,7 +1,7 @@
11 .. SPDX-License-Identifier: GPL-2.0-or-later
22
33 Kernel driver sbtsi_temp
4−==================
4+========================
55
66 Supported hardware:
77
Documentation/kbuild/makefiles.rst+1−1
@@ -598,7 +598,7 @@ more details, with real examples. · 597 unmodified lines
598598 explicitly added to $(targets).
599599
600600 Assignments to $(targets) are without $(obj)/ prefix. if_changed may be
601− used in conjunction with custom rules as defined in "3.9 Custom Rules".
601+ used in conjunction with custom rules as defined in "3.11 Custom Rules".
602602
603603 Note: It is a typical mistake to forget the FORCE prerequisite.
604604 Another common pitfall is that whitespace is sometimes significant; for
Documentation/kernel-hacking/locking.rst+4−4
@@ -118,11 +118,11 @@ spinlock, but you may block holding a mutex. If you can't lock a mutex, · 117 unmodified lines
118118 your task will suspend itself, and be woken up when the mutex is
119119 released. This means the CPU can do something else while you are
120120 waiting. There are many cases when you simply can't sleep (see
121−`What Functions Are Safe To Call From Interrupts? <#sleeping-things>`__),
121+`What Functions Are Safe To Call From Interrupts?`_),
122122 and so have to use a spinlock instead.
123123
124124 Neither type of lock is recursive: see
125−`Deadlock: Simple and Advanced <#deadlock>`__.
125+`Deadlock: Simple and Advanced`_.
126126
127127 Locks and Uniprocessor Kernels
128128 ------------------------------
@@ -179,7 +179,7 @@ perfect world). · 50 unmodified lines
179179
180180 Note that you can also use spin_lock_irq() or
181181 spin_lock_irqsave() here, which stop hardware interrupts
182−as well: see `Hard IRQ Context <#hard-irq-context>`__.
182+as well: see `Hard IRQ Context`_.
183183
184184 This works perfectly for UP as well: the spin lock vanishes, and this
185185 macro simply becomes local_bh_disable()
@@ -230,7 +230,7 @@ The Same Softirq · 44 unmodified lines
230230 ~~~~~~~~~~~~~~~~
231231
232232 The same softirq can run on the other CPUs: you can use a per-CPU array
233−(see `Per-CPU Data <#per-cpu-data>`__) for better performance. If you're
233+(see `Per-CPU Data`_) for better performance. If you're
234234 going so far as to use a softirq, you probably care about scalable
235235 performance enough to justify the extra complexity.
236236
Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst+36−26
@@ -164,46 +164,56 @@ Devlink health reporters · 163 unmodified lines
164164
165165 NPA Reporters
166166 -------------
167−The NPA reporters are responsible for reporting and recovering the following group of errors
167+The NPA reporters are responsible for reporting and recovering the following group of errors:
168+
168169 1. GENERAL events
170+
169171 - Error due to operation of unmapped PF.
170172 - Error due to disabled alloc/free for other HW blocks (NIX, SSO, TIM, DPI and AURA).
173+
171174 2. ERROR events
175+
172176 - Fault due to NPA_AQ_INST_S read or NPA_AQ_RES_S write.
173177 - AQ Doorbell Error.
178+
174179 3. RAS events
180+
175181 - RAS Error Reporting for NPA_AQ_INST_S/NPA_AQ_RES_S.
182+
176183 4. RVU events
184+
177185 - Error due to unmapped slot.
178186
179−Sample Output
180−-------------
181−~# devlink health
182−pci/0002:01:00.0:
183− reporter hw_npa_intr
184− state healthy error 2872 recover 2872 last_dump_date 2020-12-10 last_dump_time 09:39:09 grace_period 0 auto_recover true auto_dump true
185− reporter hw_npa_gen
186− state healthy error 2872 recover 2872 last_dump_date 2020-12-11 last_dump_time 04:43:04 grace_period 0 auto_recover true auto_dump true
187− reporter hw_npa_err
188− state healthy error 2871 recover 2871 last_dump_date 2020-12-10 last_dump_time 09:39:17 grace_period 0 auto_recover true auto_dump true
189− reporter hw_npa_ras
190− state healthy error 0 recover 0 last_dump_date 2020-12-10 last_dump_time 09:32:40 grace_period 0 auto_recover true auto_dump true
187+Sample Output::
188+
189+ ~# devlink health
190+ pci/0002:01:00.0:
191+ reporter hw_npa_intr
192+ state healthy error 2872 recover 2872 last_dump_date 2020-12-10 last_dump_time 09:39:09 grace_period 0 auto_recover true auto_dump true
193+ reporter hw_npa_gen
194+ state healthy error 2872 recover 2872 last_dump_date 2020-12-11 last_dump_time 04:43:04 grace_period 0 auto_recover true auto_dump true
195+ reporter hw_npa_err
196+ state healthy error 2871 recover 2871 last_dump_date 2020-12-10 last_dump_time 09:39:17 grace_period 0 auto_recover true auto_dump true
197+ reporter hw_npa_ras
198+ state healthy error 0 recover 0 last_dump_date 2020-12-10 last_dump_time 09:32:40 grace_period 0 auto_recover true auto_dump true
191199
192200 Each reporter dumps the
201+
193202 - Error Type
194203 - Error Register value
195204 - Reason in words
196205
197−For eg:
198−~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_gen
199− NPA_AF_GENERAL:
200− NPA General Interrupt Reg : 1
201− NIX0: free disabled RX
202−~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_intr
203− NPA_AF_RVU:
204− NPA RVU Interrupt Reg : 1
205− Unmap Slot Error
206−~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_err
207− NPA_AF_ERR:
208− NPA Error Interrupt Reg : 4096
209− AQ Doorbell Error
206+For example::
207+
208+ ~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_gen
209+ NPA_AF_GENERAL:
210+ NPA General Interrupt Reg : 1
211+ NIX0: free disabled RX
212+ ~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_intr
213+ NPA_AF_RVU:
214+ NPA RVU Interrupt Reg : 1
215+ Unmap Slot Error
216+ ~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_err
217+ NPA_AF_ERR:
218+ NPA Error Interrupt Reg : 4096
219+ AQ Doorbell Error
Documentation/networking/netdev-FAQ.rst+59−67
@@ -6,9 +6,9 @@ · 5 unmodified lines
66 netdev FAQ
77 ==========
88
9−Q: What is netdev?
10−------------------
11−A: It is a mailing list for all network-related Linux stuff. This
9+What is netdev?
10+---------------
11+It is a mailing list for all network-related Linux stuff. This
1212 includes anything found under net/ (i.e. core code like IPv6) and
1313 drivers/net (i.e. hardware specific drivers) in the Linux source tree.
1414
@@ -25,9 +25,9 @@ Aside from subsystems like that mentioned above, all network-related · 10 unmodified lines
2525 Linux development (i.e. RFC, review, comments, etc.) takes place on
2626 netdev.
2727
28−Q: How do the changes posted to netdev make their way into Linux?
29−-----------------------------------------------------------------
30−A: There are always two trees (git repositories) in play. Both are
28+How do the changes posted to netdev make their way into Linux?
29+--------------------------------------------------------------
30+There are always two trees (git repositories) in play. Both are
3131 driven by David Miller, the main network maintainer. There is the
3232 ``net`` tree, and the ``net-next`` tree. As you can probably guess from
3333 the names, the ``net`` tree is for fixes to existing code already in the
@@ -37,9 +37,9 @@ for the future release. You can find the trees here: · 3 unmodified lines
3737 - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
3838 - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
3939
40−Q: How often do changes from these trees make it to the mainline Linus tree?
41−----------------------------------------------------------------------------
42−A: To understand this, you need to know a bit of background information on
40+How often do changes from these trees make it to the mainline Linus tree?
41+-------------------------------------------------------------------------
42+To understand this, you need to know a bit of background information on
4343 the cadence of Linux development. Each new release starts off with a
4444 two week "merge window" where the main maintainers feed their new stuff
4545 to Linus for merging into the mainline tree. After the two weeks, the
@@ -81,7 +81,8 @@ focus for ``net`` is on stabilization and bug fixes. · 35 unmodified lines
8181
8282 Finally, the vX.Y gets released, and the whole cycle starts over.
8383
84−Q: So where are we now in this cycle?
84+So where are we now in this cycle?
85+----------------------------------
8586
8687 Load the mainline (Linus) page here:
8788
@@ -91,9 +92,9 @@ and note the top of the "tags" section. If it is rc1, it is early in · 3 unmodified lines
9192 the dev cycle. If it was tagged rc7 a week ago, then a release is
9293 probably imminent.
9394
94−Q: How do I indicate which tree (net vs. net-next) my patch should be in?
95−-------------------------------------------------------------------------
96−A: Firstly, think whether you have a bug fix or new "next-like" content.
95+How do I indicate which tree (net vs. net-next) my patch should be in?
96+----------------------------------------------------------------------
97+Firstly, think whether you have a bug fix or new "next-like" content.
9798 Then once decided, assuming that you use git, use the prefix flag, i.e.
9899 ::
99100
@@ -105,48 +106,45 @@ in the above is just the subject text of the outgoing e-mail, and you · 5 unmodified lines
105106 can manually change it yourself with whatever MUA you are comfortable
106107 with.
107108
108−Q: I sent a patch and I'm wondering what happened to it?
109−--------------------------------------------------------
110−Q: How can I tell whether it got merged?
111−A: Start by looking at the main patchworks queue for netdev:
109+I sent a patch and I'm wondering what happened to it - how can I tell whether it got merged?
110+--------------------------------------------------------------------------------------------
111+Start by looking at the main patchworks queue for netdev:
112112
113113 https://patchwork.kernel.org/project/netdevbpf/list/
114114
115115 The "State" field will tell you exactly where things are at with your
116116 patch.
117117
118−Q: The above only says "Under Review". How can I find out more?
119−----------------------------------------------------------------
120−A: Generally speaking, the patches get triaged quickly (in less than
118+The above only says "Under Review". How can I find out more?
119+-------------------------------------------------------------
120+Generally speaking, the patches get triaged quickly (in less than
121121 48h). So be patient. Asking the maintainer for status updates on your
122122 patch is a good way to ensure your patch is ignored or pushed to the
123123 bottom of the priority list.
124124
125−Q: I submitted multiple versions of the patch series
126−----------------------------------------------------
127−Q: should I directly update patchwork for the previous versions of these
128−patch series?
129−A: No, please don't interfere with the patch status on patchwork, leave
125+I submitted multiple versions of the patch series. Should I directly update patchwork for the previous versions of these patch series?
126+--------------------------------------------------------------------------------------------------------------------------------------
127+No, please don't interfere with the patch status on patchwork, leave
130128 it to the maintainer to figure out what is the most recent and current
131129 version that should be applied. If there is any doubt, the maintainer
132130 will reply and ask what should be done.
133131
134−Q: I made changes to only a few patches in a patch series should I resend only those changed?
135−---------------------------------------------------------------------------------------------
136−A: No, please resend the entire patch series and make sure you do number your
132+I made changes to only a few patches in a patch series should I resend only those changed?
133+------------------------------------------------------------------------------------------
134+No, please resend the entire patch series and make sure you do number your
137135 patches such that it is clear this is the latest and greatest set of patches
138136 that can be applied.
139137
140−Q: I submitted multiple versions of a patch series and it looks like a version other than the last one has been accepted, what should I do?
141−-------------------------------------------------------------------------------------------------------------------------------------------
142−A: There is no revert possible, once it is pushed out, it stays like that.
138+I submitted multiple versions of a patch series and it looks like a version other than the last one has been accepted, what should I do?
139+----------------------------------------------------------------------------------------------------------------------------------------
140+There is no revert possible, once it is pushed out, it stays like that.
143141 Please send incremental versions on top of what has been merged in order to fix
144142 the patches the way they would look like if your latest patch series was to be
145143 merged.
146144
147−Q: How can I tell what patches are queued up for backporting to the various stable releases?
148−--------------------------------------------------------------------------------------------
149−A: Normally Greg Kroah-Hartman collects stable commits himself, but for
145+How can I tell what patches are queued up for backporting to the various stable releases?
146+-----------------------------------------------------------------------------------------
147+Normally Greg Kroah-Hartman collects stable commits himself, but for
150148 networking, Dave collects up patches he deems critical for the
151149 networking subsystem, and then hands them off to Greg.
152150
@@ -169,11 +167,9 @@ simply clone the repo, and then git grep the mainline commit ID, e.g. · 16 unmodified lines
169167 releases/3.9.8/ipv6-fix-possible-crashes-in-ip6_cork_release.patch
170168 stable/stable-queue$
171169
172−Q: I see a network patch and I think it should be backported to stable.
173−-----------------------------------------------------------------------
174−Q: Should I request it via stable@vger.kernel.org like the references in
175−the kernel's Documentation/process/stable-kernel-rules.rst file say?
176−A: No, not for networking. Check the stable queues as per above first
170+I see a network patch and I think it should be backported to stable. Should I request it via stable@vger.kernel.org like the references in the kernel's Documentation/process/stable-kernel-rules.rst file say?
171+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
172+No, not for networking. Check the stable queues as per above first
177173 to see if it is already queued. If not, then send a mail to netdev,
178174 listing the upstream commit ID and why you think it should be a stable
179175 candidate.
@@ -190,11 +186,9 @@ mainline, the better the odds that it is an OK candidate for stable. So · 10 unmodified lines
190186 scrambling to request a commit be added the day after it appears should
191187 be avoided.
192188
193−Q: I have created a network patch and I think it should be backported to stable.
194−--------------------------------------------------------------------------------
195−Q: Should I add a Cc: stable@vger.kernel.org like the references in the
196−kernel's Documentation/ directory say?
197−A: No. See above answer. In short, if you think it really belongs in
189+I have created a network patch and I think it should be backported to stable. Should I add a Cc: stable@vger.kernel.org like the references in the kernel's Documentation/ directory say?
190+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
191+No. See above answer. In short, if you think it really belongs in
198192 stable, then ensure you write a decent commit log that describes who
199193 gets impacted by the bug fix and how it manifests itself, and when the
200194 bug was introduced. If you do that properly, then the commit will get
@@ -207,18 +201,18 @@ marker line as described in · 6 unmodified lines
207201 :ref:`Documentation/process/submitting-patches.rst <the_canonical_patch_format>`
208202 to temporarily embed that information into the patch that you send.
209203
210−Q: Are all networking bug fixes backported to all stable releases?
211−------------------------------------------------------------------
212−A: Due to capacity, Dave could only take care of the backports for the
204+Are all networking bug fixes backported to all stable releases?
205+---------------------------------------------------------------
206+Due to capacity, Dave could only take care of the backports for the
213207 last two stable releases. For earlier stable releases, each stable
214208 branch maintainer is supposed to take care of them. If you find any
215209 patch is missing from an earlier stable branch, please notify
216210 stable@vger.kernel.org with either a commit ID or a formal patch
217211 backported, and CC Dave and other relevant networking developers.
218212
219−Q: Is the comment style convention different for the networking content?
220−------------------------------------------------------------------------
221−A: Yes, in a largely trivial way. Instead of this::
213+Is the comment style convention different for the networking content?
214+---------------------------------------------------------------------
215+Yes, in a largely trivial way. Instead of this::
222216
223217 /*
224218 * foobar blah blah blah
@@ -231,32 +225,30 @@ it is requested that you make it look like this:: · 6 unmodified lines
231225 * another line of text
232226 */
233227
234−Q: I am working in existing code that has the former comment style and not the latter.
235−--------------------------------------------------------------------------------------
236−Q: Should I submit new code in the former style or the latter?
237−A: Make it the latter style, so that eventually all code in the domain
228+I am working in existing code that has the former comment style and not the latter. Should I submit new code in the former style or the latter?
229+-----------------------------------------------------------------------------------------------------------------------------------------------
230+Make it the latter style, so that eventually all code in the domain
238231 of netdev is of this format.
239232
240−Q: I found a bug that might have possible security implications or similar.
241−---------------------------------------------------------------------------
242−Q: Should I mail the main netdev maintainer off-list?**
243−A: No. The current netdev maintainer has consistently requested that
233+I found a bug that might have possible security implications or similar. Should I mail the main netdev maintainer off-list?
234+---------------------------------------------------------------------------------------------------------------------------
235+No. The current netdev maintainer has consistently requested that
244236 people use the mailing lists and not reach out directly. If you aren't
245237 OK with that, then perhaps consider mailing security@kernel.org or
246238 reading about http://oss-security.openwall.org/wiki/mailing-lists/distros
247239 as possible alternative mechanisms.
248240
249−Q: What level of testing is expected before I submit my change?
250−---------------------------------------------------------------
251−A: If your changes are against ``net-next``, the expectation is that you
241+What level of testing is expected before I submit my change?
242+------------------------------------------------------------
243+If your changes are against ``net-next``, the expectation is that you
252244 have tested by layering your changes on top of ``net-next``. Ideally
253245 you will have done run-time testing specific to your change, but at a
254246 minimum, your changes should survive an ``allyesconfig`` and an
255247 ``allmodconfig`` build without new warnings or failures.
256248
257−Q: How do I post corresponding changes to user space components?
258−----------------------------------------------------------------
259−A: User space code exercising kernel features should be posted
249+How do I post corresponding changes to user space components?
250+-------------------------------------------------------------
251+User space code exercising kernel features should be posted
260252 alongside kernel patches. This gives reviewers a chance to see
261253 how any new interface is used and how well it works.
262254
@@ -280,9 +272,9 @@ to the mailing list, e.g.:: · 17 unmodified lines
280272 Posting as one thread is discouraged because it confuses patchwork
281273 (as of patchwork 2.2.2).
282274
283−Q: Any other tips to help ensure my net/net-next patch gets OK'd?
284−-----------------------------------------------------------------
285−A: Attention to detail. Re-read your own work as if you were the
275+Any other tips to help ensure my net/net-next patch gets OK'd?
276+--------------------------------------------------------------
277+Attention to detail. Re-read your own work as if you were the
286278 reviewer. You can start with using ``checkpatch.pl``, perhaps even with
287279 the ``--strict`` flag. But do not be mindlessly robotic in doing so.
288280 If your change is a bug fix, make sure your commit log indicates the
Documentation/networking/netdevices.rst+167−8
@@ -10,18 +10,177 @@ Introduction · 9 unmodified lines
1010 The following is a random collection of documentation regarding
1111 network devices.
1212
13−struct net_device allocation rules
14−==================================
13+struct net_device lifetime rules
14+================================
1515 Network device structures need to persist even after module is unloaded and
1616 must be allocated with alloc_netdev_mqs() and friends.
1717 If device has registered successfully, it will be freed on last use
18−by free_netdev(). This is required to handle the pathologic case cleanly
19−(example: rmmod mydriver </sys/class/net/myeth/mtu )
18+by free_netdev(). This is required to handle the pathological case cleanly
19+(example: ``rmmod mydriver </sys/class/net/myeth/mtu``)
2020
21−alloc_netdev_mqs()/alloc_netdev() reserve extra space for driver
21+alloc_netdev_mqs() / alloc_netdev() reserve extra space for driver
2222 private data which gets freed when the network device is freed. If
2323 separately allocated data is attached to the network device
24−(netdev_priv(dev)) then it is up to the module exit handler to free that.
24+(netdev_priv()) then it is up to the module exit handler to free that.
25+
26+There are two groups of APIs for registering struct net_device.
27+First group can be used in normal contexts where ``rtnl_lock`` is not already
28+held: register_netdev(), unregister_netdev().
29+Second group can be used when ``rtnl_lock`` is already held:
30+register_netdevice(), unregister_netdevice(), free_netdevice().
31+
32+Simple drivers
33+--------------
34+
35+Most drivers (especially device drivers) handle lifetime of struct net_device
36+in context where ``rtnl_lock`` is not held (e.g. driver probe and remove paths).
37+
38+In that case the struct net_device registration is done using
39+the register_netdev(), and unregister_netdev() functions:
40+
41+.. code-block:: c
42+
43+ int probe()
44+ {
45+ struct my_device_priv *priv;
46+ int err;
47+
48+ dev = alloc_netdev_mqs(...);
49+ if (!dev)
50+ return -ENOMEM;
51+ priv = netdev_priv(dev);
52+
53+ /* ... do all device setup before calling register_netdev() ...
54+ */
55+
56+ err = register_netdev(dev);
57+ if (err)
58+ goto err_undo;
59+
60+ /* net_device is visible to the user! */
61+
62+ err_undo:
63+ /* ... undo the device setup ... */
64+ free_netdev(dev);
65+ return err;
66+ }
67+
68+ void remove()
69+ {
70+ unregister_netdev(dev);
71+ free_netdev(dev);
72+ }
73+
74+Note that after calling register_netdev() the device is visible in the system.
75+Users can open it and start sending / receiving traffic immediately,
76+or run any other callback, so all initialization must be done prior to
77+registration.
78+
79+unregister_netdev() closes the device and waits for all users to be done
80+with it. The memory of struct net_device itself may still be referenced
81+by sysfs but all operations on that device will fail.
82+
83+free_netdev() can be called after unregister_netdev() returns on when
84+register_netdev() failed.
85+
86+Device management under RTNL
87+----------------------------
88+
89+Registering struct net_device while in context which already holds
90+the ``rtnl_lock`` requires extra care. In those scenarios most drivers
91+will want to make use of struct net_device's ``needs_free_netdev``
92+and ``priv_destructor`` members for freeing of state.
93+
94+Example flow of netdev handling under ``rtnl_lock``:
95+
96+.. code-block:: c
97+
98+ static void my_setup(struct net_device *dev)
99+ {
100+ dev->needs_free_netdev = true;
101+ }
102+
103+ static void my_destructor(struct net_device *dev)
104+ {
105+ some_obj_destroy(priv->obj);
106+ some_uninit(priv);
107+ }
108+
109+ int create_link()
110+ {
111+ struct my_device_priv *priv;
112+ int err;
113+
114+ ASSERT_RTNL();
115+
116+ dev = alloc_netdev(sizeof(*priv), "net%d", NET_NAME_UNKNOWN, my_setup);
117+ if (!dev)
118+ return -ENOMEM;
119+ priv = netdev_priv(dev);
120+
121+ /* Implicit constructor */
122+ err = some_init(priv);
123+ if (err)
124+ goto err_free_dev;
125+
126+ priv->obj = some_obj_create();
127+ if (!priv->obj) {
128+ err = -ENOMEM;
129+ goto err_some_uninit;
130+ }
131+ /* End of constructor, set the destructor: */
132+ dev->priv_destructor = my_destructor;
133+
134+ err = register_netdevice(dev);
135+ if (err)
136+ /* register_netdevice() calls destructor on failure */
137+ goto err_free_dev;
138+
139+ /* If anything fails now unregister_netdevice() (or unregister_netdev())
140+ * will take care of calling my_destructor and free_netdev().
141+ */
142+
143+ return 0;
144+
145+ err_some_uninit:
146+ some_uninit(priv);
147+ err_free_dev:
148+ free_netdev(dev);
149+ return err;
150+ }
151+
152+If struct net_device.priv_destructor is set it will be called by the core
153+some time after unregister_netdevice(), it will also be called if
154+register_netdevice() fails. The callback may be invoked with or without
155+``rtnl_lock`` held.
156+
157+There is no explicit constructor callback, driver "constructs" the private
158+netdev state after allocating it and before registration.
159+
160+Setting struct net_device.needs_free_netdev makes core call free_netdevice()
161+automatically after unregister_netdevice() when all references to the device
162+are gone. It only takes effect after a successful call to register_netdevice()
163+so if register_netdevice() fails driver is responsible for calling
164+free_netdev().
165+
166+free_netdev() is safe to call on error paths right after unregister_netdevice()
167+or when register_netdevice() fails. Parts of netdev (de)registration process
168+happen after ``rtnl_lock`` is released, therefore in those cases free_netdev()
169+will defer some of the processing until ``rtnl_lock`` is released.
170+
171+Devices spawned from struct rtnl_link_ops should never free the
172+struct net_device directly.
173+
174+.ndo_init and .ndo_uninit
175+~~~~~~~~~~~~~~~~~~~~~~~~~
176+
177+``.ndo_init`` and ``.ndo_uninit`` callbacks are called during net_device
178+registration and de-registration, under ``rtnl_lock``. Drivers can use
179+those e.g. when parts of their init process need to run under ``rtnl_lock``.
180+
181+``.ndo_init`` runs before device is visible in the system, ``.ndo_uninit``
182+runs during de-registering after device is closed but other subsystems
183+may still have outstanding references to the netdevice.
25184
26185 MTU
27186 ===
@@ -64,8 +223,8 @@ ndo_do_ioctl: · 36 unmodified lines
64223 Context: process
65224
66225 ndo_get_stats:
67− Synchronization: dev_base_lock rwlock.
68− Context: nominally process, but don't sleep inside an rwlock
226+ Synchronization: rtnl_lock() semaphore, dev_base_lock rwlock, or RCU.
227+ Context: atomic (can't sleep under rwlock or RCU)
69228
70229 ndo_start_xmit:
71230 Synchronization: __netif_tx_lock spinlock.
Documentation/networking/packet_mmap.rst+5−6
@@ -8,7 +8,7 @@ Abstract · 7 unmodified lines
88 ========
99
1010 This file documents the mmap() facility available with the PACKET
11−socket interface on 2.4/2.6/3.x kernels. This type of sockets is used for
11+socket interface. This type of sockets is used for
1212
1313 i) capture network traffic with utilities like tcpdump,
1414 ii) transmit network traffic, or any other that needs raw
@@ -25,12 +25,12 @@ Please send your comments to · 10 unmodified lines
2525 Why use PACKET_MMAP
2626 ===================
2727
28−In Linux 2.4/2.6/3.x if PACKET_MMAP is not enabled, the capture process is very
28+Non PACKET_MMAP capture process (plain AF_PACKET) is very
2929 inefficient. It uses very limited buffers and requires one system call to
3030 capture each packet, it requires two if you want to get packet's timestamp
3131 (like libpcap always does).
3232
33−In the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size
33+On the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size
3434 configurable circular buffer mapped in user space that can be used to either
3535 send or receive packets. This way reading packets just needs to wait for them,
3636 most of the time there is no need to issue a single system call. Concerning
@@ -252,8 +252,7 @@ PACKET_MMAP setting constraints · 215 unmodified lines
252252
253253 In kernel versions prior to 2.4.26 (for the 2.4 branch) and 2.6.5 (2.6 branch),
254254 the PACKET_MMAP buffer could hold only 32768 frames in a 32 bit architecture or
255−16384 in a 64 bit architecture. For information on these kernel versions
256−see http://pusa.uv.es/~ulisses/packet_mmap/packet_mmap.pre-2.4.26_2.6.5.txt
255+16384 in a 64 bit architecture.
257256
258257 Block size limit
259258 ----------------
@@ -437,7 +436,7 @@ and the following flags apply: · 177 unmodified lines
437436 Capture process
438437 ^^^^^^^^^^^^^^^
439438
440− from include/linux/if_packet.h
439+From include/linux/if_packet.h::
441440
442441 #define TP_STATUS_COPY (1 << 1)
443442 #define TP_STATUS_LOSING (1 << 2)
Documentation/networking/tls-offload.rst+1−1
@@ -530,7 +530,7 @@ TLS device feature flags only control adding of new TLS connection · 529 unmodified lines
530530 offloads, old connections will remain active after flags are cleared.
531531
532532 TLS encryption cannot be offloaded to devices without checksum calculation
533−offload. Hence, TLS TX device feature flag requires NETIF_F_HW_CSUM being set.
533+offload. Hence, TLS TX device feature flag requires TX csum offload being set.
534534 Disabling the latter implies clearing the former. Disabling TX checksum offload
535535 should not affect old connections, and drivers should make sure checksum
536536 calculation does not break for them.
Documentation/process/4.Coding.rst+2−4
@@ -249,10 +249,8 @@ features; most of these are found in the "kernel hacking" submenu. Several · 248 unmodified lines
249249 of these options should be turned on for any kernel used for development or
250250 testing purposes. In particular, you should turn on:
251251
252− - ENABLE_MUST_CHECK and FRAME_WARN to get an
253− extra set of warnings for problems like the use of deprecated interfaces
254− or ignoring an important return value from a function. The output
255− generated by these warnings can be verbose, but one need not worry about
252+ - FRAME_WARN to get warnings for stack frames larger than a given amount.
253+ The output generated can be verbose, but one need not worry about
256254 warnings from other parts of the kernel.
257255
258256 - DEBUG_OBJECTS will add code to track the lifetime of various objects
Documentation/sound/alsa-configuration.rst+1−1
@@ -1501,7 +1501,7 @@ Module for Digigram miXart8 sound cards. · 1500 unmodified lines
15011501
15021502 This module supports multiple cards.
15031503 Note: One miXart8 board will be represented as 4 alsa cards.
1504−See MIXART.txt for details.
1504+See Documentation/sound/cards/mixart.rst for details.
15051505
15061506 When the driver is compiled as a module and the hotplug firmware
15071507 is supported, the firmware data is loaded via hotplug automatically.
Documentation/sound/kernel-api/writing-an-alsa-driver.rst+8−8
@@ -71,7 +71,7 @@ core/oss · 70 unmodified lines
7171 The codes for PCM and mixer OSS emulation modules are stored in this
7272 directory. The rawmidi OSS emulation is included in the ALSA rawmidi
7373 code since it's quite small. The sequencer code is stored in
74−``core/seq/oss`` directory (see `below <#core-seq-oss>`__).
74+``core/seq/oss`` directory (see `below <core/seq/oss_>`__).
7575
7676 core/seq
7777 ~~~~~~~~
@@ -382,7 +382,7 @@ where ``enable[dev]`` is the module option. · 304 unmodified lines
382382 Each time the ``probe`` callback is called, check the availability of
383383 the device. If not available, simply increment the device index and
384384 returns. dev will be incremented also later (`step 7
385−<#set-the-pci-driver-data-and-return-zero>`__).
385+<7) Set the PCI driver data and return zero._>`__).
386386
387387 2) Create a card instance
388388 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -450,10 +450,10 @@ field contains the information shown in ``/proc/asound/cards``. · 61 unmodified lines
450450 5) Create other components, such as mixer, MIDI, etc.
451451 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
452452
453−Here you define the basic components such as `PCM <#PCM-Interface>`__,
454−mixer (e.g. `AC97 <#API-for-AC97-Codec>`__), MIDI (e.g.
455−`MPU-401 <#MIDI-MPU401-UART-Interface>`__), and other interfaces.
456−Also, if you want a `proc file <#Proc-Interface>`__, define it here,
453+Here you define the basic components such as `PCM <PCM Interface_>`__,
454+mixer (e.g. `AC97 <API for AC97 Codec_>`__), MIDI (e.g.
455+`MPU-401 <MIDI (MPU401-UART) Interface_>`__), and other interfaces.
456+Also, if you want a `proc file <Proc Interface_>`__, define it here,
457457 too.
458458
459459 6) Register the card instance.
@@ -941,7 +941,7 @@ The allocation of an interrupt source is done like this: · 481 unmodified lines
941941 chip->irq = pci->irq;
942942
943943 where :c:func:`snd_mychip_interrupt()` is the interrupt handler
944−defined `later <#pcm-interface-interrupt-handler>`__. Note that
944+defined `later <PCM Interrupt Handler_>`__. Note that
945945 ``chip->irq`` should be defined only when :c:func:`request_irq()`
946946 succeeded.
947947
@@ -3104,7 +3104,7 @@ processing the output stream in the irq handler. · 2156 unmodified lines
31043104
31053105 If the MPU-401 interface shares its interrupt with the other logical
31063106 devices on the card, set ``MPU401_INFO_IRQ_HOOK`` (see
3107−`below <#MIDI-Interrupt-Handler>`__).
3107+`below <MIDI Interrupt Handler_>`__).
31083108
31093109 Usually, the port address corresponds to the command port and port + 1
31103110 corresponds to the data port. If not, you may change the ``cport``
Documentation/virt/kvm/api.rst+7−2
@@ -392,9 +392,14 @@ This ioctl is obsolete and has been removed. · 391 unmodified lines
392392
393393 Errors:
394394
395− ===== =============================
395+ ======= ==============================================================
396396 EINTR an unmasked signal is pending
397− ===== =============================
397+ ENOEXEC the vcpu hasn't been initialized or the guest tried to execute
398+ instructions from device memory (arm64)
399+ ENOSYS data abort outside memslots with no syndrome info and
400+ KVM_CAP_ARM_NISV_TO_USER not enabled (arm64)
401+ EPERM SVE feature set but not finalized (arm64)
402+ ======= ==============================================================
398403
399404 This ioctl is used to run a guest virtual cpu. While there are no
400405 explicit parameters, there is an implicit parameter block that can be
MAINTAINERS+42−35
@@ -203,8 +203,8 @@ F: include/uapi/linux/nl80211.h · 202 unmodified lines
203203 F: net/wireless/
204204
205205 8169 10/100/1000 GIGABIT ETHERNET DRIVER
206−M: Realtek linux nic maintainers <nic_swsd@realtek.com>
207206 M: Heiner Kallweit <hkallweit1@gmail.com>
207+M: nic_swsd@realtek.com
208208 L: netdev@vger.kernel.org
209209 S: Maintained
210210 F: drivers/net/ethernet/realtek/r8169*
@@ -820,7 +820,6 @@ M: Netanel Belgazal <netanel@amazon.com> · 609 unmodified lines
820820 M: Arthur Kiyanovski <akiyano@amazon.com>
821821 R: Guy Tzalik <gtzalik@amazon.com>
822822 R: Saeed Bishara <saeedb@amazon.com>
823−R: Zorik Machulsky <zorik@amazon.com>
824823 L: netdev@vger.kernel.org
825824 S: Supported
826825 F: Documentation/networking/device_drivers/ethernet/amazon/ena.rst
@@ -907,7 +906,7 @@ AMD KFD · 80 unmodified lines
907906 M: Felix Kuehling <Felix.Kuehling@amd.com>
908907 L: amd-gfx@lists.freedesktop.org
909908 S: Supported
910−T: git git://people.freedesktop.org/~agd5f/linux
909+T: git https://gitlab.freedesktop.org/agd5f/linux.git
911910 F: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd*.[ch]
912911 F: drivers/gpu/drm/amd/amdkfd/
913912 F: drivers/gpu/drm/amd/include/cik_structs.h
@@ -2119,7 +2118,7 @@ N: atmel · 1205 unmodified lines
21192118 ARM/Microchip Sparx5 SoC support
21202119 M: Lars Povlsen <lars.povlsen@microchip.com>
21212120 M: Steen Hegelund <Steen.Hegelund@microchip.com>
2122−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
2121+M: UNGLinuxDriver@microchip.com
21232122 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
21242123 S: Supported
21252124 T: git git://github.com/microchip-ung/linux-upstream.git
@@ -2942,7 +2941,6 @@ S: Maintained · 816 unmodified lines
29422941 F: drivers/hwmon/asus_atk0110.c
29432942
29442943 ATLX ETHERNET DRIVERS
2945−M: Jay Cliburn <jcliburn@gmail.com>
29462944 M: Chris Snook <chris.snook@gmail.com>
29472945 L: netdev@vger.kernel.org
29482946 S: Maintained
@@ -3556,7 +3554,7 @@ S: Supported · 607 unmodified lines
35563554 F: drivers/net/ethernet/broadcom/bnxt/
35573555
35583556 BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
3559−M: Arend van Spriel <arend.vanspriel@broadcom.com>
3557+M: Arend van Spriel <aspriel@gmail.com>
35603558 M: Franky Lin <franky.lin@broadcom.com>
35613559 M: Hante Meuleman <hante.meuleman@broadcom.com>
35623560 M: Chi-hsien Lin <chi-hsien.lin@infineon.com>
@@ -3883,7 +3881,7 @@ F: drivers/mtd/nand/raw/cadence-nand-controller.c · 320 unmodified lines
38833881 CADENCE USB3 DRD IP DRIVER
38843882 M: Peter Chen <peter.chen@nxp.com>
38853883 M: Pawel Laszczak <pawell@cadence.com>
3886−M: Roger Quadros <rogerq@ti.com>
3884+R: Roger Quadros <rogerq@kernel.org>
38873885 R: Aswath Govindraju <a-govindraju@ti.com>
38883886 L: linux-usb@vger.kernel.org
38893887 S: Maintained
@@ -3961,7 +3959,7 @@ F: net/can/ · 71 unmodified lines
39613959 CAN-J1939 NETWORK LAYER
39623960 M: Robin van der Gracht <robin@protonic.nl>
39633961 M: Oleksij Rempel <o.rempel@pengutronix.de>
3964−R: Pengutronix Kernel Team <kernel@pengutronix.de>
3962+R: kernel@pengutronix.de
39653963 L: linux-can@vger.kernel.org
39663964 S: Maintained
39673965 F: Documentation/networking/j1939.rst
@@ -4588,7 +4586,7 @@ B: https://bugzilla.kernel.org · 620 unmodified lines
45884586 T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
45894587 F: Documentation/admin-guide/pm/cpuidle.rst
45904588 F: Documentation/driver-api/pm/cpuidle.rst
4591−F: drivers/cpuidle/*
4589+F: drivers/cpuidle/
45924590 F: include/linux/cpuidle.h
45934591
45944592 CPU POWER MONITORING SUBSYSTEM
@@ -4922,9 +4920,8 @@ F: Documentation/scsi/dc395x.rst · 327 unmodified lines
49224920 F: drivers/scsi/dc395x.*
49234921
49244922 DCCP PROTOCOL
4925−M: Gerrit Renker <gerrit@erg.abdn.ac.uk>
49264923 L: dccp@vger.kernel.org
4927−S: Maintained
4924+S: Orphan
49284925 W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp
49294926 F: include/linux/dccp.h
49304927 F: include/linux/tfrc.h
@@ -7363,7 +7360,6 @@ L: linux-hardening@vger.kernel.org · 2432 unmodified lines
73637360 S: Maintained
73647361 F: Documentation/kbuild/gcc-plugins.rst
73657362 F: scripts/Makefile.gcc-plugins
7366−F: scripts/gcc-plugin.sh
73677363 F: scripts/gcc-plugins/
73687364
73697365 GCOV BASED KERNEL PROFILING
@@ -9240,7 +9236,7 @@ F: tools/testing/selftests/sgx/* · 1870 unmodified lines
92409236 K: \bSGX_
92419237
92429238 INTERCONNECT API
9243−M: Georgi Djakov <georgi.djakov@linaro.org>
9239+M: Georgi Djakov <djakov@kernel.org>
92449240 L: linux-pm@vger.kernel.org
92459241 S: Maintained
92469242 F: Documentation/devicetree/bindings/interconnect/
@@ -9273,7 +9269,7 @@ F: drivers/net/ethernet/sgi/ioc3-eth.c · 26 unmodified lines
92739269
92749270 IOMAP FILESYSTEM LIBRARY
92759271 M: Christoph Hellwig <hch@infradead.org>
9276−M: Darrick J. Wong <darrick.wong@oracle.com>
9272+M: Darrick J. Wong <djwong@kernel.org>
92779273 M: linux-xfs@vger.kernel.org
92789274 M: linux-fsdevel@vger.kernel.org
92799275 L: linux-xfs@vger.kernel.org
@@ -9327,7 +9323,6 @@ W: http://www.adaptec.com/ · 47 unmodified lines
93279323 F: drivers/scsi/ips*
93289324
93299325 IPVS
9330−M: Wensong Zhang <wensong@linux-vs.org>
93319326 M: Simon Horman <horms@verge.net.au>
93329327 M: Julian Anastasov <ja@ssi.bg>
93339328 L: netdev@vger.kernel.org
@@ -9776,7 +9771,7 @@ F: tools/testing/selftests/kvm/s390x/ · 442 unmodified lines
97769771
97779772 KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
97789773 M: Paolo Bonzini <pbonzini@redhat.com>
9779−R: Sean Christopherson <sean.j.christopherson@intel.com>
9774+R: Sean Christopherson <seanjc@google.com>
97809775 R: Vitaly Kuznetsov <vkuznets@redhat.com>
97819776 R: Wanpeng Li <wanpengli@tencent.com>
97829777 R: Jim Mattson <jmattson@google.com>
@@ -10260,7 +10255,6 @@ S: Supported · 477 unmodified lines
1026010255 T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev
1026110256 F: Documentation/atomic_bitops.txt
1026210257 F: Documentation/atomic_t.txt
10263−F: Documentation/core-api/atomic_ops.rst
1026410258 F: Documentation/core-api/refcount-vs-atomic.rst
1026510259 F: Documentation/litmus-tests/
1026610260 F: Documentation/memory-barriers.txt
@@ -10847,7 +10841,7 @@ F: drivers/media/radio/radio-maxiradio* · 580 unmodified lines
1084710841
1084810842 MCAN MMIO DEVICE DRIVER
1084910843 M: Dan Murphy <dmurphy@ti.com>
10850−M: Sriram Dash <sriram.dash@samsung.com>
10844+M: Pankaj Sharma <pankj.sharma@samsung.com>
1085110845 L: linux-can@vger.kernel.org
1085210846 S: Maintained
1085310847 F: Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
@@ -11667,7 +11661,7 @@ F: drivers/media/platform/atmel/atmel-isi.h · 813 unmodified lines
1166711661
1166811662 MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER
1166911663 M: Woojung Huh <woojung.huh@microchip.com>
11670−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11664+M: UNGLinuxDriver@microchip.com
1167111665 L: netdev@vger.kernel.org
1167211666 S: Maintained
1167311667 F: Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -11677,7 +11671,7 @@ F: net/dsa/tag_ksz.c · 3 unmodified lines
1167711671
1167811672 MICROCHIP LAN743X ETHERNET DRIVER
1167911673 M: Bryan Whitehead <bryan.whitehead@microchip.com>
11680−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11674+M: UNGLinuxDriver@microchip.com
1168111675 L: netdev@vger.kernel.org
1168211676 S: Maintained
1168311677 F: drivers/net/ethernet/microchip/lan743x_*
@@ -11771,7 +11765,7 @@ F: drivers/net/wireless/microchip/wilc1000/ · 87 unmodified lines
1177111765
1177211766 MICROSEMI MIPS SOCS
1177311767 M: Alexandre Belloni <alexandre.belloni@bootlin.com>
11774−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11768+M: UNGLinuxDriver@microchip.com
1177511769 L: linux-mips@vger.kernel.org
1177611770 S: Supported
1177711771 F: Documentation/devicetree/bindings/mips/mscc.txt
@@ -12418,7 +12412,6 @@ F: tools/testing/selftests/net/ipsec.c · 640 unmodified lines
1241812412
1241912413 NETWORKING [IPv4/IPv6]
1242012414 M: "David S. Miller" <davem@davemloft.net>
12421−M: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
1242212415 M: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
1242312416 L: netdev@vger.kernel.org
1242412417 S: Maintained
@@ -12475,7 +12468,6 @@ F: net/ipv6/tcp*.c · 50 unmodified lines
1247512468
1247612469 NETWORKING [TLS]
1247712470 M: Boris Pismenny <borisp@nvidia.com>
12478−M: Aviad Yehezkel <aviadye@nvidia.com>
1247912471 M: John Fastabend <john.fastabend@gmail.com>
1248012472 M: Daniel Borkmann <daniel@iogearbox.net>
1248112473 M: Jakub Kicinski <kuba@kernel.org>
@@ -12825,10 +12817,10 @@ F: tools/objtool/ · 343 unmodified lines
1282512817 F: include/linux/objtool.h
1282612818
1282712819 OCELOT ETHERNET SWITCH DRIVER
12828−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
1282912820 M: Vladimir Oltean <vladimir.oltean@nxp.com>
1283012821 M: Claudiu Manoil <claudiu.manoil@nxp.com>
1283112822 M: Alexandre Belloni <alexandre.belloni@bootlin.com>
12823+M: UNGLinuxDriver@microchip.com
1283212824 L: netdev@vger.kernel.org
1283312825 S: Supported
1283412826 F: drivers/net/dsa/ocelot/*
@@ -12850,7 +12842,7 @@ F: include/misc/ocxl* · 15 unmodified lines
1285012842 F: include/uapi/misc/ocxl.h
1285112843
1285212844 OMAP AUDIO SUPPORT
12853−M: Peter Ujfalusi <peter.ujfalusi@ti.com>
12845+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1285412846 M: Jarkko Nikula <jarkko.nikula@bitmer.com>
1285512847 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1285612848 L: linux-omap@vger.kernel.org
@@ -13890,7 +13882,7 @@ F: drivers/platform/x86/peaq-wmi.c · 1033 unmodified lines
1389013882
1389113883 PENSANDO ETHERNET DRIVERS
1389213884 M: Shannon Nelson <snelson@pensando.io>
13893−M: Pensando Drivers <drivers@pensando.io>
13885+M: drivers@pensando.io
1389413886 L: netdev@vger.kernel.org
1389513887 S: Supported
1389613888 F: Documentation/networking/device_drivers/ethernet/pensando/ionic.rst
@@ -14669,7 +14661,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git · 772 unmodified lines
1466914661 F: drivers/net/wireless/ath/ath11k/
1467014662
1467114663 QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
14672−M: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
14664+M: ath9k-devel@qca.qualcomm.com
1467314665 L: linux-wireless@vger.kernel.org
1467414666 S: Supported
1467514667 W: https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
@@ -14820,7 +14812,7 @@ M: Alex Deucher <alexander.deucher@amd.com> · 144 unmodified lines
1482014812 M: Christian König <christian.koenig@amd.com>
1482114813 L: amd-gfx@lists.freedesktop.org
1482214814 S: Supported
14823−T: git git://people.freedesktop.org/~agd5f/linux
14815+T: git https://gitlab.freedesktop.org/agd5f/linux.git
1482414816 F: drivers/gpu/drm/amd/
1482514817 F: drivers/gpu/drm/radeon/
1482614818 F: include/uapi/drm/amdgpu_drm.h
@@ -16321,6 +16313,7 @@ M: Pekka Enberg <penberg@kernel.org> · 1494 unmodified lines
1632116313 M: David Rientjes <rientjes@google.com>
1632216314 M: Joonsoo Kim <iamjoonsoo.kim@lge.com>
1632316315 M: Andrew Morton <akpm@linux-foundation.org>
16316+M: Vlastimil Babka <vbabka@suse.cz>
1632416317 L: linux-mm@kvack.org
1632516318 S: Maintained
1632616319 F: include/linux/sl?b*.h
@@ -16710,6 +16703,8 @@ M: Samuel Thibault <samuel.thibault@ens-lyon.org> · 383 unmodified lines
1671016703 L: speakup@linux-speakup.org
1671116704 S: Odd Fixes
1671216705 W: http://www.linux-speakup.org/
16706+W: https://github.com/linux-speakup/speakup
16707+B: https://github.com/linux-speakup/speakup/issues
1671316708 F: drivers/accessibility/speakup/
1671416709
1671516710 SPEAR CLOCK FRAMEWORK SUPPORT
@@ -17541,7 +17536,7 @@ F: arch/xtensa/ · 825 unmodified lines
1754117536 F: drivers/irqchip/irq-xtensa-*
1754217537
1754317538 TEXAS INSTRUMENTS ASoC DRIVERS
17544−M: Peter Ujfalusi <peter.ujfalusi@ti.com>
17539+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1754517540 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1754617541 S: Maintained
1754717542 F: sound/soc/ti/
@@ -17553,6 +17548,19 @@ S: Supported · 5 unmodified lines
1755317548 F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
1755417549 F: drivers/iio/dac/ti-dac7612.c
1755517550
17551+TEXAS INSTRUMENTS DMA DRIVERS
17552+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
17553+L: dmaengine@vger.kernel.org
17554+S: Maintained
17555+F: Documentation/devicetree/bindings/dma/ti-dma-crossbar.txt
17556+F: Documentation/devicetree/bindings/dma/ti-edma.txt
17557+F: Documentation/devicetree/bindings/dma/ti/
17558+F: drivers/dma/ti/
17559+X: drivers/dma/ti/cppi41.c
17560+F: include/linux/dma/k3-udma-glue.h
17561+F: include/linux/dma/ti-cppi5.h
17562+F: include/linux/dma/k3-psil.h
17563+
1755617564 TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
1755717565 M: Nishanth Menon <nm@ti.com>
1755817566 M: Tero Kristo <t-kristo@ti.com>
@@ -17838,7 +17846,7 @@ F: Documentation/devicetree/bindings/net/nfc/trf7970a.txt · 279 unmodified lines
1783817846 F: drivers/nfc/trf7970a.c
1783917847
1784017848 TI TWL4030 SERIES SOC CODEC DRIVER
17841−M: Peter Ujfalusi <peter.ujfalusi@ti.com>
17849+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1784217850 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1784317851 S: Maintained
1784417852 F: sound/soc/codecs/twl4030*
@@ -18370,7 +18378,7 @@ F: include/linux/usb/isp116x.h · 525 unmodified lines
1837018378
1837118379 USB LAN78XX ETHERNET DRIVER
1837218380 M: Woojung Huh <woojung.huh@microchip.com>
18373−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
18381+M: UNGLinuxDriver@microchip.com
1837418382 L: netdev@vger.kernel.org
1837518383 S: Maintained
1837618384 F: Documentation/devicetree/bindings/net/microchip,lan78xx.txt
@@ -18484,7 +18492,7 @@ F: drivers/net/usb/smsc75xx.* · 107 unmodified lines
1848418492
1848518493 USB SMSC95XX ETHERNET DRIVER
1848618494 M: Steve Glendinning <steve.glendinning@shawell.net>
18487−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
18495+M: UNGLinuxDriver@microchip.com
1848818496 L: netdev@vger.kernel.org
1848918497 S: Maintained
1849018498 F: drivers/net/usb/smsc95xx.*
@@ -19031,7 +19039,7 @@ F: drivers/input/mouse/vmmouse.h · 540 unmodified lines
1903119039
1903219040 VMWARE VMXNET3 ETHERNET DRIVER
1903319041 M: Ronak Doshi <doshir@vmware.com>
19034−M: "VMware, Inc." <pv-drivers@vmware.com>
19042+M: pv-drivers@vmware.com
1903519043 L: netdev@vger.kernel.org
1903619044 S: Maintained
1903719045 F: drivers/net/vmxnet3/
@@ -19058,7 +19066,6 @@ K: regulator_get_optional · 20 unmodified lines
1905819066
1905919067 VRF
1906019068 M: David Ahern <dsahern@kernel.org>
19061−M: Shrijeet Mukherjee <shrijeet@gmail.com>
1906219069 L: netdev@vger.kernel.org
1906319070 S: Maintained
1906419071 F: Documentation/networking/vrf.rst
@@ -19505,7 +19512,7 @@ F: arch/x86/xen/*swiotlb* · 440 unmodified lines
1950519512 F: drivers/xen/*swiotlb*
1950619513
1950719514 XFS FILESYSTEM
19508−M: Darrick J. Wong <darrick.wong@oracle.com>
19515+M: Darrick J. Wong <djwong@kernel.org>
1950919516 M: linux-xfs@vger.kernel.org
1951019517 L: linux-xfs@vger.kernel.org
1951119518 S: Supported
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 11
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc4
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
arch/Kconfig+6−0
@@ -1105,6 +1105,12 @@ config HAVE_ARCH_PFN_VALID · 1104 unmodified lines
11051105 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
11061106 bool
11071107
1108+config ARCH_SPLIT_ARG64
1109+ bool
1110+ help
1111+ If a 32-bit architecture requires 64-bit arguments to be split into
1112+ pairs of 32-bit arguments, select this option.
1113+
11081114 source "kernel/gcov/Kconfig"
11091115
11101116 source "scripts/gcc-plugins/Kconfig"
arch/alpha/include/asm/local64.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/local64.h>
arch/arc/Makefile+13−7
@@ -102,16 +102,22 @@ libs-y += arch/arc/lib/ $(LIBGCC) · 101 unmodified lines
102102
103103 boot := arch/arc/boot
104104
105−#default target for make without any arguments.
106−KBUILD_IMAGE := $(boot)/bootpImage
107−
108−all: bootpImage
109−bootpImage: vmlinux
110−
111−boot_targets += uImage uImage.bin uImage.gz
105+boot_targets := uImage.bin uImage.gz uImage.lzma
112106
107+PHONY += $(boot_targets)
113108 $(boot_targets): vmlinux
114109 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
115110
111+uimage-default-y := uImage.bin
112+uimage-default-$(CONFIG_KERNEL_GZIP) := uImage.gz
113+uimage-default-$(CONFIG_KERNEL_LZMA) := uImage.lzma
114+
115+PHONY += uImage
116+uImage: $(uimage-default-y)
117+ @ln -sf $< $(boot)/uImage
118+ @$(kecho) ' Image $(boot)/uImage is ready'
119+
120+CLEAN_FILES += $(boot)/uImage
121+
116122 archclean:
117123 $(Q)$(MAKE) $(clean)=$(boot)
arch/arc/boot/Makefile+4−14
@@ -1,5 +1,4 @@
11 # SPDX-License-Identifier: GPL-2.0
2−targets := vmlinux.bin vmlinux.bin.gz uImage
32
43 # uImage build relies on mkimage being availble on your host for ARC target
54 # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage
@@ -7,23 +6,18 @@ targets := vmlinux.bin vmlinux.bin.gz uImage · 1 unmodified line
76
87 OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S
98
10−LINUX_START_TEXT = $$(readelf -h vmlinux | \
9+LINUX_START_TEXT = $$($(READELF) -h vmlinux | \
1110 grep "Entry point address" | grep -o 0x.*)
1211
1312 UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE)
1413 UIMAGE_ENTRYADDR = $(LINUX_START_TEXT)
1514
16−suffix-y := bin
17−suffix-$(CONFIG_KERNEL_GZIP) := gz
18−suffix-$(CONFIG_KERNEL_LZMA) := lzma
19−
20−targets += uImage
15+targets += vmlinux.bin
16+targets += vmlinux.bin.gz
17+targets += vmlinux.bin.lzma
2118 targets += uImage.bin
2219 targets += uImage.gz
2320 targets += uImage.lzma
24−extra-y += vmlinux.bin
25−extra-y += vmlinux.bin.gz
26−extra-y += vmlinux.bin.lzma
2721
2822 $(obj)/vmlinux.bin: vmlinux FORCE
2923 $(call if_changed,objcopy)
@@ -42,7 +36,3 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE · 12 unmodified lines
4236
4337 $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
4438 $(call if_changed,uimage,lzma)
45−
46−$(obj)/uImage: $(obj)/uImage.$(suffix-y)
47− @ln -sf $(notdir $<) $@
48− @echo ' Image $@ is ready'
arch/arc/include/asm/Kbuild+0−1
@@ -1,7 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0
22 generic-y += extable.h
33 generic-y += kvm_para.h
4−generic-y += local64.h
54 generic-y += mcs_spinlock.h
65 generic-y += parport.h
76 generic-y += user.h
arch/arc/include/asm/page.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #ifndef __ASSEMBLY__
1111
1212 #define clear_page(paddr) memset((paddr), 0, PAGE_SIZE)
13+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
1314 #define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
1415
1516 struct vm_area_struct;
arch/arc/kernel/entry.S+1−1
@@ -307,7 +307,7 @@ resume_user_mode_begin: · 306 unmodified lines
307307 mov r0, sp ; pt_regs for arg to do_signal()/do_notify_resume()
308308
309309 GET_CURR_THR_INFO_FLAGS r9
310− and.f 0, r9, TIF_SIGPENDING|TIF_NOTIFY_SIGNAL
310+ and.f 0, r9, _TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL
311311 bz .Lchk_notify_resume
312312
313313 ; Normal Trap/IRQ entry only saves Scratch (caller-saved) regs
arch/arc/plat-hsdk/Kconfig+1−0
@@ -7,6 +7,7 @@ menuconfig ARC_SOC_HSDK · 6 unmodified lines
77 depends on ISA_ARCV2
88 select ARC_HAS_ACCL_REGS
99 select ARC_IRQ_NO_AUTOSAVE
10+ select ARC_FPU_SAVE_RESTORE
1011 select CLK_HSDK
1112 select RESET_CONTROLLER
1213 select RESET_HSDK
arch/arm/boot/dts/omap3-n950-n9.dtsi+8−0
@@ -494,3 +494,11 @@ · 493 unmodified lines
494494 clock-names = "sysclk";
495495 };
496496 };
497+
498+&aes1_target {
499+ status = "disabled";
500+};
501+
502+&aes2_target {
503+ status = "disabled";
504+};
arch/arm/boot/dts/picoxcell-pc3x2.dtsi+4−0
@@ -45,18 +45,21 @@ · 44 unmodified lines
4545 emac: gem@30000 {
4646 compatible = "cadence,gem";
4747 reg = <0x30000 0x10000>;
48+ interrupt-parent = <&vic0>;
4849 interrupts = <31>;
4950 };
5051
5152 dmac1: dmac@40000 {
5253 compatible = "snps,dw-dmac";
5354 reg = <0x40000 0x10000>;
55+ interrupt-parent = <&vic0>;
5456 interrupts = <25>;
5557 };
5658
5759 dmac2: dmac@50000 {
5860 compatible = "snps,dw-dmac";
5961 reg = <0x50000 0x10000>;
62+ interrupt-parent = <&vic0>;
6063 interrupts = <26>;
6164 };
6265
@@ -233,6 +236,7 @@ · 170 unmodified lines
233236 axi2pico@c0000000 {
234237 compatible = "picochip,axi2pico-pc3x2";
235238 reg = <0xc0000000 0x10000>;
239+ interrupt-parent = <&vic0>;
236240 interrupts = <13 14 15 16 17 18 19 20 21>;
237241 };
238242 };
arch/arm/boot/dts/ste-ux500-samsung-golden.dts+1−0
@@ -329,6 +329,7 @@ · 328 unmodified lines
329329 panel@0 {
330330 compatible = "samsung,s6e63m0";
331331 reg = <0>;
332+ max-brightness = <15>;
332333 vdd3-supply = <&panel_reg_3v0>;
333334 vci-supply = <&panel_reg_1v8>;
334335 reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
arch/arm/configs/omap2plus_defconfig+1−1
@@ -279,6 +279,7 @@ CONFIG_SERIAL_OMAP_CONSOLE=y · 278 unmodified lines
279279 CONFIG_SERIAL_DEV_BUS=y
280280 CONFIG_I2C_CHARDEV=y
281281 CONFIG_SPI=y
282+CONFIG_SPI_GPIO=m
282283 CONFIG_SPI_OMAP24XX=y
283284 CONFIG_SPI_TI_QSPI=m
284285 CONFIG_HSI=m
@@ -296,7 +297,6 @@ CONFIG_GPIO_TWL4030=y · 11 unmodified lines
296297 CONFIG_W1=m
297298 CONFIG_HDQ_MASTER_OMAP=m
298299 CONFIG_W1_SLAVE_DS250X=m
299−CONFIG_POWER_AVS=y
300300 CONFIG_POWER_RESET=y
301301 CONFIG_POWER_RESET_GPIO=y
302302 CONFIG_BATTERY_BQ27XXX=m
arch/arm/crypto/chacha-glue.c+1−0
@@ -60,6 +60,7 @@ static void chacha_doneon(u32 *state, u8 *dst, const u8 *src, · 59 unmodified lines
6060 chacha_block_xor_neon(state, d, s, nrounds);
6161 if (d != dst)
6262 memcpy(dst, buf, bytes);
63+ state[12]++;
6364 }
6465 }
6566
arch/arm/include/asm/Kbuild+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 generic-y += early_ioremap.h
33 generic-y += extable.h
44 generic-y += flat.h
5−generic-y += local64.h
65 generic-y += parport.h
76
87 generated-y += mach-types.h
arch/arm/mach-omap2/omap_device.c+5−3
@@ -230,10 +230,12 @@ static int _omap_device_notifier_call(struct notifier_block *nb, · 229 unmodified lines
230230 break;
231231 case BUS_NOTIFY_BIND_DRIVER:
232232 od = to_omap_device(pdev);
233− if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) &&
234− pm_runtime_status_suspended(dev)) {
233+ if (od) {
235234 od->_driver_status = BUS_NOTIFY_BIND_DRIVER;
236− pm_runtime_set_active(dev);
235+ if (od->_state == OMAP_DEVICE_STATE_ENABLED &&
236+ pm_runtime_status_suspended(dev)) {
237+ pm_runtime_set_active(dev);
238+ }
237239 }
238240 break;
239241 case BUS_NOTIFY_ADD_DEVICE:
arch/arm/mach-omap2/pmic-cpcap.c+1−1
@@ -71,7 +71,7 @@ static struct omap_voltdm_pmic omap_cpcap_iva = { · 70 unmodified lines
7171 .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
7272 .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
7373 .vddmin = 900000,
74− .vddmax = 1350000,
74+ .vddmax = 1375000,
7575 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
7676 .i2c_slave_addr = 0x44,
7777 .volt_reg_addr = 0x0,
arch/arm/xen/enlighten.c+1−1
@@ -371,7 +371,7 @@ static int __init xen_guest_init(void) · 370 unmodified lines
371371 }
372372 gnttab_init();
373373 if (!xen_initial_domain())
374− xenbus_probe(NULL);
374+ xenbus_probe();
375375
376376 /*
377377 * Making sure board specific code will not set up ops for
arch/arm64/Kconfig+0−2
@@ -174,8 +174,6 @@ config ARM64 · 173 unmodified lines
174174 select HAVE_NMI
175175 select HAVE_PATA_PLATFORM
176176 select HAVE_PERF_EVENTS
177− select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI && HW_PERF_EVENTS
178− select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
179177 select HAVE_PERF_REGS
180178 select HAVE_PERF_USER_STACK_DUMP
181179 select HAVE_REGS_AND_STACK_ACCESS_API
arch/arm64/Makefile+7−3
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #
1111 # Copyright (C) 1995-2001 by Russell King
1212
13−LDFLAGS_vmlinux :=--no-undefined -X -z norelro
13+LDFLAGS_vmlinux :=--no-undefined -X
1414
1515 ifeq ($(CONFIG_RELOCATABLE), y)
1616 # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
@@ -115,16 +115,20 @@ KBUILD_CPPFLAGS += -mbig-endian · 98 unmodified lines
115115 CHECKFLAGS += -D__AARCH64EB__
116116 # Prefer the baremetal ELF build target, but not all toolchains include
117117 # it so fall back to the standard linux version if needed.
118−KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
118+KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb -z norelro)
119119 UTS_MACHINE := aarch64_be
120120 else
121121 KBUILD_CPPFLAGS += -mlittle-endian
122122 CHECKFLAGS += -D__AARCH64EL__
123123 # Same as above, prefer ELF but fall back to linux target if needed.
124−KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
124+KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux -z norelro)
125125 UTS_MACHINE := aarch64
126126 endif
127127
128+ifeq ($(CONFIG_LD_IS_LLD), y)
129+KBUILD_LDFLAGS += -z norelro
130+endif
131+
128132 CHECKFLAGS += -D__aarch64__
129133
130134 ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS),y)
arch/arm64/boot/dts/bitmain/bm1880.dtsi+3−3
@@ -127,7 +127,7 @@ · 126 unmodified lines
127127 compatible = "snps,dw-apb-gpio-port";
128128 gpio-controller;
129129 #gpio-cells = <2>;
130− snps,nr-gpios = <32>;
130+ ngpios = <32>;
131131 reg = <0>;
132132 interrupt-controller;
133133 #interrupt-cells = <2>;
@@ -145,7 +145,7 @@ · 11 unmodified lines
145145 compatible = "snps,dw-apb-gpio-port";
146146 gpio-controller;
147147 #gpio-cells = <2>;
148− snps,nr-gpios = <32>;
148+ ngpios = <32>;
149149 reg = <0>;
150150 interrupt-controller;
151151 #interrupt-cells = <2>;
@@ -163,7 +163,7 @@ · 11 unmodified lines
163163 compatible = "snps,dw-apb-gpio-port";
164164 gpio-controller;
165165 #gpio-cells = <2>;
166− snps,nr-gpios = <8>;
166+ ngpios = <8>;
167167 reg = <0>;
168168 interrupt-controller;
169169 #interrupt-cells = <2>;
arch/arm64/include/asm/Kbuild+0−1
@@ -1,6 +1,5 @@
11 # SPDX-License-Identifier: GPL-2.0
22 generic-y += early_ioremap.h
3−generic-y += local64.h
43 generic-y += mcs_spinlock.h
54 generic-y += qrwlock.h
65 generic-y += qspinlock.h
arch/arm64/include/asm/atomic.h+5−5
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 #include <asm/lse.h>
1818
1919 #define ATOMIC_OP(op) \
20−static inline void arch_##op(int i, atomic_t *v) \
20+static __always_inline void arch_##op(int i, atomic_t *v) \
2121 { \
2222 __lse_ll_sc_body(op, i, v); \
2323 }
@@ -32,7 +32,7 @@ ATOMIC_OP(atomic_sub) · 8 unmodified lines
3232 #undef ATOMIC_OP
3333
3434 #define ATOMIC_FETCH_OP(name, op) \
35−static inline int arch_##op##name(int i, atomic_t *v) \
35+static __always_inline int arch_##op##name(int i, atomic_t *v) \
3636 { \
3737 return __lse_ll_sc_body(op##name, i, v); \
3838 }
@@ -56,7 +56,7 @@ ATOMIC_FETCH_OPS(atomic_sub_return) · 17 unmodified lines
5656 #undef ATOMIC_FETCH_OPS
5757
5858 #define ATOMIC64_OP(op) \
59−static inline void arch_##op(long i, atomic64_t *v) \
59+static __always_inline void arch_##op(long i, atomic64_t *v) \
6060 { \
6161 __lse_ll_sc_body(op, i, v); \
6262 }
@@ -71,7 +71,7 @@ ATOMIC64_OP(atomic64_sub) · 8 unmodified lines
7171 #undef ATOMIC64_OP
7272
7373 #define ATOMIC64_FETCH_OP(name, op) \
74−static inline long arch_##op##name(long i, atomic64_t *v) \
74+static __always_inline long arch_##op##name(long i, atomic64_t *v) \
7575 { \
7676 return __lse_ll_sc_body(op##name, i, v); \
7777 }
@@ -94,7 +94,7 @@ ATOMIC64_FETCH_OPS(atomic64_sub_return) · 16 unmodified lines
9494 #undef ATOMIC64_FETCH_OP
9595 #undef ATOMIC64_FETCH_OPS
9696
97−static inline long arch_atomic64_dec_if_positive(atomic64_t *v)
97+static __always_inline long arch_atomic64_dec_if_positive(atomic64_t *v)
9898 {
9999 return __lse_ll_sc_body(atomic64_dec_if_positive, v);
100100 }
arch/arm64/include/asm/kvm_host.h+23−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/jump_label.h>
1818 #include <linux/kvm_types.h>
1919 #include <linux/percpu.h>
20+#include <linux/psci.h>
2021 #include <asm/arch_gicv3.h>
2122 #include <asm/barrier.h>
2223 #include <asm/cpufeature.h>
@@ -240,6 +241,28 @@ struct kvm_host_data { · 217 unmodified lines
240241 struct kvm_pmu_events pmu_events;
241242 };
242243
244+struct kvm_host_psci_config {
245+ /* PSCI version used by host. */
246+ u32 version;
247+
248+ /* Function IDs used by host if version is v0.1. */
249+ struct psci_0_1_function_ids function_ids_0_1;
250+
251+ bool psci_0_1_cpu_suspend_implemented;
252+ bool psci_0_1_cpu_on_implemented;
253+ bool psci_0_1_cpu_off_implemented;
254+ bool psci_0_1_migrate_implemented;
255+};
256+
257+extern struct kvm_host_psci_config kvm_nvhe_sym(kvm_host_psci_config);
258+#define kvm_host_psci_config CHOOSE_NVHE_SYM(kvm_host_psci_config)
259+
260+extern s64 kvm_nvhe_sym(hyp_physvirt_offset);
261+#define hyp_physvirt_offset CHOOSE_NVHE_SYM(hyp_physvirt_offset)
262+
263+extern u64 kvm_nvhe_sym(hyp_cpu_logical_map)[NR_CPUS];
264+#define hyp_cpu_logical_map CHOOSE_NVHE_SYM(hyp_cpu_logical_map)
265+
243266 struct vcpu_reset_state {
244267 unsigned long pc;
245268 unsigned long r0;
arch/arm64/include/asm/uaccess.h+13−3
@@ -176,10 +176,21 @@ static inline void __uaccess_enable_hw_pan(void) · 175 unmodified lines
176176 * The Tag check override (TCO) bit disables temporarily the tag checking
177177 * preventing the issue.
178178 */
179−static inline void uaccess_disable_privileged(void)
179+static inline void __uaccess_disable_tco(void)
180180 {
181181 asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(0),
182182 ARM64_MTE, CONFIG_KASAN_HW_TAGS));
183+}
184+
185+static inline void __uaccess_enable_tco(void)
186+{
187+ asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
188+ ARM64_MTE, CONFIG_KASAN_HW_TAGS));
189+}
190+
191+static inline void uaccess_disable_privileged(void)
192+{
193+ __uaccess_disable_tco();
183194
184195 if (uaccess_ttbr0_disable())
185196 return;
@@ -189,8 +200,7 @@ static inline void uaccess_disable_privileged(void) · 3 unmodified lines
189200
190201 static inline void uaccess_enable_privileged(void)
191202 {
192− asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
193− ARM64_MTE, CONFIG_KASAN_HW_TAGS));
203+ __uaccess_enable_tco();
194204
195205 if (uaccess_ttbr0_enable())
196206 return;
arch/arm64/kernel/asm-offsets.c+1−1
@@ -75,7 +75,7 @@ int main(void) · 74 unmodified lines
7575 DEFINE(S_SDEI_TTBR1, offsetof(struct pt_regs, sdei_ttbr1));
7676 DEFINE(S_PMR_SAVE, offsetof(struct pt_regs, pmr_save));
7777 DEFINE(S_STACKFRAME, offsetof(struct pt_regs, stackframe));
78− DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
78+ DEFINE(PT_REGS_SIZE, sizeof(struct pt_regs));
7979 BLANK();
8080 #ifdef CONFIG_COMPAT
8181 DEFINE(COMPAT_SIGFRAME_REGS_OFFSET, offsetof(struct compat_sigframe, uc.uc_mcontext.arm_r0));
arch/arm64/kernel/cpufeature.c+1−1
@@ -2568,7 +2568,7 @@ static void verify_hyp_capabilities(void) · 2567 unmodified lines
25682568 int parange, ipa_max;
25692569 unsigned int safe_vmid_bits, vmid_bits;
25702570
2571− if (!IS_ENABLED(CONFIG_KVM) || !IS_ENABLED(CONFIG_KVM_ARM_HOST))
2571+ if (!IS_ENABLED(CONFIG_KVM))
25722572 return;
25732573
25742574 safe_mmfr1 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
arch/arm64/kernel/entry-ftrace.S+6−6
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 */
3636 .macro ftrace_regs_entry, allregs=0
3737 /* Make room for pt_regs, plus a callee frame */
38− sub sp, sp, #(S_FRAME_SIZE + 16)
38+ sub sp, sp, #(PT_REGS_SIZE + 16)
3939
4040 /* Save function arguments (and x9 for simplicity) */
4141 stp x0, x1, [sp, #S_X0]
@@ -61,15 +61,15 @@ · 19 unmodified lines
6161 .endif
6262
6363 /* Save the callsite's SP and LR */
64− add x10, sp, #(S_FRAME_SIZE + 16)
64+ add x10, sp, #(PT_REGS_SIZE + 16)
6565 stp x9, x10, [sp, #S_LR]
6666
6767 /* Save the PC after the ftrace callsite */
6868 str x30, [sp, #S_PC]
6969
7070 /* Create a frame record for the callsite above pt_regs */
71− stp x29, x9, [sp, #S_FRAME_SIZE]
72− add x29, sp, #S_FRAME_SIZE
71+ stp x29, x9, [sp, #PT_REGS_SIZE]
72+ add x29, sp, #PT_REGS_SIZE
7373
7474 /* Create our frame record within pt_regs. */
7575 stp x29, x30, [sp, #S_STACKFRAME]
@@ -120,7 +120,7 @@ ftrace_common_return: · 44 unmodified lines
120120 ldr x9, [sp, #S_PC]
121121
122122 /* Restore the callsite's SP */
123− add sp, sp, #S_FRAME_SIZE + 16
123+ add sp, sp, #PT_REGS_SIZE + 16
124124
125125 ret x9
126126 SYM_CODE_END(ftrace_common)
@@ -130,7 +130,7 @@ SYM_CODE_START(ftrace_graph_caller) · 3 unmodified lines
130130 ldr x0, [sp, #S_PC]
131131 sub x0, x0, #AARCH64_INSN_SIZE // ip (callsite's BL insn)
132132 add x1, sp, #S_LR // parent_ip (callsite's LR)
133− ldr x2, [sp, #S_FRAME_SIZE] // parent fp (callsite's FP)
133+ ldr x2, [sp, #PT_REGS_SIZE] // parent fp (callsite's FP)
134134 bl prepare_ftrace_return
135135 b ftrace_common_return
136136 SYM_CODE_END(ftrace_graph_caller)
arch/arm64/kernel/entry.S+8−8
@@ -75,7 +75,7 @@ alternative_else_nop_endif · 74 unmodified lines
7575 .endif
7676 #endif
7777
78− sub sp, sp, #S_FRAME_SIZE
78+ sub sp, sp, #PT_REGS_SIZE
7979 #ifdef CONFIG_VMAP_STACK
8080 /*
8181 * Test whether the SP has overflowed, without corrupting a GPR.
@@ -96,7 +96,7 @@ alternative_else_nop_endif · 14 unmodified lines
9696 * userspace, and can clobber EL0 registers to free up GPRs.
9797 */
9898
99− /* Stash the original SP (minus S_FRAME_SIZE) in tpidr_el0. */
99+ /* Stash the original SP (minus PT_REGS_SIZE) in tpidr_el0. */
100100 msr tpidr_el0, x0
101101
102102 /* Recover the original x0 value and stash it in tpidrro_el0 */
@@ -182,7 +182,6 @@ alternative_else_nop_endif · 79 unmodified lines
182182 mrs_s \tmp2, SYS_GCR_EL1
183183 bfi \tmp2, \tmp, #0, #16
184184 msr_s SYS_GCR_EL1, \tmp2
185− isb
186185 #endif
187186 .endm
188187
@@ -194,6 +193,7 @@ alternative_else_nop_endif · 5 unmodified lines
194193 ldr_l \tmp, gcr_kernel_excl
195194
196195 mte_set_gcr \tmp, \tmp2
196+ isb
197197 1:
198198 #endif
199199 .endm
@@ -253,7 +253,7 @@ alternative_else_nop_endif · 53 unmodified lines
253253
254254 scs_load tsk, x20
255255 .else
256− add x21, sp, #S_FRAME_SIZE
256+ add x21, sp, #PT_REGS_SIZE
257257 get_current_task tsk
258258 .endif /* \el == 0 */
259259 mrs x22, elr_el1
@@ -377,7 +377,7 @@ alternative_else_nop_endif · 117 unmodified lines
377377 ldp x26, x27, [sp, #16 * 13]
378378 ldp x28, x29, [sp, #16 * 14]
379379 ldr lr, [sp, #S_LR]
380− add sp, sp, #S_FRAME_SIZE // restore sp
380+ add sp, sp, #PT_REGS_SIZE // restore sp
381381
382382 .if \el == 0
383383 alternative_insn eret, nop, ARM64_UNMAP_KERNEL_AT_EL0
@@ -580,12 +580,12 @@ __bad_stack: · 196 unmodified lines
580580
581581 /*
582582 * Store the original GPRs to the new stack. The orginal SP (minus
583− * S_FRAME_SIZE) was stashed in tpidr_el0 by kernel_ventry.
583+ * PT_REGS_SIZE) was stashed in tpidr_el0 by kernel_ventry.
584584 */
585− sub sp, sp, #S_FRAME_SIZE
585+ sub sp, sp, #PT_REGS_SIZE
586586 kernel_entry 1
587587 mrs x0, tpidr_el0
588− add x0, x0, #S_FRAME_SIZE
588+ add x0, x0, #PT_REGS_SIZE
589589 str x0, [sp, #S_SP]
590590
591591 /* Stash the regs for handle_bad_stack */
arch/arm64/kernel/perf_event.c+2−39
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323 #include <linux/platform_device.h>
2424 #include <linux/sched_clock.h>
2525 #include <linux/smp.h>
26−#include <linux/nmi.h>
27−#include <linux/cpufreq.h>
2826
2927 /* ARMv8 Cortex-A53 specific event types. */
3028 #define ARMV8_A53_PERFCTR_PREF_LINEFILL 0xC2
@@ -1250,21 +1248,10 @@ static struct platform_driver armv8_pmu_driver = { · 1219 unmodified lines
12501248
12511249 static int __init armv8_pmu_driver_init(void)
12521250 {
1253− int ret;
1254−
12551251 if (acpi_disabled)
1256− ret = platform_driver_register(&armv8_pmu_driver);
1252+ return platform_driver_register(&armv8_pmu_driver);
12571253 else
1258− ret = arm_pmu_acpi_probe(armv8_pmuv3_init);
1259−
1260− /*
1261− * Try to re-initialize lockup detector after PMU init in
1262− * case PMU events are triggered via NMIs.
1263− */
1264− if (ret == 0 && arm_pmu_irq_is_nmi())
1265− lockup_detector_init();
1266−
1267− return ret;
1254+ return arm_pmu_acpi_probe(armv8_pmuv3_init);
12681255 }
12691256 device_initcall(armv8_pmu_driver_init)
12701257
@@ -1322,27 +1309,3 @@ void arch_perf_update_userpage(struct perf_event *event, · 51 unmodified lines
13221309 userpg->cap_user_time_zero = 1;
13231310 userpg->cap_user_time_short = 1;
13241311 }
1325−
1326−#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF
1327−/*
1328− * Safe maximum CPU frequency in case a particular platform doesn't implement
1329− * cpufreq driver. Although, architecture doesn't put any restrictions on
1330− * maximum frequency but 5 GHz seems to be safe maximum given the available
1331− * Arm CPUs in the market which are clocked much less than 5 GHz. On the other
1332− * hand, we can't make it much higher as it would lead to a large hard-lockup
1333− * detection timeout on parts which are running slower (eg. 1GHz on
1334− * Developerbox) and doesn't possess a cpufreq driver.
1335− */
1336−#define SAFE_MAX_CPU_FREQ 5000000000UL // 5 GHz
1337−u64 hw_nmi_get_sample_period(int watchdog_thresh)
1338−{
1339− unsigned int cpu = smp_processor_id();
1340− unsigned long max_cpu_freq;
1341−
1342− max_cpu_freq = cpufreq_get_hw_max_freq(cpu) * 1000UL;
1343− if (!max_cpu_freq)
1344− max_cpu_freq = SAFE_MAX_CPU_FREQ;
1345−
1346− return (u64)max_cpu_freq * watchdog_thresh;
1347−}
1348−#endif
arch/arm64/kernel/probes/kprobes_trampoline.S+3−3
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 stp x24, x25, [sp, #S_X24]
2626 stp x26, x27, [sp, #S_X26]
2727 stp x28, x29, [sp, #S_X28]
28− add x0, sp, #S_FRAME_SIZE
28+ add x0, sp, #PT_REGS_SIZE
2929 stp lr, x0, [sp, #S_LR]
3030 /*
3131 * Construct a useful saved PSTATE
@@ -62,7 +62,7 @@ · 30 unmodified lines
6262 .endm
6363
6464 SYM_CODE_START(kretprobe_trampoline)
65− sub sp, sp, #S_FRAME_SIZE
65+ sub sp, sp, #PT_REGS_SIZE
6666
6767 save_all_base_regs
6868
@@ -76,7 +76,7 @@ SYM_CODE_START(kretprobe_trampoline) · 7 unmodified lines
7676
7777 restore_all_base_regs
7878
79− add sp, sp, #S_FRAME_SIZE
79+ add sp, sp, #PT_REGS_SIZE
8080 ret
8181
8282 SYM_CODE_END(kretprobe_trampoline)
arch/arm64/kernel/signal.c+0−7
@@ -914,13 +914,6 @@ static void do_signal(struct pt_regs *regs) · 913 unmodified lines
914914 asmlinkage void do_notify_resume(struct pt_regs *regs,
915915 unsigned long thread_flags)
916916 {
917− /*
918− * The assembly code enters us with IRQs off, but it hasn't
919− * informed the tracing code of that for efficiency reasons.
920− * Update the trace code with the current status.
921− */
922− trace_hardirqs_off();
923−
924917 do {
925918 if (thread_flags & _TIF_NEED_RESCHED) {
926919 /* Unmask Debug and SError for the next task */
arch/arm64/kernel/smp.c+1−2
@@ -434,7 +434,7 @@ static void __init hyp_mode_check(void) · 433 unmodified lines
434434 "CPU: CPUs started in inconsistent modes");
435435 else
436436 pr_info("CPU: All CPU(s) started at EL1\n");
437− if (IS_ENABLED(CONFIG_KVM))
437+ if (IS_ENABLED(CONFIG_KVM) && !is_kernel_in_hyp_mode())
438438 kvm_compute_layout();
439439 }
440440
@@ -807,7 +807,6 @@ int arch_show_interrupts(struct seq_file *p, int prec) · 366 unmodified lines
807807 unsigned int cpu, i;
808808
809809 for (i = 0; i < NR_IPI; i++) {
810− unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
811810 seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
812811 prec >= 4 ? " " : "");
813812 for_each_online_cpu(cpu)
arch/arm64/kernel/syscall.c+2−8
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #include <asm/daifflags.h>
1111 #include <asm/debug-monitors.h>
12+#include <asm/exception.h>
1213 #include <asm/fpsimd.h>
1314 #include <asm/syscall.h>
1415 #include <asm/thread_info.h>
@@ -165,15 +166,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, · 150 unmodified lines
165166 if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
166167 local_daif_mask();
167168 flags = current_thread_info()->flags;
168− if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) {
169− /*
170− * We're off to userspace, where interrupts are
171− * always enabled after we restore the flags from
172− * the SPSR.
173− */
174− trace_hardirqs_on();
169+ if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP))
175170 return;
176− }
177171 local_daif_restore(DAIF_PROCCTX);
178172 }
179173
arch/arm64/kernel/traps.c+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #include <asm/smp.h>
4343 #include <asm/stack_pointer.h>
4444 #include <asm/stacktrace.h>
45−#include <asm/exception.h>
4645 #include <asm/system_misc.h>
4746 #include <asm/sysreg.h>
4847
arch/arm64/kernel/vdso/Makefile+1−2
@@ -24,8 +24,7 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti · 23 unmodified lines
2424 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
2525 # preparation in build-time C")).
2626 ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
27− -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id=sha1 -n \
28− $(btildflags-y) -T
27+ -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
2928
3029 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
3130 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
arch/arm64/kernel/vdso/vdso.lds.S+1−4
@@ -40,9 +40,6 @@ SECTIONS · 39 unmodified lines
4040 PROVIDE (_etext = .);
4141 PROVIDE (etext = .);
4242
43− .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
44− .eh_frame : { KEEP (*(.eh_frame)) } :text
45−
4643 .dynamic : { *(.dynamic) } :text :dynamic
4744
4845 .rodata : { *(.rodata*) } :text
@@ -54,6 +51,7 @@ SECTIONS · 5 unmodified lines
5451 *(.note.GNU-stack)
5552 *(.data .data.* .gnu.linkonce.d.* .sdata*)
5653 *(.bss .sbss .dynbss .dynsbss)
54+ *(.eh_frame .eh_frame_hdr)
5755 }
5856 }
5957
@@ -66,7 +64,6 @@ PHDRS · 6 unmodified lines
6664 text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
6765 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
6866 note PT_NOTE FLAGS(4); /* PF_R */
69− eh_frame_hdr PT_GNU_EH_FRAME;
7067 }
7168
7269 /*
arch/arm64/kvm/Kconfig+0−8
@@ -49,14 +49,6 @@ if KVM · 48 unmodified lines
4949
5050 source "virt/kvm/Kconfig"
5151
52−config KVM_ARM_PMU
53− bool "Virtual Performance Monitoring Unit (PMU) support"
54− depends on HW_PERF_EVENTS
55− default y
56− help
57− Adds support for a virtual Performance Monitoring Unit (PMU) in
58− virtual machines.
59−
6052 endif # KVM
6153
6254 endif # VIRTUALIZATION
arch/arm64/kvm/Makefile+1−1
@@ -24,4 +24,4 @@ kvm-y := $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o \ · 23 unmodified lines
2424 vgic/vgic-mmio-v3.o vgic/vgic-kvm-device.o \
2525 vgic/vgic-its.o vgic/vgic-debug.o
2626
27−kvm-$(CONFIG_KVM_ARM_PMU) += pmu-emul.o
27+kvm-$(CONFIG_HW_PERF_EVENTS) += pmu-emul.o
arch/arm64/kvm/arch_timer.c+4−3
@@ -1129,9 +1129,10 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu) · 1128 unmodified lines
11291129 if (!irqchip_in_kernel(vcpu->kvm))
11301130 goto no_vgic;
11311131
1132− if (!vgic_initialized(vcpu->kvm))
1133− return -ENODEV;
1134−
1132+ /*
1133+ * At this stage, we have the guarantee that the vgic is both
1134+ * available and initialized.
1135+ */
11351136 if (!timer_irqs_are_valid(vcpu)) {
11361137 kvm_debug("incorrectly configured timer irqs\n");
11371138 return -EINVAL;
arch/arm64/kvm/arm.c+18−14
@@ -65,10 +65,6 @@ static bool vgic_present; · 64 unmodified lines
6565 static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled);
6666 DEFINE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
6767
68−extern u64 kvm_nvhe_sym(__cpu_logical_map)[NR_CPUS];
69−extern u32 kvm_nvhe_sym(kvm_host_psci_version);
70−extern struct psci_0_1_function_ids kvm_nvhe_sym(kvm_host_psci_0_1_function_ids);
71−
7268 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
7369 {
7470 return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE;
@@ -584,11 +580,9 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) · 509 unmodified lines
584580 * Map the VGIC hardware resources before running a vcpu the
585581 * first time on this VM.
586582 */
587− if (unlikely(!vgic_ready(kvm))) {
588− ret = kvm_vgic_map_resources(kvm);
589− if (ret)
590− return ret;
591− }
583+ ret = kvm_vgic_map_resources(kvm);
584+ if (ret)
585+ return ret;
592586 } else {
593587 /*
594588 * Tell the rest of the code that there are userspace irqchip
@@ -1574,12 +1568,12 @@ static struct notifier_block hyp_init_cpu_pm_nb = { · 979 unmodified lines
15741568 .notifier_call = hyp_init_cpu_pm_notifier,
15751569 };
15761570
1577−static void __init hyp_cpu_pm_init(void)
1571+static void hyp_cpu_pm_init(void)
15781572 {
15791573 if (!is_protected_kvm_enabled())
15801574 cpu_pm_register_notifier(&hyp_init_cpu_pm_nb);
15811575 }
1582−static void __init hyp_cpu_pm_exit(void)
1576+static void hyp_cpu_pm_exit(void)
15831577 {
15841578 if (!is_protected_kvm_enabled())
15851579 cpu_pm_unregister_notifier(&hyp_init_cpu_pm_nb);
@@ -1604,9 +1598,12 @@ static void init_cpu_logical_map(void) · 18 unmodified lines
16041598 * allow any other CPUs from the `possible` set to boot.
16051599 */
16061600 for_each_online_cpu(cpu)
1607− kvm_nvhe_sym(__cpu_logical_map)[cpu] = cpu_logical_map(cpu);
1601+ hyp_cpu_logical_map[cpu] = cpu_logical_map(cpu);
16081602 }
16091603
1604+#define init_psci_0_1_impl_state(config, what) \
1605+ config.psci_0_1_ ## what ## _implemented = psci_ops.what
1606+
16101607 static bool init_psci_relay(void)
16111608 {
16121609 /*
@@ -1618,8 +1615,15 @@ static bool init_psci_relay(void) · 5 unmodified lines
16181615 return false;
16191616 }
16201617
1621− kvm_nvhe_sym(kvm_host_psci_version) = psci_ops.get_version();
1622− kvm_nvhe_sym(kvm_host_psci_0_1_function_ids) = get_psci_0_1_function_ids();
1618+ kvm_host_psci_config.version = psci_ops.get_version();
1619+
1620+ if (kvm_host_psci_config.version == PSCI_VERSION(0, 1)) {
1621+ kvm_host_psci_config.function_ids_0_1 = get_psci_0_1_function_ids();
1622+ init_psci_0_1_impl_state(kvm_host_psci_config, cpu_suspend);
1623+ init_psci_0_1_impl_state(kvm_host_psci_config, cpu_on);
1624+ init_psci_0_1_impl_state(kvm_host_psci_config, cpu_off);
1625+ init_psci_0_1_impl_state(kvm_host_psci_config, migrate);
1626+ }
16231627 return true;
16241628 }
16251629
arch/arm64/kvm/hyp/include/hyp/adjust_pc.h+9−0
@@ -59,4 +59,13 @@ static inline void __adjust_pc(struct kvm_vcpu *vcpu) · 58 unmodified lines
5959 }
6060 }
6161
62+/*
63+ * Skip an instruction while host sysregs are live.
64+ * Assumes host is always 64-bit.
65+ */
66+static inline void kvm_skip_host_instr(void)
67+{
68+ write_sysreg_el2(read_sysreg_el2(SYS_ELR) + 4, SYS_ELR);
69+}
70+
6271 #endif
arch/arm64/kvm/hyp/nvhe/hyp-main.c+2−10
@@ -157,11 +157,6 @@ static void default_host_smc_handler(struct kvm_cpu_context *host_ctxt) · 156 unmodified lines
157157 __kvm_hyp_host_forward_smc(host_ctxt);
158158 }
159159
160−static void skip_host_instruction(void)
161−{
162− write_sysreg_el2(read_sysreg_el2(SYS_ELR) + 4, SYS_ELR);
163−}
164−
165160 static void handle_host_smc(struct kvm_cpu_context *host_ctxt)
166161 {
167162 bool handled;
@@ -170,11 +165,8 @@ static void handle_host_smc(struct kvm_cpu_context *host_ctxt) · 2 unmodified lines
170165 if (!handled)
171166 default_host_smc_handler(host_ctxt);
172167
173− /*
174− * Unlike HVC, the return address of an SMC is the instruction's PC.
175− * Move the return address past the instruction.
176− */
177− skip_host_instruction();
168+ /* SMC was trapped, move ELR past the current PC. */
169+ kvm_skip_host_instr();
178170 }
179171
180172 void handle_trap(struct kvm_cpu_context *host_ctxt)
arch/arm64/kvm/hyp/nvhe/hyp-smp.c+3−3
@@ -14,14 +14,14 @@ · 13 unmodified lines
1414 * Other CPUs should not be allowed to boot because their features were
1515 * not checked against the finalized system capabilities.
1616 */
17−u64 __ro_after_init __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
17+u64 __ro_after_init hyp_cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
1818
1919 u64 cpu_logical_map(unsigned int cpu)
2020 {
21− if (cpu >= ARRAY_SIZE(__cpu_logical_map))
21+ if (cpu >= ARRAY_SIZE(hyp_cpu_logical_map))
2222 hyp_panic();
2323
24− return __cpu_logical_map[cpu];
24+ return hyp_cpu_logical_map[cpu];
2525 }
2626
2727 unsigned long __hyp_per_cpu_offset(unsigned int cpu)
arch/arm64/kvm/hyp/nvhe/psci-relay.c+22−37
@@ -7,11 +7,8 @@ · 6 unmodified lines
77 #include <asm/kvm_asm.h>
88 #include <asm/kvm_hyp.h>
99 #include <asm/kvm_mmu.h>
10−#include <kvm/arm_hypercalls.h>
1110 #include <linux/arm-smccc.h>
1211 #include <linux/kvm_host.h>
13−#include <linux/psci.h>
14−#include <kvm/arm_psci.h>
1512 #include <uapi/linux/psci.h>
1613
1714 #include <nvhe/trap_handler.h>
@@ -22,9 +19,8 @@ void kvm_hyp_cpu_resume(unsigned long r0); · 4 unmodified lines
2219 void __noreturn __host_enter(struct kvm_cpu_context *host_ctxt);
2320
2421 /* Config options set by the host. */
25−__ro_after_init u32 kvm_host_psci_version;
26−__ro_after_init struct psci_0_1_function_ids kvm_host_psci_0_1_function_ids;
27−__ro_after_init s64 hyp_physvirt_offset;
22+struct kvm_host_psci_config __ro_after_init kvm_host_psci_config;
23+s64 __ro_after_init hyp_physvirt_offset;
2824
2925 #define __hyp_pa(x) ((phys_addr_t)((x)) + hyp_physvirt_offset)
3026
@@ -47,19 +43,16 @@ struct psci_boot_args { · 16 unmodified lines
4743 static DEFINE_PER_CPU(struct psci_boot_args, cpu_on_args) = PSCI_BOOT_ARGS_INIT;
4844 static DEFINE_PER_CPU(struct psci_boot_args, suspend_args) = PSCI_BOOT_ARGS_INIT;
4945
50−static u64 get_psci_func_id(struct kvm_cpu_context *host_ctxt)
51−{
52− DECLARE_REG(u64, func_id, host_ctxt, 0);
53−
54− return func_id;
55−}
46+#define is_psci_0_1(what, func_id) \
47+ (kvm_host_psci_config.psci_0_1_ ## what ## _implemented && \
48+ (func_id) == kvm_host_psci_config.function_ids_0_1.what)
5649
5750 static bool is_psci_0_1_call(u64 func_id)
5851 {
59− return (func_id == kvm_host_psci_0_1_function_ids.cpu_suspend) ||
60− (func_id == kvm_host_psci_0_1_function_ids.cpu_on) ||
61− (func_id == kvm_host_psci_0_1_function_ids.cpu_off) ||
62− (func_id == kvm_host_psci_0_1_function_ids.migrate);
52+ return (is_psci_0_1(cpu_suspend, func_id) ||
53+ is_psci_0_1(cpu_on, func_id) ||
54+ is_psci_0_1(cpu_off, func_id) ||
55+ is_psci_0_1(migrate, func_id));
6356 }
6457
6558 static bool is_psci_0_2_call(u64 func_id)
@@ -69,16 +62,6 @@ static bool is_psci_0_2_call(u64 func_id) · 3 unmodified lines
6962 (PSCI_0_2_FN64(0) <= func_id && func_id <= PSCI_0_2_FN64(31));
7063 }
7164
72−static bool is_psci_call(u64 func_id)
73−{
74− switch (kvm_host_psci_version) {
75− case PSCI_VERSION(0, 1):
76− return is_psci_0_1_call(func_id);
77− default:
78− return is_psci_0_2_call(func_id);
79− }
80−}
81−
8265 static unsigned long psci_call(unsigned long fn, unsigned long arg0,
8366 unsigned long arg1, unsigned long arg2)
8467 {
@@ -248,15 +231,14 @@ asmlinkage void __noreturn kvm_host_psci_cpu_entry(bool is_cpu_on) · 163 unmodified lines
248231
249232 static unsigned long psci_0_1_handler(u64 func_id, struct kvm_cpu_context *host_ctxt)
250233 {
251− if ((func_id == kvm_host_psci_0_1_function_ids.cpu_off) ||
252− (func_id == kvm_host_psci_0_1_function_ids.migrate))
234+ if (is_psci_0_1(cpu_off, func_id) || is_psci_0_1(migrate, func_id))
253235 return psci_forward(host_ctxt);
254− else if (func_id == kvm_host_psci_0_1_function_ids.cpu_on)
236+ if (is_psci_0_1(cpu_on, func_id))
255237 return psci_cpu_on(func_id, host_ctxt);
256− else if (func_id == kvm_host_psci_0_1_function_ids.cpu_suspend)
238+ if (is_psci_0_1(cpu_suspend, func_id))
257239 return psci_cpu_suspend(func_id, host_ctxt);
258− else
259− return PSCI_RET_NOT_SUPPORTED;
240+
241+ return PSCI_RET_NOT_SUPPORTED;
260242 }
261243
262244 static unsigned long psci_0_2_handler(u64 func_id, struct kvm_cpu_context *host_ctxt)
@@ -298,20 +280,23 @@ static unsigned long psci_1_0_handler(u64 func_id, struct kvm_cpu_context *host_ · 35 unmodified lines
298280
299281 bool kvm_host_psci_handler(struct kvm_cpu_context *host_ctxt)
300282 {
301− u64 func_id = get_psci_func_id(host_ctxt);
283+ DECLARE_REG(u64, func_id, host_ctxt, 0);
302284 unsigned long ret;
303285
304− if (!is_psci_call(func_id))
305− return false;
306−
307− switch (kvm_host_psci_version) {
286+ switch (kvm_host_psci_config.version) {
308287 case PSCI_VERSION(0, 1):
288+ if (!is_psci_0_1_call(func_id))
289+ return false;
309290 ret = psci_0_1_handler(func_id, host_ctxt);
310291 break;
311292 case PSCI_VERSION(0, 2):
293+ if (!is_psci_0_2_call(func_id))
294+ return false;
312295 ret = psci_0_2_handler(func_id, host_ctxt);
313296 break;
314297 default:
298+ if (!is_psci_0_2_call(func_id))
299+ return false;
315300 ret = psci_1_0_handler(func_id, host_ctxt);
316301 break;
317302 }
arch/arm64/kvm/pmu-emul.c+0−2
@@ -850,8 +850,6 @@ int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) · 849 unmodified lines
850850 return -EINVAL;
851851 }
852852
853− kvm_pmu_vcpu_reset(vcpu);
854−
855853 return 0;
856854 }
857855
arch/arm64/kvm/sys_regs.c+5−1
@@ -594,6 +594,10 @@ static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) · 593 unmodified lines
594594 {
595595 u64 pmcr, val;
596596
597+ /* No PMU available, PMCR_EL0 may UNDEF... */
598+ if (!kvm_arm_support_pmu_v3())
599+ return;
600+
597601 pmcr = read_sysreg(pmcr_el0);
598602 /*
599603 * Writable bits of PMCR_EL0 (ARMV8_PMU_PMCR_MASK) are reset to UNKNOWN
@@ -919,7 +923,7 @@ static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 319 unmodified lines
919923
920924 #define reg_to_encoding(x) \
921925 sys_reg((u32)(x)->Op0, (u32)(x)->Op1, \
922− (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2);
926+ (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2)
923927
924928 /* Silly macro to expand the DBG{BCR,BVR,WVR,WCR}n_EL1 registers in one go */
925929 #define DBG_BCR_BVR_WCR_WVR_EL1(n) \
arch/arm64/kvm/va_layout.c+3−4
@@ -34,17 +34,16 @@ static u64 __early_kern_hyp_va(u64 addr) · 33 unmodified lines
3434 }
3535
3636 /*
37− * Store a hyp VA <-> PA offset into a hyp-owned variable.
37+ * Store a hyp VA <-> PA offset into a EL2-owned variable.
3838 */
3939 static void init_hyp_physvirt_offset(void)
4040 {
41− extern s64 kvm_nvhe_sym(hyp_physvirt_offset);
4241 u64 kern_va, hyp_va;
4342
4443 /* Compute the offset from the hyp VA and PA of a random symbol. */
45− kern_va = (u64)kvm_ksym_ref(__hyp_text_start);
44+ kern_va = (u64)lm_alias(__hyp_text_start);
4645 hyp_va = __early_kern_hyp_va(kern_va);
47− CHOOSE_NVHE_SYM(hyp_physvirt_offset) = (s64)__pa(kern_va) - (s64)hyp_va;
46+ hyp_physvirt_offset = (s64)__pa(kern_va) - (s64)hyp_va;
4847 }
4948
5049 /*
arch/arm64/kvm/vgic/vgic-init.c+10−1
@@ -419,7 +419,8 @@ int vgic_lazy_init(struct kvm *kvm) · 418 unmodified lines
419419 * Map the MMIO regions depending on the VGIC model exposed to the guest
420420 * called on the first VCPU run.
421421 * Also map the virtual CPU interface into the VM.
422− * v2/v3 derivatives call vgic_init if not already done.
422+ * v2 calls vgic_init() if not already done.
423+ * v3 and derivatives return an error if the VGIC is not initialized.
423424 * vgic_ready() returns true if this function has succeeded.
424425 * @kvm: kvm struct pointer
425426 */
@@ -428,7 +429,13 @@ int kvm_vgic_map_resources(struct kvm *kvm) · 2 unmodified lines
428429 struct vgic_dist *dist = &kvm->arch.vgic;
429430 int ret = 0;
430431
432+ if (likely(vgic_ready(kvm)))
433+ return 0;
434+
431435 mutex_lock(&kvm->lock);
436+ if (vgic_ready(kvm))
437+ goto out;
438+
432439 if (!irqchip_in_kernel(kvm))
433440 goto out;
434441
@@ -439,6 +446,8 @@ int kvm_vgic_map_resources(struct kvm *kvm) · 4 unmodified lines
439446
440447 if (ret)
441448 __kvm_vgic_destroy(kvm);
449+ else
450+ dist->ready = true;
442451
443452 out:
444453 mutex_unlock(&kvm->lock);
arch/arm64/kvm/vgic/vgic-v2.c+6−14
@@ -306,20 +306,15 @@ int vgic_v2_map_resources(struct kvm *kvm) · 305 unmodified lines
306306 struct vgic_dist *dist = &kvm->arch.vgic;
307307 int ret = 0;
308308
309− if (vgic_ready(kvm))
310− goto out;
311−
312309 if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) ||
313310 IS_VGIC_ADDR_UNDEF(dist->vgic_cpu_base)) {
314311 kvm_err("Need to set vgic cpu and dist addresses first\n");
315− ret = -ENXIO;
316− goto out;
312+ return -ENXIO;
317313 }
318314
319315 if (!vgic_v2_check_base(dist->vgic_dist_base, dist->vgic_cpu_base)) {
320316 kvm_err("VGIC CPU and dist frames overlap\n");
321− ret = -EINVAL;
322− goto out;
317+ return -EINVAL;
323318 }
324319
325320 /*
@@ -329,13 +324,13 @@ int vgic_v2_map_resources(struct kvm *kvm) · 3 unmodified lines
329324 ret = vgic_init(kvm);
330325 if (ret) {
331326 kvm_err("Unable to initialize VGIC dynamic data structures\n");
332− goto out;
327+ return ret;
333328 }
334329
335330 ret = vgic_register_dist_iodev(kvm, dist->vgic_dist_base, VGIC_V2);
336331 if (ret) {
337332 kvm_err("Unable to register VGIC MMIO regions\n");
338− goto out;
333+ return ret;
339334 }
340335
341336 if (!static_branch_unlikely(&vgic_v2_cpuif_trap)) {
@@ -344,14 +339,11 @@ int vgic_v2_map_resources(struct kvm *kvm) · 2 unmodified lines
344339 KVM_VGIC_V2_CPU_SIZE, true);
345340 if (ret) {
346341 kvm_err("Unable to remap VGIC CPU to VCPU\n");
347− goto out;
342+ return ret;
348343 }
349344 }
350345
351− dist->ready = true;
352−
353−out:
354− return ret;
346+ return 0;
355347 }
356348
357349 DEFINE_STATIC_KEY_FALSE(vgic_v2_cpuif_trap);
arch/arm64/kvm/vgic/vgic-v3.c+6−15
@@ -500,29 +500,23 @@ int vgic_v3_map_resources(struct kvm *kvm) · 499 unmodified lines
500500 int ret = 0;
501501 int c;
502502
503− if (vgic_ready(kvm))
504− goto out;
505−
506503 kvm_for_each_vcpu(c, vcpu, kvm) {
507504 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
508505
509506 if (IS_VGIC_ADDR_UNDEF(vgic_cpu->rd_iodev.base_addr)) {
510507 kvm_debug("vcpu %d redistributor base not set\n", c);
511− ret = -ENXIO;
512− goto out;
508+ return -ENXIO;
513509 }
514510 }
515511
516512 if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base)) {
517513 kvm_err("Need to set vgic distributor addresses first\n");
518− ret = -ENXIO;
519− goto out;
514+ return -ENXIO;
520515 }
521516
522517 if (!vgic_v3_check_base(kvm)) {
523518 kvm_err("VGIC redist and dist frames overlap\n");
524− ret = -EINVAL;
525− goto out;
519+ return -EINVAL;
526520 }
527521
528522 /*
@@ -530,22 +524,19 @@ int vgic_v3_map_resources(struct kvm *kvm) · 1 unmodified line
530524 * the VGIC before we need to use it.
531525 */
532526 if (!vgic_initialized(kvm)) {
533− ret = -EBUSY;
534− goto out;
527+ return -EBUSY;
535528 }
536529
537530 ret = vgic_register_dist_iodev(kvm, dist->vgic_dist_base, VGIC_V3);
538531 if (ret) {
539532 kvm_err("Unable to register VGICv3 dist MMIO regions\n");
540− goto out;
533+ return ret;
541534 }
542535
543536 if (kvm_vgic_global_state.has_gicv4_1)
544537 vgic_v4_configure_vsgis(kvm);
545− dist->ready = true;
546538
547−out:
548− return ret;
539+ return 0;
549540 }
550541
551542 DEFINE_STATIC_KEY_FALSE(vgic_v3_cpuif_trap);
arch/arm64/mm/init.c+18−15
@@ -53,13 +53,13 @@ s64 memstart_addr __ro_after_init = -1; · 52 unmodified lines
5353 EXPORT_SYMBOL(memstart_addr);
5454
5555 /*
56− * We create both ZONE_DMA and ZONE_DMA32. ZONE_DMA covers the first 1G of
57− * memory as some devices, namely the Raspberry Pi 4, have peripherals with
58− * this limited view of the memory. ZONE_DMA32 will cover the rest of the 32
59− * bit addressable memory area.
56+ * If the corresponding config options are enabled, we create both ZONE_DMA
57+ * and ZONE_DMA32. By default ZONE_DMA covers the 32-bit addressable memory
58+ * unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4).
59+ * In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory,
60+ * otherwise it is empty.
6061 */
6162 phys_addr_t arm64_dma_phys_limit __ro_after_init;
62−static phys_addr_t arm64_dma32_phys_limit __ro_after_init;
6363
6464 #ifdef CONFIG_KEXEC_CORE
6565 /*
@@ -84,7 +84,7 @@ static void __init reserve_crashkernel(void) · 18 unmodified lines
8484
8585 if (crash_base == 0) {
8686 /* Current arm64 boot protocol requires 2MB alignment */
87− crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit,
87+ crash_base = memblock_find_in_range(0, arm64_dma_phys_limit,
8888 crash_size, SZ_2M);
8989 if (crash_base == 0) {
9090 pr_warn("cannot allocate crashkernel (size:0x%llx)\n",
@@ -196,6 +196,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) · 105 unmodified lines
196196 unsigned long max_zone_pfns[MAX_NR_ZONES] = {0};
197197 unsigned int __maybe_unused acpi_zone_dma_bits;
198198 unsigned int __maybe_unused dt_zone_dma_bits;
199+ phys_addr_t __maybe_unused dma32_phys_limit = max_zone_phys(32);
199200
200201 #ifdef CONFIG_ZONE_DMA
201202 acpi_zone_dma_bits = fls64(acpi_iort_dma_get_max_cpu_address());
@@ -205,8 +206,12 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) · 3 unmodified lines
205206 max_zone_pfns[ZONE_DMA] = PFN_DOWN(arm64_dma_phys_limit);
206207 #endif
207208 #ifdef CONFIG_ZONE_DMA32
208− max_zone_pfns[ZONE_DMA32] = PFN_DOWN(arm64_dma32_phys_limit);
209+ max_zone_pfns[ZONE_DMA32] = PFN_DOWN(dma32_phys_limit);
210+ if (!arm64_dma_phys_limit)
211+ arm64_dma_phys_limit = dma32_phys_limit;
209212 #endif
213+ if (!arm64_dma_phys_limit)
214+ arm64_dma_phys_limit = PHYS_MASK + 1;
210215 max_zone_pfns[ZONE_NORMAL] = max;
211216
212217 free_area_init(max_zone_pfns);
@@ -394,16 +399,9 @@ void __init arm64_memblock_init(void) · 181 unmodified lines
394399
395400 early_init_fdt_scan_reserved_mem();
396401
397− if (IS_ENABLED(CONFIG_ZONE_DMA32))
398− arm64_dma32_phys_limit = max_zone_phys(32);
399− else
400− arm64_dma32_phys_limit = PHYS_MASK + 1;
401−
402402 reserve_elfcorehdr();
403403
404404 high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
405−
406− dma_contiguous_reserve(arm64_dma32_phys_limit);
407405 }
408406
409407 void __init bootmem_init(void)
@@ -438,6 +436,11 @@ void __init bootmem_init(void) · 28 unmodified lines
438436 sparse_init();
439437 zone_sizes_init(min, max);
440438
439+ /*
440+ * Reserve the CMA area after arm64_dma_phys_limit was initialised.
441+ */
442+ dma_contiguous_reserve(arm64_dma_phys_limit);
443+
441444 /*
442445 * request_standard_resources() depends on crashkernel's memory being
443446 * reserved, so do it here.
@@ -455,7 +458,7 @@ void __init bootmem_init(void) · 11 unmodified lines
455458 void __init mem_init(void)
456459 {
457460 if (swiotlb_force == SWIOTLB_FORCE ||
458− max_pfn > PFN_DOWN(arm64_dma_phys_limit ? : arm64_dma32_phys_limit))
461+ max_pfn > PFN_DOWN(arm64_dma_phys_limit))
459462 swiotlb_init(1);
460463 else
461464 swiotlb_force = SWIOTLB_NO_FORCE;
arch/arm64/mm/proc.S+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 #endif
4747
4848 #ifdef CONFIG_KASAN_HW_TAGS
49−#define TCR_KASAN_HW_FLAGS SYS_TCR_EL1_TCMA1 | TCR_TBI1
49+#define TCR_KASAN_HW_FLAGS SYS_TCR_EL1_TCMA1 | TCR_TBI1 | TCR_TBID1
5050 #else
5151 #define TCR_KASAN_HW_FLAGS 0
5252 #endif
arch/csky/include/asm/Kbuild+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 generic-y += asm-offsets.h
33 generic-y += gpio.h
44 generic-y += kvm_para.h
5−generic-y += local64.h
65 generic-y += qrwlock.h
76 generic-y += user.h
87 generic-y += vmlinux.lds.h
arch/h8300/include/asm/Kbuild+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 generic-y += asm-offsets.h
33 generic-y += extable.h
44 generic-y += kvm_para.h
5−generic-y += local64.h
65 generic-y += mcs_spinlock.h
76 generic-y += parport.h
87 generic-y += spinlock.h
arch/hexagon/include/asm/Kbuild+0−1
@@ -2,5 +2,4 @@ · 1 unmodified line
22 generic-y += extable.h
33 generic-y += iomap.h
44 generic-y += kvm_para.h
5−generic-y += local64.h
65 generic-y += mcs_spinlock.h
arch/ia64/include/asm/local64.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/local64.h>
arch/ia64/include/asm/sparsemem.h+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #define _ASM_IA64_SPARSEMEM_H
44
55 #ifdef CONFIG_SPARSEMEM
6+#include <asm/page.h>
67 /*
78 * SECTION_SIZE_BITS 2^N: how big each section will be
89 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
arch/ia64/mm/init.c+2−2
@@ -536,7 +536,7 @@ virtual_memmap_init(u64 start, u64 end, void *arg) · 535 unmodified lines
536536
537537 if (map_start < map_end)
538538 memmap_init_zone((unsigned long)(map_end - map_start),
539− args->nid, args->zone, page_to_pfn(map_start),
539+ args->nid, args->zone, page_to_pfn(map_start), page_to_pfn(map_end),
540540 MEMINIT_EARLY, NULL, MIGRATE_MOVABLE);
541541 return 0;
542542 }
@@ -546,7 +546,7 @@ memmap_init (unsigned long size, int nid, unsigned long zone, · 3 unmodified lines
546546 unsigned long start_pfn)
547547 {
548548 if (!vmem_map) {
549− memmap_init_zone(size, nid, zone, start_pfn,
549+ memmap_init_zone(size, nid, zone, start_pfn, start_pfn + size,
550550 MEMINIT_EARLY, NULL, MIGRATE_MOVABLE);
551551 } else {
552552 struct page *start;
arch/m68k/include/asm/Kbuild+0−1
@@ -2,6 +2,5 @@ · 1 unmodified line
22 generated-y += syscall_table.h
33 generic-y += extable.h
44 generic-y += kvm_para.h
5−generic-y += local64.h
65 generic-y += mcs_spinlock.h
76 generic-y += spinlock.h
arch/microblaze/include/asm/Kbuild+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 generated-y += syscall_table.h
33 generic-y += extable.h
44 generic-y += kvm_para.h
5−generic-y += local64.h
65 generic-y += mcs_spinlock.h
76 generic-y += parport.h
87 generic-y += syscalls.h
arch/mips/boot/compressed/decompress.c+2−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/libfdt.h>
1414
1515 #include <asm/addrspace.h>
16+#include <asm/unaligned.h>
1617
1718 /*
1819 * These two variables specify the free mem region
@@ -117,7 +118,7 @@ void decompress_kernel(unsigned long boot_heap_start) · 98 unmodified lines
117118 dtb_size = fdt_totalsize((void *)&__appended_dtb);
118119
119120 /* last four bytes is always image size in little endian */
120− image_size = le32_to_cpup((void *)&__image_end - 4);
121+ image_size = get_unaligned_le32((void *)&__image_end - 4);
121122
122123 /* copy dtb to where the booted kernel will expect it */
123124 memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size,
arch/mips/cavium-octeon/octeon-irq.c+1−1
@@ -1444,7 +1444,7 @@ static void octeon_irq_setup_secondary_ciu2(void) · 1443 unmodified lines
14441444 static int __init octeon_irq_init_ciu(
14451445 struct device_node *ciu_node, struct device_node *parent)
14461446 {
1447− unsigned int i, r;
1447+ int i, r;
14481448 struct irq_chip *chip;
14491449 struct irq_chip *chip_edge;
14501450 struct irq_chip *chip_mbox;
arch/mips/include/asm/Kbuild+0−1
@@ -6,7 +6,6 @@ generated-y += syscall_table_64_n64.h · 5 unmodified lines
66 generated-y += syscall_table_64_o32.h
77 generic-y += export.h
88 generic-y += kvm_para.h
9−generic-y += local64.h
109 generic-y += mcs_spinlock.h
1110 generic-y += parport.h
1211 generic-y += qrwlock.h
arch/mips/kernel/binfmt_elfn32.c+7−0
@@ -103,4 +103,11 @@ jiffies_to_old_timeval32(unsigned long jiffies, struct old_timeval32 *value) · 102 unmodified lines
103103 #undef ns_to_kernel_old_timeval
104104 #define ns_to_kernel_old_timeval ns_to_old_timeval32
105105
106+/*
107+ * Some data types as stored in coredump.
108+ */
109+#define user_long_t compat_long_t
110+#define user_siginfo_t compat_siginfo_t
111+#define copy_siginfo_to_external copy_siginfo_to_external32
112+
106113 #include "../../../fs/binfmt_elf.c"
arch/mips/kernel/binfmt_elfo32.c+7−0
@@ -106,4 +106,11 @@ jiffies_to_old_timeval32(unsigned long jiffies, struct old_timeval32 *value) · 105 unmodified lines
106106 #undef ns_to_kernel_old_timeval
107107 #define ns_to_kernel_old_timeval ns_to_old_timeval32
108108
109+/*
110+ * Some data types as stored in coredump.
111+ */
112+#define user_long_t compat_long_t
113+#define user_siginfo_t compat_siginfo_t
114+#define copy_siginfo_to_external copy_siginfo_to_external32
115+
109116 #include "../../../fs/binfmt_elf.c"
arch/mips/kernel/relocate.c+8−2
@@ -187,8 +187,14 @@ static int __init relocate_exception_table(long offset) · 186 unmodified lines
187187 static inline __init unsigned long rotate_xor(unsigned long hash,
188188 const void *area, size_t size)
189189 {
190− size_t i;
191− unsigned long *ptr = (unsigned long *)area;
190+ const typeof(hash) *ptr = PTR_ALIGN(area, sizeof(hash));
191+ size_t diff, i;
192+
193+ diff = (void *)ptr - area;
194+ if (unlikely(size < diff + sizeof(hash)))
195+ return hash;
196+
197+ size = ALIGN_DOWN(size - diff, sizeof(hash));
192198
193199 for (i = 0; i < size / sizeof(hash); i++) {
194200 /* Rotate by odd number of bits and XOR. */
arch/nds32/include/asm/Kbuild+0−1
@@ -4,6 +4,5 @@ generic-y += cmpxchg.h · 3 unmodified lines
44 generic-y += export.h
55 generic-y += gpio.h
66 generic-y += kvm_para.h
7−generic-y += local64.h
87 generic-y += parport.h
98 generic-y += user.h
arch/openrisc/include/asm/Kbuild+0−1
@@ -1,7 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0
22 generic-y += extable.h
33 generic-y += kvm_para.h
4−generic-y += local64.h
54 generic-y += mcs_spinlock.h
65 generic-y += qspinlock_types.h
76 generic-y += qspinlock.h
arch/parisc/include/asm/Kbuild+0−1
@@ -3,6 +3,5 @@ generated-y += syscall_table_32.h · 2 unmodified lines
33 generated-y += syscall_table_64.h
44 generated-y += syscall_table_c32.h
55 generic-y += kvm_para.h
6−generic-y += local64.h
76 generic-y += mcs_spinlock.h
87 generic-y += user.h
arch/powerpc/include/asm/Kbuild+0−1
@@ -5,7 +5,6 @@ generated-y += syscall_table_c32.h · 4 unmodified lines
55 generated-y += syscall_table_spu.h
66 generic-y += export.h
77 generic-y += kvm_types.h
8−generic-y += local64.h
98 generic-y += mcs_spinlock.h
109 generic-y += qrwlock.h
1110 generic-y += vtime.h
arch/powerpc/include/asm/vdso/gettimeofday.h+15−1
@@ -103,6 +103,8 @@ int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone *_tz · 102 unmodified lines
103103 return do_syscall_2(__NR_gettimeofday, (unsigned long)_tv, (unsigned long)_tz);
104104 }
105105
106+#ifdef __powerpc64__
107+
106108 static __always_inline
107109 int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
108110 {
@@ -115,10 +117,22 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 6 unmodified lines
115117 return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);
116118 }
117119
118−#ifdef CONFIG_VDSO32
120+#else
119121
120122 #define BUILD_VDSO32 1
121123
124+static __always_inline
125+int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
126+{
127+ return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts);
128+}
129+
130+static __always_inline
131+int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
132+{
133+ return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned long)_ts);
134+}
135+
122136 static __always_inline
123137 int clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
124138 {
arch/powerpc/kernel/head_book3s_32.S+9−0
@@ -260,10 +260,19 @@ __secondary_hold_acknowledge: · 259 unmodified lines
260260 MachineCheck:
261261 EXCEPTION_PROLOG_0
262262 #ifdef CONFIG_PPC_CHRP
263+#ifdef CONFIG_VMAP_STACK
264+ mtspr SPRN_SPRG_SCRATCH2,r1
265+ mfspr r1, SPRN_SPRG_THREAD
266+ lwz r1, RTAS_SP(r1)
267+ cmpwi cr1, r1, 0
268+ bne cr1, 7f
269+ mfspr r1, SPRN_SPRG_SCRATCH2
270+#else
263271 mfspr r11, SPRN_SPRG_THREAD
264272 lwz r11, RTAS_SP(r11)
265273 cmpwi cr1, r11, 0
266274 bne cr1, 7f
275+#endif
267276 #endif /* CONFIG_PPC_CHRP */
268277 EXCEPTION_PROLOG_1 for_rtas=1
269278 7: EXCEPTION_PROLOG_2
arch/powerpc/kernel/vmlinux.lds.S+9−1
@@ -85,7 +85,7 @@ SECTIONS · 84 unmodified lines
8585 ALIGN_FUNCTION();
8686 #endif
8787 /* careful! __ftr_alt_* sections need to be close to .text */
88− *(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
88+ *(.text.hot .text.hot.* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text);
8989 #ifdef CONFIG_PPC64
9090 *(.tramp.ftrace.text);
9191 #endif
@@ -187,6 +187,12 @@ SECTIONS · 95 unmodified lines
187187 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
188188 _sinittext = .;
189189 INIT_TEXT
190+
191+ /*
192+ *.init.text might be RO so we must ensure this section ends on
193+ * a page boundary.
194+ */
195+ . = ALIGN(PAGE_SIZE);
190196 _einittext = .;
191197 #ifdef CONFIG_PPC64
192198 *(.tramp.ftrace.init);
@@ -200,6 +206,8 @@ SECTIONS · 7 unmodified lines
200206 EXIT_TEXT
201207 }
202208
209+ . = ALIGN(PAGE_SIZE);
210+
203211 INIT_DATA_SECTION(16)
204212
205213 . = ALIGN(8);
arch/riscv/Kconfig+4−2
@@ -137,7 +137,7 @@ config PA_BITS · 136 unmodified lines
137137
138138 config PAGE_OFFSET
139139 hex
140− default 0xC0000000 if 32BIT && MAXPHYSMEM_2GB
140+ default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
141141 default 0x80000000 if 64BIT && !MMU
142142 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
143143 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
@@ -247,10 +247,12 @@ config MODULE_SECTIONS · 103 unmodified lines
247247
248248 choice
249249 prompt "Maximum Physical Memory"
250− default MAXPHYSMEM_2GB if 32BIT
250+ default MAXPHYSMEM_1GB if 32BIT
251251 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
252252 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
253253
254+ config MAXPHYSMEM_1GB
255+ bool "1GiB"
254256 config MAXPHYSMEM_2GB
255257 bool "2GiB"
256258 config MAXPHYSMEM_128GB
arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts+2−0
@@ -88,7 +88,9 @@ · 87 unmodified lines
8888 phy-mode = "gmii";
8989 phy-handle = <&phy0>;
9090 phy0: ethernet-phy@0 {
91+ compatible = "ethernet-phy-id0007.0771";
9192 reg = <0>;
93+ reset-gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
9294 };
9395 };
9496
arch/riscv/configs/defconfig+2−0
@@ -64,6 +64,8 @@ CONFIG_HW_RANDOM=y · 63 unmodified lines
6464 CONFIG_HW_RANDOM_VIRTIO=y
6565 CONFIG_SPI=y
6666 CONFIG_SPI_SIFIVE=y
67+CONFIG_GPIOLIB=y
68+CONFIG_GPIO_SIFIVE=y
6769 # CONFIG_PTP_1588_CLOCK is not set
6870 CONFIG_POWER_RESET=y
6971 CONFIG_DRM=y
arch/riscv/include/asm/Kbuild+0−1
@@ -3,6 +3,5 @@ generic-y += early_ioremap.h · 2 unmodified lines
33 generic-y += extable.h
44 generic-y += flat.h
55 generic-y += kvm_para.h
6−generic-y += local64.h
76 generic-y += user.h
87 generic-y += vmlinux.lds.h
arch/riscv/include/asm/pgtable.h+0−1
@@ -99,7 +99,6 @@ · 98 unmodified lines
9999 | _PAGE_DIRTY)
100100
101101 #define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
102−#define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL | _PAGE_EXEC)
103102 #define PAGE_KERNEL_READ __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE)
104103 #define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL | _PAGE_EXEC)
105104 #define PAGE_KERNEL_READ_EXEC __pgprot((_PAGE_KERNEL & ~_PAGE_WRITE) \
arch/riscv/include/asm/vdso.h+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010
1111 #include <linux/types.h>
1212
13−#ifndef GENERIC_TIME_VSYSCALL
13+#ifndef CONFIG_GENERIC_TIME_VSYSCALL
1414 struct vdso_data {
1515 };
1616 #endif
arch/riscv/kernel/cacheinfo.c+10−1
@@ -26,7 +26,16 @@ cache_get_priv_group(struct cacheinfo *this_leaf) · 25 unmodified lines
2626
2727 static struct cacheinfo *get_cacheinfo(u32 level, enum cache_type type)
2828 {
29− struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(smp_processor_id());
29+ /*
30+ * Using raw_smp_processor_id() elides a preemptability check, but this
31+ * is really indicative of a larger problem: the cacheinfo UABI assumes
32+ * that cores have a homonogenous view of the cache hierarchy. That
33+ * happens to be the case for the current set of RISC-V systems, but
34+ * likely won't be true in general. Since there's no way to provide
35+ * correct information for these systems via the current UABI we're
36+ * just eliding the check for now.
37+ */
38+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(raw_smp_processor_id());
3039 struct cacheinfo *this_leaf;
3140 int index;
3241
arch/riscv/kernel/entry.S+13−11
@@ -124,15 +124,15 @@ skip_context_tracking: · 123 unmodified lines
124124 REG_L a1, (a1)
125125 jr a1
126126 1:
127−#ifdef CONFIG_TRACE_IRQFLAGS
128− call trace_hardirqs_on
129−#endif
130127 /*
131128 * Exceptions run with interrupts enabled or disabled depending on the
132129 * state of SR_PIE in m/sstatus.
133130 */
134131 andi t0, s1, SR_PIE
135132 beqz t0, 1f
133+#ifdef CONFIG_TRACE_IRQFLAGS
134+ call trace_hardirqs_on
135+#endif
136136 csrs CSR_STATUS, SR_IE
137137
138138 1:
@@ -155,6 +155,15 @@ skip_context_tracking: · 16 unmodified lines
155155 tail do_trap_unknown
156156
157157 handle_syscall:
158+#ifdef CONFIG_RISCV_M_MODE
159+ /*
160+ * When running is M-Mode (no MMU config), MPIE does not get set.
161+ * As a result, we need to force enable interrupts here because
162+ * handle_exception did not do set SR_IE as it always sees SR_PIE
163+ * being cleared.
164+ */
165+ csrs CSR_STATUS, SR_IE
166+#endif
158167 #if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING)
159168 /* Recover a0 - a7 for system calls */
160169 REG_L a0, PT_A0(sp)
@@ -186,14 +195,7 @@ check_syscall_nr: · 25 unmodified lines
186195 * Syscall number held in a7.
187196 * If syscall number is above allowed value, redirect to ni_syscall.
188197 */
189− bge a7, t0, 1f
190− /*
191− * Check if syscall is rejected by tracer, i.e., a7 == -1.
192− * If yes, we pretend it was executed.
193− */
194− li t1, -1
195− beq a7, t1, ret_from_syscall_rejected
196− blt a7, t1, 1f
198+ bgeu a7, t0, 1f
197199 /* Call syscall */
198200 la s0, sys_call_table
199201 slli t0, a7, RISCV_LGPTR
arch/riscv/kernel/setup.c+13−11
@@ -127,7 +127,9 @@ static void __init init_resources(void) · 126 unmodified lines
127127 {
128128 struct memblock_region *region = NULL;
129129 struct resource *res = NULL;
130− int ret = 0;
130+ struct resource *mem_res = NULL;
131+ size_t mem_res_sz = 0;
132+ int ret = 0, i = 0;
131133
132134 code_res.start = __pa_symbol(_text);
133135 code_res.end = __pa_symbol(_etext) - 1;
@@ -145,16 +147,17 @@ static void __init init_resources(void) · 11 unmodified lines
145147 bss_res.end = __pa_symbol(__bss_stop) - 1;
146148 bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
147149
150+ mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt) * sizeof(*mem_res);
151+ mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES);
152+ if (!mem_res)
153+ panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz);
148154 /*
149155 * Start by adding the reserved regions, if they overlap
150156 * with /memory regions, insert_resource later on will take
151157 * care of it.
152158 */
153159 for_each_reserved_mem_region(region) {
154− res = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
155− if (!res)
156− panic("%s: Failed to allocate %zu bytes\n", __func__,
157− sizeof(struct resource));
160+ res = &mem_res[i++];
158161
159162 res->name = "Reserved";
160163 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
@@ -171,8 +174,10 @@ static void __init init_resources(void) · 10 unmodified lines
171174 * Ignore any other reserved regions within
172175 * system memory.
173176 */
174− if (memblock_is_memory(res->start))
177+ if (memblock_is_memory(res->start)) {
178+ memblock_free((phys_addr_t) res, sizeof(struct resource));
175179 continue;
180+ }
176181
177182 ret = add_resource(&iomem_resource, res);
178183 if (ret < 0)
@@ -181,10 +186,7 @@ static void __init init_resources(void) · 2 unmodified lines
181186
182187 /* Add /memory regions to the resource tree */
183188 for_each_mem_region(region) {
184− res = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
185− if (!res)
186− panic("%s: Failed to allocate %zu bytes\n", __func__,
187− sizeof(struct resource));
189+ res = &mem_res[i++];
188190
189191 if (unlikely(memblock_is_nomap(region))) {
190192 res->name = "Reserved";
@@ -205,9 +207,9 @@ static void __init init_resources(void) · 14 unmodified lines
205207 return;
206208
207209 error:
208− memblock_free((phys_addr_t) res, sizeof(struct resource));
209210 /* Better an empty resource tree than an inconsistent one */
210211 release_child_resources(&iomem_resource);
212+ memblock_free((phys_addr_t) mem_res, mem_res_sz);
211213 }
212214
213215
arch/riscv/kernel/stacktrace.c+2−3
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414
1515 #include <asm/stacktrace.h>
1616
17−register unsigned long sp_in_global __asm__("sp");
17+register const unsigned long sp_in_global __asm__("sp");
1818
1919 #ifdef CONFIG_FRAME_POINTER
2020
@@ -28,9 +28,8 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, · 7 unmodified lines
2828 sp = user_stack_pointer(regs);
2929 pc = instruction_pointer(regs);
3030 } else if (task == NULL || task == current) {
31− const register unsigned long current_sp = sp_in_global;
3231 fp = (unsigned long)__builtin_frame_address(0);
33− sp = current_sp;
32+ sp = sp_in_global;
3433 pc = (unsigned long)walk_stackframe;
3534 } else {
3635 /* task blocked in __switch_to */
arch/riscv/kernel/time.c+3−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * Copyright (C) 2017 SiFive
55 */
66
7+#include <linux/of_clk.h>
78 #include <linux/clocksource.h>
89 #include <linux/delay.h>
910 #include <asm/sbi.h>
@@ -24,6 +25,8 @@ void __init time_init(void) · 14 unmodified lines
2425 riscv_timebase = prop;
2526
2627 lpj_fine = riscv_timebase / HZ;
28+
29+ of_clk_init(NULL);
2730 timer_probe();
2831 }
2932
arch/riscv/kernel/vdso.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/binfmts.h>
1313 #include <linux/err.h>
1414 #include <asm/page.h>
15−#ifdef GENERIC_TIME_VSYSCALL
15+#ifdef CONFIG_GENERIC_TIME_VSYSCALL
1616 #include <vdso/datapage.h>
1717 #else
1818 #include <asm/vdso.h>
arch/riscv/mm/init.c+14−2
@@ -157,9 +157,10 @@ disable: · 156 unmodified lines
157157 void __init setup_bootmem(void)
158158 {
159159 phys_addr_t mem_start = 0;
160− phys_addr_t start, end = 0;
160+ phys_addr_t start, dram_end, end = 0;
161161 phys_addr_t vmlinux_end = __pa_symbol(&_end);
162162 phys_addr_t vmlinux_start = __pa_symbol(&_start);
163+ phys_addr_t max_mapped_addr = __pa(~(ulong)0);
163164 u64 i;
164165
165166 /* Find the memory region containing the kernel */
@@ -181,7 +182,18 @@ void __init setup_bootmem(void) · 15 unmodified lines
181182 /* Reserve from the start of the kernel to the end of the kernel */
182183 memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
183184
184− max_pfn = PFN_DOWN(memblock_end_of_DRAM());
185+ dram_end = memblock_end_of_DRAM();
186+
187+ /*
188+ * memblock allocator is not aware of the fact that last 4K bytes of
189+ * the addressable memory can not be mapped because of IS_ERR_VALUE
190+ * macro. Make sure that last 4k bytes are not usable by memblock
191+ * if end of dram is equal to maximum addressable memory.
192+ */
193+ if (max_mapped_addr == (dram_end - 1))
194+ memblock_set_current_limit(max_mapped_addr - 4096);
195+
196+ max_pfn = PFN_DOWN(dram_end);
185197 max_low_pfn = max_pfn;
186198 dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn));
187199 set_max_mapnr(max_low_pfn);
arch/riscv/mm/kasan_init.c+2−2
@@ -93,8 +93,8 @@ void __init kasan_init(void) · 92 unmodified lines
9393 VMALLOC_END));
9494
9595 for_each_mem_range(i, &_start, &_end) {
96− void *start = (void *)_start;
97− void *end = (void *)_end;
96+ void *start = (void *)__va(_start);
97+ void *end = (void *)__va(_end);
9898
9999 if (start >= end)
100100 break;
arch/s390/Kconfig+17−14
@@ -54,17 +54,23 @@ config KASAN_SHADOW_OFFSET · 53 unmodified lines
5454
5555 config S390
5656 def_bool y
57+ #
58+ # Note: keep this list sorted alphabetically
59+ #
60+ imply IMA_SECURE_AND_OR_TRUSTED_BOOT
5761 select ARCH_BINFMT_ELF_STATE
5862 select ARCH_HAS_DEBUG_VM_PGTABLE
5963 select ARCH_HAS_DEBUG_WX
6064 select ARCH_HAS_DEVMEM_IS_ALLOWED
6165 select ARCH_HAS_ELF_RANDOMIZE
66+ select ARCH_HAS_FORCE_DMA_UNENCRYPTED
6267 select ARCH_HAS_FORTIFY_SOURCE
6368 select ARCH_HAS_GCOV_PROFILE_ALL
6469 select ARCH_HAS_GIGANTIC_PAGE
6570 select ARCH_HAS_KCOV
6671 select ARCH_HAS_MEM_ENCRYPT
6772 select ARCH_HAS_PTE_SPECIAL
73+ select ARCH_HAS_SCALED_CPUTIME
6874 select ARCH_HAS_SET_MEMORY
6975 select ARCH_HAS_STRICT_KERNEL_RWX
7076 select ARCH_HAS_STRICT_MODULE_RWX
@@ -111,8 +117,10 @@ config S390 · 40 unmodified lines
111117 select ARCH_WANT_IPC_PARSE_VERSION
112118 select BUILDTIME_TABLE_SORT
113119 select CLONE_BACKWARDS2
120+ select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
114121 select DMA_OPS if PCI
115122 select DYNAMIC_FTRACE if FUNCTION_TRACER
123+ select GENERIC_ALLOCATOR
116124 select GENERIC_CPU_AUTOPROBE
117125 select GENERIC_CPU_VULNERABILITIES
118126 select GENERIC_FIND_FIRST_BIT
@@ -126,22 +134,21 @@ config S390 · 7 unmodified lines
126134 select HAVE_ARCH_JUMP_LABEL_RELATIVE
127135 select HAVE_ARCH_KASAN
128136 select HAVE_ARCH_KASAN_VMALLOC
129− select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
130137 select HAVE_ARCH_SECCOMP_FILTER
131138 select HAVE_ARCH_SOFT_DIRTY
132139 select HAVE_ARCH_TRACEHOOK
133140 select HAVE_ARCH_TRANSPARENT_HUGEPAGE
134141 select HAVE_ARCH_VMAP_STACK
135142 select HAVE_ASM_MODVERSIONS
136− select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
137143 select HAVE_CMPXCHG_DOUBLE
138144 select HAVE_CMPXCHG_LOCAL
139145 select HAVE_DEBUG_KMEMLEAK
140146 select HAVE_DMA_CONTIGUOUS
141147 select HAVE_DYNAMIC_FTRACE
142148 select HAVE_DYNAMIC_FTRACE_WITH_REGS
143− select HAVE_FAST_GUP
149+ select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
144150 select HAVE_EFFICIENT_UNALIGNED_ACCESS
151+ select HAVE_FAST_GUP
145152 select HAVE_FENTRY
146153 select HAVE_FTRACE_MCOUNT_RECORD
147154 select HAVE_FUNCTION_ERROR_INJECTION
@@ -163,16 +170,15 @@ config S390 · 15 unmodified lines
163170 select HAVE_KRETPROBES
164171 select HAVE_KVM
165172 select HAVE_LIVEPATCH
166− select HAVE_PERF_REGS
167− select HAVE_PERF_USER_STACK_DUMP
168173 select HAVE_MEMBLOCK_PHYS_MAP
169− select MMU_GATHER_NO_GATHER
170174 select HAVE_MOD_ARCH_SPECIFIC
175+ select HAVE_NMI
171176 select HAVE_NOP_MCOUNT
172177 select HAVE_OPROFILE
173178 select HAVE_PCI
174179 select HAVE_PERF_EVENTS
175− select MMU_GATHER_RCU_TABLE_FREE
180+ select HAVE_PERF_REGS
181+ select HAVE_PERF_USER_STACK_DUMP
176182 select HAVE_REGS_AND_STACK_ACCESS_API
177183 select HAVE_RELIABLE_STACKTRACE
178184 select HAVE_RSEQ
@@ -181,6 +187,8 @@ config S390 · 2 unmodified lines
181187 select HAVE_VIRT_CPU_ACCOUNTING_IDLE
182188 select IOMMU_HELPER if PCI
183189 select IOMMU_SUPPORT if PCI
190+ select MMU_GATHER_NO_GATHER
191+ select MMU_GATHER_RCU_TABLE_FREE
184192 select MODULES_USE_ELF_RELA
185193 select NEED_DMA_MAP_STATE if PCI
186194 select NEED_SG_DMA_LENGTH if PCI
@@ -190,17 +198,12 @@ config S390 · 3 unmodified lines
190198 select PCI_MSI if PCI
191199 select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
192200 select SPARSE_IRQ
201+ select SWIOTLB
193202 select SYSCTL_EXCEPTION_TRACE
194203 select THREAD_INFO_IN_TASK
195204 select TTY
196205 select VIRT_CPU_ACCOUNTING
197− select ARCH_HAS_SCALED_CPUTIME
198− select HAVE_NMI
199− select ARCH_HAS_FORCE_DMA_UNENCRYPTED
200− select SWIOTLB
201− select GENERIC_ALLOCATOR
202− imply IMA_SECURE_AND_OR_TRUSTED_BOOT
203−
206+ # Note: keep the above list sorted alphabetically
204207
205208 config SCHED_OMIT_FRAME_POINTER
206209 def_bool y
arch/s390/configs/debug_defconfig+9−3
@@ -61,7 +61,9 @@ CONFIG_OPROFILE=m · 60 unmodified lines
6161 CONFIG_KPROBES=y
6262 CONFIG_JUMP_LABEL=y
6363 CONFIG_STATIC_KEYS_SELFTEST=y
64+CONFIG_SECCOMP_CACHE_DEBUG=y
6465 CONFIG_LOCK_EVENT_COUNTS=y
66+# CONFIG_GCC_PLUGINS is not set
6567 CONFIG_MODULES=y
6668 CONFIG_MODULE_FORCE_LOAD=y
6769 CONFIG_MODULE_UNLOAD=y
@@ -410,12 +412,12 @@ CONFIG_SCSI_ENCLOSURE=m · 342 unmodified lines
410412 CONFIG_SCSI_CONSTANTS=y
411413 CONFIG_SCSI_LOGGING=y
412414 CONFIG_SCSI_SPI_ATTRS=m
413−CONFIG_SCSI_FC_ATTRS=y
415+CONFIG_SCSI_FC_ATTRS=m
414416 CONFIG_SCSI_SAS_LIBSAS=m
415417 CONFIG_SCSI_SRP_ATTRS=m
416418 CONFIG_ISCSI_TCP=m
417419 CONFIG_SCSI_DEBUG=m
418−CONFIG_ZFCP=y
420+CONFIG_ZFCP=m
419421 CONFIG_SCSI_VIRTIO=m
420422 CONFIG_SCSI_DH=y
421423 CONFIG_SCSI_DH_RDAC=m
@@ -444,6 +446,7 @@ CONFIG_DM_MULTIPATH=m · 22 unmodified lines
444446 CONFIG_DM_MULTIPATH_QL=m
445447 CONFIG_DM_MULTIPATH_ST=m
446448 CONFIG_DM_MULTIPATH_HST=m
449+CONFIG_DM_MULTIPATH_IOA=m
447450 CONFIG_DM_DELAY=m
448451 CONFIG_DM_UEVENT=y
449452 CONFIG_DM_FLAKEY=m
@@ -542,7 +545,6 @@ CONFIG_INPUT_EVDEV=y · 92 unmodified lines
542545 # CONFIG_INPUT_MOUSE is not set
543546 # CONFIG_SERIO is not set
544547 CONFIG_LEGACY_PTY_COUNT=0
545−CONFIG_NULL_TTY=m
546548 CONFIG_VIRTIO_CONSOLE=y
547549 CONFIG_HW_RANDOM_VIRTIO=m
548550 CONFIG_RAW_DRIVER=m
@@ -574,6 +576,7 @@ CONFIG_VIRTIO_BALLOON=m · 25 unmodified lines
574576 CONFIG_VIRTIO_INPUT=y
575577 CONFIG_VHOST_NET=m
576578 CONFIG_VHOST_VSOCK=m
579+# CONFIG_SURFACE_PLATFORMS is not set
577580 CONFIG_S390_CCW_IOMMU=y
578581 CONFIG_S390_AP_IOMMU=y
579582 CONFIG_EXT4_FS=y
@@ -655,6 +658,7 @@ CONFIG_CIFS_XATTR=y · 75 unmodified lines
655658 CONFIG_CIFS_POSIX=y
656659 # CONFIG_CIFS_DEBUG is not set
657660 CONFIG_CIFS_DFS_UPCALL=y
661+CONFIG_CIFS_SWN_UPCALL=y
658662 CONFIG_NLS_DEFAULT="utf8"
659663 CONFIG_NLS_CODEPAGE_437=m
660664 CONFIG_NLS_CODEPAGE_850=m
@@ -826,6 +830,8 @@ CONFIG_FTRACE_SYSCALLS=y · 165 unmodified lines
826830 CONFIG_BLK_DEV_IO_TRACE=y
827831 CONFIG_BPF_KPROBE_OVERRIDE=y
828832 CONFIG_HIST_TRIGGERS=y
833+CONFIG_FTRACE_STARTUP_TEST=y
834+# CONFIG_EVENT_TRACE_STARTUP_TEST is not set
829835 CONFIG_DEBUG_USER_ASCE=y
830836 CONFIG_NOTIFIER_ERROR_INJECTION=m
831837 CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m
arch/s390/configs/defconfig+7−4
@@ -58,6 +58,7 @@ CONFIG_S390_UNWIND_SELFTEST=m · 57 unmodified lines
5858 CONFIG_OPROFILE=m
5959 CONFIG_KPROBES=y
6060 CONFIG_JUMP_LABEL=y
61+# CONFIG_GCC_PLUGINS is not set
6162 CONFIG_MODULES=y
6263 CONFIG_MODULE_FORCE_LOAD=y
6364 CONFIG_MODULE_UNLOAD=y
@@ -95,7 +96,6 @@ CONFIG_ZSMALLOC_STAT=y · 31 unmodified lines
9596 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
9697 CONFIG_IDLE_PAGE_TRACKING=y
9798 CONFIG_PERCPU_STATS=y
98−CONFIG_GUP_TEST=y
9999 CONFIG_NET=y
100100 CONFIG_PACKET=y
101101 CONFIG_PACKET_DIAG=m
@@ -403,12 +403,12 @@ CONFIG_SCSI_ENCLOSURE=m · 301 unmodified lines
403403 CONFIG_SCSI_CONSTANTS=y
404404 CONFIG_SCSI_LOGGING=y
405405 CONFIG_SCSI_SPI_ATTRS=m
406−CONFIG_SCSI_FC_ATTRS=y
406+CONFIG_SCSI_FC_ATTRS=m
407407 CONFIG_SCSI_SAS_LIBSAS=m
408408 CONFIG_SCSI_SRP_ATTRS=m
409409 CONFIG_ISCSI_TCP=m
410410 CONFIG_SCSI_DEBUG=m
411−CONFIG_ZFCP=y
411+CONFIG_ZFCP=m
412412 CONFIG_SCSI_VIRTIO=m
413413 CONFIG_SCSI_DH=y
414414 CONFIG_SCSI_DH_RDAC=m
@@ -437,6 +437,7 @@ CONFIG_DM_MULTIPATH=m · 22 unmodified lines
437437 CONFIG_DM_MULTIPATH_QL=m
438438 CONFIG_DM_MULTIPATH_ST=m
439439 CONFIG_DM_MULTIPATH_HST=m
440+CONFIG_DM_MULTIPATH_IOA=m
440441 CONFIG_DM_DELAY=m
441442 CONFIG_DM_UEVENT=y
442443 CONFIG_DM_FLAKEY=m
@@ -536,7 +537,6 @@ CONFIG_INPUT_EVDEV=y · 93 unmodified lines
536537 # CONFIG_INPUT_MOUSE is not set
537538 # CONFIG_SERIO is not set
538539 CONFIG_LEGACY_PTY_COUNT=0
539−CONFIG_NULL_TTY=m
540540 CONFIG_VIRTIO_CONSOLE=y
541541 CONFIG_HW_RANDOM_VIRTIO=m
542542 CONFIG_RAW_DRIVER=m
@@ -568,6 +568,7 @@ CONFIG_VIRTIO_BALLOON=m · 25 unmodified lines
568568 CONFIG_VIRTIO_INPUT=y
569569 CONFIG_VHOST_NET=m
570570 CONFIG_VHOST_VSOCK=m
571+# CONFIG_SURFACE_PLATFORMS is not set
571572 CONFIG_S390_CCW_IOMMU=y
572573 CONFIG_S390_AP_IOMMU=y
573574 CONFIG_EXT4_FS=y
@@ -645,6 +646,7 @@ CONFIG_CIFS_XATTR=y · 71 unmodified lines
645646 CONFIG_CIFS_POSIX=y
646647 # CONFIG_CIFS_DEBUG is not set
647648 CONFIG_CIFS_DFS_UPCALL=y
649+CONFIG_CIFS_SWN_UPCALL=y
648650 CONFIG_NLS_DEFAULT="utf8"
649651 CONFIG_NLS_CODEPAGE_437=m
650652 CONFIG_NLS_CODEPAGE_850=m
@@ -778,6 +780,7 @@ CONFIG_FTRACE_SYSCALLS=y · 127 unmodified lines
778780 CONFIG_BLK_DEV_IO_TRACE=y
779781 CONFIG_BPF_KPROBE_OVERRIDE=y
780782 CONFIG_HIST_TRIGGERS=y
783+CONFIG_DEBUG_USER_ASCE=y
781784 CONFIG_LKDTM=m
782785 CONFIG_PERCPU_TEST=m
783786 CONFIG_ATOMIC64_SELFTEST=y
arch/s390/configs/zfcpdump_defconfig+2−0
@@ -22,6 +22,7 @@ CONFIG_CRASH_DUMP=y · 21 unmodified lines
2222 # CONFIG_VIRTUALIZATION is not set
2323 # CONFIG_S390_GUEST is not set
2424 # CONFIG_SECCOMP is not set
25+# CONFIG_GCC_PLUGINS is not set
2526 CONFIG_PARTITION_ADVANCED=y
2627 CONFIG_IBM_PARTITION=y
2728 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
@@ -58,6 +59,7 @@ CONFIG_RAW_DRIVER=y · 30 unmodified lines
5859 # CONFIG_HID is not set
5960 # CONFIG_VIRTIO_MENU is not set
6061 # CONFIG_VHOST_MENU is not set
62+# CONFIG_SURFACE_PLATFORMS is not set
6163 # CONFIG_IOMMU_SUPPORT is not set
6264 # CONFIG_DNOTIFY is not set
6365 # CONFIG_INOTIFY_USER is not set
arch/s390/include/asm/Kbuild+0−1
@@ -7,5 +7,4 @@ generated-y += unistd_nr.h · 6 unmodified lines
77 generic-y += asm-offsets.h
88 generic-y += export.h
99 generic-y += kvm_types.h
10−generic-y += local64.h
1110 generic-y += mcs_spinlock.h
arch/sh/include/asm/Kbuild+0−1
@@ -1,6 +1,5 @@
11 # SPDX-License-Identifier: GPL-2.0
22 generated-y += syscall_table.h
33 generic-y += kvm_para.h
4−generic-y += local64.h
54 generic-y += mcs_spinlock.h
65 generic-y += parport.h
arch/sparc/include/asm/Kbuild+0−1
@@ -6,5 +6,4 @@ generated-y += syscall_table_64.h · 5 unmodified lines
66 generated-y += syscall_table_c32.h
77 generic-y += export.h
88 generic-y += kvm_para.h
9−generic-y += local64.h
109 generic-y += mcs_spinlock.h
arch/x86/Kconfig+1−0
@@ -19,6 +19,7 @@ config X86_32 · 18 unmodified lines
1919 select KMAP_LOCAL
2020 select MODULES_USE_ELF_REL
2121 select OLD_SIGACTION
22+ select ARCH_SPLIT_ARG64
2223
2324 config X86_64
2425 def_bool y
arch/x86/hyperv/hv_init.c+30−3
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <asm/hyperv-tlfs.h>
1717 #include <asm/mshyperv.h>
1818 #include <asm/idtentry.h>
19+#include <linux/kexec.h>
1920 #include <linux/version.h>
2021 #include <linux/vmalloc.h>
2122 #include <linux/mm.h>
@@ -26,6 +27,8 @@ · 4 unmodified lines
2627 #include <linux/syscore_ops.h>
2728 #include <clocksource/hyperv_timer.h>
2829
30+int hyperv_init_cpuhp;
31+
2932 void *hv_hypercall_pg;
3033 EXPORT_SYMBOL_GPL(hv_hypercall_pg);
3134
@@ -312,6 +315,25 @@ static struct syscore_ops hv_syscore_ops = { · 280 unmodified lines
312315 .resume = hv_resume,
313316 };
314317
318+static void (* __initdata old_setup_percpu_clockev)(void);
319+
320+static void __init hv_stimer_setup_percpu_clockev(void)
321+{
322+ /*
323+ * Ignore any errors in setting up stimer clockevents
324+ * as we can run with the LAPIC timer as a fallback.
325+ */
326+ (void)hv_stimer_alloc();
327+
328+ /*
329+ * Still register the LAPIC timer, because the direct-mode STIMER is
330+ * not supported by old versions of Hyper-V. This also allows users
331+ * to switch to LAPIC timer via /sys, if they want to.
332+ */
333+ if (old_setup_percpu_clockev)
334+ old_setup_percpu_clockev();
335+}
336+
315337 /*
316338 * This function is to be invoked early in the boot sequence after the
317339 * hypervisor has been detected.
@@ -390,10 +412,14 @@ void __init hyperv_init(void) · 72 unmodified lines
390412 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
391413
392414 /*
393− * Ignore any errors in setting up stimer clockevents
394− * as we can run with the LAPIC timer as a fallback.
415+ * hyperv_init() is called before LAPIC is initialized: see
416+ * apic_intr_mode_init() -> x86_platform.apic_post_init() and
417+ * apic_bsp_setup() -> setup_local_APIC(). The direct-mode STIMER
418+ * depends on LAPIC, so hv_stimer_alloc() should be called from
419+ * x86_init.timers.setup_percpu_clockev.
395420 */
396− (void)hv_stimer_alloc();
421+ old_setup_percpu_clockev = x86_init.timers.setup_percpu_clockev;
422+ x86_init.timers.setup_percpu_clockev = hv_stimer_setup_percpu_clockev;
397423
398424 hv_apic_init();
399425
@@ -401,6 +427,7 @@ void __init hyperv_init(void) · 1 unmodified line
401427
402428 register_syscore_ops(&hv_syscore_ops);
403429
430+ hyperv_init_cpuhp = cpuhp;
404431 return;
405432
406433 remove_cpuhp_state:
arch/x86/hyperv/mmu.c+9−3
@@ -66,11 +66,17 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus, · 65 unmodified lines
6666 if (!hv_hypercall_pg)
6767 goto do_native;
6868
69− if (cpumask_empty(cpus))
70− return;
71−
7269 local_irq_save(flags);
7370
71+ /*
72+ * Only check the mask _after_ interrupt has been disabled to avoid the
73+ * mask changing under our feet.
74+ */
75+ if (cpumask_empty(cpus)) {
76+ local_irq_restore(flags);
77+ return;
78+ }
79+
7480 flush_pcpu = (struct hv_tlb_flush **)
7581 this_cpu_ptr(hyperv_pcpu_input_arg);
7682
arch/x86/include/asm/kvm_host.h+17−2
@@ -1010,9 +1010,21 @@ struct kvm_arch { · 1009 unmodified lines
10101010 */
10111011 bool tdp_mmu_enabled;
10121012
1013− /* List of struct tdp_mmu_pages being used as roots */
1013+ /*
1014+ * List of struct kvmp_mmu_pages being used as roots.
1015+ * All struct kvm_mmu_pages in the list should have
1016+ * tdp_mmu_page set.
1017+ * All struct kvm_mmu_pages in the list should have a positive
1018+ * root_count except when a thread holds the MMU lock and is removing
1019+ * an entry from the list.
1020+ */
10141021 struct list_head tdp_mmu_roots;
1015− /* List of struct tdp_mmu_pages not being used as roots */
1022+
1023+ /*
1024+ * List of struct kvmp_mmu_pages not being used as roots.
1025+ * All struct kvm_mmu_pages in the list should have
1026+ * tdp_mmu_page set and a root_count of 0.
1027+ */
10161028 struct list_head tdp_mmu_pages;
10171029 };
10181030
@@ -1287,6 +1299,8 @@ struct kvm_x86_ops { · 268 unmodified lines
12871299 void (*migrate_timers)(struct kvm_vcpu *vcpu);
12881300 void (*msr_filter_changed)(struct kvm_vcpu *vcpu);
12891301 int (*complete_emulated_msr)(struct kvm_vcpu *vcpu, int err);
1302+
1303+ void (*vcpu_deliver_sipi_vector)(struct kvm_vcpu *vcpu, u8 vector);
12901304 };
12911305
12921306 struct kvm_x86_nested_ops {
@@ -1468,6 +1482,7 @@ int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in); · 175 unmodified lines
14681482 int kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
14691483 int kvm_emulate_halt(struct kvm_vcpu *vcpu);
14701484 int kvm_vcpu_halt(struct kvm_vcpu *vcpu);
1485+int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu);
14711486 int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu);
14721487
14731488 void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
arch/x86/include/asm/local64.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/local64.h>
arch/x86/include/asm/mshyperv.h+2−0
@@ -74,6 +74,8 @@ static inline void hv_disable_stimer0_percpu_irq(int irq) {} · 73 unmodified lines
7474
7575
7676 #if IS_ENABLED(CONFIG_HYPERV)
77+extern int hyperv_init_cpuhp;
78+
7779 extern void *hv_hypercall_pg;
7880 extern void __percpu **hyperv_pcpu_input_arg;
7981
arch/x86/kernel/cpu/mshyperv.c+18−0
@@ -135,14 +135,32 @@ static void hv_machine_shutdown(void) · 134 unmodified lines
135135 {
136136 if (kexec_in_progress && hv_kexec_handler)
137137 hv_kexec_handler();
138+
139+ /*
140+ * Call hv_cpu_die() on all the CPUs, otherwise later the hypervisor
141+ * corrupts the old VP Assist Pages and can crash the kexec kernel.
142+ */
143+ if (kexec_in_progress && hyperv_init_cpuhp > 0)
144+ cpuhp_remove_state(hyperv_init_cpuhp);
145+
146+ /* The function calls stop_other_cpus(). */
138147 native_machine_shutdown();
148+
149+ /* Disable the hypercall page when there is only 1 active CPU. */
150+ if (kexec_in_progress)
151+ hyperv_cleanup();
139152 }
140153
141154 static void hv_machine_crash_shutdown(struct pt_regs *regs)
142155 {
143156 if (hv_crash_handler)
144157 hv_crash_handler(regs);
158+
159+ /* The function calls crash_smp_send_stop(). */
145160 native_machine_crash_shutdown(regs);
161+
162+ /* Disable the hypercall page when there is only 1 active CPU. */
163+ hyperv_cleanup();
146164 }
147165 #endif /* CONFIG_KEXEC_CORE */
148166 #endif /* CONFIG_HYPERV */
arch/x86/kernel/cpu/mtrr/generic.c+3−3
@@ -167,9 +167,6 @@ static u8 mtrr_type_lookup_variable(u64 start, u64 end, u64 *partial_end, · 166 unmodified lines
167167 *repeat = 0;
168168 *uniform = 1;
169169
170− /* Make end inclusive instead of exclusive */
171− end--;
172−
173170 prev_match = MTRR_TYPE_INVALID;
174171 for (i = 0; i < num_var_ranges; ++i) {
175172 unsigned short start_state, end_state, inclusive;
@@ -261,6 +258,9 @@ u8 mtrr_type_lookup(u64 start, u64 end, u8 *uniform) · 85 unmodified lines
261258 int repeat;
262259 u64 partial_end;
263260
261+ /* Make end inclusive instead of exclusive */
262+ end--;
263+
264264 if (!mtrr_state_set)
265265 return MTRR_TYPE_INVALID;
266266
arch/x86/kernel/cpu/resctrl/rdtgroup.c+49−68
@@ -525,89 +525,70 @@ static void rdtgroup_remove(struct rdtgroup *rdtgrp) · 524 unmodified lines
525525 kfree(rdtgrp);
526526 }
527527
528−struct task_move_callback {
529− struct callback_head work;
530− struct rdtgroup *rdtgrp;
531−};
532−
533−static void move_myself(struct callback_head *head)
528+static void _update_task_closid_rmid(void *task)
534529 {
535− struct task_move_callback *callback;
536− struct rdtgroup *rdtgrp;
537−
538− callback = container_of(head, struct task_move_callback, work);
539− rdtgrp = callback->rdtgrp;
540−
541530 /*
542− * If resource group was deleted before this task work callback
543− * was invoked, then assign the task to root group and free the
544− * resource group.
531+ * If the task is still current on this CPU, update PQR_ASSOC MSR.
532+ * Otherwise, the MSR is updated when the task is scheduled in.
545533 */
546− if (atomic_dec_and_test(&rdtgrp->waitcount) &&
547− (rdtgrp->flags & RDT_DELETED)) {
548− current->closid = 0;
549− current->rmid = 0;
550− rdtgroup_remove(rdtgrp);
551− }
552−
553− if (unlikely(current->flags & PF_EXITING))
554− goto out;
555−
556− preempt_disable();
557− /* update PQR_ASSOC MSR to make resource group go into effect */
558− resctrl_sched_in();
559− preempt_enable();
534+ if (task == current)
535+ resctrl_sched_in();
536+}
560537
561−out:
562− kfree(callback);
538+static void update_task_closid_rmid(struct task_struct *t)
539+{
540+ if (IS_ENABLED(CONFIG_SMP) && task_curr(t))
541+ smp_call_function_single(task_cpu(t), _update_task_closid_rmid, t, 1);
542+ else
543+ _update_task_closid_rmid(t);
563544 }
564545
565546 static int __rdtgroup_move_task(struct task_struct *tsk,
566547 struct rdtgroup *rdtgrp)
567548 {
568− struct task_move_callback *callback;
569− int ret;
570−
571− callback = kzalloc(sizeof(*callback), GFP_KERNEL);
572− if (!callback)
573− return -ENOMEM;
574− callback->work.func = move_myself;
575− callback->rdtgrp = rdtgrp;
549+ /* If the task is already in rdtgrp, no need to move the task. */
550+ if ((rdtgrp->type == RDTCTRL_GROUP && tsk->closid == rdtgrp->closid &&
551+ tsk->rmid == rdtgrp->mon.rmid) ||
552+ (rdtgrp->type == RDTMON_GROUP && tsk->rmid == rdtgrp->mon.rmid &&
553+ tsk->closid == rdtgrp->mon.parent->closid))
554+ return 0;
576555
577556 /*
578− * Take a refcount, so rdtgrp cannot be freed before the
579− * callback has been invoked.
557+ * Set the task's closid/rmid before the PQR_ASSOC MSR can be
558+ * updated by them.
559+ *
560+ * For ctrl_mon groups, move both closid and rmid.
561+ * For monitor groups, can move the tasks only from
562+ * their parent CTRL group.
580563 */
581− atomic_inc(&rdtgrp->waitcount);
582− ret = task_work_add(tsk, &callback->work, TWA_RESUME);
583− if (ret) {
584− /*
585− * Task is exiting. Drop the refcount and free the callback.
586− * No need to check the refcount as the group cannot be
587− * deleted before the write function unlocks rdtgroup_mutex.
588− */
589− atomic_dec(&rdtgrp->waitcount);
590− kfree(callback);
591− rdt_last_cmd_puts("Task exited\n");
592− } else {
593− /*
594− * For ctrl_mon groups move both closid and rmid.
595− * For monitor groups, can move the tasks only from
596− * their parent CTRL group.
597− */
598− if (rdtgrp->type == RDTCTRL_GROUP) {
599− tsk->closid = rdtgrp->closid;
564+
565+ if (rdtgrp->type == RDTCTRL_GROUP) {
566+ tsk->closid = rdtgrp->closid;
567+ tsk->rmid = rdtgrp->mon.rmid;
568+ } else if (rdtgrp->type == RDTMON_GROUP) {
569+ if (rdtgrp->mon.parent->closid == tsk->closid) {
600570 tsk->rmid = rdtgrp->mon.rmid;
601− } else if (rdtgrp->type == RDTMON_GROUP) {
602− if (rdtgrp->mon.parent->closid == tsk->closid) {
603− tsk->rmid = rdtgrp->mon.rmid;
604− } else {
605− rdt_last_cmd_puts("Can't move task to different control group\n");
606− ret = -EINVAL;
607− }
571+ } else {
572+ rdt_last_cmd_puts("Can't move task to different control group\n");
573+ return -EINVAL;
608574 }
609575 }
610− return ret;
576+
577+ /*
578+ * Ensure the task's closid and rmid are written before determining if
579+ * the task is current that will decide if it will be interrupted.
580+ */
581+ barrier();
582+
583+ /*
584+ * By now, the task's closid and rmid are set. If the task is current
585+ * on a CPU, the PQR_ASSOC MSR needs to be updated to make the resource
586+ * group go into effect. If the task is not current, the MSR will be
587+ * updated when the task is scheduled in.
588+ */
589+ update_task_closid_rmid(tsk);
590+
591+ return 0;
611592 }
612593
613594 static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)
arch/x86/kernel/sev-es-shared.c+2−2
@@ -305,14 +305,14 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo) · 304 unmodified lines
305305 case 0xe4:
306306 case 0xe5:
307307 *exitinfo |= IOIO_TYPE_IN;
308− *exitinfo |= (u64)insn->immediate.value << 16;
308+ *exitinfo |= (u8)insn->immediate.value << 16;
309309 break;
310310
311311 /* OUT immediate opcodes */
312312 case 0xe6:
313313 case 0xe7:
314314 *exitinfo |= IOIO_TYPE_OUT;
315− *exitinfo |= (u64)insn->immediate.value << 16;
315+ *exitinfo |= (u8)insn->immediate.value << 16;
316316 break;
317317
318318 /* IN register opcodes */
arch/x86/kvm/lapic.c+2−2
@@ -674,7 +674,7 @@ static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu) · 673 unmodified lines
674674 (unsigned long long)vcpu->arch.pv_eoi.msr_val);
675675 return false;
676676 }
677− return val & 0x1;
677+ return val & KVM_PV_EOI_ENABLED;
678678 }
679679
680680 static void pv_eoi_set_pending(struct kvm_vcpu *vcpu)
@@ -2898,7 +2898,7 @@ void kvm_apic_accept_events(struct kvm_vcpu *vcpu) · 2217 unmodified lines
28982898 /* evaluate pending_events before reading the vector */
28992899 smp_rmb();
29002900 sipi_vector = apic->sipi_vector;
2901− kvm_vcpu_deliver_sipi_vector(vcpu, sipi_vector);
2901+ kvm_x86_ops.vcpu_deliver_sipi_vector(vcpu, sipi_vector);
29022902 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
29032903 }
29042904 }
arch/x86/kvm/mmu.h+1−1
@@ -49,7 +49,7 @@ static inline u64 rsvd_bits(int s, int e) · 48 unmodified lines
4949 if (e < s)
5050 return 0;
5151
52− return ((1ULL << (e - s + 1)) - 1) << s;
52+ return ((2ULL << (e - s)) - 1) << s;
5353 }
5454
5555 void kvm_mmu_set_mmio_spte_mask(u64 mmio_value, u64 access_mask);
arch/x86/kvm/mmu/mmu.c+30−23
@@ -3493,26 +3493,25 @@ static bool mmio_info_in_cache(struct kvm_vcpu *vcpu, u64 addr, bool direct) · 3492 unmodified lines
34933493 * Return the level of the lowest level SPTE added to sptes.
34943494 * That SPTE may be non-present.
34953495 */
3496−static int get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes)
3496+static int get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes, int *root_level)
34973497 {
34983498 struct kvm_shadow_walk_iterator iterator;
3499− int leaf = vcpu->arch.mmu->root_level;
3499+ int leaf = -1;
35003500 u64 spte;
35013501
3502−
35033502 walk_shadow_page_lockless_begin(vcpu);
35043503
3505− for (shadow_walk_init(&iterator, vcpu, addr);
3504+ for (shadow_walk_init(&iterator, vcpu, addr),
3505+ *root_level = iterator.level;
35063506 shadow_walk_okay(&iterator);
35073507 __shadow_walk_next(&iterator, spte)) {
35083508 leaf = iterator.level;
35093509 spte = mmu_spte_get_lockless(iterator.sptep);
35103510
3511− sptes[leaf - 1] = spte;
3511+ sptes[leaf] = spte;
35123512
35133513 if (!is_shadow_present_pte(spte))
35143514 break;
3515−
35163515 }
35173516
35183517 walk_shadow_page_lockless_end(vcpu);
@@ -3520,14 +3519,12 @@ static int get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes) · 1 unmodified line
35203519 return leaf;
35213520 }
35223521
3523−/* return true if reserved bit is detected on spte. */
3522+/* return true if reserved bit(s) are detected on a valid, non-MMIO SPTE. */
35243523 static bool get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep)
35253524 {
3526− u64 sptes[PT64_ROOT_MAX_LEVEL];
3525+ u64 sptes[PT64_ROOT_MAX_LEVEL + 1];
35273526 struct rsvd_bits_validate *rsvd_check;
3528− int root = vcpu->arch.mmu->shadow_root_level;
3529− int leaf;
3530− int level;
3527+ int root, leaf, level;
35313528 bool reserved = false;
35323529
35333530 if (!VALID_PAGE(vcpu->arch.mmu->root_hpa)) {
@@ -3536,35 +3533,45 @@ static bool get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep) · 2 unmodified lines
35363533 }
35373534
35383535 if (is_tdp_mmu_root(vcpu->kvm, vcpu->arch.mmu->root_hpa))
3539− leaf = kvm_tdp_mmu_get_walk(vcpu, addr, sptes);
3536+ leaf = kvm_tdp_mmu_get_walk(vcpu, addr, sptes, &root);
35403537 else
3541− leaf = get_walk(vcpu, addr, sptes);
3538+ leaf = get_walk(vcpu, addr, sptes, &root);
3539+
3540+ if (unlikely(leaf < 0)) {
3541+ *sptep = 0ull;
3542+ return reserved;
3543+ }
3544+
3545+ *sptep = sptes[leaf];
3546+
3547+ /*
3548+ * Skip reserved bits checks on the terminal leaf if it's not a valid
3549+ * SPTE. Note, this also (intentionally) skips MMIO SPTEs, which, by
3550+ * design, always have reserved bits set. The purpose of the checks is
3551+ * to detect reserved bits on non-MMIO SPTEs. i.e. buggy SPTEs.
3552+ */
3553+ if (!is_shadow_present_pte(sptes[leaf]))
3554+ leaf++;
35423555
35433556 rsvd_check = &vcpu->arch.mmu->shadow_zero_check;
35443557
3545− for (level = root; level >= leaf; level--) {
3546− if (!is_shadow_present_pte(sptes[level - 1]))
3547− break;
3558+ for (level = root; level >= leaf; level--)
35483559 /*
35493560 * Use a bitwise-OR instead of a logical-OR to aggregate the
35503561 * reserved bit and EPT's invalid memtype/XWR checks to avoid
35513562 * adding a Jcc in the loop.
35523563 */
3553− reserved |= __is_bad_mt_xwr(rsvd_check, sptes[level - 1]) |
3554− __is_rsvd_bits_set(rsvd_check, sptes[level - 1],
3555− level);
3556− }
3564+ reserved |= __is_bad_mt_xwr(rsvd_check, sptes[level]) |
3565+ __is_rsvd_bits_set(rsvd_check, sptes[level], level);
35573566
35583567 if (reserved) {
35593568 pr_err("%s: detect reserved bits on spte, addr 0x%llx, dump hierarchy:\n",
35603569 __func__, addr);
35613570 for (level = root; level >= leaf; level--)
35623571 pr_err("------ spte 0x%llx level %d.\n",
3563− sptes[level - 1], level);
3572+ sptes[level], level);
35643573 }
35653574
3566− *sptep = sptes[leaf - 1];
3567−
35683575 return reserved;
35693576 }
35703577
arch/x86/kvm/mmu/tdp_mmu.c+54−59
@@ -44,7 +44,48 @@ void kvm_mmu_uninit_tdp_mmu(struct kvm *kvm) · 43 unmodified lines
4444 WARN_ON(!list_empty(&kvm->arch.tdp_mmu_roots));
4545 }
4646
47−#define for_each_tdp_mmu_root(_kvm, _root) \
47+static void tdp_mmu_put_root(struct kvm *kvm, struct kvm_mmu_page *root)
48+{
49+ if (kvm_mmu_put_root(kvm, root))
50+ kvm_tdp_mmu_free_root(kvm, root);
51+}
52+
53+static inline bool tdp_mmu_next_root_valid(struct kvm *kvm,
54+ struct kvm_mmu_page *root)
55+{
56+ lockdep_assert_held(&kvm->mmu_lock);
57+
58+ if (list_entry_is_head(root, &kvm->arch.tdp_mmu_roots, link))
59+ return false;
60+
61+ kvm_mmu_get_root(kvm, root);
62+ return true;
63+
64+}
65+
66+static inline struct kvm_mmu_page *tdp_mmu_next_root(struct kvm *kvm,
67+ struct kvm_mmu_page *root)
68+{
69+ struct kvm_mmu_page *next_root;
70+
71+ next_root = list_next_entry(root, link);
72+ tdp_mmu_put_root(kvm, root);
73+ return next_root;
74+}
75+
76+/*
77+ * Note: this iterator gets and puts references to the roots it iterates over.
78+ * This makes it safe to release the MMU lock and yield within the loop, but
79+ * if exiting the loop early, the caller must drop the reference to the most
80+ * recent root. (Unless keeping a live reference is desirable.)
81+ */
82+#define for_each_tdp_mmu_root_yield_safe(_kvm, _root) \
83+ for (_root = list_first_entry(&_kvm->arch.tdp_mmu_roots, \
84+ typeof(*_root), link); \
85+ tdp_mmu_next_root_valid(_kvm, _root); \
86+ _root = tdp_mmu_next_root(_kvm, _root))
87+
88+#define for_each_tdp_mmu_root(_kvm, _root) \
4889 list_for_each_entry(_root, &_kvm->arch.tdp_mmu_roots, link)
4990
5091 bool is_tdp_mmu_root(struct kvm *kvm, hpa_t hpa)
@@ -447,18 +488,9 @@ bool kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, gfn_t end) · 396 unmodified lines
447488 struct kvm_mmu_page *root;
448489 bool flush = false;
449490
450− for_each_tdp_mmu_root(kvm, root) {
451− /*
452− * Take a reference on the root so that it cannot be freed if
453− * this thread releases the MMU lock and yields in this loop.
454− */
455− kvm_mmu_get_root(kvm, root);
456−
491+ for_each_tdp_mmu_root_yield_safe(kvm, root)
457492 flush |= zap_gfn_range(kvm, root, start, end, true);
458493
459− kvm_mmu_put_root(kvm, root);
460− }
461−
462494 return flush;
463495 }
464496
@@ -619,13 +651,7 @@ static int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, unsigned long start, · 154 unmodified lines
619651 int ret = 0;
620652 int as_id;
621653
622− for_each_tdp_mmu_root(kvm, root) {
623− /*
624− * Take a reference on the root so that it cannot be freed if
625− * this thread releases the MMU lock and yields in this loop.
626− */
627− kvm_mmu_get_root(kvm, root);
628−
654+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
629655 as_id = kvm_mmu_page_as_id(root);
630656 slots = __kvm_memslots(kvm, as_id);
631657 kvm_for_each_memslot(memslot, slots) {
@@ -647,8 +673,6 @@ static int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, unsigned long start, · 15 unmodified lines
647673 ret |= handler(kvm, memslot, root, gfn_start,
648674 gfn_end, data);
649675 }
650−
651− kvm_mmu_put_root(kvm, root);
652676 }
653677
654678 return ret;
@@ -838,21 +862,13 @@ bool kvm_tdp_mmu_wrprot_slot(struct kvm *kvm, struct kvm_memory_slot *slot, · 183 unmodified lines
838862 int root_as_id;
839863 bool spte_set = false;
840864
841− for_each_tdp_mmu_root(kvm, root) {
865+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
842866 root_as_id = kvm_mmu_page_as_id(root);
843867 if (root_as_id != slot->as_id)
844868 continue;
845869
846− /*
847− * Take a reference on the root so that it cannot be freed if
848− * this thread releases the MMU lock and yields in this loop.
849− */
850− kvm_mmu_get_root(kvm, root);
851−
852870 spte_set |= wrprot_gfn_range(kvm, root, slot->base_gfn,
853871 slot->base_gfn + slot->npages, min_level);
854−
855− kvm_mmu_put_root(kvm, root);
856872 }
857873
858874 return spte_set;
@@ -906,21 +922,13 @@ bool kvm_tdp_mmu_clear_dirty_slot(struct kvm *kvm, struct kvm_memory_slot *slot) · 47 unmodified lines
906922 int root_as_id;
907923 bool spte_set = false;
908924
909− for_each_tdp_mmu_root(kvm, root) {
925+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
910926 root_as_id = kvm_mmu_page_as_id(root);
911927 if (root_as_id != slot->as_id)
912928 continue;
913929
914− /*
915− * Take a reference on the root so that it cannot be freed if
916− * this thread releases the MMU lock and yields in this loop.
917− */
918− kvm_mmu_get_root(kvm, root);
919−
920930 spte_set |= clear_dirty_gfn_range(kvm, root, slot->base_gfn,
921931 slot->base_gfn + slot->npages);
922−
923− kvm_mmu_put_root(kvm, root);
924932 }
925933
926934 return spte_set;
@@ -1029,21 +1037,13 @@ bool kvm_tdp_mmu_slot_set_dirty(struct kvm *kvm, struct kvm_memory_slot *slot) · 102 unmodified lines
10291037 int root_as_id;
10301038 bool spte_set = false;
10311039
1032− for_each_tdp_mmu_root(kvm, root) {
1040+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
10331041 root_as_id = kvm_mmu_page_as_id(root);
10341042 if (root_as_id != slot->as_id)
10351043 continue;
10361044
1037− /*
1038− * Take a reference on the root so that it cannot be freed if
1039− * this thread releases the MMU lock and yields in this loop.
1040− */
1041− kvm_mmu_get_root(kvm, root);
1042−
10431045 spte_set |= set_dirty_gfn_range(kvm, root, slot->base_gfn,
10441046 slot->base_gfn + slot->npages);
1045−
1046− kvm_mmu_put_root(kvm, root);
10471047 }
10481048 return spte_set;
10491049 }
@@ -1089,21 +1089,13 @@ void kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm, · 39 unmodified lines
10891089 struct kvm_mmu_page *root;
10901090 int root_as_id;
10911091
1092− for_each_tdp_mmu_root(kvm, root) {
1092+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
10931093 root_as_id = kvm_mmu_page_as_id(root);
10941094 if (root_as_id != slot->as_id)
10951095 continue;
10961096
1097− /*
1098− * Take a reference on the root so that it cannot be freed if
1099− * this thread releases the MMU lock and yields in this loop.
1100− */
1101− kvm_mmu_get_root(kvm, root);
1102−
11031097 zap_collapsible_spte_range(kvm, root, slot->base_gfn,
11041098 slot->base_gfn + slot->npages);
1105−
1106− kvm_mmu_put_root(kvm, root);
11071099 }
11081100 }
11091101
@@ -1160,16 +1152,19 @@ bool kvm_tdp_mmu_write_protect_gfn(struct kvm *kvm, · 50 unmodified lines
11601152 * Return the level of the lowest level SPTE added to sptes.
11611153 * That SPTE may be non-present.
11621154 */
1163−int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes)
1155+int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes,
1156+ int *root_level)
11641157 {
11651158 struct tdp_iter iter;
11661159 struct kvm_mmu *mmu = vcpu->arch.mmu;
1167− int leaf = vcpu->arch.mmu->shadow_root_level;
11681160 gfn_t gfn = addr >> PAGE_SHIFT;
1161+ int leaf = -1;
1162+
1163+ *root_level = vcpu->arch.mmu->shadow_root_level;
11691164
11701165 tdp_mmu_for_each_pte(iter, mmu, gfn, gfn + 1) {
11711166 leaf = iter.level;
1172− sptes[leaf - 1] = iter.old_spte;
1167+ sptes[leaf] = iter.old_spte;
11731168 }
11741169
11751170 return leaf;
arch/x86/kvm/mmu/tdp_mmu.h+3−1
@@ -44,5 +44,7 @@ void kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm, · 43 unmodified lines
4444 bool kvm_tdp_mmu_write_protect_gfn(struct kvm *kvm,
4545 struct kvm_memory_slot *slot, gfn_t gfn);
4646
47−int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes);
47+int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes,
48+ int *root_level);
49+
4850 #endif /* __KVM_X86_MMU_TDP_MMU_H */
arch/x86/kvm/svm/nested.c+8−0
@@ -199,6 +199,7 @@ static bool nested_svm_vmrun_msrpm(struct vcpu_svm *svm) · 198 unmodified lines
199199 static bool svm_get_nested_state_pages(struct kvm_vcpu *vcpu)
200200 {
201201 struct vcpu_svm *svm = to_svm(vcpu);
202+
202203 if (!nested_svm_vmrun_msrpm(svm)) {
203204 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
204205 vcpu->run->internal.suberror =
@@ -595,6 +596,8 @@ int nested_svm_vmexit(struct vcpu_svm *svm) · 390 unmodified lines
595596 svm->nested.vmcb12_gpa = 0;
596597 WARN_ON_ONCE(svm->nested.nested_run_pending);
597598
599+ kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, &svm->vcpu);
600+
598601 /* in case we halted in L2 */
599602 svm->vcpu.arch.mp_state = KVM_MP_STATE_RUNNABLE;
600603
@@ -754,6 +757,7 @@ void svm_leave_nested(struct vcpu_svm *svm) · 153 unmodified lines
754757 leave_guest_mode(&svm->vcpu);
755758 copy_vmcb_control_area(&vmcb->control, &hsave->control);
756759 nested_svm_uninit_mmu_context(&svm->vcpu);
760+ vmcb_mark_all_dirty(svm->vmcb);
757761 }
758762
759763 kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, &svm->vcpu);
@@ -1194,6 +1198,10 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 434 unmodified lines
11941198 * in the registers, the save area of the nested state instead
11951199 * contains saved L1 state.
11961200 */
1201+
1202+ svm->nested.nested_run_pending =
1203+ !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
1204+
11971205 copy_vmcb_control_area(&hsave->control, &svm->vmcb->control);
11981206 hsave->save = *save;
11991207
arch/x86/kvm/svm/sev.c+23−1
@@ -1563,6 +1563,7 @@ static int sev_es_validate_vmgexit(struct vcpu_svm *svm) · 1562 unmodified lines
15631563 goto vmgexit_err;
15641564 break;
15651565 case SVM_VMGEXIT_NMI_COMPLETE:
1566+ case SVM_VMGEXIT_AP_HLT_LOOP:
15661567 case SVM_VMGEXIT_AP_JUMP_TABLE:
15671568 case SVM_VMGEXIT_UNSUPPORTED_EVENT:
15681569 break;
@@ -1888,6 +1889,9 @@ int sev_handle_vmgexit(struct vcpu_svm *svm) · 319 unmodified lines
18881889 case SVM_VMGEXIT_NMI_COMPLETE:
18891890 ret = svm_invoke_exit_handler(svm, SVM_EXIT_IRET);
18901891 break;
1892+ case SVM_VMGEXIT_AP_HLT_LOOP:
1893+ ret = kvm_emulate_ap_reset_hold(&svm->vcpu);
1894+ break;
18911895 case SVM_VMGEXIT_AP_JUMP_TABLE: {
18921896 struct kvm_sev_info *sev = &to_kvm_svm(svm->vcpu.kvm)->sev_info;
18931897
@@ -2001,7 +2005,7 @@ void sev_es_vcpu_load(struct vcpu_svm *svm, int cpu) · 107 unmodified lines
20012005 * of which one step is to perform a VMLOAD. Since hardware does not
20022006 * perform a VMSAVE on VMRUN, the host savearea must be updated.
20032007 */
2004− asm volatile(__ex("vmsave") : : "a" (__sme_page_pa(sd->save_area)) : "memory");
2008+ asm volatile(__ex("vmsave %0") : : "a" (__sme_page_pa(sd->save_area)) : "memory");
20052009
20062010 /*
20072011 * Certain MSRs are restored on VMEXIT, only save ones that aren't
@@ -2040,3 +2044,21 @@ void sev_es_vcpu_put(struct vcpu_svm *svm) · 32 unmodified lines
20402044 wrmsrl(host_save_user_msrs[i].index, svm->host_user_msrs[i]);
20412045 }
20422046 }
2047+
2048+void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
2049+{
2050+ struct vcpu_svm *svm = to_svm(vcpu);
2051+
2052+ /* First SIPI: Use the values as initially set by the VMM */
2053+ if (!svm->received_first_sipi) {
2054+ svm->received_first_sipi = true;
2055+ return;
2056+ }
2057+
2058+ /*
2059+ * Subsequent SIPI: Return from an AP Reset Hold VMGEXIT, where
2060+ * the guest will set the CS and RIP. Set SW_EXIT_INFO_2 to a
2061+ * non-zero value.
2062+ */
2063+ ghcb_set_sw_exit_info_2(svm->ghcb, 1);
2064+}
arch/x86/kvm/svm/svm.c+10−2
@@ -3677,8 +3677,6 @@ static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu) · 3676 unmodified lines
36773677 return EXIT_FASTPATH_NONE;
36783678 }
36793679
3680−void __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
3681−
36823680 static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu,
36833681 struct vcpu_svm *svm)
36843682 {
@@ -4384,6 +4382,14 @@ static bool svm_apic_init_signal_blocked(struct kvm_vcpu *vcpu) · 699 unmodified lines
43844382 (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT));
43854383 }
43864384
4385+static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
4386+{
4387+ if (!sev_es_guest(vcpu->kvm))
4388+ return kvm_vcpu_deliver_sipi_vector(vcpu, vector);
4389+
4390+ sev_vcpu_deliver_sipi_vector(vcpu, vector);
4391+}
4392+
43874393 static void svm_vm_destroy(struct kvm *kvm)
43884394 {
43894395 avic_vm_destroy(kvm);
@@ -4526,6 +4532,8 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { · 136 unmodified lines
45264532
45274533 .msr_filter_changed = svm_msr_filter_changed,
45284534 .complete_emulated_msr = svm_complete_emulated_msr,
4535+
4536+ .vcpu_deliver_sipi_vector = svm_vcpu_deliver_sipi_vector,
45294537 };
45304538
45314539 static struct kvm_x86_init_ops svm_init_ops __initdata = {
arch/x86/kvm/svm/svm.h+2−0
@@ -185,6 +185,7 @@ struct vcpu_svm { · 184 unmodified lines
185185 struct vmcb_save_area *vmsa;
186186 struct ghcb *ghcb;
187187 struct kvm_host_map ghcb_map;
188+ bool received_first_sipi;
188189
189190 /* SEV-ES scratch area support */
190191 void *ghcb_sa;
@@ -591,6 +592,7 @@ void sev_es_init_vmcb(struct vcpu_svm *svm); · 400 unmodified lines
591592 void sev_es_create_vcpu(struct vcpu_svm *svm);
592593 void sev_es_vcpu_load(struct vcpu_svm *svm, int cpu);
593594 void sev_es_vcpu_put(struct vcpu_svm *svm);
595+void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector);
594596
595597 /* vmenter.S */
596598
arch/x86/kvm/vmx/nested.c+2−0
@@ -4442,6 +4442,8 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, · 4441 unmodified lines
44424442 /* trying to cancel vmlaunch/vmresume is a bug */
44434443 WARN_ON_ONCE(vmx->nested.nested_run_pending);
44444444
4445+ kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu);
4446+
44454447 /* Service the TLB flush request for L2 before switching to L1. */
44464448 if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
44474449 kvm_vcpu_flush_tlb_current(vcpu);
arch/x86/kvm/vmx/vmx.c+2−0
@@ -7707,6 +7707,8 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = { · 7706 unmodified lines
77077707 .msr_filter_changed = vmx_msr_filter_changed,
77087708 .complete_emulated_msr = kvm_complete_insn_gp,
77097709 .cpu_dirty_log_size = vmx_cpu_dirty_log_size,
7710+
7711+ .vcpu_deliver_sipi_vector = kvm_vcpu_deliver_sipi_vector,
77107712 };
77117713
77127714 static __init int hardware_setup(void)
arch/x86/kvm/x86.c+24−6
@@ -7976,17 +7976,22 @@ void kvm_arch_exit(void) · 7975 unmodified lines
79767976 kmem_cache_destroy(x86_fpu_cache);
79777977 }
79787978
7979−int kvm_vcpu_halt(struct kvm_vcpu *vcpu)
7979+static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason)
79807980 {
79817981 ++vcpu->stat.halt_exits;
79827982 if (lapic_in_kernel(vcpu)) {
7983− vcpu->arch.mp_state = KVM_MP_STATE_HALTED;
7983+ vcpu->arch.mp_state = state;
79847984 return 1;
79857985 } else {
7986− vcpu->run->exit_reason = KVM_EXIT_HLT;
7986+ vcpu->run->exit_reason = reason;
79877987 return 0;
79887988 }
79897989 }
7990+
7991+int kvm_vcpu_halt(struct kvm_vcpu *vcpu)
7992+{
7993+ return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT);
7994+}
79907995 EXPORT_SYMBOL_GPL(kvm_vcpu_halt);
79917996
79927997 int kvm_emulate_halt(struct kvm_vcpu *vcpu)
@@ -8000,6 +8005,14 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) · 7 unmodified lines
80008005 }
80018006 EXPORT_SYMBOL_GPL(kvm_emulate_halt);
80028007
8008+int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu)
8009+{
8010+ int ret = kvm_skip_emulated_instruction(vcpu);
8011+
8012+ return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, KVM_EXIT_AP_RESET_HOLD) && ret;
8013+}
8014+EXPORT_SYMBOL_GPL(kvm_emulate_ap_reset_hold);
8015+
80038016 #ifdef CONFIG_X86_64
80048017 static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
80058018 unsigned long clock_type)
@@ -8789,7 +8802,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 783 unmodified lines
87898802
87908803 if (kvm_request_pending(vcpu)) {
87918804 if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu)) {
8792− if (unlikely(!kvm_x86_ops.nested_ops->get_nested_state_pages(vcpu))) {
8805+ if (WARN_ON_ONCE(!is_guest_mode(vcpu)))
8806+ ;
8807+ else if (unlikely(!kvm_x86_ops.nested_ops->get_nested_state_pages(vcpu))) {
87938808 r = 0;
87948809 goto out;
87958810 }
@@ -9094,6 +9109,7 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) · 298 unmodified lines
90949109 kvm_apic_accept_events(vcpu);
90959110 switch(vcpu->arch.mp_state) {
90969111 case KVM_MP_STATE_HALTED:
9112+ case KVM_MP_STATE_AP_RESET_HOLD:
90979113 vcpu->arch.pv.pv_unhalted = false;
90989114 vcpu->arch.mp_state =
90999115 KVM_MP_STATE_RUNNABLE;
@@ -9520,8 +9536,9 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, · 420 unmodified lines
95209536 kvm_load_guest_fpu(vcpu);
95219537
95229538 kvm_apic_accept_events(vcpu);
9523− if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED &&
9524− vcpu->arch.pv.pv_unhalted)
9539+ if ((vcpu->arch.mp_state == KVM_MP_STATE_HALTED ||
9540+ vcpu->arch.mp_state == KVM_MP_STATE_AP_RESET_HOLD) &&
9541+ vcpu->arch.pv.pv_unhalted)
95259542 mp_state->mp_state = KVM_MP_STATE_RUNNABLE;
95269543 else
95279544 mp_state->mp_state = vcpu->arch.mp_state;
@@ -10152,6 +10169,7 @@ void kvm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) · 624 unmodified lines
1015210169 kvm_set_segment(vcpu, &cs, VCPU_SREG_CS);
1015310170 kvm_rip_write(vcpu, 0);
1015410171 }
10172+EXPORT_SYMBOL_GPL(kvm_vcpu_deliver_sipi_vector);
1015510173
1015610174 int kvm_arch_hardware_enable(void)
1015710175 {
arch/x86/mm/pgtable.c+2−0
@@ -829,6 +829,8 @@ int pud_free_pmd_page(pud_t *pud, unsigned long addr) · 828 unmodified lines
829829 }
830830
831831 free_page((unsigned long)pmd_sv);
832+
833+ pgtable_pmd_page_dtor(virt_to_page(pmd));
832834 free_page((unsigned long)pmd);
833835
834836 return 1;
arch/x86/xen/enlighten_hvm.c+12−3
@@ -164,10 +164,10 @@ static int xen_cpu_up_prepare_hvm(unsigned int cpu) · 163 unmodified lines
164164 else
165165 per_cpu(xen_vcpu_id, cpu) = cpu;
166166 rc = xen_vcpu_setup(cpu);
167− if (rc)
167+ if (rc || !xen_have_vector_callback)
168168 return rc;
169169
170− if (xen_have_vector_callback && xen_feature(XENFEAT_hvm_safe_pvclock))
170+ if (xen_feature(XENFEAT_hvm_safe_pvclock))
171171 xen_setup_timer(cpu);
172172
173173 rc = xen_smp_intr_init(cpu);
@@ -188,6 +188,8 @@ static int xen_cpu_dead_hvm(unsigned int cpu) · 14 unmodified lines
188188 return 0;
189189 }
190190
191+static bool no_vector_callback __initdata;
192+
191193 static void __init xen_hvm_guest_init(void)
192194 {
193195 if (xen_pv_domain())
@@ -207,7 +209,7 @@ static void __init xen_hvm_guest_init(void) · 13 unmodified lines
207209
208210 xen_panic_handler_init();
209211
210− if (xen_feature(XENFEAT_hvm_callback_vector))
212+ if (!no_vector_callback && xen_feature(XENFEAT_hvm_callback_vector))
211213 xen_have_vector_callback = 1;
212214
213215 xen_hvm_smp_init();
@@ -233,6 +235,13 @@ static __init int xen_parse_nopv(char *arg) · 19 unmodified lines
233235 }
234236 early_param("xen_nopv", xen_parse_nopv);
235237
238+static __init int xen_parse_no_vector_callback(char *arg)
239+{
240+ no_vector_callback = true;
241+ return 0;
242+}
243+early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
244+
236245 bool __init xen_hvm_need_lapic(void)
237246 {
238247 if (xen_pv_domain())
arch/x86/xen/smp_hvm.c+17−10
@@ -33,9 +33,11 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) · 32 unmodified lines
3333 int cpu;
3434
3535 native_smp_prepare_cpus(max_cpus);
36− WARN_ON(xen_smp_intr_init(0));
3736
38− xen_init_lock_cpu(0);
37+ if (xen_have_vector_callback) {
38+ WARN_ON(xen_smp_intr_init(0));
39+ xen_init_lock_cpu(0);
40+ }
3941
4042 for_each_possible_cpu(cpu) {
4143 if (cpu == 0)
@@ -50,9 +52,11 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) · 8 unmodified lines
5052 static void xen_hvm_cpu_die(unsigned int cpu)
5153 {
5254 if (common_cpu_die(cpu) == 0) {
53− xen_smp_intr_free(cpu);
54− xen_uninit_lock_cpu(cpu);
55− xen_teardown_timer(cpu);
55+ if (xen_have_vector_callback) {
56+ xen_smp_intr_free(cpu);
57+ xen_uninit_lock_cpu(cpu);
58+ xen_teardown_timer(cpu);
59+ }
5660 }
5761 }
5862 #else
@@ -64,14 +68,17 @@ static void xen_hvm_cpu_die(unsigned int cpu) · 5 unmodified lines
6468
6569 void __init xen_hvm_smp_init(void)
6670 {
67− if (!xen_have_vector_callback)
71+ smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
72+ smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
73+ smp_ops.smp_cpus_done = xen_smp_cpus_done;
74+ smp_ops.cpu_die = xen_hvm_cpu_die;
75+
76+ if (!xen_have_vector_callback) {
77+ nopvspin = true;
6878 return;
79+ }
6980
70− smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
7181 smp_ops.smp_send_reschedule = xen_smp_send_reschedule;
72− smp_ops.cpu_die = xen_hvm_cpu_die;
7382 smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
7483 smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
75− smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
76− smp_ops.smp_cpus_done = xen_smp_cpus_done;
7784 }
arch/xtensa/include/asm/Kbuild+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 generated-y += syscall_table.h
33 generic-y += extable.h
44 generic-y += kvm_para.h
5−generic-y += local64.h
65 generic-y += mcs_spinlock.h
76 generic-y += param.h
87 generic-y += qrwlock.h
block/bfq-iosched.c+4−4
@@ -6332,13 +6332,13 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, · 6331 unmodified lines
63326332 * limit 'something'.
63336333 */
63346334 /* no more than 50% of tags for async I/O */
6335− bfqd->word_depths[0][0] = max((1U << bt->sb.shift) >> 1, 1U);
6335+ bfqd->word_depths[0][0] = max(bt->sb.depth >> 1, 1U);
63366336 /*
63376337 * no more than 75% of tags for sync writes (25% extra tags
63386338 * w.r.t. async I/O, to prevent async I/O from starving sync
63396339 * writes)
63406340 */
6341− bfqd->word_depths[0][1] = max(((1U << bt->sb.shift) * 3) >> 2, 1U);
6341+ bfqd->word_depths[0][1] = max((bt->sb.depth * 3) >> 2, 1U);
63426342
63436343 /*
63446344 * In-word depths in case some bfq_queue is being weight-
@@ -6348,9 +6348,9 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, · 3 unmodified lines
63486348 * shortage.
63496349 */
63506350 /* no more than ~18% of tags for async I/O */
6351− bfqd->word_depths[1][0] = max(((1U << bt->sb.shift) * 3) >> 4, 1U);
6351+ bfqd->word_depths[1][0] = max((bt->sb.depth * 3) >> 4, 1U);
63526352 /* no more than ~37% of tags for sync writes (~20% extra tags) */
6353− bfqd->word_depths[1][1] = max(((1U << bt->sb.shift) * 6) >> 4, 1U);
6353+ bfqd->word_depths[1][1] = max((bt->sb.depth * 6) >> 4, 1U);
63546354
63556355 for (i = 0; i < 2; i++)
63566356 for (j = 0; j < 2; j++)
block/blk-core.c+7−6
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/bio.h>
1919 #include <linux/blkdev.h>
2020 #include <linux/blk-mq.h>
21+#include <linux/blk-pm.h>
2122 #include <linux/highmem.h>
2223 #include <linux/mm.h>
2324 #include <linux/pagemap.h>
@@ -424,11 +425,11 @@ EXPORT_SYMBOL(blk_cleanup_queue); · 400 unmodified lines
424425 /**
425426 * blk_queue_enter() - try to increase q->q_usage_counter
426427 * @q: request queue pointer
427− * @flags: BLK_MQ_REQ_NOWAIT and/or BLK_MQ_REQ_PREEMPT
428+ * @flags: BLK_MQ_REQ_NOWAIT and/or BLK_MQ_REQ_PM
428429 */
429430 int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
430431 {
431− const bool pm = flags & BLK_MQ_REQ_PREEMPT;
432+ const bool pm = flags & BLK_MQ_REQ_PM;
432433
433434 while (true) {
434435 bool success = false;
@@ -440,7 +441,8 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) · 5 unmodified lines
440441 * responsible for ensuring that that counter is
441442 * globally visible before the queue is unfrozen.
442443 */
443− if (pm || !blk_queue_pm_only(q)) {
444+ if ((pm && queue_rpm_status(q) != RPM_SUSPENDED) ||
445+ !blk_queue_pm_only(q)) {
444446 success = true;
445447 } else {
446448 percpu_ref_put(&q->q_usage_counter);
@@ -465,8 +467,7 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) · 18 unmodified lines
465467
466468 wait_event(q->mq_freeze_wq,
467469 (!q->mq_freeze_depth &&
468− (pm || (blk_pm_request_resume(q),
469− !blk_queue_pm_only(q)))) ||
470+ blk_pm_resume_queue(pm, q)) ||
470471 blk_queue_dying(q));
471472 if (blk_queue_dying(q))
472473 return -ENODEV;
@@ -630,7 +631,7 @@ struct request *blk_get_request(struct request_queue *q, unsigned int op, · 157 unmodified lines
630631 struct request *req;
631632
632633 WARN_ON_ONCE(op & REQ_NOWAIT);
633− WARN_ON_ONCE(flags & ~(BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_PREEMPT));
634+ WARN_ON_ONCE(flags & ~(BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_PM));
634635
635636 req = blk_mq_alloc_request(q, op, flags);
636637 if (!IS_ERR(req) && q->mq_ops->initialize_rq_fn)
block/blk-iocost.c+11−5
@@ -2551,8 +2551,8 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio) · 2550 unmodified lines
25512551 bool use_debt, ioc_locked;
25522552 unsigned long flags;
25532553
2554− /* bypass IOs if disabled or for root cgroup */
2555− if (!ioc->enabled || !iocg->level)
2554+ /* bypass IOs if disabled, still initializing, or for root cgroup */
2555+ if (!ioc->enabled || !iocg || !iocg->level)
25562556 return;
25572557
25582558 /* calculate the absolute vtime cost */
@@ -2679,14 +2679,14 @@ static void ioc_rqos_merge(struct rq_qos *rqos, struct request *rq, · 120 unmodified lines
26792679 struct bio *bio)
26802680 {
26812681 struct ioc_gq *iocg = blkg_to_iocg(bio->bi_blkg);
2682− struct ioc *ioc = iocg->ioc;
2682+ struct ioc *ioc = rqos_to_ioc(rqos);
26832683 sector_t bio_end = bio_end_sector(bio);
26842684 struct ioc_now now;
26852685 u64 vtime, abs_cost, cost;
26862686 unsigned long flags;
26872687
2688− /* bypass if disabled or for root cgroup */
2689− if (!ioc->enabled || !iocg->level)
2688+ /* bypass if disabled, still initializing, or for root cgroup */
2689+ if (!ioc->enabled || !iocg || !iocg->level)
26902690 return;
26912691
26922692 abs_cost = calc_vtime_cost(bio, iocg, true);
@@ -2863,6 +2863,12 @@ static int blk_iocost_init(struct request_queue *q) · 170 unmodified lines
28632863 ioc_refresh_params(ioc, true);
28642864 spin_unlock_irq(&ioc->lock);
28652865
2866+ /*
2867+ * rqos must be added before activation to allow iocg_pd_init() to
2868+ * lookup the ioc from q. This means that the rqos methods may get
2869+ * called before policy activation completion, can't assume that the
2870+ * target bio has an iocg associated and need to test for NULL iocg.
2871+ */
28662872 rq_qos_add(q, rqos);
28672873 ret = blkcg_activate_policy(q, &blkcg_policy_iocost);
28682874 if (ret) {
block/blk-mq-debugfs.c+2−1
@@ -129,6 +129,7 @@ static const char *const blk_queue_flag_name[] = { · 128 unmodified lines
129129 QUEUE_FLAG_NAME(PCI_P2PDMA),
130130 QUEUE_FLAG_NAME(ZONE_RESETALL),
131131 QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
132+ QUEUE_FLAG_NAME(NOWAIT),
132133 };
133134 #undef QUEUE_FLAG_NAME
134135
@@ -245,6 +246,7 @@ static const char *const hctx_flag_name[] = { · 110 unmodified lines
245246 HCTX_FLAG_NAME(BLOCKING),
246247 HCTX_FLAG_NAME(NO_SCHED),
247248 HCTX_FLAG_NAME(STACKING),
249+ HCTX_FLAG_NAME(TAG_HCTX_SHARED),
248250 };
249251 #undef HCTX_FLAG_NAME
250252
@@ -297,7 +299,6 @@ static const char *const rqf_name[] = { · 46 unmodified lines
297299 RQF_NAME(MIXED_MERGE),
298300 RQF_NAME(MQ_INFLIGHT),
299301 RQF_NAME(DONTPREP),
300− RQF_NAME(PREEMPT),
301302 RQF_NAME(FAILED),
302303 RQF_NAME(QUIET),
303304 RQF_NAME(ELVPRIV),
block/blk-mq.c+2−2
@@ -294,8 +294,8 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, · 293 unmodified lines
294294 rq->mq_hctx = data->hctx;
295295 rq->rq_flags = 0;
296296 rq->cmd_flags = data->cmd_flags;
297− if (data->flags & BLK_MQ_REQ_PREEMPT)
298− rq->rq_flags |= RQF_PREEMPT;
297+ if (data->flags & BLK_MQ_REQ_PM)
298+ rq->rq_flags |= RQF_PM;
299299 if (blk_queue_io_stat(data->q))
300300 rq->rq_flags |= RQF_IO_STAT;
301301 INIT_LIST_HEAD(&rq->queuelist);
block/blk-pm.c+9−6
@@ -67,6 +67,10 @@ int blk_pre_runtime_suspend(struct request_queue *q) · 66 unmodified lines
6767
6868 WARN_ON_ONCE(q->rpm_status != RPM_ACTIVE);
6969
70+ spin_lock_irq(&q->queue_lock);
71+ q->rpm_status = RPM_SUSPENDING;
72+ spin_unlock_irq(&q->queue_lock);
73+
7074 /*
7175 * Increase the pm_only counter before checking whether any
7276 * non-PM blk_queue_enter() calls are in progress to avoid that any
@@ -89,15 +93,14 @@ int blk_pre_runtime_suspend(struct request_queue *q) · 16 unmodified lines
8993 /* Switch q_usage_counter back to per-cpu mode. */
9094 blk_mq_unfreeze_queue(q);
9195
92− spin_lock_irq(&q->queue_lock);
93− if (ret < 0)
96+ if (ret < 0) {
97+ spin_lock_irq(&q->queue_lock);
98+ q->rpm_status = RPM_ACTIVE;
9499 pm_runtime_mark_last_busy(q->dev);
95− else
96− q->rpm_status = RPM_SUSPENDING;
97− spin_unlock_irq(&q->queue_lock);
100+ spin_unlock_irq(&q->queue_lock);
98101
99− if (ret)
100102 blk_clear_pm_only(q);
103+ }
101104
102105 return ret;
103106 }
block/blk-pm.h+9−5
@@ -6,11 +6,14 @@ · 5 unmodified lines
66 #include <linux/pm_runtime.h>
77
88 #ifdef CONFIG_PM
9−static inline void blk_pm_request_resume(struct request_queue *q)
9+static inline int blk_pm_resume_queue(const bool pm, struct request_queue *q)
1010 {
11− if (q->dev && (q->rpm_status == RPM_SUSPENDED ||
12− q->rpm_status == RPM_SUSPENDING))
13− pm_request_resume(q->dev);
11+ if (!q->dev || !blk_queue_pm_only(q))
12+ return 1; /* Nothing to do */
13+ if (pm && q->rpm_status != RPM_SUSPENDED)
14+ return 1; /* Request allowed */
15+ pm_request_resume(q->dev);
16+ return 0;
1417 }
1518
1619 static inline void blk_pm_mark_last_busy(struct request *rq)
@@ -44,8 +47,9 @@ static inline void blk_pm_put_request(struct request *rq) · 27 unmodified lines
4447 --rq->q->nr_pending;
4548 }
4649 #else
47−static inline void blk_pm_request_resume(struct request_queue *q)
50+static inline int blk_pm_resume_queue(const bool pm, struct request_queue *q)
4851 {
52+ return 1;
4953 }
5054
5155 static inline void blk_pm_mark_last_busy(struct request *rq)
block/genhd.c+7−4
@@ -246,15 +246,18 @@ struct block_device *disk_part_iter_next(struct disk_part_iter *piter) · 245 unmodified lines
246246 part = rcu_dereference(ptbl->part[piter->idx]);
247247 if (!part)
248248 continue;
249+ piter->part = bdgrab(part);
250+ if (!piter->part)
251+ continue;
249252 if (!bdev_nr_sectors(part) &&
250253 !(piter->flags & DISK_PITER_INCL_EMPTY) &&
251254 !(piter->flags & DISK_PITER_INCL_EMPTY_PART0 &&
252− piter->idx == 0))
255+ piter->idx == 0)) {
256+ bdput(piter->part);
257+ piter->part = NULL;
253258 continue;
259+ }
254260
255− piter->part = bdgrab(part);
256− if (!piter->part)
257− continue;
258261 piter->idx += inc;
259262 break;
260263 }
crypto/asymmetric_keys/asym_tpm.c+1−1
@@ -354,7 +354,7 @@ static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf) · 353 unmodified lines
354354 memcpy(cur, e, sizeof(e));
355355 cur += sizeof(e);
356356 /* Zero parameters to satisfy set_pub_key ABI. */
357− memset(cur, 0, SETKEY_PARAMS_SIZE);
357+ memzero_explicit(cur, SETKEY_PARAMS_SIZE);
358358
359359 return cur - buf;
360360 }
crypto/ecdh.c+2−1
@@ -39,7 +39,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, · 38 unmodified lines
3939 struct ecdh params;
4040 unsigned int ndigits;
4141
42− if (crypto_ecdh_decode_key(buf, len, &params) < 0)
42+ if (crypto_ecdh_decode_key(buf, len, &params) < 0 ||
43+ params.key_size > sizeof(ctx->private_key))
4344 return -EINVAL;
4445
4546 ndigits = ecdh_supported_curve(params.curve_id);
crypto/xor.c+2−0
@@ -107,6 +107,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) · 106 unmodified lines
107107 preempt_enable();
108108
109109 // bytes/ns == GB/s, multiply by 1000 to get MB/s [not MiB/s]
110+ if (!min)
111+ min = 1;
110112 speed = (1000 * REPS * BENCH_SIZE) / (unsigned int)ktime_to_ns(min);
111113 tmpl->speed = speed;
112114
drivers/acpi/Kconfig+0−6
@@ -395,9 +395,6 @@ config ACPI_CONTAINER · 394 unmodified lines
395395
396396 This helps support hotplug of nodes, CPUs, and memory.
397397
398− To compile this driver as a module, choose M here:
399− the module will be called container.
400−
401398 config ACPI_HOTPLUG_MEMORY
402399 bool "Memory Hotplug"
403400 depends on MEMORY_HOTPLUG
@@ -411,9 +408,6 @@ config ACPI_HOTPLUG_MEMORY · 7 unmodified lines
411408 removing memory devices at runtime, you need not enable
412409 this driver.
413410
414− To compile this driver as a module, choose M here:
415− the module will be called acpi_memhotplug.
416−
417411 config ACPI_HOTPLUG_IOAPIC
418412 bool
419413 depends on PCI
drivers/acpi/internal.h+1−1
@@ -97,7 +97,7 @@ void acpi_scan_table_handler(u32 event, void *table, void *context); · 96 unmodified lines
9797 extern struct list_head acpi_bus_id_list;
9898
9999 struct acpi_device_bus_id {
100− char bus_id[15];
100+ const char *bus_id;
101101 unsigned int instance_no;
102102 struct list_head node;
103103 };
drivers/acpi/scan.c+14−1
@@ -486,6 +486,7 @@ static void acpi_device_del(struct acpi_device *device) · 485 unmodified lines
486486 acpi_device_bus_id->instance_no--;
487487 else {
488488 list_del(&acpi_device_bus_id->node);
489+ kfree_const(acpi_device_bus_id->bus_id);
489490 kfree(acpi_device_bus_id);
490491 }
491492 break;
@@ -674,7 +675,14 @@ int acpi_device_add(struct acpi_device *device, · 182 unmodified lines
674675 }
675676 if (!found) {
676677 acpi_device_bus_id = new_bus_id;
677− strcpy(acpi_device_bus_id->bus_id, acpi_device_hid(device));
678+ acpi_device_bus_id->bus_id =
679+ kstrdup_const(acpi_device_hid(device), GFP_KERNEL);
680+ if (!acpi_device_bus_id->bus_id) {
681+ pr_err(PREFIX "Memory allocation error for bus id\n");
682+ result = -ENOMEM;
683+ goto err_free_new_bus_id;
684+ }
685+
678686 acpi_device_bus_id->instance_no = 0;
679687 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
680688 }
@@ -709,6 +717,11 @@ int acpi_device_add(struct acpi_device *device, · 28 unmodified lines
709717 if (device->parent)
710718 list_del(&device->node);
711719 list_del(&device->wakeup_list);
720+
721+ err_free_new_bus_id:
722+ if (!found)
723+ kfree(new_bus_id);
724+
712725 mutex_unlock(&acpi_device_lock);
713726
714727 err_detach:
drivers/acpi/x86/s2idle.c+1−13
@@ -105,18 +105,8 @@ static void lpi_device_get_constraints_amd(void) · 104 unmodified lines
105105
106106 for (i = 0; i < out_obj->package.count; i++) {
107107 union acpi_object *package = &out_obj->package.elements[i];
108− struct lpi_device_info_amd info = { };
109108
110− if (package->type == ACPI_TYPE_INTEGER) {
111− switch (i) {
112− case 0:
113− info.revision = package->integer.value;
114− break;
115− case 1:
116− info.count = package->integer.value;
117− break;
118− }
119− } else if (package->type == ACPI_TYPE_PACKAGE) {
109+ if (package->type == ACPI_TYPE_PACKAGE) {
120110 lpi_constraints_table = kcalloc(package->package.count,
121111 sizeof(*lpi_constraints_table),
122112 GFP_KERNEL);
@@ -135,12 +125,10 @@ static void lpi_device_get_constraints_amd(void) · 12 unmodified lines
135125
136126 for (k = 0; k < info_obj->package.count; ++k) {
137127 union acpi_object *obj = &info_obj->package.elements[k];
138− union acpi_object *obj_new;
139128
140129 list = &lpi_constraints_table[lpi_constraints_table_size];
141130 list->min_dstate = -1;
142131
143− obj_new = &obj[k];
144132 switch (k) {
145133 case 0:
146134 dev_info.enabled = obj->integer.value;
drivers/atm/idt77252.c+1−1
@@ -3607,7 +3607,7 @@ static int idt77252_init_one(struct pci_dev *pcidev, · 3606 unmodified lines
36073607
36083608 if ((err = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32)))) {
36093609 printk("idt77252: can't enable DMA for PCI device at %s\n", pci_name(pcidev));
3610− return err;
3610+ goto err_out_disable_pdev;
36113611 }
36123612
36133613 card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL);
drivers/base/core.c+8−1
@@ -4414,6 +4414,12 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode) · 4413 unmodified lines
44144414 *
44154415 * Set the device's firmware node pointer to @fwnode, but if a secondary
44164416 * firmware node of the device is present, preserve it.
4417+ *
4418+ * Valid fwnode cases are:
4419+ * - primary --> secondary --> -ENODEV
4420+ * - primary --> NULL
4421+ * - secondary --> -ENODEV
4422+ * - NULL
44174423 */
44184424 void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
44194425 {
@@ -4432,8 +4438,9 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) · 12 unmodified lines
44324438 } else {
44334439 if (fwnode_is_primary(fn)) {
44344440 dev->fwnode = fn->secondary;
4441+ /* Set fn->secondary = NULL, so fn remains the primary fwnode */
44354442 if (!(parent && fn == parent->fwnode))
4436− fn->secondary = ERR_PTR(-ENODEV);
4443+ fn->secondary = NULL;
44374444 } else {
44384445 dev->fwnode = NULL;
44394446 }
drivers/base/regmap/regmap-debugfs.c+7−2
@@ -582,8 +582,12 @@ void regmap_debugfs_init(struct regmap *map) · 581 unmodified lines
582582 devname = dev_name(map->dev);
583583
584584 if (name) {
585− map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
585+ if (!map->debugfs_name) {
586+ map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
586587 devname, name);
588+ if (!map->debugfs_name)
589+ return;
590+ }
587591 name = map->debugfs_name;
588592 } else {
589593 name = devname;
@@ -591,9 +595,10 @@ void regmap_debugfs_init(struct regmap *map) · 1 unmodified line
591595
592596 if (!strcmp(name, "dummy")) {
593597 kfree(map->debugfs_name);
594−
595598 map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d",
596599 dummy_index);
600+ if (!map->debugfs_name)
601+ return;
597602 name = map->debugfs_name;
598603 dummy_index++;
599604 }
drivers/block/Kconfig+1−0
@@ -445,6 +445,7 @@ config BLK_DEV_RBD · 444 unmodified lines
445445 config BLK_DEV_RSXX
446446 tristate "IBM Flash Adapter 900GB Full Height PCIe Device Driver"
447447 depends on PCI
448+ select CRC32
448449 help
449450 Device driver for IBM's high speed PCIe SSD
450451 storage device: Flash Adapter 900GB Full Height.
drivers/block/rnbd/Kconfig+1−0
@@ -7,6 +7,7 @@ config BLK_DEV_RNBD_CLIENT · 6 unmodified lines
77 tristate "RDMA Network Block Device driver client"
88 depends on INFINIBAND_RTRS_CLIENT
99 select BLK_DEV_RNBD
10+ select SG_POOL
1011 help
1112 RNBD client is a network block device driver using rdma transport.
1213
drivers/block/rnbd/README+1−0
@@ -90,3 +90,4 @@ Kleber Souza <kleber.souza@profitbricks.com> · 89 unmodified lines
9090 Lutz Pogrell <lutz.pogrell@cloud.ionos.com>
9191 Milind Dumbare <Milind.dumbare@gmail.com>
9292 Roman Penyaev <roman.penyaev@profitbricks.com>
93+Swapnil Ingle <ingleswapnil@gmail.com>
drivers/block/rnbd/rnbd-clt.c+9−9
@@ -375,12 +375,19 @@ static struct rnbd_iu *rnbd_get_iu(struct rnbd_clt_session *sess, · 374 unmodified lines
375375 init_waitqueue_head(&iu->comp.wait);
376376 iu->comp.errno = INT_MAX;
377377
378+ if (sg_alloc_table(&iu->sgt, 1, GFP_KERNEL)) {
379+ rnbd_put_permit(sess, permit);
380+ kfree(iu);
381+ return NULL;
382+ }
383+
378384 return iu;
379385 }
380386
381387 static void rnbd_put_iu(struct rnbd_clt_session *sess, struct rnbd_iu *iu)
382388 {
383389 if (atomic_dec_and_test(&iu->refcount)) {
390+ sg_free_table(&iu->sgt);
384391 rnbd_put_permit(sess, iu->permit);
385392 kfree(iu);
386393 }
@@ -487,8 +494,6 @@ static int send_msg_close(struct rnbd_clt_dev *dev, u32 device_id, bool wait) · 100 unmodified lines
487494 iu->buf = NULL;
488495 iu->dev = dev;
489496
490− sg_alloc_table(&iu->sgt, 1, GFP_KERNEL);
491−
492497 msg.hdr.type = cpu_to_le16(RNBD_MSG_CLOSE);
493498 msg.device_id = cpu_to_le32(device_id);
494499
@@ -502,7 +507,6 @@ static int send_msg_close(struct rnbd_clt_dev *dev, u32 device_id, bool wait) · 7 unmodified lines
502507 err = errno;
503508 }
504509
505− sg_free_table(&iu->sgt);
506510 rnbd_put_iu(sess, iu);
507511 return err;
508512 }
@@ -575,7 +579,6 @@ static int send_msg_open(struct rnbd_clt_dev *dev, bool wait) · 66 unmodified lines
575579 iu->buf = rsp;
576580 iu->dev = dev;
577581
578− sg_alloc_table(&iu->sgt, 1, GFP_KERNEL);
579582 sg_init_one(iu->sgt.sgl, rsp, sizeof(*rsp));
580583
581584 msg.hdr.type = cpu_to_le16(RNBD_MSG_OPEN);
@@ -594,7 +597,6 @@ static int send_msg_open(struct rnbd_clt_dev *dev, bool wait) · 12 unmodified lines
594597 err = errno;
595598 }
596599
597− sg_free_table(&iu->sgt);
598600 rnbd_put_iu(sess, iu);
599601 return err;
600602 }
@@ -622,8 +624,6 @@ static int send_msg_sess_info(struct rnbd_clt_session *sess, bool wait) · 21 unmodified lines
622624
623625 iu->buf = rsp;
624626 iu->sess = sess;
625−
626− sg_alloc_table(&iu->sgt, 1, GFP_KERNEL);
627627 sg_init_one(iu->sgt.sgl, rsp, sizeof(*rsp));
628628
629629 msg.hdr.type = cpu_to_le16(RNBD_MSG_SESS_INFO);
@@ -650,7 +650,6 @@ put_iu: · 20 unmodified lines
650650 } else {
651651 err = errno;
652652 }
653− sg_free_table(&iu->sgt);
654653 rnbd_put_iu(sess, iu);
655654 return err;
656655 }
@@ -1698,7 +1697,8 @@ static void rnbd_destroy_sessions(void) · 1041 unmodified lines
16981697 */
16991698
17001699 list_for_each_entry_safe(sess, sn, &sess_list, list) {
1701− WARN_ON(!rnbd_clt_get_sess(sess));
1700+ if (!rnbd_clt_get_sess(sess))
1701+ continue;
17021702 close_rtrs(sess);
17031703 list_for_each_entry_safe(dev, tn, &sess->devs_list, list) {
17041704 /*
drivers/block/rnbd/rnbd-srv.c+5−3
@@ -338,10 +338,12 @@ static int rnbd_srv_link_ev(struct rtrs_srv *rtrs, · 337 unmodified lines
338338
339339 void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev)
340340 {
341− mutex_lock(&sess_dev->sess->lock);
342− rnbd_srv_destroy_dev_session_sysfs(sess_dev);
343− mutex_unlock(&sess_dev->sess->lock);
341+ struct rnbd_srv_session *sess = sess_dev->sess;
342+
344343 sess_dev->keep_id = true;
344+ mutex_lock(&sess->lock);
345+ rnbd_srv_destroy_dev_session_sysfs(sess_dev);
346+ mutex_unlock(&sess->lock);
345347 }
346348
347349 static int process_msg_close(struct rtrs_srv *rtrs,
drivers/clk/tegra/clk-tegra30.c+2−0
@@ -1256,6 +1256,8 @@ static struct tegra_clk_init_table init_table[] __initdata = { · 1255 unmodified lines
12561256 { TEGRA30_CLK_I2S3_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
12571257 { TEGRA30_CLK_I2S4_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
12581258 { TEGRA30_CLK_VIMCLK_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
1259+ { TEGRA30_CLK_HDA, TEGRA30_CLK_PLL_P, 102000000, 0 },
1260+ { TEGRA30_CLK_HDA2CODEC_2X, TEGRA30_CLK_PLL_P, 48000000, 0 },
12591261 /* must be the last entry */
12601262 { TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
12611263 };
drivers/cpufreq/intel_pstate.c+3−13
@@ -76,11 +76,6 @@ static inline int ceiling_fp(int32_t x) · 75 unmodified lines
7676 return ret;
7777 }
7878
79−static inline int32_t percent_fp(int percent)
80−{
81− return div_fp(percent, 100);
82−}
83−
8479 static inline u64 mul_ext_fp(u64 x, u64 y)
8580 {
8681 return (x * y) >> EXT_FRAC_BITS;
@@ -91,11 +86,6 @@ static inline u64 div_ext_fp(u64 x, u64 y) · 4 unmodified lines
9186 return div64_u64(x << EXT_FRAC_BITS, y);
9287 }
9388
94−static inline int32_t percent_ext_fp(int percent)
95−{
96− return div_ext_fp(percent, 100);
97−}
98−
9989 /**
10090 * struct sample - Store performance sample
10191 * @core_avg_perf: Ratio of APERF/MPERF which is the actual average
@@ -2653,12 +2643,13 @@ static void intel_cpufreq_adjust_perf(unsigned int cpunum, · 2551 unmodified lines
26532643 unsigned long capacity)
26542644 {
26552645 struct cpudata *cpu = all_cpu_data[cpunum];
2646+ u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached);
26562647 int old_pstate = cpu->pstate.current_pstate;
26572648 int cap_pstate, min_pstate, max_pstate, target_pstate;
26582649
26592650 update_turbo_state();
2660− cap_pstate = global.turbo_disabled ? cpu->pstate.max_pstate :
2661− cpu->pstate.turbo_pstate;
2651+ cap_pstate = global.turbo_disabled ? HWP_GUARANTEED_PERF(hwp_cap) :
2652+ HWP_HIGHEST_PERF(hwp_cap);
26622653
26632654 /* Optimization: Avoid unnecessary divisions. */
26642655
@@ -3086,7 +3077,6 @@ static int __init intel_pstate_init(void) · 421 unmodified lines
30863077 intel_pstate.attr = hwp_cpufreq_attrs;
30873078 intel_cpufreq.attr = hwp_cpufreq_attrs;
30883079 intel_cpufreq.flags |= CPUFREQ_NEED_UPDATE_LIMITS;
3089− intel_cpufreq.fast_switch = NULL;
30903080 intel_cpufreq.adjust_perf = intel_cpufreq_adjust_perf;
30913081 if (!default_driver)
30923082 default_driver = &intel_pstate;
drivers/cpufreq/powernow-k8.c+3−6
@@ -878,9 +878,9 @@ static int get_transition_latency(struct powernow_k8_data *data) · 877 unmodified lines
878878
879879 /* Take a frequency, and issue the fid/vid transition command */
880880 static int transition_frequency_fidvid(struct powernow_k8_data *data,
881− unsigned int index)
881+ unsigned int index,
882+ struct cpufreq_policy *policy)
882883 {
883− struct cpufreq_policy *policy;
884884 u32 fid = 0;
885885 u32 vid = 0;
886886 int res;
@@ -912,9 +912,6 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, · 25 unmodified lines
912912 freqs.old = find_khz_freq_from_fid(data->currfid);
913913 freqs.new = find_khz_freq_from_fid(fid);
914914
915− policy = cpufreq_cpu_get(smp_processor_id());
916− cpufreq_cpu_put(policy);
917−
918915 cpufreq_freq_transition_begin(policy, &freqs);
919916 res = transition_fid_vid(data, fid, vid);
920917 cpufreq_freq_transition_end(policy, &freqs, res);
@@ -969,7 +966,7 @@ static long powernowk8_target_fn(void *arg) · 48 unmodified lines
969966
970967 powernow_k8_acpi_pst_values(data, newstate);
971968
972− ret = transition_frequency_fidvid(data, newstate);
969+ ret = transition_frequency_fidvid(data, newstate, pol);
973970
974971 if (ret) {
975972 pr_err("transition frequency failed\n");
drivers/crypto/Kconfig+1−0
@@ -366,6 +366,7 @@ if CRYPTO_DEV_OMAP · 365 unmodified lines
366366 config CRYPTO_DEV_OMAP_SHAM
367367 tristate "Support for OMAP MD5/SHA1/SHA2 hw accelerator"
368368 depends on ARCH_OMAP2PLUS
369+ select CRYPTO_ENGINE
369370 select CRYPTO_SHA1
370371 select CRYPTO_MD5
371372 select CRYPTO_SHA256
drivers/dma-buf/dma-buf.c+17−4
@@ -76,10 +76,6 @@ static void dma_buf_release(struct dentry *dentry) · 75 unmodified lines
7676
7777 dmabuf->ops->release(dmabuf);
7878
79− mutex_lock(&db_list.lock);
80− list_del(&dmabuf->list_node);
81− mutex_unlock(&db_list.lock);
82−
8379 if (dmabuf->resv == (struct dma_resv *)&dmabuf[1])
8480 dma_resv_fini(dmabuf->resv);
8581
@@ -88,6 +84,22 @@ static void dma_buf_release(struct dentry *dentry) · 2 unmodified lines
8884 kfree(dmabuf);
8985 }
9086
87+static int dma_buf_file_release(struct inode *inode, struct file *file)
88+{
89+ struct dma_buf *dmabuf;
90+
91+ if (!is_dma_buf_file(file))
92+ return -EINVAL;
93+
94+ dmabuf = file->private_data;
95+
96+ mutex_lock(&db_list.lock);
97+ list_del(&dmabuf->list_node);
98+ mutex_unlock(&db_list.lock);
99+
100+ return 0;
101+}
102+
91103 static const struct dentry_operations dma_buf_dentry_ops = {
92104 .d_dname = dmabuffs_dname,
93105 .d_release = dma_buf_release,
@@ -413,6 +425,7 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) · 319 unmodified lines
413425 }
414426
415427 static const struct file_operations dma_buf_fops = {
428+ .release = dma_buf_file_release,
416429 .mmap = dma_buf_mmap_internal,
417430 .llseek = dma_buf_llseek,
418431 .poll = dma_buf_poll,
drivers/dma-buf/heaps/cma_heap.c+3−0
@@ -251,6 +251,9 @@ static void cma_heap_dma_buf_release(struct dma_buf *dmabuf) · 250 unmodified lines
251251 buffer->vaddr = NULL;
252252 }
253253
254+ /* free page list */
255+ kfree(buffer->pages);
256+ /* release memory */
254257 cma_release(cma_heap->cma, buffer->cma_pages, buffer->pagecount);
255258 kfree(buffer);
256259 }
drivers/dma/dw-edma/dw-edma-core.c+2−2
@@ -86,12 +86,12 @@ static struct dw_edma_chunk *dw_edma_alloc_chunk(struct dw_edma_desc *desc) · 85 unmodified lines
8686
8787 if (desc->chunk) {
8888 /* Create and add new element into the linked list */
89− desc->chunks_alloc++;
90− list_add_tail(&chunk->list, &desc->chunk->list);
9189 if (!dw_edma_alloc_burst(chunk)) {
9290 kfree(chunk);
9391 return NULL;
9492 }
93+ desc->chunks_alloc++;
94+ list_add_tail(&chunk->list, &desc->chunk->list);
9595 } else {
9696 /* List head */
9797 chunk->burst = NULL;
drivers/dma/idxd/sysfs.c+2−2
@@ -434,7 +434,7 @@ int idxd_register_driver(void) · 433 unmodified lines
434434 return 0;
435435
436436 drv_fail:
437− for (; i > 0; i--)
437+ while (--i >= 0)
438438 driver_unregister(&idxd_drvs[i]->drv);
439439 return rc;
440440 }
@@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void) · 1399 unmodified lines
18401840 return 0;
18411841
18421842 bus_err:
1843− for (; i > 0; i--)
1843+ while (--i >= 0)
18441844 bus_unregister(idxd_bus_types[i]);
18451845 return rc;
18461846 }
drivers/dma/mediatek/mtk-hsdma.c+1−0
@@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev) · 1006 unmodified lines
10071007 return 0;
10081008
10091009 err_free:
1010+ mtk_hsdma_hw_deinit(hsdma);
10101011 of_dma_controller_free(pdev->dev.of_node);
10111012 err_unregister:
10121013 dma_async_device_unregister(dd);
drivers/dma/milbeaut-xdmac.c+3−1
@@ -350,7 +350,7 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev) · 349 unmodified lines
350350
351351 ret = dma_async_device_register(ddev);
352352 if (ret)
353− return ret;
353+ goto disable_xdmac;
354354
355355 ret = of_dma_controller_register(dev->of_node,
356356 of_dma_simple_xlate, mdev);
@@ -363,6 +363,8 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev) · 6 unmodified lines
363363
364364 unregister_dmac:
365365 dma_async_device_unregister(ddev);
366+disable_xdmac:
367+ disable_xdmac(mdev);
366368 return ret;
367369 }
368370
drivers/dma/qcom/bam_dma.c+1−5
@@ -630,7 +630,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, · 629 unmodified lines
630630 GFP_NOWAIT);
631631
632632 if (!async_desc)
633− goto err_out;
633+ return NULL;
634634
635635 if (flags & DMA_PREP_FENCE)
636636 async_desc->flags |= DESC_FLAG_NWD;
@@ -670,10 +670,6 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, · 33 unmodified lines
670670 }
671671
672672 return vchan_tx_prep(&bchan->vc, &async_desc->vd, flags);
673−
674−err_out:
675− kfree(async_desc);
676− return NULL;
677673 }
678674
679675 /**
drivers/dma/qcom/gpi.c+5−5
@@ -1416,7 +1416,7 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements, · 1415 unmodified lines
14161416 len = 1 << bit;
14171417 ring->alloc_size = (len + (len - 1));
14181418 dev_dbg(gpii->gpi_dev->dev,
1419− "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
1419+ "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%zu\n",
14201420 elements, el_size, (elements * el_size), len,
14211421 ring->alloc_size);
14221422
@@ -1424,7 +1424,7 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements, · 1 unmodified line
14241424 ring->alloc_size,
14251425 &ring->dma_handle, GFP_KERNEL);
14261426 if (!ring->pre_aligned) {
1427− dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
1427+ dev_err(gpii->gpi_dev->dev, "could not alloc size:%zu mem for ring\n",
14281428 ring->alloc_size);
14291429 return -ENOMEM;
14301430 }
@@ -1444,8 +1444,8 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements, · 13 unmodified lines
14441444 smp_wmb();
14451445
14461446 dev_dbg(gpii->gpi_dev->dev,
1447− "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
1448− ring->dma_handle, ring->phys_addr, ring->len,
1447+ "phy_pre:%pad phy_alig:%pa len:%u el_size:%u elements:%u\n",
1448+ &ring->dma_handle, &ring->phys_addr, ring->len,
14491449 ring->el_size, ring->elements);
14501450
14511451 return 0;
@@ -1948,7 +1948,7 @@ static int gpi_ch_init(struct gchan *gchan) · 496 unmodified lines
19481948 return ret;
19491949
19501950 error_start_chan:
1951− for (i = i - 1; i >= 0; i++) {
1951+ for (i = i - 1; i >= 0; i--) {
19521952 gpi_stop_chan(&gpii->gchan[i]);
19531953 gpi_send_cmd(gpii, gchan, GPI_CH_CMD_RESET);
19541954 }
drivers/dma/stm32-mdma.c+1−1
@@ -199,7 +199,7 @@ · 198 unmodified lines
199199 #define STM32_MDMA_MAX_CHANNELS 63
200200 #define STM32_MDMA_MAX_REQUESTS 256
201201 #define STM32_MDMA_MAX_BURST 128
202−#define STM32_MDMA_VERY_HIGH_PRIORITY 0x11
202+#define STM32_MDMA_VERY_HIGH_PRIORITY 0x3
203203
204204 enum stm32_mdma_trigger_mode {
205205 STM32_MDMA_BUFFER,
drivers/dma/ti/k3-udma.c+3−3
@@ -4698,9 +4698,9 @@ static int pktdma_setup_resources(struct udma_dev *ud) · 4697 unmodified lines
46984698 ud->tchan_tpl.levels = 1;
46994699 }
47004700
4701− ud->tchan_tpl.levels = ud->tchan_tpl.levels;
4702− ud->tchan_tpl.start_idx[0] = ud->tchan_tpl.start_idx[0];
4703− ud->tchan_tpl.start_idx[1] = ud->tchan_tpl.start_idx[1];
4701+ ud->rchan_tpl.levels = ud->tchan_tpl.levels;
4702+ ud->rchan_tpl.start_idx[0] = ud->tchan_tpl.start_idx[0];
4703+ ud->rchan_tpl.start_idx[1] = ud->tchan_tpl.start_idx[1];
47044704
47054705 ud->tchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tchan_cnt),
47064706 sizeof(unsigned long), GFP_KERNEL);
drivers/dma/xilinx/xilinx_dma.c+8−3
@@ -2781,7 +2781,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, · 2780 unmodified lines
27812781 has_dre = false;
27822782
27832783 if (!has_dre)
2784− xdev->common.copy_align = fls(width - 1);
2784+ xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1);
27852785
27862786 if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") ||
27872787 of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") ||
@@ -2900,7 +2900,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, · 112 unmodified lines
29002900 static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev,
29012901 struct device_node *node)
29022902 {
2903− int ret, i, nr_channels = 1;
2903+ int ret, i;
2904+ u32 nr_channels = 1;
29042905
29052906 ret = of_property_read_u32(node, "dma-channels", &nr_channels);
29062907 if (xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA && ret < 0)
@@ -3112,7 +3113,11 @@ static int xilinx_dma_probe(struct platform_device *pdev) · 205 unmodified lines
31123113 }
31133114
31143115 /* Register the DMA engine with the core */
3115− dma_async_device_register(&xdev->common);
3116+ err = dma_async_device_register(&xdev->common);
3117+ if (err) {
3118+ dev_err(xdev->dev, "failed to register the dma device\n");
3119+ goto error;
3120+ }
31163121
31173122 err = of_dma_controller_register(node, of_dma_xilinx_xlate,
31183123 xdev);
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c+36−17
@@ -112,6 +112,7 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) · 111 unmodified lines
112112 union igp_info {
113113 struct atom_integrated_system_info_v1_11 v11;
114114 struct atom_integrated_system_info_v1_12 v12;
115+ struct atom_integrated_system_info_v2_1 v21;
115116 };
116117
117118 union umc_info {
@@ -209,24 +210,42 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, · 91 unmodified lines
209210 if (adev->flags & AMD_IS_APU) {
210211 igp_info = (union igp_info *)
211212 (mode_info->atom_context->bios + data_offset);
212− switch (crev) {
213− case 11:
214− mem_channel_number = igp_info->v11.umachannelnumber;
215− /* channel width is 64 */
216− if (vram_width)
217− *vram_width = mem_channel_number * 64;
218− mem_type = igp_info->v11.memorytype;
219− if (vram_type)
220− *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
213+ switch (frev) {
214+ case 1:
215+ switch (crev) {
216+ case 11:
217+ case 12:
218+ mem_channel_number = igp_info->v11.umachannelnumber;
219+ if (!mem_channel_number)
220+ mem_channel_number = 1;
221+ /* channel width is 64 */
222+ if (vram_width)
223+ *vram_width = mem_channel_number * 64;
224+ mem_type = igp_info->v11.memorytype;
225+ if (vram_type)
226+ *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
227+ break;
228+ default:
229+ return -EINVAL;
230+ }
221231 break;
222− case 12:
223− mem_channel_number = igp_info->v12.umachannelnumber;
224− /* channel width is 64 */
225− if (vram_width)
226− *vram_width = mem_channel_number * 64;
227− mem_type = igp_info->v12.memorytype;
228− if (vram_type)
229− *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
232+ case 2:
233+ switch (crev) {
234+ case 1:
235+ case 2:
236+ mem_channel_number = igp_info->v21.umachannelnumber;
237+ if (!mem_channel_number)
238+ mem_channel_number = 1;
239+ /* channel width is 64 */
240+ if (vram_width)
241+ *vram_width = mem_channel_number * 64;
242+ mem_type = igp_info->v21.memorytype;
243+ if (vram_type)
244+ *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
245+ break;
246+ default:
247+ return -EINVAL;
248+ }
230249 break;
231250 default:
232251 return -EINVAL;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+3−3
@@ -2548,11 +2548,11 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) · 2547 unmodified lines
25482548 if (adev->gmc.xgmi.num_physical_nodes > 1)
25492549 amdgpu_xgmi_remove_device(adev);
25502550
2551− amdgpu_amdkfd_device_fini(adev);
2552−
25532551 amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
25542552 amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
25552553
2554+ amdgpu_amdkfd_device_fini(adev);
2555+
25562556 /* need to disable SMC first */
25572557 for (i = 0; i < adev->num_ip_blocks; i++) {
25582558 if (!adev->ip_blocks[i].status.hw)
@@ -3034,7 +3034,7 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) · 475 unmodified lines
30343034 #endif
30353035 default:
30363036 if (amdgpu_dc > 0)
3037− DRM_INFO("Display Core has been requested via kernel parameter "
3037+ DRM_INFO_ONCE("Display Core has been requested via kernel parameter "
30383038 "but isn't supported by ASIC, ignoring\n");
30393039 return false;
30403040 }
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+2−0
@@ -1085,6 +1085,8 @@ static const struct pci_device_id pciidlist[] = { · 1084 unmodified lines
10851085
10861086 /* Renoir */
10871087 {0x1002, 0x1636, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
1088+ {0x1002, 0x1638, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
1089+ {0x1002, 0x164C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
10881090
10891091 /* Navi12 */
10901092 {0x1002, 0x7360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12},
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+17−8
@@ -563,7 +563,7 @@ static int psp_asd_load(struct psp_context *psp) · 562 unmodified lines
563563 * add workaround to bypass it for sriov now.
564564 * TODO: add version check to make it common
565565 */
566− if (amdgpu_sriov_vf(psp->adev) || !psp->asd_fw)
566+ if (amdgpu_sriov_vf(psp->adev) || !psp->asd_ucode_size)
567567 return 0;
568568
569569 cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
@@ -1315,8 +1315,12 @@ static int psp_hdcp_terminate(struct psp_context *psp) · 745 unmodified lines
13151315 if (amdgpu_sriov_vf(psp->adev))
13161316 return 0;
13171317
1318− if (!psp->hdcp_context.hdcp_initialized)
1319− return 0;
1318+ if (!psp->hdcp_context.hdcp_initialized) {
1319+ if (psp->hdcp_context.hdcp_shared_buf)
1320+ goto out;
1321+ else
1322+ return 0;
1323+ }
13201324
13211325 ret = psp_hdcp_unload(psp);
13221326 if (ret)
@@ -1324,6 +1328,7 @@ static int psp_hdcp_terminate(struct psp_context *psp) · 1 unmodified line
13241328
13251329 psp->hdcp_context.hdcp_initialized = false;
13261330
1331+out:
13271332 /* free hdcp shared memory */
13281333 amdgpu_bo_free_kernel(&psp->hdcp_context.hdcp_shared_bo,
13291334 &psp->hdcp_context.hdcp_shared_mc_addr,
@@ -1462,8 +1467,12 @@ static int psp_dtm_terminate(struct psp_context *psp) · 132 unmodified lines
14621467 if (amdgpu_sriov_vf(psp->adev))
14631468 return 0;
14641469
1465− if (!psp->dtm_context.dtm_initialized)
1466− return 0;
1470+ if (!psp->dtm_context.dtm_initialized) {
1471+ if (psp->dtm_context.dtm_shared_buf)
1472+ goto out;
1473+ else
1474+ return 0;
1475+ }
14671476
14681477 ret = psp_dtm_unload(psp);
14691478 if (ret)
@@ -1471,6 +1480,7 @@ static int psp_dtm_terminate(struct psp_context *psp) · 1 unmodified line
14711480
14721481 psp->dtm_context.dtm_initialized = false;
14731482
1483+out:
14741484 /* free hdcp shared memory */
14751485 amdgpu_bo_free_kernel(&psp->dtm_context.dtm_shared_bo,
14761486 &psp->dtm_context.dtm_shared_mc_addr,
@@ -2589,11 +2599,10 @@ static int parse_ta_bin_descriptor(struct psp_context *psp, · 1112 unmodified lines
25892599
25902600 switch (desc->fw_type) {
25912601 case TA_FW_TYPE_PSP_ASD:
2592− psp->asd_fw_version = le32_to_cpu(desc->fw_version);
2602+ psp->asd_fw_version = le32_to_cpu(desc->fw_version);
25932603 psp->asd_feature_version = le32_to_cpu(desc->fw_version);
2594− psp->asd_ucode_size = le32_to_cpu(desc->size_bytes);
2604+ psp->asd_ucode_size = le32_to_cpu(desc->size_bytes);
25952605 psp->asd_start_addr = ucode_start_addr;
2596− psp->asd_fw = psp->ta_fw;
25972606 break;
25982607 case TA_FW_TYPE_PSP_XGMI:
25992608 psp->ta_xgmi_ucode_version = le32_to_cpu(desc->fw_version);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c+4−4
@@ -1518,7 +1518,7 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, · 1517 unmodified lines
15181518 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
15191519 struct ras_err_handler_data *data;
15201520 int i = 0;
1521− int ret = 0;
1521+ int ret = 0, status;
15221522
15231523 if (!con || !con->eh_data || !bps || !count)
15241524 return -EINVAL;
@@ -1543,12 +1543,12 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, · 18 unmodified lines
15431543 .size = AMDGPU_GPU_PAGE_SIZE,
15441544 .flags = AMDGPU_RAS_RETIRE_PAGE_RESERVED,
15451545 };
1546− ret = amdgpu_vram_mgr_query_page_status(
1546+ status = amdgpu_vram_mgr_query_page_status(
15471547 ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM),
15481548 data->bps[i].retired_page);
1549− if (ret == -EBUSY)
1549+ if (status == -EBUSY)
15501550 (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_PENDING;
1551− else if (ret == -ENOENT)
1551+ else if (status == -ENOENT)
15521552 (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_FAULT;
15531553 }
15541554
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c+7−1
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #define EEPROM_I2C_TARGET_ADDR_VEGA20 0xA0
3131 #define EEPROM_I2C_TARGET_ADDR_ARCTURUS 0xA8
3232 #define EEPROM_I2C_TARGET_ADDR_ARCTURUS_D342 0xA0
33+#define EEPROM_I2C_TARGET_ADDR_SIENNA_CICHLID 0xA0
3334
3435 /*
3536 * The 2 macros bellow represent the actual size in bytes that
@@ -62,7 +63,8 @@ · 26 unmodified lines
6263 static bool __is_ras_eeprom_supported(struct amdgpu_device *adev)
6364 {
6465 if ((adev->asic_type == CHIP_VEGA20) ||
65− (adev->asic_type == CHIP_ARCTURUS))
66+ (adev->asic_type == CHIP_ARCTURUS) ||
67+ (adev->asic_type == CHIP_SIENNA_CICHLID))
6668 return true;
6769
6870 return false;
@@ -100,6 +102,10 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev, · 31 unmodified lines
100102 case CHIP_ARCTURUS:
101103 return __get_eeprom_i2c_addr_arct(adev, i2c_addr);
102104
105+ case CHIP_SIENNA_CICHLID:
106+ *i2c_addr = EEPROM_I2C_TARGET_ADDR_SIENNA_CICHLID;
107+ break;
108+
103109 default:
104110 return false;
105111 }
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+46−2
@@ -99,6 +99,10 @@ · 98 unmodified lines
9999 #define mmGCR_GENERAL_CNTL_Sienna_Cichlid 0x1580
100100 #define mmGCR_GENERAL_CNTL_Sienna_Cichlid_BASE_IDX 0
101101
102+#define mmGOLDEN_TSC_COUNT_UPPER_Vangogh 0x0025
103+#define mmGOLDEN_TSC_COUNT_UPPER_Vangogh_BASE_IDX 1
104+#define mmGOLDEN_TSC_COUNT_LOWER_Vangogh 0x0026
105+#define mmGOLDEN_TSC_COUNT_LOWER_Vangogh_BASE_IDX 1
102106 #define mmSPI_CONFIG_CNTL_1_Vangogh 0x2441
103107 #define mmSPI_CONFIG_CNTL_1_Vangogh_BASE_IDX 1
104108 #define mmVGT_TF_MEMORY_BASE_HI_Vangogh 0x2261
@@ -160,6 +164,9 @@ · 55 unmodified lines
160164 #define mmGCVM_L2_CGTT_CLK_CTRL_Sienna_Cichlid 0x15db
161165 #define mmGCVM_L2_CGTT_CLK_CTRL_Sienna_Cichlid_BASE_IDX 0
162166
167+#define mmGC_THROTTLE_CTRL_Sienna_Cichlid 0x2030
168+#define mmGC_THROTTLE_CTRL_Sienna_Cichlid_BASE_IDX 0
169+
163170 MODULE_FIRMWARE("amdgpu/navi10_ce.bin");
164171 MODULE_FIRMWARE("amdgpu/navi10_pfp.bin");
165172 MODULE_FIRMWARE("amdgpu/navi10_me.bin");
@@ -3324,6 +3331,7 @@ static void gfx_v10_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume); · 3158 unmodified lines
33243331 static void gfx_v10_0_ring_emit_frame_cntl(struct amdgpu_ring *ring, bool start, bool secure);
33253332 static u32 gfx_v10_3_get_disabled_sa(struct amdgpu_device *adev);
33263333 static void gfx_v10_3_program_pbb_mode(struct amdgpu_device *adev);
3334+static void gfx_v10_3_set_power_brake_sequence(struct amdgpu_device *adev);
33273335
33283336 static void gfx10_kiq_set_resources(struct amdgpu_ring *kiq_ring, uint64_t queue_mask)
33293337 {
@@ -7192,6 +7200,9 @@ static int gfx_v10_0_hw_init(void *handle) · 3862 unmodified lines
71927200 if (adev->asic_type == CHIP_SIENNA_CICHLID)
71937201 gfx_v10_3_program_pbb_mode(adev);
71947202
7203+ if (adev->asic_type >= CHIP_SIENNA_CICHLID)
7204+ gfx_v10_3_set_power_brake_sequence(adev);
7205+
71957206 return r;
71967207 }
71977208
@@ -7377,8 +7388,16 @@ static uint64_t gfx_v10_0_get_gpu_clock_counter(struct amdgpu_device *adev) · 179 unmodified lines
73777388
73787389 amdgpu_gfx_off_ctrl(adev, false);
73797390 mutex_lock(&adev->gfx.gpu_clock_mutex);
7380− clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER) |
7381− ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER) << 32ULL);
7391+ switch (adev->asic_type) {
7392+ case CHIP_VANGOGH:
7393+ clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh) |
7394+ ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh) << 32ULL);
7395+ break;
7396+ default:
7397+ clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER) |
7398+ ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER) << 32ULL);
7399+ break;
7400+ }
73827401 mutex_unlock(&adev->gfx.gpu_clock_mutex);
73837402 amdgpu_gfx_off_ctrl(adev, true);
73847403 return clock;
@@ -9169,6 +9188,31 @@ static void gfx_v10_3_program_pbb_mode(struct amdgpu_device *adev) · 1784 unmodified lines
91699188 }
91709189 }
91719190
9191+static void gfx_v10_3_set_power_brake_sequence(struct amdgpu_device *adev)
9192+{
9193+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX,
9194+ (0x1 << GRBM_GFX_INDEX__SA_BROADCAST_WRITES__SHIFT) |
9195+ (0x1 << GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES__SHIFT) |
9196+ (0x1 << GRBM_GFX_INDEX__SE_BROADCAST_WRITES__SHIFT));
9197+
9198+ WREG32_SOC15(GC, 0, mmGC_CAC_IND_INDEX, ixPWRBRK_STALL_PATTERN_CTRL);
9199+ WREG32_SOC15(GC, 0, mmGC_CAC_IND_DATA,
9200+ (0x1 << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_STEP_INTERVAL__SHIFT) |
9201+ (0x12 << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_BEGIN_STEP__SHIFT) |
9202+ (0x13 << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_END_STEP__SHIFT) |
9203+ (0xf << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_THROTTLE_PATTERN_BIT_NUMS__SHIFT));
9204+
9205+ WREG32_SOC15(GC, 0, mmGC_THROTTLE_CTRL_Sienna_Cichlid,
9206+ (0x1 << GC_THROTTLE_CTRL__PWRBRK_STALL_EN__SHIFT) |
9207+ (0x1 << GC_THROTTLE_CTRL__PATTERN_MODE__SHIFT) |
9208+ (0x5 << GC_THROTTLE_CTRL__RELEASE_STEP_INTERVAL__SHIFT));
9209+
9210+ WREG32_SOC15(GC, 0, mmDIDT_IND_INDEX, ixDIDT_SQ_THROTTLE_CTRL);
9211+
9212+ WREG32_SOC15(GC, 0, mmDIDT_IND_DATA,
9213+ (0x1 << DIDT_SQ_THROTTLE_CTRL__PWRBRK_STALL_EN__SHIFT));
9214+}
9215+
91729216 const struct amdgpu_ip_block_version gfx_v10_0_ip_block =
91739217 {
91749218 .type = AMD_IP_BLOCK_TYPE_GFX,
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c+1−1
@@ -310,7 +310,7 @@ static void mmhub_v2_3_setup_vmid_config(struct amdgpu_device *adev) · 309 unmodified lines
310310 /* Send no-retry XNACK on fault to suppress VM fault storm. */
311311 tmp = REG_SET_FIELD(tmp, MMVM_CONTEXT1_CNTL,
312312 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
313− !amdgpu_noretry);
313+ !adev->gmc.noretry);
314314 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_CNTL,
315315 i * hub->ctx_distance, tmp);
316316 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h+1−1
@@ -47,7 +47,7 @@ enum psp_gfx_crtl_cmd_id · 46 unmodified lines
4747 GFX_CTRL_CMD_ID_DISABLE_INT = 0x00060000, /* disable PSP-to-Gfx interrupt */
4848 GFX_CTRL_CMD_ID_MODE1_RST = 0x00070000, /* trigger the Mode 1 reset */
4949 GFX_CTRL_CMD_ID_GBR_IH_SET = 0x00080000, /* set Gbr IH_RB_CNTL registers */
50− GFX_CTRL_CMD_ID_CONSUME_CMD = 0x000A0000, /* send interrupt to psp for updating write pointer of vf */
50+ GFX_CTRL_CMD_ID_CONSUME_CMD = 0x00090000, /* send interrupt to psp for updating write pointer of vf */
5151 GFX_CTRL_CMD_ID_DESTROY_GPCOM_RING = 0x000C0000, /* destroy GPCOM ring */
5252
5353 GFX_CTRL_CMD_ID_MAX = 0x000F0000, /* max command ID */
drivers/gpu/drm/amd/amdgpu/soc15.c+2−1
@@ -1239,7 +1239,8 @@ static int soc15_common_early_init(void *handle) · 1238 unmodified lines
12391239 break;
12401240 case CHIP_RENOIR:
12411241 adev->asic_funcs = &soc15_asic_funcs;
1242− if (adev->pdev->device == 0x1636)
1242+ if ((adev->pdev->device == 0x1636) ||
1243+ (adev->pdev->device == 0x164c))
12431244 adev->apu_flags |= AMD_APU_IS_RENOIR;
12441245 else
12451246 adev->apu_flags |= AMD_APU_IS_GREEN_SARDINE;
drivers/gpu/drm/amd/amdkfd/kfd_crat.c+7−4
@@ -1040,11 +1040,14 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 1039 unmodified lines
10401040 (struct crat_subtype_iolink *)sub_type_hdr);
10411041 if (ret < 0)
10421042 return ret;
1043− crat_table->length += (sub_type_hdr->length * entries);
1044− crat_table->total_entries += entries;
10451043
1046− sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +
1047− sub_type_hdr->length * entries);
1044+ if (entries) {
1045+ crat_table->length += (sub_type_hdr->length * entries);
1046+ crat_table->total_entries += entries;
1047+
1048+ sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +
1049+ sub_type_hdr->length * entries);
1050+ }
10481051 #else
10491052 pr_info("IO link not available for non x86 platforms\n");
10501053 #endif
drivers/gpu/drm/amd/display/Kconfig+1−1
@@ -6,7 +6,7 @@ config DRM_AMD_DC · 5 unmodified lines
66 bool "AMD DC - Enable new display engine"
77 default y
88 select SND_HDA_COMPONENT if SND_HDA_CORE
9− select DRM_AMD_DC_DCN if (X86 || PPC64 || (ARM64 && KERNEL_MODE_NEON)) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
9+ select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
1010 help
1111 Choose this option if you want to use the new display engine
1212 support for AMDGPU. This adds required support for Vega and
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+9−136
@@ -939,41 +939,6 @@ static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_ · 938 unmodified lines
939939 }
940940 #endif
941941
942−#ifdef CONFIG_DEBUG_FS
943−static int create_crtc_crc_properties(struct amdgpu_display_manager *dm)
944−{
945− dm->crc_win_x_start_property =
946− drm_property_create_range(adev_to_drm(dm->adev),
947− DRM_MODE_PROP_ATOMIC,
948− "AMD_CRC_WIN_X_START", 0, U16_MAX);
949− if (!dm->crc_win_x_start_property)
950− return -ENOMEM;
951−
952− dm->crc_win_y_start_property =
953− drm_property_create_range(adev_to_drm(dm->adev),
954− DRM_MODE_PROP_ATOMIC,
955− "AMD_CRC_WIN_Y_START", 0, U16_MAX);
956− if (!dm->crc_win_y_start_property)
957− return -ENOMEM;
958−
959− dm->crc_win_x_end_property =
960− drm_property_create_range(adev_to_drm(dm->adev),
961− DRM_MODE_PROP_ATOMIC,
962− "AMD_CRC_WIN_X_END", 0, U16_MAX);
963− if (!dm->crc_win_x_end_property)
964− return -ENOMEM;
965−
966− dm->crc_win_y_end_property =
967− drm_property_create_range(adev_to_drm(dm->adev),
968− DRM_MODE_PROP_ATOMIC,
969− "AMD_CRC_WIN_Y_END", 0, U16_MAX);
970− if (!dm->crc_win_y_end_property)
971− return -ENOMEM;
972−
973− return 0;
974−}
975−#endif
976−
977942 static int amdgpu_dm_init(struct amdgpu_device *adev)
978943 {
979944 struct dc_init_data init_data;
@@ -1120,10 +1085,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 140 unmodified lines
11201085
11211086 dc_init_callbacks(adev->dm.dc, &init_params);
11221087 }
1123−#endif
1124−#ifdef CONFIG_DEBUG_FS
1125− if (create_crtc_crc_properties(&adev->dm))
1126− DRM_ERROR("amdgpu: failed to create crc property.\n");
11271088 #endif
11281089 if (amdgpu_dm_initialize_drm_device(adev)) {
11291090 DRM_ERROR(
@@ -2386,8 +2347,7 @@ void amdgpu_dm_update_connector_after_detect( · 1256 unmodified lines
23862347
23872348 drm_connector_update_edid_property(connector,
23882349 aconnector->edid);
2389− aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);
2390− drm_connector_list_update(connector);
2350+ drm_add_edid_modes(connector, aconnector->edid);
23912351
23922352 if (aconnector->dc_link->aux_mode)
23932353 drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
@@ -5334,64 +5294,12 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc) · 2940 unmodified lines
53345294 state->crc_src = cur->crc_src;
53355295 state->cm_has_degamma = cur->cm_has_degamma;
53365296 state->cm_is_degamma_srgb = cur->cm_is_degamma_srgb;
5337−#ifdef CONFIG_DEBUG_FS
5338− state->crc_window = cur->crc_window;
5339−#endif
5297+
53405298 /* TODO Duplicate dc_stream after objects are stream object is flattened */
53415299
53425300 return &state->base;
53435301 }
53445302
5345−#ifdef CONFIG_DEBUG_FS
5346−static int amdgpu_dm_crtc_atomic_set_property(struct drm_crtc *crtc,
5347− struct drm_crtc_state *crtc_state,
5348− struct drm_property *property,
5349− uint64_t val)
5350−{
5351− struct drm_device *dev = crtc->dev;
5352− struct amdgpu_device *adev = drm_to_adev(dev);
5353− struct dm_crtc_state *dm_new_state =
5354− to_dm_crtc_state(crtc_state);
5355−
5356− if (property == adev->dm.crc_win_x_start_property)
5357− dm_new_state->crc_window.x_start = val;
5358− else if (property == adev->dm.crc_win_y_start_property)
5359− dm_new_state->crc_window.y_start = val;
5360− else if (property == adev->dm.crc_win_x_end_property)
5361− dm_new_state->crc_window.x_end = val;
5362− else if (property == adev->dm.crc_win_y_end_property)
5363− dm_new_state->crc_window.y_end = val;
5364− else
5365− return -EINVAL;
5366−
5367− return 0;
5368−}
5369−
5370−static int amdgpu_dm_crtc_atomic_get_property(struct drm_crtc *crtc,
5371− const struct drm_crtc_state *state,
5372− struct drm_property *property,
5373− uint64_t *val)
5374−{
5375− struct drm_device *dev = crtc->dev;
5376− struct amdgpu_device *adev = drm_to_adev(dev);
5377− struct dm_crtc_state *dm_state =
5378− to_dm_crtc_state(state);
5379−
5380− if (property == adev->dm.crc_win_x_start_property)
5381− *val = dm_state->crc_window.x_start;
5382− else if (property == adev->dm.crc_win_y_start_property)
5383− *val = dm_state->crc_window.y_start;
5384− else if (property == adev->dm.crc_win_x_end_property)
5385− *val = dm_state->crc_window.x_end;
5386− else if (property == adev->dm.crc_win_y_end_property)
5387− *val = dm_state->crc_window.y_end;
5388− else
5389− return -EINVAL;
5390−
5391− return 0;
5392−}
5393−#endif
5394−
53955303 static inline int dm_set_vupdate_irq(struct drm_crtc *crtc, bool enable)
53965304 {
53975305 enum dc_irq_source irq_source;
@@ -5458,10 +5366,6 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { · 60 unmodified lines
54585366 .enable_vblank = dm_enable_vblank,
54595367 .disable_vblank = dm_disable_vblank,
54605368 .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp,
5461−#ifdef CONFIG_DEBUG_FS
5462− .atomic_set_property = amdgpu_dm_crtc_atomic_set_property,
5463− .atomic_get_property = amdgpu_dm_crtc_atomic_get_property,
5464−#endif
54655369 };
54665370
54675371 static enum drm_connector_status
@@ -6663,25 +6567,6 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · 1195 unmodified lines
66636567 return 0;
66646568 }
66656569
6666−#ifdef CONFIG_DEBUG_FS
6667−static void attach_crtc_crc_properties(struct amdgpu_display_manager *dm,
6668− struct amdgpu_crtc *acrtc)
6669−{
6670− drm_object_attach_property(&acrtc->base.base,
6671− dm->crc_win_x_start_property,
6672− 0);
6673− drm_object_attach_property(&acrtc->base.base,
6674− dm->crc_win_y_start_property,
6675− 0);
6676− drm_object_attach_property(&acrtc->base.base,
6677− dm->crc_win_x_end_property,
6678− 0);
6679− drm_object_attach_property(&acrtc->base.base,
6680− dm->crc_win_y_end_property,
6681− 0);
6682−}
6683−#endif
6684−
66856570 static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
66866571 struct drm_plane *plane,
66876572 uint32_t crtc_index)
@@ -6729,9 +6614,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 41 unmodified lines
67296614 drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
67306615 true, MAX_COLOR_LUT_ENTRIES);
67316616 drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
6732−#ifdef CONFIG_DEBUG_FS
6733− attach_crtc_crc_properties(dm, acrtc);
6734−#endif
6617+
67356618 return 0;
67366619
67376620 fail:
@@ -8368,7 +8251,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 1630 unmodified lines
83688251 */
83698252 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
83708253 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
8371− bool configure_crc = false;
83728254
83738255 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
83748256
@@ -8378,30 +8260,21 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 3 unmodified lines
83788260 dc_stream_retain(dm_new_crtc_state->stream);
83798261 acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;
83808262 manage_dm_interrupts(adev, acrtc, true);
8381− }
8263+
83828264 #ifdef CONFIG_DEBUG_FS
8383− if (new_crtc_state->active &&
8384− amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
83858265 /**
83868266 * Frontend may have changed so reapply the CRC capture
83878267 * settings for the stream.
83888268 */
83898269 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
8390− dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);
8391−
8392− if (amdgpu_dm_crc_window_is_default(dm_new_crtc_state)) {
8393− if (!old_crtc_state->active || drm_atomic_crtc_needs_modeset(new_crtc_state))
8394− configure_crc = true;
8395− } else {
8396− if (amdgpu_dm_crc_window_changed(dm_new_crtc_state, dm_old_crtc_state))
8397− configure_crc = true;
8398− }
83998270
8400− if (configure_crc)
8271+ if (amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
84018272 amdgpu_dm_crtc_configure_crc_source(
8402− crtc, dm_new_crtc_state, dm_new_crtc_state->crc_src);
8403− }
8273+ crtc, dm_new_crtc_state,
8274+ dm_new_crtc_state->crc_src);
8275+ }
84048276 #endif
8277+ }
84058278 }
84068279
84078280 for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+0−38
@@ -336,32 +336,6 @@ struct amdgpu_display_manager { · 335 unmodified lines
336336 */
337337 const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
338338
339−#ifdef CONFIG_DEBUG_FS
340− /**
341− * @crc_win_x_start_property:
342− *
343− * X start of the crc calculation window
344− */
345− struct drm_property *crc_win_x_start_property;
346− /**
347− * @crc_win_y_start_property:
348− *
349− * Y start of the crc calculation window
350− */
351− struct drm_property *crc_win_y_start_property;
352− /**
353− * @crc_win_x_end_property:
354− *
355− * X end of the crc calculation window
356− */
357− struct drm_property *crc_win_x_end_property;
358− /**
359− * @crc_win_y_end_property:
360− *
361− * Y end of the crc calculation window
362− */
363− struct drm_property *crc_win_y_end_property;
364−#endif
365339 /**
366340 * @mst_encoders:
367341 *
@@ -448,15 +422,6 @@ struct dm_plane_state { · 80 unmodified lines
448422 struct dc_plane_state *dc_state;
449423 };
450424
451−#ifdef CONFIG_DEBUG_FS
452−struct crc_rec {
453− uint16_t x_start;
454− uint16_t y_start;
455− uint16_t x_end;
456− uint16_t y_end;
457− };
458−#endif
459−
460425 struct dm_crtc_state {
461426 struct drm_crtc_state base;
462427 struct dc_stream_state *stream;
@@ -479,9 +444,6 @@ struct dm_crtc_state { · 16 unmodified lines
479444 struct dc_info_packet vrr_infopacket;
480445
481446 int abm_level;
482−#ifdef CONFIG_DEBUG_FS
483− struct crc_rec crc_window;
484−#endif
485447 };
486448
487449 #define to_dm_crtc_state(x) container_of(x, struct dm_crtc_state, base)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c+1−53
@@ -81,41 +81,6 @@ const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc, · 80 unmodified lines
8181 return pipe_crc_sources;
8282 }
8383
84−static void amdgpu_dm_set_crc_window_default(struct dm_crtc_state *dm_crtc_state)
85−{
86− dm_crtc_state->crc_window.x_start = 0;
87− dm_crtc_state->crc_window.y_start = 0;
88− dm_crtc_state->crc_window.x_end = 0;
89− dm_crtc_state->crc_window.y_end = 0;
90−}
91−
92−bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state)
93−{
94− bool ret = true;
95−
96− if ((dm_crtc_state->crc_window.x_start != 0) ||
97− (dm_crtc_state->crc_window.y_start != 0) ||
98− (dm_crtc_state->crc_window.x_end != 0) ||
99− (dm_crtc_state->crc_window.y_end != 0))
100− ret = false;
101−
102− return ret;
103−}
104−
105−bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
106− struct dm_crtc_state *dm_old_crtc_state)
107−{
108− bool ret = false;
109−
110− if ((dm_new_crtc_state->crc_window.x_start != dm_old_crtc_state->crc_window.x_start) ||
111− (dm_new_crtc_state->crc_window.y_start != dm_old_crtc_state->crc_window.y_start) ||
112− (dm_new_crtc_state->crc_window.x_end != dm_old_crtc_state->crc_window.x_end) ||
113− (dm_new_crtc_state->crc_window.y_end != dm_old_crtc_state->crc_window.y_end))
114− ret = true;
115−
116− return ret;
117−}
118−
11984 int
12085 amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name,
12186 size_t *values_cnt)
@@ -140,7 +105,6 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, · 18 unmodified lines
140105 struct dc_stream_state *stream_state = dm_crtc_state->stream;
141106 bool enable = amdgpu_dm_is_valid_crc_source(source);
142107 int ret = 0;
143− struct crc_params *crc_window = NULL, tmp_window;
144108
145109 /* Configuration will be deferred to stream enable. */
146110 if (!stream_state)
@@ -150,24 +114,8 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, · 3 unmodified lines
150114
151115 /* Enable CRTC CRC generation if necessary. */
152116 if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
153− if (!enable)
154− amdgpu_dm_set_crc_window_default(dm_crtc_state);
155−
156− if (!amdgpu_dm_crc_window_is_default(dm_crtc_state)) {
157− crc_window = &tmp_window;
158−
159− tmp_window.windowa_x_start = dm_crtc_state->crc_window.x_start;
160− tmp_window.windowa_y_start = dm_crtc_state->crc_window.y_start;
161− tmp_window.windowa_x_end = dm_crtc_state->crc_window.x_end;
162− tmp_window.windowa_y_end = dm_crtc_state->crc_window.y_end;
163− tmp_window.windowb_x_start = dm_crtc_state->crc_window.x_start;
164− tmp_window.windowb_y_start = dm_crtc_state->crc_window.y_start;
165− tmp_window.windowb_x_end = dm_crtc_state->crc_window.x_end;
166− tmp_window.windowb_y_end = dm_crtc_state->crc_window.y_end;
167− }
168−
169117 if (!dc_stream_configure_crc(stream_state->ctx->dc,
170− stream_state, crc_window, enable, enable)) {
118+ stream_state, NULL, enable, enable)) {
171119 ret = -EINVAL;
172120 goto unlock;
173121 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h+0−3
@@ -47,9 +47,6 @@ static inline bool amdgpu_dm_is_valid_crc_source(enum amdgpu_dm_pipe_crc_source · 46 unmodified lines
4747
4848 /* amdgpu_dm_crc.c */
4949 #ifdef CONFIG_DEBUG_FS
50−bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state);
51−bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
52− struct dm_crtc_state *dm_old_crtc_state);
5350 int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
5451 struct dm_crtc_state *dm_crtc_state,
5552 enum amdgpu_dm_pipe_crc_source source);
drivers/gpu/drm/amd/display/dc/calcs/Makefile+0−4
@@ -33,10 +33,6 @@ ifdef CONFIG_PPC64 · 32 unmodified lines
3333 calcs_ccflags := -mhard-float -maltivec
3434 endif
3535
36−ifdef CONFIG_ARM64
37−calcs_rcflags := -mgeneral-regs-only
38−endif
39−
4036 ifdef CONFIG_CC_IS_GCC
4137 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
4238 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile+0−21
@@ -104,13 +104,6 @@ ifdef CONFIG_PPC64 · 103 unmodified lines
104104 CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
105105 endif
106106
107−# prevent build errors:
108−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
109−# this file is unused on arm64, just like on ppc64
110−ifdef CONFIG_ARM64
111−CFLAGS_REMOVE_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := -mgeneral-regs-only
112−endif
113−
114107 AMD_DAL_CLK_MGR_DCN21 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn21/,$(CLK_MGR_DCN21))
115108
116109 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN21)
@@ -125,13 +118,6 @@ ifdef CONFIG_PPC64 · 8 unmodified lines
125118 CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn30/dcn30_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
126119 endif
127120
128−# prevent build errors:
129−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
130−# this file is unused on arm64, just like on ppc64
131−ifdef CONFIG_ARM64
132−CFLAGS_REMOVE_$(AMDDALPATH)/dc/clk_mgr/dcn30/dcn30_clk_mgr.o := -mgeneral-regs-only
133−endif
134−
135121 AMD_DAL_CLK_MGR_DCN30 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn30/,$(CLK_MGR_DCN30))
136122
137123 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN30)
@@ -146,13 +132,6 @@ ifdef CONFIG_PPC64 · 8 unmodified lines
146132 CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn301/vg_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
147133 endif
148134
149−# prevent build errors:
150−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
151−# this file is unused on arm64, just like on ppc64
152−ifdef CONFIG_ARM64
153−CFLAGS_REMOVE_$(AMDDALPATH)/dc/clk_mgr/dcn301/vg_clk_mgr.o := -mgeneral-regs-only
154−endif
155−
156135 AMD_DAL_CLK_MGR_DCN301 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn301/,$(CLK_MGR_DCN301))
157136
158137 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN301)
drivers/gpu/drm/amd/display/dc/core/dc_link.c+6−1
@@ -2487,9 +2487,14 @@ enum dc_status dc_link_validate_mode_timing( · 2486 unmodified lines
24872487 static struct abm *get_abm_from_stream_res(const struct dc_link *link)
24882488 {
24892489 int i;
2490− struct dc *dc = link->ctx->dc;
2490+ struct dc *dc = NULL;
24912491 struct abm *abm = NULL;
24922492
2493+ if (!link || !link->ctx)
2494+ return NULL;
2495+
2496+ dc = link->ctx->dc;
2497+
24932498 for (i = 0; i < MAX_PIPES; i++) {
24942499 struct pipe_ctx pipe_ctx = dc->current_state->res_ctx.pipe_ctx[i];
24952500 struct dc_stream_state *stream = pipe_ctx.stream;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+7−1
@@ -3992,7 +3992,7 @@ bool dc_link_dp_set_test_pattern( · 3991 unmodified lines
39923992 unsigned int cust_pattern_size)
39933993 {
39943994 struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx;
3995− struct pipe_ctx *pipe_ctx = &pipes[0];
3995+ struct pipe_ctx *pipe_ctx = NULL;
39963996 unsigned int lane;
39973997 unsigned int i;
39983998 unsigned char link_qual_pattern[LANE_COUNT_DP_MAX] = {0};
@@ -4002,12 +4002,18 @@ bool dc_link_dp_set_test_pattern( · 3 unmodified lines
40024002 memset(&training_pattern, 0, sizeof(training_pattern));
40034003
40044004 for (i = 0; i < MAX_PIPES; i++) {
4005+ if (pipes[i].stream == NULL)
4006+ continue;
4007+
40054008 if (pipes[i].stream->link == link && !pipes[i].top_pipe && !pipes[i].prev_odm_pipe) {
40064009 pipe_ctx = &pipes[i];
40074010 break;
40084011 }
40094012 }
40104013
4014+ if (pipe_ctx == NULL)
4015+ return false;
4016+
40114017 /* Reset CRTC Test Pattern if it is currently running and request is VideoMode */
40124018 if (link->test_pattern_enabled && test_pattern ==
40134019 DP_TEST_PATTERN_VIDEO_MODE) {
drivers/gpu/drm/amd/display/dc/dcn10/Makefile+0−7
@@ -31,11 +31,4 @@ DCN10 = dcn10_init.o dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \ · 30 unmodified lines
3131
3232 AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
3333
34−# fix:
35−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
36−# aarch64 does not support soft-float, so use hard-float and handle this in code
37−ifdef CONFIG_ARM64
38−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn10/dcn10_resource.o := -mgeneral-regs-only
39−endif
40−
4134 AMD_DISPLAY_FILES += $(AMD_DAL_DCN10)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c+1−1
@@ -470,7 +470,7 @@ void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock) · 469 unmodified lines
470470 unsigned int mpc1_get_mpc_out_mux(struct mpc *mpc, int opp_id)
471471 {
472472 struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc);
473− uint32_t val = 0;
473+ uint32_t val = 0xf;
474474
475475 if (opp_id < MAX_OPP && REG(MUX[opp_id]))
476476 REG_GET(MUX[opp_id], MPC_OUT_MUX, &val);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c+2−9
@@ -608,8 +608,8 @@ static const struct dc_debug_options debug_defaults_drv = { · 607 unmodified lines
608608 .disable_pplib_clock_request = false,
609609 .disable_pplib_wm_range = false,
610610 .pplib_wm_report_mode = WM_REPORT_DEFAULT,
611− .pipe_split_policy = MPC_SPLIT_DYNAMIC,
612− .force_single_disp_pipe_split = true,
611+ .pipe_split_policy = MPC_SPLIT_AVOID,
612+ .force_single_disp_pipe_split = false,
613613 .disable_dcc = DCC_ENABLE,
614614 .voltage_align_fclk = true,
615615 .disable_stereo_support = true,
@@ -1534,15 +1534,8 @@ static bool dcn10_resource_construct( · 918 unmodified lines
15341534 memcpy(dc->dcn_ip, &dcn10_ip_defaults, sizeof(dcn10_ip_defaults));
15351535 memcpy(dc->dcn_soc, &dcn10_soc_defaults, sizeof(dcn10_soc_defaults));
15361536
1537−#if defined(CONFIG_ARM64)
1538− /* Aarch64 does not support -msoft-float/-mfloat-abi=soft */
1539− DC_FP_START();
1540− dcn10_resource_construct_fp(dc);
1541− DC_FP_END();
1542−#else
15431537 /* Other architectures we build for build this with soft-float */
15441538 dcn10_resource_construct_fp(dc);
1545−#endif
15461539
15471540 pool->base.pp_smu = dcn10_pp_smu_create(ctx);
15481541
drivers/gpu/drm/amd/display/dc/dcn20/Makefile+0−4
@@ -17,10 +17,6 @@ ifdef CONFIG_PPC64 · 16 unmodified lines
1717 CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -maltivec
1818 endif
1919
20−ifdef CONFIG_ARM64
21−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mgeneral-regs-only
22−endif
23−
2420 ifdef CONFIG_CC_IS_GCC
2521 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
2622 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dcn21/Makefile+0−4
@@ -13,10 +13,6 @@ ifdef CONFIG_PPC64 · 12 unmodified lines
1313 CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -maltivec
1414 endif
1515
16−ifdef CONFIG_ARM64
17−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mgeneral-regs-only
18−endif
19−
2016 ifdef CONFIG_CC_IS_GCC
2117 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
2218 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dcn30/Makefile+0−5
@@ -41,11 +41,6 @@ CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -maltivec · 40 unmodified lines
4141 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -maltivec
4242 endif
4343
44−ifdef CONFIG_ARM64
45−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mgeneral-regs-only
46−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mgeneral-regs-only
47−endif
48−
4944 ifdef CONFIG_CC_IS_GCC
5045 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
5146 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dcn301/Makefile+0−4
@@ -21,10 +21,6 @@ ifdef CONFIG_PPC64 · 20 unmodified lines
2121 CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -mhard-float -maltivec
2222 endif
2323
24−ifdef CONFIG_ARM64
25−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -mgeneral-regs-only
26−endif
27−
2824 ifdef CONFIG_CC_IS_GCC
2925 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
3026 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c+1−0
@@ -1731,6 +1731,7 @@ static struct resource_funcs dcn301_res_pool_funcs = { · 1730 unmodified lines
17311731 .populate_dml_pipes = dcn30_populate_dml_pipes_from_context,
17321732 .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
17331733 .add_stream_to_ctx = dcn30_add_stream_to_ctx,
1734+ .add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
17341735 .remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
17351736 .populate_dml_writeback_from_context = dcn30_populate_dml_writeback_from_context,
17361737 .set_mcif_arb_params = dcn30_set_mcif_arb_params,
drivers/gpu/drm/amd/display/dc/dcn302/Makefile+0−4
@@ -20,10 +20,6 @@ ifdef CONFIG_PPC64 · 19 unmodified lines
2020 CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
2121 endif
2222
23−ifdef CONFIG_ARM64
24−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mgeneral-regs-only
25−endif
26−
2723 ifdef CONFIG_CC_IS_GCC
2824 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
2925 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dml/Makefile+0−4
@@ -33,10 +33,6 @@ ifdef CONFIG_PPC64 · 32 unmodified lines
3333 dml_ccflags := -mhard-float -maltivec
3434 endif
3535
36−ifdef CONFIG_ARM64
37−dml_rcflags := -mgeneral-regs-only
38−endif
39−
4036 ifdef CONFIG_CC_IS_GCC
4137 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
4238 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c+6−5
@@ -2635,14 +2635,15 @@ static void dml20v2_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndP · 2634 unmodified lines
26352635 }
26362636
26372637 if (mode_lib->vba.DRAMClockChangeSupportsVActive &&
2638− mode_lib->vba.MinActiveDRAMClockChangeMargin > 60 &&
2639− mode_lib->vba.PrefetchMode[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb] == 0) {
2638+ mode_lib->vba.MinActiveDRAMClockChangeMargin > 60) {
26402639 mode_lib->vba.DRAMClockChangeWatermark += 25;
26412640
26422641 for (k = 0; k < mode_lib->vba.NumberOfActivePlanes; ++k) {
2643− if (mode_lib->vba.DRAMClockChangeWatermark >
2644− dml_max(mode_lib->vba.StutterEnterPlusExitWatermark, mode_lib->vba.UrgentWatermark))
2645− mode_lib->vba.MinTTUVBlank[k] += 25;
2642+ if (mode_lib->vba.PrefetchMode[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb] == 0) {
2643+ if (mode_lib->vba.DRAMClockChangeWatermark >
2644+ dml_max(mode_lib->vba.StutterEnterPlusExitWatermark, mode_lib->vba.UrgentWatermark))
2645+ mode_lib->vba.MinTTUVBlank[k] += 25;
2646+ }
26462647 }
26472648
26482649 mode_lib->vba.DRAMClockChangeSupport[0][0] = dm_dram_clock_change_vactive;
drivers/gpu/drm/amd/display/dc/dsc/Makefile+0−4
@@ -10,10 +10,6 @@ ifdef CONFIG_PPC64 · 9 unmodified lines
1010 dsc_ccflags := -mhard-float -maltivec
1111 endif
1212
13−ifdef CONFIG_ARM64
14−dsc_rcflags := -mgeneral-regs-only
15−endif
16−
1713 ifdef CONFIG_CC_IS_GCC
1814 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
1915 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/os_types.h+0−4
@@ -55,10 +55,6 @@ · 54 unmodified lines
5555 #include <asm/fpu/api.h>
5656 #define DC_FP_START() kernel_fpu_begin()
5757 #define DC_FP_END() kernel_fpu_end()
58−#elif defined(CONFIG_ARM64)
59−#include <asm/neon.h>
60−#define DC_FP_START() kernel_neon_begin()
61−#define DC_FP_END() kernel_neon_end()
6258 #elif defined(CONFIG_PPC64)
6359 #include <asm/switch_to.h>
6460 #include <asm/cputable.h>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c+151−15
@@ -251,7 +251,7 @@ static int smu10_set_hard_min_gfxclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t cl · 250 unmodified lines
251251 smu10_data->gfx_actual_soft_min_freq = clock;
252252 smum_send_msg_to_smc_with_parameter(hwmgr,
253253 PPSMC_MSG_SetHardMinGfxClk,
254− smu10_data->gfx_actual_soft_min_freq,
254+ clock,
255255 NULL);
256256 }
257257 return 0;
@@ -558,7 +558,8 @@ static int smu10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) · 300 unmodified lines
558558
559559 /* enable the pp_od_clk_voltage sysfs file */
560560 hwmgr->od_enabled = 1;
561−
561+ /* disabled fine grain tuning function by default */
562+ data->fine_grain_enabled = 0;
562563 return result;
563564 }
564565
@@ -597,6 +598,7 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 32 unmodified lines
597598 uint32_t min_mclk = hwmgr->display_config->min_mem_set_clock/100;
598599 uint32_t index_fclk = data->clock_vol_info.vdd_dep_on_fclk->count - 1;
599600 uint32_t index_socclk = data->clock_vol_info.vdd_dep_on_socclk->count - 1;
601+ uint32_t fine_grain_min_freq = 0, fine_grain_max_freq = 0;
600602
601603 if (hwmgr->smu_version < 0x1E3700) {
602604 pr_info("smu firmware version too old, can not set dpm level\n");
@@ -613,6 +615,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 10 unmodified lines
613615 switch (level) {
614616 case AMD_DPM_FORCED_LEVEL_HIGH:
615617 case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:
618+ data->fine_grain_enabled = 0;
619+
620+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
621+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
622+
623+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
624+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
625+
616626 smum_send_msg_to_smc_with_parameter(hwmgr,
617627 PPSMC_MSG_SetHardMinGfxClk,
618628 data->gfx_max_freq_limit/100,
@@ -648,6 +658,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 29 unmodified lines
648658 NULL);
649659 break;
650660 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:
661+ data->fine_grain_enabled = 0;
662+
663+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
664+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
665+
666+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
667+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
668+
651669 smum_send_msg_to_smc_with_parameter(hwmgr,
652670 PPSMC_MSG_SetHardMinGfxClk,
653671 min_sclk,
@@ -658,6 +676,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 4 unmodified lines
658676 NULL);
659677 break;
660678 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:
679+ data->fine_grain_enabled = 0;
680+
681+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
682+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
683+
684+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
685+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
686+
661687 smum_send_msg_to_smc_with_parameter(hwmgr,
662688 PPSMC_MSG_SetHardMinFclkByFreq,
663689 min_mclk,
@@ -668,6 +694,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 4 unmodified lines
668694 NULL);
669695 break;
670696 case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
697+ data->fine_grain_enabled = 0;
698+
699+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
700+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
701+
702+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
703+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
704+
671705 smum_send_msg_to_smc_with_parameter(hwmgr,
672706 PPSMC_MSG_SetHardMinGfxClk,
673707 SMU10_UMD_PSTATE_GFXCLK,
@@ -703,6 +737,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 29 unmodified lines
703737 NULL);
704738 break;
705739 case AMD_DPM_FORCED_LEVEL_AUTO:
740+ data->fine_grain_enabled = 0;
741+
742+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
743+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
744+
745+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
746+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
747+
706748 smum_send_msg_to_smc_with_parameter(hwmgr,
707749 PPSMC_MSG_SetHardMinGfxClk,
708750 min_sclk,
@@ -741,6 +783,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 32 unmodified lines
741783 NULL);
742784 break;
743785 case AMD_DPM_FORCED_LEVEL_LOW:
786+ data->fine_grain_enabled = 0;
787+
788+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
789+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
790+
791+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
792+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
793+
744794 smum_send_msg_to_smc_with_parameter(hwmgr,
745795 PPSMC_MSG_SetHardMinGfxClk,
746796 data->gfx_min_freq_limit/100,
@@ -759,6 +809,7 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 12 unmodified lines
759809 NULL);
760810 break;
761811 case AMD_DPM_FORCED_LEVEL_MANUAL:
812+ data->fine_grain_enabled = 1;
762813 case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:
763814 default:
764815 break;
@@ -948,6 +999,8 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 183 unmodified lines
948999 struct smu10_voltage_dependency_table *mclk_table =
9491000 data->clock_vol_info.vdd_dep_on_fclk;
9501001 uint32_t i, now, size = 0;
1002+ uint32_t min_freq, max_freq = 0;
1003+ uint32_t ret = 0;
9511004
9521005 switch (type) {
9531006 case PP_SCLK:
@@ -983,18 +1036,28 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 29 unmodified lines
9831036 break;
9841037 case OD_SCLK:
9851038 if (hwmgr->od_enabled) {
986− size = sprintf(buf, "%s:\n", "OD_SCLK");
1039+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1040+ if (ret)
1041+ return ret;
1042+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1043+ if (ret)
1044+ return ret;
9871045
1046+ size = sprintf(buf, "%s:\n", "OD_SCLK");
9881047 size += sprintf(buf + size, "0: %10uMhz\n",
989− (data->gfx_actual_soft_min_freq > 0) ? data->gfx_actual_soft_min_freq : data->gfx_min_freq_limit/100);
990− size += sprintf(buf + size, "1: %10uMhz\n", data->gfx_max_freq_limit/100);
1048+ (data->gfx_actual_soft_min_freq > 0) ? data->gfx_actual_soft_min_freq : min_freq);
1049+ size += sprintf(buf + size, "1: %10uMhz\n",
1050+ (data->gfx_actual_soft_max_freq > 0) ? data->gfx_actual_soft_max_freq : max_freq);
9911051 }
9921052 break;
9931053 case OD_RANGE:
9941054 if (hwmgr->od_enabled) {
995− uint32_t min_freq, max_freq = 0;
996− smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
997− smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1055+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1056+ if (ret)
1057+ return ret;
1058+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1059+ if (ret)
1060+ return ret;
9981061
9991062 size = sprintf(buf, "%s:\n", "OD_RANGE");
10001063 size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
@@ -1414,23 +1477,96 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr, · 413 unmodified lines
14141477 enum PP_OD_DPM_TABLE_COMMAND type,
14151478 long *input, uint32_t size)
14161479 {
1480+ uint32_t min_freq, max_freq = 0;
1481+ struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
1482+ int ret = 0;
1483+
14171484 if (!hwmgr->od_enabled) {
14181485 pr_err("Fine grain not support\n");
14191486 return -EINVAL;
14201487 }
14211488
1422− if (size != 2) {
1423− pr_err("Input parameter number not correct\n");
1489+ if (!smu10_data->fine_grain_enabled) {
1490+ pr_err("Fine grain not started\n");
14241491 return -EINVAL;
14251492 }
14261493
14271494 if (type == PP_OD_EDIT_SCLK_VDDC_TABLE) {
1428− if (input[0] == 0)
1429− smu10_set_hard_min_gfxclk_by_freq(hwmgr, input[1]);
1430− else if (input[0] == 1)
1431− smu10_set_soft_max_gfxclk_by_freq(hwmgr, input[1]);
1432− else
1495+ if (size != 2) {
1496+ pr_err("Input parameter number not correct\n");
14331497 return -EINVAL;
1498+ }
1499+
1500+ if (input[0] == 0) {
1501+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1502+ if (input[1] < min_freq) {
1503+ pr_err("Fine grain setting minimum sclk (%ld) MHz is less than the minimum allowed (%d) MHz\n",
1504+ input[1], min_freq);
1505+ return -EINVAL;
1506+ }
1507+ smu10_data->gfx_actual_soft_min_freq = input[1];
1508+ } else if (input[0] == 1) {
1509+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1510+ if (input[1] > max_freq) {
1511+ pr_err("Fine grain setting maximum sclk (%ld) MHz is greater than the maximum allowed (%d) MHz\n",
1512+ input[1], max_freq);
1513+ return -EINVAL;
1514+ }
1515+ smu10_data->gfx_actual_soft_max_freq = input[1];
1516+ } else {
1517+ return -EINVAL;
1518+ }
1519+ } else if (type == PP_OD_RESTORE_DEFAULT_TABLE) {
1520+ if (size != 0) {
1521+ pr_err("Input parameter number not correct\n");
1522+ return -EINVAL;
1523+ }
1524+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1525+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1526+
1527+ smu10_data->gfx_actual_soft_min_freq = min_freq;
1528+ smu10_data->gfx_actual_soft_max_freq = max_freq;
1529+
1530+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1531+ PPSMC_MSG_SetHardMinGfxClk,
1532+ min_freq,
1533+ NULL);
1534+ if (ret)
1535+ return ret;
1536+
1537+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1538+ PPSMC_MSG_SetSoftMaxGfxClk,
1539+ max_freq,
1540+ NULL);
1541+ if (ret)
1542+ return ret;
1543+ } else if (type == PP_OD_COMMIT_DPM_TABLE) {
1544+ if (size != 0) {
1545+ pr_err("Input parameter number not correct\n");
1546+ return -EINVAL;
1547+ }
1548+
1549+ if (smu10_data->gfx_actual_soft_min_freq > smu10_data->gfx_actual_soft_max_freq) {
1550+ pr_err("The setting minimun sclk (%d) MHz is greater than the setting maximum sclk (%d) MHz\n",
1551+ smu10_data->gfx_actual_soft_min_freq, smu10_data->gfx_actual_soft_max_freq);
1552+ return -EINVAL;
1553+ }
1554+
1555+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1556+ PPSMC_MSG_SetHardMinGfxClk,
1557+ smu10_data->gfx_actual_soft_min_freq,
1558+ NULL);
1559+ if (ret)
1560+ return ret;
1561+
1562+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1563+ PPSMC_MSG_SetSoftMaxGfxClk,
1564+ smu10_data->gfx_actual_soft_max_freq,
1565+ NULL);
1566+ if (ret)
1567+ return ret;
1568+ } else {
1569+ return -EINVAL;
14341570 }
14351571
14361572 return 0;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.h+3−0
@@ -283,6 +283,7 @@ struct smu10_hwmgr { · 282 unmodified lines
283283 uint32_t vclk_soft_min;
284284 uint32_t dclk_soft_min;
285285 uint32_t gfx_actual_soft_min_freq;
286+ uint32_t gfx_actual_soft_max_freq;
286287 uint32_t gfx_min_freq_limit;
287288 uint32_t gfx_max_freq_limit; /* in 10Khz*/
288289
@@ -299,6 +300,8 @@ struct smu10_hwmgr { · 10 unmodified lines
299300 bool need_min_deep_sleep_dcefclk;
300301 uint32_t deep_sleep_dcefclk;
301302 uint32_t num_active_display;
303+
304+ bool fine_grain_enabled;
302305 };
303306
304307 struct pp_hwmgr;
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c+1−1
@@ -2372,7 +2372,7 @@ static void sienna_cichlid_fill_i2c_req(SwI2cRequest_t *req, bool write, · 2371 unmodified lines
23722372 {
23732373 int i;
23742374
2375− req->I2CcontrollerPort = 0;
2375+ req->I2CcontrollerPort = 1;
23762376 req->I2CSpeed = 2;
23772377 req->SlaveAddress = address;
23782378 req->NumCmds = numbytes;
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c+2−1
@@ -252,7 +252,8 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu, · 251 unmodified lines
252252 *value = metrics->UvdActivity;
253253 break;
254254 case METRICS_AVERAGE_SOCKETPOWER:
255− *value = metrics->CurrentSocketPower;
255+ *value = (metrics->CurrentSocketPower << 8) /
256+ 1000 ;
256257 break;
257258 case METRICS_TEMPERATURE_EDGE:
258259 *value = metrics->GfxTemperature / 100 *
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c+1−0
@@ -188,6 +188,7 @@ static int renoir_get_dpm_clk_limited(struct smu_context *smu, enum smu_clk_type · 187 unmodified lines
188188 return -EINVAL;
189189 *freq = clk_table->SocClocks[dpm_level].Freq;
190190 break;
191+ case SMU_UCLK:
191192 case SMU_MCLK:
192193 if (dpm_level >= NUM_FCLK_DPM_LEVELS)
193194 return -EINVAL;
drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c+1−0
@@ -225,6 +225,7 @@ int smu_v12_0_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_ · 224 unmodified lines
225225 break;
226226 case SMU_FCLK:
227227 case SMU_MCLK:
228+ case SMU_UCLK:
228229 ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinFclkByFreq, min, NULL);
229230 if (ret)
230231 return ret;
drivers/gpu/drm/drm_plane.c+8−1
@@ -1163,7 +1163,14 @@ retry: · 1162 unmodified lines
11631163 if (ret)
11641164 goto out;
11651165
1166− if (old_fb->format != fb->format) {
1166+ /*
1167+ * Only check the FOURCC format code, excluding modifiers. This is
1168+ * enough for all legacy drivers. Atomic drivers have their own
1169+ * checks in their ->atomic_check implementation, which will
1170+ * return -EINVAL if any hw or driver constraint is violated due
1171+ * to modifier changes.
1172+ */
1173+ if (old_fb->format->format != fb->format->format) {
11671174 DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
11681175 ret = -EINVAL;
11691176 goto out;
drivers/gpu/drm/i915/Makefile+1−0
@@ -38,6 +38,7 @@ i915-y += i915_drv.o \ · 37 unmodified lines
3838 i915_config.o \
3939 i915_irq.o \
4040 i915_getparam.o \
41+ i915_mitigations.o \
4142 i915_params.o \
4243 i915_pci.o \
4344 i915_scatterlist.o \
drivers/gpu/drm/i915/display/icl_dsi.c+0−4
@@ -1616,10 +1616,6 @@ static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, · 1615 unmodified lines
16161616
16171617 get_dsi_io_power_domains(i915,
16181618 enc_to_intel_dsi(encoder));
1619−
1620− if (crtc_state->dsc.compression_enable)
1621− intel_display_power_get(i915,
1622− intel_dsc_power_domain(crtc_state));
16231619 }
16241620
16251621 static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder,
drivers/gpu/drm/i915/display/intel_display_types.h+3−0
@@ -1436,6 +1436,9 @@ struct intel_dp { · 1435 unmodified lines
14361436 bool ycbcr_444_to_420;
14371437 } dfp;
14381438
1439+ /* To control wakeup latency, e.g. for irq-driven dp aux transfers. */
1440+ struct pm_qos_request pm_qos;
1441+
14391442 /* Display stream compression testing */
14401443 bool force_dsc_en;
14411444
drivers/gpu/drm/i915/display/intel_dp.c+6−2
@@ -1489,7 +1489,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp, · 1488 unmodified lines
14891489 * lowest possible wakeup latency and so prevent the cpu from going into
14901490 * deep sleep states.
14911491 */
1492− cpu_latency_qos_update_request(&i915->pm_qos, 0);
1492+ cpu_latency_qos_update_request(&intel_dp->pm_qos, 0);
14931493
14941494 intel_dp_check_edp(intel_dp);
14951495
@@ -1622,7 +1622,7 @@ done: · 126 unmodified lines
16221622
16231623 ret = recv_bytes;
16241624 out:
1625− cpu_latency_qos_update_request(&i915->pm_qos, PM_QOS_DEFAULT_VALUE);
1625+ cpu_latency_qos_update_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE);
16261626
16271627 if (vdd)
16281628 edp_panel_vdd_off(intel_dp, false);
@@ -1898,6 +1898,9 @@ static i915_reg_t tgl_aux_data_reg(struct intel_dp *intel_dp, int index) · 269 unmodified lines
18981898 static void
18991899 intel_dp_aux_fini(struct intel_dp *intel_dp)
19001900 {
1901+ if (cpu_latency_qos_request_active(&intel_dp->pm_qos))
1902+ cpu_latency_qos_remove_request(&intel_dp->pm_qos);
1903+
19011904 kfree(intel_dp->aux.name);
19021905 }
19031906
@@ -1950,6 +1953,7 @@ intel_dp_aux_init(struct intel_dp *intel_dp) · 46 unmodified lines
19501953 encoder->base.name);
19511954
19521955 intel_dp->aux.transfer = intel_dp_aux_transfer;
1956+ cpu_latency_qos_add_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE);
19531957 }
19541958
19551959 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
drivers/gpu/drm/i915/display/intel_panel.c+5−4
@@ -1650,16 +1650,13 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus · 1649 unmodified lines
16501650 val = pch_get_backlight(connector);
16511651 else
16521652 val = lpt_get_backlight(connector);
1653− val = intel_panel_compute_brightness(connector, val);
1654− panel->backlight.level = clamp(val, panel->backlight.min,
1655− panel->backlight.max);
16561653
16571654 if (cpu_mode) {
16581655 drm_dbg_kms(&dev_priv->drm,
16591656 "CPU backlight register was enabled, switching to PCH override\n");
16601657
16611658 /* Write converted CPU PWM value to PCH override register */
1662− lpt_set_backlight(connector->base.state, panel->backlight.level);
1659+ lpt_set_backlight(connector->base.state, val);
16631660 intel_de_write(dev_priv, BLC_PWM_PCH_CTL1,
16641661 pch_ctl1 | BLM_PCH_OVERRIDE_ENABLE);
16651662
@@ -1667,6 +1664,10 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus · 1 unmodified line
16671664 cpu_ctl2 & ~BLM_PWM_ENABLE);
16681665 }
16691666
1667+ val = intel_panel_compute_brightness(connector, val);
1668+ panel->backlight.level = clamp(val, panel->backlight.min,
1669+ panel->backlight.max);
1670+
16701671 return 0;
16711672 }
16721673
drivers/gpu/drm/i915/display/vlv_dsi.c+13−3
@@ -812,10 +812,20 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state, · 811 unmodified lines
812812 intel_dsi_prepare(encoder, pipe_config);
813813
814814 intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON);
815− intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
816815
817− /* Deassert reset */
818− intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
816+ /*
817+ * Give the panel time to power-on and then deassert its reset.
818+ * Depending on the VBT MIPI sequences version the deassert-seq
819+ * may contain the necessary delay, intel_dsi_msleep() will skip
820+ * the delay in that case. If there is no deassert-seq, then an
821+ * unconditional msleep is used to give the panel time to power-on.
822+ */
823+ if (dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET]) {
824+ intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
825+ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
826+ } else {
827+ msleep(intel_dsi->panel_on_delay);
828+ }
819829
820830 if (IS_GEMINILAKE(dev_priv)) {
821831 glk_cold_boot = glk_dsi_enable_io(encoder);
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+3−1
@@ -1046,7 +1046,7 @@ static void reloc_gpu_flush(struct i915_execbuffer *eb, struct reloc_cache *cach · 1045 unmodified lines
10461046 GEM_BUG_ON(cache->rq_size >= obj->base.size / sizeof(u32));
10471047 cache->rq_cmd[cache->rq_size] = MI_BATCH_BUFFER_END;
10481048
1049− __i915_gem_object_flush_map(obj, 0, sizeof(u32) * (cache->rq_size + 1));
1049+ i915_gem_object_flush_map(obj);
10501050 i915_gem_object_unpin_map(obj);
10511051
10521052 intel_gt_chipset_flush(cache->rq->engine->gt);
@@ -1296,6 +1296,8 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, · 243 unmodified lines
12961296 goto err_pool;
12971297 }
12981298
1299+ memset32(cmd, 0, pool->obj->base.size / sizeof(u32));
1300+
12991301 batch = i915_vma_instance(pool->obj, vma->vm, NULL);
13001302 if (IS_ERR(batch)) {
13011303 err = PTR_ERR(batch);
drivers/gpu/drm/i915/gt/gen7_renderclear.c+94−63
@@ -7,8 +7,6 @@ · 6 unmodified lines
77 #include "i915_drv.h"
88 #include "intel_gpu_commands.h"
99
10−#define MAX_URB_ENTRIES 64
11−#define STATE_SIZE (4 * 1024)
1210 #define GT3_INLINE_DATA_DELAYS 0x1E00
1311 #define batch_advance(Y, CS) GEM_BUG_ON((Y)->end != (CS))
1412
@@ -34,38 +32,59 @@ struct batch_chunk { · 19 unmodified lines
3432 };
3533
3634 struct batch_vals {
37− u32 max_primitives;
38− u32 max_urb_entries;
39− u32 cmd_size;
40− u32 state_size;
35+ u32 max_threads;
4136 u32 state_start;
42− u32 batch_size;
37+ u32 surface_start;
4338 u32 surface_height;
4439 u32 surface_width;
45− u32 scratch_size;
46− u32 max_size;
40+ u32 size;
4741 };
4842
43+static inline int num_primitives(const struct batch_vals *bv)
44+{
45+ /*
46+ * We need to saturate the GPU with work in order to dispatch
47+ * a shader on every HW thread, and clear the thread-local registers.
48+ * In short, we have to dispatch work faster than the shaders can
49+ * run in order to fill the EU and occupy each HW thread.
50+ */
51+ return bv->max_threads;
52+}
53+
4954 static void
5055 batch_get_defaults(struct drm_i915_private *i915, struct batch_vals *bv)
5156 {
5257 if (IS_HASWELL(i915)) {
53− bv->max_primitives = 280;
54− bv->max_urb_entries = MAX_URB_ENTRIES;
58+ switch (INTEL_INFO(i915)->gt) {
59+ default:
60+ case 1:
61+ bv->max_threads = 70;
62+ break;
63+ case 2:
64+ bv->max_threads = 140;
65+ break;
66+ case 3:
67+ bv->max_threads = 280;
68+ break;
69+ }
5570 bv->surface_height = 16 * 16;
5671 bv->surface_width = 32 * 2 * 16;
5772 } else {
58− bv->max_primitives = 128;
59− bv->max_urb_entries = MAX_URB_ENTRIES / 2;
73+ switch (INTEL_INFO(i915)->gt) {
74+ default:
75+ case 1: /* including vlv */
76+ bv->max_threads = 36;
77+ break;
78+ case 2:
79+ bv->max_threads = 128;
80+ break;
81+ }
6082 bv->surface_height = 16 * 8;
6183 bv->surface_width = 32 * 16;
6284 }
63− bv->cmd_size = bv->max_primitives * 4096;
64− bv->state_size = STATE_SIZE;
65− bv->state_start = bv->cmd_size;
66− bv->batch_size = bv->cmd_size + bv->state_size;
67− bv->scratch_size = bv->surface_height * bv->surface_width;
68− bv->max_size = bv->batch_size + bv->scratch_size;
85+ bv->state_start = round_up(SZ_1K + num_primitives(bv) * 64, SZ_4K);
86+ bv->surface_start = bv->state_start + SZ_4K;
87+ bv->size = bv->surface_start + bv->surface_height * bv->surface_width;
6988 }
7089
7190 static void batch_init(struct batch_chunk *bc,
@@ -155,7 +174,8 @@ static u32 · 83 unmodified lines
155174 gen7_fill_binding_table(struct batch_chunk *state,
156175 const struct batch_vals *bv)
157176 {
158− u32 surface_start = gen7_fill_surface_state(state, bv->batch_size, bv);
177+ u32 surface_start =
178+ gen7_fill_surface_state(state, bv->surface_start, bv);
159179 u32 *cs = batch_alloc_items(state, 32, 8);
160180 u32 offset = batch_offset(state, cs);
161181
@@ -214,9 +234,9 @@ static void · 52 unmodified lines
214234 gen7_emit_state_base_address(struct batch_chunk *batch,
215235 u32 surface_state_base)
216236 {
217− u32 *cs = batch_alloc_items(batch, 0, 12);
237+ u32 *cs = batch_alloc_items(batch, 0, 10);
218238
219− *cs++ = STATE_BASE_ADDRESS | (12 - 2);
239+ *cs++ = STATE_BASE_ADDRESS | (10 - 2);
220240 /* general */
221241 *cs++ = batch_addr(batch) | BASE_ADDRESS_MODIFY;
222242 /* surface */
@@ -233,8 +253,6 @@ gen7_emit_state_base_address(struct batch_chunk *batch, · 10 unmodified lines
233253 *cs++ = BASE_ADDRESS_MODIFY;
234254 *cs++ = 0;
235255 *cs++ = BASE_ADDRESS_MODIFY;
236− *cs++ = 0;
237− *cs++ = 0;
238256 batch_advance(batch, cs);
239257 }
240258
@@ -244,8 +262,7 @@ gen7_emit_vfe_state(struct batch_chunk *batch, · 3 unmodified lines
244262 u32 urb_size, u32 curbe_size,
245263 u32 mode)
246264 {
247− u32 urb_entries = bv->max_urb_entries;
248− u32 threads = bv->max_primitives - 1;
265+ u32 threads = bv->max_threads - 1;
249266 u32 *cs = batch_alloc_items(batch, 32, 8);
250267
251268 *cs++ = MEDIA_VFE_STATE | (8 - 2);
@@ -254,7 +271,7 @@ gen7_emit_vfe_state(struct batch_chunk *batch, · 2 unmodified lines
254271 *cs++ = 0;
255272
256273 /* number of threads & urb entries for GPGPU vs Media Mode */
257− *cs++ = threads << 16 | urb_entries << 8 | mode << 2;
274+ *cs++ = threads << 16 | 1 << 8 | mode << 2;
258275
259276 *cs++ = 0;
260277
@@ -293,17 +310,12 @@ gen7_emit_media_object(struct batch_chunk *batch, · 32 unmodified lines
293310 {
294311 unsigned int x_offset = (media_object_index % 16) * 64;
295312 unsigned int y_offset = (media_object_index / 16) * 16;
296− unsigned int inline_data_size;
297− unsigned int media_batch_size;
298− unsigned int i;
313+ unsigned int pkt = 6 + 3;
299314 u32 *cs;
300315
301− inline_data_size = 112 * 8;
302− media_batch_size = inline_data_size + 6;
303−
304− cs = batch_alloc_items(batch, 8, media_batch_size);
316+ cs = batch_alloc_items(batch, 8, pkt);
305317
306− *cs++ = MEDIA_OBJECT | (media_batch_size - 2);
318+ *cs++ = MEDIA_OBJECT | (pkt - 2);
307319
308320 /* interface descriptor offset */
309321 *cs++ = 0;
@@ -317,25 +329,44 @@ gen7_emit_media_object(struct batch_chunk *batch, · 7 unmodified lines
317329 *cs++ = 0;
318330
319331 /* inline */
320− *cs++ = (y_offset << 16) | (x_offset);
332+ *cs++ = y_offset << 16 | x_offset;
321333 *cs++ = 0;
322334 *cs++ = GT3_INLINE_DATA_DELAYS;
323− for (i = 3; i < inline_data_size; i++)
324− *cs++ = 0;
325335
326336 batch_advance(batch, cs);
327337 }
328338
329339 static void gen7_emit_pipeline_flush(struct batch_chunk *batch)
330340 {
331− u32 *cs = batch_alloc_items(batch, 0, 5);
341+ u32 *cs = batch_alloc_items(batch, 0, 4);
332342
333− *cs++ = GFX_OP_PIPE_CONTROL(5);
334− *cs++ = PIPE_CONTROL_STATE_CACHE_INVALIDATE |
335− PIPE_CONTROL_GLOBAL_GTT_IVB;
343+ *cs++ = GFX_OP_PIPE_CONTROL(4);
344+ *cs++ = PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH |
345+ PIPE_CONTROL_DEPTH_CACHE_FLUSH |
346+ PIPE_CONTROL_DC_FLUSH_ENABLE |
347+ PIPE_CONTROL_CS_STALL;
336348 *cs++ = 0;
337349 *cs++ = 0;
350+
351+ batch_advance(batch, cs);
352+}
353+
354+static void gen7_emit_pipeline_invalidate(struct batch_chunk *batch)
355+{
356+ u32 *cs = batch_alloc_items(batch, 0, 8);
357+
358+ /* ivb: Stall before STATE_CACHE_INVALIDATE */
359+ *cs++ = GFX_OP_PIPE_CONTROL(4);
360+ *cs++ = PIPE_CONTROL_STALL_AT_SCOREBOARD |
361+ PIPE_CONTROL_CS_STALL;
362+ *cs++ = 0;
363+ *cs++ = 0;
364+
365+ *cs++ = GFX_OP_PIPE_CONTROL(4);
366+ *cs++ = PIPE_CONTROL_STATE_CACHE_INVALIDATE;
338367 *cs++ = 0;
368+ *cs++ = 0;
369+
339370 batch_advance(batch, cs);
340371 }
341372
@@ -344,34 +375,34 @@ static void emit_batch(struct i915_vma * const vma, · 2 unmodified lines
344375 const struct batch_vals *bv)
345376 {
346377 struct drm_i915_private *i915 = vma->vm->i915;
347− unsigned int desc_count = 64;
348− const u32 urb_size = 112;
378+ const unsigned int desc_count = 1;
379+ const unsigned int urb_size = 1;
349380 struct batch_chunk cmds, state;
350− u32 interface_descriptor;
381+ u32 descriptors;
351382 unsigned int i;
352383
353− batch_init(&cmds, vma, start, 0, bv->cmd_size);
354− batch_init(&state, vma, start, bv->state_start, bv->state_size);
384+ batch_init(&cmds, vma, start, 0, bv->state_start);
385+ batch_init(&state, vma, start, bv->state_start, SZ_4K);
355386
356− interface_descriptor =
357− gen7_fill_interface_descriptor(&state, bv,
358− IS_HASWELL(i915) ?
359− &cb_kernel_hsw :
360− &cb_kernel_ivb,
361− desc_count);
362− gen7_emit_pipeline_flush(&cmds);
387+ descriptors = gen7_fill_interface_descriptor(&state, bv,
388+ IS_HASWELL(i915) ?
389+ &cb_kernel_hsw :
390+ &cb_kernel_ivb,
391+ desc_count);
392+
393+ gen7_emit_pipeline_invalidate(&cmds);
363394 batch_add(&cmds, PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
364395 batch_add(&cmds, MI_NOOP);
365− gen7_emit_state_base_address(&cmds, interface_descriptor);
396+ gen7_emit_pipeline_invalidate(&cmds);
397+
366398 gen7_emit_pipeline_flush(&cmds);
399+ gen7_emit_state_base_address(&cmds, descriptors);
400+ gen7_emit_pipeline_invalidate(&cmds);
367401
368402 gen7_emit_vfe_state(&cmds, bv, urb_size - 1, 0, 0);
403+ gen7_emit_interface_descriptor_load(&cmds, descriptors, desc_count);
369404
370− gen7_emit_interface_descriptor_load(&cmds,
371− interface_descriptor,
372− desc_count);
373−
374− for (i = 0; i < bv->max_primitives; i++)
405+ for (i = 0; i < num_primitives(bv); i++)
375406 gen7_emit_media_object(&cmds, i);
376407
377408 batch_add(&cmds, MI_BATCH_BUFFER_END);
@@ -385,15 +416,15 @@ int gen7_setup_clear_gpr_bb(struct intel_engine_cs * const engine, · 7 unmodified lines
385416
386417 batch_get_defaults(engine->i915, &bv);
387418 if (!vma)
388− return bv.max_size;
419+ return bv.size;
389420
390− GEM_BUG_ON(vma->obj->base.size < bv.max_size);
421+ GEM_BUG_ON(vma->obj->base.size < bv.size);
391422
392423 batch = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
393424 if (IS_ERR(batch))
394425 return PTR_ERR(batch);
395426
396− emit_batch(vma, memset(batch, 0, bv.max_size), &bv);
427+ emit_batch(vma, memset(batch, 0, bv.size), &bv);
397428
398429 i915_gem_object_flush_map(vma->obj);
399430 __i915_gem_object_release_map(vma->obj);
drivers/gpu/drm/i915/gt/intel_ring_submission.c+4−2
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "gen6_ppgtt.h"
3333 #include "gen7_renderclear.h"
3434 #include "i915_drv.h"
35+#include "i915_mitigations.h"
3536 #include "intel_breadcrumbs.h"
3637 #include "intel_context.h"
3738 #include "intel_gt.h"
@@ -886,7 +887,8 @@ static int switch_context(struct i915_request *rq) · 848 unmodified lines
886887 GEM_BUG_ON(HAS_EXECLISTS(engine->i915));
887888
888889 if (engine->wa_ctx.vma && ce != engine->kernel_context) {
889− if (engine->wa_ctx.vma->private != ce) {
890+ if (engine->wa_ctx.vma->private != ce &&
891+ i915_mitigate_clear_residuals()) {
890892 ret = clear_residuals(rq);
891893 if (ret)
892894 return ret;
@@ -1290,7 +1292,7 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine) · 397 unmodified lines
12901292
12911293 GEM_BUG_ON(timeline->hwsp_ggtt != engine->status_page.vma);
12921294
1293− if (IS_HASWELL(engine->i915) && engine->class == RENDER_CLASS) {
1295+ if (IS_GEN(engine->i915, 7) && engine->class == RENDER_CLASS) {
12941296 err = gen7_ctx_switch_bb_init(engine);
12951297 if (err)
12961298 goto err_ring_unpin;
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c+1−0
@@ -53,6 +53,7 @@ void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw, · 52 unmodified lines
5353 fw_def(ELKHARTLAKE, 0, guc_def(ehl, 49, 0, 1), huc_def(ehl, 9, 0, 0)) \
5454 fw_def(ICELAKE, 0, guc_def(icl, 49, 0, 1), huc_def(icl, 9, 0, 0)) \
5555 fw_def(COMETLAKE, 5, guc_def(cml, 49, 0, 1), huc_def(cml, 4, 0, 0)) \
56+ fw_def(COMETLAKE, 0, guc_def(kbl, 49, 0, 1), huc_def(kbl, 4, 0, 0)) \
5657 fw_def(COFFEELAKE, 0, guc_def(kbl, 49, 0, 1), huc_def(kbl, 4, 0, 0)) \
5758 fw_def(GEMINILAKE, 0, guc_def(glk, 49, 0, 1), huc_def(glk, 4, 0, 0)) \
5859 fw_def(KABYLAKE, 0, guc_def(kbl, 49, 0, 1), huc_def(kbl, 4, 0, 0)) \
drivers/gpu/drm/i915/gvt/display.c+57−24
@@ -217,6 +217,15 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 216 unmodified lines
217217 DDI_BUF_CTL_ENABLE);
218218 vgpu_vreg_t(vgpu, DDI_BUF_CTL(port)) |= DDI_BUF_IS_IDLE;
219219 }
220+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
221+ ~(PORTA_HOTPLUG_ENABLE | PORTA_HOTPLUG_STATUS_MASK);
222+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
223+ ~(PORTB_HOTPLUG_ENABLE | PORTB_HOTPLUG_STATUS_MASK);
224+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
225+ ~(PORTC_HOTPLUG_ENABLE | PORTC_HOTPLUG_STATUS_MASK);
226+ /* No hpd_invert set in vgpu vbt, need to clear invert mask */
227+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &= ~BXT_DDI_HPD_INVERT_MASK;
228+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &= ~BXT_DE_PORT_HOTPLUG_MASK;
220229
221230 vgpu_vreg_t(vgpu, BXT_P_CR_GT_DISP_PWRON) &= ~(BIT(0) | BIT(1));
222231 vgpu_vreg_t(vgpu, BXT_PORT_CL1CM_DW0(DPIO_PHY0)) &=
@@ -273,6 +282,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 50 unmodified lines
273282 vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_EDP)) |=
274283 (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST |
275284 TRANS_DDI_FUNC_ENABLE);
285+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
286+ PORTA_HOTPLUG_ENABLE;
276287 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
277288 GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
278289 }
@@ -301,6 +312,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 22 unmodified lines
301312 (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST |
302313 (PORT_B << TRANS_DDI_PORT_SHIFT) |
303314 TRANS_DDI_FUNC_ENABLE);
315+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
316+ PORTB_HOTPLUG_ENABLE;
304317 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
305318 GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
306319 }
@@ -329,6 +342,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 22 unmodified lines
329342 (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST |
330343 (PORT_B << TRANS_DDI_PORT_SHIFT) |
331344 TRANS_DDI_FUNC_ENABLE);
345+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
346+ PORTC_HOTPLUG_ENABLE;
332347 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
333348 GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
334349 }
@@ -661,44 +676,62 @@ void intel_vgpu_emulate_hotplug(struct intel_vgpu *vgpu, bool connected) · 326 unmodified lines
661676 PORTD_HOTPLUG_STATUS_MASK;
662677 intel_vgpu_trigger_virtual_event(vgpu, DP_D_HOTPLUG);
663678 } else if (IS_BROXTON(i915)) {
664− if (connected) {
665− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_A)) {
679+ if (intel_vgpu_has_monitor_on_port(vgpu, PORT_A)) {
680+ if (connected) {
666681 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
667682 GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
683+ } else {
684+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
685+ ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
668686 }
669− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_B)) {
670− vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
671− SFUSE_STRAP_DDIB_DETECTED;
687+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_IIR) |=
688+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
689+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
690+ ~PORTA_HOTPLUG_STATUS_MASK;
691+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
692+ PORTA_HOTPLUG_LONG_DETECT;
693+ intel_vgpu_trigger_virtual_event(vgpu, DP_A_HOTPLUG);
694+ }
695+ if (intel_vgpu_has_monitor_on_port(vgpu, PORT_B)) {
696+ if (connected) {
672697 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
673698 GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
674− }
675− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_C)) {
676699 vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
677− SFUSE_STRAP_DDIC_DETECTED;
678− vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
679− GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
680− }
681− } else {
682− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_A)) {
700+ SFUSE_STRAP_DDIB_DETECTED;
701+ } else {
683702 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
684− ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
685− }
686− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_B)) {
703+ ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
687704 vgpu_vreg_t(vgpu, SFUSE_STRAP) &=
688705 ~SFUSE_STRAP_DDIB_DETECTED;
689− vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
690− ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
691706 }
692− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_C)) {
693− vgpu_vreg_t(vgpu, SFUSE_STRAP) &=
694− ~SFUSE_STRAP_DDIC_DETECTED;
707+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_IIR) |=
708+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
709+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
710+ ~PORTB_HOTPLUG_STATUS_MASK;
711+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
712+ PORTB_HOTPLUG_LONG_DETECT;
713+ intel_vgpu_trigger_virtual_event(vgpu, DP_B_HOTPLUG);
714+ }
715+ if (intel_vgpu_has_monitor_on_port(vgpu, PORT_C)) {
716+ if (connected) {
717+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
718+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
719+ vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
720+ SFUSE_STRAP_DDIC_DETECTED;
721+ } else {
695722 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
696723 ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
724+ vgpu_vreg_t(vgpu, SFUSE_STRAP) &=
725+ ~SFUSE_STRAP_DDIC_DETECTED;
697726 }
727+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_IIR) |=
728+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
729+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
730+ ~PORTC_HOTPLUG_STATUS_MASK;
731+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
732+ PORTC_HOTPLUG_LONG_DETECT;
733+ intel_vgpu_trigger_virtual_event(vgpu, DP_C_HOTPLUG);
698734 }
699− vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
700− PORTB_HOTPLUG_STATUS_MASK;
701− intel_vgpu_trigger_virtual_event(vgpu, DP_B_HOTPLUG);
702735 }
703736 }
704737
drivers/gpu/drm/i915/gvt/vgpu.c+2−3
@@ -437,10 +437,9 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt, · 436 unmodified lines
437437 if (ret)
438438 goto out_clean_sched_policy;
439439
440− if (IS_BROADWELL(dev_priv))
440+ if (IS_BROADWELL(dev_priv) || IS_BROXTON(dev_priv))
441441 ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_B);
442− /* FixMe: Re-enable APL/BXT once vfio_edid enabled */
443− else if (!IS_BROXTON(dev_priv))
442+ else
444443 ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D);
445444 if (ret)
446445 goto out_clean_sched_policy;
drivers/gpu/drm/i915/i915_cmd_parser.c+9−18
@@ -1166,7 +1166,7 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, · 1165 unmodified lines
11661166 }
11671167 }
11681168 if (IS_ERR(src)) {
1169− unsigned long x, n;
1169+ unsigned long x, n, remain;
11701170 void *ptr;
11711171
11721172 /*
@@ -1177,14 +1177,15 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, · 4 unmodified lines
11771177 * We don't care about copying too much here as we only
11781178 * validate up to the end of the batch.
11791179 */
1180+ remain = length;
11801181 if (!(dst_obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ))
1181− length = round_up(length,
1182+ remain = round_up(remain,
11821183 boot_cpu_data.x86_clflush_size);
11831184
11841185 ptr = dst;
11851186 x = offset_in_page(offset);
1186− for (n = offset >> PAGE_SHIFT; length; n++) {
1187− int len = min(length, PAGE_SIZE - x);
1187+ for (n = offset >> PAGE_SHIFT; remain; n++) {
1188+ int len = min(remain, PAGE_SIZE - x);
11881189
11891190 src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
11901191 if (needs_clflush)
@@ -1193,13 +1194,15 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, · 2 unmodified lines
11931194 kunmap_atomic(src);
11941195
11951196 ptr += len;
1196− length -= len;
1197+ remain -= len;
11971198 x = 0;
11981199 }
11991200 }
12001201
12011202 i915_gem_object_unpin_pages(src_obj);
12021203
1204+ memset32(dst + length, 0, (dst_obj->base.size - length) / sizeof(u32));
1205+
12031206 /* dst_obj is returned with vmap pinned */
12041207 return dst;
12051208 }
@@ -1392,11 +1395,6 @@ static unsigned long *alloc_whitelist(u32 batch_length) · 186 unmodified lines
13921395
13931396 #define LENGTH_BIAS 2
13941397
1395−static bool shadow_needs_clflush(struct drm_i915_gem_object *obj)
1396−{
1397− return !(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_WRITE);
1398−}
1399−
14001398 /**
14011399 * intel_engine_cmd_parser() - parse a batch buffer for privilege violations
14021400 * @engine: the engine on which the batch is to execute
@@ -1538,16 +1536,9 @@ int intel_engine_cmd_parser(struct intel_engine_cs *engine, · 135 unmodified lines
15381536 ret = 0; /* allow execution */
15391537 }
15401538 }
1541−
1542− if (shadow_needs_clflush(shadow->obj))
1543− drm_clflush_virt_range(batch_end, 8);
15441539 }
15451540
1546− if (shadow_needs_clflush(shadow->obj)) {
1547− void *ptr = page_mask_bits(shadow->obj->mm.mapping);
1548−
1549− drm_clflush_virt_range(ptr, (void *)(cmd + 1) - ptr);
1550− }
1541+ i915_gem_object_flush_map(shadow->obj);
15511542
15521543 if (!IS_ERR_OR_NULL(jump_whitelist))
15531544 kfree(jump_whitelist);
drivers/gpu/drm/i915/i915_drv.c+4−5
@@ -578,8 +578,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) · 577 unmodified lines
578578
579579 pci_set_master(pdev);
580580
581− cpu_latency_qos_add_request(&dev_priv->pm_qos, PM_QOS_DEFAULT_VALUE);
582−
583581 intel_gt_init_workarounds(dev_priv);
584582
585583 /* On the 945G/GM, the chipset reports the MSI capability on the
@@ -626,7 +624,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) · 40 unmodified lines
626624 err_msi:
627625 if (pdev->msi_enabled)
628626 pci_disable_msi(pdev);
629− cpu_latency_qos_remove_request(&dev_priv->pm_qos);
630627 err_mem_regions:
631628 intel_memory_regions_driver_release(dev_priv);
632629 err_ggtt:
@@ -648,8 +645,6 @@ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv) · 15 unmodified lines
648645
649646 if (pdev->msi_enabled)
650647 pci_disable_msi(pdev);
651−
652− cpu_latency_qos_remove_request(&dev_priv->pm_qos);
653648 }
654649
655650 /**
@@ -1052,6 +1047,8 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv) · 396 unmodified lines
10521047
10531048 void i915_driver_shutdown(struct drm_i915_private *i915)
10541049 {
1050+ disable_rpm_wakeref_asserts(&i915->runtime_pm);
1051+
10551052 i915_gem_suspend(i915);
10561053
10571054 drm_kms_helper_poll_disable(&i915->drm);
@@ -1065,6 +1062,8 @@ void i915_driver_shutdown(struct drm_i915_private *i915) · 7 unmodified lines
10651062
10661063 intel_suspend_encoders(i915);
10671064 intel_shutdown_encoders(i915);
1065+
1066+ enable_rpm_wakeref_asserts(&i915->runtime_pm);
10681067 }
10691068
10701069 static bool suspend_to_idle(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_drv.h+0−3
@@ -891,9 +891,6 @@ struct drm_i915_private { · 890 unmodified lines
891891
892892 bool display_irqs_enabled;
893893
894− /* To control wakeup latency, e.g. for irq-driven dp aux transfers. */
895− struct pm_qos_request pm_qos;
896−
897894 /* Sideband mailbox protection */
898895 struct mutex sb_lock;
899896 struct pm_qos_request sb_qos;
drivers/gpu/drm/i915/i915_mitigations.c+146−0
@@ -0,0 +1,146 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright © 2021 Intel Corporation
4+ */
5+
6+#include <linux/kernel.h>
7+#include <linux/moduleparam.h>
8+#include <linux/slab.h>
9+#include <linux/string.h>
10+
11+#include "i915_drv.h"
12+#include "i915_mitigations.h"
13+
14+static unsigned long mitigations __read_mostly = ~0UL;
15+
16+enum {
17+ CLEAR_RESIDUALS = 0,
18+};
19+
20+static const char * const names[] = {
21+ [CLEAR_RESIDUALS] = "residuals",
22+};
23+
24+bool i915_mitigate_clear_residuals(void)
25+{
26+ return READ_ONCE(mitigations) & BIT(CLEAR_RESIDUALS);
27+}
28+
29+static int mitigations_set(const char *val, const struct kernel_param *kp)
30+{
31+ unsigned long new = ~0UL;
32+ char *str, *sep, *tok;
33+ bool first = true;
34+ int err = 0;
35+
36+ BUILD_BUG_ON(ARRAY_SIZE(names) >= BITS_PER_TYPE(mitigations));
37+
38+ str = kstrdup(val, GFP_KERNEL);
39+ if (!str)
40+ return -ENOMEM;
41+
42+ for (sep = str; (tok = strsep(&sep, ","));) {
43+ bool enable = true;
44+ int i;
45+
46+ /* Be tolerant of leading/trailing whitespace */
47+ tok = strim(tok);
48+
49+ if (first) {
50+ first = false;
51+
52+ if (!strcmp(tok, "auto"))
53+ continue;
54+
55+ new = 0;
56+ if (!strcmp(tok, "off"))
57+ continue;
58+ }
59+
60+ if (*tok == '!') {
61+ enable = !enable;
62+ tok++;
63+ }
64+
65+ if (!strncmp(tok, "no", 2)) {
66+ enable = !enable;
67+ tok += 2;
68+ }
69+
70+ if (*tok == '\0')
71+ continue;
72+
73+ for (i = 0; i < ARRAY_SIZE(names); i++) {
74+ if (!strcmp(tok, names[i])) {
75+ if (enable)
76+ new |= BIT(i);
77+ else
78+ new &= ~BIT(i);
79+ break;
80+ }
81+ }
82+ if (i == ARRAY_SIZE(names)) {
83+ pr_err("Bad \"%s.mitigations=%s\", '%s' is unknown\n",
84+ DRIVER_NAME, val, tok);
85+ err = -EINVAL;
86+ break;
87+ }
88+ }
89+ kfree(str);
90+ if (err)
91+ return err;
92+
93+ WRITE_ONCE(mitigations, new);
94+ return 0;
95+}
96+
97+static int mitigations_get(char *buffer, const struct kernel_param *kp)
98+{
99+ unsigned long local = READ_ONCE(mitigations);
100+ int count, i;
101+ bool enable;
102+
103+ if (!local)
104+ return scnprintf(buffer, PAGE_SIZE, "%s\n", "off");
105+
106+ if (local & BIT(BITS_PER_LONG - 1)) {
107+ count = scnprintf(buffer, PAGE_SIZE, "%s,", "auto");
108+ enable = false;
109+ } else {
110+ enable = true;
111+ count = 0;
112+ }
113+
114+ for (i = 0; i < ARRAY_SIZE(names); i++) {
115+ if ((local & BIT(i)) != enable)
116+ continue;
117+
118+ count += scnprintf(buffer + count, PAGE_SIZE - count,
119+ "%s%s,", enable ? "" : "!", names[i]);
120+ }
121+
122+ buffer[count - 1] = '\n';
123+ return count;
124+}
125+
126+static const struct kernel_param_ops ops = {
127+ .set = mitigations_set,
128+ .get = mitigations_get,
129+};
130+
131+module_param_cb_unsafe(mitigations, &ops, NULL, 0600);
132+MODULE_PARM_DESC(mitigations,
133+"Selectively enable security mitigations for all Intel® GPUs in the system.\n"
134+"\n"
135+" auto -- enables all mitigations required for the platform [default]\n"
136+" off -- disables all mitigations\n"
137+"\n"
138+"Individual mitigations can be enabled by passing a comma-separated string,\n"
139+"e.g. mitigations=residuals to enable only clearing residuals or\n"
140+"mitigations=auto,noresiduals to disable only the clear residual mitigation.\n"
141+"Either '!' or 'no' may be used to switch from enabling the mitigation to\n"
142+"disabling it.\n"
143+"\n"
144+"Active mitigations for Ivybridge, Baytrail, Haswell:\n"
145+" residuals -- clear all thread-local registers between contexts"
146+);
drivers/gpu/drm/i915/i915_mitigations.h+13−0
@@ -0,0 +1,13 @@
1+/* SPDX-License-Identifier: MIT */
2+/*
3+ * Copyright © 2021 Intel Corporation
4+ */
5+
6+#ifndef __I915_MITIGATIONS_H__
7+#define __I915_MITIGATIONS_H__
8+
9+#include <linux/types.h>
10+
11+bool i915_mitigate_clear_residuals(void);
12+
13+#endif /* __I915_MITIGATIONS_H__ */
drivers/gpu/drm/msm/adreno/a2xx_gpu.c+4−2
@@ -534,8 +534,10 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) · 533 unmodified lines
534534
535535 if (!gpu->aspace) {
536536 dev_err(dev->dev, "No memory protection without MMU\n");
537− ret = -ENXIO;
538− goto fail;
537+ if (!allow_vram_carveout) {
538+ ret = -ENXIO;
539+ goto fail;
540+ }
539541 }
540542
541543 return gpu;
drivers/gpu/drm/msm/adreno/a3xx_gpu.c+4−2
@@ -564,8 +564,10 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) · 563 unmodified lines
564564 * implement a cmdstream validator.
565565 */
566566 DRM_DEV_ERROR(dev->dev, "No memory protection without IOMMU\n");
567− ret = -ENXIO;
568− goto fail;
567+ if (!allow_vram_carveout) {
568+ ret = -ENXIO;
569+ goto fail;
570+ }
569571 }
570572
571573 icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
drivers/gpu/drm/msm/adreno/a4xx_gpu.c+4−2
@@ -692,8 +692,10 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) · 691 unmodified lines
692692 * implement a cmdstream validator.
693693 */
694694 DRM_DEV_ERROR(dev->dev, "No memory protection without IOMMU\n");
695− ret = -ENXIO;
696− goto fail;
695+ if (!allow_vram_carveout) {
696+ ret = -ENXIO;
697+ goto fail;
698+ }
697699 }
698700
699701 icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
drivers/gpu/drm/msm/adreno/adreno_device.c+4−0
@@ -18,6 +18,10 @@ bool snapshot_debugbus = false; · 17 unmodified lines
1818 MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU devcoredump (if not fused off)");
1919 module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
2020
21+bool allow_vram_carveout = false;
22+MODULE_PARM_DESC(allow_vram_carveout, "Allow using VRAM Carveout, in place of IOMMU");
23+module_param_named(allow_vram_carveout, allow_vram_carveout, bool, 0600);
24+
2125 static const struct adreno_info gpulist[] = {
2226 {
2327 .rev = ADRENO_REV(2, 0, 0, 0),
drivers/gpu/drm/msm/adreno/adreno_gpu.c+12−9
@@ -191,8 +191,6 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 190 unmodified lines
191191 struct platform_device *pdev)
192192 {
193193 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
194− struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
195− struct io_pgtable_domain_attr pgtbl_cfg;
196194 struct iommu_domain *iommu;
197195 struct msm_mmu *mmu;
198196 struct msm_gem_address_space *aspace;
@@ -202,13 +200,18 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 3 unmodified lines
202200 if (!iommu)
203201 return NULL;
204202
205− /*
206− * This allows GPU to set the bus attributes required to use system
207− * cache on behalf of the iommu page table walker.
208− */
209− if (!IS_ERR(a6xx_gpu->htw_llc_slice)) {
210− pgtbl_cfg.quirks = IO_PGTABLE_QUIRK_ARM_OUTER_WBWA;
211− iommu_domain_set_attr(iommu, DOMAIN_ATTR_IO_PGTABLE_CFG, &pgtbl_cfg);
203+
204+ if (adreno_is_a6xx(adreno_gpu)) {
205+ struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
206+ struct io_pgtable_domain_attr pgtbl_cfg;
207+ /*
208+ * This allows GPU to set the bus attributes required to use system
209+ * cache on behalf of the iommu page table walker.
210+ */
211+ if (!IS_ERR(a6xx_gpu->htw_llc_slice)) {
212+ pgtbl_cfg.quirks = IO_PGTABLE_QUIRK_ARM_OUTER_WBWA;
213+ iommu_domain_set_attr(iommu, DOMAIN_ATTR_IO_PGTABLE_CFG, &pgtbl_cfg);
214+ }
212215 }
213216
214217 mmu = msm_iommu_new(&pdev->dev, iommu);
drivers/gpu/drm/msm/adreno/adreno_gpu.h+6−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include "adreno_pm4.xml.h"
1919
2020 extern bool snapshot_debugbus;
21+extern bool allow_vram_carveout;
2122
2223 enum {
2324 ADRENO_FW_PM4 = 0,
@@ -211,6 +212,11 @@ static inline int adreno_is_a540(struct adreno_gpu *gpu) · 187 unmodified lines
211212 return gpu->revn == 540;
212213 }
213214
215+static inline bool adreno_is_a6xx(struct adreno_gpu *gpu)
216+{
217+ return ((gpu->revn < 700 && gpu->revn > 599));
218+}
219+
214220 static inline int adreno_is_a618(struct adreno_gpu *gpu)
215221 {
216222 return gpu->revn == 618;
drivers/gpu/drm/msm/dp/dp_display.c+7−0
@@ -693,6 +693,13 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data) · 692 unmodified lines
693693 return 0;
694694 }
695695
696+ if (state == ST_CONNECT_PENDING) {
697+ /* wait until ST_CONNECTED */
698+ dp_add_event(dp, EV_IRQ_HPD_INT, 0, 1); /* delay = 1 */
699+ mutex_unlock(&dp->event_mutex);
700+ return 0;
701+ }
702+
696703 ret = dp_display_usbpd_attention_cb(&dp->pdev->dev);
697704 if (ret == -ECONNRESET) { /* cable unplugged */
698705 dp->core_initialized = false;
drivers/gpu/drm/msm/dp/dp_panel.c+9−3
@@ -167,12 +167,18 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel, · 166 unmodified lines
167167 panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
168168
169169 rc = dp_panel_read_dpcd(dp_panel);
170+ if (rc) {
171+ DRM_ERROR("read dpcd failed %d\n", rc);
172+ return rc;
173+ }
174+
170175 bw_code = drm_dp_link_rate_to_bw_code(dp_panel->link_info.rate);
171− if (rc || !is_link_rate_valid(bw_code) ||
176+ if (!is_link_rate_valid(bw_code) ||
172177 !is_lane_count_valid(dp_panel->link_info.num_lanes) ||
173178 (bw_code > dp_panel->max_bw_code)) {
174− DRM_ERROR("read dpcd failed %d\n", rc);
175− return rc;
179+ DRM_ERROR("Illegal link rate=%d lane=%d\n", dp_panel->link_info.rate,
180+ dp_panel->link_info.num_lanes);
181+ return -EINVAL;
176182 }
177183
178184 if (dp_panel->dfp_present) {
drivers/gpu/drm/msm/msm_drv.c+4−4
@@ -457,14 +457,14 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 456 unmodified lines
457457
458458 drm_mode_config_init(ddev);
459459
460− /* Bind all our sub-components: */
461− ret = component_bind_all(dev, ddev);
460+ ret = msm_init_vram(ddev);
462461 if (ret)
463462 goto err_destroy_mdss;
464463
465− ret = msm_init_vram(ddev);
464+ /* Bind all our sub-components: */
465+ ret = component_bind_all(dev, ddev);
466466 if (ret)
467− goto err_msm_uninit;
467+ goto err_destroy_mdss;
468468
469469 dma_set_max_seg_size(dev, UINT_MAX);
470470
drivers/gpu/drm/msm/msm_gem.c+9−4
@@ -96,6 +96,8 @@ static struct page **get_pages(struct drm_gem_object *obj) · 95 unmodified lines
9696 {
9797 struct msm_gem_object *msm_obj = to_msm_bo(obj);
9898
99+ WARN_ON(!msm_gem_is_locked(obj));
100+
99101 if (!msm_obj->pages) {
100102 struct drm_device *dev = obj->dev;
101103 struct page **p;
@@ -988,6 +990,8 @@ void msm_gem_free_object(struct drm_gem_object *obj) · 886 unmodified lines
988990 if (msm_obj->pages)
989991 kvfree(msm_obj->pages);
990992
993+ put_iova_vmas(obj);
994+
991995 /* dma_buf_detach() grabs resv lock, so we need to unlock
992996 * prior to drm_prime_gem_destroy
993997 */
@@ -997,11 +1001,10 @@ void msm_gem_free_object(struct drm_gem_object *obj) · 3 unmodified lines
9971001 } else {
9981002 msm_gem_vunmap(obj);
9991003 put_pages(obj);
1004+ put_iova_vmas(obj);
10001005 msm_gem_unlock(obj);
10011006 }
10021007
1003− put_iova_vmas(obj);
1004−
10051008 drm_gem_object_release(obj);
10061009
10071010 kfree(msm_obj);
@@ -1115,6 +1118,8 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, · 107 unmodified lines
11151118 struct msm_gem_vma *vma;
11161119 struct page **pages;
11171120
1121+ drm_gem_private_object_init(dev, obj, size);
1122+
11181123 msm_gem_lock(obj);
11191124
11201125 vma = add_vma(obj, NULL);
@@ -1126,9 +1131,9 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, · 5 unmodified lines
11261131
11271132 to_msm_bo(obj)->vram_node = &vma->node;
11281133
1129− drm_gem_private_object_init(dev, obj, size);
1130−
1134+ msm_gem_lock(obj);
11311135 pages = get_pages(obj);
1136+ msm_gem_unlock(obj);
11321137 if (IS_ERR(pages)) {
11331138 ret = PTR_ERR(pages);
11341139 goto fail;
drivers/gpu/drm/nouveau/dispnv50/Kbuild+1−0
@@ -37,6 +37,7 @@ nouveau-y += dispnv50/wimmc37b.o · 36 unmodified lines
3737 nouveau-y += dispnv50/wndw.o
3838 nouveau-y += dispnv50/wndwc37e.o
3939 nouveau-y += dispnv50/wndwc57e.o
40+nouveau-y += dispnv50/wndwc67e.o
4041
4142 nouveau-y += dispnv50/base.o
4243 nouveau-y += dispnv50/base507c.o
drivers/gpu/drm/nouveau/dispnv50/core.c+1−0
@@ -42,6 +42,7 @@ nv50_core_new(struct nouveau_drm *drm, struct nv50_core **pcore) · 41 unmodified lines
4242 int version;
4343 int (*new)(struct nouveau_drm *, s32, struct nv50_core **);
4444 } cores[] = {
45+ { GA102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },
4546 { TU102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },
4647 { GV100_DISP_CORE_CHANNEL_DMA, 0, corec37d_new },
4748 { GP102_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
drivers/gpu/drm/nouveau/dispnv50/curs.c+1−0
@@ -31,6 +31,7 @@ nv50_curs_new(struct nouveau_drm *drm, int head, struct nv50_wndw **pwndw) · 30 unmodified lines
3131 int version;
3232 int (*new)(struct nouveau_drm *, int, s32, struct nv50_wndw **);
3333 } curses[] = {
34+ { GA102_DISP_CURSOR, 0, cursc37a_new },
3435 { TU102_DISP_CURSOR, 0, cursc37a_new },
3536 { GV100_DISP_CURSOR, 0, cursc37a_new },
3637 { GK104_DISP_CURSOR, 0, curs907a_new },
drivers/gpu/drm/nouveau/dispnv50/disp.c+2−2
@@ -222,7 +222,7 @@ nv50_dmac_wait(struct nvif_push *push, u32 size) · 221 unmodified lines
222222
223223 int
224224 nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
225− const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf,
225+ const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf,
226226 struct nv50_dmac *dmac)
227227 {
228228 struct nouveau_cli *cli = (void *)device->object.client;
@@ -271,7 +271,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, · 42 unmodified lines
271271 if (ret)
272272 return ret;
273273
274− if (!syncbuf)
274+ if (syncbuf < 0)
275275 return 0;
276276
277277 ret = nvif_object_ctor(&dmac->base.user, "kmsSyncCtxDma", NV50_DISP_HANDLE_SYNCBUF,
drivers/gpu/drm/nouveau/dispnv50/disp.h+1−1
@@ -95,7 +95,7 @@ struct nv50_outp_atom { · 94 unmodified lines
9595
9696 int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
9797 const s32 *oclass, u8 head, void *data, u32 size,
98− u64 syncbuf, struct nv50_dmac *dmac);
98+ s64 syncbuf, struct nv50_dmac *dmac);
9999 void nv50_dmac_destroy(struct nv50_dmac *);
100100
101101 /*
drivers/gpu/drm/nouveau/dispnv50/wimm.c+1−0
@@ -31,6 +31,7 @@ nv50_wimm_init(struct nouveau_drm *drm, struct nv50_wndw *wndw) · 30 unmodified lines
3131 int version;
3232 int (*init)(struct nouveau_drm *, s32, struct nv50_wndw *);
3333 } wimms[] = {
34+ { GA102_DISP_WINDOW_IMM_CHANNEL_DMA, 0, wimmc37b_init },
3435 { TU102_DISP_WINDOW_IMM_CHANNEL_DMA, 0, wimmc37b_init },
3536 { GV100_DISP_WINDOW_IMM_CHANNEL_DMA, 0, wimmc37b_init },
3637 {}
drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c+1−1
@@ -76,7 +76,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm, · 75 unmodified lines
7676 int ret;
7777
7878 ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
79− &oclass, 0, &args, sizeof(args), 0,
79+ &oclass, 0, &args, sizeof(args), -1,
8080 &wndw->wimm);
8181 if (ret) {
8282 NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);
drivers/gpu/drm/nouveau/dispnv50/wndw.c+1−0
@@ -784,6 +784,7 @@ nv50_wndw_new(struct nouveau_drm *drm, enum drm_plane_type type, int index, · 783 unmodified lines
784784 int (*new)(struct nouveau_drm *, enum drm_plane_type,
785785 int, s32, struct nv50_wndw **);
786786 } wndws[] = {
787+ { GA102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc67e_new },
787788 { TU102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc57e_new },
788789 { GV100_DISP_WINDOW_CHANNEL_DMA, 0, wndwc37e_new },
789790 {}
drivers/gpu/drm/nouveau/dispnv50/wndw.h+8−0
@@ -129,6 +129,14 @@ int wndwc37e_update(struct nv50_wndw *, u32 *); · 128 unmodified lines
129129
130130 int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
131131 struct nv50_wndw **);
132+bool wndwc57e_ilut(struct nv50_wndw *, struct nv50_wndw_atom *, int);
133+int wndwc57e_ilut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
134+int wndwc57e_ilut_clr(struct nv50_wndw *);
135+int wndwc57e_csc_set(struct nv50_wndw *, struct nv50_wndw_atom *);
136+int wndwc57e_csc_clr(struct nv50_wndw *);
137+
138+int wndwc67e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
139+ struct nv50_wndw **);
132140
133141 int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
134142 struct nv50_wndw **);
drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c+5−5
@@ -80,7 +80,7 @@ wndwc57e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) · 79 unmodified lines
8080 return 0;
8181 }
8282
83−static int
83+int
8484 wndwc57e_csc_clr(struct nv50_wndw *wndw)
8585 {
8686 struct nvif_push *push = wndw->wndw.push;
@@ -98,7 +98,7 @@ wndwc57e_csc_clr(struct nv50_wndw *wndw) · 11 unmodified lines
9898 return 0;
9999 }
100100
101−static int
101+int
102102 wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
103103 {
104104 struct nvif_push *push = wndw->wndw.push;
@@ -111,7 +111,7 @@ wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) · 6 unmodified lines
111111 return 0;
112112 }
113113
114−static int
114+int
115115 wndwc57e_ilut_clr(struct nv50_wndw *wndw)
116116 {
117117 struct nvif_push *push = wndw->wndw.push;
@@ -124,7 +124,7 @@ wndwc57e_ilut_clr(struct nv50_wndw *wndw) · 6 unmodified lines
124124 return 0;
125125 }
126126
127−static int
127+int
128128 wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
129129 {
130130 struct nvif_push *push = wndw->wndw.push;
@@ -179,7 +179,7 @@ wndwc57e_ilut_load(struct drm_color_lut *in, int size, void __iomem *mem) · 48 unmodified lines
179179 writew(readw(mem - 4), mem + 4);
180180 }
181181
182−static bool
182+bool
183183 wndwc57e_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size)
184184 {
185185 if (size = size ? size : 1024, size != 256 && size != 1024)
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c+106−0
@@ -0,0 +1,106 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "wndw.h"
23+#include "atom.h"
24+
25+#include <nvif/pushc37b.h>
26+
27+#include <nvhw/class/clc57e.h>
28+
29+static int
30+wndwc67e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
31+{
32+ struct nvif_push *push = wndw->wndw.push;
33+ int ret;
34+
35+ if ((ret = PUSH_WAIT(push, 17)))
36+ return ret;
37+
38+ PUSH_MTHD(push, NVC57E, SET_PRESENT_CONTROL,
39+ NVVAL(NVC57E, SET_PRESENT_CONTROL, MIN_PRESENT_INTERVAL, asyw->image.interval) |
40+ NVVAL(NVC57E, SET_PRESENT_CONTROL, BEGIN_MODE, asyw->image.mode) |
41+ NVDEF(NVC57E, SET_PRESENT_CONTROL, TIMESTAMP_MODE, DISABLE));
42+
43+ PUSH_MTHD(push, NVC57E, SET_SIZE,
44+ NVVAL(NVC57E, SET_SIZE, WIDTH, asyw->image.w) |
45+ NVVAL(NVC57E, SET_SIZE, HEIGHT, asyw->image.h),
46+
47+ SET_STORAGE,
48+ NVVAL(NVC57E, SET_STORAGE, BLOCK_HEIGHT, asyw->image.blockh),
49+
50+ SET_PARAMS,
51+ NVVAL(NVC57E, SET_PARAMS, FORMAT, asyw->image.format) |
52+ NVDEF(NVC57E, SET_PARAMS, CLAMP_BEFORE_BLEND, DISABLE) |
53+ NVDEF(NVC57E, SET_PARAMS, SWAP_UV, DISABLE) |
54+ NVDEF(NVC57E, SET_PARAMS, FMT_ROUNDING_MODE, ROUND_TO_NEAREST),
55+
56+ SET_PLANAR_STORAGE(0),
57+ NVVAL(NVC57E, SET_PLANAR_STORAGE, PITCH, asyw->image.blocks[0]) |
58+ NVVAL(NVC57E, SET_PLANAR_STORAGE, PITCH, asyw->image.pitch[0] >> 6));
59+
60+ PUSH_MTHD(push, NVC57E, SET_CONTEXT_DMA_ISO(0), asyw->image.handle, 1);
61+ PUSH_MTHD(push, NVC57E, SET_OFFSET(0), asyw->image.offset[0] >> 8);
62+
63+ PUSH_MTHD(push, NVC57E, SET_POINT_IN(0),
64+ NVVAL(NVC57E, SET_POINT_IN, X, asyw->state.src_x >> 16) |
65+ NVVAL(NVC57E, SET_POINT_IN, Y, asyw->state.src_y >> 16));
66+
67+ PUSH_MTHD(push, NVC57E, SET_SIZE_IN,
68+ NVVAL(NVC57E, SET_SIZE_IN, WIDTH, asyw->state.src_w >> 16) |
69+ NVVAL(NVC57E, SET_SIZE_IN, HEIGHT, asyw->state.src_h >> 16));
70+
71+ PUSH_MTHD(push, NVC57E, SET_SIZE_OUT,
72+ NVVAL(NVC57E, SET_SIZE_OUT, WIDTH, asyw->state.crtc_w) |
73+ NVVAL(NVC57E, SET_SIZE_OUT, HEIGHT, asyw->state.crtc_h));
74+ return 0;
75+}
76+
77+static const struct nv50_wndw_func
78+wndwc67e = {
79+ .acquire = wndwc37e_acquire,
80+ .release = wndwc37e_release,
81+ .sema_set = wndwc37e_sema_set,
82+ .sema_clr = wndwc37e_sema_clr,
83+ .ntfy_set = wndwc37e_ntfy_set,
84+ .ntfy_clr = wndwc37e_ntfy_clr,
85+ .ntfy_reset = corec37d_ntfy_init,
86+ .ntfy_wait_begun = base507c_ntfy_wait_begun,
87+ .ilut = wndwc57e_ilut,
88+ .ilut_identity = true,
89+ .ilut_size = 1024,
90+ .xlut_set = wndwc57e_ilut_set,
91+ .xlut_clr = wndwc57e_ilut_clr,
92+ .csc = base907c_csc,
93+ .csc_set = wndwc57e_csc_set,
94+ .csc_clr = wndwc57e_csc_clr,
95+ .image_set = wndwc67e_image_set,
96+ .image_clr = wndwc37e_image_clr,
97+ .blend_set = wndwc37e_blend_set,
98+ .update = wndwc37e_update,
99+};
100+
101+int
102+wndwc67e_new(struct nouveau_drm *drm, enum drm_plane_type type, int index,
103+ s32 oclass, struct nv50_wndw **pwndw)
104+{
105+ return wndwc37e_new_(&wndwc67e, drm, type, index, oclass, BIT(index >> 1), pwndw);
106+}
drivers/gpu/drm/nouveau/include/nvif/cl0080.h+1−0
@@ -33,6 +33,7 @@ struct nv_device_info_v0 { · 32 unmodified lines
3333 #define NV_DEVICE_INFO_V0_PASCAL 0x0a
3434 #define NV_DEVICE_INFO_V0_VOLTA 0x0b
3535 #define NV_DEVICE_INFO_V0_TURING 0x0c
36+#define NV_DEVICE_INFO_V0_AMPERE 0x0d
3637 __u8 family;
3738 __u8 pad06[2];
3839 __u64 ram_size;
drivers/gpu/drm/nouveau/include/nvif/class.h+5−0
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888 #define GP102_DISP /* cl5070.h */ 0x00009870
8989 #define GV100_DISP /* cl5070.h */ 0x0000c370
9090 #define TU102_DISP /* cl5070.h */ 0x0000c570
91+#define GA102_DISP /* cl5070.h */ 0x0000c670
9192
9293 #define GV100_DISP_CAPS 0x0000c373
9394
@@ -103,6 +104,7 @@ · 9 unmodified lines
103104 #define GK104_DISP_CURSOR /* cl507a.h */ 0x0000917a
104105 #define GV100_DISP_CURSOR /* cl507a.h */ 0x0000c37a
105106 #define TU102_DISP_CURSOR /* cl507a.h */ 0x0000c57a
107+#define GA102_DISP_CURSOR /* cl507a.h */ 0x0000c67a
106108
107109 #define NV50_DISP_OVERLAY /* cl507b.h */ 0x0000507b
108110 #define G82_DISP_OVERLAY /* cl507b.h */ 0x0000827b
@@ -112,6 +114,7 @@ · 3 unmodified lines
112114
113115 #define GV100_DISP_WINDOW_IMM_CHANNEL_DMA /* clc37b.h */ 0x0000c37b
114116 #define TU102_DISP_WINDOW_IMM_CHANNEL_DMA /* clc37b.h */ 0x0000c57b
117+#define GA102_DISP_WINDOW_IMM_CHANNEL_DMA /* clc37b.h */ 0x0000c67b
115118
116119 #define NV50_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000507c
117120 #define G82_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000827c
@@ -135,6 +138,7 @@ · 17 unmodified lines
135138 #define GP102_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000987d
136139 #define GV100_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000c37d
137140 #define TU102_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000c57d
141+#define GA102_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000c67d
138142
139143 #define NV50_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000507e
140144 #define G82_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000827e
@@ -145,6 +149,7 @@ · 4 unmodified lines
145149
146150 #define GV100_DISP_WINDOW_CHANNEL_DMA /* clc37e.h */ 0x0000c37e
147151 #define TU102_DISP_WINDOW_CHANNEL_DMA /* clc37e.h */ 0x0000c57e
152+#define GA102_DISP_WINDOW_CHANNEL_DMA /* clc37e.h */ 0x0000c67e
148153
149154 #define NV50_TESLA 0x00005097
150155 #define G82_TESLA 0x00008297
drivers/gpu/drm/nouveau/include/nvkm/core/device.h+1−0
@@ -120,6 +120,7 @@ struct nvkm_device { · 119 unmodified lines
120120 GP100 = 0x130,
121121 GV100 = 0x140,
122122 TU100 = 0x160,
123+ GA100 = 0x170,
123124 } card_type;
124125 u32 chipset;
125126 u8 chiprev;
drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h+1−0
@@ -37,4 +37,5 @@ int gp100_disp_new(struct nvkm_device *, int, struct nvkm_disp **); · 36 unmodified lines
3737 int gp102_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
3838 int gv100_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
3939 int tu102_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
40+int ga102_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
4041 #endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h+1−0
@@ -32,4 +32,5 @@ int gm107_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **); · 31 unmodified lines
3232 int gm200_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
3333 int gv100_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
3434 int tu102_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
35+int ga100_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
3536 #endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h+2−0
@@ -86,6 +86,8 @@ int gp100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); · 85 unmodified lines
8686 int gp102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
8787 int gp10b_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
8888 int gv100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
89+int ga100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
90+int ga102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
8991
9092 #include <subdev/bios.h>
9193 #include <subdev/bios/ramcfg.h>
drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h+1−0
@@ -37,4 +37,5 @@ int nv50_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); · 36 unmodified lines
3737 int g94_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
3838 int gf119_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
3939 int gk104_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
40+int ga102_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
4041 #endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h+1−0
@@ -92,6 +92,7 @@ int g94_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **); · 91 unmodified lines
9292 int gf117_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9393 int gf119_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9494 int gk104_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
95+int gk110_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9596 int gm200_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9697
9798 static inline int
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h+1−0
@@ -32,4 +32,5 @@ int gk20a_mc_new(struct nvkm_device *, int, struct nvkm_mc **); · 31 unmodified lines
3232 int gp100_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
3333 int gp10b_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
3434 int tu102_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
35+int ga100_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
3536 #endif
drivers/gpu/drm/nouveau/nouveau_backlight.c+1−0
@@ -256,6 +256,7 @@ nouveau_backlight_init(struct drm_connector *connector) · 255 unmodified lines
256256 case NV_DEVICE_INFO_V0_PASCAL:
257257 case NV_DEVICE_INFO_V0_VOLTA:
258258 case NV_DEVICE_INFO_V0_TURING:
259+ case NV_DEVICE_INFO_V0_AMPERE: //XXX: not confirmed
259260 ret = nv50_backlight_init(nv_encoder, &props, &ops);
260261 break;
261262 default:
drivers/gpu/drm/nouveau/nvif/disp.c+1−0
@@ -35,6 +35,7 @@ nvif_disp_ctor(struct nvif_device *device, const char *name, s32 oclass, · 34 unmodified lines
3535 struct nvif_disp *disp)
3636 {
3737 static const struct nvif_mclass disps[] = {
38+ { GA102_DISP, -1 },
3839 { TU102_DISP, -1 },
3940 { GV100_DISP, -1 },
4041 { GP102_DISP, -1 },
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+78−9
@@ -1815,7 +1815,7 @@ nvf0_chipset = { · 1814 unmodified lines
18151815 .fb = gk110_fb_new,
18161816 .fuse = gf100_fuse_new,
18171817 .gpio = gk104_gpio_new,
1818− .i2c = gk104_i2c_new,
1818+ .i2c = gk110_i2c_new,
18191819 .ibus = gk104_ibus_new,
18201820 .iccsense = gf100_iccsense_new,
18211821 .imem = nv50_instmem_new,
@@ -1853,7 +1853,7 @@ nvf1_chipset = { · 31 unmodified lines
18531853 .fb = gk110_fb_new,
18541854 .fuse = gf100_fuse_new,
18551855 .gpio = gk104_gpio_new,
1856− .i2c = gk104_i2c_new,
1856+ .i2c = gk110_i2c_new,
18571857 .ibus = gk104_ibus_new,
18581858 .iccsense = gf100_iccsense_new,
18591859 .imem = nv50_instmem_new,
@@ -1891,7 +1891,7 @@ nv106_chipset = { · 31 unmodified lines
18911891 .fb = gk110_fb_new,
18921892 .fuse = gf100_fuse_new,
18931893 .gpio = gk104_gpio_new,
1894− .i2c = gk104_i2c_new,
1894+ .i2c = gk110_i2c_new,
18951895 .ibus = gk104_ibus_new,
18961896 .iccsense = gf100_iccsense_new,
18971897 .imem = nv50_instmem_new,
@@ -1929,7 +1929,7 @@ nv108_chipset = { · 31 unmodified lines
19291929 .fb = gk110_fb_new,
19301930 .fuse = gf100_fuse_new,
19311931 .gpio = gk104_gpio_new,
1932− .i2c = gk104_i2c_new,
1932+ .i2c = gk110_i2c_new,
19331933 .ibus = gk104_ibus_new,
19341934 .iccsense = gf100_iccsense_new,
19351935 .imem = nv50_instmem_new,
@@ -1967,7 +1967,7 @@ nv117_chipset = { · 31 unmodified lines
19671967 .fb = gm107_fb_new,
19681968 .fuse = gm107_fuse_new,
19691969 .gpio = gk104_gpio_new,
1970− .i2c = gk104_i2c_new,
1970+ .i2c = gk110_i2c_new,
19711971 .ibus = gk104_ibus_new,
19721972 .iccsense = gf100_iccsense_new,
19731973 .imem = nv50_instmem_new,
@@ -2003,7 +2003,7 @@ nv118_chipset = { · 29 unmodified lines
20032003 .fb = gm107_fb_new,
20042004 .fuse = gm107_fuse_new,
20052005 .gpio = gk104_gpio_new,
2006− .i2c = gk104_i2c_new,
2006+ .i2c = gk110_i2c_new,
20072007 .ibus = gk104_ibus_new,
20082008 .iccsense = gf100_iccsense_new,
20092009 .imem = nv50_instmem_new,
@@ -2652,6 +2652,61 @@ nv168_chipset = { · 642 unmodified lines
26522652 .sec2 = tu102_sec2_new,
26532653 };
26542654
2655+static const struct nvkm_device_chip
2656+nv170_chipset = {
2657+ .name = "GA100",
2658+ .bar = tu102_bar_new,
2659+ .bios = nvkm_bios_new,
2660+ .devinit = ga100_devinit_new,
2661+ .fb = ga100_fb_new,
2662+ .gpio = gk104_gpio_new,
2663+ .i2c = gm200_i2c_new,
2664+ .ibus = gm200_ibus_new,
2665+ .imem = nv50_instmem_new,
2666+ .mc = ga100_mc_new,
2667+ .mmu = tu102_mmu_new,
2668+ .pci = gp100_pci_new,
2669+ .timer = gk20a_timer_new,
2670+};
2671+
2672+static const struct nvkm_device_chip
2673+nv172_chipset = {
2674+ .name = "GA102",
2675+ .bar = tu102_bar_new,
2676+ .bios = nvkm_bios_new,
2677+ .devinit = ga100_devinit_new,
2678+ .fb = ga102_fb_new,
2679+ .gpio = ga102_gpio_new,
2680+ .i2c = gm200_i2c_new,
2681+ .ibus = gm200_ibus_new,
2682+ .imem = nv50_instmem_new,
2683+ .mc = ga100_mc_new,
2684+ .mmu = tu102_mmu_new,
2685+ .pci = gp100_pci_new,
2686+ .timer = gk20a_timer_new,
2687+ .disp = ga102_disp_new,
2688+ .dma = gv100_dma_new,
2689+};
2690+
2691+static const struct nvkm_device_chip
2692+nv174_chipset = {
2693+ .name = "GA104",
2694+ .bar = tu102_bar_new,
2695+ .bios = nvkm_bios_new,
2696+ .devinit = ga100_devinit_new,
2697+ .fb = ga102_fb_new,
2698+ .gpio = ga102_gpio_new,
2699+ .i2c = gm200_i2c_new,
2700+ .ibus = gm200_ibus_new,
2701+ .imem = nv50_instmem_new,
2702+ .mc = ga100_mc_new,
2703+ .mmu = tu102_mmu_new,
2704+ .pci = gp100_pci_new,
2705+ .timer = gk20a_timer_new,
2706+ .disp = ga102_disp_new,
2707+ .dma = gv100_dma_new,
2708+};
2709+
26552710 static int
26562711 nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
26572712 struct nvkm_notify *notify)
@@ -3063,6 +3118,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 405 unmodified lines
30633118 case 0x130: device->card_type = GP100; break;
30643119 case 0x140: device->card_type = GV100; break;
30653120 case 0x160: device->card_type = TU100; break;
3121+ case 0x170: device->card_type = GA100; break;
30663122 default:
30673123 break;
30683124 }
@@ -3160,10 +3216,23 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 91 unmodified lines
31603216 case 0x166: device->chip = &nv166_chipset; break;
31613217 case 0x167: device->chip = &nv167_chipset; break;
31623218 case 0x168: device->chip = &nv168_chipset; break;
3219+ case 0x172: device->chip = &nv172_chipset; break;
3220+ case 0x174: device->chip = &nv174_chipset; break;
31633221 default:
3164− nvdev_error(device, "unknown chipset (%08x)\n", boot0);
3165− ret = -ENODEV;
3166− goto done;
3222+ if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
3223+ switch (device->chipset) {
3224+ case 0x170: device->chip = &nv170_chipset; break;
3225+ default:
3226+ break;
3227+ }
3228+ }
3229+
3230+ if (!device->chip) {
3231+ nvdev_error(device, "unknown chipset (%08x)\n", boot0);
3232+ ret = -ENODEV;
3233+ goto done;
3234+ }
3235+ break;
31673236 }
31683237
31693238 nvdev_info(device, "NVIDIA %s (%08x)\n",
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c+1−0
@@ -176,6 +176,7 @@ nvkm_udevice_info(struct nvkm_udevice *udev, void *data, u32 size) · 175 unmodified lines
176176 case GP100: args->v0.family = NV_DEVICE_INFO_V0_PASCAL; break;
177177 case GV100: args->v0.family = NV_DEVICE_INFO_V0_VOLTA; break;
178178 case TU100: args->v0.family = NV_DEVICE_INFO_V0_TURING; break;
179+ case GA100: args->v0.family = NV_DEVICE_INFO_V0_AMPERE; break;
179180 default:
180181 args->v0.family = 0;
181182 break;
drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild+3−0
@@ -17,6 +17,7 @@ nvkm-y += nvkm/engine/disp/gp100.o · 16 unmodified lines
1717 nvkm-y += nvkm/engine/disp/gp102.o
1818 nvkm-y += nvkm/engine/disp/gv100.o
1919 nvkm-y += nvkm/engine/disp/tu102.o
20+nvkm-y += nvkm/engine/disp/ga102.o
2021 nvkm-y += nvkm/engine/disp/vga.o
2122
2223 nvkm-y += nvkm/engine/disp/head.o
@@ -42,6 +43,7 @@ nvkm-y += nvkm/engine/disp/sorgm200.o · 19 unmodified lines
4243 nvkm-y += nvkm/engine/disp/sorgp100.o
4344 nvkm-y += nvkm/engine/disp/sorgv100.o
4445 nvkm-y += nvkm/engine/disp/sortu102.o
46+nvkm-y += nvkm/engine/disp/sorga102.o
4547
4648 nvkm-y += nvkm/engine/disp/outp.o
4749 nvkm-y += nvkm/engine/disp/dp.o
@@ -75,6 +77,7 @@ nvkm-y += nvkm/engine/disp/rootgp100.o · 27 unmodified lines
7577 nvkm-y += nvkm/engine/disp/rootgp102.o
7678 nvkm-y += nvkm/engine/disp/rootgv100.o
7779 nvkm-y += nvkm/engine/disp/roottu102.o
80+nvkm-y += nvkm/engine/disp/rootga102.o
7881
7982 nvkm-y += nvkm/engine/disp/capsgv100.o
8083
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c+27−6
@@ -33,6 +33,12 @@ · 32 unmodified lines
3333
3434 #include <nvif/event.h>
3535
36+/* IED scripts are no longer used by UEFI/RM from Ampere, but have been updated for
37+ * the x86 option ROM. However, the relevant VBIOS table versions weren't modified,
38+ * so we're unable to detect this in a nice way.
39+ */
40+#define AMPERE_IED_HACK(disp) ((disp)->engine.subdev.device->card_type >= GA100)
41+
3642 struct lt_state {
3743 struct nvkm_dp *dp;
3844 u8 stat[6];
@@ -238,6 +244,19 @@ nvkm_dp_train_links(struct nvkm_dp *dp) · 199 unmodified lines
238244 dp->dpcd[DPCD_RC02] &= ~DPCD_RC02_TPS3_SUPPORTED;
239245 lt.pc2 = dp->dpcd[DPCD_RC02] & DPCD_RC02_TPS3_SUPPORTED;
240246
247+ if (AMPERE_IED_HACK(disp) && (lnkcmp = lt.dp->info.script[0])) {
248+ /* Execute BeforeLinkTraining script from DP Info table. */
249+ while (ior->dp.bw < nvbios_rd08(bios, lnkcmp))
250+ lnkcmp += 3;
251+ lnkcmp = nvbios_rd16(bios, lnkcmp + 1);
252+
253+ nvbios_init(&dp->outp.disp->engine.subdev, lnkcmp,
254+ init.outp = &dp->outp.info;
255+ init.or = ior->id;
256+ init.link = ior->asy.link;
257+ );
258+ }
259+
241260 /* Set desired link configuration on the source. */
242261 if ((lnkcmp = lt.dp->info.lnkcmp)) {
243262 if (dp->version < 0x30) {
@@ -316,12 +335,14 @@ nvkm_dp_train_init(struct nvkm_dp *dp) · 72 unmodified lines
316335 );
317336 }
318337
319− /* Execute BeforeLinkTraining script from DP Info table. */
320− nvbios_init(&dp->outp.disp->engine.subdev, dp->info.script[0],
321− init.outp = &dp->outp.info;
322− init.or = dp->outp.ior->id;
323− init.link = dp->outp.ior->asy.link;
324− );
338+ if (!AMPERE_IED_HACK(dp->outp.disp)) {
339+ /* Execute BeforeLinkTraining script from DP Info table. */
340+ nvbios_init(&dp->outp.disp->engine.subdev, dp->info.script[0],
341+ init.outp = &dp->outp.info;
342+ init.or = dp->outp.ior->id;
343+ init.link = dp->outp.ior->asy.link;
344+ );
345+ }
325346 }
326347
327348 static const struct dp_rates {
drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c+46−0
@@ -0,0 +1,46 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "nv50.h"
23+#include "head.h"
24+#include "ior.h"
25+#include "channv50.h"
26+#include "rootnv50.h"
27+
28+static const struct nv50_disp_func
29+ga102_disp = {
30+ .init = tu102_disp_init,
31+ .fini = gv100_disp_fini,
32+ .intr = gv100_disp_intr,
33+ .uevent = &gv100_disp_chan_uevent,
34+ .super = gv100_disp_super,
35+ .root = &ga102_disp_root_oclass,
36+ .wndw = { .cnt = gv100_disp_wndw_cnt },
37+ .head = { .cnt = gv100_head_cnt, .new = gv100_head_new },
38+ .sor = { .cnt = gv100_sor_cnt, .new = ga102_sor_new },
39+ .ramht_size = 0x2000,
40+};
41+
42+int
43+ga102_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp)
44+{
45+ return nv50_disp_new_(&ga102_disp, device, index, pdisp);
46+}
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h+4−0
@@ -150,6 +150,8 @@ void gv100_sor_dp_audio(struct nvkm_ior *, int, bool); · 149 unmodified lines
150150 void gv100_sor_dp_audio_sym(struct nvkm_ior *, int, u16, u32);
151151 void gv100_sor_dp_watermark(struct nvkm_ior *, int, u8);
152152
153+void tu102_sor_dp_vcpi(struct nvkm_ior *, int, u8, u8, u16, u16);
154+
153155 void g84_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
154156 void gt215_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
155157 void gf119_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
@@ -207,4 +209,6 @@ int gv100_sor_cnt(struct nvkm_disp *, unsigned long *); · 51 unmodified lines
207209 int gv100_sor_new(struct nvkm_disp *, int);
208210
209211 int tu102_sor_new(struct nvkm_disp *, int);
212+
213+int ga102_sor_new(struct nvkm_disp *, int);
210214 #endif
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h+2−0
@@ -86,6 +86,8 @@ void gv100_disp_intr(struct nv50_disp *); · 85 unmodified lines
8686 void gv100_disp_super(struct work_struct *);
8787 int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
8888
89+int tu102_disp_init(struct nv50_disp *);
90+
8991 void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
9092 void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
9193 void nv50_disp_update_sppll1(struct nv50_disp *);
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c+52−0
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "rootnv50.h"
23+#include "channv50.h"
24+
25+#include <nvif/class.h>
26+
27+static const struct nv50_disp_root_func
28+ga102_disp_root = {
29+ .user = {
30+ {{-1,-1,GV100_DISP_CAPS }, gv100_disp_caps_new },
31+ {{0,0,GA102_DISP_CURSOR }, gv100_disp_curs_new },
32+ {{0,0,GA102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
33+ {{0,0,GA102_DISP_CORE_CHANNEL_DMA }, gv100_disp_core_new },
34+ {{0,0,GA102_DISP_WINDOW_CHANNEL_DMA }, gv100_disp_wndw_new },
35+ {}
36+ },
37+};
38+
39+static int
40+ga102_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
41+ void *data, u32 size, struct nvkm_object **pobject)
42+{
43+ return nv50_disp_root_new_(&ga102_disp_root, disp, oclass, data, size, pobject);
44+}
45+
46+const struct nvkm_disp_oclass
47+ga102_disp_root_oclass = {
48+ .base.oclass = GA102_DISP,
49+ .base.minver = -1,
50+ .base.maxver = -1,
51+ .ctor = ga102_disp_root_new,
52+};
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h+1−0
@@ -41,4 +41,5 @@ extern const struct nvkm_disp_oclass gp100_disp_root_oclass; · 40 unmodified lines
4141 extern const struct nvkm_disp_oclass gp102_disp_root_oclass;
4242 extern const struct nvkm_disp_oclass gv100_disp_root_oclass;
4343 extern const struct nvkm_disp_oclass tu102_disp_root_oclass;
44+extern const struct nvkm_disp_oclass ga102_disp_root_oclass;
4445 #endif
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorga102.c+140−0
@@ -0,0 +1,140 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "ior.h"
23+
24+#include <subdev/timer.h>
25+
26+static int
27+ga102_sor_dp_links(struct nvkm_ior *sor, struct nvkm_i2c_aux *aux)
28+{
29+ struct nvkm_device *device = sor->disp->engine.subdev.device;
30+ const u32 soff = nv50_ior_base(sor);
31+ const u32 loff = nv50_sor_link(sor);
32+ u32 dpctrl = 0x00000000;
33+ u32 clksor = 0x00000000;
34+
35+ switch (sor->dp.bw) {
36+ case 0x06: clksor |= 0x00000000; break;
37+ case 0x0a: clksor |= 0x00040000; break;
38+ case 0x14: clksor |= 0x00080000; break;
39+ case 0x1e: clksor |= 0x000c0000; break;
40+ default:
41+ WARN_ON(1);
42+ return -EINVAL;
43+ }
44+
45+ dpctrl |= ((1 << sor->dp.nr) - 1) << 16;
46+ if (sor->dp.mst)
47+ dpctrl |= 0x40000000;
48+ if (sor->dp.ef)
49+ dpctrl |= 0x00004000;
50+
51+ nvkm_mask(device, 0x612300 + soff, 0x007c0000, clksor);
52+
53+ /*XXX*/
54+ nvkm_msec(device, 40, NVKM_DELAY);
55+ nvkm_mask(device, 0x612300 + soff, 0x00030000, 0x00010000);
56+ nvkm_mask(device, 0x61c10c + loff, 0x00000003, 0x00000001);
57+
58+ nvkm_mask(device, 0x61c10c + loff, 0x401f4000, dpctrl);
59+ return 0;
60+}
61+
62+static void
63+ga102_sor_clock(struct nvkm_ior *sor)
64+{
65+ struct nvkm_device *device = sor->disp->engine.subdev.device;
66+ u32 div2 = 0;
67+ if (sor->asy.proto == TMDS) {
68+ if (sor->tmds.high_speed)
69+ div2 = 1;
70+ }
71+ nvkm_wr32(device, 0x00ec08 + (sor->id * 0x10), 0x00000000);
72+ nvkm_wr32(device, 0x00ec04 + (sor->id * 0x10), div2);
73+}
74+
75+static const struct nvkm_ior_func
76+ga102_sor_hda = {
77+ .route = {
78+ .get = gm200_sor_route_get,
79+ .set = gm200_sor_route_set,
80+ },
81+ .state = gv100_sor_state,
82+ .power = nv50_sor_power,
83+ .clock = ga102_sor_clock,
84+ .hdmi = {
85+ .ctrl = gv100_hdmi_ctrl,
86+ .scdc = gm200_hdmi_scdc,
87+ },
88+ .dp = {
89+ .lanes = { 0, 1, 2, 3 },
90+ .links = ga102_sor_dp_links,
91+ .power = g94_sor_dp_power,
92+ .pattern = gm107_sor_dp_pattern,
93+ .drive = gm200_sor_dp_drive,
94+ .vcpi = tu102_sor_dp_vcpi,
95+ .audio = gv100_sor_dp_audio,
96+ .audio_sym = gv100_sor_dp_audio_sym,
97+ .watermark = gv100_sor_dp_watermark,
98+ },
99+ .hda = {
100+ .hpd = gf119_hda_hpd,
101+ .eld = gf119_hda_eld,
102+ .device_entry = gv100_hda_device_entry,
103+ },
104+};
105+
106+static const struct nvkm_ior_func
107+ga102_sor = {
108+ .route = {
109+ .get = gm200_sor_route_get,
110+ .set = gm200_sor_route_set,
111+ },
112+ .state = gv100_sor_state,
113+ .power = nv50_sor_power,
114+ .clock = ga102_sor_clock,
115+ .hdmi = {
116+ .ctrl = gv100_hdmi_ctrl,
117+ .scdc = gm200_hdmi_scdc,
118+ },
119+ .dp = {
120+ .lanes = { 0, 1, 2, 3 },
121+ .links = ga102_sor_dp_links,
122+ .power = g94_sor_dp_power,
123+ .pattern = gm107_sor_dp_pattern,
124+ .drive = gm200_sor_dp_drive,
125+ .vcpi = tu102_sor_dp_vcpi,
126+ .audio = gv100_sor_dp_audio,
127+ .audio_sym = gv100_sor_dp_audio_sym,
128+ .watermark = gv100_sor_dp_watermark,
129+ },
130+};
131+
132+int
133+ga102_sor_new(struct nvkm_disp *disp, int id)
134+{
135+ struct nvkm_device *device = disp->engine.subdev.device;
136+ u32 hda = nvkm_rd32(device, 0x08a15c);
137+ if (hda & BIT(id))
138+ return nvkm_ior_new_(&ga102_sor_hda, disp, SOR, id);
139+ return nvkm_ior_new_(&ga102_sor, disp, SOR, id);
140+}
drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323
2424 #include <subdev/timer.h>
2525
26−static void
26+void
2727 tu102_sor_dp_vcpi(struct nvkm_ior *sor, int head,
2828 u8 slot, u8 slot_nr, u16 pbn, u16 aligned)
2929 {
drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <core/gpuobj.h>
2929 #include <subdev/timer.h>
3030
31−static int
31+int
3232 tu102_disp_init(struct nv50_disp *disp)
3333 {
3434 struct nvkm_device *device = disp->base.engine.subdev.device;
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c+1−1
@@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) · 74 unmodified lines
7575 nvkm_debug(subdev, "%08x: type %02x, %d bytes\n",
7676 image.base, image.type, image.size);
7777
78− if (!shadow_fetch(bios, mthd, image.size)) {
78+ if (!shadow_fetch(bios, mthd, image.base + image.size)) {
7979 nvkm_debug(subdev, "%08x: fetch failed\n", image.base);
8080 return 0;
8181 }
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c+3−0
@@ -64,6 +64,9 @@ pramin_init(struct nvkm_bios *bios, const char *name) · 63 unmodified lines
6464 return NULL;
6565
6666 /* we can't get the bios image pointer without PDISP */
67+ if (device->card_type >= GA100)
68+ addr = device->chipset == 0x170; /*XXX: find the fuse reg for this */
69+ else
6770 if (device->card_type >= GM100)
6871 addr = nvkm_rd32(device, 0x021c04);
6972 else
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild+1−0
@@ -15,3 +15,4 @@ nvkm-y += nvkm/subdev/devinit/gm107.o · 14 unmodified lines
1515 nvkm-y += nvkm/subdev/devinit/gm200.o
1616 nvkm-y += nvkm/subdev/devinit/gv100.o
1717 nvkm-y += nvkm/subdev/devinit/tu102.o
18+nvkm-y += nvkm/subdev/devinit/ga100.o
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/ga100.c+76−0
@@ -0,0 +1,76 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "nv50.h"
23+
24+#include <subdev/bios.h>
25+#include <subdev/bios/pll.h>
26+#include <subdev/clk/pll.h>
27+
28+static int
29+ga100_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)
30+{
31+ struct nvkm_subdev *subdev = &init->subdev;
32+ struct nvkm_device *device = subdev->device;
33+ struct nvbios_pll info;
34+ int head = type - PLL_VPLL0;
35+ int N, fN, M, P;
36+ int ret;
37+
38+ ret = nvbios_pll_parse(device->bios, type, &info);
39+ if (ret)
40+ return ret;
41+
42+ ret = gt215_pll_calc(subdev, &info, freq, &N, &fN, &M, &P);
43+ if (ret < 0)
44+ return ret;
45+
46+ switch (info.type) {
47+ case PLL_VPLL0:
48+ case PLL_VPLL1:
49+ case PLL_VPLL2:
50+ case PLL_VPLL3:
51+ nvkm_wr32(device, 0x00ef00 + (head * 0x40), 0x02080004);
52+ nvkm_wr32(device, 0x00ef18 + (head * 0x40), (N << 16) | fN);
53+ nvkm_wr32(device, 0x00ef04 + (head * 0x40), (P << 16) | M);
54+ nvkm_wr32(device, 0x00e9c0 + (head * 0x04), 0x00000001);
55+ break;
56+ default:
57+ nvkm_warn(subdev, "%08x/%dKhz unimplemented\n", type, freq);
58+ ret = -EINVAL;
59+ break;
60+ }
61+
62+ return ret;
63+}
64+
65+static const struct nvkm_devinit_func
66+ga100_devinit = {
67+ .init = nv50_devinit_init,
68+ .post = tu102_devinit_post,
69+ .pll_set = ga100_devinit_pll_set,
70+};
71+
72+int
73+ga100_devinit_new(struct nvkm_device *device, int index, struct nvkm_devinit **pinit)
74+{
75+ return nv50_devinit_new_(&ga100_devinit, device, index, pinit);
76+}
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h+1−0
@@ -19,4 +19,5 @@ void nvkm_devinit_ctor(const struct nvkm_devinit_func *, struct nvkm_device *, · 18 unmodified lines
1919 int index, struct nvkm_devinit *);
2020
2121 int nv04_devinit_post(struct nvkm_devinit *, bool);
22+int tu102_devinit_post(struct nvkm_devinit *, bool);
2223 #endif
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c+1−1
@@ -65,7 +65,7 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq) · 64 unmodified lines
6565 return ret;
6666 }
6767
68−static int
68+int
6969 tu102_devinit_post(struct nvkm_devinit *base, bool post)
7070 {
7171 struct nv50_devinit *init = nv50_devinit(base);
drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild+3−0
@@ -32,6 +32,8 @@ nvkm-y += nvkm/subdev/fb/gp100.o · 31 unmodified lines
3232 nvkm-y += nvkm/subdev/fb/gp102.o
3333 nvkm-y += nvkm/subdev/fb/gp10b.o
3434 nvkm-y += nvkm/subdev/fb/gv100.o
35+nvkm-y += nvkm/subdev/fb/ga100.o
36+nvkm-y += nvkm/subdev/fb/ga102.o
3537
3638 nvkm-y += nvkm/subdev/fb/ram.o
3739 nvkm-y += nvkm/subdev/fb/ramnv04.o
@@ -52,6 +54,7 @@ nvkm-y += nvkm/subdev/fb/ramgk104.o · 14 unmodified lines
5254 nvkm-y += nvkm/subdev/fb/ramgm107.o
5355 nvkm-y += nvkm/subdev/fb/ramgm200.o
5456 nvkm-y += nvkm/subdev/fb/ramgp100.o
57+nvkm-y += nvkm/subdev/fb/ramga102.o
5558 nvkm-y += nvkm/subdev/fb/sddr2.o
5659 nvkm-y += nvkm/subdev/fb/sddr3.o
5760 nvkm-y += nvkm/subdev/fb/gddr3.o
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga100.c+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "gf100.h"
23+#include "ram.h"
24+
25+static const struct nvkm_fb_func
26+ga100_fb = {
27+ .dtor = gf100_fb_dtor,
28+ .oneinit = gf100_fb_oneinit,
29+ .init = gp100_fb_init,
30+ .init_page = gv100_fb_init_page,
31+ .init_unkn = gp100_fb_init_unkn,
32+ .ram_new = gp100_ram_new,
33+ .default_bigpage = 16,
34+};
35+
36+int
37+ga100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
38+{
39+ return gp102_fb_new_(&ga100_fb, device, index, pfb);
40+}
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "gf100.h"
23+#include "ram.h"
24+
25+static const struct nvkm_fb_func
26+ga102_fb = {
27+ .dtor = gf100_fb_dtor,
28+ .oneinit = gf100_fb_oneinit,
29+ .init = gp100_fb_init,
30+ .init_page = gv100_fb_init_page,
31+ .init_unkn = gp100_fb_init_unkn,
32+ .ram_new = ga102_ram_new,
33+ .default_bigpage = 16,
34+};
35+
36+int
37+ga102_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
38+{
39+ return gp102_fb_new_(&ga102_fb, device, index, pfb);
40+}
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include "gf100.h"
2323 #include "ram.h"
2424
25−static int
25+int
2626 gv100_fb_init_page(struct nvkm_fb *fb)
2727 {
2828 return (fb->page == 16) ? 0 : -EINVAL;
drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h+2−0
@@ -82,4 +82,6 @@ int gp102_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, int, · 81 unmodified lines
8282 struct nvkm_fb **);
8383 bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);
8484 int gp102_fb_vpr_scrub(struct nvkm_fb *);
85+
86+int gv100_fb_init_page(struct nvkm_fb *);
8587 #endif
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h+1−0
@@ -70,4 +70,5 @@ int gk104_ram_new(struct nvkm_fb *, struct nvkm_ram **); · 69 unmodified lines
7070 int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
7171 int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
7272 int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
73+int ga102_ram_new(struct nvkm_fb *, struct nvkm_ram **);
7374 #endif
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "ram.h"
23+
24+#include <subdev/bios.h>
25+#include <subdev/bios/init.h>
26+#include <subdev/bios/rammap.h>
27+
28+static const struct nvkm_ram_func
29+ga102_ram = {
30+};
31+
32+int
33+ga102_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
34+{
35+ struct nvkm_device *device = fb->subdev.device;
36+ enum nvkm_ram_type type = nvkm_fb_bios_memtype(device->bios);
37+ u32 size = nvkm_rd32(device, 0x1183a4);
38+
39+ return nvkm_ram_new_(&ga102_ram, fb, type, (u64)size << 20, pram);
40+}
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild+1−0
@@ -5,3 +5,4 @@ nvkm-y += nvkm/subdev/gpio/nv50.o · 4 unmodified lines
55 nvkm-y += nvkm/subdev/gpio/g94.o
66 nvkm-y += nvkm/subdev/gpio/gf119.o
77 nvkm-y += nvkm/subdev/gpio/gk104.o
8+nvkm-y += nvkm/subdev/gpio/ga102.o
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c+118−0
@@ -0,0 +1,118 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "priv.h"
23+
24+static void
25+ga102_gpio_reset(struct nvkm_gpio *gpio, u8 match)
26+{
27+ struct nvkm_device *device = gpio->subdev.device;
28+ struct nvkm_bios *bios = device->bios;
29+ u8 ver, len;
30+ u16 entry;
31+ int ent = -1;
32+
33+ while ((entry = dcb_gpio_entry(bios, 0, ++ent, &ver, &len))) {
34+ u32 data = nvbios_rd32(bios, entry);
35+ u8 line = (data & 0x0000003f);
36+ u8 defs = !!(data & 0x00000080);
37+ u8 func = (data & 0x0000ff00) >> 8;
38+ u8 unk0 = (data & 0x00ff0000) >> 16;
39+ u8 unk1 = (data & 0x1f000000) >> 24;
40+
41+ if ( func == DCB_GPIO_UNUSED ||
42+ (match != DCB_GPIO_UNUSED && match != func))
43+ continue;
44+
45+ nvkm_gpio_set(gpio, 0, func, line, defs);
46+
47+ nvkm_mask(device, 0x021200 + (line * 4), 0xff, unk0);
48+ if (unk1--)
49+ nvkm_mask(device, 0x00d740 + (unk1 * 4), 0xff, line);
50+ }
51+}
52+
53+static int
54+ga102_gpio_drive(struct nvkm_gpio *gpio, int line, int dir, int out)
55+{
56+ struct nvkm_device *device = gpio->subdev.device;
57+ u32 data = ((dir ^ 1) << 13) | (out << 12);
58+ nvkm_mask(device, 0x021200 + (line * 4), 0x00003000, data);
59+ nvkm_mask(device, 0x00d604, 0x00000001, 0x00000001); /* update? */
60+ return 0;
61+}
62+
63+static int
64+ga102_gpio_sense(struct nvkm_gpio *gpio, int line)
65+{
66+ struct nvkm_device *device = gpio->subdev.device;
67+ return !!(nvkm_rd32(device, 0x021200 + (line * 4)) & 0x00004000);
68+}
69+
70+static void
71+ga102_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo)
72+{
73+ struct nvkm_device *device = gpio->subdev.device;
74+ u32 intr0 = nvkm_rd32(device, 0x021640);
75+ u32 intr1 = nvkm_rd32(device, 0x02164c);
76+ u32 stat0 = nvkm_rd32(device, 0x021648) & intr0;
77+ u32 stat1 = nvkm_rd32(device, 0x021654) & intr1;
78+ *lo = (stat1 & 0xffff0000) | (stat0 >> 16);
79+ *hi = (stat1 << 16) | (stat0 & 0x0000ffff);
80+ nvkm_wr32(device, 0x021640, intr0);
81+ nvkm_wr32(device, 0x02164c, intr1);
82+}
83+
84+static void
85+ga102_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
86+{
87+ struct nvkm_device *device = gpio->subdev.device;
88+ u32 inte0 = nvkm_rd32(device, 0x021648);
89+ u32 inte1 = nvkm_rd32(device, 0x021654);
90+ if (type & NVKM_GPIO_LO)
91+ inte0 = (inte0 & ~(mask << 16)) | (data << 16);
92+ if (type & NVKM_GPIO_HI)
93+ inte0 = (inte0 & ~(mask & 0xffff)) | (data & 0xffff);
94+ mask >>= 16;
95+ data >>= 16;
96+ if (type & NVKM_GPIO_LO)
97+ inte1 = (inte1 & ~(mask << 16)) | (data << 16);
98+ if (type & NVKM_GPIO_HI)
99+ inte1 = (inte1 & ~mask) | data;
100+ nvkm_wr32(device, 0x021648, inte0);
101+ nvkm_wr32(device, 0x021654, inte1);
102+}
103+
104+static const struct nvkm_gpio_func
105+ga102_gpio = {
106+ .lines = 32,
107+ .intr_stat = ga102_gpio_intr_stat,
108+ .intr_mask = ga102_gpio_intr_mask,
109+ .drive = ga102_gpio_drive,
110+ .sense = ga102_gpio_sense,
111+ .reset = ga102_gpio_reset,
112+};
113+
114+int
115+ga102_gpio_new(struct nvkm_device *device, int index, struct nvkm_gpio **pgpio)
116+{
117+ return nvkm_gpio_new_(&ga102_gpio, device, index, pgpio);
118+}
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild+1−0
@@ -7,6 +7,7 @@ nvkm-y += nvkm/subdev/i2c/g94.o · 6 unmodified lines
77 nvkm-y += nvkm/subdev/i2c/gf117.o
88 nvkm-y += nvkm/subdev/i2c/gf119.o
99 nvkm-y += nvkm/subdev/i2c/gk104.o
10+nvkm-y += nvkm/subdev/i2c/gk110.o
1011 nvkm-y += nvkm/subdev/i2c/gm200.o
1112
1213 nvkm-y += nvkm/subdev/i2c/pad.o
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h+7−0
@@ -3,6 +3,13 @@ · 2 unmodified lines
33 #define __NVKM_I2C_AUX_H__
44 #include "pad.h"
55
6+static inline void
7+nvkm_i2c_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
8+{
9+ if (i2c->func->aux_autodpcd)
10+ i2c->func->aux_autodpcd(i2c, aux, false);
11+}
12+
613 struct nvkm_i2c_aux_func {
714 bool address_only;
815 int (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c+7−3
@@ -77,7 +77,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 76 unmodified lines
7777 u8 type, u32 addr, u8 *data, u8 *size)
7878 {
7979 struct g94_i2c_aux *aux = g94_i2c_aux(obj);
80− struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
80+ struct nvkm_i2c *i2c = aux->base.pad->i2c;
81+ struct nvkm_device *device = i2c->subdev.device;
8182 const u32 base = aux->ch * 0x50;
8283 u32 ctrl, stat, timeout, retries = 0;
8384 u32 xbuf[4] = {};
@@ -96,6 +97,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 12 unmodified lines
9697 goto out;
9798 }
9899
100+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, false);
101+
99102 if (!(type & 1)) {
100103 memcpy(xbuf, data, *size);
101104 for (i = 0; i < 16; i += 4) {
@@ -128,7 +131,7 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 26 unmodified lines
128131 if (!timeout--) {
129132 AUX_ERR(&aux->base, "timeout %08x", ctrl);
130133 ret = -EIO;
131− goto out;
134+ goto out_err;
132135 }
133136 } while (ctrl & 0x00010000);
134137 ret = 0;
@@ -154,7 +157,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 19 unmodified lines
154157 memcpy(data, xbuf, *size);
155158 *size = stat & 0x0000001f;
156159 }
157−
160+out_err:
161+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, true);
158162 out:
159163 g94_i2c_aux_fini(aux);
160164 return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c+11−6
@@ -33,7 +33,7 @@ static void · 32 unmodified lines
3333 gm200_i2c_aux_fini(struct gm200_i2c_aux *aux)
3434 {
3535 struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
36− nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000);
36+ nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000);
3737 }
3838
3939 static int
@@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) · 14 unmodified lines
5454 AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl);
5555 return -EBUSY;
5656 }
57− } while (ctrl & 0x03010000);
57+ } while (ctrl & 0x07010000);
5858
5959 /* set some magic, and wait up to 1ms for it to appear */
60− nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq);
60+ nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq);
6161 timeout = 1000;
6262 do {
6363 ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50));
@@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) · 3 unmodified lines
6767 gm200_i2c_aux_fini(aux);
6868 return -EBUSY;
6969 }
70− } while ((ctrl & 0x03000000) != urep);
70+ } while ((ctrl & 0x07000000) != urep);
7171
7272 return 0;
7373 }
@@ -77,7 +77,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 3 unmodified lines
7777 u8 type, u32 addr, u8 *data, u8 *size)
7878 {
7979 struct gm200_i2c_aux *aux = gm200_i2c_aux(obj);
80− struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
80+ struct nvkm_i2c *i2c = aux->base.pad->i2c;
81+ struct nvkm_device *device = i2c->subdev.device;
8182 const u32 base = aux->ch * 0x50;
8283 u32 ctrl, stat, timeout, retries = 0;
8384 u32 xbuf[4] = {};
@@ -96,6 +97,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 12 unmodified lines
9697 goto out;
9798 }
9899
100+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, false);
101+
99102 if (!(type & 1)) {
100103 memcpy(xbuf, data, *size);
101104 for (i = 0; i < 16; i += 4) {
@@ -128,7 +131,7 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 26 unmodified lines
128131 if (!timeout--) {
129132 AUX_ERR(&aux->base, "timeout %08x", ctrl);
130133 ret = -EIO;
131− goto out;
134+ goto out_err;
132135 }
133136 } while (ctrl & 0x00010000);
134137 ret = 0;
@@ -155,6 +158,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 20 unmodified lines
155158 *size = stat & 0x0000001f;
156159 }
157160
161+out_err:
162+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, true);
158163 out:
159164 gm200_i2c_aux_fini(aux);
160165 return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gk110.c+45−0
@@ -0,0 +1,45 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "priv.h"
23+#include "pad.h"
24+
25+static void
26+gk110_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
27+{
28+ nvkm_mask(i2c->subdev.device, 0x00e4f8 + (aux * 0x50), 0x00010000, enable << 16);
29+}
30+
31+static const struct nvkm_i2c_func
32+gk110_i2c = {
33+ .pad_x_new = gf119_i2c_pad_x_new,
34+ .pad_s_new = gf119_i2c_pad_s_new,
35+ .aux = 4,
36+ .aux_stat = gk104_aux_stat,
37+ .aux_mask = gk104_aux_mask,
38+ .aux_autodpcd = gk110_aux_autodpcd,
39+};
40+
41+int
42+gk110_i2c_new(struct nvkm_device *device, int index, struct nvkm_i2c **pi2c)
43+{
44+ return nvkm_i2c_new_(&gk110_i2c, device, index, pi2c);
45+}
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gm200.c+7−0
@@ -24,6 +24,12 @@ · 23 unmodified lines
2424 #include "priv.h"
2525 #include "pad.h"
2626
27+static void
28+gm200_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
29+{
30+ nvkm_mask(i2c->subdev.device, 0x00d968 + (aux * 0x50), 0x00010000, enable << 16);
31+}
32+
2733 static const struct nvkm_i2c_func
2834 gm200_i2c = {
2935 .pad_x_new = gf119_i2c_pad_x_new,
@@ -31,6 +37,7 @@ gm200_i2c = { · 1 unmodified line
3137 .aux = 8,
3238 .aux_stat = gk104_aux_stat,
3339 .aux_mask = gk104_aux_mask,
40+ .aux_autodpcd = gm200_aux_autodpcd,
3441 };
3542
3643 int
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h+1−1
@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: MIT */
22 #ifndef __NVKM_I2C_PAD_H__
33 #define __NVKM_I2C_PAD_H__
4−#include <subdev/i2c.h>
4+#include "priv.h"
55
66 struct nvkm_i2c_pad {
77 const struct nvkm_i2c_pad_func *func;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h+4−0
@@ -23,6 +23,10 @@ struct nvkm_i2c_func { · 22 unmodified lines
2323 /* mask on/off interrupt types for a given set of auxch
2424 */
2525 void (*aux_mask)(struct nvkm_i2c *, u32, u32, u32);
26+
27+ /* enable/disable HW-initiated DPCD reads
28+ */
29+ void (*aux_autodpcd)(struct nvkm_i2c *, int aux, bool enable);
2630 };
2731
2832 void g94_aux_stat(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c+7−3
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 * Authors: Ben Skeggs
2323 */
2424 #include "priv.h"
25+#include <subdev/timer.h>
2526
2627 static void
2728 gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -31,7 +32,6 @@ gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i) · 3 unmodified lines
3132 u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400));
3233 u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400));
3334 nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
34− nvkm_mask(device, 0x122128 + (i * 0x0400), 0x00000200, 0x00000000);
3535 }
3636
3737 static void
@@ -42,7 +42,6 @@ gf100_ibus_intr_rop(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
4242 u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400));
4343 u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400));
4444 nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
45− nvkm_mask(device, 0x124128 + (i * 0x0400), 0x00000200, 0x00000000);
4645 }
4746
4847 static void
@@ -53,7 +52,6 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
5352 u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400));
5453 u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400));
5554 nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
56− nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
5755 }
5856
5957 void
@@ -90,6 +88,12 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) · 30 unmodified lines
9088 intr1 &= ~stat;
9189 }
9290 }
91+
92+ nvkm_mask(device, 0x121c4c, 0x0000003f, 0x00000002);
93+ nvkm_msec(device, 2000,
94+ if (!(nvkm_rd32(device, 0x121c4c) & 0x0000003f))
95+ break;
96+ );
9397 }
9498
9599 static int
drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c+7−3
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 * Authors: Ben Skeggs
2323 */
2424 #include "priv.h"
25+#include <subdev/timer.h>
2526
2627 static void
2728 gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -31,7 +32,6 @@ gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i) · 3 unmodified lines
3132 u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800));
3233 u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800));
3334 nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
34− nvkm_mask(device, 0x122128 + (i * 0x0800), 0x00000200, 0x00000000);
3535 }
3636
3737 static void
@@ -42,7 +42,6 @@ gk104_ibus_intr_rop(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
4242 u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800));
4343 u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800));
4444 nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
45− nvkm_mask(device, 0x124128 + (i * 0x0800), 0x00000200, 0x00000000);
4645 }
4746
4847 static void
@@ -53,7 +52,6 @@ gk104_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
5352 u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800));
5453 u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800));
5554 nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
56− nvkm_mask(device, 0x128128 + (i * 0x0800), 0x00000200, 0x00000000);
5755 }
5856
5957 void
@@ -90,6 +88,12 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) · 30 unmodified lines
9088 intr1 &= ~stat;
9189 }
9290 }
91+
92+ nvkm_mask(device, 0x12004c, 0x0000003f, 0x00000002);
93+ nvkm_msec(device, 2000,
94+ if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f))
95+ break;
96+ );
9397 }
9498
9599 static int
drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild+1−0
@@ -14,3 +14,4 @@ nvkm-y += nvkm/subdev/mc/gk20a.o · 13 unmodified lines
1414 nvkm-y += nvkm/subdev/mc/gp100.o
1515 nvkm-y += nvkm/subdev/mc/gp10b.o
1616 nvkm-y += nvkm/subdev/mc/tu102.o
17+nvkm-y += nvkm/subdev/mc/ga100.o
drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c+74−0
@@ -0,0 +1,74 @@
1+/*
2+ * Copyright 2021 Red Hat Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ */
22+#include "priv.h"
23+
24+static void
25+ga100_mc_intr_unarm(struct nvkm_mc *mc)
26+{
27+ nvkm_wr32(mc->subdev.device, 0xb81610, 0x00000004);
28+}
29+
30+static void
31+ga100_mc_intr_rearm(struct nvkm_mc *mc)
32+{
33+ nvkm_wr32(mc->subdev.device, 0xb81608, 0x00000004);
34+}
35+
36+static void
37+ga100_mc_intr_mask(struct nvkm_mc *mc, u32 mask, u32 intr)
38+{
39+ nvkm_wr32(mc->subdev.device, 0xb81210, mask & intr );
40+ nvkm_wr32(mc->subdev.device, 0xb81410, mask & ~(mask & intr));
41+}
42+
43+static u32
44+ga100_mc_intr_stat(struct nvkm_mc *mc)
45+{
46+ u32 intr_top = nvkm_rd32(mc->subdev.device, 0xb81600), intr = 0x00000000;
47+ if (intr_top & 0x00000004)
48+ intr = nvkm_mask(mc->subdev.device, 0xb81010, 0x00000000, 0x00000000);
49+ return intr;
50+}
51+
52+static void
53+ga100_mc_init(struct nvkm_mc *mc)
54+{
55+ nv50_mc_init(mc);
56+ nvkm_wr32(mc->subdev.device, 0xb81210, 0xffffffff);
57+}
58+
59+static const struct nvkm_mc_func
60+ga100_mc = {
61+ .init = ga100_mc_init,
62+ .intr = gp100_mc_intr,
63+ .intr_unarm = ga100_mc_intr_unarm,
64+ .intr_rearm = ga100_mc_intr_rearm,
65+ .intr_mask = ga100_mc_intr_mask,
66+ .intr_stat = ga100_mc_intr_stat,
67+ .reset = gk104_mc_reset,
68+};
69+
70+int
71+ga100_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc)
72+{
73+ return nvkm_mc_new_(&ga100_mc, device, index, pmc);
74+}
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c+3−3
@@ -316,9 +316,9 @@ nvkm_mmu_vram(struct nvkm_mmu *mmu) · 315 unmodified lines
316316 {
317317 struct nvkm_device *device = mmu->subdev.device;
318318 struct nvkm_mm *mm = &device->fb->ram->vram;
319− const u32 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
320− const u32 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
321− const u32 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
319+ const u64 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
320+ const u64 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
321+ const u64 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
322322 u8 type = NVKM_MEM_KIND * !!mmu->func->kind;
323323 u8 heap = NVKM_MEM_VRAM;
324324 int heapM, heapN, heapU;
drivers/gpu/drm/radeon/radeon_ttm.c+0−3
@@ -730,9 +730,6 @@ int radeon_ttm_init(struct radeon_device *rdev) · 729 unmodified lines
730730 }
731731 rdev->mman.initialized = true;
732732
733− ttm_pool_init(&rdev->mman.bdev.pool, rdev->dev, rdev->need_swiotlb,
734− dma_addressing_limited(&rdev->pdev->dev));
735−
736733 r = radeon_ttm_init_vram(rdev);
737734 if (r) {
738735 DRM_ERROR("Failed initializing VRAM heap.\n");
drivers/gpu/drm/ttm/ttm_pool.c+11−13
@@ -66,7 +66,7 @@ static struct ttm_pool_type global_uncached[MAX_ORDER]; · 65 unmodified lines
6666 static struct ttm_pool_type global_dma32_write_combined[MAX_ORDER];
6767 static struct ttm_pool_type global_dma32_uncached[MAX_ORDER];
6868
69−static spinlock_t shrinker_lock;
69+static struct mutex shrinker_lock;
7070 static struct list_head shrinker_list;
7171 static struct shrinker mm_shrinker;
7272
@@ -190,7 +190,7 @@ static int ttm_pool_map(struct ttm_pool *pool, unsigned int order, · 117 unmodified lines
190190 size_t size = (1ULL << order) * PAGE_SIZE;
191191
192192 addr = dma_map_page(pool->dev, p, 0, size, DMA_BIDIRECTIONAL);
193− if (dma_mapping_error(pool->dev, **dma_addr))
193+ if (dma_mapping_error(pool->dev, addr))
194194 return -EFAULT;
195195 }
196196
@@ -249,9 +249,9 @@ static void ttm_pool_type_init(struct ttm_pool_type *pt, struct ttm_pool *pool, · 52 unmodified lines
249249 spin_lock_init(&pt->lock);
250250 INIT_LIST_HEAD(&pt->pages);
251251
252− spin_lock(&shrinker_lock);
252+ mutex_lock(&shrinker_lock);
253253 list_add_tail(&pt->shrinker_list, &shrinker_list);
254− spin_unlock(&shrinker_lock);
254+ mutex_unlock(&shrinker_lock);
255255 }
256256
257257 /* Remove a pool_type from the global shrinker list and free all pages */
@@ -259,9 +259,9 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt) · 1 unmodified line
259259 {
260260 struct page *p, *tmp;
261261
262− spin_lock(&shrinker_lock);
262+ mutex_lock(&shrinker_lock);
263263 list_del(&pt->shrinker_list);
264− spin_unlock(&shrinker_lock);
264+ mutex_unlock(&shrinker_lock);
265265
266266 list_for_each_entry_safe(p, tmp, &pt->pages, lru)
267267 ttm_pool_free_page(pt->pool, pt->caching, pt->order, p);
@@ -302,7 +302,7 @@ static unsigned int ttm_pool_shrink(void) · 34 unmodified lines
302302 unsigned int num_freed;
303303 struct page *p;
304304
305− spin_lock(&shrinker_lock);
305+ mutex_lock(&shrinker_lock);
306306 pt = list_first_entry(&shrinker_list, typeof(*pt), shrinker_list);
307307
308308 p = ttm_pool_type_take(pt);
@@ -314,7 +314,7 @@ static unsigned int ttm_pool_shrink(void) · 5 unmodified lines
314314 }
315315
316316 list_move_tail(&pt->shrinker_list, &shrinker_list);
317− spin_unlock(&shrinker_lock);
317+ mutex_unlock(&shrinker_lock);
318318
319319 return num_freed;
320320 }
@@ -507,7 +507,6 @@ void ttm_pool_init(struct ttm_pool *pool, struct device *dev, · 186 unmodified lines
507507 ttm_pool_type_init(&pool->caching[i].orders[j],
508508 pool, i, j);
509509 }
510−EXPORT_SYMBOL(ttm_pool_init);
511510
512511 /**
513512 * ttm_pool_fini - Cleanup a pool
@@ -525,7 +524,6 @@ void ttm_pool_fini(struct ttm_pool *pool) · 11 unmodified lines
525524 for (j = 0; j < MAX_ORDER; ++j)
526525 ttm_pool_type_fini(&pool->caching[i].orders[j]);
527526 }
528−EXPORT_SYMBOL(ttm_pool_fini);
529527
530528 #ifdef CONFIG_DEBUG_FS
531529 /* Count the number of pages available in a pool_type */
@@ -566,7 +564,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m) · 34 unmodified lines
566564 {
567565 unsigned int i;
568566
569− spin_lock(&shrinker_lock);
567+ mutex_lock(&shrinker_lock);
570568
571569 seq_puts(m, "\t ");
572570 for (i = 0; i < MAX_ORDER; ++i)
@@ -602,7 +600,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m) · 29 unmodified lines
602600 seq_printf(m, "\ntotal\t: %8lu of %8lu\n",
603601 atomic_long_read(&allocated_pages), page_pool_size);
604602
605− spin_unlock(&shrinker_lock);
603+ mutex_unlock(&shrinker_lock);
606604
607605 return 0;
608606 }
@@ -646,7 +644,7 @@ int ttm_pool_mgr_init(unsigned long num_pages) · 37 unmodified lines
646644 if (!page_pool_size)
647645 page_pool_size = num_pages;
648646
649− spin_lock_init(&shrinker_lock);
647+ mutex_init(&shrinker_lock);
650648 INIT_LIST_HEAD(&shrinker_list);
651649
652650 for (i = 0; i < MAX_ORDER; ++i) {
drivers/hid/Kconfig+1−0
@@ -899,6 +899,7 @@ config HID_SONY · 898 unmodified lines
899899 depends on NEW_LEDS
900900 depends on LEDS_CLASS
901901 select POWER_SUPPLY
902+ select CRC32
902903 help
903904 Support for
904905
drivers/hid/amd-sfh-hid/amd_sfh_client.c+4−4
@@ -154,7 +154,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) · 153 unmodified lines
154154
155155 for (i = 0; i < cl_data->num_hid_devices; i++) {
156156 cl_data->sensor_virt_addr[i] = dma_alloc_coherent(dev, sizeof(int) * 8,
157− &cl_data->sensor_phys_addr[i],
157+ &cl_data->sensor_dma_addr[i],
158158 GFP_KERNEL);
159159 cl_data->sensor_sts[i] = 0;
160160 cl_data->sensor_requested_cnt[i] = 0;
@@ -187,7 +187,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) · 26 unmodified lines
187187 }
188188 info.period = msecs_to_jiffies(AMD_SFH_IDLE_LOOP);
189189 info.sensor_idx = cl_idx;
190− info.phys_address = cl_data->sensor_phys_addr[i];
190+ info.dma_address = cl_data->sensor_dma_addr[i];
191191
192192 cl_data->report_descr[i] = kzalloc(cl_data->report_descr_sz[i], GFP_KERNEL);
193193 if (!cl_data->report_descr[i]) {
@@ -212,7 +212,7 @@ cleanup: · 18 unmodified lines
212212 if (cl_data->sensor_virt_addr[i]) {
213213 dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
214214 cl_data->sensor_virt_addr[i],
215− cl_data->sensor_phys_addr[i]);
215+ cl_data->sensor_dma_addr[i]);
216216 }
217217 kfree(cl_data->feature_report[i]);
218218 kfree(cl_data->input_report[i]);
@@ -238,7 +238,7 @@ int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata) · 19 unmodified lines
238238 if (cl_data->sensor_virt_addr[i]) {
239239 dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
240240 cl_data->sensor_virt_addr[i],
241− cl_data->sensor_phys_addr[i]);
241+ cl_data->sensor_dma_addr[i]);
242242 }
243243 }
244244 kfree(cl_data);
drivers/hid/amd-sfh-hid/amd_sfh_hid.h+1−1
@@ -27,7 +27,7 @@ struct amdtp_cl_data { · 26 unmodified lines
2727 int hid_descr_size[MAX_HID_DEVICES];
2828 phys_addr_t phys_addr_base;
2929 u32 *sensor_virt_addr[MAX_HID_DEVICES];
30− phys_addr_t sensor_phys_addr[MAX_HID_DEVICES];
30+ dma_addr_t sensor_dma_addr[MAX_HID_DEVICES];
3131 u32 sensor_sts[MAX_HID_DEVICES];
3232 u32 sensor_requested_cnt[MAX_HID_DEVICES];
3333 u8 report_type[MAX_HID_DEVICES];
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c+1−1
@@ -41,7 +41,7 @@ void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info i · 40 unmodified lines
4141 cmd_param.s.buf_layout = 1;
4242 cmd_param.s.buf_length = 16;
4343
44− writeq(info.phys_address, privdata->mmio + AMD_C2P_MSG2);
44+ writeq(info.dma_address, privdata->mmio + AMD_C2P_MSG2);
4545 writel(cmd_param.ul, privdata->mmio + AMD_C2P_MSG1);
4646 writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
4747 }
drivers/hid/amd-sfh-hid/amd_sfh_pcie.h+1−1
@@ -67,7 +67,7 @@ struct amd_mp2_dev { · 66 unmodified lines
6767 struct amd_mp2_sensor_info {
6868 u8 sensor_idx;
6969 u32 period;
70− phys_addr_t phys_address;
70+ dma_addr_t dma_address;
7171 };
7272
7373 void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info);
drivers/hid/hid-ids.h+1−0
@@ -389,6 +389,7 @@ · 388 unmodified lines
389389 #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401
390390 #define USB_DEVICE_ID_HP_X2 0x074d
391391 #define USB_DEVICE_ID_HP_X2_10_COVER 0x0755
392+#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706
392393
393394 #define USB_VENDOR_ID_ELECOM 0x056e
394395 #define USB_DEVICE_ID_ELECOM_BM084 0x0061
drivers/hid/hid-input.c+2−0
@@ -322,6 +322,8 @@ static const struct hid_device_id hid_battery_quirks[] = { · 321 unmodified lines
322322 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
323323 USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD),
324324 HID_BATTERY_QUIRK_IGNORE },
325+ { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN),
326+ HID_BATTERY_QUIRK_IGNORE },
325327 {}
326328 };
327329
drivers/hid/hid-logitech-dj.c+4−0
@@ -1869,6 +1869,10 @@ static const struct hid_device_id logi_dj_receivers[] = { · 1868 unmodified lines
18691869 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18701870 0xc531),
18711871 .driver_data = recvr_type_gaming_hidpp},
1872+ { /* Logitech G602 receiver (0xc537) */
1873+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1874+ 0xc537),
1875+ .driver_data = recvr_type_gaming_hidpp},
18721876 { /* Logitech lightspeed receiver (0xc539) */
18731877 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18741878 USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1),
drivers/hid/hid-logitech-hidpp.c+2−0
@@ -4053,6 +4053,8 @@ static const struct hid_device_id hidpp_devices[] = { · 4052 unmodified lines
40534053 { /* MX Master mouse over Bluetooth */
40544054 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb012),
40554055 .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 },
4056+ { /* MX Ergo trackball over Bluetooth */
4057+ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01d) },
40564058 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01e),
40574059 .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 },
40584060 { /* MX Master 3 mouse over Bluetooth */
drivers/hid/hid-multitouch.c+4−0
@@ -2054,6 +2054,10 @@ static const struct hid_device_id mt_devices[] = { · 2053 unmodified lines
20542054 HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
20552055 USB_VENDOR_ID_SYNAPTICS, 0xce08) },
20562056
2057+ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
2058+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2059+ USB_VENDOR_ID_SYNAPTICS, 0xce09) },
2060+
20572061 /* TopSeed panels */
20582062 { .driver_data = MT_CLS_TOPSEED,
20592063 MT_USB_DEVICE(USB_VENDOR_ID_TOPSEED2,
drivers/hid/hid-uclogic-params.c+1−1
@@ -90,7 +90,7 @@ static int uclogic_params_get_str_desc(__u8 **pbuf, struct hid_device *hdev, · 89 unmodified lines
9090 goto cleanup;
9191 } else if (rc < 0) {
9292 hid_err(hdev,
93− "failed retrieving string descriptor #%hhu: %d\n",
93+ "failed retrieving string descriptor #%u: %d\n",
9494 idx, rc);
9595 goto cleanup;
9696 }
drivers/hid/hid-wiimote-core.c+1−1
@@ -1482,7 +1482,7 @@ static void handler_return(struct wiimote_data *wdata, const __u8 *payload) · 1481 unmodified lines
14821482 wdata->state.cmd_err = err;
14831483 wiimote_cmd_complete(wdata);
14841484 } else if (err) {
1485− hid_warn(wdata->hdev, "Remote error %hhu on req %hhu\n", err,
1485+ hid_warn(wdata->hdev, "Remote error %u on req %u\n", err,
14861486 cmd);
14871487 }
14881488 }
drivers/hid/wacom_sys.c+32−3
@@ -1270,6 +1270,37 @@ static int wacom_devm_sysfs_create_group(struct wacom *wacom, · 1269 unmodified lines
12701270 group);
12711271 }
12721272
1273+static void wacom_devm_kfifo_release(struct device *dev, void *res)
1274+{
1275+ struct kfifo_rec_ptr_2 *devres = res;
1276+
1277+ kfifo_free(devres);
1278+}
1279+
1280+static int wacom_devm_kfifo_alloc(struct wacom *wacom)
1281+{
1282+ struct wacom_wac *wacom_wac = &wacom->wacom_wac;
1283+ struct kfifo_rec_ptr_2 *pen_fifo = &wacom_wac->pen_fifo;
1284+ int error;
1285+
1286+ pen_fifo = devres_alloc(wacom_devm_kfifo_release,
1287+ sizeof(struct kfifo_rec_ptr_2),
1288+ GFP_KERNEL);
1289+
1290+ if (!pen_fifo)
1291+ return -ENOMEM;
1292+
1293+ error = kfifo_alloc(pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL);
1294+ if (error) {
1295+ devres_free(pen_fifo);
1296+ return error;
1297+ }
1298+
1299+ devres_add(&wacom->hdev->dev, pen_fifo);
1300+
1301+ return 0;
1302+}
1303+
12731304 enum led_brightness wacom_leds_brightness_get(struct wacom_led *led)
12741305 {
12751306 struct wacom *wacom = led->wacom;
@@ -2724,7 +2755,7 @@ static int wacom_probe(struct hid_device *hdev, · 1448 unmodified lines
27242755 if (features->check_for_hid_type && features->hid_type != hdev->type)
27252756 return -ENODEV;
27262757
2727− error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL);
2758+ error = wacom_devm_kfifo_alloc(wacom);
27282759 if (error)
27292760 return error;
27302761
@@ -2786,8 +2817,6 @@ static void wacom_remove(struct hid_device *hdev) · 55 unmodified lines
27862817
27872818 if (wacom->wacom_wac.features.type != REMOTE)
27882819 wacom_release_resources(wacom);
2789−
2790− kfifo_free(&wacom_wac->pen_fifo);
27912820 }
27922821
27932822 #ifdef CONFIG_PM
drivers/hv/vmbus_drv.c+0−2
@@ -2550,7 +2550,6 @@ static void hv_kexec_handler(void) · 2549 unmodified lines
25502550 /* Make sure conn_state is set as hv_synic_cleanup checks for it */
25512551 mb();
25522552 cpuhp_remove_state(hyperv_cpuhp_online);
2553− hyperv_cleanup();
25542553 };
25552554
25562555 static void hv_crash_handler(struct pt_regs *regs)
@@ -2566,7 +2565,6 @@ static void hv_crash_handler(struct pt_regs *regs) · 9 unmodified lines
25662565 cpu = smp_processor_id();
25672566 hv_stimer_cleanup(cpu);
25682567 hv_synic_disable_regs(cpu);
2569− hyperv_cleanup();
25702568 };
25712569
25722570 static int hv_synic_suspend(void)
drivers/hwmon/amd_energy.c+2−1
@@ -222,7 +222,7 @@ static int amd_create_sensor(struct device *dev, · 221 unmodified lines
222222 */
223223 cpus = num_present_cpus() / num_siblings;
224224
225− s_config = devm_kcalloc(dev, cpus + sockets,
225+ s_config = devm_kcalloc(dev, cpus + sockets + 1,
226226 sizeof(u32), GFP_KERNEL);
227227 if (!s_config)
228228 return -ENOMEM;
@@ -254,6 +254,7 @@ static int amd_create_sensor(struct device *dev, · 25 unmodified lines
254254 scnprintf(label_l[i], 10, "Esocket%u", (i - cpus));
255255 }
256256
257+ s_config[i] = 0;
257258 return 0;
258259 }
259260
drivers/hwmon/pwm-fan.c+11−1
@@ -334,8 +334,18 @@ static int pwm_fan_probe(struct platform_device *pdev) · 333 unmodified lines
334334
335335 ctx->pwm_value = MAX_PWM;
336336
337− /* Set duty cycle to maximum allowed and enable PWM output */
338337 pwm_init_state(ctx->pwm, &state);
338+ /*
339+ * __set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned
340+ * long. Check this here to prevent the fan running at a too low
341+ * frequency.
342+ */
343+ if (state.period > ULONG_MAX / MAX_PWM + 1) {
344+ dev_err(dev, "Configured period too big\n");
345+ return -EINVAL;
346+ }
347+
348+ /* Set duty cycle to maximum allowed and enable PWM output */
339349 state.duty_cycle = ctx->pwm->args.period - 1;
340350 state.enabled = true;
341351
drivers/i2c/busses/i2c-i801.c+1−1
@@ -1449,7 +1449,7 @@ static int i801_add_mux(struct i801_priv *priv) · 1448 unmodified lines
14491449
14501450 /* Register GPIO descriptor lookup table */
14511451 lookup = devm_kzalloc(dev,
1452− struct_size(lookup, table, mux_config->n_gpios),
1452+ struct_size(lookup, table, mux_config->n_gpios + 1),
14531453 GFP_KERNEL);
14541454 if (!lookup)
14551455 return -ENOMEM;
drivers/i2c/busses/i2c-mt65xx.c+22−5
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #define I2C_IO_CONFIG_OPEN_DRAIN 0x0003
3939 #define I2C_IO_CONFIG_PUSH_PULL 0x0000
4040 #define I2C_SOFT_RST 0x0001
41+#define I2C_HANDSHAKE_RST 0x0020
4142 #define I2C_FIFO_ADDR_CLR 0x0001
4243 #define I2C_DELAY_LEN 0x0002
4344 #define I2C_TIME_CLR_VALUE 0x0000
@@ -45,6 +46,7 @@ · 1 unmodified line
4546 #define I2C_WRRD_TRANAC_VALUE 0x0002
4647 #define I2C_RD_TRANAC_VALUE 0x0001
4748 #define I2C_SCL_MIS_COMP_VALUE 0x0000
49+#define I2C_CHN_CLR_FLAG 0x0000
4850
4951 #define I2C_DMA_CON_TX 0x0000
5052 #define I2C_DMA_CON_RX 0x0001
@@ -54,7 +56,9 @@ · 3 unmodified lines
5456 #define I2C_DMA_START_EN 0x0001
5557 #define I2C_DMA_INT_FLAG_NONE 0x0000
5658 #define I2C_DMA_CLR_FLAG 0x0000
59+#define I2C_DMA_WARM_RST 0x0001
5760 #define I2C_DMA_HARD_RST 0x0002
61+#define I2C_DMA_HANDSHAKE_RST 0x0004
5862
5963 #define MAX_SAMPLE_CNT_DIV 8
6064 #define MAX_STEP_CNT_DIV 64
@@ -475,11 +479,24 @@ static void mtk_i2c_init_hw(struct mtk_i2c *i2c) · 414 unmodified lines
475479 {
476480 u16 control_reg;
477481
478− writel(I2C_DMA_HARD_RST, i2c->pdmabase + OFFSET_RST);
479− udelay(50);
480− writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
481−
482− mtk_i2c_writew(i2c, I2C_SOFT_RST, OFFSET_SOFTRESET);
482+ if (i2c->dev_comp->dma_sync) {
483+ writel(I2C_DMA_WARM_RST, i2c->pdmabase + OFFSET_RST);
484+ udelay(10);
485+ writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
486+ udelay(10);
487+ writel(I2C_DMA_HANDSHAKE_RST | I2C_DMA_HARD_RST,
488+ i2c->pdmabase + OFFSET_RST);
489+ mtk_i2c_writew(i2c, I2C_HANDSHAKE_RST | I2C_SOFT_RST,
490+ OFFSET_SOFTRESET);
491+ udelay(10);
492+ writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
493+ mtk_i2c_writew(i2c, I2C_CHN_CLR_FLAG, OFFSET_SOFTRESET);
494+ } else {
495+ writel(I2C_DMA_HARD_RST, i2c->pdmabase + OFFSET_RST);
496+ udelay(50);
497+ writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
498+ mtk_i2c_writew(i2c, I2C_SOFT_RST, OFFSET_SOFTRESET);
499+ }
483500
484501 /* Set ioconfig */
485502 if (i2c->use_push_pull)
drivers/i2c/busses/i2c-sprd.c+7−1
@@ -72,6 +72,8 @@ · 71 unmodified lines
7272
7373 /* timeout (ms) for pm runtime autosuspend */
7474 #define SPRD_I2C_PM_TIMEOUT 1000
75+/* timeout (ms) for transfer message */
76+#define I2C_XFER_TIMEOUT 1000
7577
7678 /* SPRD i2c data structure */
7779 struct sprd_i2c {
@@ -244,6 +246,7 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap, · 166 unmodified lines
244246 struct i2c_msg *msg, bool is_last_msg)
245247 {
246248 struct sprd_i2c *i2c_dev = i2c_adap->algo_data;
249+ unsigned long time_left;
247250
248251 i2c_dev->msg = msg;
249252 i2c_dev->buf = msg->buf;
@@ -273,7 +276,10 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap, · 23 unmodified lines
273276
274277 sprd_i2c_opt_start(i2c_dev);
275278
276− wait_for_completion(&i2c_dev->complete);
279+ time_left = wait_for_completion_timeout(&i2c_dev->complete,
280+ msecs_to_jiffies(I2C_XFER_TIMEOUT));
281+ if (!time_left)
282+ return -ETIMEDOUT;
277283
278284 return i2c_dev->err;
279285 }
drivers/ide/ide-atapi.c+0−1
@@ -223,7 +223,6 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq) · 222 unmodified lines
223223 sense_rq->rq_disk = rq->rq_disk;
224224 sense_rq->cmd_flags = REQ_OP_DRV_IN;
225225 ide_req(sense_rq)->type = ATA_PRIV_SENSE;
226− sense_rq->rq_flags |= RQF_PREEMPT;
227226
228227 req->cmd[0] = GPCMD_REQUEST_SENSE;
229228 req->cmd[4] = cmd_len;
drivers/ide/ide-io.c+1−6
@@ -515,15 +515,10 @@ repeat: · 514 unmodified lines
515515 * above to return us whatever is in the queue. Since we call
516516 * ide_do_request() ourselves, we end up taking requests while
517517 * the queue is blocked...
518− *
519− * We let requests forced at head of queue with ide-preempt
520− * though. I hope that doesn't happen too much, hopefully not
521− * unless the subdriver triggers such a thing in its own PM
522− * state machine.
523518 */
524519 if ((drive->dev_flags & IDE_DFLAG_BLOCKED) &&
525520 ata_pm_request(rq) == 0 &&
526− (rq->rq_flags & RQF_PREEMPT) == 0) {
521+ (rq->rq_flags & RQF_PM) == 0) {
527522 /* there should be no pending command at this point */
528523 ide_unlock_port(hwif);
529524 goto plug_device;
drivers/ide/ide-pm.c+1−1
@@ -77,7 +77,7 @@ int generic_ide_resume(struct device *dev) · 76 unmodified lines
7777 }
7878
7979 memset(&rqpm, 0, sizeof(rqpm));
80− rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PREEMPT);
80+ rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PM);
8181 ide_req(rq)->type = ATA_PRIV_PM_RESUME;
8282 ide_req(rq)->special = &rqpm;
8383 rqpm.pm_step = IDE_PM_START_RESUME;
drivers/idle/intel_idle.c+40−1
@@ -963,6 +963,39 @@ static struct cpuidle_state dnv_cstates[] __initdata = { · 962 unmodified lines
963963 .enter = NULL }
964964 };
965965
966+/*
967+ * Note, depending on HW and FW revision, SnowRidge SoC may or may not support
968+ * C6, and this is indicated in the CPUID mwait leaf.
969+ */
970+static struct cpuidle_state snr_cstates[] __initdata = {
971+ {
972+ .name = "C1",
973+ .desc = "MWAIT 0x00",
974+ .flags = MWAIT2flg(0x00),
975+ .exit_latency = 2,
976+ .target_residency = 2,
977+ .enter = &intel_idle,
978+ .enter_s2idle = intel_idle_s2idle, },
979+ {
980+ .name = "C1E",
981+ .desc = "MWAIT 0x01",
982+ .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
983+ .exit_latency = 15,
984+ .target_residency = 25,
985+ .enter = &intel_idle,
986+ .enter_s2idle = intel_idle_s2idle, },
987+ {
988+ .name = "C6",
989+ .desc = "MWAIT 0x20",
990+ .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
991+ .exit_latency = 130,
992+ .target_residency = 500,
993+ .enter = &intel_idle,
994+ .enter_s2idle = intel_idle_s2idle, },
995+ {
996+ .enter = NULL }
997+};
998+
966999 static const struct idle_cpu idle_cpu_nehalem __initconst = {
9671000 .state_table = nehalem_cstates,
9681001 .auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE,
@@ -1084,6 +1117,12 @@ static const struct idle_cpu idle_cpu_dnv __initconst = { · 115 unmodified lines
10841117 .use_acpi = true,
10851118 };
10861119
1120+static const struct idle_cpu idle_cpu_snr __initconst = {
1121+ .state_table = snr_cstates,
1122+ .disable_promotion_to_c1e = true,
1123+ .use_acpi = true,
1124+};
1125+
10871126 static const struct x86_cpu_id intel_idle_ids[] __initconst = {
10881127 X86_MATCH_INTEL_FAM6_MODEL(NEHALEM_EP, &idle_cpu_nhx),
10891128 X86_MATCH_INTEL_FAM6_MODEL(NEHALEM, &idle_cpu_nehalem),
@@ -1122,7 +1161,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = { · 32 unmodified lines
11221161 X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, &idle_cpu_bxt),
11231162 X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_PLUS, &idle_cpu_bxt),
11241163 X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_D, &idle_cpu_dnv),
1125− X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &idle_cpu_dnv),
1164+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &idle_cpu_snr),
11261165 {}
11271166 };
11281167
drivers/infiniband/core/cma_configfs.c+3−1
@@ -131,8 +131,10 @@ static ssize_t default_roce_mode_store(struct config_item *item, · 130 unmodified lines
131131 return ret;
132132
133133 gid_type = ib_cache_gid_parse_type_str(buf);
134− if (gid_type < 0)
134+ if (gid_type < 0) {
135+ cma_configfs_params_put(cma_dev);
135136 return -EINVAL;
137+ }
136138
137139 ret = cma_set_default_gid_type(cma_dev, group->port_num, gid_type);
138140
drivers/infiniband/core/restrack.c+1−0
@@ -254,6 +254,7 @@ void rdma_restrack_add(struct rdma_restrack_entry *res) · 253 unmodified lines
254254 } else {
255255 ret = xa_alloc_cyclic(&rt->xa, &res->id, res, xa_limit_32b,
256256 &rt->next_id, GFP_KERNEL);
257+ ret = (ret < 0) ? ret : 0;
257258 }
258259
259260 out:
drivers/infiniband/core/ucma.c+72−63
@@ -95,8 +95,6 @@ struct ucma_context { · 94 unmodified lines
9595 u64 uid;
9696
9797 struct list_head list;
98− /* sync between removal event and id destroy, protected by file mut */
99− int destroying;
10098 struct work_struct close_work;
10199 };
102100
@@ -122,7 +120,7 @@ static DEFINE_XARRAY_ALLOC(ctx_table); · 19 unmodified lines
122120 static DEFINE_XARRAY_ALLOC(multicast_table);
123121
124122 static const struct file_operations ucma_fops;
125−static int __destroy_id(struct ucma_context *ctx);
123+static int ucma_destroy_private_ctx(struct ucma_context *ctx);
126124
127125 static inline struct ucma_context *_ucma_find_context(int id,
128126 struct ucma_file *file)
@@ -179,19 +177,14 @@ static void ucma_close_id(struct work_struct *work) · 50 unmodified lines
179177
180178 /* once all inflight tasks are finished, we close all underlying
181179 * resources. The context is still alive till its explicit destryoing
182− * by its creator.
180+ * by its creator. This puts back the xarray's reference.
183181 */
184182 ucma_put_ctx(ctx);
185183 wait_for_completion(&ctx->comp);
186184 /* No new events will be generated after destroying the id. */
187185 rdma_destroy_id(ctx->cm_id);
188186
189− /*
190− * At this point ctx->ref is zero so the only place the ctx can be is in
191− * a uevent or in __destroy_id(). Since the former doesn't touch
192− * ctx->cm_id and the latter sync cancels this, there is no races with
193− * this store.
194− */
187+ /* Reading the cm_id without holding a positive ref is not allowed */
195188 ctx->cm_id = NULL;
196189 }
197190
@@ -204,7 +197,6 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file) · 6 unmodified lines
204197 return NULL;
205198
206199 INIT_WORK(&ctx->close_work, ucma_close_id);
207− refcount_set(&ctx->ref, 1);
208200 init_completion(&ctx->comp);
209201 /* So list_del() will work if we don't do ucma_finish_ctx() */
210202 INIT_LIST_HEAD(&ctx->list);
@@ -218,6 +210,13 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file) · 7 unmodified lines
218210 return ctx;
219211 }
220212
213+static void ucma_set_ctx_cm_id(struct ucma_context *ctx,
214+ struct rdma_cm_id *cm_id)
215+{
216+ refcount_set(&ctx->ref, 1);
217+ ctx->cm_id = cm_id;
218+}
219+
221220 static void ucma_finish_ctx(struct ucma_context *ctx)
222221 {
223222 lockdep_assert_held(&ctx->file->mut);
@@ -303,7 +302,7 @@ static int ucma_connect_event_handler(struct rdma_cm_id *cm_id, · 79 unmodified lines
303302 ctx = ucma_alloc_ctx(listen_ctx->file);
304303 if (!ctx)
305304 goto err_backlog;
306− ctx->cm_id = cm_id;
305+ ucma_set_ctx_cm_id(ctx, cm_id);
307306
308307 uevent = ucma_create_uevent(listen_ctx, event);
309308 if (!uevent)
@@ -321,8 +320,7 @@ static int ucma_connect_event_handler(struct rdma_cm_id *cm_id, · 11 unmodified lines
321320 return 0;
322321
323322 err_alloc:
324− xa_erase(&ctx_table, ctx->id);
325− kfree(ctx);
323+ ucma_destroy_private_ctx(ctx);
326324 err_backlog:
327325 atomic_inc(&listen_ctx->backlog);
328326 /* Returning error causes the new ID to be destroyed */
@@ -356,8 +354,12 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, · 27 unmodified lines
356354 wake_up_interruptible(&ctx->file->poll_wait);
357355 }
358356
359− if (event->event == RDMA_CM_EVENT_DEVICE_REMOVAL && !ctx->destroying)
360− queue_work(system_unbound_wq, &ctx->close_work);
357+ if (event->event == RDMA_CM_EVENT_DEVICE_REMOVAL) {
358+ xa_lock(&ctx_table);
359+ if (xa_load(&ctx_table, ctx->id) == ctx)
360+ queue_work(system_unbound_wq, &ctx->close_work);
361+ xa_unlock(&ctx_table);
362+ }
361363 return 0;
362364 }
363365
@@ -461,13 +463,12 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf, · 97 unmodified lines
461463 ret = PTR_ERR(cm_id);
462464 goto err1;
463465 }
464− ctx->cm_id = cm_id;
466+ ucma_set_ctx_cm_id(ctx, cm_id);
465467
466468 resp.id = ctx->id;
467469 if (copy_to_user(u64_to_user_ptr(cmd.response),
468470 &resp, sizeof(resp))) {
469− xa_erase(&ctx_table, ctx->id);
470− __destroy_id(ctx);
471+ ucma_destroy_private_ctx(ctx);
471472 return -EFAULT;
472473 }
473474
@@ -477,8 +478,7 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf, · 3 unmodified lines
477478 return 0;
478479
479480 err1:
480− xa_erase(&ctx_table, ctx->id);
481− kfree(ctx);
481+ ucma_destroy_private_ctx(ctx);
482482 return ret;
483483 }
484484
@@ -516,68 +516,73 @@ static void ucma_cleanup_mc_events(struct ucma_multicast *mc) · 31 unmodified lines
516516 rdma_unlock_handler(mc->ctx->cm_id);
517517 }
518518
519−/*
520− * ucma_free_ctx is called after the underlying rdma CM-ID is destroyed. At
521− * this point, no new events will be reported from the hardware. However, we
522− * still need to cleanup the UCMA context for this ID. Specifically, there
523− * might be events that have not yet been consumed by the user space software.
524− * mutex. After that we release them as needed.
525− */
526−static int ucma_free_ctx(struct ucma_context *ctx)
519+static int ucma_cleanup_ctx_events(struct ucma_context *ctx)
527520 {
528521 int events_reported;
529522 struct ucma_event *uevent, *tmp;
530523 LIST_HEAD(list);
531524
532− ucma_cleanup_multicast(ctx);
533−
534− /* Cleanup events not yet reported to the user. */
525+ /* Cleanup events not yet reported to the user.*/
535526 mutex_lock(&ctx->file->mut);
536527 list_for_each_entry_safe(uevent, tmp, &ctx->file->event_list, list) {
537− if (uevent->ctx == ctx || uevent->conn_req_ctx == ctx)
528+ if (uevent->ctx != ctx)
529+ continue;
530+
531+ if (uevent->resp.event == RDMA_CM_EVENT_CONNECT_REQUEST &&
532+ xa_cmpxchg(&ctx_table, uevent->conn_req_ctx->id,
533+ uevent->conn_req_ctx, XA_ZERO_ENTRY,
534+ GFP_KERNEL) == uevent->conn_req_ctx) {
538535 list_move_tail(&uevent->list, &list);
536+ continue;
537+ }
538+ list_del(&uevent->list);
539+ kfree(uevent);
539540 }
540541 list_del(&ctx->list);
541542 events_reported = ctx->events_reported;
542543 mutex_unlock(&ctx->file->mut);
543544
544545 /*
545− * If this was a listening ID then any connections spawned from it
546− * that have not been delivered to userspace are cleaned up too.
547− * Must be done outside any locks.
546+ * If this was a listening ID then any connections spawned from it that
547+ * have not been delivered to userspace are cleaned up too. Must be done
548+ * outside any locks.
548549 */
549550 list_for_each_entry_safe(uevent, tmp, &list, list) {
550− list_del(&uevent->list);
551− if (uevent->resp.event == RDMA_CM_EVENT_CONNECT_REQUEST &&
552− uevent->conn_req_ctx != ctx)
553− __destroy_id(uevent->conn_req_ctx);
551+ ucma_destroy_private_ctx(uevent->conn_req_ctx);
554552 kfree(uevent);
555553 }
556−
557− mutex_destroy(&ctx->mutex);
558− kfree(ctx);
559554 return events_reported;
560555 }
561556
562−static int __destroy_id(struct ucma_context *ctx)
557+/*
558+ * When this is called the xarray must have a XA_ZERO_ENTRY in the ctx->id (ie
559+ * the ctx is not public to the user). This either because:
560+ * - ucma_finish_ctx() hasn't been called
561+ * - xa_cmpxchg() succeed to remove the entry (only one thread can succeed)
562+ */
563+static int ucma_destroy_private_ctx(struct ucma_context *ctx)
563564 {
565+ int events_reported;
566+
564567 /*
565− * If the refcount is already 0 then ucma_close_id() has already
566− * destroyed the cm_id, otherwise holding the refcount keeps cm_id
567− * valid. Prevent queue_work() from being called.
568+ * Destroy the underlying cm_id. New work queuing is prevented now by
569+ * the removal from the xarray. Once the work is cancled ref will either
570+ * be 0 because the work ran to completion and consumed the ref from the
571+ * xarray, or it will be positive because we still have the ref from the
572+ * xarray. This can also be 0 in cases where cm_id was never set
568573 */
569− if (refcount_inc_not_zero(&ctx->ref)) {
570− rdma_lock_handler(ctx->cm_id);
571− ctx->destroying = 1;
572− rdma_unlock_handler(ctx->cm_id);
573− ucma_put_ctx(ctx);
574− }
575−
576574 cancel_work_sync(&ctx->close_work);
577− /* At this point it's guaranteed that there is no inflight closing task */
578− if (ctx->cm_id)
575+ if (refcount_read(&ctx->ref))
579576 ucma_close_id(&ctx->close_work);
580− return ucma_free_ctx(ctx);
577+
578+ events_reported = ucma_cleanup_ctx_events(ctx);
579+ ucma_cleanup_multicast(ctx);
580+
581+ WARN_ON(xa_cmpxchg(&ctx_table, ctx->id, XA_ZERO_ENTRY, NULL,
582+ GFP_KERNEL) != NULL);
583+ mutex_destroy(&ctx->mutex);
584+ kfree(ctx);
585+ return events_reported;
581586 }
582587
583588 static ssize_t ucma_destroy_id(struct ucma_file *file, const char __user *inbuf,
@@ -596,14 +601,17 @@ static ssize_t ucma_destroy_id(struct ucma_file *file, const char __user *inbuf, · 12 unmodified lines
596601
597602 xa_lock(&ctx_table);
598603 ctx = _ucma_find_context(cmd.id, file);
599− if (!IS_ERR(ctx))
600− __xa_erase(&ctx_table, ctx->id);
604+ if (!IS_ERR(ctx)) {
605+ if (__xa_cmpxchg(&ctx_table, ctx->id, ctx, XA_ZERO_ENTRY,
606+ GFP_KERNEL) != ctx)
607+ ctx = ERR_PTR(-ENOENT);
608+ }
601609 xa_unlock(&ctx_table);
602610
603611 if (IS_ERR(ctx))
604612 return PTR_ERR(ctx);
605613
606− resp.events_reported = __destroy_id(ctx);
614+ resp.events_reported = ucma_destroy_private_ctx(ctx);
607615 if (copy_to_user(u64_to_user_ptr(cmd.response),
608616 &resp, sizeof(resp)))
609617 ret = -EFAULT;
@@ -1777,15 +1785,16 @@ static int ucma_close(struct inode *inode, struct file *filp) · 1167 unmodified lines
17771785 * prevented by this being a FD release function. The list_add_tail() in
17781786 * ucma_connect_event_handler() can run concurrently, however it only
17791787 * adds to the list *after* a listening ID. By only reading the first of
1780− * the list, and relying on __destroy_id() to block
1788+ * the list, and relying on ucma_destroy_private_ctx() to block
17811789 * ucma_connect_event_handler(), no additional locking is needed.
17821790 */
17831791 while (!list_empty(&file->ctx_list)) {
17841792 struct ucma_context *ctx = list_first_entry(
17851793 &file->ctx_list, struct ucma_context, list);
17861794
1787− xa_erase(&ctx_table, ctx->id);
1788− __destroy_id(ctx);
1795+ WARN_ON(xa_cmpxchg(&ctx_table, ctx->id, ctx, XA_ZERO_ENTRY,
1796+ GFP_KERNEL) != ctx);
1797+ ucma_destroy_private_ctx(ctx);
17891798 }
17901799 kfree(file);
17911800 return 0;
drivers/infiniband/core/umem.c+1−1
@@ -135,7 +135,7 @@ unsigned long ib_umem_find_best_pgsz(struct ib_umem *umem, · 134 unmodified lines
135135 */
136136 if (mask)
137137 pgsz_bitmap &= GENMASK(count_trailing_zeros(mask), 0);
138− return rounddown_pow_of_two(pgsz_bitmap);
138+ return pgsz_bitmap ? rounddown_pow_of_two(pgsz_bitmap) : 0;
139139 }
140140 EXPORT_SYMBOL(ib_umem_find_best_pgsz);
141141
drivers/infiniband/hw/mlx5/main.c+2−2
@@ -3956,7 +3956,7 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev) · 3955 unmodified lines
39563956
39573957 err = set_has_smi_cap(dev);
39583958 if (err)
3959− return err;
3959+ goto err_mp;
39603960
39613961 if (!mlx5_core_mp_enabled(mdev)) {
39623962 for (i = 1; i <= dev->num_ports; i++) {
@@ -4319,7 +4319,7 @@ static int mlx5_ib_stage_bfrag_init(struct mlx5_ib_dev *dev) · 356 unmodified lines
43194319
43204320 err = mlx5_alloc_bfreg(dev->mdev, &dev->fp_bfreg, false, true);
43214321 if (err)
4322− mlx5_free_bfreg(dev->mdev, &dev->fp_bfreg);
4322+ mlx5_free_bfreg(dev->mdev, &dev->bfreg);
43234323
43244324 return err;
43254325 }
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+1−1
@@ -434,9 +434,9 @@ static void ocrdma_dealloc_ucontext_pd(struct ocrdma_ucontext *uctx) · 433 unmodified lines
434434 pr_err("%s(%d) Freeing in use pdid=0x%x.\n",
435435 __func__, dev->id, pd->id);
436436 }
437− kfree(uctx->cntxt_pd);
438437 uctx->cntxt_pd = NULL;
439438 _ocrdma_dealloc_pd(dev, pd);
439+ kfree(pd);
440440 }
441441
442442 static struct ocrdma_pd *ocrdma_get_ucontext_pd(struct ocrdma_ucontext *uctx)
drivers/infiniband/hw/usnic/usnic_ib_verbs.c+3−0
@@ -214,6 +214,7 @@ find_free_vf_and_create_qp_grp(struct usnic_ib_dev *us_ibdev, · 213 unmodified lines
214214
215215 }
216216 usnic_uiom_free_dev_list(dev_list);
217+ dev_list = NULL;
217218 }
218219
219220 /* Try to find resources on an unused vf */
@@ -239,6 +240,8 @@ find_free_vf_and_create_qp_grp(struct usnic_ib_dev *us_ibdev, · 19 unmodified lines
239240 qp_grp_check:
240241 if (IS_ERR_OR_NULL(qp_grp)) {
241242 usnic_err("Failed to allocate qp_grp\n");
243+ if (usnic_ib_share_vf)
244+ usnic_uiom_free_dev_list(dev_list);
242245 return ERR_PTR(qp_grp ? PTR_ERR(qp_grp) : -ENOMEM);
243246 }
244247 return qp_grp;
drivers/interconnect/imx/imx.c+2−1
@@ -96,9 +96,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider, · 95 unmodified lines
9696 return -ENODEV;
9797 }
9898 /* Allow scaling to be disabled on a per-node basis */
99− if (!dn || !of_device_is_available(dn)) {
99+ if (!of_device_is_available(dn)) {
100100 dev_warn(dev, "Missing property %s, skip scaling %s\n",
101101 adj->phandle_name, node->name);
102+ of_node_put(dn);
102103 return 0;
103104 }
104105
drivers/interconnect/imx/imx8mq.c+2−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77
88 #include <linux/module.h>
99 #include <linux/platform_device.h>
10+#include <linux/interconnect-provider.h>
1011 #include <dt-bindings/interconnect/imx8mq.h>
1112
1213 #include "imx.h"
@@ -94,6 +95,7 @@ static struct platform_driver imx8mq_icc_driver = { · 81 unmodified lines
9495 .remove = imx8mq_icc_remove,
9596 .driver = {
9697 .name = "imx8mq-interconnect",
98+ .sync_state = icc_sync_state,
9799 },
98100 };
99101
drivers/interconnect/qcom/Kconfig+15−8
@@ -42,13 +42,23 @@ config INTERCONNECT_QCOM_QCS404 · 41 unmodified lines
4242 This is a driver for the Qualcomm Network-on-Chip on qcs404-based
4343 platforms.
4444
45+config INTERCONNECT_QCOM_RPMH_POSSIBLE
46+ tristate
47+ default INTERCONNECT_QCOM
48+ depends on QCOM_RPMH || (COMPILE_TEST && !QCOM_RPMH)
49+ depends on QCOM_COMMAND_DB || (COMPILE_TEST && !QCOM_COMMAND_DB)
50+ depends on OF || COMPILE_TEST
51+ help
52+ Compile-testing RPMH drivers is possible on other platforms,
53+ but in order to avoid link failures, drivers must not be built-in
54+ when QCOM_RPMH or QCOM_COMMAND_DB are loadable modules
55+
4556 config INTERCONNECT_QCOM_RPMH
4657 tristate
4758
4859 config INTERCONNECT_QCOM_SC7180
4960 tristate "Qualcomm SC7180 interconnect driver"
50− depends on INTERCONNECT_QCOM
51− depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
61+ depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
5262 select INTERCONNECT_QCOM_RPMH
5363 select INTERCONNECT_QCOM_BCM_VOTER
5464 help
@@ -57,8 +67,7 @@ config INTERCONNECT_QCOM_SC7180 · 2 unmodified lines
5767
5868 config INTERCONNECT_QCOM_SDM845
5969 tristate "Qualcomm SDM845 interconnect driver"
60− depends on INTERCONNECT_QCOM
61− depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
70+ depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
6271 select INTERCONNECT_QCOM_RPMH
6372 select INTERCONNECT_QCOM_BCM_VOTER
6473 help
@@ -67,8 +76,7 @@ config INTERCONNECT_QCOM_SDM845 · 2 unmodified lines
6776
6877 config INTERCONNECT_QCOM_SM8150
6978 tristate "Qualcomm SM8150 interconnect driver"
70− depends on INTERCONNECT_QCOM
71− depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
79+ depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
7280 select INTERCONNECT_QCOM_RPMH
7381 select INTERCONNECT_QCOM_BCM_VOTER
7482 help
@@ -77,8 +85,7 @@ config INTERCONNECT_QCOM_SM8150 · 2 unmodified lines
7785
7886 config INTERCONNECT_QCOM_SM8250
7987 tristate "Qualcomm SM8250 interconnect driver"
80− depends on INTERCONNECT_QCOM
81− depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
88+ depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
8289 select INTERCONNECT_QCOM_RPMH
8390 select INTERCONNECT_QCOM_BCM_VOTER
8491 help
drivers/iommu/amd/init.c+1−2
@@ -1973,8 +1973,6 @@ static int iommu_setup_msi(struct amd_iommu *iommu) · 1972 unmodified lines
19731973 return r;
19741974 }
19751975
1976− iommu->int_enabled = true;
1977−
19781976 return 0;
19791977 }
19801978
@@ -2169,6 +2167,7 @@ static int iommu_init_irq(struct amd_iommu *iommu) · 188 unmodified lines
21692167 if (ret)
21702168 return ret;
21712169
2170+ iommu->int_enabled = true;
21722171 enable_faults:
21732172 iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
21742173
drivers/iommu/amd/iommu.c+3−0
@@ -3854,6 +3854,9 @@ static int irq_remapping_select(struct irq_domain *d, struct irq_fwspec *fwspec, · 3853 unmodified lines
38543854 struct amd_iommu *iommu;
38553855 int devid = -1;
38563856
3857+ if (!amd_iommu_irq_remap)
3858+ return 0;
3859+
38573860 if (x86_fwspec_is_ioapic(fwspec))
38583861 devid = get_ioapic_devid(fwspec->param[0]);
38593862 else if (x86_fwspec_is_hpet(fwspec))
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c+4−0
@@ -196,6 +196,8 @@ static int qcom_smmu_cfg_probe(struct arm_smmu_device *smmu) · 195 unmodified lines
196196
197197 set_bit(qsmmu->bypass_cbndx, smmu->context_map);
198198
199+ arm_smmu_cb_write(smmu, qsmmu->bypass_cbndx, ARM_SMMU_CB_SCTLR, 0);
200+
199201 reg = FIELD_PREP(ARM_SMMU_CBAR_TYPE, CBAR_TYPE_S1_TRANS_S2_BYPASS);
200202 arm_smmu_gr1_write(smmu, ARM_SMMU_GR1_CBAR(qsmmu->bypass_cbndx), reg);
201203 }
@@ -323,7 +325,9 @@ static struct arm_smmu_device *qcom_smmu_create(struct arm_smmu_device *smmu, · 121 unmodified lines
323325 }
324326
325327 static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
328+ { .compatible = "qcom,msm8998-smmu-v2" },
326329 { .compatible = "qcom,sc7180-smmu-500" },
330+ { .compatible = "qcom,sdm630-smmu-v2" },
327331 { .compatible = "qcom,sdm845-smmu-500" },
328332 { .compatible = "qcom,sm8150-smmu-500" },
329333 { .compatible = "qcom,sm8250-smmu-500" },
drivers/iommu/dma-iommu.c+0−27
@@ -863,33 +863,6 @@ static int __finalise_sg(struct device *dev, struct scatterlist *sg, int nents, · 862 unmodified lines
863863 unsigned int cur_len = 0, max_len = dma_get_max_seg_size(dev);
864864 int i, count = 0;
865865
866− /*
867− * The Intel graphic driver is used to assume that the returned
868− * sg list is not combound. This blocks the efforts of converting
869− * Intel IOMMU driver to dma-iommu api's. Add this quirk to make the
870− * device driver work and should be removed once it's fixed in i915
871− * driver.
872− */
873− if (IS_ENABLED(CONFIG_DRM_I915) && dev_is_pci(dev) &&
874− to_pci_dev(dev)->vendor == PCI_VENDOR_ID_INTEL &&
875− (to_pci_dev(dev)->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
876− for_each_sg(sg, s, nents, i) {
877− unsigned int s_iova_off = sg_dma_address(s);
878− unsigned int s_length = sg_dma_len(s);
879− unsigned int s_iova_len = s->length;
880−
881− s->offset += s_iova_off;
882− s->length = s_length;
883− sg_dma_address(s) = dma_addr + s_iova_off;
884− sg_dma_len(s) = s_length;
885− dma_addr += s_iova_len;
886−
887− pr_info_once("sg combining disabled due to i915 driver\n");
888− }
889−
890− return nents;
891− }
892−
893866 for_each_sg(sg, s, nents, i) {
894867 /* Restore this segment's original unaligned fields first */
895868 unsigned int s_iova_off = sg_dma_address(s);
drivers/iommu/intel/dmar.c+2−2
@@ -1461,8 +1461,8 @@ void qi_flush_piotlb(struct intel_iommu *iommu, u16 did, u32 pasid, u64 addr, · 1460 unmodified lines
14611461 int mask = ilog2(__roundup_pow_of_two(npages));
14621462 unsigned long align = (1ULL << (VTD_PAGE_SHIFT + mask));
14631463
1464− if (WARN_ON_ONCE(!ALIGN(addr, align)))
1465− addr &= ~(align - 1);
1464+ if (WARN_ON_ONCE(!IS_ALIGNED(addr, align)))
1465+ addr = ALIGN_DOWN(addr, align);
14661466
14671467 desc.qw0 = QI_EIOTLB_PASID(pasid) |
14681468 QI_EIOTLB_DID(did) |
drivers/iommu/intel/iommu.c+108−41
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include <linux/dmi.h>
3939 #include <linux/pci-ats.h>
4040 #include <linux/memblock.h>
41−#include <linux/dma-map-ops.h>
4241 #include <linux/dma-direct.h>
4342 #include <linux/crash_dump.h>
4443 #include <linux/numa.h>
@@ -719,6 +718,8 @@ static int domain_update_device_node(struct dmar_domain *domain) · 674 unmodified lines
719718 return nid;
720719 }
721720
721+static void domain_update_iotlb(struct dmar_domain *domain);
722+
722723 /* Some capabilities may be different across iommus */
723724 static void domain_update_iommu_cap(struct dmar_domain *domain)
724725 {
@@ -744,6 +745,8 @@ static void domain_update_iommu_cap(struct dmar_domain *domain) · 19 unmodified lines
744745 domain->domain.geometry.aperture_end = __DOMAIN_MAX_ADDR(domain->gaw - 1);
745746 else
746747 domain->domain.geometry.aperture_end = __DOMAIN_MAX_ADDR(domain->gaw);
748+
749+ domain_update_iotlb(domain);
747750 }
748751
749752 struct context_entry *iommu_context_addr(struct intel_iommu *iommu, u8 bus,
@@ -1464,17 +1467,22 @@ static void domain_update_iotlb(struct dmar_domain *domain) · 714 unmodified lines
14641467
14651468 assert_spin_locked(&device_domain_lock);
14661469
1467− list_for_each_entry(info, &domain->devices, link) {
1468− struct pci_dev *pdev;
1469−
1470− if (!info->dev || !dev_is_pci(info->dev))
1471− continue;
1472−
1473− pdev = to_pci_dev(info->dev);
1474− if (pdev->ats_enabled) {
1470+ list_for_each_entry(info, &domain->devices, link)
1471+ if (info->ats_enabled) {
14751472 has_iotlb_device = true;
14761473 break;
14771474 }
1475+
1476+ if (!has_iotlb_device) {
1477+ struct subdev_domain_info *sinfo;
1478+
1479+ list_for_each_entry(sinfo, &domain->subdevices, link_domain) {
1480+ info = get_domain_info(sinfo->pdev);
1481+ if (info && info->ats_enabled) {
1482+ has_iotlb_device = true;
1483+ break;
1484+ }
1485+ }
14781486 }
14791487
14801488 domain->has_iotlb_device = has_iotlb_device;
@@ -1555,25 +1563,37 @@ static void iommu_disable_dev_iotlb(struct device_domain_info *info) · 74 unmodified lines
15551563 #endif
15561564 }
15571565
1566+static void __iommu_flush_dev_iotlb(struct device_domain_info *info,
1567+ u64 addr, unsigned int mask)
1568+{
1569+ u16 sid, qdep;
1570+
1571+ if (!info || !info->ats_enabled)
1572+ return;
1573+
1574+ sid = info->bus << 8 | info->devfn;
1575+ qdep = info->ats_qdep;
1576+ qi_flush_dev_iotlb(info->iommu, sid, info->pfsid,
1577+ qdep, addr, mask);
1578+}
1579+
15581580 static void iommu_flush_dev_iotlb(struct dmar_domain *domain,
15591581 u64 addr, unsigned mask)
15601582 {
1561− u16 sid, qdep;
15621583 unsigned long flags;
15631584 struct device_domain_info *info;
1585+ struct subdev_domain_info *sinfo;
15641586
15651587 if (!domain->has_iotlb_device)
15661588 return;
15671589
15681590 spin_lock_irqsave(&device_domain_lock, flags);
1569− list_for_each_entry(info, &domain->devices, link) {
1570− if (!info->ats_enabled)
1571− continue;
1591+ list_for_each_entry(info, &domain->devices, link)
1592+ __iommu_flush_dev_iotlb(info, addr, mask);
15721593
1573− sid = info->bus << 8 | info->devfn;
1574− qdep = info->ats_qdep;
1575− qi_flush_dev_iotlb(info->iommu, sid, info->pfsid,
1576− qdep, addr, mask);
1594+ list_for_each_entry(sinfo, &domain->subdevices, link_domain) {
1595+ info = get_domain_info(sinfo->pdev);
1596+ __iommu_flush_dev_iotlb(info, addr, mask);
15771597 }
15781598 spin_unlock_irqrestore(&device_domain_lock, flags);
15791599 }
@@ -1877,6 +1897,7 @@ static struct dmar_domain *alloc_domain(int flags) · 297 unmodified lines
18771897 domain->flags |= DOMAIN_FLAG_USE_FIRST_LEVEL;
18781898 domain->has_iotlb_device = false;
18791899 INIT_LIST_HEAD(&domain->devices);
1900+ INIT_LIST_HEAD(&domain->subdevices);
18801901
18811902 return domain;
18821903 }
@@ -2547,7 +2568,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu, · 664 unmodified lines
25472568 info->iommu = iommu;
25482569 info->pasid_table = NULL;
25492570 info->auxd_enabled = 0;
2550− INIT_LIST_HEAD(&info->auxiliary_domains);
2571+ INIT_LIST_HEAD(&info->subdevices);
25512572
25522573 if (dev && dev_is_pci(dev)) {
25532574 struct pci_dev *pdev = to_pci_dev(info->dev);
@@ -4475,33 +4496,61 @@ is_aux_domain(struct device *dev, struct iommu_domain *domain) · 1921 unmodified lines
44754496 domain->type == IOMMU_DOMAIN_UNMANAGED;
44764497 }
44774498
4478−static void auxiliary_link_device(struct dmar_domain *domain,
4479− struct device *dev)
4499+static inline struct subdev_domain_info *
4500+lookup_subdev_info(struct dmar_domain *domain, struct device *dev)
4501+{
4502+ struct subdev_domain_info *sinfo;
4503+
4504+ if (!list_empty(&domain->subdevices)) {
4505+ list_for_each_entry(sinfo, &domain->subdevices, link_domain) {
4506+ if (sinfo->pdev == dev)
4507+ return sinfo;
4508+ }
4509+ }
4510+
4511+ return NULL;
4512+}
4513+
4514+static int auxiliary_link_device(struct dmar_domain *domain,
4515+ struct device *dev)
44804516 {
44814517 struct device_domain_info *info = get_domain_info(dev);
4518+ struct subdev_domain_info *sinfo = lookup_subdev_info(domain, dev);
44824519
44834520 assert_spin_locked(&device_domain_lock);
44844521 if (WARN_ON(!info))
4485− return;
4522+ return -EINVAL;
44864523
4487− domain->auxd_refcnt++;
4488− list_add(&domain->auxd, &info->auxiliary_domains);
4524+ if (!sinfo) {
4525+ sinfo = kzalloc(sizeof(*sinfo), GFP_ATOMIC);
4526+ sinfo->domain = domain;
4527+ sinfo->pdev = dev;
4528+ list_add(&sinfo->link_phys, &info->subdevices);
4529+ list_add(&sinfo->link_domain, &domain->subdevices);
4530+ }
4531+
4532+ return ++sinfo->users;
44894533 }
44904534
4491−static void auxiliary_unlink_device(struct dmar_domain *domain,
4492− struct device *dev)
4535+static int auxiliary_unlink_device(struct dmar_domain *domain,
4536+ struct device *dev)
44934537 {
44944538 struct device_domain_info *info = get_domain_info(dev);
4539+ struct subdev_domain_info *sinfo = lookup_subdev_info(domain, dev);
4540+ int ret;
44954541
44964542 assert_spin_locked(&device_domain_lock);
4497− if (WARN_ON(!info))
4498− return;
4543+ if (WARN_ON(!info || !sinfo || sinfo->users <= 0))
4544+ return -EINVAL;
44994545
4500− list_del(&domain->auxd);
4501− domain->auxd_refcnt--;
4546+ ret = --sinfo->users;
4547+ if (!ret) {
4548+ list_del(&sinfo->link_phys);
4549+ list_del(&sinfo->link_domain);
4550+ kfree(sinfo);
4551+ }
45024552
4503− if (!domain->auxd_refcnt && domain->default_pasid > 0)
4504− ioasid_put(domain->default_pasid);
4553+ return ret;
45054554 }
45064555
45074556 static int aux_domain_add_dev(struct dmar_domain *domain,
@@ -4530,6 +4579,19 @@ static int aux_domain_add_dev(struct dmar_domain *domain, · 22 unmodified lines
45304579 }
45314580
45324581 spin_lock_irqsave(&device_domain_lock, flags);
4582+ ret = auxiliary_link_device(domain, dev);
4583+ if (ret <= 0)
4584+ goto link_failed;
4585+
4586+ /*
4587+ * Subdevices from the same physical device can be attached to the
4588+ * same domain. For such cases, only the first subdevice attachment
4589+ * needs to go through the full steps in this function. So if ret >
4590+ * 1, just goto out.
4591+ */
4592+ if (ret > 1)
4593+ goto out;
4594+
45334595 /*
45344596 * iommu->lock must be held to attach domain to iommu and setup the
45354597 * pasid entry for second level translation.
@@ -4548,10 +4610,9 @@ static int aux_domain_add_dev(struct dmar_domain *domain, · 12 unmodified lines
45484610 domain->default_pasid);
45494611 if (ret)
45504612 goto table_failed;
4551− spin_unlock(&iommu->lock);
4552−
4553− auxiliary_link_device(domain, dev);
45544613
4614+ spin_unlock(&iommu->lock);
4615+out:
45554616 spin_unlock_irqrestore(&device_domain_lock, flags);
45564617
45574618 return 0;
@@ -4560,8 +4621,10 @@ table_failed: · 2 unmodified lines
45604621 domain_detach_iommu(domain, iommu);
45614622 attach_failed:
45624623 spin_unlock(&iommu->lock);
4624+ auxiliary_unlink_device(domain, dev);
4625+link_failed:
45634626 spin_unlock_irqrestore(&device_domain_lock, flags);
4564− if (!domain->auxd_refcnt && domain->default_pasid > 0)
4627+ if (list_empty(&domain->subdevices) && domain->default_pasid > 0)
45654628 ioasid_put(domain->default_pasid);
45664629
45674630 return ret;
@@ -4581,14 +4644,18 @@ static void aux_domain_remove_dev(struct dmar_domain *domain, · 13 unmodified lines
45814644 info = get_domain_info(dev);
45824645 iommu = info->iommu;
45834646
4584− auxiliary_unlink_device(domain, dev);
4585−
4586− spin_lock(&iommu->lock);
4587− intel_pasid_tear_down_entry(iommu, dev, domain->default_pasid, false);
4588− domain_detach_iommu(domain, iommu);
4589− spin_unlock(&iommu->lock);
4647+ if (!auxiliary_unlink_device(domain, dev)) {
4648+ spin_lock(&iommu->lock);
4649+ intel_pasid_tear_down_entry(iommu, dev,
4650+ domain->default_pasid, false);
4651+ domain_detach_iommu(domain, iommu);
4652+ spin_unlock(&iommu->lock);
4653+ }
45904654
45914655 spin_unlock_irqrestore(&device_domain_lock, flags);
4656+
4657+ if (list_empty(&domain->subdevices) && domain->default_pasid > 0)
4658+ ioasid_put(domain->default_pasid);
45924659 }
45934660
45944661 static int prepare_domain_attach_device(struct iommu_domain *domain,
drivers/iommu/intel/irq_remapping.c+2−0
@@ -1353,6 +1353,8 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain, · 1352 unmodified lines
13531353 irq_data = irq_domain_get_irq_data(domain, virq + i);
13541354 irq_cfg = irqd_cfg(irq_data);
13551355 if (!irq_data || !irq_cfg) {
1356+ if (!i)
1357+ kfree(data);
13561358 ret = -EINVAL;
13571359 goto out_free_data;
13581360 }
drivers/iommu/intel/svm.c+33−12
@@ -118,8 +118,10 @@ void intel_svm_check(struct intel_iommu *iommu) · 117 unmodified lines
118118 iommu->flags |= VTD_FLAG_SVM_CAPABLE;
119119 }
120120
121−static void intel_flush_svm_range_dev (struct intel_svm *svm, struct intel_svm_dev *sdev,
122− unsigned long address, unsigned long pages, int ih)
121+static void __flush_svm_range_dev(struct intel_svm *svm,
122+ struct intel_svm_dev *sdev,
123+ unsigned long address,
124+ unsigned long pages, int ih)
123125 {
124126 struct qi_desc desc;
125127
@@ -142,7 +144,7 @@ static void intel_flush_svm_range_dev (struct intel_svm *svm, struct intel_svm_d · 16 unmodified lines
142144 }
143145 desc.qw2 = 0;
144146 desc.qw3 = 0;
145− qi_submit_sync(svm->iommu, &desc, 1, 0);
147+ qi_submit_sync(sdev->iommu, &desc, 1, 0);
146148
147149 if (sdev->dev_iotlb) {
148150 desc.qw0 = QI_DEV_EIOTLB_PASID(svm->pasid) |
@@ -166,7 +168,23 @@ static void intel_flush_svm_range_dev (struct intel_svm *svm, struct intel_svm_d · 17 unmodified lines
166168 }
167169 desc.qw2 = 0;
168170 desc.qw3 = 0;
169− qi_submit_sync(svm->iommu, &desc, 1, 0);
171+ qi_submit_sync(sdev->iommu, &desc, 1, 0);
172+ }
173+}
174+
175+static void intel_flush_svm_range_dev(struct intel_svm *svm,
176+ struct intel_svm_dev *sdev,
177+ unsigned long address,
178+ unsigned long pages, int ih)
179+{
180+ unsigned long shift = ilog2(__roundup_pow_of_two(pages));
181+ unsigned long align = (1ULL << (VTD_PAGE_SHIFT + shift));
182+ unsigned long start = ALIGN_DOWN(address, align);
183+ unsigned long end = ALIGN(address + (pages << VTD_PAGE_SHIFT), align);
184+
185+ while (start < end) {
186+ __flush_svm_range_dev(svm, sdev, start, align >> VTD_PAGE_SHIFT, ih);
187+ start += align;
170188 }
171189 }
172190
@@ -211,7 +229,7 @@ static void intel_mm_release(struct mmu_notifier *mn, struct mm_struct *mm) · 38 unmodified lines
211229 */
212230 rcu_read_lock();
213231 list_for_each_entry_rcu(sdev, &svm->devs, list)
214− intel_pasid_tear_down_entry(svm->iommu, sdev->dev,
232+ intel_pasid_tear_down_entry(sdev->iommu, sdev->dev,
215233 svm->pasid, true);
216234 rcu_read_unlock();
217235
@@ -281,6 +299,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, · 63 unmodified lines
281299 struct dmar_domain *dmar_domain;
282300 struct device_domain_info *info;
283301 struct intel_svm *svm = NULL;
302+ unsigned long iflags;
284303 int ret = 0;
285304
286305 if (WARN_ON(!iommu) || !data)
@@ -363,6 +382,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, · 76 unmodified lines
363382 }
364383 sdev->dev = dev;
365384 sdev->sid = PCI_DEVID(info->bus, info->devfn);
385+ sdev->iommu = iommu;
366386
367387 /* Only count users if device has aux domains */
368388 if (iommu_dev_feature_enabled(dev, IOMMU_DEV_FEAT_AUX))
@@ -381,12 +401,12 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, · 12 unmodified lines
381401 * each bind of a new device even with an existing PASID, we need to
382402 * call the nested mode setup function here.
383403 */
384− spin_lock(&iommu->lock);
404+ spin_lock_irqsave(&iommu->lock, iflags);
385405 ret = intel_pasid_setup_nested(iommu, dev,
386406 (pgd_t *)(uintptr_t)data->gpgd,
387407 data->hpasid, &data->vendor.vtd, dmar_domain,
388408 data->addr_width);
389− spin_unlock(&iommu->lock);
409+ spin_unlock_irqrestore(&iommu->lock, iflags);
390410 if (ret) {
391411 dev_err_ratelimited(dev, "Failed to set up PASID %llu in nested mode, Err %d\n",
392412 data->hpasid, ret);
@@ -486,6 +506,7 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags, · 93 unmodified lines
486506 struct device_domain_info *info;
487507 struct intel_svm_dev *sdev;
488508 struct intel_svm *svm = NULL;
509+ unsigned long iflags;
489510 int pasid_max;
490511 int ret;
491512
@@ -546,6 +567,7 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags, · 54 unmodified lines
546567 goto out;
547568 }
548569 sdev->dev = dev;
570+ sdev->iommu = iommu;
549571
550572 ret = intel_iommu_enable_pasid(iommu, dev);
551573 if (ret) {
@@ -575,7 +597,6 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags, · 23 unmodified lines
575597 kfree(sdev);
576598 goto out;
577599 }
578− svm->iommu = iommu;
579600
580601 if (pasid_max > intel_pasid_max_id)
581602 pasid_max = intel_pasid_max_id;
@@ -605,14 +626,14 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags, · 23 unmodified lines
605626 }
606627 }
607628
608− spin_lock(&iommu->lock);
629+ spin_lock_irqsave(&iommu->lock, iflags);
609630 ret = intel_pasid_setup_first_level(iommu, dev,
610631 mm ? mm->pgd : init_mm.pgd,
611632 svm->pasid, FLPT_DEFAULT_DID,
612633 (mm ? 0 : PASID_FLAG_SUPERVISOR_MODE) |
613634 (cpu_feature_enabled(X86_FEATURE_LA57) ?
614635 PASID_FLAG_FL5LP : 0));
615− spin_unlock(&iommu->lock);
636+ spin_unlock_irqrestore(&iommu->lock, iflags);
616637 if (ret) {
617638 if (mm)
618639 mmu_notifier_unregister(&svm->notifier, mm);
@@ -632,14 +653,14 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags, · 13 unmodified lines
632653 * Binding a new device with existing PASID, need to setup
633654 * the PASID entry.
634655 */
635− spin_lock(&iommu->lock);
656+ spin_lock_irqsave(&iommu->lock, iflags);
636657 ret = intel_pasid_setup_first_level(iommu, dev,
637658 mm ? mm->pgd : init_mm.pgd,
638659 svm->pasid, FLPT_DEFAULT_DID,
639660 (mm ? 0 : PASID_FLAG_SUPERVISOR_MODE) |
640661 (cpu_feature_enabled(X86_FEATURE_LA57) ?
641662 PASID_FLAG_FL5LP : 0));
642− spin_unlock(&iommu->lock);
663+ spin_unlock_irqrestore(&iommu->lock, iflags);
643664 if (ret) {
644665 kfree(sdev);
645666 goto out;
drivers/iommu/iova.c+4−4
@@ -358,7 +358,7 @@ static void private_free_iova(struct iova_domain *iovad, struct iova *iova) · 357 unmodified lines
358358 * @iovad: - iova domain in question.
359359 * @pfn: - page frame number
360360 * This function finds and returns an iova belonging to the
361− * given doamin which matches the given pfn.
361+ * given domain which matches the given pfn.
362362 */
363363 struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn)
364364 {
@@ -601,7 +601,7 @@ void queue_iova(struct iova_domain *iovad, · 236 unmodified lines
601601 EXPORT_SYMBOL_GPL(queue_iova);
602602
603603 /**
604− * put_iova_domain - destroys the iova doamin
604+ * put_iova_domain - destroys the iova domain
605605 * @iovad: - iova domain in question.
606606 * All the iova's in that domain are destroyed.
607607 */
@@ -712,9 +712,9 @@ EXPORT_SYMBOL_GPL(reserve_iova); · 104 unmodified lines
712712
713713 /**
714714 * copy_reserved_iova - copies the reserved between domains
715− * @from: - source doamin from where to copy
715+ * @from: - source domain from where to copy
716716 * @to: - destination domin where to copy
717− * This function copies reserved iova's from one doamin to
717+ * This function copies reserved iova's from one domain to
718718 * other.
719719 */
720720 void
drivers/isdn/mISDN/Kconfig+1−0
@@ -13,6 +13,7 @@ if MISDN != n · 12 unmodified lines
1313 config MISDN_DSP
1414 tristate "Digital Audio Processing of transparent data"
1515 depends on MISDN
16+ select BITREVERSE
1617 help
1718 Enable support for digital audio processing capability.
1819
drivers/lightnvm/Kconfig+1−0
@@ -19,6 +19,7 @@ if NVM · 18 unmodified lines
1919
2020 config NVM_PBLK
2121 tristate "Physical Block Device Open-Channel SSD target"
22+ select CRC32
2223 help
2324 Allows an open-channel SSD to be exposed as a block device to the
2425 host. The target assumes the device exposes raw flash and must be
drivers/md/Kconfig+2−0
@@ -605,6 +605,7 @@ config DM_INTEGRITY · 604 unmodified lines
605605 select BLK_DEV_INTEGRITY
606606 select DM_BUFIO
607607 select CRYPTO
608+ select CRYPTO_SKCIPHER
608609 select ASYNC_XOR
609610 help
610611 This device-mapper target emulates a block device that has
@@ -622,6 +623,7 @@ config DM_ZONED · 11 unmodified lines
622623 tristate "Drive-managed zoned block device target support"
623624 depends on BLK_DEV_DM
624625 depends on BLK_DEV_ZONED
626+ select CRC32
625627 help
626628 This device-mapper target takes a host-managed or host-aware zoned
627629 block device and exposes most of its capacity as a regular block
drivers/md/bcache/features.c+1−1
@@ -17,7 +17,7 @@ struct feature { · 16 unmodified lines
1717 };
1818
1919 static struct feature feature_list[] = {
20− {BCH_FEATURE_INCOMPAT, BCH_FEATURE_INCOMPAT_LARGE_BUCKET,
20+ {BCH_FEATURE_INCOMPAT, BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE,
2121 "large_bucket"},
2222 {0, 0, 0 },
2323 };
drivers/md/bcache/features.h+25−5
@@ -13,11 +13,15 @@ · 12 unmodified lines
1313
1414 /* Feature set definition */
1515 /* Incompat feature set */
16−#define BCH_FEATURE_INCOMPAT_LARGE_BUCKET 0x0001 /* 32bit bucket size */
16+/* 32bit bucket size, obsoleted */
17+#define BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET 0x0001
18+/* real bucket size is (1 << bucket_size) */
19+#define BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE 0x0002
1720
18−#define BCH_FEATURE_COMPAT_SUUP 0
19−#define BCH_FEATURE_RO_COMPAT_SUUP 0
20−#define BCH_FEATURE_INCOMPAT_SUUP BCH_FEATURE_INCOMPAT_LARGE_BUCKET
21+#define BCH_FEATURE_COMPAT_SUPP 0
22+#define BCH_FEATURE_RO_COMPAT_SUPP 0
23+#define BCH_FEATURE_INCOMPAT_SUPP (BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET| \
24+ BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE)
2125
2226 #define BCH_HAS_COMPAT_FEATURE(sb, mask) \
2327 ((sb)->feature_compat & (mask))
@@ -77,7 +81,23 @@ static inline void bch_clear_feature_##name(struct cache_sb *sb) \ · 53 unmodified lines
7781 ~BCH##_FEATURE_INCOMPAT_##flagname; \
7882 }
7983
80−BCH_FEATURE_INCOMPAT_FUNCS(large_bucket, LARGE_BUCKET);
84+BCH_FEATURE_INCOMPAT_FUNCS(obso_large_bucket, OBSO_LARGE_BUCKET);
85+BCH_FEATURE_INCOMPAT_FUNCS(large_bucket, LOG_LARGE_BUCKET_SIZE);
86+
87+static inline bool bch_has_unknown_compat_features(struct cache_sb *sb)
88+{
89+ return ((sb->feature_compat & ~BCH_FEATURE_COMPAT_SUPP) != 0);
90+}
91+
92+static inline bool bch_has_unknown_ro_compat_features(struct cache_sb *sb)
93+{
94+ return ((sb->feature_ro_compat & ~BCH_FEATURE_RO_COMPAT_SUPP) != 0);
95+}
96+
97+static inline bool bch_has_unknown_incompat_features(struct cache_sb *sb)
98+{
99+ return ((sb->feature_incompat & ~BCH_FEATURE_INCOMPAT_SUPP) != 0);
100+}
81101
82102 int bch_print_cache_set_feature_compat(struct cache_set *c, char *buf, int size);
83103 int bch_print_cache_set_feature_ro_compat(struct cache_set *c, char *buf, int size);
drivers/md/bcache/super.c+49−4
@@ -64,9 +64,25 @@ static unsigned int get_bucket_size(struct cache_sb *sb, struct cache_sb_disk *s · 63 unmodified lines
6464 {
6565 unsigned int bucket_size = le16_to_cpu(s->bucket_size);
6666
67− if (sb->version >= BCACHE_SB_VERSION_CDEV_WITH_FEATURES &&
68− bch_has_feature_large_bucket(sb))
69− bucket_size |= le16_to_cpu(s->bucket_size_hi) << 16;
67+ if (sb->version >= BCACHE_SB_VERSION_CDEV_WITH_FEATURES) {
68+ if (bch_has_feature_large_bucket(sb)) {
69+ unsigned int max, order;
70+
71+ max = sizeof(unsigned int) * BITS_PER_BYTE - 1;
72+ order = le16_to_cpu(s->bucket_size);
73+ /*
74+ * bcache tool will make sure the overflow won't
75+ * happen, an error message here is enough.
76+ */
77+ if (order > max)
78+ pr_err("Bucket size (1 << %u) overflows\n",
79+ order);
80+ bucket_size = 1 << order;
81+ } else if (bch_has_feature_obso_large_bucket(sb)) {
82+ bucket_size +=
83+ le16_to_cpu(s->obso_bucket_size_hi) << 16;
84+ }
85+ }
7086
7187 return bucket_size;
7288 }
@@ -228,6 +244,20 @@ static const char *read_super(struct cache_sb *sb, struct block_device *bdev, · 155 unmodified lines
228244 sb->feature_compat = le64_to_cpu(s->feature_compat);
229245 sb->feature_incompat = le64_to_cpu(s->feature_incompat);
230246 sb->feature_ro_compat = le64_to_cpu(s->feature_ro_compat);
247+
248+ /* Check incompatible features */
249+ err = "Unsupported compatible feature found";
250+ if (bch_has_unknown_compat_features(sb))
251+ goto err;
252+
253+ err = "Unsupported read-only compatible feature found";
254+ if (bch_has_unknown_ro_compat_features(sb))
255+ goto err;
256+
257+ err = "Unsupported incompatible feature found";
258+ if (bch_has_unknown_incompat_features(sb))
259+ goto err;
260+
231261 err = read_super_common(sb, bdev, s);
232262 if (err)
233263 goto err;
@@ -1302,6 +1332,12 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, · 1068 unmodified lines
13021332 bcache_device_link(&dc->disk, c, "bdev");
13031333 atomic_inc(&c->attached_dev_nr);
13041334
1335+ if (bch_has_feature_obso_large_bucket(&(c->cache->sb))) {
1336+ pr_err("The obsoleted large bucket layout is unsupported, set the bcache device into read-only\n");
1337+ pr_err("Please update to the latest bcache-tools to create the cache device\n");
1338+ set_disk_ro(dc->disk.disk, 1);
1339+ }
1340+
13051341 /* Allow the writeback thread to proceed */
13061342 up_write(&dc->writeback_lock);
13071343
@@ -1524,6 +1560,12 @@ static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) · 216 unmodified lines
15241560
15251561 bcache_device_link(d, c, "volume");
15261562
1563+ if (bch_has_feature_obso_large_bucket(&c->cache->sb)) {
1564+ pr_err("The obsoleted large bucket layout is unsupported, set the bcache device into read-only\n");
1565+ pr_err("Please update to the latest bcache-tools to create the cache device\n");
1566+ set_disk_ro(d->disk, 1);
1567+ }
1568+
15271569 return 0;
15281570 err:
15291571 kobject_put(&d->kobj);
@@ -2083,6 +2125,9 @@ static int run_cache_set(struct cache_set *c) · 553 unmodified lines
20832125 c->cache->sb.last_mount = (u32)ktime_get_real_seconds();
20842126 bcache_write_super(c);
20852127
2128+ if (bch_has_feature_obso_large_bucket(&c->cache->sb))
2129+ pr_err("Detect obsoleted large bucket layout, all attached bcache device will be read-only\n");
2130+
20862131 list_for_each_entry_safe(dc, t, &uncached_devices, list)
20872132 bch_cached_dev_attach(dc, c, NULL);
20882133
@@ -2644,8 +2689,8 @@ static ssize_t bch_pending_bdevs_cleanup(struct kobject *k, · 555 unmodified lines
26442689 }
26452690
26462691 list_for_each_entry_safe(pdev, tpdev, &pending_devs, list) {
2692+ char *pdev_set_uuid = pdev->dc->sb.set_uuid;
26472693 list_for_each_entry_safe(c, tc, &bch_cache_sets, list) {
2648− char *pdev_set_uuid = pdev->dc->sb.set_uuid;
26492694 char *set_uuid = c->set_uuid;
26502695
26512696 if (!memcmp(pdev_set_uuid, set_uuid, 16)) {
drivers/md/dm-bufio.c+6−0
@@ -1534,6 +1534,12 @@ sector_t dm_bufio_get_device_size(struct dm_bufio_client *c) · 1533 unmodified lines
15341534 }
15351535 EXPORT_SYMBOL_GPL(dm_bufio_get_device_size);
15361536
1537+struct dm_io_client *dm_bufio_get_dm_io_client(struct dm_bufio_client *c)
1538+{
1539+ return c->dm_io;
1540+}
1541+EXPORT_SYMBOL_GPL(dm_bufio_get_dm_io_client);
1542+
15371543 sector_t dm_bufio_get_block_number(struct dm_buffer *b)
15381544 {
15391545 return b->block;
drivers/md/dm-crypt.c+155−22
@@ -1454,13 +1454,16 @@ static int crypt_convert_block_skcipher(struct crypt_config *cc, · 1453 unmodified lines
14541454 static void kcryptd_async_done(struct crypto_async_request *async_req,
14551455 int error);
14561456
1457−static void crypt_alloc_req_skcipher(struct crypt_config *cc,
1457+static int crypt_alloc_req_skcipher(struct crypt_config *cc,
14581458 struct convert_context *ctx)
14591459 {
14601460 unsigned key_index = ctx->cc_sector & (cc->tfms_count - 1);
14611461
1462− if (!ctx->r.req)
1463− ctx->r.req = mempool_alloc(&cc->req_pool, GFP_NOIO);
1462+ if (!ctx->r.req) {
1463+ ctx->r.req = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
1464+ if (!ctx->r.req)
1465+ return -ENOMEM;
1466+ }
14641467
14651468 skcipher_request_set_tfm(ctx->r.req, cc->cipher_tfm.tfms[key_index]);
14661469
@@ -1471,13 +1474,18 @@ static void crypt_alloc_req_skcipher(struct crypt_config *cc, · 4 unmodified lines
14711474 skcipher_request_set_callback(ctx->r.req,
14721475 CRYPTO_TFM_REQ_MAY_BACKLOG,
14731476 kcryptd_async_done, dmreq_of_req(cc, ctx->r.req));
1477+
1478+ return 0;
14741479 }
14751480
1476−static void crypt_alloc_req_aead(struct crypt_config *cc,
1481+static int crypt_alloc_req_aead(struct crypt_config *cc,
14771482 struct convert_context *ctx)
14781483 {
1479− if (!ctx->r.req_aead)
1480− ctx->r.req_aead = mempool_alloc(&cc->req_pool, GFP_NOIO);
1484+ if (!ctx->r.req) {
1485+ ctx->r.req = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
1486+ if (!ctx->r.req)
1487+ return -ENOMEM;
1488+ }
14811489
14821490 aead_request_set_tfm(ctx->r.req_aead, cc->cipher_tfm.tfms_aead[0]);
14831491
@@ -1488,15 +1496,17 @@ static void crypt_alloc_req_aead(struct crypt_config *cc, · 4 unmodified lines
14881496 aead_request_set_callback(ctx->r.req_aead,
14891497 CRYPTO_TFM_REQ_MAY_BACKLOG,
14901498 kcryptd_async_done, dmreq_of_req(cc, ctx->r.req_aead));
1499+
1500+ return 0;
14911501 }
14921502
1493−static void crypt_alloc_req(struct crypt_config *cc,
1503+static int crypt_alloc_req(struct crypt_config *cc,
14941504 struct convert_context *ctx)
14951505 {
14961506 if (crypt_integrity_aead(cc))
1497− crypt_alloc_req_aead(cc, ctx);
1507+ return crypt_alloc_req_aead(cc, ctx);
14981508 else
1499− crypt_alloc_req_skcipher(cc, ctx);
1509+ return crypt_alloc_req_skcipher(cc, ctx);
15001510 }
15011511
15021512 static void crypt_free_req_skcipher(struct crypt_config *cc,
@@ -1529,17 +1539,28 @@ static void crypt_free_req(struct crypt_config *cc, void *req, struct bio *base_ · 26 unmodified lines
15291539 * Encrypt / decrypt data from one bio to another one (can be the same one)
15301540 */
15311541 static blk_status_t crypt_convert(struct crypt_config *cc,
1532− struct convert_context *ctx, bool atomic)
1542+ struct convert_context *ctx, bool atomic, bool reset_pending)
15331543 {
15341544 unsigned int tag_offset = 0;
15351545 unsigned int sector_step = cc->sector_size >> SECTOR_SHIFT;
15361546 int r;
15371547
1538− atomic_set(&ctx->cc_pending, 1);
1548+ /*
1549+ * if reset_pending is set we are dealing with the bio for the first time,
1550+ * else we're continuing to work on the previous bio, so don't mess with
1551+ * the cc_pending counter
1552+ */
1553+ if (reset_pending)
1554+ atomic_set(&ctx->cc_pending, 1);
15391555
15401556 while (ctx->iter_in.bi_size && ctx->iter_out.bi_size) {
15411557
1542− crypt_alloc_req(cc, ctx);
1558+ r = crypt_alloc_req(cc, ctx);
1559+ if (r) {
1560+ complete(&ctx->restart);
1561+ return BLK_STS_DEV_RESOURCE;
1562+ }
1563+
15431564 atomic_inc(&ctx->cc_pending);
15441565
15451566 if (crypt_integrity_aead(cc))
@@ -1553,7 +1574,25 @@ static blk_status_t crypt_convert(struct crypt_config *cc, · 7 unmodified lines
15531574 * but the driver request queue is full, let's wait.
15541575 */
15551576 case -EBUSY:
1556− wait_for_completion(&ctx->restart);
1577+ if (in_interrupt()) {
1578+ if (try_wait_for_completion(&ctx->restart)) {
1579+ /*
1580+ * we don't have to block to wait for completion,
1581+ * so proceed
1582+ */
1583+ } else {
1584+ /*
1585+ * we can't wait for completion without blocking
1586+ * exit and continue processing in a workqueue
1587+ */
1588+ ctx->r.req = NULL;
1589+ ctx->cc_sector += sector_step;
1590+ tag_offset++;
1591+ return BLK_STS_DEV_RESOURCE;
1592+ }
1593+ } else {
1594+ wait_for_completion(&ctx->restart);
1595+ }
15571596 reinit_completion(&ctx->restart);
15581597 fallthrough;
15591598 /*
@@ -1691,6 +1730,12 @@ static void crypt_inc_pending(struct dm_crypt_io *io) · 131 unmodified lines
16911730 atomic_inc(&io->io_pending);
16921731 }
16931732
1733+static void kcryptd_io_bio_endio(struct work_struct *work)
1734+{
1735+ struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);
1736+ bio_endio(io->base_bio);
1737+}
1738+
16941739 /*
16951740 * One of the bios was finished. Check for completion of
16961741 * the whole request and correctly clean up the buffer.
@@ -1713,7 +1758,23 @@ static void crypt_dec_pending(struct dm_crypt_io *io) · 16 unmodified lines
17131758 kfree(io->integrity_metadata);
17141759
17151760 base_bio->bi_status = error;
1716− bio_endio(base_bio);
1761+
1762+ /*
1763+ * If we are running this function from our tasklet,
1764+ * we can't call bio_endio() here, because it will call
1765+ * clone_endio() from dm.c, which in turn will
1766+ * free the current struct dm_crypt_io structure with
1767+ * our tasklet. In this case we need to delay bio_endio()
1768+ * execution to after the tasklet is done and dequeued.
1769+ */
1770+ if (tasklet_trylock(&io->tasklet)) {
1771+ tasklet_unlock(&io->tasklet);
1772+ bio_endio(base_bio);
1773+ return;
1774+ }
1775+
1776+ INIT_WORK(&io->work, kcryptd_io_bio_endio);
1777+ queue_work(cc->io_queue, &io->work);
17171778 }
17181779
17191780 /*
@@ -1945,6 +2006,37 @@ static bool kcryptd_crypt_write_inline(struct crypt_config *cc, · 225 unmodified lines
19452006 }
19462007 }
19472008
2009+static void kcryptd_crypt_write_continue(struct work_struct *work)
2010+{
2011+ struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);
2012+ struct crypt_config *cc = io->cc;
2013+ struct convert_context *ctx = &io->ctx;
2014+ int crypt_finished;
2015+ sector_t sector = io->sector;
2016+ blk_status_t r;
2017+
2018+ wait_for_completion(&ctx->restart);
2019+ reinit_completion(&ctx->restart);
2020+
2021+ r = crypt_convert(cc, &io->ctx, true, false);
2022+ if (r)
2023+ io->error = r;
2024+ crypt_finished = atomic_dec_and_test(&ctx->cc_pending);
2025+ if (!crypt_finished && kcryptd_crypt_write_inline(cc, ctx)) {
2026+ /* Wait for completion signaled by kcryptd_async_done() */
2027+ wait_for_completion(&ctx->restart);
2028+ crypt_finished = 1;
2029+ }
2030+
2031+ /* Encryption was already finished, submit io now */
2032+ if (crypt_finished) {
2033+ kcryptd_crypt_write_io_submit(io, 0);
2034+ io->sector = sector;
2035+ }
2036+
2037+ crypt_dec_pending(io);
2038+}
2039+
19482040 static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
19492041 {
19502042 struct crypt_config *cc = io->cc;
@@ -1973,7 +2065,17 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io) · 22 unmodified lines
19732065
19742066 crypt_inc_pending(io);
19752067 r = crypt_convert(cc, ctx,
1976− test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags));
2068+ test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags), true);
2069+ /*
2070+ * Crypto API backlogged the request, because its queue was full
2071+ * and we're in softirq context, so continue from a workqueue
2072+ * (TODO: is it actually possible to be in softirq in the write path?)
2073+ */
2074+ if (r == BLK_STS_DEV_RESOURCE) {
2075+ INIT_WORK(&io->work, kcryptd_crypt_write_continue);
2076+ queue_work(cc->crypt_queue, &io->work);
2077+ return;
2078+ }
19772079 if (r)
19782080 io->error = r;
19792081 crypt_finished = atomic_dec_and_test(&ctx->cc_pending);
@@ -1998,6 +2100,25 @@ static void kcryptd_crypt_read_done(struct dm_crypt_io *io) · 18 unmodified lines
19982100 crypt_dec_pending(io);
19992101 }
20002102
2103+static void kcryptd_crypt_read_continue(struct work_struct *work)
2104+{
2105+ struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);
2106+ struct crypt_config *cc = io->cc;
2107+ blk_status_t r;
2108+
2109+ wait_for_completion(&io->ctx.restart);
2110+ reinit_completion(&io->ctx.restart);
2111+
2112+ r = crypt_convert(cc, &io->ctx, true, false);
2113+ if (r)
2114+ io->error = r;
2115+
2116+ if (atomic_dec_and_test(&io->ctx.cc_pending))
2117+ kcryptd_crypt_read_done(io);
2118+
2119+ crypt_dec_pending(io);
2120+}
2121+
20012122 static void kcryptd_crypt_read_convert(struct dm_crypt_io *io)
20022123 {
20032124 struct crypt_config *cc = io->cc;
@@ -2009,7 +2130,16 @@ static void kcryptd_crypt_read_convert(struct dm_crypt_io *io) · 5 unmodified lines
20092130 io->sector);
20102131
20112132 r = crypt_convert(cc, &io->ctx,
2012− test_bit(DM_CRYPT_NO_READ_WORKQUEUE, &cc->flags));
2133+ test_bit(DM_CRYPT_NO_READ_WORKQUEUE, &cc->flags), true);
2134+ /*
2135+ * Crypto API backlogged the request, because its queue was full
2136+ * and we're in softirq context, so continue from a workqueue
2137+ */
2138+ if (r == BLK_STS_DEV_RESOURCE) {
2139+ INIT_WORK(&io->work, kcryptd_crypt_read_continue);
2140+ queue_work(cc->crypt_queue, &io->work);
2141+ return;
2142+ }
20132143 if (r)
20142144 io->error = r;
20152145
@@ -2091,8 +2221,12 @@ static void kcryptd_queue_crypt(struct dm_crypt_io *io) · 75 unmodified lines
20912221
20922222 if ((bio_data_dir(io->base_bio) == READ && test_bit(DM_CRYPT_NO_READ_WORKQUEUE, &cc->flags)) ||
20932223 (bio_data_dir(io->base_bio) == WRITE && test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags))) {
2094− if (in_irq()) {
2095− /* Crypto API's "skcipher_walk_first() refuses to work in hard IRQ context */
2224+ /*
2225+ * in_irq(): Crypto API's skcipher_walk_first() refuses to work in hard IRQ context.
2226+ * irqs_disabled(): the kernel may run some IO completion from the idle thread, but
2227+ * it is being executed with irqs disabled.
2228+ */
2229+ if (in_irq() || irqs_disabled()) {
20962230 tasklet_init(&io->tasklet, kcryptd_crypt_tasklet, (unsigned long)&io->work);
20972231 tasklet_schedule(&io->tasklet);
20982232 return;
@@ -3166,12 +3300,11 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 1067 unmodified lines
31663300 }
31673301
31683302 if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags))
3169− cc->crypt_queue = alloc_workqueue("kcryptd-%s", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM,
3303+ cc->crypt_queue = alloc_workqueue("kcryptd/%s", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM,
31703304 1, devname);
31713305 else
3172− cc->crypt_queue = alloc_workqueue("kcryptd-%s",
3173− WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM |
3174− WQ_UNBOUND | WQ_SYSFS,
3306+ cc->crypt_queue = alloc_workqueue("kcryptd/%s",
3307+ WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND,
31753308 num_online_cpus(), devname);
31763309 if (!cc->crypt_queue) {
31773310 ti->error = "Couldn't create kcryptd queue";
drivers/md/dm-integrity.c+50−12
@@ -1379,12 +1379,52 @@ thorough_test: · 1378 unmodified lines
13791379 #undef MAY_BE_HASH
13801380 }
13811381
1382−static void dm_integrity_flush_buffers(struct dm_integrity_c *ic)
1382+struct flush_request {
1383+ struct dm_io_request io_req;
1384+ struct dm_io_region io_reg;
1385+ struct dm_integrity_c *ic;
1386+ struct completion comp;
1387+};
1388+
1389+static void flush_notify(unsigned long error, void *fr_)
1390+{
1391+ struct flush_request *fr = fr_;
1392+ if (unlikely(error != 0))
1393+ dm_integrity_io_error(fr->ic, "flusing disk cache", -EIO);
1394+ complete(&fr->comp);
1395+}
1396+
1397+static void dm_integrity_flush_buffers(struct dm_integrity_c *ic, bool flush_data)
13831398 {
13841399 int r;
1400+
1401+ struct flush_request fr;
1402+
1403+ if (!ic->meta_dev)
1404+ flush_data = false;
1405+ if (flush_data) {
1406+ fr.io_req.bi_op = REQ_OP_WRITE,
1407+ fr.io_req.bi_op_flags = REQ_PREFLUSH | REQ_SYNC,
1408+ fr.io_req.mem.type = DM_IO_KMEM,
1409+ fr.io_req.mem.ptr.addr = NULL,
1410+ fr.io_req.notify.fn = flush_notify,
1411+ fr.io_req.notify.context = &fr;
1412+ fr.io_req.client = dm_bufio_get_dm_io_client(ic->bufio),
1413+ fr.io_reg.bdev = ic->dev->bdev,
1414+ fr.io_reg.sector = 0,
1415+ fr.io_reg.count = 0,
1416+ fr.ic = ic;
1417+ init_completion(&fr.comp);
1418+ r = dm_io(&fr.io_req, 1, &fr.io_reg, NULL);
1419+ BUG_ON(r);
1420+ }
1421+
13851422 r = dm_bufio_write_dirty_buffers(ic->bufio);
13861423 if (unlikely(r))
13871424 dm_integrity_io_error(ic, "writing tags", r);
1425+
1426+ if (flush_data)
1427+ wait_for_completion(&fr.comp);
13881428 }
13891429
13901430 static void sleep_on_endio_wait(struct dm_integrity_c *ic)
@@ -2110,7 +2150,7 @@ offload_to_thread: · 719 unmodified lines
21102150
21112151 if (unlikely(dio->op == REQ_OP_DISCARD) && likely(ic->mode != 'D')) {
21122152 integrity_metadata(&dio->work);
2113− dm_integrity_flush_buffers(ic);
2153+ dm_integrity_flush_buffers(ic, false);
21142154
21152155 dio->in_flight = (atomic_t)ATOMIC_INIT(1);
21162156 dio->completion = NULL;
@@ -2195,7 +2235,7 @@ static void integrity_commit(struct work_struct *w) · 78 unmodified lines
21952235 flushes = bio_list_get(&ic->flush_bio_list);
21962236 if (unlikely(ic->mode != 'J')) {
21972237 spin_unlock_irq(&ic->endio_wait.lock);
2198− dm_integrity_flush_buffers(ic);
2238+ dm_integrity_flush_buffers(ic, true);
21992239 goto release_flush_bios;
22002240 }
22012241
@@ -2409,7 +2449,7 @@ skip_io: · 207 unmodified lines
24092449 complete_journal_op(&comp);
24102450 wait_for_completion_io(&comp.comp);
24112451
2412− dm_integrity_flush_buffers(ic);
2452+ dm_integrity_flush_buffers(ic, true);
24132453 }
24142454
24152455 static void integrity_writer(struct work_struct *w)
@@ -2451,7 +2491,7 @@ static void recalc_write_super(struct dm_integrity_c *ic) · 35 unmodified lines
24512491 {
24522492 int r;
24532493
2454− dm_integrity_flush_buffers(ic);
2494+ dm_integrity_flush_buffers(ic, false);
24552495 if (dm_integrity_failed(ic))
24562496 return;
24572497
@@ -2654,7 +2694,7 @@ static void bitmap_flush_work(struct work_struct *work) · 196 unmodified lines
26542694 unsigned long limit;
26552695 struct bio *bio;
26562696
2657− dm_integrity_flush_buffers(ic);
2697+ dm_integrity_flush_buffers(ic, false);
26582698
26592699 range.logical_sector = 0;
26602700 range.n_sectors = ic->provided_data_sectors;
@@ -2663,9 +2703,7 @@ static void bitmap_flush_work(struct work_struct *work) · 2 unmodified lines
26632703 add_new_range_and_wait(ic, &range);
26642704 spin_unlock_irq(&ic->endio_wait.lock);
26652705
2666− dm_integrity_flush_buffers(ic);
2667− if (ic->meta_dev)
2668− blkdev_issue_flush(ic->dev->bdev, GFP_NOIO);
2706+ dm_integrity_flush_buffers(ic, true);
26692707
26702708 limit = ic->provided_data_sectors;
26712709 if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING)) {
@@ -2934,11 +2972,11 @@ static void dm_integrity_postsuspend(struct dm_target *ti) · 262 unmodified lines
29342972 if (ic->meta_dev)
29352973 queue_work(ic->writer_wq, &ic->writer_work);
29362974 drain_workqueue(ic->writer_wq);
2937− dm_integrity_flush_buffers(ic);
2975+ dm_integrity_flush_buffers(ic, true);
29382976 }
29392977
29402978 if (ic->mode == 'B') {
2941− dm_integrity_flush_buffers(ic);
2979+ dm_integrity_flush_buffers(ic, true);
29422980 #if 1
29432981 /* set to 0 to test bitmap replay code */
29442982 init_journal(ic, 0, ic->journal_sections, 0);
@@ -3754,7 +3792,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) · 809 unmodified lines
37543792 unsigned extra_args;
37553793 struct dm_arg_set as;
37563794 static const struct dm_arg _args[] = {
3757− {0, 9, "Invalid number of feature args"},
3795+ {0, 15, "Invalid number of feature args"},
37583796 };
37593797 unsigned journal_sectors, interleave_sectors, buffer_sectors, journal_watermark, sync_msec;
37603798 bool should_write_sb;
drivers/md/dm-raid.c+3−3
@@ -3729,10 +3729,10 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits) · 3728 unmodified lines
37293729 blk_limits_io_opt(limits, chunk_size_bytes * mddev_data_stripes(rs));
37303730
37313731 /*
3732− * RAID1 and RAID10 personalities require bio splitting,
3733− * RAID0/4/5/6 don't and process large discard bios properly.
3732+ * RAID0 and RAID10 personalities require bio splitting,
3733+ * RAID1/4/5/6 don't and process large discard bios properly.
37343734 */
3735− if (rs_is_raid1(rs) || rs_is_raid10(rs)) {
3735+ if (rs_is_raid0(rs) || rs_is_raid10(rs)) {
37363736 limits->discard_granularity = chunk_size_bytes;
37373737 limits->max_discard_sectors = rs->md.chunk_sectors;
37383738 }
drivers/md/dm-snap.c+24−0
@@ -141,6 +141,11 @@ struct dm_snapshot { · 140 unmodified lines
141141 * for them to be committed.
142142 */
143143 struct bio_list bios_queued_during_merge;
144+
145+ /*
146+ * Flush data after merge.
147+ */
148+ struct bio flush_bio;
144149 };
145150
146151 /*
@@ -1121,6 +1126,17 @@ shut: · 974 unmodified lines
11211126
11221127 static void error_bios(struct bio *bio);
11231128
1129+static int flush_data(struct dm_snapshot *s)
1130+{
1131+ struct bio *flush_bio = &s->flush_bio;
1132+
1133+ bio_reset(flush_bio);
1134+ bio_set_dev(flush_bio, s->origin->bdev);
1135+ flush_bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
1136+
1137+ return submit_bio_wait(flush_bio);
1138+}
1139+
11241140 static void merge_callback(int read_err, unsigned long write_err, void *context)
11251141 {
11261142 struct dm_snapshot *s = context;
@@ -1134,6 +1150,11 @@ static void merge_callback(int read_err, unsigned long write_err, void *context) · 7 unmodified lines
11341150 goto shut;
11351151 }
11361152
1153+ if (flush_data(s) < 0) {
1154+ DMERR("Flush after merge failed: shutting down merge");
1155+ goto shut;
1156+ }
1157+
11371158 if (s->store->type->commit_merge(s->store,
11381159 s->num_merging_chunks) < 0) {
11391160 DMERR("Write error in exception store: shutting down merge");
@@ -1318,6 +1339,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 178 unmodified lines
13181339 s->first_merging_chunk = 0;
13191340 s->num_merging_chunks = 0;
13201341 bio_list_init(&s->bios_queued_during_merge);
1342+ bio_init(&s->flush_bio, NULL, 0);
13211343
13221344 /* Allocate hash table for COW data */
13231345 if (init_hash_tables(s)) {
@@ -1504,6 +1526,8 @@ static void snapshot_dtr(struct dm_target *ti) · 180 unmodified lines
15041526
15051527 dm_exception_store_destroy(s->store);
15061528
1529+ bio_uninit(&s->flush_bio);
1530+
15071531 dm_put_device(ti, s->cow);
15081532
15091533 dm_put_device(ti, s->origin);
drivers/md/dm.c+1−1
@@ -562,7 +562,7 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode, · 561 unmodified lines
562562 * subset of the parent bdev; require extra privileges.
563563 */
564564 if (!capable(CAP_SYS_RAWIO)) {
565− DMWARN_LIMIT(
565+ DMDEBUG_LIMIT(
566566 "%s: sending ioctl %x to DM device without required privilege.",
567567 current->comm, cmd);
568568 r = -ENOIOCTLCMD;
drivers/misc/habanalabs/common/command_submission.c+58−19
@@ -472,8 +472,11 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, · 471 unmodified lines
472472 cntr = &hdev->aggregated_cs_counters;
473473
474474 cs = kzalloc(sizeof(*cs), GFP_ATOMIC);
475− if (!cs)
475+ if (!cs) {
476+ atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
477+ atomic64_inc(&cntr->out_of_mem_drop_cnt);
476478 return -ENOMEM;
479+ }
477480
478481 cs->ctx = ctx;
479482 cs->submitted = false;
@@ -486,6 +489,8 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, · 6 unmodified lines
486489
487490 cs_cmpl = kmalloc(sizeof(*cs_cmpl), GFP_ATOMIC);
488491 if (!cs_cmpl) {
492+ atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
493+ atomic64_inc(&cntr->out_of_mem_drop_cnt);
489494 rc = -ENOMEM;
490495 goto free_cs;
491496 }
@@ -513,6 +518,8 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, · 21 unmodified lines
513518 cs->jobs_in_queue_cnt = kcalloc(hdev->asic_prop.max_queues,
514519 sizeof(*cs->jobs_in_queue_cnt), GFP_ATOMIC);
515520 if (!cs->jobs_in_queue_cnt) {
521+ atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
522+ atomic64_inc(&cntr->out_of_mem_drop_cnt);
516523 rc = -ENOMEM;
517524 goto free_fence;
518525 }
@@ -562,7 +569,7 @@ void hl_cs_rollback_all(struct hl_device *hdev) · 43 unmodified lines
562569 for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++)
563570 flush_workqueue(hdev->cq_wq[i]);
564571
565− /* Make sure we don't have leftovers in the H/W queues mirror list */
572+ /* Make sure we don't have leftovers in the CS mirror list */
566573 list_for_each_entry_safe(cs, tmp, &hdev->cs_mirror_list, mirror_node) {
567574 cs_get(cs);
568575 cs->aborted = true;
@@ -764,11 +771,14 @@ static int hl_cs_sanity_checks(struct hl_fpriv *hpriv, union hl_cs_args *args) · 195 unmodified lines
764771
765772 static int hl_cs_copy_chunk_array(struct hl_device *hdev,
766773 struct hl_cs_chunk **cs_chunk_array,
767− void __user *chunks, u32 num_chunks)
774+ void __user *chunks, u32 num_chunks,
775+ struct hl_ctx *ctx)
768776 {
769777 u32 size_to_copy;
770778
771779 if (num_chunks > HL_MAX_JOBS_PER_CS) {
780+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
781+ atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
772782 dev_err(hdev->dev,
773783 "Number of chunks can NOT be larger than %d\n",
774784 HL_MAX_JOBS_PER_CS);
@@ -777,11 +787,16 @@ static int hl_cs_copy_chunk_array(struct hl_device *hdev, · 2 unmodified lines
777787
778788 *cs_chunk_array = kmalloc_array(num_chunks, sizeof(**cs_chunk_array),
779789 GFP_ATOMIC);
780− if (!*cs_chunk_array)
790+ if (!*cs_chunk_array) {
791+ atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
792+ atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt);
781793 return -ENOMEM;
794+ }
782795
783796 size_to_copy = num_chunks * sizeof(struct hl_cs_chunk);
784797 if (copy_from_user(*cs_chunk_array, chunks, size_to_copy)) {
798+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
799+ atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
785800 dev_err(hdev->dev, "Failed to copy cs chunk array from user\n");
786801 kfree(*cs_chunk_array);
787802 return -EFAULT;
@@ -797,6 +812,7 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 9 unmodified lines
797812 struct hl_device *hdev = hpriv->hdev;
798813 struct hl_cs_chunk *cs_chunk_array;
799814 struct hl_cs_counters_atomic *cntr;
815+ struct hl_ctx *ctx = hpriv->ctx;
800816 struct hl_cs_job *job;
801817 struct hl_cs *cs;
802818 struct hl_cb *cb;
@@ -805,7 +821,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 2 unmodified lines
805821 cntr = &hdev->aggregated_cs_counters;
806822 *cs_seq = ULLONG_MAX;
807823
808− rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks);
824+ rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks,
825+ hpriv->ctx);
809826 if (rc)
810827 goto out;
811828
@@ -832,8 +849,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 20 unmodified lines
832849 rc = validate_queue_index(hdev, chunk, &queue_type,
833850 &is_kernel_allocated_cb);
834851 if (rc) {
835− atomic64_inc(&hpriv->ctx->cs_counters.parsing_drop_cnt);
836− atomic64_inc(&cntr->parsing_drop_cnt);
852+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
853+ atomic64_inc(&cntr->validation_drop_cnt);
837854 goto free_cs_object;
838855 }
839856
@@ -841,8 +858,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 1 unmodified line
841858 cb = get_cb_from_cs_chunk(hdev, &hpriv->cb_mgr, chunk);
842859 if (!cb) {
843860 atomic64_inc(
844− &hpriv->ctx->cs_counters.parsing_drop_cnt);
845− atomic64_inc(&cntr->parsing_drop_cnt);
861+ &ctx->cs_counters.validation_drop_cnt);
862+ atomic64_inc(&cntr->validation_drop_cnt);
846863 rc = -EINVAL;
847864 goto free_cs_object;
848865 }
@@ -856,8 +873,7 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 7 unmodified lines
856873 job = hl_cs_allocate_job(hdev, queue_type,
857874 is_kernel_allocated_cb);
858875 if (!job) {
859− atomic64_inc(
860− &hpriv->ctx->cs_counters.out_of_mem_drop_cnt);
876+ atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
861877 atomic64_inc(&cntr->out_of_mem_drop_cnt);
862878 dev_err(hdev->dev, "Failed to allocate a new job\n");
863879 rc = -ENOMEM;
@@ -891,7 +907,7 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 27 unmodified lines
891907
892908 rc = cs_parser(hpriv, job);
893909 if (rc) {
894− atomic64_inc(&hpriv->ctx->cs_counters.parsing_drop_cnt);
910+ atomic64_inc(&ctx->cs_counters.parsing_drop_cnt);
895911 atomic64_inc(&cntr->parsing_drop_cnt);
896912 dev_err(hdev->dev,
897913 "Failed to parse JOB %d.%llu.%d, err %d, rejecting the CS\n",
@@ -901,8 +917,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks, · 3 unmodified lines
901917 }
902918
903919 if (int_queues_only) {
904− atomic64_inc(&hpriv->ctx->cs_counters.parsing_drop_cnt);
905− atomic64_inc(&cntr->parsing_drop_cnt);
920+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
921+ atomic64_inc(&cntr->validation_drop_cnt);
906922 dev_err(hdev->dev,
907923 "Reject CS %d.%llu because only internal queues jobs are present\n",
908924 cs->ctx->asid, cs->sequence);
@@ -1042,7 +1058,7 @@ out: · 133 unmodified lines
10421058 }
10431059
10441060 static int cs_ioctl_extract_signal_seq(struct hl_device *hdev,
1045− struct hl_cs_chunk *chunk, u64 *signal_seq)
1061+ struct hl_cs_chunk *chunk, u64 *signal_seq, struct hl_ctx *ctx)
10461062 {
10471063 u64 *signal_seq_arr = NULL;
10481064 u32 size_to_copy, signal_seq_arr_len;
@@ -1052,6 +1068,8 @@ static int cs_ioctl_extract_signal_seq(struct hl_device *hdev, · 3 unmodified lines
10521068
10531069 /* currently only one signal seq is supported */
10541070 if (signal_seq_arr_len != 1) {
1071+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1072+ atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
10551073 dev_err(hdev->dev,
10561074 "Wait for signal CS supports only one signal CS seq\n");
10571075 return -EINVAL;
@@ -1060,13 +1078,18 @@ static int cs_ioctl_extract_signal_seq(struct hl_device *hdev, · 2 unmodified lines
10601078 signal_seq_arr = kmalloc_array(signal_seq_arr_len,
10611079 sizeof(*signal_seq_arr),
10621080 GFP_ATOMIC);
1063− if (!signal_seq_arr)
1081+ if (!signal_seq_arr) {
1082+ atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
1083+ atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt);
10641084 return -ENOMEM;
1085+ }
10651086
10661087 size_to_copy = chunk->num_signal_seq_arr * sizeof(*signal_seq_arr);
10671088 if (copy_from_user(signal_seq_arr,
10681089 u64_to_user_ptr(chunk->signal_seq_arr),
10691090 size_to_copy)) {
1091+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1092+ atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
10701093 dev_err(hdev->dev,
10711094 "Failed to copy signal seq array from user\n");
10721095 rc = -EFAULT;
@@ -1153,6 +1176,7 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 80 unmodified lines
11531176 struct hl_device *hdev = hpriv->hdev;
11541177 struct hl_cs_compl *sig_waitcs_cmpl;
11551178 u32 q_idx, collective_engine_id = 0;
1179+ struct hl_cs_counters_atomic *cntr;
11561180 struct hl_fence *sig_fence = NULL;
11571181 struct hl_ctx *ctx = hpriv->ctx;
11581182 enum hl_queue_type q_type;
@@ -1160,9 +1184,11 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 1 unmodified line
11601184 u64 signal_seq;
11611185 int rc;
11621186
1187+ cntr = &hdev->aggregated_cs_counters;
11631188 *cs_seq = ULLONG_MAX;
11641189
1165− rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks);
1190+ rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks,
1191+ ctx);
11661192 if (rc)
11671193 goto out;
11681194
@@ -1170,6 +1196,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 1 unmodified line
11701196 chunk = &cs_chunk_array[0];
11711197
11721198 if (chunk->queue_index >= hdev->asic_prop.max_queues) {
1199+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1200+ atomic64_inc(&cntr->validation_drop_cnt);
11731201 dev_err(hdev->dev, "Queue index %d is invalid\n",
11741202 chunk->queue_index);
11751203 rc = -EINVAL;
@@ -1181,6 +1209,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 5 unmodified lines
11811209 q_type = hw_queue_prop->type;
11821210
11831211 if (!hw_queue_prop->supports_sync_stream) {
1212+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1213+ atomic64_inc(&cntr->validation_drop_cnt);
11841214 dev_err(hdev->dev,
11851215 "Queue index %d does not support sync stream operations\n",
11861216 q_idx);
@@ -1190,6 +1220,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 3 unmodified lines
11901220
11911221 if (cs_type == CS_TYPE_COLLECTIVE_WAIT) {
11921222 if (!(hw_queue_prop->collective_mode == HL_COLLECTIVE_MASTER)) {
1223+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1224+ atomic64_inc(&cntr->validation_drop_cnt);
11931225 dev_err(hdev->dev,
11941226 "Queue index %d is invalid\n", q_idx);
11951227 rc = -EINVAL;
@@ -1200,12 +1232,14 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 4 unmodified lines
12001232 }
12011233
12021234 if (cs_type == CS_TYPE_WAIT || cs_type == CS_TYPE_COLLECTIVE_WAIT) {
1203− rc = cs_ioctl_extract_signal_seq(hdev, chunk, &signal_seq);
1235+ rc = cs_ioctl_extract_signal_seq(hdev, chunk, &signal_seq, ctx);
12041236 if (rc)
12051237 goto free_cs_chunk_array;
12061238
12071239 sig_fence = hl_ctx_get_fence(ctx, signal_seq);
12081240 if (IS_ERR(sig_fence)) {
1241+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1242+ atomic64_inc(&cntr->validation_drop_cnt);
12091243 dev_err(hdev->dev,
12101244 "Failed to get signal CS with seq 0x%llx\n",
12111245 signal_seq);
@@ -1223,6 +1257,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 11 unmodified lines
12231257 container_of(sig_fence, struct hl_cs_compl, base_fence);
12241258
12251259 if (sig_waitcs_cmpl->type != CS_TYPE_SIGNAL) {
1260+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1261+ atomic64_inc(&cntr->validation_drop_cnt);
12261262 dev_err(hdev->dev,
12271263 "CS seq 0x%llx is not of a signal CS\n",
12281264 signal_seq);
@@ -1270,8 +1306,11 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, · 41 unmodified lines
12701306 else if (cs_type == CS_TYPE_COLLECTIVE_WAIT)
12711307 rc = hdev->asic_funcs->collective_wait_create_jobs(hdev, ctx,
12721308 cs, q_idx, collective_engine_id);
1273− else
1309+ else {
1310+ atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1311+ atomic64_inc(&cntr->validation_drop_cnt);
12741312 rc = -EINVAL;
1313+ }
12751314
12761315 if (rc)
12771316 goto free_cs_object;
drivers/misc/habanalabs/common/device.c+5−3
@@ -17,12 +17,12 @@ enum hl_device_status hl_device_status(struct hl_device *hdev) · 16 unmodified lines
1717 {
1818 enum hl_device_status status;
1919
20− if (hdev->disabled)
21− status = HL_DEVICE_STATUS_MALFUNCTION;
22− else if (atomic_read(&hdev->in_reset))
20+ if (atomic_read(&hdev->in_reset))
2321 status = HL_DEVICE_STATUS_IN_RESET;
2422 else if (hdev->needs_reset)
2523 status = HL_DEVICE_STATUS_NEEDS_RESET;
24+ else if (hdev->disabled)
25+ status = HL_DEVICE_STATUS_MALFUNCTION;
2626 else
2727 status = HL_DEVICE_STATUS_OPERATIONAL;
2828
@@ -1092,6 +1092,7 @@ kill_processes: · 1063 unmodified lines
10921092 GFP_KERNEL);
10931093 if (!hdev->kernel_ctx) {
10941094 rc = -ENOMEM;
1095+ hl_mmu_fini(hdev);
10951096 goto out_err;
10961097 }
10971098
@@ -1103,6 +1104,7 @@ kill_processes: · 5 unmodified lines
11031104 "failed to init kernel ctx in hard reset\n");
11041105 kfree(hdev->kernel_ctx);
11051106 hdev->kernel_ctx = NULL;
1107+ hl_mmu_fini(hdev);
11061108 goto out_err;
11071109 }
11081110 }
drivers/misc/habanalabs/common/firmware_if.c+44−16
@@ -627,25 +627,38 @@ int hl_fw_read_preboot_status(struct hl_device *hdev, u32 cpu_boot_status_reg, · 626 unmodified lines
627627 security_status = RREG32(cpu_security_boot_status_reg);
628628
629629 /* We read security status multiple times during boot:
630− * 1. preboot - we check if fw security feature is supported
631− * 2. boot cpu - we get boot cpu security status
632− * 3. FW application - we get FW application security status
630+ * 1. preboot - a. Check whether the security status bits are valid
631+ * b. Check whether fw security is enabled
632+ * c. Check whether hard reset is done by preboot
633+ * 2. boot cpu - a. Fetch boot cpu security status
634+ * b. Check whether hard reset is done by boot cpu
635+ * 3. FW application - a. Fetch fw application security status
636+ * b. Check whether hard reset is done by fw app
633637 *
634638 * Preboot:
635639 * Check security status bit (CPU_BOOT_DEV_STS0_ENABLED), if it is set
636640 * check security enabled bit (CPU_BOOT_DEV_STS0_SECURITY_EN)
637641 */
638642 if (security_status & CPU_BOOT_DEV_STS0_ENABLED) {
639− hdev->asic_prop.fw_security_status_valid = 1;
640− prop->fw_security_disabled =
641− !(security_status & CPU_BOOT_DEV_STS0_SECURITY_EN);
643+ prop->fw_security_status_valid = 1;
644+
645+ if (security_status & CPU_BOOT_DEV_STS0_SECURITY_EN)
646+ prop->fw_security_disabled = false;
647+ else
648+ prop->fw_security_disabled = true;
649+
650+ if (security_status & CPU_BOOT_DEV_STS0_FW_HARD_RST_EN)
651+ prop->hard_reset_done_by_fw = true;
642652 } else {
643− hdev->asic_prop.fw_security_status_valid = 0;
653+ prop->fw_security_status_valid = 0;
644654 prop->fw_security_disabled = true;
645655 }
646656
657+ dev_dbg(hdev->dev, "Firmware preboot hard-reset is %s\n",
658+ prop->hard_reset_done_by_fw ? "enabled" : "disabled");
659+
647660 dev_info(hdev->dev, "firmware-level security is %s\n",
648− prop->fw_security_disabled ? "disabled" : "enabled");
661+ prop->fw_security_disabled ? "disabled" : "enabled");
649662
650663 return 0;
651664 }
@@ -655,6 +668,7 @@ int hl_fw_init_cpu(struct hl_device *hdev, u32 cpu_boot_status_reg, · 3 unmodified lines
655668 u32 cpu_security_boot_status_reg, u32 boot_err0_reg,
656669 bool skip_bmc, u32 cpu_timeout, u32 boot_fit_timeout)
657670 {
671+ struct asic_fixed_properties *prop = &hdev->asic_prop;
658672 u32 status;
659673 int rc;
660674
@@ -723,11 +737,22 @@ int hl_fw_init_cpu(struct hl_device *hdev, u32 cpu_boot_status_reg, · 62 unmodified lines
723737 /* Read U-Boot version now in case we will later fail */
724738 hdev->asic_funcs->read_device_fw_version(hdev, FW_COMP_UBOOT);
725739
740+ /* Clear reset status since we need to read it again from boot CPU */
741+ prop->hard_reset_done_by_fw = false;
742+
726743 /* Read boot_cpu security bits */
727− if (hdev->asic_prop.fw_security_status_valid)
728− hdev->asic_prop.fw_boot_cpu_security_map =
744+ if (prop->fw_security_status_valid) {
745+ prop->fw_boot_cpu_security_map =
729746 RREG32(cpu_security_boot_status_reg);
730747
748+ if (prop->fw_boot_cpu_security_map &
749+ CPU_BOOT_DEV_STS0_FW_HARD_RST_EN)
750+ prop->hard_reset_done_by_fw = true;
751+ }
752+
753+ dev_dbg(hdev->dev, "Firmware boot CPU hard-reset is %s\n",
754+ prop->hard_reset_done_by_fw ? "enabled" : "disabled");
755+
731756 if (rc) {
732757 detect_cpu_boot_status(hdev, status);
733758 rc = -EIO;
@@ -796,18 +821,21 @@ int hl_fw_init_cpu(struct hl_device *hdev, u32 cpu_boot_status_reg, · 62 unmodified lines
796821 goto out;
797822 }
798823
824+ /* Clear reset status since we need to read again from app */
825+ prop->hard_reset_done_by_fw = false;
826+
799827 /* Read FW application security bits */
800− if (hdev->asic_prop.fw_security_status_valid) {
801− hdev->asic_prop.fw_app_security_map =
828+ if (prop->fw_security_status_valid) {
829+ prop->fw_app_security_map =
802830 RREG32(cpu_security_boot_status_reg);
803831
804− if (hdev->asic_prop.fw_app_security_map &
832+ if (prop->fw_app_security_map &
805833 CPU_BOOT_DEV_STS0_FW_HARD_RST_EN)
806− hdev->asic_prop.hard_reset_done_by_fw = true;
834+ prop->hard_reset_done_by_fw = true;
807835 }
808836
809− dev_dbg(hdev->dev, "Firmware hard-reset is %s\n",
810− hdev->asic_prop.hard_reset_done_by_fw ? "enabled" : "disabled");
837+ dev_dbg(hdev->dev, "Firmware application CPU hard-reset is %s\n",
838+ prop->hard_reset_done_by_fw ? "enabled" : "disabled");
811839
812840 dev_info(hdev->dev, "Successfully loaded firmware to device\n");
813841
drivers/misc/habanalabs/common/habanalabs.h+3−1
@@ -944,7 +944,7 @@ struct hl_asic_funcs { · 943 unmodified lines
944944 u32 (*get_signal_cb_size)(struct hl_device *hdev);
945945 u32 (*get_wait_cb_size)(struct hl_device *hdev);
946946 u32 (*gen_signal_cb)(struct hl_device *hdev, void *data, u16 sob_id,
947− u32 size);
947+ u32 size, bool eb);
948948 u32 (*gen_wait_cb)(struct hl_device *hdev,
949949 struct hl_gen_wait_properties *prop);
950950 void (*reset_sob)(struct hl_device *hdev, void *data);
@@ -1000,6 +1000,7 @@ struct hl_va_range { · 49 unmodified lines
10001000 * @queue_full_drop_cnt: dropped due to queue full
10011001 * @device_in_reset_drop_cnt: dropped due to device in reset
10021002 * @max_cs_in_flight_drop_cnt: dropped due to maximum CS in-flight
1003+ * @validation_drop_cnt: dropped due to error in validation
10031004 */
10041005 struct hl_cs_counters_atomic {
10051006 atomic64_t out_of_mem_drop_cnt;
@@ -1007,6 +1008,7 @@ struct hl_cs_counters_atomic { · 1 unmodified line
10071008 atomic64_t queue_full_drop_cnt;
10081009 atomic64_t device_in_reset_drop_cnt;
10091010 atomic64_t max_cs_in_flight_drop_cnt;
1011+ atomic64_t validation_drop_cnt;
10101012 };
10111013
10121014 /**
drivers/misc/habanalabs/common/habanalabs_drv.c+1−0
@@ -544,6 +544,7 @@ static struct pci_driver hl_pci_driver = { · 543 unmodified lines
544544 .id_table = ids,
545545 .probe = hl_pci_probe,
546546 .remove = hl_pci_remove,
547+ .shutdown = hl_pci_remove,
547548 .driver.pm = &hl_pm_ops,
548549 .err_handler = &hl_pci_err_handler,
549550 };
drivers/misc/habanalabs/common/habanalabs_ioctl.c+6−1
@@ -335,6 +335,8 @@ static int cs_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args) · 334 unmodified lines
335335 atomic64_read(&cntr->device_in_reset_drop_cnt);
336336 cs_counters.total_max_cs_in_flight_drop_cnt =
337337 atomic64_read(&cntr->max_cs_in_flight_drop_cnt);
338+ cs_counters.total_validation_drop_cnt =
339+ atomic64_read(&cntr->validation_drop_cnt);
338340
339341 if (hpriv->ctx) {
340342 cs_counters.ctx_out_of_mem_drop_cnt =
@@ -352,6 +354,9 @@ static int cs_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args) · 11 unmodified lines
352354 cs_counters.ctx_max_cs_in_flight_drop_cnt =
353355 atomic64_read(
354356 &hpriv->ctx->cs_counters.max_cs_in_flight_drop_cnt);
357+ cs_counters.ctx_validation_drop_cnt =
358+ atomic64_read(
359+ &hpriv->ctx->cs_counters.validation_drop_cnt);
355360 }
356361
357362 return copy_to_user(out, &cs_counters,
@@ -406,7 +411,7 @@ static int total_energy_consumption_info(struct hl_fpriv *hpriv, · 48 unmodified lines
406411 static int pll_frequency_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
407412 {
408413 struct hl_device *hdev = hpriv->hdev;
409− struct hl_pll_frequency_info freq_info = {0};
414+ struct hl_pll_frequency_info freq_info = { {0} };
410415 u32 max_size = args->return_size;
411416 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
412417 int rc;
drivers/misc/habanalabs/common/hw_queue.c+4−1
@@ -418,8 +418,11 @@ static void init_signal_cs(struct hl_device *hdev, · 417 unmodified lines
418418 "generate signal CB, sob_id: %d, sob val: 0x%x, q_idx: %d\n",
419419 cs_cmpl->hw_sob->sob_id, cs_cmpl->sob_val, q_idx);
420420
421+ /* we set an EB since we must make sure all oeprations are done
422+ * when sending the signal
423+ */
421424 hdev->asic_funcs->gen_signal_cb(hdev, job->patched_cb,
422− cs_cmpl->hw_sob->sob_id, 0);
425+ cs_cmpl->hw_sob->sob_id, 0, true);
423426
424427 kref_get(&hw_sob->kref);
425428
drivers/misc/habanalabs/common/pci.c+17−11
@@ -130,10 +130,8 @@ static int hl_pci_elbi_write(struct hl_device *hdev, u64 addr, u32 data) · 129 unmodified lines
130130 if ((val & PCI_CONFIG_ELBI_STS_MASK) == PCI_CONFIG_ELBI_STS_DONE)
131131 return 0;
132132
133− if (val & PCI_CONFIG_ELBI_STS_ERR) {
134− dev_err(hdev->dev, "Error writing to ELBI\n");
133+ if (val & PCI_CONFIG_ELBI_STS_ERR)
135134 return -EIO;
136− }
137135
138136 if (!(val & PCI_CONFIG_ELBI_STS_MASK)) {
139137 dev_err(hdev->dev, "ELBI write didn't finish in time\n");
@@ -160,8 +158,12 @@ int hl_pci_iatu_write(struct hl_device *hdev, u32 addr, u32 data) · 20 unmodified lines
160158
161159 dbi_offset = addr & 0xFFF;
162160
163− rc = hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0x00300000);
164− rc |= hl_pci_elbi_write(hdev, prop->pcie_dbi_base_address + dbi_offset,
161+ /* Ignore result of writing to pcie_aux_dbi_reg_addr as it could fail
162+ * in case the firmware security is enabled
163+ */
164+ hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0x00300000);
165+
166+ rc = hl_pci_elbi_write(hdev, prop->pcie_dbi_base_address + dbi_offset,
165167 data);
166168
167169 if (rc)
@@ -244,9 +246,11 @@ int hl_pci_set_inbound_region(struct hl_device *hdev, u8 region, · 76 unmodified lines
244246
245247 rc |= hl_pci_iatu_write(hdev, offset + 0x4, ctrl_reg_val);
246248
247− /* Return the DBI window to the default location */
248− rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0);
249− rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr + 4, 0);
249+ /* Return the DBI window to the default location
250+ * Ignore result of writing to pcie_aux_dbi_reg_addr as it could fail
251+ * in case the firmware security is enabled
252+ */
253+ hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0);
250254
251255 if (rc)
252256 dev_err(hdev->dev, "failed to map bar %u to 0x%08llx\n",
@@ -294,9 +298,11 @@ int hl_pci_set_outbound_region(struct hl_device *hdev, · 41 unmodified lines
294298 /* Enable */
295299 rc |= hl_pci_iatu_write(hdev, 0x004, 0x80000000);
296300
297− /* Return the DBI window to the default location */
298− rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0);
299− rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr + 4, 0);
301+ /* Return the DBI window to the default location
302+ * Ignore result of writing to pcie_aux_dbi_reg_addr as it could fail
303+ * in case the firmware security is enabled
304+ */
305+ hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0);
300306
301307 return rc;
302308 }
drivers/misc/habanalabs/gaudi/gaudi.c+83−108
@@ -151,19 +151,6 @@ static const u16 gaudi_packet_sizes[MAX_PACKET_ID] = { · 150 unmodified lines
151151 [PACKET_LOAD_AND_EXE] = sizeof(struct packet_load_and_exe)
152152 };
153153
154−static const u32 gaudi_pll_base_addresses[GAUDI_PLL_MAX] = {
155− [CPU_PLL] = mmPSOC_CPU_PLL_NR,
156− [PCI_PLL] = mmPSOC_PCI_PLL_NR,
157− [SRAM_PLL] = mmSRAM_W_PLL_NR,
158− [HBM_PLL] = mmPSOC_HBM_PLL_NR,
159− [NIC_PLL] = mmNIC0_PLL_NR,
160− [DMA_PLL] = mmDMA_W_PLL_NR,
161− [MESH_PLL] = mmMESH_W_PLL_NR,
162− [MME_PLL] = mmPSOC_MME_PLL_NR,
163− [TPC_PLL] = mmPSOC_TPC_PLL_NR,
164− [IF_PLL] = mmIF_W_PLL_NR
165−};
166−
167154 static inline bool validate_packet_id(enum packet_id id)
168155 {
169156 switch (id) {
@@ -374,7 +361,7 @@ static int gaudi_cpucp_info_get(struct hl_device *hdev); · 204 unmodified lines
374361 static void gaudi_disable_clock_gating(struct hl_device *hdev);
375362 static void gaudi_mmu_prepare(struct hl_device *hdev, u32 asid);
376363 static u32 gaudi_gen_signal_cb(struct hl_device *hdev, void *data, u16 sob_id,
377− u32 size);
364+ u32 size, bool eb);
378365 static u32 gaudi_gen_wait_cb(struct hl_device *hdev,
379366 struct hl_gen_wait_properties *prop);
380367
@@ -667,12 +654,6 @@ static int gaudi_early_init(struct hl_device *hdev) · 286 unmodified lines
667654 if (rc)
668655 goto free_queue_props;
669656
670− if (gaudi_get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) {
671− dev_info(hdev->dev,
672− "H/W state is dirty, must reset before initializing\n");
673− hdev->asic_funcs->hw_fini(hdev, true);
674− }
675−
676657 /* Before continuing in the initialization, we need to read the preboot
677658 * version to determine whether we run with a security-enabled firmware
678659 */
@@ -685,6 +666,12 @@ static int gaudi_early_init(struct hl_device *hdev) · 6 unmodified lines
685666 goto pci_fini;
686667 }
687668
669+ if (gaudi_get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) {
670+ dev_info(hdev->dev,
671+ "H/W state is dirty, must reset before initializing\n");
672+ hdev->asic_funcs->hw_fini(hdev, true);
673+ }
674+
688675 return 0;
689676
690677 pci_fini:
@@ -703,93 +690,60 @@ static int gaudi_early_fini(struct hl_device *hdev) · 12 unmodified lines
703690 }
704691
705692 /**
706− * gaudi_fetch_pll_frequency - Fetch PLL frequency values
693+ * gaudi_fetch_psoc_frequency - Fetch PSOC frequency values
707694 *
708695 * @hdev: pointer to hl_device structure
709− * @pll_index: index of the pll to fetch frequency from
710− * @pll_freq: pointer to store the pll frequency in MHz in each of the available
711− * outputs. if a certain output is not available a 0 will be set
712696 *
713697 */
714−static int gaudi_fetch_pll_frequency(struct hl_device *hdev,
715− enum gaudi_pll_index pll_index,
716− u16 *pll_freq_arr)
698+static int gaudi_fetch_psoc_frequency(struct hl_device *hdev)
717699 {
718− u32 nr = 0, nf = 0, od = 0, pll_clk = 0, div_fctr, div_sel,
719− pll_base_addr = gaudi_pll_base_addresses[pll_index];
720− u16 freq = 0;
721− int i, rc;
722−
723− if (hdev->asic_prop.fw_security_status_valid &&
724− (hdev->asic_prop.fw_app_security_map &
725− CPU_BOOT_DEV_STS0_PLL_INFO_EN)) {
726− rc = hl_fw_cpucp_pll_info_get(hdev, pll_index, pll_freq_arr);
700+ struct asic_fixed_properties *prop = &hdev->asic_prop;
701+ u32 nr = 0, nf = 0, od = 0, div_fctr = 0, pll_clk, div_sel;
702+ u16 pll_freq_arr[HL_PLL_NUM_OUTPUTS], freq;
703+ int rc;
727704
728− if (rc)
729− return rc;
730− } else if (hdev->asic_prop.fw_security_disabled) {
705+ if (hdev->asic_prop.fw_security_disabled) {
731706 /* Backward compatibility */
732− nr = RREG32(pll_base_addr + PLL_NR_OFFSET);
733− nf = RREG32(pll_base_addr + PLL_NF_OFFSET);
734− od = RREG32(pll_base_addr + PLL_OD_OFFSET);
735−
736− for (i = 0; i < HL_PLL_NUM_OUTPUTS; i++) {
737− div_fctr = RREG32(pll_base_addr +
738− PLL_DIV_FACTOR_0_OFFSET + i * 4);
739− div_sel = RREG32(pll_base_addr +
740− PLL_DIV_SEL_0_OFFSET + i * 4);
707+ div_fctr = RREG32(mmPSOC_CPU_PLL_DIV_FACTOR_2);
708+ div_sel = RREG32(mmPSOC_CPU_PLL_DIV_SEL_2);
709+ nr = RREG32(mmPSOC_CPU_PLL_NR);
710+ nf = RREG32(mmPSOC_CPU_PLL_NF);
711+ od = RREG32(mmPSOC_CPU_PLL_OD);
741712
742− if (div_sel == DIV_SEL_REF_CLK ||
713+ if (div_sel == DIV_SEL_REF_CLK ||
743714 div_sel == DIV_SEL_DIVIDED_REF) {
744− if (div_sel == DIV_SEL_REF_CLK)
745− freq = PLL_REF_CLK;
746− else
747− freq = PLL_REF_CLK / (div_fctr + 1);
748− } else if (div_sel == DIV_SEL_PLL_CLK ||
749− div_sel == DIV_SEL_DIVIDED_PLL) {
750− pll_clk = PLL_REF_CLK * (nf + 1) /
751− ((nr + 1) * (od + 1));
752− if (div_sel == DIV_SEL_PLL_CLK)
753− freq = pll_clk;
754− else
755− freq = pll_clk / (div_fctr + 1);
756− } else {
757− dev_warn(hdev->dev,
758− "Received invalid div select value: %d",
759− div_sel);
760− }
761−
762− pll_freq_arr[i] = freq;
715+ if (div_sel == DIV_SEL_REF_CLK)
716+ freq = PLL_REF_CLK;
717+ else
718+ freq = PLL_REF_CLK / (div_fctr + 1);
719+ } else if (div_sel == DIV_SEL_PLL_CLK ||
720+ div_sel == DIV_SEL_DIVIDED_PLL) {
721+ pll_clk = PLL_REF_CLK * (nf + 1) /
722+ ((nr + 1) * (od + 1));
723+ if (div_sel == DIV_SEL_PLL_CLK)
724+ freq = pll_clk;
725+ else
726+ freq = pll_clk / (div_fctr + 1);
727+ } else {
728+ dev_warn(hdev->dev,
729+ "Received invalid div select value: %d",
730+ div_sel);
731+ freq = 0;
763732 }
764733 } else {
765− dev_err(hdev->dev, "Failed to fetch PLL frequency values\n");
766− return -EIO;
767− }
734+ rc = hl_fw_cpucp_pll_info_get(hdev, CPU_PLL, pll_freq_arr);
768735
769− return 0;
770−}
771−
772−/**
773− * gaudi_fetch_psoc_frequency - Fetch PSOC frequency values
774− *
775− * @hdev: pointer to hl_device structure
776− *
777− */
778−static int gaudi_fetch_psoc_frequency(struct hl_device *hdev)
779−{
780− struct asic_fixed_properties *prop = &hdev->asic_prop;
781− u16 pll_freq[HL_PLL_NUM_OUTPUTS];
782− int rc;
736+ if (rc)
737+ return rc;
783738
784− rc = gaudi_fetch_pll_frequency(hdev, CPU_PLL, pll_freq);
785− if (rc)
786− return rc;
739+ freq = pll_freq_arr[2];
740+ }
787741
788− prop->psoc_timestamp_frequency = pll_freq[2];
789− prop->psoc_pci_pll_nr = 0;
790− prop->psoc_pci_pll_nf = 0;
791− prop->psoc_pci_pll_od = 0;
792− prop->psoc_pci_pll_div_factor = 0;
742+ prop->psoc_timestamp_frequency = freq;
743+ prop->psoc_pci_pll_nr = nr;
744+ prop->psoc_pci_pll_nf = nf;
745+ prop->psoc_pci_pll_od = od;
746+ prop->psoc_pci_pll_div_factor = div_fctr;
793747
794748 return 0;
795749 }
@@ -884,11 +838,17 @@ static int gaudi_init_tpc_mem(struct hl_device *hdev) · 88 unmodified lines
884838 size_t fw_size;
885839 void *cpu_addr;
886840 dma_addr_t dma_handle;
887− int rc;
841+ int rc, count = 5;
888842
843+again:
889844 rc = request_firmware(&fw, GAUDI_TPC_FW_FILE, hdev->dev);
845+ if (rc == -EINTR && count-- > 0) {
846+ msleep(50);
847+ goto again;
848+ }
849+
890850 if (rc) {
891− dev_err(hdev->dev, "Firmware file %s is not found!\n",
851+ dev_err(hdev->dev, "Failed to load firmware file %s\n",
892852 GAUDI_TPC_FW_FILE);
893853 goto out;
894854 }
@@ -1110,7 +1070,7 @@ static void gaudi_collective_slave_init_job(struct hl_device *hdev, · 215 unmodified lines
11101070 prop->collective_sob_id, queue_id);
11111071
11121072 cb_size += gaudi_gen_signal_cb(hdev, job->user_cb,
1113− prop->collective_sob_id, cb_size);
1073+ prop->collective_sob_id, cb_size, false);
11141074 }
11151075
11161076 static void gaudi_collective_wait_init_cs(struct hl_cs *cs)
@@ -2449,8 +2409,6 @@ static void gaudi_init_golden_registers(struct hl_device *hdev) · 1332 unmodified lines
24492409 gaudi_init_e2e(hdev);
24502410 gaudi_init_hbm_cred(hdev);
24512411
2452− hdev->asic_funcs->disable_clock_gating(hdev);
2453−
24542412 for (tpc_id = 0, tpc_offset = 0;
24552413 tpc_id < TPC_NUMBER_OF_ENGINES;
24562414 tpc_id++, tpc_offset += TPC_CFG_OFFSET) {
@@ -3462,6 +3420,9 @@ static void gaudi_set_clock_gating(struct hl_device *hdev) · 1005 unmodified lines
34623420 if (hdev->in_debug)
34633421 return;
34643422
3423+ if (!hdev->asic_prop.fw_security_disabled)
3424+ return;
3425+
34653426 for (i = GAUDI_PCI_DMA_1, qman_offset = 0 ; i < GAUDI_HBM_DMA_1 ; i++) {
34663427 enable = !!(hdev->clock_gating_mask &
34673428 (BIT_ULL(gaudi_dma_assignment[i])));
@@ -3513,7 +3474,7 @@ static void gaudi_disable_clock_gating(struct hl_device *hdev) · 45 unmodified lines
35133474 u32 qman_offset;
35143475 int i;
35153476
3516− if (!(gaudi->hw_cap_initialized & HW_CAP_CLK_GATE))
3477+ if (!hdev->asic_prop.fw_security_disabled)
35173478 return;
35183479
35193480 for (i = 0, qman_offset = 0 ; i < DMA_NUMBER_OF_CHANNELS ; i++) {
@@ -3806,7 +3767,7 @@ static int gaudi_init_cpu_queues(struct hl_device *hdev, u32 cpu_timeout) · 286 unmodified lines
38063767 static void gaudi_pre_hw_init(struct hl_device *hdev)
38073768 {
38083769 /* Perform read from the device to make sure device is up */
3809− RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
3770+ RREG32(mmHW_STATE);
38103771
38113772 if (hdev->asic_prop.fw_security_disabled) {
38123773 /* Set the access through PCI bars (Linux driver only) as
@@ -3847,6 +3808,13 @@ static int gaudi_hw_init(struct hl_device *hdev) · 34 unmodified lines
38473808 return rc;
38483809 }
38493810
3811+ /* In case the clock gating was enabled in preboot we need to disable
3812+ * it here before touching the MME/TPC registers.
3813+ * There is no need to take clk gating mutex because when this function
3814+ * runs, no other relevant code can run
3815+ */
3816+ hdev->asic_funcs->disable_clock_gating(hdev);
3817+
38503818 /* SRAM scrambler must be initialized after CPU is running from HBM */
38513819 gaudi_init_scrambler_sram(hdev);
38523820
@@ -3885,7 +3853,7 @@ static int gaudi_hw_init(struct hl_device *hdev) · 32 unmodified lines
38853853 }
38863854
38873855 /* Perform read from the device to flush all configuration */
3888− RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
3856+ RREG32(mmHW_STATE);
38893857
38903858 return 0;
38913859
@@ -3927,7 +3895,10 @@ static void gaudi_hw_fini(struct hl_device *hdev, bool hard_reset) · 35 unmodified lines
39273895 /* I don't know what is the state of the CPU so make sure it is
39283896 * stopped in any means necessary
39293897 */
3930− WREG32(mmPSOC_GLOBAL_CONF_KMD_MSG_TO_CPU, KMD_MSG_GOTO_WFE);
3898+ if (hdev->asic_prop.hard_reset_done_by_fw)
3899+ WREG32(mmPSOC_GLOBAL_CONF_KMD_MSG_TO_CPU, KMD_MSG_RST_DEV);
3900+ else
3901+ WREG32(mmPSOC_GLOBAL_CONF_KMD_MSG_TO_CPU, KMD_MSG_GOTO_WFE);
39313902
39323903 WREG32(mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR, GAUDI_EVENT_HALT_MACHINE);
39333904
@@ -3971,11 +3942,15 @@ static void gaudi_hw_fini(struct hl_device *hdev, bool hard_reset) · 37 unmodified lines
39713942
39723943 WREG32(mmPSOC_GLOBAL_CONF_SW_ALL_RST,
39733944 1 << PSOC_GLOBAL_CONF_SW_ALL_RST_IND_SHIFT);
3974− }
39753945
3976− dev_info(hdev->dev,
3977− "Issued HARD reset command, going to wait %dms\n",
3978− reset_timeout_ms);
3946+ dev_info(hdev->dev,
3947+ "Issued HARD reset command, going to wait %dms\n",
3948+ reset_timeout_ms);
3949+ } else {
3950+ dev_info(hdev->dev,
3951+ "Firmware performs HARD reset, going to wait %dms\n",
3952+ reset_timeout_ms);
3953+ }
39793954
39803955 /*
39813956 * After hard reset, we can't poll the BTM_FSM register because the PSOC
@@ -7936,7 +7911,7 @@ static u32 gaudi_get_wait_cb_size(struct hl_device *hdev) · 3954 unmodified lines
79367911 }
79377912
79387913 static u32 gaudi_gen_signal_cb(struct hl_device *hdev, void *data, u16 sob_id,
7939− u32 size)
7914+ u32 size, bool eb)
79407915 {
79417916 struct hl_cb *cb = (struct hl_cb *) data;
79427917 struct packet_msg_short *pkt;
@@ -7953,7 +7928,7 @@ static u32 gaudi_gen_signal_cb(struct hl_device *hdev, void *data, u16 sob_id, · 10 unmodified lines
79537928 ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_OP_MASK, 0); /* write the value */
79547929 ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_BASE_MASK, 3); /* W_S SOB base */
79557930 ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_OPCODE_MASK, PACKET_MSG_SHORT);
7956− ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_EB_MASK, 1);
7931+ ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_EB_MASK, eb);
79577932 ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_RB_MASK, 1);
79587933 ctl |= FIELD_PREP(GAUDI_PKT_SHORT_CTL_MB_MASK, 1);
79597934
drivers/misc/habanalabs/gaudi/gaudiP.h+0−7
@@ -105,13 +105,6 @@ · 104 unmodified lines
105105 #define MME_ACC_OFFSET (mmMME1_ACC_BASE - mmMME0_ACC_BASE)
106106 #define SRAM_BANK_OFFSET (mmSRAM_Y0_X1_RTR_BASE - mmSRAM_Y0_X0_RTR_BASE)
107107
108−#define PLL_NR_OFFSET 0
109−#define PLL_NF_OFFSET (mmPSOC_CPU_PLL_NF - mmPSOC_CPU_PLL_NR)
110−#define PLL_OD_OFFSET (mmPSOC_CPU_PLL_OD - mmPSOC_CPU_PLL_NR)
111−#define PLL_DIV_FACTOR_0_OFFSET (mmPSOC_CPU_PLL_DIV_FACTOR_0 - \
112− mmPSOC_CPU_PLL_NR)
113−#define PLL_DIV_SEL_0_OFFSET (mmPSOC_CPU_PLL_DIV_SEL_0 - mmPSOC_CPU_PLL_NR)
114−
115108 #define NUM_OF_SOB_IN_BLOCK \
116109 (((mmSYNC_MNGR_E_N_SYNC_MNGR_OBJS_SOB_OBJ_2047 - \
117110 mmSYNC_MNGR_E_N_SYNC_MNGR_OBJS_SOB_OBJ_0) + 4) >> 2)
drivers/misc/habanalabs/gaudi/gaudi_coresight.c+2−1
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include "../include/gaudi/gaudi_coresight.h"
1010 #include "../include/gaudi/asic_reg/gaudi_regs.h"
1111 #include "../include/gaudi/gaudi_masks.h"
12+#include "../include/gaudi/gaudi_reg_map.h"
1213
1314 #include <uapi/misc/habanalabs.h>
1415 #define SPMU_SECTION_SIZE MME0_ACC_SPMU_MAX_OFFSET
@@ -874,7 +875,7 @@ int gaudi_debug_coresight(struct hl_device *hdev, void *data) · 859 unmodified lines
874875 }
875876
876877 /* Perform read from the device to flush all configuration */
877− RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
878+ RREG32(mmHW_STATE);
878879
879880 return rc;
880881 }
drivers/misc/habanalabs/goya/goya.c+45−30
@@ -613,12 +613,6 @@ static int goya_early_init(struct hl_device *hdev) · 612 unmodified lines
613613 if (rc)
614614 goto free_queue_props;
615615
616− if (goya_get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) {
617− dev_info(hdev->dev,
618− "H/W state is dirty, must reset before initializing\n");
619− hdev->asic_funcs->hw_fini(hdev, true);
620− }
621−
622616 /* Before continuing in the initialization, we need to read the preboot
623617 * version to determine whether we run with a security-enabled firmware
624618 */
@@ -631,6 +625,12 @@ static int goya_early_init(struct hl_device *hdev) · 6 unmodified lines
631625 goto pci_fini;
632626 }
633627
628+ if (goya_get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) {
629+ dev_info(hdev->dev,
630+ "H/W state is dirty, must reset before initializing\n");
631+ hdev->asic_funcs->hw_fini(hdev, true);
632+ }
633+
634634 if (!hdev->pldm) {
635635 val = RREG32(mmPSOC_GLOBAL_CONF_BOOT_STRAP_PINS);
636636 if (val & PSOC_GLOBAL_CONF_BOOT_STRAP_PINS_SRIOV_EN_MASK)
@@ -694,32 +694,47 @@ static void goya_qman0_set_security(struct hl_device *hdev, bool secure) · 57 unmodified lines
694694 static void goya_fetch_psoc_frequency(struct hl_device *hdev)
695695 {
696696 struct asic_fixed_properties *prop = &hdev->asic_prop;
697− u32 trace_freq = 0;
698− u32 pll_clk = 0;
699− u32 div_fctr = RREG32(mmPSOC_PCI_PLL_DIV_FACTOR_1);
700− u32 div_sel = RREG32(mmPSOC_PCI_PLL_DIV_SEL_1);
701− u32 nr = RREG32(mmPSOC_PCI_PLL_NR);
702− u32 nf = RREG32(mmPSOC_PCI_PLL_NF);
703− u32 od = RREG32(mmPSOC_PCI_PLL_OD);
704−
705− if (div_sel == DIV_SEL_REF_CLK || div_sel == DIV_SEL_DIVIDED_REF) {
706− if (div_sel == DIV_SEL_REF_CLK)
707− trace_freq = PLL_REF_CLK;
708− else
709− trace_freq = PLL_REF_CLK / (div_fctr + 1);
710− } else if (div_sel == DIV_SEL_PLL_CLK ||
711− div_sel == DIV_SEL_DIVIDED_PLL) {
712− pll_clk = PLL_REF_CLK * (nf + 1) / ((nr + 1) * (od + 1));
713− if (div_sel == DIV_SEL_PLL_CLK)
714− trace_freq = pll_clk;
715− else
716− trace_freq = pll_clk / (div_fctr + 1);
697+ u32 nr = 0, nf = 0, od = 0, div_fctr = 0, pll_clk, div_sel;
698+ u16 pll_freq_arr[HL_PLL_NUM_OUTPUTS], freq;
699+ int rc;
700+
701+ if (hdev->asic_prop.fw_security_disabled) {
702+ div_fctr = RREG32(mmPSOC_PCI_PLL_DIV_FACTOR_1);
703+ div_sel = RREG32(mmPSOC_PCI_PLL_DIV_SEL_1);
704+ nr = RREG32(mmPSOC_PCI_PLL_NR);
705+ nf = RREG32(mmPSOC_PCI_PLL_NF);
706+ od = RREG32(mmPSOC_PCI_PLL_OD);
707+
708+ if (div_sel == DIV_SEL_REF_CLK ||
709+ div_sel == DIV_SEL_DIVIDED_REF) {
710+ if (div_sel == DIV_SEL_REF_CLK)
711+ freq = PLL_REF_CLK;
712+ else
713+ freq = PLL_REF_CLK / (div_fctr + 1);
714+ } else if (div_sel == DIV_SEL_PLL_CLK ||
715+ div_sel == DIV_SEL_DIVIDED_PLL) {
716+ pll_clk = PLL_REF_CLK * (nf + 1) /
717+ ((nr + 1) * (od + 1));
718+ if (div_sel == DIV_SEL_PLL_CLK)
719+ freq = pll_clk;
720+ else
721+ freq = pll_clk / (div_fctr + 1);
722+ } else {
723+ dev_warn(hdev->dev,
724+ "Received invalid div select value: %d",
725+ div_sel);
726+ freq = 0;
727+ }
717728 } else {
718− dev_warn(hdev->dev,
719− "Received invalid div select value: %d", div_sel);
729+ rc = hl_fw_cpucp_pll_info_get(hdev, PCI_PLL, pll_freq_arr);
730+
731+ if (rc)
732+ return;
733+
734+ freq = pll_freq_arr[1];
720735 }
721736
722− prop->psoc_timestamp_frequency = trace_freq;
737+ prop->psoc_timestamp_frequency = freq;
723738 prop->psoc_pci_pll_nr = nr;
724739 prop->psoc_pci_pll_nf = nf;
725740 prop->psoc_pci_pll_od = od;
@@ -5324,7 +5339,7 @@ static u32 goya_get_wait_cb_size(struct hl_device *hdev) · 4598 unmodified lines
53245339 }
53255340
53265341 static u32 goya_gen_signal_cb(struct hl_device *hdev, void *data, u16 sob_id,
5327− u32 size)
5342+ u32 size, bool eb)
53285343 {
53295344 return 0;
53305345 }
drivers/misc/habanalabs/include/common/hl_boot_if.h+8−1
@@ -145,11 +145,15 @@ · 144 unmodified lines
145145 * implemented. This means that FW will
146146 * perform hard reset procedure on
147147 * receiving the halt-machine event.
148− * Initialized in: linux
148+ * Initialized in: preboot, u-boot, linux
149149 *
150150 * CPU_BOOT_DEV_STS0_PLL_INFO_EN FW retrieval of PLL info is enabled.
151151 * Initialized in: linux
152152 *
153+ * CPU_BOOT_DEV_STS0_CLK_GATE_EN Clock Gating enabled.
154+ * FW initialized Clock Gating.
155+ * Initialized in: preboot
156+ *
153157 * CPU_BOOT_DEV_STS0_ENABLED Device status register enabled.
154158 * This is a main indication that the
155159 * running FW populates the device status
@@ -171,6 +175,7 @@ · 15 unmodified lines
171175 #define CPU_BOOT_DEV_STS0_DRAM_SCR_EN (1 << 9)
172176 #define CPU_BOOT_DEV_STS0_FW_HARD_RST_EN (1 << 10)
173177 #define CPU_BOOT_DEV_STS0_PLL_INFO_EN (1 << 11)
178+#define CPU_BOOT_DEV_STS0_CLK_GATE_EN (1 << 13)
174179 #define CPU_BOOT_DEV_STS0_ENABLED (1 << 31)
175180
176181 enum cpu_boot_status {
@@ -204,6 +209,8 @@ enum kmd_msg { · 27 unmodified lines
204209 KMD_MSG_GOTO_WFE,
205210 KMD_MSG_FIT_RDY,
206211 KMD_MSG_SKIP_BMC,
212+ RESERVED,
213+ KMD_MSG_RST_DEV,
207214 };
208215
209216 enum cpu_msg_status {
drivers/misc/pvpanic.c+15−4
@@ -55,12 +55,23 @@ static int pvpanic_mmio_probe(struct platform_device *pdev) · 54 unmodified lines
5555 struct resource *res;
5656
5757 res = platform_get_mem_or_io(pdev, 0);
58− if (res && resource_type(res) == IORESOURCE_IO)
58+ if (!res)
59+ return -EINVAL;
60+
61+ switch (resource_type(res)) {
62+ case IORESOURCE_IO:
5963 base = devm_ioport_map(dev, res->start, resource_size(res));
60− else
64+ if (!base)
65+ return -ENOMEM;
66+ break;
67+ case IORESOURCE_MEM:
6168 base = devm_ioremap_resource(dev, res);
62− if (IS_ERR(base))
63− return PTR_ERR(base);
69+ if (IS_ERR(base))
70+ return PTR_ERR(base);
71+ break;
72+ default:
73+ return -EINVAL;
74+ }
6475
6576 atomic_notifier_chain_register(&panic_notifier_list,
6677 &pvpanic_panic_nb);
drivers/net/bareudp.c+16−9
@@ -380,7 +380,7 @@ static int bareudp6_xmit_skb(struct sk_buff *skb, struct net_device *dev, · 379 unmodified lines
380380 goto free_dst;
381381
382382 min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len +
383− BAREUDP_BASE_HLEN + info->options_len + sizeof(struct iphdr);
383+ BAREUDP_BASE_HLEN + info->options_len + sizeof(struct ipv6hdr);
384384
385385 err = skb_cow_head(skb, min_headroom);
386386 if (unlikely(err))
@@ -534,6 +534,7 @@ static void bareudp_setup(struct net_device *dev) · 147 unmodified lines
534534 SET_NETDEV_DEVTYPE(dev, &bareudp_type);
535535 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
536536 dev->features |= NETIF_F_RXCSUM;
537+ dev->features |= NETIF_F_LLTX;
537538 dev->features |= NETIF_F_GSO_SOFTWARE;
538539 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
539540 dev->hw_features |= NETIF_F_GSO_SOFTWARE;
@@ -644,11 +645,20 @@ static int bareudp_link_config(struct net_device *dev, · 104 unmodified lines
644645 return 0;
645646 }
646647
648+static void bareudp_dellink(struct net_device *dev, struct list_head *head)
649+{
650+ struct bareudp_dev *bareudp = netdev_priv(dev);
651+
652+ list_del(&bareudp->next);
653+ unregister_netdevice_queue(dev, head);
654+}
655+
647656 static int bareudp_newlink(struct net *net, struct net_device *dev,
648657 struct nlattr *tb[], struct nlattr *data[],
649658 struct netlink_ext_ack *extack)
650659 {
651660 struct bareudp_conf conf;
661+ LIST_HEAD(list_kill);
652662 int err;
653663
654664 err = bareudp2info(data, &conf, extack);
@@ -661,17 +671,14 @@ static int bareudp_newlink(struct net *net, struct net_device *dev, · 6 unmodified lines
661671
662672 err = bareudp_link_config(dev, tb);
663673 if (err)
664− return err;
674+ goto err_unconfig;
665675
666676 return 0;
667−}
668−
669−static void bareudp_dellink(struct net_device *dev, struct list_head *head)
670−{
671− struct bareudp_dev *bareudp = netdev_priv(dev);
672677
673− list_del(&bareudp->next);
674− unregister_netdevice_queue(dev, head);
678+err_unconfig:
679+ bareudp_dellink(dev, &list_kill);
680+ unregister_netdevice_many(&list_kill);
681+ return err;
675682 }
676683
677684 static size_t bareudp_get_size(const struct net_device *dev)
drivers/net/can/Kconfig+1−0
@@ -123,6 +123,7 @@ config CAN_JANZ_ICAN3 · 122 unmodified lines
123123 config CAN_KVASER_PCIEFD
124124 depends on PCI
125125 tristate "Kvaser PCIe FD cards"
126+ select CRC32
126127 help
127128 This is a driver for the Kvaser PCI Express CAN FD family.
128129
drivers/net/can/m_can/m_can.c+0−2
@@ -1852,8 +1852,6 @@ EXPORT_SYMBOL_GPL(m_can_class_register); · 1851 unmodified lines
18521852 void m_can_class_unregister(struct m_can_classdev *cdev)
18531853 {
18541854 unregister_candev(cdev->net);
1855−
1856− m_can_clk_stop(cdev);
18571855 }
18581856 EXPORT_SYMBOL_GPL(m_can_class_unregister);
18591857
drivers/net/can/m_can/tcan4x5x.c+0−26
@@ -131,30 +131,6 @@ static inline struct tcan4x5x_priv *cdev_to_priv(struct m_can_classdev *cdev) · 130 unmodified lines
131131
132132 }
133133
134−static struct can_bittiming_const tcan4x5x_bittiming_const = {
135− .name = DEVICE_NAME,
136− .tseg1_min = 2,
137− .tseg1_max = 31,
138− .tseg2_min = 2,
139− .tseg2_max = 16,
140− .sjw_max = 16,
141− .brp_min = 1,
142− .brp_max = 32,
143− .brp_inc = 1,
144−};
145−
146−static struct can_bittiming_const tcan4x5x_data_bittiming_const = {
147− .name = DEVICE_NAME,
148− .tseg1_min = 1,
149− .tseg1_max = 32,
150− .tseg2_min = 1,
151− .tseg2_max = 16,
152− .sjw_max = 16,
153− .brp_min = 1,
154− .brp_max = 32,
155− .brp_inc = 1,
156−};
157−
158134 static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv)
159135 {
160136 int wake_state = 0;
@@ -469,8 +445,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi) · 308 unmodified lines
469445 mcan_class->dev = &spi->dev;
470446 mcan_class->ops = &tcan4x5x_ops;
471447 mcan_class->is_peripheral = true;
472− mcan_class->bit_timing = &tcan4x5x_bittiming_const;
473− mcan_class->data_timing = &tcan4x5x_data_bittiming_const;
474448 mcan_class->net->irq = spi->irq;
475449
476450 spi_set_drvdata(spi, priv);
drivers/net/can/rcar/Kconfig+2−2
@@ -1,10 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0
22 config CAN_RCAR
3− tristate "Renesas R-Car CAN controller"
3+ tristate "Renesas R-Car and RZ/G CAN controller"
44 depends on ARCH_RENESAS || ARM
55 help
66 Say Y here if you want to use CAN controller found on Renesas R-Car
7− SoCs.
7+ or RZ/G SoCs.
88
99 To compile this driver as a module, choose M here: the module will
1010 be called rcar_can.
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c+9−10
@@ -1368,13 +1368,10 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) · 1367 unmodified lines
13681368 struct mcp251xfd_tx_ring *tx_ring = priv->tx;
13691369 struct spi_transfer *last_xfer;
13701370
1371− tx_ring->tail += len;
1372−
13731371 /* Increment the TEF FIFO tail pointer 'len' times in
13741372 * a single SPI message.
1375− */
1376−
1377− /* Note:
1373+ *
1374+ * Note:
13781375 *
13791376 * "cs_change == 1" on the last transfer results in an
13801377 * active chip select after the complete SPI
@@ -1391,6 +1388,8 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) · 10 unmodified lines
13911388 if (err)
13921389 return err;
13931390
1391+ tx_ring->tail += len;
1392+
13941393 err = mcp251xfd_check_tef_tail(priv);
13951394 if (err)
13961395 return err;
@@ -1492,7 +1491,7 @@ mcp251xfd_handle_rxif_one(struct mcp251xfd_priv *priv, · 95 unmodified lines
14921491 else
14931492 skb = alloc_can_skb(priv->ndev, (struct can_frame **)&cfd);
14941493
1495− if (!cfd) {
1494+ if (!skb) {
14961495 stats->rx_dropped++;
14971496 return 0;
14981497 }
@@ -1553,10 +1552,8 @@ mcp251xfd_handle_rxif_ring(struct mcp251xfd_priv *priv, · 54 unmodified lines
15531552
15541553 /* Increment the RX FIFO tail pointer 'len' times in a
15551554 * single SPI message.
1556− */
1557− ring->tail += len;
1558−
1559− /* Note:
1555+ *
1556+ * Note:
15601557 *
15611558 * "cs_change == 1" on the last transfer results in an
15621559 * active chip select after the complete SPI
@@ -1572,6 +1569,8 @@ mcp251xfd_handle_rxif_ring(struct mcp251xfd_priv *priv, · 9 unmodified lines
15721569 last_xfer->cs_change = 1;
15731570 if (err)
15741571 return err;
1572+
1573+ ring->tail += len;
15751574 }
15761575
15771576 return 0;
drivers/net/dsa/hirschmann/Kconfig+1−0
@@ -4,6 +4,7 @@ config NET_DSA_HIRSCHMANN_HELLCREEK · 3 unmodified lines
44 depends on HAS_IOMEM
55 depends on NET_DSA
66 depends on PTP_1588_CLOCK
7+ depends on LEDS_CLASS
78 select NET_DSA_TAG_HELLCREEK
89 help
910 This driver adds support for Hirschmann Hellcreek TSN switches.
drivers/net/dsa/lantiq_gswip.c+11−23
@@ -92,9 +92,7 @@ · 91 unmodified lines
9292 GSWIP_MDIO_PHY_FDUP_MASK)
9393
9494 /* GSWIP MII Registers */
95−#define GSWIP_MII_CFG0 0x00
96−#define GSWIP_MII_CFG1 0x02
97−#define GSWIP_MII_CFG5 0x04
95+#define GSWIP_MII_CFGp(p) (0x2 * (p))
9896 #define GSWIP_MII_CFG_EN BIT(14)
9997 #define GSWIP_MII_CFG_LDCLKDIS BIT(12)
10098 #define GSWIP_MII_CFG_MODE_MIIP 0x0
@@ -392,17 +390,9 @@ static void gswip_mii_mask(struct gswip_priv *priv, u32 clear, u32 set, · 291 unmodified lines
392390 static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
393391 int port)
394392 {
395− switch (port) {
396− case 0:
397− gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG0);
398− break;
399− case 1:
400− gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG1);
401− break;
402− case 5:
403− gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG5);
404− break;
405− }
393+ /* There's no MII_CFG register for the CPU port */
394+ if (!dsa_is_cpu_port(priv->ds, port))
395+ gswip_mii_mask(priv, clear, set, GSWIP_MII_CFGp(port));
406396 }
407397
408398 static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
@@ -822,9 +812,8 @@ static int gswip_setup(struct dsa_switch *ds) · 413 unmodified lines
822812 gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);
823813
824814 /* Disable the xMII link */
825− gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 0);
826− gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 1);
827− gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 5);
815+ for (i = 0; i < priv->hw_info->max_ports; i++)
816+ gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, i);
828817
829818 /* enable special tag insertion on cpu port */
830819 gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN,
@@ -1447,11 +1436,12 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port, · 616 unmodified lines
14471436 phylink_set(mask, Pause);
14481437 phylink_set(mask, Asym_Pause);
14491438
1450− /* With the exclusion of MII and Reverse MII, we support Gigabit,
1451− * including Half duplex
1439+ /* With the exclusion of MII, Reverse MII and Reduced MII, we
1440+ * support Gigabit, including Half duplex
14521441 */
14531442 if (state->interface != PHY_INTERFACE_MODE_MII &&
1454− state->interface != PHY_INTERFACE_MODE_REVMII) {
1443+ state->interface != PHY_INTERFACE_MODE_REVMII &&
1444+ state->interface != PHY_INTERFACE_MODE_RMII) {
14551445 phylink_set(mask, 1000baseT_Full);
14561446 phylink_set(mask, 1000baseT_Half);
14571447 }
@@ -1541,9 +1531,7 @@ static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, · 83 unmodified lines
15411531 {
15421532 struct gswip_priv *priv = ds->priv;
15431533
1544− /* Enable the xMII interface only for the external PHY */
1545− if (interface != PHY_INTERFACE_MODE_INTERNAL)
1546− gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port);
1534+ gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port);
15471535 }
15481536
15491537 static void gswip_get_strings(struct dsa_switch *ds, int port, u32 stringset,
drivers/net/ethernet/aquantia/Kconfig+0−1
@@ -19,7 +19,6 @@ if NET_VENDOR_AQUANTIA · 18 unmodified lines
1919 config AQTION
2020 tristate "aQuantia AQtion(tm) Support"
2121 depends on PCI
22− depends on X86_64 || ARM64 || COMPILE_TEST
2322 depends on MACSEC || MACSEC=n
2423 help
2524 This enables the support for the aQuantia AQtion(tm) Ethernet card.
drivers/net/ethernet/broadcom/bcmsysport.c+1−0
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev) · 2576 unmodified lines
25772577 NETIF_F_HW_VLAN_CTAG_TX;
25782578 dev->hw_features |= dev->features;
25792579 dev->vlan_features |= dev->features;
2580+ dev->max_mtu = UMAC_MAX_MTU_SIZE;
25802581
25812582 /* Request the WOL interrupt and advertise suspend if available */
25822583 priv->wol_irq_disabled = 1;
drivers/net/ethernet/broadcom/bnxt/bnxt.c+19−19
@@ -6790,8 +6790,10 @@ static int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp) · 6789 unmodified lines
67906790 ctx->tqm_fp_rings_count = resp->tqm_fp_rings_count;
67916791 if (!ctx->tqm_fp_rings_count)
67926792 ctx->tqm_fp_rings_count = bp->max_q;
6793+ else if (ctx->tqm_fp_rings_count > BNXT_MAX_TQM_FP_RINGS)
6794+ ctx->tqm_fp_rings_count = BNXT_MAX_TQM_FP_RINGS;
67936795
6794− tqm_rings = ctx->tqm_fp_rings_count + 1;
6796+ tqm_rings = ctx->tqm_fp_rings_count + BNXT_MAX_TQM_SP_RINGS;
67956797 ctx_pg = kcalloc(tqm_rings, sizeof(*ctx_pg), GFP_KERNEL);
67966798 if (!ctx_pg) {
67976799 kfree(ctx);
@@ -6925,7 +6927,8 @@ static int bnxt_hwrm_func_backing_store_cfg(struct bnxt *bp, u32 enables) · 127 unmodified lines
69256927 pg_attr = &req.tqm_sp_pg_size_tqm_sp_lvl,
69266928 pg_dir = &req.tqm_sp_page_dir,
69276929 ena = FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_SP;
6928− i < 9; i++, num_entries++, pg_attr++, pg_dir++, ena <<= 1) {
6930+ i < BNXT_MAX_TQM_RINGS;
6931+ i++, num_entries++, pg_attr++, pg_dir++, ena <<= 1) {
69296932 if (!(enables & ena))
69306933 continue;
69316934
@@ -12887,10 +12890,10 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, · 5955 unmodified lines
1288712890 */
1288812891 static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
1288912892 {
12893+ pci_ers_result_t result = PCI_ERS_RESULT_DISCONNECT;
1289012894 struct net_device *netdev = pci_get_drvdata(pdev);
1289112895 struct bnxt *bp = netdev_priv(netdev);
1289212896 int err = 0, off;
12893− pci_ers_result_t result = PCI_ERS_RESULT_DISCONNECT;
1289412897
1289512898 netdev_info(bp->dev, "PCI Slot Reset\n");
1289612899
@@ -12919,22 +12922,8 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) · 22 unmodified lines
1291912922 pci_save_state(pdev);
1292012923
1292112924 err = bnxt_hwrm_func_reset(bp);
12922− if (!err) {
12923− err = bnxt_hwrm_func_qcaps(bp);
12924− if (!err && netif_running(netdev))
12925− err = bnxt_open(netdev);
12926− }
12927− bnxt_ulp_start(bp, err);
12928− if (!err) {
12929− bnxt_reenable_sriov(bp);
12925+ if (!err)
1293012926 result = PCI_ERS_RESULT_RECOVERED;
12931− }
12932− }
12933−
12934− if (result != PCI_ERS_RESULT_RECOVERED) {
12935− if (netif_running(netdev))
12936− dev_close(netdev);
12937− pci_disable_device(pdev);
1293812927 }
1293912928
1294012929 rtnl_unlock();
@@ -12952,10 +12941,21 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) · 11 unmodified lines
1295212941 static void bnxt_io_resume(struct pci_dev *pdev)
1295312942 {
1295412943 struct net_device *netdev = pci_get_drvdata(pdev);
12944+ struct bnxt *bp = netdev_priv(netdev);
12945+ int err;
1295512946
12947+ netdev_info(bp->dev, "PCI Slot Resume\n");
1295612948 rtnl_lock();
1295712949
12958− netif_device_attach(netdev);
12950+ err = bnxt_hwrm_func_qcaps(bp);
12951+ if (!err && netif_running(netdev))
12952+ err = bnxt_open(netdev);
12953+
12954+ bnxt_ulp_start(bp, err);
12955+ if (!err) {
12956+ bnxt_reenable_sriov(bp);
12957+ netif_device_attach(netdev);
12958+ }
1295912959
1296012960 rtnl_unlock();
1296112961 }
drivers/net/ethernet/broadcom/bnxt/bnxt.h+6−1
@@ -1436,6 +1436,11 @@ struct bnxt_ctx_pg_info { · 1435 unmodified lines
14361436 struct bnxt_ctx_pg_info **ctx_pg_tbl;
14371437 };
14381438
1439+#define BNXT_MAX_TQM_SP_RINGS 1
1440+#define BNXT_MAX_TQM_FP_RINGS 8
1441+#define BNXT_MAX_TQM_RINGS \
1442+ (BNXT_MAX_TQM_SP_RINGS + BNXT_MAX_TQM_FP_RINGS)
1443+
14391444 struct bnxt_ctx_mem_info {
14401445 u32 qp_max_entries;
14411446 u16 qp_min_qp1_entries;
@@ -1474,7 +1479,7 @@ struct bnxt_ctx_mem_info { · 32 unmodified lines
14741479 struct bnxt_ctx_pg_info stat_mem;
14751480 struct bnxt_ctx_pg_info mrav_mem;
14761481 struct bnxt_ctx_pg_info tim_mem;
1477− struct bnxt_ctx_pg_info *tqm_mem[9];
1482+ struct bnxt_ctx_pg_info *tqm_mem[BNXT_MAX_TQM_RINGS];
14781483 };
14791484
14801485 struct bnxt_fw_health {
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+2−1
@@ -2532,7 +2532,7 @@ int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware · 2531 unmodified lines
25322532
25332533 if (rc && ((struct hwrm_err_output *)&resp)->cmd_err ==
25342534 NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
2535− install.flags |=
2535+ install.flags =
25362536 cpu_to_le16(NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
25372537
25382538 rc = _hwrm_send_message_silent(bp, &install,
@@ -2546,6 +2546,7 @@ int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware · 7 unmodified lines
25462546 * UPDATE directory and try the flash again
25472547 */
25482548 defrag_attempted = true;
2549+ install.flags = 0;
25492550 rc = __bnxt_flash_nvram(bp->dev,
25502551 BNX_DIR_TYPE_UPDATE,
25512552 BNX_DIR_ORDINAL_FIRST,
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c+6−2
@@ -222,8 +222,12 @@ int bnxt_get_ulp_msix_base(struct bnxt *bp) · 221 unmodified lines
222222
223223 int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
224224 {
225− if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP))
226− return BNXT_MIN_ROCE_STAT_CTXS;
225+ if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP)) {
226+ struct bnxt_en_dev *edev = bp->edev;
227+
228+ if (edev->ulp_tbl[BNXT_ROCE_ULP].msix_requested)
229+ return BNXT_MIN_ROCE_STAT_CTXS;
230+ }
227231
228232 return 0;
229233 }
drivers/net/ethernet/cadence/macb_main.c+1−1
@@ -467,7 +467,7 @@ static void macb_set_tx_clk(struct macb *bp, int speed) · 466 unmodified lines
467467 {
468468 long ferr, rate, rate_rounded;
469469
470− if (!bp->tx_clk || !(bp->caps & MACB_CAPS_CLK_HW_CHG))
470+ if (!bp->tx_clk || (bp->caps & MACB_CAPS_CLK_HW_CHG))
471471 return;
472472
473473 switch (speed) {
drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h+7−0
@@ -40,6 +40,13 @@ · 39 unmodified lines
4040 #define TCB_L2T_IX_M 0xfffULL
4141 #define TCB_L2T_IX_V(x) ((x) << TCB_L2T_IX_S)
4242
43+#define TCB_T_FLAGS_W 1
44+#define TCB_T_FLAGS_S 0
45+#define TCB_T_FLAGS_M 0xffffffffffffffffULL
46+#define TCB_T_FLAGS_V(x) ((__u64)(x) << TCB_T_FLAGS_S)
47+
48+#define TCB_FIELD_COOKIE_TFLAG 1
49+
4350 #define TCB_SMAC_SEL_W 0
4451 #define TCB_SMAC_SEL_S 24
4552 #define TCB_SMAC_SEL_M 0xffULL
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h+4−0
@@ -575,7 +575,11 @@ int send_tx_flowc_wr(struct sock *sk, int compl, · 574 unmodified lines
575575 void chtls_tcp_push(struct sock *sk, int flags);
576576 int chtls_push_frames(struct chtls_sock *csk, int comp);
577577 int chtls_set_tcb_tflag(struct sock *sk, unsigned int bit_pos, int val);
578+void chtls_set_tcb_field_rpl_skb(struct sock *sk, u16 word,
579+ u64 mask, u64 val, u8 cookie,
580+ int through_l2t);
578581 int chtls_setkey(struct chtls_sock *csk, u32 keylen, u32 mode, int cipher_type);
582+void chtls_set_quiesce_ctrl(struct sock *sk, int val);
579583 void skb_entail(struct sock *sk, struct sk_buff *skb, int flags);
580584 unsigned int keyid_to_addr(int start_addr, int keyid);
581585 void free_tls_keyid(struct sock *sk);
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c+54−49
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "chtls.h"
3333 #include "chtls_cm.h"
3434 #include "clip_tbl.h"
35+#include "t4_tcb.h"
3536
3637 /*
3738 * State transitions and actions for close. Note that if we are in SYN_SENT
@@ -267,7 +268,9 @@ static void chtls_send_reset(struct sock *sk, int mode, struct sk_buff *skb) · 229 unmodified lines
267268 if (sk->sk_state != TCP_SYN_RECV)
268269 chtls_send_abort(sk, mode, skb);
269270 else
270− goto out;
271+ chtls_set_tcb_field_rpl_skb(sk, TCB_T_FLAGS_W,
272+ TCB_T_FLAGS_V(TCB_T_FLAGS_M), 0,
273+ TCB_FIELD_COOKIE_TFLAG, 1);
271274
272275 return;
273276 out:
@@ -621,7 +624,7 @@ static void chtls_reset_synq(struct listen_ctx *listen_ctx) · 347 unmodified lines
621624
622625 while (!skb_queue_empty(&listen_ctx->synq)) {
623626 struct chtls_sock *csk =
624− container_of((struct synq *)__skb_dequeue
627+ container_of((struct synq *)skb_peek
625628 (&listen_ctx->synq), struct chtls_sock, synq);
626629 struct sock *child = csk->sk;
627630
@@ -1109,6 +1112,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk, · 481 unmodified lines
11091112 const struct cpl_pass_accept_req *req,
11101113 struct chtls_dev *cdev)
11111114 {
1115+ struct adapter *adap = pci_get_drvdata(cdev->pdev);
11121116 struct neighbour *n = NULL;
11131117 struct inet_sock *newinet;
11141118 const struct iphdr *iph;
@@ -1118,9 +1122,10 @@ static struct sock *chtls_recv_sock(struct sock *lsk, · 3 unmodified lines
11181122 struct dst_entry *dst;
11191123 struct tcp_sock *tp;
11201124 struct sock *newsk;
1125+ bool found = false;
11211126 u16 port_id;
11221127 int rxq_idx;
1123− int step;
1128+ int step, i;
11241129
11251130 iph = (const struct iphdr *)network_hdr;
11261131 newsk = tcp_create_openreq_child(lsk, oreq, cdev->askb);
@@ -1152,7 +1157,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk, · 25 unmodified lines
11521157 n = dst_neigh_lookup(dst, &ip6h->saddr);
11531158 #endif
11541159 }
1155− if (!n)
1160+ if (!n || !n->dev)
11561161 goto free_sk;
11571162
11581163 ndev = n->dev;
@@ -1161,6 +1166,13 @@ static struct sock *chtls_recv_sock(struct sock *lsk, · 2 unmodified lines
11611166 if (is_vlan_dev(ndev))
11621167 ndev = vlan_dev_real_dev(ndev);
11631168
1169+ for_each_port(adap, i)
1170+ if (cdev->ports[i] == ndev)
1171+ found = true;
1172+
1173+ if (!found)
1174+ goto free_dst;
1175+
11641176 port_id = cxgb4_port_idx(ndev);
11651177
11661178 csk = chtls_sock_create(cdev);
@@ -1238,6 +1250,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk, · 71 unmodified lines
12381250 free_csk:
12391251 chtls_sock_release(&csk->kref);
12401252 free_dst:
1253+ neigh_release(n);
12411254 dst_release(dst);
12421255 free_sk:
12431256 inet_csk_prepare_forced_close(newsk);
@@ -1387,7 +1400,7 @@ static void chtls_pass_accept_request(struct sock *sk, · 143 unmodified lines
13871400
13881401 newsk = chtls_recv_sock(sk, oreq, network_hdr, req, cdev);
13891402 if (!newsk)
1390− goto free_oreq;
1403+ goto reject;
13911404
13921405 if (chtls_get_module(newsk))
13931406 goto reject;
@@ -1403,8 +1416,6 @@ static void chtls_pass_accept_request(struct sock *sk, · 9 unmodified lines
14031416 kfree_skb(skb);
14041417 return;
14051418
1406−free_oreq:
1407− chtls_reqsk_free(oreq);
14081419 reject:
14091420 mk_tid_release(reply_skb, 0, tid);
14101421 cxgb4_ofld_send(cdev->lldi->ports[0], reply_skb);
@@ -1589,6 +1600,11 @@ static int chtls_pass_establish(struct chtls_dev *cdev, struct sk_buff *skb) · 178 unmodified lines
15891600 sk_wake_async(sk, 0, POLL_OUT);
15901601
15911602 data = lookup_stid(cdev->tids, stid);
1603+ if (!data) {
1604+ /* listening server close */
1605+ kfree_skb(skb);
1606+ goto unlock;
1607+ }
15921608 lsk = ((struct listen_ctx *)data)->lsk;
15931609
15941610 bh_lock_sock(lsk);
@@ -1936,6 +1952,8 @@ static void chtls_close_con_rpl(struct sock *sk, struct sk_buff *skb) · 341 unmodified lines
19361952 else if (tcp_sk(sk)->linger2 < 0 &&
19371953 !csk_flag_nochk(csk, CSK_ABORT_SHUTDOWN))
19381954 chtls_abort_conn(sk, skb);
1955+ else if (csk_flag_nochk(csk, CSK_TX_DATA_SENT))
1956+ chtls_set_quiesce_ctrl(sk, 0);
19391957 break;
19401958 default:
19411959 pr_info("close_con_rpl in bad state %d\n", sk->sk_state);
@@ -1997,39 +2015,6 @@ static void t4_defer_reply(struct sk_buff *skb, struct chtls_dev *cdev, · 55 unmodified lines
19972015 spin_unlock_bh(&cdev->deferq.lock);
19982016 }
19992017
2000−static void send_abort_rpl(struct sock *sk, struct sk_buff *skb,
2001− struct chtls_dev *cdev, int status, int queue)
2002−{
2003− struct cpl_abort_req_rss *req = cplhdr(skb);
2004− struct sk_buff *reply_skb;
2005− struct chtls_sock *csk;
2006−
2007− csk = rcu_dereference_sk_user_data(sk);
2008−
2009− reply_skb = alloc_skb(sizeof(struct cpl_abort_rpl),
2010− GFP_KERNEL);
2011−
2012− if (!reply_skb) {
2013− req->status = (queue << 1);
2014− t4_defer_reply(skb, cdev, send_defer_abort_rpl);
2015− return;
2016− }
2017−
2018− set_abort_rpl_wr(reply_skb, GET_TID(req), status);
2019− kfree_skb(skb);
2020−
2021− set_wr_txq(reply_skb, CPL_PRIORITY_DATA, queue);
2022− if (csk_conn_inline(csk)) {
2023− struct l2t_entry *e = csk->l2t_entry;
2024−
2025− if (e && sk->sk_state != TCP_SYN_RECV) {
2026− cxgb4_l2t_send(csk->egress_dev, reply_skb, e);
2027− return;
2028− }
2029− }
2030− cxgb4_ofld_send(cdev->lldi->ports[0], reply_skb);
2031−}
2032−
20332018 static void chtls_send_abort_rpl(struct sock *sk, struct sk_buff *skb,
20342019 struct chtls_dev *cdev,
20352020 int status, int queue)
@@ -2078,9 +2063,9 @@ static void bl_abort_syn_rcv(struct sock *lsk, struct sk_buff *skb) · 42 unmodified lines
20782063 queue = csk->txq_idx;
20792064
20802065 skb->sk = NULL;
2066+ chtls_send_abort_rpl(child, skb, BLOG_SKB_CB(skb)->cdev,
2067+ CPL_ABORT_NO_RST, queue);
20812068 do_abort_syn_rcv(child, lsk);
2082− send_abort_rpl(child, skb, BLOG_SKB_CB(skb)->cdev,
2083− CPL_ABORT_NO_RST, queue);
20842069 }
20852070
20862071 static int abort_syn_rcv(struct sock *sk, struct sk_buff *skb)
@@ -2110,8 +2095,8 @@ static int abort_syn_rcv(struct sock *sk, struct sk_buff *skb) · 23 unmodified lines
21102095 if (!sock_owned_by_user(psk)) {
21112096 int queue = csk->txq_idx;
21122097
2098+ chtls_send_abort_rpl(sk, skb, cdev, CPL_ABORT_NO_RST, queue);
21132099 do_abort_syn_rcv(sk, psk);
2114− send_abort_rpl(sk, skb, cdev, CPL_ABORT_NO_RST, queue);
21152100 } else {
21162101 skb->sk = sk;
21172102 BLOG_SKB_CB(skb)->backlog_rcv = bl_abort_syn_rcv;
@@ -2129,9 +2114,6 @@ static void chtls_abort_req_rss(struct sock *sk, struct sk_buff *skb) · 11 unmodified lines
21292114 int queue = csk->txq_idx;
21302115
21312116 if (is_neg_adv(req->status)) {
2132− if (sk->sk_state == TCP_SYN_RECV)
2133− chtls_set_tcb_tflag(sk, 0, 0);
2134−
21352117 kfree_skb(skb);
21362118 return;
21372119 }
@@ -2158,12 +2140,12 @@ static void chtls_abort_req_rss(struct sock *sk, struct sk_buff *skb) · 20 unmodified lines
21582140 if (sk->sk_state == TCP_SYN_RECV && !abort_syn_rcv(sk, skb))
21592141 return;
21602142
2161− chtls_release_resources(sk);
2162− chtls_conn_done(sk);
21632143 }
21642144
21652145 chtls_send_abort_rpl(sk, skb, BLOG_SKB_CB(skb)->cdev,
21662146 rst_status, queue);
2147+ chtls_release_resources(sk);
2148+ chtls_conn_done(sk);
21672149 }
21682150
21692151 static void chtls_abort_rpl_rss(struct sock *sk, struct sk_buff *skb)
@@ -2315,6 +2297,28 @@ static int chtls_wr_ack(struct chtls_dev *cdev, struct sk_buff *skb) · 145 unmodified lines
23152297 return 0;
23162298 }
23172299
2300+static int chtls_set_tcb_rpl(struct chtls_dev *cdev, struct sk_buff *skb)
2301+{
2302+ struct cpl_set_tcb_rpl *rpl = cplhdr(skb) + RSS_HDR;
2303+ unsigned int hwtid = GET_TID(rpl);
2304+ struct sock *sk;
2305+
2306+ sk = lookup_tid(cdev->tids, hwtid);
2307+
2308+ /* return EINVAL if socket doesn't exist */
2309+ if (!sk)
2310+ return -EINVAL;
2311+
2312+ /* Reusing the skb as size of cpl_set_tcb_field structure
2313+ * is greater than cpl_abort_req
2314+ */
2315+ if (TCB_COOKIE_G(rpl->cookie) == TCB_FIELD_COOKIE_TFLAG)
2316+ chtls_send_abort(sk, CPL_ABORT_SEND_RST, NULL);
2317+
2318+ kfree_skb(skb);
2319+ return 0;
2320+}
2321+
23182322 chtls_handler_func chtls_handlers[NUM_CPL_CMDS] = {
23192323 [CPL_PASS_OPEN_RPL] = chtls_pass_open_rpl,
23202324 [CPL_CLOSE_LISTSRV_RPL] = chtls_close_listsrv_rpl,
@@ -2327,5 +2331,6 @@ chtls_handler_func chtls_handlers[NUM_CPL_CMDS] = { · 6 unmodified lines
23272331 [CPL_CLOSE_CON_RPL] = chtls_conn_cpl,
23282332 [CPL_ABORT_REQ_RSS] = chtls_conn_cpl,
23292333 [CPL_ABORT_RPL_RSS] = chtls_conn_cpl,
2330− [CPL_FW4_ACK] = chtls_wr_ack,
2334+ [CPL_FW4_ACK] = chtls_wr_ack,
2335+ [CPL_SET_TCB_RPL] = chtls_set_tcb_rpl,
23312336 };
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c+41−0
@@ -88,6 +88,24 @@ static int chtls_set_tcb_field(struct sock *sk, u16 word, u64 mask, u64 val) · 87 unmodified lines
8888 return ret < 0 ? ret : 0;
8989 }
9090
91+void chtls_set_tcb_field_rpl_skb(struct sock *sk, u16 word,
92+ u64 mask, u64 val, u8 cookie,
93+ int through_l2t)
94+{
95+ struct sk_buff *skb;
96+ unsigned int wrlen;
97+
98+ wrlen = sizeof(struct cpl_set_tcb_field) + sizeof(struct ulptx_idata);
99+ wrlen = roundup(wrlen, 16);
100+
101+ skb = alloc_skb(wrlen, GFP_KERNEL | __GFP_NOFAIL);
102+ if (!skb)
103+ return;
104+
105+ __set_tcb_field(sk, skb, word, mask, val, cookie, 0);
106+ send_or_defer(sk, tcp_sk(sk), skb, through_l2t);
107+}
108+
91109 /*
92110 * Set one of the t_flags bits in the TCB.
93111 */
@@ -113,6 +131,29 @@ static int chtls_set_tcb_quiesce(struct sock *sk, int val) · 19 unmodified lines
113131 TF_RX_QUIESCE_V(val));
114132 }
115133
134+void chtls_set_quiesce_ctrl(struct sock *sk, int val)
135+{
136+ struct chtls_sock *csk;
137+ struct sk_buff *skb;
138+ unsigned int wrlen;
139+ int ret;
140+
141+ wrlen = sizeof(struct cpl_set_tcb_field) + sizeof(struct ulptx_idata);
142+ wrlen = roundup(wrlen, 16);
143+
144+ skb = alloc_skb(wrlen, GFP_ATOMIC);
145+ if (!skb)
146+ return;
147+
148+ csk = rcu_dereference_sk_user_data(sk);
149+
150+ __set_tcb_field(sk, skb, 1, TF_RX_QUIESCE_V(1), 0, 0, 1);
151+ set_wr_txq(skb, CPL_PRIORITY_CONTROL, csk->port_id);
152+ ret = cxgb4_ofld_send(csk->egress_dev, skb);
153+ if (ret < 0)
154+ kfree_skb(skb);
155+}
156+
116157 /* TLS Key bitmap processing */
117158 int chtls_init_kmap(struct chtls_dev *cdev, struct cxgb4_lld_info *lldi)
118159 {
drivers/net/ethernet/ethoc.c+2−1
@@ -1211,7 +1211,7 @@ static int ethoc_probe(struct platform_device *pdev) · 1210 unmodified lines
12111211 ret = mdiobus_register(priv->mdio);
12121212 if (ret) {
12131213 dev_err(&netdev->dev, "failed to register MDIO bus\n");
1214− goto free2;
1214+ goto free3;
12151215 }
12161216
12171217 ret = ethoc_mdio_probe(netdev);
@@ -1243,6 +1243,7 @@ error2: · 25 unmodified lines
12431243 netif_napi_del(&priv->napi);
12441244 error:
12451245 mdiobus_unregister(priv->mdio);
1246+free3:
12461247 mdiobus_free(priv->mdio);
12471248 free2:
12481249 clk_disable_unprepare(priv->clk);
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c+1−0
@@ -223,3 +223,4 @@ static struct platform_driver fs_enet_bb_mdio_driver = { · 222 unmodified lines
223223 };
224224
225225 module_platform_driver(fs_enet_bb_mdio_driver);
226+MODULE_LICENSE("GPL");
drivers/net/ethernet/freescale/fs_enet/mii-fec.c+1−0
@@ -224,3 +224,4 @@ static struct platform_driver fs_enet_fec_mdio_driver = { · 223 unmodified lines
224224 };
225225
226226 module_platform_driver(fs_enet_fec_mdio_driver);
227+MODULE_LICENSE("GPL");
drivers/net/ethernet/freescale/ucc_geth.c+2−1
@@ -3889,6 +3889,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) · 3888 unmodified lines
38893889 INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
38903890 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, 64);
38913891 dev->mtu = 1500;
3892+ dev->max_mtu = 1518;
38923893
38933894 ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT);
38943895 ugeth->phy_interface = phy_interface;
@@ -3934,12 +3935,12 @@ static int ucc_geth_remove(struct platform_device* ofdev) · 39 unmodified lines
39343935 struct device_node *np = ofdev->dev.of_node;
39353936
39363937 unregister_netdev(dev);
3937− free_netdev(dev);
39383938 ucc_geth_memclean(ugeth);
39393939 if (of_phy_is_fixed_link(np))
39403940 of_phy_deregister_fixed_link(np);
39413941 of_node_put(ugeth->ug_info->tbi_node);
39423942 of_node_put(ugeth->ug_info->phy_node);
3943+ free_netdev(dev);
39433944
39443945 return 0;
39453946 }
drivers/net/ethernet/freescale/ucc_geth.h+8−1
@@ -575,7 +575,14 @@ struct ucc_geth_tx_global_pram { · 574 unmodified lines
575575 u32 vtagtable[0x8]; /* 8 4-byte VLAN tags */
576576 u32 tqptr; /* a base pointer to the Tx Queues Memory
577577 Region */
578− u8 res2[0x80 - 0x74];
578+ u8 res2[0x78 - 0x74];
579+ u64 snums_en;
580+ u32 l2l3baseptr; /* top byte consists of a few other bit fields */
581+
582+ u16 mtu[8];
583+ u8 res3[0xa8 - 0x94];
584+ u32 wrrtablebase; /* top byte is reserved */
585+ u8 res4[0xc0 - 0xac];
579586 } __packed;
580587
581588 /* structure representing Extended Filtering Global Parameters in PRAM */
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c+4−0
@@ -415,6 +415,10 @@ static void __lb_other_process(struct hns_nic_ring_data *ring_data, · 414 unmodified lines
415415 /* for mutl buffer*/
416416 new_skb = skb_copy(skb, GFP_ATOMIC);
417417 dev_kfree_skb_any(skb);
418+ if (!new_skb) {
419+ netdev_err(ndev, "skb alloc failed\n");
420+ return;
421+ }
418422 skb = new_skb;
419423
420424 check_ok = 0;
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h+2−2
@@ -169,7 +169,7 @@ struct hclgevf_mbx_arq_ring { · 168 unmodified lines
169169 #define hclge_mbx_ring_ptr_move_crq(crq) \
170170 (crq->next_to_use = (crq->next_to_use + 1) % crq->desc_num)
171171 #define hclge_mbx_tail_ptr_move_arq(arq) \
172− (arq.tail = (arq.tail + 1) % HCLGE_MBX_MAX_ARQ_MSG_SIZE)
172+ (arq.tail = (arq.tail + 1) % HCLGE_MBX_MAX_ARQ_MSG_NUM)
173173 #define hclge_mbx_head_ptr_move_arq(arq) \
174− (arq.head = (arq.head + 1) % HCLGE_MBX_MAX_ARQ_MSG_SIZE)
174+ (arq.head = (arq.head + 1) % HCLGE_MBX_MAX_ARQ_MSG_NUM)
175175 #endif
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+6−3
@@ -752,7 +752,8 @@ static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset) · 751 unmodified lines
752752 handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK;
753753 handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK;
754754
755− if (hdev->hw.mac.phydev) {
755+ if (hdev->hw.mac.phydev && hdev->hw.mac.phydev->drv &&
756+ hdev->hw.mac.phydev->drv->set_loopback) {
756757 count += 1;
757758 handle->flags |= HNAE3_SUPPORT_PHY_LOOPBACK;
758759 }
@@ -4537,8 +4538,8 @@ static int hclge_set_rss_tuple(struct hnae3_handle *handle, · 3778 unmodified lines
45374538 req->ipv4_sctp_en = tuple_sets;
45384539 break;
45394540 case SCTP_V6_FLOW:
4540− if ((nfc->data & RXH_L4_B_0_1) ||
4541− (nfc->data & RXH_L4_B_2_3))
4541+ if (hdev->ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2 &&
4542+ (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)))
45424543 return -EINVAL;
45434544
45444545 req->ipv6_sctp_en = tuple_sets;
@@ -4730,6 +4731,8 @@ static void hclge_rss_init_cfg(struct hclge_dev *hdev) · 185 unmodified lines
47304731 vport[i].rss_tuple_sets.ipv6_udp_en =
47314732 HCLGE_RSS_INPUT_TUPLE_OTHER;
47324733 vport[i].rss_tuple_sets.ipv6_sctp_en =
4734+ hdev->ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2 ?
4735+ HCLGE_RSS_INPUT_TUPLE_SCTP_NO_PORT :
47334736 HCLGE_RSS_INPUT_TUPLE_SCTP;
47344737 vport[i].rss_tuple_sets.ipv6_fragment_en =
47354738 HCLGE_RSS_INPUT_TUPLE_OTHER;
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h+2−0
@@ -107,6 +107,8 @@ · 106 unmodified lines
107107 #define HCLGE_D_IP_BIT BIT(2)
108108 #define HCLGE_S_IP_BIT BIT(3)
109109 #define HCLGE_V_TAG_BIT BIT(4)
110+#define HCLGE_RSS_INPUT_TUPLE_SCTP_NO_PORT \
111+ (HCLGE_D_IP_BIT | HCLGE_S_IP_BIT | HCLGE_V_TAG_BIT)
110112
111113 #define HCLGE_RSS_TC_SIZE_0 1
112114 #define HCLGE_RSS_TC_SIZE_1 2
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+6−3
@@ -917,8 +917,8 @@ static int hclgevf_set_rss_tuple(struct hnae3_handle *handle, · 916 unmodified lines
917917 req->ipv4_sctp_en = tuple_sets;
918918 break;
919919 case SCTP_V6_FLOW:
920− if ((nfc->data & RXH_L4_B_0_1) ||
921− (nfc->data & RXH_L4_B_2_3))
920+ if (hdev->ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2 &&
921+ (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)))
922922 return -EINVAL;
923923
924924 req->ipv6_sctp_en = tuple_sets;
@@ -2502,7 +2502,10 @@ static void hclgevf_rss_init_cfg(struct hclgevf_dev *hdev) · 1577 unmodified lines
25022502 tuple_sets->ipv4_fragment_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
25032503 tuple_sets->ipv6_tcp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
25042504 tuple_sets->ipv6_udp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
2505− tuple_sets->ipv6_sctp_en = HCLGEVF_RSS_INPUT_TUPLE_SCTP;
2505+ tuple_sets->ipv6_sctp_en =
2506+ hdev->ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2 ?
2507+ HCLGEVF_RSS_INPUT_TUPLE_SCTP_NO_PORT :
2508+ HCLGEVF_RSS_INPUT_TUPLE_SCTP;
25062509 tuple_sets->ipv6_fragment_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
25072510 }
25082511
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h+2−0
@@ -122,6 +122,8 @@ · 121 unmodified lines
122122 #define HCLGEVF_D_IP_BIT BIT(2)
123123 #define HCLGEVF_S_IP_BIT BIT(3)
124124 #define HCLGEVF_V_TAG_BIT BIT(4)
125+#define HCLGEVF_RSS_INPUT_TUPLE_SCTP_NO_PORT \
126+ (HCLGEVF_D_IP_BIT | HCLGEVF_S_IP_BIT | HCLGEVF_V_TAG_BIT)
125127
126128 #define HCLGEVF_STATS_TIMER_INTERVAL 36U
127129
drivers/net/ethernet/ibm/ibmvnic.c+5−5
@@ -955,6 +955,7 @@ static void release_resources(struct ibmvnic_adapter *adapter) · 954 unmodified lines
955955 release_rx_pools(adapter);
956956
957957 release_napi(adapter);
958+ release_login_buffer(adapter);
958959 release_login_rsp_buffer(adapter);
959960 }
960961
@@ -2341,8 +2342,7 @@ static void __ibmvnic_reset(struct work_struct *work) · 1380 unmodified lines
23412342 set_current_state(TASK_UNINTERRUPTIBLE);
23422343 schedule_timeout(60 * HZ);
23432344 }
2344− } else if (!(rwi->reset_reason == VNIC_RESET_FATAL &&
2345− adapter->from_passive_init)) {
2345+ } else {
23462346 rc = do_reset(adapter, rwi, reset_state);
23472347 }
23482348 kfree(rwi);
@@ -2981,9 +2981,7 @@ static int reset_one_sub_crq_queue(struct ibmvnic_adapter *adapter, · 632 unmodified lines
29812981 int rc;
29822982
29832983 if (!scrq) {
2984− netdev_dbg(adapter->netdev,
2985− "Invalid scrq reset. irq (%d) or msgs (%p).\n",
2986− scrq->irq, scrq->msgs);
2984+ netdev_dbg(adapter->netdev, "Invalid scrq reset.\n");
29872985 return -EINVAL;
29882986 }
29892987
@@ -3873,7 +3871,9 @@ static int send_login(struct ibmvnic_adapter *adapter) · 883 unmodified lines
38733871 return -1;
38743872 }
38753873
3874+ release_login_buffer(adapter);
38763875 release_login_rsp_buffer(adapter);
3876+
38773877 client_data_len = vnic_client_data_len(adapter);
38783878
38793879 buffer_size =
drivers/net/ethernet/intel/e1000e/e1000.h+1−0
@@ -436,6 +436,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca); · 435 unmodified lines
436436 #define FLAG2_DFLT_CRC_STRIPPING BIT(12)
437437 #define FLAG2_CHECK_RX_HWTSTAMP BIT(13)
438438 #define FLAG2_CHECK_SYSTIM_OVERFLOW BIT(14)
439+#define FLAG2_ENABLE_S0IX_FLOWS BIT(15)
439440
440441 #define E1000_RX_DESC_PS(R, i) \
441442 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
drivers/net/ethernet/intel/e1000e/ethtool.c+46−0
@@ -23,6 +23,13 @@ struct e1000_stats { · 22 unmodified lines
2323 int stat_offset;
2424 };
2525
26+static const char e1000e_priv_flags_strings[][ETH_GSTRING_LEN] = {
27+#define E1000E_PRIV_FLAGS_S0IX_ENABLED BIT(0)
28+ "s0ix-enabled",
29+};
30+
31+#define E1000E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(e1000e_priv_flags_strings)
32+
2633 #define E1000_STAT(str, m) { \
2734 .stat_string = str, \
2835 .type = E1000_STATS, \
@@ -1776,6 +1783,8 @@ static int e1000e_get_sset_count(struct net_device __always_unused *netdev, · 1747 unmodified lines
17761783 return E1000_TEST_LEN;
17771784 case ETH_SS_STATS:
17781785 return E1000_STATS_LEN;
1786+ case ETH_SS_PRIV_FLAGS:
1787+ return E1000E_PRIV_FLAGS_STR_LEN;
17791788 default:
17801789 return -EOPNOTSUPP;
17811790 }
@@ -2097,6 +2106,10 @@ static void e1000_get_strings(struct net_device __always_unused *netdev, · 315 unmodified lines
20972106 p += ETH_GSTRING_LEN;
20982107 }
20992108 break;
2109+ case ETH_SS_PRIV_FLAGS:
2110+ memcpy(data, e1000e_priv_flags_strings,
2111+ E1000E_PRIV_FLAGS_STR_LEN * ETH_GSTRING_LEN);
2112+ break;
21002113 }
21012114 }
21022115
@@ -2305,6 +2318,37 @@ static int e1000e_get_ts_info(struct net_device *netdev, · 202 unmodified lines
23052318 return 0;
23062319 }
23072320
2321+static u32 e1000e_get_priv_flags(struct net_device *netdev)
2322+{
2323+ struct e1000_adapter *adapter = netdev_priv(netdev);
2324+ u32 priv_flags = 0;
2325+
2326+ if (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS)
2327+ priv_flags |= E1000E_PRIV_FLAGS_S0IX_ENABLED;
2328+
2329+ return priv_flags;
2330+}
2331+
2332+static int e1000e_set_priv_flags(struct net_device *netdev, u32 priv_flags)
2333+{
2334+ struct e1000_adapter *adapter = netdev_priv(netdev);
2335+ unsigned int flags2 = adapter->flags2;
2336+
2337+ flags2 &= ~FLAG2_ENABLE_S0IX_FLOWS;
2338+ if (priv_flags & E1000E_PRIV_FLAGS_S0IX_ENABLED) {
2339+ struct e1000_hw *hw = &adapter->hw;
2340+
2341+ if (hw->mac.type < e1000_pch_cnp)
2342+ return -EINVAL;
2343+ flags2 |= FLAG2_ENABLE_S0IX_FLOWS;
2344+ }
2345+
2346+ if (flags2 != adapter->flags2)
2347+ adapter->flags2 = flags2;
2348+
2349+ return 0;
2350+}
2351+
23082352 static const struct ethtool_ops e1000_ethtool_ops = {
23092353 .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
23102354 .get_drvinfo = e1000_get_drvinfo,
@@ -2336,6 +2380,8 @@ static const struct ethtool_ops e1000_ethtool_ops = { · 25 unmodified lines
23362380 .set_eee = e1000e_set_eee,
23372381 .get_link_ksettings = e1000_get_link_ksettings,
23382382 .set_link_ksettings = e1000_set_link_ksettings,
2383+ .get_priv_flags = e1000e_get_priv_flags,
2384+ .set_priv_flags = e1000e_set_priv_flags,
23392385 };
23402386
23412387 void e1000e_set_ethtool_ops(struct net_device *netdev)
drivers/net/ethernet/intel/e1000e/ich8lan.c+14−3
@@ -1240,6 +1240,9 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) · 1239 unmodified lines
12401240 return 0;
12411241
12421242 if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
1243+ struct e1000_adapter *adapter = hw->adapter;
1244+ bool firmware_bug = false;
1245+
12431246 if (force) {
12441247 /* Request ME un-configure ULP mode in the PHY */
12451248 mac_reg = er32(H2ME);
@@ -1248,16 +1251,24 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) · 2 unmodified lines
12481251 ew32(H2ME, mac_reg);
12491252 }
12501253
1251− /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */
1254+ /* Poll up to 2.5 seconds for ME to clear ULP_CFG_DONE.
1255+ * If this takes more than 1 second, show a warning indicating a
1256+ * firmware bug
1257+ */
12521258 while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) {
1253− if (i++ == 30) {
1259+ if (i++ == 250) {
12541260 ret_val = -E1000_ERR_PHY;
12551261 goto out;
12561262 }
1263+ if (i > 100 && !firmware_bug)
1264+ firmware_bug = true;
12571265
12581266 usleep_range(10000, 11000);
12591267 }
1260− e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10);
1268+ if (firmware_bug)
1269+ e_warn("ULP_CONFIG_DONE took %dmsec. This is a firmware bug\n", i * 10);
1270+ else
1271+ e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10);
12611272
12621273 if (force) {
12631274 mac_reg = er32(H2ME);
drivers/net/ethernet/intel/e1000e/netdev.c+10−49
@@ -103,45 +103,6 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = { · 102 unmodified lines
103103 {0, NULL}
104104 };
105105
106−struct e1000e_me_supported {
107− u16 device_id; /* supported device ID */
108−};
109−
110−static const struct e1000e_me_supported me_supported[] = {
111− {E1000_DEV_ID_PCH_LPT_I217_LM},
112− {E1000_DEV_ID_PCH_LPTLP_I218_LM},
113− {E1000_DEV_ID_PCH_I218_LM2},
114− {E1000_DEV_ID_PCH_I218_LM3},
115− {E1000_DEV_ID_PCH_SPT_I219_LM},
116− {E1000_DEV_ID_PCH_SPT_I219_LM2},
117− {E1000_DEV_ID_PCH_LBG_I219_LM3},
118− {E1000_DEV_ID_PCH_SPT_I219_LM4},
119− {E1000_DEV_ID_PCH_SPT_I219_LM5},
120− {E1000_DEV_ID_PCH_CNP_I219_LM6},
121− {E1000_DEV_ID_PCH_CNP_I219_LM7},
122− {E1000_DEV_ID_PCH_ICP_I219_LM8},
123− {E1000_DEV_ID_PCH_ICP_I219_LM9},
124− {E1000_DEV_ID_PCH_CMP_I219_LM10},
125− {E1000_DEV_ID_PCH_CMP_I219_LM11},
126− {E1000_DEV_ID_PCH_CMP_I219_LM12},
127− {E1000_DEV_ID_PCH_TGP_I219_LM13},
128− {E1000_DEV_ID_PCH_TGP_I219_LM14},
129− {E1000_DEV_ID_PCH_TGP_I219_LM15},
130− {0}
131−};
132−
133−static bool e1000e_check_me(u16 device_id)
134−{
135− struct e1000e_me_supported *id;
136−
137− for (id = (struct e1000e_me_supported *)me_supported;
138− id->device_id; id++)
139− if (device_id == id->device_id)
140− return true;
141−
142− return false;
143−}
144−
145106 /**
146107 * __ew32_prepare - prepare to write to MAC CSR register on certain parts
147108 * @hw: pointer to the HW structure
@@ -6962,7 +6923,6 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) · 6814 unmodified lines
69626923 struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
69636924 struct e1000_adapter *adapter = netdev_priv(netdev);
69646925 struct pci_dev *pdev = to_pci_dev(dev);
6965− struct e1000_hw *hw = &adapter->hw;
69666926 int rc;
69676927
69686928 e1000e_flush_lpic(pdev);
@@ -6970,13 +6930,13 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) · 1 unmodified line
69706930 e1000e_pm_freeze(dev);
69716931
69726932 rc = __e1000_shutdown(pdev, false);
6973− if (rc)
6933+ if (rc) {
69746934 e1000e_pm_thaw(dev);
6975−
6976− /* Introduce S0ix implementation */
6977− if (hw->mac.type >= e1000_pch_cnp &&
6978− !e1000e_check_me(hw->adapter->pdev->device))
6979− e1000e_s0ix_entry_flow(adapter);
6935+ } else {
6936+ /* Introduce S0ix implementation */
6937+ if (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS)
6938+ e1000e_s0ix_entry_flow(adapter);
6939+ }
69806940
69816941 return rc;
69826942 }
@@ -6986,12 +6946,10 @@ static __maybe_unused int e1000e_pm_resume(struct device *dev) · 3 unmodified lines
69866946 struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
69876947 struct e1000_adapter *adapter = netdev_priv(netdev);
69886948 struct pci_dev *pdev = to_pci_dev(dev);
6989− struct e1000_hw *hw = &adapter->hw;
69906949 int rc;
69916950
69926951 /* Introduce S0ix implementation */
6993− if (hw->mac.type >= e1000_pch_cnp &&
6994− !e1000e_check_me(hw->adapter->pdev->device))
6952+ if (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS)
69956953 e1000e_s0ix_exit_flow(adapter);
69966954
69976955 rc = __e1000_resume(pdev);
@@ -7655,6 +7613,9 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 657 unmodified lines
76557613 if (!(adapter->flags & FLAG_HAS_AMT))
76567614 e1000e_get_hw_control(adapter);
76577615
7616+ if (hw->mac.type >= e1000_pch_cnp)
7617+ adapter->flags2 |= FLAG2_ENABLE_S0IX_FLOWS;
7618+
76587619 strlcpy(netdev->name, "eth%d", sizeof(netdev->name));
76597620 err = register_netdev(netdev);
76607621 if (err)
drivers/net/ethernet/intel/i40e/i40e.h+3−0
@@ -120,6 +120,7 @@ enum i40e_state_t { · 119 unmodified lines
120120 __I40E_RESET_INTR_RECEIVED,
121121 __I40E_REINIT_REQUESTED,
122122 __I40E_PF_RESET_REQUESTED,
123+ __I40E_PF_RESET_AND_REBUILD_REQUESTED,
123124 __I40E_CORE_RESET_REQUESTED,
124125 __I40E_GLOBAL_RESET_REQUESTED,
125126 __I40E_EMP_RESET_INTR_RECEIVED,
@@ -146,6 +147,8 @@ enum i40e_state_t { · 20 unmodified lines
146147 };
147148
148149 #define I40E_PF_RESET_FLAG BIT_ULL(__I40E_PF_RESET_REQUESTED)
150+#define I40E_PF_RESET_AND_REBUILD_FLAG \
151+ BIT_ULL(__I40E_PF_RESET_AND_REBUILD_REQUESTED)
149152
150153 /* VSI state flags */
151154 enum i40e_vsi_state_t {
drivers/net/ethernet/intel/i40e/i40e_main.c+10−0
@@ -36,6 +36,8 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf); · 35 unmodified lines
3636 static void i40e_determine_queue_usage(struct i40e_pf *pf);
3737 static int i40e_setup_pf_filter_control(struct i40e_pf *pf);
3838 static void i40e_prep_for_reset(struct i40e_pf *pf, bool lock_acquired);
39+static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit,
40+ bool lock_acquired);
3941 static int i40e_reset(struct i40e_pf *pf);
4042 static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired);
4143 static int i40e_setup_misc_vector_for_recovery_mode(struct i40e_pf *pf);
@@ -8536,6 +8538,14 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired) · 8494 unmodified lines
85368538 "FW LLDP is disabled\n" :
85378539 "FW LLDP is enabled\n");
85388540
8541+ } else if (reset_flags & I40E_PF_RESET_AND_REBUILD_FLAG) {
8542+ /* Request a PF Reset
8543+ *
8544+ * Resets PF and reinitializes PFs VSI.
8545+ */
8546+ i40e_prep_for_reset(pf, lock_acquired);
8547+ i40e_reset_and_rebuild(pf, true, lock_acquired);
8548+
85398549 } else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) {
85408550 int v;
85418551
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+2−2
@@ -1772,7 +1772,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) · 1771 unmodified lines
17721772 if (num_vfs) {
17731773 if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
17741774 pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
1775− i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG);
1775+ i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG);
17761776 }
17771777 ret = i40e_pci_sriov_enable(pdev, num_vfs);
17781778 goto sriov_configure_out;
@@ -1781,7 +1781,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) · 2 unmodified lines
17811781 if (!pci_vfs_assigned(pf->pdev)) {
17821782 i40e_free_vfs(pf);
17831783 pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
1784− i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG);
1784+ i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG);
17851785 } else {
17861786 dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n");
17871787 ret = -EINVAL;
drivers/net/ethernet/intel/i40e/i40e_xsk.c+1−1
@@ -348,12 +348,12 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) · 347 unmodified lines
348348 * SBP is *not* set in PRT_SBPVSI (default not set).
349349 */
350350 skb = i40e_construct_skb_zc(rx_ring, *bi);
351− *bi = NULL;
352351 if (!skb) {
353352 rx_ring->rx_stats.alloc_buff_failed++;
354353 break;
355354 }
356355
356+ *bi = NULL;
357357 cleaned_count++;
358358 i40e_inc_ntc(rx_ring);
359359
drivers/net/ethernet/intel/iavf/iavf_main.c+1−3
@@ -1834,11 +1834,9 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter) · 1833 unmodified lines
18341834 netif_tx_stop_all_queues(netdev);
18351835 if (CLIENT_ALLOWED(adapter)) {
18361836 err = iavf_lan_add_device(adapter);
1837− if (err) {
1838− rtnl_unlock();
1837+ if (err)
18391838 dev_info(&pdev->dev, "Failed to add VF to client API service list: %d\n",
18401839 err);
1841− }
18421840 }
18431841 dev_info(&pdev->dev, "MAC address: %pM\n", adapter->hw.mac.addr);
18441842 if (netdev->features & NETIF_F_GRO)
drivers/net/ethernet/marvell/mvneta.c+2−2
@@ -4432,7 +4432,7 @@ static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, · 4431 unmodified lines
44324432 struct bpf_prog *old_prog;
44334433
44344434 if (prog && dev->mtu > MVNETA_MAX_RX_BUF_SIZE) {
4435− NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not supported on XDP");
4435+ NL_SET_ERR_MSG_MOD(extack, "MTU too large for XDP");
44364436 return -EOPNOTSUPP;
44374437 }
44384438
@@ -5255,7 +5255,7 @@ static int mvneta_probe(struct platform_device *pdev) · 816 unmodified lines
52555255 err = mvneta_port_power_up(pp, pp->phy_interface);
52565256 if (err < 0) {
52575257 dev_err(&pdev->dev, "can't power up port\n");
5258− return err;
5258+ goto err_netdev;
52595259 }
52605260
52615261 /* Armada3700 network controller does not support per-cpu
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+20−9
@@ -1231,7 +1231,7 @@ static void mvpp22_gop_init_rgmii(struct mvpp2_port *port) · 1230 unmodified lines
12311231
12321232 regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);
12331233 if (port->gop_id == 2)
1234− val |= GENCONF_CTRL0_PORT0_RGMII | GENCONF_CTRL0_PORT1_RGMII;
1234+ val |= GENCONF_CTRL0_PORT0_RGMII;
12351235 else if (port->gop_id == 3)
12361236 val |= GENCONF_CTRL0_PORT1_RGMII_MII;
12371237 regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
@@ -2370,17 +2370,18 @@ static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port, · 1132 unmodified lines
23702370 static void mvpp2_tx_pkts_coal_set(struct mvpp2_port *port,
23712371 struct mvpp2_tx_queue *txq)
23722372 {
2373− unsigned int thread = mvpp2_cpu_to_thread(port->priv, get_cpu());
2373+ unsigned int thread;
23742374 u32 val;
23752375
23762376 if (txq->done_pkts_coal > MVPP2_TXQ_THRESH_MASK)
23772377 txq->done_pkts_coal = MVPP2_TXQ_THRESH_MASK;
23782378
23792379 val = (txq->done_pkts_coal << MVPP2_TXQ_THRESH_OFFSET);
2380− mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_NUM_REG, txq->id);
2381− mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_THRESH_REG, val);
2382−
2383− put_cpu();
2380+ /* PKT-coalescing registers are per-queue + per-thread */
2381+ for (thread = 0; thread < MVPP2_MAX_THREADS; thread++) {
2382+ mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_NUM_REG, txq->id);
2383+ mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_THRESH_REG, val);
2384+ }
23842385 }
23852386
23862387 static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz)
@@ -5487,7 +5488,7 @@ static int mvpp2_port_init(struct mvpp2_port *port) · 3100 unmodified lines
54875488 struct mvpp2 *priv = port->priv;
54885489 struct mvpp2_txq_pcpu *txq_pcpu;
54895490 unsigned int thread;
5490− int queue, err;
5491+ int queue, err, val;
54915492
54925493 /* Checks for hardware constraints */
54935494 if (port->first_rxq + port->nrxqs >
@@ -5501,6 +5502,18 @@ static int mvpp2_port_init(struct mvpp2_port *port) · 7 unmodified lines
55015502 mvpp2_egress_disable(port);
55025503 mvpp2_port_disable(port);
55035504
5505+ if (mvpp2_is_xlg(port->phy_interface)) {
5506+ val = readl(port->base + MVPP22_XLG_CTRL0_REG);
5507+ val &= ~MVPP22_XLG_CTRL0_FORCE_LINK_PASS;
5508+ val |= MVPP22_XLG_CTRL0_FORCE_LINK_DOWN;
5509+ writel(val, port->base + MVPP22_XLG_CTRL0_REG);
5510+ } else {
5511+ val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
5512+ val &= ~MVPP2_GMAC_FORCE_LINK_PASS;
5513+ val |= MVPP2_GMAC_FORCE_LINK_DOWN;
5514+ writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG);
5515+ }
5516+
55045517 port->tx_time_coal = MVPP2_TXDONE_COAL_USEC;
55055518
55065519 port->txqs = devm_kcalloc(dev, port->ntxqs, sizeof(*port->txqs),
@@ -5869,8 +5882,6 @@ static void mvpp2_phylink_validate(struct phylink_config *config, · 362 unmodified lines
58695882
58705883 phylink_set(mask, Autoneg);
58715884 phylink_set_port_modes(mask);
5872− phylink_set(mask, Pause);
5873− phylink_set(mask, Asym_Pause);
58745885
58755886 switch (state->interface) {
58765887 case PHY_INTERFACE_MODE_10GBASER:
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c+36−2
@@ -405,6 +405,38 @@ static int mvpp2_prs_tcam_first_free(struct mvpp2 *priv, unsigned char start, · 404 unmodified lines
405405 return -EINVAL;
406406 }
407407
408+/* Drop flow control pause frames */
409+static void mvpp2_prs_drop_fc(struct mvpp2 *priv)
410+{
411+ unsigned char da[ETH_ALEN] = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x01 };
412+ struct mvpp2_prs_entry pe;
413+ unsigned int len;
414+
415+ memset(&pe, 0, sizeof(pe));
416+
417+ /* For all ports - drop flow control frames */
418+ pe.index = MVPP2_PE_FC_DROP;
419+ mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
420+
421+ /* Set match on DA */
422+ len = ETH_ALEN;
423+ while (len--)
424+ mvpp2_prs_tcam_data_byte_set(&pe, len, da[len], 0xff);
425+
426+ mvpp2_prs_sram_ri_update(&pe, MVPP2_PRS_RI_DROP_MASK,
427+ MVPP2_PRS_RI_DROP_MASK);
428+
429+ mvpp2_prs_sram_bits_set(&pe, MVPP2_PRS_SRAM_LU_GEN_BIT, 1);
430+ mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_FLOWS);
431+
432+ /* Mask all ports */
433+ mvpp2_prs_tcam_port_map_set(&pe, MVPP2_PRS_PORT_MASK);
434+
435+ /* Update shadow table and hw entry */
436+ mvpp2_prs_shadow_set(priv, pe.index, MVPP2_PRS_LU_MAC);
437+ mvpp2_prs_hw_write(priv, &pe);
438+}
439+
408440 /* Enable/disable dropping all mac da's */
409441 static void mvpp2_prs_mac_drop_all_set(struct mvpp2 *priv, int port, bool add)
410442 {
@@ -1162,6 +1194,7 @@ static void mvpp2_prs_mac_init(struct mvpp2 *priv) · 751 unmodified lines
11621194 mvpp2_prs_hw_write(priv, &pe);
11631195
11641196 /* Create dummy entries for drop all and promiscuous modes */
1197+ mvpp2_prs_drop_fc(priv);
11651198 mvpp2_prs_mac_drop_all_set(priv, 0, false);
11661199 mvpp2_prs_mac_promisc_set(priv, 0, MVPP2_PRS_L2_UNI_CAST, false);
11671200 mvpp2_prs_mac_promisc_set(priv, 0, MVPP2_PRS_L2_MULTI_CAST, false);
@@ -1647,8 +1680,9 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv) · 479 unmodified lines
16471680 mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_IP6);
16481681 mvpp2_prs_sram_ri_update(&pe, MVPP2_PRS_RI_L3_IP6,
16491682 MVPP2_PRS_RI_L3_PROTO_MASK);
1650− /* Skip eth_type + 4 bytes of IPv6 header */
1651− mvpp2_prs_sram_shift_set(&pe, MVPP2_ETH_TYPE_LEN + 4,
1683+ /* Jump to DIP of IPV6 header */
1684+ mvpp2_prs_sram_shift_set(&pe, MVPP2_ETH_TYPE_LEN + 8 +
1685+ MVPP2_MAX_L3_ADDR_SIZE,
16521686 MVPP2_PRS_SRAM_OP_SEL_SHIFT_ADD);
16531687 /* Set L3 offset */
16541688 mvpp2_prs_sram_offset_set(&pe, MVPP2_PRS_SRAM_UDF_TYPE_L3,
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h+1−1
@@ -129,7 +129,7 @@ · 128 unmodified lines
129129 #define MVPP2_PE_VID_EDSA_FLTR_DEFAULT (MVPP2_PRS_TCAM_SRAM_SIZE - 7)
130130 #define MVPP2_PE_VLAN_DBL (MVPP2_PRS_TCAM_SRAM_SIZE - 6)
131131 #define MVPP2_PE_VLAN_NONE (MVPP2_PRS_TCAM_SRAM_SIZE - 5)
132−/* reserved */
132+#define MVPP2_PE_FC_DROP (MVPP2_PRS_TCAM_SRAM_SIZE - 4)
133133 #define MVPP2_PE_MAC_MC_PROMISCUOUS (MVPP2_PRS_TCAM_SRAM_SIZE - 3)
134134 #define MVPP2_PE_MAC_UC_PROMISCUOUS (MVPP2_PRS_TCAM_SRAM_SIZE - 2)
135135 #define MVPP2_PE_MAC_NON_PROMISCUOUS (MVPP2_PRS_TCAM_SRAM_SIZE - 1)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c+11−3
@@ -871,8 +871,10 @@ static int cgx_lmac_init(struct cgx *cgx) · 870 unmodified lines
871871 if (!lmac)
872872 return -ENOMEM;
873873 lmac->name = kcalloc(1, sizeof("cgx_fwi_xxx_yyy"), GFP_KERNEL);
874− if (!lmac->name)
875− return -ENOMEM;
874+ if (!lmac->name) {
875+ err = -ENOMEM;
876+ goto err_lmac_free;
877+ }
876878 sprintf(lmac->name, "cgx_fwi_%d_%d", cgx->cgx_id, i);
877879 lmac->lmac_id = i;
878880 lmac->cgx = cgx;
@@ -883,7 +885,7 @@ static int cgx_lmac_init(struct cgx *cgx) · 4 unmodified lines
883885 CGX_LMAC_FWI + i * 9),
884886 cgx_fwi_event_handler, 0, lmac->name, lmac);
885887 if (err)
886− return err;
888+ goto err_irq;
887889
888890 /* Enable interrupt */
889891 cgx_write(cgx, lmac->lmac_id, CGXX_CMRX_INT_ENA_W1S,
@@ -895,6 +897,12 @@ static int cgx_lmac_init(struct cgx *cgx) · 5 unmodified lines
895897 }
896898
897899 return cgx_lmac_verify_fwi_version(cgx);
900+
901+err_irq:
902+ kfree(lmac->name);
903+err_lmac_free:
904+ kfree(lmac);
905+ return err;
898906 }
899907
900908 static int cgx_lmac_exit(struct cgx *cgx)
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c+5−0
@@ -626,6 +626,11 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe, · 625 unmodified lines
626626 if (!reg_c0)
627627 return true;
628628
629+ /* If reg_c0 is not equal to the default flow tag then skb->mark
630+ * is not supported and must be reset back to 0.
631+ */
632+ skb->mark = 0;
633+
629634 priv = netdev_priv(skb->dev);
630635 esw = priv->mdev->priv.eswitch;
631636
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+49−28
@@ -118,16 +118,17 @@ struct mlx5_ct_tuple { · 117 unmodified lines
118118 u16 zone;
119119 };
120120
121−struct mlx5_ct_shared_counter {
121+struct mlx5_ct_counter {
122122 struct mlx5_fc *counter;
123123 refcount_t refcount;
124+ bool is_shared;
124125 };
125126
126127 struct mlx5_ct_entry {
127128 struct rhash_head node;
128129 struct rhash_head tuple_node;
129130 struct rhash_head tuple_nat_node;
130− struct mlx5_ct_shared_counter *shared_counter;
131+ struct mlx5_ct_counter *counter;
131132 unsigned long cookie;
132133 unsigned long restore_cookie;
133134 struct mlx5_ct_tuple tuple;
@@ -394,13 +395,14 @@ mlx5_tc_ct_set_tuple_match(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec, · 260 unmodified lines
394395 }
395396
396397 static void
397−mlx5_tc_ct_shared_counter_put(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_entry *entry)
398+mlx5_tc_ct_counter_put(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_entry *entry)
398399 {
399− if (!refcount_dec_and_test(&entry->shared_counter->refcount))
400+ if (entry->counter->is_shared &&
401+ !refcount_dec_and_test(&entry->counter->refcount))
400402 return;
401403
402− mlx5_fc_destroy(ct_priv->dev, entry->shared_counter->counter);
403− kfree(entry->shared_counter);
404+ mlx5_fc_destroy(ct_priv->dev, entry->counter->counter);
405+ kfree(entry->counter);
404406 }
405407
406408 static void
@@ -699,7 +701,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 292 unmodified lines
699701 attr->dest_ft = ct_priv->post_ct;
700702 attr->ft = nat ? ct_priv->ct_nat : ct_priv->ct;
701703 attr->outer_match_level = MLX5_MATCH_L4;
702− attr->counter = entry->shared_counter->counter;
704+ attr->counter = entry->counter->counter;
703705 attr->flags |= MLX5_ESW_ATTR_FLAG_NO_IN_PORT;
704706
705707 mlx5_tc_ct_set_tuple_match(netdev_priv(ct_priv->netdev), spec, flow_rule);
@@ -732,13 +734,34 @@ err_attr: · 26 unmodified lines
732734 return err;
733735 }
734736
735−static struct mlx5_ct_shared_counter *
737+static struct mlx5_ct_counter *
738+mlx5_tc_ct_counter_create(struct mlx5_tc_ct_priv *ct_priv)
739+{
740+ struct mlx5_ct_counter *counter;
741+ int ret;
742+
743+ counter = kzalloc(sizeof(*counter), GFP_KERNEL);
744+ if (!counter)
745+ return ERR_PTR(-ENOMEM);
746+
747+ counter->is_shared = false;
748+ counter->counter = mlx5_fc_create(ct_priv->dev, true);
749+ if (IS_ERR(counter->counter)) {
750+ ct_dbg("Failed to create counter for ct entry");
751+ ret = PTR_ERR(counter->counter);
752+ kfree(counter);
753+ return ERR_PTR(ret);
754+ }
755+
756+ return counter;
757+}
758+
759+static struct mlx5_ct_counter *
736760 mlx5_tc_ct_shared_counter_get(struct mlx5_tc_ct_priv *ct_priv,
737761 struct mlx5_ct_entry *entry)
738762 {
739763 struct mlx5_ct_tuple rev_tuple = entry->tuple;
740− struct mlx5_ct_shared_counter *shared_counter;
741− struct mlx5_core_dev *dev = ct_priv->dev;
764+ struct mlx5_ct_counter *shared_counter;
742765 struct mlx5_ct_entry *rev_entry;
743766 __be16 tmp_port;
744767 int ret;
@@ -767,25 +790,20 @@ mlx5_tc_ct_shared_counter_get(struct mlx5_tc_ct_priv *ct_priv, · 22 unmodified lines
767790 rev_entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, &rev_tuple,
768791 tuples_ht_params);
769792 if (rev_entry) {
770− if (refcount_inc_not_zero(&rev_entry->shared_counter->refcount)) {
793+ if (refcount_inc_not_zero(&rev_entry->counter->refcount)) {
771794 mutex_unlock(&ct_priv->shared_counter_lock);
772− return rev_entry->shared_counter;
795+ return rev_entry->counter;
773796 }
774797 }
775798 mutex_unlock(&ct_priv->shared_counter_lock);
776799
777− shared_counter = kzalloc(sizeof(*shared_counter), GFP_KERNEL);
778− if (!shared_counter)
779− return ERR_PTR(-ENOMEM);
780−
781− shared_counter->counter = mlx5_fc_create(dev, true);
782− if (IS_ERR(shared_counter->counter)) {
783− ct_dbg("Failed to create counter for ct entry");
784− ret = PTR_ERR(shared_counter->counter);
785− kfree(shared_counter);
800+ shared_counter = mlx5_tc_ct_counter_create(ct_priv);
801+ if (IS_ERR(shared_counter)) {
802+ ret = PTR_ERR(shared_counter);
786803 return ERR_PTR(ret);
787804 }
788805
806+ shared_counter->is_shared = true;
789807 refcount_set(&shared_counter->refcount, 1);
790808 return shared_counter;
791809 }
@@ -798,10 +816,13 @@ mlx5_tc_ct_entry_add_rules(struct mlx5_tc_ct_priv *ct_priv, · 6 unmodified lines
798816 {
799817 int err;
800818
801− entry->shared_counter = mlx5_tc_ct_shared_counter_get(ct_priv, entry);
802− if (IS_ERR(entry->shared_counter)) {
803− err = PTR_ERR(entry->shared_counter);
804− ct_dbg("Failed to create counter for ct entry");
819+ if (nf_ct_acct_enabled(dev_net(ct_priv->netdev)))
820+ entry->counter = mlx5_tc_ct_counter_create(ct_priv);
821+ else
822+ entry->counter = mlx5_tc_ct_shared_counter_get(ct_priv, entry);
823+
824+ if (IS_ERR(entry->counter)) {
825+ err = PTR_ERR(entry->counter);
805826 return err;
806827 }
807828
@@ -820,7 +841,7 @@ mlx5_tc_ct_entry_add_rules(struct mlx5_tc_ct_priv *ct_priv, · 12 unmodified lines
820841 err_nat:
821842 mlx5_tc_ct_entry_del_rule(ct_priv, entry, false);
822843 err_orig:
823− mlx5_tc_ct_shared_counter_put(ct_priv, entry);
844+ mlx5_tc_ct_counter_put(ct_priv, entry);
824845 return err;
825846 }
826847
@@ -918,7 +939,7 @@ mlx5_tc_ct_del_ft_entry(struct mlx5_tc_ct_priv *ct_priv, · 91 unmodified lines
918939 rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node,
919940 tuples_ht_params);
920941 mutex_unlock(&ct_priv->shared_counter_lock);
921− mlx5_tc_ct_shared_counter_put(ct_priv, entry);
942+ mlx5_tc_ct_counter_put(ct_priv, entry);
922943
923944 }
924945
@@ -956,7 +977,7 @@ mlx5_tc_ct_block_flow_offload_stats(struct mlx5_ct_ft *ft, · 31 unmodified lines
956977 if (!entry)
957978 return -ENOENT;
958979
959− mlx5_fc_query_cached(entry->shared_counter->counter, &bytes, &packets, &lastuse);
980+ mlx5_fc_query_cached(entry->counter->counter, &bytes, &packets, &lastuse);
960981 flow_stats_update(&f->stats, bytes, packets, 0, lastuse,
961982 FLOW_ACTION_HW_STATS_DELAYED);
962983
drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h+9−0
@@ -371,6 +371,15 @@ struct mlx5e_swp_spec { · 370 unmodified lines
371371 u8 tun_l4_proto;
372372 };
373373
374+static inline void mlx5e_eseg_swp_offsets_add_vlan(struct mlx5_wqe_eth_seg *eseg)
375+{
376+ /* SWP offsets are in 2-bytes words */
377+ eseg->swp_outer_l3_offset += VLAN_HLEN / 2;
378+ eseg->swp_outer_l4_offset += VLAN_HLEN / 2;
379+ eseg->swp_inner_l3_offset += VLAN_HLEN / 2;
380+ eseg->swp_inner_l4_offset += VLAN_HLEN / 2;
381+}
382+
374383 static inline void
375384 mlx5e_set_eseg_swp(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg,
376385 struct mlx5e_swp_spec *swp_spec)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h+5−3
@@ -51,7 +51,7 @@ static inline bool mlx5_geneve_tx_allowed(struct mlx5_core_dev *mdev) · 50 unmodified lines
5151 }
5252
5353 static inline void
54−mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
54+mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg, u16 ihs)
5555 {
5656 struct mlx5e_swp_spec swp_spec = {};
5757 unsigned int offset = 0;
@@ -85,6 +85,8 @@ mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg) · 27 unmodified lines
8585 }
8686
8787 mlx5e_set_eseg_swp(skb, eseg, &swp_spec);
88+ if (skb_vlan_tag_present(skb) && ihs)
89+ mlx5e_eseg_swp_offsets_add_vlan(eseg);
8890 }
8991
9092 #else
@@ -163,7 +165,7 @@ static inline unsigned int mlx5e_accel_tx_ids_len(struct mlx5e_txqsq *sq, · 72 unmodified lines
163165
164166 static inline bool mlx5e_accel_tx_eseg(struct mlx5e_priv *priv,
165167 struct sk_buff *skb,
166− struct mlx5_wqe_eth_seg *eseg)
168+ struct mlx5_wqe_eth_seg *eseg, u16 ihs)
167169 {
168170 #ifdef CONFIG_MLX5_EN_IPSEC
169171 if (xfrm_offload(skb))
@@ -172,7 +174,7 @@ static inline bool mlx5e_accel_tx_eseg(struct mlx5e_priv *priv, · 2 unmodified lines
172174
173175 #if IS_ENABLED(CONFIG_GENEVE)
174176 if (skb->encapsulation)
175− mlx5e_tx_tunnel_accel(skb, eseg);
177+ mlx5e_tx_tunnel_accel(skb, eseg, ihs);
176178 #endif
177179
178180 return true;
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+18−6
@@ -1010,6 +1010,22 @@ static int mlx5e_get_link_ksettings(struct net_device *netdev, · 1009 unmodified lines
10101010 return mlx5e_ethtool_get_link_ksettings(priv, link_ksettings);
10111011 }
10121012
1013+static int mlx5e_speed_validate(struct net_device *netdev, bool ext,
1014+ const unsigned long link_modes, u8 autoneg)
1015+{
1016+ /* Extended link-mode has no speed limitations. */
1017+ if (ext)
1018+ return 0;
1019+
1020+ if ((link_modes & MLX5E_PROT_MASK(MLX5E_56GBASE_R4)) &&
1021+ autoneg != AUTONEG_ENABLE) {
1022+ netdev_err(netdev, "%s: 56G link speed requires autoneg enabled\n",
1023+ __func__);
1024+ return -EINVAL;
1025+ }
1026+ return 0;
1027+}
1028+
10131029 static u32 mlx5e_ethtool2ptys_adver_link(const unsigned long *link_modes)
10141030 {
10151031 u32 i, ptys_modes = 0;
@@ -1103,13 +1119,9 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 87 unmodified lines
11031119 link_modes = autoneg == AUTONEG_ENABLE ? ethtool2ptys_adver_func(adver) :
11041120 mlx5e_port_speed2linkmodes(mdev, speed, !ext);
11051121
1106− if ((link_modes & MLX5E_PROT_MASK(MLX5E_56GBASE_R4)) &&
1107− autoneg != AUTONEG_ENABLE) {
1108− netdev_err(priv->netdev, "%s: 56G link speed requires autoneg enabled\n",
1109− __func__);
1110− err = -EINVAL;
1122+ err = mlx5e_speed_validate(priv->netdev, ext, link_modes, autoneg);
1123+ if (err)
11111124 goto out;
1112− }
11131125
11141126 link_modes = link_modes & eproto.cap;
11151127 if (!link_modes) {
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c+3−0
@@ -942,6 +942,7 @@ static int mlx5e_create_ttc_table_groups(struct mlx5e_ttc_table *ttc, · 941 unmodified lines
942942 in = kvzalloc(inlen, GFP_KERNEL);
943943 if (!in) {
944944 kfree(ft->g);
945+ ft->g = NULL;
945946 return -ENOMEM;
946947 }
947948
@@ -1087,6 +1088,7 @@ static int mlx5e_create_inner_ttc_table_groups(struct mlx5e_ttc_table *ttc) · 139 unmodified lines
10871088 in = kvzalloc(inlen, GFP_KERNEL);
10881089 if (!in) {
10891090 kfree(ft->g);
1091+ ft->g = NULL;
10901092 return -ENOMEM;
10911093 }
10921094
@@ -1390,6 +1392,7 @@ err_destroy_groups: · 297 unmodified lines
13901392 ft->g[ft->num_groups] = NULL;
13911393 mlx5e_destroy_groups(ft);
13921394 kvfree(in);
1395+ kfree(ft->g);
13931396
13941397 return err;
13951398 }
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+2−1
@@ -3161,7 +3161,8 @@ static void mlx5e_modify_admin_state(struct mlx5_core_dev *mdev, · 3160 unmodified lines
31613161
31623162 mlx5_set_port_admin_status(mdev, state);
31633163
3164− if (mlx5_eswitch_mode(mdev) != MLX5_ESWITCH_LEGACY)
3164+ if (mlx5_eswitch_mode(mdev) == MLX5_ESWITCH_OFFLOADS ||
3165+ !MLX5_CAP_GEN(mdev, uplink_follow))
31653166 return;
31663167
31673168 if (state == MLX5_PORT_UP)
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+5−4
@@ -682,9 +682,9 @@ void mlx5e_tx_mpwqe_ensure_complete(struct mlx5e_txqsq *sq) · 681 unmodified lines
682682
683683 static bool mlx5e_txwqe_build_eseg(struct mlx5e_priv *priv, struct mlx5e_txqsq *sq,
684684 struct sk_buff *skb, struct mlx5e_accel_tx_state *accel,
685− struct mlx5_wqe_eth_seg *eseg)
685+ struct mlx5_wqe_eth_seg *eseg, u16 ihs)
686686 {
687− if (unlikely(!mlx5e_accel_tx_eseg(priv, skb, eseg)))
687+ if (unlikely(!mlx5e_accel_tx_eseg(priv, skb, eseg, ihs)))
688688 return false;
689689
690690 mlx5e_txwqe_build_eseg_csum(sq, skb, accel, eseg);
@@ -714,7 +714,8 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev) · 23 unmodified lines
714714 if (mlx5e_tx_skb_supports_mpwqe(skb, &attr)) {
715715 struct mlx5_wqe_eth_seg eseg = {};
716716
717− if (unlikely(!mlx5e_txwqe_build_eseg(priv, sq, skb, &accel, &eseg)))
717+ if (unlikely(!mlx5e_txwqe_build_eseg(priv, sq, skb, &accel, &eseg,
718+ attr.ihs)))
718719 return NETDEV_TX_OK;
719720
720721 mlx5e_sq_xmit_mpwqe(sq, skb, &eseg, netdev_xmit_more());
@@ -731,7 +732,7 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev) · 10 unmodified lines
731732 /* May update the WQE, but may not post other WQEs. */
732733 mlx5e_accel_tx_finish(sq, wqe, &accel,
733734 (struct mlx5_wqe_inline_seg *)(wqe->data + wqe_attr.ds_cnt_inl));
734− if (unlikely(!mlx5e_txwqe_build_eseg(priv, sq, skb, &accel, &wqe->eth)))
735+ if (unlikely(!mlx5e_txwqe_build_eseg(priv, sq, skb, &accel, &wqe->eth, attr.ihs)))
735736 return NETDEV_TX_OK;
736737
737738 mlx5e_sq_xmit_wqe(sq, skb, &attr, &wqe_attr, wqe, pi, netdev_xmit_more());
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c+13−14
@@ -95,22 +95,21 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw, · 94 unmodified lines
9595 return 0;
9696 }
9797
98− if (!IS_ERR_OR_NULL(vport->egress.acl))
99− return 0;
100−
101− vport->egress.acl = esw_acl_table_create(esw, vport->vport,
102− MLX5_FLOW_NAMESPACE_ESW_EGRESS,
103− table_size);
104− if (IS_ERR(vport->egress.acl)) {
105− err = PTR_ERR(vport->egress.acl);
106− vport->egress.acl = NULL;
107− goto out;
98+ if (!vport->egress.acl) {
99+ vport->egress.acl = esw_acl_table_create(esw, vport->vport,
100+ MLX5_FLOW_NAMESPACE_ESW_EGRESS,
101+ table_size);
102+ if (IS_ERR(vport->egress.acl)) {
103+ err = PTR_ERR(vport->egress.acl);
104+ vport->egress.acl = NULL;
105+ goto out;
106+ }
107+
108+ err = esw_acl_egress_lgcy_groups_create(esw, vport);
109+ if (err)
110+ goto out;
108111 }
109112
110− err = esw_acl_egress_lgcy_groups_create(esw, vport);
111− if (err)
112− goto out;
113−
114113 esw_debug(esw->dev,
115114 "vport[%d] configure egress rules, vlan(%d) qos(%d)\n",
116115 vport->vport, vport->info.vlan, vport->info.qos);
drivers/net/ethernet/mellanox/mlx5/core/lag.c+5−6
@@ -564,7 +564,9 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev) · 563 unmodified lines
564564 struct mlx5_core_dev *tmp_dev;
565565 int i, err;
566566
567− if (!MLX5_CAP_GEN(dev, vport_group_manager))
567+ if (!MLX5_CAP_GEN(dev, vport_group_manager) ||
568+ !MLX5_CAP_GEN(dev, lag_master) ||
569+ MLX5_CAP_GEN(dev, num_lag_ports) != MLX5_MAX_PORTS)
568570 return;
569571
570572 tmp_dev = mlx5_get_next_phys_dev(dev);
@@ -582,12 +584,9 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev) · 11 unmodified lines
582584 if (mlx5_lag_dev_add_pf(ldev, dev, netdev) < 0)
583585 return;
584586
585− for (i = 0; i < MLX5_MAX_PORTS; i++) {
586− tmp_dev = ldev->pf[i].dev;
587− if (!tmp_dev || !MLX5_CAP_GEN(tmp_dev, lag_master) ||
588− MLX5_CAP_GEN(tmp_dev, num_lag_ports) != MLX5_MAX_PORTS)
587+ for (i = 0; i < MLX5_MAX_PORTS; i++)
588+ if (!ldev->pf[i].dev)
589589 break;
590− }
591590
592591 if (i >= MLX5_MAX_PORTS)
593592 ldev->flags |= MLX5_LAG_FLAG_READY;
drivers/net/ethernet/mellanox/mlx5/core/main.c+5−2
@@ -1368,8 +1368,10 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 1367 unmodified lines
13681368 MLX5_COREDEV_VF : MLX5_COREDEV_PF;
13691369
13701370 dev->priv.adev_idx = mlx5_adev_idx_alloc();
1371− if (dev->priv.adev_idx < 0)
1372− return dev->priv.adev_idx;
1371+ if (dev->priv.adev_idx < 0) {
1372+ err = dev->priv.adev_idx;
1373+ goto adev_init_err;
1374+ }
13731375
13741376 err = mlx5_mdev_init(dev, prof_sel);
13751377 if (err)
@@ -1403,6 +1405,7 @@ pci_init_err: · 27 unmodified lines
14031405 mlx5_mdev_uninit(dev);
14041406 mdev_init_err:
14051407 mlx5_adev_idx_free(dev->priv.adev_idx);
1408+adev_init_err:
14061409 mlx5_devlink_free(devlink);
14071410
14081411 return err;
drivers/net/ethernet/mellanox/mlx5/core/rdma.c+1−1
@@ -116,7 +116,7 @@ free: · 115 unmodified lines
116116 static void mlx5_rdma_del_roce_addr(struct mlx5_core_dev *dev)
117117 {
118118 mlx5_core_roce_gid_set(dev, 0, 0, 0,
119− NULL, NULL, false, 0, 0);
119+ NULL, NULL, false, 0, 1);
120120 }
121121
122122 static void mlx5_rdma_make_default_gid(struct mlx5_core_dev *dev, union ib_gid *gid)
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c+8−5
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #define MLXSW_THERMAL_ASIC_TEMP_NORM 75000 /* 75C */
2020 #define MLXSW_THERMAL_ASIC_TEMP_HIGH 85000 /* 85C */
2121 #define MLXSW_THERMAL_ASIC_TEMP_HOT 105000 /* 105C */
22−#define MLXSW_THERMAL_ASIC_TEMP_CRIT 110000 /* 110C */
22+#define MLXSW_THERMAL_ASIC_TEMP_CRIT 140000 /* 140C */
2323 #define MLXSW_THERMAL_HYSTERESIS_TEMP 5000 /* 5C */
2424 #define MLXSW_THERMAL_MODULE_TEMP_SHIFT (MLXSW_THERMAL_HYSTERESIS_TEMP * 2)
2525 #define MLXSW_THERMAL_ZONE_MAX_NAME 16
@@ -176,6 +176,12 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, · 150 unmodified lines
176176 if (err)
177177 return err;
178178
179+ if (crit_temp > emerg_temp) {
180+ dev_warn(dev, "%s : Critical threshold %d is above emergency threshold %d\n",
181+ tz->tzdev->type, crit_temp, emerg_temp);
182+ return 0;
183+ }
184+
179185 /* According to the system thermal requirements, the thermal zones are
180186 * defined with four trip points. The critical and emergency
181187 * temperature thresholds, provided by QSFP module are set as "active"
@@ -190,11 +196,8 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, · 8 unmodified lines
190196 tz->trips[MLXSW_THERMAL_TEMP_TRIP_NORM].temp = crit_temp;
191197 tz->trips[MLXSW_THERMAL_TEMP_TRIP_HIGH].temp = crit_temp;
192198 tz->trips[MLXSW_THERMAL_TEMP_TRIP_HOT].temp = emerg_temp;
193− if (emerg_temp > crit_temp)
194− tz->trips[MLXSW_THERMAL_TEMP_TRIP_CRIT].temp = emerg_temp +
199+ tz->trips[MLXSW_THERMAL_TEMP_TRIP_CRIT].temp = emerg_temp +
195200 MLXSW_THERMAL_MODULE_TEMP_SHIFT;
196− else
197− tz->trips[MLXSW_THERMAL_TEMP_TRIP_CRIT].temp = emerg_temp;
198201
199202 return 0;
200203 }
drivers/net/ethernet/natsemi/macsonic.c+10−2
@@ -506,10 +506,14 @@ static int mac_sonic_platform_probe(struct platform_device *pdev) · 505 unmodified lines
506506
507507 err = register_netdev(dev);
508508 if (err)
509− goto out;
509+ goto undo_probe;
510510
511511 return 0;
512512
513+undo_probe:
514+ dma_free_coherent(lp->device,
515+ SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
516+ lp->descriptors, lp->descriptors_laddr);
513517 out:
514518 free_netdev(dev);
515519
@@ -584,12 +588,16 @@ static int mac_sonic_nubus_probe(struct nubus_board *board) · 68 unmodified lines
584588
585589 err = register_netdev(ndev);
586590 if (err)
587− goto out;
591+ goto undo_probe;
588592
589593 nubus_set_drvdata(board, ndev);
590594
591595 return 0;
592596
597+undo_probe:
598+ dma_free_coherent(lp->device,
599+ SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
600+ lp->descriptors, lp->descriptors_laddr);
593601 out:
594602 free_netdev(ndev);
595603 return err;
drivers/net/ethernet/natsemi/xtsonic.c+5−2
@@ -229,11 +229,14 @@ int xtsonic_probe(struct platform_device *pdev) · 228 unmodified lines
229229 sonic_msg_init(dev);
230230
231231 if ((err = register_netdev(dev)))
232− goto out1;
232+ goto undo_probe1;
233233
234234 return 0;
235235
236−out1:
236+undo_probe1:
237+ dma_free_coherent(lp->device,
238+ SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
239+ lp->descriptors, lp->descriptors_laddr);
237240 release_region(dev->base_addr, SONIC_MEM_SIZE);
238241 out:
239242 free_netdev(dev);
drivers/net/ethernet/pensando/ionic/ionic_txrx.c+1−1
@@ -337,7 +337,7 @@ void ionic_rx_fill(struct ionic_queue *q) · 336 unmodified lines
337337 unsigned int i, j;
338338 unsigned int len;
339339
340− len = netdev->mtu + ETH_HLEN;
340+ len = netdev->mtu + ETH_HLEN + VLAN_HLEN;
341341 nfrags = round_up(len, PAGE_SIZE) / PAGE_SIZE;
342342
343343 for (i = ionic_q_space_avail(q); i; i--) {
drivers/net/ethernet/qlogic/Kconfig+1−0
@@ -78,6 +78,7 @@ config QED · 77 unmodified lines
7878 depends on PCI
7979 select ZLIB_INFLATE
8080 select CRC8
81+ select CRC32
8182 select NET_DEVLINK
8283 help
8384 This enables the support for Marvell FastLinQ adapters family.
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c+1−6
@@ -564,11 +564,6 @@ static const struct net_device_ops netxen_netdev_ops = { · 563 unmodified lines
564564 .ndo_set_features = netxen_set_features,
565565 };
566566
567−static inline bool netxen_function_zero(struct pci_dev *pdev)
568−{
569− return (PCI_FUNC(pdev->devfn) == 0) ? true : false;
570−}
571−
572567 static inline void netxen_set_interrupt_mode(struct netxen_adapter *adapter,
573568 u32 mode)
574569 {
@@ -664,7 +659,7 @@ static int netxen_setup_intr(struct netxen_adapter *adapter) · 89 unmodified lines
664659 netxen_initialize_interrupt_registers(adapter);
665660 netxen_set_msix_bit(pdev, 0);
666661
667− if (netxen_function_zero(pdev)) {
662+ if (adapter->portnum == 0) {
668663 if (!netxen_setup_msi_interrupts(adapter, num_msix))
669664 netxen_set_interrupt_mode(adapter, NETXEN_MSI_MODE);
670665 else
drivers/net/ethernet/qlogic/qede/qede_fp.c+5−0
@@ -1799,6 +1799,11 @@ netdev_features_t qede_features_check(struct sk_buff *skb, · 1798 unmodified lines
17991799 ntohs(udp_hdr(skb)->dest) != gnv_port))
18001800 return features & ~(NETIF_F_CSUM_MASK |
18011801 NETIF_F_GSO_MASK);
1802+ } else if (l4_proto == IPPROTO_IPIP) {
1803+ /* IPIP tunnels are unknown to the device or at least unsupported natively,
1804+ * offloads for them can't be done trivially, so disable them for such skb.
1805+ */
1806+ return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
18021807 }
18031808 }
18041809
drivers/net/ethernet/realtek/r8169_main.c+4−2
@@ -2207,7 +2207,8 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) · 2206 unmodified lines
22072207 }
22082208
22092209 switch (tp->mac_version) {
2210− case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_33:
2210+ case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26:
2211+ case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33:
22112212 case RTL_GIGA_MAC_VER_37:
22122213 case RTL_GIGA_MAC_VER_39:
22132214 case RTL_GIGA_MAC_VER_43:
@@ -2233,7 +2234,8 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) · 19 unmodified lines
22332234 static void rtl_pll_power_up(struct rtl8169_private *tp)
22342235 {
22352236 switch (tp->mac_version) {
2236− case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_33:
2237+ case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26:
2238+ case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33:
22372239 case RTL_GIGA_MAC_VER_37:
22382240 case RTL_GIGA_MAC_VER_39:
22392241 case RTL_GIGA_MAC_VER_43:
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c+4−0
@@ -721,6 +721,8 @@ static SIMPLE_DEV_PM_OPS(intel_eth_pm_ops, intel_eth_pci_suspend, · 720 unmodified lines
721721 #define PCI_DEVICE_ID_INTEL_EHL_PSE1_RGMII1G_ID 0x4bb0
722722 #define PCI_DEVICE_ID_INTEL_EHL_PSE1_SGMII1G_ID 0x4bb1
723723 #define PCI_DEVICE_ID_INTEL_EHL_PSE1_SGMII2G5_ID 0x4bb2
724+#define PCI_DEVICE_ID_INTEL_TGLH_SGMII1G_0_ID 0x43ac
725+#define PCI_DEVICE_ID_INTEL_TGLH_SGMII1G_1_ID 0x43a2
724726 #define PCI_DEVICE_ID_INTEL_TGL_SGMII1G_ID 0xa0ac
725727
726728 static const struct pci_device_id intel_eth_pci_id_table[] = {
@@ -735,6 +737,8 @@ static const struct pci_device_id intel_eth_pci_id_table[] = { · 8 unmodified lines
735737 { PCI_DEVICE_DATA(INTEL, EHL_PSE1_SGMII1G_ID, &ehl_pse1_sgmii1g_info) },
736738 { PCI_DEVICE_DATA(INTEL, EHL_PSE1_SGMII2G5_ID, &ehl_pse1_sgmii1g_info) },
737739 { PCI_DEVICE_DATA(INTEL, TGL_SGMII1G_ID, &tgl_sgmii1g_info) },
740+ { PCI_DEVICE_DATA(INTEL, TGLH_SGMII1G_0_ID, &tgl_sgmii1g_info) },
741+ { PCI_DEVICE_DATA(INTEL, TGLH_SGMII1G_1_ID, &tgl_sgmii1g_info) },
738742 {}
739743 };
740744 MODULE_DEVICE_TABLE(pci, intel_eth_pci_id_table);
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c+1−1
@@ -135,7 +135,7 @@ static int meson8b_init_rgmii_tx_clk(struct meson8b_dwmac *dwmac) · 134 unmodified lines
135135 struct device *dev = dwmac->dev;
136136 static const struct clk_parent_data mux_parents[] = {
137137 { .fw_name = "clkin0", },
138− { .fw_name = "clkin1", },
138+ { .index = -1, },
139139 };
140140 static const struct clk_div_table div_table[] = {
141141 { .div = 2, .val = 2, },
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c+82−47
@@ -64,6 +64,7 @@ struct emac_variant { · 63 unmodified lines
6464 * @variant: reference to the current board variant
6565 * @regmap: regmap for using the syscon
6666 * @internal_phy_powered: Does the internal PHY is enabled
67+ * @use_internal_phy: Is the internal PHY selected for use
6768 * @mux_handle: Internal pointer used by mdio-mux lib
6869 */
6970 struct sunxi_priv_data {
@@ -74,6 +75,7 @@ struct sunxi_priv_data { · 4 unmodified lines
7475 const struct emac_variant *variant;
7576 struct regmap_field *regmap_field;
7677 bool internal_phy_powered;
78+ bool use_internal_phy;
7779 void *mux_handle;
7880 };
7981
@@ -539,8 +541,11 @@ static const struct stmmac_dma_ops sun8i_dwmac_dma_ops = { · 459 unmodified lines
539541 .dma_interrupt = sun8i_dwmac_dma_interrupt,
540542 };
541543
544+static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv);
545+
542546 static int sun8i_dwmac_init(struct platform_device *pdev, void *priv)
543547 {
548+ struct net_device *ndev = platform_get_drvdata(pdev);
544549 struct sunxi_priv_data *gmac = priv;
545550 int ret;
546551
@@ -554,13 +559,25 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) · 7 unmodified lines
554559
555560 ret = clk_prepare_enable(gmac->tx_clk);
556561 if (ret) {
557− if (gmac->regulator)
558− regulator_disable(gmac->regulator);
559562 dev_err(&pdev->dev, "Could not enable AHB clock\n");
560− return ret;
563+ goto err_disable_regulator;
564+ }
565+
566+ if (gmac->use_internal_phy) {
567+ ret = sun8i_dwmac_power_internal_phy(netdev_priv(ndev));
568+ if (ret)
569+ goto err_disable_clk;
561570 }
562571
563572 return 0;
573+
574+err_disable_clk:
575+ clk_disable_unprepare(gmac->tx_clk);
576+err_disable_regulator:
577+ if (gmac->regulator)
578+ regulator_disable(gmac->regulator);
579+
580+ return ret;
564581 }
565582
566583 static void sun8i_dwmac_core_init(struct mac_device_info *hw,
@@ -831,7 +848,6 @@ static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, · 264 unmodified lines
831848 struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
832849 u32 reg, val;
833850 int ret = 0;
834− bool need_power_ephy = false;
835851
836852 if (current_child ^ desired_child) {
837853 regmap_field_read(gmac->regmap_field, &reg);
@@ -839,13 +855,12 @@ static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, · 1 unmodified line
839855 case DWMAC_SUN8I_MDIO_MUX_INTERNAL_ID:
840856 dev_info(priv->device, "Switch mux to internal PHY");
841857 val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SELECT;
842−
843− need_power_ephy = true;
858+ gmac->use_internal_phy = true;
844859 break;
845860 case DWMAC_SUN8I_MDIO_MUX_EXTERNAL_ID:
846861 dev_info(priv->device, "Switch mux to external PHY");
847862 val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SHUTDOWN;
848− need_power_ephy = false;
863+ gmac->use_internal_phy = false;
849864 break;
850865 default:
851866 dev_err(priv->device, "Invalid child ID %x\n",
@@ -853,7 +868,7 @@ static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, · 1 unmodified line
853868 return -EINVAL;
854869 }
855870 regmap_field_write(gmac->regmap_field, val);
856− if (need_power_ephy) {
871+ if (gmac->use_internal_phy) {
857872 ret = sun8i_dwmac_power_internal_phy(priv);
858873 if (ret)
859874 return ret;
@@ -883,22 +898,23 @@ static int sun8i_dwmac_register_mdio_mux(struct stmmac_priv *priv) · 23 unmodified lines
883898 return ret;
884899 }
885900
886−static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
901+static int sun8i_dwmac_set_syscon(struct device *dev,
902+ struct plat_stmmacenet_data *plat)
887903 {
888− struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
889− struct device_node *node = priv->device->of_node;
904+ struct sunxi_priv_data *gmac = plat->bsp_priv;
905+ struct device_node *node = dev->of_node;
890906 int ret;
891907 u32 reg, val;
892908
893909 ret = regmap_field_read(gmac->regmap_field, &val);
894910 if (ret) {
895− dev_err(priv->device, "Fail to read from regmap field.\n");
911+ dev_err(dev, "Fail to read from regmap field.\n");
896912 return ret;
897913 }
898914
899915 reg = gmac->variant->default_syscon_value;
900916 if (reg != val)
901− dev_warn(priv->device,
917+ dev_warn(dev,
902918 "Current syscon value is not the default %x (expect %x)\n",
903919 val, reg);
904920
@@ -911,9 +927,9 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) · 6 unmodified lines
911927 /* Force EPHY xtal frequency to 24MHz. */
912928 reg |= H3_EPHY_CLK_SEL;
913929
914− ret = of_mdio_parse_addr(priv->device, priv->plat->phy_node);
930+ ret = of_mdio_parse_addr(dev, plat->phy_node);
915931 if (ret < 0) {
916− dev_err(priv->device, "Could not parse MDIO addr\n");
932+ dev_err(dev, "Could not parse MDIO addr\n");
917933 return ret;
918934 }
919935 /* of_mdio_parse_addr returns a valid (0 ~ 31) PHY
@@ -929,17 +945,17 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) · 9 unmodified lines
929945
930946 if (!of_property_read_u32(node, "allwinner,tx-delay-ps", &val)) {
931947 if (val % 100) {
932− dev_err(priv->device, "tx-delay must be a multiple of 100\n");
948+ dev_err(dev, "tx-delay must be a multiple of 100\n");
933949 return -EINVAL;
934950 }
935951 val /= 100;
936− dev_dbg(priv->device, "set tx-delay to %x\n", val);
952+ dev_dbg(dev, "set tx-delay to %x\n", val);
937953 if (val <= gmac->variant->tx_delay_max) {
938954 reg &= ~(gmac->variant->tx_delay_max <<
939955 SYSCON_ETXDC_SHIFT);
940956 reg |= (val << SYSCON_ETXDC_SHIFT);
941957 } else {
942− dev_err(priv->device, "Invalid TX clock delay: %d\n",
958+ dev_err(dev, "Invalid TX clock delay: %d\n",
943959 val);
944960 return -EINVAL;
945961 }
@@ -947,17 +963,17 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) · 1 unmodified line
947963
948964 if (!of_property_read_u32(node, "allwinner,rx-delay-ps", &val)) {
949965 if (val % 100) {
950− dev_err(priv->device, "rx-delay must be a multiple of 100\n");
966+ dev_err(dev, "rx-delay must be a multiple of 100\n");
951967 return -EINVAL;
952968 }
953969 val /= 100;
954− dev_dbg(priv->device, "set rx-delay to %x\n", val);
970+ dev_dbg(dev, "set rx-delay to %x\n", val);
955971 if (val <= gmac->variant->rx_delay_max) {
956972 reg &= ~(gmac->variant->rx_delay_max <<
957973 SYSCON_ERXDC_SHIFT);
958974 reg |= (val << SYSCON_ERXDC_SHIFT);
959975 } else {
960− dev_err(priv->device, "Invalid RX clock delay: %d\n",
976+ dev_err(dev, "Invalid RX clock delay: %d\n",
961977 val);
962978 return -EINVAL;
963979 }
@@ -968,7 +984,7 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) · 4 unmodified lines
968984 if (gmac->variant->support_rmii)
969985 reg &= ~SYSCON_RMII_EN;
970986
971− switch (priv->plat->interface) {
987+ switch (plat->interface) {
972988 case PHY_INTERFACE_MODE_MII:
973989 /* default */
974990 break;
@@ -982,8 +998,8 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) · 7 unmodified lines
982998 reg |= SYSCON_RMII_EN | SYSCON_ETCS_EXT_GMII;
983999 break;
9841000 default:
985− dev_err(priv->device, "Unsupported interface mode: %s",
986− phy_modes(priv->plat->interface));
1001+ dev_err(dev, "Unsupported interface mode: %s",
1002+ phy_modes(plat->interface));
9871003 return -EINVAL;
9881004 }
9891005
@@ -1004,17 +1020,10 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) · 14 unmodified lines
10041020 struct sunxi_priv_data *gmac = priv;
10051021
10061022 if (gmac->variant->soc_has_internal_phy) {
1007− /* sun8i_dwmac_exit could be called with mdiomux uninit */
1008− if (gmac->mux_handle)
1009− mdio_mux_uninit(gmac->mux_handle);
10101023 if (gmac->internal_phy_powered)
10111024 sun8i_dwmac_unpower_internal_phy(gmac);
10121025 }
10131026
1014− sun8i_dwmac_unset_syscon(gmac);
1015−
1016− reset_control_put(gmac->rst_ephy);
1017−
10181027 clk_disable_unprepare(gmac->tx_clk);
10191028
10201029 if (gmac->regulator)
@@ -1049,16 +1058,11 @@ static struct mac_device_info *sun8i_dwmac_setup(void *ppriv) · 28 unmodified lines
10491058 {
10501059 struct mac_device_info *mac;
10511060 struct stmmac_priv *priv = ppriv;
1052− int ret;
10531061
10541062 mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL);
10551063 if (!mac)
10561064 return NULL;
10571065
1058− ret = sun8i_dwmac_set_syscon(priv);
1059− if (ret)
1060− return NULL;
1061−
10621066 mac->pcsr = priv->ioaddr;
10631067 mac->mac = &sun8i_dwmac_ops;
10641068 mac->dma = &sun8i_dwmac_dma_ops;
@@ -1134,10 +1138,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) · 69 unmodified lines
11341138 if (ret)
11351139 return ret;
11361140
1137− plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
1138− if (IS_ERR(plat_dat))
1139− return PTR_ERR(plat_dat);
1140−
11411141 gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
11421142 if (!gmac)
11431143 return -ENOMEM;
@@ -1201,11 +1201,15 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) · 57 unmodified lines
12011201 ret = of_get_phy_mode(dev->of_node, &interface);
12021202 if (ret)
12031203 return -EINVAL;
1204− plat_dat->interface = interface;
1204+
1205+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
1206+ if (IS_ERR(plat_dat))
1207+ return PTR_ERR(plat_dat);
12051208
12061209 /* platform data specifying hardware features and callbacks.
12071210 * hardware features were copied from Allwinner drivers.
12081211 */
1212+ plat_dat->interface = interface;
12091213 plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
12101214 plat_dat->tx_coe = 1;
12111215 plat_dat->has_sun8i = true;
@@ -1214,9 +1218,13 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) · 2 unmodified lines
12141218 plat_dat->exit = sun8i_dwmac_exit;
12151219 plat_dat->setup = sun8i_dwmac_setup;
12161220
1221+ ret = sun8i_dwmac_set_syscon(&pdev->dev, plat_dat);
1222+ if (ret)
1223+ goto dwmac_deconfig;
1224+
12171225 ret = sun8i_dwmac_init(pdev, plat_dat->bsp_priv);
12181226 if (ret)
1219− return ret;
1227+ goto dwmac_syscon;
12201228
12211229 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
12221230 if (ret)
@@ -1230,7 +1238,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) · 7 unmodified lines
12301238 if (gmac->variant->soc_has_internal_phy) {
12311239 ret = get_ephy_nodes(priv);
12321240 if (ret)
1233− goto dwmac_exit;
1241+ goto dwmac_remove;
12341242 ret = sun8i_dwmac_register_mdio_mux(priv);
12351243 if (ret) {
12361244 dev_err(&pdev->dev, "Failed to register mux\n");
@@ -1239,15 +1247,42 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) · 2 unmodified lines
12391247 } else {
12401248 ret = sun8i_dwmac_reset(priv);
12411249 if (ret)
1242− goto dwmac_exit;
1250+ goto dwmac_remove;
12431251 }
12441252
12451253 return ret;
12461254 dwmac_mux:
1247− sun8i_dwmac_unset_syscon(gmac);
1255+ reset_control_put(gmac->rst_ephy);
1256+ clk_put(gmac->ephy_clk);
1257+dwmac_remove:
1258+ stmmac_dvr_remove(&pdev->dev);
12481259 dwmac_exit:
1260+ sun8i_dwmac_exit(pdev, gmac);
1261+dwmac_syscon:
1262+ sun8i_dwmac_unset_syscon(gmac);
1263+dwmac_deconfig:
1264+ stmmac_remove_config_dt(pdev, plat_dat);
1265+
1266+ return ret;
1267+}
1268+
1269+static int sun8i_dwmac_remove(struct platform_device *pdev)
1270+{
1271+ struct net_device *ndev = platform_get_drvdata(pdev);
1272+ struct stmmac_priv *priv = netdev_priv(ndev);
1273+ struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
1274+
1275+ if (gmac->variant->soc_has_internal_phy) {
1276+ mdio_mux_uninit(gmac->mux_handle);
1277+ sun8i_dwmac_unpower_internal_phy(gmac);
1278+ reset_control_put(gmac->rst_ephy);
1279+ clk_put(gmac->ephy_clk);
1280+ }
1281+
12491282 stmmac_pltfr_remove(pdev);
1250−return ret;
1283+ sun8i_dwmac_unset_syscon(gmac);
1284+
1285+ return 0;
12511286 }
12521287
12531288 static const struct of_device_id sun8i_dwmac_match[] = {
@@ -1269,7 +1304,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); · 15 unmodified lines
12691304
12701305 static struct platform_driver sun8i_dwmac_driver = {
12711306 .probe = sun8i_dwmac_probe,
1272− .remove = stmmac_pltfr_remove,
1307+ .remove = sun8i_dwmac_remove,
12731308 .driver = {
12741309 .name = "dwmac-sun8i",
12751310 .pm = &stmmac_pltfr_pm_ops,
drivers/net/ethernet/stmicro/stmmac/dwmac5.c+4−48
@@ -568,68 +568,24 @@ static int dwmac5_est_write(void __iomem *ioaddr, u32 reg, u32 val, bool gcl) · 567 unmodified lines
568568 int dwmac5_est_configure(void __iomem *ioaddr, struct stmmac_est *cfg,
569569 unsigned int ptp_rate)
570570 {
571− u32 speed, total_offset, offset, ctrl, ctr_low;
572− u32 extcfg = readl(ioaddr + GMAC_EXT_CONFIG);
573− u32 mac_cfg = readl(ioaddr + GMAC_CONFIG);
574571 int i, ret = 0x0;
575− u64 total_ctr;
576−
577− if (extcfg & GMAC_CONFIG_EIPG_EN) {
578− offset = (extcfg & GMAC_CONFIG_EIPG) >> GMAC_CONFIG_EIPG_SHIFT;
579− offset = 104 + (offset * 8);
580− } else {
581− offset = (mac_cfg & GMAC_CONFIG_IPG) >> GMAC_CONFIG_IPG_SHIFT;
582− offset = 96 - (offset * 8);
583− }
584−
585− speed = mac_cfg & (GMAC_CONFIG_PS | GMAC_CONFIG_FES);
586− speed = speed >> GMAC_CONFIG_FES_SHIFT;
587−
588− switch (speed) {
589− case 0x0:
590− offset = offset * 1000; /* 1G */
591− break;
592− case 0x1:
593− offset = offset * 400; /* 2.5G */
594− break;
595− case 0x2:
596− offset = offset * 100000; /* 10M */
597− break;
598− case 0x3:
599− offset = offset * 10000; /* 100M */
600− break;
601− default:
602− return -EINVAL;
603− }
604−
605− offset = offset / 1000;
572+ u32 ctrl;
606573
607574 ret |= dwmac5_est_write(ioaddr, BTR_LOW, cfg->btr[0], false);
608575 ret |= dwmac5_est_write(ioaddr, BTR_HIGH, cfg->btr[1], false);
609576 ret |= dwmac5_est_write(ioaddr, TER, cfg->ter, false);
610577 ret |= dwmac5_est_write(ioaddr, LLR, cfg->gcl_size, false);
578+ ret |= dwmac5_est_write(ioaddr, CTR_LOW, cfg->ctr[0], false);
579+ ret |= dwmac5_est_write(ioaddr, CTR_HIGH, cfg->ctr[1], false);
611580 if (ret)
612581 return ret;
613582
614− total_offset = 0;
615583 for (i = 0; i < cfg->gcl_size; i++) {
616− ret = dwmac5_est_write(ioaddr, i, cfg->gcl[i] + offset, true);
584+ ret = dwmac5_est_write(ioaddr, i, cfg->gcl[i], true);
617585 if (ret)
618586 return ret;
619−
620− total_offset += offset;
621587 }
622588
623− total_ctr = cfg->ctr[0] + cfg->ctr[1] * 1000000000ULL;
624− total_ctr += total_offset;
625−
626− ctr_low = do_div(total_ctr, 1000000000);
627−
628− ret |= dwmac5_est_write(ioaddr, CTR_LOW, ctr_low, false);
629− ret |= dwmac5_est_write(ioaddr, CTR_HIGH, total_ctr, false);
630− if (ret)
631− return ret;
632−
633589 ctrl = readl(ioaddr + MTL_EST_CONTROL);
634590 ctrl &= ~PTOV;
635591 ctrl |= ((1000000000 / ptp_rate) * 6) << PTOV_SHIFT;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+4−3
@@ -2184,7 +2184,7 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan) · 2183 unmodified lines
21842184 spin_lock_irqsave(&ch->lock, flags);
21852185 stmmac_disable_dma_irq(priv, priv->ioaddr, chan, 1, 0);
21862186 spin_unlock_irqrestore(&ch->lock, flags);
2187− __napi_schedule_irqoff(&ch->rx_napi);
2187+ __napi_schedule(&ch->rx_napi);
21882188 }
21892189 }
21902190
@@ -2193,7 +2193,7 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan) · 2 unmodified lines
21932193 spin_lock_irqsave(&ch->lock, flags);
21942194 stmmac_disable_dma_irq(priv, priv->ioaddr, chan, 0, 1);
21952195 spin_unlock_irqrestore(&ch->lock, flags);
2196− __napi_schedule_irqoff(&ch->tx_napi);
2196+ __napi_schedule(&ch->tx_napi);
21972197 }
21982198 }
21992199
@@ -4026,6 +4026,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) · 1826 unmodified lines
40264026 {
40274027 struct stmmac_priv *priv = netdev_priv(dev);
40284028 int txfifosz = priv->plat->tx_fifo_size;
4029+ const int mtu = new_mtu;
40294030
40304031 if (txfifosz == 0)
40314032 txfifosz = priv->dma_cap.tx_fifo_size;
@@ -4043,7 +4044,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) · 11 unmodified lines
40434044 if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
40444045 return -EINVAL;
40454046
4046− dev->mtu = new_mtu;
4047+ dev->mtu = mtu;
40474048
40484049 netdev_update_features(dev);
40494050
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+18−2
@@ -599,7 +599,8 @@ static int tc_setup_taprio(struct stmmac_priv *priv, · 598 unmodified lines
599599 {
600600 u32 size, wid = priv->dma_cap.estwid, dep = priv->dma_cap.estdep;
601601 struct plat_stmmacenet_data *plat = priv->plat;
602− struct timespec64 time;
602+ struct timespec64 time, current_time;
603+ ktime_t current_time_ns;
603604 bool fpe = false;
604605 int i, ret = 0;
605606 u64 ctr;
@@ -694,7 +695,22 @@ static int tc_setup_taprio(struct stmmac_priv *priv, · 88 unmodified lines
694695 }
695696
696697 /* Adjust for real system time */
697− time = ktime_to_timespec64(qopt->base_time);
698+ priv->ptp_clock_ops.gettime64(&priv->ptp_clock_ops, &current_time);
699+ current_time_ns = timespec64_to_ktime(current_time);
700+ if (ktime_after(qopt->base_time, current_time_ns)) {
701+ time = ktime_to_timespec64(qopt->base_time);
702+ } else {
703+ ktime_t base_time;
704+ s64 n;
705+
706+ n = div64_s64(ktime_sub_ns(current_time_ns, qopt->base_time),
707+ qopt->cycle_time);
708+ base_time = ktime_add_ns(qopt->base_time,
709+ (n + 1) * qopt->cycle_time);
710+
711+ time = ktime_to_timespec64(base_time);
712+ }
713+
698714 priv->plat->est->btr[0] = (u32)time.tv_nsec;
699715 priv->plat->est->btr[1] = (u32)time.tv_sec;
700716
drivers/net/ethernet/ti/cpts.c+2−0
@@ -599,6 +599,7 @@ void cpts_unregister(struct cpts *cpts) · 598 unmodified lines
599599
600600 ptp_clock_unregister(cpts->clock);
601601 cpts->clock = NULL;
602+ cpts->phc_index = -1;
602603
603604 cpts_write32(cpts, 0, int_enable);
604605 cpts_write32(cpts, 0, control);
@@ -784,6 +785,7 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs, · 179 unmodified lines
784785 cpts->cc.read = cpts_systim_read;
785786 cpts->cc.mask = CLOCKSOURCE_MASK(32);
786787 cpts->info = cpts_info;
788+ cpts->phc_index = -1;
787789
788790 if (n_ext_ts)
789791 cpts->info.n_ext_ts = n_ext_ts;
drivers/net/ipa/gsi.c+69−58
@@ -326,8 +326,8 @@ gsi_evt_ring_state(struct gsi *gsi, u32 evt_ring_id) · 325 unmodified lines
326326 }
327327
328328 /* Issue an event ring command and wait for it to complete */
329−static int evt_ring_command(struct gsi *gsi, u32 evt_ring_id,
330− enum gsi_evt_cmd_opcode opcode)
329+static void evt_ring_command(struct gsi *gsi, u32 evt_ring_id,
330+ enum gsi_evt_cmd_opcode opcode)
331331 {
332332 struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
333333 struct completion *completion = &evt_ring->completion;
@@ -340,7 +340,13 @@ static int evt_ring_command(struct gsi *gsi, u32 evt_ring_id, · 6 unmodified lines
340340 * is issued here. Only permit *this* event ring to trigger
341341 * an interrupt, and only enable the event control IRQ type
342342 * when we expect it to occur.
343+ *
344+ * There's a small chance that a previous command completed
345+ * after the interrupt was disabled, so make sure we have no
346+ * pending interrupts before we enable them.
343347 */
348+ iowrite32(~0, gsi->virt + GSI_CNTXT_SRC_EV_CH_IRQ_CLR_OFFSET);
349+
344350 val = BIT(evt_ring_id);
345351 iowrite32(val, gsi->virt + GSI_CNTXT_SRC_EV_CH_IRQ_MSK_OFFSET);
346352 gsi_irq_type_enable(gsi, GSI_EV_CTRL);
@@ -355,19 +361,16 @@ static int evt_ring_command(struct gsi *gsi, u32 evt_ring_id, · 8 unmodified lines
355361 iowrite32(0, gsi->virt + GSI_CNTXT_SRC_EV_CH_IRQ_MSK_OFFSET);
356362
357363 if (success)
358− return 0;
364+ return;
359365
360366 dev_err(dev, "GSI command %u for event ring %u timed out, state %u\n",
361367 opcode, evt_ring_id, evt_ring->state);
362−
363− return -ETIMEDOUT;
364368 }
365369
366370 /* Allocate an event ring in NOT_ALLOCATED state */
367371 static int gsi_evt_ring_alloc_command(struct gsi *gsi, u32 evt_ring_id)
368372 {
369373 struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
370− int ret;
371374
372375 /* Get initial event ring state */
373376 evt_ring->state = gsi_evt_ring_state(gsi, evt_ring_id);
@@ -377,14 +380,16 @@ static int gsi_evt_ring_alloc_command(struct gsi *gsi, u32 evt_ring_id) · 3 unmodified lines
377380 return -EINVAL;
378381 }
379382
380− ret = evt_ring_command(gsi, evt_ring_id, GSI_EVT_ALLOCATE);
381− if (!ret && evt_ring->state != GSI_EVT_RING_STATE_ALLOCATED) {
382− dev_err(gsi->dev, "event ring %u bad state %u after alloc\n",
383− evt_ring_id, evt_ring->state);
384− ret = -EIO;
385− }
383+ evt_ring_command(gsi, evt_ring_id, GSI_EVT_ALLOCATE);
386384
387− return ret;
385+ /* If successful the event ring state will have changed */
386+ if (evt_ring->state == GSI_EVT_RING_STATE_ALLOCATED)
387+ return 0;
388+
389+ dev_err(gsi->dev, "event ring %u bad state %u after alloc\n",
390+ evt_ring_id, evt_ring->state);
391+
392+ return -EIO;
388393 }
389394
390395 /* Reset a GSI event ring in ALLOCATED or ERROR state. */
@@ -392,7 +397,6 @@ static void gsi_evt_ring_reset_command(struct gsi *gsi, u32 evt_ring_id) · 1 unmodified line
392397 {
393398 struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
394399 enum gsi_evt_ring_state state = evt_ring->state;
395− int ret;
396400
397401 if (state != GSI_EVT_RING_STATE_ALLOCATED &&
398402 state != GSI_EVT_RING_STATE_ERROR) {
@@ -401,17 +405,20 @@ static void gsi_evt_ring_reset_command(struct gsi *gsi, u32 evt_ring_id) · 2 unmodified lines
401405 return;
402406 }
403407
404− ret = evt_ring_command(gsi, evt_ring_id, GSI_EVT_RESET);
405− if (!ret && evt_ring->state != GSI_EVT_RING_STATE_ALLOCATED)
406− dev_err(gsi->dev, "event ring %u bad state %u after reset\n",
407− evt_ring_id, evt_ring->state);
408+ evt_ring_command(gsi, evt_ring_id, GSI_EVT_RESET);
409+
410+ /* If successful the event ring state will have changed */
411+ if (evt_ring->state == GSI_EVT_RING_STATE_ALLOCATED)
412+ return;
413+
414+ dev_err(gsi->dev, "event ring %u bad state %u after reset\n",
415+ evt_ring_id, evt_ring->state);
408416 }
409417
410418 /* Issue a hardware de-allocation request for an allocated event ring */
411419 static void gsi_evt_ring_de_alloc_command(struct gsi *gsi, u32 evt_ring_id)
412420 {
413421 struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
414− int ret;
415422
416423 if (evt_ring->state != GSI_EVT_RING_STATE_ALLOCATED) {
417424 dev_err(gsi->dev, "event ring %u state %u before dealloc\n",
@@ -419,10 +426,14 @@ static void gsi_evt_ring_de_alloc_command(struct gsi *gsi, u32 evt_ring_id) · 1 unmodified line
419426 return;
420427 }
421428
422− ret = evt_ring_command(gsi, evt_ring_id, GSI_EVT_DE_ALLOC);
423− if (!ret && evt_ring->state != GSI_EVT_RING_STATE_NOT_ALLOCATED)
424− dev_err(gsi->dev, "event ring %u bad state %u after dealloc\n",
425− evt_ring_id, evt_ring->state);
429+ evt_ring_command(gsi, evt_ring_id, GSI_EVT_DE_ALLOC);
430+
431+ /* If successful the event ring state will have changed */
432+ if (evt_ring->state == GSI_EVT_RING_STATE_NOT_ALLOCATED)
433+ return;
434+
435+ dev_err(gsi->dev, "event ring %u bad state %u after dealloc\n",
436+ evt_ring_id, evt_ring->state);
426437 }
427438
428439 /* Fetch the current state of a channel from hardware */
@@ -438,7 +449,7 @@ static enum gsi_channel_state gsi_channel_state(struct gsi_channel *channel) · 9 unmodified lines
438449 }
439450
440451 /* Issue a channel command and wait for it to complete */
441−static int
452+static void
442453 gsi_channel_command(struct gsi_channel *channel, enum gsi_ch_cmd_opcode opcode)
443454 {
444455 struct completion *completion = &channel->completion;
@@ -453,7 +464,13 @@ gsi_channel_command(struct gsi_channel *channel, enum gsi_ch_cmd_opcode opcode) · 8 unmodified lines
453464 * issued here. So we only permit *this* channel to trigger
454465 * an interrupt and only enable the channel control IRQ type
455466 * when we expect it to occur.
467+ *
468+ * There's a small chance that a previous command completed
469+ * after the interrupt was disabled, so make sure we have no
470+ * pending interrupts before we enable them.
456471 */
472+ iowrite32(~0, gsi->virt + GSI_CNTXT_SRC_CH_IRQ_CLR_OFFSET);
473+
457474 val = BIT(channel_id);
458475 iowrite32(val, gsi->virt + GSI_CNTXT_SRC_CH_IRQ_MSK_OFFSET);
459476 gsi_irq_type_enable(gsi, GSI_CH_CTRL);
@@ -467,12 +484,10 @@ gsi_channel_command(struct gsi_channel *channel, enum gsi_ch_cmd_opcode opcode) · 7 unmodified lines
467484 iowrite32(0, gsi->virt + GSI_CNTXT_SRC_CH_IRQ_MSK_OFFSET);
468485
469486 if (success)
470− return 0;
487+ return;
471488
472489 dev_err(dev, "GSI command %u for channel %u timed out, state %u\n",
473490 opcode, channel_id, gsi_channel_state(channel));
474−
475− return -ETIMEDOUT;
476491 }
477492
478493 /* Allocate GSI channel in NOT_ALLOCATED state */
@@ -481,7 +496,6 @@ static int gsi_channel_alloc_command(struct gsi *gsi, u32 channel_id) · 2 unmodified lines
481496 struct gsi_channel *channel = &gsi->channel[channel_id];
482497 struct device *dev = gsi->dev;
483498 enum gsi_channel_state state;
484− int ret;
485499
486500 /* Get initial channel state */
487501 state = gsi_channel_state(channel);
@@ -491,17 +505,17 @@ static int gsi_channel_alloc_command(struct gsi *gsi, u32 channel_id) · 3 unmodified lines
491505 return -EINVAL;
492506 }
493507
494− ret = gsi_channel_command(channel, GSI_CH_ALLOCATE);
508+ gsi_channel_command(channel, GSI_CH_ALLOCATE);
495509
496− /* Channel state will normally have been updated */
510+ /* If successful the channel state will have changed */
497511 state = gsi_channel_state(channel);
498− if (!ret && state != GSI_CHANNEL_STATE_ALLOCATED) {
499− dev_err(dev, "channel %u bad state %u after alloc\n",
500− channel_id, state);
501− ret = -EIO;
502− }
512+ if (state == GSI_CHANNEL_STATE_ALLOCATED)
513+ return 0;
503514
504− return ret;
515+ dev_err(dev, "channel %u bad state %u after alloc\n",
516+ channel_id, state);
517+
518+ return -EIO;
505519 }
506520
507521 /* Start an ALLOCATED channel */
@@ -509,7 +523,6 @@ static int gsi_channel_start_command(struct gsi_channel *channel) · 1 unmodified line
509523 {
510524 struct device *dev = channel->gsi->dev;
511525 enum gsi_channel_state state;
512− int ret;
513526
514527 state = gsi_channel_state(channel);
515528 if (state != GSI_CHANNEL_STATE_ALLOCATED &&
@@ -519,17 +532,17 @@ static int gsi_channel_start_command(struct gsi_channel *channel) · 3 unmodified lines
519532 return -EINVAL;
520533 }
521534
522− ret = gsi_channel_command(channel, GSI_CH_START);
535+ gsi_channel_command(channel, GSI_CH_START);
523536
524− /* Channel state will normally have been updated */
537+ /* If successful the channel state will have changed */
525538 state = gsi_channel_state(channel);
526− if (!ret && state != GSI_CHANNEL_STATE_STARTED) {
527− dev_err(dev, "channel %u bad state %u after start\n",
528− gsi_channel_id(channel), state);
529− ret = -EIO;
530− }
539+ if (state == GSI_CHANNEL_STATE_STARTED)
540+ return 0;
531541
532− return ret;
542+ dev_err(dev, "channel %u bad state %u after start\n",
543+ gsi_channel_id(channel), state);
544+
545+ return -EIO;
533546 }
534547
535548 /* Stop a GSI channel in STARTED state */
@@ -537,7 +550,6 @@ static int gsi_channel_stop_command(struct gsi_channel *channel) · 1 unmodified line
537550 {
538551 struct device *dev = channel->gsi->dev;
539552 enum gsi_channel_state state;
540− int ret;
541553
542554 state = gsi_channel_state(channel);
543555
@@ -554,12 +566,12 @@ static int gsi_channel_stop_command(struct gsi_channel *channel) · 10 unmodified lines
554566 return -EINVAL;
555567 }
556568
557− ret = gsi_channel_command(channel, GSI_CH_STOP);
569+ gsi_channel_command(channel, GSI_CH_STOP);
558570
559− /* Channel state will normally have been updated */
571+ /* If successful the channel state will have changed */
560572 state = gsi_channel_state(channel);
561− if (ret || state == GSI_CHANNEL_STATE_STOPPED)
562− return ret;
573+ if (state == GSI_CHANNEL_STATE_STOPPED)
574+ return 0;
563575
564576 /* We may have to try again if stop is in progress */
565577 if (state == GSI_CHANNEL_STATE_STOP_IN_PROC)
@@ -576,7 +588,6 @@ static void gsi_channel_reset_command(struct gsi_channel *channel) · 10 unmodified lines
576588 {
577589 struct device *dev = channel->gsi->dev;
578590 enum gsi_channel_state state;
579− int ret;
580591
581592 msleep(1); /* A short delay is required before a RESET command */
582593
@@ -590,11 +601,11 @@ static void gsi_channel_reset_command(struct gsi_channel *channel) · 7 unmodified lines
590601 return;
591602 }
592603
593− ret = gsi_channel_command(channel, GSI_CH_RESET);
604+ gsi_channel_command(channel, GSI_CH_RESET);
594605
595− /* Channel state will normally have been updated */
606+ /* If successful the channel state will have changed */
596607 state = gsi_channel_state(channel);
597− if (!ret && state != GSI_CHANNEL_STATE_ALLOCATED)
608+ if (state != GSI_CHANNEL_STATE_ALLOCATED)
598609 dev_err(dev, "channel %u bad state %u after reset\n",
599610 gsi_channel_id(channel), state);
600611 }
@@ -605,7 +616,6 @@ static void gsi_channel_de_alloc_command(struct gsi *gsi, u32 channel_id) · 4 unmodified lines
605616 struct gsi_channel *channel = &gsi->channel[channel_id];
606617 struct device *dev = gsi->dev;
607618 enum gsi_channel_state state;
608− int ret;
609619
610620 state = gsi_channel_state(channel);
611621 if (state != GSI_CHANNEL_STATE_ALLOCATED) {
@@ -614,11 +624,12 @@ static void gsi_channel_de_alloc_command(struct gsi *gsi, u32 channel_id) · 2 unmodified lines
614624 return;
615625 }
616626
617− ret = gsi_channel_command(channel, GSI_CH_DE_ALLOC);
627+ gsi_channel_command(channel, GSI_CH_DE_ALLOC);
618628
619− /* Channel state will normally have been updated */
629+ /* If successful the channel state will have changed */
620630 state = gsi_channel_state(channel);
621− if (!ret && state != GSI_CHANNEL_STATE_NOT_ALLOCATED)
631+
632+ if (state != GSI_CHANNEL_STATE_NOT_ALLOCATED)
622633 dev_err(dev, "channel %u bad state %u after dealloc\n",
623634 channel_id, state);
624635 }
drivers/net/ipa/ipa_clock.c+2−2
@@ -115,13 +115,13 @@ static int ipa_interconnect_enable(struct ipa *ipa) · 114 unmodified lines
115115 return ret;
116116
117117 data = &clock->interconnect_data[IPA_INTERCONNECT_IMEM];
118− ret = icc_set_bw(clock->memory_path, data->average_rate,
118+ ret = icc_set_bw(clock->imem_path, data->average_rate,
119119 data->peak_rate);
120120 if (ret)
121121 goto err_memory_path_disable;
122122
123123 data = &clock->interconnect_data[IPA_INTERCONNECT_CONFIG];
124− ret = icc_set_bw(clock->memory_path, data->average_rate,
124+ ret = icc_set_bw(clock->config_path, data->average_rate,
125125 data->peak_rate);
126126 if (ret)
127127 goto err_imem_path_disable;
drivers/net/ipa/ipa_modem.c+1−0
@@ -216,6 +216,7 @@ int ipa_modem_start(struct ipa *ipa) · 215 unmodified lines
216216 ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = netdev;
217217 ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = netdev;
218218
219+ SET_NETDEV_DEV(netdev, &ipa->pdev->dev);
219220 priv = netdev_priv(netdev);
220221 priv->ipa = ipa;
221222
drivers/net/phy/smsc.c+2−1
@@ -317,7 +317,8 @@ static int smsc_phy_probe(struct phy_device *phydev) · 316 unmodified lines
317317 /* Make clk optional to keep DTB backward compatibility. */
318318 priv->refclk = clk_get_optional(dev, NULL);
319319 if (IS_ERR(priv->refclk))
320− dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n");
320+ return dev_err_probe(dev, PTR_ERR(priv->refclk),
321+ "Failed to request clock\n");
321322
322323 ret = clk_prepare_enable(priv->refclk);
323324 if (ret)
drivers/net/ppp/ppp_generic.c+9−3
@@ -623,6 +623,7 @@ static int ppp_bridge_channels(struct channel *pch, struct channel *pchb) · 622 unmodified lines
623623 write_unlock_bh(&pch->upl);
624624 return -EALREADY;
625625 }
626+ refcount_inc(&pchb->file.refcnt);
626627 rcu_assign_pointer(pch->bridge, pchb);
627628 write_unlock_bh(&pch->upl);
628629
@@ -632,19 +633,24 @@ static int ppp_bridge_channels(struct channel *pch, struct channel *pchb) · 3 unmodified lines
632633 write_unlock_bh(&pchb->upl);
633634 goto err_unset;
634635 }
636+ refcount_inc(&pch->file.refcnt);
635637 rcu_assign_pointer(pchb->bridge, pch);
636638 write_unlock_bh(&pchb->upl);
637639
638− refcount_inc(&pch->file.refcnt);
639− refcount_inc(&pchb->file.refcnt);
640−
641640 return 0;
642641
643642 err_unset:
644643 write_lock_bh(&pch->upl);
644+ /* Re-read pch->bridge with upl held in case it was modified concurrently */
645+ pchb = rcu_dereference_protected(pch->bridge, lockdep_is_held(&pch->upl));
645646 RCU_INIT_POINTER(pch->bridge, NULL);
646647 write_unlock_bh(&pch->upl);
647648 synchronize_rcu();
649+
650+ if (pchb)
651+ if (refcount_dec_and_test(&pchb->file.refcnt))
652+ ppp_destroy_channel(pchb);
653+
648654 return -EALREADY;
649655 }
650656
drivers/net/tun.c+1−1
@@ -1365,7 +1365,7 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile, · 1364 unmodified lines
13651365 int i;
13661366
13671367 if (it->nr_segs > MAX_SKB_FRAGS + 1)
1368− return ERR_PTR(-ENOMEM);
1368+ return ERR_PTR(-EMSGSIZE);
13691369
13701370 local_bh_disable();
13711371 skb = napi_get_frags(&tfile->napi);
drivers/net/usb/Kconfig+0−1
@@ -631,7 +631,6 @@ config USB_NET_AQC111 · 630 unmodified lines
631631 config USB_RTL8153_ECM
632632 tristate "RTL8153 ECM support"
633633 depends on USB_NET_CDCETHER && (USB_RTL8152 || USB_RTL8152=n)
634− default y
635634 help
636635 This option supports ECM mode for RTL8153 ethernet adapter, when
637636 CONFIG_USB_RTL8152 is not set, or the RTL8153 device is not
drivers/net/usb/cdc_ether.c+7−0
@@ -793,6 +793,13 @@ static const struct usb_device_id products[] = { · 792 unmodified lines
793793 .driver_info = 0,
794794 },
795795
796+/* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */
797+{
798+ USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM,
799+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
800+ .driver_info = 0,
801+},
802+
796803 /* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */
797804 {
798805 USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM,
drivers/net/usb/cdc_ncm.c+6−5
@@ -1199,7 +1199,10 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign) · 1198 unmodified lines
11991199 * accordingly. Otherwise, we should check here.
12001200 */
12011201 if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END)
1202− delayed_ndp_size = ALIGN(ctx->max_ndp_size, ctx->tx_ndp_modulus);
1202+ delayed_ndp_size = ctx->max_ndp_size +
1203+ max_t(u32,
1204+ ctx->tx_ndp_modulus,
1205+ ctx->tx_modulus + ctx->tx_remainder) - 1;
12031206 else
12041207 delayed_ndp_size = 0;
12051208
@@ -1410,7 +1413,8 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign) · 204 unmodified lines
14101413 if (!(dev->driver_info->flags & FLAG_SEND_ZLP) &&
14111414 skb_out->len > ctx->min_tx_pkt) {
14121415 padding_count = ctx->tx_curr_size - skb_out->len;
1413− skb_put_zero(skb_out, padding_count);
1416+ if (!WARN_ON(padding_count > ctx->tx_curr_size))
1417+ skb_put_zero(skb_out, padding_count);
14141418 } else if (skb_out->len < ctx->tx_curr_size &&
14151419 (skb_out->len % dev->maxpacket) == 0) {
14161420 skb_put_u8(skb_out, 0); /* force short packet */
@@ -1863,9 +1867,6 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb) · 446 unmodified lines
18631867 * USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be
18641868 * sent by device after USB_CDC_NOTIFY_SPEED_CHANGE.
18651869 */
1866− netif_info(dev, link, dev->net,
1867− "network connection: %sconnected\n",
1868− !!event->wValue ? "" : "dis");
18691870 usbnet_link_change(dev, !!event->wValue, 0);
18701871 break;
18711872
drivers/net/usb/qmi_wwan.c+1−0
@@ -1013,6 +1013,7 @@ static const struct usb_device_id products[] = { · 1012 unmodified lines
10131013 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
10141014 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
10151015 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
1016+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
10161017 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
10171018
10181019 /* 3. Combined interface devices matching on interface number */
drivers/net/usb/r8152.c+1−0
@@ -6877,6 +6877,7 @@ static const struct usb_device_id rtl8152_table[] = { · 6876 unmodified lines
68776877 {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)},
68786878 {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)},
68796879 {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)},
6880+ {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e)},
68806881 {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387)},
68816882 {REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)},
68826883 {REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)},
drivers/net/usb/r8153_ecm.c+8−0
@@ -122,12 +122,20 @@ static const struct driver_info r8153_info = { · 121 unmodified lines
122122 };
123123
124124 static const struct usb_device_id products[] = {
125+/* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */
125126 {
126127 USB_DEVICE_AND_INTERFACE_INFO(VENDOR_ID_REALTEK, 0x8153, USB_CLASS_COMM,
127128 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
128129 .driver_info = (unsigned long)&r8153_info,
129130 },
130131
132+/* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */
133+{
134+ USB_DEVICE_AND_INTERFACE_INFO(VENDOR_ID_LENOVO, 0x721e, USB_CLASS_COMM,
135+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
136+ .driver_info = (unsigned long)&r8153_info,
137+},
138+
131139 { }, /* END */
132140 };
133141 MODULE_DEVICE_TABLE(usb, products);
drivers/net/usb/rndis_host.c+1−1
@@ -387,7 +387,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) · 386 unmodified lines
387387 reply_len = sizeof *phym;
388388 retval = rndis_query(dev, intf, u.buf,
389389 RNDIS_OID_GEN_PHYSICAL_MEDIUM,
390− 0, (void **) &phym, &reply_len);
390+ reply_len, (void **)&phym, &reply_len);
391391 if (retval != 0 || !phym) {
392392 /* OID is optional so don't fail here. */
393393 phym_unspec = cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED);
drivers/net/virtio_net.c+7−5
@@ -2093,14 +2093,16 @@ static int virtnet_set_channels(struct net_device *dev, · 2092 unmodified lines
20932093
20942094 get_online_cpus();
20952095 err = _virtnet_set_queues(vi, queue_pairs);
2096− if (!err) {
2097− netif_set_real_num_tx_queues(dev, queue_pairs);
2098− netif_set_real_num_rx_queues(dev, queue_pairs);
2099−
2100− virtnet_set_affinity(vi);
2096+ if (err) {
2097+ put_online_cpus();
2098+ goto err;
21012099 }
2100+ virtnet_set_affinity(vi);
21022101 put_online_cpus();
21032102
2103+ netif_set_real_num_tx_queues(dev, queue_pairs);
2104+ netif_set_real_num_rx_queues(dev, queue_pairs);
2105+ err:
21042106 return err;
21052107 }
21062108
drivers/net/wan/Kconfig+1−0
@@ -282,6 +282,7 @@ config SLIC_DS26522 · 281 unmodified lines
282282 tristate "Slic Maxim ds26522 card support"
283283 depends on SPI
284284 depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE || COMPILE_TEST
285+ select BITREVERSE
285286 help
286287 This module initializes and configures the slic maxim card
287288 in T1 or E1 mode.
drivers/net/wan/hdlc_ppp.c+7−0
@@ -569,6 +569,13 @@ static void ppp_timer(struct timer_list *t) · 568 unmodified lines
569569 unsigned long flags;
570570
571571 spin_lock_irqsave(&ppp->lock, flags);
572+ /* mod_timer could be called after we entered this function but
573+ * before we got the lock.
574+ */
575+ if (timer_pending(&proto->timer)) {
576+ spin_unlock_irqrestore(&ppp->lock, flags);
577+ return;
578+ }
572579 switch (proto->state) {
573580 case STOPPING:
574581 case REQ_SENT:
drivers/net/wireless/ath/ath11k/core.c+1−1
@@ -185,7 +185,7 @@ int ath11k_core_suspend(struct ath11k_base *ab) · 184 unmodified lines
185185 ath11k_hif_ce_irq_disable(ab);
186186
187187 ret = ath11k_hif_suspend(ab);
188− if (!ret) {
188+ if (ret) {
189189 ath11k_warn(ab, "failed to suspend hif: %d\n", ret);
190190 return ret;
191191 }
drivers/net/wireless/ath/ath11k/dp_rx.c+7−3
@@ -2294,6 +2294,7 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc, · 2293 unmodified lines
22942294 {
22952295 u8 channel_num;
22962296 u32 center_freq;
2297+ struct ieee80211_channel *channel;
22972298
22982299 rx_status->freq = 0;
22992300 rx_status->rate_idx = 0;
@@ -2314,9 +2315,12 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc, · 14 unmodified lines
23142315 rx_status->band = NL80211_BAND_5GHZ;
23152316 } else {
23162317 spin_lock_bh(&ar->data_lock);
2317− rx_status->band = ar->rx_channel->band;
2318− channel_num =
2319− ieee80211_frequency_to_channel(ar->rx_channel->center_freq);
2318+ channel = ar->rx_channel;
2319+ if (channel) {
2320+ rx_status->band = channel->band;
2321+ channel_num =
2322+ ieee80211_frequency_to_channel(channel->center_freq);
2323+ }
23202324 spin_unlock_bh(&ar->data_lock);
23212325 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "rx_desc: ",
23222326 rx_desc, sizeof(struct hal_rx_desc));
drivers/net/wireless/ath/ath11k/mac.c+6−2
@@ -3021,6 +3021,7 @@ static int ath11k_mac_station_add(struct ath11k *ar, · 3020 unmodified lines
30213021 }
30223022
30233023 if (ab->hw_params.vdev_start_delay &&
3024+ !arvif->is_started &&
30243025 arvif->vdev_type != WMI_VDEV_TYPE_AP) {
30253026 ret = ath11k_start_vdev_delay(ar->hw, vif);
30263027 if (ret) {
@@ -5284,7 +5285,8 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, · 2257 unmodified lines
52845285 /* for QCA6390 bss peer must be created before vdev_start */
52855286 if (ab->hw_params.vdev_start_delay &&
52865287 arvif->vdev_type != WMI_VDEV_TYPE_AP &&
5287− arvif->vdev_type != WMI_VDEV_TYPE_MONITOR) {
5288+ arvif->vdev_type != WMI_VDEV_TYPE_MONITOR &&
5289+ !ath11k_peer_find_by_vdev_id(ab, arvif->vdev_id)) {
52885290 memcpy(&arvif->chanctx, ctx, sizeof(*ctx));
52895291 ret = 0;
52905292 goto out;
@@ -5295,7 +5297,9 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, · 4 unmodified lines
52955297 goto out;
52965298 }
52975299
5298− if (ab->hw_params.vdev_start_delay) {
5300+ if (ab->hw_params.vdev_start_delay &&
5301+ (arvif->vdev_type == WMI_VDEV_TYPE_AP ||
5302+ arvif->vdev_type == WMI_VDEV_TYPE_MONITOR)) {
52995303 param.vdev_id = arvif->vdev_id;
53005304 param.peer_type = WMI_PEER_TYPE_DEFAULT;
53015305 param.peer_addr = ar->mac_addr;
drivers/net/wireless/ath/ath11k/pci.c+40−4
@@ -274,7 +274,7 @@ static int ath11k_pci_fix_l1ss(struct ath11k_base *ab) · 273 unmodified lines
274274 PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG,
275275 PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL,
276276 PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK);
277− if (!ret) {
277+ if (ret) {
278278 ath11k_warn(ab, "failed to set sysclk: %d\n", ret);
279279 return ret;
280280 }
@@ -283,7 +283,7 @@ static int ath11k_pci_fix_l1ss(struct ath11k_base *ab) · 2 unmodified lines
283283 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_REG,
284284 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_VAL,
285285 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK);
286− if (!ret) {
286+ if (ret) {
287287 ath11k_warn(ab, "failed to set dtct config1 error: %d\n", ret);
288288 return ret;
289289 }
@@ -292,7 +292,7 @@ static int ath11k_pci_fix_l1ss(struct ath11k_base *ab) · 2 unmodified lines
292292 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_REG,
293293 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_VAL,
294294 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK);
295− if (!ret) {
295+ if (ret) {
296296 ath11k_warn(ab, "failed to set dtct config2: %d\n", ret);
297297 return ret;
298298 }
@@ -301,7 +301,7 @@ static int ath11k_pci_fix_l1ss(struct ath11k_base *ab) · 2 unmodified lines
301301 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_REG,
302302 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_VAL,
303303 PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK);
304− if (!ret) {
304+ if (ret) {
305305 ath11k_warn(ab, "failed to set dtct config4: %d\n", ret);
306306 return ret;
307307 }
@@ -886,6 +886,32 @@ static void ath11k_pci_free_region(struct ath11k_pci *ab_pci) · 578 unmodified lines
886886 pci_disable_device(pci_dev);
887887 }
888888
889+static void ath11k_pci_aspm_disable(struct ath11k_pci *ab_pci)
890+{
891+ struct ath11k_base *ab = ab_pci->ab;
892+
893+ pcie_capability_read_word(ab_pci->pdev, PCI_EXP_LNKCTL,
894+ &ab_pci->link_ctl);
895+
896+ ath11k_dbg(ab, ATH11K_DBG_PCI, "pci link_ctl 0x%04x L0s %d L1 %d\n",
897+ ab_pci->link_ctl,
898+ u16_get_bits(ab_pci->link_ctl, PCI_EXP_LNKCTL_ASPM_L0S),
899+ u16_get_bits(ab_pci->link_ctl, PCI_EXP_LNKCTL_ASPM_L1));
900+
901+ /* disable L0s and L1 */
902+ pcie_capability_write_word(ab_pci->pdev, PCI_EXP_LNKCTL,
903+ ab_pci->link_ctl & ~PCI_EXP_LNKCTL_ASPMC);
904+
905+ set_bit(ATH11K_PCI_ASPM_RESTORE, &ab_pci->flags);
906+}
907+
908+static void ath11k_pci_aspm_restore(struct ath11k_pci *ab_pci)
909+{
910+ if (test_and_clear_bit(ATH11K_PCI_ASPM_RESTORE, &ab_pci->flags))
911+ pcie_capability_write_word(ab_pci->pdev, PCI_EXP_LNKCTL,
912+ ab_pci->link_ctl);
913+}
914+
889915 static int ath11k_pci_power_up(struct ath11k_base *ab)
890916 {
891917 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);
@@ -895,6 +921,11 @@ static int ath11k_pci_power_up(struct ath11k_base *ab) · 3 unmodified lines
895921 clear_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags);
896922 ath11k_pci_sw_reset(ab_pci->ab, true);
897923
924+ /* Disable ASPM during firmware download due to problems switching
925+ * to AMSS state.
926+ */
927+ ath11k_pci_aspm_disable(ab_pci);
928+
898929 ret = ath11k_mhi_start(ab_pci);
899930 if (ret) {
900931 ath11k_err(ab, "failed to start mhi: %d\n", ret);
@@ -908,6 +939,9 @@ static void ath11k_pci_power_down(struct ath11k_base *ab) · 7 unmodified lines
908939 {
909940 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);
910941
942+ /* restore aspm in case firmware bootup fails */
943+ ath11k_pci_aspm_restore(ab_pci);
944+
911945 ath11k_pci_force_wake(ab_pci->ab);
912946 ath11k_mhi_stop(ab_pci);
913947 clear_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags);
@@ -965,6 +999,8 @@ static int ath11k_pci_start(struct ath11k_base *ab) · 51 unmodified lines
965999
9661000 set_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags);
9671001
1002+ ath11k_pci_aspm_restore(ab_pci);
1003+
9681004 ath11k_pci_ce_irqs_enable(ab);
9691005 ath11k_ce_rx_post_buf(ab);
9701006
drivers/net/wireless/ath/ath11k/pci.h+2−0
@@ -63,6 +63,7 @@ struct ath11k_msi_config { · 62 unmodified lines
6363 enum ath11k_pci_flags {
6464 ATH11K_PCI_FLAG_INIT_DONE,
6565 ATH11K_PCI_FLAG_IS_MSI_64,
66+ ATH11K_PCI_ASPM_RESTORE,
6667 };
6768
6869 struct ath11k_pci {
@@ -80,6 +81,7 @@ struct ath11k_pci { · 11 unmodified lines
8081
8182 /* enum ath11k_pci_flags */
8283 unsigned long flags;
84+ u16 link_ctl;
8385 };
8486
8587 static inline struct ath11k_pci *ath11k_pci_priv(struct ath11k_base *ab)
drivers/net/wireless/ath/ath11k/peer.c+17−0
@@ -76,6 +76,23 @@ struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, · 75 unmodified lines
7676 return NULL;
7777 }
7878
79+struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab,
80+ int vdev_id)
81+{
82+ struct ath11k_peer *peer;
83+
84+ spin_lock_bh(&ab->base_lock);
85+
86+ list_for_each_entry(peer, &ab->peers, list) {
87+ if (vdev_id == peer->vdev_id) {
88+ spin_unlock_bh(&ab->base_lock);
89+ return peer;
90+ }
91+ }
92+ spin_unlock_bh(&ab->base_lock);
93+ return NULL;
94+}
95+
7996 void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id)
8097 {
8198 struct ath11k_peer *peer;
drivers/net/wireless/ath/ath11k/peer.h+2−0
@@ -43,5 +43,7 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, · 42 unmodified lines
4343 struct ieee80211_sta *sta, struct peer_create_params *param);
4444 int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id,
4545 const u8 *addr);
46+struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab,
47+ int vdev_id);
4648
4749 #endif /* _PEER_H_ */
drivers/net/wireless/ath/ath11k/qmi.c+22−2
@@ -1660,6 +1660,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) · 1659 unmodified lines
16601660 struct qmi_wlanfw_respond_mem_resp_msg_v01 resp;
16611661 struct qmi_txn txn = {};
16621662 int ret = 0, i;
1663+ bool delayed;
16631664
16641665 req = kzalloc(sizeof(*req), GFP_KERNEL);
16651666 if (!req)
@@ -1672,11 +1673,13 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) · 6 unmodified lines
16721673 * failure to FW and FW will then request mulitple blocks of small
16731674 * chunk size memory.
16741675 */
1675− if (!ab->bus_params.fixed_mem_region && ab->qmi.mem_seg_count <= 2) {
1676+ if (!ab->bus_params.fixed_mem_region && ab->qmi.target_mem_delayed) {
1677+ delayed = true;
16761678 ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi delays mem_request %d\n",
16771679 ab->qmi.mem_seg_count);
16781680 memset(req, 0, sizeof(*req));
16791681 } else {
1682+ delayed = false;
16801683 req->mem_seg_len = ab->qmi.mem_seg_count;
16811684
16821685 for (i = 0; i < req->mem_seg_len ; i++) {
@@ -1708,6 +1711,12 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) · 25 unmodified lines
17081711 }
17091712
17101713 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
1714+ /* the error response is expected when
1715+ * target_mem_delayed is true.
1716+ */
1717+ if (delayed && resp.resp.error == 0)
1718+ goto out;
1719+
17111720 ath11k_warn(ab, "Respond mem req failed, result: %d, err: %d\n",
17121721 resp.resp.result, resp.resp.error);
17131722 ret = -EINVAL;
@@ -1742,6 +1751,8 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) · 28 unmodified lines
17421751 int i;
17431752 struct target_mem_chunk *chunk;
17441753
1754+ ab->qmi.target_mem_delayed = false;
1755+
17451756 for (i = 0; i < ab->qmi.mem_seg_count; i++) {
17461757 chunk = &ab->qmi.target_mem[i];
17471758 chunk->vaddr = dma_alloc_coherent(ab->dev,
@@ -1749,6 +1760,15 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) · 1 unmodified line
17491760 &chunk->paddr,
17501761 GFP_KERNEL);
17511762 if (!chunk->vaddr) {
1763+ if (ab->qmi.mem_seg_count <= 2) {
1764+ ath11k_dbg(ab, ATH11K_DBG_QMI,
1765+ "qmi dma allocation failed (%d B type %u), will try later with small size\n",
1766+ chunk->size,
1767+ chunk->type);
1768+ ath11k_qmi_free_target_mem_chunk(ab);
1769+ ab->qmi.target_mem_delayed = true;
1770+ return 0;
1771+ }
17521772 ath11k_err(ab, "failed to alloc memory, size: 0x%x, type: %u\n",
17531773 chunk->size,
17541774 chunk->type);
@@ -2517,7 +2537,7 @@ static void ath11k_qmi_msg_mem_request_cb(struct qmi_handle *qmi_hdl, · 762 unmodified lines
25172537 ret);
25182538 return;
25192539 }
2520− } else if (msg->mem_seg_len > 2) {
2540+ } else {
25212541 ret = ath11k_qmi_alloc_target_mem_chunk(ab);
25222542 if (ret) {
25232543 ath11k_warn(ab, "qmi failed to alloc target memory: %d\n",
drivers/net/wireless/ath/ath11k/qmi.h+1−0
@@ -125,6 +125,7 @@ struct ath11k_qmi { · 124 unmodified lines
125125 struct target_mem_chunk target_mem[ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01];
126126 u32 mem_seg_count;
127127 u32 target_mem_mode;
128+ bool target_mem_delayed;
128129 u8 cal_done;
129130 struct target_info target;
130131 struct m3_mem_region m3_mem;
drivers/net/wireless/ath/ath11k/wmi.c+3−0
@@ -3460,6 +3460,9 @@ int ath11k_wmi_set_hw_mode(struct ath11k_base *ab, · 3459 unmodified lines
34603460 len = sizeof(*cmd);
34613461
34623462 skb = ath11k_wmi_alloc_skb(wmi_ab, len);
3463+ if (!skb)
3464+ return -ENOMEM;
3465+
34633466 cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data;
34643467
34653468 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) |
drivers/net/wireless/ath/wil6210/Kconfig+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 config WIL6210
33 tristate "Wilocity 60g WiFi card wil6210 support"
44 select WANT_DEV_COREDUMP
5+ select CRC32
56 depends on CFG80211
67 depends on PCI
78 default n
drivers/net/wireless/mediatek/mt76/mt7915/init.c+2−2
@@ -40,9 +40,9 @@ static const struct ieee80211_iface_limit if_limits[] = { · 39 unmodified lines
4040 .types = BIT(NL80211_IFTYPE_ADHOC)
4141 }, {
4242 .max = 16,
43− .types = BIT(NL80211_IFTYPE_AP) |
43+ .types = BIT(NL80211_IFTYPE_AP)
4444 #ifdef CONFIG_MAC80211_MESH
45− BIT(NL80211_IFTYPE_MESH_POINT)
45+ | BIT(NL80211_IFTYPE_MESH_POINT)
4646 #endif
4747 }, {
4848 .max = MT7915_MAX_INTERFACES,
drivers/net/wireless/mediatek/mt76/sdio.c+7−12
@@ -157,10 +157,14 @@ static void mt76s_net_worker(struct mt76_worker *w) · 156 unmodified lines
157157
158158 static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
159159 {
160− bool wake, mcu = q == dev->q_mcu[MT_MCUQ_WM];
161160 struct mt76_queue_entry entry;
162161 int nframes = 0;
162+ bool mcu;
163163
164+ if (!q)
165+ return 0;
166+
167+ mcu = q == dev->q_mcu[MT_MCUQ_WM];
164168 while (q->queued > 0) {
165169 if (!q->entry[q->tail].done)
166170 break;
@@ -177,21 +181,12 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q) · 10 unmodified lines
177181 nframes++;
178182 }
179183
180− wake = q->stopped && q->queued < q->ndesc - 8;
181− if (wake)
182− q->stopped = false;
183−
184184 if (!q->queued)
185185 wake_up(&dev->tx_wait);
186186
187− if (mcu)
188− goto out;
189−
190− mt76_txq_schedule(&dev->phy, q->qid);
187+ if (!mcu)
188+ mt76_txq_schedule(&dev->phy, q->qid);
191189
192− if (wake)
193− ieee80211_wake_queue(dev->hw, q->qid);
194−out:
195190 return nframes;
196191 }
197192
drivers/net/wireless/mediatek/mt76/usb.c+2−7
@@ -811,11 +811,12 @@ static void mt76u_status_worker(struct mt76_worker *w) · 810 unmodified lines
811811 struct mt76_dev *dev = container_of(usb, struct mt76_dev, usb);
812812 struct mt76_queue_entry entry;
813813 struct mt76_queue *q;
814− bool wake;
815814 int i;
816815
817816 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
818817 q = dev->phy.q_tx[i];
818+ if (!q)
819+ continue;
819820
820821 while (q->queued > 0) {
821822 if (!q->entry[q->tail].done)
@@ -827,10 +828,6 @@ static void mt76u_status_worker(struct mt76_worker *w) · 5 unmodified lines
827828 mt76_queue_tx_complete(dev, q, &entry);
828829 }
829830
830− wake = q->stopped && q->queued < q->ndesc - 8;
831− if (wake)
832− q->stopped = false;
833−
834831 if (!q->queued)
835832 wake_up(&dev->tx_wait);
836833
@@ -839,8 +836,6 @@ static void mt76u_status_worker(struct mt76_worker *w) · 2 unmodified lines
839836 if (dev->drv->tx_status_data &&
840837 !test_and_set_bit(MT76_READING_STATS, &dev->phy.state))
841838 queue_work(dev->wq, &dev->usb.stat_work);
842− if (wake)
843− ieee80211_wake_queue(dev->hw, i);
844839 }
845840 }
846841
drivers/net/wireless/realtek/rtlwifi/core.c+5−3
@@ -78,7 +78,6 @@ static void rtl_fw_do_work(const struct firmware *firmware, void *context, · 77 unmodified lines
7878
7979 rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD,
8080 "Firmware callback routine entered!\n");
81− complete(&rtlpriv->firmware_loading_complete);
8281 if (!firmware) {
8382 if (rtlpriv->cfg->alt_fw_name) {
8483 err = request_firmware(&firmware,
@@ -91,13 +90,13 @@ static void rtl_fw_do_work(const struct firmware *firmware, void *context, · 6 unmodified lines
9190 }
9291 pr_err("Selected firmware is not available\n");
9392 rtlpriv->max_fw_size = 0;
94− return;
93+ goto exit;
9594 }
9695 found_alt:
9796 if (firmware->size > rtlpriv->max_fw_size) {
9897 pr_err("Firmware is too big!\n");
9998 release_firmware(firmware);
100− return;
99+ goto exit;
101100 }
102101 if (!is_wow) {
103102 memcpy(rtlpriv->rtlhal.pfirmware, firmware->data,
@@ -109,6 +108,9 @@ found_alt: · 5 unmodified lines
109108 rtlpriv->rtlhal.wowlan_fwsize = firmware->size;
110109 }
111110 release_firmware(firmware);
111+
112+exit:
113+ complete(&rtlpriv->firmware_loading_complete);
112114 }
113115
114116 void rtl_fw_cb(const struct firmware *firmware, void *context)
drivers/nvme/host/core.c+11−8
@@ -179,7 +179,7 @@ int nvme_reset_ctrl(struct nvme_ctrl *ctrl) · 178 unmodified lines
179179 }
180180 EXPORT_SYMBOL_GPL(nvme_reset_ctrl);
181181
182−int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl)
182+static int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl)
183183 {
184184 int ret;
185185
@@ -192,7 +192,6 @@ int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl) · 6 unmodified lines
192192
193193 return ret;
194194 }
195−EXPORT_SYMBOL_GPL(nvme_reset_ctrl_sync);
196195
197196 static void nvme_do_delete_ctrl(struct nvme_ctrl *ctrl)
198197 {
@@ -331,7 +330,7 @@ static inline void nvme_end_req(struct request *req) · 132 unmodified lines
331330 req->__sector = nvme_lba_to_sect(req->q->queuedata,
332331 le64_to_cpu(nvme_req(req)->result.u64));
333332
334− nvme_trace_bio_complete(req, status);
333+ nvme_trace_bio_complete(req);
335334 blk_mq_end_request(req, status);
336335 }
337336
@@ -578,7 +577,7 @@ struct request *nvme_alloc_request(struct request_queue *q, · 240 unmodified lines
578577 }
579578 EXPORT_SYMBOL_GPL(nvme_alloc_request);
580579
581−struct request *nvme_alloc_request_qid(struct request_queue *q,
580+static struct request *nvme_alloc_request_qid(struct request_queue *q,
582581 struct nvme_command *cmd, blk_mq_req_flags_t flags, int qid)
583582 {
584583 struct request *req;
@@ -589,7 +588,6 @@ struct request *nvme_alloc_request_qid(struct request_queue *q, · 4 unmodified lines
589588 nvme_init_request(req, cmd);
590589 return req;
591590 }
592−EXPORT_SYMBOL_GPL(nvme_alloc_request_qid);
593591
594592 static int nvme_toggle_streams(struct nvme_ctrl *ctrl, bool enable)
595593 {
@@ -2858,6 +2856,11 @@ static const struct attribute_group *nvme_subsys_attrs_groups[] = { · 2262 unmodified lines
28582856 NULL,
28592857 };
28602858
2859+static inline bool nvme_discovery_ctrl(struct nvme_ctrl *ctrl)
2860+{
2861+ return ctrl->opts && ctrl->opts->discovery_nqn;
2862+}
2863+
28612864 static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
28622865 struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
28632866 {
@@ -2877,7 +2880,7 @@ static bool nvme_validate_cntlid(struct nvme_subsystem *subsys, · 13 unmodified lines
28772880 }
28782881
28792882 if ((id->cmic & NVME_CTRL_CMIC_MULTI_CTRL) ||
2880− (ctrl->opts && ctrl->opts->discovery_nqn))
2883+ nvme_discovery_ctrl(ctrl))
28812884 continue;
28822885
28832886 dev_err(ctrl->device,
@@ -3146,7 +3149,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) · 262 unmodified lines
31463149 goto out_free;
31473150 }
31483151
3149− if (!ctrl->opts->discovery_nqn && !ctrl->kas) {
3152+ if (!nvme_discovery_ctrl(ctrl) && !ctrl->kas) {
31503153 dev_err(ctrl->device,
31513154 "keep-alive support is mandatory for fabrics\n");
31523155 ret = -EINVAL;
@@ -3186,7 +3189,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) · 33 unmodified lines
31863189 if (ret < 0)
31873190 return ret;
31883191
3189− if (!ctrl->identified) {
3192+ if (!ctrl->identified && !nvme_discovery_ctrl(ctrl)) {
31903193 ret = nvme_hwmon_init(ctrl);
31913194 if (ret < 0)
31923195 return ret;
drivers/nvme/host/fc.c+14−1
@@ -166,6 +166,7 @@ struct nvme_fc_ctrl { · 165 unmodified lines
166166 struct blk_mq_tag_set admin_tag_set;
167167 struct blk_mq_tag_set tag_set;
168168
169+ struct work_struct ioerr_work;
169170 struct delayed_work connect_work;
170171
171172 struct kref ref;
@@ -1888,6 +1889,15 @@ __nvme_fc_fcpop_chk_teardowns(struct nvme_fc_ctrl *ctrl, · 1716 unmodified lines
18881889 }
18891890 }
18901891
1892+static void
1893+nvme_fc_ctrl_ioerr_work(struct work_struct *work)
1894+{
1895+ struct nvme_fc_ctrl *ctrl =
1896+ container_of(work, struct nvme_fc_ctrl, ioerr_work);
1897+
1898+ nvme_fc_error_recovery(ctrl, "transport detected io error");
1899+}
1900+
18911901 static void
18921902 nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
18931903 {
@@ -2046,7 +2056,7 @@ done: · 152 unmodified lines
20462056
20472057 check_error:
20482058 if (terminate_assoc)
2049− nvme_fc_error_recovery(ctrl, "transport detected io error");
2059+ queue_work(nvme_reset_wq, &ctrl->ioerr_work);
20502060 }
20512061
20522062 static int
@@ -3233,6 +3243,7 @@ nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl) · 1180 unmodified lines
32333243 {
32343244 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
32353245
3246+ cancel_work_sync(&ctrl->ioerr_work);
32363247 cancel_delayed_work_sync(&ctrl->connect_work);
32373248 /*
32383249 * kill the association on the link side. this will block
@@ -3449,6 +3460,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 210 unmodified lines
34493460
34503461 INIT_WORK(&ctrl->ctrl.reset_work, nvme_fc_reset_ctrl_work);
34513462 INIT_DELAYED_WORK(&ctrl->connect_work, nvme_fc_connect_ctrl_work);
3463+ INIT_WORK(&ctrl->ioerr_work, nvme_fc_ctrl_ioerr_work);
34523464 spin_lock_init(&ctrl->lock);
34533465
34543466 /* io queue count */
@@ -3540,6 +3552,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 85 unmodified lines
35403552
35413553 fail_ctrl:
35423554 nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING);
3555+ cancel_work_sync(&ctrl->ioerr_work);
35433556 cancel_work_sync(&ctrl->ctrl.reset_work);
35443557 cancel_delayed_work_sync(&ctrl->connect_work);
35453558
drivers/nvme/host/nvme.h+2−7
@@ -610,8 +610,6 @@ void nvme_start_freeze(struct nvme_ctrl *ctrl); · 609 unmodified lines
610610 #define NVME_QID_ANY -1
611611 struct request *nvme_alloc_request(struct request_queue *q,
612612 struct nvme_command *cmd, blk_mq_req_flags_t flags);
613−struct request *nvme_alloc_request_qid(struct request_queue *q,
614− struct nvme_command *cmd, blk_mq_req_flags_t flags, int qid);
615613 void nvme_cleanup_cmd(struct request *req);
616614 blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req,
617615 struct nvme_command *cmd);
@@ -630,7 +628,6 @@ int nvme_get_features(struct nvme_ctrl *dev, unsigned int fid, · 12 unmodified lines
630628 int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count);
631629 void nvme_stop_keep_alive(struct nvme_ctrl *ctrl);
632630 int nvme_reset_ctrl(struct nvme_ctrl *ctrl);
633−int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl);
634631 int nvme_try_sched_reset(struct nvme_ctrl *ctrl);
635632 int nvme_delete_ctrl(struct nvme_ctrl *ctrl);
636633
@@ -675,8 +672,7 @@ static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) · 38 unmodified lines
675672 kblockd_schedule_work(&head->requeue_work);
676673 }
677674
678−static inline void nvme_trace_bio_complete(struct request *req,
679− blk_status_t status)
675+static inline void nvme_trace_bio_complete(struct request *req)
680676 {
681677 struct nvme_ns *ns = req->q->queuedata;
682678
@@ -731,8 +727,7 @@ static inline void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl) · 48 unmodified lines
731727 static inline void nvme_mpath_check_last_path(struct nvme_ns *ns)
732728 {
733729 }
734−static inline void nvme_trace_bio_complete(struct request *req,
735− blk_status_t status)
730+static inline void nvme_trace_bio_complete(struct request *req)
736731 {
737732 }
738733 static inline int nvme_mpath_init(struct nvme_ctrl *ctrl,
drivers/nvme/host/pci.c+6−4
@@ -967,6 +967,7 @@ static inline struct blk_mq_tags *nvme_queue_tagset(struct nvme_queue *nvmeq) · 966 unmodified lines
967967 static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx)
968968 {
969969 struct nvme_completion *cqe = &nvmeq->cqes[idx];
970+ __u16 command_id = READ_ONCE(cqe->command_id);
970971 struct request *req;
971972
972973 /*
@@ -975,17 +976,17 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx) · 2 unmodified lines
975976 * aborts. We don't even bother to allocate a struct request
976977 * for them but rather special case them here.
977978 */
978− if (unlikely(nvme_is_aen_req(nvmeq->qid, cqe->command_id))) {
979+ if (unlikely(nvme_is_aen_req(nvmeq->qid, command_id))) {
979980 nvme_complete_async_event(&nvmeq->dev->ctrl,
980981 cqe->status, &cqe->result);
981982 return;
982983 }
983984
984− req = blk_mq_tag_to_rq(nvme_queue_tagset(nvmeq), cqe->command_id);
985+ req = blk_mq_tag_to_rq(nvme_queue_tagset(nvmeq), command_id);
985986 if (unlikely(!req)) {
986987 dev_warn(nvmeq->dev->ctrl.device,
987988 "invalid id %d completed on queue %d\n",
988− cqe->command_id, le16_to_cpu(cqe->sq_id));
989+ command_id, le16_to_cpu(cqe->sq_id));
989990 return;
990991 }
991992
@@ -3196,7 +3197,8 @@ static const struct pci_device_id nvme_id_table[] = { · 2204 unmodified lines
31963197 { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */
31973198 .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
31983199 { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */
3199− .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
3200+ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY |
3201+ NVME_QUIRK_IGNORE_DEV_SUBNQN, },
32003202 { PCI_DEVICE(0x1d1d, 0x1f1f), /* LighNVM qemu device */
32013203 .driver_data = NVME_QUIRK_LIGHTNVM, },
32023204 { PCI_DEVICE(0x1d1d, 0x2807), /* CNEX WL */
drivers/nvme/host/tcp.c+13−3
@@ -201,7 +201,7 @@ static inline size_t nvme_tcp_req_cur_offset(struct nvme_tcp_request *req) · 200 unmodified lines
201201
202202 static inline size_t nvme_tcp_req_cur_length(struct nvme_tcp_request *req)
203203 {
204− return min_t(size_t, req->iter.bvec->bv_len - req->iter.iov_offset,
204+ return min_t(size_t, iov_iter_single_seg_count(&req->iter),
205205 req->pdu_len - req->pdu_sent);
206206 }
207207
@@ -262,6 +262,16 @@ static inline void nvme_tcp_advance_req(struct nvme_tcp_request *req, · 54 unmodified lines
262262 }
263263 }
264264
265+static inline void nvme_tcp_send_all(struct nvme_tcp_queue *queue)
266+{
267+ int ret;
268+
269+ /* drain the send queue as much as we can... */
270+ do {
271+ ret = nvme_tcp_try_send(queue);
272+ } while (ret > 0);
273+}
274+
265275 static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req,
266276 bool sync, bool last)
267277 {
@@ -276,10 +286,10 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req, · 8 unmodified lines
276286 * directly, otherwise queue io_work. Also, only do that if we
277287 * are on the same cpu, so we don't introduce contention.
278288 */
279− if (queue->io_cpu == smp_processor_id() &&
289+ if (queue->io_cpu == __smp_processor_id() &&
280290 sync && empty && mutex_trylock(&queue->send_mutex)) {
281291 queue->more_requests = !last;
282− nvme_tcp_try_send(queue);
292+ nvme_tcp_send_all(queue);
283293 queue->more_requests = false;
284294 mutex_unlock(&queue->send_mutex);
285295 } else if (last) {
drivers/nvme/target/fcloop.c+4−3
@@ -1501,7 +1501,8 @@ static ssize_t · 1500 unmodified lines
15011501 fcloop_set_cmd_drop(struct device *dev, struct device_attribute *attr,
15021502 const char *buf, size_t count)
15031503 {
1504− int opcode, starting, amount;
1504+ unsigned int opcode;
1505+ int starting, amount;
15051506
15061507 if (sscanf(buf, "%x:%d:%d", &opcode, &starting, &amount) != 3)
15071508 return -EBADRQC;
@@ -1588,8 +1589,8 @@ out_destroy_class: · 80 unmodified lines
15881589
15891590 static void __exit fcloop_exit(void)
15901591 {
1591− struct fcloop_lport *lport;
1592− struct fcloop_nport *nport;
1592+ struct fcloop_lport *lport = NULL;
1593+ struct fcloop_nport *nport = NULL;
15931594 struct fcloop_tport *tport;
15941595 struct fcloop_rport *rport;
15951596 unsigned long flags;
drivers/nvme/target/rdma.c+18−8
@@ -1220,6 +1220,14 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id) · 1219 unmodified lines
12201220 }
12211221 ndev->inline_data_size = nport->inline_data_size;
12221222 ndev->inline_page_count = inline_page_count;
1223+
1224+ if (nport->pi_enable && !(cm_id->device->attrs.device_cap_flags &
1225+ IB_DEVICE_INTEGRITY_HANDOVER)) {
1226+ pr_warn("T10-PI is not supported by device %s. Disabling it\n",
1227+ cm_id->device->name);
1228+ nport->pi_enable = false;
1229+ }
1230+
12231231 ndev->device = cm_id->device;
12241232 kref_init(&ndev->ref);
12251233
@@ -1641,6 +1649,16 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue) · 415 unmodified lines
16411649 spin_lock_irqsave(&queue->state_lock, flags);
16421650 switch (queue->state) {
16431651 case NVMET_RDMA_Q_CONNECTING:
1652+ while (!list_empty(&queue->rsp_wait_list)) {
1653+ struct nvmet_rdma_rsp *rsp;
1654+
1655+ rsp = list_first_entry(&queue->rsp_wait_list,
1656+ struct nvmet_rdma_rsp,
1657+ wait_list);
1658+ list_del(&rsp->wait_list);
1659+ nvmet_rdma_put_rsp(rsp);
1660+ }
1661+ fallthrough;
16441662 case NVMET_RDMA_Q_LIVE:
16451663 queue->state = NVMET_RDMA_Q_DISCONNECTING;
16461664 disconnect = true;
@@ -1845,14 +1863,6 @@ static int nvmet_rdma_enable_port(struct nvmet_rdma_port *port) · 198 unmodified lines
18451863 goto out_destroy_id;
18461864 }
18471865
1848− if (port->nport->pi_enable &&
1849− !(cm_id->device->attrs.device_cap_flags &
1850− IB_DEVICE_INTEGRITY_HANDOVER)) {
1851− pr_err("T10-PI is not supported for %pISpcs\n", addr);
1852− ret = -EINVAL;
1853− goto out_destroy_id;
1854− }
1855−
18561866 port->cm_id = cm_id;
18571867 return 0;
18581868
drivers/opp/core.c+7−2
@@ -1092,7 +1092,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index) · 1091 unmodified lines
10921092 if (IS_ERR(opp_table->clk)) {
10931093 ret = PTR_ERR(opp_table->clk);
10941094 if (ret == -EPROBE_DEFER)
1095− goto err;
1095+ goto remove_opp_dev;
10961096
10971097 dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret);
10981098 }
@@ -1101,7 +1101,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index) · 2 unmodified lines
11011101 ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
11021102 if (ret) {
11031103 if (ret == -EPROBE_DEFER)
1104− goto err;
1104+ goto put_clk;
11051105
11061106 dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
11071107 __func__, ret);
@@ -1113,6 +1113,11 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index) · 5 unmodified lines
11131113
11141114 return opp_table;
11151115
1116+put_clk:
1117+ if (!IS_ERR(opp_table->clk))
1118+ clk_put(opp_table->clk);
1119+remove_opp_dev:
1120+ _remove_opp_dev(opp_dev, opp_table);
11161121 err:
11171122 kfree(opp_table);
11181123 return ERR_PTR(ret);
drivers/perf/arm_pmu.c+0−5
@@ -726,11 +726,6 @@ static int armpmu_get_cpu_irq(struct arm_pmu *pmu, int cpu) · 725 unmodified lines
726726 return per_cpu(hw_events->irq, cpu);
727727 }
728728
729−bool arm_pmu_irq_is_nmi(void)
730−{
731− return has_nmi;
732−}
733−
734729 /*
735730 * PMU hardware loses all context when a CPU goes offline.
736731 * When a CPU is hotplugged back in, since some hardware registers are
drivers/ptp/Kconfig+2−0
@@ -64,6 +64,7 @@ config DP83640_PHY · 63 unmodified lines
6464 depends on NETWORK_PHY_TIMESTAMPING
6565 depends on PHYLIB
6666 depends on PTP_1588_CLOCK
67+ select CRC32
6768 help
6869 Supports the DP83640 PHYTER with IEEE 1588 features.
6970
@@ -78,6 +79,7 @@ config DP83640_PHY · 8 unmodified lines
7879 config PTP_1588_CLOCK_INES
7980 tristate "ZHAW InES PTP time stamping IP core"
8081 depends on NETWORK_PHY_TIMESTAMPING
82+ depends on HAS_IOMEM
8183 depends on PHYLIB
8284 depends on PTP_1588_CLOCK
8385 help
drivers/regulator/Kconfig+1−0
@@ -881,6 +881,7 @@ config REGULATOR_QCOM_RPM · 880 unmodified lines
881881 config REGULATOR_QCOM_RPMH
882882 tristate "Qualcomm Technologies, Inc. RPMh regulator driver"
883883 depends on QCOM_RPMH || (QCOM_RPMH=n && COMPILE_TEST)
884+ depends on QCOM_COMMAND_DB || (QCOM_COMMAND_DB=n && COMPILE_TEST)
884885 help
885886 This driver supports control of PMIC regulators via the RPMh hardware
886887 block found on Qualcomm Technologies Inc. SoCs. RPMh regulator
drivers/regulator/bd718x7-regulator.c+57−0
@@ -15,6 +15,36 @@ · 14 unmodified lines
1515 #include <linux/regulator/of_regulator.h>
1616 #include <linux/slab.h>
1717
18+/* Typical regulator startup times as per data sheet in uS */
19+#define BD71847_BUCK1_STARTUP_TIME 144
20+#define BD71847_BUCK2_STARTUP_TIME 162
21+#define BD71847_BUCK3_STARTUP_TIME 162
22+#define BD71847_BUCK4_STARTUP_TIME 240
23+#define BD71847_BUCK5_STARTUP_TIME 270
24+#define BD71847_BUCK6_STARTUP_TIME 200
25+#define BD71847_LDO1_STARTUP_TIME 440
26+#define BD71847_LDO2_STARTUP_TIME 370
27+#define BD71847_LDO3_STARTUP_TIME 310
28+#define BD71847_LDO4_STARTUP_TIME 400
29+#define BD71847_LDO5_STARTUP_TIME 530
30+#define BD71847_LDO6_STARTUP_TIME 400
31+
32+#define BD71837_BUCK1_STARTUP_TIME 160
33+#define BD71837_BUCK2_STARTUP_TIME 180
34+#define BD71837_BUCK3_STARTUP_TIME 180
35+#define BD71837_BUCK4_STARTUP_TIME 180
36+#define BD71837_BUCK5_STARTUP_TIME 160
37+#define BD71837_BUCK6_STARTUP_TIME 240
38+#define BD71837_BUCK7_STARTUP_TIME 220
39+#define BD71837_BUCK8_STARTUP_TIME 200
40+#define BD71837_LDO1_STARTUP_TIME 440
41+#define BD71837_LDO2_STARTUP_TIME 370
42+#define BD71837_LDO3_STARTUP_TIME 310
43+#define BD71837_LDO4_STARTUP_TIME 400
44+#define BD71837_LDO5_STARTUP_TIME 310
45+#define BD71837_LDO6_STARTUP_TIME 400
46+#define BD71837_LDO7_STARTUP_TIME 530
47+
1848 /*
1949 * BD718(37/47/50) have two "enable control modes". ON/OFF can either be
2050 * controlled by software - or by PMIC internal HW state machine. Whether
@@ -613,6 +643,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 592 unmodified lines
613643 .vsel_mask = DVS_BUCK_RUN_MASK,
614644 .enable_reg = BD718XX_REG_BUCK1_CTRL,
615645 .enable_mask = BD718XX_BUCK_EN,
646+ .enable_time = BD71847_BUCK1_STARTUP_TIME,
616647 .owner = THIS_MODULE,
617648 .of_parse_cb = buck_set_hw_dvs_levels,
618649 },
@@ -646,6 +677,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 27 unmodified lines
646677 .vsel_mask = DVS_BUCK_RUN_MASK,
647678 .enable_reg = BD718XX_REG_BUCK2_CTRL,
648679 .enable_mask = BD718XX_BUCK_EN,
680+ .enable_time = BD71847_BUCK2_STARTUP_TIME,
649681 .owner = THIS_MODULE,
650682 .of_parse_cb = buck_set_hw_dvs_levels,
651683 },
@@ -680,6 +712,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 28 unmodified lines
680712 .linear_range_selectors = bd71847_buck3_volt_range_sel,
681713 .enable_reg = BD718XX_REG_1ST_NODVS_BUCK_CTRL,
682714 .enable_mask = BD718XX_BUCK_EN,
715+ .enable_time = BD71847_BUCK3_STARTUP_TIME,
683716 .owner = THIS_MODULE,
684717 },
685718 .init = {
@@ -706,6 +739,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 20 unmodified lines
706739 .vsel_range_mask = BD71847_BUCK4_RANGE_MASK,
707740 .linear_range_selectors = bd71847_buck4_volt_range_sel,
708741 .enable_mask = BD718XX_BUCK_EN,
742+ .enable_time = BD71847_BUCK4_STARTUP_TIME,
709743 .owner = THIS_MODULE,
710744 },
711745 .init = {
@@ -727,6 +761,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 15 unmodified lines
727761 .vsel_mask = BD718XX_3RD_NODVS_BUCK_MASK,
728762 .enable_reg = BD718XX_REG_3RD_NODVS_BUCK_CTRL,
729763 .enable_mask = BD718XX_BUCK_EN,
764+ .enable_time = BD71847_BUCK5_STARTUP_TIME,
730765 .owner = THIS_MODULE,
731766 },
732767 .init = {
@@ -750,6 +785,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 17 unmodified lines
750785 .vsel_mask = BD718XX_4TH_NODVS_BUCK_MASK,
751786 .enable_reg = BD718XX_REG_4TH_NODVS_BUCK_CTRL,
752787 .enable_mask = BD718XX_BUCK_EN,
788+ .enable_time = BD71847_BUCK6_STARTUP_TIME,
753789 .owner = THIS_MODULE,
754790 },
755791 .init = {
@@ -775,6 +811,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 19 unmodified lines
775811 .linear_range_selectors = bd718xx_ldo1_volt_range_sel,
776812 .enable_reg = BD718XX_REG_LDO1_VOLT,
777813 .enable_mask = BD718XX_LDO_EN,
814+ .enable_time = BD71847_LDO1_STARTUP_TIME,
778815 .owner = THIS_MODULE,
779816 },
780817 .init = {
@@ -796,6 +833,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 15 unmodified lines
796833 .n_voltages = ARRAY_SIZE(ldo_2_volts),
797834 .enable_reg = BD718XX_REG_LDO2_VOLT,
798835 .enable_mask = BD718XX_LDO_EN,
836+ .enable_time = BD71847_LDO2_STARTUP_TIME,
799837 .owner = THIS_MODULE,
800838 },
801839 .init = {
@@ -818,6 +856,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 16 unmodified lines
818856 .vsel_mask = BD718XX_LDO3_MASK,
819857 .enable_reg = BD718XX_REG_LDO3_VOLT,
820858 .enable_mask = BD718XX_LDO_EN,
859+ .enable_time = BD71847_LDO3_STARTUP_TIME,
821860 .owner = THIS_MODULE,
822861 },
823862 .init = {
@@ -840,6 +879,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 16 unmodified lines
840879 .vsel_mask = BD718XX_LDO4_MASK,
841880 .enable_reg = BD718XX_REG_LDO4_VOLT,
842881 .enable_mask = BD718XX_LDO_EN,
882+ .enable_time = BD71847_LDO4_STARTUP_TIME,
843883 .owner = THIS_MODULE,
844884 },
845885 .init = {
@@ -865,6 +905,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 19 unmodified lines
865905 .linear_range_selectors = bd71847_ldo5_volt_range_sel,
866906 .enable_reg = BD718XX_REG_LDO5_VOLT,
867907 .enable_mask = BD718XX_LDO_EN,
908+ .enable_time = BD71847_LDO5_STARTUP_TIME,
868909 .owner = THIS_MODULE,
869910 },
870911 .init = {
@@ -889,6 +930,7 @@ static struct bd718xx_regulator_data bd71847_regulators[] = { · 18 unmodified lines
889930 .vsel_mask = BD718XX_LDO6_MASK,
890931 .enable_reg = BD718XX_REG_LDO6_VOLT,
891932 .enable_mask = BD718XX_LDO_EN,
933+ .enable_time = BD71847_LDO6_STARTUP_TIME,
892934 .owner = THIS_MODULE,
893935 },
894936 .init = {
@@ -942,6 +984,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 47 unmodified lines
942984 .vsel_mask = DVS_BUCK_RUN_MASK,
943985 .enable_reg = BD718XX_REG_BUCK1_CTRL,
944986 .enable_mask = BD718XX_BUCK_EN,
987+ .enable_time = BD71837_BUCK1_STARTUP_TIME,
945988 .owner = THIS_MODULE,
946989 .of_parse_cb = buck_set_hw_dvs_levels,
947990 },
@@ -975,6 +1018,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 27 unmodified lines
9751018 .vsel_mask = DVS_BUCK_RUN_MASK,
9761019 .enable_reg = BD718XX_REG_BUCK2_CTRL,
9771020 .enable_mask = BD718XX_BUCK_EN,
1021+ .enable_time = BD71837_BUCK2_STARTUP_TIME,
9781022 .owner = THIS_MODULE,
9791023 .of_parse_cb = buck_set_hw_dvs_levels,
9801024 },
@@ -1005,6 +1049,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 24 unmodified lines
10051049 .vsel_mask = DVS_BUCK_RUN_MASK,
10061050 .enable_reg = BD71837_REG_BUCK3_CTRL,
10071051 .enable_mask = BD718XX_BUCK_EN,
1052+ .enable_time = BD71837_BUCK3_STARTUP_TIME,
10081053 .owner = THIS_MODULE,
10091054 .of_parse_cb = buck_set_hw_dvs_levels,
10101055 },
@@ -1033,6 +1078,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 22 unmodified lines
10331078 .vsel_mask = DVS_BUCK_RUN_MASK,
10341079 .enable_reg = BD71837_REG_BUCK4_CTRL,
10351080 .enable_mask = BD718XX_BUCK_EN,
1081+ .enable_time = BD71837_BUCK4_STARTUP_TIME,
10361082 .owner = THIS_MODULE,
10371083 .of_parse_cb = buck_set_hw_dvs_levels,
10381084 },
@@ -1065,6 +1111,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 26 unmodified lines
10651111 .linear_range_selectors = bd71837_buck5_volt_range_sel,
10661112 .enable_reg = BD718XX_REG_1ST_NODVS_BUCK_CTRL,
10671113 .enable_mask = BD718XX_BUCK_EN,
1114+ .enable_time = BD71837_BUCK5_STARTUP_TIME,
10681115 .owner = THIS_MODULE,
10691116 },
10701117 .init = {
@@ -1088,6 +1135,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 17 unmodified lines
10881135 .vsel_mask = BD71837_BUCK6_MASK,
10891136 .enable_reg = BD718XX_REG_2ND_NODVS_BUCK_CTRL,
10901137 .enable_mask = BD718XX_BUCK_EN,
1138+ .enable_time = BD71837_BUCK6_STARTUP_TIME,
10911139 .owner = THIS_MODULE,
10921140 },
10931141 .init = {
@@ -1109,6 +1157,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 15 unmodified lines
11091157 .vsel_mask = BD718XX_3RD_NODVS_BUCK_MASK,
11101158 .enable_reg = BD718XX_REG_3RD_NODVS_BUCK_CTRL,
11111159 .enable_mask = BD718XX_BUCK_EN,
1160+ .enable_time = BD71837_BUCK7_STARTUP_TIME,
11121161 .owner = THIS_MODULE,
11131162 },
11141163 .init = {
@@ -1132,6 +1181,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 17 unmodified lines
11321181 .vsel_mask = BD718XX_4TH_NODVS_BUCK_MASK,
11331182 .enable_reg = BD718XX_REG_4TH_NODVS_BUCK_CTRL,
11341183 .enable_mask = BD718XX_BUCK_EN,
1184+ .enable_time = BD71837_BUCK8_STARTUP_TIME,
11351185 .owner = THIS_MODULE,
11361186 },
11371187 .init = {
@@ -1157,6 +1207,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 19 unmodified lines
11571207 .linear_range_selectors = bd718xx_ldo1_volt_range_sel,
11581208 .enable_reg = BD718XX_REG_LDO1_VOLT,
11591209 .enable_mask = BD718XX_LDO_EN,
1210+ .enable_time = BD71837_LDO1_STARTUP_TIME,
11601211 .owner = THIS_MODULE,
11611212 },
11621213 .init = {
@@ -1178,6 +1229,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 15 unmodified lines
11781229 .n_voltages = ARRAY_SIZE(ldo_2_volts),
11791230 .enable_reg = BD718XX_REG_LDO2_VOLT,
11801231 .enable_mask = BD718XX_LDO_EN,
1232+ .enable_time = BD71837_LDO2_STARTUP_TIME,
11811233 .owner = THIS_MODULE,
11821234 },
11831235 .init = {
@@ -1200,6 +1252,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 16 unmodified lines
12001252 .vsel_mask = BD718XX_LDO3_MASK,
12011253 .enable_reg = BD718XX_REG_LDO3_VOLT,
12021254 .enable_mask = BD718XX_LDO_EN,
1255+ .enable_time = BD71837_LDO3_STARTUP_TIME,
12031256 .owner = THIS_MODULE,
12041257 },
12051258 .init = {
@@ -1222,6 +1275,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 16 unmodified lines
12221275 .vsel_mask = BD718XX_LDO4_MASK,
12231276 .enable_reg = BD718XX_REG_LDO4_VOLT,
12241277 .enable_mask = BD718XX_LDO_EN,
1278+ .enable_time = BD71837_LDO4_STARTUP_TIME,
12251279 .owner = THIS_MODULE,
12261280 },
12271281 .init = {
@@ -1246,6 +1300,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 18 unmodified lines
12461300 .vsel_mask = BD71837_LDO5_MASK,
12471301 .enable_reg = BD718XX_REG_LDO5_VOLT,
12481302 .enable_mask = BD718XX_LDO_EN,
1303+ .enable_time = BD71837_LDO5_STARTUP_TIME,
12491304 .owner = THIS_MODULE,
12501305 },
12511306 .init = {
@@ -1272,6 +1327,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 20 unmodified lines
12721327 .vsel_mask = BD718XX_LDO6_MASK,
12731328 .enable_reg = BD718XX_REG_LDO6_VOLT,
12741329 .enable_mask = BD718XX_LDO_EN,
1330+ .enable_time = BD71837_LDO6_STARTUP_TIME,
12751331 .owner = THIS_MODULE,
12761332 },
12771333 .init = {
@@ -1296,6 +1352,7 @@ static struct bd718xx_regulator_data bd71837_regulators[] = { · 18 unmodified lines
12961352 .vsel_mask = BD71837_LDO7_MASK,
12971353 .enable_reg = BD71837_REG_LDO7_VOLT,
12981354 .enable_mask = BD718XX_LDO_EN,
1355+ .enable_time = BD71837_LDO7_STARTUP_TIME,
12991356 .owner = THIS_MODULE,
13001357 },
13011358 .init = {
drivers/regulator/pf8x00-regulator.c+6−2
@@ -469,13 +469,17 @@ static int pf8x00_i2c_probe(struct i2c_client *client) · 468 unmodified lines
469469 }
470470
471471 static const struct of_device_id pf8x00_dt_ids[] = {
472− { .compatible = "nxp,pf8x00",},
472+ { .compatible = "nxp,pf8100",},
473+ { .compatible = "nxp,pf8121a",},
474+ { .compatible = "nxp,pf8200",},
473475 { }
474476 };
475477 MODULE_DEVICE_TABLE(of, pf8x00_dt_ids);
476478
477479 static const struct i2c_device_id pf8x00_i2c_id[] = {
478− { "pf8x00", 0 },
480+ { "pf8100", 0 },
481+ { "pf8121a", 0 },
482+ { "pf8200", 0 },
479483 {},
480484 };
481485 MODULE_DEVICE_TABLE(i2c, pf8x00_i2c_id);
drivers/regulator/qcom-rpmh-regulator.c+1−1
@@ -726,7 +726,7 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = { · 725 unmodified lines
726726 static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
727727 .regulator_type = VRM,
728728 .ops = &rpmh_regulator_vrm_ops,
729− .voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 1600),
729+ .voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 16000),
730730 .n_voltages = 5,
731731 .pmic_mode_map = pmic_mode_map_pmic5_smps,
732732 .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
drivers/s390/net/qeth_core.h+2−1
@@ -1079,7 +1079,8 @@ struct qeth_card *qeth_get_card_by_busid(char *bus_id); · 1078 unmodified lines
10791079 void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads,
10801080 int clear_start_mask);
10811081 int qeth_threads_running(struct qeth_card *, unsigned long);
1082−int qeth_set_offline(struct qeth_card *card, bool resetting);
1082+int qeth_set_offline(struct qeth_card *card, const struct qeth_discipline *disc,
1083+ bool resetting);
10831084
10841085 int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
10851086 int (*reply_cb)
drivers/s390/net/qeth_core_main.c+25−13
@@ -5507,12 +5507,12 @@ out: · 5506 unmodified lines
55075507 return rc;
55085508 }
55095509
5510−static int qeth_set_online(struct qeth_card *card)
5510+static int qeth_set_online(struct qeth_card *card,
5511+ const struct qeth_discipline *disc)
55115512 {
55125513 bool carrier_ok;
55135514 int rc;
55145515
5515− mutex_lock(&card->discipline_mutex);
55165516 mutex_lock(&card->conf_mutex);
55175517 QETH_CARD_TEXT(card, 2, "setonlin");
55185518
@@ -5529,7 +5529,7 @@ static int qeth_set_online(struct qeth_card *card) · 10 unmodified lines
55295529 /* no need for locking / error handling at this early stage: */
55305530 qeth_set_real_num_tx_queues(card, qeth_tx_actual_queues(card));
55315531
5532− rc = card->discipline->set_online(card, carrier_ok);
5532+ rc = disc->set_online(card, carrier_ok);
55335533 if (rc)
55345534 goto err_online;
55355535
@@ -5537,7 +5537,6 @@ static int qeth_set_online(struct qeth_card *card) · 1 unmodified line
55375537 kobject_uevent(&card->gdev->dev.kobj, KOBJ_CHANGE);
55385538
55395539 mutex_unlock(&card->conf_mutex);
5540− mutex_unlock(&card->discipline_mutex);
55415540 return 0;
55425541
55435542 err_online:
@@ -5552,15 +5551,14 @@ err_hardsetup: · 8 unmodified lines
55525551 qdio_free(CARD_DDEV(card));
55535552
55545553 mutex_unlock(&card->conf_mutex);
5555− mutex_unlock(&card->discipline_mutex);
55565554 return rc;
55575555 }
55585556
5559−int qeth_set_offline(struct qeth_card *card, bool resetting)
5557+int qeth_set_offline(struct qeth_card *card, const struct qeth_discipline *disc,
5558+ bool resetting)
55605559 {
55615560 int rc, rc2, rc3;
55625561
5563− mutex_lock(&card->discipline_mutex);
55645562 mutex_lock(&card->conf_mutex);
55655563 QETH_CARD_TEXT(card, 3, "setoffl");
55665564
@@ -5581,7 +5579,7 @@ int qeth_set_offline(struct qeth_card *card, bool resetting) · 14 unmodified lines
55815579
55825580 cancel_work_sync(&card->rx_mode_work);
55835581
5584− card->discipline->set_offline(card);
5582+ disc->set_offline(card);
55855583
55865584 qeth_qdio_clear_card(card, 0);
55875585 qeth_drain_output_queues(card);
@@ -5602,16 +5600,19 @@ int qeth_set_offline(struct qeth_card *card, bool resetting) · 14 unmodified lines
56025600 kobject_uevent(&card->gdev->dev.kobj, KOBJ_CHANGE);
56035601
56045602 mutex_unlock(&card->conf_mutex);
5605− mutex_unlock(&card->discipline_mutex);
56065603 return 0;
56075604 }
56085605 EXPORT_SYMBOL_GPL(qeth_set_offline);
56095606
56105607 static int qeth_do_reset(void *data)
56115608 {
5609+ const struct qeth_discipline *disc;
56125610 struct qeth_card *card = data;
56135611 int rc;
56145612
5613+ /* Lock-free, other users will block until we are done. */
5614+ disc = card->discipline;
5615+
56155616 QETH_CARD_TEXT(card, 2, "recover1");
56165617 if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD))
56175618 return 0;
@@ -5619,8 +5620,8 @@ static int qeth_do_reset(void *data) · 1 unmodified line
56195620 dev_warn(&card->gdev->dev,
56205621 "A recovery process has been started for the device\n");
56215622
5622− qeth_set_offline(card, true);
5623− rc = qeth_set_online(card);
5623+ qeth_set_offline(card, disc, true);
5624+ rc = qeth_set_online(card, disc);
56245625 if (!rc) {
56255626 dev_info(&card->gdev->dev,
56265627 "Device successfully recovered!\n");
@@ -6584,6 +6585,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) · 957 unmodified lines
65846585 break;
65856586 default:
65866587 card->info.layer_enforced = true;
6588+ /* It's so early that we don't need the discipline_mutex yet. */
65876589 rc = qeth_core_load_discipline(card, enforced_disc);
65886590 if (rc)
65896591 goto err_load;
@@ -6616,10 +6618,12 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev) · 26 unmodified lines
66166618
66176619 QETH_CARD_TEXT(card, 2, "removedv");
66186620
6621+ mutex_lock(&card->discipline_mutex);
66196622 if (card->discipline) {
66206623 card->discipline->remove(gdev);
66216624 qeth_core_free_discipline(card);
66226625 }
6626+ mutex_unlock(&card->discipline_mutex);
66236627
66246628 qeth_free_qdio_queues(card);
66256629
@@ -6634,6 +6638,7 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev) · 8 unmodified lines
66346638 int rc = 0;
66356639 enum qeth_discipline_id def_discipline;
66366640
6641+ mutex_lock(&card->discipline_mutex);
66376642 if (!card->discipline) {
66386643 def_discipline = IS_IQD(card) ? QETH_DISCIPLINE_LAYER3 :
66396644 QETH_DISCIPLINE_LAYER2;
@@ -6647,16 +6652,23 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev) · 7 unmodified lines
66476652 }
66486653 }
66496654
6650− rc = qeth_set_online(card);
6655+ rc = qeth_set_online(card, card->discipline);
6656+
66516657 err:
6658+ mutex_unlock(&card->discipline_mutex);
66526659 return rc;
66536660 }
66546661
66556662 static int qeth_core_set_offline(struct ccwgroup_device *gdev)
66566663 {
66576664 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
6665+ int rc;
66586666
6659− return qeth_set_offline(card, false);
6667+ mutex_lock(&card->discipline_mutex);
6668+ rc = qeth_set_offline(card, card->discipline, false);
6669+ mutex_unlock(&card->discipline_mutex);
6670+
6671+ return rc;
66606672 }
66616673
66626674 static void qeth_core_shutdown(struct ccwgroup_device *gdev)
drivers/s390/net/qeth_l2_main.c+1−1
@@ -2208,7 +2208,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *gdev) · 2207 unmodified lines
22082208 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
22092209
22102210 if (gdev->state == CCWGROUP_ONLINE)
2211− qeth_set_offline(card, false);
2211+ qeth_set_offline(card, card->discipline, false);
22122212
22132213 cancel_work_sync(&card->close_dev_work);
22142214 if (card->dev->reg_state == NETREG_REGISTERED)
drivers/s390/net/qeth_l3_main.c+2−2
@@ -1813,7 +1813,7 @@ static netdev_features_t qeth_l3_osa_features_check(struct sk_buff *skb, · 1812 unmodified lines
18131813 struct net_device *dev,
18141814 netdev_features_t features)
18151815 {
1816− if (qeth_get_ip_version(skb) != 4)
1816+ if (vlan_get_protocol(skb) != htons(ETH_P_IP))
18171817 features &= ~NETIF_F_HW_VLAN_CTAG_TX;
18181818 return qeth_features_check(skb, dev, features);
18191819 }
@@ -1971,7 +1971,7 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev) · 151 unmodified lines
19711971 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
19721972
19731973 if (cgdev->state == CCWGROUP_ONLINE)
1974− qeth_set_offline(card, false);
1974+ qeth_set_offline(card, card->discipline, false);
19751975
19761976 cancel_work_sync(&card->close_dev_work);
19771977 if (card->dev->reg_state == NETREG_REGISTERED)
drivers/scsi/cxgbi/cxgb4i/Kconfig+1−0
@@ -4,6 +4,7 @@ config SCSI_CXGB4_ISCSI · 3 unmodified lines
44 depends on PCI && INET && (IPV6 || IPV6=n)
55 depends on THERMAL || !THERMAL
66 depends on ETHERNET
7+ depends on TLS || TLS=n
78 select NET_VENDOR_CHELSIO
89 select CHELSIO_T4
910 select CHELSIO_LIB
drivers/scsi/hisi_sas/hisi_sas.h+4−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/debugfs.h>
1515 #include <linux/dmapool.h>
1616 #include <linux/iopoll.h>
17+#include <linux/irq.h>
1718 #include <linux/lcm.h>
1819 #include <linux/libata.h>
1920 #include <linux/mfd/syscon.h>
@@ -294,6 +295,7 @@ enum { · 274 unmodified lines
294295
295296 struct hisi_sas_hw {
296297 int (*hw_init)(struct hisi_hba *hisi_hba);
298+ int (*interrupt_preinit)(struct hisi_hba *hisi_hba);
297299 void (*setup_itct)(struct hisi_hba *hisi_hba,
298300 struct hisi_sas_device *device);
299301 int (*slot_index_alloc)(struct hisi_hba *hisi_hba,
@@ -393,6 +395,8 @@ struct hisi_hba { · 93 unmodified lines
393395 u32 refclk_frequency_mhz;
394396 u8 sas_addr[SAS_ADDR_SIZE];
395397
398+ int *irq_map; /* v2 hw */
399+
396400 int n_phy;
397401 spinlock_t lock;
398402 struct semaphore sem;
drivers/scsi/hisi_sas/hisi_sas_main.c+11−0
@@ -2614,6 +2614,13 @@ err_out: · 2613 unmodified lines
26142614 return NULL;
26152615 }
26162616
2617+static int hisi_sas_interrupt_preinit(struct hisi_hba *hisi_hba)
2618+{
2619+ if (hisi_hba->hw->interrupt_preinit)
2620+ return hisi_hba->hw->interrupt_preinit(hisi_hba);
2621+ return 0;
2622+}
2623+
26172624 int hisi_sas_probe(struct platform_device *pdev,
26182625 const struct hisi_sas_hw *hw)
26192626 {
@@ -2671,6 +2678,10 @@ int hisi_sas_probe(struct platform_device *pdev, · 51 unmodified lines
26712678 sha->sas_port[i] = &hisi_hba->port[i].sas_port;
26722679 }
26732680
2681+ rc = hisi_sas_interrupt_preinit(hisi_hba);
2682+ if (rc)
2683+ goto err_out_ha;
2684+
26742685 rc = scsi_add_host(shost, &pdev->dev);
26752686 if (rc)
26762687 goto err_out_ha;
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c+53−13
@@ -3302,6 +3302,28 @@ static irq_handler_t fatal_interrupts[HISI_SAS_FATAL_INT_NR] = { · 3301 unmodified lines
33023302 fatal_axi_int_v2_hw
33033303 };
33043304
3305+#define CQ0_IRQ_INDEX (96)
3306+
3307+static int hisi_sas_v2_interrupt_preinit(struct hisi_hba *hisi_hba)
3308+{
3309+ struct platform_device *pdev = hisi_hba->platform_dev;
3310+ struct Scsi_Host *shost = hisi_hba->shost;
3311+ struct irq_affinity desc = {
3312+ .pre_vectors = CQ0_IRQ_INDEX,
3313+ .post_vectors = 16,
3314+ };
3315+ int resv = desc.pre_vectors + desc.post_vectors, minvec = resv + 1, nvec;
3316+
3317+ nvec = devm_platform_get_irqs_affinity(pdev, &desc, minvec, 128,
3318+ &hisi_hba->irq_map);
3319+ if (nvec < 0)
3320+ return nvec;
3321+
3322+ shost->nr_hw_queues = hisi_hba->cq_nvecs = nvec - resv;
3323+
3324+ return 0;
3325+}
3326+
33053327 /*
33063328 * There is a limitation in the hip06 chipset that we need
33073329 * to map in all mbigen interrupts, even if they are not used.
@@ -3310,14 +3332,11 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) · 2 unmodified lines
33103332 {
33113333 struct platform_device *pdev = hisi_hba->platform_dev;
33123334 struct device *dev = &pdev->dev;
3313− int irq, rc = 0, irq_map[128];
3335+ int irq, rc = 0;
33143336 int i, phy_no, fatal_no, queue_no;
33153337
3316− for (i = 0; i < 128; i++)
3317− irq_map[i] = platform_get_irq(pdev, i);
3318−
33193338 for (i = 0; i < HISI_SAS_PHY_INT_NR; i++) {
3320− irq = irq_map[i + 1]; /* Phy up/down is irq1 */
3339+ irq = hisi_hba->irq_map[i + 1]; /* Phy up/down is irq1 */
33213340 rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
33223341 DRV_NAME " phy", hisi_hba);
33233342 if (rc) {
@@ -3331,7 +3350,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) · 7 unmodified lines
33313350 for (phy_no = 0; phy_no < hisi_hba->n_phy; phy_no++) {
33323351 struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
33333352
3334− irq = irq_map[phy_no + 72];
3353+ irq = hisi_hba->irq_map[phy_no + 72];
33353354 rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
33363355 DRV_NAME " sata", phy);
33373356 if (rc) {
@@ -3343,7 +3362,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) · 5 unmodified lines
33433362 }
33443363
33453364 for (fatal_no = 0; fatal_no < HISI_SAS_FATAL_INT_NR; fatal_no++) {
3346− irq = irq_map[fatal_no + 81];
3365+ irq = hisi_hba->irq_map[fatal_no + 81];
33473366 rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
33483367 DRV_NAME " fatal", hisi_hba);
33493368 if (rc) {
@@ -3354,24 +3373,22 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba) · 4 unmodified lines
33543373 }
33553374 }
33563375
3357− for (queue_no = 0; queue_no < hisi_hba->queue_count; queue_no++) {
3376+ for (queue_no = 0; queue_no < hisi_hba->cq_nvecs; queue_no++) {
33583377 struct hisi_sas_cq *cq = &hisi_hba->cq[queue_no];
33593378
3360− cq->irq_no = irq_map[queue_no + 96];
3379+ cq->irq_no = hisi_hba->irq_map[queue_no + 96];
33613380 rc = devm_request_threaded_irq(dev, cq->irq_no,
33623381 cq_interrupt_v2_hw,
33633382 cq_thread_v2_hw, IRQF_ONESHOT,
33643383 DRV_NAME " cq", cq);
33653384 if (rc) {
33663385 dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
3367− irq, rc);
3386+ cq->irq_no, rc);
33683387 rc = -ENOENT;
33693388 goto err_out;
33703389 }
3390+ cq->irq_mask = irq_get_affinity_mask(cq->irq_no);
33713391 }
3372−
3373− hisi_hba->cq_nvecs = hisi_hba->queue_count;
3374−
33753392 err_out:
33763393 return rc;
33773394 }
@@ -3529,6 +3546,26 @@ static struct device_attribute *host_attrs_v2_hw[] = { · 151 unmodified lines
35293546 NULL
35303547 };
35313548
3549+static int map_queues_v2_hw(struct Scsi_Host *shost)
3550+{
3551+ struct hisi_hba *hisi_hba = shost_priv(shost);
3552+ struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
3553+ const struct cpumask *mask;
3554+ unsigned int queue, cpu;
3555+
3556+ for (queue = 0; queue < qmap->nr_queues; queue++) {
3557+ mask = irq_get_affinity_mask(hisi_hba->irq_map[96 + queue]);
3558+ if (!mask)
3559+ continue;
3560+
3561+ for_each_cpu(cpu, mask)
3562+ qmap->mq_map[cpu] = qmap->queue_offset + queue;
3563+ }
3564+
3565+ return 0;
3566+
3567+}
3568+
35323569 static struct scsi_host_template sht_v2_hw = {
35333570 .name = DRV_NAME,
35343571 .proc_name = DRV_NAME,
@@ -3553,10 +3590,13 @@ static struct scsi_host_template sht_v2_hw = { · 18 unmodified lines
35533590 #endif
35543591 .shost_attrs = host_attrs_v2_hw,
35553592 .host_reset = hisi_sas_host_reset,
3593+ .map_queues = map_queues_v2_hw,
3594+ .host_tagset = 1,
35563595 };
35573596
35583597 static const struct hisi_sas_hw hisi_sas_v2_hw = {
35593598 .hw_init = hisi_sas_v2_init,
3599+ .interrupt_preinit = hisi_sas_v2_interrupt_preinit,
35603600 .setup_itct = setup_itct_v2_hw,
35613601 .slot_index_alloc = slot_index_alloc_quirk_v2_hw,
35623602 .alloc_dev = alloc_dev_quirk_v2_hw,
drivers/scsi/megaraid/megaraid_sas_base.c+39−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <linux/poll.h>
3838 #include <linux/vmalloc.h>
3939 #include <linux/irq_poll.h>
40+#include <linux/blk-mq-pci.h>
4041
4142 #include <scsi/scsi.h>
4243 #include <scsi/scsi_cmnd.h>
@@ -113,6 +114,10 @@ unsigned int enable_sdev_max_qd; · 70 unmodified lines
113114 module_param(enable_sdev_max_qd, int, 0444);
114115 MODULE_PARM_DESC(enable_sdev_max_qd, "Enable sdev max qd as can_queue. Default: 0");
115116
117+int host_tagset_enable = 1;
118+module_param(host_tagset_enable, int, 0444);
119+MODULE_PARM_DESC(host_tagset_enable, "Shared host tagset enable/disable Default: enable(1)");
120+
116121 MODULE_LICENSE("GPL");
117122 MODULE_VERSION(MEGASAS_VERSION);
118123 MODULE_AUTHOR("megaraidlinux.pdl@broadcom.com");
@@ -3119,6 +3124,19 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev, · 3000 unmodified lines
31193124 return 0;
31203125 }
31213126
3127+static int megasas_map_queues(struct Scsi_Host *shost)
3128+{
3129+ struct megasas_instance *instance;
3130+
3131+ instance = (struct megasas_instance *)shost->hostdata;
3132+
3133+ if (shost->nr_hw_queues == 1)
3134+ return 0;
3135+
3136+ return blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT],
3137+ instance->pdev, instance->low_latency_index_start);
3138+}
3139+
31223140 static void megasas_aen_polling(struct work_struct *work);
31233141
31243142 /**
@@ -3427,6 +3445,7 @@ static struct scsi_host_template megasas_template = { · 302 unmodified lines
34273445 .eh_timed_out = megasas_reset_timer,
34283446 .shost_attrs = megaraid_host_attrs,
34293447 .bios_param = megasas_bios_param,
3448+ .map_queues = megasas_map_queues,
34303449 .change_queue_depth = scsi_change_queue_depth,
34313450 .max_segment_size = 0xffffffff,
34323451 };
@@ -6808,6 +6827,26 @@ static int megasas_io_attach(struct megasas_instance *instance) · 3375 unmodified lines
68086827 host->max_lun = MEGASAS_MAX_LUN;
68096828 host->max_cmd_len = 16;
68106829
6830+ /* Use shared host tagset only for fusion adaptors
6831+ * if there are managed interrupts (smp affinity enabled case).
6832+ * Single msix_vectors in kdump, so shared host tag is also disabled.
6833+ */
6834+
6835+ host->host_tagset = 0;
6836+ host->nr_hw_queues = 1;
6837+
6838+ if ((instance->adapter_type != MFI_SERIES) &&
6839+ (instance->msix_vectors > instance->low_latency_index_start) &&
6840+ host_tagset_enable &&
6841+ instance->smp_affinity_enable) {
6842+ host->host_tagset = 1;
6843+ host->nr_hw_queues = instance->msix_vectors -
6844+ instance->low_latency_index_start;
6845+ }
6846+
6847+ dev_info(&instance->pdev->dev,
6848+ "Max firmware commands: %d shared with nr_hw_queues = %d\n",
6849+ instance->max_fw_cmds, host->nr_hw_queues);
68116850 /*
68126851 * Notify the mid-layer about the new controller
68136852 */
drivers/scsi/megaraid/megaraid_sas_fusion.c+16−13
@@ -359,24 +359,29 @@ megasas_get_msix_index(struct megasas_instance *instance, · 358 unmodified lines
359359 {
360360 int sdev_busy;
361361
362− /* nr_hw_queue = 1 for MegaRAID */
363− struct blk_mq_hw_ctx *hctx =
364− scmd->device->request_queue->queue_hw_ctx[0];
365−
366− sdev_busy = atomic_read(&hctx->nr_active);
362+ /* TBD - if sml remove device_busy in future, driver
363+ * should track counter in internal structure.
364+ */
365+ sdev_busy = atomic_read(&scmd->device->device_busy);
367366
368367 if (instance->perf_mode == MR_BALANCED_PERF_MODE &&
369− sdev_busy > (data_arms * MR_DEVICE_HIGH_IOPS_DEPTH))
368+ sdev_busy > (data_arms * MR_DEVICE_HIGH_IOPS_DEPTH)) {
370369 cmd->request_desc->SCSIIO.MSIxIndex =
371370 mega_mod64((atomic64_add_return(1, &instance->high_iops_outstanding) /
372371 MR_HIGH_IOPS_BATCH_COUNT), instance->low_latency_index_start);
373− else if (instance->msix_load_balance)
372+ } else if (instance->msix_load_balance) {
374373 cmd->request_desc->SCSIIO.MSIxIndex =
375374 (mega_mod64(atomic64_add_return(1, &instance->total_io_count),
376375 instance->msix_vectors));
377− else
376+ } else if (instance->host->nr_hw_queues > 1) {
377+ u32 tag = blk_mq_unique_tag(scmd->request);
378+
379+ cmd->request_desc->SCSIIO.MSIxIndex = blk_mq_unique_tag_to_hwq(tag) +
380+ instance->low_latency_index_start;
381+ } else {
378382 cmd->request_desc->SCSIIO.MSIxIndex =
379383 instance->reply_map[raw_smp_processor_id()];
384+ }
380385 }
381386
382387 /**
@@ -956,9 +961,6 @@ megasas_alloc_cmds_fusion(struct megasas_instance *instance) · 573 unmodified lines
956961 if (megasas_alloc_cmdlist_fusion(instance))
957962 goto fail_exit;
958963
959− dev_info(&instance->pdev->dev, "Configured max firmware commands: %d\n",
960− instance->max_fw_cmds);
961−
962964 /* The first 256 bytes (SMID 0) is not used. Don't add to the cmd list */
963965 io_req_base = fusion->io_request_frames + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE;
964966 io_req_base_phys = fusion->io_request_frames_phys + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE;
@@ -1102,8 +1104,9 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) · 137 unmodified lines
11021104 MR_HIGH_IOPS_QUEUE_COUNT) && cur_intr_coalescing)
11031105 instance->perf_mode = MR_BALANCED_PERF_MODE;
11041106
1105− dev_info(&instance->pdev->dev, "Performance mode :%s\n",
1106− MEGASAS_PERF_MODE_2STR(instance->perf_mode));
1107+ dev_info(&instance->pdev->dev, "Performance mode :%s (latency index = %d)\n",
1108+ MEGASAS_PERF_MODE_2STR(instance->perf_mode),
1109+ instance->low_latency_index_start);
11071110
11081111 instance->fw_sync_cache_support = (scratch_pad_1 &
11091112 MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0;
drivers/scsi/mpt3sas/Kconfig+1−1
@@ -79,5 +79,5 @@ config SCSI_MPT2SAS · 78 unmodified lines
7979 select SCSI_MPT3SAS
8080 depends on PCI && SCSI
8181 help
82− Dummy config option for backwards compatiblity: configure the MPT3SAS
82+ Dummy config option for backwards compatibility: configure the MPT3SAS
8383 driver instead.
drivers/scsi/mpt3sas/mpt3sas_base.c+1−1
@@ -5034,7 +5034,7 @@ _base_check_for_trigger_pages_support(struct MPT3SAS_ADAPTER *ioc) · 5033 unmodified lines
50345034 static void
50355035 _base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
50365036 {
5037− u16 trigger_flags;
5037+ int trigger_flags;
50385038
50395039 /*
50405040 * Default setting of master trigger.
drivers/scsi/qedi/qedi_main.c+2−2
@@ -2245,7 +2245,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type, · 2244 unmodified lines
22452245 chap_name);
22462246 break;
22472247 case ISCSI_BOOT_TGT_CHAP_SECRET:
2248− rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
2248+ rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN,
22492249 chap_secret);
22502250 break;
22512251 case ISCSI_BOOT_TGT_REV_CHAP_NAME:
@@ -2253,7 +2253,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type, · 1 unmodified line
22532253 mchap_name);
22542254 break;
22552255 case ISCSI_BOOT_TGT_REV_CHAP_SECRET:
2256− rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
2256+ rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN,
22572257 mchap_secret);
22582258 break;
22592259 case ISCSI_BOOT_TGT_FLAGS:
drivers/scsi/scsi_debug.c+3−2
@@ -6740,7 +6740,7 @@ static int __init scsi_debug_init(void) · 6739 unmodified lines
67406740 k = sdeb_zbc_model_str(sdeb_zbc_model_s);
67416741 if (k < 0) {
67426742 ret = k;
6743− goto free_vm;
6743+ goto free_q_arr;
67446744 }
67456745 sdeb_zbc_model = k;
67466746 switch (sdeb_zbc_model) {
@@ -6753,7 +6753,8 @@ static int __init scsi_debug_init(void) · 6 unmodified lines
67536753 break;
67546754 default:
67556755 pr_err("Invalid ZBC model\n");
6756− return -EINVAL;
6756+ ret = -EINVAL;
6757+ goto free_q_arr;
67576758 }
67586759 }
67596760 if (sdeb_zbc_model != BLK_ZONED_NONE) {
drivers/scsi/scsi_lib.c+14−13
@@ -249,7 +249,8 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, · 248 unmodified lines
249249
250250 req = blk_get_request(sdev->request_queue,
251251 data_direction == DMA_TO_DEVICE ?
252− REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, BLK_MQ_REQ_PREEMPT);
252+ REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
253+ rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0);
253254 if (IS_ERR(req))
254255 return ret;
255256 rq = scsi_req(req);
@@ -1206,6 +1207,8 @@ static blk_status_t · 950 unmodified lines
12061207 scsi_device_state_check(struct scsi_device *sdev, struct request *req)
12071208 {
12081209 switch (sdev->sdev_state) {
1210+ case SDEV_CREATED:
1211+ return BLK_STS_OK;
12091212 case SDEV_OFFLINE:
12101213 case SDEV_TRANSPORT_OFFLINE:
12111214 /*
@@ -1232,18 +1235,18 @@ scsi_device_state_check(struct scsi_device *sdev, struct request *req) · 20 unmodified lines
12321235 return BLK_STS_RESOURCE;
12331236 case SDEV_QUIESCE:
12341237 /*
1235− * If the devices is blocked we defer normal commands.
1238+ * If the device is blocked we only accept power management
1239+ * commands.
12361240 */
1237− if (req && !(req->rq_flags & RQF_PREEMPT))
1241+ if (req && WARN_ON_ONCE(!(req->rq_flags & RQF_PM)))
12381242 return BLK_STS_RESOURCE;
12391243 return BLK_STS_OK;
12401244 default:
12411245 /*
12421246 * For any other not fully online state we only allow
1243− * special commands. In particular any user initiated
1244− * command is not allowed.
1247+ * power management commands.
12451248 */
1246− if (req && !(req->rq_flags & RQF_PREEMPT))
1249+ if (req && !(req->rq_flags & RQF_PM))
12471250 return BLK_STS_IOERR;
12481251 return BLK_STS_OK;
12491252 }
@@ -2516,15 +2519,13 @@ void sdev_evt_send_simple(struct scsi_device *sdev, · 1266 unmodified lines
25162519 EXPORT_SYMBOL_GPL(sdev_evt_send_simple);
25172520
25182521 /**
2519− * scsi_device_quiesce - Block user issued commands.
2522+ * scsi_device_quiesce - Block all commands except power management.
25202523 * @sdev: scsi device to quiesce.
25212524 *
25222525 * This works by trying to transition to the SDEV_QUIESCE state
25232526 * (which must be a legal transition). When the device is in this
2524− * state, only special requests will be accepted, all others will
2525− * be deferred. Since special requests may also be requeued requests,
2526− * a successful return doesn't guarantee the device will be
2527− * totally quiescent.
2527+ * state, only power management requests will be accepted, all others will
2528+ * be deferred.
25282529 *
25292530 * Must be called with user context, may sleep.
25302531 *
@@ -2586,12 +2587,12 @@ void scsi_device_resume(struct scsi_device *sdev) · 55 unmodified lines
25862587 * device deleted during suspend)
25872588 */
25882589 mutex_lock(&sdev->state_mutex);
2590+ if (sdev->sdev_state == SDEV_QUIESCE)
2591+ scsi_device_set_state(sdev, SDEV_RUNNING);
25892592 if (sdev->quiesced_by) {
25902593 sdev->quiesced_by = NULL;
25912594 blk_clear_pm_only(sdev->request_queue);
25922595 }
2593− if (sdev->sdev_state == SDEV_QUIESCE)
2594− scsi_device_set_state(sdev, SDEV_RUNNING);
25952596 mutex_unlock(&sdev->state_mutex);
25962597 }
25972598 EXPORT_SYMBOL(scsi_device_resume);
drivers/scsi/scsi_transport_spi.c+19−8
@@ -117,12 +117,16 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, · 116 unmodified lines
117117 sshdr = &sshdr_tmp;
118118
119119 for(i = 0; i < DV_RETRIES; i++) {
120+ /*
121+ * The purpose of the RQF_PM flag below is to bypass the
122+ * SDEV_QUIESCE state.
123+ */
120124 result = scsi_execute(sdev, cmd, dir, buffer, bufflen, sense,
121125 sshdr, DV_TIMEOUT, /* retries */ 1,
122126 REQ_FAILFAST_DEV |
123127 REQ_FAILFAST_TRANSPORT |
124128 REQ_FAILFAST_DRIVER,
125− 0, NULL);
129+ RQF_PM, NULL);
126130 if (driver_byte(result) != DRIVER_SENSE ||
127131 sshdr->sense_key != UNIT_ATTENTION)
128132 break;
@@ -1005,23 +1009,26 @@ spi_dv_device(struct scsi_device *sdev) · 876 unmodified lines
10051009 */
10061010 lock_system_sleep();
10071011
1012+ if (scsi_autopm_get_device(sdev))
1013+ goto unlock_system_sleep;
1014+
10081015 if (unlikely(spi_dv_in_progress(starget)))
1009− goto unlock;
1016+ goto put_autopm;
10101017
10111018 if (unlikely(scsi_device_get(sdev)))
1012− goto unlock;
1019+ goto put_autopm;
10131020
10141021 spi_dv_in_progress(starget) = 1;
10151022
10161023 buffer = kzalloc(len, GFP_KERNEL);
10171024
10181025 if (unlikely(!buffer))
1019− goto out_put;
1026+ goto put_sdev;
10201027
10211028 /* We need to verify that the actual device will quiesce; the
10221029 * later target quiesce is just a nice to have */
10231030 if (unlikely(scsi_device_quiesce(sdev)))
1024− goto out_free;
1031+ goto free_buffer;
10251032
10261033 scsi_target_quiesce(starget);
10271034
@@ -1041,12 +1048,16 @@ spi_dv_device(struct scsi_device *sdev) · 13 unmodified lines
10411048
10421049 spi_initial_dv(starget) = 1;
10431050
1044− out_free:
1051+free_buffer:
10451052 kfree(buffer);
1046− out_put:
1053+
1054+put_sdev:
10471055 spi_dv_in_progress(starget) = 0;
10481056 scsi_device_put(sdev);
1049−unlock:
1057+put_autopm:
1058+ scsi_autopm_put_device(sdev);
1059+
1060+unlock_system_sleep:
10501061 unlock_system_sleep();
10511062 }
10521063 EXPORT_SYMBOL(spi_dv_device);
drivers/scsi/sd.c+3−3
@@ -984,8 +984,10 @@ static blk_status_t sd_setup_write_zeroes_cmnd(struct scsi_cmnd *cmd) · 983 unmodified lines
984984 }
985985 }
986986
987− if (sdp->no_write_same)
987+ if (sdp->no_write_same) {
988+ rq->rq_flags |= RQF_QUIET;
988989 return BLK_STS_TARGET;
990+ }
989991
990992 if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff)
991993 return sd_setup_write_same16_cmnd(cmd, false);
@@ -3510,10 +3512,8 @@ static int sd_probe(struct device *dev) · 2518 unmodified lines
35103512 static int sd_remove(struct device *dev)
35113513 {
35123514 struct scsi_disk *sdkp;
3513− dev_t devt;
35143515
35153516 sdkp = dev_get_drvdata(dev);
3516− devt = disk_devt(sdkp->disk);
35173517 scsi_autopm_get_device(sdkp->device);
35183518
35193519 async_synchronize_full_domain(&scsi_sd_pm_domain);
drivers/scsi/ufs/ufs-mediatek-trace.h+1−1
@@ -31,6 +31,6 @@ TRACE_EVENT(ufs_mtk_event, · 30 unmodified lines
3131
3232 #undef TRACE_INCLUDE_PATH
3333 #undef TRACE_INCLUDE_FILE
34−#define TRACE_INCLUDE_PATH .
34+#define TRACE_INCLUDE_PATH ../../drivers/scsi/ufs/
3535 #define TRACE_INCLUDE_FILE ufs-mediatek-trace
3636 #include <trace/define_trace.h>
drivers/scsi/ufs/ufs-mediatek.c+21−0
@@ -70,6 +70,13 @@ static bool ufs_mtk_is_va09_supported(struct ufs_hba *hba) · 69 unmodified lines
7070 return !!(host->caps & UFS_MTK_CAP_VA09_PWR_CTRL);
7171 }
7272
73+static bool ufs_mtk_is_broken_vcc(struct ufs_hba *hba)
74+{
75+ struct ufs_mtk_host *host = ufshcd_get_variant(hba);
76+
77+ return !!(host->caps & UFS_MTK_CAP_BROKEN_VCC);
78+}
79+
7380 static void ufs_mtk_cfg_unipro_cg(struct ufs_hba *hba, bool enable)
7481 {
7582 u32 tmp;
@@ -514,6 +521,9 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba) · 438 unmodified lines
514521 if (of_property_read_bool(np, "mediatek,ufs-disable-ah8"))
515522 host->caps |= UFS_MTK_CAP_DISABLE_AH8;
516523
524+ if (of_property_read_bool(np, "mediatek,ufs-broken-vcc"))
525+ host->caps |= UFS_MTK_CAP_BROKEN_VCC;
526+
517527 dev_info(hba->dev, "caps: 0x%x", host->caps);
518528 }
519529
@@ -1003,6 +1013,17 @@ static int ufs_mtk_apply_dev_quirks(struct ufs_hba *hba) · 483 unmodified lines
10031013 static void ufs_mtk_fixup_dev_quirks(struct ufs_hba *hba)
10041014 {
10051015 ufshcd_fixup_dev_quirks(hba, ufs_mtk_dev_fixups);
1016+
1017+ if (ufs_mtk_is_broken_vcc(hba) && hba->vreg_info.vcc &&
1018+ (hba->dev_quirks & UFS_DEVICE_QUIRK_DELAY_AFTER_LPM)) {
1019+ hba->vreg_info.vcc->always_on = true;
1020+ /*
1021+ * VCC will be kept always-on thus we don't
1022+ * need any delay during regulator operations
1023+ */
1024+ hba->dev_quirks &= ~(UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM |
1025+ UFS_DEVICE_QUIRK_DELAY_AFTER_LPM);
1026+ }
10061027 }
10071028
10081029 static void ufs_mtk_event_notify(struct ufs_hba *hba,
drivers/scsi/ufs/ufs-mediatek.h+1−0
@@ -81,6 +81,7 @@ enum ufs_mtk_host_caps { · 80 unmodified lines
8181 UFS_MTK_CAP_BOOST_CRYPT_ENGINE = 1 << 0,
8282 UFS_MTK_CAP_VA09_PWR_CTRL = 1 << 1,
8383 UFS_MTK_CAP_DISABLE_AH8 = 1 << 2,
84+ UFS_MTK_CAP_BROKEN_VCC = 1 << 3,
8485 };
8586
8687 struct ufs_mtk_crypt_cfg {
drivers/scsi/ufs/ufs.h+1−1
@@ -330,7 +330,6 @@ enum { · 329 unmodified lines
330330 UFS_DEV_WRITE_BOOSTER_SUP = BIT(8),
331331 };
332332
333−#define POWER_DESC_MAX_SIZE 0x62
334333 #define POWER_DESC_MAX_ACTV_ICC_LVLS 16
335334
336335 /* Attribute bActiveICCLevel parameter bit masks definitions */
@@ -513,6 +512,7 @@ struct ufs_query_res { · 176 unmodified lines
513512 struct ufs_vreg {
514513 struct regulator *reg;
515514 const char *name;
515+ bool always_on;
516516 bool enabled;
517517 int min_uV;
518518 int max_uV;
drivers/scsi/ufs/ufshcd-pci.c+71−2
@@ -148,6 +148,8 @@ static int ufs_intel_common_init(struct ufs_hba *hba) · 147 unmodified lines
148148 {
149149 struct intel_host *host;
150150
151+ hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
152+
151153 host = devm_kzalloc(hba->dev, sizeof(*host), GFP_KERNEL);
152154 if (!host)
153155 return -ENOMEM;
@@ -163,6 +165,41 @@ static void ufs_intel_common_exit(struct ufs_hba *hba) · 9 unmodified lines
163165 intel_ltr_hide(hba->dev);
164166 }
165167
168+static int ufs_intel_resume(struct ufs_hba *hba, enum ufs_pm_op op)
169+{
170+ /*
171+ * To support S4 (suspend-to-disk) with spm_lvl other than 5, the base
172+ * address registers must be restored because the restore kernel can
173+ * have used different addresses.
174+ */
175+ ufshcd_writel(hba, lower_32_bits(hba->utrdl_dma_addr),
176+ REG_UTP_TRANSFER_REQ_LIST_BASE_L);
177+ ufshcd_writel(hba, upper_32_bits(hba->utrdl_dma_addr),
178+ REG_UTP_TRANSFER_REQ_LIST_BASE_H);
179+ ufshcd_writel(hba, lower_32_bits(hba->utmrdl_dma_addr),
180+ REG_UTP_TASK_REQ_LIST_BASE_L);
181+ ufshcd_writel(hba, upper_32_bits(hba->utmrdl_dma_addr),
182+ REG_UTP_TASK_REQ_LIST_BASE_H);
183+
184+ if (ufshcd_is_link_hibern8(hba)) {
185+ int ret = ufshcd_uic_hibern8_exit(hba);
186+
187+ if (!ret) {
188+ ufshcd_set_link_active(hba);
189+ } else {
190+ dev_err(hba->dev, "%s: hibern8 exit failed %d\n",
191+ __func__, ret);
192+ /*
193+ * Force reset and restore. Any other actions can lead
194+ * to an unrecoverable state.
195+ */
196+ ufshcd_set_link_off(hba);
197+ }
198+ }
199+
200+ return 0;
201+}
202+
166203 static int ufs_intel_ehl_init(struct ufs_hba *hba)
167204 {
168205 hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
@@ -174,6 +211,7 @@ static struct ufs_hba_variant_ops ufs_intel_cnl_hba_vops = { · 5 unmodified lines
174211 .init = ufs_intel_common_init,
175212 .exit = ufs_intel_common_exit,
176213 .link_startup_notify = ufs_intel_link_startup_notify,
214+ .resume = ufs_intel_resume,
177215 };
178216
179217 static struct ufs_hba_variant_ops ufs_intel_ehl_hba_vops = {
@@ -181,6 +219,7 @@ static struct ufs_hba_variant_ops ufs_intel_ehl_hba_vops = { · 1 unmodified line
181219 .init = ufs_intel_ehl_init,
182220 .exit = ufs_intel_common_exit,
183221 .link_startup_notify = ufs_intel_link_startup_notify,
222+ .resume = ufs_intel_resume,
184223 };
185224
186225 #ifdef CONFIG_PM_SLEEP
@@ -207,6 +246,30 @@ static int ufshcd_pci_resume(struct device *dev) · 20 unmodified lines
207246 {
208247 return ufshcd_system_resume(dev_get_drvdata(dev));
209248 }
249+
250+/**
251+ * ufshcd_pci_poweroff - suspend-to-disk poweroff function
252+ * @dev: pointer to PCI device handle
253+ *
254+ * Returns 0 if successful
255+ * Returns non-zero otherwise
256+ */
257+static int ufshcd_pci_poweroff(struct device *dev)
258+{
259+ struct ufs_hba *hba = dev_get_drvdata(dev);
260+ int spm_lvl = hba->spm_lvl;
261+ int ret;
262+
263+ /*
264+ * For poweroff we need to set the UFS device to PowerDown mode.
265+ * Force spm_lvl to ensure that.
266+ */
267+ hba->spm_lvl = 5;
268+ ret = ufshcd_system_suspend(hba);
269+ hba->spm_lvl = spm_lvl;
270+ return ret;
271+}
272+
210273 #endif /* !CONFIG_PM_SLEEP */
211274
212275 #ifdef CONFIG_PM
@@ -302,8 +365,14 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 89 unmodified lines
302365 }
303366
304367 static const struct dev_pm_ops ufshcd_pci_pm_ops = {
305− SET_SYSTEM_SLEEP_PM_OPS(ufshcd_pci_suspend,
306− ufshcd_pci_resume)
368+#ifdef CONFIG_PM_SLEEP
369+ .suspend = ufshcd_pci_suspend,
370+ .resume = ufshcd_pci_resume,
371+ .freeze = ufshcd_pci_suspend,
372+ .thaw = ufshcd_pci_resume,
373+ .poweroff = ufshcd_pci_poweroff,
374+ .restore = ufshcd_pci_resume,
375+#endif
307376 SET_RUNTIME_PM_OPS(ufshcd_pci_runtime_suspend,
308377 ufshcd_pci_runtime_resume,
309378 ufshcd_pci_runtime_idle)
drivers/scsi/ufs/ufshcd.c+39−30
@@ -225,6 +225,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba); · 224 unmodified lines
225225 static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd);
226226 static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag);
227227 static void ufshcd_hba_exit(struct ufs_hba *hba);
228+static int ufshcd_clear_ua_wluns(struct ufs_hba *hba);
228229 static int ufshcd_probe_hba(struct ufs_hba *hba, bool async);
229230 static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on);
230231 static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba);
@@ -288,7 +289,8 @@ static inline void ufshcd_wb_config(struct ufs_hba *hba) · 57 unmodified lines
288289 if (ret)
289290 dev_err(hba->dev, "%s: En WB flush during H8: failed: %d\n",
290291 __func__, ret);
291− ufshcd_wb_toggle_flush(hba, true);
292+ if (!(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL))
293+ ufshcd_wb_toggle_flush(hba, true);
292294 }
293295
294296 static void ufshcd_scsi_unblock_requests(struct ufs_hba *hba)
@@ -580,6 +582,23 @@ static void ufshcd_print_pwr_info(struct ufs_hba *hba) · 285 unmodified lines
580582 hba->pwr_info.hs_rate);
581583 }
582584
585+static void ufshcd_device_reset(struct ufs_hba *hba)
586+{
587+ int err;
588+
589+ err = ufshcd_vops_device_reset(hba);
590+
591+ if (!err) {
592+ ufshcd_set_ufs_dev_active(hba);
593+ if (ufshcd_is_wb_allowed(hba)) {
594+ hba->wb_enabled = false;
595+ hba->wb_buf_flush_enabled = false;
596+ }
597+ }
598+ if (err != -EOPNOTSUPP)
599+ ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
600+}
601+
583602 void ufshcd_delay_us(unsigned long us, unsigned long tolerance)
584603 {
585604 if (!us)
@@ -3665,7 +3684,7 @@ static int ufshcd_dme_enable(struct ufs_hba *hba) · 3079 unmodified lines
36653684 ret = ufshcd_send_uic_cmd(hba, &uic_cmd);
36663685 if (ret)
36673686 dev_err(hba->dev,
3668− "dme-reset: error code %d\n", ret);
3687+ "dme-enable: error code %d\n", ret);
36693688
36703689 return ret;
36713690 }
@@ -3964,7 +3983,7 @@ int ufshcd_link_recovery(struct ufs_hba *hba) · 292 unmodified lines
39643983 spin_unlock_irqrestore(hba->host->host_lock, flags);
39653984
39663985 /* Reset the attached device */
3967− ufshcd_vops_device_reset(hba);
3986+ ufshcd_device_reset(hba);
39683987
39693988 ret = ufshcd_host_reset_and_restore(hba);
39703989
@@ -5418,9 +5437,6 @@ static int ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set) · 1447 unmodified lines
54185437
54195438 static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable)
54205439 {
5421− if (hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)
5422− return;
5423−
54245440 if (enable)
54255441 ufshcd_wb_buf_flush_enable(hba);
54265442 else
@@ -6643,19 +6659,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) · 1216 unmodified lines
66436659 {
66446660 struct Scsi_Host *host;
66456661 struct ufs_hba *hba;
6646− unsigned int tag;
66476662 u32 pos;
66486663 int err;
6649− u8 resp = 0xF;
6650− struct ufshcd_lrb *lrbp;
6664+ u8 resp = 0xF, lun;
66516665 unsigned long flags;
66526666
66536667 host = cmd->device->host;
66546668 hba = shost_priv(host);
6655− tag = cmd->request->tag;
66566669
6657− lrbp = &hba->lrb[tag];
6658− err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp);
6670+ lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
6671+ err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp);
66596672 if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) {
66606673 if (!err)
66616674 err = resp;
@@ -6664,7 +6677,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) · 2 unmodified lines
66646677
66656678 /* clear the commands that were pending for corresponding LUN */
66666679 for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
6667− if (hba->lrb[pos].lun == lrbp->lun) {
6680+ if (hba->lrb[pos].lun == lun) {
66686681 err = ufshcd_clear_cmd(hba, pos);
66696682 if (err)
66706683 break;
@@ -6930,7 +6943,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba) · 259 unmodified lines
69306943
69316944 /* Establish the link again and restore the device */
69326945 err = ufshcd_probe_hba(hba, false);
6933−
6946+ if (!err)
6947+ ufshcd_clear_ua_wluns(hba);
69346948 out:
69356949 if (err)
69366950 dev_err(hba->dev, "%s: Host init failed %d\n", __func__, err);
@@ -6968,7 +6982,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba) · 31 unmodified lines
69686982
69696983 do {
69706984 /* Reset the attached device */
6971− ufshcd_vops_device_reset(hba);
6985+ ufshcd_device_reset(hba);
69726986
69736987 err = ufshcd_host_reset_and_restore(hba);
69746988 } while (err && --retries);
@@ -8045,7 +8059,7 @@ static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg) · 1070 unmodified lines
80458059 {
80468060 int ret = 0;
80478061
8048− if (!vreg || !vreg->enabled)
8062+ if (!vreg || !vreg->enabled || vreg->always_on)
80498063 goto out;
80508064
80518065 ret = regulator_disable(vreg->reg);
@@ -8414,13 +8428,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, · 362 unmodified lines
84148428 * handling context.
84158429 */
84168430 hba->host->eh_noresume = 1;
8417− if (hba->wlun_dev_clr_ua) {
8418− ret = ufshcd_send_request_sense(hba, sdp);
8419− if (ret)
8420− goto out;
8421− /* Unit attention condition is cleared now */
8422− hba->wlun_dev_clr_ua = false;
8423− }
8431+ ufshcd_clear_ua_wluns(hba);
84248432
84258433 cmd[4] = pwr_mode << 4;
84268434
@@ -8441,7 +8449,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, · 14 unmodified lines
84418449
84428450 if (!ret)
84438451 hba->curr_dev_pwr_mode = pwr_mode;
8444−out:
8452+
84458453 scsi_device_put(sdp);
84468454 hba->host->eh_noresume = 0;
84478455 return ret;
@@ -8685,6 +8693,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) · 237 unmodified lines
86858693 ufshcd_wb_need_flush(hba));
86868694 }
86878695
8696+ flush_work(&hba->eeh_work);
8697+
86888698 if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) {
86898699 if (!ufshcd_is_runtime_pm(pm_op))
86908700 /* ensure that bkops is disabled */
@@ -8697,8 +8707,6 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) · 6 unmodified lines
86978707 }
86988708 }
86998709
8700− flush_work(&hba->eeh_work);
8701−
87028710 /*
87038711 * In the case of DeepSleep, the device is expected to remain powered
87048712 * with the link off, so do not check for bkops.
@@ -8747,7 +8755,7 @@ set_link_active: · 42 unmodified lines
87478755 * further below.
87488756 */
87498757 if (ufshcd_is_ufs_dev_deepsleep(hba)) {
8750− ufshcd_vops_device_reset(hba);
8758+ ufshcd_device_reset(hba);
87518759 WARN_ON(!ufshcd_is_link_off(hba));
87528760 }
87538761 if (ufshcd_is_link_hibern8(hba) && !ufshcd_uic_hibern8_exit(hba))
@@ -8757,7 +8765,7 @@ set_link_active: · 3 unmodified lines
87578765 set_dev_active:
87588766 /* Can also get here needing to exit DeepSleep */
87598767 if (ufshcd_is_ufs_dev_deepsleep(hba)) {
8760− ufshcd_vops_device_reset(hba);
8768+ ufshcd_device_reset(hba);
87618769 ufshcd_host_reset_and_restore(hba);
87628770 }
87638771 if (!ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE))
@@ -8925,7 +8933,8 @@ int ufshcd_system_suspend(struct ufs_hba *hba) · 161 unmodified lines
89258933 if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) ==
89268934 hba->curr_dev_pwr_mode) &&
89278935 (ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) ==
8928− hba->uic_link_state))
8936+ hba->uic_link_state) &&
8937+ !hba->dev_info.b_rpm_dev_flush_capable)
89298938 goto out;
89308939
89318940 if (pm_runtime_suspended(hba->dev)) {
@@ -9353,7 +9362,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) · 421 unmodified lines
93539362 }
93549363
93559364 /* Reset the attached device */
9356− ufshcd_vops_device_reset(hba);
9365+ ufshcd_device_reset(hba);
93579366
93589367 ufshcd_init_crypto(hba);
93599368
drivers/scsi/ufs/ufshcd.h+5−9
@@ -1218,16 +1218,12 @@ static inline void ufshcd_vops_dbg_register_dump(struct ufs_hba *hba) · 1217 unmodified lines
12181218 hba->vops->dbg_register_dump(hba);
12191219 }
12201220
1221−static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
1221+static inline int ufshcd_vops_device_reset(struct ufs_hba *hba)
12221222 {
1223− if (hba->vops && hba->vops->device_reset) {
1224− int err = hba->vops->device_reset(hba);
1225−
1226− if (!err)
1227− ufshcd_set_ufs_dev_active(hba);
1228− if (err != -EOPNOTSUPP)
1229− ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
1230− }
1223+ if (hba->vops && hba->vops->device_reset)
1224+ return hba->vops->device_reset(hba);
1225+
1226+ return -EOPNOTSUPP;
12311227 }
12321228
12331229 static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
drivers/spi/spi-altera.c+14−12
@@ -189,24 +189,26 @@ static int altera_spi_txrx(struct spi_master *master, · 188 unmodified lines
189189
190190 /* send the first byte */
191191 altera_spi_tx_word(hw);
192− } else {
193− while (hw->count < hw->len) {
194− altera_spi_tx_word(hw);
195192
196− for (;;) {
197− altr_spi_readl(hw, ALTERA_SPI_STATUS, &val);
198− if (val & ALTERA_SPI_STATUS_RRDY_MSK)
199− break;
193+ return 1;
194+ }
195+
196+ while (hw->count < hw->len) {
197+ altera_spi_tx_word(hw);
200198
201− cpu_relax();
202− }
199+ for (;;) {
200+ altr_spi_readl(hw, ALTERA_SPI_STATUS, &val);
201+ if (val & ALTERA_SPI_STATUS_RRDY_MSK)
202+ break;
203203
204− altera_spi_rx_word(hw);
204+ cpu_relax();
205205 }
206− spi_finalize_current_transfer(master);
206+
207+ altera_spi_rx_word(hw);
207208 }
209+ spi_finalize_current_transfer(master);
208210
209− return t->len;
211+ return 0;
210212 }
211213
212214 static irqreturn_t altera_spi_irq(int irq, void *dev)
drivers/spi/spi-cadence.c+4−2
@@ -115,6 +115,7 @@ struct cdns_spi { · 114 unmodified lines
115115 void __iomem *regs;
116116 struct clk *ref_clk;
117117 struct clk *pclk;
118+ unsigned int clk_rate;
118119 u32 speed_hz;
119120 const u8 *txbuf;
120121 u8 *rxbuf;
@@ -250,7 +251,7 @@ static void cdns_spi_config_clock_freq(struct spi_device *spi, · 129 unmodified lines
250251 u32 ctrl_reg, baud_rate_val;
251252 unsigned long frequency;
252253
253− frequency = clk_get_rate(xspi->ref_clk);
254+ frequency = xspi->clk_rate;
254255
255256 ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR);
256257
@@ -558,8 +559,9 @@ static int cdns_spi_probe(struct platform_device *pdev) · 301 unmodified lines
558559 master->auto_runtime_pm = true;
559560 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
560561
562+ xspi->clk_rate = clk_get_rate(xspi->ref_clk);
561563 /* Set to default valid value */
562− master->max_speed_hz = clk_get_rate(xspi->ref_clk) / 4;
564+ master->max_speed_hz = xspi->clk_rate / 4;
563565 xspi->speed_hz = master->max_speed_hz;
564566
565567 master->bits_per_word_mask = SPI_BPW_MASK(8);
drivers/spi/spi-fsl-spi.c+2−3
@@ -115,14 +115,13 @@ static void fsl_spi_chipselect(struct spi_device *spi, int value) · 114 unmodified lines
115115 {
116116 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
117117 struct fsl_spi_platform_data *pdata;
118− bool pol = spi->mode & SPI_CS_HIGH;
119118 struct spi_mpc8xxx_cs *cs = spi->controller_state;
120119
121120 pdata = spi->dev.parent->parent->platform_data;
122121
123122 if (value == BITBANG_CS_INACTIVE) {
124123 if (pdata->cs_control)
125− pdata->cs_control(spi, !pol);
124+ pdata->cs_control(spi, false);
126125 }
127126
128127 if (value == BITBANG_CS_ACTIVE) {
@@ -134,7 +133,7 @@ static void fsl_spi_chipselect(struct spi_device *spi, int value) · 5 unmodified lines
134133 fsl_spi_change_mode(spi);
135134
136135 if (pdata->cs_control)
137− pdata->cs_control(spi, pol);
136+ pdata->cs_control(spi, true);
138137 }
139138 }
140139
drivers/spi/spi-geni-qcom.c+80−4
@@ -83,6 +83,7 @@ struct spi_geni_master { · 82 unmodified lines
8383 spinlock_t lock;
8484 int irq;
8585 bool cs_flag;
86+ bool abort_failed;
8687 };
8788
8889 static int get_spi_clk_cfg(unsigned int speed_hz,
@@ -141,8 +142,49 @@ static void handle_fifo_timeout(struct spi_master *spi, · 52 unmodified lines
141142 spin_unlock_irq(&mas->lock);
142143
143144 time_left = wait_for_completion_timeout(&mas->abort_done, HZ);
144− if (!time_left)
145+ if (!time_left) {
145146 dev_err(mas->dev, "Failed to cancel/abort m_cmd\n");
147+
148+ /*
149+ * No need for a lock since SPI core has a lock and we never
150+ * access this from an interrupt.
151+ */
152+ mas->abort_failed = true;
153+ }
154+}
155+
156+static bool spi_geni_is_abort_still_pending(struct spi_geni_master *mas)
157+{
158+ struct geni_se *se = &mas->se;
159+ u32 m_irq, m_irq_en;
160+
161+ if (!mas->abort_failed)
162+ return false;
163+
164+ /*
165+ * The only known case where a transfer times out and then a cancel
166+ * times out then an abort times out is if something is blocking our
167+ * interrupt handler from running. Avoid starting any new transfers
168+ * until that sorts itself out.
169+ */
170+ spin_lock_irq(&mas->lock);
171+ m_irq = readl(se->base + SE_GENI_M_IRQ_STATUS);
172+ m_irq_en = readl(se->base + SE_GENI_M_IRQ_EN);
173+ spin_unlock_irq(&mas->lock);
174+
175+ if (m_irq & m_irq_en) {
176+ dev_err(mas->dev, "Interrupts pending after abort: %#010x\n",
177+ m_irq & m_irq_en);
178+ return true;
179+ }
180+
181+ /*
182+ * If we're here the problem resolved itself so no need to check more
183+ * on future transfers.
184+ */
185+ mas->abort_failed = false;
186+
187+ return false;
146188 }
147189
148190 static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
@@ -158,10 +200,21 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag) · 9 unmodified lines
158200 if (set_flag == mas->cs_flag)
159201 return;
160202
161− mas->cs_flag = set_flag;
162−
163203 pm_runtime_get_sync(mas->dev);
204+
205+ if (spi_geni_is_abort_still_pending(mas)) {
206+ dev_err(mas->dev, "Can't set chip select\n");
207+ goto exit;
208+ }
209+
164210 spin_lock_irq(&mas->lock);
211+ if (mas->cur_xfer) {
212+ dev_err(mas->dev, "Can't set CS when prev xfer running\n");
213+ spin_unlock_irq(&mas->lock);
214+ goto exit;
215+ }
216+
217+ mas->cs_flag = set_flag;
165218 reinit_completion(&mas->cs_done);
166219 if (set_flag)
167220 geni_se_setup_m_cmd(se, SPI_CS_ASSERT, 0);
@@ -170,9 +223,12 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag) · 2 unmodified lines
170223 spin_unlock_irq(&mas->lock);
171224
172225 time_left = wait_for_completion_timeout(&mas->cs_done, HZ);
173− if (!time_left)
226+ if (!time_left) {
227+ dev_warn(mas->dev, "Timeout setting chip select\n");
174228 handle_fifo_timeout(spi, NULL);
229+ }
175230
231+exit:
176232 pm_runtime_put(mas->dev);
177233 }
178234
@@ -280,6 +336,9 @@ static int spi_geni_prepare_message(struct spi_master *spi, · 101 unmodified lines
280336 int ret;
281337 struct spi_geni_master *mas = spi_master_get_devdata(spi);
282338
339+ if (spi_geni_is_abort_still_pending(mas))
340+ return -EBUSY;
341+
283342 ret = setup_fifo_params(spi_msg->spi, spi);
284343 if (ret)
285344 dev_err(mas->dev, "Couldn't select mode %d\n", ret);
@@ -354,6 +413,12 @@ static bool geni_spi_handle_tx(struct spi_geni_master *mas) · 68 unmodified lines
354413 unsigned int bytes_per_fifo_word = geni_byte_per_fifo_word(mas);
355414 unsigned int i = 0;
356415
416+ /* Stop the watermark IRQ if nothing to send */
417+ if (!mas->cur_xfer) {
418+ writel(0, se->base + SE_GENI_TX_WATERMARK_REG);
419+ return false;
420+ }
421+
357422 max_bytes = (mas->tx_fifo_depth - mas->tx_wm) * bytes_per_fifo_word;
358423 if (mas->tx_rem_bytes < max_bytes)
359424 max_bytes = mas->tx_rem_bytes;
@@ -396,6 +461,14 @@ static void geni_spi_handle_rx(struct spi_geni_master *mas) · 36 unmodified lines
396461 if (rx_last_byte_valid && rx_last_byte_valid < 4)
397462 rx_bytes -= bytes_per_fifo_word - rx_last_byte_valid;
398463 }
464+
465+ /* Clear out the FIFO and bail if nowhere to put it */
466+ if (!mas->cur_xfer) {
467+ for (i = 0; i < DIV_ROUND_UP(rx_bytes, bytes_per_fifo_word); i++)
468+ readl(se->base + SE_GENI_RX_FIFOn);
469+ return;
470+ }
471+
399472 if (mas->rx_rem_bytes < rx_bytes)
400473 rx_bytes = mas->rx_rem_bytes;
401474
@@ -495,6 +568,9 @@ static int spi_geni_transfer_one(struct spi_master *spi, · 93 unmodified lines
495568 {
496569 struct spi_geni_master *mas = spi_master_get_devdata(spi);
497570
571+ if (spi_geni_is_abort_still_pending(mas))
572+ return -EBUSY;
573+
498574 /* Terminate and return success for 0 byte length transfer */
499575 if (!xfer->len)
500576 return 0;
drivers/spi/spi-stm32.c+2−2
@@ -493,9 +493,9 @@ static u32 stm32h7_spi_prepare_fthlv(struct stm32_spi *spi, u32 xfer_len) · 492 unmodified lines
493493
494494 /* align packet size with data registers access */
495495 if (spi->cur_bpw > 8)
496− fthlv -= (fthlv % 2); /* multiple of 2 */
496+ fthlv += (fthlv % 2) ? 1 : 0;
497497 else
498− fthlv -= (fthlv % 4); /* multiple of 4 */
498+ fthlv += (fthlv % 4) ? (4 - (fthlv % 4)) : 0;
499499
500500 if (!fthlv)
501501 fthlv = 1;
drivers/spi/spi.c+8−3
@@ -1108,6 +1108,7 @@ static int spi_transfer_wait(struct spi_controller *ctlr, · 1107 unmodified lines
11081108 {
11091109 struct spi_statistics *statm = &ctlr->statistics;
11101110 struct spi_statistics *stats = &msg->spi->statistics;
1111+ u32 speed_hz = xfer->speed_hz;
11111112 unsigned long long ms;
11121113
11131114 if (spi_controller_is_slave(ctlr)) {
@@ -1116,8 +1117,11 @@ static int spi_transfer_wait(struct spi_controller *ctlr, · 2 unmodified lines
11161117 return -EINTR;
11171118 }
11181119 } else {
1120+ if (!speed_hz)
1121+ speed_hz = 100000;
1122+
11191123 ms = 8LL * 1000LL * xfer->len;
1120− do_div(ms, xfer->speed_hz);
1124+ do_div(ms, speed_hz);
11211125 ms += ms + 200; /* some tolerance */
11221126
11231127 if (ms > UINT_MAX)
@@ -3378,8 +3382,9 @@ int spi_setup(struct spi_device *spi) · 2254 unmodified lines
33783382 if (status)
33793383 return status;
33803384
3381− if (!spi->max_speed_hz ||
3382− spi->max_speed_hz > spi->controller->max_speed_hz)
3385+ if (spi->controller->max_speed_hz &&
3386+ (!spi->max_speed_hz ||
3387+ spi->max_speed_hz > spi->controller->max_speed_hz))
33833388 spi->max_speed_hz = spi->controller->max_speed_hz;
33843389
33853390 mutex_lock(&spi->controller->io_mutex);
drivers/staging/comedi/comedi_fops.c+3−1
@@ -2987,7 +2987,9 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, · 2986 unmodified lines
29872987 v32.chanlist_len = cmd->chanlist_len;
29882988 v32.data = ptr_to_compat(cmd->data);
29892989 v32.data_len = cmd->data_len;
2990− return copy_to_user(cmd32, &v32, sizeof(v32));
2990+ if (copy_to_user(cmd32, &v32, sizeof(v32)))
2991+ return -EFAULT;
2992+ return 0;
29912993 }
29922994
29932995 /* Handle 32-bit COMEDI_CMD ioctl. */
drivers/staging/hikey9xx/hisi-spmi-controller.c+15−6
@@ -278,21 +278,24 @@ static int spmi_controller_probe(struct platform_device *pdev) · 277 unmodified lines
278278 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
279279 if (!iores) {
280280 dev_err(&pdev->dev, "can not get resource!\n");
281− return -EINVAL;
281+ ret = -EINVAL;
282+ goto err_put_controller;
282283 }
283284
284285 spmi_controller->base = devm_ioremap(&pdev->dev, iores->start,
285286 resource_size(iores));
286287 if (!spmi_controller->base) {
287288 dev_err(&pdev->dev, "can not remap base addr!\n");
288− return -EADDRNOTAVAIL;
289+ ret = -EADDRNOTAVAIL;
290+ goto err_put_controller;
289291 }
290292
291293 ret = of_property_read_u32(pdev->dev.of_node, "spmi-channel",
292294 &spmi_controller->channel);
293295 if (ret) {
294296 dev_err(&pdev->dev, "can not get channel\n");
295− return -ENODEV;
297+ ret = -ENODEV;
298+ goto err_put_controller;
296299 }
297300
298301 platform_set_drvdata(pdev, spmi_controller);
@@ -309,9 +312,15 @@ static int spmi_controller_probe(struct platform_device *pdev) · 10 unmodified lines
309312 ctrl->write_cmd = spmi_write_cmd;
310313
311314 ret = spmi_controller_add(ctrl);
312− if (ret)
313− dev_err(&pdev->dev, "spmi_add_controller failed with error %d!\n", ret);
315+ if (ret) {
316+ dev_err(&pdev->dev, "spmi_controller_add failed with error %d!\n", ret);
317+ goto err_put_controller;
318+ }
319+
320+ return 0;
314321
322+err_put_controller:
323+ spmi_controller_put(ctrl);
315324 return ret;
316325 }
317326
@@ -320,7 +329,7 @@ static int spmi_del_controller(struct platform_device *pdev) · 2 unmodified lines
320329 struct spmi_controller *ctrl = platform_get_drvdata(pdev);
321330
322331 spmi_controller_remove(ctrl);
323− kfree(ctrl);
332+ spmi_controller_put(ctrl);
324333 return 0;
325334 }
326335
drivers/staging/media/atomisp/pci/atomisp_subdev.c+0−20
@@ -1062,26 +1062,6 @@ static const struct v4l2_ctrl_config ctrl_select_isp_version = { · 1061 unmodified lines
10621062 .def = 0,
10631063 };
10641064
1065−#if 0 /* #ifdef CONFIG_ION */
1066−/*
1067− * Control for ISP ion device fd
1068− *
1069− * userspace will open ion device and pass the fd to kernel.
1070− * this fd will be used to map shared fd to buffer.
1071− */
1072−/* V4L2_CID_ATOMISP_ION_DEVICE_FD is not defined */
1073−static const struct v4l2_ctrl_config ctrl_ion_dev_fd = {
1074− .ops = &ctrl_ops,
1075− .id = V4L2_CID_ATOMISP_ION_DEVICE_FD,
1076− .type = V4L2_CTRL_TYPE_INTEGER,
1077− .name = "Ion Device Fd",
1078− .min = -1,
1079− .max = 1024,
1080− .step = 1,
1081− .def = ION_FD_UNSET
1082−};
1083−#endif
1084−
10851065 static void atomisp_init_subdev_pipe(struct atomisp_sub_device *asd,
10861066 struct atomisp_video_pipe *pipe, enum v4l2_buf_type buf_type)
10871067 {
drivers/staging/mt7621-dma/mtk-hsdma.c+3−1
@@ -712,7 +712,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev) · 711 unmodified lines
712712 ret = dma_async_device_register(dd);
713713 if (ret) {
714714 dev_err(&pdev->dev, "failed to register dma device\n");
715− return ret;
715+ goto err_uninit_hsdma;
716716 }
717717
718718 ret = of_dma_controller_register(pdev->dev.of_node,
@@ -728,6 +728,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev) · 9 unmodified lines
728728
729729 err_unregister:
730730 dma_async_device_unregister(dd);
731+err_uninit_hsdma:
732+ mtk_hsdma_uninit(hsdma);
731733 return ret;
732734 }
733735
drivers/target/target_core_xcopy.c+70−49
@@ -46,60 +46,83 @@ static int target_xcopy_gen_naa_ieee(struct se_device *dev, unsigned char *buf) · 45 unmodified lines
4646 return 0;
4747 }
4848
49−struct xcopy_dev_search_info {
50− const unsigned char *dev_wwn;
51− struct se_device *found_dev;
52−};
53−
49+/**
50+ * target_xcopy_locate_se_dev_e4_iter - compare XCOPY NAA device identifiers
51+ *
52+ * @se_dev: device being considered for match
53+ * @dev_wwn: XCOPY requested NAA dev_wwn
54+ * @return: 1 on match, 0 on no-match
55+ */
5456 static int target_xcopy_locate_se_dev_e4_iter(struct se_device *se_dev,
55− void *data)
57+ const unsigned char *dev_wwn)
5658 {
57− struct xcopy_dev_search_info *info = data;
5859 unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
5960 int rc;
6061
61− if (!se_dev->dev_attrib.emulate_3pc)
62+ if (!se_dev->dev_attrib.emulate_3pc) {
63+ pr_debug("XCOPY: emulate_3pc disabled on se_dev %p\n", se_dev);
6264 return 0;
65+ }
6366
6467 memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN);
6568 target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]);
6669
67− rc = memcmp(&tmp_dev_wwn[0], info->dev_wwn, XCOPY_NAA_IEEE_REGEX_LEN);
68− if (rc != 0)
69− return 0;
70−
71− info->found_dev = se_dev;
72− pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev);
73−
74− rc = target_depend_item(&se_dev->dev_group.cg_item);
70+ rc = memcmp(&tmp_dev_wwn[0], dev_wwn, XCOPY_NAA_IEEE_REGEX_LEN);
7571 if (rc != 0) {
76− pr_err("configfs_depend_item attempt failed: %d for se_dev: %p\n",
77− rc, se_dev);
78− return rc;
72+ pr_debug("XCOPY: skip non-matching: %*ph\n",
73+ XCOPY_NAA_IEEE_REGEX_LEN, tmp_dev_wwn);
74+ return 0;
7975 }
76+ pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev);
8077
81− pr_debug("Called configfs_depend_item for se_dev: %p se_dev->se_dev_group: %p\n",
82− se_dev, &se_dev->dev_group);
8378 return 1;
8479 }
8580
86−static int target_xcopy_locate_se_dev_e4(const unsigned char *dev_wwn,
87− struct se_device **found_dev)
81+static int target_xcopy_locate_se_dev_e4(struct se_session *sess,
82+ const unsigned char *dev_wwn,
83+ struct se_device **_found_dev,
84+ struct percpu_ref **_found_lun_ref)
8885 {
89− struct xcopy_dev_search_info info;
90− int ret;
91−
92− memset(&info, 0, sizeof(info));
93− info.dev_wwn = dev_wwn;
94−
95− ret = target_for_each_device(target_xcopy_locate_se_dev_e4_iter, &info);
96− if (ret == 1) {
97− *found_dev = info.found_dev;
98− return 0;
99− } else {
100− pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n");
101− return -EINVAL;
86+ struct se_dev_entry *deve;
87+ struct se_node_acl *nacl;
88+ struct se_lun *this_lun = NULL;
89+ struct se_device *found_dev = NULL;
90+
91+ /* cmd with NULL sess indicates no associated $FABRIC_MOD */
92+ if (!sess)
93+ goto err_out;
94+
95+ pr_debug("XCOPY 0xe4: searching for: %*ph\n",
96+ XCOPY_NAA_IEEE_REGEX_LEN, dev_wwn);
97+
98+ nacl = sess->se_node_acl;
99+ rcu_read_lock();
100+ hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link) {
101+ struct se_device *this_dev;
102+ int rc;
103+
104+ this_lun = rcu_dereference(deve->se_lun);
105+ this_dev = rcu_dereference_raw(this_lun->lun_se_dev);
106+
107+ rc = target_xcopy_locate_se_dev_e4_iter(this_dev, dev_wwn);
108+ if (rc) {
109+ if (percpu_ref_tryget_live(&this_lun->lun_ref))
110+ found_dev = this_dev;
111+ break;
112+ }
102113 }
114+ rcu_read_unlock();
115+ if (found_dev == NULL)
116+ goto err_out;
117+
118+ pr_debug("lun_ref held for se_dev: %p se_dev->se_dev_group: %p\n",
119+ found_dev, &found_dev->dev_group);
120+ *_found_dev = found_dev;
121+ *_found_lun_ref = &this_lun->lun_ref;
122+ return 0;
123+err_out:
124+ pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n");
125+ return -EINVAL;
103126 }
104127
105128 static int target_xcopy_parse_tiddesc_e4(struct se_cmd *se_cmd, struct xcopy_op *xop,
@@ -246,12 +269,16 @@ static int target_xcopy_parse_target_descriptors(struct se_cmd *se_cmd, · 140 unmodified lines
246269
247270 switch (xop->op_origin) {
248271 case XCOL_SOURCE_RECV_OP:
249− rc = target_xcopy_locate_se_dev_e4(xop->dst_tid_wwn,
250− &xop->dst_dev);
272+ rc = target_xcopy_locate_se_dev_e4(se_cmd->se_sess,
273+ xop->dst_tid_wwn,
274+ &xop->dst_dev,
275+ &xop->remote_lun_ref);
251276 break;
252277 case XCOL_DEST_RECV_OP:
253− rc = target_xcopy_locate_se_dev_e4(xop->src_tid_wwn,
254− &xop->src_dev);
278+ rc = target_xcopy_locate_se_dev_e4(se_cmd->se_sess,
279+ xop->src_tid_wwn,
280+ &xop->src_dev,
281+ &xop->remote_lun_ref);
255282 break;
256283 default:
257284 pr_err("XCOPY CSCD descriptor IDs not found in CSCD list - "
@@ -391,18 +418,12 @@ static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) · 133 unmodified lines
391418
392419 static void xcopy_pt_undepend_remotedev(struct xcopy_op *xop)
393420 {
394− struct se_device *remote_dev;
395−
396421 if (xop->op_origin == XCOL_SOURCE_RECV_OP)
397− remote_dev = xop->dst_dev;
422+ pr_debug("putting dst lun_ref for %p\n", xop->dst_dev);
398423 else
399− remote_dev = xop->src_dev;
400−
401− pr_debug("Calling configfs_undepend_item for"
402− " remote_dev: %p remote_dev->dev_group: %p\n",
403− remote_dev, &remote_dev->dev_group.cg_item);
424+ pr_debug("putting src lun_ref for %p\n", xop->src_dev);
404425
405− target_undepend_item(&remote_dev->dev_group.cg_item);
426+ percpu_ref_put(xop->remote_lun_ref);
406427 }
407428
408429 static void xcopy_pt_release_cmd(struct se_cmd *se_cmd)
drivers/target/target_core_xcopy.h+1−0
@@ -27,6 +27,7 @@ struct xcopy_op { · 26 unmodified lines
2727 struct se_device *dst_dev;
2828 unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
2929 unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
30+ struct percpu_ref *remote_lun_ref;
3031
3132 sector_t src_lba;
3233 sector_t dst_lba;
drivers/tty/Kconfig+14−0
@@ -401,6 +401,20 @@ config MIPS_EJTAG_FDC_KGDB_CHAN · 400 unmodified lines
401401 help
402402 FDC channel number to use for KGDB.
403403
404+config NULL_TTY
405+ tristate "NULL TTY driver"
406+ help
407+ Say Y here if you want a NULL TTY which simply discards messages.
408+
409+ This is useful to allow userspace applications which expect a console
410+ device to work without modifications even when no console is
411+ available or desired.
412+
413+ In order to use this driver, you should redirect the console to this
414+ TTY, or boot the kernel with console=ttynull.
415+
416+ If unsure, say N.
417+
404418 config TRACE_ROUTER
405419 tristate "Trace data router for MIPI P1149.7 cJTAG standard"
406420 depends on TRACE_SINK
drivers/tty/Makefile+2−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 obj-$(CONFIG_TTY) += tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o \
33 tty_buffer.o tty_port.o tty_mutex.o \
44 tty_ldsem.o tty_baudrate.o tty_jobctrl.o \
5− n_null.o ttynull.o
5+ n_null.o
66 obj-$(CONFIG_LEGACY_PTYS) += pty.o
77 obj-$(CONFIG_UNIX98_PTYS) += pty.o
88 obj-$(CONFIG_AUDIT) += tty_audit.o
@@ -25,6 +25,7 @@ obj-$(CONFIG_ISI) += isicom.o · 16 unmodified lines
2525 obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
2626 obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
2727 obj-$(CONFIG_NOZOMI) += nozomi.o
28+obj-$(CONFIG_NULL_TTY) += ttynull.o
2829 obj-$(CONFIG_ROCKETPORT) += rocket.o
2930 obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
3031 obj-$(CONFIG_PPC_EPAPR_HV_BYTECHAN) += ehv_bytechan.o
drivers/tty/serial/sifive.c+1−0
@@ -1000,6 +1000,7 @@ static int sifive_serial_probe(struct platform_device *pdev) · 999 unmodified lines
10001000 /* Set up clock divider */
10011001 ssp->clkin_rate = clk_get_rate(ssp->clk);
10021002 ssp->baud_rate = SIFIVE_DEFAULT_BAUD_RATE;
1003+ ssp->port.uartclk = ssp->baud_rate * 16;
10031004 __ssp_update_div(ssp);
10041005
10051006 platform_set_drvdata(pdev, ssp);
drivers/tty/ttynull.c+0−18
@@ -2,13 +2,6 @@ · 1 unmodified line
22 /*
33 * Copyright (C) 2019 Axis Communications AB
44 *
5− * The console is useful for userspace applications which expect a console
6− * device to work without modifications even when no console is available
7− * or desired.
8− *
9− * In order to use this driver, you should redirect the console to this
10− * TTY, or boot the kernel with console=ttynull.
11− *
125 * Based on ttyprintk.c:
136 * Copyright (C) 2010 Samo Pogacnik
147 */
@@ -66,17 +59,6 @@ static struct console ttynull_console = { · 51 unmodified lines
6659 .device = ttynull_device,
6760 };
6861
69−void __init register_ttynull_console(void)
70−{
71− if (!ttynull_driver)
72− return;
73−
74− if (add_preferred_console(ttynull_console.name, 0, NULL))
75− return;
76−
77− register_console(&ttynull_console);
78−}
79−
8062 static int __init ttynull_init(void)
8163 {
8264 struct tty_driver *driver;
drivers/usb/chipidea/ci_hdrc_imx.c+5−1
@@ -139,9 +139,13 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) · 138 unmodified lines
139139 misc_pdev = of_find_device_by_node(args.np);
140140 of_node_put(args.np);
141141
142− if (!misc_pdev || !platform_get_drvdata(misc_pdev))
142+ if (!misc_pdev)
143143 return ERR_PTR(-EPROBE_DEFER);
144144
145+ if (!platform_get_drvdata(misc_pdev)) {
146+ put_device(&misc_pdev->dev);
147+ return ERR_PTR(-EPROBE_DEFER);
148+ }
145149 data->dev = &misc_pdev->dev;
146150
147151 /*
drivers/usb/class/cdc-acm.c+4−0
@@ -1895,6 +1895,10 @@ static const struct usb_device_id acm_ids[] = { · 1894 unmodified lines
18951895 { USB_DEVICE(0x04d8, 0xfd08),
18961896 .driver_info = IGNORE_DEVICE,
18971897 },
1898+
1899+ { USB_DEVICE(0x04d8, 0xf58b),
1900+ .driver_info = IGNORE_DEVICE,
1901+ },
18981902 #endif
18991903
19001904 /*Samsung phone in firmware update mode */
drivers/usb/class/cdc-wdm.c+13−3
@@ -465,13 +465,23 @@ static int service_outstanding_interrupt(struct wdm_device *desc) · 464 unmodified lines
465465 if (!desc->resp_count || !--desc->resp_count)
466466 goto out;
467467
468+ if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
469+ rv = -ENODEV;
470+ goto out;
471+ }
472+ if (test_bit(WDM_RESETTING, &desc->flags)) {
473+ rv = -EIO;
474+ goto out;
475+ }
476+
468477 set_bit(WDM_RESPONDING, &desc->flags);
469478 spin_unlock_irq(&desc->iuspin);
470479 rv = usb_submit_urb(desc->response, GFP_KERNEL);
471480 spin_lock_irq(&desc->iuspin);
472481 if (rv) {
473− dev_err(&desc->intf->dev,
474− "usb_submit_urb failed with result %d\n", rv);
482+ if (!test_bit(WDM_DISCONNECTING, &desc->flags))
483+ dev_err(&desc->intf->dev,
484+ "usb_submit_urb failed with result %d\n", rv);
475485
476486 /* make sure the next notification trigger a submit */
477487 clear_bit(WDM_RESPONDING, &desc->flags);
@@ -1027,9 +1037,9 @@ static void wdm_disconnect(struct usb_interface *intf) · 549 unmodified lines
10271037 wake_up_all(&desc->wait);
10281038 mutex_lock(&desc->rlock);
10291039 mutex_lock(&desc->wlock);
1030− kill_urbs(desc);
10311040 cancel_work_sync(&desc->rxwork);
10321041 cancel_work_sync(&desc->service_outs_intr);
1042+ kill_urbs(desc);
10331043 mutex_unlock(&desc->wlock);
10341044 mutex_unlock(&desc->rlock);
10351045
drivers/usb/class/usblp.c+19−2
@@ -274,8 +274,25 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i · 273 unmodified lines
274274 #define usblp_reset(usblp)\
275275 usblp_ctrl_msg(usblp, USBLP_REQ_RESET, USB_TYPE_CLASS, USB_DIR_OUT, USB_RECIP_OTHER, 0, NULL, 0)
276276
277−#define usblp_hp_channel_change_request(usblp, channel, buffer) \
278− usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST, USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE, channel, buffer, 1)
277+static int usblp_hp_channel_change_request(struct usblp *usblp, int channel, u8 *new_channel)
278+{
279+ u8 *buf;
280+ int ret;
281+
282+ buf = kzalloc(1, GFP_KERNEL);
283+ if (!buf)
284+ return -ENOMEM;
285+
286+ ret = usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST,
287+ USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE,
288+ channel, buf, 1);
289+ if (ret == 0)
290+ *new_channel = buf[0];
291+
292+ kfree(buf);
293+
294+ return ret;
295+}
279296
280297 /*
281298 * See the description for usblp_select_alts() below for the usage
drivers/usb/core/hcd.c+3−5
@@ -1649,14 +1649,12 @@ static void __usb_hcd_giveback_urb(struct urb *urb) · 1648 unmodified lines
16491649 urb->status = status;
16501650 /*
16511651 * This function can be called in task context inside another remote
1652− * coverage collection section, but KCOV doesn't support that kind of
1652+ * coverage collection section, but kcov doesn't support that kind of
16531653 * recursion yet. Only collect coverage in softirq context for now.
16541654 */
1655− if (in_serving_softirq())
1656− kcov_remote_start_usb((u64)urb->dev->bus->busnum);
1655+ kcov_remote_start_usb_softirq((u64)urb->dev->bus->busnum);
16571656 urb->complete(urb);
1658− if (in_serving_softirq())
1659− kcov_remote_stop();
1657+ kcov_remote_stop_softirq();
16601658
16611659 usb_anchor_resume_wakeups(anchor);
16621660 atomic_dec(&urb->use_count);
drivers/usb/dwc3/core.h+1−0
@@ -285,6 +285,7 @@ · 284 unmodified lines
285285
286286 /* Global USB2 PHY Vendor Control Register */
287287 #define DWC3_GUSB2PHYACC_NEWREGREQ BIT(25)
288+#define DWC3_GUSB2PHYACC_DONE BIT(24)
288289 #define DWC3_GUSB2PHYACC_BUSY BIT(23)
289290 #define DWC3_GUSB2PHYACC_WRITE BIT(22)
290291 #define DWC3_GUSB2PHYACC_ADDR(n) (n << 16)
drivers/usb/dwc3/dwc3-meson-g12a.c+1−1
@@ -754,7 +754,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) · 753 unmodified lines
754754
755755 ret = priv->drvdata->setup_regmaps(priv, base);
756756 if (ret)
757− return ret;
757+ goto err_disable_clks;
758758
759759 if (priv->vbus) {
760760 ret = regulator_enable(priv->vbus);
drivers/usb/dwc3/gadget.c+5−11
@@ -1763,6 +1763,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, · 1762 unmodified lines
17631763 list_for_each_entry_safe(r, t, &dep->started_list, list)
17641764 dwc3_gadget_move_cancelled_request(r);
17651765
1766+ dep->flags &= ~DWC3_EP_WAIT_TRANSFER_COMPLETE;
1767+
17661768 goto out;
17671769 }
17681770 }
@@ -2083,6 +2085,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) · 314 unmodified lines
20832085
20842086 static void dwc3_gadget_disable_irq(struct dwc3 *dwc);
20852087 static void __dwc3_gadget_stop(struct dwc3 *dwc);
2088+static int __dwc3_gadget_start(struct dwc3 *dwc);
20862089
20872090 static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
20882091 {
@@ -2145,6 +2148,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) · 56 unmodified lines
21452148 dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) %
21462149 dwc->ev_buf->length;
21472150 }
2151+ } else {
2152+ __dwc3_gadget_start(dwc);
21482153 }
21492154
21502155 ret = dwc3_gadget_run_stop(dwc, is_on, false);
@@ -2319,10 +2324,6 @@ static int dwc3_gadget_start(struct usb_gadget *g, · 168 unmodified lines
23192324 }
23202325
23212326 dwc->gadget_driver = driver;
2322−
2323− if (pm_runtime_active(dwc->dev))
2324− __dwc3_gadget_start(dwc);
2325−
23262327 spin_unlock_irqrestore(&dwc->lock, flags);
23272328
23282329 return 0;
@@ -2348,13 +2349,6 @@ static int dwc3_gadget_stop(struct usb_gadget *g) · 19 unmodified lines
23482349 unsigned long flags;
23492350
23502351 spin_lock_irqsave(&dwc->lock, flags);
2351−
2352− if (pm_runtime_suspended(dwc->dev))
2353− goto out;
2354−
2355− __dwc3_gadget_stop(dwc);
2356−
2357−out:
23582352 dwc->gadget_driver = NULL;
23592353 spin_unlock_irqrestore(&dwc->lock, flags);
23602354
drivers/usb/dwc3/ulpi.c+21−17
@@ -7,6 +7,8 @@ · 6 unmodified lines
77 * Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
88 */
99
10+#include <linux/delay.h>
11+#include <linux/time64.h>
1012 #include <linux/ulpi/regs.h>
1113
1214 #include "core.h"
@@ -17,14 +19,28 @@ · 4 unmodified lines
1719 DWC3_GUSB2PHYACC_ADDR(ULPI_ACCESS_EXTENDED) | \
1820 DWC3_GUSB2PHYACC_EXTEND_ADDR(a) : DWC3_GUSB2PHYACC_ADDR(a))
1921
20−static int dwc3_ulpi_busyloop(struct dwc3 *dwc)
22+#define DWC3_ULPI_BASE_DELAY DIV_ROUND_UP(NSEC_PER_SEC, 60000000L)
23+
24+static int dwc3_ulpi_busyloop(struct dwc3 *dwc, u8 addr, bool read)
2125 {
22− unsigned int count = 1000;
26+ unsigned long ns = 5L * DWC3_ULPI_BASE_DELAY;
27+ unsigned int count = 10000;
2328 u32 reg;
2429
30+ if (addr >= ULPI_EXT_VENDOR_SPECIFIC)
31+ ns += DWC3_ULPI_BASE_DELAY;
32+
33+ if (read)
34+ ns += DWC3_ULPI_BASE_DELAY;
35+
36+ reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
37+ if (reg & DWC3_GUSB2PHYCFG_SUSPHY)
38+ usleep_range(1000, 1200);
39+
2540 while (count--) {
41+ ndelay(ns);
2642 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYACC(0));
27− if (!(reg & DWC3_GUSB2PHYACC_BUSY))
43+ if (reg & DWC3_GUSB2PHYACC_DONE)
2844 return 0;
2945 cpu_relax();
3046 }
@@ -38,16 +54,10 @@ static int dwc3_ulpi_read(struct device *dev, u8 addr) · 7 unmodified lines
3854 u32 reg;
3955 int ret;
4056
41− reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
42− if (reg & DWC3_GUSB2PHYCFG_SUSPHY) {
43− reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
44− dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
45− }
46−
4757 reg = DWC3_GUSB2PHYACC_NEWREGREQ | DWC3_ULPI_ADDR(addr);
4858 dwc3_writel(dwc->regs, DWC3_GUSB2PHYACC(0), reg);
4959
50− ret = dwc3_ulpi_busyloop(dwc);
60+ ret = dwc3_ulpi_busyloop(dwc, addr, true);
5161 if (ret)
5262 return ret;
5363
@@ -61,17 +71,11 @@ static int dwc3_ulpi_write(struct device *dev, u8 addr, u8 val) · 7 unmodified lines
6171 struct dwc3 *dwc = dev_get_drvdata(dev);
6272 u32 reg;
6373
64− reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
65− if (reg & DWC3_GUSB2PHYCFG_SUSPHY) {
66− reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
67− dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
68− }
69−
7074 reg = DWC3_GUSB2PHYACC_NEWREGREQ | DWC3_ULPI_ADDR(addr);
7175 reg |= DWC3_GUSB2PHYACC_WRITE | val;
7276 dwc3_writel(dwc->regs, DWC3_GUSB2PHYACC(0), reg);
7377
74− return dwc3_ulpi_busyloop(dwc);
78+ return dwc3_ulpi_busyloop(dwc, addr, false);
7579 }
7680
7781 static const struct ulpi_ops dwc3_ulpi_ops = {
drivers/usb/gadget/Kconfig+2−0
@@ -265,6 +265,7 @@ config USB_CONFIGFS_NCM · 264 unmodified lines
265265 depends on NET
266266 select USB_U_ETHER
267267 select USB_F_NCM
268+ select CRC32
268269 help
269270 NCM is an advanced protocol for Ethernet encapsulation, allows
270271 grouping of several ethernet frames into one USB transfer and
@@ -314,6 +315,7 @@ config USB_CONFIGFS_EEM · 43 unmodified lines
314315 depends on NET
315316 select USB_U_ETHER
316317 select USB_F_EEM
318+ select CRC32
317319 help
318320 CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM
319321 and therefore can be supported by more hardware. Technically ECM and
drivers/usb/gadget/composite.c+8−2
@@ -392,8 +392,11 @@ int usb_function_deactivate(struct usb_function *function) · 391 unmodified lines
392392
393393 spin_lock_irqsave(&cdev->lock, flags);
394394
395− if (cdev->deactivations == 0)
395+ if (cdev->deactivations == 0) {
396+ spin_unlock_irqrestore(&cdev->lock, flags);
396397 status = usb_gadget_deactivate(cdev->gadget);
398+ spin_lock_irqsave(&cdev->lock, flags);
399+ }
397400 if (status == 0)
398401 cdev->deactivations++;
399402
@@ -424,8 +427,11 @@ int usb_function_activate(struct usb_function *function) · 24 unmodified lines
424427 status = -EINVAL;
425428 else {
426429 cdev->deactivations--;
427− if (cdev->deactivations == 0)
430+ if (cdev->deactivations == 0) {
431+ spin_unlock_irqrestore(&cdev->lock, flags);
428432 status = usb_gadget_activate(cdev->gadget);
433+ spin_lock_irqsave(&cdev->lock, flags);
434+ }
429435 }
430436
431437 spin_unlock_irqrestore(&cdev->lock, flags);
drivers/usb/gadget/configfs.c+13−6
@@ -221,9 +221,16 @@ static ssize_t gadget_dev_desc_bcdUSB_store(struct config_item *item, · 220 unmodified lines
221221
222222 static ssize_t gadget_dev_desc_UDC_show(struct config_item *item, char *page)
223223 {
224− char *udc_name = to_gadget_info(item)->composite.gadget_driver.udc_name;
224+ struct gadget_info *gi = to_gadget_info(item);
225+ char *udc_name;
226+ int ret;
227+
228+ mutex_lock(&gi->lock);
229+ udc_name = gi->composite.gadget_driver.udc_name;
230+ ret = sprintf(page, "%s\n", udc_name ?: "");
231+ mutex_unlock(&gi->lock);
225232
226− return sprintf(page, "%s\n", udc_name ?: "");
233+ return ret;
227234 }
228235
229236 static int unregister_gadget(struct gadget_info *gi)
@@ -1248,9 +1255,9 @@ static void purge_configs_funcs(struct gadget_info *gi) · 1018 unmodified lines
12481255
12491256 cfg = container_of(c, struct config_usb_cfg, c);
12501257
1251− list_for_each_entry_safe(f, tmp, &c->functions, list) {
1258+ list_for_each_entry_safe_reverse(f, tmp, &c->functions, list) {
12521259
1253− list_move_tail(&f->list, &cfg->func_list);
1260+ list_move(&f->list, &cfg->func_list);
12541261 if (f->unbind) {
12551262 dev_dbg(&gi->cdev.gadget->dev,
12561263 "unbind function '%s'/%p\n",
@@ -1536,7 +1543,7 @@ static const struct usb_gadget_driver configfs_driver_template = { · 279 unmodified lines
15361543 .suspend = configfs_composite_suspend,
15371544 .resume = configfs_composite_resume,
15381545
1539− .max_speed = USB_SPEED_SUPER,
1546+ .max_speed = USB_SPEED_SUPER_PLUS,
15401547 .driver = {
15411548 .owner = THIS_MODULE,
15421549 .name = "configfs-gadget",
@@ -1576,7 +1583,7 @@ static struct config_group *gadgets_make( · 33 unmodified lines
15761583 gi->composite.unbind = configfs_do_nothing;
15771584 gi->composite.suspend = NULL;
15781585 gi->composite.resume = NULL;
1579− gi->composite.max_speed = USB_SPEED_SUPER;
1586+ gi->composite.max_speed = USB_SPEED_SUPER_PLUS;
15801587
15811588 spin_lock_init(&gi->spinlock);
15821589 mutex_init(&gi->lock);
drivers/usb/gadget/function/f_printer.c+1−0
@@ -1162,6 +1162,7 @@ fail_tx_reqs: · 1161 unmodified lines
11621162 printer_req_free(dev->in_ep, req);
11631163 }
11641164
1165+ usb_free_all_descriptors(f);
11651166 return ret;
11661167
11671168 }
drivers/usb/gadget/function/f_uac2.c+55−14
@@ -271,7 +271,7 @@ static struct usb_endpoint_descriptor fs_epout_desc = { · 270 unmodified lines
271271
272272 .bEndpointAddress = USB_DIR_OUT,
273273 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
274− .wMaxPacketSize = cpu_to_le16(1023),
274+ /* .wMaxPacketSize = DYNAMIC */
275275 .bInterval = 1,
276276 };
277277
@@ -280,7 +280,7 @@ static struct usb_endpoint_descriptor hs_epout_desc = { · 2 unmodified lines
280280 .bDescriptorType = USB_DT_ENDPOINT,
281281
282282 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
283− .wMaxPacketSize = cpu_to_le16(1024),
283+ /* .wMaxPacketSize = DYNAMIC */
284284 .bInterval = 4,
285285 };
286286
@@ -348,7 +348,7 @@ static struct usb_endpoint_descriptor fs_epin_desc = { · 61 unmodified lines
348348
349349 .bEndpointAddress = USB_DIR_IN,
350350 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
351− .wMaxPacketSize = cpu_to_le16(1023),
351+ /* .wMaxPacketSize = DYNAMIC */
352352 .bInterval = 1,
353353 };
354354
@@ -357,7 +357,7 @@ static struct usb_endpoint_descriptor hs_epin_desc = { · 2 unmodified lines
357357 .bDescriptorType = USB_DT_ENDPOINT,
358358
359359 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
360− .wMaxPacketSize = cpu_to_le16(1024),
360+ /* .wMaxPacketSize = DYNAMIC */
361361 .bInterval = 4,
362362 };
363363
@@ -444,12 +444,28 @@ struct cntrl_range_lay3 { · 80 unmodified lines
444444 __le32 dRES;
445445 } __packed;
446446
447−static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
447+static int set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
448448 struct usb_endpoint_descriptor *ep_desc,
449− unsigned int factor, bool is_playback)
449+ enum usb_device_speed speed, bool is_playback)
450450 {
451451 int chmask, srate, ssize;
452− u16 max_packet_size;
452+ u16 max_size_bw, max_size_ep;
453+ unsigned int factor;
454+
455+ switch (speed) {
456+ case USB_SPEED_FULL:
457+ max_size_ep = 1023;
458+ factor = 1000;
459+ break;
460+
461+ case USB_SPEED_HIGH:
462+ max_size_ep = 1024;
463+ factor = 8000;
464+ break;
465+
466+ default:
467+ return -EINVAL;
468+ }
453469
454470 if (is_playback) {
455471 chmask = uac2_opts->p_chmask;
@@ -461,10 +477,12 @@ static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts, · 5 unmodified lines
461477 ssize = uac2_opts->c_ssize;
462478 }
463479
464− max_packet_size = num_channels(chmask) * ssize *
480+ max_size_bw = num_channels(chmask) * ssize *
465481 DIV_ROUND_UP(srate, factor / (1 << (ep_desc->bInterval - 1)));
466− ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_packet_size,
467− le16_to_cpu(ep_desc->wMaxPacketSize)));
482+ ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_size_bw,
483+ max_size_ep));
484+
485+ return 0;
468486 }
469487
470488 /* Use macro to overcome line length limitation */
@@ -670,10 +688,33 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) · 199 unmodified lines
670688 }
671689
672690 /* Calculate wMaxPacketSize according to audio bandwidth */
673− set_ep_max_packet_size(uac2_opts, &fs_epin_desc, 1000, true);
674− set_ep_max_packet_size(uac2_opts, &fs_epout_desc, 1000, false);
675− set_ep_max_packet_size(uac2_opts, &hs_epin_desc, 8000, true);
676− set_ep_max_packet_size(uac2_opts, &hs_epout_desc, 8000, false);
691+ ret = set_ep_max_packet_size(uac2_opts, &fs_epin_desc, USB_SPEED_FULL,
692+ true);
693+ if (ret < 0) {
694+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
695+ return ret;
696+ }
697+
698+ ret = set_ep_max_packet_size(uac2_opts, &fs_epout_desc, USB_SPEED_FULL,
699+ false);
700+ if (ret < 0) {
701+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
702+ return ret;
703+ }
704+
705+ ret = set_ep_max_packet_size(uac2_opts, &hs_epin_desc, USB_SPEED_HIGH,
706+ true);
707+ if (ret < 0) {
708+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
709+ return ret;
710+ }
711+
712+ ret = set_ep_max_packet_size(uac2_opts, &hs_epout_desc, USB_SPEED_HIGH,
713+ false);
714+ if (ret < 0) {
715+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
716+ return ret;
717+ }
677718
678719 if (EPOUT_EN(uac2_opts)) {
679720 agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc);
drivers/usb/gadget/function/u_ether.c+5−4
@@ -45,9 +45,10 @@ · 44 unmodified lines
4545 #define UETH__VERSION "29-May-2008"
4646
4747 /* Experiments show that both Linux and Windows hosts allow up to 16k
48− * frame sizes. Set the max size to 15k+52 to prevent allocating 32k
48+ * frame sizes. Set the max MTU size to 15k+52 to prevent allocating 32k
4949 * blocks and still have efficient handling. */
50−#define GETHER_MAX_ETH_FRAME_LEN 15412
50+#define GETHER_MAX_MTU_SIZE 15412
51+#define GETHER_MAX_ETH_FRAME_LEN (GETHER_MAX_MTU_SIZE + ETH_HLEN)
5152
5253 struct eth_dev {
5354 /* lock is held while accessing port_usb
@@ -786,7 +787,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, · 732 unmodified lines
786787
787788 /* MTU range: 14 - 15412 */
788789 net->min_mtu = ETH_HLEN;
789− net->max_mtu = GETHER_MAX_ETH_FRAME_LEN;
790+ net->max_mtu = GETHER_MAX_MTU_SIZE;
790791
791792 dev->gadget = g;
792793 SET_NETDEV_DEV(net, &g->dev);
@@ -848,7 +849,7 @@ struct net_device *gether_setup_name_default(const char *netname) · 55 unmodified lines
848849
849850 /* MTU range: 14 - 15412 */
850851 net->min_mtu = ETH_HLEN;
851− net->max_mtu = GETHER_MAX_ETH_FRAME_LEN;
852+ net->max_mtu = GETHER_MAX_MTU_SIZE;
852853
853854 return net;
854855 }
drivers/usb/gadget/legacy/acm_ms.c+3−1
@@ -200,8 +200,10 @@ static int acm_ms_bind(struct usb_composite_dev *cdev) · 199 unmodified lines
200200 struct usb_descriptor_header *usb_desc;
201201
202202 usb_desc = usb_otg_descriptor_alloc(gadget);
203− if (!usb_desc)
203+ if (!usb_desc) {
204+ status = -ENOMEM;
204205 goto fail_string_ids;
206+ }
205207 usb_otg_descriptor_init(gadget, usb_desc);
206208 otg_desc[0] = usb_desc;
207209 otg_desc[1] = NULL;
drivers/usb/gadget/udc/Kconfig+1−1
@@ -90,7 +90,7 @@ config USB_BCM63XX_UDC · 89 unmodified lines
9090
9191 config USB_FSL_USB2
9292 tristate "Freescale Highspeed USB DR Peripheral Controller"
93− depends on FSL_SOC || ARCH_MXC
93+ depends on FSL_SOC
9494 help
9595 Some of Freescale PowerPC and i.MX processors have a High Speed
9696 Dual-Role(DR) USB controller, which supports device mode.
drivers/usb/gadget/udc/Makefile+0−1
@@ -23,7 +23,6 @@ obj-$(CONFIG_USB_ATMEL_USBA) += atmel_usba_udc.o · 22 unmodified lines
2323 obj-$(CONFIG_USB_BCM63XX_UDC) += bcm63xx_udc.o
2424 obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
2525 fsl_usb2_udc-y := fsl_udc_core.o
26−fsl_usb2_udc-$(CONFIG_ARCH_MXC) += fsl_mxc_udc.o
2726 obj-$(CONFIG_USB_TEGRA_XUDC) += tegra-xudc.o
2827 obj-$(CONFIG_USB_M66592) += m66592-udc.o
2928 obj-$(CONFIG_USB_R8A66597) += r8a66597-udc.o
drivers/usb/gadget/udc/core.c+1−2
@@ -659,8 +659,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_vbus_disconnect); · 658 unmodified lines
659659 *
660660 * Enables the D+ (or potentially D-) pullup. The host will start
661661 * enumerating this gadget when the pullup is active and a VBUS session
662− * is active (the link is powered). This pullup is always enabled unless
663− * usb_gadget_disconnect() has been used to disable it.
662+ * is active (the link is powered).
664663 *
665664 * Returns zero on success, else negative errno.
666665 */
drivers/usb/gadget/udc/dummy_hcd.c+23−12
@@ -2118,9 +2118,21 @@ static int dummy_hub_control( · 2117 unmodified lines
21182118 dum_hcd->port_status &= ~USB_PORT_STAT_POWER;
21192119 set_link_state(dum_hcd);
21202120 break;
2121− default:
2121+ case USB_PORT_FEAT_ENABLE:
2122+ case USB_PORT_FEAT_C_ENABLE:
2123+ case USB_PORT_FEAT_C_SUSPEND:
2124+ /* Not allowed for USB-3 */
2125+ if (hcd->speed == HCD_USB3)
2126+ goto error;
2127+ fallthrough;
2128+ case USB_PORT_FEAT_C_CONNECTION:
2129+ case USB_PORT_FEAT_C_RESET:
21222130 dum_hcd->port_status &= ~(1 << wValue);
21232131 set_link_state(dum_hcd);
2132+ break;
2133+ default:
2134+ /* Disallow INDICATOR and C_OVER_CURRENT */
2135+ goto error;
21242136 }
21252137 break;
21262138 case GetHubDescriptor:
@@ -2281,18 +2293,17 @@ static int dummy_hub_control( · 154 unmodified lines
22812293 */
22822294 dum_hcd->re_timeout = jiffies + msecs_to_jiffies(50);
22832295 fallthrough;
2296+ case USB_PORT_FEAT_C_CONNECTION:
2297+ case USB_PORT_FEAT_C_RESET:
2298+ case USB_PORT_FEAT_C_ENABLE:
2299+ case USB_PORT_FEAT_C_SUSPEND:
2300+ /* Not allowed for USB-3, and ignored for USB-2 */
2301+ if (hcd->speed == HCD_USB3)
2302+ goto error;
2303+ break;
22842304 default:
2285− if (hcd->speed == HCD_USB3) {
2286− if ((dum_hcd->port_status &
2287− USB_SS_PORT_STAT_POWER) != 0) {
2288− dum_hcd->port_status |= (1 << wValue);
2289− }
2290− } else
2291− if ((dum_hcd->port_status &
2292− USB_PORT_STAT_POWER) != 0) {
2293− dum_hcd->port_status |= (1 << wValue);
2294− }
2295− set_link_state(dum_hcd);
2305+ /* Disallow TEST, INDICATOR, and C_OVER_CURRENT */
2306+ goto error;
22962307 }
22972308 break;
22982309 case GetPortErrorCount:
drivers/usb/gadget/udc/fsl_mxc_udc.c+0−122
@@ -1,122 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0+
2−/*
3− * Copyright (C) 2009
4− * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
5− *
6− * Description:
7− * Helper routines for i.MX3x SoCs from Freescale, needed by the fsl_usb2_udc.c
8− * driver to function correctly on these systems.
9− */
10−#include <linux/clk.h>
11−#include <linux/delay.h>
12−#include <linux/err.h>
13−#include <linux/fsl_devices.h>
14−#include <linux/mod_devicetable.h>
15−#include <linux/platform_device.h>
16−#include <linux/io.h>
17−
18−#include "fsl_usb2_udc.h"
19−
20−static struct clk *mxc_ahb_clk;
21−static struct clk *mxc_per_clk;
22−static struct clk *mxc_ipg_clk;
23−
24−/* workaround ENGcm09152 for i.MX35 */
25−#define MX35_USBPHYCTRL_OFFSET 0x600
26−#define USBPHYCTRL_OTGBASE_OFFSET 0x8
27−#define USBPHYCTRL_EVDO (1 << 23)
28−
29−int fsl_udc_clk_init(struct platform_device *pdev)
30−{
31− struct fsl_usb2_platform_data *pdata;
32− unsigned long freq;
33− int ret;
34−
35− pdata = dev_get_platdata(&pdev->dev);
36−
37− mxc_ipg_clk = devm_clk_get(&pdev->dev, "ipg");
38− if (IS_ERR(mxc_ipg_clk)) {
39− dev_err(&pdev->dev, "clk_get(\"ipg\") failed\n");
40− return PTR_ERR(mxc_ipg_clk);
41− }
42−
43− mxc_ahb_clk = devm_clk_get(&pdev->dev, "ahb");
44− if (IS_ERR(mxc_ahb_clk)) {
45− dev_err(&pdev->dev, "clk_get(\"ahb\") failed\n");
46− return PTR_ERR(mxc_ahb_clk);
47− }
48−
49− mxc_per_clk = devm_clk_get(&pdev->dev, "per");
50− if (IS_ERR(mxc_per_clk)) {
51− dev_err(&pdev->dev, "clk_get(\"per\") failed\n");
52− return PTR_ERR(mxc_per_clk);
53− }
54−
55− clk_prepare_enable(mxc_ipg_clk);
56− clk_prepare_enable(mxc_ahb_clk);
57− clk_prepare_enable(mxc_per_clk);
58−
59− /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
60− if (!strcmp(pdev->id_entry->name, "imx-udc-mx27")) {
61− freq = clk_get_rate(mxc_per_clk);
62− if (pdata->phy_mode != FSL_USB2_PHY_ULPI &&
63− (freq < 59999000 || freq > 60001000)) {
64− dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq);
65− ret = -EINVAL;
66− goto eclkrate;
67− }
68− }
69−
70− return 0;
71−
72−eclkrate:
73− clk_disable_unprepare(mxc_ipg_clk);
74− clk_disable_unprepare(mxc_ahb_clk);
75− clk_disable_unprepare(mxc_per_clk);
76− mxc_per_clk = NULL;
77− return ret;
78−}
79−
80−int fsl_udc_clk_finalize(struct platform_device *pdev)
81−{
82− struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
83− int ret = 0;
84−
85− /* workaround ENGcm09152 for i.MX35 */
86− if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) {
87− unsigned int v;
88− struct resource *res = platform_get_resource
89− (pdev, IORESOURCE_MEM, 0);
90− void __iomem *phy_regs = ioremap(res->start +
91− MX35_USBPHYCTRL_OFFSET, 512);
92− if (!phy_regs) {
93− dev_err(&pdev->dev, "ioremap for phy address fails\n");
94− ret = -EINVAL;
95− goto ioremap_err;
96− }
97−
98− v = readl(phy_regs + USBPHYCTRL_OTGBASE_OFFSET);
99− writel(v | USBPHYCTRL_EVDO,
100− phy_regs + USBPHYCTRL_OTGBASE_OFFSET);
101−
102− iounmap(phy_regs);
103− }
104−
105−
106−ioremap_err:
107− /* ULPI transceivers don't need usbpll */
108− if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
109− clk_disable_unprepare(mxc_per_clk);
110− mxc_per_clk = NULL;
111− }
112−
113− return ret;
114−}
115−
116−void fsl_udc_clk_release(void)
117−{
118− if (mxc_per_clk)
119− clk_disable_unprepare(mxc_per_clk);
120− clk_disable_unprepare(mxc_ahb_clk);
121− clk_disable_unprepare(mxc_ipg_clk);
122−}
drivers/usb/host/xhci.c+12−12
@@ -4770,19 +4770,19 @@ static u16 xhci_calculate_u1_timeout(struct xhci_hcd *xhci, · 4769 unmodified lines
47704770 {
47714771 unsigned long long timeout_ns;
47724772
4773+ if (xhci->quirks & XHCI_INTEL_HOST)
4774+ timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
4775+ else
4776+ timeout_ns = udev->u1_params.sel;
4777+
47734778 /* Prevent U1 if service interval is shorter than U1 exit latency */
47744779 if (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc)) {
4775− if (xhci_service_interval_to_ns(desc) <= udev->u1_params.mel) {
4780+ if (xhci_service_interval_to_ns(desc) <= timeout_ns) {
47764781 dev_dbg(&udev->dev, "Disable U1, ESIT shorter than exit latency\n");
47774782 return USB3_LPM_DISABLED;
47784783 }
47794784 }
47804785
4781− if (xhci->quirks & XHCI_INTEL_HOST)
4782− timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
4783− else
4784− timeout_ns = udev->u1_params.sel;
4785−
47864786 /* The U1 timeout is encoded in 1us intervals.
47874787 * Don't return a timeout of zero, because that's USB3_LPM_DISABLED.
47884788 */
@@ -4834,19 +4834,19 @@ static u16 xhci_calculate_u2_timeout(struct xhci_hcd *xhci, · 45 unmodified lines
48344834 {
48354835 unsigned long long timeout_ns;
48364836
4837+ if (xhci->quirks & XHCI_INTEL_HOST)
4838+ timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc);
4839+ else
4840+ timeout_ns = udev->u2_params.sel;
4841+
48374842 /* Prevent U2 if service interval is shorter than U2 exit latency */
48384843 if (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc)) {
4839− if (xhci_service_interval_to_ns(desc) <= udev->u2_params.mel) {
4844+ if (xhci_service_interval_to_ns(desc) <= timeout_ns) {
48404845 dev_dbg(&udev->dev, "Disable U2, ESIT shorter than exit latency\n");
48414846 return USB3_LPM_DISABLED;
48424847 }
48434848 }
48444849
4845− if (xhci->quirks & XHCI_INTEL_HOST)
4846− timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc);
4847− else
4848− timeout_ns = udev->u2_params.sel;
4849−
48504850 /* The U2 timeout is encoded in 256us intervals */
48514851 timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 256 * 1000);
48524852 /* If the necessary timeout value is bigger than what we can set in the
drivers/usb/misc/yurex.c+3−0
@@ -496,6 +496,9 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer, · 495 unmodified lines
496496 timeout = schedule_timeout(YUREX_WRITE_TIMEOUT);
497497 finish_wait(&dev->waitq, &wait);
498498
499+ /* make sure URB is idle after timeout or (spurious) CMD_ACK */
500+ usb_kill_urb(dev->cntl_urb);
501+
499502 mutex_unlock(&dev->io_mutex);
500503
501504 if (retval < 0) {
drivers/usb/serial/iuu_phoenix.c+15−5
@@ -532,23 +532,29 @@ static int iuu_uart_flush(struct usb_serial_port *port) · 531 unmodified lines
532532 struct device *dev = &port->dev;
533533 int i;
534534 int status;
535− u8 rxcmd = IUU_UART_RX;
535+ u8 *rxcmd;
536536 struct iuu_private *priv = usb_get_serial_port_data(port);
537537
538538 if (iuu_led(port, 0xF000, 0, 0, 0xFF) < 0)
539539 return -EIO;
540540
541+ rxcmd = kmalloc(1, GFP_KERNEL);
542+ if (!rxcmd)
543+ return -ENOMEM;
544+
545+ rxcmd[0] = IUU_UART_RX;
546+
541547 for (i = 0; i < 2; i++) {
542− status = bulk_immediate(port, &rxcmd, 1);
548+ status = bulk_immediate(port, rxcmd, 1);
543549 if (status != IUU_OPERATION_OK) {
544550 dev_dbg(dev, "%s - uart_flush_write error\n", __func__);
545− return status;
551+ goto out_free;
546552 }
547553
548554 status = read_immediate(port, &priv->len, 1);
549555 if (status != IUU_OPERATION_OK) {
550556 dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
551− return status;
557+ goto out_free;
552558 }
553559
554560 if (priv->len > 0) {
@@ -556,12 +562,16 @@ static int iuu_uart_flush(struct usb_serial_port *port) · 1 unmodified line
556562 status = read_immediate(port, priv->buf, priv->len);
557563 if (status != IUU_OPERATION_OK) {
558564 dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
559− return status;
565+ goto out_free;
560566 }
561567 }
562568 }
563569 dev_dbg(dev, "%s - uart_flush_read OK!\n", __func__);
564570 iuu_led(port, 0, 0xF000, 0, 0xFF);
571+
572+out_free:
573+ kfree(rxcmd);
574+
565575 return status;
566576 }
567577
drivers/usb/serial/option.c+3−0
@@ -1117,6 +1117,8 @@ static const struct usb_device_id option_ids[] = { · 1116 unmodified lines
11171117 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
11181118 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
11191119 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1120+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0xff, 0x30) }, /* EM160R-GL */
1121+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0, 0) },
11201122 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
11211123 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
11221124 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
@@ -2057,6 +2059,7 @@ static const struct usb_device_id option_ids[] = { · 934 unmodified lines
20572059 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
20582060 .driver_info = RSVD(6) },
20592061 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
2062+ { USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
20602063 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
20612064 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
20622065 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
drivers/usb/storage/unusual_uas.h+7−0
@@ -90,6 +90,13 @@ UNUSUAL_DEV(0x152d, 0x0578, 0x0000, 0x9999, · 89 unmodified lines
9090 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
9191 US_FL_BROKEN_FUA),
9292
93+/* Reported-by: Thinh Nguyen <thinhn@synopsys.com> */
94+UNUSUAL_DEV(0x154b, 0xf00b, 0x0000, 0x9999,
95+ "PNY",
96+ "Pro Elite SSD",
97+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
98+ US_FL_NO_ATA_1X),
99+
93100 /* Reported-by: Thinh Nguyen <thinhn@synopsys.com> */
94101 UNUSUAL_DEV(0x154b, 0xf00d, 0x0000, 0x9999,
95102 "PNY",
drivers/usb/typec/altmodes/Kconfig+1−1
@@ -20,6 +20,6 @@ config TYPEC_NVIDIA_ALTMODE · 19 unmodified lines
2020 to enable support for VirtualLink devices with NVIDIA GPUs.
2121
2222 To compile this driver as a module, choose M here: the
23− module will be called typec_displayport.
23+ module will be called typec_nvidia.
2424
2525 endmenu
drivers/usb/typec/class.c+2−0
@@ -766,6 +766,7 @@ int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmod · 765 unmodified lines
766766 return ret;
767767
768768 sysfs_notify(&partner->dev.kobj, NULL, "number_of_alternate_modes");
769+ kobject_uevent(&partner->dev.kobj, KOBJ_CHANGE);
769770
770771 return 0;
771772 }
@@ -923,6 +924,7 @@ int typec_plug_set_num_altmodes(struct typec_plug *plug, int num_altmodes) · 151 unmodified lines
923924 return ret;
924925
925926 sysfs_notify(&plug->dev.kobj, NULL, "number_of_alternate_modes");
927+ kobject_uevent(&plug->dev.kobj, KOBJ_CHANGE);
926928
927929 return 0;
928930 }
drivers/usb/typec/mux/intel_pmc_mux.c+11−0
@@ -207,10 +207,21 @@ static int · 206 unmodified lines
207207 pmc_usb_mux_dp_hpd(struct pmc_usb_port *port, struct typec_displayport_data *dp)
208208 {
209209 u8 msg[2] = { };
210+ int ret;
210211
211212 msg[0] = PMC_USB_DP_HPD;
212213 msg[0] |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT;
213214
215+ /* Configure HPD first if HPD,IRQ comes together */
216+ if (!IOM_PORT_HPD_ASSERTED(port->iom_status) &&
217+ dp->status & DP_STATUS_IRQ_HPD &&
218+ dp->status & DP_STATUS_HPD_STATE) {
219+ msg[1] = PMC_USB_DP_HPD_LVL;
220+ ret = pmc_usb_command(port, msg, sizeof(msg));
221+ if (ret)
222+ return ret;
223+ }
224+
214225 if (dp->status & DP_STATUS_IRQ_HPD)
215226 msg[1] = PMC_USB_DP_HPD_IRQ;
216227
drivers/usb/usbip/vhci_hcd.c+2−0
@@ -396,6 +396,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, · 395 unmodified lines
396396 default:
397397 usbip_dbg_vhci_rh(" ClearPortFeature: default %x\n",
398398 wValue);
399+ if (wValue >= 32)
400+ goto error;
399401 vhci_hcd->port_status[rhport] &= ~(1 << wValue);
400402 break;
401403 }
drivers/vhost/net.c+3−3
@@ -863,6 +863,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) · 862 unmodified lines
863863 size_t len, total_len = 0;
864864 int err;
865865 struct vhost_net_ubuf_ref *ubufs;
866+ struct ubuf_info *ubuf;
866867 bool zcopy_used;

22 more lines aren’t shown here.

drivers/vhost/vsock.c+65−3

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

drivers/xen/events/events_base.c+0−10

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

drivers/xen/platform-pci.c+7−1

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

drivers/xen/privcmd.c+19−6

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

drivers/xen/xenbus/xenbus.h+1−0

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

drivers/xen/xenbus/xenbus_comms.c+0−8

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

drivers/xen/xenbus/xenbus_probe.c+67−14

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

fs/afs/dir.c+26−23

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

fs/afs/dir_edit.c+2−4

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

fs/afs/xdr_fs.h+21−4

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

fs/block_dev.c+6−3

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

fs/btrfs/btrfs_inode.h+9−0

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

fs/btrfs/ctree.c+22−2

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

fs/btrfs/ctree.h+27−2

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

fs/btrfs/dev-replace.c+1−1

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

fs/btrfs/discard.c+36−34

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

fs/btrfs/disk-io.c+9−6

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

fs/btrfs/extent-tree.c+2−0

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

fs/btrfs/extent_io.c+1−3

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

fs/btrfs/file-item.c+2−0

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

fs/btrfs/inode.c+51−18

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

fs/btrfs/ioctl.c+1−1

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

fs/btrfs/print-tree.c+5−5

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

fs/btrfs/print-tree.h+1−1

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

fs/btrfs/qgroup.c+30−13

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

fs/btrfs/reflink.c+15−0

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

fs/btrfs/relocation.c+6−1

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

fs/btrfs/send.c+31−18

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

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

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

fs/btrfs/super.c+37−3

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

fs/btrfs/tests/btrfs-tests.c+8−2

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

fs/btrfs/tests/inode-tests.c+0−9

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

fs/btrfs/tree-checker.c+7−0

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

fs/btrfs/volumes.c+2−2

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

fs/ceph/mds_client.c+22−31

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

fs/cifs/connect.c+1−1

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

fs/cifs/dfs_cache.c+2−1

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

fs/cifs/fs_context.c+1−3

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

fs/cifs/smb2pdu.c+1−1

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

fs/cifs/smb2pdu.h+1−1

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

fs/ext4/ext4_jbd2.c+0−17

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

fs/ext4/ext4_jbd2.h+0−5

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

fs/ext4/fast_commit.c+18−17

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

fs/ext4/file.c+5−2

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

fs/ext4/inode.c+5−1

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

fs/ext4/ioctl.c+3−0

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

fs/ext4/namei.c+17−10

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

fs/ext4/resize.c+16−4

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

fs/ext4/super.c+118−72

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

fs/ext4/xattr.c+4−1

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

fs/file.c+0−2

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

fs/io_uring.c+248−112

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

fs/namespace.c+5−2

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

fs/nfs/delegation.c+7−5

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

fs/nfs/internal.h+30−8

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

fs/nfs/nfs4proc.c+11−17

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

fs/nfs/nfs4super.c+2−2

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

fs/nfs/pnfs.c+35−32

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

fs/nfs/pnfs.h+3−5

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

fs/nfs/pnfs_nfs.c+10−12

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

fs/nfsd/nfs3xdr.c+6−1

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

fs/nfsd/nfs4proc.c+5−0

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

fs/nfsd/nfs4xdr.c+36−20

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

fs/nfsd/nfssvc.c+0−6

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

fs/nfsd/xdr4.h+0−1

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

fs/notify/fanotify/fanotify_user.c+7−10

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

fs/proc/task_mmu.c+30−23

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

fs/select.c+11−3

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

fs/zonefs/Kconfig+1−0

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

include/asm-generic/Kbuild+1−0

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

include/asm-generic/bitops/atomic.h+3−3

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

include/kvm/arm_pmu.h+1−1

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

include/linux/acpi.h+7−0

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

include/linux/blk-mq.h+2−2

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

include/linux/blkdev.h+13−5

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

include/linux/build_bug.h+0−5

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

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

This diff is large: its 11 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_attributes.h+6−0

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

include/linux/compiler_types.h+0−6

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

include/linux/console.h+0−3

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

include/linux/dm-bufio.h+1−0

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

include/linux/intel-iommu.h+12−6

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

include/linux/kasan.h+5−1

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

include/linux/kcov.h+21−0

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

include/linux/kdev_t.h+11−11

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

include/linux/memcontrol.h+1−1

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

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

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

include/linux/mm.h+10−2

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

include/linux/perf/arm_pmu.h+0−2

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

include/linux/rcupdate.h+6−0

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

include/linux/sizes.h+3−0

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

include/linux/skbuff.h+2−1

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

include/linux/syscalls.h+24−0

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

include/net/red.h+3−1

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

include/net/xdp_sock.h+0−4

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

include/net/xsk_buff_pool.h+5−0

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

include/soc/nps/common.h+0−172

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

include/soc/nps/mtm.h+0−59

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

include/trace/events/afs.h+2−0

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

include/trace/events/sunrpc.h+53−6

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

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

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

include/uapi/linux/if_link.h+3−2

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

include/uapi/linux/kvm.h+2−0

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

include/uapi/linux/netfilter/nf_tables.h+3−0

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

include/uapi/linux/ppp-ioctl.h+1−1

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

include/uapi/misc/habanalabs.h+5−0

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

include/xen/xenbus.h+1−1

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

init/main.c+3−8

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

kernel/bpf/hashtab.c+1−0

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

kernel/bpf/syscall.c+0−1

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

kernel/bpf/task_iter.c+9−8

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

kernel/cgroup/cgroup-v1.c+2−0

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

kernel/cgroup/cgroup.c+15−15

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

kernel/configs/android-recommended.config+0−1

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

kernel/exit.c+2−0

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

kernel/rcu/tasks.h+21−4

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

kernel/signal.c+3−0

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

kernel/trace/Kconfig+1−1

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

kernel/trace/trace_kprobe.c+1−1

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

kernel/workqueue.c+10−3

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

lib/Kconfig.debug+0−8

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

lib/fonts/font_ter16x32.c+3−3

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

lib/genalloc.c+13−12

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

lib/iov_iter.c+1−1

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

lib/raid6/Makefile+1−1

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

lib/zlib_dfltcc/Makefile+1−1

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

lib/zlib_dfltcc/dfltcc.c+5−1

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

lib/zlib_dfltcc/dfltcc_deflate.c+3−0

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

lib/zlib_dfltcc/dfltcc_inflate.c+2−2

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

lib/zlib_dfltcc/dfltcc_syms.c+0−17

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

mm/hugetlb.c+22−2

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

mm/kasan/generic.c+2−0

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

mm/kasan/init.c+2−1

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

mm/memory-failure.c+1−1

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

mm/memory.c+5−3

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

mm/memory_hotplug.c+1−1

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

mm/mempolicy.c+1−1

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

mm/mremap.c+3−1

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

mm/page-writeback.c+1−1

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

mm/page_alloc.c+21−18

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

mm/process_vm_access.c+1−0

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

mm/slub.c+3−4

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

mm/vmalloc.c+3−1

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

mm/vmscan.c+2−0

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

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

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

net/can/isotp.c+1−0

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

net/ceph/messenger_v2.c+12−3

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

net/core/dev.c+24−13

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

net/core/neighbour.c+2−4

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

net/core/net-sysfs.c+53−12

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

net/core/rtnetlink.c+6−17

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

net/core/skbuff.c+49−8

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

net/core/sock_reuseport.c+1−1

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

net/dcb/dcbnl.c+2−0

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

net/dsa/dsa2.c+4−0

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

net/dsa/master.c+10−0

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

net/ipv4/esp4.c+1−6

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

net/ipv4/fib_frontend.c+1−1

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

net/ipv4/gre_demux.c+1−1

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

net/ipv4/ip_output.c+1−1

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

net/ipv4/ip_tunnel.c+5−6

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

net/ipv4/netfilter/arp_tables.c+1−1

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

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

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

net/ipv4/nexthop.c+4−2

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

net/ipv6/esp6.c+1−6

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

net/ipv6/ip6_fib.c+2−3

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

net/ipv6/ip6_output.c+40−1

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

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

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

net/ipv6/sit.c+4−1

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

net/lapb/lapb_iface.c+1−0

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

net/mptcp/protocol.c+27−47

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

net/ncsi/ncsi-rsp.c+1−1

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

net/netfilter/ipset/ip_set_hash_gen.h+18−24

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

net/netfilter/nf_conntrack_standalone.c+3−0

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

net/netfilter/nf_nat_core.c+1−0

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

net/netfilter/nf_tables_api.c+7−3

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

net/netfilter/nft_dynset.c+10−5

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

net/netfilter/xt_RATEEST.c+3−0

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

net/packet/af_packet.c+3−1

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

net/qrtr/ns.c+4−3

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

net/qrtr/qrtr.c+11−5

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

net/qrtr/qrtr.h+1−1

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

net/rxrpc/input.c+1−1

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

net/rxrpc/key.c+4−2

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

net/sched/sch_choke.c+1−1

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

net/sched/sch_gred.c+1−1

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

net/sched/sch_red.c+1−1

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

net/sched/sch_sfq.c+1−1

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

net/sched/sch_taprio.c+4−3

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

net/smc/smc_core.c+13−7

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

net/smc/smc_ib.c+3−3

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

net/smc/smc_ism.c+2−1

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

net/sunrpc/addr.c+1−1

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

net/sunrpc/svc_xprt.c+2−2

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

net/sunrpc/svcsock.c+85−1

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

net/tipc/link.c+8−3

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

net/tipc/node.c+1−1

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

net/wireless/Kconfig+1−0

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

net/xdp/xsk.c+13−3

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

net/xdp/xsk_buff_pool.c+1−2

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

net/xdp/xsk_queue.h+5−0

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

scripts/checkpatch.pl+6−0

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

scripts/config+1−0

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

scripts/depmod.sh+2−0

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

scripts/gcc-plugins/Makefile+2−2

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

scripts/kconfig/Makefile+0−10

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

scripts/kconfig/mconf-cfg.sh+3−1

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

security/lsm_audit.c+5−2

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

sound/firewire/fireface/ff-transaction.c+1−1

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

sound/firewire/tascam/tascam-transaction.c+1−1

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

sound/pci/hda/hda_intel.c+6−5

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

sound/pci/hda/hda_tegra.c+1−1

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

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

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

sound/pci/hda/patch_hdmi.c+1−1

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

sound/pci/hda/patch_realtek.c+15−1

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

sound/pci/hda/patch_via.c+13−0

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

sound/soc/amd/raven/pci-acp3x.c+3−13

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

sound/soc/amd/renoir/rn-pci-acp3x.c+14−0

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

sound/soc/atmel/Kconfig+2−2

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

sound/soc/codecs/Kconfig+1−1

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

sound/soc/codecs/max98373-i2c.c+20−0

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

sound/soc/codecs/max98373-sdw.c+20−0

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

sound/soc/codecs/max98373.c+31−3

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

sound/soc/codecs/max98373.h+8−0

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

sound/soc/codecs/rt711.c+6−0

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

sound/soc/fsl/imx-hdmi.c+1−0

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

sound/soc/intel/boards/haswell.c+1−0

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

sound/soc/intel/skylake/cnl-sst.c+1−0

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

sound/soc/meson/axg-tdm-interface.c+13−1

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

sound/soc/meson/axg-tdmin.c+2−11

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

sound/soc/qcom/lpass-cpu.c+2−18

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

sound/soc/qcom/lpass-platform.c+35−15

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

sound/soc/sh/rcar/adg.c+10−8

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

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

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

sound/soc/sof/Kconfig+1−1

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

sound/usb/card.c+2−3

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

sound/usb/card.h+3−0

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

sound/usb/endpoint.c+72−12

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

sound/usb/endpoint.h+1−1

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

sound/usb/implicit.c+46−15

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

sound/usb/midi.c+4−0

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

sound/usb/quirks-table.h+6−0

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

sound/usb/quirks.c+46−12

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

sound/usb/usbaudio.h+1−0

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

tools/bootconfig/scripts/bconf2ftrace.sh+1−0

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

tools/bootconfig/scripts/ftrace2bconf.sh+4−0

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

tools/bpf/bpftool/net.c+0−1

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

tools/bpf/resolve_btfids/main.c+12−5

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

tools/include/linux/build_bug.h+0−5

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

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

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

tools/lib/perf/tests/test-cpumap.c+1−1

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

tools/lib/perf/tests/test-evlist.c+4−3

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

tools/lib/perf/tests/test-evsel.c+1−1

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

tools/lib/perf/tests/test-threadmap.c+1−1

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

tools/perf/examples/bpf/5sec.c+1−1

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

tools/perf/tests/shell/stat+shadow_stat.sh+14−16

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

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

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

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

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

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

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

tools/perf/util/stat-shadow.c+189−177

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

tools/testing/kunit/kunit_kernel.py+1−1

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

tools/testing/selftests/Makefile+4−2

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

tools/testing/selftests/arm64/fp/fpsimd-test.S+1−1

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

tools/testing/selftests/arm64/fp/sve-test.S+1−1

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

tools/testing/selftests/bpf/Makefile+3−0

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

tools/testing/selftests/bpf/progs/bprm_opts.c+1−1

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

tools/testing/selftests/bpf/test_maps.c+42−6

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

tools/testing/selftests/bpf/xdpxceiver.c+2−2

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

tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh+1−1

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

tools/testing/selftests/kvm/Makefile+1−1

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

tools/testing/selftests/kvm/demand_paging_test.c+32−86

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

tools/testing/selftests/kvm/dirty_log_perf_test.c+46−99

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

tools/testing/selftests/kvm/dirty_log_test.c+37−88

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

tools/testing/selftests/kvm/include/guest_modes.h+21−0

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

tools/testing/selftests/kvm/include/kvm_util.h+9−0

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

tools/testing/selftests/kvm/include/perf_test_util.h+12−155

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

tools/testing/selftests/kvm/lib/guest_modes.c+70−0

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

tools/testing/selftests/kvm/lib/kvm_util.c+1−8

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

tools/testing/selftests/kvm/lib/perf_test_util.c+134−0

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

tools/testing/selftests/net/fib_nexthops.sh+1−1

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

tools/testing/selftests/net/pmtu.sh+69−2

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

tools/testing/selftests/net/tls.c+2−2

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

tools/testing/selftests/net/udpgro.sh+34−0

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

tools/testing/selftests/netfilter/Makefile+2−1

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

tools/testing/selftests/netfilter/ipip-conntrack-mtu.sh+206−0

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

tools/testing/selftests/netfilter/nft_conntrack_helper.sh+9−3

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

tools/testing/selftests/vDSO/.gitignore+3−0

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

tools/testing/selftests/vDSO/vdso_test_correctness.c+1−1

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

tools/testing/selftests/vm/Makefile+5−5

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

tools/testing/selftests/wireguard/qemu/debug.config+0−1

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

virt/kvm/kvm_main.c+1−2

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