History

Merge tag 'v7.0-rc4' into togreg

Linux 7.0-rc4 Required for the ds4422 series which is build upon; 5187e03b817c ("iio: dac: ds4424: reject -128 RAW value")

Jonathan Cameron committed 7 months ago

Commit 9e4e86a2 parents e8b8349 f338e771405 files · +17925 −9135Browse files

Unified · Split

1405 files
  1. .mailmap +13 −2
  2. CREDITS +8 −0
  3. Documentation/ABI/testing/sysfs-block-zram +2 −2
  4. Documentation/ABI/testing/sysfs-driver-uniwill-laptop +5 −5
  5. Documentation/admin-guide/blockdev/zram.rst +3 −3
  6. Documentation/admin-guide/kernel-parameters.txt +16 −0
  7. Documentation/admin-guide/laptops/uniwill-laptop.rst +1 −1
  8. Documentation/admin-guide/sysctl/net.rst +3 −0
  9. Documentation/devicetree/bindings/display/msm/dp-controller.yaml +20 −1
  10. Documentation/devicetree/bindings/display/msm/qcom,glymur-mdss.yaml +10 −6
  11. Documentation/devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml +1 −1
  12. Documentation/devicetree/bindings/hwmon/kontron,sl28cpld-hwmon.yaml +0 −1
  13. Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml +1 −1
  14. Documentation/devicetree/bindings/net/can/nxp,sja1000.yaml +1 −0
  15. Documentation/devicetree/bindings/powerpc/fsl/fsl,mpc83xx.yaml +93 −0
  16. Documentation/devicetree/bindings/regulator/mt6359-regulator.yaml +2 −2
  17. Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml +1 −0
  18. Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml +1 −0
  19. Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml +24 −5
  20. Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +1 −30
  21. Documentation/hwmon/emc1403.rst +1 −1
  22. Documentation/hwmon/index.rst +0 −1
  23. Documentation/hwmon/sa67.rst +0 −41
  24. Documentation/netlink/specs/nfsd.yaml +2 −2
  25. Documentation/scheduler/sched-ext.rst +27 −3
  26. Documentation/sound/alsa-configuration.rst +4 −0
  27. Documentation/virt/kvm/api.rst +121 −115
  28. Documentation/virt/kvm/locking.rst +2 −0
  29. MAINTAINERS +57 −65
  30. Makefile +9 −5
  31. arch/alpha/kernel/vmlinux.lds.S +1 −0
  32. arch/arc/kernel/vmlinux.lds.S +1 −0
  33. arch/arm/boot/compressed/vmlinux.lds.S +1 −0
  34. arch/arm/kernel/vmlinux-xip.lds.S +1 −0
  35. arch/arm/kernel/vmlinux.lds.S +1 −0
  36. arch/arm64/include/asm/cmpxchg.h +7 −5
  37. arch/arm64/include/asm/io.h +20 −6
  38. arch/arm64/include/asm/kvm_host.h +5 −1
  39. arch/arm64/include/asm/kvm_nested.h +2 −0
  40. arch/arm64/include/asm/pgtable-prot.h +5 −8
  41. arch/arm64/include/asm/runtime-const.h +4 −0
  42. arch/arm64/include/asm/tlbflush.h +37 −26
  43. arch/arm64/kernel/acpi.c +1 −1
  44. arch/arm64/kernel/cpufeature.c +9 −0
  45. arch/arm64/kernel/sys_compat.c +1 −1
  46. arch/arm64/kernel/topology.c +15 −6
  47. arch/arm64/kernel/vmlinux.lds.S +1 −0
  48. arch/arm64/kvm/Kconfig +0 −1
  49. arch/arm64/kvm/arm.c +0 −1
  50. arch/arm64/kvm/at.c +2 −27
  51. arch/arm64/kvm/guest.c +2 −2
  52. arch/arm64/kvm/hyp/nvhe/mem_protect.c +1 −1
  53. arch/arm64/kvm/hyp/nvhe/mm.c +1 −1
  54. arch/arm64/kvm/hyp/nvhe/pkvm.c +34 −3
  55. arch/arm64/kvm/hyp/nvhe/tlb.c +4 −4
  56. arch/arm64/kvm/hyp/pgtable.c +1 −1
  57. arch/arm64/kvm/hyp/vhe/tlb.c +5 −5
  58. arch/arm64/kvm/mmu.c +14 −12
  59. arch/arm64/kvm/nested.c +47 −43
  60. arch/arm64/kvm/sys_regs.c +3 −0
  61. arch/arm64/kvm/vgic/vgic-init.c +16 −16
  62. arch/arm64/kvm/vgic/vgic-v2.c +2 −2
  63. arch/arm64/kvm/vgic/vgic-v3.c +6 −6
  64. arch/arm64/kvm/vgic/vgic.c +6 −0
  65. arch/arm64/lib/delay.c +5 −1
  66. arch/arm64/mm/contpte.c +49 −4
  67. arch/arm64/mm/ioremap.c +3 −3
  68. arch/arm64/mm/mmap.c +10 −2
  69. arch/arm64/net/bpf_jit_comp.c +1 −1
  70. arch/csky/kernel/vmlinux.lds.S +1 −0
  71. arch/hexagon/kernel/vmlinux.lds.S +1 −0
  72. arch/loongarch/kernel/vmlinux.lds.S +1 −0
  73. arch/loongarch/kvm/Kconfig +0 −1
  74. arch/loongarch/kvm/vcpu.c +1 −1
  75. arch/loongarch/kvm/vm.c +1 −2
  76. arch/m68k/kernel/vmlinux-nommu.lds +1 −0
  77. arch/m68k/kernel/vmlinux-std.lds +1 −0
  78. arch/m68k/kernel/vmlinux-sun3.lds +1 −0
  79. arch/mips/kernel/vmlinux.lds.S +1 −0
  80. arch/mips/kvm/Kconfig +0 −1
  81. arch/mips/kvm/mips.c +2 −3
  82. arch/nios2/kernel/vmlinux.lds.S +1 −0
  83. arch/openrisc/kernel/vmlinux.lds.S +1 −0
  84. arch/parisc/boot/compressed/vmlinux.lds.S +1 −0
  85. arch/parisc/include/asm/pgtable.h +1 −1
  86. arch/parisc/kernel/head.S +6 −1
  87. arch/parisc/kernel/setup.c +12 −8
  88. arch/parisc/kernel/vmlinux.lds.S +1 −0
  89. arch/powerpc/Kconfig +2 −2
  90. arch/powerpc/boot/dts/asp834x-redboot.dts +1 −1
  91. arch/powerpc/boot/dts/fsl/interlaken-lac-portals.dtsi +0 −156
  92. arch/powerpc/boot/dts/fsl/interlaken-lac.dtsi +0 −45
  93. arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi +0 −43
  94. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi +0 −80
  95. arch/powerpc/boot/dts/mpc8308_p1m.dts +1 −1
  96. arch/powerpc/boot/dts/mpc8308rdb.dts +1 −1
  97. arch/powerpc/boot/dts/mpc8313erdb.dts +35 −26
  98. arch/powerpc/boot/dts/mpc8315erdb.dts +64 −55
  99. arch/powerpc/boot/dts/mpc832x_rdb.dts +1 −1
  100. arch/powerpc/boot/dts/mpc8349emitx.dts +1 −1
  101. arch/powerpc/boot/dts/mpc8349emitxgp.dts +1 −1
  102. arch/powerpc/boot/dts/mpc8377_rdb.dts +1 −1
  103. arch/powerpc/boot/dts/mpc8377_wlan.dts +1 −1
  104. arch/powerpc/boot/dts/mpc8378_rdb.dts +1 −1
  105. arch/powerpc/boot/dts/mpc8379_rdb.dts +1 −1
  106. arch/powerpc/include/asm/nohash/32/pgtable.h +1 −3
  107. arch/powerpc/include/asm/nohash/32/pte-85xx.h +0 −59
  108. arch/powerpc/include/asm/pgtable-types.h +1 −1
  109. arch/powerpc/include/asm/uaccess.h +46 −21
  110. arch/powerpc/kernel/head_85xx.S +1 −45
  111. arch/powerpc/kernel/iommu.c +1 −1
  112. arch/powerpc/kernel/pci_of_scan.c +7 −0
  113. arch/powerpc/kernel/prom_init.c +2 −1
  114. arch/powerpc/kernel/setup-common.c +0 −10
  115. arch/powerpc/kernel/trace/ftrace.c +22 −4
  116. arch/powerpc/kernel/vmlinux.lds.S +1 −0
  117. arch/powerpc/kexec/core.c +9 −8
  118. arch/powerpc/kexec/file_load_64.c +13 −1
  119. arch/powerpc/kvm/Kconfig +0 −4
  120. arch/powerpc/kvm/book3s.c +2 −2
  121. arch/powerpc/kvm/booke.c +2 −2
  122. arch/powerpc/kvm/e500.h +1 −5
  123. arch/powerpc/kvm/e500_mmu.c +2 −2
  124. arch/powerpc/kvm/e500_mmu_host.c +44 −47
  125. arch/powerpc/kvm/powerpc.c +0 −6
  126. arch/powerpc/lib/copyuser_64.S +1 −0
  127. arch/powerpc/lib/copyuser_power7.S +15 −30
  128. arch/powerpc/lib/vmx-helper.c +2 −0
  129. arch/powerpc/mm/mem.c +14 −0
  130. arch/powerpc/net/bpf_jit.h +0 −5
  131. arch/powerpc/net/bpf_jit_comp.c +56 −71
  132. arch/powerpc/net/bpf_jit_comp64.c +143 −38
  133. arch/powerpc/perf/callchain.c +5 −0
  134. arch/powerpc/perf/callchain_32.c +0 −1
  135. arch/powerpc/perf/callchain_64.c +0 −1
  136. arch/powerpc/platforms/83xx/km83xx.c +2 −2
  137. arch/powerpc/platforms/Kconfig.cputype +2 −2
  138. arch/powerpc/platforms/pseries/msi.c +1 −1
  139. arch/powerpc/tools/check-fpatchable-function-entry.sh +0 −0
  140. arch/powerpc/tools/ftrace-gen-ool-stubs.sh +2 −2
  141. arch/riscv/kernel/vmlinux.lds.S +1 −0
  142. arch/riscv/kvm/Kconfig +0 −1
  143. arch/riscv/kvm/aia.c +13 −2
  144. arch/riscv/kvm/aia_aplic.c +12 −11
  145. arch/riscv/kvm/aia_device.c +14 −4
  146. arch/riscv/kvm/aia_imsic.c +4 −0
  147. arch/riscv/kvm/mmu.c +5 −1
  148. arch/riscv/kvm/vcpu.c +1 −1
  149. arch/riscv/kvm/vcpu_fp.c +13 −4
  150. arch/riscv/kvm/vcpu_onereg.c +36 −18
  151. arch/riscv/kvm/vcpu_pmu.c +12 −4
  152. arch/riscv/kvm/vm.c +1 −2
  153. arch/s390/include/asm/idle.h +2 −2
  154. arch/s390/include/asm/processor.h +1 −1
  155. arch/s390/include/asm/vtime.h +34 −0
  156. arch/s390/kernel/entry.h +0 −2
  157. arch/s390/kernel/idle.c +5 −20
  158. arch/s390/kernel/ipl.c +1 −1
  159. arch/s390/kernel/irq.c +8 −2
  160. arch/s390/kernel/vmlinux.lds.S +1 −0
  161. arch/s390/kernel/vtime.c +10 −32
  162. arch/s390/kvm/Kconfig +0 −2
  163. arch/s390/kvm/kvm-s390.c +2 −3
  164. arch/s390/lib/xor.c +5 −6
  165. arch/s390/mm/pfault.c +2 −2
  166. arch/sh/kernel/vmlinux.lds.S +1 −0
  167. arch/sparc/kernel/iommu.c +2 −0
  168. arch/sparc/kernel/pci.c +7 −0
  169. arch/sparc/kernel/pci_sun4v.c +2 −0
  170. arch/sparc/kernel/vmlinux.lds.S +1 −0
  171. arch/um/drivers/ubd_kern.c +5 −5
  172. arch/um/kernel/dyn.lds.S +1 −0
  173. arch/um/kernel/uml.lds.S +1 −0
  174. arch/x86/boot/compressed/Makefile +1 −0
  175. arch/x86/boot/compressed/sev.c +5 −4
  176. arch/x86/boot/compressed/vmlinux.lds.S +1 −1
  177. arch/x86/boot/startup/sev-shared.c +1 −1
  178. arch/x86/coco/sev/core.c +1 −0
  179. arch/x86/entry/entry_fred.c +2 −3
  180. arch/x86/entry/vdso/vdso32/sigreturn.S +30 −0
  181. arch/x86/events/intel/uncore_snbep.c +27 −1
  182. arch/x86/include/asm/bug.h +3 −3
  183. arch/x86/include/asm/cfi.h +8 −4
  184. arch/x86/include/asm/efi.h +1 −1
  185. arch/x86/include/asm/irqflags.h +2 −2
  186. arch/x86/include/asm/kvm_host.h +2 −1
  187. arch/x86/include/asm/linkage.h +2 −2
  188. arch/x86/include/asm/msr-index.h +4 −1
  189. arch/x86/include/asm/numa.h +6 −0
  190. arch/x86/include/asm/percpu.h +1 −1
  191. arch/x86/include/asm/pgtable_64.h +0 −2
  192. arch/x86/include/asm/runtime-const.h +3 −3
  193. arch/x86/include/asm/topology.h +6 −0
  194. arch/x86/include/asm/traps.h +2 −0
  195. arch/x86/include/uapi/asm/kvm.h +1 −0
  196. arch/x86/kernel/alternative.c +22 −7
  197. arch/x86/kernel/apic/apic.c +6 −0
  198. arch/x86/kernel/cpu/common.c +3 −0
  199. arch/x86/kernel/cpu/resctrl/monitor.c +5 −31
  200. arch/x86/kernel/cpu/topology.c +11 −2
  201. arch/x86/kernel/head_64.S +0 −28
  202. arch/x86/kernel/smpboot.c +145 −56
  203. arch/x86/kernel/traps.c +1 −1
  204. arch/x86/kernel/vmlinux.lds.S +1 −0
  205. arch/x86/kvm/Kconfig +0 −1
  206. arch/x86/kvm/cpuid.c +4 −1
  207. arch/x86/kvm/hyperv.c +5 −4
  208. arch/x86/kvm/ioapic.c +2 −1
  209. arch/x86/kvm/svm/avic.c +6 −3
  210. arch/x86/kvm/svm/nested.c +10 −2
  211. arch/x86/kvm/svm/svm.c +11 −6
  212. arch/x86/kvm/svm/svm.h +1 −0
  213. arch/x86/kvm/vmx/nested.c +45 −16
  214. arch/x86/kvm/vmx/nested.h +1 −0
  215. arch/x86/kvm/vmx/vmx.c +7 −3
  216. arch/x86/kvm/x86.c +2 −3
  217. arch/x86/mm/extable.c +2 −5
  218. arch/x86/mm/numa.c +8 −0
  219. arch/x86/mm/srat.c +2 −0
  220. arch/x86/net/bpf_jit_comp.c +2 −11
  221. arch/x86/platform/efi/efi.c +1 −1
  222. arch/x86/platform/efi/quirks.c +52 −3
  223. arch/x86/platform/pvh/enlighten.c +1 −6
  224. arch/x86/xen/enlighten_pv.c +1 −1
  225. arch/x86/xen/mmu_pv.c +9 −0
  226. block/blk-map.c +1 −2
  227. block/blk-mq.c +30 −15
  228. block/blk-sysfs.c +7 −1
  229. block/elevator.c +11 −1
  230. crypto/Kconfig +0 −9
  231. crypto/testmgr.c +2 −2
  232. drivers/accel/amdxdna/aie2_ctx.c +17 −28
  233. drivers/accel/amdxdna/aie2_message.c +38 −13
  234. drivers/accel/amdxdna/aie2_pci.c +64 −38
  235. drivers/accel/amdxdna/aie2_pci.h +1 −0
  236. drivers/accel/amdxdna/aie2_pm.c +1 −1
  237. drivers/accel/amdxdna/amdxdna_ctx.c +48 −13
  238. drivers/accel/amdxdna/amdxdna_ctx.h +3 −0
  239. drivers/accel/amdxdna/amdxdna_gem.c +19 −19
  240. drivers/accel/amdxdna/amdxdna_mailbox.c +45 −46
  241. drivers/accel/amdxdna/amdxdna_mailbox.h +17 −14
  242. drivers/accel/amdxdna/amdxdna_pci_drv.c +3 −0
  243. drivers/accel/amdxdna/amdxdna_pm.c +2 −0
  244. drivers/accel/amdxdna/amdxdna_pm.h +11 −0
  245. drivers/accel/amdxdna/amdxdna_ubuf.c +5 −1
  246. drivers/accel/amdxdna/npu1_regs.c +2 −2
  247. drivers/accel/amdxdna/npu4_regs.c +1 −1
  248. drivers/accel/amdxdna/npu5_regs.c +1 −1
  249. drivers/accel/amdxdna/npu6_regs.c +1 −1
  250. drivers/accel/ethosu/ethosu_gem.c +10 −4
  251. drivers/accel/ethosu/ethosu_job.c +18 −8
  252. drivers/accel/ivpu/ivpu_hw_40xx_reg.h +0 −6
  253. drivers/accel/ivpu/ivpu_hw_ip.c +0 −1
  254. drivers/acpi/Kconfig +1 −0
  255. drivers/acpi/acpi_platform.c +1 −1
  256. drivers/acpi/acpi_video.c +22 −23
  257. drivers/acpi/acpica/acpredef.h +3 −2
  258. drivers/acpi/device_pm.c +0 −9
  259. drivers/acpi/osi.c +13 −0
  260. drivers/acpi/osl.c +1 −1
  261. drivers/acpi/scan.c +45 −0
  262. drivers/acpi/sleep.c +8 −0
  263. drivers/android/binder/page_range.rs +64 −20
  264. drivers/android/binder/process.rs +2 −1
  265. drivers/android/binder/range_alloc/array.rs +33 −2
  266. drivers/android/binder/range_alloc/mod.rs +2 −2
  267. drivers/android/binder/range_alloc/tree.rs +9 −9
  268. drivers/android/binder/thread.rs +6 −11
  269. drivers/ata/libata-core.c +5 −5
  270. drivers/ata/libata-eh.c +20 −3
  271. drivers/ata/libata-scsi.c +1 −0
  272. drivers/base/base.h +1 −10
  273. drivers/base/dd.c +1 −1
  274. drivers/base/property.c +13 −14
  275. drivers/block/drbd/drbd_actlog.c +23 −30
  276. drivers/block/drbd/drbd_interval.h +4 −1
  277. drivers/block/drbd/drbd_main.c +9 −5
  278. drivers/block/drbd/drbd_receiver.c +2 −2
  279. drivers/block/drbd/drbd_req.c +2 −1
  280. drivers/block/ublk_drv.c +12 −4
  281. drivers/block/zloop.c +24 −7
  282. drivers/block/zram/zram_drv.c +12 −12
  283. drivers/block/zram/zram_drv.h +1 −1
  284. drivers/bluetooth/hci_qca.c +14 −10
  285. drivers/char/ipmi/ipmi_ipmb.c +5 −0
  286. drivers/char/ipmi/ipmi_msghandler.c +95 −46
  287. drivers/char/ipmi/ipmi_si_intf.c +24 −13
  288. drivers/char/ipmi/ipmi_si_ls2k.c +1 −1
  289. drivers/char/random.c +1 −11
  290. drivers/clk/imx/clk-imx8qxp.c +23 −1
  291. drivers/clk/imx/clk-scu.c +11 −1
  292. drivers/clk/imx/clk-scu.h +2 −0
  293. drivers/cpufreq/intel_pstate.c +8 −6
  294. drivers/cpuidle/cpuidle.c +0 −10
  295. drivers/crypto/atmel-sha204a.c +3 −2
  296. drivers/crypto/ccp/sev-dev-tsm.c +1 −1
  297. drivers/crypto/ccp/sev-dev.c +4 −6
  298. drivers/cxl/core/core.h +18 −0
  299. drivers/cxl/core/hdm.c +1 −1
  300. drivers/cxl/core/mbox.c +9 −2
  301. drivers/cxl/core/memdev.c +9 −4
  302. drivers/cxl/core/pmem.c +32 −10
  303. drivers/cxl/core/port.c +18 −34
  304. drivers/cxl/core/region.c +2 −2
  305. drivers/cxl/cxl.h +7 −0
  306. drivers/cxl/pmem.c +21 −1
  307. drivers/dpll/zl3073x/core.c +2 −5
  308. drivers/dpll/zl3073x/core.h +28 −0
  309. drivers/dpll/zl3073x/dpll.c +5 −2
  310. drivers/dpll/zl3073x/ref.c +20 −5
  311. drivers/dpll/zl3073x/regs.h +1 −0
  312. drivers/firewire/ohci.c +1 −1
  313. drivers/firmware/cirrus/cs_dsp.c +18 −6
  314. drivers/firmware/efi/mokvar-table.c +1 −1
  315. drivers/firmware/stratix10-rsu.c +2 −0
  316. drivers/firmware/stratix10-svc.c +126 −102
  317. drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +4 −3
  318. drivers/gpio/gpiolib-shared.c +3 −3
  319. drivers/gpio/gpiolib.c +6 −2
  320. drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +1 −0
  321. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +5 −1
  322. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +23 −8
  323. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 −1
  324. drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +8 −8
  325. drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c +7 −5
  326. drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +81 −35
  327. drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h +4 −0
  328. drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +33 −31
  329. drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0 −5
  330. drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +4 −6
  331. drivers/gpu/drm/amd/amdgpu/psp_v15_0.c +10 −10
  332. drivers/gpu/drm/amd/amdgpu/soc21.c +3 −1
  333. drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +4 −0
  334. drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +1 −0
  335. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +4 −2
  336. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c +2 −1
  337. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +8 −8
  338. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +8 −0
  339. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +2 −2
  340. drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.h +5 −1
  341. drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c +20 −1
  342. drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.h +7 −1
  343. drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.h +4 −1
  344. drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.h +4 −1
  345. drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +5 −1
  346. drivers/gpu/drm/amd/include/asic_reg/mp/mp_15_0_0_offset.h +18 −0
  347. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +9 −2
  348. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +4 −2
  349. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +2 −1
  350. drivers/gpu/drm/bridge/samsung-dsim.c +14 −9
  351. drivers/gpu/drm/bridge/synopsys/dw-dp.c +3 −1
  352. drivers/gpu/drm/bridge/ti-sn65dsi83.c +7 −6
  353. drivers/gpu/drm/bridge/ti-sn65dsi86.c +4 −2
  354. drivers/gpu/drm/drm_client_modeset.c +2 −1
  355. drivers/gpu/drm/drm_gpusvm.c +5 −5
  356. drivers/gpu/drm/drm_pagemap.c +2 −12
  357. drivers/gpu/drm/gud/gud_drv.c +8 −1
  358. drivers/gpu/drm/gud/gud_internal.h +4 −0
  359. drivers/gpu/drm/gud/gud_pipe.c +36 −18
  360. drivers/gpu/drm/i915/display/intel_alpm.c +1 −12
  361. drivers/gpu/drm/i915/display/intel_display.c +0 −1
  362. drivers/gpu/drm/i915/display/intel_dp.c +7 −0
  363. drivers/gpu/drm/i915/display/intel_psr.c +56 −15
  364. drivers/gpu/drm/i915/display/intel_vdsc.c +23 −0
  365. drivers/gpu/drm/i915/display/intel_vdsc.h +3 −0
  366. drivers/gpu/drm/i915/display/intel_vdsc_regs.h +12 −0
  367. drivers/gpu/drm/i915/display/intel_vrr.c +14 −0
  368. drivers/gpu/drm/i915/gem/i915_gem_shmem.c +9 −3
  369. drivers/gpu/drm/imx/ipuv3/parallel-display.c +3 −1
  370. drivers/gpu/drm/logicvc/logicvc_drm.c +2 −2
  371. drivers/gpu/drm/msm/adreno/a2xx_gpummu.c +1 −1
  372. drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 −2
  373. drivers/gpu/drm/msm/adreno/a8xx_gpu.c +12 −2
  374. drivers/gpu/drm/msm/adreno/adreno_device.c +1 −0
  375. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h +6 −6
  376. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h +6 −6
  377. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_4_sa8775p.h +2 −2
  378. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h +6 −6
  379. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_1_sar2130p.h +6 −6
  380. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_2_x1e80100.h +6 −6
  381. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c +1 −1
  382. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c +3 −1
  383. drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +14 −38
  384. drivers/gpu/drm/msm/dsi/dsi_host.c +31 −12
  385. drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c +11 −11
  386. drivers/gpu/drm/nouveau/nouveau_connector.c +3 −0
  387. drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +6 −6
  388. drivers/gpu/drm/panthor/panthor_sched.c +5 −4
  389. drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c +15 −1
  390. drivers/gpu/drm/scheduler/sched_main.c +1 −0
  391. drivers/gpu/drm/sitronix/st7586.c +6 −9
  392. drivers/gpu/drm/solomon/ssd130x.c +2 −4
  393. drivers/gpu/drm/tiny/sharp-memory.c +2 −2
  394. drivers/gpu/drm/ttm/tests/ttm_bo_test.c +2 −2
  395. drivers/gpu/drm/ttm/ttm_bo.c +5 −6
  396. drivers/gpu/drm/ttm/ttm_pool_internal.h +1 −1
  397. drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +4 −0
  398. drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +2 −2
  399. drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c +8 −1
  400. drivers/gpu/drm/xe/regs/xe_engine_regs.h +6 −0
  401. drivers/gpu/drm/xe/xe_configfs.c +1 −0
  402. drivers/gpu/drm/xe/xe_exec_queue.c +11 −12
  403. drivers/gpu/drm/xe/xe_gsc_proxy.c +35 −8
  404. drivers/gpu/drm/xe/xe_gsc_types.h +2 −0
  405. drivers/gpu/drm/xe/xe_gt.c +54 −12
  406. drivers/gpu/drm/xe/xe_lrc.h +2 −1
  407. drivers/gpu/drm/xe/xe_reg_sr.c +3 −1
  408. drivers/gpu/drm/xe/xe_ring_ops.c +9 −0
  409. drivers/gpu/drm/xe/xe_sync.c +21 −9
  410. drivers/gpu/drm/xe/xe_vm_madvise.c +2 −1
  411. drivers/gpu/drm/xe/xe_wa.c +7 −6
  412. drivers/gpu/nova-core/gsp.rs +24 −22
  413. drivers/gpu/nova-core/gsp/boot.rs +1 −1
  414. drivers/gpu/nova-core/gsp/cmdq.rs +33 −60
  415. drivers/gpu/nova-core/gsp/fw.rs +69 −32
  416. drivers/hid/hid-apple.c +4 −3
  417. drivers/hid/hid-asus.c +14 −4
  418. drivers/hid/hid-cmedia.c +1 −1
  419. drivers/hid/hid-creative-sb0540.c +1 −1
  420. drivers/hid/hid-ids.h +1 −0
  421. drivers/hid/hid-magicmouse.c +2 −4
  422. drivers/hid/hid-mcp2221.c +2 −0
  423. drivers/hid/hid-multitouch.c +38 −5
  424. drivers/hid/hid-zydacron.c +1 −1
  425. drivers/hid/intel-ish-hid/ipc/hw-ish.h +2 −0
  426. drivers/hid/intel-ish-hid/ipc/pci-ish.c +12 −0
  427. drivers/hid/usbhid/hid-pidff.c +7 −4
  428. drivers/hwmon/Kconfig +2 −14
  429. drivers/hwmon/Makefile +0 −1
  430. drivers/hwmon/aht10.c +4 −2
  431. drivers/hwmon/it87.c +4 −1
  432. drivers/hwmon/macsmc-hwmon.c +27 −26
  433. drivers/hwmon/max6639.c +1 −1
  434. drivers/hwmon/pmbus/q54sj108a2.c +10 −9
  435. drivers/hwmon/sa67mcu-hwmon.c +0 −161
  436. drivers/i2c/busses/i2c-i801.c +10 −4
  437. drivers/i3c/Kconfig +12 −0
  438. drivers/i3c/master/dw-i3c-master.c +4 −2
  439. drivers/i3c/master/mipi-i3c-hci/cmd.h +1 −0
  440. drivers/i3c/master/mipi-i3c-hci/cmd_v1.c +3 −5
  441. drivers/i3c/master/mipi-i3c-hci/cmd_v2.c +3 −5
  442. drivers/i3c/master/mipi-i3c-hci/core.c +90 −53
  443. drivers/i3c/master/mipi-i3c-hci/dma.c +84 −74
  444. drivers/i3c/master/mipi-i3c-hci/hci.h +5 −0
  445. drivers/i3c/master/mipi-i3c-hci/pio.c +5 −11
  446. drivers/iio/adc/ad7768-1.c +11 −2
  447. drivers/iio/chemical/bme680_core.c +1 −1
  448. drivers/iio/chemical/sps30_i2c.c +1 −1
  449. drivers/iio/chemical/sps30_serial.c +1 −1
  450. drivers/iio/dac/ds4424.c +1 −1
  451. drivers/iio/frequency/adf4377.c +1 −1
  452. drivers/iio/gyro/mpu3050-core.c +13 −5
  453. drivers/iio/gyro/mpu3050-i2c.c +1 −2
  454. drivers/iio/imu/adis.c +1 −1
  455. drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +2 −0
  456. drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c +4 −0
  457. drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +2 −0
  458. drivers/iio/imu/inv_icm45600/inv_icm45600.h +1 −1
  459. drivers/iio/imu/inv_icm45600/inv_icm45600_core.c +8 −3
  460. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +8 −0
  461. drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +2 −0
  462. drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +4 −1
  463. drivers/iio/industrialio-buffer.c +4 −2
  464. drivers/iio/light/bh1780.c +1 −1
  465. drivers/iio/magnetometer/Kconfig +1 −2
  466. drivers/iio/magnetometer/tlv493d.c +1 −1
  467. drivers/iio/potentiometer/mcp4131.c +1 −1
  468. drivers/iio/proximity/hx9023s.c +4 −2
  469. drivers/infiniband/Kconfig +1 −0
  470. drivers/infiniband/core/cache.c +13 −0
  471. drivers/infiniband/core/cma.c +5 −1
  472. drivers/infiniband/core/core_priv.h +3 −0
  473. drivers/infiniband/core/device.c +33 −1
  474. drivers/infiniband/core/umem_dmabuf.c +1 −3
  475. drivers/infiniband/core/uverbs_std_types_dmabuf.c +2 −0
  476. drivers/infiniband/hw/bng_re/bng_dev.c +19 −37
  477. drivers/infiniband/hw/efa/efa_verbs.c +1 −1
  478. drivers/infiniband/hw/ionic/ionic_controlpath.c +1 −1
  479. drivers/infiniband/hw/ionic/ionic_ibdev.c +2 −0
  480. drivers/infiniband/hw/irdma/verbs.c +1 −1
  481. drivers/infiniband/hw/mthca/mthca_provider.c +3 −2
  482. drivers/irqchip/irq-gic-v3-its.c +4 −0
  483. drivers/irqchip/irq-gic-v5-irs.c +1 −1
  484. drivers/irqchip/irq-ls-extirq.c +34 −19
  485. drivers/irqchip/irq-mmp.c +1 −1
  486. drivers/irqchip/irq-riscv-aplic-main.c +17 −4
  487. drivers/irqchip/irq-sifive-plic.c +6 −1
  488. drivers/media/dvb-core/dmxdev.c +3 −1
  489. drivers/media/dvb-core/dvb_net.c +3 −0
  490. drivers/misc/amd-sbi/Kconfig +1 −2
  491. drivers/mmc/host/dw_mmc-rockchip.c +37 −1
  492. drivers/mmc/host/mmci_qcom_dml.c +1 −0
  493. drivers/mmc/host/sdhci-brcmstb.c +1 −1
  494. drivers/net/bonding/bond_main.c +70 −9
  495. drivers/net/bonding/bond_options.c +2 −0
  496. drivers/net/caif/caif_serial.c +3 −0
  497. drivers/net/can/dev/calc_bittiming.c +1 −1
  498. drivers/net/can/dummy_can.c +1 −0
  499. drivers/net/can/spi/hi311x.c +4 −1
  500. drivers/net/can/spi/mcp251x.c +14 −1
  501. drivers/net/can/usb/ems_usb.c +6 −1
  502. drivers/net/can/usb/esd_usb.c +17 −13
  503. drivers/net/can/usb/etas_es58x/es58x_core.c +7 −1
  504. drivers/net/can/usb/f81604.c +40 −5
  505. drivers/net/can/usb/gs_usb.c +16 −6
  506. drivers/net/can/usb/ucan.c +1 −1
  507. drivers/net/dsa/microchip/ksz_ptp.c +8 −3
  508. drivers/net/dsa/mxl862xx/mxl862xx.c +0 −1
  509. drivers/net/dsa/realtek/rtl8365mb.c +2 −3
  510. drivers/net/dsa/realtek/rtl8366rb-leds.c +3 −3
  511. drivers/net/dsa/sja1105/sja1105_main.c +11 −5
  512. drivers/net/ethernet/amd/xgbe/xgbe-common.h +1 −1
  513. drivers/net/ethernet/amd/xgbe/xgbe-drv.c +10 −19
  514. drivers/net/ethernet/amd/xgbe/xgbe-main.c +0 −1
  515. drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +75 −7
  516. drivers/net/ethernet/amd/xgbe/xgbe.h +4 −3
  517. drivers/net/ethernet/arc/emac_main.c +11 −0
  518. drivers/net/ethernet/broadcom/bnxt/bnxt.c +7 −6
  519. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 −2
  520. drivers/net/ethernet/broadcom/genet/bcmgenet.c +12 −19
  521. drivers/net/ethernet/broadcom/genet/bcmgenet.h +1 −4
  522. drivers/net/ethernet/broadcom/genet/bcmmii.c +5 −5
  523. drivers/net/ethernet/cadence/macb_main.c +95 −3
  524. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +9 −1
  525. drivers/net/ethernet/freescale/enetc/enetc.c +1 −1
  526. drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c +10 −14
  527. drivers/net/ethernet/google/gve/gve_tx_dqo.c +25 −31
  528. drivers/net/ethernet/intel/e1000/e1000_main.c +0 −2
  529. drivers/net/ethernet/intel/e1000e/defines.h +1 −0
  530. drivers/net/ethernet/intel/e1000e/e1000.h +3 −1
  531. drivers/net/ethernet/intel/e1000e/hw.h +0 −2
  532. drivers/net/ethernet/intel/e1000e/ich8lan.c +30 −1
  533. drivers/net/ethernet/intel/e1000e/netdev.c +7 −10
  534. drivers/net/ethernet/intel/i40e/i40e_main.c +24 −17
  535. drivers/net/ethernet/intel/i40e/i40e_trace.h +1 −1
  536. drivers/net/ethernet/intel/i40e/i40e_txrx.c +3 −2
  537. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +7 −7
  538. drivers/net/ethernet/intel/iavf/iavf.h +1 −2
  539. drivers/net/ethernet/intel/iavf/iavf_ethtool.c +6 −13
  540. drivers/net/ethernet/intel/iavf/iavf_main.c +44 −54
  541. drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +0 −1
  542. drivers/net/ethernet/intel/ice/devlink/devlink.c +2 −2
  543. drivers/net/ethernet/intel/ice/ice.h +1 −0
  544. drivers/net/ethernet/intel/ice/ice_base.c +14 −24
  545. drivers/net/ethernet/intel/ice/ice_common.c +11 −4
  546. drivers/net/ethernet/intel/ice/ice_ethtool.c +28 −23
  547. drivers/net/ethernet/intel/ice/ice_idc.c +34 −10
  548. drivers/net/ethernet/intel/ice/ice_lib.c +10 −5
  549. drivers/net/ethernet/intel/ice/ice_main.c +6 −1
  550. drivers/net/ethernet/intel/ice/ice_txrx.c +3 −1
  551. drivers/net/ethernet/intel/ice/ice_xsk.c +3 −0
  552. drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 −3
  553. drivers/net/ethernet/intel/idpf/idpf_lib.c +1 −0
  554. drivers/net/ethernet/intel/idpf/idpf_txrx.c +10 −4
  555. drivers/net/ethernet/intel/idpf/xdp.c +5 −1
  556. drivers/net/ethernet/intel/idpf/xsk.c +1 −0
  557. drivers/net/ethernet/intel/igb/igb_xsk.c +30 −8
  558. drivers/net/ethernet/intel/igc/igc_main.c +24 −10
  559. drivers/net/ethernet/intel/igc/igc_ptp.c +2 −1
  560. drivers/net/ethernet/intel/ixgbevf/vf.c +2 −1
  561. drivers/net/ethernet/intel/libeth/xsk.c +1 −0
  562. drivers/net/ethernet/intel/libie/fwlog.c +4 −0
  563. drivers/net/ethernet/marvell/octeon_ep/octep_main.c +28 −12
  564. drivers/net/ethernet/marvell/octeon_ep/octep_rx.c +19 −8
  565. drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c +28 −10
  566. drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c +20 −8
  567. drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +3 −3
  568. drivers/net/ethernet/mediatek/mtk_eth_soc.c +12 −3
  569. drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +0 −1
  570. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +1 −2
  571. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +1 −1
  572. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +9 −14
  573. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +4 −3
  574. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 −0
  575. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +27 −20
  576. drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +6 −2
  577. drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c +4 −4
  578. drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h +5 −0
  579. drivers/net/ethernet/mellanox/mlx5/core/sriov.c +2 −0
  580. drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c +2 −2
  581. drivers/net/ethernet/microsoft/mana/gdma_main.c +5 −1
  582. drivers/net/ethernet/microsoft/mana/mana_en.c +21 −6
  583. drivers/net/ethernet/spacemit/k1_emac.c +13 −6
  584. drivers/net/ethernet/stmicro/stmmac/stmmac.h +1 −0
  585. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +48 −6
  586. drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c +31 −29
  587. drivers/net/ethernet/ti/am65-cpsw-nuss.c +10 −8
  588. drivers/net/ethernet/ti/am65-cpsw-nuss.h +1 −1
  589. drivers/net/ethernet/ti/cpsw_ale.c +4 −5
  590. drivers/net/ethernet/ti/icssg/icssg_prueth.c +8 −0
  591. drivers/net/ethernet/xscale/ixp4xx_eth.c +1 −4
  592. drivers/net/ethernet/xscale/ptp_ixp46x.c +3 −0
  593. drivers/net/mctp/mctp-i2c.c +1 −0
  594. drivers/net/mctp/mctp-usb.c +1 −2
  595. drivers/net/netconsole.c +3 −2
  596. drivers/net/ovpn/tcp.c +36 −17
  597. drivers/net/phy/phy_device.c +17 −8
  598. drivers/net/phy/qcom/qca807x.c +1 −1
  599. drivers/net/phy/sfp.c +7 −1
  600. drivers/net/team/team_core.c +21 −5
  601. drivers/net/usb/kalmia.c +7 −0
  602. drivers/net/usb/kaweth.c +13 −2
  603. drivers/net/usb/lan78xx.c +8 −6
  604. drivers/net/usb/lan78xx.h +3 −0
  605. drivers/net/usb/pegasus.c +42 −6
  606. drivers/net/usb/qmi_wwan.c +2 −2
  607. drivers/net/usb/r8152.c +1 −0
  608. drivers/net/usb/usbnet.c +4 −3
  609. drivers/net/vxlan/vxlan_core.c +5 −0
  610. drivers/net/wan/farsync.c +2 −0
  611. drivers/net/wireless/ath/ath12k/mac.c +3 −3
  612. drivers/net/wireless/ath/ath12k/wmi.c +13 −23
  613. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +3 −4
  614. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +4 −3
  615. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +1 −1
  616. drivers/net/wireless/marvell/libertas/main.c +2 −2
  617. drivers/net/wireless/marvell/mwifiex/cfg80211.c +1 −1
  618. drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +1 −0
  619. drivers/net/wireless/mediatek/mt76/mt7925/mac.c +1 −0
  620. drivers/net/wireless/mediatek/mt76/mt7996/mac.c +1 −0
  621. drivers/net/wireless/rsi/rsi_91x_mac80211.c +1 −1
  622. drivers/net/wireless/st/cw1200/pm.c +2 −0
  623. drivers/net/wireless/ti/wlcore/main.c +2 −2
  624. drivers/net/xen-netfront.c +17 −17
  625. drivers/nfc/pn533/usb.c +1 −0
  626. drivers/nvme/host/core.c +13 −18
  627. drivers/nvme/host/fabrics.c +2 −2
  628. drivers/nvme/host/multipath.c +6 −8
  629. drivers/nvme/host/nvme.h +56 −1
  630. drivers/nvme/host/pci.c +189 −5
  631. drivers/nvme/host/pr.c +2 −2
  632. drivers/nvme/host/sysfs.c +23 −0
  633. drivers/nvme/host/tcp.c +3 −2
  634. drivers/nvme/target/admin-cmd.c +1 −1
  635. drivers/nvme/target/core.c +12 −2
  636. drivers/nvme/target/fcloop.c +11 −4
  637. drivers/nvme/target/nvmet.h +1 −0
  638. drivers/nvme/target/rdma.c +1 −0
  639. drivers/pci/controller/dwc/pcie-designware-ep.c +16 −9
  640. drivers/pci/xen-pcifront.c +4 −4
  641. drivers/pinctrl/cirrus/pinctrl-cs42l43.c +2 −3
  642. drivers/pinctrl/cix/pinctrl-sky1.c +1 −2
  643. drivers/pinctrl/meson/pinctrl-amlogic-a4.c +1 −2
  644. drivers/pinctrl/pinconf-generic.c +2 −2
  645. drivers/pinctrl/pinctrl-amdisp.c +1 −1
  646. drivers/pinctrl/pinctrl-cy8c95x0.c +2 −2
  647. drivers/pinctrl/pinctrl-equilibrium.c +19 −12
  648. drivers/pinctrl/pinctrl-rockchip.c +4 −8
  649. drivers/pinctrl/qcom/pinctrl-qcs615.c +1 −0
  650. drivers/pinctrl/qcom/pinctrl-sdm660-lpass-lpi.c +2 −2
  651. drivers/pinctrl/sunxi/pinctrl-sunxi.c +51 −0
  652. drivers/platform/x86/asus-armoury.h +75 −0
  653. drivers/platform/x86/dell/alienware-wmi-wmax.c +1 −1
  654. drivers/platform/x86/dell/dell-wmi-base.c +6 −0
  655. drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c +0 −1
  656. drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +6 −3
  657. drivers/platform/x86/hp/hp-wmi.c +11 −1
  658. drivers/platform/x86/intel/hid.c +19 −0
  659. drivers/platform/x86/intel/int3472/discrete.c +7 −0
  660. drivers/platform/x86/lenovo/thinkpad_acpi.c +4 −2
  661. drivers/platform/x86/oxpec.c +29 −1
  662. drivers/platform/x86/redmi-wmi.c +24 −1
  663. drivers/platform/x86/touchscreen_dmi.c +18 −0
  664. drivers/platform/x86/uniwill/uniwill-acpi.c +75 −35
  665. drivers/platform/x86/uniwill/uniwill-wmi.h +3 −3
  666. drivers/pmdomain/bcm/bcm2835-power.c +3 −3
  667. drivers/pmdomain/imx/gpcv2.c +3 −1
  668. drivers/pmdomain/rockchip/pm-domains.c +1 −1
  669. drivers/power/sequencing/pwrseq-pcie-m2.c +1 −1
  670. drivers/regulator/Kconfig +1 −1
  671. drivers/regulator/bq257xx-regulator.c +1 −2
  672. drivers/regulator/fp9931.c +3 −4
  673. drivers/regulator/mt6363-regulator.c +1 −3
  674. drivers/regulator/pca9450-regulator.c +10 −4
  675. drivers/regulator/pf9453-regulator.c +1 −1
  676. drivers/regulator/tps65185.c +3 −0
  677. drivers/remoteproc/imx_rproc.c +1 −1
  678. drivers/remoteproc/mtk_scp.c +39 −0
  679. drivers/remoteproc/qcom_sysmon.c +1 −1
  680. drivers/remoteproc/qcom_wcnss.c +1 −1
  681. drivers/s390/block/dasd_eckd.c +16 −0
  682. drivers/s390/crypto/zcrypt_ccamisc.c +7 −5
  683. drivers/s390/crypto/zcrypt_cex4.c +1 −2
  684. drivers/scsi/hisi_sas/hisi_sas_main.c +1 −1
  685. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 −1
  686. drivers/scsi/lpfc/lpfc_init.c +2 −0
  687. drivers/scsi/lpfc/lpfc_sli.c +30 −6
  688. drivers/scsi/lpfc/lpfc_sli4.h +3 −0
  689. drivers/scsi/mpi3mr/mpi3mr_fw.c +29 −15
  690. drivers/scsi/pm8001/pm8001_sas.c +3 −2
  691. drivers/scsi/qla2xxx/qla_iocb.c +0 −2
  692. drivers/scsi/scsi_devinfo.c +1 −1
  693. drivers/scsi/scsi_scan.c +2 −5
  694. drivers/scsi/ses.c +2 −3
  695. drivers/scsi/snic/vnic_dev.c +0 −9
  696. drivers/scsi/storvsc_drv.c +3 −2
  697. drivers/scsi/xen-scsifront.c +1 −1
  698. drivers/spi/spi-amlogic-spifc-a4.c +2 −3
  699. drivers/spi/spi-atcspi200.c +16 −22
  700. drivers/spi/spi-cadence-quadspi.c +6 −0
  701. drivers/spi/spi-dw-dma.c +1 −1
  702. drivers/spi/spi-intel-pci.c +1 −0
  703. drivers/spi/spi-rockchip-sfc.c +1 −1
  704. drivers/spi/spi-stm32.c +3 −0
  705. drivers/staging/rtl8723bs/core/rtw_ieee80211.c +10 −5
  706. drivers/staging/rtl8723bs/core/rtw_mlme.c +4 −1
  707. drivers/staging/sm750fb/sm750.c +1 −0
  708. drivers/staging/sm750fb/sm750_hw.c +11 −11
  709. drivers/target/target_core_configfs.c +6 −9
  710. drivers/ufs/core/ufshcd.c +35 −14
  711. drivers/usb/class/cdc-acm.c +5 −0
  712. drivers/usb/class/cdc-acm.h +1 −0
  713. drivers/usb/class/cdc-wdm.c +3 −1
  714. drivers/usb/class/usbtmc.c +3 −3
  715. drivers/usb/core/config.c +5 −1
  716. drivers/usb/core/message.c +79 −21
  717. drivers/usb/core/phy.c +1 −7
  718. drivers/usb/core/quirks.c +21 −0
  719. drivers/usb/dwc3/dwc3-pci.c +2 −0
  720. drivers/usb/gadget/function/f_hid.c +4 −0
  721. drivers/usb/gadget/function/f_mass_storage.c +10 −2
  722. drivers/usb/gadget/function/f_ncm.c +80 −66
  723. drivers/usb/gadget/function/f_tcm.c +14 −0
  724. drivers/usb/gadget/function/u_ether.c +22 −45
  725. drivers/usb/gadget/function/u_ether.h +26 −30
  726. drivers/usb/gadget/function/u_ether_configfs.h +0 −177
  727. drivers/usb/gadget/function/u_ncm.h +1 −3
  728. drivers/usb/gadget/function/uvc_video.c +1 −1
  729. drivers/usb/host/xhci-debugfs.c +9 −1
  730. drivers/usb/host/xhci-ring.c +1 −0
  731. drivers/usb/host/xhci.c +2 −2
  732. drivers/usb/image/mdc800.c +4 −2
  733. drivers/usb/misc/uss720.c +1 −1
  734. drivers/usb/misc/yurex.c +1 −1
  735. drivers/usb/renesas_usbhs/common.c +9 −0
  736. drivers/usb/roles/class.c +6 −1
  737. drivers/usb/typec/altmodes/displayport.c +6 −1
  738. drivers/usb/typec/tcpm/tcpm.c +1 −1
  739. drivers/video/fbdev/au1100fb.c +6 −2
  740. drivers/xen/xen-acpi-processor.c +2 −5
  741. drivers/xen/xen-pciback/xenbus.c +5 −5
  742. drivers/xen/xenbus/xenbus_client.c +14 −3
  743. drivers/xen/xenbus/xenbus_probe.c +39 −3
  744. drivers/xen/xenbus/xenbus_probe_frontend.c +1 −1
  745. fs/afs/addr_list.c +4 −4
  746. fs/binfmt_elf.c +2 −1
  747. fs/btrfs/block-group.c +0 −1
  748. fs/btrfs/delayed-inode.c +1 −1
  749. fs/btrfs/disk-io.c +27 −16
  750. fs/btrfs/extent-tree.c +7 −1
  751. fs/btrfs/extent_io.c +1 −0
  752. fs/btrfs/inode.c +36 −2
  753. fs/btrfs/ioctl.c +34 −5
  754. fs/btrfs/messages.h +0 −3
  755. fs/btrfs/print-tree.c +10 −0
  756. fs/btrfs/qgroup.c +1 −1
  757. fs/btrfs/relocation.c +8 −0
  758. fs/btrfs/scrub.c +1 −1
  759. fs/btrfs/space-info.c +4 −1
  760. fs/btrfs/transaction.c +16 −0
  761. fs/btrfs/tree-checker.c +2 −2
  762. fs/btrfs/uuid-tree.c +38 −0
  763. fs/btrfs/uuid-tree.h +2 −0
  764. fs/btrfs/volumes.c +5 −3
  765. fs/ceph/addr.c +0 −1
  766. fs/ceph/debugfs.c +2 −2
  767. fs/ceph/dir.c +15 −2
  768. fs/ceph/file.c +2 −2
  769. fs/ceph/inode.c +1 −1
  770. fs/ceph/mds_client.c +3 −0
  771. fs/erofs/inode.c +6 −1
  772. fs/erofs/internal.h +7 −9
  773. fs/erofs/ishare.c +9 −5
  774. fs/erofs/super.c +36 −49
  775. fs/erofs/zmap.c +5 −4
  776. fs/eventpoll.c +3 −2
  777. fs/file_attr.c +1 −1
  778. fs/fs-writeback.c +5 −4
  779. fs/iomap/buffered-io.c +13 −3
  780. fs/iomap/direct-io.c +14 −1
  781. fs/iomap/ioend.c +53 −6
  782. fs/minix/bitmap.c +1 −1
  783. fs/namespace.c +74 −59
  784. fs/netfs/direct_write.c +212 −16
  785. fs/netfs/internal.h +3 −1
  786. fs/netfs/write_collect.c +0 −21
  787. fs/netfs/write_issue.c +3 −38
  788. fs/nfs/Kconfig +2 −1
  789. fs/nfs/nfs3proc.c +6 −1
  790. fs/nfsd/nfsctl.c +11 −11
  791. fs/nfsd/nfssvc.c +4 −3
  792. fs/nsfs.c +14 −1
  793. fs/pidfs.c +4 −6
  794. fs/proc/base.c +3 −0
  795. fs/smb/client/Makefile +2 −0
  796. fs/smb/client/cached_dir.c +1 −1
  797. fs/smb/client/cifs_fs_sb.h +1 −1
  798. fs/smb/client/cifs_ioctl.h +0 −8
  799. fs/smb/client/cifs_unicode.c +0 −14
  800. fs/smb/client/cifs_unicode.h +13 −1
  801. fs/smb/client/cifsacl.c +7 −12
  802. fs/smb/client/cifsfs.c +50 −43
  803. fs/smb/client/cifsglob.h +67 −17
  804. fs/smb/client/cifsproto.h +23 −4
  805. fs/smb/client/connect.c +44 −36
  806. fs/smb/client/dfs_cache.c +1 −1
  807. fs/smb/client/dir.c +29 −24
  808. fs/smb/client/file.c +114 −118
  809. fs/smb/client/fs_context.c +75 −76
  810. fs/smb/client/fs_context.h +1 −1
  811. fs/smb/client/inode.c +77 −71
  812. fs/smb/client/ioctl.c +1 −1
  813. fs/smb/client/link.c +8 −6
  814. fs/smb/client/misc.c +52 −6
  815. fs/smb/client/readdir.c +21 −18
  816. fs/smb/client/reparse.c +14 −13
  817. fs/smb/client/reparse.h +2 −2
  818. fs/smb/client/smb1encrypt.c +2 −1
  819. fs/smb/client/smb1ops.c +15 −9
  820. fs/smb/client/smb2file.c +1 −1
  821. fs/smb/client/smb2glob.h +12 −0
  822. fs/smb/client/smb2inode.c +15 −15
  823. fs/smb/client/smb2maperror.c +18 −13
  824. fs/smb/client/smb2maperror_test.c +9 −3
  825. fs/smb/client/smb2misc.c +4 −14
  826. fs/smb/client/smb2ops.c +18 −8
  827. fs/smb/client/smb2pdu.c +19 −39
  828. fs/smb/client/smb2pdu.h +5 −2
  829. fs/smb/client/smb2proto.h +0 −3
  830. fs/smb/client/smb2transport.c +3 −1
  831. fs/smb/client/trace.h +2 −0
  832. fs/smb/client/transport.c +10 −11
  833. fs/smb/client/xattr.c +3 −3
  834. fs/smb/server/Kconfig +1 −0
  835. fs/smb/server/auth.c +5 −21
  836. fs/smb/server/oplock.c +25 −10
  837. fs/smb/server/oplock.h +3 −2
  838. fs/smb/server/smb2pdu.c +7 −6
  839. fs/smb/server/smb2pdu.h +4 −1
  840. fs/smb/server/transport_rdma.c +2 −2
  841. fs/smb/server/vfs_cache.c +5 −5
  842. fs/squashfs/cache.c +3 −0
  843. fs/verity/Kconfig +3 −0
  844. fs/xfs/libxfs/xfs_ag.c +28 −0
  845. fs/xfs/libxfs/xfs_ag.h +3 −0
  846. fs/xfs/libxfs/xfs_da_btree.c +2 −6
  847. fs/xfs/libxfs/xfs_defer.c +1 −1
  848. fs/xfs/libxfs/xfs_inode_buf.c +4 −0
  849. fs/xfs/libxfs/xfs_metafile.c +5 −0
  850. fs/xfs/libxfs/xfs_ondisk.h +36 −16
  851. fs/xfs/libxfs/xfs_sb.c +3 −0
  852. fs/xfs/scrub/dir_repair.c +1 −1
  853. fs/xfs/scrub/orphanage.c +6 −1
  854. fs/xfs/xfs_bmap_item.c +1 −1
  855. fs/xfs/xfs_dquot.c +7 −1
  856. fs/xfs/xfs_fsops.c +2 −15
  857. fs/xfs/xfs_health.c +18 −2
  858. fs/xfs/xfs_healthmon.c +17 −11
  859. fs/xfs/xfs_icache.c +14 −5
  860. fs/xfs/xfs_log.c +2 −0
  861. fs/xfs/xfs_mount.h +1 −1
  862. fs/xfs/xfs_notify_failure.c +2 −2
  863. fs/xfs/xfs_platform.h +9 −0
  864. fs/xfs/xfs_rtalloc.c +37 −7
  865. fs/xfs/xfs_stats.c +11 −6
  866. fs/xfs/xfs_stats.h +10 −9
  867. fs/xfs/xfs_super.c +2 −2
  868. fs/xfs/xfs_verify_media.c +2 −2
  869. fs/xfs/xfs_zone_alloc.c +3 −3
  870. fs/xfs/xfs_zone_gc.c +5 −7
  871. include/asm-generic/vmlinux.lds.h +3 −1
  872. include/drm/display/drm_dp.h +2 −0
  873. include/kunit/run-in-irq-context.h +28 −16
  874. include/linux/bpf.h +2 −2
  875. include/linux/bpf_local_storage.h +1 −1
  876. include/linux/bpf_mem_alloc.h +6 −0
  877. include/linux/device/bus.h +2 −0
  878. include/linux/eventpoll.h +7 −4
  879. include/linux/firmware/intel/stratix10-svc-client.h +4 −4
  880. include/linux/fsnotify.h +0 −13
  881. include/linux/gfp.h +7 −4
  882. include/linux/gfp_types.h +2 −0
  883. include/linux/hid.h +6 −0
  884. include/linux/indirect_call_wrapper.h +11 −7
  885. include/linux/io_uring_types.h +1 −0
  886. include/linux/ipv6.h +6 −1
  887. include/linux/irqchip/arm-gic-v3.h +1 −0
  888. include/linux/jiffies.h +38 −2
  889. include/linux/kthread.h +20 −1
  890. include/linux/kvm_host.h +36 −54
  891. include/linux/liveupdate.h +6 −3
  892. include/linux/migrate.h +9 −1
  893. include/linux/mm.h +6 −11
  894. include/linux/mmc/host.h +5 −4
  895. include/linux/mmu_notifier.h +16 −15
  896. include/linux/netdevice.h +54 −5
  897. include/linux/ns_common.h +2 −0
  898. include/linux/nvme-auth.h +1 −1
  899. include/linux/overflow.h +4 −4
  900. include/linux/platform_data/mlxreg.h +7 −7
  901. include/linux/platform_data/x86/int3472.h +3 −2
  902. include/linux/pm_runtime.h +2 −14
  903. include/linux/ring_buffer.h +1 −0
  904. include/linux/rseq.h +12 −0
  905. include/linux/rseq_entry.h +4 −4
  906. include/linux/rseq_types.h +5 −1
  907. include/linux/sched.h +1 −2
  908. include/linux/slab.h +0 −12
  909. include/linux/tnum.h +3 −0
  910. include/linux/uaccess.h +22 −36
  911. include/linux/usb.h +6 −2
  912. include/linux/usb/quirks.h +3 −0
  913. include/linux/usb/r8152.h +1 −0
  914. include/linux/usb/usbnet.h +1 −0
  915. include/net/act_api.h +1 −0
  916. include/net/af_vsock.h +11 −2
  917. include/net/bluetooth/l2cap.h +5 −3
  918. include/net/bonding.h +1 −0
  919. include/net/inet6_hashtables.h +1 −1
  920. include/net/inet_connection_sock.h +3 −1
  921. include/net/inet_hashtables.h +1 −1
  922. include/net/ip.h +1 −1
  923. include/net/ip6_tunnel.h +14 −0
  924. include/net/ip_fib.h +1 −1
  925. include/net/ip_tunnels.h +7 −0
  926. include/net/libeth/xsk.h +3 −0
  927. include/net/netfilter/nf_tables.h +7 −0
  928. include/net/netns/vsock.h +3 −0
  929. include/net/page_pool/types.h +1 −1
  930. include/net/sch_generic.h +10 −0
  931. include/net/secure_seq.h +38 −7
  932. include/net/sock.h +1 −1
  933. include/net/tc_act/tc_gate.h +26 −7
  934. include/net/tc_act/tc_ife.h +1 −3
  935. include/net/tcp.h +7 −3
  936. include/net/xdp_sock_drv.h +13 −3
  937. include/rdma/rdma_cm.h +1 −1
  938. include/sound/cs35l56.h +1 −0
  939. include/sound/tas2781.h +1 −0
  940. include/trace/events/kmem.h +7 −1
  941. include/trace/events/netfs.h +3 −1
  942. include/uapi/drm/drm_fourcc.h +6 −6
  943. include/uapi/linux/dma-buf.h +1 −0
  944. include/uapi/linux/io_uring.h +2 −1
  945. include/uapi/linux/kvm.h +8 −0
  946. include/uapi/linux/pci_regs.h +1 −1
  947. include/uapi/linux/rseq.h +22 −4
  948. include/xen/xenbus.h +3 −1
  949. init/Kconfig +2 −2
  950. io_uring/bpf_filter.c +1 −1
  951. io_uring/cmd_net.c +1 −1
  952. io_uring/eventfd.c +7 −3
  953. io_uring/io_uring.c +3 −1
  954. io_uring/kbuf.c +11 −2
  955. io_uring/net.c +2 −0
  956. io_uring/register.c +13 −2
  957. io_uring/timeout.c +2 −2
  958. io_uring/tw.c +20 −2
  959. io_uring/zcrx.c +5 −3
  960. kernel/bpf/arena.c +1 −1
  961. kernel/bpf/arraymap.c +1 −1
  962. kernel/bpf/bloom_filter.c +1 −1
  963. kernel/bpf/bpf_insn_array.c +1 −1
  964. kernel/bpf/bpf_local_storage.c +39 −36
  965. kernel/bpf/cpumap.c +15 −2
  966. kernel/bpf/devmap.c +38 −9
  967. kernel/bpf/hashtab.c +86 −0
  968. kernel/bpf/local_storage.c +1 −1
  969. kernel/bpf/lpm_trie.c +1 −1
  970. kernel/bpf/memalloc.c +47 −11
  971. kernel/bpf/syscall.c +1 −1
  972. kernel/bpf/tnum.c +56 −0
  973. kernel/bpf/trampoline.c +1 −3
  974. kernel/bpf/verifier.c +64 −4
  975. kernel/cgroup/cgroup.c +7 −0
  976. kernel/cgroup/cpuset.c +154 −75
  977. kernel/configs/debug.config +0 −1
  978. kernel/dma/direct.h +1 −1
  979. kernel/events/core.c +62 −21
  980. kernel/exit.c +6 −0
  981. kernel/fork.c +2 −3
  982. kernel/kcsan/kcsan_test.c +1 −1
  983. kernel/kprobes.c +6 −2
  984. kernel/kthread.c +5 −36
  985. kernel/liveupdate/luo_file.c +25 −16
  986. kernel/module/Kconfig +13 −10
  987. kernel/module/main.c +7 −6
  988. kernel/nscommon.c +6 −0
  989. kernel/nstree.c +4 −25
  990. kernel/rseq.c +5 −3
  991. kernel/sched/core.c +29 −51
  992. kernel/sched/ext.c +92 −27
  993. kernel/sched/ext_idle.c +2 −3
  994. kernel/sched/ext_internal.h +99 −17
  995. kernel/sched/fair.c +112 −38
  996. kernel/sched/idle.c +10 −1
  997. kernel/sched/isolation.c +1 −3
  998. kernel/sched/sched.h +11 −0
  999. kernel/sched/syscalls.c +30 −0
  1000. kernel/time/jiffies.c +0 −2
  1001. kernel/time/time.c +8 −13
  1002. kernel/time/timekeeping.c +4 −2
  1003. kernel/time/timer_migration.c +1 −3
  1004. kernel/trace/blktrace.c +1 −2
  1005. kernel/trace/bpf_trace.c +3 −1
  1006. kernel/trace/ftrace.c +4 −0
  1007. kernel/trace/ring_buffer.c +21 −0
  1008. kernel/trace/trace.c +16 −3
  1009. kernel/trace/trace_events.c +44 −16
  1010. kernel/trace/trace_events_trigger.c +3 −0
  1011. kernel/trace/trace_functions_graph.c +13 −6
  1012. kernel/workqueue.c +28 −27
  1013. kernel/workqueue_internal.h +1 −0
  1014. lib/Kconfig.debug +3 −29
  1015. lib/bootconfig.c +3 −3
  1016. lib/crypto/.kunitconfig +34 −0
  1017. lib/crypto/tests/Kconfig +12 −23
  1018. lib/debugobjects.c +18 −1
  1019. lib/kunit/test.c +125 −106
  1020. mm/cma.c +4 −1
  1021. mm/damon/core.c +9 −1
  1022. mm/filemap.c +10 −5
  1023. mm/huge_memory.c +12 −4
  1024. mm/hugetlb.c +2 −2
  1025. mm/kfence/core.c +23 −6
  1026. mm/madvise.c +1 −1
  1027. mm/memcontrol.c +1 −1
  1028. mm/memfd_luo.c +49 −7
  1029. mm/memory.c +2 −1
  1030. mm/migrate.c +4 −4
  1031. mm/migrate_device.c +1 −1
  1032. mm/mm_init.c +5 −1
  1033. mm/page_alloc.c +2 −1
  1034. mm/slab.h +7 −7
  1035. mm/slub.c +86 −45
  1036. net/atm/lec.c +15 −11
  1037. net/batman-adv/bat_v_elp.c +9 −1
  1038. net/batman-adv/hard-interface.c +4 −4
  1039. net/batman-adv/hard-interface.h +1 −0
  1040. net/bluetooth/hci_sock.c +1 −0
  1041. net/bluetooth/hci_sync.c +1 −1
  1042. net/bluetooth/iso.c +1 −0
  1043. net/bluetooth/l2cap_core.c +70 −25
  1044. net/bluetooth/l2cap_sock.c +12 −4
  1045. net/bluetooth/sco.c +1 −0
  1046. net/bridge/br_device.c +1 −1
  1047. net/bridge/br_input.c +1 −1
  1048. net/bridge/br_private.h +10 −0
  1049. net/bridge/br_vlan_options.c +23 −3
  1050. net/can/bcm.c +1 −0
  1051. net/ceph/auth.c +4 −2
  1052. net/ceph/messenger_v2.c +21 −10
  1053. net/ceph/mon_client.c +3 −3
  1054. net/core/dev.c +36 −23
  1055. net/core/dev.h +0 −35
  1056. net/core/devmem.c +4 −2
  1057. net/core/filter.c +11 −2
  1058. net/core/neighbour.c +2 −1
  1059. net/core/netpoll.c +1 −1
  1060. net/core/page_pool_user.c +2 −2
  1061. net/core/secure_seq.c +29 −51
  1062. net/core/skbuff.c +18 −5
  1063. net/core/skmsg.c +7 −7
  1064. net/ipv4/Kconfig +2 −0
  1065. net/ipv4/af_inet.c +6 −0
  1066. net/ipv4/inet_hashtables.c +4 −4
  1067. net/ipv4/ip_tunnel_core.c +15 −0
  1068. net/ipv4/nexthop.c +11 −3
  1069. net/ipv4/syncookies.c +9 −4
  1070. net/ipv4/sysctl_net_ipv4.c +3 −2
  1071. net/ipv4/tcp.c +4 −3
  1072. net/ipv4/tcp_ao.c +2 −1
  1073. net/ipv4/tcp_bpf.c +1 −1
  1074. net/ipv4/tcp_diag.c +1 −1
  1075. net/ipv4/tcp_fastopen.c +1 −1
  1076. net/ipv4/tcp_input.c +29 −27
  1077. net/ipv4/tcp_ipv4.c +26 −22
  1078. net/ipv4/tcp_minisocks.c +2 −2
  1079. net/ipv4/udp.c +16 −11
  1080. net/ipv4/udp_bpf.c +1 −1
  1081. net/ipv4/udplite.c +1 −2
  1082. net/ipv6/af_inet6.c +0 −8
  1083. net/ipv6/inet6_hashtables.c +2 −1
  1084. net/ipv6/route.c +5 −6
  1085. net/ipv6/syncookies.c +8 −3
  1086. net/ipv6/tcp_ipv6.c +61 −77
  1087. net/ipv6/udplite.c +1 −2
  1088. net/ipv6/xfrm6_policy.c +5 −2
  1089. net/kcm/kcmsock.c +19 −2
  1090. net/mac80211/eht.c +1 −0
  1091. net/mac80211/link.c +2 −0
  1092. net/mac80211/mesh.c +3 −0
  1093. net/mac80211/mlme.c +3 −0
  1094. net/mctp/route.c +7 −4
  1095. net/mptcp/pm.c +43 −12
  1096. net/mptcp/pm_kernel.c +9 −0
  1097. net/mptcp/subflow.c +4 −2
  1098. net/ncsi/ncsi-aen.c +2 −1
  1099. net/ncsi/ncsi-rsp.c +12 −4
  1100. net/netfilter/nf_conntrack_h323_asn1.c +1 −1
  1101. net/netfilter/nf_tables_api.c +26 −23
  1102. net/netfilter/nfnetlink_cthelper.c +4 −4
  1103. net/netfilter/nfnetlink_queue.c +3 −1
  1104. net/netfilter/nft_chain_filter.c +1 −1
  1105. net/netfilter/nft_set_hash.c +1 −0
  1106. net/netfilter/nft_set_pipapo.c +54 −11
  1107. net/netfilter/nft_set_pipapo.h +2 −0
  1108. net/netfilter/nft_set_rbtree.c +5 −3
  1109. net/netfilter/xt_IDLETIMER.c +6 −0
  1110. net/netfilter/xt_dccp.c +2 −2
  1111. net/netfilter/xt_tcpudp.c +4 −2
  1112. net/nfc/digital_core.c +6 −2
  1113. net/nfc/nci/core.c +27 −3
  1114. net/nfc/nci/data.c +8 −4
  1115. net/nfc/rawsock.c +11 −0
  1116. net/psp/psp_main.c +38 −1
  1117. net/rds/connection.c +3 −0
  1118. net/rds/tcp.c +10 −4
  1119. net/rds/tcp_listen.c +5 −23
  1120. net/rxrpc/af_rxrpc.c +5 −3
  1121. net/sched/act_ct.c +6 −0
  1122. net/sched/act_gate.c +186 −79
  1123. net/sched/act_ife.c +44 −49
  1124. net/sched/cls_api.c +7 −0
  1125. net/sched/sch_cake.c +25 −28
  1126. net/sched/sch_ets.c +8 −4
  1127. net/sched/sch_fq.c +1 −0
  1128. net/sched/sch_teql.c +1 −0
  1129. net/shaper/shaper.c +2 −9
  1130. net/smc/af_smc.c +4 −2
  1131. net/socket.c +1 −1
  1132. net/sunrpc/xprtrdma/verbs.c +4 −3
  1133. net/tipc/name_table.c +4 −2
  1134. net/tipc/socket.c +2 −0
  1135. net/tls/tls_sw.c +1 −1
  1136. net/unix/af_unix.c +4 −4
  1137. net/vmw_vsock/af_vsock.c +12 −7
  1138. net/wireless/core.c +1 −0
  1139. net/wireless/radiotap.c +2 −2
  1140. net/wireless/wext-compat.c +1 −1
  1141. net/xdp/xsk.c +16 −10
  1142. net/xfrm/espintcp.c +1 −1
  1143. net/xfrm/xfrm_device.c +11 −1
  1144. net/xfrm/xfrm_policy.c +9 −2
  1145. rust/Makefile +5 −6
  1146. rust/kernel/cpufreq.rs +1 −0
  1147. rust/kernel/dma.rs +50 −64
  1148. rust/kernel/io.rs +89 −42
  1149. rust/kernel/kunit.rs +8 −0
  1150. rust/kernel/lib.rs +4 −0
  1151. rust/kernel/pci/io.rs +12 −12
  1152. rust/kernel/ptr.rs +29 −1
  1153. rust/kernel/ptr/projection.rs +305 −0
  1154. rust/kernel/str.rs +2 −2
  1155. rust/pin-init/internal/src/init.rs +23 −46
  1156. rust/pin-init/src/__internal.rs +24 −4
  1157. samples/rust/rust_dma.rs +16 −14
  1158. samples/workqueue/stall_detector/Makefile +1 −0
  1159. samples/workqueue/stall_detector/wq_stall.c +98 −0
  1160. scripts/Makefile.build +3 −1
  1161. scripts/genksyms/parse.y +2 −2
  1162. scripts/package/install-extmod-build +4 −0
  1163. security/apparmor/apparmorfs.c +134 −91
  1164. security/apparmor/include/label.h +8 −8
  1165. security/apparmor/include/lib.h +12 −0
  1166. security/apparmor/include/match.h +1 −0
  1167. security/apparmor/include/policy.h +5 −5
  1168. security/apparmor/include/policy_ns.h +2 −0
  1169. security/apparmor/include/policy_unpack.h +45 −30
  1170. security/apparmor/label.c +8 −4
  1171. security/apparmor/match.c +42 −16
  1172. security/apparmor/policy.c +67 −10
  1173. security/apparmor/policy_ns.c +2 −0
  1174. security/apparmor/policy_unpack.c +37 −12
  1175. sound/core/pcm_native.c +16 −3
  1176. sound/firewire/dice/dice.c +1 −1
  1177. sound/hda/codecs/ca0132.c +9 −0
  1178. sound/hda/codecs/hdmi/tegrahdmi.c +1 −0
  1179. sound/hda/codecs/realtek/alc269.c +40 −1
  1180. sound/hda/codecs/realtek/alc662.c +9 −0
  1181. sound/hda/codecs/senarytech.c +8 −6
  1182. sound/hda/codecs/side-codecs/cs35l56_hda.c +1 −6
  1183. sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +3 −12
  1184. sound/hda/controllers/intel.c +2 −0
  1185. sound/soc/amd/acp/acp-mach-common.c +14 −4
  1186. sound/soc/amd/acp/amd-acp63-acpi-match.c +413 −0
  1187. sound/soc/amd/acp3x-rt5682-max9836.c +7 −2
  1188. sound/soc/amd/yc/acp6x-mach.c +14 −0
  1189. sound/soc/codecs/cs35l56-shared.c +15 −1
  1190. sound/soc/codecs/cs35l56.c +10 −2
  1191. sound/soc/codecs/cs42l43-jack.c +1 −0
  1192. sound/soc/codecs/rt1011.c +1 −1
  1193. sound/soc/codecs/rt1320-sdw.c +3 −2
  1194. sound/soc/codecs/tas2781-fmwlib.c +94 −0
  1195. sound/soc/fsl/fsl_easrc.c +10 −4
  1196. sound/soc/generic/simple-card-utils.c +8 −4
  1197. sound/soc/intel/boards/sof_sdw.c +8 −0
  1198. sound/soc/qcom/qdsp6/q6apm-dai.c +1 −0
  1199. sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +1 −0
  1200. sound/soc/qcom/qdsp6/q6apm.c +1 −0
  1201. sound/soc/sdca/sdca_functions.c +4 −1
  1202. sound/soc/sdca/sdca_interrupts.c +2 −2
  1203. sound/soc/soc-core.c +8 −3
  1204. sound/soc/tegra/tegra_audio_graph_card.c +11 −0
  1205. sound/usb/endpoint.c +7 −3
  1206. sound/usb/format.c +65 −5
  1207. sound/usb/mixer_s1810c.c +6 −6
  1208. sound/usb/mixer_scarlett2.c +5 −7
  1209. sound/usb/qcom/qc_audio_offload.c +1 −1
  1210. sound/usb/quirks.c +9 −1
  1211. sound/usb/stream.c +3 −0
  1212. sound/usb/usbaudio.h +6 −0
  1213. sound/usb/usx2y/us122l.c +2 −10
  1214. sound/usb/usx2y/us144mkii.c +7 −7
  1215. sound/usb/usx2y/us144mkii_capture.c +6 −6
  1216. sound/usb/usx2y/us144mkii_controls.c +21 −21
  1217. sound/usb/usx2y/us144mkii_midi.c +11 −11
  1218. sound/usb/usx2y/us144mkii_playback.c +5 −5
  1219. sound/usb/validate.c +1 −1
  1220. tools/arch/x86/include/asm/amd/ibs.h +1 −1
  1221. tools/arch/x86/include/asm/cpufeatures.h +3 −1
  1222. tools/arch/x86/include/asm/msr-index.h +6 −0
  1223. tools/arch/x86/include/uapi/asm/kvm.h +6 −2
  1224. tools/bootconfig/samples/bad-non-closed-brace.bconf +4 −0
  1225. tools/bootconfig/samples/bad-over-max-brace.bconf +19 −0
  1226. tools/bootconfig/samples/exp-good-nested-brace.bconf +1 −0
  1227. tools/bootconfig/samples/good-nested-brace.bconf +18 −0
  1228. tools/bootconfig/test-bootconfig.sh +9 −0
  1229. tools/bpf/resolve_btfids/Makefile +10 −2
  1230. tools/bpf/resolve_btfids/main.c +54 −27
  1231. tools/build/Build.include +9 −0
  1232. tools/build/Makefile.build +4 −2
  1233. tools/include/linux/args.h +4 −0
  1234. tools/include/linux/coresight-pmu.h +0 −24
  1235. tools/include/linux/gfp.h +4 −0
  1236. tools/include/linux/gfp_types.h +7 −2
  1237. tools/include/linux/overflow.h +19 −0
  1238. tools/include/linux/slab.h +9 −0
  1239. tools/include/uapi/asm-generic/unistd.h +4 −1
  1240. tools/include/uapi/linux/kvm.h +23 −1
  1241. tools/include/uapi/linux/perf_event.h +1 −1
  1242. tools/objtool/Makefile +6 −4
  1243. tools/objtool/arch/x86/decode.c +23 −39
  1244. tools/objtool/check.c +19 −5
  1245. tools/objtool/elf.c +1 −1
  1246. tools/objtool/include/objtool/warn.h +1 −1
  1247. tools/objtool/klp-diff.c +26 −13
  1248. tools/perf/Makefile.config +18 −0
  1249. tools/perf/Makefile.perf +1 −1
  1250. tools/perf/arch/arm/entry/syscalls/syscall.tbl +1 −0
  1251. tools/perf/arch/arm/util/cs-etm.c +0 −14
  1252. tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl +1 −0
  1253. tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +1 −0
  1254. tools/perf/arch/s390/entry/syscalls/syscall.tbl +392 −467
  1255. tools/perf/arch/sh/entry/syscalls/syscall.tbl +1 −0
  1256. tools/perf/arch/sparc/entry/syscalls/syscall.tbl +2 −1
  1257. tools/perf/arch/x86/entry/syscalls/syscall_32.tbl +1 −0
  1258. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +1 −0
  1259. tools/perf/arch/xtensa/entry/syscalls/syscall.tbl +1 −0
  1260. tools/perf/builtin-ftrace.c +7 −2
  1261. tools/perf/pmu-events/Build +2 −1
  1262. tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h +1 −0
  1263. tools/perf/trace/beauty/include/uapi/linux/fs.h +1 −0
  1264. tools/perf/trace/beauty/include/uapi/linux/mount.h +11 −2
  1265. tools/perf/trace/beauty/include/uapi/linux/prctl.h +37 −0
  1266. tools/perf/util/annotate-arch/annotate-loongarch.c +1 −1
  1267. tools/perf/util/annotate.c +4 −1
  1268. tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +1 −1
  1269. tools/perf/util/cs-etm.c +13 −23
  1270. tools/perf/util/cs-etm.h +15 −0
  1271. tools/perf/util/disasm.c +1 −1
  1272. tools/perf/util/synthetic-events.c +5 −0
  1273. tools/power/cpupower/cpupower-service.conf +5 −0
  1274. tools/power/cpupower/cpupower.sh +6 −0
  1275. tools/power/cpupower/utils/cpupower-set.c +5 −1
  1276. tools/power/cpupower/utils/helpers/helpers.h +4 −1
  1277. tools/power/cpupower/utils/helpers/misc.c +39 −2
  1278. tools/power/cpupower/utils/powercap-info.c +2 −2
  1279. tools/sched_ext/Kconfig +61 −0
  1280. tools/sched_ext/Makefile +2 −0
  1281. tools/sched_ext/README.md +0 −6
  1282. tools/sched_ext/include/scx/compat.h +5 −2
  1283. tools/sched_ext/scx_central.c +1 −1
  1284. tools/sched_ext/scx_sdt.c +1 −1
  1285. tools/scripts/syscall.tbl +1 −0
  1286. tools/testing/kunit/kunit_kernel.py +4 −2
  1287. tools/testing/kunit/kunit_tool_test.py +26 −0
  1288. tools/testing/selftests/arm64/abi/hwcap.c +2 −2
  1289. tools/testing/selftests/arm64/signal/testcases/gcs_prot_none_fault.c +76 −0
  1290. tools/testing/selftests/bpf/DENYLIST.asan +3 −0
  1291. tools/testing/selftests/bpf/Makefile +10 −4
  1292. tools/testing/selftests/bpf/benchs/bench_trigger.c +8 −6
  1293. tools/testing/selftests/bpf/bpf_util.h +32 −13
  1294. tools/testing/selftests/bpf/bpftool_helpers.c +19 −6
  1295. tools/testing/selftests/bpf/cgroup_helpers.c +1 −1
  1296. tools/testing/selftests/bpf/jit_disasm_helpers.c +9 −9
  1297. tools/testing/selftests/bpf/network_helpers.c +2 −3
  1298. tools/testing/selftests/bpf/prog_tests/bpf_iter.c +1 −2
  1299. tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c +1 −1
  1300. tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c +3 −1
  1301. tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c +4 −2
  1302. tools/testing/selftests/bpf/prog_tests/dynptr.c +4 −1
  1303. tools/testing/selftests/bpf/prog_tests/fd_array.c +2 −2
  1304. tools/testing/selftests/bpf/prog_tests/flow_dissector.c +2 −2
  1305. tools/testing/selftests/bpf/prog_tests/htab_update.c +1 −0
  1306. tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c +2 −5
  1307. tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c +5 −7
  1308. tools/testing/selftests/bpf/prog_tests/lwt_seg6local.c +1 −1
  1309. tools/testing/selftests/bpf/prog_tests/map_kptr_race.c +218 −0
  1310. tools/testing/selftests/bpf/prog_tests/queue_stack_map.c +2 −2
  1311. tools/testing/selftests/bpf/prog_tests/reg_bounds.c +59 −19
  1312. tools/testing/selftests/bpf/prog_tests/setget_sockopt.c +1 −1
  1313. tools/testing/selftests/bpf/prog_tests/skc_to_unix_sock.c +1 −1
  1314. tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +14 −14
  1315. tools/testing/selftests/bpf/prog_tests/sockmap_listen.c +1 −1
  1316. tools/testing/selftests/bpf/prog_tests/sockopt_sk.c +1 −1
  1317. tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c +1 −3
  1318. tools/testing/selftests/bpf/prog_tests/task_local_data.h +1 −1
  1319. tools/testing/selftests/bpf/prog_tests/tc_opts.c +2 −4
  1320. tools/testing/selftests/bpf/prog_tests/tc_redirect.c +1 −1
  1321. tools/testing/selftests/bpf/prog_tests/test_sysctl.c +3 −0
  1322. tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c +4 −1
  1323. tools/testing/selftests/bpf/prog_tests/test_veristat.c +2 −2
  1324. tools/testing/selftests/bpf/prog_tests/test_xsk.c +20 −4
  1325. tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c +5 −1
  1326. tools/testing/selftests/bpf/prog_tests/verifier_log.c +1 −1
  1327. tools/testing/selftests/bpf/prog_tests/xdp_bonding.c +58 −0
  1328. tools/testing/selftests/bpf/prog_tests/xdp_flowtable.c +2 −1
  1329. tools/testing/selftests/bpf/prog_tests/xdp_metadata.c +2 −2
  1330. tools/testing/selftests/bpf/progs/dmabuf_iter.c +1 −1
  1331. tools/testing/selftests/bpf/progs/exceptions_assert.c +17 −17
  1332. tools/testing/selftests/bpf/progs/map_kptr_race.c +197 −0
  1333. tools/testing/selftests/bpf/progs/verifier_bounds.c +175 −1
  1334. tools/testing/selftests/bpf/progs/verifier_linked_scalars.c +64 −0
  1335. tools/testing/selftests/bpf/progs/verifier_scalar_ids.c +42 −14
  1336. tools/testing/selftests/bpf/test_progs.c +27 −11
  1337. tools/testing/selftests/bpf/test_verifier.c +1 −1
  1338. tools/testing/selftests/bpf/testing_helpers.c +1 −0
  1339. tools/testing/selftests/bpf/trace_helpers.c +12 −11
  1340. tools/testing/selftests/bpf/trace_helpers.h +9 −2
  1341. tools/testing/selftests/bpf/verifier/precise.c +4 −4
  1342. tools/testing/selftests/bpf/veristat.c +2 −0
  1343. tools/testing/selftests/bpf/xdp_features.c +2 −1
  1344. tools/testing/selftests/bpf/xdp_hw_metadata.c +2 −2
  1345. tools/testing/selftests/cgroup/test_cpuset_prs.sh +114 −110
  1346. tools/testing/selftests/drivers/net/hw/rss_ctx.py +98 −2
  1347. tools/testing/selftests/drivers/net/team/Makefile +1 −0
  1348. tools/testing/selftests/drivers/net/team/refleak.sh +17 −0
  1349. tools/testing/selftests/filesystems/nsfs/iterate_mntns.c +15 −10
  1350. tools/testing/selftests/hid/tests/test_wacom_generic.py +21 −13
  1351. tools/testing/selftests/kselftest_harness.h +5 −2
  1352. tools/testing/selftests/kvm/Makefile.kvm +1 −0
  1353. tools/testing/selftests/kvm/guest_memfd_test.c +1 −1
  1354. tools/testing/selftests/kvm/include/x86/processor.h +23 −0
  1355. tools/testing/selftests/kvm/include/x86/smm.h +17 −0
  1356. tools/testing/selftests/kvm/lib/x86/processor.c +26 −0
  1357. tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c +150 −0
  1358. tools/testing/selftests/kvm/x86/sev_smoke_test.c +30 −0
  1359. tools/testing/selftests/kvm/x86/smm_test.c +2 −25
  1360. tools/testing/selftests/net/Makefile +1 −0
  1361. tools/testing/selftests/net/bridge_vlan_dump.sh +204 −0
  1362. tools/testing/selftests/net/fib_nexthops.sh +11 −0
  1363. tools/testing/selftests/net/mptcp/mptcp_join.sh +49 −0
  1364. tools/testing/selftests/net/mptcp/simult_flows.sh +7 −4
  1365. tools/testing/selftests/net/netfilter/nf_queue.c +8 −2
  1366. tools/testing/selftests/net/netfilter/nft_queue.sh +9 −4
  1367. tools/testing/selftests/net/packetdrill/tcp_rcv_big_endseq.pkt +1 −1
  1368. tools/testing/selftests/net/packetdrill/tcp_rcv_toobig.pkt +0 −33
  1369. tools/testing/selftests/net/packetdrill/tcp_rcv_zero_wnd_fin.pkt +27 −0
  1370. tools/testing/selftests/net/rtnetlink.sh +55 −0
  1371. tools/testing/selftests/net/tun.c +6 −6
  1372. tools/testing/selftests/powerpc/copyloops/.gitignore +2 −2
  1373. tools/testing/selftests/powerpc/copyloops/Makefile +8 −3
  1374. tools/testing/selftests/powerpc/copyloops/stubs.S +0 −8
  1375. tools/testing/selftests/powerpc/copyloops/validate.c +14 −1
  1376. tools/testing/selftests/rcutorture/configs/rcu/SRCU-N +3 −1
  1377. tools/testing/selftests/rcutorture/configs/rcu/SRCU-T +2 −1
  1378. tools/testing/selftests/rcutorture/configs/rcu/SRCU-U +2 −2
  1379. tools/testing/selftests/rcutorture/configs/rcu/TASKS02 +2 −1
  1380. tools/testing/selftests/rcutorture/configs/rcu/TINY01 +2 −2
  1381. tools/testing/selftests/rcutorture/configs/rcu/TINY02 +2 −1
  1382. tools/testing/selftests/rcutorture/configs/rcu/TRACE01 +2 −1
  1383. tools/testing/selftests/rcutorture/configs/rcu/TREE04 +3 −1
  1384. tools/testing/selftests/rcutorture/configs/rcu/TREE05 +3 −1
  1385. tools/testing/selftests/rcutorture/configs/rcu/TREE06 +4 −1
  1386. tools/testing/selftests/rcutorture/configs/rcu/TREE10 +1 −0
  1387. tools/testing/selftests/rcutorture/configs/rcu/TRIVIAL +3 −1
  1388. tools/testing/selftests/rcutorture/configs/rcuscale/TINY +2 −1
  1389. tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 +2 −1
  1390. tools/testing/selftests/rcutorture/configs/refscale/NOPREEMPT +2 −1
  1391. tools/testing/selftests/rcutorture/configs/refscale/TINY +2 −1
  1392. tools/testing/selftests/rcutorture/configs/scf/NOPREEMPT +2 −1
  1393. tools/testing/selftests/sched_ext/Makefile +2 −0
  1394. tools/testing/selftests/sched_ext/init_enable_count.c +2 −1
  1395. tools/testing/selftests/sched_ext/peek_dsq.bpf.c +2 −2
  1396. tools/testing/selftests/sched_ext/rt_stall.c +0 −1
  1397. tools/testing/selftests/sched_ext/runner.c +3 −0
  1398. tools/testing/selftests/sched_ext/util.c +2 −2
  1399. tools/testing/selftests/tc-testing/tc-tests/actions/ct.json +159 −0
  1400. tools/testing/selftests/tc-testing/tc-tests/actions/ife.json +99 −0
  1401. tools/testing/selftests/tc-testing/tdc_helper.py +7 −3
  1402. tools/testing/selftests/vsock/vmtest.sh +21 −20
  1403. virt/kvm/Kconfig +1 −8
  1404. virt/kvm/binary_stats.c +1 −1
  1405. virt/kvm/kvm_main.c +11 −26
.mailmap+13−2
@@ -210,10 +210,16 @@ Daniel Borkmann <daniel@iogearbox.net> <daniel.borkmann@tik.ee.ethz.ch> · 209 unmodified lines
210210 Daniel Borkmann <daniel@iogearbox.net> <dborkmann@redhat.com>
211211 Daniel Borkmann <daniel@iogearbox.net> <dborkman@redhat.com>
212212 Daniel Borkmann <daniel@iogearbox.net> <dxchgb@gmail.com>
213+Daniel Lezcano <daniel.lezcano@kernel.org> <daniel.lezcano@linaro.org>
214+Daniel Lezcano <daniel.lezcano@kernel.org> <daniel.lezcano@free.fr>
215+Daniel Lezcano <daniel.lezcano@kernel.org> <daniel.lezcano@linexp.org>
216+Daniel Lezcano <daniel.lezcano@kernel.org> <dlezcano@fr.ibm.com>
213217 Daniel Thompson <danielt@kernel.org> <daniel.thompson@linaro.org>
218+Daniele Alessandrelli <daniele.alessandrelli@gmail.com> <daniele.alessandrelli@intel.com>
214219 Danilo Krummrich <dakr@kernel.org> <dakr@redhat.com>
215220 David Brownell <david-b@pacbell.net>
216221 David Collins <quic_collinsd@quicinc.com> <collinsd@codeaurora.org>
222+David Gow <david@davidgow.net> <davidgow@google.com>
217223 David Heidelberg <david@ixit.cz> <d.okias@gmail.com>
218224 David Hildenbrand <david@kernel.org> <david@redhat.com>
219225 David Rheinsberg <david@readahead.eu> <dh.herrmann@gmail.com>
@@ -348,6 +354,7 @@ Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@opinsys.com> · 128 unmodified lines
348354 Jason Gunthorpe <jgg@ziepe.ca> <jgg@mellanox.com>
349355 Jason Gunthorpe <jgg@ziepe.ca> <jgg@nvidia.com>
350356 Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com>
357+Jason Xing <kerneljasonxing@gmail.com> <kernelxing@tencent.com>
351358 <javier@osg.samsung.com> <javier.martinez@collabora.co.uk>
352359 Javi Merino <javi.merino@kernel.org> <javi.merino@arm.com>
353360 Jayachandran C <c.jayachandran@gmail.com> <jayachandranc@netlogicmicro.com>
@@ -396,6 +403,7 @@ Jiri Slaby <jirislaby@kernel.org> <xslaby@fi.muni.cz> · 42 unmodified lines
396403 Jisheng Zhang <jszhang@kernel.org> <jszhang@marvell.com>
397404 Jisheng Zhang <jszhang@kernel.org> <Jisheng.Zhang@synaptics.com>
398405 Jishnu Prakash <quic_jprakash@quicinc.com> <jprakash@codeaurora.org>
406+Joe Damato <joe@dama.to> <jdamato@fastly.com>
399407 Joel Granados <joel.granados@kernel.org> <j.granados@samsung.com>
400408 Johan Hovold <johan@kernel.org> <jhovold@gmail.com>
401409 Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com>
@@ -490,7 +498,8 @@ Lior David <quic_liord@quicinc.com> <liord@codeaurora.org> · 88 unmodified lines
490498 Loic Poulain <loic.poulain@oss.qualcomm.com> <loic.poulain@linaro.org>
491499 Loic Poulain <loic.poulain@oss.qualcomm.com> <loic.poulain@intel.com>
492500 Lorenzo Pieralisi <lpieralisi@kernel.org> <lorenzo.pieralisi@arm.com>
493−Lorenzo Stoakes <lorenzo.stoakes@oracle.com> <lstoakes@gmail.com>
501+Lorenzo Stoakes <ljs@kernel.org> <lstoakes@gmail.com>
502+Lorenzo Stoakes <ljs@kernel.org> <lorenzo.stoakes@oracle.com>
494503 Luca Ceresoli <luca.ceresoli@bootlin.com> <luca@lucaceresoli.net>
495504 Luca Weiss <luca@lucaweiss.eu> <luca@z3ntu.xyz>
496505 Lucas De Marchi <demarchi@kernel.org> <lucas.demarchi@intel.com>
@@ -876,6 +885,7 @@ Vivien Didelot <vivien.didelot@gmail.com> <vivien.didelot@savoirfairelinux.com> · 379 unmodified lines
876885 Vlad Dogaru <ddvlad@gmail.com> <vlad.dogaru@intel.com>
877886 Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@parallels.com>
878887 Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@virtuozzo.com>
888+Vlastimil Babka <vbabka@kernel.org> <vbabka@suse.cz>
879889 WangYuli <wangyuli@aosc.io> <wangyl5933@chinaunicom.cn>
880890 WangYuli <wangyuli@aosc.io> <wangyuli@deepin.org>
881891 Weiwen Hu <huweiwen@linux.alibaba.com> <sehuww@mail.scut.edu.cn>
@@ -890,7 +900,8 @@ Yanteng Si <si.yanteng@linux.dev> <siyanteng@loongson.cn> · 8 unmodified lines
890900 Ying Huang <huang.ying.caritas@gmail.com> <ying.huang@intel.com>
891901 Yixun Lan <dlan@kernel.org> <dlan@gentoo.org>
892902 Yixun Lan <dlan@kernel.org> <yixun.lan@amlogic.com>
893−Yosry Ahmed <yosry.ahmed@linux.dev> <yosryahmed@google.com>
903+Yosry Ahmed <yosry@kernel.org> <yosryahmed@google.com>
904+Yosry Ahmed <yosry@kernel.org> <yosry.ahmed@linux.dev>
894905 Yu-Chun Lin <eleanor.lin@realtek.com> <eleanor15x@gmail.com>
895906 Yusuke Goda <goda.yusuke@renesas.com>
896907 Zack Rusin <zack.rusin@broadcom.com> <zackr@vmware.com>
CREDITS+8−0
@@ -1242,6 +1242,10 @@ N: Veaceslav Falico · 1241 unmodified lines
12421242 E: vfalico@gmail.com
12431243 D: Co-maintainer and co-author of the network bonding driver.
12441244
1245+N: Thomas Falcon
1246+E: tlfalcon@linux.ibm.com
1247+D: Initial author of the IBM ibmvnic network driver
1248+
12451249 N: János Farkas
12461250 E: chexum@shadow.banki.hu
12471251 D: romfs, various (mostly networking) fixes
@@ -2415,6 +2419,10 @@ S: Am Muehlenweg 38 · 1167 unmodified lines
24152419 S: D53424 Remagen
24162420 S: Germany
24172421
2422+N: Jonathan Lemon
2423+E: jonathan.lemon@gmail.com
2424+D: OpenCompute PTP clock driver (ptp_ocp)
2425+
24182426 N: Colin Leroy
24192427 E: colin@colino.net
24202428 W: http://www.geekounet.org/
Documentation/ABI/testing/sysfs-block-zram+2−2
@@ -151,11 +151,11 @@ Description: · 150 unmodified lines
151151 The algorithm_params file is write-only and is used to setup
152152 compression algorithm parameters.
153153
154−What: /sys/block/zram<id>/writeback_compressed
154+What: /sys/block/zram<id>/compressed_writeback
155155 Date: Decemeber 2025
156156 Contact: Richard Chang <richardycc@google.com>
157157 Description:
158− The writeback_compressed device atrribute toggles compressed
158+ The compressed_writeback device atrribute toggles compressed
159159 writeback feature.
160160
161161 What: /sys/block/zram<id>/writeback_batch_size
Documentation/ABI/testing/sysfs-driver-uniwill-laptop+5−5
@@ -1,4 +1,4 @@
1−What: /sys/bus/platform/devices/INOU0000:XX/fn_lock_toggle_enable
1+What: /sys/bus/platform/devices/INOU0000:XX/fn_lock
22 Date: November 2025
33 KernelVersion: 6.19
44 Contact: Armin Wolf <W_Armin@gmx.de>
@@ -8,15 +8,15 @@ Description: · 3 unmodified lines
88
99 Reading this file returns the current enable status of the FN lock functionality.
1010
11−What: /sys/bus/platform/devices/INOU0000:XX/super_key_toggle_enable
11+What: /sys/bus/platform/devices/INOU0000:XX/super_key_enable
1212 Date: November 2025
1313 KernelVersion: 6.19
1414 Contact: Armin Wolf <W_Armin@gmx.de>
1515 Description:
16− Allows userspace applications to enable/disable the super key functionality
17− of the integrated keyboard by writing "1"/"0" into this file.
16+ Allows userspace applications to enable/disable the super key of the integrated
17+ keyboard by writing "1"/"0" into this file.
1818
19− Reading this file returns the current enable status of the super key functionality.
19+ Reading this file returns the current enable status of the super key.
2020
2121 What: /sys/bus/platform/devices/INOU0000:XX/touchpad_toggle_enable
2222 Date: November 2025
Documentation/admin-guide/blockdev/zram.rst+3−3
@@ -216,7 +216,7 @@ writeback_limit WO specifies the maximum amount of write IO zram · 215 unmodified lines
216216 writeback_limit_enable RW show and set writeback_limit feature
217217 writeback_batch_size RW show and set maximum number of in-flight
218218 writeback operations
219−writeback_compressed RW show and set compressed writeback feature
219+compressed_writeback RW show and set compressed writeback feature
220220 comp_algorithm RW show and change the compression algorithm
221221 algorithm_params WO setup compression algorithm parameters
222222 compact WO trigger memory compaction
@@ -439,11 +439,11 @@ budget in next setting is user's job. · 216 unmodified lines
439439 By default zram stores written back pages in decompressed (raw) form, which
440440 means that writeback operation involves decompression of the page before
441441 writing it to the backing device. This behavior can be changed by enabling
442−`writeback_compressed` feature, which causes zram to write compressed pages
442+`compressed_writeback` feature, which causes zram to write compressed pages
443443 to the backing device, thus avoiding decompression overhead. To enable
444444 this feature, execute::
445445
446− $ echo yes > /sys/block/zramX/writeback_compressed
446+ $ echo yes > /sys/block/zramX/compressed_writeback
447447
448448 Note that this feature should be configured before the `zramX` device is
449449 initialized.
Documentation/admin-guide/kernel-parameters.txt+16−0
@@ -74,6 +74,7 @@ · 73 unmodified lines
7474 TPM TPM drivers are enabled.
7575 UMS USB Mass Storage support is enabled.
7676 USB USB support is enabled.
77+ NVME NVMe support is enabled
7778 USBHID USB Human Interface Device support is enabled.
7879 V4L Video For Linux support is enabled.
7980 VGA The VGA console has been enabled.
@@ -4787,6 +4788,18 @@ Kernel parameters · 4707 unmodified lines
47874788 This can be set from sysctl after boot.
47884789 See Documentation/admin-guide/sysctl/vm.rst for details.
47894790
4791+ nvme.quirks= [NVME] A list of quirk entries to augment the built-in
4792+ nvme quirk list. List entries are separated by a
4793+ '-' character.
4794+ Each entry has the form VendorID:ProductID:quirk_names.
4795+ The IDs are 4-digits hex numbers and quirk_names is a
4796+ list of quirk names separated by commas. A quirk name
4797+ can be prefixed by '^', meaning that the specified
4798+ quirk must be disabled.
4799+
4800+ Example:
4801+ nvme.quirks=7710:2267:bogus_nid,^identify_cns-9900:7711:broken_msi
4802+
47904803 ohci1394_dma=early [HW,EARLY] enable debugging via the ohci1394 driver.
47914804 See Documentation/core-api/debugging-via-ohci1394.rst for more
47924805 info.
@@ -8183,6 +8196,9 @@ Kernel parameters · 3390 unmodified lines
81838196 p = USB_QUIRK_SHORT_SET_ADDRESS_REQ_TIMEOUT
81848197 (Reduce timeout of the SET_ADDRESS
81858198 request from 5000 ms to 500 ms);
8199+ q = USB_QUIRK_FORCE_ONE_CONFIG (Device
8200+ claims zero configurations,
8201+ forcing to 1);
81868202 Example: quirks=0781:5580:bk,0a5c:5834:gij
81878203
81888204 usbhid.mousepoll=
Documentation/admin-guide/laptops/uniwill-laptop.rst+1−1
@@ -24,7 +24,7 @@ Keyboard settings · 23 unmodified lines
2424
2525 The ``uniwill-laptop`` driver allows the user to enable/disable:
2626
27− - the FN and super key lock functionality of the integrated keyboard
27+ - the FN lock and super key of the integrated keyboard
2828 - the touchpad toggle functionality of the integrated touchpad
2929
3030 See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for details.
Documentation/admin-guide/sysctl/net.rst+3−0
@@ -594,6 +594,9 @@ Values: · 593 unmodified lines
594594 their sockets will only be able to connect within their own
595595 namespace.
596596
597+The first write to ``child_ns_mode`` locks its value. Subsequent writes of the
598+same value succeed, but writing a different value returns ``-EBUSY``.
599+
597600 Changing ``child_ns_mode`` only affects namespaces created after the change;
598601 it does not modify the current namespace or any existing children.
599602
Documentation/devicetree/bindings/display/msm/dp-controller.yaml+20−1
@@ -253,7 +253,6 @@ allOf: · 252 unmodified lines
253253 enum:
254254 # these platforms support 2 streams MST on some interfaces,
255255 # others are SST only
256− - qcom,glymur-dp
257256 - qcom,sc8280xp-dp
258257 - qcom,x1e80100-dp
259258 then:
@@ -310,6 +309,26 @@ allOf: · 50 unmodified lines
310309 minItems: 6
311310 maxItems: 8
312311
312+ - if:
313+ properties:
314+ compatible:
315+ contains:
316+ enum:
317+ # these platforms support 2 streams MST on some interfaces,
318+ # others are SST only, but all controllers have 4 ports
319+ - qcom,glymur-dp
320+ then:
321+ properties:
322+ reg:
323+ minItems: 9
324+ maxItems: 9
325+ clocks:
326+ minItems: 5
327+ maxItems: 6
328+ clocks-names:
329+ minItems: 5
330+ maxItems: 6
331+
313332 unevaluatedProperties: false
314333
315334 examples:
Documentation/devicetree/bindings/display/msm/qcom,glymur-mdss.yaml+10−6
@@ -176,13 +176,17 @@ examples: · 175 unmodified lines
176176 };
177177 };
178178
179− displayport-controller@ae90000 {
179+ displayport-controller@af54000 {
180180 compatible = "qcom,glymur-dp";
181− reg = <0xae90000 0x200>,
182− <0xae90200 0x200>,
183− <0xae90400 0x600>,
184− <0xae91000 0x400>,
185− <0xae91400 0x400>;
181+ reg = <0xaf54000 0x200>,
182+ <0xaf54200 0x200>,
183+ <0xaf55000 0xc00>,
184+ <0xaf56000 0x400>,
185+ <0xaf57000 0x400>,
186+ <0xaf58000 0x400>,
187+ <0xaf59000 0x400>,
188+ <0xaf5a000 0x600>,
189+ <0xaf5b000 0x600>;
186190
187191 interrupt-parent = <&mdss>;
188192 interrupts = <12>;
Documentation/devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml+1−1
@@ -10,7 +10,7 @@ maintainers: · 9 unmodified lines
1010 - Krzysztof Kozlowski <krzk@kernel.org>
1111
1212 description:
13− SM8650 MSM Mobile Display Subsystem(MDSS), which encapsulates sub-blocks like
13+ SM8750 MSM Mobile Display Subsystem(MDSS), which encapsulates sub-blocks like
1414 DPU display controller, DSI and DP interfaces etc.
1515
1616 $ref: /schemas/display/msm/mdss-common.yaml#
Documentation/devicetree/bindings/hwmon/kontron,sl28cpld-hwmon.yaml+0−1
@@ -16,7 +16,6 @@ description: | · 15 unmodified lines
1616 properties:
1717 compatible:
1818 enum:
19− - kontron,sa67mcu-hwmon
2019 - kontron,sl28cpld-fan
2120
2221 reg:
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Synopsys DesignWare APB I2C Controller
88
99 maintainers:
10− - Jarkko Nikula <jarkko.nikula@linux.intel.com>
10+ - Mika Westerberg <mika.westerberg@linux.intel.com>
1111
1212 allOf:
1313 - $ref: /schemas/i2c/i2c-controller.yaml#
Documentation/devicetree/bindings/net/can/nxp,sja1000.yaml+1−0
@@ -87,6 +87,7 @@ required: · 86 unmodified lines
8787
8888 allOf:
8989 - $ref: can-controller.yaml#
90+ - $ref: /schemas/memory-controllers/mc-peripheral-props.yaml
9091 - if:
9192 properties:
9293 compatible:
Documentation/devicetree/bindings/powerpc/fsl/fsl,mpc83xx.yaml+93−0
@@ -0,0 +1,93 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/powerpc/fsl/fsl,mpc83xx.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Freescale PowerQUICC II Pro (MPC83xx) platforms
8+
9+maintainers:
10+ - J. Neuschäfer <j.ne@posteo.net>
11+
12+properties:
13+ $nodename:
14+ const: '/'
15+ compatible:
16+ oneOf:
17+ - description: MPC83xx Reference Design Boards
18+ items:
19+ - enum:
20+ - fsl,mpc8308rdb
21+ - fsl,mpc8315erdb
22+ - fsl,mpc8360rdk
23+ - fsl,mpc8377rdb
24+ - fsl,mpc8377wlan
25+ - fsl,mpc8378rdb
26+ - fsl,mpc8379rdb
27+
28+ - description: MPC8313E Reference Design Board
29+ items:
30+ - const: MPC8313ERDB
31+ - const: MPC831xRDB
32+ - const: MPC83xxRDB
33+
34+ - description: MPC8323E Reference Design Board
35+ items:
36+ - const: MPC8323ERDB
37+ - const: MPC832xRDB
38+ - const: MPC83xxRDB
39+
40+ - description: MPC8349E-mITX(-GP) Reference Design Platform
41+ items:
42+ - enum:
43+ - MPC8349EMITX
44+ - MPC8349EMITXGP
45+ - const: MPC834xMITX
46+ - const: MPC83xxMITX
47+
48+ - description: Keymile KMETER1 board
49+ const: keymile,KMETER1
50+
51+ - description: MPC8308 P1M board
52+ const: denx,mpc8308_p1m
53+
54+patternProperties:
55+ "^soc@.*$":
56+ type: object
57+ properties:
58+ compatible:
59+ oneOf:
60+ - items:
61+ - enum:
62+ - fsl,mpc8315-immr
63+ - fsl,mpc8308-immr
64+ - const: simple-bus
65+ - items:
66+ - const: fsl,mpc8360-immr
67+ - const: fsl,immr
68+ - const: fsl,soc
69+ - const: simple-bus
70+ - const: simple-bus
71+
72+additionalProperties: true
73+
74+examples:
75+ - |
76+ / {
77+ compatible = "fsl,mpc8315erdb";
78+ model = "MPC8315E-RDB";
79+ #address-cells = <1>;
80+ #size-cells = <1>;
81+
82+ soc@e0000000 {
83+ compatible = "fsl,mpc8315-immr", "simple-bus";
84+ reg = <0xe0000000 0x00000200>;
85+ #address-cells = <1>;
86+ #size-cells = <1>;
87+ device_type = "soc";
88+ ranges = <0 0xe0000000 0x00100000>;
89+ bus-frequency = <0>;
90+ };
91+ };
92+
93+...
Documentation/devicetree/bindings/regulator/mt6359-regulator.yaml+2−2
@@ -287,7 +287,7 @@ examples: · 286 unmodified lines
287287 regulator-max-microvolt = <1700000>;
288288 };
289289 mt6359_vrfck_1_ldo_reg: ldo_vrfck_1 {
290− regulator-name = "vrfck";
290+ regulator-name = "vrfck_1";
291291 regulator-min-microvolt = <1240000>;
292292 regulator-max-microvolt = <1600000>;
293293 };
@@ -309,7 +309,7 @@ examples: · 15 unmodified lines
309309 regulator-max-microvolt = <3300000>;
310310 };
311311 mt6359_vemc_1_ldo_reg: ldo_vemc_1 {
312− regulator-name = "vemc";
312+ regulator-name = "vemc_1";
313313 regulator-min-microvolt = <2500000>;
314314 regulator-max-microvolt = <3300000>;
315315 };
Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml+1−0
@@ -23,6 +23,7 @@ properties: · 22 unmodified lines
2323 enum:
2424 - nvidia,tegra210-audio-graph-card
2525 - nvidia,tegra186-audio-graph-card
26+ - nvidia,tegra238-audio-graph-card
2627 - nvidia,tegra264-audio-graph-card
2728
2829 clocks:
Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml+1−0
@@ -20,6 +20,7 @@ properties: · 19 unmodified lines
2020 - renesas,r9a07g044-ssi # RZ/G2{L,LC}
2121 - renesas,r9a07g054-ssi # RZ/V2L
2222 - renesas,r9a08g045-ssi # RZ/G3S
23+ - renesas,r9a08g046-ssi # RZ/G3L
2324 - const: renesas,rz-ssi
2425
2526 reg:
Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml+24−5
@@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 5 unmodified lines
66
77 title: Allwinner A31 SPI Controller
88
9−allOf:
10− - $ref: spi-controller.yaml
11−
129 maintainers:
1310 - Chen-Yu Tsai <wens@csie.org>
1411 - Maxime Ripard <mripard@kernel.org>
@@ -82,11 +79,11 @@ patternProperties: · 67 unmodified lines
8279
8380 spi-rx-bus-width:
8481 items:
85− - const: 1
82+ enum: [0, 1, 2, 4]
8683
8784 spi-tx-bus-width:
8885 items:
89− - const: 1
86+ enum: [0, 1, 2, 4]
9087
9188 required:
9289 - compatible
@@ -95,6 +92,28 @@ required: · 2 unmodified lines
9592 - clocks
9693 - clock-names
9794
95+allOf:
96+ - $ref: spi-controller.yaml
97+ - if:
98+ not:
99+ properties:
100+ compatible:
101+ contains:
102+ enum:
103+ - allwinner,sun50i-r329-spi
104+ - allwinner,sun55i-a523-spi
105+ then:
106+ patternProperties:
107+ "^.*@[0-9a-f]+":
108+ properties:
109+ spi-rx-bus-width:
110+ items:
111+ enum: [0, 1]
112+
113+ spi-tx-bus-width:
114+ items:
115+ enum: [0, 1]
116+
98117 unevaluatedProperties: false
99118
100119 examples:
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml+1−30
@@ -22,21 +22,6 @@ allOf: · 21 unmodified lines
2222 properties:
2323 reg:
2424 minItems: 2
25− - if:
26− properties:
27− compatible:
28− contains:
29− enum:
30− - baikal,bt1-sys-ssi
31− then:
32− properties:
33− mux-controls:
34− maxItems: 1
35− required:
36− - mux-controls
37− else:
38− required:
39− - interrupts
4025 - if:
4126 properties:
4227 compatible:
@@ -75,10 +60,6 @@ properties: · 32 unmodified lines
7560 const: intel,mountevans-imc-ssi
7661 - description: AMD Pensando Elba SoC SPI Controller
7762 const: amd,pensando-elba-spi
78− - description: Baikal-T1 SPI Controller
79− const: baikal,bt1-ssi
80− - description: Baikal-T1 System Boot SPI Controller
81− const: baikal,bt1-sys-ssi
8263 - description: Canaan Kendryte K210 SoS SPI Controller
8364 const: canaan,k210-spi
8465 - description: Renesas RZ/N1 SPI Controller
@@ -170,6 +151,7 @@ required: · 85 unmodified lines
170151 - "#address-cells"
171152 - "#size-cells"
172153 - clocks
154+ - interrupts
173155
174156 examples:
175157 - |
@@ -190,15 +172,4 @@ examples: · 14 unmodified lines
190172 rx-sample-delay-ns = <7>;
191173 };
192174 };
193− - |
194− spi@1f040100 {
195− compatible = "baikal,bt1-sys-ssi";
196− reg = <0x1f040100 0x900>,
197− <0x1c000000 0x1000000>;
198− #address-cells = <1>;
199− #size-cells = <0>;
200− mux-controls = <&boot_mux>;
201− clocks = <&ccu_sys>;
202− clock-names = "ssi_clk";
203− };
204175 ...
Documentation/hwmon/emc1403.rst+1−1
@@ -57,7 +57,7 @@ Supported chips: · 56 unmodified lines
5757 - https://ww1.microchip.com/downloads/en/DeviceDoc/EMC1438%20DS%20Rev.%201.0%20(04-29-10).pdf
5858
5959 Author:
60− Kalhan Trisal <kalhan.trisal@intel.com
60+ Kalhan Trisal <kalhan.trisal@intel.com>
6161
6262
6363 Description
Documentation/hwmon/index.rst+0−1
@@ -220,7 +220,6 @@ Hardware Monitoring Kernel Drivers · 219 unmodified lines
220220 q54sj108a2
221221 qnap-mcu-hwmon
222222 raspberrypi-hwmon
223− sa67
224223 sbrmi
225224 sbtsi_temp
226225 sch5627
Documentation/hwmon/sa67.rst+0−41
@@ -1,41 +0,0 @@
1−.. SPDX-License-Identifier: GPL-2.0-only
2−
3−Kernel driver sa67mcu
4−=====================
5−
6−Supported chips:
7−
8− * Kontron sa67mcu
9−
10− Prefix: 'sa67mcu'
11−
12− Datasheet: not available
13−
14−Authors: Michael Walle <mwalle@kernel.org>
15−
16−Description
17−-----------
18−
19−The sa67mcu is a board management controller which also exposes a hardware
20−monitoring controller.
21−
22−The controller has two voltage and one temperature sensor. The values are
23−hold in two 8 bit registers to form one 16 bit value. Reading the lower byte
24−will also capture the high byte to make the access atomic. The unit of the
25−volatge sensors are 1mV and the unit of the temperature sensor is 0.1degC.
26−
27−Sysfs entries
28−-------------
29−
30−The following attributes are supported.
31−
32−======================= ========================================================
33−in0_label "VDDIN"
34−in0_input Measured VDDIN voltage.
35−
36−in1_label "VDD_RTC"
37−in1_input Measured VDD_RTC voltage.
38−
39−temp1_input MCU temperature. Roughly the board temperature.
40−======================= ========================================================
41−
Documentation/netlink/specs/nfsd.yaml+2−2
@@ -152,7 +152,7 @@ operations: · 151 unmodified lines
152152 - compound-ops
153153 -
154154 name: threads-set
155− doc: set the number of running threads
155+ doc: set the maximum number of running threads
156156 attribute-set: server
157157 flags: [admin-perm]
158158 do:
@@ -165,7 +165,7 @@ operations: · 6 unmodified lines
165165 - min-threads
166166 -
167167 name: threads-get
168− doc: get the number of running threads
168+ doc: get the maximum number of running threads
169169 attribute-set: server
170170 do:
171171 reply:
Documentation/scheduler/sched-ext.rst+27−3
@@ -43,7 +43,6 @@ options should be enabled to use sched_ext: · 42 unmodified lines
4343 CONFIG_DEBUG_INFO_BTF=y
4444 CONFIG_BPF_JIT_ALWAYS_ON=y
4545 CONFIG_BPF_JIT_DEFAULT_ON=y
46− CONFIG_PAHOLE_HAS_BTF_TAG=y
4746
4847 sched_ext is used only when the BPF scheduler is loaded and running.
4948
@@ -58,7 +57,8 @@ in ``ops->flags``, all ``SCHED_NORMAL``, ``SCHED_BATCH``, ``SCHED_IDLE``, and · 8 unmodified lines
5857 However, when the BPF scheduler is loaded and ``SCX_OPS_SWITCH_PARTIAL`` is
5958 set in ``ops->flags``, only tasks with the ``SCHED_EXT`` policy are scheduled
6059 by sched_ext, while tasks with ``SCHED_NORMAL``, ``SCHED_BATCH`` and
61−``SCHED_IDLE`` policies are scheduled by the fair-class scheduler.
60+``SCHED_IDLE`` policies are scheduled by the fair-class scheduler which has
61+higher sched_class precedence than ``SCHED_EXT``.
6262
6363 Terminating the sched_ext scheduler program, triggering `SysRq-S`, or
6464 detection of any internal error including stalled runnable tasks aborts the
@@ -345,6 +345,8 @@ Where to Look · 280 unmodified lines
345345 The functions prefixed with ``scx_bpf_`` can be called from the BPF
346346 scheduler.
347347
348+* ``kernel/sched/ext_idle.c`` contains the built-in idle CPU selection policy.
349+
348350 * ``tools/sched_ext/`` hosts example BPF scheduler implementations.
349351
350352 * ``scx_simple[.bpf].c``: Minimal global FIFO scheduler example using a
@@ -353,13 +355,35 @@ Where to Look · 2 unmodified lines
353355 * ``scx_qmap[.bpf].c``: A multi-level FIFO scheduler supporting five
354356 levels of priority implemented with ``BPF_MAP_TYPE_QUEUE``.
355357
358+ * ``scx_central[.bpf].c``: A central FIFO scheduler where all scheduling
359+ decisions are made on one CPU, demonstrating ``LOCAL_ON`` dispatching,
360+ tickless operation, and kthread preemption.
361+
362+ * ``scx_cpu0[.bpf].c``: A scheduler that queues all tasks to a shared DSQ
363+ and only dispatches them on CPU0 in FIFO order. Useful for testing bypass
364+ behavior.
365+
366+ * ``scx_flatcg[.bpf].c``: A flattened cgroup hierarchy scheduler
367+ implementing hierarchical weight-based cgroup CPU control by compounding
368+ each cgroup's share at every level into a single flat scheduling layer.
369+
370+ * ``scx_pair[.bpf].c``: A core-scheduling example that always makes
371+ sibling CPU pairs execute tasks from the same CPU cgroup.
372+
373+ * ``scx_sdt[.bpf].c``: A variation of ``scx_simple`` demonstrating BPF
374+ arena memory management for per-task data.
375+
376+ * ``scx_userland[.bpf].c``: A minimal scheduler demonstrating user space
377+ scheduling. Tasks with CPU affinity are direct-dispatched in FIFO order;
378+ all others are scheduled in user space by a simple vruntime scheduler.
379+
356380 ABI Instability
357381 ===============
358382
359383 The APIs provided by sched_ext to BPF schedulers programs have no stability
360384 guarantees. This includes the ops table callbacks and constants defined in
361385 ``include/linux/sched/ext.h``, as well as the ``scx_bpf_`` kfuncs defined in
362−``kernel/sched/ext.c``.
386+``kernel/sched/ext.c`` and ``kernel/sched/ext_idle.c``.
363387
364388 While we will attempt to provide a relatively stable API surface when
365389 possible, they are subject to change without warning between kernel
Documentation/sound/alsa-configuration.rst+4−0
@@ -2372,6 +2372,10 @@ quirk_flags · 2371 unmodified lines
23722372 audible volume
23732373 * bit 25: ``mixer_capture_min_mute``
23742374 Similar to bit 24 but for capture streams
2375+ * bit 26: ``skip_iface_setup``
2376+ Skip the probe-time interface setup (usb_set_interface,
2377+ init_pitch, init_sample_rate); redundant with
2378+ snd_usb_endpoint_prepare() at stream-open time
23752379
23762380 This module supports multiple devices, autoprobe and hotplugging.
23772381
Documentation/virt/kvm/api.rst+121−115
@@ -1396,7 +1396,10 @@ or its flags may be modified, but it may not be resized. · 1395 unmodified lines
13961396 Memory for the region is taken starting at the address denoted by the
13971397 field userspace_addr, which must point at user addressable memory for
13981398 the entire memory slot size. Any object may back this memory, including
1399−anonymous memory, ordinary files, and hugetlbfs.
1399+anonymous memory, ordinary files, and hugetlbfs. Changes in the backing
1400+of the memory region are automatically reflected into the guest.
1401+For example, an mmap() that affects the region will be made visible
1402+immediately. Another example is madvise(MADV_DROP).
14001403
14011404 On architectures that support a form of address tagging, userspace_addr must
14021405 be an untagged address.
@@ -1412,11 +1415,6 @@ use it. The latter can be set, if KVM_CAP_READONLY_MEM capability allows it, · 9 unmodified lines
14121415 to make a new slot read-only. In this case, writes to this memory will be
14131416 posted to userspace as KVM_EXIT_MMIO exits.
14141417
1415−When the KVM_CAP_SYNC_MMU capability is available, changes in the backing of
1416−the memory region are automatically reflected into the guest. For example, an
1417−mmap() that affects the region will be made visible immediately. Another
1418−example is madvise(MADV_DROP).
1419−
14201418 For TDX guest, deleting/moving memory region loses guest memory contents.
14211419 Read only region isn't supported. Only as-id 0 is supported.
14221420
@@ -8437,115 +8435,123 @@ KVM_CHECK_EXTENSION. · 7014 unmodified lines
84378435
84388436 The valid bits in cap.args[0] are:
84398437
8440−=================================== ============================================
8441− KVM_X86_QUIRK_LINT0_REENABLED By default, the reset value for the LVT
8442− LINT0 register is 0x700 (APIC_MODE_EXTINT).
8443− When this quirk is disabled, the reset value
8444− is 0x10000 (APIC_LVT_MASKED).
8445−
8446− KVM_X86_QUIRK_CD_NW_CLEARED By default, KVM clears CR0.CD and CR0.NW on
8447− AMD CPUs to workaround buggy guest firmware
8448− that runs in perpetuity with CR0.CD, i.e.
8449− with caches in "no fill" mode.
8450−
8451− When this quirk is disabled, KVM does not
8452− change the value of CR0.CD and CR0.NW.
8453−
8454− KVM_X86_QUIRK_LAPIC_MMIO_HOLE By default, the MMIO LAPIC interface is
8455− available even when configured for x2APIC
8456− mode. When this quirk is disabled, KVM
8457− disables the MMIO LAPIC interface if the
8458− LAPIC is in x2APIC mode.
8459−
8460− KVM_X86_QUIRK_OUT_7E_INC_RIP By default, KVM pre-increments %rip before
8461− exiting to userspace for an OUT instruction
8462− to port 0x7e. When this quirk is disabled,
8463− KVM does not pre-increment %rip before
8464− exiting to userspace.
8465−
8466− KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT When this quirk is disabled, KVM sets
8467− CPUID.01H:ECX[bit 3] (MONITOR/MWAIT) if
8468− IA32_MISC_ENABLE[bit 18] (MWAIT) is set.
8469− Additionally, when this quirk is disabled,
8470− KVM clears CPUID.01H:ECX[bit 3] if
8471− IA32_MISC_ENABLE[bit 18] is cleared.
8472−
8473− KVM_X86_QUIRK_FIX_HYPERCALL_INSN By default, KVM rewrites guest
8474− VMMCALL/VMCALL instructions to match the
8475− vendor's hypercall instruction for the
8476− system. When this quirk is disabled, KVM
8477− will no longer rewrite invalid guest
8478− hypercall instructions. Executing the
8479− incorrect hypercall instruction will
8480− generate a #UD within the guest.
8481−
8482−KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS By default, KVM emulates MONITOR/MWAIT (if
8483− they are intercepted) as NOPs regardless of
8484− whether or not MONITOR/MWAIT are supported
8485− according to guest CPUID. When this quirk
8486− is disabled and KVM_X86_DISABLE_EXITS_MWAIT
8487− is not set (MONITOR/MWAIT are intercepted),
8488− KVM will inject a #UD on MONITOR/MWAIT if
8489− they're unsupported per guest CPUID. Note,
8490− KVM will modify MONITOR/MWAIT support in
8491− guest CPUID on writes to MISC_ENABLE if
8492− KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT is
8493− disabled.
8494−
8495−KVM_X86_QUIRK_SLOT_ZAP_ALL By default, for KVM_X86_DEFAULT_VM VMs, KVM
8496− invalidates all SPTEs in all memslots and
8497− address spaces when a memslot is deleted or
8498− moved. When this quirk is disabled (or the
8499− VM type isn't KVM_X86_DEFAULT_VM), KVM only
8500− ensures the backing memory of the deleted
8501− or moved memslot isn't reachable, i.e KVM
8502− _may_ invalidate only SPTEs related to the
8503− memslot.
8504−
8505−KVM_X86_QUIRK_STUFF_FEATURE_MSRS By default, at vCPU creation, KVM sets the
8506− vCPU's MSR_IA32_PERF_CAPABILITIES (0x345),
8507− MSR_IA32_ARCH_CAPABILITIES (0x10a),
8508− MSR_PLATFORM_INFO (0xce), and all VMX MSRs
8509− (0x480..0x492) to the maximal capabilities
8510− supported by KVM. KVM also sets
8511− MSR_IA32_UCODE_REV (0x8b) to an arbitrary
8512− value (which is different for Intel vs.
8513− AMD). Lastly, when guest CPUID is set (by
8514− userspace), KVM modifies select VMX MSR
8515− fields to force consistency between guest
8516− CPUID and L2's effective ISA. When this
8517− quirk is disabled, KVM zeroes the vCPU's MSR
8518− values (with two exceptions, see below),
8519− i.e. treats the feature MSRs like CPUID
8520− leaves and gives userspace full control of
8521− the vCPU model definition. This quirk does
8522− not affect VMX MSRs CR0/CR4_FIXED1 (0x487
8523− and 0x489), as KVM does now allow them to
8524− be set by userspace (KVM sets them based on
8525− guest CPUID, for safety purposes).
8526−
8527−KVM_X86_QUIRK_IGNORE_GUEST_PAT By default, on Intel platforms, KVM ignores
8528− guest PAT and forces the effective memory
8529− type to WB in EPT. The quirk is not available
8530− on Intel platforms which are incapable of
8531− safely honoring guest PAT (i.e., without CPU
8532− self-snoop, KVM always ignores guest PAT and
8533− forces effective memory type to WB). It is
8534− also ignored on AMD platforms or, on Intel,
8535− when a VM has non-coherent DMA devices
8536− assigned; KVM always honors guest PAT in
8537− such case. The quirk is needed to avoid
8538− slowdowns on certain Intel Xeon platforms
8539− (e.g. ICX, SPR) where self-snoop feature is
8540− supported but UC is slow enough to cause
8541− issues with some older guests that use
8542− UC instead of WC to map the video RAM.
8543− Userspace can disable the quirk to honor
8544− guest PAT if it knows that there is no such
8545− guest software, for example if it does not
8546− expose a bochs graphics device (which is
8547− known to have had a buggy driver).
8548−=================================== ============================================
8438+======================================== ================================================
8439+KVM_X86_QUIRK_LINT0_REENABLED By default, the reset value for the LVT
8440+ LINT0 register is 0x700 (APIC_MODE_EXTINT).
8441+ When this quirk is disabled, the reset value
8442+ is 0x10000 (APIC_LVT_MASKED).
8443+
8444+KVM_X86_QUIRK_CD_NW_CLEARED By default, KVM clears CR0.CD and CR0.NW on
8445+ AMD CPUs to workaround buggy guest firmware
8446+ that runs in perpetuity with CR0.CD, i.e.
8447+ with caches in "no fill" mode.
8448+
8449+ When this quirk is disabled, KVM does not
8450+ change the value of CR0.CD and CR0.NW.
8451+
8452+KVM_X86_QUIRK_LAPIC_MMIO_HOLE By default, the MMIO LAPIC interface is
8453+ available even when configured for x2APIC
8454+ mode. When this quirk is disabled, KVM
8455+ disables the MMIO LAPIC interface if the
8456+ LAPIC is in x2APIC mode.
8457+
8458+KVM_X86_QUIRK_OUT_7E_INC_RIP By default, KVM pre-increments %rip before
8459+ exiting to userspace for an OUT instruction
8460+ to port 0x7e. When this quirk is disabled,
8461+ KVM does not pre-increment %rip before
8462+ exiting to userspace.
8463+
8464+KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT When this quirk is disabled, KVM sets
8465+ CPUID.01H:ECX[bit 3] (MONITOR/MWAIT) if
8466+ IA32_MISC_ENABLE[bit 18] (MWAIT) is set.
8467+ Additionally, when this quirk is disabled,
8468+ KVM clears CPUID.01H:ECX[bit 3] if
8469+ IA32_MISC_ENABLE[bit 18] is cleared.
8470+
8471+KVM_X86_QUIRK_FIX_HYPERCALL_INSN By default, KVM rewrites guest
8472+ VMMCALL/VMCALL instructions to match the
8473+ vendor's hypercall instruction for the
8474+ system. When this quirk is disabled, KVM
8475+ will no longer rewrite invalid guest
8476+ hypercall instructions. Executing the
8477+ incorrect hypercall instruction will
8478+ generate a #UD within the guest.
8479+
8480+KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS By default, KVM emulates MONITOR/MWAIT (if
8481+ they are intercepted) as NOPs regardless of
8482+ whether or not MONITOR/MWAIT are supported
8483+ according to guest CPUID. When this quirk
8484+ is disabled and KVM_X86_DISABLE_EXITS_MWAIT
8485+ is not set (MONITOR/MWAIT are intercepted),
8486+ KVM will inject a #UD on MONITOR/MWAIT if
8487+ they're unsupported per guest CPUID. Note,
8488+ KVM will modify MONITOR/MWAIT support in
8489+ guest CPUID on writes to MISC_ENABLE if
8490+ KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT is
8491+ disabled.
8492+
8493+KVM_X86_QUIRK_SLOT_ZAP_ALL By default, for KVM_X86_DEFAULT_VM VMs, KVM
8494+ invalidates all SPTEs in all memslots and
8495+ address spaces when a memslot is deleted or
8496+ moved. When this quirk is disabled (or the
8497+ VM type isn't KVM_X86_DEFAULT_VM), KVM only
8498+ ensures the backing memory of the deleted
8499+ or moved memslot isn't reachable, i.e KVM
8500+ _may_ invalidate only SPTEs related to the
8501+ memslot.
8502+
8503+KVM_X86_QUIRK_STUFF_FEATURE_MSRS By default, at vCPU creation, KVM sets the
8504+ vCPU's MSR_IA32_PERF_CAPABILITIES (0x345),
8505+ MSR_IA32_ARCH_CAPABILITIES (0x10a),
8506+ MSR_PLATFORM_INFO (0xce), and all VMX MSRs
8507+ (0x480..0x492) to the maximal capabilities
8508+ supported by KVM. KVM also sets
8509+ MSR_IA32_UCODE_REV (0x8b) to an arbitrary
8510+ value (which is different for Intel vs.
8511+ AMD). Lastly, when guest CPUID is set (by
8512+ userspace), KVM modifies select VMX MSR
8513+ fields to force consistency between guest
8514+ CPUID and L2's effective ISA. When this
8515+ quirk is disabled, KVM zeroes the vCPU's MSR
8516+ values (with two exceptions, see below),
8517+ i.e. treats the feature MSRs like CPUID
8518+ leaves and gives userspace full control of
8519+ the vCPU model definition. This quirk does
8520+ not affect VMX MSRs CR0/CR4_FIXED1 (0x487
8521+ and 0x489), as KVM does now allow them to
8522+ be set by userspace (KVM sets them based on
8523+ guest CPUID, for safety purposes).
8524+
8525+KVM_X86_QUIRK_IGNORE_GUEST_PAT By default, on Intel platforms, KVM ignores
8526+ guest PAT and forces the effective memory
8527+ type to WB in EPT. The quirk is not available
8528+ on Intel platforms which are incapable of
8529+ safely honoring guest PAT (i.e., without CPU
8530+ self-snoop, KVM always ignores guest PAT and
8531+ forces effective memory type to WB). It is
8532+ also ignored on AMD platforms or, on Intel,
8533+ when a VM has non-coherent DMA devices
8534+ assigned; KVM always honors guest PAT in
8535+ such case. The quirk is needed to avoid
8536+ slowdowns on certain Intel Xeon platforms
8537+ (e.g. ICX, SPR) where self-snoop feature is
8538+ supported but UC is slow enough to cause
8539+ issues with some older guests that use
8540+ UC instead of WC to map the video RAM.
8541+ Userspace can disable the quirk to honor
8542+ guest PAT if it knows that there is no such
8543+ guest software, for example if it does not
8544+ expose a bochs graphics device (which is
8545+ known to have had a buggy driver).
8546+
8547+KVM_X86_QUIRK_VMCS12_ALLOW_FREEZE_IN_SMM By default, KVM relaxes the consistency
8548+ check for GUEST_IA32_DEBUGCTL in vmcs12
8549+ to allow FREEZE_IN_SMM to be set. When
8550+ this quirk is disabled, KVM requires this
8551+ bit to be cleared. Note that the vmcs02
8552+ bit is still completely controlled by the
8553+ host, regardless of the quirk setting.
8554+======================================== ================================================
85498555
85508556 7.32 KVM_CAP_MAX_VCPU_ID
85518557 ------------------------
Documentation/virt/kvm/locking.rst+2−0
@@ -17,6 +17,8 @@ The acquisition orders for mutexes are as follows: · 16 unmodified lines
1717
1818 - kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock
1919
20+- vcpu->mutex is taken outside kvm->slots_lock and kvm->slots_arch_lock
21+
2022 - kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
2123 them together is quite rare.
2224
MAINTAINERS+57−65
@@ -996,10 +996,8 @@ F: Documentation/devicetree/bindings/thermal/amazon,al-thermal.yaml · 995 unmodified lines
996996 F: drivers/thermal/thermal_mmio.c
997997
998998 AMAZON ETHERNET DRIVERS
999−M: Shay Agroskin <shayagr@amazon.com>
1000999 M: Arthur Kiyanovski <akiyano@amazon.com>
1001−R: David Arinzon <darinzon@amazon.com>
1002−R: Saeed Bishara <saeedb@amazon.com>
1000+M: David Arinzon <darinzon@amazon.com>
10031001 L: netdev@vger.kernel.org
10041002 S: Maintained
10051003 F: Documentation/networking/device_drivers/ethernet/amazon/ena.rst
@@ -1295,7 +1293,6 @@ F: include/trace/events/amdxdna.h · 289 unmodified lines
12951293 F: include/uapi/drm/amdxdna_accel.h
12961294
12971295 AMD XGBE DRIVER
1298−M: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>
12991296 M: Raju Rangoju <Raju.Rangoju@amd.com>
13001297 L: netdev@vger.kernel.org
13011298 S: Maintained
@@ -4638,7 +4635,6 @@ F: drivers/bluetooth/ · 3336 unmodified lines
46384635
46394636 BLUETOOTH SUBSYSTEM
46404637 M: Marcel Holtmann <marcel@holtmann.org>
4641−M: Johan Hedberg <johan.hedberg@gmail.com>
46424638 M: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
46434639 L: linux-bluetooth@vger.kernel.org
46444640 S: Supported
@@ -6233,20 +6229,20 @@ F: drivers/scsi/fnic/ · 1588 unmodified lines
62336229
62346230 CISCO SCSI HBA DRIVER
62356231 M: Karan Tilak Kumar <kartilak@cisco.com>
6232+M: Narsimhulu Musini <nmusini@cisco.com>
62366233 M: Sesidhar Baddela <sebaddel@cisco.com>
62376234 L: linux-scsi@vger.kernel.org
62386235 S: Supported
62396236 F: drivers/scsi/snic/
62406237
62416238 CISCO VIC ETHERNET NIC DRIVER
6242−M: Christian Benvenuti <benve@cisco.com>
62436239 M: Satish Kharat <satishkh@cisco.com>
62446240 S: Maintained
62456241 F: drivers/net/ethernet/cisco/enic/
62466242
62476243 CISCO VIC LOW LATENCY NIC DRIVER
6248−M: Christian Benvenuti <benve@cisco.com>
62496244 M: Nelson Escobar <neescoba@cisco.com>
6245+M: Satish Kharat <satishkh@cisco.com>
62506246 S: Supported
62516247 F: drivers/infiniband/hw/usnic/
62526248
@@ -6300,7 +6296,7 @@ S: Maintained · 47 unmodified lines
63006296 F: include/linux/clk.h
63016297
63026298 CLOCKSOURCE, CLOCKEVENT DRIVERS
6303−M: Daniel Lezcano <daniel.lezcano@linaro.org>
6299+M: Daniel Lezcano <daniel.lezcano@kernel.org>
63046300 M: Thomas Gleixner <tglx@kernel.org>
63056301 L: linux-kernel@vger.kernel.org
63066302 S: Supported
@@ -6689,7 +6685,7 @@ F: rust/kernel/cpu.rs · 382 unmodified lines
66896685
66906686 CPU IDLE TIME MANAGEMENT FRAMEWORK
66916687 M: "Rafael J. Wysocki" <rafael@kernel.org>
6692−M: Daniel Lezcano <daniel.lezcano@linaro.org>
6688+M: Daniel Lezcano <daniel.lezcano@kernel.org>
66936689 R: Christian Loehle <christian.loehle@arm.com>
66946690 L: linux-pm@vger.kernel.org
66956691 S: Maintained
@@ -6719,7 +6715,7 @@ F: arch/x86/kernel/msr.c · 23 unmodified lines
67196715
67206716 CPUIDLE DRIVER - ARM BIG LITTLE
67216717 M: Lorenzo Pieralisi <lpieralisi@kernel.org>
6722−M: Daniel Lezcano <daniel.lezcano@linaro.org>
6718+M: Daniel Lezcano <daniel.lezcano@kernel.org>
67236719 L: linux-pm@vger.kernel.org
67246720 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
67256721 S: Maintained
@@ -6727,7 +6723,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git · 1 unmodified line
67276723 F: drivers/cpuidle/cpuidle-big_little.c
67286724
67296725 CPUIDLE DRIVER - ARM EXYNOS
6730−M: Daniel Lezcano <daniel.lezcano@linaro.org>
6726+M: Daniel Lezcano <daniel.lezcano@kernel.org>
67316727 M: Kukjin Kim <kgene@kernel.org>
67326728 R: Krzysztof Kozlowski <krzk@kernel.org>
67336729 L: linux-pm@vger.kernel.org
@@ -8650,9 +8646,8 @@ F: drivers/gpu/drm/lima/ · 1916 unmodified lines
86508646 F: include/uapi/drm/lima_drm.h
86518647
86528648 DRM DRIVERS FOR LOONGSON
8653−M: Sui Jingfeng <suijingfeng@loongson.cn>
86548649 L: dri-devel@lists.freedesktop.org
8655−S: Supported
8650+S: Orphan
86568651 T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
86578652 F: drivers/gpu/drm/loongson/
86588653
@@ -10192,8 +10187,8 @@ F: drivers/i2c/busses/i2c-cpm.c · 1533 unmodified lines
1019210187
1019310188 FREESCALE IMX / MXC FEC DRIVER
1019410189 M: Wei Fang <wei.fang@nxp.com>
10190+R: Frank Li <frank.li@nxp.com>
1019510191 R: Shenwei Wang <shenwei.wang@nxp.com>
10196−R: Clark Wang <xiaoning.wang@nxp.com>
1019710192 L: imx@lists.linux.dev
1019810193 L: netdev@vger.kernel.org
1019910194 S: Maintained
@@ -10505,7 +10500,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git · 305 unmodified lines
1050510500 F: Documentation/trace/ftrace*
1050610501 F: arch/*/*/*/*ftrace*
1050710502 F: arch/*/*/*ftrace*
10508−F: include/*/ftrace.h
10503+F: include/*/*ftrace*
1050910504 F: kernel/trace/fgraph.c
1051010505 F: kernel/trace/ftrace*
1051110506 F: samples/ftrace
@@ -12237,7 +12232,6 @@ IBM Power SRIOV Virtual NIC Device Driver · 1725 unmodified lines
1223712232 M: Haren Myneni <haren@linux.ibm.com>
1223812233 M: Rick Lindsley <ricklind@linux.ibm.com>
1223912234 R: Nick Child <nnac123@linux.ibm.com>
12240−R: Thomas Falcon <tlfalcon@linux.ibm.com>
1224112235 L: netdev@vger.kernel.org
1224212236 S: Maintained
1224312237 F: drivers/net/ethernet/ibm/ibmvnic.*
@@ -13963,7 +13957,7 @@ F: fs/smb/server/ · 1719 unmodified lines
1396313957
1396413958 KERNEL UNIT TESTING FRAMEWORK (KUnit)
1396513959 M: Brendan Higgins <brendan.higgins@linux.dev>
13966−M: David Gow <davidgow@google.com>
13960+M: David Gow <david@davidgow.net>
1396713961 R: Rae Moar <raemoar63@gmail.com>
1396813962 L: linux-kselftest@vger.kernel.org
1396913963 L: kunit-dev@googlegroups.com
@@ -14432,9 +14426,9 @@ LANTIQ PEF2256 DRIVER · 462 unmodified lines
1443214426 M: Herve Codina <herve.codina@bootlin.com>
1443314427 S: Maintained
1443414428 F: Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
14435−F: drivers/net/wan/framer/pef2256/
14429+F: drivers/net/wan/framer/
1443614430 F: drivers/pinctrl/pinctrl-pef2256.c
14437−F: include/linux/framer/pef2256.h
14431+F: include/linux/framer/
1443814432
1443914433 LASI 53c700 driver for PARISC
1444014434 M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
@@ -14783,7 +14777,7 @@ F: drivers/misc/lis3lv02d/ · 342 unmodified lines
1478314777 F: drivers/platform/x86/hp/hp_accel.c
1478414778
1478514779 LIST KUNIT TEST
14786−M: David Gow <davidgow@google.com>
14780+M: David Gow <david@davidgow.net>
1478714781 L: linux-kselftest@vger.kernel.org
1478814782 L: kunit-dev@googlegroups.com
1478914783 S: Maintained
@@ -15396,10 +15390,8 @@ F: drivers/crypto/marvell/ · 606 unmodified lines
1539615390 F: include/linux/soc/marvell/octeontx2/
1539715391
1539815392 MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
15399−M: Mirko Lindner <mlindner@marvell.com>
15400−M: Stephen Hemminger <stephen@networkplumber.org>
1540115393 L: netdev@vger.kernel.org
15402−S: Odd fixes
15394+S: Orphan
1540315395 F: drivers/net/ethernet/marvell/sk*
1540415396
1540515397 MARVELL LIBERTAS WIRELESS DRIVER
@@ -15496,7 +15488,6 @@ MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER · 90 unmodified lines
1549615488 M: Sunil Goutham <sgoutham@marvell.com>
1549715489 M: Linu Cherian <lcherian@marvell.com>
1549815490 M: Geetha sowjanya <gakula@marvell.com>
15499−M: Jerin Jacob <jerinj@marvell.com>
1550015491 M: hariprasad <hkelam@marvell.com>
1550115492 M: Subbaraya Sundeep <sbhatta@marvell.com>
1550215493 L: netdev@vger.kernel.org
@@ -15511,7 +15502,7 @@ S: Supported · 8 unmodified lines
1551115502 F: drivers/perf/marvell_pem_pmu.c
1551215503
1551315504 MARVELL PRESTERA ETHERNET SWITCH DRIVER
15514−M: Taras Chornyi <taras.chornyi@plvision.eu>
15505+M: Elad Nachman <enachman@marvell.com>
1551515506 S: Supported
1551615507 W: https://github.com/Marvell-switching/switchdev-prestera
1551715508 F: drivers/net/ethernet/marvell/prestera/
@@ -16185,7 +16176,6 @@ F: drivers/dma/mediatek/ · 667 unmodified lines
1618516176
1618616177 MEDIATEK ETHERNET DRIVER
1618716178 M: Felix Fietkau <nbd@nbd.name>
16188−M: Sean Wang <sean.wang@mediatek.com>
1618916179 M: Lorenzo Bianconi <lorenzo@kernel.org>
1619016180 L: netdev@vger.kernel.org
1619116181 S: Maintained
@@ -16378,8 +16368,6 @@ F: include/soc/mediatek/smi.h · 186 unmodified lines
1637816368 MEDIATEK SWITCH DRIVER
1637916369 M: Chester A. Unal <chester.a.unal@arinc9.com>
1638016370 M: Daniel Golle <daniel@makrotopia.org>
16381−M: DENG Qingfang <dqfext@gmail.com>
16382−M: Sean Wang <sean.wang@mediatek.com>
1638316371 L: netdev@vger.kernel.org
1638416372 S: Maintained
1638516373 F: drivers/net/dsa/mt7530-mdio.c
@@ -16389,7 +16377,6 @@ F: net/dsa/tag_mtk.c · 3 unmodified lines
1638916377
1639016378 MEDIATEK T7XX 5G WWAN MODEM DRIVER
1639116379 M: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
16392−R: Chiranjeevi Rapolu <chiranjeevi.rapolu@linux.intel.com>
1639316380 R: Liu Haijun <haijun.liu@mediatek.com>
1639416381 R: Ricardo Martinez <ricardo.martinez@linux.intel.com>
1639516382 L: netdev@vger.kernel.org
@@ -16674,9 +16661,9 @@ F: mm/balloon.c · 278 unmodified lines
1667416661 MEMORY MANAGEMENT - CORE
1667516662 M: Andrew Morton <akpm@linux-foundation.org>
1667616663 M: David Hildenbrand <david@kernel.org>
16677−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16664+R: Lorenzo Stoakes <ljs@kernel.org>
1667816665 R: Liam R. Howlett <Liam.Howlett@oracle.com>
16679−R: Vlastimil Babka <vbabka@suse.cz>
16666+R: Vlastimil Babka <vbabka@kernel.org>
1668016667 R: Mike Rapoport <rppt@kernel.org>
1668116668 R: Suren Baghdasaryan <surenb@google.com>
1668216669 R: Michal Hocko <mhocko@suse.com>
@@ -16804,9 +16791,9 @@ F: mm/workingset.c · 121 unmodified lines
1680416791 MEMORY MANAGEMENT - MISC
1680516792 M: Andrew Morton <akpm@linux-foundation.org>
1680616793 M: David Hildenbrand <david@kernel.org>
16807−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16794+R: Lorenzo Stoakes <ljs@kernel.org>
1680816795 R: Liam R. Howlett <Liam.Howlett@oracle.com>
16809−R: Vlastimil Babka <vbabka@suse.cz>
16796+R: Vlastimil Babka <vbabka@kernel.org>
1681016797 R: Mike Rapoport <rppt@kernel.org>
1681116798 R: Suren Baghdasaryan <surenb@google.com>
1681216799 R: Michal Hocko <mhocko@suse.com>
@@ -16861,7 +16848,7 @@ F: mm/oom_kill.c · 48 unmodified lines
1686116848
1686216849 MEMORY MANAGEMENT - PAGE ALLOCATOR
1686316850 M: Andrew Morton <akpm@linux-foundation.org>
16864−M: Vlastimil Babka <vbabka@suse.cz>
16851+M: Vlastimil Babka <vbabka@kernel.org>
1686516852 R: Suren Baghdasaryan <surenb@google.com>
1686616853 R: Michal Hocko <mhocko@suse.com>
1686716854 R: Brendan Jackman <jackmanb@google.com>
@@ -16895,7 +16882,7 @@ R: David Hildenbrand <david@kernel.org> · 27 unmodified lines
1689516882 R: Michal Hocko <mhocko@kernel.org>
1689616883 R: Qi Zheng <zhengqi.arch@bytedance.com>
1689716884 R: Shakeel Butt <shakeel.butt@linux.dev>
16898−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16885+R: Lorenzo Stoakes <ljs@kernel.org>
1689916886 L: linux-mm@kvack.org
1690016887 S: Maintained
1690116888 F: mm/vmscan.c
@@ -16904,10 +16891,10 @@ F: mm/workingset.c · 2 unmodified lines
1690416891 MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)
1690516892 M: Andrew Morton <akpm@linux-foundation.org>
1690616893 M: David Hildenbrand <david@kernel.org>
16907−M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16894+M: Lorenzo Stoakes <ljs@kernel.org>
1690816895 R: Rik van Riel <riel@surriel.com>
1690916896 R: Liam R. Howlett <Liam.Howlett@oracle.com>
16910−R: Vlastimil Babka <vbabka@suse.cz>
16897+R: Vlastimil Babka <vbabka@kernel.org>
1691116898 R: Harry Yoo <harry.yoo@oracle.com>
1691216899 R: Jann Horn <jannh@google.com>
1691316900 L: linux-mm@kvack.org
@@ -16949,7 +16936,7 @@ F: mm/swapfile.c · 35 unmodified lines
1694916936 MEMORY MANAGEMENT - THP (TRANSPARENT HUGE PAGE)
1695016937 M: Andrew Morton <akpm@linux-foundation.org>
1695116938 M: David Hildenbrand <david@kernel.org>
16952−M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16939+M: Lorenzo Stoakes <ljs@kernel.org>
1695316940 R: Zi Yan <ziy@nvidia.com>
1695416941 R: Baolin Wang <baolin.wang@linux.alibaba.com>
1695516942 R: Liam R. Howlett <Liam.Howlett@oracle.com>
@@ -16989,7 +16976,7 @@ F: tools/testing/selftests/mm/uffd-*.[ch] · 33 unmodified lines
1698916976
1699016977 MEMORY MANAGEMENT - RUST
1699116978 M: Alice Ryhl <aliceryhl@google.com>
16992−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16979+R: Lorenzo Stoakes <ljs@kernel.org>
1699316980 R: Liam R. Howlett <Liam.Howlett@oracle.com>
1699416981 L: linux-mm@kvack.org
1699516982 L: rust-for-linux@vger.kernel.org
@@ -17005,8 +16992,8 @@ F: rust/kernel/page.rs · 9 unmodified lines
1700516992 MEMORY MAPPING
1700616993 M: Andrew Morton <akpm@linux-foundation.org>
1700716994 M: Liam R. Howlett <Liam.Howlett@oracle.com>
17008−M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
17009−R: Vlastimil Babka <vbabka@suse.cz>
16995+M: Lorenzo Stoakes <ljs@kernel.org>
16996+R: Vlastimil Babka <vbabka@kernel.org>
1701016997 R: Jann Horn <jannh@google.com>
1701116998 R: Pedro Falcato <pfalcato@suse.de>
1701216999 L: linux-mm@kvack.org
@@ -17035,8 +17022,8 @@ MEMORY MAPPING - LOCKING · 22 unmodified lines
1703517022 M: Andrew Morton <akpm@linux-foundation.org>
1703617023 M: Suren Baghdasaryan <surenb@google.com>
1703717024 M: Liam R. Howlett <Liam.Howlett@oracle.com>
17038−M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
17039−R: Vlastimil Babka <vbabka@suse.cz>
17025+M: Lorenzo Stoakes <ljs@kernel.org>
17026+R: Vlastimil Babka <vbabka@kernel.org>
1704017027 R: Shakeel Butt <shakeel.butt@linux.dev>
1704117028 L: linux-mm@kvack.org
1704217029 S: Maintained
@@ -17050,9 +17037,9 @@ F: mm/mmap_lock.c · 7 unmodified lines
1705017037 MEMORY MAPPING - MADVISE (MEMORY ADVICE)
1705117038 M: Andrew Morton <akpm@linux-foundation.org>
1705217039 M: Liam R. Howlett <Liam.Howlett@oracle.com>
17053−M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
17040+M: Lorenzo Stoakes <ljs@kernel.org>
1705417041 M: David Hildenbrand <david@kernel.org>
17055−R: Vlastimil Babka <vbabka@suse.cz>
17042+R: Vlastimil Babka <vbabka@kernel.org>
1705617043 R: Jann Horn <jannh@google.com>
1705717044 L: linux-mm@kvack.org
1705817045 S: Maintained
@@ -19247,8 +19234,6 @@ F: tools/objtool/ · 2188 unmodified lines
1924719234
1924819235 OCELOT ETHERNET SWITCH DRIVER
1924919236 M: Vladimir Oltean <vladimir.oltean@nxp.com>
19250−M: Claudiu Manoil <claudiu.manoil@nxp.com>
19251−M: Alexandre Belloni <alexandre.belloni@bootlin.com>
1925219237 M: UNGLinuxDriver@microchip.com
1925319238 L: netdev@vger.kernel.org
1925419239 S: Supported
@@ -19834,7 +19819,6 @@ F: arch/*/boot/dts/ · 579 unmodified lines
1983419819 F: include/dt-bindings/
1983519820
1983619821 OPENCOMPUTE PTP CLOCK DRIVER
19837−M: Jonathan Lemon <jonathan.lemon@gmail.com>
1983819822 M: Vadim Fedorenko <vadim.fedorenko@linux.dev>
1983919823 L: netdev@vger.kernel.org
1984019824 S: Maintained
@@ -20142,9 +20126,8 @@ F: Documentation/devicetree/bindings/pci/marvell,armada-3700-pcie.yaml · 301 unmodified lines
2014220126 F: drivers/pci/controller/pci-aardvark.c
2014320127
2014420128 PCI DRIVER FOR ALTERA PCIE IP
20145−M: Joyce Ooi <joyce.ooi@intel.com>
2014620129 L: linux-pci@vger.kernel.org
20147−S: Supported
20130+S: Orphan
2014820131 F: Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml
2014920132 F: drivers/pci/controller/pcie-altera.c
2015020133
@@ -20389,9 +20372,8 @@ S: Supported · 238 unmodified lines
2038920372 F: Documentation/PCI/pci-error-recovery.rst
2039020373
2039120374 PCI MSI DRIVER FOR ALTERA MSI IP
20392−M: Joyce Ooi <joyce.ooi@intel.com>
2039320375 L: linux-pci@vger.kernel.org
20394−S: Supported
20376+S: Orphan
2039520377 F: Documentation/devicetree/bindings/interrupt-controller/altr,msi-controller.yaml
2039620378 F: drivers/pci/controller/pcie-altera-msi.c
2039720379
@@ -20529,7 +20511,7 @@ F: Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml · 131 unmodified lines
2052920511 F: drivers/pci/controller/dwc/pcie-kirin.c
2053020512
2053120513 PCIE DRIVER FOR HISILICON STB
20532−M: Shawn Guo <shawn.guo@linaro.org>
20514+M: Shawn Guo <shawnguo@kernel.org>
2053320515 L: linux-pci@vger.kernel.org
2053420516 S: Maintained
2053520517 F: Documentation/devicetree/bindings/pci/hisilicon-histb-pcie.txt
@@ -21478,9 +21460,8 @@ S: Supported · 942 unmodified lines
2147821460 F: drivers/scsi/qedi/
2147921461
2148021462 QLOGIC QL4xxx ETHERNET DRIVER
21481−M: Manish Chopra <manishc@marvell.com>
2148221463 L: netdev@vger.kernel.org
21483−S: Maintained
21464+S: Orphan
2148421465 F: drivers/net/ethernet/qlogic/qed/
2148521466 F: drivers/net/ethernet/qlogic/qede/
2148621467 F: include/linux/qed/
@@ -21715,7 +21696,7 @@ S: Maintained · 228 unmodified lines
2171521696 F: drivers/net/ethernet/qualcomm/emac/
2171621697
2171721698 QUALCOMM ETHQOS ETHERNET DRIVER
21718−M: Vinod Koul <vkoul@kernel.org>
21699+M: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
2171921700 L: netdev@vger.kernel.org
2172021701 L: linux-arm-msm@vger.kernel.org
2172121702 S: Maintained
@@ -21975,7 +21956,7 @@ F: drivers/media/radio/radio-tea5777.c · 253 unmodified lines
2197521956
2197621957 RADOS BLOCK DEVICE (RBD)
2197721958 M: Ilya Dryomov <idryomov@gmail.com>
21978−R: Dongsheng Yang <dongsheng.yang@easystack.cn>
21959+R: Dongsheng Yang <dongsheng.yang@linux.dev>
2197921960 L: ceph-devel@vger.kernel.org
2198021961 S: Supported
2198121962 W: http://ceph.com/
@@ -22304,6 +22285,16 @@ L: linux-wireless@vger.kernel.org · 322 unmodified lines
2230422285 S: Orphan
2230522286 F: drivers/net/wireless/rsi/
2230622287
22288+RELAY
22289+M: Andrew Morton <akpm@linux-foundation.org>
22290+M: Jens Axboe <axboe@kernel.dk>
22291+M: Jason Xing <kernelxing@tencent.com>
22292+L: linux-kernel@vger.kernel.org
22293+S: Maintained
22294+F: Documentation/filesystems/relay.rst
22295+F: include/linux/relay.h
22296+F: kernel/relay.c
22297+
2230722298 REGISTER MAP ABSTRACTION
2230822299 M: Mark Brown <broonie@kernel.org>
2230922300 L: linux-kernel@vger.kernel.org
@@ -23193,8 +23184,8 @@ K: \b(?i:rust)\b · 883 unmodified lines
2319323184
2319423185 RUST [ALLOC]
2319523186 M: Danilo Krummrich <dakr@kernel.org>
23196−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
23197−R: Vlastimil Babka <vbabka@suse.cz>
23187+R: Lorenzo Stoakes <ljs@kernel.org>
23188+R: Vlastimil Babka <vbabka@kernel.org>
2319823189 R: Liam R. Howlett <Liam.Howlett@oracle.com>
2319923190 R: Uladzislau Rezki <urezki@gmail.com>
2320023191 L: rust-for-linux@vger.kernel.org
@@ -24357,7 +24348,6 @@ F: Documentation/devicetree/bindings/interrupt-controller/kontron,sl28cpld-intc. · 1156 unmodified lines
2435724348 F: Documentation/devicetree/bindings/pwm/kontron,sl28cpld-pwm.yaml
2435824349 F: Documentation/devicetree/bindings/watchdog/kontron,sl28cpld-wdt.yaml
2435924350 F: drivers/gpio/gpio-sl28cpld.c
24360−F: drivers/hwmon/sa67mcu-hwmon.c
2436124351 F: drivers/hwmon/sl28cpld-hwmon.c
2436224352 F: drivers/irqchip/irq-sl28cpld.c
2436324353 F: drivers/pwm/pwm-sl28cpld.c
@@ -24370,12 +24360,13 @@ F: Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml · 6 unmodified lines
2437024360 F: drivers/nvmem/layouts/sl28vpd.c
2437124361
2437224362 SLAB ALLOCATOR
24373−M: Vlastimil Babka <vbabka@suse.cz>
24363+M: Vlastimil Babka <vbabka@kernel.org>
24364+M: Harry Yoo <harry.yoo@oracle.com>
2437424365 M: Andrew Morton <akpm@linux-foundation.org>
24366+R: Hao Li <hao.li@linux.dev>
2437524367 R: Christoph Lameter <cl@gentwo.org>
2437624368 R: David Rientjes <rientjes@google.com>
2437724369 R: Roman Gushchin <roman.gushchin@linux.dev>
24378−R: Harry Yoo <harry.yoo@oracle.com>
2437924370 L: linux-mm@kvack.org
2438024371 S: Maintained
2438124372 T: git git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git
@@ -25786,6 +25777,7 @@ F: include/net/pkt_cls.h · 1404 unmodified lines
2578625777 F: include/net/pkt_sched.h
2578725778 F: include/net/sch_priv.h
2578825779 F: include/net/tc_act/
25780+F: include/net/tc_wrapper.h
2578925781 F: include/uapi/linux/pkt_cls.h
2579025782 F: include/uapi/linux/pkt_sched.h
2579125783 F: include/uapi/linux/tc_act/
@@ -26237,7 +26229,7 @@ F: drivers/media/radio/radio-raremono.c · 445 unmodified lines
2623726229
2623826230 THERMAL
2623926231 M: Rafael J. Wysocki <rafael@kernel.org>
26240−M: Daniel Lezcano <daniel.lezcano@linaro.org>
26232+M: Daniel Lezcano <daniel.lezcano@kernel.org>
2624126233 R: Zhang Rui <rui.zhang@intel.com>
2624226234 R: Lukasz Luba <lukasz.luba@arm.com>
2624326235 L: linux-pm@vger.kernel.org
@@ -26267,7 +26259,7 @@ F: drivers/thermal/amlogic_thermal.c · 23 unmodified lines
2626726259
2626826260 THERMAL/CPU_COOLING
2626926261 M: Amit Daniel Kachhap <amit.kachhap@gmail.com>
26270−M: Daniel Lezcano <daniel.lezcano@linaro.org>
26262+M: Daniel Lezcano <daniel.lezcano@kernel.org>
2627126263 M: Viresh Kumar <viresh.kumar@linaro.org>
2627226264 R: Lukasz Luba <lukasz.luba@arm.com>
2627326265 L: linux-pm@vger.kernel.org
@@ -29206,7 +29198,7 @@ K: zstd · 2932 unmodified lines
2920629198
2920729199 ZSWAP COMPRESSED SWAP CACHING
2920829200 M: Johannes Weiner <hannes@cmpxchg.org>
29209−M: Yosry Ahmed <yosry.ahmed@linux.dev>
29201+M: Yosry Ahmed <yosry@kernel.org>
2921029202 M: Nhat Pham <nphamcs@gmail.com>
2921129203 R: Chengming Zhou <chengming.zhou@linux.dev>
2921229204 L: linux-mm@kvack.org
Makefile+9−5
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 7
33 PATCHLEVEL = 0
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc4
66 NAME = Baby Opossum Posse
77
88 # *DOCUMENTATION*
@@ -476,6 +476,7 @@ KBUILD_USERLDFLAGS := $(USERLDFLAGS) · 467 unmodified lines
476476 export rust_common_flags := --edition=2021 \
477477 -Zbinary_dep_depinfo=y \
478478 -Astable_features \
479+ -Aunused_features \
479480 -Dnon_ascii_idents \
480481 -Dunsafe_op_in_unsafe_fn \
481482 -Wmissing_docs \
@@ -1113,6 +1114,9 @@ KBUILD_CFLAGS += -fno-builtin-wcslen · 631 unmodified lines
11131114 # change __FILE__ to the relative path to the source directory
11141115 ifdef building_out_of_srctree
11151116 KBUILD_CPPFLAGS += -fmacro-prefix-map=$(srcroot)/=
1117+ifeq ($(call rustc-option-yn, --remap-path-scope=macro),y)
1118+KBUILD_RUSTFLAGS += --remap-path-prefix=$(srcroot)/= --remap-path-scope=macro
1119+endif
11161120 endif
11171121
11181122 # include additional Makefiles when needed
@@ -1497,13 +1501,13 @@ ifneq ($(wildcard $(resolve_btfids_O)),) · 378 unmodified lines
14971501 $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
14981502 endif
14991503
1500−PHONY += objtool_clean
1504+PHONY += objtool_clean objtool_mrproper
15011505
15021506 objtool_O = $(abspath $(objtree))/tools/objtool
15031507
1504−objtool_clean:
1508+objtool_clean objtool_mrproper:
15051509 ifneq ($(wildcard $(objtool_O)),)
1506− $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) clean
1510+ $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) $(patsubst objtool_%,%,$@)
15071511 endif
15081512
15091513 tools/: FORCE
@@ -1686,7 +1690,7 @@ PHONY += $(mrproper-dirs) mrproper · 176 unmodified lines
16861690 $(mrproper-dirs):
16871691 $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
16881692
1689−mrproper: clean $(mrproper-dirs)
1693+mrproper: clean objtool_mrproper $(mrproper-dirs)
16901694 $(call cmd,rmfiles)
16911695 @find . $(RCS_FIND_IGNORE) \
16921696 \( -name '*.rmeta' \) \
arch/alpha/kernel/vmlinux.lds.S+1−0
@@ -71,6 +71,7 @@ SECTIONS · 70 unmodified lines
7171
7272 STABS_DEBUG
7373 DWARF_DEBUG
74+ MODINFO
7475 ELF_DETAILS
7576
7677 DISCARDS
arch/arc/kernel/vmlinux.lds.S+1−0
@@ -123,6 +123,7 @@ SECTIONS · 122 unmodified lines
123123 _end = . ;
124124
125125 STABS_DEBUG
126+ MODINFO
126127 ELF_DETAILS
127128 DISCARDS
128129
arch/arm/boot/compressed/vmlinux.lds.S+1−0
@@ -21,6 +21,7 @@ SECTIONS · 20 unmodified lines
2121 COMMON_DISCARDS
2222 *(.ARM.exidx*)
2323 *(.ARM.extab*)
24+ *(.modinfo)
2425 *(.note.*)
2526 *(.rel.*)
2627 *(.printk_index)
arch/arm/kernel/vmlinux-xip.lds.S+1−0
@@ -154,6 +154,7 @@ SECTIONS · 153 unmodified lines
154154
155155 STABS_DEBUG
156156 DWARF_DEBUG
157+ MODINFO
157158 ARM_DETAILS
158159
159160 ARM_ASSERTS
arch/arm/kernel/vmlinux.lds.S+1−0
@@ -153,6 +153,7 @@ SECTIONS · 152 unmodified lines
153153
154154 STABS_DEBUG
155155 DWARF_DEBUG
156+ MODINFO
156157 ARM_DETAILS
157158
158159 ARM_ASSERTS
arch/arm64/include/asm/cmpxchg.h+7−5
@@ -91,8 +91,9 @@ __XCHG_GEN(_mb) · 90 unmodified lines
9191 #define __xchg_wrapper(sfx, ptr, x) \
9292 ({ \
9393 __typeof__(*(ptr)) __ret; \
94− __ret = (__typeof__(*(ptr))) \
95− __arch_xchg##sfx((unsigned long)(x), (ptr), sizeof(*(ptr))); \
94+ __ret = (__force __typeof__(*(ptr))) \
95+ __arch_xchg##sfx((__force unsigned long)(x), (ptr), \
96+ sizeof(*(ptr))); \
9697 __ret; \
9798 })
9899
@@ -175,9 +176,10 @@ __CMPXCHG_GEN(_mb) · 76 unmodified lines
175176 #define __cmpxchg_wrapper(sfx, ptr, o, n) \
176177 ({ \
177178 __typeof__(*(ptr)) __ret; \
178− __ret = (__typeof__(*(ptr))) \
179− __cmpxchg##sfx((ptr), (unsigned long)(o), \
180− (unsigned long)(n), sizeof(*(ptr))); \
179+ __ret = (__force __typeof__(*(ptr))) \
180+ __cmpxchg##sfx((ptr), (__force unsigned long)(o), \
181+ (__force unsigned long)(n), \
182+ sizeof(*(ptr))); \
181183 __ret; \
182184 })
183185
arch/arm64/include/asm/io.h+20−6
@@ -264,19 +264,33 @@ __iowrite64_copy(void __iomem *to, const void *from, size_t count) · 263 unmodified lines
264264 typedef int (*ioremap_prot_hook_t)(phys_addr_t phys_addr, size_t size,
265265 pgprot_t *prot);
266266 int arm64_ioremap_prot_hook_register(const ioremap_prot_hook_t hook);
267+void __iomem *__ioremap_prot(phys_addr_t phys, size_t size, pgprot_t prot);
267268
268−#define ioremap_prot ioremap_prot
269+static inline void __iomem *ioremap_prot(phys_addr_t phys, size_t size,
270+ pgprot_t user_prot)
271+{
272+ pgprot_t prot;
273+ ptdesc_t user_prot_val = pgprot_val(user_prot);
274+
275+ if (WARN_ON_ONCE(!(user_prot_val & PTE_USER)))
276+ return NULL;
269277
270−#define _PAGE_IOREMAP PROT_DEVICE_nGnRE
278+ prot = __pgprot_modify(PAGE_KERNEL, PTE_ATTRINDX_MASK,
279+ user_prot_val & PTE_ATTRINDX_MASK);
280+ return __ioremap_prot(phys, size, prot);
281+}
282+#define ioremap_prot ioremap_prot
271283
284+#define ioremap(addr, size) \
285+ __ioremap_prot((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
272286 #define ioremap_wc(addr, size) \
273− ioremap_prot((addr), (size), __pgprot(PROT_NORMAL_NC))
287+ __ioremap_prot((addr), (size), __pgprot(PROT_NORMAL_NC))
274288 #define ioremap_np(addr, size) \
275− ioremap_prot((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
289+ __ioremap_prot((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
276290
277291
278292 #define ioremap_encrypted(addr, size) \
279− ioremap_prot((addr), (size), PAGE_KERNEL)
293+ __ioremap_prot((addr), (size), PAGE_KERNEL)
280294
281295 /*
282296 * io{read,write}{16,32,64}be() macros
@@ -297,7 +311,7 @@ static inline void __iomem *ioremap_cache(phys_addr_t addr, size_t size) · 14 unmodified lines
297311 if (pfn_is_map_memory(__phys_to_pfn(addr)))
298312 return (void __iomem *)__phys_to_virt(addr);
299313
300− return ioremap_prot(addr, size, __pgprot(PROT_NORMAL));
314+ return __ioremap_prot(addr, size, __pgprot(PROT_NORMAL));
301315 }
302316
303317 /*
arch/arm64/include/asm/kvm_host.h+5−1
@@ -784,6 +784,9 @@ struct kvm_host_data { · 783 unmodified lines
784784 /* Number of debug breakpoints/watchpoints for this CPU (minus 1) */
785785 unsigned int debug_brps;
786786 unsigned int debug_wrps;
787+
788+ /* Last vgic_irq part of the AP list recorded in an LR */
789+ struct vgic_irq *last_lr_irq;
787790 };
788791
789792 struct kvm_host_psci_config {
@@ -1616,7 +1619,8 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); · 826 unmodified lines
16161619 (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1PIE, IMP))
16171620
16181621 #define kvm_has_s1poe(k) \
1619− (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP))
1622+ (system_supports_poe() && \
1623+ kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP))
16201624
16211625 #define kvm_has_ras(k) \
16221626 (kvm_has_feat((k), ID_AA64PFR0_EL1, RAS, IMP))
arch/arm64/include/asm/kvm_nested.h+2−0
@@ -397,6 +397,8 @@ int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu); · 396 unmodified lines
397397 int kvm_handle_vncr_abort(struct kvm_vcpu *vcpu);
398398 void kvm_handle_s1e2_tlbi(struct kvm_vcpu *vcpu, u32 inst, u64 val);
399399
400+u16 get_asid_by_regime(struct kvm_vcpu *vcpu, enum trans_regime regime);
401+
400402 #define vncr_fixmap(c) \
401403 ({ \
402404 u32 __c = (c); \
arch/arm64/include/asm/pgtable-prot.h+5−8
@@ -50,11 +50,11 @@ · 49 unmodified lines
5050
5151 #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
5252
53−#define _PAGE_KERNEL (PROT_NORMAL)
54−#define _PAGE_KERNEL_RO ((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)
55−#define _PAGE_KERNEL_ROX ((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY)
56−#define _PAGE_KERNEL_EXEC (PROT_NORMAL & ~PTE_PXN)
57−#define _PAGE_KERNEL_EXEC_CONT ((PROT_NORMAL & ~PTE_PXN) | PTE_CONT)
53+#define _PAGE_KERNEL (PROT_NORMAL | PTE_DIRTY)
54+#define _PAGE_KERNEL_RO ((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY | PTE_DIRTY)
55+#define _PAGE_KERNEL_ROX ((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY | PTE_DIRTY)
56+#define _PAGE_KERNEL_EXEC ((PROT_NORMAL & ~PTE_PXN) | PTE_DIRTY)
57+#define _PAGE_KERNEL_EXEC_CONT ((PROT_NORMAL & ~PTE_PXN) | PTE_CONT | PTE_DIRTY)
5858
5959 #define _PAGE_SHARED (_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
6060 #define _PAGE_SHARED_EXEC (_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_WRITE)
@@ -164,9 +164,6 @@ static inline bool __pure lpa2_is_enabled(void) · 103 unmodified lines
164164 #define _PAGE_GCS (_PAGE_DEFAULT | PTE_NG | PTE_UXN | PTE_WRITE | PTE_USER)
165165 #define _PAGE_GCS_RO (_PAGE_DEFAULT | PTE_NG | PTE_UXN | PTE_USER)
166166
167−#define PAGE_GCS __pgprot(_PAGE_GCS)
168−#define PAGE_GCS_RO __pgprot(_PAGE_GCS_RO)
169−
170167 #define PIE_E0 ( \
171168 PIRx_ELx_PERM_PREP(pte_pi_index(_PAGE_GCS), PIE_GCS) | \
172169 PIRx_ELx_PERM_PREP(pte_pi_index(_PAGE_GCS_RO), PIE_R) | \
arch/arm64/include/asm/runtime-const.h+4−0
@@ -2,6 +2,10 @@ · 1 unmodified line
22 #ifndef _ASM_RUNTIME_CONST_H
33 #define _ASM_RUNTIME_CONST_H
44
5+#ifdef MODULE
6+ #error "Cannot use runtime-const infrastructure from modules"
7+#endif
8+
59 #include <asm/cacheflush.h>
610
711 /* Sigh. You can still run arm64 in BE mode */
arch/arm64/include/asm/tlbflush.h+37−26
@@ -31,19 +31,11 @@ · 30 unmodified lines
3131 */
3232 #define __TLBI_0(op, arg) asm (ARM64_ASM_PREAMBLE \
3333 "tlbi " #op "\n" \
34− ALTERNATIVE("nop\n nop", \
35− "dsb ish\n tlbi " #op, \
36− ARM64_WORKAROUND_REPEAT_TLBI, \
37− CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
3834 : : )
3935
4036 #define __TLBI_1(op, arg) asm (ARM64_ASM_PREAMBLE \
41− "tlbi " #op ", %0\n" \
42− ALTERNATIVE("nop\n nop", \
43− "dsb ish\n tlbi " #op ", %0", \
44− ARM64_WORKAROUND_REPEAT_TLBI, \
45− CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
46− : : "r" (arg))
37+ "tlbi " #op ", %x0\n" \
38+ : : "rZ" (arg))
4739
4840 #define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg)
4941
@@ -181,6 +173,34 @@ static inline unsigned long get_trans_granule(void) · 131 unmodified lines
181173 (__pages >> (5 * (scale) + 1)) - 1; \
182174 })
183175
176+#define __repeat_tlbi_sync(op, arg...) \
177+do { \
178+ if (!alternative_has_cap_unlikely(ARM64_WORKAROUND_REPEAT_TLBI)) \
179+ break; \
180+ __tlbi(op, ##arg); \
181+ dsb(ish); \
182+} while (0)
183+
184+/*
185+ * Complete broadcast TLB maintenance issued by the host which invalidates
186+ * stage 1 information in the host's own translation regime.
187+ */
188+static inline void __tlbi_sync_s1ish(void)
189+{
190+ dsb(ish);
191+ __repeat_tlbi_sync(vale1is, 0);
192+}
193+
194+/*
195+ * Complete broadcast TLB maintenance issued by hyp code which invalidates
196+ * stage 1 translation information in any translation regime.
197+ */
198+static inline void __tlbi_sync_s1ish_hyp(void)
199+{
200+ dsb(ish);
201+ __repeat_tlbi_sync(vale2is, 0);
202+}
203+
184204 /*
185205 * TLB Invalidation
186206 * ================
@@ -279,7 +299,7 @@ static inline void flush_tlb_all(void) · 92 unmodified lines
279299 {
280300 dsb(ishst);
281301 __tlbi(vmalle1is);
282− dsb(ish);
302+ __tlbi_sync_s1ish();
283303 isb();
284304 }
285305
@@ -291,7 +311,7 @@ static inline void flush_tlb_mm(struct mm_struct *mm) · 5 unmodified lines
291311 asid = __TLBI_VADDR(0, ASID(mm));
292312 __tlbi(aside1is, asid);
293313 __tlbi_user(aside1is, asid);
294− dsb(ish);
314+ __tlbi_sync_s1ish();
295315 mmu_notifier_arch_invalidate_secondary_tlbs(mm, 0, -1UL);
296316 }
297317
@@ -345,20 +365,11 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, · 47 unmodified lines
345365 unsigned long uaddr)
346366 {
347367 flush_tlb_page_nosync(vma, uaddr);
348− dsb(ish);
368+ __tlbi_sync_s1ish();
349369 }
350370
351371 static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm)
352372 {
353− /*
354− * TLB flush deferral is not required on systems which are affected by
355− * ARM64_WORKAROUND_REPEAT_TLBI, as __tlbi()/__tlbi_user() implementation
356− * will have two consecutive TLBI instructions with a dsb(ish) in between
357− * defeating the purpose (i.e save overall 'dsb ish' cost).
358− */
359− if (alternative_has_cap_unlikely(ARM64_WORKAROUND_REPEAT_TLBI))
360− return false;
361−
362373 return true;
363374 }
364375
@@ -374,7 +385,7 @@ static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) · 9 unmodified lines
374385 */
375386 static inline void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch)
376387 {
377− dsb(ish);
388+ __tlbi_sync_s1ish();
378389 }
379390
380391 /*
@@ -509,7 +520,7 @@ static inline void __flush_tlb_range(struct vm_area_struct *vma, · 128 unmodified lines
509520 {
510521 __flush_tlb_range_nosync(vma->vm_mm, start, end, stride,
511522 last_level, tlb_level);
512− dsb(ish);
523+ __tlbi_sync_s1ish();
513524 }
514525
515526 static inline void local_flush_tlb_contpte(struct vm_area_struct *vma,
@@ -557,7 +568,7 @@ static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end · 41 unmodified lines
557568 dsb(ishst);
558569 __flush_tlb_range_op(vaale1is, start, pages, stride, 0,
559570 TLBI_TTL_UNKNOWN, false, lpa2_is_enabled());
560− dsb(ish);
571+ __tlbi_sync_s1ish();
561572 isb();
562573 }
563574
@@ -571,7 +582,7 @@ static inline void __flush_tlb_kernel_pgtable(unsigned long kaddr) · 7 unmodified lines
571582
572583 dsb(ishst);
573584 __tlbi(vaae1is, addr);
574− dsb(ish);
585+ __tlbi_sync_s1ish();
575586 isb();
576587 }
577588
arch/arm64/kernel/acpi.c+1−1
@@ -377,7 +377,7 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) · 376 unmodified lines
377377 prot = __acpi_get_writethrough_mem_attribute();
378378 }
379379 }
380− return ioremap_prot(phys, size, prot);
380+ return __ioremap_prot(phys, size, prot);
381381 }
382382
383383 /*
arch/arm64/kernel/cpufeature.c+9−0
@@ -2345,6 +2345,15 @@ static bool can_trap_icv_dir_el1(const struct arm64_cpu_capabilities *entry, · 2344 unmodified lines
23452345 !is_midr_in_range_list(has_vgic_v3))
23462346 return false;
23472347
2348+ /*
2349+ * pKVM prevents late onlining of CPUs. This means that whatever
2350+ * state the capability is in after deprivilege cannot be affected
2351+ * by a new CPU booting -- this is garanteed to be a CPU we have
2352+ * already seen, and the cap is therefore unchanged.
2353+ */
2354+ if (system_capabilities_finalized() && is_protected_kvm_enabled())
2355+ return cpus_have_final_cap(ARM64_HAS_ICH_HCR_EL2_TDIR);
2356+
23482357 if (is_kernel_in_hyp_mode())
23492358 res.a1 = read_sysreg_s(SYS_ICH_VTR_EL2);
23502359 else
arch/arm64/kernel/sys_compat.c+1−1
@@ -37,7 +37,7 @@ __do_compat_cache_op(unsigned long start, unsigned long end) · 36 unmodified lines
3737 * We pick the reserved-ASID to minimise the impact.
3838 */
3939 __tlbi(aside1is, __TLBI_VADDR(0, 0));
40− dsb(ish);
40+ __tlbi_sync_s1ish();
4141 }
4242
4343 ret = caches_clean_inval_user_pou(start, start + chunk);
arch/arm64/kernel/topology.c+15−6
@@ -400,16 +400,25 @@ static inline · 399 unmodified lines
400400 int counters_read_on_cpu(int cpu, smp_call_func_t func, u64 *val)
401401 {
402402 /*
403− * Abort call on counterless CPU or when interrupts are
404− * disabled - can lead to deadlock in smp sync call.
403+ * Abort call on counterless CPU.
405404 */
406405 if (!cpu_has_amu_feat(cpu))
407406 return -EOPNOTSUPP;
408407
409− if (WARN_ON_ONCE(irqs_disabled()))
410− return -EPERM;
411−
412− smp_call_function_single(cpu, func, val, 1);
408+ if (irqs_disabled()) {
409+ /*
410+ * When IRQs are disabled (tick path: sched_tick ->
411+ * topology_scale_freq_tick or cppc_scale_freq_tick), only local
412+ * CPU counter reads are allowed. Remote CPU counter read would
413+ * require smp_call_function_single() which is unsafe with IRQs
414+ * disabled.
415+ */
416+ if (WARN_ON_ONCE(cpu != smp_processor_id()))
417+ return -EPERM;
418+ func(val);
419+ } else {
420+ smp_call_function_single(cpu, func, val, 1);
421+ }
413422
414423 return 0;
415424 }
arch/arm64/kernel/vmlinux.lds.S+1−0
@@ -349,6 +349,7 @@ SECTIONS · 348 unmodified lines
349349
350350 STABS_DEBUG
351351 DWARF_DEBUG
352+ MODINFO
352353 ELF_DETAILS
353354
354355 HEAD_SYMBOLS
arch/arm64/kvm/Kconfig+0−1
@@ -21,7 +21,6 @@ menuconfig KVM · 20 unmodified lines
2121 bool "Kernel-based Virtual Machine (KVM) support"
2222 select KVM_COMMON
2323 select KVM_GENERIC_HARDWARE_ENABLING
24− select KVM_GENERIC_MMU_NOTIFIER
2524 select HAVE_KVM_CPU_RELAX_INTERCEPT
2625 select KVM_MMIO
2726 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
arch/arm64/kvm/arm.c+0−1
@@ -358,7 +358,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 357 unmodified lines
358358 break;
359359 case KVM_CAP_IOEVENTFD:
360360 case KVM_CAP_USER_MEMORY:
361− case KVM_CAP_SYNC_MMU:
362361 case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:
363362 case KVM_CAP_ONE_REG:
364363 case KVM_CAP_ARM_PSCI:
arch/arm64/kvm/at.c+2−27
@@ -540,31 +540,8 @@ static int walk_s1(struct kvm_vcpu *vcpu, struct s1_walk_info *wi, · 539 unmodified lines
540540 wr->pa |= va & GENMASK_ULL(va_bottom - 1, 0);
541541
542542 wr->nG = (wi->regime != TR_EL2) && (desc & PTE_NG);
543− if (wr->nG) {
544− u64 asid_ttbr, tcr;
545−
546− switch (wi->regime) {
547− case TR_EL10:
548− tcr = vcpu_read_sys_reg(vcpu, TCR_EL1);
549− asid_ttbr = ((tcr & TCR_A1) ?
550− vcpu_read_sys_reg(vcpu, TTBR1_EL1) :
551− vcpu_read_sys_reg(vcpu, TTBR0_EL1));
552− break;
553− case TR_EL20:
554− tcr = vcpu_read_sys_reg(vcpu, TCR_EL2);
555− asid_ttbr = ((tcr & TCR_A1) ?
556− vcpu_read_sys_reg(vcpu, TTBR1_EL2) :
557− vcpu_read_sys_reg(vcpu, TTBR0_EL2));
558− break;
559− default:
560− BUG();
561− }
562−
563− wr->asid = FIELD_GET(TTBR_ASID_MASK, asid_ttbr);
564− if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
565− !(tcr & TCR_ASID16))
566− wr->asid &= GENMASK(7, 0);
567− }
543+ if (wr->nG)
544+ wr->asid = get_asid_by_regime(vcpu, wi->regime);
568545
569546 return 0;
570547
@@ -1527,8 +1504,6 @@ int __kvm_at_s1e2(struct kvm_vcpu *vcpu, u32 op, u64 vaddr) · 956 unmodified lines
15271504 fail = true;
15281505 }
15291506
1530− isb();
1531−
15321507 if (!fail)
15331508 par = read_sysreg_par();
15341509
arch/arm64/kvm/guest.c+2−2
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929
3030 #include "trace.h"
3131
32−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
32+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
3333 KVM_GENERIC_VM_STATS()
3434 };
3535
@@ -42,7 +42,7 @@ const struct kvm_stats_header kvm_vm_stats_header = { · 6 unmodified lines
4242 sizeof(kvm_vm_stats_desc),
4343 };
4444
45−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
45+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
4646 KVM_GENERIC_VCPU_STATS(),
4747 STATS_DESC_COUNTER(VCPU, hvc_exit_stat),
4848 STATS_DESC_COUNTER(VCPU, wfe_exit_stat),
arch/arm64/kvm/hyp/nvhe/mem_protect.c+1−1
@@ -518,7 +518,7 @@ static int host_stage2_adjust_range(u64 addr, struct kvm_mem_range *range) · 517 unmodified lines
518518 granule = kvm_granule_size(level);
519519 cur.start = ALIGN_DOWN(addr, granule);
520520 cur.end = cur.start + granule;
521− if (!range_included(&cur, range))
521+ if (!range_included(&cur, range) && level < KVM_PGTABLE_LAST_LEVEL)
522522 continue;
523523 *range = cur;
524524 return 0;
arch/arm64/kvm/hyp/nvhe/mm.c+1−1
@@ -271,7 +271,7 @@ static void fixmap_clear_slot(struct hyp_fixmap_slot *slot) · 270 unmodified lines
271271 */
272272 dsb(ishst);
273273 __tlbi_level(vale2is, __TLBI_VADDR(addr, 0), level);
274− dsb(ish);
274+ __tlbi_sync_s1ish_hyp();
275275 isb();
276276 }
277277
arch/arm64/kvm/hyp/nvhe/pkvm.c+34−3
@@ -342,6 +342,7 @@ static void pkvm_init_features_from_host(struct pkvm_hyp_vm *hyp_vm, const struc · 341 unmodified lines
342342 /* No restrictions for non-protected VMs. */
343343 if (!kvm_vm_is_protected(kvm)) {
344344 hyp_vm->kvm.arch.flags = host_arch_flags;
345+ hyp_vm->kvm.arch.flags &= ~BIT_ULL(KVM_ARCH_FLAG_ID_REGS_INITIALIZED);
345346
346347 bitmap_copy(kvm->arch.vcpu_features,
347348 host_kvm->arch.vcpu_features,
@@ -391,7 +392,7 @@ static void unpin_host_sve_state(struct pkvm_hyp_vcpu *hyp_vcpu) · 43 unmodified lines
391392 if (!vcpu_has_feature(&hyp_vcpu->vcpu, KVM_ARM_VCPU_SVE))
392393 return;
393394
394− sve_state = kern_hyp_va(hyp_vcpu->vcpu.arch.sve_state);
395+ sve_state = hyp_vcpu->vcpu.arch.sve_state;
395396 hyp_unpin_shared_mem(sve_state,
396397 sve_state + vcpu_sve_state_size(&hyp_vcpu->vcpu));
397398 }
@@ -471,6 +472,35 @@ err: · 73 unmodified lines
471472 return ret;
472473 }
473474
475+static int vm_copy_id_regs(struct pkvm_hyp_vcpu *hyp_vcpu)
476+{
477+ struct pkvm_hyp_vm *hyp_vm = pkvm_hyp_vcpu_to_hyp_vm(hyp_vcpu);
478+ const struct kvm *host_kvm = hyp_vm->host_kvm;
479+ struct kvm *kvm = &hyp_vm->kvm;
480+
481+ if (!test_bit(KVM_ARCH_FLAG_ID_REGS_INITIALIZED, &host_kvm->arch.flags))
482+ return -EINVAL;
483+
484+ if (test_and_set_bit(KVM_ARCH_FLAG_ID_REGS_INITIALIZED, &kvm->arch.flags))
485+ return 0;
486+
487+ memcpy(kvm->arch.id_regs, host_kvm->arch.id_regs, sizeof(kvm->arch.id_regs));
488+
489+ return 0;
490+}
491+
492+static int pkvm_vcpu_init_sysregs(struct pkvm_hyp_vcpu *hyp_vcpu)
493+{
494+ int ret = 0;
495+
496+ if (pkvm_hyp_vcpu_is_protected(hyp_vcpu))
497+ kvm_init_pvm_id_regs(&hyp_vcpu->vcpu);
498+ else
499+ ret = vm_copy_id_regs(hyp_vcpu);
500+
501+ return ret;
502+}
503+
474504 static int init_pkvm_hyp_vcpu(struct pkvm_hyp_vcpu *hyp_vcpu,
475505 struct pkvm_hyp_vm *hyp_vm,
476506 struct kvm_vcpu *host_vcpu)
@@ -490,8 +520,9 @@ static int init_pkvm_hyp_vcpu(struct pkvm_hyp_vcpu *hyp_vcpu, · 13 unmodified lines
490520 hyp_vcpu->vcpu.arch.cflags = READ_ONCE(host_vcpu->arch.cflags);
491521 hyp_vcpu->vcpu.arch.mp_state.mp_state = KVM_MP_STATE_STOPPED;
492522
493− if (pkvm_hyp_vcpu_is_protected(hyp_vcpu))
494− kvm_init_pvm_id_regs(&hyp_vcpu->vcpu);
523+ ret = pkvm_vcpu_init_sysregs(hyp_vcpu);
524+ if (ret)
525+ goto done;
495526
496527 ret = pkvm_vcpu_init_traps(hyp_vcpu);
497528 if (ret)
arch/arm64/kvm/hyp/nvhe/tlb.c+4−4
@@ -169,7 +169,7 @@ void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu, · 168 unmodified lines
169169 */
170170 dsb(ish);
171171 __tlbi(vmalle1is);
172− dsb(ish);
172+ __tlbi_sync_s1ish_hyp();
173173 isb();
174174
175175 exit_vmid_context(&cxt);
@@ -226,7 +226,7 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu, · 50 unmodified lines
226226
227227 dsb(ish);
228228 __tlbi(vmalle1is);
229− dsb(ish);
229+ __tlbi_sync_s1ish_hyp();
230230 isb();
231231
232232 exit_vmid_context(&cxt);
@@ -240,7 +240,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu) · 7 unmodified lines
240240 enter_vmid_context(mmu, &cxt, false);
241241
242242 __tlbi(vmalls12e1is);
243− dsb(ish);
243+ __tlbi_sync_s1ish_hyp();
244244 isb();
245245
246246 exit_vmid_context(&cxt);
@@ -266,5 +266,5 @@ void __kvm_flush_vm_context(void) · 19 unmodified lines
266266 /* Same remark as in enter_vmid_context() */
267267 dsb(ish);
268268 __tlbi(alle1is);
269− dsb(ish);
269+ __tlbi_sync_s1ish_hyp();
270270 }
arch/arm64/kvm/hyp/pgtable.c+1−1
@@ -501,7 +501,7 @@ static int hyp_unmap_walker(const struct kvm_pgtable_visit_ctx *ctx, · 500 unmodified lines
501501 *unmapped += granule;
502502 }
503503
504− dsb(ish);
504+ __tlbi_sync_s1ish_hyp();
505505 isb();
506506 mm_ops->put_page(ctx->ptep);
507507
arch/arm64/kvm/hyp/vhe/tlb.c+5−5
@@ -115,7 +115,7 @@ void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu, · 114 unmodified lines
115115 */
116116 dsb(ish);
117117 __tlbi(vmalle1is);
118− dsb(ish);
118+ __tlbi_sync_s1ish_hyp();
119119 isb();
120120
121121 exit_vmid_context(&cxt);
@@ -176,7 +176,7 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu, · 54 unmodified lines
176176
177177 dsb(ish);
178178 __tlbi(vmalle1is);
179− dsb(ish);
179+ __tlbi_sync_s1ish_hyp();
180180 isb();
181181
182182 exit_vmid_context(&cxt);
@@ -192,7 +192,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu) · 9 unmodified lines
192192 enter_vmid_context(mmu, &cxt);
193193
194194 __tlbi(vmalls12e1is);
195− dsb(ish);
195+ __tlbi_sync_s1ish_hyp();
196196 isb();
197197
198198 exit_vmid_context(&cxt);
@@ -217,7 +217,7 @@ void __kvm_flush_vm_context(void) · 18 unmodified lines
217217 {
218218 dsb(ishst);
219219 __tlbi(alle1is);
220− dsb(ish);
220+ __tlbi_sync_s1ish_hyp();
221221 }
222222
223223 /*
@@ -358,7 +358,7 @@ int __kvm_tlbi_s1e2(struct kvm_s2_mmu *mmu, u64 va, u64 sys_encoding) · 134 unmodified lines
358358 default:
359359 ret = -EINVAL;
360360 }
361− dsb(ish);
361+ __tlbi_sync_s1ish_hyp();
362362 isb();
363363
364364 if (mmu)
arch/arm64/kvm/mmu.c+14−12
@@ -1751,17 +1751,16 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, · 1750 unmodified lines
17511751
17521752 force_pte = (max_map_size == PAGE_SIZE);
17531753 vma_pagesize = min_t(long, vma_pagesize, max_map_size);
1754+ vma_shift = __ffs(vma_pagesize);
17541755 }
17551756
17561757 /*
1757− * Both the canonical IPA and fault IPA must be hugepage-aligned to
1758− * ensure we find the right PFN and lay down the mapping in the right
1759− * place.
1758+ * Both the canonical IPA and fault IPA must be aligned to the
1759+ * mapping size to ensure we find the right PFN and lay down the
1760+ * mapping in the right place.
17601761 */
1761− if (vma_pagesize == PMD_SIZE || vma_pagesize == PUD_SIZE) {
1762− fault_ipa &= ~(vma_pagesize - 1);
1763− ipa &= ~(vma_pagesize - 1);
1764− }
1762+ fault_ipa = ALIGN_DOWN(fault_ipa, vma_pagesize);
1763+ ipa = ALIGN_DOWN(ipa, vma_pagesize);
17651764
17661765 gfn = ipa >> PAGE_SHIFT;
17671766 mte_allowed = kvm_vma_mte_allowed(vma);
@@ -1839,10 +1838,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, · 71 unmodified lines
18391838 if (exec_fault && s2_force_noncacheable)
18401839 ret = -ENOEXEC;
18411840
1842− if (ret) {
1843− kvm_release_page_unused(page);
1844− return ret;
1845− }
1841+ if (ret)
1842+ goto out_put_page;
18461843
18471844 /*
18481845 * Guest performs atomic/exclusive operations on memory with unsupported
@@ -1852,7 +1849,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, · 3 unmodified lines
18521849 */
18531850 if (esr_fsc_is_excl_atomic_fault(kvm_vcpu_get_esr(vcpu))) {
18541851 kvm_inject_dabt_excl_atomic(vcpu, kvm_vcpu_get_hfar(vcpu));
1855− return 1;
1852+ ret = 1;
1853+ goto out_put_page;
18561854 }
18571855
18581856 if (nested)
@@ -1938,6 +1936,10 @@ out_unlock: · 79 unmodified lines
19381936 mark_page_dirty_in_slot(kvm, memslot, gfn);
19391937
19401938 return ret != -EAGAIN ? ret : 0;
1939+
1940+out_put_page:
1941+ kvm_release_page_unused(page);
1942+ return ret;
19411943 }
19421944
19431945 /* Resolve the access fault by making the page young again. */
arch/arm64/kvm/nested.c+47−43
@@ -152,31 +152,31 @@ static int get_ia_size(struct s2_walk_info *wi) · 151 unmodified lines
152152 return 64 - wi->t0sz;
153153 }
154154
155−static int check_base_s2_limits(struct s2_walk_info *wi,
155+static int check_base_s2_limits(struct kvm_vcpu *vcpu, struct s2_walk_info *wi,
156156 int level, int input_size, int stride)
157157 {
158− int start_size, ia_size;
158+ int start_size, pa_max;
159159
160− ia_size = get_ia_size(wi);
160+ pa_max = kvm_get_pa_bits(vcpu->kvm);
161161
162162 /* Check translation limits */
163163 switch (BIT(wi->pgshift)) {
164164 case SZ_64K:
165− if (level == 0 || (level == 1 && ia_size <= 42))
165+ if (level == 0 || (level == 1 && pa_max <= 42))
166166 return -EFAULT;
167167 break;
168168 case SZ_16K:
169− if (level == 0 || (level == 1 && ia_size <= 40))
169+ if (level == 0 || (level == 1 && pa_max <= 40))
170170 return -EFAULT;
171171 break;
172172 case SZ_4K:
173− if (level < 0 || (level == 0 && ia_size <= 42))
173+ if (level < 0 || (level == 0 && pa_max <= 42))
174174 return -EFAULT;
175175 break;
176176 }
177177
178178 /* Check input size limits */
179− if (input_size > ia_size)
179+ if (input_size > pa_max)
180180 return -EFAULT;
181181
182182 /* Check number of entries in starting level table */
@@ -269,16 +269,19 @@ static int walk_nested_s2_pgd(struct kvm_vcpu *vcpu, phys_addr_t ipa, · 86 unmodified lines
269269 if (input_size > 48 || input_size < 25)
270270 return -EFAULT;
271271
272− ret = check_base_s2_limits(wi, level, input_size, stride);
273− if (WARN_ON(ret))
272+ ret = check_base_s2_limits(vcpu, wi, level, input_size, stride);
273+ if (WARN_ON(ret)) {
274+ out->esr = compute_fsc(0, ESR_ELx_FSC_FAULT);
274275 return ret;
276+ }
275277
276278 base_lower_bound = 3 + input_size - ((3 - level) * stride +
277279 wi->pgshift);
278280 base_addr = wi->baddr & GENMASK_ULL(47, base_lower_bound);
279281
280282 if (check_output_size(wi, base_addr)) {
281− out->esr = compute_fsc(level, ESR_ELx_FSC_ADDRSZ);
283+ /* R_BFHQH */
284+ out->esr = compute_fsc(0, ESR_ELx_FSC_ADDRSZ);
282285 return 1;
283286 }
284287
@@ -293,8 +296,10 @@ static int walk_nested_s2_pgd(struct kvm_vcpu *vcpu, phys_addr_t ipa, · 8 unmodified lines
293296
294297 paddr = base_addr | index;
295298 ret = read_guest_s2_desc(vcpu, paddr, &desc, wi);
296− if (ret < 0)
299+ if (ret < 0) {
300+ out->esr = ESR_ELx_FSC_SEA_TTW(level);
297301 return ret;
302+ }
298303
299304 new_desc = desc;
300305
@@ -854,6 +859,33 @@ int kvm_inject_s2_fault(struct kvm_vcpu *vcpu, u64 esr_el2) · 553 unmodified lines
854859 return kvm_inject_nested_sync(vcpu, esr_el2);
855860 }
856861
862+u16 get_asid_by_regime(struct kvm_vcpu *vcpu, enum trans_regime regime)
863+{
864+ enum vcpu_sysreg ttbr_elx;
865+ u64 tcr;
866+ u16 asid;
867+
868+ switch (regime) {
869+ case TR_EL10:
870+ tcr = vcpu_read_sys_reg(vcpu, TCR_EL1);
871+ ttbr_elx = (tcr & TCR_A1) ? TTBR1_EL1 : TTBR0_EL1;
872+ break;
873+ case TR_EL20:
874+ tcr = vcpu_read_sys_reg(vcpu, TCR_EL2);
875+ ttbr_elx = (tcr & TCR_A1) ? TTBR1_EL2 : TTBR0_EL2;
876+ break;
877+ default:
878+ BUG();
879+ }
880+
881+ asid = FIELD_GET(TTBRx_EL1_ASID, vcpu_read_sys_reg(vcpu, ttbr_elx));
882+ if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
883+ !(tcr & TCR_ASID16))
884+ asid &= GENMASK(7, 0);
885+
886+ return asid;
887+}
888+
857889 static void invalidate_vncr(struct vncr_tlb *vt)
858890 {
859891 vt->valid = false;
@@ -1154,9 +1186,6 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm) · 294 unmodified lines
11541186 {
11551187 int i;
11561188
1157− if (!kvm->arch.nested_mmus_size)
1158− return;
1159−
11601189 for (i = 0; i < kvm->arch.nested_mmus_size; i++) {
11611190 struct kvm_s2_mmu *mmu = &kvm->arch.nested_mmus[i];
11621191
@@ -1336,20 +1365,8 @@ static bool kvm_vncr_tlb_lookup(struct kvm_vcpu *vcpu) · 173 unmodified lines
13361365 if (read_vncr_el2(vcpu) != vt->gva)
13371366 return false;
13381367
1339− if (vt->wr.nG) {
1340− u64 tcr = vcpu_read_sys_reg(vcpu, TCR_EL2);
1341− u64 ttbr = ((tcr & TCR_A1) ?
1342− vcpu_read_sys_reg(vcpu, TTBR1_EL2) :
1343− vcpu_read_sys_reg(vcpu, TTBR0_EL2));
1344− u16 asid;
1345−
1346− asid = FIELD_GET(TTBR_ASID_MASK, ttbr);
1347− if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
1348− !(tcr & TCR_ASID16))
1349− asid &= GENMASK(7, 0);
1350−
1351− return asid == vt->wr.asid;
1352− }
1368+ if (vt->wr.nG)
1369+ return get_asid_by_regime(vcpu, TR_EL20) == vt->wr.asid;
13531370
13541371 return true;
13551372 }
@@ -1452,21 +1469,8 @@ static void kvm_map_l1_vncr(struct kvm_vcpu *vcpu) · 96 unmodified lines
14521469 if (read_vncr_el2(vcpu) != vt->gva)
14531470 return;
14541471
1455− if (vt->wr.nG) {
1456− u64 tcr = vcpu_read_sys_reg(vcpu, TCR_EL2);
1457− u64 ttbr = ((tcr & TCR_A1) ?
1458− vcpu_read_sys_reg(vcpu, TTBR1_EL2) :
1459− vcpu_read_sys_reg(vcpu, TTBR0_EL2));
1460− u16 asid;
1461−
1462− asid = FIELD_GET(TTBR_ASID_MASK, ttbr);
1463− if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
1464− !(tcr & TCR_ASID16))
1465− asid &= GENMASK(7, 0);
1466−
1467− if (asid != vt->wr.asid)
1468− return;
1469− }
1472+ if (vt->wr.nG && get_asid_by_regime(vcpu, TR_EL20) != vt->wr.asid)
1473+ return;
14701474
14711475 vt->cpu = smp_processor_id();
14721476
arch/arm64/kvm/sys_regs.c+3−0
@@ -1816,6 +1816,9 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu, · 1815 unmodified lines
18161816 ID_AA64MMFR3_EL1_SCTLRX |
18171817 ID_AA64MMFR3_EL1_S1POE |
18181818 ID_AA64MMFR3_EL1_S1PIE;
1819+
1820+ if (!system_supports_poe())
1821+ val &= ~ID_AA64MMFR3_EL1_S1POE;
18191822 break;
18201823 case SYS_ID_MMFR4_EL1:
18211824 val &= ~ID_MMFR4_EL1_CCIDX;
arch/arm64/kvm/vgic/vgic-init.c+16−16
@@ -143,6 +143,21 @@ int kvm_vgic_create(struct kvm *kvm, u32 type) · 142 unmodified lines
143143 kvm->arch.vgic.in_kernel = true;
144144 kvm->arch.vgic.vgic_model = type;
145145 kvm->arch.vgic.implementation_rev = KVM_VGIC_IMP_REV_LATEST;
146+ kvm->arch.vgic.vgic_dist_base = VGIC_ADDR_UNDEF;
147+
148+ aa64pfr0 = kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1) & ~ID_AA64PFR0_EL1_GIC;
149+ pfr1 = kvm_read_vm_id_reg(kvm, SYS_ID_PFR1_EL1) & ~ID_PFR1_EL1_GIC;
150+
151+ if (type == KVM_DEV_TYPE_ARM_VGIC_V2) {
152+ kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF;
153+ } else {
154+ INIT_LIST_HEAD(&kvm->arch.vgic.rd_regions);
155+ aa64pfr0 |= SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, GIC, IMP);
156+ pfr1 |= SYS_FIELD_PREP_ENUM(ID_PFR1_EL1, GIC, GICv3);
157+ }
158+
159+ kvm_set_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1, aa64pfr0);
160+ kvm_set_vm_id_reg(kvm, SYS_ID_PFR1_EL1, pfr1);
146161
147162 kvm_for_each_vcpu(i, vcpu, kvm) {
148163 ret = vgic_allocate_private_irqs_locked(vcpu, type);
@@ -157,25 +172,10 @@ int kvm_vgic_create(struct kvm *kvm, u32 type) · 8 unmodified lines
157172 vgic_cpu->private_irqs = NULL;
158173 }
159174
175+ kvm->arch.vgic.vgic_model = 0;
160176 goto out_unlock;
161177 }
162178
163− kvm->arch.vgic.vgic_dist_base = VGIC_ADDR_UNDEF;
164−
165− aa64pfr0 = kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1) & ~ID_AA64PFR0_EL1_GIC;
166− pfr1 = kvm_read_vm_id_reg(kvm, SYS_ID_PFR1_EL1) & ~ID_PFR1_EL1_GIC;
167−
168− if (type == KVM_DEV_TYPE_ARM_VGIC_V2) {
169− kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF;
170− } else {
171− INIT_LIST_HEAD(&kvm->arch.vgic.rd_regions);
172− aa64pfr0 |= SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, GIC, IMP);
173− pfr1 |= SYS_FIELD_PREP_ENUM(ID_PFR1_EL1, GIC, GICv3);
174− }
175−
176− kvm_set_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1, aa64pfr0);
177− kvm_set_vm_id_reg(kvm, SYS_ID_PFR1_EL1, pfr1);
178−
179179 if (type == KVM_DEV_TYPE_ARM_VGIC_V3)
180180 kvm->arch.vgic.nassgicap = system_supports_direct_sgis();
181181
arch/arm64/kvm/vgic/vgic-v2.c+2−2
@@ -115,7 +115,7 @@ void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu) · 114 unmodified lines
115115 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
116116 struct vgic_v2_cpu_if *cpuif = &vgic_cpu->vgic_v2;
117117 u32 eoicount = FIELD_GET(GICH_HCR_EOICOUNT, cpuif->vgic_hcr);
118− struct vgic_irq *irq;
118+ struct vgic_irq *irq = *host_data_ptr(last_lr_irq);
119119
120120 DEBUG_SPINLOCK_BUG_ON(!irqs_disabled());
121121
@@ -123,7 +123,7 @@ void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu) · 1 unmodified line
123123 vgic_v2_fold_lr(vcpu, cpuif->vgic_lr[lr]);
124124
125125 /* See the GICv3 equivalent for the EOIcount handling rationale */
126− list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
126+ list_for_each_entry_continue(irq, &vgic_cpu->ap_list_head, ap_list) {
127127 u32 lr;
128128
129129 if (!eoicount) {
arch/arm64/kvm/vgic/vgic-v3.c+6−6
@@ -148,7 +148,7 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu) · 147 unmodified lines
148148 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
149149 struct vgic_v3_cpu_if *cpuif = &vgic_cpu->vgic_v3;
150150 u32 eoicount = FIELD_GET(ICH_HCR_EL2_EOIcount, cpuif->vgic_hcr);
151− struct vgic_irq *irq;
151+ struct vgic_irq *irq = *host_data_ptr(last_lr_irq);
152152
153153 DEBUG_SPINLOCK_BUG_ON(!irqs_disabled());
154154
@@ -158,12 +158,12 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu) · 3 unmodified lines
158158 /*
159159 * EOIMode=0: use EOIcount to emulate deactivation. We are
160160 * guaranteed to deactivate in reverse order of the activation, so
161− * just pick one active interrupt after the other in the ap_list,
162− * and replay the deactivation as if the CPU was doing it. We also
163− * rely on priority drop to have taken place, and the list to be
164− * sorted by priority.
161+ * just pick one active interrupt after the other in the tail part
162+ * of the ap_list, past the LRs, and replay the deactivation as if
163+ * the CPU was doing it. We also rely on priority drop to have taken
164+ * place, and the list to be sorted by priority.
165165 */
166− list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
166+ list_for_each_entry_continue(irq, &vgic_cpu->ap_list_head, ap_list) {
167167 u64 lr;
168168
169169 /*
arch/arm64/kvm/vgic/vgic.c+6−0
@@ -814,6 +814,9 @@ retry: · 813 unmodified lines
814814
815815 static inline void vgic_fold_lr_state(struct kvm_vcpu *vcpu)
816816 {
817+ if (!*host_data_ptr(last_lr_irq))
818+ return;
819+
817820 if (kvm_vgic_global_state.type == VGIC_V2)
818821 vgic_v2_fold_lr_state(vcpu);
819822 else
@@ -960,10 +963,13 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu) · 140 unmodified lines
960963 if (irqs_outside_lrs(&als))
961964 vgic_sort_ap_list(vcpu);
962965
966+ *host_data_ptr(last_lr_irq) = NULL;
967+
963968 list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
964969 scoped_guard(raw_spinlock, &irq->irq_lock) {
965970 if (likely(vgic_target_oracle(irq) == vcpu)) {
966971 vgic_populate_lr(vcpu, irq, count++);
972+ *host_data_ptr(last_lr_irq) = irq;
967973 }
968974 }
969975
arch/arm64/lib/delay.c+5−1
@@ -32,7 +32,11 @@ static inline unsigned long xloops_to_cycles(unsigned long xloops) · 31 unmodified lines
3232 * Note that userspace cannot change the offset behind our back either,
3333 * as the vcpu mutex is held as long as KVM_RUN is in progress.
3434 */
35−#define __delay_cycles() __arch_counter_get_cntvct_stable()
35+static cycles_t notrace __delay_cycles(void)
36+{
37+ guard(preempt_notrace)();
38+ return __arch_counter_get_cntvct_stable();
39+}
3640
3741 void __delay(unsigned long cycles)
3842 {
arch/arm64/mm/contpte.c+49−4
@@ -599,6 +599,27 @@ void contpte_clear_young_dirty_ptes(struct vm_area_struct *vma, · 598 unmodified lines
599599 }
600600 EXPORT_SYMBOL_GPL(contpte_clear_young_dirty_ptes);
601601
602+static bool contpte_all_subptes_match_access_flags(pte_t *ptep, pte_t entry)
603+{
604+ pte_t *cont_ptep = contpte_align_down(ptep);
605+ /*
606+ * PFNs differ per sub-PTE. Match only bits consumed by
607+ * __ptep_set_access_flags(): AF, DIRTY and write permission.
608+ */
609+ const pteval_t cmp_mask = PTE_RDONLY | PTE_AF | PTE_WRITE | PTE_DIRTY;
610+ pteval_t entry_cmp = pte_val(entry) & cmp_mask;
611+ int i;
612+
613+ for (i = 0; i < CONT_PTES; i++) {
614+ pteval_t pte_cmp = pte_val(__ptep_get(cont_ptep + i)) & cmp_mask;
615+
616+ if (pte_cmp != entry_cmp)
617+ return false;
618+ }
619+
620+ return true;
621+}
622+
602623 int contpte_ptep_set_access_flags(struct vm_area_struct *vma,
603624 unsigned long addr, pte_t *ptep,
604625 pte_t entry, int dirty)
@@ -608,13 +629,37 @@ int contpte_ptep_set_access_flags(struct vm_area_struct *vma, · 3 unmodified lines
608629 int i;
609630
610631 /*
611− * Gather the access/dirty bits for the contiguous range. If nothing has
612− * changed, its a noop.
632+ * Check whether all sub-PTEs in the CONT block already match the
633+ * requested access flags/write permission, using raw per-PTE values
634+ * rather than the gathered ptep_get() view.
635+ *
636+ * __ptep_set_access_flags() can update AF, dirty and write
637+ * permission, but only to make the mapping more permissive.
638+ *
639+ * ptep_get() gathers AF/dirty state across the whole CONT block,
640+ * which is correct for a CPU with FEAT_HAFDBS. But page-table
641+ * walkers that evaluate each descriptor individually (e.g. a CPU
642+ * without DBM support, or an SMMU without HTTU, or with HA/HD
643+ * disabled in CD.TCR) can keep faulting on the target sub-PTE if
644+ * only a sibling has been updated. Gathering can therefore cause
645+ * false no-ops when only a sibling has been updated:
646+ * - write faults: target still has PTE_RDONLY (needs PTE_RDONLY cleared)
647+ * - read faults: target still lacks PTE_AF
648+ *
649+ * Per Arm ARM (DDI 0487) D8.7.1, any sub-PTE in a CONT range may
650+ * become the effective cached translation, so all entries must have
651+ * consistent attributes. Check the full CONT block before returning
652+ * no-op, and when any sub-PTE mismatches, proceed to update the whole
653+ * range.
613654 */
614− orig_pte = pte_mknoncont(ptep_get(ptep));
615− if (pte_val(orig_pte) == pte_val(entry))
655+ if (contpte_all_subptes_match_access_flags(ptep, entry))
616656 return 0;
617657
658+ /*
659+ * Use raw target pte (not gathered) for write-bit unfold decision.
660+ */
661+ orig_pte = pte_mknoncont(__ptep_get(ptep));
662+
618663 /*
619664 * We can fix up access/dirty bits without having to unfold the contig
620665 * range. But if the write bit is changing, we must unfold.
arch/arm64/mm/ioremap.c+3−3
@@ -14,8 +14,8 @@ int arm64_ioremap_prot_hook_register(ioremap_prot_hook_t hook) · 13 unmodified lines
1414 return 0;
1515 }
1616
17−void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
18− pgprot_t pgprot)
17+void __iomem *__ioremap_prot(phys_addr_t phys_addr, size_t size,
18+ pgprot_t pgprot)
1919 {
2020 unsigned long last_addr = phys_addr + size - 1;
2121
@@ -39,7 +39,7 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, · 17 unmodified lines
3939
4040 return generic_ioremap_prot(phys_addr, size, pgprot);
4141 }
42−EXPORT_SYMBOL(ioremap_prot);
42+EXPORT_SYMBOL(__ioremap_prot);
4343
4444 /*
4545 * Must be called after early_fixmap_init
arch/arm64/mm/mmap.c+10−2
@@ -34,6 +34,8 @@ static pgprot_t protection_map[16] __ro_after_init = { · 33 unmodified lines
3434 [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_SHARED_EXEC
3535 };
3636
37+static ptdesc_t gcs_page_prot __ro_after_init = _PAGE_GCS_RO;
38+
3739 /*
3840 * You really shouldn't be using read() or write() on /dev/mem. This might go
3941 * away in the future.
@@ -73,9 +75,11 @@ static int __init adjust_protection_map(void) · 33 unmodified lines
7375 protection_map[VM_EXEC | VM_SHARED] = PAGE_EXECONLY;
7476 }
7577
76− if (lpa2_is_enabled())
78+ if (lpa2_is_enabled()) {
7779 for (int i = 0; i < ARRAY_SIZE(protection_map); i++)
7880 pgprot_val(protection_map[i]) &= ~PTE_SHARED;
81+ gcs_page_prot &= ~PTE_SHARED;
82+ }
7983
8084 return 0;
8185 }
@@ -87,7 +91,11 @@ pgprot_t vm_get_page_prot(vm_flags_t vm_flags) · 5 unmodified lines
8791
8892 /* Short circuit GCS to avoid bloating the table. */
8993 if (system_supports_gcs() && (vm_flags & VM_SHADOW_STACK)) {
90− prot = _PAGE_GCS_RO;
94+ /* Honour mprotect(PROT_NONE) on shadow stack mappings */
95+ if (vm_flags & VM_ACCESS_FLAGS)
96+ prot = gcs_page_prot;
97+ else
98+ prot = pgprot_val(protection_map[VM_NONE]);
9199 } else {
92100 prot = pgprot_val(protection_map[vm_flags &
93101 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]);
arch/arm64/net/bpf_jit_comp.c+1−1
@@ -2119,7 +2119,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) · 2118 unmodified lines
21192119 extable_offset = round_up(prog_size + PLT_TARGET_SIZE, extable_align);
21202120 image_size = extable_offset + extable_size;
21212121 ro_header = bpf_jit_binary_pack_alloc(image_size, &ro_image_ptr,
2122− sizeof(u32), &header, &image_ptr,
2122+ sizeof(u64), &header, &image_ptr,
21232123 jit_fill_hole);
21242124 if (!ro_header) {
21252125 prog = orig_prog;
arch/csky/kernel/vmlinux.lds.S+1−0
@@ -109,6 +109,7 @@ SECTIONS · 108 unmodified lines
109109
110110 STABS_DEBUG
111111 DWARF_DEBUG
112+ MODINFO
112113 ELF_DETAILS
113114
114115 DISCARDS
arch/hexagon/kernel/vmlinux.lds.S+1−0
@@ -62,6 +62,7 @@ SECTIONS · 61 unmodified lines
6262
6363 STABS_DEBUG
6464 DWARF_DEBUG
65+ MODINFO
6566 ELF_DETAILS
6667 .hexagon.attributes 0 : { *(.hexagon.attributes) }
6768
arch/loongarch/kernel/vmlinux.lds.S+1−0
@@ -147,6 +147,7 @@ SECTIONS · 146 unmodified lines
147147
148148 STABS_DEBUG
149149 DWARF_DEBUG
150+ MODINFO
150151 ELF_DETAILS
151152
152153 #ifdef CONFIG_EFI_STUB
arch/loongarch/kvm/Kconfig+0−1
@@ -28,7 +28,6 @@ config KVM · 27 unmodified lines
2828 select KVM_COMMON
2929 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
3030 select KVM_GENERIC_HARDWARE_ENABLING
31− select KVM_GENERIC_MMU_NOTIFIER
3231 select KVM_MMIO
3332 select VIRT_XFER_TO_GUEST_WORK
3433 select SCHED_INFO
arch/loongarch/kvm/vcpu.c+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #define CREATE_TRACE_POINTS
1515 #include "trace.h"
1616
17−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
17+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
1818 KVM_GENERIC_VCPU_STATS(),
1919 STATS_DESC_COUNTER(VCPU, int_exits),
2020 STATS_DESC_COUNTER(VCPU, idle_exits),
arch/loongarch/kvm/vm.c+1−2
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <asm/kvm_eiointc.h>
1111 #include <asm/kvm_pch_pic.h>
1212
13−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
13+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
1414 KVM_GENERIC_VM_STATS(),
1515 STATS_DESC_ICOUNTER(VM, pages),
1616 STATS_DESC_ICOUNTER(VM, hugepages),
@@ -118,7 +118,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 101 unmodified lines
118118 case KVM_CAP_ONE_REG:
119119 case KVM_CAP_ENABLE_CAP:
120120 case KVM_CAP_READONLY_MEM:
121− case KVM_CAP_SYNC_MMU:
122121 case KVM_CAP_IMMEDIATE_EXIT:
123122 case KVM_CAP_IOEVENTFD:
124123 case KVM_CAP_MP_STATE:
arch/m68k/kernel/vmlinux-nommu.lds+1−0
@@ -85,6 +85,7 @@ SECTIONS { · 84 unmodified lines
8585 _end = .;
8686
8787 STABS_DEBUG
88+ MODINFO
8889 ELF_DETAILS
8990
9091 /* Sections to be discarded */
arch/m68k/kernel/vmlinux-std.lds+1−0
@@ -58,6 +58,7 @@ SECTIONS · 57 unmodified lines
5858 _end = . ;
5959
6060 STABS_DEBUG
61+ MODINFO
6162 ELF_DETAILS
6263
6364 /* Sections to be discarded */
arch/m68k/kernel/vmlinux-sun3.lds+1−0
@@ -51,6 +51,7 @@ __init_begin = .; · 50 unmodified lines
5151 _end = . ;
5252
5353 STABS_DEBUG
54+ MODINFO
5455 ELF_DETAILS
5556
5657 /* Sections to be discarded */
arch/mips/kernel/vmlinux.lds.S+1−0
@@ -217,6 +217,7 @@ SECTIONS · 216 unmodified lines
217217
218218 STABS_DEBUG
219219 DWARF_DEBUG
220+ MODINFO
220221 ELF_DETAILS
221222
222223 /* These must appear regardless of . */
arch/mips/kvm/Kconfig+0−1
@@ -23,7 +23,6 @@ config KVM · 22 unmodified lines
2323 select KVM_COMMON
2424 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
2525 select KVM_MMIO
26− select KVM_GENERIC_MMU_NOTIFIER
2726 select KVM_GENERIC_HARDWARE_ENABLING
2827 select HAVE_KVM_READONLY_MEM
2928 help
arch/mips/kvm/mips.c+2−3
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 #define VECTORSPACING 0x100 /* for EI/VI mode */
3939 #endif
4040
41−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
41+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
4242 KVM_GENERIC_VM_STATS()
4343 };
4444
@@ -51,7 +51,7 @@ const struct kvm_stats_header kvm_vm_stats_header = { · 6 unmodified lines
5151 sizeof(kvm_vm_stats_desc),
5252 };
5353
54−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
54+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
5555 KVM_GENERIC_VCPU_STATS(),
5656 STATS_DESC_COUNTER(VCPU, wait_exits),
5757 STATS_DESC_COUNTER(VCPU, cache_exits),
@@ -1035,7 +1035,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 977 unmodified lines
10351035 case KVM_CAP_ONE_REG:
10361036 case KVM_CAP_ENABLE_CAP:
10371037 case KVM_CAP_READONLY_MEM:
1038− case KVM_CAP_SYNC_MMU:
10391038 case KVM_CAP_IMMEDIATE_EXIT:
10401039 r = 1;
10411040 break;
arch/nios2/kernel/vmlinux.lds.S+1−0
@@ -57,6 +57,7 @@ SECTIONS · 56 unmodified lines
5757
5858 STABS_DEBUG
5959 DWARF_DEBUG
60+ MODINFO
6061 ELF_DETAILS
6162
6263 DISCARDS
arch/openrisc/kernel/vmlinux.lds.S+1−0
@@ -101,6 +101,7 @@ SECTIONS · 100 unmodified lines
101101 /* Throw in the debugging sections */
102102 STABS_DEBUG
103103 DWARF_DEBUG
104+ MODINFO
104105 ELF_DETAILS
105106
106107 /* Sections to be discarded -- must be last */
arch/parisc/boot/compressed/vmlinux.lds.S+1−0
@@ -90,6 +90,7 @@ SECTIONS · 89 unmodified lines
9090 /* Sections to be discarded */
9191 DISCARDS
9292 /DISCARD/ : {
93+ *(.modinfo)
9394 #ifdef CONFIG_64BIT
9495 /* temporary hack until binutils is fixed to not emit these
9596 * for static binaries
arch/parisc/include/asm/pgtable.h+1−1
@@ -85,7 +85,7 @@ extern void __update_cache(pte_t pte); · 84 unmodified lines
8585 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))
8686
8787 /* This is the size of the initially mapped kernel memory */
88−#if defined(CONFIG_64BIT)
88+#if defined(CONFIG_64BIT) || defined(CONFIG_KALLSYMS)
8989 #define KERNEL_INITIAL_ORDER 26 /* 1<<26 = 64MB */
9090 #else
9191 #define KERNEL_INITIAL_ORDER 25 /* 1<<25 = 32MB */
arch/parisc/kernel/head.S+6−1
@@ -56,6 +56,7 @@ ENTRY(parisc_kernel_start) · 55 unmodified lines
5656
5757 .import __bss_start,data
5858 .import __bss_stop,data
59+ .import __end,data
5960
6061 load32 PA(__bss_start),%r3
6162 load32 PA(__bss_stop),%r4
@@ -149,7 +150,11 @@ $cpu_ok: · 87 unmodified lines
149150 * everything ... it will get remapped correctly later */
150151 ldo 0+_PAGE_KERNEL_RWX(%r0),%r3 /* Hardwired 0 phys addr start */
151152 load32 (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */
152− load32 PA(pg0),%r1
153+ load32 PA(_end),%r1
154+ SHRREG %r1,PAGE_SHIFT,%r1 /* %r1 is PFN count for _end symbol */
155+ cmpb,<<,n %r11,%r1,1f
156+ copy %r1,%r11 /* %r1 PFN count smaller than %r11 */
157+1: load32 PA(pg0),%r1
153158
154159 $pgt_fill_loop:
155160 STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1)
arch/parisc/kernel/setup.c+12−8
@@ -120,14 +120,6 @@ void __init setup_arch(char **cmdline_p) · 119 unmodified lines
120120 #endif
121121 printk(KERN_CONT ".\n");
122122
123− /*
124− * Check if initial kernel page mappings are sufficient.
125− * panic early if not, else we may access kernel functions
126− * and variables which can't be reached.
127− */
128− if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
129− panic("KERNEL_INITIAL_ORDER too small!");
130−
131123 #ifdef CONFIG_64BIT
132124 if(parisc_narrow_firmware) {
133125 printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
@@ -279,6 +271,18 @@ void __init start_parisc(void) · 145 unmodified lines
279271 int ret, cpunum;
280272 struct pdc_coproc_cfg coproc_cfg;
281273
274+ /*
275+ * Check if initial kernel page mapping is sufficient.
276+ * Print warning if not, because we may access kernel functions and
277+ * variables which can't be reached yet through the initial mappings.
278+ * Note that the panic() and printk() functions are not functional
279+ * yet, so we need to use direct iodc() firmware calls instead.
280+ */
281+ const char warn1[] = "CRITICAL: Kernel may crash because "
282+ "KERNEL_INITIAL_ORDER is too small.\n";
283+ if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
284+ pdc_iodc_print(warn1, sizeof(warn1) - 1);
285+
282286 /* check QEMU/SeaBIOS marker in PAGE0 */
283287 running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);
284288
arch/parisc/kernel/vmlinux.lds.S+1−0
@@ -165,6 +165,7 @@ SECTIONS · 164 unmodified lines
165165 _end = . ;
166166
167167 STABS_DEBUG
168+ MODINFO
168169 ELF_DETAILS
169170 .note 0 : { *(.note) }
170171
arch/powerpc/Kconfig+2−2
@@ -573,8 +573,8 @@ config ARCH_USING_PATCHABLE_FUNCTION_ENTRY · 572 unmodified lines
573573 depends on FUNCTION_TRACER && (PPC32 || PPC64_ELF_ABI_V2)
574574 depends on $(cc-option,-fpatchable-function-entry=2)
575575 def_bool y if PPC32
576− def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mlittle-endian) if PPC64 && CPU_LITTLE_ENDIAN
577− def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mbig-endian) if PPC64 && CPU_BIG_ENDIAN
576+ def_bool $(success,$(srctree)/arch/powerpc/tools/check-fpatchable-function-entry.sh $(CC) $(CLANG_FLAGS) -mlittle-endian) if PPC64 && CPU_LITTLE_ENDIAN
577+ def_bool $(success,$(srctree)/arch/powerpc/tools/check-fpatchable-function-entry.sh $(CC) -mbig-endian) if PPC64 && CPU_BIG_ENDIAN
578578
579579 config PPC_FTRACE_OUT_OF_LINE
580580 def_bool PPC64 && ARCH_USING_PATCHABLE_FUNCTION_ENTRY
arch/powerpc/boot/dts/asp834x-redboot.dts+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 };
3838 };
3939
40− memory {
40+ memory@0 {
4141 device_type = "memory";
4242 reg = <0x00000000 0x8000000>; // 128MB at 0
4343 };
arch/powerpc/boot/dts/fsl/interlaken-lac-portals.dtsi+0−156
@@ -1,156 +0,0 @@
1−/* T4240 Interlaken LAC Portal device tree stub with 24 portals.
2− *
3− * Copyright 2012 Freescale Semiconductor Inc.
4− *
5− * Redistribution and use in source and binary forms, with or without
6− * modification, are permitted provided that the following conditions are met:
7− * * Redistributions of source code must retain the above copyright
8− * notice, this list of conditions and the following disclaimer.
9− * * Redistributions in binary form must reproduce the above copyright
10− * notice, this list of conditions and the following disclaimer in the
11− * documentation and/or other materials provided with the distribution.
12− * * Neither the name of Freescale Semiconductor nor the
13− * names of its contributors may be used to endorse or promote products
14− * derived from this software without specific prior written permission.
15− *
16− *
17− * ALTERNATIVELY, this software may be distributed under the terms of the
18− * GNU General Public License ("GPL") as published by the Free Software
19− * Foundation, either version 2 of that License or (at your option) any
20− * later version.
21− *
22− * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY
23− * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24− * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25− * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
26− * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27− * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28− * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29− * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30− * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31− * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32− */
33−
34−#address-cells = <0x1>;
35−#size-cells = <0x1>;
36−compatible = "fsl,interlaken-lac-portals";
37−
38−lportal0: lac-portal@0 {
39− compatible = "fsl,interlaken-lac-portal-v1.0";
40− reg = <0x0 0x1000>;
41−};
42−
43−lportal1: lac-portal@1000 {
44− compatible = "fsl,interlaken-lac-portal-v1.0";
45− reg = <0x1000 0x1000>;
46−};
47−
48−lportal2: lac-portal@2000 {
49− compatible = "fsl,interlaken-lac-portal-v1.0";
50− reg = <0x2000 0x1000>;
51−};
52−
53−lportal3: lac-portal@3000 {
54− compatible = "fsl,interlaken-lac-portal-v1.0";
55− reg = <0x3000 0x1000>;
56−};
57−
58−lportal4: lac-portal@4000 {
59− compatible = "fsl,interlaken-lac-portal-v1.0";
60− reg = <0x4000 0x1000>;
61−};
62−
63−lportal5: lac-portal@5000 {
64− compatible = "fsl,interlaken-lac-portal-v1.0";
65− reg = <0x5000 0x1000>;
66−};
67−
68−lportal6: lac-portal@6000 {
69− compatible = "fsl,interlaken-lac-portal-v1.0";
70− reg = <0x6000 0x1000>;
71−};
72−
73−lportal7: lac-portal@7000 {
74− compatible = "fsl,interlaken-lac-portal-v1.0";
75− reg = <0x7000 0x1000>;
76−};
77−
78−lportal8: lac-portal@8000 {
79− compatible = "fsl,interlaken-lac-portal-v1.0";
80− reg = <0x8000 0x1000>;
81−};
82−
83−lportal9: lac-portal@9000 {
84− compatible = "fsl,interlaken-lac-portal-v1.0";
85− reg = <0x9000 0x1000>;
86−};
87−
88−lportal10: lac-portal@A000 {
89− compatible = "fsl,interlaken-lac-portal-v1.0";
90− reg = <0xA000 0x1000>;
91−};
92−
93−lportal11: lac-portal@B000 {
94− compatible = "fsl,interlaken-lac-portal-v1.0";
95− reg = <0xB000 0x1000>;
96−};
97−
98−lportal12: lac-portal@C000 {
99− compatible = "fsl,interlaken-lac-portal-v1.0";
100− reg = <0xC000 0x1000>;
101−};
102−
103−lportal13: lac-portal@D000 {
104− compatible = "fsl,interlaken-lac-portal-v1.0";
105− reg = <0xD000 0x1000>;
106−};
107−
108−lportal14: lac-portal@E000 {
109− compatible = "fsl,interlaken-lac-portal-v1.0";
110− reg = <0xE000 0x1000>;
111−};
112−
113−lportal15: lac-portal@F000 {
114− compatible = "fsl,interlaken-lac-portal-v1.0";
115− reg = <0xF000 0x1000>;
116−};
117−
118−lportal16: lac-portal@10000 {
119− compatible = "fsl,interlaken-lac-portal-v1.0";
120− reg = <0x10000 0x1000>;
121−};
122−
123−lportal17: lac-portal@11000 {
124− compatible = "fsl,interlaken-lac-portal-v1.0";
125− reg = <0x11000 0x1000>;
126−};
127−
128−lportal18: lac-portal@1200 {
129− compatible = "fsl,interlaken-lac-portal-v1.0";
130− reg = <0x12000 0x1000>;
131−};
132−
133−lportal19: lac-portal@13000 {
134− compatible = "fsl,interlaken-lac-portal-v1.0";
135− reg = <0x13000 0x1000>;
136−};
137−
138−lportal20: lac-portal@14000 {
139− compatible = "fsl,interlaken-lac-portal-v1.0";
140− reg = <0x14000 0x1000>;
141−};
142−
143−lportal21: lac-portal@15000 {
144− compatible = "fsl,interlaken-lac-portal-v1.0";
145− reg = <0x15000 0x1000>;
146−};
147−
148−lportal22: lac-portal@16000 {
149− compatible = "fsl,interlaken-lac-portal-v1.0";
150− reg = <0x16000 0x1000>;
151−};
152−
153−lportal23: lac-portal@17000 {
154− compatible = "fsl,interlaken-lac-portal-v1.0";
155− reg = <0x17000 0x1000>;
156−};
arch/powerpc/boot/dts/fsl/interlaken-lac.dtsi+0−45
@@ -1,45 +0,0 @@
1−/*
2− * T4 Interlaken Look-aside Controller (LAC) device tree stub
3− *
4− * Copyright 2012 Freescale Semiconductor Inc.
5− *
6− * Redistribution and use in source and binary forms, with or without
7− * modification, are permitted provided that the following conditions are met:
8− * * Redistributions of source code must retain the above copyright
9− * notice, this list of conditions and the following disclaimer.
10− * * Redistributions in binary form must reproduce the above copyright
11− * notice, this list of conditions and the following disclaimer in the
12− * documentation and/or other materials provided with the distribution.
13− * * Neither the name of Freescale Semiconductor nor the
14− * names of its contributors may be used to endorse or promote products
15− * derived from this software without specific prior written permission.
16− *
17− *
18− * ALTERNATIVELY, this software may be distributed under the terms of the
19− * GNU General Public License ("GPL") as published by the Free Software
20− * Foundation, either version 2 of that License or (at your option) any
21− * later version.
22− *
23− * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY
24− * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25− * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26− * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27− * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28− * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29− * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30− * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31− * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32− * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33− */
34−
35−lac: lac@229000 {
36− compatible = "fsl,interlaken-lac";
37− reg = <0x229000 0x1000>;
38− interrupts = <16 2 1 18>;
39−};
40−
41−lac-hv@228000 {
42− compatible = "fsl,interlaken-lac-hv";
43− reg = <0x228000 0x1000>;
44− fsl,non-hv-node = <&lac>;
45−};
arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi+0−43
@@ -1,43 +0,0 @@
1−/*
2− * PQ3 MPIC Message (Group B) device tree stub [ controller @ offset 0x42400 ]
3− *
4− * Copyright 2012 Freescale Semiconductor Inc.
5− *
6− * Redistribution and use in source and binary forms, with or without
7− * modification, are permitted provided that the following conditions are met:
8− * * Redistributions of source code must retain the above copyright
9− * notice, this list of conditions and the following disclaimer.
10− * * Redistributions in binary form must reproduce the above copyright
11− * notice, this list of conditions and the following disclaimer in the
12− * documentation and/or other materials provided with the distribution.
13− * * Neither the name of Freescale Semiconductor nor the
14− * names of its contributors may be used to endorse or promote products
15− * derived from this software without specific prior written permission.
16− *
17− *
18− * ALTERNATIVELY, this software may be distributed under the terms of the
19− * GNU General Public License ("GPL") as published by the Free Software
20− * Foundation, either version 2 of that License or (at your option) any
21− * later version.
22− *
23− * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24− * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25− * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26− * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27− * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28− * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29− * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30− * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31− * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32− * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33− */
34−
35−message@42400 {
36− compatible = "fsl,mpic-v3.1-msgr";
37− reg = <0x42400 0x200>;
38− interrupts = <
39− 0xb4 2 0 0
40− 0xb5 2 0 0
41− 0xb6 2 0 0
42− 0xb7 2 0 0>;
43−};
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi+0−80
@@ -1,80 +0,0 @@
1−/*
2− * QorIQ FMan v3 1g port #1 device tree stub [ controller @ offset 0x400000 ]
3− *
4− * Copyright 2012 - 2015 Freescale Semiconductor Inc.
5− *
6− * Redistribution and use in source and binary forms, with or without
7− * modification, are permitted provided that the following conditions are met:
8− * * Redistributions of source code must retain the above copyright
9− * notice, this list of conditions and the following disclaimer.
10− * * Redistributions in binary form must reproduce the above copyright
11− * notice, this list of conditions and the following disclaimer in the
12− * documentation and/or other materials provided with the distribution.
13− * * Neither the name of Freescale Semiconductor nor the
14− * names of its contributors may be used to endorse or promote products
15− * derived from this software without specific prior written permission.
16− *
17− *
18− * ALTERNATIVELY, this software may be distributed under the terms of the
19− * GNU General Public License ("GPL") as published by the Free Software
20− * Foundation, either version 2 of that License or (at your option) any
21− * later version.
22− *
23− * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24− * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25− * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26− * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27− * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28− * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29− * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30− * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31− * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32− * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33− */
34−
35−fman@400000 {
36− fman0_rx_0x09: port@89000 {
37− cell-index = <0x9>;
38− compatible = "fsl,fman-v3-port-rx";
39− reg = <0x89000 0x1000>;
40− fsl,fman-10g-port;
41− fsl,fman-best-effort-port;
42− };
43−
44− fman0_tx_0x29: port@a9000 {
45− cell-index = <0x29>;
46− compatible = "fsl,fman-v3-port-tx";
47− reg = <0xa9000 0x1000>;
48− fsl,fman-10g-port;
49− fsl,fman-best-effort-port;
50− };
51−
52− ethernet@e2000 {
53− cell-index = <1>;
54− compatible = "fsl,fman-memac";
55− reg = <0xe2000 0x1000>;
56− fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
57− ptp-timer = <&ptp_timer0>;
58− pcsphy-handle = <&pcsphy1>, <&qsgmiia_pcs1>;
59− pcs-handle-names = "sgmii", "qsgmii";
60− };
61−
62− mdio@e1000 {
63− qsgmiia_pcs1: ethernet-pcs@1 {
64− compatible = "fsl,lynx-pcs";
65− reg = <1>;
66− };
67− };
68−
69− mdio@e3000 {
70− #address-cells = <1>;
71− #size-cells = <0>;
72− compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
73− reg = <0xe3000 0x1000>;
74− fsl,erratum-a011043; /* must ignore read errors */
75−
76− pcsphy1: ethernet-phy@0 {
77− reg = <0x0>;
78− };
79− };
80−};
arch/powerpc/boot/dts/mpc8308_p1m.dts+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 };
3838 };
3939
40− memory {
40+ memory@0 {
4141 device_type = "memory";
4242 reg = <0x00000000 0x08000000>; // 128MB at 0
4343 };
arch/powerpc/boot/dts/mpc8308rdb.dts+1−1
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 };
3939 };
4040
41− memory {
41+ memory@0 {
4242 device_type = "memory";
4343 reg = <0x00000000 0x08000000>; // 128MB at 0
4444 };
arch/powerpc/boot/dts/mpc8313erdb.dts+35−26
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 /dts-v1/;
9+#include <dt-bindings/interrupt-controller/irq.h>
910
1011 / {
1112 model = "MPC8313ERDB";
@@ -38,7 +39,7 @@ · 26 unmodified lines
3839 };
3940 };
4041
41− memory {
42+ memory@0 {
4243 device_type = "memory";
4344 reg = <0x00000000 0x08000000>; // 128MB at 0
4445 };
@@ -48,7 +49,7 @@ · 3 unmodified lines
4849 #size-cells = <1>;
4950 compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
5051 reg = <0xe0005000 0x1000>;
51− interrupts = <77 0x8>;
52+ interrupts = <77 IRQ_TYPE_LEVEL_LOW>;
5253 interrupt-parent = <&ipic>;
5354
5455 // CS0 and CS1 are swapped when
@@ -118,7 +119,7 @@ · 63 unmodified lines
118119 cell-index = <0>;
119120 compatible = "fsl-i2c";
120121 reg = <0x3000 0x100>;
121− interrupts = <14 0x8>;
122+ interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
122123 interrupt-parent = <&ipic>;
123124 dfsrr;
124125 rtc@68 {
@@ -131,7 +132,7 @@ · 6 unmodified lines
131132 compatible = "fsl,sec2.2", "fsl,sec2.1",
132133 "fsl,sec2.0";
133134 reg = <0x30000 0x10000>;
134− interrupts = <11 0x8>;
135+ interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
135136 interrupt-parent = <&ipic>;
136137 fsl,num-channels = <1>;
137138 fsl,channel-fifo-len = <24>;
@@ -146,7 +147,7 @@ · 8 unmodified lines
146147 cell-index = <1>;
147148 compatible = "fsl-i2c";
148149 reg = <0x3100 0x100>;
149− interrupts = <15 0x8>;
150+ interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
150151 interrupt-parent = <&ipic>;
151152 dfsrr;
152153 };
@@ -155,7 +156,7 @@ · 2 unmodified lines
155156 cell-index = <0>;
156157 compatible = "fsl,spi";
157158 reg = <0x7000 0x1000>;
158− interrupts = <16 0x8>;
159+ interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
159160 interrupt-parent = <&ipic>;
160161 mode = "cpu";
161162 };
@@ -167,7 +168,7 @@ · 5 unmodified lines
167168 #address-cells = <1>;
168169 #size-cells = <0>;
169170 interrupt-parent = <&ipic>;
170− interrupts = <38 0x8>;
171+ interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
171172 phy_type = "utmi_wide";
172173 sleep = <&pmc 0x00300000>;
173174 };
@@ -175,7 +176,8 @@ · 1 unmodified line
175176 ptp_clock@24E00 {
176177 compatible = "fsl,etsec-ptp";
177178 reg = <0x24E00 0xB0>;
178− interrupts = <12 0x8 13 0x8>;
179+ interrupts = <12 IRQ_TYPE_LEVEL_LOW>,
180+ <13 IRQ_TYPE_LEVEL_LOW>;
179181 interrupt-parent = < &ipic >;
180182 fsl,tclk-period = <10>;
181183 fsl,tmr-prsc = <100>;
@@ -197,7 +199,9 @@ · 15 unmodified lines
197199 compatible = "gianfar";
198200 reg = <0x24000 0x1000>;
199201 local-mac-address = [ 00 00 00 00 00 00 ];
200− interrupts = <37 0x8 36 0x8 35 0x8>;
202+ interrupts = <37 IRQ_TYPE_LEVEL_LOW>,
203+ <36 IRQ_TYPE_LEVEL_LOW>,
204+ <35 IRQ_TYPE_LEVEL_LOW>;
201205 interrupt-parent = <&ipic>;
202206 tbi-handle = < &tbi0 >;
203207 /* Vitesse 7385 isn't on the MDIO bus */
@@ -211,7 +215,7 @@ · 7 unmodified lines
211215 reg = <0x520 0x20>;
212216 phy4: ethernet-phy@4 {
213217 interrupt-parent = <&ipic>;
214− interrupts = <20 0x8>;
218+ interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
215219 reg = <0x4>;
216220 };
217221 tbi0: tbi-phy@11 {
@@ -231,7 +235,9 @@ · 13 unmodified lines
231235 reg = <0x25000 0x1000>;
232236 ranges = <0x0 0x25000 0x1000>;
233237 local-mac-address = [ 00 00 00 00 00 00 ];
234− interrupts = <34 0x8 33 0x8 32 0x8>;
238+ interrupts = <34 IRQ_TYPE_LEVEL_LOW>,
239+ <33 IRQ_TYPE_LEVEL_LOW>,
240+ <32 IRQ_TYPE_LEVEL_LOW>;
235241 interrupt-parent = <&ipic>;
236242 tbi-handle = < &tbi1 >;
237243 phy-handle = < &phy4 >;
@@ -259,7 +265,7 @@ · 21 unmodified lines
259265 compatible = "fsl,ns16550", "ns16550";
260266 reg = <0x4500 0x100>;
261267 clock-frequency = <0>;
262− interrupts = <9 0x8>;
268+ interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
263269 interrupt-parent = <&ipic>;
264270 };
265271
@@ -269,15 +275,12 @@ · 3 unmodified lines
269275 compatible = "fsl,ns16550", "ns16550";
270276 reg = <0x4600 0x100>;
271277 clock-frequency = <0>;
272− interrupts = <10 0x8>;
278+ interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
273279 interrupt-parent = <&ipic>;
274280 };
275281
276282 /* IPIC
277− * interrupts cell = <intr #, sense>
278− * sense values match linux IORESOURCE_IRQ_* defines:
279− * sense == 8: Level, low assertion
280− * sense == 2: Edge, high-to-low change
283+ * interrupts cell = <intr #, type>
281284 */
282285 ipic: pic@700 {
283286 interrupt-controller;
@@ -290,7 +293,7 @@ · 6 unmodified lines
290293 pmc: power@b00 {
291294 compatible = "fsl,mpc8313-pmc", "fsl,mpc8349-pmc";
292295 reg = <0xb00 0x100 0xa00 0x100>;
293− interrupts = <80 8>;
296+ interrupts = <80 IRQ_TYPE_LEVEL_LOW>;
294297 interrupt-parent = <&ipic>;
295298 fsl,mpc8313-wakeup-timer = <&gtm1>;
296299
@@ -306,14 +309,20 @@ · 9 unmodified lines
306309 gtm1: timer@500 {
307310 compatible = "fsl,mpc8313-gtm", "fsl,gtm";
308311 reg = <0x500 0x100>;
309− interrupts = <90 8 78 8 84 8 72 8>;
312+ interrupts = <90 IRQ_TYPE_LEVEL_LOW>,
313+ <78 IRQ_TYPE_LEVEL_LOW>,
314+ <84 IRQ_TYPE_LEVEL_LOW>,
315+ <72 IRQ_TYPE_LEVEL_LOW>;
310316 interrupt-parent = <&ipic>;
311317 };
312318
313319 timer@600 {
314320 compatible = "fsl,mpc8313-gtm", "fsl,gtm";
315321 reg = <0x600 0x100>;
316− interrupts = <91 8 79 8 85 8 73 8>;
322+ interrupts = <91 IRQ_TYPE_LEVEL_LOW>,
323+ <79 IRQ_TYPE_LEVEL_LOW>,
324+ <85 IRQ_TYPE_LEVEL_LOW>,
325+ <73 IRQ_TYPE_LEVEL_LOW>;
317326 interrupt-parent = <&ipic>;
318327 };
319328 };
@@ -341,7 +350,7 @@ · 21 unmodified lines
341350 0x7800 0x0 0x0 0x3 &ipic 17 0x8
342351 0x7800 0x0 0x0 0x4 &ipic 18 0x8>;
343352 interrupt-parent = <&ipic>;
344− interrupts = <66 0x8>;
353+ interrupts = <66 IRQ_TYPE_LEVEL_LOW>;
345354 bus-range = <0x0 0x0>;
346355 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
347356 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
@@ -363,14 +372,14 @@ · 15 unmodified lines
363372 reg = <0xe00082a8 4>;
364373 ranges = <0 0xe0008100 0x1a8>;
365374 interrupt-parent = <&ipic>;
366− interrupts = <71 8>;
375+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
367376
368377 dma-channel@0 {
369378 compatible = "fsl,mpc8313-dma-channel",
370379 "fsl,elo-dma-channel";
371380 reg = <0 0x28>;
372381 interrupt-parent = <&ipic>;
373− interrupts = <71 8>;
382+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
374383 cell-index = <0>;
375384 };
376385
@@ -379,7 +388,7 @@ · 2 unmodified lines
379388 "fsl,elo-dma-channel";
380389 reg = <0x80 0x28>;
381390 interrupt-parent = <&ipic>;
382− interrupts = <71 8>;
391+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
383392 cell-index = <1>;
384393 };
385394
@@ -388,7 +397,7 @@ · 2 unmodified lines
388397 "fsl,elo-dma-channel";
389398 reg = <0x100 0x28>;
390399 interrupt-parent = <&ipic>;
391− interrupts = <71 8>;
400+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
392401 cell-index = <2>;
393402 };
394403
@@ -397,7 +406,7 @@ · 2 unmodified lines
397406 "fsl,elo-dma-channel";
398407 reg = <0x180 0x28>;
399408 interrupt-parent = <&ipic>;
400− interrupts = <71 8>;
409+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
401410 cell-index = <3>;
402411 };
403412 };
arch/powerpc/boot/dts/mpc8315erdb.dts+64−55
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 };
4141 };
4242
43− memory {
43+ memory@0 {
4444 device_type = "memory";
4545 reg = <0x00000000 0x08000000>; // 128MB at 0
4646 };
@@ -50,7 +50,7 @@ · 3 unmodified lines
5050 #size-cells = <1>;
5151 compatible = "fsl,mpc8315-elbc", "fsl,elbc", "simple-bus";
5252 reg = <0xe0005000 0x1000>;
53− interrupts = <77 0x8>;
53+ interrupts = <77 IRQ_TYPE_LEVEL_LOW>;
5454 interrupt-parent = <&ipic>;
5555
5656 // CS0 and CS1 are swapped when
@@ -112,7 +112,7 @@ · 55 unmodified lines
112112 cell-index = <0>;
113113 compatible = "fsl-i2c";
114114 reg = <0x3000 0x100>;
115− interrupts = <14 0x8>;
115+ interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
116116 interrupt-parent = <&ipic>;
117117 dfsrr;
118118 rtc@68 {
@@ -133,8 +133,10 @@ · 14 unmodified lines
133133 cell-index = <0>;
134134 compatible = "fsl,spi";
135135 reg = <0x7000 0x1000>;
136− interrupts = <16 0x8>;
136+ interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
137137 interrupt-parent = <&ipic>;
138+ #address-cells = <1>;
139+ #size-cells = <0>;
138140 mode = "cpu";
139141 };
140142
@@ -145,35 +147,35 @@ · 4 unmodified lines
145147 reg = <0x82a8 4>;
146148 ranges = <0 0x8100 0x1a8>;
147149 interrupt-parent = <&ipic>;
148− interrupts = <71 8>;
150+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
149151 cell-index = <0>;
150152 dma-channel@0 {
151153 compatible = "fsl,mpc8315-dma-channel", "fsl,elo-dma-channel";
152154 reg = <0 0x80>;
153155 cell-index = <0>;
154156 interrupt-parent = <&ipic>;
155− interrupts = <71 8>;
157+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
156158 };
157159 dma-channel@80 {
158160 compatible = "fsl,mpc8315-dma-channel", "fsl,elo-dma-channel";
159161 reg = <0x80 0x80>;
160162 cell-index = <1>;
161163 interrupt-parent = <&ipic>;
162− interrupts = <71 8>;
164+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
163165 };
164166 dma-channel@100 {
165167 compatible = "fsl,mpc8315-dma-channel", "fsl,elo-dma-channel";
166168 reg = <0x100 0x80>;
167169 cell-index = <2>;
168170 interrupt-parent = <&ipic>;
169− interrupts = <71 8>;
171+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
170172 };
171173 dma-channel@180 {
172174 compatible = "fsl,mpc8315-dma-channel", "fsl,elo-dma-channel";
173175 reg = <0x180 0x28>;
174176 cell-index = <3>;
175177 interrupt-parent = <&ipic>;
176− interrupts = <71 8>;
178+ interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
177179 };
178180 };
179181
@@ -183,7 +185,7 @@ · 3 unmodified lines
183185 #address-cells = <1>;
184186 #size-cells = <0>;
185187 interrupt-parent = <&ipic>;
186− interrupts = <38 0x8>;
188+ interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
187189 phy_type = "utmi";
188190 };
189191
@@ -197,7 +199,9 @@ · 7 unmodified lines
197199 reg = <0x24000 0x1000>;
198200 ranges = <0x0 0x24000 0x1000>;
199201 local-mac-address = [ 00 00 00 00 00 00 ];
200− interrupts = <32 0x8 33 0x8 34 0x8>;
202+ interrupts = <32 IRQ_TYPE_LEVEL_LOW>,
203+ <33 IRQ_TYPE_LEVEL_LOW>,
204+ <34 IRQ_TYPE_LEVEL_LOW>;
201205 interrupt-parent = <&ipic>;
202206 tbi-handle = <&tbi0>;
203207 phy-handle = < &phy0 >;
@@ -238,7 +242,9 @@ · 34 unmodified lines
238242 reg = <0x25000 0x1000>;
239243 ranges = <0x0 0x25000 0x1000>;
240244 local-mac-address = [ 00 00 00 00 00 00 ];
241− interrupts = <35 0x8 36 0x8 37 0x8>;
245+ interrupts = <35 IRQ_TYPE_LEVEL_LOW>,
246+ <36 IRQ_TYPE_LEVEL_LOW>,
247+ <37 IRQ_TYPE_LEVEL_LOW>;
242248 interrupt-parent = <&ipic>;
243249 tbi-handle = <&tbi1>;
244250 phy-handle = < &phy1 >;
@@ -263,7 +269,7 @@ · 18 unmodified lines
263269 compatible = "fsl,ns16550", "ns16550";
264270 reg = <0x4500 0x100>;
265271 clock-frequency = <133333333>;
266− interrupts = <9 0x8>;
272+ interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
267273 interrupt-parent = <&ipic>;
268274 };
269275
@@ -273,7 +279,7 @@ · 3 unmodified lines
273279 compatible = "fsl,ns16550", "ns16550";
274280 reg = <0x4600 0x100>;
275281 clock-frequency = <133333333>;
276− interrupts = <10 0x8>;
282+ interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
277283 interrupt-parent = <&ipic>;
278284 };
279285
@@ -282,7 +288,7 @@ · 2 unmodified lines
282288 "fsl,sec2.4", "fsl,sec2.2", "fsl,sec2.1",
283289 "fsl,sec2.0";
284290 reg = <0x30000 0x10000>;
285− interrupts = <11 0x8>;
291+ interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
286292 interrupt-parent = <&ipic>;
287293 fsl,num-channels = <4>;
288294 fsl,channel-fifo-len = <24>;
@@ -294,7 +300,7 @@ · 5 unmodified lines
294300 compatible = "fsl,mpc8315-sata", "fsl,pq-sata";
295301 reg = <0x18000 0x1000>;
296302 cell-index = <1>;
297− interrupts = <44 0x8>;
303+ interrupts = <44 IRQ_TYPE_LEVEL_LOW>;
298304 interrupt-parent = <&ipic>;
299305 };
300306
@@ -302,14 +308,17 @@ · 1 unmodified line
302308 compatible = "fsl,mpc8315-sata", "fsl,pq-sata";
303309 reg = <0x19000 0x1000>;
304310 cell-index = <2>;
305− interrupts = <45 0x8>;
311+ interrupts = <45 IRQ_TYPE_LEVEL_LOW>;
306312 interrupt-parent = <&ipic>;
307313 };
308314
309315 gtm1: timer@500 {
310316 compatible = "fsl,mpc8315-gtm", "fsl,gtm";
311317 reg = <0x500 0x100>;
312− interrupts = <90 8 78 8 84 8 72 8>;
318+ interrupts = <90 IRQ_TYPE_LEVEL_LOW>,
319+ <78 IRQ_TYPE_LEVEL_LOW>,
320+ <84 IRQ_TYPE_LEVEL_LOW>,
321+ <72 IRQ_TYPE_LEVEL_LOW>;
313322 interrupt-parent = <&ipic>;
314323 clock-frequency = <133333333>;
315324 };
@@ -317,16 +326,16 @@ · 1 unmodified line
317326 timer@600 {
318327 compatible = "fsl,mpc8315-gtm", "fsl,gtm";
319328 reg = <0x600 0x100>;
320− interrupts = <91 8 79 8 85 8 73 8>;
329+ interrupts = <91 IRQ_TYPE_LEVEL_LOW>,
330+ <79 IRQ_TYPE_LEVEL_LOW>,
331+ <85 IRQ_TYPE_LEVEL_LOW>,
332+ <73 IRQ_TYPE_LEVEL_LOW>;
321333 interrupt-parent = <&ipic>;
322334 clock-frequency = <133333333>;
323335 };
324336
325337 /* IPIC
326− * interrupts cell = <intr #, sense>
327− * sense values match linux IORESOURCE_IRQ_* defines:
328− * sense == 8: Level, low assertion
329− * sense == 2: Edge, high-to-low change
338+ * interrupts cell = <intr #, type>
330339 */
331340 ipic: interrupt-controller@700 {
332341 interrupt-controller;
@@ -340,14 +349,14 @@ · 7 unmodified lines
340349 compatible = "fsl,ipic-msi";
341350 reg = <0x7c0 0x40>;
342351 msi-available-ranges = <0 0x100>;
343− interrupts = <0x43 0x8
344− 0x4 0x8
345− 0x51 0x8
346− 0x52 0x8
347− 0x56 0x8
348− 0x57 0x8
349− 0x58 0x8
350− 0x59 0x8>;
352+ interrupts = <0x43 IRQ_TYPE_LEVEL_LOW
353+ 0x4 IRQ_TYPE_LEVEL_LOW
354+ 0x51 IRQ_TYPE_LEVEL_LOW
355+ 0x52 IRQ_TYPE_LEVEL_LOW
356+ 0x56 IRQ_TYPE_LEVEL_LOW
357+ 0x57 IRQ_TYPE_LEVEL_LOW
358+ 0x58 IRQ_TYPE_LEVEL_LOW
359+ 0x59 IRQ_TYPE_LEVEL_LOW>;
351360 interrupt-parent = < &ipic >;
352361 };
353362
@@ -355,7 +364,7 @@ · 1 unmodified line
355364 compatible = "fsl,mpc8315-pmc", "fsl,mpc8313-pmc",
356365 "fsl,mpc8349-pmc";
357366 reg = <0xb00 0x100 0xa00 0x100>;
358− interrupts = <80 8>;
367+ interrupts = <80 IRQ_TYPE_LEVEL_LOW>;
359368 interrupt-parent = <&ipic>;
360369 fsl,mpc8313-wakeup-timer = <&gtm1>;
361370 };
@@ -374,24 +383,24 @@ · 12 unmodified lines
374383 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
375384 interrupt-map = <
376385 /* IDSEL 0x0E -mini PCI */
377− 0x7000 0x0 0x0 0x1 &ipic 18 0x8
378− 0x7000 0x0 0x0 0x2 &ipic 18 0x8
379− 0x7000 0x0 0x0 0x3 &ipic 18 0x8
380− 0x7000 0x0 0x0 0x4 &ipic 18 0x8
386+ 0x7000 0x0 0x0 0x1 &ipic 18 IRQ_TYPE_LEVEL_LOW
387+ 0x7000 0x0 0x0 0x2 &ipic 18 IRQ_TYPE_LEVEL_LOW
388+ 0x7000 0x0 0x0 0x3 &ipic 18 IRQ_TYPE_LEVEL_LOW
389+ 0x7000 0x0 0x0 0x4 &ipic 18 IRQ_TYPE_LEVEL_LOW
381390
382391 /* IDSEL 0x0F -mini PCI */
383− 0x7800 0x0 0x0 0x1 &ipic 17 0x8
384− 0x7800 0x0 0x0 0x2 &ipic 17 0x8
385− 0x7800 0x0 0x0 0x3 &ipic 17 0x8
386− 0x7800 0x0 0x0 0x4 &ipic 17 0x8
392+ 0x7800 0x0 0x0 0x1 &ipic 17 IRQ_TYPE_LEVEL_LOW
393+ 0x7800 0x0 0x0 0x2 &ipic 17 IRQ_TYPE_LEVEL_LOW
394+ 0x7800 0x0 0x0 0x3 &ipic 17 IRQ_TYPE_LEVEL_LOW
395+ 0x7800 0x0 0x0 0x4 &ipic 17 IRQ_TYPE_LEVEL_LOW
387396
388397 /* IDSEL 0x10 - PCI slot */
389− 0x8000 0x0 0x0 0x1 &ipic 48 0x8
390− 0x8000 0x0 0x0 0x2 &ipic 17 0x8
391− 0x8000 0x0 0x0 0x3 &ipic 48 0x8
392− 0x8000 0x0 0x0 0x4 &ipic 17 0x8>;
398+ 0x8000 0x0 0x0 0x1 &ipic 48 IRQ_TYPE_LEVEL_LOW
399+ 0x8000 0x0 0x0 0x2 &ipic 17 IRQ_TYPE_LEVEL_LOW
400+ 0x8000 0x0 0x0 0x3 &ipic 48 IRQ_TYPE_LEVEL_LOW
401+ 0x8000 0x0 0x0 0x4 &ipic 17 IRQ_TYPE_LEVEL_LOW>;
393402 interrupt-parent = <&ipic>;
394− interrupts = <66 0x8>;
403+ interrupts = <66 IRQ_TYPE_LEVEL_LOW>;
395404 bus-range = <0x0 0x0>;
396405 ranges = <0x02000000 0 0x90000000 0x90000000 0 0x10000000
397406 0x42000000 0 0x80000000 0x80000000 0 0x10000000
@@ -417,10 +426,10 @@ · 19 unmodified lines
417426 0x01000000 0 0x00000000 0xb1000000 0 0x00800000>;
418427 bus-range = <0 255>;
419428 interrupt-map-mask = <0xf800 0 0 7>;
420− interrupt-map = <0 0 0 1 &ipic 1 8
421− 0 0 0 2 &ipic 1 8
422− 0 0 0 3 &ipic 1 8
423− 0 0 0 4 &ipic 1 8>;
429+ interrupt-map = <0 0 0 1 &ipic 1 IRQ_TYPE_LEVEL_LOW
430+ 0 0 0 2 &ipic 1 IRQ_TYPE_LEVEL_LOW
431+ 0 0 0 3 &ipic 1 IRQ_TYPE_LEVEL_LOW
432+ 0 0 0 4 &ipic 1 IRQ_TYPE_LEVEL_LOW>;
424433 clock-frequency = <0>;
425434
426435 pcie@0 {
@@ -448,10 +457,10 @@ · 21 unmodified lines
448457 0x01000000 0 0x00000000 0xd1000000 0 0x00800000>;
449458 bus-range = <0 255>;
450459 interrupt-map-mask = <0xf800 0 0 7>;
451− interrupt-map = <0 0 0 1 &ipic 2 8
452− 0 0 0 2 &ipic 2 8
453− 0 0 0 3 &ipic 2 8
454− 0 0 0 4 &ipic 2 8>;
460+ interrupt-map = <0 0 0 1 &ipic 2 IRQ_TYPE_LEVEL_LOW
461+ 0 0 0 2 &ipic 2 IRQ_TYPE_LEVEL_LOW
462+ 0 0 0 3 &ipic 2 IRQ_TYPE_LEVEL_LOW
463+ 0 0 0 4 &ipic 2 IRQ_TYPE_LEVEL_LOW>;
455464 clock-frequency = <0>;
456465
457466 pcie@0 {
@@ -471,12 +480,12 @@ · 13 unmodified lines
471480 leds {
472481 compatible = "gpio-leds";
473482
474− pwr {
483+ led-pwr {
475484 gpios = <&mcu_pio 0 0>;
476485 default-state = "on";
477486 };
478487
479− hdd {
488+ led-hdd {
480489 gpios = <&mcu_pio 1 0>;
481490 linux,default-trigger = "disk-activity";
482491 };
arch/powerpc/boot/dts/mpc832x_rdb.dts+1−1
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 };
3939 };
4040
41− memory {
41+ memory@0 {
4242 device_type = "memory";
4343 reg = <0x00000000 0x04000000>;
4444 };
arch/powerpc/boot/dts/mpc8349emitx.dts+1−1
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 };
4040 };
4141
42− memory {
42+ memory@0 {
4343 device_type = "memory";
4444 reg = <0x00000000 0x10000000>;
4545 };
arch/powerpc/boot/dts/mpc8349emitxgp.dts+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 };
3838 };
3939
40− memory {
40+ memory@0 {
4141 device_type = "memory";
4242 reg = <0x00000000 0x10000000>;
4343 };
arch/powerpc/boot/dts/mpc8377_rdb.dts+1−1
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 };
4040 };
4141
42− memory {
42+ memory@0 {
4343 device_type = "memory";
4444 reg = <0x00000000 0x10000000>; // 256MB at 0
4545 };
arch/powerpc/boot/dts/mpc8377_wlan.dts+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 };
4141 };
4242
43− memory {
43+ memory@0 {
4444 device_type = "memory";
4545 reg = <0x00000000 0x20000000>; // 512MB at 0
4646 };
arch/powerpc/boot/dts/mpc8378_rdb.dts+1−1
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 };
4040 };
4141
42− memory {
42+ memory@0 {
4343 device_type = "memory";
4444 reg = <0x00000000 0x10000000>; // 256MB at 0
4545 };
arch/powerpc/boot/dts/mpc8379_rdb.dts+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 };
3838 };
3939
40− memory {
40+ memory@0 {
4141 device_type = "memory";
4242 reg = <0x00000000 0x10000000>; // 256MB at 0
4343 };
arch/powerpc/include/asm/nohash/32/pgtable.h+1−3
@@ -120,10 +120,8 @@ · 119 unmodified lines
120120
121121 #if defined(CONFIG_44x)
122122 #include <asm/nohash/32/pte-44x.h>
123−#elif defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT)
124−#include <asm/nohash/pte-e500.h>
125123 #elif defined(CONFIG_PPC_85xx)
126−#include <asm/nohash/32/pte-85xx.h>
124+#include <asm/nohash/pte-e500.h>
127125 #elif defined(CONFIG_PPC_8xx)
128126 #include <asm/nohash/32/pte-8xx.h>
129127 #endif
arch/powerpc/include/asm/nohash/32/pte-85xx.h+0−59
@@ -1,59 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _ASM_POWERPC_NOHASH_32_PTE_85xx_H
3−#define _ASM_POWERPC_NOHASH_32_PTE_85xx_H
4−#ifdef __KERNEL__
5−
6−/* PTE bit definitions for Freescale BookE SW loaded TLB MMU based
7− * processors
8− *
9− MMU Assist Register 3:
10−
11− 32 33 34 35 36 ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63
12− RPN...................... 0 0 U0 U1 U2 U3 UX SX UW SW UR SR
13−
14− - PRESENT *must* be in the bottom two bits because swap PTEs use
15− the top 30 bits.
16−
17−*/
18−
19−/* Definitions for FSL Book-E Cores */
20−#define _PAGE_READ 0x00001 /* H: Read permission (SR) */
21−#define _PAGE_PRESENT 0x00002 /* S: PTE contains a translation */
22−#define _PAGE_WRITE 0x00004 /* S: Write permission (SW) */
23−#define _PAGE_DIRTY 0x00008 /* S: Page dirty */
24−#define _PAGE_EXEC 0x00010 /* H: SX permission */
25−#define _PAGE_ACCESSED 0x00020 /* S: Page referenced */
26−
27−#define _PAGE_ENDIAN 0x00040 /* H: E bit */
28−#define _PAGE_GUARDED 0x00080 /* H: G bit */
29−#define _PAGE_COHERENT 0x00100 /* H: M bit */
30−#define _PAGE_NO_CACHE 0x00200 /* H: I bit */
31−#define _PAGE_WRITETHRU 0x00400 /* H: W bit */
32−#define _PAGE_SPECIAL 0x00800 /* S: Special page */
33−
34−#define _PMD_PRESENT 0
35−#define _PMD_PRESENT_MASK (PAGE_MASK)
36−#define _PMD_BAD (~PAGE_MASK)
37−#define _PMD_USER 0
38−
39−#define _PTE_NONE_MASK 0
40−
41−#define PTE_WIMGE_SHIFT (6)
42−
43−/*
44− * We define 2 sets of base prot bits, one for basic pages (ie,
45− * cacheable kernel and user pages) and one for non cacheable
46− * pages. We always set _PAGE_COHERENT when SMP is enabled or
47− * the processor might need it for DMA coherency.
48− */
49−#define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED)
50−#if defined(CONFIG_SMP) || defined(CONFIG_PPC_E500MC)
51−#define _PAGE_BASE (_PAGE_BASE_NC | _PAGE_COHERENT)
52−#else
53−#define _PAGE_BASE (_PAGE_BASE_NC)
54−#endif
55−
56−#include <asm/pgtable-masks.h>
57−
58−#endif /* __KERNEL__ */
59−#endif /* _ASM_POWERPC_NOHASH_32_PTE_FSL_85xx_H */
arch/powerpc/include/asm/pgtable-types.h+1−1
@@ -49,7 +49,7 @@ static inline unsigned long pud_val(pud_t x) · 48 unmodified lines
4949 #endif /* CONFIG_PPC64 */
5050
5151 /* PGD level */
52−#if defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT)
52+#if defined(CONFIG_PPC_85xx)
5353 typedef struct { unsigned long long pgd; } pgd_t;
5454
5555 static inline unsigned long long pgd_val(pgd_t x)
arch/powerpc/include/asm/uaccess.h+46−21
@@ -15,6 +15,9 @@ · 14 unmodified lines
1515 #define TASK_SIZE_MAX TASK_SIZE_USER64
1616 #endif
1717
18+/* Threshold above which VMX copy path is used */
19+#define VMX_COPY_THRESHOLD 3328
20+
1821 #include <asm-generic/access_ok.h>
1922
2023 /*
@@ -255,7 +258,7 @@ __gus_failed: \ · 234 unmodified lines
255258 ".section .fixup,\"ax\"\n" \
256259 "4: li %0,%3\n" \
257260 " li %1,0\n" \
258− " li %1+1,0\n" \
261+ " li %L1,0\n" \
259262 " b 3b\n" \
260263 ".previous\n" \
261264 EX_TABLE(1b, 4b) \
@@ -326,40 +329,62 @@ do { \ · 64 unmodified lines
326329 extern unsigned long __copy_tofrom_user(void __user *to,
327330 const void __user *from, unsigned long size);
328331
329−#ifdef __powerpc64__
330−static inline unsigned long
331−raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
332+unsigned long __copy_tofrom_user_base(void __user *to,
333+ const void __user *from, unsigned long size);
334+
335+unsigned long __copy_tofrom_user_power7_vmx(void __user *to,
336+ const void __user *from, unsigned long size);
337+
338+static __always_inline bool will_use_vmx(unsigned long n)
339+{
340+ return IS_ENABLED(CONFIG_ALTIVEC) && cpu_has_feature(CPU_FTR_VMX_COPY) &&
341+ n > VMX_COPY_THRESHOLD;
342+}
343+
344+static __always_inline unsigned long
345+raw_copy_tofrom_user(void __user *to, const void __user *from,
346+ unsigned long n, unsigned long dir)
332347 {
333348 unsigned long ret;
334349
335− barrier_nospec();
336− allow_user_access(to, KUAP_READ_WRITE);
350+ if (will_use_vmx(n) && enter_vmx_usercopy()) {
351+ allow_user_access(to, dir);
352+ ret = __copy_tofrom_user_power7_vmx(to, from, n);
353+ prevent_user_access(dir);
354+ exit_vmx_usercopy();
355+
356+ if (unlikely(ret)) {
357+ allow_user_access(to, dir);
358+ ret = __copy_tofrom_user_base(to, from, n);
359+ prevent_user_access(dir);
360+ }
361+ return ret;
362+ }
363+
364+ allow_user_access(to, dir);
337365 ret = __copy_tofrom_user(to, from, n);
338− prevent_user_access(KUAP_READ_WRITE);
366+ prevent_user_access(dir);
339367 return ret;
340368 }
341−#endif /* __powerpc64__ */
342369
343−static inline unsigned long raw_copy_from_user(void *to,
344− const void __user *from, unsigned long n)
370+#ifdef CONFIG_PPC64
371+static inline unsigned long
372+raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
345373 {
346− unsigned long ret;
374+ barrier_nospec();
375+ return raw_copy_tofrom_user(to, from, n, KUAP_READ_WRITE);
376+}
377+#endif /* CONFIG_PPC64 */
347378
348− allow_user_access(NULL, KUAP_READ);
349− ret = __copy_tofrom_user((__force void __user *)to, from, n);
350− prevent_user_access(KUAP_READ);
351− return ret;
379+static inline unsigned long raw_copy_from_user(void *to, const void __user *from, unsigned long n)
380+{
381+ return raw_copy_tofrom_user((__force void __user *)to, from, n, KUAP_READ);
352382 }
353383
354384 static inline unsigned long
355385 raw_copy_to_user(void __user *to, const void *from, unsigned long n)
356386 {
357− unsigned long ret;
358−
359− allow_user_access(to, KUAP_WRITE);
360− ret = __copy_tofrom_user(to, (__force const void __user *)from, n);
361− prevent_user_access(KUAP_WRITE);
362− return ret;
387+ return raw_copy_tofrom_user(to, (__force const void __user *)from, n, KUAP_WRITE);
363388 }
364389
365390 unsigned long __arch_clear_user(void __user *addr, unsigned long size);
arch/powerpc/kernel/head_85xx.S+1−45
@@ -305,7 +305,6 @@ set_ivor: · 304 unmodified lines
305305 * r12 is pointer to the pte
306306 * r10 is the pshift from the PGD, if we're a hugepage
307307 */
308−#ifdef CONFIG_PTE_64BIT
309308 #ifdef CONFIG_HUGETLB_PAGE
310309 #define FIND_PTE \
311310 rlwinm r12, r13, 14, 18, 28; /* Compute pgdir/pmd offset */ \
@@ -329,15 +328,6 @@ set_ivor: · 17 unmodified lines
329328 rlwimi r12, r13, 23, 20, 28; /* Compute pte address */ \
330329 lwz r11, 4(r12); /* Get pte entry */
331330 #endif /* HUGEPAGE */
332−#else /* !PTE_64BIT */
333−#define FIND_PTE \
334− rlwimi r11, r13, 12, 20, 29; /* Create L1 (pgdir/pmd) address */ \
335− lwz r11, 0(r11); /* Get L1 entry */ \
336− rlwinm. r12, r11, 0, 0, 19; /* Extract L2 (pte) base address */ \
337− beq 2f; /* Bail if no table */ \
338− rlwimi r12, r13, 22, 20, 29; /* Compute PTE address */ \
339− lwz r11, 0(r12); /* Get Linux PTE */
340−#endif
341331
342332 /*
343333 * Interrupt vector entry code
@@ -473,21 +463,15 @@ END_BTB_FLUSH_SECTION · 129 unmodified lines
473463 4:
474464 FIND_PTE
475465
476−#ifdef CONFIG_PTE_64BIT
477466 li r13,_PAGE_PRESENT|_PAGE_BAP_SR
478467 oris r13,r13,_PAGE_ACCESSED@h
479−#else
480− li r13,_PAGE_PRESENT|_PAGE_READ|_PAGE_ACCESSED
481−#endif
482468 andc. r13,r13,r11 /* Check permission */
483469
484−#ifdef CONFIG_PTE_64BIT
485470 #ifdef CONFIG_SMP
486471 subf r13,r11,r12 /* create false data dep */
487472 lwzx r13,r11,r13 /* Get upper pte bits */
488473 #else
489474 lwz r13,0(r12) /* Get upper pte bits */
490−#endif
491475 #endif
492476
493477 bne 2f /* Bail if permission/valid mismatch */
@@ -552,12 +536,8 @@ END_BTB_FLUSH_SECTION · 58 unmodified lines
552536
553537 FIND_PTE
554538 /* Make up the required permissions for kernel code */
555−#ifdef CONFIG_PTE_64BIT
556539 li r13,_PAGE_PRESENT | _PAGE_BAP_SX
557540 oris r13,r13,_PAGE_ACCESSED@h
558−#else
559− li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
560−#endif
561541 b 4f
562542
563543 /* Get the PGD for the current thread */
@@ -573,23 +553,17 @@ END_BTB_FLUSH_SECTION · 9 unmodified lines
573553
574554 FIND_PTE
575555 /* Make up the required permissions for user code */
576−#ifdef CONFIG_PTE_64BIT
577556 li r13,_PAGE_PRESENT | _PAGE_BAP_UX
578557 oris r13,r13,_PAGE_ACCESSED@h
579−#else
580− li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
581−#endif
582558
583559 4:
584560 andc. r13,r13,r11 /* Check permission */
585561
586−#ifdef CONFIG_PTE_64BIT
587562 #ifdef CONFIG_SMP
588563 subf r13,r11,r12 /* create false data dep */
589564 lwzx r13,r11,r13 /* Get upper pte bits */
590565 #else
591566 lwz r13,0(r12) /* Get upper pte bits */
592−#endif
593567 #endif
594568
595569 bne 2f /* Bail if permission mismatch */
@@ -683,7 +657,7 @@ interrupt_end: · 87 unmodified lines
683657 * r10 - tsize encoding (if HUGETLB_PAGE) or available to use
684658 * r11 - TLB (info from Linux PTE)
685659 * r12 - available to use
686− * r13 - upper bits of PTE (if PTE_64BIT) or available to use
660+ * r13 - upper bits of PTE
687661 * CR5 - results of addr >= PAGE_OFFSET
688662 * MAS0, MAS1 - loaded with proper value when we get here
689663 * MAS2, MAS3 - will need additional info from Linux PTE
@@ -751,7 +725,6 @@ finish_tlb_load: · 61 unmodified lines
751725 * here we (properly should) assume have the appropriate value.
752726 */
753727 finish_tlb_load_cont:
754−#ifdef CONFIG_PTE_64BIT
755728 rlwinm r12, r11, 32-2, 26, 31 /* Move in perm bits */
756729 andi. r10, r11, _PAGE_DIRTY
757730 bne 1f
@@ -764,26 +737,9 @@ BEGIN_MMU_FTR_SECTION · 6 unmodified lines
764737 srwi r10, r13, 12 /* grab RPN[12:31] */
765738 mtspr SPRN_MAS7, r10
766739 END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
767−#else
768− li r10, (_PAGE_EXEC | _PAGE_READ)
769− mr r13, r11
770− rlwimi r10, r11, 31, 29, 29 /* extract _PAGE_DIRTY into SW */
771− and r12, r11, r10
772− mcrf cr0, cr5 /* Test for user page */
773− slwi r10, r12, 1
774− or r10, r10, r12
775− rlwinm r10, r10, 0, ~_PAGE_EXEC /* Clear SX on user pages */
776− isellt r12, r10, r12
777− rlwimi r13, r12, 0, 20, 31 /* Get RPN from PTE, merge w/ perms */
778− mtspr SPRN_MAS3, r13
779−#endif
780740
781741 mfspr r12, SPRN_MAS2
782−#ifdef CONFIG_PTE_64BIT
783742 rlwimi r12, r11, 32-19, 27, 31 /* extract WIMGE from pte */
784−#else
785− rlwimi r12, r11, 26, 27, 31 /* extract WIMGE from pte */
786−#endif
787743 #ifdef CONFIG_HUGETLB_PAGE
788744 beq 6, 3f /* don't mask if page isn't huge */
789745 li r13, 1
arch/powerpc/kernel/iommu.c+1−1
@@ -1159,7 +1159,7 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain, · 1158 unmodified lines
11591159 struct device *dev,
11601160 struct iommu_domain *old)
11611161 {
1162− struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
1162+ struct iommu_domain *domain = iommu_driver_get_domain_for_dev(dev);
11631163 struct iommu_table_group *table_group;
11641164 struct iommu_group *grp;
11651165
arch/powerpc/kernel/pci_of_scan.c+7−0
@@ -212,6 +212,13 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 211 unmodified lines
212212 dev->error_state = pci_channel_io_normal;
213213 dev->dma_mask = 0xffffffff;
214214
215+ /*
216+ * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
217+ * if MSI (rather than MSI-X) capability does not have
218+ * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
219+ */
220+ dev->msi_addr_mask = DMA_BIT_MASK(64);
221+
215222 /* Early fixups, before probing the BARs */
216223 pci_fixup_device(pci_fixup_early, dev);
217224
arch/powerpc/kernel/prom_init.c+2−1
@@ -2893,7 +2893,8 @@ static void __init fixup_device_tree_pmac(void) · 2892 unmodified lines
28932893 for (node = 0; prom_next_node(&node); ) {
28942894 type[0] = '\0';
28952895 prom_getprop(node, "device_type", type, sizeof(type));
2896− if (prom_strcmp(type, "escc") && prom_strcmp(type, "i2s"))
2896+ if (prom_strcmp(type, "escc") && prom_strcmp(type, "i2s") &&
2897+ prom_strcmp(type, "media-bay"))
28972898 continue;
28982899
28992900 if (prom_getproplen(node, "#size-cells") != PROM_ERROR)
arch/powerpc/kernel/setup-common.c+0−10
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #include <linux/of_irq.h>
3636 #include <linux/hugetlb.h>
3737 #include <linux/pgtable.h>
38−#include <asm/kexec.h>
3938 #include <asm/io.h>
4039 #include <asm/paca.h>
4140 #include <asm/processor.h>
@@ -995,15 +994,6 @@ void __init setup_arch(char **cmdline_p) · 953 unmodified lines
995994
996995 initmem_init();
997996
998− /*
999− * Reserve large chunks of memory for use by CMA for kdump, fadump, KVM and
1000− * hugetlb. These must be called after initmem_init(), so that
1001− * pageblock_order is initialised.
1002− */
1003− fadump_cma_init();
1004− kdump_cma_reserve();
1005− kvm_cma_reserve();
1006−
1007997 early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
1008998
1009999 if (ppc_md.setup_arch)
arch/powerpc/kernel/trace/ftrace.c+22−4
@@ -37,11 +37,29 @@ unsigned long ftrace_call_adjust(unsigned long addr) · 36 unmodified lines
3737 if (addr >= (unsigned long)__exittext_begin && addr < (unsigned long)__exittext_end)
3838 return 0;
3939
40− if (IS_ENABLED(CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY) &&
41− !IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE)) {
42− addr += MCOUNT_INSN_SIZE;
43− if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS))
40+ if (IS_ENABLED(CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY)) {
41+ if (!IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE)) {
4442 addr += MCOUNT_INSN_SIZE;
43+ if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS))
44+ addr += MCOUNT_INSN_SIZE;
45+ } else if (IS_ENABLED(CONFIG_CC_IS_CLANG) && IS_ENABLED(CONFIG_PPC64)) {
46+ /*
47+ * addr points to global entry point though the NOP was emitted at local
48+ * entry point due to https://github.com/llvm/llvm-project/issues/163706
49+ * Handle that here with ppc_function_entry() for kernel symbols while
50+ * adjusting module addresses in the else case, by looking for the below
51+ * module global entry point sequence:
52+ * ld r2, -8(r12)
53+ * add r2, r2, r12
54+ */
55+ if (is_kernel_text(addr) || is_kernel_inittext(addr))
56+ addr = ppc_function_entry((void *)addr);
57+ else if ((ppc_inst_val(ppc_inst_read((u32 *)addr)) ==
58+ PPC_RAW_LD(_R2, _R12, -8)) &&
59+ (ppc_inst_val(ppc_inst_read((u32 *)(addr+4))) ==
60+ PPC_RAW_ADD(_R2, _R2, _R12)))
61+ addr += 8;
62+ }
4563 }
4664
4765 return addr;
arch/powerpc/kernel/vmlinux.lds.S+1−0
@@ -397,6 +397,7 @@ SECTIONS · 396 unmodified lines
397397 _end = . ;
398398
399399 DWARF_DEBUG
400+ MODINFO
400401 ELF_DETAILS
401402
402403 DISCARDS
arch/powerpc/kexec/core.c+9−8
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <asm/firmware.h>
2424
2525 #define cpu_to_be_ulong __PASTE(cpu_to_be, BITS_PER_LONG)
26+#define __be_word __PASTE(__be, BITS_PER_LONG)
2627
2728 #ifdef CONFIG_CRASH_DUMP
2829 void machine_crash_shutdown(struct pt_regs *regs)
@@ -146,25 +147,25 @@ int __init overlaps_crashkernel(unsigned long start, unsigned long size) · 117 unmodified lines
146147 }
147148
148149 /* Values we need to export to the second kernel via the device tree. */
149−static phys_addr_t crashk_base;
150−static phys_addr_t crashk_size;
151−static unsigned long long mem_limit;
150+static __be_word crashk_base;
151+static __be_word crashk_size;
152+static __be_word mem_limit;
152153
153154 static struct property crashk_base_prop = {
154155 .name = "linux,crashkernel-base",
155− .length = sizeof(phys_addr_t),
156+ .length = sizeof(__be_word),
156157 .value = &crashk_base
157158 };
158159
159160 static struct property crashk_size_prop = {
160161 .name = "linux,crashkernel-size",
161− .length = sizeof(phys_addr_t),
162+ .length = sizeof(__be_word),
162163 .value = &crashk_size,
163164 };
164165
165166 static struct property memory_limit_prop = {
166167 .name = "linux,memory-limit",
167− .length = sizeof(unsigned long long),
168+ .length = sizeof(__be_word),
168169 .value = &mem_limit,
169170 };
170171
@@ -193,11 +194,11 @@ static void __init export_crashk_values(struct device_node *node) · 22 unmodified lines
193194 }
194195 #endif /* CONFIG_CRASH_RESERVE */
195196
196−static phys_addr_t kernel_end;
197+static __be_word kernel_end;
197198
198199 static struct property kernel_end_prop = {
199200 .name = "linux,kernel-end",
200− .length = sizeof(phys_addr_t),
201+ .length = sizeof(__be_word),
201202 .value = &kernel_end,
202203 };
203204
arch/powerpc/kexec/file_load_64.c+13−1
@@ -450,6 +450,11 @@ static int load_elfcorehdr_segment(struct kimage *image, struct kexec_buf *kbuf) · 449 unmodified lines
450450 kbuf->buffer = headers;
451451 kbuf->mem = KEXEC_BUF_MEM_UNKNOWN;
452452 kbuf->bufsz = headers_sz;
453+
454+ /*
455+ * Account for extra space required to accommodate additional memory
456+ * ranges in elfcorehdr due to memory hotplug events.
457+ */
453458 kbuf->memsz = headers_sz + kdump_extra_elfcorehdr_size(cmem);
454459 kbuf->top_down = false;
455460
@@ -460,7 +465,14 @@ static int load_elfcorehdr_segment(struct kimage *image, struct kexec_buf *kbuf) · 4 unmodified lines
460465 }
461466
462467 image->elf_load_addr = kbuf->mem;
463− image->elf_headers_sz = headers_sz;
468+
469+ /*
470+ * If CONFIG_CRASH_HOTPLUG is enabled, the elfcorehdr kexec segment
471+ * memsz can be larger than bufsz. Always initialize elf_headers_sz
472+ * with memsz. This ensures the correct size is reserved for elfcorehdr
473+ * memory in the FDT prepared for kdump.
474+ */
475+ image->elf_headers_sz = kbuf->memsz;
464476 image->elf_headers = headers;
465477 out:
466478 kfree(cmem);
arch/powerpc/kvm/Kconfig+0−4
@@ -38,7 +38,6 @@ config KVM_BOOK3S_64_HANDLER · 37 unmodified lines
3838 config KVM_BOOK3S_PR_POSSIBLE
3939 bool
4040 select KVM_MMIO
41− select KVM_GENERIC_MMU_NOTIFIER
4241
4342 config KVM_BOOK3S_HV_POSSIBLE
4443 bool
@@ -81,7 +80,6 @@ config KVM_BOOK3S_64_HV · 36 unmodified lines
8180 tristate "KVM for POWER7 and later using hypervisor mode in host"
8281 depends on KVM_BOOK3S_64 && PPC_POWERNV
8382 select KVM_BOOK3S_HV_POSSIBLE
84− select KVM_GENERIC_MMU_NOTIFIER
8583 select KVM_BOOK3S_HV_PMU
8684 select CMA
8785 help
@@ -203,7 +201,6 @@ config KVM_E500V2 · 115 unmodified lines
203201 depends on !CONTEXT_TRACKING_USER
204202 select KVM
205203 select KVM_MMIO
206− select KVM_GENERIC_MMU_NOTIFIER
207204 help
208205 Support running unmodified E500 guest kernels in virtual machines on
209206 E500v2 host processors.
@@ -220,7 +217,6 @@ config KVM_E500MC · 10 unmodified lines
220217 select KVM
221218 select KVM_MMIO
222219 select KVM_BOOKE_HV
223− select KVM_GENERIC_MMU_NOTIFIER
224220 help
225221 Support running unmodified E500MC/E5500/E6500 guest kernels in
226222 virtual machines on E500MC/E5500/E6500 host processors.
arch/powerpc/kvm/book3s.c+2−2
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838
3939 /* #define EXIT_DEBUG */
4040
41−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
41+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
4242 KVM_GENERIC_VM_STATS(),
4343 STATS_DESC_ICOUNTER(VM, num_2M_pages),
4444 STATS_DESC_ICOUNTER(VM, num_1G_pages)
@@ -53,7 +53,7 @@ const struct kvm_stats_header kvm_vm_stats_header = { · 8 unmodified lines
5353 sizeof(kvm_vm_stats_desc),
5454 };
5555
56−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
56+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
5757 KVM_GENERIC_VCPU_STATS(),
5858 STATS_DESC_COUNTER(VCPU, sum_exits),
5959 STATS_DESC_COUNTER(VCPU, mmio_exits),
arch/powerpc/kvm/booke.c+2−2
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636
3737 unsigned long kvmppc_booke_handlers;
3838
39−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
39+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
4040 KVM_GENERIC_VM_STATS(),
4141 STATS_DESC_ICOUNTER(VM, num_2M_pages),
4242 STATS_DESC_ICOUNTER(VM, num_1G_pages)
@@ -51,7 +51,7 @@ const struct kvm_stats_header kvm_vm_stats_header = { · 8 unmodified lines
5151 sizeof(kvm_vm_stats_desc),
5252 };
5353
54−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
54+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
5555 KVM_GENERIC_VCPU_STATS(),
5656 STATS_DESC_COUNTER(VCPU, sum_exits),
5757 STATS_DESC_COUNTER(VCPU, mmio_exits),
arch/powerpc/kvm/e500.h+1−5
@@ -39,15 +39,11 @@ enum vcpu_ftr { · 38 unmodified lines
3939 /* bits [6-5] MAS2_X1 and MAS2_X0 and [4-0] bits for WIMGE */
4040 #define E500_TLB_MAS2_ATTR (0x7f)
4141
42−struct tlbe_ref {
42+struct tlbe_priv {
4343 kvm_pfn_t pfn; /* valid only for TLB0, except briefly */
4444 unsigned int flags; /* E500_TLB_* */
4545 };
4646
47−struct tlbe_priv {
48− struct tlbe_ref ref;
49−};
50−
5147 #ifdef CONFIG_KVM_E500V2
5248 struct vcpu_id_table;
5349 #endif
arch/powerpc/kvm/e500_mmu.c+2−2
@@ -920,12 +920,12 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500) · 919 unmodified lines
920920 vcpu_e500->gtlb_offset[0] = 0;
921921 vcpu_e500->gtlb_offset[1] = KVM_E500_TLB0_SIZE;
922922
923− vcpu_e500->gtlb_priv[0] = kzalloc_objs(struct tlbe_ref,
923+ vcpu_e500->gtlb_priv[0] = kzalloc_objs(struct tlbe_priv,
924924 vcpu_e500->gtlb_params[0].entries);
925925 if (!vcpu_e500->gtlb_priv[0])
926926 goto free_vcpu;
927927
928− vcpu_e500->gtlb_priv[1] = kzalloc_objs(struct tlbe_ref,
928+ vcpu_e500->gtlb_priv[1] = kzalloc_objs(struct tlbe_priv,
929929 vcpu_e500->gtlb_params[1].entries);
930930 if (!vcpu_e500->gtlb_priv[1])
931931 goto free_vcpu;
arch/powerpc/kvm/e500_mmu_host.c+44−47
@@ -189,16 +189,16 @@ void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, · 188 unmodified lines
189189 {
190190 struct kvm_book3e_206_tlb_entry *gtlbe =
191191 get_entry(vcpu_e500, tlbsel, esel);
192− struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[tlbsel][esel].ref;
192+ struct tlbe_priv *tlbe = &vcpu_e500->gtlb_priv[tlbsel][esel];
193193
194194 /* Don't bother with unmapped entries */
195− if (!(ref->flags & E500_TLB_VALID)) {
196− WARN(ref->flags & (E500_TLB_BITMAP | E500_TLB_TLB0),
197− "%s: flags %x\n", __func__, ref->flags);
195+ if (!(tlbe->flags & E500_TLB_VALID)) {
196+ WARN(tlbe->flags & (E500_TLB_BITMAP | E500_TLB_TLB0),
197+ "%s: flags %x\n", __func__, tlbe->flags);
198198 WARN_ON(tlbsel == 1 && vcpu_e500->g2h_tlb1_map[esel]);
199199 }
200200
201− if (tlbsel == 1 && ref->flags & E500_TLB_BITMAP) {
201+ if (tlbsel == 1 && tlbe->flags & E500_TLB_BITMAP) {
202202 u64 tmp = vcpu_e500->g2h_tlb1_map[esel];
203203 int hw_tlb_indx;
204204 unsigned long flags;
@@ -216,28 +216,28 @@ void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, · 11 unmodified lines
216216 }
217217 mb();
218218 vcpu_e500->g2h_tlb1_map[esel] = 0;
219− ref->flags &= ~(E500_TLB_BITMAP | E500_TLB_VALID);
219+ tlbe->flags &= ~(E500_TLB_BITMAP | E500_TLB_VALID);
220220 local_irq_restore(flags);
221221 }
222222
223− if (tlbsel == 1 && ref->flags & E500_TLB_TLB0) {
223+ if (tlbsel == 1 && tlbe->flags & E500_TLB_TLB0) {
224224 /*
225225 * TLB1 entry is backed by 4k pages. This should happen
226226 * rarely and is not worth optimizing. Invalidate everything.
227227 */
228228 kvmppc_e500_tlbil_all(vcpu_e500);
229− ref->flags &= ~(E500_TLB_TLB0 | E500_TLB_VALID);
229+ tlbe->flags &= ~(E500_TLB_TLB0 | E500_TLB_VALID);
230230 }
231231
232232 /*
233233 * If TLB entry is still valid then it's a TLB0 entry, and thus
234234 * backed by at most one host tlbe per shadow pid
235235 */
236− if (ref->flags & E500_TLB_VALID)
236+ if (tlbe->flags & E500_TLB_VALID)
237237 kvmppc_e500_tlbil_one(vcpu_e500, gtlbe);
238238
239239 /* Mark the TLB as not backed by the host anymore */
240− ref->flags = 0;
240+ tlbe->flags = 0;
241241 }
242242
243243 static inline int tlbe_is_writable(struct kvm_book3e_206_tlb_entry *tlbe)
@@ -245,26 +245,26 @@ static inline int tlbe_is_writable(struct kvm_book3e_206_tlb_entry *tlbe) · 1 unmodified line
245245 return tlbe->mas7_3 & (MAS3_SW|MAS3_UW);
246246 }
247247
248−static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref,
249− struct kvm_book3e_206_tlb_entry *gtlbe,
250− kvm_pfn_t pfn, unsigned int wimg,
251− bool writable)
248+static inline void kvmppc_e500_tlbe_setup(struct tlbe_priv *tlbe,
249+ struct kvm_book3e_206_tlb_entry *gtlbe,
250+ kvm_pfn_t pfn, unsigned int wimg,
251+ bool writable)
252252 {
253− ref->pfn = pfn;
254− ref->flags = E500_TLB_VALID;
253+ tlbe->pfn = pfn;
254+ tlbe->flags = E500_TLB_VALID;
255255 if (writable)
256− ref->flags |= E500_TLB_WRITABLE;
256+ tlbe->flags |= E500_TLB_WRITABLE;
257257
258258 /* Use guest supplied MAS2_G and MAS2_E */
259− ref->flags |= (gtlbe->mas2 & MAS2_ATTRIB_MASK) | wimg;
259+ tlbe->flags |= (gtlbe->mas2 & MAS2_ATTRIB_MASK) | wimg;
260260 }
261261
262−static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
262+static inline void kvmppc_e500_tlbe_release(struct tlbe_priv *tlbe)
263263 {
264− if (ref->flags & E500_TLB_VALID) {
264+ if (tlbe->flags & E500_TLB_VALID) {
265265 /* FIXME: don't log bogus pfn for TLB1 */
266− trace_kvm_booke206_ref_release(ref->pfn, ref->flags);
267− ref->flags = 0;
266+ trace_kvm_booke206_ref_release(tlbe->pfn, tlbe->flags);
267+ tlbe->flags = 0;
268268 }
269269 }
270270
@@ -284,11 +284,8 @@ static void clear_tlb_privs(struct kvmppc_vcpu_e500 *vcpu_e500) · 13 unmodified lines
284284 int i;
285285
286286 for (tlbsel = 0; tlbsel <= 1; tlbsel++) {
287− for (i = 0; i < vcpu_e500->gtlb_params[tlbsel].entries; i++) {
288− struct tlbe_ref *ref =
289− &vcpu_e500->gtlb_priv[tlbsel][i].ref;
290− kvmppc_e500_ref_release(ref);
291− }
287+ for (i = 0; i < vcpu_e500->gtlb_params[tlbsel].entries; i++)
288+ kvmppc_e500_tlbe_release(&vcpu_e500->gtlb_priv[tlbsel][i]);
292289 }
293290 }
294291
@@ -304,18 +301,18 @@ void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu) · 9 unmodified lines
304301 static void kvmppc_e500_setup_stlbe(
305302 struct kvm_vcpu *vcpu,
306303 struct kvm_book3e_206_tlb_entry *gtlbe,
307− int tsize, struct tlbe_ref *ref, u64 gvaddr,
304+ int tsize, struct tlbe_priv *tlbe, u64 gvaddr,
308305 struct kvm_book3e_206_tlb_entry *stlbe)
309306 {
310− kvm_pfn_t pfn = ref->pfn;
307+ kvm_pfn_t pfn = tlbe->pfn;
311308 u32 pr = vcpu->arch.shared->msr & MSR_PR;
312− bool writable = !!(ref->flags & E500_TLB_WRITABLE);
309+ bool writable = !!(tlbe->flags & E500_TLB_WRITABLE);
313310
314− BUG_ON(!(ref->flags & E500_TLB_VALID));
311+ BUG_ON(!(tlbe->flags & E500_TLB_VALID));
315312
316313 /* Force IPROT=0 for all guest mappings. */
317314 stlbe->mas1 = MAS1_TSIZE(tsize) | get_tlb_sts(gtlbe) | MAS1_VALID;
318− stlbe->mas2 = (gvaddr & MAS2_EPN) | (ref->flags & E500_TLB_MAS2_ATTR);
315+ stlbe->mas2 = (gvaddr & MAS2_EPN) | (tlbe->flags & E500_TLB_MAS2_ATTR);
319316 stlbe->mas7_3 = ((u64)pfn << PAGE_SHIFT) |
320317 e500_shadow_mas3_attrib(gtlbe->mas7_3, writable, pr);
321318 }
@@ -323,7 +320,7 @@ static void kvmppc_e500_setup_stlbe( · 1 unmodified line
323320 static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
324321 u64 gvaddr, gfn_t gfn, struct kvm_book3e_206_tlb_entry *gtlbe,
325322 int tlbsel, struct kvm_book3e_206_tlb_entry *stlbe,
326− struct tlbe_ref *ref)
323+ struct tlbe_priv *tlbe)
327324 {
328325 struct kvm_memory_slot *slot;
329326 unsigned int psize;
@@ -455,9 +452,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 125 unmodified lines
455452 }
456453 }
457454
458− kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg, writable);
455+ kvmppc_e500_tlbe_setup(tlbe, gtlbe, pfn, wimg, writable);
459456 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
460− ref, gvaddr, stlbe);
457+ tlbe, gvaddr, stlbe);
461458 writable = tlbe_is_writable(stlbe);
462459
463460 /* Clear i-cache for new pages */
@@ -474,17 +471,17 @@ static int kvmppc_e500_tlb0_map(struct kvmppc_vcpu_e500 *vcpu_e500, int esel, · 10 unmodified lines
474471 struct kvm_book3e_206_tlb_entry *stlbe)
475472 {
476473 struct kvm_book3e_206_tlb_entry *gtlbe;
477− struct tlbe_ref *ref;
474+ struct tlbe_priv *tlbe;
478475 int stlbsel = 0;
479476 int sesel = 0;
480477 int r;
481478
482479 gtlbe = get_entry(vcpu_e500, 0, esel);
483− ref = &vcpu_e500->gtlb_priv[0][esel].ref;
480+ tlbe = &vcpu_e500->gtlb_priv[0][esel];
484481
485482 r = kvmppc_e500_shadow_map(vcpu_e500, get_tlb_eaddr(gtlbe),
486483 get_tlb_raddr(gtlbe) >> PAGE_SHIFT,
487− gtlbe, 0, stlbe, ref);
484+ gtlbe, 0, stlbe, tlbe);
488485 if (r)
489486 return r;
490487
@@ -494,7 +491,7 @@ static int kvmppc_e500_tlb0_map(struct kvmppc_vcpu_e500 *vcpu_e500, int esel, · 3 unmodified lines
494491 }
495492
496493 static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500,
497− struct tlbe_ref *ref,
494+ struct tlbe_priv *tlbe,
498495 int esel)
499496 {
500497 unsigned int sesel = vcpu_e500->host_tlb1_nv++;
@@ -507,10 +504,10 @@ static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500, · 6 unmodified lines
507504 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
508505 }
509506
510− vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
507+ vcpu_e500->gtlb_priv[1][esel].flags |= E500_TLB_BITMAP;
511508 vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
512509 vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
513− WARN_ON(!(ref->flags & E500_TLB_VALID));
510+ WARN_ON(!(tlbe->flags & E500_TLB_VALID));
514511
515512 return sesel;
516513 }
@@ -522,24 +519,24 @@ static int kvmppc_e500_tlb1_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 5 unmodified lines
522519 u64 gvaddr, gfn_t gfn, struct kvm_book3e_206_tlb_entry *gtlbe,
523520 struct kvm_book3e_206_tlb_entry *stlbe, int esel)
524521 {
525− struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[1][esel].ref;
522+ struct tlbe_priv *tlbe = &vcpu_e500->gtlb_priv[1][esel];
526523 int sesel;
527524 int r;
528525
529526 r = kvmppc_e500_shadow_map(vcpu_e500, gvaddr, gfn, gtlbe, 1, stlbe,
530− ref);
527+ tlbe);
531528 if (r)
532529 return r;
533530
534531 /* Use TLB0 when we can only map a page with 4k */
535532 if (get_tlb_tsize(stlbe) == BOOK3E_PAGESZ_4K) {
536− vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_TLB0;
533+ vcpu_e500->gtlb_priv[1][esel].flags |= E500_TLB_TLB0;
537534 write_stlbe(vcpu_e500, gtlbe, stlbe, 0, 0);
538535 return 0;
539536 }
540537
541538 /* Otherwise map into TLB1 */
542− sesel = kvmppc_e500_tlb1_map_tlb1(vcpu_e500, ref, esel);
539+ sesel = kvmppc_e500_tlb1_map_tlb1(vcpu_e500, tlbe, esel);
543540 write_stlbe(vcpu_e500, gtlbe, stlbe, 1, sesel);
544541
545542 return 0;
@@ -561,11 +558,11 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr, · 15 unmodified lines
561558 priv = &vcpu_e500->gtlb_priv[tlbsel][esel];
562559
563560 /* Triggers after clear_tlb_privs or on initial mapping */
564− if (!(priv->ref.flags & E500_TLB_VALID)) {
561+ if (!(priv->flags & E500_TLB_VALID)) {
565562 kvmppc_e500_tlb0_map(vcpu_e500, esel, &stlbe);
566563 } else {
567564 kvmppc_e500_setup_stlbe(vcpu, gtlbe, BOOK3E_PAGESZ_4K,
568− &priv->ref, eaddr, &stlbe);
565+ priv, eaddr, &stlbe);
569566 write_stlbe(vcpu_e500, gtlbe, &stlbe, 0, 0);
570567 }
571568 break;
arch/powerpc/kvm/powerpc.c+0−6
@@ -623,12 +623,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 622 unmodified lines
623623 r = !!(hv_enabled && kvmppc_hv_ops->enable_nested &&
624624 !kvmppc_hv_ops->enable_nested(NULL));
625625 break;
626−#endif
627− case KVM_CAP_SYNC_MMU:
628− BUILD_BUG_ON(!IS_ENABLED(CONFIG_KVM_GENERIC_MMU_NOTIFIER));
629− r = 1;
630− break;
631−#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
632626 case KVM_CAP_PPC_HTAB_FD:
633627 r = hv_enabled;
634628 break;
arch/powerpc/lib/copyuser_64.S+1−0
@@ -562,3 +562,4 @@ exc; std r10,32(3) · 561 unmodified lines
562562 li r5,4096
563563 b .Ldst_aligned
564564 EXPORT_SYMBOL(__copy_tofrom_user)
565+EXPORT_SYMBOL(__copy_tofrom_user_base)
arch/powerpc/lib/copyuser_power7.S+15−30
@@ -5,13 +5,9 @@ · 4 unmodified lines
55 *
66 * Author: Anton Blanchard <anton@au.ibm.com>
77 */
8+#include <linux/export.h>
89 #include <asm/ppc_asm.h>
910
10−#ifndef SELFTEST_CASE
11−/* 0 == don't use VMX, 1 == use VMX */
12−#define SELFTEST_CASE 0
13−#endif
14−
1511 #ifdef __BIG_ENDIAN__
1612 #define LVS(VRT,RA,RB) lvsl VRT,RA,RB
1713 #define VPERM(VRT,VRA,VRB,VRC) vperm VRT,VRA,VRB,VRC
@@ -47,10 +43,14 @@ · 29 unmodified lines
4743 ld r15,STK_REG(R15)(r1)
4844 ld r14,STK_REG(R14)(r1)
4945 .Ldo_err3:
50− bl CFUNC(exit_vmx_usercopy)
46+ ld r6,STK_REG(R31)(r1) /* original destination pointer */
47+ ld r5,STK_REG(R29)(r1) /* original number of bytes */
48+ subf r7,r6,r3 /* #bytes copied */
49+ subf r3,r7,r5 /* #bytes not copied in r3 */
5150 ld r0,STACKFRAMESIZE+16(r1)
5251 mtlr r0
53− b .Lexit
52+ addi r1,r1,STACKFRAMESIZE
53+ blr
5454 #endif /* CONFIG_ALTIVEC */
5555
5656 .Ldo_err2:
@@ -74,7 +74,6 @@ · 17 unmodified lines
7474
7575 _GLOBAL(__copy_tofrom_user_power7)
7676 cmpldi r5,16
77− cmpldi cr1,r5,3328
7877
7978 std r3,-STACKFRAMESIZE+STK_REG(R31)(r1)
8079 std r4,-STACKFRAMESIZE+STK_REG(R30)(r1)
@@ -82,12 +81,6 @@ _GLOBAL(__copy_tofrom_user_power7) · 1 unmodified line
8281
8382 blt .Lshort_copy
8483
85−#ifdef CONFIG_ALTIVEC
86−test_feature = SELFTEST_CASE
87−BEGIN_FTR_SECTION
88− bgt cr1,.Lvmx_copy
89−END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
90−#endif
9184
9285 .Lnonvmx_copy:
9386 /* Get the source 8B aligned */
@@ -263,23 +256,14 @@ err1; stb r0,0(r3) · 169 unmodified lines
263256 15: li r3,0
264257 blr
265258
266−.Lunwind_stack_nonvmx_copy:
267− addi r1,r1,STACKFRAMESIZE
268− b .Lnonvmx_copy
269−
270−.Lvmx_copy:
271259 #ifdef CONFIG_ALTIVEC
260+_GLOBAL(__copy_tofrom_user_power7_vmx)
272261 mflr r0
273262 std r0,16(r1)
274263 stdu r1,-STACKFRAMESIZE(r1)
275− bl CFUNC(enter_vmx_usercopy)
276− cmpwi cr1,r3,0
277− ld r0,STACKFRAMESIZE+16(r1)
278− ld r3,STK_REG(R31)(r1)
279− ld r4,STK_REG(R30)(r1)
280− ld r5,STK_REG(R29)(r1)
281− mtlr r0
282264
265+ std r3,STK_REG(R31)(r1)
266+ std r5,STK_REG(R29)(r1)
283267 /*
284268 * We prefetch both the source and destination using enhanced touch
285269 * instructions. We use a stream ID of 0 for the load side and
@@ -300,8 +284,6 @@ err1; stb r0,0(r3) · 14 unmodified lines
300284
301285 DCBT_SETUP_STREAMS(r6, r7, r9, r10, r8)
302286
303− beq cr1,.Lunwind_stack_nonvmx_copy
304−
305287 /*
306288 * If source and destination are not relatively aligned we use a
307289 * slower permute loop.
@@ -478,7 +460,8 @@ err3; lbz r0,0(r4) · 170 unmodified lines
478460 err3; stb r0,0(r3)
479461
480462 15: addi r1,r1,STACKFRAMESIZE
481− b CFUNC(exit_vmx_usercopy) /* tail call optimise */
463+ li r3,0
464+ blr
482465
483466 .Lvmx_unaligned_copy:
484467 /* Get the destination 16B aligned */
@@ -681,5 +664,7 @@ err3; lbz r0,0(r4) · 196 unmodified lines
681664 err3; stb r0,0(r3)
682665
683666 15: addi r1,r1,STACKFRAMESIZE
684− b CFUNC(exit_vmx_usercopy) /* tail call optimise */
667+ li r3,0
668+ blr
669+EXPORT_SYMBOL(__copy_tofrom_user_power7_vmx)
685670 #endif /* CONFIG_ALTIVEC */
arch/powerpc/lib/vmx-helper.c+2−0
@@ -27,6 +27,7 @@ int enter_vmx_usercopy(void) · 26 unmodified lines
2727
2828 return 1;
2929 }
30+EXPORT_SYMBOL(enter_vmx_usercopy);
3031
3132 /*
3233 * This function must return 0 because we tail call optimise when calling
@@ -49,6 +50,7 @@ int exit_vmx_usercopy(void) · 16 unmodified lines
4950 set_dec(1);
5051 return 0;
5152 }
53+EXPORT_SYMBOL(exit_vmx_usercopy);
5254
5355 int enter_vmx_ops(void)
5456 {
arch/powerpc/mm/mem.c+14−0
@@ -30,6 +30,10 @@ · 29 unmodified lines
3030 #include <asm/setup.h>
3131 #include <asm/fixmap.h>
3232
33+#include <asm/fadump.h>
34+#include <asm/kexec.h>
35+#include <asm/kvm_ppc.h>
36+
3337 #include <mm/mmu_decl.h>
3438
3539 unsigned long long memory_limit __initdata;
@@ -268,6 +272,16 @@ void __init paging_init(void) · 232 unmodified lines
268272
269273 void __init arch_mm_preinit(void)
270274 {
275+
276+ /*
277+ * Reserve large chunks of memory for use by CMA for kdump, fadump, KVM
278+ * and hugetlb. These must be called after pageblock_order is
279+ * initialised.
280+ */
281+ fadump_cma_init();
282+ kdump_cma_reserve();
283+ kvm_cma_reserve();
284+
271285 /*
272286 * book3s is limited to 16 page sizes due to encoding this in
273287 * a 4-bit field for slices.
arch/powerpc/net/bpf_jit.h+0−5
@@ -81,9 +81,6 @@ · 80 unmodified lines
8181
8282 #ifdef CONFIG_PPC64
8383
84−/* for gpr non volatile registers BPG_REG_6 to 10 */
85−#define BPF_PPC_STACK_SAVE (6 * 8)
86−
8784 /* If dummy pass (!image), account for maximum possible instructions */
8885 #define PPC_LI64(d, i) do { \
8986 if (!image) \
@@ -219,8 +216,6 @@ int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg, · 129 unmodified lines
219216 int bpf_add_extable_entry(struct bpf_prog *fp, u32 *image, u32 *fimage, int pass,
220217 struct codegen_context *ctx, int insn_idx,
221218 int jmp_off, int dst_reg, u32 code);
222−
223−int bpf_jit_stack_tailcallinfo_offset(struct codegen_context *ctx);
224219 #endif
225220
226221 #endif
arch/powerpc/net/bpf_jit_comp.c+56−71
@@ -450,7 +450,7 @@ bool bpf_jit_supports_subprog_tailcalls(void) · 449 unmodified lines
450450
451451 bool bpf_jit_supports_kfunc_call(void)
452452 {
453− return true;
453+ return IS_ENABLED(CONFIG_PPC64);
454454 }
455455
456456 bool bpf_jit_supports_arena(void)
@@ -638,19 +638,12 @@ static int invoke_bpf_mod_ret(u32 *image, u32 *ro_image, struct codegen_context · 181 unmodified lines
638638 * for the traced function (BPF subprog/callee) to fetch it.
639639 */
640640 static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_context *ctx,
641− int func_frame_offset,
642− int bpf_dummy_frame_size, int r4_off)
641+ int bpf_frame_size, int r4_off)
643642 {
644643 if (IS_ENABLED(CONFIG_PPC64)) {
645− /* See Generated stack layout */
646− int tailcallinfo_offset = BPF_PPC_TAILCALL;
647−
648− /*
649− * func_frame_offset = ...(1)
650− * bpf_dummy_frame_size + trampoline_frame_size
651− */
652− EMIT(PPC_RAW_LD(_R4, _R1, func_frame_offset));
653− EMIT(PPC_RAW_LD(_R3, _R4, -tailcallinfo_offset));
644+ EMIT(PPC_RAW_LD(_R4, _R1, bpf_frame_size));
645+ /* Refer to trampoline's Generated stack layout */
646+ EMIT(PPC_RAW_LD(_R3, _R4, -BPF_PPC_TAILCALL));
654647
655648 /*
656649 * Setting the tail_call_info in trampoline's frame
@@ -658,22 +651,14 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte · 1 unmodified line
658651 */
659652 EMIT(PPC_RAW_CMPLWI(_R3, MAX_TAIL_CALL_CNT));
660653 PPC_BCC_CONST_SHORT(COND_GT, 8);
661− EMIT(PPC_RAW_ADDI(_R3, _R4, bpf_jit_stack_tailcallinfo_offset(ctx)));
654+ EMIT(PPC_RAW_ADDI(_R3, _R4, -BPF_PPC_TAILCALL));
655+
662656 /*
663− * From ...(1) above:
664− * trampoline_frame_bottom = ...(2)
665− * func_frame_offset - bpf_dummy_frame_size
666− *
667− * Using ...(2) derived above:
668− * trampoline_tail_call_info_offset = ...(3)
669− * trampoline_frame_bottom - tailcallinfo_offset
670− *
671− * From ...(3):
672− * Use trampoline_tail_call_info_offset to write reference of main's
673− * tail_call_info in trampoline frame.
657+ * Trampoline's tail_call_info is at the same offset, as that of
658+ * any bpf program, with reference to previous frame. Update the
659+ * address of main's tail_call_info in trampoline frame.
674660 */
675− EMIT(PPC_RAW_STL(_R3, _R1, (func_frame_offset - bpf_dummy_frame_size)
676− - tailcallinfo_offset));
661+ EMIT(PPC_RAW_STL(_R3, _R1, bpf_frame_size - BPF_PPC_TAILCALL));
677662 } else {
678663 /* See bpf_jit_stack_offsetof() and BPF_PPC_TC */
679664 EMIT(PPC_RAW_LL(_R4, _R1, r4_off));
@@ -681,7 +666,7 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte · 1 unmodified line
681666 }
682667
683668 static void bpf_trampoline_restore_tail_call_cnt(u32 *image, struct codegen_context *ctx,
684− int func_frame_offset, int r4_off)
669+ int bpf_frame_size, int r4_off)
685670 {
686671 if (IS_ENABLED(CONFIG_PPC32)) {
687672 /*
@@ -692,12 +677,12 @@ static void bpf_trampoline_restore_tail_call_cnt(u32 *image, struct codegen_cont · 4 unmodified lines
692677 }
693678 }
694679
695−static void bpf_trampoline_save_args(u32 *image, struct codegen_context *ctx, int func_frame_offset,
696− int nr_regs, int regs_off)
680+static void bpf_trampoline_save_args(u32 *image, struct codegen_context *ctx,
681+ int bpf_frame_size, int nr_regs, int regs_off)
697682 {
698683 int param_save_area_offset;
699684
700− param_save_area_offset = func_frame_offset; /* the two frames we alloted */
685+ param_save_area_offset = bpf_frame_size;
701686 param_save_area_offset += STACK_FRAME_MIN_SIZE; /* param save area is past frame header */
702687
703688 for (int i = 0; i < nr_regs; i++) {
@@ -720,11 +705,11 @@ static void bpf_trampoline_restore_args_regs(u32 *image, struct codegen_context · 16 unmodified lines
720705
721706 /* Used when we call into the traced function. Replicate parameter save area */
722707 static void bpf_trampoline_restore_args_stack(u32 *image, struct codegen_context *ctx,
723− int func_frame_offset, int nr_regs, int regs_off)
708+ int bpf_frame_size, int nr_regs, int regs_off)
724709 {
725710 int param_save_area_offset;
726711
727− param_save_area_offset = func_frame_offset; /* the two frames we alloted */
712+ param_save_area_offset = bpf_frame_size;
728713 param_save_area_offset += STACK_FRAME_MIN_SIZE; /* param save area is past frame header */
729714
730715 for (int i = 8; i < nr_regs; i++) {
@@ -741,10 +726,10 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 10 unmodified lines
741726 void *func_addr)
742727 {
743728 int regs_off, nregs_off, ip_off, run_ctx_off, retval_off, nvr_off, alt_lr_off, r4_off = 0;
744− int i, ret, nr_regs, bpf_frame_size = 0, bpf_dummy_frame_size = 0, func_frame_offset;
745729 struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
746730 struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
747731 struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
732+ int i, ret, nr_regs, retaddr_off, bpf_frame_size = 0;
748733 struct codegen_context codegen_ctx, *ctx;
749734 u32 *image = (u32 *)rw_image;
750735 ppc_inst_t branch_insn;
@@ -770,24 +755,19 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 19 unmodified lines
770755 * Generated stack layout:
771756 *
772757 * func prev back chain [ back chain ]
773− * [ ]
774− * bpf prog redzone/tailcallcnt [ ... ] 64 bytes (64-bit powerpc)
775− * [ ] --
776− * LR save area [ r0 save (64-bit) ] | header
777− * [ r0 save (32-bit) ] |
778− * dummy frame for unwind [ back chain 1 ] --
779758 * [ tail_call_info ] optional - 64-bit powerpc
780759 * [ padding ] align stack frame
781760 * r4_off [ r4 (tailcallcnt) ] optional - 32-bit powerpc
782761 * alt_lr_off [ real lr (ool stub)] optional - actual lr
762+ * retaddr_off [ return address ]
783763 * [ r26 ]
784764 * nvr_off [ r25 ] nvr save area
785765 * retval_off [ return value ]
786766 * [ reg argN ]
787767 * [ ... ]
788− * regs_off [ reg_arg1 ] prog ctx context
789− * nregs_off [ args count ]
790− * ip_off [ traced function ]
768+ * regs_off [ reg_arg1 ] prog_ctx
769+ * nregs_off [ args count ] ((u64 *)prog_ctx)[-1]
770+ * ip_off [ traced function ] ((u64 *)prog_ctx)[-2]
791771 * [ ... ]
792772 * run_ctx_off [ bpf_tramp_run_ctx ]
793773 * [ reg argN ]
@@ -843,6 +823,10 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 49 unmodified lines
843823 nvr_off = bpf_frame_size;
844824 bpf_frame_size += 2 * SZL;
845825
826+ /* Save area for return address */
827+ retaddr_off = bpf_frame_size;
828+ bpf_frame_size += SZL;
829+
846830 /* Optional save area for actual LR in case of ool ftrace */
847831 if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE)) {
848832 alt_lr_off = bpf_frame_size;
@@ -869,16 +853,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 20 unmodified lines
869853 /* Padding to align stack frame, if any */
870854 bpf_frame_size = round_up(bpf_frame_size, SZL * 2);
871855
872− /* Dummy frame size for proper unwind - includes 64-bytes red zone for 64-bit powerpc */
873− bpf_dummy_frame_size = STACK_FRAME_MIN_SIZE + 64;
874−
875− /* Offset to the traced function's stack frame */
876− func_frame_offset = bpf_dummy_frame_size + bpf_frame_size;
877−
878− /* Create dummy frame for unwind, store original return value */
856+ /* Store original return value */
879857 EMIT(PPC_RAW_STL(_R0, _R1, PPC_LR_STKOFF));
880− /* Protect red zone where tail call count goes */
881− EMIT(PPC_RAW_STLU(_R1, _R1, -bpf_dummy_frame_size));
882858
883859 /* Create our stack frame */
884860 EMIT(PPC_RAW_STLU(_R1, _R1, -bpf_frame_size));
@@ -893,34 +869,44 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 8 unmodified lines
893869 if (IS_ENABLED(CONFIG_PPC32) && nr_regs < 2)
894870 EMIT(PPC_RAW_STL(_R4, _R1, r4_off));
895871
896− bpf_trampoline_save_args(image, ctx, func_frame_offset, nr_regs, regs_off);
872+ bpf_trampoline_save_args(image, ctx, bpf_frame_size, nr_regs, regs_off);
897873
898− /* Save our return address */
874+ /* Save our LR/return address */
899875 EMIT(PPC_RAW_MFLR(_R3));
900876 if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE))
901877 EMIT(PPC_RAW_STL(_R3, _R1, alt_lr_off));
902878 else
903− EMIT(PPC_RAW_STL(_R3, _R1, bpf_frame_size + PPC_LR_STKOFF));
879+ EMIT(PPC_RAW_STL(_R3, _R1, retaddr_off));
904880
905881 /*
906− * Save ip address of the traced function.
907− * We could recover this from LR, but we will need to address for OOL trampoline,
908− * and optional GEP area.
882+ * Derive IP address of the traced function.
883+ * In case of CONFIG_PPC_FTRACE_OUT_OF_LINE or BPF program, LR points to the instruction
884+ * after the 'bl' instruction in the OOL stub. Refer to ftrace_init_ool_stub() and
885+ * bpf_arch_text_poke() for OOL stub of kernel functions and bpf programs respectively.
886+ * Relevant stub sequence:
887+ *
888+ * bl <tramp>
889+ * LR (R3) => mtlr r0
890+ * b <func_addr+4>
891+ *
892+ * Recover kernel function/bpf program address from the unconditional
893+ * branch instruction at the end of OOL stub.
909894 */
910895 if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE) || flags & BPF_TRAMP_F_IP_ARG) {
911896 EMIT(PPC_RAW_LWZ(_R4, _R3, 4));
912897 EMIT(PPC_RAW_SLWI(_R4, _R4, 6));
913898 EMIT(PPC_RAW_SRAWI(_R4, _R4, 6));
914899 EMIT(PPC_RAW_ADD(_R3, _R3, _R4));
915− EMIT(PPC_RAW_ADDI(_R3, _R3, 4));
916900 }
917901
918902 if (flags & BPF_TRAMP_F_IP_ARG)
919903 EMIT(PPC_RAW_STL(_R3, _R1, ip_off));
920904
921− if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE))
922− /* Fake our LR for unwind */
923− EMIT(PPC_RAW_STL(_R3, _R1, bpf_frame_size + PPC_LR_STKOFF));
905+ if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE)) {
906+ /* Fake our LR for BPF_TRAMP_F_CALL_ORIG case */
907+ EMIT(PPC_RAW_ADDI(_R3, _R3, 4));
908+ EMIT(PPC_RAW_STL(_R3, _R1, retaddr_off));
909+ }
924910
925911 /* Save function arg count -- see bpf_get_func_arg_cnt() */
926912 EMIT(PPC_RAW_LI(_R3, nr_regs));
@@ -958,20 +944,19 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 31 unmodified lines
958944 /* Call the traced function */
959945 if (flags & BPF_TRAMP_F_CALL_ORIG) {
960946 /*
961− * The address in LR save area points to the correct point in the original function
947+ * retaddr on trampoline stack points to the correct point in the original function
962948 * with both PPC_FTRACE_OUT_OF_LINE as well as with traditional ftrace instruction
963949 * sequence
964950 */
965− EMIT(PPC_RAW_LL(_R3, _R1, bpf_frame_size + PPC_LR_STKOFF));
951+ EMIT(PPC_RAW_LL(_R3, _R1, retaddr_off));
966952 EMIT(PPC_RAW_MTCTR(_R3));
967953
968954 /* Replicate tail_call_cnt before calling the original BPF prog */
969955 if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
970− bpf_trampoline_setup_tail_call_info(image, ctx, func_frame_offset,
971− bpf_dummy_frame_size, r4_off);
956+ bpf_trampoline_setup_tail_call_info(image, ctx, bpf_frame_size, r4_off);
972957
973958 /* Restore args */
974− bpf_trampoline_restore_args_stack(image, ctx, func_frame_offset, nr_regs, regs_off);
959+ bpf_trampoline_restore_args_stack(image, ctx, bpf_frame_size, nr_regs, regs_off);
975960
976961 /* Restore TOC for 64-bit */
977962 if (IS_ENABLED(CONFIG_PPC64_ELF_ABI_V2) && !IS_ENABLED(CONFIG_PPC_KERNEL_PCREL))
@@ -985,7 +970,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 7 unmodified lines
985970
986971 /* Restore updated tail_call_cnt */
987972 if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
988− bpf_trampoline_restore_tail_call_cnt(image, ctx, func_frame_offset, r4_off);
973+ bpf_trampoline_restore_tail_call_cnt(image, ctx, bpf_frame_size, r4_off);
989974
990975 /* Reserve space to patch branch instruction to skip fexit progs */
991976 if (ro_image) /* image is NULL for dummy pass */
@@ -1037,7 +1022,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 45 unmodified lines
10371022 EMIT(PPC_RAW_LD(_R2, _R1, 24));
10381023 if (flags & BPF_TRAMP_F_SKIP_FRAME) {
10391024 /* Skip the traced function and return to parent */
1040− EMIT(PPC_RAW_ADDI(_R1, _R1, func_frame_offset));
1025+ EMIT(PPC_RAW_ADDI(_R1, _R1, bpf_frame_size));
10411026 EMIT(PPC_RAW_LL(_R0, _R1, PPC_LR_STKOFF));
10421027 EMIT(PPC_RAW_MTLR(_R0));
10431028 EMIT(PPC_RAW_BLR());
@@ -1045,13 +1030,13 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im · 1 unmodified line
10451030 if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE)) {
10461031 EMIT(PPC_RAW_LL(_R0, _R1, alt_lr_off));
10471032 EMIT(PPC_RAW_MTLR(_R0));
1048− EMIT(PPC_RAW_ADDI(_R1, _R1, func_frame_offset));
1033+ EMIT(PPC_RAW_ADDI(_R1, _R1, bpf_frame_size));
10491034 EMIT(PPC_RAW_LL(_R0, _R1, PPC_LR_STKOFF));
10501035 EMIT(PPC_RAW_BLR());
10511036 } else {
1052− EMIT(PPC_RAW_LL(_R0, _R1, bpf_frame_size + PPC_LR_STKOFF));
1037+ EMIT(PPC_RAW_LL(_R0, _R1, retaddr_off));
10531038 EMIT(PPC_RAW_MTCTR(_R0));
1054− EMIT(PPC_RAW_ADDI(_R1, _R1, func_frame_offset));
1039+ EMIT(PPC_RAW_ADDI(_R1, _R1, bpf_frame_size));
10551040 EMIT(PPC_RAW_LL(_R0, _R1, PPC_LR_STKOFF));
10561041 EMIT(PPC_RAW_MTLR(_R0));
10571042 EMIT(PPC_RAW_BCTR());
arch/powerpc/net/bpf_jit_comp64.c+143−38
@@ -32,23 +32,27 @@ · 31 unmodified lines
3232 *
3333 * [ prev sp ] <-------------
3434 * [ tail_call_info ] 8 |
35− * [ nv gpr save area ] 6*8 + (12*8) |
35+ * [ nv gpr save area ] (6 * 8) |
36+ * [ addl. nv gpr save area] (12 * 8) | <--- exception boundary/callback program
3637 * [ local_tmp_var ] 24 |
3738 * fp (r31) --> [ ebpf stack space ] upto 512 |
3839 * [ frame header ] 32/112 |
3940 * sp (r1) ---> [ stack pointer ] --------------
4041 *
41− * Additional (12*8) in 'nv gpr save area' only in case of
42− * exception boundary.
42+ * Additional (12 * 8) in 'nv gpr save area' only in case of
43+ * exception boundary/callback.
4344 */
4445
46+/* BPF non-volatile registers save area size */
47+#define BPF_PPC_STACK_SAVE (6 * 8)
48+
4549 /* for bpf JIT code internal usage */
4650 #define BPF_PPC_STACK_LOCALS 24
4751 /*
4852 * for additional non volatile registers(r14-r25) to be saved
4953 * at exception boundary
5054 */
51−#define BPF_PPC_EXC_STACK_SAVE (12*8)
55+#define BPF_PPC_EXC_STACK_SAVE (12 * 8)
5256
5357 /* stack frame excluding BPF stack, ensure this is quadword aligned */
5458 #define BPF_PPC_STACKFRAME (STACK_FRAME_MIN_SIZE + \
@@ -125,12 +129,13 @@ static inline bool bpf_has_stack_frame(struct codegen_context *ctx) · 70 unmodified lines
125129 * [ ... ] |
126130 * sp (r1) ---> [ stack pointer ] --------------
127131 * [ tail_call_info ] 8
128− * [ nv gpr save area ] 6*8 + (12*8)
132+ * [ nv gpr save area ] (6 * 8)
133+ * [ addl. nv gpr save area] (12 * 8) <--- exception boundary/callback program
129134 * [ local_tmp_var ] 24
130135 * [ unused red zone ] 224
131136 *
132− * Additional (12*8) in 'nv gpr save area' only in case of
133− * exception boundary.
137+ * Additional (12 * 8) in 'nv gpr save area' only in case of
138+ * exception boundary/callback.
134139 */
135140 static int bpf_jit_stack_local(struct codegen_context *ctx)
136141 {
@@ -148,7 +153,7 @@ static int bpf_jit_stack_local(struct codegen_context *ctx) · 11 unmodified lines
148153 }
149154 }
150155
151−int bpf_jit_stack_tailcallinfo_offset(struct codegen_context *ctx)
156+static int bpf_jit_stack_tailcallinfo_offset(struct codegen_context *ctx)
152157 {
153158 return bpf_jit_stack_local(ctx) + BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE;
154159 }
@@ -237,10 +242,6 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx) · 82 unmodified lines
237242
238243 if (bpf_has_stack_frame(ctx) && !ctx->exception_cb) {
239244 /*
240− * exception_cb uses boundary frame after stack walk.
241− * It can simply use redzone, this optimization reduces
242− * stack walk loop by one level.
243− *
244245 * We need a stack frame, but we don't necessarily need to
245246 * save/restore LR unless we call other functions
246247 */
@@ -284,6 +285,22 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx) · 37 unmodified lines
284285 * program(main prog) as third arg
285286 */
286287 EMIT(PPC_RAW_MR(_R1, _R5));
288+ /*
289+ * Exception callback reuses the stack frame of exception boundary.
290+ * But BPF stack depth of exception callback and exception boundary
291+ * don't have to be same. If BPF stack depth is different, adjust the
292+ * stack frame size considering BPF stack depth of exception callback.
293+ * The non-volatile register save area remains unchanged. These non-
294+ * volatile registers are restored in exception callback's epilogue.
295+ */
296+ EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), _R5, 0));
297+ EMIT(PPC_RAW_SUB(bpf_to_ppc(TMP_REG_2), bpf_to_ppc(TMP_REG_1), _R1));
298+ EMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_2), bpf_to_ppc(TMP_REG_2),
299+ -BPF_PPC_EXC_STACKFRAME));
300+ EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_2), ctx->stack_size));
301+ PPC_BCC_CONST_SHORT(COND_EQ, 12);
302+ EMIT(PPC_RAW_MR(_R1, bpf_to_ppc(TMP_REG_1)));
303+ EMIT(PPC_RAW_STDU(_R1, _R1, -(BPF_PPC_EXC_STACKFRAME + ctx->stack_size)));
287304 }
288305
289306 /*
@@ -482,6 +499,83 @@ int bpf_jit_emit_func_call_rel(u32 *image, u32 *fimage, struct codegen_context * · 192 unmodified lines
482499 return 0;
483500 }
484501
502+static int zero_extend(u32 *image, struct codegen_context *ctx, u32 src_reg, u32 dst_reg, u32 size)
503+{
504+ switch (size) {
505+ case 1:
506+ /* zero-extend 8 bits into 64 bits */
507+ EMIT(PPC_RAW_RLDICL(dst_reg, src_reg, 0, 56));
508+ return 0;
509+ case 2:
510+ /* zero-extend 16 bits into 64 bits */
511+ EMIT(PPC_RAW_RLDICL(dst_reg, src_reg, 0, 48));
512+ return 0;
513+ case 4:
514+ /* zero-extend 32 bits into 64 bits */
515+ EMIT(PPC_RAW_RLDICL(dst_reg, src_reg, 0, 32));
516+ fallthrough;
517+ case 8:
518+ /* Nothing to do */
519+ return 0;
520+ default:
521+ return -1;
522+ }
523+}
524+
525+static int sign_extend(u32 *image, struct codegen_context *ctx, u32 src_reg, u32 dst_reg, u32 size)
526+{
527+ switch (size) {
528+ case 1:
529+ /* sign-extend 8 bits into 64 bits */
530+ EMIT(PPC_RAW_EXTSB(dst_reg, src_reg));
531+ return 0;
532+ case 2:
533+ /* sign-extend 16 bits into 64 bits */
534+ EMIT(PPC_RAW_EXTSH(dst_reg, src_reg));
535+ return 0;
536+ case 4:
537+ /* sign-extend 32 bits into 64 bits */
538+ EMIT(PPC_RAW_EXTSW(dst_reg, src_reg));
539+ fallthrough;
540+ case 8:
541+ /* Nothing to do */
542+ return 0;
543+ default:
544+ return -1;
545+ }
546+}
547+
548+/*
549+ * Handle powerpc ABI expectations from caller:
550+ * - Unsigned arguments are zero-extended.
551+ * - Signed arguments are sign-extended.
552+ */
553+static int prepare_for_kfunc_call(const struct bpf_prog *fp, u32 *image,
554+ struct codegen_context *ctx,
555+ const struct bpf_insn *insn)
556+{
557+ const struct btf_func_model *m = bpf_jit_find_kfunc_model(fp, insn);
558+ int i;
559+
560+ if (!m)
561+ return -1;
562+
563+ for (i = 0; i < m->nr_args; i++) {
564+ /* Note that BPF ABI only allows up to 5 args for kfuncs */
565+ u32 reg = bpf_to_ppc(BPF_REG_1 + i), size = m->arg_size[i];
566+
567+ if (!(m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG)) {
568+ if (zero_extend(image, ctx, reg, reg, size))
569+ return -1;
570+ } else {
571+ if (sign_extend(image, ctx, reg, reg, size))
572+ return -1;
573+ }
574+ }
575+
576+ return 0;
577+}
578+
485579 static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 out)
486580 {
487581 /*
@@ -522,9 +616,30 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o · 34 unmodified lines
522616
523617 /*
524618 * tail_call_info++; <- Actual value of tcc here
619+ * Writeback this updated value only if tailcall succeeds.
525620 */
526621 EMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_1), 1));
527622
623+ /* prog = array->ptrs[index]; */
624+ EMIT(PPC_RAW_MULI(bpf_to_ppc(TMP_REG_2), b2p_index, 8));
625+ EMIT(PPC_RAW_ADD(bpf_to_ppc(TMP_REG_2), bpf_to_ppc(TMP_REG_2), b2p_bpf_array));
626+ EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), bpf_to_ppc(TMP_REG_2),
627+ offsetof(struct bpf_array, ptrs)));
628+
629+ /*
630+ * if (prog == NULL)
631+ * goto out;
632+ */
633+ EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_2), 0));
634+ PPC_BCC_SHORT(COND_EQ, out);
635+
636+ /* goto *(prog->bpf_func + prologue_size); */
637+ EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_2), bpf_to_ppc(TMP_REG_2),
638+ offsetof(struct bpf_prog, bpf_func)));
639+ EMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_2), bpf_to_ppc(TMP_REG_2),
640+ FUNCTION_DESCR_SIZE + bpf_tailcall_prologue_size));
641+ EMIT(PPC_RAW_MTCTR(bpf_to_ppc(TMP_REG_2)));
642+
528643 /*
529644 * Before writing updated tail_call_info, distinguish if current frame
530645 * is storing a reference to tail_call_info or actual tcc value in
@@ -539,24 +654,6 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o · 8 unmodified lines
539654 /* Writeback updated value to tail_call_info */
540655 EMIT(PPC_RAW_STD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_2), 0));
541656
542− /* prog = array->ptrs[index]; */
543− EMIT(PPC_RAW_MULI(bpf_to_ppc(TMP_REG_1), b2p_index, 8));
544− EMIT(PPC_RAW_ADD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_1), b2p_bpf_array));
545− EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_1), offsetof(struct bpf_array, ptrs)));
546−
547− /*
548− * if (prog == NULL)
549− * goto out;
550− */
551− EMIT(PPC_RAW_CMPLDI(bpf_to_ppc(TMP_REG_1), 0));
552− PPC_BCC_SHORT(COND_EQ, out);
553−
554− /* goto *(prog->bpf_func + prologue_size); */
555− EMIT(PPC_RAW_LD(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_1), offsetof(struct bpf_prog, bpf_func)));
556− EMIT(PPC_RAW_ADDI(bpf_to_ppc(TMP_REG_1), bpf_to_ppc(TMP_REG_1),
557− FUNCTION_DESCR_SIZE + bpf_tailcall_prologue_size));
558− EMIT(PPC_RAW_MTCTR(bpf_to_ppc(TMP_REG_1)));
559−
560657 /* tear down stack, restore NVRs, ... */
561658 bpf_jit_emit_common_epilogue(image, ctx);
562659
@@ -1123,14 +1220,16 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code · 560 unmodified lines
11231220 /* special mov32 for zext */
11241221 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 0, 31));
11251222 break;
1126− } else if (off == 8) {
1127− EMIT(PPC_RAW_EXTSB(dst_reg, src_reg));
1128− } else if (off == 16) {
1129− EMIT(PPC_RAW_EXTSH(dst_reg, src_reg));
1130− } else if (off == 32) {
1131− EMIT(PPC_RAW_EXTSW(dst_reg, src_reg));
1132− } else if (dst_reg != src_reg)
1133− EMIT(PPC_RAW_MR(dst_reg, src_reg));
1223+ }
1224+ if (off == 0) {
1225+ /* MOV */
1226+ if (dst_reg != src_reg)
1227+ EMIT(PPC_RAW_MR(dst_reg, src_reg));
1228+ } else {
1229+ /* MOVSX: dst = (s8,s16,s32)src (off = 8,16,32) */
1230+ if (sign_extend(image, ctx, src_reg, dst_reg, off / 8))
1231+ return -1;
1232+ }
11341233 goto bpf_alu32_trunc;
11351234 case BPF_ALU | BPF_MOV | BPF_K: /* (u32) dst = imm */
11361235 case BPF_ALU64 | BPF_MOV | BPF_K: /* dst = (s64) imm */
@@ -1598,6 +1697,12 @@ emit_clear: · 461 unmodified lines
15981697 if (ret < 0)
15991698 return ret;
16001699
1700+ /* Take care of powerpc ABI requirements before kfunc call */
1701+ if (insn[i].src_reg == BPF_PSEUDO_KFUNC_CALL) {
1702+ if (prepare_for_kfunc_call(fp, image, ctx, &insn[i]))
1703+ return -1;
1704+ }
1705+
16011706 ret = bpf_jit_emit_func_call_rel(image, fimage, ctx, func_addr);
16021707 if (ret)
16031708 return ret;
arch/powerpc/perf/callchain.c+5−0
@@ -103,6 +103,11 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re · 102 unmodified lines
103103 void
104104 perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
105105 {
106+ perf_callchain_store(entry, perf_arch_instruction_pointer(regs));
107+
108+ if (!current->mm)
109+ return;
110+
106111 if (!is_32bit_task())
107112 perf_callchain_user_64(entry, regs);
108113 else
arch/powerpc/perf/callchain_32.c+0−1
@@ -142,7 +142,6 @@ void perf_callchain_user_32(struct perf_callchain_entry_ctx *entry, · 141 unmodified lines
142142 next_ip = perf_arch_instruction_pointer(regs);
143143 lr = regs->link;
144144 sp = regs->gpr[1];
145− perf_callchain_store(entry, next_ip);
146145
147146 while (entry->nr < entry->max_stack) {
148147 fp = (unsigned int __user *) (unsigned long) sp;
arch/powerpc/perf/callchain_64.c+0−1
@@ -77,7 +77,6 @@ void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry, · 76 unmodified lines
7777 next_ip = perf_arch_instruction_pointer(regs);
7878 lr = regs->link;
7979 sp = regs->gpr[1];
80− perf_callchain_store(entry, next_ip);
8180
8281 while (entry->nr < entry->max_stack) {
8382 fp = (unsigned long __user *) sp;
arch/powerpc/platforms/83xx/km83xx.c+2−2
@@ -155,8 +155,8 @@ machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices); · 154 unmodified lines
155155
156156 /* list of the supported boards */
157157 static char *board[] __initdata = {
158− "Keymile,KMETER1",
159− "Keymile,kmpbec8321",
158+ "keymile,KMETER1",
159+ "keymile,kmpbec8321",
160160 NULL
161161 };
162162
arch/powerpc/platforms/Kconfig.cputype+2−2
@@ -276,7 +276,7 @@ config PPC_BOOK3S · 275 unmodified lines
276276 config PPC_E500
277277 select FSL_EMB_PERFMON
278278 bool
279− select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
279+ select ARCH_SUPPORTS_HUGETLBFS
280280 select PPC_SMP_MUXED_IPI
281281 select PPC_DOORBELL
282282 select PPC_KUEP
@@ -337,7 +337,7 @@ config BOOKE · 54 unmodified lines
337337 config PTE_64BIT
338338 bool
339339 depends on 44x || PPC_E500 || PPC_86xx
340− default y if PHYS_64BIT
340+ default y if PPC_E500 || PHYS_64BIT
341341
342342 config PHYS_64BIT
343343 bool 'Large physical address support' if PPC_E500 || PPC_86xx
arch/powerpc/platforms/pseries/msi.c+1−1
@@ -605,7 +605,7 @@ static int pseries_irq_domain_alloc(struct irq_domain *domain, unsigned int virq · 604 unmodified lines
605605 &pseries_msi_irq_chip, pseries_dev);
606606 }
607607
608− pseries_dev->msi_used++;
608+ pseries_dev->msi_used += nr_irqs;
609609 return 0;
610610
611611 out:
arch/powerpc/tools/check-fpatchable-function-entry.shrenamed from arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh+0−0

File renamed without changes.

arch/powerpc/tools/ftrace-gen-ool-stubs.sh+2−2
@@ -15,9 +15,9 @@ if [ -z "$is_64bit" ]; then · 14 unmodified lines
1515 RELOCATION=R_PPC_ADDR32
1616 fi
1717
18−num_ool_stubs_total=$($objdump -r -j __patchable_function_entries "$vmlinux_o" |
18+num_ool_stubs_total=$($objdump -r -j __patchable_function_entries -d "$vmlinux_o" |
1919 grep -c "$RELOCATION")
20−num_ool_stubs_inittext=$($objdump -r -j __patchable_function_entries "$vmlinux_o" |
20+num_ool_stubs_inittext=$($objdump -r -j __patchable_function_entries -d "$vmlinux_o" |
2121 grep -e ".init.text" -e ".text.startup" | grep -c "$RELOCATION")
2222 num_ool_stubs_text=$((num_ool_stubs_total - num_ool_stubs_inittext))
2323
arch/riscv/kernel/vmlinux.lds.S+1−0
@@ -170,6 +170,7 @@ SECTIONS · 169 unmodified lines
170170
171171 STABS_DEBUG
172172 DWARF_DEBUG
173+ MODINFO
173174 ELF_DETAILS
174175 .riscv.attributes 0 : { *(.riscv.attributes) }
175176
arch/riscv/kvm/Kconfig+0−1
@@ -30,7 +30,6 @@ config KVM · 29 unmodified lines
3030 select KVM_GENERIC_HARDWARE_ENABLING
3131 select KVM_MMIO
3232 select VIRT_XFER_TO_GUEST_WORK
33− select KVM_GENERIC_MMU_NOTIFIER
3433 select SCHED_INFO
3534 select GUEST_PERF_EVENTS if PERF_EVENTS
3635 help
arch/riscv/kvm/aia.c+13−2
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/irqchip/riscv-imsic.h>
1414 #include <linux/irqdomain.h>
1515 #include <linux/kvm_host.h>
16+#include <linux/nospec.h>
1617 #include <linux/percpu.h>
1718 #include <linux/spinlock.h>
1819 #include <asm/cpufeature.h>
@@ -182,9 +183,14 @@ int kvm_riscv_vcpu_aia_get_csr(struct kvm_vcpu *vcpu, · 163 unmodified lines
182183 unsigned long *out_val)
183184 {
184185 struct kvm_vcpu_aia_csr *csr = &vcpu->arch.aia_context.guest_csr;
186+ unsigned long regs_max = sizeof(struct kvm_riscv_aia_csr) / sizeof(unsigned long);
185187
186− if (reg_num >= sizeof(struct kvm_riscv_aia_csr) / sizeof(unsigned long))
188+ if (!riscv_isa_extension_available(vcpu->arch.isa, SSAIA))
187189 return -ENOENT;
190+ if (reg_num >= regs_max)
191+ return -ENOENT;
192+
193+ reg_num = array_index_nospec(reg_num, regs_max);
188194
189195 *out_val = 0;
190196 if (kvm_riscv_aia_available())
@@ -198,9 +204,14 @@ int kvm_riscv_vcpu_aia_set_csr(struct kvm_vcpu *vcpu, · 7 unmodified lines
198204 unsigned long val)
199205 {
200206 struct kvm_vcpu_aia_csr *csr = &vcpu->arch.aia_context.guest_csr;
207+ unsigned long regs_max = sizeof(struct kvm_riscv_aia_csr) / sizeof(unsigned long);
201208
202− if (reg_num >= sizeof(struct kvm_riscv_aia_csr) / sizeof(unsigned long))
209+ if (!riscv_isa_extension_available(vcpu->arch.isa, SSAIA))
203210 return -ENOENT;
211+ if (reg_num >= regs_max)
212+ return -ENOENT;
213+
214+ reg_num = array_index_nospec(reg_num, regs_max);
204215
205216 if (kvm_riscv_aia_available()) {
206217 ((unsigned long *)csr)[reg_num] = val;
arch/riscv/kvm/aia_aplic.c+12−11
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/irqchip/riscv-aplic.h>
1111 #include <linux/kvm_host.h>
1212 #include <linux/math.h>
13+#include <linux/nospec.h>
1314 #include <linux/spinlock.h>
1415 #include <linux/swab.h>
1516 #include <kvm/iodev.h>
@@ -45,7 +46,7 @@ static u32 aplic_read_sourcecfg(struct aplic *aplic, u32 irq) · 29 unmodified lines
4546
4647 if (!irq || aplic->nr_irqs <= irq)
4748 return 0;
48− irqd = &aplic->irqs[irq];
49+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
4950
5051 raw_spin_lock_irqsave(&irqd->lock, flags);
5152 ret = irqd->sourcecfg;
@@ -61,7 +62,7 @@ static void aplic_write_sourcecfg(struct aplic *aplic, u32 irq, u32 val) · 9 unmodified lines
6162
6263 if (!irq || aplic->nr_irqs <= irq)
6364 return;
64− irqd = &aplic->irqs[irq];
65+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
6566
6667 if (val & APLIC_SOURCECFG_D)
6768 val = 0;
@@ -81,7 +82,7 @@ static u32 aplic_read_target(struct aplic *aplic, u32 irq) · 13 unmodified lines
8182
8283 if (!irq || aplic->nr_irqs <= irq)
8384 return 0;
84− irqd = &aplic->irqs[irq];
85+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
8586
8687 raw_spin_lock_irqsave(&irqd->lock, flags);
8788 ret = irqd->target;
@@ -97,7 +98,7 @@ static void aplic_write_target(struct aplic *aplic, u32 irq, u32 val) · 9 unmodified lines
9798
9899 if (!irq || aplic->nr_irqs <= irq)
99100 return;
100− irqd = &aplic->irqs[irq];
101+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
101102
102103 val &= APLIC_TARGET_EIID_MASK |
103104 (APLIC_TARGET_HART_IDX_MASK << APLIC_TARGET_HART_IDX_SHIFT) |
@@ -116,7 +117,7 @@ static bool aplic_read_pending(struct aplic *aplic, u32 irq) · 12 unmodified lines
116117
117118 if (!irq || aplic->nr_irqs <= irq)
118119 return false;
119− irqd = &aplic->irqs[irq];
120+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
120121
121122 raw_spin_lock_irqsave(&irqd->lock, flags);
122123 ret = (irqd->state & APLIC_IRQ_STATE_PENDING) ? true : false;
@@ -132,7 +133,7 @@ static void aplic_write_pending(struct aplic *aplic, u32 irq, bool pending) · 9 unmodified lines
132133
133134 if (!irq || aplic->nr_irqs <= irq)
134135 return;
135− irqd = &aplic->irqs[irq];
136+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
136137
137138 raw_spin_lock_irqsave(&irqd->lock, flags);
138139
@@ -170,7 +171,7 @@ static bool aplic_read_enabled(struct aplic *aplic, u32 irq) · 31 unmodified lines
170171
171172 if (!irq || aplic->nr_irqs <= irq)
172173 return false;
173− irqd = &aplic->irqs[irq];
174+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
174175
175176 raw_spin_lock_irqsave(&irqd->lock, flags);
176177 ret = (irqd->state & APLIC_IRQ_STATE_ENABLED) ? true : false;
@@ -186,7 +187,7 @@ static void aplic_write_enabled(struct aplic *aplic, u32 irq, bool enabled) · 9 unmodified lines
186187
187188 if (!irq || aplic->nr_irqs <= irq)
188189 return;
189− irqd = &aplic->irqs[irq];
190+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
190191
191192 raw_spin_lock_irqsave(&irqd->lock, flags);
192193 if (enabled)
@@ -205,7 +206,7 @@ static bool aplic_read_input(struct aplic *aplic, u32 irq) · 12 unmodified lines
205206
206207 if (!irq || aplic->nr_irqs <= irq)
207208 return false;
208− irqd = &aplic->irqs[irq];
209+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
209210
210211 raw_spin_lock_irqsave(&irqd->lock, flags);
211212
@@ -254,7 +255,7 @@ static void aplic_update_irq_range(struct kvm *kvm, u32 first, u32 last) · 42 unmodified lines
254255 for (irq = first; irq <= last; irq++) {
255256 if (!irq || aplic->nr_irqs <= irq)
256257 continue;
257− irqd = &aplic->irqs[irq];
258+ irqd = &aplic->irqs[array_index_nospec(irq, aplic->nr_irqs)];
258259
259260 raw_spin_lock_irqsave(&irqd->lock, flags);
260261
@@ -283,7 +284,7 @@ int kvm_riscv_aia_aplic_inject(struct kvm *kvm, u32 source, bool level) · 22 unmodified lines
283284
284285 if (!aplic || !source || (aplic->nr_irqs <= source))
285286 return -ENODEV;
286− irqd = &aplic->irqs[source];
287+ irqd = &aplic->irqs[array_index_nospec(source, aplic->nr_irqs)];
287288 ie = (aplic->domaincfg & APLIC_DOMAINCFG_IE) ? true : false;
288289
289290 raw_spin_lock_irqsave(&irqd->lock, flags);
arch/riscv/kvm/aia_device.c+14−4
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/irqchip/riscv-imsic.h>
1212 #include <linux/kvm_host.h>
1313 #include <linux/uaccess.h>
14+#include <linux/cpufeature.h>
1415
1516 static int aia_create(struct kvm_device *dev, u32 type)
1617 {
@@ -22,6 +23,9 @@ static int aia_create(struct kvm_device *dev, u32 type) · 5 unmodified lines
2223 if (irqchip_in_kernel(kvm))
2324 return -EEXIST;
2425
26+ if (!riscv_isa_extension_available(NULL, SSAIA))
27+ return -ENODEV;
28+
2529 ret = -EBUSY;
2630 if (kvm_trylock_all_vcpus(kvm))
2731 return ret;
@@ -437,7 +441,7 @@ static int aia_get_attr(struct kvm_device *dev, struct kvm_device_attr *attr) · 409 unmodified lines
437441
438442 static int aia_has_attr(struct kvm_device *dev, struct kvm_device_attr *attr)
439443 {
440− int nr_vcpus;
444+ int nr_vcpus, r = -ENXIO;
441445
442446 switch (attr->group) {
443447 case KVM_DEV_RISCV_AIA_GRP_CONFIG:
@@ -466,12 +470,18 @@ static int aia_has_attr(struct kvm_device *dev, struct kvm_device_attr *attr) · 22 unmodified lines
466470 }
467471 break;
468472 case KVM_DEV_RISCV_AIA_GRP_APLIC:
469− return kvm_riscv_aia_aplic_has_attr(dev->kvm, attr->attr);
473+ mutex_lock(&dev->kvm->lock);
474+ r = kvm_riscv_aia_aplic_has_attr(dev->kvm, attr->attr);
475+ mutex_unlock(&dev->kvm->lock);
476+ break;
470477 case KVM_DEV_RISCV_AIA_GRP_IMSIC:
471− return kvm_riscv_aia_imsic_has_attr(dev->kvm, attr->attr);
478+ mutex_lock(&dev->kvm->lock);
479+ r = kvm_riscv_aia_imsic_has_attr(dev->kvm, attr->attr);
480+ mutex_unlock(&dev->kvm->lock);
481+ break;
472482 }
473483
474− return -ENXIO;
484+ return r;
475485 }
476486
477487 struct kvm_device_ops kvm_riscv_aia_device_ops = {
arch/riscv/kvm/aia_imsic.c+4−0
@@ -908,6 +908,10 @@ int kvm_riscv_vcpu_aia_imsic_rmw(struct kvm_vcpu *vcpu, unsigned long isel, · 907 unmodified lines
908908 int r, rc = KVM_INSN_CONTINUE_NEXT_SEPC;
909909 struct imsic *imsic = vcpu->arch.aia_context.imsic_state;
910910
911+ /* If IMSIC vCPU state not initialized then forward to user space */
912+ if (!imsic)
913+ return KVM_INSN_EXIT_TO_USER_SPACE;
914+
911915 if (isel == KVM_RISCV_AIA_IMSIC_TOPEI) {
912916 /* Read pending and enabled interrupt with highest priority */
913917 topei = imsic_mrif_topei(imsic->swfile, imsic->nr_eix,
arch/riscv/kvm/mmu.c+5−1
@@ -245,6 +245,7 @@ out: · 244 unmodified lines
245245 bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
246246 {
247247 struct kvm_gstage gstage;
248+ bool mmu_locked;
248249
249250 if (!kvm->arch.pgd)
250251 return false;
@@ -253,9 +254,12 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range) · 2 unmodified lines
253254 gstage.flags = 0;
254255 gstage.vmid = READ_ONCE(kvm->arch.vmid.vmid);
255256 gstage.pgd = kvm->arch.pgd;
257+ mmu_locked = spin_trylock(&kvm->mmu_lock);
256258 kvm_riscv_gstage_unmap_range(&gstage, range->start << PAGE_SHIFT,
257259 (range->end - range->start) << PAGE_SHIFT,
258260 range->may_block);
261+ if (mmu_locked)
262+ spin_unlock(&kvm->mmu_lock);
259263 return false;
260264 }
261265
@@ -535,7 +539,7 @@ int kvm_riscv_mmu_map(struct kvm_vcpu *vcpu, struct kvm_memory_slot *memslot, · 273 unmodified lines
535539 goto out_unlock;
536540
537541 /* Check if we are backed by a THP and thus use block mapping if possible */
538− if (vma_pagesize == PAGE_SIZE)
542+ if (!logging && (vma_pagesize == PAGE_SIZE))
539543 vma_pagesize = transparent_hugepage_adjust(kvm, memslot, hva, &hfn, &gpa);
540544
541545 if (writable) {
arch/riscv/kvm/vcpu.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #define CREATE_TRACE_POINTS
2525 #include "trace.h"
2626
27−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
27+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
2828 KVM_GENERIC_VCPU_STATS(),
2929 STATS_DESC_COUNTER(VCPU, ecall_exit_stat),
3030 STATS_DESC_COUNTER(VCPU, wfi_exit_stat),
arch/riscv/kvm/vcpu_fp.c+13−4
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/errno.h>
1111 #include <linux/err.h>
1212 #include <linux/kvm_host.h>
13+#include <linux/nospec.h>
1314 #include <linux/uaccess.h>
1415 #include <asm/cpufeature.h>
1516
@@ -93,9 +94,11 @@ int kvm_riscv_vcpu_get_reg_fp(struct kvm_vcpu *vcpu, · 77 unmodified lines
9394 if (reg_num == KVM_REG_RISCV_FP_F_REG(fcsr))
9495 reg_val = &cntx->fp.f.fcsr;
9596 else if ((KVM_REG_RISCV_FP_F_REG(f[0]) <= reg_num) &&
96− reg_num <= KVM_REG_RISCV_FP_F_REG(f[31]))
97+ reg_num <= KVM_REG_RISCV_FP_F_REG(f[31])) {
98+ reg_num = array_index_nospec(reg_num,
99+ ARRAY_SIZE(cntx->fp.f.f));
97100 reg_val = &cntx->fp.f.f[reg_num];
98− else
101+ } else
99102 return -ENOENT;
100103 } else if ((rtype == KVM_REG_RISCV_FP_D) &&
101104 riscv_isa_extension_available(vcpu->arch.isa, d)) {
@@ -107,6 +110,8 @@ int kvm_riscv_vcpu_get_reg_fp(struct kvm_vcpu *vcpu, · 5 unmodified lines
107110 reg_num <= KVM_REG_RISCV_FP_D_REG(f[31])) {
108111 if (KVM_REG_SIZE(reg->id) != sizeof(u64))
109112 return -EINVAL;
113+ reg_num = array_index_nospec(reg_num,
114+ ARRAY_SIZE(cntx->fp.d.f));
110115 reg_val = &cntx->fp.d.f[reg_num];
111116 } else
112117 return -ENOENT;
@@ -138,9 +143,11 @@ int kvm_riscv_vcpu_set_reg_fp(struct kvm_vcpu *vcpu, · 25 unmodified lines
138143 if (reg_num == KVM_REG_RISCV_FP_F_REG(fcsr))
139144 reg_val = &cntx->fp.f.fcsr;
140145 else if ((KVM_REG_RISCV_FP_F_REG(f[0]) <= reg_num) &&
141− reg_num <= KVM_REG_RISCV_FP_F_REG(f[31]))
146+ reg_num <= KVM_REG_RISCV_FP_F_REG(f[31])) {
147+ reg_num = array_index_nospec(reg_num,
148+ ARRAY_SIZE(cntx->fp.f.f));
142149 reg_val = &cntx->fp.f.f[reg_num];
143− else
150+ } else
144151 return -ENOENT;
145152 } else if ((rtype == KVM_REG_RISCV_FP_D) &&
146153 riscv_isa_extension_available(vcpu->arch.isa, d)) {
@@ -152,6 +159,8 @@ int kvm_riscv_vcpu_set_reg_fp(struct kvm_vcpu *vcpu, · 5 unmodified lines
152159 reg_num <= KVM_REG_RISCV_FP_D_REG(f[31])) {
153160 if (KVM_REG_SIZE(reg->id) != sizeof(u64))
154161 return -EINVAL;
162+ reg_num = array_index_nospec(reg_num,
163+ ARRAY_SIZE(cntx->fp.d.f));
155164 reg_val = &cntx->fp.d.f[reg_num];
156165 } else
157166 return -ENOENT;
arch/riscv/kvm/vcpu_onereg.c+36−18
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/bitops.h>
1111 #include <linux/errno.h>
1212 #include <linux/err.h>
13+#include <linux/nospec.h>
1314 #include <linux/uaccess.h>
1415 #include <linux/kvm_host.h>
1516 #include <asm/cacheflush.h>
@@ -127,6 +128,7 @@ static int kvm_riscv_vcpu_isa_check_host(unsigned long kvm_ext, unsigned long *g · 111 unmodified lines
127128 kvm_ext >= ARRAY_SIZE(kvm_isa_ext_arr))
128129 return -ENOENT;
129130
131+ kvm_ext = array_index_nospec(kvm_ext, ARRAY_SIZE(kvm_isa_ext_arr));
130132 *guest_ext = kvm_isa_ext_arr[kvm_ext];
131133 switch (*guest_ext) {
132134 case RISCV_ISA_EXT_SMNPM:
@@ -443,13 +445,16 @@ static int kvm_riscv_vcpu_get_reg_core(struct kvm_vcpu *vcpu, · 310 unmodified lines
443445 unsigned long reg_num = reg->id & ~(KVM_REG_ARCH_MASK |
444446 KVM_REG_SIZE_MASK |
445447 KVM_REG_RISCV_CORE);
448+ unsigned long regs_max = sizeof(struct kvm_riscv_core) / sizeof(unsigned long);
446449 unsigned long reg_val;
447450
448451 if (KVM_REG_SIZE(reg->id) != sizeof(unsigned long))
449452 return -EINVAL;
450− if (reg_num >= sizeof(struct kvm_riscv_core) / sizeof(unsigned long))
453+ if (reg_num >= regs_max)
451454 return -ENOENT;
452455
456+ reg_num = array_index_nospec(reg_num, regs_max);
457+
453458 if (reg_num == KVM_REG_RISCV_CORE_REG(regs.pc))
454459 reg_val = cntx->sepc;
455460 else if (KVM_REG_RISCV_CORE_REG(regs.pc) < reg_num &&
@@ -476,13 +481,16 @@ static int kvm_riscv_vcpu_set_reg_core(struct kvm_vcpu *vcpu, · 20 unmodified lines
476481 unsigned long reg_num = reg->id & ~(KVM_REG_ARCH_MASK |
477482 KVM_REG_SIZE_MASK |
478483 KVM_REG_RISCV_CORE);
484+ unsigned long regs_max = sizeof(struct kvm_riscv_core) / sizeof(unsigned long);
479485 unsigned long reg_val;
480486
481487 if (KVM_REG_SIZE(reg->id) != sizeof(unsigned long))
482488 return -EINVAL;
483− if (reg_num >= sizeof(struct kvm_riscv_core) / sizeof(unsigned long))
489+ if (reg_num >= regs_max)
484490 return -ENOENT;
485491
492+ reg_num = array_index_nospec(reg_num, regs_max);
493+
486494 if (copy_from_user(&reg_val, uaddr, KVM_REG_SIZE(reg->id)))
487495 return -EFAULT;
488496
@@ -507,10 +515,13 @@ static int kvm_riscv_vcpu_general_get_csr(struct kvm_vcpu *vcpu, · 18 unmodified lines
507515 unsigned long *out_val)
508516 {
509517 struct kvm_vcpu_csr *csr = &vcpu->arch.guest_csr;
518+ unsigned long regs_max = sizeof(struct kvm_riscv_csr) / sizeof(unsigned long);
510519
511− if (reg_num >= sizeof(struct kvm_riscv_csr) / sizeof(unsigned long))
520+ if (reg_num >= regs_max)
512521 return -ENOENT;
513522
523+ reg_num = array_index_nospec(reg_num, regs_max);
524+
514525 if (reg_num == KVM_REG_RISCV_CSR_REG(sip)) {
515526 kvm_riscv_vcpu_flush_interrupts(vcpu);
516527 *out_val = (csr->hvip >> VSIP_TO_HVIP_SHIFT) & VSIP_VALID_MASK;
@@ -526,10 +537,13 @@ static int kvm_riscv_vcpu_general_set_csr(struct kvm_vcpu *vcpu, · 9 unmodified lines
526537 unsigned long reg_val)
527538 {
528539 struct kvm_vcpu_csr *csr = &vcpu->arch.guest_csr;
540+ unsigned long regs_max = sizeof(struct kvm_riscv_csr) / sizeof(unsigned long);
529541
530− if (reg_num >= sizeof(struct kvm_riscv_csr) / sizeof(unsigned long))
542+ if (reg_num >= regs_max)
531543 return -ENOENT;
532544
545+ reg_num = array_index_nospec(reg_num, regs_max);
546+
533547 if (reg_num == KVM_REG_RISCV_CSR_REG(sip)) {
534548 reg_val &= VSIP_VALID_MASK;
535549 reg_val <<= VSIP_TO_HVIP_SHIFT;
@@ -548,10 +562,15 @@ static inline int kvm_riscv_vcpu_smstateen_set_csr(struct kvm_vcpu *vcpu, · 12 unmodified lines
548562 unsigned long reg_val)
549563 {
550564 struct kvm_vcpu_smstateen_csr *csr = &vcpu->arch.smstateen_csr;
565+ unsigned long regs_max = sizeof(struct kvm_riscv_smstateen_csr) /
566+ sizeof(unsigned long);
551567
552− if (reg_num >= sizeof(struct kvm_riscv_smstateen_csr) /
553− sizeof(unsigned long))
554− return -EINVAL;
568+ if (!riscv_isa_extension_available(vcpu->arch.isa, SMSTATEEN))
569+ return -ENOENT;
570+ if (reg_num >= regs_max)
571+ return -ENOENT;
572+
573+ reg_num = array_index_nospec(reg_num, regs_max);
555574
556575 ((unsigned long *)csr)[reg_num] = reg_val;
557576 return 0;
@@ -562,10 +581,15 @@ static int kvm_riscv_vcpu_smstateen_get_csr(struct kvm_vcpu *vcpu, · 4 unmodified lines
562581 unsigned long *out_val)
563582 {
564583 struct kvm_vcpu_smstateen_csr *csr = &vcpu->arch.smstateen_csr;
584+ unsigned long regs_max = sizeof(struct kvm_riscv_smstateen_csr) /
585+ sizeof(unsigned long);
565586
566− if (reg_num >= sizeof(struct kvm_riscv_smstateen_csr) /
567− sizeof(unsigned long))
568− return -EINVAL;
587+ if (!riscv_isa_extension_available(vcpu->arch.isa, SMSTATEEN))
588+ return -ENOENT;
589+ if (reg_num >= regs_max)
590+ return -ENOENT;
591+
592+ reg_num = array_index_nospec(reg_num, regs_max);
569593
570594 *out_val = ((unsigned long *)csr)[reg_num];
571595 return 0;
@@ -595,10 +619,7 @@ static int kvm_riscv_vcpu_get_reg_csr(struct kvm_vcpu *vcpu, · 23 unmodified lines
595619 rc = kvm_riscv_vcpu_aia_get_csr(vcpu, reg_num, &reg_val);
596620 break;
597621 case KVM_REG_RISCV_CSR_SMSTATEEN:
598− rc = -EINVAL;
599− if (riscv_has_extension_unlikely(RISCV_ISA_EXT_SMSTATEEN))
600− rc = kvm_riscv_vcpu_smstateen_get_csr(vcpu, reg_num,
601− &reg_val);
622+ rc = kvm_riscv_vcpu_smstateen_get_csr(vcpu, reg_num, &reg_val);
602623 break;
603624 default:
604625 rc = -ENOENT;
@@ -640,10 +661,7 @@ static int kvm_riscv_vcpu_set_reg_csr(struct kvm_vcpu *vcpu, · 35 unmodified lines
640661 rc = kvm_riscv_vcpu_aia_set_csr(vcpu, reg_num, reg_val);
641662 break;
642663 case KVM_REG_RISCV_CSR_SMSTATEEN:
643− rc = -EINVAL;
644− if (riscv_has_extension_unlikely(RISCV_ISA_EXT_SMSTATEEN))
645− rc = kvm_riscv_vcpu_smstateen_set_csr(vcpu, reg_num,
646− reg_val);
664+ rc = kvm_riscv_vcpu_smstateen_set_csr(vcpu, reg_num, reg_val);
647665 break;
648666 default:
649667 rc = -ENOENT;
arch/riscv/kvm/vcpu_pmu.c+12−4
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/errno.h>
1111 #include <linux/err.h>
1212 #include <linux/kvm_host.h>
13+#include <linux/nospec.h>
1314 #include <linux/perf/riscv_pmu.h>
1415 #include <asm/csr.h>
1516 #include <asm/kvm_vcpu_sbi.h>
@@ -87,7 +88,8 @@ static void kvm_pmu_release_perf_event(struct kvm_pmc *pmc) · 71 unmodified lines
8788
8889 static u64 kvm_pmu_get_perf_event_hw_config(u32 sbi_event_code)
8990 {
90− return hw_event_perf_map[sbi_event_code];
91+ return hw_event_perf_map[array_index_nospec(sbi_event_code,
92+ SBI_PMU_HW_GENERAL_MAX)];
9193 }
9294
9395 static u64 kvm_pmu_get_perf_event_cache_config(u32 sbi_event_code)
@@ -218,6 +220,7 @@ static int pmu_fw_ctr_read_hi(struct kvm_vcpu *vcpu, unsigned long cidx, · 124 unmodified lines
218220 return -EINVAL;
219221 }
220222
223+ cidx = array_index_nospec(cidx, RISCV_KVM_MAX_COUNTERS);
221224 pmc = &kvpmu->pmc[cidx];
222225
223226 if (pmc->cinfo.type != SBI_PMU_CTR_TYPE_FW)
@@ -244,6 +247,7 @@ static int pmu_ctr_read(struct kvm_vcpu *vcpu, unsigned long cidx, · 20 unmodified lines
244247 return -EINVAL;
245248 }
246249
250+ cidx = array_index_nospec(cidx, RISCV_KVM_MAX_COUNTERS);
247251 pmc = &kvpmu->pmc[cidx];
248252
249253 if (pmc->cinfo.type == SBI_PMU_CTR_TYPE_FW) {
@@ -520,11 +524,12 @@ int kvm_riscv_vcpu_pmu_ctr_info(struct kvm_vcpu *vcpu, unsigned long cidx, · 270 unmodified lines
520524 {
521525 struct kvm_pmu *kvpmu = vcpu_to_pmu(vcpu);
522526
523− if (cidx > RISCV_KVM_MAX_COUNTERS || cidx == 1) {
527+ if (cidx >= RISCV_KVM_MAX_COUNTERS || cidx == 1) {
524528 retdata->err_val = SBI_ERR_INVALID_PARAM;
525529 return 0;
526530 }
527531
532+ cidx = array_index_nospec(cidx, RISCV_KVM_MAX_COUNTERS);
528533 retdata->out_val = kvpmu->pmc[cidx].cinfo.value;
529534
530535 return 0;
@@ -559,7 +564,8 @@ int kvm_riscv_vcpu_pmu_ctr_start(struct kvm_vcpu *vcpu, unsigned long ctr_base, · 28 unmodified lines
559564 }
560565 /* Start the counters that have been configured and requested by the guest */
561566 for_each_set_bit(i, &ctr_mask, RISCV_MAX_COUNTERS) {
562− pmc_index = i + ctr_base;
567+ pmc_index = array_index_nospec(i + ctr_base,
568+ RISCV_KVM_MAX_COUNTERS);
563569 if (!test_bit(pmc_index, kvpmu->pmc_in_use))
564570 continue;
565571 /* The guest started the counter again. Reset the overflow status */
@@ -630,7 +636,8 @@ int kvm_riscv_vcpu_pmu_ctr_stop(struct kvm_vcpu *vcpu, unsigned long ctr_base, · 64 unmodified lines
630636
631637 /* Stop the counters that have been configured and requested by the guest */
632638 for_each_set_bit(i, &ctr_mask, RISCV_MAX_COUNTERS) {
633− pmc_index = i + ctr_base;
639+ pmc_index = array_index_nospec(i + ctr_base,
640+ RISCV_KVM_MAX_COUNTERS);
634641 if (!test_bit(pmc_index, kvpmu->pmc_in_use))
635642 continue;
636643 pmc = &kvpmu->pmc[pmc_index];
@@ -761,6 +768,7 @@ int kvm_riscv_vcpu_pmu_ctr_cfg_match(struct kvm_vcpu *vcpu, unsigned long ctr_ba · 124 unmodified lines
761768 }
762769 }
763770
771+ ctr_idx = array_index_nospec(ctr_idx, RISCV_KVM_MAX_COUNTERS);
764772 pmc = &kvpmu->pmc[ctr_idx];
765773 pmc->idx = ctr_idx;
766774
arch/riscv/kvm/vm.c+1−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/kvm_host.h>
1414 #include <asm/kvm_mmu.h>
1515
16−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
16+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
1717 KVM_GENERIC_VM_STATS()
1818 };
1919 static_assert(ARRAY_SIZE(kvm_vm_stats_desc) ==
@@ -181,7 +181,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 161 unmodified lines
181181 break;
182182 case KVM_CAP_IOEVENTFD:
183183 case KVM_CAP_USER_MEMORY:
184− case KVM_CAP_SYNC_MMU:
185184 case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:
186185 case KVM_CAP_ONE_REG:
187186 case KVM_CAP_READONLY_MEM:
arch/s390/include/asm/idle.h+2−2
@@ -19,9 +19,9 @@ struct s390_idle_data { · 18 unmodified lines
1919 unsigned long mt_cycles_enter[8];
2020 };
2121
22+DECLARE_PER_CPU(struct s390_idle_data, s390_idle);
23+
2224 extern struct device_attribute dev_attr_idle_count;
2325 extern struct device_attribute dev_attr_idle_time_us;
2426
25−void psw_idle(struct s390_idle_data *data, unsigned long psw_mask);
26−
2727 #endif /* _S390_IDLE_H */
arch/s390/include/asm/processor.h+1−1
@@ -159,7 +159,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low, · 158 unmodified lines
159159 " j 4f\n"
160160 "3: mvc 8(1,%[addr]),0(%[addr])\n"
161161 "4:"
162− : [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=&a" (tmp)
162+ : [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=&a" (tmp)
163163 : [poison] "d" (poison)
164164 : "memory", "cc"
165165 );
arch/s390/include/asm/vtime.h+34−0
@@ -2,6 +2,12 @@ · 1 unmodified line
22 #ifndef _S390_VTIME_H
33 #define _S390_VTIME_H
44
5+#include <asm/lowcore.h>
6+#include <asm/cpu_mf.h>
7+#include <asm/idle.h>
8+
9+DECLARE_PER_CPU(u64, mt_cycles[8]);
10+
511 static inline void update_timer_sys(void)
612 {
713 struct lowcore *lc = get_lowcore();
@@ -20,4 +26,32 @@ static inline void update_timer_mcck(void) · 12 unmodified lines
2026 lc->last_update_timer = lc->mcck_enter_timer;
2127 }
2228
29+static inline void update_timer_idle(void)
30+{
31+ struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
32+ struct lowcore *lc = get_lowcore();
33+ u64 cycles_new[8];
34+ int i, mtid;
35+
36+ mtid = smp_cpu_mtid;
37+ if (mtid) {
38+ stcctm(MT_DIAG, mtid, cycles_new);
39+ for (i = 0; i < mtid; i++)
40+ __this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
41+ }
42+ /*
43+ * This is a bit subtle: Forward last_update_clock so it excludes idle
44+ * time. For correct steal time calculation in do_account_vtime() add
45+ * passed wall time before idle_enter to steal_timer:
46+ * During the passed wall time before idle_enter CPU time may have
47+ * been accounted to system, hardirq, softirq, etc. lowcore fields.
48+ * The accounted CPU times will be subtracted again from steal_timer
49+ * when accumulated steal time is calculated in do_account_vtime().
50+ */
51+ lc->steal_timer += idle->clock_idle_enter - lc->last_update_clock;
52+ lc->last_update_clock = lc->int_clock;
53+ lc->system_timer += lc->last_update_timer - idle->timer_idle_enter;
54+ lc->last_update_timer = lc->sys_enter_timer;
55+}
56+
2357 #endif /* _S390_VTIME_H */
arch/s390/kernel/entry.h+0−2
@@ -56,8 +56,6 @@ long sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t); · 55 unmodified lines
5656 long sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
5757 long sys_s390_sthyi(unsigned long function_code, void __user *buffer, u64 __user *return_code, unsigned long flags);
5858
59−DECLARE_PER_CPU(u64, mt_cycles[8]);
60−
6159 unsigned long stack_alloc(void);
6260 void stack_free(unsigned long stack);
6361
arch/s390/kernel/idle.c+5−20
@@ -15,37 +15,22 @@ · 14 unmodified lines
1515 #include <trace/events/power.h>
1616 #include <asm/cpu_mf.h>
1717 #include <asm/cputime.h>
18+#include <asm/idle.h>
1819 #include <asm/nmi.h>
1920 #include <asm/smp.h>
20−#include "entry.h"
2121
22−static DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
22+DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
2323
2424 void account_idle_time_irq(void)
2525 {
2626 struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
27− struct lowcore *lc = get_lowcore();
2827 unsigned long idle_time;
29− u64 cycles_new[8];
30− int i;
3128
32− if (smp_cpu_mtid) {
33− stcctm(MT_DIAG, smp_cpu_mtid, cycles_new);
34− for (i = 0; i < smp_cpu_mtid; i++)
35− this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
36− }
37−
38− idle_time = lc->int_clock - idle->clock_idle_enter;
39−
40− lc->steal_timer += idle->clock_idle_enter - lc->last_update_clock;
41− lc->last_update_clock = lc->int_clock;
42−
43− lc->system_timer += lc->last_update_timer - idle->timer_idle_enter;
44− lc->last_update_timer = lc->sys_enter_timer;
29+ idle_time = get_lowcore()->int_clock - idle->clock_idle_enter;
4530
4631 /* Account time spent with enabled wait psw loaded as idle time. */
47− WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time);
48− WRITE_ONCE(idle->idle_count, READ_ONCE(idle->idle_count) + 1);
32+ __atomic64_add(idle_time, &idle->idle_time);
33+ __atomic64_add_const(1, &idle->idle_count);
4934 account_idle_time(cputime_to_nsecs(idle_time));
5035 }
5136
arch/s390/kernel/ipl.c+1−1
@@ -2377,7 +2377,7 @@ void __init setup_ipl(void) · 2376 unmodified lines
23772377 atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
23782378 }
23792379
2380−void s390_reset_system(void)
2380+void __no_stack_protector s390_reset_system(void)
23812381 {
23822382 /* Disable prefixing */
23832383 set_prefix(0);
arch/s390/kernel/irq.c+8−2
@@ -146,6 +146,10 @@ void noinstr do_io_irq(struct pt_regs *regs) · 145 unmodified lines
146146 struct pt_regs *old_regs = set_irq_regs(regs);
147147 bool from_idle;
148148
149+ from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
150+ if (from_idle)
151+ update_timer_idle();
152+
149153 irq_enter_rcu();
150154
151155 if (user_mode(regs)) {
@@ -154,7 +158,6 @@ void noinstr do_io_irq(struct pt_regs *regs) · 2 unmodified lines
154158 current->thread.last_break = regs->last_break;
155159 }
156160
157− from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
158161 if (from_idle)
159162 account_idle_time_irq();
160163
@@ -182,6 +185,10 @@ void noinstr do_ext_irq(struct pt_regs *regs) · 21 unmodified lines
182185 struct pt_regs *old_regs = set_irq_regs(regs);
183186 bool from_idle;
184187
188+ from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
189+ if (from_idle)
190+ update_timer_idle();
191+
185192 irq_enter_rcu();
186193
187194 if (user_mode(regs)) {
@@ -194,7 +201,6 @@ void noinstr do_ext_irq(struct pt_regs *regs) · 6 unmodified lines
194201 regs->int_parm = get_lowcore()->ext_params;
195202 regs->int_parm_long = get_lowcore()->ext_params2;
196203
197− from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
198204 if (from_idle)
199205 account_idle_time_irq();
200206
arch/s390/kernel/vmlinux.lds.S+1−0
@@ -221,6 +221,7 @@ SECTIONS · 220 unmodified lines
221221 /* Debugging sections. */
222222 STABS_DEBUG
223223 DWARF_DEBUG
224+ MODINFO
224225 ELF_DETAILS
225226
226227 /*
arch/s390/kernel/vtime.c+10−32
@@ -48,8 +48,7 @@ static inline void set_vtimer(u64 expires) · 47 unmodified lines
4848
4949 static inline int virt_timer_forward(u64 elapsed)
5050 {
51− BUG_ON(!irqs_disabled());
52−
51+ lockdep_assert_irqs_disabled();
5352 if (list_empty(&virt_timer_list))
5453 return 0;
5554 elapsed = atomic64_add_return(elapsed, &virt_timer_elapsed);
@@ -137,23 +136,16 @@ static int do_account_vtime(struct task_struct *tsk) · 81 unmodified lines
137136 lc->system_timer += timer;
138137
139138 /* Update MT utilization calculation */
140− if (smp_cpu_mtid &&
141− time_after64(jiffies_64, this_cpu_read(mt_scaling_jiffies)))
139+ if (smp_cpu_mtid && time_after64(jiffies_64, __this_cpu_read(mt_scaling_jiffies)))
142140 update_mt_scaling();
143141
144142 /* Calculate cputime delta */
145− user = update_tsk_timer(&tsk->thread.user_timer,
146− READ_ONCE(lc->user_timer));
147− guest = update_tsk_timer(&tsk->thread.guest_timer,
148− READ_ONCE(lc->guest_timer));
149− system = update_tsk_timer(&tsk->thread.system_timer,
150− READ_ONCE(lc->system_timer));
151− hardirq = update_tsk_timer(&tsk->thread.hardirq_timer,
152− READ_ONCE(lc->hardirq_timer));
153− softirq = update_tsk_timer(&tsk->thread.softirq_timer,
154− READ_ONCE(lc->softirq_timer));
155− lc->steal_timer +=
156− clock - user - guest - system - hardirq - softirq;
143+ user = update_tsk_timer(&tsk->thread.user_timer, lc->user_timer);
144+ guest = update_tsk_timer(&tsk->thread.guest_timer, lc->guest_timer);
145+ system = update_tsk_timer(&tsk->thread.system_timer, lc->system_timer);
146+ hardirq = update_tsk_timer(&tsk->thread.hardirq_timer, lc->hardirq_timer);
147+ softirq = update_tsk_timer(&tsk->thread.softirq_timer, lc->softirq_timer);
148+ lc->steal_timer += clock - user - guest - system - hardirq - softirq;
157149
158150 /* Push account value */
159151 if (user) {
@@ -225,10 +217,6 @@ static u64 vtime_delta(void) · 65 unmodified lines
225217 return timer - lc->last_update_timer;
226218 }
227219
228−/*
229− * Update process times based on virtual cpu times stored by entry.S
230− * to the lowcore fields user_timer, system_timer & steal_clock.
231− */
232220 void vtime_account_kernel(struct task_struct *tsk)
233221 {
234222 struct lowcore *lc = get_lowcore();
@@ -238,27 +226,17 @@ void vtime_account_kernel(struct task_struct *tsk) · 3 unmodified lines
238226 lc->guest_timer += delta;
239227 else
240228 lc->system_timer += delta;
241−
242− virt_timer_forward(delta);
243229 }
244230 EXPORT_SYMBOL_GPL(vtime_account_kernel);
245231
246232 void vtime_account_softirq(struct task_struct *tsk)
247233 {
248− u64 delta = vtime_delta();
249−
250− get_lowcore()->softirq_timer += delta;
251−
252− virt_timer_forward(delta);
234+ get_lowcore()->softirq_timer += vtime_delta();
253235 }
254236
255237 void vtime_account_hardirq(struct task_struct *tsk)
256238 {
257− u64 delta = vtime_delta();
258−
259− get_lowcore()->hardirq_timer += delta;
260−
261− virt_timer_forward(delta);
239+ get_lowcore()->hardirq_timer += vtime_delta();
262240 }
263241
264242 /*
arch/s390/kvm/Kconfig+0−2
@@ -28,9 +28,7 @@ config KVM · 27 unmodified lines
2828 select HAVE_KVM_INVALID_WAKEUPS
2929 select HAVE_KVM_NO_POLL
3030 select KVM_VFIO
31− select MMU_NOTIFIER
3231 select VIRT_XFER_TO_GUEST_WORK
33− select KVM_GENERIC_MMU_NOTIFIER
3432 select KVM_MMU_LOCKLESS_AGING
3533 help
3634 Support hosting paravirtualized guest machines using the SIE
arch/s390/kvm/kvm-s390.c+2−3
@@ -65,7 +65,7 @@ · 64 unmodified lines
6565 #define VCPU_IRQS_MAX_BUF (sizeof(struct kvm_s390_irq) * \
6666 (KVM_MAX_VCPUS + LOCAL_IRQS))
6767
68−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
68+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
6969 KVM_GENERIC_VM_STATS(),
7070 STATS_DESC_COUNTER(VM, inject_io),
7171 STATS_DESC_COUNTER(VM, inject_float_mchk),
@@ -91,7 +91,7 @@ const struct kvm_stats_header kvm_vm_stats_header = { · 19 unmodified lines
9191 sizeof(kvm_vm_stats_desc),
9292 };
9393
94−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
94+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
9595 KVM_GENERIC_VCPU_STATS(),
9696 STATS_DESC_COUNTER(VCPU, exit_userspace),
9797 STATS_DESC_COUNTER(VCPU, exit_null),
@@ -601,7 +601,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 503 unmodified lines
601601 switch (ext) {
602602 case KVM_CAP_S390_PSW:
603603 case KVM_CAP_S390_GMAP:
604− case KVM_CAP_SYNC_MMU:
605604 #ifdef CONFIG_KVM_S390_UCONTROL
606605 case KVM_CAP_S390_UCONTROL:
607606 #endif
arch/s390/lib/xor.c+5−6
@@ -28,8 +28,8 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1, · 27 unmodified lines
2828 " j 3f\n"
2929 "2: xc 0(1,%1),0(%2)\n"
3030 "3:"
31− : : "d" (bytes), "a" (p1), "a" (p2)
32− : "0", "cc", "memory");
31+ : "+a" (bytes), "+a" (p1), "+a" (p2)
32+ : : "0", "cc", "memory");
3333 }
3434
3535 static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1,
@@ -54,7 +54,7 @@ static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1, · 18 unmodified lines
5454 "2: xc 0(1,%1),0(%2)\n"
5555 "3: xc 0(1,%1),0(%3)\n"
5656 "4:"
57− : "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3)
57+ : "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3)
5858 : : "0", "cc", "memory");
5959 }
6060
@@ -85,7 +85,7 @@ static void xor_xc_4(unsigned long bytes, unsigned long * __restrict p1, · 24 unmodified lines
8585 "3: xc 0(1,%1),0(%3)\n"
8686 "4: xc 0(1,%1),0(%4)\n"
8787 "5:"
88− : "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4)
88+ : "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4)
8989 : : "0", "cc", "memory");
9090 }
9191
@@ -96,7 +96,6 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1, · 4 unmodified lines
9696 const unsigned long * __restrict p5)
9797 {
9898 asm volatile(
99− " larl 1,2f\n"
10099 " aghi %0,-1\n"
101100 " jm 6f\n"
102101 " srlg 0,%0,8\n"
@@ -122,7 +121,7 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1, · 19 unmodified lines
122121 "4: xc 0(1,%1),0(%4)\n"
123122 "5: xc 0(1,%1),0(%5)\n"
124123 "6:"
125− : "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4),
124+ : "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4),
126125 "+a" (p5)
127126 : : "0", "cc", "memory");
128127 }
arch/s390/mm/pfault.c+2−2
@@ -62,7 +62,7 @@ int __pfault_init(void) · 61 unmodified lines
6262 "0: nopr %%r7\n"
6363 EX_TABLE(0b, 0b)
6464 : [rc] "+d" (rc)
65− : [refbk] "a" (&pfault_init_refbk), "m" (pfault_init_refbk)
65+ : [refbk] "a" (virt_to_phys(&pfault_init_refbk)), "m" (pfault_init_refbk)
6666 : "cc");
6767 return rc;
6868 }
@@ -84,7 +84,7 @@ void __pfault_fini(void) · 15 unmodified lines
8484 "0: nopr %%r7\n"
8585 EX_TABLE(0b, 0b)
8686 :
87− : [refbk] "a" (&pfault_fini_refbk), "m" (pfault_fini_refbk)
87+ : [refbk] "a" (virt_to_phys(&pfault_fini_refbk)), "m" (pfault_fini_refbk)
8888 : "cc");
8989 }
9090
arch/sh/kernel/vmlinux.lds.S+1−0
@@ -89,6 +89,7 @@ SECTIONS · 88 unmodified lines
8989
9090 STABS_DEBUG
9191 DWARF_DEBUG
92+ MODINFO
9293 ELF_DETAILS
9394
9495 DISCARDS
arch/sparc/kernel/iommu.c+2−0
@@ -312,6 +312,8 @@ static dma_addr_t dma_4u_map_phys(struct device *dev, phys_addr_t phys, · 311 unmodified lines
312312 if (direction != DMA_TO_DEVICE)
313313 iopte_protection |= IOPTE_WRITE;
314314
315+ phys &= IO_PAGE_MASK;
316+
315317 for (i = 0; i < npages; i++, base++, phys += IO_PAGE_SIZE)
316318 iopte_val(*base) = iopte_protection | phys;
317319
arch/sparc/kernel/pci.c+7−0
@@ -355,6 +355,13 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, · 354 unmodified lines
355355 dev->error_state = pci_channel_io_normal;
356356 dev->dma_mask = 0xffffffff;
357357
358+ /*
359+ * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
360+ * if MSI (rather than MSI-X) capability does not have
361+ * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
362+ */
363+ dev->msi_addr_mask = DMA_BIT_MASK(64);
364+
358365 if (of_node_name_eq(node, "pci")) {
359366 /* a PCI-PCI bridge */
360367 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
arch/sparc/kernel/pci_sun4v.c+2−0
@@ -410,6 +410,8 @@ static dma_addr_t dma_4v_map_phys(struct device *dev, phys_addr_t phys, · 409 unmodified lines
410410
411411 iommu_batch_start(dev, prot, entry);
412412
413+ phys &= IO_PAGE_MASK;
414+
413415 for (i = 0; i < npages; i++, phys += IO_PAGE_SIZE) {
414416 long err = iommu_batch_add(phys, mask);
415417 if (unlikely(err < 0L))
arch/sparc/kernel/vmlinux.lds.S+1−0
@@ -191,6 +191,7 @@ SECTIONS · 190 unmodified lines
191191
192192 STABS_DEBUG
193193 DWARF_DEBUG
194+ MODINFO
194195 ELF_DETAILS
195196
196197 DISCARDS
arch/um/drivers/ubd_kern.c+5−5
@@ -69,11 +69,11 @@ struct io_thread_req { · 68 unmodified lines
6969 };
7070
7171
72−static struct io_thread_req * (*irq_req_buffer)[];
72+static struct io_thread_req **irq_req_buffer;
7373 static struct io_thread_req *irq_remainder;
7474 static int irq_remainder_size;
7575
76−static struct io_thread_req * (*io_req_buffer)[];
76+static struct io_thread_req **io_req_buffer;
7777 static struct io_thread_req *io_remainder;
7878 static int io_remainder_size;
7979
@@ -398,7 +398,7 @@ static int thread_fd = -1; · 318 unmodified lines
398398
399399 static int bulk_req_safe_read(
400400 int fd,
401− struct io_thread_req * (*request_buffer)[],
401+ struct io_thread_req **request_buffer,
402402 struct io_thread_req **remainder,
403403 int *remainder_size,
404404 int max_recs
@@ -465,7 +465,7 @@ static irqreturn_t ubd_intr(int irq, void *dev) · 60 unmodified lines
465465 &irq_remainder, &irq_remainder_size,
466466 UBD_REQ_BUFFER_SIZE)) >= 0) {
467467 for (i = 0; i < len / sizeof(struct io_thread_req *); i++)
468− ubd_end_request((*irq_req_buffer)[i]);
468+ ubd_end_request(irq_req_buffer[i]);
469469 }
470470
471471 if (len < 0 && len != -EAGAIN)
@@ -1512,7 +1512,7 @@ void *io_thread(void *arg) · 1040 unmodified lines
15121512 }
15131513
15141514 for (count = 0; count < n/sizeof(struct io_thread_req *); count++) {
1515− struct io_thread_req *req = (*io_req_buffer)[count];
1515+ struct io_thread_req *req = io_req_buffer[count];
15161516 int i;
15171517
15181518 io_count++;
arch/um/kernel/dyn.lds.S+1−0
@@ -172,6 +172,7 @@ SECTIONS · 171 unmodified lines
172172
173173 STABS_DEBUG
174174 DWARF_DEBUG
175+ MODINFO
175176 ELF_DETAILS
176177
177178 DISCARDS
arch/um/kernel/uml.lds.S+1−0
@@ -113,6 +113,7 @@ SECTIONS · 112 unmodified lines
113113
114114 STABS_DEBUG
115115 DWARF_DEBUG
116+ MODINFO
116117 ELF_DETAILS
117118
118119 DISCARDS
arch/x86/boot/compressed/Makefile+1−0
@@ -113,6 +113,7 @@ vmlinux-objs-$(CONFIG_EFI_SBAT) += $(obj)/sbat.o · 112 unmodified lines
113113
114114 ifdef CONFIG_EFI_SBAT
115115 $(obj)/sbat.o: $(CONFIG_EFI_SBAT_FILE)
116+AFLAGS_sbat.o += -I $(srctree)
116117 endif
117118
118119 $(obj)/vmlinux: $(vmlinux-objs-y) $(vmlinux-libs-y) FORCE
arch/x86/boot/compressed/sev.c+5−4
@@ -28,17 +28,17 @@ · 27 unmodified lines
2828 #include "sev.h"
2929
3030 static struct ghcb boot_ghcb_page __aligned(PAGE_SIZE);
31−struct ghcb *boot_ghcb;
31+struct ghcb *boot_ghcb __section(".data");
3232
3333 #undef __init
3434 #define __init
3535
3636 #define __BOOT_COMPRESSED
3737
38−u8 snp_vmpl;
39−u16 ghcb_version;
38+u8 snp_vmpl __section(".data");
39+u16 ghcb_version __section(".data");
4040
41−u64 boot_svsm_caa_pa;
41+u64 boot_svsm_caa_pa __section(".data");
4242
4343 /* Include code for early handlers */
4444 #include "../../boot/startup/sev-shared.c"
@@ -188,6 +188,7 @@ bool sev_es_check_ghcb_fault(unsigned long address) · 143 unmodified lines
188188 MSR_AMD64_SNP_RESERVED_BIT13 | \
189189 MSR_AMD64_SNP_RESERVED_BIT15 | \
190190 MSR_AMD64_SNP_SECURE_AVIC | \
191+ MSR_AMD64_SNP_RESERVED_BITS19_22 | \
191192 MSR_AMD64_SNP_RESERVED_MASK)
192193
193194 #ifdef CONFIG_AMD_SECURE_AVIC
arch/x86/boot/compressed/vmlinux.lds.S+1−1
@@ -88,7 +88,7 @@ SECTIONS · 87 unmodified lines
8888 /DISCARD/ : {
8989 *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
9090 *(.hash) *(.gnu.hash)
91− *(.note.*)
91+ *(.note.*) *(.modinfo)
9292 }
9393
9494 .got.plt (INFO) : {
arch/x86/boot/startup/sev-shared.c+1−1
@@ -31,7 +31,7 @@ static u32 cpuid_std_range_max __ro_after_init; · 30 unmodified lines
3131 static u32 cpuid_hyp_range_max __ro_after_init;
3232 static u32 cpuid_ext_range_max __ro_after_init;
3333
34−bool sev_snp_needs_sfw;
34+bool sev_snp_needs_sfw __section(".data");
3535
3636 void __noreturn
3737 sev_es_terminate(unsigned int set, unsigned int reason)
arch/x86/coco/sev/core.c+1−0
@@ -89,6 +89,7 @@ static const char * const sev_status_feat_names[] = { · 88 unmodified lines
8989 [MSR_AMD64_SNP_VMSA_REG_PROT_BIT] = "VMSARegProt",
9090 [MSR_AMD64_SNP_SMT_PROT_BIT] = "SMTProt",
9191 [MSR_AMD64_SNP_SECURE_AVIC_BIT] = "SecureAVIC",
92+ [MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT] = "IBPBOnEntry",
9293 };
9394
9495 /*
arch/x86/entry/entry_fred.c+2−3
@@ -160,8 +160,6 @@ void __init fred_complete_exception_setup(void) · 159 unmodified lines
160160 static noinstr void fred_extint(struct pt_regs *regs)
161161 {
162162 unsigned int vector = regs->fred_ss.vector;
163− unsigned int index = array_index_nospec(vector - FIRST_SYSTEM_VECTOR,
164− NR_SYSTEM_VECTORS);
165163
166164 if (WARN_ON_ONCE(vector < FIRST_EXTERNAL_VECTOR))
167165 return;
@@ -170,7 +168,8 @@ static noinstr void fred_extint(struct pt_regs *regs) · 2 unmodified lines
170168 irqentry_state_t state = irqentry_enter(regs);
171169
172170 instrumentation_begin();
173− sysvec_table[index](regs);
171+ sysvec_table[array_index_nospec(vector - FIRST_SYSTEM_VECTOR,
172+ NR_SYSTEM_VECTORS)](regs);
174173 instrumentation_end();
175174 irqentry_exit(regs, state);
176175 } else {
arch/x86/entry/vdso/vdso32/sigreturn.S+30−0
@@ -35,9 +35,38 @@ · 34 unmodified lines
3535 #endif
3636 .endm
3737
38+/*
39+ * WARNING:
40+ *
41+ * A bug in the libgcc unwinder as of at least gcc 15.2 (2026) means that
42+ * the unwinder fails to recognize the signal frame flag.
43+ *
44+ * There is a hacky legacy fallback path in libgcc which ends up
45+ * getting invoked instead. It happens to work as long as BOTH of the
46+ * following conditions are true:
47+ *
48+ * 1. There is at least one byte before the each of the sigreturn
49+ * functions which falls outside any function. This is enforced by
50+ * an explicit nop instruction before the ALIGN.
51+ * 2. The code sequences between the entry point up to and including
52+ * the int $0x80 below need to match EXACTLY. Do not change them
53+ * in any way. The exact byte sequences are:
54+ *
55+ * __kernel_sigreturn:
56+ * 0: 58 pop %eax
57+ * 1: b8 77 00 00 00 mov $0x77,%eax
58+ * 6: cd 80 int $0x80
59+ *
60+ * __kernel_rt_sigreturn:
61+ * 0: b8 ad 00 00 00 mov $0xad,%eax
62+ * 5: cd 80 int $0x80
63+ *
64+ * For details, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124050
65+ */
3866 .text
3967 .globl __kernel_sigreturn
4068 .type __kernel_sigreturn,@function
69+ nop /* libgcc hack: see comment above */
4170 ALIGN
4271 __kernel_sigreturn:
4372 STARTPROC_SIGNAL_FRAME IA32_SIGFRAME_sigcontext
@@ -52,6 +81,7 @@ SYM_INNER_LABEL(vdso32_sigreturn_landing_pad, SYM_L_GLOBAL) · 8 unmodified lines
5281
5382 .globl __kernel_rt_sigreturn
5483 .type __kernel_rt_sigreturn,@function
84+ nop /* libgcc hack: see comment above */
5585 ALIGN
5686 __kernel_rt_sigreturn:
5787 STARTPROC_SIGNAL_FRAME IA32_RT_SIGFRAME_sigcontext
arch/x86/events/intel/uncore_snbep.c+27−1
@@ -6497,6 +6497,32 @@ static struct intel_uncore_type gnr_uncore_ubox = { · 6496 unmodified lines
64976497 .attr_update = uncore_alias_groups,
64986498 };
64996499
6500+static struct uncore_event_desc gnr_uncore_imc_events[] = {
6501+ INTEL_UNCORE_EVENT_DESC(clockticks, "event=0x01,umask=0x00"),
6502+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0, "event=0x05,umask=0xcf"),
6503+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0.scale, "6.103515625e-5"),
6504+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0.unit, "MiB"),
6505+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1, "event=0x06,umask=0xcf"),
6506+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1.scale, "6.103515625e-5"),
6507+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1.unit, "MiB"),
6508+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0, "event=0x05,umask=0xf0"),
6509+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0.scale, "6.103515625e-5"),
6510+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0.unit, "MiB"),
6511+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1, "event=0x06,umask=0xf0"),
6512+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1.scale, "6.103515625e-5"),
6513+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1.unit, "MiB"),
6514+ { /* end: all zeroes */ },
6515+};
6516+
6517+static struct intel_uncore_type gnr_uncore_imc = {
6518+ SPR_UNCORE_MMIO_COMMON_FORMAT(),
6519+ .name = "imc",
6520+ .fixed_ctr_bits = 48,
6521+ .fixed_ctr = SNR_IMC_MMIO_PMON_FIXED_CTR,
6522+ .fixed_ctl = SNR_IMC_MMIO_PMON_FIXED_CTL,
6523+ .event_descs = gnr_uncore_imc_events,
6524+};
6525+
65006526 static struct intel_uncore_type gnr_uncore_pciex8 = {
65016527 SPR_UNCORE_PCI_COMMON_FORMAT(),
65026528 .name = "pciex8",
@@ -6544,7 +6570,7 @@ static struct intel_uncore_type *gnr_uncores[UNCORE_GNR_NUM_UNCORE_TYPES] = { · 41 unmodified lines
65446570 NULL,
65456571 &spr_uncore_pcu,
65466572 &gnr_uncore_ubox,
6547− &spr_uncore_imc,
6573+ &gnr_uncore_imc,
65486574 NULL,
65496575 &gnr_uncore_upi,
65506576 NULL,
arch/x86/include/asm/bug.h+3−3
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 #include <linux/objtool.h>
88 #include <asm/asm.h>
99
10−#ifndef __ASSEMBLY__
10+#ifndef __ASSEMBLER__
1111 struct bug_entry;
1212 extern void __WARN_trap(struct bug_entry *bug, ...);
1313 #endif
@@ -137,7 +137,7 @@ do { \ · 123 unmodified lines
137137
138138 #ifdef HAVE_ARCH_BUG_FORMAT_ARGS
139139
140−#ifndef __ASSEMBLY__
140+#ifndef __ASSEMBLER__
141141 #include <linux/static_call_types.h>
142142 DECLARE_STATIC_CALL(WARN_trap, __WARN_trap);
143143
@@ -153,7 +153,7 @@ struct arch_va_list { · 9 unmodified lines
153153 struct sysv_va_list args;
154154 };
155155 extern void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
156−#endif /* __ASSEMBLY__ */
156+#endif /* __ASSEMBLER__ */
157157
158158 #define __WARN_bug_entry(flags, format) ({ \
159159 struct bug_entry *bug; \
arch/x86/include/asm/cfi.h+8−4
@@ -111,6 +111,12 @@ extern bhi_thunk __bhi_args_end[]; · 110 unmodified lines
111111
112112 struct pt_regs;
113113
114+#ifdef CONFIG_CALL_PADDING
115+#define CFI_OFFSET (CONFIG_FUNCTION_PADDING_CFI+5)
116+#else
117+#define CFI_OFFSET 5
118+#endif
119+
114120 #ifdef CONFIG_CFI
115121 enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
116122 #define __bpfcall
@@ -119,11 +125,9 @@ static inline int cfi_get_offset(void) · 2 unmodified lines
119125 {
120126 switch (cfi_mode) {
121127 case CFI_FINEIBT:
122− return 16;
128+ return /* fineibt_prefix_size */ 16;
123129 case CFI_KCFI:
124− if (IS_ENABLED(CONFIG_CALL_PADDING))
125− return 16;
126− return 5;
130+ return CFI_OFFSET;
127131 default:
128132 return 0;
129133 }
arch/x86/include/asm/efi.h+1−1
@@ -138,7 +138,7 @@ extern void __init efi_apply_memmap_quirks(void); · 137 unmodified lines
138138 extern int __init efi_reuse_config(u64 tables, int nr_tables);
139139 extern void efi_delete_dummy_variable(void);
140140 extern void efi_crash_gracefully_on_page_fault(unsigned long phys_addr);
141−extern void efi_free_boot_services(void);
141+extern void efi_unmap_boot_services(void);
142142
143143 void arch_efi_call_virt_setup(void);
144144 void arch_efi_call_virt_teardown(void);
arch/x86/include/asm/irqflags.h+2−2
@@ -77,7 +77,7 @@ static __always_inline void native_local_irq_restore(unsigned long flags) · 76 unmodified lines
7777 #endif
7878
7979 #ifndef CONFIG_PARAVIRT
80−#ifndef __ASSEMBLY__
80+#ifndef __ASSEMBLER__
8181 /*
8282 * Used in the idle loop; sti takes one instruction cycle
8383 * to complete:
@@ -95,7 +95,7 @@ static __always_inline void halt(void) · 11 unmodified lines
9595 {
9696 native_halt();
9797 }
98−#endif /* __ASSEMBLY__ */
98+#endif /* __ASSEMBLER__ */
9999 #endif /* CONFIG_PARAVIRT */
100100
101101 #ifdef CONFIG_PARAVIRT_XXL
arch/x86/include/asm/kvm_host.h+2−1
@@ -2485,7 +2485,8 @@ int memslot_rmap_alloc(struct kvm_memory_slot *slot, unsigned long npages); · 2484 unmodified lines
24852485 KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS | \
24862486 KVM_X86_QUIRK_SLOT_ZAP_ALL | \
24872487 KVM_X86_QUIRK_STUFF_FEATURE_MSRS | \
2488− KVM_X86_QUIRK_IGNORE_GUEST_PAT)
2488+ KVM_X86_QUIRK_IGNORE_GUEST_PAT | \
2489+ KVM_X86_QUIRK_VMCS12_ALLOW_FREEZE_IN_SMM)
24892490
24902491 #define KVM_X86_CONDITIONAL_QUIRKS \
24912492 (KVM_X86_QUIRK_CD_NW_CLEARED | \
arch/x86/include/asm/linkage.h+2−2
@@ -68,7 +68,7 @@ · 67 unmodified lines
6868 * Depending on -fpatchable-function-entry=N,N usage (CONFIG_CALL_PADDING) the
6969 * CFI symbol layout changes.
7070 *
71− * Without CALL_THUNKS:
71+ * Without CALL_PADDING:
7272 *
7373 * .align FUNCTION_ALIGNMENT
7474 * __cfi_##name:
@@ -77,7 +77,7 @@ · 2 unmodified lines
7777 * .long __kcfi_typeid_##name
7878 * name:
7979 *
80− * With CALL_THUNKS:
80+ * With CALL_PADDING:
8181 *
8282 * .align FUNCTION_ALIGNMENT
8383 * __cfi_##name:
arch/x86/include/asm/msr-index.h+4−1
@@ -740,7 +740,10 @@ · 739 unmodified lines
740740 #define MSR_AMD64_SNP_SMT_PROT BIT_ULL(MSR_AMD64_SNP_SMT_PROT_BIT)
741741 #define MSR_AMD64_SNP_SECURE_AVIC_BIT 18
742742 #define MSR_AMD64_SNP_SECURE_AVIC BIT_ULL(MSR_AMD64_SNP_SECURE_AVIC_BIT)
743−#define MSR_AMD64_SNP_RESV_BIT 19
743+#define MSR_AMD64_SNP_RESERVED_BITS19_22 GENMASK_ULL(22, 19)
744+#define MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT 23
745+#define MSR_AMD64_SNP_IBPB_ON_ENTRY BIT_ULL(MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT)
746+#define MSR_AMD64_SNP_RESV_BIT 24
744747 #define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
745748 #define MSR_AMD64_SAVIC_CONTROL 0xc0010138
746749 #define MSR_AMD64_SAVIC_EN_BIT 0
arch/x86/include/asm/numa.h+6−0
@@ -22,6 +22,7 @@ extern int numa_off; · 21 unmodified lines
2222 */
2323 extern s16 __apicid_to_node[MAX_LOCAL_APIC];
2424 extern nodemask_t numa_nodes_parsed __initdata;
25+extern nodemask_t numa_phys_nodes_parsed __initdata;
2526
2627 static inline void set_apicid_to_node(int apicid, s16 node)
2728 {
@@ -48,6 +49,7 @@ extern void __init init_cpu_to_node(void); · 20 unmodified lines
4849 extern void numa_add_cpu(unsigned int cpu);
4950 extern void numa_remove_cpu(unsigned int cpu);
5051 extern void init_gi_nodes(void);
52+extern int num_phys_nodes(void);
5153 #else /* CONFIG_NUMA */
5254 static inline void numa_set_node(int cpu, int node) { }
5355 static inline void numa_clear_node(int cpu) { }
@@ -55,6 +57,10 @@ static inline void init_cpu_to_node(void) { } · 1 unmodified line
5557 static inline void numa_add_cpu(unsigned int cpu) { }
5658 static inline void numa_remove_cpu(unsigned int cpu) { }
5759 static inline void init_gi_nodes(void) { }
60+static inline int num_phys_nodes(void)
61+{
62+ return 1;
63+}
5864 #endif /* CONFIG_NUMA */
5965
6066 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
arch/x86/include/asm/percpu.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020
2121 #define PER_CPU_VAR(var) __percpu(var)__percpu_rel
2222
23−#else /* !__ASSEMBLY__: */
23+#else /* !__ASSEMBLER__: */
2424
2525 #include <linux/args.h>
2626 #include <linux/bits.h>
arch/x86/include/asm/pgtable_64.h+0−2
@@ -19,10 +19,8 @@ · 18 unmodified lines
1919 extern p4d_t level4_kernel_pgt[512];
2020 extern p4d_t level4_ident_pgt[512];
2121 extern pud_t level3_kernel_pgt[512];
22−extern pud_t level3_ident_pgt[512];
2322 extern pmd_t level2_kernel_pgt[512];
2423 extern pmd_t level2_fixmap_pgt[512];
25−extern pmd_t level2_ident_pgt[512];
2624 extern pte_t level1_fixmap_pgt[512 * FIXMAP_PMD_NUM];
2725 extern pgd_t init_top_pgt[];
2826
arch/x86/include/asm/runtime-const.h+3−3
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #error "Cannot use runtime-const infrastructure from modules"
77 #endif
88
9−#ifdef __ASSEMBLY__
9+#ifdef __ASSEMBLER__
1010
1111 .macro RUNTIME_CONST_PTR sym reg
1212 movq $0x0123456789abcdef, %\reg
@@ -16,7 +16,7 @@ · 3 unmodified lines
1616 .popsection
1717 .endm
1818
19−#else /* __ASSEMBLY__ */
19+#else /* __ASSEMBLER__ */
2020
2121 #define runtime_const_ptr(sym) ({ \
2222 typeof(sym) __ret; \
@@ -74,5 +74,5 @@ static inline void runtime_const_fixup(void (*fn)(void *, unsigned long), · 51 unmodified lines
7474 }
7575 }
7676
77−#endif /* __ASSEMBLY__ */
77+#endif /* __ASSEMBLER__ */
7878 #endif
arch/x86/include/asm/topology.h+6−0
@@ -155,6 +155,7 @@ extern unsigned int __max_logical_packages; · 154 unmodified lines
155155 extern unsigned int __max_threads_per_core;
156156 extern unsigned int __num_threads_per_package;
157157 extern unsigned int __num_cores_per_package;
158+extern unsigned int __num_nodes_per_package;
158159
159160 const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c);
160161 enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c);
@@ -179,6 +180,11 @@ static inline unsigned int topology_num_threads_per_package(void) · 18 unmodified lines
179180 return __num_threads_per_package;
180181 }
181182
183+static inline unsigned int topology_num_nodes_per_package(void)
184+{
185+ return __num_nodes_per_package;
186+}
187+
182188 #ifdef CONFIG_X86_LOCAL_APIC
183189 int topology_get_logical_id(u32 apicid, enum x86_topology_domains at_level);
184190 #else
arch/x86/include/asm/traps.h+2−0
@@ -25,6 +25,8 @@ extern int ibt_selftest_noendbr(void); · 24 unmodified lines
2525 void handle_invalid_op(struct pt_regs *regs);
2626 #endif
2727
28+noinstr bool handle_bug(struct pt_regs *regs);
29+
2830 static inline int get_si_code(unsigned long condition)
2931 {
3032 if (condition & DR_STEP)
arch/x86/include/uapi/asm/kvm.h+1−0
@@ -476,6 +476,7 @@ struct kvm_sync_regs { · 475 unmodified lines
476476 #define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7)
477477 #define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8)
478478 #define KVM_X86_QUIRK_IGNORE_GUEST_PAT (1 << 9)
479+#define KVM_X86_QUIRK_VMCS12_ALLOW_FREEZE_IN_SMM (1 << 10)
479480
480481 #define KVM_STATE_NESTED_FORMAT_VMX 0
481482 #define KVM_STATE_NESTED_FORMAT_SVM 1
arch/x86/kernel/alternative.c+22−7
@@ -1182,7 +1182,7 @@ void __init_or_module noinline apply_seal_endbr(s32 *start, s32 *end) · 1181 unmodified lines
11821182
11831183 poison_endbr(addr);
11841184 if (IS_ENABLED(CONFIG_FINEIBT))
1185− poison_cfi(addr - 16);
1185+ poison_cfi(addr - CFI_OFFSET);
11861186 }
11871187 }
11881188
@@ -1389,6 +1389,8 @@ extern u8 fineibt_preamble_end[]; · 200 unmodified lines
13891389 #define fineibt_preamble_ud 0x13
13901390 #define fineibt_preamble_hash 5
13911391
1392+#define fineibt_prefix_size (fineibt_preamble_size - ENDBR_INSN_SIZE)
1393+
13921394 /*
13931395 * <fineibt_caller_start>:
13941396 * 0: b8 78 56 34 12 mov $0x12345678, %eax
@@ -1634,7 +1636,7 @@ static int cfi_rewrite_preamble(s32 *start, s32 *end) · 239 unmodified lines
16341636 * have determined there are no indirect calls to it and we
16351637 * don't need no CFI either.
16361638 */
1637− if (!is_endbr(addr + 16))
1639+ if (!is_endbr(addr + CFI_OFFSET))
16381640 continue;
16391641
16401642 hash = decode_preamble_hash(addr, &arity);
@@ -1642,6 +1644,15 @@ static int cfi_rewrite_preamble(s32 *start, s32 *end) · 1 unmodified line
16421644 addr, addr, 5, addr))
16431645 return -EINVAL;
16441646
1647+ /*
1648+ * FineIBT relies on being at func-16, so if the preamble is
1649+ * actually larger than that, place it the tail end.
1650+ *
1651+ * NOTE: this is possible with things like DEBUG_CALL_THUNKS
1652+ * and DEBUG_FORCE_FUNCTION_ALIGN_64B.
1653+ */
1654+ addr += CFI_OFFSET - fineibt_prefix_size;
1655+
16451656 text_poke_early(addr, fineibt_preamble_start, fineibt_preamble_size);
16461657 WARN_ON(*(u32 *)(addr + fineibt_preamble_hash) != 0x12345678);
16471658 text_poke_early(addr + fineibt_preamble_hash, &hash, 4);
@@ -1664,10 +1675,10 @@ static void cfi_rewrite_endbr(s32 *start, s32 *end) · 16 unmodified lines
16641675 for (s = start; s < end; s++) {
16651676 void *addr = (void *)s + *s;
16661677
1667− if (!exact_endbr(addr + 16))
1678+ if (!exact_endbr(addr + CFI_OFFSET))
16681679 continue;
16691680
1670− poison_endbr(addr + 16);
1681+ poison_endbr(addr + CFI_OFFSET);
16711682 }
16721683 }
16731684
@@ -1772,7 +1783,8 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, · 98 unmodified lines
17721783 if (FINEIBT_WARN(fineibt_preamble_size, 20) ||
17731784 FINEIBT_WARN(fineibt_preamble_bhi + fineibt_bhi1_size, 20) ||
17741785 FINEIBT_WARN(fineibt_caller_size, 14) ||
1775− FINEIBT_WARN(fineibt_paranoid_size, 20))
1786+ FINEIBT_WARN(fineibt_paranoid_size, 20) ||
1787+ WARN_ON_ONCE(CFI_OFFSET < fineibt_prefix_size))
17761788 return;
17771789
17781790 if (cfi_mode == CFI_AUTO) {
@@ -1885,6 +1897,11 @@ static void poison_cfi(void *addr) · 106 unmodified lines
18851897 */
18861898 switch (cfi_mode) {
18871899 case CFI_FINEIBT:
1900+ /*
1901+ * FineIBT preamble is at func-16.
1902+ */
1903+ addr += CFI_OFFSET - fineibt_prefix_size;
1904+
18881905 /*
18891906 * FineIBT prefix should start with an ENDBR.
18901907 */
@@ -1923,8 +1940,6 @@ static void poison_cfi(void *addr) · 32 unmodified lines
19231940 }
19241941 }
19251942
1926−#define fineibt_prefix_size (fineibt_preamble_size - ENDBR_INSN_SIZE)
1927−
19281943 /*
19291944 * When regs->ip points to a 0xD6 byte in the FineIBT preamble,
19301945 * return true and fill out target and type.
arch/x86/kernel/apic/apic.c+6−0
@@ -1894,6 +1894,7 @@ void __init check_x2apic(void) · 1893 unmodified lines
18941894
18951895 static inline void try_to_enable_x2apic(int remap_mode) { }
18961896 static inline void __x2apic_enable(void) { }
1897+static inline void __x2apic_disable(void) { }
18971898 #endif /* !CONFIG_X86_X2APIC */
18981899
18991900 void __init enable_IR_x2apic(void)
@@ -2456,6 +2457,11 @@ static void lapic_resume(void *data) · 556 unmodified lines
24562457 if (x2apic_mode) {
24572458 __x2apic_enable();
24582459 } else {
2460+ if (x2apic_enabled()) {
2461+ pr_warn_once("x2apic: re-enabled by firmware during resume. Disabling\n");
2462+ __x2apic_disable();
2463+ }
2464+
24592465 /*
24602466 * Make sure the APICBASE points to the right address
24612467 *
arch/x86/kernel/cpu/common.c+3−0
@@ -95,6 +95,9 @@ EXPORT_SYMBOL(__max_dies_per_package); · 94 unmodified lines
9595 unsigned int __max_logical_packages __ro_after_init = 1;
9696 EXPORT_SYMBOL(__max_logical_packages);
9797
98+unsigned int __num_nodes_per_package __ro_after_init = 1;
99+EXPORT_SYMBOL(__num_nodes_per_package);
100+
98101 unsigned int __num_cores_per_package __ro_after_init = 1;
99102 EXPORT_SYMBOL(__num_cores_per_package);
100103
arch/x86/kernel/cpu/resctrl/monitor.c+5−31
@@ -364,7 +364,7 @@ void arch_mon_domain_online(struct rdt_resource *r, struct rdt_l3_mon_domain *d) · 363 unmodified lines
364364 msr_clear_bit(MSR_RMID_SNC_CONFIG, 0);
365365 }
366366
367−/* CPU models that support MSR_RMID_SNC_CONFIG */
367+/* CPU models that support SNC and MSR_RMID_SNC_CONFIG */
368368 static const struct x86_cpu_id snc_cpu_ids[] __initconst = {
369369 X86_MATCH_VFM(INTEL_ICELAKE_X, 0),
370370 X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, 0),
@@ -375,40 +375,14 @@ static const struct x86_cpu_id snc_cpu_ids[] __initconst = { · 4 unmodified lines
375375 {}
376376 };
377377
378−/*
379− * There isn't a simple hardware bit that indicates whether a CPU is running
380− * in Sub-NUMA Cluster (SNC) mode. Infer the state by comparing the
381− * number of CPUs sharing the L3 cache with CPU0 to the number of CPUs in
382− * the same NUMA node as CPU0.
383− * It is not possible to accurately determine SNC state if the system is
384− * booted with a maxcpus=N parameter. That distorts the ratio of SNC nodes
385− * to L3 caches. It will be OK if system is booted with hyperthreading
386− * disabled (since this doesn't affect the ratio).
387− */
388378 static __init int snc_get_config(void)
389379 {
390− struct cacheinfo *ci = get_cpu_cacheinfo_level(0, RESCTRL_L3_CACHE);
391− const cpumask_t *node0_cpumask;
392− int cpus_per_node, cpus_per_l3;
393− int ret;
394−
395− if (!x86_match_cpu(snc_cpu_ids) || !ci)
396− return 1;
380+ int ret = topology_num_nodes_per_package();
397381
398− cpus_read_lock();
399− if (num_online_cpus() != num_present_cpus())
400− pr_warn("Some CPUs offline, SNC detection may be incorrect\n");
401− cpus_read_unlock();
402−
403− node0_cpumask = cpumask_of_node(cpu_to_node(0));
404−
405− cpus_per_node = cpumask_weight(node0_cpumask);
406− cpus_per_l3 = cpumask_weight(&ci->shared_cpu_map);
407−
408− if (!cpus_per_node || !cpus_per_l3)
382+ if (ret > 1 && !x86_match_cpu(snc_cpu_ids)) {
383+ pr_warn("CoD enabled system? Resctrl not supported\n");
409384 return 1;
410−
411− ret = cpus_per_l3 / cpus_per_node;
385+ }
412386
413387 /* sanity check: Only valid results are 1, 2, 3, 4, 6 */
414388 switch (ret) {
arch/x86/kernel/cpu/topology.c+11−2
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include <asm/mpspec.h>
3232 #include <asm/msr.h>
3333 #include <asm/smp.h>
34+#include <asm/numa.h>
3435
3536 #include "cpu.h"
3637
@@ -492,11 +493,19 @@ void __init topology_init_possible_cpus(void) · 455 unmodified lines
492493 set_nr_cpu_ids(allowed);
493494
494495 cnta = domain_weight(TOPO_PKG_DOMAIN);
495− cntb = domain_weight(TOPO_DIE_DOMAIN);
496496 __max_logical_packages = cnta;
497+
498+ pr_info("Max. logical packages: %3u\n", __max_logical_packages);
499+
500+ cntb = num_phys_nodes();
501+ __num_nodes_per_package = DIV_ROUND_UP(cntb, cnta);
502+
503+ pr_info("Max. logical nodes: %3u\n", cntb);
504+ pr_info("Num. nodes per package:%3u\n", __num_nodes_per_package);
505+
506+ cntb = domain_weight(TOPO_DIE_DOMAIN);
497507 __max_dies_per_package = 1U << (get_count_order(cntb) - get_count_order(cnta));
498508
499− pr_info("Max. logical packages: %3u\n", cnta);
500509 pr_info("Max. logical dies: %3u\n", cntb);
501510 pr_info("Max. dies per package: %3u\n", __max_dies_per_package);
502511
arch/x86/kernel/head_64.S+0−28
@@ -616,38 +616,10 @@ SYM_DATA(early_recursion_flag, .long 0) · 615 unmodified lines
616616
617617 .data
618618
619−#if defined(CONFIG_XEN_PV) || defined(CONFIG_PVH)
620−SYM_DATA_START_PTI_ALIGNED(init_top_pgt)
621− .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
622− .org init_top_pgt + L4_PAGE_OFFSET*8, 0
623− .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
624− .org init_top_pgt + L4_START_KERNEL*8, 0
625− /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
626− .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
627− .fill PTI_USER_PGD_FILL,8,0
628−SYM_DATA_END(init_top_pgt)
629−
630−SYM_DATA_START_PAGE_ALIGNED(level3_ident_pgt)
631− .quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
632− .fill 511, 8, 0
633−SYM_DATA_END(level3_ident_pgt)
634−SYM_DATA_START_PAGE_ALIGNED(level2_ident_pgt)
635− /*
636− * Since I easily can, map the first 1G.
637− * Don't set NX because code runs from these pages.
638− *
639− * Note: This sets _PAGE_GLOBAL despite whether
640− * the CPU supports it or it is enabled. But,
641− * the CPU should ignore the bit.
642− */
643− PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD)
644−SYM_DATA_END(level2_ident_pgt)
645−#else
646619 SYM_DATA_START_PTI_ALIGNED(init_top_pgt)
647620 .fill 512,8,0
648621 .fill PTI_USER_PGD_FILL,8,0
649622 SYM_DATA_END(init_top_pgt)
650−#endif
651623
652624 SYM_DATA_START_PAGE_ALIGNED(level4_kernel_pgt)
653625 .fill 511,8,0
arch/x86/kernel/smpboot.c+145−56
@@ -468,13 +468,6 @@ static int x86_cluster_flags(void) · 467 unmodified lines
468468 }
469469 #endif
470470
471−/*
472− * Set if a package/die has multiple NUMA nodes inside.
473− * AMD Magny-Cours, Intel Cluster-on-Die, and Intel
474− * Sub-NUMA Clustering have this.
475− */
476−static bool x86_has_numa_in_package;
477−
478471 static struct sched_domain_topology_level x86_topology[] = {
479472 SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
480473 #ifdef CONFIG_SCHED_CLUSTER
@@ -496,7 +489,7 @@ static void __init build_sched_topology(void) · 15 unmodified lines
496489 * PKG domain since the NUMA domains will auto-magically create the
497490 * right spanning domains based on the SLIT.
498491 */
499− if (x86_has_numa_in_package) {
492+ if (topology_num_nodes_per_package() > 1) {
500493 unsigned int pkgdom = ARRAY_SIZE(x86_topology) - 2;
501494
502495 memset(&x86_topology[pkgdom], 0, sizeof(x86_topology[pkgdom]));
@@ -513,33 +506,149 @@ static void __init build_sched_topology(void) · 10 unmodified lines
513506 }
514507
515508 #ifdef CONFIG_NUMA
516−static int sched_avg_remote_distance;
517−static int avg_remote_numa_distance(void)
509+/*
510+ * Test if the on-trace cluster at (N,N) is symmetric.
511+ * Uses upper triangle iteration to avoid obvious duplicates.
512+ */
513+static bool slit_cluster_symmetric(int N)
518514 {
519− int i, j;
520− int distance, nr_remote, total_distance;
521−
522− if (sched_avg_remote_distance > 0)
523− return sched_avg_remote_distance;
524−
525− nr_remote = 0;
526− total_distance = 0;
527− for_each_node_state(i, N_CPU) {
528− for_each_node_state(j, N_CPU) {
529− distance = node_distance(i, j);
530−
531− if (distance >= REMOTE_DISTANCE) {
532− nr_remote++;
533− total_distance += distance;
534− }
515+ int u = topology_num_nodes_per_package();
516+
517+ for (int k = 0; k < u; k++) {
518+ for (int l = k; l < u; l++) {
519+ if (node_distance(N + k, N + l) !=
520+ node_distance(N + l, N + k))
521+ return false;
535522 }
536523 }
537− if (nr_remote)
538− sched_avg_remote_distance = total_distance / nr_remote;
539− else
540− sched_avg_remote_distance = REMOTE_DISTANCE;
541524
542− return sched_avg_remote_distance;
525+ return true;
526+}
527+
528+/*
529+ * Return the package-id of the cluster, or ~0 if indeterminate.
530+ * Each node in the on-trace cluster should have the same package-id.
531+ */
532+static u32 slit_cluster_package(int N)
533+{
534+ int u = topology_num_nodes_per_package();
535+ u32 pkg_id = ~0;
536+
537+ for (int n = 0; n < u; n++) {
538+ const struct cpumask *cpus = cpumask_of_node(N + n);
539+ int cpu;
540+
541+ for_each_cpu(cpu, cpus) {
542+ u32 id = topology_logical_package_id(cpu);
543+
544+ if (pkg_id == ~0)
545+ pkg_id = id;
546+ if (pkg_id != id)
547+ return ~0;
548+ }
549+ }
550+
551+ return pkg_id;
552+}
553+
554+/*
555+ * Validate the SLIT table is of the form expected for SNC, specifically:
556+ *
557+ * - each on-trace cluster should be symmetric,
558+ * - each on-trace cluster should have a unique package-id.
559+ *
560+ * If you NUMA_EMU on top of SNC, you get to keep the pieces.
561+ */
562+static bool slit_validate(void)
563+{
564+ int u = topology_num_nodes_per_package();
565+ u32 pkg_id, prev_pkg_id = ~0;
566+
567+ for (int pkg = 0; pkg < topology_max_packages(); pkg++) {
568+ int n = pkg * u;
569+
570+ /*
571+ * Ensure the on-trace cluster is symmetric and each cluster
572+ * has a different package id.
573+ */
574+ if (!slit_cluster_symmetric(n))
575+ return false;
576+ pkg_id = slit_cluster_package(n);
577+ if (pkg_id == ~0)
578+ return false;
579+ if (pkg && pkg_id == prev_pkg_id)
580+ return false;
581+
582+ prev_pkg_id = pkg_id;
583+ }
584+
585+ return true;
586+}
587+
588+/*
589+ * Compute a sanitized SLIT table for SNC; notably SNC-3 can end up with
590+ * asymmetric off-trace clusters, reflecting physical assymmetries. However
591+ * this leads to 'unfortunate' sched_domain configurations.
592+ *
593+ * For example dual socket GNR with SNC-3:
594+ *
595+ * node distances:
596+ * node 0 1 2 3 4 5
597+ * 0: 10 15 17 21 28 26
598+ * 1: 15 10 15 23 26 23
599+ * 2: 17 15 10 26 23 21
600+ * 3: 21 28 26 10 15 17
601+ * 4: 23 26 23 15 10 15
602+ * 5: 26 23 21 17 15 10
603+ *
604+ * Fix things up by averaging out the off-trace clusters; resulting in:
605+ *
606+ * node 0 1 2 3 4 5
607+ * 0: 10 15 17 24 24 24
608+ * 1: 15 10 15 24 24 24
609+ * 2: 17 15 10 24 24 24
610+ * 3: 24 24 24 10 15 17
611+ * 4: 24 24 24 15 10 15
612+ * 5: 24 24 24 17 15 10
613+ */
614+static int slit_cluster_distance(int i, int j)
615+{
616+ static int slit_valid = -1;
617+ int u = topology_num_nodes_per_package();
618+ long d = 0;
619+ int x, y;
620+
621+ if (slit_valid < 0) {
622+ slit_valid = slit_validate();
623+ if (!slit_valid)
624+ pr_err(FW_BUG "SLIT table doesn't have the expected form for SNC -- fixup disabled!\n");
625+ else
626+ pr_info("Fixing up SNC SLIT table.\n");
627+ }
628+
629+ /*
630+ * Is this a unit cluster on the trace?
631+ */
632+ if ((i / u) == (j / u) || !slit_valid)
633+ return node_distance(i, j);
634+
635+ /*
636+ * Off-trace cluster.
637+ *
638+ * Notably average out the symmetric pair of off-trace clusters to
639+ * ensure the resulting SLIT table is symmetric.
640+ */
641+ x = i - (i % u);
642+ y = j - (j % u);
643+
644+ for (i = x; i < x + u; i++) {
645+ for (j = y; j < y + u; j++) {
646+ d += node_distance(i, j);
647+ d += node_distance(j, i);
648+ }
649+ }
650+
651+ return d / (2*u*u);
543652 }
544653
545654 int arch_sched_node_distance(int from, int to)
@@ -549,34 +658,14 @@ int arch_sched_node_distance(int from, int to) · 3 unmodified lines
549658 switch (boot_cpu_data.x86_vfm) {
550659 case INTEL_GRANITERAPIDS_X:
551660 case INTEL_ATOM_DARKMONT_X:
552−
553− if (!x86_has_numa_in_package || topology_max_packages() == 1 ||
554− d < REMOTE_DISTANCE)
661+ if (topology_max_packages() == 1 ||
662+ topology_num_nodes_per_package() < 3)
555663 return d;
556664
557665 /*
558− * With SNC enabled, there could be too many levels of remote
559− * NUMA node distances, creating NUMA domain levels
560− * including local nodes and partial remote nodes.
561− *
562− * Trim finer distance tuning for NUMA nodes in remote package
563− * for the purpose of building sched domains. Group NUMA nodes
564− * in the remote package in the same sched group.
565− * Simplify NUMA domains and avoid extra NUMA levels including
566− * different remote NUMA nodes and local nodes.
567− *
568− * GNR and CWF don't expect systems with more than 2 packages
569− * and more than 2 hops between packages. Single average remote
570− * distance won't be appropriate if there are more than 2
571− * packages as average distance to different remote packages
572− * could be different.
666+ * Handle SNC-3 asymmetries.
573667 */
574− WARN_ONCE(topology_max_packages() > 2,
575− "sched: Expect only up to 2 packages for GNR or CWF, "
576− "but saw %d packages when building sched domains.",
577− topology_max_packages());
578−
579− d = avg_remote_numa_distance();
668+ return slit_cluster_distance(from, to);
580669 }
581670 return d;
582671 }
@@ -606,7 +695,7 @@ void set_cpu_sibling_map(int cpu) · 23 unmodified lines
606695 o = &cpu_data(i);
607696
608697 if (match_pkg(c, o) && !topology_same_node(c, o))
609− x86_has_numa_in_package = true;
698+ WARN_ON_ONCE(topology_num_nodes_per_package() == 1);
610699
611700 if ((i == cpu) || (has_smt && match_smt(c, o)))
612701 link_mask(topology_sibling_cpumask, cpu, i);
arch/x86/kernel/traps.c+1−1
@@ -397,7 +397,7 @@ static inline void handle_invalid_op(struct pt_regs *regs) · 396 unmodified lines
397397 ILL_ILLOPN, error_get_trap_addr(regs));
398398 }
399399
400−static noinstr bool handle_bug(struct pt_regs *regs)
400+noinstr bool handle_bug(struct pt_regs *regs)
401401 {
402402 unsigned long addr = regs->ip;
403403 bool handled = false;
arch/x86/kernel/vmlinux.lds.S+1−0
@@ -427,6 +427,7 @@ SECTIONS · 426 unmodified lines
427427 .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
428428 #endif
429429
430+ MODINFO
430431 ELF_DETAILS
431432
432433 DISCARDS
arch/x86/kvm/Kconfig+0−1
@@ -20,7 +20,6 @@ if VIRTUALIZATION · 19 unmodified lines
2020 config KVM_X86
2121 def_tristate KVM if (KVM_INTEL != n || KVM_AMD != n)
2222 select KVM_COMMON
23− select KVM_GENERIC_MMU_NOTIFIER
2423 select KVM_ELIDE_TLB_FLUSH_IF_YOUNG
2524 select KVM_MMU_LOCKLESS_AGING
2625 select HAVE_KVM_IRQCHIP
arch/x86/kvm/cpuid.c+4−1
@@ -776,7 +776,10 @@ do { \ · 775 unmodified lines
776776 #define SYNTHESIZED_F(name) \
777777 ({ \
778778 kvm_cpu_cap_synthesized |= feature_bit(name); \
779− F(name); \
779+ \
780+ BUILD_BUG_ON(X86_FEATURE_##name >= MAX_CPU_FEATURES); \
781+ if (boot_cpu_has(X86_FEATURE_##name)) \
782+ F(name); \
780783 })
781784
782785 /*
arch/x86/kvm/hyperv.c+5−4
@@ -1981,16 +1981,17 @@ int kvm_hv_vcpu_flush_tlb(struct kvm_vcpu *vcpu) · 1980 unmodified lines
19811981 if (entries[i] == KVM_HV_TLB_FLUSHALL_ENTRY)
19821982 goto out_flush_all;
19831983
1984− if (is_noncanonical_invlpg_address(entries[i], vcpu))
1985− continue;
1986−
19871984 /*
19881985 * Lower 12 bits of 'address' encode the number of additional
19891986 * pages to flush.
19901987 */
19911988 gva = entries[i] & PAGE_MASK;
1992− for (j = 0; j < (entries[i] & ~PAGE_MASK) + 1; j++)
1989+ for (j = 0; j < (entries[i] & ~PAGE_MASK) + 1; j++) {
1990+ if (is_noncanonical_invlpg_address(gva + j * PAGE_SIZE, vcpu))
1991+ continue;
1992+
19931993 kvm_x86_call(flush_tlb_gva)(vcpu, gva + j * PAGE_SIZE);
1994+ }
19941995
19951996 ++vcpu->stat.tlb_flush;
19961997 }
arch/x86/kvm/ioapic.c+2−1
@@ -321,7 +321,8 @@ void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, · 320 unmodified lines
321321 idx = srcu_read_lock(&kvm->irq_srcu);
322322 gsi = kvm_irq_map_chip_pin(kvm, irqchip, pin);
323323 if (gsi != -1)
324− hlist_for_each_entry_rcu(kimn, &ioapic->mask_notifier_list, link)
324+ hlist_for_each_entry_srcu(kimn, &ioapic->mask_notifier_list, link,
325+ srcu_read_lock_held(&kvm->irq_srcu))
325326 if (kimn->irq == gsi)
326327 kimn->func(kimn, mask);
327328 srcu_read_unlock(&kvm->irq_srcu, idx);
arch/x86/kvm/svm/avic.c+6−3
@@ -189,12 +189,12 @@ static void avic_activate_vmcb(struct vcpu_svm *svm) · 188 unmodified lines
189189 struct kvm_vcpu *vcpu = &svm->vcpu;
190190
191191 vmcb->control.int_ctl &= ~(AVIC_ENABLE_MASK | X2APIC_MODE_MASK);
192−
193192 vmcb->control.avic_physical_id &= ~AVIC_PHYSICAL_MAX_INDEX_MASK;
194193 vmcb->control.avic_physical_id |= avic_get_max_physical_id(vcpu);
195−
196194 vmcb->control.int_ctl |= AVIC_ENABLE_MASK;
197195
196+ svm_clr_intercept(svm, INTERCEPT_CR8_WRITE);
197+
198198 /*
199199 * Note: KVM supports hybrid-AVIC mode, where KVM emulates x2APIC MSR
200200 * accesses, while interrupt injection to a running vCPU can be
@@ -226,6 +226,9 @@ static void avic_deactivate_vmcb(struct vcpu_svm *svm) · 25 unmodified lines
226226 vmcb->control.int_ctl &= ~(AVIC_ENABLE_MASK | X2APIC_MODE_MASK);
227227 vmcb->control.avic_physical_id &= ~AVIC_PHYSICAL_MAX_INDEX_MASK;
228228
229+ if (!sev_es_guest(svm->vcpu.kvm))
230+ svm_set_intercept(svm, INTERCEPT_CR8_WRITE);
231+
229232 /*
230233 * If running nested and the guest uses its own MSR bitmap, there
231234 * is no need to update L0's msr bitmap
@@ -368,7 +371,7 @@ void avic_init_vmcb(struct vcpu_svm *svm, struct vmcb *vmcb) · 136 unmodified lines
368371 vmcb->control.avic_physical_id = __sme_set(__pa(kvm_svm->avic_physical_id_table));
369372 vmcb->control.avic_vapic_bar = APIC_DEFAULT_PHYS_BASE;
370373
371− if (kvm_apicv_activated(svm->vcpu.kvm))
374+ if (kvm_vcpu_apicv_active(&svm->vcpu))
372375 avic_activate_vmcb(svm);
373376 else
374377 avic_deactivate_vmcb(svm);
arch/x86/kvm/svm/nested.c+10−2
@@ -418,6 +418,15 @@ static bool nested_vmcb_check_controls(struct kvm_vcpu *vcpu) · 417 unmodified lines
418418 return __nested_vmcb_check_controls(vcpu, ctl);
419419 }
420420
421+int nested_svm_check_cached_vmcb12(struct kvm_vcpu *vcpu)
422+{
423+ if (!nested_vmcb_check_save(vcpu) ||
424+ !nested_vmcb_check_controls(vcpu))
425+ return -EINVAL;
426+
427+ return 0;
428+}
429+
421430 /*
422431 * If a feature is not advertised to L1, clear the corresponding vmcb12
423432 * intercept.
@@ -1028,8 +1037,7 @@ int nested_svm_vmrun(struct kvm_vcpu *vcpu) · 604 unmodified lines
10281037 nested_copy_vmcb_control_to_cache(svm, &vmcb12->control);
10291038 nested_copy_vmcb_save_to_cache(svm, &vmcb12->save);
10301039
1031− if (!nested_vmcb_check_save(vcpu) ||
1032− !nested_vmcb_check_controls(vcpu)) {
1040+ if (nested_svm_check_cached_vmcb12(vcpu) < 0) {
10331041 vmcb12->control.exit_code = SVM_EXIT_ERR;
10341042 vmcb12->control.exit_info_1 = 0;
10351043 vmcb12->control.exit_info_2 = 0;
arch/x86/kvm/svm/svm.c+11−6
@@ -1077,8 +1077,7 @@ static void init_vmcb(struct kvm_vcpu *vcpu, bool init_event) · 1076 unmodified lines
10771077 svm_set_intercept(svm, INTERCEPT_CR0_WRITE);
10781078 svm_set_intercept(svm, INTERCEPT_CR3_WRITE);
10791079 svm_set_intercept(svm, INTERCEPT_CR4_WRITE);
1080− if (!kvm_vcpu_apicv_active(vcpu))
1081− svm_set_intercept(svm, INTERCEPT_CR8_WRITE);
1080+ svm_set_intercept(svm, INTERCEPT_CR8_WRITE);
10821081
10831082 set_dr_intercepts(svm);
10841083
@@ -1189,7 +1188,7 @@ static void init_vmcb(struct kvm_vcpu *vcpu, bool init_event) · 104 unmodified lines
11891188 if (guest_cpu_cap_has(vcpu, X86_FEATURE_ERAPS))
11901189 svm->vmcb->control.erap_ctl |= ERAP_CONTROL_ALLOW_LARGER_RAP;
11911190
1192− if (kvm_vcpu_apicv_active(vcpu))
1191+ if (enable_apicv && irqchip_in_kernel(vcpu->kvm))
11931192 avic_init_vmcb(svm, vmcb);
11941193
11951194 if (vnmi)
@@ -2674,9 +2673,11 @@ static int dr_interception(struct kvm_vcpu *vcpu) · 1478 unmodified lines
26742673
26752674 static int cr8_write_interception(struct kvm_vcpu *vcpu)
26762675 {
2676+ u8 cr8_prev = kvm_get_cr8(vcpu);
26772677 int r;
26782678
2679− u8 cr8_prev = kvm_get_cr8(vcpu);
2679+ WARN_ON_ONCE(kvm_vcpu_apicv_active(vcpu));
2680+
26802681 /* instruction emulation calls kvm_set_cr8() */
26812682 r = cr_interception(vcpu);
26822683 if (lapic_in_kernel(vcpu))
@@ -4879,11 +4880,15 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram) · 2196 unmodified lines
48794880 vmcb12 = map.hva;
48804881 nested_copy_vmcb_control_to_cache(svm, &vmcb12->control);
48814882 nested_copy_vmcb_save_to_cache(svm, &vmcb12->save);
4882− ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, vmcb12, false);
48834883
4884− if (ret)
4884+ if (nested_svm_check_cached_vmcb12(vcpu) < 0)
4885+ goto unmap_save;
4886+
4887+ if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa,
4888+ vmcb12, false) != 0)
48854889 goto unmap_save;
48864890
4891+ ret = 0;
48874892 svm->nested.nested_run_pending = 1;
48884893
48894894 unmap_save:
arch/x86/kvm/svm/svm.h+1−0
@@ -797,6 +797,7 @@ static inline int nested_svm_simple_vmexit(struct vcpu_svm *svm, u32 exit_code) · 796 unmodified lines
797797
798798 int nested_svm_exit_handled(struct vcpu_svm *svm);
799799 int nested_svm_check_permissions(struct kvm_vcpu *vcpu);
800+int nested_svm_check_cached_vmcb12(struct kvm_vcpu *vcpu);
800801 int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
801802 bool has_error_code, u32 error_code);
802803 int nested_svm_exit_special(struct vcpu_svm *svm);
arch/x86/kvm/vmx/nested.c+45−16
@@ -3300,10 +3300,24 @@ static int nested_vmx_check_guest_state(struct kvm_vcpu *vcpu, · 3299 unmodified lines
33003300 if (CC(vmcs12->guest_cr4 & X86_CR4_CET && !(vmcs12->guest_cr0 & X86_CR0_WP)))
33013301 return -EINVAL;
33023302
3303− if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) &&
3304− (CC(!kvm_dr7_valid(vmcs12->guest_dr7)) ||
3305− CC(!vmx_is_valid_debugctl(vcpu, vmcs12->guest_ia32_debugctl, false))))
3306− return -EINVAL;
3303+ if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) {
3304+ u64 debugctl = vmcs12->guest_ia32_debugctl;
3305+
3306+ /*
3307+ * FREEZE_IN_SMM is not virtualized, but allow L1 to set it in
3308+ * vmcs12's DEBUGCTL under a quirk for backwards compatibility.
3309+ * Note that the quirk only relaxes the consistency check. The
3310+ * vmcc02 bit is still under the control of the host. In
3311+ * particular, if a host administrator decides to clear the bit,
3312+ * then L1 has no say in the matter.
3313+ */
3314+ if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_VMCS12_ALLOW_FREEZE_IN_SMM))
3315+ debugctl &= ~DEBUGCTLMSR_FREEZE_IN_SMM;
3316+
3317+ if (CC(!kvm_dr7_valid(vmcs12->guest_dr7)) ||
3318+ CC(!vmx_is_valid_debugctl(vcpu, debugctl, false)))
3319+ return -EINVAL;
3320+ }
33073321
33083322 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT) &&
33093323 CC(!kvm_pat_valid(vmcs12->guest_ia32_pat)))
@@ -6842,13 +6856,34 @@ void vmx_leave_nested(struct kvm_vcpu *vcpu) · 3532 unmodified lines
68426856 free_nested(vcpu);
68436857 }
68446858
6859+int nested_vmx_check_restored_vmcs12(struct kvm_vcpu *vcpu)
6860+{
6861+ enum vm_entry_failure_code ignored;
6862+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
6863+
6864+ if (nested_cpu_has_shadow_vmcs(vmcs12) &&
6865+ vmcs12->vmcs_link_pointer != INVALID_GPA) {
6866+ struct vmcs12 *shadow_vmcs12 = get_shadow_vmcs12(vcpu);
6867+
6868+ if (shadow_vmcs12->hdr.revision_id != VMCS12_REVISION ||
6869+ !shadow_vmcs12->hdr.shadow_vmcs)
6870+ return -EINVAL;
6871+ }
6872+
6873+ if (nested_vmx_check_controls(vcpu, vmcs12) ||
6874+ nested_vmx_check_host_state(vcpu, vmcs12) ||
6875+ nested_vmx_check_guest_state(vcpu, vmcs12, &ignored))
6876+ return -EINVAL;
6877+
6878+ return 0;
6879+}
6880+
68456881 static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
68466882 struct kvm_nested_state __user *user_kvm_nested_state,
68476883 struct kvm_nested_state *kvm_state)
68486884 {
68496885 struct vcpu_vmx *vmx = to_vmx(vcpu);
68506886 struct vmcs12 *vmcs12;
6851− enum vm_entry_failure_code ignored;
68526887 struct kvm_vmx_nested_state_data __user *user_vmx_nested_state =
68536888 &user_kvm_nested_state->data.vmx[0];
68546889 int ret;
@@ -6979,25 +7014,20 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 124 unmodified lines
69797014 vmx->nested.mtf_pending =
69807015 !!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING);
69817016
6982− ret = -EINVAL;
69837017 if (nested_cpu_has_shadow_vmcs(vmcs12) &&
69847018 vmcs12->vmcs_link_pointer != INVALID_GPA) {
69857019 struct vmcs12 *shadow_vmcs12 = get_shadow_vmcs12(vcpu);
69867020
7021+ ret = -EINVAL;
69877022 if (kvm_state->size <
69887023 sizeof(*kvm_state) +
69897024 sizeof(user_vmx_nested_state->vmcs12) + sizeof(*shadow_vmcs12))
69907025 goto error_guest_mode;
69917026
7027+ ret = -EFAULT;
69927028 if (copy_from_user(shadow_vmcs12,
69937029 user_vmx_nested_state->shadow_vmcs12,
6994− sizeof(*shadow_vmcs12))) {
6995− ret = -EFAULT;
6996− goto error_guest_mode;
6997− }
6998−
6999− if (shadow_vmcs12->hdr.revision_id != VMCS12_REVISION ||
7000− !shadow_vmcs12->hdr.shadow_vmcs)
7030+ sizeof(*shadow_vmcs12)))
70017031 goto error_guest_mode;
70027032 }
70037033
@@ -7008,9 +7038,8 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 4 unmodified lines
70087038 kvm_state->hdr.vmx.preemption_timer_deadline;
70097039 }
70107040
7011− if (nested_vmx_check_controls(vcpu, vmcs12) ||
7012− nested_vmx_check_host_state(vcpu, vmcs12) ||
7013− nested_vmx_check_guest_state(vcpu, vmcs12, &ignored))
7041+ ret = nested_vmx_check_restored_vmcs12(vcpu);
7042+ if (ret < 0)
70147043 goto error_guest_mode;
70157044
70167045 vmx->nested.dirty_vmcs12 = true;
arch/x86/kvm/vmx/nested.h+1−0
@@ -22,6 +22,7 @@ void nested_vmx_setup_ctls_msrs(struct vmcs_config *vmcs_conf, u32 ept_caps); · 21 unmodified lines
2222 void nested_vmx_hardware_unsetup(void);
2323 __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));
2424 void nested_vmx_set_vmcs_shadowing_bitmap(void);
25+int nested_vmx_check_restored_vmcs12(struct kvm_vcpu *vcpu);
2526 void nested_vmx_free_vcpu(struct kvm_vcpu *vcpu);
2627 enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
2728 bool from_vmentry);
arch/x86/kvm/vmx/vmx.c+7−3
@@ -1149,7 +1149,7 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr, · 1148 unmodified lines
11491149 }
11501150
11511151 vmx_add_auto_msr(&m->guest, msr, guest_val, VM_ENTRY_MSR_LOAD_COUNT, kvm);
1152− vmx_add_auto_msr(&m->guest, msr, host_val, VM_EXIT_MSR_LOAD_COUNT, kvm);
1152+ vmx_add_auto_msr(&m->host, msr, host_val, VM_EXIT_MSR_LOAD_COUNT, kvm);
11531153 }
11541154
11551155 static bool update_transition_efer(struct vcpu_vmx *vmx)
@@ -8528,9 +8528,13 @@ int vmx_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram) · 7372 unmodified lines
85288528 }
85298529
85308530 if (vmx->nested.smm.guest_mode) {
8531+ /* Triple fault if the state is invalid. */
8532+ if (nested_vmx_check_restored_vmcs12(vcpu) < 0)
8533+ return 1;
8534+
85318535 ret = nested_vmx_enter_non_root_mode(vcpu, false);
8532− if (ret)
8533− return ret;
8536+ if (ret != NVMX_VMENTRY_SUCCESS)
8537+ return 1;
85348538
85358539 vmx->nested.nested_run_pending = 1;
85368540 vmx->nested.smm.guest_mode = false;
arch/x86/kvm/x86.c+2−3
@@ -243,7 +243,7 @@ EXPORT_SYMBOL_FOR_KVM_INTERNAL(enable_ipiv); · 242 unmodified lines
243243 bool __read_mostly enable_device_posted_irqs = true;
244244 EXPORT_SYMBOL_FOR_KVM_INTERNAL(enable_device_posted_irqs);
245245
246−const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
246+const struct kvm_stats_desc kvm_vm_stats_desc[] = {
247247 KVM_GENERIC_VM_STATS(),
248248 STATS_DESC_COUNTER(VM, mmu_shadow_zapped),
249249 STATS_DESC_COUNTER(VM, mmu_pte_write),
@@ -269,7 +269,7 @@ const struct kvm_stats_header kvm_vm_stats_header = { · 19 unmodified lines
269269 sizeof(kvm_vm_stats_desc),
270270 };
271271
272−const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
272+const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
273273 KVM_GENERIC_VCPU_STATS(),
274274 STATS_DESC_COUNTER(VCPU, pf_taken),
275275 STATS_DESC_COUNTER(VCPU, pf_fixed),
@@ -4805,7 +4805,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 4529 unmodified lines
48054805 #endif
48064806 case KVM_CAP_NOP_IO_DELAY:
48074807 case KVM_CAP_MP_STATE:
4808− case KVM_CAP_SYNC_MMU:
48094808 case KVM_CAP_USER_NMI:
48104809 case KVM_CAP_IRQ_INJECT_STATUS:
48114810 case KVM_CAP_IOEVENTFD:
arch/x86/mm/extable.c+2−5
@@ -411,14 +411,11 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr) · 410 unmodified lines
411411 return;
412412
413413 if (trapnr == X86_TRAP_UD) {
414− if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
415− /* Skip the ud2. */
416− regs->ip += LEN_UD2;
414+ if (handle_bug(regs))
417415 return;
418− }
419416
420417 /*
421− * If this was a BUG and report_bug returns or if this
418+ * If this was a BUG and handle_bug returns or if this
422419 * was just a normal #UD, we want to continue onward and
423420 * crash.
424421 */
arch/x86/mm/numa.c+8−0
@@ -48,6 +48,8 @@ s16 __apicid_to_node[MAX_LOCAL_APIC] = { · 47 unmodified lines
4848 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
4949 };
5050
51+nodemask_t numa_phys_nodes_parsed __initdata;
52+
5153 int numa_cpu_node(int cpu)
5254 {
5355 u32 apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
@@ -57,6 +59,11 @@ int numa_cpu_node(int cpu) · 3 unmodified lines
5759 return NUMA_NO_NODE;
5860 }
5961
62+int __init num_phys_nodes(void)
63+{
64+ return bitmap_weight(numa_phys_nodes_parsed.bits, MAX_NUMNODES);
65+}
66+
6067 cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
6168 EXPORT_SYMBOL(node_to_cpumask_map);
6269
@@ -210,6 +217,7 @@ static int __init dummy_numa_init(void) · 147 unmodified lines
210217 0LLU, PFN_PHYS(max_pfn) - 1);
211218
212219 node_set(0, numa_nodes_parsed);
220+ node_set(0, numa_phys_nodes_parsed);
213221 numa_add_memblk(0, 0, PFN_PHYS(max_pfn));
214222
215223 return 0;
arch/x86/mm/srat.c+2−0
@@ -57,6 +57,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) · 56 unmodified lines
5757 }
5858 set_apicid_to_node(apic_id, node);
5959 node_set(node, numa_nodes_parsed);
60+ node_set(node, numa_phys_nodes_parsed);
6061 pr_debug("SRAT: PXM %u -> APIC 0x%04x -> Node %u\n", pxm, apic_id, node);
6162 }
6263
@@ -97,6 +98,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) · 34 unmodified lines
9798
9899 set_apicid_to_node(apic_id, node);
99100 node_set(node, numa_nodes_parsed);
101+ node_set(node, numa_phys_nodes_parsed);
100102 pr_debug("SRAT: PXM %u -> APIC 0x%02x -> Node %u\n", pxm, apic_id, node);
101103 }
102104
arch/x86/net/bpf_jit_comp.c+2−11
@@ -438,17 +438,8 @@ static void emit_kcfi(u8 **pprog, u32 hash) · 437 unmodified lines
438438
439439 EMIT1_off32(0xb8, hash); /* movl $hash, %eax */
440440 #ifdef CONFIG_CALL_PADDING
441− EMIT1(0x90);
442− EMIT1(0x90);
443− EMIT1(0x90);
444− EMIT1(0x90);
445− EMIT1(0x90);
446− EMIT1(0x90);
447− EMIT1(0x90);
448− EMIT1(0x90);
449− EMIT1(0x90);
450− EMIT1(0x90);
451− EMIT1(0x90);
441+ for (int i = 0; i < CONFIG_FUNCTION_PADDING_CFI; i++)
442+ EMIT1(0x90);
452443 #endif
453444 EMIT_ENDBR();
454445
arch/x86/platform/efi/efi.c+1−1
@@ -836,7 +836,7 @@ static void __init __efi_enter_virtual_mode(void) · 835 unmodified lines
836836 }
837837
838838 efi_check_for_embedded_firmwares();
839− efi_free_boot_services();
839+ efi_unmap_boot_services();
840840
841841 if (!efi_is_mixed())
842842 efi_native_runtime_setup();
arch/x86/platform/efi/quirks.c+52−3
@@ -341,7 +341,7 @@ void __init efi_reserve_boot_services(void) · 340 unmodified lines
341341
342342 /*
343343 * Because the following memblock_reserve() is paired
344− * with memblock_free_late() for this region in
344+ * with free_reserved_area() for this region in
345345 * efi_free_boot_services(), we must be extremely
346346 * careful not to reserve, and subsequently free,
347347 * critical regions of memory (like the kernel image) or
@@ -404,17 +404,33 @@ static void __init efi_unmap_pages(efi_memory_desc_t *md) · 56 unmodified lines
404404 pr_err("Failed to unmap VA mapping for 0x%llx\n", va);
405405 }
406406
407−void __init efi_free_boot_services(void)
407+struct efi_freeable_range {
408+ u64 start;
409+ u64 end;
410+};
411+
412+static struct efi_freeable_range *ranges_to_free;
413+
414+void __init efi_unmap_boot_services(void)
408415 {
409416 struct efi_memory_map_data data = { 0 };
410417 efi_memory_desc_t *md;
411418 int num_entries = 0;
419+ int idx = 0;
420+ size_t sz;
412421 void *new, *new_md;
413422
414423 /* Keep all regions for /sys/kernel/debug/efi */
415424 if (efi_enabled(EFI_DBG))
416425 return;
417426
427+ sz = sizeof(*ranges_to_free) * efi.memmap.nr_map + 1;
428+ ranges_to_free = kzalloc(sz, GFP_KERNEL);
429+ if (!ranges_to_free) {
430+ pr_err("Failed to allocate storage for freeable EFI regions\n");
431+ return;
432+ }
433+
418434 for_each_efi_memory_desc(md) {
419435 unsigned long long start = md->phys_addr;
420436 unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
@@ -471,7 +487,15 @@ void __init efi_free_boot_services(void) · 50 unmodified lines
471487 start = SZ_1M;
472488 }
473489
474− memblock_free_late(start, size);
490+ /*
491+ * With CONFIG_DEFERRED_STRUCT_PAGE_INIT parts of the memory
492+ * map are still not initialized and we can't reliably free
493+ * memory here.
494+ * Queue the ranges to free at a later point.
495+ */
496+ ranges_to_free[idx].start = start;
497+ ranges_to_free[idx].end = start + size;
498+ idx++;
475499 }
476500
477501 if (!num_entries)
@@ -512,6 +536,31 @@ void __init efi_free_boot_services(void) · 34 unmodified lines
512536 }
513537 }
514538
539+static int __init efi_free_boot_services(void)
540+{
541+ struct efi_freeable_range *range = ranges_to_free;
542+ unsigned long freed = 0;
543+
544+ if (!ranges_to_free)
545+ return 0;
546+
547+ while (range->start) {
548+ void *start = phys_to_virt(range->start);
549+ void *end = phys_to_virt(range->end);
550+
551+ free_reserved_area(start, end, -1, NULL);
552+ freed += (end - start);
553+ range++;
554+ }
555+ kfree(ranges_to_free);
556+
557+ if (freed)
558+ pr_info("Freeing EFI boot services memory: %ldK\n", freed / SZ_1K);
559+
560+ return 0;
561+}
562+arch_initcall(efi_free_boot_services);
563+
515564 /*
516565 * A number of config table entries get remapped to virtual addresses
517566 * after entering EFI virtual mode. However, the kexec kernel requires
arch/x86/platform/pvh/enlighten.c+1−6
@@ -25,11 +25,6 @@ struct hvm_start_info __initdata pvh_start_info; · 24 unmodified lines
2525
2626 const unsigned int __initconst pvh_start_info_sz = sizeof(pvh_start_info);
2727
28−static u64 __init pvh_get_root_pointer(void)
29−{
30− return pvh_start_info.rsdp_paddr;
31−}
32−
3328 /*
3429 * Xen guests are able to obtain the memory map from the hypervisor via the
3530 * HYPERVISOR_memory_op hypercall.
@@ -95,7 +90,7 @@ static void __init init_pvh_bootparams(bool xen_guest) · 59 unmodified lines
9590 pvh_bootparams.hdr.version = (2 << 8) | 12;
9691 pvh_bootparams.hdr.type_of_loader = ((xen_guest ? 0x9 : 0xb) << 4) | 0;
9792
98− x86_init.acpi.get_root_pointer = pvh_get_root_pointer;
93+ pvh_bootparams.acpi_rsdp_addr = pvh_start_info.rsdp_paddr;
9994 }
10095
10196 /*
arch/x86/xen/enlighten_pv.c+1−1
@@ -392,7 +392,7 @@ static void __init xen_init_capabilities(void) · 391 unmodified lines
392392
393393 /*
394394 * Xen PV would need some work to support PCID: CR3 handling as well
395− * as xen_flush_tlb_others() would need updating.
395+ * as xen_flush_tlb_multi() would need updating.
396396 */
397397 setup_clear_cpu_cap(X86_FEATURE_PCID);
398398
arch/x86/xen/mmu_pv.c+9−0
@@ -105,6 +105,9 @@ pte_t xen_make_pte_init(pteval_t pte); · 104 unmodified lines
105105 static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
106106 #endif
107107
108+static pud_t level3_ident_pgt[PTRS_PER_PUD] __page_aligned_bss;
109+static pmd_t level2_ident_pgt[PTRS_PER_PMD] __page_aligned_bss;
110+
108111 /*
109112 * Protects atomic reservation decrease/increase against concurrent increases.
110113 * Also protects non-atomic updates of current_pages and balloon lists.
@@ -1777,6 +1780,12 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) · 1666 unmodified lines
17771780 /* Zap identity mapping */
17781781 init_top_pgt[0] = __pgd(0);
17791782
1783+ init_top_pgt[pgd_index(__PAGE_OFFSET_BASE_L4)].pgd =
1784+ __pa_symbol(level3_ident_pgt) + _KERNPG_TABLE_NOENC;
1785+ init_top_pgt[pgd_index(__START_KERNEL_map)].pgd =
1786+ __pa_symbol(level3_kernel_pgt) + _PAGE_TABLE_NOENC;
1787+ level3_ident_pgt[0].pud = __pa_symbol(level2_ident_pgt) + _KERNPG_TABLE_NOENC;
1788+
17801789 /* Pre-constructed entries are in pfn, so convert to mfn */
17811790 /* L4[273] -> level3_ident_pgt */
17821791 /* L4[511] -> level3_kernel_pgt */
block/blk-map.c+1−2
@@ -398,8 +398,7 @@ static struct bio *bio_copy_kern(struct request *rq, void *data, unsigned int le · 397 unmodified lines
398398 if (op_is_write(op))
399399 memcpy(page_address(page), p, bytes);
400400
401− if (bio_add_page(bio, page, bytes, 0) < bytes)
402− break;
401+ __bio_add_page(bio, page, bytes, 0);
403402
404403 len -= bytes;
405404 p += bytes;
block/blk-mq.c+30−15
@@ -4793,38 +4793,45 @@ static void blk_mq_update_queue_map(struct blk_mq_tag_set *set) · 4792 unmodified lines
47934793 }
47944794 }
47954795
4796−static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
4797− int new_nr_hw_queues)
4796+static struct blk_mq_tags **blk_mq_prealloc_tag_set_tags(
4797+ struct blk_mq_tag_set *set,
4798+ int new_nr_hw_queues)
47984799 {
47994800 struct blk_mq_tags **new_tags;
48004801 int i;
48014802
48024803 if (set->nr_hw_queues >= new_nr_hw_queues)
4803− goto done;
4804+ return NULL;
48044805
48054806 new_tags = kcalloc_node(new_nr_hw_queues, sizeof(struct blk_mq_tags *),
48064807 GFP_KERNEL, set->numa_node);
48074808 if (!new_tags)
4808− return -ENOMEM;
4809+ return ERR_PTR(-ENOMEM);
48094810
48104811 if (set->tags)
48114812 memcpy(new_tags, set->tags, set->nr_hw_queues *
48124813 sizeof(*set->tags));
4813− kfree(set->tags);
4814− set->tags = new_tags;
48154814
48164815 for (i = set->nr_hw_queues; i < new_nr_hw_queues; i++) {
4817− if (!__blk_mq_alloc_map_and_rqs(set, i)) {
4818− while (--i >= set->nr_hw_queues)
4819− __blk_mq_free_map_and_rqs(set, i);
4820− return -ENOMEM;
4816+ if (blk_mq_is_shared_tags(set->flags)) {
4817+ new_tags[i] = set->shared_tags;
4818+ } else {
4819+ new_tags[i] = blk_mq_alloc_map_and_rqs(set, i,
4820+ set->queue_depth);
4821+ if (!new_tags[i])
4822+ goto out_unwind;
48214823 }
48224824 cond_resched();
48234825 }
48244826
4825−done:
4826− set->nr_hw_queues = new_nr_hw_queues;
4827− return 0;
4827+ return new_tags;
4828+out_unwind:
4829+ while (--i >= set->nr_hw_queues) {
4830+ if (!blk_mq_is_shared_tags(set->flags))
4831+ blk_mq_free_map_and_rqs(set, new_tags[i], i);
4832+ }
4833+ kfree(new_tags);
4834+ return ERR_PTR(-ENOMEM);
48284835 }
48294836
48304837 /*
@@ -5113,6 +5120,7 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, · 282 unmodified lines
51135120 unsigned int memflags;
51145121 int i;
51155122 struct xarray elv_tbl;
5123+ struct blk_mq_tags **new_tags;
51165124 bool queues_frozen = false;
51175125
51185126 lockdep_assert_held(&set->tag_list_lock);
@@ -5147,11 +5155,18 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, · 28 unmodified lines
51475155 if (blk_mq_elv_switch_none(q, &elv_tbl))
51485156 goto switch_back;
51495157
5158+ new_tags = blk_mq_prealloc_tag_set_tags(set, nr_hw_queues);
5159+ if (IS_ERR(new_tags))
5160+ goto switch_back;
5161+
51505162 list_for_each_entry(q, &set->tag_list, tag_set_list)
51515163 blk_mq_freeze_queue_nomemsave(q);
51525164 queues_frozen = true;
5153− if (blk_mq_realloc_tag_set_tags(set, nr_hw_queues) < 0)
5154− goto switch_back;
5165+ if (new_tags) {
5166+ kfree(set->tags);
5167+ set->tags = new_tags;
5168+ }
5169+ set->nr_hw_queues = nr_hw_queues;
51555170
51565171 fallback:
51575172 blk_mq_update_queue_map(set);
block/blk-sysfs.c+7−1
@@ -78,8 +78,14 @@ queue_requests_store(struct gendisk *disk, const char *page, size_t count) · 77 unmodified lines
7878 /*
7979 * Serialize updating nr_requests with concurrent queue_requests_store()
8080 * and switching elevator.
81+ *
82+ * Use trylock to avoid circular lock dependency with kernfs active
83+ * reference during concurrent disk deletion:
84+ * update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del)
85+ * kn->active -> update_nr_hwq_lock (via this sysfs write path)
8186 */
82− down_write(&set->update_nr_hwq_lock);
87+ if (!down_write_trylock(&set->update_nr_hwq_lock))
88+ return -EBUSY;
8389
8490 if (nr == q->nr_requests)
8591 goto unlock;
block/elevator.c+11−1
@@ -807,7 +807,16 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf, · 806 unmodified lines
807807 elv_iosched_load_module(ctx.name);
808808 ctx.type = elevator_find_get(ctx.name);
809809
810− down_read(&set->update_nr_hwq_lock);
810+ /*
811+ * Use trylock to avoid circular lock dependency with kernfs active
812+ * reference during concurrent disk deletion:
813+ * update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del)
814+ * kn->active -> update_nr_hwq_lock (via this sysfs write path)
815+ */
816+ if (!down_read_trylock(&set->update_nr_hwq_lock)) {
817+ ret = -EBUSY;
818+ goto out;
819+ }
811820 if (!blk_queue_no_elv_switch(q)) {
812821 ret = elevator_change(q, &ctx);
813822 if (!ret)
@@ -817,6 +826,7 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf, · 3 unmodified lines
817826 }
818827 up_read(&set->update_nr_hwq_lock);
819828
829+out:
820830 if (ctx.type)
821831 elevator_put(ctx.type);
822832 return ret;
crypto/Kconfig+0−9
@@ -876,8 +876,6 @@ config CRYPTO_BLAKE2B · 875 unmodified lines
876876 - blake2b-384
877877 - blake2b-512
878878
879− Used by the btrfs filesystem.
880−
881879 See https://blake2.net for further information.
882880
883881 config CRYPTO_CMAC
@@ -965,7 +963,6 @@ config CRYPTO_SHA256 · 81 unmodified lines
965963 10118-3), including HMAC support.
966964
967965 This is required for IPsec AH (XFRM_AH) and IPsec ESP (XFRM_ESP).
968− Used by the btrfs filesystem, Ceph, NFS, and SMB.
969966
970967 config CRYPTO_SHA512
971968 tristate "SHA-384 and SHA-512"
@@ -1039,8 +1036,6 @@ config CRYPTO_XXHASH · 67 unmodified lines
10391036
10401037 Extremely fast, working at speeds close to RAM limits.
10411038
1042− Used by the btrfs filesystem.
1043−
10441039 endmenu
10451040
10461041 menu "CRCs (cyclic redundancy checks)"
@@ -1058,8 +1053,6 @@ config CRYPTO_CRC32C · 11 unmodified lines
10581053 on Communications, Vol. 41, No. 6, June 1993, selected for use with
10591054 iSCSI.
10601055
1061− Used by btrfs, ext4, jbd2, NVMeoF/TCP, and iSCSI.
1062−
10631056 config CRYPTO_CRC32
10641057 tristate "CRC32"
10651058 select CRYPTO_HASH
@@ -1067,8 +1060,6 @@ config CRYPTO_CRC32 · 1 unmodified line
10671060 help
10681061 CRC32 CRC algorithm (IEEE 802.3)
10691062
1070− Used by RoCEv2 and f2fs.
1071−
10721063 endmenu
10731064
10741065 menu "Compression"
crypto/testmgr.c+2−2
@@ -4132,7 +4132,7 @@ static const struct alg_test_desc alg_test_descs[] = { · 4131 unmodified lines
41324132 .fips_allowed = 1,
41334133 }, {
41344134 .alg = "authenc(hmac(sha224),cbc(aes))",
4135− .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
4135+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-lib))",
41364136 .test = alg_test_aead,
41374137 .suite = {
41384138 .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
@@ -4194,7 +4194,7 @@ static const struct alg_test_desc alg_test_descs[] = { · 55 unmodified lines
41944194 .fips_allowed = 1,
41954195 }, {
41964196 .alg = "authenc(hmac(sha384),cbc(aes))",
4197− .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
4197+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-lib))",
41984198 .test = alg_test_aead,
41994199 .suite = {
42004200 .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
drivers/accel/amdxdna/aie2_ctx.c+17−28
@@ -23,9 +23,9 @@ · 22 unmodified lines
2323 #include "amdxdna_pci_drv.h"
2424 #include "amdxdna_pm.h"
2525
26−static bool force_cmdlist;
26+static bool force_cmdlist = true;
2727 module_param(force_cmdlist, bool, 0600);
28−MODULE_PARM_DESC(force_cmdlist, "Force use command list (Default false)");
28+MODULE_PARM_DESC(force_cmdlist, "Force use command list (Default true)");
2929
3030 #define HWCTX_MAX_TIMEOUT 60000 /* milliseconds */
3131
@@ -53,6 +53,7 @@ static void aie2_hwctx_stop(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwct · 21 unmodified lines
5353 {
5454 drm_sched_stop(&hwctx->priv->sched, bad_job);
5555 aie2_destroy_context(xdna->dev_handle, hwctx);
56+ drm_sched_start(&hwctx->priv->sched, 0);
5657 }
5758
5859 static int aie2_hwctx_restart(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwctx)
@@ -80,7 +81,6 @@ static int aie2_hwctx_restart(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hw · 21 unmodified lines
8081 }
8182
8283 out:
83− drm_sched_start(&hwctx->priv->sched, 0);
8484 XDNA_DBG(xdna, "%s restarted, ret %d", hwctx->name, ret);
8585 return ret;
8686 }
@@ -165,7 +165,6 @@ aie2_sched_notify(struct amdxdna_sched_job *job) · 78 unmodified lines
165165
166166 trace_xdna_job(&job->base, job->hwctx->name, "signaled fence", job->seq);
167167
168− amdxdna_pm_suspend_put(job->hwctx->client->xdna);
169168 job->hwctx->priv->completed++;
170169 dma_fence_signal(fence);
171170
@@ -186,13 +185,13 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size) · 14 unmodified lines
186185 cmd_abo = job->cmd_bo;
187186
188187 if (unlikely(job->job_timeout)) {
189− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
188+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
190189 ret = -EINVAL;
191190 goto out;
192191 }
193192
194193 if (unlikely(!data) || unlikely(size != sizeof(u32))) {
195− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
194+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
196195 ret = -EINVAL;
197196 goto out;
198197 }
@@ -202,7 +201,7 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size) · 3 unmodified lines
202201 if (status == AIE2_STATUS_SUCCESS)
203202 amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_COMPLETED);
204203 else
205− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
204+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ERROR);
206205
207206 out:
208207 aie2_sched_notify(job);
@@ -244,13 +243,13 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size) · 35 unmodified lines
244243 cmd_abo = job->cmd_bo;
245244
246245 if (unlikely(job->job_timeout)) {
247− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
246+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
248247 ret = -EINVAL;
249248 goto out;
250249 }
251250
252251 if (unlikely(!data) || unlikely(size != sizeof(u32) * 3)) {
253− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
252+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
254253 ret = -EINVAL;
255254 goto out;
256255 }
@@ -270,19 +269,12 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size) · 13 unmodified lines
270269 fail_cmd_idx, fail_cmd_status);
271270
272271 if (fail_cmd_status == AIE2_STATUS_SUCCESS) {
273− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
272+ amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ABORT);
274273 ret = -EINVAL;
275− goto out;
274+ } else {
275+ amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ERROR);
276276 }
277− amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
278−
279− if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
280− struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
281277
282− cc->error_index = fail_cmd_idx;
283− if (cc->error_index >= cc->command_count)
284− cc->error_index = 0;
285− }
286278 out:
287279 aie2_sched_notify(job);
288280 return ret;
@@ -306,10 +298,6 @@ aie2_sched_job_run(struct drm_sched_job *sched_job) · 17 unmodified lines
306298 kref_get(&job->refcnt);
307299 fence = dma_fence_get(job->fence);
308300
309− ret = amdxdna_pm_resume_get(hwctx->client->xdna);
310− if (ret)
311− goto out;
312−
313301 if (job->drv_cmd) {
314302 switch (job->drv_cmd->opcode) {
315303 case SYNC_DEBUG_BO:
@@ -336,7 +324,6 @@ aie2_sched_job_run(struct drm_sched_job *sched_job) · 20 unmodified lines
336324
337325 out:
338326 if (ret) {
339− amdxdna_pm_suspend_put(hwctx->client->xdna);
340327 dma_fence_put(job->fence);
341328 aie2_job_put(job);
342329 mmput(job->mm);
@@ -497,7 +484,7 @@ static void aie2_release_resource(struct amdxdna_hwctx *hwctx) · 154 unmodified lines
497484
498485 if (AIE2_FEATURE_ON(xdna->dev_handle, AIE2_TEMPORAL_ONLY)) {
499486 ret = aie2_destroy_context(xdna->dev_handle, hwctx);
500− if (ret)
487+ if (ret && ret != -ENODEV)
501488 XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret);
502489 } else {
503490 ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx);
@@ -629,7 +616,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx) · 125 unmodified lines
629616 goto free_entity;
630617 }
631618
632− ret = amdxdna_pm_resume_get(xdna);
619+ ret = amdxdna_pm_resume_get_locked(xdna);
633620 if (ret)
634621 goto free_col_list;
635622
@@ -760,7 +747,7 @@ static int aie2_hwctx_cu_config(struct amdxdna_hwctx *hwctx, void *buf, u32 size · 124 unmodified lines
760747 if (!hwctx->cus)
761748 return -ENOMEM;
762749
763− ret = amdxdna_pm_resume_get(xdna);
750+ ret = amdxdna_pm_resume_get_locked(xdna);
764751 if (ret)
765752 goto free_cus;
766753
@@ -1070,6 +1057,8 @@ void aie2_hmm_invalidate(struct amdxdna_gem_obj *abo, · 303 unmodified lines
10701057
10711058 ret = dma_resv_wait_timeout(gobj->resv, DMA_RESV_USAGE_BOOKKEEP,
10721059 true, MAX_SCHEDULE_TIMEOUT);
1073− if (!ret || ret == -ERESTARTSYS)
1060+ if (!ret)
10741061 XDNA_ERR(xdna, "Failed to wait for bo, ret %ld", ret);
1062+ else if (ret == -ERESTARTSYS)
1063+ XDNA_DBG(xdna, "Wait for bo interrupted by signal");
10751064 }
drivers/accel/amdxdna/aie2_message.c+38−13
@@ -40,11 +40,8 @@ static int aie2_send_mgmt_msg_wait(struct amdxdna_dev_hdl *ndev, · 39 unmodified lines
4040 return -ENODEV;
4141
4242 ret = xdna_send_msg_wait(xdna, ndev->mgmt_chann, msg);
43− if (ret == -ETIME) {
44− xdna_mailbox_stop_channel(ndev->mgmt_chann);
45− xdna_mailbox_destroy_channel(ndev->mgmt_chann);
46− ndev->mgmt_chann = NULL;
47− }
43+ if (ret == -ETIME)
44+ aie2_destroy_mgmt_chann(ndev);
4845
4946 if (!ret && *hdl->status != AIE2_STATUS_SUCCESS) {
5047 XDNA_ERR(xdna, "command opcode 0x%x failed, status 0x%x",
@@ -216,8 +213,10 @@ static int aie2_destroy_context_req(struct amdxdna_dev_hdl *ndev, u32 id) · 165 unmodified lines
216213
217214 req.context_id = id;
218215 ret = aie2_send_mgmt_msg_wait(ndev, &msg);
219− if (ret)
216+ if (ret && ret != -ENODEV)
220217 XDNA_WARN(xdna, "Destroy context failed, ret %d", ret);
218+ else if (ret == -ENODEV)
219+ XDNA_DBG(xdna, "Destroy context: device already stopped");
221220
222221 return ret;
223222 }
@@ -294,13 +293,20 @@ int aie2_create_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwct · 70 unmodified lines
294293 }
295294
296295 intr_reg = i2x.mb_head_ptr_reg + 4;
297− hwctx->priv->mbox_chann = xdna_mailbox_create_channel(ndev->mbox, &x2i, &i2x,
298− intr_reg, ret);
296+ hwctx->priv->mbox_chann = xdna_mailbox_alloc_channel(ndev->mbox);
299297 if (!hwctx->priv->mbox_chann) {
300298 XDNA_ERR(xdna, "Not able to create channel");
301299 ret = -EINVAL;
302300 goto del_ctx_req;
303301 }
302+
303+ ret = xdna_mailbox_start_channel(hwctx->priv->mbox_chann, &x2i, &i2x,
304+ intr_reg, ret);
305+ if (ret) {
306+ XDNA_ERR(xdna, "Not able to create channel");
307+ ret = -EINVAL;
308+ goto free_channel;
309+ }
304310 ndev->hwctx_num++;
305311
306312 XDNA_DBG(xdna, "Mailbox channel irq: %d, msix_id: %d", ret, resp.msix_id);
@@ -308,6 +314,8 @@ int aie2_create_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwct · 1 unmodified line
308314
309315 return 0;
310316
317+free_channel:
318+ xdna_mailbox_free_channel(hwctx->priv->mbox_chann);
311319 del_ctx_req:
312320 aie2_destroy_context_req(ndev, hwctx->fw_ctx_id);
313321 return ret;
@@ -318,9 +326,12 @@ int aie2_destroy_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwc · 4 unmodified lines
318326 struct amdxdna_dev *xdna = ndev->xdna;
319327 int ret;
320328
329+ if (!hwctx->priv->mbox_chann)
330+ return 0;
331+
321332 xdna_mailbox_stop_channel(hwctx->priv->mbox_chann);
322333 ret = aie2_destroy_context_req(ndev, hwctx->fw_ctx_id);
323− xdna_mailbox_destroy_channel(hwctx->priv->mbox_chann);
334+ xdna_mailbox_free_channel(hwctx->priv->mbox_chann);
324335 XDNA_DBG(xdna, "Destroyed fw ctx %d", hwctx->fw_ctx_id);
325336 hwctx->priv->mbox_chann = NULL;
326337 hwctx->fw_ctx_id = -1;
@@ -694,11 +705,11 @@ aie2_cmdlist_fill_npu_cf(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *siz · 367 unmodified lines
694705 u32 cmd_len;
695706 void *cmd;
696707
697− memset(npu_slot, 0, sizeof(*npu_slot));
698708 cmd = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
699709 if (*size < sizeof(*npu_slot) + cmd_len)
700710 return -EINVAL;
701711
712+ memset(npu_slot, 0, sizeof(*npu_slot));
702713 npu_slot->cu_idx = amdxdna_cmd_get_cu_idx(cmd_bo);
703714 if (npu_slot->cu_idx == INVALID_CU_IDX)
704715 return -EINVAL;
@@ -719,7 +730,6 @@ aie2_cmdlist_fill_npu_dpu(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si · 14 unmodified lines
719730 u32 cmd_len;
720731 u32 arg_sz;
721732
722− memset(npu_slot, 0, sizeof(*npu_slot));
723733 sn = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
724734 arg_sz = cmd_len - sizeof(*sn);
725735 if (cmd_len < sizeof(*sn) || arg_sz > MAX_NPU_ARGS_SIZE)
@@ -728,6 +738,7 @@ aie2_cmdlist_fill_npu_dpu(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si · 2 unmodified lines
728738 if (*size < sizeof(*npu_slot) + arg_sz)
729739 return -EINVAL;
730740
741+ memset(npu_slot, 0, sizeof(*npu_slot));
731742 npu_slot->cu_idx = amdxdna_cmd_get_cu_idx(cmd_bo);
732743 if (npu_slot->cu_idx == INVALID_CU_IDX)
733744 return -EINVAL;
@@ -751,7 +762,6 @@ aie2_cmdlist_fill_npu_preempt(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t · 17 unmodified lines
751762 u32 cmd_len;
752763 u32 arg_sz;
753764
754− memset(npu_slot, 0, sizeof(*npu_slot));
755765 pd = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
756766 arg_sz = cmd_len - sizeof(*pd);
757767 if (cmd_len < sizeof(*pd) || arg_sz > MAX_NPU_ARGS_SIZE)
@@ -760,6 +770,7 @@ aie2_cmdlist_fill_npu_preempt(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t · 2 unmodified lines
760770 if (*size < sizeof(*npu_slot) + arg_sz)
761771 return -EINVAL;
762772
773+ memset(npu_slot, 0, sizeof(*npu_slot));
763774 npu_slot->cu_idx = amdxdna_cmd_get_cu_idx(cmd_bo);
764775 if (npu_slot->cu_idx == INVALID_CU_IDX)
765776 return -EINVAL;
@@ -787,7 +798,6 @@ aie2_cmdlist_fill_npu_elf(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si · 21 unmodified lines
787798 u32 cmd_len;
788799 u32 arg_sz;
789800
790− memset(npu_slot, 0, sizeof(*npu_slot));
791801 pd = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
792802 arg_sz = cmd_len - sizeof(*pd);
793803 if (cmd_len < sizeof(*pd) || arg_sz > MAX_NPU_ARGS_SIZE)
@@ -796,6 +806,7 @@ aie2_cmdlist_fill_npu_elf(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si · 2 unmodified lines
796806 if (*size < sizeof(*npu_slot) + arg_sz)
797807 return -EINVAL;
798808
809+ memset(npu_slot, 0, sizeof(*npu_slot));
799810 npu_slot->type = EXEC_NPU_TYPE_ELF;
800811 npu_slot->inst_buf_addr = pd->inst_buf;
801812 npu_slot->save_buf_addr = pd->save_buf;
@@ -909,6 +920,20 @@ void aie2_msg_init(struct amdxdna_dev_hdl *ndev) · 107 unmodified lines
909920 ndev->exec_msg_ops = &legacy_exec_message_ops;
910921 }
911922
923+void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev)
924+{
925+ struct amdxdna_dev *xdna = ndev->xdna;
926+
927+ drm_WARN_ON(&xdna->ddev, !mutex_is_locked(&xdna->dev_lock));
928+
929+ if (!ndev->mgmt_chann)
930+ return;
931+
932+ xdna_mailbox_stop_channel(ndev->mgmt_chann);
933+ xdna_mailbox_free_channel(ndev->mgmt_chann);
934+ ndev->mgmt_chann = NULL;
935+}
936+
912937 static inline struct amdxdna_gem_obj *
913938 aie2_cmdlist_get_cmd_buf(struct amdxdna_sched_job *job)
914939 {
drivers/accel/amdxdna/aie2_pci.c+64−38
@@ -32,6 +32,11 @@ static int aie2_max_col = XRS_MAX_COL; · 31 unmodified lines
3232 module_param(aie2_max_col, uint, 0600);
3333 MODULE_PARM_DESC(aie2_max_col, "Maximum column could be used");
3434
35+static char *npu_fw[] = {
36+ "npu_7.sbin",
37+ "npu.sbin"
38+};
39+
3540 /*
3641 * The management mailbox channel is allocated by firmware.
3742 * The related register and ring buffer information is on SRAM BAR.
@@ -323,10 +328,9 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna) · 285 unmodified lines
323328 return;
324329 }
325330
331+ aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
326332 aie2_mgmt_fw_fini(ndev);
327− xdna_mailbox_stop_channel(ndev->mgmt_chann);
328− xdna_mailbox_destroy_channel(ndev->mgmt_chann);
329− ndev->mgmt_chann = NULL;
333+ aie2_destroy_mgmt_chann(ndev);
330334 drmm_kfree(&xdna->ddev, ndev->mbox);
331335 ndev->mbox = NULL;
332336 aie2_psp_stop(ndev->psp_hdl);
@@ -357,10 +361,29 @@ static int aie2_hw_start(struct amdxdna_dev *xdna) · 24 unmodified lines
357361 }
358362 pci_set_master(pdev);
359363
364+ mbox_res.ringbuf_base = ndev->sram_base;
365+ mbox_res.ringbuf_size = pci_resource_len(pdev, xdna->dev_info->sram_bar);
366+ mbox_res.mbox_base = ndev->mbox_base;
367+ mbox_res.mbox_size = MBOX_SIZE(ndev);
368+ mbox_res.name = "xdna_mailbox";
369+ ndev->mbox = xdnam_mailbox_create(&xdna->ddev, &mbox_res);
370+ if (!ndev->mbox) {
371+ XDNA_ERR(xdna, "failed to create mailbox device");
372+ ret = -ENODEV;
373+ goto disable_dev;
374+ }
375+
376+ ndev->mgmt_chann = xdna_mailbox_alloc_channel(ndev->mbox);
377+ if (!ndev->mgmt_chann) {
378+ XDNA_ERR(xdna, "failed to alloc channel");
379+ ret = -ENODEV;
380+ goto disable_dev;
381+ }
382+
360383 ret = aie2_smu_init(ndev);
361384 if (ret) {
362385 XDNA_ERR(xdna, "failed to init smu, ret %d", ret);
363− goto disable_dev;
386+ goto free_channel;
364387 }
365388
366389 ret = aie2_psp_start(ndev->psp_hdl);
@@ -375,18 +398,6 @@ static int aie2_hw_start(struct amdxdna_dev *xdna) · 8 unmodified lines
375398 goto stop_psp;
376399 }
377400
378− mbox_res.ringbuf_base = ndev->sram_base;
379− mbox_res.ringbuf_size = pci_resource_len(pdev, xdna->dev_info->sram_bar);
380− mbox_res.mbox_base = ndev->mbox_base;
381− mbox_res.mbox_size = MBOX_SIZE(ndev);
382− mbox_res.name = "xdna_mailbox";
383− ndev->mbox = xdnam_mailbox_create(&xdna->ddev, &mbox_res);
384− if (!ndev->mbox) {
385− XDNA_ERR(xdna, "failed to create mailbox device");
386− ret = -ENODEV;
387− goto stop_psp;
388− }
389−
390401 mgmt_mb_irq = pci_irq_vector(pdev, ndev->mgmt_chan_idx);
391402 if (mgmt_mb_irq < 0) {
392403 ret = mgmt_mb_irq;
@@ -395,52 +406,55 @@ static int aie2_hw_start(struct amdxdna_dev *xdna) · 2 unmodified lines
395406 }
396407
397408 xdna_mailbox_intr_reg = ndev->mgmt_i2x.mb_head_ptr_reg + 4;
398− ndev->mgmt_chann = xdna_mailbox_create_channel(ndev->mbox,
399− &ndev->mgmt_x2i,
400− &ndev->mgmt_i2x,
401− xdna_mailbox_intr_reg,
402− mgmt_mb_irq);
403− if (!ndev->mgmt_chann) {
404− XDNA_ERR(xdna, "failed to create management mailbox channel");
409+ ret = xdna_mailbox_start_channel(ndev->mgmt_chann,
410+ &ndev->mgmt_x2i,
411+ &ndev->mgmt_i2x,
412+ xdna_mailbox_intr_reg,
413+ mgmt_mb_irq);
414+ if (ret) {
415+ XDNA_ERR(xdna, "failed to start management mailbox channel");
405416 ret = -EINVAL;
406417 goto stop_psp;
407418 }
408419
409− ret = aie2_pm_init(ndev);
420+ ret = aie2_mgmt_fw_init(ndev);
410421 if (ret) {
411− XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
412− goto destroy_mgmt_chann;
422+ XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
423+ goto stop_fw;
413424 }
414425
415− ret = aie2_mgmt_fw_init(ndev);
426+ ret = aie2_pm_init(ndev);
416427 if (ret) {
417− XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
418− goto destroy_mgmt_chann;
428+ XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
429+ goto stop_fw;
419430 }
420431
421432 ret = aie2_mgmt_fw_query(ndev);
422433 if (ret) {
423434 XDNA_ERR(xdna, "failed to query fw, ret %d", ret);
424− goto destroy_mgmt_chann;
435+ goto stop_fw;
425436 }
426437
427438 ret = aie2_error_async_events_alloc(ndev);
428439 if (ret) {
429440 XDNA_ERR(xdna, "Allocate async events failed, ret %d", ret);
430− goto destroy_mgmt_chann;
441+ goto stop_fw;
431442 }
432443
433444 ndev->dev_status = AIE2_DEV_START;
434445
435446 return 0;
436447
437−destroy_mgmt_chann:
448+stop_fw:
449+ aie2_suspend_fw(ndev);
438450 xdna_mailbox_stop_channel(ndev->mgmt_chann);
439− xdna_mailbox_destroy_channel(ndev->mgmt_chann);
440451 stop_psp:
441452 aie2_psp_stop(ndev->psp_hdl);
442453 fini_smu:
443454 aie2_smu_fini(ndev);
455+free_channel:
456+ xdna_mailbox_free_channel(ndev->mgmt_chann);
457+ ndev->mgmt_chann = NULL;
444458 disable_dev:
445459 pci_disable_device(pdev);
446460
@@ -451,7 +465,6 @@ static int aie2_hw_suspend(struct amdxdna_dev *xdna) · 4 unmodified lines
451465 {
452466 struct amdxdna_client *client;
453467
454− guard(mutex)(&xdna->dev_lock);
455468 list_for_each_entry(client, &xdna->client_list, node)
456469 aie2_hwctx_suspend(client);
457470
@@ -489,6 +502,7 @@ static int aie2_init(struct amdxdna_dev *xdna) · 31 unmodified lines
489502 struct psp_config psp_conf;
490503 const struct firmware *fw;
491504 unsigned long bars = 0;
505+ char *fw_full_path;
492506 int i, nvec, ret;
493507
494508 if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
@@ -503,7 +517,19 @@ static int aie2_init(struct amdxdna_dev *xdna) · 8 unmodified lines
503517 ndev->priv = xdna->dev_info->dev_priv;
504518 ndev->xdna = xdna;
505519
506− ret = request_firmware(&fw, ndev->priv->fw_path, &pdev->dev);
520+ for (i = 0; i < ARRAY_SIZE(npu_fw); i++) {
521+ fw_full_path = kasprintf(GFP_KERNEL, "%s%s", ndev->priv->fw_path, npu_fw[i]);
522+ if (!fw_full_path)
523+ return -ENOMEM;
524+
525+ ret = firmware_request_nowarn(&fw, fw_full_path, &pdev->dev);
526+ kfree(fw_full_path);
527+ if (!ret) {
528+ XDNA_INFO(xdna, "Load firmware %s%s", ndev->priv->fw_path, npu_fw[i]);
529+ break;
530+ }
531+ }
532+
507533 if (ret) {
508534 XDNA_ERR(xdna, "failed to request_firmware %s, ret %d",
509535 ndev->priv->fw_path, ret);
@@ -951,7 +977,7 @@ static int aie2_get_info(struct amdxdna_client *client, struct amdxdna_drm_get_i · 441 unmodified lines
951977 if (!drm_dev_enter(&xdna->ddev, &idx))
952978 return -ENODEV;
953979
954− ret = amdxdna_pm_resume_get(xdna);
980+ ret = amdxdna_pm_resume_get_locked(xdna);
955981 if (ret)
956982 goto dev_exit;
957983
@@ -1044,7 +1070,7 @@ static int aie2_get_array(struct amdxdna_client *client, · 86 unmodified lines
10441070 if (!drm_dev_enter(&xdna->ddev, &idx))
10451071 return -ENODEV;
10461072
1047− ret = amdxdna_pm_resume_get(xdna);
1073+ ret = amdxdna_pm_resume_get_locked(xdna);
10481074 if (ret)
10491075 goto dev_exit;
10501076
@@ -1134,7 +1160,7 @@ static int aie2_set_state(struct amdxdna_client *client, · 83 unmodified lines
11341160 if (!drm_dev_enter(&xdna->ddev, &idx))
11351161 return -ENODEV;
11361162
1137− ret = amdxdna_pm_resume_get(xdna);
1163+ ret = amdxdna_pm_resume_get_locked(xdna);
11381164 if (ret)
11391165 goto dev_exit;
11401166
drivers/accel/amdxdna/aie2_pci.h+1−0
@@ -303,6 +303,7 @@ int aie2_get_array_async_error(struct amdxdna_dev_hdl *ndev, · 302 unmodified lines
303303
304304 /* aie2_message.c */
305305 void aie2_msg_init(struct amdxdna_dev_hdl *ndev);
306+void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev);
306307 int aie2_suspend_fw(struct amdxdna_dev_hdl *ndev);
307308 int aie2_resume_fw(struct amdxdna_dev_hdl *ndev);
308309 int aie2_set_runtime_cfg(struct amdxdna_dev_hdl *ndev, u32 type, u64 value);
drivers/accel/amdxdna/aie2_pm.c+1−1
@@ -31,7 +31,7 @@ int aie2_pm_set_dpm(struct amdxdna_dev_hdl *ndev, u32 dpm_level) · 30 unmodified lines
3131 {
3232 int ret;
3333
34− ret = amdxdna_pm_resume_get(ndev->xdna);
34+ ret = amdxdna_pm_resume_get_locked(ndev->xdna);
3535 if (ret)
3636 return ret;
3737
drivers/accel/amdxdna/amdxdna_ctx.c+48−13
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include "amdxdna_ctx.h"
1818 #include "amdxdna_gem.h"
1919 #include "amdxdna_pci_drv.h"
20+#include "amdxdna_pm.h"
2021
2122 #define MAX_HWCTX_ID 255
2223 #define MAX_ARG_COUNT 4095
@@ -104,7 +105,10 @@ void *amdxdna_cmd_get_payload(struct amdxdna_gem_obj *abo, u32 *size) · 81 unmodified lines
104105
105106 if (size) {
106107 count = FIELD_GET(AMDXDNA_CMD_COUNT, cmd->header);
107− if (unlikely(count <= num_masks)) {
108+ if (unlikely(count <= num_masks ||
109+ count * sizeof(u32) +
110+ offsetof(struct amdxdna_cmd, data[0]) >
111+ abo->mem.size)) {
108112 *size = 0;
109113 return NULL;
110114 }
@@ -132,6 +136,33 @@ u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo) · 21 unmodified lines
132136 return INVALID_CU_IDX;
133137 }
134138
139+int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
140+ struct amdxdna_sched_job *job, u32 cmd_idx,
141+ enum ert_cmd_state error_state)
142+{
143+ struct amdxdna_client *client = job->hwctx->client;
144+ struct amdxdna_cmd *cmd = abo->mem.kva;
145+ struct amdxdna_cmd_chain *cc = NULL;
146+
147+ cmd->header &= ~AMDXDNA_CMD_STATE;
148+ cmd->header |= FIELD_PREP(AMDXDNA_CMD_STATE, error_state);
149+
150+ if (amdxdna_cmd_get_op(abo) == ERT_CMD_CHAIN) {
151+ cc = amdxdna_cmd_get_payload(abo, NULL);
152+ cc->error_index = (cmd_idx < cc->command_count) ? cmd_idx : 0;
153+ abo = amdxdna_gem_get_obj(client, cc->data[0], AMDXDNA_BO_CMD);
154+ if (!abo)
155+ return -EINVAL;
156+ cmd = abo->mem.kva;
157+ }
158+
159+ memset(cmd->data, 0xff, abo->mem.size - sizeof(*cmd));
160+ if (cc)
161+ amdxdna_gem_put_obj(abo);
162+
163+ return 0;
164+}
165+
135166 /*
136167 * This should be called in close() and remove(). DO NOT call in other syscalls.
137168 * This guarantee that when hwctx and resources will be released, if user
@@ -266,9 +297,9 @@ int amdxdna_drm_config_hwctx_ioctl(struct drm_device *dev, void *data, struct dr · 128 unmodified lines
266297 struct amdxdna_drm_config_hwctx *args = data;
267298 struct amdxdna_dev *xdna = to_xdna_dev(dev);
268299 struct amdxdna_hwctx *hwctx;
269− int ret, idx;
270300 u32 buf_size;
271301 void *buf;
302+ int ret;
272303 u64 val;
273304
274305 if (XDNA_MBZ_DBG(xdna, &args->pad, sizeof(args->pad)))
@@ -310,20 +341,17 @@ int amdxdna_drm_config_hwctx_ioctl(struct drm_device *dev, void *data, struct dr · 35 unmodified lines
310341 return -EINVAL;
311342 }
312343
313− mutex_lock(&xdna->dev_lock);
314− idx = srcu_read_lock(&client->hwctx_srcu);
344+ guard(mutex)(&xdna->dev_lock);
315345 hwctx = xa_load(&client->hwctx_xa, args->handle);
316346 if (!hwctx) {
317347 XDNA_DBG(xdna, "PID %d failed to get hwctx %d", client->pid, args->handle);
318348 ret = -EINVAL;
319− goto unlock_srcu;
349+ goto free_buf;
320350 }
321351
322352 ret = xdna->dev_info->ops->hwctx_config(hwctx, args->param_type, val, buf, buf_size);
323353
324−unlock_srcu:
325− srcu_read_unlock(&client->hwctx_srcu, idx);
326− mutex_unlock(&xdna->dev_lock);
354+free_buf:
327355 kfree(buf);
328356 return ret;
329357 }
@@ -334,7 +362,7 @@ int amdxdna_hwctx_sync_debug_bo(struct amdxdna_client *client, u32 debug_bo_hdl) · 4 unmodified lines
334362 struct amdxdna_hwctx *hwctx;
335363 struct amdxdna_gem_obj *abo;
336364 struct drm_gem_object *gobj;
337− int ret, idx;
365+ int ret;
338366
339367 if (!xdna->dev_info->ops->hwctx_sync_debug_bo)
340368 return -EOPNOTSUPP;
@@ -345,17 +373,15 @@ int amdxdna_hwctx_sync_debug_bo(struct amdxdna_client *client, u32 debug_bo_hdl) · 4 unmodified lines
345373
346374 abo = to_xdna_obj(gobj);
347375 guard(mutex)(&xdna->dev_lock);
348− idx = srcu_read_lock(&client->hwctx_srcu);
349376 hwctx = xa_load(&client->hwctx_xa, abo->assigned_hwctx);
350377 if (!hwctx) {
351378 ret = -EINVAL;
352− goto unlock_srcu;
379+ goto put_obj;
353380 }
354381
355382 ret = xdna->dev_info->ops->hwctx_sync_debug_bo(hwctx, debug_bo_hdl);
356383
357−unlock_srcu:
358− srcu_read_unlock(&client->hwctx_srcu, idx);
384+put_obj:
359385 drm_gem_object_put(gobj);
360386 return ret;
361387 }
@@ -420,6 +446,7 @@ put_shmem_bo: · 58 unmodified lines
420446 void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job)
421447 {
422448 trace_amdxdna_debug_point(job->hwctx->name, job->seq, "job release");
449+ amdxdna_pm_suspend_put(job->hwctx->client->xdna);
423450 amdxdna_arg_bos_put(job);
424451 amdxdna_gem_put_obj(job->cmd_bo);
425452 dma_fence_put(job->fence);
@@ -457,6 +484,12 @@ int amdxdna_cmd_submit(struct amdxdna_client *client, · 31 unmodified lines
457484 goto cmd_put;
458485 }
459486
487+ ret = amdxdna_pm_resume_get(xdna);
488+ if (ret) {
489+ XDNA_ERR(xdna, "Resume failed, ret %d", ret);
490+ goto put_bos;
491+ }
492+
460493 idx = srcu_read_lock(&client->hwctx_srcu);
461494 hwctx = xa_load(&client->hwctx_xa, hwctx_hdl);
462495 if (!hwctx) {
@@ -497,6 +530,8 @@ put_fence: · 34 unmodified lines
497530 dma_fence_put(job->fence);
498531 unlock_srcu:
499532 srcu_read_unlock(&client->hwctx_srcu, idx);
533+ amdxdna_pm_suspend_put(xdna);
534+put_bos:
500535 amdxdna_arg_bos_put(job);
501536 cmd_put:
502537 amdxdna_gem_put_obj(job->cmd_bo);
drivers/accel/amdxdna/amdxdna_ctx.h+3−0
@@ -167,6 +167,9 @@ amdxdna_cmd_get_state(struct amdxdna_gem_obj *abo) · 166 unmodified lines
167167
168168 void *amdxdna_cmd_get_payload(struct amdxdna_gem_obj *abo, u32 *size);
169169 u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo);
170+int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
171+ struct amdxdna_sched_job *job, u32 cmd_idx,
172+ enum ert_cmd_state error_state);
170173
171174 void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job);
172175 void amdxdna_hwctx_remove_all(struct amdxdna_client *client);
drivers/accel/amdxdna/amdxdna_gem.c+19−19
@@ -21,8 +21,6 @@ · 20 unmodified lines
2121 #include "amdxdna_pci_drv.h"
2222 #include "amdxdna_ubuf.h"
2323
24−#define XDNA_MAX_CMD_BO_SIZE SZ_32K
25−
2624 MODULE_IMPORT_NS("DMA_BUF");
2725
2826 static int
@@ -745,12 +743,6 @@ amdxdna_drm_create_cmd_bo(struct drm_device *dev, · 716 unmodified lines
745743 {
746744 struct amdxdna_dev *xdna = to_xdna_dev(dev);
747745 struct amdxdna_gem_obj *abo;
748− int ret;
749−
750− if (args->size > XDNA_MAX_CMD_BO_SIZE) {
751− XDNA_ERR(xdna, "Command bo size 0x%llx too large", args->size);
752− return ERR_PTR(-EINVAL);
753− }
754746
755747 if (args->size < sizeof(struct amdxdna_cmd)) {
756748 XDNA_DBG(xdna, "Command BO size 0x%llx too small", args->size);
@@ -764,17 +756,7 @@ amdxdna_drm_create_cmd_bo(struct drm_device *dev, · 7 unmodified lines
764756 abo->type = AMDXDNA_BO_CMD;
765757 abo->client = filp->driver_priv;
766758
767− ret = amdxdna_gem_obj_vmap(abo, &abo->mem.kva);
768− if (ret) {
769− XDNA_ERR(xdna, "Vmap cmd bo failed, ret %d", ret);
770− goto release_obj;
771− }
772−
773759 return abo;
774−
775−release_obj:
776− drm_gem_object_put(to_gobj(abo));
777− return ERR_PTR(ret);
778760 }
779761
780762 int amdxdna_drm_create_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
@@ -871,6 +853,7 @@ struct amdxdna_gem_obj *amdxdna_gem_get_obj(struct amdxdna_client *client, · 90 unmodified lines
871853 struct amdxdna_dev *xdna = client->xdna;
872854 struct amdxdna_gem_obj *abo;
873855 struct drm_gem_object *gobj;
856+ int ret;
874857
875858 gobj = drm_gem_object_lookup(client->filp, bo_hdl);
876859 if (!gobj) {
@@ -879,9 +862,26 @@ struct amdxdna_gem_obj *amdxdna_gem_get_obj(struct amdxdna_client *client, · 2 unmodified lines
879862 }
880863
881864 abo = to_xdna_obj(gobj);
882− if (bo_type == AMDXDNA_BO_INVALID || abo->type == bo_type)
865+ if (bo_type != AMDXDNA_BO_INVALID && abo->type != bo_type)
866+ goto put_obj;
867+
868+ if (bo_type != AMDXDNA_BO_CMD || abo->mem.kva)
883869 return abo;
884870
871+ if (abo->mem.size > SZ_32K) {
872+ XDNA_ERR(xdna, "Cmd bo is too big %ld", abo->mem.size);
873+ goto put_obj;
874+ }
875+
876+ ret = amdxdna_gem_obj_vmap(abo, &abo->mem.kva);
877+ if (ret) {
878+ XDNA_ERR(xdna, "Vmap cmd bo failed, ret %d", ret);
879+ goto put_obj;
880+ }
881+
882+ return abo;
883+
884+put_obj:
885885 drm_gem_object_put(gobj);
886886 return NULL;
887887 }
drivers/accel/amdxdna/amdxdna_mailbox.c+45−46
@@ -460,26 +460,49 @@ msg_id_failed: · 459 unmodified lines
460460 return ret;
461461 }
462462
463−struct mailbox_channel *
464−xdna_mailbox_create_channel(struct mailbox *mb,
465− const struct xdna_mailbox_chann_res *x2i,
466− const struct xdna_mailbox_chann_res *i2x,
467− u32 iohub_int_addr,
468− int mb_irq)
463+struct mailbox_channel *xdna_mailbox_alloc_channel(struct mailbox *mb)
469464 {
470465 struct mailbox_channel *mb_chann;
471− int ret;
472−
473− if (!is_power_of_2(x2i->rb_size) || !is_power_of_2(i2x->rb_size)) {
474− pr_err("Ring buf size must be power of 2");
475− return NULL;
476− }
477466
478467 mb_chann = kzalloc_obj(*mb_chann);
479468 if (!mb_chann)
480469 return NULL;
481470
471+ INIT_WORK(&mb_chann->rx_work, mailbox_rx_worker);
472+ mb_chann->work_q = create_singlethread_workqueue(MAILBOX_NAME);
473+ if (!mb_chann->work_q) {
474+ MB_ERR(mb_chann, "Create workqueue failed");
475+ goto free_chann;
476+ }
482477 mb_chann->mb = mb;
478+
479+ return mb_chann;
480+
481+free_chann:
482+ kfree(mb_chann);
483+ return NULL;
484+}
485+
486+void xdna_mailbox_free_channel(struct mailbox_channel *mb_chann)
487+{
488+ destroy_workqueue(mb_chann->work_q);
489+ kfree(mb_chann);
490+}
491+
492+int
493+xdna_mailbox_start_channel(struct mailbox_channel *mb_chann,
494+ const struct xdna_mailbox_chann_res *x2i,
495+ const struct xdna_mailbox_chann_res *i2x,
496+ u32 iohub_int_addr,
497+ int mb_irq)
498+{
499+ int ret;
500+
501+ if (!is_power_of_2(x2i->rb_size) || !is_power_of_2(i2x->rb_size)) {
502+ pr_err("Ring buf size must be power of 2");
503+ return -EINVAL;
504+ }
505+
483506 mb_chann->msix_irq = mb_irq;
484507 mb_chann->iohub_int_addr = iohub_int_addr;
485508 memcpy(&mb_chann->res[CHAN_RES_X2I], x2i, sizeof(*x2i));
@@ -489,61 +512,37 @@ xdna_mailbox_create_channel(struct mailbox *mb, · 3 unmodified lines
489512 mb_chann->x2i_tail = mailbox_get_tailptr(mb_chann, CHAN_RES_X2I);
490513 mb_chann->i2x_head = mailbox_get_headptr(mb_chann, CHAN_RES_I2X);
491514
492− INIT_WORK(&mb_chann->rx_work, mailbox_rx_worker);
493− mb_chann->work_q = create_singlethread_workqueue(MAILBOX_NAME);
494− if (!mb_chann->work_q) {
495− MB_ERR(mb_chann, "Create workqueue failed");
496− goto free_and_out;
497− }
498−
499515 /* Everything look good. Time to enable irq handler */
500516 ret = request_irq(mb_irq, mailbox_irq_handler, 0, MAILBOX_NAME, mb_chann);
501517 if (ret) {
502518 MB_ERR(mb_chann, "Failed to request irq %d ret %d", mb_irq, ret);
503− goto destroy_wq;
519+ return ret;
504520 }
505521
506522 mb_chann->bad_state = false;
507523 mailbox_reg_write(mb_chann, mb_chann->iohub_int_addr, 0);
508524
509− MB_DBG(mb_chann, "Mailbox channel created (irq: %d)", mb_chann->msix_irq);
510− return mb_chann;
511−
512−destroy_wq:
513− destroy_workqueue(mb_chann->work_q);
514−free_and_out:
515− kfree(mb_chann);
516− return NULL;
525+ MB_DBG(mb_chann, "Mailbox channel started (irq: %d)", mb_chann->msix_irq);
526+ return 0;
517527 }
518528
519−int xdna_mailbox_destroy_channel(struct mailbox_channel *mb_chann)
529+void xdna_mailbox_stop_channel(struct mailbox_channel *mb_chann)
520530 {
521531 struct mailbox_msg *mb_msg;
522532 unsigned long msg_id;
523533
524− MB_DBG(mb_chann, "IRQ disabled and RX work cancelled");
534+ /* Disable an irq and wait. This might sleep. */
525535 free_irq(mb_chann->msix_irq, mb_chann);
526− destroy_workqueue(mb_chann->work_q);
527− /* We can clean up and release resources */
528536
537+ /* Cancel RX work and wait for it to finish */
538+ drain_workqueue(mb_chann->work_q);
539+
540+ /* We can clean up and release resources */
529541 xa_for_each(&mb_chann->chan_xa, msg_id, mb_msg)
530542 mailbox_release_msg(mb_chann, mb_msg);
531−
532543 xa_destroy(&mb_chann->chan_xa);
533544
534− MB_DBG(mb_chann, "Mailbox channel destroyed, irq: %d", mb_chann->msix_irq);
535− kfree(mb_chann);
536− return 0;
537−}
538−
539−void xdna_mailbox_stop_channel(struct mailbox_channel *mb_chann)
540−{
541− /* Disable an irq and wait. This might sleep. */
542− disable_irq(mb_chann->msix_irq);
543−
544− /* Cancel RX work and wait for it to finish */
545− cancel_work_sync(&mb_chann->rx_work);
546− MB_DBG(mb_chann, "IRQ disabled and RX work cancelled");
545+ MB_DBG(mb_chann, "Mailbox channel stopped, irq: %d", mb_chann->msix_irq);
547546 }
548547
549548 struct mailbox *xdnam_mailbox_create(struct drm_device *ddev,
drivers/accel/amdxdna/amdxdna_mailbox.h+17−14
@@ -74,9 +74,16 @@ struct mailbox *xdnam_mailbox_create(struct drm_device *ddev, · 73 unmodified lines
7474 const struct xdna_mailbox_res *res);
7575
7676 /*
77− * xdna_mailbox_create_channel() -- Create a mailbox channel instance
77+ * xdna_mailbox_alloc_channel() -- alloc a mailbox channel
7878 *
79− * @mailbox: the handle return from xdna_mailbox_create()
79+ * @mb: mailbox handle
80+ */
81+struct mailbox_channel *xdna_mailbox_alloc_channel(struct mailbox *mb);
82+
83+/*
84+ * xdna_mailbox_start_channel() -- start a mailbox channel instance
85+ *
86+ * @mb_chann: the handle return from xdna_mailbox_alloc_channel()
8087 * @x2i: host to firmware mailbox resources
8188 * @i2x: firmware to host mailbox resources
8289 * @xdna_mailbox_intr_reg: register addr of MSI-X interrupt
@@ -84,28 +91,24 @@ struct mailbox *xdnam_mailbox_create(struct drm_device *ddev, · 1 unmodified line
8491 *
8592 * Return: If success, return a handle of mailbox channel. Otherwise, return NULL.
8693 */
87−struct mailbox_channel *
88−xdna_mailbox_create_channel(struct mailbox *mailbox,
89− const struct xdna_mailbox_chann_res *x2i,
90− const struct xdna_mailbox_chann_res *i2x,
91− u32 xdna_mailbox_intr_reg,
92− int mb_irq);
94+int
95+xdna_mailbox_start_channel(struct mailbox_channel *mb_chann,
96+ const struct xdna_mailbox_chann_res *x2i,
97+ const struct xdna_mailbox_chann_res *i2x,
98+ u32 xdna_mailbox_intr_reg,
99+ int mb_irq);
93100
94101 /*
95− * xdna_mailbox_destroy_channel() -- destroy mailbox channel
102+ * xdna_mailbox_free_channel() -- free mailbox channel
96103 *
97104 * @mailbox_chann: the handle return from xdna_mailbox_create_channel()
98− *
99− * Return: if success, return 0. otherwise return error code
100105 */
101−int xdna_mailbox_destroy_channel(struct mailbox_channel *mailbox_chann);
106+void xdna_mailbox_free_channel(struct mailbox_channel *mailbox_chann);
102107
103108 /*
104109 * xdna_mailbox_stop_channel() -- stop mailbox channel
105110 *
106111 * @mailbox_chann: the handle return from xdna_mailbox_create_channel()
107− *
108− * Return: if success, return 0. otherwise return error code
109112 */
110113 void xdna_mailbox_stop_channel(struct mailbox_channel *mailbox_chann);
111114
drivers/accel/amdxdna/amdxdna_pci_drv.c+3−0
@@ -23,6 +23,9 @@ MODULE_FIRMWARE("amdnpu/1502_00/npu.sbin"); · 22 unmodified lines
2323 MODULE_FIRMWARE("amdnpu/17f0_10/npu.sbin");
2424 MODULE_FIRMWARE("amdnpu/17f0_11/npu.sbin");
2525 MODULE_FIRMWARE("amdnpu/17f0_20/npu.sbin");
26+MODULE_FIRMWARE("amdnpu/1502_00/npu_7.sbin");
27+MODULE_FIRMWARE("amdnpu/17f0_10/npu_7.sbin");
28+MODULE_FIRMWARE("amdnpu/17f0_11/npu_7.sbin");
2629
2730 /*
2831 * 0.0: Initial version
drivers/accel/amdxdna/amdxdna_pm.c+2−0
@@ -16,6 +16,7 @@ int amdxdna_pm_suspend(struct device *dev) · 15 unmodified lines
1616 struct amdxdna_dev *xdna = to_xdna_dev(dev_get_drvdata(dev));
1717 int ret = -EOPNOTSUPP;
1818
19+ guard(mutex)(&xdna->dev_lock);
1920 if (xdna->dev_info->ops->suspend)
2021 ret = xdna->dev_info->ops->suspend(xdna);
2122
@@ -28,6 +29,7 @@ int amdxdna_pm_resume(struct device *dev) · 6 unmodified lines
2829 struct amdxdna_dev *xdna = to_xdna_dev(dev_get_drvdata(dev));
2930 int ret = -EOPNOTSUPP;
3031
32+ guard(mutex)(&xdna->dev_lock);
3133 if (xdna->dev_info->ops->resume)
3234 ret = xdna->dev_info->ops->resume(xdna);
3335
drivers/accel/amdxdna/amdxdna_pm.h+11−0
@@ -15,4 +15,15 @@ void amdxdna_pm_suspend_put(struct amdxdna_dev *xdna); · 14 unmodified lines
1515 void amdxdna_pm_init(struct amdxdna_dev *xdna);
1616 void amdxdna_pm_fini(struct amdxdna_dev *xdna);
1717
18+static inline int amdxdna_pm_resume_get_locked(struct amdxdna_dev *xdna)
19+{
20+ int ret;
21+
22+ mutex_unlock(&xdna->dev_lock);
23+ ret = amdxdna_pm_resume_get(xdna);
24+ mutex_lock(&xdna->dev_lock);
25+
26+ return ret;
27+}
28+
1829 #endif /* _AMDXDNA_PM_H_ */
drivers/accel/amdxdna/amdxdna_ubuf.c+5−1
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <drm/drm_device.h>
88 #include <drm/drm_print.h>
99 #include <linux/dma-buf.h>
10+#include <linux/overflow.h>
1011 #include <linux/pagemap.h>
1112 #include <linux/vmalloc.h>
1213
@@ -176,7 +177,10 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, · 163 unmodified lines
176177 goto free_ent;
177178 }
178179
179− exp_info.size += va_ent[i].len;
180+ if (check_add_overflow(exp_info.size, va_ent[i].len, &exp_info.size)) {
181+ ret = -EINVAL;
182+ goto free_ent;
183+ }
180184 }
181185
182186 ubuf->nr_pages = exp_info.size >> PAGE_SHIFT;
drivers/accel/amdxdna/npu1_regs.c+2−2
@@ -67,12 +67,12 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = { · 66 unmodified lines
6767
6868 static const struct aie2_fw_feature_tbl npu1_fw_feature_table[] = {
6969 { .major = 5, .min_minor = 7 },
70− { .features = BIT_U64(AIE2_NPU_COMMAND), .min_minor = 8 },
70+ { .features = BIT_U64(AIE2_NPU_COMMAND), .major = 5, .min_minor = 8 },
7171 { 0 }
7272 };
7373
7474 static const struct amdxdna_dev_priv npu1_dev_priv = {
75− .fw_path = "amdnpu/1502_00/npu.sbin",
75+ .fw_path = "amdnpu/1502_00/",
7676 .rt_config = npu1_default_rt_cfg,
7777 .dpm_clk_tbl = npu1_dpm_clk_table,
7878 .fw_feature_tbl = npu1_fw_feature_table,
drivers/accel/amdxdna/npu4_regs.c+1−1
@@ -98,7 +98,7 @@ const struct aie2_fw_feature_tbl npu4_fw_feature_table[] = { · 97 unmodified lines
9898 };
9999
100100 static const struct amdxdna_dev_priv npu4_dev_priv = {
101− .fw_path = "amdnpu/17f0_10/npu.sbin",
101+ .fw_path = "amdnpu/17f0_10/",
102102 .rt_config = npu4_default_rt_cfg,
103103 .dpm_clk_tbl = npu4_dpm_clk_table,
104104 .fw_feature_tbl = npu4_fw_feature_table,
drivers/accel/amdxdna/npu5_regs.c+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363 #define NPU5_SRAM_BAR_BASE MMNPU_APERTURE1_BASE
6464
6565 static const struct amdxdna_dev_priv npu5_dev_priv = {
66− .fw_path = "amdnpu/17f0_11/npu.sbin",
66+ .fw_path = "amdnpu/17f0_11/",
6767 .rt_config = npu4_default_rt_cfg,
6868 .dpm_clk_tbl = npu4_dpm_clk_table,
6969 .fw_feature_tbl = npu4_fw_feature_table,
drivers/accel/amdxdna/npu6_regs.c+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363 #define NPU6_SRAM_BAR_BASE MMNPU_APERTURE1_BASE
6464
6565 static const struct amdxdna_dev_priv npu6_dev_priv = {
66− .fw_path = "amdnpu/17f0_10/npu.sbin",
66+ .fw_path = "amdnpu/17f0_10/",
6767 .rt_config = npu4_default_rt_cfg,
6868 .dpm_clk_tbl = npu4_dpm_clk_table,
6969 .fw_feature_tbl = npu4_fw_feature_table,
drivers/accel/ethosu/ethosu_gem.c+10−4
@@ -154,7 +154,7 @@ static void cmd_state_init(struct cmd_state *st) · 153 unmodified lines
154154
155155 static u64 cmd_to_addr(u32 *cmd)
156156 {
157− return ((u64)((cmd[0] & 0xff0000) << 16)) | cmd[1];
157+ return (((u64)cmd[0] & 0xff0000) << 16) | cmd[1];
158158 }
159159
160160 static u64 dma_length(struct ethosu_validated_cmdstream_info *info,
@@ -245,11 +245,14 @@ static int calc_sizes(struct drm_device *ddev, · 84 unmodified lines
245245 ((st->ifm.stride_kernel >> 1) & 0x1) + 1;
246246 u32 stride_x = ((st->ifm.stride_kernel >> 5) & 0x2) +
247247 (st->ifm.stride_kernel & 0x1) + 1;
248− u32 ifm_height = st->ofm.height[2] * stride_y +
248+ s32 ifm_height = st->ofm.height[2] * stride_y +
249249 st->ifm.height[2] - (st->ifm.pad_top + st->ifm.pad_bottom);
250− u32 ifm_width = st->ofm.width * stride_x +
250+ s32 ifm_width = st->ofm.width * stride_x +
251251 st->ifm.width - (st->ifm.pad_left + st->ifm.pad_right);
252252
253+ if (ifm_height < 0 || ifm_width < 0)
254+ return -EINVAL;
255+
253256 len = feat_matrix_length(info, &st->ifm, ifm_width,
254257 ifm_height, st->ifm.depth);
255258 dev_dbg(ddev->dev, "op %d: IFM:%d:0x%llx-0x%llx\n",
@@ -417,7 +420,10 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, · 161 unmodified lines
417420 return ret;
418421 break;
419422 case NPU_OP_ELEMENTWISE:
420− use_ifm2 = !((st.ifm2.broadcast == 8) || (param == 5) ||
423+ use_scale = ethosu_is_u65(edev) ?
424+ (st.ifm2.broadcast & 0x80) :
425+ (st.ifm2.broadcast == 8);
426+ use_ifm2 = !(use_scale || (param == 5) ||
421427 (param == 6) || (param == 7) || (param == 0x24));
422428 use_ifm = st.ifm.broadcast != 8;
423429 ret = calc_sizes_elemwise(ddev, info, cmd, &st, use_ifm, use_ifm2);
drivers/accel/ethosu/ethosu_job.c+18−8
@@ -143,23 +143,29 @@ out: · 142 unmodified lines
143143 return ret;
144144 }
145145
146+static void ethosu_job_err_cleanup(struct ethosu_job *job)
147+{
148+ unsigned int i;
149+
150+ for (i = 0; i < job->region_cnt; i++)
151+ drm_gem_object_put(job->region_bo[i]);
152+
153+ drm_gem_object_put(job->cmd_bo);
154+
155+ kfree(job);
156+}
157+
146158 static void ethosu_job_cleanup(struct kref *ref)
147159 {
148160 struct ethosu_job *job = container_of(ref, struct ethosu_job,
149161 refcount);
150− unsigned int i;
151162
152163 pm_runtime_put_autosuspend(job->dev->base.dev);
153164
154165 dma_fence_put(job->done_fence);
155166 dma_fence_put(job->inference_done_fence);
156167
157− for (i = 0; i < job->region_cnt; i++)
158− drm_gem_object_put(job->region_bo[i]);
159−
160− drm_gem_object_put(job->cmd_bo);
161−
162− kfree(job);
168+ ethosu_job_err_cleanup(job);
163169 }
164170
165171 static void ethosu_job_put(struct ethosu_job *job)
@@ -454,12 +460,16 @@ static int ethosu_ioctl_submit_job(struct drm_device *dev, struct drm_file *file · 288 unmodified lines
454460 }
455461 }
456462 ret = ethosu_job_push(ejob);
463+ if (!ret) {
464+ ethosu_job_put(ejob);
465+ return 0;
466+ }
457467
458468 out_cleanup_job:
459469 if (ret)
460470 drm_sched_job_cleanup(&ejob->base);
461471 out_put_job:
462− ethosu_job_put(ejob);
472+ ethosu_job_err_cleanup(ejob);
463473
464474 return ret;
465475 }
drivers/accel/ivpu/ivpu_hw_40xx_reg.h+0−6
@@ -121,12 +121,6 @@ · 120 unmodified lines
121121 #define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY 0x0003006cu
122122 #define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY_STATUS_DLY_MASK GENMASK(7, 0)
123123
124−#define VPU_40XX_HOST_SS_AON_RETENTION0 0x0003000cu
125−#define VPU_40XX_HOST_SS_AON_RETENTION1 0x00030010u
126−#define VPU_40XX_HOST_SS_AON_RETENTION2 0x00030014u
127−#define VPU_40XX_HOST_SS_AON_RETENTION3 0x00030018u
128−#define VPU_40XX_HOST_SS_AON_RETENTION4 0x0003001cu
129−
130124 #define VPU_40XX_HOST_SS_AON_IDLE_GEN 0x00030200u
131125 #define VPU_40XX_HOST_SS_AON_IDLE_GEN_EN_MASK BIT_MASK(0)
132126 #define VPU_40XX_HOST_SS_AON_IDLE_GEN_HW_PG_EN_MASK BIT_MASK(1)
drivers/accel/ivpu/ivpu_hw_ip.c+0−1
@@ -931,7 +931,6 @@ static int soc_cpu_boot_40xx(struct ivpu_device *vdev) · 930 unmodified lines
931931
932932 static int soc_cpu_boot_60xx(struct ivpu_device *vdev)
933933 {
934− REGV_WR64(VPU_40XX_HOST_SS_AON_RETENTION1, vdev->fw->mem_bp->vpu_addr);
935934 soc_cpu_set_entry_point_40xx(vdev, vdev->fw->cold_boot_entry_point);
936935
937936 return 0;
drivers/acpi/Kconfig+1−0
@@ -9,6 +9,7 @@ config ARCH_SUPPORTS_ACPI · 8 unmodified lines
99 menuconfig ACPI
1010 bool "ACPI (Advanced Configuration and Power Interface) Support"
1111 depends on ARCH_SUPPORTS_ACPI
12+ select AUXILIARY_BUS
1213 select PNP
1314 select NLS
1415 select CRC32
drivers/acpi/acpi_platform.c+1−1
@@ -135,7 +135,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, · 134 unmodified lines
135135 }
136136 }
137137
138− if (adev->device_type == ACPI_BUS_TYPE_DEVICE && !adev->pnp.type.backlight) {
138+ if (adev->device_type == ACPI_BUS_TYPE_DEVICE) {
139139 LIST_HEAD(resource_list);
140140
141141 count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
drivers/acpi/acpi_video.c+22−23
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #define pr_fmt(fmt) "ACPI: video: " fmt
1111
12+#include <linux/auxiliary_bus.h>
1213 #include <linux/kernel.h>
1314 #include <linux/module.h>
1415 #include <linux/init.h>
@@ -21,7 +22,6 @@ · 6 unmodified lines
2122 #include <linux/sort.h>
2223 #include <linux/pci.h>
2324 #include <linux/pci_ids.h>
24−#include <linux/platform_device.h>
2525 #include <linux/slab.h>
2626 #include <linux/dmi.h>
2727 #include <linux/suspend.h>
@@ -77,8 +77,9 @@ static int register_count; · 49 unmodified lines
7777 static DEFINE_MUTEX(register_count_mutex);
7878 static DEFINE_MUTEX(video_list_lock);
7979 static LIST_HEAD(video_bus_head);
80−static int acpi_video_bus_probe(struct platform_device *pdev);
81−static void acpi_video_bus_remove(struct platform_device *pdev);
80+static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
81+ const struct auxiliary_device_id *id);
82+static void acpi_video_bus_remove(struct auxiliary_device *aux);
8283 static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data);
8384
8485 /*
@@ -93,19 +94,16 @@ enum acpi_video_level_idx { · 8 unmodified lines
9394 ACPI_VIDEO_FIRST_LEVEL, /* actual supported levels begin here */
9495 };
9596
96−static const struct acpi_device_id video_device_ids[] = {
97− {ACPI_VIDEO_HID, 0},
98− {"", 0},
97+static const struct auxiliary_device_id video_bus_auxiliary_id_table[] = {
98+ { .name = "acpi.video_bus" },
99+ {},
99100 };
100−MODULE_DEVICE_TABLE(acpi, video_device_ids);
101+MODULE_DEVICE_TABLE(auxiliary, video_bus_auxiliary_id_table);
101102
102−static struct platform_driver acpi_video_bus = {
103+static struct auxiliary_driver acpi_video_bus = {
103104 .probe = acpi_video_bus_probe,
104105 .remove = acpi_video_bus_remove,
105− .driver = {
106− .name = "acpi-video",
107− .acpi_match_table = video_device_ids,
108− },
106+ .id_table = video_bus_auxiliary_id_table,
109107 };
110108
111109 struct acpi_video_bus_flags {
@@ -1885,7 +1883,7 @@ static void acpi_video_dev_add_notify_handler(struct acpi_video_device *device) · 1773 unmodified lines
18851883 }
18861884
18871885 static int acpi_video_bus_add_notify_handler(struct acpi_video_bus *video,
1888− struct platform_device *pdev)
1886+ struct device *parent)
18891887 {
18901888 struct input_dev *input;
18911889 struct acpi_video_device *dev;
@@ -1908,7 +1906,7 @@ static int acpi_video_bus_add_notify_handler(struct acpi_video_bus *video, · 16 unmodified lines
19081906 input->phys = video->phys;
19091907 input->id.bustype = BUS_HOST;
19101908 input->id.product = 0x06;
1911− input->dev.parent = &pdev->dev;
1909+ input->dev.parent = parent;
19121910 input->evbit[0] = BIT(EV_KEY);
19131911 set_bit(KEY_SWITCHVIDEOMODE, input->keybit);
19141912 set_bit(KEY_VIDEO_NEXT, input->keybit);
@@ -1980,9 +1978,10 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) · 65 unmodified lines
19801978
19811979 static int instance;
19821980
1983−static int acpi_video_bus_probe(struct platform_device *pdev)
1981+static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
1982+ const struct auxiliary_device_id *id_unused)
19841983 {
1985− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
1984+ struct acpi_device *device = ACPI_COMPANION(&aux_dev->dev);
19861985 struct acpi_video_bus *video;
19871986 bool auto_detect;
19881987 int error;
@@ -2019,7 +2018,7 @@ static int acpi_video_bus_probe(struct platform_device *pdev) · 30 unmodified lines
20192018 instance++;
20202019 }
20212020
2022− platform_set_drvdata(pdev, video);
2021+ auxiliary_set_drvdata(aux_dev, video);
20232022
20242023 video->device = device;
20252024 strscpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
@@ -2068,7 +2067,7 @@ static int acpi_video_bus_probe(struct platform_device *pdev) · 42 unmodified lines
20682067 !auto_detect)
20692068 acpi_video_bus_register_backlight(video);
20702069
2071− error = acpi_video_bus_add_notify_handler(video, pdev);
2070+ error = acpi_video_bus_add_notify_handler(video, &aux_dev->dev);
20722071 if (error)
20732072 goto err_del;
20742073
@@ -2096,10 +2095,10 @@ err_free_video: · 21 unmodified lines
20962095 return error;
20972096 }
20982097
2099−static void acpi_video_bus_remove(struct platform_device *pdev)
2098+static void acpi_video_bus_remove(struct auxiliary_device *aux_dev)
21002099 {
2101− struct acpi_video_bus *video = platform_get_drvdata(pdev);
2102− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
2100+ struct acpi_video_bus *video = auxiliary_get_drvdata(aux_dev);
2101+ struct acpi_device *device = ACPI_COMPANION(&aux_dev->dev);
21032102
21042103 acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
21052104 acpi_video_bus_notify);
@@ -2163,7 +2162,7 @@ int acpi_video_register(void) · 57 unmodified lines
21632162
21642163 dmi_check_system(video_dmi_table);
21652164
2166− ret = platform_driver_register(&acpi_video_bus);
2165+ ret = auxiliary_driver_register(&acpi_video_bus);
21672166 if (ret)
21682167 goto leave;
21692168
@@ -2183,7 +2182,7 @@ void acpi_video_unregister(void) · 13 unmodified lines
21832182 {
21842183 mutex_lock(&register_count_mutex);
21852184 if (register_count) {
2186− platform_driver_unregister(&acpi_video_bus);
2185+ auxiliary_driver_unregister(&acpi_video_bus);
21872186 register_count = 0;
21882187 may_report_brightness_keys = false;
21892188 }
drivers/acpi/acpica/acpredef.h+3−2
@@ -379,8 +379,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = { · 378 unmodified lines
379379
380380 {{"_CPC", METHOD_0ARGS,
381381 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Bufs) */
382− PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,
383− 0, 0, 0),
382+ PACKAGE_INFO(ACPI_PTYPE1_VAR,
383+ ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER |
384+ ACPI_RTYPE_PACKAGE, 0, 0, 0, 0),
384385
385386 {{"_CR3", METHOD_0ARGS, /* ACPI 6.0 */
386387 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
drivers/acpi/device_pm.c+0−9
@@ -1456,15 +1456,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) · 1455 unmodified lines
14561456 if (!adev || !acpi_match_device_ids(adev, special_pm_ids))
14571457 return 0;
14581458
1459− /*
1460− * Skip devices whose ACPI companions don't support power management and
1461− * don't have a wakeup GPE.
1462− */
1463− if (!acpi_device_power_manageable(adev) && !acpi_device_can_wakeup(adev)) {
1464− dev_dbg(dev, "No ACPI power management or wakeup GPE\n");
1465− return 0;
1466− }
1467−
14681459 /*
14691460 * Only attach the power domain to the first device if the
14701461 * companion is shared by multiple. This is to prevent doing power
drivers/acpi/osi.c+13−0
@@ -389,6 +389,19 @@ static const struct dmi_system_id acpi_osi_dmi_table[] __initconst = { · 388 unmodified lines
389389 },
390390 },
391391
392+ /*
393+ * The screen backlight turns off during udev device creation
394+ * when returning true for _OSI("Windows 2009")
395+ */
396+ {
397+ .callback = dmi_disable_osi_win7,
398+ .ident = "Acer Aspire One D255",
399+ .matches = {
400+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
401+ DMI_MATCH(DMI_PRODUCT_NAME, "AOD255"),
402+ },
403+ },
404+
392405 /*
393406 * The wireless hotkey does not work on those machines when
394407 * returning true for _OSI("Windows 2012")
drivers/acpi/osl.c+1−1
@@ -1681,7 +1681,7 @@ acpi_status __init acpi_os_initialize(void) · 1680 unmodified lines
16811681 * Use acpi_os_map_generic_address to pre-map the reset
16821682 * register if it's in system memory.
16831683 */
1684− void *rv;
1684+ void __iomem *rv;
16851685
16861686 rv = acpi_os_map_generic_address(&acpi_gbl_FADT.reset_register);
16871687 pr_debug("%s: Reset register mapping %s\n", __func__,
drivers/acpi/scan.c+45−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #define pr_fmt(fmt) "ACPI: " fmt
77
88 #include <linux/async.h>
9+#include <linux/auxiliary_bus.h>
910 #include <linux/module.h>
1011 #include <linux/init.h>
1112 #include <linux/slab.h>
@@ -2192,6 +2193,44 @@ static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, · 2180 unmodified lines
21922193 return acpi_bus_check_add(handle, false, (struct acpi_device **)ret_p);
21932194 }
21942195
2196+static void acpi_video_bus_device_release(struct device *dev)
2197+{
2198+ struct auxiliary_device *aux_dev = to_auxiliary_dev(dev);
2199+
2200+ kfree(aux_dev);
2201+}
2202+
2203+static void acpi_create_video_bus_device(struct acpi_device *adev,
2204+ struct acpi_device *parent)
2205+{
2206+ struct auxiliary_device *aux_dev;
2207+ static unsigned int aux_dev_id;
2208+
2209+ aux_dev = kzalloc_obj(*aux_dev);
2210+ if (!aux_dev)
2211+ return;
2212+
2213+ aux_dev->id = aux_dev_id++;
2214+ aux_dev->name = "video_bus";
2215+ aux_dev->dev.parent = acpi_get_first_physical_node(parent);
2216+ if (!aux_dev->dev.parent)
2217+ goto err;
2218+
2219+ aux_dev->dev.release = acpi_video_bus_device_release;
2220+
2221+ if (auxiliary_device_init(aux_dev))
2222+ goto err;
2223+
2224+ ACPI_COMPANION_SET(&aux_dev->dev, adev);
2225+ if (__auxiliary_device_add(aux_dev, "acpi"))
2226+ auxiliary_device_uninit(aux_dev);
2227+
2228+ return;
2229+
2230+err:
2231+ kfree(aux_dev);
2232+}
2233+
21952234 struct acpi_scan_system_dev {
21962235 struct list_head node;
21972236 struct acpi_device *adev;
@@ -2229,6 +2268,12 @@ static void acpi_default_enumeration(struct acpi_device *device) · 31 unmodified lines
22292268 sd->adev = device;
22302269 list_add_tail(&sd->node, &acpi_scan_system_dev_list);
22312270 }
2271+ } else if (device->pnp.type.backlight) {
2272+ struct acpi_device *parent;
2273+
2274+ parent = acpi_dev_parent(device);
2275+ if (parent)
2276+ acpi_create_video_bus_device(device, parent);
22322277 } else {
22332278 /* For a regular device object, create a platform device. */
22342279 acpi_create_platform_device(device, NULL);
drivers/acpi/sleep.c+8−0
@@ -386,6 +386,14 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { · 385 unmodified lines
386386 DMI_MATCH(DMI_PRODUCT_NAME, "80E1"),
387387 },
388388 },
389+ {
390+ .callback = init_nvs_save_s3,
391+ .ident = "Lenovo G70-35",
392+ .matches = {
393+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
394+ DMI_MATCH(DMI_PRODUCT_NAME, "80Q5"),
395+ },
396+ },
389397 /*
390398 * ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using
391399 * the Low Power S0 Idle firmware interface (see
drivers/android/binder/page_range.rs+64−20
@@ -142,6 +142,30 @@ pub(crate) struct ShrinkablePageRange { · 141 unmodified lines
142142 _pin: PhantomPinned,
143143 }
144144
145+// We do not define any ops. For now, used only to check identity of vmas.
146+static BINDER_VM_OPS: bindings::vm_operations_struct = pin_init::zeroed();
147+
148+// To ensure that we do not accidentally install pages into or zap pages from the wrong vma, we
149+// check its vm_ops and private data before using it.
150+fn check_vma(vma: &virt::VmaRef, owner: *const ShrinkablePageRange) -> Option<&virt::VmaMixedMap> {
151+ // SAFETY: Just reading the vm_ops pointer of any active vma is safe.
152+ let vm_ops = unsafe { (*vma.as_ptr()).vm_ops };
153+ if !ptr::eq(vm_ops, &BINDER_VM_OPS) {
154+ return None;
155+ }
156+
157+ // SAFETY: Reading the vm_private_data pointer of a binder-owned vma is safe.
158+ let vm_private_data = unsafe { (*vma.as_ptr()).vm_private_data };
159+ // The ShrinkablePageRange is only dropped when the Process is dropped, which only happens once
160+ // the file's ->release handler is invoked, which means the ShrinkablePageRange outlives any
161+ // VMA associated with it, so there can't be any false positives due to pointer reuse here.
162+ if !ptr::eq(vm_private_data, owner.cast()) {
163+ return None;
164+ }
165+
166+ vma.as_mixedmap_vma()
167+}
168+
145169 struct Inner {
146170 /// Array of pages.
147171 ///
@@ -308,6 +332,18 @@ impl ShrinkablePageRange { · 160 unmodified lines
308332 inner.size = num_pages;
309333 inner.vma_addr = vma.start();
310334
335+ // This pointer is only used for comparison - it's not dereferenced.
336+ //
337+ // SAFETY: We own the vma, and we don't use any methods on VmaNew that rely on
338+ // `vm_private_data`.
339+ unsafe {
340+ (*vma.as_ptr()).vm_private_data = ptr::from_ref(self).cast_mut().cast::<c_void>()
341+ };
342+
343+ // SAFETY: We own the vma, and we don't use any methods on VmaNew that rely on
344+ // `vm_ops`.
345+ unsafe { (*vma.as_ptr()).vm_ops = &BINDER_VM_OPS };
346+
311347 Ok(num_pages)
312348 }
313349
@@ -399,22 +435,25 @@ impl ShrinkablePageRange { · 85 unmodified lines
399435 //
400436 // Using `mmput_async` avoids this, because then the `mm` cleanup is instead queued to a
401437 // workqueue.
402− MmWithUser::into_mmput_async(self.mm.mmget_not_zero().ok_or(ESRCH)?)
403− .mmap_read_lock()
404− .vma_lookup(vma_addr)
405− .ok_or(ESRCH)?
406− .as_mixedmap_vma()
407− .ok_or(ESRCH)?
408− .vm_insert_page(user_page_addr, &new_page)
409− .inspect_err(|err| {
410− pr_warn!(
411− "Failed to vm_insert_page({}): vma_addr:{} i:{} err:{:?}",
412− user_page_addr,
413− vma_addr,
414− i,
415− err
416− )
417− })?;
438+ let mm = MmWithUser::into_mmput_async(self.mm.mmget_not_zero().ok_or(ESRCH)?);
439+ {
440+ let vma_read;
441+ let mmap_read;
442+ let vma = if let Some(ret) = mm.lock_vma_under_rcu(vma_addr) {
443+ vma_read = ret;
444+ check_vma(&vma_read, self)
445+ } else {
446+ mmap_read = mm.mmap_read_lock();
447+ mmap_read
448+ .vma_lookup(vma_addr)
449+ .and_then(|vma| check_vma(vma, self))
450+ };
451+
452+ match vma {
453+ Some(vma) => vma.vm_insert_page(user_page_addr, &new_page)?,
454+ None => return Err(ESRCH),
455+ }
456+ }
418457
419458 let inner = self.lock.lock();
420459
@@ -667,12 +706,15 @@ unsafe extern "C" fn rust_shrink_free_page( · 246 unmodified lines
667706 let mmap_read;
668707 let mm_mutex;
669708 let vma_addr;
709+ let range_ptr;
670710
671711 {
672712 // CAST: The `list_head` field is first in `PageInfo`.
673713 let info = item as *mut PageInfo;
674714 // SAFETY: The `range` field of `PageInfo` is immutable.
675− let range = unsafe { &*((*info).range) };
715+ range_ptr = unsafe { (*info).range };
716+ // SAFETY: The `range` outlives its `PageInfo` values.
717+ let range = unsafe { &*range_ptr };
676718
677719 mm = match range.mm.mmget_not_zero() {
678720 Some(mm) => MmWithUser::into_mmput_async(mm),
@@ -717,9 +759,11 @@ unsafe extern "C" fn rust_shrink_free_page( · 38 unmodified lines
717759 // SAFETY: The lru lock is locked when this method is called.
718760 unsafe { bindings::spin_unlock(&raw mut (*lru).lock) };
719761
720− if let Some(vma) = mmap_read.vma_lookup(vma_addr) {
721− let user_page_addr = vma_addr + (page_index << PAGE_SHIFT);
722− vma.zap_page_range_single(user_page_addr, PAGE_SIZE);
762+ if let Some(unchecked_vma) = mmap_read.vma_lookup(vma_addr) {
763+ if let Some(vma) = check_vma(unchecked_vma, range_ptr) {
764+ let user_page_addr = vma_addr + (page_index << PAGE_SHIFT);
765+ vma.zap_page_range_single(user_page_addr, PAGE_SIZE);
766+ }
723767 }
724768
725769 drop(mmap_read);
drivers/android/binder/process.rs+2−1
@@ -1295,7 +1295,8 @@ impl Process { · 1294 unmodified lines
12951295 }
12961296
12971297 pub(crate) fn dead_binder_done(&self, cookie: u64, thread: &Thread) {
1298− if let Some(death) = self.inner.lock().pull_delivered_death(cookie) {
1298+ let death = self.inner.lock().pull_delivered_death(cookie);
1299+ if let Some(death) = death {
12991300 death.set_notification_done(thread);
13001301 }
13011302 }
drivers/android/binder/range_alloc/array.rs+33−2
@@ -118,7 +118,7 @@ impl<T> ArrayRangeAllocator<T> { · 117 unmodified lines
118118 size: usize,
119119 is_oneway: bool,
120120 pid: Pid,
121− ) -> Result<usize> {
121+ ) -> Result<(usize, bool)> {
122122 // Compute new value of free_oneway_space, which is set only on success.
123123 let new_oneway_space = if is_oneway {
124124 match self.free_oneway_space.checked_sub(size) {
@@ -146,7 +146,38 @@ impl<T> ArrayRangeAllocator<T> { · 21 unmodified lines
146146 .ok()
147147 .unwrap();
148148
149− Ok(insert_at_offset)
149+ // Start detecting spammers once we have less than 20%
150+ // of async space left (which is less than 10% of total
151+ // buffer size).
152+ //
153+ // (This will short-circuit, so `low_oneway_space` is
154+ // only called when necessary.)
155+ let oneway_spam_detected =
156+ is_oneway && new_oneway_space < self.size / 10 && self.low_oneway_space(pid);
157+
158+ Ok((insert_at_offset, oneway_spam_detected))
159+ }
160+
161+ /// Find the amount and size of buffers allocated by the current caller.
162+ ///
163+ /// The idea is that once we cross the threshold, whoever is responsible
164+ /// for the low async space is likely to try to send another async transaction,
165+ /// and at some point we'll catch them in the act. This is more efficient
166+ /// than keeping a map per pid.
167+ fn low_oneway_space(&self, calling_pid: Pid) -> bool {
168+ let mut total_alloc_size = 0;
169+ let mut num_buffers = 0;
170+
171+ // Warn if this pid has more than 50 transactions, or more than 50% of
172+ // async space (which is 25% of total buffer size). Oneway spam is only
173+ // detected when the threshold is exceeded.
174+ for range in &self.ranges {
175+ if range.state.is_oneway() && range.state.pid() == calling_pid {
176+ total_alloc_size += range.size;
177+ num_buffers += 1;
178+ }
179+ }
180+ num_buffers > 50 || total_alloc_size > self.size / 4
150181 }
151182
152183 pub(crate) fn reservation_abort(&mut self, offset: usize) -> Result<FreedRange> {
drivers/android/binder/range_alloc/mod.rs+2−2
@@ -188,11 +188,11 @@ impl<T> RangeAllocator<T> { · 187 unmodified lines
188188 self.reserve_new(args)
189189 }
190190 Impl::Array(array) => {
191− let offset =
191+ let (offset, oneway_spam_detected) =
192192 array.reserve_new(args.debug_id, args.size, args.is_oneway, args.pid)?;
193193 Ok(ReserveNew::Success(ReserveNewSuccess {
194194 offset,
195− oneway_spam_detected: false,
195+ oneway_spam_detected,
196196 _empty_array_alloc: args.empty_array_alloc,
197197 _new_tree_alloc: args.new_tree_alloc,
198198 _tree_alloc: args.tree_alloc,
drivers/android/binder/range_alloc/tree.rs+9−9
@@ -164,15 +164,6 @@ impl<T> TreeRangeAllocator<T> { · 163 unmodified lines
164164 self.free_oneway_space
165165 };
166166
167− // Start detecting spammers once we have less than 20%
168− // of async space left (which is less than 10% of total
169− // buffer size).
170− //
171− // (This will short-circut, so `low_oneway_space` is
172− // only called when necessary.)
173− let oneway_spam_detected =
174− is_oneway && new_oneway_space < self.size / 10 && self.low_oneway_space(pid);
175−
176167 let (found_size, found_off, tree_node, free_tree_node) = match self.find_best_match(size) {
177168 None => {
178169 pr_warn!("ENOSPC from range_alloc.reserve_new - size: {}", size);
@@ -203,6 +194,15 @@ impl<T> TreeRangeAllocator<T> { · 24 unmodified lines
203194 self.free_tree.insert(free_tree_node);
204195 }
205196
197+ // Start detecting spammers once we have less than 20%
198+ // of async space left (which is less than 10% of total
199+ // buffer size).
200+ //
201+ // (This will short-circuit, so `low_oneway_space` is
202+ // only called when necessary.)
203+ let oneway_spam_detected =
204+ is_oneway && new_oneway_space < self.size / 10 && self.low_oneway_space(pid);
205+
206206 Ok((found_off, oneway_spam_detected))
207207 }
208208
drivers/android/binder/thread.rs+6−11
@@ -1015,12 +1015,9 @@ impl Thread { · 1014 unmodified lines
10151015
10161016 // Copy offsets if there are any.
10171017 if offsets_size > 0 {
1018− {
1019− let mut reader =
1020− UserSlice::new(UserPtr::from_addr(trd_data_ptr.offsets as _), offsets_size)
1021− .reader();
1022− alloc.copy_into(&mut reader, aligned_data_size, offsets_size)?;
1023− }
1018+ let mut offsets_reader =
1019+ UserSlice::new(UserPtr::from_addr(trd_data_ptr.offsets as _), offsets_size)
1020+ .reader();
10241021
10251022 let offsets_start = aligned_data_size;
10261023 let offsets_end = aligned_data_size + offsets_size;
@@ -1041,11 +1038,9 @@ impl Thread { · 14 unmodified lines
10411038 .step_by(size_of::<u64>())
10421039 .enumerate()
10431040 {
1044− let offset: usize = view
1045− .alloc
1046− .read::<u64>(index_offset)?
1047− .try_into()
1048− .map_err(|_| EINVAL)?;
1041+ let offset = offsets_reader.read::<u64>()?;
1042+ view.alloc.write(index_offset, &offset)?;
1043+ let offset: usize = offset.try_into().map_err(|_| EINVAL)?;
10491044
10501045 if offset < end_of_previous_object || !is_aligned(offset, size_of::<u32>()) {
10511046 pr_warn!("Got transaction with invalid offset.");
drivers/ata/libata-core.c+5−5
@@ -4189,6 +4189,7 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = { · 4188 unmodified lines
41894189 ATA_QUIRK_FIRMWARE_WARN },
41904190
41914191 /* Seagate disks with LPM issues */
4192+ { "ST1000DM010-2EP102", NULL, ATA_QUIRK_NOLPM },
41924193 { "ST2000DM008-2FR102", NULL, ATA_QUIRK_NOLPM },
41934194
41944195 /* drives which fail FPDMA_AA activation (some may freeze afterwards)
@@ -4231,6 +4232,7 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = { · 36 unmodified lines
42314232 /* Devices that do not need bridging limits applied */
42324233 { "MTRON MSP-SATA*", NULL, ATA_QUIRK_BRIDGE_OK },
42334234 { "BUFFALO HD-QSU2/R5", NULL, ATA_QUIRK_BRIDGE_OK },
4235+ { "QEMU HARDDISK", "2.5+", ATA_QUIRK_BRIDGE_OK },
42344236
42354237 /* Devices which aren't very happy with higher link speeds */
42364238 { "WD My Book", NULL, ATA_QUIRK_1_5_GBPS },
@@ -6269,10 +6271,6 @@ static void ata_port_detach(struct ata_port *ap) · 2032 unmodified lines
62696271 }
62706272 }
62716273
6272− /* Make sure the deferred qc work finished. */
6273− cancel_work_sync(&ap->deferred_qc_work);
6274− WARN_ON(ap->deferred_qc);
6275−
62766274 /* Tell EH to disable all devices */
62776275 ap->pflags |= ATA_PFLAG_UNLOADING;
62786276 ata_port_schedule_eh(ap);
@@ -6283,9 +6281,11 @@ static void ata_port_detach(struct ata_port *ap) · 4 unmodified lines
62836281 /* wait till EH commits suicide */
62846282 ata_port_wait_eh(ap);
62856283
6286− /* it better be dead now */
6284+ /* It better be dead now and not have any remaining deferred qc. */
62876285 WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED));
6286+ WARN_ON(ap->deferred_qc);
62886287
6288+ cancel_work_sync(&ap->deferred_qc_work);
62896289 cancel_delayed_work_sync(&ap->hotplug_task);
62906290 cancel_delayed_work_sync(&ap->scsi_rescan_task);
62916291
drivers/ata/libata-eh.c+20−3
@@ -640,12 +640,29 @@ void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, · 639 unmodified lines
640640 set_host_byte(scmd, DID_OK);
641641
642642 ata_qc_for_each_raw(ap, qc, i) {
643− if (qc->flags & ATA_QCFLAG_ACTIVE &&
644− qc->scsicmd == scmd)
643+ if (qc->scsicmd != scmd)
644+ continue;
645+ if ((qc->flags & ATA_QCFLAG_ACTIVE) ||
646+ qc == ap->deferred_qc)
645647 break;
646648 }
647649
648− if (i < ATA_MAX_QUEUE) {
650+ if (i < ATA_MAX_QUEUE && qc == ap->deferred_qc) {
651+ /*
652+ * This is a deferred command that timed out while
653+ * waiting for the command queue to drain. Since the qc
654+ * is not active yet (deferred_qc is still set, so the
655+ * deferred qc work has not issued the command yet),
656+ * simply signal the timeout by finishing the SCSI
657+ * command and clear the deferred qc to prevent the
658+ * deferred qc work from issuing this qc.
659+ */
660+ WARN_ON_ONCE(qc->flags & ATA_QCFLAG_ACTIVE);
661+ ap->deferred_qc = NULL;
662+ cancel_work(&ap->deferred_qc_work);
663+ set_host_byte(scmd, DID_TIME_OUT);
664+ scsi_eh_finish_cmd(scmd, &ap->eh_done_q);
665+ } else if (i < ATA_MAX_QUEUE) {
649666 /* the scmd has an associated qc */
650667 if (!(qc->flags & ATA_QCFLAG_EH)) {
651668 /* which hasn't failed yet, timeout */
drivers/ata/libata-scsi.c+1−0
@@ -1699,6 +1699,7 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap) · 1698 unmodified lines
16991699
17001700 scmd = qc->scsicmd;
17011701 ap->deferred_qc = NULL;
1702+ cancel_work(&ap->deferred_qc_work);
17021703 ata_qc_free(qc);
17031704 scmd->result = (DID_SOFT_ERROR << 16);
17041705 scsi_done(scmd);
drivers/base/base.h+1−10
@@ -179,19 +179,10 @@ void device_release_driver_internal(struct device *dev, const struct device_driv · 178 unmodified lines
179179 void driver_detach(const struct device_driver *drv);
180180 void driver_deferred_probe_del(struct device *dev);
181181 void device_set_deferred_probe_reason(const struct device *dev, struct va_format *vaf);
182−static inline int driver_match_device_locked(const struct device_driver *drv,
183− struct device *dev)
184−{
185− device_lock_assert(dev);
186−
187− return drv->bus->match ? drv->bus->match(dev, drv) : 1;
188−}
189−
190182 static inline int driver_match_device(const struct device_driver *drv,
191183 struct device *dev)
192184 {
193− guard(device)(dev);
194− return driver_match_device_locked(drv, dev);
185+ return drv->bus->match ? drv->bus->match(dev, drv) : 1;
195186 }
196187
197188 static inline void dev_sync_state(struct device *dev)
drivers/base/dd.c+1−1
@@ -928,7 +928,7 @@ static int __device_attach_driver(struct device_driver *drv, void *_data) · 927 unmodified lines
928928 bool async_allowed;
929929 int ret;
930930
931− ret = driver_match_device_locked(drv, dev);
931+ ret = driver_match_device(drv, dev);
932932 if (ret == 0) {
933933 /* no match */
934934 return 0;
drivers/base/property.c+13−14
@@ -797,7 +797,18 @@ struct fwnode_handle * · 796 unmodified lines
797797 fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
798798 struct fwnode_handle *child)
799799 {
800− return fwnode_call_ptr_op(fwnode, get_next_child_node, child);
800+ struct fwnode_handle *next;
801+
802+ if (IS_ERR_OR_NULL(fwnode))
803+ return NULL;
804+
805+ /* Try to find a child in primary fwnode */
806+ next = fwnode_call_ptr_op(fwnode, get_next_child_node, child);
807+ if (next)
808+ return next;
809+
810+ /* When no more children in primary, continue with secondary */
811+ return fwnode_call_ptr_op(fwnode->secondary, get_next_child_node, child);
801812 }
802813 EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
803814
@@ -841,19 +852,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node); · 37 unmodified lines
841852 struct fwnode_handle *device_get_next_child_node(const struct device *dev,
842853 struct fwnode_handle *child)
843854 {
844− const struct fwnode_handle *fwnode = dev_fwnode(dev);
845− struct fwnode_handle *next;
846−
847− if (IS_ERR_OR_NULL(fwnode))
848− return NULL;
849−
850− /* Try to find a child in primary fwnode */
851− next = fwnode_get_next_child_node(fwnode, child);
852− if (next)
853− return next;
854−
855− /* When no more children in primary, continue with secondary */
856− return fwnode_get_next_child_node(fwnode->secondary, child);
855+ return fwnode_get_next_child_node(dev_fwnode(dev), child);
857856 }
858857 EXPORT_SYMBOL_GPL(device_get_next_child_node);
859858
drivers/block/drbd/drbd_actlog.c+23−30
@@ -483,38 +483,20 @@ void drbd_al_begin_io(struct drbd_device *device, struct drbd_interval *i) · 482 unmodified lines
483483
484484 int drbd_al_begin_io_nonblock(struct drbd_device *device, struct drbd_interval *i)
485485 {
486− struct lru_cache *al = device->act_log;
487486 /* for bios crossing activity log extent boundaries,
488487 * we may need to activate two extents in one go */
489488 unsigned first = i->sector >> (AL_EXTENT_SHIFT-9);
490489 unsigned last = i->size == 0 ? first : (i->sector + (i->size >> 9) - 1) >> (AL_EXTENT_SHIFT-9);
491− unsigned nr_al_extents;
492− unsigned available_update_slots;
493490 unsigned enr;
494491
495− D_ASSERT(device, first <= last);
496−
497− nr_al_extents = 1 + last - first; /* worst case: all touched extends are cold. */
498− available_update_slots = min(al->nr_elements - al->used,
499− al->max_pending_changes - al->pending_changes);
500−
501− /* We want all necessary updates for a given request within the same transaction
502− * We could first check how many updates are *actually* needed,
503− * and use that instead of the worst-case nr_al_extents */
504− if (available_update_slots < nr_al_extents) {
505− /* Too many activity log extents are currently "hot".
506− *
507− * If we have accumulated pending changes already,
508− * we made progress.
509− *
510− * If we cannot get even a single pending change through,
511− * stop the fast path until we made some progress,
512− * or requests to "cold" extents could be starved. */
513− if (!al->pending_changes)
514− __set_bit(__LC_STARVING, &device->act_log->flags);
515− return -ENOBUFS;
492+ if (i->partially_in_al_next_enr) {
493+ D_ASSERT(device, first < i->partially_in_al_next_enr);
494+ D_ASSERT(device, last >= i->partially_in_al_next_enr);
495+ first = i->partially_in_al_next_enr;
516496 }
517497
498+ D_ASSERT(device, first <= last);
499+
518500 /* Is resync active in this area? */
519501 for (enr = first; enr <= last; enr++) {
520502 struct lc_element *tmp;
@@ -529,14 +511,21 @@ int drbd_al_begin_io_nonblock(struct drbd_device *device, struct drbd_interval * · 8 unmodified lines
529511 }
530512 }
531513
532− /* Checkout the refcounts.
533− * Given that we checked for available elements and update slots above,
534− * this has to be successful. */
514+ /* Try to checkout the refcounts. */
535515 for (enr = first; enr <= last; enr++) {
536516 struct lc_element *al_ext;
537517 al_ext = lc_get_cumulative(device->act_log, enr);
538− if (!al_ext)
539− drbd_info(device, "LOGIC BUG for enr=%u\n", enr);
518+
519+ if (!al_ext) {
520+ /* Did not work. We may have exhausted the possible
521+ * changes per transaction. Or raced with someone
522+ * "locking" it against changes.
523+ * Remember where to continue from.
524+ */
525+ if (enr > first)
526+ i->partially_in_al_next_enr = enr;
527+ return -ENOBUFS;
528+ }
540529 }
541530 return 0;
542531 }
@@ -556,7 +545,11 @@ void drbd_al_complete_io(struct drbd_device *device, struct drbd_interval *i) · 13 unmodified lines
556545
557546 for (enr = first; enr <= last; enr++) {
558547 extent = lc_find(device->act_log, enr);
559− if (!extent) {
548+ /* Yes, this masks a bug elsewhere. However, during normal
549+ * operation this is harmless, so no need to crash the kernel
550+ * by the BUG_ON(refcount == 0) in lc_put().
551+ */
552+ if (!extent || extent->refcnt == 0) {
560553 drbd_err(device, "al_complete_io() called on inactive extent %u\n", enr);
561554 continue;
562555 }
drivers/block/drbd/drbd_interval.h+4−1
@@ -8,12 +8,15 @@ · 7 unmodified lines
88 struct drbd_interval {
99 struct rb_node rb;
1010 sector_t sector; /* start sector of the interval */
11− unsigned int size; /* size in bytes */
1211 sector_t end; /* highest interval end in subtree */
12+ unsigned int size; /* size in bytes */
1313 unsigned int local:1 /* local or remote request? */;
1414 unsigned int waiting:1; /* someone is waiting for completion */
1515 unsigned int completed:1; /* this has been completed already;
1616 * ignore for conflict detection */
17+
18+ /* to resume a partially successful drbd_al_begin_io_nonblock(); */
19+ unsigned int partially_in_al_next_enr;
1720 };
1821
1922 static inline void drbd_clear_interval(struct drbd_interval *i)
drivers/block/drbd/drbd_main.c+9−5
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/memcontrol.h>
3333 #include <linux/mm_inline.h>
3434 #include <linux/slab.h>
35+#include <linux/string.h>
3536 #include <linux/random.h>
3637 #include <linux/reboot.h>
3738 #include <linux/notifier.h>
@@ -732,9 +733,9 @@ int drbd_send_sync_param(struct drbd_peer_device *peer_device) · 694 unmodified lines
732733 }
733734
734735 if (apv >= 88)
735− strcpy(p->verify_alg, nc->verify_alg);
736+ strscpy(p->verify_alg, nc->verify_alg);
736737 if (apv >= 89)
737− strcpy(p->csums_alg, nc->csums_alg);
738+ strscpy(p->csums_alg, nc->csums_alg);
738739 rcu_read_unlock();
739740
740741 return drbd_send_command(peer_device, sock, cmd, size, NULL, 0);
@@ -745,6 +746,7 @@ int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_packet cm · 4 unmodified lines
745746 struct drbd_socket *sock;
746747 struct p_protocol *p;
747748 struct net_conf *nc;
749+ size_t integrity_alg_len;
748750 int size, cf;
749751
750752 sock = &connection->data;
@@ -762,8 +764,10 @@ int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_packet cm · 11 unmodified lines
762764 }
763765
764766 size = sizeof(*p);
765− if (connection->agreed_pro_version >= 87)
766− size += strlen(nc->integrity_alg) + 1;
767+ if (connection->agreed_pro_version >= 87) {
768+ integrity_alg_len = strlen(nc->integrity_alg) + 1;
769+ size += integrity_alg_len;
770+ }
767771
768772 p->protocol = cpu_to_be32(nc->wire_protocol);
769773 p->after_sb_0p = cpu_to_be32(nc->after_sb_0p);
@@ -778,7 +782,7 @@ int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_packet cm · 8 unmodified lines
778782 p->conn_flags = cpu_to_be32(cf);
779783
780784 if (connection->agreed_pro_version >= 87)
781− strcpy(p->integrity_alg, nc->integrity_alg);
785+ strscpy(p->integrity_alg, nc->integrity_alg, integrity_alg_len);
782786 rcu_read_unlock();
783787
784788 return __conn_send_command(connection, sock, cmd, size, NULL, 0);
drivers/block/drbd/drbd_receiver.c+2−2
@@ -3801,14 +3801,14 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i · 3800 unmodified lines
38013801 *new_net_conf = *old_net_conf;
38023802
38033803 if (verify_tfm) {
3804− strcpy(new_net_conf->verify_alg, p->verify_alg);
3804+ strscpy(new_net_conf->verify_alg, p->verify_alg);
38053805 new_net_conf->verify_alg_len = strlen(p->verify_alg) + 1;
38063806 crypto_free_shash(peer_device->connection->verify_tfm);
38073807 peer_device->connection->verify_tfm = verify_tfm;
38083808 drbd_info(device, "using verify-alg: \"%s\"\n", p->verify_alg);
38093809 }
38103810 if (csums_tfm) {
3811− strcpy(new_net_conf->csums_alg, p->csums_alg);
3811+ strscpy(new_net_conf->csums_alg, p->csums_alg);
38123812 new_net_conf->csums_alg_len = strlen(p->csums_alg) + 1;
38133813 crypto_free_shash(peer_device->connection->csums_tfm);
38143814 peer_device->connection->csums_tfm = csums_tfm;
drivers/block/drbd/drbd_req.c+2−1
@@ -621,7 +621,8 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, · 620 unmodified lines
621621 break;
622622
623623 case READ_COMPLETED_WITH_ERROR:
624− drbd_set_out_of_sync(peer_device, req->i.sector, req->i.size);
624+ drbd_set_out_of_sync(first_peer_device(device),
625+ req->i.sector, req->i.size);
625626 drbd_report_io_error(device, req);
626627 __drbd_chk_io_error(device, DRBD_READ_ERROR);
627628 fallthrough;
drivers/block/ublk_drv.c+12−4
@@ -4443,7 +4443,9 @@ static int ublk_ctrl_start_dev(struct ublk_device *ub, · 4442 unmodified lines
44434443
44444444 /* Skip partition scan if disabled by user */
44454445 if (ub->dev_info.flags & UBLK_F_NO_AUTO_PART_SCAN) {
4446− clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state);
4446+ /* Not clear for unprivileged daemons, see comment above */
4447+ if (!ub->unprivileged_daemons)
4448+ clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state);
44474449 } else {
44484450 /* Schedule async partition scan for trusted daemons */
44494451 if (!ub->unprivileged_daemons)
@@ -5006,15 +5008,22 @@ static int ublk_ctrl_get_features(const struct ublksrv_ctrl_cmd *header) · 556 unmodified lines
50065008 return 0;
50075009 }
50085010
5009−static void ublk_ctrl_set_size(struct ublk_device *ub, const struct ublksrv_ctrl_cmd *header)
5011+static int ublk_ctrl_set_size(struct ublk_device *ub, const struct ublksrv_ctrl_cmd *header)
50105012 {
50115013 struct ublk_param_basic *p = &ub->params.basic;
50125014 u64 new_size = header->data[0];
5015+ int ret = 0;
50135016
50145017 mutex_lock(&ub->mutex);
5018+ if (!ub->ub_disk) {
5019+ ret = -ENODEV;
5020+ goto out;
5021+ }
50155022 p->dev_sectors = new_size;
50165023 set_capacity_and_notify(ub->ub_disk, p->dev_sectors);
5024+out:
50175025 mutex_unlock(&ub->mutex);
5026+ return ret;
50185027 }
50195028
50205029 struct count_busy {
@@ -5335,8 +5344,7 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd, · 314 unmodified lines
53355344 ret = ublk_ctrl_end_recovery(ub, &header);
53365345 break;
53375346 case UBLK_CMD_UPDATE_SIZE:
5338− ublk_ctrl_set_size(ub, &header);
5339− ret = 0;
5347+ ret = ublk_ctrl_set_size(ub, &header);
53405348 break;
53415349 case UBLK_CMD_QUIESCE_DEV:
53425350 ret = ublk_ctrl_quiesce_dev(ub, &header);
drivers/block/zloop.c+24−7
@@ -542,6 +542,21 @@ out: · 541 unmodified lines
542542 zloop_put_cmd(cmd);
543543 }
544544
545+/*
546+ * Sync the entire FS containing the zone files instead of walking all files.
547+ */
548+static int zloop_flush(struct zloop_device *zlo)
549+{
550+ struct super_block *sb = file_inode(zlo->data_dir)->i_sb;
551+ int ret;
552+
553+ down_read(&sb->s_umount);
554+ ret = sync_filesystem(sb);
555+ up_read(&sb->s_umount);
556+
557+ return ret;
558+}
559+
545560 static void zloop_handle_cmd(struct zloop_cmd *cmd)
546561 {
547562 struct request *rq = blk_mq_rq_from_pdu(cmd);
@@ -562,11 +577,7 @@ static void zloop_handle_cmd(struct zloop_cmd *cmd) · 14 unmodified lines
562577 zloop_rw(cmd);
563578 return;
564579 case REQ_OP_FLUSH:
565− /*
566− * Sync the entire FS containing the zone files instead of
567− * walking all files
568− */
569− cmd->ret = sync_filesystem(file_inode(zlo->data_dir)->i_sb);
580+ cmd->ret = zloop_flush(zlo);
570581 break;
571582 case REQ_OP_ZONE_RESET:
572583 cmd->ret = zloop_reset_zone(zlo, rq_zone_no(rq));
@@ -981,7 +992,8 @@ static int zloop_ctl_add(struct zloop_options *opts) · 408 unmodified lines
981992 struct queue_limits lim = {
982993 .max_hw_sectors = SZ_1M >> SECTOR_SHIFT,
983994 .chunk_sectors = opts->zone_size,
984− .features = BLK_FEAT_ZONED,
995+ .features = BLK_FEAT_ZONED | BLK_FEAT_WRITE_CACHE,
996+
985997 };
986998 unsigned int nr_zones, i, j;
987999 struct zloop_device *zlo;
@@ -1162,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts) · 174 unmodified lines
11621174 int ret;
11631175
11641176 if (!(opts->mask & ZLOOP_OPT_ID)) {
1165− pr_err("No ID specified\n");
1177+ pr_err("No ID specified for remove\n");
1178+ return -EINVAL;
1179+ }
1180+
1181+ if (opts->mask & ~ZLOOP_OPT_ID) {
1182+ pr_err("Invalid option specified for remove\n");
11661183 return -EINVAL;
11671184 }
11681185
drivers/block/zram/zram_drv.c+12−12
@@ -549,7 +549,7 @@ static ssize_t bd_stat_show(struct device *dev, struct device_attribute *attr, · 548 unmodified lines
549549 return ret;
550550 }
551551
552−static ssize_t writeback_compressed_store(struct device *dev,
552+static ssize_t compressed_writeback_store(struct device *dev,
553553 struct device_attribute *attr,
554554 const char *buf, size_t len)
555555 {
@@ -564,12 +564,12 @@ static ssize_t writeback_compressed_store(struct device *dev, · 8 unmodified lines
564564 return -EBUSY;
565565 }
566566
567− zram->wb_compressed = val;
567+ zram->compressed_wb = val;
568568
569569 return len;
570570 }
571571
572−static ssize_t writeback_compressed_show(struct device *dev,
572+static ssize_t compressed_writeback_show(struct device *dev,
573573 struct device_attribute *attr,
574574 char *buf)
575575 {
@@ -577,7 +577,7 @@ static ssize_t writeback_compressed_show(struct device *dev, · 1 unmodified line
577577 struct zram *zram = dev_to_zram(dev);
578578
579579 guard(rwsem_read)(&zram->dev_lock);
580− val = zram->wb_compressed;
580+ val = zram->compressed_wb;
581581
582582 return sysfs_emit(buf, "%d\n", val);
583583 }
@@ -946,7 +946,7 @@ static int zram_writeback_complete(struct zram *zram, struct zram_wb_req *req) · 362 unmodified lines
946946 goto out;
947947 }
948948
949− if (zram->wb_compressed) {
949+ if (zram->compressed_wb) {
950950 /*
951951 * ZRAM_WB slots get freed, we need to preserve data required
952952 * for read decompression.
@@ -960,7 +960,7 @@ static int zram_writeback_complete(struct zram *zram, struct zram_wb_req *req) · 7 unmodified lines
960960 set_slot_flag(zram, index, ZRAM_WB);
961961 set_slot_handle(zram, index, req->blk_idx);
962962
963− if (zram->wb_compressed) {
963+ if (zram->compressed_wb) {
964964 if (huge)
965965 set_slot_flag(zram, index, ZRAM_HUGE);
966966 set_slot_size(zram, index, size);
@@ -1100,7 +1100,7 @@ static int zram_writeback_slots(struct zram *zram, · 133 unmodified lines
11001100 */
11011101 if (!test_slot_flag(zram, index, ZRAM_PP_SLOT))
11021102 goto next;
1103− if (zram->wb_compressed)
1103+ if (zram->compressed_wb)
11041104 err = read_from_zspool_raw(zram, req->page, index);
11051105 else
11061106 err = read_from_zspool(zram, req->page, index);
@@ -1429,7 +1429,7 @@ static void zram_async_read_endio(struct bio *bio) · 322 unmodified lines
14291429 *
14301430 * Keep the existing behavior for now.
14311431 */
1432− if (zram->wb_compressed == false) {
1432+ if (zram->compressed_wb == false) {
14331433 /* No decompression needed, complete the parent IO */
14341434 bio_endio(req->parent);
14351435 bio_put(bio);
@@ -1508,7 +1508,7 @@ static int read_from_bdev_sync(struct zram *zram, struct page *page, u32 index, · 72 unmodified lines
15081508 flush_work(&req.work);
15091509 destroy_work_on_stack(&req.work);
15101510
1511− if (req.error || zram->wb_compressed == false)
1511+ if (req.error || zram->compressed_wb == false)
15121512 return req.error;
15131513
15141514 return decompress_bdev_page(zram, page, index);
@@ -3007,7 +3007,7 @@ static DEVICE_ATTR_WO(writeback); · 1492 unmodified lines
30073007 static DEVICE_ATTR_RW(writeback_limit);
30083008 static DEVICE_ATTR_RW(writeback_limit_enable);
30093009 static DEVICE_ATTR_RW(writeback_batch_size);
3010−static DEVICE_ATTR_RW(writeback_compressed);
3010+static DEVICE_ATTR_RW(compressed_writeback);
30113011 #endif
30123012 #ifdef CONFIG_ZRAM_MULTI_COMP
30133013 static DEVICE_ATTR_RW(recomp_algorithm);
@@ -3031,7 +3031,7 @@ static struct attribute *zram_disk_attrs[] = { · 17 unmodified lines
30313031 &dev_attr_writeback_limit.attr,
30323032 &dev_attr_writeback_limit_enable.attr,
30333033 &dev_attr_writeback_batch_size.attr,
3034− &dev_attr_writeback_compressed.attr,
3034+ &dev_attr_compressed_writeback.attr,
30353035 #endif
30363036 &dev_attr_io_stat.attr,
30373037 &dev_attr_mm_stat.attr,
@@ -3091,7 +3091,7 @@ static int zram_add(void) · 53 unmodified lines
30913091 init_rwsem(&zram->dev_lock);
30923092 #ifdef CONFIG_ZRAM_WRITEBACK
30933093 zram->wb_batch_size = 32;
3094− zram->wb_compressed = false;
3094+ zram->compressed_wb = false;
30953095 #endif
30963096
30973097 /* gendisk structure */
drivers/block/zram/zram_drv.h+1−1
@@ -133,7 +133,7 @@ struct zram { · 132 unmodified lines
133133 #ifdef CONFIG_ZRAM_WRITEBACK
134134 struct file *backing_dev;
135135 bool wb_limit_enable;
136− bool wb_compressed;
136+ bool compressed_wb;
137137 u32 wb_batch_size;
138138 u64 bd_wb_limit;
139139 struct block_device *bdev;
drivers/bluetooth/hci_qca.c+14−10
@@ -2046,19 +2046,23 @@ retry: · 2045 unmodified lines
20462046 }
20472047
20482048 out:
2049− if (ret && retries < MAX_INIT_RETRIES) {
2050− bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
2049+ if (ret) {
20512050 qca_power_shutdown(hu);
2052− if (hu->serdev) {
2053− serdev_device_close(hu->serdev);
2054− ret = serdev_device_open(hu->serdev);
2055− if (ret) {
2056− bt_dev_err(hdev, "failed to open port");
2057− return ret;
2051+
2052+ if (retries < MAX_INIT_RETRIES) {
2053+ bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
2054+ if (hu->serdev) {
2055+ serdev_device_close(hu->serdev);
2056+ ret = serdev_device_open(hu->serdev);
2057+ if (ret) {
2058+ bt_dev_err(hdev, "failed to open port");
2059+ return ret;
2060+ }
20582061 }
2062+ retries++;
2063+ goto retry;
20592064 }
2060− retries++;
2061− goto retry;
2065+ return ret;
20622066 }
20632067
20642068 /* Setup bdaddr */
drivers/char/ipmi/ipmi_ipmb.c+5−0
@@ -202,11 +202,16 @@ static int ipmi_ipmb_slave_cb(struct i2c_client *client, · 201 unmodified lines
202202 break;
203203
204204 case I2C_SLAVE_READ_REQUESTED:
205+ *val = 0xff;
206+ ipmi_ipmb_check_msg_done(iidev);
207+ break;
208+
205209 case I2C_SLAVE_STOP:
206210 ipmi_ipmb_check_msg_done(iidev);
207211 break;
208212
209213 case I2C_SLAVE_READ_PROCESSED:
214+ *val = 0xff;
210215 break;
211216 }
212217
drivers/char/ipmi/ipmi_msghandler.c+95−46
@@ -602,6 +602,22 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf, · 601 unmodified lines
602602 static int __scan_channels(struct ipmi_smi *intf,
603603 struct ipmi_device_id *id, bool rescan);
604604
605+static void ipmi_lock_xmit_msgs(struct ipmi_smi *intf, int run_to_completion,
606+ unsigned long *flags)
607+{
608+ if (run_to_completion)
609+ return;
610+ spin_lock_irqsave(&intf->xmit_msgs_lock, *flags);
611+}
612+
613+static void ipmi_unlock_xmit_msgs(struct ipmi_smi *intf, int run_to_completion,
614+ unsigned long *flags)
615+{
616+ if (run_to_completion)
617+ return;
618+ spin_unlock_irqrestore(&intf->xmit_msgs_lock, *flags);
619+}
620+
605621 static void free_ipmi_user(struct kref *ref)
606622 {
607623 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
@@ -1869,21 +1885,32 @@ static struct ipmi_smi_msg *smi_add_send_msg(struct ipmi_smi *intf, · 1261 unmodified lines
18691885 return smi_msg;
18701886 }
18711887
1872−static void smi_send(struct ipmi_smi *intf,
1888+static int smi_send(struct ipmi_smi *intf,
18731889 const struct ipmi_smi_handlers *handlers,
18741890 struct ipmi_smi_msg *smi_msg, int priority)
18751891 {
18761892 int run_to_completion = READ_ONCE(intf->run_to_completion);
18771893 unsigned long flags = 0;
1894+ int rv = 0;
18781895
1879− if (!run_to_completion)
1880− spin_lock_irqsave(&intf->xmit_msgs_lock, flags);
1896+ ipmi_lock_xmit_msgs(intf, run_to_completion, &flags);
18811897 smi_msg = smi_add_send_msg(intf, smi_msg, priority);
1882− if (!run_to_completion)
1883− spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags);
1898+ ipmi_unlock_xmit_msgs(intf, run_to_completion, &flags);
18841899
1885− if (smi_msg)
1886− handlers->sender(intf->send_info, smi_msg);
1900+ if (smi_msg) {
1901+ rv = handlers->sender(intf->send_info, smi_msg);
1902+ if (rv) {
1903+ ipmi_lock_xmit_msgs(intf, run_to_completion, &flags);
1904+ intf->curr_msg = NULL;
1905+ ipmi_unlock_xmit_msgs(intf, run_to_completion, &flags);
1906+ /*
1907+ * Something may have been added to the transmit
1908+ * queue, so schedule a check for that.
1909+ */
1910+ queue_work(system_wq, &intf->smi_work);
1911+ }
1912+ }
1913+ return rv;
18871914 }
18881915
18891916 static bool is_maintenance_mode_cmd(struct kernel_ipmi_msg *msg)
@@ -2296,6 +2323,7 @@ static int i_ipmi_request(struct ipmi_user *user, · 406 unmodified lines
22962323 struct ipmi_recv_msg *recv_msg;
22972324 int run_to_completion = READ_ONCE(intf->run_to_completion);
22982325 int rv = 0;
2326+ bool in_seq_table = false;
22992327
23002328 if (supplied_recv) {
23012329 recv_msg = supplied_recv;
@@ -2349,33 +2377,50 @@ static int i_ipmi_request(struct ipmi_user *user, · 47 unmodified lines
23492377 rv = i_ipmi_req_ipmb(intf, addr, msgid, msg, smi_msg, recv_msg,
23502378 source_address, source_lun,
23512379 retries, retry_time_ms);
2380+ in_seq_table = true;
23522381 } else if (is_ipmb_direct_addr(addr)) {
23532382 rv = i_ipmi_req_ipmb_direct(intf, addr, msgid, msg, smi_msg,
23542383 recv_msg, source_lun);
23552384 } else if (is_lan_addr(addr)) {
23562385 rv = i_ipmi_req_lan(intf, addr, msgid, msg, smi_msg, recv_msg,
23572386 source_lun, retries, retry_time_ms);
2387+ in_seq_table = true;
23582388 } else {
2359− /* Unknown address type. */
2389+ /* Unknown address type. */
23602390 ipmi_inc_stat(intf, sent_invalid_commands);
23612391 rv = -EINVAL;
23622392 }
23632393
2364− if (rv) {
2365−out_err:
2366− if (!supplied_smi)
2367− ipmi_free_smi_msg(smi_msg);
2368− if (!supplied_recv)
2369− ipmi_free_recv_msg(recv_msg);
2370− } else {
2394+ if (!rv) {
23712395 dev_dbg(intf->si_dev, "Send: %*ph\n",
23722396 smi_msg->data_size, smi_msg->data);
23732397
2374− smi_send(intf, intf->handlers, smi_msg, priority);
2398+ rv = smi_send(intf, intf->handlers, smi_msg, priority);
2399+ if (rv != IPMI_CC_NO_ERROR)
2400+ /* smi_send() returns an IPMI err, return a Linux one. */
2401+ rv = -EIO;
2402+ if (rv && in_seq_table) {
2403+ /*
2404+ * If it's in the sequence table, it will be
2405+ * retried later, so ignore errors.
2406+ */
2407+ rv = 0;
2408+ /* But we need to fix the timeout. */
2409+ intf_start_seq_timer(intf, smi_msg->msgid);
2410+ ipmi_free_smi_msg(smi_msg);
2411+ smi_msg = NULL;
2412+ }
23752413 }
2414+out_err:
23762415 if (!run_to_completion)
23772416 mutex_unlock(&intf->users_mutex);
23782417
2418+ if (rv) {
2419+ if (!supplied_smi)
2420+ ipmi_free_smi_msg(smi_msg);
2421+ if (!supplied_recv)
2422+ ipmi_free_recv_msg(recv_msg);
2423+ }
23792424 return rv;
23802425 }
23812426
@@ -3949,12 +3994,12 @@ static int handle_ipmb_get_msg_cmd(struct ipmi_smi *intf, · 1567 unmodified lines
39493994 dev_dbg(intf->si_dev, "Invalid command: %*ph\n",
39503995 msg->data_size, msg->data);
39513996
3952− smi_send(intf, intf->handlers, msg, 0);
3953− /*
3954− * We used the message, so return the value that
3955− * causes it to not be freed or queued.
3956− */
3957− rv = -1;
3997+ if (smi_send(intf, intf->handlers, msg, 0) == IPMI_CC_NO_ERROR)
3998+ /*
3999+ * We used the message, so return the value that
4000+ * causes it to not be freed or queued.
4001+ */
4002+ rv = -1;
39584003 } else if (!IS_ERR(recv_msg)) {
39594004 /* Extract the source address from the data. */
39604005 ipmb_addr = (struct ipmi_ipmb_addr *) &recv_msg->addr;
@@ -4028,12 +4073,12 @@ static int handle_ipmb_direct_rcv_cmd(struct ipmi_smi *intf, · 67 unmodified lines
40284073 msg->data[4] = IPMI_INVALID_CMD_COMPLETION_CODE;
40294074 msg->data_size = 5;
40304075
4031− smi_send(intf, intf->handlers, msg, 0);
4032− /*
4033− * We used the message, so return the value that
4034− * causes it to not be freed or queued.
4035− */
4036− rv = -1;
4076+ if (smi_send(intf, intf->handlers, msg, 0) == IPMI_CC_NO_ERROR)
4077+ /*
4078+ * We used the message, so return the value that
4079+ * causes it to not be freed or queued.
4080+ */
4081+ rv = -1;
40374082 } else if (!IS_ERR(recv_msg)) {
40384083 /* Extract the source address from the data. */
40394084 daddr = (struct ipmi_ipmb_direct_addr *)&recv_msg->addr;
@@ -4173,7 +4218,7 @@ static int handle_lan_get_msg_cmd(struct ipmi_smi *intf, · 133 unmodified lines
41734218 struct ipmi_smi_msg *msg)
41744219 {
41754220 struct cmd_rcvr *rcvr;
4176− int rv = 0;
4221+ int rv = 0; /* Free by default */
41774222 unsigned char netfn;
41784223 unsigned char cmd;
41794224 unsigned char chan;
@@ -4226,12 +4271,12 @@ static int handle_lan_get_msg_cmd(struct ipmi_smi *intf, · 46 unmodified lines
42264271 dev_dbg(intf->si_dev, "Invalid command: %*ph\n",
42274272 msg->data_size, msg->data);
42284273
4229− smi_send(intf, intf->handlers, msg, 0);
4230− /*
4231− * We used the message, so return the value that
4232− * causes it to not be freed or queued.
4233− */
4234− rv = -1;
4274+ if (smi_send(intf, intf->handlers, msg, 0) == IPMI_CC_NO_ERROR)
4275+ /*
4276+ * We used the message, so return the value that
4277+ * causes it to not be freed or queued.
4278+ */
4279+ rv = -1;
42354280 } else if (!IS_ERR(recv_msg)) {
42364281 /* Extract the source address from the data. */
42374282 lan_addr = (struct ipmi_lan_addr *) &recv_msg->addr;
@@ -4824,8 +4869,7 @@ static void smi_work(struct work_struct *t) · 586 unmodified lines
48244869 * message delivery.
48254870 */
48264871 restart:
4827− if (!run_to_completion)
4828− spin_lock_irqsave(&intf->xmit_msgs_lock, flags);
4872+ ipmi_lock_xmit_msgs(intf, run_to_completion, &flags);
48294873 if (intf->curr_msg == NULL && !intf->in_shutdown) {
48304874 struct list_head *entry = NULL;
48314875
@@ -4841,8 +4885,7 @@ restart: · 9 unmodified lines
48414885 intf->curr_msg = newmsg;
48424886 }
48434887 }
4844− if (!run_to_completion)
4845− spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags);
4888+ ipmi_unlock_xmit_msgs(intf, run_to_completion, &flags);
48464889
48474890 if (newmsg) {
48484891 cc = intf->handlers->sender(intf->send_info, newmsg);
@@ -4850,8 +4893,11 @@ restart: · 1 unmodified line
48504893 if (newmsg->recv_msg)
48514894 deliver_err_response(intf,
48524895 newmsg->recv_msg, cc);
4853− else
4854− ipmi_free_smi_msg(newmsg);
4896+ ipmi_lock_xmit_msgs(intf, run_to_completion, &flags);
4897+ intf->curr_msg = NULL;
4898+ ipmi_unlock_xmit_msgs(intf, run_to_completion, &flags);
4899+ ipmi_free_smi_msg(newmsg);
4900+ newmsg = NULL;
48554901 goto restart;
48564902 }
48574903 }
@@ -4919,16 +4965,14 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf, · 61 unmodified lines
49194965 spin_unlock_irqrestore(&intf->waiting_rcv_msgs_lock,
49204966 flags);
49214967
4922− if (!run_to_completion)
4923− spin_lock_irqsave(&intf->xmit_msgs_lock, flags);
4968+ ipmi_lock_xmit_msgs(intf, run_to_completion, &flags);
49244969 /*
49254970 * We can get an asynchronous event or receive message in addition
49264971 * to commands we send.
49274972 */
49284973 if (msg == intf->curr_msg)
49294974 intf->curr_msg = NULL;
4930− if (!run_to_completion)
4931− spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags);
4975+ ipmi_unlock_xmit_msgs(intf, run_to_completion, &flags);
49324976
49334977 if (run_to_completion)
49344978 smi_work(&intf->smi_work);
@@ -5041,7 +5085,12 @@ static void check_msg_timeout(struct ipmi_smi *intf, struct seq_table *ent, · 106 unmodified lines
50415085 ipmi_inc_stat(intf,
50425086 retransmitted_ipmb_commands);
50435087
5044− smi_send(intf, intf->handlers, smi_msg, 0);
5088+ /* If this fails we'll retry later or timeout. */
5089+ if (smi_send(intf, intf->handlers, smi_msg, 0) != IPMI_CC_NO_ERROR) {
5090+ /* But fix the timeout. */
5091+ intf_start_seq_timer(intf, smi_msg->msgid);
5092+ ipmi_free_smi_msg(smi_msg);
5093+ }
50455094 } else
50465095 ipmi_free_smi_msg(smi_msg);
50475096
drivers/char/ipmi/ipmi_si_intf.c+24−13
@@ -809,6 +809,12 @@ restart: · 808 unmodified lines
809809 */
810810 return_hosed_msg(smi_info, IPMI_BUS_ERR);
811811 }
812+ if (smi_info->waiting_msg != NULL) {
813+ /* Also handle if there was a message waiting. */
814+ smi_info->curr_msg = smi_info->waiting_msg;
815+ smi_info->waiting_msg = NULL;
816+ return_hosed_msg(smi_info, IPMI_BUS_ERR);
817+ }
812818 smi_mod_timer(smi_info, jiffies + SI_TIMEOUT_HOSED);
813819 goto out;
814820 }
@@ -918,9 +924,14 @@ static int sender(void *send_info, struct ipmi_smi_msg *msg) · 103 unmodified lines
918924 {
919925 struct smi_info *smi_info = send_info;
920926 unsigned long flags;
927+ int rv = IPMI_CC_NO_ERROR;
921928
922929 debug_timestamp(smi_info, "Enqueue");
923930
931+ /*
932+ * Check here for run to completion mode. A check under lock is
933+ * later.
934+ */
924935 if (smi_info->si_state == SI_HOSED)
925936 return IPMI_BUS_ERR;
926937
@@ -934,18 +945,15 @@ static int sender(void *send_info, struct ipmi_smi_msg *msg) · 7 unmodified lines
934945 }
935946
936947 spin_lock_irqsave(&smi_info->si_lock, flags);
937− /*
938− * The following two lines don't need to be under the lock for
939− * the lock's sake, but they do need SMP memory barriers to
940− * avoid getting things out of order. We are already claiming
941− * the lock, anyway, so just do it under the lock to avoid the
942− * ordering problem.
943− */
944− BUG_ON(smi_info->waiting_msg);
945− smi_info->waiting_msg = msg;
946− check_start_timer_thread(smi_info);
948+ if (smi_info->si_state == SI_HOSED) {
949+ rv = IPMI_BUS_ERR;
950+ } else {
951+ BUG_ON(smi_info->waiting_msg);
952+ smi_info->waiting_msg = msg;
953+ check_start_timer_thread(smi_info);
954+ }
947955 spin_unlock_irqrestore(&smi_info->si_lock, flags);
948− return IPMI_CC_NO_ERROR;
956+ return rv;
949957 }
950958
951959 static void set_run_to_completion(void *send_info, bool i_run_to_completion)
@@ -1113,7 +1121,9 @@ static void smi_timeout(struct timer_list *t) · 161 unmodified lines
11131121 * SI_USEC_PER_JIFFY);
11141122 smi_result = smi_event_handler(smi_info, time_diff);
11151123
1116− if ((smi_info->io.irq) && (!smi_info->interrupt_disabled)) {
1124+ if (smi_info->si_state == SI_HOSED) {
1125+ timeout = jiffies + SI_TIMEOUT_HOSED;
1126+ } else if ((smi_info->io.irq) && (!smi_info->interrupt_disabled)) {
11171127 /* Running with interrupts, only do long timeouts. */
11181128 timeout = jiffies + SI_TIMEOUT_JIFFIES;
11191129 smi_inc_stat(smi_info, long_timeouts);
@@ -2226,7 +2236,8 @@ static void wait_msg_processed(struct smi_info *smi_info) · 1106 unmodified lines
22262236 unsigned long jiffies_now;
22272237 long time_diff;
22282238
2229− while (smi_info->curr_msg || (smi_info->si_state != SI_NORMAL)) {
2239+ while (smi_info->si_state != SI_HOSED &&
2240+ (smi_info->curr_msg || (smi_info->si_state != SI_NORMAL))) {
22302241 jiffies_now = jiffies;
22312242 time_diff = (((long)jiffies_now - (long)smi_info->last_timeout_jiffies)
22322243 * SI_USEC_PER_JIFFY);
drivers/char/ipmi/ipmi_si_ls2k.c+1−1
@@ -168,7 +168,7 @@ static void ipmi_ls2k_remove(struct platform_device *pdev) · 167 unmodified lines
168168 ipmi_si_remove_by_dev(&pdev->dev);
169169 }
170170
171−struct platform_driver ipmi_ls2k_platform_driver = {
171+static struct platform_driver ipmi_ls2k_platform_driver = {
172172 .driver = {
173173 .name = "ls2k-ipmi-si",
174174 },
drivers/char/random.c+1−11
@@ -96,8 +96,7 @@ static ATOMIC_NOTIFIER_HEAD(random_ready_notifier); · 95 unmodified lines
9696 /* Control how we warn userspace. */
9797 static struct ratelimit_state urandom_warning =
9898 RATELIMIT_STATE_INIT_FLAGS("urandom_warning", HZ, 3, RATELIMIT_MSG_ON_RELEASE);
99−static int ratelimit_disable __read_mostly =
100− IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM);
99+static int ratelimit_disable __read_mostly = 0;
101100 module_param_named(ratelimit_disable, ratelimit_disable, int, 0644);
102101 MODULE_PARM_DESC(ratelimit_disable, "Disable random ratelimit suppression");
103102
@@ -168,12 +167,6 @@ int __cold execute_with_initialized_rng(struct notifier_block *nb) · 64 unmodified lines
168167 return ret;
169168 }
170169
171−#define warn_unseeded_randomness() \
172− if (IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM) && !crng_ready()) \
173− printk_deferred(KERN_NOTICE "random: %s called from %pS with crng_init=%d\n", \
174− __func__, (void *)_RET_IP_, crng_init)
175−
176−
177170 /*********************************************************************
178171 *
179172 * Fast key erasure RNG, the "crng".
@@ -434,7 +427,6 @@ static void _get_random_bytes(void *buf, size_t len) · 254 unmodified lines
434427 */
435428 void get_random_bytes(void *buf, size_t len)
436429 {
437− warn_unseeded_randomness();
438430 _get_random_bytes(buf, len);
439431 }
440432 EXPORT_SYMBOL(get_random_bytes);
@@ -523,8 +515,6 @@ type get_random_ ##type(void) \ · 82 unmodified lines
523515 struct batch_ ##type *batch; \
524516 unsigned long next_gen; \
525517 \
526− warn_unseeded_randomness(); \
527− \
528518 if (!crng_ready()) { \
529519 _get_random_bytes(&ret, sizeof(ret)); \
530520 return ret; \
drivers/clk/imx/clk-imx8qxp.c+23−1
@@ -346,7 +346,29 @@ static struct platform_driver imx8qxp_clk_driver = { · 345 unmodified lines
346346 },
347347 .probe = imx8qxp_clk_probe,
348348 };
349−module_platform_driver(imx8qxp_clk_driver);
349+
350+static int __init imx8qxp_clk_init(void)
351+{
352+ int ret;
353+
354+ ret = platform_driver_register(&imx8qxp_clk_driver);
355+ if (ret)
356+ return ret;
357+
358+ ret = imx_clk_scu_module_init();
359+ if (ret)
360+ platform_driver_unregister(&imx8qxp_clk_driver);
361+
362+ return ret;
363+}
364+module_init(imx8qxp_clk_init);
365+
366+static void __exit imx8qxp_clk_exit(void)
367+{
368+ imx_clk_scu_module_exit();
369+ platform_driver_unregister(&imx8qxp_clk_driver);
370+}
371+module_exit(imx8qxp_clk_exit);
350372
351373 MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
352374 MODULE_DESCRIPTION("NXP i.MX8QXP clock driver");
drivers/clk/imx/clk-scu.c+11−1
@@ -191,6 +191,16 @@ static bool imx_scu_clk_is_valid(u32 rsrc_id) · 190 unmodified lines
191191 return p != NULL;
192192 }
193193
194+int __init imx_clk_scu_module_init(void)
195+{
196+ return platform_driver_register(&imx_clk_scu_driver);
197+}
198+
199+void __exit imx_clk_scu_module_exit(void)
200+{
201+ return platform_driver_unregister(&imx_clk_scu_driver);
202+}
203+
194204 int imx_clk_scu_init(struct device_node *np,
195205 const struct imx_clk_scu_rsrc_table *data)
196206 {
@@ -215,7 +225,7 @@ int imx_clk_scu_init(struct device_node *np, · 18 unmodified lines
215225 rsrc_table = data;
216226 }
217227
218− return platform_driver_register(&imx_clk_scu_driver);
228+ return 0;
219229 }
220230
221231 /*
drivers/clk/imx/clk-scu.h+2−0
@@ -25,6 +25,8 @@ extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8dxl; · 24 unmodified lines
2525 extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qxp;
2626 extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qm;
2727
28+int __init imx_clk_scu_module_init(void);
29+void __exit imx_clk_scu_module_exit(void);
2830 int imx_clk_scu_init(struct device_node *np,
2931 const struct imx_clk_scu_rsrc_table *data);
3032 struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec,
drivers/cpufreq/intel_pstate.c+8−6
@@ -1476,13 +1476,13 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy, · 1475 unmodified lines
14761476 refresh_frequency_limits(policy);
14771477 }
14781478
1479−static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
1479+static bool intel_pstate_update_max_freq(int cpu)
14801480 {
1481− struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
1481+ struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
14821482 if (!policy)
14831483 return false;
14841484
1485− __intel_pstate_update_max_freq(policy, cpudata);
1485+ __intel_pstate_update_max_freq(policy, all_cpu_data[cpu]);
14861486
14871487 return true;
14881488 }
@@ -1501,7 +1501,7 @@ static void intel_pstate_update_limits_for_all(void) · 12 unmodified lines
15011501 int cpu;
15021502
15031503 for_each_possible_cpu(cpu)
1504− intel_pstate_update_max_freq(all_cpu_data[cpu]);
1504+ intel_pstate_update_max_freq(cpu);
15051505
15061506 mutex_lock(&hybrid_capacity_lock);
15071507
@@ -1647,8 +1647,8 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b, · 139 unmodified lines
16471647 static void update_cpu_qos_request(int cpu, enum freq_qos_req_type type)
16481648 {
16491649 struct cpudata *cpudata = all_cpu_data[cpu];
1650− unsigned int freq = cpudata->pstate.turbo_freq;
16511650 struct freq_qos_request *req;
1651+ unsigned int freq;
16521652
16531653 struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
16541654 if (!policy)
@@ -1661,6 +1661,8 @@ static void update_cpu_qos_request(int cpu, enum freq_qos_req_type type) · 6 unmodified lines
16611661 if (hwp_active)
16621662 intel_pstate_get_hwp_cap(cpudata);
16631663
1664+ freq = cpudata->pstate.turbo_freq;
1665+
16641666 if (type == FREQ_QOS_MIN) {
16651667 freq = DIV_ROUND_UP(freq * global.min_perf_pct, 100);
16661668 } else {
@@ -1908,7 +1910,7 @@ static void intel_pstate_notify_work(struct work_struct *work) · 241 unmodified lines
19081910 struct cpudata *cpudata =
19091911 container_of(to_delayed_work(work), struct cpudata, hwp_notify_work);
19101912
1911− if (intel_pstate_update_max_freq(cpudata)) {
1913+ if (intel_pstate_update_max_freq(cpudata->cpu)) {
19121914 /*
19131915 * The driver will not be unregistered while this function is
19141916 * running, so update the capacity without acquiring the driver
drivers/cpuidle/cpuidle.c+0−10
@@ -359,16 +359,6 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev, · 358 unmodified lines
359359 int cpuidle_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
360360 bool *stop_tick)
361361 {
362− /*
363− * If there is only a single idle state (or none), there is nothing
364− * meaningful for the governor to choose. Skip the governor and
365− * always use state 0 with the tick running.
366− */
367− if (drv->state_count <= 1) {
368− *stop_tick = false;
369− return 0;
370− }
371−
372362 return cpuidle_curr_governor->select(drv, dev, stop_tick);
373363 }
374364
drivers/crypto/atmel-sha204a.c+3−2
@@ -52,9 +52,10 @@ static int atmel_sha204a_rng_read_nonblocking(struct hwrng *rng, void *data, · 51 unmodified lines
5252 rng->priv = 0;
5353 } else {
5454 work_data = kmalloc_obj(*work_data, GFP_ATOMIC);
55− if (!work_data)
55+ if (!work_data) {
56+ atomic_dec(&i2c_priv->tfm_count);
5657 return -ENOMEM;
57−
58+ }
5859 work_data->ctx = i2c_priv;
5960 work_data->client = i2c_priv->client;
6061
drivers/crypto/ccp/sev-dev-tsm.c+1−1
@@ -378,9 +378,9 @@ void sev_tsm_init_locked(struct sev_device *sev, void *tio_status_page) · 377 unmodified lines
378378 return;
379379
380380 error_exit:
381− kfree(t);
382381 pr_err("Failed to enable SEV-TIO: ret=%d en=%d initdone=%d SEV=%d\n",
383382 ret, t->tio_en, t->tio_init_done, boot_cpu_has(X86_FEATURE_SEV));
383+ kfree(t);
384384 }
385385
386386 void sev_tsm_uninit(struct sev_device *sev)
drivers/crypto/ccp/sev-dev.c+4−6
@@ -1105,15 +1105,12 @@ struct page *snp_alloc_hv_fixed_pages(unsigned int num_2mb_pages) · 1104 unmodified lines
11051105 {
11061106 struct psp_device *psp_master = psp_get_master_device();
11071107 struct snp_hv_fixed_pages_entry *entry;
1108− struct sev_device *sev;
11091108 unsigned int order;
11101109 struct page *page;
11111110
1112− if (!psp_master || !psp_master->sev_data)
1111+ if (!psp_master)
11131112 return NULL;
11141113
1115− sev = psp_master->sev_data;
1116−
11171114 order = get_order(PMD_SIZE * num_2mb_pages);
11181115
11191116 /*
@@ -1126,7 +1123,8 @@ struct page *snp_alloc_hv_fixed_pages(unsigned int num_2mb_pages) · 6 unmodified lines
11261123 * This API uses SNP_INIT_EX to transition allocated pages to HV_Fixed
11271124 * page state, fail if SNP is already initialized.
11281125 */
1129− if (sev->snp_initialized)
1126+ if (psp_master->sev_data &&
1127+ ((struct sev_device *)psp_master->sev_data)->snp_initialized)
11301128 return NULL;
11311129
11321130 /* Re-use freed pages that match the request */
@@ -1162,7 +1160,7 @@ void snp_free_hv_fixed_pages(struct page *page) · 29 unmodified lines
11621160 struct psp_device *psp_master = psp_get_master_device();
11631161 struct snp_hv_fixed_pages_entry *entry, *nentry;
11641162
1165− if (!psp_master || !psp_master->sev_data)
1163+ if (!psp_master)
11661164 return;
11671165
11681166 /*
drivers/cxl/core/core.h+18−0
@@ -152,6 +152,24 @@ int cxl_pci_get_bandwidth(struct pci_dev *pdev, struct access_coordinate *c); · 151 unmodified lines
152152 int cxl_port_get_switch_dport_bandwidth(struct cxl_port *port,
153153 struct access_coordinate *c);
154154
155+static inline struct device *port_to_host(struct cxl_port *port)
156+{
157+ struct cxl_port *parent = is_cxl_root(port) ? NULL :
158+ to_cxl_port(port->dev.parent);
159+
160+ /*
161+ * The host of CXL root port and the first level of ports is
162+ * the platform firmware device, the host of all other ports
163+ * is their parent port.
164+ */
165+ if (!parent)
166+ return port->uport_dev;
167+ else if (is_cxl_root(parent))
168+ return parent->uport_dev;
169+ else
170+ return &parent->dev;
171+}
172+
155173 static inline struct device *dport_to_host(struct cxl_dport *dport)
156174 {
157175 struct cxl_port *port = dport->port;
drivers/cxl/core/hdm.c+1−1
@@ -904,7 +904,7 @@ static void cxl_decoder_reset(struct cxl_decoder *cxld) · 903 unmodified lines
904904 if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)
905905 return;
906906
907− if (test_bit(CXL_DECODER_F_LOCK, &cxld->flags))
907+ if (cxld->flags & CXL_DECODER_F_LOCK)
908908 return;
909909
910910 if (port->commit_end == id)
drivers/cxl/core/mbox.c+9−2
@@ -311,6 +311,7 @@ static bool cxl_mem_raw_command_allowed(u16 opcode) · 310 unmodified lines
311311 * cxl_payload_from_user_allowed() - Check contents of in_payload.
312312 * @opcode: The mailbox command opcode.
313313 * @payload_in: Pointer to the input payload passed in from user space.
314+ * @in_size: Size of @payload_in in bytes.
314315 *
315316 * Return:
316317 * * true - payload_in passes check for @opcode.
@@ -325,12 +326,15 @@ static bool cxl_mem_raw_command_allowed(u16 opcode) · 8 unmodified lines
325326 *
326327 * The specific checks are determined by the opcode.
327328 */
328−static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in)
329+static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in,
330+ size_t in_size)
329331 {
330332 switch (opcode) {
331333 case CXL_MBOX_OP_SET_PARTITION_INFO: {
332334 struct cxl_mbox_set_partition_info *pi = payload_in;
333335
336+ if (in_size < sizeof(*pi))
337+ return false;
334338 if (pi->flags & CXL_SET_PARTITION_IMMEDIATE_FLAG)
335339 return false;
336340 break;
@@ -338,6 +342,8 @@ static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in) · 1 unmodified line
338342 case CXL_MBOX_OP_CLEAR_LOG: {
339343 const uuid_t *uuid = (uuid_t *)payload_in;
340344
345+ if (in_size < sizeof(uuid_t))
346+ return false;
341347 /*
342348 * Restrict the ‘Clear log’ action to only apply to
343349 * Vendor debug logs.
@@ -365,7 +371,8 @@ static int cxl_mbox_cmd_ctor(struct cxl_mbox_cmd *mbox_cmd, · 21 unmodified lines
365371 if (IS_ERR(mbox_cmd->payload_in))
366372 return PTR_ERR(mbox_cmd->payload_in);
367373
368− if (!cxl_payload_from_user_allowed(opcode, mbox_cmd->payload_in)) {
374+ if (!cxl_payload_from_user_allowed(opcode, mbox_cmd->payload_in,
375+ in_size)) {
369376 dev_dbg(cxl_mbox->host, "%s: input payload not allowed\n",
370377 cxl_mem_opcode_to_name(opcode));
371378 kvfree(mbox_cmd->payload_in);
drivers/cxl/core/memdev.c+9−4
@@ -1089,10 +1089,8 @@ static int cxlmd_add(struct cxl_memdev *cxlmd, struct cxl_dev_state *cxlds) · 1088 unmodified lines
10891089 DEFINE_FREE(put_cxlmd, struct cxl_memdev *,
10901090 if (!IS_ERR_OR_NULL(_T)) put_device(&_T->dev))
10911091
1092−static struct cxl_memdev *cxl_memdev_autoremove(struct cxl_memdev *cxlmd)
1092+static bool cxl_memdev_attach_failed(struct cxl_memdev *cxlmd)
10931093 {
1094− int rc;
1095−
10961094 /*
10971095 * If @attach is provided fail if the driver is not attached upon
10981096 * return. Note that failure here could be the result of a race to
@@ -1100,7 +1098,14 @@ static struct cxl_memdev *cxl_memdev_autoremove(struct cxl_memdev *cxlmd) · 1 unmodified line
11001098 * succeeded and then cxl_mem unbound before the lock is acquired.
11011099 */
11021100 guard(device)(&cxlmd->dev);
1103− if (cxlmd->attach && !cxlmd->dev.driver) {
1101+ return (cxlmd->attach && !cxlmd->dev.driver);
1102+}
1103+
1104+static struct cxl_memdev *cxl_memdev_autoremove(struct cxl_memdev *cxlmd)
1105+{
1106+ int rc;
1107+
1108+ if (cxl_memdev_attach_failed(cxlmd)) {
11041109 cxl_memdev_unregister(cxlmd);
11051110 return ERR_PTR(-ENXIO);
11061111 }
drivers/cxl/core/pmem.c+32−10
@@ -115,15 +115,17 @@ static void unregister_nvb(void *_cxl_nvb) · 114 unmodified lines
115115 device_unregister(&cxl_nvb->dev);
116116 }
117117
118−/**
119− * devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
120− * @host: platform firmware root device
121− * @port: CXL port at the root of a CXL topology
122− *
123− * Return: bridge device that can host cxl_nvdimm objects
124− */
125−struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
126− struct cxl_port *port)
118+static bool cxl_nvdimm_bridge_failed_attach(struct cxl_nvdimm_bridge *cxl_nvb)
119+{
120+ struct device *dev = &cxl_nvb->dev;
121+
122+ guard(device)(dev);
123+ /* If the device has no driver, then it failed to attach. */
124+ return dev->driver == NULL;
125+}
126+
127+struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
128+ struct cxl_port *port)
127129 {
128130 struct cxl_nvdimm_bridge *cxl_nvb;
129131 struct device *dev;
@@ -145,6 +147,11 @@ struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host, · 15 unmodified lines
145147 if (rc)
146148 goto err;
147149
150+ if (cxl_nvdimm_bridge_failed_attach(cxl_nvb)) {
151+ unregister_nvb(cxl_nvb);
152+ return ERR_PTR(-ENODEV);
153+ }
154+
148155 rc = devm_add_action_or_reset(host, unregister_nvb, cxl_nvb);
149156 if (rc)
150157 return ERR_PTR(rc);
@@ -155,7 +162,7 @@ err: · 4 unmodified lines
155162 put_device(dev);
156163 return ERR_PTR(rc);
157164 }
158−EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, "CXL");
165+EXPORT_SYMBOL_FOR_MODULES(__devm_cxl_add_nvdimm_bridge, "cxl_pmem");
159166
160167 static void cxl_nvdimm_release(struct device *dev)
161168 {
@@ -255,6 +262,21 @@ int devm_cxl_add_nvdimm(struct device *host, struct cxl_port *port, · 93 unmodified lines
255262 if (!cxl_nvb)
256263 return -ENODEV;
257264
265+ /*
266+ * Take the uport_dev lock to guard against race of nvdimm_bus object.
267+ * cxl_acpi_probe() registers the nvdimm_bus and is done under the
268+ * root port uport_dev lock.
269+ *
270+ * Take the cxl_nvb device lock to ensure that cxl_nvb driver is in a
271+ * consistent state. And the driver registers nvdimm_bus.
272+ */
273+ guard(device)(cxl_nvb->port->uport_dev);
274+ guard(device)(&cxl_nvb->dev);
275+ if (!cxl_nvb->nvdimm_bus) {
276+ rc = -ENODEV;
277+ goto err_alloc;
278+ }
279+
258280 cxl_nvd = cxl_nvdimm_alloc(cxl_nvb, cxlmd);
259281 if (IS_ERR(cxl_nvd)) {
260282 rc = PTR_ERR(cxl_nvd);
drivers/cxl/core/port.c+18−34
@@ -615,22 +615,8 @@ struct cxl_port *parent_port_of(struct cxl_port *port) · 614 unmodified lines
615615 static void unregister_port(void *_port)
616616 {
617617 struct cxl_port *port = _port;
618− struct cxl_port *parent = parent_port_of(port);
619− struct device *lock_dev;
620618
621− /*
622− * CXL root port's and the first level of ports are unregistered
623− * under the platform firmware device lock, all other ports are
624− * unregistered while holding their parent port lock.
625− */
626− if (!parent)
627− lock_dev = port->uport_dev;
628− else if (is_cxl_root(parent))
629− lock_dev = parent->uport_dev;
630− else
631− lock_dev = &parent->dev;
632−
633− device_lock_assert(lock_dev);
619+ device_lock_assert(port_to_host(port));
634620 port->dead = true;
635621 device_unregister(&port->dev);
636622 }
@@ -1427,20 +1413,11 @@ static struct device *grandparent(struct device *dev) · 790 unmodified lines
14271413 return NULL;
14281414 }
14291415
1430−static struct device *endpoint_host(struct cxl_port *endpoint)
1431−{
1432− struct cxl_port *port = to_cxl_port(endpoint->dev.parent);
1433−
1434− if (is_cxl_root(port))
1435− return port->uport_dev;
1436− return &port->dev;
1437−}
1438−
14391416 static void delete_endpoint(void *data)
14401417 {
14411418 struct cxl_memdev *cxlmd = data;
14421419 struct cxl_port *endpoint = cxlmd->endpoint;
1443− struct device *host = endpoint_host(endpoint);
1420+ struct device *host = port_to_host(endpoint);
14441421
14451422 scoped_guard(device, host) {
14461423 if (host->driver && !endpoint->dead) {
@@ -1456,7 +1433,7 @@ static void delete_endpoint(void *data) · 9 unmodified lines
14561433
14571434 int cxl_endpoint_autoremove(struct cxl_memdev *cxlmd, struct cxl_port *endpoint)
14581435 {
1459− struct device *host = endpoint_host(endpoint);
1436+ struct device *host = port_to_host(endpoint);
14601437 struct device *dev = &cxlmd->dev;
14611438
14621439 get_device(host);
@@ -1790,7 +1767,16 @@ static struct cxl_dport *find_or_add_dport(struct cxl_port *port, · 327 unmodified lines
17901767 {
17911768 struct cxl_dport *dport;
17921769
1793− device_lock_assert(&port->dev);
1770+ /*
1771+ * The port is already visible in CXL hierarchy, but it may still
1772+ * be in the process of binding to the CXL port driver at this point.
1773+ *
1774+ * port creation and driver binding are protected by the port's host
1775+ * lock, so acquire the host lock here to ensure the port has completed
1776+ * driver binding before proceeding with dport addition.
1777+ */
1778+ guard(device)(port_to_host(port));
1779+ guard(device)(&port->dev);
17941780 dport = cxl_find_dport_by_dev(port, dport_dev);
17951781 if (!dport) {
17961782 dport = probe_dport(port, dport_dev);
@@ -1857,13 +1843,11 @@ retry: · 60 unmodified lines
18571843 * RP port enumerated by cxl_acpi without dport will
18581844 * have the dport added here.
18591845 */
1860− scoped_guard(device, &port->dev) {
1861− dport = find_or_add_dport(port, dport_dev);
1862− if (IS_ERR(dport)) {
1863− if (PTR_ERR(dport) == -EAGAIN)
1864− goto retry;
1865− return PTR_ERR(dport);
1866− }
1846+ dport = find_or_add_dport(port, dport_dev);
1847+ if (IS_ERR(dport)) {
1848+ if (PTR_ERR(dport) == -EAGAIN)
1849+ goto retry;
1850+ return PTR_ERR(dport);
18671851 }
18681852
18691853 rc = cxl_add_ep(dport, &cxlmd->dev);
drivers/cxl/core/region.c+2−2
@@ -1100,12 +1100,12 @@ static int cxl_rr_assign_decoder(struct cxl_port *port, struct cxl_region *cxlr, · 1099 unmodified lines
11001100 static void cxl_region_setup_flags(struct cxl_region *cxlr,
11011101 struct cxl_decoder *cxld)
11021102 {
1103− if (test_bit(CXL_DECODER_F_LOCK, &cxld->flags)) {
1103+ if (cxld->flags & CXL_DECODER_F_LOCK) {
11041104 set_bit(CXL_REGION_F_LOCK, &cxlr->flags);
11051105 clear_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags);
11061106 }
11071107
1108− if (test_bit(CXL_DECODER_F_NORMALIZED_ADDRESSING, &cxld->flags))
1108+ if (cxld->flags & CXL_DECODER_F_NORMALIZED_ADDRESSING)
11091109 set_bit(CXL_REGION_F_NORMALIZED_ADDRESSING, &cxlr->flags);
11101110 }
11111111
drivers/cxl/cxl.h+7−0
@@ -574,11 +574,16 @@ struct cxl_nvdimm_bridge { · 573 unmodified lines
574574
575575 #define CXL_DEV_ID_LEN 19
576576
577+enum {
578+ CXL_NVD_F_INVALIDATED = 0,
579+};
580+
577581 struct cxl_nvdimm {
578582 struct device dev;
579583 struct cxl_memdev *cxlmd;
580584 u8 dev_id[CXL_DEV_ID_LEN]; /* for nvdimm, string of 'serial' */
581585 u64 dirty_shutdowns;
586+ unsigned long flags;
582587 };
583588
584589 struct cxl_pmem_region_mapping {
@@ -920,6 +925,8 @@ void cxl_driver_unregister(struct cxl_driver *cxl_drv); · 335 unmodified lines
920925 struct cxl_nvdimm_bridge *to_cxl_nvdimm_bridge(struct device *dev);
921926 struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
922927 struct cxl_port *port);
928+struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
929+ struct cxl_port *port);
923930 struct cxl_nvdimm *to_cxl_nvdimm(struct device *dev);
924931 bool is_cxl_nvdimm(struct device *dev);
925932 int devm_cxl_add_nvdimm(struct device *host, struct cxl_port *port,
drivers/cxl/pmem.c+21−1
@@ -13,6 +13,20 @@ · 12 unmodified lines
1313
1414 static __read_mostly DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX);
1515
16+/**
17+ * devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
18+ * @host: platform firmware root device
19+ * @port: CXL port at the root of a CXL topology
20+ *
21+ * Return: bridge device that can host cxl_nvdimm objects
22+ */
23+struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
24+ struct cxl_port *port)
25+{
26+ return __devm_cxl_add_nvdimm_bridge(host, port);
27+}
28+EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, "CXL");
29+
1630 static void clear_exclusive(void *mds)
1731 {
1832 clear_exclusive_cxl_commands(mds, exclusive_cmds);
@@ -129,6 +143,9 @@ static int cxl_nvdimm_probe(struct device *dev) · 110 unmodified lines
129143 struct nvdimm *nvdimm;
130144 int rc;
131145
146+ if (test_bit(CXL_NVD_F_INVALIDATED, &cxl_nvd->flags))
147+ return -EBUSY;
148+
132149 set_exclusive_cxl_commands(mds, exclusive_cmds);
133150 rc = devm_add_action_or_reset(dev, clear_exclusive, mds);
134151 if (rc)
@@ -309,8 +326,10 @@ static int detach_nvdimm(struct device *dev, void *data) · 174 unmodified lines
309326 scoped_guard(device, dev) {
310327 if (dev->driver) {
311328 cxl_nvd = to_cxl_nvdimm(dev);
312− if (cxl_nvd->cxlmd && cxl_nvd->cxlmd->cxl_nvb == data)
329+ if (cxl_nvd->cxlmd && cxl_nvd->cxlmd->cxl_nvb == data) {
313330 release = true;
331+ set_bit(CXL_NVD_F_INVALIDATED, &cxl_nvd->flags);
332+ }
314333 }
315334 }
316335 if (release)
@@ -353,6 +372,7 @@ static struct cxl_driver cxl_nvdimm_bridge_driver = { · 36 unmodified lines
353372 .probe = cxl_nvdimm_bridge_probe,
354373 .id = CXL_DEVICE_NVDIMM_BRIDGE,
355374 .drv = {
375+ .probe_type = PROBE_FORCE_SYNCHRONOUS,
356376 .suppress_bind_attrs = true,
357377 },
358378 };
drivers/dpll/zl3073x/core.c+2−5
@@ -981,11 +981,7 @@ zl3073x_devm_dpll_init(struct zl3073x_dev *zldev, u8 num_dplls) · 980 unmodified lines
981981 }
982982
983983 /* Add devres action to release DPLL related resources */
984− rc = devm_add_action_or_reset(zldev->dev, zl3073x_dev_dpll_fini, zldev);
985− if (rc)
986− goto error;
987−
988− return 0;
984+ return devm_add_action_or_reset(zldev->dev, zl3073x_dev_dpll_fini, zldev);
989985
990986 error:
991987 zl3073x_dev_dpll_fini(zldev);
@@ -1026,6 +1022,7 @@ int zl3073x_dev_probe(struct zl3073x_dev *zldev, · 34 unmodified lines
10261022 "Unknown or non-match chip ID: 0x%0x\n",
10271023 id);
10281024 }
1025+ zldev->chip_id = id;
10291026
10301027 /* Read revision, firmware version and custom config version */
10311028 rc = zl3073x_read_u16(zldev, ZL_REG_REVISION, &revision);
drivers/dpll/zl3073x/core.h+28−0
@@ -35,6 +35,7 @@ struct zl3073x_dpll; · 34 unmodified lines
3535 * @dev: pointer to device
3636 * @regmap: regmap to access device registers
3737 * @multiop_lock: to serialize multiple register operations
38+ * @chip_id: chip ID read from hardware
3839 * @ref: array of input references' invariants
3940 * @out: array of outs' invariants
4041 * @synth: array of synths' invariants
@@ -48,6 +49,7 @@ struct zl3073x_dev { · 7 unmodified lines
4849 struct device *dev;
4950 struct regmap *regmap;
5051 struct mutex multiop_lock;
52+ u16 chip_id;
5153
5254 /* Invariants */
5355 struct zl3073x_ref ref[ZL3073X_NUM_REFS];
@@ -144,6 +146,32 @@ int zl3073x_write_hwreg_seq(struct zl3073x_dev *zldev, · 90 unmodified lines
144146
145147 int zl3073x_ref_phase_offsets_update(struct zl3073x_dev *zldev, int channel);
146148
149+/**
150+ * zl3073x_dev_is_ref_phase_comp_32bit - check ref phase comp register size
151+ * @zldev: pointer to zl3073x device
152+ *
153+ * Some chip IDs have a 32-bit wide ref_phase_offset_comp register instead
154+ * of the default 48-bit.
155+ *
156+ * Return: true if the register is 32-bit, false if 48-bit
157+ */
158+static inline bool
159+zl3073x_dev_is_ref_phase_comp_32bit(struct zl3073x_dev *zldev)
160+{
161+ switch (zldev->chip_id) {
162+ case 0x0E30:
163+ case 0x0E93:
164+ case 0x0E94:
165+ case 0x0E95:
166+ case 0x0E96:
167+ case 0x0E97:
168+ case 0x1F60:
169+ return true;
170+ default:
171+ return false;
172+ }
173+}
174+
147175 static inline bool
148176 zl3073x_is_n_pin(u8 id)
149177 {
drivers/dpll/zl3073x/dpll.c+5−2
@@ -475,8 +475,11 @@ zl3073x_dpll_input_pin_phase_adjust_get(const struct dpll_pin *dpll_pin, · 474 unmodified lines
475475 ref_id = zl3073x_input_pin_ref_get(pin->id);
476476 ref = zl3073x_ref_state_get(zldev, ref_id);
477477
478− /* Perform sign extension for 48bit signed value */
479− phase_comp = sign_extend64(ref->phase_comp, 47);
478+ /* Perform sign extension based on register width */
479+ if (zl3073x_dev_is_ref_phase_comp_32bit(zldev))
480+ phase_comp = sign_extend64(ref->phase_comp, 31);
481+ else
482+ phase_comp = sign_extend64(ref->phase_comp, 47);
480483
481484 /* Reverse two's complement negation applied during set and convert
482485 * to 32bit signed int
drivers/dpll/zl3073x/ref.c+20−5
@@ -121,8 +121,16 @@ int zl3073x_ref_state_fetch(struct zl3073x_dev *zldev, u8 index) · 120 unmodified lines
121121 return rc;
122122
123123 /* Read phase compensation register */
124− rc = zl3073x_read_u48(zldev, ZL_REG_REF_PHASE_OFFSET_COMP,
125− &ref->phase_comp);
124+ if (zl3073x_dev_is_ref_phase_comp_32bit(zldev)) {
125+ u32 val;
126+
127+ rc = zl3073x_read_u32(zldev, ZL_REG_REF_PHASE_OFFSET_COMP_32,
128+ &val);
129+ ref->phase_comp = val;
130+ } else {
131+ rc = zl3073x_read_u48(zldev, ZL_REG_REF_PHASE_OFFSET_COMP,
132+ &ref->phase_comp);
133+ }
126134 if (rc)
127135 return rc;
128136
@@ -179,9 +187,16 @@ int zl3073x_ref_state_set(struct zl3073x_dev *zldev, u8 index, · 50 unmodified lines
179187 if (!rc && dref->sync_ctrl != ref->sync_ctrl)
180188 rc = zl3073x_write_u8(zldev, ZL_REG_REF_SYNC_CTRL,
181189 ref->sync_ctrl);
182− if (!rc && dref->phase_comp != ref->phase_comp)
183− rc = zl3073x_write_u48(zldev, ZL_REG_REF_PHASE_OFFSET_COMP,
184− ref->phase_comp);
190+ if (!rc && dref->phase_comp != ref->phase_comp) {
191+ if (zl3073x_dev_is_ref_phase_comp_32bit(zldev))
192+ rc = zl3073x_write_u32(zldev,
193+ ZL_REG_REF_PHASE_OFFSET_COMP_32,
194+ ref->phase_comp);
195+ else
196+ rc = zl3073x_write_u48(zldev,
197+ ZL_REG_REF_PHASE_OFFSET_COMP,
198+ ref->phase_comp);
199+ }
185200 if (rc)
186201 return rc;
187202
drivers/dpll/zl3073x/regs.h+1−0
@@ -194,6 +194,7 @@ · 193 unmodified lines
194194 #define ZL_REF_CONFIG_DIFF_EN BIT(2)
195195
196196 #define ZL_REG_REF_PHASE_OFFSET_COMP ZL_REG(10, 0x28, 6)
197+#define ZL_REG_REF_PHASE_OFFSET_COMP_32 ZL_REG(10, 0x28, 4)
197198
198199 #define ZL_REG_REF_SYNC_CTRL ZL_REG(10, 0x2e, 1)
199200 #define ZL_REF_SYNC_CTRL_MODE GENMASK(2, 0)
drivers/firewire/ohci.c+1−1
@@ -848,7 +848,7 @@ static int ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, · 847 unmodified lines
848848 {
849849 struct device *dev = ohci->card.device;
850850 unsigned int i;
851− struct page *pages[AR_BUFFERS + AR_WRAPAROUND_PAGES];
851+ struct page *pages[AR_BUFFERS + AR_WRAPAROUND_PAGES] = { NULL };
852852 dma_addr_t dma_addrs[AR_BUFFERS];
853853 void *vaddr;
854854 struct descriptor *d;
drivers/firmware/cirrus/cs_dsp.c+18−6
@@ -1610,11 +1610,17 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware, · 1609 unmodified lines
16101610 region_name);
16111611
16121612 if (reg) {
1613+ /*
1614+ * Although we expect the underlying bus does not require
1615+ * physically-contiguous buffers, we pessimistically use
1616+ * a temporary buffer instead of trusting that the
1617+ * alignment of region->data is ok.
1618+ */
16131619 region_len = le32_to_cpu(region->len);
16141620 if (region_len > buf_len) {
16151621 buf_len = round_up(region_len, PAGE_SIZE);
1616− kfree(buf);
1617− buf = kmalloc(buf_len, GFP_KERNEL | GFP_DMA);
1622+ vfree(buf);
1623+ buf = vmalloc(buf_len);
16181624 if (!buf) {
16191625 ret = -ENOMEM;
16201626 goto out_fw;
@@ -1643,7 +1649,7 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware, · 22 unmodified lines
16431649
16441650 ret = 0;
16451651 out_fw:
1646− kfree(buf);
1652+ vfree(buf);
16471653
16481654 if (ret == -EOVERFLOW)
16491655 cs_dsp_err(dsp, "%s: file content overflows file data\n", file);
@@ -2331,11 +2337,17 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware · 681 unmodified lines
23312337 }
23322338
23332339 if (reg) {
2340+ /*
2341+ * Although we expect the underlying bus does not require
2342+ * physically-contiguous buffers, we pessimistically use
2343+ * a temporary buffer instead of trusting that the
2344+ * alignment of blk->data is ok.
2345+ */
23342346 region_len = le32_to_cpu(blk->len);
23352347 if (region_len > buf_len) {
23362348 buf_len = round_up(region_len, PAGE_SIZE);
2337− kfree(buf);
2338− buf = kmalloc(buf_len, GFP_KERNEL | GFP_DMA);
2349+ vfree(buf);
2350+ buf = vmalloc(buf_len);
23392351 if (!buf) {
23402352 ret = -ENOMEM;
23412353 goto out_fw;
@@ -2366,7 +2378,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware · 24 unmodified lines
23662378
23672379 ret = 0;
23682380 out_fw:
2369− kfree(buf);
2381+ vfree(buf);
23702382
23712383 if (ret == -EOVERFLOW)
23722384 cs_dsp_err(dsp, "%s: file content overflows file data\n", file);
drivers/firmware/efi/mokvar-table.c+1−1
@@ -85,7 +85,7 @@ static struct kobject *mokvar_kobj; · 84 unmodified lines
8585 * as an alternative to ordinary EFI variables, due to platform-dependent
8686 * limitations. The memory occupied by this table is marked as reserved.
8787 *
88− * This routine must be called before efi_free_boot_services() in order
88+ * This routine must be called before efi_unmap_boot_services() in order
8989 * to guarantee that it can mark the table as reserved.
9090 *
9191 * Implicit inputs:
drivers/firmware/stratix10-rsu.c+2−0
@@ -768,7 +768,9 @@ static int stratix10_rsu_probe(struct platform_device *pdev) · 767 unmodified lines
768768 rsu_async_status_callback);
769769 if (ret) {
770770 dev_err(dev, "Error, getting RSU status %i\n", ret);
771+ stratix10_svc_remove_async_client(priv->chan);
771772 stratix10_svc_free_channel(priv->chan);
773+ return ret;
772774 }
773775
774776 /* get DCMF version from firmware */
drivers/firmware/stratix10-svc.c+126−102
@@ -37,15 +37,14 @@ · 36 unmodified lines
3737 * service layer will return error to FPGA manager when timeout occurs,
3838 * timeout is set to 30 seconds (30 * 1000) at Intel Stratix10 SoC.
3939 */
40−#define SVC_NUM_DATA_IN_FIFO 32
40+#define SVC_NUM_DATA_IN_FIFO 8
4141 #define SVC_NUM_CHANNEL 4
42−#define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 200
42+#define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 2000
4343 #define FPGA_CONFIG_STATUS_TIMEOUT_SEC 30
4444 #define BYTE_TO_WORD_SIZE 4
4545
4646 /* stratix10 service layer clients */
4747 #define STRATIX10_RSU "stratix10-rsu"
48−#define INTEL_FCS "intel-fcs"
4948
5049 /* Maximum number of SDM client IDs. */
5150 #define MAX_SDM_CLIENT_IDS 16
@@ -105,11 +104,9 @@ struct stratix10_svc_chan; · 53 unmodified lines
105104 /**
106105 * struct stratix10_svc - svc private data
107106 * @stratix10_svc_rsu: pointer to stratix10 RSU device
108− * @intel_svc_fcs: pointer to the FCS device
109107 */
110108 struct stratix10_svc {
111109 struct platform_device *stratix10_svc_rsu;
112− struct platform_device *intel_svc_fcs;
113110 };
114111
115112 /**
@@ -251,12 +248,10 @@ struct stratix10_async_ctrl { · 135 unmodified lines
251248 * @num_active_client: number of active service client
252249 * @node: list management
253250 * @genpool: memory pool pointing to the memory region
254− * @task: pointer to the thread task which handles SMC or HVC call
255− * @svc_fifo: a queue for storing service message data
256251 * @complete_status: state for completion
257− * @svc_fifo_lock: protect access to service message data queue
258252 * @invoke_fn: function to issue secure monitor call or hypervisor call
259253 * @svc: manages the list of client svc drivers
254+ * @sdm_lock: only allows a single command single response to SDM
260255 * @actrl: async control structure
261256 *
262257 * This struct is used to create communication channels for service clients, to
@@ -269,12 +264,10 @@ struct stratix10_svc_controller { · 6 unmodified lines
269264 int num_active_client;
270265 struct list_head node;
271266 struct gen_pool *genpool;
272− struct task_struct *task;
273− struct kfifo svc_fifo;
274267 struct completion complete_status;
275− spinlock_t svc_fifo_lock;
276268 svc_invoke_fn *invoke_fn;
277269 struct stratix10_svc *svc;
270+ struct mutex sdm_lock;
278271 struct stratix10_async_ctrl actrl;
279272 };
280273
@@ -283,6 +276,9 @@ struct stratix10_svc_controller { · 2 unmodified lines
283276 * @ctrl: pointer to service controller which is the provider of this channel
284277 * @scl: pointer to service client which owns the channel
285278 * @name: service client name associated with the channel
279+ * @task: pointer to the thread task which handles SMC or HVC call
280+ * @svc_fifo: a queue for storing service message data (separate fifo for every channel)
281+ * @svc_fifo_lock: protect access to service message data queue (locking pending fifo)
286282 * @lock: protect access to the channel
287283 * @async_chan: reference to asynchronous channel object for this channel
288284 *
@@ -293,6 +289,9 @@ struct stratix10_svc_chan { · 4 unmodified lines
293289 struct stratix10_svc_controller *ctrl;
294290 struct stratix10_svc_client *scl;
295291 char *name;
292+ struct task_struct *task;
293+ struct kfifo svc_fifo;
294+ spinlock_t svc_fifo_lock;
296295 spinlock_t lock;
297296 struct stratix10_async_chan *async_chan;
298297 };
@@ -527,10 +526,10 @@ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data, · 228 unmodified lines
527526 */
528527 static int svc_normal_to_secure_thread(void *data)
529528 {
530− struct stratix10_svc_controller
531− *ctrl = (struct stratix10_svc_controller *)data;
532− struct stratix10_svc_data *pdata;
533− struct stratix10_svc_cb_data *cbdata;
529+ struct stratix10_svc_chan *chan = (struct stratix10_svc_chan *)data;
530+ struct stratix10_svc_controller *ctrl = chan->ctrl;
531+ struct stratix10_svc_data *pdata = NULL;
532+ struct stratix10_svc_cb_data *cbdata = NULL;
534533 struct arm_smccc_res res;
535534 unsigned long a0, a1, a2, a3, a4, a5, a6, a7;
536535 int ret_fifo = 0;
@@ -555,12 +554,12 @@ static int svc_normal_to_secure_thread(void *data) · 18 unmodified lines
555554 a6 = 0;
556555 a7 = 0;
557556
558− pr_debug("smc_hvc_shm_thread is running\n");
557+ pr_debug("%s: %s: Thread is running!\n", __func__, chan->name);
559558
560559 while (!kthread_should_stop()) {
561− ret_fifo = kfifo_out_spinlocked(&ctrl->svc_fifo,
560+ ret_fifo = kfifo_out_spinlocked(&chan->svc_fifo,
562561 pdata, sizeof(*pdata),
563− &ctrl->svc_fifo_lock);
562+ &chan->svc_fifo_lock);
564563
565564 if (!ret_fifo)
566565 continue;
@@ -569,9 +568,25 @@ static int svc_normal_to_secure_thread(void *data) · 2 unmodified lines
569568 (unsigned int)pdata->paddr, pdata->command,
570569 (unsigned int)pdata->size);
571570
571+ /* SDM can only process one command at a time */
572+ pr_debug("%s: %s: Thread is waiting for mutex!\n",
573+ __func__, chan->name);
574+ if (mutex_lock_interruptible(&ctrl->sdm_lock)) {
575+ /* item already dequeued; notify client to unblock it */
576+ cbdata->status = BIT(SVC_STATUS_ERROR);
577+ cbdata->kaddr1 = NULL;
578+ cbdata->kaddr2 = NULL;
579+ cbdata->kaddr3 = NULL;
580+ if (pdata->chan->scl)
581+ pdata->chan->scl->receive_cb(pdata->chan->scl,
582+ cbdata);
583+ break;
584+ }
585+
572586 switch (pdata->command) {
573587 case COMMAND_RECONFIG_DATA_CLAIM:
574588 svc_thread_cmd_data_claim(ctrl, pdata, cbdata);
589+ mutex_unlock(&ctrl->sdm_lock);
575590 continue;
576591 case COMMAND_RECONFIG:
577592 a0 = INTEL_SIP_SMC_FPGA_CONFIG_START;
@@ -700,10 +715,11 @@ static int svc_normal_to_secure_thread(void *data) · 122 unmodified lines
700715 break;
701716 default:
702717 pr_warn("it shouldn't happen\n");
703− break;
718+ mutex_unlock(&ctrl->sdm_lock);
719+ continue;
704720 }
705− pr_debug("%s: before SMC call -- a0=0x%016x a1=0x%016x",
706− __func__,
721+ pr_debug("%s: %s: before SMC call -- a0=0x%016x a1=0x%016x",
722+ __func__, chan->name,
707723 (unsigned int)a0,
708724 (unsigned int)a1);
709725 pr_debug(" a2=0x%016x\n", (unsigned int)a2);
@@ -712,8 +728,8 @@ static int svc_normal_to_secure_thread(void *data) · 2 unmodified lines
712728 pr_debug(" a5=0x%016x\n", (unsigned int)a5);
713729 ctrl->invoke_fn(a0, a1, a2, a3, a4, a5, a6, a7, &res);
714730
715− pr_debug("%s: after SMC call -- res.a0=0x%016x",
716− __func__, (unsigned int)res.a0);
731+ pr_debug("%s: %s: after SMC call -- res.a0=0x%016x",
732+ __func__, chan->name, (unsigned int)res.a0);
717733 pr_debug(" res.a1=0x%016x, res.a2=0x%016x",
718734 (unsigned int)res.a1, (unsigned int)res.a2);
719735 pr_debug(" res.a3=0x%016x\n", (unsigned int)res.a3);
@@ -728,6 +744,7 @@ static int svc_normal_to_secure_thread(void *data) · 8 unmodified lines
728744 cbdata->kaddr2 = NULL;
729745 cbdata->kaddr3 = NULL;
730746 pdata->chan->scl->receive_cb(pdata->chan->scl, cbdata);
747+ mutex_unlock(&ctrl->sdm_lock);
731748 continue;
732749 }
733750
@@ -801,6 +818,8 @@ static int svc_normal_to_secure_thread(void *data) · 67 unmodified lines
801818 break;
802819
803820 }
821+
822+ mutex_unlock(&ctrl->sdm_lock);
804823 }
805824
806825 kfree(cbdata);
@@ -1696,22 +1715,33 @@ int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg) · 889 unmodified lines
16961715 if (!p_data)
16971716 return -ENOMEM;
16981717
1699− /* first client will create kernel thread */
1700− if (!chan->ctrl->task) {
1701− chan->ctrl->task =
1702− kthread_run_on_cpu(svc_normal_to_secure_thread,
1703− (void *)chan->ctrl,
1704− cpu, "svc_smc_hvc_thread");
1705− if (IS_ERR(chan->ctrl->task)) {
1718+ /* first caller creates the per-channel kthread */
1719+ if (!chan->task) {
1720+ struct task_struct *task;
1721+
1722+ task = kthread_run_on_cpu(svc_normal_to_secure_thread,
1723+ (void *)chan,
1724+ cpu, "svc_smc_hvc_thread");
1725+ if (IS_ERR(task)) {
17061726 dev_err(chan->ctrl->dev,
17071727 "failed to create svc_smc_hvc_thread\n");
17081728 kfree(p_data);
17091729 return -EINVAL;
17101730 }
1731+
1732+ spin_lock(&chan->lock);
1733+ if (chan->task) {
1734+ /* another caller won the race; discard our thread */
1735+ spin_unlock(&chan->lock);
1736+ kthread_stop(task);
1737+ } else {
1738+ chan->task = task;
1739+ spin_unlock(&chan->lock);
1740+ }
17111741 }
17121742
1713− pr_debug("%s: sent P-va=%p, P-com=%x, P-size=%u\n", __func__,
1714− p_msg->payload, p_msg->command,
1743+ pr_debug("%s: %s: sent P-va=%p, P-com=%x, P-size=%u\n", __func__,
1744+ chan->name, p_msg->payload, p_msg->command,
17151745 (unsigned int)p_msg->payload_length);
17161746
17171747 if (list_empty(&svc_data_mem)) {
@@ -1747,12 +1777,16 @@ int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg) · 29 unmodified lines
17471777 p_data->arg[2] = p_msg->arg[2];
17481778 p_data->size = p_msg->payload_length;
17491779 p_data->chan = chan;
1750− pr_debug("%s: put to FIFO pa=0x%016x, cmd=%x, size=%u\n", __func__,
1751− (unsigned int)p_data->paddr, p_data->command,
1752− (unsigned int)p_data->size);
1753− ret = kfifo_in_spinlocked(&chan->ctrl->svc_fifo, p_data,
1780+ pr_debug("%s: %s: put to FIFO pa=0x%016x, cmd=%x, size=%u\n",
1781+ __func__,
1782+ chan->name,
1783+ (unsigned int)p_data->paddr,
1784+ p_data->command,
1785+ (unsigned int)p_data->size);
1786+
1787+ ret = kfifo_in_spinlocked(&chan->svc_fifo, p_data,
17541788 sizeof(*p_data),
1755− &chan->ctrl->svc_fifo_lock);
1789+ &chan->svc_fifo_lock);
17561790
17571791 kfree(p_data);
17581792
@@ -1773,11 +1807,12 @@ EXPORT_SYMBOL_GPL(stratix10_svc_send); · 14 unmodified lines
17731807 */
17741808 void stratix10_svc_done(struct stratix10_svc_chan *chan)
17751809 {
1776− /* stop thread when thread is running AND only one active client */
1777− if (chan->ctrl->task && chan->ctrl->num_active_client <= 1) {
1778− pr_debug("svc_smc_hvc_shm_thread is stopped\n");
1779− kthread_stop(chan->ctrl->task);
1780− chan->ctrl->task = NULL;
1810+ /* stop thread when thread is running */
1811+ if (chan->task) {
1812+ pr_debug("%s: %s: svc_smc_hvc_shm_thread is stopping\n",
1813+ __func__, chan->name);
1814+ kthread_stop(chan->task);
1815+ chan->task = NULL;
17811816 }
17821817 }
17831818 EXPORT_SYMBOL_GPL(stratix10_svc_done);
@@ -1817,8 +1852,8 @@ void *stratix10_svc_allocate_memory(struct stratix10_svc_chan *chan, · 33 unmodified lines
18171852 pmem->paddr = pa;
18181853 pmem->size = s;
18191854 list_add_tail(&pmem->node, &svc_data_mem);
1820− pr_debug("%s: va=%p, pa=0x%016x\n", __func__,
1821− pmem->vaddr, (unsigned int)pmem->paddr);
1855+ pr_debug("%s: %s: va=%p, pa=0x%016x\n", __func__,
1856+ chan->name, pmem->vaddr, (unsigned int)pmem->paddr);
18221857
18231858 return (void *)va;
18241859 }
@@ -1855,6 +1890,13 @@ static const struct of_device_id stratix10_svc_drv_match[] = { · 30 unmodified lines
18551890 {},
18561891 };
18571892
1893+static const char * const chan_names[SVC_NUM_CHANNEL] = {
1894+ SVC_CLIENT_FPGA,
1895+ SVC_CLIENT_RSU,
1896+ SVC_CLIENT_FCS,
1897+ SVC_CLIENT_HWMON
1898+};
1899+
18581900 static int stratix10_svc_drv_probe(struct platform_device *pdev)
18591901 {
18601902 struct device *dev = &pdev->dev;
@@ -1862,11 +1904,11 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) · 1 unmodified line
18621904 struct stratix10_svc_chan *chans;
18631905 struct gen_pool *genpool;
18641906 struct stratix10_svc_sh_memory *sh_memory;
1865− struct stratix10_svc *svc;
1907+ struct stratix10_svc *svc = NULL;
18661908
18671909 svc_invoke_fn *invoke_fn;
18681910 size_t fifo_size;
1869− int ret;
1911+ int ret, i = 0;
18701912
18711913 /* get SMC or HVC function */
18721914 invoke_fn = get_invoke_func(dev);
@@ -1905,8 +1947,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) · 32 unmodified lines
19051947 controller->num_active_client = 0;
19061948 controller->chans = chans;
19071949 controller->genpool = genpool;
1908− controller->task = NULL;
19091950 controller->invoke_fn = invoke_fn;
1951+ INIT_LIST_HEAD(&controller->node);
19101952 init_completion(&controller->complete_status);
19111953
19121954 ret = stratix10_svc_async_init(controller);
@@ -1917,32 +1959,20 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) · 4 unmodified lines
19171959 }
19181960
19191961 fifo_size = sizeof(struct stratix10_svc_data) * SVC_NUM_DATA_IN_FIFO;
1920− ret = kfifo_alloc(&controller->svc_fifo, fifo_size, GFP_KERNEL);
1921− if (ret) {
1922− dev_err(dev, "failed to allocate FIFO\n");
1923− goto err_async_exit;
1924− }
1925− spin_lock_init(&controller->svc_fifo_lock);
1926−
1927− chans[0].scl = NULL;
1928− chans[0].ctrl = controller;
1929− chans[0].name = SVC_CLIENT_FPGA;
1930− spin_lock_init(&chans[0].lock);
1962+ mutex_init(&controller->sdm_lock);
19311963
1932− chans[1].scl = NULL;
1933− chans[1].ctrl = controller;
1934− chans[1].name = SVC_CLIENT_RSU;
1935− spin_lock_init(&chans[1].lock);
1936−
1937− chans[2].scl = NULL;
1938− chans[2].ctrl = controller;
1939− chans[2].name = SVC_CLIENT_FCS;
1940− spin_lock_init(&chans[2].lock);
1941−
1942− chans[3].scl = NULL;
1943− chans[3].ctrl = controller;
1944− chans[3].name = SVC_CLIENT_HWMON;
1945− spin_lock_init(&chans[3].lock);
1964+ for (i = 0; i < SVC_NUM_CHANNEL; i++) {
1965+ chans[i].scl = NULL;
1966+ chans[i].ctrl = controller;
1967+ chans[i].name = (char *)chan_names[i];
1968+ spin_lock_init(&chans[i].lock);
1969+ ret = kfifo_alloc(&chans[i].svc_fifo, fifo_size, GFP_KERNEL);
1970+ if (ret) {
1971+ dev_err(dev, "failed to allocate FIFO %d\n", i);
1972+ goto err_free_fifos;
1973+ }
1974+ spin_lock_init(&chans[i].svc_fifo_lock);
1975+ }
19461976
19471977 list_add_tail(&controller->node, &svc_ctrl);
19481978 platform_set_drvdata(pdev, controller);
@@ -1951,7 +1981,7 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) · 2 unmodified lines
19511981 svc = devm_kzalloc(dev, sizeof(*svc), GFP_KERNEL);
19521982 if (!svc) {
19531983 ret = -ENOMEM;
1954− goto err_free_kfifo;
1984+ goto err_free_fifos;
19551985 }
19561986 controller->svc = svc;
19571987
@@ -1959,51 +1989,43 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) · 1 unmodified line
19591989 if (!svc->stratix10_svc_rsu) {
19601990 dev_err(dev, "failed to allocate %s device\n", STRATIX10_RSU);
19611991 ret = -ENOMEM;
1962− goto err_free_kfifo;
1992+ goto err_free_fifos;
19631993 }
19641994
19651995 ret = platform_device_add(svc->stratix10_svc_rsu);
1966− if (ret) {
1967− platform_device_put(svc->stratix10_svc_rsu);
1968− goto err_free_kfifo;
1969− }
1970−
1971− svc->intel_svc_fcs = platform_device_alloc(INTEL_FCS, 1);
1972− if (!svc->intel_svc_fcs) {
1973− dev_err(dev, "failed to allocate %s device\n", INTEL_FCS);
1974− ret = -ENOMEM;
1975− goto err_unregister_rsu_dev;
1976− }
1977−
1978− ret = platform_device_add(svc->intel_svc_fcs);
1979− if (ret) {
1980− platform_device_put(svc->intel_svc_fcs);
1981− goto err_unregister_rsu_dev;
1982− }
1996+ if (ret)
1997+ goto err_put_device;
19831998
19841999 ret = of_platform_default_populate(dev_of_node(dev), NULL, dev);
19852000 if (ret)
1986− goto err_unregister_fcs_dev;
2001+ goto err_unregister_rsu_dev;
19872002
19882003 pr_info("Intel Service Layer Driver Initialized\n");
19892004
19902005 return 0;
19912006
1992−err_unregister_fcs_dev:
1993− platform_device_unregister(svc->intel_svc_fcs);
19942007 err_unregister_rsu_dev:
19952008 platform_device_unregister(svc->stratix10_svc_rsu);
1996−err_free_kfifo:
1997− kfifo_free(&controller->svc_fifo);
1998−err_async_exit:
2009+ goto err_free_fifos;
2010+err_put_device:
2011+ platform_device_put(svc->stratix10_svc_rsu);
2012+err_free_fifos:
2013+ /* only remove from list if list_add_tail() was reached */
2014+ if (!list_empty(&controller->node))
2015+ list_del(&controller->node);
2016+ /* free only the FIFOs that were successfully allocated */
2017+ while (i--)
2018+ kfifo_free(&chans[i].svc_fifo);
19992019 stratix10_svc_async_exit(controller);
20002020 err_destroy_pool:
20012021 gen_pool_destroy(genpool);
2022+
20022023 return ret;
20032024 }
20042025
20052026 static void stratix10_svc_drv_remove(struct platform_device *pdev)
20062027 {
2028+ int i;
20072029 struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev);
20082030 struct stratix10_svc *svc = ctrl->svc;
20092031
@@ -2011,14 +2033,16 @@ static void stratix10_svc_drv_remove(struct platform_device *pdev) · 1 unmodified line
20112033
20122034 of_platform_depopulate(ctrl->dev);
20132035
2014− platform_device_unregister(svc->intel_svc_fcs);
20152036 platform_device_unregister(svc->stratix10_svc_rsu);
20162037
2017− kfifo_free(&ctrl->svc_fifo);
2018− if (ctrl->task) {
2019− kthread_stop(ctrl->task);
2020− ctrl->task = NULL;
2038+ for (i = 0; i < SVC_NUM_CHANNEL; i++) {
2039+ if (ctrl->chans[i].task) {
2040+ kthread_stop(ctrl->chans[i].task);
2041+ ctrl->chans[i].task = NULL;
2042+ }
2043+ kfifo_free(&ctrl->chans[i].svc_fifo);
20212044 }
2045+
20222046 if (ctrl->genpool)
20232047 gen_pool_destroy(ctrl->genpool);
20242048 list_del(&ctrl->node);
drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c+4−3
@@ -38,8 +38,10 @@ MODULE_DESCRIPTION("GPIB driver for LPVO usb devices"); · 37 unmodified lines
3838 /*
3939 * Table of devices that work with this driver.
4040 *
41− * Currently, only one device is known to be used in the
42− * lpvo_usb_gpib adapter (FTDI 0403:6001).
41+ * Currently, only one device is known to be used in the lpvo_usb_gpib
42+ * adapter (FTDI 0403:6001) but as this device id is already handled by the
43+ * ftdi_sio USB serial driver the LPVO driver must not bind to it by default.
44+ *
4345 * If your adapter uses a different chip, insert a line
4446 * in the following table with proper <Vendor-id>, <Product-id>.
4547 *
@@ -50,7 +52,6 @@ MODULE_DESCRIPTION("GPIB driver for LPVO usb devices"); · 4 unmodified lines
5052 */
5153
5254 static const struct usb_device_id skel_table[] = {
53− { USB_DEVICE(0x0403, 0x6001) },
5455 { } /* Terminating entry */
5556 };
5657 MODULE_DEVICE_TABLE(usb, skel_table);
drivers/gpio/gpiolib-shared.c+3−3
@@ -748,14 +748,14 @@ static bool gpio_shared_entry_is_really_shared(struct gpio_shared_entry *entry) · 747 unmodified lines
748748 static void gpio_shared_free_exclusive(void)
749749 {
750750 struct gpio_shared_entry *entry, *epos;
751+ struct gpio_shared_ref *ref, *rpos;
751752
752753 list_for_each_entry_safe(entry, epos, &gpio_shared_list, list) {
753754 if (gpio_shared_entry_is_really_shared(entry))
754755 continue;
755756
756− gpio_shared_drop_ref(list_first_entry(&entry->refs,
757− struct gpio_shared_ref,
758− list));
757+ list_for_each_entry_safe(ref, rpos, &entry->refs, list)
758+ gpio_shared_drop_ref(ref);
759759 gpio_shared_drop_entry(entry);
760760 }
761761 }
drivers/gpio/gpiolib.c+6−2
@@ -3267,8 +3267,12 @@ static int gpiochip_get(struct gpio_chip *gc, unsigned int offset) · 3266 unmodified lines
32673267
32683268 /* Make sure this is called after checking for gc->get(). */
32693269 ret = gc->get(gc, offset);
3270− if (ret > 1)
3271− ret = -EBADE;
3270+ if (ret > 1) {
3271+ gpiochip_warn(gc,
3272+ "invalid return value from gc->get(): %d, consider fixing the driver\n",
3273+ ret);
3274+ ret = !!ret;
3275+ }
32723276
32733277 return ret;
32743278 }
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c+1−0
@@ -641,6 +641,7 @@ static void aca_error_fini(struct aca_error *aerr) · 640 unmodified lines
641641 aca_bank_error_remove(aerr, bank_error);
642642
643643 out_unlock:
644+ mutex_unlock(&aerr->lock);
644645 mutex_destroy(&aerr->lock);
645646 }
646647
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+5−1
@@ -1439,7 +1439,10 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, · 1438 unmodified lines
14391439 *process_info = info;
14401440 }
14411441
1442− vm->process_info = *process_info;
1442+ if (cmpxchg(&vm->process_info, NULL, *process_info) != NULL) {
1443+ ret = -EINVAL;
1444+ goto already_acquired;
1445+ }
14431446
14441447 /* Validate page directory and attach eviction fence */
14451448 ret = amdgpu_bo_reserve(vm->root.bo, true);
@@ -1479,6 +1482,7 @@ validate_pd_fail: · 33 unmodified lines
14791482 amdgpu_bo_unreserve(vm->root.bo);
14801483 reserve_pd_fail:
14811484 vm->process_info = NULL;
1485+already_acquired:
14821486 if (info) {
14831487 dma_fence_put(&info->eviction_fence->base);
14841488 *process_info = NULL;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+23−8
@@ -2690,8 +2690,10 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) · 2689 unmodified lines
26902690 break;
26912691 default:
26922692 r = amdgpu_discovery_set_ip_blocks(adev);
2693− if (r)
2693+ if (r) {
2694+ adev->num_ip_blocks = 0;
26942695 return r;
2696+ }
26952697 break;
26962698 }
26972699
@@ -3247,6 +3249,8 @@ int amdgpu_device_set_cg_state(struct amdgpu_device *adev, · 549 unmodified lines
32473249 i = state == AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;
32483250 if (!adev->ip_blocks[i].status.late_initialized)
32493251 continue;
3252+ if (!adev->ip_blocks[i].version)
3253+ continue;
32503254 /* skip CG for GFX, SDMA on S0ix */
32513255 if (adev->in_s0ix &&
32523256 (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX ||
@@ -3286,6 +3290,8 @@ int amdgpu_device_set_pg_state(struct amdgpu_device *adev, · 33 unmodified lines
32863290 i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;
32873291 if (!adev->ip_blocks[i].status.late_initialized)
32883292 continue;
3293+ if (!adev->ip_blocks[i].version)
3294+ continue;
32893295 /* skip PG for GFX, SDMA on S0ix */
32903296 if (adev->in_s0ix &&
32913297 (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX ||
@@ -3493,6 +3499,8 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev) · 201 unmodified lines
34933499 int i, r;
34943500
34953501 for (i = 0; i < adev->num_ip_blocks; i++) {
3502+ if (!adev->ip_blocks[i].version)
3503+ continue;
34963504 if (!adev->ip_blocks[i].version->funcs->early_fini)
34973505 continue;
34983506
@@ -3570,6 +3578,8 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) · 71 unmodified lines
35703578 if (!adev->ip_blocks[i].status.sw)
35713579 continue;
35723580
3581+ if (!adev->ip_blocks[i].version)
3582+ continue;
35733583 if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
35743584 amdgpu_ucode_free_bo(adev);
35753585 amdgpu_free_static_csa(&adev->virt.csa_obj);
@@ -3596,6 +3606,8 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) · 20 unmodified lines
35963606 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
35973607 if (!adev->ip_blocks[i].status.late_initialized)
35983608 continue;
3609+ if (!adev->ip_blocks[i].version)
3610+ continue;
35993611 if (adev->ip_blocks[i].version->funcs->late_fini)
36003612 adev->ip_blocks[i].version->funcs->late_fini(&adev->ip_blocks[i]);
36013613 adev->ip_blocks[i].status.late_initialized = false;
@@ -7059,6 +7071,15 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev) · 3457 unmodified lines
70597071 dev_info(adev->dev, "PCI error: slot reset callback!!\n");
70607072
70617073 memset(&reset_context, 0, sizeof(reset_context));
7074+ INIT_LIST_HEAD(&device_list);
7075+ hive = amdgpu_get_xgmi_hive(adev);
7076+ if (hive) {
7077+ mutex_lock(&hive->hive_lock);
7078+ list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head)
7079+ list_add_tail(&tmp_adev->reset_list, &device_list);
7080+ } else {
7081+ list_add_tail(&adev->reset_list, &device_list);
7082+ }
70627083
70637084 if (adev->pcie_reset_ctx.swus)
70647085 link_dev = adev->pcie_reset_ctx.swus;
@@ -7099,19 +7120,13 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev) · 34 unmodified lines
70997120 reset_context.reset_req_dev = adev;
71007121 set_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags);
71017122 set_bit(AMDGPU_SKIP_COREDUMP, &reset_context.flags);
7102− INIT_LIST_HEAD(&device_list);
71037123
7104− hive = amdgpu_get_xgmi_hive(adev);
71057124 if (hive) {
7106− mutex_lock(&hive->hive_lock);
71077125 reset_context.hive = hive;
7108− list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
7126+ list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head)
71097127 tmp_adev->pcie_reset_ctx.in_link_reset = true;
7110− list_add_tail(&tmp_adev->reset_list, &device_list);
7111− }
71127128 } else {
71137129 set_bit(AMDGPU_SKIP_HW_RESET, &reset_context.flags);
7114− list_add_tail(&adev->reset_list, &device_list);
71157130 }
71167131
71177132 r = amdgpu_device_asic_reset(adev, &device_list, &reset_context);
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+1−1
@@ -83,7 +83,7 @@ void amdgpu_driver_unload_kms(struct drm_device *dev) · 82 unmodified lines
8383 {
8484 struct amdgpu_device *adev = drm_to_adev(dev);
8585
86− if (adev == NULL)
86+ if (adev == NULL || !adev->num_ip_blocks)
8787 return;
8888
8989 amdgpu_unregister_gpu_instance(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+8−8
@@ -368,15 +368,15 @@ struct amdgpu_mode_info { · 367 unmodified lines
368368
369369 struct drm_property *plane_ctm_property;
370370 /**
371− * @shaper_lut_property: Plane property to set pre-blending shaper LUT
372− * that converts color content before 3D LUT. If
373− * plane_shaper_tf_property != Identity TF, AMD color module will
371+ * @plane_shaper_lut_property: Plane property to set pre-blending
372+ * shaper LUT that converts color content before 3D LUT.
373+ * If plane_shaper_tf_property != Identity TF, AMD color module will
374374 * combine the user LUT values with pre-defined TF into the LUT
375375 * parameters to be programmed.
376376 */
377377 struct drm_property *plane_shaper_lut_property;
378378 /**
379− * @shaper_lut_size_property: Plane property for the size of
379+ * @plane_shaper_lut_size_property: Plane property for the size of
380380 * pre-blending shaper LUT as supported by the driver (read-only).
381381 */
382382 struct drm_property *plane_shaper_lut_size_property;
@@ -400,10 +400,10 @@ struct amdgpu_mode_info { · 17 unmodified lines
400400 */
401401 struct drm_property *plane_lut3d_property;
402402 /**
403− * @plane_degamma_lut_size_property: Plane property to define the max
404− * size of 3D LUT as supported by the driver (read-only). The max size
405− * is the max size of one dimension and, therefore, the max number of
406− * entries for 3D LUT array is the 3D LUT size cubed;
403+ * @plane_lut3d_size_property: Plane property to define the max size
404+ * of 3D LUT as supported by the driver (read-only). The max size is
405+ * the max size of one dimension and, therefore, the max number of
406+ * entries for 3D LUT array is the 3D LUT size cubed.
407407 */
408408 struct drm_property *plane_lut3d_size_property;
409409 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c+7−5
@@ -332,13 +332,13 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size · 331 unmodified lines
332332 if (!context || !context->initialized) {
333333 dev_err(adev->dev, "TA is not initialized\n");
334334 ret = -EINVAL;
335− goto err_free_shared_buf;
335+ goto free_shared_buf;
336336 }
337337
338338 if (!psp->ta_funcs || !psp->ta_funcs->fn_ta_invoke) {
339339 dev_err(adev->dev, "Unsupported function to invoke TA\n");
340340 ret = -EOPNOTSUPP;
341− goto err_free_shared_buf;
341+ goto free_shared_buf;
342342 }
343343
344344 context->session_id = ta_id;
@@ -346,7 +346,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size · 1 unmodified line
346346 mutex_lock(&psp->ras_context.mutex);
347347 ret = prep_ta_mem_context(&context->mem_context, shared_buf, shared_buf_len);
348348 if (ret)
349− goto err_free_shared_buf;
349+ goto unlock;
350350
351351 ret = psp_fn_ta_invoke(psp, cmd_id);
352352 if (ret || context->resp_status) {
@@ -354,15 +354,17 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size · 1 unmodified line
354354 ret, context->resp_status);
355355 if (!ret) {
356356 ret = -EINVAL;
357− goto err_free_shared_buf;
357+ goto unlock;
358358 }
359359 }
360360
361361 if (copy_to_user((char *)&buf[copy_pos], context->mem_context.shared_buf, shared_buf_len))
362362 ret = -EFAULT;
363363
364−err_free_shared_buf:
364+unlock:
365365 mutex_unlock(&psp->ras_context.mutex);
366+
367+free_shared_buf:
366368 kfree(shared_buf);
367369
368370 return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c+81−35
@@ -446,8 +446,7 @@ static int amdgpu_userq_wait_for_last_fence(struct amdgpu_usermode_queue *queue) · 445 unmodified lines
446446 return ret;
447447 }
448448
449−static void amdgpu_userq_cleanup(struct amdgpu_usermode_queue *queue,
450− int queue_id)
449+static void amdgpu_userq_cleanup(struct amdgpu_usermode_queue *queue)
451450 {
452451 struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;
453452 struct amdgpu_device *adev = uq_mgr->adev;
@@ -461,7 +460,6 @@ static void amdgpu_userq_cleanup(struct amdgpu_usermode_queue *queue, · 7 unmodified lines
461460 uq_funcs->mqd_destroy(queue);
462461 amdgpu_userq_fence_driver_free(queue);
463462 /* Use interrupt-safe locking since IRQ handlers may access these XArrays */
464− xa_erase_irq(&uq_mgr->userq_xa, (unsigned long)queue_id);
465463 xa_erase_irq(&adev->userq_doorbell_xa, queue->doorbell_index);
466464 queue->userq_mgr = NULL;
467465 list_del(&queue->userq_va_list);
@@ -470,12 +468,6 @@ static void amdgpu_userq_cleanup(struct amdgpu_usermode_queue *queue, · 2 unmodified lines
470468 up_read(&adev->reset_domain->sem);
471469 }
472470
473−static struct amdgpu_usermode_queue *
474−amdgpu_userq_find(struct amdgpu_userq_mgr *uq_mgr, int qid)
475−{
476− return xa_load(&uq_mgr->userq_xa, qid);
477−}
478−
479471 void
480472 amdgpu_userq_ensure_ev_fence(struct amdgpu_userq_mgr *uq_mgr,
481473 struct amdgpu_eviction_fence_mgr *evf_mgr)
@@ -625,22 +617,13 @@ unref_bo: · 143 unmodified lines
625617 }
626618
627619 static int
628−amdgpu_userq_destroy(struct drm_file *filp, int queue_id)
620+amdgpu_userq_destroy(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_usermode_queue *queue)
629621 {
630− struct amdgpu_fpriv *fpriv = filp->driver_priv;
631− struct amdgpu_userq_mgr *uq_mgr = &fpriv->userq_mgr;
632622 struct amdgpu_device *adev = uq_mgr->adev;
633− struct amdgpu_usermode_queue *queue;
634623 int r = 0;
635624
636625 cancel_delayed_work_sync(&uq_mgr->resume_work);
637626 mutex_lock(&uq_mgr->userq_mutex);
638− queue = amdgpu_userq_find(uq_mgr, queue_id);
639− if (!queue) {
640− drm_dbg_driver(adev_to_drm(uq_mgr->adev), "Invalid queue id to destroy\n");
641− mutex_unlock(&uq_mgr->userq_mutex);
642− return -EINVAL;
643− }
644627 amdgpu_userq_wait_for_last_fence(queue);
645628 /* Cancel any pending hang detection work and cleanup */
646629 if (queue->hang_detect_fence) {
@@ -672,7 +655,7 @@ amdgpu_userq_destroy(struct drm_file *filp, int queue_id) · 25 unmodified lines
672655 drm_warn(adev_to_drm(uq_mgr->adev), "trying to destroy a HW mapping userq\n");
673656 queue->state = AMDGPU_USERQ_STATE_HUNG;
674657 }
675− amdgpu_userq_cleanup(queue, queue_id);
658+ amdgpu_userq_cleanup(queue);
676659 mutex_unlock(&uq_mgr->userq_mutex);
677660
678661 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
@@ -680,6 +663,37 @@ amdgpu_userq_destroy(struct drm_file *filp, int queue_id) · 1 unmodified line
680663 return r;
681664 }
682665
666+static void amdgpu_userq_kref_destroy(struct kref *kref)
667+{
668+ int r;
669+ struct amdgpu_usermode_queue *queue =
670+ container_of(kref, struct amdgpu_usermode_queue, refcount);
671+ struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;
672+
673+ r = amdgpu_userq_destroy(uq_mgr, queue);
674+ if (r)
675+ drm_file_err(uq_mgr->file, "Failed to destroy usermode queue %d\n", r);
676+}
677+
678+struct amdgpu_usermode_queue *amdgpu_userq_get(struct amdgpu_userq_mgr *uq_mgr, u32 qid)
679+{
680+ struct amdgpu_usermode_queue *queue;
681+
682+ xa_lock(&uq_mgr->userq_xa);
683+ queue = xa_load(&uq_mgr->userq_xa, qid);
684+ if (queue)
685+ kref_get(&queue->refcount);
686+ xa_unlock(&uq_mgr->userq_xa);
687+
688+ return queue;
689+}
690+
691+void amdgpu_userq_put(struct amdgpu_usermode_queue *queue)
692+{
693+ if (queue)
694+ kref_put(&queue->refcount, amdgpu_userq_kref_destroy);
695+}
696+
683697 static int amdgpu_userq_priority_permit(struct drm_file *filp,
684698 int priority)
685699 {
@@ -834,6 +848,9 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args) · 148 unmodified lines
834848 goto unlock;
835849 }
836850
851+ /* drop this refcount during queue destroy */
852+ kref_init(&queue->refcount);
853+
837854 /* Wait for mode-1 reset to complete */
838855 down_read(&adev->reset_domain->sem);
839856 r = xa_err(xa_store_irq(&adev->userq_doorbell_xa, index, queue, GFP_KERNEL));
@@ -985,7 +1002,9 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data, · 145 unmodified lines
9851002 struct drm_file *filp)
9861003 {
9871004 union drm_amdgpu_userq *args = data;
988− int r;
1005+ struct amdgpu_fpriv *fpriv = filp->driver_priv;
1006+ struct amdgpu_usermode_queue *queue;
1007+ int r = 0;
9891008
9901009 if (!amdgpu_userq_enabled(dev))
9911010 return -ENOTSUPP;
@@ -1000,11 +1019,16 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data, · 8 unmodified lines
10001019 drm_file_err(filp, "Failed to create usermode queue\n");
10011020 break;
10021021
1003− case AMDGPU_USERQ_OP_FREE:
1004− r = amdgpu_userq_destroy(filp, args->in.queue_id);
1005− if (r)
1006− drm_file_err(filp, "Failed to destroy usermode queue\n");
1022+ case AMDGPU_USERQ_OP_FREE: {
1023+ xa_lock(&fpriv->userq_mgr.userq_xa);
1024+ queue = __xa_erase(&fpriv->userq_mgr.userq_xa, args->in.queue_id);
1025+ xa_unlock(&fpriv->userq_mgr.userq_xa);
1026+ if (!queue)
1027+ return -ENOENT;
1028+
1029+ amdgpu_userq_put(queue);
10071030 break;
1031+ }
10081032
10091033 default:
10101034 drm_dbg_driver(dev, "Invalid user queue op specified: %d\n", args->in.op);
@@ -1023,16 +1047,23 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr) · 12 unmodified lines
10231047
10241048 /* Resume all the queues for this process */
10251049 xa_for_each(&uq_mgr->userq_xa, queue_id, queue) {
1050+ queue = amdgpu_userq_get(uq_mgr, queue_id);
1051+ if (!queue)
1052+ continue;
1053+
10261054 if (!amdgpu_userq_buffer_vas_mapped(queue)) {
10271055 drm_file_err(uq_mgr->file,
10281056 "trying restore queue without va mapping\n");
10291057 queue->state = AMDGPU_USERQ_STATE_INVALID_VA;
1058+ amdgpu_userq_put(queue);
10301059 continue;
10311060 }
10321061
10331062 r = amdgpu_userq_restore_helper(queue);
10341063 if (r)
10351064 ret = r;
1065+
1066+ amdgpu_userq_put(queue);
10361067 }
10371068
10381069 if (ret)
@@ -1266,9 +1297,13 @@ amdgpu_userq_evict_all(struct amdgpu_userq_mgr *uq_mgr) · 227 unmodified lines
12661297 amdgpu_userq_detect_and_reset_queues(uq_mgr);
12671298 /* Try to unmap all the queues in this process ctx */
12681299 xa_for_each(&uq_mgr->userq_xa, queue_id, queue) {
1300+ queue = amdgpu_userq_get(uq_mgr, queue_id);
1301+ if (!queue)
1302+ continue;
12691303 r = amdgpu_userq_preempt_helper(queue);
12701304 if (r)
12711305 ret = r;
1306+ amdgpu_userq_put(queue);
12721307 }
12731308
12741309 if (ret)
@@ -1301,16 +1336,24 @@ amdgpu_userq_wait_for_signal(struct amdgpu_userq_mgr *uq_mgr) · 26 unmodified lines
13011336 int ret;
13021337
13031338 xa_for_each(&uq_mgr->userq_xa, queue_id, queue) {
1339+ queue = amdgpu_userq_get(uq_mgr, queue_id);
1340+ if (!queue)
1341+ continue;
1342+
13041343 struct dma_fence *f = queue->last_fence;
13051344
1306− if (!f || dma_fence_is_signaled(f))
1345+ if (!f || dma_fence_is_signaled(f)) {
1346+ amdgpu_userq_put(queue);
13071347 continue;
1348+ }
13081349 ret = dma_fence_wait_timeout(f, true, msecs_to_jiffies(100));
13091350 if (ret <= 0) {
13101351 drm_file_err(uq_mgr->file, "Timed out waiting for fence=%llu:%llu\n",
13111352 f->context, f->seqno);
1353+ amdgpu_userq_put(queue);
13121354 return -ETIMEDOUT;
13131355 }
1356+ amdgpu_userq_put(queue);
13141357 }
13151358
13161359 return 0;
@@ -1361,20 +1404,23 @@ int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *f · 44 unmodified lines
13611404 void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr)
13621405 {
13631406 struct amdgpu_usermode_queue *queue;
1364− unsigned long queue_id;
1407+ unsigned long queue_id = 0;
1408+
1409+ for (;;) {
1410+ xa_lock(&userq_mgr->userq_xa);
1411+ queue = xa_find(&userq_mgr->userq_xa, &queue_id, ULONG_MAX,
1412+ XA_PRESENT);
1413+ if (queue)
1414+ __xa_erase(&userq_mgr->userq_xa, queue_id);
1415+ xa_unlock(&userq_mgr->userq_xa);
13651416
1366− cancel_delayed_work_sync(&userq_mgr->resume_work);
1417+ if (!queue)
1418+ break;
13671419
1368− mutex_lock(&userq_mgr->userq_mutex);
1369− amdgpu_userq_detect_and_reset_queues(userq_mgr);
1370− xa_for_each(&userq_mgr->userq_xa, queue_id, queue) {
1371− amdgpu_userq_wait_for_last_fence(queue);
1372− amdgpu_userq_unmap_helper(queue);
1373− amdgpu_userq_cleanup(queue, queue_id);
1420+ amdgpu_userq_put(queue);
13741421 }
13751422
13761423 xa_destroy(&userq_mgr->userq_xa);
1377− mutex_unlock(&userq_mgr->userq_mutex);
13781424 mutex_destroy(&userq_mgr->userq_mutex);
13791425 }
13801426
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h+4−0
@@ -74,6 +74,7 @@ struct amdgpu_usermode_queue { · 73 unmodified lines
7474 struct dentry *debugfs_queue;
7575 struct delayed_work hang_detect_work;
7676 struct dma_fence *hang_detect_fence;
77+ struct kref refcount;
7778
7879 struct list_head userq_va_list;
7980 };
@@ -112,6 +113,9 @@ struct amdgpu_db_info { · 32 unmodified lines
112113 struct amdgpu_userq_obj *db_obj;
113114 };
114115
116+struct amdgpu_usermode_queue *amdgpu_userq_get(struct amdgpu_userq_mgr *uq_mgr, u32 qid);
117+void amdgpu_userq_put(struct amdgpu_usermode_queue *queue);
118+
115119 int amdgpu_userq_ioctl(struct drm_device *dev, void *data, struct drm_file *filp);
116120
117121 int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *file_priv,
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c+33−31
@@ -35,6 +35,8 @@ · 34 unmodified lines
3535 static const struct dma_fence_ops amdgpu_userq_fence_ops;
3636 static struct kmem_cache *amdgpu_userq_fence_slab;
3737
38+#define AMDGPU_USERQ_MAX_HANDLES (1U << 16)
39+
3840 int amdgpu_userq_fence_slab_init(void)
3941 {
4042 amdgpu_userq_fence_slab = kmem_cache_create("amdgpu_userq_fence",
@@ -464,7 +466,7 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 423 unmodified lines
464466 struct drm_amdgpu_userq_signal *args = data;
465467 struct drm_gem_object **gobj_write = NULL;
466468 struct drm_gem_object **gobj_read = NULL;
467− struct amdgpu_usermode_queue *queue;
469+ struct amdgpu_usermode_queue *queue = NULL;
468470 struct amdgpu_userq_fence *userq_fence;
469471 struct drm_syncobj **syncobj = NULL;
470472 u32 *bo_handles_write, num_write_bo_handles;
@@ -478,6 +480,11 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 7 unmodified lines
478480 if (!amdgpu_userq_enabled(dev))
479481 return -ENOTSUPP;
480482
483+ if (args->num_syncobj_handles > AMDGPU_USERQ_MAX_HANDLES ||
484+ args->num_bo_write_handles > AMDGPU_USERQ_MAX_HANDLES ||
485+ args->num_bo_read_handles > AMDGPU_USERQ_MAX_HANDLES)
486+ return -EINVAL;
487+
481488 num_syncobj_handles = args->num_syncobj_handles;
482489 syncobj_handles = memdup_user(u64_to_user_ptr(args->syncobj_handles),
483490 size_mul(sizeof(u32), num_syncobj_handles));
@@ -546,7 +553,7 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 62 unmodified lines
546553 }
547554
548555 /* Retrieve the user queue */
549− queue = xa_load(&userq_mgr->userq_xa, args->queue_id);
556+ queue = amdgpu_userq_get(userq_mgr, args->queue_id);
550557 if (!queue) {
551558 r = -ENOENT;
552559 goto put_gobj_write;
@@ -641,6 +648,9 @@ free_syncobj: · 88 unmodified lines
641648 free_syncobj_handles:
642649 kfree(syncobj_handles);
643650
651+ if (queue)
652+ amdgpu_userq_put(queue);
653+
644654 return r;
645655 }
646656
@@ -653,7 +663,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 6 unmodified lines
653663 struct drm_amdgpu_userq_wait *wait_info = data;
654664 struct amdgpu_fpriv *fpriv = filp->driver_priv;
655665 struct amdgpu_userq_mgr *userq_mgr = &fpriv->userq_mgr;
656− struct amdgpu_usermode_queue *waitq;
666+ struct amdgpu_usermode_queue *waitq = NULL;
657667 struct drm_gem_object **gobj_write;
658668 struct drm_gem_object **gobj_read;
659669 struct dma_fence **fences = NULL;
@@ -664,6 +674,11 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 4 unmodified lines
664674 if (!amdgpu_userq_enabled(dev))
665675 return -ENOTSUPP;
666676
677+ if (wait_info->num_syncobj_handles > AMDGPU_USERQ_MAX_HANDLES ||
678+ wait_info->num_bo_write_handles > AMDGPU_USERQ_MAX_HANDLES ||
679+ wait_info->num_bo_read_handles > AMDGPU_USERQ_MAX_HANDLES)
680+ return -EINVAL;
681+
667682 num_read_bo_handles = wait_info->num_bo_read_handles;
668683 bo_handles_read = memdup_user(u64_to_user_ptr(wait_info->bo_read_handles),
669684 size_mul(sizeof(u32), num_read_bo_handles));
@@ -833,7 +848,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 163 unmodified lines
833848
834849 dma_resv_for_each_fence(&resv_cursor, gobj_read[i]->resv,
835850 DMA_RESV_USAGE_READ, fence) {
836− if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
851+ if (num_fences >= wait_info->num_fences) {
837852 r = -EINVAL;
838853 goto free_fences;
839854 }
@@ -850,7 +865,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 10 unmodified lines
850865
851866 dma_resv_for_each_fence(&resv_cursor, gobj_write[i]->resv,
852867 DMA_RESV_USAGE_WRITE, fence) {
853− if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
868+ if (num_fences >= wait_info->num_fences) {
854869 r = -EINVAL;
855870 goto free_fences;
856871 }
@@ -874,8 +889,9 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 17 unmodified lines
874889 goto free_fences;
875890
876891 dma_fence_unwrap_for_each(f, &iter, fence) {
877− if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
892+ if (num_fences >= wait_info->num_fences) {
878893 r = -EINVAL;
894+ dma_fence_put(fence);
879895 goto free_fences;
880896 }
881897
@@ -898,8 +914,9 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 16 unmodified lines
898914 if (r)
899915 goto free_fences;
900916
901− if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
917+ if (num_fences >= wait_info->num_fences) {
902918 r = -EINVAL;
919+ dma_fence_put(fence);
903920 goto free_fences;
904921 }
905922
@@ -912,7 +929,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 6 unmodified lines
912929 */
913930 num_fences = dma_fence_dedup_array(fences, num_fences);
914931
915− waitq = xa_load(&userq_mgr->userq_xa, wait_info->waitq_id);
932+ waitq = amdgpu_userq_get(userq_mgr, wait_info->waitq_id);
916933 if (!waitq) {
917934 r = -EINVAL;
918935 goto free_fences;
@@ -969,32 +986,14 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data, · 50 unmodified lines
969986 r = -EFAULT;
970987 goto free_fences;
971988 }
972−
973− kfree(fences);
974− kfree(fence_info);
975989 }
976990
977− drm_exec_fini(&exec);
978− for (i = 0; i < num_read_bo_handles; i++)
979− drm_gem_object_put(gobj_read[i]);
980− kfree(gobj_read);
981−
982− for (i = 0; i < num_write_bo_handles; i++)
983− drm_gem_object_put(gobj_write[i]);
984− kfree(gobj_write);
985−
986− kfree(timeline_points);
987− kfree(timeline_handles);
988− kfree(syncobj_handles);
989− kfree(bo_handles_write);
990− kfree(bo_handles_read);
991−
992− return 0;
993−
994991 free_fences:
995− while (num_fences-- > 0)
996− dma_fence_put(fences[num_fences]);
997− kfree(fences);
992+ if (fences) {
993+ while (num_fences-- > 0)
994+ dma_fence_put(fences[num_fences]);
995+ kfree(fences);
996+ }
998997 free_fence_info:
999998 kfree(fence_info);
1000999 exec_fini:
@@ -1018,5 +1017,8 @@ free_bo_handles_write: · 17 unmodified lines
10181017 free_bo_handles_read:
10191018 kfree(bo_handles_read);
10201019
1020+ if (waitq)
1021+ amdgpu_userq_put(waitq);
1022+
10211023 return r;
10221024 }
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c+0−5
@@ -720,11 +720,6 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) · 719 unmodified lines
720720 mes_set_hw_res_pkt.enable_reg_active_poll = 1;
721721 mes_set_hw_res_pkt.enable_level_process_quantum_check = 1;
722722 mes_set_hw_res_pkt.oversubscription_timer = 50;
723− if ((mes->adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x7f)
724− mes_set_hw_res_pkt.enable_lr_compute_wa = 1;
725− else
726− dev_info_once(mes->adev->dev,
727− "MES FW version must be >= 0x7f to enable LR compute workaround.\n");
728723
729724 if (amdgpu_mes_log_enable) {
730725 mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c+4−6
@@ -731,6 +731,9 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe) · 730 unmodified lines
731731 int i;
732732 struct amdgpu_device *adev = mes->adev;
733733 union MESAPI_SET_HW_RESOURCES mes_set_hw_res_pkt;
734+ uint32_t mes_rev = (pipe == AMDGPU_MES_SCHED_PIPE) ?
735+ (mes->sched_version & AMDGPU_MES_VERSION_MASK) :
736+ (mes->kiq_version & AMDGPU_MES_VERSION_MASK);
734737
735738 memset(&mes_set_hw_res_pkt, 0, sizeof(mes_set_hw_res_pkt));
736739
@@ -779,18 +782,13 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe) · 42 unmodified lines
779782 mes_set_hw_res_pkt.use_different_vmid_compute = 1;
780783 mes_set_hw_res_pkt.enable_reg_active_poll = 1;
781784 mes_set_hw_res_pkt.enable_level_process_quantum_check = 1;
782− if ((mes->adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x82)
783− mes_set_hw_res_pkt.enable_lr_compute_wa = 1;
784− else
785− dev_info_once(adev->dev,
786− "MES FW version must be >= 0x82 to enable LR compute workaround.\n");
787785
788786 /*
789787 * Keep oversubscribe timer for sdma . When we have unmapped doorbell
790788 * handling support, other queue will not use the oversubscribe timer.
791789 * handling mode - 0: disabled; 1: basic version; 2: basic+ version
792790 */
793− mes_set_hw_res_pkt.oversubscription_timer = 50;
791+ mes_set_hw_res_pkt.oversubscription_timer = mes_rev < 0x8b ? 0 : 50;
794792 mes_set_hw_res_pkt.unmapped_doorbell_handling = 1;
795793
796794 if (amdgpu_mes_log_enable) {
drivers/gpu/drm/amd/amdgpu/psp_v15_0.c+10−10
@@ -69,12 +69,12 @@ static int psp_v15_0_0_ring_stop(struct psp_context *psp, · 68 unmodified lines
6969 0x80000000, 0x80000000, false);
7070 } else {
7171 /* Write the ring destroy command*/
72− WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_64,
72+ WREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_64,
7373 GFX_CTRL_CMD_ID_DESTROY_RINGS);
7474 /* there might be handshake issue with hardware which needs delay */
7575 mdelay(20);
7676 /* Wait for response flag (bit 31) */
77− ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_SMN_C2PMSG_64),
77+ ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_64),
7878 0x80000000, 0x80000000, false);
7979 }
8080
@@ -116,7 +116,7 @@ static int psp_v15_0_0_ring_create(struct psp_context *psp, · 35 unmodified lines
116116
117117 } else {
118118 /* Wait for sOS ready for ring creation */
119− ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_SMN_C2PMSG_64),
119+ ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_64),
120120 0x80000000, 0x80000000, false);
121121 if (ret) {
122122 DRM_ERROR("Failed to wait for trust OS ready for ring creation\n");
@@ -125,23 +125,23 @@ static int psp_v15_0_0_ring_create(struct psp_context *psp, · 2 unmodified lines
125125
126126 /* Write low address of the ring to C2PMSG_69 */
127127 psp_ring_reg = lower_32_bits(ring->ring_mem_mc_addr);
128− WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_69, psp_ring_reg);
128+ WREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_69, psp_ring_reg);
129129 /* Write high address of the ring to C2PMSG_70 */
130130 psp_ring_reg = upper_32_bits(ring->ring_mem_mc_addr);
131− WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_70, psp_ring_reg);
131+ WREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_70, psp_ring_reg);
132132 /* Write size of ring to C2PMSG_71 */
133133 psp_ring_reg = ring->ring_size;
134− WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_71, psp_ring_reg);
134+ WREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_71, psp_ring_reg);
135135 /* Write the ring initialization command to C2PMSG_64 */
136136 psp_ring_reg = ring_type;
137137 psp_ring_reg = psp_ring_reg << 16;
138− WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_64, psp_ring_reg);
138+ WREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_64, psp_ring_reg);
139139
140140 /* there might be handshake issue with hardware which needs delay */
141141 mdelay(20);
142142
143143 /* Wait for response flag (bit 31) in C2PMSG_64 */
144− ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_SMN_C2PMSG_64),
144+ ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_64),
145145 0x80000000, 0x8000FFFF, false);
146146 }
147147
@@ -174,7 +174,7 @@ static uint32_t psp_v15_0_0_ring_get_wptr(struct psp_context *psp) · 26 unmodified lines
174174 if (amdgpu_sriov_vf(adev))
175175 data = RREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_102);
176176 else
177− data = RREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_67);
177+ data = RREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_67);
178178
179179 return data;
180180 }
@@ -188,7 +188,7 @@ static void psp_v15_0_0_ring_set_wptr(struct psp_context *psp, uint32_t value) · 7 unmodified lines
188188 WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_101,
189189 GFX_CTRL_CMD_ID_CONSUME_CMD);
190190 } else
191− WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_67, value);
191+ WREG32_SOC15(MP0, 0, regMPASP_PCRU1_MPASP_C2PMSG_67, value);
192192 }
193193
194194 static const struct psp_funcs psp_v15_0_0_funcs = {
drivers/gpu/drm/amd/amdgpu/soc21.c+3−1
@@ -858,7 +858,9 @@ static int soc21_common_early_init(struct amdgpu_ip_block *ip_block) · 857 unmodified lines
858858 AMD_CG_SUPPORT_IH_CG |
859859 AMD_CG_SUPPORT_BIF_MGCG |
860860 AMD_CG_SUPPORT_BIF_LS;
861− adev->pg_flags = AMD_PG_SUPPORT_VCN |
861+ adev->pg_flags = AMD_PG_SUPPORT_VCN_DPG |
862+ AMD_PG_SUPPORT_VCN |
863+ AMD_PG_SUPPORT_JPEG_DPG |
862864 AMD_PG_SUPPORT_JPEG |
863865 AMD_PG_SUPPORT_GFX_PG;
864866 adev->external_rev_id = adev->rev_id + 0x1;
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c+4−0
@@ -174,6 +174,10 @@ static int vcn_v5_0_0_sw_init(struct amdgpu_ip_block *ip_block) · 173 unmodified lines
174174 fw_shared->present_flag_0 = cpu_to_le32(AMDGPU_FW_SHARED_FLAG_0_UNIFIED_QUEUE);
175175 fw_shared->sq.is_enabled = 1;
176176
177+ fw_shared->present_flag_0 |= cpu_to_le32(AMDGPU_VCN_SMU_DPM_INTERFACE_FLAG);
178+ fw_shared->smu_dpm_interface.smu_interface_type = (adev->flags & AMD_IS_APU) ?
179+ AMDGPU_VCN_SMU_DPM_INTERFACE_APU : AMDGPU_VCN_SMU_DPM_INTERFACE_DGPU;
180+
177181 if (amdgpu_vcnfw_log)
178182 amdgpu_vcn_fwlog_init(&adev->vcn.inst[i]);
179183
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c+1−0
@@ -593,6 +593,7 @@ int pqm_update_queue_properties(struct process_queue_manager *pqm, · 592 unmodified lines
593593 p->queue_size)) {
594594 pr_debug("ring buf 0x%llx size 0x%llx not mapped on GPU\n",
595595 p->queue_address, p->queue_size);
596+ amdgpu_bo_unreserve(vm->root.bo);
596597 return -EFAULT;
597598 }
598599
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c+4−2
@@ -1706,6 +1706,7 @@ __set_dm_plane_colorop_3dlut(struct drm_plane_state *plane_state, · 1705 unmodified lines
17061706 struct dc_transfer_func *tf = &dc_plane_state->in_shaper_func;
17071707 struct drm_atomic_state *state = plane_state->state;
17081708 const struct amdgpu_device *adev = drm_to_adev(colorop->dev);
1709+ bool has_3dlut = adev->dm.dc->caps.color.dpp.hw_3d_lut || adev->dm.dc->caps.color.mpc.preblend;
17091710 const struct drm_device *dev = colorop->dev;
17101711 const struct drm_color_lut32 *lut3d;
17111712 uint32_t lut3d_size;
@@ -1722,7 +1723,7 @@ __set_dm_plane_colorop_3dlut(struct drm_plane_state *plane_state, · 10 unmodified lines
17221723 }
17231724
17241725 if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_3D_LUT) {
1725− if (!adev->dm.dc->caps.color.dpp.hw_3d_lut) {
1726+ if (!has_3dlut) {
17261727 drm_dbg(dev, "3D LUT is not supported by hardware\n");
17271728 return -EINVAL;
17281729 }
@@ -1875,6 +1876,7 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state, · 146 unmodified lines
18751876 struct drm_colorop *colorop = plane_state->color_pipeline;
18761877 struct drm_device *dev = plane_state->plane->dev;
18771878 struct amdgpu_device *adev = drm_to_adev(dev);
1879+ bool has_3dlut = adev->dm.dc->caps.color.dpp.hw_3d_lut || adev->dm.dc->caps.color.mpc.preblend;
18781880 int ret;
18791881
18801882 /* 1D Curve - DEGAM TF */
@@ -1907,7 +1909,7 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state, · 26 unmodified lines
19071909 if (ret)
19081910 return ret;
19091911
1910− if (adev->dm.dc->caps.color.dpp.hw_3d_lut) {
1912+ if (has_3dlut) {
19111913 /* 1D Curve & LUT - SHAPER TF & LUT */
19121914 colorop = colorop->next;
19131915 if (!colorop) {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c+2−1
@@ -60,6 +60,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr · 59 unmodified lines
6060 struct drm_colorop *ops[MAX_COLOR_PIPELINE_OPS];
6161 struct drm_device *dev = plane->dev;
6262 struct amdgpu_device *adev = drm_to_adev(dev);
63+ bool has_3dlut = adev->dm.dc->caps.color.dpp.hw_3d_lut || adev->dm.dc->caps.color.mpc.preblend;
6364 int ret;
6465 int i = 0;
6566
@@ -112,7 +113,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr · 46 unmodified lines
112113
113114 i++;
114115
115− if (adev->dm.dc->caps.color.dpp.hw_3d_lut) {
116+ if (has_3dlut) {
116117 /* 1D curve - SHAPER TF */
117118 ops[i] = kzalloc_obj(*ops[0]);
118119 if (!ops[i]) {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c+8−8
@@ -765,15 +765,15 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 764 unmodified lines
765765 dm->adev->mode_info.crtcs[crtc_index] = acrtc;
766766
767767 /* Don't enable DRM CRTC degamma property for
768− * 1. Degamma is replaced by color pipeline.
769− * 2. DCE since it doesn't support programmable degamma anywhere.
770− * 3. DCN401 since pre-blending degamma LUT doesn't apply to cursor.
768+ * 1. DCE since it doesn't support programmable degamma anywhere.
769+ * 2. DCN401 since pre-blending degamma LUT doesn't apply to cursor.
770+ * Note: DEGAMMA properties are created even if the primary plane has the
771+ * COLOR_PIPELINE property. User space can use either the DEGAMMA properties
772+ * or the COLOR_PIPELINE property. An atomic commit which attempts to enable
773+ * both is rejected.
771774 */
772− if (plane->color_pipeline_property)
773− has_degamma = false;
774− else
775− has_degamma = dm->adev->dm.dc->caps.color.dpp.dcn_arch &&
776− dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01;
775+ has_degamma = dm->adev->dm.dc->caps.color.dpp.dcn_arch &&
776+ dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01;
777777
778778 drm_crtc_enable_color_mgmt(&acrtc->base, has_degamma ? MAX_COLOR_LUT_ENTRIES : 0,
779779 true, MAX_COLOR_LUT_ENTRIES);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c+8−0
@@ -1256,6 +1256,14 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane, · 1255 unmodified lines
12561256 if (ret)
12571257 return ret;
12581258
1259+ /* Reject commits that attempt to use both COLOR_PIPELINE and CRTC DEGAMMA_LUT */
1260+ if (new_plane_state->color_pipeline && new_crtc_state->degamma_lut) {
1261+ drm_dbg_atomic(plane->dev,
1262+ "[PLANE:%d:%s] COLOR_PIPELINE and CRTC DEGAMMA_LUT cannot be enabled simultaneously\n",
1263+ plane->base.id, plane->name);
1264+ return -EINVAL;
1265+ }
1266+
12591267 ret = amdgpu_dm_plane_fill_dc_scaling_info(adev, new_plane_state, &scaling_info);
12601268 if (ret)
12611269 return ret;
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+2−2
@@ -170,11 +170,11 @@ struct dc_stream_state *dc_create_stream_for_sink( · 169 unmodified lines
170170 if (sink == NULL)
171171 goto fail;
172172
173− stream = kzalloc_obj(struct dc_stream_state);
173+ stream = kzalloc_obj(struct dc_stream_state, GFP_ATOMIC);
174174 if (stream == NULL)
175175 goto fail;
176176
177− stream->update_scratch = kzalloc((int32_t) dc_update_scratch_space_size(), GFP_KERNEL);
177+ stream->update_scratch = kzalloc((int32_t) dc_update_scratch_space_size(), GFP_ATOMIC);
178178 if (stream->update_scratch == NULL)
179179 goto fail;
180180
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.h+5−1
@@ -38,7 +38,11 @@ · 37 unmodified lines
3838 DCCG_SRII(PIXEL_RATE_CNTL, OTG, 0),\
3939 DCCG_SRII(PIXEL_RATE_CNTL, OTG, 1),\
4040 SR(DISPCLK_FREQ_CHANGE_CNTL),\
41− SR(DC_MEM_GLOBAL_PWR_REQ_CNTL)
41+ SR(DC_MEM_GLOBAL_PWR_REQ_CNTL),\
42+ SR(MICROSECOND_TIME_BASE_DIV),\
43+ SR(MILLISECOND_TIME_BASE_DIV),\
44+ SR(DCCG_GATE_DISABLE_CNTL),\
45+ SR(DCCG_GATE_DISABLE_CNTL2)
4246
4347 #define DCCG_REG_LIST_DCN2() \
4448 DCCG_COMMON_REG_LIST_DCN_BASE(),\
drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c+20−1
@@ -96,6 +96,25 @@ static void dccg21_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppcl · 95 unmodified lines
9696 dccg->pipe_dppclk_khz[dpp_inst] = req_dppclk;
9797 }
9898
99+/*
100+ * On DCN21 S0i3 resume, BIOS programs MICROSECOND_TIME_BASE_DIV to
101+ * 0x00120464 as a marker that golden init has already been done.
102+ * dcn21_s0i3_golden_init_wa() reads this marker later in bios_golden_init()
103+ * to decide whether to skip golden init.
104+ *
105+ * dccg2_init() unconditionally overwrites MICROSECOND_TIME_BASE_DIV to
106+ * 0x00120264, destroying the marker before it can be read.
107+ *
108+ * Guard the call: if the S0i3 marker is present, skip dccg2_init() so the
109+ * WA can function correctly. bios_golden_init() will handle init in that case.
110+ */
111+static void dccg21_init(struct dccg *dccg)
112+{
113+ if (dccg2_is_s0i3_golden_init_wa_done(dccg))
114+ return;
115+
116+ dccg2_init(dccg);
117+}
99118
100119 static const struct dccg_funcs dccg21_funcs = {
101120 .update_dpp_dto = dccg21_update_dpp_dto,
@@ -103,7 +122,7 @@ static const struct dccg_funcs dccg21_funcs = { · 1 unmodified line
103122 .set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
104123 .otg_add_pixel = dccg2_otg_add_pixel,
105124 .otg_drop_pixel = dccg2_otg_drop_pixel,
106− .dccg_init = dccg2_init,
125+ .dccg_init = dccg21_init,
107126 .refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
108127 .allow_clock_gating = dccg2_allow_clock_gating,
109128 .enable_memory_low_power = dccg2_enable_memory_low_power,
drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.h+7−1
@@ -34,7 +34,13 @@ · 33 unmodified lines
3434 DCCG_SRII(DTO_PARAM, DPPCLK, 1),\
3535 DCCG_SRII(DTO_PARAM, DPPCLK, 2),\
3636 DCCG_SRII(DTO_PARAM, DPPCLK, 3),\
37− SR(REFCLK_CNTL)
37+ SR(REFCLK_CNTL),\
38+ SR(DISPCLK_FREQ_CHANGE_CNTL),\
39+ SR(DC_MEM_GLOBAL_PWR_REQ_CNTL),\
40+ SR(MICROSECOND_TIME_BASE_DIV),\
41+ SR(MILLISECOND_TIME_BASE_DIV),\
42+ SR(DCCG_GATE_DISABLE_CNTL),\
43+ SR(DCCG_GATE_DISABLE_CNTL2)
3844
3945 #define DCCG_MASK_SH_LIST_DCN301(mask_sh) \
4046 DCCG_SFI(DPPCLK_DTO_CTRL, DTO_ENABLE, DPPCLK, 0, mask_sh),\
drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.h+4−1
@@ -64,9 +64,12 @@ · 63 unmodified lines
6464 SR(DSCCLK1_DTO_PARAM),\
6565 SR(DSCCLK2_DTO_PARAM),\
6666 SR(DSCCLK_DTO_CTRL),\
67+ SR(DCCG_GATE_DISABLE_CNTL),\
6768 SR(DCCG_GATE_DISABLE_CNTL2),\
6869 SR(DCCG_GATE_DISABLE_CNTL3),\
69− SR(HDMISTREAMCLK0_DTO_PARAM)
70+ SR(HDMISTREAMCLK0_DTO_PARAM),\
71+ SR(DC_MEM_GLOBAL_PWR_REQ_CNTL),\
72+ SR(MICROSECOND_TIME_BASE_DIV)
7073
7174
7275 #define DCCG_MASK_SH_LIST_DCN31(mask_sh) \
drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.h+4−1
@@ -70,11 +70,14 @@ · 69 unmodified lines
7070 SR(DSCCLK2_DTO_PARAM),\
7171 SR(DSCCLK3_DTO_PARAM),\
7272 SR(DSCCLK_DTO_CTRL),\
73+ SR(DCCG_GATE_DISABLE_CNTL),\
7374 SR(DCCG_GATE_DISABLE_CNTL2),\
7475 SR(DCCG_GATE_DISABLE_CNTL3),\
7576 SR(HDMISTREAMCLK0_DTO_PARAM),\
7677 SR(OTG_PIXEL_RATE_DIV),\
77− SR(DTBCLK_P_CNTL)
78+ SR(DTBCLK_P_CNTL),\
79+ SR(DC_MEM_GLOBAL_PWR_REQ_CNTL),\
80+ SR(MICROSECOND_TIME_BASE_DIV)
7881
7982 #define DCCG_MASK_SH_LIST_DCN314_COMMON(mask_sh) \
8083 DCCG_SFI(DPPCLK_DTO_CTRL, DTO_DB_EN, DPPCLK, 0, mask_sh),\
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c+5−1
@@ -72,7 +72,11 @@ void dcn401_initialize_min_clocks(struct dc *dc) · 71 unmodified lines
7272 * audio corruption. Read current DISPCLK from DENTIST and request the same
7373 * freq to ensure that the timing is valid and unchanged.
7474 */
75− clocks->dispclk_khz = dc->clk_mgr->funcs->get_dispclk_from_dentist(dc->clk_mgr);
75+ if (dc->clk_mgr->funcs->get_dispclk_from_dentist) {
76+ clocks->dispclk_khz = dc->clk_mgr->funcs->get_dispclk_from_dentist(dc->clk_mgr);
77+ } else {
78+ clocks->dispclk_khz = dc->clk_mgr->boot_snapshot.dispclk * 1000;
79+ }
7680 }
7781 clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].dtbclk_mhz * 1000;
7882 clocks->fclk_p_state_change_support = true;
drivers/gpu/drm/amd/include/asic_reg/mp/mp_15_0_0_offset.h+18−0
@@ -82,6 +82,24 @@ · 81 unmodified lines
8282 #define regMPASP_SMN_IH_SW_INT_CTRL 0x0142
8383 #define regMPASP_SMN_IH_SW_INT_CTRL_BASE_IDX 0
8484
85+// addressBlock: mp_SmuMpASPPub_PcruDec
86+// base address: 0x3800000
87+#define regMPASP_PCRU1_MPASP_C2PMSG_64 0x4280
88+#define regMPASP_PCRU1_MPASP_C2PMSG_64_BASE_IDX 3
89+#define regMPASP_PCRU1_MPASP_C2PMSG_65 0x4281
90+#define regMPASP_PCRU1_MPASP_C2PMSG_65_BASE_IDX 3
91+#define regMPASP_PCRU1_MPASP_C2PMSG_66 0x4282
92+#define regMPASP_PCRU1_MPASP_C2PMSG_66_BASE_IDX 3
93+#define regMPASP_PCRU1_MPASP_C2PMSG_67 0x4283
94+#define regMPASP_PCRU1_MPASP_C2PMSG_67_BASE_IDX 3
95+#define regMPASP_PCRU1_MPASP_C2PMSG_68 0x4284
96+#define regMPASP_PCRU1_MPASP_C2PMSG_68_BASE_IDX 3
97+#define regMPASP_PCRU1_MPASP_C2PMSG_69 0x4285
98+#define regMPASP_PCRU1_MPASP_C2PMSG_69_BASE_IDX 3
99+#define regMPASP_PCRU1_MPASP_C2PMSG_70 0x4286
100+#define regMPASP_PCRU1_MPASP_C2PMSG_70_BASE_IDX 3
101+#define regMPASP_PCRU1_MPASP_C2PMSG_71 0x4287
102+#define regMPASP_PCRU1_MPASP_C2PMSG_71_BASE_IDX 3
85103
86104 // addressBlock: mp_SmuMp1_SmnDec
87105 // base address: 0x0
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+9−2
@@ -2034,6 +2034,7 @@ static ssize_t smu_v13_0_0_get_gpu_metrics(struct smu_context *smu, · 2033 unmodified lines
20342034 smu, SMU_DRIVER_TABLE_GPU_METRICS);
20352035 SmuMetricsExternal_t metrics_ext;
20362036 SmuMetrics_t *metrics = &metrics_ext.SmuMetrics;
2037+ uint32_t mp1_ver = amdgpu_ip_version(smu->adev, MP1_HWIP, 0);
20372038 int ret = 0;
20382039
20392040 ret = smu_cmn_get_metrics_table(smu,
@@ -2058,7 +2059,12 @@ static ssize_t smu_v13_0_0_get_gpu_metrics(struct smu_context *smu, · 18 unmodified lines
20582059 metrics->Vcn1ActivityPercentage);
20592060
20602061 gpu_metrics->average_socket_power = metrics->AverageSocketPower;
2061− gpu_metrics->energy_accumulator = metrics->EnergyAccumulator;
2062+
2063+ if ((mp1_ver == IP_VERSION(13, 0, 0) && smu->smc_fw_version <= 0x004e1e00) ||
2064+ (mp1_ver == IP_VERSION(13, 0, 10) && smu->smc_fw_version <= 0x00500800))
2065+ gpu_metrics->energy_accumulator = metrics->EnergyAccumulator;
2066+ else
2067+ gpu_metrics->energy_accumulator = UINT_MAX;
20622068
20632069 if (metrics->AverageGfxActivity <= SMU_13_0_0_BUSY_THRESHOLD)
20642070 gpu_metrics->average_gfxclk_frequency = metrics->AverageGfxclkFrequencyPostDs;
@@ -2216,7 +2222,8 @@ static int smu_v13_0_0_restore_user_od_settings(struct smu_context *smu) · 151 unmodified lines
22162222 user_od_table->OverDriveTable.FeatureCtrlMask = BIT(PP_OD_FEATURE_GFXCLK_BIT) |
22172223 BIT(PP_OD_FEATURE_UCLK_BIT) |
22182224 BIT(PP_OD_FEATURE_GFX_VF_CURVE_BIT) |
2219− BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2225+ BIT(PP_OD_FEATURE_FAN_CURVE_BIT) |
2226+ BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
22202227 res = smu_v13_0_0_upload_overdrive_table(smu, user_od_table);
22212228 user_od_table->OverDriveTable.FeatureCtrlMask = 0;
22222229 if (res == 0)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c+4−2
@@ -2065,7 +2065,8 @@ static ssize_t smu_v13_0_7_get_gpu_metrics(struct smu_context *smu, · 2064 unmodified lines
20652065 metrics->Vcn1ActivityPercentage);
20662066
20672067 gpu_metrics->average_socket_power = metrics->AverageSocketPower;
2068− gpu_metrics->energy_accumulator = metrics->EnergyAccumulator;
2068+ gpu_metrics->energy_accumulator = smu->smc_fw_version <= 0x00521400 ?
2069+ metrics->EnergyAccumulator : UINT_MAX;
20692070
20702071 if (metrics->AverageGfxActivity <= SMU_13_0_7_BUSY_THRESHOLD)
20712072 gpu_metrics->average_gfxclk_frequency = metrics->AverageGfxclkFrequencyPostDs;
@@ -2223,7 +2224,8 @@ static int smu_v13_0_7_restore_user_od_settings(struct smu_context *smu) · 151 unmodified lines
22232224 user_od_table->OverDriveTable.FeatureCtrlMask = BIT(PP_OD_FEATURE_GFXCLK_BIT) |
22242225 BIT(PP_OD_FEATURE_UCLK_BIT) |
22252226 BIT(PP_OD_FEATURE_GFX_VF_CURVE_BIT) |
2226− BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2227+ BIT(PP_OD_FEATURE_FAN_CURVE_BIT) |
2228+ BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
22272229 res = smu_v13_0_7_upload_overdrive_table(smu, user_od_table);
22282230 user_od_table->OverDriveTable.FeatureCtrlMask = 0;
22292231 if (res == 0)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c+2−1
@@ -2311,7 +2311,8 @@ static int smu_v14_0_2_restore_user_od_settings(struct smu_context *smu) · 2310 unmodified lines
23112311 user_od_table->OverDriveTable.FeatureCtrlMask = BIT(PP_OD_FEATURE_GFXCLK_BIT) |
23122312 BIT(PP_OD_FEATURE_UCLK_BIT) |
23132313 BIT(PP_OD_FEATURE_GFX_VF_CURVE_BIT) |
2314− BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2314+ BIT(PP_OD_FEATURE_FAN_CURVE_BIT) |
2315+ BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
23152316 res = smu_v14_0_2_upload_overdrive_table(smu, user_od_table);
23162317 user_od_table->OverDriveTable.FeatureCtrlMask = 0;
23172318 if (res == 0)
drivers/gpu/drm/bridge/samsung-dsim.c+14−9
@@ -1881,6 +1881,14 @@ static int samsung_dsim_register_te_irq(struct samsung_dsim *dsi, struct device · 1880 unmodified lines
18811881 return 0;
18821882 }
18831883
1884+static void samsung_dsim_unregister_te_irq(struct samsung_dsim *dsi)
1885+{
1886+ if (dsi->te_gpio) {
1887+ free_irq(gpiod_to_irq(dsi->te_gpio), dsi);
1888+ gpiod_put(dsi->te_gpio);
1889+ }
1890+}
1891+
18841892 static int samsung_dsim_host_attach(struct mipi_dsi_host *host,
18851893 struct mipi_dsi_device *device)
18861894 {
@@ -1961,7 +1969,7 @@ of_find_panel_or_bridge: · 74 unmodified lines
19611969 if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO)) {
19621970 ret = samsung_dsim_register_te_irq(dsi, &device->dev);
19631971 if (ret)
1964− return ret;
1972+ goto err_remove_bridge;
19651973 }
19661974
19671975 // The next bridge can be used by host_ops->attach
@@ -1982,15 +1990,12 @@ of_find_panel_or_bridge: · 14 unmodified lines
19821990 err_release_next_bridge:
19831991 drm_bridge_put(dsi->bridge.next_bridge);
19841992 dsi->bridge.next_bridge = NULL;
1985− return ret;
1986−}
19871993
1988−static void samsung_dsim_unregister_te_irq(struct samsung_dsim *dsi)
1989−{
1990− if (dsi->te_gpio) {
1991− free_irq(gpiod_to_irq(dsi->te_gpio), dsi);
1992− gpiod_put(dsi->te_gpio);
1993− }
1994+ if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO))
1995+ samsung_dsim_unregister_te_irq(dsi);
1996+err_remove_bridge:
1997+ drm_bridge_remove(&dsi->bridge);
1998+ return ret;
19941999 }
19952000
19962001 static int samsung_dsim_host_detach(struct mipi_dsi_host *host,
drivers/gpu/drm/bridge/synopsys/dw-dp.c+3−1
@@ -2049,7 +2049,9 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder, · 2048 unmodified lines
20492049 bridge->type = DRM_MODE_CONNECTOR_DisplayPort;
20502050 bridge->ycbcr_420_allowed = true;
20512051
2052− devm_drm_bridge_add(dev, bridge);
2052+ ret = devm_drm_bridge_add(dev, bridge);
2053+ if (ret)
2054+ return ERR_PTR(ret);
20532055
20542056 dp->aux.dev = dev;
20552057 dp->aux.drm_dev = encoder->dev;
drivers/gpu/drm/bridge/ti-sn65dsi83.c+7−6
@@ -351,9 +351,9 @@ static u8 sn65dsi83_get_dsi_range(struct sn65dsi83 *ctx, · 350 unmodified lines
351351 * DSI_CLK = mode clock * bpp / dsi_data_lanes / 2
352352 * the 2 is there because the bus is DDR.
353353 */
354− return DIV_ROUND_UP(clamp((unsigned int)mode->clock *
355− mipi_dsi_pixel_format_to_bpp(ctx->dsi->format) /
356− ctx->dsi->lanes / 2, 40000U, 500000U), 5000U);
354+ return clamp((unsigned int)mode->clock *
355+ mipi_dsi_pixel_format_to_bpp(ctx->dsi->format) /
356+ ctx->dsi->lanes / 2, 40000U, 500000U) / 5000U;
357357 }
358358
359359 static u8 sn65dsi83_get_dsi_div(struct sn65dsi83 *ctx)
@@ -517,6 +517,7 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge, · 157 unmodified lines
517517 struct drm_atomic_state *state)
518518 {
519519 struct sn65dsi83 *ctx = bridge_to_sn65dsi83(bridge);
520+ const unsigned int dual_factor = ctx->lvds_dual_link ? 2 : 1;
520521 const struct drm_bridge_state *bridge_state;
521522 const struct drm_crtc_state *crtc_state;
522523 const struct drm_display_mode *mode;
@@ -653,18 +654,18 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge, · 130 unmodified lines
653654 /* 32 + 1 pixel clock to ensure proper operation */
654655 le16val = cpu_to_le16(32 + 1);
655656 regmap_bulk_write(ctx->regmap, REG_VID_CHA_SYNC_DELAY_LOW, &le16val, 2);
656− le16val = cpu_to_le16(mode->hsync_end - mode->hsync_start);
657+ le16val = cpu_to_le16((mode->hsync_end - mode->hsync_start) / dual_factor);
657658 regmap_bulk_write(ctx->regmap, REG_VID_CHA_HSYNC_PULSE_WIDTH_LOW,
658659 &le16val, 2);
659660 le16val = cpu_to_le16(mode->vsync_end - mode->vsync_start);
660661 regmap_bulk_write(ctx->regmap, REG_VID_CHA_VSYNC_PULSE_WIDTH_LOW,
661662 &le16val, 2);
662663 regmap_write(ctx->regmap, REG_VID_CHA_HORIZONTAL_BACK_PORCH,
663− mode->htotal - mode->hsync_end);
664+ (mode->htotal - mode->hsync_end) / dual_factor);
664665 regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_BACK_PORCH,
665666 mode->vtotal - mode->vsync_end);
666667 regmap_write(ctx->regmap, REG_VID_CHA_HORIZONTAL_FRONT_PORCH,
667− mode->hsync_start - mode->hdisplay);
668+ (mode->hsync_start - mode->hdisplay) / dual_factor);
668669 regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_FRONT_PORCH,
669670 mode->vsync_start - mode->vdisplay);
670671 regmap_write(ctx->regmap, REG_VID_CHA_TEST_PATTERN, 0x00);
drivers/gpu/drm/bridge/ti-sn65dsi86.c+4−2
@@ -1415,6 +1415,7 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev, · 1414 unmodified lines
14151415 {
14161416 struct ti_sn65dsi86 *pdata = dev_get_drvdata(adev->dev.parent);
14171417 struct device_node *np = pdata->dev->of_node;
1418+ const struct i2c_client *client = to_i2c_client(pdata->dev);
14181419 int ret;
14191420
14201421 pdata->next_bridge = devm_drm_of_get_bridge(&adev->dev, np, 1, 0);
@@ -1433,8 +1434,9 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev, · 12 unmodified lines
14331434 ? DRM_MODE_CONNECTOR_DisplayPort : DRM_MODE_CONNECTOR_eDP;
14341435
14351436 if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort) {
1436− pdata->bridge.ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT |
1437− DRM_BRIDGE_OP_HPD;
1437+ pdata->bridge.ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
1438+ if (client->irq)
1439+ pdata->bridge.ops |= DRM_BRIDGE_OP_HPD;
14381440 /*
14391441 * If comms were already enabled they would have been enabled
14401442 * with the wrong value of HPD_DISABLE. Update it now. Comms
drivers/gpu/drm/drm_client_modeset.c+2−1
@@ -930,7 +930,8 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, · 929 unmodified lines
930930 mutex_unlock(&client->modeset_mutex);
931931 out:
932932 kfree(crtcs);
933− modes_destroy(dev, modes, connector_count);
933+ if (modes)
934+ modes_destroy(dev, modes, connector_count);
934935 kfree(modes);
935936 kfree(offsets);
936937 kfree(enabled);
drivers/gpu/drm/drm_gpusvm.c+5−5
@@ -1338,14 +1338,14 @@ bool drm_gpusvm_range_pages_valid(struct drm_gpusvm *gpusvm, · 1337 unmodified lines
13381338 EXPORT_SYMBOL_GPL(drm_gpusvm_range_pages_valid);
13391339
13401340 /**
1341− * drm_gpusvm_range_pages_valid_unlocked() - GPU SVM range pages valid unlocked
1341+ * drm_gpusvm_pages_valid_unlocked() - GPU SVM pages valid unlocked
13421342 * @gpusvm: Pointer to the GPU SVM structure
1343− * @range: Pointer to the GPU SVM range structure
1343+ * @svm_pages: Pointer to the GPU SVM pages structure
13441344 *
1345− * This function determines if a GPU SVM range pages are valid. Expected be
1346− * called without holding gpusvm->notifier_lock.
1345+ * This function determines if a GPU SVM pages are valid. Expected be called
1346+ * without holding gpusvm->notifier_lock.
13471347 *
1348− * Return: True if GPU SVM range has valid pages, False otherwise
1348+ * Return: True if GPU SVM pages are valid, False otherwise
13491349 */
13501350 static bool drm_gpusvm_pages_valid_unlocked(struct drm_gpusvm *gpusvm,
13511351 struct drm_gpusvm_pages *svm_pages)
drivers/gpu/drm/drm_pagemap.c+2−12
@@ -480,18 +480,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation, · 479 unmodified lines
480480 .start = start,
481481 .end = end,
482482 .pgmap_owner = pagemap->owner,
483− /*
484− * FIXME: MIGRATE_VMA_SELECT_DEVICE_PRIVATE intermittently
485− * causes 'xe_exec_system_allocator --r *race*no*' to trigger aa
486− * engine reset and a hard hang due to getting stuck on a folio
487− * lock. This should work and needs to be root-caused. The only
488− * downside of not selecting MIGRATE_VMA_SELECT_DEVICE_PRIVATE
489− * is that device-to-device migrations won’t work; instead,
490− * memory will bounce through system memory. This path should be
491− * rare and only occur when the madvise attributes of memory are
492− * changed or atomics are being used.
493− */
494− .flags = MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT,
483+ .flags = MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT |
484+ MIGRATE_VMA_SELECT_DEVICE_PRIVATE,
495485 };
496486 unsigned long i, npages = npages_in_range(start, end);
497487 unsigned long own_pages = 0, migrated_pages = 0;
drivers/gpu/drm/gud/gud_drv.c+8−1
@@ -339,7 +339,9 @@ static int gud_stats_debugfs(struct seq_file *m, void *data) · 338 unmodified lines
339339 }
340340
341341 static const struct drm_crtc_helper_funcs gud_crtc_helper_funcs = {
342− .atomic_check = drm_crtc_helper_atomic_check
342+ .atomic_check = drm_crtc_helper_atomic_check,
343+ .atomic_enable = gud_crtc_atomic_enable,
344+ .atomic_disable = gud_crtc_atomic_disable,
343345 };
344346
345347 static const struct drm_crtc_funcs gud_crtc_funcs = {
@@ -364,6 +366,10 @@ static const struct drm_plane_funcs gud_plane_funcs = { · 18 unmodified lines
364366 DRM_GEM_SHADOW_PLANE_FUNCS,
365367 };
366368
369+static const struct drm_mode_config_helper_funcs gud_mode_config_helpers = {
370+ .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
371+};
372+
367373 static const struct drm_mode_config_funcs gud_mode_config_funcs = {
368374 .fb_create = drm_gem_fb_create_with_dirty,
369375 .atomic_check = drm_atomic_helper_check,
@@ -499,6 +505,7 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id) · 129 unmodified lines
499505 drm->mode_config.min_height = le32_to_cpu(desc.min_height);
500506 drm->mode_config.max_height = le32_to_cpu(desc.max_height);
501507 drm->mode_config.funcs = &gud_mode_config_funcs;
508+ drm->mode_config.helper_private = &gud_mode_config_helpers;
502509
503510 /* Format init */
504511 formats_dev = devm_kmalloc(dev, GUD_FORMATS_MAX_NUM, GFP_KERNEL);
drivers/gpu/drm/gud/gud_internal.h+4−0
@@ -62,6 +62,10 @@ int gud_usb_set_u8(struct gud_device *gdrm, u8 request, u8 val); · 61 unmodified lines
6262
6363 void gud_clear_damage(struct gud_device *gdrm);
6464 void gud_flush_work(struct work_struct *work);
65+void gud_crtc_atomic_enable(struct drm_crtc *crtc,
66+ struct drm_atomic_state *state);
67+void gud_crtc_atomic_disable(struct drm_crtc *crtc,
68+ struct drm_atomic_state *state);
6569 int gud_plane_atomic_check(struct drm_plane *plane,
6670 struct drm_atomic_state *state);
6771 void gud_plane_atomic_update(struct drm_plane *plane,
drivers/gpu/drm/gud/gud_pipe.c+36−18
@@ -580,6 +580,39 @@ out: · 579 unmodified lines
580580 return ret;
581581 }
582582
583+void gud_crtc_atomic_enable(struct drm_crtc *crtc,
584+ struct drm_atomic_state *state)
585+{
586+ struct drm_device *drm = crtc->dev;
587+ struct gud_device *gdrm = to_gud_device(drm);
588+ int idx;
589+
590+ if (!drm_dev_enter(drm, &idx))
591+ return;
592+
593+ gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 1);
594+ gud_usb_set(gdrm, GUD_REQ_SET_STATE_COMMIT, 0, NULL, 0);
595+ gud_usb_set_u8(gdrm, GUD_REQ_SET_DISPLAY_ENABLE, 1);
596+
597+ drm_dev_exit(idx);
598+}
599+
600+void gud_crtc_atomic_disable(struct drm_crtc *crtc,
601+ struct drm_atomic_state *state)
602+{
603+ struct drm_device *drm = crtc->dev;
604+ struct gud_device *gdrm = to_gud_device(drm);
605+ int idx;
606+
607+ if (!drm_dev_enter(drm, &idx))
608+ return;
609+
610+ gud_usb_set_u8(gdrm, GUD_REQ_SET_DISPLAY_ENABLE, 0);
611+ gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 0);
612+
613+ drm_dev_exit(idx);
614+}
615+
583616 void gud_plane_atomic_update(struct drm_plane *plane,
584617 struct drm_atomic_state *atomic_state)
585618 {
@@ -607,24 +640,12 @@ void gud_plane_atomic_update(struct drm_plane *plane, · 21 unmodified lines
607640 mutex_unlock(&gdrm->damage_lock);
608641 }
609642
610− if (!drm_dev_enter(drm, &idx))
643+ if (!crtc || !drm_dev_enter(drm, &idx))
611644 return;
612645
613− if (!old_state->fb)
614− gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 1);
615−
616− if (fb && (crtc->state->mode_changed || crtc->state->connectors_changed))
617− gud_usb_set(gdrm, GUD_REQ_SET_STATE_COMMIT, 0, NULL, 0);
618−
619− if (crtc->state->active_changed)
620− gud_usb_set_u8(gdrm, GUD_REQ_SET_DISPLAY_ENABLE, crtc->state->active);
621−
622− if (!fb)
623− goto ctrl_disable;
624−
625646 ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
626647 if (ret)
627− goto ctrl_disable;
648+ goto out;
628649
629650 drm_atomic_helper_damage_iter_init(&iter, old_state, new_state);
630651 drm_atomic_for_each_plane_damage(&iter, &damage)
@@ -632,9 +653,6 @@ void gud_plane_atomic_update(struct drm_plane *plane, · 1 unmodified line
632653
633654 drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
634655
635−ctrl_disable:
636− if (!crtc->state->enable)
637− gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 0);
638−
656+out:
639657 drm_dev_exit(idx);
640658 }
drivers/gpu/drm/i915/display/intel_alpm.c+1−12
@@ -43,12 +43,6 @@ bool intel_alpm_is_alpm_aux_less(struct intel_dp *intel_dp, · 42 unmodified lines
4343
4444 void intel_alpm_init(struct intel_dp *intel_dp)
4545 {
46− u8 dpcd;
47−
48− if (drm_dp_dpcd_readb(&intel_dp->aux, DP_RECEIVER_ALPM_CAP, &dpcd) < 0)
49− return;
50−
51− intel_dp->alpm_dpcd = dpcd;
5246 mutex_init(&intel_dp->alpm.lock);
5347 }
5448
@@ -562,12 +556,7 @@ void intel_alpm_disable(struct intel_dp *intel_dp) · 507 unmodified lines
562556 mutex_lock(&intel_dp->alpm.lock);
563557
564558 intel_de_rmw(display, ALPM_CTL(display, cpu_transcoder),
565− ALPM_CTL_ALPM_ENABLE | ALPM_CTL_LOBF_ENABLE |
566− ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0);
567−
568− intel_de_rmw(display,
569− PORT_ALPM_CTL(cpu_transcoder),
570− PORT_ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0);
559+ ALPM_CTL_ALPM_ENABLE | ALPM_CTL_LOBF_ENABLE, 0);
571560
572561 drm_dbg_kms(display->drm, "Disabling ALPM\n");
573562 mutex_unlock(&intel_dp->alpm.lock);
drivers/gpu/drm/i915/display/intel_display.c+0−1
@@ -1614,7 +1614,6 @@ static void hsw_configure_cpu_transcoder(const struct intel_crtc_state *crtc_sta · 1613 unmodified lines
16141614 }
16151615
16161616 intel_set_transcoder_timings(crtc_state);
1617− intel_vrr_set_transcoder_timings(crtc_state);
16181617
16191618 if (cpu_transcoder != TRANSCODER_EDP)
16201619 intel_de_write(display, TRANS_MULT(display, cpu_transcoder),
drivers/gpu/drm/i915/display/intel_dp.c+7−0
@@ -4577,6 +4577,7 @@ static bool · 4576 unmodified lines
45774577 intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector)
45784578 {
45794579 struct intel_display *display = to_intel_display(intel_dp);
4580+ int ret;
45804581
45814582 /* this function is meant to be called only once */
45824583 drm_WARN_ON(display->drm, intel_dp->dpcd[DP_DPCD_REV] != 0);
@@ -4616,6 +4617,12 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector · 33 unmodified lines
46164617 */
46174618 intel_dp_init_source_oui(intel_dp);
46184619
4620+ /* Read the ALPM DPCD caps */
4621+ ret = drm_dp_dpcd_read_byte(&intel_dp->aux, DP_RECEIVER_ALPM_CAP,
4622+ &intel_dp->alpm_dpcd);
4623+ if (ret < 0)
4624+ return false;
4625+
46194626 /*
46204627 * This has to be called after intel_dp->edp_dpcd is filled, PSR checks
46214628 * for SET_POWER_CAPABLE bit in intel_dp->edp_dpcd[1]
drivers/gpu/drm/i915/display/intel_psr.c+56−15
@@ -1307,9 +1307,14 @@ static bool psr2_granularity_check(struct intel_crtc_state *crtc_state, · 1306 unmodified lines
13071307 u16 sink_y_granularity = crtc_state->has_panel_replay ?
13081308 connector->dp.panel_replay_caps.su_y_granularity :
13091309 connector->dp.psr_caps.su_y_granularity;
1310− u16 sink_w_granularity = crtc_state->has_panel_replay ?
1311− connector->dp.panel_replay_caps.su_w_granularity :
1312− connector->dp.psr_caps.su_w_granularity;
1310+ u16 sink_w_granularity;
1311+
1312+ if (crtc_state->has_panel_replay)
1313+ sink_w_granularity = connector->dp.panel_replay_caps.su_w_granularity ==
1314+ DP_PANEL_REPLAY_FULL_LINE_GRANULARITY ?
1315+ crtc_hdisplay : connector->dp.panel_replay_caps.su_w_granularity;
1316+ else
1317+ sink_w_granularity = connector->dp.psr_caps.su_w_granularity;
13131318
13141319 /* PSR2 HW only send full lines so we only need to validate the width */
13151320 if (crtc_hdisplay % sink_w_granularity)
@@ -2614,6 +2619,12 @@ void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb, · 1298 unmodified lines
26142619
26152620 intel_de_write_dsb(display, dsb, PIPE_SRCSZ_ERLY_TPT(crtc->pipe),
26162621 crtc_state->pipe_srcsz_early_tpt);
2622+
2623+ if (!crtc_state->dsc.compression_enable)
2624+ return;
2625+
2626+ intel_dsc_su_et_parameters_configure(dsb, encoder, crtc_state,
2627+ drm_rect_height(&crtc_state->psr2_su_area));
26172628 }
26182629
26192630 static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
@@ -2684,11 +2695,12 @@ static void clip_area_update(struct drm_rect *overlap_damage_area, · 64 unmodified lines
26842695 overlap_damage_area->y2 = damage_area->y2;
26852696 }
26862697
2687−static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_state)
2698+static bool intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_state)
26882699 {
26892700 struct intel_display *display = to_intel_display(crtc_state);
26902701 const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
26912702 u16 y_alignment;
2703+ bool su_area_changed = false;
26922704
26932705 /* ADLP aligns the SU region to vdsc slice height in case dsc is enabled */
26942706 if (crtc_state->dsc.compression_enable &&
@@ -2697,10 +2709,18 @@ static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_st · 2 unmodified lines
26972709 else
26982710 y_alignment = crtc_state->su_y_granularity;
26992711
2700− crtc_state->psr2_su_area.y1 -= crtc_state->psr2_su_area.y1 % y_alignment;
2701− if (crtc_state->psr2_su_area.y2 % y_alignment)
2712+ if (crtc_state->psr2_su_area.y1 % y_alignment) {
2713+ crtc_state->psr2_su_area.y1 -= crtc_state->psr2_su_area.y1 % y_alignment;
2714+ su_area_changed = true;
2715+ }
2716+
2717+ if (crtc_state->psr2_su_area.y2 % y_alignment) {
27022718 crtc_state->psr2_su_area.y2 = ((crtc_state->psr2_su_area.y2 /
27032719 y_alignment) + 1) * y_alignment;
2720+ su_area_changed = true;
2721+ }
2722+
2723+ return su_area_changed;
27042724 }
27052725
27062726 /*
@@ -2834,7 +2854,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 127 unmodified lines
28342854 struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
28352855 struct intel_plane_state *new_plane_state, *old_plane_state;
28362856 struct intel_plane *plane;
2837− bool full_update = false, cursor_in_su_area = false;
2857+ bool full_update = false, su_area_changed;
28382858 int i, ret;
28392859
28402860 if (!crtc_state->enable_psr2_sel_fetch)
@@ -2941,15 +2961,32 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 100 unmodified lines
29412961 if (ret)
29422962 return ret;
29432963
2944− /*
2945− * Adjust su area to cover cursor fully as necessary (early
2946− * transport). This needs to be done after
2947− * drm_atomic_add_affected_planes to ensure visible cursor is added into
2948− * affected planes even when cursor is not updated by itself.
2949− */
2950− intel_psr2_sel_fetch_et_alignment(state, crtc, &cursor_in_su_area);
2964+ do {
2965+ bool cursor_in_su_area;
2966+
2967+ /*
2968+ * Adjust su area to cover cursor fully as necessary
2969+ * (early transport). This needs to be done after
2970+ * drm_atomic_add_affected_planes to ensure visible
2971+ * cursor is added into affected planes even when
2972+ * cursor is not updated by itself.
2973+ */
2974+ intel_psr2_sel_fetch_et_alignment(state, crtc, &cursor_in_su_area);
29512975
2952− intel_psr2_sel_fetch_pipe_alignment(crtc_state);
2976+ su_area_changed = intel_psr2_sel_fetch_pipe_alignment(crtc_state);
2977+
2978+ /*
2979+ * If the cursor was outside the SU area before
2980+ * alignment, the alignment step (which only expands
2981+ * SU) may pull the cursor partially inside, so we
2982+ * must run ET alignment again to fully cover it. But
2983+ * if the cursor was already fully inside before
2984+ * alignment, expanding the SU area won't change that,
2985+ * so no further work is needed.
2986+ */
2987+ if (cursor_in_su_area)
2988+ break;
2989+ } while (su_area_changed);
29532990
29542991 /*
29552992 * Now that we have the pipe damaged area check if it intersect with
@@ -3009,6 +3046,10 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 53 unmodified lines
30093046 }
30103047
30113048 skip_sel_fetch_set_loop:
3049+ if (full_update)
3050+ clip_area_update(&crtc_state->psr2_su_area, &crtc_state->pipe_src,
3051+ &crtc_state->pipe_src);
3052+
30123053 psr2_man_trk_ctl_calc(crtc_state, full_update);
30133054 crtc_state->pipe_srcsz_early_tpt =
30143055 psr2_pipe_srcsz_early_tpt_calc(crtc_state, full_update);
drivers/gpu/drm/i915/display/intel_vdsc.c+23−0
@@ -767,6 +767,29 @@ void intel_dsc_dp_pps_write(struct intel_encoder *encoder, · 766 unmodified lines
767767 sizeof(dp_dsc_pps_sdp));
768768 }
769769
770+void intel_dsc_su_et_parameters_configure(struct intel_dsb *dsb, struct intel_encoder *encoder,
771+ const struct intel_crtc_state *crtc_state, int su_lines)
772+{
773+ struct intel_display *display = to_intel_display(crtc_state);
774+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
775+ const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
776+ enum pipe pipe = crtc->pipe;
777+ int vdsc_instances_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
778+ int slice_row_per_frame = su_lines / vdsc_cfg->slice_height;
779+ u32 val;
780+
781+ drm_WARN_ON_ONCE(display->drm, su_lines % vdsc_cfg->slice_height);
782+ drm_WARN_ON_ONCE(display->drm, vdsc_instances_per_pipe > 2);
783+
784+ val = DSC_SUPS0_SU_SLICE_ROW_PER_FRAME(slice_row_per_frame);
785+ val |= DSC_SUPS0_SU_PIC_HEIGHT(su_lines);
786+
787+ intel_de_write_dsb(display, dsb, LNL_DSC0_SU_PARAMETER_SET_0(pipe), val);
788+
789+ if (vdsc_instances_per_pipe == 2)
790+ intel_de_write_dsb(display, dsb, LNL_DSC1_SU_PARAMETER_SET_0(pipe), val);
791+}
792+
770793 static i915_reg_t dss_ctl1_reg(struct intel_crtc *crtc, enum transcoder cpu_transcoder)
771794 {
772795 return is_pipe_dsc(crtc, cpu_transcoder) ?
drivers/gpu/drm/i915/display/intel_vdsc.h+3−0
@@ -13,6 +13,7 @@ struct drm_printer; · 12 unmodified lines
1313 enum transcoder;
1414 struct intel_crtc;
1515 struct intel_crtc_state;
16+struct intel_dsb;
1617 struct intel_encoder;
1718
1819 bool intel_dsc_source_support(const struct intel_crtc_state *crtc_state);
@@ -31,6 +32,8 @@ void intel_dsc_dsi_pps_write(struct intel_encoder *encoder, · 12 unmodified lines
3132 const struct intel_crtc_state *crtc_state);
3233 void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
3334 const struct intel_crtc_state *crtc_state);
35+void intel_dsc_su_et_parameters_configure(struct intel_dsb *dsb, struct intel_encoder *encoder,
36+ const struct intel_crtc_state *crtc_state, int su_lines);
3437 void intel_vdsc_state_dump(struct drm_printer *p, int indent,
3538 const struct intel_crtc_state *crtc_state);
3639 int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state);
drivers/gpu/drm/i915/display/intel_vdsc_regs.h+12−0
@@ -196,6 +196,18 @@ · 195 unmodified lines
196196 #define DSC_PPS18_NSL_BPG_OFFSET(offset) REG_FIELD_PREP(DSC_PPS18_NSL_BPG_OFFSET_MASK, offset)
197197 #define DSC_PPS18_SL_OFFSET_ADJ(offset) REG_FIELD_PREP(DSC_PPS18_SL_OFFSET_ADJ_MASK, offset)
198198
199+#define _LNL_DSC0_SU_PARAMETER_SET_0_PA 0x78064
200+#define _LNL_DSC1_SU_PARAMETER_SET_0_PA 0x78164
201+#define _LNL_DSC0_SU_PARAMETER_SET_0_PB 0x78264
202+#define _LNL_DSC1_SU_PARAMETER_SET_0_PB 0x78364
203+#define LNL_DSC0_SU_PARAMETER_SET_0(pipe) _MMIO_PIPE((pipe), _LNL_DSC0_SU_PARAMETER_SET_0_PA, _LNL_DSC0_SU_PARAMETER_SET_0_PB)
204+#define LNL_DSC1_SU_PARAMETER_SET_0(pipe) _MMIO_PIPE((pipe), _LNL_DSC1_SU_PARAMETER_SET_0_PA, _LNL_DSC1_SU_PARAMETER_SET_0_PB)
205+
206+#define DSC_SUPS0_SU_SLICE_ROW_PER_FRAME_MASK REG_GENMASK(31, 20)
207+#define DSC_SUPS0_SU_SLICE_ROW_PER_FRAME(rows) REG_FIELD_PREP(DSC_SUPS0_SU_SLICE_ROW_PER_FRAME_MASK, (rows))
208+#define DSC_SUPS0_SU_PIC_HEIGHT_MASK REG_GENMASK(15, 0)
209+#define DSC_SUPS0_SU_PIC_HEIGHT(h) REG_FIELD_PREP(DSC_SUPS0_SU_PIC_HEIGHT_MASK, (h))
210+
199211 /* Icelake Rate Control Buffer Threshold Registers */
200212 #define DSCA_RC_BUF_THRESH_0 _MMIO(0x6B230)
201213 #define DSCA_RC_BUF_THRESH_0_UDW _MMIO(0x6B230 + 4)
drivers/gpu/drm/i915/display/intel_vrr.c+14−0
@@ -597,6 +597,18 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state) · 596 unmodified lines
597597 if (!HAS_VRR(display))
598598 return;
599599
600+ /*
601+ * Bspec says:
602+ * "(note: VRR needs to be programmed after
603+ * TRANS_DDI_FUNC_CTL and before TRANS_CONF)."
604+ *
605+ * In practice it turns out that ICL can hang if
606+ * TRANS_VRR_VMAX/FLIPLINE are written before
607+ * enabling TRANS_DDI_FUNC_CTL.
608+ */
609+ drm_WARN_ON(display->drm,
610+ !(intel_de_read(display, TRANS_DDI_FUNC_CTL(display, cpu_transcoder)) & TRANS_DDI_FUNC_ENABLE));
611+
600612 /*
601613 * This bit seems to have two meanings depending on the platform:
602614 * TGL: generate VRR "safe window" for DSB vblank waits
@@ -939,6 +951,8 @@ void intel_vrr_transcoder_enable(const struct intel_crtc_state *crtc_state) · 336 unmodified lines
939951 {
940952 struct intel_display *display = to_intel_display(crtc_state);
941953
954+ intel_vrr_set_transcoder_timings(crtc_state);
955+
942956 if (!intel_vrr_possible(crtc_state))
943957 return;
944958
drivers/gpu/drm/i915/gem/i915_gem_shmem.c+9−3
@@ -153,8 +153,12 @@ int shmem_sg_alloc_table(struct drm_i915_private *i915, struct sg_table *st, · 152 unmodified lines
153153 }
154154 } while (1);
155155
156− nr_pages = min_t(unsigned long,
157− folio_nr_pages(folio), page_count - i);
156+ nr_pages = min_array(((unsigned long[]) {
157+ folio_nr_pages(folio),
158+ page_count - i,
159+ max_segment / PAGE_SIZE,
160+ }), 3);
161+
158162 if (!i ||
159163 sg->length >= max_segment ||
160164 folio_pfn(folio) != next_pfn) {
@@ -164,7 +168,9 @@ int shmem_sg_alloc_table(struct drm_i915_private *i915, struct sg_table *st, · 3 unmodified lines
164168 st->nents++;
165169 sg_set_folio(sg, folio, nr_pages * PAGE_SIZE, 0);
166170 } else {
167− /* XXX: could overflow? */
171+ nr_pages = min_t(unsigned long, nr_pages,
172+ (max_segment - sg->length) / PAGE_SIZE);
173+
168174 sg->length += nr_pages * PAGE_SIZE;
169175 }
170176 next_pfn = folio_pfn(folio) + nr_pages;
drivers/gpu/drm/imx/ipuv3/parallel-display.c+3−1
@@ -256,7 +256,9 @@ static int imx_pd_probe(struct platform_device *pdev) · 255 unmodified lines
256256
257257 platform_set_drvdata(pdev, imxpd);
258258
259− devm_drm_bridge_add(dev, &imxpd->bridge);
259+ ret = devm_drm_bridge_add(dev, &imxpd->bridge);
260+ if (ret)
261+ return ret;
260262
261263 return component_add(dev, &imx_pd_ops);
262264 }
drivers/gpu/drm/logicvc/logicvc_drm.c+2−2
@@ -92,7 +92,6 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc) · 91 unmodified lines
9292 struct device *dev = drm_dev->dev;
9393 struct device_node *of_node = dev->of_node;
9494 struct logicvc_drm_config *config = &logicvc->config;
95− struct device_node *layers_node;
9695 int ret;
9796
9897 logicvc_of_property_parse_bool(of_node, LOGICVC_OF_PROPERTY_DITHERING,
@@ -128,7 +127,8 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc) · 29 unmodified lines
128127 if (ret)
129128 return ret;
130129
131− layers_node = of_get_child_by_name(of_node, "layers");
130+ struct device_node *layers_node __free(device_node) =
131+ of_get_child_by_name(of_node, "layers");
132132 if (!layers_node) {
133133 drm_err(drm_dev, "Missing non-optional layers node\n");
134134 return -EINVAL;
drivers/gpu/drm/msm/adreno/a2xx_gpummu.c+1−1
@@ -78,7 +78,7 @@ static void a2xx_gpummu_destroy(struct msm_mmu *mmu) · 77 unmodified lines
7878 {
7979 struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu);
8080
81− dma_free_attrs(mmu->dev, TABLE_SIZE, gpummu->table, gpummu->pt_base,
81+ dma_free_attrs(mmu->dev, TABLE_SIZE + 32, gpummu->table, gpummu->pt_base,
8282 DMA_ATTR_FORCE_CONTIGUOUS);
8383
8484 kfree(gpummu);
drivers/gpu/drm/msm/adreno/a6xx_catalog.c+1−2
@@ -1759,7 +1759,7 @@ static const u32 x285_protect_regs[] = { · 1758 unmodified lines
17591759 A6XX_PROTECT_NORDWR(0x27c06, 0x0000),
17601760 };
17611761
1762−DECLARE_ADRENO_PROTECT(x285_protect, 64);
1762+DECLARE_ADRENO_PROTECT(x285_protect, 15);
17631763
17641764 static const struct adreno_reglist_pipe a840_nonctxt_regs[] = {
17651765 { REG_A8XX_CP_SMMU_STREAM_ID_LPAC, 0x00000101, BIT(PIPE_NONE) },
@@ -1966,5 +1966,4 @@ static inline __always_unused void __build_asserts(void) · 200 unmodified lines
19661966 BUILD_BUG_ON(a660_protect.count > a660_protect.count_max);
19671967 BUILD_BUG_ON(a690_protect.count > a690_protect.count_max);
19681968 BUILD_BUG_ON(a730_protect.count > a730_protect.count_max);
1969− BUILD_BUG_ON(a840_protect.count > a840_protect.count_max);
19701969 }
drivers/gpu/drm/msm/adreno/a8xx_gpu.c+12−2
@@ -310,11 +310,21 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu) · 309 unmodified lines
310310 hbb = cfg->highest_bank_bit - 13;
311311 hbb_hi = hbb >> 2;
312312 hbb_lo = hbb & 3;
313− a8xx_write_pipe(gpu, PIPE_BV, REG_A8XX_GRAS_NC_MODE_CNTL, hbb << 5);
314− a8xx_write_pipe(gpu, PIPE_BR, REG_A8XX_GRAS_NC_MODE_CNTL, hbb << 5);
313+
314+ a8xx_write_pipe(gpu, PIPE_BV, REG_A8XX_GRAS_NC_MODE_CNTL,
315+ hbb << 5 |
316+ level3_swizzling_dis << 4 |
317+ level2_swizzling_dis << 3);
318+
319+ a8xx_write_pipe(gpu, PIPE_BR, REG_A8XX_GRAS_NC_MODE_CNTL,
320+ hbb << 5 |
321+ level3_swizzling_dis << 4 |
322+ level2_swizzling_dis << 3);
315323
316324 a8xx_write_pipe(gpu, PIPE_BR, REG_A8XX_RB_CCU_NC_MODE_CNTL,
317325 yuvnotcomptofc << 6 |
326+ level3_swizzling_dis << 5 |
327+ level2_swizzling_dis << 4 |
318328 hbb_hi << 3 |
319329 hbb_lo << 1);
320330
drivers/gpu/drm/msm/adreno/adreno_device.c+1−0
@@ -302,6 +302,7 @@ static const struct of_device_id dt_match[] = { · 301 unmodified lines
302302 { .compatible = "qcom,kgsl-3d0" },
303303 {}
304304 };
305+MODULE_DEVICE_TABLE(of, dt_match);
305306
306307 static int adreno_runtime_resume(struct device *dev)
307308 {
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h+6−6
@@ -133,7 +133,7 @@ static const struct dpu_sspp_cfg sc8280xp_sspp[] = { · 132 unmodified lines
133133 static const struct dpu_lm_cfg sc8280xp_lm[] = {
134134 {
135135 .name = "lm_0", .id = LM_0,
136− .base = 0x44000, .len = 0x320,
136+ .base = 0x44000, .len = 0x400,
137137 .features = MIXER_MSM8998_MASK,
138138 .sblk = &sdm845_lm_sblk,
139139 .lm_pair = LM_1,
@@ -141,7 +141,7 @@ static const struct dpu_lm_cfg sc8280xp_lm[] = { · 1 unmodified line
141141 .dspp = DSPP_0,
142142 }, {
143143 .name = "lm_1", .id = LM_1,
144− .base = 0x45000, .len = 0x320,
144+ .base = 0x45000, .len = 0x400,
145145 .features = MIXER_MSM8998_MASK,
146146 .sblk = &sdm845_lm_sblk,
147147 .lm_pair = LM_0,
@@ -149,7 +149,7 @@ static const struct dpu_lm_cfg sc8280xp_lm[] = { · 1 unmodified line
149149 .dspp = DSPP_1,
150150 }, {
151151 .name = "lm_2", .id = LM_2,
152− .base = 0x46000, .len = 0x320,
152+ .base = 0x46000, .len = 0x400,
153153 .features = MIXER_MSM8998_MASK,
154154 .sblk = &sdm845_lm_sblk,
155155 .lm_pair = LM_3,
@@ -157,7 +157,7 @@ static const struct dpu_lm_cfg sc8280xp_lm[] = { · 1 unmodified line
157157 .dspp = DSPP_2,
158158 }, {
159159 .name = "lm_3", .id = LM_3,
160− .base = 0x47000, .len = 0x320,
160+ .base = 0x47000, .len = 0x400,
161161 .features = MIXER_MSM8998_MASK,
162162 .sblk = &sdm845_lm_sblk,
163163 .lm_pair = LM_2,
@@ -165,14 +165,14 @@ static const struct dpu_lm_cfg sc8280xp_lm[] = { · 1 unmodified line
165165 .dspp = DSPP_3,
166166 }, {
167167 .name = "lm_4", .id = LM_4,
168− .base = 0x48000, .len = 0x320,
168+ .base = 0x48000, .len = 0x400,
169169 .features = MIXER_MSM8998_MASK,
170170 .sblk = &sdm845_lm_sblk,
171171 .lm_pair = LM_5,
172172 .pingpong = PINGPONG_4,
173173 }, {
174174 .name = "lm_5", .id = LM_5,
175− .base = 0x49000, .len = 0x320,
175+ .base = 0x49000, .len = 0x400,
176176 .features = MIXER_MSM8998_MASK,
177177 .sblk = &sdm845_lm_sblk,
178178 .lm_pair = LM_4,
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h+6−6
@@ -134,7 +134,7 @@ static const struct dpu_sspp_cfg sm8450_sspp[] = { · 133 unmodified lines
134134 static const struct dpu_lm_cfg sm8450_lm[] = {
135135 {
136136 .name = "lm_0", .id = LM_0,
137− .base = 0x44000, .len = 0x320,
137+ .base = 0x44000, .len = 0x400,
138138 .features = MIXER_MSM8998_MASK,
139139 .sblk = &sdm845_lm_sblk,
140140 .lm_pair = LM_1,
@@ -142,7 +142,7 @@ static const struct dpu_lm_cfg sm8450_lm[] = { · 1 unmodified line
142142 .dspp = DSPP_0,
143143 }, {
144144 .name = "lm_1", .id = LM_1,
145− .base = 0x45000, .len = 0x320,
145+ .base = 0x45000, .len = 0x400,
146146 .features = MIXER_MSM8998_MASK,
147147 .sblk = &sdm845_lm_sblk,
148148 .lm_pair = LM_0,
@@ -150,7 +150,7 @@ static const struct dpu_lm_cfg sm8450_lm[] = { · 1 unmodified line
150150 .dspp = DSPP_1,
151151 }, {
152152 .name = "lm_2", .id = LM_2,
153− .base = 0x46000, .len = 0x320,
153+ .base = 0x46000, .len = 0x400,
154154 .features = MIXER_MSM8998_MASK,
155155 .sblk = &sdm845_lm_sblk,
156156 .lm_pair = LM_3,
@@ -158,7 +158,7 @@ static const struct dpu_lm_cfg sm8450_lm[] = { · 1 unmodified line
158158 .dspp = DSPP_2,
159159 }, {
160160 .name = "lm_3", .id = LM_3,
161− .base = 0x47000, .len = 0x320,
161+ .base = 0x47000, .len = 0x400,
162162 .features = MIXER_MSM8998_MASK,
163163 .sblk = &sdm845_lm_sblk,
164164 .lm_pair = LM_2,
@@ -166,14 +166,14 @@ static const struct dpu_lm_cfg sm8450_lm[] = { · 1 unmodified line
166166 .dspp = DSPP_3,
167167 }, {
168168 .name = "lm_4", .id = LM_4,
169− .base = 0x48000, .len = 0x320,
169+ .base = 0x48000, .len = 0x400,
170170 .features = MIXER_MSM8998_MASK,
171171 .sblk = &sdm845_lm_sblk,
172172 .lm_pair = LM_5,
173173 .pingpong = PINGPONG_4,
174174 }, {
175175 .name = "lm_5", .id = LM_5,
176− .base = 0x49000, .len = 0x320,
176+ .base = 0x49000, .len = 0x400,
177177 .features = MIXER_MSM8998_MASK,
178178 .sblk = &sdm845_lm_sblk,
179179 .lm_pair = LM_4,
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_4_sa8775p.h+2−2
@@ -366,8 +366,8 @@ static const struct dpu_intf_cfg sa8775p_intf[] = { · 365 unmodified lines
366366 .type = INTF_NONE,
367367 .controller_id = MSM_DP_CONTROLLER_0, /* pair with intf_0 for DP MST */
368368 .prog_fetch_lines_worst_case = 24,
369− .intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 17),
370− .intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 16),
369+ .intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 16),
370+ .intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 17),
371371 }, {
372372 .name = "intf_7", .id = INTF_7,
373373 .base = 0x3b000, .len = 0x280,
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h+6−6
@@ -131,7 +131,7 @@ static const struct dpu_sspp_cfg sm8550_sspp[] = { · 130 unmodified lines
131131 static const struct dpu_lm_cfg sm8550_lm[] = {
132132 {
133133 .name = "lm_0", .id = LM_0,
134− .base = 0x44000, .len = 0x320,
134+ .base = 0x44000, .len = 0x400,
135135 .features = MIXER_MSM8998_MASK,
136136 .sblk = &sdm845_lm_sblk,
137137 .lm_pair = LM_1,
@@ -139,7 +139,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = { · 1 unmodified line
139139 .dspp = DSPP_0,
140140 }, {
141141 .name = "lm_1", .id = LM_1,
142− .base = 0x45000, .len = 0x320,
142+ .base = 0x45000, .len = 0x400,
143143 .features = MIXER_MSM8998_MASK,
144144 .sblk = &sdm845_lm_sblk,
145145 .lm_pair = LM_0,
@@ -147,7 +147,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = { · 1 unmodified line
147147 .dspp = DSPP_1,
148148 }, {
149149 .name = "lm_2", .id = LM_2,
150− .base = 0x46000, .len = 0x320,
150+ .base = 0x46000, .len = 0x400,
151151 .features = MIXER_MSM8998_MASK,
152152 .sblk = &sdm845_lm_sblk,
153153 .lm_pair = LM_3,
@@ -155,7 +155,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = { · 1 unmodified line
155155 .dspp = DSPP_2,
156156 }, {
157157 .name = "lm_3", .id = LM_3,
158− .base = 0x47000, .len = 0x320,
158+ .base = 0x47000, .len = 0x400,
159159 .features = MIXER_MSM8998_MASK,
160160 .sblk = &sdm845_lm_sblk,
161161 .lm_pair = LM_2,
@@ -163,14 +163,14 @@ static const struct dpu_lm_cfg sm8550_lm[] = { · 1 unmodified line
163163 .dspp = DSPP_3,
164164 }, {
165165 .name = "lm_4", .id = LM_4,
166− .base = 0x48000, .len = 0x320,
166+ .base = 0x48000, .len = 0x400,
167167 .features = MIXER_MSM8998_MASK,
168168 .sblk = &sdm845_lm_sblk,
169169 .lm_pair = LM_5,
170170 .pingpong = PINGPONG_4,
171171 }, {
172172 .name = "lm_5", .id = LM_5,
173− .base = 0x49000, .len = 0x320,
173+ .base = 0x49000, .len = 0x400,
174174 .features = MIXER_MSM8998_MASK,
175175 .sblk = &sdm845_lm_sblk,
176176 .lm_pair = LM_4,
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_1_sar2130p.h+6−6
@@ -131,7 +131,7 @@ static const struct dpu_sspp_cfg sar2130p_sspp[] = { · 130 unmodified lines
131131 static const struct dpu_lm_cfg sar2130p_lm[] = {
132132 {
133133 .name = "lm_0", .id = LM_0,
134− .base = 0x44000, .len = 0x320,
134+ .base = 0x44000, .len = 0x400,
135135 .features = MIXER_MSM8998_MASK,
136136 .sblk = &sdm845_lm_sblk,
137137 .lm_pair = LM_1,
@@ -139,7 +139,7 @@ static const struct dpu_lm_cfg sar2130p_lm[] = { · 1 unmodified line
139139 .dspp = DSPP_0,
140140 }, {
141141 .name = "lm_1", .id = LM_1,
142− .base = 0x45000, .len = 0x320,
142+ .base = 0x45000, .len = 0x400,
143143 .features = MIXER_MSM8998_MASK,
144144 .sblk = &sdm845_lm_sblk,
145145 .lm_pair = LM_0,
@@ -147,7 +147,7 @@ static const struct dpu_lm_cfg sar2130p_lm[] = { · 1 unmodified line
147147 .dspp = DSPP_1,
148148 }, {
149149 .name = "lm_2", .id = LM_2,
150− .base = 0x46000, .len = 0x320,
150+ .base = 0x46000, .len = 0x400,
151151 .features = MIXER_MSM8998_MASK,
152152 .sblk = &sdm845_lm_sblk,
153153 .lm_pair = LM_3,
@@ -155,7 +155,7 @@ static const struct dpu_lm_cfg sar2130p_lm[] = { · 1 unmodified line
155155 .dspp = DSPP_2,
156156 }, {
157157 .name = "lm_3", .id = LM_3,
158− .base = 0x47000, .len = 0x320,
158+ .base = 0x47000, .len = 0x400,
159159 .features = MIXER_MSM8998_MASK,
160160 .sblk = &sdm845_lm_sblk,
161161 .lm_pair = LM_2,
@@ -163,14 +163,14 @@ static const struct dpu_lm_cfg sar2130p_lm[] = { · 1 unmodified line
163163 .dspp = DSPP_3,
164164 }, {
165165 .name = "lm_4", .id = LM_4,
166− .base = 0x48000, .len = 0x320,
166+ .base = 0x48000, .len = 0x400,
167167 .features = MIXER_MSM8998_MASK,
168168 .sblk = &sdm845_lm_sblk,
169169 .lm_pair = LM_5,
170170 .pingpong = PINGPONG_4,
171171 }, {
172172 .name = "lm_5", .id = LM_5,
173− .base = 0x49000, .len = 0x320,
173+ .base = 0x49000, .len = 0x400,
174174 .features = MIXER_MSM8998_MASK,
175175 .sblk = &sdm845_lm_sblk,
176176 .lm_pair = LM_4,
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_2_x1e80100.h+6−6
@@ -130,7 +130,7 @@ static const struct dpu_sspp_cfg x1e80100_sspp[] = { · 129 unmodified lines
130130 static const struct dpu_lm_cfg x1e80100_lm[] = {
131131 {
132132 .name = "lm_0", .id = LM_0,
133− .base = 0x44000, .len = 0x320,
133+ .base = 0x44000, .len = 0x400,
134134 .features = MIXER_MSM8998_MASK,
135135 .sblk = &sdm845_lm_sblk,
136136 .lm_pair = LM_1,
@@ -138,7 +138,7 @@ static const struct dpu_lm_cfg x1e80100_lm[] = { · 1 unmodified line
138138 .dspp = DSPP_0,
139139 }, {
140140 .name = "lm_1", .id = LM_1,
141− .base = 0x45000, .len = 0x320,
141+ .base = 0x45000, .len = 0x400,
142142 .features = MIXER_MSM8998_MASK,
143143 .sblk = &sdm845_lm_sblk,
144144 .lm_pair = LM_0,
@@ -146,7 +146,7 @@ static const struct dpu_lm_cfg x1e80100_lm[] = { · 1 unmodified line
146146 .dspp = DSPP_1,
147147 }, {
148148 .name = "lm_2", .id = LM_2,
149− .base = 0x46000, .len = 0x320,
149+ .base = 0x46000, .len = 0x400,
150150 .features = MIXER_MSM8998_MASK,
151151 .sblk = &sdm845_lm_sblk,
152152 .lm_pair = LM_3,
@@ -154,7 +154,7 @@ static const struct dpu_lm_cfg x1e80100_lm[] = { · 1 unmodified line
154154 .dspp = DSPP_2,
155155 }, {
156156 .name = "lm_3", .id = LM_3,
157− .base = 0x47000, .len = 0x320,
157+ .base = 0x47000, .len = 0x400,
158158 .features = MIXER_MSM8998_MASK,
159159 .sblk = &sdm845_lm_sblk,
160160 .lm_pair = LM_2,
@@ -162,14 +162,14 @@ static const struct dpu_lm_cfg x1e80100_lm[] = { · 1 unmodified line
162162 .dspp = DSPP_3,
163163 }, {
164164 .name = "lm_4", .id = LM_4,
165− .base = 0x48000, .len = 0x320,
165+ .base = 0x48000, .len = 0x400,
166166 .features = MIXER_MSM8998_MASK,
167167 .sblk = &sdm845_lm_sblk,
168168 .lm_pair = LM_5,
169169 .pingpong = PINGPONG_4,
170170 }, {
171171 .name = "lm_5", .id = LM_5,
172− .base = 0x49000, .len = 0x320,
172+ .base = 0x49000, .len = 0x400,
173173 .features = MIXER_MSM8998_MASK,
174174 .sblk = &sdm845_lm_sblk,
175175 .lm_pair = LM_4,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c+1−1
@@ -89,7 +89,7 @@ static void dpu_setup_dspp_gc(struct dpu_hw_dspp *ctx, · 88 unmodified lines
8989 base = ctx->cap->sblk->gc.base;
9090
9191 if (!base) {
92− DRM_ERROR("invalid ctx %pK gc base\n", ctx);
92+ DRM_ERROR("invalid ctx %p gc base\n", ctx);
9393 return;
9494 }
9595
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c+3−1
@@ -156,11 +156,13 @@ static void dpu_hw_sspp_setup_pe_config_v13(struct dpu_hw_sspp *ctx, · 155 unmodified lines
156156 u8 color;
157157 u32 lr_pe[4], tb_pe[4];
158158 const u32 bytemask = 0xff;
159− u32 offset = ctx->cap->sblk->sspp_rec0_blk.base;
159+ u32 offset;
160160
161161 if (!ctx || !pe_ext)
162162 return;
163163
164+ offset = ctx->cap->sblk->sspp_rec0_blk.base;
165+
164166 c = &ctx->hw;
165167 /* program SW pixel extension override for all pipes*/
166168 for (color = 0; color < DPU_MAX_PLANES; color++) {
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c+14−38
@@ -350,26 +350,28 @@ static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm, · 349 unmodified lines
350350 return true;
351351 }
352352
353−static bool dpu_rm_find_lms(struct dpu_rm *rm,
354− struct dpu_global_state *global_state,
355− uint32_t crtc_id, bool skip_dspp,
356− struct msm_display_topology *topology,
357− int *lm_idx, int *pp_idx, int *dspp_idx)
353+static int _dpu_rm_reserve_lms(struct dpu_rm *rm,
354+ struct dpu_global_state *global_state,
355+ uint32_t crtc_id,
356+ struct msm_display_topology *topology)
358357
359358 {
359+ int lm_idx[MAX_BLOCKS];
360+ int pp_idx[MAX_BLOCKS];
361+ int dspp_idx[MAX_BLOCKS] = {0};
360362 int i, lm_count = 0;
361363
364+ if (!topology->num_lm) {
365+ DPU_ERROR("zero LMs in topology\n");
366+ return -EINVAL;
367+ }
368+
362369 /* Find a primary mixer */
363370 for (i = 0; i < ARRAY_SIZE(rm->mixer_blks) &&
364371 lm_count < topology->num_lm; i++) {
365372 if (!rm->mixer_blks[i])
366373 continue;
367374
368− if (skip_dspp && to_dpu_hw_mixer(rm->mixer_blks[i])->cap->dspp) {
369− DPU_DEBUG("Skipping LM_%d, skipping LMs with DSPPs\n", i);
370− continue;
371− }
372−
373375 /*
374376 * Reset lm_count to an even index. This will drop the previous
375377 * primary mixer if failed to find its peer.
@@ -408,38 +410,12 @@ static bool dpu_rm_find_lms(struct dpu_rm *rm, · 32 unmodified lines
408410 }
409411 }
410412
411− return lm_count == topology->num_lm;
412−}
413−
414−static int _dpu_rm_reserve_lms(struct dpu_rm *rm,
415− struct dpu_global_state *global_state,
416− uint32_t crtc_id,
417− struct msm_display_topology *topology)
418−
419−{
420− int lm_idx[MAX_BLOCKS];
421− int pp_idx[MAX_BLOCKS];
422− int dspp_idx[MAX_BLOCKS] = {0};
423− int i;
424− bool found;
425−
426− if (!topology->num_lm) {
427− DPU_ERROR("zero LMs in topology\n");
428− return -EINVAL;
429− }
430−
431− /* Try using non-DSPP LM blocks first */
432− found = dpu_rm_find_lms(rm, global_state, crtc_id, !topology->num_dspp,
433− topology, lm_idx, pp_idx, dspp_idx);
434− if (!found && !topology->num_dspp)
435− found = dpu_rm_find_lms(rm, global_state, crtc_id, false,
436− topology, lm_idx, pp_idx, dspp_idx);
437− if (!found) {
413+ if (lm_count != topology->num_lm) {
438414 DPU_DEBUG("unable to find appropriate mixers\n");
439415 return -ENAVAIL;
440416 }
441417
442− for (i = 0; i < topology->num_lm; i++) {
418+ for (i = 0; i < lm_count; i++) {
443419 global_state->mixer_to_crtc_id[lm_idx[i]] = crtc_id;
444420 global_state->pingpong_to_crtc_id[pp_idx[i]] = crtc_id;
445421 global_state->dspp_to_crtc_id[dspp_idx[i]] =
drivers/gpu/drm/msm/dsi/dsi_host.c+31−12
@@ -584,13 +584,30 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host) · 583 unmodified lines
584584 * FIXME: Reconsider this if/when CMD mode handling is rewritten to use
585585 * transfer time and data overhead as a starting point of the calculations.
586586 */
587−static unsigned long dsi_adjust_pclk_for_compression(const struct drm_display_mode *mode,
588− const struct drm_dsc_config *dsc)
587+static unsigned long
588+dsi_adjust_pclk_for_compression(const struct drm_display_mode *mode,
589+ const struct drm_dsc_config *dsc,
590+ bool is_bonded_dsi)
589591 {
590− int new_hdisplay = DIV_ROUND_UP(mode->hdisplay * drm_dsc_get_bpp_int(dsc),
591− dsc->bits_per_component * 3);
592+ int hdisplay, new_hdisplay, new_htotal;
592593
593− int new_htotal = mode->htotal - mode->hdisplay + new_hdisplay;
594+ /*
595+ * For bonded DSI, split hdisplay across two links and round up each
596+ * half separately, passing the full hdisplay would only round up once.
597+ * This also aligns with the hdisplay we program later in
598+ * dsi_timing_setup()
599+ */
600+ hdisplay = mode->hdisplay;
601+ if (is_bonded_dsi)
602+ hdisplay /= 2;
603+
604+ new_hdisplay = DIV_ROUND_UP(hdisplay * drm_dsc_get_bpp_int(dsc),
605+ dsc->bits_per_component * 3);
606+
607+ if (is_bonded_dsi)
608+ new_hdisplay *= 2;
609+
610+ new_htotal = mode->htotal - mode->hdisplay + new_hdisplay;
594611
595612 return mult_frac(mode->clock * 1000u, new_htotal, mode->htotal);
596613 }
@@ -603,7 +620,7 @@ static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, · 6 unmodified lines
603620 pclk_rate = mode->clock * 1000u;
604621
605622 if (dsc)
606− pclk_rate = dsi_adjust_pclk_for_compression(mode, dsc);
623+ pclk_rate = dsi_adjust_pclk_for_compression(mode, dsc, is_bonded_dsi);
607624
608625 /*
609626 * For bonded DSI mode, the current DRM mode has the complete width of the
@@ -993,7 +1010,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) · 383 unmodified lines
9931010
9941011 if (msm_host->dsc) {
9951012 struct drm_dsc_config *dsc = msm_host->dsc;
996− u32 bytes_per_pclk;
1013+ u32 bits_per_pclk;
9971014
9981015 /* update dsc params with timing params */
9991016 if (!dsc || !mode->hdisplay || !mode->vdisplay) {
@@ -1015,7 +1032,9 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) · 15 unmodified lines
10151032
10161033 /*
10171034 * DPU sends 3 bytes per pclk cycle to DSI. If widebus is
1018− * enabled, bus width is extended to 6 bytes.
1035+ * enabled, MDP always sends out 48-bit compressed data per
1036+ * pclk and on average, DSI consumes an amount of compressed
1037+ * data equivalent to the uncompressed pixel depth per pclk.
10191038 *
10201039 * Calculate the number of pclks needed to transmit one line of
10211040 * the compressed data.
@@ -1027,12 +1046,12 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) · 5 unmodified lines
10271046 * unused anyway.
10281047 */
10291048 h_total -= hdisplay;
1030− if (wide_bus_enabled && !(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO))
1031− bytes_per_pclk = 6;
1049+ if (wide_bus_enabled)
1050+ bits_per_pclk = mipi_dsi_pixel_format_to_bpp(msm_host->format);
10321051 else
1033− bytes_per_pclk = 3;
1052+ bits_per_pclk = 24;
10341053
1035− hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc), bytes_per_pclk);
1054+ hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc) * 8, bits_per_pclk);
10361055
10371056 h_total += hdisplay;
10381057 ha_end = ha_start + hdisplay;
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c+11−11
@@ -51,8 +51,8 @@ · 50 unmodified lines
5151 #define DSI_PHY_7NM_QUIRK_V4_3 BIT(3)
5252 /* Hardware is V5.2 */
5353 #define DSI_PHY_7NM_QUIRK_V5_2 BIT(4)
54−/* Hardware is V7.0 */
55−#define DSI_PHY_7NM_QUIRK_V7_0 BIT(5)
54+/* Hardware is V7.2 */
55+#define DSI_PHY_7NM_QUIRK_V7_2 BIT(5)
5656
5757 struct dsi_pll_config {
5858 bool enable_ssc;
@@ -143,7 +143,7 @@ static void dsi_pll_calc_dec_frac(struct dsi_pll_7nm *pll, struct dsi_pll_config · 84 unmodified lines
143143
144144 if (pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_PRE_V4_1) {
145145 config->pll_clock_inverters = 0x28;
146− } else if ((pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0)) {
146+ } else if ((pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)) {
147147 if (pll_freq < 163000000ULL)
148148 config->pll_clock_inverters = 0xa0;
149149 else if (pll_freq < 175000000ULL)
@@ -284,7 +284,7 @@ static void dsi_pll_config_hzindep_reg(struct dsi_pll_7nm *pll) · 134 unmodified lines
284284 }
285285
286286 if ((pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V5_2) ||
287− (pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0)) {
287+ (pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)) {
288288 if (pll->vco_current_rate < 1557000000ULL)
289289 vco_config_1 = 0x08;
290290 else
@@ -699,7 +699,7 @@ static int dsi_7nm_set_usecase(struct msm_dsi_phy *phy) · 408 unmodified lines
699699 case MSM_DSI_PHY_MASTER:
700700 pll_7nm->slave = pll_7nm_list[(pll_7nm->phy->id + 1) % DSI_MAX];
701701 /* v7.0: Enable ATB_EN0 and alternate clock output to external phy */
702− if (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0)
702+ if (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)
703703 writel(0x07, base + REG_DSI_7nm_PHY_CMN_CTRL_5);
704704 break;
705705 case MSM_DSI_PHY_SLAVE:
@@ -987,7 +987,7 @@ static int dsi_7nm_phy_enable(struct msm_dsi_phy *phy, · 281 unmodified lines
987987 /* Request for REFGEN READY */
988988 if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V4_3) ||
989989 (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V5_2) ||
990− (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0)) {
990+ (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)) {
991991 writel(0x1, phy->base + REG_DSI_7nm_PHY_CMN_GLBL_DIGTOP_SPARE10);
992992 udelay(500);
993993 }
@@ -1021,7 +1021,7 @@ static int dsi_7nm_phy_enable(struct msm_dsi_phy *phy, · 27 unmodified lines
10211021 lane_ctrl0 = 0x1f;
10221022 }
10231023
1024− if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0)) {
1024+ if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)) {
10251025 if (phy->cphy_mode) {
10261026 /* TODO: different for second phy */
10271027 vreg_ctrl_0 = 0x57;
@@ -1097,7 +1097,7 @@ static int dsi_7nm_phy_enable(struct msm_dsi_phy *phy, · 69 unmodified lines
10971097
10981098 /* program CMN_CTRL_4 for minor_ver 2 chipsets*/
10991099 if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V5_2) ||
1100− (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0) ||
1100+ (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2) ||
11011101 (readl(base + REG_DSI_7nm_PHY_CMN_REVISION_ID0) & (0xf0)) == 0x20)
11021102 writel(0x04, base + REG_DSI_7nm_PHY_CMN_CTRL_4);
11031103
@@ -1213,7 +1213,7 @@ static void dsi_7nm_phy_disable(struct msm_dsi_phy *phy) · 109 unmodified lines
12131213 /* Turn off REFGEN Vote */
12141214 if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V4_3) ||
12151215 (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V5_2) ||
1216− (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_0)) {
1216+ (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)) {
12171217 writel(0x0, base + REG_DSI_7nm_PHY_CMN_GLBL_DIGTOP_SPARE10);
12181218 wmb();
12191219 /* Delay to ensure HW removes vote before PHY shut down */
@@ -1502,7 +1502,7 @@ const struct msm_dsi_phy_cfg dsi_phy_3nm_8750_cfgs = { · 282 unmodified lines
15021502 #endif
15031503 .io_start = { 0xae95000, 0xae97000 },
15041504 .num_dsi_phy = 2,
1505− .quirks = DSI_PHY_7NM_QUIRK_V7_0,
1505+ .quirks = DSI_PHY_7NM_QUIRK_V7_2,
15061506 };
15071507
15081508 const struct msm_dsi_phy_cfg dsi_phy_3nm_kaanapali_cfgs = {
@@ -1525,5 +1525,5 @@ const struct msm_dsi_phy_cfg dsi_phy_3nm_kaanapali_cfgs = { · 16 unmodified lines
15251525 #endif
15261526 .io_start = { 0x9ac1000, 0x9ac4000 },
15271527 .num_dsi_phy = 2,
1528− .quirks = DSI_PHY_7NM_QUIRK_V7_0,
1528+ .quirks = DSI_PHY_7NM_QUIRK_V7_2,
15291529 };
drivers/gpu/drm/nouveau/nouveau_connector.c+3−0
@@ -1230,6 +1230,9 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg) · 1229 unmodified lines
12301230 u8 size = msg->size;
12311231 int ret;
12321232
1233+ if (pm_runtime_suspended(nv_connector->base.dev->dev))
1234+ return -EBUSY;
1235+
12331236 nv_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP);
12341237 if (!nv_encoder)
12351238 return -ENODEV;
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c+6−6
@@ -737,8 +737,8 @@ r535_gsp_acpi_caps(acpi_handle handle, CAPS_METHOD_DATA *caps) · 736 unmodified lines
737737 if (!obj)
738738 goto done;
739739
740− if (WARN_ON(obj->type != ACPI_TYPE_BUFFER) ||
741− WARN_ON(obj->buffer.length != 4))
740+ if (obj->type != ACPI_TYPE_BUFFER ||
741+ obj->buffer.length != 4)
742742 goto done;
743743
744744 caps->status = 0;
@@ -773,8 +773,8 @@ r535_gsp_acpi_jt(acpi_handle handle, JT_METHOD_DATA *jt) · 28 unmodified lines
773773 if (!obj)
774774 goto done;
775775
776− if (WARN_ON(obj->type != ACPI_TYPE_BUFFER) ||
777− WARN_ON(obj->buffer.length != 4))
776+ if (obj->type != ACPI_TYPE_BUFFER ||
777+ obj->buffer.length != 4)
778778 goto done;
779779
780780 jt->status = 0;
@@ -861,8 +861,8 @@ r535_gsp_acpi_dod(acpi_handle handle, DOD_METHOD_DATA *dod) · 80 unmodified lines
861861
862862 _DOD = output.pointer;
863863
864− if (WARN_ON(_DOD->type != ACPI_TYPE_PACKAGE) ||
865− WARN_ON(_DOD->package.count > ARRAY_SIZE(dod->acpiIdList)))
864+ if (_DOD->type != ACPI_TYPE_PACKAGE ||
865+ _DOD->package.count > ARRAY_SIZE(dod->acpiIdList))
866866 return;
867867
868868 for (int i = 0; i < _DOD->package.count; i++) {
drivers/gpu/drm/panthor/panthor_sched.c+5−4
@@ -893,14 +893,15 @@ panthor_queue_get_syncwait_obj(struct panthor_group *group, struct panthor_queue · 892 unmodified lines
893893
894894 out_sync:
895895 /* Make sure the CPU caches are invalidated before the seqno is read.
896− * drm_gem_shmem_sync() is a NOP if map_wc=true, so no need to check
896+ * panthor_gem_sync() is a NOP if map_wc=true, so no need to check
897897 * it here.
898898 */
899− panthor_gem_sync(&bo->base.base, queue->syncwait.offset,
899+ panthor_gem_sync(&bo->base.base,
900+ DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH_AND_INVALIDATE,
901+ queue->syncwait.offset,
900902 queue->syncwait.sync64 ?
901903 sizeof(struct panthor_syncobj_64b) :
902− sizeof(struct panthor_syncobj_32b),
903− DRM_PANTHOR_BO_SYNC_CPU_CACHE_FLUSH_AND_INVALIDATE);
904+ sizeof(struct panthor_syncobj_32b));
904905
905906 return queue->syncwait.kmap + queue->syncwait.offset;
906907
drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c+15−1
@@ -1122,6 +1122,7 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host, · 1121 unmodified lines
11221122 struct mipi_dsi_device *device)
11231123 {
11241124 struct rzg2l_mipi_dsi *dsi = host_to_rzg2l_mipi_dsi(host);
1125+ int bpp;
11251126 int ret;
11261127
11271128 if (device->lanes > dsi->num_data_lanes) {
@@ -1131,7 +1132,8 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host, · 3 unmodified lines
11311132 return -EINVAL;
11321133 }
11331134
1134− switch (mipi_dsi_pixel_format_to_bpp(device->format)) {
1135+ bpp = mipi_dsi_pixel_format_to_bpp(device->format);
1136+ switch (bpp) {
11351137 case 24:
11361138 break;
11371139 case 18:
@@ -1162,6 +1164,18 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host, · 24 unmodified lines
11621164
11631165 drm_bridge_add(&dsi->bridge);
11641166
1167+ /*
1168+ * Report the required division ratio setting for the MIPI clock dividers.
1169+ *
1170+ * vclk * bpp = hsclk * 8 * num_lanes
1171+ *
1172+ * vclk * DSI_AB_divider = hsclk * 16
1173+ *
1174+ * which simplifies to...
1175+ * DSI_AB_divider = bpp * 2 / num_lanes
1176+ */
1177+ rzg2l_cpg_dsi_div_set_divider(bpp * 2 / dsi->lanes, PLL5_TARGET_DSI);
1178+
11651179 return 0;
11661180 }
11671181
drivers/gpu/drm/scheduler/sched_main.c+1−0
@@ -361,6 +361,7 @@ static void drm_sched_run_free_queue(struct drm_gpu_scheduler *sched) · 360 unmodified lines
361361 /**
362362 * drm_sched_job_done - complete a job
363363 * @s_job: pointer to the job which is done
364+ * @result: 0 on success, -ERRNO on error
364365 *
365366 * Finish the job's fence and resubmit the work items.
366367 */
drivers/gpu/drm/sitronix/st7586.c+6−9
@@ -347,6 +347,12 @@ static int st7586_probe(struct spi_device *spi) · 346 unmodified lines
347347 if (ret)
348348 return ret;
349349
350+ /*
351+ * Override value set by mipi_dbi_spi_init(). This driver is a bit
352+ * non-standard, so best to set it explicitly here.
353+ */
354+ dbi->write_memory_bpw = 8;
355+
350356 /* Cannot read from this controller via SPI */
351357 dbi->read_commands = NULL;
352358
@@ -356,15 +362,6 @@ static int st7586_probe(struct spi_device *spi) · 3 unmodified lines
356362 if (ret)
357363 return ret;
358364
359− /*
360− * we are using 8-bit data, so we are not actually swapping anything,
361− * but setting mipi->swap_bytes makes mipi_dbi_typec3_command() do the
362− * right thing and not use 16-bit transfers (which results in swapped
363− * bytes on little-endian systems and causes out of order data to be
364− * sent to the display).
365− */
366− dbi->swap_bytes = true;
367−
368365 drm_mode_config_reset(drm);
369366
370367 ret = drm_dev_register(drm, 0);
drivers/gpu/drm/solomon/ssd130x.c+2−4
@@ -737,6 +737,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x, · 736 unmodified lines
737737 unsigned int height = drm_rect_height(rect);
738738 unsigned int line_length = DIV_ROUND_UP(width, 8);
739739 unsigned int page_height = SSD130X_PAGE_HEIGHT;
740+ u8 page_start = ssd130x->page_offset + y / page_height;
740741 unsigned int pages = DIV_ROUND_UP(height, page_height);
741742 struct drm_device *drm = &ssd130x->drm;
742743 u32 array_idx = 0;
@@ -774,14 +775,11 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x, · 31 unmodified lines
774775 */
775776
776777 if (!ssd130x->page_address_mode) {
777− u8 page_start;
778−
779778 /* Set address range for horizontal addressing mode */
780779 ret = ssd130x_set_col_range(ssd130x, ssd130x->col_offset + x, width);
781780 if (ret < 0)
782781 return ret;
783782
784− page_start = ssd130x->page_offset + y / page_height;
785783 ret = ssd130x_set_page_range(ssd130x, page_start, pages);
786784 if (ret < 0)
787785 return ret;
@@ -813,7 +811,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x, · 25 unmodified lines
813811 */
814812 if (ssd130x->page_address_mode) {
815813 ret = ssd130x_set_page_pos(ssd130x,
816− ssd130x->page_offset + i,
814+ page_start + i,
817815 ssd130x->col_offset + x);
818816 if (ret < 0)
819817 return ret;
drivers/gpu/drm/tiny/sharp-memory.c+2−2
@@ -541,8 +541,8 @@ static int sharp_memory_probe(struct spi_device *spi) · 540 unmodified lines
541541
542542 smd = devm_drm_dev_alloc(dev, &sharp_memory_drm_driver,
543543 struct sharp_memory_device, drm);
544− if (!smd)
545− return -ENOMEM;
544+ if (IS_ERR(smd))
545+ return PTR_ERR(smd);
546546
547547 spi_set_drvdata(spi, smd);
548548
drivers/gpu/drm/ttm/tests/ttm_bo_test.c+2−2
@@ -222,13 +222,13 @@ static void ttm_bo_reserve_interrupted(struct kunit *test) · 221 unmodified lines
222222 KUNIT_FAIL(test, "Couldn't create ttm bo reserve task\n");
223223
224224 /* Take a lock so the threaded reserve has to wait */
225− mutex_lock(&bo->base.resv->lock.base);
225+ dma_resv_lock(bo->base.resv, NULL);
226226
227227 wake_up_process(task);
228228 msleep(20);
229229 err = kthread_stop(task);
230230
231− mutex_unlock(&bo->base.resv->lock.base);
231+ dma_resv_unlock(bo->base.resv);
232232
233233 KUNIT_ASSERT_EQ(test, err, -ERESTARTSYS);
234234 }
drivers/gpu/drm/ttm/ttm_bo.c+5−6
@@ -1107,8 +1107,7 @@ struct ttm_bo_swapout_walk { · 1106 unmodified lines
11071107 static s64
11081108 ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo)
11091109 {
1110− struct ttm_resource *res = bo->resource;
1111− struct ttm_place place = { .mem_type = res->mem_type };
1110+ struct ttm_place place = { .mem_type = bo->resource->mem_type };
11121111 struct ttm_bo_swapout_walk *swapout_walk =
11131112 container_of(walk, typeof(*swapout_walk), walk);
11141113 struct ttm_operation_ctx *ctx = walk->arg.ctx;
@@ -1148,7 +1147,7 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo) · 33 unmodified lines
11481147 /*
11491148 * Move to system cached
11501149 */
1151− if (res->mem_type != TTM_PL_SYSTEM) {
1150+ if (bo->resource->mem_type != TTM_PL_SYSTEM) {
11521151 struct ttm_resource *evict_mem;
11531152 struct ttm_place hop;
11541153
@@ -1180,15 +1179,15 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo) · 25 unmodified lines
11801179
11811180 if (ttm_tt_is_populated(tt)) {
11821181 spin_lock(&bdev->lru_lock);
1183− ttm_resource_del_bulk_move(res, bo);
1182+ ttm_resource_del_bulk_move(bo->resource, bo);
11841183 spin_unlock(&bdev->lru_lock);
11851184
11861185 ret = ttm_tt_swapout(bdev, tt, swapout_walk->gfp_flags);
11871186
11881187 spin_lock(&bdev->lru_lock);
11891188 if (ret)
1190− ttm_resource_add_bulk_move(res, bo);
1191− ttm_resource_move_to_lru_tail(res);
1189+ ttm_resource_add_bulk_move(bo->resource, bo);
1190+ ttm_resource_move_to_lru_tail(bo->resource);
11921191 spin_unlock(&bdev->lru_lock);
11931192 }
11941193
drivers/gpu/drm/ttm/ttm_pool_internal.h+1−1
@@ -17,7 +17,7 @@ static inline bool ttm_pool_uses_dma32(struct ttm_pool *pool) · 16 unmodified lines
1717 return pool->alloc_flags & TTM_ALLOCATION_POOL_USE_DMA32;
1818 }
1919
20−static inline bool ttm_pool_beneficial_order(struct ttm_pool *pool)
20+static inline unsigned int ttm_pool_beneficial_order(struct ttm_pool *pool)
2121 {
2222 return pool->alloc_flags & 0xff;
2323 }
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c+4−0
@@ -105,6 +105,7 @@ struct vmw_cmdbuf_context { · 104 unmodified lines
105105 * @handle: DMA address handle for the command buffer space if @using_mob is
106106 * false. Immutable.
107107 * @size: The size of the command buffer space. Immutable.
108+ * @id: Monotonically increasing ID of the last cmdbuf submitted.
108109 * @num_contexts: Number of contexts actually enabled.
109110 */
110111 struct vmw_cmdbuf_man {
@@ -132,6 +133,7 @@ struct vmw_cmdbuf_man { · 21 unmodified lines
132133 bool has_pool;
133134 dma_addr_t handle;
134135 size_t size;
136+ u64 id;
135137 u32 num_contexts;
136138 };
137139
@@ -303,6 +305,8 @@ static int vmw_cmdbuf_header_submit(struct vmw_cmdbuf_header *header) · 165 unmodified lines
303305 struct vmw_cmdbuf_man *man = header->man;
304306 u32 val;
305307
308+ header->cb_header->id = man->id++;
309+
306310 val = upper_32_bits(header->handle);
307311 vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, val);
308312
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c+2−2
@@ -1143,7 +1143,7 @@ static int vmw_translate_mob_ptr(struct vmw_private *dev_priv, · 1142 unmodified lines
11431143 ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo);
11441144 if (ret != 0) {
11451145 drm_dbg(&dev_priv->drm, "Could not find or use MOB buffer.\n");
1146− return PTR_ERR(vmw_bo);
1146+ return ret;
11471147 }
11481148 vmw_bo_placement_set(vmw_bo, VMW_BO_DOMAIN_MOB, VMW_BO_DOMAIN_MOB);
11491149 ret = vmw_validation_add_bo(sw_context->ctx, vmw_bo);
@@ -1199,7 +1199,7 @@ static int vmw_translate_guest_ptr(struct vmw_private *dev_priv, · 49 unmodified lines
11991199 ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo);
12001200 if (ret != 0) {
12011201 drm_dbg(&dev_priv->drm, "Could not find or use GMR region.\n");
1202− return PTR_ERR(vmw_bo);
1202+ return ret;
12031203 }
12041204 vmw_bo_placement_set(vmw_bo, VMW_BO_DOMAIN_GMR | VMW_BO_DOMAIN_VRAM,
12051205 VMW_BO_DOMAIN_GMR | VMW_BO_DOMAIN_VRAM);
drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c+8−1
@@ -260,6 +260,13 @@ out_no_dirty: · 259 unmodified lines
260260 return ret;
261261 }
262262
263+static void vmw_bo_dirty_free(struct kref *kref)
264+{
265+ struct vmw_bo_dirty *dirty = container_of(kref, struct vmw_bo_dirty, ref_count);
266+
267+ kvfree(dirty);
268+}
269+
263270 /**
264271 * vmw_bo_dirty_release - Release a dirty-tracking user from a buffer object
265272 * @vbo: The buffer object
@@ -274,7 +281,7 @@ void vmw_bo_dirty_release(struct vmw_bo *vbo) · 8 unmodified lines
274281 {
275282 struct vmw_bo_dirty *dirty = vbo->dirty;
276283
277− if (dirty && kref_put(&dirty->ref_count, (void *)kvfree))
284+ if (dirty && kref_put(&dirty->ref_count, vmw_bo_dirty_free))
278285 vbo->dirty = NULL;
279286 }
280287
drivers/gpu/drm/xe/regs/xe_engine_regs.h+6−0
@@ -96,6 +96,12 @@ · 95 unmodified lines
9696 #define ENABLE_SEMAPHORE_POLL_BIT REG_BIT(13)
9797
9898 #define RING_CMD_CCTL(base) XE_REG((base) + 0xc4, XE_REG_OPTION_MASKED)
99+
100+#define CS_MMIO_GROUP_INSTANCE_SELECT(base) XE_REG((base) + 0xcc)
101+#define SELECTIVE_READ_ADDRESSING REG_BIT(30)
102+#define SELECTIVE_READ_GROUP REG_GENMASK(29, 23)
103+#define SELECTIVE_READ_INSTANCE REG_GENMASK(22, 16)
104+
99105 /*
100106 * CMD_CCTL read/write fields take a MOCS value and _not_ a table index.
101107 * The lsb of each can be considered a separate enabling bit for encryption.
drivers/gpu/drm/xe/xe_configfs.c+1−0
@@ -830,6 +830,7 @@ static void xe_config_device_release(struct config_item *item) · 829 unmodified lines
830830
831831 mutex_destroy(&dev->lock);
832832
833+ kfree(dev->config.ctx_restore_mid_bb[0].cs);
833834 kfree(dev->config.ctx_restore_post_bb[0].cs);
834835 kfree(dev);
835836 }
drivers/gpu/drm/xe/xe_exec_queue.c+11−12
@@ -266,6 +266,16 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe, · 265 unmodified lines
266266 return q;
267267 }
268268
269+static void __xe_exec_queue_fini(struct xe_exec_queue *q)
270+{
271+ int i;
272+
273+ q->ops->fini(q);
274+
275+ for (i = 0; i < q->width; ++i)
276+ xe_lrc_put(q->lrc[i]);
277+}
278+
269279 static int __xe_exec_queue_init(struct xe_exec_queue *q, u32 exec_queue_flags)
270280 {
271281 int i, err;
@@ -320,21 +330,10 @@ static int __xe_exec_queue_init(struct xe_exec_queue *q, u32 exec_queue_flags) · 48 unmodified lines
320330 return 0;
321331
322332 err_lrc:
323− for (i = i - 1; i >= 0; --i)
324− xe_lrc_put(q->lrc[i]);
333+ __xe_exec_queue_fini(q);
325334 return err;
326335 }
327336
328−static void __xe_exec_queue_fini(struct xe_exec_queue *q)
329−{
330− int i;
331−
332− q->ops->fini(q);
333−
334− for (i = 0; i < q->width; ++i)
335− xe_lrc_put(q->lrc[i]);
336−}
337−
338337 struct xe_exec_queue *xe_exec_queue_create(struct xe_device *xe, struct xe_vm *vm,
339338 u32 logical_mask, u16 width,
340339 struct xe_hw_engine *hwe, u32 flags,
drivers/gpu/drm/xe/xe_gsc_proxy.c+35−8
@@ -435,15 +435,11 @@ static int proxy_channel_alloc(struct xe_gsc *gsc) · 434 unmodified lines
435435 return 0;
436436 }
437437
438−static void xe_gsc_proxy_remove(void *arg)
438+static void xe_gsc_proxy_stop(struct xe_gsc *gsc)
439439 {
440− struct xe_gsc *gsc = arg;
441440 struct xe_gt *gt = gsc_to_gt(gsc);
442441 struct xe_device *xe = gt_to_xe(gt);
443442
444− if (!gsc->proxy.component_added)
445− return;
446−
447443 /* disable HECI2 IRQs */
448444 scoped_guard(xe_pm_runtime, xe) {
449445 CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GSC);
@@ -455,6 +451,30 @@ static void xe_gsc_proxy_remove(void *arg) · 5 unmodified lines
455451 }
456452
457453 xe_gsc_wait_for_worker_completion(gsc);
454+ gsc->proxy.started = false;
455+}
456+
457+static void xe_gsc_proxy_remove(void *arg)
458+{
459+ struct xe_gsc *gsc = arg;
460+ struct xe_gt *gt = gsc_to_gt(gsc);
461+ struct xe_device *xe = gt_to_xe(gt);
462+
463+ if (!gsc->proxy.component_added)
464+ return;
465+
466+ /*
467+ * GSC proxy start is an async process that can be ongoing during
468+ * Xe module load/unload. Using devm managed action to register
469+ * xe_gsc_proxy_stop could cause issues if Xe module unload has
470+ * already started when the action is registered, potentially leading
471+ * to the cleanup being called at the wrong time. Therefore, instead
472+ * of registering a separate devm action to undo what is done in
473+ * proxy start, we call it from here, but only if the start has
474+ * completed successfully (tracked with the 'started' flag).
475+ */
476+ if (gsc->proxy.started)
477+ xe_gsc_proxy_stop(gsc);
458478
459479 component_del(xe->drm.dev, &xe_gsc_proxy_component_ops);
460480 gsc->proxy.component_added = false;
@@ -510,6 +530,7 @@ int xe_gsc_proxy_init(struct xe_gsc *gsc) · 49 unmodified lines
510530 */
511531 int xe_gsc_proxy_start(struct xe_gsc *gsc)
512532 {
533+ struct xe_gt *gt = gsc_to_gt(gsc);
513534 int err;
514535
515536 /* enable the proxy interrupt in the GSC shim layer */
@@ -521,12 +542,18 @@ int xe_gsc_proxy_start(struct xe_gsc *gsc) · 5 unmodified lines
521542 */
522543 err = xe_gsc_proxy_request_handler(gsc);
523544 if (err)
524− return err;
545+ goto err_irq_disable;
525546
526547 if (!xe_gsc_proxy_init_done(gsc)) {
527− xe_gt_err(gsc_to_gt(gsc), "GSC FW reports proxy init not completed\n");
528− return -EIO;
548+ xe_gt_err(gt, "GSC FW reports proxy init not completed\n");
549+ err = -EIO;
550+ goto err_irq_disable;
529551 }
530552
553+ gsc->proxy.started = true;
531554 return 0;
555+
556+err_irq_disable:
557+ gsc_proxy_irq_toggle(gsc, false);
558+ return err;
532559 }
drivers/gpu/drm/xe/xe_gsc_types.h+2−0
@@ -58,6 +58,8 @@ struct xe_gsc { · 57 unmodified lines
5858 struct mutex mutex;
5959 /** @proxy.component_added: whether the component has been added */
6060 bool component_added;
61+ /** @proxy.started: whether the proxy has been started */
62+ bool started;
6163 /** @proxy.bo: object to store message to and from the GSC */
6264 struct xe_bo *bo;
6365 /** @proxy.to_gsc: map of the memory used to send messages to the GSC */
drivers/gpu/drm/xe/xe_gt.c+54−12
@@ -210,11 +210,15 @@ static int emit_nop_job(struct xe_gt *gt, struct xe_exec_queue *q) · 209 unmodified lines
210210 return ret;
211211 }
212212
213+/* Dwords required to emit a RMW of a register */
214+#define EMIT_RMW_DW 20
215+
213216 static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
214217 {
215− struct xe_reg_sr *sr = &q->hwe->reg_lrc;
218+ struct xe_hw_engine *hwe = q->hwe;
219+ struct xe_reg_sr *sr = &hwe->reg_lrc;
216220 struct xe_reg_sr_entry *entry;
217− int count_rmw = 0, count = 0, ret;
221+ int count_rmw = 0, count_rmw_mcr = 0, count = 0, ret;
218222 unsigned long idx;
219223 struct xe_bb *bb;
220224 size_t bb_len = 0;
@@ -224,6 +228,8 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q) · 3 unmodified lines
224228 xa_for_each(&sr->xa, idx, entry) {
225229 if (entry->reg.masked || entry->clr_bits == ~0)
226230 ++count;
231+ else if (entry->reg.mcr)
232+ ++count_rmw_mcr;
227233 else
228234 ++count_rmw;
229235 }
@@ -231,17 +237,35 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q) · 1 unmodified line
231237 if (count)
232238 bb_len += count * 2 + 1;
233239
234− if (count_rmw)
235− bb_len += count_rmw * 20 + 7;
240+ /*
241+ * RMW of MCR registers is the same as a normal RMW, except an
242+ * additional LRI (3 dwords) is required per register to steer the read
243+ * to a nom-terminated instance.
244+ *
245+ * We could probably shorten the batch slightly by eliding the
246+ * steering for consecutive MCR registers that have the same
247+ * group/instance target, but it's not worth the extra complexity to do
248+ * so.
249+ */
250+ bb_len += count_rmw * EMIT_RMW_DW;
251+ bb_len += count_rmw_mcr * (EMIT_RMW_DW + 3);
252+
253+ /*
254+ * After doing all RMW, we need 7 trailing dwords to clean up,
255+ * plus an additional 3 dwords to reset steering if any of the
256+ * registers were MCR.
257+ */
258+ if (count_rmw || count_rmw_mcr)
259+ bb_len += 7 + (count_rmw_mcr ? 3 : 0);
236260
237− if (q->hwe->class == XE_ENGINE_CLASS_RENDER)
261+ if (hwe->class == XE_ENGINE_CLASS_RENDER)
238262 /*
239263 * Big enough to emit all of the context's 3DSTATE via
240264 * xe_lrc_emit_hwe_state_instructions()
241265 */
242− bb_len += xe_gt_lrc_size(gt, q->hwe->class) / sizeof(u32);
266+ bb_len += xe_gt_lrc_size(gt, hwe->class) / sizeof(u32);
243267
244− xe_gt_dbg(gt, "LRC %s WA job: %zu dwords\n", q->hwe->name, bb_len);
268+ xe_gt_dbg(gt, "LRC %s WA job: %zu dwords\n", hwe->name, bb_len);
245269
246270 bb = xe_bb_new(gt, bb_len, false);
247271 if (IS_ERR(bb))
@@ -276,13 +300,23 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q) · 28 unmodified lines
276300 }
277301 }
278302
279− if (count_rmw) {
280− /* Emit MI_MATH for each RMW reg: 20dw per reg + 7 trailing dw */
281−
303+ if (count_rmw || count_rmw_mcr) {
282304 xa_for_each(&sr->xa, idx, entry) {
283305 if (entry->reg.masked || entry->clr_bits == ~0)
284306 continue;
285307
308+ if (entry->reg.mcr) {
309+ struct xe_reg_mcr reg = { .__reg.raw = entry->reg.raw };
310+ u8 group, instance;
311+
312+ xe_gt_mcr_get_nonterminated_steering(gt, reg, &group, &instance);
313+ *cs++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1);
314+ *cs++ = CS_MMIO_GROUP_INSTANCE_SELECT(hwe->mmio_base).addr;
315+ *cs++ = SELECTIVE_READ_ADDRESSING |
316+ REG_FIELD_PREP(SELECTIVE_READ_GROUP, group) |
317+ REG_FIELD_PREP(SELECTIVE_READ_INSTANCE, instance);
318+ }
319+
286320 *cs++ = MI_LOAD_REGISTER_REG | MI_LRR_DST_CS_MMIO;
287321 *cs++ = entry->reg.addr;
288322 *cs++ = CS_GPR_REG(0, 0).addr;
@@ -308,8 +342,9 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q) · 19 unmodified lines
308342 *cs++ = CS_GPR_REG(0, 0).addr;
309343 *cs++ = entry->reg.addr;
310344
311− xe_gt_dbg(gt, "REG[%#x] = ~%#x|%#x\n",
312− entry->reg.addr, entry->clr_bits, entry->set_bits);
345+ xe_gt_dbg(gt, "REG[%#x] = ~%#x|%#x%s\n",
346+ entry->reg.addr, entry->clr_bits, entry->set_bits,
347+ entry->reg.mcr ? " (MCR)" : "");
313348 }
314349
315350 /* reset used GPR */
@@ -321,6 +356,13 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q) · 5 unmodified lines
321356 *cs++ = 0;
322357 *cs++ = CS_GPR_REG(0, 2).addr;
323358 *cs++ = 0;
359+
360+ /* reset steering */
361+ if (count_rmw_mcr) {
362+ *cs++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1);
363+ *cs++ = CS_MMIO_GROUP_INSTANCE_SELECT(q->hwe->mmio_base).addr;
364+ *cs++ = 0;
365+ }
324366 }
325367
326368 cs = xe_lrc_emit_hwe_state_instructions(q, cs);
drivers/gpu/drm/xe/xe_lrc.h+2−1
@@ -75,7 +75,8 @@ static inline struct xe_lrc *xe_lrc_get(struct xe_lrc *lrc) · 74 unmodified lines
7575 */
7676 static inline void xe_lrc_put(struct xe_lrc *lrc)
7777 {
78− kref_put(&lrc->refcount, xe_lrc_destroy);
78+ if (lrc)
79+ kref_put(&lrc->refcount, xe_lrc_destroy);
7980 }
8081
8182 /**
drivers/gpu/drm/xe/xe_reg_sr.c+3−1
@@ -98,10 +98,12 @@ int xe_reg_sr_add(struct xe_reg_sr *sr, · 97 unmodified lines
9898 *pentry = *e;
9999 ret = xa_err(xa_store(&sr->xa, idx, pentry, GFP_KERNEL));
100100 if (ret)
101− goto fail;
101+ goto fail_free;
102102
103103 return 0;
104104
105+fail_free:
106+ kfree(pentry);
105107 fail:
106108 xe_gt_err(gt,
107109 "discarding save-restore reg %04lx (clear: %08x, set: %08x, masked: %s, mcr: %s): ret=%d\n",
drivers/gpu/drm/xe/xe_ring_ops.c+9−0
@@ -280,6 +280,9 @@ static void __emit_job_gen12_simple(struct xe_sched_job *job, struct xe_lrc *lrc · 279 unmodified lines
280280
281281 i = emit_bb_start(batch_addr, ppgtt_flag, dw, i);
282282
283+ /* Don't preempt fence signaling */
284+ dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
285+
283286 if (job->user_fence.used) {
284287 i = emit_flush_dw(dw, i);
285288 i = emit_store_imm_ppgtt_posted(job->user_fence.addr,
@@ -345,6 +348,9 @@ static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc, · 59 unmodified lines
345348
346349 i = emit_bb_start(batch_addr, ppgtt_flag, dw, i);
347350
351+ /* Don't preempt fence signaling */
352+ dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
353+
348354 if (job->user_fence.used) {
349355 i = emit_flush_dw(dw, i);
350356 i = emit_store_imm_ppgtt_posted(job->user_fence.addr,
@@ -397,6 +403,9 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, · 46 unmodified lines
397403
398404 i = emit_bb_start(batch_addr, ppgtt_flag, dw, i);
399405
406+ /* Don't preempt fence signaling */
407+ dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
408+
400409 i = emit_render_cache_flush(job, dw, i);
401410
402411 if (job->user_fence.used)
drivers/gpu/drm/xe/xe_sync.c+21−9
@@ -146,8 +146,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, · 145 unmodified lines
146146
147147 if (!signal) {
148148 sync->fence = drm_syncobj_fence_get(sync->syncobj);
149− if (XE_IOCTL_DBG(xe, !sync->fence))
150− return -EINVAL;
149+ if (XE_IOCTL_DBG(xe, !sync->fence)) {
150+ err = -EINVAL;
151+ goto free_sync;
152+ }
151153 }
152154 break;
153155
@@ -167,17 +169,21 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, · 13 unmodified lines
167169
168170 if (signal) {
169171 sync->chain_fence = dma_fence_chain_alloc();
170− if (!sync->chain_fence)
171− return -ENOMEM;
172+ if (!sync->chain_fence) {
173+ err = -ENOMEM;
174+ goto free_sync;
175+ }
172176 } else {
173177 sync->fence = drm_syncobj_fence_get(sync->syncobj);
174− if (XE_IOCTL_DBG(xe, !sync->fence))
175− return -EINVAL;
178+ if (XE_IOCTL_DBG(xe, !sync->fence)) {
179+ err = -EINVAL;
180+ goto free_sync;
181+ }
176182
177183 err = dma_fence_chain_find_seqno(&sync->fence,
178184 sync_in.timeline_value);
179185 if (err)
180− return err;
186+ goto free_sync;
181187 }
182188 break;
183189
@@ -200,8 +206,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, · 16 unmodified lines
200206 if (XE_IOCTL_DBG(xe, IS_ERR(sync->ufence)))
201207 return PTR_ERR(sync->ufence);
202208 sync->ufence_chain_fence = dma_fence_chain_alloc();
203− if (!sync->ufence_chain_fence)
204− return -ENOMEM;
209+ if (!sync->ufence_chain_fence) {
210+ err = -ENOMEM;
211+ goto free_sync;
212+ }
205213 sync->ufence_syncobj = ufence_syncobj;
206214 }
207215
@@ -216,6 +224,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, · 8 unmodified lines
216224 sync->timeline_value = sync_in.timeline_value;
217225
218226 return 0;
227+
228+free_sync:
229+ xe_sync_entry_cleanup(sync);
230+ return err;
219231 }
220232 ALLOW_ERROR_INJECTION(xe_sync_entry_parse, ERRNO);
221233
drivers/gpu/drm/xe/xe_vm_madvise.c+2−1
@@ -453,7 +453,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil · 452 unmodified lines
453453 madvise_range.num_vmas,
454454 args->atomic.val)) {
455455 err = -EINVAL;
456− goto madv_fini;
456+ goto free_vmas;
457457 }
458458 }
459459
@@ -490,6 +490,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil · 30 unmodified lines
490490 err_fini:
491491 if (madvise_range.has_bo_vmas)
492492 drm_exec_fini(&exec);
493+free_vmas:
493494 kfree(madvise_range.vmas);
494495 madvise_range.vmas = NULL;
495496 madv_fini:
drivers/gpu/drm/xe/xe_wa.c+7−6
@@ -241,12 +241,13 @@ static const struct xe_rtp_entry_sr gt_was[] = { · 240 unmodified lines
241241
242242 { XE_RTP_NAME("16025250150"),
243243 XE_RTP_RULES(GRAPHICS_VERSION(2001)),
244− XE_RTP_ACTIONS(SET(LSN_VC_REG2,
245− LSN_LNI_WGT(1) |
246− LSN_LNE_WGT(1) |
247− LSN_DIM_X_WGT(1) |
248− LSN_DIM_Y_WGT(1) |
249− LSN_DIM_Z_WGT(1)))
244+ XE_RTP_ACTIONS(FIELD_SET(LSN_VC_REG2,
245+ LSN_LNI_WGT_MASK | LSN_LNE_WGT_MASK |
246+ LSN_DIM_X_WGT_MASK | LSN_DIM_Y_WGT_MASK |
247+ LSN_DIM_Z_WGT_MASK,
248+ LSN_LNI_WGT(1) | LSN_LNE_WGT(1) |
249+ LSN_DIM_X_WGT(1) | LSN_DIM_Y_WGT(1) |
250+ LSN_DIM_Z_WGT(1)))
250251 },
251252
252253 /* Xe2_HPM */
drivers/gpu/nova-core/gsp.rs+24−22
@@ -47,16 +47,12 @@ struct PteArray<const NUM_ENTRIES: usize>([u64; NUM_ENTRIES]); · 46 unmodified lines
4747 unsafe impl<const NUM_ENTRIES: usize> AsBytes for PteArray<NUM_ENTRIES> {}
4848
4949 impl<const NUM_PAGES: usize> PteArray<NUM_PAGES> {
50− /// Creates a new page table array mapping `NUM_PAGES` GSP pages starting at address `start`.
51− fn new(start: DmaAddress) -> Result<Self> {
52− let mut ptes = [0u64; NUM_PAGES];
53− for (i, pte) in ptes.iter_mut().enumerate() {
54− *pte = start
55− .checked_add(num::usize_as_u64(i) << GSP_PAGE_SHIFT)
56− .ok_or(EOVERFLOW)?;
57− }
58−
59− Ok(Self(ptes))
50+ /// Returns the page table entry for `index`, for a mapping starting at `start`.
51+ // TODO: Replace with `IoView` projection once available.
52+ fn entry(start: DmaAddress, index: usize) -> Result<u64> {
53+ start
54+ .checked_add(num::usize_as_u64(index) << GSP_PAGE_SHIFT)
55+ .ok_or(EOVERFLOW)
6056 }
6157 }
6258
@@ -86,16 +82,22 @@ impl LogBuffer { · 23 unmodified lines
8682 NUM_PAGES * GSP_PAGE_SIZE,
8783 GFP_KERNEL | __GFP_ZERO,
8884 )?);
89− let ptes = PteArray::<NUM_PAGES>::new(obj.0.dma_handle())?;
85+
86+ let start_addr = obj.0.dma_handle();
9087
9188 // SAFETY: `obj` has just been created and we are its sole user.
92− unsafe {
93− // Copy the self-mapping PTE at the expected location.
89+ let pte_region = unsafe {
9490 obj.0
95− .as_slice_mut(size_of::<u64>(), size_of_val(&ptes))?
96− .copy_from_slice(ptes.as_bytes())
91+ .as_slice_mut(size_of::<u64>(), NUM_PAGES * size_of::<u64>())?
9792 };
9893
94+ // Write values one by one to avoid an on-stack instance of `PteArray`.
95+ for (i, chunk) in pte_region.chunks_exact_mut(size_of::<u64>()).enumerate() {
96+ let pte_value = PteArray::<0>::entry(start_addr, i)?;
97+
98+ chunk.copy_from_slice(&pte_value.to_ne_bytes());
99+ }
100+
99101 Ok(obj)
100102 }
101103 }
@@ -143,14 +145,14 @@ impl Gsp { · 41 unmodified lines
143145 // _kgspInitLibosLoggingStructures (allocates memory for buffers)
144146 // kgspSetupLibosInitArgs_IMPL (creates pLibosInitArgs[] array)
145147 dma_write!(
146− libos[0] = LibosMemoryRegionInitArgument::new("LOGINIT", &loginit.0)
147− )?;
148+ libos, [0]?, LibosMemoryRegionInitArgument::new("LOGINIT", &loginit.0)
149+ );
148150 dma_write!(
149− libos[1] = LibosMemoryRegionInitArgument::new("LOGINTR", &logintr.0)
150− )?;
151− dma_write!(libos[2] = LibosMemoryRegionInitArgument::new("LOGRM", &logrm.0))?;
152− dma_write!(rmargs[0].inner = fw::GspArgumentsCached::new(cmdq))?;
153− dma_write!(libos[3] = LibosMemoryRegionInitArgument::new("RMARGS", rmargs))?;
151+ libos, [1]?, LibosMemoryRegionInitArgument::new("LOGINTR", &logintr.0)
152+ );
153+ dma_write!(libos, [2]?, LibosMemoryRegionInitArgument::new("LOGRM", &logrm.0));
154+ dma_write!(rmargs, [0]?.inner, fw::GspArgumentsCached::new(cmdq));
155+ dma_write!(libos, [3]?, LibosMemoryRegionInitArgument::new("RMARGS", rmargs));
154156 },
155157 }))
156158 })
drivers/gpu/nova-core/gsp/boot.rs+1−1
@@ -157,7 +157,7 @@ impl super::Gsp { · 156 unmodified lines
157157
158158 let wpr_meta =
159159 CoherentAllocation::<GspFwWprMeta>::alloc_coherent(dev, 1, GFP_KERNEL | __GFP_ZERO)?;
160− dma_write!(wpr_meta[0] = GspFwWprMeta::new(&gsp_fw, &fb_layout))?;
160+ dma_write!(wpr_meta, [0]?, GspFwWprMeta::new(&gsp_fw, &fb_layout));
161161
162162 self.cmdq
163163 .send_command(bar, commands::SetSystemInfo::new(pdev))?;
drivers/gpu/nova-core/gsp/cmdq.rs+33−60
@@ -2,11 +2,7 @@ · 1 unmodified line
22
33 use core::{
44 cmp,
5− mem,
6− sync::atomic::{
7− fence,
8− Ordering, //
9− }, //
5+ mem, //
106 };
117
128 use kernel::{
@@ -146,30 +142,36 @@ static_assert!(align_of::<MsgqData>() == GSP_PAGE_SIZE); · 133 unmodified lines
146142 #[repr(C)]
147143 // There is no struct defined for this in the open-gpu-kernel-source headers.
148144 // Instead it is defined by code in `GspMsgQueuesInit()`.
149−struct Msgq {
145+// TODO: Revert to private once `IoView` projections replace the `gsp_mem` module.
146+pub(super) struct Msgq {
150147 /// Header for sending messages, including the write pointer.
151− tx: MsgqTxHeader,
148+ pub(super) tx: MsgqTxHeader,
152149 /// Header for receiving messages, including the read pointer.
153− rx: MsgqRxHeader,
150+ pub(super) rx: MsgqRxHeader,
154151 /// The message queue proper.
155152 msgq: MsgqData,
156153 }
157154
158155 /// Structure shared between the driver and the GSP and containing the command and message queues.
159156 #[repr(C)]
160−struct GspMem {
157+// TODO: Revert to private once `IoView` projections replace the `gsp_mem` module.
158+pub(super) struct GspMem {
161159 /// Self-mapping page table entries.
162− ptes: PteArray<{ GSP_PAGE_SIZE / size_of::<u64>() }>,
160+ ptes: PteArray<{ Self::PTE_ARRAY_SIZE }>,
163161 /// CPU queue: the driver writes commands here, and the GSP reads them. It also contains the
164162 /// write and read pointers that the CPU updates.
165163 ///
166164 /// This member is read-only for the GSP.
167− cpuq: Msgq,
165+ pub(super) cpuq: Msgq,
168166 /// GSP queue: the GSP writes messages here, and the driver reads them. It also contains the
169167 /// write and read pointers that the GSP updates.
170168 ///
171169 /// This member is read-only for the driver.
172− gspq: Msgq,
170+ pub(super) gspq: Msgq,
171+}
172+
173+impl GspMem {
174+ const PTE_ARRAY_SIZE: usize = GSP_PAGE_SIZE / size_of::<u64>();
173175 }
174176
175177 // SAFETY: These structs don't meet the no-padding requirements of AsBytes but
@@ -201,9 +203,19 @@ impl DmaGspMem { · 25 unmodified lines
201203
202204 let gsp_mem =
203205 CoherentAllocation::<GspMem>::alloc_coherent(dev, 1, GFP_KERNEL | __GFP_ZERO)?;
204− dma_write!(gsp_mem[0].ptes = PteArray::new(gsp_mem.dma_handle())?)?;
205− dma_write!(gsp_mem[0].cpuq.tx = MsgqTxHeader::new(MSGQ_SIZE, RX_HDR_OFF, MSGQ_NUM_PAGES))?;
206− dma_write!(gsp_mem[0].cpuq.rx = MsgqRxHeader::new())?;
206+
207+ let start = gsp_mem.dma_handle();
208+ // Write values one by one to avoid an on-stack instance of `PteArray`.
209+ for i in 0..GspMem::PTE_ARRAY_SIZE {
210+ dma_write!(gsp_mem, [0]?.ptes.0[i], PteArray::<0>::entry(start, i)?);
211+ }
212+
213+ dma_write!(
214+ gsp_mem,
215+ [0]?.cpuq.tx,
216+ MsgqTxHeader::new(MSGQ_SIZE, RX_HDR_OFF, MSGQ_NUM_PAGES)
217+ );
218+ dma_write!(gsp_mem, [0]?.cpuq.rx, MsgqRxHeader::new());
207219
208220 Ok(Self(gsp_mem))
209221 }
@@ -317,12 +329,7 @@ impl DmaGspMem { · 107 unmodified lines
317329 //
318330 // - The returned value is between `0` and `MSGQ_NUM_PAGES`.
319331 fn gsp_write_ptr(&self) -> u32 {
320− let gsp_mem = self.0.start_ptr();
321−
322− // SAFETY:
323− // - The 'CoherentAllocation' contains at least one object.
324− // - By the invariants of `CoherentAllocation` the pointer is valid.
325− (unsafe { (*gsp_mem).gspq.tx.write_ptr() } % MSGQ_NUM_PAGES)
332+ super::fw::gsp_mem::gsp_write_ptr(&self.0)
326333 }
327334
328335 // Returns the index of the memory page the GSP will read the next command from.
@@ -331,12 +338,7 @@ impl DmaGspMem { · 2 unmodified lines
331338 //
332339 // - The returned value is between `0` and `MSGQ_NUM_PAGES`.
333340 fn gsp_read_ptr(&self) -> u32 {
334− let gsp_mem = self.0.start_ptr();
335−
336− // SAFETY:
337− // - The 'CoherentAllocation' contains at least one object.
338− // - By the invariants of `CoherentAllocation` the pointer is valid.
339− (unsafe { (*gsp_mem).gspq.rx.read_ptr() } % MSGQ_NUM_PAGES)
341+ super::fw::gsp_mem::gsp_read_ptr(&self.0)
340342 }
341343
342344 // Returns the index of the memory page the CPU can read the next message from.
@@ -345,27 +347,12 @@ impl DmaGspMem { · 2 unmodified lines
345347 //
346348 // - The returned value is between `0` and `MSGQ_NUM_PAGES`.
347349 fn cpu_read_ptr(&self) -> u32 {
348− let gsp_mem = self.0.start_ptr();
349−
350− // SAFETY:
351− // - The ['CoherentAllocation'] contains at least one object.
352− // - By the invariants of CoherentAllocation the pointer is valid.
353− (unsafe { (*gsp_mem).cpuq.rx.read_ptr() } % MSGQ_NUM_PAGES)
350+ super::fw::gsp_mem::cpu_read_ptr(&self.0)
354351 }
355352
356353 // Informs the GSP that it can send `elem_count` new pages into the message queue.
357354 fn advance_cpu_read_ptr(&mut self, elem_count: u32) {
358− let rptr = self.cpu_read_ptr().wrapping_add(elem_count) % MSGQ_NUM_PAGES;
359−
360− // Ensure read pointer is properly ordered.
361− fence(Ordering::SeqCst);
362−
363− let gsp_mem = self.0.start_ptr_mut();
364−
365− // SAFETY:
366− // - The 'CoherentAllocation' contains at least one object.
367− // - By the invariants of `CoherentAllocation` the pointer is valid.
368− unsafe { (*gsp_mem).cpuq.rx.set_read_ptr(rptr) };
355+ super::fw::gsp_mem::advance_cpu_read_ptr(&self.0, elem_count)
369356 }
370357
371358 // Returns the index of the memory page the CPU can write the next command to.
@@ -374,26 +361,12 @@ impl DmaGspMem { · 2 unmodified lines
374361 //
375362 // - The returned value is between `0` and `MSGQ_NUM_PAGES`.
376363 fn cpu_write_ptr(&self) -> u32 {
377− let gsp_mem = self.0.start_ptr();
378−
379− // SAFETY:
380− // - The 'CoherentAllocation' contains at least one object.
381− // - By the invariants of `CoherentAllocation` the pointer is valid.
382− (unsafe { (*gsp_mem).cpuq.tx.write_ptr() } % MSGQ_NUM_PAGES)
364+ super::fw::gsp_mem::cpu_write_ptr(&self.0)
383365 }
384366
385367 // Informs the GSP that it can process `elem_count` new pages from the command queue.
386368 fn advance_cpu_write_ptr(&mut self, elem_count: u32) {
387− let wptr = self.cpu_write_ptr().wrapping_add(elem_count) & MSGQ_NUM_PAGES;
388− let gsp_mem = self.0.start_ptr_mut();
389−
390− // SAFETY:
391− // - The 'CoherentAllocation' contains at least one object.
392− // - By the invariants of `CoherentAllocation` the pointer is valid.
393− unsafe { (*gsp_mem).cpuq.tx.set_write_ptr(wptr) };
394−
395− // Ensure all command data is visible before triggering the GSP read.
396− fence(Ordering::SeqCst);
369+ super::fw::gsp_mem::advance_cpu_write_ptr(&self.0, elem_count)
397370 }
398371 }
399372
drivers/gpu/nova-core/gsp/fw.rs+69−32
@@ -40,6 +40,75 @@ use crate::{ · 39 unmodified lines
4040 },
4141 };
4242
43+// TODO: Replace with `IoView` projections once available; the `unwrap()` calls go away once we
44+// switch to the new `dma::Coherent` API.
45+pub(super) mod gsp_mem {
46+ use core::sync::atomic::{
47+ fence,
48+ Ordering, //
49+ };
50+
51+ use kernel::{
52+ dma::CoherentAllocation,
53+ dma_read,
54+ dma_write,
55+ prelude::*, //
56+ };
57+
58+ use crate::gsp::cmdq::{
59+ GspMem,
60+ MSGQ_NUM_PAGES, //
61+ };
62+
63+ pub(in crate::gsp) fn gsp_write_ptr(qs: &CoherentAllocation<GspMem>) -> u32 {
64+ // PANIC: A `dma::CoherentAllocation` always contains at least one element.
65+ || -> Result<u32> { Ok(dma_read!(qs, [0]?.gspq.tx.0.writePtr) % MSGQ_NUM_PAGES) }().unwrap()
66+ }
67+
68+ pub(in crate::gsp) fn gsp_read_ptr(qs: &CoherentAllocation<GspMem>) -> u32 {
69+ // PANIC: A `dma::CoherentAllocation` always contains at least one element.
70+ || -> Result<u32> { Ok(dma_read!(qs, [0]?.gspq.rx.0.readPtr) % MSGQ_NUM_PAGES) }().unwrap()
71+ }
72+
73+ pub(in crate::gsp) fn cpu_read_ptr(qs: &CoherentAllocation<GspMem>) -> u32 {
74+ // PANIC: A `dma::CoherentAllocation` always contains at least one element.
75+ || -> Result<u32> { Ok(dma_read!(qs, [0]?.cpuq.rx.0.readPtr) % MSGQ_NUM_PAGES) }().unwrap()
76+ }
77+
78+ pub(in crate::gsp) fn advance_cpu_read_ptr(qs: &CoherentAllocation<GspMem>, count: u32) {
79+ let rptr = cpu_read_ptr(qs).wrapping_add(count) % MSGQ_NUM_PAGES;
80+
81+ // Ensure read pointer is properly ordered.
82+ fence(Ordering::SeqCst);
83+
84+ // PANIC: A `dma::CoherentAllocation` always contains at least one element.
85+ || -> Result {
86+ dma_write!(qs, [0]?.cpuq.rx.0.readPtr, rptr);
87+ Ok(())
88+ }()
89+ .unwrap()
90+ }
91+
92+ pub(in crate::gsp) fn cpu_write_ptr(qs: &CoherentAllocation<GspMem>) -> u32 {
93+ // PANIC: A `dma::CoherentAllocation` always contains at least one element.
94+ || -> Result<u32> { Ok(dma_read!(qs, [0]?.cpuq.tx.0.writePtr) % MSGQ_NUM_PAGES) }().unwrap()
95+ }
96+
97+ pub(in crate::gsp) fn advance_cpu_write_ptr(qs: &CoherentAllocation<GspMem>, count: u32) {
98+ let wptr = cpu_write_ptr(qs).wrapping_add(count) % MSGQ_NUM_PAGES;
99+
100+ // PANIC: A `dma::CoherentAllocation` always contains at least one element.
101+ || -> Result {
102+ dma_write!(qs, [0]?.cpuq.tx.0.writePtr, wptr);
103+ Ok(())
104+ }()
105+ .unwrap();
106+
107+ // Ensure all command data is visible before triggering the GSP read.
108+ fence(Ordering::SeqCst);
109+ }
110+}
111+
43112 /// Empty type to group methods related to heap parameters for running the GSP firmware.
44113 enum GspFwHeapParams {}
45114
@@ -708,22 +777,6 @@ impl MsgqTxHeader { · 662 unmodified lines
708777 entryOff: num::usize_into_u32::<GSP_PAGE_SIZE>(),
709778 })
710779 }
711−
712− /// Returns the value of the write pointer for this queue.
713− pub(crate) fn write_ptr(&self) -> u32 {
714− let ptr = core::ptr::from_ref(&self.0.writePtr);
715−
716− // SAFETY: `ptr` is a valid pointer to a `u32`.
717− unsafe { ptr.read_volatile() }
718− }
719−
720− /// Sets the value of the write pointer for this queue.
721− pub(crate) fn set_write_ptr(&mut self, val: u32) {
722− let ptr = core::ptr::from_mut(&mut self.0.writePtr);
723−
724− // SAFETY: `ptr` is a valid pointer to a `u32`.
725− unsafe { ptr.write_volatile(val) }
726− }
727780 }
728781
729782 // SAFETY: Padding is explicit and does not contain uninitialized data.
@@ -739,22 +792,6 @@ impl MsgqRxHeader { · 9 unmodified lines
739792 pub(crate) fn new() -> Self {
740793 Self(Default::default())
741794 }
742−
743− /// Returns the value of the read pointer for this queue.
744− pub(crate) fn read_ptr(&self) -> u32 {
745− let ptr = core::ptr::from_ref(&self.0.readPtr);
746−
747− // SAFETY: `ptr` is a valid pointer to a `u32`.
748− unsafe { ptr.read_volatile() }
749− }
750−
751− /// Sets the value of the read pointer for this queue.
752− pub(crate) fn set_read_ptr(&mut self, val: u32) {
753− let ptr = core::ptr::from_mut(&mut self.0.readPtr);
754−
755− // SAFETY: `ptr` is a valid pointer to a `u32`.
756− unsafe { ptr.write_volatile(val) }
757− }
758795 }
759796
760797 // SAFETY: Padding is explicit and does not contain uninitialized data.
drivers/hid/hid-apple.c+4−3
@@ -365,6 +365,9 @@ static const struct apple_non_apple_keyboard non_apple_keyboards[] = { · 364 unmodified lines
365365 { "A3R" },
366366 { "hfd.cn" },
367367 { "WKB603" },
368+ { "TH87" }, /* EPOMAKER TH87 BT mode */
369+ { "HFD Epomaker TH87" }, /* EPOMAKER TH87 USB mode */
370+ { "2.4G Wireless Receiver" }, /* EPOMAKER TH87 dongle */
368371 };
369372
370373 static bool apple_is_non_apple_keyboard(struct hid_device *hdev)
@@ -686,9 +689,7 @@ static const __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 315 unmodified lines
686689 hid_info(hdev,
687690 "fixing up Magic Keyboard battery report descriptor\n");
688691 *rsize = *rsize - 1;
689− rdesc = kmemdup(rdesc + 1, *rsize, GFP_KERNEL);
690− if (!rdesc)
691− return NULL;
692+ rdesc = rdesc + 1;
692693
693694 rdesc[0] = 0x05;
694695 rdesc[1] = 0x01;
drivers/hid/hid-asus.c+14−4
@@ -1399,14 +1399,21 @@ static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 1398 unmodified lines
13991399 */
14001400 if (*rsize == rsize_orig &&
14011401 rdesc[offs] == 0x09 && rdesc[offs + 1] == 0x76) {
1402− *rsize = rsize_orig + 1;
1403− rdesc = kmemdup(rdesc, *rsize, GFP_KERNEL);
1404− if (!rdesc)
1405− return NULL;
1402+ __u8 *new_rdesc;
1403+
1404+ new_rdesc = devm_kzalloc(&hdev->dev, rsize_orig + 1,
1405+ GFP_KERNEL);
1406+ if (!new_rdesc)
1407+ return rdesc;
14061408
14071409 hid_info(hdev, "Fixing up %s keyb report descriptor\n",
14081410 drvdata->quirks & QUIRK_T100CHI ?
14091411 "T100CHI" : "T90CHI");
1412+
1413+ memcpy(new_rdesc, rdesc, rsize_orig);
1414+ *rsize = rsize_orig + 1;
1415+ rdesc = new_rdesc;
1416+
14101417 memmove(rdesc + offs + 4, rdesc + offs + 2, 12);
14111418 rdesc[offs] = 0x19;
14121419 rdesc[offs + 1] = 0x00;
@@ -1490,6 +1497,9 @@ static const struct hid_device_id asus_devices[] = { · 77 unmodified lines
14901497 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
14911498 USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY_X),
14921499 QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD | QUIRK_ROG_ALLY_XPAD },
1500+ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
1501+ USB_DEVICE_ID_ASUSTEK_XGM_2023),
1502+ },
14931503 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
14941504 USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD),
14951505 QUIRK_ROG_CLAYMORE_II_KEYBOARD },
drivers/hid/hid-cmedia.c+1−1
@@ -99,7 +99,7 @@ static int cmhid_raw_event(struct hid_device *hid, struct hid_report *report, · 98 unmodified lines
9999 {
100100 struct cmhid *cm = hid_get_drvdata(hid);
101101
102− if (len != CM6533_JD_RAWEV_LEN)
102+ if (len != CM6533_JD_RAWEV_LEN || !(hid->claimed & HID_CLAIMED_INPUT))
103103 goto out;
104104 if (memcmp(data+CM6533_JD_SFX_OFFSET, ji_sfx, sizeof(ji_sfx)))
105105 goto out;
drivers/hid/hid-creative-sb0540.c+1−1
@@ -153,7 +153,7 @@ static int creative_sb0540_raw_event(struct hid_device *hid, · 152 unmodified lines
153153 u64 code, main_code;
154154 int key;
155155
156− if (len != 6)
156+ if (len != 6 || !(hid->claimed & HID_CLAIMED_INPUT))
157157 return 0;
158158
159159 /* From daemons/hw_hiddev.c sb0540_rec() in lirc */
drivers/hid/hid-ids.h+1−0
@@ -229,6 +229,7 @@ · 228 unmodified lines
229229 #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY_X 0x1b4c
230230 #define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b
231231 #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869
232+#define USB_DEVICE_ID_ASUSTEK_XGM_2023 0x1a9a
232233
233234 #define USB_VENDOR_ID_ATEN 0x0557
234235 #define USB_DEVICE_ID_ATEN_UC100KM 0x2004
drivers/hid/hid-magicmouse.c+2−4
@@ -990,13 +990,11 @@ static const __u8 *magicmouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 989 unmodified lines
990990 */
991991 if ((is_usb_magicmouse2(hdev->vendor, hdev->product) ||
992992 is_usb_magictrackpad2(hdev->vendor, hdev->product)) &&
993− *rsize == 83 && rdesc[46] == 0x84 && rdesc[58] == 0x85) {
993+ *rsize >= 83 && rdesc[46] == 0x84 && rdesc[58] == 0x85) {
994994 hid_info(hdev,
995995 "fixing up magicmouse battery report descriptor\n");
996996 *rsize = *rsize - 1;
997− rdesc = kmemdup(rdesc + 1, *rsize, GFP_KERNEL);
998− if (!rdesc)
999− return NULL;
997+ rdesc = rdesc + 1;
1000998
1001999 rdesc[0] = 0x05;
10021000 rdesc[1] = 0x01;
drivers/hid/hid-mcp2221.c+2−0
@@ -353,6 +353,8 @@ static int mcp_i2c_smbus_read(struct mcp2221 *mcp, · 352 unmodified lines
353353 usleep_range(90, 100);
354354 retries++;
355355 } else {
356+ usleep_range(980, 1000);
357+ mcp_cancel_last_cmd(mcp);
356358 return ret;
357359 }
358360 } else {
drivers/hid/hid-multitouch.c+38−5
@@ -77,6 +77,7 @@ MODULE_LICENSE("GPL"); · 76 unmodified lines
7777 #define MT_QUIRK_ORIENTATION_INVERT BIT(22)
7878 #define MT_QUIRK_APPLE_TOUCHBAR BIT(23)
7979 #define MT_QUIRK_YOGABOOK9I BIT(24)
80+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE BIT(25)
8081
8182 #define MT_INPUTMODE_TOUCHSCREEN 0x02
8283 #define MT_INPUTMODE_TOUCHPAD 0x03
@@ -214,6 +215,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app); · 131 unmodified lines
214215 #define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016
215216 #define MT_CLS_WIN_8_NO_STICKY_FINGERS 0x0017
216217 #define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU 0x0018
218+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE 0x0019
217219
218220 /* vendor specific classes */
219221 #define MT_CLS_3M 0x0101
@@ -233,6 +235,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app); · 13 unmodified lines
233235 #define MT_CLS_SMART_TECH 0x0113
234236 #define MT_CLS_APPLE_TOUCHBAR 0x0114
235237 #define MT_CLS_YOGABOOK9I 0x0115
238+#define MT_CLS_EGALAX_P80H84 0x0116
236239 #define MT_CLS_SIS 0x0457
237240
238241 #define MT_DEFAULT_MAXCONTACT 10
@@ -334,6 +337,15 @@ static const struct mt_class mt_classes[] = { · 95 unmodified lines
334337 MT_QUIRK_CONTACT_CNT_ACCURATE |
335338 MT_QUIRK_WIN8_PTP_BUTTONS,
336339 .export_all_inputs = true },
340+ { .name = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
341+ .quirks = MT_QUIRK_ALWAYS_VALID |
342+ MT_QUIRK_IGNORE_DUPLICATES |
343+ MT_QUIRK_HOVERING |
344+ MT_QUIRK_CONTACT_CNT_ACCURATE |
345+ MT_QUIRK_STICKY_FINGERS |
346+ MT_QUIRK_WIN8_PTP_BUTTONS |
347+ MT_QUIRK_KEEP_LATENCY_ON_CLOSE,
348+ .export_all_inputs = true },
337349
338350 /*
339351 * vendor specific classes
@@ -438,6 +450,11 @@ static const struct mt_class mt_classes[] = { · 98 unmodified lines
438450 MT_QUIRK_YOGABOOK9I,
439451 .export_all_inputs = true
440452 },
453+ { .name = MT_CLS_EGALAX_P80H84,
454+ .quirks = MT_QUIRK_ALWAYS_VALID |
455+ MT_QUIRK_IGNORE_DUPLICATES |
456+ MT_QUIRK_CONTACT_CNT_ACCURATE,
457+ },
441458 { }
442459 };
443460
@@ -849,7 +866,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 405 unmodified lines
849866 if ((cls->name == MT_CLS_WIN_8 ||
850867 cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT ||
851868 cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU ||
852− cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP) &&
869+ cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP ||
870+ cls->name == MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE) &&
853871 (field->application == HID_DG_TOUCHPAD ||
854872 field->application == HID_DG_TOUCHSCREEN))
855873 app->quirks |= MT_QUIRK_CONFIDENCE;
@@ -1762,7 +1780,8 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) · 906 unmodified lines
17621780 int ret;
17631781
17641782 if (td->is_haptic_touchpad && (td->mtclass.name == MT_CLS_WIN_8 ||
1765− td->mtclass.name == MT_CLS_WIN_8_FORCE_MULTI_INPUT)) {
1783+ td->mtclass.name == MT_CLS_WIN_8_FORCE_MULTI_INPUT ||
1784+ td->mtclass.name == MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE)) {
17661785 if (hid_haptic_input_configured(hdev, td->haptic, hi) == 0)
17671786 td->is_haptic_touchpad = false;
17681787 } else {
@@ -2075,7 +2094,12 @@ static void mt_on_hid_hw_open(struct hid_device *hdev) · 306 unmodified lines
20752094
20762095 static void mt_on_hid_hw_close(struct hid_device *hdev)
20772096 {
2078− mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
2097+ struct mt_device *td = hid_get_drvdata(hdev);
2098+
2099+ if (td->mtclass.quirks & MT_QUIRK_KEEP_LATENCY_ON_CLOSE)
2100+ mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_NONE);
2101+ else
2102+ mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
20792103 }
20802104
20812105 /*
@@ -2215,8 +2239,9 @@ static const struct hid_device_id mt_devices[] = { · 133 unmodified lines
22152239 { .driver_data = MT_CLS_EGALAX_SERIAL,
22162240 MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
22172241 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C000) },
2218− { .driver_data = MT_CLS_EGALAX,
2219− MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
2242+ { .driver_data = MT_CLS_EGALAX_P80H84,
2243+ HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
2244+ USB_VENDOR_ID_DWAV,
22202245 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002) },
22212246
22222247 /* Elan devices */
@@ -2461,6 +2486,14 @@ static const struct hid_device_id mt_devices[] = { · 238 unmodified lines
24612486 MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
24622487 USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
24632488
2489+ /* Uniwill touchpads */
2490+ { .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
2491+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2492+ USB_VENDOR_ID_PIXART, 0x0255) },
2493+ { .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
2494+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2495+ USB_VENDOR_ID_PIXART, 0x0274) },
2496+
24642497 /* VTL panels */
24652498 { .driver_data = MT_CLS_VTL,
24662499 MT_USB_DEVICE(USB_VENDOR_ID_VTL,
drivers/hid/hid-zydacron.c+1−1
@@ -114,7 +114,7 @@ static int zc_raw_event(struct hid_device *hdev, struct hid_report *report, · 113 unmodified lines
114114 unsigned key;
115115 unsigned short index;
116116
117− if (report->id == data[0]) {
117+ if (report->id == data[0] && (hdev->claimed & HID_CLAIMED_INPUT)) {
118118
119119 /* break keys */
120120 for (index = 0; index < 4; index++) {
drivers/hid/intel-ish-hid/ipc/hw-ish.h+2−0
@@ -39,6 +39,8 @@ · 38 unmodified lines
3939 #define PCI_DEVICE_ID_INTEL_ISH_PTL_H 0xE345
4040 #define PCI_DEVICE_ID_INTEL_ISH_PTL_P 0xE445
4141 #define PCI_DEVICE_ID_INTEL_ISH_WCL 0x4D45
42+#define PCI_DEVICE_ID_INTEL_ISH_NVL_H 0xD354
43+#define PCI_DEVICE_ID_INTEL_ISH_NVL_S 0x6E78
4244
4345 #define REVISION_ID_CHT_A0 0x6
4446 #define REVISION_ID_CHT_Ax_SI 0x0
drivers/hid/intel-ish-hid/ipc/pci-ish.c+12−0
@@ -28,11 +28,15 @@ enum ishtp_driver_data_index { · 27 unmodified lines
2828 ISHTP_DRIVER_DATA_LNL_M,
2929 ISHTP_DRIVER_DATA_PTL,
3030 ISHTP_DRIVER_DATA_WCL,
31+ ISHTP_DRIVER_DATA_NVL_H,
32+ ISHTP_DRIVER_DATA_NVL_S,
3133 };
3234
3335 #define ISH_FW_GEN_LNL_M "lnlm"
3436 #define ISH_FW_GEN_PTL "ptl"
3537 #define ISH_FW_GEN_WCL "wcl"
38+#define ISH_FW_GEN_NVL_H "nvlh"
39+#define ISH_FW_GEN_NVL_S "nvls"
3640
3741 #define ISH_FIRMWARE_PATH(gen) "intel/ish/ish_" gen ".bin"
3842 #define ISH_FIRMWARE_PATH_ALL "intel/ish/ish_*.bin"
@@ -47,6 +51,12 @@ static struct ishtp_driver_data ishtp_driver_data[] = { · 8 unmodified lines
4751 [ISHTP_DRIVER_DATA_WCL] = {
4852 .fw_generation = ISH_FW_GEN_WCL,
4953 },
54+ [ISHTP_DRIVER_DATA_NVL_H] = {
55+ .fw_generation = ISH_FW_GEN_NVL_H,
56+ },
57+ [ISHTP_DRIVER_DATA_NVL_S] = {
58+ .fw_generation = ISH_FW_GEN_NVL_S,
59+ },
5060 };
5161
5262 static const struct pci_device_id ish_pci_tbl[] = {
@@ -76,6 +86,8 @@ static const struct pci_device_id ish_pci_tbl[] = { · 23 unmodified lines
7686 {PCI_DEVICE_DATA(INTEL, ISH_PTL_H, ISHTP_DRIVER_DATA_PTL)},
7787 {PCI_DEVICE_DATA(INTEL, ISH_PTL_P, ISHTP_DRIVER_DATA_PTL)},
7888 {PCI_DEVICE_DATA(INTEL, ISH_WCL, ISHTP_DRIVER_DATA_WCL)},
89+ {PCI_DEVICE_DATA(INTEL, ISH_NVL_H, ISHTP_DRIVER_DATA_NVL_H)},
90+ {PCI_DEVICE_DATA(INTEL, ISH_NVL_S, ISHTP_DRIVER_DATA_NVL_S)},
7991 {}
8092 };
8193 MODULE_DEVICE_TABLE(pci, ish_pci_tbl);
drivers/hid/usbhid/hid-pidff.c+7−4
@@ -1452,10 +1452,13 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev) · 1451 unmodified lines
14521452 hid_warn(pidff->hid, "unknown ramp effect layout\n");
14531453
14541454 if (PIDFF_FIND_FIELDS(set_condition, PID_SET_CONDITION, 1)) {
1455− if (test_and_clear_bit(FF_SPRING, dev->ffbit) ||
1456− test_and_clear_bit(FF_DAMPER, dev->ffbit) ||
1457− test_and_clear_bit(FF_FRICTION, dev->ffbit) ||
1458− test_and_clear_bit(FF_INERTIA, dev->ffbit))
1455+ bool test = false;
1456+
1457+ test |= test_and_clear_bit(FF_SPRING, dev->ffbit);
1458+ test |= test_and_clear_bit(FF_DAMPER, dev->ffbit);
1459+ test |= test_and_clear_bit(FF_FRICTION, dev->ffbit);
1460+ test |= test_and_clear_bit(FF_INERTIA, dev->ffbit);
1461+ if (test)
14591462 hid_warn(pidff->hid, "unknown condition effect layout\n");
14601463 }
14611464
drivers/hwmon/Kconfig+2−14
@@ -1493,8 +1493,7 @@ config SENSORS_LM73 · 1492 unmodified lines
14931493
14941494 config SENSORS_LM75
14951495 tristate "National Semiconductor LM75 and compatibles"
1496− depends on I2C
1497− depends on I3C || !I3C
1496+ depends on I3C_OR_I2C
14981497 select REGMAP_I2C
14991498 select REGMAP_I3C if I3C
15001499 help
@@ -1927,16 +1926,6 @@ config SENSORS_RASPBERRYPI_HWMON · 426 unmodified lines
19271926 This driver can also be built as a module. If so, the module
19281927 will be called raspberrypi-hwmon.
19291928
1930−config SENSORS_SA67MCU
1931− tristate "Kontron sa67mcu hardware monitoring driver"
1932− depends on MFD_SL28CPLD || COMPILE_TEST
1933− help
1934− If you say yes here you get support for the voltage and temperature
1935− monitor of the sa67 board management controller.
1936−
1937− This driver can also be built as a module. If so, the module
1938− will be called sa67mcu-hwmon.
1939−
19401929 config SENSORS_SL28CPLD
19411930 tristate "Kontron sl28cpld hardware monitoring driver"
19421931 depends on MFD_SL28CPLD || COMPILE_TEST
@@ -2392,8 +2381,7 @@ config SENSORS_TMP103 · 449 unmodified lines
23922381
23932382 config SENSORS_TMP108
23942383 tristate "Texas Instruments TMP108"
2395− depends on I2C
2396− depends on I3C || !I3C
2384+ depends on I3C_OR_I2C
23972385 select REGMAP_I2C
23982386 select REGMAP_I3C if I3C
23992387 help
drivers/hwmon/Makefile+0−1
@@ -199,7 +199,6 @@ obj-$(CONFIG_SENSORS_PT5161L) += pt5161l.o · 198 unmodified lines
199199 obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
200200 obj-$(CONFIG_SENSORS_QNAP_MCU_HWMON) += qnap-mcu-hwmon.o
201201 obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o
202−obj-$(CONFIG_SENSORS_SA67MCU) += sa67mcu-hwmon.o
203202 obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o
204203 obj-$(CONFIG_SENSORS_SBRMI) += sbrmi.o
205204 obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
drivers/hwmon/aht10.c+4−2
@@ -37,7 +37,9 @@ · 36 unmodified lines
3737 #define AHT10_CMD_MEAS 0b10101100
3838 #define AHT10_CMD_RST 0b10111010
3939
40−#define DHT20_CMD_INIT 0x71
40+#define AHT20_CMD_INIT 0b10111110
41+
42+#define DHT20_CMD_INIT 0b01110001
4143
4244 /*
4345 * Flags in the answer byte/command
@@ -341,7 +343,7 @@ static int aht10_probe(struct i2c_client *client) · 297 unmodified lines
341343 data->meas_size = AHT20_MEAS_SIZE;
342344 data->crc8 = true;
343345 crc8_populate_msb(crc8_table, AHT20_CRC8_POLY);
344− data->init_cmd = AHT10_CMD_INIT;
346+ data->init_cmd = AHT20_CMD_INIT;
345347 break;
346348 case dht20:
347349 data->meas_size = AHT20_MEAS_SIZE;
drivers/hwmon/it87.c+4−1
@@ -3590,10 +3590,13 @@ static int it87_resume(struct device *dev) · 3589 unmodified lines
35903590 {
35913591 struct platform_device *pdev = to_platform_device(dev);
35923592 struct it87_data *data = dev_get_drvdata(dev);
3593+ int err;
35933594
35943595 it87_resume_sio(pdev);
35953596
3596− it87_lock(data);
3597+ err = it87_lock(data);
3598+ if (err)
3599+ return err;
35973600
35983601 it87_check_pwm(dev);
35993602 it87_check_limit_regs(data);
drivers/hwmon/macsmc-hwmon.c+27−26
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222
2323 #include <linux/bitfield.h>
2424 #include <linux/hwmon.h>
25+#include <linux/math64.h>
2526 #include <linux/mfd/macsmc.h>
2627 #include <linux/module.h>
2728 #include <linux/of.h>
@@ -130,7 +131,7 @@ static int macsmc_hwmon_read_ioft_scaled(struct apple_smc *smc, smc_key key, · 102 unmodified lines
130131 if (ret < 0)
131132 return ret;
132133
133− *p = mult_frac(val, scale, 65536);
134+ *p = mul_u64_u32_div(val, scale, 65536);
134135
135136 return 0;
136137 }
@@ -140,7 +141,7 @@ static int macsmc_hwmon_read_ioft_scaled(struct apple_smc *smc, smc_key key, · 3 unmodified lines
140141 * them.
141142 */
142143 static int macsmc_hwmon_read_f32_scaled(struct apple_smc *smc, smc_key key,
143− int *p, int scale)
144+ long *p, int scale)
144145 {
145146 u32 fval;
146147 u64 val;
@@ -162,21 +163,21 @@ static int macsmc_hwmon_read_f32_scaled(struct apple_smc *smc, smc_key key, · 15 unmodified lines
162163 val = 0;
163164 else if (exp < 0)
164165 val >>= -exp;
165− else if (exp != 0 && (val & ~((1UL << (64 - exp)) - 1))) /* overflow */
166+ else if (exp != 0 && (val & ~((1ULL << (64 - exp)) - 1))) /* overflow */
166167 val = U64_MAX;
167168 else
168169 val <<= exp;
169170
170171 if (fval & FLT_SIGN_MASK) {
171− if (val > (-(s64)INT_MIN))
172− *p = INT_MIN;
172+ if (val > (u64)LONG_MAX + 1)
173+ *p = LONG_MIN;
173174 else
174− *p = -val;
175+ *p = -(long)val;
175176 } else {
176− if (val > INT_MAX)
177− *p = INT_MAX;
177+ if (val > (u64)LONG_MAX)
178+ *p = LONG_MAX;
178179 else
179− *p = val;
180+ *p = (long)val;
180181 }
181182
182183 return 0;
@@ -195,7 +196,7 @@ static int macsmc_hwmon_read_key(struct apple_smc *smc, · 12 unmodified lines
195196 switch (sensor->info.type_code) {
196197 /* 32-bit IEEE 754 float */
197198 case __SMC_KEY('f', 'l', 't', ' '): {
198− u32 flt_ = 0;
199+ long flt_ = 0;
199200
200201 ret = macsmc_hwmon_read_f32_scaled(smc, sensor->macsmc_key,
201202 &flt_, scale);
@@ -214,7 +215,10 @@ static int macsmc_hwmon_read_key(struct apple_smc *smc, · 12 unmodified lines
214215 if (ret)
215216 return ret;
216217
217− *val = (long)ioft;
218+ if (ioft > LONG_MAX)
219+ *val = LONG_MAX;
220+ else
221+ *val = (long)ioft;
218222 break;
219223 }
220224 default:
@@ -224,29 +228,26 @@ static int macsmc_hwmon_read_key(struct apple_smc *smc, · 3 unmodified lines
224228 return 0;
225229 }
226230
227−static int macsmc_hwmon_write_f32(struct apple_smc *smc, smc_key key, int value)
231+static int macsmc_hwmon_write_f32(struct apple_smc *smc, smc_key key, long value)
228232 {
229233 u64 val;
230234 u32 fval = 0;
231− int exp = 0, neg;
235+ int exp, neg;
232236
237+ neg = value < 0;
233238 val = abs(value);
234− neg = val != value;
235239
236240 if (val) {
237− int msb = __fls(val) - exp;
238−
239− if (msb > 23) {
240− val >>= msb - FLT_MANT_BIAS;
241− exp -= msb - FLT_MANT_BIAS;
242− } else if (msb < 23) {
243− val <<= FLT_MANT_BIAS - msb;
244− exp += msb;
245− }
241+ exp = __fls(val);
242+
243+ if (exp > 23)
244+ val >>= exp - 23;
245+ else
246+ val <<= 23 - exp;
246247
247248 fval = FIELD_PREP(FLT_SIGN_MASK, neg) |
248249 FIELD_PREP(FLT_EXP_MASK, exp + FLT_EXP_BIAS) |
249− FIELD_PREP(FLT_MANT_MASK, val);
250+ FIELD_PREP(FLT_MANT_MASK, val & FLT_MANT_MASK);
250251 }
251252
252253 return apple_smc_write_u32(smc, key, fval);
@@ -663,8 +664,8 @@ static int macsmc_hwmon_populate_sensors(struct macsmc_hwmon *hwmon, · 410 unmodified lines
663664 if (!hwmon->volt.sensors)
664665 return -ENOMEM;
665666
666− for_each_child_of_node_with_prefix(hwmon_node, key_node, "volt-") {
667− sensor = &hwmon->temp.sensors[hwmon->temp.count];
667+ for_each_child_of_node_with_prefix(hwmon_node, key_node, "voltage-") {
668+ sensor = &hwmon->volt.sensors[hwmon->volt.count];
668669 if (!macsmc_hwmon_create_sensor(hwmon->dev, hwmon->smc, key_node, sensor)) {
669670 sensor->attrs = HWMON_I_INPUT;
670671
drivers/hwmon/max6639.c+1−1
@@ -607,7 +607,7 @@ static int max6639_init_client(struct i2c_client *client, · 606 unmodified lines
607607 return err;
608608
609609 /* Fans PWM polarity high by default */
610− err = regmap_write(data->regmap, MAX6639_REG_FAN_CONFIG2a(i), 0x00);
610+ err = regmap_write(data->regmap, MAX6639_REG_FAN_CONFIG2a(i), 0x02);
611611 if (err)
612612 return err;
613613
drivers/hwmon/pmbus/q54sj108a2.c+10−9
@@ -79,7 +79,8 @@ static ssize_t q54sj108a2_debugfs_read(struct file *file, char __user *buf, · 78 unmodified lines
7979 int idx = *idxp;
8080 struct q54sj108a2_data *psu = to_psu(idxp, idx);
8181 char data[I2C_SMBUS_BLOCK_MAX + 2] = { 0 };
82− char data_char[I2C_SMBUS_BLOCK_MAX + 2] = { 0 };
82+ char data_char[I2C_SMBUS_BLOCK_MAX * 2 + 2] = { 0 };
83+ char *out = data;
8384 char *res;
8485
8586 switch (idx) {
@@ -150,27 +151,27 @@ static ssize_t q54sj108a2_debugfs_read(struct file *file, char __user *buf, · 64 unmodified lines
150151 if (rc < 0)
151152 return rc;
152153
153− res = bin2hex(data, data_char, 32);
154− rc = res - data;
155−
154+ res = bin2hex(data_char, data, rc);
155+ rc = res - data_char;
156+ out = data_char;
156157 break;
157158 case Q54SJ108A2_DEBUGFS_FLASH_KEY:
158159 rc = i2c_smbus_read_block_data(psu->client, PMBUS_FLASH_KEY_WRITE, data);
159160 if (rc < 0)
160161 return rc;
161162
162− res = bin2hex(data, data_char, 4);
163− rc = res - data;
164−
163+ res = bin2hex(data_char, data, rc);
164+ rc = res - data_char;
165+ out = data_char;
165166 break;
166167 default:
167168 return -EINVAL;
168169 }
169170
170− data[rc] = '\n';
171+ out[rc] = '\n';
171172 rc += 2;
172173
173− return simple_read_from_buffer(buf, count, ppos, data, rc);
174+ return simple_read_from_buffer(buf, count, ppos, out, rc);
174175 }
175176
176177 static ssize_t q54sj108a2_debugfs_write(struct file *file, const char __user *buf,
drivers/hwmon/sa67mcu-hwmon.c+0−161
@@ -1,161 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0-only
2−/*
3− * sl67mcu hardware monitoring driver
4− *
5− * Copyright 2025 Kontron Europe GmbH
6− */
7−
8−#include <linux/bitfield.h>
9−#include <linux/hwmon.h>
10−#include <linux/kernel.h>
11−#include <linux/mod_devicetable.h>
12−#include <linux/module.h>
13−#include <linux/platform_device.h>
14−#include <linux/property.h>
15−#include <linux/regmap.h>
16−
17−#define SA67MCU_VOLTAGE(n) (0x00 + ((n) * 2))
18−#define SA67MCU_TEMP(n) (0x04 + ((n) * 2))
19−
20−struct sa67mcu_hwmon {
21− struct regmap *regmap;
22− u32 offset;
23−};
24−
25−static int sa67mcu_hwmon_read(struct device *dev,
26− enum hwmon_sensor_types type, u32 attr,
27− int channel, long *input)
28−{
29− struct sa67mcu_hwmon *hwmon = dev_get_drvdata(dev);
30− unsigned int offset;
31− u8 reg[2];
32− int ret;
33−
34− switch (type) {
35− case hwmon_in:
36− switch (attr) {
37− case hwmon_in_input:
38− offset = hwmon->offset + SA67MCU_VOLTAGE(channel);
39− break;
40− default:
41− return -EOPNOTSUPP;
42− }
43− break;
44− case hwmon_temp:
45− switch (attr) {
46− case hwmon_temp_input:
47− offset = hwmon->offset + SA67MCU_TEMP(channel);
48− break;
49− default:
50− return -EOPNOTSUPP;
51− }
52− break;
53− default:
54− return -EOPNOTSUPP;
55− }
56−
57− /* Reading the low byte will capture the value */
58− ret = regmap_bulk_read(hwmon->regmap, offset, reg, ARRAY_SIZE(reg));
59− if (ret)
60− return ret;
61−
62− *input = reg[1] << 8 | reg[0];
63−
64− /* Temperatures are s16 and in 0.1degC steps. */
65− if (type == hwmon_temp)
66− *input = sign_extend32(*input, 15) * 100;
67−
68− return 0;
69−}
70−
71−static const struct hwmon_channel_info * const sa67mcu_hwmon_info[] = {
72− HWMON_CHANNEL_INFO(in,
73− HWMON_I_INPUT | HWMON_I_LABEL,
74− HWMON_I_INPUT | HWMON_I_LABEL),
75− HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
76− NULL
77−};
78−
79−static const char *const sa67mcu_hwmon_in_labels[] = {
80− "VDDIN",
81− "VDD_RTC",
82−};
83−
84−static int sa67mcu_hwmon_read_string(struct device *dev,
85− enum hwmon_sensor_types type, u32 attr,
86− int channel, const char **str)
87−{
88− switch (type) {
89− case hwmon_in:
90− switch (attr) {
91− case hwmon_in_label:
92− *str = sa67mcu_hwmon_in_labels[channel];
93− return 0;
94− default:
95− return -EOPNOTSUPP;
96− }
97− default:
98− return -EOPNOTSUPP;
99− }
100−}
101−
102−static const struct hwmon_ops sa67mcu_hwmon_ops = {
103− .visible = 0444,
104− .read = sa67mcu_hwmon_read,
105− .read_string = sa67mcu_hwmon_read_string,
106−};
107−
108−static const struct hwmon_chip_info sa67mcu_hwmon_chip_info = {
109− .ops = &sa67mcu_hwmon_ops,
110− .info = sa67mcu_hwmon_info,
111−};
112−
113−static int sa67mcu_hwmon_probe(struct platform_device *pdev)
114−{
115− struct sa67mcu_hwmon *hwmon;
116− struct device *hwmon_dev;
117− int ret;
118−
119− if (!pdev->dev.parent)
120− return -ENODEV;
121−
122− hwmon = devm_kzalloc(&pdev->dev, sizeof(*hwmon), GFP_KERNEL);
123− if (!hwmon)
124− return -ENOMEM;
125−
126− hwmon->regmap = dev_get_regmap(pdev->dev.parent, NULL);
127− if (!hwmon->regmap)
128− return -ENODEV;
129−
130− ret = device_property_read_u32(&pdev->dev, "reg", &hwmon->offset);
131− if (ret)
132− return -EINVAL;
133−
134− hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev,
135− "sa67mcu_hwmon", hwmon,
136− &sa67mcu_hwmon_chip_info,
137− NULL);
138− if (IS_ERR(hwmon_dev))
139− dev_err(&pdev->dev, "failed to register as hwmon device");
140−
141− return PTR_ERR_OR_ZERO(hwmon_dev);
142−}
143−
144−static const struct of_device_id sa67mcu_hwmon_of_match[] = {
145− { .compatible = "kontron,sa67mcu-hwmon", },
146− {}
147−};
148−MODULE_DEVICE_TABLE(of, sa67mcu_hwmon_of_match);
149−
150−static struct platform_driver sa67mcu_hwmon_driver = {
151− .probe = sa67mcu_hwmon_probe,
152− .driver = {
153− .name = "sa67mcu-hwmon",
154− .of_match_table = sa67mcu_hwmon_of_match,
155− },
156−};
157−module_platform_driver(sa67mcu_hwmon_driver);
158−
159−MODULE_DESCRIPTION("sa67mcu Hardware Monitoring Driver");
160−MODULE_AUTHOR("Michael Walle <mwalle@kernel.org>");
161−MODULE_LICENSE("GPL");
drivers/i2c/busses/i2c-i801.c+10−4
@@ -310,9 +310,10 @@ struct i801_priv { · 309 unmodified lines
310310
311311 /*
312312 * If set to true the host controller registers are reserved for
313− * ACPI AML use.
313+ * ACPI AML use. Needs extra protection by acpi_lock.
314314 */
315315 bool acpi_reserved;
316+ struct mutex acpi_lock;
316317 };
317318
318319 #define FEATURE_SMBUS_PEC BIT(0)
@@ -894,8 +895,11 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, · 575 unmodified lines
894895 int hwpec, ret;
895896 struct i801_priv *priv = i2c_get_adapdata(adap);
896897
897− if (priv->acpi_reserved)
898+ mutex_lock(&priv->acpi_lock);
899+ if (priv->acpi_reserved) {
900+ mutex_unlock(&priv->acpi_lock);
898901 return -EBUSY;
902+ }
899903
900904 pm_runtime_get_sync(&priv->pci_dev->dev);
901905
@@ -935,6 +939,7 @@ out: · 33 unmodified lines
935939 iowrite8(SMBHSTSTS_INUSE_STS | STATUS_FLAGS, SMBHSTSTS(priv));
936940
937941 pm_runtime_put_autosuspend(&priv->pci_dev->dev);
942+ mutex_unlock(&priv->acpi_lock);
938943 return ret;
939944 }
940945
@@ -1465,7 +1470,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits, · 524 unmodified lines
14651470 * further access from the driver itself. This device is now owned
14661471 * by the system firmware.
14671472 */
1468− i2c_lock_bus(&priv->adapter, I2C_LOCK_SEGMENT);
1473+ mutex_lock(&priv->acpi_lock);
14691474
14701475 if (!priv->acpi_reserved && i801_acpi_is_smbus_ioport(priv, address)) {
14711476 priv->acpi_reserved = true;
@@ -1485,7 +1490,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits, · 13 unmodified lines
14851490 else
14861491 status = acpi_os_write_port(address, (u32)*value, bits);
14871492
1488− i2c_unlock_bus(&priv->adapter, I2C_LOCK_SEGMENT);
1493+ mutex_unlock(&priv->acpi_lock);
14891494
14901495 return status;
14911496 }
@@ -1545,6 +1550,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) · 53 unmodified lines
15451550 priv->adapter.dev.parent = &dev->dev;
15461551 acpi_use_parent_companion(&priv->adapter.dev);
15471552 priv->adapter.retries = 3;
1553+ mutex_init(&priv->acpi_lock);
15481554
15491555 priv->pci_dev = dev;
15501556 priv->features = id->driver_data;
drivers/i3c/Kconfig+12−0
@@ -22,3 +22,15 @@ menuconfig I3C · 21 unmodified lines
2222 if I3C
2323 source "drivers/i3c/master/Kconfig"
2424 endif # I3C
25+
26+config I3C_OR_I2C
27+ tristate
28+ default m if I3C=m
29+ default I2C
30+ help
31+ Device drivers using module_i3c_i2c_driver() can use either
32+ i2c or i3c hosts, but cannot be built-in for the kernel when
33+ CONFIG_I3C=m.
34+
35+ Add 'depends on I2C_OR_I3C' in Kconfig for those drivers to
36+ get the correct dependencies.
drivers/i3c/master/dw-i3c-master.c+4−2
@@ -1024,7 +1024,7 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev, · 1023 unmodified lines
10241024 master->free_pos &= ~BIT(pos);
10251025 }
10261026
1027− writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
1027+ writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr) | DEV_ADDR_TABLE_SIR_REJECT,
10281028 master->regs +
10291029 DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
10301030
@@ -1053,7 +1053,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) · 22 unmodified lines
10531053 master->free_pos &= ~BIT(pos);
10541054 i3c_dev_set_master_data(dev, data);
10551055
1056− writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr),
1056+ writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr) | DEV_ADDR_TABLE_SIR_REJECT,
10571057 master->regs +
10581058 DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
10591059
@@ -1659,6 +1659,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, · 599 unmodified lines
16591659 pm_runtime_get_noresume(&pdev->dev);
16601660
16611661 INIT_WORK(&master->hj_work, dw_i3c_hj_work);
1662+
1663+ device_set_of_node_from_dev(&master->base.i2c.dev, &pdev->dev);
16621664 ret = i3c_master_register(&master->base, &pdev->dev,
16631665 &dw_mipi_i3c_ops, false);
16641666 if (ret)
drivers/i3c/master/mipi-i3c-hci/cmd.h+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #define CMD_0_TOC W0_BIT_(31)
1818 #define CMD_0_ROC W0_BIT_(30)
1919 #define CMD_0_ATTR W0_MASK(2, 0)
20+#define CMD_0_TID W0_MASK(6, 3)
2021
2122 /*
2223 * Response Descriptor Structure
drivers/i3c/master/mipi-i3c-hci/cmd_v1.c+3−5
@@ -331,12 +331,10 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci) · 330 unmodified lines
331331 CMD_A0_ROC | CMD_A0_TOC;
332332 xfer->cmd_desc[1] = 0;
333333 xfer->completion = &done;
334− hci->io->queue_xfer(hci, xfer, 1);
335− if (!wait_for_completion_timeout(&done, HZ) &&
336− hci->io->dequeue_xfer(hci, xfer, 1)) {
337− ret = -ETIME;
334+ xfer->timeout = HZ;
335+ ret = i3c_hci_process_xfer(hci, xfer, 1);
336+ if (ret)
338337 break;
339− }
340338 if ((RESP_STATUS(xfer->response) == RESP_ERR_ADDR_HEADER ||
341339 RESP_STATUS(xfer->response) == RESP_ERR_NACK) &&
342340 RESP_DATA_LENGTH(xfer->response) == 1) {
drivers/i3c/master/mipi-i3c-hci/cmd_v2.c+3−5
@@ -253,6 +253,7 @@ static int hci_cmd_v2_daa(struct i3c_hci *hci) · 252 unmodified lines
253253 xfer[0].rnw = true;
254254 xfer[0].cmd_desc[1] = CMD_A1_DATA_LENGTH(8);
255255 xfer[1].completion = &done;
256+ xfer[1].timeout = HZ;
256257
257258 for (;;) {
258259 ret = i3c_master_get_free_addr(&hci->master, next_addr);
@@ -272,12 +273,9 @@ static int hci_cmd_v2_daa(struct i3c_hci *hci) · 13 unmodified lines
272273 CMD_A0_ASSIGN_ADDRESS(next_addr) |
273274 CMD_A0_ROC |
274275 CMD_A0_TOC;
275− hci->io->queue_xfer(hci, xfer, 2);
276− if (!wait_for_completion_timeout(&done, HZ) &&
277− hci->io->dequeue_xfer(hci, xfer, 2)) {
278− ret = -ETIME;
276+ ret = i3c_hci_process_xfer(hci, xfer, 2);
277+ if (ret)
279278 break;
280− }
281279 if (RESP_STATUS(xfer[0].response) != RESP_SUCCESS) {
282280 ret = 0; /* no more devices to be assigned */
283281 break;
drivers/i3c/master/mipi-i3c-hci/core.c+90−53
@@ -152,7 +152,11 @@ static int i3c_hci_bus_init(struct i3c_master_controller *m) · 151 unmodified lines
152152 if (hci->quirks & HCI_QUIRK_RESP_BUF_THLD)
153153 amd_set_resp_buf_thld(hci);
154154
155− reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE);
155+ scoped_guard(spinlock_irqsave, &hci->lock)
156+ hci->irq_inactive = false;
157+
158+ /* Enable bus with Hot-Join disabled */
159+ reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE | HC_CONTROL_HOT_JOIN_CTRL);
156160 dev_dbg(&hci->master.dev, "HC_CONTROL = %#x", reg_read(HC_CONTROL));
157161
158162 return 0;
@@ -177,21 +181,51 @@ static int i3c_hci_bus_disable(struct i3c_hci *hci) · 18 unmodified lines
177181 return ret;
178182 }
179183
184+static int i3c_hci_software_reset(struct i3c_hci *hci)
185+{
186+ u32 regval;
187+ int ret;
188+
189+ /*
190+ * SOFT_RST must be clear before we write to it.
191+ * Then we must wait until it clears again.
192+ */
193+ ret = readx_poll_timeout(reg_read, RESET_CONTROL, regval,
194+ !(regval & SOFT_RST), 0, 10 * USEC_PER_MSEC);
195+ if (ret) {
196+ dev_err(&hci->master.dev, "%s: Software reset stuck\n", __func__);
197+ return ret;
198+ }
199+
200+ reg_write(RESET_CONTROL, SOFT_RST);
201+
202+ ret = readx_poll_timeout(reg_read, RESET_CONTROL, regval,
203+ !(regval & SOFT_RST), 0, 10 * USEC_PER_MSEC);
204+ if (ret) {
205+ dev_err(&hci->master.dev, "%s: Software reset failed\n", __func__);
206+ return ret;
207+ }
208+
209+ return 0;
210+}
211+
180212 void i3c_hci_sync_irq_inactive(struct i3c_hci *hci)
181213 {
182214 struct platform_device *pdev = to_platform_device(hci->master.dev.parent);
183215 int irq = platform_get_irq(pdev, 0);
184216
185217 reg_write(INTR_SIGNAL_ENABLE, 0x0);
186− hci->irq_inactive = true;
187218 synchronize_irq(irq);
219+ scoped_guard(spinlock_irqsave, &hci->lock)
220+ hci->irq_inactive = true;
188221 }
189222
190223 static void i3c_hci_bus_cleanup(struct i3c_master_controller *m)
191224 {
192225 struct i3c_hci *hci = to_i3c_hci(m);
193226
194− i3c_hci_bus_disable(hci);
227+ if (i3c_hci_bus_disable(hci))
228+ i3c_hci_software_reset(hci);
195229 hci->io->cleanup(hci);
196230 }
197231
@@ -212,6 +246,36 @@ void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci) · 14 unmodified lines
212246 reg_write(DCT_SECTION, FIELD_PREP(DCT_TABLE_INDEX, 0));
213247 }
214248
249+int i3c_hci_process_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n)
250+{
251+ struct completion *done = xfer[n - 1].completion;
252+ unsigned long timeout = xfer[n - 1].timeout;
253+ int ret;
254+
255+ ret = hci->io->queue_xfer(hci, xfer, n);
256+ if (ret)
257+ return ret;
258+
259+ if (!wait_for_completion_timeout(done, timeout)) {
260+ if (hci->io->dequeue_xfer(hci, xfer, n)) {
261+ dev_err(&hci->master.dev, "%s: timeout error\n", __func__);
262+ return -ETIMEDOUT;
263+ }
264+ return 0;
265+ }
266+
267+ if (hci->io->handle_error) {
268+ bool error = false;
269+
270+ for (int i = 0; i < n && !error; i++)
271+ error = RESP_STATUS(xfer[i].response);
272+ if (error)
273+ return hci->io->handle_error(hci, xfer, n);
274+ }
275+
276+ return 0;
277+}
278+
215279 static int i3c_hci_send_ccc_cmd(struct i3c_master_controller *m,
216280 struct i3c_ccc_cmd *ccc)
217281 {
@@ -252,18 +316,14 @@ static int i3c_hci_send_ccc_cmd(struct i3c_master_controller *m, · 34 unmodified lines
252316 last = i - 1;
253317 xfer[last].cmd_desc[0] |= CMD_0_TOC;
254318 xfer[last].completion = &done;
319+ xfer[last].timeout = HZ;
255320
256321 if (prefixed)
257322 xfer--;
258323
259− ret = hci->io->queue_xfer(hci, xfer, nxfers);
324+ ret = i3c_hci_process_xfer(hci, xfer, nxfers);
260325 if (ret)
261326 goto out;
262− if (!wait_for_completion_timeout(&done, HZ) &&
263− hci->io->dequeue_xfer(hci, xfer, nxfers)) {
264− ret = -ETIME;
265− goto out;
266− }
267327 for (i = prefixed; i < nxfers; i++) {
268328 if (ccc->rnw)
269329 ccc->dests[i - prefixed].payload.len =
@@ -334,15 +394,11 @@ static int i3c_hci_i3c_xfers(struct i3c_dev_desc *dev, · 64 unmodified lines
334394 last = i - 1;
335395 xfer[last].cmd_desc[0] |= CMD_0_TOC;
336396 xfer[last].completion = &done;
397+ xfer[last].timeout = HZ;
337398
338− ret = hci->io->queue_xfer(hci, xfer, nxfers);
399+ ret = i3c_hci_process_xfer(hci, xfer, nxfers);
339400 if (ret)
340401 goto out;
341− if (!wait_for_completion_timeout(&done, HZ) &&
342− hci->io->dequeue_xfer(hci, xfer, nxfers)) {
343− ret = -ETIME;
344− goto out;
345− }
346402 for (i = 0; i < nxfers; i++) {
347403 if (i3c_xfers[i].rnw)
348404 i3c_xfers[i].len = RESP_DATA_LENGTH(xfer[i].response);
@@ -382,15 +438,11 @@ static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev, · 33 unmodified lines
382438 last = i - 1;
383439 xfer[last].cmd_desc[0] |= CMD_0_TOC;
384440 xfer[last].completion = &done;
441+ xfer[last].timeout = m->i2c.timeout;
385442
386− ret = hci->io->queue_xfer(hci, xfer, nxfers);
443+ ret = i3c_hci_process_xfer(hci, xfer, nxfers);
387444 if (ret)
388445 goto out;
389− if (!wait_for_completion_timeout(&done, m->i2c.timeout) &&
390− hci->io->dequeue_xfer(hci, xfer, nxfers)) {
391− ret = -ETIME;
392− goto out;
393− }
394446 for (i = 0; i < nxfers; i++) {
395447 if (RESP_STATUS(xfer[i].response) != RESP_SUCCESS) {
396448 ret = -EIO;
@@ -566,6 +618,8 @@ static irqreturn_t i3c_hci_irq_handler(int irq, void *dev_id) · 169 unmodified lines
566618 irqreturn_t result = IRQ_NONE;
567619 u32 val;
568620
621+ guard(spinlock)(&hci->lock);
622+
569623 /*
570624 * The IRQ can be shared, so the handler may be called when the IRQ is
571625 * due to a different device. That could happen when runtime suspended,
@@ -601,34 +655,6 @@ static irqreturn_t i3c_hci_irq_handler(int irq, void *dev_id) · 29 unmodified lines
601655 return result;
602656 }
603657
604−static int i3c_hci_software_reset(struct i3c_hci *hci)
605−{
606− u32 regval;
607− int ret;
608−
609− /*
610− * SOFT_RST must be clear before we write to it.
611− * Then we must wait until it clears again.
612− */
613− ret = readx_poll_timeout(reg_read, RESET_CONTROL, regval,
614− !(regval & SOFT_RST), 0, 10 * USEC_PER_MSEC);
615− if (ret) {
616− dev_err(&hci->master.dev, "%s: Software reset stuck\n", __func__);
617− return ret;
618− }
619−
620− reg_write(RESET_CONTROL, SOFT_RST);
621−
622− ret = readx_poll_timeout(reg_read, RESET_CONTROL, regval,
623− !(regval & SOFT_RST), 0, 10 * USEC_PER_MSEC);
624− if (ret) {
625− dev_err(&hci->master.dev, "%s: Software reset failed\n", __func__);
626− return ret;
627− }
628−
629− return 0;
630−}
631−
632658 static inline bool is_version_1_1_or_newer(struct i3c_hci *hci)
633659 {
634660 return hci->version_major > 1 || (hci->version_major == 1 && hci->version_minor > 0);
@@ -739,8 +765,12 @@ static int i3c_hci_runtime_suspend(struct device *dev) · 104 unmodified lines
739765 int ret;
740766
741767 ret = i3c_hci_bus_disable(hci);
742− if (ret)
768+ if (ret) {
769+ /* Fall back to software reset to disable the bus */
770+ ret = i3c_hci_software_reset(hci);
771+ i3c_hci_sync_irq_inactive(hci);
743772 return ret;
773+ }
744774
745775 hci->io->suspend(hci);
746776
@@ -760,11 +790,13 @@ static int i3c_hci_runtime_resume(struct device *dev) · 13 unmodified lines
760790
761791 mipi_i3c_hci_dat_v1.restore(hci);
762792
763− hci->irq_inactive = false;
764−
765793 hci->io->resume(hci);
766794
767− reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE);
795+ scoped_guard(spinlock_irqsave, &hci->lock)
796+ hci->irq_inactive = false;
797+
798+ /* Enable bus with Hot-Join disabled */
799+ reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE | HC_CONTROL_HOT_JOIN_CTRL);
768800
769801 return 0;
770802 }
@@ -924,6 +956,9 @@ static int i3c_hci_probe(struct platform_device *pdev) · 153 unmodified lines
924956 if (!hci)
925957 return -ENOMEM;
926958
959+ spin_lock_init(&hci->lock);
960+ mutex_init(&hci->control_mutex);
961+
927962 /*
928963 * Multi-bus instances share the same MMIO address range, but not
929964 * necessarily in separate contiguous sub-ranges. To avoid overlapping
@@ -950,6 +985,8 @@ static int i3c_hci_probe(struct platform_device *pdev) · 20 unmodified lines
950985 if (ret)
951986 return ret;
952987
988+ hci->irq_inactive = true;
989+
953990 irq = platform_get_irq(pdev, 0);
954991 ret = devm_request_irq(&pdev->dev, irq, i3c_hci_irq_handler,
955992 IRQF_SHARED, NULL, hci);
drivers/i3c/master/mipi-i3c-hci/dma.c+84−74
@@ -129,9 +129,8 @@ struct hci_rh_data { · 128 unmodified lines
129129 dma_addr_t xfer_dma, resp_dma, ibi_status_dma, ibi_data_dma;
130130 unsigned int xfer_entries, ibi_status_entries, ibi_chunks_total;
131131 unsigned int xfer_struct_sz, resp_struct_sz, ibi_status_sz, ibi_chunk_sz;
132− unsigned int done_ptr, ibi_chunk_ptr;
132+ unsigned int done_ptr, ibi_chunk_ptr, xfer_space;
133133 struct hci_xfer **src_xfers;
134− spinlock_t lock;
135134 struct completion op_done;
136135 };
137136
@@ -261,6 +260,7 @@ ring_ready: · 123 unmodified lines
261260
262261 rh->done_ptr = 0;
263262 rh->ibi_chunk_ptr = 0;
263+ rh->xfer_space = rh->xfer_entries;
264264 }
265265
266266 static void hci_dma_init_rings(struct i3c_hci *hci)
@@ -344,7 +344,6 @@ static int hci_dma_init(struct i3c_hci *hci) · 77 unmodified lines
344344 goto err_out;
345345 rh = &rings->headers[i];
346346 rh->regs = hci->base_regs + offset;
347− spin_lock_init(&rh->lock);
348347 init_completion(&rh->op_done);
349348
350349 rh->xfer_entries = XFER_RING_ENTRIES;
@@ -439,26 +438,63 @@ static void hci_dma_unmap_xfer(struct i3c_hci *hci, · 88 unmodified lines
439438 }
440439 }
441440
441+static struct i3c_dma *hci_dma_map_xfer(struct device *dev, struct hci_xfer *xfer)
442+{
443+ enum dma_data_direction dir = xfer->rnw ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
444+ bool need_bounce = device_iommu_mapped(dev) && xfer->rnw && (xfer->data_len & 3);
445+
446+ return i3c_master_dma_map_single(dev, xfer->data, xfer->data_len, need_bounce, dir);
447+}
448+
449+static int hci_dma_map_xfer_list(struct i3c_hci *hci, struct device *dev,
450+ struct hci_xfer *xfer_list, int n)
451+{
452+ for (int i = 0; i < n; i++) {
453+ struct hci_xfer *xfer = xfer_list + i;
454+
455+ if (!xfer->data)
456+ continue;
457+
458+ xfer->dma = hci_dma_map_xfer(dev, xfer);
459+ if (!xfer->dma) {
460+ hci_dma_unmap_xfer(hci, xfer_list, i);
461+ return -ENOMEM;
462+ }
463+ }
464+
465+ return 0;
466+}
467+
442468 static int hci_dma_queue_xfer(struct i3c_hci *hci,
443469 struct hci_xfer *xfer_list, int n)
444470 {
445471 struct hci_rings_data *rings = hci->io_data;
446472 struct hci_rh_data *rh;
447473 unsigned int i, ring, enqueue_ptr;
448− u32 op1_val, op2_val;
474+ u32 op1_val;
475+ int ret;
476+
477+ ret = hci_dma_map_xfer_list(hci, rings->sysdev, xfer_list, n);
478+ if (ret)
479+ return ret;
449480
450481 /* For now we only use ring 0 */
451482 ring = 0;
452483 rh = &rings->headers[ring];
453484
485+ spin_lock_irq(&hci->lock);
486+
487+ if (n > rh->xfer_space) {
488+ spin_unlock_irq(&hci->lock);
489+ hci_dma_unmap_xfer(hci, xfer_list, n);
490+ return -EBUSY;
491+ }
492+
454493 op1_val = rh_reg_read(RING_OPERATION1);
455494 enqueue_ptr = FIELD_GET(RING_OP1_CR_ENQ_PTR, op1_val);
456495 for (i = 0; i < n; i++) {
457496 struct hci_xfer *xfer = xfer_list + i;
458497 u32 *ring_data = rh->xfer + rh->xfer_struct_sz * enqueue_ptr;
459− enum dma_data_direction dir = xfer->rnw ? DMA_FROM_DEVICE :
460− DMA_TO_DEVICE;
461− bool need_bounce;
462498
463499 /* store cmd descriptor */
464500 *ring_data++ = xfer->cmd_desc[0];
@@ -477,18 +513,6 @@ static int hci_dma_queue_xfer(struct i3c_hci *hci, · 12 unmodified lines
477513
478514 /* 2nd and 3rd words of Data Buffer Descriptor Structure */
479515 if (xfer->data) {
480− need_bounce = device_iommu_mapped(rings->sysdev) &&
481− xfer->rnw &&
482− xfer->data_len != ALIGN(xfer->data_len, 4);
483− xfer->dma = i3c_master_dma_map_single(rings->sysdev,
484− xfer->data,
485− xfer->data_len,
486− need_bounce,
487− dir);
488− if (!xfer->dma) {
489− hci_dma_unmap_xfer(hci, xfer_list, i);
490− return -ENOMEM;
491− }
492516 *ring_data++ = lower_32_bits(xfer->dma->addr);
493517 *ring_data++ = upper_32_bits(xfer->dma->addr);
494518 } else {
@@ -503,26 +527,14 @@ static int hci_dma_queue_xfer(struct i3c_hci *hci, · 8 unmodified lines
503527 xfer->ring_entry = enqueue_ptr;
504528
505529 enqueue_ptr = (enqueue_ptr + 1) % rh->xfer_entries;
506−
507− /*
508− * We may update the hardware view of the enqueue pointer
509− * only if we didn't reach its dequeue pointer.
510− */
511− op2_val = rh_reg_read(RING_OPERATION2);
512− if (enqueue_ptr == FIELD_GET(RING_OP2_CR_DEQ_PTR, op2_val)) {
513− /* the ring is full */
514− hci_dma_unmap_xfer(hci, xfer_list, i + 1);
515− return -EBUSY;
516− }
517530 }
518531
519− /* take care to update the hardware enqueue pointer atomically */
520− spin_lock_irq(&rh->lock);
521− op1_val = rh_reg_read(RING_OPERATION1);
532+ rh->xfer_space -= n;
533+
522534 op1_val &= ~RING_OP1_CR_ENQ_PTR;
523535 op1_val |= FIELD_PREP(RING_OP1_CR_ENQ_PTR, enqueue_ptr);
524536 rh_reg_write(RING_OPERATION1, op1_val);
525− spin_unlock_irq(&rh->lock);
537+ spin_unlock_irq(&hci->lock);
526538
527539 return 0;
528540 }
@@ -534,18 +546,29 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci, · 5 unmodified lines
534546 struct hci_rh_data *rh = &rings->headers[xfer_list[0].ring_number];
535547 unsigned int i;
536548 bool did_unqueue = false;
537−
538− /* stop the ring */
539− rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
540− if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
541− /*
542− * We're deep in it if ever this condition is ever met.
543− * Hardware might still be writing to memory, etc.
544− */
545− dev_crit(&hci->master.dev, "unable to abort the ring\n");
546− WARN_ON(1);
549+ u32 ring_status;
550+
551+ guard(mutex)(&hci->control_mutex);
552+
553+ ring_status = rh_reg_read(RING_STATUS);
554+ if (ring_status & RING_STATUS_RUNNING) {
555+ /* stop the ring */
556+ reinit_completion(&rh->op_done);
557+ rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT);
558+ wait_for_completion_timeout(&rh->op_done, HZ);
559+ ring_status = rh_reg_read(RING_STATUS);
560+ if (ring_status & RING_STATUS_RUNNING) {
561+ /*
562+ * We're deep in it if ever this condition is ever met.
563+ * Hardware might still be writing to memory, etc.
564+ */
565+ dev_crit(&hci->master.dev, "unable to abort the ring\n");
566+ WARN_ON(1);
567+ }
547568 }
548569
570+ spin_lock_irq(&hci->lock);
571+
549572 for (i = 0; i < n; i++) {
550573 struct hci_xfer *xfer = xfer_list + i;
551574 int idx = xfer->ring_entry;
@@ -559,7 +582,7 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci, · 7 unmodified lines
559582 u32 *ring_data = rh->xfer + rh->xfer_struct_sz * idx;
560583
561584 /* store no-op cmd descriptor */
562− *ring_data++ = FIELD_PREP(CMD_0_ATTR, 0x7);
585+ *ring_data++ = FIELD_PREP(CMD_0_ATTR, 0x7) | FIELD_PREP(CMD_0_TID, xfer->cmd_tid);
563586 *ring_data++ = 0;
564587 if (hci->cmd == &mipi_i3c_hci_cmd_v2) {
565588 *ring_data++ = 0;
@@ -577,15 +600,25 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci, · 11 unmodified lines
577600 }
578601
579602 /* restart the ring */
603+ mipi_i3c_hci_resume(hci);
580604 rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE);
605+ rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_RUN_STOP);
606+
607+ spin_unlock_irq(&hci->lock);
581608
582609 return did_unqueue;
583610 }
584611
612+static int hci_dma_handle_error(struct i3c_hci *hci, struct hci_xfer *xfer_list, int n)
613+{
614+ return hci_dma_dequeue_xfer(hci, xfer_list, n) ? -EIO : 0;
615+}
616+
585617 static void hci_dma_xfer_done(struct i3c_hci *hci, struct hci_rh_data *rh)
586618 {
587619 u32 op1_val, op2_val, resp, *ring_resp;
588620 unsigned int tid, done_ptr = rh->done_ptr;
621+ unsigned int done_cnt = 0;
589622 struct hci_xfer *xfer;
590623
591624 for (;;) {
@@ -603,6 +636,7 @@ static void hci_dma_xfer_done(struct i3c_hci *hci, struct hci_rh_data *rh) · 11 unmodified lines
603636 dev_dbg(&hci->master.dev, "orphaned ring entry");
604637 } else {
605638 hci_dma_unmap_xfer(hci, xfer, 1);
639+ rh->src_xfers[done_ptr] = NULL;
606640 xfer->ring_entry = -1;
607641 xfer->response = resp;
608642 if (tid != xfer->cmd_tid) {
@@ -617,15 +651,14 @@ static void hci_dma_xfer_done(struct i3c_hci *hci, struct hci_rh_data *rh) · 8 unmodified lines
617651
618652 done_ptr = (done_ptr + 1) % rh->xfer_entries;
619653 rh->done_ptr = done_ptr;
654+ done_cnt += 1;
620655 }
621656
622− /* take care to update the software dequeue pointer atomically */
623− spin_lock(&rh->lock);
657+ rh->xfer_space += done_cnt;
624658 op1_val = rh_reg_read(RING_OPERATION1);
625659 op1_val &= ~RING_OP1_CR_SW_DEQ_PTR;
626660 op1_val |= FIELD_PREP(RING_OP1_CR_SW_DEQ_PTR, done_ptr);
627661 rh_reg_write(RING_OPERATION1, op1_val);
628− spin_unlock(&rh->lock);
629662 }
630663
631664 static int hci_dma_request_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev,
@@ -805,13 +838,10 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh) · 173 unmodified lines
805838 i3c_master_queue_ibi(dev, slot);
806839
807840 done:
808− /* take care to update the ibi dequeue pointer atomically */
809− spin_lock(&rh->lock);
810841 op1_val = rh_reg_read(RING_OPERATION1);
811842 op1_val &= ~RING_OP1_IBI_DEQ_PTR;
812843 op1_val |= FIELD_PREP(RING_OP1_IBI_DEQ_PTR, deq_ptr);
813844 rh_reg_write(RING_OPERATION1, op1_val);
814− spin_unlock(&rh->lock);
815845
816846 /* update the chunk pointer */
817847 rh->ibi_chunk_ptr += ibi_chunks;
@@ -845,29 +875,8 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci) · 27 unmodified lines
845875 hci_dma_xfer_done(hci, rh);
846876 if (status & INTR_RING_OP)
847877 complete(&rh->op_done);
848−
849− if (status & INTR_TRANSFER_ABORT) {
850− u32 ring_status;
851−
852− dev_notice_ratelimited(&hci->master.dev,
853− "Ring %d: Transfer Aborted\n", i);
854− mipi_i3c_hci_resume(hci);
855− ring_status = rh_reg_read(RING_STATUS);
856− if (!(ring_status & RING_STATUS_RUNNING) &&
857− status & INTR_TRANSFER_COMPLETION &&
858− status & INTR_TRANSFER_ERR) {
859− /*
860− * Ring stop followed by run is an Intel
861− * specific required quirk after resuming the
862− * halted controller. Do it only when the ring
863− * is not in running state after a transfer
864− * error.
865− */
866− rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE);
867− rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE |
868− RING_CTRL_RUN_STOP);
869− }
870− }
878+ if (status & INTR_TRANSFER_ABORT)
879+ dev_dbg(&hci->master.dev, "Ring %d: Transfer Aborted\n", i);
871880 if (status & INTR_IBI_RING_FULL)
872881 dev_err_ratelimited(&hci->master.dev,
873882 "Ring %d: IBI Ring Full Condition\n", i);
@@ -883,6 +892,7 @@ const struct hci_io_ops mipi_i3c_hci_dma = { · 9 unmodified lines
883892 .cleanup = hci_dma_cleanup,
884893 .queue_xfer = hci_dma_queue_xfer,
885894 .dequeue_xfer = hci_dma_dequeue_xfer,
895+ .handle_error = hci_dma_handle_error,
886896 .irq_handler = hci_dma_irq_handler,
887897 .request_ibi = hci_dma_request_ibi,
888898 .free_ibi = hci_dma_free_ibi,
drivers/i3c/master/mipi-i3c-hci/hci.h+5−0
@@ -50,6 +50,8 @@ struct i3c_hci { · 49 unmodified lines
5050 const struct hci_io_ops *io;
5151 void *io_data;
5252 const struct hci_cmd_ops *cmd;
53+ spinlock_t lock;
54+ struct mutex control_mutex;
5355 atomic_t next_cmd_tid;
5456 bool irq_inactive;
5557 u32 caps;
@@ -87,6 +89,7 @@ struct hci_xfer { · 31 unmodified lines
8789 unsigned int data_len;
8890 unsigned int cmd_tid;
8991 struct completion *completion;
92+ unsigned long timeout;
9093 union {
9194 struct {
9295 /* PIO specific */
@@ -120,6 +123,7 @@ struct hci_io_ops { · 27 unmodified lines
120123 bool (*irq_handler)(struct i3c_hci *hci);
121124 int (*queue_xfer)(struct i3c_hci *hci, struct hci_xfer *xfer, int n);
122125 bool (*dequeue_xfer)(struct i3c_hci *hci, struct hci_xfer *xfer, int n);
126+ int (*handle_error)(struct i3c_hci *hci, struct hci_xfer *xfer, int n);
123127 int (*request_ibi)(struct i3c_hci *hci, struct i3c_dev_desc *dev,
124128 const struct i3c_ibi_setup *req);
125129 void (*free_ibi)(struct i3c_hci *hci, struct i3c_dev_desc *dev);
@@ -154,5 +158,6 @@ void mipi_i3c_hci_dct_index_reset(struct i3c_hci *hci); · 28 unmodified lines
154158 void amd_set_od_pp_timing(struct i3c_hci *hci);
155159 void amd_set_resp_buf_thld(struct i3c_hci *hci);
156160 void i3c_hci_sync_irq_inactive(struct i3c_hci *hci);
161+int i3c_hci_process_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n);
157162
158163 #endif
drivers/i3c/master/mipi-i3c-hci/pio.c+5−11
@@ -123,7 +123,6 @@ struct hci_pio_ibi_data { · 122 unmodified lines
123123 };
124124
125125 struct hci_pio_data {
126− spinlock_t lock;
127126 struct hci_xfer *curr_xfer, *xfer_queue;
128127 struct hci_xfer *curr_rx, *rx_queue;
129128 struct hci_xfer *curr_tx, *tx_queue;
@@ -212,7 +211,6 @@ static int hci_pio_init(struct i3c_hci *hci) · 82 unmodified lines
212211 return -ENOMEM;
213212
214213 hci->io_data = pio;
215− spin_lock_init(&pio->lock);
216214
217215 __hci_pio_init(hci, &size_val);
218216
@@ -631,7 +629,7 @@ static int hci_pio_queue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n) · 412 unmodified lines
631629 xfer[i].data_left = xfer[i].data_len;
632630 }
633631
634− spin_lock_irq(&pio->lock);
632+ spin_lock_irq(&hci->lock);
635633 prev_queue_tail = pio->xfer_queue;
636634 pio->xfer_queue = &xfer[n - 1];
637635 if (pio->curr_xfer) {
@@ -645,7 +643,7 @@ static int hci_pio_queue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n) · 7 unmodified lines
645643 pio_reg_read(INTR_STATUS),
646644 pio_reg_read(INTR_SIGNAL_ENABLE));
647645 }
648− spin_unlock_irq(&pio->lock);
646+ spin_unlock_irq(&hci->lock);
649647 return 0;
650648 }
651649
@@ -716,14 +714,14 @@ static bool hci_pio_dequeue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int · 64 unmodified lines
716714 struct hci_pio_data *pio = hci->io_data;
717715 int ret;
718716
719− spin_lock_irq(&pio->lock);
717+ spin_lock_irq(&hci->lock);
720718 dev_dbg(&hci->master.dev, "n=%d status=%#x/%#x", n,
721719 pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
722720 dev_dbg(&hci->master.dev, "main_status = %#x/%#x",
723721 readl(hci->base_regs + 0x20), readl(hci->base_regs + 0x28));
724722
725723 ret = hci_pio_dequeue_xfer_common(hci, pio, xfer, n);
726− spin_unlock_irq(&pio->lock);
724+ spin_unlock_irq(&hci->lock);
727725 return ret;
728726 }
729727
@@ -1016,15 +1014,12 @@ static bool hci_pio_irq_handler(struct i3c_hci *hci) · 286 unmodified lines
10161014 struct hci_pio_data *pio = hci->io_data;
10171015 u32 status;
10181016
1019− spin_lock(&pio->lock);
10201017 status = pio_reg_read(INTR_STATUS);
10211018 dev_dbg(&hci->master.dev, "PIO_INTR_STATUS %#x/%#x",
10221019 status, pio->enabled_irqs);
10231020 status &= pio->enabled_irqs | STAT_LATENCY_WARNINGS;
1024− if (!status) {
1025− spin_unlock(&pio->lock);
1021+ if (!status)
10261022 return false;
1027− }
10281023
10291024 if (status & STAT_IBI_STATUS_THLD)
10301025 hci_pio_process_ibi(hci, pio);
@@ -1058,7 +1053,6 @@ static bool hci_pio_irq_handler(struct i3c_hci *hci) · 27 unmodified lines
10581053 pio_reg_write(INTR_SIGNAL_ENABLE, pio->enabled_irqs);
10591054 dev_dbg(&hci->master.dev, "PIO_INTR_STATUS %#x/%#x",
10601055 pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
1061− spin_unlock(&pio->lock);
10621056 return true;
10631057 }
10641058
drivers/iio/adc/ad7768-1.c+11−2
@@ -541,7 +541,7 @@ static int ad7768_reg_access(struct iio_dev *indio_dev, · 540 unmodified lines
541541 return ret;
542542 }
543543
544−static void ad7768_fill_scale_tbl(struct iio_dev *dev)
544+static int ad7768_fill_scale_tbl(struct iio_dev *dev)
545545 {
546546 struct ad7768_state *st = iio_priv(dev);
547547 const struct iio_scan_type *scan_type;
@@ -551,6 +551,11 @@ static void ad7768_fill_scale_tbl(struct iio_dev *dev) · 3 unmodified lines
551551 u64 tmp2;
552552
553553 scan_type = iio_get_current_scan_type(dev, &dev->channels[0]);
554+ if (IS_ERR(scan_type)) {
555+ dev_err(&st->spi->dev, "Failed to get scan type.\n");
556+ return PTR_ERR(scan_type);
557+ }
558+
554559 if (scan_type->sign == 's')
555560 val2 = scan_type->realbits - 1;
556561 else
@@ -575,6 +580,8 @@ static void ad7768_fill_scale_tbl(struct iio_dev *dev) · 18 unmodified lines
575580 st->scale_tbl[i][0] = tmp0; /* Integer part */
576581 st->scale_tbl[i][1] = abs(tmp1); /* Fractional part */
577582 }
583+
584+ return 0;
578585 }
579586
580587 static int ad7768_set_sinc3_dec_rate(struct ad7768_state *st,
@@ -679,7 +686,9 @@ static int ad7768_configure_dig_fil(struct iio_dev *dev, · 98 unmodified lines
679686 }
680687
681688 /* Update scale table: scale values vary according to the precision */
682− ad7768_fill_scale_tbl(dev);
689+ ret = ad7768_fill_scale_tbl(dev);
690+ if (ret)
691+ return ret;
683692
684693 ad7768_fill_samp_freq_tbl(st);
685694
drivers/iio/chemical/bme680_core.c+1−1
@@ -613,7 +613,7 @@ static int bme680_wait_for_eoc(struct bme680_data *data) · 612 unmodified lines
613613 * + heater duration
614614 */
615615 int wait_eoc_us = ((data->oversampling_temp + data->oversampling_press +
616− data->oversampling_humid) * 1936) + (477 * 4) +
616+ data->oversampling_humid) * 1963) + (477 * 4) +
617617 (477 * 5) + 1000 + (data->heater_dur * 1000);
618618
619619 fsleep(wait_eoc_us);
drivers/iio/chemical/sps30_i2c.c+1−1
@@ -171,7 +171,7 @@ static int sps30_i2c_read_meas(struct sps30_state *state, __be32 *meas, size_t n · 170 unmodified lines
171171 if (!sps30_i2c_meas_ready(state))
172172 return -ETIMEDOUT;
173173
174− return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(num) * num);
174+ return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(*meas) * num);
175175 }
176176
177177 static int sps30_i2c_clean_fan(struct sps30_state *state)
drivers/iio/chemical/sps30_serial.c+1−1
@@ -303,7 +303,7 @@ static int sps30_serial_read_meas(struct sps30_state *state, __be32 *meas, size_ · 302 unmodified lines
303303 if (msleep_interruptible(1000))
304304 return -EINTR;
305305
306− ret = sps30_serial_command(state, SPS30_SERIAL_READ_MEAS, NULL, 0, meas, num * sizeof(num));
306+ ret = sps30_serial_command(state, SPS30_SERIAL_READ_MEAS, NULL, 0, meas, num * sizeof(*meas));
307307 if (ret < 0)
308308 return ret;
309309 /* if measurements aren't ready sensor returns empty frame */
drivers/iio/dac/ds4424.c+1−1
@@ -140,7 +140,7 @@ static int ds4424_write_raw(struct iio_dev *indio_dev, · 139 unmodified lines
140140
141141 switch (mask) {
142142 case IIO_CHAN_INFO_RAW:
143− if (val < S8_MIN || val > S8_MAX)
143+ if (val <= S8_MIN || val > S8_MAX)
144144 return -EINVAL;
145145
146146 if (val > 0) {
drivers/iio/frequency/adf4377.c+1−1
@@ -508,7 +508,7 @@ static int adf4377_soft_reset(struct adf4377_state *st) · 507 unmodified lines
508508 return ret;
509509
510510 return regmap_read_poll_timeout(st->regmap, 0x0, read_val,
511− !(read_val & (ADF4377_0000_SOFT_RESET_R_MSK |
511+ !(read_val & (ADF4377_0000_SOFT_RESET_MSK |
512512 ADF4377_0000_SOFT_RESET_R_MSK)), 200, 200 * 100);
513513 }
514514
drivers/iio/gyro/mpu3050-core.c+13−5
@@ -322,7 +322,9 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev, · 321 unmodified lines
322322 }
323323 case IIO_CHAN_INFO_RAW:
324324 /* Resume device */
325− pm_runtime_get_sync(mpu3050->dev);
325+ ret = pm_runtime_resume_and_get(mpu3050->dev);
326+ if (ret)
327+ return ret;
326328 mutex_lock(&mpu3050->lock);
327329
328330 ret = mpu3050_set_8khz_samplerate(mpu3050);
@@ -647,14 +649,20 @@ out_trigger_unlock: · 318 unmodified lines
647649 static int mpu3050_buffer_preenable(struct iio_dev *indio_dev)
648650 {
649651 struct mpu3050 *mpu3050 = iio_priv(indio_dev);
652+ int ret;
650653
651− pm_runtime_get_sync(mpu3050->dev);
654+ ret = pm_runtime_resume_and_get(mpu3050->dev);
655+ if (ret)
656+ return ret;
652657
653658 /* Unless we have OUR trigger active, run at full speed */
654− if (!mpu3050->hw_irq_trigger)
655− return mpu3050_set_8khz_samplerate(mpu3050);
659+ if (!mpu3050->hw_irq_trigger) {
660+ ret = mpu3050_set_8khz_samplerate(mpu3050);
661+ if (ret)
662+ pm_runtime_put_autosuspend(mpu3050->dev);
663+ }
656664
657− return 0;
665+ return ret;
658666 }
659667
660668 static int mpu3050_buffer_postdisable(struct iio_dev *indio_dev)
drivers/iio/gyro/mpu3050-i2c.c+1−2
@@ -19,8 +19,7 @@ static int mpu3050_i2c_bypass_select(struct i2c_mux_core *mux, u32 chan_id) · 18 unmodified lines
1919 struct mpu3050 *mpu3050 = i2c_mux_priv(mux);
2020
2121 /* Just power up the device, that is all that is needed */
22− pm_runtime_get_sync(mpu3050->dev);
23− return 0;
22+ return pm_runtime_resume_and_get(mpu3050->dev);
2423 }
2524
2625 static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id)
drivers/iio/imu/adis.c+1−1
@@ -526,7 +526,7 @@ int adis_init(struct adis *adis, struct iio_dev *indio_dev, · 525 unmodified lines
526526
527527 adis->spi = spi;
528528 adis->data = data;
529− if (!adis->ops->write && !adis->ops->read && !adis->ops->reset)
529+ if (!adis->ops)
530530 adis->ops = &adis_default_ops;
531531 else if (!adis->ops->write || !adis->ops->read || !adis->ops->reset)
532532 return -EINVAL;
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c+2−0
@@ -651,6 +651,8 @@ static int inv_icm42600_accel_write_odr(struct iio_dev *indio_dev, · 650 unmodified lines
651651 return -EINVAL;
652652
653653 conf.odr = inv_icm42600_accel_odr_conv[idx / 2];
654+ if (conf.odr == st->conf.accel.odr)
655+ return 0;
654656
655657 pm_runtime_get_sync(dev);
656658 mutex_lock(&st->lock);
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c+4−0
@@ -371,6 +371,8 @@ static int inv_icm42600_buffer_predisable(struct iio_dev *indio_dev) · 370 unmodified lines
371371 static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev)
372372 {
373373 struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
374+ struct inv_icm42600_sensor_state *sensor_st = iio_priv(indio_dev);
375+ struct inv_sensors_timestamp *ts = &sensor_st->ts;
374376 struct device *dev = regmap_get_device(st->map);
375377 unsigned int sensor;
376378 unsigned int *watermark;
@@ -392,6 +394,8 @@ static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev) · 15 unmodified lines
392394
393395 mutex_lock(&st->lock);
394396
397+ inv_sensors_timestamp_apply_odr(ts, 0, 0, 0);
398+
395399 ret = inv_icm42600_buffer_set_fifo_en(st, st->fifo.en & ~sensor);
396400 if (ret)
397401 goto out_unlock;
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c+2−0
@@ -358,6 +358,8 @@ static int inv_icm42600_gyro_write_odr(struct iio_dev *indio_dev, · 357 unmodified lines
358358 return -EINVAL;
359359
360360 conf.odr = inv_icm42600_gyro_odr_conv[idx / 2];
361+ if (conf.odr == st->conf.gyro.odr)
362+ return 0;
361363
362364 pm_runtime_get_sync(dev);
363365 mutex_lock(&st->lock);
drivers/iio/imu/inv_icm45600/inv_icm45600.h+1−1
@@ -205,7 +205,7 @@ struct inv_icm45600_sensor_state { · 204 unmodified lines
205205 #define INV_ICM45600_SPI_SLEW_RATE_38NS 0
206206
207207 #define INV_ICM45600_REG_INT1_CONFIG2 0x0018
208−#define INV_ICM45600_INT1_CONFIG2_PUSH_PULL BIT(2)
208+#define INV_ICM45600_INT1_CONFIG2_OPEN_DRAIN BIT(2)
209209 #define INV_ICM45600_INT1_CONFIG2_LATCHED BIT(1)
210210 #define INV_ICM45600_INT1_CONFIG2_ACTIVE_HIGH BIT(0)
211211 #define INV_ICM45600_INT1_CONFIG2_ACTIVE_LOW 0x00
drivers/iio/imu/inv_icm45600/inv_icm45600_core.c+8−3
@@ -637,8 +637,8 @@ static int inv_icm45600_irq_init(struct inv_icm45600_state *st, int irq, · 636 unmodified lines
637637 break;
638638 }
639639
640− if (!open_drain)
641− val |= INV_ICM45600_INT1_CONFIG2_PUSH_PULL;
640+ if (open_drain)
641+ val |= INV_ICM45600_INT1_CONFIG2_OPEN_DRAIN;
642642
643643 ret = regmap_write(st->map, INV_ICM45600_REG_INT1_CONFIG2, val);
644644 if (ret)
@@ -744,6 +744,11 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chi · 99 unmodified lines
744744 */
745745 fsleep(5 * USEC_PER_MSEC);
746746
747+ /* set pm_runtime active early for disable vddio resource cleanup */
748+ ret = pm_runtime_set_active(dev);
749+ if (ret)
750+ return ret;
751+
747752 ret = inv_icm45600_enable_regulator_vddio(st);
748753 if (ret)
749754 return ret;
@@ -776,7 +781,7 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chi · 26 unmodified lines
776781 if (ret)
777782 return ret;
778783
779− ret = devm_pm_runtime_set_active_enabled(dev);
784+ ret = devm_pm_runtime_enable(dev);
780785 if (ret)
781786 return ret;
782787
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+8−0
@@ -1943,6 +1943,14 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, · 1942 unmodified lines
19431943 irq_type);
19441944 return -EINVAL;
19451945 }
1946+
1947+ /*
1948+ * Acking interrupts by status register does not work reliably
1949+ * but seem to work when this bit is set.
1950+ */
1951+ if (st->chip_type == INV_MPU9150)
1952+ st->irq_mask |= INV_MPU6050_INT_RD_CLEAR;
1953+
19461954 device_set_wakeup_capable(dev, true);
19471955
19481956 st->vdd_supply = devm_regulator_get(dev, "vdd");
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h+2−0
@@ -390,6 +390,8 @@ struct inv_mpu6050_state { · 389 unmodified lines
390390 /* enable level triggering */
391391 #define INV_MPU6050_LATCH_INT_EN 0x20
392392 #define INV_MPU6050_BIT_BYPASS_EN 0x2
393+/* allow acking interrupts by any register read */
394+#define INV_MPU6050_INT_RD_CLEAR 0x10
393395
394396 /* Allowed timestamp period jitter in percent */
395397 #define INV_MPU6050_TS_PERIOD_JITTER 4
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c+4−1
@@ -248,7 +248,6 @@ static irqreturn_t inv_mpu6050_interrupt_handle(int irq, void *p) · 247 unmodified lines
248248 switch (st->chip_type) {
249249 case INV_MPU6000:
250250 case INV_MPU6050:
251− case INV_MPU9150:
252251 /*
253252 * WoM is not supported and interrupt status read seems to be broken for
254253 * some chips. Since data ready is the only interrupt, bypass interrupt
@@ -257,6 +256,10 @@ static irqreturn_t inv_mpu6050_interrupt_handle(int irq, void *p) · 2 unmodified lines
257256 wom_bits = 0;
258257 int_status = INV_MPU6050_BIT_RAW_DATA_RDY_INT;
259258 goto data_ready_interrupt;
259+ case INV_MPU9150:
260+ /* IRQ needs to be acked */
261+ wom_bits = 0;
262+ break;
260263 case INV_MPU6500:
261264 case INV_MPU6515:
262265 case INV_MPU6880:
drivers/iio/industrialio-buffer.c+4−2
@@ -228,8 +228,10 @@ static ssize_t iio_buffer_write(struct file *filp, const char __user *buf, · 227 unmodified lines
228228 written = 0;
229229 add_wait_queue(&rb->pollq, &wait);
230230 do {
231− if (!indio_dev->info)
232− return -ENODEV;
231+ if (!indio_dev->info) {
232+ ret = -ENODEV;
233+ break;
234+ }
233235
234236 if (!iio_buffer_space_available(rb)) {
235237 if (signal_pending(current)) {
drivers/iio/light/bh1780.c+1−1
@@ -109,9 +109,9 @@ static int bh1780_read_raw(struct iio_dev *indio_dev, · 108 unmodified lines
109109 case IIO_LIGHT:
110110 pm_runtime_get_sync(&bh1780->client->dev);
111111 value = bh1780_read_word(bh1780, BH1780_REG_DLOW);
112+ pm_runtime_put_autosuspend(&bh1780->client->dev);
112113 if (value < 0)
113114 return value;
114− pm_runtime_put_autosuspend(&bh1780->client->dev);
115115 *val = value;
116116
117117 return IIO_VAL_INT;
drivers/iio/magnetometer/Kconfig+1−2
@@ -143,8 +143,7 @@ config MMC5633 · 142 unmodified lines
143143 tristate "MEMSIC MMC5633 3-axis magnetic sensor"
144144 select REGMAP_I2C
145145 select REGMAP_I3C if I3C
146− depends on I2C
147− depends on I3C || !I3C
146+ depends on I3C_OR_I2C
148147 help
149148 Say yes here to build support for the MEMSIC MMC5633 3-axis
150149 magnetic sensor.
drivers/iio/magnetometer/tlv493d.c+1−1
@@ -171,7 +171,7 @@ static s16 tlv493d_get_channel_data(u8 *b, enum tlv493d_channels ch) · 170 unmodified lines
171171 switch (ch) {
172172 case TLV493D_AXIS_X:
173173 val = FIELD_GET(TLV493D_BX_MAG_X_AXIS_MSB, b[TLV493D_RD_REG_BX]) << 4 |
174− FIELD_GET(TLV493D_BX2_MAG_X_AXIS_LSB, b[TLV493D_RD_REG_BX2]) >> 4;
174+ FIELD_GET(TLV493D_BX2_MAG_X_AXIS_LSB, b[TLV493D_RD_REG_BX2]);
175175 break;
176176 case TLV493D_AXIS_Y:
177177 val = FIELD_GET(TLV493D_BY_MAG_Y_AXIS_MSB, b[TLV493D_RD_REG_BY]) << 4 |
drivers/iio/potentiometer/mcp4131.c+1−1
@@ -221,7 +221,7 @@ static int mcp4131_write_raw(struct iio_dev *indio_dev, · 220 unmodified lines
221221
222222 mutex_lock(&data->lock);
223223
224− data->buf[0] = address << MCP4131_WIPER_SHIFT;
224+ data->buf[0] = address;
225225 data->buf[0] |= MCP4131_WRITE | (val >> 8);
226226 data->buf[1] = val & 0xFF; /* 8 bits here */
227227
drivers/iio/proximity/hx9023s.c+4−2
@@ -719,6 +719,9 @@ static int hx9023s_set_samp_freq(struct hx9023s_data *data, int val, int val2) · 718 unmodified lines
719719 struct device *dev = regmap_get_device(data->regmap);
720720 unsigned int i, period_ms;
721721
722+ if (!val && !val2)
723+ return -EINVAL;
724+
722725 period_ms = div_u64(NANO, (val * MEGA + val2));
723726
724727 for (i = 0; i < ARRAY_SIZE(hx9023s_samp_freq_table); i++) {
@@ -1034,9 +1037,8 @@ static int hx9023s_send_cfg(const struct firmware *fw, struct hx9023s_data *data · 309 unmodified lines
10341037 if (!bin)
10351038 return -ENOMEM;
10361039
1037− memcpy(bin->data, fw->data, fw->size);
1038−
10391040 bin->fw_size = fw->size;
1041+ memcpy(bin->data, fw->data, bin->fw_size);
10401042 bin->fw_ver = bin->data[FW_VER_OFFSET];
10411043 bin->reg_count = get_unaligned_le16(bin->data + FW_REG_CNT_OFFSET);
10421044
drivers/infiniband/Kconfig+1−0
@@ -6,6 +6,7 @@ menuconfig INFINIBAND · 5 unmodified lines
66 depends on INET
77 depends on m || IPV6 != m
88 depends on !ALPHA
9+ select DMA_SHARED_BUFFER
910 select IRQ_POLL
1011 select DIMLIB
1112 help
drivers/infiniband/core/cache.c+13−0
@@ -926,6 +926,13 @@ static int gid_table_setup_one(struct ib_device *ib_dev) · 925 unmodified lines
926926 if (err)
927927 return err;
928928
929+ /*
930+ * Mark the device as ready for GID cache updates. This allows netdev
931+ * event handlers to update the GID cache even before the device is
932+ * fully registered.
933+ */
934+ ib_device_enable_gid_updates(ib_dev);
935+
929936 rdma_roce_rescan_device(ib_dev);
930937
931938 return err;
@@ -1637,6 +1644,12 @@ void ib_cache_release_one(struct ib_device *device) · 705 unmodified lines
16371644
16381645 void ib_cache_cleanup_one(struct ib_device *device)
16391646 {
1647+ /*
1648+ * Clear the GID updates mark first to prevent event handlers from
1649+ * accessing the device while it's being torn down.
1650+ */
1651+ ib_device_disable_gid_updates(device);
1652+
16401653 /* The cleanup function waits for all in-progress workqueue
16411654 * elements and cleans up the GID cache. This function should be
16421655 * called after the device was removed from the devices list and
drivers/infiniband/core/cma.c+5−1
@@ -2729,6 +2729,9 @@ static int cma_listen_on_dev(struct rdma_id_private *id_priv, · 2728 unmodified lines
27292729 *to_destroy = NULL;
27302730 if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1))
27312731 return 0;
2732+ if (id_priv->restricted_node_type != RDMA_NODE_UNSPECIFIED &&
2733+ id_priv->restricted_node_type != cma_dev->device->node_type)
2734+ return 0;
27322735
27332736 dev_id_priv =
27342737 __rdma_create_id(net, cma_listen_handler, id_priv,
@@ -2736,6 +2739,7 @@ static int cma_listen_on_dev(struct rdma_id_private *id_priv, · 1 unmodified line
27362739 if (IS_ERR(dev_id_priv))
27372740 return PTR_ERR(dev_id_priv);
27382741
2742+ dev_id_priv->restricted_node_type = id_priv->restricted_node_type;
27392743 dev_id_priv->state = RDMA_CM_ADDR_BOUND;
27402744 memcpy(cma_src_addr(dev_id_priv), cma_src_addr(id_priv),
27412745 rdma_addr_size(cma_src_addr(id_priv)));
@@ -4194,7 +4198,7 @@ int rdma_restrict_node_type(struct rdma_cm_id *id, u8 node_type) · 1452 unmodified lines
41944198 }
41954199
41964200 mutex_lock(&lock);
4197− if (id_priv->cma_dev)
4201+ if (READ_ONCE(id_priv->state) != RDMA_CM_IDLE)
41984202 ret = -EALREADY;
41994203 else
42004204 id_priv->restricted_node_type = node_type;
drivers/infiniband/core/core_priv.h+3−0
@@ -100,6 +100,9 @@ void ib_enum_all_roce_netdevs(roce_netdev_filter filter, · 99 unmodified lines
100100 roce_netdev_callback cb,
101101 void *cookie);
102102
103+void ib_device_enable_gid_updates(struct ib_device *device);
104+void ib_device_disable_gid_updates(struct ib_device *device);
105+
103106 typedef int (*nldev_callback)(struct ib_device *device,
104107 struct sk_buff *skb,
105108 struct netlink_callback *cb,
drivers/infiniband/core/device.c+33−1
@@ -93,6 +93,7 @@ static struct workqueue_struct *ib_unreg_wq; · 92 unmodified lines
9393 static DEFINE_XARRAY_FLAGS(devices, XA_FLAGS_ALLOC);
9494 static DECLARE_RWSEM(devices_rwsem);
9595 #define DEVICE_REGISTERED XA_MARK_1
96+#define DEVICE_GID_UPDATES XA_MARK_2
9697
9798 static u32 highest_client_id;
9899 #define CLIENT_REGISTERED XA_MARK_1
@@ -2412,11 +2413,42 @@ void ib_enum_all_roce_netdevs(roce_netdev_filter filter, · 2313 unmodified lines
24122413 unsigned long index;
24132414
24142415 down_read(&devices_rwsem);
2415− xa_for_each_marked (&devices, index, dev, DEVICE_REGISTERED)
2416+ xa_for_each_marked(&devices, index, dev, DEVICE_GID_UPDATES)
24162417 ib_enum_roce_netdev(dev, filter, filter_cookie, cb, cookie);
24172418 up_read(&devices_rwsem);
24182419 }
24192420
2421+/**
2422+ * ib_device_enable_gid_updates - Mark device as ready for GID cache updates
2423+ * @device: Device to mark
2424+ *
2425+ * Called after GID table is allocated and initialized. After this mark is set,
2426+ * netdevice event handlers can update the device's GID cache. This allows
2427+ * events that arrive during device registration to be processed, avoiding
2428+ * stale GID entries when netdev properties change during the device
2429+ * registration process.
2430+ */
2431+void ib_device_enable_gid_updates(struct ib_device *device)
2432+{
2433+ down_write(&devices_rwsem);
2434+ xa_set_mark(&devices, device->index, DEVICE_GID_UPDATES);
2435+ up_write(&devices_rwsem);
2436+}
2437+
2438+/**
2439+ * ib_device_disable_gid_updates - Clear the GID updates mark
2440+ * @device: Device to unmark
2441+ *
2442+ * Called before GID table cleanup to prevent event handlers from accessing
2443+ * the device while it's being torn down.
2444+ */
2445+void ib_device_disable_gid_updates(struct ib_device *device)
2446+{
2447+ down_write(&devices_rwsem);
2448+ xa_clear_mark(&devices, device->index, DEVICE_GID_UPDATES);
2449+ up_write(&devices_rwsem);
2450+}
2451+
24202452 /*
24212453 * ib_enum_all_devs - enumerate all ib_devices
24222454 * @cb: Callback to call for each found ib_device
drivers/infiniband/core/umem_dmabuf.c+1−3
@@ -218,13 +218,11 @@ ib_umem_dmabuf_get_pinned_with_dma_device(struct ib_device *device, · 217 unmodified lines
218218
219219 err = ib_umem_dmabuf_map_pages(umem_dmabuf);
220220 if (err)
221− goto err_unpin;
221+ goto err_release;
222222 dma_resv_unlock(umem_dmabuf->attach->dmabuf->resv);
223223
224224 return umem_dmabuf;
225225
226−err_unpin:
227− dma_buf_unpin(umem_dmabuf->attach);
228226 err_release:
229227 dma_resv_unlock(umem_dmabuf->attach->dmabuf->resv);
230228 ib_umem_release(&umem_dmabuf->umem);
drivers/infiniband/core/uverbs_std_types_dmabuf.c+2−0
@@ -10,6 +10,8 @@ · 9 unmodified lines
1010 #include "rdma_core.h"
1111 #include "uverbs.h"
1212
13+MODULE_IMPORT_NS("DMA_BUF");
14+
1315 static int uverbs_dmabuf_attach(struct dma_buf *dmabuf,
1416 struct dma_buf_attachment *attachment)
1517 {
drivers/infiniband/hw/bng_re/bng_dev.c+19−37
@@ -54,9 +54,6 @@ static void bng_re_destroy_chip_ctx(struct bng_re_dev *rdev) · 53 unmodified lines
5454 {
5555 struct bng_re_chip_ctx *chip_ctx;
5656
57− if (!rdev->chip_ctx)
58− return;
59−
6057 kfree(rdev->dev_attr);
6158 rdev->dev_attr = NULL;
6259
@@ -124,12 +121,6 @@ static int bng_re_net_ring_free(struct bng_re_dev *rdev, · 61 unmodified lines
124121 struct bnge_fw_msg fw_msg = {};
125122 int rc = -EINVAL;
126123
127− if (!rdev)
128− return rc;
129−
130− if (!aux_dev)
131− return rc;
132−
133124 bng_re_init_hwrm_hdr((void *)&req, HWRM_RING_FREE);
134125 req.ring_type = type;
135126 req.ring_id = cpu_to_le16(fw_ring_id);
@@ -150,10 +141,7 @@ static int bng_re_net_ring_alloc(struct bng_re_dev *rdev, · 14 unmodified lines
150141 struct hwrm_ring_alloc_input req = {};
151142 struct hwrm_ring_alloc_output resp;
152143 struct bnge_fw_msg fw_msg = {};
153− int rc = -EINVAL;
154−
155− if (!aux_dev)
156− return rc;
144+ int rc;
157145
158146 bng_re_init_hwrm_hdr((void *)&req, HWRM_RING_ALLOC);
159147 req.enables = 0;
@@ -184,10 +172,7 @@ static int bng_re_stats_ctx_free(struct bng_re_dev *rdev) · 24 unmodified lines
184172 struct hwrm_stat_ctx_free_input req = {};
185173 struct hwrm_stat_ctx_free_output resp = {};
186174 struct bnge_fw_msg fw_msg = {};
187− int rc = -EINVAL;
188−
189− if (!aux_dev)
190− return rc;
175+ int rc;
191176
192177 bng_re_init_hwrm_hdr((void *)&req, HWRM_STAT_CTX_FREE);
193178 req.stat_ctx_id = cpu_to_le32(rdev->stats_ctx.fw_id);
@@ -208,13 +193,10 @@ static int bng_re_stats_ctx_alloc(struct bng_re_dev *rdev) · 14 unmodified lines
208193 struct hwrm_stat_ctx_alloc_output resp = {};
209194 struct hwrm_stat_ctx_alloc_input req = {};
210195 struct bnge_fw_msg fw_msg = {};
211− int rc = -EINVAL;
196+ int rc;
212197
213198 stats->fw_id = BNGE_INVALID_STATS_CTX_ID;
214199
215− if (!aux_dev)
216− return rc;
217−
218200 bng_re_init_hwrm_hdr((void *)&req, HWRM_STAT_CTX_ALLOC);
219201 req.update_period_ms = cpu_to_le32(1000);
220202 req.stats_dma_addr = cpu_to_le64(stats->dma_map);
@@ -303,7 +285,7 @@ static int bng_re_dev_init(struct bng_re_dev *rdev) · 82 unmodified lines
303285 if (rc) {
304286 ibdev_err(&rdev->ibdev,
305287 "Failed to register with netedev: %#x\n", rc);
306− return -EINVAL;
288+ goto reg_netdev_fail;
307289 }
308290
309291 set_bit(BNG_RE_FLAG_NETDEV_REGISTERED, &rdev->flags);
@@ -312,19 +294,16 @@ static int bng_re_dev_init(struct bng_re_dev *rdev) · 2 unmodified lines
312294 ibdev_err(&rdev->ibdev,
313295 "RoCE requires minimum 2 MSI-X vectors, but only %d reserved\n",
314296 rdev->aux_dev->auxr_info->msix_requested);
315− bnge_unregister_dev(rdev->aux_dev);
316− clear_bit(BNG_RE_FLAG_NETDEV_REGISTERED, &rdev->flags);
317− return -EINVAL;
297+ rc = -EINVAL;
298+ goto msix_ctx_fail;
318299 }
319300 ibdev_dbg(&rdev->ibdev, "Got %d MSI-X vectors\n",
320301 rdev->aux_dev->auxr_info->msix_requested);
321302
322303 rc = bng_re_setup_chip_ctx(rdev);
323304 if (rc) {
324− bnge_unregister_dev(rdev->aux_dev);
325− clear_bit(BNG_RE_FLAG_NETDEV_REGISTERED, &rdev->flags);
326305 ibdev_err(&rdev->ibdev, "Failed to get chip context\n");
327− return -EINVAL;
306+ goto msix_ctx_fail;
328307 }
329308
330309 bng_re_query_hwrm_version(rdev);
@@ -333,16 +312,14 @@ static int bng_re_dev_init(struct bng_re_dev *rdev) · 2 unmodified lines
333312 if (rc) {
334313 ibdev_err(&rdev->ibdev,
335314 "Failed to allocate RCFW Channel: %#x\n", rc);
336− goto fail;
315+ goto alloc_fw_chl_fail;
337316 }
338317
339318 /* Allocate nq record memory */
340319 rdev->nqr = kzalloc_obj(*rdev->nqr);
341320 if (!rdev->nqr) {
342− bng_re_destroy_chip_ctx(rdev);
343− bnge_unregister_dev(rdev->aux_dev);
344− clear_bit(BNG_RE_FLAG_NETDEV_REGISTERED, &rdev->flags);
345− return -ENOMEM;
321+ rc = -ENOMEM;
322+ goto nq_alloc_fail;
346323 }
347324
348325 rdev->nqr->num_msix = rdev->aux_dev->auxr_info->msix_requested;
@@ -411,9 +388,15 @@ disable_rcfw: · 62 unmodified lines
411388 free_ring:
412389 bng_re_net_ring_free(rdev, rdev->rcfw.creq.ring_id, type);
413390 free_rcfw:
391+ kfree(rdev->nqr);
392+nq_alloc_fail:
414393 bng_re_free_rcfw_channel(&rdev->rcfw);
415−fail:
416− bng_re_dev_uninit(rdev);
394+alloc_fw_chl_fail:
395+ bng_re_destroy_chip_ctx(rdev);
396+msix_ctx_fail:
397+ bnge_unregister_dev(rdev->aux_dev);
398+ clear_bit(BNG_RE_FLAG_NETDEV_REGISTERED, &rdev->flags);
399+reg_netdev_fail:
417400 return rc;
418401 }
419402
@@ -486,8 +469,7 @@ static void bng_re_remove(struct auxiliary_device *adev) · 66 unmodified lines
486469
487470 rdev = dev_info->rdev;
488471
489− if (rdev)
490− bng_re_remove_device(rdev, adev);
472+ bng_re_remove_device(rdev, adev);
491473 kfree(dev_info);
492474 }
493475
drivers/infiniband/hw/efa/efa_verbs.c+1−1
@@ -1661,7 +1661,7 @@ static struct efa_mr *efa_alloc_mr(struct ib_pd *ibpd, int access_flags, · 1660 unmodified lines
16611661 struct efa_mr *mr;
16621662
16631663 if (udata && udata->inlen &&
1664− !ib_is_udata_cleared(udata, 0, sizeof(udata->inlen))) {
1664+ !ib_is_udata_cleared(udata, 0, udata->inlen)) {
16651665 ibdev_dbg(&dev->ibdev,
16661666 "Incompatible ABI params, udata not cleared\n");
16671667 return ERR_PTR(-EINVAL);
drivers/infiniband/hw/ionic/ionic_controlpath.c+1−1
@@ -1218,7 +1218,7 @@ int ionic_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, · 1217 unmodified lines
12181218 rdma_udata_to_drv_context(udata, struct ionic_ctx, ibctx);
12191219 struct ionic_vcq *vcq = to_ionic_vcq(ibcq);
12201220 struct ionic_tbl_buf buf = {};
1221− struct ionic_cq_resp resp;
1221+ struct ionic_cq_resp resp = {};
12221222 struct ionic_cq_req req;
12231223 int udma_idx = 0, rc;
12241224
drivers/infiniband/hw/ionic/ionic_ibdev.c+2−0
@@ -81,6 +81,8 @@ static int ionic_query_port(struct ib_device *ibdev, u32 port, · 80 unmodified lines
8181 return -EINVAL;
8282
8383 ndev = ib_device_get_netdev(ibdev, port);
84+ if (!ndev)
85+ return -ENODEV;
8486
8587 if (netif_running(ndev) && netif_carrier_ok(ndev)) {
8688 attr->state = IB_PORT_ACTIVE;
drivers/infiniband/hw/irdma/verbs.c+1−1
@@ -5212,7 +5212,7 @@ static int irdma_create_user_ah(struct ib_ah *ibah, · 5211 unmodified lines
52125212 #define IRDMA_CREATE_AH_MIN_RESP_LEN offsetofend(struct irdma_create_ah_resp, rsvd)
52135213 struct irdma_ah *ah = container_of(ibah, struct irdma_ah, ibah);
52145214 struct irdma_device *iwdev = to_iwdev(ibah->pd->device);
5215− struct irdma_create_ah_resp uresp;
5215+ struct irdma_create_ah_resp uresp = {};
52165216 struct irdma_ah *parent_ah;
52175217 int err;
52185218
drivers/infiniband/hw/mthca/mthca_provider.c+3−2
@@ -428,6 +428,8 @@ static int mthca_create_srq(struct ib_srq *ibsrq, · 427 unmodified lines
428428
429429 if (context && ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {
430430 mthca_free_srq(to_mdev(ibsrq->device), srq);
431+ mthca_unmap_user_db(to_mdev(ibsrq->device), &context->uar,
432+ context->db_tab, ucmd.db_index);
431433 return -EFAULT;
432434 }
433435
@@ -436,6 +438,7 @@ static int mthca_create_srq(struct ib_srq *ibsrq, · 2 unmodified lines
436438
437439 static int mthca_destroy_srq(struct ib_srq *srq, struct ib_udata *udata)
438440 {
441+ mthca_free_srq(to_mdev(srq->device), to_msrq(srq));
439442 if (udata) {
440443 struct mthca_ucontext *context =
441444 rdma_udata_to_drv_context(
@@ -446,8 +449,6 @@ static int mthca_destroy_srq(struct ib_srq *srq, struct ib_udata *udata) · 4 unmodified lines
446449 mthca_unmap_user_db(to_mdev(srq->device), &context->uar,
447450 context->db_tab, to_msrq(srq)->db_index);
448451 }
449−
450− mthca_free_srq(to_mdev(srq->device), to_msrq(srq));
451452 return 0;
452453 }
453454
drivers/irqchip/irq-gic-v3-its.c+4−0
@@ -3474,6 +3474,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, · 3473 unmodified lines
34743474 int lpi_base;
34753475 int nr_lpis;
34763476 int nr_ites;
3477+ int id_bits;
34773478 int sz;
34783479
34793480 if (!its_alloc_device_table(its, dev_id))
@@ -3485,7 +3486,10 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, · 5 unmodified lines
34853486 /*
34863487 * Even if the device wants a single LPI, the ITT must be
34873488 * sized as a power of two (and you need at least one bit...).
3489+ * Also honor the ITS's own EID limit.
34883490 */
3491+ id_bits = FIELD_GET(GITS_TYPER_IDBITS, its->typer) + 1;
3492+ nvecs = min_t(unsigned int, nvecs, BIT(id_bits));
34893493 nr_ites = max(2, nvecs);
34903494 sz = nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1);
34913495 sz = max(sz, ITS_ITT_ALIGN);
drivers/irqchip/irq-gic-v5-irs.c+1−1
@@ -699,7 +699,7 @@ static int __init gicv5_irs_init(struct gicv5_irs_chip_data *irs_data) · 698 unmodified lines
699699 */
700700 if (list_empty(&irs_nodes)) {
701701 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR0);
702− gicv5_global_data.virt_capable = !FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
702+ gicv5_global_data.virt_capable = !!FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
703703
704704 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR1);
705705 irs_setup_pri_bits(idr);
drivers/irqchip/irq-ls-extirq.c+34−19
@@ -125,32 +125,45 @@ static const struct irq_domain_ops extirq_domain_ops = { · 124 unmodified lines
125125 static int
126126 ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
127127 {
128− struct of_imap_parser imap_parser;
129− struct of_imap_item imap_item;
128+ const __be32 *map;
129+ u32 mapsize;
130130 int ret;
131131
132− ret = of_imap_parser_init(&imap_parser, node, &imap_item);
133− if (ret)
134− return ret;
132+ map = of_get_property(node, "interrupt-map", &mapsize);
133+ if (!map)
134+ return -ENOENT;
135+ if (mapsize % sizeof(*map))
136+ return -EINVAL;
137+ mapsize /= sizeof(*map);
135138
136− for_each_of_imap_item(&imap_parser, &imap_item) {
139+ while (mapsize) {
137140 struct device_node *ipar;
138− u32 hwirq;
139− int i;
141+ u32 hwirq, intsize, j;
140142
141− hwirq = imap_item.child_imap[0];
142− if (hwirq >= MAXIRQ) {
143− of_node_put(imap_item.parent_args.np);
143+ if (mapsize < 3)
144+ return -EINVAL;
145+ hwirq = be32_to_cpup(map);
146+ if (hwirq >= MAXIRQ)
144147 return -EINVAL;
145− }
146148 priv->nirq = max(priv->nirq, hwirq + 1);
147149
148− ipar = of_node_get(imap_item.parent_args.np);
149− priv->map[hwirq].fwnode = of_fwnode_handle(ipar);
150+ ipar = of_find_node_by_phandle(be32_to_cpup(map + 2));
151+ map += 3;
152+ mapsize -= 3;
153+ if (!ipar)
154+ return -EINVAL;
155+ priv->map[hwirq].fwnode = &ipar->fwnode;
156+ ret = of_property_read_u32(ipar, "#interrupt-cells", &intsize);
157+ if (ret)
158+ return ret;
150159
151− priv->map[hwirq].param_count = imap_item.parent_args.args_count;
152− for (i = 0; i < priv->map[hwirq].param_count; i++)
153− priv->map[hwirq].param[i] = imap_item.parent_args.args[i];
160+ if (intsize > mapsize)
161+ return -EINVAL;
162+
163+ priv->map[hwirq].param_count = intsize;
164+ for (j = 0; j < intsize; ++j)
165+ priv->map[hwirq].param[j] = be32_to_cpup(map++);
166+ mapsize -= intsize;
154167 }
155168 return 0;
156169 }
@@ -177,8 +190,10 @@ static int ls_extirq_probe(struct platform_device *pdev) · 20 unmodified lines
177190 return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
178191
179192 priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
180− if (!priv->intpcr)
181− return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
193+ if (IS_ERR(priv->intpcr)) {
194+ return dev_err_probe(dev, PTR_ERR(priv->intpcr),
195+ "Cannot ioremap OF node %pOF\n", node);
196+ }
182197
183198 ret = ls_extirq_parse_map(priv, node);
184199 if (ret)
drivers/irqchip/irq-mmp.c+1−1
@@ -136,7 +136,7 @@ static void icu_unmask_irq(struct irq_data *d) · 135 unmodified lines
136136 }
137137 }
138138
139−struct irq_chip icu_irq_chip = {
139+static const struct irq_chip icu_irq_chip = {
140140 .name = "icu_irq",
141141 .irq_mask = icu_mask_irq,
142142 .irq_mask_ack = icu_mask_ack_irq,
drivers/irqchip/irq-riscv-aplic-main.c+17−4
@@ -116,6 +116,16 @@ static struct syscore aplic_syscore = { · 115 unmodified lines
116116 .ops = &aplic_syscore_ops,
117117 };
118118
119+static bool aplic_syscore_registered __ro_after_init;
120+
121+static void aplic_syscore_init(void)
122+{
123+ if (!aplic_syscore_registered) {
124+ register_syscore(&aplic_syscore);
125+ aplic_syscore_registered = true;
126+ }
127+}
128+
119129 static int aplic_pm_notifier(struct notifier_block *nb, unsigned long action, void *data)
120130 {
121131 struct aplic_priv *priv = container_of(nb, struct aplic_priv, genpd_nb);
@@ -372,18 +382,21 @@ static int aplic_probe(struct platform_device *pdev) · 250 unmodified lines
372382 rc = aplic_msi_setup(dev, regs);
373383 else
374384 rc = aplic_direct_setup(dev, regs);
375− if (rc)
385+
386+ if (rc) {
376387 dev_err_probe(dev, rc, "failed to setup APLIC in %s mode\n",
377388 msi_mode ? "MSI" : "direct");
378− else
379− register_syscore(&aplic_syscore);
389+ return rc;
390+ }
391+
392+ aplic_syscore_init();
380393
381394 #ifdef CONFIG_ACPI
382395 if (!acpi_disabled)
383396 acpi_dev_clear_dependencies(ACPI_COMPANION(dev));
384397 #endif
385398
386− return rc;
399+ return 0;
387400 }
388401
389402 static const struct of_device_id aplic_match[] = {
drivers/irqchip/irq-sifive-plic.c+6−1
@@ -172,8 +172,13 @@ static void plic_irq_disable(struct irq_data *d) · 171 unmodified lines
172172 static void plic_irq_eoi(struct irq_data *d)
173173 {
174174 struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
175+ u32 __iomem *reg;
176+ bool enabled;
177+
178+ reg = handler->enable_base + (d->hwirq / 32) * sizeof(u32);
179+ enabled = readl(reg) & BIT(d->hwirq % 32);
175180
176− if (unlikely(irqd_irq_disabled(d))) {
181+ if (unlikely(!enabled)) {
177182 plic_toggle(handler, d->hwirq, 1);
178183 writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
179184 plic_toggle(handler, d->hwirq, 0);
drivers/media/dvb-core/dmxdev.c+3−1
@@ -168,7 +168,9 @@ static int dvb_dvr_open(struct inode *inode, struct file *file) · 167 unmodified lines
168168 mutex_unlock(&dmxdev->mutex);
169169 return -ENOMEM;
170170 }
171− dvb_ringbuffer_init(&dmxdev->dvr_buffer, mem, DVR_BUFFER_SIZE);
171+ dmxdev->dvr_buffer.data = mem;
172+ dmxdev->dvr_buffer.size = DVR_BUFFER_SIZE;
173+ dvb_ringbuffer_reset(&dmxdev->dvr_buffer);
172174 if (dmxdev->may_do_mmap)
173175 dvb_vb2_init(&dmxdev->dvr_vb2_ctx, "dvr",
174176 &dmxdev->mutex,
drivers/media/dvb-core/dvb_net.c+3−0
@@ -228,6 +228,9 @@ static int handle_one_ule_extension( struct dvb_net_priv *p ) · 227 unmodified lines
228228 unsigned char hlen = (p->ule_sndu_type & 0x0700) >> 8;
229229 unsigned char htype = p->ule_sndu_type & 0x00FF;
230230
231+ if (htype >= ARRAY_SIZE(ule_mandatory_ext_handlers))
232+ return -1;
233+
231234 /* Discriminate mandatory and optional extension headers. */
232235 if (hlen == 0) {
233236 /* Mandatory extension header */
drivers/misc/amd-sbi/Kconfig+1−2
@@ -1,10 +1,9 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 config AMD_SBRMI_I2C
33 tristate "AMD side band RMI support"
4− depends on I2C
4+ depends on I3C_OR_I2C
55 depends on ARM || ARM64 || COMPILE_TEST
66 select REGMAP_I2C
7− depends on I3C || !I3C
87 select REGMAP_I3C if I3C
98 help
109 Side band RMI over I2C/I3C support for AMD out of band management.
drivers/mmc/host/dw_mmc-rockchip.c+37−1
@@ -36,6 +36,8 @@ struct dw_mci_rockchip_priv_data { · 35 unmodified lines
3636 int default_sample_phase;
3737 int num_phases;
3838 bool internal_phase;
39+ int sample_phase;
40+ int drv_phase;
3941 };
4042
4143 /*
@@ -573,9 +575,43 @@ static void dw_mci_rockchip_remove(struct platform_device *pdev) · 531 unmodified lines
573575 dw_mci_pltfm_remove(pdev);
574576 }
575577
578+static int dw_mci_rockchip_runtime_suspend(struct device *dev)
579+{
580+ struct platform_device *pdev = to_platform_device(dev);
581+ struct dw_mci *host = platform_get_drvdata(pdev);
582+ struct dw_mci_rockchip_priv_data *priv = host->priv;
583+
584+ if (priv->internal_phase) {
585+ priv->sample_phase = rockchip_mmc_get_phase(host, true);
586+ priv->drv_phase = rockchip_mmc_get_phase(host, false);
587+ }
588+
589+ return dw_mci_runtime_suspend(dev);
590+}
591+
592+static int dw_mci_rockchip_runtime_resume(struct device *dev)
593+{
594+ struct platform_device *pdev = to_platform_device(dev);
595+ struct dw_mci *host = platform_get_drvdata(pdev);
596+ struct dw_mci_rockchip_priv_data *priv = host->priv;
597+ int ret;
598+
599+ ret = dw_mci_runtime_resume(dev);
600+ if (ret)
601+ return ret;
602+
603+ if (priv->internal_phase) {
604+ rockchip_mmc_set_phase(host, true, priv->sample_phase);
605+ rockchip_mmc_set_phase(host, false, priv->drv_phase);
606+ mci_writel(host, MISC_CON, MEM_CLK_AUTOGATE_ENABLE);
607+ }
608+
609+ return ret;
610+}
611+
576612 static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
577613 SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
578− RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL)
614+ RUNTIME_PM_OPS(dw_mci_rockchip_runtime_suspend, dw_mci_rockchip_runtime_resume, NULL)
579615 };
580616
581617 static struct platform_driver dw_mci_rockchip_pltfm_driver = {
drivers/mmc/host/mmci_qcom_dml.c+1−0
@@ -109,6 +109,7 @@ static int of_get_dml_pipe_index(struct device_node *np, const char *name) · 108 unmodified lines
109109 &dma_spec))
110110 return -ENODEV;
111111
112+ of_node_put(dma_spec.np);
112113 if (dma_spec.args_count)
113114 return dma_spec.args[0];
114115
drivers/mmc/host/sdhci-brcmstb.c+1−1
@@ -116,7 +116,7 @@ static void sdhci_brcmstb_restore_regs(struct mmc_host *mmc, enum cfg_core_ver v · 115 unmodified lines
116116 writel(sr->boot_main_ctl, priv->boot_regs + SDIO_BOOT_MAIN_CTL);
117117
118118 if (ver == SDIO_CFG_CORE_V1) {
119− writel(sr->sd_pin_sel, cr + SDIO_CFG_SD_PIN_SEL);
119+ writel(sr->sd_pin_sel, cr + SDIO_CFG_V1_SD_PIN_SEL);
120120 return;
121121 }
122122
drivers/net/bonding/bond_main.c+70−9
@@ -324,7 +324,7 @@ static bool bond_sk_check(struct bonding *bond) · 323 unmodified lines
324324 }
325325 }
326326
327−bool bond_xdp_check(struct bonding *bond, int mode)
327+bool __bond_xdp_check(int mode, int xmit_policy)
328328 {
329329 switch (mode) {
330330 case BOND_MODE_ROUNDROBIN:
@@ -335,7 +335,7 @@ bool bond_xdp_check(struct bonding *bond, int mode) · 4 unmodified lines
335335 /* vlan+srcmac is not supported with XDP as in most cases the 802.1q
336336 * payload is not in the packet due to hardware offload.
337337 */
338− if (bond->params.xmit_policy != BOND_XMIT_POLICY_VLAN_SRCMAC)
338+ if (xmit_policy != BOND_XMIT_POLICY_VLAN_SRCMAC)
339339 return true;
340340 fallthrough;
341341 default:
@@ -343,6 +343,11 @@ bool bond_xdp_check(struct bonding *bond, int mode) · 1 unmodified line
343343 }
344344 }
345345
346+bool bond_xdp_check(struct bonding *bond, int mode)
347+{
348+ return __bond_xdp_check(mode, bond->params.xmit_policy);
349+}
350+
346351 /*---------------------------------- VLAN -----------------------------------*/
347352
348353 /* In the following 2 functions, bond_vlan_rx_add_vid and bond_vlan_rx_kill_vid,
@@ -1504,6 +1509,50 @@ static netdev_features_t bond_fix_features(struct net_device *dev, · 1155 unmodified lines
15041509 return features;
15051510 }
15061511
1512+static int bond_header_create(struct sk_buff *skb, struct net_device *bond_dev,
1513+ unsigned short type, const void *daddr,
1514+ const void *saddr, unsigned int len)
1515+{
1516+ struct bonding *bond = netdev_priv(bond_dev);
1517+ const struct header_ops *slave_ops;
1518+ struct slave *slave;
1519+ int ret = 0;
1520+
1521+ rcu_read_lock();
1522+ slave = rcu_dereference(bond->curr_active_slave);
1523+ if (slave) {
1524+ slave_ops = READ_ONCE(slave->dev->header_ops);
1525+ if (slave_ops && slave_ops->create)
1526+ ret = slave_ops->create(skb, slave->dev,
1527+ type, daddr, saddr, len);
1528+ }
1529+ rcu_read_unlock();
1530+ return ret;
1531+}
1532+
1533+static int bond_header_parse(const struct sk_buff *skb, unsigned char *haddr)
1534+{
1535+ struct bonding *bond = netdev_priv(skb->dev);
1536+ const struct header_ops *slave_ops;
1537+ struct slave *slave;
1538+ int ret = 0;
1539+
1540+ rcu_read_lock();
1541+ slave = rcu_dereference(bond->curr_active_slave);
1542+ if (slave) {
1543+ slave_ops = READ_ONCE(slave->dev->header_ops);
1544+ if (slave_ops && slave_ops->parse)
1545+ ret = slave_ops->parse(skb, haddr);
1546+ }
1547+ rcu_read_unlock();
1548+ return ret;
1549+}
1550+
1551+static const struct header_ops bond_header_ops = {
1552+ .create = bond_header_create,
1553+ .parse = bond_header_parse,
1554+};
1555+
15071556 static void bond_setup_by_slave(struct net_device *bond_dev,
15081557 struct net_device *slave_dev)
15091558 {
@@ -1511,7 +1560,8 @@ static void bond_setup_by_slave(struct net_device *bond_dev, · 1 unmodified line
15111560
15121561 dev_close(bond_dev);
15131562
1514− bond_dev->header_ops = slave_dev->header_ops;
1563+ bond_dev->header_ops = slave_dev->header_ops ?
1564+ &bond_header_ops : NULL;
15151565
15161566 bond_dev->type = slave_dev->type;
15171567 bond_dev->hard_header_len = slave_dev->hard_header_len;
@@ -2796,8 +2846,14 @@ static void bond_miimon_commit(struct bonding *bond) · 1278 unmodified lines
27962846
27972847 continue;
27982848
2849+ case BOND_LINK_FAIL:
2850+ case BOND_LINK_BACK:
2851+ slave_dbg(bond->dev, slave->dev, "link_new_state %d on slave\n",
2852+ slave->link_new_state);
2853+ continue;
2854+
27992855 default:
2800− slave_err(bond->dev, slave->dev, "invalid new link %d on slave\n",
2856+ slave_err(bond->dev, slave->dev, "invalid link_new_state %d on slave\n",
28012857 slave->link_new_state);
28022858 bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
28032859
@@ -3372,7 +3428,7 @@ int bond_rcv_validate(const struct sk_buff *skb, struct bonding *bond, · 568 unmodified lines
33723428 } else if (is_arp) {
33733429 return bond_arp_rcv(skb, bond, slave);
33743430 #if IS_ENABLED(CONFIG_IPV6)
3375− } else if (is_ipv6) {
3431+ } else if (is_ipv6 && likely(ipv6_mod_enabled())) {
33763432 return bond_na_rcv(skb, bond, slave);
33773433 #endif
33783434 } else {
@@ -5064,13 +5120,18 @@ static void bond_set_slave_arr(struct bonding *bond, · 1685 unmodified lines
50645120 {
50655121 struct bond_up_slave *usable, *all;
50665122
5067− usable = rtnl_dereference(bond->usable_slaves);
5068− rcu_assign_pointer(bond->usable_slaves, usable_slaves);
5069− kfree_rcu(usable, rcu);
5070−
50715123 all = rtnl_dereference(bond->all_slaves);
50725124 rcu_assign_pointer(bond->all_slaves, all_slaves);
50735125 kfree_rcu(all, rcu);
5126+
5127+ if (BOND_MODE(bond) == BOND_MODE_BROADCAST) {
5128+ kfree_rcu(usable_slaves, rcu);
5129+ return;
5130+ }
5131+
5132+ usable = rtnl_dereference(bond->usable_slaves);
5133+ rcu_assign_pointer(bond->usable_slaves, usable_slaves);
5134+ kfree_rcu(usable, rcu);
50745135 }
50755136
50765137 static void bond_reset_slave_arr(struct bonding *bond)
drivers/net/bonding/bond_options.c+2−0
@@ -1575,6 +1575,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond, · 1574 unmodified lines
15751575 static int bond_option_xmit_hash_policy_set(struct bonding *bond,
15761576 const struct bond_opt_value *newval)
15771577 {
1578+ if (bond->xdp_prog && !__bond_xdp_check(BOND_MODE(bond), newval->value))
1579+ return -EOPNOTSUPP;
15781580 netdev_dbg(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
15791581 newval->string, newval->value);
15801582 bond->params.xmit_policy = newval->value;
drivers/net/caif/caif_serial.c+3−0
@@ -297,6 +297,7 @@ static void ser_release(struct work_struct *work) · 296 unmodified lines
297297 dev_close(ser->dev);
298298 unregister_netdevice(ser->dev);
299299 debugfs_deinit(ser);
300+ tty_kref_put(tty->link);
300301 tty_kref_put(tty);
301302 }
302303 rtnl_unlock();
@@ -331,6 +332,7 @@ static int ldisc_open(struct tty_struct *tty) · 28 unmodified lines
331332
332333 ser = netdev_priv(dev);
333334 ser->tty = tty_kref_get(tty);
335+ tty_kref_get(tty->link);
334336 ser->dev = dev;
335337 debugfs_init(ser, tty);
336338 tty->receive_room = 4096;
@@ -339,6 +341,7 @@ static int ldisc_open(struct tty_struct *tty) · 2 unmodified lines
339341 rtnl_lock();
340342 result = register_netdevice(dev);
341343 if (result) {
344+ tty_kref_put(tty->link);
342345 tty_kref_put(tty);
343346 rtnl_unlock();
344347 free_netdev(dev);
drivers/net/can/dev/calc_bittiming.c+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #include <linux/units.h>
99 #include <linux/can/dev.h>
1010
11−#define CAN_CALC_MAX_ERROR 50 /* in one-tenth of a percent */
11+#define CAN_CALC_MAX_ERROR 500 /* max error 5% */
1212
1313 /* CiA recommended sample points for Non Return to Zero encoding. */
1414 static int can_calc_sample_point_nrz(const struct can_bittiming *bt)
drivers/net/can/dummy_can.c+1−0
@@ -241,6 +241,7 @@ static int __init dummy_can_init(void) · 240 unmodified lines
241241
242242 dev->netdev_ops = &dummy_can_netdev_ops;
243243 dev->ethtool_ops = &dummy_can_ethtool_ops;
244+ dev->flags |= IFF_ECHO; /* enable echo handling */
244245 priv = netdev_priv(dev);
245246 priv->can.bittiming_const = &dummy_can_bittiming_const;
246247 priv->can.bitrate_max = 20 * MEGA /* BPS */;
drivers/net/can/spi/hi311x.c+4−1
@@ -755,7 +755,9 @@ static int hi3110_open(struct net_device *net) · 754 unmodified lines
755755 return ret;
756756
757757 mutex_lock(&priv->hi3110_lock);
758− hi3110_power_enable(priv->transceiver, 1);
758+ ret = hi3110_power_enable(priv->transceiver, 1);
759+ if (ret)
760+ goto out_close_candev;
759761
760762 priv->force_quit = 0;
761763 priv->tx_skb = NULL;
@@ -790,6 +792,7 @@ static int hi3110_open(struct net_device *net) · 28 unmodified lines
790792 hi3110_hw_sleep(spi);
791793 out_close:
792794 hi3110_power_enable(priv->transceiver, 0);
795+ out_close_candev:
793796 close_candev(net);
794797 mutex_unlock(&priv->hi3110_lock);
795798 return ret;
drivers/net/can/spi/mcp251x.c+14−1
@@ -1214,6 +1214,7 @@ static int mcp251x_open(struct net_device *net) · 1213 unmodified lines
12141214 {
12151215 struct mcp251x_priv *priv = netdev_priv(net);
12161216 struct spi_device *spi = priv->spi;
1217+ bool release_irq = false;
12171218 unsigned long flags = 0;
12181219 int ret;
12191220
@@ -1257,12 +1258,24 @@ static int mcp251x_open(struct net_device *net) · 37 unmodified lines
12571258 return 0;
12581259
12591260 out_free_irq:
1260− free_irq(spi->irq, priv);
1261+ /* The IRQ handler might be running, and if so it will be waiting
1262+ * for the lock. But free_irq() must wait for the handler to finish
1263+ * so calling it here would deadlock.
1264+ *
1265+ * Setting priv->force_quit will let the handler exit right away
1266+ * without any access to the hardware. This make it safe to call
1267+ * free_irq() after the lock is released.
1268+ */
1269+ priv->force_quit = 1;
1270+ release_irq = true;
1271+
12611272 mcp251x_hw_sleep(spi);
12621273 out_close:
12631274 mcp251x_power_enable(priv->transceiver, 0);
12641275 close_candev(net);
12651276 mutex_unlock(&priv->mcp_lock);
1277+ if (release_irq)
1278+ free_irq(spi->irq, priv);
12661279 return ret;
12671280 }
12681281
drivers/net/can/usb/ems_usb.c+6−1
@@ -445,6 +445,11 @@ static void ems_usb_read_bulk_callback(struct urb *urb) · 444 unmodified lines
445445 start = CPC_HEADER_SIZE;
446446
447447 while (msg_count) {
448+ if (start + CPC_MSG_HEADER_LEN > urb->actual_length) {
449+ netdev_err(netdev, "format error\n");
450+ break;
451+ }
452+
448453 msg = (struct ems_cpc_msg *)&ibuf[start];
449454
450455 switch (msg->type) {
@@ -474,7 +479,7 @@ static void ems_usb_read_bulk_callback(struct urb *urb) · 23 unmodified lines
474479 start += CPC_MSG_HEADER_LEN + msg->length;
475480 msg_count--;
476481
477− if (start > urb->transfer_buffer_length) {
482+ if (start > urb->actual_length) {
478483 netdev_err(netdev, "format error\n");
479484 break;
480485 }
drivers/net/can/usb/esd_usb.c+17−13
@@ -272,6 +272,9 @@ struct esd_usb { · 271 unmodified lines
272272
273273 struct usb_anchor rx_submitted;
274274
275+ unsigned int rx_pipe;
276+ unsigned int tx_pipe;
277+
275278 int net_count;
276279 u32 version;
277280 int rxinitdone;
@@ -537,7 +540,7 @@ static void esd_usb_read_bulk_callback(struct urb *urb) · 259 unmodified lines
537540 }
538541
539542 resubmit_urb:
540− usb_fill_bulk_urb(urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
543+ usb_fill_bulk_urb(urb, dev->udev, dev->rx_pipe,
541544 urb->transfer_buffer, ESD_USB_RX_BUFFER_SIZE,
542545 esd_usb_read_bulk_callback, dev);
543546
@@ -626,9 +629,7 @@ static int esd_usb_send_msg(struct esd_usb *dev, union esd_usb_msg *msg) · 82 unmodified lines
626629 {
627630 int actual_length;
628631
629− return usb_bulk_msg(dev->udev,
630− usb_sndbulkpipe(dev->udev, 2),
631− msg,
632+ return usb_bulk_msg(dev->udev, dev->tx_pipe, msg,
632633 msg->hdr.len * sizeof(u32), /* convert to # of bytes */
633634 &actual_length,
634635 1000);
@@ -639,12 +640,8 @@ static int esd_usb_wait_msg(struct esd_usb *dev, · 4 unmodified lines
639640 {
640641 int actual_length;
641642
642− return usb_bulk_msg(dev->udev,
643− usb_rcvbulkpipe(dev->udev, 1),
644− msg,
645− sizeof(*msg),
646− &actual_length,
647− 1000);
643+ return usb_bulk_msg(dev->udev, dev->rx_pipe, msg,
644+ sizeof(*msg), &actual_length, 1000);
648645 }
649646
650647 static int esd_usb_setup_rx_urbs(struct esd_usb *dev)
@@ -677,8 +674,7 @@ static int esd_usb_setup_rx_urbs(struct esd_usb *dev) · 26 unmodified lines
677674
678675 urb->transfer_dma = buf_dma;
679676
680− usb_fill_bulk_urb(urb, dev->udev,
681− usb_rcvbulkpipe(dev->udev, 1),
677+ usb_fill_bulk_urb(urb, dev->udev, dev->rx_pipe,
682678 buf, ESD_USB_RX_BUFFER_SIZE,
683679 esd_usb_read_bulk_callback, dev);
684680 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
@@ -903,7 +899,7 @@ static netdev_tx_t esd_usb_start_xmit(struct sk_buff *skb, · 218 unmodified lines
903899 /* hnd must not be 0 - MSB is stripped in txdone handling */
904900 msg->tx.hnd = BIT(31) | i; /* returned in TX done message */
905901
906− usb_fill_bulk_urb(urb, dev->udev, usb_sndbulkpipe(dev->udev, 2), buf,
902+ usb_fill_bulk_urb(urb, dev->udev, dev->tx_pipe, buf,
907903 msg->hdr.len * sizeof(u32), /* convert to # of bytes */
908904 esd_usb_write_bulk_callback, context);
909905
@@ -1298,10 +1294,16 @@ done: · 388 unmodified lines
12981294 static int esd_usb_probe(struct usb_interface *intf,
12991295 const struct usb_device_id *id)
13001296 {
1297+ struct usb_endpoint_descriptor *ep_in, *ep_out;
13011298 struct esd_usb *dev;
13021299 union esd_usb_msg *msg;
13031300 int i, err;
13041301
1302+ err = usb_find_common_endpoints(intf->cur_altsetting, &ep_in, &ep_out,
1303+ NULL, NULL);
1304+ if (err)
1305+ return err;
1306+
13051307 dev = kzalloc_obj(*dev);
13061308 if (!dev) {
13071309 err = -ENOMEM;
@@ -1309,6 +1311,8 @@ static int esd_usb_probe(struct usb_interface *intf, · 1 unmodified line
13091311 }
13101312
13111313 dev->udev = interface_to_usbdev(intf);
1314+ dev->rx_pipe = usb_rcvbulkpipe(dev->udev, ep_in->bEndpointAddress);
1315+ dev->tx_pipe = usb_sndbulkpipe(dev->udev, ep_out->bEndpointAddress);
13121316
13131317 init_usb_anchor(&dev->rx_submitted);
13141318
drivers/net/can/usb/etas_es58x/es58x_core.c+7−1
@@ -1461,12 +1461,18 @@ static void es58x_read_bulk_callback(struct urb *urb) · 1460 unmodified lines
14611461 }
14621462
14631463 resubmit_urb:
1464+ usb_anchor_urb(urb, &es58x_dev->rx_urbs);
14641465 ret = usb_submit_urb(urb, GFP_ATOMIC);
1466+ if (!ret)
1467+ return;
1468+
1469+ usb_unanchor_urb(urb);
1470+
14651471 if (ret == -ENODEV) {
14661472 for (i = 0; i < es58x_dev->num_can_ch; i++)
14671473 if (es58x_dev->netdev[i])
14681474 netif_device_detach(es58x_dev->netdev[i]);
1469− } else if (ret)
1475+ } else
14701476 dev_err_ratelimited(dev,
14711477 "Failed resubmitting read bulk urb: %pe\n",
14721478 ERR_PTR(ret));
drivers/net/can/usb/f81604.c+40−5
@@ -413,6 +413,7 @@ static void f81604_read_bulk_callback(struct urb *urb) · 412 unmodified lines
413413 {
414414 struct f81604_can_frame *frame = urb->transfer_buffer;
415415 struct net_device *netdev = urb->context;
416+ struct f81604_port_priv *priv = netdev_priv(netdev);
416417 int ret;
417418
418419 if (!netif_device_present(netdev))
@@ -445,10 +446,15 @@ static void f81604_read_bulk_callback(struct urb *urb) · 26 unmodified lines
445446 f81604_process_rx_packet(netdev, frame);
446447
447448 resubmit_urb:
449+ usb_anchor_urb(urb, &priv->urbs_anchor);
448450 ret = usb_submit_urb(urb, GFP_ATOMIC);
451+ if (!ret)
452+ return;
453+ usb_unanchor_urb(urb);
454+
449455 if (ret == -ENODEV)
450456 netif_device_detach(netdev);
451− else if (ret)
457+ else
452458 netdev_err(netdev,
453459 "%s: failed to resubmit read bulk urb: %pe\n",
454460 __func__, ERR_PTR(ret));
@@ -620,6 +626,12 @@ static void f81604_read_int_callback(struct urb *urb) · 165 unmodified lines
620626 netdev_info(netdev, "%s: Int URB aborted: %pe\n", __func__,
621627 ERR_PTR(urb->status));
622628
629+ if (urb->actual_length < sizeof(*data)) {
630+ netdev_warn(netdev, "%s: short int URB: %u < %zu\n",
631+ __func__, urb->actual_length, sizeof(*data));
632+ goto resubmit_urb;
633+ }
634+
623635 switch (urb->status) {
624636 case 0: /* success */
625637 break;
@@ -646,10 +658,15 @@ static void f81604_read_int_callback(struct urb *urb) · 20 unmodified lines
646658 f81604_handle_tx(priv, data);
647659
648660 resubmit_urb:
661+ usb_anchor_urb(urb, &priv->urbs_anchor);
649662 ret = usb_submit_urb(urb, GFP_ATOMIC);
663+ if (!ret)
664+ return;
665+ usb_unanchor_urb(urb);
666+
650667 if (ret == -ENODEV)
651668 netif_device_detach(netdev);
652− else if (ret)
669+ else
653670 netdev_err(netdev, "%s: failed to resubmit int urb: %pe\n",
654671 __func__, ERR_PTR(ret));
655672 }
@@ -874,9 +891,27 @@ static void f81604_write_bulk_callback(struct urb *urb) · 218 unmodified lines
874891 if (!netif_device_present(netdev))
875892 return;
876893
877− if (urb->status)
878− netdev_info(netdev, "%s: Tx URB error: %pe\n", __func__,
879− ERR_PTR(urb->status));
894+ if (!urb->status)
895+ return;
896+
897+ switch (urb->status) {
898+ case -ENOENT:
899+ case -ECONNRESET:
900+ case -ESHUTDOWN:
901+ return;
902+ default:
903+ break;
904+ }
905+
906+ if (net_ratelimit())
907+ netdev_err(netdev, "%s: Tx URB error: %pe\n", __func__,
908+ ERR_PTR(urb->status));
909+
910+ can_free_echo_skb(netdev, 0, NULL);
911+ netdev->stats.tx_dropped++;
912+ netdev->stats.tx_errors++;
913+
914+ netif_wake_queue(netdev);
880915 }
881916
882917 static void f81604_clear_reg_work(struct work_struct *work)
drivers/net/can/usb/gs_usb.c+16−6
@@ -772,9 +772,8 @@ device_detach: · 771 unmodified lines
772772 }
773773 }
774774
775−static int gs_usb_set_bittiming(struct net_device *netdev)
775+static int gs_usb_set_bittiming(struct gs_can *dev)
776776 {
777− struct gs_can *dev = netdev_priv(netdev);
778777 struct can_bittiming *bt = &dev->can.bittiming;
779778 struct gs_device_bittiming dbt = {
780779 .prop_seg = cpu_to_le32(bt->prop_seg),
@@ -791,9 +790,8 @@ static int gs_usb_set_bittiming(struct net_device *netdev) · 10 unmodified lines
791790 GFP_KERNEL);
792791 }
793792
794−static int gs_usb_set_data_bittiming(struct net_device *netdev)
793+static int gs_usb_set_data_bittiming(struct gs_can *dev)
795794 {
796− struct gs_can *dev = netdev_priv(netdev);
797795 struct can_bittiming *bt = &dev->can.fd.data_bittiming;
798796 struct gs_device_bittiming dbt = {
799797 .prop_seg = cpu_to_le32(bt->prop_seg),
@@ -1057,6 +1055,20 @@ static int gs_can_open(struct net_device *netdev) · 257 unmodified lines
10571055 if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
10581056 flags |= GS_CAN_MODE_HW_TIMESTAMP;
10591057
1058+ rc = gs_usb_set_bittiming(dev);
1059+ if (rc) {
1060+ netdev_err(netdev, "failed to set bittiming: %pe\n", ERR_PTR(rc));
1061+ goto out_usb_kill_anchored_urbs;
1062+ }
1063+
1064+ if (ctrlmode & CAN_CTRLMODE_FD) {
1065+ rc = gs_usb_set_data_bittiming(dev);
1066+ if (rc) {
1067+ netdev_err(netdev, "failed to set data bittiming: %pe\n", ERR_PTR(rc));
1068+ goto out_usb_kill_anchored_urbs;
1069+ }
1070+ }
1071+
10601072 /* finally start device */
10611073 dev->can.state = CAN_STATE_ERROR_ACTIVE;
10621074 dm.flags = cpu_to_le32(flags);
@@ -1370,7 +1382,6 @@ static struct gs_can *gs_make_candev(unsigned int channel, · 307 unmodified lines
13701382 dev->can.state = CAN_STATE_STOPPED;
13711383 dev->can.clock.freq = le32_to_cpu(bt_const.fclk_can);
13721384 dev->can.bittiming_const = &dev->bt_const;
1373− dev->can.do_set_bittiming = gs_usb_set_bittiming;
13741385
13751386 dev->can.ctrlmode_supported = CAN_CTRLMODE_CC_LEN8_DLC;
13761387
@@ -1394,7 +1405,6 @@ static struct gs_can *gs_make_candev(unsigned int channel, · 17 unmodified lines
13941405 * GS_CAN_FEATURE_BT_CONST_EXT is set.
13951406 */
13961407 dev->can.fd.data_bittiming_const = &dev->bt_const;
1397− dev->can.fd.do_set_data_bittiming = gs_usb_set_data_bittiming;
13981408 }
13991409
14001410 if (feature & GS_CAN_FEATURE_TERMINATION) {
drivers/net/can/usb/ucan.c+1−1
@@ -748,7 +748,7 @@ static void ucan_read_bulk_callback(struct urb *urb) · 747 unmodified lines
748748 len = le16_to_cpu(m->len);
749749
750750 /* check sanity (length of content) */
751− if (urb->actual_length - pos < len) {
751+ if ((len == 0) || (urb->actual_length - pos < len)) {
752752 netdev_warn(up->netdev,
753753 "invalid message (short; no data; l:%d)\n",
754754 urb->actual_length);
drivers/net/dsa/microchip/ksz_ptp.c+8−3
@@ -1108,6 +1108,7 @@ static int ksz_ptp_msg_irq_setup(struct ksz_port *port, u8 n) · 1107 unmodified lines
11081108 const struct ksz_dev_ops *ops = port->ksz_dev->dev_ops;
11091109 struct ksz_irq *ptpirq = &port->ptpirq;
11101110 struct ksz_ptp_irq *ptpmsg_irq;
1111+ int ret;
11111112
11121113 ptpmsg_irq = &port->ptpmsg_irq[n];
11131114 ptpmsg_irq->num = irq_create_mapping(ptpirq->domain, n);
@@ -1119,9 +1120,13 @@ static int ksz_ptp_msg_irq_setup(struct ksz_port *port, u8 n) · 5 unmodified lines
11191120
11201121 strscpy(ptpmsg_irq->name, name[n]);
11211122
1122− return request_threaded_irq(ptpmsg_irq->num, NULL,
1123− ksz_ptp_msg_thread_fn, IRQF_ONESHOT,
1124− ptpmsg_irq->name, ptpmsg_irq);
1123+ ret = request_threaded_irq(ptpmsg_irq->num, NULL,
1124+ ksz_ptp_msg_thread_fn, IRQF_ONESHOT,
1125+ ptpmsg_irq->name, ptpmsg_irq);
1126+ if (ret)
1127+ irq_dispose_mapping(ptpmsg_irq->num);
1128+
1129+ return ret;
11251130 }
11261131
11271132 int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p)
drivers/net/dsa/mxl862xx/mxl862xx.c+0−1
@@ -149,7 +149,6 @@ static int mxl862xx_setup_mdio(struct dsa_switch *ds) · 148 unmodified lines
149149 return -ENOMEM;
150150
151151 bus->priv = priv;
152− ds->user_mii_bus = bus;
153152 bus->name = KBUILD_MODNAME "-mii";
154153 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(dev));
155154 bus->read_c45 = mxl862xx_phy_read_c45_mii_bus;
drivers/net/dsa/realtek/rtl8365mb.c+2−3
@@ -769,7 +769,7 @@ static int rtl8365mb_phy_ocp_write(struct realtek_priv *priv, int phy, · 768 unmodified lines
769769 out:
770770 rtl83xx_unlock(priv);
771771
772− return 0;
772+ return ret;
773773 }
774774
775775 static int rtl8365mb_phy_read(struct realtek_priv *priv, int phy, int regnum)
@@ -1480,8 +1480,7 @@ static void rtl8365mb_stats_update(struct realtek_priv *priv, int port) · 704 unmodified lines
14801480
14811481 stats->rx_packets = cnt[RTL8365MB_MIB_ifInUcastPkts] +
14821482 cnt[RTL8365MB_MIB_ifInMulticastPkts] +
1483− cnt[RTL8365MB_MIB_ifInBroadcastPkts] -
1484− cnt[RTL8365MB_MIB_ifOutDiscards];
1483+ cnt[RTL8365MB_MIB_ifInBroadcastPkts];
14851484
14861485 stats->tx_packets = cnt[RTL8365MB_MIB_ifOutUcastPkts] +
14871486 cnt[RTL8365MB_MIB_ifOutMulticastPkts] +
drivers/net/dsa/realtek/rtl8366rb-leds.c+3−3
@@ -12,11 +12,11 @@ static inline u32 rtl8366rb_led_group_port_mask(u8 led_group, u8 port) · 11 unmodified lines
1212 case 0:
1313 return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
1414 case 1:
15− return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
15+ return FIELD_PREP(RTL8366RB_LED_X_1_CTRL_MASK, BIT(port));
1616 case 2:
17− return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
17+ return FIELD_PREP(RTL8366RB_LED_2_X_CTRL_MASK, BIT(port));
1818 case 3:
19− return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
19+ return FIELD_PREP(RTL8366RB_LED_X_3_CTRL_MASK, BIT(port));
2020 default:
2121 return 0;
2222 }
drivers/net/dsa/sja1105/sja1105_main.c+11−5
@@ -2278,6 +2278,12 @@ int sja1105_static_config_reload(struct sja1105_private *priv, · 2277 unmodified lines
22782278 * change it through the dynamic interface later.
22792279 */
22802280 dsa_switch_for_each_available_port(dp, ds) {
2281+ /* May be called during unbind when we unoffload a VLAN-aware
2282+ * bridge from port 1 while port 0 was already torn down
2283+ */
2284+ if (!dp->pl)
2285+ continue;
2286+
22812287 phylink_replay_link_begin(dp->pl);
22822288 mac[dp->index].speed = priv->info->port_speed[SJA1105_SPEED_AUTO];
22832289 }
@@ -2333,13 +2339,13 @@ int sja1105_static_config_reload(struct sja1105_private *priv, · 49 unmodified lines
23332339 goto out;
23342340 }
23352341
2336− dsa_switch_for_each_available_port(dp, ds)
2337− phylink_replay_link_end(dp->pl);
2338−
23392342 rc = sja1105_reload_cbs(priv);
2340− if (rc < 0)
2341− goto out;
2343+
23422344 out:
2345+ dsa_switch_for_each_available_port(dp, ds)
2346+ if (dp->pl)
2347+ phylink_replay_link_end(dp->pl);
2348+
23432349 mutex_unlock(&priv->mgmt_lock);
23442350 mutex_unlock(&priv->fdb_lock);
23452351
drivers/net/ethernet/amd/xgbe/xgbe-common.h+1−1
@@ -431,7 +431,7 @@ · 430 unmodified lines
431431 #define MAC_SSIR_SSINC_INDEX 16
432432 #define MAC_SSIR_SSINC_WIDTH 8
433433 #define MAC_TCR_SS_INDEX 29
434−#define MAC_TCR_SS_WIDTH 2
434+#define MAC_TCR_SS_WIDTH 3
435435 #define MAC_TCR_TE_INDEX 0
436436 #define MAC_TCR_TE_WIDTH 1
437437 #define MAC_TCR_VNE_INDEX 24
drivers/net/ethernet/amd/xgbe/xgbe-drv.c+10−19
@@ -1120,7 +1120,6 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller) · 1119 unmodified lines
11201120 {
11211121 struct xgbe_prv_data *pdata = netdev_priv(netdev);
11221122 struct xgbe_hw_if *hw_if = &pdata->hw_if;
1123− unsigned long flags;
11241123
11251124 DBGPR("-->xgbe_powerdown\n");
11261125
@@ -1131,8 +1130,6 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller) · 4 unmodified lines
11311130 return -EINVAL;
11321131 }
11331132
1134− spin_lock_irqsave(&pdata->lock, flags);
1135−
11361133 if (caller == XGMAC_DRIVER_CONTEXT)
11371134 netif_device_detach(netdev);
11381135
@@ -1148,8 +1145,6 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller) · 9 unmodified lines
11481145
11491146 pdata->power_down = 1;
11501147
1151− spin_unlock_irqrestore(&pdata->lock, flags);
1152−
11531148 DBGPR("<--xgbe_powerdown\n");
11541149
11551150 return 0;
@@ -1159,7 +1154,6 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller) · 3 unmodified lines
11591154 {
11601155 struct xgbe_prv_data *pdata = netdev_priv(netdev);
11611156 struct xgbe_hw_if *hw_if = &pdata->hw_if;
1162− unsigned long flags;
11631157
11641158 DBGPR("-->xgbe_powerup\n");
11651159
@@ -1170,8 +1164,6 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller) · 4 unmodified lines
11701164 return -EINVAL;
11711165 }
11721166
1173− spin_lock_irqsave(&pdata->lock, flags);
1174−
11751167 pdata->power_down = 0;
11761168
11771169 xgbe_napi_enable(pdata, 0);
@@ -1186,8 +1178,6 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller) · 8 unmodified lines
11861178
11871179 xgbe_start_timers(pdata);
11881180
1189− spin_unlock_irqrestore(&pdata->lock, flags);
1190−
11911181 DBGPR("<--xgbe_powerup\n");
11921182
11931183 return 0;
@@ -1281,20 +1271,25 @@ static int xgbe_start(struct xgbe_prv_data *pdata) · 87 unmodified lines
12811271 if (ret)
12821272 goto err_napi;
12831273
1274+ /* Reset the phy settings */
1275+ ret = xgbe_phy_reset(pdata);
1276+ if (ret)
1277+ goto err_irqs;
1278+
1279+ /* Start the phy */
12841280 ret = phy_if->phy_start(pdata);
12851281 if (ret)
12861282 goto err_irqs;
12871283
12881284 hw_if->enable_tx(pdata);
12891285 hw_if->enable_rx(pdata);
1286+ /* Synchronize flag with hardware state after enabling TX/RX.
1287+ * This prevents stale state after device restart cycles.
1288+ */
1289+ pdata->data_path_stopped = false;
12901290
12911291 udp_tunnel_nic_reset_ntf(netdev);
12921292
1293− /* Reset the phy settings */
1294− ret = xgbe_phy_reset(pdata);
1295− if (ret)
1296− goto err_txrx;
1297−
12981293 netif_tx_start_all_queues(netdev);
12991294
13001295 xgbe_start_timers(pdata);
@@ -1304,10 +1299,6 @@ static int xgbe_start(struct xgbe_prv_data *pdata) · 3 unmodified lines
13041299
13051300 return 0;
13061301
1307−err_txrx:
1308− hw_if->disable_rx(pdata);
1309− hw_if->disable_tx(pdata);
1310−
13111302 err_irqs:
13121303 xgbe_free_irqs(pdata);
13131304
drivers/net/ethernet/amd/xgbe/xgbe-main.c+0−1
@@ -76,7 +76,6 @@ struct xgbe_prv_data *xgbe_alloc_pdata(struct device *dev) · 75 unmodified lines
7676 pdata->netdev = netdev;
7777 pdata->dev = dev;
7878
79− spin_lock_init(&pdata->lock);
8079 spin_lock_init(&pdata->xpcs_lock);
8180 mutex_init(&pdata->rss_mutex);
8281 spin_lock_init(&pdata->tstamp_lock);
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c+75−7
@@ -1942,7 +1942,7 @@ static void xgbe_set_rx_adap_mode(struct xgbe_prv_data *pdata, · 1941 unmodified lines
19421942 static void xgbe_rx_adaptation(struct xgbe_prv_data *pdata)
19431943 {
19441944 struct xgbe_phy_data *phy_data = pdata->phy_data;
1945− unsigned int reg;
1945+ int reg;
19461946
19471947 /* step 2: force PCS to send RX_ADAPT Req to PHY */
19481948 XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_EQ_CTRL4,
@@ -1964,11 +1964,20 @@ static void xgbe_rx_adaptation(struct xgbe_prv_data *pdata) · 15 unmodified lines
19641964
19651965 /* Step 4: Check for Block lock */
19661966
1967− /* Link status is latched low, so read once to clear
1968− * and then read again to get current state
1969− */
1970− reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
19711967 reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
1968+ if (reg < 0)
1969+ goto set_mode;
1970+
1971+ /* Link status is latched low so that momentary link drops
1972+ * can be detected. If link was already down read again
1973+ * to get the latest state.
1974+ */
1975+ if (!pdata->phy.link && !(reg & MDIO_STAT1_LSTATUS)) {
1976+ reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
1977+ if (reg < 0)
1978+ goto set_mode;
1979+ }
1980+
19721981 if (reg & MDIO_STAT1_LSTATUS) {
19731982 /* If the block lock is found, update the helpers
19741983 * and declare the link up
@@ -2008,6 +2017,48 @@ rx_adapt_reinit: · 33 unmodified lines
20082017 xgbe_rx_adaptation(pdata);
20092018 }
20102019
2020+/*
2021+ * xgbe_phy_stop_data_path - Stop TX/RX to prevent packet corruption
2022+ * @pdata: driver private data
2023+ *
2024+ * This function stops the data path (TX and RX) to prevent packet
2025+ * corruption during critical PHY operations like RX adaptation.
2026+ * Must be called before initiating RX adaptation when link goes down.
2027+ */
2028+static void xgbe_phy_stop_data_path(struct xgbe_prv_data *pdata)
2029+{
2030+ if (pdata->data_path_stopped)
2031+ return;
2032+
2033+ /* Stop TX/RX to prevent packet corruption during RX adaptation */
2034+ pdata->hw_if.disable_tx(pdata);
2035+ pdata->hw_if.disable_rx(pdata);
2036+ pdata->data_path_stopped = true;
2037+
2038+ netif_dbg(pdata, link, pdata->netdev,
2039+ "stopping data path for RX adaptation\n");
2040+}
2041+
2042+/*
2043+ * xgbe_phy_start_data_path - Re-enable TX/RX after RX adaptation
2044+ * @pdata: driver private data
2045+ *
2046+ * This function re-enables the data path (TX and RX) after RX adaptation
2047+ * has completed successfully. Only called when link is confirmed up.
2048+ */
2049+static void xgbe_phy_start_data_path(struct xgbe_prv_data *pdata)
2050+{
2051+ if (!pdata->data_path_stopped)
2052+ return;
2053+
2054+ pdata->hw_if.enable_rx(pdata);
2055+ pdata->hw_if.enable_tx(pdata);
2056+ pdata->data_path_stopped = false;
2057+
2058+ netif_dbg(pdata, link, pdata->netdev,
2059+ "restarting data path after RX adaptation\n");
2060+}
2061+
20112062 static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
20122063 {
20132064 int reg;
@@ -2801,13 +2852,27 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart) · 787 unmodified lines
28012852 if (pdata->en_rx_adap) {
28022853 /* if the link is available and adaptation is done,
28032854 * declare link up
2855+ *
2856+ * Note: When link is up and adaptation is done, we can
2857+ * safely re-enable the data path if it was stopped
2858+ * for adaptation.
28042859 */
2805− if ((reg & MDIO_STAT1_LSTATUS) && pdata->rx_adapt_done)
2860+ if ((reg & MDIO_STAT1_LSTATUS) && pdata->rx_adapt_done) {
2861+ xgbe_phy_start_data_path(pdata);
28062862 return 1;
2863+ }
28072864 /* If either link is not available or adaptation is not done,
28082865 * retrigger the adaptation logic. (if the mode is not set,
28092866 * then issue mailbox command first)
28102867 */
2868+
2869+ /* CRITICAL: Stop data path BEFORE triggering RX adaptation
2870+ * to prevent CRC errors from packets corrupted during
2871+ * the adaptation process. This is especially important
2872+ * when AN is OFF in 10G KR mode.
2873+ */
2874+ xgbe_phy_stop_data_path(pdata);
2875+
28112876 if (pdata->mode_set) {
28122877 xgbe_phy_rx_adaptation(pdata);
28132878 } else {
@@ -2815,8 +2880,11 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart) · 1 unmodified line
28152880 xgbe_phy_set_mode(pdata, phy_data->cur_mode);
28162881 }
28172882
2818− if (pdata->rx_adapt_done)
2883+ if (pdata->rx_adapt_done) {
2884+ /* Adaptation complete, safe to re-enable data path */
2885+ xgbe_phy_start_data_path(pdata);
28192886 return 1;
2887+ }
28202888 } else if (reg & MDIO_STAT1_LSTATUS)
28212889 return 1;
28222890
drivers/net/ethernet/amd/xgbe/xgbe.h+4−3
@@ -1004,9 +1004,6 @@ struct xgbe_prv_data { · 1003 unmodified lines
10041004 unsigned int pp3;
10051005 unsigned int pp4;
10061006
1007− /* Overall device lock */
1008− spinlock_t lock;
1009−
10101007 /* XPCS indirect addressing lock */
10111008 spinlock_t xpcs_lock;
10121009 unsigned int xpcs_window_def_reg;
@@ -1246,6 +1243,10 @@ struct xgbe_prv_data { · 233 unmodified lines
12461243 bool en_rx_adap;
12471244 int rx_adapt_retries;
12481245 bool rx_adapt_done;
1246+ /* Flag to track if data path (TX/RX) was stopped for RX adaptation.
1247+ * This prevents packet corruption during the adaptation window.
1248+ */
1249+ bool data_path_stopped;
12491250 bool mode_set;
12501251 bool sph;
12511252 };
drivers/net/ethernet/arc/emac_main.c+11−0
@@ -934,6 +934,17 @@ int arc_emac_probe(struct net_device *ndev, int interface) · 933 unmodified lines
934934 /* Set poll rate so that it polls every 1 ms */
935935 arc_reg_set(priv, R_POLLRATE, clock_frequency / 1000000);
936936
937+ /*
938+ * Put the device into a known quiescent state before requesting
939+ * the IRQ. Clear only EMAC interrupt status bits here; leave the
940+ * MDIO completion bit alone and avoid writing TXPL_MASK, which is
941+ * used to force TX polling rather than acknowledge interrupts.
942+ */
943+ arc_reg_set(priv, R_ENABLE, 0);
944+ arc_reg_set(priv, R_STATUS, RXINT_MASK | TXINT_MASK | ERR_MASK |
945+ TXCH_MASK | MSER_MASK | RXCR_MASK |
946+ RXFR_MASK | RXFL_MASK);
947+
937948 ndev->irq = irq;
938949 dev_info(dev, "IRQ is %d\n", ndev->irq);
939950
drivers/net/ethernet/broadcom/bnxt/bnxt.c+7−6
@@ -6232,6 +6232,9 @@ int bnxt_hwrm_cfa_ntuple_filter_free(struct bnxt *bp, · 6231 unmodified lines
62326232 int rc;
62336233
62346234 set_bit(BNXT_FLTR_FW_DELETED, &fltr->base.state);
6235+ if (!test_bit(BNXT_STATE_OPEN, &bp->state))
6236+ return 0;
6237+
62356238 rc = hwrm_req_init(bp, req, HWRM_CFA_NTUPLE_FILTER_FREE);
62366239 if (rc)
62376240 return rc;
@@ -10879,12 +10882,10 @@ void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx, · 4641 unmodified lines
1087910882 struct bnxt_ntuple_filter *ntp_fltr;
1088010883 int i;
1088110884
10882− if (netif_running(bp->dev)) {
10883− bnxt_hwrm_vnic_free_one(bp, &rss_ctx->vnic);
10884− for (i = 0; i < BNXT_MAX_CTX_PER_VNIC; i++) {
10885− if (vnic->fw_rss_cos_lb_ctx[i] != INVALID_HW_RING_ID)
10886− bnxt_hwrm_vnic_ctx_free_one(bp, vnic, i);
10887− }
10885+ bnxt_hwrm_vnic_free_one(bp, &rss_ctx->vnic);
10886+ for (i = 0; i < BNXT_MAX_CTX_PER_VNIC; i++) {
10887+ if (vnic->fw_rss_cos_lb_ctx[i] != INVALID_HW_RING_ID)
10888+ bnxt_hwrm_vnic_ctx_free_one(bp, vnic, i);
1088810889 }
1088910890 if (!all)
1089010891 return;
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+2−2
@@ -979,8 +979,8 @@ static int bnxt_set_channels(struct net_device *dev, · 978 unmodified lines
979979
980980 if (bnxt_get_nr_rss_ctxs(bp, req_rx_rings) !=
981981 bnxt_get_nr_rss_ctxs(bp, bp->rx_nr_rings) &&
982− netif_is_rxfh_configured(dev)) {
983− netdev_warn(dev, "RSS table size change required, RSS table entries must be default to proceed\n");
982+ (netif_is_rxfh_configured(dev) || bp->num_rss_ctx)) {
983+ netdev_warn(dev, "RSS table size change required, RSS table entries must be default (with no additional RSS contexts present) to proceed\n");
984984 return -EINVAL;
985985 }
986986
drivers/net/ethernet/broadcom/genet/bcmgenet.c+12−19
@@ -1342,8 +1342,7 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev, · 1341 unmodified lines
13421342 }
13431343 }
13441344
1345−void bcmgenet_eee_enable_set(struct net_device *dev, bool enable,
1346− bool tx_lpi_enabled)
1345+void bcmgenet_eee_enable_set(struct net_device *dev, bool enable)
13471346 {
13481347 struct bcmgenet_priv *priv = netdev_priv(dev);
13491348 u32 off = priv->hw_params->tbuf_offset + TBUF_ENERGY_CTRL;
@@ -1363,7 +1362,7 @@ void bcmgenet_eee_enable_set(struct net_device *dev, bool enable, · 13 unmodified lines
13631362
13641363 /* Enable EEE and switch to a 27Mhz clock automatically */
13651364 reg = bcmgenet_readl(priv->base + off);
1366− if (tx_lpi_enabled)
1365+ if (enable)
13671366 reg |= TBUF_EEE_EN | TBUF_PM_EN;
13681367 else
13691368 reg &= ~(TBUF_EEE_EN | TBUF_PM_EN);
@@ -1382,14 +1381,12 @@ void bcmgenet_eee_enable_set(struct net_device *dev, bool enable, · 12 unmodified lines
13821381 priv->clk_eee_enabled = false;
13831382 }
13841383
1385− priv->eee.eee_enabled = enable;
1386− priv->eee.tx_lpi_enabled = tx_lpi_enabled;
13871384 }
13881385
13891386 static int bcmgenet_get_eee(struct net_device *dev, struct ethtool_keee *e)
13901387 {
13911388 struct bcmgenet_priv *priv = netdev_priv(dev);
1392− struct ethtool_keee *p = &priv->eee;
1389+ int ret;
13931390
13941391 if (GENET_IS_V1(priv))
13951392 return -EOPNOTSUPP;
@@ -1397,17 +1394,21 @@ static int bcmgenet_get_eee(struct net_device *dev, struct ethtool_keee *e) · 1 unmodified line
13971394 if (!dev->phydev)
13981395 return -ENODEV;
13991396
1400− e->tx_lpi_enabled = p->tx_lpi_enabled;
1397+ ret = phy_ethtool_get_eee(dev->phydev, e);
1398+ if (ret)
1399+ return ret;
1400+
1401+ /* tx_lpi_timer is maintained by the MAC hardware register; the
1402+ * PHY-level eee_cfg timer is not set for GENET.
1403+ */
14011404 e->tx_lpi_timer = bcmgenet_umac_readl(priv, UMAC_EEE_LPI_TIMER);
14021405
1403− return phy_ethtool_get_eee(dev->phydev, e);
1406+ return 0;
14041407 }
14051408
14061409 static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_keee *e)
14071410 {
14081411 struct bcmgenet_priv *priv = netdev_priv(dev);
1409− struct ethtool_keee *p = &priv->eee;
1410− bool active;
14111412
14121413 if (GENET_IS_V1(priv))
14131414 return -EOPNOTSUPP;
@@ -1415,15 +1416,7 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_keee *e) · 1 unmodified line
14151416 if (!dev->phydev)
14161417 return -ENODEV;
14171418
1418− p->eee_enabled = e->eee_enabled;
1419−
1420− if (!p->eee_enabled) {
1421− bcmgenet_eee_enable_set(dev, false, false);
1422− } else {
1423− active = phy_init_eee(dev->phydev, false) >= 0;
1424− bcmgenet_umac_writel(priv, e->tx_lpi_timer, UMAC_EEE_LPI_TIMER);
1425− bcmgenet_eee_enable_set(dev, active, e->tx_lpi_enabled);
1426− }
1419+ bcmgenet_umac_writel(priv, e->tx_lpi_timer, UMAC_EEE_LPI_TIMER);
14271420
14281421 return phy_ethtool_set_eee(dev->phydev, e);
14291422 }
drivers/net/ethernet/broadcom/genet/bcmgenet.h+1−4
@@ -665,8 +665,6 @@ struct bcmgenet_priv { · 664 unmodified lines
665665 u8 sopass[SOPASS_MAX];
666666
667667 struct bcmgenet_mib_counters mib;
668−
669− struct ethtool_keee eee;
670668 };
671669
672670 static inline bool bcmgenet_has_40bits(struct bcmgenet_priv *priv)
@@ -749,7 +747,6 @@ int bcmgenet_wol_power_down_cfg(struct bcmgenet_priv *priv, · 76 unmodified lines
749747 int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv,
750748 enum bcmgenet_power_mode mode);
751749
752−void bcmgenet_eee_enable_set(struct net_device *dev, bool enable,
753− bool tx_lpi_enabled);
750+void bcmgenet_eee_enable_set(struct net_device *dev, bool enable);
754751
755752 #endif /* __BCMGENET_H__ */
drivers/net/ethernet/broadcom/genet/bcmmii.c+5−5
@@ -29,7 +29,6 @@ static void bcmgenet_mac_config(struct net_device *dev) · 28 unmodified lines
2929 struct bcmgenet_priv *priv = netdev_priv(dev);
3030 struct phy_device *phydev = dev->phydev;
3131 u32 reg, cmd_bits = 0;
32− bool active;
3332
3433 /* speed */
3534 if (phydev->speed == SPEED_1000)
@@ -90,10 +89,6 @@ static void bcmgenet_mac_config(struct net_device *dev) · 54 unmodified lines
9089 bcmgenet_umac_writel(priv, reg, UMAC_CMD);
9190 spin_unlock_bh(&priv->reg_lock);
9291
93− active = phy_init_eee(phydev, 0) >= 0;
94− bcmgenet_eee_enable_set(dev,
95− priv->eee.eee_enabled && active,
96− priv->eee.tx_lpi_enabled);
9792 }
9893
9994 /* setup netdev link state when PHY link status change and
@@ -113,6 +108,8 @@ void bcmgenet_mii_setup(struct net_device *dev) · 13 unmodified lines
113108 bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
114109 }
115110
111+ bcmgenet_eee_enable_set(dev, phydev->enable_tx_lpi);
112+
116113 phy_print_status(phydev);
117114 }
118115
@@ -412,6 +409,9 @@ int bcmgenet_mii_probe(struct net_device *dev) · 293 unmodified lines
412409 /* Indicate that the MAC is responsible for PHY PM */
413410 dev->phydev->mac_managed_pm = true;
414411
412+ if (!GENET_IS_V1(priv))
413+ phy_support_eee(dev->phydev);
414+
415415 return 0;
416416 }
417417
drivers/net/ethernet/cadence/macb_main.c+95−3
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <linux/tcp.h>
3737 #include <linux/types.h>
3838 #include <linux/udp.h>
39+#include <linux/gcd.h>
3940 #include <net/pkt_sched.h>
4041 #include "macb.h"
4142
@@ -668,6 +669,97 @@ static void macb_mac_link_down(struct phylink_config *config, unsigned int mode, · 626 unmodified lines
668669 netif_tx_stop_all_queues(ndev);
669670 }
670671
672+/* Use juggling algorithm to left rotate tx ring and tx skb array */
673+static void gem_shuffle_tx_one_ring(struct macb_queue *queue)
674+{
675+ unsigned int head, tail, count, ring_size, desc_size;
676+ struct macb_tx_skb tx_skb, *skb_curr, *skb_next;
677+ struct macb_dma_desc *desc_curr, *desc_next;
678+ unsigned int i, cycles, shift, curr, next;
679+ struct macb *bp = queue->bp;
680+ unsigned char desc[24];
681+ unsigned long flags;
682+
683+ desc_size = macb_dma_desc_get_size(bp);
684+
685+ if (WARN_ON_ONCE(desc_size > ARRAY_SIZE(desc)))
686+ return;
687+
688+ spin_lock_irqsave(&queue->tx_ptr_lock, flags);
689+ head = queue->tx_head;
690+ tail = queue->tx_tail;
691+ ring_size = bp->tx_ring_size;
692+ count = CIRC_CNT(head, tail, ring_size);
693+
694+ if (!(tail % ring_size))
695+ goto unlock;
696+
697+ if (!count) {
698+ queue->tx_head = 0;
699+ queue->tx_tail = 0;
700+ goto unlock;
701+ }
702+
703+ shift = tail % ring_size;
704+ cycles = gcd(ring_size, shift);
705+
706+ for (i = 0; i < cycles; i++) {
707+ memcpy(&desc, macb_tx_desc(queue, i), desc_size);
708+ memcpy(&tx_skb, macb_tx_skb(queue, i),
709+ sizeof(struct macb_tx_skb));
710+
711+ curr = i;
712+ next = (curr + shift) % ring_size;
713+
714+ while (next != i) {
715+ desc_curr = macb_tx_desc(queue, curr);
716+ desc_next = macb_tx_desc(queue, next);
717+
718+ memcpy(desc_curr, desc_next, desc_size);
719+
720+ if (next == ring_size - 1)
721+ desc_curr->ctrl &= ~MACB_BIT(TX_WRAP);
722+ if (curr == ring_size - 1)
723+ desc_curr->ctrl |= MACB_BIT(TX_WRAP);
724+
725+ skb_curr = macb_tx_skb(queue, curr);
726+ skb_next = macb_tx_skb(queue, next);
727+ memcpy(skb_curr, skb_next, sizeof(struct macb_tx_skb));
728+
729+ curr = next;
730+ next = (curr + shift) % ring_size;
731+ }
732+
733+ desc_curr = macb_tx_desc(queue, curr);
734+ memcpy(desc_curr, &desc, desc_size);
735+ if (i == ring_size - 1)
736+ desc_curr->ctrl &= ~MACB_BIT(TX_WRAP);
737+ if (curr == ring_size - 1)
738+ desc_curr->ctrl |= MACB_BIT(TX_WRAP);
739+ memcpy(macb_tx_skb(queue, curr), &tx_skb,
740+ sizeof(struct macb_tx_skb));
741+ }
742+
743+ queue->tx_head = count;
744+ queue->tx_tail = 0;
745+
746+ /* Make descriptor updates visible to hardware */
747+ wmb();
748+
749+unlock:
750+ spin_unlock_irqrestore(&queue->tx_ptr_lock, flags);
751+}
752+
753+/* Rotate the queue so that the tail is at index 0 */
754+static void gem_shuffle_tx_rings(struct macb *bp)
755+{
756+ struct macb_queue *queue;
757+ int q;
758+
759+ for (q = 0, queue = bp->queues; q < bp->num_queues; q++, queue++)
760+ gem_shuffle_tx_one_ring(queue);
761+}
762+
671763 static void macb_mac_link_up(struct phylink_config *config,
672764 struct phy_device *phy,
673765 unsigned int mode, phy_interface_t interface,
@@ -706,8 +798,6 @@ static void macb_mac_link_up(struct phylink_config *config, · 32 unmodified lines
706798 ctrl |= MACB_BIT(PAE);
707799
708800 for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
709− queue->tx_head = 0;
710− queue->tx_tail = 0;
711801 queue_writel(queue, IER,
712802 bp->rx_intr_mask | MACB_TX_INT_FLAGS | MACB_BIT(HRESP));
713803 }
@@ -721,8 +811,10 @@ static void macb_mac_link_up(struct phylink_config *config, · 7 unmodified lines
721811
722812 spin_unlock_irqrestore(&bp->lock, flags);
723813
724− if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC))
814+ if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC)) {
725815 macb_set_tx_clk(bp, speed);
816+ gem_shuffle_tx_rings(bp);
817+ }
726818
727819 /* Enable Rx and Tx; Enable PTP unicast */
728820 ctrl = macb_readl(bp, NCR);
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c+9−1
@@ -1533,7 +1533,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) · 1532 unmodified lines
15331533 if_id = (status & 0xFFFF0000) >> 16;
15341534 if (if_id >= ethsw->sw_attr.num_ifs) {
15351535 dev_err(dev, "Invalid if_id %d in IRQ status\n", if_id);
1536− goto out;
1536+ goto out_clear;
15371537 }
15381538 port_priv = ethsw->ports[if_id];
15391539
@@ -1553,6 +1553,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) · 13 unmodified lines
15531553 dpaa2_switch_port_connect_mac(port_priv);
15541554 }
15551555
1556+out_clear:
15561557 err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle,
15571558 DPSW_IRQ_INDEX_IF, status);
15581559 if (err)
@@ -3034,6 +3035,13 @@ static int dpaa2_switch_init(struct fsl_mc_device *sw_dev) · 1475 unmodified lines
30343035 goto err_close;
30353036 }
30363037
3038+ if (ethsw->sw_attr.num_ifs >= DPSW_MAX_IF) {
3039+ dev_err(dev, "DPSW num_ifs %u exceeds max %u\n",
3040+ ethsw->sw_attr.num_ifs, DPSW_MAX_IF);
3041+ err = -EINVAL;
3042+ goto err_close;
3043+ }
3044+
30373045 err = dpsw_get_api_version(ethsw->mc_io, 0,
30383046 &ethsw->major,
30393047 &ethsw->minor);
drivers/net/ethernet/freescale/enetc/enetc.c+1−1
@@ -3467,7 +3467,7 @@ static int enetc_int_vector_init(struct enetc_ndev_priv *priv, int i, · 3466 unmodified lines
34673467 priv->rx_ring[i] = bdr;
34683468
34693469 err = __xdp_rxq_info_reg(&bdr->xdp.rxq, priv->ndev, i, 0,
3470− ENETC_RXB_DMA_SIZE_XDP);
3470+ ENETC_RXB_TRUESIZE);
34713471 if (err)
34723472 goto free_vector;
34733473
drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c+10−14
@@ -333,11 +333,13 @@ static int netc_get_phy_addr(struct device_node *np) · 332 unmodified lines
333333
334334 mdio_node = of_get_child_by_name(np, "mdio");
335335 if (!mdio_node)
336− return 0;
336+ return -ENODEV;
337337
338338 phy_node = of_get_next_child(mdio_node, NULL);
339− if (!phy_node)
339+ if (!phy_node) {
340+ err = -ENODEV;
340341 goto of_put_mdio_node;
342+ }
341343
342344 err = of_property_read_u32(phy_node, "reg", &addr);
343345 if (err)
@@ -423,6 +425,9 @@ static int imx95_enetc_mdio_phyaddr_config(struct platform_device *pdev) · 79 unmodified lines
423425
424426 addr = netc_get_phy_addr(gchild);
425427 if (addr < 0) {
428+ if (addr == -ENODEV)
429+ continue;
430+
426431 dev_err(dev, "Failed to get PHY address\n");
427432 return addr;
428433 }
@@ -433,12 +438,6 @@ static int imx95_enetc_mdio_phyaddr_config(struct platform_device *pdev) · 4 unmodified lines
433438 return -EINVAL;
434439 }
435440
436− /* The default value of LaBCR[MDIO_PHYAD_PRTAD ] is
437− * 0, so no need to set the register.
438− */
439− if (!addr)
440− continue;
441−
442441 switch (bus_devfn) {
443442 case IMX95_ENETC0_BUS_DEVFN:
444443 netc_reg_write(priv->ierb, IERB_LBCR(0),
@@ -578,16 +577,13 @@ static int imx94_enetc_mdio_phyaddr_config(struct netc_blk_ctrl *priv, · 133 unmodified lines
578577
579578 addr = netc_get_phy_addr(np);
580579 if (addr < 0) {
580+ if (addr == -ENODEV)
581+ return 0;
582+
581583 dev_err(dev, "Failed to get PHY address\n");
582584 return addr;
583585 }
584586
585− /* The default value of LaBCR[MDIO_PHYAD_PRTAD] is 0,
586− * so no need to set the register.
587− */
588− if (!addr)
589− return 0;
590−
591587 if (phy_mask & BIT(addr)) {
592588 dev_err(dev,
593589 "Find same PHY address in EMDIO and ENETC node\n");
drivers/net/ethernet/google/gve/gve_tx_dqo.c+25−31
@@ -167,6 +167,25 @@ gve_free_pending_packet(struct gve_tx_ring *tx, · 166 unmodified lines
167167 }
168168 }
169169
170+static void gve_unmap_packet(struct device *dev,
171+ struct gve_tx_pending_packet_dqo *pkt)
172+{
173+ int i;
174+
175+ if (!pkt->num_bufs)
176+ return;
177+
178+ /* SKB linear portion is guaranteed to be mapped */
179+ dma_unmap_single(dev, dma_unmap_addr(pkt, dma[0]),
180+ dma_unmap_len(pkt, len[0]), DMA_TO_DEVICE);
181+ for (i = 1; i < pkt->num_bufs; i++) {
182+ netmem_dma_unmap_page_attrs(dev, dma_unmap_addr(pkt, dma[i]),
183+ dma_unmap_len(pkt, len[i]),
184+ DMA_TO_DEVICE, 0);
185+ }
186+ pkt->num_bufs = 0;
187+}
188+
170189 /* gve_tx_free_desc - Cleans up all pending tx requests and buffers.
171190 */
172191 static void gve_tx_clean_pending_packets(struct gve_tx_ring *tx)
@@ -176,21 +195,12 @@ static void gve_tx_clean_pending_packets(struct gve_tx_ring *tx) · 3 unmodified lines
176195 for (i = 0; i < tx->dqo.num_pending_packets; i++) {
177196 struct gve_tx_pending_packet_dqo *cur_state =
178197 &tx->dqo.pending_packets[i];
179− int j;
180−
181− for (j = 0; j < cur_state->num_bufs; j++) {
182− if (j == 0) {
183− dma_unmap_single(tx->dev,
184− dma_unmap_addr(cur_state, dma[j]),
185− dma_unmap_len(cur_state, len[j]),
186− DMA_TO_DEVICE);
187− } else {
188− dma_unmap_page(tx->dev,
189− dma_unmap_addr(cur_state, dma[j]),
190− dma_unmap_len(cur_state, len[j]),
191− DMA_TO_DEVICE);
192− }
193− }
198+
199+ if (tx->dqo.qpl)
200+ gve_free_tx_qpl_bufs(tx, cur_state);
201+ else
202+ gve_unmap_packet(tx->dev, cur_state);
203+
194204 if (cur_state->skb) {
195205 dev_consume_skb_any(cur_state->skb);
196206 cur_state->skb = NULL;
@@ -1154,22 +1164,6 @@ static void remove_from_list(struct gve_tx_ring *tx, · 957 unmodified lines
11541164 }
11551165 }
11561166
1157−static void gve_unmap_packet(struct device *dev,
1158− struct gve_tx_pending_packet_dqo *pkt)
1159−{
1160− int i;
1161−
1162− /* SKB linear portion is guaranteed to be mapped */
1163− dma_unmap_single(dev, dma_unmap_addr(pkt, dma[0]),
1164− dma_unmap_len(pkt, len[0]), DMA_TO_DEVICE);
1165− for (i = 1; i < pkt->num_bufs; i++) {
1166− netmem_dma_unmap_page_attrs(dev, dma_unmap_addr(pkt, dma[i]),
1167− dma_unmap_len(pkt, len[i]),
1168− DMA_TO_DEVICE, 0);
1169− }
1170− pkt->num_bufs = 0;
1171−}
1172−
11731167 /* Completion types and expected behavior:
11741168 * No Miss compl + Packet compl = Packet completed normally.
11751169 * Miss compl + Re-inject compl = Packet completed normally.
drivers/net/ethernet/intel/e1000/e1000_main.c+0−2
@@ -2952,8 +2952,6 @@ static int e1000_tx_map(struct e1000_adapter *adapter, · 2951 unmodified lines
29522952 dma_error:
29532953 dev_err(&pdev->dev, "TX DMA map failed\n");
29542954 buffer_info->dma = 0;
2955− if (count)
2956− count--;
29572955
29582956 while (count--) {
29592957 if (i == 0)
drivers/net/ethernet/intel/e1000e/defines.h+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333
3434 /* Extended Device Control */
3535 #define E1000_CTRL_EXT_LPCD 0x00000004 /* LCD Power Cycle Done */
36+#define E1000_CTRL_EXT_DPG_EN 0x00000008 /* Dynamic Power Gating Enable */
3637 #define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Definable Pin 3 */
3738 #define E1000_CTRL_EXT_FORCE_SMBUS 0x00000800 /* Force SMBus mode */
3839 #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
drivers/net/ethernet/intel/e1000e/e1000.h+3−1
@@ -117,7 +117,8 @@ enum e1000_boards { · 116 unmodified lines
117117 board_pch_cnp,
118118 board_pch_tgp,
119119 board_pch_adp,
120− board_pch_mtp
120+ board_pch_mtp,
121+ board_pch_ptp
121122 };
122123
123124 struct e1000_ps_page {
@@ -527,6 +528,7 @@ extern const struct e1000_info e1000_pch_cnp_info; · 403 unmodified lines
527528 extern const struct e1000_info e1000_pch_tgp_info;
528529 extern const struct e1000_info e1000_pch_adp_info;
529530 extern const struct e1000_info e1000_pch_mtp_info;
531+extern const struct e1000_info e1000_pch_ptp_info;
530532 extern const struct e1000_info e1000_es2_info;
531533
532534 void e1000e_ptp_init(struct e1000_adapter *adapter);
drivers/net/ethernet/intel/e1000e/hw.h+0−2
@@ -118,8 +118,6 @@ struct e1000_hw; · 117 unmodified lines
118118 #define E1000_DEV_ID_PCH_ARL_I219_V24 0x57A1
119119 #define E1000_DEV_ID_PCH_PTP_I219_LM25 0x57B3
120120 #define E1000_DEV_ID_PCH_PTP_I219_V25 0x57B4
121−#define E1000_DEV_ID_PCH_PTP_I219_LM26 0x57B5
122−#define E1000_DEV_ID_PCH_PTP_I219_V26 0x57B6
123121 #define E1000_DEV_ID_PCH_PTP_I219_LM27 0x57B7
124122 #define E1000_DEV_ID_PCH_PTP_I219_V27 0x57B8
125123 #define E1000_DEV_ID_PCH_NVL_I219_LM29 0x57B9
drivers/net/ethernet/intel/e1000e/ich8lan.c+30−1
@@ -528,7 +528,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) · 527 unmodified lines
528528
529529 phy->id = e1000_phy_unknown;
530530
531− if (hw->mac.type == e1000_pch_mtp) {
531+ if (hw->mac.type == e1000_pch_mtp || hw->mac.type == e1000_pch_ptp) {
532532 phy->retry_count = 2;
533533 e1000e_enable_phy_retry(hw);
534534 }
@@ -4932,6 +4932,15 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) · 4397 unmodified lines
49324932 reg |= E1000_KABGTXD_BGSQLBIAS;
49334933 ew32(KABGTXD, reg);
49344934
4935+ /* The hardware reset value of the DPG_EN bit is 1.
4936+ * Clear DPG_EN to prevent unexpected autonomous power gating.
4937+ */
4938+ if (hw->mac.type >= e1000_pch_ptp) {
4939+ reg = er32(CTRL_EXT);
4940+ reg &= ~E1000_CTRL_EXT_DPG_EN;
4941+ ew32(CTRL_EXT, reg);
4942+ }
4943+
49354944 return 0;
49364945 }
49374946
@@ -6208,3 +6217,23 @@ const struct e1000_info e1000_pch_mtp_info = { · 1270 unmodified lines
62086217 .phy_ops = &ich8_phy_ops,
62096218 .nvm_ops = &spt_nvm_ops,
62106219 };
6220+
6221+const struct e1000_info e1000_pch_ptp_info = {
6222+ .mac = e1000_pch_ptp,
6223+ .flags = FLAG_IS_ICH
6224+ | FLAG_HAS_WOL
6225+ | FLAG_HAS_HW_TIMESTAMP
6226+ | FLAG_HAS_CTRLEXT_ON_LOAD
6227+ | FLAG_HAS_AMT
6228+ | FLAG_HAS_FLASH
6229+ | FLAG_HAS_JUMBO_FRAMES
6230+ | FLAG_APME_IN_WUC,
6231+ .flags2 = FLAG2_HAS_PHY_STATS
6232+ | FLAG2_HAS_EEE,
6233+ .pba = 26,
6234+ .max_hw_frame_size = 9022,
6235+ .get_variants = e1000_get_variants_ich8lan,
6236+ .mac_ops = &ich8_mac_ops,
6237+ .phy_ops = &ich8_phy_ops,
6238+ .nvm_ops = &spt_nvm_ops,
6239+};
drivers/net/ethernet/intel/e1000e/netdev.c+7−10
@@ -55,6 +55,7 @@ static const struct e1000_info *e1000_info_tbl[] = { · 54 unmodified lines
5555 [board_pch_tgp] = &e1000_pch_tgp_info,
5656 [board_pch_adp] = &e1000_pch_adp_info,
5757 [board_pch_mtp] = &e1000_pch_mtp_info,
58+ [board_pch_ptp] = &e1000_pch_ptp_info,
5859 };
5960
6061 struct e1000_reg_info {
@@ -5651,8 +5652,6 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb, · 5590 unmodified lines
56515652 dma_error:
56525653 dev_err(&pdev->dev, "Tx DMA map failed\n");
56535654 buffer_info->dma = 0;
5654− if (count)
5655− count--;
56565655
56575656 while (count--) {
56585657 if (i == 0)
@@ -7922,14 +7921,12 @@ static const struct pci_device_id e1000_pci_tbl[] = { · 2263 unmodified lines
79227921 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21), board_pch_mtp },
79237922 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ARL_I219_LM24), board_pch_mtp },
79247923 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ARL_I219_V24), board_pch_mtp },
7925− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM25), board_pch_mtp },
7926− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V25), board_pch_mtp },
7927− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM26), board_pch_mtp },
7928− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V26), board_pch_mtp },
7929− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM27), board_pch_mtp },
7930− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V27), board_pch_mtp },
7931− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_LM29), board_pch_mtp },
7932− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_V29), board_pch_mtp },
7924+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM25), board_pch_ptp },
7925+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V25), board_pch_ptp },
7926+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM27), board_pch_ptp },
7927+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V27), board_pch_ptp },
7928+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_LM29), board_pch_ptp },
7929+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_V29), board_pch_ptp },
79337930
79347931 { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
79357932 };
drivers/net/ethernet/intel/i40e/i40e_main.c+24−17
@@ -3569,6 +3569,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring) · 3568 unmodified lines
35693569 u16 pf_q = vsi->base_queue + ring->queue_index;
35703570 struct i40e_hw *hw = &vsi->back->hw;
35713571 struct i40e_hmc_obj_rxq rx_ctx;
3572+ u32 xdp_frame_sz;
35723573 int err = 0;
35733574 bool ok;
35743575
@@ -3578,49 +3579,47 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring) · 3 unmodified lines
35783579 memset(&rx_ctx, 0, sizeof(rx_ctx));
35793580
35803581 ring->rx_buf_len = vsi->rx_buf_len;
3582+ xdp_frame_sz = i40e_rx_pg_size(ring) / 2;
35813583
35823584 /* XDP RX-queue info only needed for RX rings exposed to XDP */
35833585 if (ring->vsi->type != I40E_VSI_MAIN)
35843586 goto skip;
35853587
3586− if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
3587− err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
3588− ring->queue_index,
3589− ring->q_vector->napi.napi_id,
3590− ring->rx_buf_len);
3591− if (err)
3592− return err;
3593− }
3594−
35953588 ring->xsk_pool = i40e_xsk_pool(ring);
35963589 if (ring->xsk_pool) {
3597− xdp_rxq_info_unreg(&ring->xdp_rxq);
3590+ xdp_frame_sz = xsk_pool_get_rx_frag_step(ring->xsk_pool);
35983591 ring->rx_buf_len = xsk_pool_get_rx_frame_size(ring->xsk_pool);
35993592 err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
36003593 ring->queue_index,
36013594 ring->q_vector->napi.napi_id,
3602− ring->rx_buf_len);
3595+ xdp_frame_sz);
36033596 if (err)
36043597 return err;
36053598 err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
36063599 MEM_TYPE_XSK_BUFF_POOL,
36073600 NULL);
36083601 if (err)
3609− return err;
3602+ goto unreg_xdp;
36103603 dev_info(&vsi->back->pdev->dev,
36113604 "Registered XDP mem model MEM_TYPE_XSK_BUFF_POOL on Rx ring %d\n",
36123605 ring->queue_index);
36133606
36143607 } else {
3608+ err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
3609+ ring->queue_index,
3610+ ring->q_vector->napi.napi_id,
3611+ xdp_frame_sz);
3612+ if (err)
3613+ return err;
36153614 err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
36163615 MEM_TYPE_PAGE_SHARED,
36173616 NULL);
36183617 if (err)
3619− return err;
3618+ goto unreg_xdp;
36203619 }
36213620
36223621 skip:
3623− xdp_init_buff(&ring->xdp, i40e_rx_pg_size(ring) / 2, &ring->xdp_rxq);
3622+ xdp_init_buff(&ring->xdp, xdp_frame_sz, &ring->xdp_rxq);
36243623
36253624 rx_ctx.dbuff = DIV_ROUND_UP(ring->rx_buf_len,
36263625 BIT_ULL(I40E_RXQ_CTX_DBUFF_SHIFT));
@@ -3654,7 +3653,8 @@ skip: · 27 unmodified lines
36543653 dev_info(&vsi->back->pdev->dev,
36553654 "Failed to clear LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
36563655 ring->queue_index, pf_q, err);
3657− return -ENOMEM;
3656+ err = -ENOMEM;
3657+ goto unreg_xdp;
36583658 }
36593659
36603660 /* set the context in the HMC */
@@ -3663,7 +3663,8 @@ skip: · 2 unmodified lines
36633663 dev_info(&vsi->back->pdev->dev,
36643664 "Failed to set LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
36653665 ring->queue_index, pf_q, err);
3666− return -ENOMEM;
3666+ err = -ENOMEM;
3667+ goto unreg_xdp;
36673668 }
36683669
36693670 /* configure Rx buffer alignment */
@@ -3671,7 +3672,8 @@ skip: · 1 unmodified line
36713672 if (I40E_2K_TOO_SMALL_WITH_PADDING) {
36723673 dev_info(&vsi->back->pdev->dev,
36733674 "2k Rx buffer is too small to fit standard MTU and skb_shared_info\n");
3674− return -EOPNOTSUPP;
3675+ err = -EOPNOTSUPP;
3676+ goto unreg_xdp;
36753677 }
36763678 clear_ring_build_skb_enabled(ring);
36773679 } else {
@@ -3701,6 +3703,11 @@ skip: · 23 unmodified lines
37013703 }
37023704
37033705 return 0;
3706+unreg_xdp:
3707+ if (ring->vsi->type == I40E_VSI_MAIN)
3708+ xdp_rxq_info_unreg(&ring->xdp_rxq);
3709+
3710+ return err;
37043711 }
37053712
37063713 /**
drivers/net/ethernet/intel/i40e/i40e_trace.h+1−1
@@ -88,7 +88,7 @@ TRACE_EVENT(i40e_napi_poll, · 87 unmodified lines
8888 __entry->rx_clean_complete = rx_clean_complete;
8989 __entry->tx_clean_complete = tx_clean_complete;
9090 __entry->irq_num = q->irq_num;
91− __entry->curr_cpu = get_cpu();
91+ __entry->curr_cpu = smp_processor_id();
9292 __assign_str(qname);
9393 __assign_str(dev_name);
9494 __assign_bitmask(irq_affinity, cpumask_bits(&q->affinity_mask),
drivers/net/ethernet/intel/i40e/i40e_txrx.c+3−2
@@ -1470,6 +1470,9 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring) · 1469 unmodified lines
14701470 if (!rx_ring->rx_bi)
14711471 return;
14721472
1473+ if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
1474+ xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
1475+
14731476 if (rx_ring->xsk_pool) {
14741477 i40e_xsk_clean_rx_ring(rx_ring);
14751478 goto skip_free;
@@ -1527,8 +1530,6 @@ skip_free: · 51 unmodified lines
15271530 void i40e_free_rx_resources(struct i40e_ring *rx_ring)
15281531 {
15291532 i40e_clean_rx_ring(rx_ring);
1530− if (rx_ring->vsi->type == I40E_VSI_MAIN)
1531− xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
15321533 rx_ring->xdp_prog = NULL;
15331534 kfree(rx_ring->rx_bi);
15341535 rx_ring->rx_bi = NULL;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+7−7
@@ -3833,10 +3833,10 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) · 3832 unmodified lines
38333833 cfilter.n_proto = ETH_P_IP;
38343834 if (mask.dst_ip[0] & tcf.dst_ip[0])
38353835 memcpy(&cfilter.ip.v4.dst_ip, tcf.dst_ip,
3836− ARRAY_SIZE(tcf.dst_ip));
3837− else if (mask.src_ip[0] & tcf.dst_ip[0])
3836+ sizeof(cfilter.ip.v4.dst_ip));
3837+ else if (mask.src_ip[0] & tcf.src_ip[0])
38383838 memcpy(&cfilter.ip.v4.src_ip, tcf.src_ip,
3839− ARRAY_SIZE(tcf.dst_ip));
3839+ sizeof(cfilter.ip.v4.src_ip));
38403840 break;
38413841 case VIRTCHNL_TCP_V6_FLOW:
38423842 cfilter.n_proto = ETH_P_IPV6;
@@ -3891,7 +3891,7 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) · 48 unmodified lines
38913891 /* for ipv6, mask is set for all sixteen bytes (4 words) */
38923892 if (cfilter.n_proto == ETH_P_IPV6 && mask.dst_ip[3])
38933893 if (memcmp(&cfilter.ip.v6.dst_ip6, &cf->ip.v6.dst_ip6,
3894− sizeof(cfilter.ip.v6.src_ip6)))
3894+ sizeof(cfilter.ip.v6.dst_ip6)))
38953895 continue;
38963896 if (mask.vlan_id)
38973897 if (cfilter.vlan_id != cf->vlan_id)
@@ -3979,10 +3979,10 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) · 81 unmodified lines
39793979 cfilter->n_proto = ETH_P_IP;
39803980 if (mask.dst_ip[0] & tcf.dst_ip[0])
39813981 memcpy(&cfilter->ip.v4.dst_ip, tcf.dst_ip,
3982− ARRAY_SIZE(tcf.dst_ip));
3983− else if (mask.src_ip[0] & tcf.dst_ip[0])
3982+ sizeof(cfilter->ip.v4.dst_ip));
3983+ else if (mask.src_ip[0] & tcf.src_ip[0])
39843984 memcpy(&cfilter->ip.v4.src_ip, tcf.src_ip,
3985− ARRAY_SIZE(tcf.dst_ip));
3985+ sizeof(cfilter->ip.v4.src_ip));
39863986 break;
39873987 case VIRTCHNL_TCP_V6_FLOW:
39883988 cfilter->n_proto = ETH_P_IPV6;
drivers/net/ethernet/intel/iavf/iavf.h+1−2
@@ -260,7 +260,6 @@ struct iavf_adapter { · 259 unmodified lines
260260 struct work_struct adminq_task;
261261 struct work_struct finish_config;
262262 wait_queue_head_t down_waitqueue;
263− wait_queue_head_t reset_waitqueue;
264263 wait_queue_head_t vc_waitqueue;
265264 struct iavf_q_vector *q_vectors;
266265 struct list_head vlan_filter_list;
@@ -626,5 +625,5 @@ void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter); · 359 unmodified lines
626625 void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
627626 struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
628627 const u8 *macaddr);
629−int iavf_wait_for_reset(struct iavf_adapter *adapter);
628+void iavf_reset_step(struct iavf_adapter *adapter);
630629 #endif /* _IAVF_H_ */
drivers/net/ethernet/intel/iavf/iavf_ethtool.c+6−13
@@ -492,7 +492,6 @@ static int iavf_set_ringparam(struct net_device *netdev, · 491 unmodified lines
492492 {
493493 struct iavf_adapter *adapter = netdev_priv(netdev);
494494 u32 new_rx_count, new_tx_count;
495− int ret = 0;
496495
497496 if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
498497 return -EINVAL;
@@ -537,13 +536,11 @@ static int iavf_set_ringparam(struct net_device *netdev, · 38 unmodified lines
537536 }
538537
539538 if (netif_running(netdev)) {
540− iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
541− ret = iavf_wait_for_reset(adapter);
542− if (ret)
543− netdev_warn(netdev, "Changing ring parameters timeout or interrupted waiting for reset");
539+ adapter->flags |= IAVF_FLAG_RESET_NEEDED;
540+ iavf_reset_step(adapter);
544541 }
545542
546− return ret;
543+ return 0;
547544 }
548545
549546 /**
@@ -1723,7 +1720,6 @@ static int iavf_set_channels(struct net_device *netdev, · 1173 unmodified lines
17231720 {
17241721 struct iavf_adapter *adapter = netdev_priv(netdev);
17251722 u32 num_req = ch->combined_count;
1726− int ret = 0;
17271723
17281724 if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
17291725 adapter->num_tc) {
@@ -1745,13 +1741,10 @@ static int iavf_set_channels(struct net_device *netdev, · 15 unmodified lines
17451741
17461742 adapter->num_req_queues = num_req;
17471743 adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
1748− iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
1744+ adapter->flags |= IAVF_FLAG_RESET_NEEDED;
1745+ iavf_reset_step(adapter);
17491746
1750− ret = iavf_wait_for_reset(adapter);
1751− if (ret)
1752− netdev_warn(netdev, "Changing channel count timeout or interrupted waiting for reset");
1753−
1754− return ret;
1747+ return 0;
17551748 }
17561749
17571750 /**
drivers/net/ethernet/intel/iavf/iavf_main.c+44−54
@@ -185,31 +185,6 @@ static bool iavf_is_reset_in_progress(struct iavf_adapter *adapter) · 184 unmodified lines
185185 return false;
186186 }
187187
188−/**
189− * iavf_wait_for_reset - Wait for reset to finish.
190− * @adapter: board private structure
191− *
192− * Returns 0 if reset finished successfully, negative on timeout or interrupt.
193− */
194−int iavf_wait_for_reset(struct iavf_adapter *adapter)
195−{
196− int ret = wait_event_interruptible_timeout(adapter->reset_waitqueue,
197− !iavf_is_reset_in_progress(adapter),
198− msecs_to_jiffies(5000));
199−
200− /* If ret < 0 then it means wait was interrupted.
201− * If ret == 0 then it means we got a timeout while waiting
202− * for reset to finish.
203− * If ret > 0 it means reset has finished.
204− */
205− if (ret > 0)
206− return 0;
207− else if (ret < 0)
208− return -EINTR;
209− else
210− return -EBUSY;
211−}
212−
213188 /**
214189 * iavf_allocate_dma_mem_d - OS specific memory alloc for shared code
215190 * @hw: pointer to the HW structure
@@ -2793,7 +2768,22 @@ static void iavf_init_config_adapter(struct iavf_adapter *adapter) · 2577 unmodified lines
27932768 netdev->watchdog_timeo = 5 * HZ;
27942769
27952770 netdev->min_mtu = ETH_MIN_MTU;
2796− netdev->max_mtu = LIBIE_MAX_MTU;
2771+
2772+ /* PF/VF API: vf_res->max_mtu is max frame size (not MTU).
2773+ * Convert to MTU.
2774+ */
2775+ if (!adapter->vf_res->max_mtu) {
2776+ netdev->max_mtu = LIBIE_MAX_MTU;
2777+ } else if (adapter->vf_res->max_mtu < LIBETH_RX_LL_LEN + ETH_MIN_MTU ||
2778+ adapter->vf_res->max_mtu >
2779+ LIBETH_RX_LL_LEN + LIBIE_MAX_MTU) {
2780+ netdev_warn_once(adapter->netdev,
2781+ "invalid max frame size %d from PF, using default MTU %d",
2782+ adapter->vf_res->max_mtu, LIBIE_MAX_MTU);
2783+ netdev->max_mtu = LIBIE_MAX_MTU;
2784+ } else {
2785+ netdev->max_mtu = adapter->vf_res->max_mtu - LIBETH_RX_LL_LEN;
2786+ }
27972787
27982788 if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
27992789 dev_info(&pdev->dev, "Invalid MAC address %pM, using random\n",
@@ -3021,6 +3011,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter) · 221 unmodified lines
30213011
30223012 adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;
30233013
3014+ iavf_ptp_release(adapter);
3015+
30243016 /* We don't use netif_running() because it may be true prior to
30253017 * ndo_open() returning, so we can't assume it means all our open
30263018 * tasks have finished, since we're not holding the rtnl_lock here.
@@ -3096,18 +3088,16 @@ static void iavf_reconfig_qs_bw(struct iavf_adapter *adapter) · 69 unmodified lines
30963088 }
30973089
30983090 /**
3099− * iavf_reset_task - Call-back task to handle hardware reset
3100− * @work: pointer to work_struct
3091+ * iavf_reset_step - Perform the VF reset sequence
3092+ * @adapter: board private structure
31013093 *
3102− * During reset we need to shut down and reinitialize the admin queue
3103− * before we can use it to communicate with the PF again. We also clear
3104− * and reinit the rings because that context is lost as well.
3105− **/
3106−static void iavf_reset_task(struct work_struct *work)
3094+ * Requests a reset from PF, polls for completion, and reconfigures
3095+ * the driver. Caller must hold the netdev instance lock.
3096+ *
3097+ * This can sleep for several seconds while polling HW registers.
3098+ */
3099+void iavf_reset_step(struct iavf_adapter *adapter)
31073100 {
3108− struct iavf_adapter *adapter = container_of(work,
3109− struct iavf_adapter,
3110− reset_task);
31113101 struct virtchnl_vf_resource *vfres = adapter->vf_res;
31123102 struct net_device *netdev = adapter->netdev;
31133103 struct iavf_hw *hw = &adapter->hw;
@@ -3118,7 +3108,7 @@ static void iavf_reset_task(struct work_struct *work) · 4 unmodified lines
31183108 int i = 0, err;
31193109 bool running;
31203110
3121− netdev_lock(netdev);
3111+ netdev_assert_locked(netdev);
31223112
31233113 iavf_misc_irq_disable(adapter);
31243114 if (adapter->flags & IAVF_FLAG_RESET_NEEDED) {
@@ -3163,7 +3153,6 @@ static void iavf_reset_task(struct work_struct *work) · 38 unmodified lines
31633153 dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
31643154 reg_val);
31653155 iavf_disable_vf(adapter);
3166− netdev_unlock(netdev);
31673156 return; /* Do not attempt to reinit. It's dead, Jim. */
31683157 }
31693158
@@ -3175,7 +3164,6 @@ continue_reset: · 5 unmodified lines
31753164 iavf_startup(adapter);
31763165 queue_delayed_work(adapter->wq, &adapter->watchdog_task,
31773166 msecs_to_jiffies(30));
3178− netdev_unlock(netdev);
31793167 return;
31803168 }
31813169
@@ -3196,6 +3184,8 @@ continue_reset: · 14 unmodified lines
31963184 iavf_change_state(adapter, __IAVF_RESETTING);
31973185 adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
31983186
3187+ iavf_ptp_release(adapter);
3188+
31993189 /* free the Tx/Rx rings and descriptors, might be better to just
32003190 * re-use them sometime in the future
32013191 */
@@ -3316,9 +3306,6 @@ continue_reset: · 114 unmodified lines
33163306
33173307 adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
33183308
3319− wake_up(&adapter->reset_waitqueue);
3320− netdev_unlock(netdev);
3321−
33223309 return;
33233310 reset_err:
33243311 if (running) {
@@ -3327,10 +3314,21 @@ reset_err: · 2 unmodified lines
33273314 }
33283315 iavf_disable_vf(adapter);
33293316
3330− netdev_unlock(netdev);
33313317 dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
33323318 }
33333319
3320+static void iavf_reset_task(struct work_struct *work)
3321+{
3322+ struct iavf_adapter *adapter = container_of(work,
3323+ struct iavf_adapter,
3324+ reset_task);
3325+ struct net_device *netdev = adapter->netdev;
3326+
3327+ netdev_lock(netdev);
3328+ iavf_reset_step(adapter);
3329+ netdev_unlock(netdev);
3330+}
3331+
33343332 /**
33353333 * iavf_adminq_task - worker thread to clean the admin queue
33363334 * @work: pointer to work_struct containing our data
@@ -4596,22 +4594,17 @@ static int iavf_close(struct net_device *netdev) · 1259 unmodified lines
45964594 static int iavf_change_mtu(struct net_device *netdev, int new_mtu)
45974595 {
45984596 struct iavf_adapter *adapter = netdev_priv(netdev);
4599− int ret = 0;
46004597
46014598 netdev_dbg(netdev, "changing MTU from %d to %d\n",
46024599 netdev->mtu, new_mtu);
46034600 WRITE_ONCE(netdev->mtu, new_mtu);
46044601
46054602 if (netif_running(netdev)) {
4606− iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
4607− ret = iavf_wait_for_reset(adapter);
4608− if (ret < 0)
4609− netdev_warn(netdev, "MTU change interrupted waiting for reset");
4610− else if (ret)
4611− netdev_warn(netdev, "MTU change timed out waiting for reset");
4603+ adapter->flags |= IAVF_FLAG_RESET_NEEDED;
4604+ iavf_reset_step(adapter);
46124605 }
46134606
4614− return ret;
4607+ return 0;
46154608 }
46164609
46174610 /**
@@ -5416,9 +5409,6 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 798 unmodified lines
54165409 /* Setup the wait queue for indicating transition to down status */
54175410 init_waitqueue_head(&adapter->down_waitqueue);
54185411
5419− /* Setup the wait queue for indicating transition to running state */
5420− init_waitqueue_head(&adapter->reset_waitqueue);
5421−
54225412 /* Setup the wait queue for indicating virtchannel events */
54235413 init_waitqueue_head(&adapter->vc_waitqueue);
54245414
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c+0−1
@@ -2736,7 +2736,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 2735 unmodified lines
27362736 case VIRTCHNL_OP_ENABLE_QUEUES:
27372737 /* enable transmits */
27382738 iavf_irq_enable(adapter, true);
2739− wake_up(&adapter->reset_waitqueue);
27402739 adapter->flags &= ~IAVF_FLAG_QUEUES_DISABLED;
27412740 break;
27422741 case VIRTCHNL_OP_DISABLE_QUEUES:
drivers/net/ethernet/intel/ice/devlink/devlink.c+2−2
@@ -1360,7 +1360,7 @@ ice_devlink_enable_roce_get(struct devlink *devlink, u32 id, · 1359 unmodified lines
13601360
13611361 cdev = pf->cdev_info;
13621362 if (!cdev)
1363− return -ENODEV;

13 more lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice.h+1−0

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

drivers/net/ethernet/intel/ice/ice_base.c+14−24

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

drivers/net/ethernet/intel/ice/ice_common.c+11−4

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

drivers/net/ethernet/intel/ice/ice_ethtool.c+28−23

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

drivers/net/ethernet/intel/ice/ice_idc.c+34−10

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

drivers/net/ethernet/intel/ice/ice_lib.c+10−5

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

drivers/net/ethernet/intel/ice/ice_main.c+6−1

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

drivers/net/ethernet/intel/ice/ice_txrx.c+3−1

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

drivers/net/ethernet/intel/ice/ice_xsk.c+3−0

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

drivers/net/ethernet/intel/idpf/idpf_ethtool.c+0−3

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

drivers/net/ethernet/intel/idpf/idpf_lib.c+1−0

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

drivers/net/ethernet/intel/idpf/idpf_txrx.c+10−4

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

drivers/net/ethernet/intel/idpf/xdp.c+5−1

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

drivers/net/ethernet/intel/idpf/xsk.c+1−0

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

drivers/net/ethernet/intel/igb/igb_xsk.c+30−8

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

drivers/net/ethernet/intel/igc/igc_main.c+24−10

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

drivers/net/ethernet/intel/igc/igc_ptp.c+2−1

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

drivers/net/ethernet/intel/ixgbevf/vf.c+2−1

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

drivers/net/ethernet/intel/libeth/xsk.c+1−0

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

drivers/net/ethernet/intel/libie/fwlog.c+4−0

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

drivers/net/ethernet/marvell/octeon_ep/octep_main.c+28−12

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

drivers/net/ethernet/marvell/octeon_ep/octep_rx.c+19−8

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

drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c+28−10

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

drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c+20−8

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c+3−3

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

drivers/net/ethernet/mediatek/mtk_eth_soc.c+12−3

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

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c+0−1

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c+1−2

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+9−14

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+4−3

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+2−0

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+27−20

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

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c+6−2

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

drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c+4−4

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

drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h+5−0

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

drivers/net/ethernet/mellanox/mlx5/core/sriov.c+2−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c+2−2

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

drivers/net/ethernet/microsoft/mana/gdma_main.c+5−1

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

drivers/net/ethernet/microsoft/mana/mana_en.c+21−6

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

drivers/net/ethernet/spacemit/k1_emac.c+13−6

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

drivers/net/ethernet/stmicro/stmmac/stmmac.h+1−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+48−6

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

drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c+31−29

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

drivers/net/ethernet/ti/am65-cpsw-nuss.c+10−8

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

drivers/net/ethernet/ti/am65-cpsw-nuss.h+1−1

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

drivers/net/ethernet/ti/cpsw_ale.c+4−5

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

drivers/net/ethernet/ti/icssg/icssg_prueth.c+8−0

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

drivers/net/ethernet/xscale/ixp4xx_eth.c+1−4

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

drivers/net/ethernet/xscale/ptp_ixp46x.c+3−0

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

drivers/net/mctp/mctp-i2c.c+1−0

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

drivers/net/mctp/mctp-usb.c+1−2

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

drivers/net/netconsole.c+3−2

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

drivers/net/ovpn/tcp.c+36−17

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

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

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

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

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

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

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

drivers/net/team/team_core.c+21−5

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

drivers/net/usb/kalmia.c+7−0

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

drivers/net/usb/kaweth.c+13−2

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

drivers/net/usb/lan78xx.c+8−6

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

drivers/net/usb/lan78xx.h+3−0

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

drivers/net/usb/pegasus.c+42−6

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

drivers/net/usb/qmi_wwan.c+2−2

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

drivers/net/usb/r8152.c+1−0

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

drivers/net/usb/usbnet.c+4−3

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

drivers/net/vxlan/vxlan_core.c+5−0

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

drivers/net/wan/farsync.c+2−0

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

drivers/net/wireless/ath/ath12k/mac.c+3−3

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

drivers/net/wireless/ath/ath12k/wmi.c+13−23

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c+3−4

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c+4−3

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h+1−1

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

drivers/net/wireless/marvell/libertas/main.c+2−2

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

drivers/net/wireless/marvell/mwifiex/cfg80211.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c+1−0

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

drivers/net/wireless/mediatek/mt76/mt7925/mac.c+1−0

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

drivers/net/wireless/mediatek/mt76/mt7996/mac.c+1−0

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

drivers/net/wireless/rsi/rsi_91x_mac80211.c+1−1

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

drivers/net/wireless/st/cw1200/pm.c+2−0

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

drivers/net/wireless/ti/wlcore/main.c+2−2

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

drivers/net/xen-netfront.c+17−17

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

drivers/nfc/pn533/usb.c+1−0

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

drivers/nvme/host/core.c+13−18

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

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

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

drivers/nvme/host/multipath.c+6−8

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

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

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

drivers/nvme/host/pci.c+189−5

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

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

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

drivers/nvme/host/sysfs.c+23−0

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

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

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

drivers/nvme/target/admin-cmd.c+1−1

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

drivers/nvme/target/core.c+12−2

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

drivers/nvme/target/fcloop.c+11−4

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

drivers/nvme/target/nvmet.h+1−0

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

drivers/nvme/target/rdma.c+1−0

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

drivers/pci/controller/dwc/pcie-designware-ep.c+16−9

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

drivers/pci/xen-pcifront.c+4−4

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

drivers/pinctrl/cirrus/pinctrl-cs42l43.c+2−3

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

drivers/pinctrl/cix/pinctrl-sky1.c+1−2

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

drivers/pinctrl/meson/pinctrl-amlogic-a4.c+1−2

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

drivers/pinctrl/pinconf-generic.c+2−2

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

drivers/pinctrl/pinctrl-amdisp.c+1−1

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

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

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

drivers/pinctrl/pinctrl-equilibrium.c+19−12

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

drivers/pinctrl/pinctrl-rockchip.c+4−8

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

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

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

drivers/pinctrl/qcom/pinctrl-sdm660-lpass-lpi.c+2−2

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

drivers/pinctrl/sunxi/pinctrl-sunxi.c+51−0

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

drivers/platform/x86/asus-armoury.h+75−0

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

drivers/platform/x86/dell/alienware-wmi-wmax.c+1−1

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

drivers/platform/x86/dell/dell-wmi-base.c+6−0

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

drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c+0−1

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

drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c+6−3

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

drivers/platform/x86/hp/hp-wmi.c+11−1

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

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

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

drivers/platform/x86/intel/int3472/discrete.c+7−0

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

drivers/platform/x86/lenovo/thinkpad_acpi.c+4−2

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

drivers/platform/x86/oxpec.c+29−1

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

drivers/platform/x86/redmi-wmi.c+24−1

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

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

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

drivers/platform/x86/uniwill/uniwill-acpi.c+75−35

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

drivers/platform/x86/uniwill/uniwill-wmi.h+3−3

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

drivers/pmdomain/bcm/bcm2835-power.c+3−3

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

drivers/pmdomain/imx/gpcv2.c+3−1

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

drivers/pmdomain/rockchip/pm-domains.c+1−1

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

drivers/power/sequencing/pwrseq-pcie-m2.c+1−1

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

drivers/regulator/Kconfig+1−1

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

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

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

drivers/regulator/fp9931.c+3−4

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

drivers/regulator/mt6363-regulator.c+1−3

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

drivers/regulator/pca9450-regulator.c+10−4

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

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

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

drivers/regulator/tps65185.c+3−0

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

drivers/remoteproc/imx_rproc.c+1−1

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

drivers/remoteproc/mtk_scp.c+39−0

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

drivers/remoteproc/qcom_sysmon.c+1−1

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

drivers/remoteproc/qcom_wcnss.c+1−1

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

drivers/s390/block/dasd_eckd.c+16−0

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

drivers/s390/crypto/zcrypt_ccamisc.c+7−5

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

drivers/s390/crypto/zcrypt_cex4.c+1−2

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

drivers/scsi/hisi_sas/hisi_sas_main.c+1−1

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

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+1−1

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

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

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

drivers/scsi/lpfc/lpfc_sli.c+30−6

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

drivers/scsi/lpfc/lpfc_sli4.h+3−0

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

drivers/scsi/mpi3mr/mpi3mr_fw.c+29−15

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

drivers/scsi/pm8001/pm8001_sas.c+3−2

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

drivers/scsi/qla2xxx/qla_iocb.c+0−2

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

drivers/scsi/scsi_devinfo.c+1−1

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

drivers/scsi/scsi_scan.c+2−5

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

drivers/scsi/ses.c+2−3

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

drivers/scsi/snic/vnic_dev.c+0−9

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

drivers/scsi/storvsc_drv.c+3−2

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

drivers/scsi/xen-scsifront.c+1−1

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

drivers/spi/spi-amlogic-spifc-a4.c+2−3

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

drivers/spi/spi-atcspi200.c+16−22

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

drivers/spi/spi-cadence-quadspi.c+6−0

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

drivers/spi/spi-dw-dma.c+1−1

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

drivers/spi/spi-intel-pci.c+1−0

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

drivers/spi/spi-rockchip-sfc.c+1−1

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

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

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

drivers/staging/rtl8723bs/core/rtw_ieee80211.c+10−5

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

drivers/staging/rtl8723bs/core/rtw_mlme.c+4−1

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

drivers/staging/sm750fb/sm750.c+1−0

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

drivers/staging/sm750fb/sm750_hw.c+11−11

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

drivers/target/target_core_configfs.c+6−9

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

drivers/ufs/core/ufshcd.c+35−14

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

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

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

drivers/usb/class/cdc-acm.h+1−0

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

drivers/usb/class/cdc-wdm.c+3−1

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

drivers/usb/class/usbtmc.c+3−3

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

drivers/usb/core/config.c+5−1

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

drivers/usb/core/message.c+79−21

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

drivers/usb/core/phy.c+1−7

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

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

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

drivers/usb/dwc3/dwc3-pci.c+2−0

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

drivers/usb/gadget/function/f_hid.c+4−0

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

drivers/usb/gadget/function/f_mass_storage.c+10−2

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

drivers/usb/gadget/function/f_ncm.c+80−66

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

drivers/usb/gadget/function/f_tcm.c+14−0

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

drivers/usb/gadget/function/u_ether.c+22−45

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

drivers/usb/gadget/function/u_ether.h+26−30

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

drivers/usb/gadget/function/u_ether_configfs.h+0−177

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

drivers/usb/gadget/function/u_ncm.h+1−3

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

drivers/usb/gadget/function/uvc_video.c+1−1

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

drivers/usb/host/xhci-debugfs.c+9−1

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

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

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

drivers/usb/host/xhci.c+2−2

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

drivers/usb/image/mdc800.c+4−2

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

drivers/usb/misc/uss720.c+1−1

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

drivers/usb/misc/yurex.c+1−1

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

drivers/usb/renesas_usbhs/common.c+9−0

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

drivers/usb/roles/class.c+6−1

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

drivers/usb/typec/altmodes/displayport.c+6−1

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

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

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

drivers/video/fbdev/au1100fb.c+6−2

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

drivers/xen/xen-acpi-processor.c+2−5

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

drivers/xen/xen-pciback/xenbus.c+5−5

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

drivers/xen/xenbus/xenbus_client.c+14−3

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

drivers/xen/xenbus/xenbus_probe.c+39−3

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

drivers/xen/xenbus/xenbus_probe_frontend.c+1−1

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

fs/afs/addr_list.c+4−4

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

fs/binfmt_elf.c+2−1

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

fs/btrfs/block-group.c+0−1

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

fs/btrfs/delayed-inode.c+1−1

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

fs/btrfs/disk-io.c+27−16

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

fs/btrfs/extent-tree.c+7−1

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

fs/btrfs/extent_io.c+1−0

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

fs/btrfs/inode.c+36−2

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

fs/btrfs/ioctl.c+34−5

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

fs/btrfs/messages.h+0−3

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

fs/btrfs/print-tree.c+10−0

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

fs/btrfs/qgroup.c+1−1

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

fs/btrfs/relocation.c+8−0

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

fs/btrfs/scrub.c+1−1

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

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

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

fs/btrfs/transaction.c+16−0

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

fs/btrfs/tree-checker.c+2−2

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

fs/btrfs/uuid-tree.c+38−0

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

fs/btrfs/uuid-tree.h+2−0

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

fs/btrfs/volumes.c+5−3

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

fs/ceph/addr.c+0−1

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

fs/ceph/debugfs.c+2−2

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

fs/ceph/dir.c+15−2

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

fs/ceph/file.c+2−2

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

fs/ceph/inode.c+1−1

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

fs/ceph/mds_client.c+3−0

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

fs/erofs/inode.c+6−1

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

fs/erofs/internal.h+7−9

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

fs/erofs/ishare.c+9−5

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

fs/erofs/super.c+36−49

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

fs/erofs/zmap.c+5−4

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

fs/eventpoll.c+3−2

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

fs/file_attr.c+1−1

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

fs/fs-writeback.c+5−4

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

fs/iomap/buffered-io.c+13−3

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

fs/iomap/direct-io.c+14−1

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

fs/iomap/ioend.c+53−6

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

fs/minix/bitmap.c+1−1

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

fs/namespace.c+74−59

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

fs/netfs/direct_write.c+212−16

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

fs/netfs/internal.h+3−1

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

fs/netfs/write_collect.c+0−21

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

fs/netfs/write_issue.c+3−38

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

fs/nfs/Kconfig+2−1

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

fs/nfs/nfs3proc.c+6−1

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

fs/nfsd/nfsctl.c+11−11

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

fs/nfsd/nfssvc.c+4−3

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

fs/nsfs.c+14−1

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

fs/pidfs.c+4−6

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

fs/proc/base.c+3−0

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

fs/smb/client/Makefile+2−0

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

fs/smb/client/cached_dir.c+1−1

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

fs/smb/client/cifs_fs_sb.h+1−1

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

fs/smb/client/cifs_ioctl.h+0−8

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

fs/smb/client/cifs_unicode.c+0−14

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

fs/smb/client/cifs_unicode.h+13−1

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

fs/smb/client/cifsacl.c+7−12

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

fs/smb/client/cifsfs.c+50−43

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

fs/smb/client/cifsglob.h+67−17

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

fs/smb/client/cifsproto.h+23−4

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

fs/smb/client/connect.c+44−36

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

fs/smb/client/dfs_cache.c+1−1

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

fs/smb/client/dir.c+29−24

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

fs/smb/client/file.c+114−118

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

fs/smb/client/fs_context.c+75−76

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

fs/smb/client/fs_context.h+1−1

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

fs/smb/client/inode.c+77−71

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

fs/smb/client/ioctl.c+1−1

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

fs/smb/client/link.c+8−6

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

fs/smb/client/misc.c+52−6

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

fs/smb/client/readdir.c+21−18

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

fs/smb/client/reparse.c+14−13

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

fs/smb/client/reparse.h+2−2

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

fs/smb/client/smb1encrypt.c+2−1

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

fs/smb/client/smb1ops.c+15−9

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

fs/smb/client/smb2file.c+1−1

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

fs/smb/client/smb2glob.h+12−0

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

fs/smb/client/smb2inode.c+15−15

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

fs/smb/client/smb2maperror.c+18−13

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

fs/smb/client/smb2maperror_test.c+9−3

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

fs/smb/client/smb2misc.c+4−14

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

fs/smb/client/smb2ops.c+18−8

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

fs/smb/client/smb2pdu.c+19−39

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

fs/smb/client/smb2pdu.h+5−2

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

fs/smb/client/smb2proto.h+0−3

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

fs/smb/client/smb2transport.c+3−1

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

fs/smb/client/trace.h+2−0

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

fs/smb/client/transport.c+10−11

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

fs/smb/client/xattr.c+3−3

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

fs/smb/server/Kconfig+1−0

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

fs/smb/server/auth.c+5−21

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

fs/smb/server/oplock.c+25−10

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

fs/smb/server/oplock.h+3−2

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

fs/smb/server/smb2pdu.c+7−6

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

fs/smb/server/smb2pdu.h+4−1

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

fs/smb/server/transport_rdma.c+2−2

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

fs/smb/server/vfs_cache.c+5−5

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

fs/squashfs/cache.c+3−0

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

fs/verity/Kconfig+3−0

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

fs/xfs/libxfs/xfs_ag.c+28−0

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

fs/xfs/libxfs/xfs_ag.h+3−0

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

fs/xfs/libxfs/xfs_da_btree.c+2−6

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

fs/xfs/libxfs/xfs_defer.c+1−1

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

fs/xfs/libxfs/xfs_inode_buf.c+4−0

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

fs/xfs/libxfs/xfs_metafile.c+5−0

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

fs/xfs/libxfs/xfs_ondisk.h+36−16

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

fs/xfs/libxfs/xfs_sb.c+3−0

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

fs/xfs/scrub/dir_repair.c+1−1

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

fs/xfs/scrub/orphanage.c+6−1

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

fs/xfs/xfs_bmap_item.c+1−1

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

fs/xfs/xfs_dquot.c+7−1

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

fs/xfs/xfs_fsops.c+2−15

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

fs/xfs/xfs_health.c+18−2

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

fs/xfs/xfs_healthmon.c+17−11

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

fs/xfs/xfs_icache.c+14−5

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

fs/xfs/xfs_log.c+2−0

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

fs/xfs/xfs_mount.h+1−1

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

fs/xfs/xfs_notify_failure.c+2−2

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

fs/xfs/xfs_platform.h+9−0

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

fs/xfs/xfs_rtalloc.c+37−7

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

fs/xfs/xfs_stats.c+11−6

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

fs/xfs/xfs_stats.h+10−9

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

fs/xfs/xfs_super.c+2−2

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

fs/xfs/xfs_verify_media.c+2−2

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

fs/xfs/xfs_zone_alloc.c+3−3

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

fs/xfs/xfs_zone_gc.c+5−7

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

include/asm-generic/vmlinux.lds.h+3−1

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

include/drm/display/drm_dp.h+2−0

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

include/kunit/run-in-irq-context.h+28−16

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

include/linux/bpf.h+2−2

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

include/linux/bpf_local_storage.h+1−1

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

include/linux/bpf_mem_alloc.h+6−0

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

include/linux/device/bus.h+2−0

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

include/linux/eventpoll.h+7−4

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

include/linux/firmware/intel/stratix10-svc-client.h+4−4

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

include/linux/fsnotify.h+0−13

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

include/linux/gfp.h+7−4

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

include/linux/gfp_types.h+2−0

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

include/linux/hid.h+6−0

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

include/linux/indirect_call_wrapper.h+11−7

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

include/linux/io_uring_types.h+1−0

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

include/linux/ipv6.h+6−1

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

include/linux/irqchip/arm-gic-v3.h+1−0

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

include/linux/jiffies.h+38−2

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

include/linux/kthread.h+20−1

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

include/linux/kvm_host.h+36−54

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

include/linux/liveupdate.h+6−3

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

include/linux/migrate.h+9−1

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

include/linux/mm.h+6−11

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

include/linux/mmc/host.h+5−4

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

include/linux/mmu_notifier.h+16−15

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

include/linux/netdevice.h+54−5

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

include/linux/ns_common.h+2−0

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

include/linux/nvme-auth.h+1−1

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

include/linux/overflow.h+4−4

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

include/linux/platform_data/mlxreg.h+7−7

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

include/linux/platform_data/x86/int3472.h+3−2

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

include/linux/pm_runtime.h+2−14

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

include/linux/ring_buffer.h+1−0

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

include/linux/rseq.h+12−0

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

include/linux/rseq_entry.h+4−4

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

include/linux/rseq_types.h+5−1

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

include/linux/sched.h+1−2

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

include/linux/slab.h+0−12

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

include/linux/tnum.h+3−0

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

include/linux/uaccess.h+22−36

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

include/linux/usb.h+6−2

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

include/linux/usb/quirks.h+3−0

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

include/linux/usb/r8152.h+1−0

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

include/linux/usb/usbnet.h+1−0

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

include/net/act_api.h+1−0

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

include/net/af_vsock.h+11−2

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

include/net/bluetooth/l2cap.h+5−3

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

include/net/bonding.h+1−0

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

include/net/inet6_hashtables.h+1−1

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

include/net/inet_connection_sock.h+3−1

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

include/net/inet_hashtables.h+1−1

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

include/net/ip.h+1−1

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

include/net/ip6_tunnel.h+14−0

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

include/net/ip_fib.h+1−1

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

include/net/ip_tunnels.h+7−0

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

include/net/libeth/xsk.h+3−0

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

include/net/netfilter/nf_tables.h+7−0

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

include/net/netns/vsock.h+3−0

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

include/net/page_pool/types.h+1−1

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

include/net/sch_generic.h+10−0

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

include/net/secure_seq.h+38−7

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

include/net/sock.h+1−1

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

include/net/tc_act/tc_gate.h+26−7

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

include/net/tc_act/tc_ife.h+1−3

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

include/net/tcp.h+7−3

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

include/net/xdp_sock_drv.h+13−3

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

include/rdma/rdma_cm.h+1−1

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

include/sound/cs35l56.h+1−0

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

include/sound/tas2781.h+1−0

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

include/trace/events/kmem.h+7−1

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

include/trace/events/netfs.h+3−1

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

include/uapi/drm/drm_fourcc.h+6−6

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

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

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

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

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

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

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

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

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

include/uapi/linux/rseq.h+22−4

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

include/xen/xenbus.h+3−1

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

init/Kconfig+2−2

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

io_uring/bpf_filter.c+1−1

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

io_uring/cmd_net.c+1−1

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

io_uring/eventfd.c+7−3

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

io_uring/io_uring.c+3−1

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

io_uring/kbuf.c+11−2

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

io_uring/net.c+2−0

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

io_uring/register.c+13−2

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

io_uring/timeout.c+2−2

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

io_uring/tw.c+20−2

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

io_uring/zcrx.c+5−3

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

kernel/bpf/arena.c+1−1

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

kernel/bpf/arraymap.c+1−1

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

kernel/bpf/bloom_filter.c+1−1

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

kernel/bpf/bpf_insn_array.c+1−1

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

kernel/bpf/bpf_local_storage.c+39−36

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

kernel/bpf/cpumap.c+15−2

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

kernel/bpf/devmap.c+38−9

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

kernel/bpf/hashtab.c+86−0

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

kernel/bpf/local_storage.c+1−1

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

kernel/bpf/lpm_trie.c+1−1

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

kernel/bpf/memalloc.c+47−11

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

kernel/bpf/syscall.c+1−1

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

kernel/bpf/tnum.c+56−0

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

kernel/bpf/trampoline.c+1−3

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

kernel/bpf/verifier.c+64−4

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

kernel/cgroup/cgroup.c+7−0

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

kernel/cgroup/cpuset.c+154−75

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

kernel/configs/debug.config+0−1

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

kernel/dma/direct.h+1−1

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

kernel/events/core.c+62−21

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

kernel/exit.c+6−0

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

kernel/fork.c+2−3

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

kernel/kcsan/kcsan_test.c+1−1

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

kernel/kprobes.c+6−2

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

kernel/kthread.c+5−36

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

kernel/liveupdate/luo_file.c+25−16

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

kernel/module/Kconfig+13−10

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

kernel/module/main.c+7−6

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

kernel/nscommon.c+6−0

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

kernel/nstree.c+4−25

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

kernel/rseq.c+5−3

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

kernel/sched/core.c+29−51

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

kernel/sched/ext.c+92−27

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

kernel/sched/ext_idle.c+2−3

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

kernel/sched/ext_internal.h+99−17

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

kernel/sched/fair.c+112−38

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

kernel/sched/idle.c+10−1

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

kernel/sched/isolation.c+1−3

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

kernel/sched/sched.h+11−0

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

kernel/sched/syscalls.c+30−0

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

kernel/time/jiffies.c+0−2

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

kernel/time/time.c+8−13

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

kernel/time/timekeeping.c+4−2

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

kernel/time/timer_migration.c+1−3

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

kernel/trace/blktrace.c+1−2

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

kernel/trace/bpf_trace.c+3−1

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

kernel/trace/ftrace.c+4−0

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

kernel/trace/ring_buffer.c+21−0

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

kernel/trace/trace.c+16−3

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

kernel/trace/trace_events.c+44−16

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

kernel/trace/trace_events_trigger.c+3−0

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

kernel/trace/trace_functions_graph.c+13−6

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

kernel/workqueue.c+28−27

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

kernel/workqueue_internal.h+1−0

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

lib/Kconfig.debug+3−29

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

lib/bootconfig.c+3−3

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

lib/crypto/.kunitconfig+34−0

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

lib/crypto/tests/Kconfig+12−23

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

lib/debugobjects.c+18−1

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

lib/kunit/test.c+125−106

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

mm/cma.c+4−1

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

mm/damon/core.c+9−1

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

mm/filemap.c+10−5

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

mm/huge_memory.c+12−4

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

mm/hugetlb.c+2−2

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

mm/kfence/core.c+23−6

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

mm/madvise.c+1−1

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

mm/memcontrol.c+1−1

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

mm/memfd_luo.c+49−7

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

mm/memory.c+2−1

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

mm/migrate.c+4−4

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

mm/migrate_device.c+1−1

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

mm/mm_init.c+5−1

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

mm/page_alloc.c+2−1

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

mm/slab.h+7−7

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

mm/slub.c+86−45

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

net/atm/lec.c+15−11

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

net/batman-adv/bat_v_elp.c+9−1

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

net/batman-adv/hard-interface.c+4−4

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

net/batman-adv/hard-interface.h+1−0

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

net/bluetooth/hci_sock.c+1−0

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

net/bluetooth/hci_sync.c+1−1

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

net/bluetooth/iso.c+1−0

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

net/bluetooth/l2cap_core.c+70−25

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

net/bluetooth/l2cap_sock.c+12−4

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

net/bluetooth/sco.c+1−0

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

net/bridge/br_device.c+1−1

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

net/bridge/br_input.c+1−1

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

net/bridge/br_private.h+10−0

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

net/bridge/br_vlan_options.c+23−3

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

net/can/bcm.c+1−0

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

net/ceph/auth.c+4−2

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

net/ceph/messenger_v2.c+21−10

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

net/ceph/mon_client.c+3−3

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

net/core/dev.c+36−23

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

net/core/dev.h+0−35

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

net/core/devmem.c+4−2

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

net/core/filter.c+11−2

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

net/core/neighbour.c+2−1

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

net/core/netpoll.c+1−1

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

net/core/page_pool_user.c+2−2

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

net/core/secure_seq.c+29−51

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

net/core/skbuff.c+18−5

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

net/core/skmsg.c+7−7

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

net/ipv4/Kconfig+2−0

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

net/ipv4/af_inet.c+6−0

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

net/ipv4/inet_hashtables.c+4−4

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

net/ipv4/ip_tunnel_core.c+15−0

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

net/ipv4/nexthop.c+11−3

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

net/ipv4/syncookies.c+9−4

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

net/ipv4/sysctl_net_ipv4.c+3−2

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

net/ipv4/tcp.c+4−3

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

net/ipv4/tcp_ao.c+2−1

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

net/ipv4/tcp_bpf.c+1−1

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

net/ipv4/tcp_diag.c+1−1

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

net/ipv4/tcp_fastopen.c+1−1

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

net/ipv4/tcp_input.c+29−27

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

net/ipv4/tcp_ipv4.c+26−22

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

net/ipv4/tcp_minisocks.c+2−2

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

net/ipv4/udp.c+16−11

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

net/ipv4/udp_bpf.c+1−1

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

net/ipv4/udplite.c+1−2

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

net/ipv6/af_inet6.c+0−8

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

net/ipv6/inet6_hashtables.c+2−1

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

net/ipv6/route.c+5−6

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

net/ipv6/syncookies.c+8−3

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

net/ipv6/tcp_ipv6.c+61−77

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

net/ipv6/udplite.c+1−2

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

net/ipv6/xfrm6_policy.c+5−2

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

net/kcm/kcmsock.c+19−2

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

net/mac80211/eht.c+1−0

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

net/mac80211/link.c+2−0

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

net/mac80211/mesh.c+3−0

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

net/mac80211/mlme.c+3−0

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

net/mctp/route.c+7−4

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

net/mptcp/pm.c+43−12

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

net/mptcp/pm_kernel.c+9−0

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

net/mptcp/subflow.c+4−2

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

net/ncsi/ncsi-aen.c+2−1

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

net/ncsi/ncsi-rsp.c+12−4

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

net/netfilter/nf_conntrack_h323_asn1.c+1−1

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

net/netfilter/nf_tables_api.c+26−23

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

net/netfilter/nfnetlink_cthelper.c+4−4

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

net/netfilter/nfnetlink_queue.c+3−1

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

net/netfilter/nft_chain_filter.c+1−1

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

net/netfilter/nft_set_hash.c+1−0

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

net/netfilter/nft_set_pipapo.c+54−11

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

net/netfilter/nft_set_pipapo.h+2−0

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

net/netfilter/nft_set_rbtree.c+5−3

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

net/netfilter/xt_IDLETIMER.c+6−0

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

net/netfilter/xt_dccp.c+2−2

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

net/netfilter/xt_tcpudp.c+4−2

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

net/nfc/digital_core.c+6−2

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

net/nfc/nci/core.c+27−3

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

net/nfc/nci/data.c+8−4

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

net/nfc/rawsock.c+11−0

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

net/psp/psp_main.c+38−1

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

net/rds/connection.c+3−0

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

net/rds/tcp.c+10−4

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

net/rds/tcp_listen.c+5−23

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

net/rxrpc/af_rxrpc.c+5−3

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

net/sched/act_ct.c+6−0

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

net/sched/act_gate.c+186−79

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

net/sched/act_ife.c+44−49

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

net/sched/cls_api.c+7−0

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

net/sched/sch_cake.c+25−28

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

net/sched/sch_ets.c+8−4

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

net/sched/sch_fq.c+1−0

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

net/sched/sch_teql.c+1−0

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

net/shaper/shaper.c+2−9

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

net/smc/af_smc.c+4−2

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

net/socket.c+1−1

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

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

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

net/tipc/name_table.c+4−2

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

net/tipc/socket.c+2−0

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

net/tls/tls_sw.c+1−1

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

net/unix/af_unix.c+4−4

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

net/vmw_vsock/af_vsock.c+12−7

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

net/wireless/core.c+1−0

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

net/wireless/radiotap.c+2−2

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

net/wireless/wext-compat.c+1−1

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

net/xdp/xsk.c+16−10

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

net/xfrm/espintcp.c+1−1

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

net/xfrm/xfrm_device.c+11−1

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

net/xfrm/xfrm_policy.c+9−2

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

rust/Makefile+5−6

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

rust/kernel/cpufreq.rs+1−0

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

rust/kernel/dma.rs+50−64

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

rust/kernel/io.rs+89−42

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

rust/kernel/kunit.rs+8−0

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

rust/kernel/lib.rs+4−0

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

rust/kernel/pci/io.rs+12−12

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

rust/kernel/ptr.rs+29−1

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

rust/kernel/ptr/projection.rs+305−0

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

rust/kernel/str.rs+2−2

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

rust/pin-init/internal/src/init.rs+23−46

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

rust/pin-init/src/__internal.rs+24−4

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

samples/rust/rust_dma.rs+16−14

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

samples/workqueue/stall_detector/Makefile+1−0

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

samples/workqueue/stall_detector/wq_stall.c+98−0

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

scripts/Makefile.build+3−1

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

scripts/genksyms/parse.y+2−2

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

scripts/package/install-extmod-build+4−0

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

security/apparmor/apparmorfs.c+134−91

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

security/apparmor/include/label.h+8−8

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

security/apparmor/include/lib.h+12−0

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

security/apparmor/include/match.h+1−0

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

security/apparmor/include/policy.h+5−5

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

security/apparmor/include/policy_ns.h+2−0

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

security/apparmor/include/policy_unpack.h+45−30

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

security/apparmor/label.c+8−4

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

security/apparmor/match.c+42−16

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

security/apparmor/policy.c+67−10

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

security/apparmor/policy_ns.c+2−0

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

security/apparmor/policy_unpack.c+37−12

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

sound/core/pcm_native.c+16−3

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

sound/firewire/dice/dice.c+1−1

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

sound/hda/codecs/ca0132.c+9−0

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

sound/hda/codecs/hdmi/tegrahdmi.c+1−0

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

sound/hda/codecs/realtek/alc269.c+40−1

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

sound/hda/codecs/realtek/alc662.c+9−0

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

sound/hda/codecs/senarytech.c+8−6

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

sound/hda/codecs/side-codecs/cs35l56_hda.c+1−6

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

sound/hda/codecs/side-codecs/tas2781_hda_i2c.c+3−12

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

sound/hda/controllers/intel.c+2−0

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

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

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

sound/soc/amd/acp/amd-acp63-acpi-match.c+413−0

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

sound/soc/amd/acp3x-rt5682-max9836.c+7−2

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

sound/soc/amd/yc/acp6x-mach.c+14−0

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

sound/soc/codecs/cs35l56-shared.c+15−1

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

sound/soc/codecs/cs35l56.c+10−2

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

sound/soc/codecs/cs42l43-jack.c+1−0

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

sound/soc/codecs/rt1011.c+1−1

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

sound/soc/codecs/rt1320-sdw.c+3−2

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

sound/soc/codecs/tas2781-fmwlib.c+94−0

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

sound/soc/fsl/fsl_easrc.c+10−4

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

sound/soc/generic/simple-card-utils.c+8−4

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

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

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

sound/soc/qcom/qdsp6/q6apm-dai.c+1−0

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

sound/soc/qcom/qdsp6/q6apm-lpass-dais.c+1−0

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

sound/soc/qcom/qdsp6/q6apm.c+1−0

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

sound/soc/sdca/sdca_functions.c+4−1

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

sound/soc/sdca/sdca_interrupts.c+2−2

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

sound/soc/soc-core.c+8−3

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

sound/soc/tegra/tegra_audio_graph_card.c+11−0

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

sound/usb/endpoint.c+7−3

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

sound/usb/format.c+65−5

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

sound/usb/mixer_s1810c.c+6−6

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

sound/usb/mixer_scarlett2.c+5−7

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

sound/usb/qcom/qc_audio_offload.c+1−1

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

sound/usb/quirks.c+9−1

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

sound/usb/stream.c+3−0

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

sound/usb/usbaudio.h+6−0

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

sound/usb/usx2y/us122l.c+2−10

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

sound/usb/usx2y/us144mkii.c+7−7

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

sound/usb/usx2y/us144mkii_capture.c+6−6

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

sound/usb/usx2y/us144mkii_controls.c+21−21

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

sound/usb/usx2y/us144mkii_midi.c+11−11

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

sound/usb/usx2y/us144mkii_playback.c+5−5

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

sound/usb/validate.c+1−1

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

tools/arch/x86/include/asm/amd/ibs.h+1−1

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

tools/arch/x86/include/asm/cpufeatures.h+3−1

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

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

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

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

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

tools/bootconfig/samples/bad-non-closed-brace.bconf+4−0

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

tools/bootconfig/samples/bad-over-max-brace.bconf+19−0

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

tools/bootconfig/samples/exp-good-nested-brace.bconf+1−0

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

tools/bootconfig/samples/good-nested-brace.bconf+18−0

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

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

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

tools/bpf/resolve_btfids/Makefile+10−2

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

tools/bpf/resolve_btfids/main.c+54−27

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

tools/build/Build.include+9−0

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

tools/build/Makefile.build+4−2

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

tools/include/linux/args.h+4−0

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

tools/include/linux/coresight-pmu.h+0−24

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

tools/include/linux/gfp.h+4−0

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

tools/include/linux/gfp_types.h+7−2

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

tools/include/linux/overflow.h+19−0

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

tools/include/linux/slab.h+9−0

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

tools/include/uapi/asm-generic/unistd.h+4−1

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

tools/include/uapi/linux/kvm.h+23−1

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

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

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

tools/objtool/Makefile+6−4

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

tools/objtool/arch/x86/decode.c+23−39

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

tools/objtool/check.c+19−5

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

tools/objtool/elf.c+1−1

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

tools/objtool/include/objtool/warn.h+1−1

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

tools/objtool/klp-diff.c+26−13

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

tools/perf/Makefile.config+18−0

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

tools/perf/Makefile.perf+1−1

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

tools/perf/arch/arm/entry/syscalls/syscall.tbl+1−0

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

tools/perf/arch/arm/util/cs-etm.c+0−14

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

tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl+1−0

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

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl+1−0

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

tools/perf/arch/s390/entry/syscalls/syscall.tbl+392−467

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

tools/perf/arch/sh/entry/syscalls/syscall.tbl+1−0

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

tools/perf/arch/sparc/entry/syscalls/syscall.tbl+2−1

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

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

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

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

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

tools/perf/arch/xtensa/entry/syscalls/syscall.tbl+1−0

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

tools/perf/builtin-ftrace.c+7−2

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

tools/perf/pmu-events/Build+2−1

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

tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h+1−0

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

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

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

tools/perf/trace/beauty/include/uapi/linux/mount.h+11−2

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

tools/perf/trace/beauty/include/uapi/linux/prctl.h+37−0

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

tools/perf/util/annotate-arch/annotate-loongarch.c+1−1

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

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

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

tools/perf/util/cs-etm-decoder/cs-etm-decoder.c+1−1

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

tools/perf/util/cs-etm.c+13−23

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

tools/perf/util/cs-etm.h+15−0

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

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

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

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

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

tools/power/cpupower/cpupower-service.conf+5−0

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

tools/power/cpupower/cpupower.sh+6−0

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

tools/power/cpupower/utils/cpupower-set.c+5−1

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

tools/power/cpupower/utils/helpers/helpers.h+4−1

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

tools/power/cpupower/utils/helpers/misc.c+39−2

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

tools/power/cpupower/utils/powercap-info.c+2−2

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

tools/sched_ext/Kconfig+61−0

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

tools/sched_ext/Makefile+2−0

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

tools/sched_ext/README.md+0−6

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

tools/sched_ext/include/scx/compat.h+5−2

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

tools/sched_ext/scx_central.c+1−1

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

tools/sched_ext/scx_sdt.c+1−1

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

tools/scripts/syscall.tbl+1−0

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

tools/testing/kunit/kunit_kernel.py+4−2

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

tools/testing/kunit/kunit_tool_test.py+26−0

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

tools/testing/selftests/arm64/abi/hwcap.c+2−2

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

tools/testing/selftests/arm64/signal/testcases/gcs_prot_none_fault.c+76−0

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

tools/testing/selftests/bpf/DENYLIST.asan+3−0

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

tools/testing/selftests/bpf/Makefile+10−4

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

tools/testing/selftests/bpf/benchs/bench_trigger.c+8−6

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

tools/testing/selftests/bpf/bpf_util.h+32−13

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

tools/testing/selftests/bpf/bpftool_helpers.c+19−6

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

tools/testing/selftests/bpf/cgroup_helpers.c+1−1

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

tools/testing/selftests/bpf/jit_disasm_helpers.c+9−9

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

tools/testing/selftests/bpf/network_helpers.c+2−3

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

tools/testing/selftests/bpf/prog_tests/bpf_iter.c+1−2

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

tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c+1−1

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

tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c+3−1

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

tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c+4−2

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

tools/testing/selftests/bpf/prog_tests/dynptr.c+4−1

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

tools/testing/selftests/bpf/prog_tests/fd_array.c+2−2

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

tools/testing/selftests/bpf/prog_tests/flow_dissector.c+2−2

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

tools/testing/selftests/bpf/prog_tests/htab_update.c+1−0

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

tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c+2−5

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c+5−7

This diff is large: its 31 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/lwt_seg6local.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/map_kptr_race.c+218−0

This diff is large: its 219 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/queue_stack_map.c+2−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/reg_bounds.c+59−19

This diff is large: its 117 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/setget_sockopt.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/skc_to_unix_sock.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/sockmap_basic.c+14−14

This diff is large: its 91 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/sockmap_listen.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/sockopt_sk.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c+1−3

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/task_local_data.h+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/tc_opts.c+2−4

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/tc_redirect.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/test_sysctl.c+3−0

This diff is large: its 24 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c+4−1

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/test_veristat.c+2−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/test_xsk.c+20−4

This diff is large: its 40 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c+5−1

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/verifier_log.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/xdp_bonding.c+58−0

This diff is large: its 72 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/xdp_flowtable.c+2−1

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/xdp_metadata.c+2−2

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/bpf/progs/dmabuf_iter.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/progs/exceptions_assert.c+17−17

This diff is large: its 61 lines aren’t shown here.

tools/testing/selftests/bpf/progs/map_kptr_race.c+197−0

This diff is large: its 198 lines aren’t shown here.

tools/testing/selftests/bpf/progs/verifier_bounds.c+175−1

This diff is large: its 188 lines aren’t shown here.

tools/testing/selftests/bpf/progs/verifier_linked_scalars.c+64−0

This diff is large: its 69 lines aren’t shown here.

tools/testing/selftests/bpf/progs/verifier_scalar_ids.c+42−14

This diff is large: its 166 lines aren’t shown here.

tools/testing/selftests/bpf/test_progs.c+27−11

This diff is large: its 77 lines aren’t shown here.

tools/testing/selftests/bpf/test_verifier.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/testing_helpers.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/bpf/trace_helpers.c+12−11

This diff is large: its 65 lines aren’t shown here.

tools/testing/selftests/bpf/trace_helpers.h+9−2

This diff is large: its 25 lines aren’t shown here.

tools/testing/selftests/bpf/verifier/precise.c+4−4

This diff is large: its 24 lines aren’t shown here.

tools/testing/selftests/bpf/veristat.c+2−0

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/xdp_features.c+2−1

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/bpf/xdp_hw_metadata.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/cgroup/test_cpuset_prs.sh+114−110

This diff is large: its 427 lines aren’t shown here.

tools/testing/selftests/drivers/net/hw/rss_ctx.py+98−2

This diff is large: its 127 lines aren’t shown here.

tools/testing/selftests/drivers/net/team/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/drivers/net/team/refleak.sh+17−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/filesystems/nsfs/iterate_mntns.c+15−10

This diff is large: its 77 lines aren’t shown here.

tools/testing/selftests/hid/tests/test_wacom_generic.py+21−13

This diff is large: its 55 lines aren’t shown here.

tools/testing/selftests/kselftest_harness.h+5−2

This diff is large: its 28 lines aren’t shown here.

tools/testing/selftests/kvm/Makefile.kvm+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/kvm/guest_memfd_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/processor.h+23−0

This diff is large: its 44 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/smm.h+17−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/processor.c+26−0

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c+150−0

This diff is large: its 151 lines aren’t shown here.

tools/testing/selftests/kvm/x86/sev_smoke_test.c+30−0

This diff is large: its 58 lines aren’t shown here.

tools/testing/selftests/kvm/x86/smm_test.c+2−25

This diff is large: its 52 lines aren’t shown here.

tools/testing/selftests/net/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/net/bridge_vlan_dump.sh+204−0

This diff is large: its 205 lines aren’t shown here.

tools/testing/selftests/net/fib_nexthops.sh+11−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_join.sh+49−0

This diff is large: its 89 lines aren’t shown here.

tools/testing/selftests/net/mptcp/simult_flows.sh+7−4

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/net/netfilter/nf_queue.c+8−2

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/net/netfilter/nft_queue.sh+9−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/net/packetdrill/tcp_rcv_big_endseq.pkt+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/packetdrill/tcp_rcv_toobig.pkt+0−33

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/net/packetdrill/tcp_rcv_zero_wnd_fin.pkt+27−0

This diff is large: its 28 lines aren’t shown here.

tools/testing/selftests/net/rtnetlink.sh+55−0

This diff is large: its 69 lines aren’t shown here.

tools/testing/selftests/net/tun.c+6−6

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/powerpc/copyloops/.gitignore+2−2

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/powerpc/copyloops/Makefile+8−3

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/powerpc/copyloops/stubs.S+0−8

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/powerpc/copyloops/validate.c+14−1

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/SRCU-N+3−1

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/SRCU-T+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/SRCU-U+2−2

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TASKS02+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TINY01+2−2

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TINY02+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TRACE01+2−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TREE04+3−1

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TREE05+3−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TREE06+4−1

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TREE10+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcu/TRIVIAL+3−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcuscale/TINY+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/refscale/NOPREEMPT+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/refscale/TINY+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/rcutorture/configs/scf/NOPREEMPT+2−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/sched_ext/Makefile+2−0

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/sched_ext/init_enable_count.c+2−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/sched_ext/peek_dsq.bpf.c+2−2

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/sched_ext/rt_stall.c+0−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/sched_ext/runner.c+3−0

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/sched_ext/util.c+2−2

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/actions/ct.json+159−0

This diff is large: its 165 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/actions/ife.json+99−0

This diff is large: its 105 lines aren’t shown here.

tools/testing/selftests/tc-testing/tdc_helper.py+7−3

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/vsock/vmtest.sh+21−20

This diff is large: its 82 lines aren’t shown here.

virt/kvm/Kconfig+1−8

This diff is large: its 33 lines aren’t shown here.

virt/kvm/binary_stats.c+1−1

This diff is large: its 9 lines aren’t shown here.

virt/kvm/kvm_main.c+11−26

This diff is large: its 137 lines aren’t shown here.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t