History

Merge tag 'v5.17-rc5' into sched/core, to resolve conflicts

New conflicts in sched/core due to the following upstream fixes: 44585f7bc0cb ("psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n") a06247c6804f ("psi: Fix uaf issue when psi trigger is destroyed while being polled") Conflicts: include/linux/psi_types.h kernel/sched/psi.c

Ingo Molnar committed 4 years ago

Commit 6255b482 parents 1b2d345 cfb92441212 files · +13287 −6877Browse files

Unified · Split

1212 files
  1. .mailmap +4 −0
  2. Documentation/ABI/testing/sysfs-class-power +1 −0
  3. Documentation/ABI/testing/sysfs-driver-aspeed-uart-routing +3 −3
  4. Documentation/accounting/psi.rst +2 −1
  5. Documentation/admin-guide/gpio/index.rst +1 −0
  6. Documentation/arm/marvell.rst +2 −0
  7. Documentation/arm64/silicon-errata.rst +14 −0
  8. Documentation/dev-tools/kselftest.rst +8 −0
  9. Documentation/dev-tools/kunit/usage.rst +1 −1
  10. Documentation/devicetree/bindings/arm/omap/omap.txt +3 −0
  11. Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml +1 −0
  12. Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml +21 −12
  13. Documentation/devicetree/bindings/net/can/tcan4x5x.txt +1 −1
  14. Documentation/devicetree/bindings/net/qcom,ipa.yaml +6 −0
  15. Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml +1 −0
  16. Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml +3 −2
  17. Documentation/filesystems/netfs_library.rst +16 −0
  18. Documentation/gpu/todo.rst +0 −24
  19. Documentation/index.rst +1 −0
  20. Documentation/kernel-hacking/locking.rst +1 −1
  21. Documentation/tools/index.rst +20 −0
  22. Documentation/tools/rtla/index.rst +26 −0
  23. Documentation/userspace-api/ioctl/ioctl-number.rst +3 −0
  24. Documentation/virt/kvm/api.rst +3 −1
  25. Documentation/vm/page_table_check.rst +1 −1
  26. MAINTAINERS +102 −42
  27. Makefile +2 −2
  28. arch/arm/Kconfig +1 −0
  29. arch/arm/boot/dts/Makefile +1 −0
  30. arch/arm/boot/dts/am335x-wega.dtsi +1 −1
  31. arch/arm/boot/dts/dra7.dtsi +10 −10
  32. arch/arm/boot/dts/imx23-evk.dts +0 −1
  33. arch/arm/boot/dts/imx6qdl-udoo.dtsi +4 −1
  34. arch/arm/boot/dts/imx7ulp.dtsi +1 −1
  35. arch/arm/boot/dts/meson.dtsi +4 −4
  36. arch/arm/boot/dts/meson8.dtsi +12 −12
  37. arch/arm/boot/dts/meson8b.dtsi +12 −12
  38. arch/arm/boot/dts/omap3-beagle-ab4.dts +47 −0
  39. arch/arm/boot/dts/omap3-beagle.dts +0 −33
  40. arch/arm/boot/dts/spear320-hmi.dts +0 −1
  41. arch/arm/boot/dts/ste-ux500-samsung-skomer.dts +0 −4
  42. arch/arm/crypto/blake2s-shash.c +2 −2
  43. arch/arm/include/asm/assembler.h +2 −0
  44. arch/arm/include/asm/processor.h +1 −0
  45. arch/arm/include/asm/uaccess.h +8 −2
  46. arch/arm/mach-omap2/display.c +1 −1
  47. arch/arm/mach-omap2/omap_hwmod.c +3 −1
  48. arch/arm/mach-socfpga/Kconfig +2 −0
  49. arch/arm/probes/kprobes/Makefile +3 −0
  50. arch/arm64/Kconfig +92 −6
  51. arch/arm64/Kconfig.platforms +0 −3
  52. arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 −0
  53. arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +0 −8
  54. arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +2 −2
  55. arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 −0
  56. arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts +1 −1
  57. arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +1 −1
  58. arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +0 −8
  59. arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts +4 −0
  60. arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +2 −2
  61. arch/arm64/boot/dts/freescale/imx8mq.dtsi +5 −5
  62. arch/arm64/boot/dts/freescale/mba8mx.dtsi +1 −1
  63. arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts +12 −2
  64. arch/arm64/boot/dts/ti/k3-j721s2.dtsi +0 −22
  65. arch/arm64/include/asm/cputype.h +4 −0
  66. arch/arm64/include/asm/el2_setup.h +1 −1
  67. arch/arm64/kernel/cpu_errata.c +37 −0
  68. arch/arm64/kernel/cpufeature.c +3 −0
  69. arch/arm64/kernel/stacktrace.c +3 −2
  70. arch/arm64/kernel/vdso/Makefile +4 −1
  71. arch/arm64/kvm/arm.c +33 −18
  72. arch/arm64/kvm/handle_exit.c +8 −0
  73. arch/arm64/kvm/hyp/exception.c +4 −1
  74. arch/arm64/kvm/hyp/include/hyp/switch.h +21 −2
  75. arch/arm64/kvm/hyp/pgtable.c +6 −12
  76. arch/arm64/kvm/hyp/vgic-v3-sr.c +3 −0
  77. arch/arm64/kvm/vgic/vgic-mmio.c +2 −0
  78. arch/arm64/kvm/vgic/vgic-v3.c +15 −2
  79. arch/arm64/mm/extable.c +2 −2
  80. arch/arm64/tools/cpucaps +4 −0
  81. arch/ia64/Kconfig +1 −1
  82. arch/ia64/pci/fixup.c +2 −2
  83. arch/mips/boot/dts/ingenic/ci20.dts +2 −13
  84. arch/mips/cavium-octeon/octeon-memcpy.S +1 −1
  85. arch/mips/include/asm/asm.h +2 −2
  86. arch/mips/include/asm/ftrace.h +2 −2
  87. arch/mips/include/asm/r4kcache.h +2 −2
  88. arch/mips/include/asm/unaligned-emul.h +88 −88
  89. arch/mips/kernel/mips-r2-to-r6-emul.c +52 −52
  90. arch/mips/kernel/r2300_fpu.S +3 −3
  91. arch/mips/kernel/r4k_fpu.S +1 −1
  92. arch/mips/kernel/relocate_kernel.S +11 −11
  93. arch/mips/kernel/scall32-o32.S +5 −5
  94. arch/mips/kernel/scall64-n32.S +1 −1
  95. arch/mips/kernel/scall64-n64.S +1 −1
  96. arch/mips/kernel/scall64-o32.S +5 −5
  97. arch/mips/kernel/syscall.c +4 −4
  98. arch/mips/kvm/mips.c +46 −4
  99. arch/mips/kvm/vz.c +9 −3
  100. arch/mips/lib/csum_partial.S +2 −2
  101. arch/mips/lib/memcpy.S +2 −2
  102. arch/mips/lib/memset.S +1 −1
  103. arch/mips/lib/strncpy_user.S +2 −2
  104. arch/mips/lib/strnlen_user.S +1 −1
  105. arch/mips/loongson64/vbios_quirk.c +4 −5
  106. arch/parisc/include/asm/bitops.h +8 −0
  107. arch/parisc/include/asm/uaccess.h +15 −14
  108. arch/parisc/lib/iomap.c +18 −0
  109. arch/parisc/mm/init.c +4 −5
  110. arch/powerpc/include/asm/book3s/32/mmu-hash.h +2 −0
  111. arch/powerpc/include/asm/book3s/32/pgtable.h +1 −0
  112. arch/powerpc/include/asm/book3s/64/pgtable.h +2 −0
  113. arch/powerpc/include/asm/fixmap.h +4 −2
  114. arch/powerpc/include/asm/hw_irq.h +1 −1
  115. arch/powerpc/include/asm/kvm_book3s_64.h +0 −1
  116. arch/powerpc/include/asm/kvm_host.h +1 −0
  117. arch/powerpc/include/asm/nohash/32/pgtable.h +1 −0
  118. arch/powerpc/include/asm/nohash/64/pgtable.h +1 −0
  119. arch/powerpc/include/asm/ppc-opcode.h +1 −0
  120. arch/powerpc/include/asm/syscall.h +2 −2
  121. arch/powerpc/include/asm/thread_info.h +2 −0
  122. arch/powerpc/kernel/head_book3s_32.S +2 −2
  123. arch/powerpc/kernel/interrupt_64.S +2 −0
  124. arch/powerpc/kernel/time.c +3 −2
  125. arch/powerpc/kvm/book3s_hv.c +1 −2
  126. arch/powerpc/kvm/book3s_hv_nested.c +1 −1
  127. arch/powerpc/lib/sstep.c +2 −0
  128. arch/powerpc/mm/book3s32/mmu.c +5 −5
  129. arch/powerpc/mm/kasan/book3s_32.c +31 −28
  130. arch/powerpc/mm/pgtable.c +9 −0
  131. arch/powerpc/net/bpf_jit_comp.c +23 −6
  132. arch/powerpc/net/bpf_jit_comp32.c +9 −0
  133. arch/powerpc/net/bpf_jit_comp64.c +19 −10
  134. arch/powerpc/perf/core-book3s.c +42 −33
  135. arch/riscv/Makefile +6 −0
  136. arch/riscv/kernel/cpu-hotplug.c +2 −0
  137. arch/riscv/kernel/head.S +5 −6
  138. arch/riscv/kernel/sbi.c +47 −25
  139. arch/riscv/kernel/stacktrace.c +5 −4
  140. arch/riscv/kvm/vcpu.c +31 −17
  141. arch/riscv/kvm/vcpu_sbi_base.c +2 −1
  142. arch/riscv/mm/extable.c +3 −3
  143. arch/riscv/mm/init.c +2 −0
  144. arch/s390/Kconfig +15 −0
  145. arch/s390/configs/debug_defconfig +10 −10
  146. arch/s390/configs/defconfig +9 −7
  147. arch/s390/configs/zfcpdump_defconfig +3 −0
  148. arch/s390/hypfs/hypfs_vm.c +4 −2
  149. arch/s390/include/asm/uaccess.h +2 −2
  150. arch/s390/kernel/module.c +18 −19
  151. arch/s390/kernel/nmi.c +22 −5
  152. arch/s390/kvm/kvm-s390.c +2 −0
  153. arch/s390/lib/Makefile +3 −0
  154. arch/s390/lib/test_modules.c +32 −0
  155. arch/s390/lib/test_modules.h +53 −0
  156. arch/s390/lib/test_modules_helpers.c +13 −0
  157. arch/x86/Kconfig +1 −0
  158. arch/x86/crypto/blake2s-shash.c +2 −2
  159. arch/x86/events/intel/core.c +28 −0
  160. arch/x86/events/intel/lbr.c +101 −67
  161. arch/x86/events/intel/pt.c +3 −2
  162. arch/x86/events/intel/uncore.c +1 −1
  163. arch/x86/events/intel/uncore.h +2 −1
  164. arch/x86/events/intel/uncore_discovery.c +2 −2
  165. arch/x86/events/intel/uncore_discovery.h +2 −0
  166. arch/x86/events/intel/uncore_snb.c +213 −1
  167. arch/x86/events/intel/uncore_snbep.c +1 −1
  168. arch/x86/events/perf_event.h +9 −1
  169. arch/x86/events/rapl.c +6 −3
  170. arch/x86/include/asm/bug.h +11 −9
  171. arch/x86/include/asm/kvm-x86-ops.h +1 −1
  172. arch/x86/include/asm/kvm_host.h +5 −3
  173. arch/x86/include/asm/msr-index.h +1 −0
  174. arch/x86/include/asm/svm.h +36 −0
  175. arch/x86/include/asm/xen/cpuid.h +7 −0
  176. arch/x86/include/asm/xen/hypervisor.h +0 −14
  177. arch/x86/include/uapi/asm/kvm.h +3 −0
  178. arch/x86/kernel/cpu/mce/amd.c +1 −1
  179. arch/x86/kernel/cpu/mce/intel.c +1 −0
  180. arch/x86/kernel/cpu/sgx/encl.c +2 −0
  181. arch/x86/kernel/cpu/sgx/main.c +1 −9
  182. arch/x86/kernel/fpu/regset.c +4 −5
  183. arch/x86/kernel/ptrace.c +2 −2
  184. arch/x86/kernel/resource.c +1 −22
  185. arch/x86/kvm/cpuid.c +62 −41
  186. arch/x86/kvm/lapic.c +9 −10
  187. arch/x86/kvm/pmu.c +4 −3
  188. arch/x86/kvm/svm/avic.c +23 −70
  189. arch/x86/kvm/svm/nested.c +19 −16
  190. arch/x86/kvm/svm/sev.c +7 −2
  191. arch/x86/kvm/svm/svm.c +205 −64
  192. arch/x86/kvm/svm/svm.h +4 −18
  193. arch/x86/kvm/svm/svm_onhyperv.h +4 −8
  194. arch/x86/kvm/vmx/capabilities.h +0 −1
  195. arch/x86/kvm/vmx/evmcs.c +2 −2
  196. arch/x86/kvm/vmx/evmcs.h +39 −9
  197. arch/x86/kvm/vmx/nested.c +54 −28
  198. arch/x86/kvm/vmx/vmcs12.c +2 −2
  199. arch/x86/kvm/vmx/vmcs12.h +3 −3
  200. arch/x86/kvm/vmx/vmx.c +57 −12
  201. arch/x86/kvm/x86.c +89 −17
  202. arch/x86/kvm/x86.h +0 −45
  203. arch/x86/kvm/xen.c +69 −38
  204. arch/x86/pci/fixup.c +2 −2
  205. arch/x86/xen/enlighten_hvm.c +11 −11
  206. arch/x86/xen/enlighten_pv.c +0 −4
  207. arch/x86/xen/smp_pv.c +6 −20
  208. arch/x86/xen/vga.c +8 −8
  209. block/bfq-iosched.c +2 −0
  210. block/bio-integrity.c +1 −1
  211. block/blk-core.c +21 −14
  212. block/blk-ia-ranges.c +1 −1
  213. block/blk-map.c +1 −1
  214. block/blk-mq.c +6 −0
  215. block/elevator.c +0 −2
  216. block/fops.c +19 −14
  217. block/genhd.c +14 −0
  218. crypto/af_alg.c +0 −3
  219. crypto/algapi.c +1 −0
  220. crypto/api.c +0 −1
  221. crypto/blake2s_generic.c +2 −2
  222. drivers/accessibility/speakup/speakup_dectlk.c +1 −0
  223. drivers/acpi/Kconfig +1 −0
  224. drivers/acpi/arm64/iort.c +11 −3
  225. drivers/acpi/ec.c +10 −0
  226. drivers/acpi/processor_idle.c +5 −0
  227. drivers/acpi/sleep.c +5 −10
  228. drivers/acpi/tables.c +1 −1
  229. drivers/acpi/x86/s2idle.c +4 −8
  230. drivers/ata/libata-core.c +17 −8
  231. drivers/ata/pata_platform.c +2 −0
  232. drivers/ata/sata_fsl.c +7 −9
  233. drivers/base/power/wakeup.c +34 −7
  234. drivers/block/loop.c +36 −37
  235. drivers/block/loop.h +0 −1
  236. drivers/block/mtip32xx/mtip32xx.c +1 −1
  237. drivers/block/rbd.c +1 −1
  238. drivers/block/xen-blkfront.c +1 −1
  239. drivers/bus/mhi/pci_generic.c +2 −0
  240. drivers/char/random.c +22 −17
  241. drivers/clocksource/timer-ti-dm-systimer.c +1 −1
  242. drivers/connector/cn_proc.c +1 −1
  243. drivers/counter/counter-core.c +6 −9
  244. drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c +2 −1
  245. drivers/dma-buf/dma-heap.c +2 −0
  246. drivers/dma/at_xdmac.c +3 −1
  247. drivers/dma/ptdma/ptdma-dev.c +9 −8
  248. drivers/dma/sh/rcar-dmac.c +7 −2
  249. drivers/dma/sh/shdma-base.c +3 −1
  250. drivers/dma/stm32-dmamux.c +3 −1
  251. drivers/edac/altera_edac.c +1 −1
  252. drivers/edac/edac_mc.c +1 −1
  253. drivers/edac/xgene_edac.c +1 −1
  254. drivers/firmware/efi/efi.c +7 −0
  255. drivers/firmware/efi/libstub/arm64-stub.c +3 −3
  256. drivers/gpio/gpio-aggregator.c +14 −4
  257. drivers/gpio/gpio-sifive.c +1 −1
  258. drivers/gpio/gpio-sim.c +15 −4
  259. drivers/gpio/gpiolib-cdev.c +3 −3
  260. drivers/gpio/gpiolib-sysfs.c +2 −5
  261. drivers/gpio/gpiolib.h +12 −0
  262. drivers/gpu/drm/amd/amdgpu/amdgpu.h +8 −2
  263. drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +32 −5
  264. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +90 −2
  265. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 −1
  266. drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +6 −1
  267. drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +3 −0
  268. drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +8 −0
  269. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 −1
  270. drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +2 −2
  271. drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +0 −1
  272. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c +8 −8
  273. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +10 −10
  274. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +5 −1
  275. drivers/gpu/drm/amd/display/dc/core/dc.c +29 −13
  276. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +23 −3
  277. drivers/gpu/drm/amd/display/dc/core/dc_resource.c +54 −0
  278. drivers/gpu/drm/amd/display/dc/dc.h +2 −0
  279. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +30 −7
  280. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +0 −15
  281. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h +0 −3
  282. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 −1
  283. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c +0 −2
  284. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c +0 −2
  285. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +2 −2
  286. drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +12 −1
  287. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c +32 −29
  288. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +3 −0
  289. drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c +0 −2
  290. drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c +0 −2
  291. drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c +0 −2
  292. drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c +0 −2
  293. drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c +1 −1
  294. drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h +1 −1
  295. drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +0 −1
  296. drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_helpers.c +0 −3
  297. drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +0 −4
  298. drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 −0
  299. drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +0 −4
  300. drivers/gpu/drm/amd/display/dc/inc/resource.h +11 −0
  301. drivers/gpu/drm/amd/pm/amdgpu_pm.c +1 −2
  302. drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +24 −8
  303. drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h +8 −0
  304. drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +2 −7
  305. drivers/gpu/drm/ast/ast_tables.h +0 −2
  306. drivers/gpu/drm/bridge/nwl-dsi.c +5 −7
  307. drivers/gpu/drm/drm_atomic.c +8 −4
  308. drivers/gpu/drm/drm_atomic_uapi.c +8 −6
  309. drivers/gpu/drm/drm_gem_cma_helper.c +1 −0
  310. drivers/gpu/drm/drm_panel_orientation_quirks.c +12 −0
  311. drivers/gpu/drm/drm_privacy_screen.c +1 −1
  312. drivers/gpu/drm/drm_privacy_screen_x86.c +3 −0
  313. drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +2 −2
  314. drivers/gpu/drm/i915/Kconfig +1 −0
  315. drivers/gpu/drm/i915/display/intel_display.c +1 −0
  316. drivers/gpu/drm/i915/display/intel_drrs.c +8 −0
  317. drivers/gpu/drm/i915/display/intel_fbc.c +2 −1
  318. drivers/gpu/drm/i915/display/intel_opregion.c +15 −0
  319. drivers/gpu/drm/i915/display/intel_overlay.c +3 −0
  320. drivers/gpu/drm/i915/display/intel_tc.c +2 −1
  321. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +7 −2
  322. drivers/gpu/drm/i915/gem/i915_gem_object_types.h +1 −0
  323. drivers/gpu/drm/i915/gem/i915_gem_pages.c +10 −0
  324. drivers/gpu/drm/i915/gem/i915_gem_ttm.c +2 −4
  325. drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +10 −4
  326. drivers/gpu/drm/i915/gt/intel_gt.c +108 −0
  327. drivers/gpu/drm/i915/gt/intel_gt.h +2 −0
  328. drivers/gpu/drm/i915/gt/intel_gt_types.h +2 −0
  329. drivers/gpu/drm/i915/gt/uc/intel_guc.h +5 −0
  330. drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +97 −17
  331. drivers/gpu/drm/i915/gvt/gtt.c +2 −2
  332. drivers/gpu/drm/i915/i915_gpu_error.c +1 −1
  333. drivers/gpu/drm/i915/i915_mm.h +1 −0
  334. drivers/gpu/drm/i915/i915_reg.h +13 −1
  335. drivers/gpu/drm/i915/i915_vma.c +3 −0
  336. drivers/gpu/drm/i915/intel_pm.c +122 −25
  337. drivers/gpu/drm/i915/intel_pm.h +1 −0
  338. drivers/gpu/drm/i915/intel_runtime_pm.c +1 −3
  339. drivers/gpu/drm/i915/intel_uncore.c +22 −4
  340. drivers/gpu/drm/i915/intel_uncore.h +2 −0
  341. drivers/gpu/drm/kmb/kmb_plane.c +0 −6
  342. drivers/gpu/drm/mediatek/mtk_dsi.c +84 −83
  343. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +2 −0
  344. drivers/gpu/drm/msm/adreno/adreno_device.c +18 −0
  345. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c +9 −2
  346. drivers/gpu/drm/msm/dsi/dsi.c +6 −1
  347. drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +3 −1
  348. drivers/gpu/drm/msm/hdmi/hdmi.c +6 −1
  349. drivers/gpu/drm/msm/msm_drv.c +1 −4
  350. drivers/gpu/drm/msm/msm_gpu.c +3 −0
  351. drivers/gpu/drm/msm/msm_gpu.h +3 −0
  352. drivers/gpu/drm/msm/msm_gpu_devfreq.c +19 −2
  353. drivers/gpu/drm/mxsfb/mxsfb_kms.c +5 −1
  354. drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +1 −1
  355. drivers/gpu/drm/panel/panel-simple.c +1 −0
  356. drivers/gpu/drm/radeon/atombios_encoders.c +2 −1
  357. drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +7 −7
  358. drivers/gpu/drm/rockchip/rockchip_vop_reg.c +5 −3
  359. drivers/gpu/drm/vc4/vc4_crtc.c +0 −1
  360. drivers/gpu/drm/vc4/vc4_dsi.c +4 −10
  361. drivers/gpu/drm/vc4/vc4_hdmi.c +20 −9
  362. drivers/gpu/drm/vc4/vc4_hdmi.h +3 −0
  363. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 −3
  364. drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +17 −16
  365. drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +1 −1
  366. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 −1
  367. drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +73 −3
  368. drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +3 −1
  369. drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c +3 −1
  370. drivers/hid/hid-apple.c +8 −8
  371. drivers/hid/hid-elo.c +1 −0
  372. drivers/hid/hid-ids.h +1 −0
  373. drivers/hid/hid-quirks.c +1 −0
  374. drivers/hid/i2c-hid/i2c-hid-of-goodix.c +12 −16
  375. drivers/hv/hv_balloon.c +7 −0
  376. drivers/hv/hv_utils_transport.c +1 −1
  377. drivers/hv/vmbus_drv.c +6 −3
  378. drivers/hwmon/adt7470.c +3 −0
  379. drivers/hwmon/lm90.c +11 −10
  380. drivers/hwmon/nct6775.c +3 −3
  381. drivers/hwmon/pmbus/ir38064.c +1 −1
  382. drivers/i2c/busses/Kconfig +3 −3
  383. drivers/i2c/busses/i2c-bcm2835.c +11 −0
  384. drivers/i2c/busses/i2c-brcmstb.c +1 −1
  385. drivers/i2c/busses/i2c-qcom-cci.c +11 −5
  386. drivers/iio/industrialio-buffer.c +11 −3
  387. drivers/infiniband/core/cm.c +1 −1
  388. drivers/infiniband/core/cma.c +12 −10
  389. drivers/infiniband/core/ucma.c +23 −11
  390. drivers/infiniband/hw/hfi1/ipoib.h +1 −1
  391. drivers/infiniband/hw/hfi1/ipoib_main.c +15 −12
  392. drivers/infiniband/hw/hfi1/ipoib_tx.c +26 −12
  393. drivers/infiniband/hw/mlx4/main.c +1 −1
  394. drivers/infiniband/sw/rdmavt/qp.c +2 −0
  395. drivers/infiniband/sw/siw/siw.h +1 −6
  396. drivers/infiniband/sw/siw/siw_qp_rx.c +11 −9
  397. drivers/infiniband/sw/siw/siw_verbs.c +2 −1
  398. drivers/input/input.c +6 −0
  399. drivers/input/mouse/psmouse-smbus.c +10 −0
  400. drivers/input/touchscreen/wm97xx-core.c +3 −9
  401. drivers/input/touchscreen/zinitix.c +12 −0
  402. drivers/iommu/amd/init.c +2 −0
  403. drivers/iommu/intel/irq_remapping.c +10 −3
  404. drivers/iommu/ioasid.c +1 −0
  405. drivers/iommu/iommu.c +19 −14
  406. drivers/iommu/omap-iommu.c +1 −1
  407. drivers/irqchip/irq-apple-aic.c +0 −1
  408. drivers/irqchip/irq-gic-v3-its.c +104 −22
  409. drivers/irqchip/irq-loongson-pch-msi.c +1 −1
  410. drivers/irqchip/irq-realtek-rtl.c +12 −6
  411. drivers/irqchip/irq-sifive-plic.c +1 −0
  412. drivers/md/dm.c +4 −18
  413. drivers/md/md.c +4 −4
  414. drivers/misc/eeprom/at25.c +4 −0
  415. drivers/misc/eeprom/ee1004.c +3 −0
  416. drivers/misc/fastrpc.c +8 −1
  417. drivers/mmc/core/block.c +14 −14
  418. drivers/mmc/core/sd.c +7 −1
  419. drivers/mmc/host/moxart-mmc.c +1 −1
  420. drivers/mmc/host/sdhci-of-esdhc.c +6 −2
  421. drivers/mmc/host/sh_mmcif.c +3 −0
  422. drivers/mtd/devices/phram.c +8 −4
  423. drivers/mtd/nand/raw/Kconfig +2 −1
  424. drivers/mtd/nand/raw/brcmnand/brcmnand.c +1 −1
  425. drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 −1
  426. drivers/mtd/nand/raw/ingenic/ingenic_ecc.c +6 −1
  427. drivers/mtd/nand/raw/qcom_nandc.c +6 −8
  428. drivers/mtd/parsers/qcomsmempart.c +23 −13
  429. drivers/net/bonding/bond_3ad.c +27 −6
  430. drivers/net/bonding/bond_main.c +2 −7
  431. drivers/net/can/flexcan/flexcan-core.c +1 −0
  432. drivers/net/can/flexcan/flexcan.h +1 −1
  433. drivers/net/can/m_can/m_can.c +6 −0
  434. drivers/net/can/m_can/tcan4x5x-regmap.c +1 −1
  435. drivers/net/dsa/Kconfig +2 −0
  436. drivers/net/dsa/bcm_sf2.c +5 −2
  437. drivers/net/dsa/lan9303-core.c +10 −3
  438. drivers/net/dsa/lantiq_gswip.c +11 −3
  439. drivers/net/dsa/mt7530.c +1 −1
  440. drivers/net/dsa/mv88e6xxx/chip.c +17 −5
  441. drivers/net/dsa/ocelot/felix_vsc9959.c +3 −1
  442. drivers/net/dsa/ocelot/seville_vsc9953.c +3 −2
  443. drivers/net/dsa/qca/ar9331.c +1 −2
  444. drivers/net/ethernet/3com/typhoon.c +4 −2
  445. drivers/net/ethernet/8390/etherh.c +4 −2
  446. drivers/net/ethernet/amd/declance.c +3 −1
  447. drivers/net/ethernet/amd/xgbe/xgbe-drv.c +13 −1
  448. drivers/net/ethernet/amd/xgbe/xgbe-pci.c +3 −0
  449. drivers/net/ethernet/aquantia/atlantic/aq_filters.c +2 −4
  450. drivers/net/ethernet/atheros/atl1c/atl1c_main.c +1 −1
  451. drivers/net/ethernet/broadcom/bgmac-platform.c +16 −7
  452. drivers/net/ethernet/broadcom/sb1250-mac.c +1 −3
  453. drivers/net/ethernet/cadence/macb_main.c +1 −1
  454. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +3 −3
  455. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c +3 −1
  456. drivers/net/ethernet/freescale/fec_mpc52xx.c +7 −5
  457. drivers/net/ethernet/google/gve/gve.h +1 −1
  458. drivers/net/ethernet/google/gve/gve_adminq.c +1 −1
  459. drivers/net/ethernet/google/gve/gve_main.c +3 −3
  460. drivers/net/ethernet/google/gve/gve_rx.c +3 −1
  461. drivers/net/ethernet/google/gve/gve_rx_dqo.c +1 −1
  462. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +1 −2
  463. drivers/net/ethernet/i825xx/ether1.c +3 −1
  464. drivers/net/ethernet/ibm/ibmvnic.c +109 −71
  465. drivers/net/ethernet/ibm/ibmvnic.h +0 −1
  466. drivers/net/ethernet/intel/e1000e/e1000.h +3 −1
  467. drivers/net/ethernet/intel/e1000e/ich8lan.c +20 −0
  468. drivers/net/ethernet/intel/e1000e/netdev.c +21 −18
  469. drivers/net/ethernet/intel/i40e/i40e.h +5 −5
  470. drivers/net/ethernet/intel/i40e/i40e_debugfs.c +1 −1
  471. drivers/net/ethernet/intel/i40e/i40e_main.c +50 −25
  472. drivers/net/ethernet/intel/i40e/i40e_register.h +3 −0
  473. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +101 −2
  474. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +1 −0
  475. drivers/net/ethernet/intel/ice/ice.h +2 −1
  476. drivers/net/ethernet/intel/ice/ice_common.c +2 −1
  477. drivers/net/ethernet/intel/ice/ice_lag.c +28 −6
  478. drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h +1 −0
  479. drivers/net/ethernet/intel/ice/ice_lib.c +6 −0
  480. drivers/net/ethernet/intel/ice/ice_main.c +20 −8
  481. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +7 −6
  482. drivers/net/ethernet/litex/Kconfig +1 −1
  483. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +2 −0
  484. drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h +3 −0
  485. drivers/net/ethernet/marvell/octeontx2/af/mbox.h +1 −0
  486. drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h +35 −35
  487. drivers/net/ethernet/marvell/octeontx2/af/rpm.c +51 −15
  488. drivers/net/ethernet/marvell/octeontx2/af/rpm.h +4 −0
  489. drivers/net/ethernet/marvell/octeontx2/af/rvu.c +5 −2
  490. drivers/net/ethernet/marvell/octeontx2/af/rvu.h +1 −0
  491. drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +12 −2
  492. drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +2 −0
  493. drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +10 −10
  494. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +19 −3
  495. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +12 −8
  496. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 −0
  497. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +6 −1
  498. drivers/net/ethernet/mellanox/mlx5/core/en.h +3 −3
  499. drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +2 −1
  500. drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c +14 −18
  501. drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +4 −2
  502. drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +5 −0
  503. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +3 −1
  504. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c +11 −2
  505. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h +6 −3
  506. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +19 −11
  507. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +14 −1
  508. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +1 −1
  509. drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +4 −0
  510. drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h +1 −1
  511. drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +1 −1
  512. drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c +5 −4
  513. drivers/net/ethernet/mellanox/mlx5/core/port.c +5 −4
  514. drivers/net/ethernet/microchip/lan966x/lan966x_mac.c +6 −5
  515. drivers/net/ethernet/microchip/lan966x/lan966x_main.c +3 −3
  516. drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c +1 −1
  517. drivers/net/ethernet/microchip/sparx5/sparx5_packet.c +1 −1
  518. drivers/net/ethernet/mscc/ocelot.c +20 −5
  519. drivers/net/ethernet/netronome/nfp/flower/cmsg.h +2 −0
  520. drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +8 −4
  521. drivers/net/ethernet/seeq/ether3.c +3 −1
  522. drivers/net/ethernet/smsc/smc911x.c +4 −4
  523. drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +1 −1
  524. drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c +33 −18
  525. drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +1 −0
  526. drivers/net/ethernet/stmicro/stmmac/stmmac.h +0 −2
  527. drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +17 −2
  528. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +12 −7
  529. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +23 −19
  530. drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +0 −3
  531. drivers/net/ethernet/ti/cpsw_priv.c +1 −1
  532. drivers/net/ethernet/tundra/tsi108_eth.c +18 −17
  533. drivers/net/hamradio/yam.c +1 −3
  534. drivers/net/ieee802154/at86rf230.c +11 −2
  535. drivers/net/ieee802154/ca8210.c +3 −2
  536. drivers/net/ieee802154/mac802154_hwsim.c +1 −0
  537. drivers/net/ieee802154/mcr20a.c +2 −2
  538. drivers/net/ipa/ipa_power.c +52 −0
  539. drivers/net/ipa/ipa_power.h +7 −0
  540. drivers/net/ipa/ipa_uc.c +5 −0
  541. drivers/net/macsec.c +21 −12
  542. drivers/net/mctp/mctp-serial.c +8 −1
  543. drivers/net/mdio/mdio-aspeed.c +1 −0
  544. drivers/net/netdevsim/fib.c +2 −2
  545. drivers/net/phy/at803x.c +13 −13
  546. drivers/net/phy/broadcom.c +1 −0
  547. drivers/net/phy/marvell.c +9 −8
  548. drivers/net/phy/mediatek-ge.c +0 −3
  549. drivers/net/phy/phy_device.c +3 −3
  550. drivers/net/phy/sfp-bus.c +5 −0
  551. drivers/net/usb/ax88179_178a.c +39 −29
  552. drivers/net/usb/cdc_ether.c +12 −0
  553. drivers/net/usb/cdc_mbim.c +5 −0
  554. drivers/net/usb/cdc_ncm.c +4 −4
  555. drivers/net/usb/ipheth.c +3 −3
  556. drivers/net/usb/qmi_wwan.c +2 −0
  557. drivers/net/usb/zaurus.c +12 −0
  558. drivers/net/veth.c +8 −5
  559. drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +4 −2
  560. drivers/net/wireless/intel/iwlwifi/Kconfig +0 −13
  561. drivers/net/wireless/intel/iwlwifi/fw/acpi.c +6 −5
  562. drivers/net/wireless/intel/iwlwifi/fw/api/commands.h +0 −5
  563. drivers/net/wireless/intel/iwlwifi/fw/api/filter.h +0 −88
  564. drivers/net/wireless/intel/iwlwifi/fw/api/rs.h +0 −1
  565. drivers/net/wireless/intel/iwlwifi/fw/file.h +0 −2
  566. drivers/net/wireless/intel/iwlwifi/fw/rs.c +18 −15
  567. drivers/net/wireless/intel/iwlwifi/iwl-csr.h +2 −1
  568. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +2 −0
  569. drivers/net/wireless/intel/iwlwifi/mei/main.c +34 −11
  570. drivers/net/wireless/intel/iwlwifi/mei/net.c +1 −2
  571. drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +0 −203
  572. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +1 −1
  573. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +0 −240
  574. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 −14
  575. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +0 −1
  576. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +1 −1
  577. drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +1 −2
  578. drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 −2
  579. drivers/net/wireless/mac80211_hwsim.c +13 −0
  580. drivers/nvme/host/core.c +10 −2
  581. drivers/nvme/host/fabrics.c +1 −2
  582. drivers/nvme/host/fabrics.h +1 −0
  583. drivers/nvme/host/multipath.c +1 −1
  584. drivers/nvme/host/pci.c +2 −1
  585. drivers/nvme/host/rdma.c +1 −0
  586. drivers/nvme/host/tcp.c +10 −1
  587. drivers/parisc/ccio-dma.c +2 −1
  588. drivers/parisc/sba_iommu.c +2 −1
  589. drivers/pci/controller/cadence/pci-j721e.c +42 −43
  590. drivers/pci/controller/dwc/pcie-kirin.c +18 −13
  591. drivers/pci/controller/pci-hyperv.c +11 −2
  592. drivers/pci/controller/pcie-mt7621.c +1 −10
  593. drivers/pci/msi/irqdomain.c +2 −2
  594. drivers/pci/msi/legacy.c +0 −1
  595. drivers/pci/msi/msi.c +2 −1
  596. drivers/pci/pcie/portdrv_core.c +17 −30
  597. drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c +2 −1
  598. drivers/phy/broadcom/Kconfig +1 −2
  599. drivers/phy/broadcom/phy-brcm-usb.c +38 −0
  600. drivers/phy/cadence/phy-cadence-sierra.c +21 −14
  601. drivers/phy/mediatek/phy-mtk-tphy.c +1 −1
  602. drivers/phy/phy-core-mipi-dphy.c +2 −2
  603. drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +2 −1
  604. drivers/phy/st/phy-stm32-usbphyc.c +1 −1
  605. drivers/phy/ti/phy-j721e-wiz.c +1 −0
  606. drivers/phy/xilinx/phy-zynqmp.c +6 −5
  607. drivers/pinctrl/Makefile +1 −1
  608. drivers/pinctrl/bcm/Kconfig +1 −0
  609. drivers/pinctrl/bcm/pinctrl-bcm2835.c +15 −8
  610. drivers/pinctrl/intel/pinctrl-cherryview.c +3 −2
  611. drivers/pinctrl/intel/pinctrl-intel.c +36 −28
  612. drivers/pinctrl/pinctrl-microchip-sgpio.c +2 −1
  613. drivers/pinctrl/pinctrl-thunderbay.c +35 −55
  614. drivers/pinctrl/pinctrl-zynqmp.c +4 −6
  615. drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c +4 −4
  616. drivers/platform/surface/Kconfig +1 −0
  617. drivers/platform/x86/amd-pmc.c +9 −6
  618. drivers/platform/x86/asus-tf103c-dock.c +2 −2
  619. drivers/platform/x86/intel/crystal_cove_charger.c +13 −13
  620. drivers/platform/x86/intel/speed_select_if/isst_if_common.c +63 −34
  621. drivers/platform/x86/thinkpad_acpi.c +22 −3
  622. drivers/platform/x86/touchscreen_dmi.c +24 −0
  623. drivers/platform/x86/x86-android-tablets.c +95 −10
  624. drivers/power/supply/bq256xx_charger.c +3 −0
  625. drivers/power/supply/cw2015_battery.c +1 −1
  626. drivers/regulator/core.c +3 −10
  627. drivers/regulator/max20086-regulator.c +2 −1
  628. drivers/remoteproc/Kconfig +4 −0
  629. drivers/remoteproc/qcom_q6v5.c +1 −0
  630. drivers/rpmsg/rpmsg_char.c +4 −18
  631. drivers/s390/cio/device.c +1 −1
  632. drivers/s390/scsi/zfcp_fc.c +12 −1
  633. drivers/scsi/3w-sas.c +0 −4
  634. drivers/scsi/53c700.c +0 −1
  635. drivers/scsi/bfa/bfad.c +0 −6
  636. drivers/scsi/bnx2fc/bnx2fc_fcoe.c +18 −23
  637. drivers/scsi/elx/libefc/efc_els.c +2 −6
  638. drivers/scsi/hisi_sas/hisi_sas_main.c +6 −11
  639. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +0 −2
  640. drivers/scsi/lpfc/lpfc.h +11 −3
  641. drivers/scsi/lpfc/lpfc_attr.c +5 −2
  642. drivers/scsi/lpfc/lpfc_els.c +19 −1
  643. drivers/scsi/lpfc/lpfc_init.c +1 −1
  644. drivers/scsi/lpfc/lpfc_nportdisc.c +3 −2
  645. drivers/scsi/lpfc/lpfc_sli.c +7 −1
  646. drivers/scsi/myrs.c +2 −1
  647. drivers/scsi/pm8001/pm8001_hwi.c +0 −18
  648. drivers/scsi/pm8001/pm8001_sas.c +5 −0
  649. drivers/scsi/pm8001/pm80xx_hwi.c +17 −30
  650. drivers/scsi/pm8001/pm80xx_hwi.h +5 −1
  651. drivers/scsi/qedf/qedf_io.c +1 −0
  652. drivers/scsi/qedf/qedf_main.c +5 −2
  653. drivers/scsi/qedi/qedi_fw.c +2 −4
  654. drivers/scsi/scsi_scan.c +50 −5
  655. drivers/scsi/ufs/ufshcd-pltfrm.c +7 −0
  656. drivers/scsi/ufs/ufshcd.c +7 −4
  657. drivers/scsi/ufs/ufshci.h +2 −1
  658. drivers/soc/aspeed/aspeed-lpc-ctrl.c +3 −4
  659. drivers/soc/mediatek/mtk-scpsys.c +4 −11
  660. drivers/soc/samsung/Kconfig +1 −1
  661. drivers/spi/spi-bcm-qspi.c +1 −1
  662. drivers/spi/spi-meson-spicc.c +5 −0
  663. drivers/spi/spi-mt65xx.c +1 −1
  664. drivers/spi/spi-stm32-qspi.c +17 −30
  665. drivers/spi/spi-stm32.c +4 −3
  666. drivers/spi/spi-uniphier.c +14 −4
  667. drivers/staging/fbtft/fbtft.h +4 −1
  668. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +18 −2
  669. drivers/target/iscsi/iscsi_target_tpg.c +3 −0
  670. drivers/tee/optee/core.c +1 −0
  671. drivers/tee/optee/ffa_abi.c +55 −37
  672. drivers/tee/optee/notif.c +1 −1
  673. drivers/tee/optee/optee_private.h +3 −2
  674. drivers/tee/optee/smc_abi.c +17 −41
  675. drivers/tty/n_gsm.c +3 −1
  676. drivers/tty/n_tty.c +4 −6
  677. drivers/tty/rpmsg_tty.c +26 −14
  678. drivers/tty/serial/8250/8250_gsc.c +1 −1
  679. drivers/tty/serial/8250/8250_of.c +10 −1
  680. drivers/tty/serial/8250/8250_pci.c +98 −2
  681. drivers/tty/serial/8250/8250_pericom.c +1 −1
  682. drivers/tty/serial/8250/8250_port.c +6 −55
  683. drivers/tty/serial/amba-pl011.c +1 −10
  684. drivers/tty/serial/serial_core.c +12 −22
  685. drivers/tty/serial/stm32-usart.c +13 −1
  686. drivers/tty/vt/vt_ioctl.c +2 −1
  687. drivers/usb/cdns3/drd.c +3 −3
  688. drivers/usb/common/ulpi.c +12 −5
  689. drivers/usb/core/hcd.c +14 −0
  690. drivers/usb/core/port.c +6 −3
  691. drivers/usb/core/urb.c +12 −0
  692. drivers/usb/dwc2/gadget.c +1 −1
  693. drivers/usb/dwc3/dwc3-xilinx.c +19 −6
  694. drivers/usb/dwc3/gadget.c +13 −0
  695. drivers/usb/gadget/composite.c +3 −0
  696. drivers/usb/gadget/function/f_fs.c +42 −14
  697. drivers/usb/gadget/function/f_sourcesink.c +1 −0
  698. drivers/usb/gadget/function/f_uac2.c +2 −2
  699. drivers/usb/gadget/function/rndis.c +6 −3
  700. drivers/usb/gadget/legacy/raw_gadget.c +1 −1
  701. drivers/usb/gadget/udc/at91_udc.c +1 −1
  702. drivers/usb/gadget/udc/renesas_usb3.c +2 −0
  703. drivers/usb/host/xhci-plat.c +3 −0
  704. drivers/usb/misc/usb251xb.c +3 −1
  705. drivers/usb/serial/ch341.c +1 −0
  706. drivers/usb/serial/cp210x.c +2 −0
  707. drivers/usb/serial/ftdi_sio.c +3 −0
  708. drivers/usb/serial/ftdi_sio_ids.h +3 −0
  709. drivers/usb/serial/option.c +2 −0
  710. drivers/usb/storage/unusual_devs.h +10 −0
  711. drivers/usb/typec/port-mapper.c +7 −1
  712. drivers/usb/typec/tcpm/tcpci.c +26 −0
  713. drivers/usb/typec/tcpm/tcpci.h +1 −0
  714. drivers/usb/typec/tcpm/tcpm.c +6 −1
  715. drivers/usb/typec/ucsi/ucsi_ccg.c +1 −1
  716. drivers/video/console/Kconfig +20 −0
  717. drivers/video/fbdev/core/bitblit.c +16 −0
  718. drivers/video/fbdev/core/fbcon.c +534 −20
  719. drivers/video/fbdev/core/fbcon.h +72 −0
  720. drivers/video/fbdev/core/fbcon_ccw.c +24 −4
  721. drivers/video/fbdev/core/fbcon_cw.c +24 −4
  722. drivers/video/fbdev/core/fbcon_rotate.h +9 −0
  723. drivers/video/fbdev/core/fbcon_ud.c +29 −8
  724. drivers/video/fbdev/core/fbmem.c +2 −0
  725. drivers/video/fbdev/core/tileblit.c +16 −0
  726. drivers/video/fbdev/hyperv_fb.c +3 −13
  727. drivers/video/fbdev/skeletonfb.c +6 −6
  728. drivers/xen/pci.c +1 −1
  729. fs/9p/fid.c +4 −5
  730. fs/Kconfig +2 −2
  731. fs/Makefile +1 −1
  732. fs/binfmt_elf.c +1 −1
  733. fs/binfmt_misc.c +1 −5
  734. fs/btrfs/block-group.c +37 −2
  735. fs/btrfs/ctree.h +6 −0
  736. fs/btrfs/ioctl.c +84 −18
  737. fs/btrfs/qgroup.c +19 −2
  738. fs/btrfs/send.c +4 −0
  739. fs/btrfs/transaction.c +34 −2
  740. fs/btrfs/transaction.h +2 −0
  741. fs/btrfs/tree-checker.c +15 −0
  742. fs/btrfs/tree-log.c +23 −0
  743. fs/cachefiles/io.c +59 −0
  744. fs/ceph/caps.c +37 −18
  745. fs/ceph/file.c +9 −0
  746. fs/cifs/cifs_swn.c +3 −3
  747. fs/cifs/cifsacl.c +6 −3
  748. fs/cifs/cifsfs.c +1 −0
  749. fs/cifs/connect.c +41 −13
  750. fs/cifs/dfs_cache.c +1 −1
  751. fs/cifs/file.c +82 −139
  752. fs/cifs/fs_context.c +2 −2
  753. fs/cifs/fscache.c +108 −18
  754. fs/cifs/fscache.h +49 −30
  755. fs/cifs/inode.c +4 −4
  756. fs/cifs/sess.c +11 −6
  757. fs/cifs/smb1ops.c +1 −3
  758. fs/cifs/transport.c +1 −4
  759. fs/cifs/xattr.c +2 −0
  760. fs/configfs/dir.c +3 −3
  761. fs/devpts/inode.c +1 −1
  762. fs/erofs/data.c +4 −4
  763. fs/erofs/zdata.c +56 −57
  764. fs/erofs/zmap.c +7 −0
  765. fs/ext4/acl.c +4 −4
  766. fs/ext4/ext4.h +16 −15
  767. fs/ext4/ext4_jbd2.h +1 −1
  768. fs/ext4/extents.c +10 −6
  769. fs/ext4/fast_commit.c +78 −55
  770. fs/ext4/hash.c +1 −1
  771. fs/ext4/indirect.c +1 −1
  772. fs/ext4/inline.c +13 −10
  773. fs/ext4/inode.c +6 −6
  774. fs/ext4/ioctl.c +2 −2
  775. fs/ext4/mballoc.c +17 −9
  776. fs/ext4/migrate.c +1 −1
  777. fs/ext4/namei.c +8 −8
  778. fs/ext4/orphan.c +2 −2
  779. fs/ext4/super.c +7 −7
  780. fs/ext4/sysfs.c +4 −4
  781. fs/ext4/xattr.c +3 −3
  782. fs/f2fs/dir.c +5 −5
  783. fs/f2fs/f2fs.h +1 −1
  784. fs/f2fs/hash.c +1 −1
  785. fs/f2fs/namei.c +2 −2
  786. fs/f2fs/recovery.c +2 −2
  787. fs/f2fs/super.c +5 −5
  788. fs/f2fs/sysfs.c +5 −5
  789. fs/file_table.c +6 −0
  790. fs/gfs2/file.c +4 −3
  791. fs/gfs2/glock.c +0 −3
  792. fs/io_uring.c +11 −8
  793. fs/iomap/buffered-io.c +48 −4
  794. fs/jbd2/commit.c +4 −17
  795. fs/jbd2/journal.c +7 −1
  796. fs/jbd2/transaction.c +32 −21
  797. fs/ksmbd/auth.c +27 −0
  798. fs/ksmbd/smb2pdu.c +35 −10
  799. fs/ksmbd/smb_common.c +4 −1
  800. fs/ksmbd/transport_rdma.c +1 −1
  801. fs/ksmbd/vfs.h +1 −0
  802. fs/libfs.c +5 −5
  803. fs/lockd/svcsubs.c +10 −8
  804. fs/namei.c +5 −5
  805. fs/namespace.c +30 −0
  806. fs/nfs/callback.h +1 −1
  807. fs/nfs/callback_proc.c +1 −1
  808. fs/nfs/callback_xdr.c +9 −9
  809. fs/nfs/client.c +8 −1
  810. fs/nfs/dir.c +136 −34
  811. fs/nfs/filelayout/filelayout.h +1 −1
  812. fs/nfs/filelayout/filelayoutdev.c +1 −3
  813. fs/nfs/inode.c +3 −6
  814. fs/nfs/internal.h +1 −0
  815. fs/nfs/nfs3proc.c +3 −2
  816. fs/nfs/nfs42proc.c +8 −5
  817. fs/nfs/nfs4_fs.h +9 −5
  818. fs/nfs/nfs4client.c +4 −1
  819. fs/nfs/nfs4namespace.c +12 −7
  820. fs/nfs/nfs4proc.c +159 −44
  821. fs/nfs/nfs4state.c +5 −1
  822. fs/nfs/nfs4xdr.c +44 −5
  823. fs/nfs/sysfs.c +2 −1
  824. fs/nfsd/nfs3proc.c +11 −8
  825. fs/nfsd/nfs3xdr.c +2 −2
  826. fs/nfsd/nfs4proc.c +9 −4
  827. fs/nfsd/nfs4state.c +3 −1
  828. fs/nfsd/nfs4xdr.c +3 −7
  829. fs/nfsd/nfsctl.c +3 −2
  830. fs/nfsd/trace.h +7 −7
  831. fs/nfsd/vfs.c +40 −17
  832. fs/nfsd/vfs.h +2 −2
  833. fs/notify/fanotify/fanotify_user.c +3 −6
  834. fs/ocfs2/stackglue.c +1 −12
  835. fs/ocfs2/suballoc.c +11 −14
  836. fs/overlayfs/copy_up.c +13 −3
  837. fs/proc/task_mmu.c +31 −9
  838. fs/quota/dquot.c +8 −3
  839. fs/super.c +12 −7
  840. fs/sync.c +12 −6
  841. fs/udf/inode.c +4 −5
  842. fs/unicode/Kconfig +5 −13
  843. fs/unicode/Makefile +4 −2
  844. fs/xfs/xfs_aops.c +15 −1
  845. fs/xfs/xfs_bmap_util.c +3 −6
  846. fs/xfs/xfs_file.c +26 −60
  847. fs/xfs/xfs_inode.h +0 −9
  848. fs/xfs/xfs_ioctl.c +1 −1
  849. fs/xfs/xfs_pnfs.c +39 −3
  850. fs/xfs/xfs_super.c +5 −1
  851. include/crypto/internal/blake2s.h +25 −15
  852. include/dt-bindings/clock/dra7.h +7 −7
  853. include/linux/ata.h +1 −1
  854. include/linux/blkdev.h +3 −1
  855. include/linux/ceph/libceph.h +1 −0
  856. include/linux/ceph/messenger.h +5 −0
  857. include/linux/compiler.h +5 −16
  858. include/linux/ethtool.h +1 −1
  859. include/linux/fb.h +1 −1
  860. include/linux/fs.h +1 −1
  861. include/linux/fsnotify.h +43 −6
  862. include/linux/hyperv.h +1 −0
  863. include/linux/if_vlan.h +4 −2
  864. include/linux/iomap.h +2 −0
  865. include/linux/jbd2.h +4 −9
  866. include/linux/kfence.h +2 −0
  867. include/linux/kvm_host.h +109 −3
  868. include/linux/libata.h +1 −0
  869. include/linux/lsm_hook_defs.h +1 −1
  870. include/linux/memcontrol.h +3 −2
  871. include/linux/mm.h +12 −5
  872. include/linux/mm_types.h +1 −0
  873. include/linux/netdevice.h +2 −1
  874. include/linux/netfs.h +7 −0
  875. include/linux/nfs.h +0 −8
  876. include/linux/nfs_fs.h +7 −4
  877. include/linux/nfs_fs_sb.h +3 −1
  878. include/linux/nfs_xdr.h +4 −1
  879. include/linux/page_table_check.h +19 −0
  880. include/linux/perf_event.h +3 −12
  881. include/linux/pgtable.h +1 −0
  882. include/linux/pid_namespace.h +5 −0
  883. include/linux/psi.h +1 −1
  884. include/linux/psi_types.h +0 −3
  885. include/linux/quota.h +1 −1
  886. include/linux/sched.h +0 −5
  887. include/linux/sched/task.h +2 −2
  888. include/linux/skbuff.h +1 −1
  889. include/linux/suspend.h +3 −12
  890. include/linux/sysctl.h +1 −1
  891. include/linux/usb/role.h +6 −0
  892. include/net/addrconf.h +2 −2
  893. include/net/ax25.h +12 −0
  894. include/net/bond_3ad.h +1 −1
  895. include/net/bonding.h +1 −1
  896. include/net/dsa.h +1 −0
  897. include/net/dst_metadata.h +13 −1
  898. include/net/ip.h +10 −11
  899. include/net/ip6_fib.h +7 −5
  900. include/net/ipv6.h +4 −1
  901. include/net/neighbour.h +13 −5
  902. include/net/netns/ipv6.h +2 −1
  903. include/net/route.h +1 −1
  904. include/net/tcp.h +4 −0
  905. include/sound/pcm.h +15 −0
  906. include/trace/events/skb.h +1 −1
  907. include/trace/events/sunrpc.h +45 −25
  908. include/trace/perf.h +3 −2
  909. include/trace/trace_events.h +5 −4
  910. include/uapi/linux/cyclades.h +35 −0
  911. include/uapi/linux/kvm.h +4 −3
  912. include/uapi/linux/netfilter/nf_conntrack_common.h +1 −1
  913. include/uapi/linux/perf_event.h +2 −0
  914. include/uapi/linux/smc_diag.h +5 −6
  915. include/uapi/sound/asound.h +3 −1
  916. include/uapi/xen/gntdev.h +7 −1
  917. include/xen/xenbus_dev.h +0 −2
  918. ipc/sem.c +2 −2
  919. kernel/async.c +0 −3
  920. kernel/audit.c +43 −19
  921. kernel/auditsc.c +1 −1
  922. kernel/bpf/bpf_lsm.c +1 −1
  923. kernel/bpf/ringbuf.c +1 −1
  924. kernel/bpf/stackmap.c +3 −2
  925. kernel/bpf/trampoline.c +3 −2
  926. kernel/cgroup/cgroup-v1.c +14 −0
  927. kernel/cgroup/cgroup.c +8 −3
  928. kernel/cgroup/cpuset.c +51 −14
  929. kernel/cred.c +2 −7
  930. kernel/events/core.c +183 −106
  931. kernel/fork.c +20 −10
  932. kernel/locking/lockdep.c +2 −2
  933. kernel/module.c +5 −20
  934. kernel/module_decompress.c +2 −0
  935. kernel/power/main.c +4 −1
  936. kernel/power/process.c +1 −1
  937. kernel/power/snapshot.c +7 −14
  938. kernel/power/suspend.c +0 −2
  939. kernel/power/wakelock.c +4 −7
  940. kernel/printk/sysctl.c +1 −1
  941. kernel/rcu/tasks.h +8 −4
  942. kernel/sched/core.c +20 −18
  943. kernel/sched/core_sched.c +1 −1
  944. kernel/sched/fair.c +77 −41
  945. kernel/sched/membarrier.c +5 −4
  946. kernel/sched/pelt.h +3 −1
  947. kernel/sched/psi.c +29 −37
  948. kernel/seccomp.c +10 −0
  949. kernel/signal.c +3 −2
  950. kernel/stackleak.c +2 −3
  951. kernel/sys.c +14 −6
  952. kernel/trace/Kconfig +7 −1
  953. kernel/trace/trace.c +6 −1
  954. kernel/trace/trace_events_hist.c +8 −2
  955. kernel/ucount.c +4 −1
  956. lib/crypto/blake2s.c +2 −2
  957. lib/sbitmap.c +6 −2
  958. lib/test_kasan.c +5 −0
  959. mm/debug_vm_pgtable.c +2 −0
  960. mm/gup.c +30 −5
  961. mm/kfence/core.c +2 −1
  962. mm/kfence/kfence_test.c +4 −4
  963. mm/khugepaged.c +21 −16
  964. mm/kmemleak.c +7 −6
  965. mm/memcontrol.c +5 −5
  966. mm/memory-failure.c +6 −0
  967. mm/mprotect.c +1 −1
  968. mm/page_isolation.c +1 −1
  969. mm/page_table_check.c +27 −28
  970. mm/vmscan.c +3 −1
  971. net/8021q/vlan.h +1 −1
  972. net/8021q/vlan_dev.c +11 −4
  973. net/8021q/vlan_netlink.c +4 −3
  974. net/ax25/af_ax25.c +20 −8
  975. net/ax25/ax25_dev.c +23 −5
  976. net/ax25/ax25_route.c +11 −2
  977. net/bridge/br_multicast.c +4 −0
  978. net/bridge/br_vlan.c +5 −4
  979. net/bridge/netfilter/nft_reject_bridge.c +4 −4
  980. net/can/isotp.c +22 −7
  981. net/ceph/ceph_common.c +7 −0
  982. net/ceph/messenger.c +4 −0
  983. net/ceph/messenger_v1.c +48 −6
  984. net/ceph/messenger_v2.c +186 −64
  985. net/core/drop_monitor.c +9 −2
  986. net/core/neighbour.c +12 −6
  987. net/core/net-procfs.c +34 −4
  988. net/core/rtnetlink.c +8 −4
  989. net/core/skbuff.c +1 −1
  990. net/dsa/dsa.c +1 −0
  991. net/dsa/dsa2.c +6 −19
  992. net/dsa/dsa_priv.h +0 −1
  993. net/dsa/tag_lan9303.c +7 −14
  994. net/ieee802154/nl802154.c +4 −4
  995. net/ipv4/fib_frontend.c +3 −0
  996. net/ipv4/fib_lookup.h +3 −4
  997. net/ipv4/fib_semantics.c +3 −3
  998. net/ipv4/fib_trie.c +13 −9
  999. net/ipv4/ip_output.c +21 −5
  1000. net/ipv4/ipmr.c +2 −0
  1001. net/ipv4/netfilter/Kconfig +0 −4
  1002. net/ipv4/ping.c +10 −2
  1003. net/ipv4/raw.c +4 −1
  1004. net/ipv4/route.c +2 −2
  1005. net/ipv4/tcp.c +20 −11
  1006. net/ipv4/tcp_input.c +2 −0
  1007. net/ipv4/tcp_ipv4.c +1 −1
  1008. net/ipv6/addrconf.c +22 −9
  1009. net/ipv6/ip6_fib.c +13 −10
  1010. net/ipv6/ip6_flowlabel.c +3 −1
  1011. net/ipv6/ip6_tunnel.c +4 −4
  1012. net/ipv6/ip6mr.c +2 −0
  1013. net/ipv6/mcast.c +1 −1
  1014. net/ipv6/netfilter/Kconfig +0 −4
  1015. net/ipv6/netfilter/Makefile +0 −3
  1016. net/ipv6/netfilter/nf_flow_table_ipv6.c +0 −0
  1017. net/ipv6/route.c +11 −10
  1018. net/mac80211/mlme.c +21 −8
  1019. net/mctp/route.c +6 −5
  1020. net/mpls/af_mpls.c +1 −1
  1021. net/mptcp/pm_netlink.c +34 −13
  1022. net/mptcp/protocol.h +3 −3
  1023. net/netfilter/nf_conntrack_core.c +5 −3
  1024. net/netfilter/nf_conntrack_netbios_ns.c +3 −2
  1025. net/netfilter/nf_conntrack_netlink.c +2 −1
  1026. net/netfilter/nf_conntrack_proto_sctp.c +9 −0
  1027. net/netfilter/nf_conntrack_proto_tcp.c +41 −18
  1028. net/netfilter/nf_tables_api.c +1 −4
  1029. net/netfilter/nft_byteorder.c +12 −0
  1030. net/netfilter/nft_connlimit.c +10 −1
  1031. net/netfilter/nft_ct.c +4 −1
  1032. net/netfilter/nft_exthdr.c +1 −1
  1033. net/netfilter/nft_payload.c +5 −4
  1034. net/netfilter/nft_synproxy.c +3 −1
  1035. net/netfilter/xt_socket.c +1 −1
  1036. net/packet/af_packet.c +8 −2
  1037. net/rxrpc/call_event.c +3 −5
  1038. net/rxrpc/output.c +1 −1
  1039. net/sched/act_api.c +10 −3
  1040. net/sched/cls_api.c +10 −7
  1041. net/sched/sch_api.c +13 −11
  1042. net/sched/sch_generic.c +16 −13
  1043. net/sched/sch_htb.c +20 −0
  1044. net/smc/af_smc.c +171 −25
  1045. net/smc/smc.h +19 −1
  1046. net/smc/smc_diag.c +0 −2
  1047. net/smc/smc_pnet.c +5 −3
  1048. net/socket.c +2 −2
  1049. net/sunrpc/auth_gss/gss_generic_token.c +2 −4
  1050. net/sunrpc/clnt.c +4 −1
  1051. net/sunrpc/rpc_pipe.c +2 −2
  1052. net/sunrpc/sysfs.c +31 −21
  1053. net/sunrpc/xprtrdma/backchannel.c +0 −4
  1054. net/sunrpc/xprtrdma/frwr_ops.c +0 −4
  1055. net/sunrpc/xprtrdma/rpc_rdma.c +0 −4
  1056. net/sunrpc/xprtrdma/transport.c +0 −4
  1057. net/sunrpc/xprtrdma/verbs.c +3 −23
  1058. net/sunrpc/xprtsock.c +7 −2
  1059. net/tipc/crypto.c +1 −1
  1060. net/tipc/link.c +7 −2
  1061. net/tipc/monitor.c +2 −0
  1062. net/tipc/name_distr.c +1 −1
  1063. net/tipc/node.c +7 −6
  1064. net/vmw_vsock/af_vsock.c +1 −0
  1065. net/wireless/core.c +4 −13
  1066. samples/seccomp/dropper.c +7 −2
  1067. scripts/Makefile +1 −1
  1068. scripts/Makefile.extrawarn +1 −0
  1069. scripts/kconfig/confdata.c +15 −10
  1070. scripts/kconfig/preprocess.c +1 −1
  1071. security/integrity/digsig_asymmetric.c +9 −6
  1072. security/integrity/ima/ima_fs.c +1 −1
  1073. security/integrity/ima/ima_policy.c +8 −0
  1074. security/integrity/ima/ima_template.c +7 −3
  1075. security/integrity/integrity_audit.c +2 −0
  1076. security/security.c +13 −2
  1077. security/selinux/ss/conditional.c +2 −1
  1078. sound/core/memalloc.c +10 −5
  1079. sound/core/pcm_native.c +13 −0
  1080. sound/hda/intel-sdw-acpi.c +3 −4
  1081. sound/pci/hda/hda_auto_parser.c +1 −1
  1082. sound/pci/hda/hda_codec.c +4 −0
  1083. sound/pci/hda/hda_generic.c +15 −2
  1084. sound/pci/hda/hda_generic.h +3 −0
  1085. sound/pci/hda/hda_intel.c +4 −2
  1086. sound/pci/hda/patch_realtek.c +66 −13
  1087. sound/soc/amd/acp/acp-mach-common.c +2 −2
  1088. sound/soc/amd/acp/acp-mach.h +0 −1
  1089. sound/soc/amd/acp/acp-sof-mach.c +2 −2
  1090. sound/soc/codecs/cpcap.c +2 −0
  1091. sound/soc/codecs/hdmi-codec.c +1 −1
  1092. sound/soc/codecs/lpass-rx-macro.c +4 −4
  1093. sound/soc/codecs/max9759.c +2 −1
  1094. sound/soc/codecs/rt5668.c +7 −5
  1095. sound/soc/codecs/rt5682-i2c.c +4 −11
  1096. sound/soc/codecs/rt5682.c +14 −20
  1097. sound/soc/codecs/rt5682.h +0 −2
  1098. sound/soc/codecs/rt5682s.c +7 −5
  1099. sound/soc/codecs/tas2770.c +6 −1
  1100. sound/soc/codecs/wcd938x.c +17 −14
  1101. sound/soc/codecs/wm_adsp.c +2 −1
  1102. sound/soc/fsl/pcm030-audio-fabric.c +8 −3
  1103. sound/soc/generic/simple-card.c +25 −1
  1104. sound/soc/intel/skylake/skl.c +1 −0
  1105. sound/soc/mediatek/Kconfig +1 −1
  1106. sound/soc/qcom/lpass-platform.c +4 −4
  1107. sound/soc/qcom/qdsp6/q6apm-dai.c +5 −2
  1108. sound/soc/soc-acpi.c +2 −5
  1109. sound/soc/soc-ops.c +57 −13
  1110. sound/soc/soc-pcm.c +12 −6
  1111. sound/soc/sof/intel/hda.c +1 −0
  1112. sound/soc/xilinx/xlnx_formatter_pcm.c +24 −3
  1113. sound/usb/implicit.c +2 −2
  1114. sound/usb/mixer.c +7 −6
  1115. sound/usb/quirks-table.h +1 −1
  1116. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  1117. tools/arch/x86/include/uapi/asm/kvm.h +3 −0
  1118. tools/bpf/resolve_btfids/Makefile +5 −1
  1119. tools/bpf/runqslower/runqslower.bpf.c +1 −1
  1120. tools/bpf/runqslower/runqslower.c +1 −1
  1121. tools/bpf/runqslower/runqslower.h +1 −1
  1122. tools/include/uapi/linux/kvm.h +4 −3
  1123. tools/include/uapi/linux/lirc.h +0 −229
  1124. tools/include/uapi/linux/perf_event.h +5 −3
  1125. tools/include/uapi/linux/prctl.h +3 −0
  1126. tools/include/uapi/sound/asound.h +9 −2
  1127. tools/lib/perf/include/internal/cpumap.h +1 −5
  1128. tools/lib/perf/include/perf/cpumap.h +5 −0
  1129. tools/lib/perf/libperf.map +1 −0
  1130. tools/lib/perf/mmap.c +98 −0
  1131. tools/lib/perf/tests/test-cpumap.c +11 −0
  1132. tools/lib/perf/tests/test-evlist.c +3 −2
  1133. tools/lib/perf/tests/test-evsel.c +4 −1
  1134. tools/lib/subcmd/subcmd-util.h +2 −9
  1135. tools/objtool/check.c +1 −1
  1136. tools/perf/builtin-ftrace.c +24 −21
  1137. tools/perf/builtin-trace.c +18 −5
  1138. tools/perf/tests/attr/README +2 −0
  1139. tools/perf/tests/attr/test-record-graph-default +2 −0
  1140. tools/perf/tests/attr/test-record-graph-default-aarch64 +9 −0
  1141. tools/perf/tests/attr/test-record-graph-fp +2 −0
  1142. tools/perf/tests/attr/test-record-graph-fp-aarch64 +9 −0
  1143. tools/perf/trace/beauty/prctl_option.sh +1 −1
  1144. tools/perf/util/annotate.c +1 −0
  1145. tools/perf/util/bpf-loader.c +2 −1
  1146. tools/perf/util/bpf_counter_cgroup.c +1 −1
  1147. tools/perf/util/cs-etm.c +7 −9
  1148. tools/perf/util/machine.c +2 −0
  1149. tools/perf/util/map_symbol.h +1 −0
  1150. tools/perf/util/perf_event_attr_fprintf.c +1 −1
  1151. tools/perf/util/session.c +2 −1
  1152. tools/perf/util/sort.c +2 −2
  1153. tools/perf/util/stat-display.c +10 −9
  1154. tools/perf/util/synthetic-events.c +19 −0
  1155. tools/scripts/Makefile.include +1 −1
  1156. tools/testing/kunit/kunit_kernel.py +1 −0
  1157. tools/testing/kunit/run_checks.py +1 −1
  1158. tools/testing/scatterlist/linux/mm.h +2 −1
  1159. tools/testing/selftests/arm64/fp/sve-ptrace.c +9 −2
  1160. tools/testing/selftests/bpf/test_lirc_mode2_user.c +0 −1
  1161. tools/testing/selftests/clone3/clone3.c +0 −2
  1162. tools/testing/selftests/cpufreq/main.sh +1 −1
  1163. tools/testing/selftests/exec/Makefile +3 −3
  1164. tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +1 −1
  1165. tools/testing/selftests/futex/Makefile +2 −2
  1166. tools/testing/selftests/ir/ir_loopback.c +10 −0
  1167. tools/testing/selftests/kselftest_harness.h +3 −1
  1168. tools/testing/selftests/kvm/Makefile +1 −1
  1169. tools/testing/selftests/kvm/include/kvm_util_base.h +0 −1
  1170. tools/testing/selftests/kvm/include/x86_64/processor.h +1 −0
  1171. tools/testing/selftests/kvm/lib/kvm_util.c +0 −7
  1172. tools/testing/selftests/kvm/lib/x86_64/processor.c +21 −6
  1173. tools/testing/selftests/kvm/x86_64/amx_test.c +2 −0
  1174. tools/testing/selftests/kvm/x86_64/smm_test.c +0 −1
  1175. tools/testing/selftests/mincore/mincore_selftest.c +14 −6
  1176. tools/testing/selftests/mount_setattr/mount_setattr_test.c +2 −2
  1177. tools/testing/selftests/net/ioam6_parser.c +1 −4
  1178. tools/testing/selftests/net/mptcp/mptcp_join.sh +4 −2
  1179. tools/testing/selftests/netfilter/Makefile +1 −1
  1180. tools/testing/selftests/netfilter/nft_concat_range.sh +72 −2
  1181. tools/testing/selftests/netfilter/nft_fib.sh +1 −0
  1182. tools/testing/selftests/netfilter/nft_nat.sh +152 −0
  1183. tools/testing/selftests/netfilter/nft_synproxy.sh +117 −0
  1184. tools/testing/selftests/netfilter/nft_zones_many.sh +6 −6
  1185. tools/testing/selftests/openat2/Makefile +1 −1
  1186. tools/testing/selftests/openat2/helpers.h +7 −5
  1187. tools/testing/selftests/openat2/openat2_test.c +11 −1
  1188. tools/testing/selftests/perf_events/sigtrap_threads.c +9 −8
  1189. tools/testing/selftests/pidfd/pidfd.h +10 −3
  1190. tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +18 −4
  1191. tools/testing/selftests/pidfd/pidfd_test.c +3 −3
  1192. tools/testing/selftests/pidfd/pidfd_wait.c +2 −3
  1193. tools/testing/selftests/rtc/settings +1 −1
  1194. tools/testing/selftests/seccomp/Makefile +1 −1
  1195. tools/testing/selftests/vDSO/vdso_test_abi.c +62 −73
  1196. tools/testing/selftests/vm/userfaultfd.c +7 −2
  1197. tools/testing/selftests/zram/zram.sh +1 −14
  1198. tools/testing/selftests/zram/zram01.sh +9 −24
  1199. tools/testing/selftests/zram/zram02.sh +0 −1
  1200. tools/testing/selftests/zram/zram_lib.sh +88 −46
  1201. tools/tracing/Makefile +14 −4
  1202. tools/tracing/rtla/Makefile +4 −2
  1203. tools/tracing/rtla/src/osnoise.c +3 −0
  1204. tools/tracing/rtla/src/osnoise_hist.c +3 −4
  1205. tools/tracing/rtla/src/osnoise_top.c +3 −4
  1206. tools/tracing/rtla/src/timerlat_hist.c +3 −4
  1207. tools/tracing/rtla/src/timerlat_top.c +3 −4
  1208. tools/tracing/rtla/src/trace.c +4 −4
  1209. tools/tracing/rtla/src/utils.c +2 −2
  1210. usr/include/Makefile +1 −0
  1211. virt/kvm/eventfd.c +4 −4
  1212. virt/kvm/kvm_main.c +3 −5
.mailmap+4−0
@@ -70,6 +70,7 @@ Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@bootlin.com> · 69 unmodified lines
7070 Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@free-electrons.com>
7171 Brian Avery <b.avery@hp.com>
7272 Brian King <brking@us.ibm.com>
73+Brian Silverman <bsilver16384@gmail.com> <brian.silverman@bluerivertech.com>
7374 Changbin Du <changbin.du@intel.com> <changbin.du@gmail.com>
7475 Changbin Du <changbin.du@intel.com> <changbin.du@intel.com>
7576 Chao Yu <chao@kernel.org> <chao2.yu@samsung.com>
@@ -79,6 +80,9 @@ Chris Chiu <chris.chiu@canonical.com> <chiu@endlessos.org> · 3 unmodified lines
7980 Christian Borntraeger <borntraeger@linux.ibm.com> <borntraeger@de.ibm.com>
8081 Christian Borntraeger <borntraeger@linux.ibm.com> <cborntra@de.ibm.com>
8182 Christian Borntraeger <borntraeger@linux.ibm.com> <borntrae@de.ibm.com>
83+Christian Brauner <brauner@kernel.org> <christian@brauner.io>
84+Christian Brauner <brauner@kernel.org> <christian.brauner@canonical.com>
85+Christian Brauner <brauner@kernel.org> <christian.brauner@ubuntu.com>
8286 Christophe Ricard <christophe.ricard@gmail.com>
8387 Christoph Hellwig <hch@lst.de>
8488 Colin Ian King <colin.king@intel.com> <colin.king@canonical.com>
Documentation/ABI/testing/sysfs-class-power+1−0
@@ -468,6 +468,7 @@ Description: · 467 unmodified lines
468468 auto: Charge normally, respect thresholds
469469 inhibit-charge: Do not charge while AC is attached
470470 force-discharge: Force discharge while AC is attached
471+ ================ ====================================
471472
472473 What: /sys/class/power_supply/<supply_name>/technology
473474 Date: May 2007
Documentation/ABI/testing/sysfs-driver-aspeed-uart-routing+3−3
@@ -1,4 +1,4 @@
1−What: /sys/bus/platform/drivers/aspeed-uart-routing/*/uart*
1+What: /sys/bus/platform/drivers/aspeed-uart-routing/\*/uart\*
22 Date: September 2021
33 Contact: Oskar Senft <osk@google.com>
44 Chia-Wei Wang <chiawei_wang@aspeedtech.com>
@@ -9,7 +9,7 @@ Description: Selects the RX source of the UARTx device. · 4 unmodified lines
99 depends on the selected file.
1010
1111 e.g.
12− cat /sys/bus/platform/drivers/aspeed-uart-routing/*.uart_routing/uart1
12+ cat /sys/bus/platform/drivers/aspeed-uart-routing/\*.uart_routing/uart1
1313 [io1] io2 io3 io4 uart2 uart3 uart4 io6
1414
1515 In this case, UART1 gets its input from IO1 (physical serial port 1).
@@ -17,7 +17,7 @@ Description: Selects the RX source of the UARTx device. · 1 unmodified line
1717 Users: OpenBMC. Proposed changes should be mailed to
1818 openbmc@lists.ozlabs.org
1919
20−What: /sys/bus/platform/drivers/aspeed-uart-routing/*/io*
20+What: /sys/bus/platform/drivers/aspeed-uart-routing/\*/io\*
2121 Date: September 2021
2222 Contact: Oskar Senft <osk@google.com>
2323 Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Documentation/accounting/psi.rst+2−1
@@ -92,7 +92,8 @@ Triggers can be set on more than one psi metric and more than one trigger · 91 unmodified lines
9292 for the same psi metric can be specified. However for each trigger a separate
9393 file descriptor is required to be able to poll it separately from others,
9494 therefore for each trigger a separate open() syscall should be made even
95−when opening the same psi interface file.
95+when opening the same psi interface file. Write operations to a file descriptor
96+with an already existing psi trigger will fail with EBUSY.
9697
9798 Monitors activate only when system enters stall state for the monitored
9899 psi metric and deactivates upon exit from the stall state. While system is
Documentation/admin-guide/gpio/index.rst+1−0
@@ -10,6 +10,7 @@ gpio · 9 unmodified lines
1010 gpio-aggregator
1111 sysfs
1212 gpio-mockup
13+ gpio-sim
1314
1415 .. only:: subproject and html
1516
Documentation/arm/marvell.rst+2−0
@@ -266,10 +266,12 @@ Avanta family · 265 unmodified lines
266266 -------------
267267
268268 Flavors:
269+ - 88F6500
269270 - 88F6510
270271 - 88F6530P
271272 - 88F6550
272273 - 88F6560
274+ - 88F6601
273275
274276 Homepage:
275277 https://web.archive.org/web/20181005145041/http://www.marvell.com/broadband/
Documentation/arm64/silicon-errata.rst+14−0
@@ -52,6 +52,12 @@ stable kernels. · 51 unmodified lines
5252 | Allwinner | A64/R18 | UNKNOWN1 | SUN50I_ERRATUM_UNKNOWN1 |
5353 +----------------+-----------------+-----------------+-----------------------------+
5454 +----------------+-----------------+-----------------+-----------------------------+
55+| ARM | Cortex-A510 | #2064142 | ARM64_ERRATUM_2064142 |
56++----------------+-----------------+-----------------+-----------------------------+
57+| ARM | Cortex-A510 | #2038923 | ARM64_ERRATUM_2038923 |
58++----------------+-----------------+-----------------+-----------------------------+
59+| ARM | Cortex-A510 | #1902691 | ARM64_ERRATUM_1902691 |
60++----------------+-----------------+-----------------+-----------------------------+
5561 | ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
5662 +----------------+-----------------+-----------------+-----------------------------+
5763 | ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |
@@ -92,12 +98,20 @@ stable kernels. · 34 unmodified lines
9298 +----------------+-----------------+-----------------+-----------------------------+
9399 | ARM | Cortex-A77 | #1508412 | ARM64_ERRATUM_1508412 |
94100 +----------------+-----------------+-----------------+-----------------------------+
101+| ARM | Cortex-A510 | #2051678 | ARM64_ERRATUM_2051678 |
102++----------------+-----------------+-----------------+-----------------------------+
103+| ARM | Cortex-A510 | #2077057 | ARM64_ERRATUM_2077057 |
104++----------------+-----------------+-----------------+-----------------------------+
95105 | ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 |
96106 +----------------+-----------------+-----------------+-----------------------------+
97107 | ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 |
98108 +----------------+-----------------+-----------------+-----------------------------+
99109 | ARM | Cortex-A710 | #2224489 | ARM64_ERRATUM_2224489 |
100110 +----------------+-----------------+-----------------+-----------------------------+
111+| ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 |
112++----------------+-----------------+-----------------+-----------------------------+
113+| ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 |
114++----------------+-----------------+-----------------+-----------------------------+
101115 | ARM | Neoverse-N1 | #1188873,1418040| ARM64_ERRATUM_1418040 |
102116 +----------------+-----------------+-----------------+-----------------------------+
103117 | ARM | Neoverse-N1 | #1349291 | N/A |
Documentation/dev-tools/kselftest.rst+8−0
@@ -7,6 +7,14 @@ directory. These are intended to be small tests to exercise individual code · 6 unmodified lines
77 paths in the kernel. Tests are intended to be run after building, installing
88 and booting a kernel.
99
10+Kselftest from mainline can be run on older stable kernels. Running tests
11+from mainline offers the best coverage. Several test rings run mainline
12+kselftest suite on stable releases. The reason is that when a new test
13+gets added to test existing code to regression test a bug, we should be
14+able to run that test on an older kernel. Hence, it is important to keep
15+code that can still test an older kernel and make sure it skips the test
16+gracefully on newer releases.
17+
1018 You can find additional information on Kselftest framework, how to
1119 write new tests using the framework on Kselftest wiki:
1220
Documentation/dev-tools/kunit/usage.rst+1−1
@@ -242,7 +242,7 @@ example: · 241 unmodified lines
242242
243243 int rectangle_area(struct shape *this)
244244 {
245− struct rectangle *self = container_of(this, struct shape, parent);
245+ struct rectangle *self = container_of(this, struct rectangle, parent);
246246
247247 return self->length * self->width;
248248 };
Documentation/devicetree/bindings/arm/omap/omap.txt+3−0
@@ -119,6 +119,9 @@ Boards (incomplete list of examples): · 118 unmodified lines
119119 - OMAP3 BeagleBoard : Low cost community board
120120 compatible = "ti,omap3-beagle", "ti,omap3430", "ti,omap3"
121121
122+- OMAP3 BeagleBoard A to B4 : Early BeagleBoard revisions A to B4 with a timer quirk
123+ compatible = "ti,omap3-beagle-ab4", "ti,omap3-beagle", "ti,omap3430", "ti,omap3"
124+
122125 - OMAP3 Tobi with Overo : Commercial expansion board with daughter board
123126 compatible = "gumstix,omap3-overo-tobi", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3"
124127
Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml+1−0
@@ -36,6 +36,7 @@ properties: · 35 unmodified lines
3636 - renesas,intc-ex-r8a77980 # R-Car V3H
3737 - renesas,intc-ex-r8a77990 # R-Car E3
3838 - renesas,intc-ex-r8a77995 # R-Car D3
39+ - renesas,intc-ex-r8a779a0 # R-Car V3U
3940 - const: renesas,irqc
4041
4142 '#interrupt-cells':
Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml+21−12
@@ -35,6 +35,10 @@ description: · 34 unmodified lines
3535 contains a specific memory layout, which is documented in chapter 8 of the
3636 SiFive U5 Coreplex Series Manual <https://static.dev.sifive.com/U54-MC-RVCoreIP.pdf>.
3737
38+ The thead,c900-plic is different from sifive,plic-1.0.0 in opensbi, the
39+ T-HEAD PLIC implementation requires setting a delegation bit to allow access
40+ from S-mode. So add thead,c900-plic to distinguish them.
41+
3842 maintainers:
3943 - Sagar Kadam <sagar.kadam@sifive.com>
4044 - Paul Walmsley <paul.walmsley@sifive.com>
@@ -42,12 +46,17 @@ maintainers: · 1 unmodified line
4246
4347 properties:
4448 compatible:
45− items:
46− - enum:
47− - sifive,fu540-c000-plic
48− - starfive,jh7100-plic
49− - canaan,k210-plic
50− - const: sifive,plic-1.0.0
49+ oneOf:
50+ - items:
51+ - enum:
52+ - sifive,fu540-c000-plic
53+ - starfive,jh7100-plic
54+ - canaan,k210-plic
55+ - const: sifive,plic-1.0.0
56+ - items:
57+ - enum:
58+ - allwinner,sun20i-d1-plic
59+ - const: thead,c900-plic
5160
5261 reg:
5362 maxItems: 1
@@ -62,6 +71,7 @@ properties: · 8 unmodified lines
6271
6372 interrupts-extended:
6473 minItems: 1
74+ maxItems: 15872
6575 description:
6676 Specifies which contexts are connected to the PLIC, with "-1" specifying
6777 that a context is not present. Each node pointed to should be a
@@ -90,12 +100,11 @@ examples: · 22 unmodified lines
90100 #interrupt-cells = <1>;
91101 compatible = "sifive,fu540-c000-plic", "sifive,plic-1.0.0";
92102 interrupt-controller;
93− interrupts-extended = <
94− &cpu0_intc 11
95− &cpu1_intc 11 &cpu1_intc 9
96− &cpu2_intc 11 &cpu2_intc 9
97− &cpu3_intc 11 &cpu3_intc 9
98− &cpu4_intc 11 &cpu4_intc 9>;
103+ interrupts-extended = <&cpu0_intc 11>,
104+ <&cpu1_intc 11>, <&cpu1_intc 9>,
105+ <&cpu2_intc 11>, <&cpu2_intc 9>,
106+ <&cpu3_intc 11>, <&cpu3_intc 9>,
107+ <&cpu4_intc 11>, <&cpu4_intc 9>;
99108 reg = <0xc000000 0x4000000>;
100109 riscv,ndev = <10>;
101110 };
Documentation/devicetree/bindings/net/can/tcan4x5x.txt+1−1
@@ -31,7 +31,7 @@ tcan4x5x: tcan4x5x@0 { · 30 unmodified lines
3131 #address-cells = <1>;
3232 #size-cells = <1>;
3333 spi-max-frequency = <10000000>;
34− bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
34+ bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
3535 interrupt-parent = <&gpio1>;
3636 interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
3737 device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
Documentation/devicetree/bindings/net/qcom,ipa.yaml+6−0
@@ -107,6 +107,10 @@ properties: · 106 unmodified lines
107107 - const: imem
108108 - const: config
109109
110+ qcom,qmp:
111+ $ref: /schemas/types.yaml#/definitions/phandle
112+ description: phandle to the AOSS side-channel message RAM
113+
110114 qcom,smem-states:
111115 $ref: /schemas/types.yaml#/definitions/phandle-array
112116 description: State bits used in by the AP to signal the modem.
@@ -222,6 +226,8 @@ examples: · 109 unmodified lines
222226 "imem",
223227 "config";
224228
229+ qcom,qmp = <&aoss_qmp>;
230+
225231 qcom,smem-states = <&ipa_smp2p_out 0>,
226232 <&ipa_smp2p_out 1>;
227233 qcom,smem-state-names = "ipa-clock-enabled-valid",
Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml+1−0
@@ -8,6 +8,7 @@ title: Audio codec controlled by ChromeOS EC · 7 unmodified lines
88
99 maintainers:
1010 - Cheng-Yi Chiang <cychiang@chromium.org>
11+ - Tzung-Bi Shih <tzungbi@google.com>
1112
1213 description: |
1314 Google's ChromeOS EC codec is a digital mic codec provided by the
Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml+3−2
@@ -23,8 +23,9 @@ properties: · 22 unmodified lines
2323 minItems: 1
2424 maxItems: 256
2525 items:
26− minimum: 0
27− maximum: 256
26+ items:
27+ - minimum: 0
28+ maximum: 256
2829 description:
2930 Chip select used by the device.
3031
Documentation/filesystems/netfs_library.rst+16−0
@@ -462,6 +462,10 @@ operation table looks like the following:: · 461 unmodified lines
462462 struct iov_iter *iter,
463463 netfs_io_terminated_t term_func,
464464 void *term_func_priv);
465+
466+ int (*query_occupancy)(struct netfs_cache_resources *cres,
467+ loff_t start, size_t len, size_t granularity,
468+ loff_t *_data_start, size_t *_data_len);
465469 };
466470
467471 With a termination handler function pointer::
@@ -536,6 +540,18 @@ The methods defined in the table are: · 68 unmodified lines
536540 indicating whether the termination is definitely happening in the caller's
537541 context.
538542
543+ * ``query_occupancy()``
544+
545+ [Required] Called to find out where the next piece of data is within a
546+ particular region of the cache. The start and length of the region to be
547+ queried are passed in, along with the granularity to which the answer needs
548+ to be aligned. The function passes back the start and length of the data,
549+ if any, available within that region. Note that there may be a hole at the
550+ front.
551+
552+ It returns 0 if some data was found, -ENODATA if there was no usable data
553+ within the region or -ENOBUFS if there is no caching on this file.
554+
539555 Note that these methods are passed a pointer to the cache resource structure,
540556 not the read request structure as they could be used in other situations where
541557 there isn't a read request structure as well, such as writing dirty data to the
Documentation/gpu/todo.rst+0−24
@@ -300,30 +300,6 @@ Contact: Daniel Vetter, Noralf Tronnes · 299 unmodified lines
300300
301301 Level: Advanced
302302
303−Garbage collect fbdev scrolling acceleration
304−--------------------------------------------
305−
306−Scroll acceleration has been disabled in fbcon. Now it works as the old
307−SCROLL_REDRAW mode. A ton of code was removed in fbcon.c and the hook bmove was
308−removed from fbcon_ops.
309−Remaining tasks:
310−
311−- a bunch of the hooks in fbcon_ops could be removed or simplified by calling
312− directly instead of the function table (with a switch on p->rotate)
313−
314−- fb_copyarea is unused after this, and can be deleted from all drivers
315−
316−- after that, fb_copyarea can be deleted from fb_ops in include/linux/fb.h as
317− well as cfb_copyarea
318−
319−Note that not all acceleration code can be deleted, since clearing and cursor
320−support is still accelerated, which might be good candidates for further
321−deletion projects.
322−
323−Contact: Daniel Vetter
324−
325−Level: Intermediate
326−
327303 idr_init_base()
328304 ---------------
329305
Documentation/index.rst+1−0
@@ -166,6 +166,7 @@ to ReStructured Text format, or are simply too old. · 165 unmodified lines
166166 .. toctree::
167167 :maxdepth: 2
168168
169+ tools/index
169170 staging/index
170171 watch_queue
171172
Documentation/kernel-hacking/locking.rst+1−1
@@ -295,7 +295,7 @@ Pete Zaitcev gives the following summary: · 294 unmodified lines
295295
296296 - If you are in a process context (any syscall) and want to lock other
297297 process out, use a mutex. You can take a mutex and sleep
298− (``copy_from_user*(`` or ``kmalloc(x,GFP_KERNEL)``).
298+ (``copy_from_user()`` or ``kmalloc(x,GFP_KERNEL)``).
299299
300300 - Otherwise (== data can be touched in an interrupt), use
301301 spin_lock_irqsave() and
Documentation/tools/index.rst+20−0
@@ -0,0 +1,20 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+============
4+Kernel tools
5+============
6+
7+This book covers user-space tools that are shipped with the kernel source;
8+more additions are needed here:
9+
10+.. toctree::
11+ :maxdepth: 1
12+
13+ rtla/index
14+
15+.. only:: subproject and html
16+
17+ Indices
18+ =======
19+
20+ * :ref:`genindex`
Documentation/tools/rtla/index.rst+26−0
@@ -0,0 +1,26 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+================================
4+The realtime Linux analysis tool
5+================================
6+
7+RTLA provides a set of tools for the analysis of the kernel's realtime
8+behavior on specific hardware.
9+
10+.. toctree::
11+ :maxdepth: 1
12+
13+ rtla
14+ rtla-osnoise
15+ rtla-osnoise-hist
16+ rtla-osnoise-top
17+ rtla-timerlat
18+ rtla-timerlat-hist
19+ rtla-timerlat-top
20+
21+.. only:: subproject and html
22+
23+ Indices
24+ =======
25+
26+ * :ref:`genindex`
Documentation/userspace-api/ioctl/ioctl-number.rst+3−0
@@ -115,6 +115,7 @@ Code Seq# Include File Comments · 114 unmodified lines
115115 'B' 00-1F linux/cciss_ioctl.h conflict!
116116 'B' 00-0F include/linux/pmu.h conflict!
117117 'B' C0-FF advanced bbus <mailto:maassen@uni-freiburg.de>
118+'B' 00-0F xen/xenbus_dev.h conflict!
118119 'C' all linux/soundcard.h conflict!
119120 'C' 01-2F linux/capi.h conflict!
120121 'C' F0-FF drivers/net/wan/cosa.h conflict!
@@ -134,6 +135,7 @@ Code Seq# Include File Comments · 13 unmodified lines
134135 'F' 80-8F linux/arcfb.h conflict!
135136 'F' DD video/sstfb.h conflict!
136137 'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
138+'G' 00-0F xen/gntalloc.h, xen/gntdev.h conflict!
137139 'H' 00-7F linux/hiddev.h conflict!
138140 'H' 00-0F linux/hidraw.h conflict!
139141 'H' 01 linux/mei.h conflict!
@@ -176,6 +178,7 @@ Code Seq# Include File Comments · 36 unmodified lines
176178 'P' 60-6F sound/sscape_ioctl.h conflict!
177179 'P' 00-0F drivers/usb/class/usblp.c conflict!
178180 'P' 01-09 drivers/misc/pci_endpoint_test.c conflict!
181+'P' 00-0F xen/privcmd.h conflict!
179182 'Q' all linux/soundcard.h
180183 'R' 00-1F linux/random.h conflict!
181184 'R' 01 linux/rfkill.h conflict!
Documentation/virt/kvm/api.rst+3−1
@@ -3268,6 +3268,7 @@ number. · 3267 unmodified lines
32683268
32693269 :Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
32703270 KVM_CAP_VCPU_ATTRIBUTES for vcpu device
3271+ KVM_CAP_SYS_ATTRIBUTES for system (/dev/kvm) device (no set)
32713272 :Type: device ioctl, vm ioctl, vcpu ioctl
32723273 :Parameters: struct kvm_device_attr
32733274 :Returns: 0 on success, -1 on error
@@ -3302,7 +3303,8 @@ transferred is defined by the particular attribute. · 28 unmodified lines
33023303 ------------------------
33033304
33043305 :Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
3305− KVM_CAP_VCPU_ATTRIBUTES for vcpu device
3306+ KVM_CAP_VCPU_ATTRIBUTES for vcpu device
3307+ KVM_CAP_SYS_ATTRIBUTES for system (/dev/kvm) device
33063308 :Type: device ioctl, vm ioctl, vcpu ioctl
33073309 :Parameters: struct kvm_device_attr
33083310 :Returns: 0 on success, -1 on error
Documentation/vm/page_table_check.rst+1−1
@@ -9,7 +9,7 @@ Page Table Check · 8 unmodified lines
99 Introduction
1010 ============
1111
12−Page table check allows to hardern the kernel by ensuring that some types of
12+Page table check allows to harden the kernel by ensuring that some types of
1313 the memory corruptions are prevented.
1414
1515 Page table check performs extra verifications at the time when new pages become
MAINTAINERS+102−42
@@ -190,8 +190,9 @@ M: Johannes Berg <johannes@sipsolutions.net> · 189 unmodified lines
190190 L: linux-wireless@vger.kernel.org
191191 S: Maintained
192192 W: https://wireless.wiki.kernel.org/
193−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
194−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
193+Q: https://patchwork.kernel.org/project/linux-wireless/list/
194+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
195+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
195196 F: Documentation/driver-api/80211/cfg80211.rst
196197 F: Documentation/networking/regulatory.rst
197198 F: include/linux/ieee80211.h
@@ -1619,6 +1620,7 @@ M: Olof Johansson <olof@lixom.net> · 1421 unmodified lines
16191620 M: soc@kernel.org
16201621 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
16211622 S: Maintained
1623+C: irc://irc.libera.chat/armlinux
16221624 T: git git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
16231625 F: arch/arm/boot/dts/Makefile
16241626 F: arch/arm64/boot/dts/Makefile
@@ -1626,6 +1628,7 @@ F: arch/arm64/boot/dts/Makefile · 1 unmodified line
16261628 ARM SUB-ARCHITECTURES
16271629 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
16281630 S: Maintained
1631+C: irc://irc.libera.chat/armlinux
16291632 T: git git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
16301633 F: arch/arm/mach-*/
16311634 F: arch/arm/plat-*/
@@ -1779,6 +1782,7 @@ F: drivers/irqchip/irq-apple-aic.c · 147 unmodified lines
17791782 F: drivers/mailbox/apple-mailbox.c
17801783 F: drivers/pinctrl/pinctrl-apple-gpio.c
17811784 F: drivers/soc/apple/*
1785+F: drivers/watchdog/apple_wdt.c
17821786 F: include/dt-bindings/interrupt-controller/apple-aic.h
17831787 F: include/dt-bindings/pinctrl/apple.h
17841788 F: include/linux/apple-mailbox.h
@@ -2569,10 +2573,13 @@ N: rockchip · 784 unmodified lines
25692573
25702574 ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES
25712575 M: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2576+R: Alim Akhtar <alim.akhtar@samsung.com>
25722577 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
25732578 L: linux-samsung-soc@vger.kernel.org
25742579 S: Maintained
2580+C: irc://irc.libera.chat/linux-exynos
25752581 Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/
2582+T: git git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git
25762583 F: Documentation/arm/samsung/
25772584 F: Documentation/devicetree/bindings/arm/samsung/
25782585 F: Documentation/devicetree/bindings/power/pd-samsung.yaml
@@ -3132,11 +3139,9 @@ W: https://wireless.wiki.kernel.org/en/users/Drivers/ath5k · 553 unmodified lines
31323139 F: drivers/net/wireless/ath/ath5k/
31333140
31343141 ATHEROS ATH6KL WIRELESS DRIVER
3135−M: Kalle Valo <kvalo@kernel.org>
31363142 L: linux-wireless@vger.kernel.org
3137−S: Supported
3143+S: Orphan
31383144 W: https://wireless.wiki.kernel.org/en/users/Drivers/ath6kl
3139−T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
31403145 F: drivers/net/wireless/ath/ath6kl/
31413146
31423147 ATI_REMOTE2 DRIVER
@@ -4156,9 +4161,8 @@ N: csky · 1013 unmodified lines
41564161 K: csky
41574162
41584163 CA8210 IEEE-802.15.4 RADIO DRIVER
4159−M: Harry Morris <h.morris@cascoda.com>
41604164 L: linux-wpan@vger.kernel.org
4161−S: Maintained
4165+S: Orphan
41624166 W: https://github.com/Cascoda/ca8210-linux.git
41634167 F: Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
41644168 F: drivers/net/ieee802154/ca8210.c
@@ -4543,6 +4547,7 @@ F: drivers/platform/chrome/ · 378 unmodified lines
45434547
45444548 CHROMEOS EC CODEC DRIVER
45454549 M: Cheng-Yi Chiang <cychiang@chromium.org>
4550+M: Tzung-Bi Shih <tzungbi@google.com>
45464551 R: Guenter Roeck <groeck@chromium.org>
45474552 S: Maintained
45484553 F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
@@ -5772,7 +5777,7 @@ F: tools/testing/selftests/dma/ · 1223 unmodified lines
57725777
57735778 DMA-BUF HEAPS FRAMEWORK
57745779 M: Sumit Semwal <sumit.semwal@linaro.org>
5775−R: Benjamin Gaignard <benjamin.gaignard@linaro.org>
5780+R: Benjamin Gaignard <benjamin.gaignard@collabora.com>
57765781 R: Liam Mark <lmark@codeaurora.org>
57775782 R: Laura Abbott <labbott@redhat.com>
57785783 R: Brian Starkey <Brian.Starkey@arm.com>
@@ -6502,7 +6507,7 @@ F: Documentation/devicetree/bindings/display/rockchip/ · 723 unmodified lines
65026507 F: drivers/gpu/drm/rockchip/
65036508
65046509 DRM DRIVERS FOR STI
6505−M: Benjamin Gaignard <benjamin.gaignard@linaro.org>
6510+M: Alain Volmat <alain.volmat@foss.st.com>
65066511 L: dri-devel@lists.freedesktop.org
65076512 S: Maintained
65086513 T: git git://anongit.freedesktop.org/drm/drm-misc
@@ -6511,8 +6516,8 @@ F: drivers/gpu/drm/sti · 2 unmodified lines
65116516
65126517 DRM DRIVERS FOR STM
65136518 M: Yannick Fertre <yannick.fertre@foss.st.com>
6519+M: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
65146520 M: Philippe Cornu <philippe.cornu@foss.st.com>
6515−M: Benjamin Gaignard <benjamin.gaignard@linaro.org>
65166521 L: dri-devel@lists.freedesktop.org
65176522 S: Maintained
65186523 T: git git://anongit.freedesktop.org/drm/drm-misc
@@ -7182,7 +7187,7 @@ F: drivers/net/can/usb/etas_es58x/ · 663 unmodified lines
71827187
71837188 ETHERNET BRIDGE
71847189 M: Roopa Prabhu <roopa@nvidia.com>
7185−M: Nikolay Aleksandrov <nikolay@nvidia.com>
7190+M: Nikolay Aleksandrov <razor@blackwall.org>
71867191 L: bridge@lists.linux-foundation.org (moderated for non-subscribers)
71877192 L: netdev@vger.kernel.org
71887193 S: Maintained
@@ -7208,8 +7213,10 @@ F: drivers/net/mdio/of_mdio.c · 19 unmodified lines
72087213 F: drivers/net/pcs/
72097214 F: drivers/net/phy/
72107215 F: include/dt-bindings/net/qca-ar803x.h
7216+F: include/linux/linkmode.h
72117217 F: include/linux/*mdio*.h
72127218 F: include/linux/mdio/*.h
7219+F: include/linux/mii.h
72137220 F: include/linux/of_net.h
72147221 F: include/linux/phy.h
72157222 F: include/linux/phy_fixed.h
@@ -7573,6 +7580,12 @@ S: Maintained · 357 unmodified lines
75737580 W: http://floatingpoint.sourceforge.net/emulator/index.html
75747581 F: arch/x86/math-emu/
75757582
7583+FRAMEBUFFER CORE
7584+M: Daniel Vetter <daniel@ffwll.ch>
7585+F: drivers/video/fbdev/core/
7586+S: Odd Fixes
7587+T: git git://anongit.freedesktop.org/drm/drm-misc
7588+
75767589 FRAMEBUFFER LAYER
75777590 M: Helge Deller <deller@gmx.de>
75787591 L: linux-fbdev@vger.kernel.org
@@ -9250,6 +9263,15 @@ S: Maintained · 1671 unmodified lines
92509263 W: https://github.com/o2genum/ideapad-slidebar
92519264 F: drivers/input/misc/ideapad_slidebar.c
92529265
9266+IDMAPPED MOUNTS
9267+M: Christian Brauner <brauner@kernel.org>
9268+L: linux-fsdevel@vger.kernel.org
9269+S: Maintained
9270+T: git git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
9271+F: Documentation/filesystems/idmappings.rst
9272+F: tools/testing/selftests/mount_setattr/
9273+F: include/linux/mnt_idmapping.h
9274+
92539275 IDT VersaClock 5 CLOCK DRIVER
92549276 M: Luca Ceresoli <luca@lucaceresoli.net>
92559277 S: Maintained
@@ -10877,6 +10899,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git · 1621 unmodified lines
1087710899 F: drivers/ata/pata_arasan_cf.c
1087810900 F: include/linux/pata_arasan_cf_data.h
1087910901
10902+LIBATA PATA DRIVERS
10903+R: Sergey Shtylyov <s.shtylyov@omp.ru>
10904+L: linux-ide@vger.kernel.org
10905+F: drivers/ata/ata_*.c
10906+F: drivers/ata/pata_*.c
10907+
1088010908 LIBATA PATA FARADAY FTIDE010 AND GEMINI SATA BRIDGE DRIVERS
1088110909 M: Linus Walleij <linus.walleij@linaro.org>
1088210910 L: linux-ide@vger.kernel.org
@@ -11366,8 +11394,9 @@ M: Johannes Berg <johannes@sipsolutions.net> · 483 unmodified lines
1136611394 L: linux-wireless@vger.kernel.org
1136711395 S: Maintained
1136811396 W: https://wireless.wiki.kernel.org/
11369−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
11370−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
11397+Q: https://patchwork.kernel.org/project/linux-wireless/list/
11398+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
11399+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
1137111400 F: Documentation/networking/mac80211-injection.rst
1137211401 F: Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst
1137311402 F: drivers/net/wireless/mac80211_hwsim.[ch]
@@ -12396,7 +12425,7 @@ F: include/uapi/linux/membarrier.h · 1022 unmodified lines
1239612425 F: kernel/sched/membarrier.c
1239712426
1239812427 MEMBLOCK
12399−M: Mike Rapoport <rppt@linux.ibm.com>
12428+M: Mike Rapoport <rppt@kernel.org>
1240012429 L: linux-mm@kvack.org
1240112430 S: Maintained
1240212431 F: Documentation/core-api/boot-time-mm.rst
@@ -13294,8 +13323,8 @@ W: http://www.iptables.org/ · 891 unmodified lines
1329413323 W: http://www.nftables.org/
1329513324 Q: http://patchwork.ozlabs.org/project/netfilter-devel/list/
1329613325 C: irc://irc.libera.chat/netfilter
13297−T: git git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
13298−T: git git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git
13326+T: git git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
13327+T: git git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git
1329913328 F: include/linux/netfilter*
1330013329 F: include/linux/netfilter/
1330113330 F: include/net/netfilter/
@@ -13374,9 +13403,10 @@ NETWORKING DRIVERS (WIRELESS) · 72 unmodified lines
1337413403 M: Kalle Valo <kvalo@kernel.org>
1337513404 L: linux-wireless@vger.kernel.org
1337613405 S: Maintained
13377−Q: http://patchwork.kernel.org/project/linux-wireless/list/
13378−T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
13379−T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
13406+W: https://wireless.wiki.kernel.org/
13407+Q: https://patchwork.kernel.org/project/linux-wireless/list/
13408+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
13409+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
1338013410 F: Documentation/devicetree/bindings/net/wireless/
1338113411 F: drivers/net/wireless/
1338213412
@@ -13449,7 +13479,11 @@ L: netdev@vger.kernel.org · 66 unmodified lines
1344913479 S: Maintained
1345013480 T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
1345113481 F: arch/x86/net/*
13482+F: include/linux/ip.h
13483+F: include/linux/ipv6*
13484+F: include/net/fib*
1345213485 F: include/net/ip*
13486+F: include/net/route.h
1345313487 F: net/ipv4/
1345413488 F: net/ipv6/
1345513489
@@ -13510,10 +13544,6 @@ F: include/net/tls.h · 54 unmodified lines
1351013544 F: include/uapi/linux/tls.h
1351113545 F: net/tls/*
1351213546
13513−NETWORKING [WIRELESS]
13514−L: linux-wireless@vger.kernel.org
13515−Q: http://patchwork.kernel.org/project/linux-wireless/list/
13516−
1351713547 NETXEN (1/10) GbE SUPPORT
1351813548 M: Manish Chopra <manishc@marvell.com>
1351913549 M: Rahul Verma <rahulv@marvell.com>
@@ -13561,7 +13591,7 @@ F: tools/testing/selftests/nci/ · 41 unmodified lines
1356113591
1356213592 NFS, SUNRPC, AND LOCKD CLIENTS
1356313593 M: Trond Myklebust <trond.myklebust@hammerspace.com>
13564−M: Anna Schumaker <anna.schumaker@netapp.com>
13594+M: Anna Schumaker <anna@kernel.org>
1356513595 L: linux-nfs@vger.kernel.org
1356613596 S: Maintained
1356713597 W: http://client.linux-nfs.org
@@ -14379,6 +14409,7 @@ M: Rob Herring <robh+dt@kernel.org> · 811 unmodified lines
1437914409 M: Frank Rowand <frowand.list@gmail.com>
1438014410 L: devicetree@vger.kernel.org
1438114411 S: Maintained
14412+C: irc://irc.libera.chat/devicetree
1438214413 W: http://www.devicetree.org/
1438314414 T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
1438414415 F: Documentation/ABI/testing/sysfs-firmware-ofw
@@ -14390,6 +14421,7 @@ OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS · 5 unmodified lines
1439014421 M: Rob Herring <robh+dt@kernel.org>
1439114422 L: devicetree@vger.kernel.org
1439214423 S: Maintained
14424+C: irc://irc.libera.chat/devicetree
1439314425 Q: http://patchwork.ozlabs.org/project/devicetree-bindings/list/
1439414426 T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
1439514427 F: Documentation/devicetree/
@@ -15123,7 +15155,7 @@ M: Ingo Molnar <mingo@redhat.com> · 727 unmodified lines
1512315155 M: Arnaldo Carvalho de Melo <acme@kernel.org>
1512415156 R: Mark Rutland <mark.rutland@arm.com>
1512515157 R: Alexander Shishkin <alexander.shishkin@linux.intel.com>
15126−R: Jiri Olsa <jolsa@redhat.com>
15158+R: Jiri Olsa <jolsa@kernel.org>
1512715159 R: Namhyung Kim <namhyung@kernel.org>
1512815160 L: linux-perf-users@vger.kernel.org
1512915161 L: linux-kernel@vger.kernel.org
@@ -15280,9 +15312,11 @@ PIN CONTROLLER - SAMSUNG · 150 unmodified lines
1528015312 M: Tomasz Figa <tomasz.figa@gmail.com>
1528115313 M: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
1528215314 M: Sylwester Nawrocki <s.nawrocki@samsung.com>
15315+R: Alim Akhtar <alim.akhtar@samsung.com>
1528315316 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1528415317 L: linux-samsung-soc@vger.kernel.org
1528515318 S: Maintained
15319+C: irc://irc.libera.chat/linux-exynos
1528615320 Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/
1528715321 T: git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git
1528815322 F: Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
@@ -15887,6 +15921,7 @@ S: Supported · 598 unmodified lines
1588715921 W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
1588815922 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
1588915923 F: drivers/net/wireless/ath/ath10k/
15924+F: Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
1589015925
1589115926 QUALCOMM ATHEROS ATH11K WIRELESS DRIVER
1589215927 M: Kalle Valo <kvalo@kernel.org>
@@ -15894,11 +15929,12 @@ L: ath11k@lists.infradead.org · 1 unmodified line
1589415929 S: Supported
1589515930 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
1589615931 F: drivers/net/wireless/ath/ath11k/
15932+F: Documentation/devicetree/bindings/net/wireless/qcom,ath11k.txt
1589715933
1589815934 QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
15899−M: ath9k-devel@qca.qualcomm.com
15935+M: Toke Høiland-Jørgensen <toke@toke.dk>
1590015936 L: linux-wireless@vger.kernel.org
15901−S: Supported
15937+S: Maintained
1590215938 W: https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
1590315939 F: Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
1590415940 F: drivers/net/wireless/ath/ath9k/
@@ -15973,14 +16009,6 @@ F: Documentation/devicetree/bindings/misc/qcom,fastrpc.txt · 68 unmodified lines
1597316009 F: drivers/misc/fastrpc.c
1597416010 F: include/uapi/misc/fastrpc.h
1597516011
15976−QUALCOMM GENERIC INTERFACE I2C DRIVER
15977−M: Akash Asthana <akashast@codeaurora.org>
15978−M: Mukesh Savaliya <msavaliy@codeaurora.org>
15979−L: linux-i2c@vger.kernel.org
15980−L: linux-arm-msm@vger.kernel.org
15981−S: Supported
15982−F: drivers/i2c/busses/i2c-qcom-geni.c
15983−
1598416012 QUALCOMM HEXAGON ARCHITECTURE
1598516013 M: Brian Cain <bcain@codeaurora.org>
1598616014 L: linux-hexagon@vger.kernel.org
@@ -16079,11 +16107,10 @@ F: Documentation/devicetree/bindings/media/*venus* · 92 unmodified lines
1607916107 F: drivers/media/platform/qcom/venus/
1608016108
1608116109 QUALCOMM WCN36XX WIRELESS DRIVER
16082−M: Kalle Valo <kvalo@kernel.org>
16110+M: Loic Poulain <loic.poulain@linaro.org>
1608316111 L: wcn36xx@lists.infradead.org
1608416112 S: Supported
1608516113 W: https://wireless.wiki.kernel.org/en/users/Drivers/wcn36xx
16086−T: git git://github.com/KrasnikovEugene/wcn36xx.git
1608716114 F: drivers/net/wireless/ath/wcn36xx/
1608816115
1608916116 QUANTENNA QTNFMAC WIRELESS DRIVER
@@ -16465,6 +16492,14 @@ F: Documentation/devicetree/bindings/i2c/renesas,rmobile-iic.yaml · 375 unmodified lines
1646516492 F: drivers/i2c/busses/i2c-rcar.c
1646616493 F: drivers/i2c/busses/i2c-sh_mobile.c
1646716494
16495+RENESAS R-CAR SATA DRIVER
16496+R: Sergey Shtylyov <s.shtylyov@omp.ru>
16497+S: Supported
16498+L: linux-ide@vger.kernel.org
16499+L: linux-renesas-soc@vger.kernel.org
16500+F: Documentation/devicetree/bindings/ata/renesas,rcar-sata.yaml
16501+F: drivers/ata/sata_rcar.c
16502+
1646816503 RENESAS R-CAR THERMAL DRIVERS
1646916504 M: Niklas Söderlund <niklas.soderlund@ragnatech.se>
1647016505 L: linux-renesas-soc@vger.kernel.org
@@ -16533,8 +16568,9 @@ M: Johannes Berg <johannes@sipsolutions.net> · 62 unmodified lines
1653316568 L: linux-wireless@vger.kernel.org
1653416569 S: Maintained
1653516570 W: https://wireless.wiki.kernel.org/
16536−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
16537−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
16571+Q: https://patchwork.kernel.org/project/linux-wireless/list/
16572+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
16573+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
1653816574 F: Documentation/ABI/stable/sysfs-class-rfkill
1653916575 F: Documentation/driver-api/rfkill.rst
1654016576 F: include/linux/rfkill.h
@@ -16799,8 +16835,8 @@ F: drivers/video/fbdev/savage/ · 258 unmodified lines
1679916835 S390
1680016836 M: Heiko Carstens <hca@linux.ibm.com>
1680116837 M: Vasily Gorbik <gor@linux.ibm.com>
16802−M: Christian Borntraeger <borntraeger@linux.ibm.com>
16803−R: Alexander Gordeev <agordeev@linux.ibm.com>
16838+M: Alexander Gordeev <agordeev@linux.ibm.com>
16839+R: Christian Borntraeger <borntraeger@linux.ibm.com>
1680416840 R: Sven Schnelle <svens@linux.ibm.com>
1680516841 L: linux-s390@vger.kernel.org
1680616842 S: Supported
@@ -17071,6 +17107,7 @@ SAMSUNG SOC CLOCK DRIVERS · 264 unmodified lines
1707117107 M: Sylwester Nawrocki <s.nawrocki@samsung.com>
1707217108 M: Tomasz Figa <tomasz.figa@gmail.com>
1707317109 M: Chanwoo Choi <cw00.choi@samsung.com>
17110+R: Alim Akhtar <alim.akhtar@samsung.com>
1707417111 L: linux-samsung-soc@vger.kernel.org
1707517112 S: Supported
1707617113 T: git git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk.git
@@ -17707,6 +17744,21 @@ S: Maintained · 630 unmodified lines
1770717744 W: http://www.winischhofer.at/linuxsisusbvga.shtml
1770817745 F: drivers/usb/misc/sisusbvga/
1770917746
17747+SL28 CPLD MFD DRIVER
17748+M: Michael Walle <michael@walle.cc>
17749+S: Maintained
17750+F: Documentation/devicetree/bindings/gpio/kontron,sl28cpld-gpio.yaml
17751+F: Documentation/devicetree/bindings/hwmon/kontron,sl28cpld-hwmon.yaml
17752+F: Documentation/devicetree/bindings/interrupt-controller/kontron,sl28cpld-intc.yaml
17753+F: Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
17754+F: Documentation/devicetree/bindings/pwm/kontron,sl28cpld-pwm.yaml
17755+F: Documentation/devicetree/bindings/watchdog/kontron,sl28cpld-wdt.yaml
17756+F: drivers/gpio/gpio-sl28cpld.c
17757+F: drivers/hwmon/sl28cpld-hwmon.c
17758+F: drivers/irqchip/irq-sl28cpld.c
17759+F: drivers/pwm/pwm-sl28cpld.c
17760+F: drivers/watchdog/sl28cpld_wdt.c
17761+
1771017762 SLAB ALLOCATOR
1771117763 M: Christoph Lameter <cl@linux.com>
1771217764 M: Pekka Enberg <penberg@kernel.org>
@@ -18423,7 +18475,7 @@ F: Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt · 710 unmodified lines
1842318475 F: sound/soc/sti/
1842418476
1842518477 STI CEC DRIVER
18426−M: Benjamin Gaignard <benjamin.gaignard@linaro.org>
18478+M: Alain Volmat <alain.volmat@foss.st.com>
1842718479 S: Maintained
1842818480 F: Documentation/devicetree/bindings/media/stih-cec.txt
1842918481 F: drivers/media/cec/platform/sti/
@@ -19577,6 +19629,14 @@ F: Documentation/trace/timerlat-tracer.rst · 1147 unmodified lines
1957719629 F: Documentation/trace/hwlat_detector.rst
1957819630 F: arch/*/kernel/trace.c
1957919631
19632+Real-time Linux Analysis (RTLA) tools
19633+M: Daniel Bristot de Oliveira <bristot@kernel.org>
19634+M: Steven Rostedt <rostedt@goodmis.org>
19635+L: linux-trace-devel@vger.kernel.org
19636+S: Maintained
19637+F: Documentation/tools/rtla/
19638+F: tools/tracing/rtla/
19639+
1958019640 TRADITIONAL CHINESE DOCUMENTATION
1958119641 M: Hu Haowen <src.res@email.cn>
1958219642 L: linux-doc-tw-discuss@lists.sourceforge.net
Makefile+2−2
@@ -2,8 +2,8 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 17
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
6−NAME = Gobble Gobble
5+EXTRAVERSION = -rc5
6+NAME = Superb Owl
77
88 # *DOCUMENTATION*
99 # To see a list of typical targets execute "make help"
arch/arm/Kconfig+1−0
@@ -83,6 +83,7 @@ config ARM · 82 unmodified lines
8383 select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
8484 select HAVE_CONTEXT_TRACKING
8585 select HAVE_C_RECORDMCOUNT
86+ select HAVE_BUILDTIME_MCOUNT_SORT
8687 select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
8788 select HAVE_DMA_CONTIGUOUS if MMU
8889 select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
arch/arm/boot/dts/Makefile+1−0
@@ -806,6 +806,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += \ · 805 unmodified lines
806806 logicpd-som-lv-37xx-devkit.dtb \
807807 omap3430-sdp.dtb \
808808 omap3-beagle.dtb \
809+ omap3-beagle-ab4.dtb \
809810 omap3-beagle-xm.dtb \
810811 omap3-beagle-xm-ab.dtb \
811812 omap3-cm-t3517.dtb \
arch/arm/boot/dts/am335x-wega.dtsi+1−1
@@ -55,7 +55,7 @@ · 54 unmodified lines
5555 2 1 0 0 /* # 0: INACTIVE, 1: TX, 2: RX */
5656 >;
5757 tx-num-evt = <16>;
58− rt-num-evt = <16>;
58+ rx-num-evt = <16>;
5959 status = "okay";
6060 };
6161
arch/arm/boot/dts/dra7.dtsi+10−10
@@ -160,7 +160,7 @@ · 159 unmodified lines
160160 target-module@48210000 {
161161 compatible = "ti,sysc-omap4-simple", "ti,sysc";
162162 power-domains = <&prm_mpu>;
163− clocks = <&mpu_clkctrl DRA7_MPU_CLKCTRL 0>;
163+ clocks = <&mpu_clkctrl DRA7_MPU_MPU_CLKCTRL 0>;
164164 clock-names = "fck";
165165 #address-cells = <1>;
166166 #size-cells = <1>;
@@ -875,10 +875,10 @@ · 708 unmodified lines
875875 <0x58000014 4>;
876876 reg-names = "rev", "syss";
877877 ti,syss-mask = <1>;
878− clocks = <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 0>,
879− <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 9>,
880− <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 10>,
881− <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 11>;
878+ clocks = <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 0>,
879+ <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 9>,
880+ <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 10>,
881+ <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 11>;
882882 clock-names = "fck", "hdmi_clk", "sys_clk", "tv_clk";
883883 #address-cells = <1>;
884884 #size-cells = <1>;
@@ -912,7 +912,7 @@ · 27 unmodified lines
912912 SYSC_OMAP2_SOFTRESET |
913913 SYSC_OMAP2_AUTOIDLE)>;
914914 ti,syss-mask = <1>;
915− clocks = <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 8>;
915+ clocks = <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 8>;
916916 clock-names = "fck";
917917 #address-cells = <1>;
918918 #size-cells = <1>;
@@ -939,8 +939,8 @@ · 20 unmodified lines
939939 <SYSC_IDLE_SMART>,
940940 <SYSC_IDLE_SMART_WKUP>;
941941 ti,sysc-mask = <(SYSC_OMAP4_SOFTRESET)>;
942− clocks = <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 9>,
943− <&dss_clkctrl DRA7_DSS_CORE_CLKCTRL 8>;
942+ clocks = <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 9>,
943+ <&dss_clkctrl DRA7_DSS_DSS_CORE_CLKCTRL 8>;
944944 clock-names = "fck", "dss_clk";
945945 #address-cells = <1>;
946946 #size-cells = <1>;
@@ -979,7 +979,7 @@ · 32 unmodified lines
979979 compatible = "vivante,gc";
980980 reg = <0x0 0x700>;
981981 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
982− clocks = <&dss_clkctrl DRA7_BB2D_CLKCTRL 0>;
982+ clocks = <&dss_clkctrl DRA7_DSS_BB2D_CLKCTRL 0>;
983983 clock-names = "core";
984984 };
985985 };
@@ -1333,7 +1333,7 @@ · 347 unmodified lines
13331333 ti,no-reset-on-init;
13341334 ti,no-idle;
13351335 timer@0 {
1336− assigned-clocks = <&wkupaon_clkctrl DRA7_TIMER1_CLKCTRL 24>;
1336+ assigned-clocks = <&wkupaon_clkctrl DRA7_WKUPAON_TIMER1_CLKCTRL 24>;
13371337 assigned-clock-parents = <&sys_32k_ck>;
13381338 };
13391339 };
arch/arm/boot/dts/imx23-evk.dts+0−1
@@ -79,7 +79,6 @@ · 78 unmodified lines
7979 MX23_PAD_LCD_RESET__GPIO_1_18
8080 MX23_PAD_PWM3__GPIO_1_29
8181 MX23_PAD_PWM4__GPIO_1_30
82− MX23_PAD_SSP1_DETECT__SSP1_DETECT
8382 >;
8483 fsl,drive-strength = <MXS_DRIVE_4mA>;
8584 fsl,voltage = <MXS_VOLTAGE_HIGH>;
arch/arm/boot/dts/imx6qdl-udoo.dtsi+4−1
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 * Author: Fabio Estevam <fabio.estevam@freescale.com>
66 */
77
8+#include <dt-bindings/gpio/gpio.h>
9+
810 / {
911 aliases {
1012 backlight = &backlight;
@@ -226,6 +228,7 @@ · 215 unmodified lines
226228 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
227229 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
228230 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
231+ MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0
229232 >;
230233 };
231234
@@ -304,7 +307,7 @@ · 72 unmodified lines
304307 &usdhc3 {
305308 pinctrl-names = "default";
306309 pinctrl-0 = <&pinctrl_usdhc3>;
307− non-removable;
310+ cd-gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
308311 status = "okay";
309312 };
310313
arch/arm/boot/dts/imx7ulp.dtsi+1−1
@@ -259,7 +259,7 @@ · 258 unmodified lines
259259 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
260260 clocks = <&pcc2 IMX7ULP_CLK_WDG1>;
261261 assigned-clocks = <&pcc2 IMX7ULP_CLK_WDG1>;
262− assigned-clocks-parents = <&scg1 IMX7ULP_CLK_FIRC_BUS_CLK>;
262+ assigned-clock-parents = <&scg1 IMX7ULP_CLK_FIRC_BUS_CLK>;
263263 timeout-sec = <40>;
264264 };
265265
arch/arm/boot/dts/meson.dtsi+4−4
@@ -59,7 +59,7 @@ · 58 unmodified lines
5959 };
6060
6161 uart_A: serial@84c0 {
62− compatible = "amlogic,meson6-uart", "amlogic,meson-uart";
62+ compatible = "amlogic,meson6-uart";
6363 reg = <0x84c0 0x18>;
6464 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
6565 fifo-size = <128>;
@@ -67,7 +67,7 @@ · 1 unmodified line
6767 };
6868
6969 uart_B: serial@84dc {
70− compatible = "amlogic,meson6-uart", "amlogic,meson-uart";
70+ compatible = "amlogic,meson6-uart";
7171 reg = <0x84dc 0x18>;
7272 interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
7373 status = "disabled";
@@ -105,7 +105,7 @@ · 31 unmodified lines
105105 };
106106
107107 uart_C: serial@8700 {
108− compatible = "amlogic,meson6-uart", "amlogic,meson-uart";
108+ compatible = "amlogic,meson6-uart";
109109 reg = <0x8700 0x18>;
110110 interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
111111 status = "disabled";
@@ -228,7 +228,7 @@ · 116 unmodified lines
228228 };
229229
230230 uart_AO: serial@4c0 {
231− compatible = "amlogic,meson6-uart", "amlogic,meson-ao-uart", "amlogic,meson-uart";
231+ compatible = "amlogic,meson6-uart", "amlogic,meson-ao-uart";
232232 reg = <0x4c0 0x18>;
233233 interrupts = <GIC_SPI 90 IRQ_TYPE_EDGE_RISING>;
234234 status = "disabled";
arch/arm/boot/dts/meson8.dtsi+12−12
@@ -736,27 +736,27 @@ · 735 unmodified lines
736736 };
737737
738738 &uart_AO {
739− compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
740− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_CLK81>;
741− clock-names = "baud", "xtal", "pclk";
739+ compatible = "amlogic,meson8-uart", "amlogic,meson-ao-uart";
740+ clocks = <&xtal>, <&clkc CLKID_CLK81>, <&clkc CLKID_CLK81>;
741+ clock-names = "xtal", "pclk", "baud";
742742 };
743743
744744 &uart_A {
745− compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
746− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART0>;
747− clock-names = "baud", "xtal", "pclk";
745+ compatible = "amlogic,meson8-uart";
746+ clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>;
747+ clock-names = "xtal", "pclk", "baud";
748748 };
749749
750750 &uart_B {
751− compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
752− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART1>;
753− clock-names = "baud", "xtal", "pclk";
751+ compatible = "amlogic,meson8-uart";
752+ clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>;
753+ clock-names = "xtal", "pclk", "baud";
754754 };
755755
756756 &uart_C {
757− compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
758− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART2>;
759− clock-names = "baud", "xtal", "pclk";
757+ compatible = "amlogic,meson8-uart";
758+ clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>;
759+ clock-names = "xtal", "pclk", "baud";
760760 };
761761
762762 &usb0 {
arch/arm/boot/dts/meson8b.dtsi+12−12
@@ -724,27 +724,27 @@ · 723 unmodified lines
724724 };
725725
726726 &uart_AO {
727− compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
728− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_CLK81>;
729− clock-names = "baud", "xtal", "pclk";
727+ compatible = "amlogic,meson8b-uart", "amlogic,meson-ao-uart";
728+ clocks = <&xtal>, <&clkc CLKID_CLK81>, <&clkc CLKID_CLK81>;
729+ clock-names = "xtal", "pclk", "baud";
730730 };
731731
732732 &uart_A {
733− compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
734− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART0>;
735− clock-names = "baud", "xtal", "pclk";
733+ compatible = "amlogic,meson8b-uart";
734+ clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>;
735+ clock-names = "xtal", "pclk", "baud";
736736 };
737737
738738 &uart_B {
739− compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
740− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART1>;
741− clock-names = "baud", "xtal", "pclk";
739+ compatible = "amlogic,meson8b-uart";
740+ clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>;
741+ clock-names = "xtal", "pclk", "baud";
742742 };
743743
744744 &uart_C {
745− compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
746− clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART2>;
747− clock-names = "baud", "xtal", "pclk";
745+ compatible = "amlogic,meson8b-uart";
746+ clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>;
747+ clock-names = "xtal", "pclk", "baud";
748748 };
749749
750750 &usb0 {
arch/arm/boot/dts/omap3-beagle-ab4.dts+47−0
@@ -0,0 +1,47 @@
1+// SPDX-License-Identifier: GPL-2.0-only
2+/dts-v1/;
3+
4+#include "omap3-beagle.dts"
5+
6+/ {
7+ model = "TI OMAP3 BeagleBoard A to B4";
8+ compatible = "ti,omap3-beagle-ab4", "ti,omap3-beagle", "ti,omap3430", "ti,omap3";
9+};
10+
11+/*
12+ * Workaround for capacitor C70 issue, see "Boards revision A and < B5"
13+ * section at https://elinux.org/BeagleBoard_Community
14+ */
15+
16+/* Unusable as clocksource because of unreliable oscillator */
17+&counter32k {
18+ status = "disabled";
19+};
20+
21+/* Unusable as clockevent because of unreliable oscillator, allow to idle */
22+&timer1_target {
23+ /delete-property/ti,no-reset-on-init;
24+ /delete-property/ti,no-idle;
25+ timer@0 {
26+ /delete-property/ti,timer-alwon;
27+ };
28+};
29+
30+/* Preferred always-on timer for clocksource */
31+&timer12_target {
32+ ti,no-reset-on-init;
33+ ti,no-idle;
34+ timer@0 {
35+ /* Always clocked by secure_32k_fck */
36+ };
37+};
38+
39+/* Preferred timer for clockevent */
40+&timer2_target {
41+ ti,no-reset-on-init;
42+ ti,no-idle;
43+ timer@0 {
44+ assigned-clocks = <&gpt2_fck>;
45+ assigned-clock-parents = <&sys_ck>;
46+ };
47+};
arch/arm/boot/dts/omap3-beagle.dts+0−33
@@ -304,39 +304,6 @@ · 303 unmodified lines
304304 phys = <0 &hsusb2_phy>;
305305 };
306306
307−/* Unusable as clocksource because of unreliable oscillator */
308−&counter32k {
309− status = "disabled";
310−};
311−
312−/* Unusable as clockevent because if unreliable oscillator, allow to idle */
313−&timer1_target {
314− /delete-property/ti,no-reset-on-init;
315− /delete-property/ti,no-idle;
316− timer@0 {
317− /delete-property/ti,timer-alwon;
318− };
319−};
320−
321−/* Preferred always-on timer for clocksource */
322−&timer12_target {
323− ti,no-reset-on-init;
324− ti,no-idle;
325− timer@0 {
326− /* Always clocked by secure_32k_fck */
327− };
328−};
329−
330−/* Preferred timer for clockevent */
331−&timer2_target {
332− ti,no-reset-on-init;
333− ti,no-idle;
334− timer@0 {
335− assigned-clocks = <&gpt2_fck>;
336− assigned-clock-parents = <&sys_ck>;
337− };
338−};
339−
340307 &twl_gpio {
341308 ti,use-leds;
342309 /* pullups: BIT(1) */
arch/arm/boot/dts/spear320-hmi.dts+0−1
@@ -235,7 +235,6 @@ · 234 unmodified lines
235235 #address-cells = <1>;
236236 #size-cells = <0>;
237237 reg = <0x41>;
238− irq-over-gpio;
239238 irq-gpios = <&gpiopinctrl 29 0x4>;
240239 id = <0>;
241240 blocks = <0x5>;
arch/arm/boot/dts/ste-ux500-samsung-skomer.dts+0−4
@@ -185,10 +185,6 @@ · 184 unmodified lines
185185 cap-sd-highspeed;
186186 cap-mmc-highspeed;
187187 /* All direction control is used */
188− st,sig-dir-cmd;
189− st,sig-dir-dat0;
190− st,sig-dir-dat2;
191− st,sig-dir-dat31;
192188 st,sig-pin-fbclk;
193189 full-pwr-cycle;
194190 vmmc-supply = <&ab8500_ldo_aux3_reg>;
arch/arm/crypto/blake2s-shash.c+2−2
@@ -13,12 +13,12 @@ · 12 unmodified lines
1313 static int crypto_blake2s_update_arm(struct shash_desc *desc,
1414 const u8 *in, unsigned int inlen)
1515 {
16− return crypto_blake2s_update(desc, in, inlen, blake2s_compress);
16+ return crypto_blake2s_update(desc, in, inlen, false);
1717 }
1818
1919 static int crypto_blake2s_final_arm(struct shash_desc *desc, u8 *out)
2020 {
21− return crypto_blake2s_final(desc, out, blake2s_compress);
21+ return crypto_blake2s_final(desc, out, false);
2222 }
2323
2424 #define BLAKE2S_ALG(name, driver_name, digest_size) \
arch/arm/include/asm/assembler.h+2−0
@@ -288,6 +288,7 @@ · 287 unmodified lines
288288 */
289289 #define ALT_UP(instr...) \
290290 .pushsection ".alt.smp.init", "a" ;\
291+ .align 2 ;\
291292 .long 9998b - . ;\
292293 9997: instr ;\
293294 .if . - 9997b == 2 ;\
@@ -299,6 +300,7 @@ · 5 unmodified lines
299300 .popsection
300301 #define ALT_UP_B(label) \
301302 .pushsection ".alt.smp.init", "a" ;\
303+ .align 2 ;\
302304 .long 9998b - . ;\
303305 W(b) . + (label - 9998b) ;\
304306 .popsection
arch/arm/include/asm/processor.h+1−0
@@ -96,6 +96,7 @@ unsigned long __get_wchan(struct task_struct *p); · 95 unmodified lines
9696 #define __ALT_SMP_ASM(smp, up) \
9797 "9998: " smp "\n" \
9898 " .pushsection \".alt.smp.init\", \"a\"\n" \
99+ " .align 2\n" \
99100 " .long 9998b - .\n" \
100101 " " up "\n" \
101102 " .popsection\n"
arch/arm/include/asm/uaccess.h+8−2
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/string.h>
1212 #include <asm/memory.h>
1313 #include <asm/domain.h>
14+#include <asm/unaligned.h>
1415 #include <asm/unified.h>
1516 #include <asm/compiler.h>
1617
@@ -497,7 +498,10 @@ do { \ · 480 unmodified lines
497498 } \
498499 default: __err = __get_user_bad(); break; \
499500 } \
500− *(type *)(dst) = __val; \
501+ if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) \
502+ put_unaligned(__val, (type *)(dst)); \
503+ else \
504+ *(type *)(dst) = __val; /* aligned by caller */ \
501505 if (__err) \
502506 goto err_label; \
503507 } while (0)
@@ -507,7 +511,9 @@ do { \ · 3 unmodified lines
507511 const type *__pk_ptr = (dst); \
508512 unsigned long __dst = (unsigned long)__pk_ptr; \
509513 int __err = 0; \
510− type __val = *(type *)src; \
514+ type __val = IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) \
515+ ? get_unaligned((type *)(src)) \
516+ : *(type *)(src); /* aligned by caller */ \
511517 switch (sizeof(type)) { \
512518 case 1: __put_user_asm_byte(__val, __dst, __err, ""); break; \
513519 case 2: __put_user_asm_half(__val, __dst, __err, ""); break; \
arch/arm/mach-omap2/display.c+1−1
@@ -263,9 +263,9 @@ static int __init omapdss_init_of(void) · 262 unmodified lines
263263 }
264264
265265 r = of_platform_populate(node, NULL, NULL, &pdev->dev);
266+ put_device(&pdev->dev);
266267 if (r) {
267268 pr_err("Unable to populate DSS submodule devices\n");
268− put_device(&pdev->dev);
269269 return r;
270270 }
271271
arch/arm/mach-omap2/omap_hwmod.c+3−1
@@ -752,8 +752,10 @@ static int __init _init_clkctrl_providers(void) · 751 unmodified lines
752752
753753 for_each_matching_node(np, ti_clkctrl_match_table) {
754754 ret = _setup_clkctrl_provider(np);
755− if (ret)
755+ if (ret) {
756+ of_node_put(np);
756757 break;
758+ }
757759 }
758760
759761 return ret;
arch/arm/mach-socfpga/Kconfig+2−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 menuconfig ARCH_INTEL_SOCFPGA
33 bool "Altera SOCFPGA family"
44 depends on ARCH_MULTI_V7
5+ select ARCH_HAS_RESET_CONTROLLER
56 select ARCH_SUPPORTS_BIG_ENDIAN
67 select ARM_AMBA
78 select ARM_GIC
@@ -18,6 +19,7 @@ menuconfig ARCH_INTEL_SOCFPGA · 10 unmodified lines
1819 select PL310_ERRATA_727915
1920 select PL310_ERRATA_753970 if PL310
2021 select PL310_ERRATA_769419
22+ select RESET_CONTROLLER
2123
2224 if ARCH_INTEL_SOCFPGA
2325 config SOCFPGA_SUSPEND
arch/arm/probes/kprobes/Makefile+3−0
@@ -1,4 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
2+KASAN_SANITIZE_actions-common.o := n
3+KASAN_SANITIZE_actions-arm.o := n
4+KASAN_SANITIZE_actions-thumb.o := n
25 obj-$(CONFIG_KPROBES) += core.o actions-common.o checkers-common.o
36 obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
47 test-kprobes-objs := test-core.o
arch/arm64/Kconfig+92−6
@@ -671,15 +671,42 @@ config ARM64_ERRATUM_1508412 · 670 unmodified lines
671671 config ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
672672 bool
673673
674+config ARM64_ERRATUM_2051678
675+ bool "Cortex-A510: 2051678: disable Hardware Update of the page table dirty bit"
676+ default y
677+ help
678+ This options adds the workaround for ARM Cortex-A510 erratum ARM64_ERRATUM_2051678.
679+ Affected Coretex-A510 might not respect the ordering rules for
680+ hardware update of the page table's dirty bit. The workaround
681+ is to not enable the feature on affected CPUs.
682+
683+ If unsure, say Y.
684+
685+config ARM64_ERRATUM_2077057
686+ bool "Cortex-A510: 2077057: workaround software-step corrupting SPSR_EL2"
687+ help
688+ This option adds the workaround for ARM Cortex-A510 erratum 2077057.
689+ Affected Cortex-A510 may corrupt SPSR_EL2 when the a step exception is
690+ expected, but a Pointer Authentication trap is taken instead. The
691+ erratum causes SPSR_EL1 to be copied to SPSR_EL2, which could allow
692+ EL1 to cause a return to EL2 with a guest controlled ELR_EL2.
693+
694+ This can only happen when EL2 is stepping EL1.
695+
696+ When these conditions occur, the SPSR_EL2 value is unchanged from the
697+ previous guest entry, and can be restored from the in-memory copy.
698+
699+ If unsure, say Y.
700+
674701 config ARM64_ERRATUM_2119858
675− bool "Cortex-A710: 2119858: workaround TRBE overwriting trace data in FILL mode"
702+ bool "Cortex-A710/X2: 2119858: workaround TRBE overwriting trace data in FILL mode"
676703 default y
677704 depends on CORESIGHT_TRBE
678705 select ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
679706 help
680− This option adds the workaround for ARM Cortex-A710 erratum 2119858.
707+ This option adds the workaround for ARM Cortex-A710/X2 erratum 2119858.
681708
682− Affected Cortex-A710 cores could overwrite up to 3 cache lines of trace
709+ Affected Cortex-A710/X2 cores could overwrite up to 3 cache lines of trace
683710 data at the base of the buffer (pointed to by TRBASER_EL1) in FILL mode in
684711 the event of a WRAP event.
685712
@@ -762,14 +789,14 @@ config ARM64_ERRATUM_2253138 · 76 unmodified lines
762789 If unsure, say Y.
763790
764791 config ARM64_ERRATUM_2224489
765− bool "Cortex-A710: 2224489: workaround TRBE writing to address out-of-range"
792+ bool "Cortex-A710/X2: 2224489: workaround TRBE writing to address out-of-range"
766793 depends on CORESIGHT_TRBE
767794 default y
768795 select ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
769796 help
770− This option adds the workaround for ARM Cortex-A710 erratum 2224489.
797+ This option adds the workaround for ARM Cortex-A710/X2 erratum 2224489.
771798
772− Affected Cortex-A710 cores might write to an out-of-range address, not reserved
799+ Affected Cortex-A710/X2 cores might write to an out-of-range address, not reserved
773800 for TRBE. Under some conditions, the TRBE might generate a write to the next
774801 virtually addressed page following the last page of the TRBE address space
775802 (i.e., the TRBLIMITR_EL1.LIMIT), instead of wrapping around to the base.
@@ -779,6 +806,65 @@ config ARM64_ERRATUM_2224489 · 3 unmodified lines
779806
780807 If unsure, say Y.
781808
809+config ARM64_ERRATUM_2064142
810+ bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
811+ depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
812+ default y
813+ help
814+ This option adds the workaround for ARM Cortex-A510 erratum 2064142.
815+
816+ Affected Cortex-A510 core might fail to write into system registers after the
817+ TRBE has been disabled. Under some conditions after the TRBE has been disabled
818+ writes into TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1,
819+ and TRBTRG_EL1 will be ignored and will not be effected.
820+
821+ Work around this in the driver by executing TSB CSYNC and DSB after collection
822+ is stopped and before performing a system register write to one of the affected
823+ registers.
824+
825+ If unsure, say Y.
826+
827+config ARM64_ERRATUM_2038923
828+ bool "Cortex-A510: 2038923: workaround TRBE corruption with enable"
829+ depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
830+ default y
831+ help
832+ This option adds the workaround for ARM Cortex-A510 erratum 2038923.
833+
834+ Affected Cortex-A510 core might cause an inconsistent view on whether trace is
835+ prohibited within the CPU. As a result, the trace buffer or trace buffer state
836+ might be corrupted. This happens after TRBE buffer has been enabled by setting
837+ TRBLIMITR_EL1.E, followed by just a single context synchronization event before
838+ execution changes from a context, in which trace is prohibited to one where it
839+ isn't, or vice versa. In these mentioned conditions, the view of whether trace
840+ is prohibited is inconsistent between parts of the CPU, and the trace buffer or
841+ the trace buffer state might be corrupted.
842+
843+ Work around this in the driver by preventing an inconsistent view of whether the
844+ trace is prohibited or not based on TRBLIMITR_EL1.E by immediately following a
845+ change to TRBLIMITR_EL1.E with at least one ISB instruction before an ERET, or
846+ two ISB instructions if no ERET is to take place.
847+
848+ If unsure, say Y.
849+
850+config ARM64_ERRATUM_1902691
851+ bool "Cortex-A510: 1902691: workaround TRBE trace corruption"
852+ depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
853+ default y
854+ help
855+ This option adds the workaround for ARM Cortex-A510 erratum 1902691.
856+
857+ Affected Cortex-A510 core might cause trace data corruption, when being written
858+ into the memory. Effectively TRBE is broken and hence cannot be used to capture
859+ trace data.
860+
861+ Work around this problem in the driver by just preventing TRBE initialization on
862+ affected cpus. The firmware must have disabled the access to TRBE for the kernel
863+ on such implementations. This will cover the kernel for any firmware that doesn't
864+ do this already.
865+
866+ If unsure, say Y.
867+
782868 config CAVIUM_ERRATUM_22375
783869 bool "Cavium erratum 22375, 24313"
784870 default y
arch/arm64/Kconfig.platforms+0−3
@@ -309,9 +309,6 @@ config ARCH_VISCONTI · 308 unmodified lines
309309 help
310310 This enables support for Toshiba Visconti SoCs Family.
311311
312−config ARCH_VULCAN
313− def_bool n
314−
315312 config ARCH_XGENE
316313 bool "AppliedMicro X-Gene SOC Family"
317314 help
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi+6−0
@@ -107,6 +107,12 @@ · 106 unmodified lines
107107 no-map;
108108 };
109109
110+ /* 32 MiB reserved for ARM Trusted Firmware (BL32) */
111+ secmon_reserved_bl32: secmon@5300000 {
112+ reg = <0x0 0x05300000 0x0 0x2000000>;
113+ no-map;
114+ };
115+
110116 linux,cma {
111117 compatible = "shared-dma-pool";
112118 reusable;
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts+0−8
@@ -157,14 +157,6 @@ · 156 unmodified lines
157157 regulator-always-on;
158158 };
159159
160− reserved-memory {
161− /* TEE Reserved Memory */
162− bl32_reserved: bl32@5000000 {
163− reg = <0x0 0x05300000 0x0 0x2000000>;
164− no-map;
165− };
166− };
167−
168160 sdio_pwrseq: sdio-pwrseq {
169161 compatible = "mmc-pwrseq-simple";
170162 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi+2−2
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 rtc1 = &vrtc;
1818 };
1919
20− dioo2133: audio-amplifier-0 {
20+ dio2133: audio-amplifier-0 {
2121 compatible = "simple-audio-amplifier";
2222 enable-gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
2323 VCC-supply = <&vcc_5v>;
@@ -219,7 +219,7 @@ · 195 unmodified lines
219219 audio-widgets = "Line", "Lineout";
220220 audio-aux-devs = <&tdmout_b>, <&tdmout_c>, <&tdmin_a>,
221221 <&tdmin_b>, <&tdmin_c>, <&tdmin_lb>,
222− <&dioo2133>;
222+ <&dio2133>;
223223 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
224224 "TDMOUT_B IN 1", "FRDDR_B OUT 1",
225225 "TDMOUT_B IN 2", "FRDDR_C OUT 1",
arch/arm64/boot/dts/amlogic/meson-gx.dtsi+6−0
@@ -49,6 +49,12 @@ · 48 unmodified lines
4949 no-map;
5050 };
5151
52+ /* 32 MiB reserved for ARM Trusted Firmware (BL32) */
53+ secmon_reserved_bl32: secmon@5300000 {
54+ reg = <0x0 0x05300000 0x0 0x2000000>;
55+ no-map;
56+ };
57+
5258 linux,cma {
5359 compatible = "shared-dma-pool";
5460 reusable;
arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts+1−1
@@ -123,7 +123,7 @@ · 122 unmodified lines
123123 regulator-min-microvolt = <1800000>;
124124 regulator-max-microvolt = <3300000>;
125125
126− enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
126+ enable-gpio = <&gpio_ao GPIOE_2 GPIO_ACTIVE_HIGH>;
127127 enable-active-high;
128128 regulator-always-on;
129129
arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi+1−1
@@ -48,7 +48,7 @@ · 47 unmodified lines
4848 regulator-max-microvolt = <3300000>;
4949 vin-supply = <&vcc_5v>;
5050
51− enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
51+ enable-gpio = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
5252 enable-active-high;
5353 regulator-always-on;
5454
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts+0−8
@@ -203,14 +203,6 @@ · 202 unmodified lines
203203 regulator-always-on;
204204 };
205205
206− reserved-memory {
207− /* TEE Reserved Memory */
208− bl32_reserved: bl32@5000000 {
209− reg = <0x0 0x05300000 0x0 0x2000000>;
210− no-map;
211− };
212− };
213−
214206 sdio_pwrseq: sdio-pwrseq {
215207 compatible = "mmc-pwrseq-simple";
216208 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts+4−0
@@ -157,6 +157,10 @@ · 156 unmodified lines
157157 };
158158 };
159159
160+&ftm_alarm0 {
161+ status = "okay";
162+};
163+
160164 &gpio1 {
161165 gpio-line-names =
162166 "", "", "", "", "", "", "", "",
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi+2−2
@@ -1115,8 +1115,8 @@ · 1114 unmodified lines
11151115 status = "okay";
11161116
11171117 ports {
1118− port@1 {
1119− reg = <1>;
1118+ port@0 {
1119+ reg = <0>;
11201120
11211121 mipi1_sensor_ep: endpoint {
11221122 remote-endpoint = <&camera1_ep>;
arch/arm64/boot/dts/freescale/imx8mq.dtsi+5−5
@@ -554,7 +554,7 @@ · 553 unmodified lines
554554 assigned-clock-rates = <0>, <0>, <0>, <594000000>;
555555 status = "disabled";
556556
557− port@0 {
557+ port {
558558 lcdif_mipi_dsi: endpoint {
559559 remote-endpoint = <&mipi_dsi_lcdif_in>;
560560 };
@@ -1151,8 +1151,8 @@ · 590 unmodified lines
11511151 #address-cells = <1>;
11521152 #size-cells = <0>;
11531153
1154− port@0 {
1155− reg = <0>;
1154+ port@1 {
1155+ reg = <1>;
11561156
11571157 csi1_mipi_ep: endpoint {
11581158 remote-endpoint = <&csi1_ep>;
@@ -1203,8 +1203,8 @@ · 44 unmodified lines
12031203 #address-cells = <1>;
12041204 #size-cells = <0>;
12051205
1206− port@0 {
1207− reg = <0>;
1206+ port@1 {
1207+ reg = <1>;
12081208
12091209 csi2_mipi_ep: endpoint {
12101210 remote-endpoint = <&csi2_ep>;
arch/arm64/boot/dts/freescale/mba8mx.dtsi+1−1
@@ -91,7 +91,7 @@ · 90 unmodified lines
9191
9292 sound {
9393 compatible = "fsl,imx-audio-tlv320aic32x4";
94− model = "tqm-tlv320aic32";
94+ model = "imx-audio-tlv320aic32x4";
9595 ssi-controller = <&sai3>;
9696 audio-codec = <&tlv320aic3x04>;
9797 };
arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts+12−2
@@ -15,8 +15,18 @@ · 14 unmodified lines
1515 model = "Texas Instruments J721S2 EVM";
1616
1717 chosen {
18− stdout-path = "serial10:115200n8";
19− bootargs = "console=ttyS10,115200n8 earlycon=ns16550a,mmio32,2880000";
18+ stdout-path = "serial2:115200n8";
19+ bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,2880000";
20+ };
21+
22+ aliases {
23+ serial1 = &mcu_uart0;
24+ serial2 = &main_uart8;
25+ mmc0 = &main_sdhci0;
26+ mmc1 = &main_sdhci1;
27+ can0 = &main_mcan16;
28+ can1 = &mcu_mcan0;
29+ can2 = &mcu_mcan1;
2030 };
2131
2232 evm_12v0: fixedregulator-evm12v0 {
arch/arm64/boot/dts/ti/k3-j721s2.dtsi+0−22
@@ -21,28 +21,6 @@ · 20 unmodified lines
2121 #address-cells = <2>;
2222 #size-cells = <2>;
2323
24− aliases {
25− serial0 = &wkup_uart0;
26− serial1 = &mcu_uart0;
27− serial2 = &main_uart0;
28− serial3 = &main_uart1;
29− serial4 = &main_uart2;
30− serial5 = &main_uart3;
31− serial6 = &main_uart4;
32− serial7 = &main_uart5;
33− serial8 = &main_uart6;
34− serial9 = &main_uart7;
35− serial10 = &main_uart8;
36− serial11 = &main_uart9;
37− mmc0 = &main_sdhci0;
38− mmc1 = &main_sdhci1;
39− can0 = &main_mcan16;
40− can1 = &mcu_mcan0;
41− can2 = &mcu_mcan1;
42− can3 = &main_mcan3;
43− can4 = &main_mcan5;
44− };
45−
4624 chosen { };
4725
4826 cpus {
arch/arm64/include/asm/cputype.h+4−0
@@ -73,7 +73,9 @@ · 72 unmodified lines
7373 #define ARM_CPU_PART_CORTEX_A76 0xD0B
7474 #define ARM_CPU_PART_NEOVERSE_N1 0xD0C
7575 #define ARM_CPU_PART_CORTEX_A77 0xD0D
76+#define ARM_CPU_PART_CORTEX_A510 0xD46
7677 #define ARM_CPU_PART_CORTEX_A710 0xD47
78+#define ARM_CPU_PART_CORTEX_X2 0xD48
7779 #define ARM_CPU_PART_NEOVERSE_N2 0xD49
7880
7981 #define APM_CPU_PART_POTENZA 0x000
@@ -115,7 +117,9 @@ · 35 unmodified lines
115117 #define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
116118 #define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
117119 #define MIDR_CORTEX_A77 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A77)
120+#define MIDR_CORTEX_A510 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A510)
118121 #define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710)
122+#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)
119123 #define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)
120124 #define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
121125 #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
arch/arm64/include/asm/el2_setup.h+1−1
@@ -106,7 +106,7 @@ · 105 unmodified lines
106106 msr_s SYS_ICC_SRE_EL2, x0
107107 isb // Make sure SRE is now set
108108 mrs_s x0, SYS_ICC_SRE_EL2 // Read SRE back,
109− tbz x0, #0, 1f // and check that it sticks
109+ tbz x0, #0, .Lskip_gicv3_\@ // and check that it sticks
110110 msr_s SYS_ICH_HCR_EL2, xzr // Reset ICC_HCR_EL2 to defaults
111111 .Lskip_gicv3_\@:
112112 .endm
arch/arm64/kernel/cpu_errata.c+37−0
@@ -347,6 +347,7 @@ static const struct midr_range trbe_overwrite_fill_mode_cpus[] = { · 346 unmodified lines
347347 #endif
348348 #ifdef CONFIG_ARM64_ERRATUM_2119858
349349 MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
350+ MIDR_RANGE(MIDR_CORTEX_X2, 0, 0, 2, 0),
350351 #endif
351352 {},
352353 };
@@ -371,6 +372,7 @@ static struct midr_range trbe_write_out_of_range_cpus[] = { · 18 unmodified lines
371372 #endif
372373 #ifdef CONFIG_ARM64_ERRATUM_2224489
373374 MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
375+ MIDR_RANGE(MIDR_CORTEX_X2, 0, 0, 2, 0),
374376 #endif
375377 {},
376378 };
@@ -597,6 +599,41 @@ const struct arm64_cpu_capabilities arm64_errata[] = { · 220 unmodified lines
597599 .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
598600 CAP_MIDR_RANGE_LIST(trbe_write_out_of_range_cpus),
599601 },
602+#endif
603+#ifdef CONFIG_ARM64_ERRATUM_2077057
604+ {
605+ .desc = "ARM erratum 2077057",
606+ .capability = ARM64_WORKAROUND_2077057,
607+ .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
608+ ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
609+ },
610+#endif
611+#ifdef CONFIG_ARM64_ERRATUM_2064142
612+ {
613+ .desc = "ARM erratum 2064142",
614+ .capability = ARM64_WORKAROUND_2064142,
615+
616+ /* Cortex-A510 r0p0 - r0p2 */
617+ ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
618+ },
619+#endif
620+#ifdef CONFIG_ARM64_ERRATUM_2038923
621+ {
622+ .desc = "ARM erratum 2038923",
623+ .capability = ARM64_WORKAROUND_2038923,
624+
625+ /* Cortex-A510 r0p0 - r0p2 */
626+ ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
627+ },
628+#endif
629+#ifdef CONFIG_ARM64_ERRATUM_1902691
630+ {
631+ .desc = "ARM erratum 1902691",
632+ .capability = ARM64_WORKAROUND_1902691,
633+
634+ /* Cortex-A510 r0p0 - r0p1 */
635+ ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 1)
636+ },
600637 #endif
601638 {
602639 }
arch/arm64/kernel/cpufeature.c+3−0
@@ -1645,6 +1645,9 @@ static bool cpu_has_broken_dbm(void) · 1644 unmodified lines
16451645 MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
16461646 /* Kryo4xx Silver (rdpe => r1p0) */
16471647 MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe),
1648+#endif
1649+#ifdef CONFIG_ARM64_ERRATUM_2051678
1650+ MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
16481651 #endif
16491652 {},
16501653 };
arch/arm64/kernel/stacktrace.c+3−2
@@ -33,8 +33,8 @@ · 32 unmodified lines
3333 */
3434
3535
36−static void start_backtrace(struct stackframe *frame, unsigned long fp,
37− unsigned long pc)
36+static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
37+ unsigned long pc)
3838 {
3939 frame->fp = fp;
4040 frame->pc = pc;
@@ -55,6 +55,7 @@ static void start_backtrace(struct stackframe *frame, unsigned long fp, · 14 unmodified lines
5555 frame->prev_fp = 0;
5656 frame->prev_type = STACK_TYPE_UNKNOWN;
5757 }
58+NOKPROBE_SYMBOL(start_backtrace);
5859
5960 /*
6061 * Unwind from one frame record (A) to the next frame record (B).
arch/arm64/kernel/vdso/Makefile+4−1
@@ -29,8 +29,11 @@ ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \ · 28 unmodified lines
2929 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
3030 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
3131
32+# -Wmissing-prototypes and -Wmissing-declarations are removed from
33+# the CFLAGS of vgettimeofday.c to make possible to build the
34+# kernel with CONFIG_WERROR enabled.
3235 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) $(GCC_PLUGINS_CFLAGS) \
33− $(CC_FLAGS_LTO)
36+ $(CC_FLAGS_LTO) -Wmissing-prototypes -Wmissing-declarations
3437 KASAN_SANITIZE := n
3538 KCSAN_SANITIZE := n
3639 UBSAN_SANITIZE := n
arch/arm64/kvm/arm.c+33−18
@@ -797,6 +797,24 @@ static bool kvm_vcpu_exit_request(struct kvm_vcpu *vcpu, int *ret) · 796 unmodified lines
797797 xfer_to_guest_mode_work_pending();
798798 }
799799
800+/*
801+ * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
802+ * the vCPU is running.
803+ *
804+ * This must be noinstr as instrumentation may make use of RCU, and this is not
805+ * safe during the EQS.
806+ */
807+static int noinstr kvm_arm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
808+{
809+ int ret;
810+
811+ guest_state_enter_irqoff();
812+ ret = kvm_call_hyp_ret(__kvm_vcpu_run, vcpu);
813+ guest_state_exit_irqoff();
814+
815+ return ret;
816+}
817+
800818 /**
801819 * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code
802820 * @vcpu: The VCPU pointer
@@ -881,9 +899,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 78 unmodified lines
881899 * Enter the guest
882900 */
883901 trace_kvm_entry(*vcpu_pc(vcpu));
884− guest_enter_irqoff();
902+ guest_timing_enter_irqoff();
885903
886− ret = kvm_call_hyp_ret(__kvm_vcpu_run, vcpu);
904+ ret = kvm_arm_vcpu_enter_exit(vcpu);
887905
888906 vcpu->mode = OUTSIDE_GUEST_MODE;
889907 vcpu->stat.exits++;
@@ -918,26 +936,23 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 28 unmodified lines
918936 kvm_arch_vcpu_ctxsync_fp(vcpu);
919937
920938 /*
921− * We may have taken a host interrupt in HYP mode (ie
922− * while executing the guest). This interrupt is still
923− * pending, as we haven't serviced it yet!
939+ * We must ensure that any pending interrupts are taken before
940+ * we exit guest timing so that timer ticks are accounted as
941+ * guest time. Transiently unmask interrupts so that any
942+ * pending interrupts are taken.
924943 *
925− * We're now back in SVC mode, with interrupts
926− * disabled. Enabling the interrupts now will have
927− * the effect of taking the interrupt again, in SVC
928− * mode this time.
944+ * Per ARM DDI 0487G.b section D1.13.4, an ISB (or other
945+ * context synchronization event) is necessary to ensure that
946+ * pending interrupts are taken.
929947 */
930948 local_irq_enable();
949+ isb();
950+ local_irq_disable();
951+
952+ guest_timing_exit_irqoff();
953+
954+ local_irq_enable();
931955
932− /*
933− * We do local_irq_enable() before calling guest_exit() so
934− * that if a timer interrupt hits while running the guest we
935− * account that tick as being spent in the guest. We enable
936− * preemption after calling guest_exit() so that if we get
937− * preempted we make sure ticks after that is not counted as
938− * guest time.
939− */
940− guest_exit();
941956 trace_kvm_exit(ret, kvm_vcpu_trap_get_class(vcpu), *vcpu_pc(vcpu));
942957
943958 /* Exit types that need handling before we can be preempted */
arch/arm64/kvm/handle_exit.c+8−0
@@ -228,6 +228,14 @@ int handle_exit(struct kvm_vcpu *vcpu, int exception_index) · 227 unmodified lines
228228 {
229229 struct kvm_run *run = vcpu->run;
230230
231+ if (ARM_SERROR_PENDING(exception_index)) {
232+ /*
233+ * The SError is handled by handle_exit_early(). If the guest
234+ * survives it will re-execute the original instruction.
235+ */
236+ return 1;
237+ }
238+
231239 exception_index = ARM_EXCEPTION_CODE(exception_index);
232240
233241 switch (exception_index) {
arch/arm64/kvm/hyp/exception.c+4−1
@@ -38,7 +38,10 @@ static inline void __vcpu_write_sys_reg(struct kvm_vcpu *vcpu, u64 val, int reg) · 37 unmodified lines
3838
3939 static void __vcpu_write_spsr(struct kvm_vcpu *vcpu, u64 val)
4040 {
41− write_sysreg_el1(val, SYS_SPSR);
41+ if (has_vhe())
42+ write_sysreg_el1(val, SYS_SPSR);
43+ else
44+ __vcpu_sys_reg(vcpu, SPSR_EL1) = val;
4245 }
4346
4447 static void __vcpu_write_spsr_abt(struct kvm_vcpu *vcpu, u64 val)
arch/arm64/kvm/hyp/include/hyp/switch.h+21−2
@@ -402,6 +402,24 @@ static inline bool kvm_hyp_handle_exit(struct kvm_vcpu *vcpu, u64 *exit_code) · 401 unmodified lines
402402 return false;
403403 }
404404
405+static inline void synchronize_vcpu_pstate(struct kvm_vcpu *vcpu, u64 *exit_code)
406+{
407+ /*
408+ * Check for the conditions of Cortex-A510's #2077057. When these occur
409+ * SPSR_EL2 can't be trusted, but isn't needed either as it is
410+ * unchanged from the value in vcpu_gp_regs(vcpu)->pstate.
411+ * Are we single-stepping the guest, and took a PAC exception from the
412+ * active-not-pending state?
413+ */
414+ if (cpus_have_final_cap(ARM64_WORKAROUND_2077057) &&
415+ vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP &&
416+ *vcpu_cpsr(vcpu) & DBG_SPSR_SS &&
417+ ESR_ELx_EC(read_sysreg_el2(SYS_ESR)) == ESR_ELx_EC_PAC)
418+ write_sysreg_el2(*vcpu_cpsr(vcpu), SYS_SPSR);
419+
420+ vcpu->arch.ctxt.regs.pstate = read_sysreg_el2(SYS_SPSR);
421+}
422+
405423 /*
406424 * Return true when we were able to fixup the guest exit and should return to
407425 * the guest, false when we should restore the host state and return to the
@@ -413,7 +431,7 @@ static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code) · 5 unmodified lines
413431 * Save PSTATE early so that we can evaluate the vcpu mode
414432 * early on.
415433 */
416− vcpu->arch.ctxt.regs.pstate = read_sysreg_el2(SYS_SPSR);
434+ synchronize_vcpu_pstate(vcpu, exit_code);
417435
418436 /*
419437 * Check whether we want to repaint the state one way or
@@ -424,7 +442,8 @@ static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code) · 4 unmodified lines
424442 if (ARM_EXCEPTION_CODE(*exit_code) != ARM_EXCEPTION_IRQ)
425443 vcpu->arch.fault.esr_el2 = read_sysreg_el2(SYS_ESR);
426444
427− if (ARM_SERROR_PENDING(*exit_code)) {
445+ if (ARM_SERROR_PENDING(*exit_code) &&
446+ ARM_EXCEPTION_CODE(*exit_code) != ARM_EXCEPTION_IRQ) {
428447 u8 esr_ec = kvm_vcpu_trap_get_class(vcpu);
429448
430449 /*
arch/arm64/kvm/hyp/pgtable.c+6−12
@@ -983,13 +983,9 @@ static int stage2_unmap_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, · 982 unmodified lines
983983 */
984984 stage2_put_pte(ptep, mmu, addr, level, mm_ops);
985985
986− if (need_flush) {
987− kvm_pte_t *pte_follow = kvm_pte_follow(pte, mm_ops);
988−
989− dcache_clean_inval_poc((unsigned long)pte_follow,
990− (unsigned long)pte_follow +
991− kvm_granule_size(level));
992− }
986+ if (need_flush && mm_ops->dcache_clean_inval_poc)
987+ mm_ops->dcache_clean_inval_poc(kvm_pte_follow(pte, mm_ops),
988+ kvm_granule_size(level));
993989
994990 if (childp)
995991 mm_ops->put_page(childp);
@@ -1151,15 +1147,13 @@ static int stage2_flush_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, · 155 unmodified lines
11511147 struct kvm_pgtable *pgt = arg;
11521148 struct kvm_pgtable_mm_ops *mm_ops = pgt->mm_ops;
11531149 kvm_pte_t pte = *ptep;
1154− kvm_pte_t *pte_follow;
11551150
11561151 if (!kvm_pte_valid(pte) || !stage2_pte_cacheable(pgt, pte))
11571152 return 0;
11581153
1159− pte_follow = kvm_pte_follow(pte, mm_ops);
1160− dcache_clean_inval_poc((unsigned long)pte_follow,
1161− (unsigned long)pte_follow +
1162− kvm_granule_size(level));
1154+ if (mm_ops->dcache_clean_inval_poc)
1155+ mm_ops->dcache_clean_inval_poc(kvm_pte_follow(pte, mm_ops),
1156+ kvm_granule_size(level));
11631157 return 0;
11641158 }
11651159
arch/arm64/kvm/hyp/vgic-v3-sr.c+3−0
@@ -983,6 +983,9 @@ static void __vgic_v3_read_ctlr(struct kvm_vcpu *vcpu, u32 vmcr, int rt) · 982 unmodified lines
983983 val = ((vtr >> 29) & 7) << ICC_CTLR_EL1_PRI_BITS_SHIFT;
984984 /* IDbits */
985985 val |= ((vtr >> 23) & 7) << ICC_CTLR_EL1_ID_BITS_SHIFT;
986+ /* SEIS */
987+ if (kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK)
988+ val |= BIT(ICC_CTLR_EL1_SEIS_SHIFT);
986989 /* A3V */
987990 val |= ((vtr >> 21) & 1) << ICC_CTLR_EL1_A3V_SHIFT;
988991 /* EOImode */
arch/arm64/kvm/vgic/vgic-mmio.c+2−0
@@ -248,6 +248,8 @@ unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu, · 247 unmodified lines
248248 IRQCHIP_STATE_PENDING,
249249 &val);
250250 WARN_RATELIMIT(err, "IRQ %d", irq->host_irq);
251+ } else if (vgic_irq_is_mapped_level(irq)) {
252+ val = vgic_get_phys_line_level(irq);
251253 } else {
252254 val = irq_is_pending(irq);
253255 }
arch/arm64/kvm/vgic/vgic-v3.c+15−2
@@ -609,6 +609,18 @@ static int __init early_gicv4_enable(char *buf) · 608 unmodified lines
609609 }
610610 early_param("kvm-arm.vgic_v4_enable", early_gicv4_enable);
611611
612+static const struct midr_range broken_seis[] = {
613+ MIDR_ALL_VERSIONS(MIDR_APPLE_M1_ICESTORM),
614+ MIDR_ALL_VERSIONS(MIDR_APPLE_M1_FIRESTORM),
615+ {},
616+};
617+
618+static bool vgic_v3_broken_seis(void)
619+{
620+ return ((kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK) &&
621+ is_midr_in_range_list(read_cpuid_id(), broken_seis));
622+}
623+
612624 /**
613625 * vgic_v3_probe - probe for a VGICv3 compatible interrupt controller
614626 * @info: pointer to the GIC description
@@ -676,9 +688,10 @@ int vgic_v3_probe(const struct gic_kvm_info *info) · 61 unmodified lines
676688 group1_trap = true;
677689 }
678690
679− if (kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK) {
680− kvm_info("GICv3 with locally generated SEI\n");
691+ if (vgic_v3_broken_seis()) {
692+ kvm_info("GICv3 with broken locally generated SEI\n");
681693
694+ kvm_vgic_global_state.ich_vtr_el2 &= ~ICH_VTR_SEIS_MASK;
682695 group0_trap = true;
683696 group1_trap = true;
684697 if (ich_vtr_el2 & ICH_VTR_TDS_MASK)
arch/arm64/mm/extable.c+2−2
@@ -40,8 +40,8 @@ static bool · 39 unmodified lines
4040 ex_handler_load_unaligned_zeropad(const struct exception_table_entry *ex,
4141 struct pt_regs *regs)
4242 {
43− int reg_data = FIELD_GET(EX_DATA_REG_DATA, ex->type);
44− int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->type);
43+ int reg_data = FIELD_GET(EX_DATA_REG_DATA, ex->data);
44+ int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->data);
4545 unsigned long data, addr, offset;
4646
4747 addr = pt_regs_read_reg(regs, reg_addr);
arch/arm64/tools/cpucaps+4−0
@@ -55,6 +55,10 @@ WORKAROUND_1418040 · 54 unmodified lines
5555 WORKAROUND_1463225
5656 WORKAROUND_1508412
5757 WORKAROUND_1542419
58+WORKAROUND_1902691
59+WORKAROUND_2038923
60+WORKAROUND_2064142
61+WORKAROUND_2077057
5862 WORKAROUND_TRBE_OVERWRITE_FILL_MODE
5963 WORKAROUND_TSB_FLUSH_FAILURE
6064 WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
arch/ia64/Kconfig+1−1
@@ -318,7 +318,7 @@ config ARCH_PROC_KCORE_TEXT · 317 unmodified lines
318318 depends on PROC_KCORE
319319
320320 config IA64_MCA_RECOVERY
321− tristate "MCA recovery from errors other than TLB."
321+ bool "MCA recovery from errors other than TLB."
322322
323323 config IA64_PALINFO
324324 tristate "/proc/pal support"
arch/ia64/pci/fixup.c+2−2
@@ -76,5 +76,5 @@ static void pci_fixup_video(struct pci_dev *pdev) · 75 unmodified lines
7676 }
7777 }
7878 }
79−DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
80− PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
79+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID,
80+ PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
arch/mips/boot/dts/ingenic/ci20.dts+2−13
@@ -83,6 +83,8 @@ · 82 unmodified lines
8383 label = "HDMI OUT";
8484 type = "a";
8585
86+ ddc-en-gpios = <&gpa 25 GPIO_ACTIVE_HIGH>;
87+
8688 port {
8789 hdmi_con: endpoint {
8890 remote-endpoint = <&dw_hdmi_out>;
@@ -114,17 +116,6 @@ · 25 unmodified lines
114116 gpio = <&gpf 14 GPIO_ACTIVE_LOW>;
115117 enable-active-high;
116118 };
117−
118− hdmi_power: fixedregulator@3 {
119− compatible = "regulator-fixed";
120−
121− regulator-name = "hdmi_power";
122− regulator-min-microvolt = <5000000>;
123− regulator-max-microvolt = <5000000>;
124−
125− gpio = <&gpa 25 0>;
126− enable-active-high;
127− };
128119 };
129120
130121 &ext {
@@ -576,8 +567,6 @@ · 445 unmodified lines
576567 pinctrl-names = "default";
577568 pinctrl-0 = <&pins_hdmi_ddc>;
578569
579− hdmi-5v-supply = <&hdmi_power>;
580−
581570 ports {
582571 #address-cells = <1>;
583572 #size-cells = <0>;
arch/mips/cavium-octeon/octeon-memcpy.S+1−1
@@ -74,7 +74,7 @@ · 73 unmodified lines
7474 #define EXC(inst_reg,addr,handler) \
7575 9: inst_reg, addr; \
7676 .section __ex_table,"a"; \
77− PTR 9b, handler; \
77+ PTR_WD 9b, handler; \
7878 .previous
7979
8080 /*
arch/mips/include/asm/asm.h+2−2
@@ -285,7 +285,7 @@ symbol = value · 284 unmodified lines
285285
286286 #define PTR_SCALESHIFT 2
287287
288−#define PTR .word
288+#define PTR_WD .word
289289 #define PTRSIZE 4
290290 #define PTRLOG 2
291291 #endif
@@ -310,7 +310,7 @@ symbol = value · 18 unmodified lines
310310
311311 #define PTR_SCALESHIFT 3
312312
313−#define PTR .dword
313+#define PTR_WD .dword
314314 #define PTRSIZE 8
315315 #define PTRLOG 3
316316 #endif
arch/mips/include/asm/ftrace.h+2−2
@@ -32,7 +32,7 @@ do { \ · 31 unmodified lines
3232 ".previous\n" \
3333 \
3434 ".section\t__ex_table,\"a\"\n\t" \
35− STR(PTR) "\t1b, 3b\n\t" \
35+ STR(PTR_WD) "\t1b, 3b\n\t" \
3636 ".previous\n" \
3737 \
3838 : [tmp_dst] "=&r" (dst), [tmp_err] "=r" (error)\
@@ -54,7 +54,7 @@ do { \ · 15 unmodified lines
5454 ".previous\n" \
5555 \
5656 ".section\t__ex_table,\"a\"\n\t"\
57− STR(PTR) "\t1b, 3b\n\t" \
57+ STR(PTR_WD) "\t1b, 3b\n\t" \
5858 ".previous\n" \
5959 \
6060 : [tmp_err] "=r" (error) \
arch/mips/include/asm/r4kcache.h+2−2
@@ -119,7 +119,7 @@ static inline void flush_scache_line(unsigned long addr) · 118 unmodified lines
119119 " j 2b \n" \
120120 " .previous \n" \
121121 " .section __ex_table,\"a\" \n" \
122− " "STR(PTR)" 1b, 3b \n" \
122+ " "STR(PTR_WD)" 1b, 3b \n" \
123123 " .previous" \
124124 : "+r" (__err) \
125125 : "i" (op), "r" (addr), "i" (-EFAULT)); \
@@ -142,7 +142,7 @@ static inline void flush_scache_line(unsigned long addr) · 16 unmodified lines
142142 " j 2b \n" \
143143 " .previous \n" \
144144 " .section __ex_table,\"a\" \n" \
145− " "STR(PTR)" 1b, 3b \n" \
145+ " "STR(PTR_WD)" 1b, 3b \n" \
146146 " .previous" \
147147 : "+r" (__err) \
148148 : "i" (op), "r" (addr), "i" (-EFAULT)); \
arch/mips/include/asm/unaligned-emul.h+88−88
@@ -20,8 +20,8 @@ do { \ · 19 unmodified lines
2020 "j\t3b\n\t" \
2121 ".previous\n\t" \
2222 ".section\t__ex_table,\"a\"\n\t" \
23− STR(PTR)"\t1b, 4b\n\t" \
24− STR(PTR)"\t2b, 4b\n\t" \
23+ STR(PTR_WD)"\t1b, 4b\n\t" \
24+ STR(PTR_WD)"\t2b, 4b\n\t" \
2525 ".previous" \
2626 : "=&r" (value), "=r" (res) \
2727 : "r" (addr), "i" (-EFAULT)); \
@@ -41,8 +41,8 @@ do { \ · 13 unmodified lines
4141 "j\t3b\n\t" \
4242 ".previous\n\t" \
4343 ".section\t__ex_table,\"a\"\n\t" \
44− STR(PTR)"\t1b, 4b\n\t" \
45− STR(PTR)"\t2b, 4b\n\t" \
44+ STR(PTR_WD)"\t1b, 4b\n\t" \
45+ STR(PTR_WD)"\t2b, 4b\n\t" \
4646 ".previous" \
4747 : "=&r" (value), "=r" (res) \
4848 : "r" (addr), "i" (-EFAULT)); \
@@ -74,10 +74,10 @@ do { \ · 25 unmodified lines
7474 "j\t10b\n\t" \
7575 ".previous\n\t" \
7676 ".section\t__ex_table,\"a\"\n\t" \
77− STR(PTR)"\t1b, 11b\n\t" \
78− STR(PTR)"\t2b, 11b\n\t" \
79− STR(PTR)"\t3b, 11b\n\t" \
80− STR(PTR)"\t4b, 11b\n\t" \
77+ STR(PTR_WD)"\t1b, 11b\n\t" \
78+ STR(PTR_WD)"\t2b, 11b\n\t" \
79+ STR(PTR_WD)"\t3b, 11b\n\t" \
80+ STR(PTR_WD)"\t4b, 11b\n\t" \
8181 ".previous" \
8282 : "=&r" (value), "=r" (res) \
8383 : "r" (addr), "i" (-EFAULT)); \
@@ -102,8 +102,8 @@ do { \ · 18 unmodified lines
102102 "j\t3b\n\t" \
103103 ".previous\n\t" \
104104 ".section\t__ex_table,\"a\"\n\t" \
105− STR(PTR)"\t1b, 4b\n\t" \
106− STR(PTR)"\t2b, 4b\n\t" \
105+ STR(PTR_WD)"\t1b, 4b\n\t" \
106+ STR(PTR_WD)"\t2b, 4b\n\t" \
107107 ".previous" \
108108 : "=&r" (value), "=r" (res) \
109109 : "r" (addr), "i" (-EFAULT)); \
@@ -125,8 +125,8 @@ do { \ · 15 unmodified lines
125125 "j\t3b\n\t" \
126126 ".previous\n\t" \
127127 ".section\t__ex_table,\"a\"\n\t" \
128− STR(PTR)"\t1b, 4b\n\t" \
129− STR(PTR)"\t2b, 4b\n\t" \
128+ STR(PTR_WD)"\t1b, 4b\n\t" \
129+ STR(PTR_WD)"\t2b, 4b\n\t" \
130130 ".previous" \
131131 : "=&r" (value), "=r" (res) \
132132 : "r" (addr), "i" (-EFAULT)); \
@@ -145,8 +145,8 @@ do { \ · 12 unmodified lines
145145 "j\t3b\n\t" \
146146 ".previous\n\t" \
147147 ".section\t__ex_table,\"a\"\n\t" \
148− STR(PTR)"\t1b, 4b\n\t" \
149− STR(PTR)"\t2b, 4b\n\t" \
148+ STR(PTR_WD)"\t1b, 4b\n\t" \
149+ STR(PTR_WD)"\t2b, 4b\n\t" \
150150 ".previous" \
151151 : "=&r" (value), "=r" (res) \
152152 : "r" (addr), "i" (-EFAULT)); \
@@ -178,10 +178,10 @@ do { \ · 25 unmodified lines
178178 "j\t10b\n\t" \
179179 ".previous\n\t" \
180180 ".section\t__ex_table,\"a\"\n\t" \
181− STR(PTR)"\t1b, 11b\n\t" \
182− STR(PTR)"\t2b, 11b\n\t" \
183− STR(PTR)"\t3b, 11b\n\t" \
184− STR(PTR)"\t4b, 11b\n\t" \
181+ STR(PTR_WD)"\t1b, 11b\n\t" \
182+ STR(PTR_WD)"\t2b, 11b\n\t" \
183+ STR(PTR_WD)"\t3b, 11b\n\t" \
184+ STR(PTR_WD)"\t4b, 11b\n\t" \
185185 ".previous" \
186186 : "=&r" (value), "=r" (res) \
187187 : "r" (addr), "i" (-EFAULT)); \
@@ -223,14 +223,14 @@ do { \ · 35 unmodified lines
223223 "j\t10b\n\t" \
224224 ".previous\n\t" \
225225 ".section\t__ex_table,\"a\"\n\t" \
226− STR(PTR)"\t1b, 11b\n\t" \
227− STR(PTR)"\t2b, 11b\n\t" \
228− STR(PTR)"\t3b, 11b\n\t" \
229− STR(PTR)"\t4b, 11b\n\t" \
230− STR(PTR)"\t5b, 11b\n\t" \
231− STR(PTR)"\t6b, 11b\n\t" \
232− STR(PTR)"\t7b, 11b\n\t" \
233− STR(PTR)"\t8b, 11b\n\t" \
226+ STR(PTR_WD)"\t1b, 11b\n\t" \
227+ STR(PTR_WD)"\t2b, 11b\n\t" \
228+ STR(PTR_WD)"\t3b, 11b\n\t" \
229+ STR(PTR_WD)"\t4b, 11b\n\t" \
230+ STR(PTR_WD)"\t5b, 11b\n\t" \
231+ STR(PTR_WD)"\t6b, 11b\n\t" \
232+ STR(PTR_WD)"\t7b, 11b\n\t" \
233+ STR(PTR_WD)"\t8b, 11b\n\t" \
234234 ".previous" \
235235 : "=&r" (value), "=r" (res) \
236236 : "r" (addr), "i" (-EFAULT)); \
@@ -255,8 +255,8 @@ do { \ · 18 unmodified lines
255255 "j\t3b\n\t" \
256256 ".previous\n\t" \
257257 ".section\t__ex_table,\"a\"\n\t" \
258− STR(PTR)"\t1b, 4b\n\t" \
259− STR(PTR)"\t2b, 4b\n\t" \
258+ STR(PTR_WD)"\t1b, 4b\n\t" \
259+ STR(PTR_WD)"\t2b, 4b\n\t" \
260260 ".previous" \
261261 : "=r" (res) \
262262 : "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -276,8 +276,8 @@ do { \ · 13 unmodified lines
276276 "j\t3b\n\t" \
277277 ".previous\n\t" \
278278 ".section\t__ex_table,\"a\"\n\t" \
279− STR(PTR)"\t1b, 4b\n\t" \
280− STR(PTR)"\t2b, 4b\n\t" \
279+ STR(PTR_WD)"\t1b, 4b\n\t" \
280+ STR(PTR_WD)"\t2b, 4b\n\t" \
281281 ".previous" \
282282 : "=r" (res) \
283283 : "r" (value), "r" (addr), "i" (-EFAULT)); \
@@ -296,8 +296,8 @@ do { \ · 12 unmodified lines
296296 "j\t3b\n\t" \
297297 ".previous\n\t" \
298298 ".section\t__ex_table,\"a\"\n\t" \
299− STR(PTR)"\t1b, 4b\n\t" \
300− STR(PTR)"\t2b, 4b\n\t" \
299+ STR(PTR_WD)"\t1b, 4b\n\t" \
300+ STR(PTR_WD)"\t2b, 4b\n\t" \
301301 ".previous" \
302302 : "=r" (res) \
303303 : "r" (value), "r" (addr), "i" (-EFAULT)); \
@@ -325,10 +325,10 @@ do { \ · 21 unmodified lines
325325 "j\t10b\n\t" \
326326 ".previous\n\t" \
327327 ".section\t__ex_table,\"a\"\n\t" \
328− STR(PTR)"\t1b, 11b\n\t" \
329− STR(PTR)"\t2b, 11b\n\t" \
330− STR(PTR)"\t3b, 11b\n\t" \
331− STR(PTR)"\t4b, 11b\n\t" \
328+ STR(PTR_WD)"\t1b, 11b\n\t" \
329+ STR(PTR_WD)"\t2b, 11b\n\t" \
330+ STR(PTR_WD)"\t3b, 11b\n\t" \
331+ STR(PTR_WD)"\t4b, 11b\n\t" \
332332 ".previous" \
333333 : "=&r" (res) \
334334 : "r" (value), "r" (addr), "i" (-EFAULT) \
@@ -365,14 +365,14 @@ do { \ · 30 unmodified lines
365365 "j\t10b\n\t" \
366366 ".previous\n\t" \
367367 ".section\t__ex_table,\"a\"\n\t" \
368− STR(PTR)"\t1b, 11b\n\t" \
369− STR(PTR)"\t2b, 11b\n\t" \
370− STR(PTR)"\t3b, 11b\n\t" \
371− STR(PTR)"\t4b, 11b\n\t" \
372− STR(PTR)"\t5b, 11b\n\t" \
373− STR(PTR)"\t6b, 11b\n\t" \
374− STR(PTR)"\t7b, 11b\n\t" \
375− STR(PTR)"\t8b, 11b\n\t" \
368+ STR(PTR_WD)"\t1b, 11b\n\t" \
369+ STR(PTR_WD)"\t2b, 11b\n\t" \
370+ STR(PTR_WD)"\t3b, 11b\n\t" \
371+ STR(PTR_WD)"\t4b, 11b\n\t" \
372+ STR(PTR_WD)"\t5b, 11b\n\t" \
373+ STR(PTR_WD)"\t6b, 11b\n\t" \
374+ STR(PTR_WD)"\t7b, 11b\n\t" \
375+ STR(PTR_WD)"\t8b, 11b\n\t" \
376376 ".previous" \
377377 : "=&r" (res) \
378378 : "r" (value), "r" (addr), "i" (-EFAULT) \
@@ -398,8 +398,8 @@ do { \ · 19 unmodified lines
398398 "j\t3b\n\t" \
399399 ".previous\n\t" \
400400 ".section\t__ex_table,\"a\"\n\t" \
401− STR(PTR)"\t1b, 4b\n\t" \
402− STR(PTR)"\t2b, 4b\n\t" \
401+ STR(PTR_WD)"\t1b, 4b\n\t" \
402+ STR(PTR_WD)"\t2b, 4b\n\t" \
403403 ".previous" \
404404 : "=&r" (value), "=r" (res) \
405405 : "r" (addr), "i" (-EFAULT)); \
@@ -419,8 +419,8 @@ do { \ · 13 unmodified lines
419419 "j\t3b\n\t" \
420420 ".previous\n\t" \
421421 ".section\t__ex_table,\"a\"\n\t" \
422− STR(PTR)"\t1b, 4b\n\t" \
423− STR(PTR)"\t2b, 4b\n\t" \
422+ STR(PTR_WD)"\t1b, 4b\n\t" \
423+ STR(PTR_WD)"\t2b, 4b\n\t" \
424424 ".previous" \
425425 : "=&r" (value), "=r" (res) \
426426 : "r" (addr), "i" (-EFAULT)); \
@@ -452,10 +452,10 @@ do { \ · 25 unmodified lines
452452 "j\t10b\n\t" \
453453 ".previous\n\t" \
454454 ".section\t__ex_table,\"a\"\n\t" \
455− STR(PTR)"\t1b, 11b\n\t" \
456− STR(PTR)"\t2b, 11b\n\t" \
457− STR(PTR)"\t3b, 11b\n\t" \
458− STR(PTR)"\t4b, 11b\n\t" \
455+ STR(PTR_WD)"\t1b, 11b\n\t" \
456+ STR(PTR_WD)"\t2b, 11b\n\t" \
457+ STR(PTR_WD)"\t3b, 11b\n\t" \
458+ STR(PTR_WD)"\t4b, 11b\n\t" \
459459 ".previous" \
460460 : "=&r" (value), "=r" (res) \
461461 : "r" (addr), "i" (-EFAULT)); \
@@ -481,8 +481,8 @@ do { \ · 19 unmodified lines
481481 "j\t3b\n\t" \
482482 ".previous\n\t" \
483483 ".section\t__ex_table,\"a\"\n\t" \
484− STR(PTR)"\t1b, 4b\n\t" \
485− STR(PTR)"\t2b, 4b\n\t" \
484+ STR(PTR_WD)"\t1b, 4b\n\t" \
485+ STR(PTR_WD)"\t2b, 4b\n\t" \
486486 ".previous" \
487487 : "=&r" (value), "=r" (res) \
488488 : "r" (addr), "i" (-EFAULT)); \
@@ -504,8 +504,8 @@ do { \ · 15 unmodified lines
504504 "j\t3b\n\t" \
505505 ".previous\n\t" \
506506 ".section\t__ex_table,\"a\"\n\t" \
507− STR(PTR)"\t1b, 4b\n\t" \
508− STR(PTR)"\t2b, 4b\n\t" \
507+ STR(PTR_WD)"\t1b, 4b\n\t" \
508+ STR(PTR_WD)"\t2b, 4b\n\t" \
509509 ".previous" \
510510 : "=&r" (value), "=r" (res) \
511511 : "r" (addr), "i" (-EFAULT)); \
@@ -524,8 +524,8 @@ do { \ · 12 unmodified lines
524524 "j\t3b\n\t" \
525525 ".previous\n\t" \
526526 ".section\t__ex_table,\"a\"\n\t" \
527− STR(PTR)"\t1b, 4b\n\t" \
528− STR(PTR)"\t2b, 4b\n\t" \
527+ STR(PTR_WD)"\t1b, 4b\n\t" \
528+ STR(PTR_WD)"\t2b, 4b\n\t" \
529529 ".previous" \
530530 : "=&r" (value), "=r" (res) \
531531 : "r" (addr), "i" (-EFAULT)); \
@@ -557,10 +557,10 @@ do { \ · 25 unmodified lines
557557 "j\t10b\n\t" \
558558 ".previous\n\t" \
559559 ".section\t__ex_table,\"a\"\n\t" \
560− STR(PTR)"\t1b, 11b\n\t" \
561− STR(PTR)"\t2b, 11b\n\t" \
562− STR(PTR)"\t3b, 11b\n\t" \
563− STR(PTR)"\t4b, 11b\n\t" \
560+ STR(PTR_WD)"\t1b, 11b\n\t" \
561+ STR(PTR_WD)"\t2b, 11b\n\t" \
562+ STR(PTR_WD)"\t3b, 11b\n\t" \
563+ STR(PTR_WD)"\t4b, 11b\n\t" \
564564 ".previous" \
565565 : "=&r" (value), "=r" (res) \
566566 : "r" (addr), "i" (-EFAULT)); \
@@ -602,14 +602,14 @@ do { \ · 35 unmodified lines
602602 "j\t10b\n\t" \
603603 ".previous\n\t" \
604604 ".section\t__ex_table,\"a\"\n\t" \
605− STR(PTR)"\t1b, 11b\n\t" \
606− STR(PTR)"\t2b, 11b\n\t" \
607− STR(PTR)"\t3b, 11b\n\t" \
608− STR(PTR)"\t4b, 11b\n\t" \
609− STR(PTR)"\t5b, 11b\n\t" \
610− STR(PTR)"\t6b, 11b\n\t" \
611− STR(PTR)"\t7b, 11b\n\t" \
612− STR(PTR)"\t8b, 11b\n\t" \
605+ STR(PTR_WD)"\t1b, 11b\n\t" \
606+ STR(PTR_WD)"\t2b, 11b\n\t" \
607+ STR(PTR_WD)"\t3b, 11b\n\t" \
608+ STR(PTR_WD)"\t4b, 11b\n\t" \
609+ STR(PTR_WD)"\t5b, 11b\n\t" \
610+ STR(PTR_WD)"\t6b, 11b\n\t" \
611+ STR(PTR_WD)"\t7b, 11b\n\t" \
612+ STR(PTR_WD)"\t8b, 11b\n\t" \
613613 ".previous" \
614614 : "=&r" (value), "=r" (res) \
615615 : "r" (addr), "i" (-EFAULT)); \
@@ -632,8 +632,8 @@ do { \ · 16 unmodified lines
632632 "j\t3b\n\t" \
633633 ".previous\n\t" \
634634 ".section\t__ex_table,\"a\"\n\t" \
635− STR(PTR)"\t1b, 4b\n\t" \
636− STR(PTR)"\t2b, 4b\n\t" \
635+ STR(PTR_WD)"\t1b, 4b\n\t" \
636+ STR(PTR_WD)"\t2b, 4b\n\t" \
637637 ".previous" \
638638 : "=r" (res) \
639639 : "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -653,8 +653,8 @@ do { \ · 13 unmodified lines
653653 "j\t3b\n\t" \
654654 ".previous\n\t" \
655655 ".section\t__ex_table,\"a\"\n\t" \
656− STR(PTR)"\t1b, 4b\n\t" \
657− STR(PTR)"\t2b, 4b\n\t" \
656+ STR(PTR_WD)"\t1b, 4b\n\t" \
657+ STR(PTR_WD)"\t2b, 4b\n\t" \
658658 ".previous" \
659659 : "=r" (res) \
660660 : "r" (value), "r" (addr), "i" (-EFAULT)); \
@@ -673,8 +673,8 @@ do { \ · 12 unmodified lines
673673 "j\t3b\n\t" \
674674 ".previous\n\t" \
675675 ".section\t__ex_table,\"a\"\n\t" \
676− STR(PTR)"\t1b, 4b\n\t" \
677− STR(PTR)"\t2b, 4b\n\t" \
676+ STR(PTR_WD)"\t1b, 4b\n\t" \
677+ STR(PTR_WD)"\t2b, 4b\n\t" \
678678 ".previous" \
679679 : "=r" (res) \
680680 : "r" (value), "r" (addr), "i" (-EFAULT)); \
@@ -703,10 +703,10 @@ do { \ · 22 unmodified lines
703703 "j\t10b\n\t" \
704704 ".previous\n\t" \
705705 ".section\t__ex_table,\"a\"\n\t" \
706− STR(PTR)"\t1b, 11b\n\t" \
707− STR(PTR)"\t2b, 11b\n\t" \
708− STR(PTR)"\t3b, 11b\n\t" \
709− STR(PTR)"\t4b, 11b\n\t" \
706+ STR(PTR_WD)"\t1b, 11b\n\t" \
707+ STR(PTR_WD)"\t2b, 11b\n\t" \
708+ STR(PTR_WD)"\t3b, 11b\n\t" \
709+ STR(PTR_WD)"\t4b, 11b\n\t" \
710710 ".previous" \
711711 : "=&r" (res) \
712712 : "r" (value), "r" (addr), "i" (-EFAULT) \
@@ -743,14 +743,14 @@ do { \ · 30 unmodified lines
743743 "j\t10b\n\t" \
744744 ".previous\n\t" \
745745 ".section\t__ex_table,\"a\"\n\t" \
746− STR(PTR)"\t1b, 11b\n\t" \
747− STR(PTR)"\t2b, 11b\n\t" \
748− STR(PTR)"\t3b, 11b\n\t" \
749− STR(PTR)"\t4b, 11b\n\t" \
750− STR(PTR)"\t5b, 11b\n\t" \
751− STR(PTR)"\t6b, 11b\n\t" \
752− STR(PTR)"\t7b, 11b\n\t" \
753− STR(PTR)"\t8b, 11b\n\t" \
746+ STR(PTR_WD)"\t1b, 11b\n\t" \
747+ STR(PTR_WD)"\t2b, 11b\n\t" \
748+ STR(PTR_WD)"\t3b, 11b\n\t" \
749+ STR(PTR_WD)"\t4b, 11b\n\t" \
750+ STR(PTR_WD)"\t5b, 11b\n\t" \
751+ STR(PTR_WD)"\t6b, 11b\n\t" \
752+ STR(PTR_WD)"\t7b, 11b\n\t" \
753+ STR(PTR_WD)"\t8b, 11b\n\t" \
754754 ".previous" \
755755 : "=&r" (res) \
756756 : "r" (value), "r" (addr), "i" (-EFAULT) \
arch/mips/kernel/mips-r2-to-r6-emul.c+52−52
@@ -1258,10 +1258,10 @@ fpu_emul: · 1257 unmodified lines
12581258 " j 10b\n"
12591259 " .previous\n"
12601260 " .section __ex_table,\"a\"\n"
1261− STR(PTR) " 1b,8b\n"
1262− STR(PTR) " 2b,8b\n"
1263− STR(PTR) " 3b,8b\n"
1264− STR(PTR) " 4b,8b\n"
1261+ STR(PTR_WD) " 1b,8b\n"
1262+ STR(PTR_WD) " 2b,8b\n"
1263+ STR(PTR_WD) " 3b,8b\n"
1264+ STR(PTR_WD) " 4b,8b\n"
12651265 " .previous\n"
12661266 " .set pop\n"
12671267 : "+&r"(rt), "=&r"(rs),
@@ -1333,10 +1333,10 @@ fpu_emul: · 65 unmodified lines
13331333 " j 10b\n"
13341334 " .previous\n"
13351335 " .section __ex_table,\"a\"\n"
1336− STR(PTR) " 1b,8b\n"
1337− STR(PTR) " 2b,8b\n"
1338− STR(PTR) " 3b,8b\n"
1339− STR(PTR) " 4b,8b\n"
1336+ STR(PTR_WD) " 1b,8b\n"
1337+ STR(PTR_WD) " 2b,8b\n"
1338+ STR(PTR_WD) " 3b,8b\n"
1339+ STR(PTR_WD) " 4b,8b\n"
13401340 " .previous\n"
13411341 " .set pop\n"
13421342 : "+&r"(rt), "=&r"(rs),
@@ -1404,10 +1404,10 @@ fpu_emul: · 61 unmodified lines
14041404 " j 9b\n"
14051405 " .previous\n"
14061406 " .section __ex_table,\"a\"\n"
1407− STR(PTR) " 1b,8b\n"
1408− STR(PTR) " 2b,8b\n"
1409− STR(PTR) " 3b,8b\n"
1410− STR(PTR) " 4b,8b\n"
1407+ STR(PTR_WD) " 1b,8b\n"
1408+ STR(PTR_WD) " 2b,8b\n"
1409+ STR(PTR_WD) " 3b,8b\n"
1410+ STR(PTR_WD) " 4b,8b\n"
14111411 " .previous\n"
14121412 " .set pop\n"
14131413 : "+&r"(rt), "=&r"(rs),
@@ -1474,10 +1474,10 @@ fpu_emul: · 60 unmodified lines
14741474 " j 9b\n"
14751475 " .previous\n"
14761476 " .section __ex_table,\"a\"\n"
1477− STR(PTR) " 1b,8b\n"
1478− STR(PTR) " 2b,8b\n"
1479− STR(PTR) " 3b,8b\n"
1480− STR(PTR) " 4b,8b\n"
1477+ STR(PTR_WD) " 1b,8b\n"
1478+ STR(PTR_WD) " 2b,8b\n"
1479+ STR(PTR_WD) " 3b,8b\n"
1480+ STR(PTR_WD) " 4b,8b\n"
14811481 " .previous\n"
14821482 " .set pop\n"
14831483 : "+&r"(rt), "=&r"(rs),
@@ -1589,14 +1589,14 @@ fpu_emul: · 105 unmodified lines
15891589 " j 9b\n"
15901590 " .previous\n"
15911591 " .section __ex_table,\"a\"\n"
1592− STR(PTR) " 1b,8b\n"
1593− STR(PTR) " 2b,8b\n"
1594− STR(PTR) " 3b,8b\n"
1595− STR(PTR) " 4b,8b\n"
1596− STR(PTR) " 5b,8b\n"
1597− STR(PTR) " 6b,8b\n"
1598− STR(PTR) " 7b,8b\n"
1599− STR(PTR) " 0b,8b\n"
1592+ STR(PTR_WD) " 1b,8b\n"
1593+ STR(PTR_WD) " 2b,8b\n"
1594+ STR(PTR_WD) " 3b,8b\n"
1595+ STR(PTR_WD) " 4b,8b\n"
1596+ STR(PTR_WD) " 5b,8b\n"
1597+ STR(PTR_WD) " 6b,8b\n"
1598+ STR(PTR_WD) " 7b,8b\n"
1599+ STR(PTR_WD) " 0b,8b\n"
16001600 " .previous\n"
16011601 " .set pop\n"
16021602 : "+&r"(rt), "=&r"(rs),
@@ -1708,14 +1708,14 @@ fpu_emul: · 105 unmodified lines
17081708 " j 9b\n"
17091709 " .previous\n"
17101710 " .section __ex_table,\"a\"\n"
1711− STR(PTR) " 1b,8b\n"
1712− STR(PTR) " 2b,8b\n"
1713− STR(PTR) " 3b,8b\n"
1714− STR(PTR) " 4b,8b\n"
1715− STR(PTR) " 5b,8b\n"
1716− STR(PTR) " 6b,8b\n"
1717− STR(PTR) " 7b,8b\n"
1718− STR(PTR) " 0b,8b\n"
1711+ STR(PTR_WD) " 1b,8b\n"
1712+ STR(PTR_WD) " 2b,8b\n"
1713+ STR(PTR_WD) " 3b,8b\n"
1714+ STR(PTR_WD) " 4b,8b\n"
1715+ STR(PTR_WD) " 5b,8b\n"
1716+ STR(PTR_WD) " 6b,8b\n"
1717+ STR(PTR_WD) " 7b,8b\n"
1718+ STR(PTR_WD) " 0b,8b\n"
17191719 " .previous\n"
17201720 " .set pop\n"
17211721 : "+&r"(rt), "=&r"(rs),
@@ -1827,14 +1827,14 @@ fpu_emul: · 105 unmodified lines
18271827 " j 9b\n"
18281828 " .previous\n"
18291829 " .section __ex_table,\"a\"\n"
1830− STR(PTR) " 1b,8b\n"
1831− STR(PTR) " 2b,8b\n"
1832− STR(PTR) " 3b,8b\n"
1833− STR(PTR) " 4b,8b\n"
1834− STR(PTR) " 5b,8b\n"
1835− STR(PTR) " 6b,8b\n"
1836− STR(PTR) " 7b,8b\n"
1837− STR(PTR) " 0b,8b\n"
1830+ STR(PTR_WD) " 1b,8b\n"
1831+ STR(PTR_WD) " 2b,8b\n"
1832+ STR(PTR_WD) " 3b,8b\n"
1833+ STR(PTR_WD) " 4b,8b\n"
1834+ STR(PTR_WD) " 5b,8b\n"
1835+ STR(PTR_WD) " 6b,8b\n"
1836+ STR(PTR_WD) " 7b,8b\n"
1837+ STR(PTR_WD) " 0b,8b\n"
18381838 " .previous\n"
18391839 " .set pop\n"
18401840 : "+&r"(rt), "=&r"(rs),
@@ -1945,14 +1945,14 @@ fpu_emul: · 104 unmodified lines
19451945 " j 9b\n"
19461946 " .previous\n"
19471947 " .section __ex_table,\"a\"\n"
1948− STR(PTR) " 1b,8b\n"
1949− STR(PTR) " 2b,8b\n"
1950− STR(PTR) " 3b,8b\n"
1951− STR(PTR) " 4b,8b\n"
1952− STR(PTR) " 5b,8b\n"
1953− STR(PTR) " 6b,8b\n"
1954− STR(PTR) " 7b,8b\n"
1955− STR(PTR) " 0b,8b\n"
1948+ STR(PTR_WD) " 1b,8b\n"
1949+ STR(PTR_WD) " 2b,8b\n"
1950+ STR(PTR_WD) " 3b,8b\n"
1951+ STR(PTR_WD) " 4b,8b\n"
1952+ STR(PTR_WD) " 5b,8b\n"
1953+ STR(PTR_WD) " 6b,8b\n"
1954+ STR(PTR_WD) " 7b,8b\n"
1955+ STR(PTR_WD) " 0b,8b\n"
19561956 " .previous\n"
19571957 " .set pop\n"
19581958 : "+&r"(rt), "=&r"(rs),
@@ -2007,7 +2007,7 @@ fpu_emul: · 48 unmodified lines
20072007 "j 2b\n"
20082008 ".previous\n"
20092009 ".section __ex_table,\"a\"\n"
2010− STR(PTR) " 1b,3b\n"
2010+ STR(PTR_WD) " 1b,3b\n"
20112011 ".previous\n"
20122012 : "=&r"(res), "+&r"(err)
20132013 : "r"(vaddr), "i"(SIGSEGV)
@@ -2065,7 +2065,7 @@ fpu_emul: · 51 unmodified lines
20652065 "j 2b\n"
20662066 ".previous\n"
20672067 ".section __ex_table,\"a\"\n"
2068− STR(PTR) " 1b,3b\n"
2068+ STR(PTR_WD) " 1b,3b\n"
20692069 ".previous\n"
20702070 : "+&r"(res), "+&r"(err)
20712071 : "r"(vaddr), "i"(SIGSEGV));
@@ -2126,7 +2126,7 @@ fpu_emul: · 54 unmodified lines
21262126 "j 2b\n"
21272127 ".previous\n"
21282128 ".section __ex_table,\"a\"\n"
2129− STR(PTR) " 1b,3b\n"
2129+ STR(PTR_WD) " 1b,3b\n"
21302130 ".previous\n"
21312131 : "=&r"(res), "+&r"(err)
21322132 : "r"(vaddr), "i"(SIGSEGV)
@@ -2189,7 +2189,7 @@ fpu_emul: · 56 unmodified lines
21892189 "j 2b\n"
21902190 ".previous\n"
21912191 ".section __ex_table,\"a\"\n"
2192− STR(PTR) " 1b,3b\n"
2192+ STR(PTR_WD) " 1b,3b\n"
21932193 ".previous\n"
21942194 : "+&r"(res), "+&r"(err)
21952195 : "r"(vaddr), "i"(SIGSEGV));
arch/mips/kernel/r2300_fpu.S+3−3
@@ -23,14 +23,14 @@ · 22 unmodified lines
2323 #define EX(a,b) \
2424 9: a,##b; \
2525 .section __ex_table,"a"; \
26− PTR 9b,fault; \
26+ PTR_WD 9b,fault; \
2727 .previous
2828
2929 #define EX2(a,b) \
3030 9: a,##b; \
3131 .section __ex_table,"a"; \
32− PTR 9b,fault; \
33− PTR 9b+4,fault; \
32+ PTR_WD 9b,fault; \
33+ PTR_WD 9b+4,fault; \
3434 .previous
3535
3636 .set mips1
arch/mips/kernel/r4k_fpu.S+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 .ex\@: \insn \reg, \src
3232 .set pop
3333 .section __ex_table,"a"
34− PTR .ex\@, fault
34+ PTR_WD .ex\@, fault
3535 .previous
3636 .endm
3737
arch/mips/kernel/relocate_kernel.S+11−11
@@ -147,10 +147,10 @@ LEAF(kexec_smp_wait) · 146 unmodified lines
147147
148148 kexec_args:
149149 EXPORT(kexec_args)
150−arg0: PTR 0x0
151−arg1: PTR 0x0
152−arg2: PTR 0x0
153−arg3: PTR 0x0
150+arg0: PTR_WD 0x0
151+arg1: PTR_WD 0x0
152+arg2: PTR_WD 0x0
153+arg3: PTR_WD 0x0
154154 .size kexec_args,PTRSIZE*4
155155
156156 #ifdef CONFIG_SMP
@@ -161,10 +161,10 @@ arg3: PTR 0x0 · 4 unmodified lines
161161 */
162162 secondary_kexec_args:
163163 EXPORT(secondary_kexec_args)
164−s_arg0: PTR 0x0
165−s_arg1: PTR 0x0
166−s_arg2: PTR 0x0
167−s_arg3: PTR 0x0
164+s_arg0: PTR_WD 0x0
165+s_arg1: PTR_WD 0x0
166+s_arg2: PTR_WD 0x0
167+s_arg3: PTR_WD 0x0
168168 .size secondary_kexec_args,PTRSIZE*4
169169 kexec_flag:
170170 LONG 0x1
@@ -173,17 +173,17 @@ kexec_flag: · 2 unmodified lines
173173
174174 kexec_start_address:
175175 EXPORT(kexec_start_address)
176− PTR 0x0
176+ PTR_WD 0x0
177177 .size kexec_start_address, PTRSIZE
178178
179179 kexec_indirection_page:
180180 EXPORT(kexec_indirection_page)
181− PTR 0
181+ PTR_WD 0
182182 .size kexec_indirection_page, PTRSIZE
183183
184184 relocate_new_kernel_end:
185185
186186 relocate_new_kernel_size:
187187 EXPORT(relocate_new_kernel_size)
188− PTR relocate_new_kernel_end - relocate_new_kernel
188+ PTR_WD relocate_new_kernel_end - relocate_new_kernel
189189 .size relocate_new_kernel_size, PTRSIZE
arch/mips/kernel/scall32-o32.S+5−5
@@ -72,10 +72,10 @@ loads_done: · 71 unmodified lines
7272 .set pop
7373
7474 .section __ex_table,"a"
75− PTR load_a4, bad_stack_a4
76− PTR load_a5, bad_stack_a5
77− PTR load_a6, bad_stack_a6
78− PTR load_a7, bad_stack_a7
75+ PTR_WD load_a4, bad_stack_a4
76+ PTR_WD load_a5, bad_stack_a5
77+ PTR_WD load_a6, bad_stack_a6
78+ PTR_WD load_a7, bad_stack_a7
7979 .previous
8080
8181 lw t0, TI_FLAGS($28) # syscall tracing enabled?
@@ -216,7 +216,7 @@ einval: li v0, -ENOSYS · 134 unmodified lines
216216 #endif /* CONFIG_MIPS_MT_FPAFF */
217217
218218 #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
219−#define __SYSCALL(nr, entry) PTR entry
219+#define __SYSCALL(nr, entry) PTR_WD entry
220220 .align 2
221221 .type sys_call_table, @object
222222 EXPORT(sys_call_table)
arch/mips/kernel/scall64-n32.S+1−1
@@ -101,7 +101,7 @@ not_n32_scall: · 100 unmodified lines
101101
102102 END(handle_sysn32)
103103
104−#define __SYSCALL(nr, entry) PTR entry
104+#define __SYSCALL(nr, entry) PTR_WD entry
105105 .type sysn32_call_table, @object
106106 EXPORT(sysn32_call_table)
107107 #include <asm/syscall_table_n32.h>
arch/mips/kernel/scall64-n64.S+1−1
@@ -109,7 +109,7 @@ illegal_syscall: · 108 unmodified lines
109109 j n64_syscall_exit
110110 END(handle_sys64)
111111
112−#define __SYSCALL(nr, entry) PTR entry
112+#define __SYSCALL(nr, entry) PTR_WD entry
113113 .align 3
114114 .type sys_call_table, @object
115115 EXPORT(sys_call_table)
arch/mips/kernel/scall64-o32.S+5−5
@@ -73,10 +73,10 @@ load_a7: lw a7, 28(t0) # argument #8 from usp · 72 unmodified lines
7373 loads_done:
7474
7575 .section __ex_table,"a"
76− PTR load_a4, bad_stack_a4
77− PTR load_a5, bad_stack_a5
78− PTR load_a6, bad_stack_a6
79− PTR load_a7, bad_stack_a7
76+ PTR_WD load_a4, bad_stack_a4
77+ PTR_WD load_a5, bad_stack_a5
78+ PTR_WD load_a6, bad_stack_a6
79+ PTR_WD load_a7, bad_stack_a7
8080 .previous
8181
8282 li t1, _TIF_WORK_SYSCALL_ENTRY
@@ -214,7 +214,7 @@ einval: li v0, -ENOSYS · 131 unmodified lines
214214 END(sys32_syscall)
215215
216216 #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
217−#define __SYSCALL(nr, entry) PTR entry
217+#define __SYSCALL(nr, entry) PTR_WD entry
218218 .align 3
219219 .type sys32_call_table,@object
220220 EXPORT(sys32_call_table)
arch/mips/kernel/syscall.c+4−4
@@ -122,8 +122,8 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new) · 121 unmodified lines
122122 " j 3b \n"
123123 " .previous \n"
124124 " .section __ex_table,\"a\" \n"
125− " "STR(PTR)" 1b, 4b \n"
126− " "STR(PTR)" 2b, 4b \n"
125+ " "STR(PTR_WD)" 1b, 4b \n"
126+ " "STR(PTR_WD)" 2b, 4b \n"
127127 " .previous \n"
128128 " .set pop \n"
129129 : [old] "=&r" (old),
@@ -152,8 +152,8 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new) · 22 unmodified lines
152152 " j 3b \n"
153153 " .previous \n"
154154 " .section __ex_table,\"a\" \n"
155− " "STR(PTR)" 1b, 5b \n"
156− " "STR(PTR)" 2b, 5b \n"
155+ " "STR(PTR_WD)" 1b, 5b \n"
156+ " "STR(PTR_WD)" 2b, 5b \n"
157157 " .previous \n"
158158 " .set pop \n"
159159 : [old] "=&r" (old),
arch/mips/kvm/mips.c+46−4
@@ -414,6 +414,24 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, · 413 unmodified lines
414414 return -ENOIOCTLCMD;
415415 }
416416
417+/*
418+ * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
419+ * the vCPU is running.
420+ *
421+ * This must be noinstr as instrumentation may make use of RCU, and this is not
422+ * safe during the EQS.
423+ */
424+static int noinstr kvm_mips_vcpu_enter_exit(struct kvm_vcpu *vcpu)
425+{
426+ int ret;
427+
428+ guest_state_enter_irqoff();
429+ ret = kvm_mips_callbacks->vcpu_run(vcpu);
430+ guest_state_exit_irqoff();
431+
432+ return ret;
433+}
434+
417435 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
418436 {
419437 int r = -EINTR;
@@ -434,7 +452,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 14 unmodified lines
434452 lose_fpu(1);
435453
436454 local_irq_disable();
437− guest_enter_irqoff();
455+ guest_timing_enter_irqoff();
438456 trace_kvm_enter(vcpu);
439457
440458 /*
@@ -445,10 +463,23 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 4 unmodified lines
445463 */
446464 smp_store_mb(vcpu->mode, IN_GUEST_MODE);
447465
448− r = kvm_mips_callbacks->vcpu_run(vcpu);
466+ r = kvm_mips_vcpu_enter_exit(vcpu);
467+
468+ /*
469+ * We must ensure that any pending interrupts are taken before
470+ * we exit guest timing so that timer ticks are accounted as
471+ * guest time. Transiently unmask interrupts so that any
472+ * pending interrupts are taken.
473+ *
474+ * TODO: is there a barrier which ensures that pending interrupts are
475+ * recognised? Currently this just hopes that the CPU takes any pending
476+ * interrupts between the enable and disable.
477+ */
478+ local_irq_enable();
479+ local_irq_disable();
449480
450481 trace_kvm_out(vcpu);
451− guest_exit_irqoff();
482+ guest_timing_exit_irqoff();
452483 local_irq_enable();
453484
454485 out:
@@ -1168,7 +1199,7 @@ static void kvm_mips_set_c0_status(void) · 713 unmodified lines
11681199 /*
11691200 * Return value is in the form (errcode<<2 | RESUME_FLAG_HOST | RESUME_FLAG_NV)
11701201 */
1171−int kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
1202+static int __kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
11721203 {
11731204 struct kvm_run *run = vcpu->run;
11741205 u32 cause = vcpu->arch.host_cp0_cause;
@@ -1357,6 +1388,17 @@ int kvm_mips_handle_exit(struct kvm_vcpu *vcpu) · 182 unmodified lines
13571388 return ret;
13581389 }
13591390
1391+int noinstr kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
1392+{
1393+ int ret;
1394+
1395+ guest_state_exit_irqoff();
1396+ ret = __kvm_mips_handle_exit(vcpu);
1397+ guest_state_enter_irqoff();
1398+
1399+ return ret;
1400+}
1401+
13601402 /* Enable FPU for guest and restore context */
13611403 void kvm_own_fpu(struct kvm_vcpu *vcpu)
13621404 {
arch/mips/kvm/vz.c+9−3
@@ -458,8 +458,8 @@ void kvm_vz_acquire_htimer(struct kvm_vcpu *vcpu) · 457 unmodified lines
458458 /**
459459 * _kvm_vz_save_htimer() - Switch to software emulation of guest timer.
460460 * @vcpu: Virtual CPU.
461− * @compare: Pointer to write compare value to.
462− * @cause: Pointer to write cause value to.
461+ * @out_compare: Pointer to write compare value to.
462+ * @out_cause: Pointer to write cause value to.
463463 *
464464 * Save VZ guest timer state and switch to software emulation of guest CP0
465465 * timer. The hard timer must already be in use, so preemption should be
@@ -1541,11 +1541,14 @@ static int kvm_trap_vz_handle_guest_exit(struct kvm_vcpu *vcpu) · 1075 unmodified lines
15411541 }
15421542
15431543 /**
1544− * kvm_trap_vz_handle_cop_unusuable() - Guest used unusable coprocessor.
1544+ * kvm_trap_vz_handle_cop_unusable() - Guest used unusable coprocessor.
15451545 * @vcpu: Virtual CPU context.
15461546 *
15471547 * Handle when the guest attempts to use a coprocessor which hasn't been allowed
15481548 * by the root context.
1549+ *
1550+ * Return: value indicating whether to resume the host or the guest
1551+ * (RESUME_HOST or RESUME_GUEST)
15491552 */
15501553 static int kvm_trap_vz_handle_cop_unusable(struct kvm_vcpu *vcpu)
15511554 {
@@ -1592,6 +1595,9 @@ static int kvm_trap_vz_handle_cop_unusable(struct kvm_vcpu *vcpu) · 40 unmodified lines
15921595 *
15931596 * Handle when the guest attempts to use MSA when it is disabled in the root
15941597 * context.
1598+ *
1599+ * Return: value indicating whether to resume the host or the guest
1600+ * (RESUME_HOST or RESUME_GUEST)
15951601 */
15961602 static int kvm_trap_vz_handle_msa_disabled(struct kvm_vcpu *vcpu)
15971603 {
arch/mips/lib/csum_partial.S+2−2
@@ -347,7 +347,7 @@ EXPORT_SYMBOL(csum_partial) · 346 unmodified lines
347347 .if \mode == LEGACY_MODE; \
348348 9: insn reg, addr; \
349349 .section __ex_table,"a"; \
350− PTR 9b, .L_exc; \
350+ PTR_WD 9b, .L_exc; \
351351 .previous; \
352352 /* This is enabled in EVA mode */ \
353353 .else; \
@@ -356,7 +356,7 @@ EXPORT_SYMBOL(csum_partial) · 2 unmodified lines
356356 ((\to == USEROP) && (type == ST_INSN)); \
357357 9: __BUILD_EVA_INSN(insn##e, reg, addr); \
358358 .section __ex_table,"a"; \
359− PTR 9b, .L_exc; \
359+ PTR_WD 9b, .L_exc; \
360360 .previous; \
361361 .else; \
362362 /* EVA without exception */ \
arch/mips/lib/memcpy.S+2−2
@@ -116,7 +116,7 @@ · 115 unmodified lines
116116 .if \mode == LEGACY_MODE; \
117117 9: insn reg, addr; \
118118 .section __ex_table,"a"; \
119− PTR 9b, handler; \
119+ PTR_WD 9b, handler; \
120120 .previous; \
121121 /* This is assembled in EVA mode */ \
122122 .else; \
@@ -125,7 +125,7 @@ · 2 unmodified lines
125125 ((\to == USEROP) && (type == ST_INSN)); \
126126 9: __BUILD_EVA_INSN(insn##e, reg, addr); \
127127 .section __ex_table,"a"; \
128− PTR 9b, handler; \
128+ PTR_WD 9b, handler; \
129129 .previous; \
130130 .else; \
131131 /* \
arch/mips/lib/memset.S+1−1
@@ -52,7 +52,7 @@ · 51 unmodified lines
5252 9: ___BUILD_EVA_INSN(insn, reg, addr); \
5353 .endif; \
5454 .section __ex_table,"a"; \
55− PTR 9b, handler; \
55+ PTR_WD 9b, handler; \
5656 .previous
5757
5858 .macro f_fill64 dst, offset, val, fixup, mode
arch/mips/lib/strncpy_user.S+2−2
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #define EX(insn,reg,addr,handler) \
1616 9: insn reg, addr; \
1717 .section __ex_table,"a"; \
18− PTR 9b, handler; \
18+ PTR_WD 9b, handler; \
1919 .previous
2020
2121 /*
@@ -59,7 +59,7 @@ LEAF(__strncpy_from_user_asm) · 37 unmodified lines
5959 jr ra
6060
6161 .section __ex_table,"a"
62− PTR 1b, .Lfault
62+ PTR_WD 1b, .Lfault
6363 .previous
6464
6565 EXPORT_SYMBOL(__strncpy_from_user_asm)
arch/mips/lib/strnlen_user.S+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #define EX(insn,reg,addr,handler) \
1515 9: insn reg, addr; \
1616 .section __ex_table,"a"; \
17− PTR 9b, handler; \
17+ PTR_WD 9b, handler; \
1818 .previous
1919
2020 /*
arch/mips/loongson64/vbios_quirk.c+4−5
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 #include <linux/pci.h>
44 #include <loongson.h>
55
6−static void pci_fixup_radeon(struct pci_dev *pdev)
6+static void pci_fixup_video(struct pci_dev *pdev)
77 {
88 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
99
@@ -22,8 +22,7 @@ static void pci_fixup_radeon(struct pci_dev *pdev) · 12 unmodified lines
2222 res->flags = IORESOURCE_MEM | IORESOURCE_ROM_SHADOW |
2323 IORESOURCE_PCI_FIXED;
2424
25− dev_info(&pdev->dev, "BAR %d: assigned %pR for Radeon ROM\n",
26− PCI_ROM_RESOURCE, res);
25+ dev_info(&pdev->dev, "Video device with shadowed ROM at %pR\n", res);
2726 }
28−DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, 0x9615,
29− PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_radeon);
27+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_ATI, 0x9615,
28+ PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
arch/parisc/include/asm/bitops.h+8−0
@@ -12,6 +12,14 @@ · 11 unmodified lines
1212 #include <asm/barrier.h>
1313 #include <linux/atomic.h>
1414
15+/* compiler build environment sanity checks: */
16+#if !defined(CONFIG_64BIT) && defined(__LP64__)
17+#error "Please use 'ARCH=parisc' to build the 32-bit kernel."
18+#endif
19+#if defined(CONFIG_64BIT) && !defined(__LP64__)
20+#error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
21+#endif
22+
1523 /* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion
1624 * on use of volatile and __*_bit() (set/clear/change):
1725 * *_bit() want use of volatile.
arch/parisc/include/asm/uaccess.h+15−14
@@ -89,8 +89,8 @@ struct exception_table_entry { · 88 unmodified lines
8989 __asm__("1: " ldx " 0(" sr "%2),%0\n" \
9090 "9:\n" \
9191 ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
92− : "=r"(__gu_val), "=r"(__gu_err) \
93− : "r"(ptr), "1"(__gu_err)); \
92+ : "=r"(__gu_val), "+r"(__gu_err) \
93+ : "r"(ptr)); \
9494 \
9595 (val) = (__force __typeof__(*(ptr))) __gu_val; \
9696 }
@@ -123,8 +123,8 @@ struct exception_table_entry { · 26 unmodified lines
123123 "9:\n" \
124124 ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
125125 ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \
126− : "=&r"(__gu_tmp.l), "=r"(__gu_err) \
127− : "r"(ptr), "1"(__gu_err)); \
126+ : "=&r"(__gu_tmp.l), "+r"(__gu_err) \
127+ : "r"(ptr)); \
128128 \
129129 (val) = __gu_tmp.t; \
130130 }
@@ -135,13 +135,12 @@ struct exception_table_entry { · 4 unmodified lines
135135 #define __put_user_internal(sr, x, ptr) \
136136 ({ \
137137 ASM_EXCEPTIONTABLE_VAR(__pu_err); \
138− __typeof__(*(ptr)) __x = (__typeof__(*(ptr)))(x); \
139138 \
140139 switch (sizeof(*(ptr))) { \
141− case 1: __put_user_asm(sr, "stb", __x, ptr); break; \
142− case 2: __put_user_asm(sr, "sth", __x, ptr); break; \
143− case 4: __put_user_asm(sr, "stw", __x, ptr); break; \
144− case 8: STD_USER(sr, __x, ptr); break; \
140+ case 1: __put_user_asm(sr, "stb", x, ptr); break; \
141+ case 2: __put_user_asm(sr, "sth", x, ptr); break; \
142+ case 4: __put_user_asm(sr, "stw", x, ptr); break; \
143+ case 8: STD_USER(sr, x, ptr); break; \
145144 default: BUILD_BUG(); \
146145 } \
147146 \
@@ -150,7 +149,9 @@ struct exception_table_entry { · 2 unmodified lines
150149
151150 #define __put_user(x, ptr) \
152151 ({ \
153− __put_user_internal("%%sr3,", x, ptr); \
152+ __typeof__(&*(ptr)) __ptr = ptr; \
153+ __typeof__(*(__ptr)) __x = (__typeof__(*(__ptr)))(x); \
154+ __put_user_internal("%%sr3,", __x, __ptr); \
154155 })
155156
156157 #define __put_kernel_nofault(dst, src, type, err_label) \
@@ -180,8 +181,8 @@ struct exception_table_entry { · 23 unmodified lines
180181 "1: " stx " %2,0(" sr "%1)\n" \
181182 "9:\n" \
182183 ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
183− : "=r"(__pu_err) \
184− : "r"(ptr), "r"(x), "0"(__pu_err))
184+ : "+r"(__pu_err) \
185+ : "r"(ptr), "r"(x))
185186
186187
187188 #if !defined(CONFIG_64BIT)
@@ -193,8 +194,8 @@ struct exception_table_entry { · 5 unmodified lines
193194 "9:\n" \
194195 ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
195196 ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \
196− : "=r"(__pu_err) \
197− : "r"(ptr), "r"(__val), "0"(__pu_err)); \
197+ : "+r"(__pu_err) \
198+ : "r"(ptr), "r"(__val)); \
198199 } while (0)
199200
200201 #endif /* !defined(CONFIG_64BIT) */
arch/parisc/lib/iomap.c+18−0
@@ -346,6 +346,16 @@ u64 ioread64be(const void __iomem *addr) · 345 unmodified lines
346346 return *((u64 *)addr);
347347 }
348348
349+u64 ioread64_lo_hi(const void __iomem *addr)
350+{
351+ u32 low, high;
352+
353+ low = ioread32(addr);
354+ high = ioread32(addr + sizeof(u32));
355+
356+ return low + ((u64)high << 32);
357+}
358+
349359 u64 ioread64_hi_lo(const void __iomem *addr)
350360 {
351361 u32 low, high;
@@ -419,6 +429,12 @@ void iowrite64be(u64 datum, void __iomem *addr) · 67 unmodified lines
419429 }
420430 }
421431
432+void iowrite64_lo_hi(u64 val, void __iomem *addr)
433+{
434+ iowrite32(val, addr);
435+ iowrite32(val >> 32, addr + sizeof(u32));
436+}
437+
422438 void iowrite64_hi_lo(u64 val, void __iomem *addr)
423439 {
424440 iowrite32(val >> 32, addr + sizeof(u32));
@@ -530,6 +546,7 @@ EXPORT_SYMBOL(ioread32); · 105 unmodified lines
530546 EXPORT_SYMBOL(ioread32be);
531547 EXPORT_SYMBOL(ioread64);
532548 EXPORT_SYMBOL(ioread64be);
549+EXPORT_SYMBOL(ioread64_lo_hi);
533550 EXPORT_SYMBOL(ioread64_hi_lo);
534551 EXPORT_SYMBOL(iowrite8);
535552 EXPORT_SYMBOL(iowrite16);
@@ -538,6 +555,7 @@ EXPORT_SYMBOL(iowrite32); · 2 unmodified lines
538555 EXPORT_SYMBOL(iowrite32be);
539556 EXPORT_SYMBOL(iowrite64);
540557 EXPORT_SYMBOL(iowrite64be);
558+EXPORT_SYMBOL(iowrite64_lo_hi);
541559 EXPORT_SYMBOL(iowrite64_hi_lo);
542560 EXPORT_SYMBOL(ioread8_rep);
543561 EXPORT_SYMBOL(ioread16_rep);
arch/parisc/mm/init.c+4−5
@@ -337,9 +337,9 @@ static void __init setup_bootmem(void) · 336 unmodified lines
337337
338338 static bool kernel_set_to_readonly;
339339
340−static void __init map_pages(unsigned long start_vaddr,
341− unsigned long start_paddr, unsigned long size,
342− pgprot_t pgprot, int force)
340+static void __ref map_pages(unsigned long start_vaddr,
341+ unsigned long start_paddr, unsigned long size,
342+ pgprot_t pgprot, int force)
343343 {
344344 pmd_t *pmd;
345345 pte_t *pg_table;
@@ -449,7 +449,7 @@ void __init set_kernel_text_rw(int enable_read_write) · 103 unmodified lines
449449 flush_tlb_all();
450450 }
451451
452−void __ref free_initmem(void)
452+void free_initmem(void)
453453 {
454454 unsigned long init_begin = (unsigned long)__init_begin;
455455 unsigned long init_end = (unsigned long)__init_end;
@@ -463,7 +463,6 @@ void __ref free_initmem(void) · 7 unmodified lines
463463 /* The init text pages are marked R-X. We have to
464464 * flush the icache and mark them RW-
465465 *
466− * This is tricky, because map_pages is in the init section.
467466 * Do a dummy remap of the data section first (the data
468467 * section is already PAGE_KERNEL) to pull in the TLB entries
469468 * for map_kernel */
arch/powerpc/include/asm/book3s/32/mmu-hash.h+2−0
@@ -223,6 +223,8 @@ static __always_inline void update_user_segments(u32 val) · 222 unmodified lines
223223 update_user_segment(15, val);
224224 }
225225
226+int __init find_free_bat(void);
227+unsigned int bat_block_size(unsigned long base, unsigned long top);
226228 #endif /* !__ASSEMBLY__ */
227229
228230 /* We happily ignore the smaller BATs on 601, we don't actually use
arch/powerpc/include/asm/book3s/32/pgtable.h+1−0
@@ -178,6 +178,7 @@ static inline bool pte_user(pte_t pte) · 177 unmodified lines
178178 #ifndef __ASSEMBLY__
179179
180180 int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
181+void unmap_kernel_page(unsigned long va);
181182
182183 #endif /* !__ASSEMBLY__ */
183184
arch/powerpc/include/asm/book3s/64/pgtable.h+2−0
@@ -1082,6 +1082,8 @@ static inline int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t p · 1081 unmodified lines
10821082 return hash__map_kernel_page(ea, pa, prot);
10831083 }
10841084
1085+void unmap_kernel_page(unsigned long va);
1086+
10851087 static inline int __meminit vmemmap_create_mapping(unsigned long start,
10861088 unsigned long page_size,
10871089 unsigned long phys)
arch/powerpc/include/asm/fixmap.h+4−2
@@ -111,8 +111,10 @@ static inline void __set_fixmap(enum fixed_addresses idx, · 110 unmodified lines
111111 BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
112112 else if (WARN_ON(idx >= __end_of_fixed_addresses))
113113 return;
114−
115− map_kernel_page(__fix_to_virt(idx), phys, flags);
114+ if (pgprot_val(flags))
115+ map_kernel_page(__fix_to_virt(idx), phys, flags);
116+ else
117+ unmap_kernel_page(__fix_to_virt(idx));
116118 }
117119
118120 #define __early_set_fixmap __set_fixmap
arch/powerpc/include/asm/hw_irq.h+1−1
@@ -473,7 +473,7 @@ static inline bool arch_irq_disabled_regs(struct pt_regs *regs) · 472 unmodified lines
473473 return !(regs->msr & MSR_EE);
474474 }
475475
476−static inline bool should_hard_irq_enable(void)
476+static __always_inline bool should_hard_irq_enable(void)
477477 {
478478 return false;
479479 }
arch/powerpc/include/asm/kvm_book3s_64.h+0−1
@@ -39,7 +39,6 @@ struct kvm_nested_guest { · 38 unmodified lines
3939 pgd_t *shadow_pgtable; /* our page table for this guest */
4040 u64 l1_gr_to_hr; /* L1's addr of part'n-scoped table */
4141 u64 process_table; /* process table entry for this guest */
42− u64 hfscr; /* HFSCR that the L1 requested for this nested guest */
4342 long refcnt; /* number of pointers to this struct */
4443 struct mutex tlb_lock; /* serialize page faults and tlbies */
4544 struct kvm_nested_guest *next;
arch/powerpc/include/asm/kvm_host.h+1−0
@@ -818,6 +818,7 @@ struct kvm_vcpu_arch { · 817 unmodified lines
818818
819819 /* For support of nested guests */
820820 struct kvm_nested_guest *nested;
821+ u64 nested_hfscr; /* HFSCR that the L1 requested for the nested guest */
821822 u32 nested_vcpu_id;
822823 gpa_t nested_io_gpr;
823824 #endif
arch/powerpc/include/asm/nohash/32/pgtable.h+1−0
@@ -64,6 +64,7 @@ extern int icache_44x_need_flush; · 63 unmodified lines
6464 #ifndef __ASSEMBLY__
6565
6666 int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
67+void unmap_kernel_page(unsigned long va);
6768
6869 #endif /* !__ASSEMBLY__ */
6970
arch/powerpc/include/asm/nohash/64/pgtable.h+1−0
@@ -308,6 +308,7 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma, · 307 unmodified lines
308308 #define __swp_entry_to_pte(x) __pte((x).val)
309309
310310 int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t prot);
311+void unmap_kernel_page(unsigned long va);
311312 extern int __meminit vmemmap_create_mapping(unsigned long start,
312313 unsigned long page_size,
313314 unsigned long phys);
arch/powerpc/include/asm/ppc-opcode.h+1−0
@@ -500,6 +500,7 @@ · 499 unmodified lines
500500 #define PPC_RAW_LDX(r, base, b) (0x7c00002a | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
501501 #define PPC_RAW_LHZ(r, base, i) (0xa0000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_L(i))
502502 #define PPC_RAW_LHBRX(r, base, b) (0x7c00062c | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
503+#define PPC_RAW_LWBRX(r, base, b) (0x7c00042c | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
503504 #define PPC_RAW_LDBRX(r, base, b) (0x7c000428 | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
504505 #define PPC_RAW_STWCX(s, a, b) (0x7c00012d | ___PPC_RS(s) | ___PPC_RA(a) | ___PPC_RB(b))
505506 #define PPC_RAW_CMPWI(a, i) (0x2c000000 | ___PPC_RA(a) | IMM_L(i))
arch/powerpc/include/asm/syscall.h+2−2
@@ -90,7 +90,7 @@ static inline void syscall_get_arguments(struct task_struct *task, · 89 unmodified lines
9090 unsigned long val, mask = -1UL;
9191 unsigned int n = 6;
9292
93− if (is_32bit_task())
93+ if (is_tsk_32bit_task(task))
9494 mask = 0xffffffff;
9595
9696 while (n--) {
@@ -105,7 +105,7 @@ static inline void syscall_get_arguments(struct task_struct *task, · 8 unmodified lines
105105
106106 static inline int syscall_get_arch(struct task_struct *task)
107107 {
108− if (is_32bit_task())
108+ if (is_tsk_32bit_task(task))
109109 return AUDIT_ARCH_PPC;
110110 else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
111111 return AUDIT_ARCH_PPC64LE;
arch/powerpc/include/asm/thread_info.h+2−0
@@ -168,8 +168,10 @@ static inline bool test_thread_local_flags(unsigned int flags) · 167 unmodified lines
168168
169169 #ifdef CONFIG_COMPAT
170170 #define is_32bit_task() (test_thread_flag(TIF_32BIT))
171+#define is_tsk_32bit_task(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT))
171172 #else
172173 #define is_32bit_task() (IS_ENABLED(CONFIG_PPC32))
174+#define is_tsk_32bit_task(tsk) (IS_ENABLED(CONFIG_PPC32))
173175 #endif
174176
175177 #if defined(CONFIG_PPC64)
arch/powerpc/kernel/head_book3s_32.S+2−2
@@ -421,14 +421,14 @@ InstructionTLBMiss: · 420 unmodified lines
421421 */
422422 /* Get PTE (linux-style) and check access */
423423 mfspr r3,SPRN_IMISS
424−#ifdef CONFIG_MODULES
424+#if defined(CONFIG_MODULES) || defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KFENCE)
425425 lis r1, TASK_SIZE@h /* check if kernel address */
426426 cmplw 0,r1,r3
427427 #endif
428428 mfspr r2, SPRN_SDR1
429429 li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC | _PAGE_USER
430430 rlwinm r2, r2, 28, 0xfffff000
431−#ifdef CONFIG_MODULES
431+#if defined(CONFIG_MODULES) || defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KFENCE)
432432 bgt- 112f
433433 lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
434434 li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
arch/powerpc/kernel/interrupt_64.S+2−0
@@ -30,6 +30,7 @@ COMPAT_SYS_CALL_TABLE: · 29 unmodified lines
3030 .ifc \srr,srr
3131 mfspr r11,SPRN_SRR0
3232 ld r12,_NIP(r1)
33+ clrrdi r11,r11,2
3334 clrrdi r12,r12,2
3435 100: tdne r11,r12
3536 EMIT_WARN_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
@@ -40,6 +41,7 @@ COMPAT_SYS_CALL_TABLE: · 4 unmodified lines
4041 .else
4142 mfspr r11,SPRN_HSRR0
4243 ld r12,_NIP(r1)
44+ clrrdi r11,r11,2
4345 clrrdi r12,r12,2
4446 100: tdne r11,r12
4547 EMIT_WARN_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
arch/powerpc/kernel/time.c+3−2
@@ -649,8 +649,9 @@ DEFINE_INTERRUPT_HANDLER_ASYNC(timer_interrupt) · 648 unmodified lines
649649 __this_cpu_inc(irq_stat.timer_irqs_event);
650650 } else {
651651 now = *next_tb - now;
652− if (now <= decrementer_max)
653− set_dec_or_work(now);
652+ if (now > decrementer_max)
653+ now = decrementer_max;
654+ set_dec_or_work(now);
654655 __this_cpu_inc(irq_stat.timer_irqs_others);
655656 }
656657
arch/powerpc/kvm/book3s_hv.c+1−2
@@ -1816,7 +1816,6 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu, · 1815 unmodified lines
18161816
18171817 static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
18181818 {
1819− struct kvm_nested_guest *nested = vcpu->arch.nested;
18201819 int r;
18211820 int srcu_idx;
18221821
@@ -1922,7 +1921,7 @@ static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu) · 99 unmodified lines
19221921 * it into a HEAI.
19231922 */
19241923 if (!(vcpu->arch.hfscr_permitted & (1UL << cause)) ||
1925− (nested->hfscr & (1UL << cause))) {
1924+ (vcpu->arch.nested_hfscr & (1UL << cause))) {
19261925 vcpu->arch.trap = BOOK3S_INTERRUPT_H_EMUL_ASSIST;
19271926
19281927 /*
arch/powerpc/kvm/book3s_hv_nested.c+1−1
@@ -363,7 +363,7 @@ long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu) · 362 unmodified lines
363363 /* set L1 state to L2 state */
364364 vcpu->arch.nested = l2;
365365 vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token;
366− l2->hfscr = l2_hv.hfscr;
366+ vcpu->arch.nested_hfscr = l2_hv.hfscr;
367367 vcpu->arch.regs = l2_regs;
368368
369369 /* Guest must always run with ME enabled, HV disabled. */
arch/powerpc/lib/sstep.c+2−0
@@ -3264,12 +3264,14 @@ void emulate_update_regs(struct pt_regs *regs, struct instruction_op *op) · 3263 unmodified lines
32643264 case BARRIER_EIEIO:
32653265 eieio();
32663266 break;
3267+#ifdef CONFIG_PPC64
32673268 case BARRIER_LWSYNC:
32683269 asm volatile("lwsync" : : : "memory");
32693270 break;
32703271 case BARRIER_PTESYNC:
32713272 asm volatile("ptesync" : : : "memory");
32723273 break;
3274+#endif
32733275 }
32743276 break;
32753277
arch/powerpc/mm/book3s32/mmu.c+5−5
@@ -76,7 +76,7 @@ unsigned long p_block_mapped(phys_addr_t pa) · 75 unmodified lines
7676 return 0;
7777 }
7878
79−static int __init find_free_bat(void)
79+int __init find_free_bat(void)
8080 {
8181 int b;
8282 int n = mmu_has_feature(MMU_FTR_USE_HIGH_BATS) ? 8 : 4;
@@ -100,7 +100,7 @@ static int __init find_free_bat(void) · 17 unmodified lines
100100 * - block size has to be a power of two. This is calculated by finding the
101101 * highest bit set to 1.
102102 */
103−static unsigned int block_size(unsigned long base, unsigned long top)
103+unsigned int bat_block_size(unsigned long base, unsigned long top)
104104 {
105105 unsigned int max_size = SZ_256M;
106106 unsigned int base_shift = (ffs(base) - 1) & 31;
@@ -145,7 +145,7 @@ static unsigned long __init __mmu_mapin_ram(unsigned long base, unsigned long to · 38 unmodified lines
145145 int idx;
146146
147147 while ((idx = find_free_bat()) != -1 && base != top) {
148− unsigned int size = block_size(base, top);
148+ unsigned int size = bat_block_size(base, top);
149149
150150 if (size < 128 << 10)
151151 break;
@@ -201,12 +201,12 @@ void mmu_mark_initmem_nx(void) · 49 unmodified lines
201201 unsigned long size;
202202
203203 for (i = 0; i < nb - 1 && base < top;) {
204− size = block_size(base, top);
204+ size = bat_block_size(base, top);
205205 setibat(i++, PAGE_OFFSET + base, base, size, PAGE_KERNEL_TEXT);
206206 base += size;
207207 }
208208 if (base < top) {
209− size = block_size(base, top);
209+ size = bat_block_size(base, top);
210210 if ((top - base) > size) {
211211 size <<= 1;
212212 if (strict_kernel_rwx_enabled() && base + size > border)
arch/powerpc/mm/kasan/book3s_32.c+31−28
@@ -10,48 +10,51 @@ int __init kasan_init_region(void *start, size_t size) · 9 unmodified lines
1010 {
1111 unsigned long k_start = (unsigned long)kasan_mem_to_shadow(start);
1212 unsigned long k_end = (unsigned long)kasan_mem_to_shadow(start + size);
13− unsigned long k_cur = k_start;
14− int k_size = k_end - k_start;
15− int k_size_base = 1 << (ffs(k_size) - 1);
13+ unsigned long k_nobat = k_start;
14+ unsigned long k_cur;
15+ phys_addr_t phys;
1616 int ret;
17− void *block;
1817
19− block = memblock_alloc(k_size, k_size_base);
20−
21− if (block && k_size_base >= SZ_128K && k_start == ALIGN(k_start, k_size_base)) {
22− int shift = ffs(k_size - k_size_base);
23− int k_size_more = shift ? 1 << (shift - 1) : 0;
24−
25− setbat(-1, k_start, __pa(block), k_size_base, PAGE_KERNEL);
26− if (k_size_more >= SZ_128K)
27− setbat(-1, k_start + k_size_base, __pa(block) + k_size_base,
28− k_size_more, PAGE_KERNEL);
29− if (v_block_mapped(k_start))
30− k_cur = k_start + k_size_base;
31− if (v_block_mapped(k_start + k_size_base))
32− k_cur = k_start + k_size_base + k_size_more;
33−
34− update_bats();
18+ while (k_nobat < k_end) {
19+ unsigned int k_size = bat_block_size(k_nobat, k_end);
20+ int idx = find_free_bat();
21+
22+ if (idx == -1)
23+ break;
24+ if (k_size < SZ_128K)
25+ break;
26+ phys = memblock_phys_alloc_range(k_size, k_size, 0,
27+ MEMBLOCK_ALLOC_ANYWHERE);
28+ if (!phys)
29+ break;
30+
31+ setbat(idx, k_nobat, phys, k_size, PAGE_KERNEL);
32+ k_nobat += k_size;
3533 }
34+ if (k_nobat != k_start)
35+ update_bats();
3636
37− if (!block)
38− block = memblock_alloc(k_size, PAGE_SIZE);
39− if (!block)
40− return -ENOMEM;
37+ if (k_nobat < k_end) {
38+ phys = memblock_phys_alloc_range(k_end - k_nobat, PAGE_SIZE, 0,
39+ MEMBLOCK_ALLOC_ANYWHERE);
40+ if (!phys)
41+ return -ENOMEM;
42+ }
4143
4244 ret = kasan_init_shadow_page_tables(k_start, k_end);
4345 if (ret)
4446 return ret;
4547
46− kasan_update_early_region(k_start, k_cur, __pte(0));
48+ kasan_update_early_region(k_start, k_nobat, __pte(0));
4749
48− for (; k_cur < k_end; k_cur += PAGE_SIZE) {
50+ for (k_cur = k_nobat; k_cur < k_end; k_cur += PAGE_SIZE) {
4951 pmd_t *pmd = pmd_off_k(k_cur);
50− void *va = block + k_cur - k_start;
51− pte_t pte = pfn_pte(PHYS_PFN(__pa(va)), PAGE_KERNEL);
52+ pte_t pte = pfn_pte(PHYS_PFN(phys + k_cur - k_nobat), PAGE_KERNEL);
5253
5354 __set_pte_at(&init_mm, k_cur, pte_offset_kernel(pmd, k_cur), pte, 0);
5455 }
5556 flush_tlb_kernel_range(k_start, k_end);
57+ memset(kasan_mem_to_shadow(start), 0, k_end - k_start);
58+
5659 return 0;
5760 }
arch/powerpc/mm/pgtable.c+9−0
@@ -206,6 +206,15 @@ void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, · 205 unmodified lines
206206 __set_pte_at(mm, addr, ptep, pte, 0);
207207 }
208208
209+void unmap_kernel_page(unsigned long va)
210+{
211+ pmd_t *pmdp = pmd_off_k(va);
212+ pte_t *ptep = pte_offset_kernel(pmdp, va);
213+
214+ pte_clear(&init_mm, va, ptep);
215+ flush_tlb_kernel_range(va, va + PAGE_SIZE);
216+}
217+
209218 /*
210219 * This is called when relaxing access to a PTE. It's also called in the page
211220 * fault path when we don't hit any of the major fault cases, ie, a minor
arch/powerpc/net/bpf_jit_comp.c+23−6
@@ -23,15 +23,15 @@ static void bpf_jit_fill_ill_insns(void *area, unsigned int size) · 22 unmodified lines
2323 memset32(area, BREAKPOINT_INSTRUCTION, size / 4);
2424 }
2525
26−/* Fix the branch target addresses for subprog calls */
27−static int bpf_jit_fixup_subprog_calls(struct bpf_prog *fp, u32 *image,
28− struct codegen_context *ctx, u32 *addrs)
26+/* Fix updated addresses (for subprog calls, ldimm64, et al) during extra pass */
27+static int bpf_jit_fixup_addresses(struct bpf_prog *fp, u32 *image,
28+ struct codegen_context *ctx, u32 *addrs)
2929 {
3030 const struct bpf_insn *insn = fp->insnsi;
3131 bool func_addr_fixed;
3232 u64 func_addr;
3333 u32 tmp_idx;
34− int i, ret;
34+ int i, j, ret;
3535
3636 for (i = 0; i < fp->len; i++) {
3737 /*
@@ -66,6 +66,23 @@ static int bpf_jit_fixup_subprog_calls(struct bpf_prog *fp, u32 *image, · 28 unmodified lines
6666 * of the JITed sequence remains unchanged.
6767 */
6868 ctx->idx = tmp_idx;
69+ } else if (insn[i].code == (BPF_LD | BPF_IMM | BPF_DW)) {
70+ tmp_idx = ctx->idx;
71+ ctx->idx = addrs[i] / 4;
72+#ifdef CONFIG_PPC32
73+ PPC_LI32(ctx->b2p[insn[i].dst_reg] - 1, (u32)insn[i + 1].imm);
74+ PPC_LI32(ctx->b2p[insn[i].dst_reg], (u32)insn[i].imm);
75+ for (j = ctx->idx - addrs[i] / 4; j < 4; j++)
76+ EMIT(PPC_RAW_NOP());
77+#else
78+ func_addr = ((u64)(u32)insn[i].imm) | (((u64)(u32)insn[i + 1].imm) << 32);
79+ PPC_LI64(b2p[insn[i].dst_reg], func_addr);
80+ /* overwrite rest with nops */
81+ for (j = ctx->idx - addrs[i] / 4; j < 5; j++)
82+ EMIT(PPC_RAW_NOP());
83+#endif
84+ ctx->idx = tmp_idx;
85+ i++;
6986 }
7087 }
7188
@@ -200,13 +217,13 @@ skip_init_ctx: · 128 unmodified lines
200217 /*
201218 * Do not touch the prologue and epilogue as they will remain
202219 * unchanged. Only fix the branch target address for subprog
203− * calls in the body.
220+ * calls in the body, and ldimm64 instructions.
204221 *
205222 * This does not change the offsets and lengths of the subprog
206223 * call instruction sequences and hence, the size of the JITed
207224 * image as well.
208225 */
209− bpf_jit_fixup_subprog_calls(fp, code_base, &cgctx, addrs);
226+ bpf_jit_fixup_addresses(fp, code_base, &cgctx, addrs);
210227
211228 /* There is no need to perform the usual passes. */
212229 goto skip_codegen_passes;
arch/powerpc/net/bpf_jit_comp32.c+9−0
@@ -191,6 +191,9 @@ void bpf_jit_emit_func_call_rel(u32 *image, struct codegen_context *ctx, u64 fun · 190 unmodified lines
191191
192192 if (image && rel < 0x2000000 && rel >= -0x2000000) {
193193 PPC_BL_ABS(func);
194+ EMIT(PPC_RAW_NOP());
195+ EMIT(PPC_RAW_NOP());
196+ EMIT(PPC_RAW_NOP());
194197 } else {
195198 /* Load function address into r0 */
196199 EMIT(PPC_RAW_LIS(_R0, IMM_H(func)));
@@ -290,6 +293,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context * · 93 unmodified lines
290293 bool func_addr_fixed;
291294 u64 func_addr;
292295 u32 true_cond;
296+ u32 tmp_idx;
297+ int j;
293298
294299 /*
295300 * addrs[] maps a BPF bytecode address into a real offset from
@@ -905,8 +910,12 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context * · 609 unmodified lines
905910 * 16 byte instruction that uses two 'struct bpf_insn'
906911 */
907912 case BPF_LD | BPF_IMM | BPF_DW: /* dst = (u64) imm */
913+ tmp_idx = ctx->idx;
908914 PPC_LI32(dst_reg_h, (u32)insn[i + 1].imm);
909915 PPC_LI32(dst_reg, (u32)insn[i].imm);
916+ /* padding to allow full 4 instructions for later patching */
917+ for (j = ctx->idx - tmp_idx; j < 4; j++)
918+ EMIT(PPC_RAW_NOP());
910919 /* Adjust for two bpf instructions */
911920 addrs[++i] = ctx->idx * 4;
912921 break;
arch/powerpc/net/bpf_jit_comp64.c+19−10
@@ -319,6 +319,7 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context * · 318 unmodified lines
319319 u64 imm64;
320320 u32 true_cond;
321321 u32 tmp_idx;
322+ int j;
322323
323324 /*
324325 * addrs[] maps a BPF bytecode address into a real offset from
@@ -633,17 +634,21 @@ bpf_alu32_trunc: · 308 unmodified lines
633634 EMIT(PPC_RAW_MR(dst_reg, b2p[TMP_REG_1]));
634635 break;
635636 case 64:
636− /*
637− * Way easier and faster(?) to store the value
638− * into stack and then use ldbrx
639− *
640− * ctx->seen will be reliable in pass2, but
641− * the instructions generated will remain the
642− * same across all passes
643− */
637+ /* Store the value to stack and then use byte-reverse loads */
644638 PPC_BPF_STL(dst_reg, 1, bpf_jit_stack_local(ctx));
645639 EMIT(PPC_RAW_ADDI(b2p[TMP_REG_1], 1, bpf_jit_stack_local(ctx)));
646− EMIT(PPC_RAW_LDBRX(dst_reg, 0, b2p[TMP_REG_1]));
640+ if (cpu_has_feature(CPU_FTR_ARCH_206)) {
641+ EMIT(PPC_RAW_LDBRX(dst_reg, 0, b2p[TMP_REG_1]));
642+ } else {
643+ EMIT(PPC_RAW_LWBRX(dst_reg, 0, b2p[TMP_REG_1]));
644+ if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
645+ EMIT(PPC_RAW_SLDI(dst_reg, dst_reg, 32));
646+ EMIT(PPC_RAW_LI(b2p[TMP_REG_2], 4));
647+ EMIT(PPC_RAW_LWBRX(b2p[TMP_REG_2], b2p[TMP_REG_2], b2p[TMP_REG_1]));
648+ if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
649+ EMIT(PPC_RAW_SLDI(b2p[TMP_REG_2], b2p[TMP_REG_2], 32));
650+ EMIT(PPC_RAW_OR(dst_reg, dst_reg, b2p[TMP_REG_2]));
651+ }
647652 break;
648653 }
649654 break;
@@ -848,9 +853,13 @@ emit_clear: · 198 unmodified lines
848853 case BPF_LD | BPF_IMM | BPF_DW: /* dst = (u64) imm */
849854 imm64 = ((u64)(u32) insn[i].imm) |
850855 (((u64)(u32) insn[i+1].imm) << 32);
856+ tmp_idx = ctx->idx;
857+ PPC_LI64(dst_reg, imm64);
858+ /* padding to allow full 5 instructions for later patching */
859+ for (j = ctx->idx - tmp_idx; j < 5; j++)
860+ EMIT(PPC_RAW_NOP());
851861 /* Adjust for two bpf instructions */
852862 addrs[++i] = ctx->idx * 4;
853− PPC_LI64(dst_reg, imm64);
854863 break;
855864
856865 /*
arch/powerpc/perf/core-book3s.c+42−33
@@ -776,6 +776,34 @@ static void pmao_restore_workaround(bool ebb) · 775 unmodified lines
776776 mtspr(SPRN_PMC6, pmcs[5]);
777777 }
778778
779+/*
780+ * If the perf subsystem wants performance monitor interrupts as soon as
781+ * possible (e.g., to sample the instruction address and stack chain),
782+ * this should return true. The IRQ masking code can then enable MSR[EE]
783+ * in some places (e.g., interrupt handlers) that allows PMI interrupts
784+ * through to improve accuracy of profiles, at the cost of some performance.
785+ *
786+ * The PMU counters can be enabled by other means (e.g., sysfs raw SPR
787+ * access), but in that case there is no need for prompt PMI handling.
788+ *
789+ * This currently returns true if any perf counter is being used. It
790+ * could possibly return false if only events are being counted rather than
791+ * samples being taken, but for now this is good enough.
792+ */
793+bool power_pmu_wants_prompt_pmi(void)
794+{
795+ struct cpu_hw_events *cpuhw;
796+
797+ /*
798+ * This could simply test local_paca->pmcregs_in_use if that were not
799+ * under ifdef KVM.
800+ */
801+ if (!ppmu)
802+ return false;
803+
804+ cpuhw = this_cpu_ptr(&cpu_hw_events);
805+ return cpuhw->n_events;
806+}
779807 #endif /* CONFIG_PPC64 */
780808
781809 static void perf_event_interrupt(struct pt_regs *regs);
@@ -1327,9 +1355,20 @@ static void power_pmu_disable(struct pmu *pmu) · 545 unmodified lines
13271355 * Otherwise provide a warning if there is PMI pending, but
13281356 * no counter is found overflown.
13291357 */
1330− if (any_pmc_overflown(cpuhw))
1331− clear_pmi_irq_pending();
1332− else
1358+ if (any_pmc_overflown(cpuhw)) {
1359+ /*
1360+ * Since power_pmu_disable runs under local_irq_save, it
1361+ * could happen that code hits a PMC overflow without PMI
1362+ * pending in paca. Hence only clear PMI pending if it was
1363+ * set.
1364+ *
1365+ * If a PMI is pending, then MSR[EE] must be disabled (because
1366+ * the masked PMI handler disabling EE). So it is safe to
1367+ * call clear_pmi_irq_pending().
1368+ */
1369+ if (pmi_irq_pending())
1370+ clear_pmi_irq_pending();
1371+ } else
13331372 WARN_ON(pmi_irq_pending());
13341373
13351374 val = mmcra = cpuhw->mmcr.mmcra;
@@ -2438,36 +2477,6 @@ static void perf_event_interrupt(struct pt_regs *regs) · 1102 unmodified lines
24382477 perf_sample_event_took(sched_clock() - start_clock);
24392478 }
24402479
2441−/*
2442− * If the perf subsystem wants performance monitor interrupts as soon as
2443− * possible (e.g., to sample the instruction address and stack chain),
2444− * this should return true. The IRQ masking code can then enable MSR[EE]
2445− * in some places (e.g., interrupt handlers) that allows PMI interrupts
2446− * though to improve accuracy of profiles, at the cost of some performance.
2447− *
2448− * The PMU counters can be enabled by other means (e.g., sysfs raw SPR
2449− * access), but in that case there is no need for prompt PMI handling.
2450− *
2451− * This currently returns true if any perf counter is being used. It
2452− * could possibly return false if only events are being counted rather than
2453− * samples being taken, but for now this is good enough.
2454− */
2455−bool power_pmu_wants_prompt_pmi(void)
2456−{
2457− struct cpu_hw_events *cpuhw;
2458−
2459− /*
2460− * This could simply test local_paca->pmcregs_in_use if that were not
2461− * under ifdef KVM.
2462− */
2463−
2464− if (!ppmu)
2465− return false;
2466−
2467− cpuhw = this_cpu_ptr(&cpu_hw_events);
2468− return cpuhw->n_events;
2469−}
2470−
24712480 static int power_pmu_prepare_cpu(unsigned int cpu)
24722481 {
24732482 struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
arch/riscv/Makefile+6−0
@@ -50,6 +50,12 @@ riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima · 49 unmodified lines
5050 riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima
5151 riscv-march-$(CONFIG_FPU) := $(riscv-march-y)fd
5252 riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c
53+
54+# Newer binutils versions default to ISA spec version 20191213 which moves some
55+# instructions from the I extension to the Zicsr and Zifencei extensions.
56+toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zicsr_zifencei)
57+riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei
58+
5359 KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y))
5460 KBUILD_AFLAGS += -march=$(riscv-march-y)
5561
arch/riscv/kernel/cpu-hotplug.c+2−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/sched/hotplug.h>
1313 #include <asm/irq.h>
1414 #include <asm/cpu_ops.h>
15+#include <asm/numa.h>
1516 #include <asm/sbi.h>
1617
1718 bool cpu_has_hotplug(unsigned int cpu)
@@ -40,6 +41,7 @@ int __cpu_disable(void) · 22 unmodified lines
4041 return ret;
4142
4243 remove_cpu_topology(cpu);
44+ numa_remove_cpu(cpu);
4345 set_cpu_online(cpu, false);
4446 irq_migrate_all_off_this_cpu();
4547
arch/riscv/kernel/head.S+5−6
@@ -22,14 +22,13 @@ · 21 unmodified lines
2222 add \reg, \reg, t0
2323 .endm
2424 .macro XIP_FIXUP_FLASH_OFFSET reg
25− la t1, __data_loc
26− li t0, XIP_OFFSET_MASK
27− and t1, t1, t0
28− li t1, XIP_OFFSET
29− sub t0, t0, t1
30− sub \reg, \reg, t0
25+ la t0, __data_loc
26+ REG_L t1, _xip_phys_offset
27+ sub \reg, \reg, t1
28+ add \reg, \reg, t0
3129 .endm
3230 _xip_fixup: .dword CONFIG_PHYS_RAM_BASE - CONFIG_XIP_PHYS_ADDR - XIP_OFFSET
31+_xip_phys_offset: .dword CONFIG_XIP_PHYS_ADDR + XIP_OFFSET
3332 #else
3433 .macro XIP_FIXUP_OFFSET reg
3534 .endm
arch/riscv/kernel/sbi.c+47−25
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 * Copyright (c) 2020 Western Digital Corporation or its affiliates.
66 */
77
8+#include <linux/bits.h>
89 #include <linux/init.h>
910 #include <linux/pm.h>
1011 #include <linux/reboot.h>
@@ -85,7 +86,7 @@ static unsigned long __sbi_v01_cpumask_to_hartmask(const struct cpumask *cpu_mas · 74 unmodified lines
8586 pr_warn("Unable to send any request to hartid > BITS_PER_LONG for SBI v0.1\n");
8687 break;
8788 }
88− hmask |= 1 << hartid;
89+ hmask |= BIT(hartid);
8990 }
9091
9192 return hmask;
@@ -160,7 +161,7 @@ static int __sbi_send_ipi_v01(const struct cpumask *cpu_mask) · 68 unmodified lines
160161 {
161162 unsigned long hart_mask;
162163
163− if (!cpu_mask)
164+ if (!cpu_mask || cpumask_empty(cpu_mask))
164165 cpu_mask = cpu_online_mask;
165166 hart_mask = __sbi_v01_cpumask_to_hartmask(cpu_mask);
166167
@@ -176,7 +177,7 @@ static int __sbi_rfence_v01(int fid, const struct cpumask *cpu_mask, · 9 unmodified lines
176177 int result = 0;
177178 unsigned long hart_mask;
178179
179− if (!cpu_mask)
180+ if (!cpu_mask || cpumask_empty(cpu_mask))
180181 cpu_mask = cpu_online_mask;
181182 hart_mask = __sbi_v01_cpumask_to_hartmask(cpu_mask);
182183
@@ -249,26 +250,37 @@ static void __sbi_set_timer_v02(uint64_t stime_value) · 66 unmodified lines
249250
250251 static int __sbi_send_ipi_v02(const struct cpumask *cpu_mask)
251252 {
252− unsigned long hartid, cpuid, hmask = 0, hbase = 0;
253+ unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
253254 struct sbiret ret = {0};
254255 int result;
255256
256− if (!cpu_mask)
257+ if (!cpu_mask || cpumask_empty(cpu_mask))
257258 cpu_mask = cpu_online_mask;
258259
259260 for_each_cpu(cpuid, cpu_mask) {
260261 hartid = cpuid_to_hartid_map(cpuid);
261− if (hmask && ((hbase + BITS_PER_LONG) <= hartid)) {
262− ret = sbi_ecall(SBI_EXT_IPI, SBI_EXT_IPI_SEND_IPI,
263− hmask, hbase, 0, 0, 0, 0);
264− if (ret.error)
265− goto ecall_failed;
266− hmask = 0;
267− hbase = 0;
262+ if (hmask) {
263+ if (hartid + BITS_PER_LONG <= htop ||
264+ hbase + BITS_PER_LONG <= hartid) {
265+ ret = sbi_ecall(SBI_EXT_IPI,
266+ SBI_EXT_IPI_SEND_IPI, hmask,
267+ hbase, 0, 0, 0, 0);
268+ if (ret.error)
269+ goto ecall_failed;
270+ hmask = 0;
271+ } else if (hartid < hbase) {
272+ /* shift the mask to fit lower hartid */
273+ hmask <<= hbase - hartid;
274+ hbase = hartid;
275+ }
268276 }
269− if (!hmask)
277+ if (!hmask) {
270278 hbase = hartid;
271− hmask |= 1UL << (hartid - hbase);
279+ htop = hartid;
280+ } else if (hartid > htop) {
281+ htop = hartid;
282+ }
283+ hmask |= BIT(hartid - hbase);
272284 }
273285
274286 if (hmask) {
@@ -344,25 +356,35 @@ static int __sbi_rfence_v02(int fid, const struct cpumask *cpu_mask, · 69 unmodified lines
344356 unsigned long start, unsigned long size,
345357 unsigned long arg4, unsigned long arg5)
346358 {
347− unsigned long hartid, cpuid, hmask = 0, hbase = 0;
359+ unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
348360 int result;
349361
350− if (!cpu_mask)
362+ if (!cpu_mask || cpumask_empty(cpu_mask))
351363 cpu_mask = cpu_online_mask;
352364
353365 for_each_cpu(cpuid, cpu_mask) {
354366 hartid = cpuid_to_hartid_map(cpuid);
355− if (hmask && ((hbase + BITS_PER_LONG) <= hartid)) {
356− result = __sbi_rfence_v02_call(fid, hmask, hbase,
357− start, size, arg4, arg5);
358− if (result)
359− return result;
360− hmask = 0;
361− hbase = 0;
367+ if (hmask) {
368+ if (hartid + BITS_PER_LONG <= htop ||
369+ hbase + BITS_PER_LONG <= hartid) {
370+ result = __sbi_rfence_v02_call(fid, hmask,
371+ hbase, start, size, arg4, arg5);
372+ if (result)
373+ return result;
374+ hmask = 0;
375+ } else if (hartid < hbase) {
376+ /* shift the mask to fit lower hartid */
377+ hmask <<= hbase - hartid;
378+ hbase = hartid;
379+ }
362380 }
363− if (!hmask)
381+ if (!hmask) {
364382 hbase = hartid;
365− hmask |= 1UL << (hartid - hbase);
383+ htop = hartid;
384+ } else if (hartid > htop) {
385+ htop = hartid;
386+ }
387+ hmask |= BIT(hartid - hbase);
366388 }
367389
368390 if (hmask) {
arch/riscv/kernel/stacktrace.c+5−4
@@ -22,15 +22,16 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, · 21 unmodified lines
2222 bool (*fn)(void *, unsigned long), void *arg)
2323 {
2424 unsigned long fp, sp, pc;
25+ int level = 0;
2526
2627 if (regs) {
2728 fp = frame_pointer(regs);
2829 sp = user_stack_pointer(regs);
2930 pc = instruction_pointer(regs);
3031 } else if (task == NULL || task == current) {
31− fp = (unsigned long)__builtin_frame_address(1);
32− sp = (unsigned long)__builtin_frame_address(0);
33− pc = (unsigned long)__builtin_return_address(0);
32+ fp = (unsigned long)__builtin_frame_address(0);
33+ sp = sp_in_global;
34+ pc = (unsigned long)walk_stackframe;
3435 } else {
3536 /* task blocked in __switch_to */
3637 fp = task->thread.s[0];
@@ -42,7 +43,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, · 5 unmodified lines
4243 unsigned long low, high;
4344 struct stackframe *frame;
4445
45− if (unlikely(!__kernel_text_address(pc) || !fn(arg, pc)))
46+ if (unlikely(!__kernel_text_address(pc) || (level++ >= 1 && !fn(arg, pc))))
4647 break;
4748
4849 /* Validate frame pointer */
arch/riscv/kvm/vcpu.c+31−17
@@ -90,6 +90,7 @@ int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id) · 89 unmodified lines
9090 int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
9191 {
9292 struct kvm_cpu_context *cntx;
93+ struct kvm_vcpu_csr *reset_csr = &vcpu->arch.guest_reset_csr;
9394
9495 /* Mark this VCPU never ran */
9596 vcpu->arch.ran_atleast_once = false;
@@ -106,6 +107,9 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 10 unmodified lines
106107 cntx->hstatus |= HSTATUS_SPVP;
107108 cntx->hstatus |= HSTATUS_SPV;
108109
110+ /* By default, make CY, TM, and IR counters accessible in VU mode */
111+ reset_csr->scounteren = 0x7;
112+
109113 /* Setup VCPU timer */
110114 kvm_riscv_vcpu_timer_init(vcpu);
111115
@@ -699,6 +703,20 @@ static void kvm_riscv_update_hvip(struct kvm_vcpu *vcpu) · 587 unmodified lines
699703 csr_write(CSR_HVIP, csr->hvip);
700704 }
701705
706+/*
707+ * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
708+ * the vCPU is running.
709+ *
710+ * This must be noinstr as instrumentation may make use of RCU, and this is not
711+ * safe during the EQS.
712+ */
713+static void noinstr kvm_riscv_vcpu_enter_exit(struct kvm_vcpu *vcpu)
714+{
715+ guest_state_enter_irqoff();
716+ __kvm_riscv_switch_to(&vcpu->arch);
717+ guest_state_exit_irqoff();
718+}
719+
702720 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
703721 {
704722 int ret;
@@ -790,9 +808,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 85 unmodified lines
790808 continue;
791809 }
792810
793− guest_enter_irqoff();
811+ guest_timing_enter_irqoff();
794812
795− __kvm_riscv_switch_to(&vcpu->arch);
813+ kvm_riscv_vcpu_enter_exit(vcpu);
796814
797815 vcpu->mode = OUTSIDE_GUEST_MODE;
798816 vcpu->stat.exits++;
@@ -812,25 +830,21 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) · 13 unmodified lines
812830 kvm_riscv_vcpu_sync_interrupts(vcpu);
813831
814832 /*
815− * We may have taken a host interrupt in VS/VU-mode (i.e.
816− * while executing the guest). This interrupt is still
817− * pending, as we haven't serviced it yet!
833+ * We must ensure that any pending interrupts are taken before
834+ * we exit guest timing so that timer ticks are accounted as
835+ * guest time. Transiently unmask interrupts so that any
836+ * pending interrupts are taken.
818837 *
819− * We're now back in HS-mode with interrupts disabled
820− * so enabling the interrupts now will have the effect
821− * of taking the interrupt again, in HS-mode this time.
838+ * There's no barrier which ensures that pending interrupts are
839+ * recognised, so we just hope that the CPU takes any pending
840+ * interrupts between the enable and disable.
822841 */
823842 local_irq_enable();
843+ local_irq_disable();
824844
825− /*
826− * We do local_irq_enable() before calling guest_exit() so
827− * that if a timer interrupt hits while running the guest
828− * we account that tick as being spent in the guest. We
829− * enable preemption after calling guest_exit() so that if
830− * we get preempted we make sure ticks after that is not
831− * counted as guest time.
832− */
833− guest_exit();
845+ guest_timing_exit_irqoff();
846+
847+ local_irq_enable();
834848
835849 preempt_enable();
836850
arch/riscv/kvm/vcpu_sbi_base.c+2−1
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/errno.h>
1010 #include <linux/err.h>
1111 #include <linux/kvm_host.h>
12+#include <linux/version.h>
1213 #include <asm/csr.h>
1314 #include <asm/sbi.h>
1415 #include <asm/kvm_vcpu_timer.h>
@@ -32,7 +33,7 @@ static int kvm_sbi_ext_base_handler(struct kvm_vcpu *vcpu, struct kvm_run *run, · 17 unmodified lines
3233 *out_val = KVM_SBI_IMPID;
3334 break;
3435 case SBI_EXT_BASE_GET_IMP_VERSION:
35− *out_val = 0;
36+ *out_val = LINUX_VERSION_CODE;
3637 break;
3738 case SBI_EXT_BASE_PROBE_EXT:
3839 if ((cp->a0 >= SBI_EXT_EXPERIMENTAL_START &&
arch/riscv/mm/extable.c+3−3
@@ -33,7 +33,7 @@ static inline void regs_set_gpr(struct pt_regs *regs, unsigned int offset, · 32 unmodified lines
3333 if (unlikely(offset > MAX_REG_OFFSET))
3434 return;
3535
36− if (!offset)
36+ if (offset)
3737 *(unsigned long *)((unsigned long)regs + offset) = val;
3838 }
3939
@@ -43,8 +43,8 @@ static bool ex_handler_uaccess_err_zero(const struct exception_table_entry *ex, · 3 unmodified lines
4343 int reg_err = FIELD_GET(EX_DATA_REG_ERR, ex->data);
4444 int reg_zero = FIELD_GET(EX_DATA_REG_ZERO, ex->data);
4545
46− regs_set_gpr(regs, reg_err, -EFAULT);
47− regs_set_gpr(regs, reg_zero, 0);
46+ regs_set_gpr(regs, reg_err * sizeof(unsigned long), -EFAULT);
47+ regs_set_gpr(regs, reg_zero * sizeof(unsigned long), 0);
4848
4949 regs->epc = get_ex_fixup(ex);
5050 return true;
arch/riscv/mm/init.c+2−0
@@ -232,6 +232,7 @@ static pmd_t __maybe_unused early_dtb_pmd[PTRS_PER_PMD] __initdata __aligned(PAG · 231 unmodified lines
232232
233233 #ifdef CONFIG_XIP_KERNEL
234234 #define pt_ops (*(struct pt_alloc_ops *)XIP_FIXUP(&pt_ops))
235+#define riscv_pfn_base (*(unsigned long *)XIP_FIXUP(&riscv_pfn_base))
235236 #define trampoline_pg_dir ((pgd_t *)XIP_FIXUP(trampoline_pg_dir))
236237 #define fixmap_pte ((pte_t *)XIP_FIXUP(fixmap_pte))
237238 #define early_pg_dir ((pgd_t *)XIP_FIXUP(early_pg_dir))
@@ -522,6 +523,7 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size) · 284 unmodified lines
522523 }
523524
524525 #ifdef CONFIG_XIP_KERNEL
526+#define phys_ram_base (*(phys_addr_t *)XIP_FIXUP(&phys_ram_base))
525527 extern char _xiprom[], _exiprom[], __data_loc;
526528
527529 /* called from head.S with MMU off */
arch/s390/Kconfig+15−0
@@ -945,6 +945,9 @@ config S390_GUEST · 944 unmodified lines
945945
946946 endmenu
947947
948+config S390_MODULES_SANITY_TEST_HELPERS
949+ def_bool n
950+
948951 menu "Selftests"
949952
950953 config S390_UNWIND_SELFTEST
@@ -971,4 +974,16 @@ config S390_KPROBES_SANITY_TEST · 20 unmodified lines
971974
972975 Say N if you are unsure.
973976
977+config S390_MODULES_SANITY_TEST
978+ def_tristate n
979+ depends on KUNIT
980+ default KUNIT_ALL_TESTS
981+ prompt "Enable s390 specific modules tests"
982+ select S390_MODULES_SANITY_TEST_HELPERS
983+ help
984+ This option enables an s390 specific modules test. This option is
985+ not useful for distributions or general kernels, but only for
986+ kernel developers working on architecture code.
987+
988+ Say N if you are unsure.
974989 endmenu
arch/s390/configs/debug_defconfig+10−10
@@ -63,6 +63,7 @@ CONFIG_APPLDATA_BASE=y · 62 unmodified lines
6363 CONFIG_KVM=m
6464 CONFIG_S390_UNWIND_SELFTEST=m
6565 CONFIG_S390_KPROBES_SANITY_TEST=m
66+CONFIG_S390_MODULES_SANITY_TEST=m
6667 CONFIG_KPROBES=y
6768 CONFIG_JUMP_LABEL=y
6869 CONFIG_STATIC_KEYS_SELFTEST=y
@@ -96,7 +97,6 @@ CONFIG_MEMORY_HOTPLUG=y · 27 unmodified lines
9697 CONFIG_MEMORY_HOTREMOVE=y
9798 CONFIG_KSM=y
9899 CONFIG_TRANSPARENT_HUGEPAGE=y
99−CONFIG_FRONTSWAP=y
100100 CONFIG_CMA_DEBUG=y
101101 CONFIG_CMA_DEBUGFS=y
102102 CONFIG_CMA_SYSFS=y
@@ -109,6 +109,7 @@ CONFIG_DEFERRED_STRUCT_PAGE_INIT=y · 6 unmodified lines
109109 CONFIG_IDLE_PAGE_TRACKING=y
110110 CONFIG_PERCPU_STATS=y
111111 CONFIG_GUP_TEST=y
112+CONFIG_ANON_VMA_NAME=y
112113 CONFIG_NET=y
113114 CONFIG_PACKET=y
114115 CONFIG_PACKET_DIAG=m
@@ -116,7 +117,6 @@ CONFIG_UNIX=y · 1 unmodified line
116117 CONFIG_UNIX_DIAG=m
117118 CONFIG_XFRM_USER=m
118119 CONFIG_NET_KEY=m
119−CONFIG_NET_SWITCHDEV=y
120120 CONFIG_SMC=m
121121 CONFIG_SMC_DIAG=m
122122 CONFIG_INET=y
@@ -185,7 +185,6 @@ CONFIG_NF_CT_NETLINK_TIMEOUT=m · 62 unmodified lines
185185 CONFIG_NF_TABLES=m
186186 CONFIG_NF_TABLES_INET=y
187187 CONFIG_NFT_CT=m
188−CONFIG_NFT_COUNTER=m
189188 CONFIG_NFT_LOG=m
190189 CONFIG_NFT_LIMIT=m
191190 CONFIG_NFT_NAT=m
@@ -391,6 +390,7 @@ CONFIG_OPENVSWITCH=m · 199 unmodified lines
391390 CONFIG_VSOCKETS=m
392391 CONFIG_VIRTIO_VSOCKETS=m
393392 CONFIG_NETLINK_DIAG=m
393+CONFIG_NET_SWITCHDEV=y
394394 CONFIG_CGROUP_NET_PRIO=y
395395 CONFIG_NET_PKTGEN=m
396396 CONFIG_PCI=y
@@ -400,6 +400,7 @@ CONFIG_PCI_IOV=y · 3 unmodified lines
400400 CONFIG_HOTPLUG_PCI=y
401401 CONFIG_HOTPLUG_PCI_S390=y
402402 CONFIG_DEVTMPFS=y
403+CONFIG_DEVTMPFS_SAFE=y
403404 CONFIG_CONNECTOR=y
404405 CONFIG_ZRAM=y
405406 CONFIG_BLK_DEV_LOOP=m
@@ -501,6 +502,7 @@ CONFIG_NLMON=m · 95 unmodified lines
501502 # CONFIG_NET_VENDOR_DEC is not set
502503 # CONFIG_NET_VENDOR_DLINK is not set
503504 # CONFIG_NET_VENDOR_EMULEX is not set
505+# CONFIG_NET_VENDOR_ENGLEDER is not set
504506 # CONFIG_NET_VENDOR_EZCHIP is not set
505507 # CONFIG_NET_VENDOR_GOOGLE is not set
506508 # CONFIG_NET_VENDOR_HUAWEI is not set
@@ -511,7 +513,6 @@ CONFIG_NLMON=m · 4 unmodified lines
511513 CONFIG_MLX4_EN=m
512514 CONFIG_MLX5_CORE=m
513515 CONFIG_MLX5_CORE_EN=y
514−CONFIG_MLX5_ESWITCH=y
515516 # CONFIG_NET_VENDOR_MICREL is not set
516517 # CONFIG_NET_VENDOR_MICROCHIP is not set
517518 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -542,6 +543,7 @@ CONFIG_MLX5_ESWITCH=y · 24 unmodified lines
542543 # CONFIG_NET_VENDOR_SYNOPSYS is not set
543544 # CONFIG_NET_VENDOR_TEHUTI is not set
544545 # CONFIG_NET_VENDOR_TI is not set
546+# CONFIG_NET_VENDOR_VERTEXCOM is not set
545547 # CONFIG_NET_VENDOR_VIA is not set
546548 # CONFIG_NET_VENDOR_WIZNET is not set
547549 # CONFIG_NET_VENDOR_XILINX is not set
@@ -592,6 +594,7 @@ CONFIG_VIRTIO_BALLOON=m · 44 unmodified lines
592594 CONFIG_VIRTIO_INPUT=y
593595 CONFIG_VHOST_NET=m
594596 CONFIG_VHOST_VSOCK=m
597+# CONFIG_SURFACE_PLATFORMS is not set
595598 CONFIG_S390_CCW_IOMMU=y
596599 CONFIG_S390_AP_IOMMU=y
597600 CONFIG_EXT4_FS=y
@@ -756,9 +759,6 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 158 unmodified lines
756759 CONFIG_CRYPTO_USER_API_RNG=m
757760 CONFIG_CRYPTO_USER_API_AEAD=m
758761 CONFIG_CRYPTO_STATS=y
759−CONFIG_CRYPTO_LIB_BLAKE2S=m
760−CONFIG_CRYPTO_LIB_CURVE25519=m
761−CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
762762 CONFIG_ZCRYPT=m
763763 CONFIG_PKEY=m
764764 CONFIG_CRYPTO_PAES_S390=m
@@ -774,6 +774,8 @@ CONFIG_CRYPTO_GHASH_S390=m · 9 unmodified lines
774774 CONFIG_CRYPTO_CRC32_S390=y
775775 CONFIG_CRYPTO_DEV_VIRTIO=m
776776 CONFIG_CORDIC=m
777+CONFIG_CRYPTO_LIB_CURVE25519=m
778+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
777779 CONFIG_CRC32_SELFTEST=y
778780 CONFIG_CRC4=m
779781 CONFIG_CRC7=m
@@ -807,7 +809,6 @@ CONFIG_SLUB_DEBUG_ON=y · 27 unmodified lines
807809 CONFIG_SLUB_STATS=y
808810 CONFIG_DEBUG_STACK_USAGE=y
809811 CONFIG_DEBUG_VM=y
810−CONFIG_DEBUG_VM_VMACACHE=y
811812 CONFIG_DEBUG_VM_PGFLAGS=y
812813 CONFIG_DEBUG_MEMORY_INIT=y
813814 CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
@@ -819,12 +820,11 @@ CONFIG_PANIC_ON_OOPS=y · 5 unmodified lines
819820 CONFIG_DETECT_HUNG_TASK=y
820821 CONFIG_WQ_WATCHDOG=y
821822 CONFIG_TEST_LOCKUP=m
822−CONFIG_DEBUG_TIMEKEEPING=y
823823 CONFIG_PROVE_LOCKING=y
824824 CONFIG_LOCK_STAT=y
825−CONFIG_DEBUG_LOCKDEP=y
826825 CONFIG_DEBUG_ATOMIC_SLEEP=y
827826 CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
827+CONFIG_DEBUG_IRQFLAGS=y
828828 CONFIG_DEBUG_SG=y
829829 CONFIG_DEBUG_NOTIFIERS=y
830830 CONFIG_BUG_ON_DATA_CORRUPTION=y
arch/s390/configs/defconfig+9−7
@@ -61,6 +61,7 @@ CONFIG_APPLDATA_BASE=y · 60 unmodified lines
6161 CONFIG_KVM=m
6262 CONFIG_S390_UNWIND_SELFTEST=m
6363 CONFIG_S390_KPROBES_SANITY_TEST=m
64+CONFIG_S390_MODULES_SANITY_TEST=m
6465 CONFIG_KPROBES=y
6566 CONFIG_JUMP_LABEL=y
6667 # CONFIG_GCC_PLUGINS is not set
@@ -91,7 +92,6 @@ CONFIG_MEMORY_HOTPLUG=y · 24 unmodified lines
9192 CONFIG_MEMORY_HOTREMOVE=y
9293 CONFIG_KSM=y
9394 CONFIG_TRANSPARENT_HUGEPAGE=y
94−CONFIG_FRONTSWAP=y
9595 CONFIG_CMA_SYSFS=y
9696 CONFIG_CMA_AREAS=7
9797 CONFIG_MEM_SOFT_DIRTY=y
@@ -101,6 +101,7 @@ CONFIG_ZSMALLOC_STAT=y · 3 unmodified lines
101101 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
102102 CONFIG_IDLE_PAGE_TRACKING=y
103103 CONFIG_PERCPU_STATS=y
104+CONFIG_ANON_VMA_NAME=y
104105 CONFIG_NET=y
105106 CONFIG_PACKET=y
106107 CONFIG_PACKET_DIAG=m
@@ -108,7 +109,6 @@ CONFIG_UNIX=y · 1 unmodified line
108109 CONFIG_UNIX_DIAG=m
109110 CONFIG_XFRM_USER=m
110111 CONFIG_NET_KEY=m
111−CONFIG_NET_SWITCHDEV=y
112112 CONFIG_SMC=m
113113 CONFIG_SMC_DIAG=m
114114 CONFIG_INET=y
@@ -177,7 +177,6 @@ CONFIG_NF_CT_NETLINK_TIMEOUT=m · 62 unmodified lines
177177 CONFIG_NF_TABLES=m
178178 CONFIG_NF_TABLES_INET=y
179179 CONFIG_NFT_CT=m
180−CONFIG_NFT_COUNTER=m
181180 CONFIG_NFT_LOG=m
182181 CONFIG_NFT_LIMIT=m
183182 CONFIG_NFT_NAT=m
@@ -382,6 +381,7 @@ CONFIG_OPENVSWITCH=m · 198 unmodified lines
382381 CONFIG_VSOCKETS=m
383382 CONFIG_VIRTIO_VSOCKETS=m
384383 CONFIG_NETLINK_DIAG=m
384+CONFIG_NET_SWITCHDEV=y
385385 CONFIG_CGROUP_NET_PRIO=y
386386 CONFIG_NET_PKTGEN=m
387387 CONFIG_PCI=y
@@ -391,6 +391,7 @@ CONFIG_HOTPLUG_PCI=y · 3 unmodified lines
391391 CONFIG_HOTPLUG_PCI_S390=y
392392 CONFIG_UEVENT_HELPER=y
393393 CONFIG_DEVTMPFS=y
394+CONFIG_DEVTMPFS_SAFE=y
394395 CONFIG_CONNECTOR=y
395396 CONFIG_ZRAM=y
396397 CONFIG_BLK_DEV_LOOP=m
@@ -492,6 +493,7 @@ CONFIG_NLMON=m · 95 unmodified lines
492493 # CONFIG_NET_VENDOR_DEC is not set
493494 # CONFIG_NET_VENDOR_DLINK is not set
494495 # CONFIG_NET_VENDOR_EMULEX is not set
496+# CONFIG_NET_VENDOR_ENGLEDER is not set
495497 # CONFIG_NET_VENDOR_EZCHIP is not set
496498 # CONFIG_NET_VENDOR_GOOGLE is not set
497499 # CONFIG_NET_VENDOR_HUAWEI is not set
@@ -502,7 +504,6 @@ CONFIG_NLMON=m · 4 unmodified lines
502504 CONFIG_MLX4_EN=m
503505 CONFIG_MLX5_CORE=m
504506 CONFIG_MLX5_CORE_EN=y
505−CONFIG_MLX5_ESWITCH=y
506507 # CONFIG_NET_VENDOR_MICREL is not set
507508 # CONFIG_NET_VENDOR_MICROCHIP is not set
508509 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -533,6 +534,7 @@ CONFIG_MLX5_ESWITCH=y · 24 unmodified lines
533534 # CONFIG_NET_VENDOR_SYNOPSYS is not set
534535 # CONFIG_NET_VENDOR_TEHUTI is not set
535536 # CONFIG_NET_VENDOR_TI is not set
537+# CONFIG_NET_VENDOR_VERTEXCOM is not set
536538 # CONFIG_NET_VENDOR_VIA is not set
537539 # CONFIG_NET_VENDOR_WIZNET is not set
538540 # CONFIG_NET_VENDOR_XILINX is not set
@@ -582,6 +584,7 @@ CONFIG_VIRTIO_BALLOON=m · 43 unmodified lines
582584 CONFIG_VIRTIO_INPUT=y
583585 CONFIG_VHOST_NET=m
584586 CONFIG_VHOST_VSOCK=m
587+# CONFIG_SURFACE_PLATFORMS is not set
585588 CONFIG_S390_CCW_IOMMU=y
586589 CONFIG_S390_AP_IOMMU=y
587590 CONFIG_EXT4_FS=y
@@ -743,9 +746,6 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 155 unmodified lines
743746 CONFIG_CRYPTO_USER_API_RNG=m
744747 CONFIG_CRYPTO_USER_API_AEAD=m
745748 CONFIG_CRYPTO_STATS=y
746−CONFIG_CRYPTO_LIB_BLAKE2S=m
747−CONFIG_CRYPTO_LIB_CURVE25519=m
748−CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
749749 CONFIG_ZCRYPT=m
750750 CONFIG_PKEY=m
751751 CONFIG_CRYPTO_PAES_S390=m
@@ -762,6 +762,8 @@ CONFIG_CRYPTO_CRC32_S390=y · 10 unmodified lines
762762 CONFIG_CRYPTO_DEV_VIRTIO=m
763763 CONFIG_CORDIC=m
764764 CONFIG_PRIME_NUMBERS=m
765+CONFIG_CRYPTO_LIB_CURVE25519=m
766+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
765767 CONFIG_CRC4=m
766768 CONFIG_CRC7=m
767769 CONFIG_CRC8=m
arch/s390/configs/zfcpdump_defconfig+3−0
@@ -1,6 +1,7 @@
11 # CONFIG_SWAP is not set
22 CONFIG_NO_HZ_IDLE=y
33 CONFIG_HIGH_RES_TIMERS=y
4+CONFIG_BPF_SYSCALL=y
45 # CONFIG_CPU_ISOLATION is not set
56 # CONFIG_UTS_NS is not set
67 # CONFIG_TIME_NS is not set
@@ -34,6 +35,7 @@ CONFIG_NET=y · 27 unmodified lines
3435 # CONFIG_PCPU_DEV_REFCNT is not set
3536 # CONFIG_ETHTOOL_NETLINK is not set
3637 CONFIG_DEVTMPFS=y
38+CONFIG_DEVTMPFS_SAFE=y
3739 CONFIG_BLK_DEV_RAM=y
3840 # CONFIG_DCSSBLK is not set
3941 # CONFIG_DASD is not set
@@ -58,6 +60,7 @@ CONFIG_ZFCP=y · 18 unmodified lines
5860 # CONFIG_HID is not set
5961 # CONFIG_VIRTIO_MENU is not set
6062 # CONFIG_VHOST_MENU is not set
63+# CONFIG_SURFACE_PLATFORMS is not set
6164 # CONFIG_IOMMU_SUPPORT is not set
6265 # CONFIG_DNOTIFY is not set
6366 # CONFIG_INOTIFY_USER is not set
arch/s390/hypfs/hypfs_vm.c+4−2
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 static char local_guest[] = " ";
2222 static char all_guests[] = "* ";
23+static char *all_groups = all_guests;
2324 static char *guest_query;
2425
2526 struct diag2fc_data {
@@ -62,10 +63,11 @@ static int diag2fc(int size, char* query, void *addr) · 36 unmodified lines
6263
6364 memcpy(parm_list.userid, query, NAME_LEN);
6465 ASCEBC(parm_list.userid, NAME_LEN);
65− parm_list.addr = (unsigned long) addr ;
66+ memcpy(parm_list.aci_grp, all_groups, NAME_LEN);
67+ ASCEBC(parm_list.aci_grp, NAME_LEN);
68+ parm_list.addr = (unsigned long)addr;
6669 parm_list.size = size;
6770 parm_list.fmt = 0x02;
68− memset(parm_list.aci_grp, 0x40, NAME_LEN);
6971 rc = -1;
7072
7173 diag_stat_inc(DIAG_STAT_X2FC);
arch/s390/include/asm/uaccess.h+2−2
@@ -47,8 +47,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n); · 46 unmodified lines
4747 int __put_user_bad(void) __attribute__((noreturn));
4848 int __get_user_bad(void) __attribute__((noreturn));
4949
50−#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
51−
5250 union oac {
5351 unsigned int val;
5452 struct {
@@ -71,6 +69,8 @@ union oac { · 16 unmodified lines
7169 };
7270 };
7371
72+#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
73+
7474 #define __put_get_user_asm(to, from, size, oac_spec) \
7575 ({ \
7676 int __rc; \
arch/s390/kernel/module.c+18−19
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #define DEBUGP(fmt , ...)
3434 #endif
3535
36−#define PLT_ENTRY_SIZE 20
36+#define PLT_ENTRY_SIZE 22
3737
3838 void *module_alloc(unsigned long size)
3939 {
@@ -341,27 +341,26 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, · 301 unmodified lines
341341 case R_390_PLTOFF32: /* 32 bit offset from GOT to PLT. */
342342 case R_390_PLTOFF64: /* 16 bit offset from GOT to PLT. */
343343 if (info->plt_initialized == 0) {
344− unsigned int insn[5];
345− unsigned int *ip = me->core_layout.base +
346− me->arch.plt_offset +
347− info->plt_offset;
348−
349− insn[0] = 0x0d10e310; /* basr 1,0 */
350− insn[1] = 0x100a0004; /* lg 1,10(1) */
344+ unsigned char insn[PLT_ENTRY_SIZE];
345+ char *plt_base;
346+ char *ip;
347+
348+ plt_base = me->core_layout.base + me->arch.plt_offset;
349+ ip = plt_base + info->plt_offset;
350+ *(int *)insn = 0x0d10e310; /* basr 1,0 */
351+ *(int *)&insn[4] = 0x100c0004; /* lg 1,12(1) */
351352 if (IS_ENABLED(CONFIG_EXPOLINE) && !nospec_disable) {
352− unsigned int *ij;
353− ij = me->core_layout.base +
354− me->arch.plt_offset +
355− me->arch.plt_size - PLT_ENTRY_SIZE;
356− insn[2] = 0xa7f40000 + /* j __jump_r1 */
357− (unsigned int)(u16)
358− (((unsigned long) ij - 8 -
359− (unsigned long) ip) / 2);
353+ char *jump_r1;
354+
355+ jump_r1 = plt_base + me->arch.plt_size -
356+ PLT_ENTRY_SIZE;
357+ /* brcl 0xf,__jump_r1 */
358+ *(short *)&insn[8] = 0xc0f4;
359+ *(int *)&insn[10] = (jump_r1 - (ip + 8)) / 2;
360360 } else {
361− insn[2] = 0x07f10000; /* br %r1 */
361+ *(int *)&insn[8] = 0x07f10000; /* br %r1 */
362362 }
363− insn[3] = (unsigned int) (val >> 32);
364− insn[4] = (unsigned int) val;
363+ *(long *)&insn[14] = val;
365364
366365 write(ip, insn, sizeof(insn));
367366 info->plt_initialized = 1;
arch/s390/kernel/nmi.c+22−5
@@ -264,7 +264,14 @@ static int notrace s390_validate_registers(union mci mci, int umode) · 263 unmodified lines
264264 /* Validate vector registers */
265265 union ctlreg0 cr0;
266266
267− if (!mci.vr) {
267+ /*
268+ * The vector validity must only be checked if not running a
269+ * KVM guest. For KVM guests the machine check is forwarded by
270+ * KVM and it is the responsibility of the guest to take
271+ * appropriate actions. The host vector or FPU values have been
272+ * saved by KVM and will be restored by KVM.
273+ */
274+ if (!mci.vr && !test_cpu_flag(CIF_MCCK_GUEST)) {
268275 /*
269276 * Vector registers can't be restored. If the kernel
270277 * currently uses vector registers the system is
@@ -307,11 +314,21 @@ static int notrace s390_validate_registers(union mci mci, int umode) · 36 unmodified lines
307314 if (cr2.gse) {
308315 if (!mci.gs) {
309316 /*
310− * Guarded storage register can't be restored and
311− * the current processes uses guarded storage.
312− * It has to be terminated.
317+ * 2 cases:
318+ * - machine check in kernel or userspace
319+ * - machine check while running SIE (KVM guest)
320+ * For kernel or userspace the userspace values of
321+ * guarded storage control can not be recreated, the
322+ * process must be terminated.
323+ * For SIE the guest values of guarded storage can not
324+ * be recreated. This is either due to a bug or due to
325+ * GS being disabled in the guest. The guest will be
326+ * notified by KVM code and the guests machine check
327+ * handling must take care of this. The host values
328+ * are saved by KVM and are not affected.
313329 */
314− kill_task = 1;
330+ if (!test_cpu_flag(CIF_MCCK_GUEST))
331+ kill_task = 1;
315332 } else {
316333 load_gs_cb((struct gs_cb *)mcesa->guarded_storage_save_area);
317334 }
arch/s390/kvm/kvm-s390.c+2−0
@@ -4667,6 +4667,8 @@ static long kvm_s390_guest_sida_op(struct kvm_vcpu *vcpu, · 4666 unmodified lines
46674667 return -EINVAL;
46684668 if (mop->size + mop->sida_offset > sida_size(vcpu->arch.sie_block))
46694669 return -E2BIG;
4670+ if (!kvm_s390_pv_cpu_is_protected(vcpu))
4671+ return -EINVAL;
46704672
46714673 switch (mop->op) {
46724674 case KVM_S390_MEMOP_SIDA_READ:
arch/s390/lib/Makefile+3−0
@@ -17,4 +17,7 @@ KASAN_SANITIZE_uaccess.o := n · 16 unmodified lines
1717 obj-$(CONFIG_S390_UNWIND_SELFTEST) += test_unwind.o
1818 CFLAGS_test_unwind.o += -fno-optimize-sibling-calls
1919
20+obj-$(CONFIG_S390_MODULES_SANITY_TEST) += test_modules.o
21+obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o
22+
2023 lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
arch/s390/lib/test_modules.c+32−0
@@ -0,0 +1,32 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+
3+#include <kunit/test.h>
4+#include <linux/module.h>
5+
6+#include "test_modules.h"
7+
8+/*
9+ * Test that modules with many relocations are loaded properly.
10+ */
11+static void test_modules_many_vmlinux_relocs(struct kunit *test)
12+{
13+ int result = 0;
14+
15+#define CALL_RETURN(i) result += test_modules_return_ ## i()
16+ REPEAT_10000(CALL_RETURN);
17+ KUNIT_ASSERT_EQ(test, result, 49995000);
18+}
19+
20+static struct kunit_case modules_testcases[] = {
21+ KUNIT_CASE(test_modules_many_vmlinux_relocs),
22+ {}
23+};
24+
25+static struct kunit_suite modules_test_suite = {
26+ .name = "modules_test_s390",
27+ .test_cases = modules_testcases,
28+};
29+
30+kunit_test_suites(&modules_test_suite);
31+
32+MODULE_LICENSE("GPL");
arch/s390/lib/test_modules.h+53−0
@@ -0,0 +1,53 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
2+#ifndef TEST_MODULES_H
3+#define TEST_MODULES_H
4+
5+#define __REPEAT_10000_3(f, x) \
6+ f(x ## 0); \
7+ f(x ## 1); \
8+ f(x ## 2); \
9+ f(x ## 3); \
10+ f(x ## 4); \
11+ f(x ## 5); \
12+ f(x ## 6); \
13+ f(x ## 7); \
14+ f(x ## 8); \
15+ f(x ## 9)
16+#define __REPEAT_10000_2(f, x) \
17+ __REPEAT_10000_3(f, x ## 0); \
18+ __REPEAT_10000_3(f, x ## 1); \
19+ __REPEAT_10000_3(f, x ## 2); \
20+ __REPEAT_10000_3(f, x ## 3); \
21+ __REPEAT_10000_3(f, x ## 4); \
22+ __REPEAT_10000_3(f, x ## 5); \
23+ __REPEAT_10000_3(f, x ## 6); \
24+ __REPEAT_10000_3(f, x ## 7); \
25+ __REPEAT_10000_3(f, x ## 8); \
26+ __REPEAT_10000_3(f, x ## 9)
27+#define __REPEAT_10000_1(f, x) \
28+ __REPEAT_10000_2(f, x ## 0); \
29+ __REPEAT_10000_2(f, x ## 1); \
30+ __REPEAT_10000_2(f, x ## 2); \
31+ __REPEAT_10000_2(f, x ## 3); \
32+ __REPEAT_10000_2(f, x ## 4); \
33+ __REPEAT_10000_2(f, x ## 5); \
34+ __REPEAT_10000_2(f, x ## 6); \
35+ __REPEAT_10000_2(f, x ## 7); \
36+ __REPEAT_10000_2(f, x ## 8); \
37+ __REPEAT_10000_2(f, x ## 9)
38+#define REPEAT_10000(f) \
39+ __REPEAT_10000_1(f, 0); \
40+ __REPEAT_10000_1(f, 1); \
41+ __REPEAT_10000_1(f, 2); \
42+ __REPEAT_10000_1(f, 3); \
43+ __REPEAT_10000_1(f, 4); \
44+ __REPEAT_10000_1(f, 5); \
45+ __REPEAT_10000_1(f, 6); \
46+ __REPEAT_10000_1(f, 7); \
47+ __REPEAT_10000_1(f, 8); \
48+ __REPEAT_10000_1(f, 9)
49+
50+#define DECLARE_RETURN(i) int test_modules_return_ ## i(void)
51+REPEAT_10000(DECLARE_RETURN);
52+
53+#endif
arch/s390/lib/test_modules_helpers.c+13−0
@@ -0,0 +1,13 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+
3+#include <linux/export.h>
4+
5+#include "test_modules.h"
6+
7+#define DEFINE_RETURN(i) \
8+ int test_modules_return_ ## i(void) \
9+ { \
10+ return 1 ## i - 10000; \
11+ } \
12+ EXPORT_SYMBOL_GPL(test_modules_return_ ## i)
13+REPEAT_10000(DEFINE_RETURN);
arch/x86/Kconfig+1−0
@@ -186,6 +186,7 @@ config X86 · 185 unmodified lines
186186 select HAVE_CONTEXT_TRACKING_OFFSTACK if HAVE_CONTEXT_TRACKING
187187 select HAVE_C_RECORDMCOUNT
188188 select HAVE_OBJTOOL_MCOUNT if STACK_VALIDATION
189+ select HAVE_BUILDTIME_MCOUNT_SORT
189190 select HAVE_DEBUG_KMEMLEAK
190191 select HAVE_DMA_CONTIGUOUS
191192 select HAVE_DYNAMIC_FTRACE
arch/x86/crypto/blake2s-shash.c+2−2
@@ -18,12 +18,12 @@ · 17 unmodified lines
1818 static int crypto_blake2s_update_x86(struct shash_desc *desc,
1919 const u8 *in, unsigned int inlen)
2020 {
21− return crypto_blake2s_update(desc, in, inlen, blake2s_compress);
21+ return crypto_blake2s_update(desc, in, inlen, false);
2222 }
2323
2424 static int crypto_blake2s_final_x86(struct shash_desc *desc, u8 *out)
2525 {
26− return crypto_blake2s_final(desc, out, blake2s_compress);
26+ return crypto_blake2s_final(desc, out, false);
2727 }
2828
2929 #define BLAKE2S_ALG(name, driver_name, digest_size) \
arch/x86/events/intel/core.c+28−0
@@ -4703,6 +4703,19 @@ static __initconst const struct x86_pmu intel_pmu = { · 4702 unmodified lines
47034703 .lbr_read = intel_pmu_lbr_read_64,
47044704 .lbr_save = intel_pmu_lbr_save,
47054705 .lbr_restore = intel_pmu_lbr_restore,
4706+
4707+ /*
4708+ * SMM has access to all 4 rings and while traditionally SMM code only
4709+ * ran in CPL0, 2021-era firmware is starting to make use of CPL3 in SMM.
4710+ *
4711+ * Since the EVENTSEL.{USR,OS} CPL filtering makes no distinction
4712+ * between SMM or not, this results in what should be pure userspace
4713+ * counters including SMM data.
4714+ *
4715+ * This is a clear privilege issue, therefore globally disable
4716+ * counting SMM by default.
4717+ */
4718+ .attr_freeze_on_smi = 1,
47064719 };
47074720
47084721 static __init void intel_clovertown_quirk(void)
@@ -6236,6 +6249,19 @@ __init int intel_pmu_init(void) · 1527 unmodified lines
62366249 pmu->num_counters = x86_pmu.num_counters;
62376250 pmu->num_counters_fixed = x86_pmu.num_counters_fixed;
62386251 }
6252+
6253+ /*
6254+ * Quirk: For some Alder Lake machine, when all E-cores are disabled in
6255+ * a BIOS, the leaf 0xA will enumerate all counters of P-cores. However,
6256+ * the X86_FEATURE_HYBRID_CPU is still set. The above codes will
6257+ * mistakenly add extra counters for P-cores. Correct the number of
6258+ * counters here.
6259+ */
6260+ if ((pmu->num_counters > 8) || (pmu->num_counters_fixed > 4)) {
6261+ pmu->num_counters = x86_pmu.num_counters;
6262+ pmu->num_counters_fixed = x86_pmu.num_counters_fixed;
6263+ }
6264+
62396265 pmu->max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, pmu->num_counters);
62406266 pmu->unconstrained = (struct event_constraint)
62416267 __EVENT_CONSTRAINT(0, (1ULL << pmu->num_counters) - 1,
@@ -6340,6 +6366,8 @@ __init int intel_pmu_init(void) · 98 unmodified lines
63406366 }
63416367
63426368 if (x86_pmu.lbr_nr) {
6369+ intel_pmu_lbr_init();
6370+
63436371 pr_cont("%d-deep LBR, ", x86_pmu.lbr_nr);
63446372
63456373 /* only support branch_stack snapshot for perfmon >= v2 */
arch/x86/events/intel/lbr.c+101−67
@@ -8,14 +8,6 @@ · 7 unmodified lines
88
99 #include "../perf_event.h"
1010
11−static const enum {
12− LBR_EIP_FLAGS = 1,
13− LBR_TSX = 2,
14−} lbr_desc[LBR_FORMAT_MAX_KNOWN + 1] = {
15− [LBR_FORMAT_EIP_FLAGS] = LBR_EIP_FLAGS,
16− [LBR_FORMAT_EIP_FLAGS2] = LBR_EIP_FLAGS | LBR_TSX,
17−};
18−
1911 /*
2012 * Intel LBR_SELECT bits
2113 * Intel Vol3a, April 2011, Section 16.7 Table 16-10
@@ -243,7 +235,7 @@ void intel_pmu_lbr_reset_64(void) · 221 unmodified lines
243235 for (i = 0; i < x86_pmu.lbr_nr; i++) {
244236 wrmsrl(x86_pmu.lbr_from + i, 0);
245237 wrmsrl(x86_pmu.lbr_to + i, 0);
246− if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO)
238+ if (x86_pmu.lbr_has_info)
247239 wrmsrl(x86_pmu.lbr_info + i, 0);
248240 }
249241 }
@@ -305,11 +297,10 @@ enum { · 55 unmodified lines
305297 */
306298 static inline bool lbr_from_signext_quirk_needed(void)
307299 {
308− int lbr_format = x86_pmu.intel_cap.lbr_format;
309300 bool tsx_support = boot_cpu_has(X86_FEATURE_HLE) ||
310301 boot_cpu_has(X86_FEATURE_RTM);
311302
312− return !tsx_support && (lbr_desc[lbr_format] & LBR_TSX);
303+ return !tsx_support && x86_pmu.lbr_has_tsx;
313304 }
314305
315306 static DEFINE_STATIC_KEY_FALSE(lbr_from_quirk_key);
@@ -427,12 +418,12 @@ rdlbr_all(struct lbr_entry *lbr, unsigned int idx, bool need_info) · 111 unmodified lines
427418
428419 void intel_pmu_lbr_restore(void *ctx)
429420 {
430− bool need_info = x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO;
431421 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
432422 struct x86_perf_task_context *task_ctx = ctx;
433− int i;
434− unsigned lbr_idx, mask;
423+ bool need_info = x86_pmu.lbr_has_info;
435424 u64 tos = task_ctx->tos;
425+ unsigned lbr_idx, mask;
426+ int i;
436427
437428 mask = x86_pmu.lbr_nr - 1;
438429 for (i = 0; i < task_ctx->valid_lbrs; i++) {
@@ -444,7 +435,7 @@ void intel_pmu_lbr_restore(void *ctx) · 5 unmodified lines
444435 lbr_idx = (tos - i) & mask;
445436 wrlbr_from(lbr_idx, 0);
446437 wrlbr_to(lbr_idx, 0);
447− if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO)
438+ if (need_info)
448439 wrlbr_info(lbr_idx, 0);
449440 }
450441
@@ -519,9 +510,9 @@ static void __intel_pmu_lbr_restore(void *ctx) · 68 unmodified lines
519510
520511 void intel_pmu_lbr_save(void *ctx)
521512 {
522− bool need_info = x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO;
523513 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
524514 struct x86_perf_task_context *task_ctx = ctx;
515+ bool need_info = x86_pmu.lbr_has_info;
525516 unsigned lbr_idx, mask;
526517 u64 tos;
527518 int i;
@@ -816,7 +807,6 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) · 288 unmodified lines
816807 {
817808 bool need_info = false, call_stack = false;
818809 unsigned long mask = x86_pmu.lbr_nr - 1;
819− int lbr_format = x86_pmu.intel_cap.lbr_format;
820810 u64 tos = intel_pmu_lbr_tos();
821811 int i;
822812 int out = 0;
@@ -831,9 +821,7 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) · 8 unmodified lines
831821 for (i = 0; i < num; i++) {
832822 unsigned long lbr_idx = (tos - i) & mask;
833823 u64 from, to, mis = 0, pred = 0, in_tx = 0, abort = 0;
834− int skip = 0;
835824 u16 cycles = 0;
836− int lbr_flags = lbr_desc[lbr_format];
837825
838826 from = rdlbr_from(lbr_idx, NULL);
839827 to = rdlbr_to(lbr_idx, NULL);
@@ -845,37 +833,39 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) · 5 unmodified lines
845833 if (call_stack && !from)
846834 break;
847835
848− if (lbr_format == LBR_FORMAT_INFO && need_info) {
849− u64 info;
850−
851− info = rdlbr_info(lbr_idx, NULL);
852− mis = !!(info & LBR_INFO_MISPRED);
853− pred = !mis;
854− in_tx = !!(info & LBR_INFO_IN_TX);
855− abort = !!(info & LBR_INFO_ABORT);
856− cycles = (info & LBR_INFO_CYCLES);
857− }
858−
859− if (lbr_format == LBR_FORMAT_TIME) {
860− mis = !!(from & LBR_FROM_FLAG_MISPRED);
861− pred = !mis;
862− skip = 1;
863− cycles = ((to >> 48) & LBR_INFO_CYCLES);
864−
865− to = (u64)((((s64)to) << 16) >> 16);
866− }
867−
868− if (lbr_flags & LBR_EIP_FLAGS) {
869− mis = !!(from & LBR_FROM_FLAG_MISPRED);
870− pred = !mis;
871− skip = 1;
872− }
873− if (lbr_flags & LBR_TSX) {
874− in_tx = !!(from & LBR_FROM_FLAG_IN_TX);
875− abort = !!(from & LBR_FROM_FLAG_ABORT);
876− skip = 3;
836+ if (x86_pmu.lbr_has_info) {
837+ if (need_info) {
838+ u64 info;
839+
840+ info = rdlbr_info(lbr_idx, NULL);
841+ mis = !!(info & LBR_INFO_MISPRED);
842+ pred = !mis;
843+ cycles = (info & LBR_INFO_CYCLES);
844+ if (x86_pmu.lbr_has_tsx) {
845+ in_tx = !!(info & LBR_INFO_IN_TX);
846+ abort = !!(info & LBR_INFO_ABORT);
847+ }
848+ }
849+ } else {
850+ int skip = 0;
851+
852+ if (x86_pmu.lbr_from_flags) {
853+ mis = !!(from & LBR_FROM_FLAG_MISPRED);
854+ pred = !mis;
855+ skip = 1;
856+ }
857+ if (x86_pmu.lbr_has_tsx) {
858+ in_tx = !!(from & LBR_FROM_FLAG_IN_TX);
859+ abort = !!(from & LBR_FROM_FLAG_ABORT);
860+ skip = 3;
861+ }
862+ from = (u64)((((s64)from) << skip) >> skip);
863+
864+ if (x86_pmu.lbr_to_cycles) {
865+ cycles = ((to >> 48) & LBR_INFO_CYCLES);
866+ to = (u64)((((s64)to) << 16) >> 16);
867+ }
877868 }
878− from = (u64)((((s64)from) << skip) >> skip);
879869
880870 /*
881871 * Some CPUs report duplicated abort records,
@@ -903,37 +893,40 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) · 21 unmodified lines
903893 cpuc->lbr_stack.hw_idx = tos;
904894 }
905895
896+static DEFINE_STATIC_KEY_FALSE(x86_lbr_mispred);
897+static DEFINE_STATIC_KEY_FALSE(x86_lbr_cycles);
898+static DEFINE_STATIC_KEY_FALSE(x86_lbr_type);
899+
906900 static __always_inline int get_lbr_br_type(u64 info)
907901 {
908− if (!static_cpu_has(X86_FEATURE_ARCH_LBR) || !x86_pmu.lbr_br_type)
909− return 0;
902+ int type = 0;
910903
911− return (info & LBR_INFO_BR_TYPE) >> LBR_INFO_BR_TYPE_OFFSET;
904+ if (static_branch_likely(&x86_lbr_type))
905+ type = (info & LBR_INFO_BR_TYPE) >> LBR_INFO_BR_TYPE_OFFSET;
906+
907+ return type;
912908 }
913909
914910 static __always_inline bool get_lbr_mispred(u64 info)
915911 {
916− if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !x86_pmu.lbr_mispred)
917− return 0;
912+ bool mispred = 0;
918913
919− return !!(info & LBR_INFO_MISPRED);
920−}
914+ if (static_branch_likely(&x86_lbr_mispred))
915+ mispred = !!(info & LBR_INFO_MISPRED);
921916
922−static __always_inline bool get_lbr_predicted(u64 info)
923−{
924− if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !x86_pmu.lbr_mispred)
925− return 0;
926−
927− return !(info & LBR_INFO_MISPRED);
917+ return mispred;
928918 }
929919
930920 static __always_inline u16 get_lbr_cycles(u64 info)
931921 {
922+ u16 cycles = info & LBR_INFO_CYCLES;
923+
932924 if (static_cpu_has(X86_FEATURE_ARCH_LBR) &&
933− !(x86_pmu.lbr_timed_lbr && info & LBR_INFO_CYC_CNT_VALID))
934− return 0;
925+ (!static_branch_likely(&x86_lbr_cycles) ||
926+ !(info & LBR_INFO_CYC_CNT_VALID)))
927+ cycles = 0;
935928
936− return info & LBR_INFO_CYCLES;
929+ return cycles;
937930 }
938931
939932 static void intel_pmu_store_lbr(struct cpu_hw_events *cpuc,
@@ -961,7 +954,7 @@ static void intel_pmu_store_lbr(struct cpu_hw_events *cpuc, · 21 unmodified lines
961954 e->from = from;
962955 e->to = to;
963956 e->mispred = get_lbr_mispred(info);
964− e->predicted = get_lbr_predicted(info);
957+ e->predicted = !e->mispred;
965958 e->in_tx = !!(info & LBR_INFO_IN_TX);
966959 e->abort = !!(info & LBR_INFO_ABORT);
967960 e->cycles = get_lbr_cycles(info);
@@ -1120,7 +1113,7 @@ static int intel_pmu_setup_hw_lbr_filter(struct perf_event *event) · 152 unmodified lines
11201113
11211114 if ((br_type & PERF_SAMPLE_BRANCH_NO_CYCLES) &&
11221115 (br_type & PERF_SAMPLE_BRANCH_NO_FLAGS) &&
1123− (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO))
1116+ x86_pmu.lbr_has_info)
11241117 reg->config |= LBR_NO_INFO;
11251118
11261119 return 0;
@@ -1706,6 +1699,38 @@ void intel_pmu_lbr_init_knl(void) · 579 unmodified lines
17061699 x86_pmu.intel_cap.lbr_format = LBR_FORMAT_EIP_FLAGS;
17071700 }
17081701
1702+void intel_pmu_lbr_init(void)
1703+{
1704+ switch (x86_pmu.intel_cap.lbr_format) {
1705+ case LBR_FORMAT_EIP_FLAGS2:
1706+ x86_pmu.lbr_has_tsx = 1;
1707+ fallthrough;
1708+ case LBR_FORMAT_EIP_FLAGS:
1709+ x86_pmu.lbr_from_flags = 1;
1710+ break;
1711+
1712+ case LBR_FORMAT_INFO:
1713+ x86_pmu.lbr_has_tsx = 1;
1714+ fallthrough;
1715+ case LBR_FORMAT_INFO2:
1716+ x86_pmu.lbr_has_info = 1;
1717+ break;
1718+
1719+ case LBR_FORMAT_TIME:
1720+ x86_pmu.lbr_from_flags = 1;
1721+ x86_pmu.lbr_to_cycles = 1;
1722+ break;
1723+ }
1724+
1725+ if (x86_pmu.lbr_has_info) {
1726+ /*
1727+ * Only used in combination with baseline pebs.
1728+ */
1729+ static_branch_enable(&x86_lbr_mispred);
1730+ static_branch_enable(&x86_lbr_cycles);
1731+ }
1732+}
1733+
17091734 /*
17101735 * LBR state size is variable based on the max number of registers.
17111736 * This calculates the expected state size, which should match
@@ -1726,6 +1751,9 @@ static bool is_arch_lbr_xsave_available(void) · 14 unmodified lines
17261751 * Check the LBR state with the corresponding software structure.
17271752 * Disable LBR XSAVES support if the size doesn't match.
17281753 */
1754+ if (xfeature_size(XFEATURE_LBR) == 0)
1755+ return false;
1756+
17291757 if (WARN_ON(xfeature_size(XFEATURE_LBR) != get_lbr_state_size()))
17301758 return false;
17311759
@@ -1765,6 +1793,12 @@ void __init intel_pmu_arch_lbr_init(void) · 33 unmodified lines
17651793 x86_pmu.lbr_br_type = ecx.split.lbr_br_type;
17661794 x86_pmu.lbr_nr = lbr_nr;
17671795
1796+ if (x86_pmu.lbr_mispred)
1797+ static_branch_enable(&x86_lbr_mispred);
1798+ if (x86_pmu.lbr_timed_lbr)
1799+ static_branch_enable(&x86_lbr_cycles);
1800+ if (x86_pmu.lbr_br_type)
1801+ static_branch_enable(&x86_lbr_type);
17681802
17691803 arch_lbr_xsave = is_arch_lbr_xsave_available();
17701804 if (arch_lbr_xsave) {
arch/x86/events/intel/pt.c+3−2
@@ -897,8 +897,9 @@ static void pt_handle_status(struct pt *pt) · 896 unmodified lines
897897 * means we are already losing data; need to let the decoder
898898 * know.
899899 */
900− if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) ||
901− buf->output_off == pt_buffer_region_size(buf)) {
900+ if (!buf->single &&
901+ (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) ||
902+ buf->output_off == pt_buffer_region_size(buf))) {
902903 perf_aux_output_flag(&pt->handle,
903904 PERF_AUX_FLAG_TRUNCATED);
904905 advance++;
arch/x86/events/intel/uncore.c+1−1
@@ -1762,7 +1762,7 @@ static const struct intel_uncore_init_fun rkl_uncore_init __initconst = { · 1761 unmodified lines
17621762
17631763 static const struct intel_uncore_init_fun adl_uncore_init __initconst = {
17641764 .cpu_init = adl_uncore_cpu_init,
1765− .mmio_init = tgl_uncore_mmio_init,
1765+ .mmio_init = adl_uncore_mmio_init,
17661766 };
17671767
17681768 static const struct intel_uncore_init_fun icx_uncore_init __initconst = {
arch/x86/events/intel/uncore.h+2−1
@@ -584,10 +584,11 @@ void snb_uncore_cpu_init(void); · 583 unmodified lines
584584 void nhm_uncore_cpu_init(void);
585585 void skl_uncore_cpu_init(void);
586586 void icl_uncore_cpu_init(void);
587−void adl_uncore_cpu_init(void);
588587 void tgl_uncore_cpu_init(void);
588+void adl_uncore_cpu_init(void);
589589 void tgl_uncore_mmio_init(void);
590590 void tgl_l_uncore_mmio_init(void);
591+void adl_uncore_mmio_init(void);
591592 int snb_pci2phy_map_init(int devid);
592593
593594 /* uncore_snbep.c */
arch/x86/events/intel/uncore_discovery.c+2−2
@@ -494,8 +494,8 @@ void intel_generic_uncore_mmio_enable_box(struct intel_uncore_box *box) · 493 unmodified lines
494494 writel(0, box->io_addr);
495495 }
496496
497−static void intel_generic_uncore_mmio_enable_event(struct intel_uncore_box *box,
498− struct perf_event *event)
497+void intel_generic_uncore_mmio_enable_event(struct intel_uncore_box *box,
498+ struct perf_event *event)
499499 {
500500 struct hw_perf_event *hwc = &event->hw;
501501
arch/x86/events/intel/uncore_discovery.h+2−0
@@ -139,6 +139,8 @@ void intel_generic_uncore_mmio_disable_box(struct intel_uncore_box *box); · 138 unmodified lines
139139 void intel_generic_uncore_mmio_enable_box(struct intel_uncore_box *box);
140140 void intel_generic_uncore_mmio_disable_event(struct intel_uncore_box *box,
141141 struct perf_event *event);
142+void intel_generic_uncore_mmio_enable_event(struct intel_uncore_box *box,
143+ struct perf_event *event);
142144
143145 void intel_generic_uncore_pci_init_box(struct intel_uncore_box *box);
144146 void intel_generic_uncore_pci_disable_box(struct intel_uncore_box *box);
arch/x86/events/intel/uncore_snb.c+213−1
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /* Nehalem/SandBridge/Haswell/Broadwell/Skylake uncore support */
33 #include "uncore.h"
4+#include "uncore_discovery.h"
45
56 /* Uncore IMC PCI IDs */
67 #define PCI_DEVICE_ID_INTEL_SNB_IMC 0x0100
@@ -64,6 +65,20 @@ · 57 unmodified lines
6465 #define PCI_DEVICE_ID_INTEL_RKL_2_IMC 0x4c53
6566 #define PCI_DEVICE_ID_INTEL_ADL_1_IMC 0x4660
6667 #define PCI_DEVICE_ID_INTEL_ADL_2_IMC 0x4641
68+#define PCI_DEVICE_ID_INTEL_ADL_3_IMC 0x4601
69+#define PCI_DEVICE_ID_INTEL_ADL_4_IMC 0x4602
70+#define PCI_DEVICE_ID_INTEL_ADL_5_IMC 0x4609
71+#define PCI_DEVICE_ID_INTEL_ADL_6_IMC 0x460a
72+#define PCI_DEVICE_ID_INTEL_ADL_7_IMC 0x4621
73+#define PCI_DEVICE_ID_INTEL_ADL_8_IMC 0x4623
74+#define PCI_DEVICE_ID_INTEL_ADL_9_IMC 0x4629
75+#define PCI_DEVICE_ID_INTEL_ADL_10_IMC 0x4637
76+#define PCI_DEVICE_ID_INTEL_ADL_11_IMC 0x463b
77+#define PCI_DEVICE_ID_INTEL_ADL_12_IMC 0x4648
78+#define PCI_DEVICE_ID_INTEL_ADL_13_IMC 0x4649
79+#define PCI_DEVICE_ID_INTEL_ADL_14_IMC 0x4650
80+#define PCI_DEVICE_ID_INTEL_ADL_15_IMC 0x4668
81+#define PCI_DEVICE_ID_INTEL_ADL_16_IMC 0x4670
6782
6883 /* SNB event control */
6984 #define SNB_UNC_CTL_EV_SEL_MASK 0x000000ff
@@ -155,6 +170,7 @@ · 85 unmodified lines
155170
156171 DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7");
157172 DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
173+DEFINE_UNCORE_FORMAT_ATTR(chmask, chmask, "config:8-11");
158174 DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18");
159175 DEFINE_UNCORE_FORMAT_ATTR(inv, inv, "config:23");
160176 DEFINE_UNCORE_FORMAT_ATTR(cmask5, cmask, "config:24-28");
@@ -1334,6 +1350,62 @@ static const struct pci_device_id tgl_uncore_pci_ids[] = { · 1173 unmodified lines
13341350 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_2_IMC),
13351351 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
13361352 },
1353+ { /* IMC */
1354+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_3_IMC),
1355+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1356+ },
1357+ { /* IMC */
1358+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_4_IMC),
1359+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1360+ },
1361+ { /* IMC */
1362+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_5_IMC),
1363+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1364+ },
1365+ { /* IMC */
1366+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_6_IMC),
1367+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1368+ },
1369+ { /* IMC */
1370+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_7_IMC),
1371+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1372+ },
1373+ { /* IMC */
1374+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_8_IMC),
1375+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1376+ },
1377+ { /* IMC */
1378+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_9_IMC),
1379+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1380+ },
1381+ { /* IMC */
1382+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_10_IMC),
1383+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1384+ },
1385+ { /* IMC */
1386+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_11_IMC),
1387+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1388+ },
1389+ { /* IMC */
1390+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_12_IMC),
1391+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1392+ },
1393+ { /* IMC */
1394+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_13_IMC),
1395+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1396+ },
1397+ { /* IMC */
1398+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_14_IMC),
1399+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1400+ },
1401+ { /* IMC */
1402+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_15_IMC),
1403+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1404+ },
1405+ { /* IMC */
1406+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_16_IMC),
1407+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
1408+ },
13371409 { /* end: all zeroes */ }
13381410 };
13391411
@@ -1390,7 +1462,8 @@ static struct pci_dev *tgl_uncore_get_mc_dev(void) · 50 unmodified lines
13901462 #define TGL_UNCORE_MMIO_IMC_MEM_OFFSET 0x10000
13911463 #define TGL_UNCORE_PCI_IMC_MAP_SIZE 0xe000
13921464
1393−static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
1465+static void __uncore_imc_init_box(struct intel_uncore_box *box,
1466+ unsigned int base_offset)
13941467 {
13951468 struct pci_dev *pdev = tgl_uncore_get_mc_dev();
13961469 struct intel_uncore_pmu *pmu = box->pmu;
@@ -1417,11 +1490,17 @@ static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box) · 20 unmodified lines
14171490 addr |= ((resource_size_t)mch_bar << 32);
14181491 #endif
14191492
1493+ addr += base_offset;
14201494 box->io_addr = ioremap(addr, type->mmio_map_size);
14211495 if (!box->io_addr)
14221496 pr_warn("perf uncore: Failed to ioremap for %s.\n", type->name);
14231497 }
14241498
1499+static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
1500+{
1501+ __uncore_imc_init_box(box, 0);
1502+}
1503+
14251504 static struct intel_uncore_ops tgl_uncore_imc_freerunning_ops = {
14261505 .init_box = tgl_uncore_imc_freerunning_init_box,
14271506 .exit_box = uncore_mmio_exit_box,
@@ -1469,3 +1548,136 @@ void tgl_uncore_mmio_init(void) · 41 unmodified lines
14691548 }
14701549
14711550 /* end of Tiger Lake MMIO uncore support */
1551+
1552+/* Alder Lake MMIO uncore support */
1553+#define ADL_UNCORE_IMC_BASE 0xd900
1554+#define ADL_UNCORE_IMC_MAP_SIZE 0x200
1555+#define ADL_UNCORE_IMC_CTR 0xe8
1556+#define ADL_UNCORE_IMC_CTRL 0xd0
1557+#define ADL_UNCORE_IMC_GLOBAL_CTL 0xc0
1558+#define ADL_UNCORE_IMC_BOX_CTL 0xc4
1559+#define ADL_UNCORE_IMC_FREERUNNING_BASE 0xd800
1560+#define ADL_UNCORE_IMC_FREERUNNING_MAP_SIZE 0x100
1561+
1562+#define ADL_UNCORE_IMC_CTL_FRZ (1 << 0)
1563+#define ADL_UNCORE_IMC_CTL_RST_CTRL (1 << 1)
1564+#define ADL_UNCORE_IMC_CTL_RST_CTRS (1 << 2)
1565+#define ADL_UNCORE_IMC_CTL_INT (ADL_UNCORE_IMC_CTL_RST_CTRL | \
1566+ ADL_UNCORE_IMC_CTL_RST_CTRS)
1567+
1568+static void adl_uncore_imc_init_box(struct intel_uncore_box *box)
1569+{
1570+ __uncore_imc_init_box(box, ADL_UNCORE_IMC_BASE);
1571+
1572+ /* The global control in MC1 can control both MCs. */
1573+ if (box->io_addr && (box->pmu->pmu_idx == 1))
1574+ writel(ADL_UNCORE_IMC_CTL_INT, box->io_addr + ADL_UNCORE_IMC_GLOBAL_CTL);
1575+}
1576+
1577+static void adl_uncore_mmio_disable_box(struct intel_uncore_box *box)
1578+{
1579+ if (!box->io_addr)
1580+ return;
1581+
1582+ writel(ADL_UNCORE_IMC_CTL_FRZ, box->io_addr + uncore_mmio_box_ctl(box));
1583+}
1584+
1585+static void adl_uncore_mmio_enable_box(struct intel_uncore_box *box)
1586+{
1587+ if (!box->io_addr)
1588+ return;
1589+
1590+ writel(0, box->io_addr + uncore_mmio_box_ctl(box));
1591+}
1592+
1593+static struct intel_uncore_ops adl_uncore_mmio_ops = {
1594+ .init_box = adl_uncore_imc_init_box,
1595+ .exit_box = uncore_mmio_exit_box,
1596+ .disable_box = adl_uncore_mmio_disable_box,
1597+ .enable_box = adl_uncore_mmio_enable_box,
1598+ .disable_event = intel_generic_uncore_mmio_disable_event,
1599+ .enable_event = intel_generic_uncore_mmio_enable_event,
1600+ .read_counter = uncore_mmio_read_counter,
1601+};
1602+
1603+#define ADL_UNC_CTL_CHMASK_MASK 0x00000f00
1604+#define ADL_UNC_IMC_EVENT_MASK (SNB_UNC_CTL_EV_SEL_MASK | \
1605+ ADL_UNC_CTL_CHMASK_MASK | \
1606+ SNB_UNC_CTL_EDGE_DET)
1607+
1608+static struct attribute *adl_uncore_imc_formats_attr[] = {
1609+ &format_attr_event.attr,
1610+ &format_attr_chmask.attr,
1611+ &format_attr_edge.attr,
1612+ NULL,
1613+};
1614+
1615+static const struct attribute_group adl_uncore_imc_format_group = {
1616+ .name = "format",
1617+ .attrs = adl_uncore_imc_formats_attr,
1618+};
1619+
1620+static struct intel_uncore_type adl_uncore_imc = {
1621+ .name = "imc",
1622+ .num_counters = 5,
1623+ .num_boxes = 2,
1624+ .perf_ctr_bits = 64,
1625+ .perf_ctr = ADL_UNCORE_IMC_CTR,
1626+ .event_ctl = ADL_UNCORE_IMC_CTRL,
1627+ .event_mask = ADL_UNC_IMC_EVENT_MASK,
1628+ .box_ctl = ADL_UNCORE_IMC_BOX_CTL,
1629+ .mmio_offset = 0,
1630+ .mmio_map_size = ADL_UNCORE_IMC_MAP_SIZE,
1631+ .ops = &adl_uncore_mmio_ops,
1632+ .format_group = &adl_uncore_imc_format_group,
1633+};
1634+
1635+enum perf_adl_uncore_imc_freerunning_types {
1636+ ADL_MMIO_UNCORE_IMC_DATA_TOTAL,
1637+ ADL_MMIO_UNCORE_IMC_DATA_READ,
1638+ ADL_MMIO_UNCORE_IMC_DATA_WRITE,
1639+ ADL_MMIO_UNCORE_IMC_FREERUNNING_TYPE_MAX
1640+};
1641+
1642+static struct freerunning_counters adl_uncore_imc_freerunning[] = {
1643+ [ADL_MMIO_UNCORE_IMC_DATA_TOTAL] = { 0x40, 0x0, 0x0, 1, 64 },
1644+ [ADL_MMIO_UNCORE_IMC_DATA_READ] = { 0x58, 0x0, 0x0, 1, 64 },
1645+ [ADL_MMIO_UNCORE_IMC_DATA_WRITE] = { 0xA0, 0x0, 0x0, 1, 64 },
1646+};
1647+
1648+static void adl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
1649+{
1650+ __uncore_imc_init_box(box, ADL_UNCORE_IMC_FREERUNNING_BASE);
1651+}
1652+
1653+static struct intel_uncore_ops adl_uncore_imc_freerunning_ops = {
1654+ .init_box = adl_uncore_imc_freerunning_init_box,
1655+ .exit_box = uncore_mmio_exit_box,
1656+ .read_counter = uncore_mmio_read_counter,
1657+ .hw_config = uncore_freerunning_hw_config,
1658+};
1659+
1660+static struct intel_uncore_type adl_uncore_imc_free_running = {
1661+ .name = "imc_free_running",
1662+ .num_counters = 3,
1663+ .num_boxes = 2,
1664+ .num_freerunning_types = ADL_MMIO_UNCORE_IMC_FREERUNNING_TYPE_MAX,
1665+ .mmio_map_size = ADL_UNCORE_IMC_FREERUNNING_MAP_SIZE,
1666+ .freerunning = adl_uncore_imc_freerunning,
1667+ .ops = &adl_uncore_imc_freerunning_ops,
1668+ .event_descs = tgl_uncore_imc_events,
1669+ .format_group = &tgl_uncore_imc_format_group,
1670+};
1671+
1672+static struct intel_uncore_type *adl_mmio_uncores[] = {
1673+ &adl_uncore_imc,
1674+ &adl_uncore_imc_free_running,
1675+ NULL
1676+};
1677+
1678+void adl_uncore_mmio_init(void)
1679+{
1680+ uncore_mmio_uncores = adl_mmio_uncores;
1681+}
1682+
1683+/* end of Alder Lake MMIO uncore support */
arch/x86/events/intel/uncore_snbep.c+1−1
@@ -5482,7 +5482,7 @@ static struct intel_uncore_type icx_uncore_imc = { · 5481 unmodified lines
54825482 .fixed_ctr_bits = 48,
54835483 .fixed_ctr = SNR_IMC_MMIO_PMON_FIXED_CTR,
54845484 .fixed_ctl = SNR_IMC_MMIO_PMON_FIXED_CTL,
5485− .event_descs = hswep_uncore_imc_events,
5485+ .event_descs = snr_uncore_imc_events,
54865486 .perf_ctr = SNR_IMC_MMIO_PMON_CTR0,
54875487 .event_ctl = SNR_IMC_MMIO_PMON_CTL0,
54885488 .event_mask = SNBEP_PMON_RAW_EVENT_MASK,
arch/x86/events/perf_event.h+9−1
@@ -215,7 +215,8 @@ enum { · 214 unmodified lines
215215 LBR_FORMAT_EIP_FLAGS2 = 0x04,
216216 LBR_FORMAT_INFO = 0x05,
217217 LBR_FORMAT_TIME = 0x06,
218− LBR_FORMAT_MAX_KNOWN = LBR_FORMAT_TIME,
218+ LBR_FORMAT_INFO2 = 0x07,
219+ LBR_FORMAT_MAX_KNOWN = LBR_FORMAT_INFO2,
219220 };
220221
221222 enum {
@@ -840,6 +841,11 @@ struct x86_pmu { · 618 unmodified lines
840841 bool lbr_double_abort; /* duplicated lbr aborts */
841842 bool lbr_pt_coexist; /* (LBR|BTS) may coexist with PT */
842843
844+ unsigned int lbr_has_info:1;
845+ unsigned int lbr_has_tsx:1;
846+ unsigned int lbr_from_flags:1;
847+ unsigned int lbr_to_cycles:1;
848+
843849 /*
844850 * Intel Architectural LBR CPUID Enumeration
845851 */
@@ -1392,6 +1398,8 @@ void intel_pmu_lbr_init_skl(void); · 546 unmodified lines
13921398
13931399 void intel_pmu_lbr_init_knl(void);
13941400
1401+void intel_pmu_lbr_init(void);
1402+
13951403 void intel_pmu_arch_lbr_init(void);
13961404
13971405 void intel_pmu_pebs_data_source_nhm(void);
arch/x86/events/rapl.c+6−3
@@ -536,11 +536,14 @@ static struct perf_msr intel_rapl_spr_msrs[] = { · 535 unmodified lines
536536 * - perf_msr_probe(PERF_RAPL_MAX)
537537 * - want to use same event codes across both architectures
538538 */
539−static struct perf_msr amd_rapl_msrs[PERF_RAPL_MAX] = {
540− [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr },
539+static struct perf_msr amd_rapl_msrs[] = {
540+ [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, 0, false, 0 },
541+ [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr, false, RAPL_MSR_MASK },
542+ [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, 0, false, 0 },
543+ [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, 0, false, 0 },
544+ [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, 0, false, 0 },
541545 };
542546
543−
544547 static int rapl_cpu_offline(unsigned int cpu)
545548 {
546549 struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
arch/x86/include/asm/bug.h+11−9
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222
2323 #ifdef CONFIG_DEBUG_BUGVERBOSE
2424
25−#define _BUG_FLAGS(ins, flags) \
25+#define _BUG_FLAGS(ins, flags, extra) \
2626 do { \
2727 asm_inline volatile("1:\t" ins "\n" \
2828 ".pushsection __bug_table,\"aw\"\n" \
@@ -31,7 +31,8 @@ do { \ · 2 unmodified lines
3131 "\t.word %c1" "\t# bug_entry::line\n" \
3232 "\t.word %c2" "\t# bug_entry::flags\n" \
3333 "\t.org 2b+%c3\n" \
34− ".popsection" \
34+ ".popsection\n" \
35+ extra \
3536 : : "i" (__FILE__), "i" (__LINE__), \
3637 "i" (flags), \
3738 "i" (sizeof(struct bug_entry))); \
@@ -39,14 +40,15 @@ do { \ · 1 unmodified line
3940
4041 #else /* !CONFIG_DEBUG_BUGVERBOSE */
4142
42−#define _BUG_FLAGS(ins, flags) \
43+#define _BUG_FLAGS(ins, flags, extra) \
4344 do { \
4445 asm_inline volatile("1:\t" ins "\n" \
4546 ".pushsection __bug_table,\"aw\"\n" \
4647 "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \
4748 "\t.word %c0" "\t# bug_entry::flags\n" \
4849 "\t.org 2b+%c1\n" \
49− ".popsection" \
50+ ".popsection\n" \
51+ extra \
5052 : : "i" (flags), \
5153 "i" (sizeof(struct bug_entry))); \
5254 } while (0)
@@ -55,7 +57,7 @@ do { \ · 2 unmodified lines
5557
5658 #else
5759
58−#define _BUG_FLAGS(ins, flags) asm volatile(ins)
60+#define _BUG_FLAGS(ins, flags, extra) asm volatile(ins)
5961
6062 #endif /* CONFIG_GENERIC_BUG */
6163
@@ -63,8 +65,8 @@ do { \ · 1 unmodified line
6365 #define BUG() \
6466 do { \
6567 instrumentation_begin(); \
66− _BUG_FLAGS(ASM_UD2, 0); \
67− unreachable(); \
68+ _BUG_FLAGS(ASM_UD2, 0, ""); \
69+ __builtin_unreachable(); \
6870 } while (0)
6971
7072 /*
@@ -75,9 +77,9 @@ do { \ · 4 unmodified lines
7577 */
7678 #define __WARN_FLAGS(flags) \
7779 do { \
80+ __auto_type f = BUGFLAG_WARNING|(flags); \
7881 instrumentation_begin(); \
79− _BUG_FLAGS(ASM_UD2, BUGFLAG_WARNING|(flags)); \
80− annotate_reachable(); \
82+ _BUG_FLAGS(ASM_UD2, f, ASM_REACHABLE); \
8183 instrumentation_end(); \
8284 } while (0)
8385
arch/x86/include/asm/kvm-x86-ops.h+1−1
@@ -82,7 +82,7 @@ KVM_X86_OP_NULL(guest_apic_has_interrupt) · 81 unmodified lines
8282 KVM_X86_OP(load_eoi_exitmap)
8383 KVM_X86_OP(set_virtual_apic_mode)
8484 KVM_X86_OP_NULL(set_apic_access_page_addr)
85−KVM_X86_OP(deliver_posted_interrupt)
85+KVM_X86_OP(deliver_interrupt)
8686 KVM_X86_OP_NULL(sync_pir_to_irr)
8787 KVM_X86_OP(set_tss_addr)
8888 KVM_X86_OP(set_identity_map_addr)
arch/x86/include/asm/kvm_host.h+5−3
@@ -1410,7 +1410,8 @@ struct kvm_x86_ops { · 1409 unmodified lines
14101410 void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
14111411 void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);
14121412 void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu);
1413− int (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
1413+ void (*deliver_interrupt)(struct kvm_lapic *apic, int delivery_mode,
1414+ int trig_mode, int vector);
14141415 int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);
14151416 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
14161417 int (*set_identity_map_addr)(struct kvm *kvm, u64 ident_addr);
@@ -1483,7 +1484,8 @@ struct kvm_x86_ops { · 66 unmodified lines
14831484
14841485 int (*get_msr_feature)(struct kvm_msr_entry *entry);
14851486
1486− bool (*can_emulate_instruction)(struct kvm_vcpu *vcpu, void *insn, int insn_len);
1487+ bool (*can_emulate_instruction)(struct kvm_vcpu *vcpu, int emul_type,
1488+ void *insn, int insn_len);
14871489
14881490 bool (*apic_init_signal_blocked)(struct kvm_vcpu *vcpu);
14891491 int (*enable_direct_tlbflush)(struct kvm_vcpu *vcpu);
@@ -1496,6 +1498,7 @@ struct kvm_x86_ops { · 6 unmodified lines
14961498 };
14971499
14981500 struct kvm_x86_nested_ops {
1501+ void (*leave_nested)(struct kvm_vcpu *vcpu);
14991502 int (*check_events)(struct kvm_vcpu *vcpu);
15001503 bool (*hv_timer_pending)(struct kvm_vcpu *vcpu);
15011504 void (*triple_fault)(struct kvm_vcpu *vcpu);
@@ -1861,7 +1864,6 @@ int kvm_cpu_has_extint(struct kvm_vcpu *v); · 359 unmodified lines
18611864 int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
18621865 int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
18631866 void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event);
1864−void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu);
18651867
18661868 int kvm_pv_send_ipi(struct kvm *kvm, unsigned long ipi_bitmap_low,
18671869 unsigned long ipi_bitmap_high, u32 min,
arch/x86/include/asm/msr-index.h+1−0
@@ -476,6 +476,7 @@ · 475 unmodified lines
476476 #define MSR_AMD64_ICIBSEXTDCTL 0xc001103c
477477 #define MSR_AMD64_IBSOPDATA4 0xc001103d
478478 #define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */
479+#define MSR_AMD64_SVM_AVIC_DOORBELL 0xc001011b
479480 #define MSR_AMD64_VM_PAGE_FLUSH 0xc001011e
480481 #define MSR_AMD64_SEV_ES_GHCB 0xc0010130
481482 #define MSR_AMD64_SEV 0xc0010131
arch/x86/include/asm/svm.h+36−0
@@ -220,6 +220,42 @@ struct __attribute__ ((__packed__)) vmcb_control_area { · 219 unmodified lines
220220 #define SVM_NESTED_CTL_SEV_ENABLE BIT(1)
221221 #define SVM_NESTED_CTL_SEV_ES_ENABLE BIT(2)
222222
223+
224+/* AVIC */
225+#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF)
226+#define AVIC_LOGICAL_ID_ENTRY_VALID_BIT 31
227+#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31)
228+
229+#define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK (0xFFULL)
230+#define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12)
231+#define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK (1ULL << 62)
232+#define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK (1ULL << 63)
233+#define AVIC_PHYSICAL_ID_TABLE_SIZE_MASK (0xFF)
234+
235+#define AVIC_DOORBELL_PHYSICAL_ID_MASK (0xFF)
236+
237+#define AVIC_UNACCEL_ACCESS_WRITE_MASK 1
238+#define AVIC_UNACCEL_ACCESS_OFFSET_MASK 0xFF0
239+#define AVIC_UNACCEL_ACCESS_VECTOR_MASK 0xFFFFFFFF
240+
241+enum avic_ipi_failure_cause {
242+ AVIC_IPI_FAILURE_INVALID_INT_TYPE,
243+ AVIC_IPI_FAILURE_TARGET_NOT_RUNNING,
244+ AVIC_IPI_FAILURE_INVALID_TARGET,
245+ AVIC_IPI_FAILURE_INVALID_BACKING_PAGE,
246+};
247+
248+
249+/*
250+ * 0xff is broadcast, so the max index allowed for physical APIC ID
251+ * table is 0xfe. APIC IDs above 0xff are reserved.
252+ */
253+#define AVIC_MAX_PHYSICAL_ID_COUNT 0xff
254+
255+#define AVIC_HPA_MASK ~((0xFFFULL << 52) | 0xFFF)
256+#define VMCB_AVIC_APIC_BAR_MASK 0xFFFFFFFFFF000ULL
257+
258+
223259 struct vmcb_seg {
224260 u16 selector;
225261 u16 attrib;
arch/x86/include/asm/xen/cpuid.h+7−0
@@ -100,6 +100,13 @@ · 99 unmodified lines
100100 /* Memory mapped from other domains has valid IOMMU entries */
101101 #define XEN_HVM_CPUID_IOMMU_MAPPINGS (1u << 2)
102102 #define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */
103+#define XEN_HVM_CPUID_DOMID_PRESENT (1u << 4) /* domid is present in ECX */
104+/*
105+ * Bits 55:49 from the IO-APIC RTE and bits 11:5 from the MSI address can be
106+ * used to store high bits for the Destination ID. This expands the Destination
107+ * ID field from 8 to 15 bits, allowing to target APIC IDs up 32768.
108+ */
109+#define XEN_HVM_CPUID_EXT_DEST_ID (1u << 5)
103110
104111 /*
105112 * Leaf 6 (0x40000x05)
arch/x86/include/asm/xen/hypervisor.h+0−14
@@ -43,20 +43,6 @@ static inline uint32_t xen_cpuid_base(void) · 42 unmodified lines
4343 return hypervisor_cpuid_base("XenVMMXenVMM", 2);
4444 }
4545
46−#ifdef CONFIG_XEN
47−extern bool __init xen_hvm_need_lapic(void);
48−
49−static inline bool __init xen_x2apic_para_available(void)
50−{
51− return xen_hvm_need_lapic();
52−}
53−#else
54−static inline bool __init xen_x2apic_para_available(void)
55−{
56− return (xen_cpuid_base() != 0);
57−}
58−#endif
59−
6046 struct pci_dev;
6147
6248 #ifdef CONFIG_XEN_PV_DOM0
arch/x86/include/uapi/asm/kvm.h+3−0
@@ -452,6 +452,9 @@ struct kvm_sync_regs { · 451 unmodified lines
452452
453453 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
454454
455+/* attributes for system fd (group 0) */
456+#define KVM_X86_XCOMP_GUEST_SUPP 0
457+
455458 struct kvm_vmx_nested_state_data {
456459 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
457460 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
arch/x86/kernel/cpu/mce/amd.c+1−1
@@ -423,7 +423,7 @@ static void threshold_restart_bank(void *_tr) · 422 unmodified lines
423423 u32 hi, lo;
424424
425425 /* sysfs write might race against an offline operation */
426− if (this_cpu_read(threshold_banks))
426+ if (!this_cpu_read(threshold_banks) && !tr->set_lvt_off)
427427 return;
428428
429429 rdmsr(tr->b->address, lo, hi);
arch/x86/kernel/cpu/mce/intel.c+1−0
@@ -486,6 +486,7 @@ static void intel_ppin_init(struct cpuinfo_x86 *c) · 485 unmodified lines
486486 case INTEL_FAM6_BROADWELL_X:
487487 case INTEL_FAM6_SKYLAKE_X:
488488 case INTEL_FAM6_ICELAKE_X:
489+ case INTEL_FAM6_ICELAKE_D:
489490 case INTEL_FAM6_SAPPHIRERAPIDS_X:
490491 case INTEL_FAM6_XEON_PHI_KNL:
491492 case INTEL_FAM6_XEON_PHI_KNM:
arch/x86/kernel/cpu/sgx/encl.c+2−0
@@ -410,6 +410,8 @@ void sgx_encl_release(struct kref *ref) · 409 unmodified lines
410410 }
411411
412412 kfree(entry);
413+ /* Invoke scheduler to prevent soft lockups. */
414+ cond_resched();
413415 }
414416
415417 xa_destroy(&encl->page_array);
arch/x86/kernel/cpu/sgx/main.c+1−9
@@ -344,10 +344,8 @@ static void sgx_reclaim_pages(void) · 343 unmodified lines
344344 {
345345 struct sgx_epc_page *chunk[SGX_NR_TO_SCAN];
346346 struct sgx_backing backing[SGX_NR_TO_SCAN];
347− struct sgx_epc_section *section;
348347 struct sgx_encl_page *encl_page;
349348 struct sgx_epc_page *epc_page;
350− struct sgx_numa_node *node;
351349 pgoff_t page_index;
352350 int cnt = 0;
353351 int ret;
@@ -418,13 +416,7 @@ skip: · 64 unmodified lines
418416 kref_put(&encl_page->encl->refcount, sgx_encl_release);
419417 epc_page->flags &= ~SGX_EPC_PAGE_RECLAIMER_TRACKED;
420418
421− section = &sgx_epc_sections[epc_page->section];
422− node = section->node;
423−
424− spin_lock(&node->lock);
425− list_add_tail(&epc_page->list, &node->free_page_list);
426− spin_unlock(&node->lock);
427− atomic_long_inc(&sgx_nr_free_pages);
419+ sgx_free_epc_page(epc_page);
428420 }
429421 }
430422
arch/x86/kernel/fpu/regset.c+4−5
@@ -91,11 +91,9 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset, · 90 unmodified lines
9191 const void *kbuf, const void __user *ubuf)
9292 {
9393 struct fpu *fpu = &target->thread.fpu;
94− struct user32_fxsr_struct newstate;
94+ struct fxregs_state newstate;
9595 int ret;
9696
97− BUILD_BUG_ON(sizeof(newstate) != sizeof(struct fxregs_state));
98−
9997 if (!cpu_feature_enabled(X86_FEATURE_FXSR))
10098 return -ENODEV;
10199
@@ -116,9 +114,10 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset, · 14 unmodified lines
116114 /* Copy the state */
117115 memcpy(&fpu->fpstate->regs.fxsave, &newstate, sizeof(newstate));
118116
119− /* Clear xmm8..15 */
117+ /* Clear xmm8..15 for 32-bit callers */
120118 BUILD_BUG_ON(sizeof(fpu->__fpstate.regs.fxsave.xmm_space) != 16 * 16);
121− memset(&fpu->fpstate->regs.fxsave.xmm_space[8], 0, 8 * 16);
119+ if (in_ia32_syscall())
120+ memset(&fpu->fpstate->regs.fxsave.xmm_space[8*4], 0, 8 * 16);
122121
123122 /* Mark FP and SSE as in use when XSAVE is enabled */
124123 if (use_xsave())
arch/x86/kernel/ptrace.c+2−2
@@ -1224,7 +1224,7 @@ static struct user_regset x86_64_regsets[] __ro_after_init = { · 1223 unmodified lines
12241224 },
12251225 [REGSET_FP] = {
12261226 .core_note_type = NT_PRFPREG,
1227− .n = sizeof(struct user_i387_struct) / sizeof(long),
1227+ .n = sizeof(struct fxregs_state) / sizeof(long),
12281228 .size = sizeof(long), .align = sizeof(long),
12291229 .active = regset_xregset_fpregs_active, .regset_get = xfpregs_get, .set = xfpregs_set
12301230 },
@@ -1271,7 +1271,7 @@ static struct user_regset x86_32_regsets[] __ro_after_init = { · 40 unmodified lines
12711271 },
12721272 [REGSET_XFP] = {
12731273 .core_note_type = NT_PRXFPREG,
1274− .n = sizeof(struct user32_fxsr_struct) / sizeof(u32),
1274+ .n = sizeof(struct fxregs_state) / sizeof(u32),
12751275 .size = sizeof(u32), .align = sizeof(u32),
12761276 .active = regset_xregset_fpregs_active, .regset_get = xfpregs_get, .set = xfpregs_set
12771277 },
arch/x86/kernel/resource.c+1−22
@@ -1,5 +1,4 @@
11 // SPDX-License-Identifier: GPL-2.0
2−#include <linux/dmi.h>
32 #include <linux/ioport.h>
43 #include <asm/e820/api.h>
54
@@ -24,31 +23,11 @@ static void resource_clip(struct resource *res, resource_size_t start, · 18 unmodified lines
2423 res->start = end + 1;
2524 }
2625
27−/*
28− * Some BIOS-es contain a bug where they add addresses which map to
29− * system RAM in the PCI host bridge window returned by the ACPI _CRS
30− * method, see commit 4dc2287c1805 ("x86: avoid E820 regions when
31− * allocating address space"). To avoid this Linux by default excludes
32− * E820 reservations when allocating addresses since 2010.
33− * In 2019 some systems have shown-up with E820 reservations which cover
34− * the entire _CRS returned PCI host bridge window, causing all attempts
35− * to assign memory to PCI BARs to fail if Linux uses E820 reservations.
36− *
37− * Ideally Linux would fully stop using E820 reservations, but then
38− * the old systems this was added for will regress.
39− * Instead keep the old behavior for old systems, while ignoring the
40− * E820 reservations for any systems from now on.
41− */
4226 static void remove_e820_regions(struct resource *avail)
4327 {
44− int i, year = dmi_get_bios_year();
28+ int i;
4529 struct e820_entry *entry;
4630
47− if (year >= 2018)
48− return;
49−
50− pr_info_once("PCI: Removing E820 reservations from host bridge windows\n");
51−
5231 for (i = 0; i < e820_table->nr_entries; i++) {
5332 entry = &e820_table->entries[i];
5433
arch/x86/kvm/cpuid.c+62−41
@@ -133,6 +133,7 @@ static int kvm_cpuid_check_equal(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 · 132 unmodified lines
133133 orig = &vcpu->arch.cpuid_entries[i];
134134 if (e2[i].function != orig->function ||
135135 e2[i].index != orig->index ||
136+ e2[i].flags != orig->flags ||
136137 e2[i].eax != orig->eax || e2[i].ebx != orig->ebx ||
137138 e2[i].ecx != orig->ecx || e2[i].edx != orig->edx)
138139 return -EINVAL;
@@ -196,10 +197,26 @@ void kvm_update_pv_runtime(struct kvm_vcpu *vcpu) · 57 unmodified lines
196197 vcpu->arch.pv_cpuid.features = best->eax;
197198 }
198199
200+/*
201+ * Calculate guest's supported XCR0 taking into account guest CPUID data and
202+ * supported_xcr0 (comprised of host configuration and KVM_SUPPORTED_XCR0).
203+ */
204+static u64 cpuid_get_supported_xcr0(struct kvm_cpuid_entry2 *entries, int nent)
205+{
206+ struct kvm_cpuid_entry2 *best;
207+
208+ best = cpuid_entry2_find(entries, nent, 0xd, 0);
209+ if (!best)
210+ return 0;
211+
212+ return (best->eax | ((u64)best->edx << 32)) & supported_xcr0;
213+}
214+
199215 static void __kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *entries,
200216 int nent)
201217 {
202218 struct kvm_cpuid_entry2 *best;
219+ u64 guest_supported_xcr0 = cpuid_get_supported_xcr0(entries, nent);
203220
204221 best = cpuid_entry2_find(entries, nent, 1, 0);
205222 if (best) {
@@ -238,6 +255,21 @@ static void __kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu, struct kvm_cpuid_e · 32 unmodified lines
238255 vcpu->arch.ia32_misc_enable_msr &
239256 MSR_IA32_MISC_ENABLE_MWAIT);
240257 }
258+
259+ /*
260+ * Bits 127:0 of the allowed SECS.ATTRIBUTES (CPUID.0x12.0x1) enumerate
261+ * the supported XSAVE Feature Request Mask (XFRM), i.e. the enclave's
262+ * requested XCR0 value. The enclave's XFRM must be a subset of XCRO
263+ * at the time of EENTER, thus adjust the allowed XFRM by the guest's
264+ * supported XCR0. Similar to XCR0 handling, FP and SSE are forced to
265+ * '1' even on CPUs that don't support XSAVE.
266+ */
267+ best = cpuid_entry2_find(entries, nent, 0x12, 0x1);
268+ if (best) {
269+ best->ecx &= guest_supported_xcr0 & 0xffffffff;
270+ best->edx &= guest_supported_xcr0 >> 32;
271+ best->ecx |= XFEATURE_MASK_FPSSE;
272+ }
241273 }
242274
243275 void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
@@ -261,27 +293,8 @@ static void kvm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu) · 17 unmodified lines
261293 kvm_apic_set_version(vcpu);
262294 }
263295
264− best = kvm_find_cpuid_entry(vcpu, 0xD, 0);
265− if (!best)
266− vcpu->arch.guest_supported_xcr0 = 0;
267− else
268− vcpu->arch.guest_supported_xcr0 =
269− (best->eax | ((u64)best->edx << 32)) & supported_xcr0;
270−
271− /*
272− * Bits 127:0 of the allowed SECS.ATTRIBUTES (CPUID.0x12.0x1) enumerate
273− * the supported XSAVE Feature Request Mask (XFRM), i.e. the enclave's
274− * requested XCR0 value. The enclave's XFRM must be a subset of XCRO
275− * at the time of EENTER, thus adjust the allowed XFRM by the guest's
276− * supported XCR0. Similar to XCR0 handling, FP and SSE are forced to
277− * '1' even on CPUs that don't support XSAVE.
278− */
279− best = kvm_find_cpuid_entry(vcpu, 0x12, 0x1);
280− if (best) {
281− best->ecx &= vcpu->arch.guest_supported_xcr0 & 0xffffffff;
282− best->edx &= vcpu->arch.guest_supported_xcr0 >> 32;
283− best->ecx |= XFEATURE_MASK_FPSSE;
284− }
296+ vcpu->arch.guest_supported_xcr0 =
297+ cpuid_get_supported_xcr0(vcpu->arch.cpuid_entries, vcpu->arch.cpuid_nent);
285298
286299 kvm_update_pv_runtime(vcpu);
287300
@@ -346,8 +359,14 @@ static int kvm_set_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *e2, · 58 unmodified lines
346359 * KVM_SET_CPUID{,2} again. To support this legacy behavior, check
347360 * whether the supplied CPUID data is equal to what's already set.
348361 */
349− if (vcpu->arch.last_vmentry_cpu != -1)
350− return kvm_cpuid_check_equal(vcpu, e2, nent);
362+ if (vcpu->arch.last_vmentry_cpu != -1) {
363+ r = kvm_cpuid_check_equal(vcpu, e2, nent);
364+ if (r)
365+ return r;
366+
367+ kvfree(e2);
368+ return 0;
369+ }
351370
352371 r = kvm_check_cpuid(vcpu, e2, nent);
353372 if (r)
@@ -535,12 +554,13 @@ void kvm_set_cpu_caps(void) · 181 unmodified lines
535554 );
536555
537556 kvm_cpu_cap_mask(CPUID_7_0_EBX,
538− F(FSGSBASE) | F(SGX) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
539− F(BMI2) | F(ERMS) | F(INVPCID) | F(RTM) | 0 /*MPX*/ | F(RDSEED) |
540− F(ADX) | F(SMAP) | F(AVX512IFMA) | F(AVX512F) | F(AVX512PF) |
541− F(AVX512ER) | F(AVX512CD) | F(CLFLUSHOPT) | F(CLWB) | F(AVX512DQ) |
542− F(SHA_NI) | F(AVX512BW) | F(AVX512VL) | 0 /*INTEL_PT*/
543− );
557+ F(FSGSBASE) | F(SGX) | F(BMI1) | F(HLE) | F(AVX2) |
558+ F(FDP_EXCPTN_ONLY) | F(SMEP) | F(BMI2) | F(ERMS) | F(INVPCID) |
559+ F(RTM) | F(ZERO_FCS_FDS) | 0 /*MPX*/ | F(AVX512F) |
560+ F(AVX512DQ) | F(RDSEED) | F(ADX) | F(SMAP) | F(AVX512IFMA) |
561+ F(CLFLUSHOPT) | F(CLWB) | 0 /*INTEL_PT*/ | F(AVX512PF) |
562+ F(AVX512ER) | F(AVX512CD) | F(SHA_NI) | F(AVX512BW) |
563+ F(AVX512VL));
544564
545565 kvm_cpu_cap_mask(CPUID_7_ECX,
546566 F(AVX512VBMI) | F(LA57) | F(PKU) | 0 /*OSPKE*/ | F(RDPID) |
@@ -887,13 +907,14 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 340 unmodified lines
887907 }
888908 break;
889909 case 0xd: {
890− u64 guest_perm = xstate_get_guest_group_perm();
910+ u64 permitted_xcr0 = supported_xcr0 & xstate_get_guest_group_perm();
911+ u64 permitted_xss = supported_xss;
891912
892− entry->eax &= supported_xcr0 & guest_perm;
893− entry->ebx = xstate_required_size(supported_xcr0, false);
913+ entry->eax &= permitted_xcr0;
914+ entry->ebx = xstate_required_size(permitted_xcr0, false);
894915 entry->ecx = entry->ebx;
895− entry->edx &= (supported_xcr0 & guest_perm) >> 32;
896− if (!supported_xcr0)
916+ entry->edx &= permitted_xcr0 >> 32;
917+ if (!permitted_xcr0)
897918 break;
898919
899920 entry = do_host_cpuid(array, function, 1);
@@ -902,20 +923,20 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 2 unmodified lines
902923
903924 cpuid_entry_override(entry, CPUID_D_1_EAX);
904925 if (entry->eax & (F(XSAVES)|F(XSAVEC)))
905− entry->ebx = xstate_required_size(supported_xcr0 | supported_xss,
926+ entry->ebx = xstate_required_size(permitted_xcr0 | permitted_xss,
906927 true);
907928 else {
908− WARN_ON_ONCE(supported_xss != 0);
929+ WARN_ON_ONCE(permitted_xss != 0);
909930 entry->ebx = 0;
910931 }
911− entry->ecx &= supported_xss;
912− entry->edx &= supported_xss >> 32;
932+ entry->ecx &= permitted_xss;
933+ entry->edx &= permitted_xss >> 32;
913934
914935 for (i = 2; i < 64; ++i) {
915936 bool s_state;
916− if (supported_xcr0 & BIT_ULL(i))
937+ if (permitted_xcr0 & BIT_ULL(i))
917938 s_state = false;
918− else if (supported_xss & BIT_ULL(i))
939+ else if (permitted_xss & BIT_ULL(i))
919940 s_state = true;
920941 else
921942 continue;
@@ -929,7 +950,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 7 unmodified lines
929950 * invalid sub-leafs. Only valid sub-leafs should
930951 * reach this point, and they should have a non-zero
931952 * save state size. Furthermore, check whether the
932− * processor agrees with supported_xcr0/supported_xss
953+ * processor agrees with permitted_xcr0/permitted_xss
933954 * on whether this is an XCR0- or IA32_XSS-managed area.
934955 */
935956 if (WARN_ON_ONCE(!entry->eax || (entry->ecx & 0x1) != s_state)) {
arch/x86/kvm/lapic.c+9−10
@@ -1096,14 +1096,8 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 1095 unmodified lines
10961096 apic->regs + APIC_TMR);
10971097 }
10981098
1099− if (static_call(kvm_x86_deliver_posted_interrupt)(vcpu, vector)) {
1100− kvm_lapic_set_irr(vector, apic);
1101− kvm_make_request(KVM_REQ_EVENT, vcpu);
1102− kvm_vcpu_kick(vcpu);
1103− } else {
1104− trace_kvm_apicv_accept_irq(vcpu->vcpu_id, delivery_mode,
1105− trig_mode, vector);
1106− }
1099+ static_call(kvm_x86_deliver_interrupt)(apic, delivery_mode,
1100+ trig_mode, vector);
11071101 break;
11081102
11091103 case APIC_DM_REMRD:
@@ -2312,7 +2306,12 @@ void kvm_apic_update_apicv(struct kvm_vcpu *vcpu) · 1202 unmodified lines
23122306 apic->irr_pending = true;
23132307 apic->isr_count = 1;
23142308 } else {
2315− apic->irr_pending = (apic_search_irr(apic) != -1);
2309+ /*
2310+ * Don't clear irr_pending, searching the IRR can race with
2311+ * updates from the CPU as APICv is still active from hardware's
2312+ * perspective. The flag will be cleared as appropriate when
2313+ * KVM injects the interrupt.
2314+ */
23162315 apic->isr_count = count_vectors(apic->regs + APIC_ISR);
23172316 }
23182317 }
@@ -2629,7 +2628,7 @@ int kvm_apic_set_state(struct kvm_vcpu *vcpu, struct kvm_lapic_state *s) · 310 unmodified lines
26292628 kvm_apic_set_version(vcpu);
26302629
26312630 apic_update_ppr(apic);
2632− hrtimer_cancel(&apic->lapic_timer.timer);
2631+ cancel_apic_timer(apic);
26332632 apic->lapic_timer.expired_tscdeadline = 0;
26342633 apic_update_lvtt(apic);
26352634 apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));
arch/x86/kvm/pmu.c+4−3
@@ -95,7 +95,7 @@ static void kvm_perf_overflow(struct perf_event *perf_event, · 94 unmodified lines
9595 }
9696
9797 static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
98− unsigned config, bool exclude_user,
98+ u64 config, bool exclude_user,
9999 bool exclude_kernel, bool intr,
100100 bool in_tx, bool in_tx_cp)
101101 {
@@ -181,7 +181,8 @@ static int cmp_u64(const void *a, const void *b) · 79 unmodified lines
181181
182182 void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel)
183183 {
184− unsigned config, type = PERF_TYPE_RAW;
184+ u64 config;
185+ u32 type = PERF_TYPE_RAW;
185186 struct kvm *kvm = pmc->vcpu->kvm;
186187 struct kvm_pmu_event_filter *filter;
187188 bool allow_event = true;
@@ -220,7 +221,7 @@ void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel) · 32 unmodified lines
220221 }
221222
222223 if (type == PERF_TYPE_RAW)
223− config = eventsel & X86_RAW_EVENT_MASK;
224+ config = eventsel & AMD64_RAW_EVENT_MASK;
224225
225226 if (pmc->current_config == eventsel && pmc_resume_counter(pmc))
226227 return;
arch/x86/kvm/svm/avic.c+23−70
@@ -27,20 +27,6 @@ · 26 unmodified lines
2727 #include "irq.h"
2828 #include "svm.h"
2929
30−#define SVM_AVIC_DOORBELL 0xc001011b
31−
32−#define AVIC_HPA_MASK ~((0xFFFULL << 52) | 0xFFF)
33−
34−/*
35− * 0xff is broadcast, so the max index allowed for physical APIC ID
36− * table is 0xfe. APIC IDs above 0xff are reserved.
37− */
38−#define AVIC_MAX_PHYSICAL_ID_COUNT 255
39−
40−#define AVIC_UNACCEL_ACCESS_WRITE_MASK 1
41−#define AVIC_UNACCEL_ACCESS_OFFSET_MASK 0xFF0
42−#define AVIC_UNACCEL_ACCESS_VECTOR_MASK 0xFFFFFFFF
43−
4430 /* AVIC GATAG is encoded using VM and VCPU IDs */
4531 #define AVIC_VCPU_ID_BITS 8
4632 #define AVIC_VCPU_ID_MASK ((1 << AVIC_VCPU_ID_BITS) - 1)
@@ -73,12 +59,6 @@ struct amd_svm_iommu_ir { · 26 unmodified lines
7359 void *data; /* Storing pointer to struct amd_ir_data */
7460 };
7561
76−enum avic_ipi_failure_cause {
77− AVIC_IPI_FAILURE_INVALID_INT_TYPE,
78− AVIC_IPI_FAILURE_TARGET_NOT_RUNNING,
79− AVIC_IPI_FAILURE_INVALID_TARGET,
80− AVIC_IPI_FAILURE_INVALID_BACKING_PAGE,
81−};
8262
8363 /* Note:
8464 * This function is called from IOMMU driver to notify
@@ -289,6 +269,22 @@ static int avic_init_backing_page(struct kvm_vcpu *vcpu) · 204 unmodified lines
289269 return 0;
290270 }
291271
272+void avic_ring_doorbell(struct kvm_vcpu *vcpu)
273+{
274+ /*
275+ * Note, the vCPU could get migrated to a different pCPU at any point,
276+ * which could result in signalling the wrong/previous pCPU. But if
277+ * that happens the vCPU is guaranteed to do a VMRUN (after being
278+ * migrated) and thus will process pending interrupts, i.e. a doorbell
279+ * is not needed (and the spurious one is harmless).
280+ */
281+ int cpu = READ_ONCE(vcpu->cpu);
282+
283+ if (cpu != get_cpu())
284+ wrmsrl(MSR_AMD64_SVM_AVIC_DOORBELL, kvm_cpu_get_apicid(cpu));
285+ put_cpu();
286+}
287+
292288 static void avic_kick_target_vcpus(struct kvm *kvm, struct kvm_lapic *source,
293289 u32 icrl, u32 icrh)
294290 {
@@ -304,8 +300,13 @@ static void avic_kick_target_vcpus(struct kvm *kvm, struct kvm_lapic *source, · 9 unmodified lines
304300 kvm_for_each_vcpu(i, vcpu, kvm) {
305301 if (kvm_apic_match_dest(vcpu, source, icrl & APIC_SHORT_MASK,
306302 GET_APIC_DEST_FIELD(icrh),
307− icrl & APIC_DEST_MASK))
308− kvm_vcpu_wake_up(vcpu);
303+ icrl & APIC_DEST_MASK)) {
304+ vcpu->arch.apic->irr_pending = true;
305+ svm_complete_interrupt_delivery(vcpu,
306+ icrl & APIC_MODE_MASK,
307+ icrl & APIC_INT_LEVELTRIG,
308+ icrl & APIC_VECTOR_MASK);
309+ }
309310 }
310311 }
311312
@@ -345,8 +346,6 @@ int avic_incomplete_ipi_interception(struct kvm_vcpu *vcpu) · 33 unmodified lines
345346 avic_kick_target_vcpus(vcpu->kvm, apic, icrl, icrh);
346347 break;
347348 case AVIC_IPI_FAILURE_INVALID_TARGET:
348− WARN_ONCE(1, "Invalid IPI target: index=%u, vcpu=%d, icr=%#0x:%#0x\n",
349− index, vcpu->vcpu_id, icrh, icrl);
350349 break;
351350 case AVIC_IPI_FAILURE_INVALID_BACKING_PAGE:
352351 WARN_ONCE(1, "Invalid backing page\n");
@@ -669,52 +668,6 @@ void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) · 316 unmodified lines
669668 return;
670669 }
671670
672−int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
673−{
674− if (!vcpu->arch.apicv_active)
675− return -1;
676−
677− kvm_lapic_set_irr(vec, vcpu->arch.apic);
678−
679− /*
680− * Pairs with the smp_mb_*() after setting vcpu->guest_mode in
681− * vcpu_enter_guest() to ensure the write to the vIRR is ordered before
682− * the read of guest_mode, which guarantees that either VMRUN will see
683− * and process the new vIRR entry, or that the below code will signal
684− * the doorbell if the vCPU is already running in the guest.
685− */
686− smp_mb__after_atomic();
687−
688− /*
689− * Signal the doorbell to tell hardware to inject the IRQ if the vCPU
690− * is in the guest. If the vCPU is not in the guest, hardware will
691− * automatically process AVIC interrupts at VMRUN.
692− */
693− if (vcpu->mode == IN_GUEST_MODE) {
694− int cpu = READ_ONCE(vcpu->cpu);
695−
696− /*
697− * Note, the vCPU could get migrated to a different pCPU at any
698− * point, which could result in signalling the wrong/previous
699− * pCPU. But if that happens the vCPU is guaranteed to do a
700− * VMRUN (after being migrated) and thus will process pending
701− * interrupts, i.e. a doorbell is not needed (and the spurious
702− * one is harmless).
703− */
704− if (cpu != get_cpu())
705− wrmsrl(SVM_AVIC_DOORBELL, kvm_cpu_get_apicid(cpu));
706− put_cpu();
707− } else {
708− /*
709− * Wake the vCPU if it was blocking. KVM will then detect the
710− * pending IRQ when checking if the vCPU has a wake event.
711− */
712− kvm_vcpu_wake_up(vcpu);
713− }
714−
715− return 0;
716−}
717−
718671 bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
719672 {
720673 return false;
arch/x86/kvm/svm/nested.c+19−16
@@ -983,9 +983,9 @@ void svm_free_nested(struct vcpu_svm *svm) · 982 unmodified lines
983983 /*
984984 * Forcibly leave nested mode in order to be able to reset the VCPU later on.
985985 */
986−void svm_leave_nested(struct vcpu_svm *svm)
986+void svm_leave_nested(struct kvm_vcpu *vcpu)
987987 {
988− struct kvm_vcpu *vcpu = &svm->vcpu;
988+ struct vcpu_svm *svm = to_svm(vcpu);
989989
990990 if (is_guest_mode(vcpu)) {
991991 svm->nested.nested_run_pending = 0;
@@ -1411,7 +1411,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 419 unmodified lines
14111411 return -EINVAL;
14121412
14131413 if (!(kvm_state->flags & KVM_STATE_NESTED_GUEST_MODE)) {
1414− svm_leave_nested(svm);
1414+ svm_leave_nested(vcpu);
14151415 svm_set_gif(svm, !!(kvm_state->flags & KVM_STATE_NESTED_GIF_SET));
14161416 return 0;
14171417 }
@@ -1457,18 +1457,6 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 39 unmodified lines
14571457 !__nested_vmcb_check_save(vcpu, &save_cached))
14581458 goto out_free;
14591459
1460− /*
1461− * While the nested guest CR3 is already checked and set by
1462− * KVM_SET_SREGS, it was set when nested state was yet loaded,
1463− * thus MMU might not be initialized correctly.
1464− * Set it again to fix this.
1465− */
1466−
1467− ret = nested_svm_load_cr3(&svm->vcpu, vcpu->arch.cr3,
1468− nested_npt_enabled(svm), false);
1469− if (WARN_ON_ONCE(ret))
1470− goto out_free;
1471−
14721460
14731461 /*
14741462 * All checks done, we can enter guest mode. Userspace provides
@@ -1478,7 +1466,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 3 unmodified lines
14781466 */
14791467
14801468 if (is_guest_mode(vcpu))
1481− svm_leave_nested(svm);
1469+ svm_leave_nested(vcpu);
14821470 else
14831471 svm->nested.vmcb02.ptr->save = svm->vmcb01.ptr->save;
14841472
@@ -1494,6 +1482,20 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 9 unmodified lines
14941482
14951483 svm_switch_vmcb(svm, &svm->nested.vmcb02);
14961484 nested_vmcb02_prepare_control(svm);
1485+
1486+ /*
1487+ * While the nested guest CR3 is already checked and set by
1488+ * KVM_SET_SREGS, it was set when nested state was yet loaded,
1489+ * thus MMU might not be initialized correctly.
1490+ * Set it again to fix this.
1491+ */
1492+
1493+ ret = nested_svm_load_cr3(&svm->vcpu, vcpu->arch.cr3,
1494+ nested_npt_enabled(svm), false);
1495+ if (WARN_ON_ONCE(ret))
1496+ goto out_free;
1497+
1498+
14971499 kvm_make_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu);
14981500 ret = 0;
14991501 out_free:
@@ -1532,6 +1534,7 @@ static bool svm_get_nested_state_pages(struct kvm_vcpu *vcpu) · 32 unmodified lines
15321534 }
15331535
15341536 struct kvm_x86_nested_ops svm_nested_ops = {
1537+ .leave_nested = svm_leave_nested,
15351538 .check_events = svm_check_nested_events,
15361539 .triple_fault = nested_svm_triple_fault,
15371540 .get_nested_state_pages = svm_get_nested_state_pages,
arch/x86/kvm/svm/sev.c+7−2
@@ -2100,8 +2100,13 @@ void __init sev_hardware_setup(void) · 2099 unmodified lines
21002100 if (!sev_enabled || !npt_enabled)
21012101 goto out;
21022102
2103− /* Does the CPU support SEV? */
2104− if (!boot_cpu_has(X86_FEATURE_SEV))
2103+ /*
2104+ * SEV must obviously be supported in hardware. Sanity check that the
2105+ * CPU supports decode assists, which is mandatory for SEV guests to
2106+ * support instruction emulation.
2107+ */
2108+ if (!boot_cpu_has(X86_FEATURE_SEV) ||
2109+ WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_DECODEASSISTS)))
21052110 goto out;
21062111
21072112 /* Retrieve SEV CPUID information */
arch/x86/kvm/svm/svm.c+205−64
@@ -290,7 +290,7 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer) · 289 unmodified lines
290290
291291 if ((old_efer & EFER_SVME) != (efer & EFER_SVME)) {
292292 if (!(efer & EFER_SVME)) {
293− svm_leave_nested(svm);
293+ svm_leave_nested(vcpu);
294294 svm_set_gif(svm, true);
295295 /* #GP intercept is still needed for vmware backdoor */
296296 if (!enable_vmware_backdoor)
@@ -312,7 +312,11 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer) · 15 unmodified lines
312312 return ret;
313313 }
314314
315− if (svm_gp_erratum_intercept)
315+ /*
316+ * Never intercept #GP for SEV guests, KVM can't
317+ * decrypt guest memory to workaround the erratum.
318+ */
319+ if (svm_gp_erratum_intercept && !sev_guest(vcpu->kvm))
316320 set_exception_intercept(svm, GP_VECTOR);
317321 }
318322 }
@@ -1010,9 +1014,10 @@ static void init_vmcb(struct kvm_vcpu *vcpu) · 691 unmodified lines
10101014 * Guest access to VMware backdoor ports could legitimately
10111015 * trigger #GP because of TSS I/O permission bitmap.
10121016 * We intercept those #GP and allow access to them anyway
1013− * as VMware does.
1017+ * as VMware does. Don't intercept #GP for SEV guests as KVM can't
1018+ * decrypt guest memory to decode the faulting instruction.
10141019 */
1015− if (enable_vmware_backdoor)
1020+ if (enable_vmware_backdoor && !sev_guest(vcpu->kvm))
10161021 set_exception_intercept(svm, GP_VECTOR);
10171022
10181023 svm_set_intercept(svm, INTERCEPT_INTR);
@@ -1580,6 +1585,7 @@ void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 561 unmodified lines
15801585 {
15811586 struct vcpu_svm *svm = to_svm(vcpu);
15821587 u64 hcr0 = cr0;
1588+ bool old_paging = is_paging(vcpu);
15831589
15841590 #ifdef CONFIG_X86_64
15851591 if (vcpu->arch.efer & EFER_LME && !vcpu->arch.guest_state_protected) {
@@ -1596,8 +1602,11 @@ void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 10 unmodified lines
15961602 #endif
15971603 vcpu->arch.cr0 = cr0;
15981604
1599− if (!npt_enabled)
1605+ if (!npt_enabled) {
16001606 hcr0 |= X86_CR0_PG | X86_CR0_WP;
1607+ if (old_paging != is_paging(vcpu))
1608+ svm_set_cr4(vcpu, kvm_read_cr4(vcpu));
1609+ }
16011610
16021611 /*
16031612 * re-enable caching here because the QEMU bios
@@ -1641,8 +1650,12 @@ void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) · 37 unmodified lines
16411650 svm_flush_tlb(vcpu);
16421651
16431652 vcpu->arch.cr4 = cr4;
1644− if (!npt_enabled)
1653+ if (!npt_enabled) {
16451654 cr4 |= X86_CR4_PAE;
1655+
1656+ if (!is_paging(vcpu))
1657+ cr4 &= ~(X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_PKE);
1658+ }
16461659 cr4 |= host_cr4_mce;
16471660 to_svm(vcpu)->vmcb->save.cr4 = cr4;
16481661 vmcb_mark_dirty(to_svm(vcpu)->vmcb, VMCB_CR);
@@ -2091,10 +2104,6 @@ static int gp_interception(struct kvm_vcpu *vcpu) · 442 unmodified lines
20912104 if (error_code)
20922105 goto reinject;
20932106
2094− /* All SVM instructions expect page aligned RAX */
2095− if (svm->vmcb->save.rax & ~PAGE_MASK)
2096− goto reinject;
2097−
20982107 /* Decode the instruction for usage later */
20992108 if (x86_decode_emulated_instruction(vcpu, 0, NULL, 0) != EMULATION_OK)
21002109 goto reinject;
@@ -2112,8 +2121,13 @@ static int gp_interception(struct kvm_vcpu *vcpu) · 11 unmodified lines
21122121 if (!is_guest_mode(vcpu))
21132122 return kvm_emulate_instruction(vcpu,
21142123 EMULTYPE_VMWARE_GP | EMULTYPE_NO_DECODE);
2115− } else
2124+ } else {
2125+ /* All SVM instructions expect page aligned RAX */
2126+ if (svm->vmcb->save.rax & ~PAGE_MASK)
2127+ goto reinject;
2128+
21162129 return emulate_svm_instr(vcpu, opcode);
2130+ }
21172131
21182132 reinject:
21192133 kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
@@ -3285,6 +3299,55 @@ static void svm_set_irq(struct kvm_vcpu *vcpu) · 1165 unmodified lines
32853299 SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_INTR;
32863300 }
32873301
3302+void svm_complete_interrupt_delivery(struct kvm_vcpu *vcpu, int delivery_mode,
3303+ int trig_mode, int vector)
3304+{
3305+ /*
3306+ * vcpu->arch.apicv_active must be read after vcpu->mode.
3307+ * Pairs with smp_store_release in vcpu_enter_guest.
3308+ */
3309+ bool in_guest_mode = (smp_load_acquire(&vcpu->mode) == IN_GUEST_MODE);
3310+
3311+ if (!READ_ONCE(vcpu->arch.apicv_active)) {
3312+ /* Process the interrupt via inject_pending_event */
3313+ kvm_make_request(KVM_REQ_EVENT, vcpu);
3314+ kvm_vcpu_kick(vcpu);
3315+ return;
3316+ }
3317+
3318+ trace_kvm_apicv_accept_irq(vcpu->vcpu_id, delivery_mode, trig_mode, vector);
3319+ if (in_guest_mode) {
3320+ /*
3321+ * Signal the doorbell to tell hardware to inject the IRQ. If
3322+ * the vCPU exits the guest before the doorbell chimes, hardware
3323+ * will automatically process AVIC interrupts at the next VMRUN.
3324+ */
3325+ avic_ring_doorbell(vcpu);
3326+ } else {
3327+ /*
3328+ * Wake the vCPU if it was blocking. KVM will then detect the
3329+ * pending IRQ when checking if the vCPU has a wake event.
3330+ */
3331+ kvm_vcpu_wake_up(vcpu);
3332+ }
3333+}
3334+
3335+static void svm_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode,
3336+ int trig_mode, int vector)
3337+{
3338+ kvm_lapic_set_irr(vector, apic);
3339+
3340+ /*
3341+ * Pairs with the smp_mb_*() after setting vcpu->guest_mode in
3342+ * vcpu_enter_guest() to ensure the write to the vIRR is ordered before
3343+ * the read of guest_mode. This guarantees that either VMRUN will see
3344+ * and process the new vIRR entry, or that svm_complete_interrupt_delivery
3345+ * will signal the doorbell if the CPU has already entered the guest.
3346+ */
3347+ smp_mb__after_atomic();
3348+ svm_complete_interrupt_delivery(apic->vcpu, delivery_mode, trig_mode, vector);
3349+}
3350+
32883351 static void svm_update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)
32893352 {
32903353 struct vcpu_svm *svm = to_svm(vcpu);
@@ -3332,11 +3395,13 @@ static int svm_nmi_allowed(struct kvm_vcpu *vcpu, bool for_injection) · 41 unmodified lines
33323395 if (svm->nested.nested_run_pending)
33333396 return -EBUSY;
33343397
3398+ if (svm_nmi_blocked(vcpu))
3399+ return 0;
3400+
33353401 /* An NMI must not be injected into L2 if it's supposed to VM-Exit. */
33363402 if (for_injection && is_guest_mode(vcpu) && nested_exit_on_nmi(svm))
33373403 return -EBUSY;
3338−
3339− return !svm_nmi_blocked(vcpu);
3404+ return 1;
33403405 }
33413406
33423407 static bool svm_get_nmi_mask(struct kvm_vcpu *vcpu)
@@ -3388,9 +3453,13 @@ bool svm_interrupt_blocked(struct kvm_vcpu *vcpu) · 45 unmodified lines
33883453 static int svm_interrupt_allowed(struct kvm_vcpu *vcpu, bool for_injection)
33893454 {
33903455 struct vcpu_svm *svm = to_svm(vcpu);
3456+
33913457 if (svm->nested.nested_run_pending)
33923458 return -EBUSY;
33933459
3460+ if (svm_interrupt_blocked(vcpu))
3461+ return 0;
3462+
33943463 /*
33953464 * An IRQ must not be injected into L2 if it's supposed to VM-Exit,
33963465 * e.g. if the IRQ arrived asynchronously after checking nested events.
@@ -3398,7 +3467,7 @@ static int svm_interrupt_allowed(struct kvm_vcpu *vcpu, bool for_injection) · 1 unmodified line
33983467 if (for_injection && is_guest_mode(vcpu) && nested_exit_on_intr(svm))
33993468 return -EBUSY;
34003469
3401− return !svm_interrupt_blocked(vcpu);
3470+ return 1;
34023471 }
34033472
34043473 static void svm_enable_irq_window(struct kvm_vcpu *vcpu)
@@ -3609,7 +3678,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu) · 204 unmodified lines
36093678 struct vcpu_svm *svm = to_svm(vcpu);
36103679 unsigned long vmcb_pa = svm->current_vmcb->pa;
36113680
3612− kvm_guest_enter_irqoff();
3681+ guest_state_enter_irqoff();
36133682
36143683 if (sev_es_guest(vcpu->kvm)) {
36153684 __svm_sev_es_vcpu_run(vmcb_pa);
@@ -3629,7 +3698,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu) · 13 unmodified lines
36293698 vmload(__sme_page_pa(sd->save_area));
36303699 }
36313700
3632− kvm_guest_exit_irqoff();
3701+ guest_state_exit_irqoff();
36333702 }
36343703
36353704 static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
@@ -4129,11 +4198,14 @@ static int svm_smi_allowed(struct kvm_vcpu *vcpu, bool for_injection) · 493 unmodified lines
41294198 if (svm->nested.nested_run_pending)
41304199 return -EBUSY;
41314200
4201+ if (svm_smi_blocked(vcpu))
4202+ return 0;
4203+
41324204 /* An SMI must not be injected into L2 if it's supposed to VM-Exit. */
41334205 if (for_injection && is_guest_mode(vcpu) && nested_exit_on_smi(svm))
41344206 return -EBUSY;
41354207
4136− return !svm_smi_blocked(vcpu);
4208+ return 1;
41374209 }
41384210
41394211 static int svm_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
@@ -4227,11 +4299,18 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const char *smstate) · 87 unmodified lines
42274299 * Enter the nested guest now
42284300 */
42294301
4302+ vmcb_mark_all_dirty(svm->vmcb01.ptr);
4303+
42304304 vmcb12 = map.hva;
42314305 nested_copy_vmcb_control_to_cache(svm, &vmcb12->control);
42324306 nested_copy_vmcb_save_to_cache(svm, &vmcb12->save);
42334307 ret = enter_svm_guest_mode(vcpu, vmcb12_gpa, vmcb12, false);
42344308
4309+ if (ret)
4310+ goto unmap_save;
4311+
4312+ svm->nested.nested_run_pending = 1;
4313+
42354314 unmap_save:
42364315 kvm_vcpu_unmap(vcpu, &map_save, true);
42374316 unmap_map:
@@ -4252,79 +4331,140 @@ static void svm_enable_smi_window(struct kvm_vcpu *vcpu) · 14 unmodified lines
42524331 }
42534332 }
42544333
4255−static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int insn_len)
4334+static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, int emul_type,
4335+ void *insn, int insn_len)
42564336 {
42574337 bool smep, smap, is_user;
42584338 unsigned long cr4;
4339+ u64 error_code;
4340+
4341+ /* Emulation is always possible when KVM has access to all guest state. */
4342+ if (!sev_guest(vcpu->kvm))
4343+ return true;
4344+
4345+ /* #UD and #GP should never be intercepted for SEV guests. */
4346+ WARN_ON_ONCE(emul_type & (EMULTYPE_TRAP_UD |
4347+ EMULTYPE_TRAP_UD_FORCED |
4348+ EMULTYPE_VMWARE_GP));
42594349
42604350 /*
4261− * When the guest is an SEV-ES guest, emulation is not possible.
4351+ * Emulation is impossible for SEV-ES guests as KVM doesn't have access
4352+ * to guest register state.
42624353 */
42634354 if (sev_es_guest(vcpu->kvm))
42644355 return false;
42654356
4357+ /*
4358+ * Emulation is possible if the instruction is already decoded, e.g.
4359+ * when completing I/O after returning from userspace.
4360+ */
4361+ if (emul_type & EMULTYPE_NO_DECODE)
4362+ return true;
4363+
4364+ /*
4365+ * Emulation is possible for SEV guests if and only if a prefilled
4366+ * buffer containing the bytes of the intercepted instruction is
4367+ * available. SEV guest memory is encrypted with a guest specific key
4368+ * and cannot be decrypted by KVM, i.e. KVM would read cyphertext and
4369+ * decode garbage.
4370+ *
4371+ * Inject #UD if KVM reached this point without an instruction buffer.
4372+ * In practice, this path should never be hit by a well-behaved guest,
4373+ * e.g. KVM doesn't intercept #UD or #GP for SEV guests, but this path
4374+ * is still theoretically reachable, e.g. via unaccelerated fault-like
4375+ * AVIC access, and needs to be handled by KVM to avoid putting the
4376+ * guest into an infinite loop. Injecting #UD is somewhat arbitrary,
4377+ * but its the least awful option given lack of insight into the guest.
4378+ */
4379+ if (unlikely(!insn)) {
4380+ kvm_queue_exception(vcpu, UD_VECTOR);
4381+ return false;
4382+ }
4383+
4384+ /*
4385+ * Emulate for SEV guests if the insn buffer is not empty. The buffer
4386+ * will be empty if the DecodeAssist microcode cannot fetch bytes for
4387+ * the faulting instruction because the code fetch itself faulted, e.g.
4388+ * the guest attempted to fetch from emulated MMIO or a guest page
4389+ * table used to translate CS:RIP resides in emulated MMIO.
4390+ */
4391+ if (likely(insn_len))
4392+ return true;
4393+
42664394 /*
42674395 * Detect and workaround Errata 1096 Fam_17h_00_0Fh.
42684396 *
42694397 * Errata:
4270− * When CPU raise #NPF on guest data access and vCPU CR4.SMAP=1, it is
4271− * possible that CPU microcode implementing DecodeAssist will fail
4272− * to read bytes of instruction which caused #NPF. In this case,
4273− * GuestIntrBytes field of the VMCB on a VMEXIT will incorrectly
4274− * return 0 instead of the correct guest instruction bytes.
4275− *
4276− * This happens because CPU microcode reading instruction bytes
4277− * uses a special opcode which attempts to read data using CPL=0
4278− * privileges. The microcode reads CS:RIP and if it hits a SMAP
4279− * fault, it gives up and returns no instruction bytes.
4398+ * When CPU raises #NPF on guest data access and vCPU CR4.SMAP=1, it is
4399+ * possible that CPU microcode implementing DecodeAssist will fail to
4400+ * read guest memory at CS:RIP and vmcb.GuestIntrBytes will incorrectly
4401+ * be '0'. This happens because microcode reads CS:RIP using a _data_
4402+ * loap uop with CPL=0 privileges. If the load hits a SMAP #PF, ucode
4403+ * gives up and does not fill the instruction bytes buffer.
42804404 *
4281− * Detection:
4282− * We reach here in case CPU supports DecodeAssist, raised #NPF and
4283− * returned 0 in GuestIntrBytes field of the VMCB.
4284− * First, errata can only be triggered in case vCPU CR4.SMAP=1.
4285− * Second, if vCPU CR4.SMEP=1, errata could only be triggered
4286− * in case vCPU CPL==3 (Because otherwise guest would have triggered
4287− * a SMEP fault instead of #NPF).
4288− * Otherwise, vCPU CR4.SMEP=0, errata could be triggered by any vCPU CPL.
4289− * As most guests enable SMAP if they have also enabled SMEP, use above
4290− * logic in order to attempt minimize false-positive of detecting errata
4291− * while still preserving all cases semantic correctness.
4405+ * As above, KVM reaches this point iff the VM is an SEV guest, the CPU
4406+ * supports DecodeAssist, a #NPF was raised, KVM's page fault handler
4407+ * triggered emulation (e.g. for MMIO), and the CPU returned 0 in the
4408+ * GuestIntrBytes field of the VMCB.
42924409 *
4293− * Workaround:
4294− * To determine what instruction the guest was executing, the hypervisor
4295− * will have to decode the instruction at the instruction pointer.
4410+ * This does _not_ mean that the erratum has been encountered, as the
4411+ * DecodeAssist will also fail if the load for CS:RIP hits a legitimate
4412+ * #PF, e.g. if the guest attempt to execute from emulated MMIO and
4413+ * encountered a reserved/not-present #PF.
42964414 *
4297− * In non SEV guest, hypervisor will be able to read the guest
4298− * memory to decode the instruction pointer when insn_len is zero
4299− * so we return true to indicate that decoding is possible.
4415+ * To hit the erratum, the following conditions must be true:
4416+ * 1. CR4.SMAP=1 (obviously).
4417+ * 2. CR4.SMEP=0 || CPL=3. If SMEP=1 and CPL<3, the erratum cannot
4418+ * have been hit as the guest would have encountered a SMEP
4419+ * violation #PF, not a #NPF.
4420+ * 3. The #NPF is not due to a code fetch, in which case failure to
4421+ * retrieve the instruction bytes is legitimate (see abvoe).
43004422 *
4301− * But in the SEV guest, the guest memory is encrypted with the
4302− * guest specific key and hypervisor will not be able to decode the
4303− * instruction pointer so we will not able to workaround it. Lets
4304− * print the error and request to kill the guest.
4423+ * In addition, don't apply the erratum workaround if the #NPF occurred
4424+ * while translating guest page tables (see below).
43054425 */
4306− if (likely(!insn || insn_len))
4307− return true;
4308−
4309− /*
4310− * If RIP is invalid, go ahead with emulation which will cause an
4311− * internal error exit.
4312− */
4313− if (!kvm_vcpu_gfn_to_memslot(vcpu, kvm_rip_read(vcpu) >> PAGE_SHIFT))
4314− return true;
4426+ error_code = to_svm(vcpu)->vmcb->control.exit_info_1;
4427+ if (error_code & (PFERR_GUEST_PAGE_MASK | PFERR_FETCH_MASK))
4428+ goto resume_guest;
43154429
43164430 cr4 = kvm_read_cr4(vcpu);
43174431 smep = cr4 & X86_CR4_SMEP;
43184432 smap = cr4 & X86_CR4_SMAP;
43194433 is_user = svm_get_cpl(vcpu) == 3;
43204434 if (smap && (!smep || is_user)) {
4321− if (!sev_guest(vcpu->kvm))
4322− return true;
4323−
43244435 pr_err_ratelimited("KVM: SEV Guest triggered AMD Erratum 1096\n");
4325− kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
4436+
4437+ /*
4438+ * If the fault occurred in userspace, arbitrarily inject #GP
4439+ * to avoid killing the guest and to hopefully avoid confusing
4440+ * the guest kernel too much, e.g. injecting #PF would not be
4441+ * coherent with respect to the guest's page tables. Request
4442+ * triple fault if the fault occurred in the kernel as there's
4443+ * no fault that KVM can inject without confusing the guest.
4444+ * In practice, the triple fault is moot as no sane SEV kernel
4445+ * will execute from user memory while also running with SMAP=1.
4446+ */
4447+ if (is_user)
4448+ kvm_inject_gp(vcpu, 0);
4449+ else
4450+ kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
43264451 }
43274452
4453+resume_guest:
4454+ /*
4455+ * If the erratum was not hit, simply resume the guest and let it fault
4456+ * again. While awful, e.g. the vCPU may get stuck in an infinite loop
4457+ * if the fault is at CPL=0, it's the lesser of all evils. Exiting to
4458+ * userspace will kill the guest, and letting the emulator read garbage
4459+ * will yield random behavior and potentially corrupt the guest.
4460+ *
4461+ * Simply resuming the guest is technically not a violation of the SEV
4462+ * architecture. AMD's APM states that all code fetches and page table
4463+ * accesses for SEV guest are encrypted, regardless of the C-Bit. The
4464+ * APM also states that encrypted accesses to MMIO are "ignored", but
4465+ * doesn't explicitly define "ignored", i.e. doing nothing and letting
4466+ * the guest spin is technically "ignoring" the access.
4467+ */
43284468 return false;
43294469 }
43304470
@@ -4478,7 +4618,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { · 147 unmodified lines
44784618 .pmu_ops = &amd_pmu_ops,
44794619 .nested_ops = &svm_nested_ops,
44804620
4481− .deliver_posted_interrupt = svm_deliver_avic_intr,
4621+ .deliver_interrupt = svm_deliver_interrupt,
44824622 .dy_apicv_has_pending_interrupt = svm_dy_apicv_has_pending_interrupt,
44834623 .update_pi_irte = svm_update_pi_irte,
44844624 .setup_mce = svm_setup_mce,
@@ -4555,6 +4695,7 @@ static __init void svm_set_cpu_caps(void) · 70 unmodified lines
45554695 /* CPUID 0x80000001 and 0x8000000A (SVM features) */
45564696 if (nested) {
45574697 kvm_cpu_cap_set(X86_FEATURE_SVM);
4698+ kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN);
45584699
45594700 if (nrips)
45604701 kvm_cpu_cap_set(X86_FEATURE_NRIPS);
arch/x86/kvm/svm/svm.h+4−18
@@ -304,11 +304,6 @@ static inline void vmcb_mark_all_clean(struct vmcb *vmcb) · 303 unmodified lines
304304 & ~VMCB_ALWAYS_DIRTY_MASK;
305305 }
306306
307−static inline bool vmcb_is_clean(struct vmcb *vmcb, int bit)
308−{
309− return (vmcb->control.clean & (1 << bit));
310−}
311−
312307 static inline void vmcb_mark_dirty(struct vmcb *vmcb, int bit)
313308 {
314309 vmcb->control.clean &= ~(1 << bit);
@@ -494,6 +489,8 @@ void svm_set_gif(struct vcpu_svm *svm, bool value); · 179 unmodified lines
494489 int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code);
495490 void set_msr_interception(struct kvm_vcpu *vcpu, u32 *msrpm, u32 msr,
496491 int read, int write);
492+void svm_complete_interrupt_delivery(struct kvm_vcpu *vcpu, int delivery_mode,
493+ int trig_mode, int vec);
497494
498495 /* nested.c */
499496
@@ -525,7 +522,7 @@ static inline bool nested_exit_on_nmi(struct vcpu_svm *svm) · 25 unmodified lines
525522
526523 int enter_svm_guest_mode(struct kvm_vcpu *vcpu,
527524 u64 vmcb_gpa, struct vmcb *vmcb12, bool from_vmrun);
528−void svm_leave_nested(struct vcpu_svm *svm);
525+void svm_leave_nested(struct kvm_vcpu *vcpu);
529526 void svm_free_nested(struct vcpu_svm *svm);
530527 int svm_allocate_nested(struct vcpu_svm *svm);
531528 int nested_svm_vmrun(struct kvm_vcpu *vcpu);
@@ -561,17 +558,6 @@ extern struct kvm_x86_nested_ops svm_nested_ops; · 29 unmodified lines
561558
562559 /* avic.c */
563560
564−#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF)
565−#define AVIC_LOGICAL_ID_ENTRY_VALID_BIT 31
566−#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31)
567−
568−#define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK (0xFFULL)
569−#define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12)
570−#define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK (1ULL << 62)
571−#define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK (1ULL << 63)
572−
573−#define VMCB_AVIC_APIC_BAR_MASK 0xFFFFFFFFFF000ULL
574−
575561 int avic_ga_log_notifier(u32 ga_tag);
576562 void avic_vm_destroy(struct kvm *kvm);
577563 int avic_vm_init(struct kvm *kvm);
@@ -588,12 +574,12 @@ bool svm_check_apicv_inhibit_reasons(ulong bit); · 10 unmodified lines
588574 void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
589575 void svm_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr);
590576 void svm_hwapic_isr_update(struct kvm_vcpu *vcpu, int max_isr);
591−int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec);
592577 bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu);
593578 int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq,
594579 uint32_t guest_irq, bool set);
595580 void avic_vcpu_blocking(struct kvm_vcpu *vcpu);
596581 void avic_vcpu_unblocking(struct kvm_vcpu *vcpu);
582+void avic_ring_doorbell(struct kvm_vcpu *vcpu);
597583
598584 /* sev.c */
599585
arch/x86/kvm/svm/svm_onhyperv.h+4−8
@@ -46,6 +46,9 @@ static inline void svm_hv_init_vmcb(struct vmcb *vmcb) · 45 unmodified lines
4646 if (npt_enabled &&
4747 ms_hyperv.nested_features & HV_X64_NESTED_ENLIGHTENED_TLB)
4848 hve->hv_enlightenments_control.enlightened_npt_tlb = 1;
49+
50+ if (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)
51+ hve->hv_enlightenments_control.msr_bitmap = 1;
4952 }
5053
5154 static inline void svm_hv_hardware_setup(void)
@@ -83,14 +86,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments( · 31 unmodified lines
8386 struct hv_enlightenments *hve =
8487 (struct hv_enlightenments *)vmcb->control.reserved_sw;
8588
86− /*
87− * vmcb can be NULL if called during early vcpu init.
88− * And its okay not to mark vmcb dirty during vcpu init
89− * as we mark it dirty unconditionally towards end of vcpu
90− * init phase.
91− */
92− if (vmcb_is_clean(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS) &&
93− hve->hv_enlightenments_control.msr_bitmap)
89+ if (hve->hv_enlightenments_control.msr_bitmap)
9490 vmcb_mark_dirty(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS);
9591 }
9692
arch/x86/kvm/vmx/capabilities.h+0−1
@@ -54,7 +54,6 @@ struct nested_vmx_msrs { · 53 unmodified lines
5454
5555 struct vmcs_config {
5656 int size;
57− int order;
5857 u32 basic_cap;
5958 u32 revision_id;
6059 u32 pin_based_exec_ctrl;
arch/x86/kvm/vmx/evmcs.c+2−2
@@ -12,8 +12,6 @@ · 11 unmodified lines
1212
1313 DEFINE_STATIC_KEY_FALSE(enable_evmcs);
1414
15−#if IS_ENABLED(CONFIG_HYPERV)
16−
1715 #define EVMCS1_OFFSET(x) offsetof(struct hv_enlightened_vmcs, x)
1816 #define EVMCS1_FIELD(number, name, clean_field)[ROL16(number, 6)] = \
1917 {EVMCS1_OFFSET(name), clean_field}
@@ -296,6 +294,7 @@ const struct evmcs_field vmcs_field_to_evmcs_1[] = { · 276 unmodified lines
296294 };
297295 const unsigned int nr_evmcs_1_fields = ARRAY_SIZE(vmcs_field_to_evmcs_1);
298296
297+#if IS_ENABLED(CONFIG_HYPERV)
299298 __init void evmcs_sanitize_exec_ctrls(struct vmcs_config *vmcs_conf)
300299 {
301300 vmcs_conf->pin_based_exec_ctrl &= ~EVMCS1_UNSUPPORTED_PINCTRL;
@@ -362,6 +361,7 @@ void nested_evmcs_filter_control_msr(u32 msr_index, u64 *pdata) · 60 unmodified lines
362361 case MSR_IA32_VMX_PROCBASED_CTLS2:
363362 ctl_high &= ~EVMCS1_UNSUPPORTED_2NDEXEC;
364363 break;
364+ case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
365365 case MSR_IA32_VMX_PINBASED_CTLS:
366366 ctl_high &= ~EVMCS1_UNSUPPORTED_PINCTRL;
367367 break;
arch/x86/kvm/vmx/evmcs.h+39−9
@@ -59,12 +59,12 @@ DECLARE_STATIC_KEY_FALSE(enable_evmcs); · 58 unmodified lines
5959 SECONDARY_EXEC_SHADOW_VMCS | \
6060 SECONDARY_EXEC_TSC_SCALING | \
6161 SECONDARY_EXEC_PAUSE_LOOP_EXITING)
62−#define EVMCS1_UNSUPPORTED_VMEXIT_CTRL (VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL)
62+#define EVMCS1_UNSUPPORTED_VMEXIT_CTRL \
63+ (VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL | \
64+ VM_EXIT_SAVE_VMX_PREEMPTION_TIMER)
6365 #define EVMCS1_UNSUPPORTED_VMENTRY_CTRL (VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL)
6466 #define EVMCS1_UNSUPPORTED_VMFUNC (VMX_VMFUNC_EPTP_SWITCHING)
6567
66−#if IS_ENABLED(CONFIG_HYPERV)
67−
6868 struct evmcs_field {
6969 u16 offset;
7070 u16 clean_field;
@@ -73,26 +73,56 @@ struct evmcs_field { · 2 unmodified lines
7373 extern const struct evmcs_field vmcs_field_to_evmcs_1[];
7474 extern const unsigned int nr_evmcs_1_fields;
7575
76−static __always_inline int get_evmcs_offset(unsigned long field,
77− u16 *clean_field)
76+static __always_inline int evmcs_field_offset(unsigned long field,
77+ u16 *clean_field)
7878 {
7979 unsigned int index = ROL16(field, 6);
8080 const struct evmcs_field *evmcs_field;
8181
82− if (unlikely(index >= nr_evmcs_1_fields)) {
83− WARN_ONCE(1, "KVM: accessing unsupported EVMCS field %lx\n",
84− field);
82+ if (unlikely(index >= nr_evmcs_1_fields))
8583 return -ENOENT;
86− }
8784
8885 evmcs_field = &vmcs_field_to_evmcs_1[index];
8986
87+ /*
88+ * Use offset=0 to detect holes in eVMCS. This offset belongs to
89+ * 'revision_id' but this field has no encoding and is supposed to
90+ * be accessed directly.
91+ */
92+ if (unlikely(!evmcs_field->offset))
93+ return -ENOENT;
94+
9095 if (clean_field)
9196 *clean_field = evmcs_field->clean_field;
9297
9398 return evmcs_field->offset;
9499 }
95100
101+static inline u64 evmcs_read_any(struct hv_enlightened_vmcs *evmcs,
102+ unsigned long field, u16 offset)
103+{
104+ /*
105+ * vmcs12_read_any() doesn't care whether the supplied structure
106+ * is 'struct vmcs12' or 'struct hv_enlightened_vmcs' as it takes
107+ * the exact offset of the required field, use it for convenience
108+ * here.
109+ */
110+ return vmcs12_read_any((void *)evmcs, field, offset);
111+}
112+
113+#if IS_ENABLED(CONFIG_HYPERV)
114+
115+static __always_inline int get_evmcs_offset(unsigned long field,
116+ u16 *clean_field)
117+{
118+ int offset = evmcs_field_offset(field, clean_field);
119+
120+ WARN_ONCE(offset < 0, "KVM: accessing unsupported EVMCS field %lx\n",
121+ field);
122+
123+ return offset;
124+}
125+
96126 static __always_inline void evmcs_write64(unsigned long field, u64 value)
97127 {
98128 u16 clean_field;
arch/x86/kvm/vmx/nested.c+54−28
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <asm/mmu_context.h>
88
99 #include "cpuid.h"
10+#include "evmcs.h"
1011 #include "hyperv.h"
1112 #include "mmu.h"
1213 #include "nested.h"
@@ -4851,18 +4852,20 @@ static struct vmcs *alloc_shadow_vmcs(struct kvm_vcpu *vcpu) · 4838 unmodified lines
48514852 struct loaded_vmcs *loaded_vmcs = vmx->loaded_vmcs;
48524853
48534854 /*
4854− * We should allocate a shadow vmcs for vmcs01 only when L1
4855− * executes VMXON and free it when L1 executes VMXOFF.
4856− * As it is invalid to execute VMXON twice, we shouldn't reach
4857− * here when vmcs01 already have an allocated shadow vmcs.
4855+ * KVM allocates a shadow VMCS only when L1 executes VMXON and frees it
4856+ * when L1 executes VMXOFF or the vCPU is forced out of nested
4857+ * operation. VMXON faults if the CPU is already post-VMXON, so it
4858+ * should be impossible to already have an allocated shadow VMCS. KVM
4859+ * doesn't support virtualization of VMCS shadowing, so vmcs01 should
4860+ * always be the loaded VMCS.
48584861 */
4859− WARN_ON(loaded_vmcs == &vmx->vmcs01 && loaded_vmcs->shadow_vmcs);
4862+ if (WARN_ON(loaded_vmcs != &vmx->vmcs01 || loaded_vmcs->shadow_vmcs))
4863+ return loaded_vmcs->shadow_vmcs;
4864+
4865+ loaded_vmcs->shadow_vmcs = alloc_vmcs(true);
4866+ if (loaded_vmcs->shadow_vmcs)
4867+ vmcs_clear(loaded_vmcs->shadow_vmcs);
48604868
4861− if (!loaded_vmcs->shadow_vmcs) {
4862− loaded_vmcs->shadow_vmcs = alloc_vmcs(true);
4863− if (loaded_vmcs->shadow_vmcs)
4864− vmcs_clear(loaded_vmcs->shadow_vmcs);
4865− }
48664869 return loaded_vmcs->shadow_vmcs;
48674870 }
48684871
@@ -5099,27 +5102,49 @@ static int handle_vmread(struct kvm_vcpu *vcpu) · 230 unmodified lines
50995102 if (!nested_vmx_check_permission(vcpu))
51005103 return 1;
51015104
5102− /*
5103− * In VMX non-root operation, when the VMCS-link pointer is INVALID_GPA,
5104− * any VMREAD sets the ALU flags for VMfailInvalid.
5105− */
5106− if (vmx->nested.current_vmptr == INVALID_GPA ||
5107− (is_guest_mode(vcpu) &&
5108− get_vmcs12(vcpu)->vmcs_link_pointer == INVALID_GPA))
5109− return nested_vmx_failInvalid(vcpu);
5110−
51115105 /* Decode instruction info and find the field to read */
51125106 field = kvm_register_read(vcpu, (((instr_info) >> 28) & 0xf));
51135107
5114− offset = vmcs_field_to_offset(field);
5115− if (offset < 0)
5116− return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
5108+ if (!evmptr_is_valid(vmx->nested.hv_evmcs_vmptr)) {
5109+ /*
5110+ * In VMX non-root operation, when the VMCS-link pointer is INVALID_GPA,
5111+ * any VMREAD sets the ALU flags for VMfailInvalid.
5112+ */
5113+ if (vmx->nested.current_vmptr == INVALID_GPA ||
5114+ (is_guest_mode(vcpu) &&
5115+ get_vmcs12(vcpu)->vmcs_link_pointer == INVALID_GPA))
5116+ return nested_vmx_failInvalid(vcpu);
51175117
5118− if (!is_guest_mode(vcpu) && is_vmcs12_ext_field(field))
5119− copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12);
5118+ offset = get_vmcs12_field_offset(field);
5119+ if (offset < 0)
5120+ return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
5121+
5122+ if (!is_guest_mode(vcpu) && is_vmcs12_ext_field(field))
5123+ copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12);
51205124
5121− /* Read the field, zero-extended to a u64 value */
5122− value = vmcs12_read_any(vmcs12, field, offset);
5125+ /* Read the field, zero-extended to a u64 value */
5126+ value = vmcs12_read_any(vmcs12, field, offset);
5127+ } else {
5128+ /*
5129+ * Hyper-V TLFS (as of 6.0b) explicitly states, that while an
5130+ * enlightened VMCS is active VMREAD/VMWRITE instructions are
5131+ * unsupported. Unfortunately, certain versions of Windows 11
5132+ * don't comply with this requirement which is not enforced in
5133+ * genuine Hyper-V. Allow VMREAD from an enlightened VMCS as a
5134+ * workaround, as misbehaving guests will panic on VM-Fail.
5135+ * Note, enlightened VMCS is incompatible with shadow VMCS so
5136+ * all VMREADs from L2 should go to L1.
5137+ */
5138+ if (WARN_ON_ONCE(is_guest_mode(vcpu)))
5139+ return nested_vmx_failInvalid(vcpu);
5140+
5141+ offset = evmcs_field_offset(field, NULL);
5142+ if (offset < 0)
5143+ return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
5144+
5145+ /* Read the field, zero-extended to a u64 value */
5146+ value = evmcs_read_any(vmx->nested.hv_evmcs, field, offset);
5147+ }
51235148
51245149 /*
51255150 * Now copy part of this value to register or memory, as requested.
@@ -5214,7 +5239,7 @@ static int handle_vmwrite(struct kvm_vcpu *vcpu) · 88 unmodified lines
52145239
52155240 field = kvm_register_read(vcpu, (((instr_info) >> 28) & 0xf));
52165241
5217− offset = vmcs_field_to_offset(field);
5242+ offset = get_vmcs12_field_offset(field);
52185243 if (offset < 0)
52195244 return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
52205245
@@ -6462,7 +6487,7 @@ static u64 nested_vmx_calc_vmcs_enum_msr(void) · 1241 unmodified lines
64626487 max_idx = 0;
64636488 for (i = 0; i < nr_vmcs12_fields; i++) {
64646489 /* The vmcs12 table is very, very sparsely populated. */
6465− if (!vmcs_field_to_offset_table[i])
6490+ if (!vmcs12_field_offsets[i])
64666491 continue;
64676492
64686493 idx = vmcs_field_index(VMCS12_IDX_TO_ENC(i));
@@ -6771,6 +6796,7 @@ __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *)) · 302 unmodified lines
67716796 }
67726797
67736798 struct kvm_x86_nested_ops vmx_nested_ops = {
6799+ .leave_nested = vmx_leave_nested,
67746800 .check_events = vmx_check_nested_events,
67756801 .hv_timer_pending = nested_vmx_preemption_timer_pending,
67766802 .triple_fault = nested_vmx_triple_fault,
arch/x86/kvm/vmx/vmcs12.c+2−2
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 FIELD(number, name), \
99 [ROL16(number##_HIGH, 6)] = VMCS12_OFFSET(name) + sizeof(u32)
1010
11−const unsigned short vmcs_field_to_offset_table[] = {
11+const unsigned short vmcs12_field_offsets[] = {
1212 FIELD(VIRTUAL_PROCESSOR_ID, virtual_processor_id),
1313 FIELD(POSTED_INTR_NV, posted_intr_nv),
1414 FIELD(GUEST_ES_SELECTOR, guest_es_selector),
@@ -151,4 +151,4 @@ const unsigned short vmcs_field_to_offset_table[] = { · 136 unmodified lines
151151 FIELD(HOST_RSP, host_rsp),
152152 FIELD(HOST_RIP, host_rip),
153153 };
154−const unsigned int nr_vmcs12_fields = ARRAY_SIZE(vmcs_field_to_offset_table);
154+const unsigned int nr_vmcs12_fields = ARRAY_SIZE(vmcs12_field_offsets);
arch/x86/kvm/vmx/vmcs12.h+3−3
@@ -361,10 +361,10 @@ static inline void vmx_check_vmcs12_offsets(void) · 360 unmodified lines
361361 CHECK_OFFSET(guest_pml_index, 996);
362362 }
363363
364−extern const unsigned short vmcs_field_to_offset_table[];
364+extern const unsigned short vmcs12_field_offsets[];
365365 extern const unsigned int nr_vmcs12_fields;
366366
367−static inline short vmcs_field_to_offset(unsigned long field)
367+static inline short get_vmcs12_field_offset(unsigned long field)
368368 {
369369 unsigned short offset;
370370 unsigned int index;
@@ -377,7 +377,7 @@ static inline short vmcs_field_to_offset(unsigned long field) · 6 unmodified lines
377377 return -ENOENT;
378378
379379 index = array_index_nospec(index, nr_vmcs12_fields);
380− offset = vmcs_field_to_offset_table[index];
380+ offset = vmcs12_field_offsets[index];
381381 if (offset == 0)
382382 return -ENOENT;
383383 return offset;
arch/x86/kvm/vmx/vmx.c+57−12
@@ -1487,11 +1487,12 @@ static int vmx_rtit_ctl_check(struct kvm_vcpu *vcpu, u64 data) · 1486 unmodified lines
14871487 return 0;
14881488 }
14891489
1490−static bool vmx_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int insn_len)
1490+static bool vmx_can_emulate_instruction(struct kvm_vcpu *vcpu, int emul_type,
1491+ void *insn, int insn_len)
14911492 {
14921493 /*
14931494 * Emulation of instructions in SGX enclaves is impossible as RIP does
1494− * not point tthe failing instruction, and even if it did, the code
1495+ * not point at the failing instruction, and even if it did, the code
14951496 * stream is inaccessible. Inject #UD instead of exiting to userspace
14961497 * so that guest userspace can't DoS the guest simply by triggering
14971498 * emulation (enclaves are CPL3 only).
@@ -2603,7 +2604,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf, · 1105 unmodified lines
26032604 return -EIO;
26042605
26052606 vmcs_conf->size = vmx_msr_high & 0x1fff;
2606− vmcs_conf->order = get_order(vmcs_conf->size);
26072607 vmcs_conf->basic_cap = vmx_msr_high & ~0x1fff;
26082608
26092609 vmcs_conf->revision_id = vmx_msr_low;
@@ -2628,7 +2628,7 @@ struct vmcs *alloc_vmcs_cpu(bool shadow, int cpu, gfp_t flags) · 18 unmodified lines
26282628 struct page *pages;
26292629 struct vmcs *vmcs;
26302630
2631− pages = __alloc_pages_node(node, flags, vmcs_config.order);
2631+ pages = __alloc_pages_node(node, flags, 0);
26322632 if (!pages)
26332633 return NULL;
26342634 vmcs = page_address(pages);
@@ -2647,7 +2647,7 @@ struct vmcs *alloc_vmcs_cpu(bool shadow, int cpu, gfp_t flags) · 12 unmodified lines
26472647
26482648 void free_vmcs(struct vmcs *vmcs)
26492649 {
2650− free_pages((unsigned long)vmcs, vmcs_config.order);
2650+ free_page((unsigned long)vmcs);
26512651 }
26522652
26532653 /*
@@ -4041,6 +4041,21 @@ static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) · 1387 unmodified lines
40414041 return 0;
40424042 }
40434043
4044+static void vmx_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode,
4045+ int trig_mode, int vector)
4046+{
4047+ struct kvm_vcpu *vcpu = apic->vcpu;
4048+
4049+ if (vmx_deliver_posted_interrupt(vcpu, vector)) {
4050+ kvm_lapic_set_irr(vector, apic);
4051+ kvm_make_request(KVM_REQ_EVENT, vcpu);
4052+ kvm_vcpu_kick(vcpu);
4053+ } else {
4054+ trace_kvm_apicv_accept_irq(vcpu->vcpu_id, delivery_mode,
4055+ trig_mode, vector);
4056+ }
4057+}
4058+
40444059 /*
40454060 * Set up the vmcs's constant host-state fields, i.e., host-state fields that
40464061 * will not change in the lifetime of the guest.
@@ -4094,10 +4109,14 @@ void vmx_set_constant_host_state(struct vcpu_vmx *vmx) · 47 unmodified lines
40944109 vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
40954110
40964111 /*
4097− * If 32-bit syscall is enabled, vmx_vcpu_load_vcms rewrites
4098− * HOST_IA32_SYSENTER_ESP.
4112+ * SYSENTER is used for 32-bit system calls on either 32-bit or
4113+ * 64-bit kernels. It is always zero If neither is allowed, otherwise
4114+ * vmx_vcpu_load_vmcs loads it with the per-CPU entry stack (and may
4115+ * have already done so!).
40994116 */
4100− vmcs_writel(HOST_IA32_SYSENTER_ESP, 0);
4117+ if (!IS_ENABLED(CONFIG_IA32_EMULATION) && !IS_ENABLED(CONFIG_X86_32))
4118+ vmcs_writel(HOST_IA32_SYSENTER_ESP, 0);
4119+
41014120 rdmsrl(MSR_IA32_SYSENTER_EIP, tmpl);
41024121 vmcs_writel(HOST_IA32_SYSENTER_EIP, tmpl); /* 22.2.3 */
41034122
@@ -4901,8 +4920,33 @@ static int handle_exception_nmi(struct kvm_vcpu *vcpu) · 797 unmodified lines
49014920 dr6 = vmx_get_exit_qual(vcpu);
49024921 if (!(vcpu->guest_debug &
49034922 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) {
4923+ /*
4924+ * If the #DB was due to ICEBP, a.k.a. INT1, skip the
4925+ * instruction. ICEBP generates a trap-like #DB, but
4926+ * despite its interception control being tied to #DB,
4927+ * is an instruction intercept, i.e. the VM-Exit occurs
4928+ * on the ICEBP itself. Note, skipping ICEBP also
4929+ * clears STI and MOVSS blocking.
4930+ *
4931+ * For all other #DBs, set vmcs.PENDING_DBG_EXCEPTIONS.BS
4932+ * if single-step is enabled in RFLAGS and STI or MOVSS
4933+ * blocking is active, as the CPU doesn't set the bit
4934+ * on VM-Exit due to #DB interception. VM-Entry has a
4935+ * consistency check that a single-step #DB is pending
4936+ * in this scenario as the previous instruction cannot
4937+ * have toggled RFLAGS.TF 0=>1 (because STI and POP/MOV
4938+ * don't modify RFLAGS), therefore the one instruction
4939+ * delay when activating single-step breakpoints must
4940+ * have already expired. Note, the CPU sets/clears BS
4941+ * as appropriate for all other VM-Exits types.
4942+ */
49044943 if (is_icebp(intr_info))
49054944 WARN_ON(!skip_emulated_instruction(vcpu));
4945+ else if ((vmx_get_rflags(vcpu) & X86_EFLAGS_TF) &&
4946+ (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
4947+ (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS)))
4948+ vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS,
4949+ vmcs_readl(GUEST_PENDING_DBG_EXCEPTIONS) | DR6_BS);
49064950
49074951 kvm_queue_exception_p(vcpu, DB_VECTOR, dr6);
49084952 return 1;
@@ -5397,7 +5441,7 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu) · 488 unmodified lines
53975441 {
53985442 gpa_t gpa;
53995443
5400− if (!vmx_can_emulate_instruction(vcpu, NULL, 0))
5444+ if (!vmx_can_emulate_instruction(vcpu, EMULTYPE_PF, NULL, 0))
54015445 return 1;
54025446
54035447 /*
@@ -6725,7 +6769,7 @@ static fastpath_t vmx_exit_handlers_fastpath(struct kvm_vcpu *vcpu) · 1321 unmodified lines
67256769 static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
67266770 struct vcpu_vmx *vmx)
67276771 {
6728− kvm_guest_enter_irqoff();
6772+ guest_state_enter_irqoff();
67296773
67306774 /* L1D Flush includes CPU buffer clear to mitigate MDS */
67316775 if (static_branch_unlikely(&vmx_l1d_should_flush))
@@ -6741,7 +6785,7 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu, · 9 unmodified lines
67416785
67426786 vcpu->arch.cr2 = native_read_cr2();
67436787
6744− kvm_guest_exit_irqoff();
6788+ guest_state_exit_irqoff();
67456789 }
67466790
67476791 static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu)
@@ -7615,6 +7659,7 @@ static int vmx_leave_smm(struct kvm_vcpu *vcpu, const char *smstate) · 867 unmodified lines
76157659 if (ret)
76167660 return ret;
76177661
7662+ vmx->nested.nested_run_pending = 1;
76187663 vmx->nested.smm.guest_mode = false;
76197664 }
76207665 return 0;
@@ -7739,7 +7784,7 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = { · 118 unmodified lines
77397784 .hwapic_isr_update = vmx_hwapic_isr_update,
77407785 .guest_apic_has_interrupt = vmx_guest_apic_has_interrupt,
77417786 .sync_pir_to_irr = vmx_sync_pir_to_irr,
7742− .deliver_posted_interrupt = vmx_deliver_posted_interrupt,
7787+ .deliver_interrupt = vmx_deliver_interrupt,
77437788 .dy_apicv_has_pending_interrupt = pi_has_pending_interrupt,
77447789
77457790 .set_tss_addr = vmx_set_tss_addr,
arch/x86/kvm/x86.c+89−17
@@ -90,6 +90,8 @@ · 89 unmodified lines
9090 u64 __read_mostly kvm_mce_cap_supported = MCG_CTL_P | MCG_SER_P;
9191 EXPORT_SYMBOL_GPL(kvm_mce_cap_supported);
9292
93+#define ERR_PTR_USR(e) ((void __user *)ERR_PTR(e))
94+
9395 #define emul_to_vcpu(ctxt) \
9496 ((struct kvm_vcpu *)(ctxt)->vcpu)
9597
@@ -3535,6 +3537,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 3439 unmodified lines
35353537 if (data & ~supported_xss)
35363538 return 1;
35373539 vcpu->arch.ia32_xss = data;
3540+ kvm_update_cpuid_runtime(vcpu);
35383541 break;
35393542 case MSR_SMI_COUNT:
35403543 if (!msr_info->host_initiated)
@@ -4229,6 +4232,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 688 unmodified lines
42294232 case KVM_CAP_SREGS2:
42304233 case KVM_CAP_EXIT_ON_EMULATION_FAILURE:
42314234 case KVM_CAP_VCPU_ATTRIBUTES:
4235+ case KVM_CAP_SYS_ATTRIBUTES:
42324236 r = 1;
42334237 break;
42344238 case KVM_CAP_EXIT_HYPERCALL:
@@ -4331,7 +4335,49 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 96 unmodified lines
43314335 break;
43324336 }
43334337 return r;
4338+}
4339+
4340+static inline void __user *kvm_get_attr_addr(struct kvm_device_attr *attr)
4341+{
4342+ void __user *uaddr = (void __user*)(unsigned long)attr->addr;
4343+
4344+ if ((u64)(unsigned long)uaddr != attr->addr)
4345+ return ERR_PTR_USR(-EFAULT);
4346+ return uaddr;
4347+}
4348+
4349+static int kvm_x86_dev_get_attr(struct kvm_device_attr *attr)
4350+{
4351+ u64 __user *uaddr = kvm_get_attr_addr(attr);
4352+
4353+ if (attr->group)
4354+ return -ENXIO;
43344355
4356+ if (IS_ERR(uaddr))
4357+ return PTR_ERR(uaddr);
4358+
4359+ switch (attr->attr) {
4360+ case KVM_X86_XCOMP_GUEST_SUPP:
4361+ if (put_user(supported_xcr0, uaddr))
4362+ return -EFAULT;
4363+ return 0;
4364+ default:
4365+ return -ENXIO;
4366+ break;
4367+ }
4368+}
4369+
4370+static int kvm_x86_dev_has_attr(struct kvm_device_attr *attr)
4371+{
4372+ if (attr->group)
4373+ return -ENXIO;
4374+
4375+ switch (attr->attr) {
4376+ case KVM_X86_XCOMP_GUEST_SUPP:
4377+ return 0;
4378+ default:
4379+ return -ENXIO;
4380+ }
43354381 }
43364382
43374383 long kvm_arch_dev_ioctl(struct file *filp,
@@ -4422,6 +4468,22 @@ long kvm_arch_dev_ioctl(struct file *filp, · 84 unmodified lines
44224468 case KVM_GET_SUPPORTED_HV_CPUID:
44234469 r = kvm_ioctl_get_supported_hv_cpuid(NULL, argp);
44244470 break;
4471+ case KVM_GET_DEVICE_ATTR: {
4472+ struct kvm_device_attr attr;
4473+ r = -EFAULT;
4474+ if (copy_from_user(&attr, (void __user *)arg, sizeof(attr)))
4475+ break;
4476+ r = kvm_x86_dev_get_attr(&attr);
4477+ break;
4478+ }
4479+ case KVM_HAS_DEVICE_ATTR: {
4480+ struct kvm_device_attr attr;
4481+ r = -EFAULT;
4482+ if (copy_from_user(&attr, (void __user *)arg, sizeof(attr)))
4483+ break;
4484+ r = kvm_x86_dev_has_attr(&attr);
4485+ break;
4486+ }
44254487 default:
44264488 r = -EINVAL;
44274489 break;
@@ -4860,8 +4922,10 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, · 432 unmodified lines
48604922 vcpu->arch.apic->sipi_vector = events->sipi_vector;
48614923
48624924 if (events->flags & KVM_VCPUEVENT_VALID_SMM) {
4863− if (!!(vcpu->arch.hflags & HF_SMM_MASK) != events->smi.smm)
4925+ if (!!(vcpu->arch.hflags & HF_SMM_MASK) != events->smi.smm) {
4926+ kvm_x86_ops.nested_ops->leave_nested(vcpu);
48644927 kvm_smm_changed(vcpu, events->smi.smm);
4928+ }
48654929
48664930 vcpu->arch.smi_pending = events->smi.pending;
48674931
@@ -5022,11 +5086,11 @@ static int kvm_arch_tsc_has_attr(struct kvm_vcpu *vcpu, · 154 unmodified lines
50225086 static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu,
50235087 struct kvm_device_attr *attr)
50245088 {
5025− u64 __user *uaddr = (u64 __user *)(unsigned long)attr->addr;
5089+ u64 __user *uaddr = kvm_get_attr_addr(attr);
50265090 int r;
50275091
5028− if ((u64)(unsigned long)uaddr != attr->addr)
5029− return -EFAULT;
5092+ if (IS_ERR(uaddr))
5093+ return PTR_ERR(uaddr);
50305094
50315095 switch (attr->attr) {
50325096 case KVM_VCPU_TSC_OFFSET:
@@ -5045,12 +5109,12 @@ static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu, · 12 unmodified lines
50455109 static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
50465110 struct kvm_device_attr *attr)
50475111 {
5048− u64 __user *uaddr = (u64 __user *)(unsigned long)attr->addr;
5112+ u64 __user *uaddr = kvm_get_attr_addr(attr);
50495113 struct kvm *kvm = vcpu->kvm;
50505114 int r;
50515115
5052− if ((u64)(unsigned long)uaddr != attr->addr)
5053− return -EFAULT;
5116+ if (IS_ERR(uaddr))
5117+ return PTR_ERR(uaddr);
50545118
50555119 switch (attr->attr) {
50565120 case KVM_VCPU_TSC_OFFSET: {
@@ -6810,6 +6874,13 @@ int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val, · 1753 unmodified lines
68106874 }
68116875 EXPORT_SYMBOL_GPL(kvm_write_guest_virt_system);
68126876
6877+static int kvm_can_emulate_insn(struct kvm_vcpu *vcpu, int emul_type,
6878+ void *insn, int insn_len)
6879+{
6880+ return static_call(kvm_x86_can_emulate_instruction)(vcpu, emul_type,
6881+ insn, insn_len);
6882+}
6883+
68136884 int handle_ud(struct kvm_vcpu *vcpu)
68146885 {
68156886 static const char kvm_emulate_prefix[] = { __KVM_EMULATE_PREFIX };
@@ -6817,7 +6888,7 @@ int handle_ud(struct kvm_vcpu *vcpu) · 1 unmodified line
68176888 char sig[5]; /* ud2; .ascii "kvm" */
68186889 struct x86_exception e;
68196890
6820− if (unlikely(!static_call(kvm_x86_can_emulate_instruction)(vcpu, NULL, 0)))
6891+ if (unlikely(!kvm_can_emulate_insn(vcpu, emul_type, NULL, 0)))
68216892 return 1;
68226893
68236894 if (force_emulation_prefix &&
@@ -8193,7 +8264,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, · 1369 unmodified lines
81938264 bool writeback = true;
81948265 bool write_fault_to_spt;
81958266
8196− if (unlikely(!static_call(kvm_x86_can_emulate_instruction)(vcpu, insn, insn_len)))
8267+ if (unlikely(!kvm_can_emulate_insn(vcpu, emulation_type, insn, insn_len)))
81978268 return 1;
81988269
81998270 vcpu->arch.l1tf_flush_l1d = true;
@@ -9706,7 +9777,7 @@ void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, · 1506 unmodified lines
97069777 kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD);
97079778 }
97089779
9709−void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu)
9780+static void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu)
97109781 {
97119782 if (!lapic_in_kernel(vcpu))
97129783 return;
@@ -9912,7 +9983,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 199 unmodified lines
99129983 * result in virtual interrupt delivery.
99139984 */
99149985 local_irq_disable();
9915− vcpu->mode = IN_GUEST_MODE;
9986+
9987+ /* Store vcpu->apicv_active before vcpu->mode. */
9988+ smp_store_release(&vcpu->mode, IN_GUEST_MODE);
99169989
99179990 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
99189991
@@ -9972,6 +10045,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 53 unmodified lines
997210045 set_debugreg(0, 7);
997310046 }
997410047
10048+ guest_timing_enter_irqoff();
10049+
997510050 for (;;) {
997610051 /*
997710052 * Assert that vCPU vs. VM APICv state is consistent. An APICv
@@ -10056,7 +10131,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 78 unmodified lines
1005610131 * of accounting via context tracking, but the loss of accuracy is
1005710132 * acceptable for all known use cases.
1005810133 */
10059− vtime_account_guest_exit();
10134+ guest_timing_exit_irqoff();
1006010135
1006110136 if (lapic_in_kernel(vcpu)) {
1006210137 s64 delta = vcpu->arch.apic->lapic_timer.advance_expire_delta;
@@ -11209,7 +11284,8 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 1146 unmodified lines
1120911284
1121011285 vcpu->arch.msr_misc_features_enables = 0;
1121111286
11212− vcpu->arch.xcr0 = XFEATURE_MASK_FP;
11287+ __kvm_set_xcr(vcpu, 0, XFEATURE_MASK_FP);
11288+ __kvm_set_msr(vcpu, MSR_IA32_XSS, 0, true);
1121311289 }
1121411290
1121511291 /* All GPRs except RDX (handled below) are zeroed on RESET/INIT. */
@@ -11226,8 +11302,6 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 10 unmodified lines
1122611302 cpuid_0x1 = kvm_find_cpuid_entry(vcpu, 1, 0);
1122711303 kvm_rdx_write(vcpu, cpuid_0x1 ? cpuid_0x1->eax : 0x600);
1122811304
11229− vcpu->arch.ia32_xss = 0;
11230−
1123111305 static_call(kvm_x86_vcpu_reset)(vcpu, init_event);
1123211306
1123311307 kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);
@@ -11571,8 +11645,6 @@ void kvm_arch_sync_events(struct kvm *kvm) · 337 unmodified lines
1157111645 kvm_free_pit(kvm);
1157211646 }
1157311647
11574−#define ERR_PTR_USR(e) ((void __user *)ERR_PTR(e))
11575−
1157611648 /**
1157711649 * __x86_set_memory_region: Setup KVM internal memory slot
1157811650 *
arch/x86/kvm/x86.h+0−45
@@ -10,51 +10,6 @@ · 9 unmodified lines
1010
1111 void kvm_spurious_fault(void);
1212
13−static __always_inline void kvm_guest_enter_irqoff(void)
14−{
15− /*
16− * VMENTER enables interrupts (host state), but the kernel state is
17− * interrupts disabled when this is invoked. Also tell RCU about
18− * it. This is the same logic as for exit_to_user_mode().
19− *
20− * This ensures that e.g. latency analysis on the host observes
21− * guest mode as interrupt enabled.
22− *
23− * guest_enter_irqoff() informs context tracking about the
24− * transition to guest mode and if enabled adjusts RCU state
25− * accordingly.
26− */
27− instrumentation_begin();
28− trace_hardirqs_on_prepare();
29− lockdep_hardirqs_on_prepare(CALLER_ADDR0);
30− instrumentation_end();
31−
32− guest_enter_irqoff();
33− lockdep_hardirqs_on(CALLER_ADDR0);
34−}
35−
36−static __always_inline void kvm_guest_exit_irqoff(void)
37−{
38− /*
39− * VMEXIT disables interrupts (host state), but tracing and lockdep
40− * have them in state 'on' as recorded before entering guest mode.
41− * Same as enter_from_user_mode().
42− *
43− * context_tracking_guest_exit() restores host context and reinstates
44− * RCU if enabled and required.
45− *
46− * This needs to be done immediately after VM-Exit, before any code
47− * that might contain tracepoints or call out to the greater world,
48− * e.g. before x86_spec_ctrl_restore_host().
49− */
50− lockdep_hardirqs_off(CALLER_ADDR0);
51− context_tracking_guest_exit();
52−
53− instrumentation_begin();
54− trace_hardirqs_off_finish();
55− instrumentation_end();
56−}
57−
5813 #define KVM_NESTED_VMENTER_CONSISTENCY_CHECK(consistency_check) \
5914 ({ \
6015 bool failed = (consistency_check); \
arch/x86/kvm/xen.c+69−38
@@ -133,32 +133,57 @@ static void kvm_xen_update_runstate(struct kvm_vcpu *v, int state) · 132 unmodified lines
133133 void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state)
134134 {
135135 struct kvm_vcpu_xen *vx = &v->arch.xen;
136+ struct gfn_to_hva_cache *ghc = &vx->runstate_cache;
137+ struct kvm_memslots *slots = kvm_memslots(v->kvm);
138+ bool atomic = (state == RUNSTATE_runnable);
136139 uint64_t state_entry_time;
137− unsigned int offset;
140+ int __user *user_state;
141+ uint64_t __user *user_times;
138142
139143 kvm_xen_update_runstate(v, state);
140144
141145 if (!vx->runstate_set)
142146 return;
143147
144− BUILD_BUG_ON(sizeof(struct compat_vcpu_runstate_info) != 0x2c);
148+ if (unlikely(slots->generation != ghc->generation || kvm_is_error_hva(ghc->hva)) &&
149+ kvm_gfn_to_hva_cache_init(v->kvm, ghc, ghc->gpa, ghc->len))
150+ return;
151+
152+ /* We made sure it fits in a single page */
153+ BUG_ON(!ghc->memslot);
154+
155+ if (atomic)
156+ pagefault_disable();
145157
146− offset = offsetof(struct compat_vcpu_runstate_info, state_entry_time);
147−#ifdef CONFIG_X86_64
148158 /*
149− * The only difference is alignment of uint64_t in 32-bit.
150− * So the first field 'state' is accessed directly using
151− * offsetof() (where its offset happens to be zero), while the
152− * remaining fields which are all uint64_t, start at 'offset'
153− * which we tweak here by adding 4.
159+ * The only difference between 32-bit and 64-bit versions of the
160+ * runstate struct us the alignment of uint64_t in 32-bit, which
161+ * means that the 64-bit version has an additional 4 bytes of
162+ * padding after the first field 'state'.
163+ *
164+ * So we use 'int __user *user_state' to point to the state field,
165+ * and 'uint64_t __user *user_times' for runstate_entry_time. So
166+ * the actual array of time[] in each state starts at user_times[1].
154167 */
168+ BUILD_BUG_ON(offsetof(struct vcpu_runstate_info, state) != 0);
169+ BUILD_BUG_ON(offsetof(struct compat_vcpu_runstate_info, state) != 0);
170+ user_state = (int __user *)ghc->hva;
171+
172+ BUILD_BUG_ON(sizeof(struct compat_vcpu_runstate_info) != 0x2c);
173+
174+ user_times = (uint64_t __user *)(ghc->hva +
175+ offsetof(struct compat_vcpu_runstate_info,
176+ state_entry_time));
177+#ifdef CONFIG_X86_64
155178 BUILD_BUG_ON(offsetof(struct vcpu_runstate_info, state_entry_time) !=
156179 offsetof(struct compat_vcpu_runstate_info, state_entry_time) + 4);
157180 BUILD_BUG_ON(offsetof(struct vcpu_runstate_info, time) !=
158181 offsetof(struct compat_vcpu_runstate_info, time) + 4);
159182
160183 if (v->kvm->arch.xen.long_mode)
161− offset = offsetof(struct vcpu_runstate_info, state_entry_time);
184+ user_times = (uint64_t __user *)(ghc->hva +
185+ offsetof(struct vcpu_runstate_info,
186+ state_entry_time));
162187 #endif
163188 /*
164189 * First write the updated state_entry_time at the appropriate
@@ -172,10 +197,8 @@ void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state) · 7 unmodified lines
172197 BUILD_BUG_ON(sizeof_field(struct compat_vcpu_runstate_info, state_entry_time) !=
173198 sizeof(state_entry_time));
174199
175− if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
176− &state_entry_time, offset,
177− sizeof(state_entry_time)))
178− return;
200+ if (__put_user(state_entry_time, user_times))
201+ goto out;
179202 smp_wmb();
180203
181204 /*
@@ -189,11 +212,8 @@ void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state) · 7 unmodified lines
189212 BUILD_BUG_ON(sizeof_field(struct compat_vcpu_runstate_info, state) !=
190213 sizeof(vx->current_runstate));
191214
192− if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
193− &vx->current_runstate,
194− offsetof(struct vcpu_runstate_info, state),
195− sizeof(vx->current_runstate)))
196− return;
215+ if (__put_user(vx->current_runstate, user_state))
216+ goto out;
197217
198218 /*
199219 * Write the actual runstate times immediately after the
@@ -208,24 +228,23 @@ void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, int state) · 8 unmodified lines
208228 BUILD_BUG_ON(sizeof_field(struct vcpu_runstate_info, time) !=
209229 sizeof(vx->runstate_times));
210230
211− if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
212− &vx->runstate_times[0],
213− offset + sizeof(u64),
214− sizeof(vx->runstate_times)))
215− return;
216−
231+ if (__copy_to_user(user_times + 1, vx->runstate_times, sizeof(vx->runstate_times)))
232+ goto out;
217233 smp_wmb();
218234
219235 /*
220236 * Finally, clear the XEN_RUNSTATE_UPDATE bit in the guest's
221237 * runstate_entry_time field.
222238 */
223−
224239 state_entry_time &= ~XEN_RUNSTATE_UPDATE;
225− if (kvm_write_guest_offset_cached(v->kvm, &v->arch.xen.runstate_cache,
226− &state_entry_time, offset,
227− sizeof(state_entry_time)))
228− return;
240+ __put_user(state_entry_time, user_times);
241+ smp_wmb();
242+
243+ out:
244+ mark_page_dirty_in_slot(v->kvm, ghc->memslot, ghc->gpa >> PAGE_SHIFT);
245+
246+ if (atomic)
247+ pagefault_enable();
229248 }
230249
231250 int __kvm_xen_has_interrupt(struct kvm_vcpu *v)
@@ -316,10 +335,7 @@ int __kvm_xen_has_interrupt(struct kvm_vcpu *v) · 84 unmodified lines
316335 "\tnotq %0\n"
317336 "\t" LOCK_PREFIX "andq %0, %2\n"
318337 "2:\n"
319− "\t.section .fixup,\"ax\"\n"
320− "3:\tjmp\t2b\n"
321− "\t.previous\n"
322− _ASM_EXTABLE_UA(1b, 3b)
338+ _ASM_EXTABLE_UA(1b, 2b)
323339 : "=r" (evtchn_pending_sel),
324340 "+m" (vi->evtchn_pending_sel),
325341 "+m" (v->arch.xen.evtchn_pending_sel)
@@ -335,10 +351,7 @@ int __kvm_xen_has_interrupt(struct kvm_vcpu *v) · 9 unmodified lines
335351 "\tnotl %0\n"
336352 "\t" LOCK_PREFIX "andl %0, %2\n"
337353 "2:\n"
338− "\t.section .fixup,\"ax\"\n"
339− "3:\tjmp\t2b\n"
340− "\t.previous\n"
341− _ASM_EXTABLE_UA(1b, 3b)
354+ _ASM_EXTABLE_UA(1b, 2b)
342355 : "=r" (evtchn_pending_sel32),
343356 "+m" (vi->evtchn_pending_sel),
344357 "+m" (v->arch.xen.evtchn_pending_sel)
@@ -449,6 +462,12 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data) · 104 unmodified lines
449462 break;
450463 }
451464
465+ /* It must fit within a single page */
466+ if ((data->u.gpa & ~PAGE_MASK) + sizeof(struct vcpu_info) > PAGE_SIZE) {
467+ r = -EINVAL;
468+ break;
469+ }
470+
452471 r = kvm_gfn_to_hva_cache_init(vcpu->kvm,
453472 &vcpu->arch.xen.vcpu_info_cache,
454473 data->u.gpa,
@@ -466,6 +485,12 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data) · 11 unmodified lines
466485 break;
467486 }
468487
488+ /* It must fit within a single page */
489+ if ((data->u.gpa & ~PAGE_MASK) + sizeof(struct pvclock_vcpu_time_info) > PAGE_SIZE) {
490+ r = -EINVAL;
491+ break;
492+ }
493+
469494 r = kvm_gfn_to_hva_cache_init(vcpu->kvm,
470495 &vcpu->arch.xen.vcpu_time_info_cache,
471496 data->u.gpa,
@@ -487,6 +512,12 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data) · 15 unmodified lines
487512 break;
488513 }
489514
515+ /* It must fit within a single page */
516+ if ((data->u.gpa & ~PAGE_MASK) + sizeof(struct vcpu_runstate_info) > PAGE_SIZE) {
517+ r = -EINVAL;
518+ break;
519+ }
520+
490521 r = kvm_gfn_to_hva_cache_init(vcpu->kvm,
491522 &vcpu->arch.xen.runstate_cache,
492523 data->u.gpa,
arch/x86/pci/fixup.c+2−2
@@ -353,8 +353,8 @@ static void pci_fixup_video(struct pci_dev *pdev) · 352 unmodified lines
353353 }
354354 }
355355 }
356−DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
357− PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
356+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID,
357+ PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
358358
359359
360360 static const struct dmi_system_id msi_k8t_dmi_table[] = {
arch/x86/xen/enlighten_hvm.c+11−11
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <xen/events.h>
1010 #include <xen/interface/memory.h>
1111
12+#include <asm/apic.h>
1213 #include <asm/cpu.h>
1314 #include <asm/smp.h>
1415 #include <asm/io_apic.h>
@@ -184,8 +185,7 @@ static int xen_cpu_dead_hvm(unsigned int cpu) · 169 unmodified lines
184185
185186 if (xen_have_vector_callback && xen_feature(XENFEAT_hvm_safe_pvclock))
186187 xen_teardown_timer(cpu);
187−
188− return 0;
188+ return 0;
189189 }
190190
191191 static bool no_vector_callback __initdata;
@@ -242,15 +242,14 @@ static __init int xen_parse_no_vector_callback(char *arg) · 50 unmodified lines
242242 }
243243 early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
244244
245−bool __init xen_hvm_need_lapic(void)
245+static __init bool xen_x2apic_available(void)
246246 {
247− if (xen_pv_domain())
248− return false;
249− if (!xen_hvm_domain())
250− return false;
251− if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)
252− return false;
253− return true;
247+ return x2apic_supported();
248+}
249+
250+static bool __init msi_ext_dest_id(void)
251+{
252+ return cpuid_eax(xen_cpuid_base() + 4) & XEN_HVM_CPUID_EXT_DEST_ID;
254253 }
255254
256255 static __init void xen_hvm_guest_late_init(void)
@@ -312,9 +311,10 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata = { · 55 unmodified lines
312311 .detect = xen_platform_hvm,
313312 .type = X86_HYPER_XEN_HVM,
314313 .init.init_platform = xen_hvm_guest_init,
315− .init.x2apic_available = xen_x2apic_para_available,
314+ .init.x2apic_available = xen_x2apic_available,
316315 .init.init_mem_mapping = xen_hvm_init_mem_mapping,
317316 .init.guest_late_init = xen_hvm_guest_late_init,
317+ .init.msi_ext_dest_id = msi_ext_dest_id,
318318 .runtime.pin_vcpu = xen_pin_vcpu,
319319 .ignore_nopv = true,
320320 };
arch/x86/xen/enlighten_pv.c+0−4
@@ -1341,10 +1341,6 @@ asmlinkage __visible void __init xen_start_kernel(void) · 1340 unmodified lines
13411341
13421342 xen_acpi_sleep_register();
13431343
1344− /* Avoid searching for BIOS MP tables */
1345− x86_init.mpparse.find_smp_config = x86_init_noop;
1346− x86_init.mpparse.get_smp_config = x86_init_uint_noop;
1347−
13481344 xen_boot_params_init_edd();
13491345
13501346 #ifdef CONFIG_ACPI
arch/x86/xen/smp_pv.c+6−20
@@ -148,28 +148,12 @@ int xen_smp_intr_init_pv(unsigned int cpu) · 147 unmodified lines
148148 return rc;
149149 }
150150
151−static void __init xen_fill_possible_map(void)
152−{
153− int i, rc;
154−
155− if (xen_initial_domain())
156− return;
157−
158− for (i = 0; i < nr_cpu_ids; i++) {
159− rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
160− if (rc >= 0) {
161− num_processors++;
162− set_cpu_possible(i, true);
163− }
164− }
165−}
166−
167−static void __init xen_filter_cpu_maps(void)
151+static void __init _get_smp_config(unsigned int early)
168152 {
169153 int i, rc;
170154 unsigned int subtract = 0;
171155
172− if (!xen_initial_domain())
156+ if (early)
173157 return;
174158
175159 num_processors = 0;
@@ -210,7 +194,6 @@ static void __init xen_pv_smp_prepare_boot_cpu(void) · 34 unmodified lines
210194 * sure the old memory can be recycled. */
211195 make_lowmem_page_readwrite(xen_initial_gdt);
212196
213− xen_filter_cpu_maps();
214197 xen_setup_vcpu_info_placement();
215198
216199 /*
@@ -476,5 +459,8 @@ static const struct smp_ops xen_smp_ops __initconst = { · 259 unmodified lines
476459 void __init xen_smp_init(void)
477460 {
478461 smp_ops = xen_smp_ops;
479− xen_fill_possible_map();
462+
463+ /* Avoid searching for BIOS MP tables */
464+ x86_init.mpparse.find_smp_config = x86_init_noop;
465+ x86_init.mpparse.get_smp_config = _get_smp_config;
480466 }
arch/x86/xen/vga.c+8−8
@@ -57,6 +57,14 @@ void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size) · 56 unmodified lines
5757 screen_info->rsvd_size = info->u.vesa_lfb.rsvd_size;
5858 screen_info->rsvd_pos = info->u.vesa_lfb.rsvd_pos;
5959
60+ if (size >= offsetof(struct dom0_vga_console_info,
61+ u.vesa_lfb.ext_lfb_base)
62+ + sizeof(info->u.vesa_lfb.ext_lfb_base)
63+ && info->u.vesa_lfb.ext_lfb_base) {
64+ screen_info->ext_lfb_base = info->u.vesa_lfb.ext_lfb_base;
65+ screen_info->capabilities |= VIDEO_CAPABILITY_64BIT_BASE;
66+ }
67+
6068 if (info->video_type == XEN_VGATYPE_EFI_LFB) {
6169 screen_info->orig_video_isVGA = VIDEO_TYPE_EFI;
6270 break;
@@ -66,14 +74,6 @@ void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size) · 3 unmodified lines
6674 u.vesa_lfb.mode_attrs)
6775 + sizeof(info->u.vesa_lfb.mode_attrs))
6876 screen_info->vesa_attributes = info->u.vesa_lfb.mode_attrs;
69−
70− if (size >= offsetof(struct dom0_vga_console_info,
71− u.vesa_lfb.ext_lfb_base)
72− + sizeof(info->u.vesa_lfb.ext_lfb_base)
73− && info->u.vesa_lfb.ext_lfb_base) {
74− screen_info->ext_lfb_base = info->u.vesa_lfb.ext_lfb_base;
75− screen_info->capabilities |= VIDEO_CAPABILITY_64BIT_BASE;
76− }
7777 break;
7878 }
7979 }
block/bfq-iosched.c+2−0
@@ -7018,6 +7018,8 @@ static void bfq_exit_queue(struct elevator_queue *e) · 7017 unmodified lines
70187018 spin_unlock_irq(&bfqd->lock);
70197019 #endif
70207020
7021+ wbt_enable_default(bfqd->queue);
7022+
70217023 kfree(bfqd);
70227024 }
70237025
block/bio-integrity.c+1−1
@@ -373,7 +373,7 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done) · 372 unmodified lines
373373 struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk);
374374 unsigned bytes = bio_integrity_bytes(bi, bytes_done >> 9);
375375
376− bip->bip_iter.bi_sector += bytes_done >> 9;
376+ bip->bip_iter.bi_sector += bio_integrity_intervals(bi, bytes_done >> 9);
377377 bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes);
378378 }
379379
block/blk-core.c+21−14
@@ -284,13 +284,6 @@ void blk_queue_start_drain(struct request_queue *q) · 283 unmodified lines
284284 wake_up_all(&q->mq_freeze_wq);
285285 }
286286
287−void blk_set_queue_dying(struct request_queue *q)
288−{
289− blk_queue_flag_set(QUEUE_FLAG_DYING, q);
290− blk_queue_start_drain(q);
291−}
292−EXPORT_SYMBOL_GPL(blk_set_queue_dying);
293−
294287 /**
295288 * blk_cleanup_queue - shutdown a request queue
296289 * @q: request queue to shutdown
@@ -308,7 +301,8 @@ void blk_cleanup_queue(struct request_queue *q) · 11 unmodified lines
308301 WARN_ON_ONCE(blk_queue_registered(q));
309302
310303 /* mark @q DYING, no new request or merges will be allowed afterwards */
311− blk_set_queue_dying(q);
304+ blk_queue_flag_set(QUEUE_FLAG_DYING, q);
305+ blk_queue_start_drain(q);
312306
313307 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, q);
314308 blk_queue_flag_set(QUEUE_FLAG_NOXMERGES, q);
@@ -1061,20 +1055,32 @@ again: · 746 unmodified lines
10611055 }
10621056
10631057 static unsigned long __part_start_io_acct(struct block_device *part,
1064− unsigned int sectors, unsigned int op)
1058+ unsigned int sectors, unsigned int op,
1059+ unsigned long start_time)
10651060 {
10661061 const int sgrp = op_stat_group(op);
1067− unsigned long now = READ_ONCE(jiffies);
10681062
10691063 part_stat_lock();
1070− update_io_ticks(part, now, false);
1064+ update_io_ticks(part, start_time, false);
10711065 part_stat_inc(part, ios[sgrp]);
10721066 part_stat_add(part, sectors[sgrp], sectors);
10731067 part_stat_local_inc(part, in_flight[op_is_write(op)]);
10741068 part_stat_unlock();
10751069
1076− return now;
1070+ return start_time;
1071+}
1072+
1073+/**
1074+ * bio_start_io_acct_time - start I/O accounting for bio based drivers
1075+ * @bio: bio to start account for
1076+ * @start_time: start time that should be passed back to bio_end_io_acct().
1077+ */
1078+void bio_start_io_acct_time(struct bio *bio, unsigned long start_time)
1079+{
1080+ __part_start_io_acct(bio->bi_bdev, bio_sectors(bio),
1081+ bio_op(bio), start_time);
10771082 }
1083+EXPORT_SYMBOL_GPL(bio_start_io_acct_time);
10781084
10791085 /**
10801086 * bio_start_io_acct - start I/O accounting for bio based drivers
@@ -1084,14 +1090,15 @@ static unsigned long __part_start_io_acct(struct block_device *part, · 3 unmodified lines
10841090 */
10851091 unsigned long bio_start_io_acct(struct bio *bio)
10861092 {
1087− return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), bio_op(bio));
1093+ return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio),
1094+ bio_op(bio), jiffies);
10881095 }
10891096 EXPORT_SYMBOL_GPL(bio_start_io_acct);
10901097
10911098 unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
10921099 unsigned int op)
10931100 {
1094− return __part_start_io_acct(disk->part0, sectors, op);
1101+ return __part_start_io_acct(disk->part0, sectors, op, jiffies);
10951102 }
10961103 EXPORT_SYMBOL(disk_start_io_acct);
10971104
block/blk-ia-ranges.c+1−1
@@ -144,7 +144,7 @@ int disk_register_independent_access_ranges(struct gendisk *disk, · 143 unmodified lines
144144 &q->kobj, "%s", "independent_access_ranges");
145145 if (ret) {
146146 q->ia_ranges = NULL;
147− kfree(iars);
147+ kobject_put(&iars->kobj);
148148 return ret;
149149 }
150150
block/blk-map.c+1−1
@@ -446,7 +446,7 @@ static struct bio *bio_copy_kern(struct request_queue *q, void *data, · 445 unmodified lines
446446 if (bytes > len)
447447 bytes = len;
448448
449− page = alloc_page(GFP_NOIO | gfp_mask);
449+ page = alloc_page(GFP_NOIO | __GFP_ZERO | gfp_mask);
450450 if (!page)
451451 goto cleanup;
452452
block/blk-mq.c+6−0
@@ -736,6 +736,10 @@ static void blk_complete_request(struct request *req) · 735 unmodified lines
736736
737737 /* Completion has already been traced */
738738 bio_clear_flag(bio, BIO_TRACE_COMPLETION);
739+
740+ if (req_op(req) == REQ_OP_ZONE_APPEND)
741+ bio->bi_iter.bi_sector = req->__sector;
742+
739743 if (!is_flush)
740744 bio_endio(bio);
741745 bio = next;
@@ -2922,6 +2926,8 @@ blk_status_t blk_insert_cloned_request(struct request_queue *q, struct request * · 2180 unmodified lines
29222926 */
29232927 blk_mq_run_dispatch_ops(rq->q,
29242928 ret = blk_mq_request_issue_directly(rq, true));
2929+ if (ret)
2930+ blk_account_io_done(rq, ktime_get_ns());
29252931 return ret;
29262932 }
29272933 EXPORT_SYMBOL_GPL(blk_insert_cloned_request);
block/elevator.c+0−2
@@ -525,8 +525,6 @@ void elv_unregister_queue(struct request_queue *q) · 524 unmodified lines
525525 kobject_del(&e->kobj);
526526
527527 e->registered = 0;
528− /* Re-enable throttling in case elevator disabled it */
529− wbt_enable_default(q);
530528 }
531529 }
532530
block/fops.c+19−14
@@ -566,34 +566,37 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to) · 565 unmodified lines
566566 {
567567 struct block_device *bdev = iocb->ki_filp->private_data;
568568 loff_t size = bdev_nr_bytes(bdev);
569− size_t count = iov_iter_count(to);
570569 loff_t pos = iocb->ki_pos;
571570 size_t shorted = 0;
572571 ssize_t ret = 0;
572+ size_t count;
573573
574− if (unlikely(pos + count > size)) {
574+ if (unlikely(pos + iov_iter_count(to) > size)) {
575575 if (pos >= size)
576576 return 0;
577577 size -= pos;
578− if (count > size) {
579− shorted = count - size;
580− iov_iter_truncate(to, size);
581− }
578+ shorted = iov_iter_count(to) - size;
579+ iov_iter_truncate(to, size);
582580 }
583581
582+ count = iov_iter_count(to);
583+ if (!count)
584+ goto reexpand; /* skip atime */
585+
584586 if (iocb->ki_flags & IOCB_DIRECT) {
585587 struct address_space *mapping = iocb->ki_filp->f_mapping;
586588
587589 if (iocb->ki_flags & IOCB_NOWAIT) {
588− if (filemap_range_needs_writeback(mapping, iocb->ki_pos,
589− iocb->ki_pos + count - 1))
590− return -EAGAIN;
590+ if (filemap_range_needs_writeback(mapping, pos,
591+ pos + count - 1)) {
592+ ret = -EAGAIN;
593+ goto reexpand;
594+ }
591595 } else {
592− ret = filemap_write_and_wait_range(mapping,
593− iocb->ki_pos,
594− iocb->ki_pos + count - 1);
596+ ret = filemap_write_and_wait_range(mapping, pos,
597+ pos + count - 1);
595598 if (ret < 0)
596− return ret;
599+ goto reexpand;
597600 }
598601
599602 file_accessed(iocb->ki_filp);
@@ -603,12 +606,14 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to) · 3 unmodified lines
603606 iocb->ki_pos += ret;
604607 count -= ret;
605608 }
609+ iov_iter_revert(to, count - iov_iter_count(to));
606610 if (ret < 0 || !count)
607− return ret;
611+ goto reexpand;
608612 }
609613
610614 ret = filemap_read(iocb, to, ret);
611615
616+reexpand:
612617 if (unlikely(shorted))
613618 iov_iter_reexpand(to, iov_iter_count(to) + shorted);
614619 return ret;
block/genhd.c+14−0
@@ -548,6 +548,20 @@ out_free_ext_minor: · 547 unmodified lines
548548 }
549549 EXPORT_SYMBOL(device_add_disk);
550550
551+/**
552+ * blk_mark_disk_dead - mark a disk as dead
553+ * @disk: disk to mark as dead
554+ *
555+ * Mark as disk as dead (e.g. surprise removed) and don't accept any new I/O
556+ * to this disk.
557+ */
558+void blk_mark_disk_dead(struct gendisk *disk)
559+{
560+ set_bit(GD_DEAD, &disk->state);
561+ blk_queue_start_drain(disk->queue);
562+}
563+EXPORT_SYMBOL_GPL(blk_mark_disk_dead);
564+
551565 /**
552566 * del_gendisk - remove the gendisk
553567 * @disk: the struct gendisk to remove
crypto/af_alg.c+0−3
@@ -25,12 +25,9 @@ struct alg_type_list { · 24 unmodified lines
2525 struct list_head list;
2626 };
2727
28−static atomic_long_t alg_memory_allocated;
29−
3028 static struct proto alg_proto = {
3129 .name = "ALG",
3230 .owner = THIS_MODULE,
33− .memory_allocated = &alg_memory_allocated,
3431 .obj_size = sizeof(struct alg_sock),
3532 };
3633
crypto/algapi.c+1−0
@@ -1324,3 +1324,4 @@ module_exit(crypto_algapi_exit); · 1323 unmodified lines
13241324
13251325 MODULE_LICENSE("GPL");
13261326 MODULE_DESCRIPTION("Cryptographic algorithms API");
1327+MODULE_SOFTDEP("pre: cryptomgr");
crypto/api.c+0−1
@@ -643,4 +643,3 @@ EXPORT_SYMBOL_GPL(crypto_req_done); · 642 unmodified lines
643643
644644 MODULE_DESCRIPTION("Cryptographic core API");
645645 MODULE_LICENSE("GPL");
646−MODULE_SOFTDEP("pre: cryptomgr");
crypto/blake2s_generic.c+2−2
@@ -15,12 +15,12 @@ · 14 unmodified lines
1515 static int crypto_blake2s_update_generic(struct shash_desc *desc,
1616 const u8 *in, unsigned int inlen)
1717 {
18− return crypto_blake2s_update(desc, in, inlen, blake2s_compress_generic);
18+ return crypto_blake2s_update(desc, in, inlen, true);
1919 }
2020
2121 static int crypto_blake2s_final_generic(struct shash_desc *desc, u8 *out)
2222 {
23− return crypto_blake2s_final(desc, out, blake2s_compress_generic);
23+ return crypto_blake2s_final(desc, out, true);
2424 }
2525
2626 #define BLAKE2S_ALG(name, driver_name, digest_size) \
drivers/accessibility/speakup/speakup_dectlk.c+1−0
@@ -44,6 +44,7 @@ static struct var_t vars[] = { · 43 unmodified lines
4444 { CAPS_START, .u.s = {"[:dv ap 160] " } },
4545 { CAPS_STOP, .u.s = {"[:dv ap 100 ] " } },
4646 { RATE, .u.n = {"[:ra %d] ", 180, 75, 650, 0, 0, NULL } },
47+ { PITCH, .u.n = {"[:dv ap %d] ", 122, 50, 350, 0, 0, NULL } },
4748 { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } },
4849 { VOL, .u.n = {"[:dv g5 %d] ", 86, 60, 86, 0, 0, NULL } },
4950 { PUNCT, .u.n = {"[:pu %c] ", 0, 0, 2, 0, 0, "nsa" } },
drivers/acpi/Kconfig+1−0
@@ -11,6 +11,7 @@ menuconfig ACPI · 10 unmodified lines
1111 depends on ARCH_SUPPORTS_ACPI
1212 select PNP
1313 select NLS
14+ select CRC32
1415 default y if X86
1516 help
1617 Advanced Configuration and Power Interface (ACPI) support for
drivers/acpi/arm64/iort.c+11−3
@@ -1361,9 +1361,17 @@ static void __init arm_smmu_v3_pmcg_init_resources(struct resource *res, · 1360 unmodified lines
13611361 res[0].start = pmcg->page0_base_address;
13621362 res[0].end = pmcg->page0_base_address + SZ_4K - 1;
13631363 res[0].flags = IORESOURCE_MEM;
1364− res[1].start = pmcg->page1_base_address;
1365− res[1].end = pmcg->page1_base_address + SZ_4K - 1;
1366− res[1].flags = IORESOURCE_MEM;
1364+ /*
1365+ * The initial version in DEN0049C lacked a way to describe register
1366+ * page 1, which makes it broken for most PMCG implementations; in
1367+ * that case, just let the driver fail gracefully if it expects to
1368+ * find a second memory resource.
1369+ */
1370+ if (node->revision > 0) {
1371+ res[1].start = pmcg->page1_base_address;
1372+ res[1].end = pmcg->page1_base_address + SZ_4K - 1;
1373+ res[1].flags = IORESOURCE_MEM;
1374+ }
13671375
13681376 if (pmcg->overflow_gsiv)
13691377 acpi_iort_register_irq(pmcg->overflow_gsiv, "overflow",
drivers/acpi/ec.c+10−0
@@ -2065,6 +2065,16 @@ bool acpi_ec_dispatch_gpe(void) · 2064 unmodified lines
20652065 if (acpi_any_gpe_status_set(first_ec->gpe))
20662066 return true;
20672067
2068+ /*
2069+ * Cancel the SCI wakeup and process all pending events in case there
2070+ * are any wakeup ones in there.
2071+ *
2072+ * Note that if any non-EC GPEs are active at this point, the SCI will
2073+ * retrigger after the rearming in acpi_s2idle_wake(), so no events
2074+ * should be missed by canceling the wakeup here.
2075+ */
2076+ pm_system_cancel_wakeup();
2077+
20682078 /*
20692079 * Dispatch the EC GPE in-band, but do not report wakeup in any case
20702080 * to allow the caller to process events properly after that.
drivers/acpi/processor_idle.c+5−0
@@ -96,6 +96,11 @@ static const struct dmi_system_id processor_power_dmi_table[] = { · 95 unmodified lines
9696 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
9797 DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")},
9898 (void *)1},
99+ /* T40 can not handle C3 idle state */
100+ { set_max_cstate, "IBM ThinkPad T40", {
101+ DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
102+ DMI_MATCH(DMI_PRODUCT_NAME, "23737CU")},
103+ (void *)2},
99104 {},
100105 };
101106
drivers/acpi/sleep.c+5−10
@@ -736,21 +736,15 @@ bool acpi_s2idle_wake(void) · 735 unmodified lines
736736 return true;
737737 }
738738
739− /* Check non-EC GPE wakeups and dispatch the EC GPE. */
739+ /*
740+ * Check non-EC GPE wakeups and if there are none, cancel the
741+ * SCI-related wakeup and dispatch the EC GPE.
742+ */
740743 if (acpi_ec_dispatch_gpe()) {
741744 pm_pr_dbg("ACPI non-EC GPE wakeup\n");
742745 return true;
743746 }
744747
745− /*
746− * Cancel the SCI wakeup and process all pending events in case
747− * there are any wakeup ones in there.
748− *
749− * Note that if any non-EC GPEs are active at this point, the
750− * SCI will retrigger after the rearming below, so no events
751− * should be missed by canceling the wakeup here.
752− */
753− pm_system_cancel_wakeup();
754748 acpi_os_wait_events_complete();
755749
756750 /*
@@ -764,6 +758,7 @@ bool acpi_s2idle_wake(void) · 7 unmodified lines
764758 return true;
765759 }
766760
761+ pm_wakeup_clear(acpi_sci_irq);
767762 rearm_wake_irq(acpi_sci_irq);
768763 }
769764
drivers/acpi/tables.c+1−1
@@ -400,7 +400,7 @@ int __init_or_acpilib acpi_table_parse_entries_array( · 399 unmodified lines
400400
401401 acpi_get_table(id, instance, &table_header);
402402 if (!table_header) {
403− pr_warn("%4.4s not present\n", id);
403+ pr_debug("%4.4s not present\n", id);
404404 return -ENODEV;
405405 }
406406
drivers/acpi/x86/s2idle.c+4−8
@@ -424,15 +424,11 @@ static int lps0_device_attach(struct acpi_device *adev, · 423 unmodified lines
424424 mem_sleep_current = PM_SUSPEND_TO_IDLE;
425425
426426 /*
427− * Some Intel based LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U don't
428− * use intel-hid or intel-vbtn but require the EC GPE to be enabled while
429− * suspended for certain wakeup devices to work, so mark it as wakeup-capable.
430− *
431− * Only enable on !AMD as enabling this universally causes problems for a number
432− * of AMD based systems.
427+ * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the
428+ * EC GPE to be enabled while suspended for certain wakeup devices to
429+ * work, so mark it as wakeup-capable.
433430 */
434− if (!acpi_s2idle_vendor_amd())
435− acpi_ec_mark_gpe_for_wake();
431+ acpi_ec_mark_gpe_for_wake();
436432
437433 return 0;
438434 }
drivers/ata/libata-core.c+17−8
@@ -2007,6 +2007,9 @@ static bool ata_log_supported(struct ata_device *dev, u8 log) · 2006 unmodified lines
20072007 {
20082008 struct ata_port *ap = dev->link->ap;
20092009
2010+ if (dev->horkage & ATA_HORKAGE_NO_LOG_DIR)
2011+ return false;
2012+
20102013 if (ata_read_log_page(dev, ATA_LOG_DIRECTORY, 0, ap->sector_buf, 1))
20112014 return false;
20122015 return get_unaligned_le16(&ap->sector_buf[log * 2]) ? true : false;
@@ -2445,23 +2448,21 @@ static void ata_dev_config_cpr(struct ata_device *dev) · 432 unmodified lines
24452448 struct ata_cpr_log *cpr_log = NULL;
24462449 u8 *desc, *buf = NULL;
24472450
2448− if (!ata_identify_page_supported(dev,
2449− ATA_LOG_CONCURRENT_POSITIONING_RANGES))
2451+ if (ata_id_major_version(dev->id) < 11 ||
2452+ !ata_log_supported(dev, ATA_LOG_CONCURRENT_POSITIONING_RANGES))
24502453 goto out;
24512454
24522455 /*
2453− * Read IDENTIFY DEVICE data log, page 0x47
2454− * (concurrent positioning ranges). We can have at most 255 32B range
2455− * descriptors plus a 64B header.
2456+ * Read the concurrent positioning ranges log (0x47). We can have at
2457+ * most 255 32B range descriptors plus a 64B header.
24562458 */
24572459 buf_len = (64 + 255 * 32 + 511) & ~511;
24582460 buf = kzalloc(buf_len, GFP_KERNEL);
24592461 if (!buf)
24602462 goto out;
24612463
2462− err_mask = ata_read_log_page(dev, ATA_LOG_IDENTIFY_DEVICE,
2463− ATA_LOG_CONCURRENT_POSITIONING_RANGES,
2464− buf, buf_len >> 9);
2464+ err_mask = ata_read_log_page(dev, ATA_LOG_CONCURRENT_POSITIONING_RANGES,
2465+ 0, buf, buf_len >> 9);
24652466 if (err_mask)
24662467 goto out;
24672468
@@ -4028,6 +4029,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 1560 unmodified lines
40284029
40294030 /* devices that don't properly handle TRIM commands */
40304031 { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, },
4032+ { "M88V29*", NULL, ATA_HORKAGE_NOTRIM, },
40314033
40324034 /*
40334035 * As defined, the DRAT (Deterministic Read After Trim) and RZAT
@@ -4073,6 +4075,13 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 39 unmodified lines
40734075 { "WDC WD3000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
40744076 { "WDC WD3200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
40754077
4078+ /*
4079+ * This sata dom device goes on a walkabout when the ATA_LOG_DIRECTORY
4080+ * log page is accessed. Ensure we never ask for this log page with
4081+ * these devices.
4082+ */
4083+ { "SATADOM-ML 3ME", NULL, ATA_HORKAGE_NO_LOG_DIR },
4084+
40764085 /* End Marker */
40774086 { }
40784087 };
drivers/ata/pata_platform.c+2−0
@@ -128,6 +128,8 @@ int __pata_platform_probe(struct device *dev, struct resource *io_res, · 127 unmodified lines
128128 ap = host->ports[0];
129129
130130 ap->ops = devm_kzalloc(dev, sizeof(*ap->ops), GFP_KERNEL);
131+ if (!ap->ops)
132+ return -ENOMEM;
131133 ap->ops->inherits = &ata_sff_port_ops;
132134 ap->ops->cable_detect = ata_cable_unknown;
133135 ap->ops->set_mode = pata_platform_set_mode;
drivers/ata/sata_fsl.c+7−9
@@ -322,7 +322,7 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host, · 321 unmodified lines
322322 static ssize_t fsl_sata_intr_coalescing_show(struct device *dev,
323323 struct device_attribute *attr, char *buf)
324324 {
325− return sysfs_emit(buf, "%d %d\n",
325+ return sysfs_emit(buf, "%u %u\n",
326326 intr_coalescing_count, intr_coalescing_ticks);
327327 }
328328
@@ -332,10 +332,8 @@ static ssize_t fsl_sata_intr_coalescing_store(struct device *dev, · 3 unmodified lines
332332 {
333333 unsigned int coalescing_count, coalescing_ticks;
334334
335− if (sscanf(buf, "%d%d",
336− &coalescing_count,
337− &coalescing_ticks) != 2) {
338− printk(KERN_ERR "fsl-sata: wrong parameter format.\n");
335+ if (sscanf(buf, "%u%u", &coalescing_count, &coalescing_ticks) != 2) {
336+ dev_err(dev, "fsl-sata: wrong parameter format.\n");
339337 return -EINVAL;
340338 }
341339
@@ -359,7 +357,7 @@ static ssize_t fsl_sata_rx_watermark_show(struct device *dev, · 17 unmodified lines
359357 rx_watermark &= 0x1f;
360358 spin_unlock_irqrestore(&host->lock, flags);
361359
362− return sysfs_emit(buf, "%d\n", rx_watermark);
360+ return sysfs_emit(buf, "%u\n", rx_watermark);
363361 }
364362
365363 static ssize_t fsl_sata_rx_watermark_store(struct device *dev,
@@ -373,8 +371,8 @@ static ssize_t fsl_sata_rx_watermark_store(struct device *dev, · 7 unmodified lines
373371 void __iomem *csr_base = host_priv->csr_base;
374372 u32 temp;
375373
376− if (sscanf(buf, "%d", &rx_watermark) != 1) {
377− printk(KERN_ERR "fsl-sata: wrong parameter format.\n");
374+ if (kstrtouint(buf, 10, &rx_watermark) < 0) {
375+ dev_err(dev, "fsl-sata: wrong parameter format.\n");
378376 return -EINVAL;
379377 }
380378
@@ -382,8 +380,8 @@ static ssize_t fsl_sata_rx_watermark_store(struct device *dev, · 1 unmodified line
382380 temp = ioread32(csr_base + TRANSCFG);
383381 temp &= 0xffffffe0;
384382 iowrite32(temp | rx_watermark, csr_base + TRANSCFG);
385−
386383 spin_unlock_irqrestore(&host->lock, flags);
384+
387385 return strlen(buf);
388386 }
389387
drivers/base/power/wakeup.c+34−7
@@ -34,7 +34,8 @@ suspend_state_t pm_suspend_target_state; · 33 unmodified lines
3434 bool events_check_enabled __read_mostly;
3535
3636 /* First wakeup IRQ seen by the kernel in the last cycle. */
37−unsigned int pm_wakeup_irq __read_mostly;
37+static unsigned int wakeup_irq[2] __read_mostly;
38+static DEFINE_RAW_SPINLOCK(wakeup_irq_lock);
3839
3940 /* If greater than 0 and the system is suspending, terminate the suspend. */
4041 static atomic_t pm_abort_suspend __read_mostly;
@@ -942,19 +943,45 @@ void pm_system_cancel_wakeup(void) · 901 unmodified lines
942943 atomic_dec_if_positive(&pm_abort_suspend);
943944 }
944945
945−void pm_wakeup_clear(bool reset)
946+void pm_wakeup_clear(unsigned int irq_number)
946947 {
947− pm_wakeup_irq = 0;
948− if (reset)
948+ raw_spin_lock_irq(&wakeup_irq_lock);
949+
950+ if (irq_number && wakeup_irq[0] == irq_number)
951+ wakeup_irq[0] = wakeup_irq[1];
952+ else
953+ wakeup_irq[0] = 0;
954+
955+ wakeup_irq[1] = 0;
956+
957+ raw_spin_unlock_irq(&wakeup_irq_lock);
958+
959+ if (!irq_number)
949960 atomic_set(&pm_abort_suspend, 0);
950961 }
951962
952963 void pm_system_irq_wakeup(unsigned int irq_number)
953964 {
954− if (pm_wakeup_irq == 0) {
955− pm_wakeup_irq = irq_number;
965+ unsigned long flags;
966+
967+ raw_spin_lock_irqsave(&wakeup_irq_lock, flags);
968+
969+ if (wakeup_irq[0] == 0)
970+ wakeup_irq[0] = irq_number;
971+ else if (wakeup_irq[1] == 0)
972+ wakeup_irq[1] = irq_number;
973+ else
974+ irq_number = 0;
975+
976+ raw_spin_unlock_irqrestore(&wakeup_irq_lock, flags);
977+
978+ if (irq_number)
956979 pm_system_wakeup();
957− }
980+}
981+
982+unsigned int pm_wakeup_irq(void)
983+{
984+ return wakeup_irq[0];
958985 }
959986
960987 /**
drivers/block/loop.c+36−37
@@ -79,6 +79,7 @@ · 78 unmodified lines
7979 #include <linux/ioprio.h>
8080 #include <linux/blk-cgroup.h>
8181 #include <linux/sched/mm.h>
82+#include <linux/statfs.h>
8283
8384 #include "loop.h"
8485
@@ -774,8 +775,13 @@ static void loop_config_discard(struct loop_device *lo) · 689 unmodified lines
774775 granularity = 0;
775776
776777 } else {
778+ struct kstatfs sbuf;
779+
777780 max_discard_sectors = UINT_MAX >> 9;
778− granularity = inode->i_sb->s_blocksize;
781+ if (!vfs_statfs(&file->f_path, &sbuf))
782+ granularity = sbuf.f_bsize;
783+ else
784+ max_discard_sectors = 0;
779785 }
780786
781787 if (max_discard_sectors) {
@@ -1082,7 +1088,7 @@ out_putf: · 300 unmodified lines
10821088 return error;
10831089 }
10841090
1085−static void __loop_clr_fd(struct loop_device *lo)
1091+static void __loop_clr_fd(struct loop_device *lo, bool release)
10861092 {
10871093 struct file *filp;
10881094 gfp_t gfp = lo->old_gfp_mask;
@@ -1144,6 +1150,8 @@ static void __loop_clr_fd(struct loop_device *lo) · 55 unmodified lines
11441150 /* let user-space know about this change */
11451151 kobject_uevent(&disk_to_dev(lo->lo_disk)->kobj, KOBJ_CHANGE);
11461152 mapping_set_gfp_mask(filp->f_mapping, gfp);
1153+ /* This is safe: open() is still holding a reference. */
1154+ module_put(THIS_MODULE);
11471155 blk_mq_unfreeze_queue(lo->lo_queue);
11481156
11491157 disk_force_media_change(lo->lo_disk, DISK_EVENT_MEDIA_CHANGE);
@@ -1151,52 +1159,44 @@ static void __loop_clr_fd(struct loop_device *lo) · 1 unmodified line
11511159 if (lo->lo_flags & LO_FLAGS_PARTSCAN) {
11521160 int err;
11531161
1154− mutex_lock(&lo->lo_disk->open_mutex);
1162+ /*
1163+ * open_mutex has been held already in release path, so don't
1164+ * acquire it if this function is called in such case.
1165+ *
1166+ * If the reread partition isn't from release path, lo_refcnt
1167+ * must be at least one and it can only become zero when the
1168+ * current holder is released.
1169+ */
1170+ if (!release)
1171+ mutex_lock(&lo->lo_disk->open_mutex);
11551172 err = bdev_disk_changed(lo->lo_disk, false);
1156− mutex_unlock(&lo->lo_disk->open_mutex);
1173+ if (!release)
1174+ mutex_unlock(&lo->lo_disk->open_mutex);
11571175 if (err)
11581176 pr_warn("%s: partition scan of loop%d failed (rc=%d)\n",
11591177 __func__, lo->lo_number, err);
11601178 /* Device is gone, no point in returning error */
11611179 }
11621180
1181+ /*
1182+ * lo->lo_state is set to Lo_unbound here after above partscan has
1183+ * finished. There cannot be anybody else entering __loop_clr_fd() as
1184+ * Lo_rundown state protects us from all the other places trying to
1185+ * change the 'lo' device.
1186+ */
11631187 lo->lo_flags = 0;
11641188 if (!part_shift)
11651189 lo->lo_disk->flags |= GENHD_FL_NO_PART;
1166−
1167− fput(filp);
1168−}
1169−
1170−static void loop_rundown_completed(struct loop_device *lo)
1171−{
11721190 mutex_lock(&lo->lo_mutex);
11731191 lo->lo_state = Lo_unbound;
11741192 mutex_unlock(&lo->lo_mutex);
1175− module_put(THIS_MODULE);
1176−}
1177−
1178−static void loop_rundown_workfn(struct work_struct *work)
1179−{
1180− struct loop_device *lo = container_of(work, struct loop_device,
1181− rundown_work);
1182− struct block_device *bdev = lo->lo_device;
1183− struct gendisk *disk = lo->lo_disk;
1184−
1185− __loop_clr_fd(lo);
1186− kobject_put(&bdev->bd_device.kobj);
1187− module_put(disk->fops->owner);
1188− loop_rundown_completed(lo);
1189−}
1190−
1191−static void loop_schedule_rundown(struct loop_device *lo)
1192−{
1193− struct block_device *bdev = lo->lo_device;
1194− struct gendisk *disk = lo->lo_disk;
11951193
1196− __module_get(disk->fops->owner);
1197− kobject_get(&bdev->bd_device.kobj);
1198− INIT_WORK(&lo->rundown_work, loop_rundown_workfn);
1199− queue_work(system_long_wq, &lo->rundown_work);
1194+ /*
1195+ * Need not hold lo_mutex to fput backing file. Calling fput holding
1196+ * lo_mutex triggers a circular lock dependency possibility warning as
1197+ * fput can take open_mutex which is usually taken before lo_mutex.
1198+ */
1199+ fput(filp);
12001200 }
12011201
12021202 static int loop_clr_fd(struct loop_device *lo)
@@ -1228,8 +1228,7 @@ static int loop_clr_fd(struct loop_device *lo) · 25 unmodified lines
12281228 lo->lo_state = Lo_rundown;
12291229 mutex_unlock(&lo->lo_mutex);
12301230
1231− __loop_clr_fd(lo);
1232− loop_rundown_completed(lo);
1231+ __loop_clr_fd(lo, false);
12331232 return 0;
12341233 }
12351234
@@ -1754,7 +1753,7 @@ static void lo_release(struct gendisk *disk, fmode_t mode) · 518 unmodified lines
17541753 * In autoclear mode, stop the loop thread
17551754 * and remove configuration after last close.
17561755 */
1757− loop_schedule_rundown(lo);
1756+ __loop_clr_fd(lo, true);
17581757 return;
17591758 } else if (lo->lo_state == Lo_bound) {
17601759 /*
drivers/block/loop.h+0−1
@@ -56,7 +56,6 @@ struct loop_device { · 55 unmodified lines
5656 struct gendisk *lo_disk;
5757 struct mutex lo_mutex;
5858 bool idr_visible;
59− struct work_struct rundown_work;
6059 };
6160
6261 struct loop_cmd {
drivers/block/mtip32xx/mtip32xx.c+1−1
@@ -4112,7 +4112,7 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 4111 unmodified lines
41124112 "Completion workers still active!\n");
41134113 }
41144114
4115− blk_set_queue_dying(dd->queue);
4115+ blk_mark_disk_dead(dd->disk);
41164116 set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
41174117
41184118 /* Clean up the block layer. */
drivers/block/rbd.c+1−1
@@ -7185,7 +7185,7 @@ static ssize_t do_rbd_remove(struct bus_type *bus, · 7184 unmodified lines
71857185 * IO to complete/fail.
71867186 */
71877187 blk_mq_freeze_queue(rbd_dev->disk->queue);
7188− blk_set_queue_dying(rbd_dev->disk->queue);
7188+ blk_mark_disk_dead(rbd_dev->disk);
71897189 }
71907190
71917191 del_gendisk(rbd_dev->disk);
drivers/block/xen-blkfront.c+1−1
@@ -2126,7 +2126,7 @@ static void blkfront_closing(struct blkfront_info *info) · 2125 unmodified lines
21262126
21272127 /* No more blkif_request(). */
21282128 blk_mq_stop_hw_queues(info->rq);
2129− blk_set_queue_dying(info->rq);
2129+ blk_mark_disk_dead(info->gd);
21302130 set_capacity(info->gd, 0);
21312131
21322132 for_each_rinfo(info, rinfo, i) {
drivers/bus/mhi/pci_generic.c+2−0
@@ -366,6 +366,7 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = { · 365 unmodified lines
366366 .config = &modem_foxconn_sdx55_config,
367367 .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
368368 .dma_data_width = 32,
369+ .mru_default = 32768,
369370 .sideband_wake = false,
370371 };
371372
@@ -401,6 +402,7 @@ static const struct mhi_pci_dev_info mhi_mv31_info = { · 29 unmodified lines
401402 .config = &modem_mv31_config,
402403 .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
403404 .dma_data_width = 32,
405+ .mru_default = 32768,
404406 };
405407
406408 static const struct mhi_channel_config mhi_sierra_em919x_channels[] = {
drivers/char/random.c+22−17
@@ -762,7 +762,7 @@ static bool crng_init_try_arch(struct crng_state *crng) · 761 unmodified lines
762762 return arch_init;
763763 }
764764
765−static bool __init crng_init_try_arch_early(struct crng_state *crng)
765+static bool __init crng_init_try_arch_early(void)
766766 {
767767 int i;
768768 bool arch_init = true;
@@ -774,7 +774,7 @@ static bool __init crng_init_try_arch_early(struct crng_state *crng) · 5 unmodified lines
774774 rv = random_get_entropy();
775775 arch_init = false;
776776 }
777− crng->state[i] ^= rv;
777+ primary_crng.state[i] ^= rv;
778778 }
779779
780780 return arch_init;
@@ -788,22 +788,20 @@ static void crng_initialize_secondary(struct crng_state *crng) · 7 unmodified lines
788788 crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
789789 }
790790
791−static void __init crng_initialize_primary(struct crng_state *crng)
791+static void __init crng_initialize_primary(void)
792792 {
793− _extract_entropy(&crng->state[4], sizeof(u32) * 12);
794− if (crng_init_try_arch_early(crng) && trust_cpu && crng_init < 2) {
793+ _extract_entropy(&primary_crng.state[4], sizeof(u32) * 12);
794+ if (crng_init_try_arch_early() && trust_cpu && crng_init < 2) {
795795 invalidate_batched_entropy();
796796 numa_crng_init();
797797 crng_init = 2;
798798 pr_notice("crng init done (trusting CPU's manufacturer)\n");
799799 }
800− crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
800+ primary_crng.init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
801801 }
802802
803−static void crng_finalize_init(struct crng_state *crng)
803+static void crng_finalize_init(void)
804804 {
805− if (crng != &primary_crng || crng_init >= 2)
806− return;
807805 if (!system_wq) {
808806 /* We can't call numa_crng_init until we have workqueues,
809807 * so mark this for processing later. */
@@ -814,6 +812,7 @@ static void crng_finalize_init(struct crng_state *crng) · 4 unmodified lines
814812 invalidate_batched_entropy();
815813 numa_crng_init();
816814 crng_init = 2;
815+ crng_need_final_init = false;
817816 process_random_ready_list();
818817 wake_up_interruptible(&crng_init_wait);
819818 kill_fasync(&fasync, SIGIO, POLL_IN);
@@ -980,7 +979,8 @@ static void crng_reseed(struct crng_state *crng, bool use_input_pool) · 160 unmodified lines
980979 memzero_explicit(&buf, sizeof(buf));
981980 WRITE_ONCE(crng->init_time, jiffies);
982981 spin_unlock_irqrestore(&crng->lock, flags);
983− crng_finalize_init(crng);
982+ if (crng == &primary_crng && crng_init < 2)
983+ crng_finalize_init();
984984 }
985985
986986 static void _extract_crng(struct crng_state *crng, u8 out[CHACHA_BLOCK_SIZE])
@@ -1697,8 +1697,8 @@ int __init rand_initialize(void) · 710 unmodified lines
16971697 {
16981698 init_std_data();
16991699 if (crng_need_final_init)
1700− crng_finalize_init(&primary_crng);
1701− crng_initialize_primary(&primary_crng);
1700+ crng_finalize_init();
1701+ crng_initialize_primary();
17021702 crng_global_init_time = jiffies;
17031703 if (ratelimit_disable) {
17041704 urandom_warning.interval = 0;
@@ -1856,7 +1856,10 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg) · 151 unmodified lines
18561856 */
18571857 if (!capable(CAP_SYS_ADMIN))
18581858 return -EPERM;
1859− input_pool.entropy_count = 0;
1859+ if (xchg(&input_pool.entropy_count, 0) && random_write_wakeup_bits) {
1860+ wake_up_interruptible(&random_write_wait);
1861+ kill_fasync(&fasync, SIGIO, POLL_OUT);
1862+ }
18601863 return 0;
18611864 case RNDRESEEDCRNG:
18621865 if (!capable(CAP_SYS_ADMIN))
@@ -2205,13 +2208,15 @@ void add_hwgenerator_randomness(const char *buffer, size_t count, · 342 unmodified lines
22052208 return;
22062209 }
22072210
2208− /* Suspend writing if we're above the trickle threshold.
2211+ /* Throttle writing if we're above the trickle threshold.
22092212 * We'll be woken up again once below random_write_wakeup_thresh,
2210− * or when the calling thread is about to terminate.
2213+ * when the calling thread is about to terminate, or once
2214+ * CRNG_RESEED_INTERVAL has lapsed.
22112215 */
2212− wait_event_interruptible(random_write_wait,
2216+ wait_event_interruptible_timeout(random_write_wait,
22132217 !system_wq || kthread_should_stop() ||
2214− POOL_ENTROPY_BITS() <= random_write_wakeup_bits);
2218+ POOL_ENTROPY_BITS() <= random_write_wakeup_bits,
2219+ CRNG_RESEED_INTERVAL);
22152220 mix_pool_bytes(buffer, count);
22162221 credit_entropy_bits(entropy);
22172222 }
drivers/clocksource/timer-ti-dm-systimer.c+1−1
@@ -241,7 +241,7 @@ static void __init dmtimer_systimer_assign_alwon(void) · 240 unmodified lines
241241 bool quirk_unreliable_oscillator = false;
242242
243243 /* Quirk unreliable 32 KiHz oscillator with incomplete dts */
244− if (of_machine_is_compatible("ti,omap3-beagle") ||
244+ if (of_machine_is_compatible("ti,omap3-beagle-ab4") ||
245245 of_machine_is_compatible("timll,omap3-devkit8000")) {
246246 quirk_unreliable_oscillator = true;
247247 counter_32k = -ENODEV;
drivers/connector/cn_proc.c+1−1
@@ -358,7 +358,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg, · 357 unmodified lines
358358 * other namespaces.
359359 */
360360 if ((current_user_ns() != &init_user_ns) ||
361− (task_active_pid_ns(current) != &init_pid_ns))
361+ !task_is_in_init_pid_ns(current))
362362 return;
363363
364364 /* Can only change if privileged. */
drivers/counter/counter-core.c+6−9
@@ -90,10 +90,8 @@ struct counter_device *counter_alloc(size_t sizeof_priv) · 89 unmodified lines
9090 int err;
9191
9292 ch = kzalloc(sizeof(*ch) + sizeof_priv, GFP_KERNEL);
93− if (!ch) {
94− err = -ENOMEM;
95− goto err_alloc_ch;
96− }
93+ if (!ch)
94+ return NULL;
9795
9896 counter = &ch->counter;
9997 dev = &counter->dev;
@@ -123,9 +121,8 @@ err_chrdev_add: · 23 unmodified lines
123121 err_ida_alloc:
124122
125123 kfree(ch);
126−err_alloc_ch:
127124
128− return ERR_PTR(err);
125+ return NULL;
129126 }
130127 EXPORT_SYMBOL_GPL(counter_alloc);
131128
@@ -208,12 +205,12 @@ struct counter_device *devm_counter_alloc(struct device *dev, size_t sizeof_priv · 76 unmodified lines
208205 int err;
209206
210207 counter = counter_alloc(sizeof_priv);
211− if (IS_ERR(counter))
212− return counter;
208+ if (!counter)
209+ return NULL;
213210
214211 err = devm_add_action_or_reset(dev, devm_counter_put, counter);
215212 if (err < 0)
216− return ERR_PTR(err);
213+ return NULL;
217214
218215 return counter;
219216 }
drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c+2−1
@@ -1753,7 +1753,6 @@ void otx2_cpt_print_uc_dbg_info(struct otx2_cptpf_dev *cptpf) · 1752 unmodified lines
17531753 char engs_info[2 * OTX2_CPT_NAME_LENGTH];
17541754 struct otx2_cpt_eng_grp_info *grp;
17551755 struct otx2_cpt_engs_rsvd *engs;
1756− u32 mask[4];
17571756 int i, j;
17581757
17591758 pr_debug("Engine groups global info");
@@ -1785,6 +1784,8 @@ void otx2_cpt_print_uc_dbg_info(struct otx2_cptpf_dev *cptpf) · 25 unmodified lines
17851784 for (j = 0; j < OTX2_CPT_MAX_ETYPES_PER_GRP; j++) {
17861785 engs = &grp->engs[j];
17871786 if (engs->type) {
1787+ u32 mask[5] = { };
1788+
17881789 get_engs_info(grp, engs_info,
17891790 2 * OTX2_CPT_NAME_LENGTH, j);
17901791 pr_debug("Slot%d: %s", j, engs_info);
drivers/dma-buf/dma-heap.c+2−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/xarray.h>
1515 #include <linux/list.h>
1616 #include <linux/slab.h>
17+#include <linux/nospec.h>
1718 #include <linux/uaccess.h>
1819 #include <linux/syscalls.h>
1920 #include <linux/dma-heap.h>
@@ -135,6 +136,7 @@ static long dma_heap_ioctl(struct file *file, unsigned int ucmd, · 115 unmodified lines
135136 if (nr >= ARRAY_SIZE(dma_heap_ioctl_cmds))
136137 return -EINVAL;
137138
139+ nr = array_index_nospec(nr, ARRAY_SIZE(dma_heap_ioctl_cmds));
138140 /* Get the kernel ioctl cmd that matches */
139141 kcmd = dma_heap_ioctl_cmds[nr];
140142
drivers/dma/at_xdmac.c+3−1
@@ -1681,8 +1681,10 @@ static void at_xdmac_tasklet(struct tasklet_struct *t) · 1680 unmodified lines
16811681 __func__, atchan->irq_status);
16821682
16831683 if (!(atchan->irq_status & AT_XDMAC_CIS_LIS) &&
1684− !(atchan->irq_status & error_mask))
1684+ !(atchan->irq_status & error_mask)) {
1685+ spin_unlock_irq(&atchan->lock);
16851686 return;
1687+ }
16861688
16871689 if (atchan->irq_status & error_mask)
16881690 at_xdmac_handle_error(atchan);
drivers/dma/ptdma/ptdma-dev.c+9−8
@@ -207,7 +207,7 @@ int pt_core_init(struct pt_device *pt) · 206 unmodified lines
207207 if (!cmd_q->qbase) {
208208 dev_err(dev, "unable to allocate command queue\n");
209209 ret = -ENOMEM;
210− goto e_dma_alloc;
210+ goto e_destroy_pool;
211211 }
212212
213213 cmd_q->qidx = 0;
@@ -229,8 +229,10 @@ int pt_core_init(struct pt_device *pt) · 15 unmodified lines
229229
230230 /* Request an irq */
231231 ret = request_irq(pt->pt_irq, pt_core_irq_handler, 0, dev_name(pt->dev), pt);
232− if (ret)
233− goto e_pool;
232+ if (ret) {
233+ dev_err(dev, "unable to allocate an IRQ\n");
234+ goto e_free_dma;
235+ }
234236
235237 /* Update the device registers with queue information. */
236238 cmd_q->qcontrol &= ~CMD_Q_SIZE;
@@ -250,21 +252,20 @@ int pt_core_init(struct pt_device *pt) · 13 unmodified lines
250252 /* Register the DMA engine support */
251253 ret = pt_dmaengine_register(pt);
252254 if (ret)
253− goto e_dmaengine;
255+ goto e_free_irq;
254256
255257 /* Set up debugfs entries */
256258 ptdma_debugfs_setup(pt);
257259
258260 return 0;
259261
260−e_dmaengine:
262+e_free_irq:
261263 free_irq(pt->pt_irq, pt);
262264
263−e_dma_alloc:
265+e_free_dma:
264266 dma_free_coherent(dev, cmd_q->qsize, cmd_q->qbase, cmd_q->qbase_dma);
265267
266−e_pool:
267− dev_err(dev, "unable to allocate an IRQ\n");
268+e_destroy_pool:
268269 dma_pool_destroy(pt->cmd_q.dma_pool);
269270
270271 return ret;
drivers/dma/sh/rcar-dmac.c+7−2
@@ -1868,8 +1868,13 @@ static int rcar_dmac_probe(struct platform_device *pdev) · 1867 unmodified lines
18681868
18691869 dmac->dev = &pdev->dev;
18701870 platform_set_drvdata(pdev, dmac);
1871− dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
1872− dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
1871+ ret = dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
1872+ if (ret)
1873+ return ret;
1874+
1875+ ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
1876+ if (ret)
1877+ return ret;
18731878
18741879 ret = rcar_dmac_parse_of(&pdev->dev, dmac);
18751880 if (ret < 0)
drivers/dma/sh/shdma-base.c+3−1
@@ -115,8 +115,10 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx) · 114 unmodified lines
115115 ret = pm_runtime_get(schan->dev);
116116
117117 spin_unlock_irq(&schan->chan_lock);
118− if (ret < 0)
118+ if (ret < 0) {
119119 dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret);
120+ pm_runtime_put(schan->dev);
121+ }
120122
121123 pm_runtime_barrier(schan->dev);
122124
drivers/dma/stm32-dmamux.c+3−1
@@ -292,10 +292,12 @@ static int stm32_dmamux_probe(struct platform_device *pdev) · 291 unmodified lines
292292 ret = of_dma_router_register(node, stm32_dmamux_route_allocate,
293293 &stm32_dmamux->dmarouter);
294294 if (ret)
295− goto err_clk;
295+ goto pm_disable;
296296
297297 return 0;
298298
299+pm_disable:
300+ pm_runtime_disable(&pdev->dev);
299301 err_clk:
300302 clk_disable_unprepare(stm32_dmamux->clk);
301303
drivers/edac/altera_edac.c+1−1
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev) · 349 unmodified lines
350350 if (irq < 0) {
351351 edac_printk(KERN_ERR, EDAC_MC,
352352 "No irq %d in DT\n", irq);
353− return -ENODEV;
353+ return irq;
354354 }
355355
356356 /* Arria10 has a 2nd IRQ */
drivers/edac/edac_mc.c+1−1
@@ -215,7 +215,7 @@ void *edac_align_ptr(void **p, unsigned int size, int n_elems) · 214 unmodified lines
215215 else
216216 return (char *)ptr;
217217
218− r = (unsigned long)p % align;
218+ r = (unsigned long)ptr % align;
219219
220220 if (r == 0)
221221 return (char *)ptr;
drivers/edac/xgene_edac.c+1−1
@@ -1919,7 +1919,7 @@ static int xgene_edac_probe(struct platform_device *pdev) · 1918 unmodified lines
19191919 irq = platform_get_irq_optional(pdev, i);
19201920 if (irq < 0) {
19211921 dev_err(&pdev->dev, "No IRQ resource\n");
1922− rc = -EINVAL;
1922+ rc = irq;
19231923 goto out_err;
19241924 }
19251925 rc = devm_request_irq(&pdev->dev, irq,
drivers/firmware/efi/efi.c+7−0
@@ -722,6 +722,13 @@ void __init efi_systab_report_header(const efi_table_hdr_t *systab_hdr, · 721 unmodified lines
722722 systab_hdr->revision >> 16,
723723 systab_hdr->revision & 0xffff,
724724 vendor);
725+
726+ if (IS_ENABLED(CONFIG_X86_64) &&
727+ systab_hdr->revision > EFI_1_10_SYSTEM_TABLE_REVISION &&
728+ !strcmp(vendor, "Apple")) {
729+ pr_info("Apple Mac detected, using EFI v1.10 runtime services only\n");
730+ efi.runtime_version = EFI_1_10_SYSTEM_TABLE_REVISION;
731+ }
725732 }
726733
727734 static __initdata char memory_type_name[][13] = {
drivers/firmware/efi/libstub/arm64-stub.c+3−3
@@ -119,9 +119,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 118 unmodified lines
119119 if (image->image_base != _text)
120120 efi_err("FIRMWARE BUG: efi_loaded_image_t::image_base has bogus value\n");
121121
122− if (!IS_ALIGNED((u64)_text, EFI_KIMG_ALIGN))
123− efi_err("FIRMWARE BUG: kernel image not aligned on %ldk boundary\n",
124− EFI_KIMG_ALIGN >> 10);
122+ if (!IS_ALIGNED((u64)_text, SEGMENT_ALIGN))
123+ efi_err("FIRMWARE BUG: kernel image not aligned on %dk boundary\n",
124+ SEGMENT_ALIGN >> 10);
125125
126126 kernel_size = _edata - _text;
127127 kernel_memsize = kernel_size + (_end - _edata);
drivers/gpio/gpio-aggregator.c+14−4
@@ -278,7 +278,8 @@ static int gpio_fwd_get(struct gpio_chip *chip, unsigned int offset) · 277 unmodified lines
278278 {
279279 struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
280280
281− return gpiod_get_value(fwd->descs[offset]);
281+ return chip->can_sleep ? gpiod_get_value_cansleep(fwd->descs[offset])
282+ : gpiod_get_value(fwd->descs[offset]);
282283 }
283284
284285 static int gpio_fwd_get_multiple(struct gpiochip_fwd *fwd, unsigned long *mask,
@@ -293,7 +294,10 @@ static int gpio_fwd_get_multiple(struct gpiochip_fwd *fwd, unsigned long *mask, · 8 unmodified lines
293294 for_each_set_bit(i, mask, fwd->chip.ngpio)
294295 descs[j++] = fwd->descs[i];
295296
296− error = gpiod_get_array_value(j, descs, NULL, values);
297+ if (fwd->chip.can_sleep)
298+ error = gpiod_get_array_value_cansleep(j, descs, NULL, values);
299+ else
300+ error = gpiod_get_array_value(j, descs, NULL, values);
297301 if (error)
298302 return error;
299303
@@ -328,7 +332,10 @@ static void gpio_fwd_set(struct gpio_chip *chip, unsigned int offset, int value) · 28 unmodified lines
328332 {
329333 struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
330334
331− gpiod_set_value(fwd->descs[offset], value);
335+ if (chip->can_sleep)
336+ gpiod_set_value_cansleep(fwd->descs[offset], value);
337+ else
338+ gpiod_set_value(fwd->descs[offset], value);
332339 }
333340
334341 static void gpio_fwd_set_multiple(struct gpiochip_fwd *fwd, unsigned long *mask,
@@ -343,7 +350,10 @@ static void gpio_fwd_set_multiple(struct gpiochip_fwd *fwd, unsigned long *mask, · 8 unmodified lines
343350 descs[j++] = fwd->descs[i];
344351 }
345352
346− gpiod_set_array_value(j, descs, NULL, values);
353+ if (fwd->chip.can_sleep)
354+ gpiod_set_array_value_cansleep(j, descs, NULL, values);
355+ else
356+ gpiod_set_array_value(j, descs, NULL, values);
347357 }
348358
349359 static void gpio_fwd_set_multiple_locked(struct gpio_chip *chip,
drivers/gpio/gpio-sifive.c+1−1
@@ -223,7 +223,7 @@ static int sifive_gpio_probe(struct platform_device *pdev) · 222 unmodified lines
223223 NULL,
224224 chip->base + SIFIVE_GPIO_OUTPUT_EN,
225225 chip->base + SIFIVE_GPIO_INPUT_EN,
226− 0);
226+ BGPIOF_READ_OUTPUT_REG_SET);
227227 if (ret) {
228228 dev_err(dev, "unable to init generic GPIO\n");
229229 return ret;
drivers/gpio/gpio-sim.c+15−4
@@ -570,6 +570,11 @@ static struct gpio_sim_bank *to_gpio_sim_bank(struct config_item *item) · 569 unmodified lines
570570 return container_of(group, struct gpio_sim_bank, group);
571571 }
572572
573+static bool gpio_sim_bank_has_label(struct gpio_sim_bank *bank)
574+{
575+ return bank->label && *bank->label;
576+}
577+
573578 static struct gpio_sim_device *
574579 gpio_sim_bank_get_device(struct gpio_sim_bank *bank)
575580 {
@@ -770,9 +775,15 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev) · 194 unmodified lines
770775 * point the device doesn't exist yet and so dev_name()
771776 * is not available.
772777 */
773− hog->chip_label = kasprintf(GFP_KERNEL,
774− "gpio-sim.%u-%s", dev->id,
775− fwnode_get_name(bank->swnode));
778+ if (gpio_sim_bank_has_label(bank))
779+ hog->chip_label = kstrdup(bank->label,
780+ GFP_KERNEL);
781+ else
782+ hog->chip_label = kasprintf(GFP_KERNEL,
783+ "gpio-sim.%u-%s",
784+ dev->id,
785+ fwnode_get_name(
786+ bank->swnode));
776787 if (!hog->chip_label) {
777788 gpio_sim_remove_hogs(dev);
778789 return -ENOMEM;
@@ -816,7 +827,7 @@ gpio_sim_make_bank_swnode(struct gpio_sim_bank *bank, · 37 unmodified lines
816827
817828 properties[prop_idx++] = PROPERTY_ENTRY_U32("ngpios", bank->num_lines);
818829
819− if (bank->label)
830+ if (gpio_sim_bank_has_label(bank))
820831 properties[prop_idx++] = PROPERTY_ENTRY_STRING("gpio-sim,label",
821832 bank->label);
822833
drivers/gpio/gpiolib-cdev.c+3−3
@@ -330,7 +330,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) · 329 unmodified lines
330330 goto out_free_lh;
331331 }
332332
333− ret = gpiod_request(desc, lh->label);
333+ ret = gpiod_request_user(desc, lh->label);
334334 if (ret)
335335 goto out_free_lh;
336336 lh->descs[i] = desc;
@@ -1378,7 +1378,7 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip) · 1041 unmodified lines
13781378 goto out_free_linereq;
13791379 }
13801380
1381− ret = gpiod_request(desc, lr->label);
1381+ ret = gpiod_request_user(desc, lr->label);
13821382 if (ret)
13831383 goto out_free_linereq;
13841384
@@ -1764,7 +1764,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) · 379 unmodified lines
17641764 }
17651765 }
17661766
1767− ret = gpiod_request(desc, le->label);
1767+ ret = gpiod_request_user(desc, le->label);
17681768 if (ret)
17691769 goto out_free_le;
17701770 le->desc = desc;
drivers/gpio/gpiolib-sysfs.c+2−5
@@ -475,12 +475,9 @@ static ssize_t export_store(struct class *class, · 474 unmodified lines
475475 * they may be undone on its behalf too.
476476 */
477477
478− status = gpiod_request(desc, "sysfs");
479− if (status) {
480− if (status == -EPROBE_DEFER)
481− status = -ENODEV;
478+ status = gpiod_request_user(desc, "sysfs");
479+ if (status)
482480 goto done;
483− }
484481
485482 status = gpiod_set_transitory(desc, false);
486483 if (!status) {
drivers/gpio/gpiolib.h+12−0
@@ -135,6 +135,18 @@ struct gpio_desc { · 134 unmodified lines
135135
136136 int gpiod_request(struct gpio_desc *desc, const char *label);
137137 void gpiod_free(struct gpio_desc *desc);
138+
139+static inline int gpiod_request_user(struct gpio_desc *desc, const char *label)
140+{
141+ int ret;
142+
143+ ret = gpiod_request(desc, label);
144+ if (ret == -EPROBE_DEFER)
145+ ret = -ENODEV;
146+
147+ return ret;
148+}
149+
138150 int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
139151 unsigned long lflags, enum gpiod_flags dflags);
140152 int gpio_set_debounce_timeout(struct gpio_desc *desc, unsigned int debounce);
drivers/gpu/drm/amd/amdgpu/amdgpu.h+8−2
@@ -1408,12 +1408,10 @@ int amdgpu_acpi_smart_shift_update(struct drm_device *dev, enum amdgpu_ss ss_sta · 1407 unmodified lines
14081408 int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
14091409
14101410 void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);
1411−bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
14121411 void amdgpu_acpi_detect(void);
14131412 #else
14141413 static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }
14151414 static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }
1416−static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
14171415 static inline void amdgpu_acpi_detect(void) { }
14181416 static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
14191417 static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
@@ -1422,6 +1420,14 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev, · 2 unmodified lines
14221420 enum amdgpu_ss ss_state) { return 0; }
14231421 #endif
14241422
1423+#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
1424+bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
1425+bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
1426+#else
1427+static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
1428+static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
1429+#endif
1430+
14251431 int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
14261432 uint64_t addr, struct amdgpu_bo **bo,
14271433 struct amdgpu_bo_va_mapping **mapping);
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c+32−5
@@ -1031,6 +1031,20 @@ void amdgpu_acpi_detect(void) · 1030 unmodified lines
10311031 }
10321032 }
10331033
1034+#if IS_ENABLED(CONFIG_SUSPEND)
1035+/**
1036+ * amdgpu_acpi_is_s3_active
1037+ *
1038+ * @adev: amdgpu_device_pointer
1039+ *
1040+ * returns true if supported, false if not.
1041+ */
1042+bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
1043+{
1044+ return !(adev->flags & AMD_IS_APU) ||
1045+ (pm_suspend_target_state == PM_SUSPEND_MEM);
1046+}
1047+
10341048 /**
10351049 * amdgpu_acpi_is_s0ix_active
10361050 *
@@ -1040,11 +1054,24 @@ void amdgpu_acpi_detect(void) · 3 unmodified lines
10401054 */
10411055 bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
10421056 {
1043−#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)
1044− if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
1045− if (adev->flags & AMD_IS_APU)
1046− return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
1057+ if (!(adev->flags & AMD_IS_APU) ||
1058+ (pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
1059+ return false;
1060+
1061+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
1062+ dev_warn_once(adev->dev,
1063+ "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"
1064+ "To use suspend-to-idle change the sleep mode in BIOS setup.\n");
1065+ return false;
10471066 }
1048−#endif
1067+
1068+#if !IS_ENABLED(CONFIG_AMD_PMC)
1069+ dev_warn_once(adev->dev,
1070+ "Power consumption will be higher as the kernel has not been compiled with CONFIG_AMD_PMC.\n");
10491071 return false;
1072+#else
1073+ return true;
1074+#endif /* CONFIG_AMD_PMC */
10501075 }
1076+
1077+#endif /* CONFIG_SUSPEND */
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+90−2
@@ -1525,6 +1525,87 @@ static const u16 amdgpu_unsupported_pciidlist[] = { · 1524 unmodified lines
15251525 0x99A0,
15261526 0x99A2,
15271527 0x99A4,
1528+ /* radeon secondary ids */
1529+ 0x3171,
1530+ 0x3e70,
1531+ 0x4164,
1532+ 0x4165,
1533+ 0x4166,
1534+ 0x4168,
1535+ 0x4170,
1536+ 0x4171,
1537+ 0x4172,
1538+ 0x4173,
1539+ 0x496e,
1540+ 0x4a69,
1541+ 0x4a6a,
1542+ 0x4a6b,
1543+ 0x4a70,
1544+ 0x4a74,
1545+ 0x4b69,
1546+ 0x4b6b,
1547+ 0x4b6c,
1548+ 0x4c6e,
1549+ 0x4e64,
1550+ 0x4e65,
1551+ 0x4e66,
1552+ 0x4e67,
1553+ 0x4e68,
1554+ 0x4e69,
1555+ 0x4e6a,
1556+ 0x4e71,
1557+ 0x4f73,
1558+ 0x5569,
1559+ 0x556b,
1560+ 0x556d,
1561+ 0x556f,
1562+ 0x5571,
1563+ 0x5854,
1564+ 0x5874,
1565+ 0x5940,
1566+ 0x5941,
1567+ 0x5b72,
1568+ 0x5b73,
1569+ 0x5b74,
1570+ 0x5b75,
1571+ 0x5d44,
1572+ 0x5d45,
1573+ 0x5d6d,
1574+ 0x5d6f,
1575+ 0x5d72,
1576+ 0x5d77,
1577+ 0x5e6b,
1578+ 0x5e6d,
1579+ 0x7120,
1580+ 0x7124,
1581+ 0x7129,
1582+ 0x712e,
1583+ 0x712f,
1584+ 0x7162,
1585+ 0x7163,
1586+ 0x7166,
1587+ 0x7167,
1588+ 0x7172,
1589+ 0x7173,
1590+ 0x71a0,
1591+ 0x71a1,
1592+ 0x71a3,
1593+ 0x71a7,
1594+ 0x71bb,
1595+ 0x71e0,
1596+ 0x71e1,
1597+ 0x71e2,
1598+ 0x71e6,
1599+ 0x71e7,
1600+ 0x71f2,
1601+ 0x7269,
1602+ 0x726b,
1603+ 0x726e,
1604+ 0x72a0,
1605+ 0x72a8,
1606+ 0x72b1,
1607+ 0x72b3,
1608+ 0x793f,
15281609 };
15291610
15301611 static const struct pci_device_id pciidlist[] = {
@@ -2165,13 +2246,20 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work) · 634 unmodified lines
21652246 static int amdgpu_pmops_prepare(struct device *dev)
21662247 {
21672248 struct drm_device *drm_dev = dev_get_drvdata(dev);
2249+ struct amdgpu_device *adev = drm_to_adev(drm_dev);
21682250
21692251 /* Return a positive number here so
21702252 * DPM_FLAG_SMART_SUSPEND works properly
21712253 */
21722254 if (amdgpu_device_supports_boco(drm_dev))
2173− return pm_runtime_suspended(dev) &&
2174− pm_suspend_via_firmware();
2255+ return pm_runtime_suspended(dev);
2256+
2257+ /* if we will not support s3 or s2i for the device
2258+ * then skip suspend
2259+ */
2260+ if (!amdgpu_acpi_is_s0ix_active(adev) &&
2261+ !amdgpu_acpi_is_s3_active(adev))
2262+ return 1;
21752263
21762264 return 0;
21772265 }
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+1−1
@@ -1904,7 +1904,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset, · 1903 unmodified lines
19041904 unsigned i;
19051905 int r;
19061906
1907− if (direct_submit && !ring->sched.ready) {
1907+ if (!direct_submit && !ring->sched.ready) {
19081908 DRM_ERROR("Trying to move memory with ring turned off.\n");
19091909 return -EINVAL;
19101910 }
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c+6−1
@@ -543,7 +543,9 @@ static void gfxhub_v2_1_utcl2_harvest(struct amdgpu_device *adev) · 542 unmodified lines
543543 adev->gfx.config.max_sh_per_se *
544544 adev->gfx.config.max_shader_engines);
545545
546− if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 3)) {
546+ switch (adev->ip_versions[GC_HWIP][0]) {
547+ case IP_VERSION(10, 3, 1):
548+ case IP_VERSION(10, 3, 3):
547549 /* Get SA disabled bitmap from eFuse setting */
548550 efuse_setting = RREG32_SOC15(GC, 0, mmCC_GC_SA_UNIT_DISABLE);
549551 efuse_setting &= CC_GC_SA_UNIT_DISABLE__SA_DISABLE_MASK;
@@ -566,6 +568,9 @@ static void gfxhub_v2_1_utcl2_harvest(struct amdgpu_device *adev) · 16 unmodified lines
566568 disabled_sa = tmp;
567569
568570 WREG32_SOC15(GC, 0, mmGCUTCL2_HARVEST_BYPASS_GROUPS_YELLOW_CARP, disabled_sa);
571+ break;
572+ default:
573+ break;
569574 }
570575 }
571576
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+3−0
@@ -1140,6 +1140,9 @@ static void gmc_v10_0_get_clockgating_state(void *handle, u32 *flags) · 1139 unmodified lines
11401140 {
11411141 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
11421142
1143+ if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 3))
1144+ return;
1145+
11431146 adev->mmhub.funcs->get_clockgating(adev, flags);
11441147
11451148 if (adev->ip_versions[ATHUB_HWIP][0] >= IP_VERSION(2, 1, 0))
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c+8−0
@@ -2057,6 +2057,10 @@ static int sdma_v4_0_suspend(void *handle) · 2056 unmodified lines
20572057 {
20582058 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
20592059
2060+ /* SMU saves SDMA state for us */
2061+ if (adev->in_s0ix)
2062+ return 0;
2063+
20602064 return sdma_v4_0_hw_fini(adev);
20612065 }
20622066
@@ -2064,6 +2068,10 @@ static int sdma_v4_0_resume(void *handle) · 1 unmodified line
20642068 {
20652069 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
20662070
2071+ /* SMU restores SDMA state for us */
2072+ if (adev->in_s0ix)
2073+ return 0;
2074+
20672075 return sdma_v4_0_hw_init(adev);
20682076 }
20692077
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+1−1
@@ -3653,7 +3653,7 @@ static int dcn10_register_irq_handlers(struct amdgpu_device *adev) · 3652 unmodified lines
36533653
36543654 /* Use GRPH_PFLIP interrupt */
36553655 for (i = DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT;
3656− i <= DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT + adev->mode_info.num_crtc - 1;
3656+ i <= DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT + dc->caps.max_otg_num - 1;
36573657 i++) {
36583658 r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_DCE, i, &adev->pageflip_irq);
36593659 if (r) {
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c+2−2
@@ -2033,10 +2033,10 @@ static void calculate_bandwidth( · 2032 unmodified lines
20332033 kfree(surface_type);
20342034 free_tiling_mode:
20352035 kfree(tiling_mode);
2036−free_yclk:
2037− kfree(yclk);
20382036 free_sclk:
20392037 kfree(sclk);
2038+free_yclk:
2039+ kfree(yclk);
20402040 }
20412041
20422042 /*******************************************************************************
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c+0−1
@@ -503,7 +503,6 @@ static void dcn_bw_calc_rq_dlg_ttu( · 502 unmodified lines
503503 //input[in_idx].dout.output_standard;
504504
505505 /*todo: soc->sr_enter_plus_exit_time??*/
506− dlg_sys_param->t_srx_delay_us = dc->dcn_ip->dcfclk_cstate_latency / v->dcf_clk_deep_sleep;
507506
508507 dml1_rq_dlg_get_rq_params(dml, rq_param, &input->pipe.src);
509508 dml1_extract_rq_regs(dml, rq_regs, rq_param);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c+8−8
@@ -570,32 +570,32 @@ static struct wm_table lpddr5_wm_table = { · 569 unmodified lines
570570 .wm_inst = WM_A,
571571 .wm_type = WM_TYPE_PSTATE_CHG,
572572 .pstate_latency_us = 11.65333,
573− .sr_exit_time_us = 7.95,
574− .sr_enter_plus_exit_time_us = 9,
573+ .sr_exit_time_us = 13.5,
574+ .sr_enter_plus_exit_time_us = 16.5,
575575 .valid = true,
576576 },
577577 {
578578 .wm_inst = WM_B,
579579 .wm_type = WM_TYPE_PSTATE_CHG,
580580 .pstate_latency_us = 11.65333,
581− .sr_exit_time_us = 9.82,
582− .sr_enter_plus_exit_time_us = 11.196,
581+ .sr_exit_time_us = 13.5,
582+ .sr_enter_plus_exit_time_us = 16.5,
583583 .valid = true,
584584 },
585585 {
586586 .wm_inst = WM_C,
587587 .wm_type = WM_TYPE_PSTATE_CHG,
588588 .pstate_latency_us = 11.65333,
589− .sr_exit_time_us = 9.89,
590− .sr_enter_plus_exit_time_us = 11.24,
589+ .sr_exit_time_us = 13.5,
590+ .sr_enter_plus_exit_time_us = 16.5,
591591 .valid = true,
592592 },
593593 {
594594 .wm_inst = WM_D,
595595 .wm_type = WM_TYPE_PSTATE_CHG,
596596 .pstate_latency_us = 11.65333,
597− .sr_exit_time_us = 9.748,
598− .sr_enter_plus_exit_time_us = 11.102,
597+ .sr_exit_time_us = 13.5,
598+ .sr_enter_plus_exit_time_us = 16.5,
599599 .valid = true,
600600 },
601601 }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c+10−10
@@ -329,38 +329,38 @@ static struct clk_bw_params dcn31_bw_params = { · 328 unmodified lines
329329
330330 };
331331
332−static struct wm_table ddr4_wm_table = {
332+static struct wm_table ddr5_wm_table = {
333333 .entries = {
334334 {
335335 .wm_inst = WM_A,
336336 .wm_type = WM_TYPE_PSTATE_CHG,
337337 .pstate_latency_us = 11.72,
338− .sr_exit_time_us = 6.09,
339− .sr_enter_plus_exit_time_us = 7.14,
338+ .sr_exit_time_us = 9,
339+ .sr_enter_plus_exit_time_us = 11,
340340 .valid = true,
341341 },
342342 {
343343 .wm_inst = WM_B,
344344 .wm_type = WM_TYPE_PSTATE_CHG,
345345 .pstate_latency_us = 11.72,
346− .sr_exit_time_us = 10.12,
347− .sr_enter_plus_exit_time_us = 11.48,
346+ .sr_exit_time_us = 9,
347+ .sr_enter_plus_exit_time_us = 11,
348348 .valid = true,
349349 },
350350 {
351351 .wm_inst = WM_C,
352352 .wm_type = WM_TYPE_PSTATE_CHG,
353353 .pstate_latency_us = 11.72,
354− .sr_exit_time_us = 10.12,
355− .sr_enter_plus_exit_time_us = 11.48,
354+ .sr_exit_time_us = 9,
355+ .sr_enter_plus_exit_time_us = 11,
356356 .valid = true,
357357 },
358358 {
359359 .wm_inst = WM_D,
360360 .wm_type = WM_TYPE_PSTATE_CHG,
361361 .pstate_latency_us = 11.72,
362− .sr_exit_time_us = 10.12,
363− .sr_enter_plus_exit_time_us = 11.48,
362+ .sr_exit_time_us = 9,
363+ .sr_enter_plus_exit_time_us = 11,
364364 .valid = true,
365365 },
366366 }
@@ -687,7 +687,7 @@ void dcn31_clk_mgr_construct( · 320 unmodified lines
687687 if (ctx->dc_bios->integrated_info->memory_type == LpDdr5MemType) {
688688 dcn31_bw_params.wm_table = lpddr5_wm_table;
689689 } else {
690− dcn31_bw_params.wm_table = ddr4_wm_table;
690+ dcn31_bw_params.wm_table = ddr5_wm_table;
691691 }
692692 /* Saved clocks configured at boot for debug purposes */
693693 dcn31_dump_clk_registers(&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c+5−1
@@ -120,7 +120,11 @@ static int dcn31_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, · 119 unmodified lines
120120 result = dcn31_smu_wait_for_response(clk_mgr, 10, 200000);
121121
122122 if (result == VBIOSSMC_Result_Failed) {
123− ASSERT(0);
123+ if (msg_id == VBIOSSMC_MSG_TransferTableDram2Smu &&
124+ param == TABLE_WATERMARKS)
125+ DC_LOG_WARNING("Watermarks table not configured properly by SMU");
126+ else
127+ ASSERT(0);
124128 REG_WRITE(MP1_SMN_C2PMSG_91, VBIOSSMC_Result_OK);
125129 return -1;
126130 }
drivers/gpu/drm/amd/display/dc/core/dc.c+29−13
@@ -1220,6 +1220,8 @@ struct dc *dc_create(const struct dc_init_data *init_params) · 1219 unmodified lines
12201220
12211221 dc->caps.max_dp_protocol_version = DP_VERSION_1_4;
12221222
1223+ dc->caps.max_otg_num = dc->res_pool->res_cap->num_timing_generator;
1224+
12231225 if (dc->res_pool->dmcu != NULL)
12241226 dc->versions.dmcu_version = dc->res_pool->dmcu->dmcu_version;
12251227 }
@@ -1404,20 +1406,34 @@ static void program_timing_sync( · 178 unmodified lines
14041406 status->timing_sync_info.master = false;
14051407
14061408 }
1407− /* remove any other unblanked pipes as they have already been synced */
1408− for (j = j + 1; j < group_size; j++) {
1409− bool is_blanked;
14101409
1411− if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked)
1412− is_blanked =
1413− pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
1414− else
1415− is_blanked =
1416− pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg);
1417− if (!is_blanked) {
1418− group_size--;
1419− pipe_set[j] = pipe_set[group_size];
1420− j--;
1410+ /* remove any other pipes that are already been synced */
1411+ if (dc->config.use_pipe_ctx_sync_logic) {
1412+ /* check pipe's syncd to decide which pipe to be removed */
1413+ for (j = 1; j < group_size; j++) {
1414+ if (pipe_set[j]->pipe_idx_syncd == pipe_set[0]->pipe_idx_syncd) {
1415+ group_size--;
1416+ pipe_set[j] = pipe_set[group_size];
1417+ j--;
1418+ } else
1419+ /* link slave pipe's syncd with master pipe */
1420+ pipe_set[j]->pipe_idx_syncd = pipe_set[0]->pipe_idx_syncd;
1421+ }
1422+ } else {
1423+ for (j = j + 1; j < group_size; j++) {
1424+ bool is_blanked;
1425+
1426+ if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked)
1427+ is_blanked =
1428+ pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
1429+ else
1430+ is_blanked =
1431+ pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg);
1432+ if (!is_blanked) {
1433+ group_size--;
1434+ pipe_set[j] = pipe_set[group_size];
1435+ j--;
1436+ }
14211437 }
14221438 }
14231439
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+23−3
@@ -202,7 +202,7 @@ void dp_wait_for_training_aux_rd_interval( · 201 unmodified lines
202202 uint32_t wait_in_micro_secs)
203203 {
204204 #if defined(CONFIG_DRM_AMD_DC_DCN)
205− if (wait_in_micro_secs > 16000)
205+ if (wait_in_micro_secs > 1000)
206206 msleep(wait_in_micro_secs/1000);
207207 else
208208 udelay(wait_in_micro_secs);
@@ -5597,6 +5597,26 @@ static bool retrieve_link_cap(struct dc_link *link) · 5388 unmodified lines
55975597 dp_hw_fw_revision.ieee_fw_rev,
55985598 sizeof(dp_hw_fw_revision.ieee_fw_rev));
55995599
5600+ /* Quirk for Apple MBP 2018 15" Retina panels: wrong DP_MAX_LINK_RATE */
5601+ {
5602+ uint8_t str_mbp_2018[] = { 101, 68, 21, 103, 98, 97 };
5603+ uint8_t fwrev_mbp_2018[] = { 7, 4 };
5604+ uint8_t fwrev_mbp_2018_vega[] = { 8, 4 };
5605+
5606+ /* We also check for the firmware revision as 16,1 models have an
5607+ * identical device id and are incorrectly quirked otherwise.
5608+ */
5609+ if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
5610+ !memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2018,
5611+ sizeof(str_mbp_2018)) &&
5612+ (!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018,
5613+ sizeof(fwrev_mbp_2018)) ||
5614+ !memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018_vega,
5615+ sizeof(fwrev_mbp_2018_vega)))) {
5616+ link->reported_link_cap.link_rate = LINK_RATE_RBR2;
5617+ }
5618+ }
5619+
56005620 memset(&link->dpcd_caps.dsc_caps, '\0',
56015621 sizeof(link->dpcd_caps.dsc_caps));
56025622 memset(&link->dpcd_caps.fec_cap, '\0', sizeof(link->dpcd_caps.fec_cap));
@@ -6935,7 +6955,7 @@ bool dpcd_write_128b_132b_sst_payload_allocation_table( · 1332 unmodified lines
69356955 }
69366956 }
69376957 retries++;
6938− udelay(5000);
6958+ msleep(5);
69396959 }
69406960
69416961 if (!result && retries == max_retries) {
@@ -6987,7 +7007,7 @@ bool dpcd_poll_for_allocation_change_trigger(struct dc_link *link) · 45 unmodified lines
69877007 break;
69887008 }
69897009
6990− udelay(5000);
7010+ msleep(5);
69917011 }
69927012
69937013 if (result == ACT_FAILED) {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c+54−0
@@ -3217,6 +3217,60 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt( · 3216 unmodified lines
32173217 }
32183218 #endif
32193219
3220+void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
3221+ struct dc_state *context)
3222+{
3223+ int i, j;
3224+ struct pipe_ctx *pipe_ctx_old, *pipe_ctx, *pipe_ctx_syncd;
3225+
3226+ /* If pipe backend is reset, need to reset pipe syncd status */
3227+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
3228+ pipe_ctx_old = &dc->current_state->res_ctx.pipe_ctx[i];
3229+ pipe_ctx = &context->res_ctx.pipe_ctx[i];
3230+
3231+ if (!pipe_ctx_old->stream)
3232+ continue;
3233+
3234+ if (pipe_ctx_old->top_pipe || pipe_ctx_old->prev_odm_pipe)
3235+ continue;
3236+
3237+ if (!pipe_ctx->stream ||
3238+ pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
3239+
3240+ /* Reset all the syncd pipes from the disabled pipe */
3241+ for (j = 0; j < dc->res_pool->pipe_count; j++) {
3242+ pipe_ctx_syncd = &context->res_ctx.pipe_ctx[j];
3243+ if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_syncd) == pipe_ctx_old->pipe_idx) ||
3244+ !IS_PIPE_SYNCD_VALID(pipe_ctx_syncd))
3245+ SET_PIPE_SYNCD_TO_PIPE(pipe_ctx_syncd, j);
3246+ }
3247+ }
3248+ }
3249+}
3250+
3251+void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
3252+ struct dc_state *context,
3253+ uint8_t disabled_master_pipe_idx)
3254+{
3255+ int i;
3256+ struct pipe_ctx *pipe_ctx, *pipe_ctx_check;
3257+
3258+ pipe_ctx = &context->res_ctx.pipe_ctx[disabled_master_pipe_idx];
3259+ if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx) != disabled_master_pipe_idx) ||
3260+ !IS_PIPE_SYNCD_VALID(pipe_ctx))
3261+ SET_PIPE_SYNCD_TO_PIPE(pipe_ctx, disabled_master_pipe_idx);
3262+
3263+ /* for the pipe disabled, check if any slave pipe exists and assert */
3264+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
3265+ pipe_ctx_check = &context->res_ctx.pipe_ctx[i];
3266+
3267+ if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_check) == disabled_master_pipe_idx) &&
3268+ IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx))
3269+ DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
3270+ i, disabled_master_pipe_idx);
3271+ }
3272+}
3273+
32203274 uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter)
32213275 {
32223276 /* TODO - get transmitter to phy idx mapping from DMUB */
drivers/gpu/drm/amd/display/dc/dc.h+2−0
@@ -202,6 +202,7 @@ struct dc_caps { · 201 unmodified lines
202202 bool edp_dsc_support;
203203 bool vbios_lttpr_aware;
204204 bool vbios_lttpr_enable;
205+ uint32_t max_otg_num;
205206 };
206207
207208 struct dc_bug_wa {
@@ -344,6 +345,7 @@ struct dc_config { · 136 unmodified lines
344345 uint8_t vblank_alignment_max_frame_time_diff;
345346 bool is_asymmetric_memory;
346347 bool is_single_rank_dimm;
348+ bool use_pipe_ctx_sync_logic;
347349 };
348350
349351 enum visual_confirm {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c+30−7
@@ -1566,6 +1566,10 @@ static enum dc_status apply_single_controller_ctx_to_hw( · 1565 unmodified lines
15661566 &pipe_ctx->stream->audio_info);
15671567 }
15681568
1569+ /* make sure no pipes syncd to the pipe being enabled */
1570+ if (!pipe_ctx->stream->apply_seamless_boot_optimization && dc->config.use_pipe_ctx_sync_logic)
1571+ check_syncd_pipes_for_disabled_master_pipe(dc, context, pipe_ctx->pipe_idx);
1572+
15691573 #if defined(CONFIG_DRM_AMD_DC_DCN)
15701574 /* DCN3.1 FPGA Workaround
15711575 * Need to enable HPO DP Stream Encoder before setting OTG master enable.
@@ -1604,11 +1608,6 @@ static enum dc_status apply_single_controller_ctx_to_hw( · 32 unmodified lines
16041608 pipe_ctx->stream_res.stream_enc,
16051609 pipe_ctx->stream_res.tg->inst);
16061610
1607− if (dc_is_dp_signal(pipe_ctx->stream->signal) &&
1608− pipe_ctx->stream_res.stream_enc->funcs->reset_fifo)
1609− pipe_ctx->stream_res.stream_enc->funcs->reset_fifo(
1610− pipe_ctx->stream_res.stream_enc);
1611−
16121611 if (dc_is_dp_signal(pipe_ctx->stream->signal))
16131612 dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG);
16141613
@@ -1835,9 +1834,29 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) · 220 unmodified lines
18351834 break;
18361835 }
18371836 }
1838− // We are trying to enable eDP, don't power down VDD
1839− if (can_apply_edp_fast_boot)
1837+
1838+ /*
1839+ * TO-DO: So far the code logic below only addresses single eDP case.
1840+ * For dual eDP case, there are a few things that need to be
1841+ * implemented first:
1842+ *
1843+ * 1. Change the fastboot logic above, so eDP link[0 or 1]'s
1844+ * stream[0 or 1] will all be checked.
1845+ *
1846+ * 2. Change keep_edp_vdd_on to an array, and maintain keep_edp_vdd_on
1847+ * for each eDP.
1848+ *
1849+ * Once above 2 things are completed, we can then change the logic below
1850+ * correspondingly, so dual eDP case will be fully covered.
1851+ */
1852+
1853+ // We are trying to enable eDP, don't power down VDD if eDP stream is existing
1854+ if ((edp_stream_num == 1 && edp_streams[0] != NULL) || can_apply_edp_fast_boot) {
18401855 keep_edp_vdd_on = true;
1856+ DC_LOG_EVENT_LINK_TRAINING("Keep eDP Vdd on\n");
1857+ } else {
1858+ DC_LOG_EVENT_LINK_TRAINING("No eDP stream enabled, turn eDP Vdd off\n");
1859+ }
18411860 }
18421861
18431862 // Check seamless boot support
@@ -2297,6 +2316,10 @@ enum dc_status dce110_apply_ctx_to_hw( · 453 unmodified lines
22972316 enum dc_status status;
22982317 int i;
22992318
2319+ /* reset syncd pipes from disabled pipes */
2320+ if (dc->config.use_pipe_ctx_sync_logic)
2321+ reset_syncd_pipes_from_disabled_pipes(dc, context);
2322+
23002323 /* Reset old context */
23012324 /* look up the targets that have been removed since last commit */
23022325 hws->funcs.reset_hw_ctx_wrap(dc, context);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c+0−15
@@ -902,19 +902,6 @@ void enc1_stream_encoder_stop_dp_info_packets( · 901 unmodified lines
902902
903903 }
904904
905−void enc1_stream_encoder_reset_fifo(
906− struct stream_encoder *enc)
907−{
908− struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
909−
910− /* set DIG_START to 0x1 to reset FIFO */
911− REG_UPDATE(DIG_FE_CNTL, DIG_START, 1);
912− udelay(100);
913−
914− /* write 0 to take the FIFO out of reset */
915− REG_UPDATE(DIG_FE_CNTL, DIG_START, 0);
916−}
917−
918905 void enc1_stream_encoder_dp_blank(
919906 struct dc_link *link,
920907 struct stream_encoder *enc)
@@ -1600,8 +1587,6 @@ static const struct stream_encoder_funcs dcn10_str_enc_funcs = { · 679 unmodified lines
16001587 enc1_stream_encoder_send_immediate_sdp_message,
16011588 .stop_dp_info_packets =
16021589 enc1_stream_encoder_stop_dp_info_packets,
1603− .reset_fifo =
1604− enc1_stream_encoder_reset_fifo,
16051590 .dp_blank =
16061591 enc1_stream_encoder_dp_blank,
16071592 .dp_unblank =
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h+0−3
@@ -626,9 +626,6 @@ void enc1_stream_encoder_send_immediate_sdp_message( · 625 unmodified lines
626626 void enc1_stream_encoder_stop_dp_info_packets(
627627 struct stream_encoder *enc);
628628
629−void enc1_stream_encoder_reset_fifo(
630− struct stream_encoder *enc);
631−
632629 void enc1_stream_encoder_dp_blank(
633630 struct dc_link *link,
634631 struct stream_encoder *enc);
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c+1−1
@@ -1069,7 +1069,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 1068 unmodified lines
10691069 .timing_trace = false,
10701070 .clock_trace = true,
10711071 .disable_pplib_clock_request = true,
1072− .pipe_split_policy = MPC_SPLIT_DYNAMIC,
1072+ .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP,
10731073 .force_single_disp_pipe_split = false,
10741074 .disable_dcc = DCC_ENABLE,
10751075 .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c+0−2
@@ -593,8 +593,6 @@ static const struct stream_encoder_funcs dcn20_str_enc_funcs = { · 592 unmodified lines
593593 enc1_stream_encoder_send_immediate_sdp_message,
594594 .stop_dp_info_packets =
595595 enc1_stream_encoder_stop_dp_info_packets,
596− .reset_fifo =
597− enc1_stream_encoder_reset_fifo,
598596 .dp_blank =
599597 enc1_stream_encoder_dp_blank,
600598 .dp_unblank =
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c+0−2
@@ -789,8 +789,6 @@ static const struct stream_encoder_funcs dcn30_str_enc_funcs = { · 788 unmodified lines
789789 enc3_stream_encoder_update_dp_info_packets,
790790 .stop_dp_info_packets =
791791 enc1_stream_encoder_stop_dp_info_packets,
792− .reset_fifo =
793− enc1_stream_encoder_reset_fifo,
794792 .dp_blank =
795793 enc1_stream_encoder_dp_blank,
796794 .dp_unblank =
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c+2−2
@@ -1878,7 +1878,6 @@ noinline bool dcn30_internal_validate_bw( · 1877 unmodified lines
18781878 dc->res_pool->funcs->update_soc_for_wm_a(dc, context);
18791879 pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate);
18801880
1881− DC_FP_START();
18821881 if (!pipe_cnt) {
18831882 out = true;
18841883 goto validate_out;
@@ -2104,7 +2103,6 @@ validate_fail: · 219 unmodified lines
21042103 out = false;
21052104
21062105 validate_out:
2107− DC_FP_END();
21082106 return out;
21092107 }
21102108
@@ -2306,7 +2304,9 @@ bool dcn30_validate_bandwidth(struct dc *dc, · 195 unmodified lines
23062304
23072305 BW_VAL_TRACE_COUNT();
23082306
2307+ DC_FP_START();
23092308 out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate);
2309+ DC_FP_END();
23102310
23112311 if (pipe_cnt == 0)
23122312 goto validate_out;
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c+12−1
@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 685 unmodified lines
686686 .disable_clock_gate = true,
687687 .disable_pplib_clock_request = true,
688688 .disable_pplib_wm_range = true,
689− .pipe_split_policy = MPC_SPLIT_DYNAMIC,
689+ .pipe_split_policy = MPC_SPLIT_AVOID,
690690 .force_single_disp_pipe_split = false,
691691 .disable_dcc = DCC_ENABLE,
692692 .vsr_support = true,
@@ -1380,6 +1380,17 @@ static void set_wm_ranges( · 687 unmodified lines
13801380 pp_smu->nv_funcs.set_wm_ranges(&pp_smu->nv_funcs.pp_smu, &ranges);
13811381 }
13821382
1383+static void dcn301_calculate_wm_and_dlg(
1384+ struct dc *dc, struct dc_state *context,
1385+ display_e2e_pipe_params_st *pipes,
1386+ int pipe_cnt,
1387+ int vlevel)
1388+{
1389+ DC_FP_START();
1390+ dcn301_calculate_wm_and_dlg_fp(dc, context, pipes, pipe_cnt, vlevel);
1391+ DC_FP_END();
1392+}
1393+
13831394 static struct resource_funcs dcn301_res_pool_funcs = {
13841395 .destroy = dcn301_destroy_resource_pool,
13851396 .link_enc_create = dcn301_link_encoder_create,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c+32−29
@@ -138,8 +138,11 @@ static uint32_t convert_and_clamp( · 137 unmodified lines
138138 ret_val = wm_ns * refclk_mhz;
139139 ret_val /= 1000;
140140
141− if (ret_val > clamp_value)
141+ if (ret_val > clamp_value) {
142+ /* clamping WMs is abnormal, unexpected and may lead to underflow*/
143+ ASSERT(0);
142144 ret_val = clamp_value;
145+ }
143146
144147 return ret_val;
145148 }
@@ -159,7 +162,7 @@ static bool hubbub31_program_urgent_watermarks( · 13 unmodified lines
159162 if (safe_to_lower || watermarks->a.urgent_ns > hubbub2->watermarks.a.urgent_ns) {
160163 hubbub2->watermarks.a.urgent_ns = watermarks->a.urgent_ns;
161164 prog_wm_value = convert_and_clamp(watermarks->a.urgent_ns,
162− refclk_mhz, 0x1fffff);
165+ refclk_mhz, 0x3fff);
163166 REG_SET(DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A, 0,
164167 DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A, prog_wm_value);
165168
@@ -193,7 +196,7 @@ static bool hubbub31_program_urgent_watermarks( · 27 unmodified lines
193196 if (safe_to_lower || watermarks->a.urgent_latency_ns > hubbub2->watermarks.a.urgent_latency_ns) {
194197 hubbub2->watermarks.a.urgent_latency_ns = watermarks->a.urgent_latency_ns;
195198 prog_wm_value = convert_and_clamp(watermarks->a.urgent_latency_ns,
196− refclk_mhz, 0x1fffff);
199+ refclk_mhz, 0x3fff);
197200 REG_SET(DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_A, 0,
198201 DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_A, prog_wm_value);
199202 } else if (watermarks->a.urgent_latency_ns < hubbub2->watermarks.a.urgent_latency_ns)
@@ -203,7 +206,7 @@ static bool hubbub31_program_urgent_watermarks( · 3 unmodified lines
203206 if (safe_to_lower || watermarks->b.urgent_ns > hubbub2->watermarks.b.urgent_ns) {
204207 hubbub2->watermarks.b.urgent_ns = watermarks->b.urgent_ns;
205208 prog_wm_value = convert_and_clamp(watermarks->b.urgent_ns,
206− refclk_mhz, 0x1fffff);
209+ refclk_mhz, 0x3fff);
207210 REG_SET(DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B, 0,
208211 DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B, prog_wm_value);
209212
@@ -237,7 +240,7 @@ static bool hubbub31_program_urgent_watermarks( · 27 unmodified lines
237240 if (safe_to_lower || watermarks->b.urgent_latency_ns > hubbub2->watermarks.b.urgent_latency_ns) {
238241 hubbub2->watermarks.b.urgent_latency_ns = watermarks->b.urgent_latency_ns;
239242 prog_wm_value = convert_and_clamp(watermarks->b.urgent_latency_ns,
240− refclk_mhz, 0x1fffff);
243+ refclk_mhz, 0x3fff);
241244 REG_SET(DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_B, 0,
242245 DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_B, prog_wm_value);
243246 } else if (watermarks->b.urgent_latency_ns < hubbub2->watermarks.b.urgent_latency_ns)
@@ -247,7 +250,7 @@ static bool hubbub31_program_urgent_watermarks( · 3 unmodified lines
247250 if (safe_to_lower || watermarks->c.urgent_ns > hubbub2->watermarks.c.urgent_ns) {
248251 hubbub2->watermarks.c.urgent_ns = watermarks->c.urgent_ns;
249252 prog_wm_value = convert_and_clamp(watermarks->c.urgent_ns,
250− refclk_mhz, 0x1fffff);
253+ refclk_mhz, 0x3fff);
251254 REG_SET(DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C, 0,
252255 DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C, prog_wm_value);
253256
@@ -281,7 +284,7 @@ static bool hubbub31_program_urgent_watermarks( · 27 unmodified lines
281284 if (safe_to_lower || watermarks->c.urgent_latency_ns > hubbub2->watermarks.c.urgent_latency_ns) {
282285 hubbub2->watermarks.c.urgent_latency_ns = watermarks->c.urgent_latency_ns;
283286 prog_wm_value = convert_and_clamp(watermarks->c.urgent_latency_ns,
284− refclk_mhz, 0x1fffff);
287+ refclk_mhz, 0x3fff);
285288 REG_SET(DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_C, 0,
286289 DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_C, prog_wm_value);
287290 } else if (watermarks->c.urgent_latency_ns < hubbub2->watermarks.c.urgent_latency_ns)
@@ -291,7 +294,7 @@ static bool hubbub31_program_urgent_watermarks( · 3 unmodified lines
291294 if (safe_to_lower || watermarks->d.urgent_ns > hubbub2->watermarks.d.urgent_ns) {
292295 hubbub2->watermarks.d.urgent_ns = watermarks->d.urgent_ns;
293296 prog_wm_value = convert_and_clamp(watermarks->d.urgent_ns,
294− refclk_mhz, 0x1fffff);
297+ refclk_mhz, 0x3fff);
295298 REG_SET(DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D, 0,
296299 DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D, prog_wm_value);
297300
@@ -325,7 +328,7 @@ static bool hubbub31_program_urgent_watermarks( · 27 unmodified lines
325328 if (safe_to_lower || watermarks->d.urgent_latency_ns > hubbub2->watermarks.d.urgent_latency_ns) {
326329 hubbub2->watermarks.d.urgent_latency_ns = watermarks->d.urgent_latency_ns;
327330 prog_wm_value = convert_and_clamp(watermarks->d.urgent_latency_ns,
328− refclk_mhz, 0x1fffff);
331+ refclk_mhz, 0x3fff);
329332 REG_SET(DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_D, 0,
330333 DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_D, prog_wm_value);
331334 } else if (watermarks->d.urgent_latency_ns < hubbub2->watermarks.d.urgent_latency_ns)
@@ -351,7 +354,7 @@ static bool hubbub31_program_stutter_watermarks( · 19 unmodified lines
351354 watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns;
352355 prog_wm_value = convert_and_clamp(
353356 watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns,
354− refclk_mhz, 0x1fffff);
357+ refclk_mhz, 0xffff);
355358 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A, 0,
356359 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A, prog_wm_value);
357360 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_A calculated =%d\n"
@@ -367,7 +370,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
367370 watermarks->a.cstate_pstate.cstate_exit_ns;
368371 prog_wm_value = convert_and_clamp(
369372 watermarks->a.cstate_pstate.cstate_exit_ns,
370− refclk_mhz, 0x1fffff);
373+ refclk_mhz, 0xffff);
371374 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A, 0,
372375 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A, prog_wm_value);
373376 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_A calculated =%d\n"
@@ -383,7 +386,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
383386 watermarks->a.cstate_pstate.cstate_enter_plus_exit_z8_ns;
384387 prog_wm_value = convert_and_clamp(
385388 watermarks->a.cstate_pstate.cstate_enter_plus_exit_z8_ns,
386− refclk_mhz, 0x1fffff);
389+ refclk_mhz, 0xffff);
387390 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A, 0,
388391 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A, prog_wm_value);
389392 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_A calculated =%d\n"
@@ -399,7 +402,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
399402 watermarks->a.cstate_pstate.cstate_exit_z8_ns;
400403 prog_wm_value = convert_and_clamp(
401404 watermarks->a.cstate_pstate.cstate_exit_z8_ns,
402− refclk_mhz, 0x1fffff);
405+ refclk_mhz, 0xffff);
403406 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_A, 0,
404407 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_A, prog_wm_value);
405408 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_A calculated =%d\n"
@@ -416,7 +419,7 @@ static bool hubbub31_program_stutter_watermarks( · 10 unmodified lines
416419 watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns;
417420 prog_wm_value = convert_and_clamp(
418421 watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns,
419− refclk_mhz, 0x1fffff);
422+ refclk_mhz, 0xffff);
420423 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B, 0,
421424 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B, prog_wm_value);
422425 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_B calculated =%d\n"
@@ -432,7 +435,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
432435 watermarks->b.cstate_pstate.cstate_exit_ns;
433436 prog_wm_value = convert_and_clamp(
434437 watermarks->b.cstate_pstate.cstate_exit_ns,
435− refclk_mhz, 0x1fffff);
438+ refclk_mhz, 0xffff);
436439 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B, 0,
437440 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B, prog_wm_value);
438441 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_B calculated =%d\n"
@@ -448,7 +451,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
448451 watermarks->b.cstate_pstate.cstate_enter_plus_exit_z8_ns;
449452 prog_wm_value = convert_and_clamp(
450453 watermarks->b.cstate_pstate.cstate_enter_plus_exit_z8_ns,
451− refclk_mhz, 0x1fffff);
454+ refclk_mhz, 0xffff);
452455 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_B, 0,
453456 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_B, prog_wm_value);
454457 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_B calculated =%d\n"
@@ -464,7 +467,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
464467 watermarks->b.cstate_pstate.cstate_exit_z8_ns;
465468 prog_wm_value = convert_and_clamp(
466469 watermarks->b.cstate_pstate.cstate_exit_z8_ns,
467− refclk_mhz, 0x1fffff);
470+ refclk_mhz, 0xffff);
468471 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_B, 0,
469472 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_B, prog_wm_value);
470473 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_B calculated =%d\n"
@@ -481,7 +484,7 @@ static bool hubbub31_program_stutter_watermarks( · 10 unmodified lines
481484 watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns;
482485 prog_wm_value = convert_and_clamp(
483486 watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns,
484− refclk_mhz, 0x1fffff);
487+ refclk_mhz, 0xffff);
485488 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C, 0,
486489 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C, prog_wm_value);
487490 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_C calculated =%d\n"
@@ -497,7 +500,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
497500 watermarks->c.cstate_pstate.cstate_exit_ns;
498501 prog_wm_value = convert_and_clamp(
499502 watermarks->c.cstate_pstate.cstate_exit_ns,
500− refclk_mhz, 0x1fffff);
503+ refclk_mhz, 0xffff);
501504 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C, 0,
502505 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C, prog_wm_value);
503506 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_C calculated =%d\n"
@@ -513,7 +516,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
513516 watermarks->c.cstate_pstate.cstate_enter_plus_exit_z8_ns;
514517 prog_wm_value = convert_and_clamp(
515518 watermarks->c.cstate_pstate.cstate_enter_plus_exit_z8_ns,
516− refclk_mhz, 0x1fffff);
519+ refclk_mhz, 0xffff);
517520 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_C, 0,
518521 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_C, prog_wm_value);
519522 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_C calculated =%d\n"
@@ -529,7 +532,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
529532 watermarks->c.cstate_pstate.cstate_exit_z8_ns;
530533 prog_wm_value = convert_and_clamp(
531534 watermarks->c.cstate_pstate.cstate_exit_z8_ns,
532− refclk_mhz, 0x1fffff);
535+ refclk_mhz, 0xffff);
533536 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_C, 0,
534537 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_C, prog_wm_value);
535538 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_C calculated =%d\n"
@@ -546,7 +549,7 @@ static bool hubbub31_program_stutter_watermarks( · 10 unmodified lines
546549 watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns;
547550 prog_wm_value = convert_and_clamp(
548551 watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns,
549− refclk_mhz, 0x1fffff);
552+ refclk_mhz, 0xffff);
550553 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D, 0,
551554 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D, prog_wm_value);
552555 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_D calculated =%d\n"
@@ -562,7 +565,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
562565 watermarks->d.cstate_pstate.cstate_exit_ns;
563566 prog_wm_value = convert_and_clamp(
564567 watermarks->d.cstate_pstate.cstate_exit_ns,
565− refclk_mhz, 0x1fffff);
568+ refclk_mhz, 0xffff);
566569 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D, 0,
567570 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D, prog_wm_value);
568571 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_D calculated =%d\n"
@@ -578,7 +581,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
578581 watermarks->d.cstate_pstate.cstate_enter_plus_exit_z8_ns;
579582 prog_wm_value = convert_and_clamp(
580583 watermarks->d.cstate_pstate.cstate_enter_plus_exit_z8_ns,
581− refclk_mhz, 0x1fffff);
584+ refclk_mhz, 0xffff);
582585 REG_SET(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_D, 0,
583586 DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_D, prog_wm_value);
584587 DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_D calculated =%d\n"
@@ -594,7 +597,7 @@ static bool hubbub31_program_stutter_watermarks( · 9 unmodified lines
594597 watermarks->d.cstate_pstate.cstate_exit_z8_ns;
595598 prog_wm_value = convert_and_clamp(
596599 watermarks->d.cstate_pstate.cstate_exit_z8_ns,
597− refclk_mhz, 0x1fffff);
600+ refclk_mhz, 0xffff);
598601 REG_SET(DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_D, 0,
599602 DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_D, prog_wm_value);
600603 DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_D calculated =%d\n"
@@ -625,7 +628,7 @@ static bool hubbub31_program_pstate_watermarks( · 24 unmodified lines
625628 watermarks->a.cstate_pstate.pstate_change_ns;
626629 prog_wm_value = convert_and_clamp(
627630 watermarks->a.cstate_pstate.pstate_change_ns,
628− refclk_mhz, 0x1fffff);
631+ refclk_mhz, 0xffff);
629632 REG_SET(DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A, 0,
630633 DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A, prog_wm_value);
631634 DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_A calculated =%d\n"
@@ -642,7 +645,7 @@ static bool hubbub31_program_pstate_watermarks( · 10 unmodified lines
642645 watermarks->b.cstate_pstate.pstate_change_ns;
643646 prog_wm_value = convert_and_clamp(
644647 watermarks->b.cstate_pstate.pstate_change_ns,
645− refclk_mhz, 0x1fffff);
648+ refclk_mhz, 0xffff);
646649 REG_SET(DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B, 0,
647650 DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B, prog_wm_value);
648651 DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_B calculated =%d\n"
@@ -659,7 +662,7 @@ static bool hubbub31_program_pstate_watermarks( · 10 unmodified lines
659662 watermarks->c.cstate_pstate.pstate_change_ns;
660663 prog_wm_value = convert_and_clamp(
661664 watermarks->c.cstate_pstate.pstate_change_ns,
662− refclk_mhz, 0x1fffff);
665+ refclk_mhz, 0xffff);
663666 REG_SET(DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C, 0,
664667 DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C, prog_wm_value);
665668 DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_C calculated =%d\n"
@@ -676,7 +679,7 @@ static bool hubbub31_program_pstate_watermarks( · 10 unmodified lines
676679 watermarks->d.cstate_pstate.pstate_change_ns;
677680 prog_wm_value = convert_and_clamp(
678681 watermarks->d.cstate_pstate.pstate_change_ns,
679− refclk_mhz, 0x1fffff);
682+ refclk_mhz, 0xffff);
680683 REG_SET(DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D, 0,
681684 DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D, prog_wm_value);
682685 DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_D calculated =%d\n"
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c+3−0
@@ -2260,6 +2260,9 @@ static bool dcn31_resource_construct( · 2259 unmodified lines
22602260 dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
22612261 dc->caps.color.mpc.ocsc = 1;
22622262
2263+ /* Use pipe context based otg sync logic */
2264+ dc->config.use_pipe_ctx_sync_logic = true;
2265+
22632266 /* read VBIOS LTTPR caps */
22642267 {
22652268 if (ctx->dc_bios->funcs->get_lttpr_caps) {
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c+0−2
@@ -1576,8 +1576,6 @@ void dml20_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib, · 1575 unmodified lines
15761576 dlg_sys_param.total_flip_bytes = get_total_immediate_flip_bytes(mode_lib,
15771577 e2e_pipe_param,
15781578 num_pipes);
1579− dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
1580− / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
15811579
15821580 print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
15831581
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c+0−2
@@ -1577,8 +1577,6 @@ void dml20v2_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib, · 1576 unmodified lines
15771577 dlg_sys_param.total_flip_bytes = get_total_immediate_flip_bytes(mode_lib,
15781578 e2e_pipe_param,
15791579 num_pipes);
1580− dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
1581− / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
15821580
15831581 print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
15841582
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c+0−2
@@ -1688,8 +1688,6 @@ void dml21_rq_dlg_get_dlg_reg( · 1687 unmodified lines
16881688 mode_lib,
16891689 e2e_pipe_param,
16901690 num_pipes);
1691− dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
1692− / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
16931691
16941692 print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
16951693
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c+0−2
@@ -1858,8 +1858,6 @@ void dml30_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib, · 1857 unmodified lines
18581858 dlg_sys_param.total_flip_bytes = get_total_immediate_flip_bytes(mode_lib,
18591859 e2e_pipe_param,
18601860 num_pipes);
1861− dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
1862− / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
18631861
18641862 print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
18651863
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c+1−1
@@ -327,7 +327,7 @@ void dcn301_fpu_init_soc_bounding_box(struct bp_soc_bb_info bb_info) · 326 unmodified lines
327327 dcn3_01_soc.sr_exit_time_us = bb_info.dram_sr_exit_latency_100ns * 10;
328328 }
329329
330−void dcn301_calculate_wm_and_dlg(struct dc *dc,
330+void dcn301_calculate_wm_and_dlg_fp(struct dc *dc,
331331 struct dc_state *context,
332332 display_e2e_pipe_params_st *pipes,
333333 int pipe_cnt,
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h+1−1
@@ -34,7 +34,7 @@ void dcn301_fpu_set_wm_ranges(int i, · 33 unmodified lines
3434
3535 void dcn301_fpu_init_soc_bounding_box(struct bp_soc_bb_info bb_info);
3636
37−void dcn301_calculate_wm_and_dlg(struct dc *dc,
37+void dcn301_calculate_wm_and_dlg_fp(struct dc *dc,
3838 struct dc_state *context,
3939 display_e2e_pipe_params_st *pipes,
4040 int pipe_cnt,
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h+0−1
@@ -546,7 +546,6 @@ struct _vcs_dpi_display_dlg_sys_params_st { · 545 unmodified lines
546546 double t_sr_wm_us;
547547 double t_extra_us;
548548 double mem_trip_us;
549− double t_srx_delay_us;
550549 double deepsleep_dcfclk_mhz;
551550 double total_flip_bw;
552551 unsigned int total_flip_bytes;
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_helpers.c+0−3
@@ -141,9 +141,6 @@ void print__dlg_sys_params_st(struct display_mode_lib *mode_lib, const struct _v · 140 unmodified lines
141141 dml_print("DML_RQ_DLG_CALC: t_urg_wm_us = %3.2f\n", dlg_sys_param->t_urg_wm_us);
142142 dml_print("DML_RQ_DLG_CALC: t_sr_wm_us = %3.2f\n", dlg_sys_param->t_sr_wm_us);
143143 dml_print("DML_RQ_DLG_CALC: t_extra_us = %3.2f\n", dlg_sys_param->t_extra_us);
144− dml_print(
145− "DML_RQ_DLG_CALC: t_srx_delay_us = %3.2f\n",
146− dlg_sys_param->t_srx_delay_us);
147144 dml_print(
148145 "DML_RQ_DLG_CALC: deepsleep_dcfclk_mhz = %3.2f\n",
149146 dlg_sys_param->deepsleep_dcfclk_mhz);
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c+0−4
@@ -1331,10 +1331,6 @@ void dml1_rq_dlg_get_dlg_params( · 1330 unmodified lines
13311331 if (dual_plane)
13321332 DTRACE("DLG: %s: swath_height_c = %d", __func__, swath_height_c);
13331333
1334− DTRACE(
1335− "DLG: %s: t_srx_delay_us = %3.2f",
1336− __func__,
1337− (double) dlg_sys_param->t_srx_delay_us);
13381334 DTRACE("DLG: %s: line_time_in_us = %3.2f", __func__, (double) line_time_in_us);
13391335 DTRACE("DLG: %s: vupdate_offset = %d", __func__, vupdate_offset);
13401336 DTRACE("DLG: %s: vupdate_width = %d", __func__, vupdate_width);
drivers/gpu/drm/amd/display/dc/inc/core_types.h+1−0
@@ -382,6 +382,7 @@ struct pipe_ctx { · 381 unmodified lines
382382 struct pll_settings pll_settings;
383383
384384 uint8_t pipe_idx;
385+ uint8_t pipe_idx_syncd;
385386
386387 struct pipe_ctx *top_pipe;
387388 struct pipe_ctx *bottom_pipe;
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h+0−4
@@ -164,10 +164,6 @@ struct stream_encoder_funcs { · 163 unmodified lines
164164 void (*stop_dp_info_packets)(
165165 struct stream_encoder *enc);
166166
167− void (*reset_fifo)(
168− struct stream_encoder *enc
169− );
170−
171167 void (*dp_blank)(
172168 struct dc_link *link,
173169 struct stream_encoder *enc);
drivers/gpu/drm/amd/display/dc/inc/resource.h+11−0
@@ -34,6 +34,10 @@ · 33 unmodified lines
3434 #define MEMORY_TYPE_HBM 2
3535
3636
37+#define IS_PIPE_SYNCD_VALID(pipe) ((((pipe)->pipe_idx_syncd) & 0x80)?1:0)
38+#define GET_PIPE_SYNCD_FROM_PIPE(pipe) ((pipe)->pipe_idx_syncd & 0x7F)
39+#define SET_PIPE_SYNCD_TO_PIPE(pipe, pipe_syncd) ((pipe)->pipe_idx_syncd = (0x80 | pipe_syncd))
40+
3741 enum dce_version resource_parse_asic_id(
3842 struct hw_asic_id asic_id);
3943
@@ -208,6 +212,13 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt( · 168 unmodified lines
208212 const struct dc_link *link);
209213 #endif
210214
215+void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
216+ struct dc_state *context);
217+
218+void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
219+ struct dc_state *context,
220+ uint8_t disabled_master_pipe_idx);
221+
211222 uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter);
212223
213224 #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
drivers/gpu/drm/amd/pm/amdgpu_pm.c+1−2
@@ -3462,8 +3462,7 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, · 3461 unmodified lines
34623462 attr == &sensor_dev_attr_power2_cap_min.dev_attr.attr ||
34633463 attr == &sensor_dev_attr_power2_cap.dev_attr.attr ||
34643464 attr == &sensor_dev_attr_power2_cap_default.dev_attr.attr ||
3465− attr == &sensor_dev_attr_power2_label.dev_attr.attr ||
3466− attr == &sensor_dev_attr_power1_label.dev_attr.attr))
3465+ attr == &sensor_dev_attr_power2_label.dev_attr.attr))
34673466 return 0;
34683467
34693468 return effective_mode;
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c+24−8
@@ -1238,21 +1238,37 @@ static int sienna_cichlid_populate_umd_state_clk(struct smu_context *smu) · 1237 unmodified lines
12381238 &dpm_context->dpm_tables.soc_table;
12391239 struct smu_umd_pstate_table *pstate_table =
12401240 &smu->pstate_table;
1241+ struct amdgpu_device *adev = smu->adev;
12411242
12421243 pstate_table->gfxclk_pstate.min = gfx_table->min;
12431244 pstate_table->gfxclk_pstate.peak = gfx_table->max;
1244− if (gfx_table->max >= SIENNA_CICHLID_UMD_PSTATE_PROFILING_GFXCLK)
1245− pstate_table->gfxclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_GFXCLK;
12461245
12471246 pstate_table->uclk_pstate.min = mem_table->min;
12481247 pstate_table->uclk_pstate.peak = mem_table->max;
1249− if (mem_table->max >= SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK)
1250− pstate_table->uclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK;
12511248
12521249 pstate_table->socclk_pstate.min = soc_table->min;
12531250 pstate_table->socclk_pstate.peak = soc_table->max;
1254− if (soc_table->max >= SIENNA_CICHLID_UMD_PSTATE_PROFILING_SOCCLK)
1251+
1252+ switch (adev->asic_type) {
1253+ case CHIP_SIENNA_CICHLID:
1254+ case CHIP_NAVY_FLOUNDER:
1255+ pstate_table->gfxclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_GFXCLK;
1256+ pstate_table->uclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK;
12551257 pstate_table->socclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_SOCCLK;
1258+ break;
1259+ case CHIP_DIMGREY_CAVEFISH:
1260+ pstate_table->gfxclk_pstate.standard = DIMGREY_CAVEFISH_UMD_PSTATE_PROFILING_GFXCLK;
1261+ pstate_table->uclk_pstate.standard = DIMGREY_CAVEFISH_UMD_PSTATE_PROFILING_MEMCLK;
1262+ pstate_table->socclk_pstate.standard = DIMGREY_CAVEFISH_UMD_PSTATE_PROFILING_SOCCLK;
1263+ break;
1264+ case CHIP_BEIGE_GOBY:
1265+ pstate_table->gfxclk_pstate.standard = BEIGE_GOBY_UMD_PSTATE_PROFILING_GFXCLK;
1266+ pstate_table->uclk_pstate.standard = BEIGE_GOBY_UMD_PSTATE_PROFILING_MEMCLK;
1267+ pstate_table->socclk_pstate.standard = BEIGE_GOBY_UMD_PSTATE_PROFILING_SOCCLK;
1268+ break;
1269+ default:
1270+ break;
1271+ }
12561272
12571273 return 0;
12581274 }
@@ -3696,14 +3712,14 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu, · 2437 unmodified lines
36963712
36973713 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)
36983714 {
3699− struct smu_table_context *table_context = &smu->smu_table;
3700− PPTable_t *smc_pptable = table_context->driver_pptable;
3715+ uint16_t *mgpu_fan_boost_limit_rpm;
37013716
3717+ GET_PPTABLE_MEMBER(MGpuFanBoostLimitRpm, &mgpu_fan_boost_limit_rpm);
37023718 /*
37033719 * Skip the MGpuFanBoost setting for those ASICs
37043720 * which do not support it
37053721 */
3706− if (!smc_pptable->MGpuFanBoostLimitRpm)
3722+ if (*mgpu_fan_boost_limit_rpm == 0)
37073723 return 0;
37083724
37093725 return smu_cmn_send_smc_msg_with_param(smu,
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h+8−0
@@ -33,6 +33,14 @@ typedef enum { · 32 unmodified lines
3333 #define SIENNA_CICHLID_UMD_PSTATE_PROFILING_SOCCLK 960
3434 #define SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK 1000
3535
36+#define DIMGREY_CAVEFISH_UMD_PSTATE_PROFILING_GFXCLK 1950
37+#define DIMGREY_CAVEFISH_UMD_PSTATE_PROFILING_SOCCLK 960
38+#define DIMGREY_CAVEFISH_UMD_PSTATE_PROFILING_MEMCLK 676
39+
40+#define BEIGE_GOBY_UMD_PSTATE_PROFILING_GFXCLK 2200
41+#define BEIGE_GOBY_UMD_PSTATE_PROFILING_SOCCLK 960
42+#define BEIGE_GOBY_UMD_PSTATE_PROFILING_MEMCLK 1000
43+
3644 extern void sienna_cichlid_set_ppt_funcs(struct smu_context *smu);
3745
3846 #endif
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c+2−7
@@ -282,14 +282,9 @@ static int yellow_carp_post_smu_init(struct smu_context *smu) · 281 unmodified lines
282282
283283 static int yellow_carp_mode_reset(struct smu_context *smu, int type)
284284 {
285− int ret = 0, index = 0;
286−
287− index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
288− SMU_MSG_GfxDeviceDriverReset);
289− if (index < 0)
290− return index == -EACCES ? 0 : index;
285+ int ret = 0;
291286
292− ret = smu_cmn_send_smc_msg_with_param(smu, (uint16_t)index, type, NULL);
287+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset, type, NULL);
293288 if (ret)
294289 dev_err(smu->adev->dev, "Failed to mode reset!\n");
295290
drivers/gpu/drm/ast/ast_tables.h+0−2
@@ -282,8 +282,6 @@ static const struct ast_vbios_enhtable res_1360x768[] = { · 281 unmodified lines
282282 };
283283
284284 static const struct ast_vbios_enhtable res_1600x900[] = {
285− {1800, 1600, 24, 80, 1000, 900, 1, 3, VCLK108, /* 60Hz */
286− (SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 3, 0x3A },
287285 {1760, 1600, 48, 32, 926, 900, 3, 5, VCLK97_75, /* 60Hz CVT RB */
288286 (SyncNP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo |
289287 AST2500PreCatchCRT), 60, 1, 0x3A },
drivers/gpu/drm/bridge/nwl-dsi.c+5−7
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 */
88
99 #include <linux/bitfield.h>
10+#include <linux/bits.h>
1011 #include <linux/clk.h>
1112 #include <linux/irq.h>
1213 #include <linux/math64.h>
@@ -196,12 +197,9 @@ static u32 ps2bc(struct nwl_dsi *dsi, unsigned long long ps) · 183 unmodified lines
196197 /*
197198 * ui2bc - UI time periods to byte clock cycles
198199 */
199−static u32 ui2bc(struct nwl_dsi *dsi, unsigned long long ui)
200+static u32 ui2bc(unsigned int ui)
200201 {
201− u32 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
202−
203− return DIV64_U64_ROUND_UP(ui * dsi->lanes,
204− dsi->mode.clock * 1000 * bpp);
202+ return DIV_ROUND_UP(ui, BITS_PER_BYTE);
205203 }
206204
207205 /*
@@ -232,12 +230,12 @@ static int nwl_dsi_config_host(struct nwl_dsi *dsi) · 24 unmodified lines
232230 }
233231
234232 /* values in byte clock cycles */
235− cycles = ui2bc(dsi, cfg->clk_pre);
233+ cycles = ui2bc(cfg->clk_pre);
236234 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_pre: 0x%x\n", cycles);
237235 nwl_dsi_write(dsi, NWL_DSI_CFG_T_PRE, cycles);
238236 cycles = ps2bc(dsi, cfg->lpx + cfg->clk_prepare + cfg->clk_zero);
239237 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_tx_gap (pre): 0x%x\n", cycles);
240− cycles += ui2bc(dsi, cfg->clk_pre);
238+ cycles += ui2bc(cfg->clk_pre);
241239 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_post: 0x%x\n", cycles);
242240 nwl_dsi_write(dsi, NWL_DSI_CFG_T_POST, cycles);
243241 cycles = ps2bc(dsi, cfg->hs_exit);
drivers/gpu/drm/drm_atomic.c+8−4
@@ -1327,8 +1327,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 1326 unmodified lines
13271327
13281328 drm_dbg_atomic(dev, "checking %p\n", state);
13291329
1330− for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
1331− requested_crtc |= drm_crtc_mask(crtc);
1330+ for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
1331+ if (new_crtc_state->enable)
1332+ requested_crtc |= drm_crtc_mask(crtc);
1333+ }
13321334
13331335 for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
13341336 ret = drm_atomic_plane_check(old_plane_state, new_plane_state);
@@ -1377,8 +1379,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 42 unmodified lines
13771379 }
13781380 }
13791381
1380− for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
1381− affected_crtc |= drm_crtc_mask(crtc);
1382+ for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
1383+ if (new_crtc_state->enable)
1384+ affected_crtc |= drm_crtc_mask(crtc);
1385+ }
13821386
13831387 /*
13841388 * For commits that allow modesets drivers can add other CRTCs to the
drivers/gpu/drm/drm_atomic_uapi.c+8−6
@@ -76,15 +76,17 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state, · 75 unmodified lines
7676 state->mode_blob = NULL;
7777
7878 if (mode) {
79+ struct drm_property_blob *blob;
80+
7981 drm_mode_convert_to_umode(&umode, mode);
80− state->mode_blob =
81− drm_property_create_blob(state->crtc->dev,
82− sizeof(umode),
83− &umode);
84− if (IS_ERR(state->mode_blob))
85− return PTR_ERR(state->mode_blob);
82+ blob = drm_property_create_blob(crtc->dev,
83+ sizeof(umode), &umode);
84+ if (IS_ERR(blob))
85+ return PTR_ERR(blob);
8686
8787 drm_mode_copy(&state->mode, mode);
88+
89+ state->mode_blob = blob;
8890 state->enable = true;
8991 drm_dbg_atomic(crtc->dev,
9092 "Set [MODE:%s] for [CRTC:%d:%s] state %p\n",
drivers/gpu/drm/drm_gem_cma_helper.c+1−0
@@ -512,6 +512,7 @@ int drm_gem_cma_mmap(struct drm_gem_cma_object *cma_obj, struct vm_area_struct * · 511 unmodified lines
512512 */
513513 vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node);
514514 vma->vm_flags &= ~VM_PFNMAP;
515+ vma->vm_flags |= VM_DONTEXPAND;
515516
516517 if (cma_obj->map_noncoherent) {
517518 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
drivers/gpu/drm/drm_panel_orientation_quirks.c+12−0
@@ -115,6 +115,12 @@ static const struct drm_dmi_panel_orientation_data lcd1280x1920_rightside_up = { · 114 unmodified lines
115115 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
116116 };
117117
118+static const struct drm_dmi_panel_orientation_data lcd1600x2560_leftside_up = {
119+ .width = 1600,
120+ .height = 2560,
121+ .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP,
122+};
123+
118124 static const struct dmi_system_id orientation_data[] = {
119125 { /* Acer One 10 (S1003) */
120126 .matches = {
@@ -275,6 +281,12 @@ static const struct dmi_system_id orientation_data[] = { · 154 unmodified lines
275281 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Default string"),
276282 },
277283 .driver_data = (void *)&onegx1_pro,
284+ }, { /* OneXPlayer */
285+ .matches = {
286+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONE-NETBOOK TECHNOLOGY CO., LTD."),
287+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"),
288+ },
289+ .driver_data = (void *)&lcd1600x2560_leftside_up,
278290 }, { /* Samsung GalaxyBook 10.6 */
279291 .matches = {
280292 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
drivers/gpu/drm/drm_privacy_screen.c+1−1
@@ -269,7 +269,7 @@ EXPORT_SYMBOL(drm_privacy_screen_get_state); · 268 unmodified lines
269269 *
270270 * The notifier is called with no locks held. The new hw_state and sw_state
271271 * can be retrieved using the drm_privacy_screen_get_state() function.
272− * A pointer to the drm_privacy_screen's struct is passed as the void *data
272+ * A pointer to the drm_privacy_screen's struct is passed as the ``void *data``
273273 * argument of the notifier_block's notifier_call.
274274 *
275275 * The notifier will NOT be called when changes are made through
drivers/gpu/drm/drm_privacy_screen_x86.c+3−0
@@ -33,6 +33,9 @@ static bool __init detect_thinkpad_privacy_screen(void) · 32 unmodified lines
3333 unsigned long long output;
3434 acpi_status status;
3535
36+ if (acpi_disabled)
37+ return false;
38+
3639 /* Get embedded-controller handle */
3740 status = acpi_get_devices("PNP0C09", acpi_set_handle, NULL, &ec_handle);
3841 if (ACPI_FAILURE(status) || !ec_handle)
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c+2−2
@@ -469,8 +469,8 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data, · 468 unmodified lines
469469 return -EINVAL;
470470 }
471471
472− if (args->stream_size > SZ_64K || args->nr_relocs > SZ_64K ||
473− args->nr_bos > SZ_64K || args->nr_pmrs > 128) {
472+ if (args->stream_size > SZ_128K || args->nr_relocs > SZ_128K ||
473+ args->nr_bos > SZ_128K || args->nr_pmrs > 128) {
474474 DRM_ERROR("submit arguments out of size limits\n");
475475 return -EINVAL;
476476 }
drivers/gpu/drm/i915/Kconfig+1−0
@@ -101,6 +101,7 @@ config DRM_I915_USERPTR · 100 unmodified lines
101101 config DRM_I915_GVT
102102 bool "Enable Intel GVT-g graphics virtualization host support"
103103 depends on DRM_I915
104+ depends on X86
104105 depends on 64BIT
105106 default n
106107 help
drivers/gpu/drm/i915/display/intel_display.c+1−0
@@ -10673,6 +10673,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev, · 10672 unmodified lines
1067310673 vlv_wm_sanitize(dev_priv);
1067410674 } else if (DISPLAY_VER(dev_priv) >= 9) {
1067510675 skl_wm_get_hw_state(dev_priv);
10676+ skl_wm_sanitize(dev_priv);
1067610677 } else if (HAS_PCH_SPLIT(dev_priv)) {
1067710678 ilk_wm_get_hw_state(dev_priv);
1067810679 }
drivers/gpu/drm/i915/display/intel_drrs.c+8−0
@@ -405,6 +405,7 @@ intel_drrs_init(struct intel_connector *connector, · 404 unmodified lines
405405 struct drm_display_mode *fixed_mode)
406406 {
407407 struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
408+ struct intel_encoder *encoder = connector->encoder;
408409 struct drm_display_mode *downclock_mode = NULL;
409410
410411 INIT_DELAYED_WORK(&dev_priv->drrs.work, intel_drrs_downclock_work);
@@ -416,6 +417,13 @@ intel_drrs_init(struct intel_connector *connector, · 5 unmodified lines
416417 return NULL;
417418 }
418419
420+ if ((DISPLAY_VER(dev_priv) < 8 && !HAS_GMCH(dev_priv)) &&
421+ encoder->port != PORT_A) {
422+ drm_dbg_kms(&dev_priv->drm,
423+ "DRRS only supported on eDP port A\n");
424+ return NULL;
425+ }
426+
419427 if (dev_priv->vbt.drrs_type != SEAMLESS_DRRS_SUPPORT) {
420428 drm_dbg_kms(&dev_priv->drm, "VBT doesn't support DRRS\n");
421429 return NULL;
drivers/gpu/drm/i915/display/intel_fbc.c+2−1
@@ -1115,7 +1115,8 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state, · 1114 unmodified lines
11151115
11161116 /* Wa_22010751166: icl, ehl, tgl, dg1, rkl */
11171117 if (DISPLAY_VER(i915) >= 11 &&
1118− (plane_state->view.color_plane[0].y + drm_rect_height(&plane_state->uapi.src)) & 3) {
1118+ (plane_state->view.color_plane[0].y +
1119+ (drm_rect_height(&plane_state->uapi.src) >> 16)) & 3) {
11191120 plane_state->no_fbc_reason = "plane end Y offset misaligned";
11201121 return false;
11211122 }
drivers/gpu/drm/i915/display/intel_opregion.c+15−0
@@ -360,6 +360,21 @@ int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, · 359 unmodified lines
360360 port++;
361361 }
362362
363+ /*
364+ * The port numbering and mapping here is bizarre. The now-obsolete
365+ * swsci spec supports ports numbered [0..4]. Port E is handled as a
366+ * special case, but port F and beyond are not. The functionality is
367+ * supposed to be obsolete for new platforms. Just bail out if the port
368+ * number is out of bounds after mapping.
369+ */
370+ if (port > 4) {
371+ drm_dbg_kms(&dev_priv->drm,
372+ "[ENCODER:%d:%s] port %c (index %u) out of bounds for display power state notification\n",
373+ intel_encoder->base.base.id, intel_encoder->base.name,
374+ port_name(intel_encoder->port), port);
375+ return -EINVAL;
376+ }
377+
363378 if (!enable)
364379 parm |= 4 << 8;
365380
drivers/gpu/drm/i915/display/intel_overlay.c+3−0
@@ -959,6 +959,9 @@ static int check_overlay_dst(struct intel_overlay *overlay, · 958 unmodified lines
959959 const struct intel_crtc_state *pipe_config =
960960 overlay->crtc->config;
961961
962+ if (rec->dst_height == 0 || rec->dst_width == 0)
963+ return -EINVAL;
964+
962965 if (rec->dst_x < pipe_config->pipe_src_w &&
963966 rec->dst_x + rec->dst_width <= pipe_config->pipe_src_w &&
964967 rec->dst_y < pipe_config->pipe_src_h &&
drivers/gpu/drm/i915/display/intel_tc.c+2−1
@@ -345,10 +345,11 @@ static bool icl_tc_phy_status_complete(struct intel_digital_port *dig_port) · 344 unmodified lines
345345 static bool adl_tc_phy_status_complete(struct intel_digital_port *dig_port)
346346 {
347347 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
348+ enum tc_port tc_port = intel_port_to_tc(i915, dig_port->base.port);
348349 struct intel_uncore *uncore = &i915->uncore;
349350 u32 val;
350351
351− val = intel_uncore_read(uncore, TCSS_DDI_STATUS(dig_port->tc_phy_fia_idx));
352+ val = intel_uncore_read(uncore, TCSS_DDI_STATUS(tc_port));
352353 if (val == 0xffffffff) {
353354 drm_dbg_kms(&i915->drm,
354355 "Port %s: PHY in TCCOLD, assuming not complete\n",
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+7−2
@@ -2505,9 +2505,14 @@ static int eb_pin_timeline(struct i915_execbuffer *eb, struct intel_context *ce, · 2504 unmodified lines
25052505 timeout) < 0) {
25062506 i915_request_put(rq);
25072507
2508− tl = intel_context_timeline_lock(ce);
2508+ /*
2509+ * Error path, cannot use intel_context_timeline_lock as
2510+ * that is user interruptable and this clean up step
2511+ * must be done.
2512+ */
2513+ mutex_lock(&ce->timeline->mutex);
25092514 intel_context_exit(ce);
2510− intel_context_timeline_unlock(tl);
2515+ mutex_unlock(&ce->timeline->mutex);
25112516
25122517 if (nonblock)
25132518 return -EWOULDBLOCK;
drivers/gpu/drm/i915/gem/i915_gem_object_types.h+1−0
@@ -311,6 +311,7 @@ struct drm_i915_gem_object { · 310 unmodified lines
311311 #define I915_BO_READONLY BIT(6)
312312 #define I915_TILING_QUIRK_BIT 7 /* unknown swizzling; do not release! */
313313 #define I915_BO_PROTECTED BIT(8)
314+#define I915_BO_WAS_BOUND_BIT 9
314315 /**
315316 * @mem_flags - Mutable placement-related flags
316317 *
drivers/gpu/drm/i915/gem/i915_gem_pages.c+10−0
@@ -10,6 +10,8 @@ · 9 unmodified lines
1010 #include "i915_gem_lmem.h"
1111 #include "i915_gem_mman.h"
1212
13+#include "gt/intel_gt.h"
14+
1315 void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
1416 struct sg_table *pages,
1517 unsigned int sg_page_sizes)
@@ -221,6 +223,14 @@ __i915_gem_object_unset_pages(struct drm_i915_gem_object *obj) · 205 unmodified lines
221223 __i915_gem_object_reset_page_iter(obj);
222224 obj->mm.page_sizes.phys = obj->mm.page_sizes.sg = 0;
223225
226+ if (test_and_clear_bit(I915_BO_WAS_BOUND_BIT, &obj->flags)) {
227+ struct drm_i915_private *i915 = to_i915(obj->base.dev);
228+ intel_wakeref_t wakeref;
229+
230+ with_intel_runtime_pm_if_active(&i915->runtime_pm, wakeref)
231+ intel_gt_invalidate_tlbs(to_gt(i915));
232+ }
233+
224234 return pages;
225235 }
226236
drivers/gpu/drm/i915/gem/i915_gem_ttm.c+2−4
@@ -842,11 +842,9 @@ void i915_ttm_adjust_lru(struct drm_i915_gem_object *obj) · 841 unmodified lines
842842 } else if (obj->mm.madv != I915_MADV_WILLNEED) {
843843 bo->priority = I915_TTM_PRIO_PURGE;
844844 } else if (!i915_gem_object_has_pages(obj)) {
845− if (bo->priority < I915_TTM_PRIO_HAS_PAGES)
846− bo->priority = I915_TTM_PRIO_HAS_PAGES;
845+ bo->priority = I915_TTM_PRIO_NO_PAGES;
847846 } else {
848− if (bo->priority > I915_TTM_PRIO_NO_PAGES)
849− bo->priority = I915_TTM_PRIO_NO_PAGES;
847+ bo->priority = I915_TTM_PRIO_HAS_PAGES;
850848 }
851849
852850 ttm_bo_move_to_lru_tail(bo, bo->resource, NULL);
drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c+10−4
@@ -427,11 +427,17 @@ __i915_ttm_move(struct ttm_buffer_object *bo, · 426 unmodified lines
427427
428428 if (!IS_ERR(fence))
429429 goto out;
430− } else if (move_deps) {
431− int err = i915_deps_sync(move_deps, ctx);
430+ } else {
431+ int err = PTR_ERR(fence);
432+
433+ if (err == -EINTR || err == -ERESTARTSYS || err == -EAGAIN)
434+ return fence;
432435
433− if (err)
434− return ERR_PTR(err);
436+ if (move_deps) {
437+ err = i915_deps_sync(move_deps, ctx);
438+ if (err)
439+ return ERR_PTR(err);
440+ }
435441 }
436442
437443 /* Error intercept failed or no accelerated migration to start with */
drivers/gpu/drm/i915/gt/intel_gt.c+108−0
@@ -29,6 +29,8 @@ void __intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915) · 28 unmodified lines
2929 {
3030 spin_lock_init(&gt->irq_lock);
3131
32+ mutex_init(&gt->tlb_invalidate_lock);
33+
3234 INIT_LIST_HEAD(&gt->closed_vma);
3335 spin_lock_init(&gt->closed_lock);
3436
@@ -912,3 +914,109 @@ void intel_gt_info_print(const struct intel_gt_info *info, · 877 unmodified lines
912914
913915 intel_sseu_dump(&info->sseu, p);
914916 }
917+
918+struct reg_and_bit {
919+ i915_reg_t reg;
920+ u32 bit;
921+};
922+
923+static struct reg_and_bit
924+get_reg_and_bit(const struct intel_engine_cs *engine, const bool gen8,
925+ const i915_reg_t *regs, const unsigned int num)
926+{
927+ const unsigned int class = engine->class;
928+ struct reg_and_bit rb = { };
929+
930+ if (drm_WARN_ON_ONCE(&engine->i915->drm,
931+ class >= num || !regs[class].reg))
932+ return rb;
933+
934+ rb.reg = regs[class];
935+ if (gen8 && class == VIDEO_DECODE_CLASS)
936+ rb.reg.reg += 4 * engine->instance; /* GEN8_M2TCR */
937+ else
938+ rb.bit = engine->instance;
939+
940+ rb.bit = BIT(rb.bit);
941+
942+ return rb;
943+}
944+
945+void intel_gt_invalidate_tlbs(struct intel_gt *gt)
946+{
947+ static const i915_reg_t gen8_regs[] = {
948+ [RENDER_CLASS] = GEN8_RTCR,
949+ [VIDEO_DECODE_CLASS] = GEN8_M1TCR, /* , GEN8_M2TCR */
950+ [VIDEO_ENHANCEMENT_CLASS] = GEN8_VTCR,
951+ [COPY_ENGINE_CLASS] = GEN8_BTCR,
952+ };
953+ static const i915_reg_t gen12_regs[] = {
954+ [RENDER_CLASS] = GEN12_GFX_TLB_INV_CR,
955+ [VIDEO_DECODE_CLASS] = GEN12_VD_TLB_INV_CR,
956+ [VIDEO_ENHANCEMENT_CLASS] = GEN12_VE_TLB_INV_CR,
957+ [COPY_ENGINE_CLASS] = GEN12_BLT_TLB_INV_CR,
958+ };
959+ struct drm_i915_private *i915 = gt->i915;
960+ struct intel_uncore *uncore = gt->uncore;
961+ struct intel_engine_cs *engine;
962+ enum intel_engine_id id;
963+ const i915_reg_t *regs;
964+ unsigned int num = 0;
965+
966+ if (I915_SELFTEST_ONLY(gt->awake == -ENODEV))
967+ return;
968+
969+ if (GRAPHICS_VER(i915) == 12) {
970+ regs = gen12_regs;
971+ num = ARRAY_SIZE(gen12_regs);
972+ } else if (GRAPHICS_VER(i915) >= 8 && GRAPHICS_VER(i915) <= 11) {
973+ regs = gen8_regs;
974+ num = ARRAY_SIZE(gen8_regs);
975+ } else if (GRAPHICS_VER(i915) < 8) {
976+ return;
977+ }
978+
979+ if (drm_WARN_ONCE(&i915->drm, !num,
980+ "Platform does not implement TLB invalidation!"))
981+ return;
982+
983+ GEM_TRACE("\n");
984+
985+ assert_rpm_wakelock_held(&i915->runtime_pm);
986+
987+ mutex_lock(&gt->tlb_invalidate_lock);
988+ intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
989+
990+ for_each_engine(engine, gt, id) {
991+ /*
992+ * HW architecture suggest typical invalidation time at 40us,
993+ * with pessimistic cases up to 100us and a recommendation to
994+ * cap at 1ms. We go a bit higher just in case.
995+ */
996+ const unsigned int timeout_us = 100;
997+ const unsigned int timeout_ms = 4;
998+ struct reg_and_bit rb;
999+
1000+ rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
1001+ if (!i915_mmio_reg_offset(rb.reg))
1002+ continue;
1003+
1004+ intel_uncore_write_fw(uncore, rb.reg, rb.bit);
1005+ if (__intel_wait_for_register_fw(uncore,
1006+ rb.reg, rb.bit, 0,
1007+ timeout_us, timeout_ms,
1008+ NULL))
1009+ drm_err_ratelimited(&gt->i915->drm,
1010+ "%s TLB invalidation did not complete in %ums!\n",
1011+ engine->name, timeout_ms);
1012+ }
1013+
1014+ /*
1015+ * Use delayed put since a) we mostly expect a flurry of TLB
1016+ * invalidations so it is good to avoid paying the forcewake cost and
1017+ * b) it works around a bug in Icelake which cannot cope with too rapid
1018+ * transitions.
1019+ */
1020+ intel_uncore_forcewake_put_delayed(uncore, FORCEWAKE_ALL);
1021+ mutex_unlock(&gt->tlb_invalidate_lock);
1022+}
drivers/gpu/drm/i915/gt/intel_gt.h+2−0
@@ -91,4 +91,6 @@ void intel_gt_info_print(const struct intel_gt_info *info, · 90 unmodified lines
9191
9292 void intel_gt_watchdog_work(struct work_struct *work);
9393
94+void intel_gt_invalidate_tlbs(struct intel_gt *gt);
95+
9496 #endif /* __INTEL_GT_H__ */
drivers/gpu/drm/i915/gt/intel_gt_types.h+2−0
@@ -73,6 +73,8 @@ struct intel_gt { · 72 unmodified lines
7373
7474 struct intel_uc uc;
7575
76+ struct mutex tlb_invalidate_lock;
77+
7678 struct i915_wa_list wa_list;
7779
7880 struct intel_gt_timelines {
drivers/gpu/drm/i915/gt/uc/intel_guc.h+5−0
@@ -206,6 +206,11 @@ struct intel_guc { · 205 unmodified lines
206206 * context usage for overflows.
207207 */
208208 struct delayed_work work;
209+
210+ /**
211+ * @shift: Right shift value for the gpm timestamp
212+ */
213+ u32 shift;
209214 } timestamp;
210215
211216 #ifdef CONFIG_DRM_I915_SELFTEST
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c+97−17
@@ -1113,6 +1113,19 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start) · 1112 unmodified lines
11131113 if (new_start == lower_32_bits(*prev_start))
11141114 return;
11151115
1116+ /*
1117+ * When gt is unparked, we update the gt timestamp and start the ping
1118+ * worker that updates the gt_stamp every POLL_TIME_CLKS. As long as gt
1119+ * is unparked, all switched in contexts will have a start time that is
1120+ * within +/- POLL_TIME_CLKS of the most recent gt_stamp.
1121+ *
1122+ * If neither gt_stamp nor new_start has rolled over, then the
1123+ * gt_stamp_hi does not need to be adjusted, however if one of them has
1124+ * rolled over, we need to adjust gt_stamp_hi accordingly.
1125+ *
1126+ * The below conditions address the cases of new_start rollover and
1127+ * gt_stamp_last rollover respectively.
1128+ */
11161129 if (new_start < gt_stamp_last &&
11171130 (new_start - gt_stamp_last) <= POLL_TIME_CLKS)
11181131 gt_stamp_hi++;
@@ -1124,17 +1137,45 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start) · 5 unmodified lines
11241137 *prev_start = ((u64)gt_stamp_hi << 32) | new_start;
11251138 }
11261139
1127−static void guc_update_engine_gt_clks(struct intel_engine_cs *engine)
1140+/*
1141+ * GuC updates shared memory and KMD reads it. Since this is not synchronized,
1142+ * we run into a race where the value read is inconsistent. Sometimes the
1143+ * inconsistency is in reading the upper MSB bytes of the last_in value when
1144+ * this race occurs. 2 types of cases are seen - upper 8 bits are zero and upper
1145+ * 24 bits are zero. Since these are non-zero values, it is non-trivial to
1146+ * determine validity of these values. Instead we read the values multiple times
1147+ * until they are consistent. In test runs, 3 attempts results in consistent
1148+ * values. The upper bound is set to 6 attempts and may need to be tuned as per
1149+ * any new occurences.
1150+ */
1151+static void __get_engine_usage_record(struct intel_engine_cs *engine,
1152+ u32 *last_in, u32 *id, u32 *total)
11281153 {
11291154 struct guc_engine_usage_record *rec = intel_guc_engine_usage(engine);
1155+ int i = 0;
1156+
1157+ do {
1158+ *last_in = READ_ONCE(rec->last_switch_in_stamp);
1159+ *id = READ_ONCE(rec->current_context_index);
1160+ *total = READ_ONCE(rec->total_runtime);
1161+
1162+ if (READ_ONCE(rec->last_switch_in_stamp) == *last_in &&
1163+ READ_ONCE(rec->current_context_index) == *id &&
1164+ READ_ONCE(rec->total_runtime) == *total)
1165+ break;
1166+ } while (++i < 6);
1167+}
1168+
1169+static void guc_update_engine_gt_clks(struct intel_engine_cs *engine)
1170+{
11301171 struct intel_engine_guc_stats *stats = &engine->stats.guc;
11311172 struct intel_guc *guc = &engine->gt->uc.guc;
1132− u32 last_switch = rec->last_switch_in_stamp;
1133− u32 ctx_id = rec->current_context_index;
1134− u32 total = rec->total_runtime;
1173+ u32 last_switch, ctx_id, total;
11351174
11361175 lockdep_assert_held(&guc->timestamp.lock);
11371176
1177+ __get_engine_usage_record(engine, &last_switch, &ctx_id, &total);
1178+
11381179 stats->running = ctx_id != ~0U && last_switch;
11391180 if (stats->running)
11401181 __extend_last_switch(guc, &stats->start_gt_clk, last_switch);
@@ -1149,23 +1190,51 @@ static void guc_update_engine_gt_clks(struct intel_engine_cs *engine) · 8 unmodified lines
11491190 }
11501191 }
11511192
1152−static void guc_update_pm_timestamp(struct intel_guc *guc,
1153− struct intel_engine_cs *engine,
1154− ktime_t *now)
1193+static u32 gpm_timestamp_shift(struct intel_gt *gt)
1194+{
1195+ intel_wakeref_t wakeref;
1196+ u32 reg, shift;
1197+
1198+ with_intel_runtime_pm(gt->uncore->rpm, wakeref)
1199+ reg = intel_uncore_read(gt->uncore, RPM_CONFIG0);
1200+
1201+ shift = (reg & GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK) >>
1202+ GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT;
1203+
1204+ return 3 - shift;
1205+}
1206+
1207+static u64 gpm_timestamp(struct intel_gt *gt)
1208+{
1209+ u32 lo, hi, old_hi, loop = 0;
1210+
1211+ hi = intel_uncore_read(gt->uncore, MISC_STATUS1);
1212+ do {
1213+ lo = intel_uncore_read(gt->uncore, MISC_STATUS0);
1214+ old_hi = hi;
1215+ hi = intel_uncore_read(gt->uncore, MISC_STATUS1);
1216+ } while (old_hi != hi && loop++ < 2);
1217+
1218+ return ((u64)hi << 32) | lo;
1219+}
1220+
1221+static void guc_update_pm_timestamp(struct intel_guc *guc, ktime_t *now)
11551222 {
1156− u32 gt_stamp_now, gt_stamp_hi;
1223+ struct intel_gt *gt = guc_to_gt(guc);
1224+ u32 gt_stamp_lo, gt_stamp_hi;
1225+ u64 gpm_ts;
11571226
11581227 lockdep_assert_held(&guc->timestamp.lock);
11591228
11601229 gt_stamp_hi = upper_32_bits(guc->timestamp.gt_stamp);
1161− gt_stamp_now = intel_uncore_read(engine->uncore,
1162− RING_TIMESTAMP(engine->mmio_base));
1230+ gpm_ts = gpm_timestamp(gt) >> guc->timestamp.shift;
1231+ gt_stamp_lo = lower_32_bits(gpm_ts);
11631232 *now = ktime_get();
11641233
1165− if (gt_stamp_now < lower_32_bits(guc->timestamp.gt_stamp))
1234+ if (gt_stamp_lo < lower_32_bits(guc->timestamp.gt_stamp))
11661235 gt_stamp_hi++;
11671236
1168− guc->timestamp.gt_stamp = ((u64)gt_stamp_hi << 32) | gt_stamp_now;
1237+ guc->timestamp.gt_stamp = ((u64)gt_stamp_hi << 32) | gt_stamp_lo;
11691238 }
11701239
11711240 /*
@@ -1208,8 +1277,12 @@ static ktime_t guc_engine_busyness(struct intel_engine_cs *engine, ktime_t *now) · 36 unmodified lines
12081277 if (!in_reset && intel_gt_pm_get_if_awake(gt)) {
12091278 stats_saved = *stats;
12101279 gt_stamp_saved = guc->timestamp.gt_stamp;
1280+ /*
1281+ * Update gt_clks, then gt timestamp to simplify the 'gt_stamp -
1282+ * start_gt_clk' calculation below for active engines.
1283+ */
12111284 guc_update_engine_gt_clks(engine);
1212− guc_update_pm_timestamp(guc, engine, now);
1285+ guc_update_pm_timestamp(guc, now);
12131286 intel_gt_pm_put_async(gt);
12141287 if (i915_reset_count(gpu_error) != reset_count) {
12151288 *stats = stats_saved;
@@ -1241,8 +1314,8 @@ static void __reset_guc_busyness_stats(struct intel_guc *guc) · 25 unmodified lines
12411314
12421315 spin_lock_irqsave(&guc->timestamp.lock, flags);
12431316
1317+ guc_update_pm_timestamp(guc, &unused);
12441318 for_each_engine(engine, gt, id) {
1245− guc_update_pm_timestamp(guc, engine, &unused);
12461319 guc_update_engine_gt_clks(engine);
12471320 engine->stats.guc.prev_total = 0;
12481321 }
@@ -1259,10 +1332,11 @@ static void __update_guc_busyness_stats(struct intel_guc *guc) · 10 unmodified lines
12591332 ktime_t unused;
12601333
12611334 spin_lock_irqsave(&guc->timestamp.lock, flags);
1262− for_each_engine(engine, gt, id) {
1263− guc_update_pm_timestamp(guc, engine, &unused);
1335+
1336+ guc_update_pm_timestamp(guc, &unused);
1337+ for_each_engine(engine, gt, id)
12641338 guc_update_engine_gt_clks(engine);
1265− }
1339+
12661340 spin_unlock_irqrestore(&guc->timestamp.lock, flags);
12671341 }
12681342
@@ -1335,10 +1409,15 @@ void intel_guc_busyness_park(struct intel_gt *gt) · 66 unmodified lines
13351409 void intel_guc_busyness_unpark(struct intel_gt *gt)
13361410 {
13371411 struct intel_guc *guc = &gt->uc.guc;
1412+ unsigned long flags;
1413+ ktime_t unused;
13381414
13391415 if (!guc_submission_initialized(guc))
13401416 return;
13411417
1418+ spin_lock_irqsave(&guc->timestamp.lock, flags);
1419+ guc_update_pm_timestamp(guc, &unused);
1420+ spin_unlock_irqrestore(&guc->timestamp.lock, flags);
13421421 mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
13431422 guc->timestamp.ping_delay);
13441423 }
@@ -1783,6 +1862,7 @@ int intel_guc_submission_init(struct intel_guc *guc) · 438 unmodified lines
17831862 spin_lock_init(&guc->timestamp.lock);
17841863 INIT_DELAYED_WORK(&guc->timestamp.work, guc_timestamp_ping);
17851864 guc->timestamp.ping_delay = (POLL_TIME_CLKS / gt->clock_frequency + 1) * HZ;
1865+ guc->timestamp.shift = gpm_timestamp_shift(gt);
17861866
17871867 return 0;
17881868 }
drivers/gpu/drm/i915/gvt/gtt.c+2−2
@@ -1148,7 +1148,7 @@ static inline void ppgtt_generate_shadow_entry(struct intel_gvt_gtt_entry *se, · 1147 unmodified lines
11481148 ops->set_pfn(se, s->shadow_page.mfn);
11491149 }
11501150
1151−/**
1151+/*
11521152 * Check if can do 2M page
11531153 * @vgpu: target vgpu
11541154 * @entry: target pfn's gtt entry
@@ -2193,7 +2193,7 @@ static int emulate_ggtt_mmio_read(struct intel_vgpu *vgpu, · 1038 unmodified lines
21932193 }
21942194
21952195 /**
2196− * intel_vgpu_emulate_gtt_mmio_read - emulate GTT MMIO register read
2196+ * intel_vgpu_emulate_ggtt_mmio_read - emulate GTT MMIO register read
21972197 * @vgpu: a vGPU
21982198 * @off: register offset
21992199 * @p_data: data will be returned to guest
drivers/gpu/drm/i915/i915_gpu_error.c+1−1
@@ -1522,7 +1522,7 @@ capture_engine(struct intel_engine_cs *engine, · 1521 unmodified lines
15221522 struct i915_request *rq = NULL;
15231523 unsigned long flags;
15241524
1525− ee = intel_engine_coredump_alloc(engine, GFP_KERNEL);
1525+ ee = intel_engine_coredump_alloc(engine, ALLOW_FAIL);
15261526 if (!ee)
15271527 return NULL;
15281528
drivers/gpu/drm/i915/i915_mm.h+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #ifndef __I915_MM_H__
77 #define __I915_MM_H__
88
9+#include <linux/bug.h>
910 #include <linux/types.h>
1011
1112 struct vm_area_struct;
drivers/gpu/drm/i915/i915_reg.h+13−1
@@ -2684,7 +2684,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) · 2683 unmodified lines
26842684 #define RING_WAIT (1 << 11) /* gen3+, PRBx_CTL */
26852685 #define RING_WAIT_SEMAPHORE (1 << 10) /* gen6+ */
26862686
2687−#define GUCPMTIMESTAMP _MMIO(0xC3E8)
2687+#define MISC_STATUS0 _MMIO(0xA500)
2688+#define MISC_STATUS1 _MMIO(0xA504)
26882689
26892690 /* There are 16 64-bit CS General Purpose Registers per-engine on Gen8+ */
26902691 #define GEN8_RING_CS_GPR(base, n) _MMIO((base) + 0x600 + (n) * 8)
@@ -2721,6 +2722,12 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) · 30 unmodified lines
27212722 #define GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING (1 << 28)
27222723 #define GAMT_CHKN_DISABLE_I2M_CYCLE_ON_WR_PORT (1 << 24)
27232724
2725+#define GEN8_RTCR _MMIO(0x4260)
2726+#define GEN8_M1TCR _MMIO(0x4264)
2727+#define GEN8_M2TCR _MMIO(0x4268)
2728+#define GEN8_BTCR _MMIO(0x426c)
2729+#define GEN8_VTCR _MMIO(0x4270)
2730+
27242731 #if 0
27252732 #define PRB0_TAIL _MMIO(0x2030)
27262733 #define PRB0_HEAD _MMIO(0x2034)
@@ -2819,6 +2826,11 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) · 92 unmodified lines
28192826 #define FAULT_VA_HIGH_BITS (0xf << 0)
28202827 #define FAULT_GTT_SEL (1 << 4)
28212828
2829+#define GEN12_GFX_TLB_INV_CR _MMIO(0xced8)
2830+#define GEN12_VD_TLB_INV_CR _MMIO(0xcedc)
2831+#define GEN12_VE_TLB_INV_CR _MMIO(0xcee0)
2832+#define GEN12_BLT_TLB_INV_CR _MMIO(0xcee4)
2833+
28222834 #define GEN12_AUX_ERR_DBG _MMIO(0x43f4)
28232835
28242836 #define FPGA_DBG _MMIO(0x42300)
drivers/gpu/drm/i915/i915_vma.c+3−0
@@ -457,6 +457,9 @@ int i915_vma_bind(struct i915_vma *vma, · 456 unmodified lines
457457 vma->ops->bind_vma(vma->vm, NULL, vma, cache_level, bind_flags);
458458 }
459459
460+ if (vma->obj)
461+ set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
462+
460463 atomic_or(bind_flags, &vma->flags);
461464 return 0;
462465 }
drivers/gpu/drm/i915/intel_pm.c+122−25
@@ -4717,6 +4717,10 @@ static const struct dbuf_slice_conf_entry dg2_allowed_dbufs[] = { · 4716 unmodified lines
47174717 };
47184718
47194719 static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = {
4720+ /*
4721+ * Keep the join_mbus cases first so check_mbus_joined()
4722+ * will prefer them over the !join_mbus cases.
4723+ */
47204724 {
47214725 .active_pipes = BIT(PIPE_A),
47224726 .dbuf_mask = {
@@ -4731,6 +4735,20 @@ static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = { · 8 unmodified lines
47314735 },
47324736 .join_mbus = true,
47334737 },
4738+ {
4739+ .active_pipes = BIT(PIPE_A),
4740+ .dbuf_mask = {
4741+ [PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2),
4742+ },
4743+ .join_mbus = false,
4744+ },
4745+ {
4746+ .active_pipes = BIT(PIPE_B),
4747+ .dbuf_mask = {
4748+ [PIPE_B] = BIT(DBUF_S3) | BIT(DBUF_S4),
4749+ },
4750+ .join_mbus = false,
4751+ },
47344752 {
47354753 .active_pipes = BIT(PIPE_A) | BIT(PIPE_B),
47364754 .dbuf_mask = {
@@ -4835,7 +4853,7 @@ static bool check_mbus_joined(u8 active_pipes, · 98 unmodified lines
48354853 {
48364854 int i;
48374855
4838− for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
4856+ for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {
48394857 if (dbuf_slices[i].active_pipes == active_pipes)
48404858 return dbuf_slices[i].join_mbus;
48414859 }
@@ -4847,13 +4865,14 @@ static bool adlp_check_mbus_joined(u8 active_pipes) · 5 unmodified lines
48474865 return check_mbus_joined(active_pipes, adlp_allowed_dbufs);
48484866 }
48494867
4850−static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes,
4868+static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus,
48514869 const struct dbuf_slice_conf_entry *dbuf_slices)
48524870 {
48534871 int i;
48544872
4855− for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
4856− if (dbuf_slices[i].active_pipes == active_pipes)
4873+ for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {
4874+ if (dbuf_slices[i].active_pipes == active_pipes &&
4875+ dbuf_slices[i].join_mbus == join_mbus)
48574876 return dbuf_slices[i].dbuf_mask[pipe];
48584877 }
48594878 return 0;
@@ -4864,7 +4883,7 @@ static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, · 4 unmodified lines
48644883 * returns correspondent DBuf slice mask as stated in BSpec for particular
48654884 * platform.
48664885 */
4867−static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes)
4886+static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48684887 {
48694888 /*
48704889 * FIXME: For ICL this is still a bit unclear as prev BSpec revision
@@ -4878,37 +4897,41 @@ static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes) · 7 unmodified lines
48784897 * still here - we will need it once those additional constraints
48794898 * pop up.
48804899 */
4881− return compute_dbuf_slices(pipe, active_pipes, icl_allowed_dbufs);
4900+ return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4901+ icl_allowed_dbufs);
48824902 }
48834903
4884−static u8 tgl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes)
4904+static u8 tgl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48854905 {
4886− return compute_dbuf_slices(pipe, active_pipes, tgl_allowed_dbufs);
4906+ return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4907+ tgl_allowed_dbufs);
48874908 }
48884909
4889−static u32 adlp_compute_dbuf_slices(enum pipe pipe, u32 active_pipes)
4910+static u8 adlp_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48904911 {
4891− return compute_dbuf_slices(pipe, active_pipes, adlp_allowed_dbufs);
4912+ return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4913+ adlp_allowed_dbufs);
48924914 }
48934915
4894−static u32 dg2_compute_dbuf_slices(enum pipe pipe, u32 active_pipes)
4916+static u8 dg2_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48954917 {
4896− return compute_dbuf_slices(pipe, active_pipes, dg2_allowed_dbufs);
4918+ return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4919+ dg2_allowed_dbufs);
48974920 }
48984921
4899−static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes)
4922+static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes, bool join_mbus)
49004923 {
49014924 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
49024925 enum pipe pipe = crtc->pipe;
49034926
49044927 if (IS_DG2(dev_priv))
4905− return dg2_compute_dbuf_slices(pipe, active_pipes);
4928+ return dg2_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49064929 else if (IS_ALDERLAKE_P(dev_priv))
4907− return adlp_compute_dbuf_slices(pipe, active_pipes);
4930+ return adlp_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49084931 else if (DISPLAY_VER(dev_priv) == 12)
4909− return tgl_compute_dbuf_slices(pipe, active_pipes);
4932+ return tgl_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49104933 else if (DISPLAY_VER(dev_priv) == 11)
4911− return icl_compute_dbuf_slices(pipe, active_pipes);
4934+ return icl_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49124935 /*
49134936 * For anything else just return one slice yet.
49144937 * Should be extended for other platforms.
@@ -6127,11 +6150,16 @@ skl_compute_ddb(struct intel_atomic_state *state) · 1212 unmodified lines
61276150 return ret;
61286151 }
61296152
6153+ if (IS_ALDERLAKE_P(dev_priv))
6154+ new_dbuf_state->joined_mbus =
6155+ adlp_check_mbus_joined(new_dbuf_state->active_pipes);
6156+
61306157 for_each_intel_crtc(&dev_priv->drm, crtc) {
61316158 enum pipe pipe = crtc->pipe;
61326159
61336160 new_dbuf_state->slices[pipe] =
6134− skl_compute_dbuf_slices(crtc, new_dbuf_state->active_pipes);
6161+ skl_compute_dbuf_slices(crtc, new_dbuf_state->active_pipes,
6162+ new_dbuf_state->joined_mbus);
61356163
61366164 if (old_dbuf_state->slices[pipe] == new_dbuf_state->slices[pipe])
61376165 continue;
@@ -6143,9 +6171,6 @@ skl_compute_ddb(struct intel_atomic_state *state) · 5 unmodified lines
61436171
61446172 new_dbuf_state->enabled_slices = intel_dbuf_enabled_slices(new_dbuf_state);
61456173
6146− if (IS_ALDERLAKE_P(dev_priv))
6147− new_dbuf_state->joined_mbus = adlp_check_mbus_joined(new_dbuf_state->active_pipes);
6148−
61496174 if (old_dbuf_state->enabled_slices != new_dbuf_state->enabled_slices ||
61506175 old_dbuf_state->joined_mbus != new_dbuf_state->joined_mbus) {
61516176 ret = intel_atomic_serialize_global_state(&new_dbuf_state->base);
@@ -6626,6 +6651,7 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv) · 474 unmodified lines
66266651 enum pipe pipe = crtc->pipe;
66276652 unsigned int mbus_offset;
66286653 enum plane_id plane_id;
6654+ u8 slices;
66296655
66306656 skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
66316657 crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal;
@@ -6645,19 +6671,22 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv) · 13 unmodified lines
66456671 skl_ddb_entry_union(&dbuf_state->ddb[pipe], ddb_uv);
66466672 }
66476673
6648− dbuf_state->slices[pipe] =
6649− skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes);
6650−
66516674 dbuf_state->weight[pipe] = intel_crtc_ddb_weight(crtc_state);
66526675
66536676 /*
66546677 * Used for checking overlaps, so we need absolute
66556678 * offsets instead of MBUS relative offsets.
66566679 */
6657− mbus_offset = mbus_ddb_offset(dev_priv, dbuf_state->slices[pipe]);
6680+ slices = skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes,
6681+ dbuf_state->joined_mbus);
6682+ mbus_offset = mbus_ddb_offset(dev_priv, slices);
66586683 crtc_state->wm.skl.ddb.start = mbus_offset + dbuf_state->ddb[pipe].start;
66596684 crtc_state->wm.skl.ddb.end = mbus_offset + dbuf_state->ddb[pipe].end;
66606685
6686+ /* The slices actually used by the planes on the pipe */
6687+ dbuf_state->slices[pipe] =
6688+ skl_ddb_dbuf_slice_mask(dev_priv, &crtc_state->wm.skl.ddb);
6689+
66616690 drm_dbg_kms(&dev_priv->drm,
66626691 "[CRTC:%d:%s] dbuf slices 0x%x, ddb (%d - %d), active pipes 0x%x, mbus joined: %s\n",
66636692 crtc->base.base.id, crtc->base.name,
@@ -6669,6 +6698,74 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv) · 5 unmodified lines
66696698 dbuf_state->enabled_slices = dev_priv->dbuf.enabled_slices;
66706699 }
66716700
6701+static bool skl_dbuf_is_misconfigured(struct drm_i915_private *i915)
6702+{
6703+ const struct intel_dbuf_state *dbuf_state =
6704+ to_intel_dbuf_state(i915->dbuf.obj.state);
6705+ struct skl_ddb_entry entries[I915_MAX_PIPES] = {};
6706+ struct intel_crtc *crtc;
6707+
6708+ for_each_intel_crtc(&i915->drm, crtc) {
6709+ const struct intel_crtc_state *crtc_state =
6710+ to_intel_crtc_state(crtc->base.state);
6711+
6712+ entries[crtc->pipe] = crtc_state->wm.skl.ddb;
6713+ }
6714+
6715+ for_each_intel_crtc(&i915->drm, crtc) {
6716+ const struct intel_crtc_state *crtc_state =
6717+ to_intel_crtc_state(crtc->base.state);
6718+ u8 slices;
6719+
6720+ slices = skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes,
6721+ dbuf_state->joined_mbus);
6722+ if (dbuf_state->slices[crtc->pipe] & ~slices)
6723+ return true;
6724+
6725+ if (skl_ddb_allocation_overlaps(&crtc_state->wm.skl.ddb, entries,
6726+ I915_MAX_PIPES, crtc->pipe))
6727+ return true;
6728+ }
6729+
6730+ return false;
6731+}
6732+
6733+void skl_wm_sanitize(struct drm_i915_private *i915)
6734+{
6735+ struct intel_crtc *crtc;
6736+
6737+ /*
6738+ * On TGL/RKL (at least) the BIOS likes to assign the planes
6739+ * to the wrong DBUF slices. This will cause an infinite loop
6740+ * in skl_commit_modeset_enables() as it can't find a way to
6741+ * transition between the old bogus DBUF layout to the new
6742+ * proper DBUF layout without DBUF allocation overlaps between
6743+ * the planes (which cannot be allowed or else the hardware
6744+ * may hang). If we detect a bogus DBUF layout just turn off
6745+ * all the planes so that skl_commit_modeset_enables() can
6746+ * simply ignore them.
6747+ */
6748+ if (!skl_dbuf_is_misconfigured(i915))
6749+ return;
6750+
6751+ drm_dbg_kms(&i915->drm, "BIOS has misprogrammed the DBUF, disabling all planes\n");
6752+
6753+ for_each_intel_crtc(&i915->drm, crtc) {
6754+ struct intel_plane *plane = to_intel_plane(crtc->base.primary);
6755+ const struct intel_plane_state *plane_state =
6756+ to_intel_plane_state(plane->base.state);
6757+ struct intel_crtc_state *crtc_state =
6758+ to_intel_crtc_state(crtc->base.state);
6759+
6760+ if (plane_state->uapi.visible)
6761+ intel_plane_disable_noatomic(crtc, plane);
6762+
6763+ drm_WARN_ON(&i915->drm, crtc_state->active_planes != 0);
6764+
6765+ memset(&crtc_state->wm.skl.ddb, 0, sizeof(crtc_state->wm.skl.ddb));
6766+ }
6767+}
6768+
66726769 static void ilk_pipe_wm_get_hw_state(struct intel_crtc *crtc)
66736770 {
66746771 struct drm_device *dev = crtc->base.dev;
drivers/gpu/drm/i915/intel_pm.h+1−0
@@ -47,6 +47,7 @@ void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc, · 46 unmodified lines
4747 struct skl_pipe_wm *out);
4848 void g4x_wm_sanitize(struct drm_i915_private *dev_priv);
4949 void vlv_wm_sanitize(struct drm_i915_private *dev_priv);
50+void skl_wm_sanitize(struct drm_i915_private *dev_priv);
5051 bool intel_can_enable_sagv(struct drm_i915_private *dev_priv,
5152 const struct intel_bw_state *bw_state);
5253 void intel_sagv_pre_plane_update(struct intel_atomic_state *state);
drivers/gpu/drm/i915/intel_runtime_pm.c+1−3
@@ -68,9 +68,7 @@ static noinline depot_stack_handle_t __save_depot_stack(void) · 67 unmodified lines
6868 static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
6969 {
7070 spin_lock_init(&rpm->debug.lock);
71−
72− if (rpm->available)
73− stack_depot_init();
71+ stack_depot_init();
7472 }
7573
7674 static noinline depot_stack_handle_t
drivers/gpu/drm/i915/intel_uncore.c+22−4
@@ -724,7 +724,8 @@ void intel_uncore_forcewake_get__locked(struct intel_uncore *uncore, · 723 unmodified lines
724724 }
725725
726726 static void __intel_uncore_forcewake_put(struct intel_uncore *uncore,
727− enum forcewake_domains fw_domains)
727+ enum forcewake_domains fw_domains,
728+ bool delayed)
728729 {
729730 struct intel_uncore_forcewake_domain *domain;
730731 unsigned int tmp;
@@ -739,7 +740,11 @@ static void __intel_uncore_forcewake_put(struct intel_uncore *uncore, · 8 unmodified lines
739740 continue;
740741 }
741742
742− fw_domains_put(uncore, domain->mask);
743+ if (delayed &&
744+ !(domain->uncore->fw_domains_timer & domain->mask))
745+ fw_domain_arm_timer(domain);
746+ else
747+ fw_domains_put(uncore, domain->mask);
743748 }
744749 }
745750
@@ -760,7 +765,20 @@ void intel_uncore_forcewake_put(struct intel_uncore *uncore, · 14 unmodified lines
760765 return;
761766
762767 spin_lock_irqsave(&uncore->lock, irqflags);
763− __intel_uncore_forcewake_put(uncore, fw_domains);
768+ __intel_uncore_forcewake_put(uncore, fw_domains, false);
769+ spin_unlock_irqrestore(&uncore->lock, irqflags);
770+}
771+
772+void intel_uncore_forcewake_put_delayed(struct intel_uncore *uncore,
773+ enum forcewake_domains fw_domains)
774+{
775+ unsigned long irqflags;
776+
777+ if (!uncore->fw_get_funcs)
778+ return;
779+
780+ spin_lock_irqsave(&uncore->lock, irqflags);
781+ __intel_uncore_forcewake_put(uncore, fw_domains, true);
764782 spin_unlock_irqrestore(&uncore->lock, irqflags);
765783 }
766784
@@ -802,7 +820,7 @@ void intel_uncore_forcewake_put__locked(struct intel_uncore *uncore, · 35 unmodified lines
802820 if (!uncore->fw_get_funcs)
803821 return;
804822
805− __intel_uncore_forcewake_put(uncore, fw_domains);
823+ __intel_uncore_forcewake_put(uncore, fw_domains, false);
806824 }
807825
808826 void assert_forcewakes_inactive(struct intel_uncore *uncore)
drivers/gpu/drm/i915/intel_uncore.h+2−0
@@ -246,6 +246,8 @@ void intel_uncore_forcewake_get(struct intel_uncore *uncore, · 245 unmodified lines
246246 enum forcewake_domains domains);
247247 void intel_uncore_forcewake_put(struct intel_uncore *uncore,
248248 enum forcewake_domains domains);
249+void intel_uncore_forcewake_put_delayed(struct intel_uncore *uncore,
250+ enum forcewake_domains domains);
249251 void intel_uncore_forcewake_flush(struct intel_uncore *uncore,
250252 enum forcewake_domains fw_domains);
251253
drivers/gpu/drm/kmb/kmb_plane.c+0−6
@@ -158,12 +158,6 @@ static void kmb_plane_atomic_disable(struct drm_plane *plane, · 157 unmodified lines
158158 case LAYER_1:
159159 kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
160160 break;
161− case LAYER_2:
162− kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
163− break;
164− case LAYER_3:
165− kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
166− break;
167161 }
168162
169163 kmb->plane_status[plane_id].disable = true;
drivers/gpu/drm/mediatek/mtk_dsi.c+84−83
@@ -786,18 +786,101 @@ void mtk_dsi_ddp_stop(struct device *dev) · 785 unmodified lines
786786 mtk_dsi_poweroff(dsi);
787787 }
788788
789+static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
790+{
791+ int ret;
792+
793+ ret = drm_simple_encoder_init(drm, &dsi->encoder,
794+ DRM_MODE_ENCODER_DSI);
795+ if (ret) {
796+ DRM_ERROR("Failed to encoder init to drm\n");
797+ return ret;
798+ }
799+
800+ dsi->encoder.possible_crtcs = mtk_drm_find_possible_crtc_by_comp(drm, dsi->host.dev);
801+
802+ ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL,
803+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
804+ if (ret)
805+ goto err_cleanup_encoder;
806+
807+ dsi->connector = drm_bridge_connector_init(drm, &dsi->encoder);
808+ if (IS_ERR(dsi->connector)) {
809+ DRM_ERROR("Unable to create bridge connector\n");
810+ ret = PTR_ERR(dsi->connector);
811+ goto err_cleanup_encoder;
812+ }
813+ drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
814+
815+ return 0;
816+
817+err_cleanup_encoder:
818+ drm_encoder_cleanup(&dsi->encoder);
819+ return ret;
820+}
821+
822+static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
823+{
824+ int ret;
825+ struct drm_device *drm = data;
826+ struct mtk_dsi *dsi = dev_get_drvdata(dev);
827+
828+ ret = mtk_dsi_encoder_init(drm, dsi);
829+ if (ret)
830+ return ret;
831+
832+ return device_reset_optional(dev);
833+}
834+
835+static void mtk_dsi_unbind(struct device *dev, struct device *master,
836+ void *data)
837+{
838+ struct mtk_dsi *dsi = dev_get_drvdata(dev);
839+
840+ drm_encoder_cleanup(&dsi->encoder);
841+}
842+
843+static const struct component_ops mtk_dsi_component_ops = {
844+ .bind = mtk_dsi_bind,
845+ .unbind = mtk_dsi_unbind,
846+};
847+
789848 static int mtk_dsi_host_attach(struct mipi_dsi_host *host,
790849 struct mipi_dsi_device *device)
791850 {
792851 struct mtk_dsi *dsi = host_to_dsi(host);
852+ struct device *dev = host->dev;
853+ int ret;
793854
794855 dsi->lanes = device->lanes;
795856 dsi->format = device->format;
796857 dsi->mode_flags = device->mode_flags;
858+ dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0);
859+ if (IS_ERR(dsi->next_bridge))
860+ return PTR_ERR(dsi->next_bridge);
861+
862+ drm_bridge_add(&dsi->bridge);
863+
864+ ret = component_add(host->dev, &mtk_dsi_component_ops);
865+ if (ret) {
866+ DRM_ERROR("failed to add dsi_host component: %d\n", ret);
867+ drm_bridge_remove(&dsi->bridge);
868+ return ret;
869+ }
797870
798871 return 0;
799872 }
800873
874+static int mtk_dsi_host_detach(struct mipi_dsi_host *host,
875+ struct mipi_dsi_device *device)
876+{
877+ struct mtk_dsi *dsi = host_to_dsi(host);
878+
879+ component_del(host->dev, &mtk_dsi_component_ops);
880+ drm_bridge_remove(&dsi->bridge);
881+ return 0;
882+}
883+
801884 static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)
802885 {
803886 int ret;
@@ -938,73 +1021,14 @@ static ssize_t mtk_dsi_host_transfer(struct mipi_dsi_host *host, · 134 unmodified lines
9381021
9391022 static const struct mipi_dsi_host_ops mtk_dsi_ops = {
9401023 .attach = mtk_dsi_host_attach,
1024+ .detach = mtk_dsi_host_detach,
9411025 .transfer = mtk_dsi_host_transfer,
9421026 };
9431027
944−static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
945−{
946− int ret;
947−
948− ret = drm_simple_encoder_init(drm, &dsi->encoder,
949− DRM_MODE_ENCODER_DSI);
950− if (ret) {
951− DRM_ERROR("Failed to encoder init to drm\n");
952− return ret;
953− }
954−
955− dsi->encoder.possible_crtcs = mtk_drm_find_possible_crtc_by_comp(drm, dsi->host.dev);
956−
957− ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL,
958− DRM_BRIDGE_ATTACH_NO_CONNECTOR);
959− if (ret)
960− goto err_cleanup_encoder;
961−
962− dsi->connector = drm_bridge_connector_init(drm, &dsi->encoder);
963− if (IS_ERR(dsi->connector)) {
964− DRM_ERROR("Unable to create bridge connector\n");
965− ret = PTR_ERR(dsi->connector);
966− goto err_cleanup_encoder;
967− }
968− drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
969−
970− return 0;
971−
972−err_cleanup_encoder:
973− drm_encoder_cleanup(&dsi->encoder);
974− return ret;
975−}
976−
977−static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
978−{
979− int ret;
980− struct drm_device *drm = data;
981− struct mtk_dsi *dsi = dev_get_drvdata(dev);
982−
983− ret = mtk_dsi_encoder_init(drm, dsi);
984− if (ret)
985− return ret;
986−
987− return device_reset_optional(dev);
988−}
989−
990−static void mtk_dsi_unbind(struct device *dev, struct device *master,
991− void *data)
992−{
993− struct mtk_dsi *dsi = dev_get_drvdata(dev);
994−
995− drm_encoder_cleanup(&dsi->encoder);
996−}
997−
998−static const struct component_ops mtk_dsi_component_ops = {
999− .bind = mtk_dsi_bind,
1000− .unbind = mtk_dsi_unbind,
1001−};
1002−
10031028 static int mtk_dsi_probe(struct platform_device *pdev)
10041029 {
10051030 struct mtk_dsi *dsi;
10061031 struct device *dev = &pdev->dev;
1007− struct drm_panel *panel;
10081032 struct resource *regs;
10091033 int irq_num;
10101034 int ret;
@@ -1021,19 +1045,6 @@ static int mtk_dsi_probe(struct platform_device *pdev) · 10 unmodified lines
10211045 return ret;
10221046 }
10231047
1024− ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
1025− &panel, &dsi->next_bridge);
1026− if (ret)
1027− goto err_unregister_host;
1028−
1029− if (panel) {
1030− dsi->next_bridge = devm_drm_panel_bridge_add(dev, panel);
1031− if (IS_ERR(dsi->next_bridge)) {
1032− ret = PTR_ERR(dsi->next_bridge);
1033− goto err_unregister_host;
1034− }
1035− }
1036−
10371048 dsi->driver_data = of_device_get_match_data(dev);
10381049
10391050 dsi->engine_clk = devm_clk_get(dev, "engine");
@@ -1098,14 +1109,6 @@ static int mtk_dsi_probe(struct platform_device *pdev) · 58 unmodified lines
10981109 dsi->bridge.of_node = dev->of_node;
10991110 dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
11001111
1101− drm_bridge_add(&dsi->bridge);
1102−
1103− ret = component_add(&pdev->dev, &mtk_dsi_component_ops);
1104− if (ret) {
1105− dev_err(&pdev->dev, "failed to add component: %d\n", ret);
1106− goto err_unregister_host;
1107− }
1108−
11091112 return 0;
11101113
11111114 err_unregister_host:
@@ -1118,8 +1121,6 @@ static int mtk_dsi_remove(struct platform_device *pdev) · 6 unmodified lines
11181121 struct mtk_dsi *dsi = platform_get_drvdata(pdev);
11191122
11201123 mtk_output_dsi_disable(dsi);
1121− drm_bridge_remove(&dsi->bridge);
1122− component_del(&pdev->dev, &mtk_dsi_component_ops);
11231124 mipi_dsi_host_unregister(&dsi->host);
11241125
11251126 return 0;
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+2−0
@@ -1560,6 +1560,8 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu) · 1559 unmodified lines
15601560 for (i = 0; i < gpu->nr_rings; i++)
15611561 a6xx_gpu->shadow[i] = 0;
15621562
1563+ gpu->suspend_count++;
1564+
15631565 return 0;
15641566 }
15651567
drivers/gpu/drm/msm/adreno/adreno_device.c+18−0
@@ -608,9 +608,27 @@ static int adreno_resume(struct device *dev) · 607 unmodified lines
608608 return gpu->funcs->pm_resume(gpu);
609609 }
610610
611+static int active_submits(struct msm_gpu *gpu)
612+{
613+ int active_submits;
614+ mutex_lock(&gpu->active_lock);
615+ active_submits = gpu->active_submits;
616+ mutex_unlock(&gpu->active_lock);
617+ return active_submits;
618+}
619+
611620 static int adreno_suspend(struct device *dev)
612621 {
613622 struct msm_gpu *gpu = dev_to_gpu(dev);
623+ int remaining;
624+
625+ remaining = wait_event_timeout(gpu->retire_event,
626+ active_submits(gpu) == 0,
627+ msecs_to_jiffies(1000));
628+ if (remaining == 0) {
629+ dev_err(dev, "Timeout waiting for GPU to suspend\n");
630+ return -EBUSY;
631+ }
614632
615633 return gpu->funcs->pm_suspend(gpu);
616634 }
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c+9−2
@@ -26,9 +26,16 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx, · 25 unmodified lines
2626 struct dpu_hw_pcc_cfg *cfg)
2727 {
2828
29− u32 base = ctx->cap->sblk->pcc.base;
29+ u32 base;
3030
31− if (!ctx || !base) {
31+ if (!ctx) {
32+ DRM_ERROR("invalid ctx %pK\n", ctx);
33+ return;
34+ }
35+
36+ base = ctx->cap->sblk->pcc.base;
37+
38+ if (!base) {
3239 DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
3340 return;
3441 }
drivers/gpu/drm/msm/dsi/dsi.c+6−1
@@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi) · 39 unmodified lines
4040
4141 of_node_put(phy_node);
4242
43− if (!phy_pdev || !msm_dsi->phy) {
43+ if (!phy_pdev) {
44+ DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
45+ return -EPROBE_DEFER;
46+ }
47+ if (!msm_dsi->phy) {
48+ put_device(&phy_pdev->dev);
4449 DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
4550 return -EPROBE_DEFER;
4651 }
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c+3−1
@@ -808,12 +808,14 @@ int msm_dsi_phy_enable(struct msm_dsi_phy *phy, · 807 unmodified lines
808808 struct msm_dsi_phy_clk_request *clk_req,
809809 struct msm_dsi_phy_shared_timings *shared_timings)
810810 {
811− struct device *dev = &phy->pdev->dev;
811+ struct device *dev;
812812 int ret;
813813
814814 if (!phy || !phy->cfg->ops.enable)
815815 return -EINVAL;
816816
817+ dev = &phy->pdev->dev;
818+
817819 ret = dsi_phy_enable_resource(phy);
818820 if (ret) {
819821 DRM_DEV_ERROR(dev, "%s: resource enable failed, %d\n",
drivers/gpu/drm/msm/hdmi/hdmi.c+6−1
@@ -97,10 +97,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi) · 96 unmodified lines
9797
9898 of_node_put(phy_node);
9999
100− if (!phy_pdev || !hdmi->phy) {
100+ if (!phy_pdev) {
101101 DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
102102 return -EPROBE_DEFER;
103103 }
104+ if (!hdmi->phy) {
105+ DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
106+ put_device(&phy_pdev->dev);
107+ return -EPROBE_DEFER;
108+ }
104109
105110 hdmi->phy_dev = get_device(&phy_pdev->dev);
106111
drivers/gpu/drm/msm/msm_drv.c+1−4
@@ -461,7 +461,7 @@ static int msm_init_vram(struct drm_device *dev) · 460 unmodified lines
461461 of_node_put(node);
462462 if (ret)
463463 return ret;
464− size = r.end - r.start;
464+ size = r.end - r.start + 1;
465465 DRM_INFO("using VRAM carveout: %lx@%pa\n", size, &r.start);
466466
467467 /* if we have no IOMMU, then we need to use carveout allocator.
@@ -510,7 +510,6 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 42 unmodified lines
510510 struct msm_drm_private *priv = dev_get_drvdata(dev);
511511 struct drm_device *ddev;
512512 struct msm_kms *kms;
513− struct msm_mdss *mdss;
514513 int ret, i;
515514
516515 ddev = drm_dev_alloc(drv, dev);
@@ -521,8 +520,6 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 4 unmodified lines
521520 ddev->dev_private = priv;
522521 priv->dev = ddev;
523522
524− mdss = priv->mdss;
525−
526523 priv->wq = alloc_ordered_workqueue("msm", 0);
527524 priv->hangcheck_period = DRM_MSM_HANGCHECK_DEFAULT_PERIOD;
528525
drivers/gpu/drm/msm/msm_gpu.c+3−0
@@ -703,6 +703,8 @@ static void retire_submits(struct msm_gpu *gpu) · 702 unmodified lines
703703 }
704704 }
705705 }
706+
707+ wake_up_all(&gpu->retire_event);
706708 }
707709
708710 static void retire_worker(struct kthread_work *work)
@@ -848,6 +850,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 139 unmodified lines
848850 INIT_LIST_HEAD(&gpu->active_list);
849851 mutex_init(&gpu->active_lock);
850852 mutex_init(&gpu->lock);
853+ init_waitqueue_head(&gpu->retire_event);
851854 kthread_init_work(&gpu->retire_work, retire_worker);
852855 kthread_init_work(&gpu->recover_work, recover_worker);
853856 kthread_init_work(&gpu->fault_work, fault_worker);
drivers/gpu/drm/msm/msm_gpu.h+3−0
@@ -230,6 +230,9 @@ struct msm_gpu { · 229 unmodified lines
230230 /* work for handling GPU recovery: */
231231 struct kthread_work recover_work;
232232
233+ /** retire_event: notified when submits are retired: */
234+ wait_queue_head_t retire_event;
235+
233236 /* work for handling active-list retiring: */
234237 struct kthread_work retire_work;
235238
drivers/gpu/drm/msm/msm_gpu_devfreq.c+19−2
@@ -133,6 +133,18 @@ void msm_devfreq_init(struct msm_gpu *gpu) · 132 unmodified lines
133133 CLOCK_MONOTONIC, HRTIMER_MODE_REL);
134134 }
135135
136+static void cancel_idle_work(struct msm_gpu_devfreq *df)
137+{
138+ hrtimer_cancel(&df->idle_work.timer);
139+ kthread_cancel_work_sync(&df->idle_work.work);
140+}
141+
142+static void cancel_boost_work(struct msm_gpu_devfreq *df)
143+{
144+ hrtimer_cancel(&df->boost_work.timer);
145+ kthread_cancel_work_sync(&df->boost_work.work);
146+}
147+
136148 void msm_devfreq_cleanup(struct msm_gpu *gpu)
137149 {
138150 struct msm_gpu_devfreq *df = &gpu->devfreq;
@@ -152,7 +164,12 @@ void msm_devfreq_resume(struct msm_gpu *gpu) · 13 unmodified lines
152164
153165 void msm_devfreq_suspend(struct msm_gpu *gpu)
154166 {
155− devfreq_suspend_device(gpu->devfreq.devfreq);
167+ struct msm_gpu_devfreq *df = &gpu->devfreq;
168+
169+ devfreq_suspend_device(df->devfreq);
170+
171+ cancel_idle_work(df);
172+ cancel_boost_work(df);
156173 }
157174
158175 static void msm_devfreq_boost_work(struct kthread_work *work)
@@ -196,7 +213,7 @@ void msm_devfreq_active(struct msm_gpu *gpu) · 37 unmodified lines
196213 /*
197214 * Cancel any pending transition to idle frequency:
198215 */
199− hrtimer_cancel(&df->idle_work.timer);
216+ cancel_idle_work(df);
200217
201218 idle_time = ktime_to_ms(ktime_sub(ktime_get(), df->idle_time));
202219
drivers/gpu/drm/mxsfb/mxsfb_kms.c+5−1
@@ -361,7 +361,11 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, · 360 unmodified lines
361361 bridge_state =
362362 drm_atomic_get_new_bridge_state(state,
363363 mxsfb->bridge);
364− bus_format = bridge_state->input_bus_cfg.format;
364+ if (!bridge_state)
365+ bus_format = MEDIA_BUS_FMT_FIXED;
366+ else
367+ bus_format = bridge_state->input_bus_cfg.format;
368+
365369 if (bus_format == MEDIA_BUS_FMT_FIXED) {
366370 dev_warn_once(drm->dev,
367371 "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n"
drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c+1−1
@@ -38,7 +38,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size) · 37 unmodified lines
3838 *addr += bios->imaged_addr;
3939 }
4040
41− if (unlikely(*addr + size >= bios->size)) {
41+ if (unlikely(*addr + size > bios->size)) {
4242 nvkm_error(&bios->subdev, "OOB %d %08x %08x\n", size, p, *addr);
4343 return false;
4444 }
drivers/gpu/drm/panel/panel-simple.c+1−0
@@ -588,6 +588,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) · 587 unmodified lines
588588 err = panel_dpi_probe(dev, panel);
589589 if (err)
590590 goto free_ddc;
591+ desc = panel->desc;
591592 } else {
592593 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
593594 panel_simple_parse_panel_timing_node(dev, panel, &dt);
drivers/gpu/drm/radeon/atombios_encoders.c+2−1
@@ -198,7 +198,8 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, · 197 unmodified lines
198198 * so don't register a backlight device
199199 */
200200 if ((rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) &&
201− (rdev->pdev->device == 0x6741))
201+ (rdev->pdev->device == 0x6741) &&
202+ !dmi_match(DMI_PRODUCT_NAME, "iMac12,1"))
202203 return;
203204
204205 if (!radeon_encoder->enc_priv)
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c+7−7
@@ -529,13 +529,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, · 528 unmodified lines
529529 return ret;
530530 }
531531
532− ret = clk_prepare_enable(hdmi->vpll_clk);
533− if (ret) {
534− DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n",
535− ret);
536− return ret;
537− }
538−
539532 hdmi->phy = devm_phy_optional_get(dev, "hdmi");
540533 if (IS_ERR(hdmi->phy)) {
541534 ret = PTR_ERR(hdmi->phy);
@@ -544,6 +537,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, · 2 unmodified lines
544537 return ret;
545538 }
546539
540+ ret = clk_prepare_enable(hdmi->vpll_clk);
541+ if (ret) {
542+ DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n",
543+ ret);
544+ return ret;
545+ }
546+
547547 drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
548548 drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
549549
drivers/gpu/drm/rockchip/rockchip_vop_reg.c+5−3
@@ -902,6 +902,7 @@ static const struct vop_win_phy rk3399_win01_data = { · 901 unmodified lines
902902 .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0),
903903 .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1),
904904 .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12),
905+ .x_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 21),
905906 .y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22),
906907 .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0),
907908 .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0),
@@ -912,6 +913,7 @@ static const struct vop_win_phy rk3399_win01_data = { · 4 unmodified lines
912913 .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16),
913914 .src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xff, 0),
914915 .dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0),
916+ .channel = VOP_REG(RK3288_WIN0_CTRL2, 0xff, 0),
915917 };
916918
917919 /*
@@ -922,11 +924,11 @@ static const struct vop_win_phy rk3399_win01_data = { · 4 unmodified lines
922924 static const struct vop_win_data rk3399_vop_win_data[] = {
923925 { .base = 0x00, .phy = &rk3399_win01_data,
924926 .type = DRM_PLANE_TYPE_PRIMARY },
925− { .base = 0x40, .phy = &rk3288_win01_data,
927+ { .base = 0x40, .phy = &rk3368_win01_data,
926928 .type = DRM_PLANE_TYPE_OVERLAY },
927− { .base = 0x00, .phy = &rk3288_win23_data,
929+ { .base = 0x00, .phy = &rk3368_win23_data,
928930 .type = DRM_PLANE_TYPE_OVERLAY },
929− { .base = 0x50, .phy = &rk3288_win23_data,
931+ { .base = 0x50, .phy = &rk3368_win23_data,
930932 .type = DRM_PLANE_TYPE_CURSOR },
931933 };
932934
drivers/gpu/drm/vc4/vc4_crtc.c+0−1
@@ -671,7 +671,6 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, · 670 unmodified lines
671671 const struct drm_display_mode *mode = &crtc_state->adjusted_mode;
672672 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
673673
674− mode = &crtc_state->adjusted_mode;
675674 if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) {
676675 vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000,
677676 mode->clock * 9 / 10) * 1000;
drivers/gpu/drm/vc4/vc4_dsi.c+4−10
@@ -1262,7 +1262,6 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, · 1261 unmodified lines
12621262 struct mipi_dsi_device *device)
12631263 {
12641264 struct vc4_dsi *dsi = host_to_dsi(host);
1265− int ret;
12661265
12671266 dsi->lanes = device->lanes;
12681267 dsi->channel = device->channel;
@@ -1297,18 +1296,15 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, · 28 unmodified lines
12971296 return 0;
12981297 }
12991298
1300− ret = component_add(&dsi->pdev->dev, &vc4_dsi_ops);
1301− if (ret) {
1302− mipi_dsi_host_unregister(&dsi->dsi_host);
1303− return ret;
1304− }
1305−
1306− return 0;
1299+ return component_add(&dsi->pdev->dev, &vc4_dsi_ops);
13071300 }
13081301
13091302 static int vc4_dsi_host_detach(struct mipi_dsi_host *host,
13101303 struct mipi_dsi_device *device)
13111304 {
1305+ struct vc4_dsi *dsi = host_to_dsi(host);
1306+
1307+ component_del(&dsi->pdev->dev, &vc4_dsi_ops);
13121308 return 0;
13131309 }
13141310
@@ -1686,9 +1682,7 @@ static int vc4_dsi_dev_remove(struct platform_device *pdev) · 371 unmodified lines
16861682 struct device *dev = &pdev->dev;
16871683 struct vc4_dsi *dsi = dev_get_drvdata(dev);
16881684
1689− component_del(&pdev->dev, &vc4_dsi_ops);
16901685 mipi_dsi_host_unregister(&dsi->dsi_host);
1691−
16921686 return 0;
16931687 }
16941688
drivers/gpu/drm/vc4/vc4_hdmi.c+20−9
@@ -196,14 +196,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) · 195 unmodified lines
196196 if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
197197 connected = true;
198198 } else {
199− unsigned long flags;
200− u32 hotplug;
201−
202− spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
203− hotplug = HDMI_READ(HDMI_HOTPLUG);
204− spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
205−
206− if (hotplug & VC4_HDMI_HOTPLUG_CONNECTED)
199+ if (vc4_hdmi->variant->hp_detect &&
200+ vc4_hdmi->variant->hp_detect(vc4_hdmi))
207201 connected = true;
208202 }
209203
@@ -1251,6 +1245,7 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, · 1041 unmodified lines
12511245 unsigned long long tmds_rate;
12521246
12531247 if (vc4_hdmi->variant->unsupported_odd_h_timings &&
1248+ !(mode->flags & DRM_MODE_FLAG_DBLCLK) &&
12541249 ((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
12551250 (mode->hsync_end % 2) || (mode->htotal % 2)))
12561251 return -EINVAL;
@@ -1298,6 +1293,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, · 41 unmodified lines
12981293 struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
12991294
13001295 if (vc4_hdmi->variant->unsupported_odd_h_timings &&
1296+ !(mode->flags & DRM_MODE_FLAG_DBLCLK) &&
13011297 ((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
13021298 (mode->hsync_end % 2) || (mode->htotal % 2)))
13031299 return MODE_H_ILLEGAL;
@@ -1343,6 +1339,18 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) · 39 unmodified lines
13431339 return channel_map;
13441340 }
13451341
1342+static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi)
1343+{
1344+ unsigned long flags;
1345+ u32 hotplug;
1346+
1347+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
1348+ hotplug = HDMI_READ(HDMI_HOTPLUG);
1349+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
1350+
1351+ return !!(hotplug & VC4_HDMI_HOTPLUG_CONNECTED);
1352+}
1353+
13461354 /* HDMI audio codec callbacks */
13471355 static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi,
13481356 unsigned int samplerate)
@@ -2504,7 +2512,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) · 1155 unmodified lines
25042512 * vc4_hdmi_disable_scrambling() will thus run at boot, make
25052513 * sure it's disabled, and avoid any inconsistency.
25062514 */
2507− vc4_hdmi->scdc_enabled = true;
2515+ if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK)
2516+ vc4_hdmi->scdc_enabled = true;
25082517
25092518 ret = variant->init_resources(vc4_hdmi);
25102519 if (ret)
@@ -2723,6 +2732,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { · 212 unmodified lines
27232732 .phy_rng_disable = vc5_hdmi_phy_rng_disable,
27242733 .channel_map = vc5_hdmi_channel_map,
27252734 .supports_hdr = true,
2735+ .hp_detect = vc5_hdmi_hp_detect,
27262736 };
27272737
27282738 static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
@@ -2751,6 +2761,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { · 22 unmodified lines
27512761 .phy_rng_disable = vc5_hdmi_phy_rng_disable,
27522762 .channel_map = vc5_hdmi_channel_map,
27532763 .supports_hdr = true,
2764+ .hp_detect = vc5_hdmi_hp_detect,
27542765 };
27552766
27562767 static const struct of_device_id vc4_hdmi_dt_match[] = {
drivers/gpu/drm/vc4/vc4_hdmi.h+3−0
@@ -102,6 +102,9 @@ struct vc4_hdmi_variant { · 101 unmodified lines
102102
103103 /* Enables HDR metadata */
104104 bool supports_hdr;
105+
106+ /* Callback for hardware specific hotplug detect */
107+ bool (*hp_detect)(struct vc4_hdmi *vc4_hdmi);
105108 };
106109
107110 /* HDMI audio information */
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+2−3
@@ -1140,15 +1140,14 @@ extern int vmw_execbuf_fence_commands(struct drm_file *file_priv, · 1139 unmodified lines
11401140 struct vmw_private *dev_priv,
11411141 struct vmw_fence_obj **p_fence,
11421142 uint32_t *p_handle);
1143−extern void vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
1143+extern int vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
11441144 struct vmw_fpriv *vmw_fp,
11451145 int ret,
11461146 struct drm_vmw_fence_rep __user
11471147 *user_fence_rep,
11481148 struct vmw_fence_obj *fence,
11491149 uint32_t fence_handle,
1150− int32_t out_fence_fd,
1151− struct sync_file *sync_file);
1150+ int32_t out_fence_fd);
11521151 bool vmw_cmd_describe(const void *buf, u32 *size, char const **cmd);
11531152
11541153 /**
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c+17−16
@@ -3879,17 +3879,17 @@ int vmw_execbuf_fence_commands(struct drm_file *file_priv, · 3878 unmodified lines
38793879 * Also if copying fails, user-space will be unable to signal the fence object
38803880 * so we wait for it immediately, and then unreference the user-space reference.
38813881 */
3882−void
3882+int
38833883 vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
38843884 struct vmw_fpriv *vmw_fp, int ret,
38853885 struct drm_vmw_fence_rep __user *user_fence_rep,
38863886 struct vmw_fence_obj *fence, uint32_t fence_handle,
3887− int32_t out_fence_fd, struct sync_file *sync_file)
3887+ int32_t out_fence_fd)
38883888 {
38893889 struct drm_vmw_fence_rep fence_rep;
38903890
38913891 if (user_fence_rep == NULL)
3892− return;
3892+ return 0;
38933893
38943894 memset(&fence_rep, 0, sizeof(fence_rep));
38953895
@@ -3917,19 +3917,13 @@ vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv, · 21 unmodified lines
39173917 * handle.
39183918 */
39193919 if (unlikely(ret != 0) && (fence_rep.error == 0)) {
3920− if (sync_file)
3921− fput(sync_file->file);
3922−
3923− if (fence_rep.fd != -1) {
3924− put_unused_fd(fence_rep.fd);
3925− fence_rep.fd = -1;
3926− }
3927−
39283920 ttm_ref_object_base_unref(vmw_fp->tfile, fence_handle);
39293921 VMW_DEBUG_USER("Fence copy error. Syncing.\n");
39303922 (void) vmw_fence_obj_wait(fence, false, false,
39313923 VMW_FENCE_WAIT_TIMEOUT);
39323924 }
3925+
3926+ return ret ? -EFAULT : 0;
39333927 }
39343928
39353929 /**
@@ -4266,16 +4260,23 @@ int vmw_execbuf_process(struct drm_file *file_priv, · 330 unmodified lines
42664260
42674261 (void) vmw_fence_obj_wait(fence, false, false,
42684262 VMW_FENCE_WAIT_TIMEOUT);
4263+ }
4264+ }
4265+
4266+ ret = vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret,
4267+ user_fence_rep, fence, handle, out_fence_fd);
4268+
4269+ if (sync_file) {
4270+ if (ret) {
4271+ /* usercopy of fence failed, put the file object */
4272+ fput(sync_file->file);
4273+ put_unused_fd(out_fence_fd);
42694274 } else {
42704275 /* Link the fence with the FD created earlier */
42714276 fd_install(out_fence_fd, sync_file->file);
42724277 }
42734278 }
42744279
4275− vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret,
4276− user_fence_rep, fence, handle, out_fence_fd,
4277− sync_file);
4278−
42794280 /* Don't unreference when handing fence out */
42804281 if (unlikely(out_fence != NULL)) {
42814282 *out_fence = fence;
@@ -4293,7 +4294,7 @@ int vmw_execbuf_process(struct drm_file *file_priv, · 11 unmodified lines
42934294 */
42944295 vmw_validation_unref_lists(&val_ctx);
42954296
4296− return 0;
4297+ return ret;
42974298
42984299 out_unlock_binding:
42994300 mutex_unlock(&dev_priv->binding_mutex);
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c+1−1
@@ -1128,7 +1128,7 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data, · 1127 unmodified lines
11281128 }
11291129
11301130 vmw_execbuf_copy_fence_user(dev_priv, vmw_fp, 0, user_fence_rep, fence,
1131− handle, -1, NULL);
1131+ handle, -1);
11321132 vmw_fence_obj_unreference(&fence);
11331133 return 0;
11341134 out_no_create:
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+1−1
@@ -2501,7 +2501,7 @@ void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv, · 2500 unmodified lines
25012501 if (file_priv)
25022502 vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv),
25032503 ret, user_fence_rep, fence,
2504− handle, -1, NULL);
2504+ handle, -1);
25052505 if (out_fence)
25062506 *out_fence = fence;
25072507 else
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c+73−3
@@ -37,11 +37,11 @@ static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_ · 36 unmodified lines
3737 {
3838 union cmd_response cmd_resp;
3939
40− /* Get response with status within a max of 800 ms timeout */
40+ /* Get response with status within a max of 1600 ms timeout */
4141 if (!readl_poll_timeout(mp2->mmio + AMD_P2C_MSG(0), cmd_resp.resp,
4242 (cmd_resp.response_v2.response == sensor_sts &&
4343 cmd_resp.response_v2.status == 0 && (sid == 0xff ||
44− cmd_resp.response_v2.sensor_id == sid)), 500, 800000))
44+ cmd_resp.response_v2.sensor_id == sid)), 500, 1600000))
4545 return cmd_resp.response_v2.response;
4646
4747 return SENSOR_DISABLED;
@@ -53,6 +53,7 @@ static void amd_start_sensor_v2(struct amd_mp2_dev *privdata, struct amd_mp2_sen · 5 unmodified lines
5353
5454 cmd_base.ul = 0;
5555 cmd_base.cmd_v2.cmd_id = ENABLE_SENSOR;
56+ cmd_base.cmd_v2.intr_disable = 1;
5657 cmd_base.cmd_v2.period = info.period;
5758 cmd_base.cmd_v2.sensor_id = info.sensor_idx;
5859 cmd_base.cmd_v2.length = 16;
@@ -70,6 +71,7 @@ static void amd_stop_sensor_v2(struct amd_mp2_dev *privdata, u16 sensor_idx) · 11 unmodified lines
7071
7172 cmd_base.ul = 0;
7273 cmd_base.cmd_v2.cmd_id = DISABLE_SENSOR;
74+ cmd_base.cmd_v2.intr_disable = 1;
7375 cmd_base.cmd_v2.period = 0;
7476 cmd_base.cmd_v2.sensor_id = sensor_idx;
7577 cmd_base.cmd_v2.length = 16;
@@ -83,12 +85,51 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata) · 7 unmodified lines
8385 union sfh_cmd_base cmd_base;
8486
8587 cmd_base.cmd_v2.cmd_id = STOP_ALL_SENSORS;
88+ cmd_base.cmd_v2.intr_disable = 1;
8689 cmd_base.cmd_v2.period = 0;
8790 cmd_base.cmd_v2.sensor_id = 0;
8891
8992 writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
9093 }
9194
95+static void amd_sfh_clear_intr_v2(struct amd_mp2_dev *privdata)
96+{
97+ if (readl(privdata->mmio + AMD_P2C_MSG(4))) {
98+ writel(0, privdata->mmio + AMD_P2C_MSG(4));
99+ writel(0xf, privdata->mmio + AMD_P2C_MSG(5));
100+ }
101+}
102+
103+static void amd_sfh_clear_intr(struct amd_mp2_dev *privdata)
104+{
105+ if (privdata->mp2_ops->clear_intr)
106+ privdata->mp2_ops->clear_intr(privdata);
107+}
108+
109+static irqreturn_t amd_sfh_irq_handler(int irq, void *data)
110+{
111+ amd_sfh_clear_intr(data);
112+
113+ return IRQ_HANDLED;
114+}
115+
116+static int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata)
117+{
118+ int rc;
119+
120+ pci_intx(privdata->pdev, true);
121+
122+ rc = devm_request_irq(&privdata->pdev->dev, privdata->pdev->irq,
123+ amd_sfh_irq_handler, 0, DRIVER_NAME, privdata);
124+ if (rc) {
125+ dev_err(&privdata->pdev->dev, "failed to request irq %d err=%d\n",
126+ privdata->pdev->irq, rc);
127+ return rc;
128+ }
129+
130+ return 0;
131+}
132+
92133 void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info)
93134 {
94135 union sfh_cmd_param cmd_param;
@@ -193,6 +234,8 @@ static void amd_mp2_pci_remove(void *privdata) · 98 unmodified lines
193234 struct amd_mp2_dev *mp2 = privdata;
194235 amd_sfh_hid_client_deinit(privdata);
195236 mp2->mp2_ops->stop_all(mp2);
237+ pci_intx(mp2->pdev, false);
238+ amd_sfh_clear_intr(mp2);
196239 }
197240
198241 static const struct amd_mp2_ops amd_sfh_ops_v2 = {
@@ -200,6 +243,8 @@ static const struct amd_mp2_ops amd_sfh_ops_v2 = { · 1 unmodified line
200243 .stop = amd_stop_sensor_v2,
201244 .stop_all = amd_stop_all_sensor_v2,
202245 .response = amd_sfh_wait_response_v2,
246+ .clear_intr = amd_sfh_clear_intr_v2,
247+ .init_intr = amd_sfh_irq_init_v2,
203248 };
204249
205250 static const struct amd_mp2_ops amd_sfh_ops = {
@@ -225,6 +270,14 @@ static void mp2_select_ops(struct amd_mp2_dev *privdata) · 19 unmodified lines
225270 }
226271 }
227272
273+static int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
274+{
275+ if (privdata->mp2_ops->init_intr)
276+ return privdata->mp2_ops->init_intr(privdata);
277+
278+ return 0;
279+}
280+
228281 static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
229282 {
230283 struct amd_mp2_dev *privdata;
@@ -261,9 +314,20 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i · 30 unmodified lines
261314
262315 mp2_select_ops(privdata);
263316
317+ rc = amd_sfh_irq_init(privdata);
318+ if (rc) {
319+ dev_err(&pdev->dev, "amd_sfh_irq_init failed\n");
320+ return rc;
321+ }
322+
264323 rc = amd_sfh_hid_client_init(privdata);
265− if (rc)
324+ if (rc) {
325+ amd_sfh_clear_intr(privdata);
326+ dev_err(&pdev->dev, "amd_sfh_hid_client_init failed\n");
266327 return rc;
328+ }
329+
330+ amd_sfh_clear_intr(privdata);
267331
268332 return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
269333 }
@@ -290,6 +354,9 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev) · 20 unmodified lines
290354 }
291355 }
292356
357+ schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
358+ amd_sfh_clear_intr(mp2);
359+
293360 return 0;
294361 }
295362
@@ -312,6 +379,9 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev) · 16 unmodified lines
312379 }
313380 }
314381
382+ cancel_delayed_work_sync(&cl_data->work_buffer);
383+ amd_sfh_clear_intr(mp2);
384+
315385 return 0;
316386 }
317387
drivers/hid/amd-sfh-hid/amd_sfh_pcie.h+3−1
@@ -49,7 +49,7 @@ union sfh_cmd_base { · 48 unmodified lines
4949 } s;
5050 struct {
5151 u32 cmd_id : 4;
52− u32 intr_enable : 1;
52+ u32 intr_disable : 1;
5353 u32 rsvd1 : 3;
5454 u32 length : 7;
5555 u32 mem_type : 1;
@@ -141,5 +141,7 @@ struct amd_mp2_ops { · 85 unmodified lines
141141 void (*stop)(struct amd_mp2_dev *privdata, u16 sensor_idx);
142142 void (*stop_all)(struct amd_mp2_dev *privdata);
143143 int (*response)(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts);
144+ void (*clear_intr)(struct amd_mp2_dev *privdata);
145+ int (*init_intr)(struct amd_mp2_dev *privdata);
144146 };
145147 #endif
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c+3−1
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #define HID_USAGE_SENSOR_STATE_READY_ENUM 0x02
2828 #define HID_USAGE_SENSOR_STATE_INITIALIZING_ENUM 0x05
2929 #define HID_USAGE_SENSOR_EVENT_DATA_UPDATED_ENUM 0x04
30+#define ILLUMINANCE_MASK GENMASK(14, 0)
3031
3132 int get_report_descriptor(int sensor_idx, u8 *rep_desc)
3233 {
@@ -246,7 +247,8 @@ u8 get_input_report(u8 current_index, int sensor_idx, int report_id, struct amd_ · 213 unmodified lines
246247 get_common_inputs(&als_input.common_property, report_id);
247248 /* For ALS ,V2 Platforms uses C2P_MSG5 register instead of DRAM access method */
248249 if (supported_input == V2_STATUS)
249− als_input.illuminance_value = (int)readl(privdata->mmio + AMD_C2P_MSG(5));
250+ als_input.illuminance_value =
251+ readl(privdata->mmio + AMD_C2P_MSG(5)) & ILLUMINANCE_MASK;
250252 else
251253 als_input.illuminance_value =
252254 (int)sensor_virt_addr[0] / AMD_SFH_FW_MULTIPLIER;
drivers/hid/hid-apple.c+8−8
@@ -691,49 +691,49 @@ static const struct hid_device_id apple_devices[] = { · 690 unmodified lines
691691 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI),
692692 .driver_data = APPLE_HAS_FN },
693693 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO),
694− .driver_data = APPLE_HAS_FN },
694+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
695695 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS),
696696 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
697697 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI),
698698 .driver_data = APPLE_HAS_FN },
699699 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO),
700− .driver_data = APPLE_HAS_FN },
700+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
701701 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS),
702702 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
703703 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI),
704704 .driver_data = APPLE_HAS_FN },
705705 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO),
706− .driver_data = APPLE_HAS_FN },
706+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
707707 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS),
708708 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
709709 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI),
710710 .driver_data = APPLE_HAS_FN },
711711 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO),
712− .driver_data = APPLE_HAS_FN },
712+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
713713 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS),
714714 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
715715 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI),
716716 .driver_data = APPLE_HAS_FN },
717717 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO),
718− .driver_data = APPLE_HAS_FN },
718+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
719719 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS),
720720 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
721721 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI),
722722 .driver_data = APPLE_HAS_FN },
723723 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO),
724− .driver_data = APPLE_HAS_FN },
724+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
725725 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS),
726726 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
727727 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI),
728728 .driver_data = APPLE_HAS_FN },
729729 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO),
730− .driver_data = APPLE_HAS_FN },
730+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
731731 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS),
732732 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
733733 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI),
734734 .driver_data = APPLE_HAS_FN },
735735 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO),
736− .driver_data = APPLE_HAS_FN },
736+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
737737 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
738738 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
739739 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
drivers/hid/hid-elo.c+1−0
@@ -262,6 +262,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) · 261 unmodified lines
262262
263263 return 0;
264264 err_free:
265+ usb_put_dev(udev);
265266 kfree(priv);
266267 return ret;
267268 }
drivers/hid/hid-ids.h+1−0
@@ -1370,6 +1370,7 @@ · 1369 unmodified lines
13701370 #define USB_VENDOR_ID_UGTIZER 0x2179
13711371 #define USB_DEVICE_ID_UGTIZER_TABLET_GP0610 0x0053
13721372 #define USB_DEVICE_ID_UGTIZER_TABLET_GT5040 0x0077
1373+#define USB_DEVICE_ID_UGTIZER_TABLET_WP5540 0x0004
13731374
13741375 #define USB_VENDOR_ID_VIEWSONIC 0x0543
13751376 #define USB_DEVICE_ID_VIEWSONIC_PD1011 0xe621
drivers/hid/hid-quirks.c+1−0
@@ -187,6 +187,7 @@ static const struct hid_device_id hid_quirks[] = { · 186 unmodified lines
187187 { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD), HID_QUIRK_NOGET },
188188 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5), HID_QUIRK_MULTI_INPUT },
189189 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60), HID_QUIRK_MULTI_INPUT },
190+ { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, USB_DEVICE_ID_UGTIZER_TABLET_WP5540), HID_QUIRK_MULTI_INPUT },
190191 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH), HID_QUIRK_MULTI_INPUT },
191192 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH), HID_QUIRK_MULTI_INPUT },
192193 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT },
drivers/hid/i2c-hid/i2c-hid-of-goodix.c+12−16
@@ -27,7 +27,6 @@ struct i2c_hid_of_goodix { · 26 unmodified lines
2727
2828 struct regulator *vdd;
2929 struct notifier_block nb;
30− struct mutex regulator_mutex;
3130 struct gpio_desc *reset_gpio;
3231 const struct goodix_i2c_hid_timing_data *timings;
3332 };
@@ -67,8 +66,6 @@ static int ihid_goodix_vdd_notify(struct notifier_block *nb, · 33 unmodified lines
6766 container_of(nb, struct i2c_hid_of_goodix, nb);
6867 int ret = NOTIFY_OK;
6968
70− mutex_lock(&ihid_goodix->regulator_mutex);
71−
7269 switch (event) {
7370 case REGULATOR_EVENT_PRE_DISABLE:
7471 gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1);
@@ -87,8 +84,6 @@ static int ihid_goodix_vdd_notify(struct notifier_block *nb, · 12 unmodified lines
8784 break;
8885 }
8986
90− mutex_unlock(&ihid_goodix->regulator_mutex);
91−
9287 return ret;
9388 }
9489
@@ -102,8 +97,6 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client, · 7 unmodified lines
10297 if (!ihid_goodix)
10398 return -ENOMEM;
10499
105− mutex_init(&ihid_goodix->regulator_mutex);
106−
107100 ihid_goodix->ops.power_up = goodix_i2c_hid_power_up;
108101 ihid_goodix->ops.power_down = goodix_i2c_hid_power_down;
109102
@@ -130,25 +123,28 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client, · 20 unmodified lines
130123 * long. Holding the controller in reset apparently draws extra
131124 * power.
132125 */
133− mutex_lock(&ihid_goodix->regulator_mutex);
134126 ihid_goodix->nb.notifier_call = ihid_goodix_vdd_notify;
135127 ret = devm_regulator_register_notifier(ihid_goodix->vdd, &ihid_goodix->nb);
136− if (ret) {
137− mutex_unlock(&ihid_goodix->regulator_mutex);
128+ if (ret)
138129 return dev_err_probe(&client->dev, ret,
139130 "regulator notifier request failed\n");
140− }
141131
142132 /*
143133 * If someone else is holding the regulator on (or the regulator is
144134 * an always-on one) we might never be told to deassert reset. Do it
145− * now. Here we'll assume that someone else might have _just
146− * barely_ turned the regulator on so we'll do the full
147− * "post_power_delay" just in case.
135+ * now... and temporarily bump the regulator reference count just to
136+ * make sure it is impossible for this to race with our own notifier!
137+ * We also assume that someone else might have _just barely_ turned
138+ * the regulator on so we'll do the full "post_power_delay" just in
139+ * case.
148140 */
149− if (ihid_goodix->reset_gpio && regulator_is_enabled(ihid_goodix->vdd))
141+ if (ihid_goodix->reset_gpio && regulator_is_enabled(ihid_goodix->vdd)) {
142+ ret = regulator_enable(ihid_goodix->vdd);
143+ if (ret)
144+ return ret;
150145 goodix_i2c_hid_deassert_reset(ihid_goodix, true);
151− mutex_unlock(&ihid_goodix->regulator_mutex);
146+ regulator_disable(ihid_goodix->vdd);
147+ }
152148
153149 return i2c_hid_core_probe(client, &ihid_goodix->ops, 0x0001, 0);
154150 }
drivers/hv/hv_balloon.c+7−0
@@ -1660,6 +1660,13 @@ static int balloon_connect_vsp(struct hv_device *dev) · 1659 unmodified lines
16601660 unsigned long t;
16611661 int ret;
16621662
1663+ /*
1664+ * max_pkt_size should be large enough for one vmbus packet header plus
1665+ * our receive buffer size. Hyper-V sends messages up to
1666+ * HV_HYP_PAGE_SIZE bytes long on balloon channel.
1667+ */
1668+ dev->channel->max_pkt_size = HV_HYP_PAGE_SIZE * 2;
1669+
16631670 ret = vmbus_open(dev->channel, dm_ring_size, dm_ring_size, NULL, 0,
16641671 balloon_onchannelcallback, dev);
16651672 if (ret)
drivers/hv/hv_utils_transport.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include "hv_utils_transport.h"
1414
1515 static DEFINE_SPINLOCK(hvt_list_lock);
16−static struct list_head hvt_list = LIST_HEAD_INIT(hvt_list);
16+static LIST_HEAD(hvt_list);
1717
1818 static void hvt_reset(struct hvutil_transport *hvt)
1919 {
drivers/hv/vmbus_drv.c+6−3
@@ -2028,8 +2028,10 @@ int vmbus_add_channel_kobj(struct hv_device *dev, struct vmbus_channel *channel) · 2027 unmodified lines
20282028 kobj->kset = dev->channels_kset;
20292029 ret = kobject_init_and_add(kobj, &vmbus_chan_ktype, NULL,
20302030 "%u", relid);
2031− if (ret)
2031+ if (ret) {
2032+ kobject_put(kobj);
20322033 return ret;
2034+ }
20332035
20342036 ret = sysfs_create_group(kobj, &vmbus_chan_group);
20352037
@@ -2038,6 +2040,7 @@ int vmbus_add_channel_kobj(struct hv_device *dev, struct vmbus_channel *channel) · 2 unmodified lines
20382040 * The calling functions' error handling paths will cleanup the
20392041 * empty channel directory.
20402042 */
2043+ kobject_put(kobj);
20412044 dev_err(device, "Unable to set up channel sysfs files\n");
20422045 return ret;
20432046 }
@@ -2079,7 +2082,6 @@ struct hv_device *vmbus_device_create(const guid_t *type, · 35 unmodified lines
20792082 return child_device_obj;
20802083 }
20812084
2082−static u64 vmbus_dma_mask = DMA_BIT_MASK(64);
20832085 /*
20842086 * vmbus_device_register - Register the child device
20852087 */
@@ -2120,8 +2122,9 @@ int vmbus_device_register(struct hv_device *child_device_obj) · 34 unmodified lines
21202122 }
21212123 hv_debug_add_dev_dir(child_device_obj);
21222124
2123− child_device_obj->device.dma_mask = &vmbus_dma_mask;
21242125 child_device_obj->device.dma_parms = &child_device_obj->dma_parms;
2126+ child_device_obj->device.dma_mask = &child_device_obj->dma_mask;
2127+ dma_set_mask(&child_device_obj->device, DMA_BIT_MASK(64));
21252128 return 0;
21262129
21272130 err_kset_unregister:
drivers/hwmon/adt7470.c+3−0
@@ -662,6 +662,9 @@ static int adt7470_fan_write(struct device *dev, u32 attr, int channel, long val · 661 unmodified lines
662662 struct adt7470_data *data = dev_get_drvdata(dev);
663663 int err;
664664
665+ if (val <= 0)
666+ return -EINVAL;
667+
665668 val = FAN_RPM_TO_PERIOD(val);
666669 val = clamp_val(val, 1, 65534);
667670
drivers/hwmon/lm90.c+11−10
@@ -373,7 +373,7 @@ static const struct lm90_params lm90_params[] = { · 372 unmodified lines
373373 .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
374374 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT,
375375 .alert_alarms = 0x7c,
376− .max_convrate = 8,
376+ .max_convrate = 7,
377377 },
378378 [lm86] = {
379379 .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
@@ -394,12 +394,13 @@ static const struct lm90_params lm90_params[] = { · 14 unmodified lines
394394 .max_convrate = 9,
395395 },
396396 [max6646] = {
397− .flags = LM90_HAVE_CRIT,
397+ .flags = LM90_HAVE_CRIT | LM90_HAVE_BROKEN_ALERT,
398398 .alert_alarms = 0x7c,
399399 .max_convrate = 6,
400400 .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
401401 },
402402 [max6654] = {
403+ .flags = LM90_HAVE_BROKEN_ALERT,
403404 .alert_alarms = 0x7c,
404405 .max_convrate = 7,
405406 .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
@@ -418,7 +419,7 @@ static const struct lm90_params lm90_params[] = { · 12 unmodified lines
418419 },
419420 [max6680] = {
420421 .flags = LM90_HAVE_OFFSET | LM90_HAVE_CRIT
421− | LM90_HAVE_CRIT_ALRM_SWP,
422+ | LM90_HAVE_CRIT_ALRM_SWP | LM90_HAVE_BROKEN_ALERT,
422423 .alert_alarms = 0x7c,
423424 .max_convrate = 7,
424425 },
@@ -848,7 +849,7 @@ static int lm90_update_device(struct device *dev) · 423 unmodified lines
848849 * Re-enable ALERT# output if it was originally enabled and
849850 * relevant alarms are all clear
850851 */
851− if (!(data->config_orig & 0x80) &&
852+ if ((client->irq || !(data->config_orig & 0x80)) &&
852853 !(data->alarms & data->alert_alarms)) {
853854 if (data->config & 0x80) {
854855 dev_dbg(&client->dev, "Re-enabling ALERT#\n");
@@ -1807,22 +1808,22 @@ static bool lm90_is_tripped(struct i2c_client *client, u16 *status) · 952 unmodified lines
18071808
18081809 if (st & LM90_STATUS_LLOW)
18091810 hwmon_notify_event(data->hwmon_dev, hwmon_temp,
1810− hwmon_temp_min, 0);
1811+ hwmon_temp_min_alarm, 0);
18111812 if (st & LM90_STATUS_RLOW)
18121813 hwmon_notify_event(data->hwmon_dev, hwmon_temp,
1813− hwmon_temp_min, 1);
1814+ hwmon_temp_min_alarm, 1);
18141815 if (st2 & MAX6696_STATUS2_R2LOW)
18151816 hwmon_notify_event(data->hwmon_dev, hwmon_temp,
1816− hwmon_temp_min, 2);
1817+ hwmon_temp_min_alarm, 2);
18171818 if (st & LM90_STATUS_LHIGH)
18181819 hwmon_notify_event(data->hwmon_dev, hwmon_temp,
1819− hwmon_temp_max, 0);
1820+ hwmon_temp_max_alarm, 0);
18201821 if (st & LM90_STATUS_RHIGH)
18211822 hwmon_notify_event(data->hwmon_dev, hwmon_temp,
1822− hwmon_temp_max, 1);
1823+ hwmon_temp_max_alarm, 1);
18231824 if (st2 & MAX6696_STATUS2_R2HIGH)
18241825 hwmon_notify_event(data->hwmon_dev, hwmon_temp,
1825− hwmon_temp_max, 2);
1826+ hwmon_temp_max_alarm, 2);
18261827
18271828 return true;
18281829 }
drivers/hwmon/nct6775.c+3−3
@@ -1175,7 +1175,7 @@ static inline u8 in_to_reg(u32 val, u8 nr) · 1174 unmodified lines
11751175
11761176 struct nct6775_data {
11771177 int addr; /* IO base of hw monitor block */
1178− int sioreg; /* SIO register address */
1178+ struct nct6775_sio_data *sio_data;
11791179 enum kinds kind;
11801180 const char *name;
11811181
@@ -3559,7 +3559,7 @@ clear_caseopen(struct device *dev, struct device_attribute *attr, · 2377 unmodified lines
35593559 const char *buf, size_t count)
35603560 {
35613561 struct nct6775_data *data = dev_get_drvdata(dev);
3562− struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
3562+ struct nct6775_sio_data *sio_data = data->sio_data;
35633563 int nr = to_sensor_dev_attr(attr)->index - INTRUSION_ALARM_BASE;
35643564 unsigned long val;
35653565 u8 reg;
@@ -3967,7 +3967,7 @@ static int nct6775_probe(struct platform_device *pdev) · 401 unmodified lines
39673967 return -ENOMEM;
39683968
39693969 data->kind = sio_data->kind;
3970− data->sioreg = sio_data->sioreg;
3970+ data->sio_data = sio_data;
39713971
39723972 if (sio_data->access == access_direct) {
39733973 data->addr = res->start;
drivers/hwmon/pmbus/ir38064.c+1−1
@@ -62,7 +62,7 @@ static const struct i2c_device_id ir38064_id[] = { · 61 unmodified lines
6262
6363 MODULE_DEVICE_TABLE(i2c, ir38064_id);
6464
65−static const struct of_device_id ir38064_of_match[] = {
65+static const struct of_device_id __maybe_unused ir38064_of_match[] = {
6666 { .compatible = "infineon,ir38060" },
6767 { .compatible = "infineon,ir38064" },
6868 { .compatible = "infineon,ir38164" },
drivers/i2c/busses/Kconfig+3−3
@@ -488,7 +488,7 @@ config I2C_BRCMSTB · 487 unmodified lines
488488
489489 config I2C_CADENCE
490490 tristate "Cadence I2C Controller"
491− depends on ARCH_ZYNQ || ARM64 || XTENSA
491+ depends on ARCH_ZYNQ || ARM64 || XTENSA || COMPILE_TEST
492492 help
493493 Say yes here to select Cadence I2C Host Controller. This controller is
494494 e.g. used by Xilinx Zynq.
@@ -680,7 +680,7 @@ config I2C_IMG · 185 unmodified lines
680680
681681 config I2C_IMX
682682 tristate "IMX I2C interface"
683− depends on ARCH_MXC || ARCH_LAYERSCAPE || COLDFIRE
683+ depends on ARCH_MXC || ARCH_LAYERSCAPE || COLDFIRE || COMPILE_TEST
684684 select I2C_SLAVE
685685 help
686686 Say Y here if you want to use the IIC bus controller on
@@ -935,7 +935,7 @@ config I2C_QCOM_GENI · 248 unmodified lines
935935
936936 config I2C_QUP
937937 tristate "Qualcomm QUP based I2C controller"
938− depends on ARCH_QCOM
938+ depends on ARCH_QCOM || COMPILE_TEST
939939 help
940940 If you say yes to this option, support will be included for the
941941 built-in I2C interface on the Qualcomm SoCs.
drivers/i2c/busses/i2c-bcm2835.c+11−0
@@ -23,6 +23,11 @@ · 22 unmodified lines
2323 #define BCM2835_I2C_FIFO 0x10
2424 #define BCM2835_I2C_DIV 0x14
2525 #define BCM2835_I2C_DEL 0x18
26+/*
27+ * 16-bit field for the number of SCL cycles to wait after rising SCL
28+ * before deciding the slave is not responding. 0 disables the
29+ * timeout detection.
30+ */
2631 #define BCM2835_I2C_CLKT 0x1c
2732
2833 #define BCM2835_I2C_C_READ BIT(0)
@@ -474,6 +479,12 @@ static int bcm2835_i2c_probe(struct platform_device *pdev) · 445 unmodified lines
474479 adap->dev.of_node = pdev->dev.of_node;
475480 adap->quirks = of_device_get_match_data(&pdev->dev);
476481
482+ /*
483+ * Disable the hardware clock stretching timeout. SMBUS
484+ * specifies a limit for how long the device can stretch the
485+ * clock, but core I2C doesn't.
486+ */
487+ bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_CLKT, 0);
477488 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0);
478489
479490 ret = i2c_add_adapter(adap);
drivers/i2c/busses/i2c-brcmstb.c+1−1
@@ -673,7 +673,7 @@ static int brcmstb_i2c_probe(struct platform_device *pdev) · 672 unmodified lines
673673
674674 /* set the data in/out register size for compatible SoCs */
675675 if (of_device_is_compatible(dev->device->of_node,
676− "brcmstb,brcmper-i2c"))
676+ "brcm,brcmper-i2c"))
677677 dev->data_regsz = sizeof(u8);
678678 else
679679 dev->data_regsz = sizeof(u32);
drivers/i2c/busses/i2c-qcom-cci.c+11−5
@@ -558,7 +558,7 @@ static int cci_probe(struct platform_device *pdev) · 557 unmodified lines
558558 cci->master[idx].adap.quirks = &cci->data->quirks;
559559 cci->master[idx].adap.algo = &cci_algo;
560560 cci->master[idx].adap.dev.parent = dev;
561− cci->master[idx].adap.dev.of_node = child;
561+ cci->master[idx].adap.dev.of_node = of_node_get(child);
562562 cci->master[idx].master = idx;
563563 cci->master[idx].cci = cci;
564564
@@ -643,8 +643,10 @@ static int cci_probe(struct platform_device *pdev) · 78 unmodified lines
643643 continue;
644644
645645 ret = i2c_add_adapter(&cci->master[i].adap);
646− if (ret < 0)
646+ if (ret < 0) {
647+ of_node_put(cci->master[i].adap.dev.of_node);
647648 goto error_i2c;
649+ }
648650 }
649651
650652 pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC);
@@ -655,9 +657,11 @@ static int cci_probe(struct platform_device *pdev) · 4 unmodified lines
655657 return 0;
656658
657659 error_i2c:
658− for (; i >= 0; i--) {
659− if (cci->master[i].cci)
660+ for (--i ; i >= 0; i--) {
661+ if (cci->master[i].cci) {
660662 i2c_del_adapter(&cci->master[i].adap);
663+ of_node_put(cci->master[i].adap.dev.of_node);
664+ }
661665 }
662666 error:
663667 disable_irq(cci->irq);
@@ -673,8 +677,10 @@ static int cci_remove(struct platform_device *pdev) · 9 unmodified lines
673677 int i;
674678
675679 for (i = 0; i < cci->data->num_masters; i++) {
676− if (cci->master[i].cci)
680+ if (cci->master[i].cci) {
677681 i2c_del_adapter(&cci->master[i].adap);
682+ of_node_put(cci->master[i].adap.dev.of_node);
683+ }
678684 cci_halt(cci, i);
679685 }
680686
drivers/iio/industrialio-buffer.c+11−3
@@ -1569,9 +1569,17 @@ static long iio_device_buffer_getfd(struct iio_dev *indio_dev, unsigned long arg · 1568 unmodified lines
15691569 }
15701570
15711571 if (copy_to_user(ival, &fd, sizeof(fd))) {
1572− put_unused_fd(fd);
1573− ret = -EFAULT;
1574− goto error_free_ib;
1572+ /*
1573+ * "Leak" the fd, as there's not much we can do about this
1574+ * anyway. 'fd' might have been closed already, as
1575+ * anon_inode_getfd() called fd_install() on it, which made
1576+ * it reachable by userland.
1577+ *
1578+ * Instead of allowing a malicious user to play tricks with
1579+ * us, rely on the process exit path to do any necessary
1580+ * cleanup, as in releasing the file, if still needed.
1581+ */
1582+ return -EFAULT;
15751583 }
15761584
15771585 return 0;
drivers/infiniband/core/cm.c+1−1
@@ -3322,7 +3322,7 @@ static int cm_lap_handler(struct cm_work *work) · 3321 unmodified lines
33223322 ret = cm_init_av_by_path(param->alternate_path, NULL, &alt_av);
33233323 if (ret) {
33243324 rdma_destroy_ah_attr(&ah_attr);
3325− return -EINVAL;
3325+ goto deref;
33263326 }
33273327
33283328 spin_lock_irq(&cm_id_priv->lock);
drivers/infiniband/core/cma.c+12−10
@@ -67,8 +67,8 @@ static const char * const cma_events[] = { · 66 unmodified lines
6767 [RDMA_CM_EVENT_TIMEWAIT_EXIT] = "timewait exit",
6868 };
6969
70−static void cma_set_mgid(struct rdma_id_private *id_priv, struct sockaddr *addr,
71− union ib_gid *mgid);
70+static void cma_iboe_set_mgid(struct sockaddr *addr, union ib_gid *mgid,
71+ enum ib_gid_type gid_type);
7272
7373 const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event)
7474 {
@@ -1846,17 +1846,19 @@ static void destroy_mc(struct rdma_id_private *id_priv, · 1771 unmodified lines
18461846 if (dev_addr->bound_dev_if)
18471847 ndev = dev_get_by_index(dev_addr->net,
18481848 dev_addr->bound_dev_if);
1849− if (ndev) {
1849+ if (ndev && !send_only) {
1850+ enum ib_gid_type gid_type;
18501851 union ib_gid mgid;
18511852
1852− cma_set_mgid(id_priv, (struct sockaddr *)&mc->addr,
1853− &mgid);
1854−
1855− if (!send_only)
1856− cma_igmp_send(ndev, &mgid, false);
1857−
1858− dev_put(ndev);
1853+ gid_type = id_priv->cma_dev->default_gid_type
1854+ [id_priv->id.port_num -
1855+ rdma_start_port(
1856+ id_priv->cma_dev->device)];
1857+ cma_iboe_set_mgid((struct sockaddr *)&mc->addr, &mgid,
1858+ gid_type);
1859+ cma_igmp_send(ndev, &mgid, false);
18591860 }
1861+ dev_put(ndev);
18601862
18611863 cancel_work_sync(&mc->iboe_join.work);
18621864 }
drivers/infiniband/core/ucma.c+23−11
@@ -95,6 +95,7 @@ struct ucma_context { · 94 unmodified lines
9595 u64 uid;
9696
9797 struct list_head list;
98+ struct list_head mc_list;
9899 struct work_struct close_work;
99100 };
100101
@@ -105,6 +106,7 @@ struct ucma_multicast { · 4 unmodified lines
105106
106107 u64 uid;
107108 u8 join_state;
109+ struct list_head list;
108110 struct sockaddr_storage addr;
109111 };
110112
@@ -198,6 +200,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file) · 87 unmodified lines
198200
199201 INIT_WORK(&ctx->close_work, ucma_close_id);
200202 init_completion(&ctx->comp);
203+ INIT_LIST_HEAD(&ctx->mc_list);
201204 /* So list_del() will work if we don't do ucma_finish_ctx() */
202205 INIT_LIST_HEAD(&ctx->list);
203206 ctx->file = file;
@@ -484,19 +487,19 @@ err1: · 280 unmodified lines
484487
485488 static void ucma_cleanup_multicast(struct ucma_context *ctx)
486489 {
487− struct ucma_multicast *mc;
488− unsigned long index;
490+ struct ucma_multicast *mc, *tmp;
489491
490− xa_for_each(&multicast_table, index, mc) {
491− if (mc->ctx != ctx)
492− continue;
492+ xa_lock(&multicast_table);
493+ list_for_each_entry_safe(mc, tmp, &ctx->mc_list, list) {
494+ list_del(&mc->list);
493495 /*
494496 * At this point mc->ctx->ref is 0 so the mc cannot leave the
495497 * lock on the reader and this is enough serialization
496498 */
497− xa_erase(&multicast_table, index);
499+ __xa_erase(&multicast_table, mc->id);
498500 kfree(mc);
499501 }
502+ xa_unlock(&multicast_table);
500503 }
501504
502505 static void ucma_cleanup_mc_events(struct ucma_multicast *mc)
@@ -1469,12 +1472,16 @@ static ssize_t ucma_process_join(struct ucma_file *file, · 966 unmodified lines
14691472 mc->uid = cmd->uid;
14701473 memcpy(&mc->addr, addr, cmd->addr_size);
14711474
1472− if (xa_alloc(&multicast_table, &mc->id, NULL, xa_limit_32b,
1475+ xa_lock(&multicast_table);
1476+ if (__xa_alloc(&multicast_table, &mc->id, NULL, xa_limit_32b,
14731477 GFP_KERNEL)) {
14741478 ret = -ENOMEM;
14751479 goto err_free_mc;
14761480 }
14771481
1482+ list_add_tail(&mc->list, &ctx->mc_list);
1483+ xa_unlock(&multicast_table);
1484+
14781485 mutex_lock(&ctx->mutex);
14791486 ret = rdma_join_multicast(ctx->cm_id, (struct sockaddr *)&mc->addr,
14801487 join_state, mc);
@@ -1500,8 +1507,11 @@ err_leave_multicast: · 19 unmodified lines
15001507 mutex_unlock(&ctx->mutex);
15011508 ucma_cleanup_mc_events(mc);
15021509 err_xa_erase:
1503− xa_erase(&multicast_table, mc->id);
1510+ xa_lock(&multicast_table);
1511+ list_del(&mc->list);
1512+ __xa_erase(&multicast_table, mc->id);
15041513 err_free_mc:
1514+ xa_unlock(&multicast_table);
15051515 kfree(mc);
15061516 err_put_ctx:
15071517 ucma_put_ctx(ctx);
@@ -1569,15 +1579,17 @@ static ssize_t ucma_leave_multicast(struct ucma_file *file, · 61 unmodified lines
15691579 mc = ERR_PTR(-EINVAL);
15701580 else if (!refcount_inc_not_zero(&mc->ctx->ref))
15711581 mc = ERR_PTR(-ENXIO);
1572− else
1573− __xa_erase(&multicast_table, mc->id);
1574− xa_unlock(&multicast_table);
15751582
15761583 if (IS_ERR(mc)) {
1584+ xa_unlock(&multicast_table);
15771585 ret = PTR_ERR(mc);
15781586 goto out;
15791587 }
15801588
1589+ list_del(&mc->list);
1590+ __xa_erase(&multicast_table, mc->id);
1591+ xa_unlock(&multicast_table);
1592+
15811593 mutex_lock(&mc->ctx->mutex);
15821594 rdma_leave_multicast(mc->ctx->cm_id, (struct sockaddr *) &mc->addr);
15831595 mutex_unlock(&mc->ctx->mutex);
drivers/infiniband/hw/hfi1/ipoib.h+1−1
@@ -55,7 +55,7 @@ union hfi1_ipoib_flow { · 54 unmodified lines
5555 */
5656 struct ipoib_txreq {
5757 struct sdma_txreq txreq;
58− struct hfi1_sdma_header sdma_hdr;
58+ struct hfi1_sdma_header *sdma_hdr;
5959 int sdma_status;
6060 int complete;
6161 struct hfi1_ipoib_dev_priv *priv;
drivers/infiniband/hw/hfi1/ipoib_main.c+15−12
@@ -22,26 +22,35 @@ static int hfi1_ipoib_dev_init(struct net_device *dev) · 21 unmodified lines
2222 int ret;
2323
2424 dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
25+ if (!dev->tstats)
26+ return -ENOMEM;
2527
2628 ret = priv->netdev_ops->ndo_init(dev);
2729 if (ret)
28− return ret;
30+ goto out_ret;
2931
3032 ret = hfi1_netdev_add_data(priv->dd,
3133 qpn_from_mac(priv->netdev->dev_addr),
3234 dev);
3335 if (ret < 0) {
3436 priv->netdev_ops->ndo_uninit(dev);
35− return ret;
37+ goto out_ret;
3638 }
3739
3840 return 0;
41+out_ret:
42+ free_percpu(dev->tstats);
43+ dev->tstats = NULL;
44+ return ret;
3945 }
4046
4147 static void hfi1_ipoib_dev_uninit(struct net_device *dev)
4248 {
4349 struct hfi1_ipoib_dev_priv *priv = hfi1_ipoib_priv(dev);
4450
51+ free_percpu(dev->tstats);
52+ dev->tstats = NULL;
53+
4554 hfi1_netdev_remove_data(priv->dd, qpn_from_mac(priv->netdev->dev_addr));
4655
4756 priv->netdev_ops->ndo_uninit(dev);
@@ -166,12 +175,7 @@ static void hfi1_ipoib_netdev_dtor(struct net_device *dev) · 118 unmodified lines
166175 hfi1_ipoib_rxq_deinit(priv->netdev);
167176
168177 free_percpu(dev->tstats);
169−}
170−
171−static void hfi1_ipoib_free_rdma_netdev(struct net_device *dev)
172−{
173− hfi1_ipoib_netdev_dtor(dev);
174− free_netdev(dev);
178+ dev->tstats = NULL;
175179 }
176180
177181 static void hfi1_ipoib_set_id(struct net_device *dev, int id)
@@ -211,24 +215,23 @@ static int hfi1_ipoib_setup_rn(struct ib_device *device, · 33 unmodified lines
211215 priv->port_num = port_num;
212216 priv->netdev_ops = netdev->netdev_ops;
213217
214− netdev->netdev_ops = &hfi1_ipoib_netdev_ops;
215−
216218 ib_query_pkey(device, port_num, priv->pkey_index, &priv->pkey);
217219
218220 rc = hfi1_ipoib_txreq_init(priv);
219221 if (rc) {
220222 dd_dev_err(dd, "IPoIB netdev TX init - failed(%d)\n", rc);
221− hfi1_ipoib_free_rdma_netdev(netdev);
222223 return rc;
223224 }
224225
225226 rc = hfi1_ipoib_rxq_init(netdev);
226227 if (rc) {
227228 dd_dev_err(dd, "IPoIB netdev RX init - failed(%d)\n", rc);
228− hfi1_ipoib_free_rdma_netdev(netdev);
229+ hfi1_ipoib_txreq_deinit(priv);
229230 return rc;
230231 }
231232
233+ netdev->netdev_ops = &hfi1_ipoib_netdev_ops;
234+
232235 netdev->priv_destructor = hfi1_ipoib_netdev_dtor;
233236 netdev->needs_free_netdev = true;
234237
drivers/infiniband/hw/hfi1/ipoib_tx.c+26−12
@@ -122,7 +122,7 @@ static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget) · 121 unmodified lines
122122 dd_dev_warn(priv->dd,
123123 "%s: Status = 0x%x pbc 0x%llx txq = %d sde = %d\n",
124124 __func__, tx->sdma_status,
125− le64_to_cpu(tx->sdma_hdr.pbc), tx->txq->q_idx,
125+ le64_to_cpu(tx->sdma_hdr->pbc), tx->txq->q_idx,
126126 tx->txq->sde->this_idx);
127127 }
128128
@@ -231,7 +231,7 @@ static int hfi1_ipoib_build_tx_desc(struct ipoib_txreq *tx, · 102 unmodified lines
231231 {
232232 struct hfi1_devdata *dd = txp->dd;
233233 struct sdma_txreq *txreq = &tx->txreq;
234− struct hfi1_sdma_header *sdma_hdr = &tx->sdma_hdr;
234+ struct hfi1_sdma_header *sdma_hdr = tx->sdma_hdr;
235235 u16 pkt_bytes =
236236 sizeof(sdma_hdr->pbc) + (txp->hdr_dwords << 2) + tx->skb->len;
237237 int ret;
@@ -256,7 +256,7 @@ static void hfi1_ipoib_build_ib_tx_headers(struct ipoib_txreq *tx, · 18 unmodified lines
256256 struct ipoib_txparms *txp)
257257 {
258258 struct hfi1_ipoib_dev_priv *priv = tx->txq->priv;
259− struct hfi1_sdma_header *sdma_hdr = &tx->sdma_hdr;
259+ struct hfi1_sdma_header *sdma_hdr = tx->sdma_hdr;
260260 struct sk_buff *skb = tx->skb;
261261 struct hfi1_pportdata *ppd = ppd_from_ibp(txp->ibp);
262262 struct rdma_ah_attr *ah_attr = txp->ah_attr;
@@ -483,7 +483,7 @@ static int hfi1_ipoib_send_dma_single(struct net_device *dev, · 220 unmodified lines
483483 if (likely(!ret)) {
484484 tx_ok:
485485 trace_sdma_output_ibhdr(txq->priv->dd,
486− &tx->sdma_hdr.hdr,
486+ &tx->sdma_hdr->hdr,
487487 ib_is_sc5(txp->flow.sc5));
488488 hfi1_ipoib_check_queue_depth(txq);
489489 return NETDEV_TX_OK;
@@ -547,7 +547,7 @@ static int hfi1_ipoib_send_dma_list(struct net_device *dev, · 57 unmodified lines
547547 hfi1_ipoib_check_queue_depth(txq);
548548
549549 trace_sdma_output_ibhdr(txq->priv->dd,
550− &tx->sdma_hdr.hdr,
550+ &tx->sdma_hdr->hdr,
551551 ib_is_sc5(txp->flow.sc5));
552552
553553 if (!netdev_xmit_more())
@@ -683,7 +683,8 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) · 129 unmodified lines
683683 {
684684 struct net_device *dev = priv->netdev;
685685 u32 tx_ring_size, tx_item_size;
686− int i;
686+ struct hfi1_ipoib_circ_buf *tx_ring;
687+ int i, j;
687688
688689 /*
689690 * Ring holds 1 less than tx_ring_size
@@ -701,7 +702,9 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) · 11 unmodified lines
701702
702703 for (i = 0; i < dev->num_tx_queues; i++) {
703704 struct hfi1_ipoib_txq *txq = &priv->txqs[i];
705+ struct ipoib_txreq *tx;
704706
707+ tx_ring = &txq->tx_ring;
705708 iowait_init(&txq->wait,
706709 0,
707710 hfi1_ipoib_flush_txq,
@@ -725,14 +728,19 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) · 17 unmodified lines
725728 priv->dd->node);
726729
727730 txq->tx_ring.items =
728− kcalloc_node(tx_ring_size, tx_item_size,
729− GFP_KERNEL, priv->dd->node);
731+ kvzalloc_node(array_size(tx_ring_size, tx_item_size),
732+ GFP_KERNEL, priv->dd->node);
730733 if (!txq->tx_ring.items)
731734 goto free_txqs;
732735
733736 txq->tx_ring.max_items = tx_ring_size;
734− txq->tx_ring.shift = ilog2(tx_ring_size);
737+ txq->tx_ring.shift = ilog2(tx_item_size);
735738 txq->tx_ring.avail = hfi1_ipoib_ring_hwat(txq);
739+ tx_ring = &txq->tx_ring;
740+ for (j = 0; j < tx_ring_size; j++)
741+ hfi1_txreq_from_idx(tx_ring, j)->sdma_hdr =
742+ kzalloc_node(sizeof(*tx->sdma_hdr),
743+ GFP_KERNEL, priv->dd->node);
736744
737745 netif_tx_napi_add(dev, &txq->napi,
738746 hfi1_ipoib_poll_tx_ring,
@@ -746,7 +754,10 @@ free_txqs: · 7 unmodified lines
746754 struct hfi1_ipoib_txq *txq = &priv->txqs[i];
747755
748756 netif_napi_del(&txq->napi);
749− kfree(txq->tx_ring.items);
757+ tx_ring = &txq->tx_ring;
758+ for (j = 0; j < tx_ring_size; j++)
759+ kfree(hfi1_txreq_from_idx(tx_ring, j)->sdma_hdr);
760+ kvfree(tx_ring->items);
750761 }
751762
752763 kfree(priv->txqs);
@@ -780,17 +791,20 @@ static void hfi1_ipoib_drain_tx_list(struct hfi1_ipoib_txq *txq) · 27 unmodified lines
780791
781792 void hfi1_ipoib_txreq_deinit(struct hfi1_ipoib_dev_priv *priv)
782793 {
783− int i;
794+ int i, j;
784795
785796 for (i = 0; i < priv->netdev->num_tx_queues; i++) {
786797 struct hfi1_ipoib_txq *txq = &priv->txqs[i];
798+ struct hfi1_ipoib_circ_buf *tx_ring = &txq->tx_ring;
787799
788800 iowait_cancel_work(&txq->wait);
789801 iowait_sdma_drain(&txq->wait);
790802 hfi1_ipoib_drain_tx_list(txq);
791803 netif_napi_del(&txq->napi);
792804 hfi1_ipoib_drain_tx_ring(txq);
793− kfree(txq->tx_ring.items);
805+ for (j = 0; j < tx_ring->max_items; j++)
806+ kfree(hfi1_txreq_from_idx(tx_ring, j)->sdma_hdr);
807+ kvfree(tx_ring->items);
794808 }
795809
796810 kfree(priv->txqs);
drivers/infiniband/hw/mlx4/main.c+1−1
@@ -3237,7 +3237,7 @@ static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr, · 3236 unmodified lines
32373237 case MLX4_DEV_EVENT_PORT_MGMT_CHANGE:
32383238 ew = kmalloc(sizeof *ew, GFP_ATOMIC);
32393239 if (!ew)
3240− break;
3240+ return;
32413241
32423242 INIT_WORK(&ew->work, handle_port_mgmt_change_event);
32433243 memcpy(&ew->ib_eqe, eqe, sizeof *eqe);
drivers/infiniband/sw/rdmavt/qp.c+2−0
@@ -3073,6 +3073,8 @@ do_write: · 3072 unmodified lines
30733073 case IB_WR_ATOMIC_FETCH_AND_ADD:
30743074 if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
30753075 goto inv_err;
3076+ if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1)))
3077+ goto inv_err;
30763078 if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
30773079 wqe->atomic_wr.remote_addr,
30783080 wqe->atomic_wr.rkey,
drivers/infiniband/sw/siw/siw.h+1−6
@@ -644,14 +644,9 @@ static inline struct siw_sqe *orq_get_current(struct siw_qp *qp) · 643 unmodified lines
644644 return &qp->orq[qp->orq_get % qp->attrs.orq_size];
645645 }
646646
647−static inline struct siw_sqe *orq_get_tail(struct siw_qp *qp)
648−{
649− return &qp->orq[qp->orq_put % qp->attrs.orq_size];
650−}
651−
652647 static inline struct siw_sqe *orq_get_free(struct siw_qp *qp)
653648 {
654− struct siw_sqe *orq_e = orq_get_tail(qp);
649+ struct siw_sqe *orq_e = &qp->orq[qp->orq_put % qp->attrs.orq_size];
655650
656651 if (READ_ONCE(orq_e->flags) == 0)
657652 return orq_e;
drivers/infiniband/sw/siw/siw_qp_rx.c+11−9
@@ -1153,11 +1153,12 @@ static int siw_check_tx_fence(struct siw_qp *qp) · 1152 unmodified lines
11531153
11541154 spin_lock_irqsave(&qp->orq_lock, flags);
11551155
1156− rreq = orq_get_current(qp);
1157−
11581156 /* free current orq entry */
1157+ rreq = orq_get_current(qp);
11591158 WRITE_ONCE(rreq->flags, 0);
11601159
1160+ qp->orq_get++;
1161+
11611162 if (qp->tx_ctx.orq_fence) {
11621163 if (unlikely(tx_waiting->wr_status != SIW_WR_QUEUED)) {
11631164 pr_warn("siw: [QP %u]: fence resume: bad status %d\n",
@@ -1165,10 +1166,12 @@ static int siw_check_tx_fence(struct siw_qp *qp) · 1 unmodified line
11651166 rv = -EPROTO;
11661167 goto out;
11671168 }
1168− /* resume SQ processing */
1169+ /* resume SQ processing, if possible */
11691170 if (tx_waiting->sqe.opcode == SIW_OP_READ ||
11701171 tx_waiting->sqe.opcode == SIW_OP_READ_LOCAL_INV) {
1171− rreq = orq_get_tail(qp);
1172+
1173+ /* SQ processing was stopped because of a full ORQ */
1174+ rreq = orq_get_free(qp);
11721175 if (unlikely(!rreq)) {
11731176 pr_warn("siw: [QP %u]: no ORQE\n", qp_id(qp));
11741177 rv = -EPROTO;
@@ -1181,15 +1184,14 @@ static int siw_check_tx_fence(struct siw_qp *qp) · 6 unmodified lines
11811184 resume_tx = 1;
11821185
11831186 } else if (siw_orq_empty(qp)) {
1187+ /*
1188+ * SQ processing was stopped by fenced work request.
1189+ * Resume since all previous Read's are now completed.
1190+ */
11841191 qp->tx_ctx.orq_fence = 0;
11851192 resume_tx = 1;
1186− } else {
1187− pr_warn("siw: [QP %u]: fence resume: orq idx: %d:%d\n",
1188− qp_id(qp), qp->orq_get, qp->orq_put);
1189− rv = -EPROTO;
11901193 }
11911194 }
1192− qp->orq_get++;
11931195 out:
11941196 spin_unlock_irqrestore(&qp->orq_lock, flags);
11951197
drivers/infiniband/sw/siw/siw_verbs.c+2−1
@@ -313,7 +313,8 @@ int siw_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs, · 312 unmodified lines
313313
314314 if (atomic_inc_return(&sdev->num_qp) > SIW_MAX_QP) {
315315 siw_dbg(base_dev, "too many QP's\n");
316− return -ENOMEM;
316+ rv = -ENOMEM;
317+ goto err_atomic;
317318 }
318319 if (attrs->qp_type != IB_QPT_RC) {
319320 siw_dbg(base_dev, "only RC QP's supported\n");
drivers/input/input.c+6−0
@@ -2285,6 +2285,12 @@ int input_register_device(struct input_dev *dev) · 2284 unmodified lines
22852285 /* KEY_RESERVED is not supposed to be transmitted to userspace. */
22862286 __clear_bit(KEY_RESERVED, dev->keybit);
22872287
2288+ /* Buttonpads should not map BTN_RIGHT and/or BTN_MIDDLE. */
2289+ if (test_bit(INPUT_PROP_BUTTONPAD, dev->propbit)) {
2290+ __clear_bit(BTN_RIGHT, dev->keybit);
2291+ __clear_bit(BTN_MIDDLE, dev->keybit);
2292+ }
2293+
22882294 /* Make sure that bitmasks not mentioned in dev->evbit are clean. */
22892295 input_cleanse_bitmasks(dev);
22902296
drivers/input/mouse/psmouse-smbus.c+10−0
@@ -75,6 +75,8 @@ static void psmouse_smbus_detach_i2c_client(struct i2c_client *client) · 74 unmodified lines
7575 "Marking SMBus companion %s as gone\n",
7676 dev_name(&smbdev->client->dev));
7777 smbdev->dead = true;
78+ device_link_remove(&smbdev->client->dev,
79+ &smbdev->psmouse->ps2dev.serio->dev);
7880 serio_rescan(smbdev->psmouse->ps2dev.serio);
7981 } else {
8082 list_del(&smbdev->node);
@@ -174,6 +176,8 @@ static void psmouse_smbus_disconnect(struct psmouse *psmouse) · 93 unmodified lines
174176 kfree(smbdev);
175177 } else {
176178 smbdev->dead = true;
179+ device_link_remove(&smbdev->client->dev,
180+ &psmouse->ps2dev.serio->dev);
177181 psmouse_dbg(smbdev->psmouse,
178182 "posting removal request for SMBus companion %s\n",
179183 dev_name(&smbdev->client->dev));
@@ -270,6 +274,12 @@ int psmouse_smbus_init(struct psmouse *psmouse, · 90 unmodified lines
270274
271275 if (smbdev->client) {
272276 /* We have our companion device */
277+ if (!device_link_add(&smbdev->client->dev,
278+ &psmouse->ps2dev.serio->dev,
279+ DL_FLAG_STATELESS))
280+ psmouse_warn(psmouse,
281+ "failed to set up link with iSMBus companion %s\n",
282+ dev_name(&smbdev->client->dev));
273283 return 0;
274284 }
275285
drivers/input/touchscreen/wm97xx-core.c+3−9
@@ -615,10 +615,9 @@ static int wm97xx_register_touch(struct wm97xx *wm) · 614 unmodified lines
615615 * extensions)
616616 */
617617 wm->touch_dev = platform_device_alloc("wm97xx-touch", -1);
618− if (!wm->touch_dev) {
619− ret = -ENOMEM;
620− goto touch_err;
621− }
618+ if (!wm->touch_dev)
619+ return -ENOMEM;
620+
622621 platform_set_drvdata(wm->touch_dev, wm);
623622 wm->touch_dev->dev.parent = wm->dev;
624623 wm->touch_dev->dev.platform_data = pdata;
@@ -629,9 +628,6 @@ static int wm97xx_register_touch(struct wm97xx *wm) · 4 unmodified lines
629628 return 0;
630629 touch_reg_err:
631630 platform_device_put(wm->touch_dev);
632−touch_err:
633− input_unregister_device(wm->input_dev);
634− wm->input_dev = NULL;
635631
636632 return ret;
637633 }
@@ -639,8 +635,6 @@ touch_err: · 1 unmodified line
639635 static void wm97xx_unregister_touch(struct wm97xx *wm)
640636 {
641637 platform_device_unregister(wm->touch_dev);
642− input_unregister_device(wm->input_dev);
643− wm->input_dev = NULL;
644638 }
645639
646640 static int _wm97xx_probe(struct wm97xx *wm)
drivers/input/touchscreen/zinitix.c+12−0
@@ -571,8 +571,20 @@ static SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume); · 570 unmodified lines
571571
572572 #ifdef CONFIG_OF
573573 static const struct of_device_id zinitix_of_match[] = {
574+ { .compatible = "zinitix,bt402" },
575+ { .compatible = "zinitix,bt403" },
576+ { .compatible = "zinitix,bt404" },
577+ { .compatible = "zinitix,bt412" },
578+ { .compatible = "zinitix,bt413" },
579+ { .compatible = "zinitix,bt431" },
580+ { .compatible = "zinitix,bt432" },
581+ { .compatible = "zinitix,bt531" },
574582 { .compatible = "zinitix,bt532" },
583+ { .compatible = "zinitix,bt538" },
575584 { .compatible = "zinitix,bt541" },
585+ { .compatible = "zinitix,bt548" },
586+ { .compatible = "zinitix,bt554" },
587+ { .compatible = "zinitix,at100" },
576588 { }
577589 };
578590 MODULE_DEVICE_TABLE(of, zinitix_of_match);
drivers/iommu/amd/init.c+2−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/export.h>
2222 #include <linux/kmemleak.h>
2323 #include <linux/cc_platform.h>
24+#include <linux/iopoll.h>
2425 #include <asm/pci-direct.h>
2526 #include <asm/iommu.h>
2627 #include <asm/apic.h>
@@ -834,6 +835,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu) · 807 unmodified lines
834835 status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
835836 if (status & (MMIO_STATUS_GALOG_RUN_MASK))
836837 break;
838+ udelay(10);
837839 }
838840
839841 if (WARN_ON(i >= LOOP_TIMEOUT))
drivers/iommu/intel/irq_remapping.c+10−3
@@ -569,9 +569,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) · 568 unmodified lines
569569 fn, &intel_ir_domain_ops,
570570 iommu);
571571 if (!iommu->ir_domain) {
572− irq_domain_free_fwnode(fn);
573572 pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id);
574− goto out_free_bitmap;
573+ goto out_free_fwnode;
575574 }
576575 iommu->ir_msi_domain =
577576 arch_create_remap_msi_irq_domain(iommu->ir_domain,
@@ -595,7 +594,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) · 17 unmodified lines
595594
596595 if (dmar_enable_qi(iommu)) {
597596 pr_err("Failed to enable queued invalidation\n");
598− goto out_free_bitmap;
597+ goto out_free_ir_domain;
599598 }
600599 }
601600
@@ -619,6 +618,14 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) · 17 unmodified lines
619618
620619 return 0;
621620
621+out_free_ir_domain:
622+ if (iommu->ir_msi_domain)
623+ irq_domain_remove(iommu->ir_msi_domain);
624+ iommu->ir_msi_domain = NULL;
625+ irq_domain_remove(iommu->ir_domain);
626+ iommu->ir_domain = NULL;
627+out_free_fwnode:
628+ irq_domain_free_fwnode(fn);
622629 out_free_bitmap:
623630 bitmap_free(bitmap);
624631 out_free_pages:
drivers/iommu/ioasid.c+1−0
@@ -349,6 +349,7 @@ EXPORT_SYMBOL_GPL(ioasid_alloc); · 348 unmodified lines
349349
350350 /**
351351 * ioasid_get - obtain a reference to the IOASID
352+ * @ioasid: the ID to get
352353 */
353354 void ioasid_get(ioasid_t ioasid)
354355 {
drivers/iommu/iommu.c+19−14
@@ -207,9 +207,14 @@ static struct dev_iommu *dev_iommu_get(struct device *dev) · 206 unmodified lines
207207
208208 static void dev_iommu_free(struct device *dev)
209209 {
210− iommu_fwspec_free(dev);
211− kfree(dev->iommu);
210+ struct dev_iommu *param = dev->iommu;
211+
212212 dev->iommu = NULL;
213+ if (param->fwspec) {
214+ fwnode_handle_put(param->fwspec->iommu_fwnode);
215+ kfree(param->fwspec);
216+ }
217+ kfree(param);
213218 }
214219
215220 static int __iommu_probe_device(struct device *dev, struct list_head *group_list)
@@ -980,17 +985,6 @@ static int iommu_group_device_count(struct iommu_group *group) · 764 unmodified lines
980985 return ret;
981986 }
982987
983−/**
984− * iommu_group_for_each_dev - iterate over each device in the group
985− * @group: the group
986− * @data: caller opaque data to be passed to callback function
987− * @fn: caller supplied callback function
988− *
989− * This function is called by group users to iterate over group devices.
990− * Callers should hold a reference count to the group during callback.
991− * The group->mutex is held across callbacks, which will block calls to
992− * iommu_group_add/remove_device.
993− */
994988 static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
995989 int (*fn)(struct device *, void *))
996990 {
@@ -1005,7 +999,17 @@ static int __iommu_group_for_each_dev(struct iommu_group *group, void *data, · 8 unmodified lines
1005999 return ret;
10061000 }
10071001
1008−
1002+/**
1003+ * iommu_group_for_each_dev - iterate over each device in the group
1004+ * @group: the group
1005+ * @data: caller opaque data to be passed to callback function
1006+ * @fn: caller supplied callback function
1007+ *
1008+ * This function is called by group users to iterate over group devices.
1009+ * Callers should hold a reference count to the group during callback.
1010+ * The group->mutex is held across callbacks, which will block calls to
1011+ * iommu_group_add/remove_device.
1012+ */
10091013 int iommu_group_for_each_dev(struct iommu_group *group, void *data,
10101014 int (*fn)(struct device *, void *))
10111015 {
@@ -3032,6 +3036,7 @@ EXPORT_SYMBOL_GPL(iommu_aux_get_pasid); · 2020 unmodified lines
30323036 * iommu_sva_bind_device() - Bind a process address space to a device
30333037 * @dev: the device
30343038 * @mm: the mm to bind, caller must hold a reference to it
3039+ * @drvdata: opaque data pointer to pass to bind callback
30353040 *
30363041 * Create a bond between device and address space, allowing the device to access
30373042 * the mm using the returned PASID. If a bond already exists between @device and
drivers/iommu/omap-iommu.c+1−1
@@ -1085,7 +1085,7 @@ static __maybe_unused int omap_iommu_runtime_resume(struct device *dev) · 1084 unmodified lines
10851085 }
10861086
10871087 /**
1088− * omap_iommu_suspend_prepare - prepare() dev_pm_ops implementation
1088+ * omap_iommu_prepare - prepare() dev_pm_ops implementation
10891089 * @dev: iommu device
10901090 *
10911091 * This function performs the necessary checks to determine if the IOMMU
drivers/irqchip/irq-apple-aic.c+0−1
@@ -178,7 +178,6 @@ struct aic_irq_chip { · 177 unmodified lines
178178 struct irq_domain *hw_domain;
179179 struct irq_domain *ipi_domain;
180180 int nr_hw;
181− int ipi_hwirq;
182181 };
183182
184183 static DEFINE_PER_CPU(uint32_t, aic_fiq_unmasked);
drivers/irqchip/irq-gic-v3-its.c+104−22
@@ -4856,6 +4856,38 @@ static struct syscore_ops its_syscore_ops = { · 4855 unmodified lines
48564856 .resume = its_restore_enable,
48574857 };
48584858
4859+static void __init __iomem *its_map_one(struct resource *res, int *err)
4860+{
4861+ void __iomem *its_base;
4862+ u32 val;
4863+
4864+ its_base = ioremap(res->start, SZ_64K);
4865+ if (!its_base) {
4866+ pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start);
4867+ *err = -ENOMEM;
4868+ return NULL;
4869+ }
4870+
4871+ val = readl_relaxed(its_base + GITS_PIDR2) & GIC_PIDR2_ARCH_MASK;
4872+ if (val != 0x30 && val != 0x40) {
4873+ pr_warn("ITS@%pa: No ITS detected, giving up\n", &res->start);
4874+ *err = -ENODEV;
4875+ goto out_unmap;
4876+ }
4877+
4878+ *err = its_force_quiescent(its_base);
4879+ if (*err) {
4880+ pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &res->start);
4881+ goto out_unmap;
4882+ }
4883+
4884+ return its_base;
4885+
4886+out_unmap:
4887+ iounmap(its_base);
4888+ return NULL;
4889+}
4890+
48594891 static int its_init_domain(struct fwnode_handle *handle, struct its_node *its)
48604892 {
48614893 struct irq_domain *inner_domain;
@@ -4963,29 +4995,14 @@ static int __init its_probe_one(struct resource *res, · 101 unmodified lines
49634995 {
49644996 struct its_node *its;
49654997 void __iomem *its_base;
4966− u32 val, ctlr;
49674998 u64 baser, tmp, typer;
49684999 struct page *page;
5000+ u32 ctlr;
49695001 int err;
49705002
4971− its_base = ioremap(res->start, SZ_64K);
4972− if (!its_base) {
4973− pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start);
4974− return -ENOMEM;
4975− }
4976−
4977− val = readl_relaxed(its_base + GITS_PIDR2) & GIC_PIDR2_ARCH_MASK;
4978− if (val != 0x30 && val != 0x40) {
4979− pr_warn("ITS@%pa: No ITS detected, giving up\n", &res->start);
4980− err = -ENODEV;
4981− goto out_unmap;
4982− }
4983−
4984− err = its_force_quiescent(its_base);
4985− if (err) {
4986− pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &res->start);
4987− goto out_unmap;
4988− }
5003+ its_base = its_map_one(res, &err);
5004+ if (!its_base)
5005+ return err;
49895006
49905007 pr_info("ITS %pR\n", res);
49915008
@@ -5241,13 +5258,31 @@ static int its_cpu_memreserve_lpi(unsigned int cpu) · 249 unmodified lines
52415258
52425259 out:
52435260 /* Last CPU being brought up gets to issue the cleanup */
5244− if (cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
5261+ if (!IS_ENABLED(CONFIG_SMP) ||
5262+ cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
52455263 schedule_work(&rdist_memreserve_cpuhp_cleanup_work);
52465264
52475265 gic_data_rdist()->flags |= RD_LOCAL_MEMRESERVE_DONE;
52485266 return ret;
52495267 }
52505268
5269+/* Mark all the BASER registers as invalid before they get reprogrammed */
5270+static int __init its_reset_one(struct resource *res)
5271+{
5272+ void __iomem *its_base;
5273+ int err, i;
5274+
5275+ its_base = its_map_one(res, &err);
5276+ if (!its_base)
5277+ return err;
5278+
5279+ for (i = 0; i < GITS_BASER_NR_REGS; i++)
5280+ gits_write_baser(0, its_base + GITS_BASER + (i << 3));
5281+
5282+ iounmap(its_base);
5283+ return 0;
5284+}
5285+
52515286 static const struct of_device_id its_device_id[] = {
52525287 { .compatible = "arm,gic-v3-its", },
52535288 {},
@@ -5258,6 +5293,26 @@ static int __init its_of_probe(struct device_node *node) · 4 unmodified lines
52585293 struct device_node *np;
52595294 struct resource res;
52605295
5296+ /*
5297+ * Make sure *all* the ITS are reset before we probe any, as
5298+ * they may be sharing memory. If any of the ITS fails to
5299+ * reset, don't even try to go any further, as this could
5300+ * result in something even worse.
5301+ */
5302+ for (np = of_find_matching_node(node, its_device_id); np;
5303+ np = of_find_matching_node(np, its_device_id)) {
5304+ int err;
5305+
5306+ if (!of_device_is_available(np) ||
5307+ !of_property_read_bool(np, "msi-controller") ||
5308+ of_address_to_resource(np, 0, &res))
5309+ continue;
5310+
5311+ err = its_reset_one(&res);
5312+ if (err)
5313+ return err;
5314+ }
5315+
52615316 for (np = of_find_matching_node(node, its_device_id); np;
52625317 np = of_find_matching_node(np, its_device_id)) {
52635318 if (!of_device_is_available(np))
@@ -5420,11 +5475,35 @@ dom_err: · 156 unmodified lines
54205475 return err;
54215476 }
54225477
5478+static int __init its_acpi_reset(union acpi_subtable_headers *header,
5479+ const unsigned long end)
5480+{
5481+ struct acpi_madt_generic_translator *its_entry;
5482+ struct resource res;
5483+
5484+ its_entry = (struct acpi_madt_generic_translator *)header;
5485+ res = (struct resource) {
5486+ .start = its_entry->base_address,
5487+ .end = its_entry->base_address + ACPI_GICV3_ITS_MEM_SIZE - 1,
5488+ .flags = IORESOURCE_MEM,
5489+ };
5490+
5491+ return its_reset_one(&res);
5492+}
5493+
54235494 static void __init its_acpi_probe(void)
54245495 {
54255496 acpi_table_parse_srat_its();
5426− acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
5427− gic_acpi_parse_madt_its, 0);
5497+ /*
5498+ * Make sure *all* the ITS are reset before we probe any, as
5499+ * they may be sharing memory. If any of the ITS fails to
5500+ * reset, don't even try to go any further, as this could
5501+ * result in something even worse.
5502+ */
5503+ if (acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
5504+ its_acpi_reset, 0) > 0)
5505+ acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
5506+ gic_acpi_parse_madt_its, 0);
54285507 acpi_its_srat_maps_free();
54295508 }
54305509 #else
@@ -5438,6 +5517,9 @@ int __init its_lpi_memreserve_init(void) · 7 unmodified lines
54385517 if (!efi_enabled(EFI_CONFIG_TABLES))
54395518 return 0;
54405519
5520+ if (list_empty(&its_nodes))
5521+ return 0;
5522+
54415523 gic_rdists->cpuhp_memreserve_state = CPUHP_INVALID;
54425524 state = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
54435525 "irqchip/arm/gicv3/memreserve:online",
drivers/irqchip/irq-loongson-pch-msi.c+1−1
@@ -241,7 +241,7 @@ static int pch_msi_init(struct device_node *node, · 240 unmodified lines
241241 return 0;
242242
243243 err_map:
244− kfree(priv->msi_map);
244+ bitmap_free(priv->msi_map);
245245 err_priv:
246246 kfree(priv);
247247 return ret;
drivers/irqchip/irq-realtek-rtl.c+12−6
@@ -62,7 +62,7 @@ static struct irq_chip realtek_ictl_irq = { · 61 unmodified lines
6262
6363 static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
6464 {
65− irq_set_chip_and_handler(hw, &realtek_ictl_irq, handle_level_irq);
65+ irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq);
6666
6767 return 0;
6868 }
@@ -76,16 +76,20 @@ static void realtek_irq_dispatch(struct irq_desc *desc) · 7 unmodified lines
7676 {
7777 struct irq_chip *chip = irq_desc_get_chip(desc);
7878 struct irq_domain *domain;
79− unsigned int pending;
79+ unsigned long pending;
80+ unsigned int soc_int;
8081
8182 chained_irq_enter(chip, desc);
8283 pending = readl(REG(RTL_ICTL_GIMR)) & readl(REG(RTL_ICTL_GISR));
84+
8385 if (unlikely(!pending)) {
8486 spurious_interrupt();
8587 goto out;
8688 }
89+
8790 domain = irq_desc_get_handler_data(desc);
88− generic_handle_domain_irq(domain, __ffs(pending));
91+ for_each_set_bit(soc_int, &pending, 32)
92+ generic_handle_domain_irq(domain, soc_int);
8993
9094 out:
9195 chained_irq_exit(chip, desc);
@@ -95,7 +99,8 @@ out: · 3 unmodified lines
9599 * SoC interrupts are cascaded to MIPS CPU interrupts according to the
96100 * interrupt-map in the device tree. Each SoC interrupt gets 4 bits for
97101 * the CPU interrupt in an Interrupt Routing Register. Max 32 SoC interrupts
98− * thus go into 4 IRRs.
102+ * thus go into 4 IRRs. A routing value of '0' means the interrupt is left
103+ * disconnected. Routing values {1..15} connect to output lines {0..14}.
99104 */
100105 static int __init map_interrupts(struct device_node *node, struct irq_domain *domain)
101106 {
@@ -134,7 +139,7 @@ static int __init map_interrupts(struct device_node *node, struct irq_domain *do · 32 unmodified lines
134139 of_node_put(cpu_ictl);
135140
136141 cpu_int = be32_to_cpup(imap + 2);
137− if (cpu_int > 7)
142+ if (cpu_int > 7 || cpu_int < 2)
138143 return -EINVAL;
139144
140145 if (!(mips_irqs_set & BIT(cpu_int))) {
@@ -143,7 +148,8 @@ static int __init map_interrupts(struct device_node *node, struct irq_domain *do · 2 unmodified lines
143148 mips_irqs_set |= BIT(cpu_int);
144149 }
145150
146− regs[(soc_int * 4) / 32] |= cpu_int << (soc_int * 4) % 32;
151+ /* Use routing values (1..6) for CPU interrupts (2..7) */
152+ regs[(soc_int * 4) / 32] |= (cpu_int - 1) << (soc_int * 4) % 32;
147153 imap += 3;
148154 }
149155
drivers/irqchip/irq-sifive-plic.c+1−0
@@ -398,3 +398,4 @@ out_free_priv: · 397 unmodified lines
398398
399399 IRQCHIP_DECLARE(sifive_plic, "sifive,plic-1.0.0", plic_init);
400400 IRQCHIP_DECLARE(riscv_plic0, "riscv,plic0", plic_init); /* for legacy systems */
401+IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", plic_init); /* for firmware driver */
drivers/md/dm.c+4−18
@@ -489,7 +489,7 @@ static void start_io_acct(struct dm_io *io) · 488 unmodified lines
489489 struct mapped_device *md = io->md;
490490 struct bio *bio = io->orig_bio;
491491
492− io->start_time = bio_start_io_acct(bio);
492+ bio_start_io_acct_time(bio, io->start_time);
493493 if (unlikely(dm_stats_used(&md->stats)))
494494 dm_stats_account_io(&md->stats, bio_data_dir(bio),
495495 bio->bi_iter.bi_sector, bio_sectors(bio),
@@ -535,7 +535,7 @@ static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio) · 39 unmodified lines
535535 io->md = md;
536536 spin_lock_init(&io->endio_lock);
537537
538− start_io_acct(io);
538+ io->start_time = jiffies;
539539
540540 return io;
541541 }
@@ -1442,9 +1442,6 @@ static void init_clone_info(struct clone_info *ci, struct mapped_device *md, · 900 unmodified lines
14421442 ci->sector = bio->bi_iter.bi_sector;
14431443 }
14441444
1445−#define __dm_part_stat_sub(part, field, subnd) \
1446− (part_stat_get(part, field) -= (subnd))
1447−
14481445 /*
14491446 * Entry point to split a bio into clones and submit them to the targets.
14501447 */
@@ -1480,23 +1477,12 @@ static void __split_and_process_bio(struct mapped_device *md, · 29 unmodified lines
14801477 GFP_NOIO, &md->queue->bio_split);
14811478 ci.io->orig_bio = b;
14821479
1483− /*
1484− * Adjust IO stats for each split, otherwise upon queue
1485− * reentry there will be redundant IO accounting.
1486− * NOTE: this is a stop-gap fix, a proper fix involves
1487− * significant refactoring of DM core's bio splitting
1488− * (by eliminating DM's splitting and just using bio_split)
1489− */
1490− part_stat_lock();
1491− __dm_part_stat_sub(dm_disk(md)->part0,
1492− sectors[op_stat_group(bio_op(bio))], ci.sector_count);
1493− part_stat_unlock();
1494−
14951480 bio_chain(b, bio);
14961481 trace_block_split(b, bio->bi_iter.bi_sector);
14971482 submit_bio_noacct(bio);
14981483 }
14991484 }
1485+ start_io_acct(ci.io);
15001486
15011487 /* drop the extra reference count */
15021488 dm_io_dec_pending(ci.io, errno_to_blk_status(error));
@@ -2091,7 +2077,7 @@ static void __dm_destroy(struct mapped_device *md, bool wait) · 588 unmodified lines
20912077 set_bit(DMF_FREEING, &md->flags);
20922078 spin_unlock(&_minor_lock);
20932079
2094− blk_set_queue_dying(md->queue);
2080+ blk_mark_disk_dead(md->disk);
20952081
20962082 /*
20972083 * Take suspend_lock so that presuspend and postsuspend methods
drivers/md/md.c+4−4
@@ -5869,10 +5869,6 @@ int md_run(struct mddev *mddev) · 5868 unmodified lines
58695869 nowait = nowait && blk_queue_nowait(bdev_get_queue(rdev->bdev));
58705870 }
58715871
5872− /* Set the NOWAIT flags if all underlying devices support it */
5873− if (nowait)
5874− blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
5875−
58765872 if (!bioset_initialized(&mddev->bio_set)) {
58775873 err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
58785874 if (err)
@@ -6010,6 +6006,10 @@ int md_run(struct mddev *mddev) · 131 unmodified lines
60106006 else
60116007 blk_queue_flag_clear(QUEUE_FLAG_NONROT, mddev->queue);
60126008 blk_queue_flag_set(QUEUE_FLAG_IO_STAT, mddev->queue);
6009+
6010+ /* Set the NOWAIT flags if all underlying devices support it */
6011+ if (nowait)
6012+ blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
60136013 }
60146014 if (pers->sync_request) {
60156015 if (mddev->kobj.sd &&
drivers/misc/eeprom/at25.c+4−0
@@ -440,6 +440,10 @@ static int at25_probe(struct spi_device *spi) · 439 unmodified lines
440440 return -ENXIO;
441441 }
442442
443+ at25 = devm_kzalloc(&spi->dev, sizeof(*at25), GFP_KERNEL);
444+ if (!at25)
445+ return -ENOMEM;
446+
443447 mutex_init(&at25->lock);
444448 at25->spi = spi;
445449 spi_set_drvdata(spi, at25);
drivers/misc/eeprom/ee1004.c+3−0
@@ -114,6 +114,9 @@ static ssize_t ee1004_eeprom_read(struct i2c_client *client, char *buf, · 113 unmodified lines
114114 if (offset + count > EE1004_PAGE_SIZE)
115115 count = EE1004_PAGE_SIZE - offset;
116116
117+ if (count > I2C_SMBUS_BLOCK_MAX)
118+ count = I2C_SMBUS_BLOCK_MAX;
119+
117120 return i2c_smbus_read_i2c_block_data_or_emulated(client, offset, count, buf);
118121 }
119122
drivers/misc/fastrpc.c+8−1
@@ -1288,7 +1288,14 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp) · 1287 unmodified lines
12881288 }
12891289
12901290 if (copy_to_user(argp, &bp, sizeof(bp))) {
1291− dma_buf_put(buf->dmabuf);
1291+ /*
1292+ * The usercopy failed, but we can't do much about it, as
1293+ * dma_buf_fd() already called fd_install() and made the
1294+ * file descriptor accessible for the current process. It
1295+ * might already be closed and dmabuf no longer valid when
1296+ * we reach this point. Therefore "leak" the fd and rely on
1297+ * the process exit path to do any required cleanup.
1298+ */
12921299 return -EFAULT;
12931300 }
12941301
drivers/mmc/core/block.c+14−14
@@ -1682,31 +1682,31 @@ static void mmc_blk_read_single(struct mmc_queue *mq, struct request *req) · 1681 unmodified lines
16821682 struct mmc_card *card = mq->card;
16831683 struct mmc_host *host = card->host;
16841684 blk_status_t error = BLK_STS_OK;
1685− int retries = 0;
16861685
16871686 do {
16881687 u32 status;
16891688 int err;
1689+ int retries = 0;
16901690
1691− mmc_blk_rw_rq_prep(mqrq, card, 1, mq);
1691+ while (retries++ <= MMC_READ_SINGLE_RETRIES) {
1692+ mmc_blk_rw_rq_prep(mqrq, card, 1, mq);
16921693
1693− mmc_wait_for_req(host, mrq);
1694+ mmc_wait_for_req(host, mrq);
16941695
1695− err = mmc_send_status(card, &status);
1696− if (err)
1697− goto error_exit;
1698−
1699− if (!mmc_host_is_spi(host) &&
1700− !mmc_ready_for_data(status)) {
1701− err = mmc_blk_fix_state(card, req);
1696+ err = mmc_send_status(card, &status);
17021697 if (err)
17031698 goto error_exit;
1704− }
17051699
1706− if (mrq->cmd->error && retries++ < MMC_READ_SINGLE_RETRIES)
1707− continue;
1700+ if (!mmc_host_is_spi(host) &&
1701+ !mmc_ready_for_data(status)) {
1702+ err = mmc_blk_fix_state(card, req);
1703+ if (err)
1704+ goto error_exit;
1705+ }
17081706
1709− retries = 0;
1707+ if (!mrq->cmd->error)
1708+ break;
1709+ }
17101710
17111711 if (mrq->cmd->error ||
17121712 mrq->data->error ||
drivers/mmc/core/sd.c+7−1
@@ -67,7 +67,7 @@ static const unsigned int sd_au_size[] = { · 66 unmodified lines
6767 __res & __mask; \
6868 })
6969
70−#define SD_POWEROFF_NOTIFY_TIMEOUT_MS 2000
70+#define SD_POWEROFF_NOTIFY_TIMEOUT_MS 1000
7171 #define SD_WRITE_EXTR_SINGLE_TIMEOUT_MS 1000
7272
7373 struct sd_busy_data {
@@ -1664,6 +1664,12 @@ static int sd_poweroff_notify(struct mmc_card *card) · 1590 unmodified lines
16641664 goto out;
16651665 }
16661666
1667+ /* Find out when the command is completed. */
1668+ err = mmc_poll_for_busy(card, SD_WRITE_EXTR_SINGLE_TIMEOUT_MS, false,
1669+ MMC_BUSY_EXTR_SINGLE);
1670+ if (err)
1671+ goto out;
1672+
16671673 cb_data.card = card;
16681674 cb_data.reg_buf = reg_buf;
16691675 err = __mmc_poll_for_busy(card->host, SD_POWEROFF_NOTIFY_TIMEOUT_MS,
drivers/mmc/host/moxart-mmc.c+1−1
@@ -705,12 +705,12 @@ static int moxart_remove(struct platform_device *pdev) · 704 unmodified lines
705705 if (!IS_ERR_OR_NULL(host->dma_chan_rx))
706706 dma_release_channel(host->dma_chan_rx);
707707 mmc_remove_host(mmc);
708− mmc_free_host(mmc);
709708
710709 writel(0, host->base + REG_INTERRUPT_MASK);
711710 writel(0, host->base + REG_POWER_CONTROL);
712711 writel(readl(host->base + REG_CLOCK_CONTROL) | CLK_OFF,
713712 host->base + REG_CLOCK_CONTROL);
713+ mmc_free_host(mmc);
714714
715715 return 0;
716716 }
drivers/mmc/host/sdhci-of-esdhc.c+6−2
@@ -524,12 +524,16 @@ static void esdhc_of_adma_workaround(struct sdhci_host *host, u32 intmask) · 523 unmodified lines
524524
525525 static int esdhc_of_enable_dma(struct sdhci_host *host)
526526 {
527+ int ret;
527528 u32 value;
528529 struct device *dev = mmc_dev(host->mmc);
529530
530531 if (of_device_is_compatible(dev->of_node, "fsl,ls1043a-esdhc") ||
531− of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc"))
532− dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40));
532+ of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc")) {
533+ ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40));
534+ if (ret)
535+ return ret;
536+ }
533537
534538 value = sdhci_readl(host, ESDHC_DMA_SYSCTL);
535539
drivers/mmc/host/sh_mmcif.c+3−0
@@ -405,6 +405,9 @@ static int sh_mmcif_dma_slave_config(struct sh_mmcif_host *host, · 404 unmodified lines
405405 struct dma_slave_config cfg = { 0, };
406406
407407 res = platform_get_resource(host->pd, IORESOURCE_MEM, 0);
408+ if (!res)
409+ return -EINVAL;
410+
408411 cfg.direction = direction;
409412
410413 if (direction == DMA_DEV_TO_MEM) {
drivers/mtd/devices/phram.c+8−4
@@ -264,16 +264,20 @@ static int phram_setup(const char *val) · 263 unmodified lines
264264 }
265265 }
266266
267− if (erasesize)
268− div_u64_rem(len, (uint32_t)erasesize, &rem);
269−
270267 if (len == 0 || erasesize == 0 || erasesize > len
271− || erasesize > UINT_MAX || rem) {
268+ || erasesize > UINT_MAX) {
272269 parse_err("illegal erasesize or len\n");
273270 ret = -EINVAL;
274271 goto error;
275272 }
276273
274+ div_u64_rem(len, (uint32_t)erasesize, &rem);
275+ if (rem) {
276+ parse_err("len is not multiple of erasesize\n");
277+ ret = -EINVAL;
278+ goto error;
279+ }
280+
277281 ret = register_device(name, start, len, (uint32_t)erasesize);
278282 if (ret)
279283 goto error;
drivers/mtd/nand/raw/Kconfig+2−1
@@ -42,7 +42,8 @@ config MTD_NAND_OMAP2 · 41 unmodified lines
4242 tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
4343 depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
4444 depends on HAS_IOMEM
45− select OMAP_GPMC if ARCH_K3
45+ select MEMORY
46+ select OMAP_GPMC
4647 help
4748 Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
4849 and Keystone platforms.
drivers/mtd/nand/raw/brcmnand/brcmnand.c+1−1
@@ -2106,7 +2106,7 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip, · 2105 unmodified lines
21062106 mtd->oobsize / trans,
21072107 host->hwcfg.sector_size_1k);
21082108
2109− if (!ret) {
2109+ if (ret != -EBADMSG) {
21102110 *err_addr = brcmnand_get_uncorrecc_addr(ctrl);
21112111
21122112 if (*err_addr)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c+2−1
@@ -2285,7 +2285,7 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip, · 2284 unmodified lines
22852285 this->hw.must_apply_timings = false;
22862286 ret = gpmi_nfc_apply_timings(this);
22872287 if (ret)
2288− return ret;
2288+ goto out_pm;
22892289 }
22902290
22912291 dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs);
@@ -2414,6 +2414,7 @@ unmap: · 122 unmodified lines
24142414
24152415 this->bch = false;
24162416
2417+out_pm:
24172418 pm_runtime_mark_last_busy(this->dev);
24182419 pm_runtime_put_autosuspend(this->dev);
24192420
drivers/mtd/nand/raw/ingenic/ingenic_ecc.c+6−1
@@ -68,9 +68,14 @@ static struct ingenic_ecc *ingenic_ecc_get(struct device_node *np) · 67 unmodified lines
6868 struct ingenic_ecc *ecc;
6969
7070 pdev = of_find_device_by_node(np);
71− if (!pdev || !platform_get_drvdata(pdev))
71+ if (!pdev)
7272 return ERR_PTR(-EPROBE_DEFER);
7373
74+ if (!platform_get_drvdata(pdev)) {
75+ put_device(&pdev->dev);
76+ return ERR_PTR(-EPROBE_DEFER);
77+ }
78+
7479 ecc = platform_get_drvdata(pdev);
7580 clk_prepare_enable(ecc->clk);
7681
drivers/mtd/nand/raw/qcom_nandc.c+6−8
@@ -2,7 +2,6 @@ · 1 unmodified line
22 /*
33 * Copyright (c) 2016, The Linux Foundation. All rights reserved.
44 */
5−
65 #include <linux/clk.h>
76 #include <linux/slab.h>
87 #include <linux/bitops.h>
@@ -3073,10 +3072,6 @@ static int qcom_nandc_probe(struct platform_device *pdev) · 3064 unmodified lines
30733072 if (dma_mapping_error(dev, nandc->base_dma))
30743073 return -ENXIO;
30753074
3076− ret = qcom_nandc_alloc(nandc);
3077− if (ret)
3078− goto err_nandc_alloc;
3079−
30803075 ret = clk_prepare_enable(nandc->core_clk);
30813076 if (ret)
30823077 goto err_core_clk;
@@ -3085,6 +3080,10 @@ static int qcom_nandc_probe(struct platform_device *pdev) · 2 unmodified lines
30853080 if (ret)
30863081 goto err_aon_clk;
30873082
3083+ ret = qcom_nandc_alloc(nandc);
3084+ if (ret)
3085+ goto err_nandc_alloc;
3086+
30883087 ret = qcom_nandc_setup(nandc);
30893088 if (ret)
30903089 goto err_setup;
@@ -3096,15 +3095,14 @@ static int qcom_nandc_probe(struct platform_device *pdev) · 5 unmodified lines
30963095 return 0;
30973096
30983097 err_setup:
3098+ qcom_nandc_unalloc(nandc);
3099+err_nandc_alloc:
30993100 clk_disable_unprepare(nandc->aon_clk);
31003101 err_aon_clk:
31013102 clk_disable_unprepare(nandc->core_clk);
31023103 err_core_clk:
3103− qcom_nandc_unalloc(nandc);
3104−err_nandc_alloc:
31053104 dma_unmap_resource(dev, res->start, resource_size(res),
31063105 DMA_BIDIRECTIONAL, 0);
3107−
31083106 return ret;
31093107 }
31103108
drivers/mtd/parsers/qcomsmempart.c+23−13
@@ -58,11 +58,11 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, · 57 unmodified lines
5858 const struct mtd_partition **pparts,
5959 struct mtd_part_parser_data *data)
6060 {
61+ size_t len = SMEM_FLASH_PTABLE_HDR_LEN;
62+ int ret, i, j, tmpparts, numparts = 0;
6163 struct smem_flash_pentry *pentry;
6264 struct smem_flash_ptable *ptable;
63− size_t len = SMEM_FLASH_PTABLE_HDR_LEN;
6465 struct mtd_partition *parts;
65− int ret, i, numparts;
6666 char *name, *c;
6767
6868 if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
@@ -75,7 +75,8 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, · 6 unmodified lines
7575 pr_debug("Parsing partition table info from SMEM\n");
7676 ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
7777 if (IS_ERR(ptable)) {
78− pr_err("Error reading partition table header\n");
78+ if (PTR_ERR(ptable) != -EPROBE_DEFER)
79+ pr_err("Error reading partition table header\n");
7980 return PTR_ERR(ptable);
8081 }
8182
@@ -87,8 +88,8 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, · 5 unmodified lines
8788 }
8889
8990 /* Ensure that # of partitions is less than the max we have allocated */
90− numparts = le32_to_cpu(ptable->numparts);
91− if (numparts > SMEM_FLASH_PTABLE_MAX_PARTS_V4) {
91+ tmpparts = le32_to_cpu(ptable->numparts);
92+ if (tmpparts > SMEM_FLASH_PTABLE_MAX_PARTS_V4) {
9293 pr_err("Partition numbers exceed the max limit\n");
9394 return -EINVAL;
9495 }
@@ -116,11 +117,17 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, · 21 unmodified lines
116117 return PTR_ERR(ptable);
117118 }
118119
120+ for (i = 0; i < tmpparts; i++) {
121+ pentry = &ptable->pentry[i];
122+ if (pentry->name[0] != '\0')
123+ numparts++;
124+ }
125+
119126 parts = kcalloc(numparts, sizeof(*parts), GFP_KERNEL);
120127 if (!parts)
121128 return -ENOMEM;
122129
123− for (i = 0; i < numparts; i++) {
130+ for (i = 0, j = 0; i < tmpparts; i++) {
124131 pentry = &ptable->pentry[i];
125132 if (pentry->name[0] == '\0')
126133 continue;
@@ -135,24 +142,25 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, · 8 unmodified lines
135142 for (c = name; *c != '\0'; c++)
136143 *c = tolower(*c);
137144
138− parts[i].name = name;
139− parts[i].offset = le32_to_cpu(pentry->offset) * mtd->erasesize;
140− parts[i].mask_flags = pentry->attr;
141− parts[i].size = le32_to_cpu(pentry->length) * mtd->erasesize;
145+ parts[j].name = name;
146+ parts[j].offset = le32_to_cpu(pentry->offset) * mtd->erasesize;
147+ parts[j].mask_flags = pentry->attr;
148+ parts[j].size = le32_to_cpu(pentry->length) * mtd->erasesize;
142149 pr_debug("%d: %s offs=0x%08x size=0x%08x attr:0x%08x\n",
143150 i, pentry->name, le32_to_cpu(pentry->offset),
144151 le32_to_cpu(pentry->length), pentry->attr);
152+ j++;
145153 }
146154
147155 pr_debug("SMEM partition table found: ver: %d len: %d\n",
148− le32_to_cpu(ptable->version), numparts);
156+ le32_to_cpu(ptable->version), tmpparts);
149157 *pparts = parts;
150158
151159 return numparts;
152160
153161 out_free_parts:
154− while (--i >= 0)
155− kfree(parts[i].name);
162+ while (--j >= 0)
163+ kfree(parts[j].name);
156164 kfree(parts);
157165 *pparts = NULL;
158166
@@ -166,6 +174,8 @@ static void parse_qcomsmem_cleanup(const struct mtd_partition *pparts, · 7 unmodified lines
166174
167175 for (i = 0; i < nr_parts; i++)
168176 kfree(pparts[i].name);
177+
178+ kfree(pparts);
169179 }
170180
171181 static const struct of_device_id qcomsmem_of_match_table[] = {
drivers/net/bonding/bond_3ad.c+27−6
@@ -225,7 +225,7 @@ static inline int __check_agg_selection_timer(struct port *port) · 224 unmodified lines
225225 if (bond == NULL)
226226 return 0;
227227
228− return BOND_AD_INFO(bond).agg_select_timer ? 1 : 0;
228+ return atomic_read(&BOND_AD_INFO(bond).agg_select_timer) ? 1 : 0;
229229 }
230230
231231 /**
@@ -1021,8 +1021,8 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr) · 789 unmodified lines
10211021 if (port->aggregator &&
10221022 port->aggregator->is_active &&
10231023 !__port_is_enabled(port)) {
1024−
10251024 __enable_port(port);
1025+ *update_slave_arr = true;
10261026 }
10271027 }
10281028 break;
@@ -1779,6 +1779,7 @@ static void ad_agg_selection_logic(struct aggregator *agg, · 750 unmodified lines
17791779 port = port->next_port_in_aggregator) {
17801780 __enable_port(port);
17811781 }
1782+ *update_slave_arr = true;
17821783 }
17831784 }
17841785
@@ -1994,7 +1995,7 @@ static void ad_marker_response_received(struct bond_marker *marker, · 209 unmodified lines
19941995 */
19951996 void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)
19961997 {
1997− BOND_AD_INFO(bond).agg_select_timer = timeout;
1998+ atomic_set(&BOND_AD_INFO(bond).agg_select_timer, timeout);
19981999 }
19992000
20002001 /**
@@ -2277,6 +2278,28 @@ void bond_3ad_update_ad_actor_settings(struct bonding *bond) · 276 unmodified lines
22772278 spin_unlock_bh(&bond->mode_lock);
22782279 }
22792280
2281+/**
2282+ * bond_agg_timer_advance - advance agg_select_timer
2283+ * @bond: bonding structure
2284+ *
2285+ * Return true when agg_select_timer reaches 0.
2286+ */
2287+static bool bond_agg_timer_advance(struct bonding *bond)
2288+{
2289+ int val, nval;
2290+
2291+ while (1) {
2292+ val = atomic_read(&BOND_AD_INFO(bond).agg_select_timer);
2293+ if (!val)
2294+ return false;
2295+ nval = val - 1;
2296+ if (atomic_cmpxchg(&BOND_AD_INFO(bond).agg_select_timer,
2297+ val, nval) == val)
2298+ break;
2299+ }
2300+ return nval == 0;
2301+}
2302+
22802303 /**
22812304 * bond_3ad_state_machine_handler - handle state machines timeout
22822305 * @work: work context to fetch bonding struct to work on from
@@ -2312,9 +2335,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work) · 29 unmodified lines
23122335 if (!bond_has_slaves(bond))
23132336 goto re_arm;
23142337
2315− /* check if agg_select_timer timer after initialize is timed out */
2316− if (BOND_AD_INFO(bond).agg_select_timer &&
2317− !(--BOND_AD_INFO(bond).agg_select_timer)) {
2338+ if (bond_agg_timer_advance(bond)) {
23182339 slave = bond_first_slave_rcu(bond);
23192340 port = slave ? &(SLAVE_AD_INFO(slave)->port) : NULL;
23202341
drivers/net/bonding/bond_main.c+2−7
@@ -2379,10 +2379,9 @@ static int __bond_release_one(struct net_device *bond_dev, · 2378 unmodified lines
23792379 bond_select_active_slave(bond);
23802380 }
23812381
2382− if (!bond_has_slaves(bond)) {
2383− bond_set_carrier(bond);
2382+ bond_set_carrier(bond);
2383+ if (!bond_has_slaves(bond))
23842384 eth_hw_addr_random(bond_dev);
2385− }
23862385
23872386 unblock_netpoll_tx();
23882387 synchronize_rcu();
@@ -4133,9 +4132,7 @@ static int bond_eth_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cm · 1744 unmodified lines
41334132
41344133 fallthrough;
41354134 case SIOCGHWTSTAMP:
4136− rcu_read_lock();
41374135 real_dev = bond_option_active_slave_get_rcu(bond);
4138− rcu_read_unlock();
41394136 if (!real_dev)
41404137 return -EOPNOTSUPP;
41414138
@@ -5382,9 +5379,7 @@ static int bond_ethtool_get_ts_info(struct net_device *bond_dev, · 1240 unmodified lines
53825379 struct net_device *real_dev;
53835380 struct phy_device *phydev;
53845381
5385− rcu_read_lock();
53865382 real_dev = bond_option_active_slave_get_rcu(bond);
5387− rcu_read_unlock();
53885383 if (real_dev) {
53895384 ops = real_dev->ethtool_ops;
53905385 phydev = real_dev->phydev;
drivers/net/can/flexcan/flexcan-core.c+1−0
@@ -296,6 +296,7 @@ static_assert(sizeof(struct flexcan_regs) == 0x4 * 18 + 0xfb8); · 295 unmodified lines
296296 static const struct flexcan_devtype_data fsl_mcf5441x_devtype_data = {
297297 .quirks = FLEXCAN_QUIRK_BROKEN_PERR_STATE |
298298 FLEXCAN_QUIRK_NR_IRQ_3 | FLEXCAN_QUIRK_NR_MB_16 |
299+ FLEXCAN_QUIRK_SUPPPORT_RX_MAILBOX |
299300 FLEXCAN_QUIRK_SUPPPORT_RX_FIFO,
300301 };
301302
drivers/net/can/flexcan/flexcan.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 * Below is some version info we got:
2222 * SOC Version IP-Version Glitch- [TR]WRN_INT IRQ Err Memory err RTR rece- FD Mode MB
2323 * Filter? connected? Passive detection ption in MB Supported?
24− * MCF5441X FlexCAN2 ? no yes no no yes no 16
24+ * MCF5441X FlexCAN2 ? no yes no no no no 16
2525 * MX25 FlexCAN2 03.00.00.00 no no no no no no 64
2626 * MX28 FlexCAN2 03.00.04.00 yes yes no no no no 64
2727 * MX35 FlexCAN2 03.00.00.00 no no no no no no 64
drivers/net/can/m_can/m_can.c+6−0
@@ -336,6 +336,9 @@ m_can_fifo_read(struct m_can_classdev *cdev, · 335 unmodified lines
336336 u32 addr_offset = cdev->mcfg[MRAM_RXF0].off + fgi * RXF0_ELEMENT_SIZE +
337337 offset;
338338
339+ if (val_count == 0)
340+ return 0;
341+
339342 return cdev->ops->read_fifo(cdev, addr_offset, val, val_count);
340343 }
341344
@@ -346,6 +349,9 @@ m_can_fifo_write(struct m_can_classdev *cdev, · 4 unmodified lines
346349 u32 addr_offset = cdev->mcfg[MRAM_TXB].off + fpi * TXB_ELEMENT_SIZE +
347350 offset;
348351
352+ if (val_count == 0)
353+ return 0;
354+
349355 return cdev->ops->write_fifo(cdev, addr_offset, val, val_count);
350356 }
351357
drivers/net/can/m_can/tcan4x5x-regmap.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #define TCAN4X5X_SPI_INSTRUCTION_WRITE (0x61 << 24)
1313 #define TCAN4X5X_SPI_INSTRUCTION_READ (0x41 << 24)
1414
15−#define TCAN4X5X_MAX_REGISTER 0x8ffc
15+#define TCAN4X5X_MAX_REGISTER 0x87fc
1616
1717 static int tcan4x5x_regmap_gather_write(void *context,
1818 const void *reg, size_t reg_len,
drivers/net/dsa/Kconfig+2−0
@@ -36,6 +36,7 @@ config NET_DSA_LANTIQ_GSWIP · 35 unmodified lines
3636 config NET_DSA_MT7530
3737 tristate "MediaTek MT753x and MT7621 Ethernet switch support"
3838 select NET_DSA_TAG_MTK
39+ select MEDIATEK_GE_PHY
3940 help
4041 This enables support for the MediaTek MT7530, MT7531, and MT7621
4142 Ethernet switch chips.
@@ -81,6 +82,7 @@ config NET_DSA_REALTEK_SMI · 39 unmodified lines
8182
8283 config NET_DSA_SMSC_LAN9303
8384 tristate
85+ depends on VLAN_8021Q || VLAN_8021Q=n
8486 select NET_DSA_TAG_LAN9303
8587 select REGMAP
8688 help
drivers/net/dsa/bcm_sf2.c+5−2
@@ -621,7 +621,7 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) · 620 unmodified lines
621621 get_device(&priv->master_mii_bus->dev);
622622 priv->master_mii_dn = dn;
623623
624− priv->slave_mii_bus = devm_mdiobus_alloc(ds->dev);
624+ priv->slave_mii_bus = mdiobus_alloc();
625625 if (!priv->slave_mii_bus) {
626626 of_node_put(dn);
627627 return -ENOMEM;
@@ -681,8 +681,10 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) · 53 unmodified lines
681681 }
682682
683683 err = mdiobus_register(priv->slave_mii_bus);
684− if (err && dn)
684+ if (err && dn) {
685+ mdiobus_free(priv->slave_mii_bus);
685686 of_node_put(dn);
687+ }
686688
687689 return err;
688690 }
@@ -690,6 +692,7 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) · 1 unmodified line
690692 static void bcm_sf2_mdio_unregister(struct bcm_sf2_priv *priv)
691693 {
692694 mdiobus_unregister(priv->slave_mii_bus);
695+ mdiobus_free(priv->slave_mii_bus);
693696 of_node_put(priv->master_mii_dn);
694697 }
695698
drivers/net/dsa/lan9303-core.c+10−3
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/mii.h>
1111 #include <linux/phy.h>
1212 #include <linux/if_bridge.h>
13+#include <linux/if_vlan.h>
1314 #include <linux/etherdevice.h>
1415
1516 #include "lan9303.h"
@@ -1083,21 +1084,27 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port, · 1067 unmodified lines
10831084 static int lan9303_port_enable(struct dsa_switch *ds, int port,
10841085 struct phy_device *phy)
10851086 {
1087+ struct dsa_port *dp = dsa_to_port(ds, port);
10861088 struct lan9303 *chip = ds->priv;
10871089
1088− if (!dsa_is_user_port(ds, port))
1090+ if (!dsa_port_is_user(dp))
10891091 return 0;
10901092
1093+ vlan_vid_add(dp->cpu_dp->master, htons(ETH_P_8021Q), port);
1094+
10911095 return lan9303_enable_processing_port(chip, port);
10921096 }
10931097
10941098 static void lan9303_port_disable(struct dsa_switch *ds, int port)
10951099 {
1100+ struct dsa_port *dp = dsa_to_port(ds, port);
10961101 struct lan9303 *chip = ds->priv;
10971102
1098− if (!dsa_is_user_port(ds, port))
1103+ if (!dsa_port_is_user(dp))
10991104 return;
11001105
1106+ vlan_vid_del(dp->cpu_dp->master, htons(ETH_P_8021Q), port);
1107+
11011108 lan9303_disable_processing_port(chip, port);
11021109 lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN);
11031110 }
@@ -1310,7 +1317,7 @@ static int lan9303_probe_reset_gpio(struct lan9303 *chip, · 206 unmodified lines
13101317 struct device_node *np)
13111318 {
13121319 chip->reset_gpio = devm_gpiod_get_optional(chip->dev, "reset",
1313− GPIOD_OUT_LOW);
1320+ GPIOD_OUT_HIGH);
13141321 if (IS_ERR(chip->reset_gpio))
13151322 return PTR_ERR(chip->reset_gpio);
13161323
drivers/net/dsa/lantiq_gswip.c+11−3
@@ -498,8 +498,9 @@ static int gswip_mdio_rd(struct mii_bus *bus, int addr, int reg) · 497 unmodified lines
498498 static int gswip_mdio(struct gswip_priv *priv, struct device_node *mdio_np)
499499 {
500500 struct dsa_switch *ds = priv->ds;
501+ int err;
501502
502− ds->slave_mii_bus = devm_mdiobus_alloc(priv->dev);
503+ ds->slave_mii_bus = mdiobus_alloc();
503504 if (!ds->slave_mii_bus)
504505 return -ENOMEM;
505506
@@ -512,7 +513,11 @@ static int gswip_mdio(struct gswip_priv *priv, struct device_node *mdio_np) · 6 unmodified lines
512513 ds->slave_mii_bus->parent = priv->dev;
513514 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
514515
515− return of_mdiobus_register(ds->slave_mii_bus, mdio_np);
516+ err = of_mdiobus_register(ds->slave_mii_bus, mdio_np);
517+ if (err)
518+ mdiobus_free(ds->slave_mii_bus);
519+
520+ return err;
516521 }
517522
518523 static int gswip_pce_table_entry_read(struct gswip_priv *priv,
@@ -2145,8 +2150,10 @@ disable_switch: · 1626 unmodified lines
21452150 gswip_mdio_mask(priv, GSWIP_MDIO_GLOB_ENABLE, 0, GSWIP_MDIO_GLOB);
21462151 dsa_unregister_switch(priv->ds);
21472152 mdio_bus:
2148− if (mdio_np)
2153+ if (mdio_np) {
21492154 mdiobus_unregister(priv->ds->slave_mii_bus);
2155+ mdiobus_free(priv->ds->slave_mii_bus);
2156+ }
21502157 put_mdio_node:
21512158 of_node_put(mdio_np);
21522159 for (i = 0; i < priv->num_gphy_fw; i++)
@@ -2170,6 +2177,7 @@ static int gswip_remove(struct platform_device *pdev) · 17 unmodified lines
21702177 if (priv->ds->slave_mii_bus) {
21712178 mdiobus_unregister(priv->ds->slave_mii_bus);
21722179 of_node_put(priv->ds->slave_mii_bus->dev.of_node);
2180+ mdiobus_free(priv->ds->slave_mii_bus);
21732181 }
21742182
21752183 for (i = 0; i < priv->num_gphy_fw; i++)
drivers/net/dsa/mt7530.c+1−1
@@ -2074,7 +2074,7 @@ mt7530_setup_mdio(struct mt7530_priv *priv) · 2073 unmodified lines
20742074 if (priv->irq)
20752075 mt7530_setup_mdio_irq(priv);
20762076
2077− ret = mdiobus_register(bus);
2077+ ret = devm_mdiobus_register(dev, bus);
20782078 if (ret) {
20792079 dev_err(dev, "failed to register MDIO bus: %d\n", ret);
20802080 if (priv->irq)
drivers/net/dsa/mv88e6xxx/chip.c+17−5
@@ -2284,6 +2284,13 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, · 2283 unmodified lines
22842284 if (!mv88e6xxx_max_vid(chip))
22852285 return -EOPNOTSUPP;
22862286
2287+ /* The ATU removal procedure needs the FID to be mapped in the VTU,
2288+ * but FDB deletion runs concurrently with VLAN deletion. Flush the DSA
2289+ * switchdev workqueue to ensure that all FDB entries are deleted
2290+ * before we remove the VLAN.
2291+ */
2292+ dsa_flush_workqueue();
2293+
22872294 mv88e6xxx_reg_lock(chip);
22882295
22892296 err = mv88e6xxx_port_get_pvid(chip, port, &pvid);
@@ -3399,7 +3406,7 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip, · 1109 unmodified lines
33993406 return err;
34003407 }
34013408
3402− bus = devm_mdiobus_alloc_size(chip->dev, sizeof(*mdio_bus));
3409+ bus = mdiobus_alloc_size(sizeof(*mdio_bus));
34033410 if (!bus)
34043411 return -ENOMEM;
34053412
@@ -3424,14 +3431,14 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip, · 18 unmodified lines
34243431 if (!external) {
34253432 err = mv88e6xxx_g2_irq_mdio_setup(chip, bus);
34263433 if (err)
3427− return err;
3434+ goto out;
34283435 }
34293436
34303437 err = of_mdiobus_register(bus, np);
34313438 if (err) {
34323439 dev_err(chip->dev, "Cannot register MDIO bus (%d)\n", err);
34333440 mv88e6xxx_g2_irq_mdio_free(chip, bus);
3434− return err;
3441+ goto out;
34353442 }
34363443
34373444 if (external)
@@ -3440,21 +3447,26 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip, · 2 unmodified lines
34403447 list_add(&mdio_bus->list, &chip->mdios);
34413448
34423449 return 0;
3450+
3451+out:
3452+ mdiobus_free(bus);
3453+ return err;
34433454 }
34443455
34453456 static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip)
34463457
34473458 {
3448− struct mv88e6xxx_mdio_bus *mdio_bus;
3459+ struct mv88e6xxx_mdio_bus *mdio_bus, *p;
34493460 struct mii_bus *bus;
34503461
3451− list_for_each_entry(mdio_bus, &chip->mdios, list) {
3462+ list_for_each_entry_safe(mdio_bus, p, &chip->mdios, list) {
34523463 bus = mdio_bus->bus;
34533464
34543465 if (!mdio_bus->external)
34553466 mv88e6xxx_g2_irq_mdio_free(chip, bus);
34563467
34573468 mdiobus_unregister(bus);
3469+ mdiobus_free(bus);
34583470 }
34593471 }
34603472
drivers/net/dsa/ocelot/felix_vsc9959.c+3−1
@@ -1061,7 +1061,7 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) · 1060 unmodified lines
10611061 return PTR_ERR(hw);
10621062 }
10631063
1064− bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv));
1064+ bus = mdiobus_alloc_size(sizeof(*mdio_priv));
10651065 if (!bus)
10661066 return -ENOMEM;
10671067
@@ -1081,6 +1081,7 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) · 13 unmodified lines
10811081 rc = mdiobus_register(bus);
10821082 if (rc < 0) {
10831083 dev_err(dev, "failed to register MDIO bus\n");
1084+ mdiobus_free(bus);
10841085 return rc;
10851086 }
10861087
@@ -1132,6 +1133,7 @@ static void vsc9959_mdio_bus_free(struct ocelot *ocelot) · 45 unmodified lines
11321133 lynx_pcs_destroy(phylink_pcs);
11331134 }
11341135 mdiobus_unregister(felix->imdio);
1136+ mdiobus_free(felix->imdio);
11351137 }
11361138
11371139 static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port,
drivers/net/dsa/ocelot/seville_vsc9953.c+3−2
@@ -1029,7 +1029,7 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) · 1028 unmodified lines
10291029 }
10301030
10311031 /* Needed in order to initialize the bus mutex lock */
1032− rc = of_mdiobus_register(bus, NULL);
1032+ rc = devm_of_mdiobus_register(dev, bus, NULL);
10331033 if (rc < 0) {
10341034 dev_err(dev, "failed to register MDIO bus\n");
10351035 return rc;
@@ -1083,7 +1083,8 @@ static void vsc9953_mdio_bus_free(struct ocelot *ocelot) · 47 unmodified lines
10831083 mdio_device_free(mdio_device);
10841084 lynx_pcs_destroy(phylink_pcs);
10851085 }
1086− mdiobus_unregister(felix->imdio);
1086+
1087+ /* mdiobus_unregister and mdiobus_free handled by devres */
10871088 }
10881089
10891090 static const struct felix_info seville_info_vsc9953 = {
drivers/net/dsa/qca/ar9331.c+1−2
@@ -378,7 +378,7 @@ static int ar9331_sw_mbus_init(struct ar9331_sw_priv *priv) · 377 unmodified lines
378378 if (!mnp)
379379 return -ENODEV;
380380
381− ret = of_mdiobus_register(mbus, mnp);
381+ ret = devm_of_mdiobus_register(dev, mbus, mnp);
382382 of_node_put(mnp);
383383 if (ret)
384384 return ret;
@@ -1091,7 +1091,6 @@ static void ar9331_sw_remove(struct mdio_device *mdiodev) · 706 unmodified lines
10911091 }
10921092
10931093 irq_domain_remove(priv->irqdomain);
1094− mdiobus_unregister(priv->mbus);
10951094 dsa_unregister_switch(&priv->ds);
10961095
10971096 reset_control_assert(priv->sw_reset);
drivers/net/ethernet/3com/typhoon.c+4−2
@@ -2278,6 +2278,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 2277 unmodified lines
22782278 struct net_device *dev;
22792279 struct typhoon *tp;
22802280 int card_id = (int) ent->driver_data;
2281+ u8 addr[ETH_ALEN] __aligned(4);
22812282 void __iomem *ioaddr;
22822283 void *shared;
22832284 dma_addr_t shared_dma;
@@ -2409,8 +2410,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 125 unmodified lines
24092410 goto error_out_reset;
24102411 }
24112412
2412− *(__be16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
2413− *(__be32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
2413+ *(__be16 *)&addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
2414+ *(__be32 *)&addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
2415+ eth_hw_addr_set(dev, addr);
24142416
24152417 if (!is_valid_ether_addr(dev->dev_addr)) {
24162418 err_msg = "Could not obtain valid ethernet address, aborting";
drivers/net/ethernet/8390/etherh.c+4−2
@@ -655,6 +655,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) · 654 unmodified lines
655655 struct ei_device *ei_local;
656656 struct net_device *dev;
657657 struct etherh_priv *eh;
658+ u8 addr[ETH_ALEN];
658659 int ret;
659660
660661 ret = ecard_request_resources(ec);
@@ -724,12 +725,13 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) · 63 unmodified lines
724725 spin_lock_init(&ei_local->page_lock);
725726
726727 if (ec->cid.product == PROD_ANT_ETHERM) {
727− etherm_addr(dev->dev_addr);
728+ etherm_addr(addr);
728729 ei_local->reg_offset = etherm_regoffsets;
729730 } else {
730− etherh_addr(dev->dev_addr, ec);
731+ etherh_addr(addr, ec);
731732 ei_local->reg_offset = etherh_regoffsets;
732733 }
734+ eth_hw_addr_set(dev, addr);
733735
734736 ei_local->name = dev->name;
735737 ei_local->word16 = 1;
drivers/net/ethernet/amd/declance.c+3−1
@@ -1032,6 +1032,7 @@ static int dec_lance_probe(struct device *bdev, const int type) · 1031 unmodified lines
10321032 int i, ret;
10331033 unsigned long esar_base;
10341034 unsigned char *esar;
1035+ u8 addr[ETH_ALEN];
10351036 const char *desc;
10361037
10371038 if (dec_lance_debug && version_printed++ == 0)
@@ -1228,7 +1229,8 @@ static int dec_lance_probe(struct device *bdev, const int type) · 190 unmodified lines
12281229 break;
12291230 }
12301231 for (i = 0; i < 6; i++)
1231− dev->dev_addr[i] = esar[i * 4];
1232+ addr[i] = esar[i * 4];
1233+ eth_hw_addr_set(dev, addr);
12321234
12331235 printk("%s: %s, addr = %pM, irq = %d\n",
12341236 name, desc, dev->dev_addr, dev->irq);
drivers/net/ethernet/amd/xgbe/xgbe-drv.c+13−1
@@ -721,7 +721,9 @@ static void xgbe_stop_timers(struct xgbe_prv_data *pdata) · 720 unmodified lines
721721 if (!channel->tx_ring)
722722 break;
723723
724+ /* Deactivate the Tx timer */
724725 del_timer_sync(&channel->tx_timer);
726+ channel->tx_timer_active = 0;
725727 }
726728 }
727729
@@ -2550,6 +2552,14 @@ read_again: · 1822 unmodified lines
25502552 buf2_len = xgbe_rx_buf2_len(rdata, packet, len);
25512553 len += buf2_len;
25522554
2555+ if (buf2_len > rdata->rx.buf.dma_len) {
2556+ /* Hardware inconsistency within the descriptors
2557+ * that has resulted in a length underflow.
2558+ */
2559+ error = 1;
2560+ goto skip_data;
2561+ }
2562+
25532563 if (!skb) {
25542564 skb = xgbe_create_skb(pdata, napi, rdata,
25552565 buf1_len);
@@ -2579,8 +2589,10 @@ skip_data: · 23 unmodified lines
25792589 if (!last || context_next)
25802590 goto read_again;
25812591
2582− if (!skb)
2592+ if (!skb || error) {
2593+ dev_kfree_skb(skb);
25832594 goto next_packet;
2595+ }
25842596
25852597 /* Be sure we don't exceed the configured MTU */
25862598 max_len = netdev->mtu + ETH_HLEN;
drivers/net/ethernet/amd/xgbe/xgbe-pci.c+3−0
@@ -425,6 +425,9 @@ static void xgbe_pci_remove(struct pci_dev *pdev) · 424 unmodified lines
425425
426426 pci_free_irq_vectors(pdata->pcidev);
427427
428+ /* Disable all interrupts in the hardware */
429+ XP_IOWRITE(pdata, XP_INT_EN, 0x0);
430+
428431 xgbe_free_pdata(pdata);
429432 }
430433
drivers/net/ethernet/aquantia/atlantic/aq_filters.c+2−4
@@ -826,7 +826,6 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic) · 825 unmodified lines
826826 struct aq_hw_s *aq_hw = aq_nic->aq_hw;
827827 int hweight = 0;
828828 int err = 0;
829− int i;
830829
831830 if (unlikely(!aq_hw_ops->hw_filter_vlan_set))
832831 return -EOPNOTSUPP;
@@ -837,8 +836,7 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic) · 4 unmodified lines
837836 aq_nic->aq_hw_rx_fltrs.fl2.aq_vlans);
838837
839838 if (aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) {
840− for (i = 0; i < BITS_TO_LONGS(VLAN_N_VID); i++)
841− hweight += hweight_long(aq_nic->active_vlans[i]);
839+ hweight = bitmap_weight(aq_nic->active_vlans, VLAN_N_VID);
842840
843841 err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw, false);
844842 if (err)
@@ -871,7 +869,7 @@ int aq_filters_vlan_offload_off(struct aq_nic_s *aq_nic) · 26 unmodified lines
871869 struct aq_hw_s *aq_hw = aq_nic->aq_hw;
872870 int err = 0;
873871
874− memset(aq_nic->active_vlans, 0, sizeof(aq_nic->active_vlans));
872+ bitmap_zero(aq_nic->active_vlans, VLAN_N_VID);
875873 aq_fvlan_rebuild(aq_nic, aq_nic->active_vlans,
876874 aq_nic->aq_hw_rx_fltrs.fl2.aq_vlans);
877875
drivers/net/ethernet/atheros/atl1c/atl1c_main.c+1−1
@@ -900,7 +900,7 @@ static void atl1c_clean_tx_ring(struct atl1c_adapter *adapter, · 899 unmodified lines
900900 atl1c_clean_buffer(pdev, buffer_info);
901901 }
902902
903− netdev_reset_queue(adapter->netdev);
903+ netdev_tx_reset_queue(netdev_get_tx_queue(adapter->netdev, queue));
904904
905905 /* Zero out Tx-buffers */
906906 memset(tpd_ring->desc, 0, sizeof(struct atl1c_tpd_desc) *
drivers/net/ethernet/broadcom/bgmac-platform.c+16−7
@@ -172,6 +172,7 @@ static int bgmac_probe(struct platform_device *pdev) · 171 unmodified lines
172172 {
173173 struct device_node *np = pdev->dev.of_node;
174174 struct bgmac *bgmac;
175+ struct resource *regs;
175176 int ret;
176177
177178 bgmac = bgmac_alloc(&pdev->dev);
@@ -208,15 +209,23 @@ static int bgmac_probe(struct platform_device *pdev) · 30 unmodified lines
208209 if (IS_ERR(bgmac->plat.base))
209210 return PTR_ERR(bgmac->plat.base);
210211
211− bgmac->plat.idm_base = devm_platform_ioremap_resource_byname(pdev, "idm_base");
212− if (IS_ERR(bgmac->plat.idm_base))
213− return PTR_ERR(bgmac->plat.idm_base);
214− else
212+ /* The idm_base resource is optional for some platforms */
213+ regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "idm_base");
214+ if (regs) {
215+ bgmac->plat.idm_base = devm_ioremap_resource(&pdev->dev, regs);
216+ if (IS_ERR(bgmac->plat.idm_base))
217+ return PTR_ERR(bgmac->plat.idm_base);
215218 bgmac->feature_flags &= ~BGMAC_FEAT_IDM_MASK;
219+ }
216220
217− bgmac->plat.nicpm_base = devm_platform_ioremap_resource_byname(pdev, "nicpm_base");
218− if (IS_ERR(bgmac->plat.nicpm_base))
219− return PTR_ERR(bgmac->plat.nicpm_base);
221+ /* The nicpm_base resource is optional for some platforms */
222+ regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nicpm_base");
223+ if (regs) {
224+ bgmac->plat.nicpm_base = devm_ioremap_resource(&pdev->dev,
225+ regs);
226+ if (IS_ERR(bgmac->plat.nicpm_base))
227+ return PTR_ERR(bgmac->plat.nicpm_base);
228+ }
220229
221230 bgmac->read = platform_bgmac_read;
222231 bgmac->write = platform_bgmac_write;
drivers/net/ethernet/broadcom/sb1250-mac.c+1−3
@@ -2183,9 +2183,7 @@ static int sbmac_init(struct platform_device *pldev, long long base) · 2182 unmodified lines
21832183 ea_reg >>= 8;
21842184 }
21852185
2186− for (i = 0; i < 6; i++) {
2187− dev->dev_addr[i] = eaddr[i];
2188− }
2186+ eth_hw_addr_set(dev, eaddr);
21892187
21902188 /*
21912189 * Initialize context (get pointers to registers and stuff), then
drivers/net/ethernet/cadence/macb_main.c+1−1
@@ -4712,7 +4712,7 @@ static int macb_probe(struct platform_device *pdev) · 4711 unmodified lines
47124712
47134713 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
47144714 if (GEM_BFEXT(DAW64, gem_readl(bp, DCFG6))) {
4715− dma_set_mask(&pdev->dev, DMA_BIT_MASK(44));
4715+ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44));
47164716 bp->hw_dma_cap |= HW_DMA_CAP_64B;
47174717 }
47184718 #endif
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c+3−3
@@ -4338,7 +4338,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) · 4337 unmodified lines
43384338 }
43394339
43404340 INIT_WORK(&priv->tx_onestep_tstamp, dpaa2_eth_tx_onestep_tstamp);
4341−
4341+ mutex_init(&priv->onestep_tstamp_lock);
43424342 skb_queue_head_init(&priv->tx_skbs);
43434343
43444344 priv->rx_copybreak = DPAA2_ETH_DEFAULT_COPYBREAK;
@@ -4523,12 +4523,12 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev) · 178 unmodified lines
45234523 #ifdef CONFIG_DEBUG_FS
45244524 dpaa2_dbg_remove(priv);
45254525 #endif
4526+
4527+ unregister_netdev(net_dev);
45264528 rtnl_lock();
45274529 dpaa2_eth_disconnect_mac(priv);
45284530 rtnl_unlock();
45294531
4530− unregister_netdev(net_dev);
4531−
45324532 dpaa2_eth_dl_port_del(priv);
45334533 dpaa2_eth_dl_traps_unregister(priv);
45344534 dpaa2_eth_dl_free(priv);
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c+3−1
@@ -532,6 +532,7 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls, · 531 unmodified lines
532532 struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
533533 struct flow_dissector *dissector = rule->match.dissector;
534534 struct netlink_ext_ack *extack = cls->common.extack;
535+ int ret = -EOPNOTSUPP;
535536
536537 if (dissector->used_keys &
537538 ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
@@ -561,9 +562,10 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls, · 23 unmodified lines
561562 }
562563
563564 *vlan = (u16)match.key->vlan_id;
565+ ret = 0;
564566 }
565567
566− return 0;
568+ return ret;
567569 }
568570
569571 static int
drivers/net/ethernet/freescale/fec_mpc52xx.c+7−5
@@ -99,13 +99,13 @@ static void mpc52xx_fec_tx_timeout(struct net_device *dev, unsigned int txqueue) · 98 unmodified lines
9999 netif_wake_queue(dev);
100100 }
101101
102−static void mpc52xx_fec_set_paddr(struct net_device *dev, u8 *mac)
102+static void mpc52xx_fec_set_paddr(struct net_device *dev, const u8 *mac)
103103 {
104104 struct mpc52xx_fec_priv *priv = netdev_priv(dev);
105105 struct mpc52xx_fec __iomem *fec = priv->fec;
106106
107− out_be32(&fec->paddr1, *(u32 *)(&mac[0]));
108− out_be32(&fec->paddr2, (*(u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
107+ out_be32(&fec->paddr1, *(const u32 *)(&mac[0]));
108+ out_be32(&fec->paddr2, (*(const u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
109109 }
110110
111111 static int mpc52xx_fec_set_mac_address(struct net_device *dev, void *addr)
@@ -893,13 +893,15 @@ static int mpc52xx_fec_probe(struct platform_device *op) · 781 unmodified lines
893893 rv = of_get_ethdev_address(np, ndev);
894894 if (rv) {
895895 struct mpc52xx_fec __iomem *fec = priv->fec;
896+ u8 addr[ETH_ALEN] __aligned(4);
896897
897898 /*
898899 * If the MAC addresse is not provided via DT then read
899900 * it back from the controller regs
900901 */
901− *(u32 *)(&ndev->dev_addr[0]) = in_be32(&fec->paddr1);
902− *(u16 *)(&ndev->dev_addr[4]) = in_be32(&fec->paddr2) >> 16;
902+ *(u32 *)(&addr[0]) = in_be32(&fec->paddr1);
903+ *(u16 *)(&addr[4]) = in_be32(&fec->paddr2) >> 16;
904+ eth_hw_addr_set(ndev, addr);
903905 }
904906
905907 /*
drivers/net/ethernet/google/gve/gve.h+1−1
@@ -843,7 +843,7 @@ static inline bool gve_is_gqi(struct gve_priv *priv) · 842 unmodified lines
843843 /* buffers */
844844 int gve_alloc_page(struct gve_priv *priv, struct device *dev,
845845 struct page **page, dma_addr_t *dma,
846− enum dma_data_direction);
846+ enum dma_data_direction, gfp_t gfp_flags);
847847 void gve_free_page(struct device *dev, struct page *page, dma_addr_t dma,
848848 enum dma_data_direction);
849849 /* tx handling */
drivers/net/ethernet/google/gve/gve_adminq.c+1−1
@@ -301,7 +301,7 @@ static int gve_adminq_parse_err(struct gve_priv *priv, u32 status) · 300 unmodified lines
301301 */
302302 static int gve_adminq_kick_and_wait(struct gve_priv *priv)
303303 {
304− u32 tail, head;
304+ int tail, head;
305305 int i;
306306
307307 tail = ioread32be(&priv->reg_bar0->adminq_event_counter);
drivers/net/ethernet/google/gve/gve_main.c+3−3
@@ -766,9 +766,9 @@ static void gve_free_rings(struct gve_priv *priv) · 765 unmodified lines
766766
767767 int gve_alloc_page(struct gve_priv *priv, struct device *dev,
768768 struct page **page, dma_addr_t *dma,
769− enum dma_data_direction dir)
769+ enum dma_data_direction dir, gfp_t gfp_flags)
770770 {
771− *page = alloc_page(GFP_KERNEL);
771+ *page = alloc_page(gfp_flags);
772772 if (!*page) {
773773 priv->page_alloc_fail++;
774774 return -ENOMEM;
@@ -811,7 +811,7 @@ static int gve_alloc_queue_page_list(struct gve_priv *priv, u32 id, · 36 unmodified lines
811811 for (i = 0; i < pages; i++) {
812812 err = gve_alloc_page(priv, &priv->pdev->dev, &qpl->pages[i],
813813 &qpl->page_buses[i],
814− gve_qpl_dma_dir(priv, id));
814+ gve_qpl_dma_dir(priv, id), GFP_KERNEL);
815815 /* caller handles clean up */
816816 if (err)
817817 return -ENOMEM;
drivers/net/ethernet/google/gve/gve_rx.c+3−1
@@ -86,7 +86,8 @@ static int gve_rx_alloc_buffer(struct gve_priv *priv, struct device *dev, · 85 unmodified lines
8686 dma_addr_t dma;
8787 int err;
8888
89− err = gve_alloc_page(priv, dev, &page, &dma, DMA_FROM_DEVICE);
89+ err = gve_alloc_page(priv, dev, &page, &dma, DMA_FROM_DEVICE,
90+ GFP_ATOMIC);
9091 if (err)
9192 return err;
9293
@@ -608,6 +609,7 @@ static bool gve_rx(struct gve_rx_ring *rx, netdev_features_t feat, · 515 unmodified lines
608609
609610 *packet_size_bytes = skb->len + (skb->protocol ? ETH_HLEN : 0);
610611 *work_done = work_cnt;
612+ skb_record_rx_queue(skb, rx->q_num);
611613 if (skb_is_nonlinear(skb))
612614 napi_gro_frags(napi);
613615 else
drivers/net/ethernet/google/gve/gve_rx_dqo.c+1−1
@@ -157,7 +157,7 @@ static int gve_alloc_page_dqo(struct gve_priv *priv, · 156 unmodified lines
157157 int err;
158158
159159 err = gve_alloc_page(priv, &priv->pdev->dev, &buf_state->page_info.page,
160− &buf_state->addr, DMA_FROM_DEVICE);
160+ &buf_state->addr, DMA_FROM_DEVICE, GFP_KERNEL);
161161 if (err)
162162 return err;
163163
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+1−2
@@ -2043,8 +2043,7 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data) · 2042 unmodified lines
20432043 break;
20442044 }
20452045
2046− if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER)
2047− hclgevf_enable_vector(&hdev->misc_vector, true);
2046+ hclgevf_enable_vector(&hdev->misc_vector, true);
20482047
20492048 return IRQ_HANDLED;
20502049 }
drivers/net/ethernet/i825xx/ether1.c+3−1
@@ -986,6 +986,7 @@ static int · 985 unmodified lines
986986 ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
987987 {
988988 struct net_device *dev;
989+ u8 addr[ETH_ALEN];
989990 int i, ret = 0;
990991
991992 ether1_banner();
@@ -1015,7 +1016,8 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) · 23 unmodified lines
10151016 }
10161017
10171018 for (i = 0; i < 6; i++)
1018− dev->dev_addr[i] = readb(IDPROM_ADDRESS + (i << 2));
1019+ addr[i] = readb(IDPROM_ADDRESS + (i << 2));
1020+ eth_hw_addr_set(dev, addr);
10191021
10201022 if (ether1_init_2(dev)) {
10211023 ret = -ENODEV;
drivers/net/ethernet/ibm/ibmvnic.c+109−71
@@ -110,6 +110,7 @@ static void ibmvnic_tx_scrq_clean_buffer(struct ibmvnic_adapter *adapter, · 109 unmodified lines
110110 struct ibmvnic_sub_crq_queue *tx_scrq);
111111 static void free_long_term_buff(struct ibmvnic_adapter *adapter,
112112 struct ibmvnic_long_term_buff *ltb);
113+static void ibmvnic_disable_irqs(struct ibmvnic_adapter *adapter);
113114
114115 struct ibmvnic_stat {
115116 char name[ETH_GSTRING_LEN];
@@ -1424,7 +1425,7 @@ static int __ibmvnic_open(struct net_device *netdev) · 1308 unmodified lines
14241425 rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP);
14251426 if (rc) {
14261427 ibmvnic_napi_disable(adapter);
1427− release_resources(adapter);
1428+ ibmvnic_disable_irqs(adapter);
14281429 return rc;
14291430 }
14301431
@@ -1474,9 +1475,6 @@ static int ibmvnic_open(struct net_device *netdev) · 43 unmodified lines
14741475 rc = init_resources(adapter);
14751476 if (rc) {
14761477 netdev_err(netdev, "failed to initialize resources\n");
1477− release_resources(adapter);
1478− release_rx_pools(adapter);
1479− release_tx_pools(adapter);
14801478 goto out;
14811479 }
14821480 }
@@ -1493,6 +1491,13 @@ out: · 10 unmodified lines
14931491 adapter->state = VNIC_OPEN;
14941492 rc = 0;
14951493 }
1494+
1495+ if (rc) {
1496+ release_resources(adapter);
1497+ release_rx_pools(adapter);
1498+ release_tx_pools(adapter);
1499+ }
1500+
14961501 return rc;
14971502 }
14981503
@@ -2602,6 +2607,7 @@ static void __ibmvnic_reset(struct work_struct *work) · 1103 unmodified lines
26022607 struct ibmvnic_rwi *rwi;
26032608 unsigned long flags;
26042609 u32 reset_state;
2610+ int num_fails = 0;
26052611 int rc = 0;
26062612
26072613 adapter = container_of(work, struct ibmvnic_adapter, ibmvnic_reset);
@@ -2655,11 +2661,23 @@ static void __ibmvnic_reset(struct work_struct *work) · 47 unmodified lines
26552661 rc = do_hard_reset(adapter, rwi, reset_state);
26562662 rtnl_unlock();
26572663 }
2658− if (rc) {
2659− /* give backing device time to settle down */
2664+ if (rc)
2665+ num_fails++;
2666+ else
2667+ num_fails = 0;
2668+
2669+ /* If auto-priority-failover is enabled we can get
2670+ * back to back failovers during resets, resulting
2671+ * in at least two failed resets (from high-priority
2672+ * backing device to low-priority one and then back)
2673+ * If resets continue to fail beyond that, give the
2674+ * adapter some time to settle down before retrying.
2675+ */
2676+ if (num_fails >= 3) {
26602677 netdev_dbg(adapter->netdev,
2661− "[S:%s] Hard reset failed, waiting 60 secs\n",
2662− adapter_state_to_string(adapter->state));
2678+ "[S:%s] Hard reset failed %d times, waiting 60 secs\n",
2679+ adapter_state_to_string(adapter->state),
2680+ num_fails);
26632681 set_current_state(TASK_UNINTERRUPTIBLE);
26642682 schedule_timeout(60 * HZ);
26652683 }
@@ -3844,11 +3862,25 @@ static void send_request_cap(struct ibmvnic_adapter *adapter, int retry) · 1178 unmodified lines
38443862 struct device *dev = &adapter->vdev->dev;
38453863 union ibmvnic_crq crq;
38463864 int max_entries;
3865+ int cap_reqs;
3866+
3867+ /* We send out 6 or 7 REQUEST_CAPABILITY CRQs below (depending on
3868+ * the PROMISC flag). Initialize this count upfront. When the tasklet
3869+ * receives a response to all of these, it will send the next protocol
3870+ * message (QUERY_IP_OFFLOAD).
3871+ */
3872+ if (!(adapter->netdev->flags & IFF_PROMISC) ||
3873+ adapter->promisc_supported)
3874+ cap_reqs = 7;
3875+ else
3876+ cap_reqs = 6;
38473877
38483878 if (!retry) {
38493879 /* Sub-CRQ entries are 32 byte long */
38503880 int entries_page = 4 * PAGE_SIZE / (sizeof(u64) * 4);
38513881
3882+ atomic_set(&adapter->running_cap_crqs, cap_reqs);
3883+
38523884 if (adapter->min_tx_entries_per_subcrq > entries_page ||
38533885 adapter->min_rx_add_entries_per_subcrq > entries_page) {
38543886 dev_err(dev, "Fatal, invalid entries per sub-crq\n");
@@ -3909,44 +3941,45 @@ static void send_request_cap(struct ibmvnic_adapter *adapter, int retry) · 54 unmodified lines
39093941 adapter->opt_rx_comp_queues;
39103942
39113943 adapter->req_rx_add_queues = adapter->max_rx_add_queues;
3944+ } else {
3945+ atomic_add(cap_reqs, &adapter->running_cap_crqs);
39123946 }
3913−
39143947 memset(&crq, 0, sizeof(crq));
39153948 crq.request_capability.first = IBMVNIC_CRQ_CMD;
39163949 crq.request_capability.cmd = REQUEST_CAPABILITY;
39173950
39183951 crq.request_capability.capability = cpu_to_be16(REQ_TX_QUEUES);
39193952 crq.request_capability.number = cpu_to_be64(adapter->req_tx_queues);
3920− atomic_inc(&adapter->running_cap_crqs);
3953+ cap_reqs--;
39213954 ibmvnic_send_crq(adapter, &crq);
39223955
39233956 crq.request_capability.capability = cpu_to_be16(REQ_RX_QUEUES);
39243957 crq.request_capability.number = cpu_to_be64(adapter->req_rx_queues);
3925− atomic_inc(&adapter->running_cap_crqs);
3958+ cap_reqs--;
39263959 ibmvnic_send_crq(adapter, &crq);
39273960
39283961 crq.request_capability.capability = cpu_to_be16(REQ_RX_ADD_QUEUES);
39293962 crq.request_capability.number = cpu_to_be64(adapter->req_rx_add_queues);
3930− atomic_inc(&adapter->running_cap_crqs);
3963+ cap_reqs--;
39313964 ibmvnic_send_crq(adapter, &crq);
39323965
39333966 crq.request_capability.capability =
39343967 cpu_to_be16(REQ_TX_ENTRIES_PER_SUBCRQ);
39353968 crq.request_capability.number =
39363969 cpu_to_be64(adapter->req_tx_entries_per_subcrq);
3937− atomic_inc(&adapter->running_cap_crqs);
3970+ cap_reqs--;
39383971 ibmvnic_send_crq(adapter, &crq);
39393972
39403973 crq.request_capability.capability =
39413974 cpu_to_be16(REQ_RX_ADD_ENTRIES_PER_SUBCRQ);
39423975 crq.request_capability.number =
39433976 cpu_to_be64(adapter->req_rx_add_entries_per_subcrq);
3944− atomic_inc(&adapter->running_cap_crqs);
3977+ cap_reqs--;
39453978 ibmvnic_send_crq(adapter, &crq);
39463979
39473980 crq.request_capability.capability = cpu_to_be16(REQ_MTU);
39483981 crq.request_capability.number = cpu_to_be64(adapter->req_mtu);
3949− atomic_inc(&adapter->running_cap_crqs);
3982+ cap_reqs--;
39503983 ibmvnic_send_crq(adapter, &crq);
39513984
39523985 if (adapter->netdev->flags & IFF_PROMISC) {
@@ -3954,16 +3987,21 @@ static void send_request_cap(struct ibmvnic_adapter *adapter, int retry) · 1 unmodified line
39543987 crq.request_capability.capability =
39553988 cpu_to_be16(PROMISC_REQUESTED);
39563989 crq.request_capability.number = cpu_to_be64(1);
3957− atomic_inc(&adapter->running_cap_crqs);
3990+ cap_reqs--;
39583991 ibmvnic_send_crq(adapter, &crq);
39593992 }
39603993 } else {
39613994 crq.request_capability.capability =
39623995 cpu_to_be16(PROMISC_REQUESTED);
39633996 crq.request_capability.number = cpu_to_be64(0);
3964− atomic_inc(&adapter->running_cap_crqs);
3997+ cap_reqs--;
39653998 ibmvnic_send_crq(adapter, &crq);
39663999 }
4000+
4001+ /* Keep at end to catch any discrepancy between expected and actual
4002+ * CRQs sent.
4003+ */
4004+ WARN_ON(cap_reqs != 0);
39674005 }
39684006
39694007 static int pending_scrq(struct ibmvnic_adapter *adapter,
@@ -4357,118 +4395,132 @@ static void send_query_map(struct ibmvnic_adapter *adapter) · 387 unmodified lines
43574395 static void send_query_cap(struct ibmvnic_adapter *adapter)
43584396 {
43594397 union ibmvnic_crq crq;
4398+ int cap_reqs;
4399+
4400+ /* We send out 25 QUERY_CAPABILITY CRQs below. Initialize this count
4401+ * upfront. When the tasklet receives a response to all of these, it
4402+ * can send out the next protocol messaage (REQUEST_CAPABILITY).
4403+ */
4404+ cap_reqs = 25;
4405+
4406+ atomic_set(&adapter->running_cap_crqs, cap_reqs);
43604407
4361− atomic_set(&adapter->running_cap_crqs, 0);
43624408 memset(&crq, 0, sizeof(crq));
43634409 crq.query_capability.first = IBMVNIC_CRQ_CMD;
43644410 crq.query_capability.cmd = QUERY_CAPABILITY;
43654411
43664412 crq.query_capability.capability = cpu_to_be16(MIN_TX_QUEUES);
4367− atomic_inc(&adapter->running_cap_crqs);
43684413 ibmvnic_send_crq(adapter, &crq);
4414+ cap_reqs--;
43694415
43704416 crq.query_capability.capability = cpu_to_be16(MIN_RX_QUEUES);
4371− atomic_inc(&adapter->running_cap_crqs);
43724417 ibmvnic_send_crq(adapter, &crq);
4418+ cap_reqs--;
43734419
43744420 crq.query_capability.capability = cpu_to_be16(MIN_RX_ADD_QUEUES);
4375− atomic_inc(&adapter->running_cap_crqs);
43764421 ibmvnic_send_crq(adapter, &crq);
4422+ cap_reqs--;
43774423
43784424 crq.query_capability.capability = cpu_to_be16(MAX_TX_QUEUES);
4379− atomic_inc(&adapter->running_cap_crqs);
43804425 ibmvnic_send_crq(adapter, &crq);
4426+ cap_reqs--;
43814427
43824428 crq.query_capability.capability = cpu_to_be16(MAX_RX_QUEUES);
4383− atomic_inc(&adapter->running_cap_crqs);
43844429 ibmvnic_send_crq(adapter, &crq);
4430+ cap_reqs--;
43854431
43864432 crq.query_capability.capability = cpu_to_be16(MAX_RX_ADD_QUEUES);
4387− atomic_inc(&adapter->running_cap_crqs);
43884433 ibmvnic_send_crq(adapter, &crq);
4434+ cap_reqs--;
43894435
43904436 crq.query_capability.capability =
43914437 cpu_to_be16(MIN_TX_ENTRIES_PER_SUBCRQ);
4392− atomic_inc(&adapter->running_cap_crqs);
43934438 ibmvnic_send_crq(adapter, &crq);
4439+ cap_reqs--;
43944440
43954441 crq.query_capability.capability =
43964442 cpu_to_be16(MIN_RX_ADD_ENTRIES_PER_SUBCRQ);
4397− atomic_inc(&adapter->running_cap_crqs);
43984443 ibmvnic_send_crq(adapter, &crq);
4444+ cap_reqs--;
43994445
44004446 crq.query_capability.capability =
44014447 cpu_to_be16(MAX_TX_ENTRIES_PER_SUBCRQ);
4402− atomic_inc(&adapter->running_cap_crqs);
44034448 ibmvnic_send_crq(adapter, &crq);
4449+ cap_reqs--;
44044450
44054451 crq.query_capability.capability =
44064452 cpu_to_be16(MAX_RX_ADD_ENTRIES_PER_SUBCRQ);
4407− atomic_inc(&adapter->running_cap_crqs);
44084453 ibmvnic_send_crq(adapter, &crq);
4454+ cap_reqs--;
44094455
44104456 crq.query_capability.capability = cpu_to_be16(TCP_IP_OFFLOAD);
4411− atomic_inc(&adapter->running_cap_crqs);
44124457 ibmvnic_send_crq(adapter, &crq);
4458+ cap_reqs--;
44134459
44144460 crq.query_capability.capability = cpu_to_be16(PROMISC_SUPPORTED);
4415− atomic_inc(&adapter->running_cap_crqs);
44164461 ibmvnic_send_crq(adapter, &crq);
4462+ cap_reqs--;
44174463
44184464 crq.query_capability.capability = cpu_to_be16(MIN_MTU);
4419− atomic_inc(&adapter->running_cap_crqs);
44204465 ibmvnic_send_crq(adapter, &crq);
4466+ cap_reqs--;
44214467
44224468 crq.query_capability.capability = cpu_to_be16(MAX_MTU);
4423− atomic_inc(&adapter->running_cap_crqs);
44244469 ibmvnic_send_crq(adapter, &crq);
4470+ cap_reqs--;
44254471
44264472 crq.query_capability.capability = cpu_to_be16(MAX_MULTICAST_FILTERS);
4427− atomic_inc(&adapter->running_cap_crqs);
44284473 ibmvnic_send_crq(adapter, &crq);
4474+ cap_reqs--;
44294475
44304476 crq.query_capability.capability = cpu_to_be16(VLAN_HEADER_INSERTION);
4431− atomic_inc(&adapter->running_cap_crqs);
44324477 ibmvnic_send_crq(adapter, &crq);
4478+ cap_reqs--;
44334479
44344480 crq.query_capability.capability = cpu_to_be16(RX_VLAN_HEADER_INSERTION);
4435− atomic_inc(&adapter->running_cap_crqs);
44364481 ibmvnic_send_crq(adapter, &crq);
4482+ cap_reqs--;
44374483
44384484 crq.query_capability.capability = cpu_to_be16(MAX_TX_SG_ENTRIES);
4439− atomic_inc(&adapter->running_cap_crqs);
44404485 ibmvnic_send_crq(adapter, &crq);
4486+ cap_reqs--;
44414487
44424488 crq.query_capability.capability = cpu_to_be16(RX_SG_SUPPORTED);
4443− atomic_inc(&adapter->running_cap_crqs);
44444489 ibmvnic_send_crq(adapter, &crq);
4490+ cap_reqs--;
44454491
44464492 crq.query_capability.capability = cpu_to_be16(OPT_TX_COMP_SUB_QUEUES);
4447− atomic_inc(&adapter->running_cap_crqs);
44484493 ibmvnic_send_crq(adapter, &crq);
4494+ cap_reqs--;
44494495
44504496 crq.query_capability.capability = cpu_to_be16(OPT_RX_COMP_QUEUES);
4451− atomic_inc(&adapter->running_cap_crqs);
44524497 ibmvnic_send_crq(adapter, &crq);
4498+ cap_reqs--;
44534499
44544500 crq.query_capability.capability =
44554501 cpu_to_be16(OPT_RX_BUFADD_Q_PER_RX_COMP_Q);
4456− atomic_inc(&adapter->running_cap_crqs);
44574502 ibmvnic_send_crq(adapter, &crq);
4503+ cap_reqs--;
44584504
44594505 crq.query_capability.capability =
44604506 cpu_to_be16(OPT_TX_ENTRIES_PER_SUBCRQ);
4461− atomic_inc(&adapter->running_cap_crqs);
44624507 ibmvnic_send_crq(adapter, &crq);
4508+ cap_reqs--;
44634509
44644510 crq.query_capability.capability =
44654511 cpu_to_be16(OPT_RXBA_ENTRIES_PER_SUBCRQ);
4466− atomic_inc(&adapter->running_cap_crqs);
44674512 ibmvnic_send_crq(adapter, &crq);
4513+ cap_reqs--;
44684514
44694515 crq.query_capability.capability = cpu_to_be16(TX_RX_DESC_REQ);
4470− atomic_inc(&adapter->running_cap_crqs);
4516+
44714517 ibmvnic_send_crq(adapter, &crq);
4518+ cap_reqs--;
4519+
4520+ /* Keep at end to catch any discrepancy between expected and actual
4521+ * CRQs sent.
4522+ */
4523+ WARN_ON(cap_reqs != 0);
44724524 }
44734525
44744526 static void send_query_ip_offload(struct ibmvnic_adapter *adapter)
@@ -4772,6 +4824,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, · 297 unmodified lines
47724824 char *name;
47734825
47744826 atomic_dec(&adapter->running_cap_crqs);
4827+ netdev_dbg(adapter->netdev, "Outstanding request-caps: %d\n",
4828+ atomic_read(&adapter->running_cap_crqs));
47754829 switch (be16_to_cpu(crq->request_capability_rsp.capability)) {
47764830 case REQ_TX_QUEUES:
47774831 req_value = &adapter->req_tx_queues;
@@ -4835,10 +4889,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, · 57 unmodified lines
48354889 }
48364890
48374891 /* Done receiving requested capabilities, query IP offload support */
4838− if (atomic_read(&adapter->running_cap_crqs) == 0) {
4839− adapter->wait_capability = false;
4892+ if (atomic_read(&adapter->running_cap_crqs) == 0)
48404893 send_query_ip_offload(adapter);
4841− }
48424894 }
48434895
48444896 static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
@@ -5136,10 +5188,8 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq, · 291 unmodified lines
51365188 }
51375189
51385190 out:
5139− if (atomic_read(&adapter->running_cap_crqs) == 0) {
5140− adapter->wait_capability = false;
5191+ if (atomic_read(&adapter->running_cap_crqs) == 0)
51415192 send_request_cap(adapter, 0);
5142− }
51435193 }
51445194
51455195 static int send_query_phys_parms(struct ibmvnic_adapter *adapter)
@@ -5435,33 +5485,21 @@ static void ibmvnic_tasklet(struct tasklet_struct *t) · 289 unmodified lines
54355485 struct ibmvnic_crq_queue *queue = &adapter->crq;
54365486 union ibmvnic_crq *crq;
54375487 unsigned long flags;
5438− bool done = false;
54395488
54405489 spin_lock_irqsave(&queue->lock, flags);
5441− while (!done) {
5442− /* Pull all the valid messages off the CRQ */
5443− while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
5444− /* This barrier makes sure ibmvnic_next_crq()'s
5445− * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
5446− * before ibmvnic_handle_crq()'s
5447− * switch(gen_crq->first) and switch(gen_crq->cmd).
5448− */
5449− dma_rmb();
5450− ibmvnic_handle_crq(crq, adapter);
5451− crq->generic.first = 0;
5452− }
54535490
5454− /* remain in tasklet until all
5455− * capabilities responses are received
5491+ /* Pull all the valid messages off the CRQ */
5492+ while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
5493+ /* This barrier makes sure ibmvnic_next_crq()'s
5494+ * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
5495+ * before ibmvnic_handle_crq()'s
5496+ * switch(gen_crq->first) and switch(gen_crq->cmd).
54565497 */
5457− if (!adapter->wait_capability)
5458− done = true;
5498+ dma_rmb();
5499+ ibmvnic_handle_crq(crq, adapter);
5500+ crq->generic.first = 0;
54595501 }
5460− /* if capabilities CRQ's were sent in this tasklet, the following
5461− * tasklet must wait until all responses are received
5462− */
5463− if (atomic_read(&adapter->running_cap_crqs) != 0)
5464− adapter->wait_capability = true;
5502+
54655503 spin_unlock_irqrestore(&queue->lock, flags);
54665504 }
54675505
drivers/net/ethernet/ibm/ibmvnic.h+0−1
@@ -919,7 +919,6 @@ struct ibmvnic_adapter { · 918 unmodified lines
919919 int login_rsp_buf_sz;
920920
921921 atomic_t running_cap_crqs;
922− bool wait_capability;
923922
924923 struct ibmvnic_sub_crq_queue **tx_scrq ____cacheline_aligned;
925924 struct ibmvnic_sub_crq_queue **rx_scrq ____cacheline_aligned;
drivers/net/ethernet/intel/e1000e/e1000.h+3−1
@@ -115,7 +115,8 @@ enum e1000_boards { · 114 unmodified lines
115115 board_pch_lpt,
116116 board_pch_spt,
117117 board_pch_cnp,
118− board_pch_tgp
118+ board_pch_tgp,
119+ board_pch_adp
119120 };
120121
121122 struct e1000_ps_page {
@@ -502,6 +503,7 @@ extern const struct e1000_info e1000_pch_lpt_info; · 380 unmodified lines
502503 extern const struct e1000_info e1000_pch_spt_info;
503504 extern const struct e1000_info e1000_pch_cnp_info;
504505 extern const struct e1000_info e1000_pch_tgp_info;
506+extern const struct e1000_info e1000_pch_adp_info;
505507 extern const struct e1000_info e1000_es2_info;
506508
507509 void e1000e_ptp_init(struct e1000_adapter *adapter);
drivers/net/ethernet/intel/e1000e/ich8lan.c+20−0
@@ -6021,3 +6021,23 @@ const struct e1000_info e1000_pch_tgp_info = { · 6020 unmodified lines
60216021 .phy_ops = &ich8_phy_ops,
60226022 .nvm_ops = &spt_nvm_ops,
60236023 };
6024+
6025+const struct e1000_info e1000_pch_adp_info = {
6026+ .mac = e1000_pch_adp,
6027+ .flags = FLAG_IS_ICH
6028+ | FLAG_HAS_WOL
6029+ | FLAG_HAS_HW_TIMESTAMP
6030+ | FLAG_HAS_CTRLEXT_ON_LOAD
6031+ | FLAG_HAS_AMT
6032+ | FLAG_HAS_FLASH
6033+ | FLAG_HAS_JUMBO_FRAMES
6034+ | FLAG_APME_IN_WUC,
6035+ .flags2 = FLAG2_HAS_PHY_STATS
6036+ | FLAG2_HAS_EEE,
6037+ .pba = 26,
6038+ .max_hw_frame_size = 9022,
6039+ .get_variants = e1000_get_variants_ich8lan,
6040+ .mac_ops = &ich8_mac_ops,
6041+ .phy_ops = &ich8_phy_ops,
6042+ .nvm_ops = &spt_nvm_ops,
6043+};
drivers/net/ethernet/intel/e1000e/netdev.c+21−18
@@ -52,6 +52,7 @@ static const struct e1000_info *e1000_info_tbl[] = { · 51 unmodified lines
5252 [board_pch_spt] = &e1000_pch_spt_info,
5353 [board_pch_cnp] = &e1000_pch_cnp_info,
5454 [board_pch_tgp] = &e1000_pch_tgp_info,
55+ [board_pch_adp] = &e1000_pch_adp_info,
5556 };
5657
5758 struct e1000_reg_info {
@@ -6341,7 +6342,8 @@ static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter) · 6283 unmodified lines
63416342 u32 mac_data;
63426343 u16 phy_data;
63436344
6344− if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
6345+ if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID &&
6346+ hw->mac.type >= e1000_pch_adp) {
63456347 /* Request ME configure the device for S0ix */
63466348 mac_data = er32(H2ME);
63476349 mac_data |= E1000_H2ME_START_DPG;
@@ -6490,7 +6492,8 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter) · 142 unmodified lines
64906492 u16 phy_data;
64916493 u32 i = 0;
64926494
6493− if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
6495+ if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID &&
6496+ hw->mac.type >= e1000_pch_adp) {
64946497 /* Request ME unconfigure the device from S0ix */
64956498 mac_data = er32(H2ME);
64966499 mac_data &= ~E1000_H2ME_START_DPG;
@@ -7898,22 +7901,22 @@ static const struct pci_device_id e1000_pci_tbl[] = { · 1401 unmodified lines
78987901 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14), board_pch_tgp },
78997902 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15), board_pch_tgp },
79007903 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V15), board_pch_tgp },
7901− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM23), board_pch_tgp },
7902− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V23), board_pch_tgp },
7903− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16), board_pch_tgp },
7904− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_tgp },
7905− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_tgp },
7906− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_tgp },
7907− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_tgp },
7908− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_tgp },
7909− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_tgp },
7910− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_tgp },
7911− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_tgp },
7912− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_tgp },
7913− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_tgp },
7914− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_tgp },
7915− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_tgp },
7916− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21), board_pch_tgp },
7904+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM23), board_pch_adp },
7905+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V23), board_pch_adp },
7906+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16), board_pch_adp },
7907+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_adp },
7908+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_adp },
7909+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_adp },
7910+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_adp },
7911+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_adp },
7912+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_adp },
7913+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_adp },
7914+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_adp },
7915+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_adp },
7916+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_adp },
7917+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_adp },
7918+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_adp },
7919+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21), board_pch_adp },
79177920
79187921 { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
79197922 };
drivers/net/ethernet/intel/i40e/i40e.h+5−5
@@ -144,6 +144,7 @@ enum i40e_state_t { · 143 unmodified lines
144144 __I40E_VIRTCHNL_OP_PENDING,
145145 __I40E_RECOVERY_MODE,
146146 __I40E_VF_RESETS_DISABLED, /* disable resets during i40e_remove */
147+ __I40E_IN_REMOVE,
147148 __I40E_VFS_RELEASING,
148149 /* This must be last as it determines the size of the BITMAP */
149150 __I40E_STATE_SIZE__,
@@ -174,7 +175,6 @@ enum i40e_interrupt_policy { · 24 unmodified lines
174175
175176 struct i40e_lump_tracking {
176177 u16 num_entries;
177− u16 search_hint;
178178 u16 list[0];
179179 #define I40E_PILE_VALID_BIT 0x8000
180180 #define I40E_IWARP_IRQ_PILE_ID (I40E_PILE_VALID_BIT - 2)
@@ -848,12 +848,12 @@ struct i40e_vsi { · 667 unmodified lines
848848 struct rtnl_link_stats64 net_stats_offsets;
849849 struct i40e_eth_stats eth_stats;
850850 struct i40e_eth_stats eth_stats_offsets;
851− u32 tx_restart;
852− u32 tx_busy;
851+ u64 tx_restart;
852+ u64 tx_busy;
853853 u64 tx_linearize;
854854 u64 tx_force_wb;
855− u32 rx_buf_failed;
856− u32 rx_page_failed;
855+ u64 rx_buf_failed;
856+ u64 rx_page_failed;
857857
858858 /* These are containers of ring pointers, allocated at run-time */
859859 struct i40e_ring **rx_rings;
drivers/net/ethernet/intel/i40e/i40e_debugfs.c+1−1
@@ -240,7 +240,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid) · 239 unmodified lines
240240 (unsigned long int)vsi->net_stats_offsets.rx_compressed,
241241 (unsigned long int)vsi->net_stats_offsets.tx_compressed);
242242 dev_info(&pf->pdev->dev,
243− " tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n",
243+ " tx_restart = %llu, tx_busy = %llu, rx_buf_failed = %llu, rx_page_failed = %llu\n",
244244 vsi->tx_restart, vsi->tx_busy,
245245 vsi->rx_buf_failed, vsi->rx_page_failed);
246246 rcu_read_lock();
drivers/net/ethernet/intel/i40e/i40e_main.c+50−25
@@ -196,10 +196,6 @@ int i40e_free_virt_mem_d(struct i40e_hw *hw, struct i40e_virt_mem *mem) · 195 unmodified lines
196196 * @id: an owner id to stick on the items assigned
197197 *
198198 * Returns the base item index of the lump, or negative for error
199− *
200− * The search_hint trick and lack of advanced fit-finding only work
201− * because we're highly likely to have all the same size lump requests.
202− * Linear search time and any fragmentation should be minimal.
203199 **/
204200 static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
205201 u16 needed, u16 id)
@@ -214,8 +210,21 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, · 8 unmodified lines
214210 return -EINVAL;
215211 }
216212
217− /* start the linear search with an imperfect hint */
218− i = pile->search_hint;
213+ /* Allocate last queue in the pile for FDIR VSI queue
214+ * so it doesn't fragment the qp_pile
215+ */
216+ if (pile == pf->qp_pile && pf->vsi[id]->type == I40E_VSI_FDIR) {
217+ if (pile->list[pile->num_entries - 1] & I40E_PILE_VALID_BIT) {
218+ dev_err(&pf->pdev->dev,
219+ "Cannot allocate queue %d for I40E_VSI_FDIR\n",
220+ pile->num_entries - 1);
221+ return -ENOMEM;
222+ }
223+ pile->list[pile->num_entries - 1] = id | I40E_PILE_VALID_BIT;
224+ return pile->num_entries - 1;
225+ }
226+
227+ i = 0;
219228 while (i < pile->num_entries) {
220229 /* skip already allocated entries */
221230 if (pile->list[i] & I40E_PILE_VALID_BIT) {
@@ -234,7 +243,6 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, · 12 unmodified lines
234243 for (j = 0; j < needed; j++)
235244 pile->list[i+j] = id | I40E_PILE_VALID_BIT;
236245 ret = i;
237− pile->search_hint = i + j;
238246 break;
239247 }
240248
@@ -257,7 +265,7 @@ static int i40e_put_lump(struct i40e_lump_tracking *pile, u16 index, u16 id) · 16 unmodified lines
257265 {
258266 int valid_id = (id | I40E_PILE_VALID_BIT);
259267 int count = 0;
260− int i;
268+ u16 i;
261269
262270 if (!pile || index >= pile->num_entries)
263271 return -EINVAL;
@@ -269,8 +277,6 @@ static int i40e_put_lump(struct i40e_lump_tracking *pile, u16 index, u16 id) · 5 unmodified lines
269277 count++;
270278 }
271279
272− if (count && index < pile->search_hint)
273− pile->search_hint = index;
274280
275281 return count;
276282 }
@@ -772,9 +778,9 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) · 495 unmodified lines
772778 struct rtnl_link_stats64 *ns; /* netdev stats */
773779 struct i40e_eth_stats *oes;
774780 struct i40e_eth_stats *es; /* device's eth stats */
775− u32 tx_restart, tx_busy;
781+ u64 tx_restart, tx_busy;
776782 struct i40e_ring *p;
777− u32 rx_page, rx_buf;
783+ u64 rx_page, rx_buf;
778784 u64 bytes, packets;
779785 unsigned int start;
780786 u64 tx_linearize;
@@ -5366,7 +5372,15 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc, · 4585 unmodified lines
53665372 /* There is no need to reset BW when mqprio mode is on. */
53675373 if (pf->flags & I40E_FLAG_TC_MQPRIO)
53685374 return 0;
5369− if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags & I40E_FLAG_DCB_ENABLED)) {
5375+
5376+ if (!vsi->mqprio_qopt.qopt.hw) {
5377+ if (pf->flags & I40E_FLAG_DCB_ENABLED)
5378+ goto skip_reset;
5379+
5380+ if (IS_ENABLED(CONFIG_I40E_DCB) &&
5381+ i40e_dcb_hw_get_num_tc(&pf->hw) == 1)
5382+ goto skip_reset;
5383+
53705384 ret = i40e_set_bw_limit(vsi, vsi->seid, 0);
53715385 if (ret)
53725386 dev_info(&pf->pdev->dev,
@@ -5374,6 +5388,8 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc, · 1 unmodified line
53745388 vsi->seid);
53755389 return ret;
53765390 }
5391+
5392+skip_reset:
53775393 memset(&bw_data, 0, sizeof(bw_data));
53785394 bw_data.tc_valid_bits = enabled_tc;
53795395 for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
@@ -10574,15 +10590,9 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) · 5194 unmodified lines
1057410590 }
1057510591 i40e_get_oem_version(&pf->hw);
1057610592
10577− if (test_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state) &&
10578− ((hw->aq.fw_maj_ver == 4 && hw->aq.fw_min_ver <= 33) ||
10579− hw->aq.fw_maj_ver < 4) && hw->mac.type == I40E_MAC_XL710) {
10580− /* The following delay is necessary for 4.33 firmware and older
10581− * to recover after EMP reset. 200 ms should suffice but we
10582− * put here 300 ms to be sure that FW is ready to operate
10583− * after reset.
10584− */
10585− mdelay(300);
10593+ if (test_and_clear_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state)) {
10594+ /* The following delay is necessary for firmware update. */
10595+ mdelay(1000);
1058610596 }
1058710597
1058810598 /* re-verify the eeprom if we just had an EMP reset */
@@ -10853,6 +10863,9 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit, · 264 unmodified lines
1085310863 bool lock_acquired)
1085410864 {
1085510865 int ret;
10866+
10867+ if (test_bit(__I40E_IN_REMOVE, pf->state))
10868+ return;
1085610869 /* Now we wait for GRST to settle out.
1085710870 * We don't have to delete the VEBs or VSIs from the hw switch
1085810871 * because the reset will make them disappear.
@@ -11792,7 +11805,6 @@ static int i40e_init_interrupt_scheme(struct i40e_pf *pf) · 933 unmodified lines
1179211805 return -ENOMEM;
1179311806
1179411807 pf->irq_pile->num_entries = vectors;
11795− pf->irq_pile->search_hint = 0;
1179611808
1179711809 /* track first vector for misc interrupts, ignore return */
1179811810 (void)i40e_get_lump(pf, pf->irq_pile, 1, I40E_PILE_VALID_BIT - 1);
@@ -12213,6 +12225,8 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count) · 414 unmodified lines
1221312225
1221412226 vsi->req_queue_pairs = queue_count;
1221512227 i40e_prep_for_reset(pf);
12228+ if (test_bit(__I40E_IN_REMOVE, pf->state))
12229+ return pf->alloc_rss_size;
1221612230
1221712231 pf->alloc_rss_size = new_rss_size;
1221812232
@@ -12595,7 +12609,6 @@ static int i40e_sw_init(struct i40e_pf *pf) · 376 unmodified lines
1259512609 goto sw_init_done;
1259612610 }
1259712611 pf->qp_pile->num_entries = pf->hw.func_caps.num_tx_qp;
12598− pf->qp_pile->search_hint = 0;
1259912612
1260012613 pf->tx_timeout_recovery_level = 1;
1260112614
@@ -13040,6 +13053,10 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog, · 438 unmodified lines
1304013053 if (need_reset)
1304113054 i40e_prep_for_reset(pf);
1304213055
13056+ /* VSI shall be deleted in a moment, just return EINVAL */
13057+ if (test_bit(__I40E_IN_REMOVE, pf->state))
13058+ return -EINVAL;
13059+
1304313060 old_prog = xchg(&vsi->xdp_prog, prog);
1304413061
1304513062 if (need_reset) {
@@ -15930,8 +15947,13 @@ static void i40e_remove(struct pci_dev *pdev) · 2884 unmodified lines
1593015947 i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), 0);
1593115948 i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), 0);
1593215949
15933− while (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
15950+ /* Grab __I40E_RESET_RECOVERY_PENDING and set __I40E_IN_REMOVE
15951+ * flags, once they are set, i40e_rebuild should not be called as
15952+ * i40e_prep_for_reset always returns early.
15953+ */
15954+ while (test_and_set_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
1593415955 usleep_range(1000, 2000);
15956+ set_bit(__I40E_IN_REMOVE, pf->state);
1593515957
1593615958 if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
1593715959 set_bit(__I40E_VF_RESETS_DISABLED, pf->state);
@@ -16130,6 +16152,9 @@ static void i40e_pci_error_reset_done(struct pci_dev *pdev) · 192 unmodified lines
1613016152 {
1613116153 struct i40e_pf *pf = pci_get_drvdata(pdev);
1613216154
16155+ if (test_bit(__I40E_IN_REMOVE, pf->state))
16156+ return;
16157+
1613316158 i40e_reset_and_rebuild(pf, false, false);
1613416159 }
1613516160
drivers/net/ethernet/intel/i40e/i40e_register.h+3−0
@@ -413,6 +413,9 @@ · 412 unmodified lines
413413 #define I40E_VFINT_DYN_CTLN(_INTVF) (0x00024800 + ((_INTVF) * 4)) /* _i=0...511 */ /* Reset: VFR */
414414 #define I40E_VFINT_DYN_CTLN_CLEARPBA_SHIFT 1
415415 #define I40E_VFINT_DYN_CTLN_CLEARPBA_MASK I40E_MASK(0x1, I40E_VFINT_DYN_CTLN_CLEARPBA_SHIFT)
416+#define I40E_VFINT_ICR0_ADMINQ_SHIFT 30
417+#define I40E_VFINT_ICR0_ADMINQ_MASK I40E_MASK(0x1, I40E_VFINT_ICR0_ADMINQ_SHIFT)
418+#define I40E_VFINT_ICR0_ENA(_VF) (0x0002C000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: CORER */
416419 #define I40E_VPINT_AEQCTL(_VF) (0x0002B800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: CORER */
417420 #define I40E_VPINT_AEQCTL_MSIX_INDX_SHIFT 0
418421 #define I40E_VPINT_AEQCTL_ITR_INDX_SHIFT 11
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+101−2
@@ -1376,6 +1376,32 @@ static i40e_status i40e_config_vf_promiscuous_mode(struct i40e_vf *vf, · 1375 unmodified lines
13761376 return aq_ret;
13771377 }
13781378
1379+/**
1380+ * i40e_sync_vfr_reset
1381+ * @hw: pointer to hw struct
1382+ * @vf_id: VF identifier
1383+ *
1384+ * Before trigger hardware reset, we need to know if no other process has
1385+ * reserved the hardware for any reset operations. This check is done by
1386+ * examining the status of the RSTAT1 register used to signal the reset.
1387+ **/
1388+static int i40e_sync_vfr_reset(struct i40e_hw *hw, int vf_id)
1389+{
1390+ u32 reg;
1391+ int i;
1392+
1393+ for (i = 0; i < I40E_VFR_WAIT_COUNT; i++) {
1394+ reg = rd32(hw, I40E_VFINT_ICR0_ENA(vf_id)) &
1395+ I40E_VFINT_ICR0_ADMINQ_MASK;
1396+ if (reg)
1397+ return 0;
1398+
1399+ usleep_range(100, 200);
1400+ }
1401+
1402+ return -EAGAIN;
1403+}
1404+
13791405 /**
13801406 * i40e_trigger_vf_reset
13811407 * @vf: pointer to the VF structure
@@ -1390,9 +1416,11 @@ static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr) · 8 unmodified lines
13901416 struct i40e_pf *pf = vf->pf;
13911417 struct i40e_hw *hw = &pf->hw;
13921418 u32 reg, reg_idx, bit_idx;
1419+ bool vf_active;
1420+ u32 radq;
13931421
13941422 /* warn the VF */
1395− clear_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states);
1423+ vf_active = test_and_clear_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states);
13961424
13971425 /* Disable VF's configuration API during reset. The flag is re-enabled
13981426 * in i40e_alloc_vf_res(), when it's safe again to access VF's VSI.
@@ -1406,7 +1434,19 @@ static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr) · 7 unmodified lines
14061434 * just need to clean up, so don't hit the VFRTRIG register.
14071435 */
14081436 if (!flr) {
1409− /* reset VF using VPGEN_VFRTRIG reg */
1437+ /* Sync VFR reset before trigger next one */
1438+ radq = rd32(hw, I40E_VFINT_ICR0_ENA(vf->vf_id)) &
1439+ I40E_VFINT_ICR0_ADMINQ_MASK;
1440+ if (vf_active && !radq)
1441+ /* waiting for finish reset by virtual driver */
1442+ if (i40e_sync_vfr_reset(hw, vf->vf_id))
1443+ dev_info(&pf->pdev->dev,
1444+ "Reset VF %d never finished\n",
1445+ vf->vf_id);
1446+
1447+ /* Reset VF using VPGEN_VFRTRIG reg. It is also setting
1448+ * in progress state in rstat1 register.
1449+ */
14101450 reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id));
14111451 reg |= I40E_VPGEN_VFRTRIG_VFSWR_MASK;
14121452 wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg);
@@ -2617,6 +2657,59 @@ error_param: · 1204 unmodified lines
26172657 aq_ret);
26182658 }
26192659
2660+/**
2661+ * i40e_check_enough_queue - find big enough queue number
2662+ * @vf: pointer to the VF info
2663+ * @needed: the number of items needed
2664+ *
2665+ * Returns the base item index of the queue, or negative for error
2666+ **/
2667+static int i40e_check_enough_queue(struct i40e_vf *vf, u16 needed)
2668+{
2669+ unsigned int i, cur_queues, more, pool_size;
2670+ struct i40e_lump_tracking *pile;
2671+ struct i40e_pf *pf = vf->pf;
2672+ struct i40e_vsi *vsi;
2673+
2674+ vsi = pf->vsi[vf->lan_vsi_idx];
2675+ cur_queues = vsi->alloc_queue_pairs;
2676+
2677+ /* if current allocated queues are enough for need */
2678+ if (cur_queues >= needed)
2679+ return vsi->base_queue;
2680+
2681+ pile = pf->qp_pile;
2682+ if (cur_queues > 0) {
2683+ /* if the allocated queues are not zero
2684+ * just check if there are enough queues for more
2685+ * behind the allocated queues.
2686+ */
2687+ more = needed - cur_queues;
2688+ for (i = vsi->base_queue + cur_queues;
2689+ i < pile->num_entries; i++) {
2690+ if (pile->list[i] & I40E_PILE_VALID_BIT)
2691+ break;
2692+
2693+ if (more-- == 1)
2694+ /* there is enough */
2695+ return vsi->base_queue;
2696+ }
2697+ }
2698+
2699+ pool_size = 0;
2700+ for (i = 0; i < pile->num_entries; i++) {
2701+ if (pile->list[i] & I40E_PILE_VALID_BIT) {
2702+ pool_size = 0;
2703+ continue;
2704+ }
2705+ if (needed <= ++pool_size)
2706+ /* there is enough */
2707+ return i;
2708+ }
2709+
2710+ return -ENOMEM;
2711+}
2712+
26202713 /**
26212714 * i40e_vc_request_queues_msg
26222715 * @vf: pointer to the VF info
@@ -2651,6 +2744,12 @@ static int i40e_vc_request_queues_msg(struct i40e_vf *vf, u8 *msg) · 28 unmodified lines
26512744 req_pairs - cur_pairs,
26522745 pf->queues_left);
26532746 vfres->num_queue_pairs = pf->queues_left + cur_pairs;
2747+ } else if (i40e_check_enough_queue(vf, req_pairs) < 0) {
2748+ dev_warn(&pf->pdev->dev,
2749+ "VF %d requested %d more queues, but there is not enough for it.\n",
2750+ vf->vf_id,
2751+ req_pairs - cur_pairs);
2752+ vfres->num_queue_pairs = cur_pairs;
26542753 } else {
26552754 /* successful request */
26562755 vf->num_req_queues = req_pairs;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #define I40E_MAX_VF_PROMISC_FLAGS 3
2020
2121 #define I40E_VF_STATE_WAIT_COUNT 20
22+#define I40E_VFR_WAIT_COUNT 100
2223
2324 /* Various queue ctrls */
2425 enum i40e_queue_ctrl {
drivers/net/ethernet/intel/ice/ice.h+2−1
@@ -483,6 +483,7 @@ enum ice_pf_flags { · 482 unmodified lines
483483 ICE_FLAG_VF_TRUE_PROMISC_ENA,
484484 ICE_FLAG_MDD_AUTO_RESET_VF,
485485 ICE_FLAG_LINK_LENIENT_MODE_ENA,
486+ ICE_FLAG_PLUG_AUX_DEV,
486487 ICE_PF_FLAGS_NBITS /* must be last */
487488 };
488489
@@ -887,7 +888,7 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf) · 398 unmodified lines
887888 if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) {
888889 set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
889890 set_bit(ICE_FLAG_AUX_ENA, pf->flags);
890− ice_plug_aux_dev(pf);
891+ set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags);
891892 }
892893 }
893894
drivers/net/ethernet/intel/ice/ice_common.c+2−1
@@ -3342,7 +3342,8 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, · 3341 unmodified lines
33423342 !ice_fw_supports_report_dflt_cfg(hw)) {
33433343 struct ice_link_default_override_tlv tlv;
33443344
3345− if (ice_get_link_default_override(&tlv, pi))
3345+ status = ice_get_link_default_override(&tlv, pi);
3346+ if (status)
33463347 goto out;
33473348
33483349 if (!(tlv.options & ICE_LINK_OVERRIDE_STRICT_MODE) &&
drivers/net/ethernet/intel/ice/ice_lag.c+28−6
@@ -204,17 +204,39 @@ ice_lag_unlink(struct ice_lag *lag, · 203 unmodified lines
204204 lag->upper_netdev = NULL;
205205 }
206206
207− if (lag->peer_netdev) {
208− dev_put(lag->peer_netdev);
209− lag->peer_netdev = NULL;
210− }
211−
207+ lag->peer_netdev = NULL;
212208 ice_set_sriov_cap(pf);
213209 ice_set_rdma_cap(pf);
214210 lag->bonded = false;
215211 lag->role = ICE_LAG_NONE;
216212 }
217213
214+/**
215+ * ice_lag_unregister - handle netdev unregister events
216+ * @lag: LAG info struct
217+ * @netdev: netdev reporting the event
218+ */
219+static void ice_lag_unregister(struct ice_lag *lag, struct net_device *netdev)
220+{
221+ struct ice_pf *pf = lag->pf;
222+
223+ /* check to see if this event is for this netdev
224+ * check that we are in an aggregate
225+ */
226+ if (netdev != lag->netdev || !lag->bonded)
227+ return;
228+
229+ if (lag->upper_netdev) {
230+ dev_put(lag->upper_netdev);
231+ lag->upper_netdev = NULL;
232+ ice_set_sriov_cap(pf);
233+ ice_set_rdma_cap(pf);
234+ }
235+ /* perform some cleanup in case we come back */
236+ lag->bonded = false;
237+ lag->role = ICE_LAG_NONE;
238+}
239+
218240 /**
219241 * ice_lag_changeupper_event - handle LAG changeupper event
220242 * @lag: LAG info struct
@@ -307,7 +329,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event, · 86 unmodified lines
307329 ice_lag_info_event(lag, ptr);
308330 break;
309331 case NETDEV_UNREGISTER:
310− ice_lag_unlink(lag, ptr);
332+ ice_lag_unregister(lag, netdev);
311333 break;
312334 default:
313335 break;
drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h+1−0
@@ -568,6 +568,7 @@ struct ice_tx_ctx_desc { · 567 unmodified lines
568568 (0x3FFFFULL << ICE_TXD_CTX_QW1_TSO_LEN_S)
569569
570570 #define ICE_TXD_CTX_QW1_MSS_S 50
571+#define ICE_TXD_CTX_MIN_MSS 64
571572
572573 #define ICE_TXD_CTX_QW1_VSI_S 50
573574 #define ICE_TXD_CTX_QW1_VSI_M (0x3FFULL << ICE_TXD_CTX_QW1_VSI_S)
drivers/net/ethernet/intel/ice/ice_lib.c+6−0
@@ -1684,6 +1684,12 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi) · 1683 unmodified lines
16841684 if (status)
16851685 dev_dbg(dev, "ice_add_rss_cfg failed for sctp6 flow, vsi = %d, error = %d\n",
16861686 vsi_num, status);
1687+
1688+ status = ice_add_rss_cfg(hw, vsi_handle, ICE_FLOW_HASH_ESP_SPI,
1689+ ICE_FLOW_SEG_HDR_ESP);
1690+ if (status)
1691+ dev_dbg(dev, "ice_add_rss_cfg failed for esp/spi flow, vsi = %d, error = %d\n",
1692+ vsi_num, status);
16871693 }
16881694
16891695 /**
drivers/net/ethernet/intel/ice/ice_main.c+20−8
@@ -2253,6 +2253,9 @@ static void ice_service_task(struct work_struct *work) · 2252 unmodified lines
22532253 return;
22542254 }
22552255
2256+ if (test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags))
2257+ ice_plug_aux_dev(pf);
2258+
22562259 ice_clean_adminq_subtask(pf);
22572260 ice_check_media_subtask(pf);
22582261 ice_check_for_hang_subtask(pf);
@@ -8525,6 +8528,7 @@ ice_features_check(struct sk_buff *skb, · 6266 unmodified lines
85258528 struct net_device __always_unused *netdev,
85268529 netdev_features_t features)
85278530 {
8531+ bool gso = skb_is_gso(skb);
85288532 size_t len;
85298533
85308534 /* No point in doing any of this if neither checksum nor GSO are
@@ -8537,24 +8541,32 @@ ice_features_check(struct sk_buff *skb, · 6 unmodified lines
85378541 /* We cannot support GSO if the MSS is going to be less than
85388542 * 64 bytes. If it is then we need to drop support for GSO.
85398543 */
8540− if (skb_is_gso(skb) && (skb_shinfo(skb)->gso_size < 64))
8544+ if (gso && (skb_shinfo(skb)->gso_size < ICE_TXD_CTX_MIN_MSS))
85418545 features &= ~NETIF_F_GSO_MASK;
85428546
8543− len = skb_network_header(skb) - skb->data;
8547+ len = skb_network_offset(skb);
85448548 if (len > ICE_TXD_MACLEN_MAX || len & 0x1)
85458549 goto out_rm_features;
85468550
8547− len = skb_transport_header(skb) - skb_network_header(skb);
8551+ len = skb_network_header_len(skb);
85488552 if (len > ICE_TXD_IPLEN_MAX || len & 0x1)
85498553 goto out_rm_features;
85508554
85518555 if (skb->encapsulation) {
8552− len = skb_inner_network_header(skb) - skb_transport_header(skb);
8553− if (len > ICE_TXD_L4LEN_MAX || len & 0x1)
8554− goto out_rm_features;
8556+ /* this must work for VXLAN frames AND IPIP/SIT frames, and in
8557+ * the case of IPIP frames, the transport header pointer is
8558+ * after the inner header! So check to make sure that this
8559+ * is a GRE or UDP_TUNNEL frame before doing that math.
8560+ */
8561+ if (gso && (skb_shinfo(skb)->gso_type &
8562+ (SKB_GSO_GRE | SKB_GSO_UDP_TUNNEL))) {
8563+ len = skb_inner_network_header(skb) -
8564+ skb_transport_header(skb);
8565+ if (len > ICE_TXD_L4LEN_MAX || len & 0x1)
8566+ goto out_rm_features;
8567+ }
85558568
8556− len = skb_inner_transport_header(skb) -
8557− skb_inner_network_header(skb);
8569+ len = skb_inner_network_header_len(skb);
85588570 if (len > ICE_TXD_IPLEN_MAX || len & 0x1)
85598571 goto out_rm_features;
85608572 }
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+7−6
@@ -1984,14 +1984,15 @@ static void ixgbevf_set_rx_buffer_len(struct ixgbevf_adapter *adapter, · 1983 unmodified lines
19841984 if (adapter->flags & IXGBEVF_FLAGS_LEGACY_RX)
19851985 return;
19861986
1987− set_ring_build_skb_enabled(rx_ring);
1987+ if (PAGE_SIZE < 8192)
1988+ if (max_frame > IXGBEVF_MAX_FRAME_BUILD_SKB)
1989+ set_ring_uses_large_buffer(rx_ring);
19881990
1989− if (PAGE_SIZE < 8192) {
1990− if (max_frame <= IXGBEVF_MAX_FRAME_BUILD_SKB)
1991− return;
1991+ /* 82599 can't rely on RXDCTL.RLPML to restrict the size of the frame */
1992+ if (adapter->hw.mac.type == ixgbe_mac_82599_vf && !ring_uses_large_buffer(rx_ring))
1993+ return;
19921994
1993− set_ring_uses_large_buffer(rx_ring);
1994− }
1995+ set_ring_build_skb_enabled(rx_ring);
19951996 }
19961997
19971998 /**
drivers/net/ethernet/litex/Kconfig+1−1
@@ -17,7 +17,7 @@ if NET_VENDOR_LITEX · 16 unmodified lines
1717
1818 config LITEX_LITEETH
1919 tristate "LiteX Ethernet support"
20− depends on OF
20+ depends on OF && HAS_IOMEM
2121 help
2222 If you wish to compile a kernel for hardware with a LiteX LiteEth
2323 device then you should answer Y to this.
drivers/net/ethernet/marvell/octeontx2/af/cgx.c+2−0
@@ -1570,6 +1570,8 @@ static struct mac_ops cgx_mac_ops = { · 1569 unmodified lines
15701570 .mac_enadis_pause_frm = cgx_lmac_enadis_pause_frm,
15711571 .mac_pause_frm_config = cgx_lmac_pause_frm_config,
15721572 .mac_enadis_ptp_config = cgx_lmac_ptp_config,
1573+ .mac_rx_tx_enable = cgx_lmac_rx_tx_enable,
1574+ .mac_tx_enable = cgx_lmac_tx_enable,
15731575 };
15741576
15751577 static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h+3−0
@@ -107,6 +107,9 @@ struct mac_ops { · 106 unmodified lines
107107 void (*mac_enadis_ptp_config)(void *cgxd,
108108 int lmac_id,
109109 bool enable);
110+
111+ int (*mac_rx_tx_enable)(void *cgxd, int lmac_id, bool enable);
112+ int (*mac_tx_enable)(void *cgxd, int lmac_id, bool enable);
110113 };
111114
112115 struct cgx {
drivers/net/ethernet/marvell/octeontx2/af/mbox.h+1−0
@@ -732,6 +732,7 @@ enum nix_af_status { · 731 unmodified lines
732732 NIX_AF_ERR_BANDPROF_INVAL_REQ = -428,
733733 NIX_AF_ERR_CQ_CTX_WRITE_ERR = -429,
734734 NIX_AF_ERR_AQ_CTX_RETRY_WRITE = -430,
735+ NIX_AF_ERR_LINK_CREDITS = -431,
735736 };
736737
737738 /* For NIX RX vtag action */
drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h+35−35
@@ -185,7 +185,6 @@ enum npc_kpu_parser_state { · 184 unmodified lines
185185 NPC_S_KPU2_QINQ,
186186 NPC_S_KPU2_ETAG,
187187 NPC_S_KPU2_EXDSA,
188− NPC_S_KPU2_NGIO,
189188 NPC_S_KPU2_CPT_CTAG,
190189 NPC_S_KPU2_CPT_QINQ,
191190 NPC_S_KPU3_CTAG,
@@ -212,6 +211,7 @@ enum npc_kpu_parser_state { · 20 unmodified lines
212211 NPC_S_KPU5_NSH,
213212 NPC_S_KPU5_CPT_IP,
214213 NPC_S_KPU5_CPT_IP6,
214+ NPC_S_KPU5_NGIO,
215215 NPC_S_KPU6_IP6_EXT,
216216 NPC_S_KPU6_IP6_HOP_DEST,
217217 NPC_S_KPU6_IP6_ROUT,
@@ -1120,15 +1120,6 @@ static struct npc_kpu_profile_cam kpu1_cam_entries[] = { · 902 unmodified lines
11201120 0x0000,
11211121 0x0000,
11221122 },
1123− {
1124− NPC_S_KPU1_ETHER, 0xff,
1125− NPC_ETYPE_CTAG,
1126− 0xffff,
1127− NPC_ETYPE_NGIO,
1128− 0xffff,
1129− 0x0000,
1130− 0x0000,
1131− },
11321123 {
11331124 NPC_S_KPU1_ETHER, 0xff,
11341125 NPC_ETYPE_CTAG,
@@ -1966,6 +1957,15 @@ static struct npc_kpu_profile_cam kpu2_cam_entries[] = { · 831 unmodified lines
19661957 0x0000,
19671958 0x0000,
19681959 },
1960+ {
1961+ NPC_S_KPU2_CTAG, 0xff,
1962+ NPC_ETYPE_NGIO,
1963+ 0xffff,
1964+ 0x0000,
1965+ 0x0000,
1966+ 0x0000,
1967+ 0x0000,
1968+ },
19691969 {
19701970 NPC_S_KPU2_CTAG, 0xff,
19711971 NPC_ETYPE_PPPOE,
@@ -2749,15 +2749,6 @@ static struct npc_kpu_profile_cam kpu2_cam_entries[] = { · 777 unmodified lines
27492749 0x0000,
27502750 0x0000,
27512751 },
2752− {
2753− NPC_S_KPU2_NGIO, 0xff,
2754− 0x0000,
2755− 0x0000,
2756− 0x0000,
2757− 0x0000,
2758− 0x0000,
2759− 0x0000,
2760− },
27612752 {
27622753 NPC_S_KPU2_CPT_CTAG, 0xff,
27632754 NPC_ETYPE_IP,
@@ -5089,6 +5080,15 @@ static struct npc_kpu_profile_cam kpu5_cam_entries[] = { · 2325 unmodified lines
50895080 0x0000,
50905081 0x0000,
50915082 },
5083+ {
5084+ NPC_S_KPU5_NGIO, 0xff,
5085+ 0x0000,
5086+ 0x0000,
5087+ 0x0000,
5088+ 0x0000,
5089+ 0x0000,
5090+ 0x0000,
5091+ },
50925092 {
50935093 NPC_S_NA, 0X00,
50945094 0x0000,
@@ -8422,14 +8422,6 @@ static struct npc_kpu_profile_action kpu1_action_entries[] = { · 3327 unmodified lines
84228422 0,
84238423 0, 0, 0, 0,
84248424 },
8425− {
8426− NPC_ERRLEV_RE, NPC_EC_NOERR,
8427− 8, 12, 0, 0, 0,
8428− NPC_S_KPU2_NGIO, 12, 1,
8429− NPC_LID_LA, NPC_LT_LA_ETHER,
8430− 0,
8431− 0, 0, 0, 0,
8432− },
84338425 {
84348426 NPC_ERRLEV_RE, NPC_EC_NOERR,
84358427 8, 12, 0, 0, 0,
@@ -9194,6 +9186,14 @@ static struct npc_kpu_profile_action kpu2_action_entries[] = { · 758 unmodified lines
91949186 0,
91959187 0, 0, 0, 0,
91969188 },
9189+ {
9190+ NPC_ERRLEV_RE, NPC_EC_NOERR,
9191+ 0, 0, 0, 2, 0,
9192+ NPC_S_KPU5_NGIO, 6, 1,
9193+ NPC_LID_LB, NPC_LT_LB_CTAG,
9194+ 0,
9195+ 0, 0, 0, 0,
9196+ },
91979197 {
91989198 NPC_ERRLEV_RE, NPC_EC_NOERR,
91999199 8, 0, 6, 2, 0,
@@ -9890,14 +9890,6 @@ static struct npc_kpu_profile_action kpu2_action_entries[] = { · 690 unmodified lines
98909890 NPC_F_LB_U_UNK_ETYPE | NPC_F_LB_L_EXDSA,
98919891 0, 0, 0, 0,
98929892 },
9893− {
9894− NPC_ERRLEV_RE, NPC_EC_NOERR,
9895− 0, 0, 0, 0, 1,
9896− NPC_S_NA, 0, 1,
9897− NPC_LID_LC, NPC_LT_LC_NGIO,
9898− 0,
9899− 0, 0, 0, 0,
9900− },
99019893 {
99029894 NPC_ERRLEV_RE, NPC_EC_NOERR,
99039895 8, 0, 6, 2, 0,
@@ -11973,6 +11965,14 @@ static struct npc_kpu_profile_action kpu5_action_entries[] = { · 2069 unmodified lines
1197311965 0,
1197411966 0, 0, 0, 0,
1197511967 },
11968+ {
11969+ NPC_ERRLEV_RE, NPC_EC_NOERR,
11970+ 0, 0, 0, 0, 1,
11971+ NPC_S_NA, 0, 1,
11972+ NPC_LID_LC, NPC_LT_LC_NGIO,
11973+ 0,
11974+ 0, 0, 0, 0,
11975+ },
1197611976 {
1197711977 NPC_ERRLEV_LC, NPC_EC_UNK,
1197811978 0, 0, 0, 0, 1,
drivers/net/ethernet/marvell/octeontx2/af/rpm.c+51−15
@@ -30,6 +30,8 @@ static struct mac_ops rpm_mac_ops = { · 29 unmodified lines
3030 .mac_enadis_pause_frm = rpm_lmac_enadis_pause_frm,
3131 .mac_pause_frm_config = rpm_lmac_pause_frm_config,
3232 .mac_enadis_ptp_config = rpm_lmac_ptp_config,
33+ .mac_rx_tx_enable = rpm_lmac_rx_tx_enable,
34+ .mac_tx_enable = rpm_lmac_tx_enable,
3335 };
3436
3537 struct mac_ops *rpm_get_mac_ops(void)
@@ -54,6 +56,43 @@ int rpm_get_nr_lmacs(void *rpmd) · 18 unmodified lines
5456 return hweight8(rpm_read(rpm, 0, CGXX_CMRX_RX_LMACS) & 0xFULL);
5557 }
5658
59+int rpm_lmac_tx_enable(void *rpmd, int lmac_id, bool enable)
60+{
61+ rpm_t *rpm = rpmd;
62+ u64 cfg, last;
63+
64+ if (!is_lmac_valid(rpm, lmac_id))
65+ return -ENODEV;
66+
67+ cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG);
68+ last = cfg;
69+ if (enable)
70+ cfg |= RPM_TX_EN;
71+ else
72+ cfg &= ~(RPM_TX_EN);
73+
74+ if (cfg != last)
75+ rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg);
76+ return !!(last & RPM_TX_EN);
77+}
78+
79+int rpm_lmac_rx_tx_enable(void *rpmd, int lmac_id, bool enable)
80+{
81+ rpm_t *rpm = rpmd;
82+ u64 cfg;
83+
84+ if (!is_lmac_valid(rpm, lmac_id))
85+ return -ENODEV;
86+
87+ cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG);
88+ if (enable)
89+ cfg |= RPM_RX_EN | RPM_TX_EN;
90+ else
91+ cfg &= ~(RPM_RX_EN | RPM_TX_EN);
92+ rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg);
93+ return 0;
94+}
95+
5796 void rpm_lmac_enadis_rx_pause_fwding(void *rpmd, int lmac_id, bool enable)
5897 {
5998 rpm_t *rpm = rpmd;
@@ -252,23 +291,20 @@ int rpm_lmac_internal_loopback(void *rpmd, int lmac_id, bool enable) · 192 unmodified lines
252291 if (!rpm || lmac_id >= rpm->lmac_count)
253292 return -ENODEV;
254293 lmac_type = rpm->mac_ops->get_lmac_type(rpm, lmac_id);
255− if (lmac_type == LMAC_MODE_100G_R) {
256− cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
257−
258− if (enable)
259− cfg |= RPMX_MTI_PCS_LBK;
260− else
261− cfg &= ~RPMX_MTI_PCS_LBK;
262− rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
263− } else {
264− cfg = rpm_read(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1);
265− if (enable)
266− cfg |= RPMX_MTI_PCS_LBK;
267− else
268− cfg &= ~RPMX_MTI_PCS_LBK;
269− rpm_write(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1, cfg);
294+
295+ if (lmac_type == LMAC_MODE_QSGMII || lmac_type == LMAC_MODE_SGMII) {
296+ dev_err(&rpm->pdev->dev, "loopback not supported for LPC mode\n");
297+ return 0;
270298 }
271299
300+ cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
301+
302+ if (enable)
303+ cfg |= RPMX_MTI_PCS_LBK;
304+ else
305+ cfg &= ~RPMX_MTI_PCS_LBK;
306+ rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
307+
272308 return 0;
273309 }
274310
drivers/net/ethernet/marvell/octeontx2/af/rpm.h+4−0
@@ -43,6 +43,8 @@ · 42 unmodified lines
4343 #define RPMX_MTI_STAT_DATA_HI_CDC 0x10038
4444
4545 #define RPM_LMAC_FWI 0xa
46+#define RPM_TX_EN BIT_ULL(0)
47+#define RPM_RX_EN BIT_ULL(1)
4648
4749 /* Function Declarations */
4850 int rpm_get_nr_lmacs(void *rpmd);
@@ -57,4 +59,6 @@ int rpm_lmac_enadis_pause_frm(void *rpmd, int lmac_id, u8 tx_pause, · 8 unmodified lines
5759 int rpm_get_tx_stats(void *rpmd, int lmac_id, int idx, u64 *tx_stat);
5860 int rpm_get_rx_stats(void *rpmd, int lmac_id, int idx, u64 *rx_stat);
5961 void rpm_lmac_ptp_config(void *rpmd, int lmac_id, bool enable);
62+int rpm_lmac_rx_tx_enable(void *rpmd, int lmac_id, bool enable);
63+int rpm_lmac_tx_enable(void *rpmd, int lmac_id, bool enable);
6064 #endif /* RPM_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu.c+5−2
@@ -520,8 +520,11 @@ static void rvu_block_reset(struct rvu *rvu, int blkaddr, u64 rst_reg) · 519 unmodified lines
520520
521521 rvu_write64(rvu, blkaddr, rst_reg, BIT_ULL(0));
522522 err = rvu_poll_reg(rvu, blkaddr, rst_reg, BIT_ULL(63), true);
523− if (err)
524− dev_err(rvu->dev, "HW block:%d reset failed\n", blkaddr);
523+ if (err) {
524+ dev_err(rvu->dev, "HW block:%d reset timeout retrying again\n", blkaddr);
525+ while (rvu_poll_reg(rvu, blkaddr, rst_reg, BIT_ULL(63), true) == -EBUSY)
526+ ;
527+ }
525528 }
526529
527530 static void rvu_reset_all_blocks(struct rvu *rvu)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h+1−0
@@ -806,6 +806,7 @@ bool is_mac_feature_supported(struct rvu *rvu, int pf, int feature); · 805 unmodified lines
806806 u32 rvu_cgx_get_fifolen(struct rvu *rvu);
807807 void *rvu_first_cgx_pdata(struct rvu *rvu);
808808 int cgxlmac_to_pf(struct rvu *rvu, int cgx_id, int lmac_id);
809+int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable);
809810
810811 int npc_get_nixlf_mcam_index(struct npc_mcam *mcam, u16 pcifunc, int nixlf,
811812 int type);
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c+12−2
@@ -441,16 +441,26 @@ void rvu_cgx_enadis_rx_bp(struct rvu *rvu, int pf, bool enable) · 440 unmodified lines
441441 int rvu_cgx_config_rxtx(struct rvu *rvu, u16 pcifunc, bool start)
442442 {
443443 int pf = rvu_get_pf(pcifunc);
444+ struct mac_ops *mac_ops;
444445 u8 cgx_id, lmac_id;
446+ void *cgxd;
445447
446448 if (!is_cgx_config_permitted(rvu, pcifunc))
447449 return LMAC_AF_ERR_PERM_DENIED;
448450
449451 rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
452+ cgxd = rvu_cgx_pdata(cgx_id, rvu);
453+ mac_ops = get_mac_ops(cgxd);
454+
455+ return mac_ops->mac_rx_tx_enable(cgxd, lmac_id, start);
456+}
450457
451− cgx_lmac_rx_tx_enable(rvu_cgx_pdata(cgx_id, rvu), lmac_id, start);
458+int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable)
459+{
460+ struct mac_ops *mac_ops;
452461
453− return 0;
462+ mac_ops = get_mac_ops(cgxd);
463+ return mac_ops->mac_tx_enable(cgxd, lmac_id, enable);
454464 }
455465
456466 void rvu_cgx_disable_dmac_entries(struct rvu *rvu, u16 pcifunc)
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c+2−0
@@ -1224,6 +1224,8 @@ static void print_nix_cn10k_sq_ctx(struct seq_file *m, · 1223 unmodified lines
12241224 seq_printf(m, "W3: head_offset\t\t\t%d\nW3: smenq_next_sqb_vld\t\t%d\n\n",
12251225 sq_ctx->head_offset, sq_ctx->smenq_next_sqb_vld);
12261226
1227+ seq_printf(m, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d\n",
1228+ sq_ctx->smq_next_sq_vld, sq_ctx->smq_pend);
12271229 seq_printf(m, "W4: next_sqb \t\t\t%llx\n\n", sq_ctx->next_sqb);
12281230 seq_printf(m, "W5: tail_sqb \t\t\t%llx\n\n", sq_ctx->tail_sqb);
12291231 seq_printf(m, "W6: smenq_sqb \t\t\t%llx\n\n", sq_ctx->smenq_sqb);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c+10−10
@@ -512,11 +512,11 @@ static int rvu_nix_get_bpid(struct rvu *rvu, struct nix_bp_cfg_req *req, · 511 unmodified lines
512512 cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST);
513513 lmac_chan_cnt = cfg & 0xFF;
514514
515− cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST1);
516− sdp_chan_cnt = cfg & 0xFFF;
517−
518515 cgx_bpid_cnt = hw->cgx_links * lmac_chan_cnt;
519516 lbk_bpid_cnt = hw->lbk_links * ((cfg >> 16) & 0xFF);
517+
518+ cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST1);
519+ sdp_chan_cnt = cfg & 0xFFF;
520520 sdp_bpid_cnt = hw->sdp_links * sdp_chan_cnt;
521521
522522 pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc);
@@ -2068,8 +2068,8 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, · 1545 unmodified lines
20682068 /* enable cgx tx if disabled */
20692069 if (is_pf_cgxmapped(rvu, pf)) {
20702070 rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
2071− restore_tx_en = !cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu),
2072− lmac_id, true);
2071+ restore_tx_en = !rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu),
2072+ lmac_id, true);
20732073 }
20742074
20752075 cfg = rvu_read64(rvu, blkaddr, NIX_AF_SMQX_CFG(smq));
@@ -2092,7 +2092,7 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, · 16 unmodified lines
20922092 rvu_cgx_enadis_rx_bp(rvu, pf, true);
20932093 /* restore cgx tx state */
20942094 if (restore_tx_en)
2095− cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
2095+ rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
20962096 return err;
20972097 }
20982098
@@ -3878,7 +3878,7 @@ nix_config_link_credits(struct rvu *rvu, int blkaddr, int link, · 1779 unmodified lines
38783878 /* Enable cgx tx if disabled for credits to be back */
38793879 if (is_pf_cgxmapped(rvu, pf)) {
38803880 rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
3881− restore_tx_en = !cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu),
3881+ restore_tx_en = !rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu),
38823882 lmac_id, true);
38833883 }
38843884
@@ -3891,8 +3891,8 @@ nix_config_link_credits(struct rvu *rvu, int blkaddr, int link, · 6 unmodified lines
38913891 NIX_AF_TL1X_SW_XOFF(schq), BIT_ULL(0));
38923892 }
38933893
3894− rc = -EBUSY;
3895− poll_tmo = jiffies + usecs_to_jiffies(10000);
3894+ rc = NIX_AF_ERR_LINK_CREDITS;
3895+ poll_tmo = jiffies + usecs_to_jiffies(200000);
38963896 /* Wait for credits to return */
38973897 do {
38983898 if (time_after(jiffies, poll_tmo))
@@ -3918,7 +3918,7 @@ exit: · 19 unmodified lines
39183918
39193919 /* Restore state of cgx tx */
39203920 if (restore_tx_en)
3921− cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
3921+ rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
39223922
39233923 mutex_unlock(&rvu->rsrc_lock);
39243924 return rc;
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c+19−3
@@ -402,6 +402,7 @@ static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam, · 401 unmodified lines
402402 int blkaddr, int index, struct mcam_entry *entry,
403403 bool *enable)
404404 {
405+ struct rvu_npc_mcam_rule *rule;
405406 u16 owner, target_func;
406407 struct rvu_pfvf *pfvf;
407408 u64 rx_action;
@@ -423,6 +424,12 @@ static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam, · 15 unmodified lines
423424 test_bit(NIXLF_INITIALIZED, &pfvf->flags)))
424425 *enable = false;
425426
427+ /* fix up not needed for the rules added by user(ntuple filters) */
428+ list_for_each_entry(rule, &mcam->mcam_rules, list) {
429+ if (rule->entry == index)
430+ return;
431+ }
432+
426433 /* copy VF default entry action to the VF mcam entry */
427434 rx_action = npc_get_default_entry_action(rvu, mcam, blkaddr,
428435 target_func);
@@ -489,8 +496,8 @@ static void npc_config_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, · 60 unmodified lines
489496 }
490497
491498 /* PF installing VF rule */
492− if (intf == NIX_INTF_RX && actindex < mcam->bmap_entries)
493− npc_fixup_vf_rule(rvu, mcam, blkaddr, index, entry, &enable);
499+ if (is_npc_intf_rx(intf) && actindex < mcam->bmap_entries)
500+ npc_fixup_vf_rule(rvu, mcam, blkaddr, actindex, entry, &enable);
494501
495502 /* Set 'action' */
496503 rvu_write64(rvu, blkaddr,
@@ -916,7 +923,8 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam, · 419 unmodified lines
916923 int blkaddr, u16 pcifunc, u64 rx_action)
917924 {
918925 int actindex, index, bank, entry;
919− bool enable;
926+ struct rvu_npc_mcam_rule *rule;
927+ bool enable, update;
920928
921929 if (!(pcifunc & RVU_PFVF_FUNC_MASK))
922930 return;
@@ -924,6 +932,14 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam, · 1 unmodified line
924932 mutex_lock(&mcam->lock);
925933 for (index = 0; index < mcam->bmap_entries; index++) {
926934 if (mcam->entry2target_pffunc[index] == pcifunc) {
935+ update = true;
936+ /* update not needed for the rules added via ntuple filters */
937+ list_for_each_entry(rule, &mcam->mcam_rules, list) {
938+ if (rule->entry == index)
939+ update = false;
940+ }
941+ if (!update)
942+ continue;
927943 bank = npc_get_bank(mcam, index);
928944 actindex = index;
929945 entry = index & (mcam->banksize - 1);
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c+12−8
@@ -1098,14 +1098,6 @@ find_rule: · 1097 unmodified lines
10981098 write_req.cntr = rule->cntr;
10991099 }
11001100
1101− err = rvu_mbox_handler_npc_mcam_write_entry(rvu, &write_req,
1102− &write_rsp);
1103− if (err) {
1104− rvu_mcam_remove_counter_from_rule(rvu, owner, rule);
1105− if (new)
1106− kfree(rule);
1107− return err;
1108− }
11091101 /* update rule */
11101102 memcpy(&rule->packet, &dummy.packet, sizeof(rule->packet));
11111103 memcpy(&rule->mask, &dummy.mask, sizeof(rule->mask));
@@ -1132,6 +1124,18 @@ find_rule: · 20 unmodified lines
11321124 if (req->default_rule)
11331125 pfvf->def_ucast_rule = rule;
11341126
1127+ /* write to mcam entry registers */
1128+ err = rvu_mbox_handler_npc_mcam_write_entry(rvu, &write_req,
1129+ &write_rsp);
1130+ if (err) {
1131+ rvu_mcam_remove_counter_from_rule(rvu, owner, rule);
1132+ if (new) {
1133+ list_del(&rule->list);
1134+ kfree(rule);
1135+ }
1136+ return err;
1137+ }
1138+
11351139 /* VF's MAC address is being changed via PF */
11361140 if (pf_set_vfs_mac) {
11371141 ether_addr_copy(pfvf->default_mac, req->packet.dmac);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h+1−0
@@ -603,6 +603,7 @@ static inline void __cn10k_aura_freeptr(struct otx2_nic *pfvf, u64 aura, · 602 unmodified lines
603603 size++;
604604 tar_addr |= ((size - 1) & 0x7) << 4;
605605 }
606+ dma_wmb();
606607 memcpy((u64 *)lmt_info->lmt_addr, ptrs, sizeof(u64) * num_ptrs);
607608 /* Perform LMTST flush */
608609 cn10k_lmt_flush(val, tar_addr);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+6−1
@@ -394,7 +394,12 @@ static int otx2_forward_vf_mbox_msgs(struct otx2_nic *pf, · 393 unmodified lines
394394 dst_mdev->msg_size = mbox_hdr->msg_size;
395395 dst_mdev->num_msgs = num_msgs;
396396 err = otx2_sync_mbox_msg(dst_mbox);
397− if (err) {
397+ /* Error code -EIO indicate there is a communication failure
398+ * to the AF. Rest of the error codes indicate that AF processed
399+ * VF messages and set the error codes in response messages
400+ * (if any) so simply forward responses to VF.
401+ */
402+ if (err == -EIO) {
398403 dev_warn(pf->dev,
399404 "AF not responding to VF%d messages\n", vf);
400405 /* restore PF mbase and exit */
drivers/net/ethernet/mellanox/mlx5/core/en.h+3−3
@@ -224,7 +224,7 @@ static inline int mlx5e_get_max_num_channels(struct mlx5_core_dev *mdev) · 223 unmodified lines
224224 struct mlx5e_tx_wqe {
225225 struct mlx5_wqe_ctrl_seg ctrl;
226226 struct mlx5_wqe_eth_seg eth;
227− struct mlx5_wqe_data_seg data[0];
227+ struct mlx5_wqe_data_seg data[];
228228 };
229229
230230 struct mlx5e_rx_wqe_ll {
@@ -241,8 +241,8 @@ struct mlx5e_umr_wqe { · 10 unmodified lines
241241 struct mlx5_wqe_umr_ctrl_seg uctrl;
242242 struct mlx5_mkey_seg mkc;
243243 union {
244− struct mlx5_mtt inline_mtts[0];
245− struct mlx5_klm inline_klms[0];
244+ DECLARE_FLEX_ARRAY(struct mlx5_mtt, inline_mtts);
245+ DECLARE_FLEX_ARRAY(struct mlx5_klm, inline_klms);
246246 };
247247 };
248248
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c+2−1
@@ -570,7 +570,8 @@ static int mlx5e_htb_convert_rate(struct mlx5e_priv *priv, u64 rate, · 569 unmodified lines
570570
571571 static void mlx5e_htb_convert_ceil(struct mlx5e_priv *priv, u64 ceil, u32 *max_average_bw)
572572 {
573− *max_average_bw = div_u64(ceil, BYTES_IN_MBIT);
573+ /* Hardware treats 0 as "unlimited", set at least 1. */
574+ *max_average_bw = max_t(u32, div_u64(ceil, BYTES_IN_MBIT), 1);
574575
575576 qos_dbg(priv->mdev, "Convert: ceil %llu -> max_average_bw %u\n",
576577 ceil, *max_average_bw);
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c+14−18
@@ -183,18 +183,7 @@ void mlx5e_rep_bond_unslave(struct mlx5_eswitch *esw, · 182 unmodified lines
183183
184184 static bool mlx5e_rep_is_lag_netdev(struct net_device *netdev)
185185 {
186− struct mlx5e_rep_priv *rpriv;
187− struct mlx5e_priv *priv;
188−
189− /* A given netdev is not a representor or not a slave of LAG configuration */
190− if (!mlx5e_eswitch_rep(netdev) || !netif_is_lag_port(netdev))
191− return false;
192−
193− priv = netdev_priv(netdev);
194− rpriv = priv->ppriv;
195−
196− /* Egress acl forward to vport is supported only non-uplink representor */
197− return rpriv->rep->vport != MLX5_VPORT_UPLINK;
186+ return netif_is_lag_port(netdev) && mlx5e_eswitch_vf_rep(netdev);
198187 }
199188
200189 static void mlx5e_rep_changelowerstate_event(struct net_device *netdev, void *ptr)
@@ -210,9 +199,6 @@ static void mlx5e_rep_changelowerstate_event(struct net_device *netdev, void *pt · 9 unmodified lines
210199 u16 fwd_vport_num;
211200 int err;
212201
213− if (!mlx5e_rep_is_lag_netdev(netdev))
214− return;
215−
216202 info = ptr;
217203 lag_info = info->lower_state_info;
218204 /* This is not an event of a representor becoming active slave */
@@ -266,9 +252,6 @@ static void mlx5e_rep_changeupper_event(struct net_device *netdev, void *ptr) · 47 unmodified lines
266252 struct net_device *lag_dev;
267253 struct mlx5e_priv *priv;
268254
269− if (!mlx5e_rep_is_lag_netdev(netdev))
270− return;
271−
272255 priv = netdev_priv(netdev);
273256 rpriv = priv->ppriv;
274257 lag_dev = info->upper_dev;
@@ -293,6 +276,19 @@ static int mlx5e_rep_esw_bond_netevent(struct notifier_block *nb, · 18 unmodified lines
293276 unsigned long event, void *ptr)
294277 {
295278 struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
279+ struct mlx5e_rep_priv *rpriv;
280+ struct mlx5e_rep_bond *bond;
281+ struct mlx5e_priv *priv;
282+
283+ if (!mlx5e_rep_is_lag_netdev(netdev))
284+ return NOTIFY_DONE;
285+
286+ bond = container_of(nb, struct mlx5e_rep_bond, nb);
287+ priv = netdev_priv(netdev);
288+ rpriv = mlx5_eswitch_get_uplink_priv(priv->mdev->priv.eswitch, REP_ETH);
289+ /* Verify VF representor is on the same device of the bond handling the netevent. */
290+ if (rpriv->uplink_priv.bond != bond)
291+ return NOTIFY_DONE;
296292
297293 switch (event) {
298294 case NETDEV_CHANGELOWERSTATE:
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c+4−2
@@ -491,7 +491,7 @@ void mlx5e_rep_bridge_init(struct mlx5e_priv *priv) · 490 unmodified lines
491491 }
492492
493493 br_offloads->netdev_nb.notifier_call = mlx5_esw_bridge_switchdev_port_event;
494− err = register_netdevice_notifier(&br_offloads->netdev_nb);
494+ err = register_netdevice_notifier_net(&init_net, &br_offloads->netdev_nb);
495495 if (err) {
496496 esw_warn(mdev, "Failed to register bridge offloads netdevice notifier (err=%d)\n",
497497 err);
@@ -509,7 +509,9 @@ err_register_swdev_blk: · 11 unmodified lines
509509 err_register_swdev:
510510 destroy_workqueue(br_offloads->wq);
511511 err_alloc_wq:
512+ rtnl_lock();
512513 mlx5_esw_bridge_cleanup(esw);
514+ rtnl_unlock();
513515 }
514516
515517 void mlx5e_rep_bridge_cleanup(struct mlx5e_priv *priv)
@@ -524,7 +526,7 @@ void mlx5e_rep_bridge_cleanup(struct mlx5e_priv *priv) · 8 unmodified lines
524526 return;
525527
526528 cancel_delayed_work_sync(&br_offloads->update_work);
527− unregister_netdevice_notifier(&br_offloads->netdev_nb);
529+ unregister_netdevice_notifier_net(&init_net, &br_offloads->netdev_nb);
528530 unregister_switchdev_blocking_notifier(&br_offloads->nb_blk);
529531 unregister_switchdev_notifier(&br_offloads->nb);
530532 destroy_workqueue(br_offloads->wq);
drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h+5−0
@@ -167,6 +167,11 @@ static inline u16 mlx5e_txqsq_get_next_pi(struct mlx5e_txqsq *sq, u16 size) · 166 unmodified lines
167167 return pi;
168168 }
169169
170+static inline u16 mlx5e_shampo_get_cqe_header_index(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
171+{
172+ return be16_to_cpu(cqe->shampo.header_entry_index) & (rq->mpwqe.shampo->hd_per_wq - 1);
173+}
174+
170175 struct mlx5e_shampo_umr {
171176 u16 len;
172177 };
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c+3−1
@@ -341,8 +341,10 @@ mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xmit_data *xdptxd, · 340 unmodified lines
341341
342342 /* copy the inline part if required */
343343 if (sq->min_inline_mode != MLX5_INLINE_MODE_NONE) {
344− memcpy(eseg->inline_hdr.start, xdptxd->data, MLX5E_XDP_MIN_INLINE);
344+ memcpy(eseg->inline_hdr.start, xdptxd->data, sizeof(eseg->inline_hdr.start));
345345 eseg->inline_hdr.sz = cpu_to_be16(MLX5E_XDP_MIN_INLINE);
346+ memcpy(dseg, xdptxd->data + sizeof(eseg->inline_hdr.start),
347+ MLX5E_XDP_MIN_INLINE - sizeof(eseg->inline_hdr.start));
346348 dma_len -= MLX5E_XDP_MIN_INLINE;
347349 dma_addr += MLX5E_XDP_MIN_INLINE;
348350 dseg++;
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c+11−2
@@ -157,11 +157,20 @@ static void mlx5e_ipsec_set_swp(struct sk_buff *skb, · 156 unmodified lines
157157 /* Tunnel mode */
158158 if (mode == XFRM_MODE_TUNNEL) {
159159 eseg->swp_inner_l3_offset = skb_inner_network_offset(skb) / 2;
160− eseg->swp_inner_l4_offset = skb_inner_transport_offset(skb) / 2;
161160 if (xo->proto == IPPROTO_IPV6)
162161 eseg->swp_flags |= MLX5_ETH_WQE_SWP_INNER_L3_IPV6;
163− if (inner_ip_hdr(skb)->protocol == IPPROTO_UDP)
162+
163+ switch (xo->inner_ipproto) {
164+ case IPPROTO_UDP:
164165 eseg->swp_flags |= MLX5_ETH_WQE_SWP_INNER_L4_UDP;
166+ fallthrough;
167+ case IPPROTO_TCP:
168+ /* IP | ESP | IP | [TCP | UDP] */
169+ eseg->swp_inner_l4_offset = skb_inner_transport_offset(skb) / 2;
170+ break;
171+ default:
172+ break;
173+ }
165174 return;
166175 }
167176
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h+6−3
@@ -131,14 +131,17 @@ static inline bool · 130 unmodified lines
131131 mlx5e_ipsec_txwqe_build_eseg_csum(struct mlx5e_txqsq *sq, struct sk_buff *skb,
132132 struct mlx5_wqe_eth_seg *eseg)
133133 {
134− struct xfrm_offload *xo = xfrm_offload(skb);
134+ u8 inner_ipproto;
135135
136136 if (!mlx5e_ipsec_eseg_meta(eseg))
137137 return false;
138138
139139 eseg->cs_flags = MLX5_ETH_WQE_L3_CSUM;
140− if (xo->inner_ipproto) {
141− eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM | MLX5_ETH_WQE_L3_INNER_CSUM;
140+ inner_ipproto = xfrm_offload(skb)->inner_ipproto;
141+ if (inner_ipproto) {
142+ eseg->cs_flags |= MLX5_ETH_WQE_L3_INNER_CSUM;
143+ if (inner_ipproto == IPPROTO_TCP || inner_ipproto == IPPROTO_UDP)
144+ eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM;
142145 } else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
143146 eseg->cs_flags |= MLX5_ETH_WQE_L4_CSUM;
144147 sq->stats->csum_partial_inner++;
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+19−11
@@ -1117,7 +1117,7 @@ static void mlx5e_shampo_update_ipv6_udp_hdr(struct mlx5e_rq *rq, struct ipv6hdr · 1116 unmodified lines
11171117 static void mlx5e_shampo_update_fin_psh_flags(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe,
11181118 struct tcphdr *skb_tcp_hd)
11191119 {
1120− u16 header_index = be16_to_cpu(cqe->shampo.header_entry_index);
1120+ u16 header_index = mlx5e_shampo_get_cqe_header_index(rq, cqe);
11211121 struct tcphdr *last_tcp_hd;
11221122 void *last_hd_addr;
11231123
@@ -1871,7 +1871,7 @@ mlx5e_skb_from_cqe_mpwrq_linear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, · 747 unmodified lines
18711871 return skb;
18721872 }
18731873
1874−static void
1874+static struct sk_buff *
18751875 mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,
18761876 struct mlx5_cqe64 *cqe, u16 header_index)
18771877 {
@@ -1895,7 +1895,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, · 17 unmodified lines
18951895 skb = mlx5e_build_linear_skb(rq, hdr, frag_size, rx_headroom, head_size);
18961896
18971897 if (unlikely(!skb))
1898− return;
1898+ return NULL;
18991899
19001900 /* queue up for recycling/reuse */
19011901 page_ref_inc(head->page);
@@ -1907,7 +1907,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, · 5 unmodified lines
19071907 ALIGN(head_size, sizeof(long)));
19081908 if (unlikely(!skb)) {
19091909 rq->stats->buff_alloc_err++;
1910− return;
1910+ return NULL;
19111911 }
19121912
19131913 prefetchw(skb->data);
@@ -1918,9 +1918,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, · 4 unmodified lines
19181918 skb->tail += head_size;
19191919 skb->len += head_size;
19201920 }
1921− rq->hw_gro_data->skb = skb;
1922− NAPI_GRO_CB(skb)->count = 1;
1923− skb_shinfo(skb)->gso_size = mpwrq_get_cqe_byte_cnt(cqe) - head_size;
1921+ return skb;
19241922 }
19251923
19261924 static void
@@ -1973,13 +1971,14 @@ mlx5e_free_rx_shampo_hd_entry(struct mlx5e_rq *rq, u16 header_index) · 46 unmodified lines
19731971 static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
19741972 {
19751973 u16 data_bcnt = mpwrq_get_cqe_byte_cnt(cqe) - cqe->shampo.header_size;
1976− u16 header_index = be16_to_cpu(cqe->shampo.header_entry_index);
1974+ u16 header_index = mlx5e_shampo_get_cqe_header_index(rq, cqe);
19771975 u32 wqe_offset = be32_to_cpu(cqe->shampo.data_offset);
19781976 u16 cstrides = mpwrq_get_cqe_consumed_strides(cqe);
19791977 u32 data_offset = wqe_offset & (PAGE_SIZE - 1);
19801978 u32 cqe_bcnt = mpwrq_get_cqe_byte_cnt(cqe);
19811979 u16 wqe_id = be16_to_cpu(cqe->wqe_id);
19821980 u32 page_idx = wqe_offset >> PAGE_SHIFT;
1981+ u16 head_size = cqe->shampo.header_size;
19831982 struct sk_buff **skb = &rq->hw_gro_data->skb;
19841983 bool flush = cqe->shampo.flush;
19851984 bool match = cqe->shampo.match;
@@ -2011,9 +2010,16 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq · 25 unmodified lines
20112010 }
20122011
20132012 if (!*skb) {
2014− mlx5e_skb_from_cqe_shampo(rq, wi, cqe, header_index);
2013+ if (likely(head_size))
2014+ *skb = mlx5e_skb_from_cqe_shampo(rq, wi, cqe, header_index);
2015+ else
2016+ *skb = mlx5e_skb_from_cqe_mpwrq_nonlinear(rq, wi, cqe_bcnt, data_offset,
2017+ page_idx);
20152018 if (unlikely(!*skb))
20162019 goto free_hd_entry;
2020+
2021+ NAPI_GRO_CB(*skb)->count = 1;
2022+ skb_shinfo(*skb)->gso_size = cqe_bcnt - head_size;
20172023 } else {
20182024 NAPI_GRO_CB(*skb)->count++;
20192025 if (NAPI_GRO_CB(*skb)->count == 2 &&
@@ -2027,8 +2033,10 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq · 7 unmodified lines
20272033 }
20282034 }
20292035
2030− di = &wi->umr.dma_info[page_idx];
2031− mlx5e_fill_skb_data(*skb, rq, di, data_bcnt, data_offset);
2036+ if (likely(head_size)) {
2037+ di = &wi->umr.dma_info[page_idx];
2038+ mlx5e_fill_skb_data(*skb, rq, di, data_bcnt, data_offset);
2039+ }
20322040
20332041 mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb);
20342042 if (flush)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+14−1
@@ -1414,7 +1414,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, · 1413 unmodified lines
14141414 if (err)
14151415 goto err_out;
14161416
1417− if (!attr->chain && esw_attr->int_port) {
1417+ if (!attr->chain && esw_attr->int_port &&
1418+ attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
14181419 /* If decap route device is internal port, change the
14191420 * source vport value in reg_c0 back to uplink just in
14201421 * case the rule performs goto chain > 0. If we have a miss
@@ -3191,6 +3192,18 @@ actions_match_supported(struct mlx5e_priv *priv, · 1770 unmodified lines
31913192 return false;
31923193 }
31933194
3195+ if (!(~actions &
3196+ (MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | MLX5_FLOW_CONTEXT_ACTION_DROP))) {
3197+ NL_SET_ERR_MSG_MOD(extack, "Rule cannot support forward+drop action");
3198+ return false;
3199+ }
3200+
3201+ if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
3202+ actions & MLX5_FLOW_CONTEXT_ACTION_DROP) {
3203+ NL_SET_ERR_MSG_MOD(extack, "Drop with modify header action is not supported");
3204+ return false;
3205+ }
3206+
31943207 if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
31953208 !modify_header_match_supported(priv, &parse_attr->spec, flow_action,
31963209 actions, ct_flow, ct_clear, extack))
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+1−1
@@ -208,7 +208,7 @@ static inline void mlx5e_insert_vlan(void *start, struct sk_buff *skb, u16 ihs) · 207 unmodified lines
208208 int cpy1_sz = 2 * ETH_ALEN;
209209 int cpy2_sz = ihs - cpy1_sz;
210210
211− memcpy(vhdr, skb->data, cpy1_sz);
211+ memcpy(&vhdr->addrs, skb->data, cpy1_sz);
212212 vhdr->h_vlan_proto = skb->vlan_proto;
213213 vhdr->h_vlan_TCI = cpu_to_be16(skb_vlan_tag_get(skb));
214214 memcpy(&vhdr->h_vlan_encapsulated_proto, skb->data + cpy1_sz, cpy2_sz);
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c+4−0
@@ -1574,6 +1574,8 @@ struct mlx5_esw_bridge_offloads *mlx5_esw_bridge_init(struct mlx5_eswitch *esw) · 1573 unmodified lines
15741574 {
15751575 struct mlx5_esw_bridge_offloads *br_offloads;
15761576
1577+ ASSERT_RTNL();
1578+
15771579 br_offloads = kvzalloc(sizeof(*br_offloads), GFP_KERNEL);
15781580 if (!br_offloads)
15791581 return ERR_PTR(-ENOMEM);
@@ -1590,6 +1592,8 @@ void mlx5_esw_bridge_cleanup(struct mlx5_eswitch *esw) · 10 unmodified lines
15901592 {
15911593 struct mlx5_esw_bridge_offloads *br_offloads = esw->br_offloads;
15921594
1595+ ASSERT_RTNL();
1596+
15931597 if (!br_offloads)
15941598 return;
15951599
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h+1−1
@@ -21,7 +21,7 @@ DECLARE_EVENT_CLASS(mlx5_esw_bridge_fdb_template, · 20 unmodified lines
2121 __field(unsigned int, used)
2222 ),
2323 TP_fast_assign(
24− strncpy(__entry->dev_name,
24+ strscpy(__entry->dev_name,
2525 netdev_name(fdb->dev),
2626 IFNAMSIZ);
2727 memcpy(__entry->addr, fdb->key.addr, ETH_ALEN);
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c+1−1
@@ -132,7 +132,7 @@ static void mlx5_stop_sync_reset_poll(struct mlx5_core_dev *dev) · 131 unmodified lines
132132 {
133133 struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset;
134134
135− del_timer(&fw_reset->timer);
135+ del_timer_sync(&fw_reset->timer);
136136 }
137137
138138 static void mlx5_sync_reset_clear_reset_requested(struct mlx5_core_dev *dev, bool poll_health)
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c+5−4
@@ -121,12 +121,13 @@ u32 mlx5_chains_get_nf_ft_chain(struct mlx5_fs_chains *chains) · 120 unmodified lines
121121
122122 u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains)
123123 {
124− if (!mlx5_chains_prios_supported(chains))
125− return 1;
126−
127124 if (mlx5_chains_ignore_flow_level_supported(chains))
128125 return UINT_MAX;
129126
127+ if (!chains->dev->priv.eswitch ||
128+ chains->dev->priv.eswitch->mode != MLX5_ESWITCH_OFFLOADS)
129+ return 1;
130+
130131 /* We should get here only for eswitch case */
131132 return FDB_TC_MAX_PRIO;
132133 }
@@ -211,7 +212,7 @@ static int · 78 unmodified lines
211212 create_chain_restore(struct fs_chain *chain)
212213 {
213214 struct mlx5_eswitch *esw = chain->chains->dev->priv.eswitch;
214− char modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)];
215+ u8 modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
215216 struct mlx5_fs_chains *chains = chain->chains;
216217 enum mlx5e_tc_attr_to_reg chain_to_reg;
217218 struct mlx5_modify_hdr *mod_hdr;
drivers/net/ethernet/mellanox/mlx5/core/port.c+5−4
@@ -406,23 +406,24 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev, · 405 unmodified lines
406406
407407 switch (module_id) {
408408 case MLX5_MODULE_ID_SFP:
409− mlx5_sfp_eeprom_params_set(&query.i2c_address, &query.page, &query.offset);
409+ mlx5_sfp_eeprom_params_set(&query.i2c_address, &query.page, &offset);
410410 break;
411411 case MLX5_MODULE_ID_QSFP:
412412 case MLX5_MODULE_ID_QSFP_PLUS:
413413 case MLX5_MODULE_ID_QSFP28:
414− mlx5_qsfp_eeprom_params_set(&query.i2c_address, &query.page, &query.offset);
414+ mlx5_qsfp_eeprom_params_set(&query.i2c_address, &query.page, &offset);
415415 break;
416416 default:
417417 mlx5_core_err(dev, "Module ID not recognized: 0x%x\n", module_id);
418418 return -EINVAL;
419419 }
420420
421− if (query.offset + size > MLX5_EEPROM_PAGE_LENGTH)
421+ if (offset + size > MLX5_EEPROM_PAGE_LENGTH)
422422 /* Cross pages read, read until offset 256 in low page */
423− size -= offset + size - MLX5_EEPROM_PAGE_LENGTH;
423+ size = MLX5_EEPROM_PAGE_LENGTH - offset;
424424
425425 query.size = size;
426+ query.offset = offset;
426427
427428 return mlx5_query_mcia(dev, &query, data);
428429 }
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c+6−5
@@ -40,11 +40,12 @@ static int lan966x_mac_wait_for_completion(struct lan966x *lan966x) · 39 unmodified lines
4040 {
4141 u32 val;
4242
43− return readx_poll_timeout(lan966x_mac_get_status,
44− lan966x, val,
45− (ANA_MACACCESS_MAC_TABLE_CMD_GET(val)) ==
46− MACACCESS_CMD_IDLE,
47− TABLE_UPDATE_SLEEP_US, TABLE_UPDATE_TIMEOUT_US);
43+ return readx_poll_timeout_atomic(lan966x_mac_get_status,
44+ lan966x, val,
45+ (ANA_MACACCESS_MAC_TABLE_CMD_GET(val)) ==
46+ MACACCESS_CMD_IDLE,
47+ TABLE_UPDATE_SLEEP_US,
48+ TABLE_UPDATE_TIMEOUT_US);
4849 }
4950
5051 static void lan966x_mac_select(struct lan966x *lan966x,
drivers/net/ethernet/microchip/lan966x/lan966x_main.c+3−3
@@ -182,9 +182,9 @@ static int lan966x_port_inj_ready(struct lan966x *lan966x, u8 grp) · 181 unmodified lines
182182 {
183183 u32 val;
184184
185− return readx_poll_timeout(lan966x_port_inj_status, lan966x, val,
186− QS_INJ_STATUS_FIFO_RDY_GET(val) & BIT(grp),
187− READL_SLEEP_US, READL_TIMEOUT_US);
185+ return readx_poll_timeout_atomic(lan966x_port_inj_status, lan966x, val,
186+ QS_INJ_STATUS_FIFO_RDY_GET(val) & BIT(grp),
187+ READL_SLEEP_US, READL_TIMEOUT_US);
188188 }
189189
190190 static int lan966x_port_ifh_xmit(struct sk_buff *skb,
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c+1−1
@@ -1103,7 +1103,7 @@ void sparx5_get_stats64(struct net_device *ndev, · 1102 unmodified lines
11031103 stats->tx_carrier_errors = portstats[spx5_stats_tx_csense_cnt];
11041104 stats->tx_window_errors = portstats[spx5_stats_tx_late_coll_cnt];
11051105 stats->rx_dropped = portstats[spx5_stats_ana_ac_port_stat_lsb_cnt];
1106− for (idx = 0; idx < 2 * SPX5_PRIOS; ++idx, ++stats)
1106+ for (idx = 0; idx < 2 * SPX5_PRIOS; ++idx)
11071107 stats->rx_dropped += portstats[spx5_stats_green_p0_rx_port_drop
11081108 + idx];
11091109 stats->tx_dropped = portstats[spx5_stats_tx_local_drop];
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c+1−1
@@ -145,9 +145,9 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap) · 144 unmodified lines
145145 skb_put(skb, byte_cnt - ETH_FCS_LEN);
146146 eth_skb_pad(skb);
147147 skb->protocol = eth_type_trans(skb, netdev);
148− netif_rx(skb);
149148 netdev->stats.rx_bytes += skb->len;
150149 netdev->stats.rx_packets++;
150+ netif_rx(skb);
151151 }
152152
153153 static int sparx5_inject(struct sparx5 *sparx5,
drivers/net/ethernet/mscc/ocelot.c+20−5
@@ -549,14 +549,18 @@ EXPORT_SYMBOL(ocelot_vlan_add); · 548 unmodified lines
549549 int ocelot_vlan_del(struct ocelot *ocelot, int port, u16 vid)
550550 {
551551 struct ocelot_port *ocelot_port = ocelot->ports[port];
552+ bool del_pvid = false;
552553 int err;
553554
555+ if (ocelot_port->pvid_vlan && ocelot_port->pvid_vlan->vid == vid)
556+ del_pvid = true;
557+
554558 err = ocelot_vlan_member_del(ocelot, port, vid);
555559 if (err)
556560 return err;
557561
558562 /* Ingress */
559− if (ocelot_port->pvid_vlan && ocelot_port->pvid_vlan->vid == vid)
563+ if (del_pvid)
560564 ocelot_port_set_pvid(ocelot, port, NULL);
561565
562566 /* Egress */
@@ -1432,6 +1436,8 @@ static void · 869 unmodified lines
14321436 ocelot_populate_ipv4_ptp_event_trap_key(struct ocelot_vcap_filter *trap)
14331437 {
14341438 trap->key_type = OCELOT_VCAP_KEY_IPV4;
1439+ trap->key.ipv4.proto.value[0] = IPPROTO_UDP;
1440+ trap->key.ipv4.proto.mask[0] = 0xff;
14351441 trap->key.ipv4.dport.value = PTP_EV_PORT;
14361442 trap->key.ipv4.dport.mask = 0xffff;
14371443 }
@@ -1440,6 +1446,8 @@ static void · 2 unmodified lines
14401446 ocelot_populate_ipv6_ptp_event_trap_key(struct ocelot_vcap_filter *trap)
14411447 {
14421448 trap->key_type = OCELOT_VCAP_KEY_IPV6;
1449+ trap->key.ipv4.proto.value[0] = IPPROTO_UDP;
1450+ trap->key.ipv4.proto.mask[0] = 0xff;
14431451 trap->key.ipv6.dport.value = PTP_EV_PORT;
14441452 trap->key.ipv6.dport.mask = 0xffff;
14451453 }
@@ -1448,6 +1456,8 @@ static void · 2 unmodified lines
14481456 ocelot_populate_ipv4_ptp_general_trap_key(struct ocelot_vcap_filter *trap)
14491457 {
14501458 trap->key_type = OCELOT_VCAP_KEY_IPV4;
1459+ trap->key.ipv4.proto.value[0] = IPPROTO_UDP;
1460+ trap->key.ipv4.proto.mask[0] = 0xff;
14511461 trap->key.ipv4.dport.value = PTP_GEN_PORT;
14521462 trap->key.ipv4.dport.mask = 0xffff;
14531463 }
@@ -1456,6 +1466,8 @@ static void · 2 unmodified lines
14561466 ocelot_populate_ipv6_ptp_general_trap_key(struct ocelot_vcap_filter *trap)
14571467 {
14581468 trap->key_type = OCELOT_VCAP_KEY_IPV6;
1469+ trap->key.ipv4.proto.value[0] = IPPROTO_UDP;
1470+ trap->key.ipv4.proto.mask[0] = 0xff;
14591471 trap->key.ipv6.dport.value = PTP_GEN_PORT;
14601472 trap->key.ipv6.dport.mask = 0xffff;
14611473 }
@@ -1737,12 +1749,11 @@ void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data) · 275 unmodified lines
17371749 }
17381750 EXPORT_SYMBOL(ocelot_get_strings);
17391751
1752+/* Caller must hold &ocelot->stats_lock */
17401753 static void ocelot_update_stats(struct ocelot *ocelot)
17411754 {
17421755 int i, j;
17431756
1744− mutex_lock(&ocelot->stats_lock);
1745−
17461757 for (i = 0; i < ocelot->num_phys_ports; i++) {
17471758 /* Configure the port to read the stats from */
17481759 ocelot_write(ocelot, SYS_STAT_CFG_STAT_VIEW(i), SYS_STAT_CFG);
@@ -1761,8 +1772,6 @@ static void ocelot_update_stats(struct ocelot *ocelot) · 12 unmodified lines
17611772 ~(u64)U32_MAX) + val;
17621773 }
17631774 }
1764−
1765− mutex_unlock(&ocelot->stats_lock);
17661775 }
17671776
17681777 static void ocelot_check_stats_work(struct work_struct *work)
@@ -1771,7 +1780,9 @@ static void ocelot_check_stats_work(struct work_struct *work) · 2 unmodified lines
17711780 struct ocelot *ocelot = container_of(del_work, struct ocelot,
17721781 stats_work);
17731782
1783+ mutex_lock(&ocelot->stats_lock);
17741784 ocelot_update_stats(ocelot);
1785+ mutex_unlock(&ocelot->stats_lock);
17751786
17761787 queue_delayed_work(ocelot->stats_queue, &ocelot->stats_work,
17771788 OCELOT_STATS_CHECK_DELAY);
@@ -1781,12 +1792,16 @@ void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data) · 3 unmodified lines
17811792 {
17821793 int i;
17831794
1795+ mutex_lock(&ocelot->stats_lock);
1796+
17841797 /* check and update now */
17851798 ocelot_update_stats(ocelot);
17861799
17871800 /* Copy all counters */
17881801 for (i = 0; i < ocelot->num_stats; i++)
17891802 *data++ = ocelot->stats[port * ocelot->num_stats + i];
1803+
1804+ mutex_unlock(&ocelot->stats_lock);
17901805 }
17911806 EXPORT_SYMBOL(ocelot_get_ethtool_stats);
17921807
drivers/net/ethernet/netronome/nfp/flower/cmsg.h+2−0
@@ -723,6 +723,8 @@ static inline bool nfp_fl_is_netdev_to_offload(struct net_device *netdev) · 722 unmodified lines
723723 return true;
724724 if (netif_is_gretap(netdev))
725725 return true;
726+ if (netif_is_ip6gretap(netdev))
727+ return true;
726728
727729 return false;
728730 }
drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c+8−4
@@ -1011,6 +1011,7 @@ nfp_tunnel_del_shared_mac(struct nfp_app *app, struct net_device *netdev, · 1010 unmodified lines
10111011 struct nfp_flower_repr_priv *repr_priv;
10121012 struct nfp_tun_offloaded_mac *entry;
10131013 struct nfp_repr *repr;
1014+ u16 nfp_mac_idx;
10141015 int ida_idx;
10151016
10161017 entry = nfp_tunnel_lookup_offloaded_macs(app, mac);
@@ -1029,8 +1030,6 @@ nfp_tunnel_del_shared_mac(struct nfp_app *app, struct net_device *netdev, · 12 unmodified lines
10291030 entry->bridge_count--;
10301031
10311032 if (!entry->bridge_count && entry->ref_count) {
1032− u16 nfp_mac_idx;
1033−
10341033 nfp_mac_idx = entry->index & ~NFP_TUN_PRE_TUN_IDX_BIT;
10351034 if (__nfp_tunnel_offload_mac(app, mac, nfp_mac_idx,
10361035 false)) {
@@ -1046,7 +1045,6 @@ nfp_tunnel_del_shared_mac(struct nfp_app *app, struct net_device *netdev, · 9 unmodified lines
10461045
10471046 /* If MAC is now used by 1 repr set the offloaded MAC index to port. */
10481047 if (entry->ref_count == 1 && list_is_singular(&entry->repr_list)) {
1049− u16 nfp_mac_idx;
10501048 int port, err;
10511049
10521050 repr_priv = list_first_entry(&entry->repr_list,
@@ -1074,8 +1072,14 @@ nfp_tunnel_del_shared_mac(struct nfp_app *app, struct net_device *netdev, · 21 unmodified lines
10741072 WARN_ON_ONCE(rhashtable_remove_fast(&priv->tun.offloaded_macs,
10751073 &entry->ht_node,
10761074 offloaded_macs_params));
1075+
1076+ if (nfp_flower_is_supported_bridge(netdev))
1077+ nfp_mac_idx = entry->index & ~NFP_TUN_PRE_TUN_IDX_BIT;
1078+ else
1079+ nfp_mac_idx = entry->index;
1080+
10771081 /* If MAC has global ID then extract and free the ida entry. */
1078− if (nfp_tunnel_is_mac_idx_global(entry->index)) {
1082+ if (nfp_tunnel_is_mac_idx_global(nfp_mac_idx)) {
10791083 ida_idx = nfp_tunnel_get_ida_from_global_mac_idx(entry->index);
10801084 ida_simple_remove(&priv->tun.mac_off_ids, ida_idx);
10811085 }
drivers/net/ethernet/seeq/ether3.c+3−1
@@ -749,6 +749,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) · 748 unmodified lines
749749 const struct ether3_data *data = id->data;
750750 struct net_device *dev;
751751 int bus_type, ret;
752+ u8 addr[ETH_ALEN];
752753
753754 ether3_banner();
754755
@@ -776,7 +777,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) · 21 unmodified lines
776777 priv(dev)->seeq = priv(dev)->base + data->base_offset;
777778 dev->irq = ec->irq;
778779
779− ether3_addr(dev->dev_addr, ec);
780+ ether3_addr(addr, ec);
781+ eth_hw_addr_set(dev, addr);
780782
781783 priv(dev)->dev = dev;
782784 timer_setup(&priv(dev)->timer, ether3_ledoff, 0);
drivers/net/ethernet/smsc/smc911x.c+4−4
@@ -1648,7 +1648,7 @@ static int smc911x_ethtool_geteeprom(struct net_device *dev, · 1647 unmodified lines
16481648 return ret;
16491649 if ((ret=smc911x_ethtool_read_eeprom_byte(dev, &eebuf[i]))!=0)
16501650 return ret;
1651− }
1651+ }
16521652 memcpy(data, eebuf+eeprom->offset, eeprom->len);
16531653 return 0;
16541654 }
@@ -1667,11 +1667,11 @@ static int smc911x_ethtool_seteeprom(struct net_device *dev, · 12 unmodified lines
16671667 return ret;
16681668 /* write byte */
16691669 if ((ret=smc911x_ethtool_write_eeprom_byte(dev, *data))!=0)
1670− return ret;
1670+ return ret;
16711671 if ((ret=smc911x_ethtool_write_eeprom_cmd(dev, E2P_CMD_EPC_CMD_WRITE_, i ))!=0)
16721672 return ret;
1673− }
1674− return 0;
1673+ }
1674+ return 0;
16751675 }
16761676
16771677 static int smc911x_ethtool_geteeprom_len(struct net_device *dev)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c+1−1
@@ -756,7 +756,7 @@ static int sun8i_dwmac_reset(struct stmmac_priv *priv) · 755 unmodified lines
756756
757757 if (err) {
758758 dev_err(priv->device, "EMAC reset timeout\n");
759− return -EFAULT;
759+ return err;
760760 }
761761 return 0;
762762 }
drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c+33−18
@@ -22,21 +22,21 @@ · 21 unmodified lines
2222 #define ETHER_CLK_SEL_RMII_CLK_EN BIT(2)
2323 #define ETHER_CLK_SEL_RMII_CLK_RST BIT(3)
2424 #define ETHER_CLK_SEL_DIV_SEL_2 BIT(4)
25−#define ETHER_CLK_SEL_DIV_SEL_20 BIT(0)
25+#define ETHER_CLK_SEL_DIV_SEL_20 0
2626 #define ETHER_CLK_SEL_FREQ_SEL_125M (BIT(9) | BIT(8))
2727 #define ETHER_CLK_SEL_FREQ_SEL_50M BIT(9)
2828 #define ETHER_CLK_SEL_FREQ_SEL_25M BIT(8)
2929 #define ETHER_CLK_SEL_FREQ_SEL_2P5M 0
30−#define ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN BIT(0)
30+#define ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN 0
3131 #define ETHER_CLK_SEL_TX_CLK_EXT_SEL_TXC BIT(10)
3232 #define ETHER_CLK_SEL_TX_CLK_EXT_SEL_DIV BIT(11)
33−#define ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN BIT(0)
33+#define ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN 0
3434 #define ETHER_CLK_SEL_RX_CLK_EXT_SEL_RXC BIT(12)
3535 #define ETHER_CLK_SEL_RX_CLK_EXT_SEL_DIV BIT(13)
36−#define ETHER_CLK_SEL_TX_CLK_O_TX_I BIT(0)
36+#define ETHER_CLK_SEL_TX_CLK_O_TX_I 0
3737 #define ETHER_CLK_SEL_TX_CLK_O_RMII_I BIT(14)
3838 #define ETHER_CLK_SEL_TX_O_E_N_IN BIT(15)
39−#define ETHER_CLK_SEL_RMII_CLK_SEL_IN BIT(0)
39+#define ETHER_CLK_SEL_RMII_CLK_SEL_IN 0
4040 #define ETHER_CLK_SEL_RMII_CLK_SEL_RX_C BIT(16)
4141
4242 #define ETHER_CLK_SEL_RX_TX_CLK_EN (ETHER_CLK_SEL_RX_CLK_EN | ETHER_CLK_SEL_TX_CLK_EN)
@@ -49,13 +49,15 @@ struct visconti_eth { · 6 unmodified lines
4949 void __iomem *reg;
5050 u32 phy_intf_sel;
5151 struct clk *phy_ref_clk;
52+ struct device *dev;
5253 spinlock_t lock; /* lock to protect register update */
5354 };
5455
5556 static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
5657 {
5758 struct visconti_eth *dwmac = priv;
58− unsigned int val, clk_sel_val;
59+ struct net_device *netdev = dev_get_drvdata(dwmac->dev);
60+ unsigned int val, clk_sel_val = 0;
5961 unsigned long flags;
6062
6163 spin_lock_irqsave(&dwmac->lock, flags);
@@ -85,7 +87,9 @@ static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed) · 23 unmodified lines
8587 break;
8688 default:
8789 /* No bit control */
88− break;
90+ netdev_err(netdev, "Unsupported speed request (%d)", speed);
91+ spin_unlock_irqrestore(&dwmac->lock, flags);
92+ return;
8993 }
9094
9195 writel(val, dwmac->reg + MAC_CTRL_REG);
@@ -96,31 +100,41 @@ static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed) · 4 unmodified lines
96100 val |= ETHER_CLK_SEL_TX_O_E_N_IN;
97101 writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
98102
103+ /* Set Clock-Mux, Start clock, Set TX_O direction */
99104 switch (dwmac->phy_intf_sel) {
100105 case ETHER_CONFIG_INTF_RGMII:
101106 val = clk_sel_val | ETHER_CLK_SEL_RX_CLK_EXT_SEL_RXC;
107+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
108+
109+ val |= ETHER_CLK_SEL_RX_TX_CLK_EN;
110+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
111+
112+ val &= ~ETHER_CLK_SEL_TX_O_E_N_IN;
113+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
102114 break;
103115 case ETHER_CONFIG_INTF_RMII:
104116 val = clk_sel_val | ETHER_CLK_SEL_RX_CLK_EXT_SEL_DIV |
105− ETHER_CLK_SEL_TX_CLK_EXT_SEL_TXC | ETHER_CLK_SEL_TX_O_E_N_IN |
117+ ETHER_CLK_SEL_TX_CLK_EXT_SEL_DIV | ETHER_CLK_SEL_TX_O_E_N_IN |
106118 ETHER_CLK_SEL_RMII_CLK_SEL_RX_C;
119+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
120+
121+ val |= ETHER_CLK_SEL_RMII_CLK_RST;
122+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
123+
124+ val |= ETHER_CLK_SEL_RMII_CLK_EN | ETHER_CLK_SEL_RX_TX_CLK_EN;
125+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
107126 break;
108127 case ETHER_CONFIG_INTF_MII:
109128 default:
110129 val = clk_sel_val | ETHER_CLK_SEL_RX_CLK_EXT_SEL_RXC |
111− ETHER_CLK_SEL_TX_CLK_EXT_SEL_DIV | ETHER_CLK_SEL_TX_O_E_N_IN |
112− ETHER_CLK_SEL_RMII_CLK_EN;
130+ ETHER_CLK_SEL_TX_CLK_EXT_SEL_TXC | ETHER_CLK_SEL_TX_O_E_N_IN;
131+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
132+
133+ val |= ETHER_CLK_SEL_RX_TX_CLK_EN;
134+ writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
113135 break;
114136 }
115137
116− /* Start clock */
117− writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
118− val |= ETHER_CLK_SEL_RX_TX_CLK_EN;
119− writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
120−
121− val &= ~ETHER_CLK_SEL_TX_O_E_N_IN;
122− writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
123−
124138 spin_unlock_irqrestore(&dwmac->lock, flags);
125139 }
126140
@@ -219,6 +233,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev) · 92 unmodified lines
219233
220234 spin_lock_init(&dwmac->lock);
221235 dwmac->reg = stmmac_res.addr;
236+ dwmac->dev = &pdev->dev;
222237 plat_dat->bsp_priv = dwmac;
223238 plat_dat->fix_mac_speed = visconti_eth_fix_mac_speed;
224239
drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h+1−0
@@ -150,6 +150,7 @@ · 149 unmodified lines
150150
151151 #define NUM_DWMAC100_DMA_REGS 9
152152 #define NUM_DWMAC1000_DMA_REGS 23
153+#define NUM_DWMAC4_DMA_REGS 27
153154
154155 void dwmac_enable_dma_transmission(void __iomem *ioaddr);
155156 void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan, bool rx, bool tx);
drivers/net/ethernet/stmicro/stmmac/stmmac.h+0−2
@@ -194,7 +194,6 @@ struct stmmac_priv { · 193 unmodified lines
194194 u32 tx_coal_timer[MTL_MAX_TX_QUEUES];
195195 u32 rx_coal_frames[MTL_MAX_TX_QUEUES];
196196
197− int tx_coalesce;
198197 int hwts_tx_en;
199198 bool tx_path_in_lpi_mode;
200199 bool tso;
@@ -229,7 +228,6 @@ struct stmmac_priv { · 28 unmodified lines
229228 unsigned int flow_ctrl;
230229 unsigned int pause;
231230 struct mii_bus *mii;
232− int mii_irq[PHY_MAX_ADDR];
233231
234232 struct phylink_config phylink_config;
235233 struct phylink *phylink;
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c+17−2
@@ -21,10 +21,18 @@ · 20 unmodified lines
2121 #include "dwxgmac2.h"
2222
2323 #define REG_SPACE_SIZE 0x1060
24+#define GMAC4_REG_SPACE_SIZE 0x116C
2425 #define MAC100_ETHTOOL_NAME "st_mac100"
2526 #define GMAC_ETHTOOL_NAME "st_gmac"
2627 #define XGMAC_ETHTOOL_NAME "st_xgmac"
2728
29+/* Same as DMA_CHAN_BASE_ADDR defined in dwmac4_dma.h
30+ *
31+ * It is here because dwmac_dma.h and dwmac4_dam.h can not be included at the
32+ * same time due to the conflicting macro names.
33+ */
34+#define GMAC4_DMA_CHAN_BASE_ADDR 0x00001100
35+
2836 #define ETHTOOL_DMA_OFFSET 55
2937
3038 struct stmmac_stats {
@@ -434,6 +442,8 @@ static int stmmac_ethtool_get_regs_len(struct net_device *dev) · 403 unmodified lines
434442
435443 if (priv->plat->has_xgmac)
436444 return XGMAC_REGSIZE * 4;
445+ else if (priv->plat->has_gmac4)
446+ return GMAC4_REG_SPACE_SIZE;
437447 return REG_SPACE_SIZE;
438448 }
439449
@@ -446,8 +456,13 @@ static void stmmac_ethtool_gregs(struct net_device *dev, · 6 unmodified lines
446456 stmmac_dump_mac_regs(priv, priv->hw, reg_space);
447457 stmmac_dump_dma_regs(priv, priv->ioaddr, reg_space);
448458
449− if (!priv->plat->has_xgmac) {
450− /* Copy DMA registers to where ethtool expects them */
459+ /* Copy DMA registers to where ethtool expects them */
460+ if (priv->plat->has_gmac4) {
461+ /* GMAC4 dumps its DMA registers at its DMA_CHAN_BASE_ADDR */
462+ memcpy(&reg_space[ETHTOOL_DMA_OFFSET],
463+ &reg_space[GMAC4_DMA_CHAN_BASE_ADDR / 4],
464+ NUM_DWMAC4_DMA_REGS * 4);
465+ } else if (!priv->plat->has_xgmac) {
451466 memcpy(&reg_space[ETHTOOL_DMA_OFFSET],
452467 &reg_space[DMA_BUS_MODE / 4],
453468 NUM_DWMAC1000_DMA_REGS * 4);
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c+12−7
@@ -145,15 +145,20 @@ static int adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec, · 144 unmodified lines
145145
146146 static void get_systime(void __iomem *ioaddr, u64 *systime)
147147 {
148− u64 ns;
149−
150− /* Get the TSSS value */
151− ns = readl(ioaddr + PTP_STNSR);
152− /* Get the TSS and convert sec time value to nanosecond */
153− ns += readl(ioaddr + PTP_STSR) * 1000000000ULL;
148+ u64 ns, sec0, sec1;
149+
150+ /* Get the TSS value */
151+ sec1 = readl_relaxed(ioaddr + PTP_STSR);
152+ do {
153+ sec0 = sec1;
154+ /* Get the TSSS value */
155+ ns = readl_relaxed(ioaddr + PTP_STNSR);
156+ /* Get the TSS value */
157+ sec1 = readl_relaxed(ioaddr + PTP_STSR);
158+ } while (sec0 != sec1);
154159
155160 if (systime)
156− *systime = ns;
161+ *systime = ns + (sec1 * 1000000000ULL);
157162 }
158163
159164 static void get_ptptime(void __iomem *ptpaddr, u64 *ptp_time)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+23−19
@@ -402,7 +402,7 @@ static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en) · 401 unmodified lines
402402 * Description: this function is to verify and enter in LPI mode in case of
403403 * EEE.
404404 */
405−static void stmmac_enable_eee_mode(struct stmmac_priv *priv)
405+static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
406406 {
407407 u32 tx_cnt = priv->plat->tx_queues_to_use;
408408 u32 queue;
@@ -412,13 +412,14 @@ static void stmmac_enable_eee_mode(struct stmmac_priv *priv) · 3 unmodified lines
412412 struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
413413
414414 if (tx_q->dirty_tx != tx_q->cur_tx)
415− return; /* still unfinished work */
415+ return -EBUSY; /* still unfinished work */
416416 }
417417
418418 /* Check and enter in LPI mode */
419419 if (!priv->tx_path_in_lpi_mode)
420420 stmmac_set_eee_mode(priv, priv->hw,
421421 priv->plat->en_tx_lpi_clockgating);
422+ return 0;
422423 }
423424
424425 /**
@@ -450,8 +451,8 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t) · 25 unmodified lines
450451 {
451452 struct stmmac_priv *priv = from_timer(priv, t, eee_ctrl_timer);
452453
453− stmmac_enable_eee_mode(priv);
454− mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
454+ if (stmmac_enable_eee_mode(priv))
455+ mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
455456 }
456457
457458 /**
@@ -889,6 +890,9 @@ static int stmmac_init_ptp(struct stmmac_priv *priv) · 431 unmodified lines
889890 bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
890891 int ret;
891892
893+ if (priv->plat->ptp_clk_freq_config)
894+ priv->plat->ptp_clk_freq_config(priv);
895+
892896 ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE);
893897 if (ret)
894898 return ret;
@@ -911,8 +915,6 @@ static int stmmac_init_ptp(struct stmmac_priv *priv) · 16 unmodified lines
911915 priv->hwts_tx_en = 0;
912916 priv->hwts_rx_en = 0;
913917
914− stmmac_ptp_register(priv);
915−
916918 return 0;
917919 }
918920
@@ -2647,8 +2649,8 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue) · 1728 unmodified lines
26472649
26482650 if (priv->eee_enabled && !priv->tx_path_in_lpi_mode &&
26492651 priv->eee_sw_timer_en) {
2650− stmmac_enable_eee_mode(priv);
2651− mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
2652+ if (stmmac_enable_eee_mode(priv))
2653+ mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
26522654 }
26532655
26542656 /* We still have pending packets, let's call for a new scheduling */
@@ -3238,7 +3240,7 @@ static int stmmac_fpe_start_wq(struct stmmac_priv *priv) · 583 unmodified lines
32383240 /**
32393241 * stmmac_hw_setup - setup mac in a usable state.
32403242 * @dev : pointer to the device structure.
3241− * @init_ptp: initialize PTP if set
3243+ * @ptp_register: register PTP if set
32423244 * Description:
32433245 * this is the main function to setup the HW in a usable state because the
32443246 * dma engine is reset, the core registers are configured (e.g. AXI,
@@ -3248,7 +3250,7 @@ static int stmmac_fpe_start_wq(struct stmmac_priv *priv) · 3 unmodified lines
32483250 * 0 on success and an appropriate (-)ve integer as defined in errno.h
32493251 * file on failure.
32503252 */
3251−static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
3253+static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
32523254 {
32533255 struct stmmac_priv *priv = netdev_priv(dev);
32543256 u32 rx_cnt = priv->plat->rx_queues_to_use;
@@ -3305,13 +3307,13 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp) · 50 unmodified lines
33053307
33063308 stmmac_mmc_setup(priv);
33073309
3308− if (init_ptp) {
3309− ret = stmmac_init_ptp(priv);
3310− if (ret == -EOPNOTSUPP)
3311− netdev_warn(priv->dev, "PTP not supported by HW\n");
3312− else if (ret)
3313− netdev_warn(priv->dev, "PTP init failed\n");
3314− }
3310+ ret = stmmac_init_ptp(priv);
3311+ if (ret == -EOPNOTSUPP)
3312+ netdev_warn(priv->dev, "PTP not supported by HW\n");
3313+ else if (ret)
3314+ netdev_warn(priv->dev, "PTP init failed\n");
3315+ else if (ptp_register)
3316+ stmmac_ptp_register(priv);
33153317
33163318 priv->eee_tw_timer = STMMAC_DEFAULT_TWT_LS;
33173319
@@ -7250,6 +7252,10 @@ int stmmac_dvr_remove(struct device *dev) · 3932 unmodified lines
72507252
72517253 netdev_info(priv->dev, "%s: removing driver", __func__);
72527254
7255+ pm_runtime_get_sync(dev);
7256+ pm_runtime_disable(dev);
7257+ pm_runtime_put_noidle(dev);
7258+
72537259 stmmac_stop_all_dma(priv);
72547260 stmmac_mac_set(priv, priv->ioaddr, false);
72557261 netif_carrier_off(ndev);
@@ -7268,8 +7274,6 @@ int stmmac_dvr_remove(struct device *dev) · 12 unmodified lines
72687274 if (priv->plat->stmmac_rst)
72697275 reset_control_assert(priv->plat->stmmac_rst);
72707276 reset_control_assert(priv->plat->stmmac_ahb_rst);
7271− pm_runtime_put(dev);
7272− pm_runtime_disable(dev);
72737277 if (priv->hw->pcs != STMMAC_PCS_TBI &&
72747278 priv->hw->pcs != STMMAC_PCS_RTBI)
72757279 stmmac_mdio_unregister(ndev);
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c+0−3
@@ -297,9 +297,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv) · 296 unmodified lines
297297 {
298298 int i;
299299
300− if (priv->plat->ptp_clk_freq_config)
301− priv->plat->ptp_clk_freq_config(priv);
302−
303300 for (i = 0; i < priv->dma_cap.pps_out_num; i++) {
304301 if (i >= STMMAC_PPS_MAX)
305302 break;
drivers/net/ethernet/ti/cpsw_priv.c+1−1
@@ -1146,7 +1146,7 @@ int cpsw_fill_rx_channels(struct cpsw_priv *priv) · 1145 unmodified lines
11461146 static struct page_pool *cpsw_create_page_pool(struct cpsw_common *cpsw,
11471147 int size)
11481148 {
1149− struct page_pool_params pp_params;
1149+ struct page_pool_params pp_params = {};
11501150 struct page_pool *pool;
11511151
11521152 pp_params.order = 0;
drivers/net/ethernet/tundra/tsi108_eth.c+18−17
@@ -1091,20 +1091,22 @@ static int tsi108_get_mac(struct net_device *dev) · 1090 unmodified lines
10911091 struct tsi108_prv_data *data = netdev_priv(dev);
10921092 u32 word1 = TSI_READ(TSI108_MAC_ADDR1);
10931093 u32 word2 = TSI_READ(TSI108_MAC_ADDR2);
1094+ u8 addr[ETH_ALEN];
10941095
10951096 /* Note that the octets are reversed from what the manual says,
10961097 * producing an even weirder ordering...
10971098 */
10981099 if (word2 == 0 && word1 == 0) {
1099− dev->dev_addr[0] = 0x00;
1100− dev->dev_addr[1] = 0x06;
1101− dev->dev_addr[2] = 0xd2;
1102− dev->dev_addr[3] = 0x00;
1103− dev->dev_addr[4] = 0x00;
1100+ addr[0] = 0x00;
1101+ addr[1] = 0x06;
1102+ addr[2] = 0xd2;
1103+ addr[3] = 0x00;
1104+ addr[4] = 0x00;
11041105 if (0x8 == data->phy)
1105− dev->dev_addr[5] = 0x01;
1106+ addr[5] = 0x01;
11061107 else
1107− dev->dev_addr[5] = 0x02;
1108+ addr[5] = 0x02;
1109+ eth_hw_addr_set(dev, addr);
11081110
11091111 word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24);
11101112
@@ -1114,12 +1116,13 @@ static int tsi108_get_mac(struct net_device *dev) · 3 unmodified lines
11141116 TSI_WRITE(TSI108_MAC_ADDR1, word1);
11151117 TSI_WRITE(TSI108_MAC_ADDR2, word2);
11161118 } else {
1117− dev->dev_addr[0] = (word2 >> 16) & 0xff;
1118− dev->dev_addr[1] = (word2 >> 24) & 0xff;
1119− dev->dev_addr[2] = (word1 >> 0) & 0xff;
1120− dev->dev_addr[3] = (word1 >> 8) & 0xff;
1121− dev->dev_addr[4] = (word1 >> 16) & 0xff;
1122− dev->dev_addr[5] = (word1 >> 24) & 0xff;
1119+ addr[0] = (word2 >> 16) & 0xff;
1120+ addr[1] = (word2 >> 24) & 0xff;
1121+ addr[2] = (word1 >> 0) & 0xff;
1122+ addr[3] = (word1 >> 8) & 0xff;
1123+ addr[4] = (word1 >> 16) & 0xff;
1124+ addr[5] = (word1 >> 24) & 0xff;
1125+ eth_hw_addr_set(dev, addr);
11231126 }
11241127
11251128 if (!is_valid_ether_addr(dev->dev_addr)) {
@@ -1136,14 +1139,12 @@ static int tsi108_set_mac(struct net_device *dev, void *addr) · 10 unmodified lines
11361139 {
11371140 struct tsi108_prv_data *data = netdev_priv(dev);
11381141 u32 word1, word2;
1139− int i;
11401142
11411143 if (!is_valid_ether_addr(addr))
11421144 return -EADDRNOTAVAIL;
11431145
1144− for (i = 0; i < 6; i++)
1145− /* +2 is for the offset of the HW addr type */
1146− dev->dev_addr[i] = ((unsigned char *)addr)[i + 2];
1146+ /* +2 is for the offset of the HW addr type */
1147+ eth_hw_addr_set(dev, ((unsigned char *)addr) + 2);
11471148
11481149 word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24);
11491150
drivers/net/hamradio/yam.c+1−3
@@ -950,9 +950,7 @@ static int yam_siocdevprivate(struct net_device *dev, struct ifreq *ifr, void __ · 949 unmodified lines
950950 ym = memdup_user(data, sizeof(struct yamdrv_ioctl_mcs));
951951 if (IS_ERR(ym))
952952 return PTR_ERR(ym);
953− if (ym->cmd != SIOCYAMSMCS)
954− return -EINVAL;
955− if (ym->bitrate > YAM_MAXBITRATE) {
953+ if (ym->cmd != SIOCYAMSMCS || ym->bitrate > YAM_MAXBITRATE) {
956954 kfree(ym);
957955 return -EINVAL;
958956 }
drivers/net/ieee802154/at86rf230.c+11−2
@@ -100,6 +100,7 @@ struct at86rf230_local { · 99 unmodified lines
100100 unsigned long cal_timeout;
101101 bool is_tx;
102102 bool is_tx_from_off;
103+ bool was_tx;
103104 u8 tx_retry;
104105 struct sk_buff *tx_skb;
105106 struct at86rf230_state_change tx;
@@ -343,7 +344,11 @@ at86rf230_async_error_recover_complete(void *context) · 237 unmodified lines
343344 if (ctx->free)
344345 kfree(ctx);
345346
346− ieee802154_wake_queue(lp->hw);
347+ if (lp->was_tx) {
348+ lp->was_tx = 0;
349+ dev_kfree_skb_any(lp->tx_skb);
350+ ieee802154_wake_queue(lp->hw);
351+ }
347352 }
348353
349354 static void
@@ -352,7 +357,11 @@ at86rf230_async_error_recover(void *context) · 2 unmodified lines
352357 struct at86rf230_state_change *ctx = context;
353358 struct at86rf230_local *lp = ctx->lp;
354359
355− lp->is_tx = 0;
360+ if (lp->is_tx) {
361+ lp->was_tx = 1;
362+ lp->is_tx = 0;
363+ }
364+
356365 at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON,
357366 at86rf230_async_error_recover_complete);
358367 }
drivers/net/ieee802154/ca8210.c+3−2
@@ -1771,6 +1771,7 @@ static int ca8210_async_xmit_complete( · 1770 unmodified lines
17711771 status
17721772 );
17731773 if (status != MAC_TRANSACTION_OVERFLOW) {
1774+ dev_kfree_skb_any(priv->tx_skb);
17741775 ieee802154_wake_queue(priv->hw);
17751776 return 0;
17761777 }
@@ -2974,8 +2975,8 @@ static void ca8210_hw_setup(struct ieee802154_hw *ca8210_hw) · 1197 unmodified lines
29742975 ca8210_hw->phy->cca.opt = NL802154_CCA_OPT_ENERGY_CARRIER_AND;
29752976 ca8210_hw->phy->cca_ed_level = -9800;
29762977 ca8210_hw->phy->symbol_duration = 16;
2977− ca8210_hw->phy->lifs_period = 40;
2978− ca8210_hw->phy->sifs_period = 12;
2978+ ca8210_hw->phy->lifs_period = 40 * ca8210_hw->phy->symbol_duration;
2979+ ca8210_hw->phy->sifs_period = 12 * ca8210_hw->phy->symbol_duration;
29792980 ca8210_hw->flags =
29802981 IEEE802154_HW_AFILT |
29812982 IEEE802154_HW_OMIT_CKSUM |
drivers/net/ieee802154/mac802154_hwsim.c+1−0
@@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev, · 785 unmodified lines
786786 goto err_pib;
787787 }
788788
789+ pib->channel = 13;
789790 rcu_assign_pointer(phy->pib, pib);
790791 phy->idx = idx;
791792 INIT_LIST_HEAD(&phy->edges);
drivers/net/ieee802154/mcr20a.c+2−2
@@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp) · 975 unmodified lines
976976 dev_dbg(printdev(lp), "%s\n", __func__);
977977
978978 phy->symbol_duration = 16;
979− phy->lifs_period = 40;
980− phy->sifs_period = 12;
979+ phy->lifs_period = 40 * phy->symbol_duration;
980+ phy->sifs_period = 12 * phy->symbol_duration;
981981
982982 hw->flags = IEEE802154_HW_TX_OMIT_CKSUM |
983983 IEEE802154_HW_AFILT |
drivers/net/ipa/ipa_power.c+52−0
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 #include <linux/pm_runtime.h>
1212 #include <linux/bitops.h>
1313
14+#include "linux/soc/qcom/qcom_aoss.h"
15+
1416 #include "ipa.h"
1517 #include "ipa_power.h"
1618 #include "ipa_endpoint.h"
@@ -64,6 +66,7 @@ enum ipa_power_flag { · 47 unmodified lines
6466 * struct ipa_power - IPA power management information
6567 * @dev: IPA device pointer
6668 * @core: IPA core clock
69+ * @qmp: QMP handle for AOSS communication
6770 * @spinlock: Protects modem TX queue enable/disable
6871 * @flags: Boolean state flags
6972 * @interconnect_count: Number of elements in interconnect[]
@@ -72,6 +75,7 @@ enum ipa_power_flag { · 2 unmodified lines
7275 struct ipa_power {
7376 struct device *dev;
7477 struct clk *core;
78+ struct qmp *qmp;
7579 spinlock_t spinlock; /* used with STOPPED/STARTED power flags */
7680 DECLARE_BITMAP(flags, IPA_POWER_FLAG_COUNT);
7781 u32 interconnect_count;
@@ -382,6 +386,47 @@ void ipa_power_modem_queue_active(struct ipa *ipa) · 304 unmodified lines
382386 clear_bit(IPA_POWER_FLAG_STARTED, ipa->power->flags);
383387 }
384388
389+static int ipa_power_retention_init(struct ipa_power *power)
390+{
391+ struct qmp *qmp = qmp_get(power->dev);
392+
393+ if (IS_ERR(qmp)) {
394+ if (PTR_ERR(qmp) == -EPROBE_DEFER)
395+ return -EPROBE_DEFER;
396+
397+ /* We assume any other error means it's not defined/needed */
398+ qmp = NULL;
399+ }
400+ power->qmp = qmp;
401+
402+ return 0;
403+}
404+
405+static void ipa_power_retention_exit(struct ipa_power *power)
406+{
407+ qmp_put(power->qmp);
408+ power->qmp = NULL;
409+}
410+
411+/* Control register retention on power collapse */
412+void ipa_power_retention(struct ipa *ipa, bool enable)
413+{
414+ static const char fmt[] = "{ class: bcm, res: ipa_pc, val: %c }";
415+ struct ipa_power *power = ipa->power;
416+ char buf[36]; /* Exactly enough for fmt[]; size a multiple of 4 */
417+ int ret;
418+
419+ if (!power->qmp)
420+ return; /* Not needed on this platform */
421+
422+ (void)snprintf(buf, sizeof(buf), fmt, enable ? '1' : '0');
423+
424+ ret = qmp_send(power->qmp, buf, sizeof(buf));
425+ if (ret)
426+ dev_err(power->dev, "error %d sending QMP %sable request\n",
427+ ret, enable ? "en" : "dis");
428+}
429+
385430 int ipa_power_setup(struct ipa *ipa)
386431 {
387432 int ret;
@@ -438,12 +483,18 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data) · 50 unmodified lines
438483 if (ret)
439484 goto err_kfree;
440485
486+ ret = ipa_power_retention_init(power);
487+ if (ret)
488+ goto err_interconnect_exit;
489+
441490 pm_runtime_set_autosuspend_delay(dev, IPA_AUTOSUSPEND_DELAY);
442491 pm_runtime_use_autosuspend(dev);
443492 pm_runtime_enable(dev);
444493
445494 return power;
446495
496+err_interconnect_exit:
497+ ipa_interconnect_exit(power);
447498 err_kfree:
448499 kfree(power);
449500 err_clk_put:
@@ -460,6 +511,7 @@ void ipa_power_exit(struct ipa_power *power) · 10 unmodified lines
460511
461512 pm_runtime_disable(dev);
462513 pm_runtime_dont_use_autosuspend(dev);
514+ ipa_power_retention_exit(power);
463515 ipa_interconnect_exit(power);
464516 kfree(power);
465517 clk_put(clk);
drivers/net/ipa/ipa_power.h+7−0
@@ -40,6 +40,13 @@ void ipa_power_modem_queue_wake(struct ipa *ipa); · 39 unmodified lines
4040 */
4141 void ipa_power_modem_queue_active(struct ipa *ipa);
4242
43+/**
44+ * ipa_power_retention() - Control register retention on power collapse
45+ * @ipa: IPA pointer
46+ * @enable: Whether retention should be enabled or disabled
47+ */
48+void ipa_power_retention(struct ipa *ipa, bool enable);
49+
4350 /**
4451 * ipa_power_setup() - Set up IPA power management
4552 * @ipa: IPA pointer
drivers/net/ipa/ipa_uc.c+5−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include "ipa.h"
1313 #include "ipa_uc.h"
14+#include "ipa_power.h"
1415
1516 /**
1617 * DOC: The IPA embedded microcontroller
@@ -154,6 +155,7 @@ static void ipa_uc_response_hdlr(struct ipa *ipa, enum ipa_irq_id irq_id) · 137 unmodified lines
154155 case IPA_UC_RESPONSE_INIT_COMPLETED:
155156 if (ipa->uc_powered) {
156157 ipa->uc_loaded = true;
158+ ipa_power_retention(ipa, true);
157159 pm_runtime_mark_last_busy(dev);
158160 (void)pm_runtime_put_autosuspend(dev);
159161 ipa->uc_powered = false;
@@ -184,6 +186,9 @@ void ipa_uc_deconfig(struct ipa *ipa) · 24 unmodified lines
184186
185187 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1);
186188 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0);
189+ if (ipa->uc_loaded)
190+ ipa_power_retention(ipa, false);
191+
187192 if (!ipa->uc_powered)
188193 return;
189194
drivers/net/macsec.c+21−12
@@ -3870,6 +3870,18 @@ static void macsec_common_dellink(struct net_device *dev, struct list_head *head · 3869 unmodified lines
38703870 struct macsec_dev *macsec = macsec_priv(dev);
38713871 struct net_device *real_dev = macsec->real_dev;
38723872
3873+ /* If h/w offloading is available, propagate to the device */
3874+ if (macsec_is_offloaded(macsec)) {
3875+ const struct macsec_ops *ops;
3876+ struct macsec_context ctx;
3877+
3878+ ops = macsec_get_ops(netdev_priv(dev), &ctx);
3879+ if (ops) {
3880+ ctx.secy = &macsec->secy;
3881+ macsec_offload(ops->mdo_del_secy, &ctx);
3882+ }
3883+ }
3884+
38733885 unregister_netdevice_queue(dev, head);
38743886 list_del_rcu(&macsec->secys);
38753887 macsec_del_dev(macsec);
@@ -3884,18 +3896,6 @@ static void macsec_dellink(struct net_device *dev, struct list_head *head) · 8 unmodified lines
38843896 struct net_device *real_dev = macsec->real_dev;
38853897 struct macsec_rxh_data *rxd = macsec_data_rtnl(real_dev);
38863898
3887− /* If h/w offloading is available, propagate to the device */
3888− if (macsec_is_offloaded(macsec)) {
3889− const struct macsec_ops *ops;
3890− struct macsec_context ctx;
3891−
3892− ops = macsec_get_ops(netdev_priv(dev), &ctx);
3893− if (ops) {
3894− ctx.secy = &macsec->secy;
3895− macsec_offload(ops->mdo_del_secy, &ctx);
3896− }
3897− }
3898−
38993899 macsec_common_dellink(dev, head);
39003900
39013901 if (list_empty(&rxd->secys)) {
@@ -4018,6 +4018,15 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 116 unmodified lines
40184018 !macsec_check_offload(macsec->offload, macsec))
40194019 return -EOPNOTSUPP;
40204020
4021+ /* send_sci must be set to true when transmit sci explicitly is set */
4022+ if ((data && data[IFLA_MACSEC_SCI]) &&
4023+ (data && data[IFLA_MACSEC_INC_SCI])) {
4024+ u8 send_sci = !!nla_get_u8(data[IFLA_MACSEC_INC_SCI]);
4025+
4026+ if (!send_sci)
4027+ return -EINVAL;
4028+ }
4029+
40214030 if (data && data[IFLA_MACSEC_ICV_LEN])
40224031 icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]);
40234032 mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
drivers/net/mctp/mctp-serial.c+8−1
@@ -403,8 +403,16 @@ static void mctp_serial_tty_receive_buf(struct tty_struct *tty, · 402 unmodified lines
403403 mctp_serial_push(dev, c[i]);
404404 }
405405
406+static void mctp_serial_uninit(struct net_device *ndev)
407+{
408+ struct mctp_serial *dev = netdev_priv(ndev);
409+
410+ cancel_work_sync(&dev->tx_work);
411+}
412+
406413 static const struct net_device_ops mctp_serial_netdev_ops = {
407414 .ndo_start_xmit = mctp_serial_tx,
415+ .ndo_uninit = mctp_serial_uninit,
408416 };
409417
410418 static void mctp_serial_setup(struct net_device *ndev)
@@ -483,7 +491,6 @@ static void mctp_serial_close(struct tty_struct *tty) · 72 unmodified lines
483491 int idx = dev->idx;
484492
485493 unregister_netdev(dev->netdev);
486− cancel_work_sync(&dev->tx_work);
487494 ida_free(&mctp_serial_ida, idx);
488495 }
489496
drivers/net/mdio/mdio-aspeed.c+1−0
@@ -148,6 +148,7 @@ static const struct of_device_id aspeed_mdio_of_match[] = { · 147 unmodified lines
148148 { .compatible = "aspeed,ast2600-mdio", },
149149 { },
150150 };
151+MODULE_DEVICE_TABLE(of, aspeed_mdio_of_match);
151152
152153 static struct platform_driver aspeed_mdio_driver = {
153154 .driver = {
drivers/net/netdevsim/fib.c+2−2
@@ -623,14 +623,14 @@ static int nsim_fib6_rt_append(struct nsim_fib_data *data, · 622 unmodified lines
623623 if (err)
624624 goto err_fib6_rt_nh_del;
625625
626− fib6_event->rt_arr[i]->trap = true;
626+ WRITE_ONCE(fib6_event->rt_arr[i]->trap, true);
627627 }
628628
629629 return 0;
630630
631631 err_fib6_rt_nh_del:
632632 for (i--; i >= 0; i--) {
633− fib6_event->rt_arr[i]->trap = false;
633+ WRITE_ONCE(fib6_event->rt_arr[i]->trap, false);
634634 nsim_fib6_rt_nh_del(fib6_rt, fib6_event->rt_arr[i]);
635635 }
636636 return err;
drivers/net/phy/at803x.c+13−13
@@ -1688,19 +1688,19 @@ static int qca808x_read_status(struct phy_device *phydev) · 1687 unmodified lines
16881688 if (ret < 0)
16891689 return ret;
16901690
1691− if (phydev->link && phydev->speed == SPEED_2500)
1692− phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
1693− else
1694− phydev->interface = PHY_INTERFACE_MODE_SMII;
1695−
1696− /* generate seed as a lower random value to make PHY linked as SLAVE easily,
1697− * except for master/slave configuration fault detected.
1698− * the reason for not putting this code into the function link_change_notify is
1699− * the corner case where the link partner is also the qca8081 PHY and the seed
1700− * value is configured as the same value, the link can't be up and no link change
1701− * occurs.
1702− */
1703− if (!phydev->link) {
1691+ if (phydev->link) {
1692+ if (phydev->speed == SPEED_2500)
1693+ phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
1694+ else
1695+ phydev->interface = PHY_INTERFACE_MODE_SGMII;
1696+ } else {
1697+ /* generate seed as a lower random value to make PHY linked as SLAVE easily,
1698+ * except for master/slave configuration fault detected.
1699+ * the reason for not putting this code into the function link_change_notify is
1700+ * the corner case where the link partner is also the qca8081 PHY and the seed
1701+ * value is configured as the same value, the link can't be up and no link change
1702+ * occurs.
1703+ */
17041704 if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR) {
17051705 qca808x_phy_ms_seed_enable(phydev, false);
17061706 } else {
drivers/net/phy/broadcom.c+1−0
@@ -854,6 +854,7 @@ static struct phy_driver broadcom_drivers[] = { · 853 unmodified lines
854854 .phy_id_mask = 0xfffffff0,
855855 .name = "Broadcom BCM54616S",
856856 /* PHY_GBIT_FEATURES */
857+ .soft_reset = genphy_soft_reset,
857858 .config_init = bcm54xx_config_init,
858859 .config_aneg = bcm54616s_config_aneg,
859860 .config_intr = bcm_phy_config_intr,
drivers/net/phy/marvell.c+9−8
@@ -553,9 +553,9 @@ static int m88e1121_config_aneg_rgmii_delays(struct phy_device *phydev) · 552 unmodified lines
553553 else
554554 mscr = 0;
555555
556− return phy_modify_paged(phydev, MII_MARVELL_MSCR_PAGE,
557− MII_88E1121_PHY_MSCR_REG,
558− MII_88E1121_PHY_MSCR_DELAY_MASK, mscr);
556+ return phy_modify_paged_changed(phydev, MII_MARVELL_MSCR_PAGE,
557+ MII_88E1121_PHY_MSCR_REG,
558+ MII_88E1121_PHY_MSCR_DELAY_MASK, mscr);
559559 }
560560
561561 static int m88e1121_config_aneg(struct phy_device *phydev)
@@ -569,11 +569,13 @@ static int m88e1121_config_aneg(struct phy_device *phydev) · 7 unmodified lines
569569 return err;
570570 }
571571
572+ changed = err;
573+
572574 err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
573575 if (err < 0)
574576 return err;
575577
576− changed = err;
578+ changed |= err;
577579
578580 err = genphy_config_aneg(phydev);
579581 if (err < 0)
@@ -1213,16 +1215,15 @@ static int m88e1118_config_aneg(struct phy_device *phydev) · 633 unmodified lines
12131215 {
12141216 int err;
12151217
1216− err = genphy_soft_reset(phydev);
1218+ err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
12171219 if (err < 0)
12181220 return err;
12191221
1220− err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
1222+ err = genphy_config_aneg(phydev);
12211223 if (err < 0)
12221224 return err;
12231225
1224− err = genphy_config_aneg(phydev);
1225− return 0;
1226+ return genphy_soft_reset(phydev);
12261227 }
12271228
12281229 static int m88e1118_config_init(struct phy_device *phydev)
drivers/net/phy/mediatek-ge.c+0−3
@@ -55,9 +55,6 @@ static int mt7530_phy_config_init(struct phy_device *phydev) · 54 unmodified lines
5555
5656 static int mt7531_phy_config_init(struct phy_device *phydev)
5757 {
58− if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
59− return -EINVAL;
60−
6158 mtk_gephy_config_init(phydev);
6259
6360 /* PHY link down power saving enable */
drivers/net/phy/phy_device.c+3−3
@@ -1746,6 +1746,9 @@ void phy_detach(struct phy_device *phydev) · 1745 unmodified lines
17461746 phy_driver_is_genphy_10g(phydev))
17471747 device_release_driver(&phydev->mdio.dev);
17481748
1749+ /* Assert the reset signal */
1750+ phy_device_reset(phydev, 1);
1751+
17491752 /*
17501753 * The phydev might go away on the put_device() below, so avoid
17511754 * a use-after-free bug by reading the underlying bus first.
@@ -1757,9 +1760,6 @@ void phy_detach(struct phy_device *phydev) · 5 unmodified lines
17571760 ndev_owner = dev->dev.parent->driver->owner;
17581761 if (ndev_owner != bus->owner)
17591762 module_put(bus->owner);
1760−
1761− /* Assert the reset signal */
1762− phy_device_reset(phydev, 1);
17631763 }
17641764 EXPORT_SYMBOL(phy_detach);
17651765
drivers/net/phy/sfp-bus.c+5−0
@@ -651,6 +651,11 @@ struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode) · 650 unmodified lines
651651 else if (ret < 0)
652652 return ERR_PTR(ret);
653653
654+ if (!fwnode_device_is_available(ref.fwnode)) {
655+ fwnode_handle_put(ref.fwnode);
656+ return NULL;
657+ }
658+
654659 bus = sfp_bus_get(ref.fwnode);
655660 fwnode_handle_put(ref.fwnode);
656661 if (!bus)
drivers/net/usb/ax88179_178a.c+39−29
@@ -1468,58 +1468,68 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) · 1467 unmodified lines
14681468 u16 hdr_off;
14691469 u32 *pkt_hdr;
14701470
1471− /* This check is no longer done by usbnet */
1472− if (skb->len < dev->net->hard_header_len)
1471+ /* At the end of the SKB, there's a header telling us how many packets
1472+ * are bundled into this buffer and where we can find an array of
1473+ * per-packet metadata (which contains elements encoded into u16).
1474+ */
1475+ if (skb->len < 4)
14731476 return 0;
1474−
14751477 skb_trim(skb, skb->len - 4);
14761478 rx_hdr = get_unaligned_le32(skb_tail_pointer(skb));
1477−
14781479 pkt_cnt = (u16)rx_hdr;
14791480 hdr_off = (u16)(rx_hdr >> 16);
1481+
1482+ if (pkt_cnt == 0)
1483+ return 0;
1484+
1485+ /* Make sure that the bounds of the metadata array are inside the SKB
1486+ * (and in front of the counter at the end).
1487+ */
1488+ if (pkt_cnt * 2 + hdr_off > skb->len)
1489+ return 0;
14801490 pkt_hdr = (u32 *)(skb->data + hdr_off);
14811491
1482− while (pkt_cnt--) {
1492+ /* Packets must not overlap the metadata array */
1493+ skb_trim(skb, hdr_off);
1494+
1495+ for (; ; pkt_cnt--, pkt_hdr++) {
14831496 u16 pkt_len;
14841497
14851498 le32_to_cpus(pkt_hdr);
14861499 pkt_len = (*pkt_hdr >> 16) & 0x1fff;
14871500
1488− /* Check CRC or runt packet */
1489− if ((*pkt_hdr & AX_RXHDR_CRC_ERR) ||
1490− (*pkt_hdr & AX_RXHDR_DROP_ERR)) {
1491− skb_pull(skb, (pkt_len + 7) & 0xFFF8);
1492− pkt_hdr++;
1493− continue;
1494− }
1495−
1496− if (pkt_cnt == 0) {
1497− skb->len = pkt_len;
1498− /* Skip IP alignment pseudo header */
1499− skb_pull(skb, 2);
1500− skb_set_tail_pointer(skb, skb->len);
1501− skb->truesize = pkt_len + sizeof(struct sk_buff);
1502− ax88179_rx_checksum(skb, pkt_hdr);
1503− return 1;
1504− }
1501+ if (pkt_len > skb->len)
1502+ return 0;
15051503
1506− ax_skb = skb_clone(skb, GFP_ATOMIC);
1507− if (ax_skb) {
1504+ /* Check CRC or runt packet */
1505+ if (((*pkt_hdr & (AX_RXHDR_CRC_ERR | AX_RXHDR_DROP_ERR)) == 0) &&
1506+ pkt_len >= 2 + ETH_HLEN) {
1507+ bool last = (pkt_cnt == 0);
1508+
1509+ if (last) {
1510+ ax_skb = skb;
1511+ } else {
1512+ ax_skb = skb_clone(skb, GFP_ATOMIC);
1513+ if (!ax_skb)
1514+ return 0;
1515+ }
15081516 ax_skb->len = pkt_len;
15091517 /* Skip IP alignment pseudo header */
15101518 skb_pull(ax_skb, 2);
15111519 skb_set_tail_pointer(ax_skb, ax_skb->len);
15121520 ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
15131521 ax88179_rx_checksum(ax_skb, pkt_hdr);
1522+
1523+ if (last)
1524+ return 1;
1525+
15141526 usbnet_skb_return(dev, ax_skb);
1515− } else {
1516− return 0;
15171527 }
15181528
1519− skb_pull(skb, (pkt_len + 7) & 0xFFF8);
1520− pkt_hdr++;
1529+ /* Trim this packet away from the SKB */
1530+ if (!skb_pull(skb, (pkt_len + 7) & 0xFFF8))
1531+ return 0;
15211532 }
1522− return 1;
15231533 }
15241534
15251535 static struct sk_buff *
drivers/net/usb/cdc_ether.c+12−0
@@ -583,6 +583,11 @@ static const struct usb_device_id products[] = { · 582 unmodified lines
583583 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
584584 .bInterfaceProtocol = USB_CDC_PROTO_NONE
585585
586+#define ZAURUS_FAKE_INTERFACE \
587+ .bInterfaceClass = USB_CLASS_COMM, \
588+ .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \
589+ .bInterfaceProtocol = USB_CDC_PROTO_NONE
590+
586591 /* SA-1100 based Sharp Zaurus ("collie"), or compatible;
587592 * wire-incompatible with true CDC Ethernet implementations.
588593 * (And, it seems, needlessly so...)
@@ -636,6 +641,13 @@ static const struct usb_device_id products[] = { · 47 unmodified lines
636641 .idProduct = 0x9032, /* SL-6000 */
637642 ZAURUS_MASTER_INTERFACE,
638643 .driver_info = 0,
644+}, {
645+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
646+ | USB_DEVICE_ID_MATCH_DEVICE,
647+ .idVendor = 0x04DD,
648+ .idProduct = 0x9032, /* SL-6000 */
649+ ZAURUS_FAKE_INTERFACE,
650+ .driver_info = 0,
639651 }, {
640652 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
641653 | USB_DEVICE_ID_MATCH_DEVICE,
drivers/net/usb/cdc_mbim.c+5−0
@@ -659,6 +659,11 @@ static const struct usb_device_id mbim_devs[] = { · 658 unmodified lines
659659 .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,
660660 },
661661
662+ /* Telit FN990 */
663+ { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1071, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
664+ .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,
665+ },
666+
662667 /* default entry */
663668 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
664669 .driver_info = (unsigned long)&cdc_mbim_info_zlp,
drivers/net/usb/cdc_ncm.c+4−4
@@ -1715,10 +1715,10 @@ int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) · 1714 unmodified lines
17151715 {
17161716 struct sk_buff *skb;
17171717 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
1718− int len;
1718+ unsigned int len;
17191719 int nframes;
17201720 int x;
1721− int offset;
1721+ unsigned int offset;
17221722 union {
17231723 struct usb_cdc_ncm_ndp16 *ndp16;
17241724 struct usb_cdc_ncm_ndp32 *ndp32;
@@ -1790,8 +1790,8 @@ next_ndp: · 65 unmodified lines
17901790 break;
17911791 }
17921792
1793− /* sanity checking */
1794− if (((offset + len) > skb_in->len) ||
1793+ /* sanity checking - watch out for integer wrap*/
1794+ if ((offset > skb_in->len) || (len > skb_in->len - offset) ||
17951795 (len > ctx->rx_max) || (len < ETH_HLEN)) {
17961796 netif_dbg(dev, rx_err, dev->net,
17971797 "invalid frame detected (ignored) offset[%u]=%u, length=%u, skb=%p\n",
drivers/net/usb/ipheth.c+3−3
@@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone) · 120 unmodified lines
121121 if (tx_buf == NULL)
122122 goto free_rx_urb;
123123
124− rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
124+ rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
125125 GFP_KERNEL, &rx_urb->transfer_dma);
126126 if (rx_buf == NULL)
127127 goto free_tx_buf;
@@ -146,7 +146,7 @@ error_nomem: · 18 unmodified lines
146146
147147 static void ipheth_free_urbs(struct ipheth_device *iphone)
148148 {
149− usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
149+ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf,
150150 iphone->rx_urb->transfer_dma);
151151 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
152152 iphone->tx_urb->transfer_dma);
@@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags) · 164 unmodified lines
317317
318318 usb_fill_bulk_urb(dev->rx_urb, udev,
319319 usb_rcvbulkpipe(udev, dev->bulk_in),
320− dev->rx_buf, IPHETH_BUF_SIZE,
320+ dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
321321 ipheth_rcvbulk_callback,
322322 dev);
323323 dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
drivers/net/usb/qmi_wwan.c+2−0
@@ -1400,6 +1400,8 @@ static const struct usb_device_id products[] = { · 1399 unmodified lines
14001400 {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
14011401 {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */
14021402 {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
1403+ {QMI_FIXED_INTF(0x413c, 0x81e4, 0)}, /* Dell Wireless 5829e with eSIM support*/
1404+ {QMI_FIXED_INTF(0x413c, 0x81e6, 0)}, /* Dell Wireless 5829e */
14031405 {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
14041406 {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
14051407 {QMI_QUIRK_SET_DTR(0x22de, 0x9051, 2)}, /* Hucom Wireless HM-211S/K */
drivers/net/usb/zaurus.c+12−0
@@ -256,6 +256,11 @@ static const struct usb_device_id products [] = { · 255 unmodified lines
256256 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
257257 .bInterfaceProtocol = USB_CDC_PROTO_NONE
258258
259+#define ZAURUS_FAKE_INTERFACE \
260+ .bInterfaceClass = USB_CLASS_COMM, \
261+ .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \
262+ .bInterfaceProtocol = USB_CDC_PROTO_NONE
263+
259264 /* SA-1100 based Sharp Zaurus ("collie"), or compatible. */
260265 {
261266 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
@@ -313,6 +318,13 @@ static const struct usb_device_id products [] = { · 51 unmodified lines
313318 .idProduct = 0x9032, /* SL-6000 */
314319 ZAURUS_MASTER_INTERFACE,
315320 .driver_info = ZAURUS_PXA_INFO,
321+}, {
322+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
323+ | USB_DEVICE_ID_MATCH_DEVICE,
324+ .idVendor = 0x04DD,
325+ .idProduct = 0x9032, /* SL-6000 */
326+ ZAURUS_FAKE_INTERFACE,
327+ .driver_info = (unsigned long)&bogus_mdlm_info,
316328 }, {
317329 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
318330 | USB_DEVICE_ID_MATCH_DEVICE,
drivers/net/veth.c+8−5
@@ -265,9 +265,10 @@ static void __veth_xdp_flush(struct veth_rq *rq) · 264 unmodified lines
265265 {
266266 /* Write ptr_ring before reading rx_notify_masked */
267267 smp_mb();
268− if (!rq->rx_notify_masked) {
269− rq->rx_notify_masked = true;
270− napi_schedule(&rq->xdp_napi);
268+ if (!READ_ONCE(rq->rx_notify_masked) &&
269+ napi_schedule_prep(&rq->xdp_napi)) {
270+ WRITE_ONCE(rq->rx_notify_masked, true);
271+ __napi_schedule(&rq->xdp_napi);
271272 }
272273 }
273274
@@ -912,8 +913,10 @@ static int veth_poll(struct napi_struct *napi, int budget) · 638 unmodified lines
912913 /* Write rx_notify_masked before reading ptr_ring */
913914 smp_store_mb(rq->rx_notify_masked, false);
914915 if (unlikely(!__ptr_ring_empty(&rq->xdp_ring))) {
915− rq->rx_notify_masked = true;
916− napi_schedule(&rq->xdp_napi);
916+ if (napi_schedule_prep(&rq->xdp_napi)) {
917+ WRITE_ONCE(rq->rx_notify_masked, true);
918+ __napi_schedule(&rq->xdp_napi);
919+ }
917920 }
918921 }
919922
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c+4−2
@@ -693,7 +693,7 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req, · 692 unmodified lines
693693 {
694694 struct brcmf_fw_item *first = &req->items[0];
695695 struct brcmf_fw *fwctx;
696− char *alt_path;
696+ char *alt_path = NULL;
697697 int ret;
698698
699699 brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
@@ -712,7 +712,9 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req, · 12 unmodified lines
712712 fwctx->done = fw_cb;
713713
714714 /* First try alternative board-specific path if any */
715− alt_path = brcm_alt_fw_path(first->path, fwctx->req->board_type);
715+ if (fwctx->req->board_type)
716+ alt_path = brcm_alt_fw_path(first->path,
717+ fwctx->req->board_type);
716718 if (alt_path) {
717719 ret = request_firmware_nowait(THIS_MODULE, true, alt_path,
718720 fwctx->dev, GFP_KERNEL, fwctx,
drivers/net/wireless/intel/iwlwifi/Kconfig+0−13
@@ -80,19 +80,6 @@ config IWLWIFI_OPMODE_MODULAR · 79 unmodified lines
8080 comment "WARNING: iwlwifi is useless without IWLDVM or IWLMVM"
8181 depends on IWLDVM=n && IWLMVM=n
8282
83−config IWLWIFI_BCAST_FILTERING
84− bool "Enable broadcast filtering"
85− depends on IWLMVM
86− help
87− Say Y here to enable default bcast filtering configuration.
88−
89− Enabling broadcast filtering will drop any incoming wireless
90− broadcast frames, except some very specific predefined
91− patterns (e.g. incoming arp requests).
92−
93− If unsure, don't enable this option, as some programs might
94− expect incoming broadcasts for their normal operations.
95−
9683 menu "Debugging Options"
9784
9885 config IWLWIFI_DEBUG
drivers/net/wireless/intel/iwlwifi/fw/acpi.c+6−5
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22 /*
33 * Copyright (C) 2017 Intel Deutschland GmbH
4− * Copyright (C) 2019-2021 Intel Corporation
4+ * Copyright (C) 2019-2022 Intel Corporation
55 */
66 #include <linux/uuid.h>
77 #include "iwl-drv.h"
@@ -888,10 +888,11 @@ bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt) · 880 unmodified lines
888888 * only one using version 36, so skip this version entirely.
889889 */
890890 return IWL_UCODE_SERIAL(fwrt->fw->ucode_ver) >= 38 ||
891− IWL_UCODE_SERIAL(fwrt->fw->ucode_ver) == 17 ||
892− (IWL_UCODE_SERIAL(fwrt->fw->ucode_ver) == 29 &&
893− ((fwrt->trans->hw_rev & CSR_HW_REV_TYPE_MSK) ==
894− CSR_HW_REV_TYPE_7265D));
891+ (IWL_UCODE_SERIAL(fwrt->fw->ucode_ver) == 17 &&
892+ fwrt->trans->hw_rev != CSR_HW_REV_TYPE_3160) ||
893+ (IWL_UCODE_SERIAL(fwrt->fw->ucode_ver) == 29 &&
894+ ((fwrt->trans->hw_rev & CSR_HW_REV_TYPE_MSK) ==
895+ CSR_HW_REV_TYPE_7265D));
895896 }
896897 IWL_EXPORT_SYMBOL(iwl_sar_geo_support);
897898
drivers/net/wireless/intel/iwlwifi/fw/api/commands.h+0−5
@@ -501,11 +501,6 @@ enum iwl_legacy_cmds { · 500 unmodified lines
501501 */
502502 DEBUG_LOG_MSG = 0xf7,
503503
504− /**
505− * @BCAST_FILTER_CMD: &struct iwl_bcast_filter_cmd
506− */
507− BCAST_FILTER_CMD = 0xcf,
508−
509504 /**
510505 * @MCAST_FILTER_CMD: &struct iwl_mcast_filter_cmd
511506 */
drivers/net/wireless/intel/iwlwifi/fw/api/filter.h+0−88
@@ -36,92 +36,4 @@ struct iwl_mcast_filter_cmd { · 35 unmodified lines
3636 u8 addr_list[0];
3737 } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
3838
39−#define MAX_BCAST_FILTERS 8
40−#define MAX_BCAST_FILTER_ATTRS 2
41−
42−/**
43− * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
44− * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
45− * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
46− * start of ip payload).
47− */
48−enum iwl_mvm_bcast_filter_attr_offset {
49− BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
50− BCAST_FILTER_OFFSET_IP_END = 1,
51−};
52−
53−/**
54− * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
55− * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
56− * @offset: starting offset of this pattern.
57− * @reserved1: reserved
58− * @val: value to match - big endian (MSB is the first
59− * byte to match from offset pos).
60− * @mask: mask to match (big endian).
61− */
62−struct iwl_fw_bcast_filter_attr {
63− u8 offset_type;
64− u8 offset;
65− __le16 reserved1;
66− __be32 val;
67− __be32 mask;
68−} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
69−
70−/**
71− * enum iwl_mvm_bcast_filter_frame_type - filter frame type
72− * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
73− * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
74− */
75−enum iwl_mvm_bcast_filter_frame_type {
76− BCAST_FILTER_FRAME_TYPE_ALL = 0,
77− BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
78−};
79−
80−/**
81− * struct iwl_fw_bcast_filter - broadcast filter
82− * @discard: discard frame (1) or let it pass (0).
83− * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
84− * @reserved1: reserved
85− * @num_attrs: number of valid attributes in this filter.
86− * @attrs: attributes of this filter. a filter is considered matched
87− * only when all its attributes are matched (i.e. AND relationship)
88− */
89−struct iwl_fw_bcast_filter {
90− u8 discard;
91− u8 frame_type;
92− u8 num_attrs;
93− u8 reserved1;
94− struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
95−} __packed; /* BCAST_FILTER_S_VER_1 */
96−
97−/**
98− * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
99− * @default_discard: default action for this mac (discard (1) / pass (0)).
100− * @reserved1: reserved
101− * @attached_filters: bitmap of relevant filters for this mac.
102− */
103−struct iwl_fw_bcast_mac {
104− u8 default_discard;
105− u8 reserved1;
106− __le16 attached_filters;
107−} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
108−
109−/**
110− * struct iwl_bcast_filter_cmd - broadcast filtering configuration
111− * @disable: enable (0) / disable (1)
112− * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
113− * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
114− * @reserved1: reserved
115− * @filters: broadcast filters
116− * @macs: broadcast filtering configuration per-mac
117− */
118−struct iwl_bcast_filter_cmd {
119− u8 disable;
120− u8 max_bcast_filters;
121− u8 max_macs;
122− u8 reserved1;
123− struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
124− struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
125−} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
126−
12739 #endif /* __iwl_fw_api_filter_h__ */
drivers/net/wireless/intel/iwlwifi/fw/api/rs.h+0−1
@@ -752,7 +752,6 @@ struct iwl_lq_cmd { · 751 unmodified lines
752752
753753 u8 iwl_fw_rate_idx_to_plcp(int idx);
754754 u32 iwl_new_rate_from_v1(u32 rate_v1);
755−u32 iwl_legacy_rate_to_fw_idx(u32 rate_n_flags);
756755 const struct iwl_rate_mcs_info *iwl_rate_mcs(int idx);
757756 const char *iwl_rs_pretty_ant(u8 ant);
758757 const char *iwl_rs_pretty_bw(int bw);
drivers/net/wireless/intel/iwlwifi/fw/file.h+0−2
@@ -181,7 +181,6 @@ struct iwl_ucode_capa { · 180 unmodified lines
181181 * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version)
182182 * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD
183183 * @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save
184− * @IWL_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering.
185184 * @IWL_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS.
186185 */
187186 enum iwl_ucode_tlv_flag {
@@ -196,7 +195,6 @@ enum iwl_ucode_tlv_flag { · 8 unmodified lines
196195 IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT = BIT(24),
197196 IWL_UCODE_TLV_FLAGS_EBS_SUPPORT = BIT(25),
198197 IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD = BIT(26),
199− IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29),
200198 };
201199
202200 typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
drivers/net/wireless/intel/iwlwifi/fw/rs.c+18−15
@@ -91,6 +91,20 @@ const char *iwl_rs_pretty_bw(int bw) · 90 unmodified lines
9191 }
9292 IWL_EXPORT_SYMBOL(iwl_rs_pretty_bw);
9393
94+static u32 iwl_legacy_rate_to_fw_idx(u32 rate_n_flags)
95+{
96+ int rate = rate_n_flags & RATE_LEGACY_RATE_MSK_V1;
97+ int idx;
98+ bool ofdm = !(rate_n_flags & RATE_MCS_CCK_MSK_V1);
99+ int offset = ofdm ? IWL_FIRST_OFDM_RATE : 0;
100+ int last = ofdm ? IWL_RATE_COUNT_LEGACY : IWL_FIRST_OFDM_RATE;
101+
102+ for (idx = offset; idx < last; idx++)
103+ if (iwl_fw_rate_idx_to_plcp(idx) == rate)
104+ return idx - offset;
105+ return IWL_RATE_INVALID;
106+}
107+
94108 u32 iwl_new_rate_from_v1(u32 rate_v1)
95109 {
96110 u32 rate_v2 = 0;
@@ -144,7 +158,10 @@ u32 iwl_new_rate_from_v1(u32 rate_v1) · 47 unmodified lines
144158 } else {
145159 u32 legacy_rate = iwl_legacy_rate_to_fw_idx(rate_v1);
146160
147− WARN_ON(legacy_rate < 0);
161+ if (WARN_ON_ONCE(legacy_rate == IWL_RATE_INVALID))
162+ legacy_rate = (rate_v1 & RATE_MCS_CCK_MSK_V1) ?
163+ IWL_FIRST_CCK_RATE : IWL_FIRST_OFDM_RATE;
164+
148165 rate_v2 |= legacy_rate;
149166 if (!(rate_v1 & RATE_MCS_CCK_MSK_V1))
150167 rate_v2 |= RATE_MCS_LEGACY_OFDM_MSK;
@@ -172,20 +189,6 @@ u32 iwl_new_rate_from_v1(u32 rate_v1) · 21 unmodified lines
172189 }
173190 IWL_EXPORT_SYMBOL(iwl_new_rate_from_v1);
174191
175−u32 iwl_legacy_rate_to_fw_idx(u32 rate_n_flags)
176−{
177− int rate = rate_n_flags & RATE_LEGACY_RATE_MSK_V1;
178− int idx;
179− bool ofdm = !(rate_n_flags & RATE_MCS_CCK_MSK_V1);
180− int offset = ofdm ? IWL_FIRST_OFDM_RATE : 0;
181− int last = ofdm ? IWL_RATE_COUNT_LEGACY : IWL_FIRST_OFDM_RATE;
182−
183− for (idx = offset; idx < last; idx++)
184− if (iwl_fw_rate_idx_to_plcp(idx) == rate)
185− return idx - offset;
186− return -1;
187−}
188−
189192 int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate)
190193 {
191194 char *type;
drivers/net/wireless/intel/iwlwifi/iwl-csr.h+2−1
@@ -1,6 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
22 /*
3− * Copyright (C) 2005-2014, 2018-2021 Intel Corporation
3+ * Copyright (C) 2005-2014, 2018-2022 Intel Corporation
44 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
55 * Copyright (C) 2016 Intel Deutschland GmbH
66 */
@@ -329,6 +329,7 @@ enum { · 322 unmodified lines
329329 #define CSR_HW_REV_TYPE_2x00 (0x0000100)
330330 #define CSR_HW_REV_TYPE_105 (0x0000110)
331331 #define CSR_HW_REV_TYPE_135 (0x0000120)
332+#define CSR_HW_REV_TYPE_3160 (0x0000164)
332333 #define CSR_HW_REV_TYPE_7265D (0x0000210)
333334 #define CSR_HW_REV_TYPE_NONE (0x00001F0)
334335 #define CSR_HW_REV_TYPE_QNJ (0x0000360)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c+2−0
@@ -1707,6 +1707,8 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) · 1706 unmodified lines
17071707 out_unbind:
17081708 complete(&drv->request_firmware_complete);
17091709 device_release_driver(drv->trans->dev);
1710+ /* drv has just been freed by the release */
1711+ failure = false;
17101712 free:
17111713 if (failure)
17121714 iwl_dealloc_ucode(drv);
drivers/net/wireless/intel/iwlwifi/mei/main.c+34−11
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
3− * Copyright (C) 2021 Intel Corporation
3+ * Copyright (C) 2021-2022 Intel Corporation
44 */
55
66 #include <linux/etherdevice.h>
@@ -146,6 +146,7 @@ struct iwl_mei_filters { · 139 unmodified lines
146146 * @csme_taking_ownership: true when CSME is taking ownership. Used to remember
147147 * to send CSME_OWNERSHIP_CONFIRMED when the driver completes its down
148148 * flow.
149+ * @link_prot_state: true when we are in link protection PASSIVE
149150 * @csa_throttle_end_wk: used when &csa_throttled is true
150151 * @data_q_lock: protects the access to the data queues which are
151152 * accessed without the mutex.
@@ -165,6 +166,7 @@ struct iwl_mei { · 13 unmodified lines
165166 bool amt_enabled;
166167 bool csa_throttled;
167168 bool csme_taking_ownership;
169+ bool link_prot_state;
168170 struct delayed_work csa_throttle_end_wk;
169171 spinlock_t data_q_lock;
170172
@@ -229,8 +231,6 @@ static int iwl_mei_alloc_shared_mem(struct mei_cl_device *cldev) · 58 unmodified lines
229231 if (IS_ERR(mem->ctrl)) {
230232 int ret = PTR_ERR(mem->ctrl);
231233
232− dev_err(&cldev->dev, "Couldn't allocate the shared memory: %d\n",
233− ret);
234234 mem->ctrl = NULL;
235235
236236 return ret;
@@ -669,6 +669,8 @@ iwl_mei_handle_conn_status(struct mei_cl_device *cldev, · 432 unmodified lines
669669
670670 iwl_mei_cache.ops->me_conn_status(iwl_mei_cache.priv, &conn_info);
671671
672+ mei->link_prot_state = status->link_prot_state;
673+
672674 /*
673675 * Update the Rfkill state in case the host does not own the device:
674676 * if we are in Link Protection, ask to not touch the device, else,
@@ -1663,9 +1665,11 @@ int iwl_mei_register(void *priv, const struct iwl_mei_ops *ops) · 988 unmodified lines
16631665 mei_cldev_get_drvdata(iwl_mei_global_cldev);
16641666
16651667 /* we have already a SAP connection */
1666− if (iwl_mei_is_connected())
1668+ if (iwl_mei_is_connected()) {
16671669 iwl_mei_send_sap_msg(mei->cldev,
16681670 SAP_MSG_NOTIF_WIFIDR_UP);
1671+ ops->rfkill(priv, mei->link_prot_state);
1672+ }
16691673 }
16701674 ret = 0;
16711675
@@ -1784,6 +1788,8 @@ static void iwl_mei_dbgfs_unregister(struct iwl_mei *mei) {} · 112 unmodified lines
17841788
17851789 #endif /* CONFIG_DEBUG_FS */
17861790
1791+#define ALLOC_SHARED_MEM_RETRY_MAX_NUM 3
1792+
17871793 /*
17881794 * iwl_mei_probe - the probe function called by the mei bus enumeration
17891795 *
@@ -1795,6 +1801,7 @@ static void iwl_mei_dbgfs_unregister(struct iwl_mei *mei) {} · 5 unmodified lines
17951801 static int iwl_mei_probe(struct mei_cl_device *cldev,
17961802 const struct mei_cl_device_id *id)
17971803 {
1804+ int alloc_retry = ALLOC_SHARED_MEM_RETRY_MAX_NUM;
17981805 struct iwl_mei *mei;
17991806 int ret;
18001807
@@ -1812,15 +1819,31 @@ static int iwl_mei_probe(struct mei_cl_device *cldev, · 11 unmodified lines
18121819 mei_cldev_set_drvdata(cldev, mei);
18131820 mei->cldev = cldev;
18141821
1815− /*
1816− * The CSME firmware needs to boot the internal WLAN client. Wait here
1817− * so that the DMA map request will succeed.
1818− */
1819− msleep(20);
1822+ do {
1823+ ret = iwl_mei_alloc_shared_mem(cldev);
1824+ if (!ret)
1825+ break;
1826+ /*
1827+ * The CSME firmware needs to boot the internal WLAN client.
1828+ * This can take time in certain configurations (usually
1829+ * upon resume and when the whole CSME firmware is shut down
1830+ * during suspend).
1831+ *
1832+ * Wait a bit before retrying and hope we'll succeed next time.
1833+ */
18201834
1821− ret = iwl_mei_alloc_shared_mem(cldev);
1822− if (ret)
1835+ dev_dbg(&cldev->dev,
1836+ "Couldn't allocate the shared memory: %d, attempt %d / %d\n",
1837+ ret, alloc_retry, ALLOC_SHARED_MEM_RETRY_MAX_NUM);
1838+ msleep(100);
1839+ alloc_retry--;
1840+ } while (alloc_retry);
1841+
1842+ if (ret) {
1843+ dev_err(&cldev->dev, "Couldn't allocate the shared memory: %d\n",
1844+ ret);
18231845 goto free;
1846+ }
18241847
18251848 iwl_mei_init_shared_mem(mei);
18261849
drivers/net/wireless/intel/iwlwifi/mei/net.c+1−2
@@ -195,8 +195,7 @@ static bool iwl_mei_rx_filter_ipv4(struct sk_buff *skb, · 194 unmodified lines
195195 bool match;
196196
197197 if (!pskb_may_pull(skb, skb_network_offset(skb) + sizeof(*iphdr)) ||
198− !pskb_may_pull(skb, skb_network_offset(skb) +
199− sizeof(ip_hdrlen(skb) - sizeof(*iphdr))))
198+ !pskb_may_pull(skb, skb_network_offset(skb) + ip_hdrlen(skb)))
200199 return false;
201200
202201 iphdrlen = ip_hdrlen(skb);
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c+0−203
@@ -1369,189 +1369,6 @@ static ssize_t iwl_dbgfs_dbg_time_point_write(struct iwl_mvm *mvm, · 1368 unmodified lines
13691369 return count;
13701370 }
13711371
1372−#define ADD_TEXT(...) pos += scnprintf(buf + pos, bufsz - pos, __VA_ARGS__)
1373−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
1374−static ssize_t iwl_dbgfs_bcast_filters_read(struct file *file,
1375− char __user *user_buf,
1376− size_t count, loff_t *ppos)
1377−{
1378− struct iwl_mvm *mvm = file->private_data;
1379− struct iwl_bcast_filter_cmd cmd;
1380− const struct iwl_fw_bcast_filter *filter;
1381− char *buf;
1382− int bufsz = 1024;
1383− int i, j, pos = 0;
1384− ssize_t ret;
1385−
1386− buf = kzalloc(bufsz, GFP_KERNEL);
1387− if (!buf)
1388− return -ENOMEM;
1389−
1390− mutex_lock(&mvm->mutex);
1391− if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) {
1392− ADD_TEXT("None\n");
1393− mutex_unlock(&mvm->mutex);
1394− goto out;
1395− }
1396− mutex_unlock(&mvm->mutex);
1397−
1398− for (i = 0; cmd.filters[i].attrs[0].mask; i++) {
1399− filter = &cmd.filters[i];
1400−
1401− ADD_TEXT("Filter [%d]:\n", i);
1402− ADD_TEXT("\tDiscard=%d\n", filter->discard);
1403− ADD_TEXT("\tFrame Type: %s\n",
1404− filter->frame_type ? "IPv4" : "Generic");
1405−
1406− for (j = 0; j < ARRAY_SIZE(filter->attrs); j++) {
1407− const struct iwl_fw_bcast_filter_attr *attr;
1408−
1409− attr = &filter->attrs[j];
1410− if (!attr->mask)
1411− break;
1412−
1413− ADD_TEXT("\tAttr [%d]: offset=%d (from %s), mask=0x%x, value=0x%x reserved=0x%x\n",
1414− j, attr->offset,
1415− attr->offset_type ? "IP End" :
1416− "Payload Start",
1417− be32_to_cpu(attr->mask),
1418− be32_to_cpu(attr->val),
1419− le16_to_cpu(attr->reserved1));
1420− }
1421− }
1422−out:
1423− ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1424− kfree(buf);
1425− return ret;
1426−}
1427−
1428−static ssize_t iwl_dbgfs_bcast_filters_write(struct iwl_mvm *mvm, char *buf,
1429− size_t count, loff_t *ppos)
1430−{
1431− int pos, next_pos;
1432− struct iwl_fw_bcast_filter filter = {};
1433− struct iwl_bcast_filter_cmd cmd;
1434− u32 filter_id, attr_id, mask, value;
1435− int err = 0;
1436−
1437− if (sscanf(buf, "%d %hhi %hhi %n", &filter_id, &filter.discard,
1438− &filter.frame_type, &pos) != 3)
1439− return -EINVAL;
1440−
1441− if (filter_id >= ARRAY_SIZE(mvm->dbgfs_bcast_filtering.cmd.filters) ||
1442− filter.frame_type > BCAST_FILTER_FRAME_TYPE_IPV4)
1443− return -EINVAL;
1444−
1445− for (attr_id = 0; attr_id < ARRAY_SIZE(filter.attrs);
1446− attr_id++) {
1447− struct iwl_fw_bcast_filter_attr *attr =
1448− &filter.attrs[attr_id];
1449−
1450− if (pos >= count)
1451− break;
1452−
1453− if (sscanf(&buf[pos], "%hhi %hhi %i %i %n",
1454− &attr->offset, &attr->offset_type,
1455− &mask, &value, &next_pos) != 4)
1456− return -EINVAL;
1457−
1458− attr->mask = cpu_to_be32(mask);
1459− attr->val = cpu_to_be32(value);
1460− if (mask)
1461− filter.num_attrs++;
1462−
1463− pos += next_pos;
1464− }
1465−
1466− mutex_lock(&mvm->mutex);
1467− memcpy(&mvm->dbgfs_bcast_filtering.cmd.filters[filter_id],
1468− &filter, sizeof(filter));
1469−
1470− /* send updated bcast filtering configuration */
1471− if (iwl_mvm_firmware_running(mvm) &&
1472− mvm->dbgfs_bcast_filtering.override &&
1473− iwl_mvm_bcast_filter_build_cmd(mvm, &cmd))
1474− err = iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0,
1475− sizeof(cmd), &cmd);
1476− mutex_unlock(&mvm->mutex);
1477−
1478− return err ?: count;
1479−}
1480−
1481−static ssize_t iwl_dbgfs_bcast_filters_macs_read(struct file *file,
1482− char __user *user_buf,
1483− size_t count, loff_t *ppos)
1484−{
1485− struct iwl_mvm *mvm = file->private_data;
1486− struct iwl_bcast_filter_cmd cmd;
1487− char *buf;
1488− int bufsz = 1024;
1489− int i, pos = 0;
1490− ssize_t ret;
1491−
1492− buf = kzalloc(bufsz, GFP_KERNEL);
1493− if (!buf)
1494− return -ENOMEM;
1495−
1496− mutex_lock(&mvm->mutex);
1497− if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) {
1498− ADD_TEXT("None\n");
1499− mutex_unlock(&mvm->mutex);
1500− goto out;
1501− }
1502− mutex_unlock(&mvm->mutex);
1503−
1504− for (i = 0; i < ARRAY_SIZE(cmd.macs); i++) {
1505− const struct iwl_fw_bcast_mac *mac = &cmd.macs[i];
1506−
1507− ADD_TEXT("Mac [%d]: discard=%d attached_filters=0x%x\n",
1508− i, mac->default_discard, mac->attached_filters);
1509− }
1510−out:
1511− ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1512− kfree(buf);
1513− return ret;
1514−}
1515−
1516−static ssize_t iwl_dbgfs_bcast_filters_macs_write(struct iwl_mvm *mvm,
1517− char *buf, size_t count,
1518− loff_t *ppos)
1519−{
1520− struct iwl_bcast_filter_cmd cmd;
1521− struct iwl_fw_bcast_mac mac = {};
1522− u32 mac_id, attached_filters;
1523− int err = 0;
1524−
1525− if (!mvm->bcast_filters)
1526− return -ENOENT;
1527−
1528− if (sscanf(buf, "%d %hhi %i", &mac_id, &mac.default_discard,
1529− &attached_filters) != 3)
1530− return -EINVAL;
1531−
1532− if (mac_id >= ARRAY_SIZE(cmd.macs) ||
1533− mac.default_discard > 1 ||
1534− attached_filters >= BIT(ARRAY_SIZE(cmd.filters)))
1535− return -EINVAL;
1536−
1537− mac.attached_filters = cpu_to_le16(attached_filters);
1538−
1539− mutex_lock(&mvm->mutex);
1540− memcpy(&mvm->dbgfs_bcast_filtering.cmd.macs[mac_id],
1541− &mac, sizeof(mac));
1542−
1543− /* send updated bcast filtering configuration */
1544− if (iwl_mvm_firmware_running(mvm) &&
1545− mvm->dbgfs_bcast_filtering.override &&
1546− iwl_mvm_bcast_filter_build_cmd(mvm, &cmd))
1547− err = iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0,
1548− sizeof(cmd), &cmd);
1549− mutex_unlock(&mvm->mutex);
1550−
1551− return err ?: count;
1552−}
1553−#endif
1554−
15551372 #define MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz) \
15561373 _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct iwl_mvm)
15571374 #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \
@@ -1881,11 +1698,6 @@ MVM_DEBUGFS_WRITE_FILE_OPS(inject_beacon_ie_restore, 512); · 323 unmodified lines
18811698
18821699 MVM_DEBUGFS_READ_FILE_OPS(uapsd_noagg_bssids);
18831700
1884−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
1885−MVM_DEBUGFS_READ_WRITE_FILE_OPS(bcast_filters, 256);
1886−MVM_DEBUGFS_READ_WRITE_FILE_OPS(bcast_filters_macs, 256);
1887−#endif
1888−
18891701 #ifdef CONFIG_ACPI
18901702 MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile);
18911703 #endif
@@ -2097,21 +1909,6 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm) · 205 unmodified lines
20971909
20981910 MVM_DEBUGFS_ADD_FILE(uapsd_noagg_bssids, mvm->debugfs_dir, S_IRUSR);
20991911
2100−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
2101− if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING) {
2102− bcast_dir = debugfs_create_dir("bcast_filtering",
2103− mvm->debugfs_dir);
2104−
2105− debugfs_create_bool("override", 0600, bcast_dir,
2106− &mvm->dbgfs_bcast_filtering.override);
2107−
2108− MVM_DEBUGFS_ADD_FILE_ALIAS("filters", bcast_filters,
2109− bcast_dir, 0600);
2110− MVM_DEBUGFS_ADD_FILE_ALIAS("macs", bcast_filters_macs,
2111− bcast_dir, 0600);
2112− }
2113−#endif
2114−
21151912 #ifdef CONFIG_PM_SLEEP
21161913 MVM_DEBUGFS_ADD_FILE(d3_test, mvm->debugfs_dir, 0400);
21171914 debugfs_create_bool("d3_wake_sysassert", 0600, mvm->debugfs_dir,
drivers/net/wireless/intel/iwlwifi/mvm/fw.c+1−1
@@ -1741,7 +1741,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) · 1740 unmodified lines
17411741 ret = iwl_mvm_sar_init(mvm);
17421742 if (ret == 0)
17431743 ret = iwl_mvm_sar_geo_init(mvm);
1744− else if (ret < 0)
1744+ if (ret < 0)
17451745 goto error;
17461746
17471747 ret = iwl_mvm_sgom_init(mvm);
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+0−240
@@ -55,79 +55,6 @@ static const struct ieee80211_iface_combination iwl_mvm_iface_combinations[] = { · 54 unmodified lines
5555 },
5656 };
5757
58−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
59−/*
60− * Use the reserved field to indicate magic values.
61− * these values will only be used internally by the driver,
62− * and won't make it to the fw (reserved will be 0).
63− * BC_FILTER_MAGIC_IP - configure the val of this attribute to
64− * be the vif's ip address. in case there is not a single
65− * ip address (0, or more than 1), this attribute will
66− * be skipped.
67− * BC_FILTER_MAGIC_MAC - set the val of this attribute to
68− * the LSB bytes of the vif's mac address
69− */
70−enum {
71− BC_FILTER_MAGIC_NONE = 0,
72− BC_FILTER_MAGIC_IP,
73− BC_FILTER_MAGIC_MAC,
74−};
75−
76−static const struct iwl_fw_bcast_filter iwl_mvm_default_bcast_filters[] = {
77− {
78− /* arp */
79− .discard = 0,
80− .frame_type = BCAST_FILTER_FRAME_TYPE_ALL,
81− .attrs = {
82− {
83− /* frame type - arp, hw type - ethernet */
84− .offset_type =
85− BCAST_FILTER_OFFSET_PAYLOAD_START,
86− .offset = sizeof(rfc1042_header),
87− .val = cpu_to_be32(0x08060001),
88− .mask = cpu_to_be32(0xffffffff),
89− },
90− {
91− /* arp dest ip */
92− .offset_type =
93− BCAST_FILTER_OFFSET_PAYLOAD_START,
94− .offset = sizeof(rfc1042_header) + 2 +
95− sizeof(struct arphdr) +
96− ETH_ALEN + sizeof(__be32) +
97− ETH_ALEN,
98− .mask = cpu_to_be32(0xffffffff),
99− /* mark it as special field */
100− .reserved1 = cpu_to_le16(BC_FILTER_MAGIC_IP),
101− },
102− },
103− },
104− {
105− /* dhcp offer bcast */
106− .discard = 0,
107− .frame_type = BCAST_FILTER_FRAME_TYPE_IPV4,
108− .attrs = {
109− {
110− /* udp dest port - 68 (bootp client)*/
111− .offset_type = BCAST_FILTER_OFFSET_IP_END,
112− .offset = offsetof(struct udphdr, dest),
113− .val = cpu_to_be32(0x00440000),
114− .mask = cpu_to_be32(0xffff0000),
115− },
116− {
117− /* dhcp - lsb bytes of client hw address */
118− .offset_type = BCAST_FILTER_OFFSET_IP_END,
119− .offset = 38,
120− .mask = cpu_to_be32(0xffffffff),
121− /* mark it as special field */
122− .reserved1 = cpu_to_le16(BC_FILTER_MAGIC_MAC),
123− },
124− },
125− },
126− /* last filter must be empty */
127− {},
128−};
129−#endif
130−
13158 static const struct cfg80211_pmsr_capabilities iwl_mvm_pmsr_capa = {
13259 .max_peers = IWL_MVM_TOF_MAX_APS,
13360 .report_ap_tsf = 1,
@@ -693,11 +620,6 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) · 559 unmodified lines
693620 }
694621 #endif
695622
696−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
697− /* assign default bcast filtering configuration */
698− mvm->bcast_filters = iwl_mvm_default_bcast_filters;
699−#endif
700−
701623 ret = iwl_mvm_leds_init(mvm);
702624 if (ret)
703625 return ret;
@@ -1853,162 +1775,6 @@ static void iwl_mvm_config_iface_filter(struct ieee80211_hw *hw, · 1149 unmodified lines
18531775 mutex_unlock(&mvm->mutex);
18541776 }
18551777
1856−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
1857−struct iwl_bcast_iter_data {
1858− struct iwl_mvm *mvm;
1859− struct iwl_bcast_filter_cmd *cmd;
1860− u8 current_filter;
1861−};
1862−
1863−static void
1864−iwl_mvm_set_bcast_filter(struct ieee80211_vif *vif,
1865− const struct iwl_fw_bcast_filter *in_filter,
1866− struct iwl_fw_bcast_filter *out_filter)
1867−{
1868− struct iwl_fw_bcast_filter_attr *attr;
1869− int i;
1870−
1871− memcpy(out_filter, in_filter, sizeof(*out_filter));
1872−
1873− for (i = 0; i < ARRAY_SIZE(out_filter->attrs); i++) {
1874− attr = &out_filter->attrs[i];
1875−
1876− if (!attr->mask)
1877− break;
1878−
1879− switch (attr->reserved1) {
1880− case cpu_to_le16(BC_FILTER_MAGIC_IP):
1881− if (vif->bss_conf.arp_addr_cnt != 1) {
1882− attr->mask = 0;
1883− continue;
1884− }
1885−
1886− attr->val = vif->bss_conf.arp_addr_list[0];
1887− break;
1888− case cpu_to_le16(BC_FILTER_MAGIC_MAC):
1889− attr->val = *(__be32 *)&vif->addr[2];
1890− break;
1891− default:
1892− break;
1893− }
1894− attr->reserved1 = 0;
1895− out_filter->num_attrs++;
1896− }
1897−}
1898−
1899−static void iwl_mvm_bcast_filter_iterator(void *_data, u8 *mac,
1900− struct ieee80211_vif *vif)
1901−{
1902− struct iwl_bcast_iter_data *data = _data;
1903− struct iwl_mvm *mvm = data->mvm;
1904− struct iwl_bcast_filter_cmd *cmd = data->cmd;
1905− struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
1906− struct iwl_fw_bcast_mac *bcast_mac;
1907− int i;
1908−
1909− if (WARN_ON(mvmvif->id >= ARRAY_SIZE(cmd->macs)))
1910− return;
1911−
1912− bcast_mac = &cmd->macs[mvmvif->id];
1913−
1914− /*
1915− * enable filtering only for associated stations, but not for P2P
1916− * Clients
1917− */
1918− if (vif->type != NL80211_IFTYPE_STATION || vif->p2p ||
1919− !vif->bss_conf.assoc)
1920− return;
1921−
1922− bcast_mac->default_discard = 1;
1923−
1924− /* copy all configured filters */
1925− for (i = 0; mvm->bcast_filters[i].attrs[0].mask; i++) {
1926− /*
1927− * Make sure we don't exceed our filters limit.
1928− * if there is still a valid filter to be configured,
1929− * be on the safe side and just allow bcast for this mac.
1930− */
1931− if (WARN_ON_ONCE(data->current_filter >=
1932− ARRAY_SIZE(cmd->filters))) {
1933− bcast_mac->default_discard = 0;
1934− bcast_mac->attached_filters = 0;
1935− break;
1936− }
1937−
1938− iwl_mvm_set_bcast_filter(vif,
1939− &mvm->bcast_filters[i],
1940− &cmd->filters[data->current_filter]);
1941−
1942− /* skip current filter if it contains no attributes */
1943− if (!cmd->filters[data->current_filter].num_attrs)
1944− continue;
1945−
1946− /* attach the filter to current mac */
1947− bcast_mac->attached_filters |=
1948− cpu_to_le16(BIT(data->current_filter));
1949−
1950− data->current_filter++;
1951− }
1952−}
1953−
1954−bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm,
1955− struct iwl_bcast_filter_cmd *cmd)
1956−{
1957− struct iwl_bcast_iter_data iter_data = {
1958− .mvm = mvm,
1959− .cmd = cmd,
1960− };
1961−
1962− if (IWL_MVM_FW_BCAST_FILTER_PASS_ALL)
1963− return false;
1964−
1965− memset(cmd, 0, sizeof(*cmd));
1966− cmd->max_bcast_filters = ARRAY_SIZE(cmd->filters);
1967− cmd->max_macs = ARRAY_SIZE(cmd->macs);
1968−
1969−#ifdef CONFIG_IWLWIFI_DEBUGFS
1970− /* use debugfs filters/macs if override is configured */
1971− if (mvm->dbgfs_bcast_filtering.override) {
1972− memcpy(cmd->filters, &mvm->dbgfs_bcast_filtering.cmd.filters,
1973− sizeof(cmd->filters));
1974− memcpy(cmd->macs, &mvm->dbgfs_bcast_filtering.cmd.macs,
1975− sizeof(cmd->macs));
1976− return true;
1977− }
1978−#endif
1979−
1980− /* if no filters are configured, do nothing */
1981− if (!mvm->bcast_filters)
1982− return false;
1983−
1984− /* configure and attach these filters for each associated sta vif */
1985− ieee80211_iterate_active_interfaces(
1986− mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
1987− iwl_mvm_bcast_filter_iterator, &iter_data);
1988−
1989− return true;
1990−}
1991−
1992−static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm)
1993−{
1994− struct iwl_bcast_filter_cmd cmd;
1995−
1996− if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING))
1997− return 0;
1998−
1999− if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd))
2000− return 0;
2001−
2002− return iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0,
2003− sizeof(cmd), &cmd);
2004−}
2005−#else
2006−static inline int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm)
2007−{
2008− return 0;
2009−}
2010−#endif
2011−
20121778 static int iwl_mvm_update_mu_groups(struct iwl_mvm *mvm,
20131779 struct ieee80211_vif *vif)
20141780 {
@@ -2520,7 +2286,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, · 505 unmodified lines
25202286 }
25212287
25222288 iwl_mvm_recalc_multicast(mvm);
2523− iwl_mvm_configure_bcast_filter(mvm);
25242289
25252290 /* reset rssi values */
25262291 mvmvif->bf_data.ave_beacon_signal = 0;
@@ -2570,11 +2335,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, · 43 unmodified lines
25702335 }
25712336 }
25722337
2573− if (changes & BSS_CHANGED_ARP_FILTER) {
2574− IWL_DEBUG_MAC80211(mvm, "arp filter changed\n");
2575− iwl_mvm_configure_bcast_filter(mvm);
2576− }
2577−
25782338 if (changes & BSS_CHANGED_BANDWIDTH)
25792339 iwl_mvm_apply_fw_smps_request(vif);
25802340 }
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h+1−14
@@ -884,17 +884,6 @@ struct iwl_mvm { · 883 unmodified lines
884884 /* rx chain antennas set through debugfs for the scan command */
885885 u8 scan_rx_ant;
886886
887−#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
888− /* broadcast filters to configure for each associated station */
889− const struct iwl_fw_bcast_filter *bcast_filters;
890−#ifdef CONFIG_IWLWIFI_DEBUGFS
891− struct {
892− bool override;
893− struct iwl_bcast_filter_cmd cmd;
894− } dbgfs_bcast_filtering;
895−#endif
896−#endif
897−
898887 /* Internal station */
899888 struct iwl_mvm_int_sta aux_sta;
900889 struct iwl_mvm_int_sta snif_sta;
@@ -1593,8 +1582,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm); · 692 unmodified lines
15931582 int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm);
15941583
15951584 int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm);
1596−bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm,
1597− struct iwl_bcast_filter_cmd *cmd);
15981585
15991586 /*
16001587 * FW notifications / CMD responses handlers
@@ -2225,7 +2212,7 @@ static inline void iwl_mvm_mei_device_down(struct iwl_mvm *mvm) · 624 unmodified lines
22252212 static inline void iwl_mvm_mei_set_sw_rfkill_state(struct iwl_mvm *mvm)
22262213 {
22272214 bool sw_rfkill =
2228− mvm->hw_registered ? rfkill_blocked(mvm->hw->wiphy->rfkill) : false;
2215+ mvm->hw_registered ? rfkill_soft_blocked(mvm->hw->wiphy->rfkill) : false;
22292216
22302217 if (mvm->mei_registered)
22312218 iwl_mei_set_rfkill_state(iwl_mvm_is_radio_killed(mvm),
drivers/net/wireless/intel/iwlwifi/mvm/ops.c+0−1
@@ -469,7 +469,6 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = { · 468 unmodified lines
469469 HCMD_NAME(MCC_CHUB_UPDATE_CMD),
470470 HCMD_NAME(MARKER_CMD),
471471 HCMD_NAME(BT_PROFILE_NOTIFICATION),
472− HCMD_NAME(BCAST_FILTER_CMD),
473472 HCMD_NAME(MCAST_FILTER_CMD),
474473 HCMD_NAME(REPLY_SF_CFG_CMD),
475474 HCMD_NAME(REPLY_BEACON_FILTERING_CMD),
drivers/net/wireless/intel/iwlwifi/mvm/tx.c+1−1
@@ -1427,7 +1427,7 @@ static void iwl_mvm_hwrate_to_tx_status(const struct iwl_fw *fw, · 1426 unmodified lines
14271427 struct ieee80211_tx_rate *r = &info->status.rates[0];
14281428
14291429 if (iwl_fw_lookup_notif_ver(fw, LONG_GROUP,
1430− TX_CMD, 0) > 6)
1430+ TX_CMD, 0) <= 6)
14311431 rate_n_flags = iwl_new_rate_from_v1(rate_n_flags);
14321432
14331433 info->status.antenna =
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c+1−2
@@ -385,8 +385,7 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans, · 384 unmodified lines
385385 /* This may fail if AMT took ownership of the device */
386386 if (iwl_pcie_prepare_card_hw(trans)) {
387387 IWL_WARN(trans, "Exit HW not ready\n");
388− ret = -EIO;
389− goto out;
388+ return -EIO;
390389 }
391390
392391 iwl_enable_rfkill_int(trans);
drivers/net/wireless/intel/iwlwifi/pcie/trans.c+1−2
@@ -1329,8 +1329,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, · 1328 unmodified lines
13291329 /* This may fail if AMT took ownership of the device */
13301330 if (iwl_pcie_prepare_card_hw(trans)) {
13311331 IWL_WARN(trans, "Exit HW not ready\n");
1332− ret = -EIO;
1333− goto out;
1332+ return -EIO;
13341333 }
13351334
13361335 iwl_enable_rfkill_int(trans);
drivers/net/wireless/mac80211_hwsim.c+13−0
@@ -2336,6 +2336,15 @@ static void hw_scan_work(struct work_struct *work) · 2335 unmodified lines
23362336 if (req->ie_len)
23372337 skb_put_data(probe, req->ie, req->ie_len);
23382338
2339+ if (!ieee80211_tx_prepare_skb(hwsim->hw,
2340+ hwsim->hw_scan_vif,
2341+ probe,
2342+ hwsim->tmp_chan->band,
2343+ NULL)) {
2344+ kfree_skb(probe);
2345+ continue;
2346+ }
2347+
23392348 local_bh_disable();
23402349 mac80211_hwsim_tx_frame(hwsim->hw, probe,
23412350 hwsim->tmp_chan);
@@ -3770,6 +3779,10 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2, · 1428 unmodified lines
37703779 }
37713780 txi->flags |= IEEE80211_TX_STAT_ACK;
37723781 }
3782+
3783+ if (hwsim_flags & HWSIM_TX_CTL_NO_ACK)
3784+ txi->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
3785+
37733786 ieee80211_tx_status_irqsafe(data2->hw, skb);
37743787 return 0;
37753788 out:
drivers/nvme/host/core.c+10−2
@@ -368,6 +368,7 @@ EXPORT_SYMBOL_GPL(nvme_complete_rq); · 367 unmodified lines
368368
369369 void nvme_complete_batch_req(struct request *req)
370370 {
371+ trace_nvme_complete_rq(req);
371372 nvme_cleanup_cmd(req);
372373 nvme_end_req_zoned(req);
373374 }
@@ -4253,7 +4254,14 @@ static void nvme_async_event_work(struct work_struct *work) · 3879 unmodified lines
42534254 container_of(work, struct nvme_ctrl, async_event_work);
42544255
42554256 nvme_aen_uevent(ctrl);
4256− ctrl->ops->submit_async_event(ctrl);
4257+
4258+ /*
4259+ * The transport drivers must guarantee AER submission here is safe by
4260+ * flushing ctrl async_event_work after changing the controller state
4261+ * from LIVE and before freeing the admin queue.
4262+ */
4263+ if (ctrl->state == NVME_CTRL_LIVE)
4264+ ctrl->ops->submit_async_event(ctrl);
42574265 }
42584266
42594267 static bool nvme_ctrl_pp_status(struct nvme_ctrl *ctrl)
@@ -4566,7 +4574,7 @@ static void nvme_set_queue_dying(struct nvme_ns *ns) · 306 unmodified lines
45664574 if (test_and_set_bit(NVME_NS_DEAD, &ns->flags))
45674575 return;
45684576
4569− blk_set_queue_dying(ns->queue);
4577+ blk_mark_disk_dead(ns->disk);
45704578 nvme_start_ns_queue(ns);
45714579
45724580 set_capacity_and_notify(ns->disk, 0);
drivers/nvme/host/fabrics.c+1−2
@@ -1092,7 +1092,6 @@ static void __nvmf_concat_opt_tokens(struct seq_file *seq_file) · 1091 unmodified lines
10921092 static int nvmf_dev_show(struct seq_file *seq_file, void *private)
10931093 {
10941094 struct nvme_ctrl *ctrl;
1095− int ret = 0;
10961095
10971096 mutex_lock(&nvmf_dev_mutex);
10981097 ctrl = seq_file->private;
@@ -1106,7 +1105,7 @@ static int nvmf_dev_show(struct seq_file *seq_file, void *private) · 7 unmodified lines
11061105
11071106 out_unlock:
11081107 mutex_unlock(&nvmf_dev_mutex);
1109− return ret;
1108+ return 0;
11101109 }
11111110
11121111 static int nvmf_dev_open(struct inode *inode, struct file *file)
drivers/nvme/host/fabrics.h+1−0
@@ -170,6 +170,7 @@ nvmf_ctlr_matches_baseopts(struct nvme_ctrl *ctrl, · 169 unmodified lines
170170 struct nvmf_ctrl_options *opts)
171171 {
172172 if (ctrl->state == NVME_CTRL_DELETING ||
173+ ctrl->state == NVME_CTRL_DELETING_NOIO ||
173174 ctrl->state == NVME_CTRL_DEAD ||
174175 strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
175176 strcmp(opts->host->nqn, ctrl->opts->host->nqn) ||
drivers/nvme/host/multipath.c+1−1
@@ -848,7 +848,7 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head) · 847 unmodified lines
848848 {
849849 if (!head->disk)
850850 return;
851− blk_set_queue_dying(head->disk->queue);
851+ blk_mark_disk_dead(head->disk);
852852 /* make sure all pending bios are cleaned up */
853853 kblockd_schedule_work(&head->requeue_work);
854854 flush_work(&head->requeue_work);
drivers/nvme/host/pci.c+2−1
@@ -3391,7 +3391,8 @@ static const struct pci_device_id nvme_id_table[] = { · 3390 unmodified lines
33913391 NVME_QUIRK_DEALLOCATE_ZEROES, },
33923392 { PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */
33933393 .driver_data = NVME_QUIRK_STRIPE_SIZE |
3394− NVME_QUIRK_DEALLOCATE_ZEROES, },
3394+ NVME_QUIRK_DEALLOCATE_ZEROES |
3395+ NVME_QUIRK_IGNORE_DEV_SUBNQN, },
33953396 { PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */
33963397 .driver_data = NVME_QUIRK_STRIPE_SIZE |
33973398 NVME_QUIRK_DEALLOCATE_ZEROES, },
drivers/nvme/host/rdma.c+1−0
@@ -1200,6 +1200,7 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work) · 1199 unmodified lines
12001200 struct nvme_rdma_ctrl, err_work);
12011201
12021202 nvme_stop_keep_alive(&ctrl->ctrl);
1203+ flush_work(&ctrl->ctrl.async_event_work);
12031204 nvme_rdma_teardown_io_queues(ctrl, false);
12041205 nvme_start_queues(&ctrl->ctrl);
12051206 nvme_rdma_teardown_admin_queue(ctrl, false);
drivers/nvme/host/tcp.c+10−1
@@ -913,7 +913,15 @@ static inline void nvme_tcp_done_send_req(struct nvme_tcp_queue *queue) · 912 unmodified lines
913913
914914 static void nvme_tcp_fail_request(struct nvme_tcp_request *req)
915915 {
916− nvme_tcp_end_request(blk_mq_rq_from_pdu(req), NVME_SC_HOST_PATH_ERROR);
916+ if (nvme_tcp_async_req(req)) {
917+ union nvme_result res = {};
918+
919+ nvme_complete_async_event(&req->queue->ctrl->ctrl,
920+ cpu_to_le16(NVME_SC_HOST_PATH_ERROR), &res);
921+ } else {
922+ nvme_tcp_end_request(blk_mq_rq_from_pdu(req),
923+ NVME_SC_HOST_PATH_ERROR);
924+ }
917925 }
918926
919927 static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
@@ -2096,6 +2104,7 @@ static void nvme_tcp_error_recovery_work(struct work_struct *work) · 1176 unmodified lines
20962104 struct nvme_ctrl *ctrl = &tcp_ctrl->ctrl;
20972105
20982106 nvme_stop_keep_alive(ctrl);
2107+ flush_work(&ctrl->async_event_work);
20992108 nvme_tcp_teardown_io_queues(ctrl, false);
21002109 /* unquiesce to fail fast pending requests */
21012110 nvme_start_queues(ctrl);
drivers/parisc/ccio-dma.c+2−1
@@ -1003,7 +1003,7 @@ ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, · 1002 unmodified lines
10031003 ioc->usg_calls++;
10041004 #endif
10051005
1006− while(sg_dma_len(sglist) && nents--) {
1006+ while (nents && sg_dma_len(sglist)) {
10071007
10081008 #ifdef CCIO_COLLECT_STATS
10091009 ioc->usg_pages += sg_dma_len(sglist) >> PAGE_SHIFT;
@@ -1011,6 +1011,7 @@ ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, · 1 unmodified line
10111011 ccio_unmap_page(dev, sg_dma_address(sglist),
10121012 sg_dma_len(sglist), direction, 0);
10131013 ++sglist;
1014+ nents--;
10141015 }
10151016
10161017 DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents);
drivers/parisc/sba_iommu.c+2−1
@@ -1047,7 +1047,7 @@ sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, · 1046 unmodified lines
10471047 spin_unlock_irqrestore(&ioc->res_lock, flags);
10481048 #endif
10491049
1050− while (sg_dma_len(sglist) && nents--) {
1050+ while (nents && sg_dma_len(sglist)) {
10511051
10521052 sba_unmap_page(dev, sg_dma_address(sglist), sg_dma_len(sglist),
10531053 direction, 0);
@@ -1056,6 +1056,7 @@ sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, · 2 unmodified lines
10561056 ioc->usingle_calls--; /* kluge since call is unmap_sg() */
10571057 #endif
10581058 ++sglist;
1059+ nents--;
10591060 }
10601061
10611062 DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents);
drivers/pci/controller/cadence/pci-j721e.c+42−43
@@ -356,8 +356,8 @@ static int j721e_pcie_probe(struct platform_device *pdev) · 355 unmodified lines
356356 const struct j721e_pcie_data *data;
357357 struct cdns_pcie *cdns_pcie;
358358 struct j721e_pcie *pcie;
359− struct cdns_pcie_rc *rc;
360− struct cdns_pcie_ep *ep;
359+ struct cdns_pcie_rc *rc = NULL;
360+ struct cdns_pcie_ep *ep = NULL;
361361 struct gpio_desc *gpiod;
362362 void __iomem *base;
363363 struct clk *clk;
@@ -376,6 +376,46 @@ static int j721e_pcie_probe(struct platform_device *pdev) · 12 unmodified lines
376376 if (!pcie)
377377 return -ENOMEM;
378378
379+ switch (mode) {
380+ case PCI_MODE_RC:
381+ if (!IS_ENABLED(CONFIG_PCIE_CADENCE_HOST))
382+ return -ENODEV;
383+
384+ bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc));
385+ if (!bridge)
386+ return -ENOMEM;
387+
388+ if (!data->byte_access_allowed)
389+ bridge->ops = &cdns_ti_pcie_host_ops;
390+ rc = pci_host_bridge_priv(bridge);
391+ rc->quirk_retrain_flag = data->quirk_retrain_flag;
392+ rc->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
393+
394+ cdns_pcie = &rc->pcie;
395+ cdns_pcie->dev = dev;
396+ cdns_pcie->ops = &j721e_pcie_ops;
397+ pcie->cdns_pcie = cdns_pcie;
398+ break;
399+ case PCI_MODE_EP:
400+ if (!IS_ENABLED(CONFIG_PCIE_CADENCE_EP))
401+ return -ENODEV;
402+
403+ ep = devm_kzalloc(dev, sizeof(*ep), GFP_KERNEL);
404+ if (!ep)
405+ return -ENOMEM;
406+
407+ ep->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
408+
409+ cdns_pcie = &ep->pcie;
410+ cdns_pcie->dev = dev;
411+ cdns_pcie->ops = &j721e_pcie_ops;
412+ pcie->cdns_pcie = cdns_pcie;
413+ break;
414+ default:
415+ dev_err(dev, "INVALID device type %d\n", mode);
416+ return 0;
417+ }
418+
379419 pcie->mode = mode;
380420 pcie->linkdown_irq_regfield = data->linkdown_irq_regfield;
381421
@@ -426,28 +466,6 @@ static int j721e_pcie_probe(struct platform_device *pdev) · 44 unmodified lines
426466
427467 switch (mode) {
428468 case PCI_MODE_RC:
429− if (!IS_ENABLED(CONFIG_PCIE_CADENCE_HOST)) {
430− ret = -ENODEV;
431− goto err_get_sync;
432− }
433−
434− bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc));
435− if (!bridge) {
436− ret = -ENOMEM;
437− goto err_get_sync;
438− }
439−
440− if (!data->byte_access_allowed)
441− bridge->ops = &cdns_ti_pcie_host_ops;
442− rc = pci_host_bridge_priv(bridge);
443− rc->quirk_retrain_flag = data->quirk_retrain_flag;
444− rc->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
445−
446− cdns_pcie = &rc->pcie;
447− cdns_pcie->dev = dev;
448− cdns_pcie->ops = &j721e_pcie_ops;
449− pcie->cdns_pcie = cdns_pcie;
450−
451469 gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
452470 if (IS_ERR(gpiod)) {
453471 ret = PTR_ERR(gpiod);
@@ -497,23 +515,6 @@ static int j721e_pcie_probe(struct platform_device *pdev) · 43 unmodified lines
497515
498516 break;
499517 case PCI_MODE_EP:
500− if (!IS_ENABLED(CONFIG_PCIE_CADENCE_EP)) {
501− ret = -ENODEV;
502− goto err_get_sync;
503− }
504−
505− ep = devm_kzalloc(dev, sizeof(*ep), GFP_KERNEL);
506− if (!ep) {
507− ret = -ENOMEM;
508− goto err_get_sync;
509− }
510− ep->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
511−
512− cdns_pcie = &ep->pcie;
513− cdns_pcie->dev = dev;
514− cdns_pcie->ops = &j721e_pcie_ops;
515− pcie->cdns_pcie = cdns_pcie;
516−
517518 ret = cdns_pcie_init_phy(dev, cdns_pcie);
518519 if (ret) {
519520 dev_err(dev, "Failed to init phy\n");
@@ -525,8 +526,6 @@ static int j721e_pcie_probe(struct platform_device *pdev) · 5 unmodified lines
525526 goto err_pcie_setup;
526527
527528 break;
528− default:
529− dev_err(dev, "INVALID device type %d\n", mode);
530529 }
531530
532531 return 0;
drivers/pci/controller/dwc/pcie-kirin.c+18−13
@@ -756,22 +756,28 @@ static int __exit kirin_pcie_remove(struct platform_device *pdev) · 755 unmodified lines
756756 return 0;
757757 }
758758
759+struct kirin_pcie_data {
760+ enum pcie_kirin_phy_type phy_type;
761+};
762+
763+static const struct kirin_pcie_data kirin_960_data = {
764+ .phy_type = PCIE_KIRIN_INTERNAL_PHY,
765+};
766+
767+static const struct kirin_pcie_data kirin_970_data = {
768+ .phy_type = PCIE_KIRIN_EXTERNAL_PHY,
769+};
770+
759771 static const struct of_device_id kirin_pcie_match[] = {
760− {
761− .compatible = "hisilicon,kirin960-pcie",
762− .data = (void *)PCIE_KIRIN_INTERNAL_PHY
763− },
764− {
765− .compatible = "hisilicon,kirin970-pcie",
766− .data = (void *)PCIE_KIRIN_EXTERNAL_PHY
767− },
772+ { .compatible = "hisilicon,kirin960-pcie", .data = &kirin_960_data },
773+ { .compatible = "hisilicon,kirin970-pcie", .data = &kirin_970_data },
768774 {},
769775 };
770776
771777 static int kirin_pcie_probe(struct platform_device *pdev)
772778 {
773− enum pcie_kirin_phy_type phy_type;
774779 struct device *dev = &pdev->dev;
780+ const struct kirin_pcie_data *data;
775781 struct kirin_pcie *kirin_pcie;
776782 struct dw_pcie *pci;
777783 int ret;
@@ -781,13 +787,12 @@ static int kirin_pcie_probe(struct platform_device *pdev) · 3 unmodified lines
781787 return -EINVAL;
782788 }
783789
784− phy_type = (long)of_device_get_match_data(dev);
785− if (!phy_type) {
790+ data = of_device_get_match_data(dev);
791+ if (!data) {
786792 dev_err(dev, "OF data missing\n");
787793 return -EINVAL;
788794 }
789795
790−
791796 kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
792797 if (!kirin_pcie)
793798 return -ENOMEM;
@@ -800,7 +805,7 @@ static int kirin_pcie_probe(struct platform_device *pdev) · 6 unmodified lines
800805 pci->ops = &kirin_dw_pcie_ops;
801806 pci->pp.ops = &kirin_pcie_host_ops;
802807 kirin_pcie->pci = pci;
803− kirin_pcie->type = phy_type;
808+ kirin_pcie->type = data->phy_type;
804809
805810 ret = kirin_pcie_get_resource(kirin_pcie, pdev);
806811 if (ret)
drivers/pci/controller/pci-hyperv.c+11−2

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

drivers/pci/controller/pcie-mt7621.c+1−10

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

drivers/pci/msi/irqdomain.c+2−2

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

drivers/pci/msi/legacy.c+0−1

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

drivers/pci/msi/msi.c+2−1

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

drivers/pci/pcie/portdrv_core.c+17−30

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

drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c+2−1

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

drivers/phy/broadcom/Kconfig+1−2

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

drivers/phy/broadcom/phy-brcm-usb.c+38−0

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

drivers/phy/cadence/phy-cadence-sierra.c+21−14

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

drivers/phy/mediatek/phy-mtk-tphy.c+1−1

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

drivers/phy/phy-core-mipi-dphy.c+2−2

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

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

This diff is large: its 17 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-j721e-wiz.c+1−0

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

drivers/phy/xilinx/phy-zynqmp.c+6−5

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

drivers/pinctrl/Makefile+1−1

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

drivers/pinctrl/bcm/Kconfig+1−0

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

drivers/pinctrl/bcm/pinctrl-bcm2835.c+15−8

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

drivers/pinctrl/intel/pinctrl-cherryview.c+3−2

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

drivers/pinctrl/intel/pinctrl-intel.c+36−28

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

drivers/pinctrl/pinctrl-microchip-sgpio.c+2−1

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

drivers/pinctrl/pinctrl-thunderbay.c+35−55

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

drivers/pinctrl/pinctrl-zynqmp.c+4−6

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

drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c+4−4

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

drivers/platform/surface/Kconfig+1−0

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

drivers/platform/x86/amd-pmc.c+9−6

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

drivers/platform/x86/asus-tf103c-dock.c+2−2

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

drivers/platform/x86/intel/crystal_cove_charger.c+13−13

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

drivers/platform/x86/intel/speed_select_if/isst_if_common.c+63−34

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

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

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

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

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

drivers/platform/x86/x86-android-tablets.c+95−10

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

drivers/power/supply/bq256xx_charger.c+3−0

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

drivers/power/supply/cw2015_battery.c+1−1

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

drivers/regulator/core.c+3−10

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

drivers/regulator/max20086-regulator.c+2−1

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

drivers/remoteproc/Kconfig+4−0

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

drivers/remoteproc/qcom_q6v5.c+1−0

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

drivers/rpmsg/rpmsg_char.c+4−18

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

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

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

drivers/s390/scsi/zfcp_fc.c+12−1

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

drivers/scsi/3w-sas.c+0−4

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

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

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

drivers/scsi/bfa/bfad.c+0−6

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

drivers/scsi/bnx2fc/bnx2fc_fcoe.c+18−23

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

drivers/scsi/elx/libefc/efc_els.c+2−6

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

drivers/scsi/hisi_sas/hisi_sas_main.c+6−11

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

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+0−2

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

drivers/scsi/lpfc/lpfc.h+11−3

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

drivers/scsi/lpfc/lpfc_attr.c+5−2

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

drivers/scsi/lpfc/lpfc_els.c+19−1

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

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

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

drivers/scsi/lpfc/lpfc_nportdisc.c+3−2

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

drivers/scsi/lpfc/lpfc_sli.c+7−1

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

drivers/scsi/myrs.c+2−1

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

drivers/scsi/pm8001/pm8001_hwi.c+0−18

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

drivers/scsi/pm8001/pm8001_sas.c+5−0

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

drivers/scsi/pm8001/pm80xx_hwi.c+17−30

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

drivers/scsi/pm8001/pm80xx_hwi.h+5−1

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

drivers/scsi/qedf/qedf_io.c+1−0

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

drivers/scsi/qedf/qedf_main.c+5−2

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

drivers/scsi/qedi/qedi_fw.c+2−4

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

drivers/scsi/scsi_scan.c+50−5

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

drivers/scsi/ufs/ufshcd-pltfrm.c+7−0

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

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

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

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

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

drivers/soc/aspeed/aspeed-lpc-ctrl.c+3−4

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

drivers/soc/mediatek/mtk-scpsys.c+4−11

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

drivers/soc/samsung/Kconfig+1−1

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

drivers/spi/spi-bcm-qspi.c+1−1

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

drivers/spi/spi-meson-spicc.c+5−0

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

drivers/spi/spi-mt65xx.c+1−1

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

drivers/spi/spi-stm32-qspi.c+17−30

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

drivers/spi/spi-stm32.c+4−3

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

drivers/spi/spi-uniphier.c+14−4

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

drivers/staging/fbtft/fbtft.h+4−1

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

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c+18−2

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

drivers/target/iscsi/iscsi_target_tpg.c+3−0

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

drivers/tee/optee/core.c+1−0

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

drivers/tee/optee/ffa_abi.c+55−37

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

drivers/tee/optee/notif.c+1−1

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

drivers/tee/optee/optee_private.h+3−2

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

drivers/tee/optee/smc_abi.c+17−41

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

drivers/tty/n_gsm.c+3−1

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

drivers/tty/n_tty.c+4−6

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

drivers/tty/rpmsg_tty.c+26−14

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

drivers/tty/serial/8250/8250_gsc.c+1−1

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

drivers/tty/serial/8250/8250_of.c+10−1

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

drivers/tty/serial/8250/8250_pci.c+98−2

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

drivers/tty/serial/8250/8250_pericom.c+1−1

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

drivers/tty/serial/8250/8250_port.c+6−55

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

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

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

drivers/tty/serial/serial_core.c+12−22

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

drivers/tty/serial/stm32-usart.c+13−1

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

drivers/tty/vt/vt_ioctl.c+2−1

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

drivers/usb/cdns3/drd.c+3−3

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

drivers/usb/common/ulpi.c+12−5

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

drivers/usb/core/hcd.c+14−0

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

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

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

drivers/usb/core/urb.c+12−0

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

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

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

drivers/usb/dwc3/dwc3-xilinx.c+19−6

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

drivers/usb/dwc3/gadget.c+13−0

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

drivers/usb/gadget/composite.c+3−0

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

drivers/usb/gadget/function/f_fs.c+42−14

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

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

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

drivers/usb/gadget/function/f_uac2.c+2−2

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

drivers/usb/gadget/function/rndis.c+6−3

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

drivers/usb/gadget/legacy/raw_gadget.c+1−1

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

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

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

drivers/usb/gadget/udc/renesas_usb3.c+2−0

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

drivers/usb/host/xhci-plat.c+3−0

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

drivers/usb/misc/usb251xb.c+3−1

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

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

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

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

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

drivers/usb/serial/ftdi_sio.c+3−0

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

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

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

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

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

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

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

drivers/usb/typec/port-mapper.c+7−1

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

drivers/usb/typec/tcpm/tcpci.c+26−0

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

drivers/usb/typec/tcpm/tcpci.h+1−0

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

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

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

drivers/usb/typec/ucsi/ucsi_ccg.c+1−1

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

drivers/video/console/Kconfig+20−0

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

drivers/video/fbdev/core/bitblit.c+16−0

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

drivers/video/fbdev/core/fbcon.c+534−20

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

drivers/video/fbdev/core/fbcon.h+72−0

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

drivers/video/fbdev/core/fbcon_ccw.c+24−4

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

drivers/video/fbdev/core/fbcon_cw.c+24−4

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

drivers/video/fbdev/core/fbcon_rotate.h+9−0

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

drivers/video/fbdev/core/fbcon_ud.c+29−8

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

drivers/video/fbdev/core/fbmem.c+2−0

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

drivers/video/fbdev/core/tileblit.c+16−0

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

drivers/video/fbdev/hyperv_fb.c+3−13

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

drivers/video/fbdev/skeletonfb.c+6−6

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

drivers/xen/pci.c+1−1

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

fs/9p/fid.c+4−5

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

fs/Kconfig+2−2

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

fs/Makefile+1−1

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

fs/binfmt_elf.c+1−1

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

fs/binfmt_misc.c+1−5

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

fs/btrfs/block-group.c+37−2

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

fs/btrfs/ctree.h+6−0

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

fs/btrfs/ioctl.c+84−18

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

fs/btrfs/qgroup.c+19−2

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

fs/btrfs/send.c+4−0

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

fs/btrfs/transaction.c+34−2

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

fs/btrfs/transaction.h+2−0

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

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

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

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

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

fs/cachefiles/io.c+59−0

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

fs/ceph/caps.c+37−18

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

fs/ceph/file.c+9−0

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

fs/cifs/cifs_swn.c+3−3

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

fs/cifs/cifsacl.c+6−3

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

fs/cifs/cifsfs.c+1−0

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

fs/cifs/connect.c+41−13

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

fs/cifs/dfs_cache.c+1−1

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

fs/cifs/file.c+82−139

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

fs/cifs/fs_context.c+2−2

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

fs/cifs/fscache.c+108−18

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

fs/cifs/fscache.h+49−30

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

fs/cifs/inode.c+4−4

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

fs/cifs/sess.c+11−6

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

fs/cifs/smb1ops.c+1−3

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

fs/cifs/transport.c+1−4

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

fs/cifs/xattr.c+2−0

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

fs/configfs/dir.c+3−3

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

fs/devpts/inode.c+1−1

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

fs/erofs/data.c+4−4

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

fs/erofs/zdata.c+56−57

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

fs/erofs/zmap.c+7−0

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

fs/ext4/acl.c+4−4

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

fs/ext4/ext4.h+16−15

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

fs/ext4/ext4_jbd2.h+1−1

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

fs/ext4/extents.c+10−6

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

fs/ext4/fast_commit.c+78−55

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

fs/ext4/hash.c+1−1

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

fs/ext4/indirect.c+1−1

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

fs/ext4/inline.c+13−10

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

fs/ext4/inode.c+6−6

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

fs/ext4/ioctl.c+2−2

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

fs/ext4/mballoc.c+17−9

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

fs/ext4/migrate.c+1−1

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

fs/ext4/namei.c+8−8

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

fs/ext4/orphan.c+2−2

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

fs/ext4/super.c+7−7

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

fs/ext4/sysfs.c+4−4

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

fs/ext4/xattr.c+3−3

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

fs/f2fs/dir.c+5−5

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

fs/f2fs/f2fs.h+1−1

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

fs/f2fs/hash.c+1−1

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

fs/f2fs/namei.c+2−2

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

fs/f2fs/recovery.c+2−2

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

fs/f2fs/super.c+5−5

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

fs/f2fs/sysfs.c+5−5

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

fs/file_table.c+6−0

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

fs/gfs2/file.c+4−3

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

fs/gfs2/glock.c+0−3

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

fs/io_uring.c+11−8

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

fs/iomap/buffered-io.c+48−4

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

fs/jbd2/commit.c+4−17

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

fs/jbd2/journal.c+7−1

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

fs/jbd2/transaction.c+32−21

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

fs/ksmbd/auth.c+27−0

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

fs/ksmbd/smb2pdu.c+35−10

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

fs/ksmbd/smb_common.c+4−1

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

fs/ksmbd/transport_rdma.c+1−1

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

fs/ksmbd/vfs.h+1−0

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

fs/libfs.c+5−5

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

fs/lockd/svcsubs.c+10−8

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

fs/namei.c+5−5

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

fs/namespace.c+30−0

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

fs/nfs/callback.h+1−1

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

fs/nfs/callback_proc.c+1−1

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

fs/nfs/callback_xdr.c+9−9

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

fs/nfs/client.c+8−1

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

fs/nfs/dir.c+136−34

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

fs/nfs/filelayout/filelayout.h+1−1

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

fs/nfs/filelayout/filelayoutdev.c+1−3

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

fs/nfs/inode.c+3−6

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

fs/nfs/internal.h+1−0

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

fs/nfs/nfs3proc.c+3−2

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

fs/nfs/nfs42proc.c+8−5

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

fs/nfs/nfs4_fs.h+9−5

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

fs/nfs/nfs4client.c+4−1

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

fs/nfs/nfs4namespace.c+12−7

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

fs/nfs/nfs4proc.c+159−44

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

fs/nfs/nfs4state.c+5−1

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

fs/nfs/nfs4xdr.c+44−5

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

fs/nfs/sysfs.c+2−1

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

fs/nfsd/nfs3proc.c+11−8

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

fs/nfsd/nfs3xdr.c+2−2

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

fs/nfsd/nfs4proc.c+9−4

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

fs/nfsd/nfs4state.c+3−1

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

fs/nfsd/nfs4xdr.c+3−7

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

fs/nfsd/nfsctl.c+3−2

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

fs/nfsd/trace.h+7−7

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

fs/nfsd/vfs.c+40−17

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

fs/nfsd/vfs.h+2−2

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

fs/notify/fanotify/fanotify_user.c+3−6

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

fs/ocfs2/stackglue.c+1−12

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

fs/ocfs2/suballoc.c+11−14

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

fs/overlayfs/copy_up.c+13−3

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

fs/proc/task_mmu.c+31−9

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

fs/quota/dquot.c+8−3

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

fs/super.c+12−7

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

fs/sync.c+12−6

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

fs/udf/inode.c+4−5

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

fs/unicode/Kconfig+5−13

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

fs/unicode/Makefile+4−2

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

fs/xfs/xfs_aops.c+15−1

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

fs/xfs/xfs_bmap_util.c+3−6

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

fs/xfs/xfs_file.c+26−60

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

fs/xfs/xfs_inode.h+0−9

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

fs/xfs/xfs_ioctl.c+1−1

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

fs/xfs/xfs_pnfs.c+39−3

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

fs/xfs/xfs_super.c+5−1

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

include/crypto/internal/blake2s.h+25−15

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

include/dt-bindings/clock/dra7.h+7−7

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

include/linux/ata.h+1−1

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

include/linux/blkdev.h+3−1

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

include/linux/ceph/libceph.h+1−0

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

include/linux/ceph/messenger.h+5−0

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

include/linux/compiler.h+5−16

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

include/linux/ethtool.h+1−1

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

include/linux/fb.h+1−1

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

include/linux/fs.h+1−1

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

include/linux/fsnotify.h+43−6

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

include/linux/hyperv.h+1−0

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

include/linux/if_vlan.h+4−2

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

include/linux/iomap.h+2−0

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

include/linux/jbd2.h+4−9

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

include/linux/kfence.h+2−0

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

include/linux/kvm_host.h+109−3

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

include/linux/libata.h+1−0

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

include/linux/lsm_hook_defs.h+1−1

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

include/linux/memcontrol.h+3−2

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

include/linux/mm.h+12−5

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

include/linux/mm_types.h+1−0

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

include/linux/netdevice.h+2−1

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

include/linux/netfs.h+7−0

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

include/linux/nfs.h+0−8

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

include/linux/nfs_fs.h+7−4

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

include/linux/nfs_fs_sb.h+3−1

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

include/linux/nfs_xdr.h+4−1

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

include/linux/page_table_check.h+19−0

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

include/linux/perf_event.h+3−12

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

include/linux/pgtable.h+1−0

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

include/linux/pid_namespace.h+5−0

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

include/linux/psi.h+1−1

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

include/linux/psi_types.h+0−3

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

include/linux/quota.h+1−1

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

include/linux/sched.h+0−5

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

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

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

include/linux/skbuff.h+1−1

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

include/linux/suspend.h+3−12

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

include/linux/sysctl.h+1−1

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

include/linux/usb/role.h+6−0

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

include/net/addrconf.h+2−2

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

include/net/ax25.h+12−0

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

include/net/bond_3ad.h+1−1

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

include/net/bonding.h+1−1

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

include/net/dsa.h+1−0

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

include/net/dst_metadata.h+13−1

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

include/net/ip.h+10−11

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

include/net/ip6_fib.h+7−5

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

include/net/ipv6.h+4−1

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

include/net/neighbour.h+13−5

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

include/net/netns/ipv6.h+2−1

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

include/net/route.h+1−1

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

include/net/tcp.h+4−0

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

include/sound/pcm.h+15−0

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

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

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

include/trace/events/sunrpc.h+45−25

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

include/trace/perf.h+3−2

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

include/trace/trace_events.h+5−4

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

include/uapi/linux/cyclades.h+35−0

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

include/uapi/linux/kvm.h+4−3

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

include/uapi/linux/netfilter/nf_conntrack_common.h+1−1

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

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

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

include/uapi/linux/smc_diag.h+5−6

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

include/uapi/sound/asound.h+3−1

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

include/uapi/xen/gntdev.h+7−1

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

include/xen/xenbus_dev.h+0−2

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

ipc/sem.c+2−2

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

kernel/async.c+0−3

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

kernel/audit.c+43−19

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

kernel/auditsc.c+1−1

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

kernel/bpf/bpf_lsm.c+1−1

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

kernel/bpf/ringbuf.c+1−1

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

kernel/bpf/stackmap.c+3−2

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

kernel/bpf/trampoline.c+3−2

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

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

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

kernel/cgroup/cgroup.c+8−3

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

kernel/cgroup/cpuset.c+51−14

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

kernel/cred.c+2−7

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

kernel/events/core.c+183−106

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

kernel/fork.c+20−10

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

kernel/locking/lockdep.c+2−2

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

kernel/module.c+5−20

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

kernel/module_decompress.c+2−0

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

kernel/power/main.c+4−1

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

kernel/power/process.c+1−1

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

kernel/power/snapshot.c+7−14

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

kernel/power/suspend.c+0−2

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

kernel/power/wakelock.c+4−7

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

kernel/printk/sysctl.c+1−1

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

kernel/rcu/tasks.h+8−4

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

kernel/sched/core.c+20−18

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

kernel/sched/core_sched.c+1−1

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

kernel/sched/fair.c+77−41

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

kernel/sched/membarrier.c+5−4

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

kernel/sched/pelt.h+3−1

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

kernel/sched/psi.c+29−37

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

kernel/seccomp.c+10−0

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

kernel/signal.c+3−2

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

kernel/stackleak.c+2−3

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

kernel/sys.c+14−6

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

kernel/trace/Kconfig+7−1

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

kernel/trace/trace.c+6−1

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

kernel/trace/trace_events_hist.c+8−2

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

kernel/ucount.c+4−1

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

lib/crypto/blake2s.c+2−2

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

lib/sbitmap.c+6−2

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

lib/test_kasan.c+5−0

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

mm/debug_vm_pgtable.c+2−0

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

mm/gup.c+30−5

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

mm/kfence/core.c+2−1

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

mm/kfence/kfence_test.c+4−4

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

mm/khugepaged.c+21−16

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

mm/kmemleak.c+7−6

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

mm/memcontrol.c+5−5

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

mm/memory-failure.c+6−0

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

mm/mprotect.c+1−1

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

mm/page_isolation.c+1−1

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

mm/page_table_check.c+27−28

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

mm/vmscan.c+3−1

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

net/8021q/vlan.h+1−1

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

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

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

net/8021q/vlan_netlink.c+4−3

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

net/ax25/af_ax25.c+20−8

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

net/ax25/ax25_dev.c+23−5

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

net/ax25/ax25_route.c+11−2

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

net/bridge/br_multicast.c+4−0

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

net/bridge/br_vlan.c+5−4

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

net/bridge/netfilter/nft_reject_bridge.c+4−4

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

net/can/isotp.c+22−7

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

net/ceph/ceph_common.c+7−0

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

net/ceph/messenger.c+4−0

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

net/ceph/messenger_v1.c+48−6

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

net/ceph/messenger_v2.c+186−64

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

net/core/drop_monitor.c+9−2

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

net/core/neighbour.c+12−6

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

net/core/net-procfs.c+34−4

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

net/core/rtnetlink.c+8−4

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

net/core/skbuff.c+1−1

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

net/dsa/dsa.c+1−0

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

net/dsa/dsa2.c+6−19

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

net/dsa/dsa_priv.h+0−1

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

net/dsa/tag_lan9303.c+7−14

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

net/ieee802154/nl802154.c+4−4

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

net/ipv4/fib_frontend.c+3−0

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

net/ipv4/fib_lookup.h+3−4

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

net/ipv4/fib_semantics.c+3−3

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

net/ipv4/fib_trie.c+13−9

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

net/ipv4/ip_output.c+21−5

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

net/ipv4/ipmr.c+2−0

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

net/ipv4/netfilter/Kconfig+0−4

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

net/ipv4/ping.c+10−2

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

net/ipv4/raw.c+4−1

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

net/ipv4/route.c+2−2

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

net/ipv4/tcp.c+20−11

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

net/ipv4/tcp_input.c+2−0

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

net/ipv4/tcp_ipv4.c+1−1

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

net/ipv6/addrconf.c+22−9

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

net/ipv6/ip6_fib.c+13−10

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

net/ipv6/ip6_flowlabel.c+3−1

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

net/ipv6/ip6_tunnel.c+4−4

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

net/ipv6/ip6mr.c+2−0

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

net/ipv6/mcast.c+1−1

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

net/ipv6/netfilter/Kconfig+0−4

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

net/ipv6/netfilter/Makefile+0−3

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

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

Empty file deleted.

net/ipv6/route.c+11−10

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

net/mac80211/mlme.c+21−8

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

net/mctp/route.c+6−5

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

net/mpls/af_mpls.c+1−1

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

net/mptcp/pm_netlink.c+34−13

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

net/mptcp/protocol.h+3−3

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

net/netfilter/nf_conntrack_core.c+5−3

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

net/netfilter/nf_conntrack_netbios_ns.c+3−2

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

net/netfilter/nf_conntrack_netlink.c+2−1

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

net/netfilter/nf_conntrack_proto_sctp.c+9−0

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

net/netfilter/nf_conntrack_proto_tcp.c+41−18

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

net/netfilter/nf_tables_api.c+1−4

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

net/netfilter/nft_byteorder.c+12−0

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

net/netfilter/nft_connlimit.c+10−1

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

net/netfilter/nft_ct.c+4−1

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

net/netfilter/nft_exthdr.c+1−1

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

net/netfilter/nft_payload.c+5−4

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

net/netfilter/nft_synproxy.c+3−1

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

net/netfilter/xt_socket.c+1−1

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

net/packet/af_packet.c+8−2

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

net/rxrpc/call_event.c+3−5

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

net/rxrpc/output.c+1−1

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

net/sched/act_api.c+10−3

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

net/sched/cls_api.c+10−7

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

net/sched/sch_api.c+13−11

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

net/sched/sch_generic.c+16−13

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

net/sched/sch_htb.c+20−0

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

net/smc/af_smc.c+171−25

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

net/smc/smc.h+19−1

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

net/smc/smc_diag.c+0−2

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

net/smc/smc_pnet.c+5−3

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

net/socket.c+2−2

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

net/sunrpc/auth_gss/gss_generic_token.c+2−4

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

net/sunrpc/clnt.c+4−1

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

net/sunrpc/rpc_pipe.c+2−2

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

net/sunrpc/sysfs.c+31−21

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

net/sunrpc/xprtrdma/backchannel.c+0−4

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

net/sunrpc/xprtrdma/frwr_ops.c+0−4

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

net/sunrpc/xprtrdma/rpc_rdma.c+0−4

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

net/sunrpc/xprtrdma/transport.c+0−4

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

net/sunrpc/xprtrdma/verbs.c+3−23

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

net/sunrpc/xprtsock.c+7−2

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

net/tipc/crypto.c+1−1

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

net/tipc/link.c+7−2

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

net/tipc/monitor.c+2−0

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

net/tipc/name_distr.c+1−1

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

net/tipc/node.c+7−6

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

net/vmw_vsock/af_vsock.c+1−0

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

net/wireless/core.c+4−13

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

samples/seccomp/dropper.c+7−2

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

scripts/Makefile+1−1

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

scripts/Makefile.extrawarn+1−0

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

scripts/kconfig/confdata.c+15−10

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

scripts/kconfig/preprocess.c+1−1

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

security/integrity/digsig_asymmetric.c+9−6

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

security/integrity/ima/ima_fs.c+1−1

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

security/integrity/ima/ima_policy.c+8−0

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

security/integrity/ima/ima_template.c+7−3

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

security/integrity/integrity_audit.c+2−0

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

security/security.c+13−2

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

security/selinux/ss/conditional.c+2−1

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

sound/core/memalloc.c+10−5

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

sound/core/pcm_native.c+13−0

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

sound/hda/intel-sdw-acpi.c+3−4

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

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

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

sound/pci/hda/hda_codec.c+4−0

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

sound/pci/hda/hda_generic.c+15−2

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

sound/pci/hda/hda_generic.h+3−0

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

sound/pci/hda/hda_intel.c+4−2

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

sound/pci/hda/patch_realtek.c+66−13

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

sound/soc/amd/acp/acp-mach-common.c+2−2

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

sound/soc/amd/acp/acp-mach.h+0−1

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

sound/soc/amd/acp/acp-sof-mach.c+2−2

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

sound/soc/codecs/cpcap.c+2−0

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

sound/soc/codecs/hdmi-codec.c+1−1

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

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

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

sound/soc/codecs/max9759.c+2−1

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

sound/soc/codecs/rt5668.c+7−5

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

sound/soc/codecs/rt5682-i2c.c+4−11

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

sound/soc/codecs/rt5682.c+14−20

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

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

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

sound/soc/codecs/rt5682s.c+7−5

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

sound/soc/codecs/tas2770.c+6−1

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

sound/soc/codecs/wcd938x.c+17−14

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

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

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

sound/soc/fsl/pcm030-audio-fabric.c+8−3

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

sound/soc/generic/simple-card.c+25−1

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

sound/soc/intel/skylake/skl.c+1−0

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

sound/soc/mediatek/Kconfig+1−1

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

sound/soc/qcom/lpass-platform.c+4−4

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

sound/soc/qcom/qdsp6/q6apm-dai.c+5−2

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

sound/soc/soc-acpi.c+2−5

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

sound/soc/soc-ops.c+57−13

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

sound/soc/soc-pcm.c+12−6

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

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

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

sound/soc/xilinx/xlnx_formatter_pcm.c+24−3

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

sound/usb/implicit.c+2−2

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

sound/usb/mixer.c+7−6

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

sound/usb/quirks-table.h+1−1

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

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

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

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

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

tools/bpf/resolve_btfids/Makefile+5−1

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

tools/bpf/runqslower/runqslower.bpf.c+1−1

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

tools/bpf/runqslower/runqslower.c+1−1

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

tools/bpf/runqslower/runqslower.h+1−1

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

tools/include/uapi/linux/kvm.h+4−3

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

tools/include/uapi/linux/lirc.h+0−229

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

tools/include/uapi/linux/perf_event.h+5−3

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

tools/include/uapi/linux/prctl.h+3−0

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

tools/include/uapi/sound/asound.h+9−2

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

tools/lib/perf/include/internal/cpumap.h+1−5

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

tools/lib/perf/include/perf/cpumap.h+5−0

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

tools/lib/perf/libperf.map+1−0

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

tools/lib/perf/mmap.c+98−0

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

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

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

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

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

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

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

tools/lib/subcmd/subcmd-util.h+2−9

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

tools/objtool/check.c+1−1

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

tools/perf/builtin-ftrace.c+24−21

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

tools/perf/builtin-trace.c+18−5

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

tools/perf/tests/attr/README+2−0

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

tools/perf/tests/attr/test-record-graph-default+2−0

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

tools/perf/tests/attr/test-record-graph-default-aarch64+9−0

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

tools/perf/tests/attr/test-record-graph-fp+2−0

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

tools/perf/tests/attr/test-record-graph-fp-aarch64+9−0

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

tools/perf/trace/beauty/prctl_option.sh+1−1

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

tools/perf/util/annotate.c+1−0

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

tools/perf/util/bpf-loader.c+2−1

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

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

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

tools/perf/util/cs-etm.c+7−9

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

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

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

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

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

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

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

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

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

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

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

tools/perf/util/stat-display.c+10−9

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

tools/perf/util/synthetic-events.c+19−0

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

tools/scripts/Makefile.include+1−1

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

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

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

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

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

tools/testing/scatterlist/linux/mm.h+2−1

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

tools/testing/selftests/arm64/fp/sve-ptrace.c+9−2

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

tools/testing/selftests/bpf/test_lirc_mode2_user.c+0−1

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

tools/testing/selftests/clone3/clone3.c+0−2

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

tools/testing/selftests/cpufreq/main.sh+1−1

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

tools/testing/selftests/exec/Makefile+3−3

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

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

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

tools/testing/selftests/futex/Makefile+2−2

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

tools/testing/selftests/ir/ir_loopback.c+10−0

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

tools/testing/selftests/kselftest_harness.h+3−1

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

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

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

tools/testing/selftests/kvm/include/kvm_util_base.h+0−1

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

tools/testing/selftests/kvm/include/x86_64/processor.h+1−0

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

tools/testing/selftests/kvm/lib/kvm_util.c+0−7

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

tools/testing/selftests/kvm/lib/x86_64/processor.c+21−6

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

tools/testing/selftests/kvm/x86_64/amx_test.c+2−0

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

tools/testing/selftests/kvm/x86_64/smm_test.c+0−1

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

tools/testing/selftests/mincore/mincore_selftest.c+14−6

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

tools/testing/selftests/mount_setattr/mount_setattr_test.c+2−2

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

tools/testing/selftests/net/ioam6_parser.c+1−4

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

tools/testing/selftests/net/mptcp/mptcp_join.sh+4−2

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

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

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

tools/testing/selftests/netfilter/nft_concat_range.sh+72−2

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

tools/testing/selftests/netfilter/nft_fib.sh+1−0

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

tools/testing/selftests/netfilter/nft_nat.sh+152−0

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

tools/testing/selftests/netfilter/nft_synproxy.sh+117−0

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

tools/testing/selftests/netfilter/nft_zones_many.sh+6−6

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

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

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

tools/testing/selftests/openat2/helpers.h+7−5

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

tools/testing/selftests/openat2/openat2_test.c+11−1

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

tools/testing/selftests/perf_events/sigtrap_threads.c+9−8

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

tools/testing/selftests/pidfd/pidfd.h+10−3

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

tools/testing/selftests/pidfd/pidfd_fdinfo_test.c+18−4

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

tools/testing/selftests/pidfd/pidfd_test.c+3−3

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

tools/testing/selftests/pidfd/pidfd_wait.c+2−3

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

tools/testing/selftests/rtc/settings+1−1

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

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

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

tools/testing/selftests/vDSO/vdso_test_abi.c+62−73

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

tools/testing/selftests/vm/userfaultfd.c+7−2

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

tools/testing/selftests/zram/zram.sh+1−14

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

tools/testing/selftests/zram/zram01.sh+9−24

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

tools/testing/selftests/zram/zram02.sh+0−1

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

tools/testing/selftests/zram/zram_lib.sh+88−46

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

tools/tracing/Makefile+14−4

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

tools/tracing/rtla/Makefile+4−2

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

tools/tracing/rtla/src/osnoise.c+3−0

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

tools/tracing/rtla/src/osnoise_hist.c+3−4

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

tools/tracing/rtla/src/osnoise_top.c+3−4

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

tools/tracing/rtla/src/timerlat_hist.c+3−4

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

tools/tracing/rtla/src/timerlat_top.c+3−4

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

tools/tracing/rtla/src/trace.c+4−4

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

tools/tracing/rtla/src/utils.c+2−2

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

usr/include/Makefile+1−0

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

virt/kvm/eventfd.c+4−4

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

virt/kvm/kvm_main.c+3−5

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