History

Merge tag 'v5.16-rc5' into rdma.git for-next

Required due to dependencies in following patches.

Jason Gunthorpe committed 4 years ago

Commit 4922f092 parents 2067909 2585cf91267 files · +14671 −9308Browse files

Unified · Split

1267 files
  1. .mailmap +5 −0
  2. Documentation/admin-guide/blockdev/drbd/figures.rst +2 −2
  3. Documentation/admin-guide/blockdev/drbd/peer-states-8.dot +0 −5
  4. Documentation/admin-guide/laptops/thinkpad-acpi.rst +6 −6
  5. Documentation/admin-guide/sysctl/kernel.rst +1 −1
  6. Documentation/arm/marvell.rst +24 −24
  7. Documentation/arm64/pointer-authentication.rst +4 −5
  8. Documentation/bpf/index.rst +1 −1
  9. Documentation/conf.py +10 −5
  10. Documentation/cpu-freq/core.rst +3 −3
  11. Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml +3 −2
  12. Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.yaml +1 −1
  13. Documentation/devicetree/bindings/input/gpio-keys.yaml +1 −1
  14. Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml +2 −12
  15. Documentation/devicetree/bindings/net/ethernet-phy.yaml +8 −0
  16. Documentation/devicetree/bindings/phy/xlnx,zynqmp-psgtr.yaml +1 −1
  17. Documentation/devicetree/bindings/power/supply/bq25980.yaml +1 −1
  18. Documentation/devicetree/bindings/sound/wlf,wm8962.yaml +3 −0
  19. Documentation/devicetree/bindings/spi/spi-rockchip.yaml +1 −0
  20. Documentation/doc-guide/sphinx.rst +9 −13
  21. Documentation/filesystems/autofs.rst +1 −1
  22. Documentation/filesystems/cifs/ksmbd.rst +5 −5
  23. Documentation/filesystems/netfs_library.rst +56 −39
  24. Documentation/i2c/smbus-protocol.rst +8 −6
  25. Documentation/locking/locktypes.rst +3 −6
  26. Documentation/networking/ipvs-sysctl.rst +1 −2
  27. Documentation/networking/timestamping.rst +2 −2
  28. Documentation/power/energy-model.rst +38 −15
  29. Documentation/process/changes.rst +12 −1
  30. Documentation/process/submitting-patches.rst +4 −3
  31. Documentation/trace/ftrace.rst +4 −5
  32. Documentation/translations/it_IT/doc-guide/sphinx.rst +9 −14
  33. Documentation/translations/it_IT/process/changes.rst +1 −1
  34. Documentation/translations/zh_CN/doc-guide/sphinx.rst +9 −12
  35. Documentation/translations/zh_CN/process/management-style.rst +2 −2
  36. MAINTAINERS +44 −15
  37. Makefile +8 −8
  38. arch/Kconfig +10 −0
  39. arch/alpha/kernel/syscalls/syscall.tbl +1 −0
  40. arch/arc/include/asm/cacheflush.h +0 −1
  41. arch/arm/Kconfig +1 −0
  42. arch/arm/boot/dts/bcm2711.dtsi +7 −1
  43. arch/arm/boot/dts/bcm5301x.dtsi +3 −1
  44. arch/arm/include/asm/cacheflush.h +0 −1
  45. arch/arm/mach-socfpga/core.h +1 −1
  46. arch/arm/mach-socfpga/platsmp.c +4 −4
  47. arch/arm64/boot/dts/apple/t8103.dtsi +4 −3
  48. arch/arm64/boot/dts/exynos/exynosautov9.dtsi +1 −2
  49. arch/arm64/include/asm/ftrace.h +11 −0
  50. arch/arm64/include/asm/kvm_arm.h +2 −2
  51. arch/arm64/include/asm/pgalloc.h +1 −1
  52. arch/arm64/include/asm/stacktrace.h +0 −6
  53. arch/arm64/include/asm/uaccess.h +41 −7
  54. arch/arm64/kernel/entry-ftrace.S +6 −0
  55. arch/arm64/kernel/ftrace.c +3 −3
  56. arch/arm64/kernel/machine_kexec.c +1 −1
  57. arch/arm64/kernel/stacktrace.c +8 −10
  58. arch/arm64/kvm/arm.c +8 −1
  59. arch/arm64/kvm/hyp/include/hyp/switch.h +14 −0
  60. arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h +6 −1
  61. arch/arm64/kvm/hyp/nvhe/switch.c +1 −7
  62. arch/arm64/kvm/hyp/vhe/switch.c +4 −0
  63. arch/csky/kernel/traps.c +2 −2
  64. arch/hexagon/include/asm/timer-regs.h +0 −26
  65. arch/hexagon/include/asm/timex.h +1 −2
  66. arch/hexagon/kernel/.gitignore +1 −0
  67. arch/hexagon/kernel/time.c +10 −2
  68. arch/hexagon/lib/io.c +4 −0
  69. arch/ia64/kernel/syscalls/syscall.tbl +1 −0
  70. arch/m68k/include/asm/cacheflush_mm.h +0 −1
  71. arch/m68k/kernel/syscalls/syscall.tbl +1 −0
  72. arch/m68k/kernel/traps.c +1 −1
  73. arch/microblaze/kernel/syscalls/syscall.tbl +1 −0
  74. arch/mips/Kconfig +1 −1
  75. arch/mips/bcm63xx/clk.c +6 −0
  76. arch/mips/boot/compressed/Makefile +1 −1
  77. arch/mips/generic/yamon-dt.c +1 −1
  78. arch/mips/include/asm/cacheflush.h +0 −2
  79. arch/mips/kernel/cpu-probe.c +2 −2
  80. arch/mips/kernel/proc.c +1 −1
  81. arch/mips/kernel/syscalls/syscall_n32.tbl +1 −0
  82. arch/mips/kernel/syscalls/syscall_n64.tbl +1 −0
  83. arch/mips/kernel/syscalls/syscall_o32.tbl +1 −0
  84. arch/mips/kvm/mips.c +1 −1
  85. arch/mips/lantiq/clk.c +6 −0
  86. arch/mips/net/bpf_jit_comp.h +1 −1
  87. arch/nds32/include/asm/cacheflush.h +0 −1
  88. arch/nios2/include/asm/cacheflush.h +0 −1
  89. arch/parisc/Makefile +5 −0
  90. arch/parisc/configs/generic-32bit_defconfig +1 −0
  91. arch/parisc/configs/generic-64bit_defconfig +13 −1
  92. arch/parisc/include/asm/assembly.h +35 −20
  93. arch/parisc/include/asm/cacheflush.h +0 −1
  94. arch/parisc/include/asm/jump_label.h +1 −0
  95. arch/parisc/include/asm/rt_sigframe.h +1 −1
  96. arch/parisc/install.sh +1 −0
  97. arch/parisc/kernel/entry.S +3 −11
  98. arch/parisc/kernel/signal.c +7 −6
  99. arch/parisc/kernel/signal32.h +1 −1
  100. arch/parisc/kernel/syscall.S +2 −2
  101. arch/parisc/kernel/syscalls/syscall.tbl +1 −0
  102. arch/parisc/kernel/time.c +8 −22
  103. arch/parisc/kernel/vmlinux.lds.S +1 −2
  104. arch/powerpc/kernel/Makefile +3 −0
  105. arch/powerpc/kernel/head_32.h +3 −3
  106. arch/powerpc/kernel/head_8xx.S +7 −6
  107. arch/powerpc/kernel/signal.h +8 −2
  108. arch/powerpc/kernel/signal_32.c +1 −1
  109. arch/powerpc/kernel/signal_64.c +2 −2
  110. arch/powerpc/kernel/syscalls/syscall.tbl +1 −0
  111. arch/powerpc/kernel/watchdog.c +6 −0
  112. arch/powerpc/kvm/book3s_hv_builtin.c +4 −1
  113. arch/powerpc/kvm/book3s_hv_rmhandlers.S +2 −2
  114. arch/powerpc/kvm/powerpc.c +2 −2
  115. arch/powerpc/mm/nohash/kaslr_booke.c +1 −1
  116. arch/powerpc/mm/nohash/tlb.c +2 −2
  117. arch/powerpc/mm/numa.c +20 −24
  118. arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +0 −1
  119. arch/powerpc/platforms/pseries/iommu.c +8 −18
  120. arch/powerpc/sysdev/xive/Kconfig +0 −1
  121. arch/powerpc/sysdev/xive/common.c +1 −2
  122. arch/riscv/Makefile +2 −0
  123. arch/riscv/configs/defconfig +2 −0
  124. arch/riscv/configs/rv32_defconfig +2 −0
  125. arch/riscv/include/asm/kvm_host.h +3 −5
  126. arch/riscv/kvm/mmu.c +6 −0
  127. arch/riscv/kvm/vcpu.c +1 −1
  128. arch/riscv/kvm/vcpu_sbi.c +1 −1
  129. arch/riscv/kvm/vm.c +1 −1
  130. arch/s390/Kconfig +2 −1
  131. arch/s390/Makefile +6 −4
  132. arch/s390/boot/startup.c +31 −57
  133. arch/s390/configs/debug_defconfig +8 −2
  134. arch/s390/configs/defconfig +6 −1
  135. arch/s390/configs/zfcpdump_defconfig +2 −0
  136. arch/s390/include/asm/kexec.h +6 −0
  137. arch/s390/include/asm/pci_io.h +4 −3
  138. arch/s390/kernel/crash_dump.c +2 −2
  139. arch/s390/kernel/ipl.c +2 −1
  140. arch/s390/kernel/machine_kexec_file.c +17 −1
  141. arch/s390/kernel/setup.c +5 −17
  142. arch/s390/kernel/syscalls/syscall.tbl +1 −0
  143. arch/s390/kernel/traps.c +1 −1
  144. arch/s390/kernel/vdso32/Makefile +1 −1
  145. arch/s390/kernel/vdso64/Makefile +4 −3
  146. arch/s390/kvm/kvm-s390.c +2 −0
  147. arch/s390/lib/test_unwind.c +3 −2
  148. arch/sh/include/asm/cacheflush.h +0 −1
  149. arch/sh/kernel/syscalls/syscall.tbl +1 −0
  150. arch/sparc/kernel/signal_32.c +2 −2
  151. arch/sparc/kernel/syscalls/syscall.tbl +1 −0
  152. arch/sparc/kernel/windows.c +1 −1
  153. arch/x86/Kconfig +2 −1
  154. arch/x86/entry/entry_64.S +17 −18
  155. arch/x86/entry/vsyscall/vsyscall_64.c +1 −1
  156. arch/x86/events/intel/core.c +0 −2
  157. arch/x86/events/intel/uncore_snbep.c +12 −0
  158. arch/x86/hyperv/hv_init.c +4 −8
  159. arch/x86/include/asm/fpu/api.h +0 −6
  160. arch/x86/include/asm/intel-family.h +1 −1
  161. arch/x86/include/asm/kvm_host.h +3 −1
  162. arch/x86/include/asm/sev-common.h +11 −0
  163. arch/x86/include/asm/xen/hypercall.h +2 −2
  164. arch/x86/include/asm/xen/hypervisor.h +1 −0
  165. arch/x86/kernel/cpu/mshyperv.c +15 −5
  166. arch/x86/kernel/cpu/sgx/main.c +6 −6
  167. arch/x86/kernel/fpu/signal.c +1 −1
  168. arch/x86/kernel/process.c +5 −0
  169. arch/x86/kernel/setup.c +39 −27
  170. arch/x86/kernel/sev.c +39 −18
  171. arch/x86/kernel/smpboot.c +14 −0
  172. arch/x86/kernel/tsc.c +24 −4
  173. arch/x86/kernel/tsc_sync.c +41 −0
  174. arch/x86/kernel/vm86_32.c +1 −1
  175. arch/x86/kvm/cpuid.c +1 −1
  176. arch/x86/kvm/hyperv.c +7 −4
  177. arch/x86/kvm/ioapic.h +0 −1
  178. arch/x86/kvm/irq.h +0 −1
  179. arch/x86/kvm/lapic.c +1 −1
  180. arch/x86/kvm/mmu/mmu.c +74 −47
  181. arch/x86/kvm/mmu/paging_tmpl.h +2 −1
  182. arch/x86/kvm/mmu/tdp_mmu.c +14 −24
  183. arch/x86/kvm/mmu/tdp_mmu.h +2 −3
  184. arch/x86/kvm/svm/avic.c +10 −7
  185. arch/x86/kvm/svm/pmu.c +1 −1
  186. arch/x86/kvm/svm/sev.c +151 −118
  187. arch/x86/kvm/svm/svm.c +0 −1
  188. arch/x86/kvm/svm/svm.h +2 −1
  189. arch/x86/kvm/vmx/nested.c +87 −60
  190. arch/x86/kvm/vmx/posted_intr.c +11 −9
  191. arch/x86/kvm/vmx/vmx.c +55 −34
  192. arch/x86/kvm/vmx/vmx.h +10 −0
  193. arch/x86/kvm/x86.c +78 −27
  194. arch/x86/kvm/x86.h +13 −6
  195. arch/x86/kvm/xen.c +11 −11
  196. arch/x86/platform/efi/quirks.c +2 −1
  197. arch/x86/realmode/init.c +11 −1
  198. arch/x86/xen/xen-asm.S +20 −0
  199. arch/xtensa/include/asm/cacheflush.h +0 −3
  200. arch/xtensa/kernel/syscalls/syscall.tbl +1 −0
  201. block/bdev.c +7 −5
  202. block/blk-cgroup.c +5 −4
  203. block/blk-core.c +4 −1
  204. block/blk-flush.c +6 −6
  205. block/blk-mq.c +26 −10
  206. block/blk-mq.h +2 −0
  207. block/blk-sysfs.c +0 −10
  208. block/blk.h +1 −1
  209. block/elevator.c +8 −2
  210. block/fops.c +2 −2
  211. block/genhd.c +2 −0
  212. block/ioprio.c +11 −1
  213. drivers/acpi/cppc_acpi.c +8 −1
  214. drivers/acpi/glue.c +0 −25
  215. drivers/acpi/internal.h +0 −1
  216. drivers/acpi/property.c +5 −9
  217. drivers/acpi/scan.c +0 −6
  218. drivers/android/binder.c +10 −13
  219. drivers/ata/ahci.c +1 −0
  220. drivers/ata/ahci_ceva.c +2 −1
  221. drivers/ata/libahci.c +15 −0
  222. drivers/ata/libata-core.c +10 −3
  223. drivers/ata/libata-sata.c +2 −2
  224. drivers/ata/pata_falcon.c +8 −8
  225. drivers/ata/sata_fsl.c +13 −7
  226. drivers/block/loop.c +1 −1
  227. drivers/block/virtio_blk.c +1 −2
  228. drivers/block/zram/zram_drv.c +2 −0
  229. drivers/bus/mhi/core/pm.c +18 −3
  230. drivers/bus/mhi/pci_generic.c +1 −1
  231. drivers/char/agp/parisc-agp.c +3 −3
  232. drivers/char/ipmi/ipmi_msghandler.c +33 −8
  233. drivers/clk/imx/clk-imx8qxp-lpcg.c +1 −1
  234. drivers/clk/imx/clk-imx8qxp.c +1 −1
  235. drivers/clk/qcom/clk-alpha-pll.c +9 −0
  236. drivers/clk/qcom/clk-regmap-mux.c +1 −1
  237. drivers/clk/qcom/common.c +12 −0
  238. drivers/clk/qcom/common.h +2 −0
  239. drivers/clk/qcom/gcc-sm6125.c +2 −2
  240. drivers/clk/versatile/clk-icst.c +1 −1
  241. drivers/clocksource/arm_arch_timer.c +7 −2
  242. drivers/clocksource/dw_apb_timer_of.c +1 −1
  243. drivers/cpufreq/cpufreq.c +7 −7
  244. drivers/cpufreq/intel_pstate.c +17 −0
  245. drivers/dma-buf/heaps/system_heap.c +1 −1
  246. drivers/firmware/arm_scmi/base.c +12 −3
  247. drivers/firmware/arm_scmi/scmi_pm_domain.c +1 −3
  248. drivers/firmware/arm_scmi/sensors.c +1 −1
  249. drivers/firmware/arm_scmi/virtio.c +5 −5
  250. drivers/firmware/arm_scmi/voltage.c +1 −1
  251. drivers/firmware/smccc/soc_id.c +1 −1
  252. drivers/gpio/Kconfig +1 −0
  253. drivers/gpio/gpio-virtio.c +1 −1
  254. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +5 −9
  255. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +12 −0
  256. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h +2 −0
  257. drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 −0
  258. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +11 −5
  259. drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +45 −6
  260. drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +2 −1
  261. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1 −0
  262. drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 −2
  263. drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +1 −0
  264. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +13 −2
  265. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +39 −14
  266. drivers/gpu/drm/amd/amdgpu/navi10_ih.c +13 −21
  267. drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +4 −0
  268. drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +4 −0
  269. drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c +3 −1
  270. drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c +4 −0
  271. drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +6 −1
  272. drivers/gpu/drm/amd/amdgpu/nv.c +6 −3
  273. drivers/gpu/drm/amd/amdgpu/soc15.c +5 −3
  274. drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 −0
  275. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 −1
  276. drivers/gpu/drm/amd/amdkfd/kfd_svm.c +73 −51
  277. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +29 −3
  278. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +8 −0
  279. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +16 −4
  280. drivers/gpu/drm/amd/display/dc/core/dc_link.c +16 −0
  281. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 −1
  282. drivers/gpu/drm/amd/display/dc/core/dc_resource.c +14 −10
  283. drivers/gpu/drm/amd/display/dc/dc.h +2 −1
  284. drivers/gpu/drm/amd/display/dc/dc_link.h +4 −0
  285. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 −1
  286. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 −1
  287. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +1 −1
  288. drivers/gpu/drm/amd/include/amd_shared.h +2 −1
  289. drivers/gpu/drm/amd/pm/amdgpu_dpm.c +10 −0
  290. drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +8 −0
  291. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +9 −11
  292. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +11 −13
  293. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +2 −4
  294. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +13 −15
  295. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +4 −6
  296. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +28 −30
  297. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 −1
  298. drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c +20 −2
  299. drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +8 −5
  300. drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +26 −0
  301. drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +27 −0
  302. drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.h +1 −0
  303. drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +6 −2
  304. drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1 −1
  305. drivers/gpu/drm/drm_gem_cma_helper.c +7 −2
  306. drivers/gpu/drm/drm_gem_shmem_helper.c +1 −0
  307. drivers/gpu/drm/drm_syncobj.c +10 −1
  308. drivers/gpu/drm/hyperv/hyperv_drm_drv.c +18 −1
  309. drivers/gpu/drm/i915/display/icl_dsi.c +4 −9
  310. drivers/gpu/drm/i915/display/intel_display_types.h +3 −0
  311. drivers/gpu/drm/i915/display/intel_dp.c +11 −0
  312. drivers/gpu/drm/i915/display/intel_dp.h +2 −0
  313. drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +26 −6
  314. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +1 −0
  315. drivers/gpu/drm/i915/gt/intel_gt_pm.c +4 −3
  316. drivers/gpu/drm/i915/gt/intel_gtt.c +1 −0
  317. drivers/gpu/drm/i915/gt/intel_workarounds.c +9 −16
  318. drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +2 −2
  319. drivers/gpu/drm/i915/i915_reg.h +3 −1
  320. drivers/gpu/drm/i915/i915_request.c +1 −0
  321. drivers/gpu/drm/i915/pxp/intel_pxp_pm.c +26 −11
  322. drivers/gpu/drm/i915/pxp/intel_pxp_pm.h +16 −3
  323. drivers/gpu/drm/lima/lima_device.c +1 −0
  324. drivers/gpu/drm/msm/Kconfig +1 −1
  325. drivers/gpu/drm/msm/Makefile +3 −3
  326. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +10 −10
  327. drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +2 −2
  328. drivers/gpu/drm/msm/dp/dp_aux.c +17 −0
  329. drivers/gpu/drm/msm/dsi/dsi_host.c +2 −0
  330. drivers/gpu/drm/msm/msm_debugfs.c +1 −0
  331. drivers/gpu/drm/msm/msm_drv.c +32 −17
  332. drivers/gpu/drm/msm/msm_gem.c +2 −3
  333. drivers/gpu/drm/msm/msm_gem_shrinker.c +1 −0
  334. drivers/gpu/drm/msm/msm_gem_submit.c +2 −0
  335. drivers/gpu/drm/msm/msm_gpu.h +3 −0
  336. drivers/gpu/drm/msm/msm_gpu_devfreq.c +9 −4
  337. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +22 −0
  338. drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmigv100.c +0 −1
  339. drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c +4 −2
  340. drivers/gpu/drm/nouveau/nvkm/subdev/acr/gp102.c +4 −2
  341. drivers/gpu/drm/scheduler/sched_main.c +5 −1
  342. drivers/gpu/drm/sun4i/Kconfig +1 −0
  343. drivers/gpu/drm/ttm/ttm_bo.c +2 −1
  344. drivers/gpu/drm/ttm/ttm_tt.c +1 −0
  345. drivers/gpu/drm/vc4/vc4_bo.c +1 −1
  346. drivers/gpu/drm/vc4/vc4_kms.c +18 −22
  347. drivers/gpu/drm/virtio/virtgpu_drv.c +1 −41
  348. drivers/gpu/drm/virtio/virtgpu_drv.h +0 −1
  349. drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 −1
  350. drivers/gpu/drm/xen/xen_drm_front.c +1 −0
  351. drivers/hid/Kconfig +5 −5
  352. drivers/hid/hid-asus.c +3 −5
  353. drivers/hid/hid-bigbenff.c +1 −1
  354. drivers/hid/hid-chicony.c +3 −0
  355. drivers/hid/hid-corsair.c +6 −1
  356. drivers/hid/hid-elan.c +1 −1
  357. drivers/hid/hid-elo.c +3 −0
  358. drivers/hid/hid-ft260.c +8 −6
  359. drivers/hid/hid-google-hammer.c +2 −0
  360. drivers/hid/hid-holtek-kbd.c +7 −2
  361. drivers/hid/hid-holtek-mouse.c +9 −0
  362. drivers/hid/hid-ids.h +4 −0
  363. drivers/hid/hid-input.c +7 −3
  364. drivers/hid/hid-lg.c +8 −2
  365. drivers/hid/hid-logitech-dj.c +1 −1
  366. drivers/hid/hid-magicmouse.c +5 −2
  367. drivers/hid/hid-multitouch.c +5 −0
  368. drivers/hid/hid-nintendo.c +9 −4
  369. drivers/hid/hid-prodikeys.c +8 −2
  370. drivers/hid/hid-quirks.c +1 −0
  371. drivers/hid/hid-roccat-arvo.c +3 −0
  372. drivers/hid/hid-roccat-isku.c +3 −0
  373. drivers/hid/hid-roccat-kone.c +3 −0
  374. drivers/hid/hid-roccat-koneplus.c +3 −0
  375. drivers/hid/hid-roccat-konepure.c +3 −0
  376. drivers/hid/hid-roccat-kovaplus.c +3 −0
  377. drivers/hid/hid-roccat-lua.c +3 −0
  378. drivers/hid/hid-roccat-pyra.c +3 −0
  379. drivers/hid/hid-roccat-ryos.c +3 −0
  380. drivers/hid/hid-roccat-savu.c +3 −0
  381. drivers/hid/hid-samsung.c +3 −0
  382. drivers/hid/hid-sony.c +18 −6
  383. drivers/hid/hid-thrustmaster.c +6 −3
  384. drivers/hid/hid-u2fzero.c +1 −1
  385. drivers/hid/hid-uclogic-core.c +3 −0
  386. drivers/hid/hid-uclogic-params.c +1 −2
  387. drivers/hid/intel-ish-hid/ipc/pci-ish.c +4 −2
  388. drivers/hid/intel-ish-hid/ishtp-fw-loader.c +8 −6
  389. drivers/hid/intel-ish-hid/ishtp-hid-client.c +8 −6
  390. drivers/hid/intel-ish-hid/ishtp/bus.c +3 −3
  391. drivers/hid/wacom_sys.c +13 −6
  392. drivers/hid/wacom_wac.c +7 −1
  393. drivers/hid/wacom_wac.h +1 −0
  394. drivers/hv/hv_balloon.c +1 −1
  395. drivers/hwmon/corsair-psu.c +1 −1
  396. drivers/hwmon/dell-smm-hwmon.c +3 −4
  397. drivers/hwmon/nct6775.c +1 −1
  398. drivers/hwmon/pwm-fan.c +0 −2
  399. drivers/hwmon/sht4x.c +2 −2
  400. drivers/i2c/busses/i2c-cbus-gpio.c +3 −2
  401. drivers/i2c/busses/i2c-i801.c +25 −7
  402. drivers/i2c/busses/i2c-mpc.c +1 −1
  403. drivers/i2c/busses/i2c-rk3x.c +2 −2
  404. drivers/i2c/busses/i2c-stm32f7.c +38 −7
  405. drivers/i2c/busses/i2c-virtio.c +16 −28
  406. drivers/iio/accel/kxcjk-1013.c +2 −3
  407. drivers/iio/accel/kxsd9.c +3 −3
  408. drivers/iio/accel/mma8452.c +1 −1
  409. drivers/iio/adc/Kconfig +1 −1
  410. drivers/iio/adc/ad7768-1.c +1 −1
  411. drivers/iio/adc/at91-sama5d2_adc.c +2 −1
  412. drivers/iio/adc/axp20x_adc.c +3 −15
  413. drivers/iio/adc/dln2-adc.c +12 −9
  414. drivers/iio/adc/stm32-adc.c +2 −1
  415. drivers/iio/gyro/adxrs290.c +3 −2
  416. drivers/iio/gyro/itg3200_buffer.c +1 −1
  417. drivers/iio/industrialio-trigger.c +0 −1
  418. drivers/iio/light/ltr501.c +1 −1
  419. drivers/iio/light/stk3310.c +3 −3
  420. drivers/iio/trigger/stm32-timer-trigger.c +1 −1
  421. drivers/infiniband/core/nldev.c +2 −1
  422. drivers/infiniband/core/verbs.c +3 −0
  423. drivers/infiniband/hw/hfi1/chip.c +2 −0
  424. drivers/infiniband/hw/hfi1/driver.c +2 −0
  425. drivers/infiniband/hw/hfi1/init.c +17 −23
  426. drivers/infiniband/hw/hfi1/sdma.c +1 −1
  427. drivers/infiniband/hw/hfi1/verbs.c +2 −3
  428. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +11 −3
  429. drivers/infiniband/hw/irdma/hw.c +6 −1
  430. drivers/infiniband/hw/irdma/main.h +1 −0
  431. drivers/infiniband/hw/irdma/pble.c +3 −5
  432. drivers/infiniband/hw/irdma/pble.h +0 −1
  433. drivers/infiniband/hw/irdma/utils.c +17 −7
  434. drivers/infiniband/hw/irdma/verbs.c +18 −5
  435. drivers/infiniband/hw/irdma/verbs.h +2 −0
  436. drivers/infiniband/hw/mlx4/main.c +15 −3
  437. drivers/infiniband/hw/mlx5/mlx5_ib.h +3 −3
  438. drivers/infiniband/hw/mlx5/mr.c +12 −14
  439. drivers/infiniband/sw/rxe/rxe_qp.c +1 −0
  440. drivers/infiniband/ulp/rtrs/rtrs-clt-stats.c +6 −3
  441. drivers/input/misc/xen-kbdfront.c +1 −0
  442. drivers/iommu/amd/iommu_v2.c +3 −3
  443. drivers/iommu/intel/cap_audit.c +3 −2
  444. drivers/iommu/intel/iommu.c +2 −4
  445. drivers/iommu/rockchip-iommu.c +2 −2
  446. drivers/irqchip/irq-apple-aic.c +1 −1
  447. drivers/irqchip/irq-armada-370-xp.c +6 −10
  448. drivers/irqchip/irq-aspeed-scu-ic.c +2 −2
  449. drivers/irqchip/irq-bcm7120-l2.c +1 −0
  450. drivers/irqchip/irq-gic-v3-its.c +1 −1
  451. drivers/irqchip/irq-mips-gic.c +2 −2
  452. drivers/irqchip/irq-nvic.c +1 −1
  453. drivers/md/md.c +3 −1
  454. drivers/media/cec/core/cec-adap.c +1 −0
  455. drivers/media/common/videobuf2/videobuf2-dma-sg.c +2 −0
  456. drivers/media/i2c/hi846.c +2 −2
  457. drivers/media/v4l2-core/v4l2-compat-ioctl32.c +17 −24
  458. drivers/memory/mtk-smi.c +1 −1
  459. drivers/misc/cardreader/rtsx_pcr.c +0 −4
  460. drivers/misc/eeprom/at25.c +18 −20
  461. drivers/misc/fastrpc.c +6 −4
  462. drivers/mmc/host/mmc_spi.c +7 −0
  463. drivers/mmc/host/mtk-sd.c +3 −1
  464. drivers/mmc/host/renesas_sdhi_core.c +1 −1
  465. drivers/mmc/host/sdhci-esdhc-imx.c +0 −2
  466. drivers/mmc/host/sdhci.c +18 −3
  467. drivers/mmc/host/sdhci.h +3 −1
  468. drivers/mtd/devices/mtd_dataflash.c +8 −0
  469. drivers/mtd/nand/raw/Kconfig +1 −1
  470. drivers/mtd/nand/raw/fsmc_nand.c +28 −8
  471. drivers/mtd/nand/raw/nand_base.c +3 −3
  472. drivers/net/Kconfig +1 −3
  473. drivers/net/amt.c +1 −1
  474. drivers/net/bonding/bond_alb.c +8 −6
  475. drivers/net/can/kvaser_pciefd.c +7 −1
  476. drivers/net/can/m_can/m_can.c +27 −15
  477. drivers/net/can/m_can/m_can.h +3 −0
  478. drivers/net/can/m_can/m_can_pci.c +56 −6
  479. drivers/net/can/pch_can.c +1 −1
  480. drivers/net/can/sja1000/ems_pcmcia.c +6 −1
  481. drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +73 −28
  482. drivers/net/dsa/b53/b53_spi.c +14 −0
  483. drivers/net/dsa/microchip/ksz8795.c +7 −49
  484. drivers/net/dsa/microchip/ksz9477.c +8 −58
  485. drivers/net/dsa/microchip/ksz_common.c +28 −22
  486. drivers/net/dsa/microchip/ksz_common.h +0 −4
  487. drivers/net/dsa/mv88e6xxx/chip.c +47 −38
  488. drivers/net/dsa/mv88e6xxx/serdes.c +227 −33
  489. drivers/net/dsa/mv88e6xxx/serdes.h +4 −0
  490. drivers/net/dsa/ocelot/felix.c +4 −1
  491. drivers/net/dsa/qca8k.c +11 −7
  492. drivers/net/dsa/rtl8365mb.c +8 −1
  493. drivers/net/ethernet/altera/altera_tse_main.c +6 −3
  494. drivers/net/ethernet/aquantia/atlantic/aq_common.h +14 −13
  495. drivers/net/ethernet/aquantia/atlantic/aq_hw.h +2 −0
  496. drivers/net/ethernet/aquantia/atlantic/aq_nic.c +22 −12
  497. drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +6 −1
  498. drivers/net/ethernet/aquantia/atlantic/aq_ring.c +2 −1
  499. drivers/net/ethernet/aquantia/atlantic/aq_vec.c +0 −3
  500. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c +23 −2
  501. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c +0 −3
  502. drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c +18 −4
  503. drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.h +2 −0
  504. drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils.h +34 −4
  505. drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c +87 −23
  506. drivers/net/ethernet/asix/ax88796c_main.h +3 −3
  507. drivers/net/ethernet/asix/ax88796c_spi.c +1 −1
  508. drivers/net/ethernet/broadcom/bcm4908_enet.c +3 −1
  509. drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h +3 −1
  510. drivers/net/ethernet/broadcom/bnxt/bnxt.h +10 −0
  511. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +5 −4
  512. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +1 −1
  513. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 −0
  514. drivers/net/ethernet/dec/tulip/de4x5.c +21 −13
  515. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +3 −1
  516. drivers/net/ethernet/freescale/fec.h +3 −0
  517. drivers/net/ethernet/freescale/fec_main.c +1 −1
  518. drivers/net/ethernet/google/gve/gve_utils.c +3 −0
  519. drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c +4 −0
  520. drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +7 −1
  521. drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +4 −0
  522. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +2 −2
  523. drivers/net/ethernet/huawei/hinic/hinic_sriov.c +1 −0
  524. drivers/net/ethernet/ibm/ibmvnic.c +6 −22
  525. drivers/net/ethernet/intel/e100.c +13 −5
  526. drivers/net/ethernet/intel/i40e/i40e.h +2 −0
  527. drivers/net/ethernet/intel/i40e/i40e_debugfs.c +8 −0
  528. drivers/net/ethernet/intel/i40e/i40e_main.c +104 −56
  529. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +89 −107
  530. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +2 −0
  531. drivers/net/ethernet/intel/iavf/iavf.h +4 −0
  532. drivers/net/ethernet/intel/iavf/iavf_ethtool.c +83 −23
  533. drivers/net/ethernet/intel/iavf/iavf_main.c +69 −27
  534. drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +44 −3
  535. drivers/net/ethernet/intel/ice/ice_dcb_nl.c +12 −6
  536. drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c +2 −2
  537. drivers/net/ethernet/intel/ice/ice_fdir.c +1 −1
  538. drivers/net/ethernet/intel/ice/ice_flex_pipe.c +5 −2
  539. drivers/net/ethernet/intel/ice/ice_flex_pipe.h +2 −1
  540. drivers/net/ethernet/intel/ice/ice_lib.c +7 −2
  541. drivers/net/ethernet/intel/ice/ice_main.c +38 −12
  542. drivers/net/ethernet/intel/ice/ice_switch.c +13 −6
  543. drivers/net/ethernet/intel/ice/ice_tc_lib.c +12 −18
  544. drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +6 −0
  545. drivers/net/ethernet/intel/ice/ice_xsk.c +1 −0
  546. drivers/net/ethernet/intel/igb/igb_main.c +1 −1
  547. drivers/net/ethernet/lantiq_etop.c +17 −3
  548. drivers/net/ethernet/marvell/mvmdio.c +2 −0
  549. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +11 −9
  550. drivers/net/ethernet/marvell/octeontx2/af/rvu.c +1 −1
  551. drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +10 −7
  552. drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +2 −0
  553. drivers/net/ethernet/marvell/prestera/prestera_switchdev.c +3 −5
  554. drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +3 −3
  555. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +7 −2
  556. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +3 −3
  557. drivers/net/ethernet/mellanox/mlx5/core/cq.c +3 −2
  558. drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +3 −1
  559. drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c +40 −1
  560. drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h +3 −3
  561. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +17 −9
  562. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h +2 −0
  563. drivers/net/ethernet/mellanox/mlx5/core/en/tc_priv.h +1 −0
  564. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +7 −1
  565. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c +1 −1
  566. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c +18 −29
  567. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +4 −0
  568. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +3 −5
  569. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +8 −2
  570. drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +2 −2
  571. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +17 −4
  572. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +17 −12
  573. drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c +1 −1
  574. drivers/net/ethernet/mellanox/mlx5/core/health.c +3 −2
  575. drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +13 −15
  576. drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c +1 −0
  577. drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c +2 −3
  578. drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h +1 −0
  579. drivers/net/ethernet/mellanox/mlx5/core/main.c +15 −15
  580. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c +23 −33
  581. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c +6 −5
  582. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h +1 −0
  583. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +5 −5
  584. drivers/net/ethernet/microchip/lan743x_main.c +3 −9
  585. drivers/net/ethernet/microsoft/mana/hw_channel.c +5 −5
  586. drivers/net/ethernet/mscc/ocelot.c +246 −8
  587. drivers/net/ethernet/mscc/ocelot_vcap.c +16 −0
  588. drivers/net/ethernet/natsemi/xtsonic.c +1 −1
  589. drivers/net/ethernet/netronome/nfp/nfp_net.h +0 −3
  590. drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +1 −1
  591. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c +3 −1
  592. drivers/net/ethernet/ni/nixge.c +2 −2
  593. drivers/net/ethernet/qlogic/qed/qed_int.c +3 −3
  594. drivers/net/ethernet/qlogic/qede/qede_fp.c +7 −0
  595. drivers/net/ethernet/qlogic/qla3xxx.c +9 −10
  596. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +8 −2
  597. drivers/net/ethernet/realtek/r8169_main.c +3 −2
  598. drivers/net/ethernet/sis/sis900.c +1 −1
  599. drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +22 −2
  600. drivers/net/ethernet/stmicro/stmmac/stmmac.h +1 −0
  601. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +102 −68
  602. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +1 −1
  603. drivers/net/hamradio/6pack.c +0 −1
  604. drivers/net/hamradio/mkiss.c +2 −0
  605. drivers/net/ipa/ipa_cmd.c +0 −16
  606. drivers/net/ipa/ipa_cmd.h +0 −6
  607. drivers/net/ipa/ipa_endpoint.c +5 −2
  608. drivers/net/ipa/ipa_main.c +6 −0
  609. drivers/net/ipa/ipa_modem.c +3 −3
  610. drivers/net/ipa/ipa_resource.c +1 −1
  611. drivers/net/ipa/ipa_smp2p.c +10 −11
  612. drivers/net/ipa/ipa_smp2p.h +3 −4
  613. drivers/net/mdio/mdio-aspeed.c +7 −0
  614. drivers/net/phy/phylink.c +26 −1
  615. drivers/net/slip/slip.h +2 −0
  616. drivers/net/tun.c +5 −0
  617. drivers/net/usb/cdc_ncm.c +2 −0
  618. drivers/net/usb/lan78xx.c +1 −1
  619. drivers/net/usb/r8152.c +3 −6
  620. drivers/net/usb/smsc95xx.c +26 −29
  621. drivers/net/virtio_net.c +0 −1
  622. drivers/net/vmxnet3/vmxnet3_drv.c +7 −6
  623. drivers/net/vrf.c +6 −4
  624. drivers/net/wireguard/allowedips.c +1 −1
  625. drivers/net/wireguard/device.c +21 −18
  626. drivers/net/wireguard/device.h +3 −6
  627. drivers/net/wireguard/main.c +4 −4
  628. drivers/net/wireguard/queueing.c +3 −3
  629. drivers/net/wireguard/queueing.h +1 −1
  630. drivers/net/wireguard/ratelimiter.c +2 −2
  631. drivers/net/wireguard/receive.c +23 −16
  632. drivers/net/wireguard/socket.c +1 −1
  633. drivers/net/wireless/ath/ath11k/mhi.c +5 −1
  634. drivers/net/wireless/intel/iwlwifi/fw/uefi.c +6 −0
  635. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +15 −7
  636. drivers/net/wireless/intel/iwlwifi/iwl-drv.h +3 −0
  637. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +23 −1
  638. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 −0
  639. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +5 −0
  640. drivers/net/wireless/intel/iwlwifi/pcie/drv.c +8 −2
  641. drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c +1 −2
  642. drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c +15 −13
  643. drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c +7 −1
  644. drivers/net/wireless/mediatek/mt76/mt7915/mac.c +7 −8
  645. drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +2 −2
  646. drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c +12 −9
  647. drivers/net/wireless/mediatek/mt76/tx.c +1 −1
  648. drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +3 −0
  649. drivers/net/wireless/realtek/rtw89/fw.c +1 −1
  650. drivers/net/wireless/realtek/rtw89/fw.h +4 −2
  651. drivers/net/wwan/iosm/iosm_ipc_imem.c +17 −9
  652. drivers/net/wwan/iosm/iosm_ipc_imem.h +1 −3
  653. drivers/net/wwan/iosm/iosm_ipc_imem_ops.c +1 −6
  654. drivers/nfc/virtual_ncidev.c +1 −1
  655. drivers/nvme/host/core.c +44 −8
  656. drivers/nvme/host/fabrics.c +3 −0
  657. drivers/nvme/host/multipath.c +2 −1
  658. drivers/nvme/host/nvme.h +1 −1
  659. drivers/nvme/host/tcp.c +30 −31
  660. drivers/nvme/host/zns.c +4 −1
  661. drivers/nvme/target/io-cmd-file.c +3 −1
  662. drivers/nvme/target/tcp.c +40 −13
  663. drivers/of/irq.c +25 −2
  664. drivers/pci/controller/dwc/pci-exynos.c +1 −0
  665. drivers/pci/controller/dwc/pcie-qcom-ep.c +1 −0
  666. drivers/pci/controller/pci-aardvark.c +0 −9
  667. drivers/pci/controller/pcie-apple.c +12 −2
  668. drivers/phy/hisilicon/phy-hi3670-pcie.c +2 −2
  669. drivers/phy/marvell/phy-mvebu-cp110-utmi.c +2 −2
  670. drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c +14 −12
  671. drivers/phy/qualcomm/phy-qcom-qmp.c +3 −0
  672. drivers/phy/qualcomm/phy-qcom-usb-hsic.c +1 −1
  673. drivers/phy/st/phy-stm32-usbphyc.c +1 −1
  674. drivers/phy/ti/phy-am654-serdes.c +1 −1
  675. drivers/phy/ti/phy-j721e-wiz.c +1 −1
  676. drivers/phy/ti/phy-omap-usb2.c +3 −3
  677. drivers/phy/ti/phy-tusb1210.c +1 −1
  678. drivers/pinctrl/pinctrl-amd.c +26 −3
  679. drivers/pinctrl/pinctrl-apple-gpio.c +6 −6
  680. drivers/pinctrl/qcom/Kconfig +2 −0
  681. drivers/pinctrl/qcom/pinctrl-sdm845.c +1 −0
  682. drivers/pinctrl/qcom/pinctrl-sm8350.c +4 −4
  683. drivers/pinctrl/ralink/pinctrl-mt7620.c +1 −0
  684. drivers/pinctrl/tegra/pinctrl-tegra.c +2 −2
  685. drivers/pinctrl/tegra/pinctrl-tegra194.c +0 −1
  686. drivers/platform/chrome/cros_ec_ishtp.c +8 −6
  687. drivers/platform/mellanox/mlxreg-lc.c +3 −2
  688. drivers/platform/x86/Kconfig +1 −1
  689. drivers/platform/x86/amd-pmc.c +1 −1
  690. drivers/platform/x86/dell/Kconfig +1 −1
  691. drivers/platform/x86/hp_accel.c +2 −0
  692. drivers/platform/x86/intel/hid.c +7 −0
  693. drivers/platform/x86/intel/ishtp_eclite.c +8 −6
  694. drivers/platform/x86/lg-laptop.c +12 −0
  695. drivers/platform/x86/samsung-laptop.c +1 −1
  696. drivers/platform/x86/think-lmi.c +10 −3
  697. drivers/platform/x86/think-lmi.h +0 −1
  698. drivers/platform/x86/thinkpad_acpi.c +5 −14
  699. drivers/platform/x86/touchscreen_dmi.c +18 −0
  700. drivers/powercap/dtpm.c +0 −5
  701. drivers/powercap/dtpm_cpu.c +3 −6
  702. drivers/ptp/ptp_clockmatrix.c +1 −4
  703. drivers/ptp/ptp_ocp.c +5 −4
  704. drivers/s390/block/dasd_devmap.c +38 −38
  705. drivers/s390/char/raw3270.c +6 −6
  706. drivers/s390/cio/chp.c +1 −1
  707. drivers/scsi/lpfc/lpfc_els.c +2 −7
  708. drivers/scsi/mpt3sas/mpt3sas_base.c +2 −2
  709. drivers/scsi/mpt3sas/mpt3sas_base.h +4 −0
  710. drivers/scsi/mpt3sas/mpt3sas_scsih.c +57 −2
  711. drivers/scsi/pm8001/pm8001_init.c +2 −4
  712. drivers/scsi/qedi/qedi_fw.c +15 −22
  713. drivers/scsi/qedi/qedi_iscsi.c +1 −1
  714. drivers/scsi/qedi/qedi_iscsi.h +1 −1
  715. drivers/scsi/qla2xxx/qla_dbg.c +3 −0
  716. drivers/scsi/qla2xxx/qla_edif.c +1 −1
  717. drivers/scsi/qla2xxx/qla_mbx.c +2 −4
  718. drivers/scsi/scsi_debug.c +27 −18
  719. drivers/scsi/scsi_sysfs.c +19 −11
  720. drivers/scsi/scsi_transport_iscsi.c +3 −3
  721. drivers/scsi/ufs/ufs-mediatek.c +1 −0
  722. drivers/scsi/ufs/ufshcd-pci.c +18 −0
  723. drivers/scsi/ufs/ufshcd.c +2 −7
  724. drivers/scsi/ufs/ufshpb.c +1 −1
  725. drivers/scsi/virtio_scsi.c +0 −1
  726. drivers/spi/spi-cadence-quadspi.c +21 −3
  727. drivers/spi/spi-fsl-lpspi.c +1 −1
  728. drivers/spi/spi-geni-qcom.c +10 −6
  729. drivers/spi/spi.c +6 −6
  730. drivers/staging/Kconfig +0 −2
  731. drivers/staging/Makefile +0 −1
  732. drivers/staging/fbtft/fb_ssd1351.c +0 −4
  733. drivers/staging/fbtft/fbtft-core.c +1 −8
  734. drivers/staging/greybus/audio_helper.c +6 −2
  735. drivers/staging/netlogic/Kconfig +0 −9
  736. drivers/staging/netlogic/Makefile +0 −2
  737. drivers/staging/netlogic/TODO +0 −11
  738. drivers/staging/netlogic/platform_net.c +0 −219
  739. drivers/staging/netlogic/platform_net.h +0 −21
  740. drivers/staging/netlogic/xlr_net.c +0 −1080
  741. drivers/staging/netlogic/xlr_net.h +0 −1079
  742. drivers/staging/r8188eu/core/rtw_mlme_ext.c +4 −2
  743. drivers/staging/r8188eu/os_dep/ioctl_linux.c +7 −1
  744. drivers/staging/r8188eu/os_dep/mlme_linux.c +1 −1
  745. drivers/staging/rtl8192e/rtl8192e/rtl_core.c +2 −1
  746. drivers/target/target_core_fabric_configfs.c +8 −8
  747. drivers/target/target_core_spc.c +7 −7
  748. drivers/tee/optee/ffa_abi.c +3 −4
  749. drivers/thermal/intel/int340x_thermal/Kconfig +2 −2
  750. drivers/thermal/intel/int340x_thermal/processor_thermal_rfim.c +1 −1
  751. drivers/thermal/thermal_core.c +2 −0
  752. drivers/tty/hvc/hvc_xen.c +1 −0
  753. drivers/tty/serial/8250/8250_bcm7271.c +13 −0
  754. drivers/tty/serial/8250/8250_pci.c +25 −14
  755. drivers/tty/serial/8250/8250_port.c +0 −7
  756. drivers/tty/serial/Kconfig +1 −1
  757. drivers/tty/serial/amba-pl011.c +1 −0
  758. drivers/tty/serial/fsl_lpuart.c +1 −0
  759. drivers/tty/serial/liteuart.c +17 −3
  760. drivers/tty/serial/msm_serial.c +3 −0
  761. drivers/tty/serial/serial-tegra.c +2 −2
  762. drivers/tty/serial/serial_core.c +17 −1
  763. drivers/usb/cdns3/cdns3-gadget.c +4 −16
  764. drivers/usb/cdns3/cdnsp-mem.c +3 −0
  765. drivers/usb/cdns3/host.c +1 −0
  766. drivers/usb/chipidea/ci_hdrc_imx.c +9 −9
  767. drivers/usb/core/config.c +3 −3
  768. drivers/usb/core/hub.c +18 −6
  769. drivers/usb/core/quirks.c +3 −0
  770. drivers/usb/dwc2/gadget.c +14 −3
  771. drivers/usb/dwc2/hcd_queue.c +1 −1
  772. drivers/usb/dwc3/core.c +5 −3
  773. drivers/usb/dwc3/core.h +1 −1
  774. drivers/usb/dwc3/dwc3-qcom.c +0 −15
  775. drivers/usb/dwc3/gadget.c +28 −11
  776. drivers/usb/gadget/composite.c +13 −1
  777. drivers/usb/gadget/legacy/dbgp.c +14 −1
  778. drivers/usb/gadget/legacy/inode.c +15 −1
  779. drivers/usb/gadget/udc/udc-xilinx.c +4 −1
  780. drivers/usb/host/xhci-hub.c +1 −0
  781. drivers/usb/host/xhci-ring.c +14 −8
  782. drivers/usb/host/xhci-tegra.c +29 −12
  783. drivers/usb/host/xhci.c +15 −11
  784. drivers/usb/serial/option.c +5 −0
  785. drivers/usb/serial/pl2303.c +1 −0
  786. drivers/usb/typec/tcpm/fusb302.c +4 −2
  787. drivers/usb/typec/tcpm/tcpm.c +0 −4
  788. drivers/usb/typec/tipd/core.c +17 −18
  789. drivers/vdpa/vdpa_sim/vdpa_sim.c +5 −2
  790. drivers/vfio/pci/vfio_pci_igd.c +3 −2
  791. drivers/vfio/vfio.c +14 −14
  792. drivers/vhost/vdpa.c +1 −1
  793. drivers/vhost/vsock.c +2 −6
  794. drivers/video/console/sticon.c +6 −6
  795. drivers/video/console/vgacon.c +9 −5
  796. drivers/video/fbdev/efifb.c +11 −0
  797. drivers/video/fbdev/simplefb.c +11 −0
  798. drivers/video/fbdev/xen-fbfront.c +1 −0
  799. drivers/virtio/virtio_ring.c +0 −60
  800. drivers/xen/Kconfig +7 −1
  801. drivers/xen/pvcalls-front.c +1 −0
  802. drivers/xen/xenbus/xenbus_probe.c +26 −1
  803. drivers/xen/xenbus/xenbus_probe_frontend.c +3 −11
  804. fs/aio.c +152 −34
  805. fs/attr.c +2 −2
  806. fs/btrfs/async-thread.c +14 −0
  807. fs/btrfs/delalloc-space.c +9 −3
  808. fs/btrfs/disk-io.c +13 −1
  809. fs/btrfs/extent-tree.c +3 −0
  810. fs/btrfs/extent_io.c +14 −0
  811. fs/btrfs/ioctl.c +6 −4
  812. fs/btrfs/lzo.c +14 −1
  813. fs/btrfs/root-tree.c +2 −1
  814. fs/btrfs/scrub.c +2 −2
  815. fs/btrfs/tree-log.c +3 −2
  816. fs/btrfs/volumes.c +13 −5
  817. fs/btrfs/zoned.c +2 −0
  818. fs/cifs/cifs_swn.c +2 −14
  819. fs/cifs/cifsfs.h +1 −1
  820. fs/cifs/cifsproto.h +1 −0
  821. fs/cifs/connect.c +12 −22
  822. fs/cifs/dfs_cache.c +1 −6
  823. fs/cifs/fscache.c +10 −36
  824. fs/cifs/inode.c +7 −0
  825. fs/cifs/sess.c +51 −19
  826. fs/cifs/smb2pdu.c +1 −1
  827. fs/erofs/utils.c +6 −2
  828. fs/file.c +4 −0
  829. fs/fuse/dev.c +5 −5
  830. fs/gfs2/bmap.c +1 −1
  831. fs/gfs2/file.c +6 −3
  832. fs/gfs2/glock.c +11 −11
  833. fs/gfs2/inode.c +45 −64
  834. fs/gfs2/super.c +7 −7
  835. fs/inode.c +0 −2
  836. fs/io-wq.c +30 −6
  837. fs/io_uring.c +57 −24
  838. fs/iomap/buffered-io.c +16 −10
  839. fs/ksmbd/smb2pdu.c +17 −13
  840. fs/netfs/read_helper.c +10 −15
  841. fs/nfs/inode.c +1 −0
  842. fs/nfs/nfs42proc.c +3 −1
  843. fs/nfs/nfs42xdr.c +1 −2
  844. fs/nfs/nfs4state.c +4 −0
  845. fs/nfs/nfstrace.h +1 −0
  846. fs/nfsd/nfs4recover.c +1 −0
  847. fs/nfsd/nfs4state.c +7 −2
  848. fs/nfsd/nfs4xdr.c +2 −5
  849. fs/nfsd/nfsctl.c +7 −7
  850. fs/ntfs/Kconfig +1 −0
  851. fs/proc/vmcore.c +12 −8
  852. fs/pstore/Kconfig +0 −1
  853. fs/pstore/blk.c +1 −1
  854. fs/signalfd.c +1 −11
  855. fs/smbfs_common/cifs_arc4.c +0 −13
  856. fs/tracefs/inode.c +76 −0
  857. fs/udf/dir.c +30 −2
  858. fs/udf/namei.c +3 −0
  859. fs/udf/super.c +2 −0
  860. fs/xfs/libxfs/xfs_attr.c +7 −10
  861. fs/xfs/xfs_icache.c +0 −21
  862. fs/xfs/xfs_inode.c +0 −1
  863. fs/xfs/xfs_inode.h +1 −3
  864. fs/xfs/xfs_super.c +11 −3
  865. include/asm-generic/cacheflush.h +0 −6
  866. include/linux/acpi.h +9 −7
  867. include/linux/bpf.h +5 −15
  868. include/linux/btf.h +10 −4
  869. include/linux/cacheflush.h +18 −0
  870. include/linux/cacheinfo.h +0 −1
  871. include/linux/delay.h +13 −1
  872. include/linux/device/driver.h +1 −0
  873. include/linux/filter.h +1 −4
  874. include/linux/fs.h +0 −1
  875. include/linux/hid.h +5 −0
  876. include/linux/highmem.h +42 −5
  877. include/linux/hugetlb_cgroup.h +12 −0
  878. include/linux/intel-ish-client-if.h +2 −2
  879. include/linux/ipc_namespace.h +15 −0
  880. include/linux/kprobes.h +2 −0
  881. include/linux/kvm_host.h +1 −5
  882. include/linux/kvm_types.h +0 −7
  883. include/linux/mhi.h +13 −0
  884. include/linux/mlx5/eswitch.h +2 −2
  885. include/linux/mlx5/mlx5_ifc.h +4 −1
  886. include/linux/mm_types.h +12 −1
  887. include/linux/mod_devicetable.h +14 −0
  888. include/linux/netdevice.h +13 −6
  889. include/linux/page-flags.h +7 −7
  890. include/linux/pagemap.h +21 −5
  891. include/linux/percpu-refcount.h +1 −1
  892. include/linux/percpu.h +0 −1
  893. include/linux/phy.h +6 −5
  894. include/linux/pm_runtime.h +1 −1
  895. include/linux/printk.h +4 −0
  896. include/linux/ptp_classify.h +1 −0
  897. include/linux/regulator/driver.h +8 −6
  898. include/linux/sched/cputime.h +3 −2
  899. include/linux/sched/signal.h +1 −0
  900. include/linux/sched/task.h +1 −1
  901. include/linux/sdb.h +0 −160
  902. include/linux/siphash.h +4 −10
  903. include/linux/skbuff.h +1 −1
  904. include/linux/trace_events.h +1 −1
  905. include/linux/virtio.h +0 −2
  906. include/linux/virtio_net.h +6 −1
  907. include/linux/wait.h +26 −0
  908. include/net/bond_alb.h +1 −1
  909. include/net/busy_poll.h +13 −0
  910. include/net/dst_cache.h +11 −0
  911. include/net/fib_rules.h +3 −1
  912. include/net/ip6_fib.h +1 −0
  913. include/net/ip_fib.h +1 −1
  914. include/net/ipv6_stubs.h +1 −0
  915. include/net/netfilter/nf_conntrack.h +3 −3
  916. include/net/netns/ipv4.h +1 −1
  917. include/net/nfc/nci_core.h +1 −0
  918. include/net/nl802154.h +4 −3
  919. include/net/page_pool.h +11 −1
  920. include/net/sock.h +23 −7
  921. include/rdma/rdma_netlink.h +1 −1
  922. include/soc/mscc/ocelot_vcap.h +2 −0
  923. include/sound/soc-acpi.h +1 −1
  924. include/trace/events/rpcgss.h +1 −1
  925. include/uapi/asm-generic/poll.h +1 −1
  926. include/uapi/drm/virtgpu_drm.h +7 −0
  927. include/uapi/linux/if_ether.h +1 −1
  928. include/uapi/linux/resource.h +10 −3
  929. include/xen/xenbus.h +1 −0
  930. init/Kconfig +1 −1
  931. ipc/shm.c +143 −46
  932. ipc/util.c +3 −3
  933. kernel/bpf/btf.c +2 −9
  934. kernel/bpf/cgroup.c +2 −0
  935. kernel/bpf/helpers.c +0 −2
  936. kernel/bpf/syscall.c +36 −21
  937. kernel/bpf/verifier.c +26 −3
  938. kernel/cpu.c +7 −0
  939. kernel/entry/syscall_user_dispatch.c +2 −2
  940. kernel/events/core.c +3 −0
  941. kernel/kprobes.c +3 −0
  942. kernel/locking/rwsem.c +89 −93
  943. kernel/power/hibernate.c +3 −3
  944. kernel/power/user.c +1 −1
  945. kernel/printk/printk.c +5 −0
  946. kernel/sched/core.c +3 −7
  947. kernel/sched/cputime.c +9 −3
  948. kernel/sched/wait.c +7 −0
  949. kernel/signal.c +29 −7
  950. kernel/softirq.c +2 −1
  951. kernel/time/tick-sched.c +7 −0
  952. kernel/time/timer.c +9 −7
  953. kernel/trace/bpf_trace.c +0 −2
  954. kernel/trace/ftrace.c +7 −1
  955. kernel/trace/trace.c +13 −3
  956. kernel/trace/trace.h +18 −6
  957. kernel/trace/trace_events.c +12 −0
  958. kernel/trace/trace_events_hist.c +30 −22
  959. kernel/trace/trace_events_synth.c +6 −5
  960. kernel/trace/trace_uprobe.c +1 −0
  961. kernel/trace/tracing_map.c +3 −0
  962. lib/Kconfig.debug +4 −2
  963. lib/nmi_backtrace.c +6 −0
  964. lib/siphash.c +6 −6
  965. lib/test_kasan.c +2 −0
  966. lib/zstd/Makefile +0 −2
  967. lib/zstd/common/compiler.h +7 −0
  968. lib/zstd/compress/zstd_compress_superblock.c +2 −0
  969. lib/zstd/compress/zstd_opt.c +12 −0
  970. mm/Kconfig +4 −1
  971. mm/backing-dev.c +7 −0
  972. mm/damon/core.c +7 −13
  973. mm/damon/dbgfs.c +14 −10
  974. mm/damon/vaddr-test.h +37 −42
  975. mm/damon/vaddr.c +1 −1
  976. mm/filemap.c +0 −2
  977. mm/highmem.c +21 −13
  978. mm/hugetlb.c +28 −10
  979. mm/memcontrol.c +54 −54
  980. mm/memory_hotplug.c +1 −0
  981. mm/shmem.c +2 −1
  982. mm/slab.c +1 −2
  983. mm/slab.h +1 −1
  984. mm/slob.c +1 −2
  985. mm/slub.c +10 −7
  986. mm/swap.c +1 −0
  987. mm/swap_slots.c +1 −0
  988. mm/util.c +1 −1
  989. net/8021q/vlan.c +0 −3
  990. net/8021q/vlan_dev.c +3 −0
  991. net/core/dev.c +4 −1
  992. net/core/devlink.c +11 −9
  993. net/core/dst_cache.c +19 −0
  994. net/core/fib_rules.c +1 −1
  995. net/core/filter.c +6 −0
  996. net/core/neighbour.c +2 −2
  997. net/core/page_pool.c +4 −6
  998. net/core/skmsg.c +5 −0
  999. net/core/sock.c +3 −3
  1000. net/core/sock_map.c +10 −5
  1001. net/ethtool/ioctl.c +1 −1
  1002. net/ethtool/netlink.c +2 −1
  1003. net/ipv4/bpf_tcp_ca.c +2 −0
  1004. net/ipv4/devinet.c +1 −1
  1005. net/ipv4/fib_frontend.c +1 −1
  1006. net/ipv4/fib_rules.c +3 −2
  1007. net/ipv4/fib_semantics.c +2 −2
  1008. net/ipv4/inet_connection_sock.c +1 −1
  1009. net/ipv4/nexthop.c +30 −5
  1010. net/ipv4/tcp.c +3 −0
  1011. net/ipv4/tcp_cubic.c +3 −2
  1012. net/ipv4/tcp_minisocks.c +2 −2
  1013. net/ipv4/udp.c +12 −1
  1014. net/ipv6/af_inet6.c +1 −0
  1015. net/ipv6/esp6.c +6 −0
  1016. net/ipv6/fib6_rules.c +2 −2
  1017. net/ipv6/ip6_offload.c +3 −3
  1018. net/ipv6/ip6_output.c +1 −1
  1019. net/ipv6/route.c +19 −0
  1020. net/ipv6/seg6_iptunnel.c +8 −0
  1021. net/mac80211/cfg.c +8 −4
  1022. net/mac80211/iface.c +3 −1
  1023. net/mac80211/led.h +4 −4
  1024. net/mac80211/rx.c +7 −5
  1025. net/mac80211/tx.c +15 −19
  1026. net/mac80211/util.c +4 −3
  1027. net/mac80211/wme.c +1 −2
  1028. net/mctp/route.c +5 −4
  1029. net/mctp/test/utils.c +1 −1
  1030. net/mpls/af_mpls.c +62 −35
  1031. net/mpls/internal.h +1 −1
  1032. net/mptcp/options.c +9 −23
  1033. net/mptcp/protocol.c +42 −9
  1034. net/mptcp/protocol.h +9 −8
  1035. net/ncsi/ncsi-cmd.c +16 −8
  1036. net/netfilter/ipvs/ip_vs_core.c +4 −4
  1037. net/netfilter/nf_conntrack_core.c +3 −3
  1038. net/netfilter/nf_conntrack_netlink.c +3 −5
  1039. net/netfilter/nf_flow_table_core.c +2 −2
  1040. net/netfilter/nf_flow_table_offload.c +2 −2
  1041. net/netfilter/nfnetlink_queue.c +1 −1
  1042. net/netfilter/nft_exthdr.c +7 −4
  1043. net/netfilter/nft_payload.c +0 −1
  1044. net/netfilter/nft_set_pipapo_avx2.c +1 −1
  1045. net/netfilter/xt_IDLETIMER.c +2 −2
  1046. net/netlink/af_netlink.c +5 −0
  1047. net/nfc/core.c +18 −14
  1048. net/nfc/nci/core.c +24 −6
  1049. net/nfc/netlink.c +8 −4
  1050. net/rds/tcp.c +1 −1
  1051. net/rxrpc/conn_client.c +9 −5
  1052. net/rxrpc/peer_object.c +9 −5
  1053. net/sched/act_mirred.c +8 −3
  1054. net/sched/sch_ets.c +5 −3
  1055. net/sched/sch_fq_pie.c +1 −0
  1056. net/smc/af_smc.c +24 −2
  1057. net/smc/smc_close.c +12 −2
  1058. net/smc/smc_core.c +23 −22
  1059. net/sunrpc/xprtsock.c +5 −5
  1060. net/tipc/crypto.c +8 −4
  1061. net/tipc/link.c +5 −2
  1062. net/tls/tls_main.c +40 −7
  1063. net/tls/tls_sw.c +29 −15
  1064. net/unix/af_unix.c +0 −3
  1065. net/wireless/nl80211.c +19 −15
  1066. net/wireless/nl80211.h +1 −5
  1067. net/wireless/util.c +1 −0
  1068. net/xdp/xsk_buff_pool.c +5 −2
  1069. samples/Kconfig +10 −1
  1070. samples/Makefile +1 −1
  1071. samples/bpf/hbm_kern.h +0 −2
  1072. samples/bpf/xdp_redirect_cpu_user.c +2 −3
  1073. samples/bpf/xdp_sample_user.c +15 −13
  1074. samples/ftrace/Makefile +2 −1
  1075. samples/ftrace/ftrace-direct-multi-modify.c +152 −0
  1076. samples/ftrace/ftrace-direct-multi.c +30 −0
  1077. scripts/mod/devicetable-offsets.c +3 −0
  1078. scripts/mod/file2alias.c +24 −0
  1079. security/selinux/ss/hashtab.c +12 −5
  1080. sound/core/control_compat.c +3 −0
  1081. sound/core/oss/pcm_oss.c +25 −12
  1082. sound/hda/intel-dsp-config.c +19 −0
  1083. sound/pci/cmipci.c +1 −3
  1084. sound/pci/ctxfi/ctamixer.c +6 −8
  1085. sound/pci/ctxfi/ctdaio.c +8 −8
  1086. sound/pci/ctxfi/ctresource.c +3 −4
  1087. sound/pci/ctxfi/ctresource.h +2 −2
  1088. sound/pci/ctxfi/ctsrc.c +3 −4
  1089. sound/pci/hda/hda_intel.c +11 −1
  1090. sound/pci/hda/hda_local.h +9 −0
  1091. sound/pci/hda/patch_cs8409.c +5 −0
  1092. sound/pci/hda/patch_hdmi.c +2 −1
  1093. sound/pci/hda/patch_realtek.c +90 −18
  1094. sound/soc/amd/yc/pci-acp6x.c +2 −1
  1095. sound/soc/codecs/cs35l41-spi.c +3 −29
  1096. sound/soc/codecs/cs35l41.c +7 −14
  1097. sound/soc/codecs/cs35l41.h +1 −3
  1098. sound/soc/codecs/lpass-rx-macro.c +1 −1
  1099. sound/soc/codecs/rk817_codec.c +1 −0
  1100. sound/soc/codecs/rt1011.c +49 −6
  1101. sound/soc/codecs/rt1011.h +7 −0
  1102. sound/soc/codecs/rt5682-i2c.c +1 −0
  1103. sound/soc/codecs/rt5682.c +35 −13
  1104. sound/soc/codecs/rt5682.h +1 −0
  1105. sound/soc/codecs/rt5682s.c +6 −4
  1106. sound/soc/codecs/rt9120.c +48 −10
  1107. sound/soc/codecs/wcd934x.c +94 −35
  1108. sound/soc/codecs/wcd938x.c +3 −0
  1109. sound/soc/codecs/wm_adsp.c +3 −2
  1110. sound/soc/codecs/wsa881x.c +12 −4
  1111. sound/soc/intel/boards/sof_sdw.c +69 −0
  1112. sound/soc/intel/common/soc-acpi-intel-adl-match.c +105 −0
  1113. sound/soc/intel/common/soc-acpi-intel-cml-match.c +6 −0
  1114. sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +43 −8
  1115. sound/soc/mediatek/mt8173/mt8173-rt5650.c +4 −4
  1116. sound/soc/qcom/qdsp6/audioreach.h +4 −0
  1117. sound/soc/qcom/qdsp6/q6adm.c +2 −2
  1118. sound/soc/qcom/qdsp6/q6asm-dai.c +13 −6
  1119. sound/soc/qcom/qdsp6/q6prm.c +51 −2
  1120. sound/soc/qcom/qdsp6/q6routing.c +12 −0
  1121. sound/soc/rockchip/rockchip_i2s_tdm.c +31 −21
  1122. sound/soc/sh/rcar/dma.c +1 −1
  1123. sound/soc/soc-acpi.c +3 −1
  1124. sound/soc/soc-dapm.c +23 −6
  1125. sound/soc/soc-topology.c +3 −0
  1126. sound/soc/sof/Kconfig +1 −1
  1127. sound/soc/sof/control.c +4 −4
  1128. sound/soc/sof/intel/hda-bus.c +17 −0
  1129. sound/soc/sof/intel/hda-codec.c +9 −5
  1130. sound/soc/sof/intel/hda-dsp.c +1 −2
  1131. sound/soc/sof/intel/hda.c +23 −0
  1132. sound/soc/stm/stm32_i2s.c +1 −1
  1133. sound/soc/tegra/tegra186_dspk.c +147 −34
  1134. sound/soc/tegra/tegra210_admaif.c +110 −30
  1135. sound/soc/tegra/tegra210_adx.c +5 −2
  1136. sound/soc/tegra/tegra210_ahub.c +7 −4
  1137. sound/soc/tegra/tegra210_amx.c +5 −2
  1138. sound/soc/tegra/tegra210_dmic.c +149 −35
  1139. sound/soc/tegra/tegra210_i2s.c +226 −70
  1140. sound/soc/tegra/tegra210_mixer.c +21 −9
  1141. sound/soc/tegra/tegra210_mvc.c +26 −12
  1142. sound/soc/tegra/tegra210_sfc.c +96 −31
  1143. sound/usb/mixer_quirks.c +5 −5
  1144. sound/usb/pcm.c +11 −3
  1145. sound/xen/xen_snd_front.c +1 −0
  1146. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  1147. tools/arch/x86/include/uapi/asm/kvm.h +4 −0
  1148. tools/bpf/resolve_btfids/main.c +5 −3
  1149. tools/bpf/runqslower/Makefile +1 −2
  1150. tools/build/Makefile.feature +0 −1
  1151. tools/build/feature/Makefile +0 −4
  1152. tools/build/feature/test-all.c +0 −6
  1153. tools/build/feature/test-libpython-version.c +0 −11
  1154. tools/include/linux/debug_locks.h +0 −14
  1155. tools/include/linux/hardirq.h +0 −12
  1156. tools/include/linux/irqflags.h +0 −39
  1157. tools/include/linux/kernel.h +1 −21
  1158. tools/include/linux/lockdep.h +0 −72
  1159. tools/include/linux/math.h +25 −0
  1160. tools/include/linux/proc_fs.h +0 −4
  1161. tools/include/linux/spinlock.h +0 −2
  1162. tools/include/linux/stacktrace.h +0 −33
  1163. tools/include/uapi/linux/if_link.h +259 −34
  1164. tools/include/uapi/linux/kvm.h +27 −3
  1165. tools/lib/bpf/bpf_gen_internal.h +2 −2
  1166. tools/lib/bpf/gen_loader.c +30 −17
  1167. tools/lib/bpf/libbpf.c +2 −2
  1168. tools/objtool/elf.c +1 −0
  1169. tools/objtool/objtool.c +4 −0
  1170. tools/perf/Makefile.config +3 −2
  1171. tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl +1 −0
  1172. tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +1 −0
  1173. tools/perf/arch/s390/entry/syscalls/syscall.tbl +1 −0
  1174. tools/perf/builtin-inject.c +1 −1
  1175. tools/perf/builtin-report.c +9 −6
  1176. tools/perf/tests/event_update.c +2 −3
  1177. tools/perf/tests/expr.c +3 −1
  1178. tools/perf/tests/parse-metric.c +1 −0
  1179. tools/perf/tests/sample-parsing.c +1 −1
  1180. tools/perf/tests/wp.c +1 −1
  1181. tools/perf/ui/hist.c +14 −14
  1182. tools/perf/util/arm-spe.c +15 −0
  1183. tools/perf/util/bpf_skel/bperf.h +0 −14
  1184. tools/perf/util/bpf_skel/bperf_follower.bpf.c +14 −5
  1185. tools/perf/util/bpf_skel/bperf_leader.bpf.c +14 −5
  1186. tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c +1 −1
  1187. tools/perf/util/event.h +4 −1
  1188. tools/perf/util/evsel.c +9 −9
  1189. tools/perf/util/header.c +15 −8
  1190. tools/perf/util/hist.c +6 −17
  1191. tools/perf/util/hist.h +0 −1
  1192. tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +55 −30
  1193. tools/perf/util/intel-pt.c +1 −0
  1194. tools/perf/util/parse-events.c +6 −3
  1195. tools/perf/util/perf_regs.c +3 −0
  1196. tools/perf/util/python.c +1 −1
  1197. tools/perf/util/smt.c +1 −1
  1198. tools/perf/util/sort.c +16 −36
  1199. tools/perf/util/sort.h +3 −3
  1200. tools/perf/util/util.c +7 −7
  1201. tools/perf/util/util.h +1 −1
  1202. tools/power/acpi/Makefile.config +1 −0
  1203. tools/power/acpi/Makefile.rules +1 −0
  1204. tools/testing/radix-tree/linux/lockdep.h +3 −0
  1205. tools/testing/selftests/bpf/Makefile +1 −1
  1206. tools/testing/selftests/bpf/prog_tests/helper_restricted.c +33 −0
  1207. tools/testing/selftests/bpf/progs/test_helper_restricted.c +123 −0
  1208. tools/testing/selftests/bpf/test_verifier.c +45 −1
  1209. tools/testing/selftests/bpf/verifier/helper_restricted.c +196 −0
  1210. tools/testing/selftests/bpf/verifier/map_in_map.c +34 −0
  1211. tools/testing/selftests/bpf/verifier/xdp_direct_packet_access.c +600 −32
  1212. tools/testing/selftests/damon/.gitignore +2 −0
  1213. tools/testing/selftests/damon/Makefile +5 −2
  1214. tools/testing/selftests/damon/_debugfs_common.sh +52 −0
  1215. tools/testing/selftests/damon/debugfs_attrs.sh +1 −72
  1216. tools/testing/selftests/damon/debugfs_empty_targets.sh +13 −0
  1217. tools/testing/selftests/damon/debugfs_huge_count_read_write.sh +22 −0
  1218. tools/testing/selftests/damon/debugfs_schemes.sh +19 −0
  1219. tools/testing/selftests/damon/debugfs_target_ids.sh +19 −0
  1220. tools/testing/selftests/damon/huge_count_read_write.c +39 −0
  1221. tools/testing/selftests/gpio/Makefile +1 −0
  1222. tools/testing/selftests/gpio/gpio-mockup-cdev.c +1 −1
  1223. tools/testing/selftests/kvm/.gitignore +2 −0
  1224. tools/testing/selftests/kvm/Makefile +1 −0
  1225. tools/testing/selftests/kvm/access_tracking_perf_test.c +10 −44
  1226. tools/testing/selftests/kvm/demand_paging_test.c +9 −47
  1227. tools/testing/selftests/kvm/dirty_log_perf_test.c +7 −22
  1228. tools/testing/selftests/kvm/dirty_log_test.c +3 −3
  1229. tools/testing/selftests/kvm/include/kvm_util.h +9 −0
  1230. tools/testing/selftests/kvm/include/perf_test_util.h +11 −12
  1231. tools/testing/selftests/kvm/include/test_util.h +26 −0
  1232. tools/testing/selftests/kvm/kvm_create_max_vcpus.c +30 −0
  1233. tools/testing/selftests/kvm/kvm_page_table_test.c +1 −1
  1234. tools/testing/selftests/kvm/lib/elf.c +1 −2
  1235. tools/testing/selftests/kvm/lib/kvm_util.c +25 −21
  1236. tools/testing/selftests/kvm/lib/perf_test_util.c +138 −46
  1237. tools/testing/selftests/kvm/lib/test_util.c +5 −0
  1238. tools/testing/selftests/kvm/lib/x86_64/processor.c +68 −0
  1239. tools/testing/selftests/kvm/memslot_modification_stress_test.c +7 −31
  1240. tools/testing/selftests/kvm/x86_64/hyperv_features.c +71 −69
  1241. tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c +155 −10
  1242. tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c +1 −1
  1243. tools/testing/selftests/kvm/x86_64/userspace_io_test.c +114 −0
  1244. tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c +66 −9
  1245. tools/testing/selftests/net/Makefile +1 −0
  1246. tools/testing/selftests/net/fcnal-test.sh +10 −2
  1247. tools/testing/selftests/net/fib_nexthops.sh +63 −0
  1248. tools/testing/selftests/net/fib_tests.sh +49 −10
  1249. tools/testing/selftests/net/forwarding/config +1 −0
  1250. tools/testing/selftests/net/forwarding/tc_actions.sh +46 −1
  1251. tools/testing/selftests/net/gre_gso.sh +9 −7
  1252. tools/testing/selftests/net/tls.c +425 −132
  1253. tools/testing/selftests/netfilter/Makefile +2 −1
  1254. tools/testing/selftests/netfilter/conntrack_vrf.sh +241 −0
  1255. tools/testing/selftests/netfilter/nft_concat_range.sh +21 −3
  1256. tools/testing/selftests/netfilter/nft_nat.sh +23 −10
  1257. tools/testing/selftests/netfilter/nft_queue.sh +54 −0
  1258. tools/testing/selftests/netfilter/nft_zones_many.sh +13 −6
  1259. tools/testing/selftests/tc-testing/config +2 −0
  1260. tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json +1 −1
  1261. tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json +6 −6
  1262. tools/testing/selftests/tc-testing/tdc.py +5 −3
  1263. tools/testing/selftests/tc-testing/tdc.sh +1 −0
  1264. tools/testing/selftests/wireguard/netns.sh +28 −2
  1265. tools/testing/selftests/wireguard/qemu/debug.config +1 −1
  1266. tools/testing/selftests/wireguard/qemu/kernel.config +1 −0
  1267. virt/kvm/kvm_main.c +48 −108
.mailmap+5−0
@@ -71,6 +71,9 @@ Chao Yu <chao@kernel.org> <chao2.yu@samsung.com> · 70 unmodified lines
7171 Chao Yu <chao@kernel.org> <yuchao0@huawei.com>
7272 Chris Chiu <chris.chiu@canonical.com> <chiu@endlessm.com>
7373 Chris Chiu <chris.chiu@canonical.com> <chiu@endlessos.org>
74+Christian Borntraeger <borntraeger@linux.ibm.com> <borntraeger@de.ibm.com>
75+Christian Borntraeger <borntraeger@linux.ibm.com> <cborntra@de.ibm.com>
76+Christian Borntraeger <borntraeger@linux.ibm.com> <borntrae@de.ibm.com>
7477 Christophe Ricard <christophe.ricard@gmail.com>
7578 Christoph Hellwig <hch@lst.de>
7679 Colin Ian King <colin.king@intel.com> <colin.king@canonical.com>
@@ -123,6 +126,8 @@ Greg Kroah-Hartman <gregkh@suse.de> · 46 unmodified lines
123126 Greg Kroah-Hartman <greg@kroah.com>
124127 Greg Kurz <groug@kaod.org> <gkurz@linux.vnet.ibm.com>
125128 Gregory CLEMENT <gregory.clement@bootlin.com> <gregory.clement@free-electrons.com>
129+Guo Ren <guoren@kernel.org> <guoren@linux.alibaba.com>
130+Guo Ren <guoren@kernel.org> <ren_guo@c-sky.com>
126131 Gustavo Padovan <gustavo@las.ic.unicamp.br>
127132 Gustavo Padovan <padovan@profusion.mobi>
128133 Hanjun Guo <guohanjun@huawei.com> <hanjun.guo@linaro.org>
Documentation/admin-guide/blockdev/drbd/figures.rst+2−2
@@ -25,6 +25,6 @@ Sub graphs of DRBD's state transitions · 24 unmodified lines
2525 :alt: disk-states-8.dot
2626 :align: center
2727
28−.. kernel-figure:: node-states-8.dot
29− :alt: node-states-8.dot
28+.. kernel-figure:: peer-states-8.dot
29+ :alt: peer-states-8.dot
3030 :align: center
Documentation/admin-guide/blockdev/drbd/peer-states-8.dotrenamed from Documentation/admin-guide/blockdev/drbd/node-states-8.dot+0−5
@@ -1,8 +1,3 @@
1−digraph node_states {
2− Secondary -> Primary [ label = "ioctl_set_state()" ]
3− Primary -> Secondary [ label = "ioctl_set_state()" ]
4−}
5−
61 digraph peer_states {
72 Secondary -> Primary [ label = "recv state packet" ]
83 Primary -> Secondary [ label = "recv state packet" ]
Documentation/admin-guide/laptops/thinkpad-acpi.rst+6−6
@@ -1520,15 +1520,15 @@ This sysfs attribute controls the keyboard "face" that will be shown on the · 1519 unmodified lines
15201520 Lenovo X1 Carbon 2nd gen (2014)'s adaptive keyboard. The value can be read
15211521 and set.
15221522
1523−- 1 = Home mode
1524−- 2 = Web-browser mode
1525−- 3 = Web-conference mode
1526−- 4 = Function mode
1527−- 5 = Layflat mode
1523+- 0 = Home mode
1524+- 1 = Web-browser mode
1525+- 2 = Web-conference mode
1526+- 3 = Function mode
1527+- 4 = Layflat mode
15281528
15291529 For more details about which buttons will appear depending on the mode, please
15301530 review the laptop's user guide:
1531−http://www.lenovo.com/shop/americas/content/user_guides/x1carbon_2_ug_en.pdf
1531+https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/x1carbon_2_ug_en.pdf
15321532
15331533 Battery charge control
15341534 ----------------------
Documentation/admin-guide/sysctl/kernel.rst+1−1
@@ -1099,7 +1099,7 @@ task_delayacct · 1098 unmodified lines
10991099 ===============
11001100
11011101 Enables/disables task delay accounting (see
1102−:doc:`accounting/delay-accounting.rst`). Enabling this feature incurs
1102+Documentation/accounting/delay-accounting.rst. Enabling this feature incurs
11031103 a small amount of overhead in the scheduler but is useful for debugging
11041104 and performance tuning. It is required by some tools such as iotop.
11051105
Documentation/arm/marvell.rst+24−24
@@ -104,6 +104,8 @@ Discovery family · 103 unmodified lines
104104
105105 Not supported by the Linux kernel.
106106
107+ Homepage:
108+ https://web.archive.org/web/20110924171043/http://www.marvell.com/embedded-processors/discovery-innovation/
107109 Core:
108110 Feroceon 88fr571-vd ARMv5 compatible
109111
@@ -120,6 +122,7 @@ EBU Armada family · 10 unmodified lines
120122 - 88F6707
121123 - 88F6W11
122124
125+ - Product infos: https://web.archive.org/web/20141002083258/http://www.marvell.com/embedded-processors/armada-370/
123126 - Product Brief: https://web.archive.org/web/20121115063038/http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
124127 - Hardware Spec: https://web.archive.org/web/20140617183747/http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf
125128 - Functional Spec: https://web.archive.org/web/20140617183701/http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf
@@ -127,9 +130,29 @@ EBU Armada family · 1 unmodified line
127130 Core:
128131 Sheeva ARMv7 compatible PJ4B
129132
133+ Armada XP Flavors:
134+ - MV78230
135+ - MV78260
136+ - MV78460
137+
138+ NOTE:
139+ not to be confused with the non-SMP 78xx0 SoCs
140+
141+ - Product infos: https://web.archive.org/web/20150101215721/http://www.marvell.com/embedded-processors/armada-xp/
142+ - Product Brief: https://web.archive.org/web/20121021173528/http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
143+ - Functional Spec: https://web.archive.org/web/20180829171131/http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf
144+ - Hardware Specs:
145+ - https://web.archive.org/web/20141127013651/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF
146+ - https://web.archive.org/web/20141222000224/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF
147+ - https://web.archive.org/web/20141222000230/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF
148+
149+ Core:
150+ Sheeva ARMv7 compatible Dual-core or Quad-core PJ4B-MP
151+
130152 Armada 375 Flavors:
131153 - 88F6720
132154
155+ - Product infos: https://web.archive.org/web/20140108032402/http://www.marvell.com/embedded-processors/armada-375/
133156 - Product Brief: https://web.archive.org/web/20131216023516/http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf
134157
135158 Core:
@@ -162,29 +185,6 @@ EBU Armada family · 26 unmodified lines
162185 Core:
163186 ARM Cortex-A9
164187
165− Armada XP Flavors:
166− - MV78230
167− - MV78260
168− - MV78460
169−
170− NOTE:
171− not to be confused with the non-SMP 78xx0 SoCs
172−
173− Product Brief:
174− https://web.archive.org/web/20121021173528/http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
175−
176− Functional Spec:
177− https://web.archive.org/web/20180829171131/http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf
178−
179− - Hardware Specs:
180−
181− - https://web.archive.org/web/20141127013651/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF
182− - https://web.archive.org/web/20141222000224/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF
183− - https://web.archive.org/web/20141222000230/http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF
184−
185− Core:
186− Sheeva ARMv7 compatible Dual-core or Quad-core PJ4B-MP
187−
188188 Linux kernel mach directory:
189189 arch/arm/mach-mvebu
190190 Linux kernel plat directory:
@@ -436,7 +436,7 @@ Berlin family (Multimedia Solutions) · 245 unmodified lines
436436 - Flavors:
437437 - 88DE3010, Armada 1000 (no Linux support)
438438 - Core: Marvell PJ1 (ARMv5TE), Dual-core
439− - Product Brief: http://www.marvell.com.cn/digital-entertainment/assets/armada_1000_pb.pdf
439+ - Product Brief: https://web.archive.org/web/20131103162620/http://www.marvell.com/digital-entertainment/assets/armada_1000_pb.pdf
440440 - 88DE3005, Armada 1500 Mini
441441 - Design name: BG2CD
442442 - Core: ARM Cortex-A9, PL310 L2CC
Documentation/arm64/pointer-authentication.rst+4−5
@@ -53,11 +53,10 @@ The number of bits that the PAC occupies in a pointer is 55 minus the · 52 unmodified lines
5353 virtual address size configured by the kernel. For example, with a
5454 virtual address size of 48, the PAC is 7 bits wide.
5555
56−Recent versions of GCC can compile code with APIAKey-based return
57−address protection when passed the -msign-return-address option. This
58−uses instructions in the HINT space (unless -march=armv8.3-a or higher
59−is also passed), and such code can run on systems without the pointer
60−authentication extension.
56+When ARM64_PTR_AUTH_KERNEL is selected, the kernel will be compiled
57+with HINT space pointer authentication instructions protecting
58+function returns. Kernels built with this option will work on hardware
59+with or without pointer authentication support.
6160
6261 In addition to exec(), keys can also be reinitialized to random values
6362 using the PR_PAC_RESET_KEYS prctl. A bitmask of PR_PAC_APIAKEY,
Documentation/bpf/index.rst+1−1
@@ -15,7 +15,7 @@ that goes into great technical depth about the BPF Architecture. · 14 unmodified lines
1515 libbpf
1616 ======
1717
18−Documentation/bpf/libbpf/libbpf.rst is a userspace library for loading and interacting with bpf programs.
18+Documentation/bpf/libbpf/index.rst is a userspace library for loading and interacting with bpf programs.
1919
2020 BPF Type Format (BTF)
2121 =====================
Documentation/conf.py+10−5
@@ -249,11 +249,16 @@ except ImportError: · 248 unmodified lines
249249
250250 html_static_path = ['sphinx-static']
251251
252−html_context = {
253− 'css_files': [
254− '_static/theme_overrides.css',
255− ],
256−}
252+html_css_files = [
253+ 'theme_overrides.css',
254+]
255+
256+if major <= 1 and minor < 8:
257+ html_context = {
258+ 'css_files': [
259+ '_static/theme_overrides.css',
260+ ],
261+ }
257262
258263 # Add any extra paths that contain custom files (such as robots.txt or
259264 # .htaccess) here, relative to this directory. These files are copied
Documentation/cpu-freq/core.rst+3−3
@@ -73,12 +73,12 @@ CPUFREQ_POSTCHANGE. · 72 unmodified lines
7373 The third argument is a struct cpufreq_freqs with the following
7474 values:
7575
76−===== ===========================
77−cpu number of the affected CPU
76+====== ======================================
77+policy a pointer to the struct cpufreq_policy
7878 old old frequency
7979 new new frequency
8080 flags flags of the cpufreq driver
81−===== ===========================
81+====== ======================================
8282
8383 3. CPUFreq Table Generation with Operating Performance Point (OPP)
8484 ==================================================================
Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml+3−2
@@ -17,9 +17,10 @@ properties: · 16 unmodified lines
1717 oneOf:
1818 - enum:
1919 - fsl,imx7ulp-lpi2c
20− - fsl,imx8qm-lpi2c
2120 - items:
22− - const: fsl,imx8qxp-lpi2c
21+ - enum:
22+ - fsl,imx8qxp-lpi2c
23+ - fsl,imx8qm-lpi2c
2324 - const: fsl,imx7ulp-lpi2c
2425
2526 reg:
Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.yaml+1−1
@@ -136,7 +136,7 @@ examples: · 135 unmodified lines
136136 samsung,syscon-phandle = <&pmu_system_controller>;
137137
138138 /* NTC thermistor is a hwmon device */
139− ncp15wb473 {
139+ thermistor {
140140 compatible = "murata,ncp15wb473";
141141 pullup-uv = <1800000>;
142142 pullup-ohm = <47000>;
Documentation/devicetree/bindings/input/gpio-keys.yaml+1−1
@@ -142,7 +142,7 @@ examples: · 141 unmodified lines
142142 down {
143143 label = "GPIO Key DOWN";
144144 linux,code = <108>;
145− interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
145+ interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
146146 };
147147 };
148148
Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml+2−12
@@ -79,6 +79,8 @@ properties: · 78 unmodified lines
7979
8080 properties:
8181 data-lanes:
82+ description:
83+ Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
8284 items:
8385 minItems: 1
8486 maxItems: 4
@@ -91,18 +93,6 @@ properties: · 6 unmodified lines
9193 required:
9294 - data-lanes
9395
94− allOf:
95− - if:
96− properties:
97− compatible:
98− contains:
99− const: fsl,imx7-mipi-csi2
100− then:
101− properties:
102− data-lanes:
103− items:
104− maxItems: 2
105−
10696 port@1:
10797 $ref: /schemas/graph.yaml#/properties/port
10898 description:
Documentation/devicetree/bindings/net/ethernet-phy.yaml+8−0
@@ -91,6 +91,14 @@ properties: · 90 unmodified lines
9191 compensate for the board being designed with the lanes
9292 swapped.
9393
94+ enet-phy-lane-no-swap:
95+ $ref: /schemas/types.yaml#/definitions/flag
96+ description:
97+ If set, indicates that PHY will disable swap of the
98+ TX/RX lanes. This property allows the PHY to work correcly after
99+ e.g. wrong bootstrap configuration caused by issues in PCB
100+ layout design.
101+
94102 eee-broken-100tx:
95103 $ref: /schemas/types.yaml#/definitions/flag
96104 description:
Documentation/devicetree/bindings/phy/xlnx,zynqmp-psgtr.yaml+1−1
@@ -29,7 +29,7 @@ properties: · 28 unmodified lines
2929 - PHY_TYPE_PCIE
3030 - PHY_TYPE_SATA
3131 - PHY_TYPE_SGMII
32− - PHY_TYPE_USB
32+ - PHY_TYPE_USB3
3333 - description: The PHY instance
3434 minimum: 0
3535 maximum: 1 # for DP, SATA or USB
Documentation/devicetree/bindings/power/supply/bq25980.yaml+1−1
@@ -105,7 +105,7 @@ examples: · 104 unmodified lines
105105 reg = <0x65>;
106106 interrupt-parent = <&gpio1>;
107107 interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
108− ti,watchdog-timer = <0>;
108+ ti,watchdog-timeout-ms = <0>;
109109 ti,sc-ocp-limit-microamp = <2000000>;
110110 ti,sc-ovp-limit-microvolt = <17800000>;
111111 monitored-battery = <&bat>;
Documentation/devicetree/bindings/sound/wlf,wm8962.yaml+3−0
@@ -19,6 +19,9 @@ properties: · 18 unmodified lines
1919 clocks:
2020 maxItems: 1
2121
22+ interrupts:
23+ maxItems: 1
24+
2225 "#sound-dai-cells":
2326 const: 0
2427
Documentation/devicetree/bindings/spi/spi-rockchip.yaml+1−0
@@ -33,6 +33,7 @@ properties: · 32 unmodified lines
3333 - rockchip,rk3328-spi
3434 - rockchip,rk3368-spi
3535 - rockchip,rk3399-spi
36+ - rockchip,rk3568-spi
3637 - rockchip,rv1126-spi
3738 - const: rockchip,rk3066-spi
3839
Documentation/doc-guide/sphinx.rst+9−13
@@ -27,7 +27,7 @@ Sphinx Install · 26 unmodified lines
2727 ==============
2828
2929 The ReST markups currently used by the Documentation/ files are meant to be
30−built with ``Sphinx`` version 1.3 or higher.
30+built with ``Sphinx`` version 1.7 or higher.
3131
3232 There's a script that checks for the Sphinx requirements. Please see
3333 :ref:`sphinx-pre-install` for further details.
@@ -43,10 +43,6 @@ or ``virtualenv``, depending on how your distribution packaged Python 3. · 9 unmodified lines
4343
4444 .. note::
4545
46− #) Sphinx versions below 1.5 don't work properly with Python's
47− docutils version 0.13.1 or higher. So, if you're willing to use
48− those versions, you should run ``pip install 'docutils==0.12'``.
49−
5046 #) It is recommended to use the RTD theme for html output. Depending
5147 on the Sphinx version, it should be installed separately,
5248 with ``pip install sphinx_rtd_theme``.
@@ -55,13 +51,13 @@ or ``virtualenv``, depending on how your distribution packaged Python 3. · 2 unmodified lines
5551 those expressions are written using LaTeX notation. It needs texlive
5652 installed with amsfonts and amsmath in order to evaluate them.
5753
58−In summary, if you want to install Sphinx version 1.7.9, you should do::
54+In summary, if you want to install Sphinx version 2.4.4, you should do::
5955
60− $ virtualenv sphinx_1.7.9
61− $ . sphinx_1.7.9/bin/activate
62− (sphinx_1.7.9) $ pip install -r Documentation/sphinx/requirements.txt
56+ $ virtualenv sphinx_2.4.4
57+ $ . sphinx_2.4.4/bin/activate
58+ (sphinx_2.4.4) $ pip install -r Documentation/sphinx/requirements.txt
6359
64−After running ``. sphinx_1.7.9/bin/activate``, the prompt will change,
60+After running ``. sphinx_2.4.4/bin/activate``, the prompt will change,
6561 in order to indicate that you're using the new environment. If you
6662 open a new shell, you need to rerun this command to enter again at
6763 the virtual environment before building the documentation.
@@ -81,7 +77,7 @@ output. · 13 unmodified lines
8177 PDF and LaTeX builds
8278 --------------------
8379
84−Such builds are currently supported only with Sphinx versions 1.4 and higher.
80+Such builds are currently supported only with Sphinx versions 2.4 and higher.
8581
8682 For PDF and LaTeX output, you'll also need ``XeLaTeX`` version 3.14159265.
8783
@@ -104,8 +100,8 @@ command line options for your distro:: · 16 unmodified lines
104100 You should run:
105101
106102 sudo dnf install -y texlive-luatex85
107− /usr/bin/virtualenv sphinx_1.7.9
108− . sphinx_1.7.9/bin/activate
103+ /usr/bin/virtualenv sphinx_2.4.4
104+ . sphinx_2.4.4/bin/activate
109105 pip install -r Documentation/sphinx/requirements.txt
110106
111107 Can't build as 1 mandatory dependency is missing at ./scripts/sphinx-pre-install line 468.
Documentation/filesystems/autofs.rst+1−1
@@ -35,7 +35,7 @@ This document describes only the kernel module and the interactions · 34 unmodified lines
3535 required with any user-space program. Subsequent text refers to this
3636 as the "automount daemon" or simply "the daemon".
3737
38−"autofs" is a Linux kernel module with provides the "autofs"
38+"autofs" is a Linux kernel module which provides the "autofs"
3939 filesystem type. Several "autofs" filesystems can be mounted and they
4040 can each be managed separately, or all managed by the same daemon.
4141
Documentation/filesystems/cifs/ksmbd.rst+5−5
@@ -50,11 +50,11 @@ ksmbd.mountd (user space daemon) · 49 unmodified lines
5050 --------------------------------
5151
5252 ksmbd.mountd is userspace process to, transfer user account and password that
53−are registered using ksmbd.adduser(part of utils for user space). Further it
53+are registered using ksmbd.adduser (part of utils for user space). Further it
5454 allows sharing information parameters that parsed from smb.conf to ksmbd in
5555 kernel. For the execution part it has a daemon which is continuously running
5656 and connected to the kernel interface using netlink socket, it waits for the
57−requests(dcerpc and share/user info). It handles RPC calls (at a minimum few
57+requests (dcerpc and share/user info). It handles RPC calls (at a minimum few
5858 dozen) that are most important for file server from NetShareEnum and
5959 NetServerGetInfo. Complete DCE/RPC response is prepared from the user space
6060 and passed over to the associated kernel thread for the client.
@@ -154,11 +154,11 @@ Each layer · 93 unmodified lines
154154 1. Enable all component prints
155155 # sudo ksmbd.control -d "all"
156156
157−2. Enable one of components(smb, auth, vfs, oplock, ipc, conn, rdma)
157+2. Enable one of components (smb, auth, vfs, oplock, ipc, conn, rdma)
158158 # sudo ksmbd.control -d "smb"
159159
160−3. Show what prints are enable.
161− # cat/sys/class/ksmbd-control/debug
160+3. Show what prints are enabled.
161+ # cat /sys/class/ksmbd-control/debug
162162 [smb] auth vfs oplock ipc conn [rdma]
163163
164164 4. Disable prints:
Documentation/filesystems/netfs_library.rst+56−39
@@ -1,7 +1,7 @@
11 .. SPDX-License-Identifier: GPL-2.0
22
33 =================================
4−NETWORK FILESYSTEM HELPER LIBRARY
4+Network Filesystem Helper Library
55 =================================
66
77 .. Contents:
@@ -37,22 +37,22 @@ into a common call framework. · 29 unmodified lines
3737
3838 The following services are provided:
3939
40− * Handles transparent huge pages (THPs).
40+ * Handle folios that span multiple pages.
4141
42− * Insulates the netfs from VM interface changes.
42+ * Insulate the netfs from VM interface changes.
4343
44− * Allows the netfs to arbitrarily split reads up into pieces, even ones that
45− don't match page sizes or page alignments and that may cross pages.
44+ * Allow the netfs to arbitrarily split reads up into pieces, even ones that
45+ don't match folio sizes or folio alignments and that may cross folios.
4646
47− * Allows the netfs to expand a readahead request in both directions to meet
48− its needs.
47+ * Allow the netfs to expand a readahead request in both directions to meet its
48+ needs.
4949
50− * Allows the netfs to partially fulfil a read, which will then be resubmitted.
50+ * Allow the netfs to partially fulfil a read, which will then be resubmitted.
5151
52− * Handles local caching, allowing cached data and server-read data to be
52+ * Handle local caching, allowing cached data and server-read data to be
5353 interleaved for a single request.
5454
55− * Handles clearing of bufferage that aren't on the server.
55+ * Handle clearing of bufferage that aren't on the server.
5656
5757 * Handle retrying of reads that failed, switching reads from the cache to the
5858 server as necessary.
@@ -70,22 +70,22 @@ Read Helper Functions · 11 unmodified lines
7070
7171 Three read helpers are provided::
7272
73− * void netfs_readahead(struct readahead_control *ractl,
74− const struct netfs_read_request_ops *ops,
75− void *netfs_priv);``
76− * int netfs_readpage(struct file *file,
77− struct page *page,
78− const struct netfs_read_request_ops *ops,
79− void *netfs_priv);
80− * int netfs_write_begin(struct file *file,
81− struct address_space *mapping,
82− loff_t pos,
83− unsigned int len,
84− unsigned int flags,
85− struct page **_page,
86− void **_fsdata,
87− const struct netfs_read_request_ops *ops,
88− void *netfs_priv);
73+ void netfs_readahead(struct readahead_control *ractl,
74+ const struct netfs_read_request_ops *ops,
75+ void *netfs_priv);
76+ int netfs_readpage(struct file *file,
77+ struct folio *folio,
78+ const struct netfs_read_request_ops *ops,
79+ void *netfs_priv);
80+ int netfs_write_begin(struct file *file,
81+ struct address_space *mapping,
82+ loff_t pos,
83+ unsigned int len,
84+ unsigned int flags,
85+ struct folio **_folio,
86+ void **_fsdata,
87+ const struct netfs_read_request_ops *ops,
88+ void *netfs_priv);
8989
9090 Each corresponds to a VM operation, with the addition of a couple of parameters
9191 for the use of the read helpers:
@@ -103,8 +103,8 @@ Both of these values will be stored into the read request structure. · 11 unmodified lines
103103 For ->readahead() and ->readpage(), the network filesystem should just jump
104104 into the corresponding read helper; whereas for ->write_begin(), it may be a
105105 little more complicated as the network filesystem might want to flush
106−conflicting writes or track dirty data and needs to put the acquired page if an
107−error occurs after calling the helper.
106+conflicting writes or track dirty data and needs to put the acquired folio if
107+an error occurs after calling the helper.
108108
109109 The helpers manage the read request, calling back into the network filesystem
110110 through the suppplied table of operations. Waits will be performed as
@@ -253,7 +253,7 @@ through which it can issue requests and negotiate:: · 142 unmodified lines
253253 void (*issue_op)(struct netfs_read_subrequest *subreq);
254254 bool (*is_still_valid)(struct netfs_read_request *rreq);
255255 int (*check_write_begin)(struct file *file, loff_t pos, unsigned len,
256− struct page *page, void **_fsdata);
256+ struct folio *folio, void **_fsdata);
257257 void (*done)(struct netfs_read_request *rreq);
258258 void (*cleanup)(struct address_space *mapping, void *netfs_priv);
259259 };
@@ -313,13 +313,14 @@ The operations are as follows: · 53 unmodified lines
313313
314314 There is no return value; the netfs_subreq_terminated() function should be
315315 called to indicate whether or not the operation succeeded and how much data
316− it transferred. The filesystem also should not deal with setting pages
316+ it transferred. The filesystem also should not deal with setting folios
317317 uptodate, unlocking them or dropping their refs - the helpers need to deal
318318 with this as they have to coordinate with copying to the local cache.
319319
320− Note that the helpers have the pages locked, but not pinned. It is possible
321− to use the ITER_XARRAY iov iterator to refer to the range of the inode that
322− is being operated upon without the need to allocate large bvec tables.
320+ Note that the helpers have the folios locked, but not pinned. It is
321+ possible to use the ITER_XARRAY iov iterator to refer to the range of the
322+ inode that is being operated upon without the need to allocate large bvec
323+ tables.
323324
324325 * ``is_still_valid()``
325326
@@ -330,15 +331,15 @@ The operations are as follows: · 4 unmodified lines
330331 * ``check_write_begin()``
331332
332333 [Optional] This is called from the netfs_write_begin() helper once it has
333− allocated/grabbed the page to be modified to allow the filesystem to flush
334+ allocated/grabbed the folio to be modified to allow the filesystem to flush
334335 conflicting state before allowing it to be modified.
335336
336− It should return 0 if everything is now fine, -EAGAIN if the page should be
337+ It should return 0 if everything is now fine, -EAGAIN if the folio should be
337338 regrabbed and any other error code to abort the operation.
338339
339340 * ``done``
340341
341− [Optional] This is called after the pages in the request have all been
342+ [Optional] This is called after the folios in the request have all been
342343 unlocked (and marked uptodate if applicable).
343344
344345 * ``cleanup``
@@ -390,7 +391,7 @@ The read helpers work by the following general procedure: · 45 unmodified lines
390391 * If NETFS_SREQ_CLEAR_TAIL was set, a short read will be cleared to the
391392 end of the slice instead of reissuing.
392393
393− * Once the data is read, the pages that have been fully read/cleared:
394+ * Once the data is read, the folios that have been fully read/cleared:
394395
395396 * Will be marked uptodate.
396397
@@ -398,11 +399,11 @@ The read helpers work by the following general procedure: · 1 unmodified line
398399
399400 * Unlocked
400401
401− * Any pages that need writing to the cache will then have DIO writes issued.
402+ * Any folios that need writing to the cache will then have DIO writes issued.
402403
403404 * Synchronous operations will wait for reading to be complete.
404405
405− * Writes to the cache will proceed asynchronously and the pages will have the
406+ * Writes to the cache will proceed asynchronously and the folios will have the
406407 PG_fscache mark removed when that completes.
407408
408409 * The request structures will be cleaned up when everything has completed.
@@ -452,6 +453,9 @@ operation table looks like the following:: · 43 unmodified lines
452453 netfs_io_terminated_t term_func,
453454 void *term_func_priv);
454455
456+ int (*prepare_write)(struct netfs_cache_resources *cres,
457+ loff_t *_start, size_t *_len, loff_t i_size);
458+
455459 int (*write)(struct netfs_cache_resources *cres,
456460 loff_t start_pos,
457461 struct iov_iter *iter,
@@ -509,6 +513,14 @@ The methods defined in the table are: · 51 unmodified lines
509513 indicating whether the termination is definitely happening in the caller's
510514 context.
511515
516+ * ``prepare_write()``
517+
518+ [Required] Called to adjust a write to the cache and check that there is
519+ sufficient space in the cache. The start and length values indicate the
520+ size of the write that netfslib is proposing, and this can be adjusted by
521+ the cache to respect DIO boundaries. The file size is passed for
522+ information.
523+
512524 * ``write()``
513525
514526 [Required] Called to write to the cache. The start file offset is given
@@ -525,4 +537,9 @@ not the read request structure as they could be used in other situations where · 10 unmodified lines
525537 there isn't a read request structure as well, such as writing dirty data to the
526538 cache.
527539
540+
541+API Function Reference
542+======================
543+
528544 .. kernel-doc:: include/linux/netfs.h
545+.. kernel-doc:: fs/netfs/read_helper.c
Documentation/i2c/smbus-protocol.rst+8−6
@@ -36,6 +36,8 @@ Key to symbols · 35 unmodified lines
3636
3737 =============== =============================================================
3838 S Start condition
39+Sr Repeated start condition, used to switch from write to
40+ read mode.
3941 P Stop condition
4042 Rd/Wr (1 bit) Read/Write bit. Rd equals 1, Wr equals 0.
4143 A, NA (1 bit) Acknowledge (ACK) and Not Acknowledge (NACK) bit
@@ -100,7 +102,7 @@ Implemented by i2c_smbus_read_byte_data() · 58 unmodified lines
100102 This reads a single byte from a device, from a designated register.
101103 The register is specified through the Comm byte::
102104
103− S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P
105+ S Addr Wr [A] Comm [A] Sr Addr Rd [A] [Data] NA P
104106
105107 Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA
106108
@@ -114,7 +116,7 @@ This operation is very like Read Byte; again, data is read from a · 7 unmodified lines
114116 device, from a designated register that is specified through the Comm
115117 byte. But this time, the data is a complete word (16 bits)::
116118
117− S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P
119+ S Addr Wr [A] Comm [A] Sr Addr Rd [A] [DataLow] A [DataHigh] NA P
118120
119121 Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA
120122
@@ -164,7 +166,7 @@ This command selects a device register (through the Comm byte), sends · 43 unmodified lines
164166 16 bits of data to it, and reads 16 bits of data in return::
165167
166168 S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A]
167− S Addr Rd [A] [DataLow] A [DataHigh] NA P
169+ Sr Addr Rd [A] [DataLow] A [DataHigh] NA P
168170
169171 Functionality flag: I2C_FUNC_SMBUS_PROC_CALL
170172
@@ -181,7 +183,7 @@ of data is specified by the device in the Count byte. · 10 unmodified lines
181183 ::
182184
183185 S Addr Wr [A] Comm [A]
184− S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P
186+ Sr Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P
185187
186188 Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA
187189
@@ -212,7 +214,7 @@ This command selects a device register (through the Comm byte), sends · 24 unmodified lines
212214 1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return::
213215
214216 S Addr Wr [A] Comm [A] Count [A] Data [A] ...
215− S Addr Rd [A] [Count] A [Data] ... A P
217+ Sr Addr Rd [A] [Count] A [Data] ... A P
216218
217219 Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL
218220
@@ -300,7 +302,7 @@ This command reads a block of bytes from a device, from a · 81 unmodified lines
300302 designated register that is specified through the Comm byte::
301303
302304 S Addr Wr [A] Comm [A]
303− S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
305+ Sr Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
304306
305307 Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK
306308
Documentation/locking/locktypes.rst+3−6
@@ -439,11 +439,9 @@ preemption. The following substitution works on both kernels:: · 438 unmodified lines
439439 spin_lock(&p->lock);
440440 p->count += this_cpu_read(var2);
441441
442−On a non-PREEMPT_RT kernel migrate_disable() maps to preempt_disable()
443−which makes the above code fully equivalent. On a PREEMPT_RT kernel
444442 migrate_disable() ensures that the task is pinned on the current CPU which
445443 in turn guarantees that the per-CPU access to var1 and var2 are staying on
446−the same CPU.
444+the same CPU while the task remains preemptible.
447445
448446 The migrate_disable() substitution is not valid for the following
449447 scenario::
@@ -456,9 +454,8 @@ scenario:: · 6 unmodified lines
456454 p = this_cpu_ptr(&var1);
457455 p->val = func2();
458456
459−While correct on a non-PREEMPT_RT kernel, this breaks on PREEMPT_RT because
460−here migrate_disable() does not protect against reentrancy from a
461−preempting task. A correct substitution for this case is::
457+This breaks because migrate_disable() does not protect against reentrancy from
458+a preempting task. A correct substitution for this case is::
462459
463460 func()
464461 {
Documentation/networking/ipvs-sysctl.rst+1−2
@@ -37,8 +37,7 @@ conn_reuse_mode - INTEGER · 36 unmodified lines
3737
3838 0: disable any special handling on port reuse. The new
3939 connection will be delivered to the same real server that was
40− servicing the previous connection. This will effectively
41− disable expire_nodest_conn.
40+ servicing the previous connection.
4241
4342 bit 1: enable rescheduling of new connections when it is safe.
4443 That is, whenever expire_nodest_conn and for TCP sockets, when
Documentation/networking/timestamping.rst+2−2
@@ -486,8 +486,8 @@ of packets. · 485 unmodified lines
486486 Drivers are free to use a more permissive configuration than the requested
487487 configuration. It is expected that drivers should only implement directly the
488488 most generic mode that can be supported. For example if the hardware can
489−support HWTSTAMP_FILTER_V2_EVENT, then it should generally always upscale
490−HWTSTAMP_FILTER_V2_L2_SYNC_MESSAGE, and so forth, as HWTSTAMP_FILTER_V2_EVENT
489+support HWTSTAMP_FILTER_PTP_V2_EVENT, then it should generally always upscale
490+HWTSTAMP_FILTER_PTP_V2_L2_SYNC, and so forth, as HWTSTAMP_FILTER_PTP_V2_EVENT
491491 is more generic (and more useful to applications).
492492
493493 A driver which supports hardware time stamping shall update the struct
Documentation/power/energy-model.rst+38−15
@@ -84,6 +84,16 @@ CONFIG_ENERGY_MODEL must be enabled to use the EM framework. · 83 unmodified lines
8484 2.2 Registration of performance domains
8585 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8686
87+Registration of 'advanced' EM
88+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89+
90+The 'advanced' EM gets it's name due to the fact that the driver is allowed
91+to provide more precised power model. It's not limited to some implemented math
92+formula in the framework (like it's in 'simple' EM case). It can better reflect
93+the real power measurements performed for each performance state. Thus, this
94+registration method should be preferred in case considering EM static power
95+(leakage) is important.
96+
8797 Drivers are expected to register performance domains into the EM framework by
8898 calling the following API::
8999
@@ -103,6 +113,18 @@ to: return warning/error, stop working or panic. · 13 unmodified lines
103113 See Section 3. for an example of driver implementing this
104114 callback, or Section 2.4 for further documentation on this API
105115
116+Registration of 'simple' EM
117+~~~~~~~~~~~~~~~~~~~~~~~~~~~
118+
119+The 'simple' EM is registered using the framework helper function
120+cpufreq_register_em_with_opp(). It implements a power model which is tight to
121+math formula::
122+
123+ Power = C * V^2 * f
124+
125+The EM which is registered using this method might not reflect correctly the
126+physics of a real device, e.g. when static power (leakage) is important.
127+
106128
107129 2.3 Accessing performance domains
108130 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -138,6 +160,10 @@ or in Section 2.4 · 29 unmodified lines
138160 3. Example driver
139161 -----------------
140162
163+The CPUFreq framework supports dedicated callback for registering
164+the EM for a given CPU(s) 'policy' object: cpufreq_driver::register_em().
165+That callback has to be implemented properly for a given driver,
166+because the framework would call it at the right time during setup.
141167 This section provides a simple example of a CPUFreq driver registering a
142168 performance domain in the Energy Model framework using the (fake) 'foo'
143169 protocol. The driver implements an est_power() function to be provided to the
@@ -167,25 +193,22 @@ EM framework:: · 23 unmodified lines
167193 20 return 0;
168194 21 }
169195 22
170− 23 static int foo_cpufreq_init(struct cpufreq_policy *policy)
196+ 23 static void foo_cpufreq_register_em(struct cpufreq_policy *policy)
171197 24 {
172198 25 struct em_data_callback em_cb = EM_DATA_CB(est_power);
173199 26 struct device *cpu_dev;
174− 27 int nr_opp, ret;
200+ 27 int nr_opp;
175201 28
176202 29 cpu_dev = get_cpu_device(cpumask_first(policy->cpus));
177203 30
178− 31 /* Do the actual CPUFreq init work ... */
179− 32 ret = do_foo_cpufreq_init(policy);
180− 33 if (ret)
181− 34 return ret;
182− 35
183− 36 /* Find the number of OPPs for this policy */
184− 37 nr_opp = foo_get_nr_opp(policy);
204+ 31 /* Find the number of OPPs for this policy */
205+ 32 nr_opp = foo_get_nr_opp(policy);
206+ 33
207+ 34 /* And register the new performance domain */
208+ 35 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus,
209+ 36 true);
210+ 37 }
185211 38
186− 39 /* And register the new performance domain */
187− 40 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus,
188− 41 true);
189− 42
190− 43 return 0;
191− 44 }
212+ 39 static struct cpufreq_driver foo_cpufreq_driver = {
213+ 40 .register_em = foo_cpufreq_register_em,
214+ 41 };
Documentation/process/changes.rst+12−1
@@ -35,6 +35,7 @@ GNU make 3.81 make --version · 34 unmodified lines
3535 binutils 2.23 ld -v
3636 flex 2.5.35 flex --version
3737 bison 2.0 bison --version
38+pahole 1.16 pahole --version
3839 util-linux 2.10o fdformat --version
3940 kmod 13 depmod -V
4041 e2fsprogs 1.41.4 e2fsck -V
@@ -54,7 +55,7 @@ mcelog 0.6 mcelog --version · 13 unmodified lines
5455 iptables 1.4.2 iptables -V
5556 openssl & libcrypto 1.0.0 openssl version
5657 bc 1.06.95 bc --version
57−Sphinx\ [#f1]_ 1.3 sphinx-build --version
58+Sphinx\ [#f1]_ 1.7 sphinx-build --version
5859 ====================== =============== ========================================
5960
6061 .. [#f1] Sphinx is needed only to build the Kernel documentation
@@ -108,6 +109,16 @@ Bison · 47 unmodified lines
108109 Since Linux 4.16, the build system generates parsers
109110 during build. This requires bison 2.0 or later.
110111
112+pahole:
113+-------
114+
115+Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system
116+generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel
117+modules as well. This requires pahole v1.16 or later.
118+
119+It is found in the 'dwarves' or 'pahole' distro packages or from
120+https://fedorapeople.org/~acme/dwarves/.
121+
111122 Perl
112123 ----
113124
Documentation/process/submitting-patches.rst+4−3
@@ -14,7 +14,8 @@ works, see Documentation/process/development-process.rst. Also, read · 13 unmodified lines
1414 Documentation/process/submit-checklist.rst
1515 for a list of items to check before submitting code. If you are submitting
1616 a driver, also read Documentation/process/submitting-drivers.rst; for device
17−tree binding patches, read Documentation/process/submitting-patches.rst.
17+tree binding patches, read
18+Documentation/devicetree/bindings/submitting-patches.rst.
1819
1920 This documentation assumes that you're using ``git`` to prepare your patches.
2021 If you're unfamiliar with ``git``, you would be well-advised to learn how to
@@ -22,8 +23,8 @@ use it, it will make your life as a kernel developer and in general much · 1 unmodified line
2223 easier.
2324
2425 Some subsystems and maintainer trees have additional information about
25−their workflow and expectations, see :ref:`Documentation/process/maintainer
26−handbooks <maintainer_handbooks_main>`.
26+their workflow and expectations, see
27+:ref:`Documentation/process/maintainer-handbooks.rst <maintainer_handbooks_main>`.
2728
2829 Obtain a current source tree
2930 ----------------------------
Documentation/trace/ftrace.rst+4−5
@@ -2442,11 +2442,10 @@ Or this simple script! · 2441 unmodified lines
24422442 #!/bin/bash
24432443
24442444 tracefs=`sed -ne 's/^tracefs \(.*\) tracefs.*/\1/p' /proc/mounts`
2445− echo nop > $tracefs/tracing/current_tracer
2446− echo 0 > $tracefs/tracing/tracing_on
2447− echo $$ > $tracefs/tracing/set_ftrace_pid
2448− echo function > $tracefs/tracing/current_tracer
2449− echo 1 > $tracefs/tracing/tracing_on
2445+ echo 0 > $tracefs/tracing_on
2446+ echo $$ > $tracefs/set_ftrace_pid
2447+ echo function > $tracefs/current_tracer
2448+ echo 1 > $tracefs/tracing_on
24502449 exec "$@"
24512450
24522451
Documentation/translations/it_IT/doc-guide/sphinx.rst+9−14
@@ -35,7 +35,7 @@ Installazione Sphinx · 34 unmodified lines
3535 ====================
3636
3737 I marcatori ReST utilizzati nei file in Documentation/ sono pensati per essere
38−processati da ``Sphinx`` nella versione 1.3 o superiore.
38+processati da ``Sphinx`` nella versione 1.7 o superiore.
3939
4040 Esiste uno script che verifica i requisiti Sphinx. Per ulteriori dettagli
4141 consultate :ref:`it_sphinx-pre-install`.
@@ -53,11 +53,6 @@ pacchettizzato dalla vostra distribuzione. · 11 unmodified lines
5353
5454 .. note::
5555
56− #) Le versioni di Sphinx inferiori alla 1.5 non funzionano bene
57− con il pacchetto Python docutils versione 0.13.1 o superiore.
58− Se volete usare queste versioni, allora dovere eseguire
59− ``pip install 'docutils==0.12'``.
60−
6156 #) Viene raccomandato l'uso del tema RTD per la documentazione in HTML.
6257 A seconda della versione di Sphinx, potrebbe essere necessaria
6358 l'installazione tramite il comando ``pip install sphinx_rtd_theme``.
@@ -67,13 +62,13 @@ pacchettizzato dalla vostra distribuzione. · 3 unmodified lines
6762 utilizzando LaTeX. Per una corretta interpretazione, è necessario aver
6863 installato texlive con i pacchetti amdfonts e amsmath.
6964
70−Riassumendo, se volete installare la versione 1.7.9 di Sphinx dovete eseguire::
65+Riassumendo, se volete installare la versione 2.4.4 di Sphinx dovete eseguire::
7166
72− $ virtualenv sphinx_1.7.9
73− $ . sphinx_1.7.9/bin/activate
74− (sphinx_1.7.9) $ pip install -r Documentation/sphinx/requirements.txt
67+ $ virtualenv sphinx_2.4.4
68+ $ . sphinx_2.4.4/bin/activate
69+ (sphinx_2.4.4) $ pip install -r Documentation/sphinx/requirements.txt
7570
76−Dopo aver eseguito ``. sphinx_1.7.9/bin/activate``, il prompt cambierà per
71+Dopo aver eseguito ``. sphinx_2.4.4/bin/activate``, il prompt cambierà per
7772 indicare che state usando il nuovo ambiente. Se aprite un nuova sessione,
7873 prima di generare la documentazione, dovrete rieseguire questo comando per
7974 rientrare nell'ambiente virtuale.
@@ -94,7 +89,7 @@ Generazione in PDF e LaTeX · 14 unmodified lines
9489 --------------------------
9590
9691 Al momento, la generazione di questi documenti è supportata solo dalle
97−versioni di Sphinx superiori alla 1.4.
92+versioni di Sphinx superiori alla 2.4.
9893
9994 Per la generazione di PDF e LaTeX, avrete bisogno anche del pacchetto
10095 ``XeLaTeX`` nella versione 3.14159265
@@ -119,8 +114,8 @@ l'installazione:: · 18 unmodified lines
119114 You should run:
120115
121116 sudo dnf install -y texlive-luatex85
122− /usr/bin/virtualenv sphinx_1.7.9
123− . sphinx_1.7.9/bin/activate
117+ /usr/bin/virtualenv sphinx_2.4.4
118+ . sphinx_2.4.4/bin/activate
124119 pip install -r Documentation/sphinx/requirements.txt
125120
126121 Can't build as 1 mandatory dependency is missing at ./scripts/sphinx-pre-install line 468.
Documentation/translations/it_IT/process/changes.rst+1−1
@@ -57,7 +57,7 @@ mcelog 0.6 mcelog --version · 56 unmodified lines
5757 iptables 1.4.2 iptables -V
5858 openssl & libcrypto 1.0.0 openssl version
5959 bc 1.06.95 bc --version
60−Sphinx\ [#f1]_ 1.3 sphinx-build --version
60+Sphinx\ [#f1]_ 1.7 sphinx-build --version
6161 ====================== ================= ========================================
6262
6363 .. [#f1] Sphinx è necessario solo per produrre la documentazione del Kernel
Documentation/translations/zh_CN/doc-guide/sphinx.rst+9−12
@@ -26,7 +26,7 @@ reStructuredText文件可能包含包含来自源文件的结构化文档注释 · 25 unmodified lines
2626 安装Sphinx
2727 ==========
2828
29−Documentation/ 下的ReST文件现在使用sphinx1.3或更高版本构建。
29+Documentation/ 下的ReST文件现在使用sphinx1.7或更高版本构建。
3030
3131 这有一个脚本可以检查Sphinx的依赖项。更多详细信息见
3232 :ref:`sphinx-pre-install_zh` 。
@@ -40,22 +40,19 @@ Documentation/ 下的ReST文件现在使用sphinx1.3或更高版本构建。 · 7 unmodified lines
4040
4141 .. note::
4242
43− #) 低于1.5版本的Sphinx无法与Python的0.13.1或更高版本docutils一起正常工作。
44− 如果您想使用这些版本,那么应该运行 ``pip install 'docutils==0.12'`` 。
45−
4643 #) html输出建议使用RTD主题。根据Sphinx版本的不同,它应该用
4744 ``pip install sphinx_rtd_theme`` 单独安装。
4845
4946 #) 一些ReST页面包含数学表达式。由于Sphinx的工作方式,这些表达式是使用 LaTeX
5047 编写的。它需要安装amsfonts和amsmath宏包,以便显示。
5148
52−总之,如您要安装Sphinx 1.7.9版本,应执行::
49+总之,如您要安装Sphinx 2.4.4版本,应执行::
5350
54− $ virtualenv sphinx_1.7.9
55− $ . sphinx_1.7.9/bin/activate
56− (sphinx_1.7.9) $ pip install -r Documentation/sphinx/requirements.txt
51+ $ virtualenv sphinx_2.4.4
52+ $ . sphinx_2.4.4/bin/activate
53+ (sphinx_2.4.4) $ pip install -r Documentation/sphinx/requirements.txt
5754
58−在运行 ``. sphinx_1.7.9/bin/activate`` 之后,提示符将变化,以指示您正在使用新
55+在运行 ``. sphinx_2.4.4/bin/activate`` 之后,提示符将变化,以指示您正在使用新
5956 环境。如果您打开了一个新的shell,那么在构建文档之前,您需要重新运行此命令以再
6057 次进入虚拟环境中。
6158
@@ -71,7 +68,7 @@ Documentation/ 下的ReST文件现在使用sphinx1.3或更高版本构建。 · 9 unmodified lines
7168 PDF和LaTeX构建
7269 --------------
7370
74−目前只有Sphinx 1.4及更高版本才支持这种构建。
71+目前只有Sphinx 2.4及更高版本才支持这种构建。
7572
7673 对于PDF和LaTeX输出,还需要 ``XeLaTeX`` 3.14159265版本。(译注:此版本号真实
7774 存在)
@@ -93,8 +90,8 @@ PDF和LaTeX构建 · 15 unmodified lines
9390 You should run:
9491
9592 sudo dnf install -y texlive-luatex85
96− /usr/bin/virtualenv sphinx_1.7.9
97− . sphinx_1.7.9/bin/activate
93+ /usr/bin/virtualenv sphinx_2.4.4
94+ . sphinx_2.4.4/bin/activate
9895 pip install -r Documentation/sphinx/requirements.txt
9996
10097 Can't build as 1 mandatory dependency is missing at ./scripts/sphinx-pre-install line 468.
Documentation/translations/zh_CN/process/management-style.rst+2−2
@@ -36,14 +36,14 @@ Linux内核管理风格 · 35 unmodified lines
3636 每个人都认为管理者做决定,而且决策很重要。决定越大越痛苦,管理者就必须越高级。
3737 这很明显,但事实并非如此。
3838
39−游戏的名字是 **避免** 做出决定。尤其是,如果有人告诉你“选择(a)或(b),
39+最重要的是 **避免** 做出决定。尤其是,如果有人告诉你“选择(a)或(b),
4040 我们真的需要你来做决定”,你就是陷入麻烦的管理者。你管理的人比你更了解细节,
4141 所以如果他们来找你做技术决策,你完蛋了。你显然没有能力为他们做这个决定。
4242
4343 (推论:如果你管理的人不比你更了解细节,你也会被搞砸,尽管原因完全不同。
4444 也就是说,你的工作是错的,他们应该管理你的才智)
4545
46−所以游戏的名字是 **避免** 做出决定,至少是那些大而痛苦的决定。做一些小的
46+所以最重要的是 **避免** 做出决定,至少是那些大而痛苦的决定。做一些小的
4747 和非结果性的决定是很好的,并且使您看起来好像知道自己在做什么,所以内核管理者
4848 需要做的是将那些大的和痛苦的决定变成那些没有人真正关心的小事情。
4949
MAINTAINERS+44−15
@@ -2263,6 +2263,15 @@ L: linux-iio@vger.kernel.org · 2262 unmodified lines
22632263 S: Maintained
22642264 F: drivers/counter/microchip-tcb-capture.c
22652265
2266+ARM/MILBEAUT ARCHITECTURE
2267+M: Taichi Sugaya <sugaya.taichi@socionext.com>
2268+M: Takao Orito <orito.takao@socionext.com>
2269+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2270+S: Maintained
2271+F: arch/arm/boot/dts/milbeaut*
2272+F: arch/arm/mach-milbeaut/
2273+N: milbeaut
2274+
22662275 ARM/MIOA701 MACHINE SUPPORT
22672276 M: Robert Jarzmik <robert.jarzmik@free.fr>
22682277 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -2729,10 +2738,11 @@ S: Maintained · 460 unmodified lines
27292738 F: drivers/memory/*emif*
27302739
27312740 ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
2741+M: Nishanth Menon <nm@ti.com>
27322742 M: Santosh Shilimkar <ssantosh@kernel.org>
27332743 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
27342744 S: Maintained
2735−T: git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
2745+T: git git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
27362746 F: arch/arm/boot/dts/keystone-*
27372747 F: arch/arm/mach-keystone/
27382748
@@ -3570,13 +3580,14 @@ L: netdev@vger.kernel.org · 831 unmodified lines
35703580 S: Supported
35713581 F: drivers/net/ethernet/broadcom/b44.*
35723582
3573−BROADCOM B53 ETHERNET SWITCH DRIVER
3583+BROADCOM B53/SF2 ETHERNET SWITCH DRIVER
35743584 M: Florian Fainelli <f.fainelli@gmail.com>
35753585 L: netdev@vger.kernel.org
35763586 L: openwrt-devel@lists.openwrt.org (subscribers-only)
35773587 S: Supported
35783588 F: Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
35793589 F: drivers/net/dsa/b53/*
3590+F: drivers/net/dsa/bcm_sf2*
35803591 F: include/linux/dsa/brcm.h
35813592 F: include/linux/platform_data/b53.h
35823593
@@ -3733,7 +3744,7 @@ F: drivers/scsi/bnx2i/ · 150 unmodified lines
37333744 BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
37343745 M: Ariel Elior <aelior@marvell.com>
37353746 M: Sudarsana Kalluru <skalluru@marvell.com>
3736−M: GR-everest-linux-l2@marvell.com
3747+M: Manish Chopra <manishc@marvell.com>
37373748 L: netdev@vger.kernel.org
37383749 S: Supported
37393750 F: drivers/net/ethernet/broadcom/bnx2x/
@@ -9318,7 +9329,6 @@ S: Maintained · 5578 unmodified lines
93189329 F: drivers/iio/pressure/dps310.c
93199330
93209331 INFINIBAND SUBSYSTEM
9321−M: Doug Ledford <dledford@redhat.com>
93229332 M: Jason Gunthorpe <jgg@nvidia.com>
93239333 L: linux-rdma@vger.kernel.org
93249334 S: Supported
@@ -10269,9 +10279,9 @@ F: lib/Kconfig.kcsan · 944 unmodified lines
1026910279 F: scripts/Makefile.kcsan
1027010280
1027110281 KDUMP
10272−M: Dave Young <dyoung@redhat.com>
1027310282 M: Baoquan He <bhe@redhat.com>
1027410283 R: Vivek Goyal <vgoyal@redhat.com>
10284+R: Dave Young <dyoung@redhat.com>
1027510285 L: kexec@lists.infradead.org
1027610286 S: Maintained
1027710287 W: http://lse.sourceforge.net/kdump/
@@ -10445,7 +10455,7 @@ F: arch/riscv/include/uapi/asm/kvm* · 167 unmodified lines
1044510455 F: arch/riscv/kvm/
1044610456
1044710457 KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
10448−M: Christian Borntraeger <borntraeger@de.ibm.com>
10458+M: Christian Borntraeger <borntraeger@linux.ibm.com>
1044910459 M: Janosch Frank <frankja@linux.ibm.com>
1045010460 R: David Hildenbrand <david@redhat.com>
1045110461 R: Claudio Imbrenda <imbrenda@linux.ibm.com>
@@ -12169,8 +12179,8 @@ F: drivers/net/ethernet/mellanox/mlx5/core/fpga/* · 1717 unmodified lines
1216912179 F: include/linux/mlx5/mlx5_ifc_fpga.h
1217012180
1217112181 MELLANOX ETHERNET SWITCH DRIVERS
12172−M: Jiri Pirko <jiri@nvidia.com>
1217312182 M: Ido Schimmel <idosch@nvidia.com>
12183+M: Petr Machata <petrm@nvidia.com>
1217412184 L: netdev@vger.kernel.org
1217512185 S: Supported
1217612186 W: http://www.mellanox.com
@@ -15593,7 +15603,7 @@ F: drivers/scsi/qedi/ · 3416 unmodified lines
1559315603
1559415604 QLOGIC QL4xxx ETHERNET DRIVER
1559515605 M: Ariel Elior <aelior@marvell.com>
15596−M: GR-everest-linux-l2@marvell.com
15606+M: Manish Chopra <manishc@marvell.com>
1559715607 L: netdev@vger.kernel.org
1559815608 S: Supported
1559915609 F: drivers/net/ethernet/qlogic/qed/
@@ -15760,6 +15770,15 @@ S: Maintained · 160 unmodified lines
1576015770 F: Documentation/devicetree/bindings/net/qcom,ethqos.txt
1576115771 F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
1576215772
15773+QUALCOMM FASTRPC DRIVER
15774+M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
15775+M: Amol Maheshwari <amahesh@qti.qualcomm.com>
15776+L: linux-arm-msm@vger.kernel.org
15777+S: Maintained
15778+F: Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
15779+F: drivers/misc/fastrpc.c
15780+F: include/uapi/misc/fastrpc.h
15781+
1576315782 QUALCOMM GENERIC INTERFACE I2C DRIVER
1576415783 M: Akash Asthana <akashast@codeaurora.org>
1576515784 M: Mukesh Savaliya <msavaliy@codeaurora.org>
@@ -15968,6 +15987,7 @@ F: arch/mips/generic/board-ranchu.c · 202 unmodified lines
1596815987
1596915988 RANDOM NUMBER DRIVER
1597015989 M: "Theodore Ts'o" <tytso@mit.edu>
15990+M: Jason A. Donenfeld <Jason@zx2c4.com>
1597115991 S: Maintained
1597215992 F: drivers/char/random.c
1597315993
@@ -16490,6 +16510,12 @@ T: git git://linuxtv.org/media_tree.git · 516 unmodified lines
1649016510 F: Documentation/devicetree/bindings/media/allwinner,sun8i-a83t-de2-rotate.yaml
1649116511 F: drivers/media/platform/sunxi/sun8i-rotate/
1649216512
16513+RPMSG TTY DRIVER
16514+M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
16515+L: linux-remoteproc@vger.kernel.org
16516+S: Maintained
16517+F: drivers/tty/rpmsg_tty.c
16518+
1649316519 RTL2830 MEDIA DRIVER
1649416520 M: Antti Palosaari <crope@iki.fi>
1649516521 L: linux-media@vger.kernel.org
@@ -16573,7 +16599,7 @@ F: drivers/video/fbdev/savage/ · 77 unmodified lines
1657316599 S390
1657416600 M: Heiko Carstens <hca@linux.ibm.com>
1657516601 M: Vasily Gorbik <gor@linux.ibm.com>
16576−M: Christian Borntraeger <borntraeger@de.ibm.com>
16602+M: Christian Borntraeger <borntraeger@linux.ibm.com>
1657716603 R: Alexander Gordeev <agordeev@linux.ibm.com>
1657816604 L: linux-s390@vger.kernel.org
1657916605 S: Supported
@@ -16611,8 +16637,8 @@ W: http://www.ibm.com/developerworks/linux/linux390/ · 31 unmodified lines
1661116637 F: drivers/iommu/s390-iommu.c
1661216638
1661316639 S390 IUCV NETWORK LAYER
16614−M: Julian Wiedmann <jwi@linux.ibm.com>
16615−M: Karsten Graul <kgraul@linux.ibm.com>
16640+M: Alexandra Winter <wintera@linux.ibm.com>
16641+M: Wenjia Zhang <wenjia@linux.ibm.com>
1661616642 L: linux-s390@vger.kernel.org
1661716643 L: netdev@vger.kernel.org
1661816644 S: Supported
@@ -16622,8 +16648,8 @@ F: include/net/iucv/ · 3 unmodified lines
1662216648 F: net/iucv/
1662316649
1662416650 S390 NETWORK DRIVERS
16625−M: Julian Wiedmann <jwi@linux.ibm.com>
16626−M: Karsten Graul <kgraul@linux.ibm.com>
16651+M: Alexandra Winter <wintera@linux.ibm.com>
16652+M: Wenjia Zhang <wenjia@linux.ibm.com>
1662716653 L: linux-s390@vger.kernel.org
1662816654 L: netdev@vger.kernel.org
1662916655 S: Supported
@@ -18483,6 +18509,7 @@ F: include/uapi/linux/pkt_sched.h · 1853 unmodified lines
1848318509 F: include/uapi/linux/tc_act/
1848418510 F: include/uapi/linux/tc_ematch/
1848518511 F: net/sched/
18512+F: tools/testing/selftests/tc-testing
1848618513
1848718514 TC90522 MEDIA DRIVER
1848818515 M: Akihiro Tsukada <tskd08@gmail.com>
@@ -19031,11 +19058,12 @@ F: drivers/mmc/host/tifm_sd.c · 542 unmodified lines
1903119058 F: include/linux/tifm.h
1903219059
1903319060 TI KEYSTONE MULTICORE NAVIGATOR DRIVERS
19061+M: Nishanth Menon <nm@ti.com>
1903419062 M: Santosh Shilimkar <ssantosh@kernel.org>
1903519063 L: linux-kernel@vger.kernel.org
1903619064 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1903719065 S: Maintained
19038−T: git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
19066+T: git git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
1903919067 F: drivers/soc/ti/*
1904019068
1904119069 TI LM49xxx FAMILY ASoC CODEC DRIVERS
@@ -20317,7 +20345,8 @@ F: arch/x86/include/asm/vmware.h · 1275 unmodified lines
2031720345 F: arch/x86/kernel/cpu/vmware.c
2031820346
2031920347 VMWARE PVRDMA DRIVER
20320−M: Adit Ranadive <aditr@vmware.com>
20348+M: Bryan Tan <bryantan@vmware.com>
20349+M: Vishnu Dasa <vdasa@vmware.com>
2032120350 M: VMware PV-Drivers <pv-drivers@vmware.com>
2032220351 L: linux-rdma@vger.kernel.org
2032320352 S: Maintained
Makefile+8−8
@@ -2,8 +2,8 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 16
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
6−NAME = Trick or Treat
5+EXTRAVERSION = -rc5
6+NAME = Gobble Gobble
77
88 # *DOCUMENTATION*
99 # To see a list of typical targets execute "make help"
@@ -789,7 +789,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong · 779 unmodified lines
789789 KBUILD_CFLAGS += $(stackp-flags-y)
790790
791791 KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
792−KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
792+KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH:"%"=%)
793793
794794 ifdef CONFIG_CC_IS_CLANG
795795 KBUILD_CPPFLAGS += -Qunused-arguments
@@ -1374,17 +1374,17 @@ endif · 578 unmodified lines
13741374
13751375 ifneq ($(dtstree),)
13761376
1377−%.dtb: dt_binding_check include/config/kernel.release scripts_dtc
1378− $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml
1377+%.dtb: include/config/kernel.release scripts_dtc
1378+ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
13791379
1380−%.dtbo: dt_binding_check include/config/kernel.release scripts_dtc
1381− $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml
1380+%.dtbo: include/config/kernel.release scripts_dtc
1381+ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
13821382
13831383 PHONY += dtbs dtbs_install dtbs_check
13841384 dtbs: include/config/kernel.release scripts_dtc
13851385 $(Q)$(MAKE) $(build)=$(dtstree)
13861386
1387−ifneq ($(filter dtbs_check %.dtb %.dtbo, $(MAKECMDGOALS)),)
1387+ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
13881388 export CHECK_DTBS=y
13891389 dtbs: dt_binding_check
13901390 endif
arch/Kconfig+10−0
@@ -991,6 +991,16 @@ config HAVE_ARCH_COMPAT_MMAP_BASES · 990 unmodified lines
991991 and vice-versa 32-bit applications to call 64-bit mmap().
992992 Required for applications doing different bitness syscalls.
993993
994+config PAGE_SIZE_LESS_THAN_64KB
995+ def_bool y
996+ depends on !ARM64_64K_PAGES
997+ depends on !IA64_PAGE_SIZE_64KB
998+ depends on !PAGE_SIZE_64KB
999+ depends on !PARISC_PAGE_SIZE_64KB
1000+ depends on !PPC_64K_PAGES
1001+ depends on !PPC_256K_PAGES
1002+ depends on !PAGE_SIZE_256KB
1003+
9941004 # This allows to use a set of generic functions to determine mmap base
9951005 # address by giving priority to top-down scheme only if the process
9961006 # is not in legacy mode (compat task, unlimited stack size or
arch/alpha/kernel/syscalls/syscall.tbl+1−0
@@ -488,3 +488,4 @@ · 487 unmodified lines
488488 556 common landlock_restrict_self sys_landlock_restrict_self
489489 # 557 reserved for memfd_secret
490490 558 common process_mrelease sys_process_mrelease
491+559 common futex_waitv sys_futex_waitv
arch/arc/include/asm/cacheflush.h+0−1
@@ -36,7 +36,6 @@ void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr); · 35 unmodified lines
3636 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
3737
3838 void flush_dcache_page(struct page *page);
39−void flush_dcache_folio(struct folio *folio);
4039
4140 void dma_cache_wback_inv(phys_addr_t start, unsigned long sz);
4241 void dma_cache_inv(phys_addr_t start, unsigned long sz);
arch/arm/Kconfig+1−0
@@ -1463,6 +1463,7 @@ config HIGHMEM · 1462 unmodified lines
14631463 bool "High Memory Support"
14641464 depends on MMU
14651465 select KMAP_LOCAL
1466+ select KMAP_LOCAL_NON_LINEAR_PTE_ARRAY
14661467 help
14671468 The address space of ARM processors is only 4 Gigabytes large
14681469 and it has to accommodate user address space, kernel address
arch/arm/boot/dts/bcm2711.dtsi+7−1
@@ -506,11 +506,17 @@ · 505 unmodified lines
506506 #address-cells = <3>;
507507 #interrupt-cells = <1>;
508508 #size-cells = <2>;
509− interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
509+ interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
510510 <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
511511 interrupt-names = "pcie", "msi";
512512 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
513513 interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143
514+ IRQ_TYPE_LEVEL_HIGH>,
515+ <0 0 0 2 &gicv2 GIC_SPI 144
516+ IRQ_TYPE_LEVEL_HIGH>,
517+ <0 0 0 3 &gicv2 GIC_SPI 145
518+ IRQ_TYPE_LEVEL_HIGH>,
519+ <0 0 0 4 &gicv2 GIC_SPI 146
514520 IRQ_TYPE_LEVEL_HIGH>;
515521 msi-controller;
516522 msi-parent = <&pcie0>;
arch/arm/boot/dts/bcm5301x.dtsi+3−1
@@ -242,6 +242,8 @@ · 241 unmodified lines
242242
243243 gpio-controller;
244244 #gpio-cells = <2>;
245+ interrupt-controller;
246+ #interrupt-cells = <2>;
245247 };
246248
247249 pcie0: pcie@12000 {
@@ -408,7 +410,7 @@ · 160 unmodified lines
408410 i2c0: i2c@18009000 {
409411 compatible = "brcm,iproc-i2c";
410412 reg = <0x18009000 0x50>;
411− interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
413+ interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
412414 #address-cells = <1>;
413415 #size-cells = <0>;
414416 clock-frequency = <100000>;
arch/arm/include/asm/cacheflush.h+0−1
@@ -290,7 +290,6 @@ extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr · 289 unmodified lines
290290 */
291291 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
292292 extern void flush_dcache_page(struct page *);
293−void flush_dcache_folio(struct folio *folio);
294293
295294 #define ARCH_IMPLEMENTS_FLUSH_KERNEL_VMAP_RANGE 1
296295 static inline void flush_kernel_vmap_range(void *addr, int size)
arch/arm/mach-socfpga/core.h+1−1
@@ -33,7 +33,7 @@ extern void __iomem *sdr_ctl_base_addr; · 32 unmodified lines
3333 u32 socfpga_sdram_self_refresh(u32 sdr_base);
3434 extern unsigned int socfpga_sdram_self_refresh_sz;
3535
36−extern char secondary_trampoline, secondary_trampoline_end;
36+extern char secondary_trampoline[], secondary_trampoline_end[];
3737
3838 extern unsigned long socfpga_cpu1start_addr;
3939
arch/arm/mach-socfpga/platsmp.c+4−4
@@ -20,14 +20,14 @@ · 19 unmodified lines
2020
2121 static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
2222 {
23− int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
23+ int trampoline_size = secondary_trampoline_end - secondary_trampoline;
2424
2525 if (socfpga_cpu1start_addr) {
2626 /* This will put CPU #1 into reset. */
2727 writel(RSTMGR_MPUMODRST_CPU1,
2828 rst_manager_base_addr + SOCFPGA_RSTMGR_MODMPURST);
2929
30− memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
30+ memcpy(phys_to_virt(0), secondary_trampoline, trampoline_size);
3131
3232 writel(__pa_symbol(secondary_startup),
3333 sys_manager_base_addr + (socfpga_cpu1start_addr & 0x000000ff));
@@ -45,12 +45,12 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle) · 11 unmodified lines
4545
4646 static int socfpga_a10_boot_secondary(unsigned int cpu, struct task_struct *idle)
4747 {
48− int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
48+ int trampoline_size = secondary_trampoline_end - secondary_trampoline;
4949
5050 if (socfpga_cpu1start_addr) {
5151 writel(RSTMGR_MPUMODRST_CPU1, rst_manager_base_addr +
5252 SOCFPGA_A10_RSTMGR_MODMPURST);
53− memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
53+ memcpy(phys_to_virt(0), secondary_trampoline, trampoline_size);
5454
5555 writel(__pa_symbol(secondary_startup),
5656 sys_manager_base_addr + (socfpga_cpu1start_addr & 0x00000fff));
arch/arm64/boot/dts/apple/t8103.dtsi+4−3
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 * Copyright The Asahi Linux Contributors
88 */
99
10+#include <dt-bindings/gpio/gpio.h>
1011 #include <dt-bindings/interrupt-controller/apple-aic.h>
1112 #include <dt-bindings/interrupt-controller/irq.h>
1213 #include <dt-bindings/pinctrl/apple.h>
@@ -281,7 +282,7 @@ · 268 unmodified lines
281282 port00: pci@0,0 {
282283 device_type = "pci";
283284 reg = <0x0 0x0 0x0 0x0 0x0>;
284− reset-gpios = <&pinctrl_ap 152 0>;
285+ reset-gpios = <&pinctrl_ap 152 GPIO_ACTIVE_LOW>;
285286 max-link-speed = <2>;
286287
287288 #address-cells = <3>;
@@ -301,7 +302,7 @@ · 13 unmodified lines
301302 port01: pci@1,0 {
302303 device_type = "pci";
303304 reg = <0x800 0x0 0x0 0x0 0x0>;
304− reset-gpios = <&pinctrl_ap 153 0>;
305+ reset-gpios = <&pinctrl_ap 153 GPIO_ACTIVE_LOW>;
305306 max-link-speed = <2>;
306307
307308 #address-cells = <3>;
@@ -321,7 +322,7 @@ · 13 unmodified lines
321322 port02: pci@2,0 {
322323 device_type = "pci";
323324 reg = <0x1000 0x0 0x0 0x0 0x0>;
324− reset-gpios = <&pinctrl_ap 33 0>;
325+ reset-gpios = <&pinctrl_ap 33 GPIO_ACTIVE_LOW>;
325326 max-link-speed = <1>;
326327
327328 #address-cells = <3>;
arch/arm64/boot/dts/exynos/exynosautov9.dtsi+1−2
@@ -296,8 +296,7 @@ · 295 unmodified lines
296296 pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>;
297297 phys = <&ufs_0_phy>;
298298 phy-names = "ufs-phy";
299− samsung,sysreg = <&syscon_fsys2>;
300− samsung,ufs-shareability-reg-offset = <0x710>;
299+ samsung,sysreg = <&syscon_fsys2 0x710>;
301300 status = "disabled";
302301 };
303302 };
arch/arm64/include/asm/ftrace.h+11−0
@@ -12,6 +12,17 @@ · 11 unmodified lines
1212
1313 #define HAVE_FUNCTION_GRAPH_FP_TEST
1414
15+/*
16+ * HAVE_FUNCTION_GRAPH_RET_ADDR_PTR means that the architecture can provide a
17+ * "return address pointer" which can be used to uniquely identify a return
18+ * address which has been overwritten.
19+ *
20+ * On arm64 we use the address of the caller's frame record, which remains the
21+ * same for the lifetime of the instrumented function, unlike the return
22+ * address in the LR.
23+ */
24+#define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
25+
1526 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
1627 #define ARCH_SUPPORTS_FTRACE_OPS 1
1728 #else
arch/arm64/include/asm/kvm_arm.h+2−2
@@ -91,7 +91,7 @@ · 90 unmodified lines
9191 #define HCR_HOST_VHE_FLAGS (HCR_RW | HCR_TGE | HCR_E2H)
9292
9393 /* TCR_EL2 Registers bits */
94−#define TCR_EL2_RES1 ((1 << 31) | (1 << 23))
94+#define TCR_EL2_RES1 ((1U << 31) | (1 << 23))
9595 #define TCR_EL2_TBI (1 << 20)
9696 #define TCR_EL2_PS_SHIFT 16
9797 #define TCR_EL2_PS_MASK (7 << TCR_EL2_PS_SHIFT)
@@ -276,7 +276,7 @@ · 178 unmodified lines
276276 #define CPTR_EL2_TFP_SHIFT 10
277277
278278 /* Hyp Coprocessor Trap Register */
279−#define CPTR_EL2_TCPAC (1 << 31)
279+#define CPTR_EL2_TCPAC (1U << 31)
280280 #define CPTR_EL2_TAM (1 << 30)
281281 #define CPTR_EL2_TTA (1 << 20)
282282 #define CPTR_EL2_TFP (1 << CPTR_EL2_TFP_SHIFT)
arch/arm64/include/asm/pgalloc.h+1−1
@@ -76,7 +76,7 @@ static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t ptep, · 75 unmodified lines
7676 static inline void
7777 pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
7878 {
79− VM_BUG_ON(mm != &init_mm);
79+ VM_BUG_ON(mm && mm != &init_mm);
8080 __pmd_populate(pmdp, __pa(ptep), PMD_TYPE_TABLE | PMD_TABLE_UXN);
8181 }
8282
arch/arm64/include/asm/stacktrace.h+0−6
@@ -47,9 +47,6 @@ struct stack_info { · 46 unmodified lines
4747 * @prev_type: The type of stack this frame record was on, or a synthetic
4848 * value of STACK_TYPE_UNKNOWN. This is used to detect a
4949 * transition from one stack to another.
50− *
51− * @graph: When FUNCTION_GRAPH_TRACER is selected, holds the index of a
52− * replacement lr value in the ftrace graph stack.
5350 */
5451 struct stackframe {
5552 unsigned long fp;
@@ -57,9 +54,6 @@ struct stackframe { · 1 unmodified line
5754 DECLARE_BITMAP(stacks_done, __NR_STACK_TYPES);
5855 unsigned long prev_fp;
5956 enum stack_type prev_type;
60−#ifdef CONFIG_FUNCTION_GRAPH_TRACER
61− int graph;
62−#endif
6357 #ifdef CONFIG_KRETPROBES
6458 struct llist_node *kr_cur;
6559 #endif
arch/arm64/include/asm/uaccess.h+41−7
@@ -281,12 +281,22 @@ do { \ · 280 unmodified lines
281281 (x) = (__force __typeof__(*(ptr)))__gu_val; \
282282 } while (0)
283283
284+/*
285+ * We must not call into the scheduler between uaccess_ttbr0_enable() and
286+ * uaccess_ttbr0_disable(). As `x` and `ptr` could contain blocking functions,
287+ * we must evaluate these outside of the critical section.
288+ */
284289 #define __raw_get_user(x, ptr, err) \
285290 do { \
291+ __typeof__(*(ptr)) __user *__rgu_ptr = (ptr); \
292+ __typeof__(x) __rgu_val; \
286293 __chk_user_ptr(ptr); \
294+ \
287295 uaccess_ttbr0_enable(); \
288− __raw_get_mem("ldtr", x, ptr, err); \
296+ __raw_get_mem("ldtr", __rgu_val, __rgu_ptr, err); \
289297 uaccess_ttbr0_disable(); \
298+ \
299+ (x) = __rgu_val; \
290300 } while (0)
291301
292302 #define __get_user_error(x, ptr, err) \
@@ -310,14 +320,22 @@ do { \ · 17 unmodified lines
310320
311321 #define get_user __get_user
312322
323+/*
324+ * We must not call into the scheduler between __uaccess_enable_tco_async() and
325+ * __uaccess_disable_tco_async(). As `dst` and `src` may contain blocking
326+ * functions, we must evaluate these outside of the critical section.
327+ */
313328 #define __get_kernel_nofault(dst, src, type, err_label) \
314329 do { \
330+ __typeof__(dst) __gkn_dst = (dst); \
331+ __typeof__(src) __gkn_src = (src); \
315332 int __gkn_err = 0; \
316333 \
317334 __uaccess_enable_tco_async(); \
318− __raw_get_mem("ldr", *((type *)(dst)), \
319− (__force type *)(src), __gkn_err); \
335+ __raw_get_mem("ldr", *((type *)(__gkn_dst)), \
336+ (__force type *)(__gkn_src), __gkn_err); \
320337 __uaccess_disable_tco_async(); \
338+ \
321339 if (unlikely(__gkn_err)) \
322340 goto err_label; \
323341 } while (0)
@@ -351,11 +369,19 @@ do { \ · 27 unmodified lines
351369 } \
352370 } while (0)
353371
372+/*
373+ * We must not call into the scheduler between uaccess_ttbr0_enable() and
374+ * uaccess_ttbr0_disable(). As `x` and `ptr` could contain blocking functions,
375+ * we must evaluate these outside of the critical section.
376+ */
354377 #define __raw_put_user(x, ptr, err) \
355378 do { \
356− __chk_user_ptr(ptr); \
379+ __typeof__(*(ptr)) __user *__rpu_ptr = (ptr); \
380+ __typeof__(*(ptr)) __rpu_val = (x); \
381+ __chk_user_ptr(__rpu_ptr); \
382+ \
357383 uaccess_ttbr0_enable(); \
358− __raw_put_mem("sttr", x, ptr, err); \
384+ __raw_put_mem("sttr", __rpu_val, __rpu_ptr, err); \
359385 uaccess_ttbr0_disable(); \
360386 } while (0)
361387
@@ -380,14 +406,22 @@ do { \ · 18 unmodified lines
380406
381407 #define put_user __put_user
382408
409+/*
410+ * We must not call into the scheduler between __uaccess_enable_tco_async() and
411+ * __uaccess_disable_tco_async(). As `dst` and `src` may contain blocking
412+ * functions, we must evaluate these outside of the critical section.
413+ */
383414 #define __put_kernel_nofault(dst, src, type, err_label) \
384415 do { \
416+ __typeof__(dst) __pkn_dst = (dst); \
417+ __typeof__(src) __pkn_src = (src); \
385418 int __pkn_err = 0; \
386419 \
387420 __uaccess_enable_tco_async(); \
388− __raw_put_mem("str", *((type *)(src)), \
389− (__force type *)(dst), __pkn_err); \
421+ __raw_put_mem("str", *((type *)(__pkn_src)), \
422+ (__force type *)(__pkn_dst), __pkn_err); \
390423 __uaccess_disable_tco_async(); \
424+ \
391425 if (unlikely(__pkn_err)) \
392426 goto err_label; \
393427 } while(0)
arch/arm64/kernel/entry-ftrace.S+6−0
@@ -77,11 +77,17 @@ · 76 unmodified lines
7777 .endm
7878
7979 SYM_CODE_START(ftrace_regs_caller)
80+#ifdef BTI_C
81+ BTI_C
82+#endif
8083 ftrace_regs_entry 1
8184 b ftrace_common
8285 SYM_CODE_END(ftrace_regs_caller)
8386
8487 SYM_CODE_START(ftrace_caller)
88+#ifdef BTI_C
89+ BTI_C
90+#endif
8591 ftrace_regs_entry 0
8692 b ftrace_common
8793 SYM_CODE_END(ftrace_caller)
arch/arm64/kernel/ftrace.c+3−3
@@ -244,8 +244,6 @@ void arch_ftrace_update_code(int command) · 243 unmodified lines
244244 * on the way back to parent. For this purpose, this function is called
245245 * in _mcount() or ftrace_caller() to replace return address (*parent) on
246246 * the call stack to return_to_handler.
247− *
248− * Note that @frame_pointer is used only for sanity check later.
249247 */
250248 void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent,
251249 unsigned long frame_pointer)
@@ -263,8 +261,10 @@ void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent, · 11 unmodified lines
263261 */
264262 old = *parent;
265263
266− if (!function_graph_enter(old, self_addr, frame_pointer, NULL))
264+ if (!function_graph_enter(old, self_addr, frame_pointer,
265+ (void *)frame_pointer)) {
267266 *parent = return_hooker;
267+ }
268268 }
269269
270270 #ifdef CONFIG_DYNAMIC_FTRACE
arch/arm64/kernel/machine_kexec.c+1−1
@@ -147,7 +147,7 @@ int machine_kexec_post_load(struct kimage *kimage) · 146 unmodified lines
147147 if (rc)
148148 return rc;
149149 kimage->arch.ttbr1 = __pa(trans_pgd);
150− kimage->arch.zero_page = __pa(empty_zero_page);
150+ kimage->arch.zero_page = __pa_symbol(empty_zero_page);
151151
152152 reloc_size = __relocate_new_kernel_end - __relocate_new_kernel_start;
153153 memcpy(reloc_code, __relocate_new_kernel_start, reloc_size);
arch/arm64/kernel/stacktrace.c+8−10
@@ -38,9 +38,6 @@ void start_backtrace(struct stackframe *frame, unsigned long fp, · 37 unmodified lines
3838 {
3939 frame->fp = fp;
4040 frame->pc = pc;
41−#ifdef CONFIG_FUNCTION_GRAPH_TRACER
42− frame->graph = 0;
43−#endif
4441 #ifdef CONFIG_KRETPROBES
4542 frame->kr_cur = NULL;
4643 #endif
@@ -116,20 +113,23 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) · 69 unmodified lines
116113 frame->prev_fp = fp;
117114 frame->prev_type = info.type;
118115
116+ frame->pc = ptrauth_strip_insn_pac(frame->pc);
117+
119118 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
120119 if (tsk->ret_stack &&
121− (ptrauth_strip_insn_pac(frame->pc) == (unsigned long)return_to_handler)) {
122− struct ftrace_ret_stack *ret_stack;
120+ (frame->pc == (unsigned long)return_to_handler)) {
121+ unsigned long orig_pc;
123122 /*
124123 * This is a case where function graph tracer has
125124 * modified a return address (LR) in a stack frame
126125 * to hook a function return.
127126 * So replace it to an original value.
128127 */
129− ret_stack = ftrace_graph_get_ret_stack(tsk, frame->graph++);
130− if (WARN_ON_ONCE(!ret_stack))
128+ orig_pc = ftrace_graph_ret_addr(tsk, NULL, frame->pc,
129+ (void *)frame->fp);
130+ if (WARN_ON_ONCE(frame->pc == orig_pc))
131131 return -EINVAL;
132− frame->pc = ret_stack->ret;
132+ frame->pc = orig_pc;
133133 }
134134 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
135135 #ifdef CONFIG_KRETPROBES
@@ -137,8 +137,6 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) · 1 unmodified line
137137 frame->pc = kretprobe_find_ret_addr(tsk, (void *)frame->fp, &frame->kr_cur);
138138 #endif
139139
140− frame->pc = ptrauth_strip_insn_pac(frame->pc);
141−
142140 return 0;
143141 }
144142 NOKPROBE_SYMBOL(unwind_frame);
arch/arm64/kvm/arm.c+8−1
@@ -223,7 +223,14 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 222 unmodified lines
223223 r = 1;
224224 break;
225225 case KVM_CAP_NR_VCPUS:
226− r = num_online_cpus();
226+ /*
227+ * ARM64 treats KVM_CAP_NR_CPUS differently from all other
228+ * architectures, as it does not always bound it to
229+ * KVM_CAP_MAX_VCPUS. It should not matter much because
230+ * this is just an advisory value.
231+ */
232+ r = min_t(unsigned int, num_online_cpus(),
233+ kvm_arm_default_max_vcpus());
227234 break;
228235 case KVM_CAP_MAX_VCPUS:
229236 case KVM_CAP_MAX_VCPU_ID:
arch/arm64/kvm/hyp/include/hyp/switch.h+14−0
@@ -403,6 +403,8 @@ typedef bool (*exit_handler_fn)(struct kvm_vcpu *, u64 *); · 402 unmodified lines
403403
404404 static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu);
405405
406+static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code);
407+
406408 /*
407409 * Allow the hypervisor to handle the exit with an exit handler if it has one.
408410 *
@@ -429,6 +431,18 @@ static inline bool kvm_hyp_handle_exit(struct kvm_vcpu *vcpu, u64 *exit_code) · 20 unmodified lines
429431 */
430432 static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
431433 {
434+ /*
435+ * Save PSTATE early so that we can evaluate the vcpu mode
436+ * early on.
437+ */
438+ vcpu->arch.ctxt.regs.pstate = read_sysreg_el2(SYS_SPSR);
439+
440+ /*
441+ * Check whether we want to repaint the state one way or
442+ * another.
443+ */
444+ early_exit_filter(vcpu, exit_code);
445+
432446 if (ARM_EXCEPTION_CODE(*exit_code) != ARM_EXCEPTION_IRQ)
433447 vcpu->arch.fault.esr_el2 = read_sysreg_el2(SYS_ESR);
434448
arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h+6−1
@@ -70,7 +70,12 @@ static inline void __sysreg_save_el1_state(struct kvm_cpu_context *ctxt) · 69 unmodified lines
7070 static inline void __sysreg_save_el2_return_state(struct kvm_cpu_context *ctxt)
7171 {
7272 ctxt->regs.pc = read_sysreg_el2(SYS_ELR);
73− ctxt->regs.pstate = read_sysreg_el2(SYS_SPSR);
73+ /*
74+ * Guest PSTATE gets saved at guest fixup time in all
75+ * cases. We still need to handle the nVHE host side here.
76+ */
77+ if (!has_vhe() && ctxt->__hyp_running_vcpu)
78+ ctxt->regs.pstate = read_sysreg_el2(SYS_SPSR);
7479
7580 if (cpus_have_final_cap(ARM64_HAS_RAS_EXTN))
7681 ctxt_sys_reg(ctxt, DISR_EL1) = read_sysreg_s(SYS_VDISR_EL2);
arch/arm64/kvm/hyp/nvhe/switch.c+1−7
@@ -233,7 +233,7 @@ static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu) · 232 unmodified lines
233233 * Returns false if the guest ran in AArch32 when it shouldn't have, and
234234 * thus should exit to the host, or true if a the guest run loop can continue.
235235 */
236−static bool handle_aarch32_guest(struct kvm_vcpu *vcpu, u64 *exit_code)
236+static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code)
237237 {
238238 struct kvm *kvm = kern_hyp_va(vcpu->kvm);
239239
@@ -248,10 +248,7 @@ static bool handle_aarch32_guest(struct kvm_vcpu *vcpu, u64 *exit_code) · 8 unmodified lines
248248 vcpu->arch.target = -1;
249249 *exit_code &= BIT(ARM_EXIT_WITH_SERROR_BIT);
250250 *exit_code |= ARM_EXCEPTION_IL;
251− return false;
252251 }
253−
254− return true;
255252 }
256253
257254 /* Switch to the guest for legacy non-VHE systems */
@@ -316,9 +313,6 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu) · 58 unmodified lines
316313 /* Jump in the fire! */
317314 exit_code = __guest_enter(vcpu);
318315
319− if (unlikely(!handle_aarch32_guest(vcpu, &exit_code)))
320− break;
321−
322316 /* And we're baaack! */
323317 } while (fixup_guest_exit(vcpu, &exit_code));
324318
arch/arm64/kvm/hyp/vhe/switch.c+4−0
@@ -112,6 +112,10 @@ static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu) · 111 unmodified lines
112112 return hyp_exit_handlers;
113113 }
114114
115+static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code)
116+{
117+}
118+
115119 /* Switch to the guest for VHE systems running in EL2 */
116120 static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
117121 {
arch/csky/kernel/traps.c+2−2
@@ -209,7 +209,7 @@ asmlinkage void do_trap_illinsn(struct pt_regs *regs) · 208 unmodified lines
209209
210210 asmlinkage void do_trap_fpe(struct pt_regs *regs)
211211 {
212−#ifdef CONFIG_CPU_HAS_FP
212+#ifdef CONFIG_CPU_HAS_FPU
213213 return fpu_fpe(regs);
214214 #else
215215 do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->pc,
@@ -219,7 +219,7 @@ asmlinkage void do_trap_fpe(struct pt_regs *regs) · 3 unmodified lines
219219
220220 asmlinkage void do_trap_priv(struct pt_regs *regs)
221221 {
222−#ifdef CONFIG_CPU_HAS_FP
222+#ifdef CONFIG_CPU_HAS_FPU
223223 if (user_mode(regs) && fpu_libc_helper(regs))
224224 return;
225225 #endif
arch/hexagon/include/asm/timer-regs.h+0−26
@@ -1,26 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Timer support for Hexagon
4− *
5− * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
6− */
7−
8−#ifndef _ASM_TIMER_REGS_H
9−#define _ASM_TIMER_REGS_H
10−
11−/* This stuff should go into a platform specific file */
12−#define TCX0_CLK_RATE 19200
13−#define TIMER_ENABLE 0
14−#define TIMER_CLR_ON_MATCH 1
15−
16−/*
17− * 8x50 HDD Specs 5-8. Simulator co-sim not fixed until
18− * release 1.1, and then it's "adjustable" and probably not defaulted.
19− */
20−#define RTOS_TIMER_INT 3
21−#ifdef CONFIG_HEXAGON_COMET
22−#define RTOS_TIMER_REGS_ADDR 0xAB000000UL
23−#endif
24−#define SLEEP_CLK_RATE 32000
25−
26−#endif
arch/hexagon/include/asm/timex.h+1−2
@@ -7,11 +7,10 @@ · 6 unmodified lines
77 #define _ASM_TIMEX_H
88
99 #include <asm-generic/timex.h>
10−#include <asm/timer-regs.h>
1110 #include <asm/hexagon_vm.h>
1211
1312 /* Using TCX0 as our clock. CLOCK_TICK_RATE scheduled to be removed. */
14−#define CLOCK_TICK_RATE TCX0_CLK_RATE
13+#define CLOCK_TICK_RATE 19200
1514
1615 #define ARCH_HAS_READ_CURRENT_TIMER
1716
arch/hexagon/kernel/.gitignore+1−0
@@ -0,0 +1 @@
1+vmlinux.lds
arch/hexagon/kernel/time.c+10−2
@@ -17,9 +17,10 @@ · 16 unmodified lines
1717 #include <linux/of_irq.h>
1818 #include <linux/module.h>
1919
20−#include <asm/timer-regs.h>
2120 #include <asm/hexagon_vm.h>
2221
22+#define TIMER_ENABLE BIT(0)
23+
2324 /*
2425 * For the clocksource we need:
2526 * pcycle frequency (600MHz)
@@ -33,6 +34,13 @@ cycles_t pcycle_freq_mhz; · 7 unmodified lines
3334 cycles_t thread_freq_mhz;
3435 cycles_t sleep_clk_freq;
3536
37+/*
38+ * 8x50 HDD Specs 5-8. Simulator co-sim not fixed until
39+ * release 1.1, and then it's "adjustable" and probably not defaulted.
40+ */
41+#define RTOS_TIMER_INT 3
42+#define RTOS_TIMER_REGS_ADDR 0xAB000000UL
43+
3644 static struct resource rtos_timer_resources[] = {
3745 {
3846 .start = RTOS_TIMER_REGS_ADDR,
@@ -80,7 +88,7 @@ static int set_next_event(unsigned long delta, struct clock_event_device *evt) · 41 unmodified lines
8088 iowrite32(0, &rtos_timer->clear);
8189
8290 iowrite32(delta, &rtos_timer->match);
83− iowrite32(1 << TIMER_ENABLE, &rtos_timer->enable);
91+ iowrite32(TIMER_ENABLE, &rtos_timer->enable);
8492 return 0;
8593 }
8694
arch/hexagon/lib/io.c+4−0
@@ -27,6 +27,7 @@ void __raw_readsw(const void __iomem *addr, void *data, int len) · 26 unmodified lines
2727 *dst++ = *src;
2828
2929 }
30+EXPORT_SYMBOL(__raw_readsw);
3031
3132 /*
3233 * __raw_writesw - read words a short at a time
@@ -47,6 +48,7 @@ void __raw_writesw(void __iomem *addr, const void *data, int len) · 14 unmodified lines
4748
4849
4950 }
51+EXPORT_SYMBOL(__raw_writesw);
5052
5153 /* Pretty sure len is pre-adjusted for the length of the access already */
5254 void __raw_readsl(const void __iomem *addr, void *data, int len)
@@ -62,6 +64,7 @@ void __raw_readsl(const void __iomem *addr, void *data, int len) · 9 unmodified lines
6264
6365
6466 }
67+EXPORT_SYMBOL(__raw_readsl);
6568
6669 void __raw_writesl(void __iomem *addr, const void *data, int len)
6770 {
@@ -76,3 +79,4 @@ void __raw_writesl(void __iomem *addr, const void *data, int len) · 8 unmodified lines
7679
7780
7881 }
82+EXPORT_SYMBOL(__raw_writesl);
arch/ia64/kernel/syscalls/syscall.tbl+1−0
@@ -369,3 +369,4 @@ · 368 unmodified lines
369369 446 common landlock_restrict_self sys_landlock_restrict_self
370370 # 447 reserved for memfd_secret
371371 448 common process_mrelease sys_process_mrelease
372+449 common futex_waitv sys_futex_waitv
arch/m68k/include/asm/cacheflush_mm.h+0−1
@@ -250,7 +250,6 @@ static inline void __flush_page_to_ram(void *vaddr) · 249 unmodified lines
250250
251251 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
252252 #define flush_dcache_page(page) __flush_page_to_ram(page_address(page))
253−void flush_dcache_folio(struct folio *folio);
254253 #define flush_dcache_mmap_lock(mapping) do { } while (0)
255254 #define flush_dcache_mmap_unlock(mapping) do { } while (0)
256255 #define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page))
arch/m68k/kernel/syscalls/syscall.tbl+1−0
@@ -448,3 +448,4 @@ · 447 unmodified lines
448448 446 common landlock_restrict_self sys_landlock_restrict_self
449449 # 447 reserved for memfd_secret
450450 448 common process_mrelease sys_process_mrelease
451+449 common futex_waitv sys_futex_waitv
arch/m68k/kernel/traps.c+1−1
@@ -1145,7 +1145,7 @@ asmlinkage void set_esp0(unsigned long ssp) · 1144 unmodified lines
11451145 */
11461146 asmlinkage void fpsp040_die(void)
11471147 {
1148− force_fatal_sig(SIGSEGV);
1148+ force_exit_sig(SIGSEGV);
11491149 }
11501150
11511151 #ifdef CONFIG_M68KFPU_EMU
arch/microblaze/kernel/syscalls/syscall.tbl+1−0
@@ -454,3 +454,4 @@ · 453 unmodified lines
454454 446 common landlock_restrict_self sys_landlock_restrict_self
455455 # 447 reserved for memfd_secret
456456 448 common process_mrelease sys_process_mrelease
457+449 common futex_waitv sys_futex_waitv
arch/mips/Kconfig+1−1
@@ -3097,7 +3097,7 @@ config STACKTRACE_SUPPORT · 3096 unmodified lines
30973097 config PGTABLE_LEVELS
30983098 int
30993099 default 4 if PAGE_SIZE_4KB && MIPS_VA_BITS_48
3100− default 3 if 64BIT && !PAGE_SIZE_64KB
3100+ default 3 if 64BIT && (!PAGE_SIZE_64KB || MIPS_VA_BITS_48)
31013101 default 2
31023102
31033103 config MIPS_AUTO_PFN_OFFSET
arch/mips/bcm63xx/clk.c+6−0
@@ -381,6 +381,12 @@ void clk_disable(struct clk *clk) · 380 unmodified lines
381381
382382 EXPORT_SYMBOL(clk_disable);
383383
384+struct clk *clk_get_parent(struct clk *clk)
385+{
386+ return NULL;
387+}
388+EXPORT_SYMBOL(clk_get_parent);
389+
384390 unsigned long clk_get_rate(struct clk *clk)
385391 {
386392 if (!clk)
arch/mips/boot/compressed/Makefile+1−1
@@ -52,7 +52,7 @@ endif · 51 unmodified lines
5252
5353 vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
5454
55−vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o
55+vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o $(obj)/ashldi3.o
5656
5757 targets := $(notdir $(vmlinuzobjs-y))
5858
arch/mips/generic/yamon-dt.c+1−1
@@ -75,7 +75,7 @@ static unsigned int __init gen_fdt_mem_array( · 74 unmodified lines
7575 __init int yamon_dt_append_memory(void *fdt,
7676 const struct yamon_mem_region *regions)
7777 {
78− unsigned long phys_memsize, memsize;
78+ unsigned long phys_memsize = 0, memsize;
7979 __be32 mem_array[2 * MAX_MEM_ARRAY_ENTRIES];
8080 unsigned int mem_entries;
8181 int i, err, mem_off;
arch/mips/include/asm/cacheflush.h+0−2
@@ -61,8 +61,6 @@ static inline void flush_dcache_page(struct page *page) · 60 unmodified lines
6161 SetPageDcacheDirty(page);
6262 }
6363
64−void flush_dcache_folio(struct folio *folio);
65−
6664 #define flush_dcache_mmap_lock(mapping) do { } while (0)
6765 #define flush_dcache_mmap_unlock(mapping) do { } while (0)
6866
arch/mips/kernel/cpu-probe.c+2−2
@@ -1734,8 +1734,6 @@ static inline void decode_cpucfg(struct cpuinfo_mips *c) · 1733 unmodified lines
17341734
17351735 static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
17361736 {
1737− decode_configs(c);
1738−
17391737 /* All Loongson processors covered here define ExcCode 16 as GSExc. */
17401738 c->options |= MIPS_CPU_GSEXCEX;
17411739
@@ -1796,6 +1794,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) · 54 unmodified lines
17961794 panic("Unknown Loongson Processor ID!");
17971795 break;
17981796 }
1797+
1798+ decode_configs(c);
17991799 }
18001800 #else
18011801 static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) { }
arch/mips/kernel/proc.c+1−1
@@ -185,7 +185,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) · 184 unmodified lines
185185 seq_puts(m, " tx39_cache");
186186 if (cpu_has_octeon_cache)
187187 seq_puts(m, " octeon_cache");
188− if (cpu_has_fpu)
188+ if (raw_cpu_has_fpu)
189189 seq_puts(m, " fpu");
190190 if (cpu_has_32fpr)
191191 seq_puts(m, " 32fpr");
arch/mips/kernel/syscalls/syscall_n32.tbl+1−0
@@ -387,3 +387,4 @@ · 386 unmodified lines
387387 446 n32 landlock_restrict_self sys_landlock_restrict_self
388388 # 447 reserved for memfd_secret
389389 448 n32 process_mrelease sys_process_mrelease
390+449 n32 futex_waitv sys_futex_waitv
arch/mips/kernel/syscalls/syscall_n64.tbl+1−0
@@ -363,3 +363,4 @@ · 362 unmodified lines
363363 446 n64 landlock_restrict_self sys_landlock_restrict_self
364364 # 447 reserved for memfd_secret
365365 448 n64 process_mrelease sys_process_mrelease
366+449 n64 futex_waitv sys_futex_waitv
arch/mips/kernel/syscalls/syscall_o32.tbl+1−0
@@ -436,3 +436,4 @@ · 435 unmodified lines
436436 446 o32 landlock_restrict_self sys_landlock_restrict_self
437437 # 447 reserved for memfd_secret
438438 448 o32 process_mrelease sys_process_mrelease
439+449 o32 futex_waitv sys_futex_waitv
arch/mips/kvm/mips.c+1−1
@@ -1067,7 +1067,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 1066 unmodified lines
10671067 r = 1;
10681068 break;
10691069 case KVM_CAP_NR_VCPUS:
1070− r = num_online_cpus();
1070+ r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
10711071 break;
10721072 case KVM_CAP_MAX_VCPUS:
10731073 r = KVM_MAX_VCPUS;
arch/mips/lantiq/clk.c+6−0
@@ -158,6 +158,12 @@ void clk_deactivate(struct clk *clk) · 157 unmodified lines
158158 }
159159 EXPORT_SYMBOL(clk_deactivate);
160160
161+struct clk *clk_get_parent(struct clk *clk)
162+{
163+ return NULL;
164+}
165+EXPORT_SYMBOL(clk_get_parent);
166+
161167 static inline u32 get_counter_resolution(void)
162168 {
163169 u32 res;
arch/mips/net/bpf_jit_comp.h+1−1
@@ -98,7 +98,7 @@ do { \ · 97 unmodified lines
9898 #define emit(...) __emit(__VA_ARGS__)
9999
100100 /* Workaround for R10000 ll/sc errata */
101−#ifdef CONFIG_WAR_R10000
101+#ifdef CONFIG_WAR_R10000_LLSC
102102 #define LLSC_beqz beqzl
103103 #else
104104 #define LLSC_beqz beqz
arch/nds32/include/asm/cacheflush.h+0−1
@@ -27,7 +27,6 @@ void flush_cache_vunmap(unsigned long start, unsigned long end); · 26 unmodified lines
2727
2828 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
2929 void flush_dcache_page(struct page *page);
30−void flush_dcache_folio(struct folio *folio);
3130 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
3231 unsigned long vaddr, void *dst, void *src, int len);
3332 void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
arch/nios2/include/asm/cacheflush.h+0−1
@@ -29,7 +29,6 @@ extern void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, · 28 unmodified lines
2929 unsigned long pfn);
3030 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
3131 void flush_dcache_page(struct page *page);
32−void flush_dcache_folio(struct folio *folio);
3332
3433 extern void flush_icache_range(unsigned long start, unsigned long end);
3534 extern void flush_icache_page(struct vm_area_struct *vma, struct page *page);
arch/parisc/Makefile+5−0
@@ -15,7 +15,12 @@ · 14 unmodified lines
1515 # Mike Shaver, Helge Deller and Martin K. Petersen
1616 #
1717
18+ifdef CONFIG_PARISC_SELF_EXTRACT
19+boot := arch/parisc/boot
20+KBUILD_IMAGE := $(boot)/bzImage
21+else
1822 KBUILD_IMAGE := vmlinuz
23+endif
1924
2025 NM = sh $(srctree)/arch/parisc/nm
2126 CHECKFLAGS += -D__hppa__=1
arch/parisc/configs/generic-32bit_defconfig+1−0
@@ -231,6 +231,7 @@ CONFIG_CRYPTO_DEFLATE=y · 230 unmodified lines
231231 CONFIG_CRC_CCITT=m
232232 CONFIG_CRC_T10DIF=y
233233 CONFIG_FONTS=y
234+CONFIG_PRINTK_TIME=y
234235 CONFIG_MAGIC_SYSRQ=y
235236 CONFIG_DEBUG_FS=y
236237 CONFIG_DEBUG_MEMORY_INIT=y
arch/parisc/configs/generic-64bit_defconfig+13−1
@@ -1,7 +1,9 @@
11 CONFIG_LOCALVERSION="-64bit"
22 # CONFIG_LOCALVERSION_AUTO is not set
3+CONFIG_KERNEL_LZ4=y
34 CONFIG_SYSVIPC=y
45 CONFIG_POSIX_MQUEUE=y
6+CONFIG_AUDIT=y
57 CONFIG_BSD_PROCESS_ACCT=y
68 CONFIG_BSD_PROCESS_ACCT_V3=y
79 CONFIG_TASKSTATS=y
@@ -35,6 +37,7 @@ CONFIG_MODVERSIONS=y · 27 unmodified lines
3537 CONFIG_BLK_DEV_INTEGRITY=y
3638 CONFIG_BINFMT_MISC=m
3739 # CONFIG_COMPACTION is not set
40+CONFIG_MEMORY_FAILURE=y
3841 CONFIG_NET=y
3942 CONFIG_PACKET=y
4043 CONFIG_UNIX=y
@@ -65,12 +68,15 @@ CONFIG_SCSI_ISCSI_ATTRS=y · 24 unmodified lines
6568 CONFIG_SCSI_SRP_ATTRS=y
6669 CONFIG_ISCSI_BOOT_SYSFS=y
6770 CONFIG_SCSI_MPT2SAS=y
68−CONFIG_SCSI_LASI700=m
71+CONFIG_SCSI_LASI700=y
6972 CONFIG_SCSI_SYM53C8XX_2=y
7073 CONFIG_SCSI_ZALON=y
7174 CONFIG_SCSI_QLA_ISCSI=m
7275 CONFIG_SCSI_DH=y
7376 CONFIG_ATA=y
77+CONFIG_SATA_SIL=y
78+CONFIG_SATA_SIS=y
79+CONFIG_SATA_VIA=y
7480 CONFIG_PATA_NS87415=y
7581 CONFIG_PATA_SIL680=y
7682 CONFIG_ATA_GENERIC=y
@@ -79,6 +85,7 @@ CONFIG_MD_LINEAR=m · 2 unmodified lines
7985 CONFIG_BLK_DEV_DM=m
8086 CONFIG_DM_RAID=m
8187 CONFIG_DM_UEVENT=y
88+CONFIG_DM_AUDIT=y
8289 CONFIG_FUSION=y
8390 CONFIG_FUSION_SPI=y
8491 CONFIG_FUSION_SAS=y
@@ -196,10 +203,15 @@ CONFIG_FB_MATROX_G=y · 111 unmodified lines
196203 CONFIG_FB_MATROX_I2C=y
197204 CONFIG_FB_MATROX_MAVEN=y
198205 CONFIG_FB_RADEON=y
206+CONFIG_LOGO=y
207+# CONFIG_LOGO_LINUX_CLUT224 is not set
199208 CONFIG_HIDRAW=y
200209 CONFIG_HID_PID=y
201210 CONFIG_USB_HIDDEV=y
202211 CONFIG_USB=y
212+CONFIG_USB_EHCI_HCD=y
213+CONFIG_USB_OHCI_HCD=y
214+CONFIG_USB_OHCI_HCD_PLATFORM=y
203215 CONFIG_UIO=y
204216 CONFIG_UIO_PDRV_GENIRQ=m
205217 CONFIG_UIO_AEC=m
arch/parisc/include/asm/assembly.h+35−20
@@ -3,38 +3,19 @@ · 2 unmodified lines
33 * Copyright (C) 1999 Hewlett-Packard (Frank Rowand)
44 * Copyright (C) 1999 Philipp Rumpf <prumpf@tux.org>
55 * Copyright (C) 1999 SuSE GmbH
6+ * Copyright (C) 2021 Helge Deller <deller@gmx.de>
67 */
78
89 #ifndef _PARISC_ASSEMBLY_H
910 #define _PARISC_ASSEMBLY_H
1011
11−#define CALLEE_FLOAT_FRAME_SIZE 80
12−
1312 #ifdef CONFIG_64BIT
14−#define LDREG ldd
15−#define STREG std
16−#define LDREGX ldd,s
17−#define LDREGM ldd,mb
18−#define STREGM std,ma
19−#define SHRREG shrd
20−#define SHLREG shld
21−#define ANDCM andcm,*
22−#define COND(x) * ## x
2313 #define RP_OFFSET 16
2414 #define FRAME_SIZE 128
2515 #define CALLEE_REG_FRAME_SIZE 144
2616 #define REG_SZ 8
2717 #define ASM_ULONG_INSN .dword
2818 #else /* CONFIG_64BIT */
29−#define LDREG ldw
30−#define STREG stw
31−#define LDREGX ldwx,s
32−#define LDREGM ldwm
33−#define STREGM stwm
34−#define SHRREG shr
35−#define SHLREG shlw
36−#define ANDCM andcm
37−#define COND(x) x
3819 #define RP_OFFSET 20
3920 #define FRAME_SIZE 64
4021 #define CALLEE_REG_FRAME_SIZE 128
@@ -45,6 +26,7 @@ · 4 unmodified lines
4526 /* Frame alignment for 32- and 64-bit */
4627 #define FRAME_ALIGN 64
4728
29+#define CALLEE_FLOAT_FRAME_SIZE 80
4830 #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE)
4931
5032 #ifdef CONFIG_PA20
@@ -67,6 +49,28 @@ · 16 unmodified lines
6749
6850 #ifdef __ASSEMBLY__
6951
52+#ifdef CONFIG_64BIT
53+#define LDREG ldd
54+#define STREG std
55+#define LDREGX ldd,s
56+#define LDREGM ldd,mb
57+#define STREGM std,ma
58+#define SHRREG shrd
59+#define SHLREG shld
60+#define ANDCM andcm,*
61+#define COND(x) * ## x
62+#else /* CONFIG_64BIT */
63+#define LDREG ldw
64+#define STREG stw
65+#define LDREGX ldwx,s
66+#define LDREGM ldwm
67+#define STREGM stwm
68+#define SHRREG shr
69+#define SHLREG shlw
70+#define ANDCM andcm
71+#define COND(x) x
72+#endif
73+
7074 #ifdef CONFIG_64BIT
7175 /* the 64-bit pa gnu assembler unfortunately defaults to .level 1.1 or 2.0 so
7276 * work around that for now... */
@@ -143,6 +147,17 @@ · 70 unmodified lines
143147 extrd,u \r, 63-(\sa), 64-(\sa), \t
144148 .endm
145149
150+ /* Extract unsigned for 32- and 64-bit
151+ * The extru instruction leaves the most significant 32 bits of the
152+ * target register in an undefined state on PA 2.0 systems. */
153+ .macro extru_safe r, p, len, t
154+#ifdef CONFIG_64BIT
155+ extrd,u \r, 32+(\p), \len, \t
156+#else
157+ extru \r, \p, \len, \t
158+#endif
159+ .endm
160+
146161 /* load 32-bit 'value' into 'reg' compensating for the ldil
147162 * sign-extension when running in wide mode.
148163 * WARNING!! neither 'value' nor 'reg' can be expressions
arch/parisc/include/asm/cacheflush.h+0−1
@@ -50,7 +50,6 @@ void invalidate_kernel_vmap_range(void *vaddr, int size); · 49 unmodified lines
5050
5151 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
5252 void flush_dcache_page(struct page *page);
53−void flush_dcache_folio(struct folio *folio);
5453
5554 #define flush_dcache_mmap_lock(mapping) xa_lock_irq(&mapping->i_pages)
5655 #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&mapping->i_pages)
arch/parisc/include/asm/jump_label.h+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #ifndef __ASSEMBLY__
66
77 #include <linux/types.h>
8+#include <linux/stringify.h>
89 #include <asm/assembly.h>
910
1011 #define JUMP_LABEL_NOP_SIZE 4
arch/parisc/include/asm/rt_sigframe.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef _ASM_PARISC_RT_SIGFRAME_H
33 #define _ASM_PARISC_RT_SIGFRAME_H
44
5−#define SIGRETURN_TRAMP 3
5+#define SIGRETURN_TRAMP 4
66 #define SIGRESTARTBLOCK_TRAMP 5
77 #define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
88
arch/parisc/install.sh+1−0
@@ -39,6 +39,7 @@ verify "$3" · 38 unmodified lines
3939 if [ -n "${INSTALLKERNEL}" ]; then
4040 if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
4141 if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
42+ if [ -x /usr/sbin/${INSTALLKERNEL} ]; then exec /usr/sbin/${INSTALLKERNEL} "$@"; fi
4243 fi
4344
4445 # Default install
arch/parisc/kernel/entry.S+3−11
@@ -366,17 +366,9 @@ · 365 unmodified lines
366366 */
367367 .macro L2_ptep pmd,pte,index,va,fault
368368 #if CONFIG_PGTABLE_LEVELS == 3
369− extru \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
369+ extru_safe \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
370370 #else
371−# if defined(CONFIG_64BIT)
372− extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
373− #else
374− # if PAGE_SIZE > 4096
375− extru \va,31-ASM_PGDIR_SHIFT,32-ASM_PGDIR_SHIFT,\index
376− # else
377− extru \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
378− # endif
379−# endif
371+ extru_safe \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
380372 #endif
381373 dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */
382374 #if CONFIG_PGTABLE_LEVELS < 3
@@ -386,7 +378,7 @@ · 3 unmodified lines
386378 bb,>=,n \pmd,_PxD_PRESENT_BIT,\fault
387379 dep %r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */
388380 SHLREG \pmd,PxD_VALUE_SHIFT,\pmd
389− extru \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
381+ extru_safe \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
390382 dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */
391383 shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd /* pmd is now pte */
392384 .endm
arch/parisc/kernel/signal.c+7−6
@@ -288,21 +288,22 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs, · 287 unmodified lines
288288 already in userspace. The first words of tramp are used to
289289 save the previous sigrestartblock trampoline that might be
290290 on the stack. We start the sigreturn trampoline at
291− SIGRESTARTBLOCK_TRAMP. */
291+ SIGRESTARTBLOCK_TRAMP+X. */
292292 err |= __put_user(in_syscall ? INSN_LDI_R25_1 : INSN_LDI_R25_0,
293293 &frame->tramp[SIGRESTARTBLOCK_TRAMP+0]);
294− err |= __put_user(INSN_BLE_SR2_R0,
294+ err |= __put_user(INSN_LDI_R20,
295295 &frame->tramp[SIGRESTARTBLOCK_TRAMP+1]);
296− err |= __put_user(INSN_LDI_R20,
296+ err |= __put_user(INSN_BLE_SR2_R0,
297297 &frame->tramp[SIGRESTARTBLOCK_TRAMP+2]);
298+ err |= __put_user(INSN_NOP, &frame->tramp[SIGRESTARTBLOCK_TRAMP+3]);
298299
299− start = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+0];
300− end = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+3];
300+ start = (unsigned long) &frame->tramp[0];
301+ end = (unsigned long) &frame->tramp[TRAMP_SIZE];
301302 flush_user_dcache_range_asm(start, end);
302303 flush_user_icache_range_asm(start, end);
303304
304305 /* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP
305− * TRAMP Words 5-7, Length 3 = SIGRETURN_TRAMP
306+ * TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
306307 * So the SIGRETURN_TRAMP is at the end of SIGRESTARTBLOCK_TRAMP
307308 */
308309 rp = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP];
arch/parisc/kernel/signal32.h+1−1
@@ -36,7 +36,7 @@ struct compat_regfile { · 35 unmodified lines
3636 compat_int_t rf_sar;
3737 };
3838
39−#define COMPAT_SIGRETURN_TRAMP 3
39+#define COMPAT_SIGRETURN_TRAMP 4
4040 #define COMPAT_SIGRESTARTBLOCK_TRAMP 5
4141 #define COMPAT_TRAMP_SIZE (COMPAT_SIGRETURN_TRAMP + \
4242 COMPAT_SIGRESTARTBLOCK_TRAMP)
arch/parisc/kernel/syscall.S+2−2
@@ -566,7 +566,7 @@ lws_compare_and_swap: · 565 unmodified lines
566566 ldo R%lws_lock_start(%r20), %r28
567567
568568 /* Extract eight bits from r26 and hash lock (Bits 3-11) */
569− extru %r26, 28, 8, %r20
569+ extru_safe %r26, 28, 8, %r20
570570
571571 /* Find lock to use, the hash is either one of 0 to
572572 15, multiplied by 16 (keep it 16-byte aligned)
@@ -751,7 +751,7 @@ cas2_lock_start: · 178 unmodified lines
751751 ldo R%lws_lock_start(%r20), %r28
752752
753753 /* Extract eight bits from r26 and hash lock (Bits 3-11) */
754− extru %r26, 28, 8, %r20
754+ extru_safe %r26, 28, 8, %r20
755755
756756 /* Find lock to use, the hash is either one of 0 to
757757 15, multiplied by 16 (keep it 16-byte aligned)
arch/parisc/kernel/syscalls/syscall.tbl+1−0
@@ -446,3 +446,4 @@ · 445 unmodified lines
446446 446 common landlock_restrict_self sys_landlock_restrict_self
447447 # 447 reserved for memfd_secret
448448 448 common process_mrelease sys_process_mrelease
449+449 common futex_waitv sys_futex_waitv
arch/parisc/kernel/time.c+8−22
@@ -249,30 +249,16 @@ void __init time_init(void) · 248 unmodified lines
249249 static int __init init_cr16_clocksource(void)
250250 {
251251 /*
252− * The cr16 interval timers are not syncronized across CPUs on
253− * different sockets, so mark them unstable and lower rating on
254− * multi-socket SMP systems.
252+ * The cr16 interval timers are not syncronized across CPUs, even if
253+ * they share the same socket.
255254 */
256255 if (num_online_cpus() > 1 && !running_on_qemu) {
257− int cpu;
258− unsigned long cpu0_loc;
259− cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;
260−
261− for_each_online_cpu(cpu) {
262− if (cpu == 0)
263− continue;
264− if ((cpu0_loc != 0) &&
265− (cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
266− continue;
267−
268− /* mark sched_clock unstable */
269− clear_sched_clock_stable();
270−
271− clocksource_cr16.name = "cr16_unstable";
272− clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
273− clocksource_cr16.rating = 0;
274− break;
275− }
256+ /* mark sched_clock unstable */
257+ clear_sched_clock_stable();
258+
259+ clocksource_cr16.name = "cr16_unstable";
260+ clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
261+ clocksource_cr16.rating = 0;
276262 }
277263
278264 /* register at clocksource framework */
arch/parisc/kernel/vmlinux.lds.S+1−2
@@ -57,8 +57,6 @@ SECTIONS · 56 unmodified lines
5757 {
5858 . = KERNEL_BINARY_TEXT_START;
5959
60− _stext = .; /* start of kernel text, includes init code & data */
61−
6260 __init_begin = .;
6361 HEAD_TEXT_SECTION
6462 MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
@@ -82,6 +80,7 @@ SECTIONS · 17 unmodified lines
8280 /* freed after init ends here */
8381
8482 _text = .; /* Text and read-only data */
83+ _stext = .;
8584 MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
8685 .text ALIGN(PAGE_SIZE) : {
8786 TEXT_TEXT
arch/powerpc/kernel/Makefile+3−0
@@ -196,3 +196,6 @@ clean-files := vmlinux.lds · 195 unmodified lines
196196 # Force dependency (incbin is bad)
197197 $(obj)/vdso32_wrapper.o : $(obj)/vdso32/vdso32.so.dbg
198198 $(obj)/vdso64_wrapper.o : $(obj)/vdso64/vdso64.so.dbg
199+
200+# for cleaning
201+subdir- += vdso32 vdso64
arch/powerpc/kernel/head_32.h+3−3
@@ -202,11 +202,11 @@ vmap_stack_overflow: · 201 unmodified lines
202202 mfspr r1, SPRN_SPRG_THREAD
203203 lwz r1, TASK_CPU - THREAD(r1)
204204 slwi r1, r1, 3
205− addis r1, r1, emergency_ctx@ha
205+ addis r1, r1, emergency_ctx-PAGE_OFFSET@ha
206206 #else
207− lis r1, emergency_ctx@ha
207+ lis r1, emergency_ctx-PAGE_OFFSET@ha
208208 #endif
209− lwz r1, emergency_ctx@l(r1)
209+ lwz r1, emergency_ctx-PAGE_OFFSET@l(r1)
210210 addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE
211211 EXCEPTION_PROLOG_2 0 vmap_stack_overflow
212212 prepare_transfer_to_handler
arch/powerpc/kernel/head_8xx.S+7−6
@@ -733,6 +733,7 @@ _GLOBAL(mmu_pin_tlb) · 732 unmodified lines
733733 #ifdef CONFIG_PIN_TLB_DATA
734734 LOAD_REG_IMMEDIATE(r6, PAGE_OFFSET)
735735 LOAD_REG_IMMEDIATE(r7, MI_SVALID | MI_PS8MEG | _PMD_ACCESSED)
736+ li r8, 0
736737 #ifdef CONFIG_PIN_TLB_IMMR
737738 li r0, 3
738739 #else
@@ -741,26 +742,26 @@ _GLOBAL(mmu_pin_tlb) · 2 unmodified lines
741742 mtctr r0
742743 cmpwi r4, 0
743744 beq 4f
744− LOAD_REG_IMMEDIATE(r8, 0xf0 | _PAGE_RO | _PAGE_SPS | _PAGE_SH | _PAGE_PRESENT)
745745 LOAD_REG_ADDR(r9, _sinittext)
746746
747747 2: ori r0, r6, MD_EVALID
748+ ori r12, r8, 0xf0 | _PAGE_RO | _PAGE_SPS | _PAGE_SH | _PAGE_PRESENT
748749 mtspr SPRN_MD_CTR, r5
749750 mtspr SPRN_MD_EPN, r0
750751 mtspr SPRN_MD_TWC, r7
751− mtspr SPRN_MD_RPN, r8
752+ mtspr SPRN_MD_RPN, r12
752753 addi r5, r5, 0x100
753754 addis r6, r6, SZ_8M@h
754755 addis r8, r8, SZ_8M@h
755756 cmplw r6, r9
756757 bdnzt lt, 2b
757−
758−4: LOAD_REG_IMMEDIATE(r8, 0xf0 | _PAGE_DIRTY | _PAGE_SPS | _PAGE_SH | _PAGE_PRESENT)
758+4:
759759 2: ori r0, r6, MD_EVALID
760+ ori r12, r8, 0xf0 | _PAGE_DIRTY | _PAGE_SPS | _PAGE_SH | _PAGE_PRESENT
760761 mtspr SPRN_MD_CTR, r5
761762 mtspr SPRN_MD_EPN, r0
762763 mtspr SPRN_MD_TWC, r7
763− mtspr SPRN_MD_RPN, r8
764+ mtspr SPRN_MD_RPN, r12
764765 addi r5, r5, 0x100
765766 addis r6, r6, SZ_8M@h
766767 addis r8, r8, SZ_8M@h
@@ -781,7 +782,7 @@ _GLOBAL(mmu_pin_tlb) · 14 unmodified lines
781782 #endif
782783 #if defined(CONFIG_PIN_TLB_IMMR) || defined(CONFIG_PIN_TLB_DATA)
783784 lis r0, (MD_RSV4I | MD_TWAM)@h
784− mtspr SPRN_MI_CTR, r0
785+ mtspr SPRN_MD_CTR, r0
785786 #endif
786787 mtspr SPRN_SRR1, r10
787788 mtspr SPRN_SRR0, r11
arch/powerpc/kernel/signal.h+8−2
@@ -25,8 +25,14 @@ static inline int __get_user_sigset(sigset_t *dst, const sigset_t __user *src) · 24 unmodified lines
2525
2626 return __get_user(dst->sig[0], (u64 __user *)&src->sig[0]);
2727 }
28−#define unsafe_get_user_sigset(dst, src, label) \
29− unsafe_get_user((dst)->sig[0], (u64 __user *)&(src)->sig[0], label)
28+#define unsafe_get_user_sigset(dst, src, label) do { \
29+ sigset_t *__dst = dst; \
30+ const sigset_t __user *__src = src; \
31+ int i; \
32+ \
33+ for (i = 0; i < _NSIG_WORDS; i++) \
34+ unsafe_get_user(__dst->sig[i], &__src->sig[i], label); \
35+} while (0)
3036
3137 #ifdef CONFIG_VSX
3238 extern unsigned long copy_vsx_to_user(void __user *to,
arch/powerpc/kernel/signal_32.c+1−1
@@ -1063,7 +1063,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 1062 unmodified lines
10631063 * We kill the task with a SIGSEGV in this situation.
10641064 */
10651065 if (do_setcontext(new_ctx, regs, 0)) {
1066− force_fatal_sig(SIGSEGV);
1066+ force_exit_sig(SIGSEGV);
10671067 return -EFAULT;
10681068 }
10691069
arch/powerpc/kernel/signal_64.c+2−2
@@ -704,7 +704,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 703 unmodified lines
704704 */
705705
706706 if (__get_user_sigset(&set, &new_ctx->uc_sigmask)) {
707− force_fatal_sig(SIGSEGV);
707+ force_exit_sig(SIGSEGV);
708708 return -EFAULT;
709709 }
710710 set_current_blocked(&set);
@@ -713,7 +713,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 2 unmodified lines
713713 return -EFAULT;
714714 if (__unsafe_restore_sigcontext(current, NULL, 0, &new_ctx->uc_mcontext)) {
715715 user_read_access_end();
716− force_fatal_sig(SIGSEGV);
716+ force_exit_sig(SIGSEGV);
717717 return -EFAULT;
718718 }
719719 user_read_access_end();
arch/powerpc/kernel/syscalls/syscall.tbl+1−0
@@ -528,3 +528,4 @@ · 527 unmodified lines
528528 446 common landlock_restrict_self sys_landlock_restrict_self
529529 # 447 reserved for memfd_secret
530530 448 common process_mrelease sys_process_mrelease
531+449 common futex_waitv sys_futex_waitv
arch/powerpc/kernel/watchdog.c+6−0
@@ -187,6 +187,12 @@ static void watchdog_smp_panic(int cpu, u64 tb) · 186 unmodified lines
187187 if (sysctl_hardlockup_all_cpu_backtrace)
188188 trigger_allbutself_cpu_backtrace();
189189
190+ /*
191+ * Force flush any remote buffers that might be stuck in IRQ context
192+ * and therefore could not run their irq_work.
193+ */
194+ printk_trigger_flush();
195+
190196 if (hardlockup_panic)
191197 nmi_panic(NULL, "Hard LOCKUP");
192198
arch/powerpc/kvm/book3s_hv_builtin.c+4−1
@@ -695,6 +695,7 @@ static void flush_guest_tlb(struct kvm *kvm) · 694 unmodified lines
695695 "r" (0) : "memory");
696696 }
697697 asm volatile("ptesync": : :"memory");
698+ // POWER9 congruence-class TLBIEL leaves ERAT. Flush it now.
698699 asm volatile(PPC_RADIX_INVALIDATE_ERAT_GUEST : : :"memory");
699700 } else {
700701 for (set = 0; set < kvm->arch.tlb_sets; ++set) {
@@ -705,7 +706,9 @@ static void flush_guest_tlb(struct kvm *kvm) · 4 unmodified lines
705706 rb += PPC_BIT(51); /* increment set number */
706707 }
707708 asm volatile("ptesync": : :"memory");
708− asm volatile(PPC_ISA_3_0_INVALIDATE_ERAT : : :"memory");
709+ // POWER9 congruence-class TLBIEL leaves ERAT. Flush it now.
710+ if (cpu_has_feature(CPU_FTR_ARCH_300))
711+ asm volatile(PPC_ISA_3_0_INVALIDATE_ERAT : : :"memory");
709712 }
710713 }
711714
arch/powerpc/kvm/book3s_hv_rmhandlers.S+2−2
@@ -2005,7 +2005,7 @@ hcall_real_table: · 2004 unmodified lines
20052005 .globl hcall_real_table_end
20062006 hcall_real_table_end:
20072007
2008−_GLOBAL(kvmppc_h_set_xdabr)
2008+_GLOBAL_TOC(kvmppc_h_set_xdabr)
20092009 EXPORT_SYMBOL_GPL(kvmppc_h_set_xdabr)
20102010 andi. r0, r5, DABRX_USER | DABRX_KERNEL
20112011 beq 6f
@@ -2015,7 +2015,7 @@ EXPORT_SYMBOL_GPL(kvmppc_h_set_xdabr) · 3 unmodified lines
20152015 6: li r3, H_PARAMETER
20162016 blr
20172017
2018−_GLOBAL(kvmppc_h_set_dabr)
2018+_GLOBAL_TOC(kvmppc_h_set_dabr)
20192019 EXPORT_SYMBOL_GPL(kvmppc_h_set_dabr)
20202020 li r5, DABRX_USER | DABRX_KERNEL
20212021 3:
arch/powerpc/kvm/powerpc.c+2−2
@@ -641,9 +641,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 640 unmodified lines
641641 * implementations just count online CPUs.
642642 */
643643 if (hv_enabled)
644− r = num_present_cpus();
644+ r = min_t(unsigned int, num_present_cpus(), KVM_MAX_VCPUS);
645645 else
646− r = num_online_cpus();
646+ r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
647647 break;
648648 case KVM_CAP_MAX_VCPUS:
649649 r = KVM_MAX_VCPUS;
arch/powerpc/mm/nohash/kaslr_booke.c+1−1
@@ -314,7 +314,7 @@ static unsigned long __init kaslr_choose_location(void *dt_ptr, phys_addr_t size · 313 unmodified lines
314314 pr_warn("KASLR: No safe seed for randomizing the kernel base.\n");
315315
316316 ram = min_t(phys_addr_t, __max_low_memory, size);
317− ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true, false);
317+ ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true, true);
318318 linear_sz = min_t(unsigned long, ram, SZ_512M);
319319
320320 /* If the linear size is smaller than 64M, do not randmize */
arch/powerpc/mm/nohash/tlb.c+2−2
@@ -645,7 +645,7 @@ static void early_init_this_mmu(void) · 644 unmodified lines
645645
646646 if (map)
647647 linear_map_top = map_mem_in_cams(linear_map_top,
648− num_cams, true, true);
648+ num_cams, false, true);
649649 }
650650 #endif
651651
@@ -766,7 +766,7 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, · 114 unmodified lines
766766 num_cams = (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) / 4;
767767
768768 linear_sz = map_mem_in_cams(first_memblock_size, num_cams,
769− false, true);
769+ true, true);
770770
771771 ppc64_rma_size = min_t(u64, linear_sz, 0x40000000);
772772 } else
arch/powerpc/mm/numa.c+20−24
@@ -376,9 +376,9 @@ static void initialize_form2_numa_distance_lookup_table(void) · 375 unmodified lines
376376 {
377377 int i, j;
378378 struct device_node *root;
379− const __u8 *numa_dist_table;
379+ const __u8 *form2_distances;
380380 const __be32 *numa_lookup_index;
381− int numa_dist_table_length;
381+ int form2_distances_length;
382382 int max_numa_index, distance_index;
383383
384384 if (firmware_has_feature(FW_FEATURE_OPAL))
@@ -392,45 +392,41 @@ static void initialize_form2_numa_distance_lookup_table(void) · 7 unmodified lines
392392 max_numa_index = of_read_number(&numa_lookup_index[0], 1);
393393
394394 /* first element of the array is the size and is encode-int */
395− numa_dist_table = of_get_property(root, "ibm,numa-distance-table", NULL);
396− numa_dist_table_length = of_read_number((const __be32 *)&numa_dist_table[0], 1);
395+ form2_distances = of_get_property(root, "ibm,numa-distance-table", NULL);
396+ form2_distances_length = of_read_number((const __be32 *)&form2_distances[0], 1);
397397 /* Skip the size which is encoded int */
398− numa_dist_table += sizeof(__be32);
398+ form2_distances += sizeof(__be32);
399399
400− pr_debug("numa_dist_table_len = %d, numa_dist_indexes_len = %d\n",
401− numa_dist_table_length, max_numa_index);
400+ pr_debug("form2_distances_len = %d, numa_dist_indexes_len = %d\n",
401+ form2_distances_length, max_numa_index);
402402
403403 for (i = 0; i < max_numa_index; i++)
404404 /* +1 skip the max_numa_index in the property */
405405 numa_id_index_table[i] = of_read_number(&numa_lookup_index[i + 1], 1);
406406
407407
408− if (numa_dist_table_length != max_numa_index * max_numa_index) {
408+ if (form2_distances_length != max_numa_index * max_numa_index) {
409409 WARN(1, "Wrong NUMA distance information\n");
410− /* consider everybody else just remote. */
411− for (i = 0; i < max_numa_index; i++) {
412− for (j = 0; j < max_numa_index; j++) {
413− int nodeA = numa_id_index_table[i];
414− int nodeB = numa_id_index_table[j];
415−
416− if (nodeA == nodeB)
417− numa_distance_table[nodeA][nodeB] = LOCAL_DISTANCE;
418− else
419− numa_distance_table[nodeA][nodeB] = REMOTE_DISTANCE;
420− }
421− }
410+ form2_distances = NULL; // don't use it
422411 }
423−
424412 distance_index = 0;
425413 for (i = 0; i < max_numa_index; i++) {
426414 for (j = 0; j < max_numa_index; j++) {
427415 int nodeA = numa_id_index_table[i];
428416 int nodeB = numa_id_index_table[j];
429−
430− numa_distance_table[nodeA][nodeB] = numa_dist_table[distance_index++];
431− pr_debug("dist[%d][%d]=%d ", nodeA, nodeB, numa_distance_table[nodeA][nodeB]);
417+ int dist;
418+
419+ if (form2_distances)
420+ dist = form2_distances[distance_index++];
421+ else if (nodeA == nodeB)
422+ dist = LOCAL_DISTANCE;
423+ else
424+ dist = REMOTE_DISTANCE;
425+ numa_distance_table[nodeA][nodeB] = dist;
426+ pr_debug("dist[%d][%d]=%d ", nodeA, nodeB, dist);
432427 }
433428 }
429+
434430 of_node_put(root);
435431 }
436432
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c+0−1
@@ -186,7 +186,6 @@ err: · 185 unmodified lines
186186 static int mcu_remove(struct i2c_client *client)
187187 {
188188 struct mcu *mcu = i2c_get_clientdata(client);
189− int ret;
190189
191190 kthread_stop(shutdown_thread);
192191
arch/powerpc/platforms/pseries/iommu.c+8−18
@@ -1094,15 +1094,6 @@ static phys_addr_t ddw_memory_hotplug_max(void) · 1093 unmodified lines
10941094 phys_addr_t max_addr = memory_hotplug_max();
10951095 struct device_node *memory;
10961096
1097− /*
1098− * The "ibm,pmemory" can appear anywhere in the address space.
1099− * Assuming it is still backed by page structs, set the upper limit
1100− * for the huge DMA window as MAX_PHYSMEM_BITS.
1101− */
1102− if (of_find_node_by_type(NULL, "ibm,pmemory"))
1103− return (sizeof(phys_addr_t) * 8 <= MAX_PHYSMEM_BITS) ?
1104− (phys_addr_t) -1 : (1ULL << MAX_PHYSMEM_BITS);
1105−
11061097 for_each_node_by_type(memory, "memory") {
11071098 unsigned long start, size;
11081099 int n_mem_addr_cells, n_mem_size_cells, len;
@@ -1238,7 +1229,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 129 unmodified lines
12381229 u32 ddw_avail[DDW_APPLICABLE_SIZE];
12391230 struct dma_win *window;
12401231 struct property *win64;
1241− bool ddw_enabled = false;
12421232 struct failed_ddw_pdn *fpdn;
12431233 bool default_win_removed = false, direct_mapping = false;
12441234 bool pmem_present;
@@ -1253,7 +1243,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 8 unmodified lines
12531243
12541244 if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) {
12551245 direct_mapping = (len >= max_ram_len);
1256− ddw_enabled = true;
12571246 goto out_unlock;
12581247 }
12591248
@@ -1367,8 +1356,10 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 107 unmodified lines
13671356 len = order_base_2(query.largest_available_block << page_shift);
13681357 win_name = DMA64_PROPNAME;
13691358 } else {
1370− direct_mapping = true;
1371− win_name = DIRECT64_PROPNAME;
1359+ direct_mapping = !default_win_removed ||
1360+ (len == MAX_PHYSMEM_BITS) ||
1361+ (!pmem_present && (len == max_ram_len));
1362+ win_name = direct_mapping ? DIRECT64_PROPNAME : DMA64_PROPNAME;
13721363 }
13731364
13741365 ret = create_ddw(dev, ddw_avail, &create, page_shift, len);
@@ -1406,8 +1397,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 31 unmodified lines
14061397 dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n",
14071398 dn, ret);
14081399
1409− /* Make sure to clean DDW if any TCE was set*/
1410− clean_dma_window(pdn, win64->value);
1400+ /* Make sure to clean DDW if any TCE was set*/
1401+ clean_dma_window(pdn, win64->value);
14111402 goto out_del_list;
14121403 }
14131404 } else {
@@ -1454,7 +1445,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 40 unmodified lines
14541445 spin_unlock(&dma_win_list_lock);
14551446
14561447 dev->dev.archdata.dma_offset = win_addr;
1457− ddw_enabled = true;
14581448 goto out_unlock;
14591449
14601450 out_del_list:
@@ -1490,10 +1480,10 @@ out_unlock: · 29 unmodified lines
14901480 * as RAM, then we failed to create a window to cover persistent
14911481 * memory and need to set the DMA limit.
14921482 */
1493− if (pmem_present && ddw_enabled && direct_mapping && len == max_ram_len)
1483+ if (pmem_present && direct_mapping && len == max_ram_len)
14941484 dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset + (1ULL << len);
14951485
1496− return ddw_enabled && direct_mapping;
1486+ return direct_mapping;
14971487 }
14981488
14991489 static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
arch/powerpc/sysdev/xive/Kconfig+0−1
@@ -3,7 +3,6 @@ config PPC_XIVE · 2 unmodified lines
33 bool
44 select PPC_SMP_MUXED_IPI
55 select HARDIRQS_SW_RESEND
6− select IRQ_DOMAIN_NOMAP
76
87 config PPC_XIVE_NATIVE
98 bool
arch/powerpc/sysdev/xive/common.c+1−2
@@ -1443,8 +1443,7 @@ static const struct irq_domain_ops xive_irq_domain_ops = { · 1442 unmodified lines
14431443
14441444 static void __init xive_init_host(struct device_node *np)
14451445 {
1446− xive_irq_domain = irq_domain_add_nomap(np, XIVE_MAX_IRQ,
1447− &xive_irq_domain_ops, NULL);
1446+ xive_irq_domain = irq_domain_add_tree(np, &xive_irq_domain_ops, NULL);
14481447 if (WARN_ON(xive_irq_domain == NULL))
14491448 return;
14501449 irq_set_default_host(xive_irq_domain);
arch/riscv/Makefile+2−0
@@ -107,11 +107,13 @@ PHONY += vdso_install · 106 unmodified lines
107107 vdso_install:
108108 $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@
109109
110+ifeq ($(KBUILD_EXTMOD),)
110111 ifeq ($(CONFIG_MMU),y)
111112 prepare: vdso_prepare
112113 vdso_prepare: prepare0
113114 $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso include/generated/vdso-offsets.h
114115 endif
116+endif
115117
116118 ifneq ($(CONFIG_XIP_KERNEL),y)
117119 ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAAN),yy)
arch/riscv/configs/defconfig+2−0
@@ -19,6 +19,8 @@ CONFIG_SOC_VIRT=y · 18 unmodified lines
1919 CONFIG_SOC_MICROCHIP_POLARFIRE=y
2020 CONFIG_SMP=y
2121 CONFIG_HOTPLUG_CPU=y
22+CONFIG_VIRTUALIZATION=y
23+CONFIG_KVM=m
2224 CONFIG_JUMP_LABEL=y
2325 CONFIG_MODULES=y
2426 CONFIG_MODULE_UNLOAD=y
arch/riscv/configs/rv32_defconfig+2−0
@@ -19,6 +19,8 @@ CONFIG_SOC_VIRT=y · 18 unmodified lines
1919 CONFIG_ARCH_RV32I=y
2020 CONFIG_SMP=y
2121 CONFIG_HOTPLUG_CPU=y
22+CONFIG_VIRTUALIZATION=y
23+CONFIG_KVM=m
2224 CONFIG_JUMP_LABEL=y
2325 CONFIG_MODULES=y
2426 CONFIG_MODULE_UNLOAD=y
arch/riscv/include/asm/kvm_host.h+3−5
@@ -12,14 +12,12 @@ · 11 unmodified lines
1212 #include <linux/types.h>
1313 #include <linux/kvm.h>
1414 #include <linux/kvm_types.h>
15+#include <asm/csr.h>
1516 #include <asm/kvm_vcpu_fp.h>
1617 #include <asm/kvm_vcpu_timer.h>
1718
18−#ifdef CONFIG_64BIT
19−#define KVM_MAX_VCPUS (1U << 16)
20−#else
21−#define KVM_MAX_VCPUS (1U << 9)
22−#endif
19+#define KVM_MAX_VCPUS \
20+ ((HGATP_VMID_MASK >> HGATP_VMID_SHIFT) + 1)
2321
2422 #define KVM_HALT_POLL_NS_DEFAULT 500000
2523
arch/riscv/kvm/mmu.c+6−0
@@ -453,6 +453,12 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm) · 452 unmodified lines
453453 void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
454454 struct kvm_memory_slot *slot)
455455 {
456+ gpa_t gpa = slot->base_gfn << PAGE_SHIFT;
457+ phys_addr_t size = slot->npages << PAGE_SHIFT;
458+
459+ spin_lock(&kvm->mmu_lock);
460+ stage2_unmap_range(kvm, gpa, size, false);
461+ spin_unlock(&kvm->mmu_lock);
456462 }
457463
458464 void kvm_arch_commit_memory_region(struct kvm *kvm,
arch/riscv/kvm/vcpu.c+1−1
@@ -740,7 +740,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 739 unmodified lines
740740 * Ensure we set mode to IN_GUEST_MODE after we disable
741741 * interrupts and before the final VCPU requests check.
742742 * See the comment in kvm_vcpu_exiting_guest_mode() and
743− * Documentation/virtual/kvm/vcpu-requests.rst
743+ * Documentation/virt/kvm/vcpu-requests.rst
744744 */
745745 vcpu->mode = IN_GUEST_MODE;
746746
arch/riscv/kvm/vcpu_sbi.c+1−1
@@ -1,5 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2−/**
2+/*
33 * Copyright (c) 2019 Western Digital Corporation or its affiliates.
44 *
55 * Authors:
arch/riscv/kvm/vm.c+1−1
@@ -74,7 +74,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 73 unmodified lines
7474 r = 1;
7575 break;
7676 case KVM_CAP_NR_VCPUS:
77− r = num_online_cpus();
77+ r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
7878 break;
7979 case KVM_CAP_MAX_VCPUS:
8080 r = KVM_MAX_VCPUS;
arch/s390/Kconfig+2−1
@@ -47,7 +47,7 @@ config ARCH_SUPPORTS_UPROBES · 46 unmodified lines
4747 config KASAN_SHADOW_OFFSET
4848 hex
4949 depends on KASAN
50− default 0x18000000000000
50+ default 0x1C000000000000
5151
5252 config S390
5353 def_bool y
@@ -194,6 +194,7 @@ config S390 · 140 unmodified lines
194194 select HAVE_RELIABLE_STACKTRACE
195195 select HAVE_RSEQ
196196 select HAVE_SAMPLE_FTRACE_DIRECT
197+ select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
197198 select HAVE_SOFTIRQ_ON_OWN_STACK
198199 select HAVE_SYSCALL_TRACEPOINTS
199200 select HAVE_VIRT_CPU_ACCOUNTING
arch/s390/Makefile+6−4
@@ -77,10 +77,12 @@ KBUILD_AFLAGS_DECOMPRESSOR += $(aflags-y) · 76 unmodified lines
7777 KBUILD_CFLAGS_DECOMPRESSOR += $(cflags-y)
7878
7979 ifneq ($(call cc-option,-mstack-size=8192 -mstack-guard=128),)
80−cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
81−ifeq ($(call cc-option,-mstack-size=8192),)
82−cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
83−endif
80+ CC_FLAGS_CHECK_STACK := -mstack-size=$(STACK_SIZE)
81+ ifeq ($(call cc-option,-mstack-size=8192),)
82+ CC_FLAGS_CHECK_STACK += -mstack-guard=$(CONFIG_STACK_GUARD)
83+ endif
84+ export CC_FLAGS_CHECK_STACK
85+ cflags-$(CONFIG_CHECK_STACK) += $(CC_FLAGS_CHECK_STACK)
8486 endif
8587
8688 ifdef CONFIG_EXPOLINE
arch/s390/boot/startup.c+31−57
@@ -149,82 +149,56 @@ static void setup_ident_map_size(unsigned long max_physmem_end) · 148 unmodified lines
149149
150150 static void setup_kernel_memory_layout(void)
151151 {
152− bool vmalloc_size_verified = false;
153− unsigned long vmemmap_off;
154− unsigned long vspace_left;
152+ unsigned long vmemmap_start;
155153 unsigned long rte_size;
156154 unsigned long pages;
157− unsigned long vmax;
158155
159156 pages = ident_map_size / PAGE_SIZE;
160157 /* vmemmap contains a multiple of PAGES_PER_SECTION struct pages */
161158 vmemmap_size = SECTION_ALIGN_UP(pages) * sizeof(struct page);
162159
163160 /* choose kernel address space layout: 4 or 3 levels. */
164− vmemmap_off = round_up(ident_map_size, _REGION3_SIZE);
161+ vmemmap_start = round_up(ident_map_size, _REGION3_SIZE);
165162 if (IS_ENABLED(CONFIG_KASAN) ||
166163 vmalloc_size > _REGION2_SIZE ||
167− vmemmap_off + vmemmap_size + vmalloc_size + MODULES_LEN > _REGION2_SIZE)
168− vmax = _REGION1_SIZE;
169− else
170− vmax = _REGION2_SIZE;
171−
172− /* keep vmemmap_off aligned to a top level region table entry */
173− rte_size = vmax == _REGION1_SIZE ? _REGION2_SIZE : _REGION3_SIZE;
174− MODULES_END = vmax;
175− if (is_prot_virt_host()) {
176− /*
177− * forcing modules and vmalloc area under the ultravisor
178− * secure storage limit, so that any vmalloc allocation
179− * we do could be used to back secure guest storage.
180− */
181− adjust_to_uv_max(&MODULES_END);
182− }
183−
184−#ifdef CONFIG_KASAN
185− if (MODULES_END < vmax) {
186− /* force vmalloc and modules below kasan shadow */
187− MODULES_END = min(MODULES_END, KASAN_SHADOW_START);
164+ vmemmap_start + vmemmap_size + vmalloc_size + MODULES_LEN >
165+ _REGION2_SIZE) {
166+ MODULES_END = _REGION1_SIZE;
167+ rte_size = _REGION2_SIZE;
188168 } else {
189− /*
190− * leave vmalloc and modules above kasan shadow but make
191− * sure they don't overlap with it
192− */
193− vmalloc_size = min(vmalloc_size, vmax - KASAN_SHADOW_END - MODULES_LEN);
194− vmalloc_size_verified = true;
195− vspace_left = KASAN_SHADOW_START;
169+ MODULES_END = _REGION2_SIZE;
170+ rte_size = _REGION3_SIZE;
196171 }
172+ /*
173+ * forcing modules and vmalloc area under the ultravisor
174+ * secure storage limit, so that any vmalloc allocation
175+ * we do could be used to back secure guest storage.
176+ */
177+ adjust_to_uv_max(&MODULES_END);
178+#ifdef CONFIG_KASAN
179+ /* force vmalloc and modules below kasan shadow */
180+ MODULES_END = min(MODULES_END, KASAN_SHADOW_START);
197181 #endif
198182 MODULES_VADDR = MODULES_END - MODULES_LEN;
199183 VMALLOC_END = MODULES_VADDR;
200184
201− if (vmalloc_size_verified) {
202− VMALLOC_START = VMALLOC_END - vmalloc_size;
203− } else {
204− vmemmap_off = round_up(ident_map_size, rte_size);
205−
206− if (vmemmap_off + vmemmap_size > VMALLOC_END ||
207− vmalloc_size > VMALLOC_END - vmemmap_off - vmemmap_size) {
208− /*
209− * allow vmalloc area to occupy up to 1/2 of
210− * the rest virtual space left.
211− */
212− vmalloc_size = min(vmalloc_size, VMALLOC_END / 2);
213− }
214− VMALLOC_START = VMALLOC_END - vmalloc_size;
215− vspace_left = VMALLOC_START;
216− }
185+ /* allow vmalloc area to occupy up to about 1/2 of the rest virtual space left */
186+ vmalloc_size = min(vmalloc_size, round_down(VMALLOC_END / 2, _REGION3_SIZE));
187+ VMALLOC_START = VMALLOC_END - vmalloc_size;
217188
218− pages = vspace_left / (PAGE_SIZE + sizeof(struct page));
189+ /* split remaining virtual space between 1:1 mapping & vmemmap array */
190+ pages = VMALLOC_START / (PAGE_SIZE + sizeof(struct page));
219191 pages = SECTION_ALIGN_UP(pages);
220− vmemmap_off = round_up(vspace_left - pages * sizeof(struct page), rte_size);
221− /* keep vmemmap left most starting from a fresh region table entry */
222− vmemmap_off = min(vmemmap_off, round_up(ident_map_size, rte_size));
223− /* take care that identity map is lower then vmemmap */
224− ident_map_size = min(ident_map_size, vmemmap_off);
192+ /* keep vmemmap_start aligned to a top level region table entry */
193+ vmemmap_start = round_down(VMALLOC_START - pages * sizeof(struct page), rte_size);
194+ /* vmemmap_start is the future VMEM_MAX_PHYS, make sure it is within MAX_PHYSMEM */
195+ vmemmap_start = min(vmemmap_start, 1UL << MAX_PHYSMEM_BITS);
196+ /* make sure identity map doesn't overlay with vmemmap */
197+ ident_map_size = min(ident_map_size, vmemmap_start);
225198 vmemmap_size = SECTION_ALIGN_UP(ident_map_size / PAGE_SIZE) * sizeof(struct page);
226− VMALLOC_START = max(vmemmap_off + vmemmap_size, VMALLOC_START);
227− vmemmap = (struct page *)vmemmap_off;
199+ /* make sure vmemmap doesn't overlay with vmalloc area */
200+ VMALLOC_START = max(vmemmap_start + vmemmap_size, VMALLOC_START);
201+ vmemmap = (struct page *)vmemmap_start;
228202 }
229203
230204 /*
arch/s390/configs/debug_defconfig+8−2
@@ -403,7 +403,6 @@ CONFIG_DEVTMPFS=y · 402 unmodified lines
403403 CONFIG_CONNECTOR=y
404404 CONFIG_ZRAM=y
405405 CONFIG_BLK_DEV_LOOP=m
406−CONFIG_BLK_DEV_CRYPTOLOOP=m
407406 CONFIG_BLK_DEV_DRBD=m
408407 CONFIG_BLK_DEV_NBD=m
409408 CONFIG_BLK_DEV_RAM=y
@@ -476,6 +475,7 @@ CONFIG_MACVLAN=m · 66 unmodified lines
476475 CONFIG_MACVTAP=m
477476 CONFIG_VXLAN=m
478477 CONFIG_BAREUDP=m
478+CONFIG_AMT=m
479479 CONFIG_TUN=m
480480 CONFIG_VETH=m
481481 CONFIG_VIRTIO_NET=m
@@ -489,6 +489,7 @@ CONFIG_NLMON=m · 7 unmodified lines
489489 # CONFIG_NET_VENDOR_AMD is not set
490490 # CONFIG_NET_VENDOR_AQUANTIA is not set
491491 # CONFIG_NET_VENDOR_ARC is not set
492+# CONFIG_NET_VENDOR_ASIX is not set
492493 # CONFIG_NET_VENDOR_ATHEROS is not set
493494 # CONFIG_NET_VENDOR_BROADCOM is not set
494495 # CONFIG_NET_VENDOR_BROCADE is not set
@@ -571,6 +572,7 @@ CONFIG_WATCHDOG=y · 76 unmodified lines
571572 CONFIG_WATCHDOG_NOWAYOUT=y
572573 CONFIG_SOFT_WATCHDOG=m
573574 CONFIG_DIAG288_WATCHDOG=m
575+# CONFIG_DRM_DEBUG_MODESET_LOCK is not set
574576 CONFIG_FB=y
575577 CONFIG_FRAMEBUFFER_CONSOLE=y
576578 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
@@ -775,12 +777,14 @@ CONFIG_CRC4=m · 198 unmodified lines
775777 CONFIG_CRC7=m
776778 CONFIG_CRC8=m
777779 CONFIG_RANDOM32_SELFTEST=y
780+CONFIG_XZ_DEC_MICROLZMA=y
778781 CONFIG_DMA_CMA=y
779782 CONFIG_CMA_SIZE_MBYTES=0
780783 CONFIG_PRINTK_TIME=y
781784 CONFIG_DYNAMIC_DEBUG=y
782785 CONFIG_DEBUG_INFO=y
783786 CONFIG_DEBUG_INFO_DWARF4=y
787+CONFIG_DEBUG_INFO_BTF=y
784788 CONFIG_GDB_SCRIPTS=y
785789 CONFIG_HEADERS_INSTALL=y
786790 CONFIG_DEBUG_SECTION_MISMATCH=y
@@ -807,6 +811,7 @@ CONFIG_DEBUG_MEMORY_INIT=y · 20 unmodified lines
807811 CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
808812 CONFIG_DEBUG_PER_CPU_MAPS=y
809813 CONFIG_KFENCE=y
814+CONFIG_KFENCE_STATIC_KEYS=y
810815 CONFIG_DEBUG_SHIRQ=y
811816 CONFIG_PANIC_ON_OOPS=y
812817 CONFIG_DETECT_HUNG_TASK=y
@@ -842,6 +847,7 @@ CONFIG_FTRACE_STARTUP_TEST=y · 29 unmodified lines
842847 CONFIG_SAMPLES=y
843848 CONFIG_SAMPLE_TRACE_PRINTK=m
844849 CONFIG_SAMPLE_FTRACE_DIRECT=m
850+CONFIG_SAMPLE_FTRACE_DIRECT_MULTI=m
845851 CONFIG_DEBUG_ENTRY=y
846852 CONFIG_CIO_INJECT=y
847853 CONFIG_KUNIT=m
@@ -860,7 +866,7 @@ CONFIG_FAIL_FUNCTION=y · 12 unmodified lines
860866 CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
861867 CONFIG_LKDTM=m
862868 CONFIG_TEST_MIN_HEAP=y
863−CONFIG_KPROBES_SANITY_TEST=y
869+CONFIG_KPROBES_SANITY_TEST=m
864870 CONFIG_RBTREE_TEST=y
865871 CONFIG_INTERVAL_TREE_TEST=m
866872 CONFIG_PERCPU_TEST=m
arch/s390/configs/defconfig+6−1
@@ -394,7 +394,6 @@ CONFIG_DEVTMPFS=y · 393 unmodified lines
394394 CONFIG_CONNECTOR=y
395395 CONFIG_ZRAM=y
396396 CONFIG_BLK_DEV_LOOP=m
397−CONFIG_BLK_DEV_CRYPTOLOOP=m
398397 CONFIG_BLK_DEV_DRBD=m
399398 CONFIG_BLK_DEV_NBD=m
400399 CONFIG_BLK_DEV_RAM=y
@@ -467,6 +466,7 @@ CONFIG_MACVLAN=m · 66 unmodified lines
467466 CONFIG_MACVTAP=m
468467 CONFIG_VXLAN=m
469468 CONFIG_BAREUDP=m
469+CONFIG_AMT=m
470470 CONFIG_TUN=m
471471 CONFIG_VETH=m
472472 CONFIG_VIRTIO_NET=m
@@ -480,6 +480,7 @@ CONFIG_NLMON=m · 7 unmodified lines
480480 # CONFIG_NET_VENDOR_AMD is not set
481481 # CONFIG_NET_VENDOR_AQUANTIA is not set
482482 # CONFIG_NET_VENDOR_ARC is not set
483+# CONFIG_NET_VENDOR_ASIX is not set
483484 # CONFIG_NET_VENDOR_ATHEROS is not set
484485 # CONFIG_NET_VENDOR_BROADCOM is not set
485486 # CONFIG_NET_VENDOR_BROCADE is not set
@@ -762,12 +763,14 @@ CONFIG_PRIME_NUMBERS=m · 276 unmodified lines
762763 CONFIG_CRC4=m
763764 CONFIG_CRC7=m
764765 CONFIG_CRC8=m
766+CONFIG_XZ_DEC_MICROLZMA=y
765767 CONFIG_DMA_CMA=y
766768 CONFIG_CMA_SIZE_MBYTES=0
767769 CONFIG_PRINTK_TIME=y
768770 CONFIG_DYNAMIC_DEBUG=y
769771 CONFIG_DEBUG_INFO=y
770772 CONFIG_DEBUG_INFO_DWARF4=y
773+CONFIG_DEBUG_INFO_BTF=y
771774 CONFIG_GDB_SCRIPTS=y
772775 CONFIG_DEBUG_SECTION_MISMATCH=y
773776 CONFIG_MAGIC_SYSRQ=y
@@ -792,9 +795,11 @@ CONFIG_HIST_TRIGGERS=y · 18 unmodified lines
792795 CONFIG_SAMPLES=y
793796 CONFIG_SAMPLE_TRACE_PRINTK=m
794797 CONFIG_SAMPLE_FTRACE_DIRECT=m
798+CONFIG_SAMPLE_FTRACE_DIRECT_MULTI=m
795799 CONFIG_KUNIT=m
796800 CONFIG_KUNIT_DEBUGFS=y
797801 CONFIG_LKDTM=m
802+CONFIG_KPROBES_SANITY_TEST=m
798803 CONFIG_PERCPU_TEST=m
799804 CONFIG_ATOMIC64_SELFTEST=y
800805 CONFIG_TEST_BPF=m
arch/s390/configs/zfcpdump_defconfig+2−0
@@ -65,9 +65,11 @@ CONFIG_ZFCP=y · 64 unmodified lines
6565 # CONFIG_NETWORK_FILESYSTEMS is not set
6666 CONFIG_LSM="yama,loadpin,safesetid,integrity"
6767 # CONFIG_ZLIB_DFLTCC is not set
68+CONFIG_XZ_DEC_MICROLZMA=y
6869 CONFIG_PRINTK_TIME=y
6970 # CONFIG_SYMBOLIC_ERRNAME is not set
7071 CONFIG_DEBUG_INFO=y
72+CONFIG_DEBUG_INFO_BTF=y
7173 CONFIG_DEBUG_FS=y
7274 CONFIG_DEBUG_KERNEL=y
7375 CONFIG_PANIC_ON_OOPS=y
arch/s390/include/asm/kexec.h+6−0
@@ -74,6 +74,12 @@ void *kexec_file_add_components(struct kimage *image, · 73 unmodified lines
7474 int arch_kexec_do_relocs(int r_type, void *loc, unsigned long val,
7575 unsigned long addr);
7676
77+#define ARCH_HAS_KIMAGE_ARCH
78+
79+struct kimage_arch {
80+ void *ipl_buf;
81+};
82+
7783 extern const struct kexec_file_ops s390_kexec_image_ops;
7884 extern const struct kexec_file_ops s390_kexec_elf_ops;
7985
arch/s390/include/asm/pci_io.h+4−3
@@ -14,12 +14,13 @@ · 13 unmodified lines
1414
1515 /* I/O Map */
1616 #define ZPCI_IOMAP_SHIFT 48
17−#define ZPCI_IOMAP_ADDR_BASE 0x8000000000000000UL
17+#define ZPCI_IOMAP_ADDR_SHIFT 62
18+#define ZPCI_IOMAP_ADDR_BASE (1UL << ZPCI_IOMAP_ADDR_SHIFT)
1819 #define ZPCI_IOMAP_ADDR_OFF_MASK ((1UL << ZPCI_IOMAP_SHIFT) - 1)
1920 #define ZPCI_IOMAP_MAX_ENTRIES \
20− ((ULONG_MAX - ZPCI_IOMAP_ADDR_BASE + 1) / (1UL << ZPCI_IOMAP_SHIFT))
21+ (1UL << (ZPCI_IOMAP_ADDR_SHIFT - ZPCI_IOMAP_SHIFT))
2122 #define ZPCI_IOMAP_ADDR_IDX_MASK \
22− (~ZPCI_IOMAP_ADDR_OFF_MASK - ZPCI_IOMAP_ADDR_BASE)
23+ ((ZPCI_IOMAP_ADDR_BASE - 1) & ~ZPCI_IOMAP_ADDR_OFF_MASK)
2324
2425 struct zpci_iomap_entry {
2526 u32 fh;
arch/s390/kernel/crash_dump.c+2−2
@@ -191,8 +191,8 @@ static int copy_oldmem_user(void __user *dst, void *src, size_t count) · 190 unmodified lines
191191 return rc;
192192 } else {
193193 /* Check for swapped kdump oldmem areas */
194− if (oldmem_data.start && from - oldmem_data.size < oldmem_data.size) {
195− from -= oldmem_data.size;
194+ if (oldmem_data.start && from - oldmem_data.start < oldmem_data.size) {
195+ from -= oldmem_data.start;
196196 len = min(count, oldmem_data.size - from);
197197 } else if (oldmem_data.start && from < oldmem_data.size) {
198198 len = min(count, oldmem_data.size - from);
arch/s390/kernel/ipl.c+2−1
@@ -2156,7 +2156,7 @@ void *ipl_report_finish(struct ipl_report *report) · 2155 unmodified lines
21562156
21572157 buf = vzalloc(report->size);
21582158 if (!buf)
2159− return ERR_PTR(-ENOMEM);
2159+ goto out;
21602160 ptr = buf;
21612161
21622162 memcpy(ptr, report->ipib, report->ipib->hdr.len);
@@ -2195,6 +2195,7 @@ void *ipl_report_finish(struct ipl_report *report) · 32 unmodified lines
21952195 }
21962196
21972197 BUG_ON(ptr > buf + report->size);
2198+out:
21982199 return buf;
21992200 }
22002201
arch/s390/kernel/machine_kexec_file.c+17−1
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/kexec.h>
1313 #include <linux/module_signature.h>
1414 #include <linux/verification.h>
15+#include <linux/vmalloc.h>
1516 #include <asm/boot_data.h>
1617 #include <asm/ipl.h>
1718 #include <asm/setup.h>
@@ -170,6 +171,7 @@ static int kexec_file_add_ipl_report(struct kimage *image, · 152 unmodified lines
170171 struct kexec_buf buf;
171172 unsigned long addr;
172173 void *ptr, *end;
174+ int ret;
173175
174176 buf.image = image;
175177
@@ -199,9 +201,13 @@ static int kexec_file_add_ipl_report(struct kimage *image, · 23 unmodified lines
199201 ptr += len;
200202 }
201203
204+ ret = -ENOMEM;
202205 buf.buffer = ipl_report_finish(data->report);
206+ if (!buf.buffer)
207+ goto out;
203208 buf.bufsz = data->report->size;
204209 buf.memsz = buf.bufsz;
210+ image->arch.ipl_buf = buf.buffer;
205211
206212 data->memsz += buf.memsz;
207213
@@ -209,7 +215,9 @@ static int kexec_file_add_ipl_report(struct kimage *image, · 1 unmodified line
209215 data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr);
210216 *lc_ipl_parmblock_ptr = (__u32)buf.mem;
211217
212− return kexec_add_buffer(&buf);
218+ ret = kexec_add_buffer(&buf);
219+out:
220+ return ret;
213221 }
214222
215223 void *kexec_file_add_components(struct kimage *image,
@@ -322,3 +330,11 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi, · 106 unmodified lines
322330 }
323331 return 0;
324332 }
333+
334+int arch_kimage_file_post_load_cleanup(struct kimage *image)
335+{
336+ vfree(image->arch.ipl_buf);
337+ image->arch.ipl_buf = NULL;
338+
339+ return kexec_image_post_load_cleanup_default(image);
340+}
arch/s390/kernel/setup.c+5−17
@@ -606,7 +606,7 @@ static void __init setup_resources(void) · 605 unmodified lines
606606
607607 static void __init setup_memory_end(void)
608608 {
609− memblock_remove(ident_map_size, ULONG_MAX);
609+ memblock_remove(ident_map_size, PHYS_ADDR_MAX - ident_map_size);
610610 max_pfn = max_low_pfn = PFN_DOWN(ident_map_size);
611611 pr_notice("The maximum memory size is %luMB\n", ident_map_size >> 20);
612612 }
@@ -637,14 +637,6 @@ static struct notifier_block kdump_mem_nb = { · 24 unmodified lines
637637
638638 #endif
639639
640−/*
641− * Make sure that the area above identity mapping is protected
642− */
643−static void __init reserve_above_ident_map(void)
644−{
645− memblock_reserve(ident_map_size, ULONG_MAX);
646−}
647−
648640 /*
649641 * Reserve memory for kdump kernel to be loaded with kexec
650642 */
@@ -785,7 +777,6 @@ static void __init memblock_add_mem_detect_info(void) · 134 unmodified lines
785777 }
786778 memblock_set_bottom_up(false);
787779 memblock_set_node(0, ULONG_MAX, &memblock.memory, 0);
788− memblock_dump_all();
789780 }
790781
791782 /*
@@ -826,9 +817,6 @@ static void __init setup_memory(void) · 34 unmodified lines
826817 storage_key_init_range(start, end);
827818
828819 psw_set_key(PAGE_DEFAULT_KEY);
829−
830− /* Only cosmetics */
831− memblock_enforce_memory_limit(memblock_end_of_DRAM());
832820 }
833821
834822 static void __init relocate_amode31_section(void)
@@ -999,24 +987,24 @@ void __init setup_arch(char **cmdline_p) · 164 unmodified lines
999987 setup_control_program_code();
1000988
1001989 /* Do some memory reservations *before* memory is added to memblock */
1002− reserve_above_ident_map();
1003990 reserve_kernel();
1004991 reserve_initrd();
1005992 reserve_certificate_list();
1006993 reserve_mem_detect_info();
994+ memblock_set_current_limit(ident_map_size);
1007995 memblock_allow_resize();
1008996
1009997 /* Get information about *all* installed memory */
1010998 memblock_add_mem_detect_info();
1011999
10121000 free_mem_detect_info();
1001+ setup_memory_end();
1002+ memblock_dump_all();
1003+ setup_memory();
10131004
10141005 relocate_amode31_section();
10151006 setup_cr();
1016−
10171007 setup_uv();
1018− setup_memory_end();
1019− setup_memory();
10201008 dma_contiguous_reserve(ident_map_size);
10211009 vmcp_cma_reserve();
10221010 if (MACHINE_HAS_EDAT2)
arch/s390/kernel/syscalls/syscall.tbl+1−0
@@ -451,3 +451,4 @@ · 450 unmodified lines
451451 446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self
452452 # 447 reserved for memfd_secret
453453 448 common process_mrelease sys_process_mrelease sys_process_mrelease
454+449 common futex_waitv sys_futex_waitv sys_futex_waitv
arch/s390/kernel/traps.c+1−1
@@ -84,7 +84,7 @@ static void default_trap_handler(struct pt_regs *regs) · 83 unmodified lines
8484 {
8585 if (user_mode(regs)) {
8686 report_user_fault(regs, SIGSEGV, 0);
87− force_fatal_sig(SIGSEGV);
87+ force_exit_sig(SIGSEGV);
8888 } else
8989 die(regs, "Unknown program exception");
9090 }
arch/s390/kernel/vdso32/Makefile+1−1
@@ -22,7 +22,7 @@ KBUILD_AFLAGS_32 += -m31 -s · 21 unmodified lines
2222 KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
2323 KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin
2424
25−LDFLAGS_vdso32.so.dbg += -fPIC -shared -nostdlib -soname=linux-vdso32.so.1 \
25+LDFLAGS_vdso32.so.dbg += -fPIC -shared -soname=linux-vdso32.so.1 \
2626 --hash-style=both --build-id=sha1 -melf_s390 -T
2727
2828 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
arch/s390/kernel/vdso64/Makefile+4−3
@@ -8,8 +8,9 @@ ARCH_REL_TYPE_ABS += R_390_GOT|R_390_PLT · 7 unmodified lines
88 include $(srctree)/lib/vdso/Makefile
99 obj-vdso64 = vdso_user_wrapper.o note.o
1010 obj-cvdso64 = vdso64_generic.o getcpu.o
11−CFLAGS_REMOVE_getcpu.o = -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE)
12−CFLAGS_REMOVE_vdso64_generic.o = -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE)
11+VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE) $(CC_FLAGS_CHECK_STACK)
12+CFLAGS_REMOVE_getcpu.o = $(VDSO_CFLAGS_REMOVE)
13+CFLAGS_REMOVE_vdso64_generic.o = $(VDSO_CFLAGS_REMOVE)
1314
1415 # Build rules
1516
@@ -25,7 +26,7 @@ KBUILD_AFLAGS_64 += -m64 -s · 9 unmodified lines
2526
2627 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
2728 KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin
28−ldflags-y := -fPIC -shared -nostdlib -soname=linux-vdso64.so.1 \
29+ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \
2930 --hash-style=both --build-id=sha1 -T
3031
3132 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
arch/s390/kvm/kvm-s390.c+2−0
@@ -585,6 +585,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 584 unmodified lines
585585 r = KVM_MAX_VCPUS;
586586 else if (sclp.has_esca && sclp.has_64bscao)
587587 r = KVM_S390_ESCA_CPU_SLOTS;
588+ if (ext == KVM_CAP_NR_VCPUS)
589+ r = min_t(unsigned int, num_online_cpus(), r);
588590 break;
589591 case KVM_CAP_S390_COW:
590592 r = MACHINE_HAS_ESOP;
arch/s390/lib/test_unwind.c+3−2
@@ -173,10 +173,11 @@ static noinline int unwindme_func4(struct unwindme *u) · 172 unmodified lines
173173 }
174174
175175 /*
176− * trigger specification exception
176+ * Trigger operation exception; use insn notation to bypass
177+ * llvm's integrated assembler sanity checks.
177178 */
178179 asm volatile(
179− " mvcl %%r1,%%r1\n"
180+ " .insn e,0x0000\n" /* illegal opcode */
180181 "0: nopr %%r7\n"
181182 EX_TABLE(0b, 0b)
182183 :);
arch/sh/include/asm/cacheflush.h+0−1
@@ -43,7 +43,6 @@ extern void flush_cache_range(struct vm_area_struct *vma, · 42 unmodified lines
4343 unsigned long start, unsigned long end);
4444 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
4545 void flush_dcache_page(struct page *page);
46−void flush_dcache_folio(struct folio *folio);
4746 extern void flush_icache_range(unsigned long start, unsigned long end);
4847 #define flush_icache_user_range flush_icache_range
4948 extern void flush_icache_page(struct vm_area_struct *vma,
arch/sh/kernel/syscalls/syscall.tbl+1−0
@@ -451,3 +451,4 @@ · 450 unmodified lines
451451 446 common landlock_restrict_self sys_landlock_restrict_self
452452 # 447 reserved for memfd_secret
453453 448 common process_mrelease sys_process_mrelease
454+449 common futex_waitv sys_futex_waitv
arch/sparc/kernel/signal_32.c+2−2
@@ -244,7 +244,7 @@ static int setup_frame(struct ksignal *ksig, struct pt_regs *regs, · 243 unmodified lines
244244 get_sigframe(ksig, regs, sigframe_size);
245245
246246 if (invalid_frame_pointer(sf, sigframe_size)) {
247− force_fatal_sig(SIGILL);
247+ force_exit_sig(SIGILL);
248248 return -EINVAL;
249249 }
250250
@@ -336,7 +336,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs, · 85 unmodified lines
336336 sf = (struct rt_signal_frame __user *)
337337 get_sigframe(ksig, regs, sigframe_size);
338338 if (invalid_frame_pointer(sf, sigframe_size)) {
339− force_fatal_sig(SIGILL);
339+ force_exit_sig(SIGILL);
340340 return -EINVAL;
341341 }
342342
arch/sparc/kernel/syscalls/syscall.tbl+1−0
@@ -494,3 +494,4 @@ · 493 unmodified lines
494494 446 common landlock_restrict_self sys_landlock_restrict_self
495495 # 447 reserved for memfd_secret
496496 448 common process_mrelease sys_process_mrelease
497+449 common futex_waitv sys_futex_waitv
arch/sparc/kernel/windows.c+1−1
@@ -122,7 +122,7 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who) · 121 unmodified lines
122122 if ((sp & 7) ||
123123 copy_to_user((char __user *) sp, &tp->reg_window[window],
124124 sizeof(struct reg_window32))) {
125− force_fatal_sig(SIGILL);
125+ force_exit_sig(SIGILL);
126126 return;
127127 }
128128 }
arch/x86/Kconfig+2−1
@@ -193,7 +193,7 @@ config X86 · 192 unmodified lines
193193 select HAVE_DYNAMIC_FTRACE_WITH_ARGS if X86_64
194194 select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
195195 select HAVE_SAMPLE_FTRACE_DIRECT if X86_64
196− select HAVE_SAMPLE_FTRACE_MULTI_DIRECT if X86_64
196+ select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if X86_64
197197 select HAVE_EBPF_JIT
198198 select HAVE_EFFICIENT_UNALIGNED_ACCESS
199199 select HAVE_EISA
@@ -1932,6 +1932,7 @@ config EFI · 1732 unmodified lines
19321932 depends on ACPI
19331933 select UCS2_STRING
19341934 select EFI_RUNTIME_WRAPPERS
1935+ select ARCH_USE_MEMREMAP_PROT
19351936 help
19361937 This enables the kernel to use EFI runtime services that are
19371938 available (such as the EFI variable services).
arch/x86/entry/entry_64.S+17−18
@@ -574,6 +574,10 @@ SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL) · 573 unmodified lines
574574 ud2
575575 1:
576576 #endif
577+#ifdef CONFIG_XEN_PV
578+ ALTERNATIVE "", "jmp xenpv_restore_regs_and_return_to_usermode", X86_FEATURE_XENPV
579+#endif
580+
577581 POP_REGS pop_rdi=0
578582
579583 /*
@@ -890,6 +894,7 @@ SYM_CODE_START_LOCAL(paranoid_entry) · 310 unmodified lines
890894 .Lparanoid_entry_checkgs:
891895 /* EBX = 1 -> kernel GSBASE active, no restore required */
892896 movl $1, %ebx
897+
893898 /*
894899 * The kernel-enforced convention is a negative GSBASE indicates
895900 * a kernel value. No SWAPGS needed on entry and exit.
@@ -897,21 +902,14 @@ SYM_CODE_START_LOCAL(paranoid_entry) · 1 unmodified line
897902 movl $MSR_GS_BASE, %ecx
898903 rdmsr
899904 testl %edx, %edx
900− jns .Lparanoid_entry_swapgs
901− ret
905+ js .Lparanoid_kernel_gsbase
902906
903−.Lparanoid_entry_swapgs:
907+ /* EBX = 0 -> SWAPGS required on exit */
908+ xorl %ebx, %ebx
904909 swapgs
910+.Lparanoid_kernel_gsbase:
905911
906− /*
907− * The above SAVE_AND_SWITCH_TO_KERNEL_CR3 macro doesn't do an
908− * unconditional CR3 write, even in the PTI case. So do an lfence
909− * to prevent GS speculation, regardless of whether PTI is enabled.
910− */
911912 FENCE_SWAPGS_KERNEL_ENTRY
912−
913− /* EBX = 0 -> SWAPGS required on exit */
914− xorl %ebx, %ebx
915913 ret
916914 SYM_CODE_END(paranoid_entry)
917915
@@ -993,11 +991,6 @@ SYM_CODE_START_LOCAL(error_entry) · 75 unmodified lines
993991 pushq %r12
994992 ret
995993
996−.Lerror_entry_done_lfence:
997− FENCE_SWAPGS_KERNEL_ENTRY
998−.Lerror_entry_done:
999− ret
1000−
1001994 /*
1002995 * There are two places in the kernel that can potentially fault with
1003996 * usergs. Handle them here. B stepping K8s sometimes report a
@@ -1020,8 +1013,14 @@ SYM_CODE_START_LOCAL(error_entry) · 16 unmodified lines
10201013 * .Lgs_change's error handler with kernel gsbase.
10211014 */
10221015 SWAPGS
1023− FENCE_SWAPGS_USER_ENTRY
1024− jmp .Lerror_entry_done
1016+
1017+ /*
1018+ * Issue an LFENCE to prevent GS speculation, regardless of whether it is a
1019+ * kernel or user gsbase.
1020+ */
1021+.Lerror_entry_done_lfence:
1022+ FENCE_SWAPGS_KERNEL_ENTRY
1023+ ret
10251024
10261025 .Lbstep_iret:
10271026 /* Fix truncated RIP */
arch/x86/entry/vsyscall/vsyscall_64.c+1−1
@@ -226,7 +226,7 @@ bool emulate_vsyscall(unsigned long error_code, · 225 unmodified lines
226226 if ((!tmp && regs->orig_ax != syscall_nr) || regs->ip != address) {
227227 warn_bad_vsyscall(KERN_DEBUG, regs,
228228 "seccomp tried to change syscall nr or ip");
229− force_fatal_sig(SIGSYS);
229+ force_exit_sig(SIGSYS);
230230 return true;
231231 }
232232 regs->orig_ax = -1;
arch/x86/events/intel/core.c+0−2
@@ -2211,7 +2211,6 @@ intel_pmu_snapshot_branch_stack(struct perf_branch_entry *entries, unsigned int · 2210 unmodified lines
22112211 /* must not have branches... */
22122212 local_irq_save(flags);
22132213 __intel_pmu_disable_all(false); /* we don't care about BTS */
2214− __intel_pmu_pebs_disable_all();
22152214 __intel_pmu_lbr_disable();
22162215 /* ... until here */
22172216 return __intel_pmu_snapshot_branch_stack(entries, cnt, flags);
@@ -2225,7 +2224,6 @@ intel_pmu_snapshot_arch_branch_stack(struct perf_branch_entry *entries, unsigned · 7 unmodified lines
22252224 /* must not have branches... */
22262225 local_irq_save(flags);
22272226 __intel_pmu_disable_all(false); /* we don't care about BTS */
2228− __intel_pmu_pebs_disable_all();
22292227 __intel_pmu_arch_lbr_disable();
22302228 /* ... until here */
22312229 return __intel_pmu_snapshot_branch_stack(entries, cnt, flags);
arch/x86/events/intel/uncore_snbep.c+12−0
@@ -3608,6 +3608,9 @@ static int skx_cha_hw_config(struct intel_uncore_box *box, struct perf_event *ev · 3607 unmodified lines
36083608 struct hw_perf_event_extra *reg1 = &event->hw.extra_reg;
36093609 struct extra_reg *er;
36103610 int idx = 0;
3611+ /* Any of the CHA events may be filtered by Thread/Core-ID.*/
3612+ if (event->hw.config & SNBEP_CBO_PMON_CTL_TID_EN)
3613+ idx = SKX_CHA_MSR_PMON_BOX_FILTER_TID;
36113614
36123615 for (er = skx_uncore_cha_extra_regs; er->msr; er++) {
36133616 if (er->event != (event->hw.config & er->config_mask))
@@ -3675,6 +3678,7 @@ static struct event_constraint skx_uncore_iio_constraints[] = { · 61 unmodified lines
36753678 UNCORE_EVENT_CONSTRAINT(0xc0, 0xc),
36763679 UNCORE_EVENT_CONSTRAINT(0xc5, 0xc),
36773680 UNCORE_EVENT_CONSTRAINT(0xd4, 0xc),
3681+ UNCORE_EVENT_CONSTRAINT(0xd5, 0xc),
36783682 EVENT_CONSTRAINT_END
36793683 };
36803684
@@ -4525,6 +4529,13 @@ static void snr_iio_cleanup_mapping(struct intel_uncore_type *type) · 844 unmodified lines
45254529 pmu_iio_cleanup_mapping(type, &snr_iio_mapping_group);
45264530 }
45274531
4532+static struct event_constraint snr_uncore_iio_constraints[] = {
4533+ UNCORE_EVENT_CONSTRAINT(0x83, 0x3),
4534+ UNCORE_EVENT_CONSTRAINT(0xc0, 0xc),
4535+ UNCORE_EVENT_CONSTRAINT(0xd5, 0xc),
4536+ EVENT_CONSTRAINT_END
4537+};
4538+
45284539 static struct intel_uncore_type snr_uncore_iio = {
45294540 .name = "iio",
45304541 .num_counters = 4,
@@ -4536,6 +4547,7 @@ static struct intel_uncore_type snr_uncore_iio = { · 5 unmodified lines
45364547 .event_mask_ext = SNR_IIO_PMON_RAW_EVENT_MASK_EXT,
45374548 .box_ctl = SNR_IIO_MSR_PMON_BOX_CTL,
45384549 .msr_offset = SNR_IIO_MSR_OFFSET,
4550+ .constraints = snr_uncore_iio_constraints,
45394551 .ops = &ivbep_uncore_msr_ops,
45404552 .format_group = &snr_uncore_iio_format_group,
45414553 .attr_update = snr_iio_attr_update,
arch/x86/hyperv/hv_init.c+4−8
@@ -177,6 +177,9 @@ void set_hv_tscchange_cb(void (*cb)(void)) · 176 unmodified lines
177177 return;
178178 }
179179
180+ if (!hv_vp_index)
181+ return;
182+
180183 hv_reenlightenment_cb = cb;
181184
182185 /* Make sure callback is registered before we write to MSRs */
@@ -383,20 +386,13 @@ static void __init hv_get_partition_id(void) · 200 unmodified lines
383386 */
384387 void __init hyperv_init(void)
385388 {
386− u64 guest_id, required_msrs;
389+ u64 guest_id;
387390 union hv_x64_msr_hypercall_contents hypercall_msr;
388391 int cpuhp;
389392
390393 if (x86_hyper_type != X86_HYPER_MS_HYPERV)
391394 return;
392395
393− /* Absolutely required MSRs */
394− required_msrs = HV_MSR_HYPERCALL_AVAILABLE |
395− HV_MSR_VP_INDEX_AVAILABLE;
396−
397− if ((ms_hyperv.features & required_msrs) != required_msrs)
398− return;
399−
400396 if (hv_common_init())
401397 return;
402398
arch/x86/include/asm/fpu/api.h+0−6
@@ -102,12 +102,6 @@ extern void switch_fpu_return(void); · 101 unmodified lines
102102 */
103103 extern int cpu_has_xfeatures(u64 xfeatures_mask, const char **feature_name);
104104
105−/*
106− * Tasks that are not using SVA have mm->pasid set to zero to note that they
107− * will not have the valid bit set in MSR_IA32_PASID while they are running.
108− */
109−#define PASID_DISABLED 0
110−
111105 /* Trap handling */
112106 extern int fpu__exception_code(struct fpu *fpu, int trap_nr);
113107 extern void fpu_sync_fpstate(struct fpu *fpu);
arch/x86/include/asm/intel-family.h+1−1
@@ -108,7 +108,7 @@ · 107 unmodified lines
108108 #define INTEL_FAM6_ALDERLAKE 0x97 /* Golden Cove / Gracemont */
109109 #define INTEL_FAM6_ALDERLAKE_L 0x9A /* Golden Cove / Gracemont */
110110
111−#define INTEL_FAM6_RAPTOR_LAKE 0xB7
111+#define INTEL_FAM6_RAPTORLAKE 0xB7
112112
113113 /* "Small Core" Processors (Atom) */
114114
arch/x86/include/asm/kvm_host.h+3−1
@@ -97,7 +97,7 @@ · 96 unmodified lines
9797 KVM_ARCH_REQ_FLAGS(25, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
9898 #define KVM_REQ_TLB_FLUSH_CURRENT KVM_ARCH_REQ(26)
9999 #define KVM_REQ_TLB_FLUSH_GUEST \
100− KVM_ARCH_REQ_FLAGS(27, KVM_REQUEST_NO_WAKEUP)
100+ KVM_ARCH_REQ_FLAGS(27, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
101101 #define KVM_REQ_APF_READY KVM_ARCH_REQ(28)
102102 #define KVM_REQ_MSR_FILTER_CHANGED KVM_ARCH_REQ(29)
103103 #define KVM_REQ_UPDATE_CPU_DIRTY_LOGGING \
@@ -363,6 +363,7 @@ union kvm_mmu_extended_role { · 259 unmodified lines
363363 unsigned int cr4_smap:1;
364364 unsigned int cr4_smep:1;
365365 unsigned int cr4_la57:1;
366+ unsigned int efer_lma:1;
366367 };
367368 };
368369
@@ -1035,6 +1036,7 @@ struct kvm_x86_msr_filter { · 666 unmodified lines
10351036 #define APICV_INHIBIT_REASON_PIT_REINJ 4
10361037 #define APICV_INHIBIT_REASON_X2APIC 5
10371038 #define APICV_INHIBIT_REASON_BLOCKIRQ 6
1039+#define APICV_INHIBIT_REASON_ABSENT 7
10381040
10391041 struct kvm_arch {
10401042 unsigned long n_used_mmu_pages;
arch/x86/include/asm/sev-common.h+11−0
@@ -73,4 +73,15 @@ · 72 unmodified lines
7373
7474 #define GHCB_RESP_CODE(v) ((v) & GHCB_MSR_INFO_MASK)
7575
76+/*
77+ * Error codes related to GHCB input that can be communicated back to the guest
78+ * by setting the lower 32-bits of the GHCB SW_EXITINFO1 field to 2.
79+ */
80+#define GHCB_ERR_NOT_REGISTERED 1
81+#define GHCB_ERR_INVALID_USAGE 2
82+#define GHCB_ERR_INVALID_SCRATCH_AREA 3
83+#define GHCB_ERR_MISSING_INPUT 4
84+#define GHCB_ERR_INVALID_INPUT 5
85+#define GHCB_ERR_INVALID_EVENT 6
86+
7687 #endif
arch/x86/include/asm/xen/hypercall.h+2−2
@@ -281,13 +281,13 @@ HYPERVISOR_callback_op(int cmd, void *arg) · 280 unmodified lines
281281 return _hypercall2(int, callback_op, cmd, arg);
282282 }
283283
284−static inline int
284+static __always_inline int
285285 HYPERVISOR_set_debugreg(int reg, unsigned long value)
286286 {
287287 return _hypercall2(int, set_debugreg, reg, value);
288288 }
289289
290−static inline unsigned long
290+static __always_inline unsigned long
291291 HYPERVISOR_get_debugreg(int reg)
292292 {
293293 return _hypercall1(unsigned long, get_debugreg, reg);
arch/x86/include/asm/xen/hypervisor.h+1−0
@@ -64,6 +64,7 @@ void xen_arch_unregister_cpu(int num); · 63 unmodified lines
6464
6565 #ifdef CONFIG_PVH
6666 void __init xen_pvh_init(struct boot_params *boot_params);
67+void __init mem_map_via_hcall(struct boot_params *boot_params_p);
6768 #endif
6869
6970 #endif /* _ASM_X86_XEN_HYPERVISOR_H */
arch/x86/kernel/cpu/mshyperv.c+15−5
@@ -163,12 +163,22 @@ static uint32_t __init ms_hyperv_platform(void) · 162 unmodified lines
163163 cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
164164 &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
165165
166− if (eax >= HYPERV_CPUID_MIN &&
167− eax <= HYPERV_CPUID_MAX &&
168− !memcmp("Microsoft Hv", hyp_signature, 12))
169− return HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
166+ if (eax < HYPERV_CPUID_MIN || eax > HYPERV_CPUID_MAX ||
167+ memcmp("Microsoft Hv", hyp_signature, 12))
168+ return 0;
170169
171− return 0;
170+ /* HYPERCALL and VP_INDEX MSRs are mandatory for all features. */
171+ eax = cpuid_eax(HYPERV_CPUID_FEATURES);
172+ if (!(eax & HV_MSR_HYPERCALL_AVAILABLE)) {
173+ pr_warn("x86/hyperv: HYPERCALL MSR not available.\n");
174+ return 0;
175+ }
176+ if (!(eax & HV_MSR_VP_INDEX_AVAILABLE)) {
177+ pr_warn("x86/hyperv: VP_INDEX MSR not available.\n");
178+ return 0;
179+ }
180+
181+ return HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
172182 }
173183
174184 static unsigned char hv_get_nmi_reason(void)
arch/x86/kernel/cpu/sgx/main.c+6−6
@@ -28,8 +28,7 @@ static DECLARE_WAIT_QUEUE_HEAD(ksgxd_waitq); · 27 unmodified lines
2828 static LIST_HEAD(sgx_active_page_list);
2929 static DEFINE_SPINLOCK(sgx_reclaimer_lock);
3030
31−/* The free page list lock protected variables prepend the lock. */
32−static unsigned long sgx_nr_free_pages;
31+static atomic_long_t sgx_nr_free_pages = ATOMIC_LONG_INIT(0);
3332
3433 /* Nodes with one or more EPC sections. */
3534 static nodemask_t sgx_numa_mask;
@@ -403,14 +402,15 @@ skip: · 367 unmodified lines
403402
404403 spin_lock(&node->lock);
405404 list_add_tail(&epc_page->list, &node->free_page_list);
406− sgx_nr_free_pages++;
407405 spin_unlock(&node->lock);
406+ atomic_long_inc(&sgx_nr_free_pages);
408407 }
409408 }
410409
411410 static bool sgx_should_reclaim(unsigned long watermark)
412411 {
413− return sgx_nr_free_pages < watermark && !list_empty(&sgx_active_page_list);
412+ return atomic_long_read(&sgx_nr_free_pages) < watermark &&
413+ !list_empty(&sgx_active_page_list);
414414 }
415415
416416 static int ksgxd(void *p)
@@ -471,9 +471,9 @@ static struct sgx_epc_page *__sgx_alloc_epc_page_from_node(int nid) · 54 unmodified lines
471471
472472 page = list_first_entry(&node->free_page_list, struct sgx_epc_page, list);
473473 list_del_init(&page->list);
474− sgx_nr_free_pages--;
475474
476475 spin_unlock(&node->lock);
476+ atomic_long_dec(&sgx_nr_free_pages);
477477
478478 return page;
479479 }
@@ -625,9 +625,9 @@ void sgx_free_epc_page(struct sgx_epc_page *page) · 145 unmodified lines
625625 spin_lock(&node->lock);
626626
627627 list_add_tail(&page->list, &node->free_page_list);
628− sgx_nr_free_pages++;
629628
630629 spin_unlock(&node->lock);
630+ atomic_long_inc(&sgx_nr_free_pages);
631631 }
632632
633633 static bool __init sgx_setup_epc_section(u64 phys_addr, u64 size,
arch/x86/kernel/fpu/signal.c+1−1
@@ -118,7 +118,7 @@ static inline bool save_xstate_epilog(void __user *buf, int ia32_frame, · 117 unmodified lines
118118 struct fpstate *fpstate)
119119 {
120120 struct xregs_state __user *x = buf;
121− struct _fpx_sw_bytes sw_bytes;
121+ struct _fpx_sw_bytes sw_bytes = {};
122122 u32 xfeatures;
123123 int err;
124124
arch/x86/kernel/process.c+5−0
@@ -964,6 +964,9 @@ unsigned long __get_wchan(struct task_struct *p) · 963 unmodified lines
964964 struct unwind_state state;
965965 unsigned long addr = 0;
966966
967+ if (!try_get_task_stack(p))
968+ return 0;
969+
967970 for (unwind_start(&state, p, NULL, NULL); !unwind_done(&state);
968971 unwind_next_frame(&state)) {
969972 addr = unwind_get_return_address(&state);
@@ -974,6 +977,8 @@ unsigned long __get_wchan(struct task_struct *p) · 4 unmodified lines
974977 break;
975978 }
976979
980+ put_task_stack(p);
981+
977982 return addr;
978983 }
979984
arch/x86/kernel/setup.c+39−27
@@ -742,6 +742,28 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p) · 741 unmodified lines
742742 return 0;
743743 }
744744
745+static char * __init prepare_command_line(void)
746+{
747+#ifdef CONFIG_CMDLINE_BOOL
748+#ifdef CONFIG_CMDLINE_OVERRIDE
749+ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
750+#else
751+ if (builtin_cmdline[0]) {
752+ /* append boot loader cmdline to builtin */
753+ strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
754+ strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
755+ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
756+ }
757+#endif
758+#endif
759+
760+ strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
761+
762+ parse_early_param();
763+
764+ return command_line;
765+}
766+
745767 /*
746768 * Determine if we were loaded by an EFI loader. If so, then we have also been
747769 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -830,6 +852,23 @@ void __init setup_arch(char **cmdline_p) · 82 unmodified lines
830852
831853 x86_init.oem.arch_setup();
832854
855+ /*
856+ * x86_configure_nx() is called before parse_early_param() (called by
857+ * prepare_command_line()) to detect whether hardware doesn't support
858+ * NX (so that the early EHCI debug console setup can safely call
859+ * set_fixmap()). It may then be called again from within noexec_setup()
860+ * during parsing early parameters to honor the respective command line
861+ * option.
862+ */
863+ x86_configure_nx();
864+
865+ /*
866+ * This parses early params and it needs to run before
867+ * early_reserve_memory() because latter relies on such settings
868+ * supplied as early params.
869+ */
870+ *cmdline_p = prepare_command_line();
871+
833872 /*
834873 * Do some memory reservations *before* memory is added to memblock, so
835874 * memblock allocations won't overwrite it.
@@ -863,33 +902,6 @@ void __init setup_arch(char **cmdline_p) · 27 unmodified lines
863902 bss_resource.start = __pa_symbol(__bss_start);
864903 bss_resource.end = __pa_symbol(__bss_stop)-1;
865904
866−#ifdef CONFIG_CMDLINE_BOOL
867−#ifdef CONFIG_CMDLINE_OVERRIDE
868− strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
869−#else
870− if (builtin_cmdline[0]) {
871− /* append boot loader cmdline to builtin */
872− strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
873− strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
874− strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
875− }
876−#endif
877−#endif
878−
879− strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
880− *cmdline_p = command_line;
881−
882− /*
883− * x86_configure_nx() is called before parse_early_param() to detect
884− * whether hardware doesn't support NX (so that the early EHCI debug
885− * console setup can safely call set_fixmap()). It may then be called
886− * again from within noexec_setup() during parsing early parameters
887− * to honor the respective command line option.
888− */
889− x86_configure_nx();
890−
891− parse_early_param();
892−
893905 #ifdef CONFIG_MEMORY_HOTPLUG
894906 /*
895907 * Memory used by the kernel cannot be hot-removed because Linux
arch/x86/kernel/sev.c+39−18
@@ -294,11 +294,6 @@ static enum es_result vc_write_mem(struct es_em_ctxt *ctxt, · 293 unmodified lines
294294 char *dst, char *buf, size_t size)
295295 {
296296 unsigned long error_code = X86_PF_PROT | X86_PF_WRITE;
297− char __user *target = (char __user *)dst;
298− u64 d8;
299− u32 d4;
300− u16 d2;
301− u8 d1;
302297
303298 /*
304299 * This function uses __put_user() independent of whether kernel or user
@@ -320,26 +315,42 @@ static enum es_result vc_write_mem(struct es_em_ctxt *ctxt, · 15 unmodified lines
320315 * instructions here would cause infinite nesting.
321316 */
322317 switch (size) {
323− case 1:
318+ case 1: {
319+ u8 d1;
320+ u8 __user *target = (u8 __user *)dst;
321+
324322 memcpy(&d1, buf, 1);
325323 if (__put_user(d1, target))
326324 goto fault;
327325 break;
328− case 2:
326+ }
327+ case 2: {
328+ u16 d2;
329+ u16 __user *target = (u16 __user *)dst;
330+
329331 memcpy(&d2, buf, 2);
330332 if (__put_user(d2, target))
331333 goto fault;
332334 break;
333− case 4:
335+ }
336+ case 4: {
337+ u32 d4;
338+ u32 __user *target = (u32 __user *)dst;
339+
334340 memcpy(&d4, buf, 4);
335341 if (__put_user(d4, target))
336342 goto fault;
337343 break;
338− case 8:
344+ }
345+ case 8: {
346+ u64 d8;
347+ u64 __user *target = (u64 __user *)dst;
348+
339349 memcpy(&d8, buf, 8);
340350 if (__put_user(d8, target))
341351 goto fault;
342352 break;
353+ }
343354 default:
344355 WARN_ONCE(1, "%s: Invalid size: %zu\n", __func__, size);
345356 return ES_UNSUPPORTED;
@@ -362,11 +373,6 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt, · 16 unmodified lines
362373 char *src, char *buf, size_t size)
363374 {
364375 unsigned long error_code = X86_PF_PROT;
365− char __user *s = (char __user *)src;
366− u64 d8;
367− u32 d4;
368− u16 d2;
369− u8 d1;
370376
371377 /*
372378 * This function uses __get_user() independent of whether kernel or user
@@ -388,26 +394,41 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt, · 15 unmodified lines
388394 * instructions here would cause infinite nesting.
389395 */
390396 switch (size) {
391− case 1:
397+ case 1: {
398+ u8 d1;
399+ u8 __user *s = (u8 __user *)src;
400+
392401 if (__get_user(d1, s))
393402 goto fault;
394403 memcpy(buf, &d1, 1);
395404 break;
396− case 2:
405+ }
406+ case 2: {
407+ u16 d2;
408+ u16 __user *s = (u16 __user *)src;
409+
397410 if (__get_user(d2, s))
398411 goto fault;
399412 memcpy(buf, &d2, 2);
400413 break;
401− case 4:
414+ }
415+ case 4: {
416+ u32 d4;
417+ u32 __user *s = (u32 __user *)src;
418+
402419 if (__get_user(d4, s))
403420 goto fault;
404421 memcpy(buf, &d4, 4);
405422 break;
406− case 8:
423+ }
424+ case 8: {
425+ u64 d8;
426+ u64 __user *s = (u64 __user *)src;
407427 if (__get_user(d8, s))
408428 goto fault;
409429 memcpy(buf, &d8, 8);
410430 break;
431+ }
411432 default:
412433 WARN_ONCE(1, "%s: Invalid size: %zu\n", __func__, size);
413434 return ES_UNSUPPORTED;
arch/x86/kernel/smpboot.c+14−0
@@ -579,6 +579,17 @@ static struct sched_domain_topology_level x86_numa_in_package_topology[] = { · 578 unmodified lines
579579 { NULL, },
580580 };
581581
582+static struct sched_domain_topology_level x86_hybrid_topology[] = {
583+#ifdef CONFIG_SCHED_SMT
584+ { cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
585+#endif
586+#ifdef CONFIG_SCHED_MC
587+ { cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
588+#endif
589+ { cpu_cpu_mask, SD_INIT_NAME(DIE) },
590+ { NULL, },
591+};
592+
582593 static struct sched_domain_topology_level x86_topology[] = {
583594 #ifdef CONFIG_SCHED_SMT
584595 { cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
@@ -1469,8 +1480,11 @@ void __init native_smp_cpus_done(unsigned int max_cpus) · 884 unmodified lines
14691480
14701481 calculate_max_logical_packages();
14711482
1483+ /* XXX for now assume numa-in-package and hybrid don't overlap */
14721484 if (x86_has_numa_in_package)
14731485 set_sched_topology(x86_numa_in_package_topology);
1486+ if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
1487+ set_sched_topology(x86_hybrid_topology);
14741488
14751489 nmi_selftest();
14761490 impress_friends();
arch/x86/kernel/tsc.c+24−4
@@ -1180,6 +1180,12 @@ void mark_tsc_unstable(char *reason) · 1179 unmodified lines
11801180
11811181 EXPORT_SYMBOL_GPL(mark_tsc_unstable);
11821182
1183+static void __init tsc_disable_clocksource_watchdog(void)
1184+{
1185+ clocksource_tsc_early.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
1186+ clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
1187+}
1188+
11831189 static void __init check_system_tsc_reliable(void)
11841190 {
11851191 #if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC)
@@ -1196,6 +1202,23 @@ static void __init check_system_tsc_reliable(void) · 10 unmodified lines
11961202 #endif
11971203 if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
11981204 tsc_clocksource_reliable = 1;
1205+
1206+ /*
1207+ * Disable the clocksource watchdog when the system has:
1208+ * - TSC running at constant frequency
1209+ * - TSC which does not stop in C-States
1210+ * - the TSC_ADJUST register which allows to detect even minimal
1211+ * modifications
1212+ * - not more than two sockets. As the number of sockets cannot be
1213+ * evaluated at the early boot stage where this has to be
1214+ * invoked, check the number of online memory nodes as a
1215+ * fallback solution which is an reasonable estimate.
1216+ */
1217+ if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
1218+ boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
1219+ boot_cpu_has(X86_FEATURE_TSC_ADJUST) &&
1220+ nr_online_nodes <= 2)
1221+ tsc_disable_clocksource_watchdog();
11991222 }
12001223
12011224 /*
@@ -1387,9 +1410,6 @@ static int __init init_tsc_clocksource(void) · 185 unmodified lines
13871410 if (tsc_unstable)
13881411 goto unreg;
13891412
1390− if (tsc_clocksource_reliable || no_tsc_watchdog)
1391− clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
1392−
13931413 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC_S3))
13941414 clocksource_tsc.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP;
13951415
@@ -1527,7 +1547,7 @@ void __init tsc_init(void) · 131 unmodified lines
15271547 }
15281548
15291549 if (tsc_clocksource_reliable || no_tsc_watchdog)
1530− clocksource_tsc_early.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
1550+ tsc_disable_clocksource_watchdog();
15311551
15321552 clocksource_register_khz(&clocksource_tsc_early, tsc_khz);
15331553 detect_art();
arch/x86/kernel/tsc_sync.c+41−0
@@ -30,6 +30,7 @@ struct tsc_adjust { · 29 unmodified lines
3030 };
3131
3232 static DEFINE_PER_CPU(struct tsc_adjust, tsc_adjust);
33+static struct timer_list tsc_sync_check_timer;
3334
3435 /*
3536 * TSC's on different sockets may be reset asynchronously.
@@ -77,6 +78,46 @@ void tsc_verify_tsc_adjust(bool resume) · 41 unmodified lines
7778 }
7879 }
7980
81+/*
82+ * Normally the tsc_sync will be checked every time system enters idle
83+ * state, but there is still caveat that a system won't enter idle,
84+ * either because it's too busy or configured purposely to not enter
85+ * idle.
86+ *
87+ * So setup a periodic timer (every 10 minutes) to make sure the check
88+ * is always on.
89+ */
90+
91+#define SYNC_CHECK_INTERVAL (HZ * 600)
92+
93+static void tsc_sync_check_timer_fn(struct timer_list *unused)
94+{
95+ int next_cpu;
96+
97+ tsc_verify_tsc_adjust(false);
98+
99+ /* Run the check for all onlined CPUs in turn */
100+ next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
101+ if (next_cpu >= nr_cpu_ids)
102+ next_cpu = cpumask_first(cpu_online_mask);
103+
104+ tsc_sync_check_timer.expires += SYNC_CHECK_INTERVAL;
105+ add_timer_on(&tsc_sync_check_timer, next_cpu);
106+}
107+
108+static int __init start_sync_check_timer(void)
109+{
110+ if (!cpu_feature_enabled(X86_FEATURE_TSC_ADJUST) || tsc_clocksource_reliable)
111+ return 0;
112+
113+ timer_setup(&tsc_sync_check_timer, tsc_sync_check_timer_fn, 0);
114+ tsc_sync_check_timer.expires = jiffies + SYNC_CHECK_INTERVAL;
115+ add_timer(&tsc_sync_check_timer);
116+
117+ return 0;
118+}
119+late_initcall(start_sync_check_timer);
120+
80121 static void tsc_sanitize_first_cpu(struct tsc_adjust *cur, s64 bootval,
81122 unsigned int cpu, bool bootcpu)
82123 {
arch/x86/kernel/vm86_32.c+1−1
@@ -160,7 +160,7 @@ Efault_end: · 159 unmodified lines
160160 user_access_end();
161161 Efault:
162162 pr_alert("could not access userspace vm86 info\n");
163− force_fatal_sig(SIGSEGV);
163+ force_exit_sig(SIGSEGV);
164164 goto exit_vm86;
165165 }
166166
arch/x86/kvm/cpuid.c+1−1
@@ -125,7 +125,7 @@ static void kvm_update_kvm_cpuid_base(struct kvm_vcpu *vcpu) · 124 unmodified lines
125125 }
126126 }
127127
128−struct kvm_cpuid_entry2 *kvm_find_kvm_cpuid_features(struct kvm_vcpu *vcpu)
128+static struct kvm_cpuid_entry2 *kvm_find_kvm_cpuid_features(struct kvm_vcpu *vcpu)
129129 {
130130 u32 base = vcpu->arch.kvm_cpuid_base;
131131
arch/x86/kvm/hyperv.c+7−4
@@ -1922,11 +1922,13 @@ static u64 kvm_hv_send_ipi(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool · 1921 unmodified lines
19221922
19231923 all_cpus = send_ipi_ex.vp_set.format == HV_GENERIC_SET_ALL;
19241924
1925+ if (all_cpus)
1926+ goto check_and_send_ipi;
1927+
19251928 if (!sparse_banks_len)
19261929 goto ret_success;
19271930
1928− if (!all_cpus &&
1929− kvm_read_guest(kvm,
1931+ if (kvm_read_guest(kvm,
19301932 hc->ingpa + offsetof(struct hv_send_ipi_ex,
19311933 vp_set.bank_contents),
19321934 sparse_banks,
@@ -1934,6 +1936,7 @@ static u64 kvm_hv_send_ipi(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool · 1 unmodified line
19341936 return HV_STATUS_INVALID_HYPERCALL_INPUT;
19351937 }
19361938
1939+check_and_send_ipi:
19371940 if ((vector < HV_IPI_LOW_VECTOR) || (vector > HV_IPI_HIGH_VECTOR))
19381941 return HV_STATUS_INVALID_HYPERCALL_INPUT;
19391942
@@ -2022,7 +2025,7 @@ static void kvm_hv_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result) · 82 unmodified lines
20222025 {
20232026 bool longmode;
20242027
2025− longmode = is_64_bit_mode(vcpu);
2028+ longmode = is_64_bit_hypercall(vcpu);
20262029 if (longmode)
20272030 kvm_rax_write(vcpu, result);
20282031 else {
@@ -2171,7 +2174,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) · 142 unmodified lines
21712174 }
21722175
21732176 #ifdef CONFIG_X86_64
2174− if (is_64_bit_mode(vcpu)) {
2177+ if (is_64_bit_hypercall(vcpu)) {
21752178 hc.param = kvm_rcx_read(vcpu);
21762179 hc.ingpa = kvm_rdx_read(vcpu);
21772180 hc.outgpa = kvm_r8_read(vcpu);
arch/x86/kvm/ioapic.h+0−1
@@ -81,7 +81,6 @@ struct kvm_ioapic { · 80 unmodified lines
8181 unsigned long irq_states[IOAPIC_NUM_PINS];
8282 struct kvm_io_device dev;
8383 struct kvm *kvm;
84− void (*ack_notifier)(void *opaque, int irq);
8584 spinlock_t lock;
8685 struct rtc_status rtc_status;
8786 struct delayed_work eoi_inject;
arch/x86/kvm/irq.h+0−1
@@ -56,7 +56,6 @@ struct kvm_pic { · 55 unmodified lines
5656 struct kvm_io_device dev_master;
5757 struct kvm_io_device dev_slave;
5858 struct kvm_io_device dev_elcr;
59− void (*ack_notifier)(void *opaque, int irq);
6059 unsigned long irq_states[PIC_NUM_PINS];
6160 };
6261
arch/x86/kvm/lapic.c+1−1
@@ -707,7 +707,7 @@ static void pv_eoi_clr_pending(struct kvm_vcpu *vcpu) · 706 unmodified lines
707707 static int apic_has_interrupt_for_ppr(struct kvm_lapic *apic, u32 ppr)
708708 {
709709 int highest_irr;
710− if (apic->vcpu->arch.apicv_active)
710+ if (kvm_x86_ops.sync_pir_to_irr)
711711 highest_irr = static_call(kvm_x86_sync_pir_to_irr)(apic->vcpu);
712712 else
713713 highest_irr = apic_find_highest_irr(apic);
arch/x86/kvm/mmu/mmu.c+74−47
@@ -1582,7 +1582,7 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range) · 1581 unmodified lines
15821582 flush = kvm_handle_gfn_range(kvm, range, kvm_unmap_rmapp);
15831583
15841584 if (is_tdp_mmu_enabled(kvm))
1585− flush |= kvm_tdp_mmu_unmap_gfn_range(kvm, range, flush);
1585+ flush = kvm_tdp_mmu_unmap_gfn_range(kvm, range, flush);
15861586
15871587 return flush;
15881588 }
@@ -1936,7 +1936,11 @@ static void mmu_audit_disable(void) { } · 347 unmodified lines
19361936
19371937 static bool is_obsolete_sp(struct kvm *kvm, struct kvm_mmu_page *sp)
19381938 {
1939− return sp->role.invalid ||
1939+ if (sp->role.invalid)
1940+ return true;
1941+
1942+ /* TDP MMU pages due not use the MMU generation. */
1943+ return !sp->tdp_mmu_page &&
19401944 unlikely(sp->mmu_valid_gen != kvm->arch.mmu_valid_gen);
19411945 }
19421946
@@ -2173,10 +2177,10 @@ static void shadow_walk_init_using_root(struct kvm_shadow_walk_iterator *iterato · 230 unmodified lines
21732177 iterator->shadow_addr = root;
21742178 iterator->level = vcpu->arch.mmu->shadow_root_level;
21752179
2176− if (iterator->level == PT64_ROOT_4LEVEL &&
2180+ if (iterator->level >= PT64_ROOT_4LEVEL &&
21772181 vcpu->arch.mmu->root_level < PT64_ROOT_4LEVEL &&
21782182 !vcpu->arch.mmu->direct_map)
2179− --iterator->level;
2183+ iterator->level = PT32E_ROOT_LEVEL;
21802184
21812185 if (iterator->level == PT32E_ROOT_LEVEL) {
21822186 /*
@@ -3976,6 +3980,20 @@ out_retry: · 1793 unmodified lines
39763980 return true;
39773981 }
39783982
3983+/*
3984+ * Returns true if the page fault is stale and needs to be retried, i.e. if the
3985+ * root was invalidated by a memslot update or a relevant mmu_notifier fired.
3986+ */
3987+static bool is_page_fault_stale(struct kvm_vcpu *vcpu,
3988+ struct kvm_page_fault *fault, int mmu_seq)
3989+{
3990+ if (is_obsolete_sp(vcpu->kvm, to_shadow_page(vcpu->arch.mmu->root_hpa)))
3991+ return true;
3992+
3993+ return fault->slot &&
3994+ mmu_notifier_retry_hva(vcpu->kvm, mmu_seq, fault->hva);
3995+}
3996+
39793997 static int direct_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
39803998 {
39813999 bool is_tdp_mmu_fault = is_tdp_mmu(vcpu->arch.mmu);
@@ -4013,8 +4031,9 @@ static int direct_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault · 31 unmodified lines
40134031 else
40144032 write_lock(&vcpu->kvm->mmu_lock);
40154033
4016− if (fault->slot && mmu_notifier_retry_hva(vcpu->kvm, mmu_seq, fault->hva))
4034+ if (is_page_fault_stale(vcpu, fault, mmu_seq))
40174035 goto out_unlock;
4036+
40184037 r = make_mmu_pages_available(vcpu);
40194038 if (r)
40204039 goto out_unlock;
@@ -4682,6 +4701,7 @@ static union kvm_mmu_extended_role kvm_calc_mmu_role_ext(struct kvm_vcpu *vcpu, · 661 unmodified lines
46824701 /* PKEY and LA57 are active iff long mode is active. */
46834702 ext.cr4_pke = ____is_efer_lma(regs) && ____is_cr4_pke(regs);
46844703 ext.cr4_la57 = ____is_efer_lma(regs) && ____is_cr4_la57(regs);
4704+ ext.efer_lma = ____is_efer_lma(regs);
46854705 }
46864706
46874707 ext.valid = 1;
@@ -4854,7 +4874,7 @@ void kvm_init_shadow_npt_mmu(struct kvm_vcpu *vcpu, unsigned long cr0, · 166 unmodified lines
48544874 struct kvm_mmu *context = &vcpu->arch.guest_mmu;
48554875 struct kvm_mmu_role_regs regs = {
48564876 .cr0 = cr0,
4857− .cr4 = cr4,
4877+ .cr4 = cr4 & ~X86_CR4_PKE,
48584878 .efer = efer,
48594879 };
48604880 union kvm_mmu_role new_role;
@@ -4918,7 +4938,7 @@ void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, bool execonly, · 57 unmodified lines
49184938 context->direct_map = false;
49194939
49204940 update_permission_bitmask(context, true);
4921− update_pkru_bitmask(context);
4941+ context->pkru_mask = 0;
49224942 reset_rsvds_bits_mask_ept(vcpu, context, execonly);
49234943 reset_ept_shadow_zero_bits_mask(vcpu, context, execonly);
49244944 }
@@ -5024,6 +5044,14 @@ void kvm_mmu_after_set_cpuid(struct kvm_vcpu *vcpu) · 99 unmodified lines
50245044 /*
50255045 * Invalidate all MMU roles to force them to reinitialize as CPUID
50265046 * information is factored into reserved bit calculations.
5047+ *
5048+ * Correctly handling multiple vCPU models with respect to paging and
5049+ * physical address properties) in a single VM would require tracking
5050+ * all relevant CPUID information in kvm_mmu_page_role. That is very
5051+ * undesirable as it would increase the memory requirements for
5052+ * gfn_track (see struct kvm_mmu_page_role comments). For now that
5053+ * problem is swept under the rug; KVM's CPUID API is horrific and
5054+ * it's all but impossible to solve it without introducing a new API.
50275055 */
50285056 vcpu->arch.root_mmu.mmu_role.ext.valid = 0;
50295057 vcpu->arch.guest_mmu.mmu_role.ext.valid = 0;
@@ -5031,24 +5059,10 @@ void kvm_mmu_after_set_cpuid(struct kvm_vcpu *vcpu) · 1 unmodified line
50315059 kvm_mmu_reset_context(vcpu);
50325060
50335061 /*
5034− * KVM does not correctly handle changing guest CPUID after KVM_RUN, as
5035− * MAXPHYADDR, GBPAGES support, AMD reserved bit behavior, etc.. aren't
5036− * tracked in kvm_mmu_page_role. As a result, KVM may miss guest page
5037− * faults due to reusing SPs/SPTEs. Alert userspace, but otherwise
5038− * sweep the problem under the rug.
5039− *
5040− * KVM's horrific CPUID ABI makes the problem all but impossible to
5041− * solve, as correctly handling multiple vCPU models (with respect to
5042− * paging and physical address properties) in a single VM would require
5043− * tracking all relevant CPUID information in kvm_mmu_page_role. That
5044− * is very undesirable as it would double the memory requirements for
5045− * gfn_track (see struct kvm_mmu_page_role comments), and in practice
5046− * no sane VMM mucks with the core vCPU model on the fly.
5062+ * Changing guest CPUID after KVM_RUN is forbidden, see the comment in
5063+ * kvm_arch_vcpu_ioctl().
50475064 */
5048− if (vcpu->arch.last_vmentry_cpu != -1) {
5049− pr_warn_ratelimited("KVM: KVM_SET_CPUID{,2} after KVM_RUN may cause guest instability\n");
5050− pr_warn_ratelimited("KVM: KVM_SET_CPUID{,2} will fail after KVM_RUN starting with Linux 5.16\n");
5051− }
5065+ KVM_BUG_ON(vcpu->arch.last_vmentry_cpu != -1, vcpu->kvm);
50525066 }
50535067
50545068 void kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
@@ -5368,7 +5382,7 @@ void kvm_mmu_invalidate_gva(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, · 313 unmodified lines
53685382
53695383 void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva)
53705384 {
5371− kvm_mmu_invalidate_gva(vcpu, vcpu->arch.mmu, gva, INVALID_PAGE);
5385+ kvm_mmu_invalidate_gva(vcpu, vcpu->arch.walk_mmu, gva, INVALID_PAGE);
53725386 ++vcpu->stat.invlpg;
53735387 }
53745388 EXPORT_SYMBOL_GPL(kvm_mmu_invlpg);
@@ -5853,8 +5867,6 @@ restart: · 478 unmodified lines
58535867 void kvm_mmu_zap_collapsible_sptes(struct kvm *kvm,
58545868 const struct kvm_memory_slot *slot)
58555869 {
5856− bool flush = false;
5857−
58585870 if (kvm_memslots_have_rmaps(kvm)) {
58595871 write_lock(&kvm->mmu_lock);
58605872 /*
@@ -5862,17 +5874,14 @@ void kvm_mmu_zap_collapsible_sptes(struct kvm *kvm, · 1 unmodified line
58625874 * logging at a 4k granularity and never creates collapsible
58635875 * 2m SPTEs during dirty logging.
58645876 */
5865− flush = slot_handle_level_4k(kvm, slot, kvm_mmu_zap_collapsible_spte, true);
5866− if (flush)
5877+ if (slot_handle_level_4k(kvm, slot, kvm_mmu_zap_collapsible_spte, true))
58675878 kvm_arch_flush_remote_tlbs_memslot(kvm, slot);
58685879 write_unlock(&kvm->mmu_lock);
58695880 }
58705881
58715882 if (is_tdp_mmu_enabled(kvm)) {
58725883 read_lock(&kvm->mmu_lock);
5873− flush = kvm_tdp_mmu_zap_collapsible_sptes(kvm, slot, flush);
5874− if (flush)
5875− kvm_arch_flush_remote_tlbs_memslot(kvm, slot);
5884+ kvm_tdp_mmu_zap_collapsible_sptes(kvm, slot);
58765885 read_unlock(&kvm->mmu_lock);
58775886 }
58785887 }
@@ -6181,23 +6190,46 @@ void kvm_mmu_module_exit(void) · 302 unmodified lines
61816190 mmu_audit_disable();
61826191 }
61836192
6193+/*
6194+ * Calculate the effective recovery period, accounting for '0' meaning "let KVM
6195+ * select a halving time of 1 hour". Returns true if recovery is enabled.
6196+ */
6197+static bool calc_nx_huge_pages_recovery_period(uint *period)
6198+{
6199+ /*
6200+ * Use READ_ONCE to get the params, this may be called outside of the
6201+ * param setters, e.g. by the kthread to compute its next timeout.
6202+ */
6203+ bool enabled = READ_ONCE(nx_huge_pages);
6204+ uint ratio = READ_ONCE(nx_huge_pages_recovery_ratio);
6205+
6206+ if (!enabled || !ratio)
6207+ return false;
6208+
6209+ *period = READ_ONCE(nx_huge_pages_recovery_period_ms);
6210+ if (!*period) {
6211+ /* Make sure the period is not less than one second. */
6212+ ratio = min(ratio, 3600u);
6213+ *period = 60 * 60 * 1000 / ratio;
6214+ }
6215+ return true;
6216+}
6217+
61846218 static int set_nx_huge_pages_recovery_param(const char *val, const struct kernel_param *kp)
61856219 {
61866220 bool was_recovery_enabled, is_recovery_enabled;
61876221 uint old_period, new_period;
61886222 int err;
61896223
6190− was_recovery_enabled = nx_huge_pages_recovery_ratio;
6191− old_period = nx_huge_pages_recovery_period_ms;
6224+ was_recovery_enabled = calc_nx_huge_pages_recovery_period(&old_period);
61926225
61936226 err = param_set_uint(val, kp);
61946227 if (err)
61956228 return err;
61966229
6197− is_recovery_enabled = nx_huge_pages_recovery_ratio;
6198− new_period = nx_huge_pages_recovery_period_ms;
6230+ is_recovery_enabled = calc_nx_huge_pages_recovery_period(&new_period);
61996231
6200− if (READ_ONCE(nx_huge_pages) && is_recovery_enabled &&
6232+ if (is_recovery_enabled &&
62016233 (!was_recovery_enabled || old_period > new_period)) {
62026234 struct kvm *kvm;
62036235
@@ -6261,18 +6293,13 @@ static void kvm_recover_nx_lpages(struct kvm *kvm) · 57 unmodified lines
62616293
62626294 static long get_nx_lpage_recovery_timeout(u64 start_time)
62636295 {
6264− uint ratio = READ_ONCE(nx_huge_pages_recovery_ratio);
6265− uint period = READ_ONCE(nx_huge_pages_recovery_period_ms);
6296+ bool enabled;
6297+ uint period;
62666298
6267− if (!period && ratio) {
6268− /* Make sure the period is not less than one second. */
6269− ratio = min(ratio, 3600u);
6270− period = 60 * 60 * 1000 / ratio;
6271− }
6299+ enabled = calc_nx_huge_pages_recovery_period(&period);
62726300
6273− return READ_ONCE(nx_huge_pages) && ratio
6274− ? start_time + msecs_to_jiffies(period) - get_jiffies_64()
6275− : MAX_SCHEDULE_TIMEOUT;
6301+ return enabled ? start_time + msecs_to_jiffies(period) - get_jiffies_64()
6302+ : MAX_SCHEDULE_TIMEOUT;
62766303 }
62776304
62786305 static int kvm_nx_lpage_recovery_worker(struct kvm *kvm, uintptr_t data)
arch/x86/kvm/mmu/paging_tmpl.h+2−1
@@ -911,7 +911,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault · 910 unmodified lines
911911
912912 r = RET_PF_RETRY;
913913 write_lock(&vcpu->kvm->mmu_lock);
914− if (fault->slot && mmu_notifier_retry_hva(vcpu->kvm, mmu_seq, fault->hva))
914+
915+ if (is_page_fault_stale(vcpu, fault, mmu_seq))
915916 goto out_unlock;
916917
917918 kvm_mmu_audit(vcpu, AUDIT_PRE_PAGE_FAULT);
arch/x86/kvm/mmu/tdp_mmu.c+14−24
@@ -317,9 +317,6 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt, · 316 unmodified lines
317317 struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt));
318318 int level = sp->role.level;
319319 gfn_t base_gfn = sp->gfn;
320− u64 old_child_spte;
321− u64 *sptep;
322− gfn_t gfn;
323320 int i;
324321
325322 trace_kvm_mmu_prepare_zap_page(sp);
@@ -327,8 +324,9 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt, · 1 unmodified line
327324 tdp_mmu_unlink_page(kvm, sp, shared);
328325
329326 for (i = 0; i < PT64_ENT_PER_PAGE; i++) {
330− sptep = rcu_dereference(pt) + i;
331− gfn = base_gfn + i * KVM_PAGES_PER_HPAGE(level);
327+ u64 *sptep = rcu_dereference(pt) + i;
328+ gfn_t gfn = base_gfn + i * KVM_PAGES_PER_HPAGE(level);
329+ u64 old_child_spte;
332330
333331 if (shared) {
334332 /*
@@ -374,7 +372,7 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt, · 39 unmodified lines
374372 shared);
375373 }
376374
377− kvm_flush_remote_tlbs_with_address(kvm, gfn,
375+ kvm_flush_remote_tlbs_with_address(kvm, base_gfn,
378376 KVM_PAGES_PER_HPAGE(level + 1));
379377
380378 call_rcu(&sp->rcu_head, tdp_mmu_free_sp_rcu_callback);
@@ -1033,9 +1031,9 @@ bool kvm_tdp_mmu_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range, · 652 unmodified lines
10331031 {
10341032 struct kvm_mmu_page *root;
10351033
1036− for_each_tdp_mmu_root(kvm, root, range->slot->as_id)
1037− flush |= zap_gfn_range(kvm, root, range->start, range->end,
1038− range->may_block, flush, false);
1034+ for_each_tdp_mmu_root_yield_safe(kvm, root, range->slot->as_id, false)
1035+ flush = zap_gfn_range(kvm, root, range->start, range->end,
1036+ range->may_block, flush, false);
10391037
10401038 return flush;
10411039 }
@@ -1364,10 +1362,9 @@ void kvm_tdp_mmu_clear_dirty_pt_masked(struct kvm *kvm, · 322 unmodified lines
13641362 * Clear leaf entries which could be replaced by large mappings, for
13651363 * GFNs within the slot.
13661364 */
1367−static bool zap_collapsible_spte_range(struct kvm *kvm,
1365+static void zap_collapsible_spte_range(struct kvm *kvm,
13681366 struct kvm_mmu_page *root,
1369− const struct kvm_memory_slot *slot,
1370− bool flush)
1367+ const struct kvm_memory_slot *slot)
13711368 {
13721369 gfn_t start = slot->base_gfn;
13731370 gfn_t end = start + slot->npages;
@@ -1378,10 +1375,8 @@ static bool zap_collapsible_spte_range(struct kvm *kvm, · 4 unmodified lines
13781375
13791376 tdp_root_for_each_pte(iter, root, start, end) {
13801377 retry:
1381− if (tdp_mmu_iter_cond_resched(kvm, &iter, flush, true)) {
1382− flush = false;
1378+ if (tdp_mmu_iter_cond_resched(kvm, &iter, false, true))
13831379 continue;
1384− }
13851380
13861381 if (!is_shadow_present_pte(iter.old_spte) ||
13871382 !is_last_spte(iter.old_spte, iter.level))
@@ -1393,6 +1388,7 @@ retry: · 5 unmodified lines
13931388 pfn, PG_LEVEL_NUM))
13941389 continue;
13951390
1391+ /* Note, a successful atomic zap also does a remote TLB flush. */
13961392 if (!tdp_mmu_zap_spte_atomic(kvm, &iter)) {
13971393 /*
13981394 * The iter must explicitly re-read the SPTE because
@@ -1401,30 +1397,24 @@ retry: · 2 unmodified lines
14011397 iter.old_spte = READ_ONCE(*rcu_dereference(iter.sptep));
14021398 goto retry;
14031399 }
1404− flush = true;
14051400 }
14061401
14071402 rcu_read_unlock();
1408−
1409− return flush;
14101403 }
14111404
14121405 /*
14131406 * Clear non-leaf entries (and free associated page tables) which could
14141407 * be replaced by large mappings, for GFNs within the slot.
14151408 */
1416−bool kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm,
1417− const struct kvm_memory_slot *slot,
1418− bool flush)
1409+void kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm,
1410+ const struct kvm_memory_slot *slot)
14191411 {
14201412 struct kvm_mmu_page *root;
14211413
14221414 lockdep_assert_held_read(&kvm->mmu_lock);
14231415
14241416 for_each_tdp_mmu_root_yield_safe(kvm, root, slot->as_id, true)
1425− flush = zap_collapsible_spte_range(kvm, root, slot, flush);
1426−
1427− return flush;
1417+ zap_collapsible_spte_range(kvm, root, slot);
14281418 }
14291419
14301420 /*
arch/x86/kvm/mmu/tdp_mmu.h+2−3
@@ -64,9 +64,8 @@ void kvm_tdp_mmu_clear_dirty_pt_masked(struct kvm *kvm, · 63 unmodified lines
6464 struct kvm_memory_slot *slot,
6565 gfn_t gfn, unsigned long mask,
6666 bool wrprot);
67−bool kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm,
68− const struct kvm_memory_slot *slot,
69− bool flush);
67+void kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm,
68+ const struct kvm_memory_slot *slot);
7069
7170 bool kvm_tdp_mmu_write_protect_gfn(struct kvm *kvm,
7271 struct kvm_memory_slot *slot, gfn_t gfn,
arch/x86/kvm/svm/avic.c+10−7
@@ -900,6 +900,7 @@ out: · 899 unmodified lines
900900 bool svm_check_apicv_inhibit_reasons(ulong bit)
901901 {
902902 ulong supported = BIT(APICV_INHIBIT_REASON_DISABLE) |
903+ BIT(APICV_INHIBIT_REASON_ABSENT) |
903904 BIT(APICV_INHIBIT_REASON_HYPERV) |
904905 BIT(APICV_INHIBIT_REASON_NESTED) |
905906 BIT(APICV_INHIBIT_REASON_IRQWIN) |
@@ -989,16 +990,18 @@ void avic_vcpu_put(struct kvm_vcpu *vcpu) · 83 unmodified lines
989990 static void avic_set_running(struct kvm_vcpu *vcpu, bool is_run)
990991 {
991992 struct vcpu_svm *svm = to_svm(vcpu);
993+ int cpu = get_cpu();
992994
995+ WARN_ON(cpu != vcpu->cpu);
993996 svm->avic_is_running = is_run;
994997
995− if (!kvm_vcpu_apicv_active(vcpu))
996− return;
997−
998− if (is_run)
999− avic_vcpu_load(vcpu, vcpu->cpu);
1000− else
1001− avic_vcpu_put(vcpu);
998+ if (kvm_vcpu_apicv_active(vcpu)) {
999+ if (is_run)
1000+ avic_vcpu_load(vcpu, cpu);
1001+ else
1002+ avic_vcpu_put(vcpu);
1003+ }
1004+ put_cpu();
10021005 }
10031006
10041007 void svm_vcpu_blocking(struct kvm_vcpu *vcpu)
arch/x86/kvm/svm/pmu.c+1−1
@@ -281,7 +281,7 @@ static void amd_pmu_refresh(struct kvm_vcpu *vcpu) · 280 unmodified lines
281281 pmu->nr_arch_gp_counters = AMD64_NUM_COUNTERS;
282282
283283 pmu->counter_bitmask[KVM_PMC_GP] = ((u64)1 << 48) - 1;
284− pmu->reserved_bits = 0xffffffff00200000ull;
284+ pmu->reserved_bits = 0xfffffff000280000ull;
285285 pmu->version = 1;
286286 /* not applicable to AMD; but clean them to prevent any fall out */
287287 pmu->counter_bitmask[KVM_PMC_FIXED] = 0;
arch/x86/kvm/svm/sev.c+151−118
@@ -237,7 +237,6 @@ static void sev_unbind_asid(struct kvm *kvm, unsigned int handle) · 236 unmodified lines
237237 static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp)
238238 {
239239 struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
240− bool es_active = argp->id == KVM_SEV_ES_INIT;
241240 int asid, ret;
242241
243242 if (kvm->created_vcpus)
@@ -247,7 +246,8 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp) · 3 unmodified lines
247246 if (unlikely(sev->active))
248247 return ret;
249248
250− sev->es_active = es_active;
249+ sev->active = true;
250+ sev->es_active = argp->id == KVM_SEV_ES_INIT;
251251 asid = sev_asid_new(sev);
252252 if (asid < 0)
253253 goto e_no_asid;
@@ -257,8 +257,6 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp) · 3 unmodified lines
257257 if (ret)
258258 goto e_free;
259259
260− sev->active = true;
261− sev->asid = asid;
262260 INIT_LIST_HEAD(&sev->regions_list);
263261
264262 return 0;
@@ -268,6 +266,7 @@ e_free: · 3 unmodified lines
268266 sev->asid = 0;
269267 e_no_asid:
270268 sev->es_active = false;
269+ sev->active = false;
271270 return ret;
272271 }
273272
@@ -1530,7 +1529,7 @@ static int sev_receive_finish(struct kvm *kvm, struct kvm_sev_cmd *argp) · 1256 unmodified lines
15301529 return sev_issue_cmd(kvm, SEV_CMD_RECEIVE_FINISH, &data, &argp->error);
15311530 }
15321531
1533−static bool cmd_allowed_from_miror(u32 cmd_id)
1532+static bool is_cmd_allowed_from_mirror(u32 cmd_id)
15341533 {
15351534 /*
15361535 * Allow mirrors VM to call KVM_SEV_LAUNCH_UPDATE_VMSA to enable SEV-ES
@@ -1544,28 +1543,50 @@ static bool cmd_allowed_from_miror(u32 cmd_id) · 7 unmodified lines
15441543 return false;
15451544 }
15461545
1547−static int sev_lock_for_migration(struct kvm *kvm)
1546+static int sev_lock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
15481547 {
1549− struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
1548+ struct kvm_sev_info *dst_sev = &to_kvm_svm(dst_kvm)->sev_info;
1549+ struct kvm_sev_info *src_sev = &to_kvm_svm(src_kvm)->sev_info;
1550+ int r = -EBUSY;
1551+
1552+ if (dst_kvm == src_kvm)
1553+ return -EINVAL;
15501554
15511555 /*
1552− * Bail if this VM is already involved in a migration to avoid deadlock
1553− * between two VMs trying to migrate to/from each other.
1556+ * Bail if these VMs are already involved in a migration to avoid
1557+ * deadlock between two VMs trying to migrate to/from each other.
15541558 */
1555− if (atomic_cmpxchg_acquire(&sev->migration_in_progress, 0, 1))
1559+ if (atomic_cmpxchg_acquire(&dst_sev->migration_in_progress, 0, 1))
15561560 return -EBUSY;
15571561
1558− mutex_lock(&kvm->lock);
1562+ if (atomic_cmpxchg_acquire(&src_sev->migration_in_progress, 0, 1))
1563+ goto release_dst;
15591564
1565+ r = -EINTR;
1566+ if (mutex_lock_killable(&dst_kvm->lock))
1567+ goto release_src;
1568+ if (mutex_lock_killable(&src_kvm->lock))
1569+ goto unlock_dst;
15601570 return 0;
1571+
1572+unlock_dst:
1573+ mutex_unlock(&dst_kvm->lock);
1574+release_src:
1575+ atomic_set_release(&src_sev->migration_in_progress, 0);
1576+release_dst:
1577+ atomic_set_release(&dst_sev->migration_in_progress, 0);
1578+ return r;
15611579 }
15621580
1563−static void sev_unlock_after_migration(struct kvm *kvm)
1581+static void sev_unlock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
15641582 {
1565− struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
1583+ struct kvm_sev_info *dst_sev = &to_kvm_svm(dst_kvm)->sev_info;
1584+ struct kvm_sev_info *src_sev = &to_kvm_svm(src_kvm)->sev_info;
15661585
1567− mutex_unlock(&kvm->lock);
1568− atomic_set_release(&sev->migration_in_progress, 0);
1586+ mutex_unlock(&dst_kvm->lock);
1587+ mutex_unlock(&src_kvm->lock);
1588+ atomic_set_release(&dst_sev->migration_in_progress, 0);
1589+ atomic_set_release(&src_sev->migration_in_progress, 0);
15691590 }
15701591
15711592
@@ -1608,14 +1629,15 @@ static void sev_migrate_from(struct kvm_sev_info *dst, · 36 unmodified lines
16081629 dst->asid = src->asid;
16091630 dst->handle = src->handle;
16101631 dst->pages_locked = src->pages_locked;
1632+ dst->enc_context_owner = src->enc_context_owner;
16111633
16121634 src->asid = 0;
16131635 src->active = false;
16141636 src->handle = 0;
16151637 src->pages_locked = 0;
1638+ src->enc_context_owner = NULL;
16161639
1617− INIT_LIST_HEAD(&dst->regions_list);
1618− list_replace_init(&src->regions_list, &dst->regions_list);
1640+ list_cut_before(&dst->regions_list, &src->regions_list, &src->regions_list);
16191641 }
16201642
16211643 static int sev_es_migrate_from(struct kvm *dst, struct kvm *src)
@@ -1667,15 +1689,6 @@ int svm_vm_migrate_from(struct kvm *kvm, unsigned int source_fd) · 45 unmodified lines
16671689 bool charged = false;
16681690 int ret;
16691691
1670− ret = sev_lock_for_migration(kvm);
1671− if (ret)
1672− return ret;
1673−
1674− if (sev_guest(kvm)) {
1675− ret = -EINVAL;
1676− goto out_unlock;
1677− }
1678−
16791692 source_kvm_file = fget(source_fd);
16801693 if (!file_is_kvm(source_kvm_file)) {
16811694 ret = -EBADF;
@@ -1683,16 +1696,26 @@ int svm_vm_migrate_from(struct kvm *kvm, unsigned int source_fd) · 1 unmodified line
16831696 }
16841697
16851698 source_kvm = source_kvm_file->private_data;
1686− ret = sev_lock_for_migration(source_kvm);
1699+ ret = sev_lock_two_vms(kvm, source_kvm);
16871700 if (ret)
16881701 goto out_fput;
16891702
1690− if (!sev_guest(source_kvm)) {
1703+ if (sev_guest(kvm) || !sev_guest(source_kvm)) {
16911704 ret = -EINVAL;
1692− goto out_source;
1705+ goto out_unlock;
16931706 }
16941707
16951708 src_sev = &to_kvm_svm(source_kvm)->sev_info;
1709+
1710+ /*
1711+ * VMs mirroring src's encryption context rely on it to keep the
1712+ * ASID allocated, but below we are clearing src_sev->asid.
1713+ */
1714+ if (src_sev->num_mirrored_vms) {
1715+ ret = -EBUSY;
1716+ goto out_unlock;
1717+ }
1718+
16961719 dst_sev->misc_cg = get_current_misc_cg();
16971720 cg_cleanup_sev = dst_sev;
16981721 if (dst_sev->misc_cg != src_sev->misc_cg) {
@@ -1729,13 +1752,11 @@ out_dst_cgroup: · 30 unmodified lines
17291752 sev_misc_cg_uncharge(cg_cleanup_sev);
17301753 put_misc_cg(cg_cleanup_sev->misc_cg);
17311754 cg_cleanup_sev->misc_cg = NULL;
1732−out_source:
1733− sev_unlock_after_migration(source_kvm);
1755+out_unlock:
1756+ sev_unlock_two_vms(kvm, source_kvm);
17341757 out_fput:
17351758 if (source_kvm_file)
17361759 fput(source_kvm_file);
1737−out_unlock:
1738− sev_unlock_after_migration(kvm);
17391760 return ret;
17401761 }
17411762
@@ -1757,7 +1778,7 @@ int svm_mem_enc_op(struct kvm *kvm, void __user *argp) · 15 unmodified lines
17571778
17581779 /* Only the enc_context_owner handles some memory enc operations. */
17591780 if (is_mirroring_enc_context(kvm) &&
1760− !cmd_allowed_from_miror(sev_cmd.id)) {
1781+ !is_cmd_allowed_from_mirror(sev_cmd.id)) {
17611782 r = -EINVAL;
17621783 goto out;
17631784 }
@@ -1954,71 +1975,60 @@ int svm_vm_copy_asid_from(struct kvm *kvm, unsigned int source_fd) · 190 unmodified lines
19541975 {
19551976 struct file *source_kvm_file;
19561977 struct kvm *source_kvm;
1957− struct kvm_sev_info source_sev, *mirror_sev;
1978+ struct kvm_sev_info *source_sev, *mirror_sev;
19581979 int ret;
19591980
19601981 source_kvm_file = fget(source_fd);
19611982 if (!file_is_kvm(source_kvm_file)) {
19621983 ret = -EBADF;
1963− goto e_source_put;
1984+ goto e_source_fput;
19641985 }
19651986
19661987 source_kvm = source_kvm_file->private_data;
1967− mutex_lock(&source_kvm->lock);
1968−
1969− if (!sev_guest(source_kvm)) {
1970− ret = -EINVAL;
1971− goto e_source_unlock;
1972− }
1988+ ret = sev_lock_two_vms(kvm, source_kvm);
1989+ if (ret)
1990+ goto e_source_fput;
19731991
1974− /* Mirrors of mirrors should work, but let's not get silly */
1975− if (is_mirroring_enc_context(source_kvm) || source_kvm == kvm) {
1992+ /*
1993+ * Mirrors of mirrors should work, but let's not get silly. Also
1994+ * disallow out-of-band SEV/SEV-ES init if the target is already an
1995+ * SEV guest, or if vCPUs have been created. KVM relies on vCPUs being
1996+ * created after SEV/SEV-ES initialization, e.g. to init intercepts.
1997+ */
1998+ if (sev_guest(kvm) || !sev_guest(source_kvm) ||
1999+ is_mirroring_enc_context(source_kvm) || kvm->created_vcpus) {
19762000 ret = -EINVAL;
1977− goto e_source_unlock;
2001+ goto e_unlock;
19782002 }
19792003
1980− memcpy(&source_sev, &to_kvm_svm(source_kvm)->sev_info,
1981− sizeof(source_sev));
1982−
19832004 /*
19842005 * The mirror kvm holds an enc_context_owner ref so its asid can't
19852006 * disappear until we're done with it
19862007 */
2008+ source_sev = &to_kvm_svm(source_kvm)->sev_info;
19872009 kvm_get_kvm(source_kvm);
1988−
1989− fput(source_kvm_file);
1990− mutex_unlock(&source_kvm->lock);
1991− mutex_lock(&kvm->lock);
1992−
1993− if (sev_guest(kvm)) {
1994− ret = -EINVAL;
1995− goto e_mirror_unlock;
1996− }
2010+ source_sev->num_mirrored_vms++;
19972011
19982012 /* Set enc_context_owner and copy its encryption context over */
19992013 mirror_sev = &to_kvm_svm(kvm)->sev_info;
20002014 mirror_sev->enc_context_owner = source_kvm;
20012015 mirror_sev->active = true;
2002− mirror_sev->asid = source_sev.asid;
2003− mirror_sev->fd = source_sev.fd;
2004− mirror_sev->es_active = source_sev.es_active;
2005− mirror_sev->handle = source_sev.handle;
2016+ mirror_sev->asid = source_sev->asid;
2017+ mirror_sev->fd = source_sev->fd;
2018+ mirror_sev->es_active = source_sev->es_active;
2019+ mirror_sev->handle = source_sev->handle;
2020+ INIT_LIST_HEAD(&mirror_sev->regions_list);
2021+ ret = 0;
2022+
20062023 /*
20072024 * Do not copy ap_jump_table. Since the mirror does not share the same
20082025 * KVM contexts as the original, and they may have different
20092026 * memory-views.
20102027 */
20112028
2012− mutex_unlock(&kvm->lock);
2013− return 0;
2014−
2015−e_mirror_unlock:
2016− mutex_unlock(&kvm->lock);
2017− kvm_put_kvm(source_kvm);
2018− return ret;
2019−e_source_unlock:
2020− mutex_unlock(&source_kvm->lock);
2021−e_source_put:
2029+e_unlock:
2030+ sev_unlock_two_vms(kvm, source_kvm);
2031+e_source_fput:
20222032 if (source_kvm_file)
20232033 fput(source_kvm_file);
20242034 return ret;
@@ -2030,17 +2040,24 @@ void sev_vm_destroy(struct kvm *kvm) · 5 unmodified lines
20302040 struct list_head *head = &sev->regions_list;
20312041 struct list_head *pos, *q;
20322042
2043+ WARN_ON(sev->num_mirrored_vms);
2044+
20332045 if (!sev_guest(kvm))
20342046 return;
20352047
20362048 /* If this is a mirror_kvm release the enc_context_owner and skip sev cleanup */
20372049 if (is_mirroring_enc_context(kvm)) {
2038− kvm_put_kvm(sev->enc_context_owner);
2050+ struct kvm *owner_kvm = sev->enc_context_owner;
2051+ struct kvm_sev_info *owner_sev = &to_kvm_svm(owner_kvm)->sev_info;
2052+
2053+ mutex_lock(&owner_kvm->lock);
2054+ if (!WARN_ON(!owner_sev->num_mirrored_vms))
2055+ owner_sev->num_mirrored_vms--;
2056+ mutex_unlock(&owner_kvm->lock);
2057+ kvm_put_kvm(owner_kvm);
20392058 return;
20402059 }
20412060
2042− mutex_lock(&kvm->lock);
2043−
20442061 /*
20452062 * Ensure that all guest tagged cache entries are flushed before
20462063 * releasing the pages back to the system for use. CLFLUSH will
@@ -2060,8 +2077,6 @@ void sev_vm_destroy(struct kvm *kvm) · 13 unmodified lines
20602077 }
20612078 }
20622079
2063− mutex_unlock(&kvm->lock);
2064−
20652080 sev_unbind_asid(kvm, sev->handle);
20662081 sev_asid_free(sev);
20672082 }
@@ -2245,7 +2260,7 @@ void sev_free_vcpu(struct kvm_vcpu *vcpu) · 177 unmodified lines
22452260 __free_page(virt_to_page(svm->sev_es.vmsa));
22462261
22472262 if (svm->sev_es.ghcb_sa_free)
2248− kfree(svm->sev_es.ghcb_sa);
2263+ kvfree(svm->sev_es.ghcb_sa);
22492264 }
22502265
22512266 static void dump_ghcb(struct vcpu_svm *svm)
@@ -2337,24 +2352,29 @@ static void sev_es_sync_from_ghcb(struct vcpu_svm *svm) · 85 unmodified lines
23372352 memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap));
23382353 }
23392354
2340−static int sev_es_validate_vmgexit(struct vcpu_svm *svm)
2355+static bool sev_es_validate_vmgexit(struct vcpu_svm *svm)
23412356 {
23422357 struct kvm_vcpu *vcpu;
23432358 struct ghcb *ghcb;
2344− u64 exit_code = 0;
2359+ u64 exit_code;
2360+ u64 reason;
23452361
23462362 ghcb = svm->sev_es.ghcb;
23472363
2348− /* Only GHCB Usage code 0 is supported */
2349− if (ghcb->ghcb_usage)
2350− goto vmgexit_err;
2351−
23522364 /*
2353− * Retrieve the exit code now even though is may not be marked valid
2365+ * Retrieve the exit code now even though it may not be marked valid
23542366 * as it could help with debugging.
23552367 */
23562368 exit_code = ghcb_get_sw_exit_code(ghcb);
23572369
2370+ /* Only GHCB Usage code 0 is supported */
2371+ if (ghcb->ghcb_usage) {
2372+ reason = GHCB_ERR_INVALID_USAGE;
2373+ goto vmgexit_err;
2374+ }
2375+
2376+ reason = GHCB_ERR_MISSING_INPUT;
2377+
23582378 if (!ghcb_sw_exit_code_is_valid(ghcb) ||
23592379 !ghcb_sw_exit_info_1_is_valid(ghcb) ||
23602380 !ghcb_sw_exit_info_2_is_valid(ghcb))
@@ -2433,30 +2453,34 @@ static int sev_es_validate_vmgexit(struct vcpu_svm *svm) · 72 unmodified lines
24332453 case SVM_VMGEXIT_UNSUPPORTED_EVENT:
24342454 break;
24352455 default:
2456+ reason = GHCB_ERR_INVALID_EVENT;
24362457 goto vmgexit_err;
24372458 }
24382459
2439− return 0;
2460+ return true;
24402461
24412462 vmgexit_err:
24422463 vcpu = &svm->vcpu;
24432464
2444− if (ghcb->ghcb_usage) {
2465+ if (reason == GHCB_ERR_INVALID_USAGE) {
24452466 vcpu_unimpl(vcpu, "vmgexit: ghcb usage %#x is not valid\n",
24462467 ghcb->ghcb_usage);
2468+ } else if (reason == GHCB_ERR_INVALID_EVENT) {
2469+ vcpu_unimpl(vcpu, "vmgexit: exit code %#llx is not valid\n",
2470+ exit_code);
24472471 } else {
2448− vcpu_unimpl(vcpu, "vmgexit: exit reason %#llx is not valid\n",
2472+ vcpu_unimpl(vcpu, "vmgexit: exit code %#llx input is not valid\n",
24492473 exit_code);
24502474 dump_ghcb(svm);
24512475 }
24522476
2453− vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
2454− vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_UNEXPECTED_EXIT_REASON;
2455− vcpu->run->internal.ndata = 2;
2456− vcpu->run->internal.data[0] = exit_code;
2457− vcpu->run->internal.data[1] = vcpu->arch.last_vmentry_cpu;
2477+ /* Clear the valid entries fields */
2478+ memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap));
2479+
2480+ ghcb_set_sw_exit_info_1(ghcb, 2);
2481+ ghcb_set_sw_exit_info_2(ghcb, reason);
24582482
2459− return -EINVAL;
2483+ return false;
24602484 }
24612485
24622486 void sev_es_unmap_ghcb(struct vcpu_svm *svm)
@@ -2478,7 +2502,7 @@ void sev_es_unmap_ghcb(struct vcpu_svm *svm) · 15 unmodified lines
24782502 svm->sev_es.ghcb_sa_sync = false;
24792503 }
24802504
2481− kfree(svm->sev_es.ghcb_sa);
2505+ kvfree(svm->sev_es.ghcb_sa);
24822506 svm->sev_es.ghcb_sa = NULL;
24832507 svm->sev_es.ghcb_sa_free = false;
24842508 }
@@ -2526,14 +2550,14 @@ static bool setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len) · 41 unmodified lines
25262550 scratch_gpa_beg = ghcb_get_sw_scratch(ghcb);
25272551 if (!scratch_gpa_beg) {
25282552 pr_err("vmgexit: scratch gpa not provided\n");
2529− return false;
2553+ goto e_scratch;
25302554 }
25312555
25322556 scratch_gpa_end = scratch_gpa_beg + len;
25332557 if (scratch_gpa_end < scratch_gpa_beg) {
25342558 pr_err("vmgexit: scratch length (%#llx) not valid for scratch address (%#llx)\n",
25352559 len, scratch_gpa_beg);
2536− return false;
2560+ goto e_scratch;
25372561 }
25382562
25392563 if ((scratch_gpa_beg & PAGE_MASK) == control->ghcb_gpa) {
@@ -2551,7 +2575,7 @@ static bool setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len) · 11 unmodified lines
25512575 scratch_gpa_end > ghcb_scratch_end) {
25522576 pr_err("vmgexit: scratch area is outside of GHCB shared buffer area (%#llx - %#llx)\n",
25532577 scratch_gpa_beg, scratch_gpa_end);
2554− return false;
2578+ goto e_scratch;
25552579 }
25562580
25572581 scratch_va = (void *)svm->sev_es.ghcb;
@@ -2564,18 +2588,18 @@ static bool setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len) · 6 unmodified lines
25642588 if (len > GHCB_SCRATCH_AREA_LIMIT) {
25652589 pr_err("vmgexit: scratch area exceeds KVM limits (%#llx requested, %#llx limit)\n",
25662590 len, GHCB_SCRATCH_AREA_LIMIT);
2567− return false;
2591+ goto e_scratch;
25682592 }
2569− scratch_va = kzalloc(len, GFP_KERNEL_ACCOUNT);
2593+ scratch_va = kvzalloc(len, GFP_KERNEL_ACCOUNT);
25702594 if (!scratch_va)
2571− return false;
2595+ goto e_scratch;
25722596
25732597 if (kvm_read_guest(svm->vcpu.kvm, scratch_gpa_beg, scratch_va, len)) {
25742598 /* Unable to copy scratch area from guest */
25752599 pr_err("vmgexit: kvm_read_guest for scratch area failed\n");
25762600
2577− kfree(scratch_va);
2578− return false;
2601+ kvfree(scratch_va);
2602+ goto e_scratch;
25792603 }
25802604
25812605 /*
@@ -2592,6 +2616,12 @@ static bool setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len) · 10 unmodified lines
25922616 svm->sev_es.ghcb_sa_len = len;
25932617
25942618 return true;
2619+
2620+e_scratch:
2621+ ghcb_set_sw_exit_info_1(ghcb, 2);
2622+ ghcb_set_sw_exit_info_2(ghcb, GHCB_ERR_INVALID_SCRATCH_AREA);
2623+
2624+ return false;
25952625 }
25962626
25972627 static void set_ghcb_msr_bits(struct vcpu_svm *svm, u64 value, u64 mask,
@@ -2642,7 +2672,7 @@ static int sev_handle_vmgexit_msr_protocol(struct vcpu_svm *svm) · 44 unmodified lines
26422672
26432673 ret = svm_invoke_exit_handler(vcpu, SVM_EXIT_CPUID);
26442674 if (!ret) {
2645− ret = -EINVAL;
2675+ /* Error, keep GHCB MSR value as-is */
26462676 break;
26472677 }
26482678
@@ -2678,10 +2708,13 @@ static int sev_handle_vmgexit_msr_protocol(struct vcpu_svm *svm) · 29 unmodified lines
26782708 GHCB_MSR_TERM_REASON_POS);
26792709 pr_info("SEV-ES guest requested termination: %#llx:%#llx\n",
26802710 reason_set, reason_code);
2681− fallthrough;
2711+
2712+ ret = -EINVAL;
2713+ break;
26822714 }
26832715 default:
2684− ret = -EINVAL;
2716+ /* Error, keep GHCB MSR value as-is */
2717+ break;
26852718 }
26862719
26872720 trace_kvm_vmgexit_msr_protocol_exit(svm->vcpu.vcpu_id,
@@ -2705,14 +2738,18 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) · 17 unmodified lines
27052738
27062739 if (!ghcb_gpa) {
27072740 vcpu_unimpl(vcpu, "vmgexit: GHCB gpa is not set\n");
2708− return -EINVAL;
2741+
2742+ /* Without a GHCB, just return right back to the guest */
2743+ return 1;
27092744 }
27102745
27112746 if (kvm_vcpu_map(vcpu, ghcb_gpa >> PAGE_SHIFT, &svm->sev_es.ghcb_map)) {
27122747 /* Unable to map GHCB from guest */
27132748 vcpu_unimpl(vcpu, "vmgexit: error mapping GHCB [%#llx] from guest\n",
27142749 ghcb_gpa);
2715− return -EINVAL;
2750+
2751+ /* Without a GHCB, just return right back to the guest */
2752+ return 1;
27162753 }
27172754
27182755 svm->sev_es.ghcb = svm->sev_es.ghcb_map.hva;
@@ -2722,15 +2759,14 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) · 3 unmodified lines
27222759
27232760 exit_code = ghcb_get_sw_exit_code(ghcb);
27242761
2725− ret = sev_es_validate_vmgexit(svm);
2726− if (ret)
2727− return ret;
2762+ if (!sev_es_validate_vmgexit(svm))
2763+ return 1;
27282764
27292765 sev_es_sync_from_ghcb(svm);
27302766 ghcb_set_sw_exit_info_1(ghcb, 0);
27312767 ghcb_set_sw_exit_info_2(ghcb, 0);
27322768
2733− ret = -EINVAL;
2769+ ret = 1;
27342770 switch (exit_code) {
27352771 case SVM_VMGEXIT_MMIO_READ:
27362772 if (!setup_vmgexit_scratch(svm, true, control->exit_info_2))
@@ -2771,20 +2807,17 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) · 34 unmodified lines
27712807 default:
27722808 pr_err("svm: vmgexit: unsupported AP jump table request - exit_info_1=%#llx\n",
27732809 control->exit_info_1);
2774− ghcb_set_sw_exit_info_1(ghcb, 1);
2775− ghcb_set_sw_exit_info_2(ghcb,
2776− X86_TRAP_UD |
2777− SVM_EVTINJ_TYPE_EXEPT |
2778− SVM_EVTINJ_VALID);
2810+ ghcb_set_sw_exit_info_1(ghcb, 2);
2811+ ghcb_set_sw_exit_info_2(ghcb, GHCB_ERR_INVALID_INPUT);
27792812 }
27802813
2781− ret = 1;
27822814 break;
27832815 }
27842816 case SVM_VMGEXIT_UNSUPPORTED_EVENT:
27852817 vcpu_unimpl(vcpu,
27862818 "vmgexit: unsupported event - exit_info_1=%#llx, exit_info_2=%#llx\n",
27872819 control->exit_info_1, control->exit_info_2);
2820+ ret = -EINVAL;
27882821 break;
27892822 default:
27902823 ret = svm_invoke_exit_handler(vcpu, exit_code);
@@ -2806,7 +2839,7 @@ int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in) · 15 unmodified lines
28062839 return -EINVAL;
28072840
28082841 if (!setup_vmgexit_scratch(svm, in, bytes))
2809− return -EINVAL;
2842+ return 1;
28102843
28112844 return kvm_sev_es_string_io(&svm->vcpu, size, port, svm->sev_es.ghcb_sa,
28122845 count, in);
arch/x86/kvm/svm/svm.c+0−1
@@ -4651,7 +4651,6 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { · 4650 unmodified lines
46514651 .load_eoi_exitmap = svm_load_eoi_exitmap,
46524652 .hwapic_irr_update = svm_hwapic_irr_update,
46534653 .hwapic_isr_update = svm_hwapic_isr_update,
4654− .sync_pir_to_irr = kvm_lapic_find_highest_irr,
46554654 .apicv_post_state_restore = avic_post_state_restore,
46564655
46574656 .set_tss_addr = svm_set_tss_addr,
arch/x86/kvm/svm/svm.h+2−1
@@ -79,6 +79,7 @@ struct kvm_sev_info { · 78 unmodified lines
7979 struct list_head regions_list; /* List of registered regions */
8080 u64 ap_jump_table; /* SEV-ES AP Jump Table address */
8181 struct kvm *enc_context_owner; /* Owner of copied encryption context */
82+ unsigned long num_mirrored_vms; /* Number of VMs sharing this ASID */
8283 struct misc_cg *misc_cg; /* For misc cgroup accounting */
8384 atomic_t migration_in_progress;
8485 };
@@ -247,7 +248,7 @@ static __always_inline bool sev_es_guest(struct kvm *kvm) · 162 unmodified lines
247248 #ifdef CONFIG_KVM_AMD_SEV
248249 struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
249250
250− return sev_guest(kvm) && sev->es_active;
251+ return sev->es_active && !WARN_ON_ONCE(!sev->active);
251252 #else
252253 return false;
253254 #endif
arch/x86/kvm/vmx/nested.c+87−60
@@ -670,33 +670,39 @@ static inline bool nested_vmx_prepare_msr_bitmap(struct kvm_vcpu *vcpu, · 669 unmodified lines
670670 static void nested_cache_shadow_vmcs12(struct kvm_vcpu *vcpu,
671671 struct vmcs12 *vmcs12)
672672 {
673− struct kvm_host_map map;
674− struct vmcs12 *shadow;
673+ struct vcpu_vmx *vmx = to_vmx(vcpu);
674+ struct gfn_to_hva_cache *ghc = &vmx->nested.shadow_vmcs12_cache;
675675
676676 if (!nested_cpu_has_shadow_vmcs(vmcs12) ||
677677 vmcs12->vmcs_link_pointer == INVALID_GPA)
678678 return;
679679
680− shadow = get_shadow_vmcs12(vcpu);
681−
682− if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->vmcs_link_pointer), &map))
680+ if (ghc->gpa != vmcs12->vmcs_link_pointer &&
681+ kvm_gfn_to_hva_cache_init(vcpu->kvm, ghc,
682+ vmcs12->vmcs_link_pointer, VMCS12_SIZE))
683683 return;
684684
685− memcpy(shadow, map.hva, VMCS12_SIZE);
686− kvm_vcpu_unmap(vcpu, &map, false);
685+ kvm_read_guest_cached(vmx->vcpu.kvm, ghc, get_shadow_vmcs12(vcpu),
686+ VMCS12_SIZE);
687687 }
688688
689689 static void nested_flush_cached_shadow_vmcs12(struct kvm_vcpu *vcpu,
690690 struct vmcs12 *vmcs12)
691691 {
692692 struct vcpu_vmx *vmx = to_vmx(vcpu);
693+ struct gfn_to_hva_cache *ghc = &vmx->nested.shadow_vmcs12_cache;
693694
694695 if (!nested_cpu_has_shadow_vmcs(vmcs12) ||
695696 vmcs12->vmcs_link_pointer == INVALID_GPA)
696697 return;
697698
698− kvm_write_guest(vmx->vcpu.kvm, vmcs12->vmcs_link_pointer,
699− get_shadow_vmcs12(vcpu), VMCS12_SIZE);
699+ if (ghc->gpa != vmcs12->vmcs_link_pointer &&
700+ kvm_gfn_to_hva_cache_init(vcpu->kvm, ghc,
701+ vmcs12->vmcs_link_pointer, VMCS12_SIZE))
702+ return;
703+
704+ kvm_write_guest_cached(vmx->vcpu.kvm, ghc, get_shadow_vmcs12(vcpu),
705+ VMCS12_SIZE);
700706 }
701707
702708 /*
@@ -1156,29 +1162,26 @@ static void nested_vmx_transition_tlb_flush(struct kvm_vcpu *vcpu, · 453 unmodified lines
11561162 WARN_ON(!enable_vpid);
11571163
11581164 /*
1159− * If VPID is enabled and used by vmc12, but L2 does not have a unique
1160− * TLB tag (ASID), i.e. EPT is disabled and KVM was unable to allocate
1161− * a VPID for L2, flush the current context as the effective ASID is
1162− * common to both L1 and L2.
1163− *
1164− * Defer the flush so that it runs after vmcs02.EPTP has been set by
1165− * KVM_REQ_LOAD_MMU_PGD (if nested EPT is enabled) and to avoid
1166− * redundant flushes further down the nested pipeline.
1167− *
1168− * If a TLB flush isn't required due to any of the above, and vpid12 is
1169− * changing then the new "virtual" VPID (vpid12) will reuse the same
1170− * "real" VPID (vpid02), and so needs to be flushed. There's no direct
1171− * mapping between vpid02 and vpid12, vpid02 is per-vCPU and reused for
1172− * all nested vCPUs. Remember, a flush on VM-Enter does not invalidate
1173− * guest-physical mappings, so there is no need to sync the nEPT MMU.
1165+ * VPID is enabled and in use by vmcs12. If vpid12 is changing, then
1166+ * emulate a guest TLB flush as KVM does not track vpid12 history nor
1167+ * is the VPID incorporated into the MMU context. I.e. KVM must assume
1168+ * that the new vpid12 has never been used and thus represents a new
1169+ * guest ASID that cannot have entries in the TLB.
11741170 */
1175− if (!nested_has_guest_tlb_tag(vcpu)) {
1176− kvm_make_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu);
1177− } else if (is_vmenter &&
1178− vmcs12->virtual_processor_id != vmx->nested.last_vpid) {
1171+ if (is_vmenter && vmcs12->virtual_processor_id != vmx->nested.last_vpid) {
11791172 vmx->nested.last_vpid = vmcs12->virtual_processor_id;
1180− vpid_sync_context(nested_get_vpid02(vcpu));
1173+ kvm_make_request(KVM_REQ_TLB_FLUSH_GUEST, vcpu);
1174+ return;
11811175 }
1176+
1177+ /*
1178+ * If VPID is enabled, used by vmc12, and vpid12 is not changing but
1179+ * does not have a unique TLB tag (ASID), i.e. EPT is disabled and
1180+ * KVM was unable to allocate a VPID for L2, flush the current context
1181+ * as the effective ASID is common to both L1 and L2.
1182+ */
1183+ if (!nested_has_guest_tlb_tag(vcpu))
1184+ kvm_make_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu);
11821185 }
11831186
11841187 static bool is_bitwise_subset(u64 superset, u64 subset, u64 mask)
@@ -2588,8 +2591,10 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, · 1403 unmodified lines
25882591
25892592 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL) &&
25902593 WARN_ON_ONCE(kvm_set_msr(vcpu, MSR_CORE_PERF_GLOBAL_CTRL,
2591− vmcs12->guest_ia32_perf_global_ctrl)))
2594+ vmcs12->guest_ia32_perf_global_ctrl))) {
2595+ *entry_failure_code = ENTRY_FAIL_DEFAULT;
25922596 return -EINVAL;
2597+ }
25932598
25942599 kvm_rsp_write(vcpu, vmcs12->guest_rsp);
25952600 kvm_rip_write(vcpu, vmcs12->guest_rip);
@@ -2830,6 +2835,17 @@ static int nested_vmx_check_controls(struct kvm_vcpu *vcpu, · 234 unmodified lines
28302835 return 0;
28312836 }
28322837
2838+static int nested_vmx_check_address_space_size(struct kvm_vcpu *vcpu,
2839+ struct vmcs12 *vmcs12)
2840+{
2841+#ifdef CONFIG_X86_64
2842+ if (CC(!!(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) !=
2843+ !!(vcpu->arch.efer & EFER_LMA)))
2844+ return -EINVAL;
2845+#endif
2846+ return 0;
2847+}
2848+
28332849 static int nested_vmx_check_host_state(struct kvm_vcpu *vcpu,
28342850 struct vmcs12 *vmcs12)
28352851 {
@@ -2854,18 +2870,16 @@ static int nested_vmx_check_host_state(struct kvm_vcpu *vcpu, · 18 unmodified lines
28542870 return -EINVAL;
28552871
28562872 #ifdef CONFIG_X86_64
2857− ia32e = !!(vcpu->arch.efer & EFER_LMA);
2873+ ia32e = !!(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE);
28582874 #else
28592875 ia32e = false;
28602876 #endif
28612877
28622878 if (ia32e) {
2863− if (CC(!(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE)) ||
2864− CC(!(vmcs12->host_cr4 & X86_CR4_PAE)))
2879+ if (CC(!(vmcs12->host_cr4 & X86_CR4_PAE)))
28652880 return -EINVAL;
28662881 } else {
2867− if (CC(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) ||
2868− CC(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) ||
2882+ if (CC(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) ||
28692883 CC(vmcs12->host_cr4 & X86_CR4_PCIDE) ||
28702884 CC((vmcs12->host_rip) >> 32))
28712885 return -EINVAL;
@@ -2910,9 +2924,9 @@ static int nested_vmx_check_host_state(struct kvm_vcpu *vcpu, · 38 unmodified lines
29102924 static int nested_vmx_check_vmcs_link_ptr(struct kvm_vcpu *vcpu,
29112925 struct vmcs12 *vmcs12)
29122926 {
2913− int r = 0;
2914− struct vmcs12 *shadow;
2915− struct kvm_host_map map;
2927+ struct vcpu_vmx *vmx = to_vmx(vcpu);
2928+ struct gfn_to_hva_cache *ghc = &vmx->nested.shadow_vmcs12_cache;
2929+ struct vmcs_hdr hdr;
29162930
29172931 if (vmcs12->vmcs_link_pointer == INVALID_GPA)
29182932 return 0;
@@ -2920,17 +2934,21 @@ static int nested_vmx_check_vmcs_link_ptr(struct kvm_vcpu *vcpu, · 1 unmodified line
29202934 if (CC(!page_address_valid(vcpu, vmcs12->vmcs_link_pointer)))
29212935 return -EINVAL;
29222936
2923− if (CC(kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->vmcs_link_pointer), &map)))
2924− return -EINVAL;
2937+ if (ghc->gpa != vmcs12->vmcs_link_pointer &&
2938+ CC(kvm_gfn_to_hva_cache_init(vcpu->kvm, ghc,
2939+ vmcs12->vmcs_link_pointer, VMCS12_SIZE)))
2940+ return -EINVAL;
29252941
2926− shadow = map.hva;
2942+ if (CC(kvm_read_guest_offset_cached(vcpu->kvm, ghc, &hdr,
2943+ offsetof(struct vmcs12, hdr),
2944+ sizeof(hdr))))
2945+ return -EINVAL;
29272946
2928− if (CC(shadow->hdr.revision_id != VMCS12_REVISION) ||
2929− CC(shadow->hdr.shadow_vmcs != nested_cpu_has_shadow_vmcs(vmcs12)))
2930− r = -EINVAL;
2947+ if (CC(hdr.revision_id != VMCS12_REVISION) ||
2948+ CC(hdr.shadow_vmcs != nested_cpu_has_shadow_vmcs(vmcs12)))
2949+ return -EINVAL;
29312950
2932− kvm_vcpu_unmap(vcpu, &map, false);
2933− return r;
2951+ return 0;
29342952 }
29352953
29362954 /*
@@ -3325,8 +3343,7 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, · 388 unmodified lines
33253343 };
33263344 u32 failed_index;
33273345
3328− if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
3329− kvm_vcpu_flush_tlb_current(vcpu);
3346+ kvm_service_local_tlb_flush_requests(vcpu);
33303347
33313348 evaluate_pending_interrupts = exec_controls_get(vmx) &
33323349 (CPU_BASED_INTR_WINDOW_EXITING | CPU_BASED_NMI_WINDOW_EXITING);
@@ -3535,6 +3552,9 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) · 202 unmodified lines
35353552 if (nested_vmx_check_controls(vcpu, vmcs12))
35363553 return nested_vmx_fail(vcpu, VMXERR_ENTRY_INVALID_CONTROL_FIELD);
35373554
3555+ if (nested_vmx_check_address_space_size(vcpu, vmcs12))
3556+ return nested_vmx_fail(vcpu, VMXERR_ENTRY_INVALID_HOST_STATE_FIELD);
3557+
35383558 if (nested_vmx_check_host_state(vcpu, vmcs12))
35393559 return nested_vmx_fail(vcpu, VMXERR_ENTRY_INVALID_HOST_STATE_FIELD);
35403560
@@ -4480,9 +4500,8 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, · 939 unmodified lines
44804500 (void)nested_get_evmcs_page(vcpu);
44814501 }
44824502
4483− /* Service the TLB flush request for L2 before switching to L1. */
4484− if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
4485− kvm_vcpu_flush_tlb_current(vcpu);
4503+ /* Service pending TLB flush requests for L2 before switching to L1. */
4504+ kvm_service_local_tlb_flush_requests(vcpu);
44864505
44874506 /*
44884507 * VCPU_EXREG_PDPTR will be clobbered in arch/x86/kvm/vmx/vmx.h between
@@ -4835,6 +4854,7 @@ static int enter_vmx_operation(struct kvm_vcpu *vcpu) · 346 unmodified lines
48354854 if (!vmx->nested.cached_vmcs12)
48364855 goto out_cached_vmcs12;
48374856
4857+ vmx->nested.shadow_vmcs12_cache.gpa = INVALID_GPA;
48384858 vmx->nested.cached_shadow_vmcs12 = kzalloc(VMCS12_SIZE, GFP_KERNEL_ACCOUNT);
48394859 if (!vmx->nested.cached_shadow_vmcs12)
48404860 goto out_cached_shadow_vmcs12;
@@ -5264,10 +5284,10 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu) · 423 unmodified lines
52645284 return 1;
52655285
52665286 if (vmx->nested.current_vmptr != vmptr) {
5267− struct kvm_host_map map;
5268− struct vmcs12 *new_vmcs12;
5287+ struct gfn_to_hva_cache *ghc = &vmx->nested.vmcs12_cache;
5288+ struct vmcs_hdr hdr;
52695289
5270− if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmptr), &map)) {
5290+ if (kvm_gfn_to_hva_cache_init(vcpu->kvm, ghc, vmptr, VMCS12_SIZE)) {
52715291 /*
52725292 * Reads from an unbacked page return all 1s,
52735293 * which means that the 32 bits located at the
@@ -5278,12 +5298,16 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu) · 4 unmodified lines
52785298 VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
52795299 }
52805300
5281− new_vmcs12 = map.hva;
5301+ if (kvm_read_guest_offset_cached(vcpu->kvm, ghc, &hdr,
5302+ offsetof(struct vmcs12, hdr),
5303+ sizeof(hdr))) {
5304+ return nested_vmx_fail(vcpu,
5305+ VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
5306+ }
52825307
5283− if (new_vmcs12->hdr.revision_id != VMCS12_REVISION ||
5284− (new_vmcs12->hdr.shadow_vmcs &&
5308+ if (hdr.revision_id != VMCS12_REVISION ||
5309+ (hdr.shadow_vmcs &&
52855310 !nested_cpu_has_vmx_shadow_vmcs(vcpu))) {
5286− kvm_vcpu_unmap(vcpu, &map, false);
52875311 return nested_vmx_fail(vcpu,
52885312 VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
52895313 }
@@ -5294,8 +5318,11 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu) · 4 unmodified lines
52945318 * Load VMCS12 from guest memory since it is not already
52955319 * cached.
52965320 */
5297− memcpy(vmx->nested.cached_vmcs12, new_vmcs12, VMCS12_SIZE);
5298− kvm_vcpu_unmap(vcpu, &map, false);
5321+ if (kvm_read_guest_cached(vcpu->kvm, ghc, vmx->nested.cached_vmcs12,
5322+ VMCS12_SIZE)) {
5323+ return nested_vmx_fail(vcpu,
5324+ VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
5325+ }
52995326
53005327 set_current_vmptr(vmx, vmptr);
53015328 }
arch/x86/kvm/vmx/posted_intr.c+11−9
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #include <asm/cpu.h>
66
77 #include "lapic.h"
8+#include "irq.h"
89 #include "posted_intr.h"
910 #include "trace.h"
1011 #include "vmx.h"
@@ -77,13 +78,18 @@ after_clear_sn: · 66 unmodified lines
7778 pi_set_on(pi_desc);
7879 }
7980
81+static bool vmx_can_use_vtd_pi(struct kvm *kvm)
82+{
83+ return irqchip_in_kernel(kvm) && enable_apicv &&
84+ kvm_arch_has_assigned_device(kvm) &&
85+ irq_remapping_cap(IRQ_POSTING_CAP);
86+}
87+
8088 void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu)
8189 {
8290 struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);
8391
84− if (!kvm_arch_has_assigned_device(vcpu->kvm) ||
85− !irq_remapping_cap(IRQ_POSTING_CAP) ||
86− !kvm_vcpu_apicv_active(vcpu))
92+ if (!vmx_can_use_vtd_pi(vcpu->kvm))
8793 return;
8894
8995 /* Set SN when the vCPU is preempted */
@@ -141,9 +147,7 @@ int pi_pre_block(struct kvm_vcpu *vcpu) · 51 unmodified lines
141147 struct pi_desc old, new;
142148 struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);
143149
144− if (!kvm_arch_has_assigned_device(vcpu->kvm) ||
145− !irq_remapping_cap(IRQ_POSTING_CAP) ||
146− !kvm_vcpu_apicv_active(vcpu))
150+ if (!vmx_can_use_vtd_pi(vcpu->kvm))
147151 return 0;
148152
149153 WARN_ON(irqs_disabled());
@@ -270,9 +274,7 @@ int pi_update_irte(struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq, · 120 unmodified lines
270274 struct vcpu_data vcpu_info;
271275 int idx, ret = 0;
272276
273− if (!kvm_arch_has_assigned_device(kvm) ||
274− !irq_remapping_cap(IRQ_POSTING_CAP) ||
275− !kvm_vcpu_apicv_active(kvm->vcpus[0]))
277+ if (!vmx_can_use_vtd_pi(kvm))
276278 return 0;
277279
278280 idx = srcu_read_lock(&kvm->irq_srcu);
arch/x86/kvm/vmx/vmx.c+55−34
@@ -2646,15 +2646,6 @@ int alloc_loaded_vmcs(struct loaded_vmcs *loaded_vmcs) · 2645 unmodified lines
26462646 if (!loaded_vmcs->msr_bitmap)
26472647 goto out_vmcs;
26482648 memset(loaded_vmcs->msr_bitmap, 0xff, PAGE_SIZE);
2649−
2650− if (IS_ENABLED(CONFIG_HYPERV) &&
2651− static_branch_unlikely(&enable_evmcs) &&
2652− (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {
2653− struct hv_enlightened_vmcs *evmcs =
2654− (struct hv_enlightened_vmcs *)loaded_vmcs->vmcs;
2655−
2656− evmcs->hv_enlightenments_control.msr_bitmap = 1;
2657− }
26582649 }
26592650
26602651 memset(&loaded_vmcs->host_state, 0, sizeof(struct vmcs_host_state));
@@ -2918,6 +2909,13 @@ static void vmx_flush_tlb_all(struct kvm_vcpu *vcpu) · 257 unmodified lines
29182909 }
29192910 }
29202911
2912+static inline int vmx_get_current_vpid(struct kvm_vcpu *vcpu)
2913+{
2914+ if (is_guest_mode(vcpu))
2915+ return nested_get_vpid02(vcpu);
2916+ return to_vmx(vcpu)->vpid;
2917+}
2918+
29212919 static void vmx_flush_tlb_current(struct kvm_vcpu *vcpu)
29222920 {
29232921 struct kvm_mmu *mmu = vcpu->arch.mmu;
@@ -2930,31 +2928,29 @@ static void vmx_flush_tlb_current(struct kvm_vcpu *vcpu) · 6 unmodified lines
29302928 if (enable_ept)
29312929 ept_sync_context(construct_eptp(vcpu, root_hpa,
29322930 mmu->shadow_root_level));
2933− else if (!is_guest_mode(vcpu))
2934− vpid_sync_context(to_vmx(vcpu)->vpid);
29352931 else
2936− vpid_sync_context(nested_get_vpid02(vcpu));
2932+ vpid_sync_context(vmx_get_current_vpid(vcpu));
29372933 }
29382934
29392935 static void vmx_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t addr)
29402936 {
29412937 /*
2942− * vpid_sync_vcpu_addr() is a nop if vmx->vpid==0, see the comment in
2938+ * vpid_sync_vcpu_addr() is a nop if vpid==0, see the comment in
29432939 * vmx_flush_tlb_guest() for an explanation of why this is ok.
29442940 */
2945− vpid_sync_vcpu_addr(to_vmx(vcpu)->vpid, addr);
2941+ vpid_sync_vcpu_addr(vmx_get_current_vpid(vcpu), addr);
29462942 }
29472943
29482944 static void vmx_flush_tlb_guest(struct kvm_vcpu *vcpu)
29492945 {
29502946 /*
2951− * vpid_sync_context() is a nop if vmx->vpid==0, e.g. if enable_vpid==0
2952− * or a vpid couldn't be allocated for this vCPU. VM-Enter and VM-Exit
2953− * are required to flush GVA->{G,H}PA mappings from the TLB if vpid is
2947+ * vpid_sync_context() is a nop if vpid==0, e.g. if enable_vpid==0 or a
2948+ * vpid couldn't be allocated for this vCPU. VM-Enter and VM-Exit are
2949+ * required to flush GVA->{G,H}PA mappings from the TLB if vpid is
29542950 * disabled (VM-Enter with vpid enabled and vpid==0 is disallowed),
29552951 * i.e. no explicit INVVPID is necessary.
29562952 */
2957− vpid_sync_context(to_vmx(vcpu)->vpid);
2953+ vpid_sync_context(vmx_get_current_vpid(vcpu));
29582954 }
29592955
29602956 void vmx_ept_load_pdptrs(struct kvm_vcpu *vcpu)
@@ -6262,9 +6258,9 @@ static int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu) · 3301 unmodified lines
62626258 {
62636259 struct vcpu_vmx *vmx = to_vmx(vcpu);
62646260 int max_irr;
6265− bool max_irr_updated;
6261+ bool got_posted_interrupt;
62666262
6267− if (KVM_BUG_ON(!vcpu->arch.apicv_active, vcpu->kvm))
6263+ if (KVM_BUG_ON(!enable_apicv, vcpu->kvm))
62686264 return -EIO;
62696265
62706266 if (pi_test_on(&vmx->pi_desc)) {
@@ -6274,22 +6270,33 @@ static int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu) · 3 unmodified lines
62746270 * But on x86 this is just a compiler barrier anyway.
62756271 */
62766272 smp_mb__after_atomic();
6277− max_irr_updated =
6273+ got_posted_interrupt =
62786274 kvm_apic_update_irr(vcpu, vmx->pi_desc.pir, &max_irr);
6279−
6280− /*
6281− * If we are running L2 and L1 has a new pending interrupt
6282− * which can be injected, this may cause a vmexit or it may
6283− * be injected into L2. Either way, this interrupt will be
6284− * processed via KVM_REQ_EVENT, not RVI, because we do not use
6285− * virtual interrupt delivery to inject L1 interrupts into L2.
6286− */
6287− if (is_guest_mode(vcpu) && max_irr_updated)
6288− kvm_make_request(KVM_REQ_EVENT, vcpu);
62896275 } else {
62906276 max_irr = kvm_lapic_find_highest_irr(vcpu);
6277+ got_posted_interrupt = false;
62916278 }
6292− vmx_hwapic_irr_update(vcpu, max_irr);
6279+
6280+ /*
6281+ * Newly recognized interrupts are injected via either virtual interrupt
6282+ * delivery (RVI) or KVM_REQ_EVENT. Virtual interrupt delivery is
6283+ * disabled in two cases:
6284+ *
6285+ * 1) If L2 is running and the vCPU has a new pending interrupt. If L1
6286+ * wants to exit on interrupts, KVM_REQ_EVENT is needed to synthesize a
6287+ * VM-Exit to L1. If L1 doesn't want to exit, the interrupt is injected
6288+ * into L2, but KVM doesn't use virtual interrupt delivery to inject
6289+ * interrupts into L2, and so KVM_REQ_EVENT is again needed.
6290+ *
6291+ * 2) If APICv is disabled for this vCPU, assigned devices may still
6292+ * attempt to post interrupts. The posted interrupt vector will cause
6293+ * a VM-Exit and the subsequent entry will call sync_pir_to_irr.
6294+ */
6295+ if (!is_guest_mode(vcpu) && kvm_vcpu_apicv_active(vcpu))
6296+ vmx_set_rvi(max_irr);
6297+ else if (got_posted_interrupt)
6298+ kvm_make_request(KVM_REQ_EVENT, vcpu);
6299+
62936300 return max_irr;
62946301 }
62956302
@@ -6826,6 +6833,19 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 530 unmodified lines
68266833 if (err < 0)
68276834 goto free_pml;
68286835
6836+ /*
6837+ * Use Hyper-V 'Enlightened MSR Bitmap' feature when KVM runs as a
6838+ * nested (L1) hypervisor and Hyper-V in L0 supports it. Enable the
6839+ * feature only for vmcs01, KVM currently isn't equipped to realize any
6840+ * performance benefits from enabling it for vmcs02.
6841+ */
6842+ if (IS_ENABLED(CONFIG_HYPERV) && static_branch_unlikely(&enable_evmcs) &&
6843+ (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {
6844+ struct hv_enlightened_vmcs *evmcs = (void *)vmx->vmcs01.vmcs;
6845+
6846+ evmcs->hv_enlightenments_control.msr_bitmap = 1;
6847+ }
6848+
68296849 /* The MSR bitmap starts with all ones */
68306850 bitmap_fill(vmx->shadow_msr_intercept.read, MAX_POSSIBLE_PASSTHROUGH_MSRS);
68316851 bitmap_fill(vmx->shadow_msr_intercept.write, MAX_POSSIBLE_PASSTHROUGH_MSRS);
@@ -7509,6 +7529,7 @@ static void hardware_unsetup(void) · 677 unmodified lines
75097529 static bool vmx_check_apicv_inhibit_reasons(ulong bit)
75107530 {
75117531 ulong supported = BIT(APICV_INHIBIT_REASON_DISABLE) |
7532+ BIT(APICV_INHIBIT_REASON_ABSENT) |
75127533 BIT(APICV_INHIBIT_REASON_HYPERV) |
75137534 BIT(APICV_INHIBIT_REASON_BLOCKIRQ);
75147535
@@ -7761,10 +7782,10 @@ static __init int hardware_setup(void) · 246 unmodified lines
77617782 ple_window_shrink = 0;
77627783 }
77637784
7764− if (!cpu_has_vmx_apicv()) {
7785+ if (!cpu_has_vmx_apicv())
77657786 enable_apicv = 0;
7787+ if (!enable_apicv)
77667788 vmx_x86_ops.sync_pir_to_irr = NULL;
7767− }
77687789
77697790 if (cpu_has_vmx_tsc_scaling()) {
77707791 kvm_has_tsc_control = true;
arch/x86/kvm/vmx/vmx.h+10−0
@@ -141,6 +141,16 @@ struct nested_vmx { · 140 unmodified lines
141141 */
142142 struct vmcs12 *cached_shadow_vmcs12;
143143
144+ /*
145+ * GPA to HVA cache for accessing vmcs12->vmcs_link_pointer
146+ */
147+ struct gfn_to_hva_cache shadow_vmcs12_cache;
148+
149+ /*
150+ * GPA to HVA cache for VMCS12
151+ */
152+ struct gfn_to_hva_cache vmcs12_cache;
153+
144154 /*
145155 * Indicates if the shadow vmcs or enlightened vmcs must be updated
146156 * with the data held by struct vmcs12.
arch/x86/kvm/x86.c+78−27
@@ -890,7 +890,8 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 889 unmodified lines
890890 !load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu)))
891891 return 1;
892892
893− if (!(cr0 & X86_CR0_PG) && kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE))
893+ if (!(cr0 & X86_CR0_PG) &&
894+ (is_64_bit_mode(vcpu) || kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE)))
894895 return 1;
895896
896897 static_call(kvm_x86_set_cr0)(vcpu, cr0);
@@ -3258,6 +3259,29 @@ static void kvm_vcpu_flush_tlb_guest(struct kvm_vcpu *vcpu) · 2361 unmodified lines
32583259 static_call(kvm_x86_tlb_flush_guest)(vcpu);
32593260 }
32603261
3262+
3263+static inline void kvm_vcpu_flush_tlb_current(struct kvm_vcpu *vcpu)
3264+{
3265+ ++vcpu->stat.tlb_flush;
3266+ static_call(kvm_x86_tlb_flush_current)(vcpu);
3267+}
3268+
3269+/*
3270+ * Service "local" TLB flush requests, which are specific to the current MMU
3271+ * context. In addition to the generic event handling in vcpu_enter_guest(),
3272+ * TLB flushes that are targeted at an MMU context also need to be serviced
3273+ * prior before nested VM-Enter/VM-Exit.
3274+ */
3275+void kvm_service_local_tlb_flush_requests(struct kvm_vcpu *vcpu)
3276+{
3277+ if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
3278+ kvm_vcpu_flush_tlb_current(vcpu);
3279+
3280+ if (kvm_check_request(KVM_REQ_TLB_FLUSH_GUEST, vcpu))
3281+ kvm_vcpu_flush_tlb_guest(vcpu);
3282+}
3283+EXPORT_SYMBOL_GPL(kvm_service_local_tlb_flush_requests);
3284+
32613285 static void record_steal_time(struct kvm_vcpu *vcpu)
32623286 {
32633287 struct gfn_to_hva_cache *ghc = &vcpu->arch.st.cache;
@@ -3307,9 +3331,9 @@ static void record_steal_time(struct kvm_vcpu *vcpu) · 43 unmodified lines
33073331 "xor %1, %1\n"
33083332 "2:\n"
33093333 _ASM_EXTABLE_UA(1b, 2b)
3310− : "+r" (st_preempted),
3311− "+&r" (err)
3312− : "m" (st->preempted));
3334+ : "+q" (st_preempted),
3335+ "+&r" (err),
3336+ "+m" (st->preempted));
33133337 if (err)
33143338 goto out;
33153339
@@ -4133,6 +4157,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 817 unmodified lines
41334157 case KVM_CAP_SGX_ATTRIBUTE:
41344158 #endif
41354159 case KVM_CAP_VM_COPY_ENC_CONTEXT_FROM:
4160+ case KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM:
41364161 case KVM_CAP_SREGS2:
41374162 case KVM_CAP_EXIT_ON_EMULATION_FAILURE:
41384163 case KVM_CAP_VCPU_ATTRIBUTES:
@@ -4179,7 +4204,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 40 unmodified lines
41794204 r = !static_call(kvm_x86_cpu_has_accelerated_tpr)();
41804205 break;
41814206 case KVM_CAP_NR_VCPUS:
4182− r = num_online_cpus();
4207+ r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
41834208 break;
41844209 case KVM_CAP_MAX_VCPUS:
41854210 r = KVM_MAX_VCPUS;
@@ -4448,8 +4473,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) · 262 unmodified lines
44484473 static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu,
44494474 struct kvm_lapic_state *s)
44504475 {
4451− if (vcpu->arch.apicv_active)
4452− static_call(kvm_x86_sync_pir_to_irr)(vcpu);
4476+ static_call_cond(kvm_x86_sync_pir_to_irr)(vcpu);
44534477
44544478 return kvm_apic_get_state(vcpu, s);
44554479 }
@@ -5124,6 +5148,17 @@ long kvm_arch_vcpu_ioctl(struct file *filp, · 668 unmodified lines
51245148 struct kvm_cpuid __user *cpuid_arg = argp;
51255149 struct kvm_cpuid cpuid;
51265150
5151+ /*
5152+ * KVM does not correctly handle changing guest CPUID after KVM_RUN, as
5153+ * MAXPHYADDR, GBPAGES support, AMD reserved bit behavior, etc.. aren't
5154+ * tracked in kvm_mmu_page_role. As a result, KVM may miss guest page
5155+ * faults due to reusing SPs/SPTEs. In practice no sane VMM mucks with
5156+ * the core vCPU model on the fly, so fail.
5157+ */
5158+ r = -EINVAL;
5159+ if (vcpu->arch.last_vmentry_cpu != -1)
5160+ goto out;
5161+
51275162 r = -EFAULT;
51285163 if (copy_from_user(&cpuid, cpuid_arg, sizeof(cpuid)))
51295164 goto out;
@@ -5134,6 +5169,14 @@ long kvm_arch_vcpu_ioctl(struct file *filp, · 4 unmodified lines
51345169 struct kvm_cpuid2 __user *cpuid_arg = argp;
51355170 struct kvm_cpuid2 cpuid;
51365171
5172+ /*
5173+ * KVM_SET_CPUID{,2} after KVM_RUN is forbidded, see the comment in
5174+ * KVM_SET_CPUID case above.
5175+ */
5176+ r = -EINVAL;
5177+ if (vcpu->arch.last_vmentry_cpu != -1)
5178+ goto out;
5179+
51375180 r = -EFAULT;
51385181 if (copy_from_user(&cpuid, cpuid_arg, sizeof(cpuid)))
51395182 goto out;
@@ -5698,6 +5741,7 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, · 558 unmodified lines
56985741 smp_wmb();
56995742 kvm->arch.irqchip_mode = KVM_IRQCHIP_SPLIT;
57005743 kvm->arch.nr_reserved_ioapic_pins = cap->args[0];
5744+ kvm_request_apicv_update(kvm, true, APICV_INHIBIT_REASON_ABSENT);
57015745 r = 0;
57025746 split_irqchip_unlock:
57035747 mutex_unlock(&kvm->lock);
@@ -6078,6 +6122,7 @@ set_identity_unlock: · 374 unmodified lines
60786122 /* Write kvm->irq_routing before enabling irqchip_in_kernel. */
60796123 smp_wmb();
60806124 kvm->arch.irqchip_mode = KVM_IRQCHIP_KERNEL;
6125+ kvm_request_apicv_update(kvm, true, APICV_INHIBIT_REASON_ABSENT);
60816126 create_irqchip_unlock:
60826127 mutex_unlock(&kvm->lock);
60836128 break;
@@ -7077,7 +7122,13 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size, · 993 unmodified lines
70777122 unsigned short port, void *val, unsigned int count)
70787123 {
70797124 if (vcpu->arch.pio.count) {
7080− /* Complete previous iteration. */
7125+ /*
7126+ * Complete a previous iteration that required userspace I/O.
7127+ * Note, @count isn't guaranteed to match pio.count as userspace
7128+ * can modify ECX before rerunning the vCPU. Ignore any such
7129+ * shenanigans as KVM doesn't support modifying the rep count,
7130+ * and the emulator ensures @count doesn't overflow the buffer.
7131+ */
70817132 } else {
70827133 int r = __emulator_pio_in(vcpu, size, port, count);
70837134 if (!r)
@@ -7086,7 +7137,6 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size, · 2 unmodified lines
70867137 /* Results already available, fall through. */
70877138 }
70887139
7089− WARN_ON(count != vcpu->arch.pio.count);
70907140 complete_emulator_pio_in(vcpu, val);
70917141 return 1;
70927142 }
@@ -8776,10 +8826,9 @@ static void kvm_apicv_init(struct kvm *kvm) · 1683 unmodified lines
87768826 {
87778827 init_rwsem(&kvm->arch.apicv_update_lock);
87788828
8779− if (enable_apicv)
8780− clear_bit(APICV_INHIBIT_REASON_DISABLE,
8781− &kvm->arch.apicv_inhibit_reasons);
8782− else
8829+ set_bit(APICV_INHIBIT_REASON_ABSENT,
8830+ &kvm->arch.apicv_inhibit_reasons);
8831+ if (!enable_apicv)
87838832 set_bit(APICV_INHIBIT_REASON_DISABLE,
87848833 &kvm->arch.apicv_inhibit_reasons);
87858834 }
@@ -8848,7 +8897,7 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) · 62 unmodified lines
88488897
88498898 trace_kvm_hypercall(nr, a0, a1, a2, a3);
88508899
8851− op_64_bit = is_64_bit_mode(vcpu);
8900+ op_64_bit = is_64_bit_hypercall(vcpu);
88528901 if (!op_64_bit) {
88538902 nr &= 0xFFFFFFFF;
88548903 a0 &= 0xFFFFFFFF;
@@ -9528,8 +9577,7 @@ static void vcpu_scan_ioapic(struct kvm_vcpu *vcpu) · 673 unmodified lines
95289577 if (irqchip_split(vcpu->kvm))
95299578 kvm_scan_ioapic_routes(vcpu, vcpu->arch.ioapic_handled_vectors);
95309579 else {
9531− if (vcpu->arch.apicv_active)
9532− static_call(kvm_x86_sync_pir_to_irr)(vcpu);
9580+ static_call_cond(kvm_x86_sync_pir_to_irr)(vcpu);
95339581 if (ioapic_in_kernel(vcpu->kvm))
95349582 kvm_ioapic_scan_entry(vcpu, vcpu->arch.ioapic_handled_vectors);
95359583 }
@@ -9547,12 +9595,16 @@ static void vcpu_load_eoi_exitmap(struct kvm_vcpu *vcpu) · 11 unmodified lines
95479595 if (!kvm_apic_hw_enabled(vcpu->arch.apic))
95489596 return;
95499597
9550− if (to_hv_vcpu(vcpu))
9598+ if (to_hv_vcpu(vcpu)) {
95519599 bitmap_or((ulong *)eoi_exit_bitmap,
95529600 vcpu->arch.ioapic_handled_vectors,
95539601 to_hv_synic(vcpu)->vec_bitmap, 256);
9602+ static_call(kvm_x86_load_eoi_exitmap)(vcpu, eoi_exit_bitmap);
9603+ return;
9604+ }
95549605
9555− static_call(kvm_x86_load_eoi_exitmap)(vcpu, eoi_exit_bitmap);
9606+ static_call(kvm_x86_load_eoi_exitmap)(
9607+ vcpu, (u64 *)vcpu->arch.ioapic_handled_vectors);
95569608 }
95579609
95589610 void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
@@ -9644,10 +9696,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 85 unmodified lines
96449696 /* Flushing all ASIDs flushes the current ASID... */
96459697 kvm_clear_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu);
96469698 }
9647− if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
9648− kvm_vcpu_flush_tlb_current(vcpu);
9649− if (kvm_check_request(KVM_REQ_TLB_FLUSH_GUEST, vcpu))
9650− kvm_vcpu_flush_tlb_guest(vcpu);
9699+ kvm_service_local_tlb_flush_requests(vcpu);
96519700
96529701 if (kvm_check_request(KVM_REQ_REPORT_TPR_ACCESS, vcpu)) {
96539702 vcpu->run->exit_reason = KVM_EXIT_TPR_ACCESS;
@@ -9798,10 +9847,12 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 144 unmodified lines
97989847
97999848 /*
98009849 * This handles the case where a posted interrupt was
9801− * notified with kvm_vcpu_kick.
9850+ * notified with kvm_vcpu_kick. Assigned devices can
9851+ * use the POSTED_INTR_VECTOR even if APICv is disabled,
9852+ * so do it even if APICv is disabled on this vCPU.
98029853 */
9803− if (kvm_lapic_enabled(vcpu) && vcpu->arch.apicv_active)
9804− static_call(kvm_x86_sync_pir_to_irr)(vcpu);
9854+ if (kvm_lapic_enabled(vcpu))
9855+ static_call_cond(kvm_x86_sync_pir_to_irr)(vcpu);
98059856
98069857 if (kvm_vcpu_exit_request(vcpu)) {
98079858 vcpu->mode = OUTSIDE_GUEST_MODE;
@@ -9845,8 +9896,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 37 unmodified lines
98459896 if (likely(exit_fastpath != EXIT_FASTPATH_REENTER_GUEST))
98469897 break;
98479898
9848− if (vcpu->arch.apicv_active)
9849− static_call(kvm_x86_sync_pir_to_irr)(vcpu);
9899+ if (kvm_lapic_enabled(vcpu))
9900+ static_call_cond(kvm_x86_sync_pir_to_irr)(vcpu);
98509901
98519902 if (unlikely(kvm_vcpu_exit_request(vcpu))) {
98529903 exit_fastpath = EXIT_FASTPATH_EXIT_HANDLED;
arch/x86/kvm/x86.h+13−6
@@ -103,6 +103,7 @@ static inline unsigned int __shrink_ple_window(unsigned int val, · 102 unmodified lines
103103
104104 #define MSR_IA32_CR_PAT_DEFAULT 0x0007040600070406ULL
105105
106+void kvm_service_local_tlb_flush_requests(struct kvm_vcpu *vcpu);
106107 int kvm_check_nested_events(struct kvm_vcpu *vcpu);
107108
108109 static inline void kvm_clear_exception_queue(struct kvm_vcpu *vcpu)
@@ -153,12 +154,24 @@ static inline bool is_64_bit_mode(struct kvm_vcpu *vcpu) · 44 unmodified lines
153154 {
154155 int cs_db, cs_l;
155156
157+ WARN_ON_ONCE(vcpu->arch.guest_state_protected);
158+
156159 if (!is_long_mode(vcpu))
157160 return false;
158161 static_call(kvm_x86_get_cs_db_l_bits)(vcpu, &cs_db, &cs_l);
159162 return cs_l;
160163 }
161164
165+static inline bool is_64_bit_hypercall(struct kvm_vcpu *vcpu)
166+{
167+ /*
168+ * If running with protected guest state, the CS register is not
169+ * accessible. The hypercall register values will have had to been
170+ * provided in 64-bit mode, so assume the guest is in 64-bit.
171+ */
172+ return vcpu->arch.guest_state_protected || is_64_bit_mode(vcpu);
173+}
174+
162175 static inline bool x86_exception_has_error_code(unsigned int vector)
163176 {
164177 static u32 exception_has_error_code = BIT(DF_VECTOR) | BIT(TS_VECTOR) |
@@ -173,12 +186,6 @@ static inline bool mmu_is_nested(struct kvm_vcpu *vcpu) · 8 unmodified lines
173186 return vcpu->arch.walk_mmu == &vcpu->arch.nested_mmu;
174187 }
175188
176−static inline void kvm_vcpu_flush_tlb_current(struct kvm_vcpu *vcpu)
177−{
178− ++vcpu->stat.tlb_flush;
179− static_call(kvm_x86_tlb_flush_current)(vcpu);
180−}
181−
182189 static inline int is_pae(struct kvm_vcpu *vcpu)
183190 {
184191 return kvm_read_cr4_bits(vcpu, X86_CR4_PAE);
arch/x86/kvm/xen.c+11−11
@@ -127,9 +127,9 @@ void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state) · 126 unmodified lines
127127 state_entry_time = vx->runstate_entry_time;
128128 state_entry_time |= XEN_RUNSTATE_UPDATE;
129129
130− BUILD_BUG_ON(sizeof(((struct vcpu_runstate_info *)0)->state_entry_time) !=
130+ BUILD_BUG_ON(sizeof_field(struct vcpu_runstate_info, state_entry_time) !=
131131 sizeof(state_entry_time));
132− BUILD_BUG_ON(sizeof(((struct compat_vcpu_runstate_info *)0)->state_entry_time) !=
132+ BUILD_BUG_ON(sizeof_field(struct compat_vcpu_runstate_info, state_entry_time) !=
133133 sizeof(state_entry_time));
134134
135135 if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
@@ -144,9 +144,9 @@ void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state) · 8 unmodified lines
144144 */
145145 BUILD_BUG_ON(offsetof(struct vcpu_runstate_info, state) !=
146146 offsetof(struct compat_vcpu_runstate_info, state));
147− BUILD_BUG_ON(sizeof(((struct vcpu_runstate_info *)0)->state) !=
147+ BUILD_BUG_ON(sizeof_field(struct vcpu_runstate_info, state) !=
148148 sizeof(vx->current_runstate));
149− BUILD_BUG_ON(sizeof(((struct compat_vcpu_runstate_info *)0)->state) !=
149+ BUILD_BUG_ON(sizeof_field(struct compat_vcpu_runstate_info, state) !=
150150 sizeof(vx->current_runstate));
151151
152152 if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
@@ -163,9 +163,9 @@ void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state) · 10 unmodified lines
163163 offsetof(struct vcpu_runstate_info, time) - sizeof(u64));
164164 BUILD_BUG_ON(offsetof(struct compat_vcpu_runstate_info, state_entry_time) !=
165165 offsetof(struct compat_vcpu_runstate_info, time) - sizeof(u64));
166− BUILD_BUG_ON(sizeof(((struct vcpu_runstate_info *)0)->time) !=
167− sizeof(((struct compat_vcpu_runstate_info *)0)->time));
168− BUILD_BUG_ON(sizeof(((struct vcpu_runstate_info *)0)->time) !=
166+ BUILD_BUG_ON(sizeof_field(struct vcpu_runstate_info, time) !=
167+ sizeof_field(struct compat_vcpu_runstate_info, time));
168+ BUILD_BUG_ON(sizeof_field(struct vcpu_runstate_info, time) !=
169169 sizeof(vx->runstate_times));
170170
171171 if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
@@ -205,9 +205,9 @@ int __kvm_xen_has_interrupt(struct kvm_vcpu *v) · 33 unmodified lines
205205 BUILD_BUG_ON(offsetof(struct vcpu_info, evtchn_upcall_pending) !=
206206 offsetof(struct compat_vcpu_info, evtchn_upcall_pending));
207207 BUILD_BUG_ON(sizeof(rc) !=
208− sizeof(((struct vcpu_info *)0)->evtchn_upcall_pending));
208+ sizeof_field(struct vcpu_info, evtchn_upcall_pending));
209209 BUILD_BUG_ON(sizeof(rc) !=
210− sizeof(((struct compat_vcpu_info *)0)->evtchn_upcall_pending));
210+ sizeof_field(struct compat_vcpu_info, evtchn_upcall_pending));
211211
212212 /*
213213 * For efficiency, this mirrors the checks for using the valid
@@ -299,7 +299,7 @@ int kvm_xen_hvm_get_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data) · 85 unmodified lines
299299 break;
300300
301301 case KVM_XEN_ATTR_TYPE_SHARED_INFO:
302− data->u.shared_info.gfn = gpa_to_gfn(kvm->arch.xen.shinfo_gfn);
302+ data->u.shared_info.gfn = kvm->arch.xen.shinfo_gfn;
303303 r = 0;
304304 break;
305305
@@ -698,7 +698,7 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu) · 392 unmodified lines
698698 kvm_hv_hypercall_enabled(vcpu))
699699 return kvm_hv_hypercall(vcpu);
700700
701− longmode = is_64_bit_mode(vcpu);
701+ longmode = is_64_bit_hypercall(vcpu);
702702 if (!longmode) {
703703 params[0] = (u32)kvm_rbx_read(vcpu);
704704 params[1] = (u32)kvm_rcx_read(vcpu);
arch/x86/platform/efi/quirks.c+2−1
@@ -277,7 +277,8 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size) · 276 unmodified lines
277277 return;
278278 }
279279
280− new = early_memremap(data.phys_map, data.size);
280+ new = early_memremap_prot(data.phys_map, data.size,
281+ pgprot_val(pgprot_encrypted(FIXMAP_PAGE_NORMAL)));
281282 if (!new) {
282283 pr_err("Failed to map new boot services memmap\n");
283284 return;
arch/x86/realmode/init.c+11−1
@@ -72,6 +72,7 @@ static void __init setup_real_mode(void) · 71 unmodified lines
7272 #ifdef CONFIG_X86_64
7373 u64 *trampoline_pgd;
7474 u64 efer;
75+ int i;
7576 #endif
7677
7778 base = (unsigned char *)real_mode_header;
@@ -128,8 +129,17 @@ static void __init setup_real_mode(void) · 50 unmodified lines
128129 trampoline_header->flags = 0;
129130
130131 trampoline_pgd = (u64 *) __va(real_mode_header->trampoline_pgd);
132+
133+ /* Map the real mode stub as virtual == physical */
131134 trampoline_pgd[0] = trampoline_pgd_entry.pgd;
132− trampoline_pgd[511] = init_top_pgt[511].pgd;
135+
136+ /*
137+ * Include the entirety of the kernel mapping into the trampoline
138+ * PGD. This way, all mappings present in the normal kernel page
139+ * tables are usable while running on trampoline_pgd.
140+ */
141+ for (i = pgd_index(__PAGE_OFFSET); i < PTRS_PER_PGD; i++)
142+ trampoline_pgd[i] = init_top_pgt[i].pgd;
133143 #endif
134144
135145 sme_sev_setup_real_mode(trampoline_header);
arch/x86/xen/xen-asm.S+20−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #include <linux/init.h>
2222 #include <linux/linkage.h>
23+#include <../entry/calling.h>
2324
2425 .pushsection .noinstr.text, "ax"
2526 /*
@@ -192,6 +193,25 @@ SYM_CODE_START(xen_iret) · 166 unmodified lines
192193 jmp hypercall_iret
193194 SYM_CODE_END(xen_iret)
194195
196+/*
197+ * XEN pv doesn't use trampoline stack, PER_CPU_VAR(cpu_tss_rw + TSS_sp0) is
198+ * also the kernel stack. Reusing swapgs_restore_regs_and_return_to_usermode()
199+ * in XEN pv would cause %rsp to move up to the top of the kernel stack and
200+ * leave the IRET frame below %rsp, which is dangerous to be corrupted if #NMI
201+ * interrupts. And swapgs_restore_regs_and_return_to_usermode() pushing the IRET
202+ * frame at the same address is useless.
203+ */
204+SYM_CODE_START(xenpv_restore_regs_and_return_to_usermode)
205+ UNWIND_HINT_REGS
206+ POP_REGS
207+
208+ /* stackleak_erase() can work safely on the kernel stack. */
209+ STACKLEAK_ERASE_NOCLOBBER
210+
211+ addq $8, %rsp /* skip regs->orig_ax */
212+ jmp xen_iret
213+SYM_CODE_END(xenpv_restore_regs_and_return_to_usermode)
214+
195215 /*
196216 * Xen handles syscall callbacks much like ordinary exceptions, which
197217 * means we have:
arch/xtensa/include/asm/cacheflush.h+0−3
@@ -121,7 +121,6 @@ void flush_cache_page(struct vm_area_struct*, · 120 unmodified lines
121121
122122 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
123123 void flush_dcache_page(struct page *);
124−void flush_dcache_folio(struct folio *);
125124
126125 void local_flush_cache_range(struct vm_area_struct *vma,
127126 unsigned long start, unsigned long end);
@@ -138,9 +137,7 @@ void local_flush_cache_page(struct vm_area_struct *vma, · 10 unmodified lines
138137 #define flush_cache_vunmap(start,end) do { } while (0)
139138
140139 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
141−#define ARCH_IMPLEMENTS_FLUSH_DCACHE_FOLIO
142140 #define flush_dcache_page(page) do { } while (0)
143−static inline void flush_dcache_folio(struct folio *folio) { }
144141
145142 #define flush_icache_range local_flush_icache_range
146143 #define flush_cache_page(vma, addr, pfn) do { } while (0)
arch/xtensa/kernel/syscalls/syscall.tbl+1−0
@@ -419,3 +419,4 @@ · 418 unmodified lines
419419 446 common landlock_restrict_self sys_landlock_restrict_self
420420 # 447 reserved for memfd_secret
421421 448 common process_mrelease sys_process_mrelease
422+449 common futex_waitv sys_futex_waitv
block/bdev.c+7−5
@@ -753,8 +753,7 @@ struct block_device *blkdev_get_no_open(dev_t dev) · 752 unmodified lines
753753
754754 if (!bdev)
755755 return NULL;
756− if ((bdev->bd_disk->flags & GENHD_FL_HIDDEN) ||
757− !try_module_get(bdev->bd_disk->fops->owner)) {
756+ if ((bdev->bd_disk->flags & GENHD_FL_HIDDEN)) {
758757 put_device(&bdev->bd_device);
759758 return NULL;
760759 }
@@ -764,7 +763,6 @@ struct block_device *blkdev_get_no_open(dev_t dev) · 3 unmodified lines
764763
765764 void blkdev_put_no_open(struct block_device *bdev)
766765 {
767− module_put(bdev->bd_disk->fops->owner);
768766 put_device(&bdev->bd_device);
769767 }
770768
@@ -820,12 +818,14 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder) · 49 unmodified lines
820818 ret = -ENXIO;
821819 if (!disk_live(disk))
822820 goto abort_claiming;
821+ if (!try_module_get(disk->fops->owner))
822+ goto abort_claiming;
823823 if (bdev_is_partition(bdev))
824824 ret = blkdev_get_part(bdev, mode);
825825 else
826826 ret = blkdev_get_whole(bdev, mode);
827827 if (ret)
828− goto abort_claiming;
828+ goto put_module;
829829 if (mode & FMODE_EXCL) {
830830 bd_finish_claiming(bdev, holder);
831831
@@ -847,7 +847,8 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder) · 15 unmodified lines
847847 if (unblock_events)
848848 disk_unblock_events(disk);
849849 return bdev;
850−
850+put_module:
851+ module_put(disk->fops->owner);
851852 abort_claiming:
852853 if (mode & FMODE_EXCL)
853854 bd_abort_claiming(bdev, holder);
@@ -956,6 +957,7 @@ void blkdev_put(struct block_device *bdev, fmode_t mode) · 102 unmodified lines
956957 blkdev_put_whole(bdev, mode);
957958 mutex_unlock(&disk->open_mutex);
958959
960+ module_put(disk->fops->owner);
959961 blkdev_put_no_open(bdev);
960962 }
961963 EXPORT_SYMBOL(blkdev_put);
block/blk-cgroup.c+5−4
@@ -640,7 +640,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, · 639 unmodified lines
640640 */
641641 ret = blk_queue_enter(q, 0);
642642 if (ret)
643− return ret;
643+ goto fail;
644644
645645 rcu_read_lock();
646646 spin_lock_irq(&q->queue_lock);
@@ -676,13 +676,13 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, · 29 unmodified lines
676676 new_blkg = blkg_alloc(pos, q, GFP_KERNEL);
677677 if (unlikely(!new_blkg)) {
678678 ret = -ENOMEM;
679− goto fail;
679+ goto fail_exit_queue;
680680 }
681681
682682 if (radix_tree_preload(GFP_KERNEL)) {
683683 blkg_free(new_blkg);
684684 ret = -ENOMEM;
685− goto fail;
685+ goto fail_exit_queue;
686686 }
687687
688688 rcu_read_lock();
@@ -722,9 +722,10 @@ fail_preloaded: · 33 unmodified lines
722722 fail_unlock:
723723 spin_unlock_irq(&q->queue_lock);
724724 rcu_read_unlock();
725+fail_exit_queue:
726+ blk_queue_exit(q);
725727 fail:
726728 blkdev_put_no_open(bdev);
727− blk_queue_exit(q);
728729 /*
729730 * If queue was bypassing, we should retry. Do so after a
730731 * short msleep(). It isn't strictly necessary but queue
block/blk-core.c+4−1
@@ -363,8 +363,10 @@ void blk_cleanup_queue(struct request_queue *q) · 362 unmodified lines
363363 blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
364364
365365 blk_sync_queue(q);
366− if (queue_is_mq(q))
366+ if (queue_is_mq(q)) {
367+ blk_mq_cancel_work_sync(q);
367368 blk_mq_exit_queue(q);
369+ }
368370
369371 /*
370372 * In theory, request pool of sched_tags belongs to request queue.
@@ -1015,6 +1017,7 @@ EXPORT_SYMBOL(submit_bio); · 644 unmodified lines
10151017 /**
10161018 * bio_poll - poll for BIO completions
10171019 * @bio: bio to poll for
1020+ * @iob: batches of IO
10181021 * @flags: BLK_POLL_* flags that control the behavior
10191022 *
10201023 * Poll for completions on queue associated with the bio. Returns number of
block/blk-flush.c+6−6
@@ -379,7 +379,7 @@ static void mq_flush_data_end_io(struct request *rq, blk_status_t error) · 378 unmodified lines
379379 * @rq is being submitted. Analyze what needs to be done and put it on the
380380 * right queue.
381381 */
382−bool blk_insert_flush(struct request *rq)
382+void blk_insert_flush(struct request *rq)
383383 {
384384 struct request_queue *q = rq->q;
385385 unsigned long fflags = q->queue_flags; /* may change, cache */
@@ -409,7 +409,7 @@ bool blk_insert_flush(struct request *rq) · 23 unmodified lines
409409 */
410410 if (!policy) {
411411 blk_mq_end_request(rq, 0);
412− return true;
412+ return;
413413 }
414414
415415 BUG_ON(rq->bio != rq->biotail); /*assumes zero or single bio rq */
@@ -420,8 +420,10 @@ bool blk_insert_flush(struct request *rq) · 4 unmodified lines
420420 * for normal execution.
421421 */
422422 if ((policy & REQ_FSEQ_DATA) &&
423− !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH)))
424− return false;
423+ !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
424+ blk_mq_request_bypass_insert(rq, false, true);
425+ return;
426+ }
425427
426428 /*
427429 * @rq should go through flush machinery. Mark it part of flush
@@ -437,8 +439,6 @@ bool blk_insert_flush(struct request *rq) · 9 unmodified lines
437439 spin_lock_irq(&fq->mq_flush_lock);
438440 blk_flush_complete_seq(rq, fq, REQ_FSEQ_ACTIONS & ~policy, 0);
439441 spin_unlock_irq(&fq->mq_flush_lock);
440−
441− return true;
442442 }
443443
444444 /**
block/blk-mq.c+26−10
@@ -860,13 +860,14 @@ void blk_mq_end_request_batch(struct io_comp_batch *iob) · 859 unmodified lines
860860 if (iob->need_ts)
861861 __blk_mq_end_request_acct(rq, now);
862862
863+ rq_qos_done(rq->q, rq);
864+
863865 WRITE_ONCE(rq->state, MQ_RQ_IDLE);
864866 if (!refcount_dec_and_test(&rq->ref))
865867 continue;
866868
867869 blk_crypto_free_request(rq);
868870 blk_pm_mark_last_busy(rq);
869− rq_qos_done(rq->q, rq);
870871
871872 if (nr_tags == TAG_COMP_BATCH || cur_hctx != rq->mq_hctx) {
872873 if (cur_hctx)
@@ -2543,8 +2544,7 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q, · 1670 unmodified lines
25432544 return NULL;
25442545 }
25452546
2546−static inline bool blk_mq_can_use_cached_rq(struct request *rq,
2547− struct bio *bio)
2547+static inline bool blk_mq_can_use_cached_rq(struct request *rq, struct bio *bio)
25482548 {
25492549 if (blk_mq_get_hctx_type(bio->bi_opf) != rq->mq_hctx->type)
25502550 return false;
@@ -2565,7 +2565,6 @@ static inline struct request *blk_mq_get_request(struct request_queue *q, · 14 unmodified lines
25652565 bool checked = false;
25662566
25672567 if (plug) {
2568−
25692568 rq = rq_list_peek(&plug->cached_rq);
25702569 if (rq && rq->q == q) {
25712570 if (unlikely(!submit_bio_checks(bio)))
@@ -2587,12 +2586,14 @@ static inline struct request *blk_mq_get_request(struct request_queue *q, · 15 unmodified lines
25872586 fallback:
25882587 if (unlikely(bio_queue_enter(bio)))
25892588 return NULL;
2590− if (!checked && !submit_bio_checks(bio))
2591− return NULL;
2589+ if (unlikely(!checked && !submit_bio_checks(bio)))
2590+ goto out_put;
25922591 rq = blk_mq_get_new_requests(q, plug, bio, nsegs, same_queue_rq);
2593− if (!rq)
2594− blk_queue_exit(q);
2595− return rq;
2592+ if (rq)
2593+ return rq;
2594+out_put:
2595+ blk_queue_exit(q);
2596+ return NULL;
25962597 }
25972598
25982599 /**
@@ -2647,8 +2648,10 @@ void blk_mq_submit_bio(struct bio *bio) · 48 unmodified lines
26472648 return;
26482649 }
26492650
2650− if (op_is_flush(bio->bi_opf) && blk_insert_flush(rq))
2651+ if (op_is_flush(bio->bi_opf)) {
2652+ blk_insert_flush(rq);
26512653 return;
2654+ }
26522655
26532656 if (plug && (q->nr_hw_queues == 1 ||
26542657 blk_mq_is_shared_tags(rq->mq_hctx->flags) ||
@@ -4417,6 +4420,19 @@ unsigned int blk_mq_rq_cpu(struct request *rq) · 1762 unmodified lines
44174420 }
44184421 EXPORT_SYMBOL(blk_mq_rq_cpu);
44194422
4423+void blk_mq_cancel_work_sync(struct request_queue *q)
4424+{
4425+ if (queue_is_mq(q)) {
4426+ struct blk_mq_hw_ctx *hctx;
4427+ int i;
4428+
4429+ cancel_delayed_work_sync(&q->requeue_work);
4430+
4431+ queue_for_each_hw_ctx(q, hctx, i)
4432+ cancel_delayed_work_sync(&hctx->run_work);
4433+ }
4434+}
4435+
44204436 static int __init blk_mq_init(void)
44214437 {
44224438 int i;
block/blk-mq.h+2−0
@@ -128,6 +128,8 @@ extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx); · 127 unmodified lines
128128 void blk_mq_free_plug_rqs(struct blk_plug *plug);
129129 void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule);
130130
131+void blk_mq_cancel_work_sync(struct request_queue *q);
132+
131133 void blk_mq_release(struct request_queue *q);
132134
133135 static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q,
block/blk-sysfs.c+0−10
@@ -791,16 +791,6 @@ static void blk_release_queue(struct kobject *kobj) · 790 unmodified lines
791791
792792 blk_free_queue_stats(q->stats);
793793
794− if (queue_is_mq(q)) {
795− struct blk_mq_hw_ctx *hctx;
796− int i;
797−
798− cancel_delayed_work_sync(&q->requeue_work);
799−
800− queue_for_each_hw_ctx(q, hctx, i)
801− cancel_delayed_work_sync(&hctx->run_work);
802− }
803−
804794 blk_exit_queue(q);
805795
806796 blk_queue_free_zone_bitmaps(q);
block/blk.h+1−1
@@ -271,7 +271,7 @@ void __blk_account_io_done(struct request *req, u64 now); · 270 unmodified lines
271271 */
272272 #define ELV_ON_HASH(rq) ((rq)->rq_flags & RQF_HASHED)
273273
274−bool blk_insert_flush(struct request *rq);
274+void blk_insert_flush(struct request *rq);
275275
276276 int elevator_switch_mq(struct request_queue *q,
277277 struct elevator_type *new_e);
block/elevator.c+8−2
@@ -694,12 +694,18 @@ void elevator_init_mq(struct request_queue *q) · 693 unmodified lines
694694 if (!e)
695695 return;
696696
697+ /*
698+ * We are called before adding disk, when there isn't any FS I/O,
699+ * so freezing queue plus canceling dispatch work is enough to
700+ * drain any dispatch activities originated from passthrough
701+ * requests, then no need to quiesce queue which may add long boot
702+ * latency, especially when lots of disks are involved.
703+ */
697704 blk_mq_freeze_queue(q);
698− blk_mq_quiesce_queue(q);
705+ blk_mq_cancel_work_sync(q);
699706
700707 err = blk_mq_init_sched(q, e);
701708
702− blk_mq_unquiesce_queue(q);
703709 blk_mq_unfreeze_queue(q);
704710
705711 if (err) {
block/fops.c+2−2
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/falloc.h>
1616 #include <linux/suspend.h>
1717 #include <linux/fs.h>
18+#include <linux/module.h>
1819 #include "blk.h"
1920
2021 static inline struct inode *bdev_file_inode(struct file *file)
@@ -340,8 +341,7 @@ static ssize_t __blkdev_direct_IO_async(struct kiocb *iocb, · 319 unmodified lines
340341 } else {
341342 ret = bio_iov_iter_get_pages(bio, iter);
342343 if (unlikely(ret)) {
343− bio->bi_status = BLK_STS_IOERR;
344− bio_endio(bio);
344+ bio_put(bio);
345345 return ret;
346346 }
347347 }
block/genhd.c+2−0
@@ -1111,6 +1111,8 @@ static void disk_release(struct device *dev) · 1110 unmodified lines
11111111 might_sleep();
11121112 WARN_ON_ONCE(disk_live(disk));
11131113
1114+ blk_mq_cancel_work_sync(disk->queue);
1115+
11141116 disk_release_events(disk);
11151117 kfree(disk->random);
11161118 xa_destroy(&disk->part_tbl);
block/ioprio.c+11−1
@@ -69,7 +69,14 @@ int ioprio_check_cap(int ioprio) · 68 unmodified lines
6969
7070 switch (class) {
7171 case IOPRIO_CLASS_RT:
72− if (!capable(CAP_SYS_NICE) && !capable(CAP_SYS_ADMIN))
72+ /*
73+ * Originally this only checked for CAP_SYS_ADMIN,
74+ * which was implicitly allowed for pid 0 by security
75+ * modules such as SELinux. Make sure we check
76+ * CAP_SYS_ADMIN first to avoid a denial/avc for
77+ * possibly missing CAP_SYS_NICE permission.
78+ */
79+ if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_NICE))
7380 return -EPERM;
7481 fallthrough;
7582 /* rt has prio field too */
@@ -213,6 +220,7 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) · 137 unmodified lines
213220 pgrp = task_pgrp(current);
214221 else
215222 pgrp = find_vpid(who);
223+ read_lock(&tasklist_lock);
216224 do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
217225 tmpio = get_task_ioprio(p);
218226 if (tmpio < 0)
@@ -222,6 +230,8 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) · 3 unmodified lines
222230 else
223231 ret = ioprio_best(ret, tmpio);
224232 } while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
233+ read_unlock(&tasklist_lock);
234+
225235 break;
226236 case IOPRIO_WHO_USER:
227237 uid = make_kuid(current_user_ns(), who);
drivers/acpi/cppc_acpi.c+8−1
@@ -998,7 +998,14 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) · 997 unmodified lines
998998 static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
999999 {
10001000 struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
1001− struct cpc_register_resource *reg = &cpc_desc->cpc_regs[reg_idx];
1001+ struct cpc_register_resource *reg;
1002+
1003+ if (!cpc_desc) {
1004+ pr_debug("No CPC descriptor for CPU:%d\n", cpunum);
1005+ return -ENODEV;
1006+ }
1007+
1008+ reg = &cpc_desc->cpc_regs[reg_idx];
10021009
10031010 if (CPC_IN_PCC(reg)) {
10041011 int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);
drivers/acpi/glue.c+0−25
@@ -347,28 +347,3 @@ void acpi_device_notify_remove(struct device *dev) · 346 unmodified lines
347347
348348 acpi_unbind_one(dev);
349349 }
350−
351−int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used)
352−{
353− struct acpi_device *adev = to_acpi_device(dev);
354−
355− /*
356− * Skip device objects with device IDs, because they may be in use even
357− * if they are not companions of any physical device objects.
358− */
359− if (adev->pnp.type.hardware_id)
360− return 0;
361−
362− mutex_lock(&adev->physical_node_lock);
363−
364− /*
365− * Device objects without device IDs are not in use if they have no
366− * corresponding physical device objects.
367− */
368− if (list_empty(&adev->physical_node_list))
369− acpi_device_set_power(adev, ACPI_STATE_D3_COLD);
370−
371− mutex_unlock(&adev->physical_node_lock);
372−
373− return 0;
374−}
drivers/acpi/internal.h+0−1
@@ -117,7 +117,6 @@ bool acpi_device_is_battery(struct acpi_device *adev); · 116 unmodified lines
117117 bool acpi_device_is_first_physical_node(struct acpi_device *adev,
118118 const struct device *dev);
119119 int acpi_bus_register_early_device(int type);
120−int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used);
121120
122121 /* --------------------------------------------------------------------------
123122 Device Matching and Notification
drivers/acpi/property.c+5−9
@@ -1084,21 +1084,17 @@ struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode, · 1083 unmodified lines
10841084 * Returns parent node of an ACPI device or data firmware node or %NULL if
10851085 * not available.
10861086 */
1087−struct fwnode_handle *acpi_node_get_parent(const struct fwnode_handle *fwnode)
1087+static struct fwnode_handle *
1088+acpi_node_get_parent(const struct fwnode_handle *fwnode)
10881089 {
10891090 if (is_acpi_data_node(fwnode)) {
10901091 /* All data nodes have parent pointer so just return that */
10911092 return to_acpi_data_node(fwnode)->parent;
10921093 } else if (is_acpi_device_node(fwnode)) {
1093− acpi_handle handle, parent_handle;
1094−
1095− handle = to_acpi_device_node(fwnode)->handle;
1096− if (ACPI_SUCCESS(acpi_get_parent(handle, &parent_handle))) {
1097− struct acpi_device *adev;
1094+ struct device *dev = to_acpi_device_node(fwnode)->dev.parent;
10981095
1099− if (!acpi_bus_get_device(parent_handle, &adev))
1100− return acpi_fwnode_handle(adev);
1101− }
1096+ if (dev)
1097+ return acpi_fwnode_handle(to_acpi_device(dev));
11021098 }
11031099
11041100 return NULL;
drivers/acpi/scan.c+0−6
@@ -2564,12 +2564,6 @@ int __init acpi_scan_init(void) · 2563 unmodified lines
25642564 }
25652565 }
25662566
2567− /*
2568− * Make sure that power management resources are not blocked by ACPI
2569− * device objects with no users.
2570− */
2571− bus_for_each_dev(&acpi_bus_type, NULL, NULL, acpi_dev_turn_off_if_unused);
2572−
25732567 acpi_turn_off_unused_power_resources();
25742568
25752569 acpi_scan_initialized = true;
drivers/android/binder.c+10−13
@@ -2710,7 +2710,7 @@ static void binder_transaction(struct binder_proc *proc, · 2709 unmodified lines
27102710 t->from = thread;
27112711 else
27122712 t->from = NULL;
2713− t->sender_euid = proc->cred->euid;
2713+ t->sender_euid = task_euid(proc->tsk);
27142714 t->to_proc = target_proc;
27152715 t->to_thread = target_thread;
27162716 t->code = tr->code;
@@ -4422,23 +4422,20 @@ static int binder_thread_release(struct binder_proc *proc, · 1705 unmodified lines
44224422 __release(&t->lock);
44234423
44244424 /*
4425− * If this thread used poll, make sure we remove the waitqueue
4426− * from any epoll data structures holding it with POLLFREE.
4427− * waitqueue_active() is safe to use here because we're holding
4428− * the inner lock.
4425+ * If this thread used poll, make sure we remove the waitqueue from any
4426+ * poll data structures holding it.
44294427 */
4430− if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&
4431− waitqueue_active(&thread->wait)) {
4432− wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);
4433− }
4428+ if (thread->looper & BINDER_LOOPER_STATE_POLL)
4429+ wake_up_pollfree(&thread->wait);
44344430
44354431 binder_inner_proc_unlock(thread->proc);
44364432
44374433 /*
4438− * This is needed to avoid races between wake_up_poll() above and
4439− * and ep_remove_waitqueue() called for other reasons (eg the epoll file
4440− * descriptor being closed); ep_remove_waitqueue() holds an RCU read
4441− * lock, so we can be sure it's done after calling synchronize_rcu().
4434+ * This is needed to avoid races between wake_up_pollfree() above and
4435+ * someone else removing the last entry from the queue for other reasons
4436+ * (e.g. ep_remove_wait_queue() being called due to an epoll file
4437+ * descriptor being closed). Such other users hold an RCU read lock, so
4438+ * we can be sure they're done after we call synchronize_rcu().
44424439 */
44434440 if (thread->looper & BINDER_LOOPER_STATE_POLL)
44444441 synchronize_rcu();
drivers/ata/ahci.c+1−0
@@ -438,6 +438,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 437 unmodified lines
438438 /* AMD */
439439 { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
440440 { PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
441+ { PCI_VDEVICE(AMD, 0x7901), board_ahci_mobile }, /* AMD Green Sardine */
441442 /* AMD is using RAID class only for ahci controllers */
442443 { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
443444 PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },
drivers/ata/ahci_ceva.c+2−1
@@ -94,6 +94,7 @@ struct ceva_ahci_priv { · 93 unmodified lines
9494 static unsigned int ceva_ahci_read_id(struct ata_device *dev,
9595 struct ata_taskfile *tf, u16 *id)
9696 {
97+ __le16 *__id = (__le16 *)id;
9798 u32 err_mask;
9899
99100 err_mask = ata_do_dev_read_id(dev, tf, id);
@@ -103,7 +104,7 @@ static unsigned int ceva_ahci_read_id(struct ata_device *dev, · 3 unmodified lines
103104 * Since CEVA controller does not support device sleep feature, we
104105 * need to clear DEVSLP (bit 8) in word78 of the IDENTIFY DEVICE data.
105106 */
106− id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
107+ __id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
107108
108109 return 0;
109110 }
drivers/ata/libahci.c+15−0
@@ -2323,6 +2323,18 @@ int ahci_port_resume(struct ata_port *ap) · 2322 unmodified lines
23232323 EXPORT_SYMBOL_GPL(ahci_port_resume);
23242324
23252325 #ifdef CONFIG_PM
2326+static void ahci_handle_s2idle(struct ata_port *ap)
2327+{
2328+ void __iomem *port_mmio = ahci_port_base(ap);
2329+ u32 devslp;
2330+
2331+ if (pm_suspend_via_firmware())
2332+ return;
2333+ devslp = readl(port_mmio + PORT_DEVSLP);
2334+ if ((devslp & PORT_DEVSLP_ADSE))
2335+ ata_msleep(ap, devslp_idle_timeout);
2336+}
2337+
23262338 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
23272339 {
23282340 const char *emsg = NULL;
@@ -2336,6 +2348,9 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) · 7 unmodified lines
23362348 ata_port_freeze(ap);
23372349 }
23382350
2351+ if (acpi_storage_d3(ap->host->dev))
2352+ ahci_handle_s2idle(ap);
2353+
23392354 ahci_rpm_put_port(ap);
23402355 return rc;
23412356 }
drivers/ata/libata-core.c+10−3
@@ -2031,8 +2031,9 @@ retry: · 2030 unmodified lines
20312031 dev->horkage |= ATA_HORKAGE_NO_DMA_LOG;
20322032 goto retry;
20332033 }
2034− ata_dev_err(dev, "Read log page 0x%02x failed, Emask 0x%x\n",
2035− (unsigned int)page, err_mask);
2034+ ata_dev_err(dev,
2035+ "Read log 0x%02x page 0x%02x failed, Emask 0x%x\n",
2036+ (unsigned int)log, (unsigned int)page, err_mask);
20362037 }
20372038
20382039 return err_mask;
@@ -2177,6 +2178,9 @@ static void ata_dev_config_ncq_prio(struct ata_device *dev) · 138 unmodified lines
21772178 struct ata_port *ap = dev->link->ap;
21782179 unsigned int err_mask;
21792180
2181+ if (!ata_identify_page_supported(dev, ATA_LOG_SATA_SETTINGS))
2182+ return;
2183+
21802184 err_mask = ata_read_log_page(dev,
21812185 ATA_LOG_IDENTIFY_DEVICE,
21822186 ATA_LOG_SATA_SETTINGS,
@@ -2453,7 +2457,8 @@ static void ata_dev_config_devslp(struct ata_device *dev) · 270 unmodified lines
24532457 * Check device sleep capability. Get DevSlp timing variables
24542458 * from SATA Settings page of Identify Device Data Log.
24552459 */
2456− if (!ata_id_has_devslp(dev->id))
2460+ if (!ata_id_has_devslp(dev->id) ||
2461+ !ata_identify_page_supported(dev, ATA_LOG_SATA_SETTINGS))
24572462 return;
24582463
24592464 err_mask = ata_read_log_page(dev,
@@ -3915,6 +3920,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 1455 unmodified lines
39153920 { "VRFDFC22048UCHC-TE*", NULL, ATA_HORKAGE_NODMA },
39163921 /* Odd clown on sil3726/4726 PMPs */
39173922 { "Config Disk", NULL, ATA_HORKAGE_DISABLE },
3923+ /* Similar story with ASMedia 1092 */
3924+ { "ASMT109x- Config", NULL, ATA_HORKAGE_DISABLE },
39183925
39193926 /* Weird ATAPI devices */
39203927 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
drivers/ata/libata-sata.c+2−2
@@ -827,7 +827,7 @@ static ssize_t ata_scsi_lpm_show(struct device *dev, · 826 unmodified lines
827827 if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names))
828828 return -EINVAL;
829829
830− return snprintf(buf, PAGE_SIZE, "%s\n",
830+ return sysfs_emit(buf, "%s\n",
831831 ata_lpm_policy_names[ap->target_lpm_policy]);
832832 }
833833 DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
@@ -922,7 +922,7 @@ DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, · 88 unmodified lines
922922 ata_ncq_prio_enable_show, ata_ncq_prio_enable_store);
923923 EXPORT_SYMBOL_GPL(dev_attr_ncq_prio_enable);
924924
925−struct attribute *ata_ncq_sdev_attrs[] = {
925+static struct attribute *ata_ncq_sdev_attrs[] = {
926926 &dev_attr_unload_heads.attr,
927927 &dev_attr_ncq_prio_enable.attr,
928928 &dev_attr_ncq_prio_supported.attr,
drivers/ata/pata_falcon.c+8−8
@@ -55,14 +55,14 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc, · 54 unmodified lines
5555 /* Transfer multiple of 2 bytes */
5656 if (rw == READ) {
5757 if (swap)
58− raw_insw_swapw((u16 *)data_addr, (u16 *)buf, words);
58+ raw_insw_swapw(data_addr, (u16 *)buf, words);
5959 else
60− raw_insw((u16 *)data_addr, (u16 *)buf, words);
60+ raw_insw(data_addr, (u16 *)buf, words);
6161 } else {
6262 if (swap)
63− raw_outsw_swapw((u16 *)data_addr, (u16 *)buf, words);
63+ raw_outsw_swapw(data_addr, (u16 *)buf, words);
6464 else
65− raw_outsw((u16 *)data_addr, (u16 *)buf, words);
65+ raw_outsw(data_addr, (u16 *)buf, words);
6666 }
6767
6868 /* Transfer trailing byte, if any. */
@@ -74,16 +74,16 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc, · 5 unmodified lines
7474
7575 if (rw == READ) {
7676 if (swap)
77− raw_insw_swapw((u16 *)data_addr, (u16 *)pad, 1);
77+ raw_insw_swapw(data_addr, (u16 *)pad, 1);
7878 else
79− raw_insw((u16 *)data_addr, (u16 *)pad, 1);
79+ raw_insw(data_addr, (u16 *)pad, 1);
8080 *buf = pad[0];
8181 } else {
8282 pad[0] = *buf;
8383 if (swap)
84− raw_outsw_swapw((u16 *)data_addr, (u16 *)pad, 1);
84+ raw_outsw_swapw(data_addr, (u16 *)pad, 1);
8585 else
86− raw_outsw((u16 *)data_addr, (u16 *)pad, 1);
86+ raw_outsw(data_addr, (u16 *)pad, 1);
8787 }
8888 words++;
8989 }
drivers/ata/sata_fsl.c+13−7
@@ -1394,6 +1394,14 @@ static int sata_fsl_init_controller(struct ata_host *host) · 1393 unmodified lines
13941394 return 0;
13951395 }
13961396
1397+static void sata_fsl_host_stop(struct ata_host *host)
1398+{
1399+ struct sata_fsl_host_priv *host_priv = host->private_data;
1400+
1401+ iounmap(host_priv->hcr_base);
1402+ kfree(host_priv);
1403+}
1404+
13971405 /*
13981406 * scsi mid-layer and libata interface structures
13991407 */
@@ -1426,6 +1434,8 @@ static struct ata_port_operations sata_fsl_ops = { · 26 unmodified lines
14261434 .port_start = sata_fsl_port_start,
14271435 .port_stop = sata_fsl_port_stop,
14281436
1437+ .host_stop = sata_fsl_host_stop,
1438+
14291439 .pmp_attach = sata_fsl_pmp_attach,
14301440 .pmp_detach = sata_fsl_pmp_detach,
14311441 };
@@ -1480,9 +1490,9 @@ static int sata_fsl_probe(struct platform_device *ofdev) · 48 unmodified lines
14801490 host_priv->ssr_base = ssr_base;
14811491 host_priv->csr_base = csr_base;
14821492
1483− irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
1484− if (!irq) {
1485− dev_err(&ofdev->dev, "invalid irq from platform\n");
1493+ irq = platform_get_irq(ofdev, 0);
1494+ if (irq < 0) {
1495+ retval = irq;
14861496 goto error_exit_with_cleanup;
14871497 }
14881498 host_priv->irq = irq;
@@ -1557,10 +1567,6 @@ static int sata_fsl_remove(struct platform_device *ofdev) · 68 unmodified lines
15571567
15581568 ata_host_detach(host);
15591569
1560− irq_dispose_mapping(host_priv->irq);
1561− iounmap(host_priv->hcr_base);
1562− kfree(host_priv);
1563−
15641570 return 0;
15651571 }
15661572
drivers/block/loop.c+1−1
@@ -2103,7 +2103,7 @@ static int loop_control_remove(int idx) · 2102 unmodified lines
21032103 int ret;
21042104
21052105 if (idx < 0) {
2106− pr_warn("deleting an unspecified loop device is not supported.\n");
2106+ pr_warn_once("deleting an unspecified loop device is not supported.\n");
21072107 return -EINVAL;
21082108 }
21092109
drivers/block/virtio_blk.c+1−2
@@ -316,7 +316,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, · 315 unmodified lines
316316 struct request *req = bd->rq;
317317 struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
318318 unsigned long flags;
319− unsigned int num;
319+ int num;
320320 int qid = hctx->queue_num;
321321 bool notify = false;
322322 blk_status_t status;
@@ -1049,7 +1049,6 @@ static struct virtio_driver virtio_blk = { · 726 unmodified lines
10491049 .feature_table_size = ARRAY_SIZE(features),
10501050 .feature_table_legacy = features_legacy,
10511051 .feature_table_size_legacy = ARRAY_SIZE(features_legacy),
1052− .suppress_used_validation = true,
10531052 .driver.name = KBUILD_MODNAME,
10541053 .driver.owner = THIS_MODULE,
10551054 .id_table = id_table,
drivers/block/zram/zram_drv.c+2−0
@@ -1853,12 +1853,14 @@ static const struct block_device_operations zram_devops = { · 1852 unmodified lines
18531853 .owner = THIS_MODULE
18541854 };
18551855
1856+#ifdef CONFIG_ZRAM_WRITEBACK
18561857 static const struct block_device_operations zram_wb_devops = {
18571858 .open = zram_open,
18581859 .submit_bio = zram_submit_bio,
18591860 .swap_slot_free_notify = zram_slot_free_notify,
18601861 .owner = THIS_MODULE
18611862 };
1863+#endif
18621864
18631865 static DEVICE_ATTR_WO(compact);
18641866 static DEVICE_ATTR_RW(disksize);
drivers/bus/mhi/core/pm.c+18−3
@@ -881,7 +881,7 @@ int mhi_pm_suspend(struct mhi_controller *mhi_cntrl) · 880 unmodified lines
881881 }
882882 EXPORT_SYMBOL_GPL(mhi_pm_suspend);
883883
884−int mhi_pm_resume(struct mhi_controller *mhi_cntrl)
884+static int __mhi_pm_resume(struct mhi_controller *mhi_cntrl, bool force)
885885 {
886886 struct mhi_chan *itr, *tmp;
887887 struct device *dev = &mhi_cntrl->mhi_dev->dev;
@@ -898,8 +898,12 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl) · 10 unmodified lines
898898 if (MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state))
899899 return -EIO;
900900
901− if (mhi_get_mhi_state(mhi_cntrl) != MHI_STATE_M3)
902− return -EINVAL;
901+ if (mhi_get_mhi_state(mhi_cntrl) != MHI_STATE_M3) {
902+ dev_warn(dev, "Resuming from non M3 state (%s)\n",
903+ TO_MHI_STATE_STR(mhi_get_mhi_state(mhi_cntrl)));
904+ if (!force)
905+ return -EINVAL;
906+ }
903907
904908 /* Notify clients about exiting LPM */
905909 list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans, node) {
@@ -940,8 +944,19 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl) · 34 unmodified lines
940944
941945 return 0;
942946 }
947+
948+int mhi_pm_resume(struct mhi_controller *mhi_cntrl)
949+{
950+ return __mhi_pm_resume(mhi_cntrl, false);
951+}
943952 EXPORT_SYMBOL_GPL(mhi_pm_resume);
944953
954+int mhi_pm_resume_force(struct mhi_controller *mhi_cntrl)
955+{
956+ return __mhi_pm_resume(mhi_cntrl, true);
957+}
958+EXPORT_SYMBOL_GPL(mhi_pm_resume_force);
959+
945960 int __mhi_device_get_sync(struct mhi_controller *mhi_cntrl)
946961 {
947962 int ret;
drivers/bus/mhi/pci_generic.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020
2121 #define MHI_PCI_DEFAULT_BAR_NUM 0
2222
23−#define MHI_POST_RESET_DELAY_MS 500
23+#define MHI_POST_RESET_DELAY_MS 2000
2424
2525 #define HEALTH_CHECK_PERIOD (HZ * 2)
2626
drivers/char/agp/parisc-agp.c+3−3
@@ -281,7 +281,7 @@ agp_ioc_init(void __iomem *ioc_regs) · 280 unmodified lines
281281 return 0;
282282 }
283283
284−static int
284+static int __init
285285 lba_find_capability(int cap)
286286 {
287287 struct _parisc_agp_info *info = &parisc_agp_info;
@@ -366,7 +366,7 @@ fail: · 78 unmodified lines
366366 return error;
367367 }
368368
369−static int
369+static int __init
370370 find_quicksilver(struct device *dev, void *data)
371371 {
372372 struct parisc_device **lba = data;
@@ -378,7 +378,7 @@ find_quicksilver(struct device *dev, void *data) · 5 unmodified lines
378378 return 0;
379379 }
380380
381−static int
381+static int __init
382382 parisc_agp_init(void)
383383 {
384384 extern struct sba_device *sba_list;
drivers/char/ipmi/ipmi_msghandler.c+33−8
@@ -191,6 +191,8 @@ struct ipmi_user { · 190 unmodified lines
191191 struct work_struct remove_work;
192192 };
193193
194+static struct workqueue_struct *remove_work_wq;
195+
194196 static struct ipmi_user *acquire_ipmi_user(struct ipmi_user *user, int *index)
195197 __acquires(user->release_barrier)
196198 {
@@ -1297,7 +1299,7 @@ static void free_user(struct kref *ref) · 1100 unmodified lines
12971299 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
12981300
12991301 /* SRCU cleanup must happen in task context. */
1300− schedule_work(&user->remove_work);
1302+ queue_work(remove_work_wq, &user->remove_work);
13011303 }
13021304
13031305 static void _ipmi_destroy_user(struct ipmi_user *user)
@@ -3918,9 +3920,11 @@ static int handle_ipmb_direct_rcv_cmd(struct ipmi_smi *intf, · 2614 unmodified lines
39183920 /* We didn't find a user, deliver an error response. */
39193921 ipmi_inc_stat(intf, unhandled_commands);
39203922
3921− msg->data[0] = ((netfn + 1) << 2) | (msg->rsp[4] & 0x3);
3922− msg->data[1] = msg->rsp[2];
3923− msg->data[2] = msg->rsp[4] & ~0x3;
3923+ msg->data[0] = (netfn + 1) << 2;
3924+ msg->data[0] |= msg->rsp[2] & 0x3; /* rqLUN */
3925+ msg->data[1] = msg->rsp[1]; /* Addr */
3926+ msg->data[2] = msg->rsp[2] & ~0x3; /* rqSeq */
3927+ msg->data[2] |= msg->rsp[0] & 0x3; /* rsLUN */
39243928 msg->data[3] = cmd;
39253929 msg->data[4] = IPMI_INVALID_CMD_COMPLETION_CODE;
39263930 msg->data_size = 5;
@@ -4455,13 +4459,24 @@ return_unspecified: · 528 unmodified lines
44554459 msg->rsp[2] = IPMI_ERR_UNSPECIFIED;
44564460 msg->rsp_size = 3;
44574461 } else if (msg->type == IPMI_SMI_MSG_TYPE_IPMB_DIRECT) {
4458− /* commands must have at least 3 bytes, responses 4. */
4459− if (is_cmd && (msg->rsp_size < 3)) {
4462+ /* commands must have at least 4 bytes, responses 5. */
4463+ if (is_cmd && (msg->rsp_size < 4)) {
44604464 ipmi_inc_stat(intf, invalid_commands);
44614465 goto out;
44624466 }
4463− if (!is_cmd && (msg->rsp_size < 4))
4464− goto return_unspecified;
4467+ if (!is_cmd && (msg->rsp_size < 5)) {
4468+ ipmi_inc_stat(intf, invalid_ipmb_responses);
4469+ /* Construct a valid error response. */
4470+ msg->rsp[0] = msg->data[0] & 0xfc; /* NetFN */
4471+ msg->rsp[0] |= (1 << 2); /* Make it a response */
4472+ msg->rsp[0] |= msg->data[2] & 3; /* rqLUN */
4473+ msg->rsp[1] = msg->data[1]; /* Addr */
4474+ msg->rsp[2] = msg->data[2] & 0xfc; /* rqSeq */
4475+ msg->rsp[2] |= msg->data[0] & 0x3; /* rsLUN */
4476+ msg->rsp[3] = msg->data[3]; /* Cmd */
4477+ msg->rsp[4] = IPMI_ERR_UNSPECIFIED;
4478+ msg->rsp_size = 5;
4479+ }
44654480 } else if ((msg->data_size >= 2)
44664481 && (msg->data[0] == (IPMI_NETFN_APP_REQUEST << 2))
44674482 && (msg->data[1] == IPMI_SEND_MSG_CMD)
@@ -5031,6 +5046,7 @@ struct ipmi_smi_msg *ipmi_alloc_smi_msg(void) · 563 unmodified lines
50315046 if (rv) {
50325047 rv->done = free_smi_msg;
50335048 rv->user_data = NULL;
5049+ rv->type = IPMI_SMI_MSG_TYPE_NORMAL;
50345050 atomic_inc(&smi_msg_inuse_count);
50355051 }
50365052 return rv;
@@ -5383,6 +5399,13 @@ static int ipmi_init_msghandler(void) · 346 unmodified lines
53835399
53845400 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
53855401
5402+ remove_work_wq = create_singlethread_workqueue("ipmi-msghandler-remove-wq");
5403+ if (!remove_work_wq) {
5404+ pr_err("unable to create ipmi-msghandler-remove-wq workqueue");
5405+ rv = -ENOMEM;
5406+ goto out;
5407+ }
5408+
53865409 initialized = true;
53875410
53885411 out:
@@ -5408,6 +5431,8 @@ static void __exit cleanup_ipmi(void) · 19 unmodified lines
54085431 int count;
54095432
54105433 if (initialized) {
5434+ destroy_workqueue(remove_work_wq);
5435+
54115436 atomic_notifier_chain_unregister(&panic_notifier_list,
54125437 &panic_block);
54135438
drivers/clk/imx/clk-imx8qxp-lpcg.c+1−1
@@ -370,7 +370,7 @@ static struct platform_driver imx8qxp_lpcg_clk_driver = { · 369 unmodified lines
370370 .probe = imx8qxp_lpcg_clk_probe,
371371 };
372372
373−builtin_platform_driver(imx8qxp_lpcg_clk_driver);
373+module_platform_driver(imx8qxp_lpcg_clk_driver);
374374
375375 MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
376376 MODULE_DESCRIPTION("NXP i.MX8QXP LPCG clock driver");
drivers/clk/imx/clk-imx8qxp.c+1−1
@@ -308,7 +308,7 @@ static struct platform_driver imx8qxp_clk_driver = { · 307 unmodified lines
308308 },
309309 .probe = imx8qxp_clk_probe,
310310 };
311−builtin_platform_driver(imx8qxp_clk_driver);
311+module_platform_driver(imx8qxp_clk_driver);
312312
313313 MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
314314 MODULE_DESCRIPTION("NXP i.MX8QXP clock driver");
drivers/clk/qcom/clk-alpha-pll.c+9−0
@@ -1429,6 +1429,15 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_fabia_ops); · 1428 unmodified lines
14291429 void clk_trion_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
14301430 const struct alpha_pll_config *config)
14311431 {
1432+ /*
1433+ * If the bootloader left the PLL enabled it's likely that there are
1434+ * RCGs that will lock up if we disable the PLL below.
1435+ */
1436+ if (trion_pll_is_enabled(pll, regmap)) {
1437+ pr_debug("Trion PLL is already enabled, skipping configuration\n");
1438+ return;
1439+ }
1440+
14321441 clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
14331442 regmap_write(regmap, PLL_CAL_L_VAL(pll), TRION_PLL_CAL_VAL);
14341443 clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
drivers/clk/qcom/clk-regmap-mux.c+1−1
@@ -28,7 +28,7 @@ static u8 mux_get_parent(struct clk_hw *hw) · 27 unmodified lines
2828 val &= mask;
2929
3030 if (mux->parent_map)
31− return qcom_find_src_index(hw, mux->parent_map, val);
31+ return qcom_find_cfg_index(hw, mux->parent_map, val);
3232
3333 return val;
3434 }
drivers/clk/qcom/common.c+12−0
@@ -69,6 +69,18 @@ int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map, u8 src) · 68 unmodified lines
6969 }
7070 EXPORT_SYMBOL_GPL(qcom_find_src_index);
7171
72+int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map, u8 cfg)
73+{
74+ int i, num_parents = clk_hw_get_num_parents(hw);
75+
76+ for (i = 0; i < num_parents; i++)
77+ if (cfg == map[i].cfg)
78+ return i;
79+
80+ return -ENOENT;
81+}
82+EXPORT_SYMBOL_GPL(qcom_find_cfg_index);
83+
7284 struct regmap *
7385 qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc)
7486 {
drivers/clk/qcom/common.h+2−0
@@ -49,6 +49,8 @@ extern void · 48 unmodified lines
4949 qcom_pll_set_fsm_mode(struct regmap *m, u32 reg, u8 bias_count, u8 lock_count);
5050 extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map,
5151 u8 src);
52+extern int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map,
53+ u8 cfg);
5254
5355 extern int qcom_cc_register_board_clk(struct device *dev, const char *path,
5456 const char *name, unsigned long rate);
drivers/clk/qcom/gcc-sm6125.c+2−2
@@ -1121,7 +1121,7 @@ static struct clk_rcg2 gcc_sdcc1_apps_clk_src = { · 1120 unmodified lines
11211121 .name = "gcc_sdcc1_apps_clk_src",
11221122 .parent_data = gcc_parent_data_1,
11231123 .num_parents = ARRAY_SIZE(gcc_parent_data_1),
1124− .ops = &clk_rcg2_ops,
1124+ .ops = &clk_rcg2_floor_ops,
11251125 },
11261126 };
11271127
@@ -1143,7 +1143,7 @@ static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = { · 15 unmodified lines
11431143 .name = "gcc_sdcc1_ice_core_clk_src",
11441144 .parent_data = gcc_parent_data_0,
11451145 .num_parents = ARRAY_SIZE(gcc_parent_data_0),
1146− .ops = &clk_rcg2_floor_ops,
1146+ .ops = &clk_rcg2_ops,
11471147 },
11481148 };
11491149
drivers/clk/versatile/clk-icst.c+1−1
@@ -543,8 +543,8 @@ static void __init of_syscon_icst_setup(struct device_node *np) · 542 unmodified lines
543543
544544 regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map, ctype);
545545 if (IS_ERR(regclk)) {
546− kfree(name);
547546 pr_err("error setting up syscon ICST clock %s\n", name);
547+ kfree(name);
548548 return;
549549 }
550550 of_clk_add_provider(np, of_clk_src_simple_get, regclk);
drivers/clocksource/arm_arch_timer.c+7−2
@@ -394,8 +394,13 @@ EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround); · 393 unmodified lines
394394
395395 static atomic_t timer_unstable_counter_workaround_in_use = ATOMIC_INIT(0);
396396
397−static void erratum_set_next_event_generic(const int access, unsigned long evt,
398− struct clock_event_device *clk)
397+/*
398+ * Force the inlining of this function so that the register accesses
399+ * can be themselves correctly inlined.
400+ */
401+static __always_inline
402+void erratum_set_next_event_generic(const int access, unsigned long evt,
403+ struct clock_event_device *clk)
399404 {
400405 unsigned long ctrl;
401406 u64 cval;
drivers/clocksource/dw_apb_timer_of.c+1−1
@@ -47,7 +47,7 @@ static int __init timer_get_base_and_rate(struct device_node *np, · 46 unmodified lines
4747 pr_warn("pclk for %pOFn is present, but could not be activated\n",
4848 np);
4949
50− if (!of_property_read_u32(np, "clock-freq", rate) &&
50+ if (!of_property_read_u32(np, "clock-freq", rate) ||
5151 !of_property_read_u32(np, "clock-frequency", rate))
5252 return 0;
5353
drivers/cpufreq/cpufreq.c+7−7
@@ -1004,10 +1004,9 @@ static struct kobj_type ktype_cpufreq = { · 1003 unmodified lines
10041004 .release = cpufreq_sysfs_release,
10051005 };
10061006
1007−static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu)
1007+static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu,
1008+ struct device *dev)
10081009 {
1009− struct device *dev = get_cpu_device(cpu);
1010−
10111010 if (unlikely(!dev))
10121011 return;
10131012
@@ -1296,8 +1295,9 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy) · 282 unmodified lines
12961295
12971296 if (policy->max_freq_req) {
12981297 /*
1299− * CPUFREQ_CREATE_POLICY notification is sent only after
1300− * successfully adding max_freq_req request.
1298+ * Remove max_freq_req after sending CPUFREQ_REMOVE_POLICY
1299+ * notification, since CPUFREQ_CREATE_POLICY notification was
1300+ * sent after adding max_freq_req earlier.
13011301 */
13021302 blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
13031303 CPUFREQ_REMOVE_POLICY, policy);
@@ -1391,7 +1391,7 @@ static int cpufreq_online(unsigned int cpu) · 87 unmodified lines
13911391 if (new_policy) {
13921392 for_each_cpu(j, policy->related_cpus) {
13931393 per_cpu(cpufreq_cpu_data, j) = policy;
1394− add_cpu_dev_symlink(policy, j);
1394+ add_cpu_dev_symlink(policy, j, get_cpu_device(j));
13951395 }
13961396
13971397 policy->min_freq_req = kzalloc(2 * sizeof(*policy->min_freq_req),
@@ -1565,7 +1565,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) · 167 unmodified lines
15651565 /* Create sysfs link on CPU registration */
15661566 policy = per_cpu(cpufreq_cpu_data, cpu);
15671567 if (policy)
1568− add_cpu_dev_symlink(policy, cpu);
1568+ add_cpu_dev_symlink(policy, cpu, dev);
15691569
15701570 return 0;
15711571 }
drivers/cpufreq/intel_pstate.c+17−0
@@ -338,6 +338,8 @@ static void intel_pstste_sched_itmt_work_fn(struct work_struct *work) · 337 unmodified lines
338338
339339 static DECLARE_WORK(sched_itmt_work, intel_pstste_sched_itmt_work_fn);
340340
341+#define CPPC_MAX_PERF U8_MAX
342+
341343 static void intel_pstate_set_itmt_prio(int cpu)
342344 {
343345 struct cppc_perf_caps cppc_perf;
@@ -348,6 +350,14 @@ static void intel_pstate_set_itmt_prio(int cpu) · 4 unmodified lines
348350 if (ret)
349351 return;
350352
353+ /*
354+ * On some systems with overclocking enabled, CPPC.highest_perf is hardcoded to 0xff.
355+ * In this case we can't use CPPC.highest_perf to enable ITMT.
356+ * In this case we can look at MSR_HWP_CAPABILITIES bits [8:0] to decide.
357+ */
358+ if (cppc_perf.highest_perf == CPPC_MAX_PERF)
359+ cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached));
360+
351361 /*
352362 * The priorities can be set regardless of whether or not
353363 * sched_set_itmt_support(true) has been called and it is valid to
@@ -1006,6 +1016,12 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu) · 652 unmodified lines
10061016 */
10071017 value &= ~GENMASK_ULL(31, 24);
10081018 value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached);
1019+ /*
1020+ * However, make sure that EPP will be set to "performance" when
1021+ * the CPU is brought back online again and the "performance"
1022+ * scaling algorithm is still in effect.
1023+ */
1024+ cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN;
10091025 }
10101026
10111027 /*
@@ -2353,6 +2369,7 @@ static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] __initconst = { · 1341 unmodified lines
23532369 X86_MATCH(BROADWELL_D, core_funcs),
23542370 X86_MATCH(BROADWELL_X, core_funcs),
23552371 X86_MATCH(SKYLAKE_X, core_funcs),
2372+ X86_MATCH(ICELAKE_X, core_funcs),
23562373 {}
23572374 };
23582375
drivers/dma-buf/heaps/system_heap.c+1−1
@@ -290,7 +290,7 @@ static void system_heap_dma_buf_release(struct dma_buf *dmabuf) · 289 unmodified lines
290290 int i;
291291
292292 table = &buffer->sg_table;
293− for_each_sg(table->sgl, sg, table->nents, i) {
293+ for_each_sgtable_sg(table, sg, i) {
294294 struct page *page = sg_page(sg);
295295
296296 __free_pages(page, compound_order(page));
drivers/firmware/arm_scmi/base.c+12−3
@@ -34,6 +34,12 @@ struct scmi_msg_resp_base_attributes { · 33 unmodified lines
3434 __le16 reserved;
3535 };
3636
37+struct scmi_msg_resp_base_discover_agent {
38+ __le32 agent_id;
39+ u8 name[SCMI_MAX_STR_SIZE];
40+};
41+
42+
3743 struct scmi_msg_base_error_notify {
3844 __le32 event_control;
3945 #define BASE_TP_NOTIFY_ALL BIT(0)
@@ -225,18 +231,21 @@ static int scmi_base_discover_agent_get(const struct scmi_protocol_handle *ph, · 185 unmodified lines
225231 int id, char *name)
226232 {
227233 int ret;
234+ struct scmi_msg_resp_base_discover_agent *agent_info;
228235 struct scmi_xfer *t;
229236
230237 ret = ph->xops->xfer_get_init(ph, BASE_DISCOVER_AGENT,
231− sizeof(__le32), SCMI_MAX_STR_SIZE, &t);
238+ sizeof(__le32), sizeof(*agent_info), &t);
232239 if (ret)
233240 return ret;
234241
235242 put_unaligned_le32(id, t->tx.buf);
236243
237244 ret = ph->xops->do_xfer(ph, t);
238− if (!ret)
239− strlcpy(name, t->rx.buf, SCMI_MAX_STR_SIZE);
245+ if (!ret) {
246+ agent_info = t->rx.buf;
247+ strlcpy(name, agent_info->name, SCMI_MAX_STR_SIZE);
248+ }
240249
241250 ph->xops->xfer_put(ph, t);
242251
drivers/firmware/arm_scmi/scmi_pm_domain.c+1−3
@@ -138,9 +138,7 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev) · 137 unmodified lines
138138 scmi_pd_data->domains = domains;
139139 scmi_pd_data->num_domains = num_domains;
140140
141− of_genpd_add_provider_onecell(np, scmi_pd_data);
142−
143− return 0;
141+ return of_genpd_add_provider_onecell(np, scmi_pd_data);
144142 }
145143
146144 static const struct scmi_device_id scmi_id_table[] = {
drivers/firmware/arm_scmi/sensors.c+1−1
@@ -637,7 +637,7 @@ static int scmi_sensor_config_get(const struct scmi_protocol_handle *ph, · 636 unmodified lines
637637 if (ret)
638638 return ret;
639639
640− put_unaligned_le32(cpu_to_le32(sensor_id), t->tx.buf);
640+ put_unaligned_le32(sensor_id, t->tx.buf);
641641 ret = ph->xops->do_xfer(ph, t);
642642 if (!ret) {
643643 struct sensors_info *si = ph->get_priv(ph);
drivers/firmware/arm_scmi/virtio.c+5−5
@@ -82,7 +82,8 @@ static bool scmi_vio_have_vq_rx(struct virtio_device *vdev) · 81 unmodified lines
8282 }
8383
8484 static int scmi_vio_feed_vq_rx(struct scmi_vio_channel *vioch,
85− struct scmi_vio_msg *msg)
85+ struct scmi_vio_msg *msg,
86+ struct device *dev)
8687 {
8788 struct scatterlist sg_in;
8889 int rc;
@@ -94,8 +95,7 @@ static int scmi_vio_feed_vq_rx(struct scmi_vio_channel *vioch, · 5 unmodified lines
9495
9596 rc = virtqueue_add_inbuf(vioch->vqueue, &sg_in, 1, msg, GFP_ATOMIC);
9697 if (rc)
97− dev_err_once(vioch->cinfo->dev,
98− "failed to add to virtqueue (%d)\n", rc);
98+ dev_err_once(dev, "failed to add to virtqueue (%d)\n", rc);
9999 else
100100 virtqueue_kick(vioch->vqueue);
101101
@@ -108,7 +108,7 @@ static void scmi_finalize_message(struct scmi_vio_channel *vioch, · 6 unmodified lines
108108 struct scmi_vio_msg *msg)
109109 {
110110 if (vioch->is_rx) {
111− scmi_vio_feed_vq_rx(vioch, msg);
111+ scmi_vio_feed_vq_rx(vioch, msg, vioch->cinfo->dev);
112112 } else {
113113 /* Here IRQs are assumed to be already disabled by the caller */
114114 spin_lock(&vioch->lock);
@@ -269,7 +269,7 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, · 154 unmodified lines
269269 list_add_tail(&msg->list, &vioch->free_list);
270270 spin_unlock_irqrestore(&vioch->lock, flags);
271271 } else {
272− scmi_vio_feed_vq_rx(vioch, msg);
272+ scmi_vio_feed_vq_rx(vioch, msg, cinfo->dev);
273273 }
274274 }
275275
drivers/firmware/arm_scmi/voltage.c+1−1
@@ -156,7 +156,7 @@ static int scmi_voltage_descriptors_get(const struct scmi_protocol_handle *ph, · 155 unmodified lines
156156 int cnt;
157157
158158 cmd->domain_id = cpu_to_le32(v->id);
159− cmd->level_index = desc_index;
159+ cmd->level_index = cpu_to_le32(desc_index);
160160 ret = ph->xops->do_xfer(ph, tl);
161161 if (ret)
162162 break;
drivers/firmware/smccc/soc_id.c+1−1
@@ -50,7 +50,7 @@ static int __init smccc_soc_init(void) · 49 unmodified lines
5050 arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
5151 ARM_SMCCC_ARCH_SOC_ID, &res);
5252
53− if (res.a0 == SMCCC_RET_NOT_SUPPORTED) {
53+ if ((int)res.a0 == SMCCC_RET_NOT_SUPPORTED) {
5454 pr_info("ARCH_SOC_ID not implemented, skipping ....\n");
5555 return 0;
5656 }
drivers/gpio/Kconfig+1−0
@@ -523,6 +523,7 @@ config GPIO_REG · 522 unmodified lines
523523 config GPIO_ROCKCHIP
524524 tristate "Rockchip GPIO support"
525525 depends on ARCH_ROCKCHIP || COMPILE_TEST
526+ select GENERIC_IRQ_CHIP
526527 select GPIOLIB_IRQCHIP
527528 default ARCH_ROCKCHIP
528529 help
drivers/gpio/gpio-virtio.c+1−1
@@ -434,7 +434,7 @@ static void virtio_gpio_event_vq(struct virtqueue *vq) · 433 unmodified lines
434434 ret = generic_handle_domain_irq(vgpio->gc.irq.domain, gpio);
435435 if (ret)
436436 dev_err(dev, "failed to handle interrupt: %d\n", ret);
437− };
437+ }
438438 }
439439
440440 static void virtio_gpio_request_vq(struct virtqueue *vq)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+5−9
@@ -646,12 +646,6 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem, · 645 unmodified lines
646646 if (IS_ERR(gobj))
647647 return PTR_ERR(gobj);
648648
649− /* Import takes an extra reference on the dmabuf. Drop it now to
650− * avoid leaking it. We only need the one reference in
651− * kgd_mem->dmabuf.
652− */
653− dma_buf_put(mem->dmabuf);
654−
655649 *bo = gem_to_amdgpu_bo(gobj);
656650 (*bo)->flags |= AMDGPU_GEM_CREATE_PREEMPTIBLE;
657651 (*bo)->parent = amdgpu_bo_ref(mem->bo);
@@ -1402,7 +1396,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( · 744 unmodified lines
14021396 struct sg_table *sg = NULL;
14031397 uint64_t user_addr = 0;
14041398 struct amdgpu_bo *bo;
1405− struct drm_gem_object *gobj;
1399+ struct drm_gem_object *gobj = NULL;
14061400 u32 domain, alloc_domain;
14071401 u64 alloc_flags;
14081402 int ret;
@@ -1512,14 +1506,16 @@ allocate_init_user_pages_failed: · 103 unmodified lines
15121506 remove_kgd_mem_from_kfd_bo_list(*mem, avm->process_info);
15131507 drm_vma_node_revoke(&gobj->vma_node, drm_priv);
15141508 err_node_allow:
1515− drm_gem_object_put(gobj);
15161509 /* Don't unreserve system mem limit twice */
15171510 goto err_reserve_limit;
15181511 err_bo_create:
15191512 unreserve_mem_limit(adev, size, alloc_domain, !!sg);
15201513 err_reserve_limit:
15211514 mutex_destroy(&(*mem)->lock);
1522− kfree(*mem);
1515+ if (gobj)
1516+ drm_gem_object_put(gobj);
1517+ else
1518+ kfree(*mem);
15231519 err:
15241520 if (sg) {
15251521 sg_free_table(sg);
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c+12−0
@@ -1569,6 +1569,18 @@ void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev, · 1568 unmodified lines
15691569 WREG32(adev->bios_scratch_reg_offset + 3, tmp);
15701570 }
15711571
1572+void amdgpu_atombios_scratch_regs_set_backlight_level(struct amdgpu_device *adev,
1573+ u32 backlight_level)
1574+{
1575+ u32 tmp = RREG32(adev->bios_scratch_reg_offset + 2);
1576+
1577+ tmp &= ~ATOM_S2_CURRENT_BL_LEVEL_MASK;
1578+ tmp |= (backlight_level << ATOM_S2_CURRENT_BL_LEVEL_SHIFT) &
1579+ ATOM_S2_CURRENT_BL_LEVEL_MASK;
1580+
1581+ WREG32(adev->bios_scratch_reg_offset + 2, tmp);
1582+}
1583+
15721584 bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev)
15731585 {
15741586 u32 tmp = RREG32(adev->bios_scratch_reg_offset + 7);
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h+2−0
@@ -185,6 +185,8 @@ bool amdgpu_atombios_has_gpu_virtualization_table(struct amdgpu_device *adev); · 184 unmodified lines
185185 void amdgpu_atombios_scratch_regs_lock(struct amdgpu_device *adev, bool lock);
186186 void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev,
187187 bool hung);
188+void amdgpu_atombios_scratch_regs_set_backlight_level(struct amdgpu_device *adev,
189+ u32 backlight_level);
188190 bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev);
189191
190192 void amdgpu_atombios_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le);
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c+1−0
@@ -827,6 +827,7 @@ static int amdgpu_connector_vga_get_modes(struct drm_connector *connector) · 826 unmodified lines
827827
828828 amdgpu_connector_get_edid(connector);
829829 ret = amdgpu_connector_ddc_get_modes(connector);
830+ amdgpu_get_native_mode(connector);
830831
831832 return ret;
832833 }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+11−5
@@ -3509,6 +3509,9 @@ int amdgpu_device_init(struct amdgpu_device *adev, · 3508 unmodified lines
35093509 adev->rmmio_size = pci_resource_len(adev->pdev, 2);
35103510 }
35113511
3512+ for (i = 0; i < AMD_IP_BLOCK_TYPE_NUM; i++)
3513+ atomic_set(&adev->pm.pwr_state[i], POWER_STATE_UNKNOWN);
3514+
35123515 adev->rmmio = ioremap(adev->rmmio_base, adev->rmmio_size);
35133516 if (adev->rmmio == NULL) {
35143517 return -ENOMEM;
@@ -3830,7 +3833,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev) · 315 unmodified lines
38303833 /* disable all interrupts */
38313834 amdgpu_irq_disable_all(adev);
38323835 if (adev->mode_info.mode_config_initialized){
3833− if (!amdgpu_device_has_dc_support(adev))
3836+ if (!drm_drv_uses_atomic_modeset(adev_to_drm(adev)))
38343837 drm_helper_force_disable_all(adev_to_drm(adev));
38353838 else
38363839 drm_atomic_helper_shutdown(adev_to_drm(adev));
@@ -4286,6 +4289,8 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev, · 449 unmodified lines
42864289 {
42874290 int r;
42884291
4292+ amdgpu_amdkfd_pre_reset(adev);
4293+
42894294 if (from_hypervisor)
42904295 r = amdgpu_virt_request_full_gpu(adev, true);
42914296 else
@@ -5028,7 +5033,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · 736 unmodified lines
50285033
50295034 cancel_delayed_work_sync(&tmp_adev->delayed_init_work);
50305035
5031− amdgpu_amdkfd_pre_reset(tmp_adev);
5036+ if (!amdgpu_sriov_vf(tmp_adev))
5037+ amdgpu_amdkfd_pre_reset(tmp_adev);
50325038
50335039 /*
50345040 * Mark these ASICs to be reseted as untracked first
@@ -5086,7 +5092,7 @@ retry: /* Rest of adevs pre asic reset from XGMI hive. */ · 51 unmodified lines
50865092
50875093 tmp_vram_lost_counter = atomic_read(&((adev)->vram_lost_counter));
50885094 /* Actual ASIC resets if needed.*/
5089− /* TODO Implement XGMI hive reset logic for SRIOV */
5095+ /* Host driver will handle XGMI hive reset for SRIOV */
50905096 if (amdgpu_sriov_vf(adev)) {
50915097 r = amdgpu_device_reset_sriov(adev, job ? false : true);
50925098 if (r)
@@ -5127,7 +5133,7 @@ skip_hw_reset: · 34 unmodified lines
51275133 drm_sched_start(&ring->sched, !tmp_adev->asic_reset_res);
51285134 }
51295135
5130− if (!amdgpu_device_has_dc_support(tmp_adev) && !job_signaled) {
5136+ if (!drm_drv_uses_atomic_modeset(adev_to_drm(tmp_adev)) && !job_signaled) {
51315137 drm_helper_resume_force_mode(adev_to_drm(tmp_adev));
51325138 }
51335139
@@ -5148,7 +5154,7 @@ skip_sched_resume: · 14 unmodified lines
51485154 list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
51495155 /* unlock kfd: SRIOV would do it separately */
51505156 if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev))
5151− amdgpu_amdkfd_post_reset(tmp_adev);
5157+ amdgpu_amdkfd_post_reset(tmp_adev);
51525158
51535159 /* kfd_post_reset will do nothing if kfd device is not initialized,
51545160 * need to bring up kfd here if it's not be initialized before
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c+45−6
@@ -157,6 +157,8 @@ static int hw_id_map[MAX_HWIP] = { · 156 unmodified lines
157157 [HDP_HWIP] = HDP_HWID,
158158 [SDMA0_HWIP] = SDMA0_HWID,
159159 [SDMA1_HWIP] = SDMA1_HWID,
160+ [SDMA2_HWIP] = SDMA2_HWID,
161+ [SDMA3_HWIP] = SDMA3_HWID,
160162 [MMHUB_HWIP] = MMHUB_HWID,
161163 [ATHUB_HWIP] = ATHUB_HWID,
162164 [NBIO_HWIP] = NBIF_HWID,
@@ -248,8 +250,8 @@ get_from_vram: · 85 unmodified lines
248250
249251 offset = offsetof(struct binary_header, binary_checksum) +
250252 sizeof(bhdr->binary_checksum);
251− size = bhdr->binary_size - offset;
252− checksum = bhdr->binary_checksum;
253+ size = le16_to_cpu(bhdr->binary_size) - offset;
254+ checksum = le16_to_cpu(bhdr->binary_checksum);
253255
254256 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
255257 size, checksum)) {
@@ -270,7 +272,7 @@ get_from_vram: · 14 unmodified lines
270272 }
271273
272274 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
273− ihdr->size, checksum)) {
275+ le16_to_cpu(ihdr->size), checksum)) {
274276 DRM_ERROR("invalid ip discovery data table checksum\n");
275277 r = -EINVAL;
276278 goto out;
@@ -282,7 +284,7 @@ get_from_vram: · 5 unmodified lines
282284 ghdr = (struct gpu_info_header *)(adev->mman.discovery_bin + offset);
283285
284286 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
285− ghdr->size, checksum)) {
287+ le32_to_cpu(ghdr->size), checksum)) {
286288 DRM_ERROR("invalid gc data table checksum\n");
287289 r = -EINVAL;
288290 goto out;
@@ -489,10 +491,10 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev) · 200 unmodified lines
489491 le16_to_cpu(bhdr->table_list[HARVEST_INFO].offset));
490492
491493 for (i = 0; i < 32; i++) {
492− if (le32_to_cpu(harvest_info->list[i].hw_id) == 0)
494+ if (le16_to_cpu(harvest_info->list[i].hw_id) == 0)
493495 break;
494496
495− switch (le32_to_cpu(harvest_info->list[i].hw_id)) {
497+ switch (le16_to_cpu(harvest_info->list[i].hw_id)) {
496498 case VCN_HWID:
497499 vcn_harvest_count++;
498500 if (harvest_info->list[i].number_instance == 0)
@@ -587,6 +589,9 @@ static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev) · 88 unmodified lines
587589 amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
588590 break;
589591 default:
592+ dev_err(adev->dev,
593+ "Failed to add common ip block(GC_HWIP:0x%x)\n",
594+ adev->ip_versions[GC_HWIP][0]);
590595 return -EINVAL;
591596 }
592597 return 0;
@@ -619,6 +624,9 @@ static int amdgpu_discovery_set_gmc_ip_blocks(struct amdgpu_device *adev) · 26 unmodified lines
619624 amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
620625 break;
621626 default:
627+ dev_err(adev->dev,
628+ "Failed to add gmc ip block(GC_HWIP:0x%x)\n",
629+ adev->ip_versions[GC_HWIP][0]);
622630 return -EINVAL;
623631 }
624632 return 0;
@@ -648,6 +656,9 @@ static int amdgpu_discovery_set_ih_ip_blocks(struct amdgpu_device *adev) · 23 unmodified lines
648656 amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
649657 break;
650658 default:
659+ dev_err(adev->dev,
660+ "Failed to add ih ip block(OSSSYS_HWIP:0x%x)\n",
661+ adev->ip_versions[OSSSYS_HWIP][0]);
651662 return -EINVAL;
652663 }
653664 return 0;
@@ -688,6 +699,9 @@ static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev) · 34 unmodified lines
688699 amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block);
689700 break;
690701 default:
702+ dev_err(adev->dev,
703+ "Failed to add psp ip block(MP0_HWIP:0x%x)\n",
704+ adev->ip_versions[MP0_HWIP][0]);
691705 return -EINVAL;
692706 }
693707 return 0;
@@ -726,6 +740,9 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev) · 32 unmodified lines
726740 amdgpu_device_ip_block_add(adev, &smu_v13_0_ip_block);
727741 break;
728742 default:
743+ dev_err(adev->dev,
744+ "Failed to add smu ip block(MP1_HWIP:0x%x)\n",
745+ adev->ip_versions[MP1_HWIP][0]);
729746 return -EINVAL;
730747 }
731748 return 0;
@@ -753,6 +770,9 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev) · 21 unmodified lines
753770 amdgpu_device_ip_block_add(adev, &dm_ip_block);
754771 break;
755772 default:
773+ dev_err(adev->dev,
774+ "Failed to add dm ip block(DCE_HWIP:0x%x)\n",
775+ adev->ip_versions[DCE_HWIP][0]);
756776 return -EINVAL;
757777 }
758778 } else if (adev->ip_versions[DCI_HWIP][0]) {
@@ -763,6 +783,9 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev) · 4 unmodified lines
763783 amdgpu_device_ip_block_add(adev, &dm_ip_block);
764784 break;
765785 default:
786+ dev_err(adev->dev,
787+ "Failed to add dm ip block(DCI_HWIP:0x%x)\n",
788+ adev->ip_versions[DCI_HWIP][0]);
766789 return -EINVAL;
767790 }
768791 #endif
@@ -796,6 +819,9 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev) · 27 unmodified lines
796819 amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
797820 break;
798821 default:
822+ dev_err(adev->dev,
823+ "Failed to add gfx ip block(GC_HWIP:0x%x)\n",
824+ adev->ip_versions[GC_HWIP][0]);
799825 return -EINVAL;
800826 }
801827 return 0;
@@ -829,6 +855,9 @@ static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev) · 27 unmodified lines
829855 amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
830856 break;
831857 default:
858+ dev_err(adev->dev,
859+ "Failed to add sdma ip block(SDMA0_HWIP:0x%x)\n",
860+ adev->ip_versions[SDMA0_HWIP][0]);
832861 return -EINVAL;
833862 }
834863 return 0;
@@ -845,6 +874,9 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev) · 10 unmodified lines
845874 amdgpu_device_ip_block_add(adev, &uvd_v7_0_ip_block);
846875 break;
847876 default:
877+ dev_err(adev->dev,
878+ "Failed to add uvd v7 ip block(UVD_HWIP:0x%x)\n",
879+ adev->ip_versions[UVD_HWIP][0]);
848880 return -EINVAL;
849881 }
850882 switch (adev->ip_versions[VCE_HWIP][0]) {
@@ -855,6 +887,9 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev) · 4 unmodified lines
855887 amdgpu_device_ip_block_add(adev, &vce_v4_0_ip_block);
856888 break;
857889 default:
890+ dev_err(adev->dev,
891+ "Failed to add VCE v4 ip block(VCE_HWIP:0x%x)\n",
892+ adev->ip_versions[VCE_HWIP][0]);
858893 return -EINVAL;
859894 }
860895 } else {
@@ -885,6 +920,7 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev) · 24 unmodified lines
885920 case IP_VERSION(3, 0, 64):
886921 case IP_VERSION(3, 1, 1):
887922 case IP_VERSION(3, 0, 2):
923+ case IP_VERSION(3, 0, 192):
888924 amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
889925 if (!amdgpu_sriov_vf(adev))
890926 amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
@@ -893,6 +929,9 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev) · 2 unmodified lines
893929 amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
894930 break;
895931 default:
932+ dev_err(adev->dev,
933+ "Failed to add vcn/jpeg ip block(UVD_HWIP:0x%x)\n",
934+ adev->ip_versions[UVD_HWIP][0]);
896935 return -EINVAL;
897936 }
898937 }
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c+2−1
@@ -223,7 +223,7 @@ int amdgpu_ih_wait_on_checkpoint_process(struct amdgpu_device *adev, · 222 unmodified lines
223223 */
224224 int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih)
225225 {
226− unsigned int count = AMDGPU_IH_MAX_NUM_IVS;
226+ unsigned int count;
227227 u32 wptr;
228228
229229 if (!ih->enabled || adev->shutdown)
@@ -232,6 +232,7 @@ int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih) · 2 unmodified lines
232232 wptr = amdgpu_ih_get_wptr(adev, ih);
233233
234234 restart_ih:
235+ count = AMDGPU_IH_MAX_NUM_IVS;
235236 DRM_DEBUG("%s: rptr %d, wptr %d\n", __func__, ih->rptr, wptr);
236237
237238 /* Order reading of wptr vs. reading of IH ring data */
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c+1−0
@@ -135,6 +135,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 134 unmodified lines
135135 break;
136136 case IP_VERSION(3, 0, 0):
137137 case IP_VERSION(3, 0, 64):
138+ case IP_VERSION(3, 0, 192):
138139 if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
139140 fw_name = FIRMWARE_SIENNA_CICHLID;
140141 else
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c+2−2
@@ -504,8 +504,8 @@ static int amdgpu_vkms_sw_fini(void *handle) · 503 unmodified lines
504504 int i = 0;
505505
506506 for (i = 0; i < adev->mode_info.num_crtc; i++)
507− if (adev->mode_info.crtcs[i])
508− hrtimer_cancel(&adev->mode_info.crtcs[i]->vblank_timer);
507+ if (adev->amdgpu_vkms_output[i].vblank_hrtimer.function)
508+ hrtimer_cancel(&adev->amdgpu_vkms_output[i].vblank_hrtimer);
509509
510510 kfree(adev->mode_info.bios_hardcoded_edid);
511511 kfree(adev->amdgpu_vkms_output);
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c+1−0
@@ -386,6 +386,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev) · 385 unmodified lines
386386 "%s", "xgmi_hive_info");
387387 if (ret) {
388388 dev_err(adev->dev, "XGMI: failed initializing kobject for xgmi hive\n");
389+ kobject_put(&hive->kobj);
389390 kfree(hive);
390391 hive = NULL;
391392 goto pro_end;
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+13−2
@@ -7707,8 +7707,19 @@ static uint64_t gfx_v10_0_get_gpu_clock_counter(struct amdgpu_device *adev) · 7706 unmodified lines
77077707 switch (adev->ip_versions[GC_HWIP][0]) {
77087708 case IP_VERSION(10, 3, 1):
77097709 case IP_VERSION(10, 3, 3):
7710− clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh) |
7711− ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh) << 32ULL);
7710+ preempt_disable();
7711+ clock_hi = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh);
7712+ clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh);
7713+ hi_check = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh);
7714+ /* The SMUIO TSC clock frequency is 100MHz, which sets 32-bit carry over
7715+ * roughly every 42 seconds.
7716+ */
7717+ if (hi_check != clock_hi) {
7718+ clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh);
7719+ clock_hi = hi_check;
7720+ }
7721+ preempt_enable();
7722+ clock = clock_lo | (clock_hi << 32ULL);
77127723 break;
77137724 default:
77147725 preempt_disable();
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+39−14
@@ -140,6 +140,11 @@ MODULE_FIRMWARE("amdgpu/aldebaran_rlc.bin"); · 139 unmodified lines
140140 #define mmTCP_CHAN_STEER_5_ARCT 0x0b0c
141141 #define mmTCP_CHAN_STEER_5_ARCT_BASE_IDX 0
142142
143+#define mmGOLDEN_TSC_COUNT_UPPER_Renoir 0x0025
144+#define mmGOLDEN_TSC_COUNT_UPPER_Renoir_BASE_IDX 1
145+#define mmGOLDEN_TSC_COUNT_LOWER_Renoir 0x0026
146+#define mmGOLDEN_TSC_COUNT_LOWER_Renoir_BASE_IDX 1
147+
143148 enum ta_ras_gfx_subblock {
144149 /*CPC*/
145150 TA_RAS_BLOCK__GFX_CPC_INDEX_START = 0,
@@ -4055,9 +4060,10 @@ static int gfx_v9_0_hw_fini(void *handle) · 3909 unmodified lines
40554060
40564061 gfx_v9_0_cp_enable(adev, false);
40574062
4058− /* Skip suspend with A+A reset */
4059− if (adev->gmc.xgmi.connected_to_cpu && amdgpu_in_reset(adev)) {
4060− dev_dbg(adev->dev, "Device in reset. Skipping RLC halt\n");
4063+ /* Skip stopping RLC with A+A reset or when RLC controls GFX clock */
4064+ if ((adev->gmc.xgmi.connected_to_cpu && amdgpu_in_reset(adev)) ||
4065+ (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(9, 4, 2))) {
4066+ dev_dbg(adev->dev, "Skipping RLC halt\n");
40614067 return 0;
40624068 }
40634069
@@ -4238,19 +4244,38 @@ failed_kiq_read: · 174 unmodified lines
42384244
42394245 static uint64_t gfx_v9_0_get_gpu_clock_counter(struct amdgpu_device *adev)
42404246 {
4241− uint64_t clock;
4247+ uint64_t clock, clock_lo, clock_hi, hi_check;
42424248
4243− amdgpu_gfx_off_ctrl(adev, false);
4244− mutex_lock(&adev->gfx.gpu_clock_mutex);
4245− if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 0, 1) && amdgpu_sriov_runtime(adev)) {
4246− clock = gfx_v9_0_kiq_read_clock(adev);
4247− } else {
4248− WREG32_SOC15(GC, 0, mmRLC_CAPTURE_GPU_CLOCK_COUNT, 1);
4249− clock = (uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_LSB) |
4250− ((uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_MSB) << 32ULL);
4249+ switch (adev->ip_versions[GC_HWIP][0]) {
4250+ case IP_VERSION(9, 3, 0):
4251+ preempt_disable();
4252+ clock_hi = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Renoir);
4253+ clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Renoir);
4254+ hi_check = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Renoir);
4255+ /* The SMUIO TSC clock frequency is 100MHz, which sets 32-bit carry over
4256+ * roughly every 42 seconds.
4257+ */
4258+ if (hi_check != clock_hi) {
4259+ clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Renoir);
4260+ clock_hi = hi_check;
4261+ }
4262+ preempt_enable();
4263+ clock = clock_lo | (clock_hi << 32ULL);
4264+ break;
4265+ default:
4266+ amdgpu_gfx_off_ctrl(adev, false);
4267+ mutex_lock(&adev->gfx.gpu_clock_mutex);
4268+ if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 0, 1) && amdgpu_sriov_runtime(adev)) {
4269+ clock = gfx_v9_0_kiq_read_clock(adev);
4270+ } else {
4271+ WREG32_SOC15(GC, 0, mmRLC_CAPTURE_GPU_CLOCK_COUNT, 1);
4272+ clock = (uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_LSB) |
4273+ ((uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_MSB) << 32ULL);
4274+ }
4275+ mutex_unlock(&adev->gfx.gpu_clock_mutex);
4276+ amdgpu_gfx_off_ctrl(adev, true);
4277+ break;
42514278 }
4252− mutex_unlock(&adev->gfx.gpu_clock_mutex);
4253− amdgpu_gfx_off_ctrl(adev, true);
42544279 return clock;
42554280 }
42564281
drivers/gpu/drm/amd/amdgpu/navi10_ih.c+13−21
@@ -160,6 +160,7 @@ static int navi10_ih_toggle_ring_interrupts(struct amdgpu_device *adev, · 159 unmodified lines
160160
161161 tmp = RREG32(ih_regs->ih_rb_cntl);
162162 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, RB_ENABLE, (enable ? 1 : 0));
163+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, RB_GPU_TS_ENABLE, 1);
163164 /* enable_intr field is only valid in ring0 */
164165 if (ih == &adev->irq.ih)
165166 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, ENABLE_INTR, (enable ? 1 : 0));
@@ -275,10 +276,8 @@ static int navi10_ih_enable_ring(struct amdgpu_device *adev, · 109 unmodified lines
275276 tmp = navi10_ih_rb_cntl(ih, tmp);
276277 if (ih == &adev->irq.ih)
277278 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, RPTR_REARM, !!adev->irq.msi_enabled);
278− if (ih == &adev->irq.ih1) {
279− tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_ENABLE, 0);
279+ if (ih == &adev->irq.ih1)
280280 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, RB_FULL_DRAIN_ENABLE, 1);
281− }
282281
283282 if (amdgpu_sriov_vf(adev) && amdgpu_sriov_reg_indirect_ih(adev)) {
284283 if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) {
@@ -319,7 +318,6 @@ static int navi10_ih_irq_init(struct amdgpu_device *adev) · 34 unmodified lines
319318 {
320319 struct amdgpu_ih_ring *ih[] = {&adev->irq.ih, &adev->irq.ih1, &adev->irq.ih2};
321320 u32 ih_chicken;
322− u32 tmp;
323321 int ret;
324322 int i;
325323
@@ -363,15 +361,6 @@ static int navi10_ih_irq_init(struct amdgpu_device *adev) · 37 unmodified lines
363361 adev->nbio.funcs->ih_doorbell_range(adev, ih[0]->use_doorbell,
364362 ih[0]->doorbell_index);
365363
366− tmp = RREG32_SOC15(OSSSYS, 0, mmIH_STORM_CLIENT_LIST_CNTL);
367− tmp = REG_SET_FIELD(tmp, IH_STORM_CLIENT_LIST_CNTL,
368− CLIENT18_IS_STORM_CLIENT, 1);
369− WREG32_SOC15(OSSSYS, 0, mmIH_STORM_CLIENT_LIST_CNTL, tmp);
370−
371− tmp = RREG32_SOC15(OSSSYS, 0, mmIH_INT_FLOOD_CNTL);
372− tmp = REG_SET_FIELD(tmp, IH_INT_FLOOD_CNTL, FLOOD_CNTL_ENABLE, 1);
373− WREG32_SOC15(OSSSYS, 0, mmIH_INT_FLOOD_CNTL, tmp);
374−
375364 pci_set_master(adev->pdev);
376365
377366 /* enable interrupts */
@@ -420,12 +409,19 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev, · 42 unmodified lines
420409 u32 wptr, tmp;
421410 struct amdgpu_ih_regs *ih_regs;
422411
423− wptr = le32_to_cpu(*ih->wptr_cpu);
424− ih_regs = &ih->ih_regs;
412+ if (ih == &adev->irq.ih) {
413+ /* Only ring0 supports writeback. On other rings fall back
414+ * to register-based code with overflow checking below.
415+ */
416+ wptr = le32_to_cpu(*ih->wptr_cpu);
425417
426− if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
427− goto out;
418+ if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
419+ goto out;
420+ }
428421
422+ ih_regs = &ih->ih_regs;
423+
424+ /* Double check that the overflow wasn't already cleared. */
429425 wptr = RREG32_NO_KIQ(ih_regs->ih_rb_wptr);
430426 if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
431427 goto out;
@@ -513,15 +509,11 @@ static int navi10_ih_self_irq(struct amdgpu_device *adev, · 81 unmodified lines
513509 struct amdgpu_irq_src *source,
514510 struct amdgpu_iv_entry *entry)
515511 {
516− uint32_t wptr = cpu_to_le32(entry->src_data[0]);
517−
518512 switch (entry->ring_id) {
519513 case 1:
520− *adev->irq.ih1.wptr_cpu = wptr;
521514 schedule_work(&adev->irq.ih1_work);
522515 break;
523516 case 2:
524− *adev->irq.ih2.wptr_cpu = wptr;
525517 schedule_work(&adev->irq.ih2_work);
526518 break;
527519 default: break;
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c+4−0
@@ -359,6 +359,10 @@ static void nbio_v2_3_init_registers(struct amdgpu_device *adev) · 358 unmodified lines
359359
360360 if (def != data)
361361 WREG32_PCIE(smnPCIE_CONFIG_CNTL, data);
362+
363+ if (amdgpu_sriov_vf(adev))
364+ adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
365+ mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
362366 }
363367
364368 #define NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT 0x00000000 // off by default, no gains over L1
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c+4−0
@@ -276,6 +276,10 @@ static void nbio_v6_1_init_registers(struct amdgpu_device *adev) · 275 unmodified lines
276276
277277 if (def != data)
278278 WREG32_PCIE(smnPCIE_CI_CNTL, data);
279+
280+ if (amdgpu_sriov_vf(adev))
281+ adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
282+ mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
279283 }
280284
281285 static void nbio_v6_1_program_ltr(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c+3−1
@@ -273,7 +273,9 @@ const struct nbio_hdp_flush_reg nbio_v7_0_hdp_flush_reg = { · 272 unmodified lines
273273
274274 static void nbio_v7_0_init_registers(struct amdgpu_device *adev)
275275 {
276−
276+ if (amdgpu_sriov_vf(adev))
277+ adev->rmmio_remap.reg_offset =
278+ SOC15_REG_OFFSET(NBIO, 0, mmHDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
277279 }
278280
279281 const struct amdgpu_nbio_funcs nbio_v7_0_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c+4−0
@@ -371,6 +371,10 @@ static void nbio_v7_2_init_registers(struct amdgpu_device *adev) · 370 unmodified lines
371371 if (def != data)
372372 WREG32_PCIE_PORT(SOC15_REG_OFFSET(NBIO, 0, regPCIE_CONFIG_CNTL), data);
373373 }
374+
375+ if (amdgpu_sriov_vf(adev))
376+ adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
377+ regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
374378 }
375379
376380 const struct amdgpu_nbio_funcs nbio_v7_2_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c+6−1
@@ -362,7 +362,9 @@ const struct nbio_hdp_flush_reg nbio_v7_4_hdp_flush_reg_ald = { · 361 unmodified lines
362362
363363 static void nbio_v7_4_init_registers(struct amdgpu_device *adev)
364364 {
365−
365+ if (amdgpu_sriov_vf(adev))
366+ adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
367+ mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
366368 }
367369
368370 static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device *adev)
@@ -692,6 +694,9 @@ static void nbio_v7_4_program_aspm(struct amdgpu_device *adev) · 323 unmodified lines
692694 {
693695 uint32_t def, data;
694696
697+ if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(7, 4, 4))
698+ return;
699+
695700 def = data = RREG32_PCIE(smnPCIE_LC_CNTL);
696701 data &= ~PCIE_LC_CNTL__LC_L1_INACTIVITY_MASK;
697702 data &= ~PCIE_LC_CNTL__LC_L0S_INACTIVITY_MASK;
drivers/gpu/drm/amd/amdgpu/nv.c+6−3
@@ -183,6 +183,7 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode, · 182 unmodified lines
183183 switch (adev->ip_versions[UVD_HWIP][0]) {
184184 case IP_VERSION(3, 0, 0):
185185 case IP_VERSION(3, 0, 64):
186+ case IP_VERSION(3, 0, 192):
186187 if (amdgpu_sriov_vf(adev)) {
187188 if (encode)
188189 *codecs = &sriov_sc_video_codecs_encode;
@@ -731,8 +732,10 @@ static int nv_common_early_init(void *handle) · 542 unmodified lines
731732 #define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)
732733 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
733734
734− adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET;
735− adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET;
735+ if (!amdgpu_sriov_vf(adev)) {
736+ adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET;
737+ adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET;
738+ }
736739 adev->smc_rreg = NULL;
737740 adev->smc_wreg = NULL;
738741 adev->pcie_rreg = &nv_pcie_rreg;
@@ -1032,7 +1035,7 @@ static int nv_common_hw_init(void *handle) · 293 unmodified lines
10321035 * for the purpose of expose those registers
10331036 * to process space
10341037 */
1035− if (adev->nbio.funcs->remap_hdp_registers)
1038+ if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
10361039 adev->nbio.funcs->remap_hdp_registers(adev);
10371040 /* enable the doorbell aperture */
10381041 nv_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc15.c+5−3
@@ -971,8 +971,10 @@ static int soc15_common_early_init(void *handle) · 970 unmodified lines
971971 #define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)
972972 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
973973
974− adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET;
975− adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET;
974+ if (!amdgpu_sriov_vf(adev)) {
975+ adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET;
976+ adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET;
977+ }
976978 adev->smc_rreg = NULL;
977979 adev->smc_wreg = NULL;
978980 adev->pcie_rreg = &soc15_pcie_rreg;
@@ -1285,7 +1287,7 @@ static int soc15_common_hw_init(void *handle) · 306 unmodified lines
12851287 * for the purpose of expose those registers
12861288 * to process space
12871289 */
1288− if (adev->nbio.funcs->remap_hdp_registers)
1290+ if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
12891291 adev->nbio.funcs->remap_hdp_registers(adev);
12901292
12911293 /* enable the doorbell aperture */
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c+5−0
@@ -1226,6 +1226,11 @@ static int stop_cpsch(struct device_queue_manager *dqm) · 1225 unmodified lines
12261226 bool hanging;
12271227
12281228 dqm_lock(dqm);
1229+ if (!dqm->sched_running) {
1230+ dqm_unlock(dqm);
1231+ return 0;
1232+ }
1233+
12291234 if (!dqm->is_hws_hang)
12301235 unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0);
12311236 hanging = dqm->is_hws_hang || dqm->is_resetting;
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+1−1
@@ -766,7 +766,7 @@ struct svm_range_list { · 765 unmodified lines
766766 struct list_head deferred_range_list;
767767 spinlock_t deferred_list_lock;
768768 atomic_t evicted_ranges;
769− bool drain_pagefaults;
769+ atomic_t drain_pagefaults;
770770 struct delayed_work restore_work;
771771 DECLARE_BITMAP(bitmap_supported, MAX_GPU_INSTANCE);
772772 struct task_struct *faulting_task;
drivers/gpu/drm/amd/amdkfd/kfd_svm.c+73−51
@@ -1574,7 +1574,6 @@ retry_flush_work: · 1573 unmodified lines
15741574 static void svm_range_restore_work(struct work_struct *work)
15751575 {
15761576 struct delayed_work *dwork = to_delayed_work(work);
1577− struct amdkfd_process_info *process_info;
15781577 struct svm_range_list *svms;
15791578 struct svm_range *prange;
15801579 struct kfd_process *p;
@@ -1594,12 +1593,10 @@ static void svm_range_restore_work(struct work_struct *work) · 13 unmodified lines
15941593 * the lifetime of this thread, kfd_process and mm will be valid.
15951594 */
15961595 p = container_of(svms, struct kfd_process, svms);
1597− process_info = p->kgd_process_info;
15981596 mm = p->mm;
15991597 if (!mm)
16001598 return;
16011599
1602− mutex_lock(&process_info->lock);
16031600 svm_range_list_lock_and_flush_work(svms, mm);
16041601 mutex_lock(&svms->lock);
16051602
@@ -1652,7 +1649,6 @@ static void svm_range_restore_work(struct work_struct *work) · 46 unmodified lines
16521649 out_reschedule:
16531650 mutex_unlock(&svms->lock);
16541651 mmap_write_unlock(mm);
1655− mutex_unlock(&process_info->lock);
16561652
16571653 /* If validation failed, reschedule another attempt */
16581654 if (evicted_ranges) {
@@ -1968,10 +1964,16 @@ static void svm_range_drain_retry_fault(struct svm_range_list *svms) · 309 unmodified lines
19681964 struct kfd_process_device *pdd;
19691965 struct amdgpu_device *adev;
19701966 struct kfd_process *p;
1967+ int drain;
19711968 uint32_t i;
19721969
19731970 p = container_of(svms, struct kfd_process, svms);
19741971
1972+restart:
1973+ drain = atomic_read(&svms->drain_pagefaults);
1974+ if (!drain)
1975+ return;
1976+
19751977 for_each_set_bit(i, svms->bitmap_supported, p->n_pdds) {
19761978 pdd = p->pdds[i];
19771979 if (!pdd)
@@ -1983,6 +1985,8 @@ static void svm_range_drain_retry_fault(struct svm_range_list *svms) · 5 unmodified lines
19831985 amdgpu_ih_wait_on_checkpoint_process(adev, &adev->irq.ih1);
19841986 pr_debug("drain retry fault gpu %d svms 0x%p done\n", i, svms);
19851987 }
1988+ if (atomic_cmpxchg(&svms->drain_pagefaults, drain, 0) != drain)
1989+ goto restart;
19861990 }
19871991
19881992 static void svm_range_deferred_list_work(struct work_struct *work)
@@ -1990,43 +1994,41 @@ static void svm_range_deferred_list_work(struct work_struct *work) · 1 unmodified line
19901994 struct svm_range_list *svms;
19911995 struct svm_range *prange;
19921996 struct mm_struct *mm;
1997+ struct kfd_process *p;
19931998
19941999 svms = container_of(work, struct svm_range_list, deferred_list_work);
19952000 pr_debug("enter svms 0x%p\n", svms);
19962001
2002+ p = container_of(svms, struct kfd_process, svms);
2003+ /* Avoid mm is gone when inserting mmu notifier */
2004+ mm = get_task_mm(p->lead_thread);
2005+ if (!mm) {
2006+ pr_debug("svms 0x%p process mm gone\n", svms);
2007+ return;
2008+ }
2009+retry:
2010+ mmap_write_lock(mm);
2011+
2012+ /* Checking for the need to drain retry faults must be inside
2013+ * mmap write lock to serialize with munmap notifiers.
2014+ */
2015+ if (unlikely(atomic_read(&svms->drain_pagefaults))) {
2016+ mmap_write_unlock(mm);
2017+ svm_range_drain_retry_fault(svms);
2018+ goto retry;
2019+ }
2020+
19972021 spin_lock(&svms->deferred_list_lock);
19982022 while (!list_empty(&svms->deferred_range_list)) {
19992023 prange = list_first_entry(&svms->deferred_range_list,
20002024 struct svm_range, deferred_list);
2025+ list_del_init(&prange->deferred_list);
20012026 spin_unlock(&svms->deferred_list_lock);
2027+
20022028 pr_debug("prange 0x%p [0x%lx 0x%lx] op %d\n", prange,
20032029 prange->start, prange->last, prange->work_item.op);
20042030
2005− mm = prange->work_item.mm;
2006−retry:
2007− mmap_write_lock(mm);
20082031 mutex_lock(&svms->lock);
2009−
2010− /* Checking for the need to drain retry faults must be in
2011− * mmap write lock to serialize with munmap notifiers.
2012− *
2013− * Remove from deferred_list must be inside mmap write lock,
2014− * otherwise, svm_range_list_lock_and_flush_work may hold mmap
2015− * write lock, and continue because deferred_list is empty, then
2016− * deferred_list handle is blocked by mmap write lock.
2017− */
2018− spin_lock(&svms->deferred_list_lock);
2019− if (unlikely(svms->drain_pagefaults)) {
2020− svms->drain_pagefaults = false;
2021− spin_unlock(&svms->deferred_list_lock);
2022− mutex_unlock(&svms->lock);
2023− mmap_write_unlock(mm);
2024− svm_range_drain_retry_fault(svms);
2025− goto retry;
2026− }
2027− list_del_init(&prange->deferred_list);
2028− spin_unlock(&svms->deferred_list_lock);
2029−
20302032 mutex_lock(&prange->migrate_mutex);
20312033 while (!list_empty(&prange->child_list)) {
20322034 struct svm_range *pchild;
@@ -2042,12 +2044,13 @@ retry: · 9 unmodified lines
20422044
20432045 svm_range_handle_list_op(svms, prange);
20442046 mutex_unlock(&svms->lock);
2045− mmap_write_unlock(mm);
20462047
20472048 spin_lock(&svms->deferred_list_lock);
20482049 }
20492050 spin_unlock(&svms->deferred_list_lock);
20502051
2052+ mmap_write_unlock(mm);
2053+ mmput(mm);
20512054 pr_debug("exit svms 0x%p\n", svms);
20522055 }
20532056
@@ -2056,12 +2059,6 @@ svm_range_add_list_work(struct svm_range_list *svms, struct svm_range *prange, · 2 unmodified lines
20562059 struct mm_struct *mm, enum svm_work_list_ops op)
20572060 {
20582061 spin_lock(&svms->deferred_list_lock);
2059− /* Make sure pending page faults are drained in the deferred worker
2060− * before the range is freed to avoid straggler interrupts on
2061− * unmapped memory causing "phantom faults".
2062− */
2063− if (op == SVM_OP_UNMAP_RANGE)
2064− svms->drain_pagefaults = true;
20652062 /* if prange is on the deferred list */
20662063 if (!list_empty(&prange->deferred_list)) {
20672064 pr_debug("update exist prange 0x%p work op %d\n", prange, op);
@@ -2140,6 +2137,12 @@ svm_range_unmap_from_cpu(struct mm_struct *mm, struct svm_range *prange, · 72 unmodified lines
21402137 pr_debug("svms 0x%p prange 0x%p [0x%lx 0x%lx] [0x%lx 0x%lx]\n", svms,
21412138 prange, prange->start, prange->last, start, last);
21422139
2140+ /* Make sure pending page faults are drained in the deferred worker
2141+ * before the range is freed to avoid straggler interrupts on
2142+ * unmapped memory causing "phantom faults".
2143+ */
2144+ atomic_inc(&svms->drain_pagefaults);
2145+
21432146 unmap_parent = start <= prange->start && last >= prange->last;
21442147
21452148 list_for_each_entry(pchild, &prange->child_list, child_list) {
@@ -2559,20 +2562,13 @@ svm_range_count_fault(struct amdgpu_device *adev, struct kfd_process *p, · 413 unmodified lines
25592562 }
25602563
25612564 static bool
2562−svm_fault_allowed(struct mm_struct *mm, uint64_t addr, bool write_fault)
2565+svm_fault_allowed(struct vm_area_struct *vma, bool write_fault)
25632566 {
25642567 unsigned long requested = VM_READ;
2565− struct vm_area_struct *vma;
25662568
25672569 if (write_fault)
25682570 requested |= VM_WRITE;
25692571
2570− vma = find_vma(mm, addr << PAGE_SHIFT);
2571− if (!vma || (addr << PAGE_SHIFT) < vma->vm_start) {
2572− pr_debug("address 0x%llx VMA is removed\n", addr);
2573− return true;
2574− }
2575−
25762572 pr_debug("requested 0x%lx, vma permission flags 0x%lx\n", requested,
25772573 vma->vm_flags);
25782574 return (vma->vm_flags & requested) == requested;
@@ -2590,6 +2586,7 @@ svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid, · 11 unmodified lines
25902586 int32_t best_loc;
25912587 int32_t gpuidx = MAX_GPU_INSTANCE;
25922588 bool write_locked = false;
2589+ struct vm_area_struct *vma;
25932590 int r = 0;
25942591
25952592 if (!KFD_IS_SVM_API_SUPPORTED(adev->kfd.dev)) {
@@ -2600,7 +2597,7 @@ svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid, · 4 unmodified lines
26002597 p = kfd_lookup_process_by_pasid(pasid);
26012598 if (!p) {
26022599 pr_debug("kfd process not founded pasid 0x%x\n", pasid);
2603− return -ESRCH;
2600+ return 0;
26042601 }
26052602 if (!p->xnack_enabled) {
26062603 pr_debug("XNACK not enabled for pasid 0x%x\n", pasid);
@@ -2611,10 +2608,19 @@ svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid, · 4 unmodified lines
26112608
26122609 pr_debug("restoring svms 0x%p fault address 0x%llx\n", svms, addr);
26132610
2611+ if (atomic_read(&svms->drain_pagefaults)) {
2612+ pr_debug("draining retry fault, drop fault 0x%llx\n", addr);
2613+ r = 0;
2614+ goto out;
2615+ }
2616+
2617+ /* p->lead_thread is available as kfd_process_wq_release flush the work
2618+ * before releasing task ref.
2619+ */
26142620 mm = get_task_mm(p->lead_thread);
26152621 if (!mm) {
26162622 pr_debug("svms 0x%p failed to get mm\n", svms);
2617− r = -ESRCH;
2623+ r = 0;
26182624 goto out;
26192625 }
26202626
@@ -2652,6 +2658,7 @@ retry_write_locked: · 31 unmodified lines
26522658
26532659 if (svm_range_skip_recover(prange)) {
26542660 amdgpu_gmc_filter_faults_remove(adev, addr, pasid);
2661+ r = 0;
26552662 goto out_unlock_range;
26562663 }
26572664
@@ -2660,10 +2667,21 @@ retry_write_locked: · 2 unmodified lines
26602667 if (timestamp < AMDGPU_SVM_RANGE_RETRY_FAULT_PENDING) {
26612668 pr_debug("svms 0x%p [0x%lx %lx] already restored\n",
26622669 svms, prange->start, prange->last);
2670+ r = 0;
26632671 goto out_unlock_range;
26642672 }
26652673
2666− if (!svm_fault_allowed(mm, addr, write_fault)) {
2674+ /* __do_munmap removed VMA, return success as we are handling stale
2675+ * retry fault.
2676+ */
2677+ vma = find_vma(mm, addr << PAGE_SHIFT);
2678+ if (!vma || (addr << PAGE_SHIFT) < vma->vm_start) {
2679+ pr_debug("address 0x%llx VMA is removed\n", addr);
2680+ r = 0;
2681+ goto out_unlock_range;
2682+ }
2683+
2684+ if (!svm_fault_allowed(vma, write_fault)) {
26672685 pr_debug("fault addr 0x%llx no %s permission\n", addr,
26682686 write_fault ? "write" : "read");
26692687 r = -EPERM;
@@ -2741,6 +2759,14 @@ void svm_range_list_fini(struct kfd_process *p) · 71 unmodified lines
27412759 /* Ensure list work is finished before process is destroyed */
27422760 flush_work(&p->svms.deferred_list_work);
27432761
2762+ /*
2763+ * Ensure no retry fault comes in afterwards, as page fault handler will
2764+ * not find kfd process and take mm lock to recover fault.
2765+ */
2766+ atomic_inc(&p->svms.drain_pagefaults);
2767+ svm_range_drain_retry_fault(&p->svms);
2768+
2769+
27442770 list_for_each_entry_safe(prange, next, &p->svms.list, list) {
27452771 svm_range_unlink(prange);
27462772 svm_range_remove_notifier(prange);
@@ -2761,6 +2787,7 @@ int svm_range_list_init(struct kfd_process *p) · 14 unmodified lines
27612787 mutex_init(&svms->lock);
27622788 INIT_LIST_HEAD(&svms->list);
27632789 atomic_set(&svms->evicted_ranges, 0);
2790+ atomic_set(&svms->drain_pagefaults, 0);
27642791 INIT_DELAYED_WORK(&svms->restore_work, svm_range_restore_work);
27652792 INIT_WORK(&svms->deferred_list_work, svm_range_deferred_list_work);
27662793 INIT_LIST_HEAD(&svms->deferred_range_list);
@@ -3150,7 +3177,6 @@ static int · 383 unmodified lines
31503177 svm_range_set_attr(struct kfd_process *p, uint64_t start, uint64_t size,
31513178 uint32_t nattr, struct kfd_ioctl_svm_attribute *attrs)
31523179 {
3153− struct amdkfd_process_info *process_info = p->kgd_process_info;
31543180 struct mm_struct *mm = current->mm;
31553181 struct list_head update_list;
31563182 struct list_head insert_list;
@@ -3169,8 +3195,6 @@ svm_range_set_attr(struct kfd_process *p, uint64_t start, uint64_t size, · 12 unmodified lines
31693195
31703196 svms = &p->svms;
31713197
3172− mutex_lock(&process_info->lock);
3173−
31743198 svm_range_list_lock_and_flush_work(svms, mm);
31753199
31763200 r = svm_range_is_valid(p, start, size);
@@ -3246,8 +3270,6 @@ out_unlock_range: · 69 unmodified lines
32463270 mutex_unlock(&svms->lock);
32473271 mmap_read_unlock(mm);
32483272 out:
3249− mutex_unlock(&process_info->lock);
3250−
32513273 pr_debug("pasid 0x%x svms 0x%p [0x%llx 0x%llx] done, r=%d\n", p->pasid,
32523274 &p->svms, start, start + size - 1, r);
32533275
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+29−3
@@ -51,6 +51,7 @@ · 50 unmodified lines
5151 #include <drm/drm_hdcp.h>
5252 #endif
5353 #include "amdgpu_pm.h"
54+#include "amdgpu_atombios.h"
5455
5556 #include "amd_shared.h"
5657 #include "amdgpu_dm_irq.h"
@@ -2561,6 +2562,23 @@ static int dm_resume(void *handle) · 2504 unmodified lines
25612562 if (amdgpu_in_reset(adev)) {
25622563 dc_state = dm->cached_dc_state;
25632564
2565+ /*
2566+ * The dc->current_state is backed up into dm->cached_dc_state
2567+ * before we commit 0 streams.
2568+ *
2569+ * DC will clear link encoder assignments on the real state
2570+ * but the changes won't propagate over to the copy we made
2571+ * before the 0 streams commit.
2572+ *
2573+ * DC expects that link encoder assignments are *not* valid
2574+ * when committing a state, so as a workaround it needs to be
2575+ * cleared here.
2576+ */
2577+ link_enc_cfg_init(dm->dc, dc_state);
2578+
2579+ if (dc_enable_dmub_notifications(adev->dm.dc))
2580+ amdgpu_dm_outbox_init(adev);
2581+
25642582 r = dm_dmub_hw_init(adev);
25652583 if (r)
25662584 DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
@@ -2572,8 +2590,8 @@ static int dm_resume(void *handle) · 5 unmodified lines
25722590
25732591 for (i = 0; i < dc_state->stream_count; i++) {
25742592 dc_state->streams[i]->mode_changed = true;
2575− for (j = 0; j < dc_state->stream_status->plane_count; j++) {
2576− dc_state->stream_status->plane_states[j]->update_flags.raw
2593+ for (j = 0; j < dc_state->stream_status[i].plane_count; j++) {
2594+ dc_state->stream_status[i].plane_states[j]->update_flags.raw
25772595 = 0xffffffff;
25782596 }
25792597 }
@@ -2608,6 +2626,10 @@ static int dm_resume(void *handle) · 28 unmodified lines
26082626 /* TODO: Remove dc_state->dccg, use dc->dccg directly. */
26092627 dc_resource_state_construct(dm->dc, dm_state->context);
26102628
2629+ /* Re-enable outbox interrupts for DPIA. */
2630+ if (dc_enable_dmub_notifications(adev->dm.dc))
2631+ amdgpu_dm_outbox_init(adev);
2632+
26112633 /* Before powering on DC we need to re-initialize DMUB. */
26122634 r = dm_dmub_hw_init(adev);
26132635 if (r)
@@ -3909,6 +3931,9 @@ static int amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm, · 1295 unmodified lines
39093931 caps = dm->backlight_caps[bl_idx];
39103932
39113933 dm->brightness[bl_idx] = user_brightness;
3934+ /* update scratch register */
3935+ if (bl_idx == 0)
3936+ amdgpu_atombios_scratch_regs_set_backlight_level(dm->adev, dm->brightness[bl_idx]);
39123937 brightness = convert_brightness_from_user(&caps, dm->brightness[bl_idx]);
39133938 link = (struct dc_link *)dm->backlight_link[bl_idx];
39143939
@@ -4242,7 +4267,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · 327 unmodified lines
42424267 } else if (dc_link_detect(link, DETECT_REASON_BOOT)) {
42434268 amdgpu_dm_update_connector_after_detect(aconnector);
42444269 register_backlight_device(dm, link);
4245−
4270+ if (dm->num_of_edps)
4271+ update_connector_ext_caps(aconnector);
42464272 if (psr_feature_enabled)
42474273 amdgpu_dm_set_psr_caps(link);
42484274 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c+8−0
@@ -314,6 +314,14 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name) · 313 unmodified lines
314314 ret = -EINVAL;
315315 goto cleanup;
316316 }
317+
318+ if ((aconn->base.connector_type != DRM_MODE_CONNECTOR_DisplayPort) &&
319+ (aconn->base.connector_type != DRM_MODE_CONNECTOR_eDP)) {
320+ DRM_DEBUG_DRIVER("No DP connector available for CRC source\n");
321+ ret = -EINVAL;
322+ goto cleanup;
323+ }
324+
317325 }
318326
319327 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+16−4
@@ -36,6 +36,8 @@ · 35 unmodified lines
3636 #include "dm_helpers.h"
3737
3838 #include "dc_link_ddc.h"
39+#include "ddc_service_types.h"
40+#include "dpcd_defs.h"
3941
4042 #include "i2caux_interface.h"
4143 #include "dmub_cmd.h"
@@ -157,6 +159,16 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { · 115 unmodified lines
157159 };
158160
159161 #if defined(CONFIG_DRM_AMD_DC_DCN)
162+static bool needs_dsc_aux_workaround(struct dc_link *link)
163+{
164+ if (link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_90CC24 &&
165+ (link->dpcd_caps.dpcd_rev.raw == DPCD_REV_14 || link->dpcd_caps.dpcd_rev.raw == DPCD_REV_12) &&
166+ link->dpcd_caps.sink_count.bits.SINK_COUNT >= 2)
167+ return true;
168+
169+ return false;
170+}
171+
160172 static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnector)
161173 {
162174 struct dc_sink *dc_sink = aconnector->dc_sink;
@@ -166,7 +178,7 @@ static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnecto · 3 unmodified lines
166178 u8 *dsc_branch_dec_caps = NULL;
167179
168180 aconnector->dsc_aux = drm_dp_mst_dsc_aux_for_port(port);
169−#if defined(CONFIG_HP_HOOK_WORKAROUND)
181+
170182 /*
171183 * drm_dp_mst_dsc_aux_for_port() will return NULL for certain configs
172184 * because it only check the dsc/fec caps of the "port variable" and not the dock
@@ -176,10 +188,10 @@ static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnecto · 3 unmodified lines
176188 * Workaround: explicitly check the use case above and use the mst dock's aux as dsc_aux
177189 *
178190 */
179−
180− if (!aconnector->dsc_aux && !port->parent->port_parent)
191+ if (!aconnector->dsc_aux && !port->parent->port_parent &&
192+ needs_dsc_aux_workaround(aconnector->dc_link))
181193 aconnector->dsc_aux = &aconnector->mst_port->dm_dp_aux.aux;
182−#endif
194+
183195 if (!aconnector->dsc_aux)
184196 return false;
185197
drivers/gpu/drm/amd/display/dc/core/dc_link.c+16−0
@@ -758,6 +758,18 @@ static bool detect_dp(struct dc_link *link, · 757 unmodified lines
758758 dal_ddc_service_set_transaction_type(link->ddc,
759759 sink_caps->transaction_type);
760760
761+#if defined(CONFIG_DRM_AMD_DC_DCN)
762+ /* Apply work around for tunneled MST on certain USB4 docks. Always use DSC if dock
763+ * reports DSC support.
764+ */
765+ if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA &&
766+ link->type == dc_connection_mst_branch &&
767+ link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_90CC24 &&
768+ link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_SUPPORT &&
769+ !link->dc->debug.dpia_debug.bits.disable_mst_dsc_work_around)
770+ link->wa_flags.dpia_mst_dsc_always_on = true;
771+#endif
772+
761773 #if defined(CONFIG_DRM_AMD_DC_HDCP)
762774 /* In case of fallback to SST when topology discovery below fails
763775 * HDCP caps will be querried again later by the upper layer (caller
@@ -1203,6 +1215,10 @@ static bool dc_link_detect_helper(struct dc_link *link, · 439 unmodified lines
12031215 LINK_INFO("link=%d, mst branch is now Disconnected\n",
12041216 link->link_index);
12051217
1218+ /* Disable work around which keeps DSC on for tunneled MST on certain USB4 docks. */
1219+ if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA)
1220+ link->wa_flags.dpia_mst_dsc_always_on = false;
1221+
12061222 dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
12071223
12081224 link->mst_stream_alloc_table.stream_count = 0;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+1−1
@@ -2138,7 +2138,7 @@ static enum link_training_result dp_perform_8b_10b_link_training( · 2137 unmodified lines
21382138 }
21392139
21402140 for (lane = 0; lane < (uint8_t)lt_settings->link_settings.lane_count; lane++)
2141− lt_settings->dpcd_lane_settings[lane].bits.VOLTAGE_SWING_SET = VOLTAGE_SWING_LEVEL0;
2141+ lt_settings->dpcd_lane_settings[lane].raw = 0;
21422142 }
21432143
21442144 if (status == LINK_TRAINING_SUCCESS) {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c+14−10
@@ -1664,6 +1664,10 @@ bool dc_is_stream_unchanged( · 1663 unmodified lines
16641664 if (old_stream->ignore_msa_timing_param != stream->ignore_msa_timing_param)
16651665 return false;
16661666
1667+ // Only Have Audio left to check whether it is same or not. This is a corner case for Tiled sinks
1668+ if (old_stream->audio_info.mode_count != stream->audio_info.mode_count)
1669+ return false;
1670+
16671671 return true;
16681672 }
16691673
@@ -2252,16 +2256,6 @@ enum dc_status dc_validate_global_state( · 582 unmodified lines
22522256
22532257 if (!new_ctx)
22542258 return DC_ERROR_UNEXPECTED;
2255−#if defined(CONFIG_DRM_AMD_DC_DCN)
2256−
2257− /*
2258− * Update link encoder to stream assignment.
2259− * TODO: Split out reason allocation from validation.
2260− */
2261− if (dc->res_pool->funcs->link_encs_assign && fast_validate == false)
2262− dc->res_pool->funcs->link_encs_assign(
2263− dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
2264−#endif
22652259
22662260 if (dc->res_pool->funcs->validate_global) {
22672261 result = dc->res_pool->funcs->validate_global(dc, new_ctx);
@@ -2313,6 +2307,16 @@ enum dc_status dc_validate_global_state( · 45 unmodified lines
23132307 if (!dc->res_pool->funcs->validate_bandwidth(dc, new_ctx, fast_validate))
23142308 result = DC_FAIL_BANDWIDTH_VALIDATE;
23152309
2310+#if defined(CONFIG_DRM_AMD_DC_DCN)
2311+ /*
2312+ * Only update link encoder to stream assignment after bandwidth validation passed.
2313+ * TODO: Split out assignment and validation.
2314+ */
2315+ if (result == DC_OK && dc->res_pool->funcs->link_encs_assign && fast_validate == false)
2316+ dc->res_pool->funcs->link_encs_assign(
2317+ dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
2318+#endif
2319+
23162320 return result;
23172321 }
23182322
drivers/gpu/drm/amd/display/dc/dc.h+2−1
@@ -508,7 +508,8 @@ union dpia_debug_options { · 507 unmodified lines
508508 uint32_t disable_dpia:1;
509509 uint32_t force_non_lttpr:1;
510510 uint32_t extend_aux_rd_interval:1;
511− uint32_t reserved:29;
511+ uint32_t disable_mst_dsc_work_around:1;
512+ uint32_t reserved:28;
512513 } bits;
513514 uint32_t raw;
514515 };
drivers/gpu/drm/amd/display/dc/dc_link.h+4−0
@@ -191,6 +191,8 @@ struct dc_link { · 190 unmodified lines
191191 bool dp_skip_DID2;
192192 bool dp_skip_reset_segment;
193193 bool dp_mot_reset_segment;
194+ /* Some USB4 docks do not handle turning off MST DSC once it has been enabled. */
195+ bool dpia_mst_dsc_always_on;
194196 } wa_flags;
195197 struct link_mst_stream_allocation_table mst_stream_alloc_table;
196198
@@ -224,6 +226,8 @@ static inline void get_edp_links(const struct dc *dc, · 27 unmodified lines
224226 *edp_num = 0;
225227 for (i = 0; i < dc->link_count; i++) {
226228 // report any eDP links, even unconnected DDI's
229+ if (!dc->links[i])
230+ continue;
227231 if (dc->links[i]->connector_signal == SIGNAL_TYPE_EDP) {
228232 edp_links[*edp_num] = dc->links[i];
229233 if (++(*edp_num) == MAX_NUM_EDP)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c+1−1
@@ -1637,7 +1637,7 @@ void dcn10_reset_hw_ctx_wrap( · 1636 unmodified lines
16371637
16381638 dcn10_reset_back_end_for_pipe(dc, pipe_ctx_old, dc->current_state);
16391639 if (hws->funcs.enable_stream_gating)
1640− hws->funcs.enable_stream_gating(dc, pipe_ctx);
1640+ hws->funcs.enable_stream_gating(dc, pipe_ctx_old);
16411641 if (old_clk)
16421642 old_clk->funcs->cs_power_down(old_clk);
16431643 }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c+1−1
@@ -2270,7 +2270,7 @@ void dcn20_reset_hw_ctx_wrap( · 2269 unmodified lines
22702270
22712271 dcn20_reset_back_end_for_pipe(dc, pipe_ctx_old, dc->current_state);
22722272 if (hws->funcs.enable_stream_gating)
2273− hws->funcs.enable_stream_gating(dc, pipe_ctx);
2273+ hws->funcs.enable_stream_gating(dc, pipe_ctx_old);
22742274 if (old_clk)
22752275 old_clk->funcs->cs_power_down(old_clk);
22762276 }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c+1−1
@@ -602,7 +602,7 @@ void dcn31_reset_hw_ctx_wrap( · 601 unmodified lines
602602
603603 dcn31_reset_back_end_for_pipe(dc, pipe_ctx_old, dc->current_state);
604604 if (hws->funcs.enable_stream_gating)
605− hws->funcs.enable_stream_gating(dc, pipe_ctx);
605+ hws->funcs.enable_stream_gating(dc, pipe_ctx_old);
606606 if (old_clk)
607607 old_clk->funcs->cs_power_down(old_clk);
608608 }
drivers/gpu/drm/amd/include/amd_shared.h+2−1
@@ -98,7 +98,8 @@ enum amd_ip_block_type { · 97 unmodified lines
9898 AMD_IP_BLOCK_TYPE_ACP,
9999 AMD_IP_BLOCK_TYPE_VCN,
100100 AMD_IP_BLOCK_TYPE_MES,
101− AMD_IP_BLOCK_TYPE_JPEG
101+ AMD_IP_BLOCK_TYPE_JPEG,
102+ AMD_IP_BLOCK_TYPE_NUM,
102103 };
103104
104105 enum amd_clockgating_state {
drivers/gpu/drm/amd/pm/amdgpu_dpm.c+10−0
@@ -927,6 +927,13 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t block · 926 unmodified lines
927927 {
928928 int ret = 0;
929929 const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
930+ enum ip_power_state pwr_state = gate ? POWER_STATE_OFF : POWER_STATE_ON;
931+
932+ if (atomic_read(&adev->pm.pwr_state[block_type]) == pwr_state) {
933+ dev_dbg(adev->dev, "IP block%d already in the target %s state!",
934+ block_type, gate ? "gate" : "ungate");
935+ return 0;
936+ }
930937
931938 switch (block_type) {
932939 case AMD_IP_BLOCK_TYPE_UVD:
@@ -979,6 +986,9 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t block · 46 unmodified lines
979986 break;
980987 }
981988
989+ if (!ret)
990+ atomic_set(&adev->pm.pwr_state[block_type], pwr_state);
991+
982992 return ret;
983993 }
984994
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h+8−0
@@ -417,6 +417,12 @@ struct amdgpu_dpm { · 416 unmodified lines
417417 enum amd_dpm_forced_level forced_level;
418418 };
419419
420+enum ip_power_state {
421+ POWER_STATE_UNKNOWN,
422+ POWER_STATE_ON,
423+ POWER_STATE_OFF,
424+};
425+
420426 struct amdgpu_pm {
421427 struct mutex mutex;
422428 u32 current_sclk;
@@ -452,6 +458,8 @@ struct amdgpu_pm { · 29 unmodified lines
452458 struct i2c_adapter smu_i2c;
453459 struct mutex smu_i2c_mutex;
454460 struct list_head pm_attr_list;
461+
462+ atomic_t pwr_state[AMD_IP_BLOCK_TYPE_NUM];
455463 };
456464
457465 #define R600_SSTU_DFLT 0
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c+9−11
@@ -1024,8 +1024,6 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 1023 unmodified lines
10241024 uint32_t min_freq, max_freq = 0;
10251025 uint32_t ret = 0;
10261026
1027− phm_get_sysfs_buf(&buf, &size);
1028−
10291027 switch (type) {
10301028 case PP_SCLK:
10311029 smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now);
@@ -1038,13 +1036,13 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 6 unmodified lines
10381036 else
10391037 i = 1;
10401038
1041− size += sysfs_emit_at(buf, size, "0: %uMhz %s\n",
1039+ size += sprintf(buf + size, "0: %uMhz %s\n",
10421040 data->gfx_min_freq_limit/100,
10431041 i == 0 ? "*" : "");
1044− size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
1042+ size += sprintf(buf + size, "1: %uMhz %s\n",
10451043 i == 1 ? now : SMU10_UMD_PSTATE_GFXCLK,
10461044 i == 1 ? "*" : "");
1047− size += sysfs_emit_at(buf, size, "2: %uMhz %s\n",
1045+ size += sprintf(buf + size, "2: %uMhz %s\n",
10481046 data->gfx_max_freq_limit/100,
10491047 i == 2 ? "*" : "");
10501048 break;
@@ -1052,7 +1050,7 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 1 unmodified line
10521050 smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency, &now);
10531051
10541052 for (i = 0; i < mclk_table->count; i++)
1055− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
1053+ size += sprintf(buf + size, "%d: %uMhz %s\n",
10561054 i,
10571055 mclk_table->entries[i].clk / 100,
10581056 ((mclk_table->entries[i].clk / 100)
@@ -1067,10 +1065,10 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 8 unmodified lines
10671065 if (ret)
10681066 return ret;
10691067
1070− size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
1071− size += sysfs_emit_at(buf, size, "0: %10uMhz\n",
1068+ size += sprintf(buf + size, "%s:\n", "OD_SCLK");
1069+ size += sprintf(buf + size, "0: %10uMhz\n",
10721070 (data->gfx_actual_soft_min_freq > 0) ? data->gfx_actual_soft_min_freq : min_freq);
1073− size += sysfs_emit_at(buf, size, "1: %10uMhz\n",
1071+ size += sprintf(buf + size, "1: %10uMhz\n",
10741072 (data->gfx_actual_soft_max_freq > 0) ? data->gfx_actual_soft_max_freq : max_freq);
10751073 }
10761074 break;
@@ -1083,8 +1081,8 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 6 unmodified lines
10831081 if (ret)
10841082 return ret;
10851083
1086− size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
1087− size += sysfs_emit_at(buf, size, "SCLK: %7uMHz %10uMHz\n",
1084+ size += sprintf(buf + size, "%s:\n", "OD_RANGE");
1085+ size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
10881086 min_freq, max_freq);
10891087 }
10901088 break;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c+11−13
@@ -4914,8 +4914,6 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr, · 4913 unmodified lines
49144914 int size = 0;
49154915 uint32_t i, now, clock, pcie_speed;
49164916
4917− phm_get_sysfs_buf(&buf, &size);
4918−
49194917 switch (type) {
49204918 case PP_SCLK:
49214919 smum_send_msg_to_smc(hwmgr, PPSMC_MSG_API_GetSclkFrequency, &clock);
@@ -4928,7 +4926,7 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr, · 6 unmodified lines
49284926 now = i;
49294927
49304928 for (i = 0; i < sclk_table->count; i++)
4931− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
4929+ size += sprintf(buf + size, "%d: %uMhz %s\n",
49324930 i, sclk_table->dpm_levels[i].value / 100,
49334931 (i == now) ? "*" : "");
49344932 break;
@@ -4943,7 +4941,7 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr, · 8 unmodified lines
49434941 now = i;
49444942
49454943 for (i = 0; i < mclk_table->count; i++)
4946− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
4944+ size += sprintf(buf + size, "%d: %uMhz %s\n",
49474945 i, mclk_table->dpm_levels[i].value / 100,
49484946 (i == now) ? "*" : "");
49494947 break;
@@ -4957,7 +4955,7 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr, · 7 unmodified lines
49574955 now = i;
49584956
49594957 for (i = 0; i < pcie_table->count; i++)
4960− size += sysfs_emit_at(buf, size, "%d: %s %s\n", i,
4958+ size += sprintf(buf + size, "%d: %s %s\n", i,
49614959 (pcie_table->dpm_levels[i].value == 0) ? "2.5GT/s, x8" :
49624960 (pcie_table->dpm_levels[i].value == 1) ? "5.0GT/s, x16" :
49634961 (pcie_table->dpm_levels[i].value == 2) ? "8.0GT/s, x16" : "",
@@ -4965,32 +4963,32 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr, · 1 unmodified line
49654963 break;
49664964 case OD_SCLK:
49674965 if (hwmgr->od_enabled) {
4968− size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
4966+ size += sprintf(buf + size, "%s:\n", "OD_SCLK");
49694967 for (i = 0; i < odn_sclk_table->num_of_pl; i++)
4970− size += sysfs_emit_at(buf, size, "%d: %10uMHz %10umV\n",
4968+ size += sprintf(buf + size, "%d: %10uMHz %10umV\n",
49714969 i, odn_sclk_table->entries[i].clock/100,
49724970 odn_sclk_table->entries[i].vddc);
49734971 }
49744972 break;
49754973 case OD_MCLK:
49764974 if (hwmgr->od_enabled) {
4977− size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
4975+ size += sprintf(buf + size, "%s:\n", "OD_MCLK");
49784976 for (i = 0; i < odn_mclk_table->num_of_pl; i++)
4979− size += sysfs_emit_at(buf, size, "%d: %10uMHz %10umV\n",
4977+ size += sprintf(buf + size, "%d: %10uMHz %10umV\n",
49804978 i, odn_mclk_table->entries[i].clock/100,
49814979 odn_mclk_table->entries[i].vddc);
49824980 }
49834981 break;
49844982 case OD_RANGE:
49854983 if (hwmgr->od_enabled) {
4986− size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
4987− size += sysfs_emit_at(buf, size, "SCLK: %7uMHz %10uMHz\n",
4984+ size += sprintf(buf + size, "%s:\n", "OD_RANGE");
4985+ size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
49884986 data->golden_dpm_table.sclk_table.dpm_levels[0].value/100,
49894987 hwmgr->platform_descriptor.overdriveLimit.engineClock/100);
4990− size += sysfs_emit_at(buf, size, "MCLK: %7uMHz %10uMHz\n",
4988+ size += sprintf(buf + size, "MCLK: %7uMHz %10uMHz\n",
49914989 data->golden_dpm_table.mclk_table.dpm_levels[0].value/100,
49924990 hwmgr->platform_descriptor.overdriveLimit.memoryClock/100);
4993− size += sysfs_emit_at(buf, size, "VDDC: %7umV %11umV\n",
4991+ size += sprintf(buf + size, "VDDC: %7umV %11umV\n",
49944992 data->odn_dpm_table.min_vddc,
49954993 data->odn_dpm_table.max_vddc);
49964994 }
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c+2−4
@@ -1550,8 +1550,6 @@ static int smu8_print_clock_levels(struct pp_hwmgr *hwmgr, · 1549 unmodified lines
15501550 uint32_t i, now;
15511551 int size = 0;
15521552
1553− phm_get_sysfs_buf(&buf, &size);
1554−
15551553 switch (type) {
15561554 case PP_SCLK:
15571555 now = PHM_GET_FIELD(cgs_read_ind_register(hwmgr->device,
@@ -1561,7 +1559,7 @@ static int smu8_print_clock_levels(struct pp_hwmgr *hwmgr, · 3 unmodified lines
15611559 CURR_SCLK_INDEX);
15621560
15631561 for (i = 0; i < sclk_table->count; i++)
1564− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
1562+ size += sprintf(buf + size, "%d: %uMhz %s\n",
15651563 i, sclk_table->entries[i].clk / 100,
15661564 (i == now) ? "*" : "");
15671565 break;
@@ -1573,7 +1571,7 @@ static int smu8_print_clock_levels(struct pp_hwmgr *hwmgr, · 5 unmodified lines
15731571 CURR_MCLK_INDEX);
15741572
15751573 for (i = SMU8_NUM_NBPMEMORYCLOCK; i > 0; i--)
1576− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
1574+ size += sprintf(buf + size, "%d: %uMhz %s\n",
15771575 SMU8_NUM_NBPMEMORYCLOCK-i, data->sys_info.nbp_memory_clock[i-1] / 100,
15781576 (SMU8_NUM_NBPMEMORYCLOCK-i == now) ? "*" : "");
15791577 break;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c+13−15
@@ -4639,8 +4639,6 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 4638 unmodified lines
46394639
46404640 int i, now, size = 0, count = 0;
46414641
4642− phm_get_sysfs_buf(&buf, &size);
4643−
46444642 switch (type) {
46454643 case PP_SCLK:
46464644 if (data->registry_data.sclk_dpm_key_disabled)
@@ -4654,7 +4652,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 7 unmodified lines
46544652 else
46554653 count = sclk_table->count;
46564654 for (i = 0; i < count; i++)
4657− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
4655+ size += sprintf(buf + size, "%d: %uMhz %s\n",
46584656 i, sclk_table->dpm_levels[i].value / 100,
46594657 (i == now) ? "*" : "");
46604658 break;
@@ -4665,7 +4663,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 4 unmodified lines
46654663 smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentUclkIndex, &now);
46664664
46674665 for (i = 0; i < mclk_table->count; i++)
4668− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
4666+ size += sprintf(buf + size, "%d: %uMhz %s\n",
46694667 i, mclk_table->dpm_levels[i].value / 100,
46704668 (i == now) ? "*" : "");
46714669 break;
@@ -4676,7 +4674,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 4 unmodified lines
46764674 smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentSocclkIndex, &now);
46774675
46784676 for (i = 0; i < soc_table->count; i++)
4679− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
4677+ size += sprintf(buf + size, "%d: %uMhz %s\n",
46804678 i, soc_table->dpm_levels[i].value / 100,
46814679 (i == now) ? "*" : "");
46824680 break;
@@ -4688,7 +4686,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 5 unmodified lines
46884686 PPSMC_MSG_GetClockFreqMHz, CLK_DCEFCLK, &now);
46894687
46904688 for (i = 0; i < dcef_table->count; i++)
4691− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
4689+ size += sprintf(buf + size, "%d: %uMhz %s\n",
46924690 i, dcef_table->dpm_levels[i].value / 100,
46934691 (dcef_table->dpm_levels[i].value / 100 == now) ?
46944692 "*" : "");
@@ -4702,7 +4700,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 7 unmodified lines
47024700 gen_speed = pptable->PcieGenSpeed[i];
47034701 lane_width = pptable->PcieLaneCount[i];
47044702
4705− size += sysfs_emit_at(buf, size, "%d: %s %s %s\n", i,
4703+ size += sprintf(buf + size, "%d: %s %s %s\n", i,
47064704 (gen_speed == 0) ? "2.5GT/s," :
47074705 (gen_speed == 1) ? "5.0GT/s," :
47084706 (gen_speed == 2) ? "8.0GT/s," :
@@ -4721,34 +4719,34 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 12 unmodified lines
47214719
47224720 case OD_SCLK:
47234721 if (hwmgr->od_enabled) {
4724− size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
4722+ size += sprintf(buf + size, "%s:\n", "OD_SCLK");
47254723 podn_vdd_dep = &data->odn_dpm_table.vdd_dep_on_sclk;
47264724 for (i = 0; i < podn_vdd_dep->count; i++)
4727− size += sysfs_emit_at(buf, size, "%d: %10uMhz %10umV\n",
4725+ size += sprintf(buf + size, "%d: %10uMhz %10umV\n",
47284726 i, podn_vdd_dep->entries[i].clk / 100,
47294727 podn_vdd_dep->entries[i].vddc);
47304728 }
47314729 break;
47324730 case OD_MCLK:
47334731 if (hwmgr->od_enabled) {
4734− size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
4732+ size += sprintf(buf + size, "%s:\n", "OD_MCLK");
47354733 podn_vdd_dep = &data->odn_dpm_table.vdd_dep_on_mclk;
47364734 for (i = 0; i < podn_vdd_dep->count; i++)
4737− size += sysfs_emit_at(buf, size, "%d: %10uMhz %10umV\n",
4735+ size += sprintf(buf + size, "%d: %10uMhz %10umV\n",
47384736 i, podn_vdd_dep->entries[i].clk/100,
47394737 podn_vdd_dep->entries[i].vddc);
47404738 }
47414739 break;
47424740 case OD_RANGE:
47434741 if (hwmgr->od_enabled) {
4744− size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
4745− size += sysfs_emit_at(buf, size, "SCLK: %7uMHz %10uMHz\n",
4742+ size += sprintf(buf + size, "%s:\n", "OD_RANGE");
4743+ size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
47464744 data->golden_dpm_table.gfx_table.dpm_levels[0].value/100,
47474745 hwmgr->platform_descriptor.overdriveLimit.engineClock/100);
4748− size += sysfs_emit_at(buf, size, "MCLK: %7uMHz %10uMHz\n",
4746+ size += sprintf(buf + size, "MCLK: %7uMHz %10uMHz\n",
47494747 data->golden_dpm_table.mem_table.dpm_levels[0].value/100,
47504748 hwmgr->platform_descriptor.overdriveLimit.memoryClock/100);
4751− size += sysfs_emit_at(buf, size, "VDDC: %7umV %11umV\n",
4749+ size += sprintf(buf + size, "VDDC: %7umV %11umV\n",
47524750 data->odn_dpm_table.min_vddc,
47534751 data->odn_dpm_table.max_vddc);
47544752 }
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c+4−6
@@ -2246,8 +2246,6 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · 2245 unmodified lines
22462246 int i, now, size = 0;
22472247 struct pp_clock_levels_with_latency clocks;
22482248
2249− phm_get_sysfs_buf(&buf, &size);
2250−
22512249 switch (type) {
22522250 case PP_SCLK:
22532251 PP_ASSERT_WITH_CODE(
@@ -2260,7 +2258,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · 6 unmodified lines
22602258 "Attempt to get gfx clk levels Failed!",
22612259 return -1);
22622260 for (i = 0; i < clocks.num_levels; i++)
2263− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
2261+ size += sprintf(buf + size, "%d: %uMhz %s\n",
22642262 i, clocks.data[i].clocks_in_khz / 1000,
22652263 (clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
22662264 break;
@@ -2276,7 +2274,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · 9 unmodified lines
22762274 "Attempt to get memory clk levels Failed!",
22772275 return -1);
22782276 for (i = 0; i < clocks.num_levels; i++)
2279− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
2277+ size += sprintf(buf + size, "%d: %uMhz %s\n",
22802278 i, clocks.data[i].clocks_in_khz / 1000,
22812279 (clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
22822280 break;
@@ -2294,7 +2292,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · 11 unmodified lines
22942292 "Attempt to get soc clk levels Failed!",
22952293 return -1);
22962294 for (i = 0; i < clocks.num_levels; i++)
2297− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
2295+ size += sprintf(buf + size, "%d: %uMhz %s\n",
22982296 i, clocks.data[i].clocks_in_khz / 1000,
22992297 (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
23002298 break;
@@ -2312,7 +2310,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr, · 11 unmodified lines
23122310 "Attempt to get dcef clk levels Failed!",
23132311 return -1);
23142312 for (i = 0; i < clocks.num_levels; i++)
2315− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
2313+ size += sprintf(buf + size, "%d: %uMhz %s\n",
23162314 i, clocks.data[i].clocks_in_khz / 1000,
23172315 (clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
23182316 break;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c+28−30
@@ -3366,8 +3366,6 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 3365 unmodified lines
33663366 int ret = 0;
33673367 uint32_t gen_speed, lane_width, current_gen_speed, current_lane_width;
33683368
3369− phm_get_sysfs_buf(&buf, &size);
3370−
33713369 switch (type) {
33723370 case PP_SCLK:
33733371 ret = vega20_get_current_clk_freq(hwmgr, PPCLK_GFXCLK, &now);
@@ -3376,13 +3374,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 2 unmodified lines
33763374 return ret);
33773375
33783376 if (vega20_get_sclks(hwmgr, &clocks)) {
3379− size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
3377+ size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
33803378 now / 100);
33813379 break;
33823380 }
33833381
33843382 for (i = 0; i < clocks.num_levels; i++)
3385− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
3383+ size += sprintf(buf + size, "%d: %uMhz %s\n",
33863384 i, clocks.data[i].clocks_in_khz / 1000,
33873385 (clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
33883386 break;
@@ -3394,13 +3392,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 5 unmodified lines
33943392 return ret);
33953393
33963394 if (vega20_get_memclocks(hwmgr, &clocks)) {
3397− size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
3395+ size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
33983396 now / 100);
33993397 break;
34003398 }
34013399
34023400 for (i = 0; i < clocks.num_levels; i++)
3403− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
3401+ size += sprintf(buf + size, "%d: %uMhz %s\n",
34043402 i, clocks.data[i].clocks_in_khz / 1000,
34053403 (clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
34063404 break;
@@ -3412,13 +3410,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 5 unmodified lines
34123410 return ret);
34133411
34143412 if (vega20_get_socclocks(hwmgr, &clocks)) {
3415− size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
3413+ size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
34163414 now / 100);
34173415 break;
34183416 }
34193417
34203418 for (i = 0; i < clocks.num_levels; i++)
3421− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
3419+ size += sprintf(buf + size, "%d: %uMhz %s\n",
34223420 i, clocks.data[i].clocks_in_khz / 1000,
34233421 (clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
34243422 break;
@@ -3430,7 +3428,7 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 5 unmodified lines
34303428 return ret);
34313429
34323430 for (i = 0; i < fclk_dpm_table->count; i++)
3433− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
3431+ size += sprintf(buf + size, "%d: %uMhz %s\n",
34343432 i, fclk_dpm_table->dpm_levels[i].value,
34353433 fclk_dpm_table->dpm_levels[i].value == (now / 100) ? "*" : "");
34363434 break;
@@ -3442,13 +3440,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 5 unmodified lines
34423440 return ret);
34433441
34443442 if (vega20_get_dcefclocks(hwmgr, &clocks)) {
3445− size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
3443+ size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
34463444 now / 100);
34473445 break;
34483446 }
34493447
34503448 for (i = 0; i < clocks.num_levels; i++)
3451− size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
3449+ size += sprintf(buf + size, "%d: %uMhz %s\n",
34523450 i, clocks.data[i].clocks_in_khz / 1000,
34533451 (clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
34543452 break;
@@ -3462,7 +3460,7 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 7 unmodified lines
34623460 gen_speed = pptable->PcieGenSpeed[i];
34633461 lane_width = pptable->PcieLaneCount[i];
34643462
3465− size += sysfs_emit_at(buf, size, "%d: %s %s %dMhz %s\n", i,
3463+ size += sprintf(buf + size, "%d: %s %s %dMhz %s\n", i,
34663464 (gen_speed == 0) ? "2.5GT/s," :
34673465 (gen_speed == 1) ? "5.0GT/s," :
34683466 (gen_speed == 2) ? "8.0GT/s," :
@@ -3483,18 +3481,18 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 14 unmodified lines
34833481 case OD_SCLK:
34843482 if (od8_settings[OD8_SETTING_GFXCLK_FMIN].feature_id &&
34853483 od8_settings[OD8_SETTING_GFXCLK_FMAX].feature_id) {
3486− size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
3487− size += sysfs_emit_at(buf, size, "0: %10uMhz\n",
3484+ size += sprintf(buf + size, "%s:\n", "OD_SCLK");
3485+ size += sprintf(buf + size, "0: %10uMhz\n",
34883486 od_table->GfxclkFmin);
3489− size += sysfs_emit_at(buf, size, "1: %10uMhz\n",
3487+ size += sprintf(buf + size, "1: %10uMhz\n",
34903488 od_table->GfxclkFmax);
34913489 }
34923490 break;
34933491
34943492 case OD_MCLK:
34953493 if (od8_settings[OD8_SETTING_UCLK_FMAX].feature_id) {
3496− size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
3497− size += sysfs_emit_at(buf, size, "1: %10uMhz\n",
3494+ size += sprintf(buf + size, "%s:\n", "OD_MCLK");
3495+ size += sprintf(buf + size, "1: %10uMhz\n",
34983496 od_table->UclkFmax);
34993497 }
35003498
@@ -3507,14 +3505,14 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 6 unmodified lines
35073505 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].feature_id &&
35083506 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].feature_id &&
35093507 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].feature_id) {
3510− size += sysfs_emit_at(buf, size, "%s:\n", "OD_VDDC_CURVE");
3511− size += sysfs_emit_at(buf, size, "0: %10uMhz %10dmV\n",
3508+ size += sprintf(buf + size, "%s:\n", "OD_VDDC_CURVE");
3509+ size += sprintf(buf + size, "0: %10uMhz %10dmV\n",
35123510 od_table->GfxclkFreq1,
35133511 od_table->GfxclkVolt1 / VOLTAGE_SCALE);
3514− size += sysfs_emit_at(buf, size, "1: %10uMhz %10dmV\n",
3512+ size += sprintf(buf + size, "1: %10uMhz %10dmV\n",
35153513 od_table->GfxclkFreq2,
35163514 od_table->GfxclkVolt2 / VOLTAGE_SCALE);
3517− size += sysfs_emit_at(buf, size, "2: %10uMhz %10dmV\n",
3515+ size += sprintf(buf + size, "2: %10uMhz %10dmV\n",
35183516 od_table->GfxclkFreq3,
35193517 od_table->GfxclkVolt3 / VOLTAGE_SCALE);
35203518 }
@@ -3522,17 +3520,17 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 1 unmodified line
35223520 break;
35233521
35243522 case OD_RANGE:
3525− size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
3523+ size += sprintf(buf + size, "%s:\n", "OD_RANGE");
35263524
35273525 if (od8_settings[OD8_SETTING_GFXCLK_FMIN].feature_id &&
35283526 od8_settings[OD8_SETTING_GFXCLK_FMAX].feature_id) {
3529− size += sysfs_emit_at(buf, size, "SCLK: %7uMhz %10uMhz\n",
3527+ size += sprintf(buf + size, "SCLK: %7uMhz %10uMhz\n",
35303528 od8_settings[OD8_SETTING_GFXCLK_FMIN].min_value,
35313529 od8_settings[OD8_SETTING_GFXCLK_FMAX].max_value);
35323530 }
35333531
35343532 if (od8_settings[OD8_SETTING_UCLK_FMAX].feature_id) {
3535− size += sysfs_emit_at(buf, size, "MCLK: %7uMhz %10uMhz\n",
3533+ size += sprintf(buf + size, "MCLK: %7uMhz %10uMhz\n",
35363534 od8_settings[OD8_SETTING_UCLK_FMAX].min_value,
35373535 od8_settings[OD8_SETTING_UCLK_FMAX].max_value);
35383536 }
@@ -3543,22 +3541,22 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 4 unmodified lines
35433541 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].feature_id &&
35443542 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].feature_id &&
35453543 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].feature_id) {
3546− size += sysfs_emit_at(buf, size, "VDDC_CURVE_SCLK[0]: %7uMhz %10uMhz\n",
3544+ size += sprintf(buf + size, "VDDC_CURVE_SCLK[0]: %7uMhz %10uMhz\n",
35473545 od8_settings[OD8_SETTING_GFXCLK_FREQ1].min_value,
35483546 od8_settings[OD8_SETTING_GFXCLK_FREQ1].max_value);
3549− size += sysfs_emit_at(buf, size, "VDDC_CURVE_VOLT[0]: %7dmV %11dmV\n",
3547+ size += sprintf(buf + size, "VDDC_CURVE_VOLT[0]: %7dmV %11dmV\n",
35503548 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].min_value,
35513549 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].max_value);
3552− size += sysfs_emit_at(buf, size, "VDDC_CURVE_SCLK[1]: %7uMhz %10uMhz\n",
3550+ size += sprintf(buf + size, "VDDC_CURVE_SCLK[1]: %7uMhz %10uMhz\n",
35533551 od8_settings[OD8_SETTING_GFXCLK_FREQ2].min_value,
35543552 od8_settings[OD8_SETTING_GFXCLK_FREQ2].max_value);
3555− size += sysfs_emit_at(buf, size, "VDDC_CURVE_VOLT[1]: %7dmV %11dmV\n",
3553+ size += sprintf(buf + size, "VDDC_CURVE_VOLT[1]: %7dmV %11dmV\n",
35563554 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].min_value,
35573555 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].max_value);
3558− size += sysfs_emit_at(buf, size, "VDDC_CURVE_SCLK[2]: %7uMhz %10uMhz\n",
3556+ size += sprintf(buf + size, "VDDC_CURVE_SCLK[2]: %7uMhz %10uMhz\n",
35593557 od8_settings[OD8_SETTING_GFXCLK_FREQ3].min_value,
35603558 od8_settings[OD8_SETTING_GFXCLK_FREQ3].max_value);
3561− size += sysfs_emit_at(buf, size, "VDDC_CURVE_VOLT[2]: %7dmV %11dmV\n",
3559+ size += sprintf(buf + size, "VDDC_CURVE_VOLT[2]: %7dmV %11dmV\n",
35623560 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].min_value,
35633561 od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].max_value);
35643562 }
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+1−1
@@ -1468,7 +1468,7 @@ static int smu_disable_dpms(struct smu_context *smu) · 1467 unmodified lines
14681468 dev_err(adev->dev, "Failed to disable smu features.\n");
14691469 }
14701470
1471− if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 0, 0) &&
1471+ if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(9, 4, 2) &&
14721472 adev->gfx.rlc.funcs->stop)
14731473 adev->gfx.rlc.funcs->stop(adev);
14741474
drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c+20−2
@@ -309,6 +309,7 @@ static int cyan_skillfish_print_clk_levels(struct smu_context *smu, · 308 unmodified lines
309309 {
310310 int ret = 0, size = 0;
311311 uint32_t cur_value = 0;
312+ int i;
312313
313314 smu_cmn_get_sysfs_buf(&buf, &size);
314315
@@ -334,8 +335,6 @@ static int cyan_skillfish_print_clk_levels(struct smu_context *smu, · 19 unmodified lines
334335 size += sysfs_emit_at(buf, size, "VDDC: %7umV %10umV\n",
335336 CYAN_SKILLFISH_VDDC_MIN, CYAN_SKILLFISH_VDDC_MAX);
336337 break;
337− case SMU_GFXCLK:
338− case SMU_SCLK:
339338 case SMU_FCLK:
340339 case SMU_MCLK:
341340 case SMU_SOCCLK:
@@ -346,6 +345,25 @@ static int cyan_skillfish_print_clk_levels(struct smu_context *smu, · 4 unmodified lines
346345 return ret;
347346 size += sysfs_emit_at(buf, size, "0: %uMhz *\n", cur_value);
348347 break;
348+ case SMU_SCLK:
349+ case SMU_GFXCLK:
350+ ret = cyan_skillfish_get_current_clk_freq(smu, clk_type, &cur_value);
351+ if (ret)
352+ return ret;
353+ if (cur_value == CYAN_SKILLFISH_SCLK_MAX)
354+ i = 2;
355+ else if (cur_value == CYAN_SKILLFISH_SCLK_MIN)
356+ i = 0;
357+ else
358+ i = 1;
359+ size += sysfs_emit_at(buf, size, "0: %uMhz %s\n", CYAN_SKILLFISH_SCLK_MIN,
360+ i == 0 ? "*" : "");
361+ size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
362+ i == 1 ? cur_value : cyan_skillfish_sclk_default,
363+ i == 1 ? "*" : "");
364+ size += sysfs_emit_at(buf, size, "2: %uMhz %s\n", CYAN_SKILLFISH_SCLK_MAX,
365+ i == 2 ? "*" : "");
366+ break;
349367 default:
350368 dev_warn(smu->adev->dev, "Unsupported clock type\n");
351369 return ret;
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c+8−5
@@ -1265,7 +1265,7 @@ static int navi10_print_clk_levels(struct smu_context *smu, · 1264 unmodified lines
12651265 enum smu_clk_type clk_type, char *buf)
12661266 {
12671267 uint16_t *curve_settings;
1268− int i, size = 0, ret = 0;
1268+ int i, levels, size = 0, ret = 0;
12691269 uint32_t cur_value = 0, value = 0, count = 0;
12701270 uint32_t freq_values[3] = {0};
12711271 uint32_t mark_index = 0;
@@ -1319,14 +1319,17 @@ static int navi10_print_clk_levels(struct smu_context *smu, · 47 unmodified lines
13191319 freq_values[1] = cur_value;
13201320 mark_index = cur_value == freq_values[0] ? 0 :
13211321 cur_value == freq_values[2] ? 2 : 1;
1322− if (mark_index != 1)
1323− freq_values[1] = (freq_values[0] + freq_values[2]) / 2;
13241322
1325− for (i = 0; i < 3; i++) {
1323+ levels = 3;
1324+ if (mark_index != 1) {
1325+ levels = 2;
1326+ freq_values[1] = freq_values[2];
1327+ }
1328+
1329+ for (i = 0; i < levels; i++) {
13261330 size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n", i, freq_values[i],
13271331 i == mark_index ? "*" : "");
13281332 }
1329−
13301333 }
13311334 break;
13321335 case SMU_PCIE:
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c+26−0
@@ -683,6 +683,7 @@ static int vangogh_print_clk_levels(struct smu_context *smu, · 682 unmodified lines
683683 int i, size = 0, ret = 0;
684684 uint32_t cur_value = 0, value = 0, count = 0;
685685 bool cur_value_match_level = false;
686+ uint32_t min, max;
686687
687688 memset(&metrics, 0, sizeof(metrics));
688689
@@ -743,6 +744,13 @@ static int vangogh_print_clk_levels(struct smu_context *smu, · 54 unmodified lines
743744 if (ret)
744745 return ret;
745746 break;
747+ case SMU_GFXCLK:
748+ case SMU_SCLK:
749+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GetGfxclkFrequency, 0, &cur_value);
750+ if (ret) {
751+ return ret;
752+ }
753+ break;
746754 default:
747755 break;
748756 }
@@ -768,6 +776,24 @@ static int vangogh_print_clk_levels(struct smu_context *smu, · 19 unmodified lines
768776 if (!cur_value_match_level)
769777 size += sysfs_emit_at(buf, size, " %uMhz *\n", cur_value);
770778 break;
779+ case SMU_GFXCLK:
780+ case SMU_SCLK:
781+ min = (smu->gfx_actual_hard_min_freq > 0) ? smu->gfx_actual_hard_min_freq : smu->gfx_default_hard_min_freq;
782+ max = (smu->gfx_actual_soft_max_freq > 0) ? smu->gfx_actual_soft_max_freq : smu->gfx_default_soft_max_freq;
783+ if (cur_value == max)
784+ i = 2;
785+ else if (cur_value == min)
786+ i = 0;
787+ else
788+ i = 1;
789+ size += sysfs_emit_at(buf, size, "0: %uMhz %s\n", min,
790+ i == 0 ? "*" : "");
791+ size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
792+ i == 1 ? cur_value : VANGOGH_UMD_PSTATE_STANDARD_GFXCLK,
793+ i == 1 ? "*" : "");
794+ size += sysfs_emit_at(buf, size, "2: %uMhz %s\n", max,
795+ i == 2 ? "*" : "");
796+ break;
771797 default:
772798 break;
773799 }
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c+27−0
@@ -697,6 +697,11 @@ static int yellow_carp_get_current_clk_freq(struct smu_context *smu, · 696 unmodified lines
697697 case SMU_FCLK:
698698 return smu_cmn_send_smc_msg_with_param(smu,
699699 SMU_MSG_GetFclkFrequency, 0, value);
700+ case SMU_GFXCLK:
701+ case SMU_SCLK:
702+ return smu_cmn_send_smc_msg_with_param(smu,
703+ SMU_MSG_GetGfxclkFrequency, 0, value);
704+ break;
700705 default:
701706 return -EINVAL;
702707 }
@@ -967,6 +972,7 @@ static int yellow_carp_print_clk_levels(struct smu_context *smu, · 264 unmodified lines
967972 {
968973 int i, size = 0, ret = 0;
969974 uint32_t cur_value = 0, value = 0, count = 0;
975+ uint32_t min, max;
970976
971977 smu_cmn_get_sysfs_buf(&buf, &size);
972978
@@ -1005,6 +1011,27 @@ static int yellow_carp_print_clk_levels(struct smu_context *smu, · 32 unmodified lines
10051011 cur_value == value ? "*" : "");
10061012 }
10071013 break;
1014+ case SMU_GFXCLK:
1015+ case SMU_SCLK:
1016+ ret = yellow_carp_get_current_clk_freq(smu, clk_type, &cur_value);
1017+ if (ret)
1018+ goto print_clk_out;
1019+ min = (smu->gfx_actual_hard_min_freq > 0) ? smu->gfx_actual_hard_min_freq : smu->gfx_default_hard_min_freq;
1020+ max = (smu->gfx_actual_soft_max_freq > 0) ? smu->gfx_actual_soft_max_freq : smu->gfx_default_soft_max_freq;
1021+ if (cur_value == max)
1022+ i = 2;
1023+ else if (cur_value == min)
1024+ i = 0;
1025+ else
1026+ i = 1;
1027+ size += sysfs_emit_at(buf, size, "0: %uMhz %s\n", min,
1028+ i == 0 ? "*" : "");
1029+ size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
1030+ i == 1 ? cur_value : YELLOW_CARP_UMD_PSTATE_GFXCLK,
1031+ i == 1 ? "*" : "");
1032+ size += sysfs_emit_at(buf, size, "2: %uMhz %s\n", max,
1033+ i == 2 ? "*" : "");
1034+ break;
10081035 default:
10091036 break;
10101037 }
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.h+1−0
@@ -24,5 +24,6 @@ · 23 unmodified lines
2424 #define __YELLOW_CARP_PPT_H__
2525
2626 extern void yellow_carp_set_ppt_funcs(struct smu_context *smu);
27+#define YELLOW_CARP_UMD_PSTATE_GFXCLK 1100
2728
2829 #endif
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c+6−2
@@ -139,9 +139,13 @@ static void __smu_cmn_reg_print_error(struct smu_context *smu, · 138 unmodified lines
139139 const char *message = smu_get_message_name(smu, msg);
140140
141141 switch (reg_c2pmsg_90) {
142− case SMU_RESP_NONE:
142+ case SMU_RESP_NONE: {
143+ u32 msg_idx = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66);
144+ u32 prm = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);
143145 dev_err_ratelimited(adev->dev,
144− "SMU: I'm not done with your previous command!");
146+ "SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x%08X SMN_C2PMSG_82:0x%08X",
147+ msg_idx, prm);
148+ }
145149 break;
146150 case SMU_RESP_OK:
147151 /* The SMU executed the command. It completed with a
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c+1−1
@@ -291,7 +291,7 @@ vga_pw_show(struct device *dev, struct device_attribute *attr, char *buf) · 290 unmodified lines
291291 if (rc)
292292 return rc;
293293
294− return sprintf(buf, "%u\n", reg & 1);
294+ return sprintf(buf, "%u\n", reg);
295295 }
296296 static DEVICE_ATTR_RO(vga_pw);
297297
drivers/gpu/drm/drm_gem_cma_helper.c+7−2
@@ -210,8 +210,13 @@ void drm_gem_cma_free_object(struct drm_gem_object *gem_obj) · 209 unmodified lines
210210 dma_buf_vunmap(gem_obj->import_attach->dmabuf, &map);
211211 drm_prime_gem_destroy(gem_obj, cma_obj->sgt);
212212 } else if (cma_obj->vaddr) {
213− dma_free_wc(gem_obj->dev->dev, cma_obj->base.size,
214− cma_obj->vaddr, cma_obj->paddr);
213+ if (cma_obj->map_noncoherent)
214+ dma_free_noncoherent(gem_obj->dev->dev, cma_obj->base.size,
215+ cma_obj->vaddr, cma_obj->paddr,
216+ DMA_TO_DEVICE);
217+ else
218+ dma_free_wc(gem_obj->dev->dev, cma_obj->base.size,
219+ cma_obj->vaddr, cma_obj->paddr);
215220 }
216221
217222 drm_gem_object_release(gem_obj);
drivers/gpu/drm/drm_gem_shmem_helper.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/shmem_fs.h>
1010 #include <linux/slab.h>
1111 #include <linux/vmalloc.h>
12+#include <linux/module.h>
1213
1314 #ifdef CONFIG_X86
1415 #include <asm/set_memory.h>
drivers/gpu/drm/drm_syncobj.c+10−1
@@ -404,8 +404,17 @@ int drm_syncobj_find_fence(struct drm_file *file_private, · 403 unmodified lines
404404
405405 if (*fence) {
406406 ret = dma_fence_chain_find_seqno(fence, point);
407− if (!ret)
407+ if (!ret) {
408+ /* If the requested seqno is already signaled
409+ * drm_syncobj_find_fence may return a NULL
410+ * fence. To make sure the recipient gets
411+ * signalled, use a new fence instead.
412+ */
413+ if (!*fence)
414+ *fence = dma_fence_get_stub();
415+
408416 goto out;
417+ }
409418 dma_fence_put(*fence);
410419 } else {
411420 ret = -EINVAL;
drivers/gpu/drm/hyperv/hyperv_drm_drv.c+18−1
@@ -225,12 +225,29 @@ static int hyperv_vmbus_remove(struct hv_device *hdev) · 224 unmodified lines
225225 {
226226 struct drm_device *dev = hv_get_drvdata(hdev);
227227 struct hyperv_drm_device *hv = to_hv(dev);
228+ struct pci_dev *pdev;
228229
229230 drm_dev_unplug(dev);
230231 drm_atomic_helper_shutdown(dev);
231232 vmbus_close(hdev->channel);
232233 hv_set_drvdata(hdev, NULL);
233− vmbus_free_mmio(hv->mem->start, hv->fb_size);
234+
235+ /*
236+ * Free allocated MMIO memory only on Gen2 VMs.
237+ * On Gen1 VMs, release the PCI device
238+ */
239+ if (efi_enabled(EFI_BOOT)) {
240+ vmbus_free_mmio(hv->mem->start, hv->fb_size);
241+ } else {
242+ pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
243+ PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
244+ if (!pdev) {
245+ drm_err(dev, "Unable to find PCI Hyper-V video\n");
246+ return -ENODEV;
247+ }
248+ pci_release_region(pdev, 0);
249+ pci_dev_put(pdev);
250+ }
234251
235252 return 0;
236253 }
drivers/gpu/drm/i915/display/icl_dsi.c+4−9
@@ -696,10 +696,7 @@ static void gen11_dsi_map_pll(struct intel_encoder *encoder, · 695 unmodified lines
696696 intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, val);
697697
698698 for_each_dsi_phy(phy, intel_dsi->phys) {
699− if (DISPLAY_VER(dev_priv) >= 12)
700− val |= ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
701− else
702− val &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
699+ val &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
703700 }
704701 intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, val);
705702
@@ -1135,8 +1132,6 @@ static void · 429 unmodified lines
11351132 gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,
11361133 const struct intel_crtc_state *crtc_state)
11371134 {
1138− struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1139−
11401135 /* step 4a: power up all lanes of the DDI used by DSI */
11411136 gen11_dsi_power_up_lanes(encoder);
11421137
@@ -1162,8 +1157,7 @@ gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder, · 19 unmodified lines
11621157 gen11_dsi_configure_transcoder(encoder, crtc_state);
11631158
11641159 /* Step 4l: Gate DDI clocks */
1165− if (DISPLAY_VER(dev_priv) == 11)
1166− gen11_dsi_gate_clocks(encoder);
1160+ gen11_dsi_gate_clocks(encoder);
11671161 }
11681162
11691163 static void gen11_dsi_powerup_panel(struct intel_encoder *encoder)
@@ -1271,7 +1265,8 @@ static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder) · 101 unmodified lines
12711265 if (DISPLAY_VER(i915) == 13) {
12721266 for_each_dsi_port(port, intel_dsi->ports)
12731267 intel_de_rmw(i915, TGL_DSI_CHKN_REG(port),
1274− TGL_DSI_CHKN_LSHS_GB, 0x4);
1268+ TGL_DSI_CHKN_LSHS_GB_MASK,
1269+ TGL_DSI_CHKN_LSHS_GB(4));
12751270 }
12761271 }
12771272
drivers/gpu/drm/i915/display/intel_display_types.h+3−0
@@ -1640,6 +1640,9 @@ struct intel_dp { · 1639 unmodified lines
16401640 struct intel_dp_pcon_frl frl;
16411641
16421642 struct intel_psr psr;
1643+
1644+ /* When we last wrote the OUI for eDP */
1645+ unsigned long last_oui_write;
16431646 };
16441647
16451648 enum lspcon_vendor {
drivers/gpu/drm/i915/display/intel_dp.c+11−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/i2c.h>
3030 #include <linux/notifier.h>
3131 #include <linux/slab.h>
32+#include <linux/timekeeping.h>
3233 #include <linux/types.h>
3334
3435 #include <asm/byteorder.h>
@@ -1955,6 +1956,16 @@ intel_edp_init_source_oui(struct intel_dp *intel_dp, bool careful) · 1920 unmodified lines
19551956
19561957 if (drm_dp_dpcd_write(&intel_dp->aux, DP_SOURCE_OUI, oui, sizeof(oui)) < 0)
19571958 drm_err(&i915->drm, "Failed to write source OUI\n");
1959+
1960+ intel_dp->last_oui_write = jiffies;
1961+}
1962+
1963+void intel_dp_wait_source_oui(struct intel_dp *intel_dp)
1964+{
1965+ struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1966+
1967+ drm_dbg_kms(&i915->drm, "Performing OUI wait\n");
1968+ wait_remaining_ms_from_jiffies(intel_dp->last_oui_write, 30);
19581969 }
19591970
19601971 /* If the device supports it, try to set the power state appropriately */
drivers/gpu/drm/i915/display/intel_dp.h+2−0
@@ -119,4 +119,6 @@ void intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp, · 118 unmodified lines
119119 const struct intel_crtc_state *crtc_state);
120120 void intel_dp_phy_test(struct intel_encoder *encoder);
121121
122+void intel_dp_wait_source_oui(struct intel_dp *intel_dp);
123+
122124 #endif /* __INTEL_DP_H__ */
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c+26−6
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636
3737 #include "intel_backlight.h"
3838 #include "intel_display_types.h"
39+#include "intel_dp.h"
3940 #include "intel_dp_aux_backlight.h"
4041
4142 /* TODO:
@@ -106,6 +107,8 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector) · 64 unmodified lines
106107 int ret;
107108 u8 tcon_cap[4];
108109
110+ intel_dp_wait_source_oui(intel_dp);
111+
109112 ret = drm_dp_dpcd_read(aux, INTEL_EDP_HDR_TCON_CAP0, tcon_cap, sizeof(tcon_cap));
110113 if (ret != sizeof(tcon_cap))
111114 return false;
@@ -204,6 +207,8 @@ intel_dp_aux_hdr_enable_backlight(const struct intel_crtc_state *crtc_state, · 92 unmodified lines
204207 int ret;
205208 u8 old_ctrl, ctrl;
206209
210+ intel_dp_wait_source_oui(intel_dp);
211+
207212 ret = drm_dp_dpcd_readb(&intel_dp->aux, INTEL_EDP_HDR_GETSET_CTRL_PARAMS, &old_ctrl);
208213 if (ret != 1) {
209214 drm_err(&i915->drm, "Failed to read current backlight control mode: %d\n", ret);
@@ -293,6 +298,13 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state, · 83 unmodified lines
293298 struct intel_panel *panel = &connector->panel;
294299 struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
295300
301+ if (!panel->backlight.edp.vesa.info.aux_enable) {
302+ u32 pwm_level = intel_backlight_invert_pwm_level(connector,
303+ panel->backlight.pwm_level_max);
304+
305+ panel->backlight.pwm_funcs->enable(crtc_state, conn_state, pwm_level);
306+ }
307+
296308 drm_edp_backlight_enable(&intel_dp->aux, &panel->backlight.edp.vesa.info, level);
297309 }
298310
@@ -304,6 +316,10 @@ static void intel_dp_aux_vesa_disable_backlight(const struct drm_connector_state · 5 unmodified lines
304316 struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
305317
306318 drm_edp_backlight_disable(&intel_dp->aux, &panel->backlight.edp.vesa.info);
319+
320+ if (!panel->backlight.edp.vesa.info.aux_enable)
321+ panel->backlight.pwm_funcs->disable(old_conn_state,
322+ intel_backlight_invert_pwm_level(connector, 0));
307323 }
308324
309325 static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector, enum pipe pipe)
@@ -321,6 +337,15 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector, · 11 unmodified lines
321337 if (ret < 0)
322338 return ret;
323339
340+ if (!panel->backlight.edp.vesa.info.aux_enable) {
341+ ret = panel->backlight.pwm_funcs->setup(connector, pipe);
342+ if (ret < 0) {
343+ drm_err(&i915->drm,
344+ "Failed to setup PWM backlight controls for eDP backlight: %d\n",
345+ ret);
346+ return ret;
347+ }
348+ }
324349 panel->backlight.max = panel->backlight.edp.vesa.info.max;
325350 panel->backlight.min = 0;
326351 if (current_mode == DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD) {
@@ -340,12 +365,7 @@ intel_dp_aux_supports_vesa_backlight(struct intel_connector *connector) · 13 unmodified lines
340365 struct intel_dp *intel_dp = intel_attached_dp(connector);
341366 struct drm_i915_private *i915 = dp_to_i915(intel_dp);
342367
343− /* TODO: We currently only support AUX only backlight configurations, not backlights which
344− * require a mix of PWM and AUX controls to work. In the mean time, these machines typically
345− * work just fine using normal PWM controls anyway.
346− */
347− if ((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
348− drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
368+ if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
349369 drm_dbg_kms(&i915->drm, "AUX Backlight Control Supported!\n");
350370 return true;
351371 }
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+1−0
@@ -3277,6 +3277,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, · 3276 unmodified lines
32773277 out_fence = eb_requests_create(&eb, in_fence, out_fence_fd);
32783278 if (IS_ERR(out_fence)) {
32793279 err = PTR_ERR(out_fence);
3280+ out_fence = NULL;
32803281 if (eb.requests[0])
32813282 goto err_request;
32823283 else
drivers/gpu/drm/i915/gt/intel_gt_pm.c+4−3
@@ -301,7 +301,7 @@ void intel_gt_suspend_prepare(struct intel_gt *gt) · 300 unmodified lines
301301 user_forcewake(gt, true);
302302 wait_for_suspend(gt);
303303
304− intel_pxp_suspend(&gt->pxp, false);
304+ intel_pxp_suspend_prepare(&gt->pxp);
305305 }
306306
307307 static suspend_state_t pm_suspend_target(void)
@@ -326,6 +326,7 @@ void intel_gt_suspend_late(struct intel_gt *gt) · 18 unmodified lines
326326 GEM_BUG_ON(gt->awake);
327327
328328 intel_uc_suspend(&gt->uc);
329+ intel_pxp_suspend(&gt->pxp);
329330
330331 /*
331332 * On disabling the device, we want to turn off HW access to memory
@@ -353,7 +354,7 @@ void intel_gt_suspend_late(struct intel_gt *gt) · 21 unmodified lines
353354
354355 void intel_gt_runtime_suspend(struct intel_gt *gt)
355356 {
356− intel_pxp_suspend(&gt->pxp, true);
357+ intel_pxp_runtime_suspend(&gt->pxp);
357358 intel_uc_runtime_suspend(&gt->uc);
358359
359360 GT_TRACE(gt, "\n");
@@ -371,7 +372,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt) · 11 unmodified lines
371372 if (ret)
372373 return ret;
373374
374− intel_pxp_resume(&gt->pxp);
375+ intel_pxp_runtime_resume(&gt->pxp);
375376
376377 return 0;
377378 }
drivers/gpu/drm/i915/gt/intel_gtt.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <linux/slab.h> /* fault-inject.h is not standalone! */
77
88 #include <linux/fault-inject.h>
9+#include <linux/sched/mm.h>
910
1011 #include "gem/i915_gem_lmem.h"
1112 #include "i915_trace.h"
drivers/gpu/drm/i915/gt/intel_workarounds.c+9−16
@@ -621,13 +621,6 @@ static void gen12_ctx_workarounds_init(struct intel_engine_cs *engine, · 620 unmodified lines
621621 FF_MODE2_GS_TIMER_MASK,
622622 FF_MODE2_GS_TIMER_224,
623623 0, false);
624−
625− /*
626− * Wa_14012131227:dg1
627− * Wa_1508744258:tgl,rkl,dg1,adl-s,adl-p
628− */
629− wa_masked_en(wal, GEN7_COMMON_SLICE_CHICKEN1,
630− GEN9_RHWO_OPTIMIZATION_DISABLE);
631624 }
632625
633626 static void dg1_ctx_workarounds_init(struct intel_engine_cs *engine,
@@ -1134,6 +1127,15 @@ icl_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal) · 500 unmodified lines
11341127 GAMT_CHKN_BIT_REG,
11351128 GAMT_CHKN_DISABLE_L3_COH_PIPE);
11361129
1130+ /* Wa_1407352427:icl,ehl */
1131+ wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE2,
1132+ PSDUNIT_CLKGATE_DIS);
1133+
1134+ /* Wa_1406680159:icl,ehl */
1135+ wa_write_or(wal,
1136+ SUBSLICE_UNIT_LEVEL_CLKGATE,
1137+ GWUNIT_CLKGATE_DIS);
1138+
11371139 /* Wa_1607087056:icl,ehl,jsl */
11381140 if (IS_ICELAKE(i915) ||
11391141 IS_JSL_EHL_GT_STEP(i915, STEP_A0, STEP_B0))
@@ -1859,15 +1861,6 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) · 719 unmodified lines
18591861 wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE,
18601862 VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS);
18611863
1862− /* Wa_1407352427:icl,ehl */
1863− wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE2,
1864− PSDUNIT_CLKGATE_DIS);
1865−
1866− /* Wa_1406680159:icl,ehl */
1867− wa_write_or(wal,
1868− SUBSLICE_UNIT_LEVEL_CLKGATE,
1869− GWUNIT_CLKGATE_DIS);
1870−
18711864 /*
18721865 * Wa_1408767742:icl[a2..forever],ehl[all]
18731866 * Wa_1605460711:icl[a0..c0]
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c+2−2
@@ -3080,8 +3080,8 @@ guc_create_parallel(struct intel_engine_cs **engines, · 3079 unmodified lines
30803080
30813081 ce = intel_engine_create_virtual(siblings, num_siblings,
30823082 FORCE_VIRTUAL);
3083− if (!ce) {
3084− err = ERR_PTR(-ENOMEM);
3083+ if (IS_ERR(ce)) {
3084+ err = ERR_CAST(ce);
30853085 goto unwind;
30863086 }
30873087
drivers/gpu/drm/i915/i915_reg.h+3−1
@@ -11717,7 +11717,9 @@ enum skl_power_gate { · 11716 unmodified lines
1171711717 #define TGL_DSI_CHKN_REG(port) _MMIO_PORT(port, \
1171811718 _TGL_DSI_CHKN_REG_0, \
1171911719 _TGL_DSI_CHKN_REG_1)
11720−#define TGL_DSI_CHKN_LSHS_GB REG_GENMASK(15, 12)
11720+#define TGL_DSI_CHKN_LSHS_GB_MASK REG_GENMASK(15, 12)
11721+#define TGL_DSI_CHKN_LSHS_GB(byte_clocks) REG_FIELD_PREP(TGL_DSI_CHKN_LSHS_GB_MASK, \
11722+ (byte_clocks))
1172111723
1172211724 /* Display Stream Splitter Control */
1172311725 #define DSS_CTL1 _MMIO(0x67400)
drivers/gpu/drm/i915/i915_request.c+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/sched.h>
3030 #include <linux/sched/clock.h>
3131 #include <linux/sched/signal.h>
32+#include <linux/sched/mm.h>
3233
3334 #include "gem/i915_gem_context.h"
3435 #include "gt/intel_breadcrumbs.h"
drivers/gpu/drm/i915/pxp/intel_pxp_pm.c+26−11
@@ -7,26 +7,29 @@ · 6 unmodified lines
77 #include "intel_pxp_irq.h"
88 #include "intel_pxp_pm.h"
99 #include "intel_pxp_session.h"
10+#include "i915_drv.h"
1011
11−void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
12+void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
1213 {
1314 if (!intel_pxp_is_enabled(pxp))
1415 return;
1516
1617 pxp->arb_is_valid = false;
1718
18− /*
19− * Contexts using protected objects keep a runtime PM reference, so we
20− * can only runtime suspend when all of them have been either closed
21− * or banned. Therefore, there is no need to invalidate in that
22− * scenario.
23− */
24− if (!runtime)
25− intel_pxp_invalidate(pxp);
19+ intel_pxp_invalidate(pxp);
20+}
2621
27− intel_pxp_fini_hw(pxp);
22+void intel_pxp_suspend(struct intel_pxp *pxp)
23+{
24+ intel_wakeref_t wakeref;
2825
29− pxp->hw_state_invalidated = false;
26+ if (!intel_pxp_is_enabled(pxp))
27+ return;
28+
29+ with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
30+ intel_pxp_fini_hw(pxp);
31+ pxp->hw_state_invalidated = false;
32+ }
3033 }
3134
3235 void intel_pxp_resume(struct intel_pxp *pxp)
@@ -44,3 +47,15 @@ void intel_pxp_resume(struct intel_pxp *pxp) · 11 unmodified lines
4447
4548 intel_pxp_init_hw(pxp);
4649 }
50+
51+void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
52+{
53+ if (!intel_pxp_is_enabled(pxp))
54+ return;
55+
56+ pxp->arb_is_valid = false;
57+
58+ intel_pxp_fini_hw(pxp);
59+
60+ pxp->hw_state_invalidated = false;
61+}
drivers/gpu/drm/i915/pxp/intel_pxp_pm.h+16−3
@@ -9,16 +9,29 @@ · 8 unmodified lines
99 #include "intel_pxp_types.h"
1010
1111 #ifdef CONFIG_DRM_I915_PXP
12−void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime);
12+void intel_pxp_suspend_prepare(struct intel_pxp *pxp);
13+void intel_pxp_suspend(struct intel_pxp *pxp);
1314 void intel_pxp_resume(struct intel_pxp *pxp);
15+void intel_pxp_runtime_suspend(struct intel_pxp *pxp);
1416 #else
15−static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
17+static inline void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
18+{
19+}
20+
21+static inline void intel_pxp_suspend(struct intel_pxp *pxp)
1622 {
1723 }
1824
1925 static inline void intel_pxp_resume(struct intel_pxp *pxp)
2026 {
2127 }
22−#endif
2328
29+static inline void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
30+{
31+}
32+#endif
33+static inline void intel_pxp_runtime_resume(struct intel_pxp *pxp)
34+{
35+ intel_pxp_resume(pxp);
36+}
2437 #endif /* __INTEL_PXP_PM_H__ */
drivers/gpu/drm/lima/lima_device.c+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 #include <linux/regulator/consumer.h>
55 #include <linux/reset.h>
66 #include <linux/clk.h>
7+#include <linux/slab.h>
78 #include <linux/dma-mapping.h>
89 #include <linux/platform_device.h>
910
drivers/gpu/drm/msm/Kconfig+1−1
@@ -4,8 +4,8 @@ config DRM_MSM · 3 unmodified lines
44 tristate "MSM DRM"
55 depends on DRM
66 depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
7+ depends on COMMON_CLK
78 depends on IOMMU_SUPPORT
8− depends on (OF && COMMON_CLK) || COMPILE_TEST
99 depends on QCOM_OCMEM || QCOM_OCMEM=n
1010 depends on QCOM_LLCC || QCOM_LLCC=n
1111 depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n
drivers/gpu/drm/msm/Makefile+3−3
@@ -23,8 +23,10 @@ msm-y := \ · 22 unmodified lines
2323 hdmi/hdmi_i2c.o \
2424 hdmi/hdmi_phy.o \
2525 hdmi/hdmi_phy_8960.o \
26+ hdmi/hdmi_phy_8996.o \
2627 hdmi/hdmi_phy_8x60.o \
2728 hdmi/hdmi_phy_8x74.o \
29+ hdmi/hdmi_pll_8960.o \
2830 edp/edp.o \
2931 edp/edp_aux.o \
3032 edp/edp_bridge.o \
@@ -37,6 +39,7 @@ msm-y := \ · 6 unmodified lines
3739 disp/mdp4/mdp4_dtv_encoder.o \
3840 disp/mdp4/mdp4_lcdc_encoder.o \
3941 disp/mdp4/mdp4_lvds_connector.o \
42+ disp/mdp4/mdp4_lvds_pll.o \
4043 disp/mdp4/mdp4_irq.o \
4144 disp/mdp4/mdp4_kms.o \
4245 disp/mdp4/mdp4_plane.o \
@@ -116,9 +119,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ · 73 unmodified lines
116119 dp/dp_audio.o
117120
118121 msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
119−msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
120−msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
121−msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_phy_8996.o
122122
123123 msm-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
124124
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+10−10
@@ -1424,17 +1424,24 @@ static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu) · 1423 unmodified lines
14241424 {
14251425 struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
14261426 struct msm_gpu *gpu = &adreno_gpu->base;
1427− u32 gpu_scid, cntl1_regval = 0;
1427+ u32 cntl1_regval = 0;
14281428
14291429 if (IS_ERR(a6xx_gpu->llc_mmio))
14301430 return;
14311431
14321432 if (!llcc_slice_activate(a6xx_gpu->llc_slice)) {
1433− gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice);
1433+ u32 gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice);
14341434
14351435 gpu_scid &= 0x1f;
14361436 cntl1_regval = (gpu_scid << 0) | (gpu_scid << 5) | (gpu_scid << 10) |
14371437 (gpu_scid << 15) | (gpu_scid << 20);
1438+
1439+ /* On A660, the SCID programming for UCHE traffic is done in
1440+ * A6XX_GBIF_SCACHE_CNTL0[14:10]
1441+ */
1442+ if (adreno_is_a660_family(adreno_gpu))
1443+ gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL0, (0x1f << 10) |
1444+ (1 << 8), (gpu_scid << 10) | (1 << 8));
14381445 }
14391446
14401447 /*
@@ -1471,13 +1478,6 @@ static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu) · 30 unmodified lines
14711478 }
14721479
14731480 gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL1, GENMASK(24, 0), cntl1_regval);
1474−
1475− /* On A660, the SCID programming for UCHE traffic is done in
1476− * A6XX_GBIF_SCACHE_CNTL0[14:10]
1477− */
1478− if (adreno_is_a660_family(adreno_gpu))
1479− gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL0, (0x1f << 10) |
1480− (1 << 8), (gpu_scid << 10) | (1 << 8));
14811481 }
14821482
14831483 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
@@ -1640,7 +1640,7 @@ static unsigned long a6xx_gpu_busy(struct msm_gpu *gpu) · 156 unmodified lines
16401640 return (unsigned long)busy_time;
16411641 }
16421642
1643−void a6xx_gpu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
1643+static void a6xx_gpu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
16441644 {
16451645 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
16461646 struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c+2−2
@@ -777,12 +777,12 @@ static void a6xx_get_gmu_registers(struct msm_gpu *gpu, · 776 unmodified lines
777777 struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
778778
779779 a6xx_state->gmu_registers = state_kcalloc(a6xx_state,
780− 2, sizeof(*a6xx_state->gmu_registers));
780+ 3, sizeof(*a6xx_state->gmu_registers));
781781
782782 if (!a6xx_state->gmu_registers)
783783 return;
784784
785− a6xx_state->nr_gmu_registers = 2;
785+ a6xx_state->nr_gmu_registers = 3;
786786
787787 /* Get the CX GMU registers from AHB */
788788 _a6xx_get_gmu_registers(gpu, a6xx_state, &a6xx_gmu_reglist[0],
drivers/gpu/drm/msm/dp/dp_aux.c+17−0
@@ -33,6 +33,7 @@ struct dp_aux_private { · 32 unmodified lines
3333 bool read;
3434 bool no_send_addr;
3535 bool no_send_stop;
36+ bool initted;
3637 u32 offset;
3738 u32 segment;
3839
@@ -331,6 +332,10 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, · 292 unmodified lines
331332 }
332333
333334 mutex_lock(&aux->mutex);
335+ if (!aux->initted) {
336+ ret = -EIO;
337+ goto exit;
338+ }
334339
335340 dp_aux_update_offset_and_segment(aux, msg);
336341 dp_aux_transfer_helper(aux, msg, true);
@@ -380,6 +385,8 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, · 43 unmodified lines
380385 }
381386
382387 aux->cmd_busy = false;
388+
389+exit:
383390 mutex_unlock(&aux->mutex);
384391
385392 return ret;
@@ -431,8 +438,13 @@ void dp_aux_init(struct drm_dp_aux *dp_aux) · 45 unmodified lines
431438
432439 aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
433440
441+ mutex_lock(&aux->mutex);
442+
434443 dp_catalog_aux_enable(aux->catalog, true);
435444 aux->retry_cnt = 0;
445+ aux->initted = true;
446+
447+ mutex_unlock(&aux->mutex);
436448 }
437449
438450 void dp_aux_deinit(struct drm_dp_aux *dp_aux)
@@ -441,7 +453,12 @@ void dp_aux_deinit(struct drm_dp_aux *dp_aux) · 2 unmodified lines
441453
442454 aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
443455
456+ mutex_lock(&aux->mutex);
457+
458+ aux->initted = false;
444459 dp_catalog_aux_enable(aux->catalog, false);
460+
461+ mutex_unlock(&aux->mutex);
445462 }
446463
447464 int dp_aux_register(struct drm_dp_aux *dp_aux)
drivers/gpu/drm/msm/dsi/dsi_host.c+2−0
@@ -1658,6 +1658,8 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host, · 1657 unmodified lines
16581658 if (!prop) {
16591659 DRM_DEV_DEBUG(dev,
16601660 "failed to find data lane mapping, using default\n");
1661+ /* Set the number of date lanes to 4 by default. */
1662+ msm_host->num_data_lanes = 4;
16611663 return 0;
16621664 }
16631665
drivers/gpu/drm/msm/msm_debugfs.c+1−0
@@ -77,6 +77,7 @@ static int msm_gpu_open(struct inode *inode, struct file *file) · 76 unmodified lines
7777 goto free_priv;
7878
7979 pm_runtime_get_sync(&gpu->pdev->dev);
80+ msm_gpu_hw_init(gpu);
8081 show_priv->state = gpu->funcs->gpu_state_get(gpu);
8182 pm_runtime_put_sync(&gpu->pdev->dev);
8283
drivers/gpu/drm/msm/msm_drv.c+32−17
@@ -967,29 +967,18 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data, · 966 unmodified lines
967967 return ret;
968968 }
969969
970−static int msm_ioctl_wait_fence(struct drm_device *dev, void *data,
971− struct drm_file *file)
970+static int wait_fence(struct msm_gpu_submitqueue *queue, uint32_t fence_id,
971+ ktime_t timeout)
972972 {
973− struct msm_drm_private *priv = dev->dev_private;
974− struct drm_msm_wait_fence *args = data;
975− ktime_t timeout = to_ktime(args->timeout);
976− struct msm_gpu_submitqueue *queue;
977− struct msm_gpu *gpu = priv->gpu;
978973 struct dma_fence *fence;
979974 int ret;
980975
981− if (args->pad) {
982− DRM_ERROR("invalid pad: %08x\n", args->pad);
976+ if (fence_id > queue->last_fence) {
977+ DRM_ERROR_RATELIMITED("waiting on invalid fence: %u (of %u)\n",
978+ fence_id, queue->last_fence);
983979 return -EINVAL;
984980 }
985981
986− if (!gpu)
987− return 0;
988−
989− queue = msm_submitqueue_get(file->driver_priv, args->queueid);
990− if (!queue)
991− return -ENOENT;
992−
993982 /*
994983 * Map submitqueue scoped "seqno" (which is actually an idr key)
995984 * back to underlying dma-fence
@@ -1001,7 +990,7 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data, · 5 unmodified lines
1001990 ret = mutex_lock_interruptible(&queue->lock);
1002991 if (ret)
1003992 return ret;
1004− fence = idr_find(&queue->fence_idr, args->fence);
993+ fence = idr_find(&queue->fence_idr, fence_id);
1005994 if (fence)
1006995 fence = dma_fence_get_rcu(fence);
1007996 mutex_unlock(&queue->lock);
@@ -1017,6 +1006,32 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data, · 9 unmodified lines
10171006 }
10181007
10191008 dma_fence_put(fence);
1009+
1010+ return ret;
1011+}
1012+
1013+static int msm_ioctl_wait_fence(struct drm_device *dev, void *data,
1014+ struct drm_file *file)
1015+{
1016+ struct msm_drm_private *priv = dev->dev_private;
1017+ struct drm_msm_wait_fence *args = data;
1018+ struct msm_gpu_submitqueue *queue;
1019+ int ret;
1020+
1021+ if (args->pad) {
1022+ DRM_ERROR("invalid pad: %08x\n", args->pad);
1023+ return -EINVAL;
1024+ }
1025+
1026+ if (!priv->gpu)
1027+ return 0;
1028+
1029+ queue = msm_submitqueue_get(file->driver_priv, args->queueid);
1030+ if (!queue)
1031+ return -ENOENT;
1032+
1033+ ret = wait_fence(queue, args->fence, to_ktime(args->timeout));
1034+
10201035 msm_submitqueue_put(queue);
10211036
10221037 return ret;
drivers/gpu/drm/msm/msm_gem.c+2−3
@@ -1056,8 +1056,7 @@ static int msm_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct · 1055 unmodified lines
10561056 {
10571057 struct msm_gem_object *msm_obj = to_msm_bo(obj);
10581058
1059− vma->vm_flags &= ~VM_PFNMAP;
1060− vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND;
1059+ vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP;
10611060 vma->vm_page_prot = msm_gem_pgprot(msm_obj, vm_get_page_prot(vma->vm_flags));
10621061
10631062 return 0;
@@ -1121,7 +1120,7 @@ static int msm_gem_new_impl(struct drm_device *dev, · 57 unmodified lines
11211120 break;
11221121 fallthrough;
11231122 default:
1124− DRM_DEV_ERROR(dev->dev, "invalid cache flag: %x\n",
1123+ DRM_DEV_DEBUG(dev->dev, "invalid cache flag: %x\n",
11251124 (flags & MSM_BO_CACHE_MASK));
11261125 return -EINVAL;
11271126 }
drivers/gpu/drm/msm/msm_gem_shrinker.c+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 */
66
77 #include <linux/vmalloc.h>
8+#include <linux/sched/mm.h>
89
910 #include "msm_drv.h"
1011 #include "msm_gem.h"
drivers/gpu/drm/msm/msm_gem_submit.c+2−0
@@ -772,6 +772,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 771 unmodified lines
772772 args->nr_cmds);
773773 if (IS_ERR(submit)) {
774774 ret = PTR_ERR(submit);
775+ submit = NULL;
775776 goto out_unlock;
776777 }
777778
@@ -904,6 +905,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 126 unmodified lines
904905 drm_sched_entity_push_job(&submit->base);
905906
906907 args->fence = submit->fence_id;
908+ queue->last_fence = submit->fence_id;
907909
908910 msm_reset_syncobjs(syncobjs_to_reset, args->nr_in_syncobjs);
909911 msm_process_post_deps(post_deps, args->nr_out_syncobjs,
drivers/gpu/drm/msm/msm_gpu.h+3−0
@@ -359,6 +359,8 @@ static inline int msm_gpu_convert_priority(struct msm_gpu *gpu, int prio, · 358 unmodified lines
359359 * @ring_nr: the ringbuffer used by this submitqueue, which is determined
360360 * by the submitqueue's priority
361361 * @faults: the number of GPU hangs associated with this submitqueue
362+ * @last_fence: the sequence number of the last allocated fence (for error
363+ * checking)
362364 * @ctx: the per-drm_file context associated with the submitqueue (ie.
363365 * which set of pgtables do submits jobs associated with the
364366 * submitqueue use)
@@ -374,6 +376,7 @@ struct msm_gpu_submitqueue { · 9 unmodified lines
374376 u32 flags;
375377 u32 ring_nr;
376378 int faults;
379+ uint32_t last_fence;
377380 struct msm_file_private *ctx;
378381 struct list_head node;
379382 struct idr fence_idr;
drivers/gpu/drm/msm/msm_gpu_devfreq.c+9−4
@@ -20,6 +20,10 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, · 19 unmodified lines
2020 struct msm_gpu *gpu = dev_to_gpu(dev);
2121 struct dev_pm_opp *opp;
2222
23+ /*
24+ * Note that devfreq_recommended_opp() can modify the freq
25+ * to something that actually is in the opp table:
26+ */
2327 opp = devfreq_recommended_opp(dev, freq, flags);
2428
2529 /*
@@ -28,6 +32,7 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, · 2 unmodified lines
2832 */
2933 if (gpu->devfreq.idle_freq) {
3034 gpu->devfreq.idle_freq = *freq;
35+ dev_pm_opp_put(opp);
3136 return 0;
3237 }
3338
@@ -203,9 +208,6 @@ static void msm_devfreq_idle_work(struct kthread_work *work) · 169 unmodified lines
203208 struct msm_gpu *gpu = container_of(df, struct msm_gpu, devfreq);
204209 unsigned long idle_freq, target_freq = 0;
205210
206− if (!df->devfreq)
207− return;
208−
209211 /*
210212 * Hold devfreq lock to synchronize with get_dev_status()/
211213 * target() callbacks
@@ -227,6 +229,9 @@ void msm_devfreq_idle(struct msm_gpu *gpu) · 15 unmodified lines
227229 {
228230 struct msm_gpu_devfreq *df = &gpu->devfreq;
229231
232+ if (!df->devfreq)
233+ return;
234+
230235 msm_hrtimer_queue_work(&df->idle_work, ms_to_ktime(1),
231− HRTIMER_MODE_ABS);
236+ HRTIMER_MODE_REL);
232237 }
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+22−0
@@ -2626,6 +2626,27 @@ nv174_chipset = { · 2625 unmodified lines
26262626 .fifo = { 0x00000001, ga102_fifo_new },
26272627 };
26282628
2629+static const struct nvkm_device_chip
2630+nv176_chipset = {
2631+ .name = "GA106",
2632+ .bar = { 0x00000001, tu102_bar_new },
2633+ .bios = { 0x00000001, nvkm_bios_new },
2634+ .devinit = { 0x00000001, ga100_devinit_new },
2635+ .fb = { 0x00000001, ga102_fb_new },
2636+ .gpio = { 0x00000001, ga102_gpio_new },
2637+ .i2c = { 0x00000001, gm200_i2c_new },
2638+ .imem = { 0x00000001, nv50_instmem_new },
2639+ .mc = { 0x00000001, ga100_mc_new },
2640+ .mmu = { 0x00000001, tu102_mmu_new },
2641+ .pci = { 0x00000001, gp100_pci_new },
2642+ .privring = { 0x00000001, gm200_privring_new },
2643+ .timer = { 0x00000001, gk20a_timer_new },
2644+ .top = { 0x00000001, ga100_top_new },
2645+ .disp = { 0x00000001, ga102_disp_new },
2646+ .dma = { 0x00000001, gv100_dma_new },
2647+ .fifo = { 0x00000001, ga102_fifo_new },
2648+};
2649+
26292650 static const struct nvkm_device_chip
26302651 nv177_chipset = {
26312652 .name = "GA107",
@@ -3072,6 +3093,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 440 unmodified lines
30723093 case 0x168: device->chip = &nv168_chipset; break;
30733094 case 0x172: device->chip = &nv172_chipset; break;
30743095 case 0x174: device->chip = &nv174_chipset; break;
3096+ case 0x176: device->chip = &nv176_chipset; break;
30753097 case 0x177: device->chip = &nv177_chipset; break;
30763098 default:
30773099 if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmigv100.c+0−1
@@ -62,7 +62,6 @@ gv100_hdmi_ctrl(struct nvkm_ior *ior, int head, bool enable, u8 max_ac_packet, · 61 unmodified lines
6262 nvkm_wr32(device, 0x6f0108 + hdmi, vendor_infoframe.header);
6363 nvkm_wr32(device, 0x6f010c + hdmi, vendor_infoframe.subpack0_low);
6464 nvkm_wr32(device, 0x6f0110 + hdmi, vendor_infoframe.subpack0_high);
65− nvkm_wr32(device, 0x6f0110 + hdmi, 0x00000000);
6665 nvkm_wr32(device, 0x6f0114 + hdmi, 0x00000000);
6766 nvkm_wr32(device, 0x6f0118 + hdmi, 0x00000000);
6867 nvkm_wr32(device, 0x6f011c + hdmi, 0x00000000);
drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c+4−2
@@ -207,11 +207,13 @@ int · 206 unmodified lines
207207 gm200_acr_wpr_parse(struct nvkm_acr *acr)
208208 {
209209 const struct wpr_header *hdr = (void *)acr->wpr_fw->data;
210+ struct nvkm_acr_lsfw *lsfw;
210211
211212 while (hdr->falcon_id != WPR_HEADER_V0_FALCON_ID_INVALID) {
212213 wpr_header_dump(&acr->subdev, hdr);
213− if (!nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id))
214− return -ENOMEM;
214+ lsfw = nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id);
215+ if (IS_ERR(lsfw))
216+ return PTR_ERR(lsfw);
215217 }
216218
217219 return 0;
drivers/gpu/drm/nouveau/nvkm/subdev/acr/gp102.c+4−2
@@ -161,11 +161,13 @@ int · 160 unmodified lines
161161 gp102_acr_wpr_parse(struct nvkm_acr *acr)
162162 {
163163 const struct wpr_header_v1 *hdr = (void *)acr->wpr_fw->data;
164+ struct nvkm_acr_lsfw *lsfw;
164165
165166 while (hdr->falcon_id != WPR_HEADER_V1_FALCON_ID_INVALID) {
166167 wpr_header_v1_dump(&acr->subdev, hdr);
167− if (!nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id))
168− return -ENOMEM;
168+ lsfw = nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id);
169+ if (IS_ERR(lsfw))
170+ return PTR_ERR(lsfw);
169171 }
170172
171173 return 0;
drivers/gpu/drm/scheduler/sched_main.c+5−1
@@ -704,9 +704,13 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job, · 703 unmodified lines
704704 int ret;
705705
706706 dma_resv_for_each_fence(&cursor, obj->resv, write, fence) {
707+ /* Make sure to grab an additional ref on the added fence */
708+ dma_fence_get(fence);
707709 ret = drm_sched_job_add_dependency(job, fence);
708− if (ret)
710+ if (ret) {
711+ dma_fence_put(fence);
709712 return ret;
713+ }
710714 }
711715 return 0;
712716 }
drivers/gpu/drm/sun4i/Kconfig+1−0
@@ -46,6 +46,7 @@ config DRM_SUN6I_DSI · 45 unmodified lines
4646 default MACH_SUN8I
4747 select CRC_CCITT
4848 select DRM_MIPI_DSI
49+ select RESET_CONTROLLER
4950 select PHY_SUN6I_MIPI_DPHY
5051 help
5152 Choose this option if you want have an Allwinner SoC with
drivers/gpu/drm/ttm/ttm_bo.c+2−1
@@ -1103,7 +1103,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx, · 1102 unmodified lines
11031103 * as an indication that we're about to swap out.
11041104 */
11051105 memset(&place, 0, sizeof(place));
1106− place.mem_type = TTM_PL_SYSTEM;
1106+ place.mem_type = bo->resource->mem_type;
11071107 if (!ttm_bo_evict_swapout_allowable(bo, ctx, &place, &locked, NULL))
11081108 return -EBUSY;
11091109
@@ -1135,6 +1135,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx, · 25 unmodified lines
11351135 struct ttm_place hop;
11361136
11371137 memset(&hop, 0, sizeof(hop));
1138+ place.mem_type = TTM_PL_SYSTEM;
11381139 ret = ttm_resource_alloc(bo, &place, &evict_mem);
11391140 if (unlikely(ret))
11401141 goto out;
drivers/gpu/drm/ttm/ttm_tt.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <linux/sched.h>
3535 #include <linux/shmem_fs.h>
3636 #include <linux/file.h>
37+#include <linux/module.h>
3738 #include <drm/drm_cache.h>
3839 #include <drm/ttm/ttm_bo_driver.h>
3940
drivers/gpu/drm/vc4/vc4_bo.c+1−1
@@ -391,7 +391,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) · 390 unmodified lines
391391
392392 bo = kzalloc(sizeof(*bo), GFP_KERNEL);
393393 if (!bo)
394− return ERR_PTR(-ENOMEM);
394+ return NULL;
395395
396396 bo->madv = VC4_MADV_WILLNEED;
397397 refcount_set(&bo->usecnt, 0);
drivers/gpu/drm/vc4/vc4_kms.c+18−22
@@ -337,10 +337,10 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) · 336 unmodified lines
337337 struct drm_device *dev = state->dev;
338338 struct vc4_dev *vc4 = to_vc4_dev(dev);
339339 struct vc4_hvs *hvs = vc4->hvs;
340− struct drm_crtc_state *old_crtc_state;
341340 struct drm_crtc_state *new_crtc_state;
342341 struct drm_crtc *crtc;
343342 struct vc4_hvs_state *old_hvs_state;
343+ unsigned int channel;
344344 int i;
345345
346346 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
@@ -353,30 +353,32 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) · 6 unmodified lines
353353 vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel);
354354 }
355355
356− if (vc4->hvs->hvs5)
357− clk_set_min_rate(hvs->core_clk, 500000000);
358−
359356 old_hvs_state = vc4_hvs_get_old_global_state(state);
360− if (!old_hvs_state)
357+ if (IS_ERR(old_hvs_state))
361358 return;
362359
363− for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) {
364− struct vc4_crtc_state *vc4_crtc_state =
365− to_vc4_crtc_state(old_crtc_state);
366− unsigned int channel = vc4_crtc_state->assigned_channel;
360+ for (channel = 0; channel < HVS_NUM_CHANNELS; channel++) {
361+ struct drm_crtc_commit *commit;
367362 int ret;
368363
369− if (channel == VC4_HVS_CHANNEL_DISABLED)
364+ if (!old_hvs_state->fifo_state[channel].in_use)
370365 continue;
371366
372− if (!old_hvs_state->fifo_state[channel].in_use)
367+ commit = old_hvs_state->fifo_state[channel].pending_commit;
368+ if (!commit)
373369 continue;
374370
375− ret = drm_crtc_commit_wait(old_hvs_state->fifo_state[channel].pending_commit);
371+ ret = drm_crtc_commit_wait(commit);
376372 if (ret)
377373 drm_err(dev, "Timed out waiting for commit\n");
374+
375+ drm_crtc_commit_put(commit);
376+ old_hvs_state->fifo_state[channel].pending_commit = NULL;
378377 }
379378
379+ if (vc4->hvs->hvs5)
380+ clk_set_min_rate(hvs->core_clk, 500000000);
381+
380382 drm_atomic_helper_commit_modeset_disables(dev, state);
381383
382384 vc4_ctm_commit(vc4, state);
@@ -410,8 +412,8 @@ static int vc4_atomic_commit_setup(struct drm_atomic_state *state) · 27 unmodified lines
410412 unsigned int i;
411413
412414 hvs_state = vc4_hvs_get_new_global_state(state);
413− if (!hvs_state)
414− return -EINVAL;
415+ if (WARN_ON(IS_ERR(hvs_state)))
416+ return PTR_ERR(hvs_state);
415417
416418 for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
417419 struct vc4_crtc_state *vc4_crtc_state =
@@ -668,12 +670,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) · 250 unmodified lines
668670
669671 for (i = 0; i < HVS_NUM_CHANNELS; i++) {
670672 state->fifo_state[i].in_use = old_state->fifo_state[i].in_use;
671−
672− if (!old_state->fifo_state[i].pending_commit)
673− continue;
674−
675− state->fifo_state[i].pending_commit =
676− drm_crtc_commit_get(old_state->fifo_state[i].pending_commit);
677673 }
678674
679675 return &state->base;
@@ -762,8 +758,8 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, · 82 unmodified lines
762758 unsigned int i;
763759
764760 hvs_new_state = vc4_hvs_get_global_state(state);
765− if (!hvs_new_state)
766− return -EINVAL;
761+ if (IS_ERR(hvs_new_state))
762+ return PTR_ERR(hvs_new_state);
767763
768764 for (i = 0; i < ARRAY_SIZE(hvs_new_state->fifo_state); i++)
769765 if (!hvs_new_state->fifo_state[i].in_use)
drivers/gpu/drm/virtio/virtgpu_drv.c+1−41
@@ -157,36 +157,6 @@ static void virtio_gpu_config_changed(struct virtio_device *vdev) · 156 unmodified lines
157157 schedule_work(&vgdev->config_changed_work);
158158 }
159159
160−static __poll_t virtio_gpu_poll(struct file *filp,
161− struct poll_table_struct *wait)
162−{
163− struct drm_file *drm_file = filp->private_data;
164− struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;
165− struct drm_device *dev = drm_file->minor->dev;
166− struct virtio_gpu_device *vgdev = dev->dev_private;
167− struct drm_pending_event *e = NULL;
168− __poll_t mask = 0;
169−
170− if (!vgdev->has_virgl_3d || !vfpriv || !vfpriv->ring_idx_mask)
171− return drm_poll(filp, wait);
172−
173− poll_wait(filp, &drm_file->event_wait, wait);
174−
175− if (!list_empty(&drm_file->event_list)) {
176− spin_lock_irq(&dev->event_lock);
177− e = list_first_entry(&drm_file->event_list,
178− struct drm_pending_event, link);
179− drm_file->event_space += e->event->length;
180− list_del(&e->link);
181− spin_unlock_irq(&dev->event_lock);
182−
183− kfree(e);
184− mask |= EPOLLIN | EPOLLRDNORM;
185− }
186−
187− return mask;
188−}
189−
190160 static struct virtio_device_id id_table[] = {
191161 { VIRTIO_ID_GPU, VIRTIO_DEV_ANY_ID },
192162 { 0 },
@@ -226,17 +196,7 @@ MODULE_AUTHOR("Dave Airlie <airlied@redhat.com>"); · 33 unmodified lines
226196 MODULE_AUTHOR("Gerd Hoffmann <kraxel@redhat.com>");
227197 MODULE_AUTHOR("Alon Levy");
228198
229−static const struct file_operations virtio_gpu_driver_fops = {
230− .owner = THIS_MODULE,
231− .open = drm_open,
232− .release = drm_release,
233− .unlocked_ioctl = drm_ioctl,
234− .compat_ioctl = drm_compat_ioctl,
235− .poll = virtio_gpu_poll,
236− .read = drm_read,
237− .llseek = noop_llseek,
238− .mmap = drm_gem_mmap
239−};
199+DEFINE_DRM_GEM_FOPS(virtio_gpu_driver_fops);
240200
241201 static const struct drm_driver driver = {
242202 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC,
drivers/gpu/drm/virtio/virtgpu_drv.h+0−1
@@ -138,7 +138,6 @@ struct virtio_gpu_fence_driver { · 137 unmodified lines
138138 spinlock_t lock;
139139 };
140140
141−#define VIRTGPU_EVENT_FENCE_SIGNALED_INTERNAL 0x10000000
142141 struct virtio_gpu_fence_event {
143142 struct drm_pending_event base;
144143 struct drm_event event;
drivers/gpu/drm/virtio/virtgpu_ioctl.c+1−1
@@ -54,7 +54,7 @@ static int virtio_gpu_fence_event_create(struct drm_device *dev, · 53 unmodified lines
5454 if (!e)
5555 return -ENOMEM;
5656
57− e->event.type = VIRTGPU_EVENT_FENCE_SIGNALED_INTERNAL;
57+ e->event.type = VIRTGPU_EVENT_FENCE_SIGNALED;
5858 e->event.length = sizeof(e->event);
5959
6060 ret = drm_event_reserve_init(dev, file, &e->base, &e->event);
drivers/gpu/drm/xen/xen_drm_front.c+1−0
@@ -773,6 +773,7 @@ static struct xenbus_driver xen_driver = { · 772 unmodified lines
773773 .probe = xen_drv_probe,
774774 .remove = xen_drv_remove,
775775 .otherend_changed = displback_changed,
776+ .not_essential = true,
776777 };
777778
778779 static int __init xen_drv_init(void)
drivers/hid/Kconfig+5−5
@@ -207,14 +207,14 @@ config HID_CHERRY · 206 unmodified lines
207207
208208 config HID_CHICONY
209209 tristate "Chicony devices"
210− depends on HID
210+ depends on USB_HID
211211 default !EXPERT
212212 help
213213 Support for Chicony Tactical pad and special keys on Chicony keyboards.
214214
215215 config HID_CORSAIR
216216 tristate "Corsair devices"
217− depends on HID && USB && LEDS_CLASS
217+ depends on USB_HID && LEDS_CLASS
218218 help
219219 Support for Corsair devices that are not fully compliant with the
220220 HID standard.
@@ -245,7 +245,7 @@ config HID_MACALLY · 24 unmodified lines
245245
246246 config HID_PRODIKEYS
247247 tristate "Prodikeys PC-MIDI Keyboard support"
248− depends on HID && SND
248+ depends on USB_HID && SND
249249 select SND_RAWMIDI
250250 help
251251 Support for Prodikeys PC-MIDI Keyboard device support.
@@ -560,7 +560,7 @@ config HID_LENOVO · 308 unmodified lines
560560
561561 config HID_LOGITECH
562562 tristate "Logitech devices"
563− depends on HID
563+ depends on USB_HID
564564 depends on LEDS_CLASS
565565 default !EXPERT
566566 help
@@ -951,7 +951,7 @@ config HID_SAITEK · 384 unmodified lines
951951
952952 config HID_SAMSUNG
953953 tristate "Samsung InfraRed remote control or keyboards"
954− depends on HID
954+ depends on USB_HID
955955 help
956956 Support for Samsung InfraRed remote control or keyboards.
957957
drivers/hid/hid-asus.c+3−5
@@ -854,7 +854,7 @@ static int asus_input_mapping(struct hid_device *hdev, · 853 unmodified lines
854854 switch (usage->hid & HID_USAGE) {
855855 case 0x10: asus_map_key_clear(KEY_BRIGHTNESSDOWN); break;
856856 case 0x20: asus_map_key_clear(KEY_BRIGHTNESSUP); break;
857− case 0x35: asus_map_key_clear(KEY_SCREENLOCK); break;
857+ case 0x35: asus_map_key_clear(KEY_DISPLAY_OFF); break;
858858 case 0x6c: asus_map_key_clear(KEY_SLEEP); break;
859859 case 0x7c: asus_map_key_clear(KEY_MICMUTE); break;
860860 case 0x82: asus_map_key_clear(KEY_CAMERA); break;
@@ -1028,8 +1028,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id) · 167 unmodified lines
10281028 if (drvdata->quirks & QUIRK_IS_MULTITOUCH)
10291029 drvdata->tp = &asus_i2c_tp;
10301030
1031− if ((drvdata->quirks & QUIRK_T100_KEYBOARD) &&
1032− hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
1031+ if ((drvdata->quirks & QUIRK_T100_KEYBOARD) && hid_is_usb(hdev)) {
10331032 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
10341033
10351034 if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) {
@@ -1057,8 +1056,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id) · 21 unmodified lines
10571056 drvdata->tp = &asus_t100chi_tp;
10581057 }
10591058
1060− if ((drvdata->quirks & QUIRK_MEDION_E1239T) &&
1061− hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
1059+ if ((drvdata->quirks & QUIRK_MEDION_E1239T) && hid_is_usb(hdev)) {
10621060 struct usb_host_interface *alt =
10631061 to_usb_interface(hdev->dev.parent)->altsetting;
10641062
drivers/hid/hid-bigbenff.c+1−1
@@ -191,7 +191,7 @@ static void bigben_worker(struct work_struct *work) · 190 unmodified lines
191191 struct bigben_device, worker);
192192 struct hid_field *report_field = bigben->report->field[0];
193193
194− if (bigben->removed)
194+ if (bigben->removed || !report_field)
195195 return;
196196
197197 if (bigben->work_led) {
drivers/hid/hid-chicony.c+3−0
@@ -114,6 +114,9 @@ static int ch_probe(struct hid_device *hdev, const struct hid_device_id *id) · 113 unmodified lines
114114 {
115115 int ret;
116116
117+ if (!hid_is_usb(hdev))
118+ return -EINVAL;
119+
117120 hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
118121 ret = hid_parse(hdev);
119122 if (ret) {
drivers/hid/hid-corsair.c+6−1
@@ -553,7 +553,12 @@ static int corsair_probe(struct hid_device *dev, const struct hid_device_id *id) · 552 unmodified lines
553553 int ret;
554554 unsigned long quirks = id->driver_data;
555555 struct corsair_drvdata *drvdata;
556− struct usb_interface *usbif = to_usb_interface(dev->dev.parent);
556+ struct usb_interface *usbif;
557+
558+ if (!hid_is_usb(dev))
559+ return -EINVAL;
560+
561+ usbif = to_usb_interface(dev->dev.parent);
557562
558563 drvdata = devm_kzalloc(&dev->dev, sizeof(struct corsair_drvdata),
559564 GFP_KERNEL);
drivers/hid/hid-elan.c+1−1
@@ -50,7 +50,7 @@ struct elan_drvdata { · 49 unmodified lines
5050
5151 static int is_not_elan_touchpad(struct hid_device *hdev)
5252 {
53− if (hdev->bus == BUS_USB) {
53+ if (hid_is_usb(hdev)) {
5454 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
5555
5656 return (intf->altsetting->desc.bInterfaceNumber !=
drivers/hid/hid-elo.c+3−0
@@ -230,6 +230,9 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) · 229 unmodified lines
230230 int ret;
231231 struct usb_device *udev;
232232
233+ if (!hid_is_usb(hdev))
234+ return -EINVAL;
235+
233236 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
234237 if (!priv)
235238 return -ENOMEM;
drivers/hid/hid-ft260.c+8−6
@@ -915,6 +915,9 @@ static int ft260_probe(struct hid_device *hdev, const struct hid_device_id *id) · 914 unmodified lines
915915 struct ft260_get_chip_version_report version;
916916 int ret;
917917
918+ if (!hid_is_usb(hdev))
919+ return -EINVAL;
920+
918921 dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
919922 if (!dev)
920923 return -ENOMEM;
@@ -966,24 +969,23 @@ static int ft260_probe(struct hid_device *hdev, const struct hid_device_id *id) · 45 unmodified lines
966969 mutex_init(&dev->lock);
967970 init_completion(&dev->wait);
968971
972+ ret = ft260_xfer_status(dev);
973+ if (ret)
974+ ft260_i2c_reset(hdev);
975+
976+ i2c_set_adapdata(&dev->adap, dev);
969977 ret = i2c_add_adapter(&dev->adap);
970978 if (ret) {
971979 hid_err(hdev, "failed to add i2c adapter\n");
972980 goto err_hid_close;
973981 }
974982
975− i2c_set_adapdata(&dev->adap, dev);
976−
977983 ret = sysfs_create_group(&hdev->dev.kobj, &ft260_attr_group);
978984 if (ret < 0) {
979985 hid_err(hdev, "failed to create sysfs attrs\n");
980986 goto err_i2c_free;
981987 }
982988
983− ret = ft260_xfer_status(dev);
984− if (ret)
985− ft260_i2c_reset(hdev);
986−
987989 return 0;
988990
989991 err_i2c_free:
drivers/hid/hid-google-hammer.c+2−0
@@ -585,6 +585,8 @@ static void hammer_remove(struct hid_device *hdev) · 584 unmodified lines
585585 static const struct hid_device_id hammer_devices[] = {
586586 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
587587 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) },
588+ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
589+ USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_EEL) },
588590 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
589591 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) },
590592 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
drivers/hid/hid-holtek-kbd.c+7−2
@@ -140,12 +140,17 @@ static int holtek_kbd_input_event(struct input_dev *dev, unsigned int type, · 139 unmodified lines
140140 static int holtek_kbd_probe(struct hid_device *hdev,
141141 const struct hid_device_id *id)
142142 {
143− struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
144− int ret = hid_parse(hdev);
143+ struct usb_interface *intf;
144+ int ret;
145+
146+ if (!hid_is_usb(hdev))
147+ return -EINVAL;
145148
149+ ret = hid_parse(hdev);
146150 if (!ret)
147151 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
148152
153+ intf = to_usb_interface(hdev->dev.parent);
149154 if (!ret && intf->cur_altsetting->desc.bInterfaceNumber == 1) {
150155 struct hid_input *hidinput;
151156 list_for_each_entry(hidinput, &hdev->inputs, list) {
drivers/hid/hid-holtek-mouse.c+9−0
@@ -62,6 +62,14 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 61 unmodified lines
6262 return rdesc;
6363 }
6464
65+static int holtek_mouse_probe(struct hid_device *hdev,
66+ const struct hid_device_id *id)
67+{
68+ if (!hid_is_usb(hdev))
69+ return -EINVAL;
70+ return 0;
71+}
72+
6573 static const struct hid_device_id holtek_mouse_devices[] = {
6674 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
6775 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) },
@@ -83,6 +91,7 @@ static struct hid_driver holtek_mouse_driver = { · 15 unmodified lines
8391 .name = "holtek_mouse",
8492 .id_table = holtek_mouse_devices,
8593 .report_fixup = holtek_mouse_report_fixup,
94+ .probe = holtek_mouse_probe,
8695 };
8796
8897 module_hid_driver(holtek_mouse_driver);
drivers/hid/hid-ids.h+4−0
@@ -397,7 +397,9 @@ · 396 unmodified lines
397397 #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401
398398 #define USB_DEVICE_ID_HP_X2 0x074d
399399 #define USB_DEVICE_ID_HP_X2_10_COVER 0x0755
400+#define I2C_DEVICE_ID_HP_ENVY_X360_15 0x2d05
400401 #define I2C_DEVICE_ID_HP_SPECTRE_X360_15 0x2817
402+#define USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN 0x2544
401403 #define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706
402404 #define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A
403405
@@ -500,6 +502,7 @@ · 96 unmodified lines
500502 #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d
501503 #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044
502504 #define USB_DEVICE_ID_GOOGLE_DON 0x5050
505+#define USB_DEVICE_ID_GOOGLE_EEL 0x5057
503506
504507 #define USB_VENDOR_ID_GOTOP 0x08f2
505508 #define USB_DEVICE_ID_SUPER_Q2 0x007f
@@ -885,6 +888,7 @@ · 379 unmodified lines
885888 #define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7
886889 #define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
887890 #define USB_DEVICE_ID_MS_POWER_COVER 0x07da
891+#define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de
888892 #define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd
889893 #define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb
890894 #define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0
drivers/hid/hid-input.c+7−3
@@ -160,6 +160,7 @@ static int hidinput_setkeycode(struct input_dev *dev, · 159 unmodified lines
160160 if (usage) {
161161 *old_keycode = usage->type == EV_KEY ?
162162 usage->code : KEY_RESERVED;
163+ usage->type = EV_KEY;
163164 usage->code = ke->keycode;
164165
165166 clear_bit(*old_keycode, dev->keybit);
@@ -324,6 +325,10 @@ static const struct hid_device_id hid_battery_quirks[] = { · 158 unmodified lines
324325 HID_BATTERY_QUIRK_IGNORE },
325326 { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN),
326327 HID_BATTERY_QUIRK_IGNORE },
328+ { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN),
329+ HID_BATTERY_QUIRK_IGNORE },
330+ { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_15),
331+ HID_BATTERY_QUIRK_IGNORE },
327332 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_15),
328333 HID_BATTERY_QUIRK_IGNORE },
329334 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN),
@@ -650,10 +655,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · 320 unmodified lines
650655 code += KEY_MACRO1;
651656 else
652657 code += BTN_TRIGGER_HAPPY - 0x1e;
653− } else {
654− goto ignore;
658+ break;
655659 }
656− break;
660+ fallthrough;
657661 default:
658662 switch (field->physical) {
659663 case HID_GD_MOUSE:
drivers/hid/hid-lg.c+8−2
@@ -749,12 +749,18 @@ static int lg_raw_event(struct hid_device *hdev, struct hid_report *report, · 748 unmodified lines
749749
750750 static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
751751 {
752− struct usb_interface *iface = to_usb_interface(hdev->dev.parent);
753− __u8 iface_num = iface->cur_altsetting->desc.bInterfaceNumber;
752+ struct usb_interface *iface;
753+ __u8 iface_num;
754754 unsigned int connect_mask = HID_CONNECT_DEFAULT;
755755 struct lg_drv_data *drv_data;
756756 int ret;
757757
758+ if (!hid_is_usb(hdev))
759+ return -EINVAL;
760+
761+ iface = to_usb_interface(hdev->dev.parent);
762+ iface_num = iface->cur_altsetting->desc.bInterfaceNumber;
763+
758764 /* G29 only work with the 1st interface */
759765 if ((hdev->product == USB_DEVICE_ID_LOGITECH_G29_WHEEL) &&
760766 (iface_num != 0)) {
drivers/hid/hid-logitech-dj.c+1−1
@@ -1777,7 +1777,7 @@ static int logi_dj_probe(struct hid_device *hdev, · 1776 unmodified lines
17771777 case recvr_type_bluetooth: no_dj_interfaces = 2; break;
17781778 case recvr_type_dinovo: no_dj_interfaces = 2; break;
17791779 }
1780− if (hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
1780+ if (hid_is_usb(hdev)) {
17811781 intf = to_usb_interface(hdev->dev.parent);
17821782 if (intf && intf->altsetting->desc.bInterfaceNumber >=
17831783 no_dj_interfaces) {
drivers/hid/hid-magicmouse.c+5−2
@@ -256,8 +256,11 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda · 255 unmodified lines
256256 unsigned long now = jiffies;
257257 int step_x = msc->touches[id].scroll_x - x;
258258 int step_y = msc->touches[id].scroll_y - y;
259− int step_hr = ((64 - (int)scroll_speed) * msc->scroll_accel) /
260− SCROLL_HR_STEPS;
259+ int step_hr =
260+ max_t(int,
261+ ((64 - (int)scroll_speed) * msc->scroll_accel) /
262+ SCROLL_HR_STEPS,
263+ 1);
261264 int step_x_hr = msc->touches[id].scroll_x_hr - x;
262265 int step_y_hr = msc->touches[id].scroll_y_hr - y;
263266
drivers/hid/hid-multitouch.c+5−0
@@ -1888,6 +1888,11 @@ static const struct hid_device_id mt_devices[] = { · 1887 unmodified lines
18881888 MT_USB_DEVICE(USB_VENDOR_ID_CVTOUCH,
18891889 USB_DEVICE_ID_CVTOUCH_SCREEN) },
18901890
1891+ /* eGalax devices (SAW) */
1892+ { .driver_data = MT_CLS_EXPORT_ALL_INPUTS,
1893+ MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
1894+ USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER) },
1895+
18911896 /* eGalax devices (resistive) */
18921897 { .driver_data = MT_CLS_EGALAX,
18931898 MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
drivers/hid/hid-nintendo.c+9−4
@@ -189,6 +189,7 @@ struct joycon_rumble_amp_data { · 188 unmodified lines
189189 u16 amp;
190190 };
191191
192+#if IS_ENABLED(CONFIG_NINTENDO_FF)
192193 /*
193194 * These tables are from
194195 * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
@@ -289,6 +290,10 @@ static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = { · 94 unmodified lines
289290 { 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
290291 { 0xc8, 0x0072, joycon_max_rumble_amp }
291292 };
293+static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
294+static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
295+#endif /* IS_ENABLED(CONFIG_NINTENDO_FF) */
296+static const u16 JC_RUMBLE_PERIOD_MS = 50;
292297
293298 /* States for controller state machine */
294299 enum joycon_ctlr_state {
@@ -397,9 +402,6 @@ struct joycon_input_report { · 102 unmodified lines
397402 #define JC_RUMBLE_DATA_SIZE 8
398403 #define JC_RUMBLE_QUEUE_SIZE 8
399404
400−static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
401−static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
402−static const u16 JC_RUMBLE_PERIOD_MS = 50;
403405 static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
404406
405407 static const char * const joycon_player_led_names[] = {
@@ -1850,8 +1852,10 @@ static int joycon_leds_create(struct joycon_ctlr *ctlr) · 1444 unmodified lines
18501852 d_name,
18511853 "green",
18521854 joycon_player_led_names[i]);
1853− if (!name)
1855+ if (!name) {
1856+ mutex_unlock(&joycon_input_num_mutex);
18541857 return -ENOMEM;
1858+ }
18551859
18561860 led = &ctlr->leds[i];
18571861 led->name = name;
@@ -1864,6 +1868,7 @@ static int joycon_leds_create(struct joycon_ctlr *ctlr) · 6 unmodified lines
18641868 ret = devm_led_classdev_register(&hdev->dev, led);
18651869 if (ret) {
18661870 hid_err(hdev, "Failed registering %s LED\n", led->name);
1871+ mutex_unlock(&joycon_input_num_mutex);
18671872 return ret;
18681873 }
18691874 }
drivers/hid/hid-prodikeys.c+8−2
@@ -798,12 +798,18 @@ static int pk_raw_event(struct hid_device *hdev, struct hid_report *report, · 797 unmodified lines
798798 static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id)
799799 {
800800 int ret;
801− struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
802− unsigned short ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
801+ struct usb_interface *intf;
802+ unsigned short ifnum;
803803 unsigned long quirks = id->driver_data;
804804 struct pk_device *pk;
805805 struct pcmidi_snd *pm = NULL;
806806
807+ if (!hid_is_usb(hdev))
808+ return -EINVAL;
809+
810+ intf = to_usb_interface(hdev->dev.parent);
811+ ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
812+
807813 pk = kzalloc(sizeof(*pk), GFP_KERNEL);
808814 if (pk == NULL) {
809815 hid_err(hdev, "can't alloc descriptor\n");
drivers/hid/hid-quirks.c+1−0
@@ -124,6 +124,7 @@ static const struct hid_device_id hid_quirks[] = { · 123 unmodified lines
124124 { HID_USB_DEVICE(USB_VENDOR_ID_MCS, USB_DEVICE_ID_MCS_GAMEPADBLOCK), HID_QUIRK_MULTI_INPUT },
125125 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PIXART_MOUSE), HID_QUIRK_ALWAYS_POLL },
126126 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER), HID_QUIRK_NO_INIT_REPORTS },
127+ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE3_COVER), HID_QUIRK_NO_INIT_REPORTS },
127128 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2), HID_QUIRK_NO_INIT_REPORTS },
128129 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), HID_QUIRK_NO_INIT_REPORTS },
129130 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2), HID_QUIRK_NO_INIT_REPORTS },
drivers/hid/hid-roccat-arvo.c+3−0
@@ -344,6 +344,9 @@ static int arvo_probe(struct hid_device *hdev, · 343 unmodified lines
344344 {
345345 int retval;
346346
347+ if (!hid_is_usb(hdev))
348+ return -EINVAL;
349+
347350 retval = hid_parse(hdev);
348351 if (retval) {
349352 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-isku.c+3−0
@@ -324,6 +324,9 @@ static int isku_probe(struct hid_device *hdev, · 323 unmodified lines
324324 {
325325 int retval;
326326
327+ if (!hid_is_usb(hdev))
328+ return -EINVAL;
329+
327330 retval = hid_parse(hdev);
328331 if (retval) {
329332 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-kone.c+3−0
@@ -749,6 +749,9 @@ static int kone_probe(struct hid_device *hdev, const struct hid_device_id *id) · 748 unmodified lines
749749 {
750750 int retval;
751751
752+ if (!hid_is_usb(hdev))
753+ return -EINVAL;
754+
752755 retval = hid_parse(hdev);
753756 if (retval) {
754757 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-koneplus.c+3−0
@@ -431,6 +431,9 @@ static int koneplus_probe(struct hid_device *hdev, · 430 unmodified lines
431431 {
432432 int retval;
433433
434+ if (!hid_is_usb(hdev))
435+ return -EINVAL;
436+
434437 retval = hid_parse(hdev);
435438 if (retval) {
436439 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-konepure.c+3−0
@@ -133,6 +133,9 @@ static int konepure_probe(struct hid_device *hdev, · 132 unmodified lines
133133 {
134134 int retval;
135135
136+ if (!hid_is_usb(hdev))
137+ return -EINVAL;
138+
136139 retval = hid_parse(hdev);
137140 if (retval) {
138141 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-kovaplus.c+3−0
@@ -501,6 +501,9 @@ static int kovaplus_probe(struct hid_device *hdev, · 500 unmodified lines
501501 {
502502 int retval;
503503
504+ if (!hid_is_usb(hdev))
505+ return -EINVAL;
506+
504507 retval = hid_parse(hdev);
505508 if (retval) {
506509 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-lua.c+3−0
@@ -160,6 +160,9 @@ static int lua_probe(struct hid_device *hdev, · 159 unmodified lines
160160 {
161161 int retval;
162162
163+ if (!hid_is_usb(hdev))
164+ return -EINVAL;
165+
163166 retval = hid_parse(hdev);
164167 if (retval) {
165168 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-pyra.c+3−0
@@ -449,6 +449,9 @@ static int pyra_probe(struct hid_device *hdev, const struct hid_device_id *id) · 448 unmodified lines
449449 {
450450 int retval;
451451
452+ if (!hid_is_usb(hdev))
453+ return -EINVAL;
454+
452455 retval = hid_parse(hdev);
453456 if (retval) {
454457 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-ryos.c+3−0
@@ -141,6 +141,9 @@ static int ryos_probe(struct hid_device *hdev, · 140 unmodified lines
141141 {
142142 int retval;
143143
144+ if (!hid_is_usb(hdev))
145+ return -EINVAL;
146+
144147 retval = hid_parse(hdev);
145148 if (retval) {
146149 hid_err(hdev, "parse failed\n");
drivers/hid/hid-roccat-savu.c+3−0
@@ -113,6 +113,9 @@ static int savu_probe(struct hid_device *hdev, · 112 unmodified lines
113113 {
114114 int retval;
115115
116+ if (!hid_is_usb(hdev))
117+ return -EINVAL;
118+
116119 retval = hid_parse(hdev);
117120 if (retval) {
118121 hid_err(hdev, "parse failed\n");
drivers/hid/hid-samsung.c+3−0
@@ -152,6 +152,9 @@ static int samsung_probe(struct hid_device *hdev, · 151 unmodified lines
152152 int ret;
153153 unsigned int cmask = HID_CONNECT_DEFAULT;
154154
155+ if (!hid_is_usb(hdev))
156+ return -EINVAL;
157+
155158 ret = hid_parse(hdev);
156159 if (ret) {
157160 hid_err(hdev, "parse failed\n");
drivers/hid/hid-sony.c+18−6
@@ -3000,7 +3000,6 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) · 2999 unmodified lines
30003000 sc->quirks = quirks;
30013001 hid_set_drvdata(hdev, sc);
30023002 sc->hdev = hdev;
3003− usbdev = to_usb_device(sc->hdev->dev.parent->parent);
30043003
30053004 ret = hid_parse(hdev);
30063005 if (ret) {
@@ -3038,14 +3037,23 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) · 31 unmodified lines
30383037 */
30393038 if (!(hdev->claimed & HID_CLAIMED_INPUT)) {
30403039 hid_err(hdev, "failed to claim input\n");
3041− hid_hw_stop(hdev);
3042− return -ENODEV;
3040+ ret = -ENODEV;
3041+ goto err;
30433042 }
30443043
30453044 if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) {
3045+ if (!hid_is_usb(hdev)) {
3046+ ret = -EINVAL;
3047+ goto err;
3048+ }
3049+
3050+ usbdev = to_usb_device(sc->hdev->dev.parent->parent);
3051+
30463052 sc->ghl_urb = usb_alloc_urb(0, GFP_ATOMIC);
3047− if (!sc->ghl_urb)
3048− return -ENOMEM;
3053+ if (!sc->ghl_urb) {
3054+ ret = -ENOMEM;
3055+ goto err;
3056+ }
30493057
30503058 if (sc->quirks & GHL_GUITAR_PS3WIIU)
30513059 ret = ghl_init_urb(sc, usbdev, ghl_ps3wiiu_magic_data,
@@ -3055,7 +3063,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) · 3 unmodified lines
30553063 ARRAY_SIZE(ghl_ps4_magic_data));
30563064 if (ret) {
30573065 hid_err(hdev, "error preparing URB\n");
3058− return ret;
3066+ goto err;
30593067 }
30603068
30613069 timer_setup(&sc->ghl_poke_timer, ghl_magic_poke, 0);
@@ -3064,6 +3072,10 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) · 2 unmodified lines
30643072 }
30653073
30663074 return ret;
3075+
3076+err:
3077+ hid_hw_stop(hdev);
3078+ return ret;
30673079 }
30683080
30693081 static void sony_remove(struct hid_device *hdev)
drivers/hid/hid-thrustmaster.c+6−3
@@ -205,7 +205,7 @@ static void thrustmaster_model_handler(struct urb *urb) · 204 unmodified lines
205205 struct tm_wheel *tm_wheel = hid_get_drvdata(hdev);
206206 uint16_t model = 0;
207207 int i, ret;
208− const struct tm_wheel_info *twi = 0;
208+ const struct tm_wheel_info *twi = NULL;
209209
210210 if (urb->status) {
211211 hid_err(hdev, "URB to get model id failed with error %d\n", urb->status);
@@ -238,7 +238,7 @@ static void thrustmaster_model_handler(struct urb *urb) · 26 unmodified lines
238238 tm_wheel->usb_dev,
239239 usb_sndctrlpipe(tm_wheel->usb_dev, 0),
240240 (char *)tm_wheel->change_request,
241− 0, 0, // We do not expect any response from the wheel
241+ NULL, 0, // We do not expect any response from the wheel
242242 thrustmaster_change_handler,
243243 hdev
244244 );
@@ -272,7 +272,10 @@ static void thrustmaster_remove(struct hid_device *hdev) · 27 unmodified lines
272272 static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_id *id)
273273 {
274274 int ret = 0;
275− struct tm_wheel *tm_wheel = 0;
275+ struct tm_wheel *tm_wheel = NULL;
276+
277+ if (!hid_is_usb(hdev))
278+ return -EINVAL;
276279
277280 ret = hid_parse(hdev);
278281 if (ret) {
drivers/hid/hid-u2fzero.c+1−1
@@ -311,7 +311,7 @@ static int u2fzero_probe(struct hid_device *hdev, · 310 unmodified lines
311311 unsigned int minor;
312312 int ret;
313313
314− if (!hid_is_using_ll_driver(hdev, &usb_hid_driver))
314+ if (!hid_is_usb(hdev))
315315 return -EINVAL;
316316
317317 dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
drivers/hid/hid-uclogic-core.c+3−0
@@ -164,6 +164,9 @@ static int uclogic_probe(struct hid_device *hdev, · 163 unmodified lines
164164 struct uclogic_drvdata *drvdata = NULL;
165165 bool params_initialized = false;
166166
167+ if (!hid_is_usb(hdev))
168+ return -EINVAL;
169+
167170 /*
168171 * libinput requires the pad interface to be on a different node
169172 * than the pen, so use QUIRK_MULTI_INPUT for all tablets.
drivers/hid/hid-uclogic-params.c+1−2
@@ -843,8 +843,7 @@ int uclogic_params_init(struct uclogic_params *params, · 842 unmodified lines
843843 struct uclogic_params p = {0, };
844844
845845 /* Check arguments */
846− if (params == NULL || hdev == NULL ||
847− !hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
846+ if (params == NULL || hdev == NULL || !hid_is_usb(hdev)) {
848847 rc = -EINVAL;
849848 goto cleanup;
850849 }
drivers/hid/intel-ish-hid/ipc/pci-ish.c+4−2
@@ -266,7 +266,8 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work) · 265 unmodified lines
266266
267267 if (ish_should_leave_d0i3(pdev) && !dev->suspend_flag
268268 && IPC_IS_ISH_ILUP(fwsts)) {
269− disable_irq_wake(pdev->irq);
269+ if (device_may_wakeup(&pdev->dev))
270+ disable_irq_wake(pdev->irq);
270271
271272 ish_set_host_ready(dev);
272273
@@ -337,7 +338,8 @@ static int __maybe_unused ish_suspend(struct device *device) · 64 unmodified lines
337338 */
338339 pci_save_state(pdev);
339340
340− enable_irq_wake(pdev->irq);
341+ if (device_may_wakeup(&pdev->dev))
342+ enable_irq_wake(pdev->irq);
341343 }
342344 } else {
343345 /*
drivers/hid/intel-ish-hid/ishtp-fw-loader.c+8−6
@@ -76,9 +76,12 @@ enum ish_loader_commands { · 75 unmodified lines
7676 #define LOADER_XFER_MODE_ISHTP BIT(1)
7777
7878 /* ISH Transport Loader client unique GUID */
79−static const guid_t loader_ishtp_guid =
80− GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7,
81− 0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc);
79+static const struct ishtp_device_id loader_ishtp_id_table[] = {
80+ { .guid = GUID_INIT(0xc804d06a, 0x55bd, 0x4ea7,
81+ 0xad, 0xed, 0x1e, 0x31, 0x22, 0x8c, 0x76, 0xdc) },
82+ { }
83+};
84+MODULE_DEVICE_TABLE(ishtp, loader_ishtp_id_table);
8285
8386 #define FILENAME_SIZE 256
8487
@@ -880,7 +883,7 @@ static int loader_init(struct ishtp_cl *loader_ishtp_cl, int reset) · 795 unmodified lines
880883
881884 fw_client =
882885 ishtp_fw_cl_get_client(ishtp_get_ishtp_device(loader_ishtp_cl),
883− &loader_ishtp_guid);
886+ &loader_ishtp_id_table[0].guid);
884887 if (!fw_client) {
885888 dev_err(cl_data_to_dev(client_data),
886889 "ISH client uuid not found\n");
@@ -1057,7 +1060,7 @@ static int loader_ishtp_cl_reset(struct ishtp_cl_device *cl_device) · 170 unmodified lines
10571060
10581061 static struct ishtp_cl_driver loader_ishtp_cl_driver = {
10591062 .name = "ish-loader",
1060− .guid = &loader_ishtp_guid,
1063+ .id = loader_ishtp_id_table,
10611064 .probe = loader_ishtp_cl_probe,
10621065 .remove = loader_ishtp_cl_remove,
10631066 .reset = loader_ishtp_cl_reset,
@@ -1083,4 +1086,3 @@ MODULE_DESCRIPTION("ISH ISH-TP Host firmware Loader Client Driver"); · 19 unmodified lines
10831086 MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@intel.com>");
10841087
10851088 MODULE_LICENSE("GPL v2");
1086−MODULE_ALIAS("ishtp:*");
drivers/hid/intel-ish-hid/ishtp-hid-client.c+8−6
@@ -12,9 +12,12 @@ · 11 unmodified lines
1212 #include "ishtp-hid.h"
1313
1414 /* ISH Transport protocol (ISHTP in short) GUID */
15−static const guid_t hid_ishtp_guid =
16− GUID_INIT(0x33AECD58, 0xB679, 0x4E54,
17− 0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26);
15+static const struct ishtp_device_id hid_ishtp_id_table[] = {
16+ { .guid = GUID_INIT(0x33AECD58, 0xB679, 0x4E54,
17+ 0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26), },
18+ { }
19+};
20+MODULE_DEVICE_TABLE(ishtp, hid_ishtp_id_table);
1821
1922 /* Rx ring buffer pool size */
2023 #define HID_CL_RX_RING_SIZE 32
@@ -662,7 +665,7 @@ static int hid_ishtp_cl_init(struct ishtp_cl *hid_ishtp_cl, int reset) · 641 unmodified lines
662665 ishtp_set_tx_ring_size(hid_ishtp_cl, HID_CL_TX_RING_SIZE);
663666 ishtp_set_rx_ring_size(hid_ishtp_cl, HID_CL_RX_RING_SIZE);
664667
665− fw_client = ishtp_fw_cl_get_client(dev, &hid_ishtp_guid);
668+ fw_client = ishtp_fw_cl_get_client(dev, &hid_ishtp_id_table[0].guid);
666669 if (!fw_client) {
667670 dev_err(cl_data_to_dev(client_data),
668671 "ish client uuid not found\n");
@@ -945,7 +948,7 @@ static const struct dev_pm_ops hid_ishtp_pm_ops = { · 276 unmodified lines
945948
946949 static struct ishtp_cl_driver hid_ishtp_cl_driver = {
947950 .name = "ish-hid",
948− .guid = &hid_ishtp_guid,
951+ .id = hid_ishtp_id_table,
949952 .probe = hid_ishtp_cl_probe,
950953 .remove = hid_ishtp_cl_remove,
951954 .reset = hid_ishtp_cl_reset,
@@ -981,4 +984,3 @@ MODULE_AUTHOR("Daniel Drubin <daniel.drubin@intel.com>"); · 29 unmodified lines
981984 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
982985
983986 MODULE_LICENSE("GPL");
984−MODULE_ALIAS("ishtp:*");
drivers/hid/intel-ish-hid/ishtp/bus.c+3−3
@@ -241,7 +241,7 @@ static int ishtp_cl_bus_match(struct device *dev, struct device_driver *drv) · 240 unmodified lines
241241 struct ishtp_cl_device *device = to_ishtp_cl_device(dev);
242242 struct ishtp_cl_driver *driver = to_ishtp_cl_driver(drv);
243243
244− return guid_equal(driver->guid,
244+ return guid_equal(&driver->id[0].guid,
245245 &device->fw_client->props.protocol_name);
246246 }
247247
@@ -350,7 +350,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a, · 102 unmodified lines
350350 {
351351 int len;
352352
353− len = snprintf(buf, PAGE_SIZE, "ishtp:%s\n", dev_name(dev));
353+ len = snprintf(buf, PAGE_SIZE, ISHTP_MODULE_PREFIX "%s\n", dev_name(dev));
354354 return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
355355 }
356356 static DEVICE_ATTR_RO(modalias);
@@ -363,7 +363,7 @@ ATTRIBUTE_GROUPS(ishtp_cl_dev); · 6 unmodified lines
363363
364364 static int ishtp_cl_uevent(struct device *dev, struct kobj_uevent_env *env)
365365 {
366− if (add_uevent_var(env, "MODALIAS=ishtp:%s", dev_name(dev)))
366+ if (add_uevent_var(env, "MODALIAS=" ISHTP_MODULE_PREFIX "%s", dev_name(dev)))
367367 return -ENOMEM;
368368 return 0;
369369 }
drivers/hid/wacom_sys.c+13−6
@@ -726,7 +726,7 @@ static void wacom_retrieve_hid_descriptor(struct hid_device *hdev, · 725 unmodified lines
726726 * Skip the query for this type and modify defaults based on
727727 * interface number.
728728 */
729− if (features->type == WIRELESS) {
729+ if (features->type == WIRELESS && intf) {
730730 if (intf->cur_altsetting->desc.bInterfaceNumber == 0)
731731 features->device_type = WACOM_DEVICETYPE_WL_MONITOR;
732732 else
@@ -2214,7 +2214,7 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix) · 1481 unmodified lines
22142214 if ((features->type == HID_GENERIC) && !strcmp("Wacom HID", features->name)) {
22152215 char *product_name = wacom->hdev->name;
22162216
2217− if (hid_is_using_ll_driver(wacom->hdev, &usb_hid_driver)) {
2217+ if (hid_is_usb(wacom->hdev)) {
22182218 struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent);
22192219 struct usb_device *dev = interface_to_usbdev(intf);
22202220 product_name = dev->product;
@@ -2451,6 +2451,9 @@ static void wacom_wireless_work(struct work_struct *work) · 230 unmodified lines
24512451
24522452 wacom_destroy_battery(wacom);
24532453
2454+ if (!usbdev)
2455+ return;
2456+
24542457 /* Stylus interface */
24552458 hdev1 = usb_get_intfdata(usbdev->config->interface[1]);
24562459 wacom1 = hid_get_drvdata(hdev1);
@@ -2730,8 +2733,6 @@ static void wacom_mode_change_work(struct work_struct *work) · 273 unmodified lines
27302733 static int wacom_probe(struct hid_device *hdev,
27312734 const struct hid_device_id *id)
27322735 {
2733− struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
2734− struct usb_device *dev = interface_to_usbdev(intf);
27352736 struct wacom *wacom;
27362737 struct wacom_wac *wacom_wac;
27372738 struct wacom_features *features;
@@ -2766,8 +2767,14 @@ static int wacom_probe(struct hid_device *hdev, · 28 unmodified lines
27662767 wacom_wac->hid_data.inputmode = -1;
27672768 wacom_wac->mode_report = -1;
27682769
2769− wacom->usbdev = dev;
2770− wacom->intf = intf;
2770+ if (hid_is_usb(hdev)) {
2771+ struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
2772+ struct usb_device *dev = interface_to_usbdev(intf);
2773+
2774+ wacom->usbdev = dev;
2775+ wacom->intf = intf;
2776+ }
2777+
27712778 mutex_init(&wacom->lock);
27722779 INIT_DELAYED_WORK(&wacom->init_work, wacom_init_work);
27732780 INIT_WORK(&wacom->wireless_work, wacom_wireless_work);
drivers/hid/wacom_wac.c+7−1
@@ -2603,6 +2603,9 @@ static void wacom_wac_finger_event(struct hid_device *hdev, · 2602 unmodified lines
26032603 return;
26042604
26052605 switch (equivalent_usage) {
2606+ case HID_DG_CONFIDENCE:
2607+ wacom_wac->hid_data.confidence = value;
2608+ break;
26062609 case HID_GD_X:
26072610 wacom_wac->hid_data.x = value;
26082611 break;
@@ -2635,7 +2638,8 @@ static void wacom_wac_finger_event(struct hid_device *hdev, · 26 unmodified lines
26352638 }
26362639
26372640 if (usage->usage_index + 1 == field->report_count) {
2638− if (equivalent_usage == wacom_wac->hid_data.last_slot_field)
2641+ if (equivalent_usage == wacom_wac->hid_data.last_slot_field &&
2642+ wacom_wac->hid_data.confidence)
26392643 wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input);
26402644 }
26412645 }
@@ -2653,6 +2657,8 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev, · 11 unmodified lines
26532657
26542658 wacom_wac->is_invalid_bt_frame = false;
26552659
2660+ hid_data->confidence = true;
2661+
26562662 for (i = 0; i < report->maxfield; i++) {
26572663 struct hid_field *field = report->field[i];
26582664 int j;
drivers/hid/wacom_wac.h+1−0
@@ -301,6 +301,7 @@ struct hid_data { · 300 unmodified lines
301301 bool barrelswitch;
302302 bool barrelswitch2;
303303 bool serialhi;
304+ bool confidence;
304305 int x;
305306 int y;
306307 int pressure;
drivers/hv/hv_balloon.c+1−1
@@ -480,7 +480,7 @@ module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR)); · 479 unmodified lines
480480 MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
481481 static atomic_t trans_id = ATOMIC_INIT(0);
482482
483−static int dm_ring_size = 20 * 1024;
483+static int dm_ring_size = VMBUS_RING_SIZE(16 * 1024);
484484
485485 /*
486486 * Driver specific state.
drivers/hwmon/corsair-psu.c+1−1
@@ -729,7 +729,7 @@ static int corsairpsu_probe(struct hid_device *hdev, const struct hid_device_id · 728 unmodified lines
729729 corsairpsu_check_cmd_support(priv);
730730
731731 priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "corsairpsu", priv,
732− &corsairpsu_chip_info, 0);
732+ &corsairpsu_chip_info, NULL);
733733
734734 if (IS_ERR(priv->hwmon_dev)) {
735735 ret = PTR_ERR(priv->hwmon_dev);
drivers/hwmon/dell-smm-hwmon.c+3−4
@@ -627,10 +627,9 @@ static void __init i8k_init_procfs(struct device *dev) · 626 unmodified lines
627627 {
628628 struct dell_smm_data *data = dev_get_drvdata(dev);
629629
630− /* Register the proc entry */
631− proc_create_data("i8k", 0, NULL, &i8k_proc_ops, data);
632−
633− devm_add_action_or_reset(dev, i8k_exit_procfs, NULL);
630+ /* Only register exit function if creation was successful */
631+ if (proc_create_data("i8k", 0, NULL, &i8k_proc_ops, data))
632+ devm_add_action_or_reset(dev, i8k_exit_procfs, NULL);
634633 }
635634
636635 #else
drivers/hwmon/nct6775.c+1−1
@@ -1527,7 +1527,7 @@ static u16 nct6775_wmi_read_value(struct nct6775_data *data, u16 reg) · 1526 unmodified lines
15271527
15281528 nct6775_wmi_set_bank(data, reg);
15291529
1530− err = nct6775_asuswmi_read(data->bank, reg, &tmp);
1530+ err = nct6775_asuswmi_read(data->bank, reg & 0xff, &tmp);
15311531 if (err)
15321532 return 0;
15331533
drivers/hwmon/pwm-fan.c+0−2
@@ -336,8 +336,6 @@ static int pwm_fan_probe(struct platform_device *pdev) · 335 unmodified lines
336336 return ret;
337337 }
338338
339− ctx->pwm_value = MAX_PWM;
340−
341339 pwm_init_state(ctx->pwm, &ctx->pwm_state);
342340
343341 /*
drivers/hwmon/sht4x.c+2−2
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 /*
2424 * I2C command delays (in microseconds)
2525 */
26−#define SHT4X_MEAS_DELAY 1000
26+#define SHT4X_MEAS_DELAY_HPM 8200 /* see t_MEAS,h in datasheet */
2727 #define SHT4X_DELAY_EXTRA 10000
2828
2929 /*
@@ -90,7 +90,7 @@ static int sht4x_read_values(struct sht4x_data *data) · 60 unmodified lines
9090 if (ret < 0)
9191 goto unlock;
9292
93− usleep_range(SHT4X_MEAS_DELAY, SHT4X_MEAS_DELAY + SHT4X_DELAY_EXTRA);
93+ usleep_range(SHT4X_MEAS_DELAY_HPM, SHT4X_MEAS_DELAY_HPM + SHT4X_DELAY_EXTRA);
9494
9595 ret = i2c_master_recv(client, raw_data, SHT4X_RESPONSE_LENGTH);
9696 if (ret != SHT4X_RESPONSE_LENGTH) {
drivers/i2c/busses/i2c-cbus-gpio.c+3−2
@@ -195,8 +195,9 @@ static u32 cbus_i2c_func(struct i2c_adapter *adapter) · 194 unmodified lines
195195 }
196196
197197 static const struct i2c_algorithm cbus_i2c_algo = {
198− .smbus_xfer = cbus_i2c_smbus_xfer,
199− .functionality = cbus_i2c_func,
198+ .smbus_xfer = cbus_i2c_smbus_xfer,
199+ .smbus_xfer_atomic = cbus_i2c_smbus_xfer,
200+ .functionality = cbus_i2c_func,
200201 };
201202
202203 static int cbus_i2c_remove(struct platform_device *pdev)
drivers/i2c/busses/i2c-i801.c+25−7
@@ -191,6 +191,7 @@ · 190 unmodified lines
191191 #define SMBSLVSTS_HST_NTFY_STS BIT(0)
192192
193193 /* Host Notify Command register bits */
194+#define SMBSLVCMD_SMBALERT_DISABLE BIT(2)
194195 #define SMBSLVCMD_HST_NTFY_INTREN BIT(0)
195196
196197 #define STATUS_ERROR_FLAGS (SMBHSTSTS_FAILED | SMBHSTSTS_BUS_ERR | \
@@ -259,6 +260,7 @@ struct i801_priv { · 62 unmodified lines
259260 struct i2c_adapter adapter;
260261 unsigned long smba;
261262 unsigned char original_hstcfg;
263+ unsigned char original_hstcnt;
262264 unsigned char original_slvcmd;
263265 struct pci_dev *pci_dev;
264266 unsigned int features;
@@ -641,12 +643,20 @@ static irqreturn_t i801_isr(int irq, void *dev_id) · 376 unmodified lines
641643 i801_isr_byte_done(priv);
642644
643645 /*
644− * Clear irq sources and report transaction result.
646+ * Clear remaining IRQ sources: Completion of last command, errors
647+ * and the SMB_ALERT signal. SMB_ALERT status is set after signal
648+ * assertion independently of the interrupt generation being blocked
649+ * or not so clear it always when the status is set.
650+ */
651+ status &= SMBHSTSTS_INTR | STATUS_ERROR_FLAGS | SMBHSTSTS_SMBALERT_STS;
652+ if (status)
653+ outb_p(status, SMBHSTSTS(priv));
654+ status &= ~SMBHSTSTS_SMBALERT_STS; /* SMB_ALERT not reported */
655+ /*
656+ * Report transaction result.
645657 * ->status must be cleared before the next transaction is started.
646658 */
647− status &= SMBHSTSTS_INTR | STATUS_ERROR_FLAGS;
648659 if (status) {
649− outb_p(status, SMBHSTSTS(priv));
650660 priv->status = status;
651661 complete(&priv->done);
652662 }
@@ -974,9 +984,13 @@ static void i801_enable_host_notify(struct i2c_adapter *adapter) · 321 unmodified lines
974984 if (!(priv->features & FEATURE_HOST_NOTIFY))
975985 return;
976986
977− if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd))
978− outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd,
979− SMBSLVCMD(priv));
987+ /*
988+ * Enable host notify interrupt and block the generation of interrupt
989+ * from the SMB_ALERT signal because the driver does not support
990+ * SMBus Alert.
991+ */
992+ outb_p(SMBSLVCMD_HST_NTFY_INTREN | SMBSLVCMD_SMBALERT_DISABLE |
993+ priv->original_slvcmd, SMBSLVCMD(priv));
980994
981995 /* clear Host Notify bit to allow a new notification */
982996 outb_p(SMBSLVSTS_HST_NTFY_STS, SMBSLVSTS(priv));
@@ -1805,7 +1819,8 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) · 822 unmodified lines
18051819 outb_p(inb_p(SMBAUXCTL(priv)) &
18061820 ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv));
18071821
1808− /* Remember original Host Notify setting */
1822+ /* Remember original Interrupt and Host Notify settings */
1823+ priv->original_hstcnt = inb_p(SMBHSTCNT(priv)) & ~SMBHSTCNT_KILL;
18091824 if (priv->features & FEATURE_HOST_NOTIFY)
18101825 priv->original_slvcmd = inb_p(SMBSLVCMD(priv));
18111826
@@ -1869,6 +1884,7 @@ static void i801_remove(struct pci_dev *dev) · 57 unmodified lines
18691884 {
18701885 struct i801_priv *priv = pci_get_drvdata(dev);
18711886
1887+ outb_p(priv->original_hstcnt, SMBHSTCNT(priv));
18721888 i801_disable_host_notify(priv);
18731889 i801_del_mux(priv);
18741890 i2c_del_adapter(&priv->adapter);
@@ -1892,6 +1908,7 @@ static void i801_shutdown(struct pci_dev *dev) · 17 unmodified lines
18921908 struct i801_priv *priv = pci_get_drvdata(dev);
18931909
18941910 /* Restore config registers to avoid hard hang on some systems */
1911+ outb_p(priv->original_hstcnt, SMBHSTCNT(priv));
18951912 i801_disable_host_notify(priv);
18961913 pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
18971914 }
@@ -1901,6 +1918,7 @@ static int i801_suspend(struct device *dev) · 3 unmodified lines
19011918 {
19021919 struct i801_priv *priv = dev_get_drvdata(dev);
19031920
1921+ outb_p(priv->original_hstcnt, SMBHSTCNT(priv));
19041922 pci_write_config_byte(priv->pci_dev, SMBHSTCFG, priv->original_hstcfg);
19051923 return 0;
19061924 }
drivers/i2c/busses/i2c-mpc.c+1−1
@@ -636,7 +636,7 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id) · 635 unmodified lines
636636 status = readb(i2c->base + MPC_I2C_SR);
637637 if (status & CSR_MIF) {
638638 /* Wait up to 100us for transfer to properly complete */
639− readb_poll_timeout(i2c->base + MPC_I2C_SR, status, !(status & CSR_MCF), 0, 100);
639+ readb_poll_timeout_atomic(i2c->base + MPC_I2C_SR, status, status & CSR_MCF, 0, 100);
640640 writeb(0, i2c->base + MPC_I2C_SR);
641641 mpc_i2c_do_intr(i2c, status);
642642 return IRQ_HANDLED;
drivers/i2c/busses/i2c-rk3x.c+2−2
@@ -423,8 +423,8 @@ static void rk3x_i2c_handle_read(struct rk3x_i2c *i2c, unsigned int ipd) · 422 unmodified lines
423423 if (!(ipd & REG_INT_MBRF))
424424 return;
425425
426− /* ack interrupt */
427− i2c_writel(i2c, REG_INT_MBRF, REG_IPD);
426+ /* ack interrupt (read also produces a spurious START flag, clear it too) */
427+ i2c_writel(i2c, REG_INT_MBRF | REG_INT_START, REG_IPD);
428428
429429 /* Can only handle a maximum of 32 bytes at a time */
430430 if (len > 32)
drivers/i2c/busses/i2c-stm32f7.c+38−7
@@ -1493,6 +1493,7 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data) · 1492 unmodified lines
14931493 {
14941494 struct stm32f7_i2c_dev *i2c_dev = data;
14951495 struct stm32f7_i2c_msg *f7_msg = &i2c_dev->f7_msg;
1496+ struct stm32_i2c_dma *dma = i2c_dev->dma;
14961497 void __iomem *base = i2c_dev->base;
14971498 u32 status, mask;
14981499 int ret = IRQ_HANDLED;
@@ -1518,6 +1519,10 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data) · 19 unmodified lines
15181519 dev_dbg(i2c_dev->dev, "<%s>: Receive NACK (addr %x)\n",
15191520 __func__, f7_msg->addr);
15201521 writel_relaxed(STM32F7_I2C_ICR_NACKCF, base + STM32F7_I2C_ICR);
1522+ if (i2c_dev->use_dma) {
1523+ stm32f7_i2c_disable_dma_req(i2c_dev);
1524+ dmaengine_terminate_async(dma->chan_using);
1525+ }
15211526 f7_msg->result = -ENXIO;
15221527 }
15231528
@@ -1533,7 +1538,7 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data) · 9 unmodified lines
15331538 /* Clear STOP flag */
15341539 writel_relaxed(STM32F7_I2C_ICR_STOPCF, base + STM32F7_I2C_ICR);
15351540
1536− if (i2c_dev->use_dma) {
1541+ if (i2c_dev->use_dma && !f7_msg->result) {
15371542 ret = IRQ_WAKE_THREAD;
15381543 } else {
15391544 i2c_dev->master_mode = false;
@@ -1546,7 +1551,7 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data) · 6 unmodified lines
15461551 if (f7_msg->stop) {
15471552 mask = STM32F7_I2C_CR2_STOP;
15481553 stm32f7_i2c_set_bits(base + STM32F7_I2C_CR2, mask);
1549− } else if (i2c_dev->use_dma) {
1554+ } else if (i2c_dev->use_dma && !f7_msg->result) {
15501555 ret = IRQ_WAKE_THREAD;
15511556 } else if (f7_msg->smbus) {
15521557 stm32f7_i2c_smbus_rep_start(i2c_dev);
@@ -1583,7 +1588,7 @@ static irqreturn_t stm32f7_i2c_isr_event_thread(int irq, void *data) · 30 unmodified lines
15831588 if (!ret) {
15841589 dev_dbg(i2c_dev->dev, "<%s>: Timed out\n", __func__);
15851590 stm32f7_i2c_disable_dma_req(i2c_dev);
1586− dmaengine_terminate_all(dma->chan_using);
1591+ dmaengine_terminate_async(dma->chan_using);
15871592 f7_msg->result = -ETIMEDOUT;
15881593 }
15891594
@@ -1660,7 +1665,7 @@ static irqreturn_t stm32f7_i2c_isr_error(int irq, void *data) · 70 unmodified lines
16601665 /* Disable dma */
16611666 if (i2c_dev->use_dma) {
16621667 stm32f7_i2c_disable_dma_req(i2c_dev);
1663− dmaengine_terminate_all(dma->chan_using);
1668+ dmaengine_terminate_async(dma->chan_using);
16641669 }
16651670
16661671 i2c_dev->master_mode = false;
@@ -1696,12 +1701,26 @@ static int stm32f7_i2c_xfer(struct i2c_adapter *i2c_adap, · 29 unmodified lines
16961701 time_left = wait_for_completion_timeout(&i2c_dev->complete,
16971702 i2c_dev->adap.timeout);
16981703 ret = f7_msg->result;
1704+ if (ret) {
1705+ if (i2c_dev->use_dma)
1706+ dmaengine_synchronize(dma->chan_using);
1707+
1708+ /*
1709+ * It is possible that some unsent data have already been
1710+ * written into TXDR. To avoid sending old data in a
1711+ * further transfer, flush TXDR in case of any error
1712+ */
1713+ writel_relaxed(STM32F7_I2C_ISR_TXE,
1714+ i2c_dev->base + STM32F7_I2C_ISR);
1715+ goto pm_free;
1716+ }
16991717
17001718 if (!time_left) {
17011719 dev_dbg(i2c_dev->dev, "Access to slave 0x%x timed out\n",
17021720 i2c_dev->msg->addr);
17031721 if (i2c_dev->use_dma)
1704− dmaengine_terminate_all(dma->chan_using);
1722+ dmaengine_terminate_sync(dma->chan_using);
1723+ stm32f7_i2c_wait_free_bus(i2c_dev);
17051724 ret = -ETIMEDOUT;
17061725 }
17071726
@@ -1744,13 +1763,25 @@ static int stm32f7_i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, · 36 unmodified lines
17441763 timeout = wait_for_completion_timeout(&i2c_dev->complete,
17451764 i2c_dev->adap.timeout);
17461765 ret = f7_msg->result;
1747− if (ret)
1766+ if (ret) {
1767+ if (i2c_dev->use_dma)
1768+ dmaengine_synchronize(dma->chan_using);
1769+
1770+ /*
1771+ * It is possible that some unsent data have already been
1772+ * written into TXDR. To avoid sending old data in a
1773+ * further transfer, flush TXDR in case of any error
1774+ */
1775+ writel_relaxed(STM32F7_I2C_ISR_TXE,
1776+ i2c_dev->base + STM32F7_I2C_ISR);
17481777 goto pm_free;
1778+ }
17491779
17501780 if (!timeout) {
17511781 dev_dbg(dev, "Access to slave 0x%x timed out\n", f7_msg->addr);
17521782 if (i2c_dev->use_dma)
1753− dmaengine_terminate_all(dma->chan_using);
1783+ dmaengine_terminate_sync(dma->chan_using);
1784+ stm32f7_i2c_wait_free_bus(i2c_dev);
17541785 ret = -ETIMEDOUT;
17551786 goto pm_free;
17561787 }
drivers/i2c/busses/i2c-virtio.c+16−28
@@ -22,24 +22,24 @@ · 21 unmodified lines
2222 /**
2323 * struct virtio_i2c - virtio I2C data
2424 * @vdev: virtio device for this controller
25− * @completion: completion of virtio I2C message
2625 * @adap: I2C adapter for this controller
2726 * @vq: the virtio virtqueue for communication
2827 */
2928 struct virtio_i2c {
3029 struct virtio_device *vdev;
31− struct completion completion;
3230 struct i2c_adapter adap;
3331 struct virtqueue *vq;
3432 };
3533
3634 /**
3735 * struct virtio_i2c_req - the virtio I2C request structure
36+ * @completion: completion of virtio I2C message
3837 * @out_hdr: the OUT header of the virtio I2C message
3938 * @buf: the buffer into which data is read, or from which it's written
4039 * @in_hdr: the IN header of the virtio I2C message
4140 */
4241 struct virtio_i2c_req {
42+ struct completion completion;
4343 struct virtio_i2c_out_hdr out_hdr ____cacheline_aligned;
4444 uint8_t *buf ____cacheline_aligned;
4545 struct virtio_i2c_in_hdr in_hdr ____cacheline_aligned;
@@ -47,9 +47,11 @@ struct virtio_i2c_req { · 1 unmodified line
4747
4848 static void virtio_i2c_msg_done(struct virtqueue *vq)
4949 {
50− struct virtio_i2c *vi = vq->vdev->priv;
50+ struct virtio_i2c_req *req;
51+ unsigned int len;
5152
52− complete(&vi->completion);
53+ while ((req = virtqueue_get_buf(vq, &len)))
54+ complete(&req->completion);
5355 }
5456
5557 static int virtio_i2c_prepare_reqs(struct virtqueue *vq,
@@ -62,6 +64,8 @@ static int virtio_i2c_prepare_reqs(struct virtqueue *vq, · 6 unmodified lines
6264 for (i = 0; i < num; i++) {
6365 int outcnt = 0, incnt = 0;
6466
67+ init_completion(&reqs[i].completion);
68+
6569 /*
6670 * Only 7-bit mode supported for this moment. For the address
6771 * format, Please check the Virtio I2C Specification.
@@ -104,24 +108,17 @@ static int virtio_i2c_prepare_reqs(struct virtqueue *vq, · 36 unmodified lines
104108
105109 static int virtio_i2c_complete_reqs(struct virtqueue *vq,
106110 struct virtio_i2c_req *reqs,
107− struct i2c_msg *msgs, int num,
108− bool timedout)
111+ struct i2c_msg *msgs, int num)
109112 {
110− struct virtio_i2c_req *req;
111− bool failed = timedout;
112− unsigned int len;
113+ bool failed = false;
113114 int i, j = 0;
114115
115116 for (i = 0; i < num; i++) {
116− /* Detach the ith request from the vq */
117− req = virtqueue_get_buf(vq, &len);
117+ struct virtio_i2c_req *req = &reqs[i];
118118
119− /*
120− * Condition req == &reqs[i] should always meet since we have
121− * total num requests in the vq. reqs[i] can never be NULL here.
122− */
123− if (!failed && (WARN_ON(req != &reqs[i]) ||
124− req->in_hdr.status != VIRTIO_I2C_MSG_OK))
119+ wait_for_completion(&req->completion);
120+
121+ if (!failed && req->in_hdr.status != VIRTIO_I2C_MSG_OK)
125122 failed = true;
126123
127124 i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !failed);
@@ -130,7 +127,7 @@ static int virtio_i2c_complete_reqs(struct virtqueue *vq, · 2 unmodified lines
130127 j++;
131128 }
132129
133− return timedout ? -ETIMEDOUT : j;
130+ return j;
134131 }
135132
136133 static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
@@ -139,7 +136,6 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, · 2 unmodified lines
139136 struct virtio_i2c *vi = i2c_get_adapdata(adap);
140137 struct virtqueue *vq = vi->vq;
141138 struct virtio_i2c_req *reqs;
142− unsigned long time_left;
143139 int count;
144140
145141 reqs = kcalloc(num, sizeof(*reqs), GFP_KERNEL);
@@ -158,15 +154,9 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, · 12 unmodified lines
158154 * remote here to clear the virtqueue, so we can try another set of
159155 * messages later on.
160156 */
161−
162− reinit_completion(&vi->completion);
163157 virtqueue_kick(vq);
164158
165− time_left = wait_for_completion_timeout(&vi->completion, adap->timeout);
166− if (!time_left)
167− dev_err(&adap->dev, "virtio i2c backend timeout.\n");
168−
169− count = virtio_i2c_complete_reqs(vq, reqs, msgs, count, !time_left);
159+ count = virtio_i2c_complete_reqs(vq, reqs, msgs, count);
170160
171161 err_free:
172162 kfree(reqs);
@@ -214,8 +204,6 @@ static int virtio_i2c_probe(struct virtio_device *vdev) · 41 unmodified lines
214204 vdev->priv = vi;
215205 vi->vdev = vdev;
216206
217− init_completion(&vi->completion);
218−
219207 ret = virtio_i2c_setup_vqs(vi);
220208 if (ret)
221209 return ret;
drivers/iio/accel/kxcjk-1013.c+2−3
@@ -1595,8 +1595,7 @@ static int kxcjk1013_probe(struct i2c_client *client, · 1594 unmodified lines
15951595 return 0;
15961596
15971597 err_buffer_cleanup:
1598− if (data->dready_trig)
1599− iio_triggered_buffer_cleanup(indio_dev);
1598+ iio_triggered_buffer_cleanup(indio_dev);
16001599 err_trigger_unregister:
16011600 if (data->dready_trig)
16021601 iio_trigger_unregister(data->dready_trig);
@@ -1618,8 +1617,8 @@ static int kxcjk1013_remove(struct i2c_client *client) · 15 unmodified lines
16181617 pm_runtime_disable(&client->dev);
16191618 pm_runtime_set_suspended(&client->dev);
16201619
1620+ iio_triggered_buffer_cleanup(indio_dev);
16211621 if (data->dready_trig) {
1622− iio_triggered_buffer_cleanup(indio_dev);
16231622 iio_trigger_unregister(data->dready_trig);
16241623 iio_trigger_unregister(data->motion_trig);
16251624 }
drivers/iio/accel/kxsd9.c+3−3
@@ -224,14 +224,14 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p) · 223 unmodified lines
224224 hw_values.chan,
225225 sizeof(hw_values.chan));
226226 if (ret) {
227− dev_err(st->dev,
228− "error reading data\n");
229− return ret;
227+ dev_err(st->dev, "error reading data: %d\n", ret);
228+ goto out;
230229 }
231230
232231 iio_push_to_buffers_with_timestamp(indio_dev,
233232 &hw_values,
234233 iio_get_time_ns(indio_dev));
234+out:
235235 iio_trigger_notify_done(indio_dev->trig);
236236
237237 return IRQ_HANDLED;
drivers/iio/accel/mma8452.c+1−1
@@ -1470,7 +1470,7 @@ static int mma8452_trigger_setup(struct iio_dev *indio_dev) · 1469 unmodified lines
14701470 if (ret)
14711471 return ret;
14721472
1473− indio_dev->trig = trig;
1473+ indio_dev->trig = iio_trigger_get(trig);
14741474
14751475 return 0;
14761476 }
drivers/iio/adc/Kconfig+1−1
@@ -532,7 +532,7 @@ config IMX7D_ADC · 531 unmodified lines
532532
533533 config IMX8QXP_ADC
534534 tristate "NXP IMX8QXP ADC driver"
535− depends on ARCH_MXC_ARM64 || COMPILE_TEST
535+ depends on ARCH_MXC || COMPILE_TEST
536536 depends on HAS_IOMEM
537537 help
538538 Say yes here to build support for IMX8QXP ADC.
drivers/iio/adc/ad7768-1.c+1−1
@@ -480,8 +480,8 @@ static irqreturn_t ad7768_trigger_handler(int irq, void *p) · 479 unmodified lines
480480 iio_push_to_buffers_with_timestamp(indio_dev, &st->data.scan,
481481 iio_get_time_ns(indio_dev));
482482
483− iio_trigger_notify_done(indio_dev->trig);
484483 err_unlock:
484+ iio_trigger_notify_done(indio_dev->trig);
485485 mutex_unlock(&st->lock);
486486
487487 return IRQ_HANDLED;
drivers/iio/adc/at91-sama5d2_adc.c+2−1
@@ -1586,7 +1586,8 @@ static int at91_adc_read_info_raw(struct iio_dev *indio_dev, · 1585 unmodified lines
15861586 *val = st->conversion_value;
15871587 ret = at91_adc_adjust_val_osr(st, val);
15881588 if (chan->scan_type.sign == 's')
1589− *val = sign_extend32(*val, 11);
1589+ *val = sign_extend32(*val,
1590+ chan->scan_type.realbits - 1);
15901591 st->conversion_done = false;
15911592 }
15921593
drivers/iio/adc/axp20x_adc.c+3−15
@@ -251,19 +251,8 @@ static int axp22x_adc_raw(struct iio_dev *indio_dev, · 250 unmodified lines
251251 struct iio_chan_spec const *chan, int *val)
252252 {
253253 struct axp20x_adc_iio *info = iio_priv(indio_dev);
254− int size;
255254
256− /*
257− * N.B.: Unlike the Chinese datasheets tell, the charging current is
258− * stored on 12 bits, not 13 bits. Only discharging current is on 13
259− * bits.
260− */
261− if (chan->type == IIO_CURRENT && chan->channel == AXP22X_BATT_DISCHRG_I)
262− size = 13;
263− else
264− size = 12;
265−
266− *val = axp20x_read_variable_width(info->regmap, chan->address, size);
255+ *val = axp20x_read_variable_width(info->regmap, chan->address, 12);
267256 if (*val < 0)
268257 return *val;
269258
@@ -386,9 +375,8 @@ static int axp22x_adc_scale(struct iio_chan_spec const *chan, int *val, · 116 unmodified lines
386375 return IIO_VAL_INT_PLUS_MICRO;
387376
388377 case IIO_CURRENT:
389− *val = 0;
390− *val2 = 500000;
391− return IIO_VAL_INT_PLUS_MICRO;
378+ *val = 1;
379+ return IIO_VAL_INT;
392380
393381 case IIO_TEMP:
394382 *val = 100;
drivers/iio/adc/dln2-adc.c+12−9
@@ -248,7 +248,6 @@ static int dln2_adc_set_chan_period(struct dln2_adc *dln2, · 247 unmodified lines
248248 static int dln2_adc_read(struct dln2_adc *dln2, unsigned int channel)
249249 {
250250 int ret, i;
251− struct iio_dev *indio_dev = platform_get_drvdata(dln2->pdev);
252251 u16 conflict;
253252 __le16 value;
254253 int olen = sizeof(value);
@@ -257,13 +256,9 @@ static int dln2_adc_read(struct dln2_adc *dln2, unsigned int channel) · 2 unmodified lines
257256 .chan = channel,
258257 };
259258
260− ret = iio_device_claim_direct_mode(indio_dev);
261− if (ret < 0)
262− return ret;
263−
264259 ret = dln2_adc_set_chan_enabled(dln2, channel, true);
265260 if (ret < 0)
266− goto release_direct;
261+ return ret;
267262
268263 ret = dln2_adc_set_port_enabled(dln2, true, &conflict);
269264 if (ret < 0) {
@@ -300,8 +295,6 @@ disable_port: · 30 unmodified lines
300295 dln2_adc_set_port_enabled(dln2, false, NULL);
301296 disable_chan:
302297 dln2_adc_set_chan_enabled(dln2, channel, false);
303−release_direct:
304− iio_device_release_direct_mode(indio_dev);
305298
306299 return ret;
307300 }
@@ -337,10 +330,16 @@ static int dln2_adc_read_raw(struct iio_dev *indio_dev, · 29 unmodified lines
337330
338331 switch (mask) {
339332 case IIO_CHAN_INFO_RAW:
333+ ret = iio_device_claim_direct_mode(indio_dev);
334+ if (ret < 0)
335+ return ret;
336+
340337 mutex_lock(&dln2->mutex);
341338 ret = dln2_adc_read(dln2, chan->channel);
342339 mutex_unlock(&dln2->mutex);
343340
341+ iio_device_release_direct_mode(indio_dev);
342+
344343 if (ret < 0)
345344 return ret;
346345
@@ -656,7 +655,11 @@ static int dln2_adc_probe(struct platform_device *pdev) · 309 unmodified lines
656655 return -ENOMEM;
657656 }
658657 iio_trigger_set_drvdata(dln2->trig, dln2);
659− devm_iio_trigger_register(dev, dln2->trig);
658+ ret = devm_iio_trigger_register(dev, dln2->trig);
659+ if (ret) {
660+ dev_err(dev, "failed to register trigger: %d\n", ret);
661+ return ret;
662+ }
660663 iio_trigger_set_immutable(indio_dev, dln2->trig);
661664
662665 ret = devm_iio_triggered_buffer_setup(dev, indio_dev, NULL,
drivers/iio/adc/stm32-adc.c+2−1
@@ -1117,6 +1117,7 @@ static void stm32h7_adc_unprepare(struct iio_dev *indio_dev) · 1116 unmodified lines
11171117 {
11181118 struct stm32_adc *adc = iio_priv(indio_dev);
11191119
1120+ stm32_adc_writel(adc, STM32H7_ADC_PCSEL, 0);
11201121 stm32h7_adc_disable(indio_dev);
11211122 stm32_adc_int_ch_disable(adc);
11221123 stm32h7_adc_enter_pwr_down(adc);
@@ -1986,7 +1987,7 @@ static int stm32_adc_populate_int_ch(struct iio_dev *indio_dev, const char *ch_n · 863 unmodified lines
19861987 /* Get calibration data for vrefint channel */
19871988 ret = nvmem_cell_read_u16(&indio_dev->dev, "vrefint", &vrefint);
19881989 if (ret && ret != -ENOENT) {
1989− return dev_err_probe(&indio_dev->dev, ret,
1990+ return dev_err_probe(indio_dev->dev.parent, ret,
19901991 "nvmem access error\n");
19911992 }
19921993 if (ret == -ENOENT)
drivers/iio/gyro/adxrs290.c+3−2
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 */
88
99 #include <linux/bitfield.h>
10+#include <linux/bitops.h>
1011 #include <linux/delay.h>
1112 #include <linux/device.h>
1213 #include <linux/kernel.h>
@@ -124,7 +125,7 @@ static int adxrs290_get_rate_data(struct iio_dev *indio_dev, const u8 cmd, int * · 111 unmodified lines
124125 goto err_unlock;
125126 }
126127
127− *val = temp;
128+ *val = sign_extend32(temp, 15);
128129
129130 err_unlock:
130131 mutex_unlock(&st->lock);
@@ -146,7 +147,7 @@ static int adxrs290_get_temp_data(struct iio_dev *indio_dev, int *val) · 15 unmodified lines
146147 }
147148
148149 /* extract lower 12 bits temperature reading */
149− *val = temp & 0x0FFF;
150+ *val = sign_extend32(temp, 11);
150151
151152 err_unlock:
152153 mutex_unlock(&st->lock);
drivers/iio/gyro/itg3200_buffer.c+1−1
@@ -61,9 +61,9 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p) · 60 unmodified lines
6161
6262 iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp);
6363
64+error_ret:
6465 iio_trigger_notify_done(indio_dev->trig);
6566
66−error_ret:
6767 return IRQ_HANDLED;
6868 }
6969
drivers/iio/industrialio-trigger.c+0−1
@@ -556,7 +556,6 @@ struct iio_trigger *viio_trigger_alloc(struct device *parent, · 555 unmodified lines
556556 irq_modify_status(trig->subirq_base + i,
557557 IRQ_NOREQUEST | IRQ_NOAUTOEN, IRQ_NOPROBE);
558558 }
559− get_device(&trig->dev);
560559
561560 return trig;
562561
drivers/iio/light/ltr501.c+1−1
@@ -1275,7 +1275,7 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p) · 1274 unmodified lines
12751275 ret = regmap_bulk_read(data->regmap, LTR501_ALS_DATA1,
12761276 als_buf, sizeof(als_buf));
12771277 if (ret < 0)
1278− return ret;
1278+ goto done;
12791279 if (test_bit(0, indio_dev->active_scan_mask))
12801280 scan.channels[j++] = le16_to_cpu(als_buf[1]);
12811281 if (test_bit(1, indio_dev->active_scan_mask))
drivers/iio/light/stk3310.c+3−3
@@ -546,9 +546,8 @@ static irqreturn_t stk3310_irq_event_handler(int irq, void *private) · 545 unmodified lines
546546 mutex_lock(&data->lock);
547547 ret = regmap_field_read(data->reg_flag_nf, &dir);
548548 if (ret < 0) {
549− dev_err(&data->client->dev, "register read failed\n");
550− mutex_unlock(&data->lock);
551− return ret;
549+ dev_err(&data->client->dev, "register read failed: %d\n", ret);
550+ goto out;
552551 }
553552 event = IIO_UNMOD_EVENT_CODE(IIO_PROXIMITY, 1,
554553 IIO_EV_TYPE_THRESH,
@@ -560,6 +559,7 @@ static irqreturn_t stk3310_irq_event_handler(int irq, void *private) · 5 unmodified lines
560559 ret = regmap_field_write(data->reg_flag_psint, 0);
561560 if (ret < 0)
562561 dev_err(&data->client->dev, "failed to reset interrupts\n");
562+out:
563563 mutex_unlock(&data->lock);
564564
565565 return IRQ_HANDLED;
drivers/iio/trigger/stm32-timer-trigger.c+1−1
@@ -912,6 +912,6 @@ static struct platform_driver stm32_timer_trigger_driver = { · 911 unmodified lines
912912 };
913913 module_platform_driver(stm32_timer_trigger_driver);
914914
915−MODULE_ALIAS("platform: stm32-timer-trigger");
915+MODULE_ALIAS("platform:stm32-timer-trigger");
916916 MODULE_DESCRIPTION("STMicroelectronics STM32 Timer Trigger driver");
917917 MODULE_LICENSE("GPL v2");
drivers/infiniband/core/nldev.c+2−1
@@ -1906,7 +1906,8 @@ static int nldev_stat_set_mode_doit(struct sk_buff *msg, · 1905 unmodified lines
19061906 int ret;
19071907
19081908 /* Currently only counter for QP is supported */
1909− if (nla_get_u32(tb[RDMA_NLDEV_ATTR_STAT_RES]) != RDMA_NLDEV_ATTR_RES_QP)
1909+ if (!tb[RDMA_NLDEV_ATTR_STAT_RES] ||
1910+ nla_get_u32(tb[RDMA_NLDEV_ATTR_STAT_RES]) != RDMA_NLDEV_ATTR_RES_QP)
19101911 return -EINVAL;
19111912
19121913 mode = nla_get_u32(tb[RDMA_NLDEV_ATTR_STAT_MODE]);
drivers/infiniband/core/verbs.c+3−0
@@ -1232,6 +1232,9 @@ static struct ib_qp *create_qp(struct ib_device *dev, struct ib_pd *pd, · 1231 unmodified lines
12321232 INIT_LIST_HEAD(&qp->rdma_mrs);
12331233 INIT_LIST_HEAD(&qp->sig_mrs);
12341234
1235+ qp->send_cq = attr->send_cq;
1236+ qp->recv_cq = attr->recv_cq;
1237+
12351238 rdma_restrack_new(&qp->res, RDMA_RESTRACK_QP);
12361239 WARN_ONCE(!udata && !caller, "Missing kernel QP owner");
12371240 rdma_restrack_set_name(&qp->res, udata ? NULL : caller);
drivers/infiniband/hw/hfi1/chip.c+2−0
@@ -8415,6 +8415,8 @@ static void receive_interrupt_common(struct hfi1_ctxtdata *rcd) · 8414 unmodified lines
84158415 */
84168416 static void __hfi1_rcd_eoi_intr(struct hfi1_ctxtdata *rcd)
84178417 {
8418+ if (!rcd->rcvhdrq)
8419+ return;
84188420 clear_recv_intr(rcd);
84198421 if (check_packet_present(rcd))
84208422 force_recv_intr(rcd);
drivers/infiniband/hw/hfi1/driver.c+2−0
@@ -1012,6 +1012,8 @@ int handle_receive_interrupt(struct hfi1_ctxtdata *rcd, int thread) · 1011 unmodified lines
10121012 struct hfi1_packet packet;
10131013 int skip_pkt = 0;
10141014
1015+ if (!rcd->rcvhdrq)
1016+ return RCV_PKT_OK;
10151017 /* Control context will always use the slow path interrupt handler */
10161018 needset = (rcd->ctxt == HFI1_CTRL_CTXT) ? 0 : 1;
10171019
drivers/infiniband/hw/hfi1/init.c+17−23
@@ -113,7 +113,6 @@ static int hfi1_create_kctxt(struct hfi1_devdata *dd, · 112 unmodified lines
113113 rcd->fast_handler = get_dma_rtail_setting(rcd) ?
114114 handle_receive_interrupt_dma_rtail :
115115 handle_receive_interrupt_nodma_rtail;
116− rcd->slow_handler = handle_receive_interrupt;
117116
118117 hfi1_set_seq_cnt(rcd, 1);
119118
@@ -334,6 +333,8 @@ int hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, int numa, · 214 unmodified lines
334333 rcd->numa_id = numa;
335334 rcd->rcv_array_groups = dd->rcv_entries.ngroups;
336335 rcd->rhf_rcv_function_map = normal_rhf_rcv_functions;
336+ rcd->slow_handler = handle_receive_interrupt;
337+ rcd->do_interrupt = rcd->slow_handler;
337338 rcd->msix_intr = CCE_NUM_MSIX_VECTORS;
338339
339340 mutex_init(&rcd->exp_mutex);
@@ -874,18 +875,6 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit) · 534 unmodified lines
874875 if (ret)
875876 goto done;
876877
877− /* allocate dummy tail memory for all receive contexts */
878− dd->rcvhdrtail_dummy_kvaddr = dma_alloc_coherent(&dd->pcidev->dev,
879− sizeof(u64),
880− &dd->rcvhdrtail_dummy_dma,
881− GFP_KERNEL);
882−
883− if (!dd->rcvhdrtail_dummy_kvaddr) {
884− dd_dev_err(dd, "cannot allocate dummy tail memory\n");
885− ret = -ENOMEM;
886− goto done;
887− }
888−
889878 /* dd->rcd can be NULL if early initialization failed */
890879 for (i = 0; dd->rcd && i < dd->first_dyn_alloc_ctxt; ++i) {
891880 /*
@@ -898,8 +887,6 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit) · 6 unmodified lines
898887 if (!rcd)
899888 continue;
900889
901− rcd->do_interrupt = &handle_receive_interrupt;
902−
903890 lastfail = hfi1_create_rcvhdrq(dd, rcd);
904891 if (!lastfail)
905892 lastfail = hfi1_setup_eagerbufs(rcd);
@@ -1120,7 +1107,7 @@ void hfi1_free_ctxtdata(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd) · 214 unmodified lines
11201107 rcd->egrbufs.rcvtids = NULL;
11211108
11221109 for (e = 0; e < rcd->egrbufs.alloced; e++) {
1123− if (rcd->egrbufs.buffers[e].dma)
1110+ if (rcd->egrbufs.buffers[e].addr)
11241111 dma_free_coherent(&dd->pcidev->dev,
11251112 rcd->egrbufs.buffers[e].len,
11261113 rcd->egrbufs.buffers[e].addr,
@@ -1201,6 +1188,11 @@ void hfi1_free_devdata(struct hfi1_devdata *dd) · 74 unmodified lines
12011188 dd->tx_opstats = NULL;
12021189 kfree(dd->comp_vect);
12031190 dd->comp_vect = NULL;
1191+ if (dd->rcvhdrtail_dummy_kvaddr)
1192+ dma_free_coherent(&dd->pcidev->dev, sizeof(u64),
1193+ (void *)dd->rcvhdrtail_dummy_kvaddr,
1194+ dd->rcvhdrtail_dummy_dma);
1195+ dd->rcvhdrtail_dummy_kvaddr = NULL;
12041196 sdma_clean(dd, dd->num_sdma);
12051197 rvt_dealloc_device(&dd->verbs_dev.rdi);
12061198 }
@@ -1298,6 +1290,15 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, · 91 unmodified lines
12981290 goto bail;
12991291 }
13001292
1293+ /* allocate dummy tail memory for all receive contexts */
1294+ dd->rcvhdrtail_dummy_kvaddr =
1295+ dma_alloc_coherent(&dd->pcidev->dev, sizeof(u64),
1296+ &dd->rcvhdrtail_dummy_dma, GFP_KERNEL);
1297+ if (!dd->rcvhdrtail_dummy_kvaddr) {
1298+ ret = -ENOMEM;
1299+ goto bail;
1300+ }
1301+
13011302 atomic_set(&dd->ipoib_rsm_usr_num, 0);
13021303 return dd;
13031304
@@ -1505,13 +1506,6 @@ static void cleanup_device_data(struct hfi1_devdata *dd) · 201 unmodified lines
15051506
15061507 free_credit_return(dd);
15071508
1508− if (dd->rcvhdrtail_dummy_kvaddr) {
1509− dma_free_coherent(&dd->pcidev->dev, sizeof(u64),
1510− (void *)dd->rcvhdrtail_dummy_kvaddr,
1511− dd->rcvhdrtail_dummy_dma);
1512− dd->rcvhdrtail_dummy_kvaddr = NULL;
1513− }
1514−
15151509 /*
15161510 * Free any resources still in use (usually just kernel contexts)
15171511 * at unload; we do for ctxtcnt, because that's what we allocate.
drivers/infiniband/hw/hfi1/sdma.c+1−1
@@ -838,8 +838,8 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, · 837 unmodified lines
838838 if (current->nr_cpus_allowed != 1)
839839 goto out;
840840
841− cpu_id = smp_processor_id();
842841 rcu_read_lock();
842+ cpu_id = smp_processor_id();
843843 rht_node = rhashtable_lookup(dd->sdma_rht, &cpu_id,
844844 sdma_rht_params);
845845
drivers/infiniband/hw/hfi1/verbs.c+2−3
@@ -1628,8 +1628,7 @@ static int init_cntr_names(const char *names_in, const size_t names_len, · 1627 unmodified lines
16281628 n++;
16291629
16301630 names_out =
1631− kmalloc((n + num_extra_names) * sizeof(struct rdma_stat_desc) +
1632− names_len,
1631+ kzalloc((n + num_extra_names) * sizeof(*q) + names_len,
16331632 GFP_KERNEL);
16341633 if (!names_out) {
16351634 *num_cntrs = 0;
@@ -1637,7 +1636,7 @@ static int init_cntr_names(const char *names_in, const size_t names_len, · 1 unmodified line
16371636 return -ENOMEM;
16381637 }
16391638
1640− p = names_out + (n + num_extra_names) * sizeof(struct rdma_stat_desc);
1639+ p = names_out + (n + num_extra_names) * sizeof(*q);
16411640 memcpy(p, names_in, names_len);
16421641
16431642 q = (struct rdma_stat_desc *)names_out;
drivers/infiniband/hw/hns/hns_roce_hw_v2.c+11−3
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <linux/acpi.h>
3434 #include <linux/etherdevice.h>
3535 #include <linux/interrupt.h>
36+#include <linux/iopoll.h>
3637 #include <linux/kernel.h>
3738 #include <linux/types.h>
3839 #include <net/addrconf.h>
@@ -1052,9 +1053,14 @@ static u32 hns_roce_v2_cmd_hw_resetting(struct hns_roce_dev *hr_dev, · 1013 unmodified lines
10521053 unsigned long instance_stage,
10531054 unsigned long reset_stage)
10541055 {
1056+#define HW_RESET_TIMEOUT_US 1000000
1057+#define HW_RESET_SLEEP_US 1000
1058+
10551059 struct hns_roce_v2_priv *priv = hr_dev->priv;
10561060 struct hnae3_handle *handle = priv->handle;
10571061 const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
1062+ unsigned long val;
1063+ int ret;
10581064
10591065 /* When hardware reset is detected, we should stop sending mailbox&cmq&
10601066 * doorbell to hardware. If now in .init_instance() function, we should
@@ -1066,7 +1072,11 @@ static u32 hns_roce_v2_cmd_hw_resetting(struct hns_roce_dev *hr_dev, · 5 unmodified lines
10661072 * again.
10671073 */
10681074 hr_dev->dis_db = true;
1069− if (!ops->get_hw_reset_stat(handle))
1075+
1076+ ret = read_poll_timeout(ops->ae_dev_reset_cnt, val,
1077+ val > hr_dev->reset_cnt, HW_RESET_SLEEP_US,
1078+ HW_RESET_TIMEOUT_US, false, handle);
1079+ if (!ret)
10701080 hr_dev->is_reset = true;
10711081
10721082 if (!hr_dev->is_reset || reset_stage == HNS_ROCE_STATE_RST_INIT ||
@@ -6391,10 +6401,8 @@ static int hns_roce_hw_v2_reset_notify_down(struct hnae3_handle *handle) · 5318 unmodified lines
63916401 if (!hr_dev)
63926402 return 0;
63936403
6394− hr_dev->is_reset = true;
63956404 hr_dev->active = false;
63966405 hr_dev->dis_db = true;
6397−
63986406 hr_dev->state = HNS_ROCE_DEVICE_STATE_RST_DOWN;
63996407
64006408 return 0;
drivers/infiniband/hw/irdma/hw.c+6−1
@@ -60,6 +60,8 @@ static void irdma_iwarp_ce_handler(struct irdma_sc_cq *iwcq) · 59 unmodified lines
6060 {
6161 struct irdma_cq *cq = iwcq->back_cq;
6262
63+ if (!cq->user_mode)
64+ cq->armed = false;
6365 if (cq->ibcq.comp_handler)
6466 cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
6567 }
@@ -146,6 +148,7 @@ static void irdma_set_flush_fields(struct irdma_sc_qp *qp, · 80 unmodified lines
146148 qp->flush_code = FLUSH_PROT_ERR;
147149 break;
148150 case IRDMA_AE_AMP_BAD_QP:
151+ case IRDMA_AE_WQE_UNEXPECTED_OPCODE:
149152 qp->flush_code = FLUSH_LOC_QP_OP_ERR;
150153 break;
151154 case IRDMA_AE_AMP_BAD_STAG_KEY:
@@ -156,7 +159,6 @@ static void irdma_set_flush_fields(struct irdma_sc_qp *qp, · 4 unmodified lines
156159 case IRDMA_AE_PRIV_OPERATION_DENIED:
157160 case IRDMA_AE_IB_INVALID_REQUEST:
158161 case IRDMA_AE_IB_REMOTE_ACCESS_ERROR:
159− case IRDMA_AE_IB_REMOTE_OP_ERROR:
160162 qp->flush_code = FLUSH_REM_ACCESS_ERR;
161163 qp->event_type = IRDMA_QP_EVENT_ACCESS_ERR;
162164 break;
@@ -184,6 +186,9 @@ static void irdma_set_flush_fields(struct irdma_sc_qp *qp, · 21 unmodified lines
184186 case IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS:
185187 qp->flush_code = FLUSH_MW_BIND_ERR;
186188 break;
189+ case IRDMA_AE_IB_REMOTE_OP_ERROR:
190+ qp->flush_code = FLUSH_REM_OP_ERR;
191+ break;
187192 default:
188193 qp->flush_code = FLUSH_FATAL_ERR;
189194 break;
drivers/infiniband/hw/irdma/main.h+1−0
@@ -542,6 +542,7 @@ int irdma_ah_cqp_op(struct irdma_pci_f *rf, struct irdma_sc_ah *sc_ah, u8 cmd, · 541 unmodified lines
542542 void (*callback_fcn)(struct irdma_cqp_request *cqp_request),
543543 void *cb_param);
544544 void irdma_gsi_ud_qp_ah_cb(struct irdma_cqp_request *cqp_request);
545+bool irdma_cq_empty(struct irdma_cq *iwcq);
545546 int irdma_inetaddr_event(struct notifier_block *notifier, unsigned long event,
546547 void *ptr);
547548 int irdma_inet6addr_event(struct notifier_block *notifier, unsigned long event,
drivers/infiniband/hw/irdma/pble.c+3−5
@@ -25,8 +25,7 @@ void irdma_destroy_pble_prm(struct irdma_hmc_pble_rsrc *pble_rsrc) · 24 unmodified lines
2525 list_del(&chunk->list);
2626 if (chunk->type == PBLE_SD_PAGED)
2727 irdma_pble_free_paged_mem(chunk);
28− if (chunk->bitmapbuf)
29− kfree(chunk->bitmapmem.va);
28+ bitmap_free(chunk->bitmapbuf);
3029 kfree(chunk->chunkmem.va);
3130 }
3231 }
@@ -283,7 +282,6 @@ add_pble_prm(struct irdma_hmc_pble_rsrc *pble_rsrc) · 250 unmodified lines
283282 "PBLE: next_fpm_addr = %llx chunk_size[%llu] = 0x%llx\n",
284283 pble_rsrc->next_fpm_addr, chunk->size, chunk->size);
285284 pble_rsrc->unallocated_pble -= (u32)(chunk->size >> 3);
286− list_add(&chunk->list, &pble_rsrc->pinfo.clist);
287285 sd_reg_val = (sd_entry_type == IRDMA_SD_TYPE_PAGED) ?
288286 sd_entry->u.pd_table.pd_page_addr.pa :
289287 sd_entry->u.bp.addr.pa;
@@ -295,12 +293,12 @@ add_pble_prm(struct irdma_hmc_pble_rsrc *pble_rsrc) · 5 unmodified lines
295293 goto error;
296294 }
297295
296+ list_add(&chunk->list, &pble_rsrc->pinfo.clist);
298297 sd_entry->valid = true;
299298 return 0;
300299
301300 error:
302− if (chunk->bitmapbuf)
303− kfree(chunk->bitmapmem.va);
301+ bitmap_free(chunk->bitmapbuf);
304302 kfree(chunk->chunkmem.va);
305303
306304 return ret_code;
drivers/infiniband/hw/irdma/pble.h+0−1
@@ -78,7 +78,6 @@ struct irdma_chunk { · 77 unmodified lines
7878 u32 pg_cnt;
7979 enum irdma_alloc_type type;
8080 struct irdma_sc_dev *dev;
81− struct irdma_virt_mem bitmapmem;
8281 struct irdma_virt_mem chunkmem;
8382 };
8483
drivers/infiniband/hw/irdma/utils.c+17−7
@@ -2239,15 +2239,10 @@ enum irdma_status_code irdma_prm_add_pble_mem(struct irdma_pble_prm *pprm, · 2238 unmodified lines
22392239
22402240 sizeofbitmap = (u64)pchunk->size >> pprm->pble_shift;
22412241
2242− pchunk->bitmapmem.size = sizeofbitmap >> 3;
2243− pchunk->bitmapmem.va = kzalloc(pchunk->bitmapmem.size, GFP_KERNEL);
2244−
2245− if (!pchunk->bitmapmem.va)
2242+ pchunk->bitmapbuf = bitmap_zalloc(sizeofbitmap, GFP_KERNEL);
2243+ if (!pchunk->bitmapbuf)
22462244 return IRDMA_ERR_NO_MEMORY;
22472245
2248− pchunk->bitmapbuf = pchunk->bitmapmem.va;
2249− bitmap_zero(pchunk->bitmapbuf, sizeofbitmap);
2250−
22512246 pchunk->sizeofbitmap = sizeofbitmap;
22522247 /* each pble is 8 bytes hence shift by 3 */
22532248 pprm->total_pble_alloc += pchunk->size >> 3;
@@ -2491,3 +2486,18 @@ void irdma_ib_qp_event(struct irdma_qp *iwqp, enum irdma_qp_event_type event) · 237 unmodified lines
24912486 ibevent.element.qp = &iwqp->ibqp;
24922487 iwqp->ibqp.event_handler(&ibevent, iwqp->ibqp.qp_context);
24932488 }
2489+
2490+bool irdma_cq_empty(struct irdma_cq *iwcq)
2491+{
2492+ struct irdma_cq_uk *ukcq;
2493+ u64 qword3;
2494+ __le64 *cqe;
2495+ u8 polarity;
2496+
2497+ ukcq = &iwcq->sc_cq.cq_uk;
2498+ cqe = IRDMA_GET_CURRENT_CQ_ELEM(ukcq);
2499+ get_64bit_val(cqe, 24, &qword3);
2500+ polarity = (u8)FIELD_GET(IRDMA_CQ_VALID, qword3);
2501+
2502+ return polarity != ukcq->polarity;
2503+}
drivers/infiniband/hw/irdma/verbs.c+18−5
@@ -3585,18 +3585,31 @@ static int irdma_req_notify_cq(struct ib_cq *ibcq, · 3584 unmodified lines
35853585 struct irdma_cq *iwcq;
35863586 struct irdma_cq_uk *ukcq;
35873587 unsigned long flags;
3588− enum irdma_cmpl_notify cq_notify = IRDMA_CQ_COMPL_EVENT;
3588+ enum irdma_cmpl_notify cq_notify;
3589+ bool promo_event = false;
3590+ int ret = 0;
35893591
3592+ cq_notify = notify_flags == IB_CQ_SOLICITED ?
3593+ IRDMA_CQ_COMPL_SOLICITED : IRDMA_CQ_COMPL_EVENT;
35903594 iwcq = to_iwcq(ibcq);
35913595 ukcq = &iwcq->sc_cq.cq_uk;
3592− if (notify_flags == IB_CQ_SOLICITED)
3593− cq_notify = IRDMA_CQ_COMPL_SOLICITED;
35943596
35953597 spin_lock_irqsave(&iwcq->lock, flags);
3596− irdma_uk_cq_request_notification(ukcq, cq_notify);
3598+ /* Only promote to arm the CQ for any event if the last arm event was solicited. */
3599+ if (iwcq->last_notify == IRDMA_CQ_COMPL_SOLICITED && notify_flags != IB_CQ_SOLICITED)
3600+ promo_event = true;
3601+
3602+ if (!iwcq->armed || promo_event) {
3603+ iwcq->armed = true;
3604+ iwcq->last_notify = cq_notify;
3605+ irdma_uk_cq_request_notification(ukcq, cq_notify);
3606+ }
3607+
3608+ if ((notify_flags & IB_CQ_REPORT_MISSED_EVENTS) && !irdma_cq_empty(iwcq))
3609+ ret = 1;
35973610 spin_unlock_irqrestore(&iwcq->lock, flags);
35983611
3599− return 0;
3612+ return ret;
36003613 }
36013614
36023615 static int irdma_roce_port_immutable(struct ib_device *ibdev, u32 port_num,
drivers/infiniband/hw/irdma/verbs.h+2−0
@@ -110,6 +110,8 @@ struct irdma_cq { · 109 unmodified lines
110110 u16 cq_size;
111111 u16 cq_num;
112112 bool user_mode;
113+ bool armed;
114+ enum irdma_cmpl_notify last_notify;
113115 u32 polled_cmpls;
114116 u32 cq_mem_size;
115117 struct irdma_dma_mem kmem;
drivers/infiniband/hw/mlx4/main.c+15−3
@@ -2215,6 +2215,11 @@ static const struct ib_device_ops mlx4_ib_hw_stats_ops = { · 2214 unmodified lines
22152215 .get_hw_stats = mlx4_ib_get_hw_stats,
22162216 };
22172217
2218+static const struct ib_device_ops mlx4_ib_hw_stats_ops1 = {
2219+ .alloc_hw_device_stats = mlx4_ib_alloc_hw_device_stats,
2220+ .get_hw_stats = mlx4_ib_get_hw_stats,
2221+};
2222+
22182223 static int mlx4_ib_alloc_diag_counters(struct mlx4_ib_dev *ibdev)
22192224 {
22202225 struct mlx4_ib_diag_counters *diag = ibdev->diag_counters;
@@ -2227,9 +2232,16 @@ static int mlx4_ib_alloc_diag_counters(struct mlx4_ib_dev *ibdev) · 6 unmodified lines
22272232 return 0;
22282233
22292234 for (i = 0; i < MLX4_DIAG_COUNTERS_TYPES; i++) {
2230− /* i == 1 means we are building port counters */
2231− if (i && !per_port)
2232− continue;
2235+ /*
2236+ * i == 1 means we are building port counters, set a different
2237+ * stats ops without port stats callback.
2238+ */
2239+ if (i && !per_port) {
2240+ ib_set_device_ops(&ibdev->ib_dev,
2241+ &mlx4_ib_hw_stats_ops1);
2242+
2243+ return 0;
2244+ }
22332245
22342246 ret = __mlx4_ib_alloc_diag_counters(ibdev, &diag[i].descs,
22352247 &diag[i].offset,
drivers/infiniband/hw/mlx5/mlx5_ib.h+3−3
@@ -664,7 +664,6 @@ struct mlx5_ib_mr { · 663 unmodified lines
664664
665665 /* User MR data */
666666 struct mlx5_cache_ent *cache_ent;
667− struct ib_umem *umem;
668667
669668 /* This is zero'd when the MR is allocated */
670669 union {
@@ -676,7 +675,7 @@ struct mlx5_ib_mr { · 5 unmodified lines
676675 struct list_head list;
677676 };
678677
679− /* Used only by kernel MRs (umem == NULL) */
678+ /* Used only by kernel MRs */
680679 struct {
681680 void *descs;
682681 void *descs_alloc;
@@ -697,8 +696,9 @@ struct mlx5_ib_mr { · 14 unmodified lines
697696 int data_length;
698697 };
699698
700− /* Used only by User MRs (umem != NULL) */
699+ /* Used only by User MRs */
701700 struct {
701+ struct ib_umem *umem;
702702 unsigned int page_shift;
703703 /* Current access_flags */
704704 int access_flags;
drivers/infiniband/hw/mlx5/mr.c+12−14
@@ -1904,19 +1904,18 @@ err: · 1903 unmodified lines
19041904 return ret;
19051905 }
19061906
1907−static void
1908−mlx5_free_priv_descs(struct mlx5_ib_mr *mr)
1907+static void mlx5_free_priv_descs(struct mlx5_ib_mr *mr)
19091908 {
1910− if (!mr->umem && mr->descs) {
1911− struct ib_device *device = mr->ibmr.device;
1912− int size = mr->max_descs * mr->desc_size;
1913− struct mlx5_ib_dev *dev = to_mdev(device);
1909+ struct mlx5_ib_dev *dev = to_mdev(mr->ibmr.device);
1910+ int size = mr->max_descs * mr->desc_size;
19141911
1915− dma_unmap_single(&dev->mdev->pdev->dev, mr->desc_map, size,
1916− DMA_TO_DEVICE);
1917− kfree(mr->descs_alloc);
1918− mr->descs = NULL;
1919− }
1912+ if (!mr->descs)
1913+ return;
1914+
1915+ dma_unmap_single(&dev->mdev->pdev->dev, mr->desc_map, size,
1916+ DMA_TO_DEVICE);
1917+ kfree(mr->descs_alloc);
1918+ mr->descs = NULL;
19201919 }
19211920
19221921 int mlx5_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
@@ -1992,7 +1991,8 @@ int mlx5_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata) · 69 unmodified lines
19921991 if (mr->cache_ent) {
19931992 mlx5_mr_cache_free(dev, mr);
19941993 } else {
1995− mlx5_free_priv_descs(mr);
1994+ if (!udata)
1995+ mlx5_free_priv_descs(mr);
19961996 kfree(mr);
19971997 }
19981998 return 0;
@@ -2079,7 +2079,6 @@ static struct mlx5_ib_mr *mlx5_ib_alloc_pi_mr(struct ib_pd *pd, · 80 unmodified lines
20792079 if (err)
20802080 goto err_free_in;
20812081
2082− mr->umem = NULL;
20832082 kfree(in);
20842083
20852084 return mr;
@@ -2206,7 +2205,6 @@ static struct ib_mr *__mlx5_ib_alloc_mr(struct ib_pd *pd, · 120 unmodified lines
22062205 }
22072206
22082207 mr->ibmr.device = pd->device;
2209− mr->umem = NULL;
22102208
22112209 switch (mr_type) {
22122210 case IB_MR_TYPE_MEM_REG:
drivers/infiniband/sw/rxe/rxe_qp.c+1−0
@@ -359,6 +359,7 @@ int rxe_qp_from_init(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_pd *pd, · 358 unmodified lines
359359
360360 err2:
361361 rxe_queue_cleanup(qp->sq.queue);
362+ qp->sq.queue = NULL;
362363 err1:
363364 qp->pd = NULL;
364365 qp->rcq = NULL;
drivers/infiniband/ulp/rtrs/rtrs-clt-stats.c+6−3
@@ -19,7 +19,7 @@ void rtrs_clt_update_wc_stats(struct rtrs_clt_con *con) · 18 unmodified lines
1919 int cpu;
2020
2121 cpu = raw_smp_processor_id();
22− s = this_cpu_ptr(stats->pcpu_stats);
22+ s = get_cpu_ptr(stats->pcpu_stats);
2323 if (con->cpu != cpu) {
2424 s->cpu_migr.to++;
2525
@@ -27,14 +27,16 @@ void rtrs_clt_update_wc_stats(struct rtrs_clt_con *con) · 1 unmodified line
2727 s = per_cpu_ptr(stats->pcpu_stats, con->cpu);
2828 atomic_inc(&s->cpu_migr.from);
2929 }
30+ put_cpu_ptr(stats->pcpu_stats);
3031 }
3132
3233 void rtrs_clt_inc_failover_cnt(struct rtrs_clt_stats *stats)
3334 {
3435 struct rtrs_clt_stats_pcpu *s;
3536
36− s = this_cpu_ptr(stats->pcpu_stats);
37+ s = get_cpu_ptr(stats->pcpu_stats);
3738 s->rdma.failover_cnt++;
39+ put_cpu_ptr(stats->pcpu_stats);
3840 }
3941
4042 int rtrs_clt_stats_migration_from_cnt_to_str(struct rtrs_clt_stats *stats, char *buf)
@@ -169,9 +171,10 @@ static inline void rtrs_clt_update_rdma_stats(struct rtrs_clt_stats *stats, · 128 unmodified lines
169171 {
170172 struct rtrs_clt_stats_pcpu *s;
171173
172− s = this_cpu_ptr(stats->pcpu_stats);
174+ s = get_cpu_ptr(stats->pcpu_stats);
173175 s->rdma.dir[d].cnt++;
174176 s->rdma.dir[d].size_total += size;
177+ put_cpu_ptr(stats->pcpu_stats);
175178 }
176179
177180 void rtrs_clt_update_all_stats(struct rtrs_clt_io_req *req, int dir)
drivers/input/misc/xen-kbdfront.c+1−0
@@ -542,6 +542,7 @@ static struct xenbus_driver xenkbd_driver = { · 541 unmodified lines
542542 .remove = xenkbd_remove,
543543 .resume = xenkbd_resume,
544544 .otherend_changed = xenkbd_backend_changed,
545+ .not_essential = true,
545546 };
546547
547548 static int __init xenkbd_init(void)
drivers/iommu/amd/iommu_v2.c+3−3
@@ -929,10 +929,8 @@ static int __init amd_iommu_v2_init(void) · 928 unmodified lines
929929 {
930930 int ret;
931931
932− pr_info("AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>\n");
933−
934932 if (!amd_iommu_v2_supported()) {
935− pr_info("AMD IOMMUv2 functionality not available on this system\n");
933+ pr_info("AMD IOMMUv2 functionality not available on this system - This is not a bug.\n");
936934 /*
937935 * Load anyway to provide the symbols to other modules
938936 * which may use AMD IOMMUv2 optionally.
@@ -947,6 +945,8 @@ static int __init amd_iommu_v2_init(void) · 8 unmodified lines
947945
948946 amd_iommu_register_ppr_notifier(&ppr_nb);
949947
948+ pr_info("AMD IOMMUv2 loaded and initialized\n");
949+
950950 return 0;
951951
952952 out:
drivers/iommu/intel/cap_audit.c+3−2
@@ -144,6 +144,7 @@ static int cap_audit_static(struct intel_iommu *iommu, enum cap_audit_type type) · 143 unmodified lines
144144 {
145145 struct dmar_drhd_unit *d;
146146 struct intel_iommu *i;
147+ int rc = 0;
147148
148149 rcu_read_lock();
149150 if (list_empty(&dmar_drhd_units))
@@ -169,11 +170,11 @@ static int cap_audit_static(struct intel_iommu *iommu, enum cap_audit_type type) · 19 unmodified lines
169170 */
170171 if (intel_cap_smts_sanity() &&
171172 !intel_cap_flts_sanity() && !intel_cap_slts_sanity())
172− return -EOPNOTSUPP;
173+ rc = -EOPNOTSUPP;
173174
174175 out:
175176 rcu_read_unlock();
176− return 0;
177+ return rc;
177178 }
178179
179180 int intel_cap_audit(enum cap_audit_type type, struct intel_iommu *iommu)
drivers/iommu/intel/iommu.c+2−4
@@ -1339,13 +1339,11 @@ static struct page *dma_pte_clear_level(struct dmar_domain *domain, int level, · 1338 unmodified lines
13391339 pte = &pte[pfn_level_offset(pfn, level)];
13401340
13411341 do {
1342− unsigned long level_pfn;
1342+ unsigned long level_pfn = pfn & level_mask(level);
13431343
13441344 if (!dma_pte_present(pte))
13451345 goto next;
13461346
1347− level_pfn = pfn & level_mask(level);
1348−
13491347 /* If range covers entire pagetable, free it */
13501348 if (start_pfn <= level_pfn &&
13511349 last_pfn >= level_pfn + level_size(level) - 1) {
@@ -1366,7 +1364,7 @@ static struct page *dma_pte_clear_level(struct dmar_domain *domain, int level, · 14 unmodified lines
13661364 freelist);
13671365 }
13681366 next:
1369− pfn += level_size(level);
1367+ pfn = level_pfn + level_size(level);
13701368 } while (!first_pte_in_page(++pte) && pfn <= last_pfn);
13711369
13721370 if (first_pte)
drivers/iommu/rockchip-iommu.c+2−2
@@ -200,8 +200,8 @@ static inline phys_addr_t rk_dte_pt_address(u32 dte) · 199 unmodified lines
200200 #define DTE_HI_MASK2 GENMASK(7, 4)
201201 #define DTE_HI_SHIFT1 24 /* shift bit 8 to bit 32 */
202202 #define DTE_HI_SHIFT2 32 /* shift bit 4 to bit 36 */
203−#define PAGE_DESC_HI_MASK1 GENMASK_ULL(39, 36)
204−#define PAGE_DESC_HI_MASK2 GENMASK_ULL(35, 32)
203+#define PAGE_DESC_HI_MASK1 GENMASK_ULL(35, 32)
204+#define PAGE_DESC_HI_MASK2 GENMASK_ULL(39, 36)
205205
206206 static inline phys_addr_t rk_dte_pt_address_v2(u32 dte)
207207 {
drivers/irqchip/irq-apple-aic.c+1−1
@@ -707,7 +707,7 @@ static const struct irq_domain_ops aic_ipi_domain_ops = { · 706 unmodified lines
707707 .free = aic_ipi_free,
708708 };
709709
710−static int aic_init_smp(struct aic_irq_chip *irqc, struct device_node *node)
710+static int __init aic_init_smp(struct aic_irq_chip *irqc, struct device_node *node)
711711 {
712712 struct irq_domain *ipi_domain;
713713 int base_ipi;
drivers/irqchip/irq-armada-370-xp.c+6−10
@@ -232,16 +232,12 @@ static int armada_370_xp_msi_alloc(struct irq_domain *domain, unsigned int virq, · 231 unmodified lines
232232 int hwirq, i;
233233
234234 mutex_lock(&msi_used_lock);
235+ hwirq = bitmap_find_free_region(msi_used, PCI_MSI_DOORBELL_NR,
236+ order_base_2(nr_irqs));
237+ mutex_unlock(&msi_used_lock);
235238
236− hwirq = bitmap_find_next_zero_area(msi_used, PCI_MSI_DOORBELL_NR,
237− 0, nr_irqs, 0);
238− if (hwirq >= PCI_MSI_DOORBELL_NR) {
239− mutex_unlock(&msi_used_lock);
239+ if (hwirq < 0)
240240 return -ENOSPC;
241− }
242−
243− bitmap_set(msi_used, hwirq, nr_irqs);
244− mutex_unlock(&msi_used_lock);
245241
246242 for (i = 0; i < nr_irqs; i++) {
247243 irq_domain_set_info(domain, virq + i, hwirq + i,
@@ -250,7 +246,7 @@ static int armada_370_xp_msi_alloc(struct irq_domain *domain, unsigned int virq, · 2 unmodified lines
250246 NULL, NULL);
251247 }
252248
253− return hwirq;
249+ return 0;
254250 }
255251
256252 static void armada_370_xp_msi_free(struct irq_domain *domain,
@@ -259,7 +255,7 @@ static void armada_370_xp_msi_free(struct irq_domain *domain, · 2 unmodified lines
259255 struct irq_data *d = irq_domain_get_irq_data(domain, virq);
260256
261257 mutex_lock(&msi_used_lock);
262− bitmap_clear(msi_used, d->hwirq, nr_irqs);
258+ bitmap_release_region(msi_used, d->hwirq, order_base_2(nr_irqs));
263259 mutex_unlock(&msi_used_lock);
264260 }
265261
drivers/irqchip/irq-aspeed-scu-ic.c+2−2
@@ -76,8 +76,8 @@ static void aspeed_scu_ic_irq_handler(struct irq_desc *desc) · 75 unmodified lines
7676 generic_handle_domain_irq(scu_ic->irq_domain,
7777 bit - scu_ic->irq_shift);
7878
79− regmap_update_bits(scu_ic->scu, scu_ic->reg, mask,
80− BIT(bit + ASPEED_SCU_IC_STATUS_SHIFT));
79+ regmap_write_bits(scu_ic->scu, scu_ic->reg, mask,
80+ BIT(bit + ASPEED_SCU_IC_STATUS_SHIFT));
8181 }
8282
8383 chained_irq_exit(chip, desc);
drivers/irqchip/irq-bcm7120-l2.c+1−0
@@ -238,6 +238,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn, · 237 unmodified lines
238238 }
239239
240240 data->num_parent_irqs = platform_irq_count(pdev);
241+ put_device(&pdev->dev);
241242 if (data->num_parent_irqs <= 0) {
242243 pr_err("invalid number of parent interrupts\n");
243244 ret = -ENOMEM;
drivers/irqchip/irq-gic-v3-its.c+1−1
@@ -742,7 +742,7 @@ static struct its_collection *its_build_invall_cmd(struct its_node *its, · 741 unmodified lines
742742
743743 its_fixup_cmd(cmd);
744744
745− return NULL;
745+ return desc->its_invall_cmd.col;
746746 }
747747
748748 static struct its_vpe *its_build_vinvall_cmd(struct its_node *its,
drivers/irqchip/irq-mips-gic.c+2−2
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #define pr_fmt(fmt) "irq-mips-gic: " fmt
1111
12+#include <linux/bitfield.h>
1213 #include <linux/bitmap.h>
1314 #include <linux/clocksource.h>
1415 #include <linux/cpuhotplug.h>
@@ -735,8 +736,7 @@ static int __init gic_of_init(struct device_node *node, · 720 unmodified lines
735736 mips_gic_base = ioremap(gic_base, gic_len);
736737
737738 gicconfig = read_gic_config();
738− gic_shared_intrs = gicconfig & GIC_CONFIG_NUMINTERRUPTS;
739− gic_shared_intrs >>= __ffs(GIC_CONFIG_NUMINTERRUPTS);
739+ gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);
740740 gic_shared_intrs = (gic_shared_intrs + 1) * 8;
741741
742742 if (cpu_has_veic) {
drivers/irqchip/irq-nvic.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626
2727 #define NVIC_ISER 0x000
2828 #define NVIC_ICER 0x080
29−#define NVIC_IPR 0x300
29+#define NVIC_IPR 0x400
3030
3131 #define NVIC_MAX_BANKS 16
3232 /*
drivers/md/md.c+3−1
@@ -2189,6 +2189,7 @@ super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors) · 2188 unmodified lines
21892189
21902190 if (!num_sectors || num_sectors > max_sectors)
21912191 num_sectors = max_sectors;
2192+ rdev->sb_start = sb_start;
21922193 }
21932194 sb = page_address(rdev->sb_page);
21942195 sb->data_size = cpu_to_le64(num_sectors);
@@ -6270,7 +6271,8 @@ static void __md_stop(struct mddev *mddev) · 4075 unmodified lines
62706271 spin_lock(&mddev->lock);
62716272 mddev->pers = NULL;
62726273 spin_unlock(&mddev->lock);
6273− pers->free(mddev, mddev->private);
6274+ if (mddev->private)
6275+ pers->free(mddev, mddev->private);
62746276 mddev->private = NULL;
62756277 if (pers->sync_request && mddev->to_remove == NULL)
62766278 mddev->to_remove = &md_redundancy_group;
drivers/media/cec/core/cec-adap.c+1−0
@@ -1199,6 +1199,7 @@ void cec_received_msg_ts(struct cec_adapter *adap, · 1198 unmodified lines
11991199 if (abort)
12001200 dst->rx_status |= CEC_RX_STATUS_FEATURE_ABORT;
12011201 msg->flags = dst->flags;
1202+ msg->sequence = dst->sequence;
12021203 /* Remove it from the wait_queue */
12031204 list_del_init(&data->list);
12041205
drivers/media/common/videobuf2/videobuf2-dma-sg.c+2−0
@@ -241,6 +241,7 @@ static void *vb2_dma_sg_get_userptr(struct vb2_buffer *vb, struct device *dev, · 240 unmodified lines
241241 buf->offset = vaddr & ~PAGE_MASK;
242242 buf->size = size;
243243 buf->dma_sgt = &buf->sg_table;
244+ buf->vb = vb;
244245 vec = vb2_create_framevec(vaddr, size);
245246 if (IS_ERR(vec))
246247 goto userptr_fail_pfnvec;
@@ -642,6 +643,7 @@ static void *vb2_dma_sg_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, · 395 unmodified lines
642643 buf->dma_dir = vb->vb2_queue->dma_dir;
643644 buf->size = size;
644645 buf->db_attach = dba;
646+ buf->vb = vb;
645647
646648 return buf;
647649 }
drivers/media/i2c/hi846.c+2−2
@@ -7,9 +7,9 @@ · 6 unmodified lines
77 #include <linux/gpio/consumer.h>
88 #include <linux/i2c.h>
99 #include <linux/module.h>
10−#include <linux/of_graph.h>
1110 #include <linux/pm_runtime.h>
1211 #include <linux/pm.h>
12+#include <linux/property.h>
1313 #include <linux/regulator/consumer.h>
1414 #include <media/v4l2-ctrls.h>
1515 #include <media/v4l2-device.h>
@@ -2176,7 +2176,7 @@ static struct i2c_driver hi846_i2c_driver = { · 2160 unmodified lines
21762176 .driver = {
21772177 .name = "hi846",
21782178 .pm = &hi846_pm_ops,
2179− .of_match_table = of_match_ptr(hi846_of_match),
2179+ .of_match_table = hi846_of_match,
21802180 },
21812181 .probe_new = hi846_probe,
21822182 .remove = hi846_remove,
drivers/media/v4l2-core/v4l2-compat-ioctl32.c+17−24
@@ -751,10 +751,6 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *p64, · 750 unmodified lines
751751 /*
752752 * x86 is the only compat architecture with different struct alignment
753753 * between 32-bit and 64-bit tasks.
754− *
755− * On all other architectures, v4l2_event32 and v4l2_event32_time32 are
756− * the same as v4l2_event and v4l2_event_time32, so we can use the native
757− * handlers, converting v4l2_event to v4l2_event_time32 if necessary.
758754 */
759755 struct v4l2_event32 {
760756 __u32 type;
@@ -772,21 +768,6 @@ struct v4l2_event32 { · 11 unmodified lines
772768 __u32 reserved[8];
773769 };
774770
775−#ifdef CONFIG_COMPAT_32BIT_TIME
776−struct v4l2_event32_time32 {
777− __u32 type;
778− union {
779− compat_s64 value64;
780− __u8 data[64];
781− } u;
782− __u32 pending;
783− __u32 sequence;
784− struct old_timespec32 timestamp;
785− __u32 id;
786− __u32 reserved[8];
787−};
788−#endif
789−
790771 static int put_v4l2_event32(struct v4l2_event *p64,
791772 struct v4l2_event32 __user *p32)
792773 {
@@ -802,7 +783,22 @@ static int put_v4l2_event32(struct v4l2_event *p64, · 9 unmodified lines
802783 return 0;
803784 }
804785
786+#endif
787+
805788 #ifdef CONFIG_COMPAT_32BIT_TIME
789+struct v4l2_event32_time32 {
790+ __u32 type;
791+ union {
792+ compat_s64 value64;
793+ __u8 data[64];
794+ } u;
795+ __u32 pending;
796+ __u32 sequence;
797+ struct old_timespec32 timestamp;
798+ __u32 id;
799+ __u32 reserved[8];
800+};
801+
806802 static int put_v4l2_event32_time32(struct v4l2_event *p64,
807803 struct v4l2_event32_time32 __user *p32)
808804 {
@@ -818,7 +814,6 @@ static int put_v4l2_event32_time32(struct v4l2_event *p64, · 9 unmodified lines
818814 return 0;
819815 }
820816 #endif
821−#endif
822817
823818 struct v4l2_edid32 {
824819 __u32 pad;
@@ -880,9 +875,7 @@ static int put_v4l2_edid32(struct v4l2_edid *p64, · 55 unmodified lines
880875 #define VIDIOC_QUERYBUF32_TIME32 _IOWR('V', 9, struct v4l2_buffer32_time32)
881876 #define VIDIOC_QBUF32_TIME32 _IOWR('V', 15, struct v4l2_buffer32_time32)
882877 #define VIDIOC_DQBUF32_TIME32 _IOWR('V', 17, struct v4l2_buffer32_time32)
883−#ifdef CONFIG_X86_64
884878 #define VIDIOC_DQEVENT32_TIME32 _IOR ('V', 89, struct v4l2_event32_time32)
885−#endif
886879 #define VIDIOC_PREPARE_BUF32_TIME32 _IOWR('V', 93, struct v4l2_buffer32_time32)
887880 #endif
888881
@@ -936,10 +929,10 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd) · 47 unmodified lines
936929 #ifdef CONFIG_X86_64
937930 case VIDIOC_DQEVENT32:
938931 return VIDIOC_DQEVENT;
932+#endif
939933 #ifdef CONFIG_COMPAT_32BIT_TIME
940934 case VIDIOC_DQEVENT32_TIME32:
941935 return VIDIOC_DQEVENT;
942−#endif
943936 #endif
944937 }
945938 return cmd;
@@ -1032,10 +1025,10 @@ int v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd) · 86 unmodified lines
10321025 #ifdef CONFIG_X86_64
10331026 case VIDIOC_DQEVENT32:
10341027 return put_v4l2_event32(parg, arg);
1028+#endif
10351029 #ifdef CONFIG_COMPAT_32BIT_TIME
10361030 case VIDIOC_DQEVENT32_TIME32:
10371031 return put_v4l2_event32_time32(parg, arg);
1038−#endif
10391032 #endif
10401033 }
10411034 return 0;
drivers/memory/mtk-smi.c+1−1
@@ -241,7 +241,7 @@ static void mtk_smi_larb_config_port_gen2_general(struct device *dev) · 240 unmodified lines
241241 {
242242 struct mtk_smi_larb *larb = dev_get_drvdata(dev);
243243 u32 reg, flags_general = larb->larb_gen->flags_general;
244− const u8 *larbostd = larb->larb_gen->ostd[larb->larbid];
244+ const u8 *larbostd = larb->larb_gen->ostd ? larb->larb_gen->ostd[larb->larbid] : NULL;
245245 int i;
246246
247247 if (BIT(larb->larbid) & larb->larb_gen->larb_direct_to_common_mask)
drivers/misc/cardreader/rtsx_pcr.c+0−4
@@ -1803,8 +1803,6 @@ static int rtsx_pci_runtime_suspend(struct device *device) · 1802 unmodified lines
18031803 mutex_lock(&pcr->pcr_mutex);
18041804 rtsx_pci_power_off(pcr, HOST_ENTER_S3);
18051805
1806− free_irq(pcr->irq, (void *)pcr);
1807−
18081806 mutex_unlock(&pcr->pcr_mutex);
18091807
18101808 pcr->is_runtime_suspended = true;
@@ -1825,8 +1823,6 @@ static int rtsx_pci_runtime_resume(struct device *device) · 14 unmodified lines
18251823 mutex_lock(&pcr->pcr_mutex);
18261824
18271825 rtsx_pci_write_register(pcr, HOST_SLEEP_STATE, 0x03, 0x00);
1828− rtsx_pci_acquire_irq(pcr);
1829− synchronize_irq(pcr->irq);
18301826
18311827 if (pcr->ops->fetch_vendor_settings)
18321828 pcr->ops->fetch_vendor_settings(pcr);
drivers/misc/eeprom/at25.c+18−20
@@ -376,7 +376,6 @@ MODULE_DEVICE_TABLE(spi, at25_spi_ids); · 375 unmodified lines
376376 static int at25_probe(struct spi_device *spi)
377377 {
378378 struct at25_data *at25 = NULL;
379− struct spi_eeprom chip;
380379 int err;
381380 int sr;
382381 u8 id[FM25_ID_LEN];
@@ -389,15 +388,18 @@ static int at25_probe(struct spi_device *spi) · 6 unmodified lines
389388 if (match && !strcmp(match->compatible, "cypress,fm25"))
390389 is_fram = 1;
391390
391+ at25 = devm_kzalloc(&spi->dev, sizeof(struct at25_data), GFP_KERNEL);
392+ if (!at25)
393+ return -ENOMEM;
394+
392395 /* Chip description */
393− if (!spi->dev.platform_data) {
394− if (!is_fram) {
395− err = at25_fw_to_chip(&spi->dev, &chip);
396− if (err)
397− return err;
398− }
399− } else
400− chip = *(struct spi_eeprom *)spi->dev.platform_data;
396+ if (spi->dev.platform_data) {
397+ memcpy(&at25->chip, spi->dev.platform_data, sizeof(at25->chip));
398+ } else if (!is_fram) {
399+ err = at25_fw_to_chip(&spi->dev, &at25->chip);
400+ if (err)
401+ return err;
402+ }
401403
402404 /* Ping the chip ... the status register is pretty portable,
403405 * unlike probing manufacturer IDs. We do expect that system
@@ -409,12 +411,7 @@ static int at25_probe(struct spi_device *spi) · 5 unmodified lines
409411 return -ENXIO;
410412 }
411413
412− at25 = devm_kzalloc(&spi->dev, sizeof(struct at25_data), GFP_KERNEL);
413− if (!at25)
414− return -ENOMEM;
415−
416414 mutex_init(&at25->lock);
417− at25->chip = chip;
418415 at25->spi = spi;
419416 spi_set_drvdata(spi, at25);
420417
@@ -431,7 +428,7 @@ static int at25_probe(struct spi_device *spi) · 10 unmodified lines
431428 dev_err(&spi->dev, "Error: unsupported size (id %02x)\n", id[7]);
432429 return -ENODEV;
433430 }
434− chip.byte_len = int_pow(2, id[7] - 0x21 + 4) * 1024;
431+ at25->chip.byte_len = int_pow(2, id[7] - 0x21 + 4) * 1024;
435432
436433 if (at25->chip.byte_len > 64 * 1024)
437434 at25->chip.flags |= EE_ADDR3;
@@ -464,7 +461,7 @@ static int at25_probe(struct spi_device *spi) · 26 unmodified lines
464461 at25->nvmem_config.type = is_fram ? NVMEM_TYPE_FRAM : NVMEM_TYPE_EEPROM;
465462 at25->nvmem_config.name = dev_name(&spi->dev);
466463 at25->nvmem_config.dev = &spi->dev;
467− at25->nvmem_config.read_only = chip.flags & EE_READONLY;
464+ at25->nvmem_config.read_only = at25->chip.flags & EE_READONLY;
468465 at25->nvmem_config.root_only = true;
469466 at25->nvmem_config.owner = THIS_MODULE;
470467 at25->nvmem_config.compat = true;
@@ -474,17 +471,18 @@ static int at25_probe(struct spi_device *spi) · 3 unmodified lines
474471 at25->nvmem_config.priv = at25;
475472 at25->nvmem_config.stride = 1;
476473 at25->nvmem_config.word_size = 1;
477− at25->nvmem_config.size = chip.byte_len;
474+ at25->nvmem_config.size = at25->chip.byte_len;
478475
479476 at25->nvmem = devm_nvmem_register(&spi->dev, &at25->nvmem_config);
480477 if (IS_ERR(at25->nvmem))
481478 return PTR_ERR(at25->nvmem);
482479
483480 dev_info(&spi->dev, "%d %s %s %s%s, pagesize %u\n",
484− (chip.byte_len < 1024) ? chip.byte_len : (chip.byte_len / 1024),
485− (chip.byte_len < 1024) ? "Byte" : "KByte",
481+ (at25->chip.byte_len < 1024) ?
482+ at25->chip.byte_len : (at25->chip.byte_len / 1024),
483+ (at25->chip.byte_len < 1024) ? "Byte" : "KByte",
486484 at25->chip.name, is_fram ? "fram" : "eeprom",
487− (chip.flags & EE_READONLY) ? " (readonly)" : "",
485+ (at25->chip.flags & EE_READONLY) ? " (readonly)" : "",
488486 at25->chip.page_size);
489487 return 0;
490488 }
drivers/misc/fastrpc.c+6−4
@@ -719,16 +719,18 @@ static int fastrpc_get_meta_size(struct fastrpc_invoke_ctx *ctx) · 718 unmodified lines
719719 static u64 fastrpc_get_payload_size(struct fastrpc_invoke_ctx *ctx, int metalen)
720720 {
721721 u64 size = 0;
722− int i;
722+ int oix;
723723
724724 size = ALIGN(metalen, FASTRPC_ALIGN);
725− for (i = 0; i < ctx->nscalars; i++) {
725+ for (oix = 0; oix < ctx->nbufs; oix++) {
726+ int i = ctx->olaps[oix].raix;
727+
726728 if (ctx->args[i].fd == 0 || ctx->args[i].fd == -1) {
727729
728− if (ctx->olaps[i].offset == 0)
730+ if (ctx->olaps[oix].offset == 0)
729731 size = ALIGN(size, FASTRPC_ALIGN);
730732
731− size += (ctx->olaps[i].mend - ctx->olaps[i].mstart);
733+ size += (ctx->olaps[oix].mend - ctx->olaps[oix].mstart);
732734 }
733735 }
734736
drivers/mmc/host/mmc_spi.c+7−0
@@ -1514,6 +1514,12 @@ static int mmc_spi_remove(struct spi_device *spi) · 1513 unmodified lines
15141514 return 0;
15151515 }
15161516
1517+static const struct spi_device_id mmc_spi_dev_ids[] = {
1518+ { "mmc-spi-slot"},
1519+ { },
1520+};
1521+MODULE_DEVICE_TABLE(spi, mmc_spi_dev_ids);
1522+
15171523 static const struct of_device_id mmc_spi_of_match_table[] = {
15181524 { .compatible = "mmc-spi-slot", },
15191525 {},
@@ -1525,6 +1531,7 @@ static struct spi_driver mmc_spi_driver = { · 5 unmodified lines
15251531 .name = "mmc_spi",
15261532 .of_match_table = mmc_spi_of_match_table,
15271533 },
1534+ .id_table = mmc_spi_dev_ids,
15281535 .probe = mmc_spi_probe,
15291536 .remove = mmc_spi_remove,
15301537 };
drivers/mmc/host/mtk-sd.c+3−1
@@ -2291,8 +2291,10 @@ static int msdc_execute_hs400_tuning(struct mmc_host *mmc, struct mmc_card *card · 2290 unmodified lines
22912291 sdr_set_field(host->base + PAD_DS_TUNE,
22922292 PAD_DS_TUNE_DLY1, i);
22932293 ret = mmc_get_ext_csd(card, &ext_csd);
2294− if (!ret)
2294+ if (!ret) {
22952295 result_dly1 |= (1 << i);
2296+ kfree(ext_csd);
2297+ }
22962298 }
22972299 host->hs400_tuning = false;
22982300
drivers/mmc/host/renesas_sdhi_core.c+1−1
@@ -673,7 +673,7 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode) · 672 unmodified lines
673673
674674 /* Issue CMD19 twice for each tap */
675675 for (i = 0; i < 2 * priv->tap_num; i++) {
676− int cmd_error;
676+ int cmd_error = 0;
677677
678678 /* Set sampling clock position */
679679 sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
drivers/mmc/host/sdhci-esdhc-imx.c+0−2
@@ -310,7 +310,6 @@ static struct esdhc_soc_data usdhc_imx8qxp_data = { · 309 unmodified lines
310310 .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
311311 | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
312312 | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
313− | ESDHC_FLAG_CQHCI
314313 | ESDHC_FLAG_STATE_LOST_IN_LPMODE
315314 | ESDHC_FLAG_CLK_RATE_LOST_IN_PM_RUNTIME,
316315 };
@@ -319,7 +318,6 @@ static struct esdhc_soc_data usdhc_imx8mm_data = { · 2 unmodified lines
319318 .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
320319 | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
321320 | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
322− | ESDHC_FLAG_CQHCI
323321 | ESDHC_FLAG_STATE_LOST_IN_LPMODE,
324322 };
325323
drivers/mmc/host/sdhci.c+18−3
@@ -771,7 +771,19 @@ static void sdhci_adma_table_pre(struct sdhci_host *host, · 770 unmodified lines
771771 len -= offset;
772772 }
773773
774− BUG_ON(len > 65536);
774+ /*
775+ * The block layer forces a minimum segment size of PAGE_SIZE,
776+ * so 'len' can be too big here if PAGE_SIZE >= 64KiB. Write
777+ * multiple descriptors, noting that the ADMA table is sized
778+ * for 4KiB chunks anyway, so it will be big enough.
779+ */
780+ while (len > host->max_adma) {
781+ int n = 32 * 1024; /* 32KiB*/
782+
783+ __sdhci_adma_write_desc(host, &desc, addr, n, ADMA2_TRAN_VALID);
784+ addr += n;
785+ len -= n;
786+ }
775787
776788 /* tran, valid */
777789 if (len)
@@ -3968,6 +3980,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, · 3190 unmodified lines
39683980 * descriptor for each segment, plus 1 for a nop end descriptor.
39693981 */
39703982 host->adma_table_cnt = SDHCI_MAX_SEGS * 2 + 1;
3983+ host->max_adma = 65536;
39713984
39723985 host->max_timeout_count = 0xE;
39733986
@@ -4633,10 +4646,12 @@ int sdhci_setup_host(struct sdhci_host *host) · 659 unmodified lines
46334646 * be larger than 64 KiB though.
46344647 */
46354648 if (host->flags & SDHCI_USE_ADMA) {
4636− if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC)
4649+ if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) {
4650+ host->max_adma = 65532; /* 32-bit alignment */
46374651 mmc->max_seg_size = 65535;
4638− else
4652+ } else {
46394653 mmc->max_seg_size = 65536;
4654+ }
46404655 } else {
46414656 mmc->max_seg_size = mmc->max_req_size;
46424657 }
drivers/mmc/host/sdhci.h+3−1
@@ -340,7 +340,8 @@ struct sdhci_adma2_64_desc { · 339 unmodified lines
340340
341341 /*
342342 * Maximum segments assuming a 512KiB maximum requisition size and a minimum
343− * 4KiB page size.
343+ * 4KiB page size. Note this also allows enough for multiple descriptors in
344+ * case of PAGE_SIZE >= 64KiB.
344345 */
345346 #define SDHCI_MAX_SEGS 128
346347
@@ -543,6 +544,7 @@ struct sdhci_host { · 196 unmodified lines
543544 unsigned int blocks; /* remaining PIO blocks */
544545
545546 int sg_count; /* Mapped sg entries */
547+ int max_adma; /* Max. length in ADMA descriptor */
546548
547549 void *adma_table; /* ADMA descriptor table */
548550 void *align_buffer; /* Bounce buffer */
drivers/mtd/devices/mtd_dataflash.c+8−0
@@ -96,6 +96,13 @@ struct dataflash { · 95 unmodified lines
9696 struct mtd_info mtd;
9797 };
9898
99+static const struct spi_device_id dataflash_dev_ids[] = {
100+ { "at45" },
101+ { "dataflash" },
102+ { },
103+};
104+MODULE_DEVICE_TABLE(spi, dataflash_dev_ids);
105+
99106 #ifdef CONFIG_OF
100107 static const struct of_device_id dataflash_dt_ids[] = {
101108 { .compatible = "atmel,at45", },
@@ -927,6 +934,7 @@ static struct spi_driver dataflash_driver = { · 825 unmodified lines
927934 .name = "mtd_dataflash",
928935 .of_match_table = of_match_ptr(dataflash_dt_ids),
929936 },
937+ .id_table = dataflash_dev_ids,
930938
931939 .probe = dataflash_probe,
932940 .remove = dataflash_remove,
drivers/mtd/nand/raw/Kconfig+1−1
@@ -26,7 +26,7 @@ config MTD_NAND_DENALI_PCI · 25 unmodified lines
2626 config MTD_NAND_DENALI_DT
2727 tristate "Denali NAND controller as a DT device"
2828 select MTD_NAND_DENALI
29− depends on HAS_DMA && HAVE_CLK && OF
29+ depends on HAS_DMA && HAVE_CLK && OF && HAS_IOMEM
3030 help
3131 Enable the driver for NAND flash on platforms using a Denali NAND
3232 controller as a DT device.
drivers/mtd/nand/raw/fsmc_nand.c+28−8
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515
1616 #include <linux/clk.h>
1717 #include <linux/completion.h>
18+#include <linux/delay.h>
1819 #include <linux/dmaengine.h>
1920 #include <linux/dma-direction.h>
2021 #include <linux/dma-mapping.h>
@@ -93,6 +94,14 @@ · 72 unmodified lines
9394
9495 #define FSMC_BUSY_WAIT_TIMEOUT (1 * HZ)
9596
97+/*
98+ * According to SPEAr300 Reference Manual (RM0082)
99+ * TOUDEL = 7ns (Output delay from the flip-flops to the board)
100+ * TINDEL = 5ns (Input delay from the board to the flipflop)
101+ */
102+#define TOUTDEL 7000
103+#define TINDEL 5000
104+
96105 struct fsmc_nand_timings {
97106 u8 tclr;
98107 u8 tar;
@@ -277,7 +286,7 @@ static int fsmc_calc_timings(struct fsmc_nand_data *host, · 178 unmodified lines
277286 {
278287 unsigned long hclk = clk_get_rate(host->clk);
279288 unsigned long hclkn = NSEC_PER_SEC / hclk;
280− u32 thiz, thold, twait, tset;
289+ u32 thiz, thold, twait, tset, twait_min;
281290
282291 if (sdrt->tRC_min < 30000)
283292 return -EOPNOTSUPP;
@@ -309,13 +318,6 @@ static int fsmc_calc_timings(struct fsmc_nand_data *host, · 25 unmodified lines
309318 else if (tims->thold > FSMC_THOLD_MASK)
310319 tims->thold = FSMC_THOLD_MASK;
311320
312− twait = max(sdrt->tRP_min, sdrt->tWP_min);
313− tims->twait = DIV_ROUND_UP(twait / 1000, hclkn) - 1;
314− if (tims->twait == 0)
315− tims->twait = 1;
316− else if (tims->twait > FSMC_TWAIT_MASK)
317− tims->twait = FSMC_TWAIT_MASK;
318−
319321 tset = max(sdrt->tCS_min - sdrt->tWP_min,
320322 sdrt->tCEA_max - sdrt->tREA_max);
321323 tims->tset = DIV_ROUND_UP(tset / 1000, hclkn) - 1;
@@ -324,6 +326,21 @@ static int fsmc_calc_timings(struct fsmc_nand_data *host, · 2 unmodified lines
324326 else if (tims->tset > FSMC_TSET_MASK)
325327 tims->tset = FSMC_TSET_MASK;
326328
329+ /*
330+ * According to SPEAr300 Reference Manual (RM0082) which gives more
331+ * information related to FSMSC timings than the SPEAr600 one (RM0305),
332+ * twait >= tCEA - (tset * TCLK) + TOUTDEL + TINDEL
333+ */
334+ twait_min = sdrt->tCEA_max - ((tims->tset + 1) * hclkn * 1000)
335+ + TOUTDEL + TINDEL;
336+ twait = max3(sdrt->tRP_min, sdrt->tWP_min, twait_min);
337+
338+ tims->twait = DIV_ROUND_UP(twait / 1000, hclkn) - 1;
339+ if (tims->twait == 0)
340+ tims->twait = 1;
341+ else if (tims->twait > FSMC_TWAIT_MASK)
342+ tims->twait = FSMC_TWAIT_MASK;
343+
327344 return 0;
328345 }
329346
@@ -664,6 +681,9 @@ static int fsmc_exec_op(struct nand_chip *chip, const struct nand_operation *op, · 334 unmodified lines
664681 instr->ctx.waitrdy.timeout_ms);
665682 break;
666683 }
684+
685+ if (instr->delay_ns)
686+ ndelay(instr->delay_ns);
667687 }
668688
669689 return ret;
drivers/mtd/nand/raw/nand_base.c+3−3
@@ -926,7 +926,7 @@ int nand_choose_best_sdr_timings(struct nand_chip *chip, · 925 unmodified lines
926926 struct nand_sdr_timings *spec_timings)
927927 {
928928 const struct nand_controller_ops *ops = chip->controller->ops;
929− int best_mode = 0, mode, ret;
929+ int best_mode = 0, mode, ret = -EOPNOTSUPP;
930930
931931 iface->type = NAND_SDR_IFACE;
932932
@@ -977,7 +977,7 @@ int nand_choose_best_nvddr_timings(struct nand_chip *chip, · 44 unmodified lines
977977 struct nand_nvddr_timings *spec_timings)
978978 {
979979 const struct nand_controller_ops *ops = chip->controller->ops;
980− int best_mode = 0, mode, ret;
980+ int best_mode = 0, mode, ret = -EOPNOTSUPP;
981981
982982 iface->type = NAND_NVDDR_IFACE;
983983
@@ -1837,7 +1837,7 @@ int nand_erase_op(struct nand_chip *chip, unsigned int eraseblock) · 853 unmodified lines
18371837 NAND_OP_CMD(NAND_CMD_ERASE1, 0),
18381838 NAND_OP_ADDR(2, addrs, 0),
18391839 NAND_OP_CMD(NAND_CMD_ERASE2,
1840− NAND_COMMON_TIMING_MS(conf, tWB_max)),
1840+ NAND_COMMON_TIMING_NS(conf, tWB_max)),
18411841 NAND_OP_WAIT_RDY(NAND_COMMON_TIMING_MS(conf, tBERS_max),
18421842 0),
18431843 };
drivers/net/Kconfig+1−3
@@ -567,9 +567,7 @@ config XEN_NETDEV_BACKEND · 566 unmodified lines
567567 config VMXNET3
568568 tristate "VMware VMXNET3 ethernet driver"
569569 depends on PCI && INET
570− depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
571− IA64_PAGE_SIZE_64KB || PARISC_PAGE_SIZE_64KB || \
572− PPC_64K_PAGES)
570+ depends on PAGE_SIZE_LESS_THAN_64KB
573571 help
574572 This driver supports VMware's vmxnet3 virtual ethernet NIC.
575573 To compile this driver as a module, choose M here: the
drivers/net/amt.c+1−1
@@ -3286,7 +3286,7 @@ static void __exit amt_fini(void) · 3285 unmodified lines
32863286 {
32873287 rtnl_link_unregister(&amt_link_ops);
32883288 unregister_netdevice_notifier(&amt_notifier_block);
3289− cancel_delayed_work(&source_gc_wq);
3289+ cancel_delayed_work_sync(&source_gc_wq);
32903290 __amt_source_gc_work();
32913291 destroy_workqueue(amt_wq);
32923292 }
drivers/net/bonding/bond_alb.c+8−6
@@ -1501,14 +1501,14 @@ void bond_alb_monitor(struct work_struct *work) · 1500 unmodified lines
15011501 struct slave *slave;
15021502
15031503 if (!bond_has_slaves(bond)) {
1504− bond_info->tx_rebalance_counter = 0;
1504+ atomic_set(&bond_info->tx_rebalance_counter, 0);
15051505 bond_info->lp_counter = 0;
15061506 goto re_arm;
15071507 }
15081508
15091509 rcu_read_lock();
15101510
1511− bond_info->tx_rebalance_counter++;
1511+ atomic_inc(&bond_info->tx_rebalance_counter);
15121512 bond_info->lp_counter++;
15131513
15141514 /* send learning packets */
@@ -1530,7 +1530,7 @@ void bond_alb_monitor(struct work_struct *work) · 15 unmodified lines
15301530 }
15311531
15321532 /* rebalance tx traffic */
1533− if (bond_info->tx_rebalance_counter >= BOND_TLB_REBALANCE_TICKS) {
1533+ if (atomic_read(&bond_info->tx_rebalance_counter) >= BOND_TLB_REBALANCE_TICKS) {
15341534 bond_for_each_slave_rcu(bond, slave, iter) {
15351535 tlb_clear_slave(bond, slave, 1);
15361536 if (slave == rcu_access_pointer(bond->curr_active_slave)) {
@@ -1540,7 +1540,7 @@ void bond_alb_monitor(struct work_struct *work) · 3 unmodified lines
15401540 bond_info->unbalanced_load = 0;
15411541 }
15421542 }
1543− bond_info->tx_rebalance_counter = 0;
1543+ atomic_set(&bond_info->tx_rebalance_counter, 0);
15441544 }
15451545
15461546 if (bond_info->rlb_enabled) {
@@ -1610,7 +1610,8 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave) · 63 unmodified lines
16101610 tlb_init_slave(slave);
16111611
16121612 /* order a rebalance ASAP */
1613− bond->alb_info.tx_rebalance_counter = BOND_TLB_REBALANCE_TICKS;
1613+ atomic_set(&bond->alb_info.tx_rebalance_counter,
1614+ BOND_TLB_REBALANCE_TICKS);
16141615
16151616 if (bond->alb_info.rlb_enabled)
16161617 bond->alb_info.rlb_rebalance = 1;
@@ -1647,7 +1648,8 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char · 30 unmodified lines
16471648 rlb_clear_slave(bond, slave);
16481649 } else if (link == BOND_LINK_UP) {
16491650 /* order a rebalance ASAP */
1650− bond_info->tx_rebalance_counter = BOND_TLB_REBALANCE_TICKS;
1651+ atomic_set(&bond_info->tx_rebalance_counter,
1652+ BOND_TLB_REBALANCE_TICKS);
16511653 if (bond->alb_info.rlb_enabled) {
16521654 bond->alb_info.rlb_rebalance = 1;
16531655 /* If the updelay module parameter is smaller than the
drivers/net/can/kvaser_pciefd.c+7−1
@@ -248,6 +248,9 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices"); · 247 unmodified lines
248248 #define KVASER_PCIEFD_SPACK_EWLR BIT(23)
249249 #define KVASER_PCIEFD_SPACK_EPLR BIT(24)
250250
251+/* Kvaser KCAN_EPACK second word */
252+#define KVASER_PCIEFD_EPACK_DIR_TX BIT(0)
253+
251254 struct kvaser_pciefd;
252255
253256 struct kvaser_pciefd_can {
@@ -1285,7 +1288,10 @@ static int kvaser_pciefd_rx_error_frame(struct kvaser_pciefd_can *can, · 1031 unmodified lines
12851288
12861289 can->err_rep_cnt++;
12871290 can->can.can_stats.bus_error++;
1288− stats->rx_errors++;
1291+ if (p->header[1] & KVASER_PCIEFD_EPACK_DIR_TX)
1292+ stats->tx_errors++;
1293+ else
1294+ stats->rx_errors++;
12891295
12901296 can->bec.txerr = bec.txerr;
12911297 can->bec.rxerr = bec.rxerr;
drivers/net/can/m_can/m_can.c+27−15
@@ -204,16 +204,16 @@ enum m_can_reg { · 203 unmodified lines
204204
205205 /* Interrupts for version 3.0.x */
206206 #define IR_ERR_LEC_30X (IR_STE | IR_FOE | IR_ACKE | IR_BE | IR_CRCE)
207−#define IR_ERR_BUS_30X (IR_ERR_LEC_30X | IR_WDI | IR_ELO | IR_BEU | \
208− IR_BEC | IR_TOO | IR_MRAF | IR_TSW | IR_TEFL | \
209− IR_RF1L | IR_RF0L)
207+#define IR_ERR_BUS_30X (IR_ERR_LEC_30X | IR_WDI | IR_BEU | IR_BEC | \
208+ IR_TOO | IR_MRAF | IR_TSW | IR_TEFL | IR_RF1L | \
209+ IR_RF0L)
210210 #define IR_ERR_ALL_30X (IR_ERR_STATE | IR_ERR_BUS_30X)
211211
212212 /* Interrupts for version >= 3.1.x */
213213 #define IR_ERR_LEC_31X (IR_PED | IR_PEA)
214−#define IR_ERR_BUS_31X (IR_ERR_LEC_31X | IR_WDI | IR_ELO | IR_BEU | \
215− IR_BEC | IR_TOO | IR_MRAF | IR_TSW | IR_TEFL | \
216− IR_RF1L | IR_RF0L)
214+#define IR_ERR_BUS_31X (IR_ERR_LEC_31X | IR_WDI | IR_BEU | IR_BEC | \
215+ IR_TOO | IR_MRAF | IR_TSW | IR_TEFL | IR_RF1L | \
216+ IR_RF0L)
217217 #define IR_ERR_ALL_31X (IR_ERR_STATE | IR_ERR_BUS_31X)
218218
219219 /* Interrupt Line Select (ILS) */
@@ -517,7 +517,7 @@ static int m_can_read_fifo(struct net_device *dev, u32 rxfs) · 297 unmodified lines
517517 err = m_can_fifo_read(cdev, fgi, M_CAN_FIFO_DATA,
518518 cf->data, DIV_ROUND_UP(cf->len, 4));
519519 if (err)
520− goto out_fail;
520+ goto out_free_skb;
521521 }
522522
523523 /* acknowledge rx fifo 0 */
@@ -532,6 +532,8 @@ static int m_can_read_fifo(struct net_device *dev, u32 rxfs) · 8 unmodified lines
532532
533533 return 0;
534534
535+out_free_skb:
536+ kfree_skb(skb);
535537 out_fail:
536538 netdev_err(dev, "FIFO read returned %d\n", err);
537539 return err;
@@ -810,8 +812,6 @@ static void m_can_handle_other_err(struct net_device *dev, u32 irqstatus) · 272 unmodified lines
810812 {
811813 if (irqstatus & IR_WDI)
812814 netdev_err(dev, "Message RAM Watchdog event due to missing READY\n");
813− if (irqstatus & IR_ELO)
814− netdev_err(dev, "Error Logging Overflow\n");
815815 if (irqstatus & IR_BEU)
816816 netdev_err(dev, "Bit Error Uncorrected\n");
817817 if (irqstatus & IR_BEC)
@@ -1494,20 +1494,32 @@ static int m_can_dev_setup(struct m_can_classdev *cdev) · 676 unmodified lines
14941494 case 30:
14951495 /* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.0.x */
14961496 can_set_static_ctrlmode(dev, CAN_CTRLMODE_FD_NON_ISO);
1497− cdev->can.bittiming_const = &m_can_bittiming_const_30X;
1498− cdev->can.data_bittiming_const = &m_can_data_bittiming_const_30X;
1497+ cdev->can.bittiming_const = cdev->bit_timing ?
1498+ cdev->bit_timing : &m_can_bittiming_const_30X;
1499+
1500+ cdev->can.data_bittiming_const = cdev->data_timing ?
1501+ cdev->data_timing :
1502+ &m_can_data_bittiming_const_30X;
14991503 break;
15001504 case 31:
15011505 /* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.1.x */
15021506 can_set_static_ctrlmode(dev, CAN_CTRLMODE_FD_NON_ISO);
1503− cdev->can.bittiming_const = &m_can_bittiming_const_31X;
1504− cdev->can.data_bittiming_const = &m_can_data_bittiming_const_31X;
1507+ cdev->can.bittiming_const = cdev->bit_timing ?
1508+ cdev->bit_timing : &m_can_bittiming_const_31X;
1509+
1510+ cdev->can.data_bittiming_const = cdev->data_timing ?
1511+ cdev->data_timing :
1512+ &m_can_data_bittiming_const_31X;
15051513 break;
15061514 case 32:
15071515 case 33:
15081516 /* Support both MCAN version v3.2.x and v3.3.0 */
1509− cdev->can.bittiming_const = &m_can_bittiming_const_31X;
1510− cdev->can.data_bittiming_const = &m_can_data_bittiming_const_31X;
1517+ cdev->can.bittiming_const = cdev->bit_timing ?
1518+ cdev->bit_timing : &m_can_bittiming_const_31X;
1519+
1520+ cdev->can.data_bittiming_const = cdev->data_timing ?
1521+ cdev->data_timing :
1522+ &m_can_data_bittiming_const_31X;
15111523
15121524 cdev->can.ctrlmode_supported |=
15131525 (m_can_niso_supported(cdev) ?
drivers/net/can/m_can/m_can.h+3−0
@@ -85,6 +85,9 @@ struct m_can_classdev { · 84 unmodified lines
8585 struct sk_buff *tx_skb;
8686 struct phy *transceiver;
8787
88+ const struct can_bittiming_const *bit_timing;
89+ const struct can_bittiming_const *data_timing;
90+
8891 struct m_can_ops *ops;
8992
9093 int version;
drivers/net/can/m_can/m_can_pci.c+56−6
@@ -18,9 +18,14 @@ · 17 unmodified lines
1818
1919 #define M_CAN_PCI_MMIO_BAR 0
2020
21−#define M_CAN_CLOCK_FREQ_EHL 100000000
2221 #define CTL_CSR_INT_CTL_OFFSET 0x508
2322
23+struct m_can_pci_config {
24+ const struct can_bittiming_const *bit_timing;
25+ const struct can_bittiming_const *data_timing;
26+ unsigned int clock_freq;
27+};
28+
2429 struct m_can_pci_priv {
2530 struct m_can_classdev cdev;
2631
@@ -42,8 +47,13 @@ static u32 iomap_read_reg(struct m_can_classdev *cdev, int reg) · 15 unmodified lines
4247 static int iomap_read_fifo(struct m_can_classdev *cdev, int offset, void *val, size_t val_count)
4348 {
4449 struct m_can_pci_priv *priv = cdev_to_priv(cdev);
50+ void __iomem *src = priv->base + offset;
4551
46− ioread32_rep(priv->base + offset, val, val_count);
52+ while (val_count--) {
53+ *(unsigned int *)val = ioread32(src);
54+ val += 4;
55+ src += 4;
56+ }
4757
4858 return 0;
4959 }
@@ -61,8 +71,13 @@ static int iomap_write_fifo(struct m_can_classdev *cdev, int offset, · 11 unmodified lines
6171 const void *val, size_t val_count)
6272 {
6373 struct m_can_pci_priv *priv = cdev_to_priv(cdev);
74+ void __iomem *dst = priv->base + offset;
6475
65− iowrite32_rep(priv->base + offset, val, val_count);
76+ while (val_count--) {
77+ iowrite32(*(unsigned int *)val, dst);
78+ val += 4;
79+ dst += 4;
80+ }
6681
6782 return 0;
6883 }
@@ -74,9 +89,40 @@ static struct m_can_ops m_can_pci_ops = { · 5 unmodified lines
7489 .read_fifo = iomap_read_fifo,
7590 };
7691
92+static const struct can_bittiming_const m_can_bittiming_const_ehl = {
93+ .name = KBUILD_MODNAME,
94+ .tseg1_min = 2, /* Time segment 1 = prop_seg + phase_seg1 */
95+ .tseg1_max = 64,
96+ .tseg2_min = 1, /* Time segment 2 = phase_seg2 */
97+ .tseg2_max = 128,
98+ .sjw_max = 128,
99+ .brp_min = 1,
100+ .brp_max = 512,
101+ .brp_inc = 1,
102+};
103+
104+static const struct can_bittiming_const m_can_data_bittiming_const_ehl = {
105+ .name = KBUILD_MODNAME,
106+ .tseg1_min = 2, /* Time segment 1 = prop_seg + phase_seg1 */
107+ .tseg1_max = 16,
108+ .tseg2_min = 1, /* Time segment 2 = phase_seg2 */
109+ .tseg2_max = 8,
110+ .sjw_max = 4,
111+ .brp_min = 1,
112+ .brp_max = 32,
113+ .brp_inc = 1,
114+};
115+
116+static const struct m_can_pci_config m_can_pci_ehl = {
117+ .bit_timing = &m_can_bittiming_const_ehl,
118+ .data_timing = &m_can_data_bittiming_const_ehl,
119+ .clock_freq = 200000000,
120+};
121+
77122 static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
78123 {
79124 struct device *dev = &pci->dev;
125+ const struct m_can_pci_config *cfg;
80126 struct m_can_classdev *mcan_class;
81127 struct m_can_pci_priv *priv;
82128 void __iomem *base;
@@ -104,6 +150,8 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) · 21 unmodified lines
104150 if (!mcan_class)
105151 return -ENOMEM;
106152
153+ cfg = (const struct m_can_pci_config *)id->driver_data;
154+
107155 priv = cdev_to_priv(mcan_class);
108156
109157 priv->base = base;
@@ -115,7 +163,9 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) · 5 unmodified lines
115163 mcan_class->dev = &pci->dev;
116164 mcan_class->net->irq = pci_irq_vector(pci, 0);
117165 mcan_class->pm_clock_support = 1;
118− mcan_class->can.clock.freq = id->driver_data;
166+ mcan_class->bit_timing = cfg->bit_timing;
167+ mcan_class->data_timing = cfg->data_timing;
168+ mcan_class->can.clock.freq = cfg->clock_freq;
119169 mcan_class->ops = &m_can_pci_ops;
120170
121171 pci_set_drvdata(pci, mcan_class);
@@ -168,8 +218,8 @@ static SIMPLE_DEV_PM_OPS(m_can_pci_pm_ops, · 46 unmodified lines
168218 m_can_pci_suspend, m_can_pci_resume);
169219
170220 static const struct pci_device_id m_can_pci_id_table[] = {
171− { PCI_VDEVICE(INTEL, 0x4bc1), M_CAN_CLOCK_FREQ_EHL, },
172− { PCI_VDEVICE(INTEL, 0x4bc2), M_CAN_CLOCK_FREQ_EHL, },
221+ { PCI_VDEVICE(INTEL, 0x4bc1), (kernel_ulong_t)&m_can_pci_ehl, },
222+ { PCI_VDEVICE(INTEL, 0x4bc2), (kernel_ulong_t)&m_can_pci_ehl, },
173223 { } /* Terminating Entry */
174224 };
175225 MODULE_DEVICE_TABLE(pci, m_can_pci_id_table);
drivers/net/can/pch_can.c+1−1
@@ -692,11 +692,11 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 obj_num, int quota) · 691 unmodified lines
692692 cf->data[i + 1] = data_reg >> 8;
693693 }
694694
695− netif_receive_skb(skb);
696695 rcv_pkts++;
697696 stats->rx_packets++;
698697 quota--;
699698 stats->rx_bytes += cf->len;
699+ netif_receive_skb(skb);
700700
701701 pch_fifo_thresh(priv, obj_num);
702702 obj_num++;
drivers/net/can/sja1000/ems_pcmcia.c+6−1
@@ -234,7 +234,12 @@ static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base) · 233 unmodified lines
234234 free_sja1000dev(dev);
235235 }
236236
237− err = request_irq(dev->irq, &ems_pcmcia_interrupt, IRQF_SHARED,
237+ if (!card->channels) {
238+ err = -ENODEV;
239+ goto failure_cleanup;
240+ }
241+
242+ err = request_irq(pdev->irq, &ems_pcmcia_interrupt, IRQF_SHARED,
238243 DRV_NAME, card);
239244 if (!err)
240245 return 0;
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+73−28
@@ -28,10 +28,6 @@ · 27 unmodified lines
2828
2929 #include "kvaser_usb.h"
3030
31−/* Forward declaration */
32−static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg;
33−
34−#define CAN_USB_CLOCK 8000000
3531 #define MAX_USBCAN_NET_DEVICES 2
3632
3733 /* Command header size */
@@ -80,6 +76,12 @@ static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg; · 42 unmodified lines
8076
8177 #define CMD_LEAF_LOG_MESSAGE 106
8278
79+/* Leaf frequency options */
80+#define KVASER_USB_LEAF_SWOPTION_FREQ_MASK 0x60
81+#define KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK 0
82+#define KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK BIT(5)
83+#define KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK BIT(6)
84+
8385 /* error factors */
8486 #define M16C_EF_ACKE BIT(0)
8587 #define M16C_EF_CRCE BIT(1)
@@ -340,6 +342,50 @@ struct kvaser_usb_err_summary { · 254 unmodified lines
340342 };
341343 };
342344
345+static const struct can_bittiming_const kvaser_usb_leaf_bittiming_const = {
346+ .name = "kvaser_usb",
347+ .tseg1_min = KVASER_USB_TSEG1_MIN,
348+ .tseg1_max = KVASER_USB_TSEG1_MAX,
349+ .tseg2_min = KVASER_USB_TSEG2_MIN,
350+ .tseg2_max = KVASER_USB_TSEG2_MAX,
351+ .sjw_max = KVASER_USB_SJW_MAX,
352+ .brp_min = KVASER_USB_BRP_MIN,
353+ .brp_max = KVASER_USB_BRP_MAX,
354+ .brp_inc = KVASER_USB_BRP_INC,
355+};
356+
357+static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_8mhz = {
358+ .clock = {
359+ .freq = 8000000,
360+ },
361+ .timestamp_freq = 1,
362+ .bittiming_const = &kvaser_usb_leaf_bittiming_const,
363+};
364+
365+static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_16mhz = {
366+ .clock = {
367+ .freq = 16000000,
368+ },
369+ .timestamp_freq = 1,
370+ .bittiming_const = &kvaser_usb_leaf_bittiming_const,
371+};
372+
373+static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_24mhz = {
374+ .clock = {
375+ .freq = 24000000,
376+ },
377+ .timestamp_freq = 1,
378+ .bittiming_const = &kvaser_usb_leaf_bittiming_const,
379+};
380+
381+static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg_32mhz = {
382+ .clock = {
383+ .freq = 32000000,
384+ },
385+ .timestamp_freq = 1,
386+ .bittiming_const = &kvaser_usb_leaf_bittiming_const,
387+};
388+
343389 static void *
344390 kvaser_usb_leaf_frame_to_cmd(const struct kvaser_usb_net_priv *priv,
345391 const struct sk_buff *skb, int *frame_len,
@@ -471,6 +517,27 @@ static int kvaser_usb_leaf_send_simple_cmd(const struct kvaser_usb *dev, · 125 unmodified lines
471517 return rc;
472518 }
473519
520+static void kvaser_usb_leaf_get_software_info_leaf(struct kvaser_usb *dev,
521+ const struct leaf_cmd_softinfo *softinfo)
522+{
523+ u32 sw_options = le32_to_cpu(softinfo->sw_options);
524+
525+ dev->fw_version = le32_to_cpu(softinfo->fw_version);
526+ dev->max_tx_urbs = le16_to_cpu(softinfo->max_outstanding_tx);
527+
528+ switch (sw_options & KVASER_USB_LEAF_SWOPTION_FREQ_MASK) {
529+ case KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK:
530+ dev->cfg = &kvaser_usb_leaf_dev_cfg_16mhz;
531+ break;
532+ case KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK:
533+ dev->cfg = &kvaser_usb_leaf_dev_cfg_24mhz;
534+ break;
535+ case KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK:
536+ dev->cfg = &kvaser_usb_leaf_dev_cfg_32mhz;
537+ break;
538+ }
539+}
540+
474541 static int kvaser_usb_leaf_get_software_info_inner(struct kvaser_usb *dev)
475542 {
476543 struct kvaser_cmd cmd;
@@ -486,14 +553,13 @@ static int kvaser_usb_leaf_get_software_info_inner(struct kvaser_usb *dev) · 9 unmodified lines
486553
487554 switch (dev->card_data.leaf.family) {
488555 case KVASER_LEAF:
489− dev->fw_version = le32_to_cpu(cmd.u.leaf.softinfo.fw_version);
490− dev->max_tx_urbs =
491− le16_to_cpu(cmd.u.leaf.softinfo.max_outstanding_tx);
556+ kvaser_usb_leaf_get_software_info_leaf(dev, &cmd.u.leaf.softinfo);
492557 break;
493558 case KVASER_USBCAN:
494559 dev->fw_version = le32_to_cpu(cmd.u.usbcan.softinfo.fw_version);
495560 dev->max_tx_urbs =
496561 le16_to_cpu(cmd.u.usbcan.softinfo.max_outstanding_tx);
562+ dev->cfg = &kvaser_usb_leaf_dev_cfg_8mhz;
497563 break;
498564 }
499565
@@ -1225,24 +1291,11 @@ static int kvaser_usb_leaf_init_card(struct kvaser_usb *dev) · 725 unmodified lines
12251291 {
12261292 struct kvaser_usb_dev_card_data *card_data = &dev->card_data;
12271293
1228− dev->cfg = &kvaser_usb_leaf_dev_cfg;
12291294 card_data->ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
12301295
12311296 return 0;
12321297 }
12331298
1234−static const struct can_bittiming_const kvaser_usb_leaf_bittiming_const = {
1235− .name = "kvaser_usb",
1236− .tseg1_min = KVASER_USB_TSEG1_MIN,
1237− .tseg1_max = KVASER_USB_TSEG1_MAX,
1238− .tseg2_min = KVASER_USB_TSEG2_MIN,
1239− .tseg2_max = KVASER_USB_TSEG2_MAX,
1240− .sjw_max = KVASER_USB_SJW_MAX,
1241− .brp_min = KVASER_USB_BRP_MIN,
1242− .brp_max = KVASER_USB_BRP_MAX,
1243− .brp_inc = KVASER_USB_BRP_INC,
1244−};
1245−
12461299 static int kvaser_usb_leaf_set_bittiming(struct net_device *netdev)
12471300 {
12481301 struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
@@ -1348,11 +1401,3 @@ const struct kvaser_usb_dev_ops kvaser_usb_leaf_dev_ops = { · 99 unmodified lines
13481401 .dev_read_bulk_callback = kvaser_usb_leaf_read_bulk_callback,
13491402 .dev_frame_to_cmd = kvaser_usb_leaf_frame_to_cmd,
13501403 };
1351−
1352−static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg = {
1353− .clock = {
1354− .freq = CAN_USB_CLOCK,
1355− },
1356− .timestamp_freq = 1,
1357− .bittiming_const = &kvaser_usb_leaf_bittiming_const,
1358−};
drivers/net/dsa/b53/b53_spi.c+14−0
@@ -349,6 +349,19 @@ static const struct of_device_id b53_spi_of_match[] = { · 348 unmodified lines
349349 };
350350 MODULE_DEVICE_TABLE(of, b53_spi_of_match);
351351
352+static const struct spi_device_id b53_spi_ids[] = {
353+ { .name = "bcm5325" },
354+ { .name = "bcm5365" },
355+ { .name = "bcm5395" },
356+ { .name = "bcm5397" },
357+ { .name = "bcm5398" },
358+ { .name = "bcm53115" },
359+ { .name = "bcm53125" },
360+ { .name = "bcm53128" },
361+ { /* sentinel */ }
362+};
363+MODULE_DEVICE_TABLE(spi, b53_spi_ids);
364+
352365 static struct spi_driver b53_spi_driver = {
353366 .driver = {
354367 .name = "b53-switch",
@@ -357,6 +370,7 @@ static struct spi_driver b53_spi_driver = { · 2 unmodified lines
357370 .probe = b53_spi_probe,
358371 .remove = b53_spi_remove,
359372 .shutdown = b53_spi_shutdown,
373+ .id_table = b53_spi_ids,
360374 };
361375
362376 module_spi_driver(b53_spi_driver);
drivers/net/dsa/microchip/ksz8795.c+7−49
@@ -1002,57 +1002,32 @@ static void ksz8_cfg_port_member(struct ksz_device *dev, int port, u8 member) · 1001 unmodified lines
10021002 data &= ~PORT_VLAN_MEMBERSHIP;
10031003 data |= (member & dev->port_mask);
10041004 ksz_pwrite8(dev, port, P_MIRROR_CTRL, data);
1005− dev->ports[port].member = member;
10061005 }
10071006
10081007 static void ksz8_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
10091008 {
10101009 struct ksz_device *dev = ds->priv;
1011− int forward = dev->member;
10121010 struct ksz_port *p;
1013− int member = -1;
10141011 u8 data;
10151012
1016− p = &dev->ports[port];
1017−
10181013 ksz_pread8(dev, port, P_STP_CTRL, &data);
10191014 data &= ~(PORT_TX_ENABLE | PORT_RX_ENABLE | PORT_LEARN_DISABLE);
10201015
10211016 switch (state) {
10221017 case BR_STATE_DISABLED:
10231018 data |= PORT_LEARN_DISABLE;
1024− if (port < dev->phy_port_cnt)
1025− member = 0;
10261019 break;
10271020 case BR_STATE_LISTENING:
10281021 data |= (PORT_RX_ENABLE | PORT_LEARN_DISABLE);
1029− if (port < dev->phy_port_cnt &&
1030− p->stp_state == BR_STATE_DISABLED)
1031− member = dev->host_mask | p->vid_member;
10321022 break;
10331023 case BR_STATE_LEARNING:
10341024 data |= PORT_RX_ENABLE;
10351025 break;
10361026 case BR_STATE_FORWARDING:
10371027 data |= (PORT_TX_ENABLE | PORT_RX_ENABLE);
1038−
1039− /* This function is also used internally. */
1040− if (port == dev->cpu_port)
1041− break;
1042−
1043− /* Port is a member of a bridge. */
1044− if (dev->br_member & BIT(port)) {
1045− dev->member |= BIT(port);
1046− member = dev->member;
1047− } else {
1048− member = dev->host_mask | p->vid_member;
1049− }
10501028 break;
10511029 case BR_STATE_BLOCKING:
10521030 data |= PORT_LEARN_DISABLE;
1053− if (port < dev->phy_port_cnt &&
1054− p->stp_state == BR_STATE_DISABLED)
1055− member = dev->host_mask | p->vid_member;
10561031 break;
10571032 default:
10581033 dev_err(ds->dev, "invalid STP state: %d\n", state);
@@ -1060,22 +1035,11 @@ static void ksz8_port_stp_state_set(struct dsa_switch *ds, int port, u8 state) · 1 unmodified line
10601035 }
10611036
10621037 ksz_pwrite8(dev, port, P_STP_CTRL, data);
1038+
1039+ p = &dev->ports[port];
10631040 p->stp_state = state;
1064− /* Port membership may share register with STP state. */
1065− if (member >= 0 && member != p->member)
1066− ksz8_cfg_port_member(dev, port, (u8)member);
1067−
1068− /* Check if forwarding needs to be updated. */
1069− if (state != BR_STATE_FORWARDING) {
1070− if (dev->br_member & BIT(port))
1071− dev->member &= ~BIT(port);
1072− }
10731041
1074− /* When topology has changed the function ksz_update_port_member
1075− * should be called to modify port forwarding behavior.
1076− */
1077− if (forward != dev->member)
1078− ksz_update_port_member(dev, port);
1042+ ksz_update_port_member(dev, port);
10791043 }
10801044
10811045 static void ksz8_flush_dyn_mac_table(struct ksz_device *dev, int port)
@@ -1341,7 +1305,7 @@ static void ksz8795_cpu_interface_select(struct ksz_device *dev, int port) · 259 unmodified lines
13411305
13421306 static void ksz8_port_setup(struct ksz_device *dev, int port, bool cpu_port)
13431307 {
1344− struct ksz_port *p = &dev->ports[port];
1308+ struct dsa_switch *ds = dev->ds;
13451309 struct ksz8 *ksz8 = dev->priv;
13461310 const u32 *masks;
13471311 u8 member;
@@ -1368,10 +1332,11 @@ static void ksz8_port_setup(struct ksz_device *dev, int port, bool cpu_port) · 20 unmodified lines
13681332 if (!ksz_is_ksz88x3(dev))
13691333 ksz8795_cpu_interface_select(dev, port);
13701334
1371− member = dev->port_mask;
1335+ member = dsa_user_ports(ds);
13721336 } else {
1373− member = dev->host_mask | p->vid_member;
1337+ member = BIT(dsa_upstream_port(ds, port));
13741338 }
1339+
13751340 ksz8_cfg_port_member(dev, port, member);
13761341 }
13771342
@@ -1392,20 +1357,13 @@ static void ksz8_config_cpu_port(struct dsa_switch *ds) · 14 unmodified lines
13921357 ksz_cfg(dev, regs[S_TAIL_TAG_CTRL], masks[SW_TAIL_TAG_ENABLE], true);
13931358
13941359 p = &dev->ports[dev->cpu_port];
1395− p->vid_member = dev->port_mask;
13961360 p->on = 1;
13971361
13981362 ksz8_port_setup(dev, dev->cpu_port, true);
1399− dev->member = dev->host_mask;
14001363
14011364 for (i = 0; i < dev->phy_port_cnt; i++) {
14021365 p = &dev->ports[i];
14031366
1404− /* Initialize to non-zero so that ksz_cfg_port_member() will
1405− * be called.
1406− */
1407− p->vid_member = BIT(i);
1408− p->member = dev->port_mask;
14091367 ksz8_port_stp_state_set(ds, i, BR_STATE_DISABLED);
14101368
14111369 /* Last port may be disabled. */
drivers/net/dsa/microchip/ksz9477.c+8−58
@@ -391,7 +391,6 @@ static void ksz9477_cfg_port_member(struct ksz_device *dev, int port, · 390 unmodified lines
391391 u8 member)
392392 {
393393 ksz_pwrite32(dev, port, REG_PORT_VLAN_MEMBERSHIP__4, member);
394− dev->ports[port].member = member;
395394 }
396395
397396 static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port,
@@ -400,8 +399,6 @@ static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port, · 2 unmodified lines
400399 struct ksz_device *dev = ds->priv;
401400 struct ksz_port *p = &dev->ports[port];
402401 u8 data;
403− int member = -1;
404− int forward = dev->member;
405402
406403 ksz_pread8(dev, port, P_STP_CTRL, &data);
407404 data &= ~(PORT_TX_ENABLE | PORT_RX_ENABLE | PORT_LEARN_DISABLE);
@@ -409,40 +406,18 @@ static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port, · 1 unmodified line
409406 switch (state) {
410407 case BR_STATE_DISABLED:
411408 data |= PORT_LEARN_DISABLE;
412− if (port != dev->cpu_port)
413− member = 0;
414409 break;
415410 case BR_STATE_LISTENING:
416411 data |= (PORT_RX_ENABLE | PORT_LEARN_DISABLE);
417− if (port != dev->cpu_port &&
418− p->stp_state == BR_STATE_DISABLED)
419− member = dev->host_mask | p->vid_member;
420412 break;
421413 case BR_STATE_LEARNING:
422414 data |= PORT_RX_ENABLE;
423415 break;
424416 case BR_STATE_FORWARDING:
425417 data |= (PORT_TX_ENABLE | PORT_RX_ENABLE);
426−
427− /* This function is also used internally. */
428− if (port == dev->cpu_port)
429− break;
430−
431− member = dev->host_mask | p->vid_member;
432− mutex_lock(&dev->dev_mutex);
433−
434− /* Port is a member of a bridge. */
435− if (dev->br_member & (1 << port)) {
436− dev->member |= (1 << port);
437− member = dev->member;
438− }
439− mutex_unlock(&dev->dev_mutex);
440418 break;
441419 case BR_STATE_BLOCKING:
442420 data |= PORT_LEARN_DISABLE;
443− if (port != dev->cpu_port &&
444− p->stp_state == BR_STATE_DISABLED)
445− member = dev->host_mask | p->vid_member;
446421 break;
447422 default:
448423 dev_err(ds->dev, "invalid STP state: %d\n", state);
@@ -451,23 +426,8 @@ static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port, · 2 unmodified lines
451426
452427 ksz_pwrite8(dev, port, P_STP_CTRL, data);
453428 p->stp_state = state;
454− mutex_lock(&dev->dev_mutex);
455− /* Port membership may share register with STP state. */
456− if (member >= 0 && member != p->member)
457− ksz9477_cfg_port_member(dev, port, (u8)member);
458−
459− /* Check if forwarding needs to be updated. */
460− if (state != BR_STATE_FORWARDING) {
461− if (dev->br_member & (1 << port))
462− dev->member &= ~(1 << port);
463− }
464429
465− /* When topology has changed the function ksz_update_port_member
466− * should be called to modify port forwarding behavior.
467− */
468− if (forward != dev->member)
469− ksz_update_port_member(dev, port);
470− mutex_unlock(&dev->dev_mutex);
430+ ksz_update_port_member(dev, port);
471431 }
472432
473433 static void ksz9477_flush_dyn_mac_table(struct ksz_device *dev, int port)
@@ -1168,10 +1128,10 @@ static void ksz9477_phy_errata_setup(struct ksz_device *dev, int port) · 694 unmodified lines
11681128
11691129 static void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
11701130 {
1171− u8 data8;
1172− u8 member;
1173− u16 data16;
11741131 struct ksz_port *p = &dev->ports[port];
1132+ struct dsa_switch *ds = dev->ds;
1133+ u8 data8, member;
1134+ u16 data16;
11751135
11761136 /* enable tag tail for host port */
11771137 if (cpu_port)
@@ -1250,12 +1210,12 @@ static void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port) · 72 unmodified lines
12501210 ksz_pwrite8(dev, port, REG_PORT_XMII_CTRL_1, data8);
12511211 p->phydev.duplex = 1;
12521212 }
1253− mutex_lock(&dev->dev_mutex);
1213+
12541214 if (cpu_port)
1255− member = dev->port_mask;
1215+ member = dsa_user_ports(ds);
12561216 else
1257− member = dev->host_mask | p->vid_member;
1258− mutex_unlock(&dev->dev_mutex);
1217+ member = BIT(dsa_upstream_port(ds, port));
1218+
12591219 ksz9477_cfg_port_member(dev, port, member);
12601220
12611221 /* clear pending interrupts */
@@ -1276,8 +1236,6 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) · 14 unmodified lines
12761236 const char *prev_mode;
12771237
12781238 dev->cpu_port = i;
1279− dev->host_mask = (1 << dev->cpu_port);
1280− dev->port_mask |= dev->host_mask;
12811239 p = &dev->ports[i];
12821240
12831241 /* Read from XMII register to determine host port
@@ -1312,23 +1270,15 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) · 28 unmodified lines
13121270
13131271 /* enable cpu port */
13141272 ksz9477_port_setup(dev, i, true);
1315− p->vid_member = dev->port_mask;
13161273 p->on = 1;
13171274 }
13181275 }
13191276
1320− dev->member = dev->host_mask;
1321−
13221277 for (i = 0; i < dev->port_cnt; i++) {
13231278 if (i == dev->cpu_port)
13241279 continue;
13251280 p = &dev->ports[i];
13261281
1327− /* Initialize to non-zero so that ksz_cfg_port_member() will
1328− * be called.
1329− */
1330− p->vid_member = (1 << i);
1331− p->member = dev->port_mask;
13321282 ksz9477_port_stp_state_set(ds, i, BR_STATE_DISABLED);
13331283 p->on = 1;
13341284 if (i < dev->phy_port_cnt)
drivers/net/dsa/microchip/ksz_common.c+28−22
@@ -22,21 +22,40 @@ · 21 unmodified lines
2222
2323 void ksz_update_port_member(struct ksz_device *dev, int port)
2424 {
25− struct ksz_port *p;
25+ struct ksz_port *p = &dev->ports[port];
26+ struct dsa_switch *ds = dev->ds;
27+ u8 port_member = 0, cpu_port;
28+ const struct dsa_port *dp;
2629 int i;
2730
28− for (i = 0; i < dev->port_cnt; i++) {
29− if (i == port || i == dev->cpu_port)
31+ if (!dsa_is_user_port(ds, port))
32+ return;
33+
34+ dp = dsa_to_port(ds, port);
35+ cpu_port = BIT(dsa_upstream_port(ds, port));
36+
37+ for (i = 0; i < ds->num_ports; i++) {
38+ const struct dsa_port *other_dp = dsa_to_port(ds, i);
39+ struct ksz_port *other_p = &dev->ports[i];
40+ u8 val = 0;
41+
42+ if (!dsa_is_user_port(ds, i))
3043 continue;
31− p = &dev->ports[i];
32− if (!(dev->member & (1 << i)))
44+ if (port == i)
45+ continue;
46+ if (!dp->bridge_dev || dp->bridge_dev != other_dp->bridge_dev)
3347 continue;
3448
35− /* Port is a member of the bridge and is forwarding. */
36− if (p->stp_state == BR_STATE_FORWARDING &&
37− p->member != dev->member)
38− dev->dev_ops->cfg_port_member(dev, i, dev->member);
49+ if (other_p->stp_state == BR_STATE_FORWARDING &&
50+ p->stp_state == BR_STATE_FORWARDING) {
51+ val |= BIT(port);
52+ port_member |= BIT(i);
53+ }
54+
55+ dev->dev_ops->cfg_port_member(dev, i, val | cpu_port);
3956 }
57+
58+ dev->dev_ops->cfg_port_member(dev, port, port_member | cpu_port);
4059 }
4160 EXPORT_SYMBOL_GPL(ksz_update_port_member);
4261
@@ -175,12 +194,6 @@ EXPORT_SYMBOL_GPL(ksz_get_ethtool_stats); · 132 unmodified lines
175194 int ksz_port_bridge_join(struct dsa_switch *ds, int port,
176195 struct net_device *br)
177196 {
178− struct ksz_device *dev = ds->priv;
179−
180− mutex_lock(&dev->dev_mutex);
181− dev->br_member |= (1 << port);
182− mutex_unlock(&dev->dev_mutex);
183−
184197 /* port_stp_state_set() will be called after to put the port in
185198 * appropriate state so there is no need to do anything.
186199 */
@@ -192,13 +205,6 @@ EXPORT_SYMBOL_GPL(ksz_port_bridge_join); · 5 unmodified lines
192205 void ksz_port_bridge_leave(struct dsa_switch *ds, int port,
193206 struct net_device *br)
194207 {
195− struct ksz_device *dev = ds->priv;
196−
197− mutex_lock(&dev->dev_mutex);
198− dev->br_member &= ~(1 << port);
199− dev->member &= ~(1 << port);
200− mutex_unlock(&dev->dev_mutex);
201−
202208 /* port_stp_state_set() will be called after to put the port in
203209 * forwarding state so there is no need to do anything.
204210 */
drivers/net/dsa/microchip/ksz_common.h+0−4
@@ -25,8 +25,6 @@ struct ksz_port_mib { · 24 unmodified lines
2525 };
2626
2727 struct ksz_port {
28− u16 member;
29− u16 vid_member;
3028 bool remove_tag; /* Remove Tag flag set, for ksz8795 only */
3129 int stp_state;
3230 struct phy_device phydev;
@@ -83,8 +81,6 @@ struct ksz_device { · 50 unmodified lines
8381 struct ksz_port *ports;
8482 struct delayed_work mib_read;
8583 unsigned long mib_read_interval;
86− u16 br_member;
87− u16 member;
8884 u16 mirror_rx;
8985 u16 mirror_tx;
9086 u32 features; /* chip specific features */
drivers/net/dsa/mv88e6xxx/chip.c+47−38
@@ -471,6 +471,12 @@ static int mv88e6xxx_port_ppu_updates(struct mv88e6xxx_chip *chip, int port) · 470 unmodified lines
471471 u16 reg;
472472 int err;
473473
474+ /* The 88e6250 family does not have the PHY detect bit. Instead,
475+ * report whether the port is internal.
476+ */
477+ if (chip->info->family == MV88E6XXX_FAMILY_6250)
478+ return port < chip->info->num_internal_phys;
479+
474480 err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &reg);
475481 if (err) {
476482 dev_err(chip->dev,
@@ -692,44 +698,48 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, · 215 unmodified lines
692698 {
693699 struct mv88e6xxx_chip *chip = ds->priv;
694700 struct mv88e6xxx_port *p;
695− int err;
701+ int err = 0;
696702
697703 p = &chip->ports[port];
698704
699− /* FIXME: is this the correct test? If we're in fixed mode on an
700− * internal port, why should we process this any different from
701− * PHY mode? On the other hand, the port may be automedia between
702− * an internal PHY and the serdes...
703− */
704− if ((mode == MLO_AN_PHY) && mv88e6xxx_phy_is_internal(ds, port))
705− return;
706−
707705 mv88e6xxx_reg_lock(chip);
708− /* In inband mode, the link may come up at any time while the link
709− * is not forced down. Force the link down while we reconfigure the
710− * interface mode.
711− */
712− if (mode == MLO_AN_INBAND && p->interface != state->interface &&
713− chip->info->ops->port_set_link)
714− chip->info->ops->port_set_link(chip, port, LINK_FORCED_DOWN);
715−
716− err = mv88e6xxx_port_config_interface(chip, port, state->interface);
717− if (err && err != -EOPNOTSUPP)
718− goto err_unlock;
719706
720− err = mv88e6xxx_serdes_pcs_config(chip, port, mode, state->interface,
721− state->advertising);
722− /* FIXME: we should restart negotiation if something changed - which
723− * is something we get if we convert to using phylinks PCS operations.
724− */
725− if (err > 0)
726− err = 0;
707+ if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) {
708+ /* In inband mode, the link may come up at any time while the
709+ * link is not forced down. Force the link down while we
710+ * reconfigure the interface mode.
711+ */
712+ if (mode == MLO_AN_INBAND &&
713+ p->interface != state->interface &&
714+ chip->info->ops->port_set_link)
715+ chip->info->ops->port_set_link(chip, port,
716+ LINK_FORCED_DOWN);
717+
718+ err = mv88e6xxx_port_config_interface(chip, port,
719+ state->interface);
720+ if (err && err != -EOPNOTSUPP)
721+ goto err_unlock;
722+
723+ err = mv88e6xxx_serdes_pcs_config(chip, port, mode,
724+ state->interface,
725+ state->advertising);
726+ /* FIXME: we should restart negotiation if something changed -
727+ * which is something we get if we convert to using phylinks
728+ * PCS operations.
729+ */
730+ if (err > 0)
731+ err = 0;
732+ }
727733
728734 /* Undo the forced down state above after completing configuration
729− * irrespective of its state on entry, which allows the link to come up.
735+ * irrespective of its state on entry, which allows the link to come
736+ * up in the in-band case where there is no separate SERDES. Also
737+ * ensure that the link can come up if the PPU is in use and we are
738+ * in PHY mode (we treat the PPU as an effective in-band mechanism.)
730739 */
731− if (mode == MLO_AN_INBAND && p->interface != state->interface &&
732− chip->info->ops->port_set_link)
740+ if (chip->info->ops->port_set_link &&
741+ ((mode == MLO_AN_INBAND && p->interface != state->interface) ||
742+ (mode == MLO_AN_PHY && mv88e6xxx_port_ppu_updates(chip, port))))
733743 chip->info->ops->port_set_link(chip, port, LINK_UNFORCED);
734744
735745 p->interface = state->interface;
@@ -752,11 +762,10 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port, · 16 unmodified lines
752762 ops = chip->info->ops;
753763
754764 mv88e6xxx_reg_lock(chip);
755− /* Internal PHYs propagate their configuration directly to the MAC.
756− * External PHYs depend on whether the PPU is enabled for this port.
765+ /* Force the link down if we know the port may not be automatically
766+ * updated by the switch or if we are using fixed-link mode.
757767 */
758− if (((!mv88e6xxx_phy_is_internal(ds, port) &&
759− !mv88e6xxx_port_ppu_updates(chip, port)) ||
768+ if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
760769 mode == MLO_AN_FIXED) && ops->port_sync_link)
761770 err = ops->port_sync_link(chip, port, mode, false);
762771 mv88e6xxx_reg_unlock(chip);
@@ -779,11 +788,11 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, · 16 unmodified lines
779788 ops = chip->info->ops;
780789
781790 mv88e6xxx_reg_lock(chip);
782− /* Internal PHYs propagate their configuration directly to the MAC.
783− * External PHYs depend on whether the PPU is enabled for this port.
791+ /* Configure and force the link up if we know that the port may not
792+ * automatically updated by the switch or if we are using fixed-link
793+ * mode.
784794 */
785− if ((!mv88e6xxx_phy_is_internal(ds, port) &&
786− !mv88e6xxx_port_ppu_updates(chip, port)) ||
795+ if (!mv88e6xxx_port_ppu_updates(chip, port) ||
787796 mode == MLO_AN_FIXED) {
788797 /* FIXME: for an automedia port, should we force the link
789798 * down here - what if the link comes up due to "other" media
drivers/net/dsa/mv88e6xxx/serdes.c+227−33
@@ -50,11 +50,22 @@ static int mv88e6390_serdes_write(struct mv88e6xxx_chip *chip, · 49 unmodified lines
5050 }
5151
5252 static int mv88e6xxx_serdes_pcs_get_state(struct mv88e6xxx_chip *chip,
53− u16 status, u16 lpa,
53+ u16 ctrl, u16 status, u16 lpa,
5454 struct phylink_link_state *state)
5555 {
56+ state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK);
57+
5658 if (status & MV88E6390_SGMII_PHY_STATUS_SPD_DPL_VALID) {
57− state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK);
59+ /* The Spped and Duplex Resolved register is 1 if AN is enabled
60+ * and complete, or if AN is disabled. So with disabled AN we
61+ * still get here on link up. But we want to set an_complete
62+ * only if AN was enabled, thus we look at BMCR_ANENABLE.
63+ * (According to 802.3-2008 section 22.2.4.2.10, we should be
64+ * able to get this same value from BMSR_ANEGCAPABLE, but tests
65+ * show that these Marvell PHYs don't conform to this part of
66+ * the specificaion - BMSR_ANEGCAPABLE is simply always 1.)
67+ */
68+ state->an_complete = !!(ctrl & BMCR_ANENABLE);
5869 state->duplex = status &
5970 MV88E6390_SGMII_PHY_STATUS_DUPLEX_FULL ?
6071 DUPLEX_FULL : DUPLEX_HALF;
@@ -81,6 +92,18 @@ static int mv88e6xxx_serdes_pcs_get_state(struct mv88e6xxx_chip *chip, · 20 unmodified lines
8192 dev_err(chip->dev, "invalid PHY speed\n");
8293 return -EINVAL;
8394 }
95+ } else if (state->link &&
96+ state->interface != PHY_INTERFACE_MODE_SGMII) {
97+ /* If Speed and Duplex Resolved register is 0 and link is up, it
98+ * means that AN was enabled, but link partner had it disabled
99+ * and the PHY invoked the Auto-Negotiation Bypass feature and
100+ * linked anyway.
101+ */
102+ state->duplex = DUPLEX_FULL;
103+ if (state->interface == PHY_INTERFACE_MODE_2500BASEX)
104+ state->speed = SPEED_2500;
105+ else
106+ state->speed = SPEED_1000;
84107 } else {
85108 state->link = false;
86109 }
@@ -168,9 +191,15 @@ int mv88e6352_serdes_pcs_config(struct mv88e6xxx_chip *chip, int port, · 81 unmodified lines
168191 int mv88e6352_serdes_pcs_get_state(struct mv88e6xxx_chip *chip, int port,
169192 int lane, struct phylink_link_state *state)
170193 {
171− u16 lpa, status;
194+ u16 lpa, status, ctrl;
172195 int err;
173196
197+ err = mv88e6352_serdes_read(chip, MII_BMCR, &ctrl);
198+ if (err) {
199+ dev_err(chip->dev, "can't read Serdes PHY control: %d\n", err);
200+ return err;
201+ }
202+
174203 err = mv88e6352_serdes_read(chip, 0x11, &status);
175204 if (err) {
176205 dev_err(chip->dev, "can't read Serdes PHY status: %d\n", err);
@@ -183,7 +212,7 @@ int mv88e6352_serdes_pcs_get_state(struct mv88e6xxx_chip *chip, int port, · 6 unmodified lines
183212 return err;
184213 }
185214
186− return mv88e6xxx_serdes_pcs_get_state(chip, status, lpa, state);
215+ return mv88e6xxx_serdes_pcs_get_state(chip, ctrl, status, lpa, state);
187216 }
188217
189218 int mv88e6352_serdes_pcs_an_restart(struct mv88e6xxx_chip *chip, int port,
@@ -801,7 +830,7 @@ int mv88e6390_serdes_power(struct mv88e6xxx_chip *chip, int port, int lane, · 611 unmodified lines
801830 bool up)
802831 {
803832 u8 cmode = chip->ports[port].cmode;
804− int err = 0;
833+ int err;
805834
806835 switch (cmode) {
807836 case MV88E6XXX_PORT_STS_CMODE_SGMII:
@@ -813,6 +842,9 @@ int mv88e6390_serdes_power(struct mv88e6xxx_chip *chip, int port, int lane, · 5 unmodified lines
813842 case MV88E6XXX_PORT_STS_CMODE_RXAUI:
814843 err = mv88e6390_serdes_power_10g(chip, lane, up);
815844 break;
845+ default:
846+ err = -EINVAL;
847+ break;
816848 }
817849
818850 if (!err && up)
@@ -883,9 +915,16 @@ int mv88e6390_serdes_pcs_config(struct mv88e6xxx_chip *chip, int port, · 64 unmodified lines
883915 static int mv88e6390_serdes_pcs_get_state_sgmii(struct mv88e6xxx_chip *chip,
884916 int port, int lane, struct phylink_link_state *state)
885917 {
886− u16 lpa, status;
918+ u16 lpa, status, ctrl;
887919 int err;
888920
921+ err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS,
922+ MV88E6390_SGMII_BMCR, &ctrl);
923+ if (err) {
924+ dev_err(chip->dev, "can't read Serdes PHY control: %d\n", err);
925+ return err;
926+ }
927+
889928 err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS,
890929 MV88E6390_SGMII_PHY_STATUS, &status);
891930 if (err) {
@@ -900,7 +939,7 @@ static int mv88e6390_serdes_pcs_get_state_sgmii(struct mv88e6xxx_chip *chip, · 8 unmodified lines
900939 return err;
901940 }
902941
903− return mv88e6xxx_serdes_pcs_get_state(chip, status, lpa, state);
942+ return mv88e6xxx_serdes_pcs_get_state(chip, ctrl, status, lpa, state);
904943 }
905944
906945 static int mv88e6390_serdes_pcs_get_state_10g(struct mv88e6xxx_chip *chip,
@@ -1271,9 +1310,31 @@ void mv88e6390_serdes_get_regs(struct mv88e6xxx_chip *chip, int port, void *_p) · 364 unmodified lines
12711310 }
12721311 }
12731312
1274−static int mv88e6393x_serdes_port_errata(struct mv88e6xxx_chip *chip, int lane)
1313+static int mv88e6393x_serdes_power_lane(struct mv88e6xxx_chip *chip, int lane,
1314+ bool on)
12751315 {
1276− u16 reg, pcs;
1316+ u16 reg;
1317+ int err;
1318+
1319+ err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS,
1320+ MV88E6393X_SERDES_CTRL1, &reg);
1321+ if (err)
1322+ return err;
1323+
1324+ if (on)
1325+ reg &= ~(MV88E6393X_SERDES_CTRL1_TX_PDOWN |
1326+ MV88E6393X_SERDES_CTRL1_RX_PDOWN);
1327+ else
1328+ reg |= MV88E6393X_SERDES_CTRL1_TX_PDOWN |
1329+ MV88E6393X_SERDES_CTRL1_RX_PDOWN;
1330+
1331+ return mv88e6390_serdes_write(chip, lane, MDIO_MMD_PHYXS,
1332+ MV88E6393X_SERDES_CTRL1, reg);
1333+}
1334+
1335+static int mv88e6393x_serdes_erratum_4_6(struct mv88e6xxx_chip *chip, int lane)
1336+{
1337+ u16 reg;
12771338 int err;
12781339
12791340 /* mv88e6393x family errata 4.6:
@@ -1284,26 +1345,45 @@ static int mv88e6393x_serdes_port_errata(struct mv88e6xxx_chip *chip, int lane) · 4 unmodified lines
12841345 * It seems that after this workaround the SERDES is automatically
12851346 * powered up (the bit is cleared), so power it down.
12861347 */
1287− if (lane == MV88E6393X_PORT0_LANE || lane == MV88E6393X_PORT9_LANE ||
1288− lane == MV88E6393X_PORT10_LANE) {
1289− err = mv88e6390_serdes_read(chip, lane,
1290− MDIO_MMD_PHYXS,
1291− MV88E6393X_SERDES_POC, &reg);
1292− if (err)
1293− return err;
1348+ err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS,
1349+ MV88E6393X_SERDES_POC, &reg);
1350+ if (err)
1351+ return err;
12941352
1295− reg &= ~MV88E6393X_SERDES_POC_PDOWN;
1296− reg |= MV88E6393X_SERDES_POC_RESET;
1353+ reg &= ~MV88E6393X_SERDES_POC_PDOWN;
1354+ reg |= MV88E6393X_SERDES_POC_RESET;
12971355
1298− err = mv88e6390_serdes_write(chip, lane, MDIO_MMD_PHYXS,
1299− MV88E6393X_SERDES_POC, reg);
1300− if (err)
1301− return err;
1356+ err = mv88e6390_serdes_write(chip, lane, MDIO_MMD_PHYXS,
1357+ MV88E6393X_SERDES_POC, reg);
1358+ if (err)
1359+ return err;
13021360
1303− err = mv88e6390_serdes_power_sgmii(chip, lane, false);
1304− if (err)
1305− return err;
1306− }
1361+ err = mv88e6390_serdes_power_sgmii(chip, lane, false);
1362+ if (err)
1363+ return err;
1364+
1365+ return mv88e6393x_serdes_power_lane(chip, lane, false);
1366+}
1367+
1368+int mv88e6393x_serdes_setup_errata(struct mv88e6xxx_chip *chip)
1369+{
1370+ int err;
1371+
1372+ err = mv88e6393x_serdes_erratum_4_6(chip, MV88E6393X_PORT0_LANE);
1373+ if (err)
1374+ return err;
1375+
1376+ err = mv88e6393x_serdes_erratum_4_6(chip, MV88E6393X_PORT9_LANE);
1377+ if (err)
1378+ return err;
1379+
1380+ return mv88e6393x_serdes_erratum_4_6(chip, MV88E6393X_PORT10_LANE);
1381+}
1382+
1383+static int mv88e6393x_serdes_erratum_4_8(struct mv88e6xxx_chip *chip, int lane)
1384+{
1385+ u16 reg, pcs;
1386+ int err;
13071387
13081388 /* mv88e6393x family errata 4.8:
13091389 * When a SERDES port is operating in 1000BASE-X or SGMII mode link may
@@ -1334,38 +1414,152 @@ static int mv88e6393x_serdes_port_errata(struct mv88e6xxx_chip *chip, int lane) · 24 unmodified lines
13341414 MV88E6393X_ERRATA_4_8_REG, reg);
13351415 }
13361416
1337−int mv88e6393x_serdes_setup_errata(struct mv88e6xxx_chip *chip)
1417+static int mv88e6393x_serdes_erratum_5_2(struct mv88e6xxx_chip *chip, int lane,
1418+ u8 cmode)
1419+{
1420+ static const struct {
1421+ u16 dev, reg, val, mask;
1422+ } fixes[] = {
1423+ { MDIO_MMD_VEND1, 0x8093, 0xcb5a, 0xffff },
1424+ { MDIO_MMD_VEND1, 0x8171, 0x7088, 0xffff },
1425+ { MDIO_MMD_VEND1, 0x80c9, 0x311a, 0xffff },
1426+ { MDIO_MMD_VEND1, 0x80a2, 0x8000, 0xff7f },
1427+ { MDIO_MMD_VEND1, 0x80a9, 0x0000, 0xfff0 },
1428+ { MDIO_MMD_VEND1, 0x80a3, 0x0000, 0xf8ff },
1429+ { MDIO_MMD_PHYXS, MV88E6393X_SERDES_POC,
1430+ MV88E6393X_SERDES_POC_RESET, MV88E6393X_SERDES_POC_RESET },
1431+ };
1432+ int err, i;
1433+ u16 reg;
1434+
1435+ /* mv88e6393x family errata 5.2:
1436+ * For optimal signal integrity the following sequence should be applied
1437+ * to SERDES operating in 10G mode. These registers only apply to 10G
1438+ * operation and have no effect on other speeds.
1439+ */
1440+ if (cmode != MV88E6393X_PORT_STS_CMODE_10GBASER)
1441+ return 0;
1442+
1443+ for (i = 0; i < ARRAY_SIZE(fixes); ++i) {
1444+ err = mv88e6390_serdes_read(chip, lane, fixes[i].dev,
1445+ fixes[i].reg, &reg);
1446+ if (err)
1447+ return err;
1448+
1449+ reg &= ~fixes[i].mask;
1450+ reg |= fixes[i].val;
1451+
1452+ err = mv88e6390_serdes_write(chip, lane, fixes[i].dev,
1453+ fixes[i].reg, reg);
1454+ if (err)
1455+ return err;
1456+ }
1457+
1458+ return 0;
1459+}
1460+
1461+static int mv88e6393x_serdes_fix_2500basex_an(struct mv88e6xxx_chip *chip,
1462+ int lane, u8 cmode, bool on)
13381463 {
1464+ u16 reg;
13391465 int err;
13401466
1341− err = mv88e6393x_serdes_port_errata(chip, MV88E6393X_PORT0_LANE);
1467+ if (cmode != MV88E6XXX_PORT_STS_CMODE_2500BASEX)
1468+ return 0;
1469+
1470+ /* Inband AN is broken on Amethyst in 2500base-x mode when set by
1471+ * standard mechanism (via cmode).
1472+ * We can get around this by configuring the PCS mode to 1000base-x
1473+ * and then writing value 0x58 to register 1e.8000. (This must be done
1474+ * while SerDes receiver and transmitter are disabled, which is, when
1475+ * this function is called.)
1476+ * It seem that when we do this configuration to 2500base-x mode (by
1477+ * changing PCS mode to 1000base-x and frequency to 3.125 GHz from
1478+ * 1.25 GHz) and then configure to sgmii or 1000base-x, the device
1479+ * thinks that it already has SerDes at 1.25 GHz and does not change
1480+ * the 1e.8000 register, leaving SerDes at 3.125 GHz.
1481+ * To avoid this, change PCS mode back to 2500base-x when disabling
1482+ * SerDes from 2500base-x mode.
1483+ */
1484+ err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS,
1485+ MV88E6393X_SERDES_POC, &reg);
1486+ if (err)
1487+ return err;
1488+
1489+ reg &= ~(MV88E6393X_SERDES_POC_PCS_MASK | MV88E6393X_SERDES_POC_AN);
1490+ if (on)
1491+ reg |= MV88E6393X_SERDES_POC_PCS_1000BASEX |
1492+ MV88E6393X_SERDES_POC_AN;
1493+ else
1494+ reg |= MV88E6393X_SERDES_POC_PCS_2500BASEX;
1495+ reg |= MV88E6393X_SERDES_POC_RESET;
1496+
1497+ err = mv88e6390_serdes_write(chip, lane, MDIO_MMD_PHYXS,
1498+ MV88E6393X_SERDES_POC, reg);
13421499 if (err)
13431500 return err;
13441501
1345− err = mv88e6393x_serdes_port_errata(chip, MV88E6393X_PORT9_LANE);
1502+ err = mv88e6390_serdes_write(chip, lane, MDIO_MMD_VEND1, 0x8000, 0x58);
13461503 if (err)
13471504 return err;
13481505
1349− return mv88e6393x_serdes_port_errata(chip, MV88E6393X_PORT10_LANE);
1506+ return 0;
13501507 }
13511508
13521509 int mv88e6393x_serdes_power(struct mv88e6xxx_chip *chip, int port, int lane,
13531510 bool on)
13541511 {
13551512 u8 cmode = chip->ports[port].cmode;
1513+ int err;
13561514
13571515 if (port != 0 && port != 9 && port != 10)
13581516 return -EOPNOTSUPP;
13591517
1518+ if (on) {
1519+ err = mv88e6393x_serdes_erratum_4_8(chip, lane);
1520+ if (err)
1521+ return err;
1522+
1523+ err = mv88e6393x_serdes_erratum_5_2(chip, lane, cmode);
1524+ if (err)
1525+ return err;
1526+
1527+ err = mv88e6393x_serdes_fix_2500basex_an(chip, lane, cmode,
1528+ true);
1529+ if (err)
1530+ return err;
1531+
1532+ err = mv88e6393x_serdes_power_lane(chip, lane, true);
1533+ if (err)
1534+ return err;
1535+ }
1536+
13601537 switch (cmode) {
13611538 case MV88E6XXX_PORT_STS_CMODE_SGMII:
13621539 case MV88E6XXX_PORT_STS_CMODE_1000BASEX:
13631540 case MV88E6XXX_PORT_STS_CMODE_2500BASEX:
1364− return mv88e6390_serdes_power_sgmii(chip, lane, on);
1541+ err = mv88e6390_serdes_power_sgmii(chip, lane, on);
1542+ break;
13651543 case MV88E6393X_PORT_STS_CMODE_5GBASER:
13661544 case MV88E6393X_PORT_STS_CMODE_10GBASER:
1367− return mv88e6390_serdes_power_10g(chip, lane, on);
1545+ err = mv88e6390_serdes_power_10g(chip, lane, on);
1546+ break;
1547+ default:
1548+ err = -EINVAL;
1549+ break;
13681550 }
13691551
1370− return 0;
1552+ if (err)
1553+ return err;
1554+
1555+ if (!on) {
1556+ err = mv88e6393x_serdes_power_lane(chip, lane, false);
1557+ if (err)
1558+ return err;
1559+
1560+ err = mv88e6393x_serdes_fix_2500basex_an(chip, lane, cmode,
1561+ false);
1562+ }
1563+
1564+ return err;
13711565 }
drivers/net/dsa/mv88e6xxx/serdes.h+4−0
@@ -93,6 +93,10 @@ · 92 unmodified lines
9393 #define MV88E6393X_SERDES_POC_PCS_MASK 0x0007
9494 #define MV88E6393X_SERDES_POC_RESET BIT(15)
9595 #define MV88E6393X_SERDES_POC_PDOWN BIT(5)
96+#define MV88E6393X_SERDES_POC_AN BIT(3)
97+#define MV88E6393X_SERDES_CTRL1 0xf003
98+#define MV88E6393X_SERDES_CTRL1_TX_PDOWN BIT(9)
99+#define MV88E6393X_SERDES_CTRL1_RX_PDOWN BIT(8)
96100
97101 #define MV88E6393X_ERRATA_4_8_REG 0xF074
98102 #define MV88E6393X_ERRATA_4_8_BIT BIT(14)
drivers/net/dsa/ocelot/felix.c+4−1
@@ -290,8 +290,11 @@ static int felix_setup_mmio_filtering(struct felix *felix) · 289 unmodified lines
290290 }
291291 }
292292
293− if (cpu < 0)
293+ if (cpu < 0) {
294+ kfree(tagging_rule);
295+ kfree(redirect_rule);
294296 return -EINVAL;
297+ }
295298
296299 tagging_rule->key_type = OCELOT_VCAP_KEY_ETYPE;
297300 *(__be16 *)tagging_rule->key.etype.etype.value = htons(ETH_P_1588);
drivers/net/dsa/qca8k.c+11−7
@@ -1256,8 +1256,12 @@ qca8k_setup(struct dsa_switch *ds) · 1255 unmodified lines
12561256 /* Set initial MTU for every port.
12571257 * We have only have a general MTU setting. So track
12581258 * every port and set the max across all port.
1259+ * Set per port MTU to 1500 as the MTU change function
1260+ * will add the overhead and if its set to 1518 then it
1261+ * will apply the overhead again and we will end up with
1262+ * MTU of 1536 instead of 1518
12591263 */
1260− priv->port_mtu[i] = ETH_FRAME_LEN + ETH_FCS_LEN;
1264+ priv->port_mtu[i] = ETH_DATA_LEN;
12611265 }
12621266
12631267 /* Special GLOBAL_FC_THRESH value are needed for ar8327 switch */
@@ -1433,6 +1437,12 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, · 169 unmodified lines
14331437
14341438 qca8k_write(priv, QCA8K_REG_SGMII_CTRL, val);
14351439
1440+ /* From original code is reported port instability as SGMII also
1441+ * require delay set. Apply advised values here or take them from DT.
1442+ */
1443+ if (state->interface == PHY_INTERFACE_MODE_SGMII)
1444+ qca8k_mac_config_setup_internal_delay(priv, cpu_port_index, reg);
1445+
14361446 /* For qca8327/qca8328/qca8334/qca8338 sgmii is unique and
14371447 * falling edge is set writing in the PORT0 PAD reg
14381448 */
@@ -1455,12 +1465,6 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, · 16 unmodified lines
14551465 QCA8K_PORT0_PAD_SGMII_TXCLK_FALLING_EDGE,
14561466 val);
14571467
1458− /* From original code is reported port instability as SGMII also
1459− * require delay set. Apply advised values here or take them from DT.
1460− */
1461− if (state->interface == PHY_INTERFACE_MODE_SGMII)
1462− qca8k_mac_config_setup_internal_delay(priv, cpu_port_index, reg);
1463−
14641468 break;
14651469 default:
14661470 dev_err(ds->dev, "xMII mode %s not supported for port %d\n",
drivers/net/dsa/rtl8365mb.c+8−1
@@ -107,6 +107,7 @@ · 106 unmodified lines
107107 #define RTL8365MB_LEARN_LIMIT_MAX_8365MB_VC 2112
108108
109109 /* Family-specific data and limits */
110+#define RTL8365MB_PHYADDRMAX 7
110111 #define RTL8365MB_NUM_PHYREGS 32
111112 #define RTL8365MB_PHYREGMAX (RTL8365MB_NUM_PHYREGS - 1)
112113 #define RTL8365MB_MAX_NUM_PORTS (RTL8365MB_CPU_PORT_NUM_8365MB_VC + 1)
@@ -176,7 +177,7 @@ · 63 unmodified lines
176177 #define RTL8365MB_INDIRECT_ACCESS_STATUS_REG 0x1F01
177178 #define RTL8365MB_INDIRECT_ACCESS_ADDRESS_REG 0x1F02
178179 #define RTL8365MB_INDIRECT_ACCESS_ADDRESS_OCPADR_5_1_MASK GENMASK(4, 0)
179−#define RTL8365MB_INDIRECT_ACCESS_ADDRESS_PHYNUM_MASK GENMASK(6, 5)
180+#define RTL8365MB_INDIRECT_ACCESS_ADDRESS_PHYNUM_MASK GENMASK(7, 5)
180181 #define RTL8365MB_INDIRECT_ACCESS_ADDRESS_OCPADR_9_6_MASK GENMASK(11, 8)
181182 #define RTL8365MB_PHY_BASE 0x2000
182183 #define RTL8365MB_INDIRECT_ACCESS_WRITE_DATA_REG 0x1F03
@@ -679,6 +680,9 @@ static int rtl8365mb_phy_read(struct realtek_smi *smi, int phy, int regnum) · 496 unmodified lines
679680 u16 val;
680681 int ret;
681682
683+ if (phy > RTL8365MB_PHYADDRMAX)
684+ return -EINVAL;
685+
682686 if (regnum > RTL8365MB_PHYREGMAX)
683687 return -EINVAL;
684688
@@ -704,6 +708,9 @@ static int rtl8365mb_phy_write(struct realtek_smi *smi, int phy, int regnum, · 19 unmodified lines
704708 u32 ocp_addr;
705709 int ret;
706710
711+ if (phy > RTL8365MB_PHYADDRMAX)
712+ return -EINVAL;
713+
707714 if (regnum > RTL8365MB_PHYREGMAX)
708715 return -EINVAL;
709716
drivers/net/ethernet/altera/altera_tse_main.c+6−3
@@ -1430,16 +1430,19 @@ static int altera_tse_probe(struct platform_device *pdev) · 1429 unmodified lines
14301430 priv->rxdescmem_busaddr = dma_res->start;
14311431
14321432 } else {
1433+ ret = -ENODEV;
14331434 goto err_free_netdev;
14341435 }
14351436
1436− if (!dma_set_mask(priv->device, DMA_BIT_MASK(priv->dmaops->dmamask)))
1437+ if (!dma_set_mask(priv->device, DMA_BIT_MASK(priv->dmaops->dmamask))) {
14371438 dma_set_coherent_mask(priv->device,
14381439 DMA_BIT_MASK(priv->dmaops->dmamask));
1439− else if (!dma_set_mask(priv->device, DMA_BIT_MASK(32)))
1440+ } else if (!dma_set_mask(priv->device, DMA_BIT_MASK(32))) {
14401441 dma_set_coherent_mask(priv->device, DMA_BIT_MASK(32));
1441− else
1442+ } else {
1443+ ret = -EIO;
14421444 goto err_free_netdev;
1445+ }
14431446
14441447 /* MAC address space */
14451448 ret = request_and_map(pdev, "control_port", &control_port,
drivers/net/ethernet/aquantia/atlantic/aq_common.h+14−13
@@ -40,10 +40,12 @@ · 39 unmodified lines
4040
4141 #define AQ_DEVICE_ID_AQC113DEV 0x00C0
4242 #define AQ_DEVICE_ID_AQC113CS 0x94C0
43+#define AQ_DEVICE_ID_AQC113CA 0x34C0
4344 #define AQ_DEVICE_ID_AQC114CS 0x93C0
4445 #define AQ_DEVICE_ID_AQC113 0x04C0
4546 #define AQ_DEVICE_ID_AQC113C 0x14C0
4647 #define AQ_DEVICE_ID_AQC115C 0x12C0
48+#define AQ_DEVICE_ID_AQC116C 0x11C0
4749
4850 #define HW_ATL_NIC_NAME "Marvell (aQuantia) AQtion 10Gbit Network Adapter"
4951
@@ -53,20 +55,19 @@ · 3 unmodified lines
5355
5456 #define AQ_NIC_RATE_10G BIT(0)
5557 #define AQ_NIC_RATE_5G BIT(1)
56−#define AQ_NIC_RATE_5GSR BIT(2)
57−#define AQ_NIC_RATE_2G5 BIT(3)
58−#define AQ_NIC_RATE_1G BIT(4)
59−#define AQ_NIC_RATE_100M BIT(5)
60−#define AQ_NIC_RATE_10M BIT(6)
61−#define AQ_NIC_RATE_1G_HALF BIT(7)
62−#define AQ_NIC_RATE_100M_HALF BIT(8)
63−#define AQ_NIC_RATE_10M_HALF BIT(9)
58+#define AQ_NIC_RATE_2G5 BIT(2)
59+#define AQ_NIC_RATE_1G BIT(3)
60+#define AQ_NIC_RATE_100M BIT(4)
61+#define AQ_NIC_RATE_10M BIT(5)
62+#define AQ_NIC_RATE_1G_HALF BIT(6)
63+#define AQ_NIC_RATE_100M_HALF BIT(7)
64+#define AQ_NIC_RATE_10M_HALF BIT(8)
6465
65−#define AQ_NIC_RATE_EEE_10G BIT(10)
66−#define AQ_NIC_RATE_EEE_5G BIT(11)
67−#define AQ_NIC_RATE_EEE_2G5 BIT(12)
68−#define AQ_NIC_RATE_EEE_1G BIT(13)
69−#define AQ_NIC_RATE_EEE_100M BIT(14)
66+#define AQ_NIC_RATE_EEE_10G BIT(9)
67+#define AQ_NIC_RATE_EEE_5G BIT(10)
68+#define AQ_NIC_RATE_EEE_2G5 BIT(11)
69+#define AQ_NIC_RATE_EEE_1G BIT(12)
70+#define AQ_NIC_RATE_EEE_100M BIT(13)
7071 #define AQ_NIC_RATE_EEE_MSK (AQ_NIC_RATE_EEE_10G |\
7172 AQ_NIC_RATE_EEE_5G |\
7273 AQ_NIC_RATE_EEE_2G5 |\
drivers/net/ethernet/aquantia/atlantic/aq_hw.h+2−0
@@ -80,6 +80,8 @@ struct aq_hw_link_status_s { · 79 unmodified lines
8080 };
8181
8282 struct aq_stats_s {
83+ u64 brc;
84+ u64 btc;
8385 u64 uprc;
8486 u64 mprc;
8587 u64 bprc;
drivers/net/ethernet/aquantia/atlantic/aq_nic.c+22−12
@@ -316,18 +316,22 @@ int aq_nic_ndev_register(struct aq_nic_s *self) · 315 unmodified lines
316316 aq_macsec_init(self);
317317 #endif
318318
319− mutex_lock(&self->fwreq_mutex);
320− err = self->aq_fw_ops->get_mac_permanent(self->aq_hw, addr);
321− mutex_unlock(&self->fwreq_mutex);
322− if (err)
323− goto err_exit;
319+ if (platform_get_ethdev_address(&self->pdev->dev, self->ndev) != 0) {
320+ // If DT has none or an invalid one, ask device for MAC address
321+ mutex_lock(&self->fwreq_mutex);
322+ err = self->aq_fw_ops->get_mac_permanent(self->aq_hw, addr);
323+ mutex_unlock(&self->fwreq_mutex);
324324
325− eth_hw_addr_set(self->ndev, addr);
325+ if (err)
326+ goto err_exit;
326327
327− if (!is_valid_ether_addr(self->ndev->dev_addr) ||
328− !aq_nic_is_valid_ether_addr(self->ndev->dev_addr)) {
329− netdev_warn(self->ndev, "MAC is invalid, will use random.");
330− eth_hw_addr_random(self->ndev);
328+ if (is_valid_ether_addr(addr) &&
329+ aq_nic_is_valid_ether_addr(addr)) {
330+ eth_hw_addr_set(self->ndev, addr);
331+ } else {
332+ netdev_warn(self->ndev, "MAC is invalid, will use random.");
333+ eth_hw_addr_random(self->ndev);
334+ }
331335 }
332336
333337 #if defined(AQ_CFG_MAC_ADDR_PERMANENT)
@@ -905,8 +909,14 @@ u64 *aq_nic_get_stats(struct aq_nic_s *self, u64 *data) · 571 unmodified lines
905909 data[++i] = stats->mbtc;
906910 data[++i] = stats->bbrc;
907911 data[++i] = stats->bbtc;
908− data[++i] = stats->ubrc + stats->mbrc + stats->bbrc;
909− data[++i] = stats->ubtc + stats->mbtc + stats->bbtc;
912+ if (stats->brc)
913+ data[++i] = stats->brc;
914+ else
915+ data[++i] = stats->ubrc + stats->mbrc + stats->bbrc;
916+ if (stats->btc)
917+ data[++i] = stats->btc;
918+ else
919+ data[++i] = stats->ubtc + stats->mbtc + stats->bbtc;
910920 data[++i] = stats->dma_pkt_rc;
911921 data[++i] = stats->dma_pkt_tc;
912922 data[++i] = stats->dma_oct_rc;
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c+6−1
@@ -49,6 +49,8 @@ static const struct pci_device_id aq_pci_tbl[] = { · 48 unmodified lines
4949 { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC113), },
5050 { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC113C), },
5151 { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC115C), },
52+ { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC113CA), },
53+ { PCI_VDEVICE(AQUANTIA, AQ_DEVICE_ID_AQC116C), },
5254
5355 {}
5456 };
@@ -85,7 +87,10 @@ static const struct aq_board_revision_s hw_atl_boards[] = { · 30 unmodified lines
8587 { AQ_DEVICE_ID_AQC113CS, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, },
8688 { AQ_DEVICE_ID_AQC114CS, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, },
8789 { AQ_DEVICE_ID_AQC113C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, },
88− { AQ_DEVICE_ID_AQC115C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, },
90+ { AQ_DEVICE_ID_AQC115C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc115c, },
91+ { AQ_DEVICE_ID_AQC113CA, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc113, },
92+ { AQ_DEVICE_ID_AQC116C, AQ_HWREV_ANY, &hw_atl2_ops, &hw_atl2_caps_aqc116c, },
93+
8994 };
9095
9196 MODULE_DEVICE_TABLE(pci, aq_pci_tbl);
drivers/net/ethernet/aquantia/atlantic/aq_ring.c+2−1
@@ -298,13 +298,14 @@ bool aq_ring_tx_clean(struct aq_ring_s *self) · 297 unmodified lines
298298 }
299299 }
300300
301− if (unlikely(buff->is_eop)) {
301+ if (unlikely(buff->is_eop && buff->skb)) {
302302 u64_stats_update_begin(&self->stats.tx.syncp);
303303 ++self->stats.tx.packets;
304304 self->stats.tx.bytes += buff->skb->len;
305305 u64_stats_update_end(&self->stats.tx.syncp);
306306
307307 dev_kfree_skb_any(buff->skb);
308+ buff->skb = NULL;
308309 }
309310 buff->pa = 0U;
310311 buff->eop_index = 0xffffU;
drivers/net/ethernet/aquantia/atlantic/aq_vec.c+0−3
@@ -362,9 +362,6 @@ unsigned int aq_vec_get_sw_stats(struct aq_vec_s *self, const unsigned int tc, u · 361 unmodified lines
362362 {
363363 unsigned int count;
364364
365− WARN_ONCE(!aq_vec_is_valid_tc(self, tc),
366− "Invalid tc %u (#rx=%u, #tx=%u)\n",
367− tc, self->rx_rings, self->tx_rings);
368365 if (!aq_vec_is_valid_tc(self, tc))
369366 return 0;
370367
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c+23−2
@@ -559,6 +559,11 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self, · 558 unmodified lines
559559 goto err_exit;
560560
561561 if (fw.len == 0xFFFFU) {
562+ if (sw.len > sizeof(self->rpc)) {
563+ printk(KERN_INFO "Invalid sw len: %x\n", sw.len);
564+ err = -EINVAL;
565+ goto err_exit;
566+ }
562567 err = hw_atl_utils_fw_rpc_call(self, sw.len);
563568 if (err < 0)
564569 goto err_exit;
@@ -567,6 +572,11 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self, · 2 unmodified lines
567572
568573 if (rpc) {
569574 if (fw.len) {
575+ if (fw.len > sizeof(self->rpc)) {
576+ printk(KERN_INFO "Invalid fw len: %x\n", fw.len);
577+ err = -EINVAL;
578+ goto err_exit;
579+ }
570580 err =
571581 hw_atl_utils_fw_downld_dwords(self,
572582 self->rpc_addr,
@@ -857,12 +867,20 @@ static int hw_atl_fw1x_deinit(struct aq_hw_s *self) · 284 unmodified lines
857867 int hw_atl_utils_update_stats(struct aq_hw_s *self)
858868 {
859869 struct aq_stats_s *cs = &self->curr_stats;
870+ struct aq_stats_s curr_stats = *cs;
860871 struct hw_atl_utils_mbox mbox;
872+ bool corrupted_stats = false;
861873
862874 hw_atl_utils_mpi_read_stats(self, &mbox);
863875
864−#define AQ_SDELTA(_N_) (self->curr_stats._N_ += \
865− mbox.stats._N_ - self->last_stats._N_)
876+#define AQ_SDELTA(_N_) \
877+do { \
878+ if (!corrupted_stats && \
879+ ((s64)(mbox.stats._N_ - self->last_stats._N_)) >= 0) \
880+ curr_stats._N_ += mbox.stats._N_ - self->last_stats._N_; \
881+ else \
882+ corrupted_stats = true; \
883+} while (0)
866884
867885 if (self->aq_link_status.mbps) {
868886 AQ_SDELTA(uprc);
@@ -882,6 +900,9 @@ int hw_atl_utils_update_stats(struct aq_hw_s *self) · 13 unmodified lines
882900 AQ_SDELTA(bbrc);
883901 AQ_SDELTA(bbtc);
884902 AQ_SDELTA(dpc);
903+
904+ if (!corrupted_stats)
905+ *cs = curr_stats;
885906 }
886907 #undef AQ_SDELTA
887908
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c+0−3
@@ -132,9 +132,6 @@ static enum hw_atl_fw2x_rate link_speed_mask_2fw2x_ratemask(u32 speed) · 131 unmodified lines
132132 if (speed & AQ_NIC_RATE_5G)
133133 rate |= FW2X_RATE_5G;
134134
135− if (speed & AQ_NIC_RATE_5GSR)
136− rate |= FW2X_RATE_5G;
137−
138135 if (speed & AQ_NIC_RATE_2G5)
139136 rate |= FW2X_RATE_2G5;
140137
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c+18−4
@@ -65,11 +65,25 @@ const struct aq_hw_caps_s hw_atl2_caps_aqc113 = { · 64 unmodified lines
6565 AQ_NIC_RATE_5G |
6666 AQ_NIC_RATE_2G5 |
6767 AQ_NIC_RATE_1G |
68− AQ_NIC_RATE_1G_HALF |
6968 AQ_NIC_RATE_100M |
70− AQ_NIC_RATE_100M_HALF |
71− AQ_NIC_RATE_10M |
72− AQ_NIC_RATE_10M_HALF,
69+ AQ_NIC_RATE_10M,
70+};
71+
72+const struct aq_hw_caps_s hw_atl2_caps_aqc115c = {
73+ DEFAULT_BOARD_BASIC_CAPABILITIES,
74+ .media_type = AQ_HW_MEDIA_TYPE_TP,
75+ .link_speed_msk = AQ_NIC_RATE_2G5 |
76+ AQ_NIC_RATE_1G |
77+ AQ_NIC_RATE_100M |
78+ AQ_NIC_RATE_10M,
79+};
80+
81+const struct aq_hw_caps_s hw_atl2_caps_aqc116c = {
82+ DEFAULT_BOARD_BASIC_CAPABILITIES,
83+ .media_type = AQ_HW_MEDIA_TYPE_TP,
84+ .link_speed_msk = AQ_NIC_RATE_1G |
85+ AQ_NIC_RATE_100M |
86+ AQ_NIC_RATE_10M,
7387 };
7488
7589 static u32 hw_atl2_sem_act_rslvr_get(struct aq_hw_s *self)
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.h+2−0
@@ -9,6 +9,8 @@ · 8 unmodified lines
99 #include "aq_common.h"
1010
1111 extern const struct aq_hw_caps_s hw_atl2_caps_aqc113;
12+extern const struct aq_hw_caps_s hw_atl2_caps_aqc115c;
13+extern const struct aq_hw_caps_s hw_atl2_caps_aqc116c;
1214 extern const struct aq_hw_ops hw_atl2_ops;
1315
1416 #endif /* HW_ATL2_H */
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils.h+34−4
@@ -239,7 +239,8 @@ struct version_s { · 238 unmodified lines
239239 u8 minor;
240240 u16 build;
241241 } phy;
242− u32 rsvd;
242+ u32 drv_iface_ver:4;
243+ u32 rsvd:28;
243244 };
244245
245246 struct link_status_s {
@@ -424,7 +425,7 @@ struct cable_diag_status_s { · 178 unmodified lines
424425 u16 rsvd2;
425426 };
426427
427−struct statistics_s {
428+struct statistics_a0_s {
428429 struct {
429430 u32 link_up;
430431 u32 link_down;
@@ -457,6 +458,33 @@ struct statistics_s { · 26 unmodified lines
457458 u32 reserve_fw_gap;
458459 };
459460
461+struct __packed statistics_b0_s {
462+ u64 rx_good_octets;
463+ u64 rx_pause_frames;
464+ u64 rx_good_frames;
465+ u64 rx_errors;
466+ u64 rx_unicast_frames;
467+ u64 rx_multicast_frames;
468+ u64 rx_broadcast_frames;
469+
470+ u64 tx_good_octets;
471+ u64 tx_pause_frames;
472+ u64 tx_good_frames;
473+ u64 tx_errors;
474+ u64 tx_unicast_frames;
475+ u64 tx_multicast_frames;
476+ u64 tx_broadcast_frames;
477+
478+ u32 main_loop_cycles;
479+};
480+
481+struct __packed statistics_s {
482+ union __packed {
483+ struct statistics_a0_s a0;
484+ struct statistics_b0_s b0;
485+ };
486+};
487+
460488 struct filter_caps_s {
461489 u8 l2_filters_base_index:6;
462490 u8 flexible_filter_mask:2;
@@ -545,7 +573,7 @@ struct management_status_s { · 82 unmodified lines
545573 u32 rsvd5;
546574 };
547575
548−struct fw_interface_out {
576+struct __packed fw_interface_out {
549577 struct transaction_counter_s transaction_id;
550578 struct version_s version;
551579 struct link_status_s link_status;
@@ -569,7 +597,6 @@ struct fw_interface_out { · 17 unmodified lines
569597 struct core_dump_s core_dump;
570598 u32 rsvd11;
571599 struct statistics_s stats;
572− u32 rsvd12;
573600 struct filter_caps_s filter_caps;
574601 struct device_caps_s device_caps;
575602 u32 rsvd13;
@@ -592,6 +619,9 @@ struct fw_interface_out { · 16 unmodified lines
592619 #define AQ_HOST_MODE_LOW_POWER 3U
593620 #define AQ_HOST_MODE_SHUTDOWN 4U
594621
622+#define AQ_A2_FW_INTERFACE_A0 0
623+#define AQ_A2_FW_INTERFACE_B0 1
624+
595625 int hw_atl2_utils_initfw(struct aq_hw_s *self, const struct aq_fw_ops **fw_ops);
596626
597627 int hw_atl2_utils_soft_reset(struct aq_hw_s *self);
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c+87−23
@@ -84,7 +84,7 @@ static int hw_atl2_shared_buffer_read_block(struct aq_hw_s *self, · 83 unmodified lines
8484 if (cnt > AQ_A2_FW_READ_TRY_MAX)
8585 return -ETIME;
8686 if (tid1.transaction_cnt_a != tid1.transaction_cnt_b)
87− udelay(1);
87+ mdelay(1);
8888 } while (tid1.transaction_cnt_a != tid1.transaction_cnt_b);
8989
9090 hw_atl2_mif_shared_buf_read(self, offset, (u32 *)data, dwords);
@@ -154,7 +154,7 @@ static void a2_link_speed_mask2fw(u32 speed, · 63 unmodified lines
154154 {
155155 link_options->rate_10G = !!(speed & AQ_NIC_RATE_10G);
156156 link_options->rate_5G = !!(speed & AQ_NIC_RATE_5G);
157− link_options->rate_N5G = !!(speed & AQ_NIC_RATE_5GSR);
157+ link_options->rate_N5G = link_options->rate_5G;
158158 link_options->rate_2P5G = !!(speed & AQ_NIC_RATE_2G5);
159159 link_options->rate_N2P5G = link_options->rate_2P5G;
160160 link_options->rate_1G = !!(speed & AQ_NIC_RATE_1G);
@@ -192,8 +192,6 @@ static u32 a2_fw_lkp_to_mask(struct lkp_link_caps_s *lkp_link_caps) · 31 unmodified lines
192192 rate |= AQ_NIC_RATE_10G;
193193 if (lkp_link_caps->rate_5G)
194194 rate |= AQ_NIC_RATE_5G;
195− if (lkp_link_caps->rate_N5G)
196− rate |= AQ_NIC_RATE_5GSR;
197195 if (lkp_link_caps->rate_2P5G)
198196 rate |= AQ_NIC_RATE_2G5;
199197 if (lkp_link_caps->rate_1G)
@@ -335,15 +333,22 @@ static int aq_a2_fw_get_mac_permanent(struct aq_hw_s *self, u8 *mac) · 135 unmodified lines
335333 return 0;
336334 }
337335
338−static int aq_a2_fw_update_stats(struct aq_hw_s *self)
336+static void aq_a2_fill_a0_stats(struct aq_hw_s *self,
337+ struct statistics_s *stats)
339338 {
340339 struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
341− struct statistics_s stats;
342−
343− hw_atl2_shared_buffer_read_safe(self, stats, &stats);
344−
345−#define AQ_SDELTA(_N_, _F_) (self->curr_stats._N_ += \
346− stats.msm._F_ - priv->last_stats.msm._F_)
340+ struct aq_stats_s *cs = &self->curr_stats;
341+ struct aq_stats_s curr_stats = *cs;
342+ bool corrupted_stats = false;
343+
344+#define AQ_SDELTA(_N, _F) \
345+do { \
346+ if (!corrupted_stats && \
347+ ((s64)(stats->a0.msm._F - priv->last_stats.a0.msm._F)) >= 0) \
348+ curr_stats._N += stats->a0.msm._F - priv->last_stats.a0.msm._F;\
349+ else \
350+ corrupted_stats = true; \
351+} while (0)
347352
348353 if (self->aq_link_status.mbps) {
349354 AQ_SDELTA(uprc, rx_unicast_frames);
@@ -362,17 +367,76 @@ static int aq_a2_fw_update_stats(struct aq_hw_s *self) · 12 unmodified lines
362367 AQ_SDELTA(mbtc, tx_multicast_octets);
363368 AQ_SDELTA(bbrc, rx_broadcast_octets);
364369 AQ_SDELTA(bbtc, tx_broadcast_octets);
370+
371+ if (!corrupted_stats)
372+ *cs = curr_stats;
365373 }
366374 #undef AQ_SDELTA
367− self->curr_stats.dma_pkt_rc =
368− hw_atl_stats_rx_dma_good_pkt_counter_get(self);
369− self->curr_stats.dma_pkt_tc =
370− hw_atl_stats_tx_dma_good_pkt_counter_get(self);
371− self->curr_stats.dma_oct_rc =
372− hw_atl_stats_rx_dma_good_octet_counter_get(self);
373− self->curr_stats.dma_oct_tc =
374− hw_atl_stats_tx_dma_good_octet_counter_get(self);
375− self->curr_stats.dpc = hw_atl_rpb_rx_dma_drop_pkt_cnt_get(self);
375+
376+}
377+
378+static void aq_a2_fill_b0_stats(struct aq_hw_s *self,
379+ struct statistics_s *stats)
380+{
381+ struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
382+ struct aq_stats_s *cs = &self->curr_stats;
383+ struct aq_stats_s curr_stats = *cs;
384+ bool corrupted_stats = false;
385+
386+#define AQ_SDELTA(_N, _F) \
387+do { \
388+ if (!corrupted_stats && \
389+ ((s64)(stats->b0._F - priv->last_stats.b0._F)) >= 0) \
390+ curr_stats._N += stats->b0._F - priv->last_stats.b0._F; \
391+ else \
392+ corrupted_stats = true; \
393+} while (0)
394+
395+ if (self->aq_link_status.mbps) {
396+ AQ_SDELTA(uprc, rx_unicast_frames);
397+ AQ_SDELTA(mprc, rx_multicast_frames);
398+ AQ_SDELTA(bprc, rx_broadcast_frames);
399+ AQ_SDELTA(erpr, rx_errors);
400+ AQ_SDELTA(brc, rx_good_octets);
401+
402+ AQ_SDELTA(uptc, tx_unicast_frames);
403+ AQ_SDELTA(mptc, tx_multicast_frames);
404+ AQ_SDELTA(bptc, tx_broadcast_frames);
405+ AQ_SDELTA(erpt, tx_errors);
406+ AQ_SDELTA(btc, tx_good_octets);
407+
408+ if (!corrupted_stats)
409+ *cs = curr_stats;
410+ }
411+#undef AQ_SDELTA
412+}
413+
414+static int aq_a2_fw_update_stats(struct aq_hw_s *self)
415+{
416+ struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
417+ struct aq_stats_s *cs = &self->curr_stats;
418+ struct statistics_s stats;
419+ struct version_s version;
420+ int err;
421+
422+ err = hw_atl2_shared_buffer_read_safe(self, version, &version);
423+ if (err)
424+ return err;
425+
426+ err = hw_atl2_shared_buffer_read_safe(self, stats, &stats);
427+ if (err)
428+ return err;
429+
430+ if (version.drv_iface_ver == AQ_A2_FW_INTERFACE_A0)
431+ aq_a2_fill_a0_stats(self, &stats);
432+ else
433+ aq_a2_fill_b0_stats(self, &stats);
434+
435+ cs->dma_pkt_rc = hw_atl_stats_rx_dma_good_pkt_counter_get(self);
436+ cs->dma_pkt_tc = hw_atl_stats_tx_dma_good_pkt_counter_get(self);
437+ cs->dma_oct_rc = hw_atl_stats_rx_dma_good_octet_counter_get(self);
438+ cs->dma_oct_tc = hw_atl_stats_tx_dma_good_octet_counter_get(self);
439+ cs->dpc = hw_atl_rpb_rx_dma_drop_pkt_cnt_get(self);
376440
377441 memcpy(&priv->last_stats, &stats, sizeof(stats));
378442
@@ -499,9 +563,9 @@ u32 hw_atl2_utils_get_fw_version(struct aq_hw_s *self) · 120 unmodified lines
499563 hw_atl2_shared_buffer_read_safe(self, version, &version);
500564
501565 /* A2 FW version is stored in reverse order */
502− return version.mac.major << 24 |
503− version.mac.minor << 16 |
504− version.mac.build;
566+ return version.bundle.major << 24 |
567+ version.bundle.minor << 16 |
568+ version.bundle.build;
505569 }
506570
507571 int hw_atl2_utils_get_action_resolve_table_caps(struct aq_hw_s *self,
drivers/net/ethernet/asix/ax88796c_main.h+3−3
@@ -127,9 +127,9 @@ struct ax88796c_device { · 126 unmodified lines
127127 #define AX_PRIV_FLAGS_MASK (AX_CAP_COMP)
128128
129129 unsigned long flags;
130− #define EVENT_INTR BIT(0)
131− #define EVENT_TX BIT(1)
132− #define EVENT_SET_MULTI BIT(2)
130+ #define EVENT_INTR 0
131+ #define EVENT_TX 1
132+ #define EVENT_SET_MULTI 2
133133
134134 };
135135
drivers/net/ethernet/asix/ax88796c_spi.c+1−1
@@ -34,7 +34,7 @@ int axspi_read_status(struct axspi_data *ax_spi, struct spi_status *status) · 33 unmodified lines
3434
3535 /* OP */
3636 ax_spi->cmd_buf[0] = AX_SPICMD_READ_STATUS;
37− ret = spi_write_then_read(ax_spi->spi, ax_spi->cmd_buf, 1, (u8 *)&status, 3);
37+ ret = spi_write_then_read(ax_spi->spi, ax_spi->cmd_buf, 1, (u8 *)status, 3);
3838 if (ret)
3939 dev_err(&ax_spi->spi->dev, "%s() failed: ret = %d\n", __func__, ret);
4040 else
drivers/net/ethernet/broadcom/bcm4908_enet.c+3−1
@@ -708,7 +708,9 @@ static int bcm4908_enet_probe(struct platform_device *pdev) · 707 unmodified lines
708708
709709 enet->irq_tx = platform_get_irq_byname(pdev, "tx");
710710
711− dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
711+ err = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
712+ if (err)
713+ return err;
712714
713715 err = bcm4908_enet_dma_alloc(enet);
714716 if (err)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h+3−1
@@ -635,11 +635,13 @@ static int bnx2x_ilt_client_mem_op(struct bnx2x *bp, int cli_num, · 634 unmodified lines
635635 {
636636 int i, rc;
637637 struct bnx2x_ilt *ilt = BP_ILT(bp);
638− struct ilt_client_info *ilt_cli = &ilt->clients[cli_num];
638+ struct ilt_client_info *ilt_cli;
639639
640640 if (!ilt || !ilt->lines)
641641 return -1;
642642
643+ ilt_cli = &ilt->clients[cli_num];
644+
643645 if (ilt_cli->flags & (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM))
644646 return 0;
645647
drivers/net/ethernet/broadcom/bnxt/bnxt.h+10−0
@@ -2258,6 +2258,16 @@ static inline void bnxt_db_write(struct bnxt *bp, struct bnxt_db_info *db, · 2257 unmodified lines
22582258 }
22592259 }
22602260
2261+/* Must hold rtnl_lock */
2262+static inline bool bnxt_sriov_cfg(struct bnxt *bp)
2263+{
2264+#if defined(CONFIG_BNXT_SRIOV)
2265+ return BNXT_PF(bp) && (bp->pf.active_vfs || bp->sriov_cfg);
2266+#else
2267+ return false;
2268+#endif
2269+}
2270+
22612271 extern const u16 bnxt_lhint_arr[];
22622272
22632273 int bnxt_alloc_rx_data(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c+5−4
@@ -360,7 +360,7 @@ bnxt_dl_livepatch_report_err(struct bnxt *bp, struct netlink_ext_ack *extack, · 359 unmodified lines
360360 NL_SET_ERR_MSG_MOD(extack, "Live patch already applied");
361361 break;
362362 default:
363− netdev_err(bp->dev, "Unexpected live patch error: %hhd\n", err);
363+ netdev_err(bp->dev, "Unexpected live patch error: %d\n", err);
364364 NL_SET_ERR_MSG_MOD(extack, "Failed to activate live patch");
365365 break;
366366 }
@@ -441,12 +441,13 @@ static int bnxt_dl_reload_down(struct devlink *dl, bool netns_change, · 74 unmodified lines
441441
442442 switch (action) {
443443 case DEVLINK_RELOAD_ACTION_DRIVER_REINIT: {
444− if (BNXT_PF(bp) && bp->pf.active_vfs) {
444+ rtnl_lock();
445+ if (bnxt_sriov_cfg(bp)) {
445446 NL_SET_ERR_MSG_MOD(extack,
446− "reload is unsupported when VFs are allocated");
447+ "reload is unsupported while VFs are allocated or being configured");
448+ rtnl_unlock();
447449 return -EOPNOTSUPP;
448450 }
449− rtnl_lock();
450451 if (bp->dev->reg_state == NETREG_UNREGISTERED) {
451452 rtnl_unlock();
452453 return -ENODEV;
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c+1−1
@@ -1868,7 +1868,7 @@ static int bnxt_tc_setup_indr_block_cb(enum tc_setup_type type, · 1867 unmodified lines
18681868 struct flow_cls_offload *flower = type_data;
18691869 struct bnxt *bp = priv->bp;
18701870
1871− if (flower->common.chain_index)
1871+ if (!tc_cls_can_offload_and_chain0(bp->dev, type_data))
18721872 return -EOPNOTSUPP;
18731873
18741874 switch (type) {
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c+1−0
@@ -3196,6 +3196,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, · 3195 unmodified lines
31963196 }
31973197 if (adapter->registered_device_map == 0) {
31983198 dev_err(&pdev->dev, "could not register any net devices\n");
3199+ err = -EINVAL;
31993200 goto err_disable_interrupts;
32003201 }
32013202
drivers/net/ethernet/dec/tulip/de4x5.c+21−13
@@ -4709,6 +4709,10 @@ type3_infoblock(struct net_device *dev, u_char count, u_char *p) · 4708 unmodified lines
47094709 lp->ibn = 3;
47104710 lp->active = *p++;
47114711 if (MOTO_SROM_BUG) lp->active = 0;
4712+ /* if (MOTO_SROM_BUG) statement indicates lp->active could
4713+ * be 8 (i.e. the size of array lp->phy) */
4714+ if (WARN_ON(lp->active >= ARRAY_SIZE(lp->phy)))
4715+ return -EINVAL;
47124716 lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1);
47134717 lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1);
47144718 lp->phy[lp->active].mc = get_unaligned_le16(p); p += 2;
@@ -5000,19 +5004,23 @@ mii_get_phy(struct net_device *dev) · 285 unmodified lines
50005004 }
50015005 if ((j == limit) && (i < DE4X5_MAX_MII)) {
50025006 for (k=0; k < DE4X5_MAX_PHY && lp->phy[k].id; k++);
5003− lp->phy[k].addr = i;
5004− lp->phy[k].id = id;
5005− lp->phy[k].spd.reg = GENERIC_REG; /* ANLPA register */
5006− lp->phy[k].spd.mask = GENERIC_MASK; /* 100Mb/s technologies */
5007− lp->phy[k].spd.value = GENERIC_VALUE; /* TX & T4, H/F Duplex */
5008− lp->mii_cnt++;
5009− lp->active++;
5010− printk("%s: Using generic MII device control. If the board doesn't operate,\nplease mail the following dump to the author:\n", dev->name);
5011− j = de4x5_debug;
5012− de4x5_debug |= DEBUG_MII;
5013− de4x5_dbg_mii(dev, k);
5014− de4x5_debug = j;
5015− printk("\n");
5007+ if (k < DE4X5_MAX_PHY) {
5008+ lp->phy[k].addr = i;
5009+ lp->phy[k].id = id;
5010+ lp->phy[k].spd.reg = GENERIC_REG; /* ANLPA register */
5011+ lp->phy[k].spd.mask = GENERIC_MASK; /* 100Mb/s technologies */
5012+ lp->phy[k].spd.value = GENERIC_VALUE; /* TX & T4, H/F Duplex */
5013+ lp->mii_cnt++;
5014+ lp->active++;
5015+ printk("%s: Using generic MII device control. If the board doesn't operate,\nplease mail the following dump to the author:\n", dev->name);
5016+ j = de4x5_debug;
5017+ de4x5_debug |= DEBUG_MII;
5018+ de4x5_dbg_mii(dev, k);
5019+ de4x5_debug = j;
5020+ printk("\n");
5021+ } else {
5022+ goto purgatory;
5023+ }
50165024 }
50175025 }
50185026 purgatory:
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c+3−1
@@ -4550,10 +4550,12 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev) · 4549 unmodified lines
45504550
45514551 fsl_mc_portal_free(priv->mc_io);
45524552
4553− free_netdev(net_dev);
4553+ destroy_workqueue(priv->dpaa2_ptp_wq);
45544554
45554555 dev_dbg(net_dev->dev.parent, "Removed interface %s\n", net_dev->name);
45564556
4557+ free_netdev(net_dev);
4558+
45574559 return 0;
45584560 }
45594561
drivers/net/ethernet/freescale/fec.h+3−0
@@ -377,6 +377,9 @@ struct bufdesc_ex { · 376 unmodified lines
377377 #define FEC_ENET_WAKEUP ((uint)0x00020000) /* Wakeup request */
378378 #define FEC_ENET_TXF (FEC_ENET_TXF_0 | FEC_ENET_TXF_1 | FEC_ENET_TXF_2)
379379 #define FEC_ENET_RXF (FEC_ENET_RXF_0 | FEC_ENET_RXF_1 | FEC_ENET_RXF_2)
380+#define FEC_ENET_RXF_GET(X) (((X) == 0) ? FEC_ENET_RXF_0 : \
381+ (((X) == 1) ? FEC_ENET_RXF_1 : \
382+ FEC_ENET_RXF_2))
380383 #define FEC_ENET_TS_AVAIL ((uint)0x00010000)
381384 #define FEC_ENET_TS_TIMER ((uint)0x00008000)
382385
drivers/net/ethernet/freescale/fec_main.c+1−1
@@ -1480,7 +1480,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) · 1479 unmodified lines
14801480 break;
14811481 pkt_received++;
14821482
1483− writel(FEC_ENET_RXF, fep->hwp + FEC_IEVENT);
1483+ writel(FEC_ENET_RXF_GET(queue_id), fep->hwp + FEC_IEVENT);
14841484
14851485 /* Check for errors. */
14861486 status ^= BD_ENET_RX_LAST;
drivers/net/ethernet/google/gve/gve_utils.c+3−0
@@ -68,6 +68,9 @@ struct sk_buff *gve_rx_copy(struct net_device *dev, struct napi_struct *napi, · 67 unmodified lines
6868 set_protocol = ctx->curr_frag_cnt == ctx->expected_frag_cnt - 1;
6969 } else {
7070 skb = napi_alloc_skb(napi, len);
71+
72+ if (unlikely(!skb))
73+ return NULL;
7174 set_protocol = true;
7275 }
7376 __skb_put(skb, len);
drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c+4−0
@@ -400,6 +400,10 @@ static void hns_dsaf_ge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, · 399 unmodified lines
400400 return;
401401
402402 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) {
403+ /* DSAF_MAX_PORT_NUM is 6, but DSAF_GE_NUM is 8.
404+ We need check to prevent array overflow */
405+ if (port >= DSAF_MAX_PORT_NUM)
406+ return;
403407 reg_val_1 = 0x1 << port;
404408 port_rst_off = dsaf_dev->mac_cb[port]->port_rst_off;
405409 /* there is difference between V1 and V2 in register.*/
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c+7−1
@@ -1081,7 +1081,8 @@ static void hns3_dump_page_pool_info(struct hns3_enet_ring *ring, · 1080 unmodified lines
10811081 u32 j = 0;
10821082
10831083 sprintf(result[j++], "%u", index);
1084− sprintf(result[j++], "%u", ring->page_pool->pages_state_hold_cnt);
1084+ sprintf(result[j++], "%u",
1085+ READ_ONCE(ring->page_pool->pages_state_hold_cnt));
10851086 sprintf(result[j++], "%u",
10861087 atomic_read(&ring->page_pool->pages_state_release_cnt));
10871088 sprintf(result[j++], "%u", ring->page_pool->p.pool_size);
@@ -1106,6 +1107,11 @@ hns3_dbg_page_pool_info(struct hnae3_handle *h, char *buf, int len) · 18 unmodified lines
11061107 return -EFAULT;
11071108 }
11081109
1110+ if (!priv->ring[h->kinfo.num_tqps].page_pool) {
1111+ dev_err(&h->pdev->dev, "page pool is not initialized\n");
1112+ return -EFAULT;
1113+ }
1114+
11091115 for (i = 0; i < ARRAY_SIZE(page_pool_info_items); i++)
11101116 result[i] = &data_str[i][0];
11111117
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c+4−0
@@ -987,6 +987,7 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags) · 986 unmodified lines
987987 struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
988988 const struct hnae3_ae_ops *ops = h->ae_algo->ops;
989989 const struct hns3_reset_type_map *rst_type_map;
990+ enum ethtool_reset_flags rst_flags;
990991 u32 i, size;
991992
992993 if (ops->ae_dev_resetting && ops->ae_dev_resetting(h))
@@ -1006,6 +1007,7 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags) · 13 unmodified lines
10061007 for (i = 0; i < size; i++) {
10071008 if (rst_type_map[i].rst_flags == *flags) {
10081009 rst_type = rst_type_map[i].rst_type;
1010+ rst_flags = rst_type_map[i].rst_flags;
10091011 break;
10101012 }
10111013 }
@@ -1021,6 +1023,8 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags) · 9 unmodified lines
10211023
10221024 ops->reset_event(h->pdev, h);
10231025
1026+ *flags &= ~rst_flags;
1027+
10241028 return 0;
10251029 }
10261030
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+2−2
@@ -703,9 +703,9 @@ static int hclgevf_set_rss_tc_mode(struct hclgevf_dev *hdev, u16 rss_size) · 702 unmodified lines
703703 roundup_size = ilog2(roundup_size);
704704
705705 for (i = 0; i < HCLGEVF_MAX_TC_NUM; i++) {
706− tc_valid[i] = !!(hdev->hw_tc_map & BIT(i));
706+ tc_valid[i] = 1;
707707 tc_size[i] = roundup_size;
708− tc_offset[i] = rss_size * i;
708+ tc_offset[i] = (hdev->hw_tc_map & BIT(i)) ? rss_size * i : 0;
709709 }
710710
711711 hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_RSS_TC_MODE, false);
drivers/net/ethernet/huawei/hinic/hinic_sriov.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/interrupt.h>
99 #include <linux/etherdevice.h>
1010 #include <linux/netdevice.h>
11+#include <linux/module.h>
1112
1213 #include "hinic_hw_dev.h"
1314 #include "hinic_dev.h"
drivers/net/ethernet/ibm/ibmvnic.c+6−22
@@ -628,17 +628,9 @@ static bool reuse_rx_pools(struct ibmvnic_adapter *adapter) · 627 unmodified lines
628628 old_buff_size = adapter->prev_rx_buf_sz;
629629 new_buff_size = adapter->cur_rx_buf_sz;
630630
631− /* Require buff size to be exactly same for now */
632− if (old_buff_size != new_buff_size)
633− return false;
634−
635− if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
636− return true;
637−
638− if (old_num_pools < adapter->min_rx_queues ||
639− old_num_pools > adapter->max_rx_queues ||
640− old_pool_size < adapter->min_rx_add_entries_per_subcrq ||
641− old_pool_size > adapter->max_rx_add_entries_per_subcrq)
631+ if (old_buff_size != new_buff_size ||
632+ old_num_pools != new_num_pools ||
633+ old_pool_size != new_pool_size)
642634 return false;
643635
644636 return true;
@@ -874,17 +866,9 @@ static bool reuse_tx_pools(struct ibmvnic_adapter *adapter) · 229 unmodified lines
874866 old_mtu = adapter->prev_mtu;
875867 new_mtu = adapter->req_mtu;
876868
877− /* Require MTU to be exactly same to reuse pools for now */
878− if (old_mtu != new_mtu)
879− return false;
880−
881− if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
882− return true;
883−
884− if (old_num_pools < adapter->min_tx_queues ||
885− old_num_pools > adapter->max_tx_queues ||
886− old_pool_size < adapter->min_tx_entries_per_subcrq ||
887− old_pool_size > adapter->max_tx_entries_per_subcrq)
869+ if (old_mtu != new_mtu ||
870+ old_num_pools != new_num_pools ||
871+ old_pool_size != new_pool_size)
888872 return false;
889873
890874 return true;
drivers/net/ethernet/intel/e100.c+13−5
@@ -3003,9 +3003,10 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake) · 3002 unmodified lines
30033003 struct net_device *netdev = pci_get_drvdata(pdev);
30043004 struct nic *nic = netdev_priv(netdev);
30053005
3006+ netif_device_detach(netdev);
3007+
30063008 if (netif_running(netdev))
30073009 e100_down(nic);
3008− netif_device_detach(netdev);
30093010
30103011 if ((nic->flags & wol_magic) | e100_asf(nic)) {
30113012 /* enable reverse auto-negotiation */
@@ -3022,7 +3023,7 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake) · 10 unmodified lines
30223023 *enable_wake = false;
30233024 }
30243025
3025− pci_clear_master(pdev);
3026+ pci_disable_device(pdev);
30263027 }
30273028
30283029 static int __e100_power_off(struct pci_dev *pdev, bool wake)
@@ -3042,8 +3043,6 @@ static int __maybe_unused e100_suspend(struct device *dev_d) · 13 unmodified lines
30423043
30433044 __e100_shutdown(to_pci_dev(dev_d), &wake);
30443045
3045− device_wakeup_disable(dev_d);
3046−
30473046 return 0;
30483047 }
30493048
@@ -3051,6 +3050,14 @@ static int __maybe_unused e100_resume(struct device *dev_d) · 1 unmodified line
30513050 {
30523051 struct net_device *netdev = dev_get_drvdata(dev_d);
30533052 struct nic *nic = netdev_priv(netdev);
3053+ int err;
3054+
3055+ err = pci_enable_device(to_pci_dev(dev_d));
3056+ if (err) {
3057+ netdev_err(netdev, "Resume cannot enable PCI device, aborting\n");
3058+ return err;
3059+ }
3060+ pci_set_master(to_pci_dev(dev_d));
30543061
30553062 /* disable reverse auto-negotiation */
30563063 if (nic->phy == phy_82552_v) {
@@ -3062,10 +3069,11 @@ static int __maybe_unused e100_resume(struct device *dev_d) · 5 unmodified lines
30623069 smartspeed & ~(E100_82552_REV_ANEG));
30633070 }
30643071
3065− netif_device_attach(netdev);
30663072 if (netif_running(netdev))
30673073 e100_up(nic);
30683074
3075+ netif_device_attach(netdev);
3076+
30693077 return 0;
30703078 }
30713079
drivers/net/ethernet/intel/i40e/i40e.h+2−0
@@ -161,6 +161,7 @@ enum i40e_vsi_state_t { · 160 unmodified lines
161161 __I40E_VSI_OVERFLOW_PROMISC,
162162 __I40E_VSI_REINIT_REQUESTED,
163163 __I40E_VSI_DOWN_REQUESTED,
164+ __I40E_VSI_RELEASING,
164165 /* This must be last as it determines the size of the BITMAP */
165166 __I40E_VSI_STATE_SIZE__,
166167 };
@@ -1247,6 +1248,7 @@ void i40e_ptp_restore_hw_time(struct i40e_pf *pf); · 1080 unmodified lines
12471248 void i40e_ptp_init(struct i40e_pf *pf);
12481249 void i40e_ptp_stop(struct i40e_pf *pf);
12491250 int i40e_ptp_alloc_pins(struct i40e_pf *pf);
1251+int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset);
12501252 int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi);
12511253 i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf);
12521254 i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf);
drivers/net/ethernet/intel/i40e/i40e_debugfs.c+8−0
@@ -553,6 +553,14 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, · 552 unmodified lines
553553 dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid);
554554 return;
555555 }
556+ if (vsi->type != I40E_VSI_MAIN &&
557+ vsi->type != I40E_VSI_FDIR &&
558+ vsi->type != I40E_VSI_VMDQ2) {
559+ dev_info(&pf->pdev->dev,
560+ "vsi %d type %d descriptor rings not available\n",
561+ vsi_seid, vsi->type);
562+ return;
563+ }
556564 if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) {
557565 dev_info(&pf->pdev->dev, "XDP not enabled on VSI %d\n", vsi_seid);
558566 return;
drivers/net/ethernet/intel/i40e/i40e_main.c+104−56
@@ -1790,6 +1790,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, · 1789 unmodified lines
17901790 bool is_add)
17911791 {
17921792 struct i40e_pf *pf = vsi->back;
1793+ u16 num_tc_qps = 0;
17931794 u16 sections = 0;
17941795 u8 netdev_tc = 0;
17951796 u16 numtc = 1;
@@ -1797,13 +1798,33 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, · 1 unmodified line
17971798 u8 offset;
17981799 u16 qmap;
17991800 int i;
1800− u16 num_tc_qps = 0;
18011801
18021802 sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID;
18031803 offset = 0;
1804+ /* zero out queue mapping, it will get updated on the end of the function */
1805+ memset(ctxt->info.queue_mapping, 0, sizeof(ctxt->info.queue_mapping));
1806+
1807+ if (vsi->type == I40E_VSI_MAIN) {
1808+ /* This code helps add more queue to the VSI if we have
1809+ * more cores than RSS can support, the higher cores will
1810+ * be served by ATR or other filters. Furthermore, the
1811+ * non-zero req_queue_pairs says that user requested a new
1812+ * queue count via ethtool's set_channels, so use this
1813+ * value for queues distribution across traffic classes
1814+ */
1815+ if (vsi->req_queue_pairs > 0)
1816+ vsi->num_queue_pairs = vsi->req_queue_pairs;
1817+ else if (pf->flags & I40E_FLAG_MSIX_ENABLED)
1818+ vsi->num_queue_pairs = pf->num_lan_msix;
1819+ }
18041820
18051821 /* Number of queues per enabled TC */
1806− num_tc_qps = vsi->alloc_queue_pairs;
1822+ if (vsi->type == I40E_VSI_MAIN ||
1823+ (vsi->type == I40E_VSI_SRIOV && vsi->num_queue_pairs != 0))
1824+ num_tc_qps = vsi->num_queue_pairs;
1825+ else
1826+ num_tc_qps = vsi->alloc_queue_pairs;
1827+
18071828 if (enabled_tc && (vsi->back->flags & I40E_FLAG_DCB_ENABLED)) {
18081829 /* Find numtc from enabled TC bitmap */
18091830 for (i = 0, numtc = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
@@ -1881,15 +1902,11 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, · 71 unmodified lines
18811902 }
18821903 ctxt->info.tc_mapping[i] = cpu_to_le16(qmap);
18831904 }
1884−
1885− /* Set actual Tx/Rx queue pairs */
1886− vsi->num_queue_pairs = offset;
1887− if ((vsi->type == I40E_VSI_MAIN) && (numtc == 1)) {
1888− if (vsi->req_queue_pairs > 0)
1889− vsi->num_queue_pairs = vsi->req_queue_pairs;
1890− else if (pf->flags & I40E_FLAG_MSIX_ENABLED)
1891− vsi->num_queue_pairs = pf->num_lan_msix;
1892− }
1905+ /* Do not change previously set num_queue_pairs for PFs and VFs*/
1906+ if ((vsi->type == I40E_VSI_MAIN && numtc != 1) ||
1907+ (vsi->type == I40E_VSI_SRIOV && vsi->num_queue_pairs == 0) ||
1908+ (vsi->type != I40E_VSI_MAIN && vsi->type != I40E_VSI_SRIOV))
1909+ vsi->num_queue_pairs = offset;
18931910
18941911 /* Scheduler section valid can only be set for ADD VSI */
18951912 if (is_add) {
@@ -2623,7 +2640,8 @@ static void i40e_sync_filters_subtask(struct i40e_pf *pf) · 727 unmodified lines
26232640
26242641 for (v = 0; v < pf->num_alloc_vsi; v++) {
26252642 if (pf->vsi[v] &&
2626− (pf->vsi[v]->flags & I40E_VSI_FLAG_FILTER_CHANGED)) {
2643+ (pf->vsi[v]->flags & I40E_VSI_FLAG_FILTER_CHANGED) &&
2644+ !test_bit(__I40E_VSI_RELEASING, pf->vsi[v]->state)) {
26272645 int ret = i40e_sync_vsi_filters(pf->vsi[v]);
26282646
26292647 if (ret) {
@@ -5426,6 +5444,58 @@ static void i40e_vsi_update_queue_map(struct i40e_vsi *vsi, · 2796 unmodified lines
54265444 sizeof(vsi->info.tc_mapping));
54275445 }
54285446
5447+/**
5448+ * i40e_update_adq_vsi_queues - update queue mapping for ADq VSI
5449+ * @vsi: the VSI being reconfigured
5450+ * @vsi_offset: offset from main VF VSI
5451+ */
5452+int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset)
5453+{
5454+ struct i40e_vsi_context ctxt = {};
5455+ struct i40e_pf *pf;
5456+ struct i40e_hw *hw;
5457+ int ret;
5458+
5459+ if (!vsi)
5460+ return I40E_ERR_PARAM;
5461+ pf = vsi->back;
5462+ hw = &pf->hw;
5463+
5464+ ctxt.seid = vsi->seid;
5465+ ctxt.pf_num = hw->pf_id;
5466+ ctxt.vf_num = vsi->vf_id + hw->func_caps.vf_base_id + vsi_offset;
5467+ ctxt.uplink_seid = vsi->uplink_seid;
5468+ ctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL;
5469+ ctxt.flags = I40E_AQ_VSI_TYPE_VF;
5470+ ctxt.info = vsi->info;
5471+
5472+ i40e_vsi_setup_queue_map(vsi, &ctxt, vsi->tc_config.enabled_tc,
5473+ false);
5474+ if (vsi->reconfig_rss) {
5475+ vsi->rss_size = min_t(int, pf->alloc_rss_size,
5476+ vsi->num_queue_pairs);
5477+ ret = i40e_vsi_config_rss(vsi);
5478+ if (ret) {
5479+ dev_info(&pf->pdev->dev, "Failed to reconfig rss for num_queues\n");
5480+ return ret;
5481+ }
5482+ vsi->reconfig_rss = false;
5483+ }
5484+
5485+ ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
5486+ if (ret) {
5487+ dev_info(&pf->pdev->dev, "Update vsi config failed, err %s aq_err %s\n",
5488+ i40e_stat_str(hw, ret),
5489+ i40e_aq_str(hw, hw->aq.asq_last_status));
5490+ return ret;
5491+ }
5492+ /* update the local VSI info with updated queue map */
5493+ i40e_vsi_update_queue_map(vsi, &ctxt);
5494+ vsi->info.valid_sections = 0;
5495+
5496+ return ret;
5497+}
5498+
54295499 /**
54305500 * i40e_vsi_config_tc - Configure VSI Tx Scheduler for given TC map
54315501 * @vsi: VSI to be configured
@@ -5716,24 +5786,6 @@ static void i40e_remove_queue_channels(struct i40e_vsi *vsi) · 284 unmodified lines
57165786 INIT_LIST_HEAD(&vsi->ch_list);
57175787 }
57185788
5719−/**
5720− * i40e_is_any_channel - channel exist or not
5721− * @vsi: ptr to VSI to which channels are associated with
5722− *
5723− * Returns true or false if channel(s) exist for associated VSI or not
5724− **/
5725−static bool i40e_is_any_channel(struct i40e_vsi *vsi)
5726−{
5727− struct i40e_channel *ch, *ch_tmp;
5728−
5729− list_for_each_entry_safe(ch, ch_tmp, &vsi->ch_list, list) {
5730− if (ch->initialized)
5731− return true;
5732− }
5733−
5734− return false;
5735−}
5736−
57375789 /**
57385790 * i40e_get_max_queues_for_channel
57395791 * @vsi: ptr to VSI to which channels are associated with
@@ -6240,26 +6292,15 @@ int i40e_create_queue_channel(struct i40e_vsi *vsi, · 500 unmodified lines
62406292 /* By default we are in VEPA mode, if this is the first VF/VMDq
62416293 * VSI to be added switch to VEB mode.
62426294 */
6243− if ((!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) ||
6244− (!i40e_is_any_channel(vsi))) {
6245− if (!is_power_of_2(vsi->tc_config.tc_info[0].qcount)) {
6246− dev_dbg(&pf->pdev->dev,
6247− "Failed to create channel. Override queues (%u) not power of 2\n",
6248− vsi->tc_config.tc_info[0].qcount);
6249− return -EINVAL;
6250− }
62516295
6252− if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
6253− pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
6296+ if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
6297+ pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
62546298
6255− if (vsi->type == I40E_VSI_MAIN) {
6256− if (pf->flags & I40E_FLAG_TC_MQPRIO)
6257− i40e_do_reset(pf, I40E_PF_RESET_FLAG,
6258− true);
6259− else
6260− i40e_do_reset_safe(pf,
6261− I40E_PF_RESET_FLAG);
6262− }
6299+ if (vsi->type == I40E_VSI_MAIN) {
6300+ if (pf->flags & I40E_FLAG_TC_MQPRIO)
6301+ i40e_do_reset(pf, I40E_PF_RESET_FLAG, true);
6302+ else
6303+ i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG);
62636304 }
62646305 /* now onwards for main VSI, number of queues will be value
62656306 * of TC0's queue count
@@ -7912,12 +7953,20 @@ config_tc: · 1646 unmodified lines
79127953 vsi->seid);
79137954 need_reset = true;
79147955 goto exit;
7915− } else {
7916− dev_info(&vsi->back->pdev->dev,
7917− "Setup channel (id:%u) utilizing num_queues %d\n",
7918− vsi->seid, vsi->tc_config.tc_info[0].qcount);
7956+ } else if (enabled_tc &&
7957+ (!is_power_of_2(vsi->tc_config.tc_info[0].qcount))) {
7958+ netdev_info(netdev,
7959+ "Failed to create channel. Override queues (%u) not power of 2\n",
7960+ vsi->tc_config.tc_info[0].qcount);
7961+ ret = -EINVAL;
7962+ need_reset = true;
7963+ goto exit;
79197964 }
79207965
7966+ dev_info(&vsi->back->pdev->dev,
7967+ "Setup channel (id:%u) utilizing num_queues %d\n",
7968+ vsi->seid, vsi->tc_config.tc_info[0].qcount);
7969+
79217970 if (pf->flags & I40E_FLAG_TC_MQPRIO) {
79227971 if (vsi->mqprio_qopt.max_rate[0]) {
79237972 u64 max_tx_rate = vsi->mqprio_qopt.max_rate[0];
@@ -8482,9 +8531,8 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi, · 558 unmodified lines
84828531 err = i40e_add_del_cloud_filter(vsi, filter, true);
84838532
84848533 if (err) {
8485− dev_err(&pf->pdev->dev,
8486− "Failed to add cloud filter, err %s\n",
8487− i40e_stat_str(&pf->hw, err));
8534+ dev_err(&pf->pdev->dev, "Failed to add cloud filter, err %d\n",
8535+ err);
84888536 goto err;
84898537 }
84908538
@@ -13771,7 +13819,7 @@ int i40e_vsi_release(struct i40e_vsi *vsi) · 5280 unmodified lines
1377113819 dev_info(&pf->pdev->dev, "Can't remove PF VSI\n");
1377213820 return -ENODEV;
1377313821 }
13774−
13822+ set_bit(__I40E_VSI_RELEASING, vsi->state);
1377513823 uplink_seid = vsi->uplink_seid;
1377613824 if (vsi->type != I40E_VSI_SRIOV) {
1377713825 if (vsi->netdev_registered) {
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+89−107
@@ -183,17 +183,18 @@ void i40e_vc_notify_vf_reset(struct i40e_vf *vf) · 182 unmodified lines
183183 /***********************misc routines*****************************/
184184
185185 /**
186− * i40e_vc_disable_vf
186+ * i40e_vc_reset_vf
187187 * @vf: pointer to the VF info
188− *
189− * Disable the VF through a SW reset.
188+ * @notify_vf: notify vf about reset or not
189+ * Reset VF handler.
190190 **/
191−static inline void i40e_vc_disable_vf(struct i40e_vf *vf)
191+static void i40e_vc_reset_vf(struct i40e_vf *vf, bool notify_vf)
192192 {
193193 struct i40e_pf *pf = vf->pf;
194194 int i;
195195
196− i40e_vc_notify_vf_reset(vf);
196+ if (notify_vf)
197+ i40e_vc_notify_vf_reset(vf);
197198
198199 /* We want to ensure that an actual reset occurs initiated after this
199200 * function was called. However, we do not want to wait forever, so
@@ -211,9 +212,14 @@ static inline void i40e_vc_disable_vf(struct i40e_vf *vf) · 11 unmodified lines
211212 usleep_range(10000, 20000);
212213 }
213214
214− dev_warn(&vf->pf->pdev->dev,
215− "Failed to initiate reset for VF %d after 200 milliseconds\n",
216− vf->vf_id);
215+ if (notify_vf)
216+ dev_warn(&vf->pf->pdev->dev,
217+ "Failed to initiate reset for VF %d after 200 milliseconds\n",
218+ vf->vf_id);
219+ else
220+ dev_dbg(&vf->pf->pdev->dev,
221+ "Failed to initiate reset for VF %d after 200 milliseconds\n",
222+ vf->vf_id);
217223 }
218224
219225 /**
@@ -674,14 +680,13 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id, · 454 unmodified lines
674680 u16 vsi_queue_id,
675681 struct virtchnl_rxq_info *info)
676682 {
683+ u16 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
677684 struct i40e_pf *pf = vf->pf;
685+ struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx];
678686 struct i40e_hw *hw = &pf->hw;
679687 struct i40e_hmc_obj_rxq rx_ctx;
680− u16 pf_queue_id;
681688 int ret = 0;
682689
683− pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
684−
685690 /* clear the context structure first */
686691 memset(&rx_ctx, 0, sizeof(struct i40e_hmc_obj_rxq));
687692
@@ -719,6 +724,10 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id, · 31 unmodified lines
719724 }
720725 rx_ctx.rxmax = info->max_pkt_size;
721726
727+ /* if port VLAN is configured increase the max packet size */
728+ if (vsi->info.pvid)
729+ rx_ctx.rxmax += VLAN_HLEN;
730+
722731 /* enable 32bytes desc always */
723732 rx_ctx.dsize = 1;
724733
@@ -1939,6 +1948,32 @@ static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf, · 1214 unmodified lines
19391948 return i40e_vc_send_msg_to_vf(vf, opcode, retval, NULL, 0);
19401949 }
19411950
1951+/**
1952+ * i40e_sync_vf_state
1953+ * @vf: pointer to the VF info
1954+ * @state: VF state
1955+ *
1956+ * Called from a VF message to synchronize the service with a potential
1957+ * VF reset state
1958+ **/
1959+static bool i40e_sync_vf_state(struct i40e_vf *vf, enum i40e_vf_states state)
1960+{
1961+ int i;
1962+
1963+ /* When handling some messages, it needs VF state to be set.
1964+ * It is possible that this flag is cleared during VF reset,
1965+ * so there is a need to wait until the end of the reset to
1966+ * handle the request message correctly.
1967+ */
1968+ for (i = 0; i < I40E_VF_STATE_WAIT_COUNT; i++) {
1969+ if (test_bit(state, &vf->vf_states))
1970+ return true;
1971+ usleep_range(10000, 20000);
1972+ }
1973+
1974+ return test_bit(state, &vf->vf_states);
1975+}
1976+
19421977 /**
19431978 * i40e_vc_get_version_msg
19441979 * @vf: pointer to the VF info
@@ -1999,7 +2034,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) · 54 unmodified lines
19992034 size_t len = 0;
20002035 int ret;
20012036
2002− if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
2037+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_INIT)) {
20032038 aq_ret = I40E_ERR_PARAM;
20042039 goto err;
20052040 }
@@ -2105,20 +2140,6 @@ err: · 99 unmodified lines
21052140 return ret;
21062141 }
21072142
2108−/**
2109− * i40e_vc_reset_vf_msg
2110− * @vf: pointer to the VF info
2111− *
2112− * called from the VF to reset itself,
2113− * unlike other virtchnl messages, PF driver
2114− * doesn't send the response back to the VF
2115− **/
2116−static void i40e_vc_reset_vf_msg(struct i40e_vf *vf)
2117−{
2118− if (test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states))
2119− i40e_reset_vf(vf, false);
2120−}
2121−
21222143 /**
21232144 * i40e_vc_config_promiscuous_mode_msg
21242145 * @vf: pointer to the VF info
@@ -2136,7 +2157,7 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg) · 11 unmodified lines
21362157 bool allmulti = false;
21372158 bool alluni = false;
21382159
2139− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
2160+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
21402161 aq_ret = I40E_ERR_PARAM;
21412162 goto err_out;
21422163 }
@@ -2217,13 +2238,14 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) · 74 unmodified lines
22172238 struct virtchnl_vsi_queue_config_info *qci =
22182239 (struct virtchnl_vsi_queue_config_info *)msg;
22192240 struct virtchnl_queue_pair_info *qpi;
2220− struct i40e_pf *pf = vf->pf;
22212241 u16 vsi_id, vsi_queue_id = 0;
2222− u16 num_qps_all = 0;
2242+ struct i40e_pf *pf = vf->pf;
22232243 i40e_status aq_ret = 0;
22242244 int i, j = 0, idx = 0;
2245+ struct i40e_vsi *vsi;
2246+ u16 num_qps_all = 0;
22252247
2226− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
2248+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
22272249 aq_ret = I40E_ERR_PARAM;
22282250 goto error_param;
22292251 }
@@ -2310,9 +2332,15 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) · 80 unmodified lines
23102332 pf->vsi[vf->lan_vsi_idx]->num_queue_pairs =
23112333 qci->num_queue_pairs;
23122334 } else {
2313− for (i = 0; i < vf->num_tc; i++)
2314− pf->vsi[vf->ch[i].vsi_idx]->num_queue_pairs =
2315− vf->ch[i].num_qps;
2335+ for (i = 0; i < vf->num_tc; i++) {
2336+ vsi = pf->vsi[vf->ch[i].vsi_idx];
2337+ vsi->num_queue_pairs = vf->ch[i].num_qps;
2338+
2339+ if (i40e_update_adq_vsi_queues(vsi, i)) {
2340+ aq_ret = I40E_ERR_CONFIG;
2341+ goto error_param;
2342+ }
2343+ }
23162344 }
23172345
23182346 error_param:
@@ -2366,7 +2394,7 @@ static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg) · 47 unmodified lines
23662394 i40e_status aq_ret = 0;
23672395 int i;
23682396
2369− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
2397+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
23702398 aq_ret = I40E_ERR_PARAM;
23712399 goto error_param;
23722400 }
@@ -2538,7 +2566,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) · 165 unmodified lines
25382566 struct i40e_pf *pf = vf->pf;
25392567 i40e_status aq_ret = 0;
25402568
2541− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
2569+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
25422570 aq_ret = I40E_ERR_PARAM;
25432571 goto error_param;
25442572 }
@@ -2588,7 +2616,7 @@ static int i40e_vc_request_queues_msg(struct i40e_vf *vf, u8 *msg) · 43 unmodified lines
25882616 u8 cur_pairs = vf->num_queue_pairs;
25892617 struct i40e_pf *pf = vf->pf;
25902618
2591− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states))
2619+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE))
25922620 return -EINVAL;
25932621
25942622 if (req_pairs > I40E_MAX_VF_QUEUES) {
@@ -2607,8 +2635,7 @@ static int i40e_vc_request_queues_msg(struct i40e_vf *vf, u8 *msg) · 12 unmodified lines
26072635 } else {
26082636 /* successful request */
26092637 vf->num_req_queues = req_pairs;
2610− i40e_vc_notify_vf_reset(vf);
2611− i40e_reset_vf(vf, false);
2638+ i40e_vc_reset_vf(vf, true);
26122639 return 0;
26132640 }
26142641
@@ -2634,7 +2661,7 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg) · 19 unmodified lines
26342661
26352662 memset(&stats, 0, sizeof(struct i40e_eth_stats));
26362663
2637− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
2664+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
26382665 aq_ret = I40E_ERR_PARAM;
26392666 goto error_param;
26402667 }
@@ -2751,7 +2778,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 110 unmodified lines
27512778 i40e_status ret = 0;
27522779 int i;
27532780
2754− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
2781+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
27552782 !i40e_vc_isvalid_vsi_id(vf, al->vsi_id)) {
27562783 ret = I40E_ERR_PARAM;
27572784 goto error_param;
@@ -2823,7 +2850,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 65 unmodified lines
28232850 i40e_status ret = 0;
28242851 int i;
28252852
2826− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
2853+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
28272854 !i40e_vc_isvalid_vsi_id(vf, al->vsi_id)) {
28282855 ret = I40E_ERR_PARAM;
28292856 goto error_param;
@@ -2967,7 +2994,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg) · 137 unmodified lines
29672994 i40e_status aq_ret = 0;
29682995 int i;
29692996
2970− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
2997+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
29712998 !i40e_vc_isvalid_vsi_id(vf, vfl->vsi_id)) {
29722999 aq_ret = I40E_ERR_PARAM;
29733000 goto error_param;
@@ -3087,9 +3114,9 @@ static int i40e_vc_config_rss_key(struct i40e_vf *vf, u8 *msg) · 113 unmodified lines
30873114 struct i40e_vsi *vsi = NULL;
30883115 i40e_status aq_ret = 0;
30893116
3090− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
3117+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
30913118 !i40e_vc_isvalid_vsi_id(vf, vrk->vsi_id) ||
3092− (vrk->key_len != I40E_HKEY_ARRAY_SIZE)) {
3119+ vrk->key_len != I40E_HKEY_ARRAY_SIZE) {
30933120 aq_ret = I40E_ERR_PARAM;
30943121 goto err;
30953122 }
@@ -3118,9 +3145,9 @@ static int i40e_vc_config_rss_lut(struct i40e_vf *vf, u8 *msg) · 22 unmodified lines
31183145 i40e_status aq_ret = 0;
31193146 u16 i;
31203147
3121− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
3148+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
31223149 !i40e_vc_isvalid_vsi_id(vf, vrl->vsi_id) ||
3123− (vrl->lut_entries != I40E_VF_HLUT_ARRAY_SIZE)) {
3150+ vrl->lut_entries != I40E_VF_HLUT_ARRAY_SIZE) {
31243151 aq_ret = I40E_ERR_PARAM;
31253152 goto err;
31263153 }
@@ -3153,7 +3180,7 @@ static int i40e_vc_get_rss_hena(struct i40e_vf *vf, u8 *msg) · 26 unmodified lines
31533180 i40e_status aq_ret = 0;
31543181 int len = 0;
31553182
3156− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3183+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
31573184 aq_ret = I40E_ERR_PARAM;
31583185 goto err;
31593186 }
@@ -3189,7 +3216,7 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg) · 29 unmodified lines
31893216 struct i40e_hw *hw = &pf->hw;
31903217 i40e_status aq_ret = 0;
31913218
3192− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3219+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
31933220 aq_ret = I40E_ERR_PARAM;
31943221 goto err;
31953222 }
@@ -3214,7 +3241,7 @@ static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg) · 18 unmodified lines
32143241 i40e_status aq_ret = 0;
32153242 struct i40e_vsi *vsi;
32163243
3217− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3244+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
32183245 aq_ret = I40E_ERR_PARAM;
32193246 goto err;
32203247 }
@@ -3240,7 +3267,7 @@ static int i40e_vc_disable_vlan_stripping(struct i40e_vf *vf, u8 *msg) · 19 unmodified lines
32403267 i40e_status aq_ret = 0;
32413268 struct i40e_vsi *vsi;
32423269
3243− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3270+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
32443271 aq_ret = I40E_ERR_PARAM;
32453272 goto err;
32463273 }
@@ -3467,7 +3494,7 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) · 220 unmodified lines
34673494 i40e_status aq_ret = 0;
34683495 int i, ret;
34693496
3470− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3497+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
34713498 aq_ret = I40E_ERR_PARAM;
34723499 goto err;
34733500 }
@@ -3598,7 +3625,7 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) · 124 unmodified lines
35983625 i40e_status aq_ret = 0;
35993626 int i, ret;
36003627
3601− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3628+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
36023629 aq_ret = I40E_ERR_PARAM;
36033630 goto err_out;
36043631 }
@@ -3707,7 +3734,7 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg) · 102 unmodified lines
37073734 i40e_status aq_ret = 0;
37083735 u64 speed = 0;
37093736
3710− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3737+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
37113738 aq_ret = I40E_ERR_PARAM;
37123739 goto err;
37133740 }
@@ -3796,15 +3823,9 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg) · 82 unmodified lines
37963823
37973824 /* set this flag only after making sure all inputs are sane */
37983825 vf->adq_enabled = true;
3799− /* num_req_queues is set when user changes number of queues via ethtool
3800− * and this causes issue for default VSI(which depends on this variable)
3801− * when ADq is enabled, hence reset it.
3802− */
3803− vf->num_req_queues = 0;
38043826
38053827 /* reset the VF in order to allocate resources */
3806− i40e_vc_notify_vf_reset(vf);
3807− i40e_reset_vf(vf, false);
3828+ i40e_vc_reset_vf(vf, true);
38083829
38093830 return I40E_SUCCESS;
38103831
@@ -3824,7 +3845,7 @@ static int i40e_vc_del_qch_msg(struct i40e_vf *vf, u8 *msg) · 13 unmodified lines
38243845 struct i40e_pf *pf = vf->pf;
38253846 i40e_status aq_ret = 0;
38263847
3827− if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
3848+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
38283849 aq_ret = I40E_ERR_PARAM;
38293850 goto err;
38303851 }
@@ -3844,8 +3865,7 @@ static int i40e_vc_del_qch_msg(struct i40e_vf *vf, u8 *msg) · 13 unmodified lines
38443865 }
38453866
38463867 /* reset the VF in order to allocate resources */
3847− i40e_vc_notify_vf_reset(vf);
3848− i40e_reset_vf(vf, false);
3868+ i40e_vc_reset_vf(vf, true);
38493869
38503870 return I40E_SUCCESS;
38513871
@@ -3907,7 +3927,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode, · 55 unmodified lines
39073927 i40e_vc_notify_vf_link_state(vf);
39083928 break;
39093929 case VIRTCHNL_OP_RESET_VF:
3910− i40e_vc_reset_vf_msg(vf);
3930+ i40e_vc_reset_vf(vf, false);
39113931 ret = 0;
39123932 break;
39133933 case VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE:
@@ -4161,7 +4181,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) · 247 unmodified lines
41614181 /* Force the VF interface down so it has to bring up with new MAC
41624182 * address
41634183 */
4164− i40e_vc_disable_vf(vf);
4184+ i40e_vc_reset_vf(vf, true);
41654185 dev_info(&pf->pdev->dev, "Bring down and up the VF interface to make this change effective.\n");
41664186
41674187 error_param:
@@ -4169,34 +4189,6 @@ error_param: · 1 unmodified line
41694189 return ret;
41704190 }
41714191
4172−/**
4173− * i40e_vsi_has_vlans - True if VSI has configured VLANs
4174− * @vsi: pointer to the vsi
4175− *
4176− * Check if a VSI has configured any VLANs. False if we have a port VLAN or if
4177− * we have no configured VLANs. Do not call while holding the
4178− * mac_filter_hash_lock.
4179− */
4180−static bool i40e_vsi_has_vlans(struct i40e_vsi *vsi)
4181−{
4182− bool have_vlans;
4183−
4184− /* If we have a port VLAN, then the VSI cannot have any VLANs
4185− * configured, as all MAC/VLAN filters will be assigned to the PVID.
4186− */
4187− if (vsi->info.pvid)
4188− return false;
4189−
4190− /* Since we don't have a PVID, we know that if the device is in VLAN
4191− * mode it must be because of a VLAN filter configured on this VSI.
4192− */
4193− spin_lock_bh(&vsi->mac_filter_hash_lock);
4194− have_vlans = i40e_is_vsi_in_vlan(vsi);
4195− spin_unlock_bh(&vsi->mac_filter_hash_lock);
4196−
4197− return have_vlans;
4198−}
4199−
42004192 /**
42014193 * i40e_ndo_set_vf_port_vlan
42024194 * @netdev: network interface device structure
@@ -4253,19 +4245,9 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id, · 50 unmodified lines
42534245 /* duplicate request, so just return success */
42544246 goto error_pvid;
42554247
4256− if (i40e_vsi_has_vlans(vsi)) {
4257− dev_err(&pf->pdev->dev,
4258− "VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n",
4259− vf_id);
4260− /* Administrator Error - knock the VF offline until he does
4261− * the right thing by reconfiguring his network correctly
4262− * and then reloading the VF driver.
4263− */
4264− i40e_vc_disable_vf(vf);
4265− /* During reset the VF got a new VSI, so refresh the pointer. */
4266− vsi = pf->vsi[vf->lan_vsi_idx];
4267− }
4268−
4248+ i40e_vc_reset_vf(vf, true);
4249+ /* During reset the VF got a new VSI, so refresh a pointer. */
4250+ vsi = pf->vsi[vf->lan_vsi_idx];
42694251 /* Locked once because multiple functions below iterate list */
42704252 spin_lock_bh(&vsi->mac_filter_hash_lock);
42714253
@@ -4641,7 +4623,7 @@ int i40e_ndo_set_vf_trust(struct net_device *netdev, int vf_id, bool setting) · 369 unmodified lines
46414623 goto out;
46424624
46434625 vf->trusted = setting;
4644− i40e_vc_disable_vf(vf);
4626+ i40e_vc_reset_vf(vf, true);
46454627 dev_info(&pf->pdev->dev, "VF %u is now %strusted\n",
46464628 vf_id, setting ? "" : "un");
46474629
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818
1919 #define I40E_MAX_VF_PROMISC_FLAGS 3
2020
21+#define I40E_VF_STATE_WAIT_COUNT 20
22+
2123 /* Various queue ctrls */
2224 enum i40e_queue_ctrl {
2325 I40E_QUEUE_CTRL_UNKNOWN = 0,
drivers/net/ethernet/intel/iavf/iavf.h+4−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include "iavf_txrx.h"
4040 #include "iavf_fdir.h"
4141 #include "iavf_adv_rss.h"
42+#include <linux/bitmap.h>
4243
4344 #define DEFAULT_DEBUG_LEVEL_SHIFT 3
4445 #define PFX "iavf: "
@@ -304,6 +305,7 @@ struct iavf_adapter { · 259 unmodified lines
304305 #define IAVF_FLAG_AQ_DEL_FDIR_FILTER BIT(26)
305306 #define IAVF_FLAG_AQ_ADD_ADV_RSS_CFG BIT(27)
306307 #define IAVF_FLAG_AQ_DEL_ADV_RSS_CFG BIT(28)
308+#define IAVF_FLAG_AQ_REQUEST_STATS BIT(29)
307309
308310 /* OS defined structs */
309311 struct net_device *netdev;
@@ -443,6 +445,7 @@ int iavf_up(struct iavf_adapter *adapter); · 133 unmodified lines
443445 void iavf_down(struct iavf_adapter *adapter);
444446 int iavf_process_config(struct iavf_adapter *adapter);
445447 void iavf_schedule_reset(struct iavf_adapter *adapter);
448+void iavf_schedule_request_stats(struct iavf_adapter *adapter);
446449 void iavf_reset(struct iavf_adapter *adapter);
447450 void iavf_set_ethtool_ops(struct net_device *netdev);
448451 void iavf_update_stats(struct iavf_adapter *adapter);
@@ -500,4 +503,5 @@ void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter); · 51 unmodified lines
500503 void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
501504 struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
502505 const u8 *macaddr);
506+int iavf_lock_timeout(struct mutex *lock, unsigned int msecs);
503507 #endif /* _IAVF_H_ */
drivers/net/ethernet/intel/iavf/iavf_ethtool.c+83−23
@@ -354,6 +354,9 @@ static void iavf_get_ethtool_stats(struct net_device *netdev, · 353 unmodified lines
354354 struct iavf_adapter *adapter = netdev_priv(netdev);
355355 unsigned int i;
356356
357+ /* Explicitly request stats refresh */
358+ iavf_schedule_request_stats(adapter);
359+
357360 iavf_add_ethtool_stats(&data, adapter, iavf_gstrings_stats);
358361
359362 rcu_read_lock();
@@ -612,23 +615,44 @@ static int iavf_set_ringparam(struct net_device *netdev, · 252 unmodified lines
612615 if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
613616 return -EINVAL;
614617
615− new_tx_count = clamp_t(u32, ring->tx_pending,
616− IAVF_MIN_TXD,
617− IAVF_MAX_TXD);
618− new_tx_count = ALIGN(new_tx_count, IAVF_REQ_DESCRIPTOR_MULTIPLE);
618+ if (ring->tx_pending > IAVF_MAX_TXD ||
619+ ring->tx_pending < IAVF_MIN_TXD ||
620+ ring->rx_pending > IAVF_MAX_RXD ||
621+ ring->rx_pending < IAVF_MIN_RXD) {
622+ netdev_err(netdev, "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d] (increment %d)\n",
623+ ring->tx_pending, ring->rx_pending, IAVF_MIN_TXD,
624+ IAVF_MAX_RXD, IAVF_REQ_DESCRIPTOR_MULTIPLE);
625+ return -EINVAL;
626+ }
627+
628+ new_tx_count = ALIGN(ring->tx_pending, IAVF_REQ_DESCRIPTOR_MULTIPLE);
629+ if (new_tx_count != ring->tx_pending)
630+ netdev_info(netdev, "Requested Tx descriptor count rounded up to %d\n",
631+ new_tx_count);
619632
620− new_rx_count = clamp_t(u32, ring->rx_pending,
621− IAVF_MIN_RXD,
622− IAVF_MAX_RXD);
623− new_rx_count = ALIGN(new_rx_count, IAVF_REQ_DESCRIPTOR_MULTIPLE);
633+ new_rx_count = ALIGN(ring->rx_pending, IAVF_REQ_DESCRIPTOR_MULTIPLE);
634+ if (new_rx_count != ring->rx_pending)
635+ netdev_info(netdev, "Requested Rx descriptor count rounded up to %d\n",
636+ new_rx_count);
624637
625638 /* if nothing to do return success */
626639 if ((new_tx_count == adapter->tx_desc_count) &&
627− (new_rx_count == adapter->rx_desc_count))
640+ (new_rx_count == adapter->rx_desc_count)) {
641+ netdev_dbg(netdev, "Nothing to change, descriptor count is same as requested\n");
628642 return 0;
643+ }
644+
645+ if (new_tx_count != adapter->tx_desc_count) {
646+ netdev_dbg(netdev, "Changing Tx descriptor count from %d to %d\n",
647+ adapter->tx_desc_count, new_tx_count);
648+ adapter->tx_desc_count = new_tx_count;
649+ }
629650
630− adapter->tx_desc_count = new_tx_count;
631− adapter->rx_desc_count = new_rx_count;
651+ if (new_rx_count != adapter->rx_desc_count) {
652+ netdev_dbg(netdev, "Changing Rx descriptor count from %d to %d\n",
653+ adapter->rx_desc_count, new_rx_count);
654+ adapter->rx_desc_count = new_rx_count;
655+ }
632656
633657 if (netif_running(netdev)) {
634658 adapter->flags |= IAVF_FLAG_RESET_NEEDED;
@@ -723,12 +747,31 @@ static int iavf_get_per_queue_coalesce(struct net_device *netdev, u32 queue, · 88 unmodified lines
723747 *
724748 * Change the ITR settings for a specific queue.
725749 **/
726−static void iavf_set_itr_per_queue(struct iavf_adapter *adapter,
727− struct ethtool_coalesce *ec, int queue)
750+static int iavf_set_itr_per_queue(struct iavf_adapter *adapter,
751+ struct ethtool_coalesce *ec, int queue)
728752 {
729753 struct iavf_ring *rx_ring = &adapter->rx_rings[queue];
730754 struct iavf_ring *tx_ring = &adapter->tx_rings[queue];
731755 struct iavf_q_vector *q_vector;
756+ u16 itr_setting;
757+
758+ itr_setting = rx_ring->itr_setting & ~IAVF_ITR_DYNAMIC;
759+
760+ if (ec->rx_coalesce_usecs != itr_setting &&
761+ ec->use_adaptive_rx_coalesce) {
762+ netif_info(adapter, drv, adapter->netdev,
763+ "Rx interrupt throttling cannot be changed if adaptive-rx is enabled\n");
764+ return -EINVAL;
765+ }
766+
767+ itr_setting = tx_ring->itr_setting & ~IAVF_ITR_DYNAMIC;
768+
769+ if (ec->tx_coalesce_usecs != itr_setting &&
770+ ec->use_adaptive_tx_coalesce) {
771+ netif_info(adapter, drv, adapter->netdev,
772+ "Tx interrupt throttling cannot be changed if adaptive-tx is enabled\n");
773+ return -EINVAL;
774+ }
732775
733776 rx_ring->itr_setting = ITR_REG_ALIGN(ec->rx_coalesce_usecs);
734777 tx_ring->itr_setting = ITR_REG_ALIGN(ec->tx_coalesce_usecs);
@@ -751,6 +794,7 @@ static void iavf_set_itr_per_queue(struct iavf_adapter *adapter, · 16 unmodified lines
751794 * the Tx and Rx ITR values based on the values we have entered
752795 * into the q_vector, no need to write the values now.
753796 */
797+ return 0;
754798 }
755799
756800 /**
@@ -792,9 +836,11 @@ static int __iavf_set_coalesce(struct net_device *netdev, · 35 unmodified lines
792836 */
793837 if (queue < 0) {
794838 for (i = 0; i < adapter->num_active_queues; i++)
795− iavf_set_itr_per_queue(adapter, ec, i);
839+ if (iavf_set_itr_per_queue(adapter, ec, i))
840+ return -EINVAL;
796841 } else if (queue < adapter->num_active_queues) {
797− iavf_set_itr_per_queue(adapter, ec, queue);
842+ if (iavf_set_itr_per_queue(adapter, ec, queue))
843+ return -EINVAL;
798844 } else {
799845 netif_info(adapter, drv, netdev, "Invalid queue value, queue range is 0 - %d\n",
800846 adapter->num_active_queues - 1);
@@ -1776,6 +1822,7 @@ static int iavf_set_channels(struct net_device *netdev, · 975 unmodified lines
17761822 {
17771823 struct iavf_adapter *adapter = netdev_priv(netdev);
17781824 u32 num_req = ch->combined_count;
1825+ int i;
17791826
17801827 if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
17811828 adapter->num_tc) {
@@ -1786,7 +1833,7 @@ static int iavf_set_channels(struct net_device *netdev, · 4 unmodified lines
17861833 /* All of these should have already been checked by ethtool before this
17871834 * even gets to us, but just to be sure.
17881835 */
1789− if (num_req > adapter->vsi_res->num_queue_pairs)
1836+ if (num_req == 0 || num_req > adapter->vsi_res->num_queue_pairs)
17901837 return -EINVAL;
17911838
17921839 if (num_req == adapter->num_active_queues)
@@ -1798,6 +1845,20 @@ static int iavf_set_channels(struct net_device *netdev, · 5 unmodified lines
17981845 adapter->num_req_queues = num_req;
17991846 adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
18001847 iavf_schedule_reset(adapter);
1848+
1849+ /* wait for the reset is done */
1850+ for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
1851+ msleep(IAVF_RESET_WAIT_MS);
1852+ if (adapter->flags & IAVF_FLAG_RESET_PENDING)
1853+ continue;
1854+ break;
1855+ }
1856+ if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {
1857+ adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
1858+ adapter->num_active_queues = num_req;
1859+ return -EOPNOTSUPP;
1860+ }
1861+
18011862 return 0;
18021863 }
18031864
@@ -1844,14 +1905,13 @@ static int iavf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, · 40 unmodified lines
18441905
18451906 if (hfunc)
18461907 *hfunc = ETH_RSS_HASH_TOP;
1847− if (!indir)
1848− return 0;
1849−
1850− memcpy(key, adapter->rss_key, adapter->rss_key_size);
1908+ if (key)
1909+ memcpy(key, adapter->rss_key, adapter->rss_key_size);
18511910
1852− /* Each 32 bits pointed by 'indir' is stored with a lut entry */
1853− for (i = 0; i < adapter->rss_lut_size; i++)
1854− indir[i] = (u32)adapter->rss_lut[i];
1911+ if (indir)
1912+ /* Each 32 bits pointed by 'indir' is stored with a lut entry */
1913+ for (i = 0; i < adapter->rss_lut_size; i++)
1914+ indir[i] = (u32)adapter->rss_lut[i];
18551915
18561916 return 0;
18571917 }
drivers/net/ethernet/intel/iavf/iavf_main.c+69−27
@@ -147,7 +147,7 @@ enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw, · 146 unmodified lines
147147 *
148148 * Returns 0 on success, negative on failure
149149 **/
150−static int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
150+int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
151151 {
152152 unsigned int wait, delay = 10;
153153
@@ -174,6 +174,19 @@ void iavf_schedule_reset(struct iavf_adapter *adapter) · 20 unmodified lines
174174 }
175175 }
176176
177+/**
178+ * iavf_schedule_request_stats - Set the flags and schedule statistics request
179+ * @adapter: board private structure
180+ *
181+ * Sets IAVF_FLAG_AQ_REQUEST_STATS flag so iavf_watchdog_task() will explicitly
182+ * request and refresh ethtool stats
183+ **/
184+void iavf_schedule_request_stats(struct iavf_adapter *adapter)
185+{
186+ adapter->aq_required |= IAVF_FLAG_AQ_REQUEST_STATS;
187+ mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0);
188+}
189+
177190 /**
178191 * iavf_tx_timeout - Respond to a Tx Hang
179192 * @netdev: network interface device structure
@@ -696,6 +709,21 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, u16 vlan) · 516 unmodified lines
696709 spin_unlock_bh(&adapter->mac_vlan_list_lock);
697710 }
698711
712+/**
713+ * iavf_restore_filters
714+ * @adapter: board private structure
715+ *
716+ * Restore existing non MAC filters when VF netdev comes back up
717+ **/
718+static void iavf_restore_filters(struct iavf_adapter *adapter)
719+{
720+ u16 vid;
721+
722+ /* re-add all VLAN filters */
723+ for_each_set_bit(vid, adapter->vsi.active_vlans, VLAN_N_VID)
724+ iavf_add_vlan(adapter, vid);
725+}
726+
699727 /**
700728 * iavf_vlan_rx_add_vid - Add a VLAN filter to a device
701729 * @netdev: network device struct
@@ -709,8 +737,11 @@ static int iavf_vlan_rx_add_vid(struct net_device *netdev, · 7 unmodified lines
709737
710738 if (!VLAN_ALLOWED(adapter))
711739 return -EIO;
740+
712741 if (iavf_add_vlan(adapter, vid) == NULL)
713742 return -ENOMEM;
743+
744+ set_bit(vid, adapter->vsi.active_vlans);
714745 return 0;
715746 }
716747
@@ -725,11 +756,10 @@ static int iavf_vlan_rx_kill_vid(struct net_device *netdev, · 8 unmodified lines
725756 {
726757 struct iavf_adapter *adapter = netdev_priv(netdev);
727758
728− if (VLAN_ALLOWED(adapter)) {
729− iavf_del_vlan(adapter, vid);
730− return 0;
731− }
732− return -EIO;
759+ iavf_del_vlan(adapter, vid);
760+ clear_bit(vid, adapter->vsi.active_vlans);
761+
762+ return 0;
733763 }
734764
735765 /**
@@ -1639,8 +1669,7 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter) · 903 unmodified lines
16391669 iavf_set_promiscuous(adapter, FLAG_VF_MULTICAST_PROMISC);
16401670 return 0;
16411671 }
1642−
1643− if ((adapter->aq_required & IAVF_FLAG_AQ_RELEASE_PROMISC) &&
1672+ if ((adapter->aq_required & IAVF_FLAG_AQ_RELEASE_PROMISC) ||
16441673 (adapter->aq_required & IAVF_FLAG_AQ_RELEASE_ALLMULTI)) {
16451674 iavf_set_promiscuous(adapter, 0);
16461675 return 0;
@@ -1688,6 +1717,11 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter) · 41 unmodified lines
16881717 iavf_del_adv_rss_cfg(adapter);
16891718 return 0;
16901719 }
1720+ if (adapter->aq_required & IAVF_FLAG_AQ_REQUEST_STATS) {
1721+ iavf_request_stats(adapter);
1722+ return 0;
1723+ }
1724+
16911725 return -EAGAIN;
16921726 }
16931727
@@ -2123,8 +2157,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter) · 429 unmodified lines
21232157
21242158 iavf_free_misc_irq(adapter);
21252159 iavf_reset_interrupt_capability(adapter);
2126− iavf_free_queues(adapter);
21272160 iavf_free_q_vectors(adapter);
2161+ iavf_free_queues(adapter);
21282162 memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);
21292163 iavf_shutdown_adminq(&adapter->hw);
21302164 adapter->netdev->flags &= ~IFF_UP;
@@ -2152,7 +2186,6 @@ static void iavf_reset_task(struct work_struct *work) · 21 unmodified lines
21522186 struct net_device *netdev = adapter->netdev;
21532187 struct iavf_hw *hw = &adapter->hw;
21542188 struct iavf_mac_filter *f, *ftmp;
2155− struct iavf_vlan_filter *vlf;
21562189 struct iavf_cloud_filter *cf;
21572190 u32 reg_val;
21582191 int i = 0, err;
@@ -2215,6 +2248,7 @@ static void iavf_reset_task(struct work_struct *work) · 56 unmodified lines
22152248 }
22162249
22172250 pci_set_master(adapter->pdev);
2251+ pci_restore_msi_state(adapter->pdev);
22182252
22192253 if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {
22202254 dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
@@ -2233,6 +2267,7 @@ continue_reset: · 12 unmodified lines
22332267 (adapter->state == __IAVF_RESETTING));
22342268
22352269 if (running) {
2270+ netdev->flags &= ~IFF_UP;
22362271 netif_carrier_off(netdev);
22372272 netif_tx_stop_all_queues(netdev);
22382273 adapter->link_up = false;
@@ -2292,11 +2327,6 @@ continue_reset: · 53 unmodified lines
22922327 list_for_each_entry(f, &adapter->mac_filter_list, list) {
22932328 f->add = true;
22942329 }
2295− /* re-add all VLAN filters */
2296− list_for_each_entry(vlf, &adapter->vlan_filter_list, list) {
2297− vlf->add = true;
2298− }
2299−
23002330 spin_unlock_bh(&adapter->mac_vlan_list_lock);
23012331
23022332 /* check if TCs are running and re-add all cloud filters */
@@ -2310,7 +2340,6 @@ continue_reset: · 7 unmodified lines
23102340 spin_unlock_bh(&adapter->cloud_filter_list_lock);
23112341
23122342 adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
2313− adapter->aq_required |= IAVF_FLAG_AQ_ADD_VLAN_FILTER;
23142343 adapter->aq_required |= IAVF_FLAG_AQ_ADD_CLOUD_FILTER;
23152344 iavf_misc_irq_enable(adapter);
23162345
@@ -2344,7 +2373,7 @@ continue_reset: · 27 unmodified lines
23442373 * to __IAVF_RUNNING
23452374 */
23462375 iavf_up_complete(adapter);
2347−
2376+ netdev->flags |= IFF_UP;
23482377 iavf_irq_enable(adapter, true);
23492378 } else {
23502379 iavf_change_state(adapter, __IAVF_DOWN);
@@ -2357,8 +2386,10 @@ continue_reset: · 6 unmodified lines
23572386 reset_err:
23582387 mutex_unlock(&adapter->client_lock);
23592388 mutex_unlock(&adapter->crit_lock);
2360− if (running)
2389+ if (running) {
23612390 iavf_change_state(adapter, __IAVF_RUNNING);
2391+ netdev->flags |= IFF_UP;
2392+ }
23622393 dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
23632394 iavf_close(netdev);
23642395 }
@@ -2410,7 +2441,7 @@ static void iavf_adminq_task(struct work_struct *work) · 45 unmodified lines
24102441
24112442 /* check for error indications */
24122443 val = rd32(hw, hw->aq.arq.len);
2413− if (val == 0xdeadbeef) /* indicates device in reset */
2444+ if (val == 0xdeadbeef || val == 0xffffffff) /* device in reset */
24142445 goto freedom;
24152446 oldval = val;
24162447 if (val & IAVF_VF_ARQLEN1_ARQVFE_MASK) {
@@ -3095,8 +3126,10 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter, · 678 unmodified lines
30953126 return -ENOMEM;
30963127
30973128 while (!mutex_trylock(&adapter->crit_lock)) {
3098− if (--count == 0)
3099− goto err;
3129+ if (--count == 0) {
3130+ kfree(filter);
3131+ return err;
3132+ }
31003133 udelay(1);
31013134 }
31023135
@@ -3107,11 +3140,11 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter, · 4 unmodified lines
31073140 /* start out with flow type and eth type IPv4 to begin with */
31083141 filter->f.flow_type = VIRTCHNL_TCP_V4_FLOW;
31093142 err = iavf_parse_cls_flower(adapter, cls_flower, filter);
3110− if (err < 0)
3143+ if (err)
31113144 goto err;
31123145
31133146 err = iavf_handle_tclass(adapter, tc, filter);
3114− if (err < 0)
3147+ if (err)
31153148 goto err;
31163149
31173150 /* add filter to the list */
@@ -3308,6 +3341,9 @@ static int iavf_open(struct net_device *netdev) · 190 unmodified lines
33083341
33093342 spin_unlock_bh(&adapter->mac_vlan_list_lock);
33103343
3344+ /* Restore VLAN filters that were removed with IFF_DOWN */
3345+ iavf_restore_filters(adapter);
3346+
33113347 iavf_configure(adapter);
33123348
33133349 iavf_up_complete(adapter);
@@ -3415,11 +3451,16 @@ static int iavf_set_features(struct net_device *netdev, · 101 unmodified lines
34153451 {
34163452 struct iavf_adapter *adapter = netdev_priv(netdev);
34173453
3418− /* Don't allow changing VLAN_RX flag when adapter is not capable
3419− * of VLAN offload
3454+ /* Don't allow enabling VLAN features when adapter is not capable
3455+ * of VLAN offload/filtering
34203456 */
34213457 if (!VLAN_ALLOWED(adapter)) {
3422− if ((netdev->features ^ features) & NETIF_F_HW_VLAN_CTAG_RX)
3458+ netdev->hw_features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
3459+ NETIF_F_HW_VLAN_CTAG_TX |
3460+ NETIF_F_HW_VLAN_CTAG_FILTER);
3461+ if (features & (NETIF_F_HW_VLAN_CTAG_RX |
3462+ NETIF_F_HW_VLAN_CTAG_TX |
3463+ NETIF_F_HW_VLAN_CTAG_FILTER))
34233464 return -EINVAL;
34243465 } else if ((netdev->features ^ features) & NETIF_F_HW_VLAN_CTAG_RX) {
34253466 if (features & NETIF_F_HW_VLAN_CTAG_RX)
@@ -3503,7 +3544,8 @@ static netdev_features_t iavf_fix_features(struct net_device *netdev, · 77 unmodified lines
35033544 {
35043545 struct iavf_adapter *adapter = netdev_priv(netdev);
35053546
3506− if (!(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
3547+ if (adapter->vf_res &&
3548+ !(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
35073549 features &= ~(NETIF_F_HW_VLAN_CTAG_TX |
35083550 NETIF_F_HW_VLAN_CTAG_RX |
35093551 NETIF_F_HW_VLAN_CTAG_FILTER);
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c+44−3
@@ -607,7 +607,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter) · 606 unmodified lines
607607 if (f->add)
608608 count++;
609609 }
610− if (!count) {
610+ if (!count || !VLAN_ALLOWED(adapter)) {
611611 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_VLAN_FILTER;
612612 spin_unlock_bh(&adapter->mac_vlan_list_lock);
613613 return;
@@ -673,9 +673,19 @@ void iavf_del_vlans(struct iavf_adapter *adapter) · 59 unmodified lines
673673
674674 spin_lock_bh(&adapter->mac_vlan_list_lock);
675675
676− list_for_each_entry(f, &adapter->vlan_filter_list, list) {
677− if (f->remove)
676+ list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) {
677+ /* since VLAN capabilities are not allowed, we dont want to send
678+ * a VLAN delete request because it will most likely fail and
679+ * create unnecessary errors/noise, so just free the VLAN
680+ * filters marked for removal to enable bailing out before
681+ * sending a virtchnl message
682+ */
683+ if (f->remove && !VLAN_ALLOWED(adapter)) {
684+ list_del(&f->list);
685+ kfree(f);
686+ } else if (f->remove) {
678687 count++;
688+ }
679689 }
680690 if (!count) {
681691 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER;
@@ -784,6 +794,8 @@ void iavf_request_stats(struct iavf_adapter *adapter) · 102 unmodified lines
784794 /* no error message, this isn't crucial */
785795 return;
786796 }
797+
798+ adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_STATS;
787799 adapter->current_op = VIRTCHNL_OP_GET_STATS;
788800 vqs.vsi_id = adapter->vsi_res->vsi_id;
789801 /* queue maps are ignored for this message - only the vsi is used */
@@ -1722,8 +1734,37 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 932 unmodified lines
17221734 }
17231735 spin_lock_bh(&adapter->mac_vlan_list_lock);
17241736 iavf_add_filter(adapter, adapter->hw.mac.addr);
1737+
1738+ if (VLAN_ALLOWED(adapter)) {
1739+ if (!list_empty(&adapter->vlan_filter_list)) {
1740+ struct iavf_vlan_filter *vlf;
1741+
1742+ /* re-add all VLAN filters over virtchnl */
1743+ list_for_each_entry(vlf,
1744+ &adapter->vlan_filter_list,
1745+ list)
1746+ vlf->add = true;
1747+
1748+ adapter->aq_required |=
1749+ IAVF_FLAG_AQ_ADD_VLAN_FILTER;
1750+ }
1751+ }
1752+
17251753 spin_unlock_bh(&adapter->mac_vlan_list_lock);
17261754 iavf_process_config(adapter);
1755+
1756+ /* unlock crit_lock before acquiring rtnl_lock as other
1757+ * processes holding rtnl_lock could be waiting for the same
1758+ * crit_lock
1759+ */
1760+ mutex_unlock(&adapter->crit_lock);
1761+ rtnl_lock();
1762+ netdev_update_features(adapter->netdev);
1763+ rtnl_unlock();
1764+ if (iavf_lock_timeout(&adapter->crit_lock, 10000))
1765+ dev_warn(&adapter->pdev->dev, "failed to acquire crit_lock in %s\n",
1766+ __FUNCTION__);
1767+
17271768 }
17281769 break;
17291770 case VIRTCHNL_OP_ENABLE_QUEUES:
drivers/net/ethernet/intel/ice/ice_dcb_nl.c+12−6
@@ -97,6 +97,9 @@ static int ice_dcbnl_setets(struct net_device *netdev, struct ieee_ets *ets) · 96 unmodified lines
9797
9898 new_cfg->etscfg.maxtcs = pf->hw.func_caps.common_cap.maxtc;
9999
100+ if (!bwcfg)
101+ new_cfg->etscfg.tcbwtable[0] = 100;
102+
100103 if (!bwrec)
101104 new_cfg->etsrec.tcbwtable[0] = 100;
102105
@@ -167,15 +170,18 @@ static u8 ice_dcbnl_setdcbx(struct net_device *netdev, u8 mode) · 64 unmodified lines
167170 if (mode == pf->dcbx_cap)
168171 return ICE_DCB_NO_HW_CHG;
169172
170− pf->dcbx_cap = mode;
171173 qos_cfg = &pf->hw.port_info->qos_cfg;
172− if (mode & DCB_CAP_DCBX_VER_CEE) {
173− if (qos_cfg->local_dcbx_cfg.pfc_mode == ICE_QOS_MODE_DSCP)
174− return ICE_DCB_NO_HW_CHG;
174+
175+ /* DSCP configuration is not DCBx negotiated */
176+ if (qos_cfg->local_dcbx_cfg.pfc_mode == ICE_QOS_MODE_DSCP)
177+ return ICE_DCB_NO_HW_CHG;
178+
179+ pf->dcbx_cap = mode;
180+
181+ if (mode & DCB_CAP_DCBX_VER_CEE)
175182 qos_cfg->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_CEE;
176− } else {
183+ else
177184 qos_cfg->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_IEEE;
178− }
179185
180186 dev_info(ice_pf_to_dev(pf), "DCBx mode = 0x%x\n", mode);
181187 return ICE_DCB_HW_CHG_RST;
drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c+2−2
@@ -1268,7 +1268,7 @@ ice_fdir_write_all_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, · 1267 unmodified lines
12681268 bool is_tun = tun == ICE_FD_HW_SEG_TUN;
12691269 int err;
12701270
1271− if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num))
1271+ if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num, TNL_ALL))
12721272 continue;
12731273 err = ice_fdir_write_fltr(pf, input, add, is_tun);
12741274 if (err)
@@ -1652,7 +1652,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) · 377 unmodified lines
16521652 }
16531653
16541654 /* return error if not an update and no available filters */
1655− fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port) ? 2 : 1;
1655+ fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port, TNL_ALL) ? 2 : 1;
16561656 if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) &&
16571657 ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) {
16581658 dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");
drivers/net/ethernet/intel/ice/ice_fdir.c+1−1
@@ -924,7 +924,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, · 923 unmodified lines
924924 memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len);
925925 loc = pkt;
926926 } else {
927− if (!ice_get_open_tunnel_port(hw, &tnl_port))
927+ if (!ice_get_open_tunnel_port(hw, &tnl_port, TNL_ALL))
928928 return ICE_ERR_DOES_NOT_EXIST;
929929 if (!ice_fdir_pkt[idx].tun_pkt)
930930 return ICE_ERR_PARAM;
drivers/net/ethernet/intel/ice/ice_flex_pipe.c+5−2
@@ -1899,9 +1899,11 @@ static struct ice_buf *ice_pkg_buf(struct ice_buf_build *bld) · 1898 unmodified lines
18991899 * ice_get_open_tunnel_port - retrieve an open tunnel port
19001900 * @hw: pointer to the HW structure
19011901 * @port: returns open port
1902+ * @type: type of tunnel, can be TNL_LAST if it doesn't matter
19021903 */
19031904 bool
1904−ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port)
1905+ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port,
1906+ enum ice_tunnel_type type)
19051907 {
19061908 bool res = false;
19071909 u16 i;
@@ -1909,7 +1911,8 @@ ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port) · 1 unmodified line
19091911 mutex_lock(&hw->tnl_lock);
19101912
19111913 for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++)
1912− if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].port) {
1914+ if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].port &&
1915+ (type == TNL_LAST || type == hw->tnl.tbl[i].type)) {
19131916 *port = hw->tnl.tbl[i].port;
19141917 res = true;
19151918 break;
drivers/net/ethernet/intel/ice/ice_flex_pipe.h+2−1
@@ -33,7 +33,8 @@ enum ice_status · 32 unmodified lines
3333 ice_get_sw_fv_list(struct ice_hw *hw, u8 *prot_ids, u16 ids_cnt,
3434 unsigned long *bm, struct list_head *fv_list);
3535 bool
36−ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port);
36+ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port,
37+ enum ice_tunnel_type type);
3738 int ice_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,
3839 unsigned int idx, struct udp_tunnel_info *ti);
3940 int ice_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table,
drivers/net/ethernet/intel/ice/ice_lib.c+7−2
@@ -89,8 +89,13 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi) · 88 unmodified lines
8989 if (!vsi->rx_rings)
9090 goto err_rings;
9191
92− /* XDP will have vsi->alloc_txq Tx queues as well, so double the size */
93− vsi->txq_map = devm_kcalloc(dev, (2 * vsi->alloc_txq),
92+ /* txq_map needs to have enough space to track both Tx (stack) rings
93+ * and XDP rings; at this point vsi->num_xdp_txq might not be set,
94+ * so use num_possible_cpus() as we want to always provide XDP ring
95+ * per CPU, regardless of queue count settings from user that might
96+ * have come from ethtool's set_channels() callback;
97+ */
98+ vsi->txq_map = devm_kcalloc(dev, (vsi->alloc_txq + num_possible_cpus()),
9499 sizeof(*vsi->txq_map), GFP_KERNEL);
95100
96101 if (!vsi->txq_map)
drivers/net/ethernet/intel/ice/ice_main.c+38−12
@@ -2609,7 +2609,18 @@ int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog) · 2608 unmodified lines
26092609 ice_stat_str(status));
26102610 goto clear_xdp_rings;
26112611 }
2612− ice_vsi_assign_bpf_prog(vsi, prog);
2612+
2613+ /* assign the prog only when it's not already present on VSI;
2614+ * this flow is a subject of both ethtool -L and ndo_bpf flows;
2615+ * VSI rebuild that happens under ethtool -L can expose us to
2616+ * the bpf_prog refcount issues as we would be swapping same
2617+ * bpf_prog pointers from vsi->xdp_prog and calling bpf_prog_put
2618+ * on it as it would be treated as an 'old_prog'; for ndo_bpf
2619+ * this is not harmful as dev_xdp_install bumps the refcount
2620+ * before calling the op exposed by the driver;
2621+ */
2622+ if (!ice_is_xdp_ena_vsi(vsi))
2623+ ice_vsi_assign_bpf_prog(vsi, prog);
26132624
26142625 return 0;
26152626 clear_xdp_rings:
@@ -2785,6 +2796,11 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog, · 169 unmodified lines
27852796 if (xdp_ring_err)
27862797 NL_SET_ERR_MSG_MOD(extack, "Freeing XDP Tx resources failed");
27872798 } else {
2799+ /* safe to call even when prog == vsi->xdp_prog as
2800+ * dev_xdp_install in net/core/dev.c incremented prog's
2801+ * refcount so corresponding bpf_prog_put won't cause
2802+ * underflow
2803+ */
27882804 ice_vsi_assign_bpf_prog(vsi, prog);
27892805 }
27902806
@@ -5865,6 +5881,9 @@ static int ice_up_complete(struct ice_vsi *vsi) · 3074 unmodified lines
58655881 netif_carrier_on(vsi->netdev);
58665882 }
58675883
5884+ /* clear this now, and the first stats read will be used as baseline */
5885+ vsi->stat_offsets_loaded = false;
5886+
58685887 ice_service_task_schedule(pf);
58695888
58705889 return 0;
@@ -5911,14 +5930,15 @@ ice_fetch_u64_stats_per_ring(struct u64_stats_sync *syncp, struct ice_q_stats st · 40 unmodified lines
59115930 /**
59125931 * ice_update_vsi_tx_ring_stats - Update VSI Tx ring stats counters
59135932 * @vsi: the VSI to be updated
5933+ * @vsi_stats: the stats struct to be updated
59145934 * @rings: rings to work on
59155935 * @count: number of rings
59165936 */
59175937 static void
5918−ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi, struct ice_tx_ring **rings,
5919− u16 count)
5938+ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi,
5939+ struct rtnl_link_stats64 *vsi_stats,
5940+ struct ice_tx_ring **rings, u16 count)
59205941 {
5921− struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;
59225942 u16 i;
59235943
59245944 for (i = 0; i < count; i++) {
@@ -5942,15 +5962,13 @@ ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi, struct ice_tx_ring **rings, · 17 unmodified lines
59425962 */
59435963 static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
59445964 {
5945− struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;
5965+ struct rtnl_link_stats64 *vsi_stats;
59465966 u64 pkts, bytes;
59475967 int i;
59485968
5949− /* reset netdev stats */
5950− vsi_stats->tx_packets = 0;
5951− vsi_stats->tx_bytes = 0;
5952− vsi_stats->rx_packets = 0;
5953− vsi_stats->rx_bytes = 0;
5969+ vsi_stats = kzalloc(sizeof(*vsi_stats), GFP_ATOMIC);
5970+ if (!vsi_stats)
5971+ return;
59545972
59555973 /* reset non-netdev (extended) stats */
59565974 vsi->tx_restart = 0;
@@ -5962,7 +5980,8 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi) · 5 unmodified lines
59625980 rcu_read_lock();
59635981
59645982 /* update Tx rings counters */
5965− ice_update_vsi_tx_ring_stats(vsi, vsi->tx_rings, vsi->num_txq);
5983+ ice_update_vsi_tx_ring_stats(vsi, vsi_stats, vsi->tx_rings,
5984+ vsi->num_txq);
59665985
59675986 /* update Rx rings counters */
59685987 ice_for_each_rxq(vsi, i) {
@@ -5977,10 +5996,17 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi) · 8 unmodified lines
59775996
59785997 /* update XDP Tx rings counters */
59795998 if (ice_is_xdp_ena_vsi(vsi))
5980− ice_update_vsi_tx_ring_stats(vsi, vsi->xdp_rings,
5999+ ice_update_vsi_tx_ring_stats(vsi, vsi_stats, vsi->xdp_rings,
59816000 vsi->num_xdp_txq);
59826001
59836002 rcu_read_unlock();
6003+
6004+ vsi->net_stats.tx_packets = vsi_stats->tx_packets;
6005+ vsi->net_stats.tx_bytes = vsi_stats->tx_bytes;
6006+ vsi->net_stats.rx_packets = vsi_stats->rx_packets;
6007+ vsi->net_stats.rx_bytes = vsi_stats->rx_bytes;
6008+
6009+ kfree(vsi_stats);
59846010 }
59856011
59866012 /**
drivers/net/ethernet/intel/ice/ice_switch.c+13−6
@@ -3796,10 +3796,13 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { · 3795 unmodified lines
37963796 * ice_find_recp - find a recipe
37973797 * @hw: pointer to the hardware structure
37983798 * @lkup_exts: extension sequence to match
3799+ * @tun_type: type of recipe tunnel
37993800 *
38003801 * Returns index of matching recipe, or ICE_MAX_NUM_RECIPES if not found.
38013802 */
3802−static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts)
3803+static u16
3804+ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,
3805+ enum ice_sw_tunnel_type tun_type)
38033806 {
38043807 bool refresh_required = true;
38053808 struct ice_sw_recipe *recp;
@@ -3860,8 +3863,9 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts) · 54 unmodified lines
38603863 }
38613864 /* If for "i"th recipe the found was never set to false
38623865 * then it means we found our match
3866+ * Also tun type of recipe needs to be checked
38633867 */
3864− if (found)
3868+ if (found && recp[i].tun_type == tun_type)
38653869 return i; /* Return the recipe ID */
38663870 }
38673871 }
@@ -4651,11 +4655,12 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, · 783 unmodified lines
46514655 }
46524656
46534657 /* Look for a recipe which matches our requested fv / mask list */
4654− *rid = ice_find_recp(hw, lkup_exts);
4658+ *rid = ice_find_recp(hw, lkup_exts, rinfo->tun_type);
46554659 if (*rid < ICE_MAX_NUM_RECIPES)
46564660 /* Success if found a recipe that match the existing criteria */
46574661 goto err_unroll;
46584662
4663+ rm->tun_type = rinfo->tun_type;
46594664 /* Recipe we need does not exist, add a recipe */
46604665 status = ice_add_sw_recipe(hw, rm, profiles);
46614666 if (status)
@@ -4958,11 +4963,13 @@ ice_fill_adv_packet_tun(struct ice_hw *hw, enum ice_sw_tunnel_type tun_type, · 296 unmodified lines
49584963
49594964 switch (tun_type) {
49604965 case ICE_SW_TUN_VXLAN:
4966+ if (!ice_get_open_tunnel_port(hw, &open_port, TNL_VXLAN))
4967+ return ICE_ERR_CFG;
4968+ break;
49614969 case ICE_SW_TUN_GENEVE:
4962− if (!ice_get_open_tunnel_port(hw, &open_port))
4970+ if (!ice_get_open_tunnel_port(hw, &open_port, TNL_GENEVE))
49634971 return ICE_ERR_CFG;
49644972 break;
4965−
49664973 default:
49674974 /* Nothing needs to be done for this tunnel type */
49684975 return 0;
@@ -5555,7 +5562,7 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, · 586 unmodified lines
55555562 if (status)
55565563 return status;
55575564
5558− rid = ice_find_recp(hw, &lkup_exts);
5565+ rid = ice_find_recp(hw, &lkup_exts, rinfo->tun_type);
55595566 /* If did not find a recipe that match the existing criteria */
55605567 if (rid == ICE_MAX_NUM_RECIPES)
55615568 return ICE_ERR_PARAM;
drivers/net/ethernet/intel/ice/ice_tc_lib.c+12−18
@@ -74,21 +74,13 @@ static enum ice_protocol_type ice_proto_type_from_ipv6(bool inner) · 73 unmodified lines
7474 return inner ? ICE_IPV6_IL : ICE_IPV6_OFOS;
7575 }
7676
77−static enum ice_protocol_type
78−ice_proto_type_from_l4_port(bool inner, u16 ip_proto)
77+static enum ice_protocol_type ice_proto_type_from_l4_port(u16 ip_proto)
7978 {
80− if (inner) {
81− switch (ip_proto) {
82− case IPPROTO_UDP:
83− return ICE_UDP_ILOS;
84− }
85− } else {
86− switch (ip_proto) {
87− case IPPROTO_TCP:
88− return ICE_TCP_IL;
89− case IPPROTO_UDP:
90− return ICE_UDP_OF;
91− }
79+ switch (ip_proto) {
80+ case IPPROTO_TCP:
81+ return ICE_TCP_IL;
82+ case IPPROTO_UDP:
83+ return ICE_UDP_ILOS;
9284 }
9385
9486 return 0;
@@ -191,8 +183,9 @@ ice_tc_fill_tunnel_outer(u32 flags, struct ice_tc_flower_fltr *fltr, · 96 unmodified lines
191183 i++;
192184 }
193185
194− if (flags & ICE_TC_FLWR_FIELD_ENC_DEST_L4_PORT) {
195− list[i].type = ice_proto_type_from_l4_port(false, hdr->l3_key.ip_proto);
186+ if ((flags & ICE_TC_FLWR_FIELD_ENC_DEST_L4_PORT) &&
187+ hdr->l3_key.ip_proto == IPPROTO_UDP) {
188+ list[i].type = ICE_UDP_OF;
196189 list[i].h_u.l4_hdr.dst_port = hdr->l4_key.dst_port;
197190 list[i].m_u.l4_hdr.dst_port = hdr->l4_mask.dst_port;
198191 i++;
@@ -317,7 +310,7 @@ ice_tc_fill_rules(struct ice_hw *hw, u32 flags, · 118 unmodified lines
317310 ICE_TC_FLWR_FIELD_SRC_L4_PORT)) {
318311 struct ice_tc_l4_hdr *l4_key, *l4_mask;
319312
320− list[i].type = ice_proto_type_from_l4_port(inner, headers->l3_key.ip_proto);
313+ list[i].type = ice_proto_type_from_l4_port(headers->l3_key.ip_proto);
321314 l4_key = &headers->l4_key;
322315 l4_mask = &headers->l4_mask;
323316
@@ -802,7 +795,8 @@ ice_parse_tunnel_attr(struct net_device *dev, struct flow_rule *rule, · 478 unmodified lines
802795 headers->l3_mask.ttl = match.mask->ttl;
803796 }
804797
805− if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_PORTS)) {
798+ if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_PORTS) &&
799+ fltr->tunnel_type != TNL_VXLAN && fltr->tunnel_type != TNL_GENEVE) {
806800 struct flow_match_ports match;
807801
808802 flow_rule_match_enc_ports(rule, &match);
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c+6−0
@@ -1617,6 +1617,7 @@ bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr) · 1616 unmodified lines
16171617 ice_vc_set_default_allowlist(vf);
16181618
16191619 ice_vf_fdir_exit(vf);
1620+ ice_vf_fdir_init(vf);
16201621 /* clean VF control VSI when resetting VFs since it should be
16211622 * setup only when VF creates its first FDIR rule.
16221623 */
@@ -1747,6 +1748,7 @@ bool ice_reset_vf(struct ice_vf *vf, bool is_vflr) · 124 unmodified lines
17471748 }
17481749
17491750 ice_vf_fdir_exit(vf);
1751+ ice_vf_fdir_init(vf);
17501752 /* clean VF control VSI when resetting VF since it should be setup
17511753 * only when VF creates its first FDIR rule.
17521754 */
@@ -2021,6 +2023,10 @@ static int ice_ena_vfs(struct ice_pf *pf, u16 num_vfs) · 268 unmodified lines
20212023 if (ret)
20222024 goto err_unroll_sriov;
20232025
2026+ /* rearm global interrupts */
2027+ if (test_and_clear_bit(ICE_OICR_INTR_DIS, pf->state))
2028+ ice_irq_dynamic_ena(hw, NULL, NULL);
2029+
20242030 return 0;
20252031
20262032 err_unroll_sriov:
drivers/net/ethernet/intel/ice/ice_xsk.c+1−0
@@ -383,6 +383,7 @@ bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count) · 382 unmodified lines
383383 while (i--) {
384384 dma = xsk_buff_xdp_get_dma(*xdp);
385385 rx_desc->read.pkt_addr = cpu_to_le64(dma);
386+ rx_desc->wb.status_error0 = 0;
386387
387388 rx_desc++;
388389 xdp++;
drivers/net/ethernet/intel/igb/igb_main.c+1−1
@@ -8026,7 +8026,7 @@ static int igb_poll(struct napi_struct *napi, int budget) · 8025 unmodified lines
80268026 if (likely(napi_complete_done(napi, work_done)))
80278027 igb_ring_irq_enable(q_vector);
80288028
8029− return min(work_done, budget - 1);
8029+ return work_done;
80308030 }
80318031
80328032 /**
drivers/net/ethernet/lantiq_etop.c+17−3
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/io.h>
2626 #include <linux/dma-mapping.h>
2727 #include <linux/module.h>
28+#include <linux/property.h>
2829
2930 #include <asm/checksum.h>
3031
@@ -239,6 +240,7 @@ ltq_etop_hw_init(struct net_device *dev) · 208 unmodified lines
239240 {
240241 struct ltq_etop_priv *priv = netdev_priv(dev);
241242 int i;
243+ int err;
242244
243245 ltq_pmu_enable(PMU_PPE);
244246
@@ -273,7 +275,13 @@ ltq_etop_hw_init(struct net_device *dev) · 28 unmodified lines
273275
274276 if (IS_TX(i)) {
275277 ltq_dma_alloc_tx(&ch->dma);
276− request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
278+ err = request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
279+ if (err) {
280+ netdev_err(dev,
281+ "Unable to get Tx DMA IRQ %d\n",
282+ irq);
283+ return err;
284+ }
277285 } else if (IS_RX(i)) {
278286 ltq_dma_alloc_rx(&ch->dma);
279287 for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
@@ -281,7 +289,13 @@ ltq_etop_hw_init(struct net_device *dev) · 1 unmodified line
281289 if (ltq_etop_alloc_skb(ch))
282290 return -ENOMEM;
283291 ch->dma.desc = 0;
284− request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
292+ err = request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
293+ if (err) {
294+ netdev_err(dev,
295+ "Unable to get Rx DMA IRQ %d\n",
296+ irq);
297+ return err;
298+ }
285299 }
286300 ch->dma.irq = irq;
287301 }
@@ -726,7 +740,7 @@ static struct platform_driver ltq_mii_driver = { · 438 unmodified lines
726740 },
727741 };
728742
729−int __init
743+static int __init
730744 init_ltq_etop(void)
731745 {
732746 int ret = platform_driver_probe(&ltq_mii_driver, ltq_etop_probe);
drivers/net/ethernet/marvell/mvmdio.c+2−0
@@ -429,12 +429,14 @@ static const struct of_device_id orion_mdio_match[] = { · 428 unmodified lines
429429 };
430430 MODULE_DEVICE_TABLE(of, orion_mdio_match);
431431
432+#ifdef CONFIG_ACPI
432433 static const struct acpi_device_id orion_mdio_acpi_match[] = {
433434 { "MRVL0100", BUS_TYPE_SMI },
434435 { "MRVL0101", BUS_TYPE_XSMI },
435436 { },
436437 };
437438 MODULE_DEVICE_TABLE(acpi, orion_mdio_acpi_match);
439+#endif
438440
439441 static struct platform_driver orion_mdio_driver = {
440442 .probe = orion_mdio_probe,
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+11−9
@@ -2960,11 +2960,11 @@ static int mvpp2_rxq_init(struct mvpp2_port *port, · 2959 unmodified lines
29602960 mvpp2_rxq_status_update(port, rxq->id, 0, rxq->size);
29612961
29622962 if (priv->percpu_pools) {
2963− err = xdp_rxq_info_reg(&rxq->xdp_rxq_short, port->dev, rxq->id, 0);
2963+ err = xdp_rxq_info_reg(&rxq->xdp_rxq_short, port->dev, rxq->logic_rxq, 0);
29642964 if (err < 0)
29652965 goto err_free_dma;
29662966
2967− err = xdp_rxq_info_reg(&rxq->xdp_rxq_long, port->dev, rxq->id, 0);
2967+ err = xdp_rxq_info_reg(&rxq->xdp_rxq_long, port->dev, rxq->logic_rxq, 0);
29682968 if (err < 0)
29692969 goto err_unregister_rxq_short;
29702970
@@ -5017,11 +5017,13 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu) · 2046 unmodified lines
50175017 mtu = ALIGN(MVPP2_RX_PKT_SIZE(mtu), 8);
50185018 }
50195019
5020+ if (port->xdp_prog && mtu > MVPP2_MAX_RX_BUF_SIZE) {
5021+ netdev_err(dev, "Illegal MTU value %d (> %d) for XDP mode\n",
5022+ mtu, (int)MVPP2_MAX_RX_BUF_SIZE);
5023+ return -EINVAL;
5024+ }
5025+
50205026 if (MVPP2_RX_PKT_SIZE(mtu) > MVPP2_BM_LONG_PKT_SIZE) {
5021− if (port->xdp_prog) {
5022− netdev_err(dev, "Jumbo frames are not supported with XDP\n");
5023− return -EINVAL;
5024− }
50255027 if (priv->percpu_pools) {
50265028 netdev_warn(dev, "mtu %d too high, switching to shared buffers", mtu);
50275029 mvpp2_bm_switch_buffers(priv, false);
@@ -5307,8 +5309,8 @@ static int mvpp2_xdp_setup(struct mvpp2_port *port, struct netdev_bpf *bpf) · 279 unmodified lines
53075309 bool running = netif_running(port->dev);
53085310 bool reset = !prog != !port->xdp_prog;
53095311
5310− if (port->dev->mtu > ETH_DATA_LEN) {
5311− NL_SET_ERR_MSG_MOD(bpf->extack, "XDP is not supported with jumbo frames enabled");
5312+ if (port->dev->mtu > MVPP2_MAX_RX_BUF_SIZE) {
5313+ NL_SET_ERR_MSG_MOD(bpf->extack, "MTU too large for XDP");
53125314 return -EOPNOTSUPP;
53135315 }
53145316
@@ -7456,7 +7458,7 @@ static int mvpp2_probe(struct platform_device *pdev) · 2141 unmodified lines
74567458
74577459 shared = num_present_cpus() - priv->nthreads;
74587460 if (shared > 0)
7459− bitmap_fill(&priv->lock_map,
7461+ bitmap_set(&priv->lock_map, 0,
74607462 min_t(int, shared, MVPP2_MAX_THREADS));
74617463
74627464 for (i = 0; i < MVPP2_MAX_THREADS; i++) {
drivers/net/ethernet/marvell/octeontx2/af/rvu.c+1−1
@@ -2341,7 +2341,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, · 2340 unmodified lines
23412341 goto free_regions;
23422342 break;
23432343 default:
2344− return err;
2344+ goto free_regions;
23452345 }
23462346
23472347 mw->mbox_wq = alloc_workqueue(name,
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c+10−7
@@ -236,10 +236,11 @@ static ssize_t rvu_dbg_lmtst_map_table_display(struct file *filp, · 235 unmodified lines
236236 u64 lmt_addr, val, tbl_base;
237237 int pf, vf, num_vfs, hw_vfs;
238238 void __iomem *lmt_map_base;
239− int index = 0, off = 0;
240− int bytes_not_copied;
241239 int buf_size = 10240;
240+ size_t off = 0;
241+ int index = 0;
242242 char *buf;
243+ int ret;
243244
244245 /* don't allow partial reads */
245246 if (*ppos != 0)
@@ -303,15 +304,17 @@ static ssize_t rvu_dbg_lmtst_map_table_display(struct file *filp, · 57 unmodified lines
303304 }
304305 off += scnprintf(&buf[off], buf_size - 1 - off, "\n");
305306
306− bytes_not_copied = copy_to_user(buffer, buf, off);
307+ ret = min(off, count);
308+ if (copy_to_user(buffer, buf, ret))
309+ ret = -EFAULT;
307310 kfree(buf);
308311
309312 iounmap(lmt_map_base);
310− if (bytes_not_copied)
311− return -EFAULT;
313+ if (ret < 0)
314+ return ret;
312315
313− *ppos = off;
314− return off;
316+ *ppos = ret;
317+ return ret;
315318 }
316319
317320 RVU_DEBUG_FOPS(lmtst_map_table, lmtst_map_table_display, NULL);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c+2−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 *
66 */
77
8+#include <linux/module.h>
9+
810 #include "otx2_common.h"
911 #include "otx2_ptp.h"
1012
drivers/net/ethernet/marvell/prestera/prestera_switchdev.c+3−5
@@ -497,8 +497,8 @@ int prestera_bridge_port_join(struct net_device *br_dev, · 496 unmodified lines
497497
498498 br_port = prestera_bridge_port_add(bridge, port->dev);
499499 if (IS_ERR(br_port)) {
500− err = PTR_ERR(br_port);
501− goto err_brport_create;
500+ prestera_bridge_put(bridge);
501+ return PTR_ERR(br_port);
502502 }
503503
504504 err = switchdev_bridge_port_offload(br_port->dev, port->dev, NULL,
@@ -519,8 +519,6 @@ err_port_join: · 14 unmodified lines
519519 switchdev_bridge_port_unoffload(br_port->dev, NULL, NULL, NULL);
520520 err_switchdev_offload:
521521 prestera_bridge_port_put(br_port);
522−err_brport_create:
523− prestera_bridge_put(bridge);
524522 return err;
525523 }
526524
@@ -1124,7 +1122,7 @@ static int prestera_switchdev_blk_event(struct notifier_block *unused, · 597 unmodified lines
11241122 prestera_port_obj_attr_set);
11251123 break;
11261124 default:
1127− err = -EOPNOTSUPP;
1125+ return NOTIFY_DONE;
11281126 }
11291127
11301128 return notifier_from_errno(err);
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c+3−3
@@ -670,7 +670,7 @@ void __init mlx4_en_init_ptys2ethtool_map(void) · 669 unmodified lines
670670 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_T, SPEED_1000,
671671 ETHTOOL_LINK_MODE_1000baseT_Full_BIT);
672672 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_CX_SGMII, SPEED_1000,
673− ETHTOOL_LINK_MODE_1000baseKX_Full_BIT);
673+ ETHTOOL_LINK_MODE_1000baseX_Full_BIT);
674674 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_KX, SPEED_1000,
675675 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT);
676676 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_T, SPEED_10000,
@@ -682,9 +682,9 @@ void __init mlx4_en_init_ptys2ethtool_map(void) · 5 unmodified lines
682682 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_KR, SPEED_10000,
683683 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT);
684684 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_CR, SPEED_10000,
685− ETHTOOL_LINK_MODE_10000baseKR_Full_BIT);
685+ ETHTOOL_LINK_MODE_10000baseCR_Full_BIT);
686686 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_SR, SPEED_10000,
687− ETHTOOL_LINK_MODE_10000baseKR_Full_BIT);
687+ ETHTOOL_LINK_MODE_10000baseSR_Full_BIT);
688688 MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_20GBASE_KR2, SPEED_20000,
689689 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT,
690690 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT);
drivers/net/ethernet/mellanox/mlx4/en_netdev.c+7−2
@@ -2286,9 +2286,14 @@ int mlx4_en_try_alloc_resources(struct mlx4_en_priv *priv, · 2285 unmodified lines
22862286 bool carry_xdp_prog)
22872287 {
22882288 struct bpf_prog *xdp_prog;
2289− int i, t;
2289+ int i, t, ret;
22902290
2291− mlx4_en_copy_priv(tmp, priv, prof);
2291+ ret = mlx4_en_copy_priv(tmp, priv, prof);
2292+ if (ret) {
2293+ en_warn(priv, "%s: mlx4_en_copy_priv() failed, return\n",
2294+ __func__);
2295+ return ret;
2296+ }
22922297
22932298 if (mlx4_en_alloc_resources(tmp)) {
22942299 en_warn(priv,
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+3−3
@@ -339,6 +339,9 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 338 unmodified lines
339339 case MLX5_CMD_OP_PAGE_FAULT_RESUME:
340340 case MLX5_CMD_OP_QUERY_ESW_FUNCTIONS:
341341 case MLX5_CMD_OP_DEALLOC_SF:
342+ case MLX5_CMD_OP_DESTROY_UCTX:
343+ case MLX5_CMD_OP_DESTROY_UMEM:
344+ case MLX5_CMD_OP_MODIFY_RQT:
342345 return MLX5_CMD_STAT_OK;
343346
344347 case MLX5_CMD_OP_QUERY_HCA_CAP:
@@ -444,7 +447,6 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 99 unmodified lines
444447 case MLX5_CMD_OP_MODIFY_TIS:
445448 case MLX5_CMD_OP_QUERY_TIS:
446449 case MLX5_CMD_OP_CREATE_RQT:
447− case MLX5_CMD_OP_MODIFY_RQT:
448450 case MLX5_CMD_OP_QUERY_RQT:
449451
450452 case MLX5_CMD_OP_CREATE_FLOW_TABLE:
@@ -464,9 +466,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 13 unmodified lines
464466 case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT:
465467 case MLX5_CMD_OP_QUERY_GENERAL_OBJECT:
466468 case MLX5_CMD_OP_CREATE_UCTX:
467− case MLX5_CMD_OP_DESTROY_UCTX:
468469 case MLX5_CMD_OP_CREATE_UMEM:
469− case MLX5_CMD_OP_DESTROY_UMEM:
470470 case MLX5_CMD_OP_ALLOC_MEMIC:
471471 case MLX5_CMD_OP_MODIFY_XRQ:
472472 case MLX5_CMD_OP_RELEASE_XRQ_ERROR:
drivers/net/ethernet/mellanox/mlx5/core/cq.c+3−2
@@ -164,13 +164,14 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq) · 163 unmodified lines
164164 MLX5_SET(destroy_cq_in, in, cqn, cq->cqn);
165165 MLX5_SET(destroy_cq_in, in, uid, cq->uid);
166166 err = mlx5_cmd_exec_in(dev, destroy_cq, in);
167+ if (err)
168+ return err;
167169
168170 synchronize_irq(cq->irqn);
169−
170171 mlx5_cq_put(cq);
171172 wait_for_completion(&cq->free);
172173
173− return err;
174+ return 0;
174175 }
175176 EXPORT_SYMBOL(mlx5_core_destroy_cq);
176177
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c+3−1
@@ -507,6 +507,8 @@ void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq) · 506 unmodified lines
507507 if (!mlx5_debugfs_root)
508508 return;
509509
510− if (cq->dbg)
510+ if (cq->dbg) {
511511 rem_res_tree(cq->dbg);
512+ cq->dbg = NULL;
513+ }
512514 }
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c+40−1
@@ -13,6 +13,9 @@ struct mlx5e_rx_res { · 12 unmodified lines
1313 unsigned int max_nch;
1414 u32 drop_rqn;
1515
16+ struct mlx5e_packet_merge_param pkt_merge_param;
17+ struct rw_semaphore pkt_merge_param_sem;
18+
1619 struct mlx5e_rss *rss[MLX5E_MAX_NUM_RSS];
1720 bool rss_active;
1821 u32 rss_rqns[MLX5E_INDIR_RQT_SIZE];
@@ -392,6 +395,7 @@ static int mlx5e_rx_res_ptp_init(struct mlx5e_rx_res *res) · 373 unmodified lines
392395 if (err)
393396 goto out;
394397
398+ /* Separated from the channels RQs, does not share pkt_merge state with them */
395399 mlx5e_tir_builder_build_rqt(builder, res->mdev->mlx5e_res.hw_objs.td.tdn,
396400 mlx5e_rqt_get_rqtn(&res->ptp.rqt),
397401 inner_ft_support);
@@ -447,6 +451,9 @@ int mlx5e_rx_res_init(struct mlx5e_rx_res *res, struct mlx5_core_dev *mdev, · 49 unmodified lines
447451 res->max_nch = max_nch;
448452 res->drop_rqn = drop_rqn;
449453
454+ res->pkt_merge_param = *init_pkt_merge_param;
455+ init_rwsem(&res->pkt_merge_param_sem);
456+
450457 err = mlx5e_rx_res_rss_init_def(res, init_pkt_merge_param, init_nch);
451458 if (err)
452459 goto err_out;
@@ -513,7 +520,7 @@ u32 mlx5e_rx_res_get_tirn_ptp(struct mlx5e_rx_res *res) · 60 unmodified lines
513520 return mlx5e_tir_get_tirn(&res->ptp.tir);
514521 }
515522
516−u32 mlx5e_rx_res_get_rqtn_direct(struct mlx5e_rx_res *res, unsigned int ix)
523+static u32 mlx5e_rx_res_get_rqtn_direct(struct mlx5e_rx_res *res, unsigned int ix)
517524 {
518525 return mlx5e_rqt_get_rqtn(&res->channels[ix].direct_rqt);
519526 }
@@ -656,6 +663,9 @@ int mlx5e_rx_res_packet_merge_set_param(struct mlx5e_rx_res *res, · 136 unmodified lines
656663 if (!builder)
657664 return -ENOMEM;
658665
666+ down_write(&res->pkt_merge_param_sem);
667+ res->pkt_merge_param = *pkt_merge_param;
668+
659669 mlx5e_tir_builder_build_packet_merge(builder, pkt_merge_param);
660670
661671 final_err = 0;
@@ -681,6 +691,7 @@ int mlx5e_rx_res_packet_merge_set_param(struct mlx5e_rx_res *res, · 19 unmodified lines
681691 }
682692 }
683693
694+ up_write(&res->pkt_merge_param_sem);
684695 mlx5e_tir_builder_free(builder);
685696 return final_err;
686697 }
@@ -689,3 +700,31 @@ struct mlx5e_rss_params_hash mlx5e_rx_res_get_current_hash(struct mlx5e_rx_res * · 2 unmodified lines
689700 {
690701 return mlx5e_rss_get_hash(res->rss[0]);
691702 }
703+
704+int mlx5e_rx_res_tls_tir_create(struct mlx5e_rx_res *res, unsigned int rxq,
705+ struct mlx5e_tir *tir)
706+{
707+ bool inner_ft_support = res->features & MLX5E_RX_RES_FEATURE_INNER_FT;
708+ struct mlx5e_tir_builder *builder;
709+ u32 rqtn;
710+ int err;
711+
712+ builder = mlx5e_tir_builder_alloc(false);
713+ if (!builder)
714+ return -ENOMEM;
715+
716+ rqtn = mlx5e_rx_res_get_rqtn_direct(res, rxq);
717+
718+ mlx5e_tir_builder_build_rqt(builder, res->mdev->mlx5e_res.hw_objs.td.tdn, rqtn,
719+ inner_ft_support);
720+ mlx5e_tir_builder_build_direct(builder);
721+ mlx5e_tir_builder_build_tls(builder);
722+ down_read(&res->pkt_merge_param_sem);
723+ mlx5e_tir_builder_build_packet_merge(builder, &res->pkt_merge_param);
724+ err = mlx5e_tir_init(tir, builder, res->mdev, false);
725+ up_read(&res->pkt_merge_param_sem);
726+
727+ mlx5e_tir_builder_free(builder);
728+
729+ return err;
730+}
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h+3−3
@@ -37,9 +37,6 @@ u32 mlx5e_rx_res_get_tirn_rss(struct mlx5e_rx_res *res, enum mlx5_traffic_types · 36 unmodified lines
3737 u32 mlx5e_rx_res_get_tirn_rss_inner(struct mlx5e_rx_res *res, enum mlx5_traffic_types tt);
3838 u32 mlx5e_rx_res_get_tirn_ptp(struct mlx5e_rx_res *res);
3939
40−/* RQTN getters for modules that create their own TIRs */
41−u32 mlx5e_rx_res_get_rqtn_direct(struct mlx5e_rx_res *res, unsigned int ix);
42−
4340 /* Activate/deactivate API */
4441 void mlx5e_rx_res_channels_activate(struct mlx5e_rx_res *res, struct mlx5e_channels *chs);
4542 void mlx5e_rx_res_channels_deactivate(struct mlx5e_rx_res *res);
@@ -69,4 +66,7 @@ struct mlx5e_rss *mlx5e_rx_res_rss_get(struct mlx5e_rx_res *res, u32 rss_idx); · 23 unmodified lines
6966 /* Workaround for hairpin */
7067 struct mlx5e_rss_params_hash mlx5e_rx_res_get_current_hash(struct mlx5e_rx_res *res);
7168
69+/* Accel TIRs */
70+int mlx5e_rx_res_tls_tir_create(struct mlx5e_rx_res *res, unsigned int rxq,
71+ struct mlx5e_tir *tir);
7272 #endif /* __MLX5_EN_RX_RES_H__ */
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+17−9
@@ -1356,9 +1356,13 @@ mlx5_tc_ct_match_add(struct mlx5_tc_ct_priv *priv, · 1355 unmodified lines
13561356 int
13571357 mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
13581358 struct mlx5_flow_attr *attr,
1359+ struct mlx5e_tc_mod_hdr_acts *mod_acts,
13591360 const struct flow_action_entry *act,
13601361 struct netlink_ext_ack *extack)
13611362 {
1363+ bool clear_action = act->ct.action & TCA_CT_ACT_CLEAR;
1364+ int err;
1365+
13621366 if (!priv) {
13631367 NL_SET_ERR_MSG_MOD(extack,
13641368 "offload of ct action isn't available");
@@ -1369,6 +1373,17 @@ mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv, · 4 unmodified lines
13691373 attr->ct_attr.ct_action = act->ct.action;
13701374 attr->ct_attr.nf_ft = act->ct.flow_table;
13711375
1376+ if (!clear_action)
1377+ goto out;
1378+
1379+ err = mlx5_tc_ct_entry_set_registers(priv, mod_acts, 0, 0, 0, 0);
1380+ if (err) {
1381+ NL_SET_ERR_MSG_MOD(extack, "Failed to set registers for ct clear");
1382+ return err;
1383+ }
1384+ attr->action |= MLX5_FLOW_CONTEXT_ACTION_MOD_HDR;
1385+
1386+out:
13721387 return 0;
13731388 }
13741389
@@ -1898,23 +1913,16 @@ __mlx5_tc_ct_flow_offload_clear(struct mlx5_tc_ct_priv *ct_priv, · 523 unmodified lines
18981913
18991914 memcpy(pre_ct_attr, attr, attr_sz);
19001915
1901− err = mlx5_tc_ct_entry_set_registers(ct_priv, mod_acts, 0, 0, 0, 0);
1902− if (err) {
1903− ct_dbg("Failed to set register for ct clear");
1904− goto err_set_registers;
1905− }
1906−
19071916 mod_hdr = mlx5_modify_header_alloc(priv->mdev, ct_priv->ns_type,
19081917 mod_acts->num_actions,
19091918 mod_acts->actions);
19101919 if (IS_ERR(mod_hdr)) {
19111920 err = PTR_ERR(mod_hdr);
19121921 ct_dbg("Failed to add create ct clear mod hdr");
1913− goto err_set_registers;
1922+ goto err_mod_hdr;
19141923 }
19151924
19161925 pre_ct_attr->modify_hdr = mod_hdr;
1917− pre_ct_attr->action |= MLX5_FLOW_CONTEXT_ACTION_MOD_HDR;
19181926
19191927 rule = mlx5_tc_rule_insert(priv, orig_spec, pre_ct_attr);
19201928 if (IS_ERR(rule)) {
@@ -1930,7 +1938,7 @@ __mlx5_tc_ct_flow_offload_clear(struct mlx5_tc_ct_priv *ct_priv, · 9 unmodified lines
19301938
19311939 err_insert:
19321940 mlx5_modify_header_dealloc(priv->mdev, mod_hdr);
1933−err_set_registers:
1941+err_mod_hdr:
19341942 netdev_warn(priv->netdev,
19351943 "Failed to offload ct clear flow, err %d\n", err);
19361944 kfree(pre_ct_attr);
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h+2−0
@@ -110,6 +110,7 @@ int mlx5_tc_ct_add_no_trk_match(struct mlx5_flow_spec *spec); · 109 unmodified lines
110110 int
111111 mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
112112 struct mlx5_flow_attr *attr,
113+ struct mlx5e_tc_mod_hdr_acts *mod_acts,
113114 const struct flow_action_entry *act,
114115 struct netlink_ext_ack *extack);
115116
@@ -172,6 +173,7 @@ mlx5_tc_ct_add_no_trk_match(struct mlx5_flow_spec *spec) · 56 unmodified lines
172173 static inline int
173174 mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
174175 struct mlx5_flow_attr *attr,
176+ struct mlx5e_tc_mod_hdr_acts *mod_acts,
175177 const struct flow_action_entry *act,
176178 struct netlink_ext_ack *extack)
177179 {
drivers/net/ethernet/mellanox/mlx5/core/en/tc_priv.h+1−0
@@ -102,6 +102,7 @@ struct mlx5e_tc_flow { · 101 unmodified lines
102102 refcount_t refcnt;
103103 struct rcu_head rcu_head;
104104 struct completion init_done;
105+ struct completion del_hw_done;
105106 int tunnel_id; /* the mapped tunnel id of this flow */
106107 struct mlx5_flow_attr *attr;
107108 };
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c+7−1
@@ -245,8 +245,14 @@ static void mlx5e_take_tmp_flow(struct mlx5e_tc_flow *flow, · 244 unmodified lines
245245 struct list_head *flow_list,
246246 int index)
247247 {
248− if (IS_ERR(mlx5e_flow_get(flow)))
248+ if (IS_ERR(mlx5e_flow_get(flow))) {
249+ /* Flow is being deleted concurrently. Wait for it to be
250+ * unoffloaded from hardware, otherwise deleting encap will
251+ * fail.
252+ */
253+ wait_for_completion(&flow->del_hw_done);
249254 return;
255+ }
250256 wait_for_completion(&flow->init_done);
251257
252258 flow->tmp_entry_index = index;
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c+1−1
@@ -191,7 +191,7 @@ static void mlx5e_ipsec_set_swp(struct sk_buff *skb, · 190 unmodified lines
191191 eseg->swp_inner_l3_offset = skb_inner_network_offset(skb) / 2;
192192 eseg->swp_inner_l4_offset =
193193 (skb->csum_start + skb->head - skb->data) / 2;
194− if (skb->protocol == htons(ETH_P_IPV6))
194+ if (inner_ip_hdr(skb)->version == 6)
195195 eseg->swp_flags |= MLX5_ETH_WQE_SWP_INNER_L3_IPV6;
196196 break;
197197 default:
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c+18−29
@@ -55,6 +55,7 @@ struct mlx5e_ktls_offload_context_rx { · 54 unmodified lines
5555 DECLARE_BITMAP(flags, MLX5E_NUM_PRIV_RX_FLAGS);
5656
5757 /* resync */
58+ spinlock_t lock; /* protects resync fields */
5859 struct mlx5e_ktls_rx_resync_ctx resync;
5960 struct list_head list;
6061 };
@@ -99,25 +100,6 @@ mlx5e_ktls_rx_resync_create_resp_list(void) · 38 unmodified lines
99100 return resp_list;
100101 }
101102
102−static int mlx5e_ktls_create_tir(struct mlx5_core_dev *mdev, struct mlx5e_tir *tir, u32 rqtn)
103−{
104− struct mlx5e_tir_builder *builder;
105− int err;
106−
107− builder = mlx5e_tir_builder_alloc(false);
108− if (!builder)
109− return -ENOMEM;
110−
111− mlx5e_tir_builder_build_rqt(builder, mdev->mlx5e_res.hw_objs.td.tdn, rqtn, false);
112− mlx5e_tir_builder_build_direct(builder);
113− mlx5e_tir_builder_build_tls(builder);
114− err = mlx5e_tir_init(tir, builder, mdev, false);
115−
116− mlx5e_tir_builder_free(builder);
117−
118− return err;
119−}
120−
121103 static void accel_rule_handle_work(struct work_struct *work)
122104 {
123105 struct mlx5e_ktls_offload_context_rx *priv_rx;
@@ -386,14 +368,18 @@ static void resync_handle_seq_match(struct mlx5e_ktls_offload_context_rx *priv_r · 262 unmodified lines
386368 struct mlx5e_icosq *sq;
387369 bool trigger_poll;
388370
389− memcpy(info->rec_seq, &priv_rx->resync.sw_rcd_sn_be, sizeof(info->rec_seq));
390−
391371 sq = &c->async_icosq;
392372 ktls_resync = sq->ktls_resync;
373+ trigger_poll = false;
393374
394375 spin_lock_bh(&ktls_resync->lock);
395− list_add_tail(&priv_rx->list, &ktls_resync->list);
396− trigger_poll = !test_and_set_bit(MLX5E_SQ_STATE_PENDING_TLS_RX_RESYNC, &sq->state);
376+ spin_lock_bh(&priv_rx->lock);
377+ memcpy(info->rec_seq, &priv_rx->resync.sw_rcd_sn_be, sizeof(info->rec_seq));
378+ if (list_empty(&priv_rx->list)) {
379+ list_add_tail(&priv_rx->list, &ktls_resync->list);
380+ trigger_poll = !test_and_set_bit(MLX5E_SQ_STATE_PENDING_TLS_RX_RESYNC, &sq->state);
381+ }
382+ spin_unlock_bh(&priv_rx->lock);
397383 spin_unlock_bh(&ktls_resync->lock);
398384
399385 if (!trigger_poll)
@@ -604,7 +590,6 @@ int mlx5e_ktls_add_rx(struct net_device *netdev, struct sock *sk, · 204 unmodified lines
604590 struct mlx5_core_dev *mdev;
605591 struct mlx5e_priv *priv;
606592 int rxq, err;
607− u32 rqtn;
608593
609594 tls_ctx = tls_get_ctx(sk);
610595 priv = netdev_priv(netdev);
@@ -617,6 +602,8 @@ int mlx5e_ktls_add_rx(struct net_device *netdev, struct sock *sk, · 6 unmodified lines
617602 if (err)
618603 goto err_create_key;
619604
605+ INIT_LIST_HEAD(&priv_rx->list);
606+ spin_lock_init(&priv_rx->lock);
620607 priv_rx->crypto_info =
621608 *(struct tls12_crypto_info_aes_gcm_128 *)crypto_info;
622609
@@ -628,9 +615,7 @@ int mlx5e_ktls_add_rx(struct net_device *netdev, struct sock *sk, · 5 unmodified lines
628615 priv_rx->sw_stats = &priv->tls->sw_stats;
629616 mlx5e_set_ktls_rx_priv_ctx(tls_ctx, priv_rx);
630617
631− rqtn = mlx5e_rx_res_get_rqtn_direct(priv->rx_res, rxq);
632−
633− err = mlx5e_ktls_create_tir(mdev, &priv_rx->tir, rqtn);
618+ err = mlx5e_rx_res_tls_tir_create(priv->rx_res, rxq, &priv_rx->tir);
634619 if (err)
635620 goto err_create_tir;
636621
@@ -730,10 +715,14 @@ bool mlx5e_ktls_rx_handle_resync_list(struct mlx5e_channel *c, int budget) · 93 unmodified lines
730715 priv_rx = list_first_entry(&local_list,
731716 struct mlx5e_ktls_offload_context_rx,
732717 list);
718+ spin_lock(&priv_rx->lock);
733719 cseg = post_static_params(sq, priv_rx);
734− if (IS_ERR(cseg))
720+ if (IS_ERR(cseg)) {
721+ spin_unlock(&priv_rx->lock);
735722 break;
736− list_del(&priv_rx->list);
723+ }
724+ list_del_init(&priv_rx->list);
725+ spin_unlock(&priv_rx->lock);
737726 db_cseg = cseg;
738727 }
739728 if (db_cseg)
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+4−0
@@ -1080,6 +1080,10 @@ static mlx5e_stats_grp_t mlx5e_ul_rep_stats_grps[] = { · 1079 unmodified lines
10801080 &MLX5E_STATS_GRP(pme),
10811081 &MLX5E_STATS_GRP(channels),
10821082 &MLX5E_STATS_GRP(per_port_buff_congest),
1083+#ifdef CONFIG_MLX5_EN_IPSEC
1084+ &MLX5E_STATS_GRP(ipsec_sw),
1085+ &MLX5E_STATS_GRP(ipsec_hw),
1086+#endif
10831087 };
10841088
10851089 static unsigned int mlx5e_ul_rep_stats_grps_num(struct mlx5e_priv *priv)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+3−5
@@ -543,13 +543,13 @@ static int mlx5e_build_shampo_hd_umr(struct mlx5e_rq *rq, · 542 unmodified lines
543543 u16 klm_entries, u16 index)
544544 {
545545 struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo;
546− u16 entries, pi, i, header_offset, err, wqe_bbs, new_entries;
546+ u16 entries, pi, header_offset, err, wqe_bbs, new_entries;
547547 u32 lkey = rq->mdev->mlx5e_res.hw_objs.mkey;
548548 struct page *page = shampo->last_page;
549549 u64 addr = shampo->last_addr;
550550 struct mlx5e_dma_info *dma_info;
551551 struct mlx5e_umr_wqe *umr_wqe;
552− int headroom;
552+ int headroom, i;
553553
554554 headroom = rq->buff.headroom;
555555 new_entries = klm_entries - (shampo->pi & (MLX5_UMR_KLM_ALIGNMENT - 1));
@@ -601,9 +601,7 @@ update_klm: · 45 unmodified lines
601601
602602 err_unmap:
603603 while (--i >= 0) {
604− if (--index < 0)
605− index = shampo->hd_per_wq - 1;
606− dma_info = &shampo->info[index];
604+ dma_info = &shampo->info[--index];
607605 if (!(i & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1))) {
608606 dma_info->addr = ALIGN_DOWN(dma_info->addr, PAGE_SIZE);
609607 mlx5e_page_release(rq, dma_info, true);
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+8−2
@@ -1600,6 +1600,7 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv, · 1599 unmodified lines
16001600 else
16011601 mlx5e_tc_unoffload_fdb_rules(esw, flow, attr);
16021602 }
1603+ complete_all(&flow->del_hw_done);
16031604
16041605 if (mlx5_flow_has_geneve_opt(flow))
16051606 mlx5_geneve_tlv_option_del(priv->mdev->geneve);
@@ -3607,7 +3608,9 @@ parse_tc_nic_actions(struct mlx5e_priv *priv, · 2001 unmodified lines
36073608 attr->dest_chain = act->chain_index;
36083609 break;
36093610 case FLOW_ACTION_CT:
3610− err = mlx5_tc_ct_parse_action(get_ct_priv(priv), attr, act, extack);
3611+ err = mlx5_tc_ct_parse_action(get_ct_priv(priv), attr,
3612+ &parse_attr->mod_hdr_acts,
3613+ act, extack);
36113614 if (err)
36123615 return err;
36133616
@@ -4276,7 +4279,9 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, · 662 unmodified lines
42764279 NL_SET_ERR_MSG_MOD(extack, "Sample action with connection tracking is not supported");
42774280 return -EOPNOTSUPP;
42784281 }
4279− err = mlx5_tc_ct_parse_action(get_ct_priv(priv), attr, act, extack);
4282+ err = mlx5_tc_ct_parse_action(get_ct_priv(priv), attr,
4283+ &parse_attr->mod_hdr_acts,
4284+ act, extack);
42804285 if (err)
42814286 return err;
42824287
@@ -4465,6 +4470,7 @@ mlx5e_alloc_flow(struct mlx5e_priv *priv, int attr_size, · 182 unmodified lines
44654470 INIT_LIST_HEAD(&flow->l3_to_l2_reformat);
44664471 refcount_set(&flow->refcnt, 1);
44674472 init_completion(&flow->init_done);
4473+ init_completion(&flow->del_hw_done);
44684474
44694475 *__flow = flow;
44704476 *__parse_attr = parse_attr;
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c+2−2
@@ -130,7 +130,7 @@ static u32 esw_qos_calculate_min_rate_divider(struct mlx5_eswitch *esw, · 129 unmodified lines
130130 /* If vports min rate divider is 0 but their group has bw_share configured, then
131131 * need to set bw_share for vports to minimal value.
132132 */
133− if (!group_level && !max_guarantee && group->bw_share)
133+ if (!group_level && !max_guarantee && group && group->bw_share)
134134 return 1;
135135 return 0;
136136 }
@@ -423,7 +423,7 @@ static int esw_qos_vport_update_group(struct mlx5_eswitch *esw, · 286 unmodified lines
423423 return err;
424424
425425 /* Recalculate bw share weights of old and new groups */
426− if (vport->qos.bw_share) {
426+ if (vport->qos.bw_share || new_group->bw_share) {
427427 esw_qos_normalize_vports_min_rate(esw, curr_group, extack);
428428 esw_qos_normalize_vports_min_rate(esw, new_group, extack);
429429 }
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+17−4
@@ -1305,12 +1305,17 @@ abort: · 1304 unmodified lines
13051305 */
13061306 int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs)
13071307 {
1308+ bool toggle_lag;
13081309 int ret;
13091310
13101311 if (!mlx5_esw_allowed(esw))
13111312 return 0;
13121313
1313− mlx5_lag_disable_change(esw->dev);
1314+ toggle_lag = esw->mode == MLX5_ESWITCH_NONE;
1315+
1316+ if (toggle_lag)
1317+ mlx5_lag_disable_change(esw->dev);
1318+
13141319 down_write(&esw->mode_lock);
13151320 if (esw->mode == MLX5_ESWITCH_NONE) {
13161321 ret = mlx5_eswitch_enable_locked(esw, MLX5_ESWITCH_LEGACY, num_vfs);
@@ -1324,7 +1329,10 @@ int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs) · 7 unmodified lines
13241329 esw->esw_funcs.num_vfs = num_vfs;
13251330 }
13261331 up_write(&esw->mode_lock);
1327− mlx5_lag_enable_change(esw->dev);
1332+
1333+ if (toggle_lag)
1334+ mlx5_lag_enable_change(esw->dev);
1335+
13281336 return ret;
13291337 }
13301338
@@ -1572,6 +1580,11 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) · 241 unmodified lines
15721580 esw->enabled_vports = 0;
15731581 esw->mode = MLX5_ESWITCH_NONE;
15741582 esw->offloads.inline_mode = MLX5_INLINE_MODE_NONE;
1583+ if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, reformat) &&
1584+ MLX5_CAP_ESW_FLOWTABLE_FDB(dev, decap))
1585+ esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC;
1586+ else
1587+ esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
15751588
15761589 dev->priv.eswitch = esw;
15771590 BLOCKING_INIT_NOTIFIER_HEAD(&esw->n_head);
@@ -1934,7 +1947,7 @@ free_out: · 356 unmodified lines
19341947 return err;
19351948 }
19361949
1937−u8 mlx5_eswitch_mode(struct mlx5_core_dev *dev)
1950+u8 mlx5_eswitch_mode(const struct mlx5_core_dev *dev)
19381951 {
19391952 struct mlx5_eswitch *esw = dev->priv.eswitch;
19401953
@@ -1948,7 +1961,7 @@ mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev) · 7 unmodified lines
19481961 struct mlx5_eswitch *esw;
19491962
19501963 esw = dev->priv.eswitch;
1951− return mlx5_esw_allowed(esw) ? esw->offloads.encap :
1964+ return (mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS) ? esw->offloads.encap :
19521965 DEVLINK_ESWITCH_ENCAP_MODE_NONE;
19531966 }
19541967 EXPORT_SYMBOL(mlx5_eswitch_get_encap_mode);
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+17−12
@@ -329,14 +329,25 @@ static bool · 328 unmodified lines
329329 esw_is_indir_table(struct mlx5_eswitch *esw, struct mlx5_flow_attr *attr)
330330 {
331331 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
332+ bool result = false;
332333 int i;
333334
334− for (i = esw_attr->split_count; i < esw_attr->out_count; i++)
335+ /* Indirect table is supported only for flows with in_port uplink
336+ * and the destination is vport on the same eswitch as the uplink,
337+ * return false in case at least one of destinations doesn't meet
338+ * this criteria.
339+ */
340+ for (i = esw_attr->split_count; i < esw_attr->out_count; i++) {
335341 if (esw_attr->dests[i].rep &&
336342 mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].rep->vport,
337− esw_attr->dests[i].mdev))
338− return true;
339− return false;
343+ esw_attr->dests[i].mdev)) {
344+ result = true;
345+ } else {
346+ result = false;
347+ break;
348+ }
349+ }
350+ return result;
340351 }
341352
342353 static int
@@ -2512,6 +2523,7 @@ static int esw_set_master_egress_rule(struct mlx5_core_dev *master, · 2169 unmodified lines
25122523 struct mlx5_eswitch *esw = master->priv.eswitch;
25132524 struct mlx5_flow_table_attr ft_attr = {
25142525 .max_fte = 1, .prio = 0, .level = 0,
2526+ .flags = MLX5_FLOW_TABLE_OTHER_VPORT,
25152527 };
25162528 struct mlx5_flow_namespace *egress_ns;
25172529 struct mlx5_flow_table *acl;
@@ -3183,12 +3195,6 @@ int esw_offloads_enable(struct mlx5_eswitch *esw) · 665 unmodified lines
31833195 u64 mapping_id;
31843196 int err;
31853197
3186− if (MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, reformat) &&
3187− MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, decap))
3188− esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC;
3189− else
3190− esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
3191−
31923198 mutex_init(&esw->offloads.termtbl_mutex);
31933199 mlx5_rdma_enable_roce(esw->dev);
31943200
@@ -3286,7 +3292,6 @@ void esw_offloads_disable(struct mlx5_eswitch *esw) · 91 unmodified lines
32863292 esw_offloads_metadata_uninit(esw);
32873293 mlx5_rdma_disable_roce(esw->dev);
32883294 mutex_destroy(&esw->offloads.termtbl_mutex);
3289− esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
32903295 }
32913296
32923297 static int esw_mode_from_devlink(u16 mode, u16 *mlx5_mode)
@@ -3630,7 +3635,7 @@ int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, · 337 unmodified lines
36303635 *encap = esw->offloads.encap;
36313636 unlock:
36323637 up_write(&esw->mode_lock);
3633− return 0;
3638+ return err;
36343639 }
36353640
36363641 static bool
drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #define MLX5_FC_STATS_PERIOD msecs_to_jiffies(1000)
4141 /* Max number of counters to query in bulk read is 32K */
4242 #define MLX5_SW_MAX_COUNTERS_BULK BIT(15)
43−#define MLX5_SF_NUM_COUNTERS_BULK 6
43+#define MLX5_SF_NUM_COUNTERS_BULK 8
4444 #define MLX5_FC_POOL_MAX_THRESHOLD BIT(18)
4545 #define MLX5_FC_POOL_USED_BUFF_RATIO 10
4646
drivers/net/ethernet/mellanox/mlx5/core/health.c+3−2
@@ -835,6 +835,9 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev) · 834 unmodified lines
835835
836836 health->timer.expires = jiffies + msecs_to_jiffies(poll_interval_ms);
837837 add_timer(&health->timer);
838+
839+ if (mlx5_core_is_pf(dev) && MLX5_CAP_MCAM_REG(dev, mrtc))
840+ queue_delayed_work(health->wq, &health->update_fw_log_ts_work, 0);
838841 }
839842
840843 void mlx5_stop_health_poll(struct mlx5_core_dev *dev, bool disable_health)
@@ -902,8 +905,6 @@ int mlx5_health_init(struct mlx5_core_dev *dev) · 61 unmodified lines
902905 INIT_WORK(&health->fatal_report_work, mlx5_fw_fatal_reporter_err_work);
903906 INIT_WORK(&health->report_work, mlx5_fw_reporter_err_work);
904907 INIT_DELAYED_WORK(&health->update_fw_log_ts_work, mlx5_health_log_ts_update);
905− if (mlx5_core_is_pf(dev))
906− queue_delayed_work(health->wq, &health->update_fw_log_ts_work, 0);
907908
908909 return 0;
909910
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c+13−15
@@ -615,6 +615,7 @@ static int mlx5_handle_changeupper_event(struct mlx5_lag *ldev, · 614 unmodified lines
615615 bool is_bonded, is_in_lag, mode_supported;
616616 int bond_status = 0;
617617 int num_slaves = 0;
618+ int changed = 0;
618619 int idx;
619620
620621 if (!netif_is_lag_master(upper))
@@ -653,27 +654,27 @@ static int mlx5_handle_changeupper_event(struct mlx5_lag *ldev, · 32 unmodified lines
653654 */
654655 is_in_lag = num_slaves == MLX5_MAX_PORTS && bond_status == 0x3;
655656
656− if (!mlx5_lag_is_ready(ldev) && is_in_lag) {
657− NL_SET_ERR_MSG_MOD(info->info.extack,
658− "Can't activate LAG offload, PF is configured with more than 64 VFs");
659− return 0;
660− }
661−
662657 /* Lag mode must be activebackup or hash. */
663658 mode_supported = tracker->tx_type == NETDEV_LAG_TX_TYPE_ACTIVEBACKUP ||
664659 tracker->tx_type == NETDEV_LAG_TX_TYPE_HASH;
665660
666− if (is_in_lag && !mode_supported)
667− NL_SET_ERR_MSG_MOD(info->info.extack,
668− "Can't activate LAG offload, TX type isn't supported");
669−
670661 is_bonded = is_in_lag && mode_supported;
671662 if (tracker->is_bonded != is_bonded) {
672663 tracker->is_bonded = is_bonded;
673− return 1;
664+ changed = 1;
674665 }
675666
676− return 0;
667+ if (!is_in_lag)
668+ return changed;
669+
670+ if (!mlx5_lag_is_ready(ldev))
671+ NL_SET_ERR_MSG_MOD(info->info.extack,
672+ "Can't activate LAG offload, PF is configured with more than 64 VFs");
673+ else if (!mode_supported)
674+ NL_SET_ERR_MSG_MOD(info->info.extack,
675+ "Can't activate LAG offload, TX type isn't supported");
676+
677+ return changed;
677678 }
678679
679680 static int mlx5_handle_changelowerstate_event(struct mlx5_lag *ldev,
@@ -716,9 +717,6 @@ static int mlx5_lag_netdev_event(struct notifier_block *this, · 36 unmodified lines
716717
717718 ldev = container_of(this, struct mlx5_lag, nb);
718719
719− if (!mlx5_lag_is_ready(ldev) && event == NETDEV_CHANGELOWERSTATE)
720− return NOTIFY_DONE;
721−
722720 tracker = ldev->tracker;
723721
724722 switch (event) {
drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c+1−0
@@ -608,4 +608,5 @@ void mlx5_lag_port_sel_destroy(struct mlx5_lag *ldev) · 607 unmodified lines
608608 if (port_sel->tunnel)
609609 mlx5_destroy_ttc_table(port_sel->inner.ttc);
610610 mlx5_lag_destroy_definers(ldev);
611+ memset(port_sel, 0, sizeof(*port_sel));
611612 }
drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c+2−3
@@ -31,11 +31,11 @@ static void tout_set(struct mlx5_core_dev *dev, u64 val, enum mlx5_timeouts_type · 30 unmodified lines
3131 dev->timeouts->to[type] = val;
3232 }
3333
34−static void tout_set_def_val(struct mlx5_core_dev *dev)
34+void mlx5_tout_set_def_val(struct mlx5_core_dev *dev)
3535 {
3636 int i;
3737
38− for (i = MLX5_TO_FW_PRE_INIT_TIMEOUT_MS; i < MAX_TIMEOUT_TYPES; i++)
38+ for (i = 0; i < MAX_TIMEOUT_TYPES; i++)
3939 tout_set(dev, tout_def_sw_val[i], i);
4040 }
4141
@@ -45,7 +45,6 @@ int mlx5_tout_init(struct mlx5_core_dev *dev) · 3 unmodified lines
4545 if (!dev->timeouts)
4646 return -ENOMEM;
4747
48− tout_set_def_val(dev);
4948 return 0;
5049 }
5150
drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h+1−0
@@ -34,6 +34,7 @@ int mlx5_tout_init(struct mlx5_core_dev *dev); · 33 unmodified lines
3434 void mlx5_tout_cleanup(struct mlx5_core_dev *dev);
3535 void mlx5_tout_query_iseg(struct mlx5_core_dev *dev);
3636 int mlx5_tout_query_dtor(struct mlx5_core_dev *dev);
37+void mlx5_tout_set_def_val(struct mlx5_core_dev *dev);
3738 u64 _mlx5_tout_ms(struct mlx5_core_dev *dev, enum mlx5_timeouts_types type);
3839
3940 #define mlx5_tout_ms(dev, type) _mlx5_tout_ms(dev, MLX5_TO_##type##_MS)
drivers/net/ethernet/mellanox/mlx5/core/main.c+15−15
@@ -992,11 +992,7 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, bool boot) · 991 unmodified lines
992992 if (mlx5_core_is_pf(dev))
993993 pcie_print_link_status(dev->pdev);
994994
995− err = mlx5_tout_init(dev);
996− if (err) {
997− mlx5_core_err(dev, "Failed initializing timeouts, aborting\n");
998− return err;
999− }
995+ mlx5_tout_set_def_val(dev);
1000996
1001997 /* wait for firmware to accept initialization segments configurations
1002998 */
@@ -1005,13 +1001,13 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, bool boot) · 2 unmodified lines
10051001 if (err) {
10061002 mlx5_core_err(dev, "Firmware over %llu MS in pre-initializing state, aborting\n",
10071003 mlx5_tout_ms(dev, FW_PRE_INIT_TIMEOUT));
1008− goto err_tout_cleanup;
1004+ return err;
10091005 }
10101006
10111007 err = mlx5_cmd_init(dev);
10121008 if (err) {
10131009 mlx5_core_err(dev, "Failed initializing command interface, aborting\n");
1014− goto err_tout_cleanup;
1010+ return err;
10151011 }
10161012
10171013 mlx5_tout_query_iseg(dev);
@@ -1075,18 +1071,16 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, bool boot) · 57 unmodified lines
10751071
10761072 mlx5_set_driver_version(dev);
10771073
1078− mlx5_start_health_poll(dev);
1079−
10801074 err = mlx5_query_hca_caps(dev);
10811075 if (err) {
10821076 mlx5_core_err(dev, "query hca failed\n");
1083− goto stop_health;
1077+ goto reclaim_boot_pages;
10841078 }
10851079
1080+ mlx5_start_health_poll(dev);
1081+
10861082 return 0;
10871083
1088−stop_health:
1089− mlx5_stop_health_poll(dev, boot);
10901084 reclaim_boot_pages:
10911085 mlx5_reclaim_startup_pages(dev);
10921086 err_disable_hca:
@@ -1094,8 +1088,6 @@ err_disable_hca: · 1 unmodified line
10941088 err_cmd_cleanup:
10951089 mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_DOWN);
10961090 mlx5_cmd_cleanup(dev);
1097−err_tout_cleanup:
1098− mlx5_tout_cleanup(dev);
10991091
11001092 return err;
11011093 }
@@ -1114,7 +1106,6 @@ static int mlx5_function_teardown(struct mlx5_core_dev *dev, bool boot) · 12 unmodified lines
11141106 mlx5_core_disable_hca(dev, 0);
11151107 mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_DOWN);
11161108 mlx5_cmd_cleanup(dev);
1117− mlx5_tout_cleanup(dev);
11181109
11191110 return 0;
11201111 }
@@ -1476,6 +1467,12 @@ int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx) · 355 unmodified lines
14761467 mlx5_debugfs_root);
14771468 INIT_LIST_HEAD(&priv->traps);
14781469
1470+ err = mlx5_tout_init(dev);
1471+ if (err) {
1472+ mlx5_core_err(dev, "Failed initializing timeouts, aborting\n");
1473+ goto err_timeout_init;
1474+ }
1475+
14791476 err = mlx5_health_init(dev);
14801477 if (err)
14811478 goto err_health_init;
@@ -1501,6 +1498,8 @@ err_adev_init: · 19 unmodified lines
15011498 err_pagealloc_init:
15021499 mlx5_health_cleanup(dev);
15031500 err_health_init:
1501+ mlx5_tout_cleanup(dev);
1502+err_timeout_init:
15041503 debugfs_remove(dev->priv.dbg_root);
15051504 mutex_destroy(&priv->pgdir_mutex);
15061505 mutex_destroy(&priv->alloc_mutex);
@@ -1518,6 +1517,7 @@ void mlx5_mdev_uninit(struct mlx5_core_dev *dev) · 11 unmodified lines
15181517 mlx5_adev_cleanup(dev);
15191518 mlx5_pagealloc_cleanup(dev);
15201519 mlx5_health_cleanup(dev);
1520+ mlx5_tout_cleanup(dev);
15211521 debugfs_remove_recursive(dev->priv.dbg_root);
15221522 mutex_destroy(&priv->pgdir_mutex);
15231523 mutex_destroy(&priv->alloc_mutex);
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c+23−33
@@ -135,25 +135,14 @@ static void dr_domain_fill_uplink_caps(struct mlx5dr_domain *dmn, · 134 unmodified lines
135135
136136 static int dr_domain_query_vport(struct mlx5dr_domain *dmn,
137137 u16 vport_number,
138+ bool other_vport,
138139 struct mlx5dr_cmd_vport_cap *vport_caps)
139140 {
140− u16 cmd_vport = vport_number;
141− bool other_vport = true;
142141 int ret;
143142
144− if (vport_number == MLX5_VPORT_UPLINK) {
145− dr_domain_fill_uplink_caps(dmn, vport_caps);
146− return 0;
147− }
148−
149− if (dmn->info.caps.is_ecpf && vport_number == MLX5_VPORT_ECPF) {
150− other_vport = false;
151− cmd_vport = 0;
152− }
153−
154143 ret = mlx5dr_cmd_query_esw_vport_context(dmn->mdev,
155144 other_vport,
156− cmd_vport,
145+ vport_number,
157146 &vport_caps->icm_address_rx,
158147 &vport_caps->icm_address_tx);
159148 if (ret)
@@ -161,7 +150,7 @@ static int dr_domain_query_vport(struct mlx5dr_domain *dmn, · 1 unmodified line
161150
162151 ret = mlx5dr_cmd_query_gvmi(dmn->mdev,
163152 other_vport,
164− cmd_vport,
153+ vport_number,
165154 &vport_caps->vport_gvmi);
166155 if (ret)
167156 return ret;
@@ -176,9 +165,15 @@ static int dr_domain_query_esw_mngr(struct mlx5dr_domain *dmn) · 8 unmodified lines
176165 {
177166 return dr_domain_query_vport(dmn,
178167 dmn->info.caps.is_ecpf ? MLX5_VPORT_ECPF : 0,
168+ false,
179169 &dmn->info.caps.vports.esw_manager_caps);
180170 }
181171
172+static void dr_domain_query_uplink(struct mlx5dr_domain *dmn)
173+{
174+ dr_domain_fill_uplink_caps(dmn, &dmn->info.caps.vports.uplink_caps);
175+}
176+
182177 static struct mlx5dr_cmd_vport_cap *
183178 dr_domain_add_vport_cap(struct mlx5dr_domain *dmn, u16 vport)
184179 {
@@ -190,7 +185,7 @@ dr_domain_add_vport_cap(struct mlx5dr_domain *dmn, u16 vport) · 5 unmodified lines
190185 if (!vport_caps)
191186 return NULL;
192187
193− ret = dr_domain_query_vport(dmn, vport, vport_caps);
188+ ret = dr_domain_query_vport(dmn, vport, true, vport_caps);
194189 if (ret) {
195190 kvfree(vport_caps);
196191 return NULL;
@@ -207,16 +202,26 @@ dr_domain_add_vport_cap(struct mlx5dr_domain *dmn, u16 vport) · 10 unmodified lines
207202 return vport_caps;
208203 }
209204
205+static bool dr_domain_is_esw_mgr_vport(struct mlx5dr_domain *dmn, u16 vport)
206+{
207+ struct mlx5dr_cmd_caps *caps = &dmn->info.caps;
208+
209+ return (caps->is_ecpf && vport == MLX5_VPORT_ECPF) ||
210+ (!caps->is_ecpf && vport == 0);
211+}
212+
210213 struct mlx5dr_cmd_vport_cap *
211214 mlx5dr_domain_get_vport_cap(struct mlx5dr_domain *dmn, u16 vport)
212215 {
213216 struct mlx5dr_cmd_caps *caps = &dmn->info.caps;
214217 struct mlx5dr_cmd_vport_cap *vport_caps;
215218
216− if ((caps->is_ecpf && vport == MLX5_VPORT_ECPF) ||
217− (!caps->is_ecpf && vport == 0))
219+ if (dr_domain_is_esw_mgr_vport(dmn, vport))
218220 return &caps->vports.esw_manager_caps;
219221
222+ if (vport == MLX5_VPORT_UPLINK)
223+ return &caps->vports.uplink_caps;
224+
220225 vport_load:
221226 vport_caps = xa_load(&caps->vports.vports_caps_xa, vport);
222227 if (vport_caps)
@@ -241,17 +246,6 @@ static void dr_domain_clear_vports(struct mlx5dr_domain *dmn) · 18 unmodified lines
241246 }
242247 }
243248
244−static int dr_domain_query_uplink(struct mlx5dr_domain *dmn)
245−{
246− struct mlx5dr_cmd_vport_cap *vport_caps;
247−
248− vport_caps = mlx5dr_domain_get_vport_cap(dmn, MLX5_VPORT_UPLINK);
249− if (!vport_caps)
250− return -EINVAL;
251−
252− return 0;
253−}
254−
255249 static int dr_domain_query_fdb_caps(struct mlx5_core_dev *mdev,
256250 struct mlx5dr_domain *dmn)
257251 {
@@ -281,11 +275,7 @@ static int dr_domain_query_fdb_caps(struct mlx5_core_dev *mdev, · 23 unmodified lines
281275 goto free_vports_caps_xa;
282276 }
283277
284− ret = dr_domain_query_uplink(dmn);
285− if (ret) {
286− mlx5dr_err(dmn, "Failed to query uplink vport caps (err: %d)", ret);
287− goto free_vports_caps_xa;
288− }
278+ dr_domain_query_uplink(dmn);
289279
290280 return 0;
291281
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c+6−5
@@ -924,11 +924,12 @@ static int dr_matcher_init(struct mlx5dr_matcher *matcher, · 923 unmodified lines
924924
925925 /* Check that all mask data was consumed */
926926 for (i = 0; i < consumed_mask.match_sz; i++) {
927− if (consumed_mask.match_buf[i]) {
928− mlx5dr_dbg(dmn, "Match param mask contains unsupported parameters\n");
929− ret = -EOPNOTSUPP;
930− goto free_consumed_mask;
931− }
927+ if (!((u8 *)consumed_mask.match_buf)[i])
928+ continue;
929+
930+ mlx5dr_dbg(dmn, "Match param mask contains unsupported parameters\n");
931+ ret = -EOPNOTSUPP;
932+ goto free_consumed_mask;
932933 }
933934
934935 ret = 0;
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h+1−0
@@ -764,6 +764,7 @@ struct mlx5dr_roce_cap { · 763 unmodified lines
764764
765765 struct mlx5dr_vports {
766766 struct mlx5dr_cmd_vport_cap esw_manager_caps;
767+ struct mlx5dr_cmd_vport_cap uplink_caps;
767768 struct xarray vports_caps_xa;
768769 };
769770
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+5−5
@@ -2153,7 +2153,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, · 2152 unmodified lines
21532153 max_ports = mlxsw_core_max_ports(mlxsw_sp->core);
21542154 local_port = mlxsw_reg_pude_local_port_get(pude_pl);
21552155
2156− if (WARN_ON_ONCE(local_port >= max_ports))
2156+ if (WARN_ON_ONCE(!local_port || local_port >= max_ports))
21572157 return;
21582158 mlxsw_sp_port = mlxsw_sp->ports[local_port];
21592159 if (!mlxsw_sp_port)
@@ -3290,10 +3290,10 @@ mlxsw_sp_resources_rif_mac_profile_register(struct mlxsw_core *mlxsw_core) · 1130 unmodified lines
32903290 u8 max_rif_mac_profiles;
32913291
32923292 if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_RIF_MAC_PROFILES))
3293− return -EIO;
3294−
3295− max_rif_mac_profiles = MLXSW_CORE_RES_GET(mlxsw_core,
3296− MAX_RIF_MAC_PROFILES);
3293+ max_rif_mac_profiles = 1;
3294+ else
3295+ max_rif_mac_profiles = MLXSW_CORE_RES_GET(mlxsw_core,
3296+ MAX_RIF_MAC_PROFILES);
32973297 devlink_resource_size_params_init(&size_params, max_rif_mac_profiles,
32983298 max_rif_mac_profiles, 1,
32993299 DEVLINK_RESOURCE_UNIT_ENTRY);
drivers/net/ethernet/microchip/lan743x_main.c+3−9
@@ -914,8 +914,7 @@ static int lan743x_phy_reset(struct lan743x_adapter *adapter) · 913 unmodified lines
914914 }
915915
916916 static void lan743x_phy_update_flowcontrol(struct lan743x_adapter *adapter,
917− u8 duplex, u16 local_adv,
918− u16 remote_adv)
917+ u16 local_adv, u16 remote_adv)
919918 {
920919 struct lan743x_phy *phy = &adapter->phy;
921920 u8 cap;
@@ -943,7 +942,6 @@ static void lan743x_phy_link_status_change(struct net_device *netdev) · 21 unmodified lines
943942
944943 phy_print_status(phydev);
945944 if (phydev->state == PHY_RUNNING) {
946− struct ethtool_link_ksettings ksettings;
947945 int remote_advertisement = 0;
948946 int local_advertisement = 0;
949947
@@ -980,18 +978,14 @@ static void lan743x_phy_link_status_change(struct net_device *netdev) · 30 unmodified lines
980978 }
981979 lan743x_csr_write(adapter, MAC_CR, data);
982980
983− memset(&ksettings, 0, sizeof(ksettings));
984− phy_ethtool_get_link_ksettings(netdev, &ksettings);
985981 local_advertisement =
986982 linkmode_adv_to_mii_adv_t(phydev->advertising);
987983 remote_advertisement =
988984 linkmode_adv_to_mii_adv_t(phydev->lp_advertising);
989985
990− lan743x_phy_update_flowcontrol(adapter,
991− ksettings.base.duplex,
992− local_advertisement,
986+ lan743x_phy_update_flowcontrol(adapter, local_advertisement,
993987 remote_advertisement);
994− lan743x_ptp_update_latency(adapter, ksettings.base.speed);
988+ lan743x_ptp_update_latency(adapter, phydev->speed);
995989 }
996990 }
997991
drivers/net/ethernet/microsoft/mana/hw_channel.c+5−5
@@ -480,16 +480,16 @@ static int mana_hwc_create_wq(struct hw_channel_context *hwc, · 479 unmodified lines
480480 if (err)
481481 goto out;
482482
483− err = mana_hwc_alloc_dma_buf(hwc, q_depth, max_msg_size,
484− &hwc_wq->msg_buf);
485− if (err)
486− goto out;
487−
488483 hwc_wq->hwc = hwc;
489484 hwc_wq->gdma_wq = queue;
490485 hwc_wq->queue_depth = q_depth;
491486 hwc_wq->hwc_cq = hwc_cq;
492487
488+ err = mana_hwc_alloc_dma_buf(hwc, q_depth, max_msg_size,
489+ &hwc_wq->msg_buf);
490+ if (err)
491+ goto out;
492+
493493 *hwc_wq_ptr = hwc_wq;
494494 return 0;
495495 out:
drivers/net/ethernet/mscc/ocelot.c+246−8
@@ -1278,6 +1278,225 @@ int ocelot_fdb_dump(struct ocelot *ocelot, int port, · 1277 unmodified lines
12781278 }
12791279 EXPORT_SYMBOL(ocelot_fdb_dump);
12801280
1281+static void ocelot_populate_l2_ptp_trap_key(struct ocelot_vcap_filter *trap)
1282+{
1283+ trap->key_type = OCELOT_VCAP_KEY_ETYPE;
1284+ *(__be16 *)trap->key.etype.etype.value = htons(ETH_P_1588);
1285+ *(__be16 *)trap->key.etype.etype.mask = htons(0xffff);
1286+}
1287+
1288+static void
1289+ocelot_populate_ipv4_ptp_event_trap_key(struct ocelot_vcap_filter *trap)
1290+{
1291+ trap->key_type = OCELOT_VCAP_KEY_IPV4;
1292+ trap->key.ipv4.dport.value = PTP_EV_PORT;
1293+ trap->key.ipv4.dport.mask = 0xffff;
1294+}
1295+
1296+static void
1297+ocelot_populate_ipv6_ptp_event_trap_key(struct ocelot_vcap_filter *trap)
1298+{
1299+ trap->key_type = OCELOT_VCAP_KEY_IPV6;
1300+ trap->key.ipv6.dport.value = PTP_EV_PORT;
1301+ trap->key.ipv6.dport.mask = 0xffff;
1302+}
1303+
1304+static void
1305+ocelot_populate_ipv4_ptp_general_trap_key(struct ocelot_vcap_filter *trap)
1306+{
1307+ trap->key_type = OCELOT_VCAP_KEY_IPV4;
1308+ trap->key.ipv4.dport.value = PTP_GEN_PORT;
1309+ trap->key.ipv4.dport.mask = 0xffff;
1310+}
1311+
1312+static void
1313+ocelot_populate_ipv6_ptp_general_trap_key(struct ocelot_vcap_filter *trap)
1314+{
1315+ trap->key_type = OCELOT_VCAP_KEY_IPV6;
1316+ trap->key.ipv6.dport.value = PTP_GEN_PORT;
1317+ trap->key.ipv6.dport.mask = 0xffff;
1318+}
1319+
1320+static int ocelot_trap_add(struct ocelot *ocelot, int port,
1321+ unsigned long cookie,
1322+ void (*populate)(struct ocelot_vcap_filter *f))
1323+{
1324+ struct ocelot_vcap_block *block_vcap_is2;
1325+ struct ocelot_vcap_filter *trap;
1326+ bool new = false;
1327+ int err;
1328+
1329+ block_vcap_is2 = &ocelot->block[VCAP_IS2];
1330+
1331+ trap = ocelot_vcap_block_find_filter_by_id(block_vcap_is2, cookie,
1332+ false);
1333+ if (!trap) {
1334+ trap = kzalloc(sizeof(*trap), GFP_KERNEL);
1335+ if (!trap)
1336+ return -ENOMEM;
1337+
1338+ populate(trap);
1339+ trap->prio = 1;
1340+ trap->id.cookie = cookie;
1341+ trap->id.tc_offload = false;
1342+ trap->block_id = VCAP_IS2;
1343+ trap->type = OCELOT_VCAP_FILTER_OFFLOAD;
1344+ trap->lookup = 0;
1345+ trap->action.cpu_copy_ena = true;
1346+ trap->action.mask_mode = OCELOT_MASK_MODE_PERMIT_DENY;
1347+ trap->action.port_mask = 0;
1348+ new = true;
1349+ }
1350+
1351+ trap->ingress_port_mask |= BIT(port);
1352+
1353+ if (new)
1354+ err = ocelot_vcap_filter_add(ocelot, trap, NULL);
1355+ else
1356+ err = ocelot_vcap_filter_replace(ocelot, trap);
1357+ if (err) {
1358+ trap->ingress_port_mask &= ~BIT(port);
1359+ if (!trap->ingress_port_mask)
1360+ kfree(trap);
1361+ return err;
1362+ }
1363+
1364+ return 0;
1365+}
1366+
1367+static int ocelot_trap_del(struct ocelot *ocelot, int port,
1368+ unsigned long cookie)
1369+{
1370+ struct ocelot_vcap_block *block_vcap_is2;
1371+ struct ocelot_vcap_filter *trap;
1372+
1373+ block_vcap_is2 = &ocelot->block[VCAP_IS2];
1374+
1375+ trap = ocelot_vcap_block_find_filter_by_id(block_vcap_is2, cookie,
1376+ false);
1377+ if (!trap)
1378+ return 0;
1379+
1380+ trap->ingress_port_mask &= ~BIT(port);
1381+ if (!trap->ingress_port_mask)
1382+ return ocelot_vcap_filter_del(ocelot, trap);
1383+
1384+ return ocelot_vcap_filter_replace(ocelot, trap);
1385+}
1386+
1387+static int ocelot_l2_ptp_trap_add(struct ocelot *ocelot, int port)
1388+{
1389+ unsigned long l2_cookie = ocelot->num_phys_ports + 1;
1390+
1391+ return ocelot_trap_add(ocelot, port, l2_cookie,
1392+ ocelot_populate_l2_ptp_trap_key);
1393+}
1394+
1395+static int ocelot_l2_ptp_trap_del(struct ocelot *ocelot, int port)
1396+{
1397+ unsigned long l2_cookie = ocelot->num_phys_ports + 1;
1398+
1399+ return ocelot_trap_del(ocelot, port, l2_cookie);
1400+}
1401+
1402+static int ocelot_ipv4_ptp_trap_add(struct ocelot *ocelot, int port)
1403+{
1404+ unsigned long ipv4_gen_cookie = ocelot->num_phys_ports + 2;
1405+ unsigned long ipv4_ev_cookie = ocelot->num_phys_ports + 3;
1406+ int err;
1407+
1408+ err = ocelot_trap_add(ocelot, port, ipv4_ev_cookie,
1409+ ocelot_populate_ipv4_ptp_event_trap_key);
1410+ if (err)
1411+ return err;
1412+
1413+ err = ocelot_trap_add(ocelot, port, ipv4_gen_cookie,
1414+ ocelot_populate_ipv4_ptp_general_trap_key);
1415+ if (err)
1416+ ocelot_trap_del(ocelot, port, ipv4_ev_cookie);
1417+
1418+ return err;
1419+}
1420+
1421+static int ocelot_ipv4_ptp_trap_del(struct ocelot *ocelot, int port)
1422+{
1423+ unsigned long ipv4_gen_cookie = ocelot->num_phys_ports + 2;
1424+ unsigned long ipv4_ev_cookie = ocelot->num_phys_ports + 3;
1425+ int err;
1426+
1427+ err = ocelot_trap_del(ocelot, port, ipv4_ev_cookie);
1428+ err |= ocelot_trap_del(ocelot, port, ipv4_gen_cookie);
1429+ return err;
1430+}
1431+
1432+static int ocelot_ipv6_ptp_trap_add(struct ocelot *ocelot, int port)
1433+{
1434+ unsigned long ipv6_gen_cookie = ocelot->num_phys_ports + 4;
1435+ unsigned long ipv6_ev_cookie = ocelot->num_phys_ports + 5;
1436+ int err;
1437+
1438+ err = ocelot_trap_add(ocelot, port, ipv6_ev_cookie,
1439+ ocelot_populate_ipv6_ptp_event_trap_key);
1440+ if (err)
1441+ return err;
1442+
1443+ err = ocelot_trap_add(ocelot, port, ipv6_gen_cookie,
1444+ ocelot_populate_ipv6_ptp_general_trap_key);
1445+ if (err)
1446+ ocelot_trap_del(ocelot, port, ipv6_ev_cookie);
1447+
1448+ return err;
1449+}
1450+
1451+static int ocelot_ipv6_ptp_trap_del(struct ocelot *ocelot, int port)
1452+{
1453+ unsigned long ipv6_gen_cookie = ocelot->num_phys_ports + 4;
1454+ unsigned long ipv6_ev_cookie = ocelot->num_phys_ports + 5;
1455+ int err;
1456+
1457+ err = ocelot_trap_del(ocelot, port, ipv6_ev_cookie);
1458+ err |= ocelot_trap_del(ocelot, port, ipv6_gen_cookie);
1459+ return err;
1460+}
1461+
1462+static int ocelot_setup_ptp_traps(struct ocelot *ocelot, int port,
1463+ bool l2, bool l4)
1464+{
1465+ int err;
1466+
1467+ if (l2)
1468+ err = ocelot_l2_ptp_trap_add(ocelot, port);
1469+ else
1470+ err = ocelot_l2_ptp_trap_del(ocelot, port);
1471+ if (err)
1472+ return err;
1473+
1474+ if (l4) {
1475+ err = ocelot_ipv4_ptp_trap_add(ocelot, port);
1476+ if (err)
1477+ goto err_ipv4;
1478+
1479+ err = ocelot_ipv6_ptp_trap_add(ocelot, port);
1480+ if (err)
1481+ goto err_ipv6;
1482+ } else {
1483+ err = ocelot_ipv4_ptp_trap_del(ocelot, port);
1484+
1485+ err |= ocelot_ipv6_ptp_trap_del(ocelot, port);
1486+ }
1487+ if (err)
1488+ return err;
1489+
1490+ return 0;
1491+
1492+err_ipv6:
1493+ ocelot_ipv4_ptp_trap_del(ocelot, port);
1494+err_ipv4:
1495+ if (l2)
1496+ ocelot_l2_ptp_trap_del(ocelot, port);
1497+ return err;
1498+}
1499+
12811500 int ocelot_hwstamp_get(struct ocelot *ocelot, int port, struct ifreq *ifr)
12821501 {
12831502 return copy_to_user(ifr->ifr_data, &ocelot->hwtstamp_config,
@@ -1288,7 +1507,9 @@ EXPORT_SYMBOL(ocelot_hwstamp_get); · 4 unmodified lines
12881507 int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
12891508 {
12901509 struct ocelot_port *ocelot_port = ocelot->ports[port];
1510+ bool l2 = false, l4 = false;
12911511 struct hwtstamp_config cfg;
1512+ int err;
12921513
12931514 if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
12941515 return -EFAULT;
@@ -1320,28 +1541,42 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr) · 25 unmodified lines
13201541 switch (cfg.rx_filter) {
13211542 case HWTSTAMP_FILTER_NONE:
13221543 break;
1323− case HWTSTAMP_FILTER_ALL:
1324− case HWTSTAMP_FILTER_SOME:
1325− case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
1326− case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
1327− case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
1328− case HWTSTAMP_FILTER_NTP_ALL:
13291544 case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
13301545 case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
13311546 case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
1547+ l4 = true;
1548+ break;
13321549 case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
13331550 case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
13341551 case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
1552+ l2 = true;
1553+ break;
13351554 case HWTSTAMP_FILTER_PTP_V2_EVENT:
13361555 case HWTSTAMP_FILTER_PTP_V2_SYNC:
13371556 case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
1338− cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
1557+ l2 = true;
1558+ l4 = true;
13391559 break;
13401560 default:
13411561 mutex_unlock(&ocelot->ptp_lock);
13421562 return -ERANGE;
13431563 }
13441564
1565+ err = ocelot_setup_ptp_traps(ocelot, port, l2, l4);
1566+ if (err) {
1567+ mutex_unlock(&ocelot->ptp_lock);
1568+ return err;
1569+ }
1570+
1571+ if (l2 && l4)
1572+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
1573+ else if (l2)
1574+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;
1575+ else if (l4)
1576+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
1577+ else
1578+ cfg.rx_filter = HWTSTAMP_FILTER_NONE;
1579+
13451580 /* Commit back the result & save it */
13461581 memcpy(&ocelot->hwtstamp_config, &cfg, sizeof(cfg));
13471582 mutex_unlock(&ocelot->ptp_lock);
@@ -1444,7 +1679,10 @@ int ocelot_get_ts_info(struct ocelot *ocelot, int port, · 96 unmodified lines
14441679 SOF_TIMESTAMPING_RAW_HARDWARE;
14451680 info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON) |
14461681 BIT(HWTSTAMP_TX_ONESTEP_SYNC);
1447− info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | BIT(HWTSTAMP_FILTER_ALL);
1682+ info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
1683+ BIT(HWTSTAMP_FILTER_PTP_V2_EVENT) |
1684+ BIT(HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
1685+ BIT(HWTSTAMP_FILTER_PTP_V2_L4_EVENT);
14481686
14491687 return 0;
14501688 }
drivers/net/ethernet/mscc/ocelot_vcap.c+16−0
@@ -1217,6 +1217,22 @@ int ocelot_vcap_filter_del(struct ocelot *ocelot, · 1216 unmodified lines
12171217 }
12181218 EXPORT_SYMBOL(ocelot_vcap_filter_del);
12191219
1220+int ocelot_vcap_filter_replace(struct ocelot *ocelot,
1221+ struct ocelot_vcap_filter *filter)
1222+{
1223+ struct ocelot_vcap_block *block = &ocelot->block[filter->block_id];
1224+ int index;
1225+
1226+ index = ocelot_vcap_block_get_filter_index(block, filter);
1227+ if (index < 0)
1228+ return index;
1229+
1230+ vcap_entry_set(ocelot, index, filter);
1231+
1232+ return 0;
1233+}
1234+EXPORT_SYMBOL(ocelot_vcap_filter_replace);
1235+
12201236 int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
12211237 struct ocelot_vcap_filter *filter)
12221238 {
drivers/net/ethernet/natsemi/xtsonic.c+1−1
@@ -120,7 +120,7 @@ static const struct net_device_ops xtsonic_netdev_ops = { · 119 unmodified lines
120120 .ndo_set_mac_address = eth_mac_addr,
121121 };
122122
123−static int __init sonic_probe1(struct net_device *dev)
123+static int sonic_probe1(struct net_device *dev)
124124 {
125125 unsigned int silicon_revision;
126126 struct sonic_local *lp = netdev_priv(dev);
drivers/net/ethernet/netronome/nfp/nfp_net.h+0−3
@@ -565,7 +565,6 @@ struct nfp_net_dp { · 564 unmodified lines
565565 * @exn_name: Name for Exception interrupt
566566 * @shared_handler: Handler for shared interrupts
567567 * @shared_name: Name for shared interrupt
568− * @me_freq_mhz: ME clock_freq (MHz)
569568 * @reconfig_lock: Protects @reconfig_posted, @reconfig_timer_active,
570569 * @reconfig_sync_present and HW reconfiguration request
571570 * regs/machinery from async requests (sync must take
@@ -650,8 +649,6 @@ struct nfp_net { · 78 unmodified lines
650649 irq_handler_t shared_handler;
651650 char shared_name[IFNAMSIZ + 8];
652651
653− u32 me_freq_mhz;
654−
655652 bool link_up;
656653 spinlock_t link_status_lock;
657654
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c+1−1
@@ -1344,7 +1344,7 @@ static int nfp_net_set_coalesce(struct net_device *netdev, · 1343 unmodified lines
13441344 * ME timestamp ticks. There are 16 ME clock cycles for each timestamp
13451345 * count.
13461346 */
1347− factor = nn->me_freq_mhz / 16;
1347+ factor = nn->tlv_caps.me_freq_mhz / 16;
13481348
13491349 /* Each pair of (usecs, max_frames) fields specifies that interrupts
13501350 * should be coalesced until
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c+3−1
@@ -803,8 +803,10 @@ int nfp_cpp_area_cache_add(struct nfp_cpp *cpp, size_t size) · 802 unmodified lines
803803 return -ENOMEM;
804804
805805 cache = kzalloc(sizeof(*cache), GFP_KERNEL);
806− if (!cache)
806+ if (!cache) {
807+ nfp_cpp_area_free(area);
807808 return -ENOMEM;
809+ }
808810
809811 cache->id = 0;
810812 cache->addr = 0;
drivers/net/ethernet/ni/nixge.c+2−2
@@ -1209,7 +1209,7 @@ static void *nixge_get_nvmem_address(struct device *dev) · 1208 unmodified lines
12091209
12101210 cell = nvmem_cell_get(dev, "address");
12111211 if (IS_ERR(cell))
1212− return NULL;
1212+ return cell;
12131213
12141214 mac = nvmem_cell_read(cell, &cell_size);
12151215 nvmem_cell_put(cell);
@@ -1282,7 +1282,7 @@ static int nixge_probe(struct platform_device *pdev) · 66 unmodified lines
12821282 ndev->max_mtu = NIXGE_JUMBO_MTU;
12831283
12841284 mac_addr = nixge_get_nvmem_address(&pdev->dev);
1285− if (mac_addr && is_valid_ether_addr(mac_addr)) {
1285+ if (!IS_ERR(mac_addr) && is_valid_ether_addr(mac_addr)) {
12861286 eth_hw_addr_set(ndev, mac_addr);
12871287 kfree(mac_addr);
12881288 } else {
drivers/net/ethernet/qlogic/qed/qed_int.c+3−3
@@ -1045,7 +1045,7 @@ static int qed_int_deassertion(struct qed_hwfn *p_hwfn, · 1044 unmodified lines
10451045 if (!parities)
10461046 continue;
10471047
1048− for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
1048+ for (j = 0, bit_idx = 0; bit_idx < 32 && j < 32; j++) {
10491049 struct aeu_invert_reg_bit *p_bit = &p_aeu->bits[j];
10501050
10511051 if (qed_int_is_parity_flag(p_hwfn, p_bit) &&
@@ -1083,7 +1083,7 @@ static int qed_int_deassertion(struct qed_hwfn *p_hwfn, · 31 unmodified lines
10831083 * to current group, making them responsible for the
10841084 * previous assertion.
10851085 */
1086− for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
1086+ for (j = 0, bit_idx = 0; bit_idx < 32 && j < 32; j++) {
10871087 long unsigned int bitmask;
10881088 u8 bit, bit_len;
10891089
@@ -1382,7 +1382,7 @@ static void qed_int_sb_attn_init(struct qed_hwfn *p_hwfn, · 292 unmodified lines
13821382 memset(sb_info->parity_mask, 0, sizeof(u32) * NUM_ATTN_REGS);
13831383 for (i = 0; i < NUM_ATTN_REGS; i++) {
13841384 /* j is array index, k is bit index */
1385− for (j = 0, k = 0; k < 32; j++) {
1385+ for (j = 0, k = 0; k < 32 && j < 32; j++) {
13861386 struct aeu_invert_reg_bit *p_aeu;
13871387
13881388 p_aeu = &aeu_descs[i].bits[j];
drivers/net/ethernet/qlogic/qede/qede_fp.c+7−0
@@ -1643,6 +1643,13 @@ netdev_tx_t qede_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 1642 unmodified lines
16431643 data_split = true;
16441644 }
16451645 } else {
1646+ if (unlikely(skb->len > ETH_TX_MAX_NON_LSO_PKT_LEN)) {
1647+ DP_ERR(edev, "Unexpected non LSO skb length = 0x%x\n", skb->len);
1648+ qede_free_failed_tx_pkt(txq, first_bd, 0, false);
1649+ qede_update_tx_producer(txq);
1650+ return NETDEV_TX_OK;
1651+ }
1652+
16461653 val |= ((skb->len & ETH_TX_DATA_1ST_BD_PKT_LEN_MASK) <<
16471654 ETH_TX_DATA_1ST_BD_PKT_LEN_SHIFT);
16481655 }
drivers/net/ethernet/qlogic/qla3xxx.c+9−10
@@ -3480,20 +3480,19 @@ static int ql_adapter_up(struct ql3_adapter *qdev) · 3479 unmodified lines
34803480
34813481 spin_lock_irqsave(&qdev->hw_lock, hw_flags);
34823482
3483− err = ql_wait_for_drvr_lock(qdev);
3484− if (err) {
3485− err = ql_adapter_initialize(qdev);
3486− if (err) {
3487− netdev_err(ndev, "Unable to initialize adapter\n");
3488− goto err_init;
3489− }
3490− netdev_err(ndev, "Releasing driver lock\n");
3491− ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);
3492− } else {
3483+ if (!ql_wait_for_drvr_lock(qdev)) {
34933484 netdev_err(ndev, "Could not acquire driver lock\n");
3485+ err = -ENODEV;
34943486 goto err_lock;
34953487 }
34963488
3489+ err = ql_adapter_initialize(qdev);
3490+ if (err) {
3491+ netdev_err(ndev, "Unable to initialize adapter\n");
3492+ goto err_init;
3493+ }
3494+ ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);
3495+
34973496 spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
34983497
34993498 set_bit(QL_ADAPTER_UP, &qdev->flags);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c+8−2
@@ -1077,8 +1077,14 @@ static int qlcnic_83xx_add_rings(struct qlcnic_adapter *adapter) · 1076 unmodified lines
10771077 sds_mbx_size = sizeof(struct qlcnic_sds_mbx);
10781078 context_id = recv_ctx->context_id;
10791079 num_sds = adapter->drv_sds_rings - QLCNIC_MAX_SDS_RINGS;
1080− ahw->hw_ops->alloc_mbx_args(&cmd, adapter,
1081− QLCNIC_CMD_ADD_RCV_RINGS);
1080+ err = ahw->hw_ops->alloc_mbx_args(&cmd, adapter,
1081+ QLCNIC_CMD_ADD_RCV_RINGS);
1082+ if (err) {
1083+ dev_err(&adapter->pdev->dev,
1084+ "Failed to alloc mbx args %d\n", err);
1085+ return err;
1086+ }
1087+
10821088 cmd.req.arg[1] = 0 | (num_sds << 8) | (context_id << 16);
10831089
10841090 /* set up status rings, mbx 2-81 */
drivers/net/ethernet/realtek/r8169_main.c+3−2
@@ -5217,8 +5217,8 @@ static int rtl_get_ether_clk(struct rtl8169_private *tp) · 5216 unmodified lines
52175217
52185218 static void rtl_init_mac_address(struct rtl8169_private *tp)
52195219 {
5220+ u8 mac_addr[ETH_ALEN] __aligned(2) = {};
52205221 struct net_device *dev = tp->dev;
5221− u8 mac_addr[ETH_ALEN];
52225222 int rc;
52235223
52245224 rc = eth_platform_get_mac_address(tp_to_dev(tp), mac_addr);
@@ -5233,7 +5233,8 @@ static void rtl_init_mac_address(struct rtl8169_private *tp) · 8 unmodified lines
52335233 if (is_valid_ether_addr(mac_addr))
52345234 goto done;
52355235
5236− eth_hw_addr_random(dev);
5236+ eth_random_addr(mac_addr);
5237+ dev->addr_assign_type = NET_ADDR_RANDOM;
52375238 dev_warn(tp_to_dev(tp), "can't read MAC address, setting random one\n");
52385239 done:
52395240 eth_hw_addr_set(dev, mac_addr);
drivers/net/ethernet/sis/sis900.c+1−1
@@ -392,7 +392,7 @@ static int sis96x_get_mac_addr(struct pci_dev *pci_dev, · 391 unmodified lines
392392 /* get MAC address from EEPROM */
393393 for (i = 0; i < 3; i++)
394394 addr[i] = read_eeprom(ioaddr, i + EEPROMMACAddr);
395− eth_hw_addr_set(net_dev, (u8 *)addr);
395+ eth_hw_addr_set(net_dev, (u8 *)addr);
396396
397397 rc = 1;
398398 break;
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c+22−2
@@ -485,8 +485,28 @@ static int socfpga_dwmac_resume(struct device *dev) · 484 unmodified lines
485485 }
486486 #endif /* CONFIG_PM_SLEEP */
487487
488−static SIMPLE_DEV_PM_OPS(socfpga_dwmac_pm_ops, stmmac_suspend,
489− socfpga_dwmac_resume);
488+static int __maybe_unused socfpga_dwmac_runtime_suspend(struct device *dev)
489+{
490+ struct net_device *ndev = dev_get_drvdata(dev);
491+ struct stmmac_priv *priv = netdev_priv(ndev);
492+
493+ stmmac_bus_clks_config(priv, false);
494+
495+ return 0;
496+}
497+
498+static int __maybe_unused socfpga_dwmac_runtime_resume(struct device *dev)
499+{
500+ struct net_device *ndev = dev_get_drvdata(dev);
501+ struct stmmac_priv *priv = netdev_priv(ndev);
502+
503+ return stmmac_bus_clks_config(priv, true);
504+}
505+
506+static const struct dev_pm_ops socfpga_dwmac_pm_ops = {
507+ SET_SYSTEM_SLEEP_PM_OPS(stmmac_suspend, socfpga_dwmac_resume)
508+ SET_RUNTIME_PM_OPS(socfpga_dwmac_runtime_suspend, socfpga_dwmac_runtime_resume, NULL)
509+};
490510
491511 static const struct socfpga_dwmac_ops socfpga_gen5_ops = {
492512 .set_phy_mode = socfpga_gen5_set_phy_mode,
drivers/net/ethernet/stmicro/stmmac/stmmac.h+1−0
@@ -314,6 +314,7 @@ int stmmac_mdio_reset(struct mii_bus *mii); · 313 unmodified lines
314314 int stmmac_xpcs_setup(struct mii_bus *mii);
315315 void stmmac_set_ethtool_ops(struct net_device *netdev);
316316
317+int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags);
317318 void stmmac_ptp_register(struct stmmac_priv *priv);
318319 void stmmac_ptp_unregister(struct stmmac_priv *priv);
319320 int stmmac_open(struct net_device *dev);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+102−68
@@ -50,6 +50,13 @@ · 49 unmodified lines
5050 #include "dwxgmac2.h"
5151 #include "hwif.h"
5252
53+/* As long as the interface is active, we keep the timestamping counter enabled
54+ * with fine resolution and binary rollover. This avoid non-monotonic behavior
55+ * (clock jumps) when changing timestamping settings at runtime.
56+ */
57+#define STMMAC_HWTS_ACTIVE (PTP_TCR_TSENA | PTP_TCR_TSCFUPDT | \
58+ PTP_TCR_TSCTRLSSR)
59+
5360 #define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
5461 #define TSO_MAX_BUFF_SIZE (SZ_16K - 1)
5562
@@ -511,6 +518,14 @@ bool stmmac_eee_init(struct stmmac_priv *priv) · 455 unmodified lines
511518 return true;
512519 }
513520
521+static inline u32 stmmac_cdc_adjust(struct stmmac_priv *priv)
522+{
523+ /* Correct the clk domain crossing(CDC) error */
524+ if (priv->plat->has_gmac4 && priv->plat->clk_ptp_rate)
525+ return (2 * NSEC_PER_SEC) / priv->plat->clk_ptp_rate;
526+ return 0;
527+}
528+
514529 /* stmmac_get_tx_hwtstamp - get HW TX timestamps
515530 * @priv: driver private structure
516531 * @p : descriptor pointer
@@ -524,7 +539,6 @@ static void stmmac_get_tx_hwtstamp(struct stmmac_priv *priv, · 7 unmodified lines
524539 {
525540 struct skb_shared_hwtstamps shhwtstamp;
526541 bool found = false;
527− s64 adjust = 0;
528542 u64 ns = 0;
529543
530544 if (!priv->hwts_tx_en)
@@ -543,12 +557,7 @@ static void stmmac_get_tx_hwtstamp(struct stmmac_priv *priv, · 12 unmodified lines
543557 }
544558
545559 if (found) {
546− /* Correct the clk domain crossing(CDC) error */
547− if (priv->plat->has_gmac4 && priv->plat->clk_ptp_rate) {
548− adjust += -(2 * (NSEC_PER_SEC /
549− priv->plat->clk_ptp_rate));
550− ns += adjust;
551− }
560+ ns -= stmmac_cdc_adjust(priv);
552561
553562 memset(&shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps));
554563 shhwtstamp.hwtstamp = ns_to_ktime(ns);
@@ -573,7 +582,6 @@ static void stmmac_get_rx_hwtstamp(struct stmmac_priv *priv, struct dma_desc *p, · 18 unmodified lines
573582 {
574583 struct skb_shared_hwtstamps *shhwtstamp = NULL;
575584 struct dma_desc *desc = p;
576− u64 adjust = 0;
577585 u64 ns = 0;
578586
579587 if (!priv->hwts_rx_en)
@@ -586,11 +594,7 @@ static void stmmac_get_rx_hwtstamp(struct stmmac_priv *priv, struct dma_desc *p, · 6 unmodified lines
586594 if (stmmac_get_rx_timestamp_status(priv, p, np, priv->adv_ts)) {
587595 stmmac_get_timestamp(priv, desc, priv->adv_ts, &ns);
588596
589− /* Correct the clk domain crossing(CDC) error */
590− if (priv->plat->has_gmac4 && priv->plat->clk_ptp_rate) {
591− adjust += 2 * (NSEC_PER_SEC / priv->plat->clk_ptp_rate);
592− ns -= adjust;
593− }
597+ ns -= stmmac_cdc_adjust(priv);
594598
595599 netdev_dbg(priv->dev, "get valid RX hw timestamp %llu\n", ns);
596600 shhwtstamp = skb_hwtstamps(skb);
@@ -616,8 +620,6 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr) · 19 unmodified lines
616620 {
617621 struct stmmac_priv *priv = netdev_priv(dev);
618622 struct hwtstamp_config config;
619− struct timespec64 now;
620− u64 temp = 0;
621623 u32 ptp_v2 = 0;
622624 u32 tstamp_all = 0;
623625 u32 ptp_over_ipv4_udp = 0;
@@ -626,11 +628,6 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr) · 2 unmodified lines
626628 u32 snap_type_sel = 0;
627629 u32 ts_master_en = 0;
628630 u32 ts_event_en = 0;
629− u32 sec_inc = 0;
630− u32 value = 0;
631− bool xmac;
632−
633− xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
634631
635632 if (!(priv->dma_cap.time_stamp || priv->adv_ts)) {
636633 netdev_alert(priv->dev, "No support for HW time stamping\n");
@@ -792,42 +789,17 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr) · 155 unmodified lines
792789 priv->hwts_rx_en = ((config.rx_filter == HWTSTAMP_FILTER_NONE) ? 0 : 1);
793790 priv->hwts_tx_en = config.tx_type == HWTSTAMP_TX_ON;
794791
795− if (!priv->hwts_tx_en && !priv->hwts_rx_en)
796− stmmac_config_hw_tstamping(priv, priv->ptpaddr, 0);
797− else {
798− value = (PTP_TCR_TSENA | PTP_TCR_TSCFUPDT | PTP_TCR_TSCTRLSSR |
799− tstamp_all | ptp_v2 | ptp_over_ethernet |
800− ptp_over_ipv6_udp | ptp_over_ipv4_udp | ts_event_en |
801− ts_master_en | snap_type_sel);
802− stmmac_config_hw_tstamping(priv, priv->ptpaddr, value);
803−
804− /* program Sub Second Increment reg */
805− stmmac_config_sub_second_increment(priv,
806− priv->ptpaddr, priv->plat->clk_ptp_rate,
807− xmac, &sec_inc);
808− temp = div_u64(1000000000ULL, sec_inc);
809−
810− /* Store sub second increment and flags for later use */
811− priv->sub_second_inc = sec_inc;
812− priv->systime_flags = value;
813−
814− /* calculate default added value:
815− * formula is :
816− * addend = (2^32)/freq_div_ratio;
817− * where, freq_div_ratio = 1e9ns/sec_inc
818− */
819− temp = (u64)(temp << 32);
820− priv->default_addend = div_u64(temp, priv->plat->clk_ptp_rate);
821− stmmac_config_addend(priv, priv->ptpaddr, priv->default_addend);
822−
823− /* initialize system time */
824− ktime_get_real_ts64(&now);
792+ priv->systime_flags = STMMAC_HWTS_ACTIVE;
825793
826− /* lower 32 bits of tv_sec are safe until y2106 */
827− stmmac_init_systime(priv, priv->ptpaddr,
828− (u32)now.tv_sec, now.tv_nsec);
794+ if (priv->hwts_tx_en || priv->hwts_rx_en) {
795+ priv->systime_flags |= tstamp_all | ptp_v2 |
796+ ptp_over_ethernet | ptp_over_ipv6_udp |
797+ ptp_over_ipv4_udp | ts_event_en |
798+ ts_master_en | snap_type_sel;
829799 }
830800
801+ stmmac_config_hw_tstamping(priv, priv->ptpaddr, priv->systime_flags);
802+
831803 memcpy(&priv->tstamp_config, &config, sizeof(config));
832804
833805 return copy_to_user(ifr->ifr_data, &config,
@@ -855,6 +827,66 @@ static int stmmac_hwtstamp_get(struct net_device *dev, struct ifreq *ifr) · 21 unmodified lines
855827 sizeof(*config)) ? -EFAULT : 0;
856828 }
857829
830+/**
831+ * stmmac_init_tstamp_counter - init hardware timestamping counter
832+ * @priv: driver private structure
833+ * @systime_flags: timestamping flags
834+ * Description:
835+ * Initialize hardware counter for packet timestamping.
836+ * This is valid as long as the interface is open and not suspended.
837+ * Will be rerun after resuming from suspend, case in which the timestamping
838+ * flags updated by stmmac_hwtstamp_set() also need to be restored.
839+ */
840+int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags)
841+{
842+ bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
843+ struct timespec64 now;
844+ u32 sec_inc = 0;
845+ u64 temp = 0;
846+ int ret;
847+
848+ if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
849+ return -EOPNOTSUPP;
850+
851+ ret = clk_prepare_enable(priv->plat->clk_ptp_ref);
852+ if (ret < 0) {
853+ netdev_warn(priv->dev,
854+ "failed to enable PTP reference clock: %pe\n",
855+ ERR_PTR(ret));
856+ return ret;
857+ }
858+
859+ stmmac_config_hw_tstamping(priv, priv->ptpaddr, systime_flags);
860+ priv->systime_flags = systime_flags;
861+
862+ /* program Sub Second Increment reg */
863+ stmmac_config_sub_second_increment(priv, priv->ptpaddr,
864+ priv->plat->clk_ptp_rate,
865+ xmac, &sec_inc);
866+ temp = div_u64(1000000000ULL, sec_inc);
867+
868+ /* Store sub second increment for later use */
869+ priv->sub_second_inc = sec_inc;
870+
871+ /* calculate default added value:
872+ * formula is :
873+ * addend = (2^32)/freq_div_ratio;
874+ * where, freq_div_ratio = 1e9ns/sec_inc
875+ */
876+ temp = (u64)(temp << 32);
877+ priv->default_addend = div_u64(temp, priv->plat->clk_ptp_rate);
878+ stmmac_config_addend(priv, priv->ptpaddr, priv->default_addend);
879+
880+ /* initialize system time */
881+ ktime_get_real_ts64(&now);
882+
883+ /* lower 32 bits of tv_sec are safe until y2106 */
884+ stmmac_init_systime(priv, priv->ptpaddr, (u32)now.tv_sec, now.tv_nsec);
885+
886+ return 0;
887+}
888+EXPORT_SYMBOL_GPL(stmmac_init_tstamp_counter);
889+
858890 /**
859891 * stmmac_init_ptp - init PTP
860892 * @priv: driver private structure
@@ -865,9 +897,11 @@ static int stmmac_hwtstamp_get(struct net_device *dev, struct ifreq *ifr) · 4 unmodified lines
865897 static int stmmac_init_ptp(struct stmmac_priv *priv)
866898 {
867899 bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
900+ int ret;
868901
869− if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
870− return -EOPNOTSUPP;
902+ ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE);
903+ if (ret)
904+ return ret;
871905
872906 priv->adv_ts = 0;
873907 /* Check if adv_ts can be enabled for dwmac 4.x / xgmac core */
@@ -3275,10 +3309,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp) · 2401 unmodified lines
32753309 stmmac_mmc_setup(priv);
32763310
32773311 if (init_ptp) {
3278− ret = clk_prepare_enable(priv->plat->clk_ptp_ref);
3279− if (ret < 0)
3280− netdev_warn(priv->dev, "failed to enable PTP reference clock: %d\n", ret);
3281−
32823312 ret = stmmac_init_ptp(priv);
32833313 if (ret == -EOPNOTSUPP)
32843314 netdev_warn(priv->dev, "PTP not supported by HW\n");
@@ -3772,6 +3802,8 @@ int stmmac_release(struct net_device *dev) · 487 unmodified lines
37723802 struct stmmac_priv *priv = netdev_priv(dev);
37733803 u32 chan;
37743804
3805+ netif_tx_disable(dev);
3806+
37753807 if (device_may_wakeup(priv->device))
37763808 phylink_speed_down(priv->phylink, false);
37773809 /* Stop and disconnect the PHY */
@@ -5164,12 +5196,13 @@ read_again: · 1386 unmodified lines
51645196 if (likely(!(status & rx_not_ls)) &&
51655197 (likely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
51665198 unlikely(status != llc_snap))) {
5167− if (buf2_len)
5199+ if (buf2_len) {
51685200 buf2_len -= ETH_FCS_LEN;
5169− else
5201+ len -= ETH_FCS_LEN;
5202+ } else if (buf1_len) {
51705203 buf1_len -= ETH_FCS_LEN;
5171−
5172− len -= ETH_FCS_LEN;
5204+ len -= ETH_FCS_LEN;
5205+ }
51735206 }
51745207
51755208 if (!skb) {
@@ -5507,8 +5540,6 @@ static int stmmac_set_features(struct net_device *netdev, · 331 unmodified lines
55075540 netdev_features_t features)
55085541 {
55095542 struct stmmac_priv *priv = netdev_priv(netdev);
5510− bool sph_en;
5511− u32 chan;
55125543
55135544 /* Keep the COE Type in case of csum is supporting */
55145545 if (features & NETIF_F_RXCSUM)
@@ -5520,10 +5551,13 @@ static int stmmac_set_features(struct net_device *netdev, · 5 unmodified lines
55205551 */
55215552 stmmac_rx_ipc(priv, priv->hw);
55225553
5523− sph_en = (priv->hw->rx_csum > 0) && priv->sph;
5554+ if (priv->sph_cap) {
5555+ bool sph_en = (priv->hw->rx_csum > 0) && priv->sph;
5556+ u32 chan;
55245557
5525− for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
5526− stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
5558+ for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
5559+ stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
5560+ }
55275561
55285562 return 0;
55295563 }
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+1−1
@@ -816,7 +816,7 @@ static int __maybe_unused stmmac_pltfr_noirq_resume(struct device *dev) · 815 unmodified lines
816816 if (ret)
817817 return ret;
818818
819− clk_prepare_enable(priv->plat->clk_ptp_ref);
819+ stmmac_init_tstamp_counter(priv, priv->systime_flags);
820820 }
821821
822822 return 0;
drivers/net/hamradio/6pack.c+0−1
@@ -306,7 +306,6 @@ static void sp_setup(struct net_device *dev) · 305 unmodified lines
306306 {
307307 /* Finish setting up the DEVICE info. */
308308 dev->netdev_ops = &sp_netdev_ops;
309− dev->needs_free_netdev = true;
310309 dev->mtu = SIXP_MTU;
311310 dev->hard_header_len = AX25_MAX_HEADER_LEN;
312311 dev->header_ops = &ax25_header_ops;
drivers/net/hamradio/mkiss.c+2−0
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131
3232 #define AX_MTU 236
3333
34+/* some arch define END as assembly function ending, just undef it */
35+#undef END
3436 /* SLIP/KISS protocol characters. */
3537 #define END 0300 /* indicates end of frame */
3638 #define ESC 0333 /* indicates byte stuffing */
drivers/net/ipa/ipa_cmd.c+0−16
@@ -661,22 +661,6 @@ void ipa_cmd_pipeline_clear_wait(struct ipa *ipa) · 660 unmodified lines
661661 wait_for_completion(&ipa->completion);
662662 }
663663
664−void ipa_cmd_pipeline_clear(struct ipa *ipa)
665−{
666− u32 count = ipa_cmd_pipeline_clear_count();
667− struct gsi_trans *trans;
668−
669− trans = ipa_cmd_trans_alloc(ipa, count);
670− if (trans) {
671− ipa_cmd_pipeline_clear_add(trans);
672− gsi_trans_commit_wait(trans);
673− ipa_cmd_pipeline_clear_wait(ipa);
674− } else {
675− dev_err(&ipa->pdev->dev,
676− "error allocating %u entry tag transaction\n", count);
677− }
678−}
679−
680664 static struct ipa_cmd_info *
681665 ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count)
682666 {
drivers/net/ipa/ipa_cmd.h+0−6
@@ -163,12 +163,6 @@ u32 ipa_cmd_pipeline_clear_count(void); · 162 unmodified lines
163163 */
164164 void ipa_cmd_pipeline_clear_wait(struct ipa *ipa);
165165
166−/**
167− * ipa_cmd_pipeline_clear() - Clear the hardware pipeline
168− * @ipa: - IPA pointer
169− */
170−void ipa_cmd_pipeline_clear(struct ipa *ipa);
171−
172166 /**
173167 * ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint
174168 * @ipa: IPA pointer
drivers/net/ipa/ipa_endpoint.c+5−2
@@ -853,6 +853,7 @@ static void ipa_endpoint_init_hol_block_timer(struct ipa_endpoint *endpoint, · 852 unmodified lines
853853 u32 offset;
854854 u32 val;
855855
856+ /* This should only be changed when HOL_BLOCK_EN is disabled */
856857 offset = IPA_REG_ENDP_INIT_HOL_BLOCK_TIMER_N_OFFSET(endpoint_id);
857858 val = hol_block_timer_val(ipa, microseconds);
858859 iowrite32(val, ipa->reg_virt + offset);
@@ -868,6 +869,9 @@ ipa_endpoint_init_hol_block_enable(struct ipa_endpoint *endpoint, bool enable) · 9 unmodified lines
868869 val = enable ? HOL_BLOCK_EN_FMASK : 0;
869870 offset = IPA_REG_ENDP_INIT_HOL_BLOCK_EN_N_OFFSET(endpoint_id);
870871 iowrite32(val, endpoint->ipa->reg_virt + offset);
872+ /* When enabling, the register must be written twice for IPA v4.5+ */
873+ if (enable && endpoint->ipa->version >= IPA_VERSION_4_5)
874+ iowrite32(val, endpoint->ipa->reg_virt + offset);
871875 }
872876
873877 void ipa_endpoint_modem_hol_block_clear_all(struct ipa *ipa)
@@ -880,6 +884,7 @@ void ipa_endpoint_modem_hol_block_clear_all(struct ipa *ipa) · 6 unmodified lines
880884 if (endpoint->toward_ipa || endpoint->ee_id != GSI_EE_MODEM)
881885 continue;
882886
887+ ipa_endpoint_init_hol_block_enable(endpoint, false);
883888 ipa_endpoint_init_hol_block_timer(endpoint, 0);
884889 ipa_endpoint_init_hol_block_enable(endpoint, true);
885890 }
@@ -1631,8 +1636,6 @@ void ipa_endpoint_suspend(struct ipa *ipa) · 745 unmodified lines
16311636 if (ipa->modem_netdev)
16321637 ipa_modem_suspend(ipa->modem_netdev);
16331638
1634− ipa_cmd_pipeline_clear(ipa);
1635−
16361639 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]);
16371640 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]);
16381641 }
drivers/net/ipa/ipa_main.c+6−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include "ipa_reg.h"
2929 #include "ipa_mem.h"
3030 #include "ipa_table.h"
31+#include "ipa_smp2p.h"
3132 #include "ipa_modem.h"
3233 #include "ipa_uc.h"
3334 #include "ipa_interrupt.h"
@@ -801,6 +802,11 @@ static int ipa_remove(struct platform_device *pdev) · 767 unmodified lines
801802 struct device *dev = &pdev->dev;
802803 int ret;
803804
805+ /* Prevent the modem from triggering a call to ipa_setup(). This
806+ * also ensures a modem-initiated setup that's underway completes.
807+ */
808+ ipa_smp2p_irq_disable_setup(ipa);
809+
804810 ret = pm_runtime_get_sync(dev);
805811 if (WARN_ON(ret < 0))
806812 goto out_power_put;
drivers/net/ipa/ipa_modem.c+3−3
@@ -339,9 +339,6 @@ int ipa_modem_stop(struct ipa *ipa) · 338 unmodified lines
339339 if (state != IPA_MODEM_STATE_RUNNING)
340340 return -EBUSY;
341341
342− /* Prevent the modem from triggering a call to ipa_setup() */
343− ipa_smp2p_disable(ipa);
344−
345342 /* Clean up the netdev and endpoints if it was started */
346343 if (netdev) {
347344 struct ipa_priv *priv = netdev_priv(netdev);
@@ -369,6 +366,9 @@ static void ipa_modem_crashed(struct ipa *ipa) · 21 unmodified lines
369366 struct device *dev = &ipa->pdev->dev;
370367 int ret;
371368
369+ /* Prevent the modem from triggering a call to ipa_setup() */
370+ ipa_smp2p_irq_disable_setup(ipa);
371+
372372 ret = pm_runtime_get_sync(dev);
373373 if (ret < 0) {
374374 dev_err(dev, "error %d getting power to handle crash\n", ret);
drivers/net/ipa/ipa_resource.c+1−1
@@ -52,7 +52,7 @@ static bool ipa_resource_limits_valid(struct ipa *ipa, · 51 unmodified lines
5252 return false;
5353 }
5454
55− group_count = data->rsrc_group_src_count;
55+ group_count = data->rsrc_group_dst_count;
5656 if (!group_count || group_count > IPA_RESOURCE_GROUP_MAX)
5757 return false;
5858
drivers/net/ipa/ipa_smp2p.c+10−11
@@ -53,7 +53,7 @@ · 52 unmodified lines
5353 * @setup_ready_irq: IPA interrupt triggered by modem to signal GSI ready
5454 * @power_on: Whether IPA power is on
5555 * @notified: Whether modem has been notified of power state
56− * @disabled: Whether setup ready interrupt handling is disabled
56+ * @setup_disabled: Whether setup ready interrupt handler is disabled
5757 * @mutex: Mutex protecting ready-interrupt/shutdown interlock
5858 * @panic_notifier: Panic notifier structure
5959 */
@@ -67,7 +67,7 @@ struct ipa_smp2p { · 7 unmodified lines
6767 u32 setup_ready_irq;
6868 bool power_on;
6969 bool notified;
70− bool disabled;
70+ bool setup_disabled;
7171 struct mutex mutex;
7272 struct notifier_block panic_notifier;
7373 };
@@ -155,11 +155,9 @@ static irqreturn_t ipa_smp2p_modem_setup_ready_isr(int irq, void *dev_id) · 81 unmodified lines
155155 struct device *dev;
156156 int ret;
157157
158− mutex_lock(&smp2p->mutex);
159−
160− if (smp2p->disabled)
161− goto out_mutex_unlock;
162− smp2p->disabled = true; /* If any others arrive, ignore them */
158+ /* Ignore any (spurious) interrupts received after the first */
159+ if (smp2p->ipa->setup_complete)
160+ return IRQ_HANDLED;
163161
164162 /* Power needs to be active for setup */
165163 dev = &smp2p->ipa->pdev->dev;
@@ -176,8 +174,6 @@ static irqreturn_t ipa_smp2p_modem_setup_ready_isr(int irq, void *dev_id) · 10 unmodified lines
176174 out_power_put:
177175 pm_runtime_mark_last_busy(dev);
178176 (void)pm_runtime_put_autosuspend(dev);
179−out_mutex_unlock:
180− mutex_unlock(&smp2p->mutex);
181177
182178 return IRQ_HANDLED;
183179 }
@@ -313,7 +309,7 @@ void ipa_smp2p_exit(struct ipa *ipa) · 129 unmodified lines
313309 kfree(smp2p);
314310 }
315311
316−void ipa_smp2p_disable(struct ipa *ipa)
312+void ipa_smp2p_irq_disable_setup(struct ipa *ipa)
317313 {
318314 struct ipa_smp2p *smp2p = ipa->smp2p;
319315
@@ -322,7 +318,10 @@ void ipa_smp2p_disable(struct ipa *ipa) · 2 unmodified lines
322318
323319 mutex_lock(&smp2p->mutex);
324320
325− smp2p->disabled = true;
321+ if (!smp2p->setup_disabled) {
322+ disable_irq(smp2p->setup_ready_irq);
323+ smp2p->setup_disabled = true;
324+ }
326325
327326 mutex_unlock(&smp2p->mutex);
328327 }
drivers/net/ipa/ipa_smp2p.h+3−4
@@ -27,13 +27,12 @@ int ipa_smp2p_init(struct ipa *ipa, bool modem_init); · 26 unmodified lines
2727 void ipa_smp2p_exit(struct ipa *ipa);
2828
2929 /**
30− * ipa_smp2p_disable() - Prevent "ipa-setup-ready" interrupt handling
30+ * ipa_smp2p_irq_disable_setup() - Disable the "setup ready" interrupt
3131 * @ipa: IPA pointer
3232 *
33− * Prevent handling of the "setup ready" interrupt from the modem.
34− * This is used before initiating shutdown of the driver.
33+ * Disable the "ipa-setup-ready" interrupt from the modem.
3534 */
36−void ipa_smp2p_disable(struct ipa *ipa);
35+void ipa_smp2p_irq_disable_setup(struct ipa *ipa);
3736
3837 /**
3938 * ipa_smp2p_notify_reset() - Reset modem notification state
drivers/net/mdio/mdio-aspeed.c+7−0
@@ -61,6 +61,13 @@ static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum) · 60 unmodified lines
6161
6262 iowrite32(ctrl, ctx->base + ASPEED_MDIO_CTRL);
6363
64+ rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_CTRL, ctrl,
65+ !(ctrl & ASPEED_MDIO_CTRL_FIRE),
66+ ASPEED_MDIO_INTERVAL_US,
67+ ASPEED_MDIO_TIMEOUT_US);
68+ if (rc < 0)
69+ return rc;
70+
6471 rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_DATA, data,
6572 data & ASPEED_MDIO_DATA_IDLE,
6673 ASPEED_MDIO_INTERVAL_US,
drivers/net/phy/phylink.c+26−1
@@ -710,6 +710,7 @@ static void phylink_resolve(struct work_struct *w) · 709 unmodified lines
710710 struct phylink_link_state link_state;
711711 struct net_device *ndev = pl->netdev;
712712 bool mac_config = false;
713+ bool retrigger = false;
713714 bool cur_link_state;
714715
715716 mutex_lock(&pl->state_mutex);
@@ -723,6 +724,7 @@ static void phylink_resolve(struct work_struct *w) · 7 unmodified lines
723724 link_state.link = false;
724725 } else if (pl->mac_link_dropped) {
725726 link_state.link = false;
727+ retrigger = true;
726728 } else {
727729 switch (pl->cur_link_an_mode) {
728730 case MLO_AN_PHY:
@@ -739,6 +741,19 @@ static void phylink_resolve(struct work_struct *w) · 10 unmodified lines
739741 case MLO_AN_INBAND:
740742 phylink_mac_pcs_get_state(pl, &link_state);
741743
744+ /* The PCS may have a latching link-fail indicator.
745+ * If the link was up, bring the link down and
746+ * re-trigger the resolve. Otherwise, re-read the
747+ * PCS state to get the current status of the link.
748+ */
749+ if (!link_state.link) {
750+ if (cur_link_state)
751+ retrigger = true;
752+ else
753+ phylink_mac_pcs_get_state(pl,
754+ &link_state);
755+ }
756+
742757 /* If we have a phy, the "up" state is the union of
743758 * both the PHY and the MAC
744759 */

33 more lines aren’t shown here.

drivers/net/slip/slip.h+2−0

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

drivers/net/tun.c+5−0

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

drivers/net/usb/cdc_ncm.c+2−0

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

drivers/net/usb/lan78xx.c+1−1

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

drivers/net/usb/r8152.c+3−6

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

drivers/net/usb/smsc95xx.c+26−29

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

drivers/net/virtio_net.c+0−1

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

drivers/net/vmxnet3/vmxnet3_drv.c+7−6

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

drivers/net/vrf.c+6−4

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

drivers/net/wireguard/allowedips.c+1−1

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

drivers/net/wireguard/device.c+21−18

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

drivers/net/wireguard/device.h+3−6

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

drivers/net/wireguard/main.c+4−4

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

drivers/net/wireguard/queueing.c+3−3

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

drivers/net/wireguard/queueing.h+1−1

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

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

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

drivers/net/wireguard/receive.c+23−16

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

drivers/net/wireguard/socket.c+1−1

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

drivers/net/wireless/ath/ath11k/mhi.c+5−1

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

drivers/net/wireless/intel/iwlwifi/fw/uefi.c+6−0

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

drivers/net/wireless/intel/iwlwifi/iwl-drv.c+15−7

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

drivers/net/wireless/intel/iwlwifi/iwl-drv.h+3−0

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

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

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

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

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

drivers/net/wireless/intel/iwlwifi/mvm/ops.c+5−0

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

drivers/net/wireless/intel/iwlwifi/pcie/drv.c+8−2

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

drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c+1−2

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

drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c+15−13

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

drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c+7−1

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

drivers/net/wireless/mediatek/mt76/mt7915/mac.c+7−8

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

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c+2−2

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

drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c+12−9

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

drivers/net/wireless/mediatek/mt76/tx.c+1−1

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

drivers/net/wireless/ralink/rt2x00/rt2x00usb.c+3−0

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

drivers/net/wireless/realtek/rtw89/fw.c+1−1

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

drivers/net/wireless/realtek/rtw89/fw.h+4−2

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

drivers/net/wwan/iosm/iosm_ipc_imem.c+17−9

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

drivers/net/wwan/iosm/iosm_ipc_imem.h+1−3

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

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c+1−6

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

drivers/nfc/virtual_ncidev.c+1−1

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

drivers/nvme/host/core.c+44−8

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

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

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

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

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

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

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

drivers/nvme/host/tcp.c+30−31

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

drivers/nvme/host/zns.c+4−1

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

drivers/nvme/target/io-cmd-file.c+3−1

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

drivers/nvme/target/tcp.c+40−13

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

drivers/of/irq.c+25−2

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

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

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

drivers/pci/controller/dwc/pcie-qcom-ep.c+1−0

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

drivers/pci/controller/pci-aardvark.c+0−9

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

drivers/pci/controller/pcie-apple.c+12−2

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

drivers/phy/hisilicon/phy-hi3670-pcie.c+2−2

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

drivers/phy/marvell/phy-mvebu-cp110-utmi.c+2−2

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

drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c+14−12

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

drivers/phy/qualcomm/phy-qcom-qmp.c+3−0

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

drivers/phy/qualcomm/phy-qcom-usb-hsic.c+1−1

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

drivers/phy/st/phy-stm32-usbphyc.c+1−1

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

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

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

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

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

drivers/phy/ti/phy-omap-usb2.c+3−3

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

drivers/phy/ti/phy-tusb1210.c+1−1

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

drivers/pinctrl/pinctrl-amd.c+26−3

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

drivers/pinctrl/pinctrl-apple-gpio.c+6−6

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

drivers/pinctrl/qcom/Kconfig+2−0

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

drivers/pinctrl/qcom/pinctrl-sdm845.c+1−0

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

drivers/pinctrl/qcom/pinctrl-sm8350.c+4−4

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

drivers/pinctrl/ralink/pinctrl-mt7620.c+1−0

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

drivers/pinctrl/tegra/pinctrl-tegra.c+2−2

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

drivers/pinctrl/tegra/pinctrl-tegra194.c+0−1

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

drivers/platform/chrome/cros_ec_ishtp.c+8−6

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

drivers/platform/mellanox/mlxreg-lc.c+3−2

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

drivers/platform/x86/Kconfig+1−1

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

drivers/platform/x86/amd-pmc.c+1−1

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

drivers/platform/x86/dell/Kconfig+1−1

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

drivers/platform/x86/hp_accel.c+2−0

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

drivers/platform/x86/intel/hid.c+7−0

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

drivers/platform/x86/intel/ishtp_eclite.c+8−6

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

drivers/platform/x86/lg-laptop.c+12−0

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

drivers/platform/x86/samsung-laptop.c+1−1

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

drivers/platform/x86/think-lmi.c+10−3

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

drivers/platform/x86/think-lmi.h+0−1

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

drivers/platform/x86/thinkpad_acpi.c+5−14

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

drivers/platform/x86/touchscreen_dmi.c+18−0

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

drivers/powercap/dtpm.c+0−5

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

drivers/powercap/dtpm_cpu.c+3−6

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

drivers/ptp/ptp_clockmatrix.c+1−4

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

drivers/ptp/ptp_ocp.c+5−4

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

drivers/s390/block/dasd_devmap.c+38−38

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

drivers/s390/char/raw3270.c+6−6

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

drivers/s390/cio/chp.c+1−1

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

drivers/scsi/lpfc/lpfc_els.c+2−7

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

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

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

drivers/scsi/mpt3sas/mpt3sas_base.h+4−0

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

drivers/scsi/mpt3sas/mpt3sas_scsih.c+57−2

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

drivers/scsi/pm8001/pm8001_init.c+2−4

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

drivers/scsi/qedi/qedi_fw.c+15−22

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

drivers/scsi/qedi/qedi_iscsi.c+1−1

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

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

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

drivers/scsi/qla2xxx/qla_dbg.c+3−0

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

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

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

drivers/scsi/qla2xxx/qla_mbx.c+2−4

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

drivers/scsi/scsi_debug.c+27−18

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

drivers/scsi/scsi_sysfs.c+19−11

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

drivers/scsi/scsi_transport_iscsi.c+3−3

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

drivers/scsi/ufs/ufs-mediatek.c+1−0

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

drivers/scsi/ufs/ufshcd-pci.c+18−0

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

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

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

drivers/scsi/ufs/ufshpb.c+1−1

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

drivers/scsi/virtio_scsi.c+0−1

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

drivers/spi/spi-cadence-quadspi.c+21−3

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

drivers/spi/spi-fsl-lpspi.c+1−1

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

drivers/spi/spi-geni-qcom.c+10−6

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

drivers/spi/spi.c+6−6

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

drivers/staging/Kconfig+0−2

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

drivers/staging/Makefile+0−1

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

drivers/staging/fbtft/fb_ssd1351.c+0−4

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

drivers/staging/fbtft/fbtft-core.c+1−8

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

drivers/staging/greybus/audio_helper.c+6−2

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

drivers/staging/netlogic/Kconfig+0−9

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

drivers/staging/netlogic/Makefile+0−2

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

drivers/staging/netlogic/TODO+0−11

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

drivers/staging/netlogic/platform_net.c+0−219

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

drivers/staging/netlogic/platform_net.h+0−21

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

drivers/staging/netlogic/xlr_net.c+0−1080

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

drivers/staging/netlogic/xlr_net.h+0−1079

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

drivers/staging/r8188eu/core/rtw_mlme_ext.c+4−2

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

drivers/staging/r8188eu/os_dep/ioctl_linux.c+7−1

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

drivers/staging/r8188eu/os_dep/mlme_linux.c+1−1

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

drivers/staging/rtl8192e/rtl8192e/rtl_core.c+2−1

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

drivers/target/target_core_fabric_configfs.c+8−8

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

drivers/target/target_core_spc.c+7−7

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

drivers/tee/optee/ffa_abi.c+3−4

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

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

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

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

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

drivers/thermal/thermal_core.c+2−0

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

drivers/tty/hvc/hvc_xen.c+1−0

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

drivers/tty/serial/8250/8250_bcm7271.c+13−0

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

drivers/tty/serial/8250/8250_pci.c+25−14

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

drivers/tty/serial/8250/8250_port.c+0−7

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

drivers/tty/serial/Kconfig+1−1

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

drivers/tty/serial/amba-pl011.c+1−0

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

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

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

drivers/tty/serial/liteuart.c+17−3

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

drivers/tty/serial/msm_serial.c+3−0

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

drivers/tty/serial/serial-tegra.c+2−2

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

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

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

drivers/usb/cdns3/cdns3-gadget.c+4−16

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

drivers/usb/cdns3/cdnsp-mem.c+3−0

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

drivers/usb/cdns3/host.c+1−0

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

drivers/usb/chipidea/ci_hdrc_imx.c+9−9

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

drivers/usb/core/config.c+3−3

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

drivers/usb/core/hub.c+18−6

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

drivers/usb/core/quirks.c+3−0

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

drivers/usb/dwc2/gadget.c+14−3

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

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

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

drivers/usb/dwc3/core.c+5−3

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

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

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

drivers/usb/dwc3/dwc3-qcom.c+0−15

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

drivers/usb/dwc3/gadget.c+28−11

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

drivers/usb/gadget/composite.c+13−1

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

drivers/usb/gadget/legacy/dbgp.c+14−1

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

drivers/usb/gadget/legacy/inode.c+15−1

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

drivers/usb/gadget/udc/udc-xilinx.c+4−1

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

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

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

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

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

drivers/usb/host/xhci-tegra.c+29−12

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

drivers/usb/host/xhci.c+15−11

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

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

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

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

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

drivers/usb/typec/tcpm/fusb302.c+4−2

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

drivers/usb/typec/tcpm/tcpm.c+0−4

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

drivers/usb/typec/tipd/core.c+17−18

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

drivers/vdpa/vdpa_sim/vdpa_sim.c+5−2

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

drivers/vfio/pci/vfio_pci_igd.c+3−2

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

drivers/vfio/vfio.c+14−14

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

drivers/vhost/vdpa.c+1−1

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

drivers/vhost/vsock.c+2−6

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

drivers/video/console/sticon.c+6−6

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

drivers/video/console/vgacon.c+9−5

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

drivers/video/fbdev/efifb.c+11−0

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

drivers/video/fbdev/simplefb.c+11−0

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

drivers/video/fbdev/xen-fbfront.c+1−0

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

drivers/virtio/virtio_ring.c+0−60

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

drivers/xen/Kconfig+7−1

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

drivers/xen/pvcalls-front.c+1−0

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

drivers/xen/xenbus/xenbus_probe.c+26−1

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

drivers/xen/xenbus/xenbus_probe_frontend.c+3−11

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

fs/aio.c+152−34

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

fs/attr.c+2−2

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

fs/btrfs/async-thread.c+14−0

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

fs/btrfs/delalloc-space.c+9−3

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

fs/btrfs/disk-io.c+13−1

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

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

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

fs/btrfs/extent_io.c+14−0

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

fs/btrfs/ioctl.c+6−4

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

fs/btrfs/lzo.c+14−1

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

fs/btrfs/root-tree.c+2−1

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

fs/btrfs/scrub.c+2−2

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

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

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

fs/btrfs/volumes.c+13−5

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

fs/btrfs/zoned.c+2−0

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

fs/cifs/cifs_swn.c+2−14

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

fs/cifs/cifsfs.h+1−1

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

fs/cifs/cifsproto.h+1−0

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

fs/cifs/connect.c+12−22

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

fs/cifs/dfs_cache.c+1−6

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

fs/cifs/fscache.c+10−36

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

fs/cifs/inode.c+7−0

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

fs/cifs/sess.c+51−19

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

fs/cifs/smb2pdu.c+1−1

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

fs/erofs/utils.c+6−2

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

fs/file.c+4−0

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

fs/fuse/dev.c+5−5

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

fs/gfs2/bmap.c+1−1

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

fs/gfs2/file.c+6−3

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

fs/gfs2/glock.c+11−11

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

fs/gfs2/inode.c+45−64

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

fs/gfs2/super.c+7−7

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

fs/inode.c+0−2

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

fs/io-wq.c+30−6

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

fs/io_uring.c+57−24

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

fs/iomap/buffered-io.c+16−10

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

fs/ksmbd/smb2pdu.c+17−13

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

fs/netfs/read_helper.c+10−15

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

fs/nfs/inode.c+1−0

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

fs/nfs/nfs42proc.c+3−1

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

fs/nfs/nfs42xdr.c+1−2

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

fs/nfs/nfs4state.c+4−0

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

fs/nfs/nfstrace.h+1−0

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

fs/nfsd/nfs4recover.c+1−0

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

fs/nfsd/nfs4state.c+7−2

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

fs/nfsd/nfs4xdr.c+2−5

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

fs/nfsd/nfsctl.c+7−7

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

fs/ntfs/Kconfig+1−0

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

fs/proc/vmcore.c+12−8

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

fs/pstore/Kconfig+0−1

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

fs/pstore/blk.c+1−1

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

fs/signalfd.c+1−11

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

fs/smbfs_common/cifs_arc4.c+0−13

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

fs/tracefs/inode.c+76−0

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

fs/udf/dir.c+30−2

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

fs/udf/namei.c+3−0

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

fs/udf/super.c+2−0

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

fs/xfs/libxfs/xfs_attr.c+7−10

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

fs/xfs/xfs_icache.c+0−21

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

fs/xfs/xfs_inode.c+0−1

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

fs/xfs/xfs_inode.h+1−3

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

fs/xfs/xfs_super.c+11−3

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

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

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

include/linux/acpi.h+9−7

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

include/linux/bpf.h+5−15

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

include/linux/btf.h+10−4

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

include/linux/cacheflush.h+18−0

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

include/linux/cacheinfo.h+0−1

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

include/linux/delay.h+13−1

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

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

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

include/linux/filter.h+1−4

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

include/linux/fs.h+0−1

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

include/linux/hid.h+5−0

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

include/linux/highmem.h+42−5

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

include/linux/hugetlb_cgroup.h+12−0

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

include/linux/intel-ish-client-if.h+2−2

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

include/linux/ipc_namespace.h+15−0

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

include/linux/kprobes.h+2−0

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

include/linux/kvm_host.h+1−5

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

include/linux/kvm_types.h+0−7

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

include/linux/mhi.h+13−0

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

include/linux/mlx5/eswitch.h+2−2

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

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

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

include/linux/mm_types.h+12−1

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

include/linux/mod_devicetable.h+14−0

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

include/linux/netdevice.h+13−6

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

include/linux/page-flags.h+7−7

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

include/linux/pagemap.h+21−5

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

include/linux/percpu-refcount.h+1−1

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

include/linux/percpu.h+0−1

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

include/linux/phy.h+6−5

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

include/linux/pm_runtime.h+1−1

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

include/linux/printk.h+4−0

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

include/linux/ptp_classify.h+1−0

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

include/linux/regulator/driver.h+8−6

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

include/linux/sched/cputime.h+3−2

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

include/linux/sched/signal.h+1−0

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

include/linux/sched/task.h+1−1

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

include/linux/sdb.h+0−160

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

include/linux/siphash.h+4−10

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

include/linux/skbuff.h+1−1

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

include/linux/trace_events.h+1−1

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

include/linux/virtio.h+0−2

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

include/linux/virtio_net.h+6−1

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

include/linux/wait.h+26−0

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

include/net/bond_alb.h+1−1

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

include/net/busy_poll.h+13−0

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

include/net/dst_cache.h+11−0

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

include/net/fib_rules.h+3−1

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

include/net/ip6_fib.h+1−0

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

include/net/ip_fib.h+1−1

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

include/net/ipv6_stubs.h+1−0

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

include/net/netfilter/nf_conntrack.h+3−3

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

include/net/netns/ipv4.h+1−1

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

include/net/nfc/nci_core.h+1−0

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

include/net/nl802154.h+4−3

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

include/net/page_pool.h+11−1

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

include/net/sock.h+23−7

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

include/rdma/rdma_netlink.h+1−1

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

include/soc/mscc/ocelot_vcap.h+2−0

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

include/sound/soc-acpi.h+1−1

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

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

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

include/uapi/asm-generic/poll.h+1−1

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

include/uapi/drm/virtgpu_drm.h+7−0

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

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

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

include/uapi/linux/resource.h+10−3

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

include/xen/xenbus.h+1−0

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

init/Kconfig+1−1

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

ipc/shm.c+143−46

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

ipc/util.c+3−3

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

kernel/bpf/btf.c+2−9

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

kernel/bpf/cgroup.c+2−0

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

kernel/bpf/helpers.c+0−2

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

kernel/bpf/syscall.c+36−21

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

kernel/bpf/verifier.c+26−3

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

kernel/cpu.c+7−0

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

kernel/entry/syscall_user_dispatch.c+2−2

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

kernel/events/core.c+3−0

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

kernel/kprobes.c+3−0

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

kernel/locking/rwsem.c+89−93

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

kernel/power/hibernate.c+3−3

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

kernel/power/user.c+1−1

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

kernel/printk/printk.c+5−0

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

kernel/sched/core.c+3−7

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

kernel/sched/cputime.c+9−3

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

kernel/sched/wait.c+7−0

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

kernel/signal.c+29−7

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

kernel/softirq.c+2−1

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

kernel/time/tick-sched.c+7−0

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

kernel/time/timer.c+9−7

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

kernel/trace/bpf_trace.c+0−2

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

kernel/trace/ftrace.c+7−1

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

kernel/trace/trace.c+13−3

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

kernel/trace/trace.h+18−6

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

kernel/trace/trace_events.c+12−0

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

kernel/trace/trace_events_hist.c+30−22

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

kernel/trace/trace_events_synth.c+6−5

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

kernel/trace/trace_uprobe.c+1−0

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

kernel/trace/tracing_map.c+3−0

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

lib/Kconfig.debug+4−2

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

lib/nmi_backtrace.c+6−0

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

lib/siphash.c+6−6

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

lib/test_kasan.c+2−0

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

lib/zstd/Makefile+0−2

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

lib/zstd/common/compiler.h+7−0

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

lib/zstd/compress/zstd_compress_superblock.c+2−0

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

lib/zstd/compress/zstd_opt.c+12−0

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

mm/Kconfig+4−1

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

mm/backing-dev.c+7−0

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

mm/damon/core.c+7−13

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

mm/damon/dbgfs.c+14−10

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

mm/damon/vaddr-test.h+37−42

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

mm/damon/vaddr.c+1−1

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

mm/filemap.c+0−2

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

mm/highmem.c+21−13

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

mm/hugetlb.c+28−10

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

mm/memcontrol.c+54−54

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

mm/memory_hotplug.c+1−0

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

mm/shmem.c+2−1

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

mm/slab.c+1−2

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

mm/slab.h+1−1

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

mm/slob.c+1−2

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

mm/slub.c+10−7

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

mm/swap.c+1−0

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

mm/swap_slots.c+1−0

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

mm/util.c+1−1

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

net/8021q/vlan.c+0−3

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

net/8021q/vlan_dev.c+3−0

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

net/core/dev.c+4−1

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

net/core/devlink.c+11−9

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

net/core/dst_cache.c+19−0

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

net/core/fib_rules.c+1−1

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

net/core/filter.c+6−0

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

net/core/neighbour.c+2−2

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

net/core/page_pool.c+4−6

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

net/core/skmsg.c+5−0

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

net/core/sock.c+3−3

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

net/core/sock_map.c+10−5

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

net/ethtool/ioctl.c+1−1

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

net/ethtool/netlink.c+2−1

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

net/ipv4/bpf_tcp_ca.c+2−0

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

net/ipv4/devinet.c+1−1

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

net/ipv4/fib_frontend.c+1−1

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

net/ipv4/fib_rules.c+3−2

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

net/ipv4/fib_semantics.c+2−2

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

net/ipv4/inet_connection_sock.c+1−1

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

net/ipv4/nexthop.c+30−5

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

net/ipv4/tcp.c+3−0

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

net/ipv4/tcp_cubic.c+3−2

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

net/ipv4/tcp_minisocks.c+2−2

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

net/ipv4/udp.c+12−1

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

net/ipv6/af_inet6.c+1−0

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

net/ipv6/esp6.c+6−0

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

net/ipv6/fib6_rules.c+2−2

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

net/ipv6/ip6_offload.c+3−3

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

net/ipv6/ip6_output.c+1−1

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

net/ipv6/route.c+19−0

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

net/ipv6/seg6_iptunnel.c+8−0

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

net/mac80211/cfg.c+8−4

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

net/mac80211/iface.c+3−1

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

net/mac80211/led.h+4−4

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

net/mac80211/rx.c+7−5

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

net/mac80211/tx.c+15−19

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

net/mac80211/util.c+4−3

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

net/mac80211/wme.c+1−2

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

net/mctp/route.c+5−4

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

net/mctp/test/utils.c+1−1

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

net/mpls/af_mpls.c+62−35

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

net/mpls/internal.h+1−1

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

net/mptcp/options.c+9−23

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

net/mptcp/protocol.c+42−9

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

net/mptcp/protocol.h+9−8

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

net/ncsi/ncsi-cmd.c+16−8

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

net/netfilter/ipvs/ip_vs_core.c+4−4

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

net/netfilter/nf_conntrack_core.c+3−3

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

net/netfilter/nf_conntrack_netlink.c+3−5

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

net/netfilter/nf_flow_table_core.c+2−2

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

net/netfilter/nf_flow_table_offload.c+2−2

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

net/netfilter/nfnetlink_queue.c+1−1

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

net/netfilter/nft_exthdr.c+7−4

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

net/netfilter/nft_payload.c+0−1

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

net/netfilter/nft_set_pipapo_avx2.c+1−1

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

net/netfilter/xt_IDLETIMER.c+2−2

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

net/netlink/af_netlink.c+5−0

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

net/nfc/core.c+18−14

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

net/nfc/nci/core.c+24−6

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

net/nfc/netlink.c+8−4

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

net/rds/tcp.c+1−1

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

net/rxrpc/conn_client.c+9−5

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

net/rxrpc/peer_object.c+9−5

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

net/sched/act_mirred.c+8−3

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

net/sched/sch_ets.c+5−3

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

net/sched/sch_fq_pie.c+1−0

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

net/smc/af_smc.c+24−2

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

net/smc/smc_close.c+12−2

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

net/smc/smc_core.c+23−22

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

net/sunrpc/xprtsock.c+5−5

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

net/tipc/crypto.c+8−4

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

net/tipc/link.c+5−2

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

net/tls/tls_main.c+40−7

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

net/tls/tls_sw.c+29−15

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

net/unix/af_unix.c+0−3

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

net/wireless/nl80211.c+19−15

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

net/wireless/nl80211.h+1−5

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

net/wireless/util.c+1−0

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

net/xdp/xsk_buff_pool.c+5−2

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

samples/Kconfig+10−1

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

samples/Makefile+1−1

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

samples/bpf/hbm_kern.h+0−2

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

samples/bpf/xdp_redirect_cpu_user.c+2−3

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

samples/bpf/xdp_sample_user.c+15−13

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

samples/ftrace/Makefile+2−1

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

samples/ftrace/ftrace-direct-multi-modify.c+152−0

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

samples/ftrace/ftrace-direct-multi.c+30−0

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

scripts/mod/devicetable-offsets.c+3−0

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

scripts/mod/file2alias.c+24−0

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

security/selinux/ss/hashtab.c+12−5

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

sound/core/control_compat.c+3−0

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

sound/core/oss/pcm_oss.c+25−12

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

sound/hda/intel-dsp-config.c+19−0

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

sound/pci/cmipci.c+1−3

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

sound/pci/ctxfi/ctamixer.c+6−8

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

sound/pci/ctxfi/ctdaio.c+8−8

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

sound/pci/ctxfi/ctresource.c+3−4

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

sound/pci/ctxfi/ctresource.h+2−2

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

sound/pci/ctxfi/ctsrc.c+3−4

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

sound/pci/hda/hda_intel.c+11−1

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

sound/pci/hda/hda_local.h+9−0

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

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

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

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

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

sound/pci/hda/patch_realtek.c+90−18

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

sound/soc/amd/yc/pci-acp6x.c+2−1

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

sound/soc/codecs/cs35l41-spi.c+3−29

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

sound/soc/codecs/cs35l41.c+7−14

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

sound/soc/codecs/cs35l41.h+1−3

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

sound/soc/codecs/lpass-rx-macro.c+1−1

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

sound/soc/codecs/rk817_codec.c+1−0

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

sound/soc/codecs/rt1011.c+49−6

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

sound/soc/codecs/rt1011.h+7−0

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

sound/soc/codecs/rt5682-i2c.c+1−0

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

sound/soc/codecs/rt5682.c+35−13

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

sound/soc/codecs/rt5682.h+1−0

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

sound/soc/codecs/rt5682s.c+6−4

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

sound/soc/codecs/rt9120.c+48−10

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

sound/soc/codecs/wcd934x.c+94−35

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

sound/soc/codecs/wcd938x.c+3−0

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

sound/soc/codecs/wm_adsp.c+3−2

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

sound/soc/codecs/wsa881x.c+12−4

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

sound/soc/intel/boards/sof_sdw.c+69−0

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

sound/soc/intel/common/soc-acpi-intel-adl-match.c+105−0

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

sound/soc/intel/common/soc-acpi-intel-cml-match.c+6−0

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

sound/soc/mediatek/mt8173/mt8173-afe-pcm.c+43−8

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

sound/soc/mediatek/mt8173/mt8173-rt5650.c+4−4

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

sound/soc/qcom/qdsp6/audioreach.h+4−0

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

sound/soc/qcom/qdsp6/q6adm.c+2−2

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

sound/soc/qcom/qdsp6/q6asm-dai.c+13−6

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

sound/soc/qcom/qdsp6/q6prm.c+51−2

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

sound/soc/qcom/qdsp6/q6routing.c+12−0

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

sound/soc/rockchip/rockchip_i2s_tdm.c+31−21

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

sound/soc/sh/rcar/dma.c+1−1

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

sound/soc/soc-acpi.c+3−1

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

sound/soc/soc-dapm.c+23−6

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

sound/soc/soc-topology.c+3−0

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

sound/soc/sof/Kconfig+1−1

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

sound/soc/sof/control.c+4−4

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

sound/soc/sof/intel/hda-bus.c+17−0

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

sound/soc/sof/intel/hda-codec.c+9−5

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

sound/soc/sof/intel/hda-dsp.c+1−2

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

sound/soc/sof/intel/hda.c+23−0

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

sound/soc/stm/stm32_i2s.c+1−1

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

sound/soc/tegra/tegra186_dspk.c+147−34

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

sound/soc/tegra/tegra210_admaif.c+110−30

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

sound/soc/tegra/tegra210_adx.c+5−2

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

sound/soc/tegra/tegra210_ahub.c+7−4

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

sound/soc/tegra/tegra210_amx.c+5−2

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

sound/soc/tegra/tegra210_dmic.c+149−35

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

sound/soc/tegra/tegra210_i2s.c+226−70

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

sound/soc/tegra/tegra210_mixer.c+21−9

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

sound/soc/tegra/tegra210_mvc.c+26−12

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

sound/soc/tegra/tegra210_sfc.c+96−31

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

sound/usb/mixer_quirks.c+5−5

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

sound/usb/pcm.c+11−3

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

sound/xen/xen_snd_front.c+1−0

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

tools/arch/x86/include/asm/cpufeatures.h+2−0

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

tools/arch/x86/include/uapi/asm/kvm.h+4−0

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

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

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

tools/bpf/runqslower/Makefile+1−2

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

tools/build/Makefile.feature+0−1

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

tools/build/feature/Makefile+0−4

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

tools/build/feature/test-all.c+0−6

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

tools/build/feature/test-libpython-version.c+0−11

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

tools/include/linux/debug_locks.h+0−14

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

tools/include/linux/hardirq.h+0−12

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

tools/include/linux/irqflags.h+0−39

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

tools/include/linux/kernel.h+1−21

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

tools/include/linux/lockdep.h+0−72

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

tools/include/linux/math.h+25−0

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

tools/include/linux/proc_fs.h+0−4

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

tools/include/linux/spinlock.h+0−2

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

tools/include/linux/stacktrace.h+0−33

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

tools/include/uapi/linux/if_link.h+259−34

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

tools/include/uapi/linux/kvm.h+27−3

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

tools/lib/bpf/bpf_gen_internal.h+2−2

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

tools/lib/bpf/gen_loader.c+30−17

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

tools/lib/bpf/libbpf.c+2−2

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

tools/objtool/elf.c+1−0

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

tools/objtool/objtool.c+4−0

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

tools/perf/Makefile.config+3−2

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

tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl+1−0

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

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl+1−0

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

tools/perf/arch/s390/entry/syscalls/syscall.tbl+1−0

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

tools/perf/builtin-inject.c+1−1

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

tools/perf/builtin-report.c+9−6

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

tools/perf/tests/event_update.c+2−3

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

tools/perf/tests/expr.c+3−1

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

tools/perf/tests/parse-metric.c+1−0

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

tools/perf/tests/sample-parsing.c+1−1

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

tools/perf/tests/wp.c+1−1

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

tools/perf/ui/hist.c+14−14

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

tools/perf/util/arm-spe.c+15−0

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

tools/perf/util/bpf_skel/bperf.h+0−14

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

tools/perf/util/bpf_skel/bperf_follower.bpf.c+14−5

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

tools/perf/util/bpf_skel/bperf_leader.bpf.c+14−5

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

tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c+1−1

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

tools/perf/util/event.h+4−1

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

tools/perf/util/evsel.c+9−9

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

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

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

tools/perf/util/hist.c+6−17

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

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

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

tools/perf/util/intel-pt-decoder/intel-pt-decoder.c+55−30

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

tools/perf/util/intel-pt.c+1−0

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

tools/perf/util/parse-events.c+6−3

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

tools/perf/util/perf_regs.c+3−0

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

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

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

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

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

tools/perf/util/sort.c+16−36

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

tools/perf/util/sort.h+3−3

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

tools/perf/util/util.c+7−7

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

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

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

tools/power/acpi/Makefile.config+1−0

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

tools/power/acpi/Makefile.rules+1−0

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

tools/testing/radix-tree/linux/lockdep.h+3−0

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

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

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

tools/testing/selftests/bpf/prog_tests/helper_restricted.c+33−0

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

tools/testing/selftests/bpf/progs/test_helper_restricted.c+123−0

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

tools/testing/selftests/bpf/test_verifier.c+45−1

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

tools/testing/selftests/bpf/verifier/helper_restricted.c+196−0

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

tools/testing/selftests/bpf/verifier/map_in_map.c+34−0

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

tools/testing/selftests/bpf/verifier/xdp_direct_packet_access.c+600−32

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

tools/testing/selftests/damon/.gitignore+2−0

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

tools/testing/selftests/damon/Makefile+5−2

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

tools/testing/selftests/damon/_debugfs_common.sh+52−0

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

tools/testing/selftests/damon/debugfs_attrs.sh+1−72

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

tools/testing/selftests/damon/debugfs_empty_targets.sh+13−0

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

tools/testing/selftests/damon/debugfs_huge_count_read_write.sh+22−0

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

tools/testing/selftests/damon/debugfs_schemes.sh+19−0

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

tools/testing/selftests/damon/debugfs_target_ids.sh+19−0

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

tools/testing/selftests/damon/huge_count_read_write.c+39−0

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

tools/testing/selftests/gpio/Makefile+1−0

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

tools/testing/selftests/gpio/gpio-mockup-cdev.c+1−1

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

tools/testing/selftests/kvm/.gitignore+2−0

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

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

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

tools/testing/selftests/kvm/access_tracking_perf_test.c+10−44

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

tools/testing/selftests/kvm/demand_paging_test.c+9−47

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

tools/testing/selftests/kvm/dirty_log_perf_test.c+7−22

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

tools/testing/selftests/kvm/dirty_log_test.c+3−3

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

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

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

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

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

tools/testing/selftests/kvm/include/test_util.h+26−0

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

tools/testing/selftests/kvm/kvm_create_max_vcpus.c+30−0

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

tools/testing/selftests/kvm/kvm_page_table_test.c+1−1

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

tools/testing/selftests/kvm/lib/elf.c+1−2

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

tools/testing/selftests/kvm/lib/kvm_util.c+25−21

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

tools/testing/selftests/kvm/lib/perf_test_util.c+138−46

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

tools/testing/selftests/kvm/lib/test_util.c+5−0

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

tools/testing/selftests/kvm/lib/x86_64/processor.c+68−0

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

tools/testing/selftests/kvm/memslot_modification_stress_test.c+7−31

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

tools/testing/selftests/kvm/x86_64/hyperv_features.c+71−69

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

tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c+155−10

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

tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c+1−1

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

tools/testing/selftests/kvm/x86_64/userspace_io_test.c+114−0

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

tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c+66−9

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

tools/testing/selftests/net/Makefile+1−0

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

tools/testing/selftests/net/fcnal-test.sh+10−2

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

tools/testing/selftests/net/fib_nexthops.sh+63−0

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

tools/testing/selftests/net/fib_tests.sh+49−10

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

tools/testing/selftests/net/forwarding/config+1−0

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

tools/testing/selftests/net/forwarding/tc_actions.sh+46−1

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

tools/testing/selftests/net/gre_gso.sh+9−7

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

tools/testing/selftests/net/tls.c+425−132

This diff is large: its 697 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/conntrack_vrf.sh+241−0

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

tools/testing/selftests/netfilter/nft_concat_range.sh+21−3

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

tools/testing/selftests/netfilter/nft_nat.sh+23−10

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

tools/testing/selftests/netfilter/nft_queue.sh+54−0

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

tools/testing/selftests/netfilter/nft_zones_many.sh+13−6

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

tools/testing/selftests/tc-testing/config+2−0

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

tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json+1−1

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

tools/testing/selftests/tc-testing/tc-tests/qdiscs/mq.json+6−6

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

tools/testing/selftests/tc-testing/tdc.py+5−3

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

tools/testing/selftests/tc-testing/tdc.sh+1−0

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

tools/testing/selftests/wireguard/netns.sh+28−2

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

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

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

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

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

virt/kvm/kvm_main.c+48−108

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