History

Add USB VBUS regulator for RZ/G2L

Merge series from Biju Das <biju.das.jz@bp.renesas.com>: As per RZ/G2L HW manual, VBUS enable can be controlled by the VBOUT bit of the VBUS Control Register(VBENCTL) register in the USBPHY Control. But this IP is in the Reset block. Reset driver exposes this register as regmap and instantiate the USB VBUS regulator device. Consumers(phy device) can use regulator APIs to control VBUS as controlling is done in the atomic context using a new API which is added for the purpose.

Mark Brown committed 2 years ago

Commit db576ed2 parents b147ae7 84fbd61297 files · +3938 −1796Browse files

Unified · Split

297 files
  1. .mailmap +1 −0
  2. Documentation/admin-guide/kernel-parameters.txt +0 −6
  3. Documentation/devicetree/bindings/dma/fsl,edma.yaml +2 −2
  4. Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml +1 −1
  5. Documentation/devicetree/bindings/i2c/google,cros-ec-i2c-tunnel.yaml +1 −1
  6. Documentation/i2c/i2c_bus.svg +8 −7
  7. Documentation/i2c/summary.rst +50 −29
  8. Documentation/netlink/specs/nfsd.yaml +0 −2
  9. Documentation/power/regulator/consumer.rst +6 −0
  10. Documentation/userspace-api/index.rst +1 −0
  11. Documentation/userspace-api/mfd_noexec.rst +86 −0
  12. Documentation/virt/hyperv/clocks.rst +15 −6
  13. Documentation/virt/hyperv/overview.rst +11 −11
  14. Documentation/virt/hyperv/vmbus.rst +83 −60
  15. MAINTAINERS +15 −17
  16. Makefile +1 −1
  17. arch/arm/boot/dts/nxp/imx/imx53-qsb-common.dtsi +1 −1
  18. arch/arm/boot/dts/nxp/imx/imx53-qsb-hdmi.dtso +4 −2
  19. arch/arm/include/asm/efi.h +13 −0
  20. arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi +2 −1
  21. arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi +1 −1
  22. arch/arm64/boot/dts/freescale/imx8mp-venice-gw73xx.dtsi +1 −1
  23. arch/arm64/boot/dts/freescale/imx8qm-mek.dts +1 −1
  24. arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts +0 −1
  25. arch/arm64/kernel/efi.c +2 −0
  26. arch/arm64/kvm/hyp/nvhe/ffa.c +12 −0
  27. arch/arm64/kvm/vgic/vgic-init.c +1 −1
  28. arch/arm64/kvm/vgic/vgic-mmio-v3.c +13 −2
  29. arch/arm64/kvm/vgic/vgic.h +1 −1
  30. arch/loongarch/Kconfig +4 −1
  31. arch/loongarch/Kconfig.debug +1 −0
  32. arch/loongarch/include/asm/hw_breakpoint.h +3 −1
  33. arch/loongarch/kernel/hw_breakpoint.c +55 −41
  34. arch/loongarch/kernel/ptrace.c +27 −20
  35. arch/loongarch/kvm/exit.c +1 −1
  36. arch/mips/bmips/setup.c +2 −1
  37. arch/mips/include/asm/mipsmtregs.h +1 −1
  38. arch/mips/kernel/syscalls/syscall_o32.tbl +1 −1
  39. arch/mips/pci/ops-rc32434.c +2 −2
  40. arch/powerpc/crypto/.gitignore +2 −0
  41. arch/powerpc/kvm/book3s_64_vio.c +13 −5
  42. arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts +1 −0
  43. arch/x86/include/asm/efi.h +0 −1
  44. arch/x86/kernel/cpu/resctrl/monitor.c +2 −1
  45. arch/x86/kvm/svm/svm.c +2 −2
  46. arch/x86/kvm/x86.c +4 −5
  47. arch/x86/platform/efi/memmap.c +11 −1
  48. drivers/acpi/acpica/exregion.c +2 −21
  49. drivers/acpi/internal.h +4 −0
  50. drivers/acpi/mipi-disco-img.c +19 −9
  51. drivers/ata/ahci.c +8 −0
  52. drivers/dma/Kconfig +1 −1
  53. drivers/dma/idxd/irq.c +3 −1
  54. drivers/dma/ioat/init.c +30 −25
  55. drivers/dma/ti/k3-udma-glue.c +1 −4
  56. drivers/dma/xilinx/xdma.c +2 −2
  57. drivers/firmware/efi/memmap.c +0 −9
  58. drivers/firmware/psci/psci.c +3 −1
  59. drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +0 −34
  60. drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 −2
  61. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +34 −32
  62. drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +0 −15
  63. drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +13 −2
  64. drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +48 −28
  65. drivers/gpu/drm/amd/amdgpu/psp_v14_0.c +5 −0
  66. drivers/gpu/drm/amd/display/Kconfig +1 −1
  67. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10 −3
  68. drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +1 −1
  69. drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c +1 −1
  70. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +72 −0
  71. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +2 −0
  72. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 −1
  73. drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +2 −0
  74. drivers/gpu/drm/i915/display/intel_dp.c +4 −0
  75. drivers/gpu/drm/radeon/sumo_dpm.c +2 −0
  76. drivers/gpu/drm/vmwgfx/Kconfig +1 −1
  77. drivers/gpu/drm/xe/xe_guc.c +2 −2
  78. drivers/hv/hv.c +18 −19
  79. drivers/hv/hv_balloon.c +80 −110
  80. drivers/i2c/busses/i2c-ocores.c +1 −1
  81. drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 −3
  82. drivers/infiniband/hw/mana/mr.c +1 −0
  83. drivers/infiniband/hw/mlx5/main.c +2 −2
  84. drivers/infiniband/hw/mlx5/mr.c +4 −4
  85. drivers/infiniband/hw/mlx5/srq.c +8 −5
  86. drivers/infiniband/sw/rxe/rxe_resp.c +13 −0
  87. drivers/infiniband/sw/rxe/rxe_verbs.c +1 −1
  88. drivers/mfd/axp20x.c +1 −0
  89. drivers/net/ethernet/broadcom/bnxt/bnxt.c +5 −3
  90. drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 −0
  91. drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h +178 −133
  92. drivers/net/ethernet/intel/ice/ice_ddp.c +21 −2
  93. drivers/net/ethernet/intel/ice/ice_main.c +9 −1
  94. drivers/net/ethernet/intel/ice/ice_switch.c +4 −2
  95. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +4 −1
  96. drivers/net/ethernet/marvell/octeontx2/nic/Makefile +1 −2
  97. drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +7 −0
  98. drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +2 −0
  99. drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +4 −1
  100. drivers/net/ethernet/microchip/lan743x_ethtool.c +40 −4
  101. drivers/net/ethernet/microchip/lan743x_main.c +40 −8
  102. drivers/net/ethernet/microchip/lan743x_main.h +28 −0
  103. drivers/net/ethernet/qualcomm/qca_debug.c +2 −4
  104. drivers/net/ethernet/qualcomm/qca_spi.c +8 −8
  105. drivers/net/ethernet/qualcomm/qca_spi.h +1 −2
  106. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +5 −1
  107. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +22 −18
  108. drivers/net/phy/dp83tg720.c +34 −4
  109. drivers/net/phy/mxl-gpy.c +38 −20
  110. drivers/net/usb/ax88179_178a.c +13 −5
  111. drivers/net/usb/rtl8150.c +2 −1
  112. drivers/net/virtio_net.c +29 −3
  113. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +1 −1
  114. drivers/net/wireless/intel/iwlwifi/mvm/scan.c +1 −1
  115. drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +2 −0
  116. drivers/phy/qualcomm/phy-qcom-qmp-combo.c +160 −29
  117. drivers/phy/qualcomm/phy-qcom-qmp-pcs-v6-n4.h +32 −0
  118. drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h +13 −0
  119. drivers/phy/qualcomm/phy-qcom-qmp.h +2 −0
  120. drivers/ptp/ptp_sysfs.c +1 −2
  121. drivers/pwm/pwm-stm32.c +16 −7
  122. drivers/regulator/Kconfig +9 −0
  123. drivers/regulator/Makefile +1 −0
  124. drivers/regulator/axp20x-regulator.c +19 −14
  125. drivers/regulator/bd71815-regulator.c +1 −1
  126. drivers/regulator/core.c +29 −0
  127. drivers/regulator/renesas-usb-vbus-regulator.c +74 −0
  128. drivers/regulator/tps6594-regulator.c +4 −8
  129. drivers/scsi/sd.c +4 −0
  130. drivers/soc/tegra/fuse/fuse-tegra.c +2 −2
  131. drivers/soundwire/amd_manager.c +3 −0
  132. drivers/soundwire/intel_auxdevice.c +5 −1
  133. drivers/soundwire/mipi_disco.c +24 −6
  134. drivers/spi/spi-cs42l43.c +3 −3
  135. drivers/spi/spi-imx.c +2 −12
  136. drivers/spi/spi-stm32-qspi.c +5 −7
  137. drivers/spi/spi.c +10 −6
  138. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +2 −1
  139. drivers/thermal/mediatek/lvts_thermal.c +5 −7
  140. drivers/thermal/thermal_core.c +27 −0
  141. drivers/thermal/thermal_core.h +4 −0
  142. drivers/ufs/core/ufshcd.c +1 −0
  143. drivers/usb/storage/scsiglue.c +6 −0
  144. drivers/usb/storage/uas.c +7 −0
  145. fs/bcachefs/alloc_background.c +61 −15
  146. fs/bcachefs/alloc_background.h +7 −1
  147. fs/bcachefs/bcachefs.h +5 −0
  148. fs/bcachefs/bcachefs_format.h +9 −4
  149. fs/bcachefs/bkey.c +1 −1
  150. fs/bcachefs/bkey_methods.c +5 −1
  151. fs/bcachefs/bkey_methods.h +2 −1
  152. fs/bcachefs/btree_iter.c +8 −3
  153. fs/bcachefs/btree_types.h +8 −8
  154. fs/bcachefs/errcode.h +3 −0
  155. fs/bcachefs/error.c +18 −1
  156. fs/bcachefs/error.h +0 −7
  157. fs/bcachefs/fs-ioctl.c +1 −1
  158. fs/bcachefs/fs.c +14 −7
  159. fs/bcachefs/journal.c +3 −0
  160. fs/bcachefs/journal_io.c +8 −5
  161. fs/bcachefs/lru.h +0 −3
  162. fs/bcachefs/opts.h +1 −1
  163. fs/bcachefs/recovery.c +9 −3
  164. fs/bcachefs/sb-downgrade.c +1 −1
  165. fs/bcachefs/sb-errors_format.h +286 −273
  166. fs/bcachefs/snapshot.c +2 −7
  167. fs/bcachefs/str_hash.h +1 −1
  168. fs/bcachefs/super-io.c +4 −3
  169. fs/bcachefs/super.c +7 −6
  170. fs/btrfs/bio.c +3 −1
  171. fs/btrfs/block-group.c +9 −2
  172. fs/nfsd/netlink.c +0 −2
  173. fs/nfsd/netlink.h +0 −3
  174. fs/nfsd/nfsctl.c +11 −37
  175. fs/ocfs2/journal.c +107 −85
  176. fs/ocfs2/ocfs2.h +27 −0
  177. fs/ocfs2/super.c +3 −1
  178. fs/overlayfs/dir.c +4 −4
  179. fs/overlayfs/export.c +5 −1
  180. fs/smb/client/cifsfs.c +1 −1
  181. fs/smb/client/cifsglob.h +2 −1
  182. fs/smb/client/cifssmb.c +4 −4
  183. fs/smb/client/file.c +6 −21
  184. fs/smb/client/smb2pdu.c +14 −5
  185. fs/xfs/xfs_inode.c +19 −4
  186. include/linux/bpf_verifier.h +2 −0
  187. include/linux/btf.h +1 −1
  188. include/linux/compiler_types.h +23 −0
  189. include/linux/i2c.h +22 −2
  190. include/linux/kcov.h +2 −0
  191. include/linux/lsm_hook_defs.h +1 −1
  192. include/linux/mm.h +1 −8
  193. include/linux/numa.h +5 −0
  194. include/linux/pagemap.h +4 −0
  195. include/linux/pgalloc_tag.h +8 −3
  196. include/linux/regulator/consumer.h +7 −0
  197. include/linux/security.h +3 −2
  198. include/linux/spi/spi.h +3 −2
  199. include/linux/string.h +1 −1
  200. include/net/netns/netfilter.h +3 −0
  201. include/scsi/scsi_devinfo.h +3 −1
  202. init/Kconfig +1 −1
  203. io_uring/rsrc.c +0 −1
  204. kernel/auditfilter.c +3 −2
  205. kernel/bpf/verifier.c +16 −9
  206. kernel/gcov/gcc_4_7.c +3 −1
  207. kernel/kcov.c +1 −0
  208. kernel/pid_namespace.c +1 −0
  209. kernel/trace/Kconfig +2 −2
  210. lib/Kconfig +1 −7
  211. lib/alloc_tag.c +13 −3
  212. lib/closure.c +8 −2
  213. lib/fortify_kunit.c +1 −1
  214. lib/overflow_kunit.c +17 −3
  215. mm/debug_vm_pgtable.c +5 −26
  216. mm/huge_memory.c +17 −11
  217. mm/internal.h +0 −1
  218. mm/memblock.c +7 −21
  219. mm/memcontrol.c +1 −2
  220. mm/memory.c +10 −10
  221. mm/migrate.c +7 −1
  222. mm/mm_init.c +7 −36
  223. mm/page_alloc.c +1 −1
  224. mm/page_table_check.c +10 −1
  225. mm/shmem.c +1 −1
  226. mm/util.c +2 −2
  227. net/core/filter.c +5 −0
  228. net/core/net_namespace.c +7 −2
  229. net/core/netdev-genl.c +8 −8
  230. net/core/sock.c +3 −0
  231. net/ipv4/cipso_ipv4.c +54 −21
  232. net/ipv4/tcp_ao.c +4 −2
  233. net/ipv4/tcp_input.c +1 −0
  234. net/ipv6/ip6_fib.c +2 −1
  235. net/ipv6/route.c +3 −1
  236. net/ipv6/seg6_local.c +4 −4
  237. net/ipv6/xfrm6_policy.c +7 −1
  238. net/mac80211/driver-ops.c +17 −0
  239. net/mac80211/iface.c +10 −12
  240. net/mac80211/scan.c +9 −8
  241. net/mac80211/util.c +1 −1
  242. net/netfilter/core.c +11 −2
  243. net/netfilter/ipset/ip_set_core.c +6 −5
  244. net/netfilter/nf_conntrack_standalone.c +0 −15
  245. net/netfilter/nf_hooks_lwtunnel.c +67 −0
  246. net/netfilter/nf_internals.h +6 −0
  247. net/netrom/nr_timer.c +2 −1
  248. net/sched/act_api.c +1 −2
  249. net/sched/act_ct.c +11 −5
  250. net/sunrpc/svc_xprt.c +5 −3
  251. net/tipc/node.c +1 −0
  252. net/wireless/scan.c +9 −3
  253. rust/kernel/alloc/vec_ext.rs +5 −2
  254. security/Kconfig.hardening +0 −15
  255. security/apparmor/audit.c +3 −3
  256. security/apparmor/include/audit.h +1 −1
  257. security/integrity/ima/ima.h +1 −1
  258. security/integrity/ima/ima_policy.c +9 −6
  259. security/security.c +4 −2
  260. security/selinux/include/audit.h +3 −1
  261. security/selinux/ss/services.c +3 −2
  262. security/smack/smack_lsm.c +3 −1
  263. security/yama/yama_lsm.c +1 −0
  264. sound/core/seq/seq_ump_convert.c +2 −0
  265. sound/hda/intel-dsp-config.c +1 −1
  266. sound/oss/dmasound/dmasound_core.c +1 −0
  267. sound/pci/hda/Kconfig +2 −0
  268. sound/pci/hda/cs35l41_hda.c +3 −3
  269. sound/pci/hda/cs35l41_hda_property.c +8 −0
  270. sound/pci/hda/cs35l56_hda.c +7 −2
  271. sound/pci/hda/patch_realtek.c +36 −3
  272. sound/pci/hda/tas2781_hda_i2c.c +2 −2
  273. tools/hv/Makefile +1 −0
  274. tools/testing/selftests/bpf/prog_tests/verifier.c +2 −0
  275. tools/testing/selftests/bpf/progs/verifier_or_jmp32_k.c +41 −0
  276. tools/testing/selftests/drivers/net/virtio_net/config +7 −1
  277. tools/testing/selftests/fchmodat2/Makefile +10 −1
  278. tools/testing/selftests/filesystems/statmount/statmount_test.c +10 −2
  279. tools/testing/selftests/kvm/include/x86_64/processor.h +1 −0
  280. tools/testing/selftests/kvm/lib/riscv/ucall.c +1 −0
  281. tools/testing/selftests/kvm/lib/x86_64/processor.c +13 −2
  282. tools/testing/selftests/kvm/riscv/ebreak_test.c +1 −0
  283. tools/testing/selftests/kvm/riscv/sbi_pmu_test.c +1 −0
  284. tools/testing/selftests/kvm/x86_64/sev_init2_tests.c +2 −2
  285. tools/testing/selftests/mm/map_fixed_noreplace.c +16 −8
  286. tools/testing/selftests/net/Makefile +2 −0
  287. tools/testing/selftests/net/config +2 −0
  288. tools/testing/selftests/net/mptcp/userspace_pm.sh +28 −18
  289. tools/testing/selftests/net/openvswitch/openvswitch.sh +1 −1
  290. tools/testing/selftests/net/openvswitch/ovs-dpctl.py +1 −1
  291. tools/testing/selftests/net/srv6_end_dx4_netfilter_test.sh +335 −0
  292. tools/testing/selftests/net/srv6_end_dx6_netfilter_test.sh +340 −0
  293. tools/testing/selftests/openat2/Makefile +12 −2
  294. tools/testing/selftests/seccomp/seccomp_benchmark.c +3 −3
  295. virt/kvm/dirty_ring.c +3 −0
  296. virt/kvm/guest_memfd.c +3 −2
  297. virt/kvm/kvm_main.c +10 −9
.mailmap+1−0
@@ -608,6 +608,7 @@ Simon Kelley <simon@thekelleys.org.uk> · 607 unmodified lines
608608 Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
609609 Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>
610610 Sriram R <quic_srirrama@quicinc.com> <srirrama@codeaurora.org>
611+Stanislav Fomichev <sdf@fomichev.me> <sdf@google.com>
611612 Stefan Wahren <wahrenst@gmx.net> <stefan.wahren@i2se.com>
612613 Stéphane Witzmann <stephane.witzmann@ubpmes.univ-bpclermont.fr>
613614 Stephen Hemminger <stephen@networkplumber.org> <shemminger@linux-foundation.org>
Documentation/admin-guide/kernel-parameters.txt+0−6
@@ -2192,12 +2192,6 @@ · 2191 unmodified lines
21922192 Format: 0 | 1
21932193 Default set by CONFIG_INIT_ON_FREE_DEFAULT_ON.
21942194
2195− init_mlocked_on_free= [MM] Fill freed userspace memory with zeroes if
2196− it was mlock'ed and not explicitly munlock'ed
2197− afterwards.
2198− Format: 0 | 1
2199− Default set by CONFIG_INIT_MLOCKED_ON_FREE_DEFAULT_ON
2200−
22012195 init_pkru= [X86] Specify the default memory protection keys rights
22022196 register contents for all processes. 0x55555554 by
22032197 default (disallow access to all but pkey 0). Can
Documentation/devicetree/bindings/dma/fsl,edma.yaml+2−2
@@ -59,8 +59,8 @@ properties: · 58 unmodified lines
5959 - 3
6060
6161 dma-channels:
62− minItems: 1
63− maxItems: 64
62+ minimum: 1
63+ maximum: 64
6464
6565 clocks:
6666 minItems: 1
Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml+1−1
@@ -77,7 +77,7 @@ required: · 76 unmodified lines
7777 - clocks
7878
7979 allOf:
80− - $ref: i2c-controller.yaml
80+ - $ref: /schemas/i2c/i2c-controller.yaml#
8181 - if:
8282 properties:
8383 compatible:
Documentation/devicetree/bindings/i2c/google,cros-ec-i2c-tunnel.yaml+1−1
@@ -21,7 +21,7 @@ description: | · 20 unmodified lines
2121 google,cros-ec-spi or google,cros-ec-i2c.
2222
2323 allOf:
24− - $ref: i2c-controller.yaml#
24+ - $ref: /schemas/i2c/i2c-controller.yaml#
2525
2626 properties:
2727 compatible:
Documentation/i2c/i2c_bus.svg+8−7
@@ -1,5 +1,6 @@
11 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
22 <!-- Created with Inkscape (http://www.inkscape.org/) -->
3+<!-- Updated to inclusive terminology by Wolfram Sang -->
34
45 <svg
56 xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -1120,7 +1121,7 @@ · 1114 unmodified lines
11201121 <rect
11211122 style="opacity:1;fill:#ffb9b9;fill-opacity:1;stroke:#f00000;stroke-width:2.8125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
11221123 id="rect4424-3-2-9-7"
1123− width="112.5"
1124+ width="134.5"
11241125 height="113.75008"
11251126 x="112.5"
11261127 y="471.11221"
@@ -1133,15 +1134,15 @@ · 6 unmodified lines
11331134 y="521.46259"
11341135 id="text4349"><tspan
11351136 sodipodi:role="line"
1136− x="167.5354"
1137+ x="178.5354"
11371138 y="521.46259"
11381139 style="font-size:25px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle"
11391140 id="tspan1273">I2C</tspan><tspan
11401141 sodipodi:role="line"
1141− x="167.5354"
1142+ x="178.5354"
11421143 y="552.71259"
11431144 style="font-size:25px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle"
1144− id="tspan1285">Master</tspan></text>
1145+ id="tspan1285">Controller</tspan></text>
11451146 <rect
11461147 style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#b9ffb9;fill-opacity:1;fill-rule:nonzero;stroke:#006400;stroke-width:2.8125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
11471148 id="rect4424-3-2-9-7-3-3-5-3"
@@ -1171,7 +1172,7 @@ · 23 unmodified lines
11711172 x="318.59131"
11721173 y="552.08752"
11731174 style="font-size:25.00000191px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle;stroke-width:1px"
1174− id="tspan1287">Slave</tspan></text>
1175+ id="tspan1287">Target</tspan></text>
11751176 <path
11761177 style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.99968767;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
11771178 d="m 112.49995,677.36223 c 712.50005,0 712.50005,0 712.50005,0"
@@ -1233,7 +1234,7 @@ · 55 unmodified lines
12331234 x="468.59131"
12341235 y="552.08746"
12351236 style="font-size:25.00000191px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle;stroke-width:1px"
1236− id="tspan1287-6">Slave</tspan></text>
1237+ id="tspan1287-6">Target</tspan></text>
12371238 <rect
12381239 style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#b9ffb9;fill-opacity:1;fill-rule:nonzero;stroke:#006400;stroke-width:2.8125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
12391240 id="rect4424-3-2-9-7-3-3-5-3-1"
@@ -1258,7 +1259,7 @@ · 18 unmodified lines
12581259 x="618.59131"
12591260 y="552.08746"
12601261 style="font-size:25.00000191px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle;stroke-width:1px"
1261− id="tspan1287-9">Slave</tspan></text>
1262+ id="tspan1287-9">Target</tspan></text>
12621263 <path
12631264 style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.99968743;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#DotM)"
12641265 d="m 150,583.61221 v 93.75"
Documentation/i2c/summary.rst+50−29
@@ -3,29 +3,27 @@ Introduction to I2C and SMBus · 2 unmodified lines
33 =============================
44
55 I²C (pronounce: I squared C and written I2C in the kernel documentation) is
6−a protocol developed by Philips. It is a slow two-wire protocol (variable
7−speed, up to 400 kHz), with a high speed extension (3.4 MHz). It provides
6+a protocol developed by Philips. It is a two-wire protocol with variable
7+speed (typically up to 400 kHz, high speed modes up to 5 MHz). It provides
88 an inexpensive bus for connecting many types of devices with infrequent or
9−low bandwidth communications needs. I2C is widely used with embedded
10−systems. Some systems use variants that don't meet branding requirements,
9+low bandwidth communications needs. I2C is widely used with embedded
10+systems. Some systems use variants that don't meet branding requirements,
1111 and so are not advertised as being I2C but come under different names,
1212 e.g. TWI (Two Wire Interface), IIC.
1313
14−The latest official I2C specification is the `"I2C-bus specification and user
15−manual" (UM10204) <https://www.nxp.com/webapp/Download?colCode=UM10204>`_
16−published by NXP Semiconductors. However, you need to log-in to the site to
17−access the PDF. An older version of the specification (revision 6) is archived
18−`here <https://web.archive.org/web/20210813122132/https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_.
14+The latest official I2C specification is the `"I²C-bus specification and user
15+manual" (UM10204) <https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_
16+published by NXP Semiconductors, version 7 as of this writing.
1917
2018 SMBus (System Management Bus) is based on the I2C protocol, and is mostly
21−a subset of I2C protocols and signaling. Many I2C devices will work on an
19+a subset of I2C protocols and signaling. Many I2C devices will work on an
2220 SMBus, but some SMBus protocols add semantics beyond what is required to
23−achieve I2C branding. Modern PC mainboards rely on SMBus. The most common
21+achieve I2C branding. Modern PC mainboards rely on SMBus. The most common
2422 devices connected through SMBus are RAM modules configured using I2C EEPROMs,
2523 and hardware monitoring chips.
2624
2725 Because the SMBus is mostly a subset of the generalized I2C bus, we can
28−use its protocols on many I2C systems. However, there are systems that don't
26+use its protocols on many I2C systems. However, there are systems that don't
2927 meet both SMBus and I2C electrical constraints; and others which can't
3028 implement all the common SMBus protocol semantics or messages.
3129
@@ -33,29 +31,52 @@ implement all the common SMBus protocol semantics or messages. · 1 unmodified line
3331 Terminology
3432 ===========
3533
36−Using the terminology from the official documentation, the I2C bus connects
37−one or more *master* chips and one or more *slave* chips.
34+The I2C bus connects one or more controller chips and one or more target chips.
3835
3936 .. kernel-figure:: i2c_bus.svg
40− :alt: Simple I2C bus with one master and 3 slaves
37+ :alt: Simple I2C bus with one controller and 3 targets
4138
4239 Simple I2C bus
4340
44−A **master** chip is a node that starts communications with slaves. In the
45−Linux kernel implementation it is called an **adapter** or bus. Adapter
46−drivers are in the ``drivers/i2c/busses/`` subdirectory.
41+A **controller** chip is a node that starts communications with targets. In the
42+Linux kernel implementation it is also called an "adapter" or "bus". Controller
43+drivers are usually in the ``drivers/i2c/busses/`` subdirectory.
4744
48−An **algorithm** contains general code that can be used to implement a
49−whole class of I2C adapters. Each specific adapter driver either depends on
50−an algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes
51−its own implementation.
45+An **algorithm** contains general code that can be used to implement a whole
46+class of I2C controllers. Each specific controller driver either depends on an
47+algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes its
48+own implementation.
5249
53−A **slave** chip is a node that responds to communications when addressed
54−by the master. In Linux it is called a **client**. Client drivers are kept
55−in a directory specific to the feature they provide, for example
56−``drivers/media/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for
50+A **target** chip is a node that responds to communications when addressed by a
51+controller. In the Linux kernel implementation it is also called a "client".
52+While targets are usually separate external chips, Linux can also act as a
53+target (needs hardware support) and respond to another controller on the bus.
54+This is then called a **local target**. In contrast, an external chip is called
55+a **remote target**.
56+
57+Target drivers are kept in a directory specific to the feature they provide,
58+for example ``drivers/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for
5759 video-related chips.
5860
59−For the example configuration in figure, you will need a driver for your
60−I2C adapter, and drivers for your I2C devices (usually one driver for each
61−device).
61+For the example configuration in the figure above, you will need one driver for
62+the I2C controller, and drivers for your I2C targets. Usually one driver for
63+each target.
64+
65+Synonyms
66+--------
67+
68+As mentioned above, the Linux I2C implementation historically uses the terms
69+"adapter" for controller and "client" for target. A number of data structures
70+have these synonyms in their name. So, when discussing implementation details,
71+you should be aware of these terms as well. The official wording is preferred,
72+though.
73+
74+Outdated terminology
75+--------------------
76+
77+In earlier I2C specifications, controller was named "master" and target was
78+named "slave". These terms have been obsoleted with v7 of the specification and
79+their use is also discouraged by the Linux Kernel Code of Conduct. You may
80+still find them in references to documentation which has not been updated. The
81+general attitude, however, is to use the inclusive terms: controller and
82+target. Work to replace the old terminology in the Linux Kernel is on-going.
Documentation/netlink/specs/nfsd.yaml+0−2
@@ -123,8 +123,6 @@ operations: · 122 unmodified lines
123123 doc: dump pending nfsd rpc
124124 attribute-set: rpc-status
125125 dump:
126− pre: nfsd-nl-rpc-status-get-start
127− post: nfsd-nl-rpc-status-get-done
128126 reply:
129127 attributes:
130128 - xid
Documentation/power/regulator/consumer.rst+6−0
@@ -227,3 +227,9 @@ directly written to the voltage selector register, use:: · 226 unmodified lines
227227
228228 int regulator_list_hardware_vsel(struct regulator *regulator,
229229 unsigned selector);
230+
231+To access the hardware for enabling/disabling the regulator, consumers must
232+use regulator_get_exclusive(), as it can't work if there's more than one
233+consumer. To enable/disable regulator use::
234+
235+ int regulator_hardware_enable(struct regulator *regulator, bool enable);
Documentation/userspace-api/index.rst+1−0
@@ -32,6 +32,7 @@ Security-related interfaces · 31 unmodified lines
3232 seccomp_filter
3333 landlock
3434 lsm
35+ mfd_noexec
3536 spec_ctrl
3637 tee
3738
Documentation/userspace-api/mfd_noexec.rst+86−0
@@ -0,0 +1,86 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==================================
4+Introduction of non-executable mfd
5+==================================
6+:Author:
7+ Daniel Verkamp <dverkamp@chromium.org>
8+ Jeff Xu <jeffxu@chromium.org>
9+
10+:Contributor:
11+ Aleksa Sarai <cyphar@cyphar.com>
12+
13+Since Linux introduced the memfd feature, memfds have always had their
14+execute bit set, and the memfd_create() syscall doesn't allow setting
15+it differently.
16+
17+However, in a secure-by-default system, such as ChromeOS, (where all
18+executables should come from the rootfs, which is protected by verified
19+boot), this executable nature of memfd opens a door for NoExec bypass
20+and enables “confused deputy attack”. E.g, in VRP bug [1]: cros_vm
21+process created a memfd to share the content with an external process,
22+however the memfd is overwritten and used for executing arbitrary code
23+and root escalation. [2] lists more VRP of this kind.
24+
25+On the other hand, executable memfd has its legit use: runc uses memfd’s
26+seal and executable feature to copy the contents of the binary then
27+execute them. For such a system, we need a solution to differentiate runc's
28+use of executable memfds and an attacker's [3].
29+
30+To address those above:
31+ - Let memfd_create() set X bit at creation time.
32+ - Let memfd be sealed for modifying X bit when NX is set.
33+ - Add a new pid namespace sysctl: vm.memfd_noexec to help applications in
34+ migrating and enforcing non-executable MFD.
35+
36+User API
37+========
38+``int memfd_create(const char *name, unsigned int flags)``
39+
40+``MFD_NOEXEC_SEAL``
41+ When MFD_NOEXEC_SEAL bit is set in the ``flags``, memfd is created
42+ with NX. F_SEAL_EXEC is set and the memfd can't be modified to
43+ add X later. MFD_ALLOW_SEALING is also implied.
44+ This is the most common case for the application to use memfd.
45+
46+``MFD_EXEC``
47+ When MFD_EXEC bit is set in the ``flags``, memfd is created with X.
48+
49+Note:
50+ ``MFD_NOEXEC_SEAL`` implies ``MFD_ALLOW_SEALING``. In case that
51+ an app doesn't want sealing, it can add F_SEAL_SEAL after creation.
52+
53+
54+Sysctl:
55+========
56+``pid namespaced sysctl vm.memfd_noexec``
57+
58+The new pid namespaced sysctl vm.memfd_noexec has 3 values:
59+
60+ - 0: MEMFD_NOEXEC_SCOPE_EXEC
61+ memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL acts like
62+ MFD_EXEC was set.
63+
64+ - 1: MEMFD_NOEXEC_SCOPE_NOEXEC_SEAL
65+ memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL acts like
66+ MFD_NOEXEC_SEAL was set.
67+
68+ - 2: MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED
69+ memfd_create() without MFD_NOEXEC_SEAL will be rejected.
70+
71+The sysctl allows finer control of memfd_create for old software that
72+doesn't set the executable bit; for example, a container with
73+vm.memfd_noexec=1 means the old software will create non-executable memfd
74+by default while new software can create executable memfd by setting
75+MFD_EXEC.
76+
77+The value of vm.memfd_noexec is passed to child namespace at creation
78+time. In addition, the setting is hierarchical, i.e. during memfd_create,
79+we will search from current ns to root ns and use the most restrictive
80+setting.
81+
82+[1] https://crbug.com/1305267
83+
84+[2] https://bugs.chromium.org/p/chromium/issues/list?q=type%3Dbug-security%20memfd%20escalation&can=1
85+
86+[3] https://lwn.net/Articles/781013/
Documentation/virt/hyperv/clocks.rst+15−6
@@ -62,12 +62,21 @@ shared page with scale and offset values into user space. User · 61 unmodified lines
6262 space code performs the same algorithm of reading the TSC and
6363 applying the scale and offset to get the constant 10 MHz clock.
6464
65−Linux clockevents are based on Hyper-V synthetic timer 0. While
66−Hyper-V offers 4 synthetic timers for each CPU, Linux only uses
67−timer 0. Interrupts from stimer0 are recorded on the "HVS" line in
68−/proc/interrupts. Clockevents based on the virtualized PIT and
69−local APIC timer also work, but the Hyper-V synthetic timer is
70−preferred.
65+Linux clockevents are based on Hyper-V synthetic timer 0 (stimer0).
66+While Hyper-V offers 4 synthetic timers for each CPU, Linux only uses
67+timer 0. In older versions of Hyper-V, an interrupt from stimer0
68+results in a VMBus control message that is demultiplexed by
69+vmbus_isr() as described in the Documentation/virt/hyperv/vmbus.rst
70+documentation. In newer versions of Hyper-V, stimer0 interrupts can
71+be mapped to an architectural interrupt, which is referred to as
72+"Direct Mode". Linux prefers to use Direct Mode when available. Since
73+x86/x64 doesn't support per-CPU interrupts, Direct Mode statically
74+allocates an x86 interrupt vector (HYPERV_STIMER0_VECTOR) across all CPUs
75+and explicitly codes it to call the stimer0 interrupt handler. Hence
76+interrupts from stimer0 are recorded on the "HVS" line in /proc/interrupts
77+rather than being associated with a Linux IRQ. Clockevents based on the
78+virtualized PIT and local APIC timer also work, but Hyper-V stimer0
79+is preferred.
7180
7281 The driver for the Hyper-V synthetic system clock and timers is
7382 drivers/clocksource/hyperv_timer.c.
Documentation/virt/hyperv/overview.rst+11−11
@@ -40,7 +40,7 @@ Linux guests communicate with Hyper-V in four different ways: · 39 unmodified lines
4040 arm64, these synthetic registers must be accessed using explicit
4141 hypercalls.
4242
43−* VMbus: VMbus is a higher-level software construct that is built on
43+* VMBus: VMBus is a higher-level software construct that is built on
4444 the other 3 mechanisms. It is a message passing interface between
4545 the Hyper-V host and the Linux guest. It uses memory that is shared
4646 between Hyper-V and the guest, along with various signaling
@@ -54,8 +54,8 @@ x86/x64 architecture only. · 7 unmodified lines
5454
5555 .. _Hyper-V Top Level Functional Spec (TLFS): https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/tlfs
5656
57−VMbus is not documented. This documentation provides a high-level
58−overview of VMbus and how it works, but the details can be discerned
57+VMBus is not documented. This documentation provides a high-level
58+overview of VMBus and how it works, but the details can be discerned
5959 only from the code.
6060
6161 Sharing Memory
@@ -74,7 +74,7 @@ follows: · 12 unmodified lines
7474 physical address space. How Hyper-V is told about the GPA or list
7575 of GPAs varies. In some cases, a single GPA is written to a
7676 synthetic register. In other cases, a GPA or list of GPAs is sent
77− in a VMbus message.
77+ in a VMBus message.
7878
7979 * Hyper-V translates the GPAs into "real" physical memory addresses,
8080 and creates a virtual mapping that it can use to access the memory.
@@ -133,9 +133,9 @@ only the CPUs actually present in the VM, so Linux does not report · 52 unmodified lines
133133 any hot-add CPUs.
134134
135135 A Linux guest CPU may be taken offline using the normal Linux
136−mechanisms, provided no VMbus channel interrupts are assigned to
137−the CPU. See the section on VMbus Interrupts for more details
138−on how VMbus channel interrupts can be re-assigned to permit
136+mechanisms, provided no VMBus channel interrupts are assigned to
137+the CPU. See the section on VMBus Interrupts for more details
138+on how VMBus channel interrupts can be re-assigned to permit
139139 taking a CPU offline.
140140
141141 32-bit and 64-bit
@@ -169,14 +169,14 @@ and functionality. Hyper-V indicates feature/function availability · 27 unmodified lines
169169 via flags in synthetic MSRs that Hyper-V provides to the guest,
170170 and the guest code tests these flags.
171171
172−VMbus has its own protocol version that is negotiated during the
173−initial VMbus connection from the guest to Hyper-V. This version
172+VMBus has its own protocol version that is negotiated during the
173+initial VMBus connection from the guest to Hyper-V. This version
174174 number is also output to dmesg during boot. This version number
175175 is checked in a few places in the code to determine if specific
176176 functionality is present.
177177
178−Furthermore, each synthetic device on VMbus also has a protocol
179−version that is separate from the VMbus protocol version. Device
178+Furthermore, each synthetic device on VMBus also has a protocol
179+version that is separate from the VMBus protocol version. Device
180180 drivers for these synthetic devices typically negotiate the device
181181 protocol version, and may test that protocol version to determine
182182 if specific device functionality is present.
Documentation/virt/hyperv/vmbus.rst+83−60
@@ -1,8 +1,8 @@
11 .. SPDX-License-Identifier: GPL-2.0
22
3−VMbus
3+VMBus
44 =====
5−VMbus is a software construct provided by Hyper-V to guest VMs. It
5+VMBus is a software construct provided by Hyper-V to guest VMs. It
66 consists of a control path and common facilities used by synthetic
77 devices that Hyper-V presents to guest VMs. The control path is
88 used to offer synthetic devices to the guest VM and, in some cases,
@@ -12,9 +12,9 @@ and the synthetic device implementation that is part of Hyper-V, and · 3 unmodified lines
1212 signaling primitives to allow Hyper-V and the guest to interrupt
1313 each other.
1414
15−VMbus is modeled in Linux as a bus, with the expected /sys/bus/vmbus
16−entry in a running Linux guest. The VMbus driver (drivers/hv/vmbus_drv.c)
17−establishes the VMbus control path with the Hyper-V host, then
15+VMBus is modeled in Linux as a bus, with the expected /sys/bus/vmbus
16+entry in a running Linux guest. The VMBus driver (drivers/hv/vmbus_drv.c)
17+establishes the VMBus control path with the Hyper-V host, then
1818 registers itself as a Linux bus driver. It implements the standard
1919 bus functions for adding and removing devices to/from the bus.
2020
@@ -49,9 +49,9 @@ synthetic NIC is referred to as "netvsc" and the Linux driver for · 28 unmodified lines
4949 the synthetic SCSI controller is "storvsc". These drivers contain
5050 functions with names like "storvsc_connect_to_vsp".
5151
52−VMbus channels
52+VMBus channels
5353 --------------
54−An instance of a synthetic device uses VMbus channels to communicate
54+An instance of a synthetic device uses VMBus channels to communicate
5555 between the VSP and the VSC. Channels are bi-directional and used
5656 for passing messages. Most synthetic devices use a single channel,
5757 but the synthetic SCSI controller and synthetic NIC may use multiple
@@ -73,7 +73,7 @@ write indices and some control flags, followed by the memory for the · 15 unmodified lines
7373 actual ring. The size of the ring is determined by the VSC in the
7474 guest and is specific to each synthetic device. The list of GPAs
7575 making up the ring is communicated to the Hyper-V host over the
76−VMbus control path as a GPA Descriptor List (GPADL). See function
76+VMBus control path as a GPA Descriptor List (GPADL). See function
7777 vmbus_establish_gpadl().
7878
7979 Each ring buffer is mapped into contiguous Linux kernel virtual
@@ -102,10 +102,10 @@ resources. For Windows Server 2019 and later, this limit is · 22 unmodified lines
102102 approximately 1280 Mbytes. For versions prior to Windows Server
103103 2019, the limit is approximately 384 Mbytes.
104104
105−VMbus messages
106−--------------
107−All VMbus messages have a standard header that includes the message
108−length, the offset of the message payload, some flags, and a
105+VMBus channel messages
106+----------------------
107+All messages sent in a VMBus channel have a standard header that includes
108+the message length, the offset of the message payload, some flags, and a
109109 transactionID. The portion of the message after the header is
110110 unique to each VSP/VSC pair.
111111
@@ -137,7 +137,7 @@ control message contains a list of GPAs that describe the data · 25 unmodified lines
137137 buffer. For example, the storvsc driver uses this approach to
138138 specify the data buffers to/from which disk I/O is done.
139139
140−Three functions exist to send VMbus messages:
140+Three functions exist to send VMBus channel messages:
141141
142142 1. vmbus_sendpacket(): Control-only messages and messages with
143143 embedded data -- no GPAs
@@ -154,20 +154,51 @@ Historically, Linux guests have trusted Hyper-V to send well-formed · 10 unmodified lines
154154 and valid messages, and Linux drivers for synthetic devices did not
155155 fully validate messages. With the introduction of processor
156156 technologies that fully encrypt guest memory and that allow the
157−guest to not trust the hypervisor (AMD SNP-SEV, Intel TDX), trusting
157+guest to not trust the hypervisor (AMD SEV-SNP, Intel TDX), trusting
158158 the Hyper-V host is no longer a valid assumption. The drivers for
159−VMbus synthetic devices are being updated to fully validate any
159+VMBus synthetic devices are being updated to fully validate any
160160 values read from memory that is shared with Hyper-V, which includes
161−messages from VMbus devices. To facilitate such validation,
161+messages from VMBus devices. To facilitate such validation,
162162 messages read by the guest from the "in" ring buffer are copied to a
163163 temporary buffer that is not shared with Hyper-V. Validation is
164164 performed in this temporary buffer without the risk of Hyper-V
165165 maliciously modifying the message after it is validated but before
166166 it is used.
167167
168−VMbus interrupts
168+Synthetic Interrupt Controller (synic)
169+--------------------------------------
170+Hyper-V provides each guest CPU with a synthetic interrupt controller
171+that is used by VMBus for host-guest communication. While each synic
172+defines 16 synthetic interrupts (SINT), Linux uses only one of the 16
173+(VMBUS_MESSAGE_SINT). All interrupts related to communication between
174+the Hyper-V host and a guest CPU use that SINT.
175+
176+The SINT is mapped to a single per-CPU architectural interrupt (i.e,
177+an 8-bit x86/x64 interrupt vector, or an arm64 PPI INTID). Because
178+each CPU in the guest has a synic and may receive VMBus interrupts,
179+they are best modeled in Linux as per-CPU interrupts. This model works
180+well on arm64 where a single per-CPU Linux IRQ is allocated for
181+VMBUS_MESSAGE_SINT. This IRQ appears in /proc/interrupts as an IRQ labelled
182+"Hyper-V VMbus". Since x86/x64 lacks support for per-CPU IRQs, an x86
183+interrupt vector is statically allocated (HYPERVISOR_CALLBACK_VECTOR)
184+across all CPUs and explicitly coded to call vmbus_isr(). In this case,
185+there's no Linux IRQ, and the interrupts are visible in aggregate in
186+/proc/interrupts on the "HYP" line.
187+
188+The synic provides the means to demultiplex the architectural interrupt into
189+one or more logical interrupts and route the logical interrupt to the proper
190+VMBus handler in Linux. This demultiplexing is done by vmbus_isr() and
191+related functions that access synic data structures.
192+
193+The synic is not modeled in Linux as an irq chip or irq domain,
194+and the demultiplexed logical interrupts are not Linux IRQs. As such,
195+they don't appear in /proc/interrupts or /proc/irq. The CPU
196+affinity for one of these logical interrupts is controlled via an
197+entry under /sys/bus/vmbus as described below.
198+
199+VMBus interrupts
169200 ----------------
170−VMbus provides a mechanism for the guest to interrupt the host when
201+VMBus provides a mechanism for the guest to interrupt the host when
171202 the guest has queued new messages in a ring buffer. The host
172203 expects that the guest will send an interrupt only when an "out"
173204 ring buffer transitions from empty to non-empty. If the guest sends
@@ -176,63 +207,55 @@ unnecessary. If a guest sends an excessive number of unnecessary · 2 unmodified lines
176207 interrupts, the host may throttle that guest by suspending its
177208 execution for a few seconds to prevent a denial-of-service attack.
178209
179−Similarly, the host will interrupt the guest when it sends a new
180−message on the VMbus control path, or when a VMbus channel "in" ring
181−buffer transitions from empty to non-empty. Each CPU in the guest
182−may receive VMbus interrupts, so they are best modeled as per-CPU
183−interrupts in Linux. This model works well on arm64 where a single
184−per-CPU IRQ is allocated for VMbus. Since x86/x64 lacks support for
185−per-CPU IRQs, an x86 interrupt vector is statically allocated (see
186−HYPERVISOR_CALLBACK_VECTOR) across all CPUs and explicitly coded to
187−call the VMbus interrupt service routine. These interrupts are
188−visible in /proc/interrupts on the "HYP" line.
189−
190−The guest CPU that a VMbus channel will interrupt is selected by the
210+Similarly, the host will interrupt the guest via the synic when
211+it sends a new message on the VMBus control path, or when a VMBus
212+channel "in" ring buffer transitions from empty to non-empty due to
213+the host inserting a new VMBus channel message. The control message stream
214+and each VMBus channel "in" ring buffer are separate logical interrupts
215+that are demultiplexed by vmbus_isr(). It demultiplexes by first checking
216+for channel interrupts by calling vmbus_chan_sched(), which looks at a synic
217+bitmap to determine which channels have pending interrupts on this CPU.
218+If multiple channels have pending interrupts for this CPU, they are
219+processed sequentially. When all channel interrupts have been processed,
220+vmbus_isr() checks for and processes any messages received on the VMBus
221+control path.
222+
223+The guest CPU that a VMBus channel will interrupt is selected by the
191224 guest when the channel is created, and the host is informed of that
192−selection. VMbus devices are broadly grouped into two categories:
225+selection. VMBus devices are broadly grouped into two categories:
193226
194−1. "Slow" devices that need only one VMbus channel. The devices
227+1. "Slow" devices that need only one VMBus channel. The devices
195228 (such as keyboard, mouse, heartbeat, and timesync) generate
196− relatively few interrupts. Their VMbus channels are all
229+ relatively few interrupts. Their VMBus channels are all
197230 assigned to interrupt the VMBUS_CONNECT_CPU, which is always
198231 CPU 0.
199232
200−2. "High speed" devices that may use multiple VMbus channels for
233+2. "High speed" devices that may use multiple VMBus channels for
201234 higher parallelism and performance. These devices include the
202− synthetic SCSI controller and synthetic NIC. Their VMbus
235+ synthetic SCSI controller and synthetic NIC. Their VMBus
203236 channels interrupts are assigned to CPUs that are spread out
204237 among the available CPUs in the VM so that interrupts on
205238 multiple channels can be processed in parallel.
206239
207−The assignment of VMbus channel interrupts to CPUs is done in the
240+The assignment of VMBus channel interrupts to CPUs is done in the
208241 function init_vp_index(). This assignment is done outside of the
209242 normal Linux interrupt affinity mechanism, so the interrupts are
210243 neither "unmanaged" nor "managed" interrupts.
211244
212−The CPU that a VMbus channel will interrupt can be seen in
245+The CPU that a VMBus channel will interrupt can be seen in
213246 /sys/bus/vmbus/devices/<deviceGUID>/ channels/<channelRelID>/cpu.
214247 When running on later versions of Hyper-V, the CPU can be changed
215−by writing a new value to this sysfs entry. Because the interrupt
216−assignment is done outside of the normal Linux affinity mechanism,
217−there are no entries in /proc/irq corresponding to individual
218−VMbus channel interrupts.
248+by writing a new value to this sysfs entry. Because VMBus channel
249+interrupts are not Linux IRQs, there are no entries in /proc/interrupts
250+or /proc/irq corresponding to individual VMBus channel interrupts.
219251
220252 An online CPU in a Linux guest may not be taken offline if it has
221−VMbus channel interrupts assigned to it. Any such channel
253+VMBus channel interrupts assigned to it. Any such channel
222254 interrupts must first be manually reassigned to another CPU as
223255 described above. When no channel interrupts are assigned to the
224256 CPU, it can be taken offline.
225257
226−When a guest CPU receives a VMbus interrupt from the host, the
227−function vmbus_isr() handles the interrupt. It first checks for
228−channel interrupts by calling vmbus_chan_sched(), which looks at a
229−bitmap setup by the host to determine which channels have pending
230−interrupts on this CPU. If multiple channels have pending
231−interrupts for this CPU, they are processed sequentially. When all
232−channel interrupts have been processed, vmbus_isr() checks for and
233−processes any message received on the VMbus control path.
234−
235−The VMbus channel interrupt handling code is designed to work
258+The VMBus channel interrupt handling code is designed to work
236259 correctly even if an interrupt is received on a CPU other than the
237260 CPU assigned to the channel. Specifically, the code does not use
238261 CPU-based exclusion for correctness. In normal operation, Hyper-V
@@ -242,23 +265,23 @@ when Hyper-V will make the transition. The code must work correctly · 3 unmodified lines
242265 even if there is a time lag before Hyper-V starts interrupting the
243266 new CPU. See comments in target_cpu_store().
244267
245−VMbus device creation/deletion
268+VMBus device creation/deletion
246269 ------------------------------
247270 Hyper-V and the Linux guest have a separate message-passing path
248271 that is used for synthetic device creation and deletion. This
249−path does not use a VMbus channel. See vmbus_post_msg() and
272+path does not use a VMBus channel. See vmbus_post_msg() and
250273 vmbus_on_msg_dpc().
251274
252275 The first step is for the guest to connect to the generic
253−Hyper-V VMbus mechanism. As part of establishing this connection,
254−the guest and Hyper-V agree on a VMbus protocol version they will
276+Hyper-V VMBus mechanism. As part of establishing this connection,
277+the guest and Hyper-V agree on a VMBus protocol version they will
255278 use. This negotiation allows newer Linux kernels to run on older
256279 Hyper-V versions, and vice versa.
257280
258281 The guest then tells Hyper-V to "send offers". Hyper-V sends an
259282 offer message to the guest for each synthetic device that the VM
260−is configured to have. Each VMbus device type has a fixed GUID
261−known as the "class ID", and each VMbus device instance is also
283+is configured to have. Each VMBus device type has a fixed GUID
284+known as the "class ID", and each VMBus device instance is also
262285 identified by a GUID. The offer message from Hyper-V contains
263286 both GUIDs to uniquely (within the VM) identify the device.
264287 There is one offer message for each device instance, so a VM with
@@ -275,7 +298,7 @@ type based on the class ID, and invokes the correct driver to set up · 10 unmodified lines
275298 the device. Driver/device matching is performed using the standard
276299 Linux mechanism.
277300
278−The device driver probe function opens the primary VMbus channel to
301+The device driver probe function opens the primary VMBus channel to
279302 the corresponding VSP. It allocates guest memory for the channel
280303 ring buffers and shares the ring buffer with the Hyper-V host by
281304 giving the host a list of GPAs for the ring buffer memory. See
@@ -285,7 +308,7 @@ Once the ring buffer is set up, the device driver and VSP exchange · 3 unmodified lines
285308 setup messages via the primary channel. These messages may include
286309 negotiating the device protocol version to be used between the Linux
287310 VSC and the VSP on the Hyper-V host. The setup messages may also
288−include creating additional VMbus channels, which are somewhat
311+include creating additional VMBus channels, which are somewhat
289312 mis-named as "sub-channels" since they are functionally
290313 equivalent to the primary channel once they are created.
291314
MAINTAINERS+15−17
@@ -3980,7 +3980,7 @@ R: Song Liu <song@kernel.org> · 3979 unmodified lines
39803980 R: Yonghong Song <yonghong.song@linux.dev>
39813981 R: John Fastabend <john.fastabend@gmail.com>
39823982 R: KP Singh <kpsingh@kernel.org>
3983−R: Stanislav Fomichev <sdf@google.com>
3983+R: Stanislav Fomichev <sdf@fomichev.me>
39843984 R: Hao Luo <haoluo@google.com>
39853985 R: Jiri Olsa <jolsa@kernel.org>
39863986 L: bpf@vger.kernel.org
@@ -5295,7 +5295,7 @@ F: drivers/infiniband/hw/usnic/ · 1308 unmodified lines
52955295
52965296 CLANG CONTROL FLOW INTEGRITY SUPPORT
52975297 M: Sami Tolvanen <samitolvanen@google.com>
5298−M: Kees Cook <keescook@chromium.org>
5298+M: Kees Cook <kees@kernel.org>
52995299 R: Nathan Chancellor <nathan@kernel.org>
53005300 L: llvm@lists.linux.dev
53015301 S: Supported
@@ -8211,7 +8211,7 @@ F: rust/kernel/net/phy.rs · 2909 unmodified lines
82118211
82128212 EXEC & BINFMT API, ELF
82138213 R: Eric Biederman <ebiederm@xmission.com>
8214−R: Kees Cook <keescook@chromium.org>
8214+R: Kees Cook <kees@kernel.org>
82158215 L: linux-mm@kvack.org
82168216 S: Supported
82178217 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
@@ -8612,7 +8612,7 @@ S: Maintained · 394 unmodified lines
86128612 F: drivers/net/ethernet/nvidia/*
86138613
86148614 FORTIFY_SOURCE
8615−M: Kees Cook <keescook@chromium.org>
8615+M: Kees Cook <kees@kernel.org>
86168616 L: linux-hardening@vger.kernel.org
86178617 S: Supported
86188618 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@ -9102,7 +9102,7 @@ F: include/linux/mfd/gsc.h · 483 unmodified lines
91029102 F: include/linux/platform_data/gsc_hwmon.h
91039103
91049104 GCC PLUGINS
9105−M: Kees Cook <keescook@chromium.org>
9105+M: Kees Cook <kees@kernel.org>
91069106 L: linux-hardening@vger.kernel.org
91079107 S: Maintained
91089108 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@ -9236,7 +9236,7 @@ S: Maintained · 127 unmodified lines
92369236 F: drivers/input/touchscreen/resistive-adc-touch.c
92379237
92389238 GENERIC STRING LIBRARY
9239−M: Kees Cook <keescook@chromium.org>
9239+M: Kees Cook <kees@kernel.org>
92409240 R: Andy Shevchenko <andy@kernel.org>
92419241 L: linux-hardening@vger.kernel.org
92429242 S: Supported
@@ -11950,7 +11950,7 @@ F: scripts/package/ · 2707 unmodified lines
1195011950 F: usr/
1195111951
1195211952 KERNEL HARDENING (not covered by other areas)
11953−M: Kees Cook <keescook@chromium.org>
11953+M: Kees Cook <kees@kernel.org>
1195411954 R: Gustavo A. R. Silva <gustavoars@kernel.org>
1195511955 L: linux-hardening@vger.kernel.org
1195611956 S: Supported
@@ -12382,7 +12382,6 @@ F: drivers/video/backlight/ktz8866.c · 425 unmodified lines
1238212382
1238312383 KVM PARAVIRT (KVM/paravirt)
1238412384 M: Paolo Bonzini <pbonzini@redhat.com>
12385−R: Wanpeng Li <wanpengli@tencent.com>
1238612385 R: Vitaly Kuznetsov <vkuznets@redhat.com>
1238712386 L: kvm@vger.kernel.org
1238812387 S: Supported
@@ -12478,7 +12477,7 @@ F: drivers/scsi/53c700* · 89 unmodified lines
1247812477
1247912478 LEAKING_ADDRESSES
1248012479 M: Tycho Andersen <tycho@tycho.pizza>
12481−R: Kees Cook <keescook@chromium.org>
12480+R: Kees Cook <kees@kernel.org>
1248212481 L: linux-hardening@vger.kernel.org
1248312482 S: Maintained
1248412483 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@ -12774,7 +12773,7 @@ F: arch/powerpc/platforms/8xx/ · 289 unmodified lines
1277412773 F: arch/powerpc/platforms/83xx/
1277512774
1277612775 LINUX KERNEL DUMP TEST MODULE (LKDTM)
12777−M: Kees Cook <keescook@chromium.org>
12776+M: Kees Cook <kees@kernel.org>
1277812777 S: Maintained
1277912778 F: drivers/misc/lkdtm/*
1278012779 F: tools/testing/selftests/lkdtm/*
@@ -12904,7 +12903,7 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/ · 123 unmodified lines
1290412903 F: drivers/media/usb/dvb-usb-v2/lmedm04*
1290512904
1290612905 LOADPIN SECURITY MODULE
12907−M: Kees Cook <keescook@chromium.org>
12906+M: Kees Cook <kees@kernel.org>
1290812907 S: Supported
1290912908 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
1291012909 F: Documentation/admin-guide/LSM/LoadPin.rst
@@ -17996,7 +17995,7 @@ F: tools/testing/selftests/proc/ · 5085 unmodified lines
1799617995
1799717996 PROC SYSCTL
1799817997 M: Luis Chamberlain <mcgrof@kernel.org>
17999−M: Kees Cook <keescook@chromium.org>
17998+M: Kees Cook <kees@kernel.org>
1800017999 M: Joel Granados <j.granados@samsung.com>
1800118000 L: linux-kernel@vger.kernel.org
1800218001 L: linux-fsdevel@vger.kernel.org
@@ -18052,7 +18051,7 @@ F: Documentation/devicetree/bindings/net/pse-pd/ · 49 unmodified lines
1805218051 F: drivers/net/pse-pd/
1805318052
1805418053 PSTORE FILESYSTEM
18055−M: Kees Cook <keescook@chromium.org>
18054+M: Kees Cook <kees@kernel.org>
1805618055 R: Tony Luck <tony.luck@intel.com>
1805718056 R: Guilherme G. Piccoli <gpiccoli@igalia.com>
1805818057 L: linux-hardening@vger.kernel.org
@@ -20058,7 +20057,7 @@ F: drivers/media/cec/platform/seco/seco-cec.c · 1999 unmodified lines
2005820057 F: drivers/media/cec/platform/seco/seco-cec.h
2005920058
2006020059 SECURE COMPUTING
20061−M: Kees Cook <keescook@chromium.org>
20060+M: Kees Cook <kees@kernel.org>
2006220061 R: Andy Lutomirski <luto@amacapital.net>
2006320062 R: Will Drewry <wad@chromium.org>
2006420063 S: Supported
@@ -22972,7 +22971,7 @@ F: drivers/block/ublk_drv.c · 2907 unmodified lines
2297222971 F: include/uapi/linux/ublk_cmd.h
2297322972
2297422973 UBSAN
22975−M: Kees Cook <keescook@chromium.org>
22974+M: Kees Cook <kees@kernel.org>
2297622975 R: Marco Elver <elver@google.com>
2297722976 R: Andrey Konovalov <andreyknvl@gmail.com>
2297822977 R: Andrey Ryabinin <ryabinin.a.a@gmail.com>
@@ -23974,7 +23973,6 @@ VMALLOC · 995 unmodified lines
2397423973 M: Andrew Morton <akpm@linux-foundation.org>
2397523974 R: Uladzislau Rezki <urezki@gmail.com>
2397623975 R: Christoph Hellwig <hch@infradead.org>
23977−R: Lorenzo Stoakes <lstoakes@gmail.com>
2397823976 L: linux-mm@kvack.org
2397923977 S: Maintained
2398023978 W: http://www.linux-mm.org
@@ -24810,7 +24808,7 @@ F: drivers/net/hamradio/yam* · 829 unmodified lines
2481024808 F: include/linux/yam.h
2481124809
2481224810 YAMA SECURITY MODULE
24813−M: Kees Cook <keescook@chromium.org>
24811+M: Kees Cook <kees@kernel.org>
2481424812 S: Supported
2481524813 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
2481624814 F: Documentation/admin-guide/LSM/Yama.rst
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 10
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc4
5+EXTRAVERSION = -rc5
66 NAME = Baby Opossum Posse
77
88 # *DOCUMENTATION*
arch/arm/boot/dts/nxp/imx/imx53-qsb-common.dtsi+1−1
@@ -85,7 +85,7 @@ · 84 unmodified lines
8585 };
8686 };
8787
88− panel {
88+ panel_dpi: panel {
8989 compatible = "sii,43wvf1g";
9090 pinctrl-names = "default";
9191 pinctrl-0 = <&pinctrl_display_power>;
arch/arm/boot/dts/nxp/imx/imx53-qsb-hdmi.dtso+4−2
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010 /plugin/;
1111
1212 &{/} {
13− /delete-node/ panel;
14−
1513 hdmi: connector-hdmi {
1614 compatible = "hdmi-connector";
1715 label = "hdmi";
@@ -82,6 +80,10 @@ · 64 unmodified lines
8280 };
8381 };
8482
83+&panel_dpi {
84+ status = "disabled";
85+};
86+
8587 &tve {
8688 status = "disabled";
8789 };
arch/arm/include/asm/efi.h+13−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <asm/mach/map.h>
1515 #include <asm/mmu_context.h>
1616 #include <asm/ptrace.h>
17+#include <asm/uaccess.h>
1718
1819 #ifdef CONFIG_EFI
1920 void efi_init(void);
@@ -25,6 +26,18 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md, boo · 5 unmodified lines
2526 #define arch_efi_call_virt_setup() efi_virtmap_load()
2627 #define arch_efi_call_virt_teardown() efi_virtmap_unload()
2728
29+#ifdef CONFIG_CPU_TTBR0_PAN
30+#undef arch_efi_call_virt
31+#define arch_efi_call_virt(p, f, args...) ({ \
32+ unsigned int flags = uaccess_save_and_enable(); \
33+ efi_status_t res = _Generic((p)->f(args), \
34+ efi_status_t: (p)->f(args), \
35+ default: ((p)->f(args), EFI_ABORTED)); \
36+ uaccess_restore(flags); \
37+ res; \
38+})
39+#endif
40+
2841 #define ARCH_EFI_IRQ_FLAGS_MASK \
2942 (PSR_J_BIT | PSR_E_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT | \
3043 PSR_T_BIT | MODE_MASK)
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi+2−1
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <dt-bindings/phy/phy-imx8-pcie.h>
77 #include <dt-bindings/pwm/pwm.h>
88 #include "imx8mm.dtsi"
9+#include "imx8mm-overdrive.dtsi"
910
1011 / {
1112 chosen {
@@ -935,7 +936,7 @@ · 923 unmodified lines
935936 /* Verdin GPIO_9_DSI (pulled-up as active-low) */
936937 pinctrl_gpio_9_dsi: gpio9dsigrp {
937938 fsl,pins =
938− <MX8MM_IOMUXC_NAND_RE_B_GPIO3_IO15 0x146>; /* SODIMM 17 */
939+ <MX8MM_IOMUXC_NAND_RE_B_GPIO3_IO15 0x1c6>; /* SODIMM 17 */
939940 };
940941
941942 /* Verdin GPIO_10_DSI (pulled-up as active-low) */
arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi+1−1
@@ -254,7 +254,7 @@ · 253 unmodified lines
254254 <&clk IMX8MP_CLK_CLKOUT2>,
255255 <&clk IMX8MP_AUDIO_PLL2_OUT>;
256256 assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL2_OUT>;
257− assigned-clock-rates = <13000000>, <13000000>, <156000000>;
257+ assigned-clock-rates = <13000000>, <13000000>, <208000000>;
258258 reset-gpios = <&gpio4 1 GPIO_ACTIVE_HIGH>;
259259 status = "disabled";
260260
arch/arm64/boot/dts/freescale/imx8mp-venice-gw73xx.dtsi+1−1
@@ -219,7 +219,7 @@ · 218 unmodified lines
219219
220220 bluetooth {
221221 compatible = "brcm,bcm4330-bt";
222− shutdown-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
222+ shutdown-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
223223 };
224224 };
225225
arch/arm64/boot/dts/freescale/imx8qm-mek.dts+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 regulator-name = "SD1_SPWR";
3737 regulator-min-microvolt = <3000000>;
3838 regulator-max-microvolt = <3000000>;
39− gpio = <&lsio_gpio4 19 GPIO_ACTIVE_HIGH>;
39+ gpio = <&lsio_gpio4 7 GPIO_ACTIVE_HIGH>;
4040 enable-active-high;
4141 };
4242
arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts+0−1
@@ -296,7 +296,6 @@ · 295 unmodified lines
296296 vmmc-supply = <&reg_usdhc2_vmmc>;
297297 bus-width = <4>;
298298 status = "okay";
299− no-sdio;
300299 no-mmc;
301300 };
302301
arch/arm64/kernel/efi.c+2−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #include <linux/efi.h>
1111 #include <linux/init.h>
12+#include <linux/kmemleak.h>
1213 #include <linux/screen_info.h>
1314 #include <linux/vmalloc.h>
1415
@@ -213,6 +214,7 @@ l: if (!p) { · 198 unmodified lines
213214 return -ENOMEM;
214215 }
215216
217+ kmemleak_not_leak(p);
216218 efi_rt_stack_top = p + THREAD_SIZE;
217219 return 0;
218220 }
arch/arm64/kvm/hyp/nvhe/ffa.c+12−0
@@ -177,6 +177,14 @@ static void ffa_retrieve_req(struct arm_smccc_res *res, u32 len) · 176 unmodified lines
177177 res);
178178 }
179179
180+static void ffa_rx_release(struct arm_smccc_res *res)
181+{
182+ arm_smccc_1_1_smc(FFA_RX_RELEASE,
183+ 0, 0,
184+ 0, 0, 0, 0, 0,
185+ res);
186+}
187+
180188 static void do_ffa_rxtx_map(struct arm_smccc_res *res,
181189 struct kvm_cpu_context *ctxt)
182190 {
@@ -543,16 +551,19 @@ static void do_ffa_mem_reclaim(struct arm_smccc_res *res, · 360 unmodified lines
543551 if (WARN_ON(offset > len ||
544552 fraglen > KVM_FFA_MBOX_NR_PAGES * PAGE_SIZE)) {
545553 ret = FFA_RET_ABORTED;
554+ ffa_rx_release(res);
546555 goto out_unlock;
547556 }
548557
549558 if (len > ffa_desc_buf.len) {
550559 ret = FFA_RET_NO_MEMORY;
560+ ffa_rx_release(res);
551561 goto out_unlock;
552562 }
553563
554564 buf = ffa_desc_buf.buf;
555565 memcpy(buf, hyp_buffers.rx, fraglen);
566+ ffa_rx_release(res);
556567
557568 for (fragoff = fraglen; fragoff < len; fragoff += fraglen) {
558569 ffa_mem_frag_rx(res, handle_lo, handle_hi, fragoff);
@@ -563,6 +574,7 @@ static void do_ffa_mem_reclaim(struct arm_smccc_res *res, · 4 unmodified lines
563574
564575 fraglen = res->a3;
565576 memcpy((void *)buf + fragoff, hyp_buffers.rx, fraglen);
577+ ffa_rx_release(res);
566578 }
567579
568580 ffa_mem_reclaim(res, handle_lo, handle_hi, flags);
arch/arm64/kvm/vgic/vgic-init.c+1−1
@@ -391,7 +391,7 @@ static void kvm_vgic_dist_destroy(struct kvm *kvm) · 390 unmodified lines
391391
392392 if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
393393 list_for_each_entry_safe(rdreg, next, &dist->rd_regions, list)
394− vgic_v3_free_redist_region(rdreg);
394+ vgic_v3_free_redist_region(kvm, rdreg);
395395 INIT_LIST_HEAD(&dist->rd_regions);
396396 } else {
397397 dist->vgic_cpu_base = VGIC_ADDR_UNDEF;
arch/arm64/kvm/vgic/vgic-mmio-v3.c+13−2
@@ -919,8 +919,19 @@ free: · 918 unmodified lines
919919 return ret;
920920 }
921921
922−void vgic_v3_free_redist_region(struct vgic_redist_region *rdreg)
922+void vgic_v3_free_redist_region(struct kvm *kvm, struct vgic_redist_region *rdreg)
923923 {
924+ struct kvm_vcpu *vcpu;
925+ unsigned long c;
926+
927+ lockdep_assert_held(&kvm->arch.config_lock);
928+
929+ /* Garbage collect the region */
930+ kvm_for_each_vcpu(c, vcpu, kvm) {
931+ if (vcpu->arch.vgic_cpu.rdreg == rdreg)
932+ vcpu->arch.vgic_cpu.rdreg = NULL;
933+ }
934+
924935 list_del(&rdreg->list);
925936 kfree(rdreg);
926937 }
@@ -945,7 +956,7 @@ int vgic_v3_set_redist_base(struct kvm *kvm, u32 index, u64 addr, u32 count) · 18 unmodified lines
945956
946957 mutex_lock(&kvm->arch.config_lock);
947958 rdreg = vgic_v3_rdist_region_from_index(kvm, index);
948− vgic_v3_free_redist_region(rdreg);
959+ vgic_v3_free_redist_region(kvm, rdreg);
949960 mutex_unlock(&kvm->arch.config_lock);
950961 return ret;
951962 }
arch/arm64/kvm/vgic/vgic.h+1−1
@@ -316,7 +316,7 @@ vgic_v3_rd_region_size(struct kvm *kvm, struct vgic_redist_region *rdreg) · 315 unmodified lines
316316
317317 struct vgic_redist_region *vgic_v3_rdist_region_from_index(struct kvm *kvm,
318318 u32 index);
319−void vgic_v3_free_redist_region(struct vgic_redist_region *rdreg);
319+void vgic_v3_free_redist_region(struct kvm *kvm, struct vgic_redist_region *rdreg);
320320
321321 bool vgic_v3_rdist_overlap(struct kvm *kvm, gpa_t base, size_t size);
322322
arch/loongarch/Kconfig+4−1
@@ -143,7 +143,7 @@ config LOONGARCH · 142 unmodified lines
143143 select HAVE_LIVEPATCH
144144 select HAVE_MOD_ARCH_SPECIFIC
145145 select HAVE_NMI
146− select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS
146+ select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && AS_HAS_THIN_ADD_SUB && !CC_IS_CLANG
147147 select HAVE_PCI
148148 select HAVE_PERF_EVENTS
149149 select HAVE_PERF_REGS
@@ -261,6 +261,9 @@ config AS_HAS_EXPLICIT_RELOCS · 111 unmodified lines
261261 config AS_HAS_FCSR_CLASS
262262 def_bool $(as-instr,movfcsr2gr \$t0$(comma)\$fcsr0)
263263
264+config AS_HAS_THIN_ADD_SUB
265+ def_bool $(cc-option,-Wa$(comma)-mthin-add-sub)
266+
264267 config AS_HAS_LSX_EXTENSION
265268 def_bool $(as-instr,vld \$vr0$(comma)\$a0$(comma)0)
266269
arch/loongarch/Kconfig.debug+1−0
@@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE · 27 unmodified lines
2828
2929 config UNWINDER_ORC
3030 bool "ORC unwinder"
31+ depends on HAVE_OBJTOOL
3132 select OBJTOOL
3233 help
3334 This option enables the ORC (Oops Rewind Capability) unwinder for
arch/loongarch/include/asm/hw_breakpoint.h+3−1
@@ -75,6 +75,8 @@ do { \ · 74 unmodified lines
7575 #define CSR_MWPC_NUM 0x3f
7676
7777 #define CTRL_PLV_ENABLE 0x1e
78+#define CTRL_PLV0_ENABLE 0x02
79+#define CTRL_PLV3_ENABLE 0x10
7880
7981 #define MWPnCFG3_LoadEn 8
8082 #define MWPnCFG3_StoreEn 9
@@ -101,7 +103,7 @@ struct perf_event; · 20 unmodified lines
101103 struct perf_event_attr;
102104
103105 extern int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
104− int *gen_len, int *gen_type, int *offset);
106+ int *gen_len, int *gen_type);
105107 extern int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw);
106108 extern int hw_breakpoint_arch_parse(struct perf_event *bp,
107109 const struct perf_event_attr *attr,
arch/loongarch/kernel/hw_breakpoint.c+55−41
@@ -174,11 +174,21 @@ void flush_ptrace_hw_breakpoint(struct task_struct *tsk) · 173 unmodified lines
174174 static int hw_breakpoint_control(struct perf_event *bp,
175175 enum hw_breakpoint_ops ops)
176176 {
177− u32 ctrl;
177+ u32 ctrl, privilege;
178178 int i, max_slots, enable;
179+ struct pt_regs *regs;
179180 struct perf_event **slots;
180181 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
181182
183+ if (arch_check_bp_in_kernelspace(info))
184+ privilege = CTRL_PLV0_ENABLE;
185+ else
186+ privilege = CTRL_PLV3_ENABLE;
187+
188+ /* Whether bp belongs to a task. */
189+ if (bp->hw.target)
190+ regs = task_pt_regs(bp->hw.target);
191+
182192 if (info->ctrl.type == LOONGARCH_BREAKPOINT_EXECUTE) {
183193 /* Breakpoint */
184194 slots = this_cpu_ptr(bp_on_reg);
@@ -197,31 +207,38 @@ static int hw_breakpoint_control(struct perf_event *bp, · 12 unmodified lines
197207 switch (ops) {
198208 case HW_BREAKPOINT_INSTALL:
199209 /* Set the FWPnCFG/MWPnCFG 1~4 register. */
200− write_wb_reg(CSR_CFG_ADDR, i, 0, info->address);
201− write_wb_reg(CSR_CFG_ADDR, i, 1, info->address);
202− write_wb_reg(CSR_CFG_MASK, i, 0, info->mask);
203− write_wb_reg(CSR_CFG_MASK, i, 1, info->mask);
204− write_wb_reg(CSR_CFG_ASID, i, 0, 0);
205− write_wb_reg(CSR_CFG_ASID, i, 1, 0);
206210 if (info->ctrl.type == LOONGARCH_BREAKPOINT_EXECUTE) {
207− write_wb_reg(CSR_CFG_CTRL, i, 0, CTRL_PLV_ENABLE);
211+ write_wb_reg(CSR_CFG_ADDR, i, 0, info->address);
212+ write_wb_reg(CSR_CFG_MASK, i, 0, info->mask);
213+ write_wb_reg(CSR_CFG_ASID, i, 0, 0);
214+ write_wb_reg(CSR_CFG_CTRL, i, 0, privilege);
208215 } else {
216+ write_wb_reg(CSR_CFG_ADDR, i, 1, info->address);
217+ write_wb_reg(CSR_CFG_MASK, i, 1, info->mask);
218+ write_wb_reg(CSR_CFG_ASID, i, 1, 0);
209219 ctrl = encode_ctrl_reg(info->ctrl);
210− write_wb_reg(CSR_CFG_CTRL, i, 1, ctrl | CTRL_PLV_ENABLE);
220+ write_wb_reg(CSR_CFG_CTRL, i, 1, ctrl | privilege);
211221 }
212222 enable = csr_read64(LOONGARCH_CSR_CRMD);
213223 csr_write64(CSR_CRMD_WE | enable, LOONGARCH_CSR_CRMD);
224+ if (bp->hw.target)
225+ regs->csr_prmd |= CSR_PRMD_PWE;
214226 break;
215227 case HW_BREAKPOINT_UNINSTALL:
216228 /* Reset the FWPnCFG/MWPnCFG 1~4 register. */
217− write_wb_reg(CSR_CFG_ADDR, i, 0, 0);
218− write_wb_reg(CSR_CFG_ADDR, i, 1, 0);
219− write_wb_reg(CSR_CFG_MASK, i, 0, 0);
220− write_wb_reg(CSR_CFG_MASK, i, 1, 0);
221− write_wb_reg(CSR_CFG_CTRL, i, 0, 0);
222− write_wb_reg(CSR_CFG_CTRL, i, 1, 0);
223− write_wb_reg(CSR_CFG_ASID, i, 0, 0);
224− write_wb_reg(CSR_CFG_ASID, i, 1, 0);
229+ if (info->ctrl.type == LOONGARCH_BREAKPOINT_EXECUTE) {
230+ write_wb_reg(CSR_CFG_ADDR, i, 0, 0);
231+ write_wb_reg(CSR_CFG_MASK, i, 0, 0);
232+ write_wb_reg(CSR_CFG_CTRL, i, 0, 0);
233+ write_wb_reg(CSR_CFG_ASID, i, 0, 0);
234+ } else {
235+ write_wb_reg(CSR_CFG_ADDR, i, 1, 0);
236+ write_wb_reg(CSR_CFG_MASK, i, 1, 0);
237+ write_wb_reg(CSR_CFG_CTRL, i, 1, 0);
238+ write_wb_reg(CSR_CFG_ASID, i, 1, 0);
239+ }
240+ if (bp->hw.target)
241+ regs->csr_prmd &= ~CSR_PRMD_PWE;
225242 break;
226243 }
227244
@@ -283,7 +300,7 @@ int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw) · 55 unmodified lines
283300 * to generic breakpoint descriptions.
284301 */
285302 int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
286− int *gen_len, int *gen_type, int *offset)
303+ int *gen_len, int *gen_type)
287304 {
288305 /* Type */
289306 switch (ctrl.type) {
@@ -303,11 +320,6 @@ int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl, · 13 unmodified lines
303320 return -EINVAL;
304321 }
305322
306− if (!ctrl.len)
307− return -EINVAL;
308−
309− *offset = __ffs(ctrl.len);
310−
311323 /* Len */
312324 switch (ctrl.len) {
313325 case LOONGARCH_BREAKPOINT_LEN_1:
@@ -386,21 +398,17 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, · 72 unmodified lines
386398 struct arch_hw_breakpoint *hw)
387399 {
388400 int ret;
389− u64 alignment_mask, offset;
401+ u64 alignment_mask;
390402
391403 /* Build the arch_hw_breakpoint. */
392404 ret = arch_build_bp_info(bp, attr, hw);
393405 if (ret)
394406 return ret;
395407
396− if (hw->ctrl.type != LOONGARCH_BREAKPOINT_EXECUTE)
397− alignment_mask = 0x7;
398− else
408+ if (hw->ctrl.type == LOONGARCH_BREAKPOINT_EXECUTE) {
399409 alignment_mask = 0x3;
400− offset = hw->address & alignment_mask;
401−
402− hw->address &= ~alignment_mask;
403− hw->ctrl.len <<= offset;
410+ hw->address &= ~alignment_mask;
411+ }
404412
405413 return 0;
406414 }
@@ -471,12 +479,15 @@ void breakpoint_handler(struct pt_regs *regs) · 64 unmodified lines
471479 slots = this_cpu_ptr(bp_on_reg);
472480
473481 for (i = 0; i < boot_cpu_data.watch_ireg_count; ++i) {
474− bp = slots[i];
475− if (bp == NULL)
476− continue;
477− perf_bp_event(bp, regs);
482+ if ((csr_read32(LOONGARCH_CSR_FWPS) & (0x1 << i))) {
483+ bp = slots[i];
484+ if (bp == NULL)
485+ continue;
486+ perf_bp_event(bp, regs);
487+ csr_write32(0x1 << i, LOONGARCH_CSR_FWPS);
488+ update_bp_registers(regs, 0, 0);
489+ }
478490 }
479− update_bp_registers(regs, 0, 0);
480491 }
481492 NOKPROBE_SYMBOL(breakpoint_handler);
482493
@@ -488,12 +499,15 @@ void watchpoint_handler(struct pt_regs *regs) · 5 unmodified lines
488499 slots = this_cpu_ptr(wp_on_reg);
489500
490501 for (i = 0; i < boot_cpu_data.watch_dreg_count; ++i) {
491− wp = slots[i];
492− if (wp == NULL)
493− continue;
494− perf_bp_event(wp, regs);
502+ if ((csr_read32(LOONGARCH_CSR_MWPS) & (0x1 << i))) {
503+ wp = slots[i];
504+ if (wp == NULL)
505+ continue;
506+ perf_bp_event(wp, regs);
507+ csr_write32(0x1 << i, LOONGARCH_CSR_MWPS);
508+ update_bp_registers(regs, 0, 1);
509+ }
495510 }
496− update_bp_registers(regs, 0, 1);
497511 }
498512 NOKPROBE_SYMBOL(watchpoint_handler);
499513
arch/loongarch/kernel/ptrace.c+27−20
@@ -494,28 +494,14 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type, · 493 unmodified lines
494494 struct arch_hw_breakpoint_ctrl ctrl,
495495 struct perf_event_attr *attr)
496496 {
497− int err, len, type, offset;
497+ int err, len, type;
498498
499− err = arch_bp_generic_fields(ctrl, &len, &type, &offset);
499+ err = arch_bp_generic_fields(ctrl, &len, &type);
500500 if (err)
501501 return err;
502502
503− switch (note_type) {
504− case NT_LOONGARCH_HW_BREAK:
505− if ((type & HW_BREAKPOINT_X) != type)
506− return -EINVAL;
507− break;
508− case NT_LOONGARCH_HW_WATCH:
509− if ((type & HW_BREAKPOINT_RW) != type)
510− return -EINVAL;
511− break;
512− default:
513− return -EINVAL;
514− }
515−
516503 attr->bp_len = len;
517504 attr->bp_type = type;
518− attr->bp_addr += offset;
519505
520506 return 0;
521507 }
@@ -609,10 +595,27 @@ static int ptrace_hbp_set_ctrl(unsigned int note_type, · 87 unmodified lines
609595 return PTR_ERR(bp);
610596
611597 attr = bp->attr;
612− decode_ctrl_reg(uctrl, &ctrl);
613− err = ptrace_hbp_fill_attr_ctrl(note_type, ctrl, &attr);
614− if (err)
615− return err;
598+
599+ switch (note_type) {
600+ case NT_LOONGARCH_HW_BREAK:
601+ ctrl.type = LOONGARCH_BREAKPOINT_EXECUTE;
602+ ctrl.len = LOONGARCH_BREAKPOINT_LEN_4;
603+ break;
604+ case NT_LOONGARCH_HW_WATCH:
605+ decode_ctrl_reg(uctrl, &ctrl);
606+ break;
607+ default:
608+ return -EINVAL;
609+ }
610+
611+ if (uctrl & CTRL_PLV_ENABLE) {
612+ err = ptrace_hbp_fill_attr_ctrl(note_type, ctrl, &attr);
613+ if (err)
614+ return err;
615+ attr.disabled = 0;
616+ } else {
617+ attr.disabled = 1;
618+ }
616619
617620 return modify_user_hw_breakpoint(bp, &attr);
618621 }
@@ -643,6 +646,10 @@ static int ptrace_hbp_set_addr(unsigned int note_type, · 24 unmodified lines
643646 struct perf_event *bp;
644647 struct perf_event_attr attr;
645648
649+ /* Kernel-space address cannot be monitored by user-space */
650+ if ((unsigned long)addr >= XKPRANGE)
651+ return -EINVAL;
652+
646653 bp = ptrace_hbp_get_initialised_bp(note_type, tsk, idx);
647654 if (IS_ERR(bp))
648655 return PTR_ERR(bp);
arch/loongarch/kvm/exit.c+1−1
@@ -761,7 +761,7 @@ static void kvm_handle_service(struct kvm_vcpu *vcpu) · 760 unmodified lines
761761 default:
762762 ret = KVM_HCALL_INVALID_CODE;
763763 break;
764− };
764+ }
765765
766766 kvm_write_reg(vcpu, LOONGARCH_GPR_A0, ret);
767767 }
arch/mips/bmips/setup.c+2−1
@@ -110,7 +110,8 @@ static void bcm6358_quirks(void) · 109 unmodified lines
110110 * RAC flush causes kernel panics on BCM6358 when booting from TP1
111111 * because the bootloader is not initializing it properly.
112112 */
113− bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31));
113+ bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)) ||
114+ !!BMIPS_GET_CBR();
114115 }
115116
116117 static void bcm6368_quirks(void)
arch/mips/include/asm/mipsmtregs.h+1−1
@@ -322,7 +322,7 @@ static inline void ehb(void) · 321 unmodified lines
322322 " .set push \n" \
323323 " .set "MIPS_ISA_LEVEL" \n" \
324324 _ASM_SET_MFTC0 \
325− " mftc0 $1, " #rt ", " #sel " \n" \
325+ " mftc0 %0, " #rt ", " #sel " \n" \
326326 _ASM_UNSET_MFTC0 \
327327 " .set pop \n" \
328328 : "=r" (__res)); \
arch/mips/kernel/syscalls/syscall_o32.tbl+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 17 o32 break sys_ni_syscall
2828 # 18 was sys_stat
2929 18 o32 unused18 sys_ni_syscall
30−19 o32 lseek sys_lseek
30+19 o32 lseek sys_lseek compat_sys_lseek
3131 20 o32 getpid sys_getpid
3232 21 o32 mount sys_mount
3333 22 o32 umount sys_oldumount
arch/mips/pci/ops-rc32434.c+2−2
@@ -112,8 +112,8 @@ retry: · 111 unmodified lines
112112 * gives them time to settle
113113 */
114114 if (where == PCI_VENDOR_ID) {
115− if (ret == 0xffffffff || ret == 0x00000000 ||
116− ret == 0x0000ffff || ret == 0xffff0000) {
115+ if (*val == 0xffffffff || *val == 0x00000000 ||
116+ *val == 0x0000ffff || *val == 0xffff0000) {
117117 if (delay > 4)
118118 return 0;
119119 delay *= 2;
arch/powerpc/crypto/.gitignore+2−0
@@ -1,3 +1,5 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 aesp10-ppc.S
3+aesp8-ppc.S
34 ghashp10-ppc.S
5+ghashp8-ppc.S
arch/powerpc/kvm/book3s_64_vio.c+13−5
@@ -130,14 +130,16 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, · 129 unmodified lines
130130 }
131131 rcu_read_unlock();
132132
133− fdput(f);
134−
135− if (!found)
133+ if (!found) {
134+ fdput(f);
136135 return -EINVAL;
136+ }
137137
138138 table_group = iommu_group_get_iommudata(grp);
139− if (WARN_ON(!table_group))
139+ if (WARN_ON(!table_group)) {
140+ fdput(f);
140141 return -EFAULT;
142+ }
141143
142144 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) {
143145 struct iommu_table *tbltmp = table_group->tables[i];
@@ -158,8 +160,10 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, · 14 unmodified lines
158160 break;
159161 }
160162 }
161− if (!tbl)
163+ if (!tbl) {
164+ fdput(f);
162165 return -EINVAL;
166+ }
163167
164168 rcu_read_lock();
165169 list_for_each_entry_rcu(stit, &stt->iommu_tables, next) {
@@ -170,6 +174,7 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, · 4 unmodified lines
170174 /* stit is being destroyed */
171175 iommu_tce_table_put(tbl);
172176 rcu_read_unlock();
177+ fdput(f);
173178 return -ENOTTY;
174179 }
175180 /*
@@ -177,6 +182,7 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, · 1 unmodified line
177182 * its KVM reference counter and can return.
178183 */
179184 rcu_read_unlock();
185+ fdput(f);
180186 return 0;
181187 }
182188 rcu_read_unlock();
@@ -184,6 +190,7 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, · 1 unmodified line
184190 stit = kzalloc(sizeof(*stit), GFP_KERNEL);
185191 if (!stit) {
186192 iommu_tce_table_put(tbl);
193+ fdput(f);
187194 return -ENOMEM;
188195 }
189196
@@ -192,6 +199,7 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, · 2 unmodified lines
192199
193200 list_add_rcu(&stit->next, &stt->iommu_tables);
194201
202+ fdput(f);
195203 return 0;
196204 }
197205
arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts+1−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 no-1-8-v;
4646 no-mmc;
4747 no-sdio;
48+ disable-wp;
4849 };
4950
5051 &uart0 {
arch/x86/include/asm/efi.h+0−1
@@ -401,7 +401,6 @@ extern int __init efi_memmap_alloc(unsigned int num_entries, · 400 unmodified lines
401401 struct efi_memory_map_data *data);
402402 extern void __efi_memmap_free(u64 phys, unsigned long size,
403403 unsigned long flags);
404−#define __efi_memmap_free __efi_memmap_free
405404
406405 extern int __init efi_memmap_install(struct efi_memory_map_data *data);
407406 extern int __init efi_memmap_split_count(efi_memory_desc_t *md,
arch/x86/kernel/cpu/resctrl/monitor.c+2−1
@@ -519,7 +519,8 @@ void free_rmid(u32 closid, u32 rmid) · 518 unmodified lines
519519 * allows architectures that ignore the closid parameter to avoid an
520520 * unnecessary check.
521521 */
522− if (idx == resctrl_arch_rmid_idx_encode(RESCTRL_RESERVED_CLOSID,
522+ if (!resctrl_arch_mon_capable() ||
523+ idx == resctrl_arch_rmid_idx_encode(RESCTRL_RESERVED_CLOSID,
523524 RESCTRL_RESERVED_RMID))
524525 return;
525526
arch/x86/kvm/svm/svm.c+2−2
@@ -2843,7 +2843,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 2842 unmodified lines
28432843
28442844 if (sev_es_prevent_msr_access(vcpu, msr_info)) {
28452845 msr_info->data = 0;
2846− return -EINVAL;
2846+ return vcpu->kvm->arch.has_protected_state ? -EINVAL : 0;
28472847 }
28482848
28492849 switch (msr_info->index) {
@@ -2998,7 +2998,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 148 unmodified lines
29982998 u64 data = msr->data;
29992999
30003000 if (sev_es_prevent_msr_access(vcpu, msr))
3001− return -EINVAL;
3001+ return vcpu->kvm->arch.has_protected_state ? -EINVAL : 0;
30023002
30033003 switch (ecx) {
30043004 case MSR_AMD64_TSC_RATIO:
arch/x86/kvm/x86.c+4−5
@@ -10718,13 +10718,12 @@ static void vcpu_scan_ioapic(struct kvm_vcpu *vcpu) · 10717 unmodified lines
1071810718
1071910719 bitmap_zero(vcpu->arch.ioapic_handled_vectors, 256);
1072010720
10721+ static_call_cond(kvm_x86_sync_pir_to_irr)(vcpu);
10722+
1072110723 if (irqchip_split(vcpu->kvm))
1072210724 kvm_scan_ioapic_routes(vcpu, vcpu->arch.ioapic_handled_vectors);
10723− else {
10724− static_call_cond(kvm_x86_sync_pir_to_irr)(vcpu);
10725− if (ioapic_in_kernel(vcpu->kvm))
10726− kvm_ioapic_scan_entry(vcpu, vcpu->arch.ioapic_handled_vectors);
10727− }
10725+ else if (ioapic_in_kernel(vcpu->kvm))
10726+ kvm_ioapic_scan_entry(vcpu, vcpu->arch.ioapic_handled_vectors);
1072810727
1072910728 if (is_guest_mode(vcpu))
1073010729 vcpu->arch.load_eoi_exitmap_pending = true;
arch/x86/platform/efi/memmap.c+11−1
@@ -92,12 +92,22 @@ int __init efi_memmap_alloc(unsigned int num_entries, · 91 unmodified lines
9292 */
9393 int __init efi_memmap_install(struct efi_memory_map_data *data)
9494 {
95+ unsigned long size = efi.memmap.desc_size * efi.memmap.nr_map;
96+ unsigned long flags = efi.memmap.flags;
97+ u64 phys = efi.memmap.phys_map;
98+ int ret;
99+
95100 efi_memmap_unmap();
96101
97102 if (efi_enabled(EFI_PARAVIRT))
98103 return 0;
99104
100− return __efi_memmap_init(data);
105+ ret = __efi_memmap_init(data);
106+ if (ret)
107+ return ret;
108+
109+ __efi_memmap_free(phys, size, flags);
110+ return 0;
101111 }
102112
103113 /**
drivers/acpi/acpica/exregion.c+2−21
@@ -44,7 +44,6 @@ acpi_ex_system_memory_space_handler(u32 function, · 43 unmodified lines
4444 struct acpi_mem_mapping *mm = mem_info->cur_mm;
4545 u32 length;
4646 acpi_size map_length;
47− acpi_size page_boundary_map_length;
4847 #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
4948 u32 remainder;
5049 #endif
@@ -138,26 +137,8 @@ acpi_ex_system_memory_space_handler(u32 function, · 87 unmodified lines
138137 map_length = (acpi_size)
139138 ((mem_info->address + mem_info->length) - address);
140139
141− /*
142− * If mapping the entire remaining portion of the region will cross
143− * a page boundary, just map up to the page boundary, do not cross.
144− * On some systems, crossing a page boundary while mapping regions
145− * can cause warnings if the pages have different attributes
146− * due to resource management.
147− *
148− * This has the added benefit of constraining a single mapping to
149− * one page, which is similar to the original code that used a 4k
150− * maximum window.
151− */
152− page_boundary_map_length = (acpi_size)
153− (ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address);
154− if (page_boundary_map_length == 0) {
155− page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
156− }
157−
158− if (map_length > page_boundary_map_length) {
159− map_length = page_boundary_map_length;
160− }
140+ if (map_length > ACPI_DEFAULT_PAGE_SIZE)
141+ map_length = ACPI_DEFAULT_PAGE_SIZE;
161142
162143 /* Create a new mapping starting at the address given */
163144
drivers/acpi/internal.h+4−0
@@ -302,6 +302,10 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle); · 301 unmodified lines
302302 void acpi_mipi_scan_crs_csi2(void);
303303 void acpi_mipi_init_crs_csi2_swnodes(void);
304304 void acpi_mipi_crs_csi2_cleanup(void);
305+#ifdef CONFIG_X86
305306 bool acpi_graph_ignore_port(acpi_handle handle);
307+#else
308+static inline bool acpi_graph_ignore_port(acpi_handle handle) { return false; }
309+#endif
306310
307311 #endif /* _ACPI_INTERNAL_H_ */
drivers/acpi/mipi-disco-img.c+19−9
@@ -725,14 +725,20 @@ void acpi_mipi_crs_csi2_cleanup(void) · 724 unmodified lines
725725 acpi_mipi_del_crs_csi2(csi2);
726726 }
727727
728−static const struct dmi_system_id dmi_ignore_port_nodes[] = {
729− {
730− .matches = {
731− DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
732− DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"),
733− },
734− },
735− { }
728+#ifdef CONFIG_X86
729+#include <asm/cpu_device_id.h>
730+#include <asm/intel-family.h>
731+
732+/* CPU matches for Dell generations with broken ACPI MIPI DISCO info */
733+static const struct x86_cpu_id dell_broken_mipi_disco_cpu_gens[] = {
734+ X86_MATCH_VFM(INTEL_TIGERLAKE, NULL),
735+ X86_MATCH_VFM(INTEL_TIGERLAKE_L, NULL),
736+ X86_MATCH_VFM(INTEL_ALDERLAKE, NULL),
737+ X86_MATCH_VFM(INTEL_ALDERLAKE_L, NULL),
738+ X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL),
739+ X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL),
740+ X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL),
741+ {}
736742 };
737743
738744 static const char *strnext(const char *s1, const char *s2)
@@ -761,7 +767,10 @@ bool acpi_graph_ignore_port(acpi_handle handle) · 22 unmodified lines
761767 static bool dmi_tested, ignore_port;
762768
763769 if (!dmi_tested) {
764− ignore_port = dmi_first_match(dmi_ignore_port_nodes);
770+ if (dmi_name_in_vendors("Dell Inc.") &&
771+ x86_match_cpu(dell_broken_mipi_disco_cpu_gens))
772+ ignore_port = true;
773+
765774 dmi_tested = true;
766775 }
767776
@@ -794,3 +803,4 @@ out_free: · 26 unmodified lines
794803 kfree(orig_path);
795804 return false;
796805 }
806+#endif
drivers/ata/ahci.c+8−0
@@ -1735,6 +1735,14 @@ static void ahci_update_initial_lpm_policy(struct ata_port *ap) · 1734 unmodified lines
17351735 if (ap->pflags & ATA_PFLAG_EXTERNAL)
17361736 return;
17371737
1738+ /* If no LPM states are supported by the HBA, do not bother with LPM */
1739+ if ((ap->host->flags & ATA_HOST_NO_PART) &&
1740+ (ap->host->flags & ATA_HOST_NO_SSC) &&
1741+ (ap->host->flags & ATA_HOST_NO_DEVSLP)) {
1742+ ata_port_dbg(ap, "no LPM states supported, not enabling LPM\n");
1743+ return;
1744+ }
1745+
17381746 /* user modified policy via module param */
17391747 if (mobile_lpm_policy != -1) {
17401748 policy = mobile_lpm_policy;
drivers/dma/Kconfig+1−1
@@ -394,7 +394,7 @@ config LS2X_APB_DMA · 393 unmodified lines
394394
395395 config MCF_EDMA
396396 tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs"
397− depends on M5441x || COMPILE_TEST
397+ depends on M5441x || (COMPILE_TEST && FSL_EDMA=n)
398398 select DMA_ENGINE
399399 select DMA_VIRTUAL_CHANNELS
400400 help
drivers/dma/idxd/irq.c+3−1
@@ -611,11 +611,13 @@ static void irq_process_work_list(struct idxd_irq_entry *irq_entry) · 610 unmodified lines
611611
612612 spin_unlock(&irq_entry->list_lock);
613613
614− list_for_each_entry(desc, &flist, list) {
614+ list_for_each_entry_safe(desc, n, &flist, list) {
615615 /*
616616 * Check against the original status as ABORT is software defined
617617 * and 0xff, which DSA_COMP_STATUS_MASK can mask out.
618618 */
619+ list_del(&desc->list);
620+
619621 if (unlikely(desc->completion->status == IDXD_COMP_DESC_ABORT)) {
620622 idxd_desc_complete(desc, IDXD_COMPLETE_ABORT, true);
621623 continue;
drivers/dma/ioat/init.c+30−25
@@ -534,18 +534,6 @@ err_out: · 533 unmodified lines
534534 return err;
535535 }
536536
537−static int ioat_register(struct ioatdma_device *ioat_dma)
538−{
539− int err = dma_async_device_register(&ioat_dma->dma_dev);
540−
541− if (err) {
542− ioat_disable_interrupts(ioat_dma);
543− dma_pool_destroy(ioat_dma->completion_pool);
544− }
545−
546− return err;
547−}
548−
549537 static void ioat_dma_remove(struct ioatdma_device *ioat_dma)
550538 {
551539 struct dma_device *dma = &ioat_dma->dma_dev;
@@ -1181,9 +1169,9 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca) · 629 unmodified lines
11811169 ioat_chan->reg_base + IOAT_DCACTRL_OFFSET);
11821170 }
11831171
1184− err = ioat_register(ioat_dma);
1172+ err = dma_async_device_register(&ioat_dma->dma_dev);
11851173 if (err)
1186− return err;
1174+ goto err_disable_interrupts;
11871175
11881176 ioat_kobject_add(ioat_dma, &ioat_ktype);
11891177
@@ -1192,20 +1180,29 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca) · 2 unmodified lines
11921180
11931181 /* disable relaxed ordering */
11941182 err = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &val16);
1195− if (err)
1196− return pcibios_err_to_errno(err);
1183+ if (err) {
1184+ err = pcibios_err_to_errno(err);
1185+ goto err_disable_interrupts;
1186+ }
11971187
11981188 /* clear relaxed ordering enable */
11991189 val16 &= ~PCI_EXP_DEVCTL_RELAX_EN;
12001190 err = pcie_capability_write_word(pdev, PCI_EXP_DEVCTL, val16);
1201− if (err)
1202− return pcibios_err_to_errno(err);
1191+ if (err) {
1192+ err = pcibios_err_to_errno(err);
1193+ goto err_disable_interrupts;
1194+ }
12031195
12041196 if (ioat_dma->cap & IOAT_CAP_DPS)
12051197 writeb(ioat_pending_level + 1,
12061198 ioat_dma->reg_base + IOAT_PREFETCH_LIMIT_OFFSET);
12071199
12081200 return 0;
1201+
1202+err_disable_interrupts:
1203+ ioat_disable_interrupts(ioat_dma);
1204+ dma_pool_destroy(ioat_dma->completion_pool);
1205+ return err;
12091206 }
12101207
12111208 static void ioat_shutdown(struct pci_dev *pdev)
@@ -1350,6 +1347,8 @@ static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 138 unmodified lines
13501347 void __iomem * const *iomap;
13511348 struct device *dev = &pdev->dev;
13521349 struct ioatdma_device *device;
1350+ unsigned int i;
1351+ u8 version;
13531352 int err;
13541353
13551354 err = pcim_enable_device(pdev);
@@ -1363,6 +1362,10 @@ static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 7 unmodified lines
13631362 if (!iomap)
13641363 return -ENOMEM;
13651364
1365+ version = readb(iomap[IOAT_MMIO_BAR] + IOAT_VER_OFFSET);
1366+ if (version < IOAT_VER_3_0)
1367+ return -ENODEV;
1368+
13661369 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
13671370 if (err)
13681371 return err;
@@ -1373,17 +1376,18 @@ static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 4 unmodified lines
13731376 pci_set_master(pdev);
13741377 pci_set_drvdata(pdev, device);
13751378
1376− device->version = readb(device->reg_base + IOAT_VER_OFFSET);
1379+ device->version = version;
13771380 if (device->version >= IOAT_VER_3_4)
13781381 ioat_dca_enabled = 0;
1379− if (device->version >= IOAT_VER_3_0) {
1380− if (is_skx_ioat(pdev))
1381− device->version = IOAT_VER_3_2;
1382− err = ioat3_dma_probe(device, ioat_dca_enabled);
1383− } else
1384− return -ENODEV;
13851382
1383+ if (is_skx_ioat(pdev))
1384+ device->version = IOAT_VER_3_2;
1385+
1386+ err = ioat3_dma_probe(device, ioat_dca_enabled);
13861387 if (err) {
1388+ for (i = 0; i < IOAT_MAX_CHANS; i++)
1389+ kfree(device->idx[i]);
1390+ kfree(device);
13871391 dev_err(dev, "Intel(R) I/OAT DMA Engine init failed\n");
13881392 return -ENODEV;
13891393 }
@@ -1445,6 +1449,7 @@ module_init(ioat_init_module); · 55 unmodified lines
14451449 static void __exit ioat_exit_module(void)
14461450 {
14471451 pci_unregister_driver(&ioat_pci_driver);
1452+ kmem_cache_destroy(ioat_sed_cache);
14481453 kmem_cache_destroy(ioat_cache);
14491454 }
14501455 module_exit(ioat_exit_module);
drivers/dma/ti/k3-udma-glue.c+1−4
@@ -200,12 +200,9 @@ of_k3_udma_glue_parse_chn_by_id(struct device_node *udmax_np, struct k3_udma_glu · 199 unmodified lines
200200
201201 ret = of_k3_udma_glue_parse(udmax_np, common);
202202 if (ret)
203− goto out_put_spec;
203+ return ret;
204204
205205 ret = of_k3_udma_glue_parse_chn_common(common, thread_id, tx_chn);
206−
207−out_put_spec:
208− of_node_put(udmax_np);
209206 return ret;
210207 }
211208
drivers/dma/xilinx/xdma.c+2−2
@@ -885,11 +885,11 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id) · 884 unmodified lines
885885 u32 st;
886886 bool repeat_tx;
887887
888+ spin_lock(&xchan->vchan.lock);
889+
888890 if (xchan->stop_requested)
889891 complete(&xchan->last_interrupt);
890892
891− spin_lock(&xchan->vchan.lock);
892−
893893 /* get submitted request */
894894 vd = vchan_next_desc(&xchan->vchan);
895895 if (!vd)
drivers/firmware/efi/memmap.c+0−9
@@ -15,10 +15,6 @@ · 14 unmodified lines
1515 #include <asm/early_ioremap.h>
1616 #include <asm/efi.h>
1717
18−#ifndef __efi_memmap_free
19−#define __efi_memmap_free(phys, size, flags) do { } while (0)
20−#endif
21−
2218 /**
2319 * __efi_memmap_init - Common code for mapping the EFI memory map
2420 * @data: EFI memory map data
@@ -51,11 +47,6 @@ int __init __efi_memmap_init(struct efi_memory_map_data *data) · 26 unmodified lines
5147 return -ENOMEM;
5248 }
5349
54− if (efi.memmap.flags & (EFI_MEMMAP_MEMBLOCK | EFI_MEMMAP_SLAB))
55− __efi_memmap_free(efi.memmap.phys_map,
56− efi.memmap.desc_size * efi.memmap.nr_map,
57− efi.memmap.flags);
58−
5950 map.phys_map = data->phys_map;
6051 map.nr_map = data->size / data->desc_size;
6152 map.map_end = map.map + data->size;
drivers/firmware/psci/psci.c+3−1
@@ -497,10 +497,12 @@ int psci_cpu_suspend_enter(u32 state) · 496 unmodified lines
497497
498498 static int psci_system_suspend(unsigned long unused)
499499 {
500+ int err;
500501 phys_addr_t pa_cpu_resume = __pa_symbol(cpu_resume);
501502
502− return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
503+ err = invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
503504 pa_cpu_resume, 0, 0);
505+ return psci_to_linux_errno(err);
504506 }
505507
506508 static int psci_system_suspend_enter(suspend_state_t state)
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c+0−34
@@ -41,8 +41,6 @@ · 40 unmodified lines
4141 #include <linux/dma-buf.h>
4242 #include <linux/dma-fence-array.h>
4343 #include <linux/pci-p2pdma.h>
44−#include <linux/pm_runtime.h>
45−#include "amdgpu_trace.h"
4644
4745 /**
4846 * amdgpu_dma_buf_attach - &dma_buf_ops.attach implementation
@@ -58,42 +56,11 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf, · 9 unmodified lines
5856 struct drm_gem_object *obj = dmabuf->priv;
5957 struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
6058 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
61− int r;
6259
6360 if (pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
6461 attach->peer2peer = false;
6562
66− r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
67− trace_amdgpu_runpm_reference_dumps(1, __func__);
68− if (r < 0)
69− goto out;
70−
7163 return 0;
72−
73−out:
74− pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
75− trace_amdgpu_runpm_reference_dumps(0, __func__);
76− return r;
77−}
78−
79−/**
80− * amdgpu_dma_buf_detach - &dma_buf_ops.detach implementation
81− *
82− * @dmabuf: DMA-buf where we remove the attachment from
83− * @attach: the attachment to remove
84− *
85− * Called when an attachment is removed from the DMA-buf.
86− */
87−static void amdgpu_dma_buf_detach(struct dma_buf *dmabuf,
88− struct dma_buf_attachment *attach)
89−{
90− struct drm_gem_object *obj = dmabuf->priv;
91− struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
92− struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
93−
94− pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
95− pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
96− trace_amdgpu_runpm_reference_dumps(0, __func__);
9764 }
9865
9966 /**
@@ -267,7 +234,6 @@ static int amdgpu_dma_buf_begin_cpu_access(struct dma_buf *dma_buf, · 167 unmodified lines
267234
268235 const struct dma_buf_ops amdgpu_dmabuf_ops = {
269236 .attach = amdgpu_dma_buf_attach,
270− .detach = amdgpu_dma_buf_detach,
271237 .pin = amdgpu_dma_buf_pin,
272238 .unpin = amdgpu_dma_buf_unpin,
273239 .map_dma_buf = amdgpu_dma_buf_map,
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+0−2
@@ -181,7 +181,6 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct dma_fence **f, struct amd · 180 unmodified lines
181181 amdgpu_ring_emit_fence(ring, ring->fence_drv.gpu_addr,
182182 seq, flags | AMDGPU_FENCE_FLAG_INT);
183183 pm_runtime_get_noresume(adev_to_drm(adev)->dev);
184− trace_amdgpu_runpm_reference_dumps(1, __func__);
185184 ptr = &ring->fence_drv.fences[seq & ring->fence_drv.num_fences_mask];
186185 if (unlikely(rcu_dereference_protected(*ptr, 1))) {
187186 struct dma_fence *old;
@@ -309,7 +308,6 @@ bool amdgpu_fence_process(struct amdgpu_ring *ring) · 121 unmodified lines
309308 dma_fence_put(fence);
310309 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
311310 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
312− trace_amdgpu_runpm_reference_dumps(0, __func__);
313311 } while (last_seq != seq);
314312
315313 return true;
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+34−32
@@ -684,12 +684,17 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid, · 683 unmodified lines
684684 struct amdgpu_ring *ring = &adev->gfx.kiq[inst].ring;
685685 struct amdgpu_kiq *kiq = &adev->gfx.kiq[inst];
686686 unsigned int ndw;
687− signed long r;
687+ int r;
688688 uint32_t seq;
689689
690− if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready ||
691− !down_read_trylock(&adev->reset_domain->sem)) {
690+ /*
691+ * A GPU reset should flush all TLBs anyway, so no need to do
692+ * this while one is ongoing.
693+ */
694+ if (!down_read_trylock(&adev->reset_domain->sem))
695+ return 0;
692696
697+ if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) {
693698 if (adev->gmc.flush_tlb_needs_extra_type_2)
694699 adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
695700 2, all_hub,
@@ -703,43 +708,40 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid, · 7 unmodified lines
703708 adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
704709 flush_type, all_hub,
705710 inst);
706− return 0;
707− }
711+ r = 0;
712+ } else {
713+ /* 2 dwords flush + 8 dwords fence */
714+ ndw = kiq->pmf->invalidate_tlbs_size + 8;
708715
709− /* 2 dwords flush + 8 dwords fence */
710− ndw = kiq->pmf->invalidate_tlbs_size + 8;
716+ if (adev->gmc.flush_tlb_needs_extra_type_2)
717+ ndw += kiq->pmf->invalidate_tlbs_size;
711718
712− if (adev->gmc.flush_tlb_needs_extra_type_2)
713− ndw += kiq->pmf->invalidate_tlbs_size;
719+ if (adev->gmc.flush_tlb_needs_extra_type_0)
720+ ndw += kiq->pmf->invalidate_tlbs_size;
714721
715− if (adev->gmc.flush_tlb_needs_extra_type_0)
716− ndw += kiq->pmf->invalidate_tlbs_size;
722+ spin_lock(&adev->gfx.kiq[inst].ring_lock);
723+ amdgpu_ring_alloc(ring, ndw);
724+ if (adev->gmc.flush_tlb_needs_extra_type_2)
725+ kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 2, all_hub);
717726
718− spin_lock(&adev->gfx.kiq[inst].ring_lock);
719− amdgpu_ring_alloc(ring, ndw);
720− if (adev->gmc.flush_tlb_needs_extra_type_2)
721− kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 2, all_hub);
727+ if (flush_type == 2 && adev->gmc.flush_tlb_needs_extra_type_0)
728+ kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 0, all_hub);
722729
723− if (flush_type == 2 && adev->gmc.flush_tlb_needs_extra_type_0)
724− kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 0, all_hub);
730+ kiq->pmf->kiq_invalidate_tlbs(ring, pasid, flush_type, all_hub);
731+ r = amdgpu_fence_emit_polling(ring, &seq, MAX_KIQ_REG_WAIT);
732+ if (r) {
733+ amdgpu_ring_undo(ring);
734+ spin_unlock(&adev->gfx.kiq[inst].ring_lock);
735+ goto error_unlock_reset;
736+ }
725737
726− kiq->pmf->kiq_invalidate_tlbs(ring, pasid, flush_type, all_hub);
727− r = amdgpu_fence_emit_polling(ring, &seq, MAX_KIQ_REG_WAIT);
728− if (r) {
729− amdgpu_ring_undo(ring);
738+ amdgpu_ring_commit(ring);
730739 spin_unlock(&adev->gfx.kiq[inst].ring_lock);
731− goto error_unlock_reset;
732− }
733−
734− amdgpu_ring_commit(ring);
735− spin_unlock(&adev->gfx.kiq[inst].ring_lock);
736− r = amdgpu_fence_wait_polling(ring, seq, usec_timeout);
737− if (r < 1) {
738− dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r);
739− r = -ETIME;
740− goto error_unlock_reset;
740+ if (amdgpu_fence_wait_polling(ring, seq, usec_timeout) < 1) {
741+ dev_err(adev->dev, "timeout waiting for kiq fence\n");
742+ r = -ETIME;
743+ }
741744 }
742− r = 0;
743745
744746 error_unlock_reset:
745747 up_read(&adev->reset_domain->sem);
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h+0−15
@@ -554,21 +554,6 @@ TRACE_EVENT(amdgpu_reset_reg_dumps, · 553 unmodified lines
554554 __entry->value)
555555 );
556556
557−TRACE_EVENT(amdgpu_runpm_reference_dumps,
558− TP_PROTO(uint32_t index, const char *func),
559− TP_ARGS(index, func),
560− TP_STRUCT__entry(
561− __field(uint32_t, index)
562− __string(func, func)
563− ),
564− TP_fast_assign(
565− __entry->index = index;
566− __assign_str(func);
567− ),
568− TP_printk("amdgpu runpm reference dump 0x%x: 0x%s\n",
569− __entry->index,
570− __get_str(func))
571−);
572557 #undef AMDGPU_JOB_GET_TIMELINE_NAME
573558 #endif
574559
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c+13−2
@@ -4195,9 +4195,10 @@ static u32 gfx_v9_4_3_get_cu_active_bitmap(struct amdgpu_device *adev, int xcc_i · 4194 unmodified lines
41954195 static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev,
41964196 struct amdgpu_cu_info *cu_info)
41974197 {
4198− int i, j, k, counter, xcc_id, active_cu_number = 0;
4199− u32 mask, bitmap, ao_bitmap, ao_cu_mask = 0;
4198+ int i, j, k, prev_counter, counter, xcc_id, active_cu_number = 0;
4199+ u32 mask, bitmap, ao_bitmap, ao_cu_mask = 0, tmp;
42004200 unsigned disable_masks[4 * 4];
4201+ bool is_symmetric_cus;
42014202
42024203 if (!adev || !cu_info)
42034204 return -EINVAL;
@@ -4215,6 +4216,7 @@ static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev, · 11 unmodified lines
42154216
42164217 mutex_lock(&adev->grbm_idx_mutex);
42174218 for (xcc_id = 0; xcc_id < NUM_XCC(adev->gfx.xcc_mask); xcc_id++) {
4219+ is_symmetric_cus = true;
42184220 for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
42194221 for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
42204222 mask = 1;
@@ -4242,6 +4244,15 @@ static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev, · 21 unmodified lines
42424244 ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
42434245 cu_info->ao_cu_bitmap[i][j] = ao_bitmap;
42444246 }
4247+ if (i && is_symmetric_cus && prev_counter != counter)
4248+ is_symmetric_cus = false;
4249+ prev_counter = counter;
4250+ }
4251+ if (is_symmetric_cus) {
4252+ tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_CPC_DEBUG);
4253+ tmp = REG_SET_FIELD(tmp, CP_CPC_DEBUG, CPC_HARVESTING_RELAUNCH_DISABLE, 1);
4254+ tmp = REG_SET_FIELD(tmp, CP_CPC_DEBUG, CPC_HARVESTING_DISPATCH_DISABLE, 1);
4255+ WREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_CPC_DEBUG, tmp);
42454256 }
42464257 gfx_v9_4_3_xcc_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff,
42474258 xcc_id);
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c+48−28
@@ -154,18 +154,18 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, · 153 unmodified lines
154154 void *pkt, int size,
155155 int api_status_off)
156156 {
157− int ndw = size / 4;
158− signed long r;
159− union MESAPI__MISC *x_pkt = pkt;
160− struct MES_API_STATUS *api_status;
157+ union MESAPI__QUERY_MES_STATUS mes_status_pkt;
158+ signed long timeout = 3000000; /* 3000 ms */
161159 struct amdgpu_device *adev = mes->adev;
162160 struct amdgpu_ring *ring = &mes->ring;
163− unsigned long flags;
164− signed long timeout = 3000000; /* 3000 ms */
161+ struct MES_API_STATUS *api_status;
162+ union MESAPI__MISC *x_pkt = pkt;
165163 const char *op_str, *misc_op_str;
166− u32 fence_offset;
167− u64 fence_gpu_addr;
168− u64 *fence_ptr;
164+ unsigned long flags;
165+ u64 status_gpu_addr;
166+ u32 status_offset;
167+ u64 *status_ptr;
168+ signed long r;
169169 int ret;
170170
171171 if (x_pkt->header.opcode >= MES_SCH_API_MAX)
@@ -177,28 +177,38 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, · 5 unmodified lines
177177 /* Worst case in sriov where all other 15 VF timeout, each VF needs about 600ms */
178178 timeout = 15 * 600 * 1000;
179179 }
180− BUG_ON(size % 4 != 0);
181180
182− ret = amdgpu_device_wb_get(adev, &fence_offset);
181+ ret = amdgpu_device_wb_get(adev, &status_offset);
183182 if (ret)
184183 return ret;
185− fence_gpu_addr =
186− adev->wb.gpu_addr + (fence_offset * 4);
187− fence_ptr = (u64 *)&adev->wb.wb[fence_offset];
188− *fence_ptr = 0;
184+
185+ status_gpu_addr = adev->wb.gpu_addr + (status_offset * 4);
186+ status_ptr = (u64 *)&adev->wb.wb[status_offset];
187+ *status_ptr = 0;
189188
190189 spin_lock_irqsave(&mes->ring_lock, flags);
191− if (amdgpu_ring_alloc(ring, ndw)) {
192− spin_unlock_irqrestore(&mes->ring_lock, flags);
193− amdgpu_device_wb_free(adev, fence_offset);
194− return -ENOMEM;
195− }
190+ r = amdgpu_ring_alloc(ring, (size + sizeof(mes_status_pkt)) / 4);
191+ if (r)
192+ goto error_unlock_free;
196193
197194 api_status = (struct MES_API_STATUS *)((char *)pkt + api_status_off);
198− api_status->api_completion_fence_addr = fence_gpu_addr;
195+ api_status->api_completion_fence_addr = status_gpu_addr;
199196 api_status->api_completion_fence_value = 1;
200197
201− amdgpu_ring_write_multiple(ring, pkt, ndw);
198+ amdgpu_ring_write_multiple(ring, pkt, size / 4);
199+
200+ memset(&mes_status_pkt, 0, sizeof(mes_status_pkt));
201+ mes_status_pkt.header.type = MES_API_TYPE_SCHEDULER;
202+ mes_status_pkt.header.opcode = MES_SCH_API_QUERY_SCHEDULER_STATUS;
203+ mes_status_pkt.header.dwsize = API_FRAME_SIZE_IN_DWORDS;
204+ mes_status_pkt.api_status.api_completion_fence_addr =
205+ ring->fence_drv.gpu_addr;
206+ mes_status_pkt.api_status.api_completion_fence_value =
207+ ++ring->fence_drv.sync_seq;
208+
209+ amdgpu_ring_write_multiple(ring, &mes_status_pkt,
210+ sizeof(mes_status_pkt) / 4);
211+
202212 amdgpu_ring_commit(ring);
203213 spin_unlock_irqrestore(&mes->ring_lock, flags);
204214
@@ -206,15 +216,16 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, · 1 unmodified line
206216 misc_op_str = mes_v11_0_get_misc_op_string(x_pkt);
207217
208218 if (misc_op_str)
209− dev_dbg(adev->dev, "MES msg=%s (%s) was emitted\n", op_str, misc_op_str);
219+ dev_dbg(adev->dev, "MES msg=%s (%s) was emitted\n", op_str,
220+ misc_op_str);
210221 else if (op_str)
211222 dev_dbg(adev->dev, "MES msg=%s was emitted\n", op_str);
212223 else
213− dev_dbg(adev->dev, "MES msg=%d was emitted\n", x_pkt->header.opcode);
224+ dev_dbg(adev->dev, "MES msg=%d was emitted\n",
225+ x_pkt->header.opcode);
214226
215− r = amdgpu_mes_fence_wait_polling(fence_ptr, (u64)1, timeout);
216− amdgpu_device_wb_free(adev, fence_offset);
217− if (r < 1) {
227+ r = amdgpu_fence_wait_polling(ring, ring->fence_drv.sync_seq, timeout);
228+ if (r < 1 || !*status_ptr) {
218229
219230 if (misc_op_str)
220231 dev_err(adev->dev, "MES failed to respond to msg=%s (%s)\n",
@@ -229,10 +240,19 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes, · 8 unmodified lines
229240 while (halt_if_hws_hang)
230241 schedule();
231242
232− return -ETIMEDOUT;
243+ r = -ETIMEDOUT;
244+ goto error_wb_free;
233245 }
234246
247+ amdgpu_device_wb_free(adev, status_offset);
235248 return 0;
249+
250+error_unlock_free:
251+ spin_unlock_irqrestore(&mes->ring_lock, flags);
252+
253+error_wb_free:
254+ amdgpu_device_wb_free(adev, status_offset);
255+ return r;
236256 }
237257
238258 static int convert_to_mes_queue_type(int queue_type)
drivers/gpu/drm/amd/amdgpu/psp_v14_0.c+5−0
@@ -32,7 +32,9 @@ · 31 unmodified lines
3232 #include "mp/mp_14_0_2_sh_mask.h"
3333
3434 MODULE_FIRMWARE("amdgpu/psp_14_0_2_sos.bin");
35+MODULE_FIRMWARE("amdgpu/psp_14_0_2_ta.bin");
3536 MODULE_FIRMWARE("amdgpu/psp_14_0_3_sos.bin");
37+MODULE_FIRMWARE("amdgpu/psp_14_0_3_ta.bin");
3638
3739 /* For large FW files the time to complete can be very long */
3840 #define USBC_PD_POLLING_LIMIT_S 240
@@ -64,6 +66,9 @@ static int psp_v14_0_init_microcode(struct psp_context *psp) · 25 unmodified lines
6466 case IP_VERSION(14, 0, 2):
6567 case IP_VERSION(14, 0, 3):
6668 err = psp_init_sos_microcode(psp, ucode_prefix);
69+ if (err)
70+ return err;
71+ err = psp_init_ta_microcode(psp, ucode_prefix);
6772 if (err)
6873 return err;
6974 break;
drivers/gpu/drm/amd/display/Kconfig+1−1
@@ -8,7 +8,7 @@ config DRM_AMD_DC · 7 unmodified lines
88 depends on BROKEN || !CC_IS_CLANG || ARM64 || RISCV || SPARC64 || X86_64
99 select SND_HDA_COMPONENT if SND_HDA_CORE
1010 # !CC_IS_CLANG: https://github.com/ClangBuiltLinux/linux/issues/1752
11− select DRM_AMD_DC_FP if ARCH_HAS_KERNEL_FPU_SUPPORT && (!ARM64 || !CC_IS_CLANG)
11+ select DRM_AMD_DC_FP if ARCH_HAS_KERNEL_FPU_SUPPORT && !(CC_IS_CLANG && (ARM64 || RISCV))
1212 help
1313 Choose this option if you want to use the new display engine
1414 support for AMDGPU. This adds required support for Vega and
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+10−3
@@ -9169,9 +9169,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 9168 unmodified lines
91699169
91709170 trace_amdgpu_dm_atomic_commit_tail_begin(state);
91719171
9172− if (dm->dc->caps.ips_support && dm->dc->idle_optimizations_allowed)
9173− dc_allow_idle_optimizations(dm->dc, false);
9174−
91759172 drm_atomic_helper_update_legacy_modeset_state(dev, state);
91769173 drm_dp_mst_atomic_wait_for_dependencies(state);
91779174
@@ -11440,6 +11437,12 @@ void amdgpu_dm_trigger_timing_sync(struct drm_device *dev) · 2262 unmodified lines
1144011437 mutex_unlock(&adev->dm.dc_lock);
1144111438 }
1144211439
11440+static inline void amdgpu_dm_exit_ips_for_hw_access(struct dc *dc)
11441+{
11442+ if (dc->ctx->dmub_srv && !dc->ctx->dmub_srv->idle_exit_counter)
11443+ dc_exit_ips_for_hw_access(dc);
11444+}
11445+
1144311446 void dm_write_reg_func(const struct dc_context *ctx, uint32_t address,
1144411447 u32 value, const char *func_name)
1144511448 {
@@ -11450,6 +11453,8 @@ void dm_write_reg_func(const struct dc_context *ctx, uint32_t address, · 4 unmodified lines
1145011453 return;
1145111454 }
1145211455 #endif
11456+
11457+ amdgpu_dm_exit_ips_for_hw_access(ctx->dc);
1145311458 cgs_write_register(ctx->cgs_device, address, value);
1145411459 trace_amdgpu_dc_wreg(&ctx->perf_trace->write_count, address, value);
1145511460 }
@@ -11473,6 +11478,8 @@ uint32_t dm_read_reg_func(const struct dc_context *ctx, uint32_t address, · 17 unmodified lines
1147311478 return 0;
1147411479 }
1147511480
11481+ amdgpu_dm_exit_ips_for_hw_access(ctx->dc);
11482+
1147611483 value = cgs_read_register(ctx->cgs_device, address);
1147711484
1147811485 trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value);
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c+1−1
@@ -177,7 +177,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = { · 176 unmodified lines
177177 .urgent_latency_pixel_data_only_us = 4.0,
178178 .urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
179179 .urgent_latency_vm_data_only_us = 4.0,
180− .dram_clock_change_latency_us = 11.72,
180+ .dram_clock_change_latency_us = 34.0,
181181 .urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
182182 .urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
183183 .urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c+1−1
@@ -215,7 +215,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_51_soc = { · 214 unmodified lines
215215 .urgent_latency_pixel_data_only_us = 4.0,
216216 .urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
217217 .urgent_latency_vm_data_only_us = 4.0,
218− .dram_clock_change_latency_us = 11.72,
218+ .dram_clock_change_latency_us = 34,
219219 .urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
220220 .urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
221221 .urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c+72−0
@@ -1439,3 +1439,75 @@ void dcn35_set_long_vblank(struct pipe_ctx **pipe_ctx, · 1438 unmodified lines
14391439 }
14401440 }
14411441 }
1442+
1443+static bool should_avoid_empty_tu(struct pipe_ctx *pipe_ctx)
1444+{
1445+ /* Calculate average pixel count per TU, return false if under ~2.00 to
1446+ * avoid empty TUs. This is only required for DPIA tunneling as empty TUs
1447+ * are legal to generate for native DP links. Assume TU size 64 as there
1448+ * is currently no scenario where it's reprogrammed from HW default.
1449+ * MTPs have no such limitation, so this does not affect MST use cases.
1450+ */
1451+ unsigned int pix_clk_mhz;
1452+ unsigned int symclk_mhz;
1453+ unsigned int avg_pix_per_tu_x1000;
1454+ unsigned int tu_size_bytes = 64;
1455+ struct dc_crtc_timing *timing = &pipe_ctx->stream->timing;
1456+ struct dc_link_settings *link_settings = &pipe_ctx->link_config.dp_link_settings;
1457+ const struct dc *dc = pipe_ctx->stream->link->dc;
1458+
1459+ if (pipe_ctx->stream->link->ep_type != DISPLAY_ENDPOINT_USB4_DPIA)
1460+ return false;
1461+
1462+ // Not necessary for MST configurations
1463+ if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
1464+ return false;
1465+
1466+ pix_clk_mhz = timing->pix_clk_100hz / 10000;
1467+
1468+ // If this is true, can't block due to dynamic ODM
1469+ if (pix_clk_mhz > dc->clk_mgr->bw_params->clk_table.entries[0].dispclk_mhz)
1470+ return false;
1471+
1472+ switch (link_settings->link_rate) {
1473+ case LINK_RATE_LOW:
1474+ symclk_mhz = 162;
1475+ break;
1476+ case LINK_RATE_HIGH:
1477+ symclk_mhz = 270;
1478+ break;
1479+ case LINK_RATE_HIGH2:
1480+ symclk_mhz = 540;
1481+ break;
1482+ case LINK_RATE_HIGH3:
1483+ symclk_mhz = 810;
1484+ break;
1485+ default:
1486+ // We shouldn't be tunneling any other rates, something is wrong
1487+ ASSERT(0);
1488+ return false;
1489+ }
1490+
1491+ avg_pix_per_tu_x1000 = (1000 * pix_clk_mhz * tu_size_bytes)
1492+ / (symclk_mhz * link_settings->lane_count);
1493+
1494+ // Add small empirically-decided margin to account for potential jitter
1495+ return (avg_pix_per_tu_x1000 < 2020);
1496+}
1497+
1498+bool dcn35_is_dp_dig_pixel_rate_div_policy(struct pipe_ctx *pipe_ctx)
1499+{
1500+ struct dc *dc = pipe_ctx->stream->ctx->dc;
1501+
1502+ if (!is_h_timing_divisible_by_2(pipe_ctx->stream))
1503+ return false;
1504+
1505+ if (should_avoid_empty_tu(pipe_ctx))
1506+ return false;
1507+
1508+ if (dc_is_dp_signal(pipe_ctx->stream->signal) && !dc->link_srv->dp_is_128b_132b_signal(pipe_ctx) &&
1509+ dc->debug.enable_dp_dig_pixel_rate_div_policy)
1510+ return true;
1511+
1512+ return false;
1513+}
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h+2−0
@@ -95,4 +95,6 @@ void dcn35_set_static_screen_control(struct pipe_ctx **pipe_ctx, · 94 unmodified lines
9595 void dcn35_set_long_vblank(struct pipe_ctx **pipe_ctx,
9696 int num_pipes, uint32_t v_total_min, uint32_t v_total_max);
9797
98+bool dcn35_is_dp_dig_pixel_rate_div_policy(struct pipe_ctx *pipe_ctx);
99+
98100 #endif /* __DC_HWSS_DCN35_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c+1−1
@@ -158,7 +158,7 @@ static const struct hwseq_private_funcs dcn35_private_funcs = { · 157 unmodified lines
158158 .setup_hpo_hw_control = dcn35_setup_hpo_hw_control,
159159 .calculate_dccg_k1_k2_values = dcn32_calculate_dccg_k1_k2_values,
160160 .set_pixels_per_cycle = dcn32_set_pixels_per_cycle,
161− .is_dp_dig_pixel_rate_div_policy = dcn32_is_dp_dig_pixel_rate_div_policy,
161+ .is_dp_dig_pixel_rate_div_policy = dcn35_is_dp_dig_pixel_rate_div_policy,
162162 .dsc_pg_control = dcn35_dsc_pg_control,
163163 .dsc_pg_status = dcn32_dsc_pg_status,
164164 .enable_plane = dcn35_enable_plane,
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c+2−0
@@ -164,6 +164,8 @@ static void sumo_construct_vid_mapping_table(struct amdgpu_device *adev, · 163 unmodified lines
164164
165165 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
166166 if (table[i].ulSupportedSCLK != 0) {
167+ if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
168+ continue;
167169 vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
168170 table[i].usVoltageID;
169171 vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =
drivers/gpu/drm/i915/display/intel_dp.c+4−0
@@ -442,6 +442,10 @@ bool intel_dp_has_bigjoiner(struct intel_dp *intel_dp) · 441 unmodified lines
442442 struct intel_encoder *encoder = &intel_dig_port->base;
443443 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
444444
445+ /* eDP MSO is not compatible with joiner */
446+ if (intel_dp->mso_link_count)
447+ return false;
448+
445449 return DISPLAY_VER(dev_priv) >= 12 ||
446450 (DISPLAY_VER(dev_priv) == 11 &&
447451 encoder->port != PORT_A);
drivers/gpu/drm/radeon/sumo_dpm.c+2−0
@@ -1619,6 +1619,8 @@ void sumo_construct_vid_mapping_table(struct radeon_device *rdev, · 1618 unmodified lines
16191619
16201620 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
16211621 if (table[i].ulSupportedSCLK != 0) {
1622+ if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
1623+ continue;
16221624 vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
16231625 table[i].usVoltageID;
16241626 vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =
drivers/gpu/drm/vmwgfx/Kconfig+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 config DRM_VMWGFX
33 tristate "DRM driver for VMware Virtual GPU"
44 depends on DRM && PCI && MMU
5− depends on X86 || ARM64
5+ depends on (X86 && HYPERVISOR_GUEST) || ARM64
66 select DRM_TTM
77 select DRM_TTM_HELPER
88 select MAPPING_DIRTY_HELPERS
drivers/gpu/drm/xe/xe_guc.c+2−2
@@ -631,8 +631,6 @@ int xe_guc_enable_communication(struct xe_guc *guc) · 630 unmodified lines
631631 struct xe_device *xe = guc_to_xe(guc);
632632 int err;
633633
634− guc_enable_irq(guc);
635−
636634 if (IS_SRIOV_VF(xe) && xe_device_has_memirq(xe)) {
637635 struct xe_gt *gt = guc_to_gt(guc);
638636 struct xe_tile *tile = gt_to_tile(gt);
@@ -640,6 +638,8 @@ int xe_guc_enable_communication(struct xe_guc *guc) · 1 unmodified line
640638 err = xe_memirq_init_guc(&tile->sriov.vf.memirq, guc);
641639 if (err)
642640 return err;
641+ } else {
642+ guc_enable_irq(guc);
643643 }
644644
645645 xe_mmio_rmw32(guc_to_gt(guc), PMINTRMSK,
drivers/hv/hv.c+18−19
@@ -45,8 +45,8 @@ int hv_init(void) · 44 unmodified lines
4545 * This involves a hypercall.
4646 */
4747 int hv_post_message(union hv_connection_id connection_id,
48− enum hv_message_type message_type,
49− void *payload, size_t payload_size)
48+ enum hv_message_type message_type,
49+ void *payload, size_t payload_size)
5050 {
5151 struct hv_input_post_message *aligned_msg;
5252 unsigned long flags;
@@ -86,7 +86,7 @@ int hv_post_message(union hv_connection_id connection_id, · 33 unmodified lines
8686 status = HV_STATUS_INVALID_PARAMETER;
8787 } else {
8888 status = hv_do_hypercall(HVCALL_POST_MESSAGE,
89− aligned_msg, NULL);
89+ aligned_msg, NULL);
9090 }
9191
9292 local_irq_restore(flags);
@@ -111,7 +111,7 @@ int hv_synic_alloc(void) · 18 unmodified lines
111111
112112 hv_context.hv_numa_map = kcalloc(nr_node_ids, sizeof(struct cpumask),
113113 GFP_KERNEL);
114− if (hv_context.hv_numa_map == NULL) {
114+ if (!hv_context.hv_numa_map) {
115115 pr_err("Unable to allocate NUMA map\n");
116116 goto err;
117117 }
@@ -120,11 +120,11 @@ int hv_synic_alloc(void) · 2 unmodified lines
120120 hv_cpu = per_cpu_ptr(hv_context.cpu_context, cpu);
121121
122122 tasklet_init(&hv_cpu->msg_dpc,
123− vmbus_on_msg_dpc, (unsigned long) hv_cpu);
123+ vmbus_on_msg_dpc, (unsigned long)hv_cpu);
124124
125125 if (ms_hyperv.paravisor_present && hv_isolation_type_tdx()) {
126126 hv_cpu->post_msg_page = (void *)get_zeroed_page(GFP_ATOMIC);
127− if (hv_cpu->post_msg_page == NULL) {
127+ if (!hv_cpu->post_msg_page) {
128128 pr_err("Unable to allocate post msg page\n");
129129 goto err;
130130 }
@@ -147,14 +147,14 @@ int hv_synic_alloc(void) · 16 unmodified lines
147147 if (!ms_hyperv.paravisor_present && !hv_root_partition) {
148148 hv_cpu->synic_message_page =
149149 (void *)get_zeroed_page(GFP_ATOMIC);
150− if (hv_cpu->synic_message_page == NULL) {
150+ if (!hv_cpu->synic_message_page) {
151151 pr_err("Unable to allocate SYNIC message page\n");
152152 goto err;
153153 }
154154
155155 hv_cpu->synic_event_page =
156156 (void *)get_zeroed_page(GFP_ATOMIC);
157− if (hv_cpu->synic_event_page == NULL) {
157+ if (!hv_cpu->synic_event_page) {
158158 pr_err("Unable to allocate SYNIC event page\n");
159159
160160 free_page((unsigned long)hv_cpu->synic_message_page);
@@ -203,14 +203,13 @@ err: · 42 unmodified lines
203203 return ret;
204204 }
205205
206−
207206 void hv_synic_free(void)
208207 {
209208 int cpu, ret;
210209
211210 for_each_present_cpu(cpu) {
212− struct hv_per_cpu_context *hv_cpu
213− = per_cpu_ptr(hv_context.cpu_context, cpu);
211+ struct hv_per_cpu_context *hv_cpu =
212+ per_cpu_ptr(hv_context.cpu_context, cpu);
214213
215214 /* It's better to leak the page if the encryption fails. */
216215 if (ms_hyperv.paravisor_present && hv_isolation_type_tdx()) {
@@ -262,8 +261,8 @@ void hv_synic_free(void) · 45 unmodified lines
262261 */
263262 void hv_synic_enable_regs(unsigned int cpu)
264263 {
265− struct hv_per_cpu_context *hv_cpu
266− = per_cpu_ptr(hv_context.cpu_context, cpu);
264+ struct hv_per_cpu_context *hv_cpu =
265+ per_cpu_ptr(hv_context.cpu_context, cpu);
267266 union hv_synic_simp simp;
268267 union hv_synic_siefp siefp;
269268 union hv_synic_sint shared_sint;
@@ -277,8 +276,8 @@ void hv_synic_enable_regs(unsigned int cpu) · 7 unmodified lines
277276 /* Mask out vTOM bit. ioremap_cache() maps decrypted */
278277 u64 base = (simp.base_simp_gpa << HV_HYP_PAGE_SHIFT) &
279278 ~ms_hyperv.shared_gpa_boundary;
280− hv_cpu->synic_message_page
281− = (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
279+ hv_cpu->synic_message_page =
280+ (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
282281 if (!hv_cpu->synic_message_page)
283282 pr_err("Fail to map synic message page.\n");
284283 } else {
@@ -296,8 +295,8 @@ void hv_synic_enable_regs(unsigned int cpu) · 11 unmodified lines
296295 /* Mask out vTOM bit. ioremap_cache() maps decrypted */
297296 u64 base = (siefp.base_siefp_gpa << HV_HYP_PAGE_SHIFT) &
298297 ~ms_hyperv.shared_gpa_boundary;
299− hv_cpu->synic_event_page
300− = (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
298+ hv_cpu->synic_event_page =
299+ (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
301300 if (!hv_cpu->synic_event_page)
302301 pr_err("Fail to map synic event page.\n");
303302 } else {
@@ -348,8 +347,8 @@ int hv_synic_init(unsigned int cpu) · 44 unmodified lines
348347 */
349348 void hv_synic_disable_regs(unsigned int cpu)
350349 {
351− struct hv_per_cpu_context *hv_cpu
352− = per_cpu_ptr(hv_context.cpu_context, cpu);
350+ struct hv_per_cpu_context *hv_cpu =
351+ per_cpu_ptr(hv_context.cpu_context, cpu);
353352 union hv_synic_sint shared_sint;
354353 union hv_synic_simp simp;
355354 union hv_synic_siefp siefp;
drivers/hv/hv_balloon.c+80−110
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/notifier.h>
2626 #include <linux/percpu_counter.h>
2727 #include <linux/page_reporting.h>
28+#include <linux/sizes.h>
2829
2930 #include <linux/hyperv.h>
3031 #include <asm/hyperv-tlfs.h>
@@ -41,8 +42,6 @@ · 10 unmodified lines
4142 * Begin protocol definitions.
4243 */
4344
44−
45−
4645 /*
4746 * Protocol versions. The low word is the minor version, the high word the major
4847 * version.
@@ -71,8 +70,6 @@ enum { · 22 unmodified lines
7170 DYNMEM_PROTOCOL_VERSION_CURRENT = DYNMEM_PROTOCOL_VERSION_WIN10
7271 };
7372
74−
75−
7673 /*
7774 * Message Types
7875 */
@@ -101,7 +98,6 @@ enum dm_message_type { · 22 unmodified lines
10198 DM_VERSION_1_MAX = 12
10299 };
103100
104−
105101 /*
106102 * Structures defining the dynamic memory management
107103 * protocol.
@@ -115,7 +111,6 @@ union dm_version { · 7 unmodified lines
115111 __u32 version;
116112 } __packed;
117113
118−
119114 union dm_caps {
120115 struct {
121116 __u64 balloon:1;
@@ -148,8 +143,6 @@ union dm_mem_page_range { · 26 unmodified lines
148143 __u64 page_range;
149144 } __packed;
150145
151−
152−
153146 /*
154147 * The header for all dynamic memory messages:
155148 *
@@ -174,7 +167,6 @@ struct dm_message { · 18 unmodified lines
174167 __u8 data[]; /* enclosed message */
175168 } __packed;
176169
177−
178170 /*
179171 * Specific message types supporting the dynamic memory protocol.
180172 */
@@ -271,7 +263,6 @@ struct dm_status { · 90 unmodified lines
271263 __u32 io_diff;
272264 } __packed;
273265
274−
275266 /*
276267 * Message to ask the guest to allocate memory - balloon up message.
277268 * This message is sent from the host to the guest. The guest may not be
@@ -286,14 +277,13 @@ struct dm_balloon { · 8 unmodified lines
286277 __u32 reservedz;
287278 } __packed;
288279
289−
290280 /*
291281 * Balloon response message; this message is sent from the guest
292282 * to the host in response to the balloon message.
293283 *
294284 * reservedz: Reserved; must be set to zero.
295285 * more_pages: If FALSE, this is the last message of the transaction.
296− * if TRUE there will atleast one more message from the guest.
286+ * if TRUE there will be at least one more message from the guest.
297287 *
298288 * range_count: The number of ranges in the range array.
299289 *
@@ -314,7 +304,7 @@ struct dm_balloon_response { · 14 unmodified lines
314304 * to the guest to give guest more memory.
315305 *
316306 * more_pages: If FALSE, this is the last message of the transaction.
317− * if TRUE there will atleast one more message from the guest.
307+ * if TRUE there will be at least one more message from the guest.
318308 *
319309 * reservedz: Reserved; must be set to zero.
320310 *
@@ -342,7 +332,6 @@ struct dm_unballoon_response { · 21 unmodified lines
342332 struct dm_header hdr;
343333 } __packed;
344334
345−
346335 /*
347336 * Hot add request message. Message sent from the host to the guest.
348337 *
@@ -390,7 +379,6 @@ enum dm_info_type { · 41 unmodified lines
390379 MAX_INFO_TYPE
391380 };
392381
393−
394382 /*
395383 * Header for the information message.
396384 */
@@ -425,11 +413,11 @@ struct dm_info_msg { · 28 unmodified lines
425413 * The range start_pfn : end_pfn specifies the range
426414 * that the host has asked us to hot add. The range
427415 * start_pfn : ha_end_pfn specifies the range that we have
428− * currently hot added. We hot add in multiples of 128M
429− * chunks; it is possible that we may not be able to bring
430− * online all the pages in the region. The range
416+ * currently hot added. We hot add in chunks equal to the
417+ * memory block size; it is possible that we may not be able
418+ * to bring online all the pages in the region. The range
431419 * covered_start_pfn:covered_end_pfn defines the pages that can
432− * be brough online.
420+ * be brought online.
433421 */
434422
435423 struct hv_hotadd_state {
@@ -480,10 +468,10 @@ static unsigned long last_post_time; · 44 unmodified lines
480468
481469 static int hv_hypercall_multi_failure;
482470
483−module_param(hot_add, bool, (S_IRUGO | S_IWUSR));
471+module_param(hot_add, bool, 0644);
484472 MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
485473
486−module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR));
474+module_param(pressure_report_delay, uint, 0644);
487475 MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
488476 static atomic_t trans_id = ATOMIC_INIT(0);
489477
@@ -502,11 +490,13 @@ enum hv_dm_state { · 12 unmodified lines
502490 DM_INIT_ERROR
503491 };
504492
505−
506493 static __u8 recv_buffer[HV_HYP_PAGE_SIZE];
507494 static __u8 balloon_up_send_buffer[HV_HYP_PAGE_SIZE];
495+
496+static unsigned long ha_pages_in_chunk;
497+#define HA_BYTES_IN_CHUNK (ha_pages_in_chunk << PAGE_SHIFT)
498+
508499 #define PAGES_IN_2M (2 * 1024 * 1024 / PAGE_SIZE)
509−#define HA_CHUNK (128 * 1024 * 1024 / PAGE_SIZE)
510500
511501 struct hv_dynmem_device {
512502 struct hv_device *dev;
@@ -595,12 +585,12 @@ static inline bool has_pfn_is_backed(struct hv_hotadd_state *has, · 82 unmodified lines
595585 struct hv_hotadd_gap *gap;
596586
597587 /* The page is not backed. */
598− if ((pfn < has->covered_start_pfn) || (pfn >= has->covered_end_pfn))
588+ if (pfn < has->covered_start_pfn || pfn >= has->covered_end_pfn)
599589 return false;
600590
601591 /* Check for gaps. */
602592 list_for_each_entry(gap, &has->gap_list, list) {
603− if ((pfn >= gap->start_pfn) && (pfn < gap->end_pfn))
593+ if (pfn >= gap->start_pfn && pfn < gap->end_pfn)
604594 return false;
605595 }
606596
@@ -724,28 +714,21 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, · 117 unmodified lines
724714 unsigned long processed_pfn;
725715 unsigned long total_pfn = pfn_count;
726716
727− for (i = 0; i < (size/HA_CHUNK); i++) {
728− start_pfn = start + (i * HA_CHUNK);
717+ for (i = 0; i < (size/ha_pages_in_chunk); i++) {
718+ start_pfn = start + (i * ha_pages_in_chunk);
729719
730720 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
731− has->ha_end_pfn += HA_CHUNK;
732−
733− if (total_pfn > HA_CHUNK) {
734− processed_pfn = HA_CHUNK;
735− total_pfn -= HA_CHUNK;
736− } else {
737− processed_pfn = total_pfn;
738− total_pfn = 0;
739− }
740−
741− has->covered_end_pfn += processed_pfn;
721+ has->ha_end_pfn += ha_pages_in_chunk;
722+ processed_pfn = umin(total_pfn, ha_pages_in_chunk);
723+ total_pfn -= processed_pfn;
724+ has->covered_end_pfn += processed_pfn;
742725 }
743726
744727 reinit_completion(&dm_device.ol_waitevent);
745728
746729 nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn));
747730 ret = add_memory(nid, PFN_PHYS((start_pfn)),
748− (HA_CHUNK << PAGE_SHIFT), MHP_MERGE_RESOURCE);
731+ HA_BYTES_IN_CHUNK, MHP_MERGE_RESOURCE);
749732
750733 if (ret) {
751734 pr_err("hot_add memory failed error is %d\n", ret);
@@ -760,7 +743,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, · 8 unmodified lines
760743 do_hot_add = false;
761744 }
762745 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
763− has->ha_end_pfn -= HA_CHUNK;
746+ has->ha_end_pfn -= ha_pages_in_chunk;
764747 has->covered_end_pfn -= processed_pfn;
765748 }
766749 break;
@@ -787,8 +770,8 @@ static void hv_online_page(struct page *pg, unsigned int order) · 20 unmodified lines
787770 guard(spinlock_irqsave)(&dm_device.ha_lock);
788771 list_for_each_entry(has, &dm_device.ha_region_list, list) {
789772 /* The page belongs to a different HAS. */
790− if ((pfn < has->start_pfn) ||
791− (pfn + (1UL << order) > has->end_pfn))
773+ if (pfn < has->start_pfn ||
774+ (pfn + (1UL << order) > has->end_pfn))
792775 continue;
793776
794777 hv_bring_pgs_online(has, pfn, 1UL << order);
@@ -800,7 +783,7 @@ static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) · 5 unmodified lines
800783 {
801784 struct hv_hotadd_state *has;
802785 struct hv_hotadd_gap *gap;
803− unsigned long residual, new_inc;
786+ unsigned long residual;
804787 int ret = 0;
805788
806789 guard(spinlock_irqsave)(&dm_device.ha_lock);
@@ -836,15 +819,9 @@ static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) · 29 unmodified lines
836819 * our current limit; extend it.
837820 */
838821 if ((start_pfn + pfn_cnt) > has->end_pfn) {
822+ /* Extend the region by multiples of ha_pages_in_chunk */
839823 residual = (start_pfn + pfn_cnt - has->end_pfn);
840− /*
841− * Extend the region by multiples of HA_CHUNK.
842− */
843− new_inc = (residual / HA_CHUNK) * HA_CHUNK;
844− if (residual % HA_CHUNK)
845− new_inc += HA_CHUNK;
846−
847− has->end_pfn += new_inc;
824+ has->end_pfn += ALIGN(residual, ha_pages_in_chunk);
848825 }
849826
850827 ret = 1;
@@ -855,7 +832,7 @@ static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) · 4 unmodified lines
855832 }
856833
857834 static unsigned long handle_pg_range(unsigned long pg_start,
858− unsigned long pg_count)
835+ unsigned long pg_count)
859836 {
860837 unsigned long start_pfn = pg_start;
861838 unsigned long pfn_cnt = pg_count;
@@ -866,7 +843,7 @@ static unsigned long handle_pg_range(unsigned long pg_start, · 4 unmodified lines
866843 unsigned long res = 0, flags;
867844
868845 pr_debug("Hot adding %lu pages starting at pfn 0x%lx.\n", pg_count,
869− pg_start);
846+ pg_start);
870847
871848 spin_lock_irqsave(&dm_device.ha_lock, flags);
872849 list_for_each_entry(has, &dm_device.ha_region_list, list) {
@@ -902,22 +879,19 @@ static unsigned long handle_pg_range(unsigned long pg_start, · 29 unmodified lines
902879 if (start_pfn > has->start_pfn &&
903880 online_section_nr(pfn_to_section_nr(start_pfn)))
904881 hv_bring_pgs_online(has, start_pfn, pgs_ol);
905−
906882 }
907883
908− if ((has->ha_end_pfn < has->end_pfn) && (pfn_cnt > 0)) {
884+ if (has->ha_end_pfn < has->end_pfn && pfn_cnt > 0) {
909885 /*
910886 * We have some residual hot add range
911887 * that needs to be hot added; hot add
912888 * it now. Hot add a multiple of
913− * HA_CHUNK that fully covers the pages
889+ * ha_pages_in_chunk that fully covers the pages
914890 * we have.
915891 */
916892 size = (has->end_pfn - has->ha_end_pfn);
917893 if (pfn_cnt <= size) {
918− size = ((pfn_cnt / HA_CHUNK) * HA_CHUNK);
919− if (pfn_cnt % HA_CHUNK)
920− size += HA_CHUNK;
894+ size = ALIGN(pfn_cnt, ha_pages_in_chunk);
921895 } else {
922896 pfn_cnt = size;
923897 }
@@ -1010,10 +984,7 @@ static void hot_add_req(struct work_struct *dummy) · 86 unmodified lines
1010984 rg_start = dm->ha_wrk.ha_region_range.finfo.start_page;
1011985 rg_sz = dm->ha_wrk.ha_region_range.finfo.page_cnt;
1012986
1013− if ((rg_start == 0) && (!dm->host_specified_ha_region)) {
1014− unsigned long region_size;
1015− unsigned long region_start;
1016−
987+ if (rg_start == 0 && !dm->host_specified_ha_region) {
1017988 /*
1018989 * The host has not specified the hot-add region.
1019990 * Based on the hot-add page range being specified,
@@ -1021,19 +992,13 @@ static void hot_add_req(struct work_struct *dummy) · 1 unmodified line
1021992 * that need to be hot-added while ensuring the alignment
1022993 * and size requirements of Linux as it relates to hot-add.
1023994 */
1024− region_size = (pfn_cnt / HA_CHUNK) * HA_CHUNK;
1025− if (pfn_cnt % HA_CHUNK)
1026− region_size += HA_CHUNK;
1027−
1028− region_start = (pg_start / HA_CHUNK) * HA_CHUNK;
1029−
1030− rg_start = region_start;
1031− rg_sz = region_size;
995+ rg_start = ALIGN_DOWN(pg_start, ha_pages_in_chunk);
996+ rg_sz = ALIGN(pfn_cnt, ha_pages_in_chunk);
1032997 }
1033998
1034999 if (do_hot_add)
10351000 resp.page_count = process_hot_add(pg_start, pfn_cnt,
1036− rg_start, rg_sz);
1001+ rg_start, rg_sz);
10371002
10381003 dm->num_pages_added += resp.page_count;
10391004 #endif
@@ -1211,11 +1176,10 @@ static void post_status(struct hv_dynmem_device *dm) · 171 unmodified lines
12111176 sizeof(struct dm_status),
12121177 (unsigned long)NULL,
12131178 VM_PKT_DATA_INBAND, 0);
1214−
12151179 }
12161180
12171181 static void free_balloon_pages(struct hv_dynmem_device *dm,
1218− union dm_mem_page_range *range_array)
1182+ union dm_mem_page_range *range_array)
12191183 {
12201184 int num_pages = range_array->finfo.page_cnt;
12211185 __u64 start_frame = range_array->finfo.start_page;
@@ -1231,8 +1195,6 @@ static void free_balloon_pages(struct hv_dynmem_device *dm, · 9 unmodified lines
12311195 }
12321196 }
12331197
1234−
1235−
12361198 static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm,
12371199 unsigned int num_pages,
12381200 struct dm_balloon_response *bl_resp,
@@ -1278,7 +1240,6 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm, · 39 unmodified lines
12781240 page_to_pfn(pg);
12791241 bl_resp->range_array[i].finfo.page_cnt = alloc_unit;
12801242 bl_resp->hdr.size += sizeof(union dm_mem_page_range);
1281−
12821243 }
12831244
12841245 return i * alloc_unit;
@@ -1332,7 +1293,7 @@ static void balloon_up(struct work_struct *dummy) · 47 unmodified lines
13321293
13331294 if (num_ballooned == 0 || num_ballooned == num_pages) {
13341295 pr_debug("Ballooned %u out of %u requested pages.\n",
1335− num_pages, dm_device.balloon_wrk.num_pages);
1296+ num_pages, dm_device.balloon_wrk.num_pages);
13361297
13371298 bl_resp->more_pages = 0;
13381299 done = true;
@@ -1366,16 +1327,15 @@ static void balloon_up(struct work_struct *dummy) · 27 unmodified lines
13661327
13671328 for (i = 0; i < bl_resp->range_count; i++)
13681329 free_balloon_pages(&dm_device,
1369− &bl_resp->range_array[i]);
1330+ &bl_resp->range_array[i]);
13701331
13711332 done = true;
13721333 }
13731334 }
1374−
13751335 }
13761336
13771337 static void balloon_down(struct hv_dynmem_device *dm,
1378− struct dm_unballoon_request *req)
1338+ struct dm_unballoon_request *req)
13791339 {
13801340 union dm_mem_page_range *range_array = req->range_array;
13811341 int range_count = req->range_count;
@@ -1389,7 +1349,7 @@ static void balloon_down(struct hv_dynmem_device *dm, · 7 unmodified lines
13891349 }
13901350
13911351 pr_debug("Freed %u ballooned pages.\n",
1392− prev_pages_ballooned - dm->num_pages_ballooned);
1352+ prev_pages_ballooned - dm->num_pages_ballooned);
13931353
13941354 if (req->more_pages == 1)
13951355 return;
@@ -1414,8 +1374,7 @@ static int dm_thread_func(void *dm_dev) · 18 unmodified lines
14141374 struct hv_dynmem_device *dm = dm_dev;
14151375
14161376 while (!kthread_should_stop()) {
1417− wait_for_completion_interruptible_timeout(
1418− &dm_device.config_event, 1*HZ);
1377+ wait_for_completion_interruptible_timeout(&dm_device.config_event, 1 * HZ);
14191378 /*
14201379 * The host expects us to post information on the memory
14211380 * pressure every second.
@@ -1439,9 +1398,8 @@ static int dm_thread_func(void *dm_dev) · 17 unmodified lines
14391398 return 0;
14401399 }
14411400
1442−
14431401 static void version_resp(struct hv_dynmem_device *dm,
1444− struct dm_version_response *vresp)
1402+ struct dm_version_response *vresp)
14451403 {
14461404 struct dm_version_request version_req;
14471405 int ret;
@@ -1502,7 +1460,7 @@ version_error: · 54 unmodified lines
15021460 }
15031461
15041462 static void cap_resp(struct hv_dynmem_device *dm,
1505− struct dm_capabilities_resp_msg *cap_resp)
1463+ struct dm_capabilities_resp_msg *cap_resp)
15061464 {
15071465 if (!cap_resp->is_accepted) {
15081466 pr_err("Capabilities not accepted by host\n");
@@ -1535,7 +1493,7 @@ static void balloon_onchannelcallback(void *context) · 26 unmodified lines
15351493 switch (dm_hdr->type) {
15361494 case DM_VERSION_RESPONSE:
15371495 version_resp(dm,
1538− (struct dm_version_response *)dm_msg);
1496+ (struct dm_version_response *)dm_msg);
15391497 break;
15401498
15411499 case DM_CAPABILITIES_RESPONSE:
@@ -1565,7 +1523,7 @@ static void balloon_onchannelcallback(void *context) · 23 unmodified lines
15651523
15661524 dm->state = DM_BALLOON_DOWN;
15671525 balloon_down(dm,
1568− (struct dm_unballoon_request *)recv_buffer);
1526+ (struct dm_unballoon_request *)recv_buffer);
15691527 break;
15701528
15711529 case DM_MEM_HOT_ADD_REQUEST:
@@ -1603,17 +1561,15 @@ static void balloon_onchannelcallback(void *context) · 31 unmodified lines
16031561
16041562 default:
16051563 pr_warn_ratelimited("Unhandled message: type: %d\n", dm_hdr->type);
1606−
16071564 }
16081565 }
1609−
16101566 }
16111567
16121568 #define HV_LARGE_REPORTING_ORDER 9
16131569 #define HV_LARGE_REPORTING_LEN (HV_HYP_PAGE_SIZE << \
16141570 HV_LARGE_REPORTING_ORDER)
16151571 static int hv_free_page_report(struct page_reporting_dev_info *pr_dev_info,
1616− struct scatterlist *sgl, unsigned int nents)
1572+ struct scatterlist *sgl, unsigned int nents)
16171573 {
16181574 unsigned long flags;
16191575 struct hv_memory_hint *hint;
@@ -1648,7 +1604,7 @@ static int hv_free_page_report(struct page_reporting_dev_info *pr_dev_info, · 28 unmodified lines
16481604 */
16491605
16501606 /* page reporting for pages 2MB or higher */
1651− if (order >= HV_LARGE_REPORTING_ORDER ) {
1607+ if (order >= HV_LARGE_REPORTING_ORDER) {
16521608 range->page.largepage = 1;
16531609 range->page_size = HV_GPA_PAGE_RANGE_PAGE_SIZE_2MB;
16541610 range->base_large_pfn = page_to_hvpfn(
@@ -1662,23 +1618,21 @@ static int hv_free_page_report(struct page_reporting_dev_info *pr_dev_info, · 7 unmodified lines
16621618 range->page.additional_pages =
16631619 (sg->length / HV_HYP_PAGE_SIZE) - 1;
16641620 }
1665−
16661621 }
16671622
16681623 status = hv_do_rep_hypercall(HV_EXT_CALL_MEMORY_HEAT_HINT, nents, 0,
16691624 hint, NULL);
16701625 local_irq_restore(flags);
16711626 if (!hv_result_success(status)) {
1672−
16731627 pr_err("Cold memory discard hypercall failed with status %llx\n",
1674− status);
1628+ status);
16751629 if (hv_hypercall_multi_failure > 0)
16761630 hv_hypercall_multi_failure++;
16771631
16781632 if (hv_result(status) == HV_STATUS_INVALID_PARAMETER) {
16791633 pr_err("Underlying Hyper-V does not support order less than 9. Hypercall failed\n");
16801634 pr_err("Defaulting to page_reporting_order %d\n",
1681− pageblock_order);
1635+ pageblock_order);
16821636 page_reporting_order = pageblock_order;
16831637 hv_hypercall_multi_failure++;
16841638 return -EINVAL;
@@ -1712,7 +1666,7 @@ static void enable_page_reporting(void) · 27 unmodified lines
17121666 pr_err("Failed to enable cold memory discard: %d\n", ret);
17131667 } else {
17141668 pr_info("Cold memory discard hint enabled with order %d\n",
1715− page_reporting_order);
1669+ page_reporting_order);
17161670 }
17171671 }
17181672
@@ -1795,7 +1749,7 @@ static int balloon_connect_vsp(struct hv_device *dev) · 76 unmodified lines
17951749 if (ret)
17961750 goto out;
17971751
1798− t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1752+ t = wait_for_completion_timeout(&dm_device.host_event, 5 * HZ);
17991753 if (t == 0) {
18001754 ret = -ETIMEDOUT;
18011755 goto out;
@@ -1831,10 +1785,13 @@ static int balloon_connect_vsp(struct hv_device *dev) · 29 unmodified lines
18311785 cap_msg.caps.cap_bits.hot_add = hot_add_enabled();
18321786
18331787 /*
1834− * Specify our alignment requirements as it relates
1835− * memory hot-add. Specify 128MB alignment.
1788+ * Specify our alignment requirements for memory hot-add. The value is
1789+ * the log base 2 of the number of megabytes in a chunk. For example,
1790+ * with 256 MiB chunks, the value is 8. The number of MiB in a chunk
1791+ * must be a power of 2.
18361792 */
1837− cap_msg.caps.cap_bits.hot_add_alignment = 7;
1793+ cap_msg.caps.cap_bits.hot_add_alignment =
1794+ ilog2(HA_BYTES_IN_CHUNK / SZ_1M);
18381795
18391796 /*
18401797 * Currently the host does not use these
@@ -1850,7 +1807,7 @@ static int balloon_connect_vsp(struct hv_device *dev) · 9 unmodified lines
18501807 if (ret)
18511808 goto out;
18521809
1853− t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1810+ t = wait_for_completion_timeout(&dm_device.host_event, 5 * HZ);
18541811 if (t == 0) {
18551812 ret = -ETIMEDOUT;
18561813 goto out;
@@ -1891,8 +1848,8 @@ static int hv_balloon_debug_show(struct seq_file *f, void *offset) · 34 unmodified lines
18911848 char *sname;
18921849
18931850 seq_printf(f, "%-22s: %u.%u\n", "host_version",
1894− DYNMEM_MAJOR_VERSION(dm->version),
1895− DYNMEM_MINOR_VERSION(dm->version));
1851+ DYNMEM_MAJOR_VERSION(dm->version),
1852+ DYNMEM_MINOR_VERSION(dm->version));
18961853
18971854 seq_printf(f, "%-22s:", "capabilities");
18981855 if (ballooning_enabled())
@@ -1941,10 +1898,10 @@ static int hv_balloon_debug_show(struct seq_file *f, void *offset) · 42 unmodified lines
19411898 seq_printf(f, "%-22s: %u\n", "pages_ballooned", dm->num_pages_ballooned);
19421899
19431900 seq_printf(f, "%-22s: %lu\n", "total_pages_committed",
1944− get_pages_committed(dm));
1901+ get_pages_committed(dm));
19451902
19461903 seq_printf(f, "%-22s: %llu\n", "max_dynamic_page_count",
1947− dm->max_dynamic_page_count);
1904+ dm->max_dynamic_page_count);
19481905
19491906 return 0;
19501907 }
@@ -1954,7 +1911,7 @@ DEFINE_SHOW_ATTRIBUTE(hv_balloon_debug); · 3 unmodified lines
19541911 static void hv_balloon_debugfs_init(struct hv_dynmem_device *b)
19551912 {
19561913 debugfs_create_file("hv-balloon", 0444, NULL, b,
1957− &hv_balloon_debug_fops);
1914+ &hv_balloon_debug_fops);
19581915 }
19591916
19601917 static void hv_balloon_debugfs_exit(struct hv_dynmem_device *b)
@@ -1984,8 +1941,23 @@ static int balloon_probe(struct hv_device *dev, · 23 unmodified lines
19841941 hot_add = false;
19851942
19861943 #ifdef CONFIG_MEMORY_HOTPLUG
1944+ /*
1945+ * Hot-add must operate in chunks that are of size equal to the
1946+ * memory block size because that's what the core add_memory()
1947+ * interface requires. The Hyper-V interface requires that the memory
1948+ * block size be a power of 2, which is guaranteed by the check in
1949+ * memory_dev_init().
1950+ */
1951+ ha_pages_in_chunk = memory_block_size_bytes() / PAGE_SIZE;
19871952 do_hot_add = hot_add;
19881953 #else
1954+ /*
1955+ * Without MEMORY_HOTPLUG, the guest returns a failure status for all
1956+ * hot add requests from Hyper-V, and the chunk size is used only to
1957+ * specify alignment to Hyper-V as required by the host/guest protocol.
1958+ * Somewhat arbitrarily, use 128 MiB.
1959+ */
1960+ ha_pages_in_chunk = SZ_128M / PAGE_SIZE;
19891961 do_hot_add = false;
19901962 #endif
19911963 dm_device.dev = dev;
@@ -2097,7 +2069,6 @@ static int balloon_suspend(struct hv_device *hv_dev) · 105 unmodified lines
20972069 tasklet_enable(&hv_dev->channel->callback_event);
20982070
20992071 return 0;
2100−
21012072 }
21022073
21032074 static int balloon_resume(struct hv_device *dev)
@@ -2156,7 +2127,6 @@ static struct hv_driver balloon_drv = { · 52 unmodified lines
21562127
21572128 static int __init init_balloon_drv(void)
21582129 {
2159−
21602130 return vmbus_driver_register(&balloon_drv);
21612131 }
21622132
drivers/i2c/busses/i2c-ocores.c+1−1
@@ -431,8 +431,8 @@ static int ocores_init(struct device *dev, struct ocores_i2c *i2c) · 430 unmodified lines
431431 oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8);
432432
433433 /* Init the device */
434− oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
435434 oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN);
435+ oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
436436
437437 return 0;
438438 }
drivers/infiniband/hw/bnxt_re/bnxt_re.h+1−3
@@ -107,8 +107,6 @@ struct bnxt_re_gsi_context { · 106 unmodified lines
107107 struct bnxt_re_sqp_entries *sqp_tbl;
108108 };
109109
110−#define BNXT_RE_MIN_MSIX 2
111−#define BNXT_RE_MAX_MSIX 9
112110 #define BNXT_RE_AEQ_IDX 0
113111 #define BNXT_RE_NQ_IDX 1
114112 #define BNXT_RE_GEN_P5_MAX_VF 64
@@ -168,7 +166,7 @@ struct bnxt_re_dev { · 53 unmodified lines
168166 struct bnxt_qplib_rcfw rcfw;
169167
170168 /* NQ */
171− struct bnxt_qplib_nq nq[BNXT_RE_MAX_MSIX];
169+ struct bnxt_qplib_nq nq[BNXT_MAX_ROCE_MSIX];
172170
173171 /* Device Resources */
174172 struct bnxt_qplib_dev_attr dev_attr;
drivers/infiniband/hw/mana/mr.c+1−0
@@ -112,6 +112,7 @@ struct ib_mr *mana_ib_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length, · 111 unmodified lines
112112 "start 0x%llx, iova 0x%llx length 0x%llx access_flags 0x%x",
113113 start, iova, length, access_flags);
114114
115+ access_flags &= ~IB_ACCESS_OPTIONAL;
115116 if (access_flags & ~VALID_MR_FLAGS)
116117 return ERR_PTR(-EINVAL);
117118
drivers/infiniband/hw/mlx5/main.c+2−2
@@ -3759,10 +3759,10 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev) · 3758 unmodified lines
37593759 spin_lock_init(&dev->dm.lock);
37603760 dev->dm.dev = mdev;
37613761 return 0;
3762−err:
3763− mlx5r_macsec_dealloc_gids(dev);
37643762 err_mp:
37653763 mlx5_ib_cleanup_multiport_master(dev);
3764+err:
3765+ mlx5r_macsec_dealloc_gids(dev);
37663766 return err;
37673767 }
37683768
drivers/infiniband/hw/mlx5/mr.c+4−4
@@ -246,6 +246,7 @@ static void set_cache_mkc(struct mlx5_cache_ent *ent, void *mkc) · 245 unmodified lines
246246 MLX5_SET(mkc, mkc, access_mode_1_0, ent->rb_key.access_mode & 0x3);
247247 MLX5_SET(mkc, mkc, access_mode_4_2,
248248 (ent->rb_key.access_mode >> 2) & 0x7);
249+ MLX5_SET(mkc, mkc, ma_translation_mode, !!ent->rb_key.ats);
249250
250251 MLX5_SET(mkc, mkc, translations_octword_size,
251252 get_mkc_octo_size(ent->rb_key.access_mode,
@@ -641,10 +642,8 @@ static int mlx5_cache_ent_insert(struct mlx5_mkey_cache *cache, · 389 unmodified lines
641642 new = &((*new)->rb_left);
642643 if (cmp < 0)
643644 new = &((*new)->rb_right);
644− if (cmp == 0) {
645− mutex_unlock(&cache->rb_lock);
645+ if (cmp == 0)
646646 return -EEXIST;
647− }
648647 }
649648
650649 /* Add new node and rebalance tree. */
@@ -719,6 +718,8 @@ static struct mlx5_ib_mr *_mlx5_mr_cache_alloc(struct mlx5_ib_dev *dev, · 68 unmodified lines
719718 }
720719 mr->mmkey.cache_ent = ent;
721720 mr->mmkey.type = MLX5_MKEY_MR;
721+ mr->mmkey.rb_key = ent->rb_key;
722+ mr->mmkey.cacheable = true;
722723 init_waitqueue_head(&mr->mmkey.wait);
723724 return mr;
724725 }
@@ -1169,7 +1170,6 @@ static struct mlx5_ib_mr *alloc_cacheable_mr(struct ib_pd *pd, · 444 unmodified lines
11691170 mr->ibmr.pd = pd;
11701171 mr->umem = umem;
11711172 mr->page_shift = order_base_2(page_size);
1172− mr->mmkey.cacheable = true;
11731173 set_mr_fields(dev, mr, umem->length, access_flags, iova);
11741174
11751175 return mr;
drivers/infiniband/hw/mlx5/srq.c+8−5
@@ -199,17 +199,20 @@ int mlx5_ib_create_srq(struct ib_srq *ib_srq, · 198 unmodified lines
199199 int err;
200200 struct mlx5_srq_attr in = {};
201201 __u32 max_srq_wqes = 1 << MLX5_CAP_GEN(dev->mdev, log_max_srq_sz);
202+ __u32 max_sge_sz = MLX5_CAP_GEN(dev->mdev, max_wqe_sz_rq) /
203+ sizeof(struct mlx5_wqe_data_seg);
202204
203205 if (init_attr->srq_type != IB_SRQT_BASIC &&
204206 init_attr->srq_type != IB_SRQT_XRC &&
205207 init_attr->srq_type != IB_SRQT_TM)
206208 return -EOPNOTSUPP;
207209
208− /* Sanity check SRQ size before proceeding */
209− if (init_attr->attr.max_wr >= max_srq_wqes) {
210− mlx5_ib_dbg(dev, "max_wr %d, cap %d\n",
211− init_attr->attr.max_wr,
212− max_srq_wqes);
210+ /* Sanity check SRQ and sge size before proceeding */
211+ if (init_attr->attr.max_wr >= max_srq_wqes ||
212+ init_attr->attr.max_sge > max_sge_sz) {
213+ mlx5_ib_dbg(dev, "max_wr %d,wr_cap %d,max_sge %d, sge_cap:%d\n",
214+ init_attr->attr.max_wr, max_srq_wqes,
215+ init_attr->attr.max_sge, max_sge_sz);
213216 return -EINVAL;
214217 }
215218
drivers/infiniband/sw/rxe/rxe_resp.c+13−0
@@ -344,6 +344,19 @@ static enum resp_states rxe_resp_check_length(struct rxe_qp *qp, · 343 unmodified lines
344344 * receive buffer later. For rmda operations additional
345345 * length checks are performed in check_rkey.
346346 */
347+ if ((qp_type(qp) == IB_QPT_GSI) || (qp_type(qp) == IB_QPT_UD)) {
348+ unsigned int payload = payload_size(pkt);
349+ unsigned int recv_buffer_len = 0;
350+ int i;
351+
352+ for (i = 0; i < qp->resp.wqe->dma.num_sge; i++)
353+ recv_buffer_len += qp->resp.wqe->dma.sge[i].length;
354+ if (payload + 40 > recv_buffer_len) {
355+ rxe_dbg_qp(qp, "The receive buffer is too small for this UD packet.\n");
356+ return RESPST_ERR_LENGTH;
357+ }
358+ }
359+
347360 if (pkt->mask & RXE_PAYLOAD_MASK && ((qp_type(qp) == IB_QPT_RC) ||
348361 (qp_type(qp) == IB_QPT_UC))) {
349362 unsigned int mtu = qp->mtu;
drivers/infiniband/sw/rxe/rxe_verbs.c+1−1
@@ -812,7 +812,7 @@ static void copy_inline_data_to_wqe(struct rxe_send_wqe *wqe, · 811 unmodified lines
812812 int i;
813813
814814 for (i = 0; i < ibwr->num_sge; i++, sge++) {
815− memcpy(p, ib_virt_dma_to_page(sge->addr), sge->length);
815+ memcpy(p, ib_virt_dma_to_ptr(sge->addr), sge->length);
816816 p += sge->length;
817817 }
818818 }
drivers/mfd/axp20x.c+1−0
@@ -210,6 +210,7 @@ static const struct regmap_access_table axp313a_volatile_table = { · 209 unmodified lines
210210
211211 static const struct regmap_range axp717_writeable_ranges[] = {
212212 regmap_reg_range(AXP717_IRQ0_EN, AXP717_IRQ4_EN),
213+ regmap_reg_range(AXP717_IRQ0_STATE, AXP717_IRQ4_STATE),
213214 regmap_reg_range(AXP717_DCDC_OUTPUT_CONTROL, AXP717_CPUSLDO_CONTROL),
214215 };
215216
drivers/net/ethernet/broadcom/bnxt/bnxt.c+5−3
@@ -732,9 +732,6 @@ tx_done: · 731 unmodified lines
732732 return NETDEV_TX_OK;
733733
734734 tx_dma_error:
735− if (BNXT_TX_PTP_IS_SET(lflags))
736− atomic_inc(&bp->ptp_cfg->tx_avail);
737−
738735 last_frag = i;
739736
740737 /* start back at beginning and unmap skb */
@@ -756,6 +753,8 @@ tx_dma_error: · 15 unmodified lines
756753 tx_free:
757754 dev_kfree_skb_any(skb);
758755 tx_kick_pending:
756+ if (BNXT_TX_PTP_IS_SET(lflags))
757+ atomic_inc(&bp->ptp_cfg->tx_avail);
759758 if (txr->kick_pending)
760759 bnxt_txr_db_kick(bp, txr, txr->tx_prod);
761760 txr->tx_buf_ring[txr->tx_prod].skb = NULL;
@@ -8996,6 +8995,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) · 8234 unmodified lines
89968995 memcpy(vf->mac_addr, resp->mac_address, ETH_ALEN);
89978996 #endif
89988997 }
8998+ bp->tso_max_segs = le16_to_cpu(resp->max_tso_segs);
89998999
90009000 hwrm_func_qcaps_exit:
90019001 hwrm_req_drop(bp, req);
@@ -15363,6 +15363,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 6361 unmodified lines
1536315363 dev->priv_flags |= IFF_UNICAST_FLT;
1536415364
1536515365 netif_set_tso_max_size(dev, GSO_MAX_SIZE);
15366+ if (bp->tso_max_segs)
15367+ netif_set_tso_max_segs(dev, bp->tso_max_segs);
1536615368
1536715369 dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
1536815370 NETDEV_XDP_ACT_RX_SG;
drivers/net/ethernet/broadcom/bnxt/bnxt.h+1−0
@@ -2318,6 +2318,7 @@ struct bnxt { · 2317 unmodified lines
23182318 u8 rss_hash_key_updated:1;
23192319
23202320 u16 max_mtu;
2321+ u16 tso_max_segs;
23212322 u8 max_tc;
23222323 u8 max_lltc; /* lossless TCs */
23232324 struct bnxt_queue_info q_info[BNXT_MAX_QUEUE];
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h+178−133
@@ -2,7 +2,7 @@ · 1 unmodified line
22 *
33 * Copyright (c) 2014-2016 Broadcom Corporation
44 * Copyright (c) 2014-2018 Broadcom Limited
5− * Copyright (c) 2018-2023 Broadcom Inc.
5+ * Copyright (c) 2018-2024 Broadcom Inc.
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
@@ -500,7 +500,11 @@ struct cmd_nums { · 491 unmodified lines
500500 #define HWRM_TFC_IF_TBL_GET 0x399UL
501501 #define HWRM_TFC_TBL_SCOPE_CONFIG_GET 0x39aUL
502502 #define HWRM_TFC_RESC_USAGE_QUERY 0x39bUL
503+ #define HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS 0x39cUL
504+ #define HWRM_QUEUE_PFCWD_TIMEOUT_CFG 0x39dUL
505+ #define HWRM_QUEUE_PFCWD_TIMEOUT_QCFG 0x39eUL
503506 #define HWRM_SV 0x400UL
507+ #define HWRM_DBG_LOG_BUFFER_FLUSH 0xff0fUL
504508 #define HWRM_DBG_READ_DIRECT 0xff10UL
505509 #define HWRM_DBG_READ_INDIRECT 0xff11UL
506510 #define HWRM_DBG_WRITE_DIRECT 0xff12UL
@@ -609,8 +613,8 @@ struct hwrm_err_output { · 102 unmodified lines
609613 #define HWRM_VERSION_MAJOR 1
610614 #define HWRM_VERSION_MINOR 10
611615 #define HWRM_VERSION_UPDATE 3
612−#define HWRM_VERSION_RSVD 39
613−#define HWRM_VERSION_STR "1.10.3.39"
616+#define HWRM_VERSION_RSVD 44
617+#define HWRM_VERSION_STR "1.10.3.44"
614618
615619 /* hwrm_ver_get_input (size:192b/24B) */
616620 struct hwrm_ver_get_input {
@@ -664,6 +668,7 @@ struct hwrm_ver_get_output { · 47 unmodified lines
664668 #define VER_GET_RESP_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED 0x2000UL
665669 #define VER_GET_RESP_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED 0x4000UL
666670 #define VER_GET_RESP_DEV_CAPS_CFG_SECURE_BOOT_CAPABLE 0x8000UL
671+ #define VER_GET_RESP_DEV_CAPS_CFG_SECURE_SOC_CAPABLE 0x10000UL
667672 u8 roce_fw_maj_8b;
668673 u8 roce_fw_min_8b;
669674 u8 roce_fw_bld_8b;
@@ -843,7 +848,9 @@ struct hwrm_async_event_cmpl { · 173 unmodified lines
843848 #define ASYNC_EVENT_CMPL_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR 0x49UL
844849 #define ASYNC_EVENT_CMPL_EVENT_ID_CTX_ERROR 0x4aUL
845850 #define ASYNC_EVENT_CMPL_EVENT_ID_UDCC_SESSION_CHANGE 0x4bUL
846− #define ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID 0x4cUL
851+ #define ASYNC_EVENT_CMPL_EVENT_ID_DBG_BUF_PRODUCER 0x4cUL
852+ #define ASYNC_EVENT_CMPL_EVENT_ID_PEER_MMAP_CHANGE 0x4dUL
853+ #define ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID 0x4eUL
847854 #define ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG 0xfeUL
848855 #define ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR 0xffUL
849856 #define ASYNC_EVENT_CMPL_EVENT_ID_LAST ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
@@ -1326,13 +1333,13 @@ struct hwrm_async_event_cmpl_error_report_base { · 476 unmodified lines
13261333 u8 timestamp_lo;
13271334 __le16 timestamp_hi;
13281335 __le32 event_data1;
1329− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK 0xffUL
1330− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT 0
1331− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_RESERVED 0x0UL
1332− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM 0x1UL
1333− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL 0x2UL
1334− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM 0x3UL
1335− #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD 0x4UL
1336+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK 0xffUL
1337+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT 0
1338+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_RESERVED 0x0UL
1339+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM 0x1UL
1340+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL 0x2UL
1341+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM 0x3UL
1342+ #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD 0x4UL
13361343 #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD 0x5UL
13371344 #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED 0x6UL
13381345 #define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
@@ -1814,6 +1821,9 @@ struct hwrm_func_qcaps_output { · 475 unmodified lines
18141821 #define FUNC_QCAPS_RESP_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED 0x800000UL
18151822 #define FUNC_QCAPS_RESP_FLAGS_EXT2_TF_INGRESS_NIC_FLOW_SUPPORTED 0x1000000UL
18161823 #define FUNC_QCAPS_RESP_FLAGS_EXT2_LPBK_STATS_SUPPORTED 0x2000000UL
1824+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_TF_EGRESS_NIC_FLOW_SUPPORTED 0x4000000UL
1825+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_MULTI_LOSSLESS_QUEUES_SUPPORTED 0x8000000UL
1826+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_PEER_MMAP_SUPPORTED 0x10000000UL
18171827 __le16 tunnel_disable_flag;
18181828 #define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN 0x1UL
18191829 #define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_NGE 0x2UL
@@ -1828,7 +1838,7 @@ struct hwrm_func_qcaps_output { · 8 unmodified lines
18281838 #define FUNC_QCAPS_RESP_XID_PARTITION_CAP_RX_CK 0x2UL
18291839 u8 device_serial_number[8];
18301840 __le16 ctxs_per_partition;
1831− u8 unused_2[2];
1841+ __le16 max_tso_segs;
18321842 __le32 roce_vf_max_av;
18331843 __le32 roce_vf_max_cq;
18341844 __le32 roce_vf_max_mrw;
@@ -2449,6 +2459,7 @@ struct hwrm_func_drv_rgtr_input { · 614 unmodified lines
24492459 #define FUNC_DRV_RGTR_REQ_FLAGS_NPAR_1_2_SUPPORT 0x200UL
24502460 #define FUNC_DRV_RGTR_REQ_FLAGS_ASYM_QUEUE_CFG_SUPPORT 0x400UL
24512461 #define FUNC_DRV_RGTR_REQ_FLAGS_TF_INGRESS_NIC_FLOW_MODE 0x800UL
2462+ #define FUNC_DRV_RGTR_REQ_FLAGS_TF_EGRESS_NIC_FLOW_MODE 0x1000UL
24522463 __le32 enables;
24532464 #define FUNC_DRV_RGTR_REQ_ENABLES_OS_TYPE 0x1UL
24542465 #define FUNC_DRV_RGTR_REQ_ENABLES_VER 0x2UL
@@ -3660,22 +3671,24 @@ struct hwrm_func_backing_store_cfg_v2_input { · 1205 unmodified lines
36603671 __le16 target_id;
36613672 __le64 resp_addr;
36623673 __le16 type;
3663− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_QP 0x0UL
3664− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRQ 0x1UL
3665− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CQ 0x2UL
3666− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_VNIC 0x3UL
3667− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_STAT 0x4UL
3668− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SP_TQM_RING 0x5UL
3669− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_FP_TQM_RING 0x6UL
3670− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_MRAV 0xeUL
3671− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TIM 0xfUL
3672− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_MP_TQM_RING 0x15UL
3673− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
3674− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
3675− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
3676− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
3677− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
3678− #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_XID_PARTITION 0x1dUL
3674+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_QP 0x0UL
3675+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRQ 0x1UL
3676+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CQ 0x2UL
3677+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_VNIC 0x3UL
3678+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_STAT 0x4UL
3679+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SP_TQM_RING 0x5UL
3680+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_FP_TQM_RING 0x6UL
3681+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_MRAV 0xeUL
3682+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TIM 0xfUL
3683+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TX_CK 0x13UL
3684+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_RX_CK 0x14UL
3685+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_MP_TQM_RING 0x15UL
3686+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
3687+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
3688+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
3689+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
3690+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
3691+ #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_XID_PARTITION 0x1dUL
36793692 #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRT_TRACE 0x1eUL
36803693 #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRT2_TRACE 0x1fUL
36813694 #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CRT_TRACE 0x20UL
@@ -3772,18 +3785,20 @@ struct hwrm_func_backing_store_qcfg_v2_output { · 90 unmodified lines
37723785 __le16 seq_id;
37733786 __le16 resp_len;
37743787 __le16 type;
3775− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QP 0x0UL
3776− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRQ 0x1UL
3777− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CQ 0x2UL
3778− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_VNIC 0x3UL
3779− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_STAT 0x4UL
3780− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SP_TQM_RING 0x5UL
3781− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_FP_TQM_RING 0x6UL
3782− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MRAV 0xeUL
3783− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TIM 0xfUL
3784− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MP_TQM_RING 0x15UL
3785− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TBL_SCOPE 0x1cUL
3786− #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_XID_PARTITION 0x1dUL
3788+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QP 0x0UL
3789+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRQ 0x1UL
3790+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CQ 0x2UL
3791+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_VNIC 0x3UL
3792+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_STAT 0x4UL
3793+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SP_TQM_RING 0x5UL
3794+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_FP_TQM_RING 0x6UL
3795+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MRAV 0xeUL
3796+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TIM 0xfUL
3797+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TX_CK 0x13UL
3798+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_RX_CK 0x14UL
3799+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MP_TQM_RING 0x15UL
3800+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TBL_SCOPE 0x1cUL
3801+ #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_XID_PARTITION 0x1dUL
37873802 #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRT_TRACE 0x1eUL
37883803 #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRT2_TRACE 0x1fUL
37893804 #define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CRT_TRACE 0x20UL
@@ -3876,22 +3891,24 @@ struct hwrm_func_backing_store_qcaps_v2_input { · 86 unmodified lines
38763891 __le16 target_id;
38773892 __le64 resp_addr;
38783893 __le16 type;
3879− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QP 0x0UL
3880− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRQ 0x1UL
3881− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ 0x2UL
3882− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_VNIC 0x3UL
3883− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_STAT 0x4UL
3884− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SP_TQM_RING 0x5UL
3885− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_FP_TQM_RING 0x6UL
3886− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MRAV 0xeUL
3887− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TIM 0xfUL
3888− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MP_TQM_RING 0x15UL
3889− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
3890− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
3891− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
3892− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
3893− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
3894− #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_XID_PARTITION 0x1dUL
3894+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QP 0x0UL
3895+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRQ 0x1UL
3896+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ 0x2UL
3897+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_VNIC 0x3UL
3898+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_STAT 0x4UL
3899+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SP_TQM_RING 0x5UL
3900+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_FP_TQM_RING 0x6UL
3901+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MRAV 0xeUL
3902+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TIM 0xfUL
3903+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TX_CK 0x13UL
3904+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_RX_CK 0x14UL
3905+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MP_TQM_RING 0x15UL
3906+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
3907+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
3908+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
3909+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
3910+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
3911+ #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_XID_PARTITION 0x1dUL
38953912 #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRT_TRACE 0x1eUL
38963913 #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRT2_TRACE 0x1fUL
38973914 #define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CRT_TRACE 0x20UL
@@ -3911,22 +3928,24 @@ struct hwrm_func_backing_store_qcaps_v2_output { · 13 unmodified lines
39113928 __le16 seq_id;
39123929 __le16 resp_len;
39133930 __le16 type;
3914− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_QP 0x0UL
3915− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRQ 0x1UL
3916− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CQ 0x2UL
3917− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_VNIC 0x3UL
3918− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_STAT 0x4UL
3919− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SP_TQM_RING 0x5UL
3920− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_FP_TQM_RING 0x6UL
3921− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_MRAV 0xeUL
3922− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TIM 0xfUL
3923− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_MP_TQM_RING 0x15UL
3924− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SQ_DB_SHADOW 0x16UL
3925− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_RQ_DB_SHADOW 0x17UL
3926− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRQ_DB_SHADOW 0x18UL
3927− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CQ_DB_SHADOW 0x19UL
3928− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TBL_SCOPE 0x1cUL
3929− #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_XID_PARTITION 0x1dUL
3931+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_QP 0x0UL
3932+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRQ 0x1UL
3933+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CQ 0x2UL
3934+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_VNIC 0x3UL
3935+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_STAT 0x4UL
3936+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SP_TQM_RING 0x5UL
3937+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_FP_TQM_RING 0x6UL
3938+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_MRAV 0xeUL
3939+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TIM 0xfUL
3940+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TX_CK 0x13UL
3941+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_RX_CK 0x14UL
3942+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_MP_TQM_RING 0x15UL
3943+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SQ_DB_SHADOW 0x16UL
3944+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_RQ_DB_SHADOW 0x17UL
3945+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRQ_DB_SHADOW 0x18UL
3946+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CQ_DB_SHADOW 0x19UL
3947+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TBL_SCOPE 0x1cUL
3948+ #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_XID_PARTITION 0x1dUL
39303949 #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRT_TRACE 0x1eUL
39313950 #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRT2_TRACE 0x1fUL
39323951 #define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CRT_TRACE 0x20UL
@@ -4202,7 +4221,8 @@ struct hwrm_port_phy_cfg_input { · 269 unmodified lines
42024221 #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_100GB_PAM4_112 0x3eaUL
42034222 #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_200GB_PAM4_112 0x7d2UL
42044223 #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_400GB_PAM4_112 0xfa2UL
4205− #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_LAST PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_400GB_PAM4_112
4224+ #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_800GB_PAM4_112 0x1f42UL
4225+ #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_LAST PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_800GB_PAM4_112
42064226 __le16 auto_link_speeds2_mask;
42074227 #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEEDS2_MASK_1GB 0x1UL
42084228 #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEEDS2_MASK_10GB 0x2UL
@@ -4217,6 +4237,7 @@ struct hwrm_port_phy_cfg_input { · 8 unmodified lines
42174237 #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEEDS2_MASK_100GB_PAM4_112 0x400UL
42184238 #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEEDS2_MASK_200GB_PAM4_112 0x800UL
42194239 #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEEDS2_MASK_400GB_PAM4_112 0x1000UL
4240+ #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEEDS2_MASK_800GB_PAM4_112 0x2000UL
42204241 u8 unused_2[6];
42214242 };
42224243
@@ -4292,6 +4313,7 @@ struct hwrm_port_phy_qcfg_output { · 69 unmodified lines
42924313 #define PORT_PHY_QCFG_RESP_LINK_SPEED_100GB 0x3e8UL
42934314 #define PORT_PHY_QCFG_RESP_LINK_SPEED_200GB 0x7d0UL
42944315 #define PORT_PHY_QCFG_RESP_LINK_SPEED_400GB 0xfa0UL
4316+ #define PORT_PHY_QCFG_RESP_LINK_SPEED_800GB 0x1f40UL
42954317 #define PORT_PHY_QCFG_RESP_LINK_SPEED_10MB 0xffffUL
42964318 #define PORT_PHY_QCFG_RESP_LINK_SPEED_LAST PORT_PHY_QCFG_RESP_LINK_SPEED_10MB
42974319 u8 duplex_cfg;
@@ -4451,7 +4473,13 @@ struct hwrm_port_phy_qcfg_output { · 153 unmodified lines
44514473 #define PORT_PHY_QCFG_RESP_PHY_TYPE_400G_BASESR4 0x35UL
44524474 #define PORT_PHY_QCFG_RESP_PHY_TYPE_400G_BASELR4 0x36UL
44534475 #define PORT_PHY_QCFG_RESP_PHY_TYPE_400G_BASEER4 0x37UL
4454− #define PORT_PHY_QCFG_RESP_PHY_TYPE_LAST PORT_PHY_QCFG_RESP_PHY_TYPE_400G_BASEER4
4476+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASECR8 0x38UL
4477+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASESR8 0x39UL
4478+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASELR8 0x3aUL
4479+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASEER8 0x3bUL
4480+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASEFR8 0x3cUL
4481+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASEDR8 0x3dUL
4482+ #define PORT_PHY_QCFG_RESP_PHY_TYPE_LAST PORT_PHY_QCFG_RESP_PHY_TYPE_800G_BASEDR8
44554483 u8 media_type;
44564484 #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_UNKNOWN 0x0UL
44574485 #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP 0x1UL
@@ -5049,33 +5077,43 @@ struct hwrm_port_qstats_ext_output { · 591 unmodified lines
50495077 u8 valid;
50505078 };
50515079
5052−/* hwrm_port_lpbk_qstats_input (size:128b/16B) */
5080+/* hwrm_port_lpbk_qstats_input (size:256b/32B) */
50535081 struct hwrm_port_lpbk_qstats_input {
50545082 __le16 req_type;
50555083 __le16 cmpl_ring;
50565084 __le16 seq_id;
50575085 __le16 target_id;
50585086 __le64 resp_addr;
5087+ __le16 lpbk_stat_size;
5088+ u8 flags;
5089+ #define PORT_LPBK_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
5090+ u8 unused_0[5];
5091+ __le64 lpbk_stat_host_addr;
50595092 };
50605093
5061−/* hwrm_port_lpbk_qstats_output (size:768b/96B) */
5094+/* hwrm_port_lpbk_qstats_output (size:128b/16B) */
50625095 struct hwrm_port_lpbk_qstats_output {
50635096 __le16 error_code;
50645097 __le16 req_type;
50655098 __le16 seq_id;
50665099 __le16 resp_len;
5100+ __le16 lpbk_stat_size;
5101+ u8 unused_0[5];
5102+ u8 valid;
5103+};
5104+
5105+/* port_lpbk_stats (size:640b/80B) */
5106+struct port_lpbk_stats {
50675107 __le64 lpbk_ucast_frames;
50685108 __le64 lpbk_mcast_frames;
50695109 __le64 lpbk_bcast_frames;
50705110 __le64 lpbk_ucast_bytes;
50715111 __le64 lpbk_mcast_bytes;
50725112 __le64 lpbk_bcast_bytes;
5073− __le64 tx_stat_discard;
5074− __le64 tx_stat_error;
5075− __le64 rx_stat_discard;
5076− __le64 rx_stat_error;
5077− u8 unused_0[7];
5078− u8 valid;
5113+ __le64 lpbk_tx_discards;
5114+ __le64 lpbk_tx_errors;
5115+ __le64 lpbk_rx_discards;
5116+ __le64 lpbk_rx_errors;
50795117 };
50805118
50815119 /* hwrm_port_ecn_qstats_input (size:256b/32B) */
@@ -5140,13 +5178,15 @@ struct hwrm_port_clr_stats_output { · 58 unmodified lines
51405178 u8 valid;
51415179 };
51425180
5143−/* hwrm_port_lpbk_clr_stats_input (size:128b/16B) */
5181+/* hwrm_port_lpbk_clr_stats_input (size:192b/24B) */
51445182 struct hwrm_port_lpbk_clr_stats_input {
51455183 __le16 req_type;
51465184 __le16 cmpl_ring;
51475185 __le16 seq_id;
51485186 __le16 target_id;
51495187 __le64 resp_addr;
5188+ __le16 port_id;
5189+ u8 unused_0[6];
51505190 };
51515191
51525192 /* hwrm_port_lpbk_clr_stats_output (size:128b/16B) */
@@ -5287,10 +5327,11 @@ struct hwrm_port_phy_qcaps_output { · 134 unmodified lines
52875327 #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G 0x2UL
52885328 #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G 0x4UL
52895329 __le16 flags2;
5290− #define PORT_PHY_QCAPS_RESP_FLAGS2_PAUSE_UNSUPPORTED 0x1UL
5291− #define PORT_PHY_QCAPS_RESP_FLAGS2_PFC_UNSUPPORTED 0x2UL
5292− #define PORT_PHY_QCAPS_RESP_FLAGS2_BANK_ADDR_SUPPORTED 0x4UL
5293− #define PORT_PHY_QCAPS_RESP_FLAGS2_SPEEDS2_SUPPORTED 0x8UL
5330+ #define PORT_PHY_QCAPS_RESP_FLAGS2_PAUSE_UNSUPPORTED 0x1UL
5331+ #define PORT_PHY_QCAPS_RESP_FLAGS2_PFC_UNSUPPORTED 0x2UL
5332+ #define PORT_PHY_QCAPS_RESP_FLAGS2_BANK_ADDR_SUPPORTED 0x4UL
5333+ #define PORT_PHY_QCAPS_RESP_FLAGS2_SPEEDS2_SUPPORTED 0x8UL
5334+ #define PORT_PHY_QCAPS_RESP_FLAGS2_REMOTE_LPBK_UNSUPPORTED 0x10UL
52945335 u8 internal_port_cnt;
52955336 u8 unused_0;
52965337 __le16 supported_speeds2_force_mode;
@@ -7443,17 +7484,17 @@ struct hwrm_cfa_l2_filter_cfg_input { · 2146 unmodified lines
74437484 __le16 target_id;
74447485 __le64 resp_addr;
74457486 __le32 flags;
7446− #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH 0x1UL
7447− #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_TX 0x0UL
7448− #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX 0x1UL
7449− #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_LAST CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX
7450− #define CFA_L2_FILTER_CFG_REQ_FLAGS_DROP 0x2UL
7451− #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_MASK 0xcUL
7452− #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_SFT 2
7453− #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_NO_ROCE_L2 (0x0UL << 2)
7454− #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_L2 (0x1UL << 2)
7455− #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_ROCE (0x2UL << 2)
7456− #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_LAST CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_ROCE
7487+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH 0x1UL
7488+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_TX 0x0UL
7489+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX 0x1UL
7490+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_LAST CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX
7491+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_DROP 0x2UL
7492+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_MASK 0xcUL
7493+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_SFT 2
7494+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_NO_ROCE_L2 (0x0UL << 2)
7495+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_L2 (0x1UL << 2)
7496+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_ROCE (0x2UL << 2)
7497+ #define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_LAST CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_ROCE
74577498 #define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_MASK 0x30UL
74587499 #define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_SFT 4
74597500 #define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_NO_UPDATE (0x0UL << 4)
@@ -8520,17 +8561,17 @@ struct hwrm_tunnel_dst_port_query_input { · 1060 unmodified lines
85208561 __le16 target_id;
85218562 __le64 resp_addr;
85228563 u8 tunnel_type;
8523− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN 0x1UL
8524− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GENEVE 0x5UL
8525− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_V4 0x9UL
8526− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
8527− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
8528− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8529− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8530− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8531− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_SRV6 0xfUL
8532− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
8533− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GRE 0x11UL
8564+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN 0x1UL
8565+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GENEVE 0x5UL
8566+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_V4 0x9UL
8567+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
8568+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
8569+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8570+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8571+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8572+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_SRV6 0xfUL
8573+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
8574+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GRE 0x11UL
85348575 #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR 0x12UL
85358576 #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 0x13UL
85368577 #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 0x14UL
@@ -8576,17 +8617,17 @@ struct hwrm_tunnel_dst_port_alloc_input { · 39 unmodified lines
85768617 __le16 target_id;
85778618 __le64 resp_addr;
85788619 u8 tunnel_type;
8579− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN 0x1UL
8580− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE 0x5UL
8581− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_V4 0x9UL
8582− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
8583− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
8584− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8585− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8586− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8587− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_SRV6 0xfUL
8588− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
8589− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GRE 0x11UL
8620+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN 0x1UL
8621+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE 0x5UL
8622+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_V4 0x9UL
8623+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
8624+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
8625+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8626+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8627+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8628+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_SRV6 0xfUL
8629+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
8630+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GRE 0x11UL
85908631 #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR 0x12UL
85918632 #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 0x13UL
85928633 #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 0x14UL
@@ -8635,17 +8676,17 @@ struct hwrm_tunnel_dst_port_free_input { · 42 unmodified lines
86358676 __le16 target_id;
86368677 __le64 resp_addr;
86378678 u8 tunnel_type;
8638− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN 0x1UL
8639− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE 0x5UL
8640− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_V4 0x9UL
8641− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
8642− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
8643− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8644− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8645− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8646− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_SRV6 0xfUL
8647− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
8648− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GRE 0x11UL
8679+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN 0x1UL
8680+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE 0x5UL
8681+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_V4 0x9UL
8682+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
8683+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
8684+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8685+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8686+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8687+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_SRV6 0xfUL
8688+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
8689+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GRE 0x11UL
86498690 #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR 0x12UL
86508691 #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 0x13UL
86518692 #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 0x14UL
@@ -9109,6 +9150,7 @@ struct hwrm_struct_hdr { · 457 unmodified lines
91099150 #define STRUCT_HDR_STRUCT_ID_LLDP_GENERIC 0x424UL
91109151 #define STRUCT_HDR_STRUCT_ID_LLDP_DEVICE 0x426UL
91119152 #define STRUCT_HDR_STRUCT_ID_POWER_BKUP 0x427UL
9153+ #define STRUCT_HDR_STRUCT_ID_PEER_MMAP 0x429UL
91129154 #define STRUCT_HDR_STRUCT_ID_AFM_OPAQUE 0x1UL
91139155 #define STRUCT_HDR_STRUCT_ID_PORT_DESCRIPTION 0xaUL
91149156 #define STRUCT_HDR_STRUCT_ID_RSS_V2 0x64UL
@@ -9758,6 +9800,9 @@ struct hwrm_dbg_coredump_initiate_input { · 643 unmodified lines
97589800 __le16 instance;
97599801 __le16 unused_0;
97609802 u8 seg_flags;
9803+ #define DBG_COREDUMP_INITIATE_REQ_SEG_FLAGS_LIVE_DATA 0x1UL
9804+ #define DBG_COREDUMP_INITIATE_REQ_SEG_FLAGS_CRASH_DATA 0x2UL
9805+ #define DBG_COREDUMP_INITIATE_REQ_SEG_FLAGS_COLLECT_CTX_L1_CACHE 0x4UL
97619806 u8 unused_1[7];
97629807 };
97639808
@@ -10433,13 +10478,13 @@ struct hwrm_selftest_irq_output { · 669 unmodified lines
1043310478
1043410479 /* dbc_dbc (size:64b/8B) */
1043510480 struct dbc_dbc {
10436− u32 index;
10481+ __le32 index;
1043710482 #define DBC_DBC_INDEX_MASK 0xffffffUL
1043810483 #define DBC_DBC_INDEX_SFT 0
1043910484 #define DBC_DBC_EPOCH 0x1000000UL
1044010485 #define DBC_DBC_TOGGLE_MASK 0x6000000UL
1044110486 #define DBC_DBC_TOGGLE_SFT 25
10442− u32 type_path_xid;
10487+ __le32 type_path_xid;
1044310488 #define DBC_DBC_XID_MASK 0xfffffUL
1044410489 #define DBC_DBC_XID_SFT 0
1044510490 #define DBC_DBC_PATH_MASK 0x3000000UL
drivers/net/ethernet/intel/ice/ice_ddp.c+21−2
@@ -1339,6 +1339,7 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start, · 1338 unmodified lines
13391339
13401340 for (i = 0; i < count; i++) {
13411341 bool last = false;
1342+ int try_cnt = 0;
13421343 int status;
13431344
13441345 bh = (struct ice_buf_hdr *)(bufs + start + i);
@@ -1346,8 +1347,26 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start, · 1 unmodified line
13461347 if (indicate_last)
13471348 last = ice_is_last_download_buffer(bh, i, count);
13481349
1349− status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE, last,
1350− &offset, &info, NULL);
1350+ while (1) {
1351+ status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE,
1352+ last, &offset, &info,
1353+ NULL);
1354+ if (hw->adminq.sq_last_status != ICE_AQ_RC_ENOSEC &&
1355+ hw->adminq.sq_last_status != ICE_AQ_RC_EBADSIG)
1356+ break;
1357+
1358+ try_cnt++;
1359+
1360+ if (try_cnt == 5)
1361+ break;
1362+
1363+ msleep(20);
1364+ }
1365+
1366+ if (try_cnt)
1367+ dev_dbg(ice_hw_to_dev(hw),
1368+ "ice_aq_download_pkg number of retries: %d\n",
1369+ try_cnt);
13511370
13521371 /* Save AQ status from download package */
13531372 if (status) {
drivers/net/ethernet/intel/ice/ice_main.c+9−1
@@ -805,6 +805,9 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup) · 804 unmodified lines
805805 }
806806
807807 switch (vsi->port_info->phy.link_info.link_speed) {
808+ case ICE_AQ_LINK_SPEED_200GB:
809+ speed = "200 G";
810+ break;
808811 case ICE_AQ_LINK_SPEED_100GB:
809812 speed = "100 G";
810813 break;
@@ -5564,7 +5567,7 @@ static int ice_suspend(struct device *dev) · 4753 unmodified lines
55645567 */
55655568 disabled = ice_service_task_stop(pf);
55665569
5567− ice_unplug_aux_dev(pf);
5570+ ice_deinit_rdma(pf);
55685571
55695572 /* Already suspended?, then there is nothing to do */
55705573 if (test_and_set_bit(ICE_SUSPENDED, pf->state)) {
@@ -5644,6 +5647,11 @@ static int ice_resume(struct device *dev) · 73 unmodified lines
56445647 if (ret)
56455648 dev_err(dev, "Cannot restore interrupt scheme: %d\n", ret);
56465649
5650+ ret = ice_init_rdma(pf);
5651+ if (ret)
5652+ dev_err(dev, "Reinitialize RDMA during resume failed: %d\n",
5653+ ret);
5654+
56475655 clear_bit(ICE_DOWN, pf->state);
56485656 /* Now perform PF reset and rebuild */
56495657 reset_type = ICE_RESET_PFR;
drivers/net/ethernet/intel/ice/ice_switch.c+4−2
@@ -1899,7 +1899,8 @@ ice_aq_alloc_free_vsi_list(struct ice_hw *hw, u16 *vsi_list_id, · 1898 unmodified lines
18991899 lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC ||
19001900 lkup_type == ICE_SW_LKUP_PROMISC ||
19011901 lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
1902− lkup_type == ICE_SW_LKUP_DFLT) {
1902+ lkup_type == ICE_SW_LKUP_DFLT ||
1903+ lkup_type == ICE_SW_LKUP_LAST) {
19031904 sw_buf->res_type = cpu_to_le16(ICE_AQC_RES_TYPE_VSI_LIST_REP);
19041905 } else if (lkup_type == ICE_SW_LKUP_VLAN) {
19051906 if (opc == ice_aqc_opc_alloc_res)
@@ -2922,7 +2923,8 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi, · 1016 unmodified lines
29222923 lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC ||
29232924 lkup_type == ICE_SW_LKUP_PROMISC ||
29242925 lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
2925− lkup_type == ICE_SW_LKUP_DFLT)
2926+ lkup_type == ICE_SW_LKUP_DFLT ||
2927+ lkup_type == ICE_SW_LKUP_LAST)
29262928 rule_type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR :
29272929 ICE_AQC_SW_RULES_T_VSI_LIST_SET;
29282930 else if (lkup_type == ICE_SW_LKUP_VLAN)
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+4−1
@@ -4014,7 +4014,10 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi, · 4013 unmodified lines
40144014 }
40154015 }
40164016
4017− skb = build_skb(data, frag_size);
4017+ if (frag_size)
4018+ skb = build_skb(data, frag_size);
4019+ else
4020+ skb = slab_build_skb(data);
40184021 if (!skb) {
40194022 netdev_warn(port->dev, "skb build failed\n");
40204023 goto err_drop_frame;
drivers/net/ethernet/marvell/octeontx2/nic/Makefile+1−2
@@ -9,10 +9,9 @@ obj-$(CONFIG_OCTEONTX2_VF) += rvu_nicvf.o otx2_ptp.o · 8 unmodified lines
99 rvu_nicpf-y := otx2_pf.o otx2_common.o otx2_txrx.o otx2_ethtool.o \
1010 otx2_flows.o otx2_tc.o cn10k.o otx2_dmac_flt.o \
1111 otx2_devlink.o qos_sq.o qos.o
12−rvu_nicvf-y := otx2_vf.o otx2_devlink.o
12+rvu_nicvf-y := otx2_vf.o
1313
1414 rvu_nicpf-$(CONFIG_DCB) += otx2_dcbnl.o
15−rvu_nicvf-$(CONFIG_DCB) += otx2_dcbnl.o
1615 rvu_nicpf-$(CONFIG_MACSEC) += cn10k_macsec.o
1716
1817 ccflags-y += -I$(srctree)/drivers/net/ethernet/marvell/octeontx2/af
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c+7−0
@@ -54,6 +54,7 @@ int otx2_pfc_txschq_config(struct otx2_nic *pfvf) · 53 unmodified lines
5454
5555 return 0;
5656 }
57+EXPORT_SYMBOL(otx2_pfc_txschq_config);
5758
5859 static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio)
5960 {
@@ -122,6 +123,7 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf) · 62 unmodified lines
122123
123124 return 0;
124125 }
126+EXPORT_SYMBOL(otx2_pfc_txschq_alloc);
125127
126128 static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio)
127129 {
@@ -260,6 +262,7 @@ update_sq_smq_map: · 132 unmodified lines
260262
261263 return 0;
262264 }
265+EXPORT_SYMBOL(otx2_pfc_txschq_update);
263266
264267 int otx2_pfc_txschq_stop(struct otx2_nic *pfvf)
265268 {
@@ -282,6 +285,7 @@ int otx2_pfc_txschq_stop(struct otx2_nic *pfvf) · 16 unmodified lines
282285
283286 return 0;
284287 }
288+EXPORT_SYMBOL(otx2_pfc_txschq_stop);
285289
286290 int otx2_config_priority_flow_ctrl(struct otx2_nic *pfvf)
287291 {
@@ -321,6 +325,7 @@ unlock: · 33 unmodified lines
321325 mutex_unlock(&pfvf->mbox.lock);
322326 return err;
323327 }
328+EXPORT_SYMBOL(otx2_config_priority_flow_ctrl);
324329
325330 void otx2_update_bpid_in_rqctx(struct otx2_nic *pfvf, int vlan_prio, int qidx,
326331 bool pfc_enable)
@@ -385,6 +390,7 @@ out: · 58 unmodified lines
385390 "Updating BPIDs in CQ and Aura contexts of RQ%d failed with err %d\n",
386391 qidx, err);
387392 }
393+EXPORT_SYMBOL(otx2_update_bpid_in_rqctx);
388394
389395 static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc)
390396 {
@@ -472,3 +478,4 @@ int otx2_dcbnl_set_ops(struct net_device *dev) · 81 unmodified lines
472478
473479 return 0;
474480 }
481+EXPORT_SYMBOL(otx2_dcbnl_set_ops);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c+2−0
@@ -113,6 +113,7 @@ err_dl: · 112 unmodified lines
113113 devlink_free(dl);
114114 return err;
115115 }
116+EXPORT_SYMBOL(otx2_register_dl);
116117
117118 void otx2_unregister_dl(struct otx2_nic *pfvf)
118119 {
@@ -124,3 +125,4 @@ void otx2_unregister_dl(struct otx2_nic *pfvf) · 5 unmodified lines
124125 ARRAY_SIZE(otx2_dl_params));
125126 devlink_free(dl);
126127 }
128+EXPORT_SYMBOL(otx2_unregister_dl);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c+4−1
@@ -1174,8 +1174,11 @@ bool otx2_sq_append_skb(struct net_device *netdev, struct otx2_snd_queue *sq, · 1173 unmodified lines
11741174
11751175 if (skb_shinfo(skb)->gso_size && !is_hw_tso_supported(pfvf, skb)) {
11761176 /* Insert vlan tag before giving pkt to tso */
1177− if (skb_vlan_tag_present(skb))
1177+ if (skb_vlan_tag_present(skb)) {
11781178 skb = __vlan_hwaccel_push_inside(skb);
1179+ if (!skb)
1180+ return true;
1181+ }
11791182 otx2_sq_append_tso(pfvf, sq, skb, qidx);
11801183 return true;
11811184 }
drivers/net/ethernet/microchip/lan743x_ethtool.c+40−4
@@ -1127,8 +1127,12 @@ static void lan743x_ethtool_get_wol(struct net_device *netdev, · 1126 unmodified lines
11271127 if (netdev->phydev)
11281128 phy_ethtool_get_wol(netdev->phydev, wol);
11291129
1130− wol->supported |= WAKE_BCAST | WAKE_UCAST | WAKE_MCAST |
1131− WAKE_MAGIC | WAKE_PHY | WAKE_ARP;
1130+ if (wol->supported != adapter->phy_wol_supported)
1131+ netif_warn(adapter, drv, adapter->netdev,
1132+ "PHY changed its supported WOL! old=%x, new=%x\n",
1133+ adapter->phy_wol_supported, wol->supported);
1134+
1135+ wol->supported |= MAC_SUPPORTED_WAKES;
11321136
11331137 if (adapter->is_pci11x1x)
11341138 wol->supported |= WAKE_MAGICSECURE;
@@ -1143,7 +1147,39 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev, · 8 unmodified lines
11431147 {
11441148 struct lan743x_adapter *adapter = netdev_priv(netdev);
11451149
1150+ /* WAKE_MAGICSEGURE is a modifier of and only valid together with
1151+ * WAKE_MAGIC
1152+ */
1153+ if ((wol->wolopts & WAKE_MAGICSECURE) && !(wol->wolopts & WAKE_MAGIC))
1154+ return -EINVAL;
1155+
1156+ if (netdev->phydev) {
1157+ struct ethtool_wolinfo phy_wol;
1158+ int ret;
1159+
1160+ phy_wol.wolopts = wol->wolopts & adapter->phy_wol_supported;
1161+
1162+ /* If WAKE_MAGICSECURE was requested, filter out WAKE_MAGIC
1163+ * for PHYs that do not support WAKE_MAGICSECURE
1164+ */
1165+ if (wol->wolopts & WAKE_MAGICSECURE &&
1166+ !(adapter->phy_wol_supported & WAKE_MAGICSECURE))
1167+ phy_wol.wolopts &= ~WAKE_MAGIC;
1168+
1169+ ret = phy_ethtool_set_wol(netdev->phydev, &phy_wol);
1170+ if (ret && (ret != -EOPNOTSUPP))
1171+ return ret;
1172+
1173+ if (ret == -EOPNOTSUPP)
1174+ adapter->phy_wolopts = 0;
1175+ else
1176+ adapter->phy_wolopts = phy_wol.wolopts;
1177+ } else {
1178+ adapter->phy_wolopts = 0;
1179+ }
1180+
11461181 adapter->wolopts = 0;
1182+ wol->wolopts &= ~adapter->phy_wolopts;
11471183 if (wol->wolopts & WAKE_UCAST)
11481184 adapter->wolopts |= WAKE_UCAST;
11491185 if (wol->wolopts & WAKE_MCAST)
@@ -1164,10 +1200,10 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev, · 14 unmodified lines
11641200 memset(adapter->sopass, 0, sizeof(u8) * SOPASS_MAX);
11651201 }
11661202
1203+ wol->wolopts = adapter->wolopts | adapter->phy_wolopts;
11671204 device_set_wakeup_enable(&adapter->pdev->dev, (bool)wol->wolopts);
11681205
1169− return netdev->phydev ? phy_ethtool_set_wol(netdev->phydev, wol)
1170− : -ENETDOWN;
1206+ return 0;
11711207 }
11721208 #endif /* CONFIG_PM */
11731209
drivers/net/ethernet/microchip/lan743x_main.c+40−8
@@ -3118,6 +3118,17 @@ static int lan743x_netdev_open(struct net_device *netdev) · 3117 unmodified lines
31183118 if (ret)
31193119 goto close_tx;
31203120 }
3121+
3122+#ifdef CONFIG_PM
3123+ if (adapter->netdev->phydev) {
3124+ struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
3125+
3126+ phy_ethtool_get_wol(netdev->phydev, &wol);
3127+ adapter->phy_wol_supported = wol.supported;
3128+ adapter->phy_wolopts = wol.wolopts;
3129+ }
3130+#endif
3131+
31213132 return 0;
31223133
31233134 close_tx:
@@ -3575,7 +3586,7 @@ static void lan743x_pm_set_wol(struct lan743x_adapter *adapter) · 451 unmodified lines
35753586
35763587 /* clear wake settings */
35773588 pmtctl = lan743x_csr_read(adapter, PMT_CTL);
3578− pmtctl |= PMT_CTL_WUPS_MASK_;
3589+ pmtctl |= PMT_CTL_WUPS_MASK_ | PMT_CTL_RES_CLR_WKP_MASK_;
35793590 pmtctl &= ~(PMT_CTL_GPIO_WAKEUP_EN_ | PMT_CTL_EEE_WAKEUP_EN_ |
35803591 PMT_CTL_WOL_EN_ | PMT_CTL_MAC_D3_RX_CLK_OVR_ |
35813592 PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_ | PMT_CTL_ETH_PHY_WAKE_EN_);
@@ -3587,10 +3598,9 @@ static void lan743x_pm_set_wol(struct lan743x_adapter *adapter) · 5 unmodified lines
35873598
35883599 pmtctl |= PMT_CTL_ETH_PHY_D3_COLD_OVR_ | PMT_CTL_ETH_PHY_D3_OVR_;
35893600
3590− if (adapter->wolopts & WAKE_PHY) {
3591− pmtctl |= PMT_CTL_ETH_PHY_EDPD_PLL_CTL_;
3601+ if (adapter->phy_wolopts)
35923602 pmtctl |= PMT_CTL_ETH_PHY_WAKE_EN_;
3593− }
3603+
35943604 if (adapter->wolopts & WAKE_MAGIC) {
35953605 wucsr |= MAC_WUCSR_MPEN_;
35963606 macrx |= MAC_RX_RXEN_;
@@ -3686,7 +3696,7 @@ static int lan743x_pm_suspend(struct device *dev) · 89 unmodified lines
36863696 lan743x_csr_write(adapter, MAC_WUCSR2, 0);
36873697 lan743x_csr_write(adapter, MAC_WK_SRC, 0xFFFFFFFF);
36883698
3689− if (adapter->wolopts)
3699+ if (adapter->wolopts || adapter->phy_wolopts)
36903700 lan743x_pm_set_wol(adapter);
36913701
36923702 if (adapter->is_pci11x1x) {
@@ -3710,6 +3720,7 @@ static int lan743x_pm_resume(struct device *dev) · 17 unmodified lines
37103720 struct pci_dev *pdev = to_pci_dev(dev);
37113721 struct net_device *netdev = pci_get_drvdata(pdev);
37123722 struct lan743x_adapter *adapter = netdev_priv(netdev);
3723+ u32 data;
37133724 int ret;
37143725
37153726 pci_set_power_state(pdev, PCI_D0);
@@ -3728,6 +3739,30 @@ static int lan743x_pm_resume(struct device *dev) · 12 unmodified lines
37283739 return ret;
37293740 }
37303741
3742+ ret = lan743x_csr_read(adapter, MAC_WK_SRC);
3743+ netif_dbg(adapter, drv, adapter->netdev,
3744+ "Wakeup source : 0x%08X\n", ret);
3745+
3746+ /* Clear the wol configuration and status bits. Note that
3747+ * the status bits are "Write One to Clear (W1C)"
3748+ */
3749+ data = MAC_WUCSR_EEE_TX_WAKE_ | MAC_WUCSR_EEE_RX_WAKE_ |
3750+ MAC_WUCSR_RFE_WAKE_FR_ | MAC_WUCSR_PFDA_FR_ | MAC_WUCSR_WUFR_ |
3751+ MAC_WUCSR_MPR_ | MAC_WUCSR_BCAST_FR_;
3752+ lan743x_csr_write(adapter, MAC_WUCSR, data);
3753+
3754+ data = MAC_WUCSR2_NS_RCD_ | MAC_WUCSR2_ARP_RCD_ |
3755+ MAC_WUCSR2_IPV6_TCPSYN_RCD_ | MAC_WUCSR2_IPV4_TCPSYN_RCD_;
3756+ lan743x_csr_write(adapter, MAC_WUCSR2, data);
3757+
3758+ data = MAC_WK_SRC_ETH_PHY_WK_ | MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_ |
3759+ MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_ | MAC_WK_SRC_EEE_TX_WK_ |
3760+ MAC_WK_SRC_EEE_RX_WK_ | MAC_WK_SRC_RFE_FR_WK_ |
3761+ MAC_WK_SRC_PFDA_FR_WK_ | MAC_WK_SRC_MP_FR_WK_ |
3762+ MAC_WK_SRC_BCAST_FR_WK_ | MAC_WK_SRC_WU_FR_WK_ |
3763+ MAC_WK_SRC_WK_FR_SAVED_;
3764+ lan743x_csr_write(adapter, MAC_WK_SRC, data);
3765+
37313766 /* open netdev when netdev is at running state while resume.
37323767 * For instance, it is true when system wakesup after pm-suspend
37333768 * However, it is false when system wakes up after suspend GUI menu
@@ -3736,9 +3771,6 @@ static int lan743x_pm_resume(struct device *dev) · 2 unmodified lines
37363771 lan743x_netdev_open(netdev);
37373772
37383773 netif_device_attach(netdev);
3739− ret = lan743x_csr_read(adapter, MAC_WK_SRC);
3740− netif_info(adapter, drv, adapter->netdev,
3741− "Wakeup source : 0x%08X\n", ret);
37423774
37433775 return 0;
37443776 }
drivers/net/ethernet/microchip/lan743x_main.h+28−0
@@ -61,6 +61,7 @@ · 60 unmodified lines
6161 #define PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_ BIT(18)
6262 #define PMT_CTL_GPIO_WAKEUP_EN_ BIT(15)
6363 #define PMT_CTL_EEE_WAKEUP_EN_ BIT(13)
64+#define PMT_CTL_RES_CLR_WKP_MASK_ GENMASK(9, 8)
6465 #define PMT_CTL_READY_ BIT(7)
6566 #define PMT_CTL_ETH_PHY_RST_ BIT(4)
6667 #define PMT_CTL_WOL_EN_ BIT(3)
@@ -227,12 +228,31 @@ · 160 unmodified lines
227228 #define MAC_WUCSR (0x140)
228229 #define MAC_MP_SO_EN_ BIT(21)
229230 #define MAC_WUCSR_RFE_WAKE_EN_ BIT(14)
231+#define MAC_WUCSR_EEE_TX_WAKE_ BIT(13)
232+#define MAC_WUCSR_EEE_RX_WAKE_ BIT(11)
233+#define MAC_WUCSR_RFE_WAKE_FR_ BIT(9)
234+#define MAC_WUCSR_PFDA_FR_ BIT(7)
235+#define MAC_WUCSR_WUFR_ BIT(6)
236+#define MAC_WUCSR_MPR_ BIT(5)
237+#define MAC_WUCSR_BCAST_FR_ BIT(4)
230238 #define MAC_WUCSR_PFDA_EN_ BIT(3)
231239 #define MAC_WUCSR_WAKE_EN_ BIT(2)
232240 #define MAC_WUCSR_MPEN_ BIT(1)
233241 #define MAC_WUCSR_BCST_EN_ BIT(0)
234242
235243 #define MAC_WK_SRC (0x144)
244+#define MAC_WK_SRC_ETH_PHY_WK_ BIT(17)
245+#define MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_ BIT(16)
246+#define MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_ BIT(15)
247+#define MAC_WK_SRC_EEE_TX_WK_ BIT(14)
248+#define MAC_WK_SRC_EEE_RX_WK_ BIT(13)
249+#define MAC_WK_SRC_RFE_FR_WK_ BIT(12)
250+#define MAC_WK_SRC_PFDA_FR_WK_ BIT(11)
251+#define MAC_WK_SRC_MP_FR_WK_ BIT(10)
252+#define MAC_WK_SRC_BCAST_FR_WK_ BIT(9)
253+#define MAC_WK_SRC_WU_FR_WK_ BIT(8)
254+#define MAC_WK_SRC_WK_FR_SAVED_ BIT(7)
255+
236256 #define MAC_MP_SO_HI (0x148)
237257 #define MAC_MP_SO_LO (0x14C)
238258
@@ -295,6 +315,10 @@ · 56 unmodified lines
295315 #define RFE_INDX(index) (0x580 + (index << 2))
296316
297317 #define MAC_WUCSR2 (0x600)
318+#define MAC_WUCSR2_NS_RCD_ BIT(7)
319+#define MAC_WUCSR2_ARP_RCD_ BIT(6)
320+#define MAC_WUCSR2_IPV6_TCPSYN_RCD_ BIT(5)
321+#define MAC_WUCSR2_IPV4_TCPSYN_RCD_ BIT(4)
298322
299323 #define SGMII_ACC (0x720)
300324 #define SGMII_ACC_SGMII_BZY_ BIT(31)
@@ -1018,6 +1042,8 @@ enum lan743x_sgmii_lsd { · 717 unmodified lines
10181042 LINK_2500_SLAVE
10191043 };
10201044
1045+#define MAC_SUPPORTED_WAKES (WAKE_BCAST | WAKE_UCAST | WAKE_MCAST | \
1046+ WAKE_MAGIC | WAKE_ARP)
10211047 struct lan743x_adapter {
10221048 struct net_device *netdev;
10231049 struct mii_bus *mdiobus;
@@ -1025,6 +1051,8 @@ struct lan743x_adapter { · 1 unmodified line
10251051 #ifdef CONFIG_PM
10261052 u32 wolopts;
10271053 u8 sopass[SOPASS_MAX];
1054+ u32 phy_wolopts;
1055+ u32 phy_wol_supported;
10281056 #endif
10291057 struct pci_dev *pdev;
10301058 struct lan743x_csr csr;
drivers/net/ethernet/qualcomm/qca_debug.c+2−4
@@ -98,10 +98,8 @@ qcaspi_info_show(struct seq_file *s, void *what) · 97 unmodified lines
9898
9999 seq_printf(s, "IRQ : %d\n",
100100 qca->spi_dev->irq);
101− seq_printf(s, "INTR REQ : %u\n",
102− qca->intr_req);
103− seq_printf(s, "INTR SVC : %u\n",
104− qca->intr_svc);
101+ seq_printf(s, "INTR : %lx\n",
102+ qca->intr);
105103
106104 seq_printf(s, "SPI max speed : %lu\n",
107105 (unsigned long)qca->spi_dev->max_speed_hz);
drivers/net/ethernet/qualcomm/qca_spi.c+8−8
@@ -35,6 +35,8 @@ · 34 unmodified lines
3535
3636 #define MAX_DMA_BURST_LEN 5000
3737
38+#define SPI_INTR 0
39+
3840 /* Modules parameters */
3941 #define QCASPI_CLK_SPEED_MIN 1000000
4042 #define QCASPI_CLK_SPEED_MAX 16000000
@@ -579,14 +581,14 @@ qcaspi_spi_thread(void *data) · 538 unmodified lines
579581 continue;
580582 }
581583
582− if ((qca->intr_req == qca->intr_svc) &&
584+ if (!test_bit(SPI_INTR, &qca->intr) &&
583585 !qca->txr.skb[qca->txr.head])
584586 schedule();
585587
586588 set_current_state(TASK_RUNNING);
587589
588− netdev_dbg(qca->net_dev, "have work to do. int: %d, tx_skb: %p\n",
589− qca->intr_req - qca->intr_svc,
590+ netdev_dbg(qca->net_dev, "have work to do. int: %lu, tx_skb: %p\n",
591+ qca->intr,
590592 qca->txr.skb[qca->txr.head]);
591593
592594 qcaspi_qca7k_sync(qca, QCASPI_EVENT_UPDATE);
@@ -600,8 +602,7 @@ qcaspi_spi_thread(void *data) · 7 unmodified lines
600602 msleep(QCASPI_QCA7K_REBOOT_TIME_MS);
601603 }
602604
603− if (qca->intr_svc != qca->intr_req) {
604− qca->intr_svc = qca->intr_req;
605+ if (test_and_clear_bit(SPI_INTR, &qca->intr)) {
605606 start_spi_intr_handling(qca, &intr_cause);
606607
607608 if (intr_cause & SPI_INT_CPU_ON) {
@@ -663,7 +664,7 @@ qcaspi_intr_handler(int irq, void *data) · 55 unmodified lines
663664 {
664665 struct qcaspi *qca = data;
665666
666− qca->intr_req++;
667+ set_bit(SPI_INTR, &qca->intr);
667668 if (qca->spi_thread)
668669 wake_up_process(qca->spi_thread);
669670
@@ -679,8 +680,7 @@ qcaspi_netdev_open(struct net_device *dev) · 9 unmodified lines
679680 if (!qca)
680681 return -EINVAL;
681682
682− qca->intr_req = 1;
683− qca->intr_svc = 0;
683+ set_bit(SPI_INTR, &qca->intr);
684684 qca->sync = QCASPI_SYNC_UNKNOWN;
685685 qcafrm_fsm_init_spi(&qca->frm_handle);
686686
drivers/net/ethernet/qualcomm/qca_spi.h+1−2
@@ -81,8 +81,7 @@ struct qcaspi { · 80 unmodified lines
8181 struct qcafrm_handle frm_handle;
8282 struct sk_buff *rx_skb;
8383
84− unsigned int intr_req;
85− unsigned int intr_svc;
84+ unsigned long intr;
8685 u16 reset_count;
8786
8887 #ifdef CONFIG_DEBUG_FS
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c+5−1
@@ -218,6 +218,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv) · 217 unmodified lines
218218 {
219219 u32 num_snapshot, ts_status, tsync_int;
220220 struct ptp_clock_event event;
221+ u32 acr_value, channel;
221222 unsigned long flags;
222223 u64 ptp_time;
223224 int i;
@@ -243,12 +244,15 @@ static void timestamp_interrupt(struct stmmac_priv *priv) · 19 unmodified lines
243244 num_snapshot = (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >>
244245 GMAC_TIMESTAMP_ATSNS_SHIFT;
245246
247+ acr_value = readl(priv->ptpaddr + PTP_ACR);
248+ channel = ilog2(FIELD_GET(PTP_ACR_MASK, acr_value));
249+
246250 for (i = 0; i < num_snapshot; i++) {
247251 read_lock_irqsave(&priv->ptp_lock, flags);
248252 get_ptptime(priv->ptpaddr, &ptp_time);
249253 read_unlock_irqrestore(&priv->ptp_lock, flags);
250254 event.type = PTP_CLOCK_EXTTS;
251− event.index = 0;
255+ event.index = channel;
252256 event.timestamp = ptp_time;
253257 ptp_clock_event(priv->ptp_clock, &event);
254258 }
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+22−18
@@ -358,24 +358,28 @@ static int tc_setup_cbs(struct stmmac_priv *priv, · 357 unmodified lines
358358
359359 port_transmit_rate_kbps = qopt->idleslope - qopt->sendslope;
360360
361− /* Port Transmit Rate and Speed Divider */
362− switch (div_s64(port_transmit_rate_kbps, 1000)) {
363− case SPEED_10000:
364− case SPEED_5000:
365− ptr = 32;
366− break;
367− case SPEED_2500:
368− case SPEED_1000:
369− ptr = 8;
370− break;
371− case SPEED_100:
372− ptr = 4;
373− break;
374− default:
375− netdev_err(priv->dev,
376− "Invalid portTransmitRate %lld (idleSlope - sendSlope)\n",
377− port_transmit_rate_kbps);
378− return -EINVAL;
361+ if (qopt->enable) {
362+ /* Port Transmit Rate and Speed Divider */
363+ switch (div_s64(port_transmit_rate_kbps, 1000)) {
364+ case SPEED_10000:
365+ case SPEED_5000:
366+ ptr = 32;
367+ break;
368+ case SPEED_2500:
369+ case SPEED_1000:
370+ ptr = 8;
371+ break;
372+ case SPEED_100:
373+ ptr = 4;
374+ break;
375+ default:
376+ netdev_err(priv->dev,
377+ "Invalid portTransmitRate %lld (idleSlope - sendSlope)\n",
378+ port_transmit_rate_kbps);
379+ return -EINVAL;
380+ }
381+ } else {
382+ ptr = 0;
379383 }
380384
381385 mode_to_use = priv->plat->tx_queues_cfg[queue].mode_to_use;
drivers/net/phy/dp83tg720.c+34−4
@@ -17,6 +17,11 @@ · 16 unmodified lines
1717 #define DP83TG720S_PHY_RESET 0x1f
1818 #define DP83TG720S_HW_RESET BIT(15)
1919
20+#define DP83TG720S_LPS_CFG3 0x18c
21+/* Power modes are documented as bit fields but used as values */
22+/* Power Mode 0 is Normal mode */
23+#define DP83TG720S_LPS_CFG3_PWR_MODE_0 BIT(0)
24+
2025 #define DP83TG720S_RGMII_DELAY_CTRL 0x602
2126 /* In RGMII mode, Enable or disable the internal delay for RXD */
2227 #define DP83TG720S_RGMII_RX_CLK_SEL BIT(1)
@@ -31,11 +36,20 @@ · 8 unmodified lines
3136
3237 static int dp83tg720_config_aneg(struct phy_device *phydev)
3338 {
39+ int ret;
40+
3441 /* Autoneg is not supported and this PHY supports only one speed.
3542 * We need to care only about master/slave configuration if it was
3643 * changed by user.
3744 */
38− return genphy_c45_pma_baset1_setup_master_slave(phydev);
45+ ret = genphy_c45_pma_baset1_setup_master_slave(phydev);
46+ if (ret)
47+ return ret;
48+
49+ /* Re-read role configuration to make changes visible even if
50+ * the link is in administrative down state.
51+ */
52+ return genphy_c45_pma_baset1_read_master_slave(phydev);
3953 }
4054
4155 static int dp83tg720_read_status(struct phy_device *phydev)
@@ -64,6 +78,8 @@ static int dp83tg720_read_status(struct phy_device *phydev) · 22 unmodified lines
6478 return ret;
6579
6680 /* After HW reset we need to restore master/slave configuration.
81+ * genphy_c45_pma_baset1_read_master_slave() call will be done
82+ * by the dp83tg720_config_aneg() function.
6783 */
6884 ret = dp83tg720_config_aneg(phydev);
6985 if (ret)
@@ -154,10 +170,24 @@ static int dp83tg720_config_init(struct phy_device *phydev) · 84 unmodified lines
154170 */
155171 usleep_range(1000, 2000);
156172
157− if (phy_interface_is_rgmii(phydev))
158− return dp83tg720_config_rgmii_delay(phydev);
173+ if (phy_interface_is_rgmii(phydev)) {
174+ ret = dp83tg720_config_rgmii_delay(phydev);
175+ if (ret)
176+ return ret;
177+ }
178+
179+ /* In case the PHY is bootstrapped in managed mode, we need to
180+ * wake it.
181+ */
182+ ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TG720S_LPS_CFG3,
183+ DP83TG720S_LPS_CFG3_PWR_MODE_0);
184+ if (ret)
185+ return ret;
159186
160− return 0;
187+ /* Make role configuration visible for ethtool on init and after
188+ * rest.
189+ */
190+ return genphy_c45_pma_baset1_read_master_slave(phydev);
161191 }
162192
163193 static struct phy_driver dp83tg720_driver[] = {
drivers/net/phy/mxl-gpy.c+38−20
@@ -107,6 +107,7 @@ struct gpy_priv { · 106 unmodified lines
107107
108108 u8 fw_major;
109109 u8 fw_minor;
110+ u32 wolopts;
110111
111112 /* It takes 3 seconds to fully switch out of loopback mode before
112113 * it can safely re-enter loopback mode. Record the time when
@@ -221,6 +222,15 @@ static int gpy_hwmon_register(struct phy_device *phydev) · 108 unmodified lines
221222 }
222223 #endif
223224
225+static int gpy_ack_interrupt(struct phy_device *phydev)
226+{
227+ int ret;
228+
229+ /* Clear all pending interrupts */
230+ ret = phy_read(phydev, PHY_ISTAT);
231+ return ret < 0 ? ret : 0;
232+}
233+
224234 static int gpy_mbox_read(struct phy_device *phydev, u32 addr)
225235 {
226236 struct gpy_priv *priv = phydev->priv;
@@ -262,16 +272,8 @@ out: · 35 unmodified lines
262272
263273 static int gpy_config_init(struct phy_device *phydev)
264274 {
265− int ret;
266−
267− /* Mask all interrupts */
268− ret = phy_write(phydev, PHY_IMASK, 0);
269− if (ret)
270− return ret;
271−
272− /* Clear all pending interrupts */
273− ret = phy_read(phydev, PHY_ISTAT);
274− return ret < 0 ? ret : 0;
275+ /* Nothing to configure. Configuration Requirement Placeholder */
276+ return 0;
275277 }
276278
277279 static int gpy21x_config_init(struct phy_device *phydev)
@@ -627,11 +629,23 @@ static int gpy_read_status(struct phy_device *phydev) · 349 unmodified lines
627629
628630 static int gpy_config_intr(struct phy_device *phydev)
629631 {
632+ struct gpy_priv *priv = phydev->priv;
630633 u16 mask = 0;
634+ int ret;
635+
636+ ret = gpy_ack_interrupt(phydev);
637+ if (ret)
638+ return ret;
631639
632640 if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
633641 mask = PHY_IMASK_MASK;
634642
643+ if (priv->wolopts & WAKE_MAGIC)
644+ mask |= PHY_IMASK_WOL;
645+
646+ if (priv->wolopts & WAKE_PHY)
647+ mask |= PHY_IMASK_LSTC;
648+
635649 return phy_write(phydev, PHY_IMASK, mask);
636650 }
637651
@@ -678,6 +692,7 @@ static int gpy_set_wol(struct phy_device *phydev, · 40 unmodified lines
678692 struct ethtool_wolinfo *wol)
679693 {
680694 struct net_device *attach_dev = phydev->attached_dev;
695+ struct gpy_priv *priv = phydev->priv;
681696 int ret;
682697
683698 if (wol->wolopts & WAKE_MAGIC) {
@@ -725,6 +740,8 @@ static int gpy_set_wol(struct phy_device *phydev, · 41 unmodified lines
725740 ret = phy_read(phydev, PHY_ISTAT);
726741 if (ret < 0)
727742 return ret;
743+
744+ priv->wolopts |= WAKE_MAGIC;
728745 } else {
729746 /* Disable magic packet matching */
730747 ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2,
@@ -732,6 +749,13 @@ static int gpy_set_wol(struct phy_device *phydev, · 1 unmodified line
732749 WOL_EN);
733750 if (ret < 0)
734751 return ret;
752+
753+ /* Disable the WOL interrupt */
754+ ret = phy_clear_bits(phydev, PHY_IMASK, PHY_IMASK_WOL);
755+ if (ret < 0)
756+ return ret;
757+
758+ priv->wolopts &= ~WAKE_MAGIC;
735759 }
736760
737761 if (wol->wolopts & WAKE_PHY) {
@@ -748,9 +772,11 @@ static int gpy_set_wol(struct phy_device *phydev, · 10 unmodified lines
748772 if (ret & (PHY_IMASK_MASK & ~PHY_IMASK_LSTC))
749773 phy_trigger_machine(phydev);
750774
775+ priv->wolopts |= WAKE_PHY;
751776 return 0;
752777 }
753778
779+ priv->wolopts &= ~WAKE_PHY;
754780 /* Disable the link state change interrupt */
755781 return phy_clear_bits(phydev, PHY_IMASK, PHY_IMASK_LSTC);
756782 }
@@ -758,18 +784,10 @@ static int gpy_set_wol(struct phy_device *phydev, · 1 unmodified line
758784 static void gpy_get_wol(struct phy_device *phydev,
759785 struct ethtool_wolinfo *wol)
760786 {
761− int ret;
787+ struct gpy_priv *priv = phydev->priv;
762788
763789 wol->supported = WAKE_MAGIC | WAKE_PHY;
764− wol->wolopts = 0;
765−
766− ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, VPSPEC2_WOL_CTL);
767− if (ret & WOL_EN)
768− wol->wolopts |= WAKE_MAGIC;
769−
770− ret = phy_read(phydev, PHY_IMASK);
771− if (ret & PHY_IMASK_LSTC)
772− wol->wolopts |= WAKE_PHY;
790+ wol->wolopts = priv->wolopts;
773791 }
774792
775793 static int gpy_loopback(struct phy_device *phydev, bool enable)
drivers/net/usb/ax88179_178a.c+13−5
@@ -174,7 +174,6 @@ struct ax88179_data { · 173 unmodified lines
174174 u32 wol_supported;
175175 u32 wolopts;
176176 u8 disconnecting;
177− u8 initialized;
178177 };
179178
180179 struct ax88179_int_data {
@@ -1678,12 +1677,21 @@ static int ax88179_reset(struct usbnet *dev) · 1497 unmodified lines
16781677
16791678 static int ax88179_net_reset(struct usbnet *dev)
16801679 {
1681− struct ax88179_data *ax179_data = dev->driver_priv;
1680+ u16 tmp16;
16821681
1683− if (ax179_data->initialized)
1682+ ax88179_read_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID, GMII_PHY_PHYSR,
1683+ 2, &tmp16);
1684+ if (tmp16) {
1685+ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
1686+ 2, 2, &tmp16);
1687+ if (!(tmp16 & AX_MEDIUM_RECEIVE_EN)) {
1688+ tmp16 |= AX_MEDIUM_RECEIVE_EN;
1689+ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
1690+ 2, 2, &tmp16);
1691+ }
1692+ } else {
16841693 ax88179_reset(dev);
1685− else
1686− ax179_data->initialized = 1;
1694+ }
16871695
16881696 return 0;
16891697 }
drivers/net/usb/rtl8150.c+2−1
@@ -778,7 +778,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev, · 777 unmodified lines
778778 struct ethtool_link_ksettings *ecmd)
779779 {
780780 rtl8150_t *dev = netdev_priv(netdev);
781− short lpa, bmcr;
781+ short lpa = 0;
782+ short bmcr = 0;
782783 u32 supported;
783784
784785 supported = (SUPPORTED_10baseT_Half |
drivers/net/virtio_net.c+29−3
@@ -1360,6 +1360,10 @@ static struct sk_buff *receive_small_xdp(struct net_device *dev, · 1359 unmodified lines
13601360 if (unlikely(hdr->hdr.gso_type))
13611361 goto err_xdp;
13621362
1363+ /* Partially checksummed packets must be dropped. */
1364+ if (unlikely(hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM))
1365+ goto err_xdp;
1366+
13631367 buflen = SKB_DATA_ALIGN(GOOD_PACKET_LEN + headroom) +
13641368 SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
13651369
@@ -1677,6 +1681,10 @@ static void *mergeable_xdp_get_buf(struct virtnet_info *vi, · 311 unmodified lines
16771681 if (unlikely(hdr->hdr.gso_type))
16781682 return NULL;
16791683
1684+ /* Partially checksummed packets must be dropped. */
1685+ if (unlikely(hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM))
1686+ return NULL;
1687+
16801688 /* Now XDP core assumes frag size is PAGE_SIZE, but buffers
16811689 * with headroom may add hole in truesize, which
16821690 * make their length exceed PAGE_SIZE. So we disabled the
@@ -1943,6 +1951,7 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq, · 260 unmodified lines
19431951 struct net_device *dev = vi->dev;
19441952 struct sk_buff *skb;
19451953 struct virtio_net_common_hdr *hdr;
1954+ u8 flags;
19461955
19471956 if (unlikely(len < vi->hdr_len + ETH_HLEN)) {
19481957 pr_debug("%s: short packet %i\n", dev->name, len);
@@ -1951,6 +1960,15 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq, · 2 unmodified lines
19511960 return;
19521961 }
19531962
1963+ /* 1. Save the flags early, as the XDP program might overwrite them.
1964+ * These flags ensure packets marked as VIRTIO_NET_HDR_F_DATA_VALID
1965+ * stay valid after XDP processing.
1966+ * 2. XDP doesn't work with partially checksummed packets (refer to
1967+ * virtnet_xdp_set()), so packets marked as
1968+ * VIRTIO_NET_HDR_F_NEEDS_CSUM get dropped during XDP processing.
1969+ */
1970+ flags = ((struct virtio_net_common_hdr *)buf)->hdr.flags;
1971+
19541972 if (vi->mergeable_rx_bufs)
19551973 skb = receive_mergeable(dev, vi, rq, buf, ctx, len, xdp_xmit,
19561974 stats);
@@ -1966,7 +1984,7 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq, · 9 unmodified lines
19661984 if (dev->features & NETIF_F_RXHASH && vi->has_rss_hash_report)
19671985 virtio_skb_set_hash(&hdr->hash_v1_hdr, skb);
19681986
1969− if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID)
1987+ if (flags & VIRTIO_NET_HDR_F_DATA_VALID)
19701988 skb->ip_summed = CHECKSUM_UNNECESSARY;
19711989
19721990 if (virtio_net_hdr_to_skb(skb, &hdr->hdr,
@@ -5666,8 +5684,16 @@ static int virtnet_probe(struct virtio_device *vdev) · 3693 unmodified lines
56665684 dev->features |= dev->hw_features & NETIF_F_ALL_TSO;
56675685 /* (!csum && gso) case will be fixed by register_netdev() */
56685686 }
5669− if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_CSUM))
5670− dev->features |= NETIF_F_RXCSUM;
5687+
5688+ /* 1. With VIRTIO_NET_F_GUEST_CSUM negotiation, the driver doesn't
5689+ * need to calculate checksums for partially checksummed packets,
5690+ * as they're considered valid by the upper layer.
5691+ * 2. Without VIRTIO_NET_F_GUEST_CSUM negotiation, the driver only
5692+ * receives fully checksummed packets. The device may assist in
5693+ * validating these packets' checksums, so the driver won't have to.
5694+ */
5695+ dev->features |= NETIF_F_RXCSUM;
5696+
56715697 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) ||
56725698 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6))
56735699 dev->features |= NETIF_F_GRO_HW;
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+1−1
@@ -4795,7 +4795,7 @@ static int iwl_mvm_roc_station(struct iwl_mvm *mvm, · 4794 unmodified lines
47954795
47964796 if (fw_ver == IWL_FW_CMD_VER_UNKNOWN) {
47974797 ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, vif, duration);
4798− } else if (fw_ver == 3) {
4798+ } else if (fw_ver >= 3) {
47994799 ret = iwl_mvm_roc_add_cmd(mvm, channel, vif, duration,
48004800 ROC_ACTIVITY_HOTSPOT);
48014801 } else {
drivers/net/wireless/intel/iwlwifi/mvm/scan.c+1−1
@@ -1830,7 +1830,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm, · 1829 unmodified lines
18301830 */
18311831 if (!iwl_mvm_is_scan_fragmented(params->type)) {
18321832 if (!cfg80211_channel_is_psc(params->channels[i]) ||
1833− flags & IWL_UHB_CHAN_CFG_FLAG_PSC_CHAN_NO_LISTEN) {
1833+ psc_no_listen) {
18341834 if (unsolicited_probe_on_chan) {
18351835 max_s_ssids = 2;
18361836 max_bssids = 6;
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c+2−0
@@ -1238,6 +1238,7 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 1237 unmodified lines
12381238 if (te_data->id >= SESSION_PROTECT_CONF_MAX_ID) {
12391239 IWL_DEBUG_TE(mvm,
12401240 "No remain on channel event\n");
1241+ mutex_unlock(&mvm->mutex);
12411242 return;
12421243 }
12431244
@@ -1253,6 +1254,7 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 9 unmodified lines
12531254 te_data = iwl_mvm_get_roc_te(mvm);
12541255 if (!te_data) {
12551256 IWL_WARN(mvm, "No remain on channel event\n");
1257+ mutex_unlock(&mvm->mutex);
12561258 return;
12571259 }
12581260
drivers/phy/qualcomm/phy-qcom-qmp-combo.c+160−29
@@ -187,6 +187,31 @@ static const unsigned int qmp_v6_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { · 186 unmodified lines
187187 [QPHY_TX_TRANSCEIVER_BIAS_EN] = QSERDES_V6_TX_TRANSCEIVER_BIAS_EN,
188188 };
189189
190+static const unsigned int qmp_v6_n4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = {
191+ [QPHY_SW_RESET] = QPHY_V6_N4_PCS_SW_RESET,
192+ [QPHY_START_CTRL] = QPHY_V6_N4_PCS_START_CONTROL,
193+ [QPHY_PCS_STATUS] = QPHY_V6_N4_PCS_PCS_STATUS1,
194+ [QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V6_N4_PCS_POWER_DOWN_CONTROL,
195+
196+ /* In PCS_USB */
197+ [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = QPHY_V6_PCS_USB3_AUTONOMOUS_MODE_CTRL,
198+ [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V6_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR,
199+
200+ [QPHY_COM_RESETSM_CNTRL] = QSERDES_V6_COM_RESETSM_CNTRL,
201+ [QPHY_COM_C_READY_STATUS] = QSERDES_V6_COM_C_READY_STATUS,
202+ [QPHY_COM_CMN_STATUS] = QSERDES_V6_COM_CMN_STATUS,
203+ [QPHY_COM_BIAS_EN_CLKBUFLR_EN] = QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN,
204+
205+ [QPHY_DP_PHY_STATUS] = QSERDES_V6_DP_PHY_STATUS,
206+ [QPHY_DP_PHY_VCO_DIV] = QSERDES_V6_DP_PHY_VCO_DIV,
207+
208+ [QPHY_TX_TX_POL_INV] = QSERDES_V6_N4_TX_TX_POL_INV,
209+ [QPHY_TX_TX_DRV_LVL] = QSERDES_V6_N4_TX_TX_DRV_LVL,
210+ [QPHY_TX_TX_EMP_POST1_LVL] = QSERDES_V6_N4_TX_TX_EMP_POST1_LVL,
211+ [QPHY_TX_HIGHZ_DRVR_EN] = QSERDES_V6_N4_TX_HIGHZ_DRVR_EN,
212+ [QPHY_TX_TRANSCEIVER_BIAS_EN] = QSERDES_V6_N4_TX_TRANSCEIVER_BIAS_EN,
213+};
214+
190215 static const struct qmp_phy_init_tbl qmp_v3_usb3_serdes_tbl[] = {
191216 QMP_PHY_INIT_CFG(QSERDES_V3_COM_PLL_IVCO, 0x07),
192217 QMP_PHY_INIT_CFG(QSERDES_V3_COM_SYSCLK_EN_SEL, 0x14),
@@ -997,6 +1022,31 @@ static const struct qmp_phy_init_tbl qmp_v6_dp_serdes_tbl[] = { · 804 unmodified lines
9971022 QMP_PHY_INIT_CFG(QSERDES_V6_COM_CORE_CLK_EN, 0x0f),
9981023 };
9991024
1025+static const struct qmp_phy_init_tbl qmp_v6_n4_dp_serdes_tbl[] = {
1026+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SVS_MODE_CLK_SEL, 0x15),
1027+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_EN_SEL, 0x3b),
1028+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYS_CLK_CTRL, 0x02),
1029+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_CLK_ENABLE1, 0x0c),
1030+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_BUF_ENABLE, 0x06),
1031+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_CLK_SELECT, 0x30),
1032+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x07),
1033+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x36),
1034+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x16),
1035+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x06),
1036+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x34),
1037+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START1_MODE0, 0x00),
1038+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START2_MODE0, 0xc0),
1039+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_CONFIG_1, 0x12),
1040+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE0, 0x3f),
1041+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_INTEGLOOP_GAIN1_MODE0, 0x00),
1042+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x00),
1043+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BG_TIMER, 0x0a),
1044+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CORE_CLK_DIV_MODE0, 0x14),
1045+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_CTRL, 0x00),
1046+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN, 0x17),
1047+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_CORE_CLK_EN, 0x0f),
1048+};
1049+
10001050 static const struct qmp_phy_init_tbl qmp_v6_dp_tx_tbl[] = {
10011051 QMP_PHY_INIT_CFG(QSERDES_V6_TX_VMODE_CTRL1, 0x40),
10021052 QMP_PHY_INIT_CFG(QSERDES_V6_TX_PRE_STALL_LDO_BOOST_EN, 0x30),
@@ -1011,6 +1061,19 @@ static const struct qmp_phy_init_tbl qmp_v6_dp_tx_tbl[] = { · 8 unmodified lines
10111061 QMP_PHY_INIT_CFG(QSERDES_V6_TX_TX_BAND, 0x4),
10121062 };
10131063
1064+static const struct qmp_phy_init_tbl qmp_v6_n4_dp_tx_tbl[] = {
1065+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_VMODE_CTRL1, 0x40),
1066+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_PRE_STALL_LDO_BOOST_EN, 0x00),
1067+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_INTERFACE_SELECT, 0xff),
1068+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_CLKBUF_ENABLE, 0x0f),
1069+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RESET_TSYNC_EN, 0x03),
1070+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_TRAN_DRVR_EMP_EN, 0x0f),
1071+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_PARRATE_REC_DETECT_IDLE_EN, 0x00),
1072+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_TX, 0x11),
1073+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX, 0x11),
1074+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_TX_BAND, 0x1),
1075+};
1076+
10141077 static const struct qmp_phy_init_tbl qmp_v6_dp_serdes_tbl_rbr[] = {
10151078 QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x05),
10161079 QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x34),
@@ -1059,6 +1122,74 @@ static const struct qmp_phy_init_tbl qmp_v6_dp_serdes_tbl_hbr3[] = { · 42 unmodified lines
10591122 QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x0c),
10601123 };
10611124
1125+static const struct qmp_phy_init_tbl qmp_v6_n4_dp_serdes_tbl_rbr[] = {
1126+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x05),
1127+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x34),
1128+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x04),
1129+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START3_MODE0, 0x0b),
1130+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x37),
1131+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x04),
1132+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0x71),
1133+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x0c),
1134+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_EN_CENTER, 0x01),
1135+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_ADJ_PER1, 0x00),
1136+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER1, 0x6b),
1137+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER2, 0x02),
1138+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0, 0x92),
1139+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0, 0x01),
1140+};
1141+
1142+static const struct qmp_phy_init_tbl qmp_v6_n4_dp_serdes_tbl_hbr[] = {
1143+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x03),
1144+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x34),
1145+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x08),
1146+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START3_MODE0, 0x0b),
1147+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x07),
1148+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x07),
1149+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0x71),
1150+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x0c),
1151+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_EN_CENTER, 0x01),
1152+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_ADJ_PER1, 0x00),
1153+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER1, 0x6b),
1154+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER2, 0x02),
1155+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0, 0x92),
1156+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0, 0x01),
1157+};
1158+
1159+static const struct qmp_phy_init_tbl qmp_v6_n4_dp_serdes_tbl_hbr2[] = {
1160+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x01),
1161+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x46),
1162+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x08),
1163+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START3_MODE0, 0x05),
1164+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x0f),
1165+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x0e),
1166+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0x97),
1167+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x10),
1168+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_EN_CENTER, 0x01),
1169+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_ADJ_PER1, 0x00),
1170+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER1, 0x6b),
1171+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER2, 0x02),
1172+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0, 0x18),
1173+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0, 0x02),
1174+};
1175+
1176+static const struct qmp_phy_init_tbl qmp_v6_n4_dp_serdes_tbl_hbr3[] = {
1177+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x00),
1178+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x34),
1179+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x08),
1180+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START3_MODE0, 0x0b),
1181+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x17),
1182+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x15),
1183+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0x71),
1184+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x0c),
1185+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_EN_CENTER, 0x01),
1186+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_ADJ_PER1, 0x00),
1187+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER1, 0x6b),
1188+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER2, 0x02),
1189+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0, 0x92),
1190+ QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0, 0x01),
1191+};
1192+
10621193 static const struct qmp_phy_init_tbl sc8280xp_usb43dp_serdes_tbl[] = {
10631194 QMP_PHY_INIT_CFG(QSERDES_V5_COM_SSC_EN_CENTER, 0x01),
10641195 QMP_PHY_INIT_CFG(QSERDES_V5_COM_SSC_PER1, 0x31),
@@ -1273,20 +1404,20 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_rx_tbl[] = { · 208 unmodified lines
12731404 };
12741405
12751406 static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_tbl[] = {
1276− QMP_PHY_INIT_CFG(QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7),
1277− QMP_PHY_INIT_CFG(QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
1278− QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG1, 0xc4),
1279− QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG2, 0x89),
1280− QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG3, 0x20),
1281− QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG6, 0x13),
1282− QMP_PHY_INIT_CFG(QPHY_V6_PCS_REFGEN_REQ_CONFIG1, 0x21),
1283− QMP_PHY_INIT_CFG(QPHY_V6_PCS_RX_SIGDET_LVL, 0x55),
1284− QMP_PHY_INIT_CFG(QPHY_V6_PCS_CDR_RESET_TIME, 0x0a),
1285− QMP_PHY_INIT_CFG(QPHY_V6_PCS_ALIGN_DETECT_CONFIG1, 0xd4),
1286− QMP_PHY_INIT_CFG(QPHY_V6_PCS_ALIGN_DETECT_CONFIG2, 0x30),
1287− QMP_PHY_INIT_CFG(QPHY_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
1288− QMP_PHY_INIT_CFG(QPHY_V6_PCS_EQ_CONFIG1, 0x4b),
1289− QMP_PHY_INIT_CFG(QPHY_V6_PCS_EQ_CONFIG5, 0x10),
1407+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7),
1408+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
1409+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG1, 0xc4),
1410+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG2, 0x89),
1411+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG3, 0x20),
1412+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG6, 0x13),
1413+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_REFGEN_REQ_CONFIG1, 0x21),
1414+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_RX_SIGDET_LVL, 0x55),
1415+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_RX_CONFIG, 0x0a),
1416+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_ALIGN_DETECT_CONFIG1, 0xd4),
1417+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_ALIGN_DETECT_CONFIG2, 0x30),
1418+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_PCS_TX_RX_CONFIG, 0x0c),
1419+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_EQ_CONFIG1, 0x4b),
1420+ QMP_PHY_INIT_CFG(QPHY_V6_N4_PCS_EQ_CONFIG5, 0x10),
12901421 };
12911422
12921423 static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_usb_tbl[] = {
@@ -1794,22 +1925,22 @@ static const struct qmp_phy_cfg x1e80100_usb3dpphy_cfg = { · 501 unmodified lines
17941925 .pcs_usb_tbl = x1e80100_usb43dp_pcs_usb_tbl,
17951926 .pcs_usb_tbl_num = ARRAY_SIZE(x1e80100_usb43dp_pcs_usb_tbl),
17961927
1797− .dp_serdes_tbl = qmp_v6_dp_serdes_tbl,
1798− .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl),
1799− .dp_tx_tbl = qmp_v6_dp_tx_tbl,
1800− .dp_tx_tbl_num = ARRAY_SIZE(qmp_v6_dp_tx_tbl),
1928+ .dp_serdes_tbl = qmp_v6_n4_dp_serdes_tbl,
1929+ .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v6_n4_dp_serdes_tbl),
1930+ .dp_tx_tbl = qmp_v6_n4_dp_tx_tbl,
1931+ .dp_tx_tbl_num = ARRAY_SIZE(qmp_v6_n4_dp_tx_tbl),
18011932
1802− .serdes_tbl_rbr = qmp_v6_dp_serdes_tbl_rbr,
1803− .serdes_tbl_rbr_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_rbr),
1804− .serdes_tbl_hbr = qmp_v6_dp_serdes_tbl_hbr,
1805− .serdes_tbl_hbr_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_hbr),
1806− .serdes_tbl_hbr2 = qmp_v6_dp_serdes_tbl_hbr2,
1807− .serdes_tbl_hbr2_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_hbr2),
1808− .serdes_tbl_hbr3 = qmp_v6_dp_serdes_tbl_hbr3,
1809− .serdes_tbl_hbr3_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_hbr3),
1933+ .serdes_tbl_rbr = qmp_v6_n4_dp_serdes_tbl_rbr,
1934+ .serdes_tbl_rbr_num = ARRAY_SIZE(qmp_v6_n4_dp_serdes_tbl_rbr),
1935+ .serdes_tbl_hbr = qmp_v6_n4_dp_serdes_tbl_hbr,
1936+ .serdes_tbl_hbr_num = ARRAY_SIZE(qmp_v6_n4_dp_serdes_tbl_hbr),
1937+ .serdes_tbl_hbr2 = qmp_v6_n4_dp_serdes_tbl_hbr2,
1938+ .serdes_tbl_hbr2_num = ARRAY_SIZE(qmp_v6_n4_dp_serdes_tbl_hbr2),
1939+ .serdes_tbl_hbr3 = qmp_v6_n4_dp_serdes_tbl_hbr3,
1940+ .serdes_tbl_hbr3_num = ARRAY_SIZE(qmp_v6_n4_dp_serdes_tbl_hbr3),
18101941
1811− .swing_hbr_rbr = &qmp_dp_v5_voltage_swing_hbr_rbr,
1812− .pre_emphasis_hbr_rbr = &qmp_dp_v5_pre_emphasis_hbr_rbr,
1942+ .swing_hbr_rbr = &qmp_dp_v6_voltage_swing_hbr_rbr,
1943+ .pre_emphasis_hbr_rbr = &qmp_dp_v6_pre_emphasis_hbr_rbr,
18131944 .swing_hbr3_hbr2 = &qmp_dp_v5_voltage_swing_hbr3_hbr2,
18141945 .pre_emphasis_hbr3_hbr2 = &qmp_dp_v5_pre_emphasis_hbr3_hbr2,
18151946
@@ -1822,7 +1953,7 @@ static const struct qmp_phy_cfg x1e80100_usb3dpphy_cfg = { · 6 unmodified lines
18221953 .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l),
18231954 .vreg_list = qmp_phy_vreg_l,
18241955 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
1825− .regs = qmp_v45_usb3phy_regs_layout,
1956+ .regs = qmp_v6_n4_usb3phy_regs_layout,
18261957 };
18271958
18281959 static const struct qmp_phy_cfg sm6350_usb3dpphy_cfg = {
drivers/phy/qualcomm/phy-qcom-qmp-pcs-v6-n4.h+32−0
@@ -0,0 +1,32 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (c) 2023, Linaro Limited
4+ */
5+
6+#ifndef QCOM_PHY_QMP_PCS_V6_N4_H_
7+#define QCOM_PHY_QMP_PCS_V6_N4_H_
8+
9+/* Only for QMP V6 N4 PHY - USB/PCIe PCS registers */
10+#define QPHY_V6_N4_PCS_SW_RESET 0x000
11+#define QPHY_V6_N4_PCS_PCS_STATUS1 0x014
12+#define QPHY_V6_N4_PCS_POWER_DOWN_CONTROL 0x040
13+#define QPHY_V6_N4_PCS_START_CONTROL 0x044
14+#define QPHY_V6_N4_PCS_POWER_STATE_CONFIG1 0x090
15+#define QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG1 0x0c4
16+#define QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG2 0x0c8
17+#define QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG3 0x0cc
18+#define QPHY_V6_N4_PCS_LOCK_DETECT_CONFIG6 0x0d8
19+#define QPHY_V6_N4_PCS_REFGEN_REQ_CONFIG1 0x0dc
20+#define QPHY_V6_N4_PCS_RX_SIGDET_LVL 0x188
21+#define QPHY_V6_N4_PCS_RCVR_DTCT_DLY_P1U2_L 0x190
22+#define QPHY_V6_N4_PCS_RCVR_DTCT_DLY_P1U2_H 0x194
23+#define QPHY_V6_N4_PCS_RATE_SLEW_CNTRL1 0x198
24+#define QPHY_V6_N4_PCS_RX_CONFIG 0x1b0
25+#define QPHY_V6_N4_PCS_ALIGN_DETECT_CONFIG1 0x1c0
26+#define QPHY_V6_N4_PCS_ALIGN_DETECT_CONFIG2 0x1c4
27+#define QPHY_V6_N4_PCS_PCS_TX_RX_CONFIG 0x1d0
28+#define QPHY_V6_N4_PCS_EQ_CONFIG1 0x1dc
29+#define QPHY_V6_N4_PCS_EQ_CONFIG2 0x1e0
30+#define QPHY_V6_N4_PCS_EQ_CONFIG5 0x1ec
31+
32+#endif
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h+13−0
@@ -6,11 +6,24 @@ · 5 unmodified lines
66 #ifndef QCOM_PHY_QMP_QSERDES_TXRX_V6_N4_H_
77 #define QCOM_PHY_QMP_QSERDES_TXRX_V6_N4_H_
88
9+#define QSERDES_V6_N4_TX_CLKBUF_ENABLE 0x08
10+#define QSERDES_V6_N4_TX_TX_EMP_POST1_LVL 0x0c
11+#define QSERDES_V6_N4_TX_TX_DRV_LVL 0x14
12+#define QSERDES_V6_N4_TX_RESET_TSYNC_EN 0x1c
13+#define QSERDES_V6_N4_TX_PRE_STALL_LDO_BOOST_EN 0x20
914 #define QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_TX 0x30
1015 #define QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX 0x34
16+#define QSERDES_V6_N4_TX_TRANSCEIVER_BIAS_EN 0x48
17+#define QSERDES_V6_N4_TX_HIGHZ_DRVR_EN 0x4c
18+#define QSERDES_V6_N4_TX_TX_POL_INV 0x50
19+#define QSERDES_V6_N4_TX_PARRATE_REC_DETECT_IDLE_EN 0x54
1120 #define QSERDES_V6_N4_TX_LANE_MODE_1 0x78
1221 #define QSERDES_V6_N4_TX_LANE_MODE_2 0x7c
1322 #define QSERDES_V6_N4_TX_LANE_MODE_3 0x80
23+#define QSERDES_V6_N4_TX_TRAN_DRVR_EMP_EN 0xac
24+#define QSERDES_V6_N4_TX_TX_BAND 0xd8
25+#define QSERDES_V6_N4_TX_INTERFACE_SELECT 0xe4
26+#define QSERDES_V6_N4_TX_VMODE_CTRL1 0xb0
1427
1528 #define QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE2 0x8
1629 #define QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE2 0x18
drivers/phy/qualcomm/phy-qcom-qmp.h+2−0
@@ -46,6 +46,8 @@ · 45 unmodified lines
4646
4747 #include "phy-qcom-qmp-pcs-v6.h"
4848
49+#include "phy-qcom-qmp-pcs-v6-n4.h"
50+
4951 #include "phy-qcom-qmp-pcs-v6_20.h"
5052
5153 #include "phy-qcom-qmp-pcs-v7.h"
drivers/ptp/ptp_sysfs.c+1−2
@@ -296,8 +296,7 @@ static ssize_t max_vclocks_store(struct device *dev, · 295 unmodified lines
296296 if (max < ptp->n_vclocks)
297297 goto out;
298298
299− size = sizeof(int) * max;
300− vclock_index = kzalloc(size, GFP_KERNEL);
299+ vclock_index = kcalloc(max, sizeof(int), GFP_KERNEL);
301300 if (!vclock_index) {
302301 err = -ENOMEM;
303302 goto out;
drivers/pwm/pwm-stm32.c+16−7
@@ -321,22 +321,30 @@ static int stm32_pwm_config(struct stm32_pwm *priv, unsigned int ch, · 320 unmodified lines
321321 * First we need to find the minimal value for prescaler such that
322322 *
323323 * period_ns * clkrate
324− * ------------------------------
324+ * ------------------------------ < max_arr + 1
325325 * NSEC_PER_SEC * (prescaler + 1)
326326 *
327− * isn't bigger than max_arr.
327+ * This equation is equivalent to
328+ *
329+ * period_ns * clkrate
330+ * ---------------------------- < prescaler + 1
331+ * NSEC_PER_SEC * (max_arr + 1)
332+ *
333+ * Using integer division and knowing that the right hand side is
334+ * integer, this is further equivalent to
335+ *
336+ * (period_ns * clkrate) // (NSEC_PER_SEC * (max_arr + 1)) ≤ prescaler
328337 */
329338
330339 prescaler = mul_u64_u64_div_u64(period_ns, clk_get_rate(priv->clk),
331− (u64)NSEC_PER_SEC * priv->max_arr);
332− if (prescaler > 0)
333− prescaler -= 1;
334−
340+ (u64)NSEC_PER_SEC * ((u64)priv->max_arr + 1));
335341 if (prescaler > MAX_TIM_PSC)
336342 return -EINVAL;
337343
338344 prd = mul_u64_u64_div_u64(period_ns, clk_get_rate(priv->clk),
339345 (u64)NSEC_PER_SEC * (prescaler + 1));
346+ if (!prd)
347+ return -EINVAL;
340348
341349 /*
342350 * All channels share the same prescaler and counter so when two
@@ -673,7 +681,8 @@ static int stm32_pwm_probe(struct platform_device *pdev) · 330 unmodified lines
673681 * .apply() won't overflow.
674682 */
675683 if (clk_get_rate(priv->clk) > 1000000000)
676− return dev_err_probe(dev, -EINVAL, "Failed to lock clock\n");
684+ return dev_err_probe(dev, -EINVAL, "Clock freq too high (%lu)\n",
685+ clk_get_rate(priv->clk));
677686
678687 chip->ops = &stm32pwm_ops;
679688
drivers/regulator/Kconfig+9−0
@@ -1634,6 +1634,15 @@ config REGULATOR_UNIPHIER · 1633 unmodified lines
16341634 help
16351635 Support for regulators implemented on Socionext UniPhier SoCs.
16361636
1637+config REGULATOR_RZG2L_VBCTRL
1638+ tristate "Renesas RZ/G2L USB VBUS regulator driver"
1639+ depends on ARCH_RZG2L || COMPILE_TEST
1640+ depends on OF
1641+ select REGMAP_MMIO
1642+ default ARCH_RZG2L
1643+ help
1644+ Support for VBUS regulators implemented on Renesas RZ/G2L SoCs.
1645+
16371646 config REGULATOR_VCTRL
16381647 tristate "Voltage controlled regulators"
16391648 depends on OF
drivers/regulator/Makefile+1−0
@@ -189,6 +189,7 @@ obj-$(CONFIG_REGULATOR_TPS65132) += tps65132-regulator.o · 188 unmodified lines
189189 obj-$(CONFIG_REGULATOR_TPS68470) += tps68470-regulator.o
190190 obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o twl6030-regulator.o
191191 obj-$(CONFIG_REGULATOR_UNIPHIER) += uniphier-regulator.o
192+obj-$(CONFIG_REGULATOR_RZG2L_VBCTRL) += renesas-usb-vbus-regulator.o
192193 obj-$(CONFIG_REGULATOR_VCTRL) += vctrl-regulator.o
193194 obj-$(CONFIG_REGULATOR_VEXPRESS) += vexpress-regulator.o
194195 obj-$(CONFIG_REGULATOR_VQMMC_IPQ4019) += vqmmc-ipq4019-regulator.o
drivers/regulator/axp20x-regulator.c+19−14
@@ -140,7 +140,7 @@ · 139 unmodified lines
140140
141141 #define AXP717_DCDC1_NUM_VOLTAGES 88
142142 #define AXP717_DCDC2_NUM_VOLTAGES 107
143−#define AXP717_DCDC3_NUM_VOLTAGES 104
143+#define AXP717_DCDC3_NUM_VOLTAGES 103
144144 #define AXP717_DCDC_V_OUT_MASK GENMASK(6, 0)
145145 #define AXP717_LDO_V_OUT_MASK GENMASK(4, 0)
146146
@@ -763,10 +763,15 @@ static const struct linear_range axp717_dcdc1_ranges[] = { · 616 unmodified lines
763763 REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
764764 };
765765
766+/*
767+ * The manual says that the last voltage is 3.4V, encoded as 0b1101011 (107),
768+ * but every other method proves that this is wrong, so it's really 106 that
769+ * programs the final 3.4V.
770+ */
766771 static const struct linear_range axp717_dcdc2_ranges[] = {
767772 REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
768773 REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
769− REGULATOR_LINEAR_RANGE(1600000, 88, 107, 100000),
774+ REGULATOR_LINEAR_RANGE(1600000, 88, 106, 100000),
770775 };
771776
772777 static const struct linear_range axp717_dcdc3_ranges[] = {
@@ -790,40 +795,40 @@ static const struct regulator_desc axp717_regulators[] = { · 17 unmodified lines
790795 AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,
791796 AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
792797 AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
793− AXP_DESC(AXP717, ALDO1, "aldo1", "vin1", 500, 3500, 100,
798+ AXP_DESC(AXP717, ALDO1, "aldo1", "aldoin", 500, 3500, 100,
794799 AXP717_ALDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
795800 AXP717_LDO0_OUTPUT_CONTROL, BIT(0)),
796− AXP_DESC(AXP717, ALDO2, "aldo2", "vin1", 500, 3500, 100,
801+ AXP_DESC(AXP717, ALDO2, "aldo2", "aldoin", 500, 3500, 100,
797802 AXP717_ALDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
798803 AXP717_LDO0_OUTPUT_CONTROL, BIT(1)),
799− AXP_DESC(AXP717, ALDO3, "aldo3", "vin1", 500, 3500, 100,
804+ AXP_DESC(AXP717, ALDO3, "aldo3", "aldoin", 500, 3500, 100,
800805 AXP717_ALDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
801806 AXP717_LDO0_OUTPUT_CONTROL, BIT(2)),
802− AXP_DESC(AXP717, ALDO4, "aldo4", "vin1", 500, 3500, 100,
807+ AXP_DESC(AXP717, ALDO4, "aldo4", "aldoin", 500, 3500, 100,
803808 AXP717_ALDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
804809 AXP717_LDO0_OUTPUT_CONTROL, BIT(3)),
805− AXP_DESC(AXP717, BLDO1, "bldo1", "vin1", 500, 3500, 100,
810+ AXP_DESC(AXP717, BLDO1, "bldo1", "bldoin", 500, 3500, 100,
806811 AXP717_BLDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
807812 AXP717_LDO0_OUTPUT_CONTROL, BIT(4)),
808− AXP_DESC(AXP717, BLDO2, "bldo2", "vin1", 500, 3500, 100,
813+ AXP_DESC(AXP717, BLDO2, "bldo2", "bldoin", 500, 3500, 100,
809814 AXP717_BLDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
810815 AXP717_LDO0_OUTPUT_CONTROL, BIT(5)),
811− AXP_DESC(AXP717, BLDO3, "bldo3", "vin1", 500, 3500, 100,
816+ AXP_DESC(AXP717, BLDO3, "bldo3", "bldoin", 500, 3500, 100,
812817 AXP717_BLDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
813818 AXP717_LDO0_OUTPUT_CONTROL, BIT(6)),
814− AXP_DESC(AXP717, BLDO4, "bldo4", "vin1", 500, 3500, 100,
819+ AXP_DESC(AXP717, BLDO4, "bldo4", "bldoin", 500, 3500, 100,
815820 AXP717_BLDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
816821 AXP717_LDO0_OUTPUT_CONTROL, BIT(7)),
817− AXP_DESC(AXP717, CLDO1, "cldo1", "vin1", 500, 3500, 100,
822+ AXP_DESC(AXP717, CLDO1, "cldo1", "cldoin", 500, 3500, 100,
818823 AXP717_CLDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
819824 AXP717_LDO1_OUTPUT_CONTROL, BIT(0)),
820− AXP_DESC(AXP717, CLDO2, "cldo2", "vin1", 500, 3500, 100,
825+ AXP_DESC(AXP717, CLDO2, "cldo2", "cldoin", 500, 3500, 100,
821826 AXP717_CLDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
822827 AXP717_LDO1_OUTPUT_CONTROL, BIT(1)),
823− AXP_DESC(AXP717, CLDO3, "cldo3", "vin1", 500, 3500, 100,
828+ AXP_DESC(AXP717, CLDO3, "cldo3", "cldoin", 500, 3500, 100,
824829 AXP717_CLDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
825830 AXP717_LDO1_OUTPUT_CONTROL, BIT(2)),
826− AXP_DESC(AXP717, CLDO4, "cldo4", "vin1", 500, 3500, 100,
831+ AXP_DESC(AXP717, CLDO4, "cldo4", "cldoin", 500, 3500, 100,
827832 AXP717_CLDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
828833 AXP717_LDO1_OUTPUT_CONTROL, BIT(3)),
829834 AXP_DESC(AXP717, CPUSLDO, "cpusldo", "vin1", 500, 1400, 50,
drivers/regulator/bd71815-regulator.c+1−1
@@ -256,7 +256,7 @@ static int buck12_set_hw_dvs_levels(struct device_node *np, · 255 unmodified lines
256256 * 10: 2.50mV/usec 10mV 4uS
257257 * 11: 1.25mV/usec 10mV 8uS
258258 */
259−static const unsigned int bd7181x_ramp_table[] = { 1250, 2500, 5000, 10000 };
259+static const unsigned int bd7181x_ramp_table[] = { 10000, 5000, 2500, 1250 };
260260
261261 static int bd7181x_led_set_current_limit(struct regulator_dev *rdev,
262262 int min_uA, int max_uA)
drivers/regulator/core.c+29−0
@@ -3347,6 +3347,7 @@ struct regmap *regulator_get_regmap(struct regulator *regulator) · 3346 unmodified lines
33473347
33483348 return map ? map : ERR_PTR(-EOPNOTSUPP);
33493349 }
3350+EXPORT_SYMBOL_GPL(regulator_get_regmap);
33503351
33513352 /**
33523353 * regulator_get_hardware_vsel_register - get the HW voltage selector register
@@ -3407,6 +3408,34 @@ int regulator_list_hardware_vsel(struct regulator *regulator, · 54 unmodified lines
34073408 }
34083409 EXPORT_SYMBOL_GPL(regulator_list_hardware_vsel);
34093410
3411+/**
3412+ * regulator_hardware_enable - access the HW for enable/disable regulator
3413+ * @regulator: regulator source
3414+ * @enable: true for enable, false for disable
3415+ *
3416+ * Request that the regulator be enabled/disabled with the regulator output at
3417+ * the predefined voltage or current value.
3418+ *
3419+ * On success 0 is returned, otherwise a negative errno is returned.
3420+ */
3421+int regulator_hardware_enable(struct regulator *regulator, bool enable)
3422+{
3423+ struct regulator_dev *rdev = regulator->rdev;
3424+ const struct regulator_ops *ops = rdev->desc->ops;
3425+ int ret = -EOPNOTSUPP;
3426+
3427+ if (!rdev->exclusive || !ops || !ops->enable || !ops->disable)
3428+ return ret;
3429+
3430+ if (enable)
3431+ ret = ops->enable(rdev);
3432+ else
3433+ ret = ops->disable(rdev);
3434+
3435+ return ret;
3436+}
3437+EXPORT_SYMBOL_GPL(regulator_hardware_enable);
3438+
34103439 /**
34113440 * regulator_get_linear_step - return the voltage step size between VSEL values
34123441 * @regulator: regulator source
drivers/regulator/renesas-usb-vbus-regulator.c+74−0
@@ -0,0 +1,74 @@
1+// SPDX-License-Identifier: GPL-2.0
2+//
3+// Renesas USB VBUS output regulator driver
4+//
5+// Copyright (C) 2024 Renesas Electronics Corporation
6+//
7+
8+#include <linux/module.h>
9+#include <linux/err.h>
10+#include <linux/kernel.h>
11+#include <linux/of.h>
12+#include <linux/platform_device.h>
13+#include <linux/regmap.h>
14+#include <linux/regulator/driver.h>
15+#include <linux/regulator/of_regulator.h>
16+
17+static const struct regulator_ops rzg2l_usb_vbus_reg_ops = {
18+ .enable = regulator_enable_regmap,
19+ .disable = regulator_disable_regmap,
20+ .is_enabled = regulator_is_enabled_regmap,
21+};
22+
23+static const struct regulator_desc rzg2l_usb_vbus_rdesc = {
24+ .name = "vbus",
25+ .of_match = of_match_ptr("regulator-vbus"),
26+ .ops = &rzg2l_usb_vbus_reg_ops,
27+ .type = REGULATOR_VOLTAGE,
28+ .owner = THIS_MODULE,
29+ .enable_reg = 0,
30+ .enable_mask = BIT(0),
31+ .enable_is_inverted = true,
32+ .fixed_uV = 5000000,
33+ .n_voltages = 1,
34+};
35+
36+static int rzg2l_usb_vbus_regulator_probe(struct platform_device *pdev)
37+{
38+ struct regulator_config config = { };
39+ struct device *dev = &pdev->dev;
40+ struct regulator_dev *rdev;
41+
42+ config.regmap = dev_get_regmap(dev->parent, NULL);
43+ if (!config.regmap)
44+ return dev_err_probe(dev, -ENOENT, "Failed to get regmap\n");
45+
46+ config.dev = dev;
47+ config.of_node = of_get_child_by_name(dev->parent->of_node, "regulator-vbus");
48+ if (!config.of_node)
49+ return dev_err_probe(dev, -ENODEV, "regulator node not found\n");
50+
51+ rdev = devm_regulator_register(dev, &rzg2l_usb_vbus_rdesc, &config);
52+ if (IS_ERR(rdev)) {
53+ of_node_put(config.of_node);
54+ return dev_err_probe(dev, PTR_ERR(rdev),
55+ "not able to register vbus regulator\n");
56+ }
57+
58+ of_node_put(config.of_node);
59+
60+ return 0;
61+}
62+
63+static struct platform_driver rzg2l_usb_vbus_regulator_driver = {
64+ .probe = rzg2l_usb_vbus_regulator_probe,
65+ .driver = {
66+ .name = "rzg2l-usb-vbus-regulator",
67+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
68+ },
69+};
70+module_platform_driver(rzg2l_usb_vbus_regulator_driver);
71+
72+MODULE_AUTHOR("Biju Das <biju.das.jz@bp.renesas.com>");
73+MODULE_DESCRIPTION("Renesas RZ/G2L USB Vbus Regulator Driver");
74+MODULE_LICENSE("GPL");
drivers/regulator/tps6594-regulator.c+4−8
@@ -653,18 +653,14 @@ static int tps6594_regulator_probe(struct platform_device *pdev) · 652 unmodified lines
653653 }
654654 }
655655
656− if (tps->chip_id == LP8764) {
657− nr_buck = ARRAY_SIZE(buck_regs);
658− nr_ldo = 0;
659− nr_types = REGS_INT_NB;
660− } else if (tps->chip_id == TPS65224) {
656+ if (tps->chip_id == TPS65224) {
661657 nr_buck = ARRAY_SIZE(tps65224_buck_regs);
662658 nr_ldo = ARRAY_SIZE(tps65224_ldo_regs);
663− nr_types = REGS_INT_NB;
659+ nr_types = TPS65224_REGS_INT_NB;
664660 } else {
665661 nr_buck = ARRAY_SIZE(buck_regs);
666− nr_ldo = ARRAY_SIZE(tps6594_ldo_regs);
667− nr_types = TPS65224_REGS_INT_NB;
662+ nr_ldo = (tps->chip_id == LP8764) ? 0 : ARRAY_SIZE(tps6594_ldo_regs);
663+ nr_types = REGS_INT_NB;
668664 }
669665
670666 reg_irq_nb = nr_types * (nr_buck + nr_ldo);
drivers/scsi/sd.c+4−0
@@ -63,6 +63,7 @@ · 62 unmodified lines
6363 #include <scsi/scsi_cmnd.h>
6464 #include <scsi/scsi_dbg.h>
6565 #include <scsi/scsi_device.h>
66+#include <scsi/scsi_devinfo.h>
6667 #include <scsi/scsi_driver.h>
6768 #include <scsi/scsi_eh.h>
6869 #include <scsi/scsi_host.h>
@@ -3118,6 +3119,9 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer) · 3049 unmodified lines
31183119 struct scsi_mode_data data;
31193120 int res;
31203121
3122+ if (sdp->sdev_bflags & BLIST_SKIP_IO_HINTS)
3123+ return;
3124+
31213125 res = scsi_mode_sense(sdp, /*dbd=*/0x8, /*modepage=*/0x0a,
31223126 /*subpage=*/0x05, buffer, SD_BUF_SIZE, SD_TIMEOUT,
31233127 sdkp->max_retries, &data, &sshdr);
drivers/soc/tegra/fuse/fuse-tegra.c+2−2
@@ -127,8 +127,8 @@ static void tegra_fuse_print_sku_info(struct tegra_sku_info *tegra_sku_info) · 126 unmodified lines
127127
128128 static int tegra_fuse_add_lookups(struct tegra_fuse *fuse)
129129 {
130− fuse->lookups = kmemdup_array(fuse->soc->lookups, sizeof(*fuse->lookups),
131− fuse->soc->num_lookups, GFP_KERNEL);
130+ fuse->lookups = kmemdup_array(fuse->soc->lookups, fuse->soc->num_lookups,
131+ sizeof(*fuse->lookups), GFP_KERNEL);
132132 if (!fuse->lookups)
133133 return -ENOMEM;
134134
drivers/soundwire/amd_manager.c+3−0
@@ -571,6 +571,9 @@ static int sdw_master_read_amd_prop(struct sdw_bus *bus) · 570 unmodified lines
571571 amd_manager->wake_en_mask = wake_en_mask;
572572 fwnode_property_read_u32(link, "amd-sdw-power-mode", &power_mode_mask);
573573 amd_manager->power_mode_mask = power_mode_mask;
574+
575+ fwnode_handle_put(link);
576+
574577 return 0;
575578 }
576579
drivers/soundwire/intel_auxdevice.c+5−1
@@ -155,8 +155,10 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) · 154 unmodified lines
155155 SDW_MASTER_QUIRKS_CLEAR_INITIAL_PARITY;
156156
157157 intel_prop = devm_kzalloc(bus->dev, sizeof(*intel_prop), GFP_KERNEL);
158− if (!intel_prop)
158+ if (!intel_prop) {
159+ fwnode_handle_put(link);
159160 return -ENOMEM;
161+ }
160162
161163 /* initialize with hardware defaults, in case the properties are not found */
162164 intel_prop->doaise = 0x1;
@@ -184,6 +186,8 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) · 21 unmodified lines
184186 intel_prop->dodse,
185187 intel_prop->dods);
186188
189+ fwnode_handle_put(link);
190+
187191 return 0;
188192 }
189193
drivers/soundwire/mipi_disco.c+24−6
@@ -66,8 +66,10 @@ int sdw_master_read_prop(struct sdw_bus *bus) · 65 unmodified lines
6666 prop->clk_freq = devm_kcalloc(bus->dev, prop->num_clk_freq,
6767 sizeof(*prop->clk_freq),
6868 GFP_KERNEL);
69− if (!prop->clk_freq)
69+ if (!prop->clk_freq) {
70+ fwnode_handle_put(link);
7071 return -ENOMEM;
72+ }
7173
7274 fwnode_property_read_u32_array(link,
7375 "mipi-sdw-clock-frequencies-supported",
@@ -92,8 +94,10 @@ int sdw_master_read_prop(struct sdw_bus *bus) · 18 unmodified lines
9294 prop->clk_gears = devm_kcalloc(bus->dev, prop->num_clk_gears,
9395 sizeof(*prop->clk_gears),
9496 GFP_KERNEL);
95− if (!prop->clk_gears)
97+ if (!prop->clk_gears) {
98+ fwnode_handle_put(link);
9699 return -ENOMEM;
100+ }
97101
98102 fwnode_property_read_u32_array(link,
99103 "mipi-sdw-supported-clock-gears",
@@ -116,6 +120,8 @@ int sdw_master_read_prop(struct sdw_bus *bus) · 16 unmodified lines
116120 fwnode_property_read_u32(link, "mipi-sdw-command-error-threshold",
117121 &prop->err_threshold);
118122
123+ fwnode_handle_put(link);
124+
119125 return 0;
120126 }
121127 EXPORT_SYMBOL(sdw_master_read_prop);
@@ -197,8 +203,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, · 75 unmodified lines
197203 dpn[i].num_words,
198204 sizeof(*dpn[i].words),
199205 GFP_KERNEL);
200− if (!dpn[i].words)
206+ if (!dpn[i].words) {
207+ fwnode_handle_put(node);
201208 return -ENOMEM;
209+ }
202210
203211 fwnode_property_read_u32_array(node,
204212 "mipi-sdw-port-wordlength-configs",
@@ -236,8 +244,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, · 31 unmodified lines
236244 dpn[i].num_channels,
237245 sizeof(*dpn[i].channels),
238246 GFP_KERNEL);
239− if (!dpn[i].channels)
247+ if (!dpn[i].channels) {
248+ fwnode_handle_put(node);
240249 return -ENOMEM;
250+ }
241251
242252 fwnode_property_read_u32_array(node,
243253 "mipi-sdw-channel-number-list",
@@ -251,8 +261,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, · 7 unmodified lines
251261 dpn[i].num_ch_combinations,
252262 sizeof(*dpn[i].ch_combinations),
253263 GFP_KERNEL);
254− if (!dpn[i].ch_combinations)
264+ if (!dpn[i].ch_combinations) {
265+ fwnode_handle_put(node);
255266 return -ENOMEM;
267+ }
256268
257269 fwnode_property_read_u32_array(node,
258270 "mipi-sdw-channel-combination-list",
@@ -274,6 +286,8 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, · 15 unmodified lines
274286
275287 /* TODO: Read audio mode */
276288
289+ fwnode_handle_put(node);
290+
277291 i++;
278292 }
279293
@@ -348,10 +362,14 @@ int sdw_slave_read_prop(struct sdw_slave *slave) · 68 unmodified lines
348362 prop->dp0_prop = devm_kzalloc(&slave->dev,
349363 sizeof(*prop->dp0_prop),
350364 GFP_KERNEL);
351− if (!prop->dp0_prop)
365+ if (!prop->dp0_prop) {
366+ fwnode_handle_put(port);
352367 return -ENOMEM;
368+ }
353369
354370 sdw_slave_read_dp0(slave, port, prop->dp0_prop);
371+
372+ fwnode_handle_put(port);
355373 }
356374
357375 /*
drivers/spi/spi-cs42l43.c+3−3
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/units.h>
2727
2828 #define CS42L43_FIFO_SIZE 16
29−#define CS42L43_SPI_ROOT_HZ (40 * HZ_PER_MHZ)
29+#define CS42L43_SPI_ROOT_HZ 49152000
3030 #define CS42L43_SPI_MAX_LENGTH 65532
3131
3232 enum cs42l43_spi_cmd {
@@ -54,7 +54,7 @@ static const struct software_node ampr = { · 21 unmodified lines
5454
5555 static struct spi_board_info ampl_info = {
5656 .modalias = "cs35l56",
57− .max_speed_hz = 20 * HZ_PER_MHZ,
57+ .max_speed_hz = 11 * HZ_PER_MHZ,
5858 .chip_select = 0,
5959 .mode = SPI_MODE_0,
6060 .swnode = &ampl,
@@ -62,7 +62,7 @@ static struct spi_board_info ampl_info = { · 1 unmodified line
6262
6363 static struct spi_board_info ampr_info = {
6464 .modalias = "cs35l56",
65− .max_speed_hz = 20 * HZ_PER_MHZ,
65+ .max_speed_hz = 11 * HZ_PER_MHZ,
6666 .chip_select = 1,
6767 .mode = SPI_MODE_0,
6868 .swnode = &ampr,
drivers/spi/spi-imx.c+2−12
@@ -660,18 +660,8 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, · 659 unmodified lines
660660 ctrl |= (spi_imx->target_burst * 8 - 1)
661661 << MX51_ECSPI_CTRL_BL_OFFSET;
662662 else {
663− if (spi_imx->usedma) {
664− ctrl |= (spi_imx->bits_per_word - 1)
665− << MX51_ECSPI_CTRL_BL_OFFSET;
666− } else {
667− if (spi_imx->count >= MX51_ECSPI_CTRL_MAX_BURST)
668− ctrl |= (MX51_ECSPI_CTRL_MAX_BURST * BITS_PER_BYTE - 1)
669− << MX51_ECSPI_CTRL_BL_OFFSET;
670− else
671− ctrl |= (spi_imx->count / DIV_ROUND_UP(spi_imx->bits_per_word,
672− BITS_PER_BYTE) * spi_imx->bits_per_word - 1)
673− << MX51_ECSPI_CTRL_BL_OFFSET;
674− }
663+ ctrl |= (spi_imx->bits_per_word - 1)
664+ << MX51_ECSPI_CTRL_BL_OFFSET;
675665 }
676666
677667 /* set clock speed */
drivers/spi/spi-stm32-qspi.c+5−7
@@ -349,7 +349,7 @@ static int stm32_qspi_wait_poll_status(struct stm32_qspi *qspi) · 348 unmodified lines
349349
350350 static int stm32_qspi_get_mode(u8 buswidth)
351351 {
352− if (buswidth == 4)
352+ if (buswidth >= 4)
353353 return CCR_BUSWIDTH_4;
354354
355355 return buswidth;
@@ -653,9 +653,7 @@ static int stm32_qspi_setup(struct spi_device *spi) · 297 unmodified lines
653653 return -EINVAL;
654654
655655 mode = spi->mode & (SPI_TX_OCTAL | SPI_RX_OCTAL);
656− if ((mode == SPI_TX_OCTAL || mode == SPI_RX_OCTAL) ||
657− ((mode == (SPI_TX_OCTAL | SPI_RX_OCTAL)) &&
658− gpiod_count(qspi->dev, "cs") == -ENOENT)) {
656+ if (mode && gpiod_count(qspi->dev, "cs") == -ENOENT) {
659657 dev_err(qspi->dev, "spi-rx-bus-width\\/spi-tx-bus-width\\/cs-gpios\n");
660658 dev_err(qspi->dev, "configuration not supported\n");
661659
@@ -676,10 +674,10 @@ static int stm32_qspi_setup(struct spi_device *spi) · 14 unmodified lines
676674 qspi->cr_reg = CR_APMS | 3 << CR_FTHRES_SHIFT | CR_SSHIFT | CR_EN;
677675
678676 /*
679− * Dual flash mode is only enable in case SPI_TX_OCTAL and SPI_TX_OCTAL
680− * are both set in spi->mode and "cs-gpios" properties is found in DT
677+ * Dual flash mode is only enable in case SPI_TX_OCTAL or SPI_RX_OCTAL
678+ * is set in spi->mode and "cs-gpios" properties is found in DT
681679 */
682− if (mode == (SPI_TX_OCTAL | SPI_RX_OCTAL)) {
680+ if (mode) {
683681 qspi->cr_reg |= CR_DFM;
684682 dev_dbg(qspi->dev, "Dual flash mode enable");
685683 }
drivers/spi/spi.c+10−6
@@ -689,10 +689,12 @@ static int __spi_add_device(struct spi_device *spi) · 688 unmodified lines
689689 * Make sure that multiple logical CS doesn't map to the same physical CS.
690690 * For example, spi->chip_select[0] != spi->chip_select[1] and so on.
691691 */
692− for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
693− status = spi_dev_check_cs(dev, spi, idx, spi, idx + 1);
694− if (status)
695− return status;
692+ if (!spi_controller_is_target(ctlr)) {
693+ for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
694+ status = spi_dev_check_cs(dev, spi, idx, spi, idx + 1);
695+ if (status)
696+ return status;
697+ }
696698 }
697699
698700 /* Set the bus ID string */
@@ -4156,7 +4158,8 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) · 3457 unmodified lines
41564158 return -EINVAL;
41574159 if (xfer->tx_nbits != SPI_NBITS_SINGLE &&
41584160 xfer->tx_nbits != SPI_NBITS_DUAL &&
4159− xfer->tx_nbits != SPI_NBITS_QUAD)
4161+ xfer->tx_nbits != SPI_NBITS_QUAD &&
4162+ xfer->tx_nbits != SPI_NBITS_OCTAL)
41604163 return -EINVAL;
41614164 if ((xfer->tx_nbits == SPI_NBITS_DUAL) &&
41624165 !(spi->mode & (SPI_TX_DUAL | SPI_TX_QUAD)))
@@ -4171,7 +4174,8 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) · 8 unmodified lines
41714174 return -EINVAL;
41724175 if (xfer->rx_nbits != SPI_NBITS_SINGLE &&
41734176 xfer->rx_nbits != SPI_NBITS_DUAL &&
4174− xfer->rx_nbits != SPI_NBITS_QUAD)
4177+ xfer->rx_nbits != SPI_NBITS_QUAD &&
4178+ xfer->rx_nbits != SPI_NBITS_OCTAL)
41754179 return -EINVAL;
41764180 if ((xfer->rx_nbits == SPI_NBITS_DUAL) &&
41774181 !(spi->mode & (SPI_RX_DUAL | SPI_RX_QUAD)))
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c+2−1
@@ -150,7 +150,7 @@ static irqreturn_t proc_thermal_irq_handler(int irq, void *devid) · 149 unmodified lines
150150 {
151151 struct proc_thermal_pci *pci_info = devid;
152152 struct proc_thermal_device *proc_priv;
153− int ret = IRQ_HANDLED;
153+ int ret = IRQ_NONE;
154154 u32 status;
155155
156156 proc_priv = pci_info->proc_priv;
@@ -175,6 +175,7 @@ static irqreturn_t proc_thermal_irq_handler(int irq, void *devid) · 18 unmodified lines
175175 /* Disable enable interrupt flag */
176176 proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_INT_ENABLE_0, 0);
177177 pkg_thermal_schedule_work(&pci_info->work);
178+ ret = IRQ_HANDLED;
178179 }
179180
180181 pci_write_config_byte(pci_info->pdev, 0xdc, 0x01);
drivers/thermal/mediatek/lvts_thermal.c+5−7
@@ -769,7 +769,11 @@ static int lvts_golden_temp_init(struct device *dev, u8 *calib, · 768 unmodified lines
769769 */
770770 gt = (((u32 *)calib)[0] >> lvts_data->gt_calib_bit_offset) & 0xff;
771771
772− if (gt && gt < LVTS_GOLDEN_TEMP_MAX)
772+ /* A zero value for gt means that device has invalid efuse data */
773+ if (!gt)
774+ return -ENODATA;
775+
776+ if (gt < LVTS_GOLDEN_TEMP_MAX)
773777 golden_temp = gt;
774778
775779 golden_temp_offset = golden_temp * 500 + lvts_data->temp_offset;
@@ -1458,7 +1462,6 @@ static const struct lvts_ctrl_data mt8188_lvts_mcu_data_ctrl[] = { · 682 unmodified lines
14581462 },
14591463 VALID_SENSOR_MAP(1, 1, 1, 1),
14601464 .offset = 0x0,
1461− .mode = LVTS_MSR_FILTERED_MODE,
14621465 },
14631466 {
14641467 .lvts_sensor = {
@@ -1469,7 +1472,6 @@ static const struct lvts_ctrl_data mt8188_lvts_mcu_data_ctrl[] = { · 4 unmodified lines
14691472 },
14701473 VALID_SENSOR_MAP(1, 1, 0, 0),
14711474 .offset = 0x100,
1472− .mode = LVTS_MSR_FILTERED_MODE,
14731475 }
14741476 };
14751477
@@ -1483,7 +1485,6 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = { · 7 unmodified lines
14831485 },
14841486 VALID_SENSOR_MAP(0, 1, 0, 0),
14851487 .offset = 0x0,
1486− .mode = LVTS_MSR_FILTERED_MODE,
14871488 },
14881489 {
14891490 .lvts_sensor = {
@@ -1496,7 +1497,6 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = { · 6 unmodified lines
14961497 },
14971498 VALID_SENSOR_MAP(1, 1, 1, 0),
14981499 .offset = 0x100,
1499− .mode = LVTS_MSR_FILTERED_MODE,
15001500 },
15011501 {
15021502 .lvts_sensor = {
@@ -1507,7 +1507,6 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = { · 4 unmodified lines
15071507 },
15081508 VALID_SENSOR_MAP(1, 1, 0, 0),
15091509 .offset = 0x200,
1510− .mode = LVTS_MSR_FILTERED_MODE,
15111510 },
15121511 {
15131512 .lvts_sensor = {
@@ -1518,7 +1517,6 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = { · 4 unmodified lines
15181517 },
15191518 VALID_SENSOR_MAP(1, 1, 0, 0),
15201519 .offset = 0x300,
1521− .mode = LVTS_MSR_FILTERED_MODE,
15221520 }
15231521 };
15241522
drivers/thermal/thermal_core.c+27−0
@@ -1406,6 +1406,7 @@ thermal_zone_device_register_with_trips(const char *type, · 1405 unmodified lines
14061406 ida_init(&tz->ida);
14071407 mutex_init(&tz->lock);
14081408 init_completion(&tz->removal);
1409+ init_completion(&tz->resume);
14091410 id = ida_alloc(&thermal_tz_ida, GFP_KERNEL);
14101411 if (id < 0) {
14111412 result = id;
@@ -1651,6 +1652,9 @@ static void thermal_zone_device_resume(struct work_struct *work) · 239 unmodified lines
16511652 thermal_zone_device_init(tz);
16521653 __thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
16531654
1655+ complete(&tz->resume);
1656+ tz->resuming = false;
1657+
16541658 mutex_unlock(&tz->lock);
16551659 }
16561660
@@ -1668,6 +1672,20 @@ static int thermal_pm_notify(struct notifier_block *nb, · 11 unmodified lines
16681672 list_for_each_entry(tz, &thermal_tz_list, node) {
16691673 mutex_lock(&tz->lock);
16701674
1675+ if (tz->resuming) {
1676+ /*
1677+ * thermal_zone_device_resume() queued up for
1678+ * this zone has not acquired the lock yet, so
1679+ * release it to let the function run and wait
1680+ * util it has done the work.
1681+ */
1682+ mutex_unlock(&tz->lock);
1683+
1684+ wait_for_completion(&tz->resume);
1685+
1686+ mutex_lock(&tz->lock);
1687+ }
1688+
16711689 tz->suspended = true;
16721690
16731691 mutex_unlock(&tz->lock);
@@ -1685,6 +1703,9 @@ static int thermal_pm_notify(struct notifier_block *nb, · 11 unmodified lines
16851703
16861704 cancel_delayed_work(&tz->poll_queue);
16871705
1706+ reinit_completion(&tz->resume);
1707+ tz->resuming = true;
1708+
16881709 /*
16891710 * Replace the work function with the resume one, which
16901711 * will restore the original work function and schedule
@@ -1709,6 +1730,12 @@ static int thermal_pm_notify(struct notifier_block *nb, · 18 unmodified lines
17091730
17101731 static struct notifier_block thermal_pm_nb = {
17111732 .notifier_call = thermal_pm_notify,
1733+ /*
1734+ * Run at the lowest priority to avoid interference between the thermal
1735+ * zone resume work items spawned by thermal_pm_notify() and the other
1736+ * PM notifiers.
1737+ */
1738+ .priority = INT_MIN,
17121739 };
17131740
17141741 static int __init thermal_init(void)
drivers/thermal/thermal_core.h+4−0
@@ -55,6 +55,7 @@ struct thermal_governor { · 54 unmodified lines
5555 * @type: the thermal zone device type
5656 * @device: &struct device for this thermal zone
5757 * @removal: removal completion
58+ * @resume: resume completion
5859 * @trip_temp_attrs: attributes for trip points for sysfs: trip temperature
5960 * @trip_type_attrs: attributes for trip points for sysfs: trip type
6061 * @trip_hyst_attrs: attributes for trip points for sysfs: trip hysteresis
@@ -89,6 +90,7 @@ struct thermal_governor { · 28 unmodified lines
8990 * @poll_queue: delayed work for polling
9091 * @notify_event: Last notification event
9192 * @suspended: thermal zone suspend indicator
93+ * @resuming: indicates whether or not thermal zone resume is in progress
9294 * @trips: array of struct thermal_trip objects
9395 */
9496 struct thermal_zone_device {
@@ -96,6 +98,7 @@ struct thermal_zone_device { · 1 unmodified line
9698 char type[THERMAL_NAME_LENGTH];
9799 struct device device;
98100 struct completion removal;
101+ struct completion resume;
99102 struct attribute_group trips_attribute_group;
100103 struct thermal_attr *trip_temp_attrs;
101104 struct thermal_attr *trip_type_attrs;
@@ -123,6 +126,7 @@ struct thermal_zone_device { · 21 unmodified lines
123126 struct delayed_work poll_queue;
124127 enum thermal_notify_event notify_event;
125128 bool suspended;
129+ bool resuming;
126130 #ifdef CONFIG_THERMAL_DEBUGFS
127131 struct thermal_debugfs *debugfs;
128132 #endif
drivers/ufs/core/ufshcd.c+1−0
@@ -8787,6 +8787,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params) · 8786 unmodified lines
87878787 (hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH)) {
87888788 /* Reset the device and controller before doing reinit */
87898789 ufshcd_device_reset(hba);
8790+ ufs_put_device_desc(hba);
87908791 ufshcd_hba_stop(hba);
87918792 ufshcd_vops_reinit_notify(hba);
87928793 ret = ufshcd_hba_enable(hba);
drivers/usb/storage/scsiglue.c+6−0
@@ -79,6 +79,12 @@ static int slave_alloc (struct scsi_device *sdev) · 78 unmodified lines
7979 if (us->protocol == USB_PR_BULK && us->max_lun > 0)
8080 sdev->sdev_bflags |= BLIST_FORCELUN;
8181
82+ /*
83+ * Some USB storage devices reset if the IO advice hints grouping mode
84+ * page is queried. Hence skip that mode page.
85+ */
86+ sdev->sdev_bflags |= BLIST_SKIP_IO_HINTS;
87+
8288 return 0;
8389 }
8490
drivers/usb/storage/uas.c+7−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <scsi/scsi.h>
2222 #include <scsi/scsi_eh.h>
2323 #include <scsi/scsi_dbg.h>
24+#include <scsi/scsi_devinfo.h>
2425 #include <scsi/scsi_cmnd.h>
2526 #include <scsi/scsi_device.h>
2627 #include <scsi/scsi_host.h>
@@ -820,6 +821,12 @@ static int uas_slave_alloc(struct scsi_device *sdev) · 793 unmodified lines
820821 struct uas_dev_info *devinfo =
821822 (struct uas_dev_info *)sdev->host->hostdata;
822823
824+ /*
825+ * Some USB storage devices reset if the IO advice hints grouping mode
826+ * page is queried. Hence skip that mode page.
827+ */
828+ sdev->sdev_bflags |= BLIST_SKIP_IO_HINTS;
829+
823830 sdev->hostdata = devinfo;
824831 return 0;
825832 }
fs/bcachefs/alloc_background.c+61−15
@@ -259,6 +259,14 @@ int bch2_alloc_v4_invalid(struct bch_fs *c, struct bkey_s_c k, · 258 unmodified lines
259259 "invalid data type (got %u should be %u)",
260260 a.v->data_type, alloc_data_type(*a.v, a.v->data_type));
261261
262+ for (unsigned i = 0; i < 2; i++)
263+ bkey_fsck_err_on(a.v->io_time[i] > LRU_TIME_MAX,
264+ c, err,
265+ alloc_key_io_time_bad,
266+ "invalid io_time[%s]: %llu, max %llu",
267+ i == READ ? "read" : "write",
268+ a.v->io_time[i], LRU_TIME_MAX);
269+
262270 switch (a.v->data_type) {
263271 case BCH_DATA_free:
264272 case BCH_DATA_need_gc_gens:
@@ -757,8 +765,8 @@ int bch2_trigger_alloc(struct btree_trans *trans, · 492 unmodified lines
757765 alloc_data_type_set(new_a, new_a->data_type);
758766
759767 if (bch2_bucket_sectors_total(*new_a) > bch2_bucket_sectors_total(*old_a)) {
760− new_a->io_time[READ] = max_t(u64, 1, atomic64_read(&c->io_clock[READ].now));
761− new_a->io_time[WRITE]= max_t(u64, 1, atomic64_read(&c->io_clock[WRITE].now));
768+ new_a->io_time[READ] = bch2_current_io_time(c, READ);
769+ new_a->io_time[WRITE]= bch2_current_io_time(c, WRITE);
762770 SET_BCH_ALLOC_V4_NEED_INC_GEN(new_a, true);
763771 SET_BCH_ALLOC_V4_NEED_DISCARD(new_a, true);
764772 }
@@ -768,6 +776,7 @@ int bch2_trigger_alloc(struct btree_trans *trans, · 3 unmodified lines
768776 !bch2_bucket_is_open_safe(c, new.k->p.inode, new.k->p.offset)) {
769777 new_a->gen++;
770778 SET_BCH_ALLOC_V4_NEED_INC_GEN(new_a, false);
779+ alloc_data_type_set(new_a, new_a->data_type);
771780 }
772781
773782 if (old_a->data_type != new_a->data_type ||
@@ -781,7 +790,7 @@ int bch2_trigger_alloc(struct btree_trans *trans, · 7 unmodified lines
781790
782791 if (new_a->data_type == BCH_DATA_cached &&
783792 !new_a->io_time[READ])
784− new_a->io_time[READ] = max_t(u64, 1, atomic64_read(&c->io_clock[READ].now));
793+ new_a->io_time[READ] = bch2_current_io_time(c, READ);
785794
786795 u64 old_lru = alloc_lru_idx_read(*old_a);
787796 u64 new_lru = alloc_lru_idx_read(*new_a);
@@ -882,7 +891,7 @@ int bch2_trigger_alloc(struct btree_trans *trans, · 94 unmodified lines
882891 closure_wake_up(&c->freelist_wait);
883892
884893 if (statechange(a->data_type == BCH_DATA_need_discard) &&
885− !bch2_bucket_is_open(c, new.k->p.inode, new.k->p.offset) &&
894+ !bch2_bucket_is_open_safe(c, new.k->p.inode, new.k->p.offset) &&
886895 bucket_flushed(new_a))
887896 bch2_discard_one_bucket_fast(c, new.k->p);
888897
@@ -1579,7 +1588,7 @@ static int bch2_check_alloc_to_lru_ref(struct btree_trans *trans, · 690 unmodified lines
15791588 if (ret)
15801589 goto err;
15811590
1582− a_mut->v.io_time[READ] = atomic64_read(&c->io_clock[READ].now);
1591+ a_mut->v.io_time[READ] = bch2_current_io_time(c, READ);
15831592 ret = bch2_trans_update(trans, alloc_iter,
15841593 &a_mut->k_i, BTREE_TRIGGER_norun);
15851594 if (ret)
@@ -1634,7 +1643,7 @@ static int discard_in_flight_add(struct bch_fs *c, struct bpos bucket) · 48 unmodified lines
16341643 mutex_lock(&c->discard_buckets_in_flight_lock);
16351644 darray_for_each(c->discard_buckets_in_flight, i)
16361645 if (bkey_eq(*i, bucket)) {
1637− ret = -EEXIST;
1646+ ret = -BCH_ERR_EEXIST_discard_in_flight_add;
16381647 goto out;
16391648 }
16401649
@@ -1788,8 +1797,9 @@ static int bch2_discard_one_bucket(struct btree_trans *trans, · 147 unmodified lines
17881797 }
17891798
17901799 SET_BCH_ALLOC_V4_NEED_DISCARD(&a->v, false);
1791− alloc_data_type_set(&a->v, a->v.data_type);
17921800 write:
1801+ alloc_data_type_set(&a->v, a->v.data_type);
1802+
17931803 ret = bch2_trans_update(trans, &iter, &a->k_i, 0) ?:
17941804 bch2_trans_commit(trans, NULL, NULL,
17951805 BCH_WATERMARK_btree|
@@ -1975,8 +1985,8 @@ static int invalidate_one_bucket(struct btree_trans *trans, · 179 unmodified lines
19751985 a->v.data_type = 0;
19761986 a->v.dirty_sectors = 0;
19771987 a->v.cached_sectors = 0;
1978− a->v.io_time[READ] = atomic64_read(&c->io_clock[READ].now);
1979− a->v.io_time[WRITE] = atomic64_read(&c->io_clock[WRITE].now);
1988+ a->v.io_time[READ] = bch2_current_io_time(c, READ);
1989+ a->v.io_time[WRITE] = bch2_current_io_time(c, WRITE);
19801990
19811991 ret = bch2_trans_commit(trans, NULL, NULL,
19821992 BCH_WATERMARK_btree|
@@ -2011,6 +2021,21 @@ err: · 28 unmodified lines
20112021 goto out;
20122022 }
20132023
2024+static struct bkey_s_c next_lru_key(struct btree_trans *trans, struct btree_iter *iter,
2025+ struct bch_dev *ca, bool *wrapped)
2026+{
2027+ struct bkey_s_c k;
2028+again:
2029+ k = bch2_btree_iter_peek_upto(iter, lru_pos(ca->dev_idx, U64_MAX, LRU_TIME_MAX));
2030+ if (!k.k && !*wrapped) {
2031+ bch2_btree_iter_set_pos(iter, lru_pos(ca->dev_idx, 0, 0));
2032+ *wrapped = true;
2033+ goto again;
2034+ }
2035+
2036+ return k;
2037+}
2038+
20142039 static void bch2_do_invalidates_work(struct work_struct *work)
20152040 {
20162041 struct bch_fs *c = container_of(work, struct bch_fs, invalidate_work);
@@ -2024,12 +2049,33 @@ static void bch2_do_invalidates_work(struct work_struct *work) · 7 unmodified lines
20242049 for_each_member_device(c, ca) {
20252050 s64 nr_to_invalidate =
20262051 should_invalidate_buckets(ca, bch2_dev_usage_read(ca));
2052+ struct btree_iter iter;
2053+ bool wrapped = false;
2054+
2055+ bch2_trans_iter_init(trans, &iter, BTREE_ID_lru,
2056+ lru_pos(ca->dev_idx, 0,
2057+ ((bch2_current_io_time(c, READ) + U32_MAX) &
2058+ LRU_TIME_MAX)), 0);
20272059
2028− ret = for_each_btree_key_upto(trans, iter, BTREE_ID_lru,
2029− lru_pos(ca->dev_idx, 0, 0),
2030− lru_pos(ca->dev_idx, U64_MAX, LRU_TIME_MAX),
2031− BTREE_ITER_intent, k,
2032− invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate));
2060+ while (true) {
2061+ bch2_trans_begin(trans);
2062+
2063+ struct bkey_s_c k = next_lru_key(trans, &iter, ca, &wrapped);
2064+ ret = bkey_err(k);
2065+ if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2066+ continue;
2067+ if (ret)
2068+ break;
2069+ if (!k.k)
2070+ break;
2071+
2072+ ret = invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate);
2073+ if (ret)
2074+ break;
2075+
2076+ bch2_btree_iter_advance(&iter);
2077+ }
2078+ bch2_trans_iter_exit(trans, &iter);
20332079
20342080 if (ret < 0) {
20352081 bch2_dev_put(ca);
@@ -2204,7 +2250,7 @@ int bch2_bucket_io_time_reset(struct btree_trans *trans, unsigned dev, · 168 unmodified lines
22042250 if (ret)
22052251 return ret;
22062252
2207− now = atomic64_read(&c->io_clock[rw].now);
2253+ now = bch2_current_io_time(c, rw);
22082254 if (a->v.io_time[rw] == now)
22092255 goto out;
22102256
fs/bcachefs/alloc_background.h+7−1
@@ -141,7 +141,13 @@ static inline u64 alloc_lru_idx_fragmentation(struct bch_alloc_v4 a, · 140 unmodified lines
141141 !bch2_bucket_sectors_fragmented(ca, a))
142142 return 0;
143143
144− u64 d = bch2_bucket_sectors_dirty(a);
144+ /*
145+ * avoid overflowing LRU_TIME_BITS on a corrupted fs, when
146+ * bucket_sectors_dirty is (much) bigger than bucket_size
147+ */
148+ u64 d = min(bch2_bucket_sectors_dirty(a),
149+ ca->mi.bucket_size);
150+
145151 return div_u64(d * (1ULL << 31), ca->mi.bucket_size);
146152 }
147153
fs/bcachefs/bcachefs.h+5−0
@@ -1214,6 +1214,11 @@ static inline s64 bch2_current_time(const struct bch_fs *c) · 1213 unmodified lines
12141214 return timespec_to_bch2_time(c, now);
12151215 }
12161216
1217+static inline u64 bch2_current_io_time(const struct bch_fs *c, int rw)
1218+{
1219+ return max(1ULL, (u64) atomic64_read(&c->io_clock[rw].now) & LRU_TIME_MAX);
1220+}
1221+
12171222 static inline struct stdio_redirect *bch2_fs_stdio_redirect(struct bch_fs *c)
12181223 {
12191224 struct stdio_redirect *stdio = c->stdio;
fs/bcachefs/bcachefs_format.h+9−4
@@ -476,6 +476,9 @@ struct bch_lru { · 475 unmodified lines
476476
477477 #define LRU_ID_STRIPES (1U << 16)
478478
479+#define LRU_TIME_BITS 48
480+#define LRU_TIME_MAX ((1ULL << LRU_TIME_BITS) - 1)
481+
479482 /* Optional/variable size superblock sections: */
480483
481484 struct bch_sb_field {
@@ -987,8 +990,9 @@ enum bch_version_upgrade_opts { · 505 unmodified lines
987990
988991 #define BCH_ERROR_ACTIONS() \
989992 x(continue, 0) \
990− x(ro, 1) \
991− x(panic, 2)
993+ x(fix_safe, 1) \
994+ x(panic, 2) \
995+ x(ro, 3)
992996
993997 enum bch_error_actions {
994998 #define x(t, n) BCH_ON_ERROR_##t = n,
@@ -1382,9 +1386,10 @@ enum btree_id { · 387 unmodified lines
13821386
13831387 /*
13841388 * Maximum number of btrees that we will _ever_ have under the current scheme,
1385− * where we refer to them with bitfields
1389+ * where we refer to them with 64 bit bitfields - and we also need a bit for
1390+ * the interior btree node type:
13861391 */
1387−#define BTREE_ID_NR_MAX 64
1392+#define BTREE_ID_NR_MAX 63
13881393
13891394 static inline bool btree_id_is_alloc(enum btree_id id)
13901395 {
fs/bcachefs/bkey.c+1−1
@@ -1064,7 +1064,7 @@ void bch2_bkey_swab_key(const struct bkey_format *_f, struct bkey_packed *k) · 1063 unmodified lines
10641064 {
10651065 const struct bkey_format *f = bkey_packed(k) ? _f : &bch2_bkey_format_current;
10661066 u8 *l = k->key_start;
1067− u8 *h = (u8 *) (k->_data + f->key_u64s) - 1;
1067+ u8 *h = (u8 *) ((u64 *) k->_data + f->key_u64s) - 1;
10681068
10691069 while (l < h) {
10701070 swap(*l, *h);
fs/bcachefs/bkey_methods.c+5−1
@@ -398,8 +398,12 @@ void __bch2_bkey_compat(unsigned level, enum btree_id btree_id, · 397 unmodified lines
398398 for (i = 0; i < nr_compat; i++)
399399 switch (!write ? i : nr_compat - 1 - i) {
400400 case 0:
401− if (big_endian != CPU_BIG_ENDIAN)
401+ if (big_endian != CPU_BIG_ENDIAN) {
402+ bch2_bkey_swab_key(f, k);
403+ } else if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) {
402404 bch2_bkey_swab_key(f, k);
405+ bch2_bkey_swab_key(f, k);
406+ }
403407 break;
404408 case 1:
405409 if (version < bcachefs_metadata_version_bkey_renumber)
fs/bcachefs/bkey_methods.h+2−1
@@ -129,7 +129,8 @@ static inline void bch2_bkey_compat(unsigned level, enum btree_id btree_id, · 128 unmodified lines
129129 struct bkey_packed *k)
130130 {
131131 if (version < bcachefs_metadata_version_current ||
132− big_endian != CPU_BIG_ENDIAN)
132+ big_endian != CPU_BIG_ENDIAN ||
133+ IS_ENABLED(CONFIG_BCACHEFS_DEBUG))
133134 __bch2_bkey_compat(level, btree_id, version,
134135 big_endian, write, f, k);
135136
fs/bcachefs/btree_iter.c+8−3
@@ -3161,6 +3161,7 @@ struct btree_trans *__bch2_trans_get(struct bch_fs *c, unsigned fn_idx) · 3160 unmodified lines
31613161 list_add_done:
31623162 seqmutex_unlock(&c->btree_trans_lock);
31633163 got_trans:
3164+ trans->ref.closure_get_happened = false;
31643165 trans->c = c;
31653166 trans->last_begin_time = local_clock();
31663167 trans->fn_idx = fn_idx;
@@ -3235,7 +3236,6 @@ void bch2_trans_put(struct btree_trans *trans) · 68 unmodified lines
32353236 trans_for_each_update(trans, i)
32363237 __btree_path_put(trans->paths + i->path, true);
32373238 trans->nr_updates = 0;
3238− trans->locking_wait.task = NULL;
32393239
32403240 check_btree_paths_leaked(trans);
32413241
@@ -3256,6 +3256,13 @@ void bch2_trans_put(struct btree_trans *trans) · 14 unmodified lines
32563256 if (unlikely(trans->journal_replay_not_finished))
32573257 bch2_journal_keys_put(c);
32583258
3259+ /*
3260+ * trans->ref protects trans->locking_wait.task, btree_paths arary; used
3261+ * by cycle detector
3262+ */
3263+ closure_sync(&trans->ref);
3264+ trans->locking_wait.task = NULL;
3265+
32593266 unsigned long *paths_allocated = trans->paths_allocated;
32603267 trans->paths_allocated = NULL;
32613268 trans->paths = NULL;
@@ -3273,8 +3280,6 @@ void bch2_trans_put(struct btree_trans *trans) · 11 unmodified lines
32733280 trans = this_cpu_xchg(c->btree_trans_bufs->trans, trans);
32743281
32753282 if (trans) {
3276− closure_sync(&trans->ref);
3277−
32783283 seqmutex_lock(&c->btree_trans_lock);
32793284 list_del(&trans->list);
32803285 seqmutex_unlock(&c->btree_trans_lock);
fs/bcachefs/btree_types.h+8−8
@@ -761,13 +761,13 @@ static inline bool btree_node_type_needs_gc(enum btree_node_type type) · 760 unmodified lines
761761
762762 static inline bool btree_node_type_is_extents(enum btree_node_type type)
763763 {
764− const unsigned mask = 0
764+ const u64 mask = 0
765765 #define x(name, nr, flags, ...) |((!!((flags) & BTREE_ID_EXTENTS)) << (nr + 1))
766766 BCH_BTREE_IDS()
767767 #undef x
768768 ;
769769
770− return (1U << type) & mask;
770+ return BIT_ULL(type) & mask;
771771 }
772772
773773 static inline bool btree_id_is_extents(enum btree_id btree)
@@ -777,35 +777,35 @@ static inline bool btree_id_is_extents(enum btree_id btree) · 3 unmodified lines
777777
778778 static inline bool btree_type_has_snapshots(enum btree_id id)
779779 {
780− const unsigned mask = 0
780+ const u64 mask = 0
781781 #define x(name, nr, flags, ...) |((!!((flags) & BTREE_ID_SNAPSHOTS)) << nr)
782782 BCH_BTREE_IDS()
783783 #undef x
784784 ;
785785
786− return (1U << id) & mask;
786+ return BIT_ULL(id) & mask;
787787 }
788788
789789 static inline bool btree_type_has_snapshot_field(enum btree_id id)
790790 {
791− const unsigned mask = 0
791+ const u64 mask = 0
792792 #define x(name, nr, flags, ...) |((!!((flags) & (BTREE_ID_SNAPSHOT_FIELD|BTREE_ID_SNAPSHOTS))) << nr)
793793 BCH_BTREE_IDS()
794794 #undef x
795795 ;
796796
797− return (1U << id) & mask;
797+ return BIT_ULL(id) & mask;
798798 }
799799
800800 static inline bool btree_type_has_ptrs(enum btree_id id)
801801 {
802− const unsigned mask = 0
802+ const u64 mask = 0
803803 #define x(name, nr, flags, ...) |((!!((flags) & BTREE_ID_DATA)) << nr)
804804 BCH_BTREE_IDS()
805805 #undef x
806806 ;
807807
808− return (1U << id) & mask;
808+ return BIT_ULL(id) & mask;
809809 }
810810
811811 struct btree_root {
fs/bcachefs/errcode.h+3−0
@@ -116,6 +116,9 @@ · 115 unmodified lines
116116 x(ENOENT, ENOENT_dev_idx_not_found) \
117117 x(ENOTEMPTY, ENOTEMPTY_dir_not_empty) \
118118 x(ENOTEMPTY, ENOTEMPTY_subvol_not_empty) \
119+ x(EEXIST, EEXIST_str_hash_set) \
120+ x(EEXIST, EEXIST_discard_in_flight_add) \
121+ x(EEXIST, EEXIST_subvolume_create) \
119122 x(0, open_buckets_empty) \
120123 x(0, freelist_empty) \
121124 x(BCH_ERR_freelist_empty, no_buckets_found) \
fs/bcachefs/error.c+18−1
@@ -15,6 +15,7 @@ bool bch2_inconsistent_error(struct bch_fs *c) · 14 unmodified lines
1515 switch (c->opts.errors) {
1616 case BCH_ON_ERROR_continue:
1717 return false;
18+ case BCH_ON_ERROR_fix_safe:
1819 case BCH_ON_ERROR_ro:
1920 if (bch2_fs_emergency_read_only(c))
2021 bch_err(c, "inconsistency detected - emergency read only at journal seq %llu",
@@ -191,6 +192,12 @@ static void prt_actioning(struct printbuf *out, const char *action) · 170 unmodified lines
191192 prt_str(out, "ing");
192193 }
193194
195+static const u8 fsck_flags_extra[] = {
196+#define x(t, n, flags) [BCH_FSCK_ERR_##t] = flags,
197+ BCH_SB_ERRS()
198+#undef x
199+};
200+
194201 int bch2_fsck_err(struct bch_fs *c,
195202 enum bch_fsck_flags flags,
196203 enum bch_sb_error_id err,
@@ -203,6 +210,9 @@ int bch2_fsck_err(struct bch_fs *c, · 6 unmodified lines
203210 int ret = -BCH_ERR_fsck_ignore;
204211 const char *action_orig = "fix?", *action = action_orig;
205212
213+ if (!WARN_ON(err >= ARRAY_SIZE(fsck_flags_extra)))
214+ flags |= fsck_flags_extra[err];
215+
206216 if ((flags & FSCK_CAN_FIX) &&
207217 test_bit(err, c->sb.errors_silent))
208218 return -BCH_ERR_fsck_fix;
@@ -265,7 +275,14 @@ int bch2_fsck_err(struct bch_fs *c, · 56 unmodified lines
265275 prt_printf(out, bch2_log_msg(c, ""));
266276 #endif
267277
268− if (!test_bit(BCH_FS_fsck_running, &c->flags)) {
278+ if ((flags & FSCK_CAN_FIX) &&
279+ (flags & FSCK_AUTOFIX) &&
280+ (c->opts.errors == BCH_ON_ERROR_continue ||
281+ c->opts.errors == BCH_ON_ERROR_fix_safe)) {
282+ prt_str(out, ", ");
283+ prt_actioning(out, action);
284+ ret = -BCH_ERR_fsck_fix;
285+ } else if (!test_bit(BCH_FS_fsck_running, &c->flags)) {
269286 if (c->opts.errors != BCH_ON_ERROR_continue ||
270287 !(flags & (FSCK_CAN_FIX|FSCK_CAN_IGNORE))) {
271288 prt_str(out, ", shutting down");
fs/bcachefs/error.h+0−7
@@ -108,13 +108,6 @@ struct fsck_err_state { · 107 unmodified lines
108108 char *last_msg;
109109 };
110110
111−enum bch_fsck_flags {
112− FSCK_CAN_FIX = 1 << 0,
113− FSCK_CAN_IGNORE = 1 << 1,
114− FSCK_NEED_FSCK = 1 << 2,
115− FSCK_NO_RATELIMIT = 1 << 3,
116−};
117−
118111 #define fsck_err_count(_c, _err) bch2_sb_err_count(_c, BCH_FSCK_ERR_##_err)
119112
120113 __printf(4, 5) __cold
fs/bcachefs/fs-ioctl.c+1−1
@@ -373,7 +373,7 @@ retry: · 372 unmodified lines
373373 }
374374
375375 if (dst_dentry->d_inode) {
376− error = -EEXIST;
376+ error = -BCH_ERR_EEXIST_subvolume_create;
377377 goto err3;
378378 }
379379
fs/bcachefs/fs.c+14−7
@@ -188,6 +188,12 @@ static struct bch_inode_info *bch2_inode_insert(struct bch_fs *c, struct bch_ino · 187 unmodified lines
188188 BUG_ON(!old);
189189
190190 if (unlikely(old != inode)) {
191+ /*
192+ * bcachefs doesn't use I_NEW; we have no use for it since we
193+ * only insert fully created inodes in the inode hash table. But
194+ * discard_new_inode() expects it to be set...
195+ */
196+ inode->v.i_flags |= I_NEW;
191197 discard_new_inode(&inode->v);
192198 inode = old;
193199 } else {
@@ -195,8 +201,10 @@ static struct bch_inode_info *bch2_inode_insert(struct bch_fs *c, struct bch_ino · 1 unmodified line
195201 list_add(&inode->ei_vfs_inode_list, &c->vfs_inodes_list);
196202 mutex_unlock(&c->vfs_inodes_lock);
197203 /*
198− * we really don't want insert_inode_locked2() to be setting
199− * I_NEW...
204+ * Again, I_NEW makes no sense for bcachefs. This is only needed
205+ * for clearing I_NEW, but since the inode was already fully
206+ * created and initialized we didn't actually want
207+ * inode_insert5() to set it for us.
200208 */
201209 unlock_new_inode(&inode->v);
202210 }
@@ -1157,6 +1165,7 @@ static const struct file_operations bch_file_operations = { · 954 unmodified lines
11571165 .read_iter = bch2_read_iter,
11581166 .write_iter = bch2_write_iter,
11591167 .mmap = bch2_mmap,
1168+ .get_unmapped_area = thp_get_unmapped_area,
11601169 .fsync = bch2_fsync,
11611170 .splice_read = filemap_splice_read,
11621171 .splice_write = iter_file_splice_write,
@@ -1488,11 +1497,6 @@ static void bch2_vfs_inode_init(struct btree_trans *trans, subvol_inum inum, · 325 unmodified lines
14881497 bch2_iget5_set(&inode->v, &inum);
14891498 bch2_inode_update_after_write(trans, inode, bi, ~0);
14901499
1491− if (BCH_SUBVOLUME_SNAP(subvol))
1492− set_bit(EI_INODE_SNAPSHOT, &inode->ei_flags);
1493− else
1494− clear_bit(EI_INODE_SNAPSHOT, &inode->ei_flags);
1495−
14961500 inode->v.i_blocks = bi->bi_sectors;
14971501 inode->v.i_ino = bi->bi_inum;
14981502 inode->v.i_rdev = bi->bi_dev;
@@ -1504,6 +1508,9 @@ static void bch2_vfs_inode_init(struct btree_trans *trans, subvol_inum inum, · 5 unmodified lines
15041508 inode->ei_qid = bch_qid(bi);
15051509 inode->ei_subvol = inum.subvol;
15061510
1511+ if (BCH_SUBVOLUME_SNAP(subvol))
1512+ set_bit(EI_INODE_SNAPSHOT, &inode->ei_flags);
1513+
15071514 inode->v.i_mapping->a_ops = &bch_address_space_operations;
15081515
15091516 switch (inode->v.i_mode & S_IFMT) {
fs/bcachefs/journal.c+3−0
@@ -1167,6 +1167,9 @@ void bch2_dev_journal_stop(struct journal *j, struct bch_dev *ca) · 1166 unmodified lines
11671167
11681168 void bch2_fs_journal_stop(struct journal *j)
11691169 {
1170+ if (!test_bit(JOURNAL_running, &j->flags))
1171+ return;
1172+
11701173 bch2_journal_reclaim_stop(j);
11711174 bch2_journal_flush_all_pins(j);
11721175
fs/bcachefs/journal_io.c+8−5
@@ -1967,7 +1967,6 @@ CLOSURE_CALLBACK(bch2_journal_write) · 1966 unmodified lines
19671967 struct journal *j = container_of(w, struct journal, buf[w->idx]);
19681968 struct bch_fs *c = container_of(j, struct bch_fs, journal);
19691969 struct bch_replicas_padded replicas;
1970− struct printbuf journal_debug_buf = PRINTBUF;
19711970 unsigned nr_rw_members = 0;
19721971 int ret;
19731972
@@ -2011,11 +2010,15 @@ CLOSURE_CALLBACK(bch2_journal_write) · 37 unmodified lines
20112010 }
20122011
20132012 if (ret) {
2014− __bch2_journal_debug_to_text(&journal_debug_buf, j);
2013+ struct printbuf buf = PRINTBUF;
2014+ buf.atomic++;
2015+
2016+ prt_printf(&buf, bch2_fmt(c, "Unable to allocate journal write: %s"),
2017+ bch2_err_str(ret));
2018+ __bch2_journal_debug_to_text(&buf, j);
20152019 spin_unlock(&j->lock);
2016− bch_err(c, "Unable to allocate journal write:\n%s",
2017− journal_debug_buf.buf);
2018− printbuf_exit(&journal_debug_buf);
2020+ bch2_print_string_as_lines(KERN_ERR, buf.buf);
2021+ printbuf_exit(&buf);
20192022 goto err;
20202023 }
20212024
fs/bcachefs/lru.h+0−3
@@ -2,9 +2,6 @@ · 1 unmodified line
22 #ifndef _BCACHEFS_LRU_H
33 #define _BCACHEFS_LRU_H
44
5−#define LRU_TIME_BITS 48
6−#define LRU_TIME_MAX ((1ULL << LRU_TIME_BITS) - 1)
7−
85 static inline u64 lru_pos_id(struct bpos pos)
96 {
107 return pos.inode >> LRU_TIME_BITS;
fs/bcachefs/opts.h+1−1
@@ -137,7 +137,7 @@ enum fsck_err_opts { · 136 unmodified lines
137137 x(errors, u8, \
138138 OPT_FS|OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
139139 OPT_STR(bch2_error_actions), \
140− BCH_SB_ERROR_ACTION, BCH_ON_ERROR_ro, \
140+ BCH_SB_ERROR_ACTION, BCH_ON_ERROR_fix_safe, \
141141 NULL, "Action to take on filesystem error") \
142142 x(metadata_replicas, u8, \
143143 OPT_FS|OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
fs/bcachefs/recovery.c+9−3
@@ -326,6 +326,12 @@ static int journal_replay_entry_early(struct bch_fs *c, · 325 unmodified lines
326326 case BCH_JSET_ENTRY_btree_root: {
327327 struct btree_root *r;
328328
329+ if (fsck_err_on(entry->btree_id >= BTREE_ID_NR_MAX,
330+ c, invalid_btree_id,
331+ "invalid btree id %u (max %u)",
332+ entry->btree_id, BTREE_ID_NR_MAX))
333+ return 0;
334+
329335 while (entry->btree_id >= c->btree_roots_extra.nr + BTREE_ID_NR) {
330336 ret = darray_push(&c->btree_roots_extra, (struct btree_root) { NULL });
331337 if (ret)
@@ -415,7 +421,7 @@ static int journal_replay_entry_early(struct bch_fs *c, · 83 unmodified lines
415421 atomic64_set(&c->io_clock[clock->rw].now, le64_to_cpu(clock->time));
416422 }
417423 }
418−
424+fsck_err:
419425 return ret;
420426 }
421427
@@ -658,10 +664,10 @@ int bch2_fs_recovery(struct bch_fs *c) · 236 unmodified lines
658664 if (check_version_upgrade(c))
659665 write_sb = true;
660666
667+ c->recovery_passes_explicit |= bch2_recovery_passes_from_stable(le64_to_cpu(ext->recovery_passes_required[0]));
668+
661669 if (write_sb)
662670 bch2_write_super(c);
663−
664− c->recovery_passes_explicit |= bch2_recovery_passes_from_stable(le64_to_cpu(ext->recovery_passes_required[0]));
665671 mutex_unlock(&c->sb_lock);
666672
667673 if (c->opts.fsck && IS_ENABLED(CONFIG_BCACHEFS_DEBUG))
fs/bcachefs/sb-downgrade.c+1−1
@@ -228,7 +228,7 @@ int bch2_sb_downgrade_update(struct bch_fs *c) · 227 unmodified lines
228228
229229 dst = (void *) &darray_top(table);
230230 dst->version = cpu_to_le16(src->version);
231− dst->recovery_passes[0] = cpu_to_le64(src->recovery_passes);
231+ dst->recovery_passes[0] = cpu_to_le64(bch2_recovery_passes_to_stable(src->recovery_passes));
232232 dst->recovery_passes[1] = 0;
233233 dst->nr_errors = cpu_to_le16(src->nr_errors);
234234 for (unsigned i = 0; i < src->nr_errors; i++)
fs/bcachefs/sb-errors_format.h+286−273
@@ -2,281 +2,294 @@ · 1 unmodified line
22 #ifndef _BCACHEFS_SB_ERRORS_FORMAT_H
33 #define _BCACHEFS_SB_ERRORS_FORMAT_H
44
5−#define BCH_SB_ERRS() \
6− x(clean_but_journal_not_empty, 0) \
7− x(dirty_but_no_journal_entries, 1) \
8− x(dirty_but_no_journal_entries_post_drop_nonflushes, 2) \
9− x(sb_clean_journal_seq_mismatch, 3) \
10− x(sb_clean_btree_root_mismatch, 4) \
11− x(sb_clean_missing, 5) \
12− x(jset_unsupported_version, 6) \
13− x(jset_unknown_csum, 7) \
14− x(jset_last_seq_newer_than_seq, 8) \
15− x(jset_past_bucket_end, 9) \
16− x(jset_seq_blacklisted, 10) \
17− x(journal_entries_missing, 11) \
18− x(journal_entry_replicas_not_marked, 12) \
19− x(journal_entry_past_jset_end, 13) \
20− x(journal_entry_replicas_data_mismatch, 14) \
21− x(journal_entry_bkey_u64s_0, 15) \
22− x(journal_entry_bkey_past_end, 16) \
23− x(journal_entry_bkey_bad_format, 17) \
24− x(journal_entry_bkey_invalid, 18) \
25− x(journal_entry_btree_root_bad_size, 19) \
26− x(journal_entry_blacklist_bad_size, 20) \
27− x(journal_entry_blacklist_v2_bad_size, 21) \
28− x(journal_entry_blacklist_v2_start_past_end, 22) \
29− x(journal_entry_usage_bad_size, 23) \
30− x(journal_entry_data_usage_bad_size, 24) \
31− x(journal_entry_clock_bad_size, 25) \
32− x(journal_entry_clock_bad_rw, 26) \
33− x(journal_entry_dev_usage_bad_size, 27) \
34− x(journal_entry_dev_usage_bad_dev, 28) \
35− x(journal_entry_dev_usage_bad_pad, 29) \
36− x(btree_node_unreadable, 30) \
37− x(btree_node_fault_injected, 31) \
38− x(btree_node_bad_magic, 32) \
39− x(btree_node_bad_seq, 33) \
40− x(btree_node_unsupported_version, 34) \
41− x(btree_node_bset_older_than_sb_min, 35) \
42− x(btree_node_bset_newer_than_sb, 36) \
43− x(btree_node_data_missing, 37) \
44− x(btree_node_bset_after_end, 38) \
45− x(btree_node_replicas_sectors_written_mismatch, 39) \
46− x(btree_node_replicas_data_mismatch, 40) \
47− x(bset_unknown_csum, 41) \
48− x(bset_bad_csum, 42) \
49− x(bset_past_end_of_btree_node, 43) \
50− x(bset_wrong_sector_offset, 44) \
51− x(bset_empty, 45) \
52− x(bset_bad_seq, 46) \
53− x(bset_blacklisted_journal_seq, 47) \
54− x(first_bset_blacklisted_journal_seq, 48) \
55− x(btree_node_bad_btree, 49) \
56− x(btree_node_bad_level, 50) \
57− x(btree_node_bad_min_key, 51) \
58− x(btree_node_bad_max_key, 52) \
59− x(btree_node_bad_format, 53) \
60− x(btree_node_bkey_past_bset_end, 54) \
61− x(btree_node_bkey_bad_format, 55) \
62− x(btree_node_bad_bkey, 56) \
63− x(btree_node_bkey_out_of_order, 57) \
64− x(btree_root_bkey_invalid, 58) \
65− x(btree_root_read_error, 59) \
66− x(btree_root_bad_min_key, 60) \
67− x(btree_root_bad_max_key, 61) \
68− x(btree_node_read_error, 62) \
69− x(btree_node_topology_bad_min_key, 63) \
70− x(btree_node_topology_bad_max_key, 64) \
71− x(btree_node_topology_overwritten_by_prev_node, 65) \
72− x(btree_node_topology_overwritten_by_next_node, 66) \
73− x(btree_node_topology_interior_node_empty, 67) \
74− x(fs_usage_hidden_wrong, 68) \
75− x(fs_usage_btree_wrong, 69) \
76− x(fs_usage_data_wrong, 70) \
77− x(fs_usage_cached_wrong, 71) \
78− x(fs_usage_reserved_wrong, 72) \
79− x(fs_usage_persistent_reserved_wrong, 73) \
80− x(fs_usage_nr_inodes_wrong, 74) \
81− x(fs_usage_replicas_wrong, 75) \
82− x(dev_usage_buckets_wrong, 76) \
83− x(dev_usage_sectors_wrong, 77) \
84− x(dev_usage_fragmented_wrong, 78) \
85− x(dev_usage_buckets_ec_wrong, 79) \
86− x(bkey_version_in_future, 80) \
87− x(bkey_u64s_too_small, 81) \
88− x(bkey_invalid_type_for_btree, 82) \
89− x(bkey_extent_size_zero, 83) \
90− x(bkey_extent_size_greater_than_offset, 84) \
91− x(bkey_size_nonzero, 85) \
92− x(bkey_snapshot_nonzero, 86) \
93− x(bkey_snapshot_zero, 87) \
94− x(bkey_at_pos_max, 88) \
95− x(bkey_before_start_of_btree_node, 89) \
96− x(bkey_after_end_of_btree_node, 90) \
97− x(bkey_val_size_nonzero, 91) \
98− x(bkey_val_size_too_small, 92) \
99− x(alloc_v1_val_size_bad, 93) \
100− x(alloc_v2_unpack_error, 94) \
101− x(alloc_v3_unpack_error, 95) \
102− x(alloc_v4_val_size_bad, 96) \
103− x(alloc_v4_backpointers_start_bad, 97) \
104− x(alloc_key_data_type_bad, 98) \
105− x(alloc_key_empty_but_have_data, 99) \
106− x(alloc_key_dirty_sectors_0, 100) \
107− x(alloc_key_data_type_inconsistency, 101) \
108− x(alloc_key_to_missing_dev_bucket, 102) \
109− x(alloc_key_cached_inconsistency, 103) \
110− x(alloc_key_cached_but_read_time_zero, 104) \
111− x(alloc_key_to_missing_lru_entry, 105) \
112− x(alloc_key_data_type_wrong, 106) \
113− x(alloc_key_gen_wrong, 107) \
114− x(alloc_key_dirty_sectors_wrong, 108) \
115− x(alloc_key_cached_sectors_wrong, 109) \
116− x(alloc_key_stripe_wrong, 110) \
117− x(alloc_key_stripe_redundancy_wrong, 111) \
118− x(bucket_sector_count_overflow, 112) \
119− x(bucket_metadata_type_mismatch, 113) \
120− x(need_discard_key_wrong, 114) \
121− x(freespace_key_wrong, 115) \
122− x(freespace_hole_missing, 116) \
123− x(bucket_gens_val_size_bad, 117) \
124− x(bucket_gens_key_wrong, 118) \
125− x(bucket_gens_hole_wrong, 119) \
126− x(bucket_gens_to_invalid_dev, 120) \
127− x(bucket_gens_to_invalid_buckets, 121) \
128− x(bucket_gens_nonzero_for_invalid_buckets, 122) \
129− x(need_discard_freespace_key_to_invalid_dev_bucket, 123) \
130− x(need_discard_freespace_key_bad, 124) \
131− x(backpointer_bucket_offset_wrong, 125) \
132− x(backpointer_to_missing_device, 126) \
133− x(backpointer_to_missing_alloc, 127) \
134− x(backpointer_to_missing_ptr, 128) \
135− x(lru_entry_at_time_0, 129) \
136− x(lru_entry_to_invalid_bucket, 130) \
137− x(lru_entry_bad, 131) \
138− x(btree_ptr_val_too_big, 132) \
139− x(btree_ptr_v2_val_too_big, 133) \
140− x(btree_ptr_has_non_ptr, 134) \
141− x(extent_ptrs_invalid_entry, 135) \
142− x(extent_ptrs_no_ptrs, 136) \
143− x(extent_ptrs_too_many_ptrs, 137) \
144− x(extent_ptrs_redundant_crc, 138) \
145− x(extent_ptrs_redundant_stripe, 139) \
146− x(extent_ptrs_unwritten, 140) \
147− x(extent_ptrs_written_and_unwritten, 141) \
148− x(ptr_to_invalid_device, 142) \
149− x(ptr_to_duplicate_device, 143) \
150− x(ptr_after_last_bucket, 144) \
151− x(ptr_before_first_bucket, 145) \
152− x(ptr_spans_multiple_buckets, 146) \
153− x(ptr_to_missing_backpointer, 147) \
154− x(ptr_to_missing_alloc_key, 148) \
155− x(ptr_to_missing_replicas_entry, 149) \
156− x(ptr_to_missing_stripe, 150) \
157− x(ptr_to_incorrect_stripe, 151) \
158− x(ptr_gen_newer_than_bucket_gen, 152) \
159− x(ptr_too_stale, 153) \
160− x(stale_dirty_ptr, 154) \
161− x(ptr_bucket_data_type_mismatch, 155) \
162− x(ptr_cached_and_erasure_coded, 156) \
163− x(ptr_crc_uncompressed_size_too_small, 157) \
164− x(ptr_crc_csum_type_unknown, 158) \
165− x(ptr_crc_compression_type_unknown, 159) \
166− x(ptr_crc_redundant, 160) \
167− x(ptr_crc_uncompressed_size_too_big, 161) \
168− x(ptr_crc_nonce_mismatch, 162) \
169− x(ptr_stripe_redundant, 163) \
170− x(reservation_key_nr_replicas_invalid, 164) \
171− x(reflink_v_refcount_wrong, 165) \
172− x(reflink_p_to_missing_reflink_v, 166) \
173− x(stripe_pos_bad, 167) \
174− x(stripe_val_size_bad, 168) \
175− x(stripe_sector_count_wrong, 169) \
176− x(snapshot_tree_pos_bad, 170) \
177− x(snapshot_tree_to_missing_snapshot, 171) \
178− x(snapshot_tree_to_missing_subvol, 172) \
179− x(snapshot_tree_to_wrong_subvol, 173) \
180− x(snapshot_tree_to_snapshot_subvol, 174) \
181− x(snapshot_pos_bad, 175) \
182− x(snapshot_parent_bad, 176) \
183− x(snapshot_children_not_normalized, 177) \
184− x(snapshot_child_duplicate, 178) \
185− x(snapshot_child_bad, 179) \
186− x(snapshot_skiplist_not_normalized, 180) \
187− x(snapshot_skiplist_bad, 181) \
188− x(snapshot_should_not_have_subvol, 182) \
189− x(snapshot_to_bad_snapshot_tree, 183) \
190− x(snapshot_bad_depth, 184) \
191− x(snapshot_bad_skiplist, 185) \
192− x(subvol_pos_bad, 186) \
193− x(subvol_not_master_and_not_snapshot, 187) \
194− x(subvol_to_missing_root, 188) \
195− x(subvol_root_wrong_bi_subvol, 189) \
196− x(bkey_in_missing_snapshot, 190) \
197− x(inode_pos_inode_nonzero, 191) \
198− x(inode_pos_blockdev_range, 192) \
199− x(inode_unpack_error, 193) \
200− x(inode_str_hash_invalid, 194) \
201− x(inode_v3_fields_start_bad, 195) \
202− x(inode_snapshot_mismatch, 196) \
203− x(inode_unlinked_but_clean, 197) \
204− x(inode_unlinked_but_nlink_nonzero, 198) \
205− x(inode_checksum_type_invalid, 199) \
206− x(inode_compression_type_invalid, 200) \
207− x(inode_subvol_root_but_not_dir, 201) \
208− x(inode_i_size_dirty_but_clean, 202) \
209− x(inode_i_sectors_dirty_but_clean, 203) \
210− x(inode_i_sectors_wrong, 204) \
211− x(inode_dir_wrong_nlink, 205) \
212− x(inode_dir_multiple_links, 206) \
213− x(inode_multiple_links_but_nlink_0, 207) \
214− x(inode_wrong_backpointer, 208) \
215− x(inode_wrong_nlink, 209) \
216− x(inode_unreachable, 210) \
217− x(deleted_inode_but_clean, 211) \
218− x(deleted_inode_missing, 212) \
219− x(deleted_inode_is_dir, 213) \
220− x(deleted_inode_not_unlinked, 214) \
221− x(extent_overlapping, 215) \
222− x(extent_in_missing_inode, 216) \
223− x(extent_in_non_reg_inode, 217) \
224− x(extent_past_end_of_inode, 218) \
225− x(dirent_empty_name, 219) \
226− x(dirent_val_too_big, 220) \
227− x(dirent_name_too_long, 221) \
228− x(dirent_name_embedded_nul, 222) \
229− x(dirent_name_dot_or_dotdot, 223) \
230− x(dirent_name_has_slash, 224) \
231− x(dirent_d_type_wrong, 225) \
232− x(inode_bi_parent_wrong, 226) \
233− x(dirent_in_missing_dir_inode, 227) \
234− x(dirent_in_non_dir_inode, 228) \
235− x(dirent_to_missing_inode, 229) \
236− x(dirent_to_missing_subvol, 230) \
237− x(dirent_to_itself, 231) \
238− x(quota_type_invalid, 232) \
239− x(xattr_val_size_too_small, 233) \
240− x(xattr_val_size_too_big, 234) \
241− x(xattr_invalid_type, 235) \
242− x(xattr_name_invalid_chars, 236) \
243− x(xattr_in_missing_inode, 237) \
244− x(root_subvol_missing, 238) \
245− x(root_dir_missing, 239) \
246− x(root_inode_not_dir, 240) \
247− x(dir_loop, 241) \
248− x(hash_table_key_duplicate, 242) \
249− x(hash_table_key_wrong_offset, 243) \
250− x(unlinked_inode_not_on_deleted_list, 244) \
251− x(reflink_p_front_pad_bad, 245) \
252− x(journal_entry_dup_same_device, 246) \
253− x(inode_bi_subvol_missing, 247) \
254− x(inode_bi_subvol_wrong, 248) \
255− x(inode_points_to_missing_dirent, 249) \
256− x(inode_points_to_wrong_dirent, 250) \
257− x(inode_bi_parent_nonzero, 251) \
258− x(dirent_to_missing_parent_subvol, 252) \
259− x(dirent_not_visible_in_parent_subvol, 253) \
260− x(subvol_fs_path_parent_wrong, 254) \
261− x(subvol_root_fs_path_parent_nonzero, 255) \
262− x(subvol_children_not_set, 256) \
263− x(subvol_children_bad, 257) \
264− x(subvol_loop, 258) \
265− x(subvol_unreachable, 259) \
266− x(btree_node_bkey_bad_u64s, 260) \
267− x(btree_node_topology_empty_interior_node, 261) \
268− x(btree_ptr_v2_min_key_bad, 262) \
269− x(btree_root_unreadable_and_scan_found_nothing, 263) \
270− x(snapshot_node_missing, 264) \
271− x(dup_backpointer_to_bad_csum_extent, 265) \
272− x(btree_bitmap_not_marked, 266) \
273− x(sb_clean_entry_overrun, 267) \
274− x(btree_ptr_v2_written_0, 268) \
275− x(subvol_snapshot_bad, 269) \
276− x(subvol_inode_bad, 270)
5+enum bch_fsck_flags {
6+ FSCK_CAN_FIX = 1 << 0,
7+ FSCK_CAN_IGNORE = 1 << 1,
8+ FSCK_NEED_FSCK = 1 << 2,
9+ FSCK_NO_RATELIMIT = 1 << 3,
10+ FSCK_AUTOFIX = 1 << 4,
11+};
12+
13+#define BCH_SB_ERRS() \
14+ x(clean_but_journal_not_empty, 0, 0) \
15+ x(dirty_but_no_journal_entries, 1, 0) \
16+ x(dirty_but_no_journal_entries_post_drop_nonflushes, 2, 0) \
17+ x(sb_clean_journal_seq_mismatch, 3, 0) \
18+ x(sb_clean_btree_root_mismatch, 4, 0) \
19+ x(sb_clean_missing, 5, 0) \
20+ x(jset_unsupported_version, 6, 0) \
21+ x(jset_unknown_csum, 7, 0) \
22+ x(jset_last_seq_newer_than_seq, 8, 0) \
23+ x(jset_past_bucket_end, 9, 0) \
24+ x(jset_seq_blacklisted, 10, 0) \
25+ x(journal_entries_missing, 11, 0) \
26+ x(journal_entry_replicas_not_marked, 12, 0) \
27+ x(journal_entry_past_jset_end, 13, 0) \
28+ x(journal_entry_replicas_data_mismatch, 14, 0) \
29+ x(journal_entry_bkey_u64s_0, 15, 0) \
30+ x(journal_entry_bkey_past_end, 16, 0) \
31+ x(journal_entry_bkey_bad_format, 17, 0) \
32+ x(journal_entry_bkey_invalid, 18, 0) \
33+ x(journal_entry_btree_root_bad_size, 19, 0) \
34+ x(journal_entry_blacklist_bad_size, 20, 0) \
35+ x(journal_entry_blacklist_v2_bad_size, 21, 0) \
36+ x(journal_entry_blacklist_v2_start_past_end, 22, 0) \
37+ x(journal_entry_usage_bad_size, 23, 0) \
38+ x(journal_entry_data_usage_bad_size, 24, 0) \
39+ x(journal_entry_clock_bad_size, 25, 0) \
40+ x(journal_entry_clock_bad_rw, 26, 0) \
41+ x(journal_entry_dev_usage_bad_size, 27, 0) \
42+ x(journal_entry_dev_usage_bad_dev, 28, 0) \
43+ x(journal_entry_dev_usage_bad_pad, 29, 0) \
44+ x(btree_node_unreadable, 30, 0) \
45+ x(btree_node_fault_injected, 31, 0) \
46+ x(btree_node_bad_magic, 32, 0) \
47+ x(btree_node_bad_seq, 33, 0) \
48+ x(btree_node_unsupported_version, 34, 0) \
49+ x(btree_node_bset_older_than_sb_min, 35, 0) \
50+ x(btree_node_bset_newer_than_sb, 36, 0) \
51+ x(btree_node_data_missing, 37, 0) \
52+ x(btree_node_bset_after_end, 38, 0) \
53+ x(btree_node_replicas_sectors_written_mismatch, 39, 0) \
54+ x(btree_node_replicas_data_mismatch, 40, 0) \
55+ x(bset_unknown_csum, 41, 0) \
56+ x(bset_bad_csum, 42, 0) \
57+ x(bset_past_end_of_btree_node, 43, 0) \
58+ x(bset_wrong_sector_offset, 44, 0) \
59+ x(bset_empty, 45, 0) \
60+ x(bset_bad_seq, 46, 0) \
61+ x(bset_blacklisted_journal_seq, 47, 0) \
62+ x(first_bset_blacklisted_journal_seq, 48, 0) \
63+ x(btree_node_bad_btree, 49, 0) \
64+ x(btree_node_bad_level, 50, 0) \
65+ x(btree_node_bad_min_key, 51, 0) \
66+ x(btree_node_bad_max_key, 52, 0) \
67+ x(btree_node_bad_format, 53, 0) \
68+ x(btree_node_bkey_past_bset_end, 54, 0) \
69+ x(btree_node_bkey_bad_format, 55, 0) \
70+ x(btree_node_bad_bkey, 56, 0) \
71+ x(btree_node_bkey_out_of_order, 57, 0) \
72+ x(btree_root_bkey_invalid, 58, 0) \
73+ x(btree_root_read_error, 59, 0) \
74+ x(btree_root_bad_min_key, 60, 0) \
75+ x(btree_root_bad_max_key, 61, 0) \
76+ x(btree_node_read_error, 62, 0) \
77+ x(btree_node_topology_bad_min_key, 63, 0) \
78+ x(btree_node_topology_bad_max_key, 64, 0) \
79+ x(btree_node_topology_overwritten_by_prev_node, 65, 0) \
80+ x(btree_node_topology_overwritten_by_next_node, 66, 0) \
81+ x(btree_node_topology_interior_node_empty, 67, 0) \
82+ x(fs_usage_hidden_wrong, 68, FSCK_AUTOFIX) \
83+ x(fs_usage_btree_wrong, 69, FSCK_AUTOFIX) \
84+ x(fs_usage_data_wrong, 70, FSCK_AUTOFIX) \
85+ x(fs_usage_cached_wrong, 71, FSCK_AUTOFIX) \
86+ x(fs_usage_reserved_wrong, 72, FSCK_AUTOFIX) \
87+ x(fs_usage_persistent_reserved_wrong, 73, FSCK_AUTOFIX) \
88+ x(fs_usage_nr_inodes_wrong, 74, FSCK_AUTOFIX) \
89+ x(fs_usage_replicas_wrong, 75, FSCK_AUTOFIX) \
90+ x(dev_usage_buckets_wrong, 76, FSCK_AUTOFIX) \
91+ x(dev_usage_sectors_wrong, 77, FSCK_AUTOFIX) \
92+ x(dev_usage_fragmented_wrong, 78, FSCK_AUTOFIX) \
93+ x(dev_usage_buckets_ec_wrong, 79, FSCK_AUTOFIX) \
94+ x(bkey_version_in_future, 80, 0) \
95+ x(bkey_u64s_too_small, 81, 0) \
96+ x(bkey_invalid_type_for_btree, 82, 0) \
97+ x(bkey_extent_size_zero, 83, 0) \
98+ x(bkey_extent_size_greater_than_offset, 84, 0) \
99+ x(bkey_size_nonzero, 85, 0) \
100+ x(bkey_snapshot_nonzero, 86, 0) \
101+ x(bkey_snapshot_zero, 87, 0) \
102+ x(bkey_at_pos_max, 88, 0) \
103+ x(bkey_before_start_of_btree_node, 89, 0) \
104+ x(bkey_after_end_of_btree_node, 90, 0) \
105+ x(bkey_val_size_nonzero, 91, 0) \
106+ x(bkey_val_size_too_small, 92, 0) \
107+ x(alloc_v1_val_size_bad, 93, 0) \
108+ x(alloc_v2_unpack_error, 94, 0) \
109+ x(alloc_v3_unpack_error, 95, 0) \
110+ x(alloc_v4_val_size_bad, 96, 0) \
111+ x(alloc_v4_backpointers_start_bad, 97, 0) \
112+ x(alloc_key_data_type_bad, 98, 0) \
113+ x(alloc_key_empty_but_have_data, 99, 0) \
114+ x(alloc_key_dirty_sectors_0, 100, 0) \
115+ x(alloc_key_data_type_inconsistency, 101, 0) \
116+ x(alloc_key_to_missing_dev_bucket, 102, 0) \
117+ x(alloc_key_cached_inconsistency, 103, 0) \
118+ x(alloc_key_cached_but_read_time_zero, 104, 0) \
119+ x(alloc_key_to_missing_lru_entry, 105, 0) \
120+ x(alloc_key_data_type_wrong, 106, FSCK_AUTOFIX) \
121+ x(alloc_key_gen_wrong, 107, FSCK_AUTOFIX) \
122+ x(alloc_key_dirty_sectors_wrong, 108, FSCK_AUTOFIX) \
123+ x(alloc_key_cached_sectors_wrong, 109, FSCK_AUTOFIX) \
124+ x(alloc_key_stripe_wrong, 110, FSCK_AUTOFIX) \
125+ x(alloc_key_stripe_redundancy_wrong, 111, FSCK_AUTOFIX) \
126+ x(bucket_sector_count_overflow, 112, 0) \
127+ x(bucket_metadata_type_mismatch, 113, 0) \
128+ x(need_discard_key_wrong, 114, 0) \
129+ x(freespace_key_wrong, 115, 0) \
130+ x(freespace_hole_missing, 116, 0) \
131+ x(bucket_gens_val_size_bad, 117, 0) \
132+ x(bucket_gens_key_wrong, 118, 0) \
133+ x(bucket_gens_hole_wrong, 119, 0) \
134+ x(bucket_gens_to_invalid_dev, 120, 0) \
135+ x(bucket_gens_to_invalid_buckets, 121, 0) \
136+ x(bucket_gens_nonzero_for_invalid_buckets, 122, 0) \
137+ x(need_discard_freespace_key_to_invalid_dev_bucket, 123, 0) \
138+ x(need_discard_freespace_key_bad, 124, 0) \
139+ x(backpointer_bucket_offset_wrong, 125, 0) \
140+ x(backpointer_to_missing_device, 126, 0) \
141+ x(backpointer_to_missing_alloc, 127, 0) \
142+ x(backpointer_to_missing_ptr, 128, 0) \
143+ x(lru_entry_at_time_0, 129, 0) \
144+ x(lru_entry_to_invalid_bucket, 130, 0) \
145+ x(lru_entry_bad, 131, 0) \
146+ x(btree_ptr_val_too_big, 132, 0) \
147+ x(btree_ptr_v2_val_too_big, 133, 0) \
148+ x(btree_ptr_has_non_ptr, 134, 0) \
149+ x(extent_ptrs_invalid_entry, 135, 0) \
150+ x(extent_ptrs_no_ptrs, 136, 0) \
151+ x(extent_ptrs_too_many_ptrs, 137, 0) \
152+ x(extent_ptrs_redundant_crc, 138, 0) \
153+ x(extent_ptrs_redundant_stripe, 139, 0) \
154+ x(extent_ptrs_unwritten, 140, 0) \
155+ x(extent_ptrs_written_and_unwritten, 141, 0) \
156+ x(ptr_to_invalid_device, 142, 0) \
157+ x(ptr_to_duplicate_device, 143, 0) \
158+ x(ptr_after_last_bucket, 144, 0) \
159+ x(ptr_before_first_bucket, 145, 0) \
160+ x(ptr_spans_multiple_buckets, 146, 0) \
161+ x(ptr_to_missing_backpointer, 147, 0) \
162+ x(ptr_to_missing_alloc_key, 148, 0) \
163+ x(ptr_to_missing_replicas_entry, 149, 0) \
164+ x(ptr_to_missing_stripe, 150, 0) \
165+ x(ptr_to_incorrect_stripe, 151, 0) \
166+ x(ptr_gen_newer_than_bucket_gen, 152, 0) \
167+ x(ptr_too_stale, 153, 0) \
168+ x(stale_dirty_ptr, 154, 0) \
169+ x(ptr_bucket_data_type_mismatch, 155, 0) \
170+ x(ptr_cached_and_erasure_coded, 156, 0) \
171+ x(ptr_crc_uncompressed_size_too_small, 157, 0) \
172+ x(ptr_crc_csum_type_unknown, 158, 0) \
173+ x(ptr_crc_compression_type_unknown, 159, 0) \
174+ x(ptr_crc_redundant, 160, 0) \
175+ x(ptr_crc_uncompressed_size_too_big, 161, 0) \
176+ x(ptr_crc_nonce_mismatch, 162, 0) \
177+ x(ptr_stripe_redundant, 163, 0) \
178+ x(reservation_key_nr_replicas_invalid, 164, 0) \
179+ x(reflink_v_refcount_wrong, 165, 0) \
180+ x(reflink_p_to_missing_reflink_v, 166, 0) \
181+ x(stripe_pos_bad, 167, 0) \
182+ x(stripe_val_size_bad, 168, 0) \
183+ x(stripe_sector_count_wrong, 169, 0) \
184+ x(snapshot_tree_pos_bad, 170, 0) \
185+ x(snapshot_tree_to_missing_snapshot, 171, 0) \
186+ x(snapshot_tree_to_missing_subvol, 172, 0) \
187+ x(snapshot_tree_to_wrong_subvol, 173, 0) \
188+ x(snapshot_tree_to_snapshot_subvol, 174, 0) \
189+ x(snapshot_pos_bad, 175, 0) \
190+ x(snapshot_parent_bad, 176, 0) \
191+ x(snapshot_children_not_normalized, 177, 0) \
192+ x(snapshot_child_duplicate, 178, 0) \
193+ x(snapshot_child_bad, 179, 0) \
194+ x(snapshot_skiplist_not_normalized, 180, 0) \
195+ x(snapshot_skiplist_bad, 181, 0) \
196+ x(snapshot_should_not_have_subvol, 182, 0) \
197+ x(snapshot_to_bad_snapshot_tree, 183, 0) \
198+ x(snapshot_bad_depth, 184, 0) \
199+ x(snapshot_bad_skiplist, 185, 0) \
200+ x(subvol_pos_bad, 186, 0) \
201+ x(subvol_not_master_and_not_snapshot, 187, 0) \
202+ x(subvol_to_missing_root, 188, 0) \
203+ x(subvol_root_wrong_bi_subvol, 189, 0) \
204+ x(bkey_in_missing_snapshot, 190, 0) \
205+ x(inode_pos_inode_nonzero, 191, 0) \
206+ x(inode_pos_blockdev_range, 192, 0) \
207+ x(inode_unpack_error, 193, 0) \
208+ x(inode_str_hash_invalid, 194, 0) \
209+ x(inode_v3_fields_start_bad, 195, 0) \
210+ x(inode_snapshot_mismatch, 196, 0) \
211+ x(inode_unlinked_but_clean, 197, 0) \
212+ x(inode_unlinked_but_nlink_nonzero, 198, 0) \
213+ x(inode_checksum_type_invalid, 199, 0) \
214+ x(inode_compression_type_invalid, 200, 0) \
215+ x(inode_subvol_root_but_not_dir, 201, 0) \
216+ x(inode_i_size_dirty_but_clean, 202, 0) \
217+ x(inode_i_sectors_dirty_but_clean, 203, 0) \
218+ x(inode_i_sectors_wrong, 204, 0) \
219+ x(inode_dir_wrong_nlink, 205, 0) \
220+ x(inode_dir_multiple_links, 206, 0) \
221+ x(inode_multiple_links_but_nlink_0, 207, 0) \
222+ x(inode_wrong_backpointer, 208, 0) \
223+ x(inode_wrong_nlink, 209, 0) \
224+ x(inode_unreachable, 210, 0) \
225+ x(deleted_inode_but_clean, 211, 0) \
226+ x(deleted_inode_missing, 212, 0) \
227+ x(deleted_inode_is_dir, 213, 0) \
228+ x(deleted_inode_not_unlinked, 214, 0) \
229+ x(extent_overlapping, 215, 0) \
230+ x(extent_in_missing_inode, 216, 0) \
231+ x(extent_in_non_reg_inode, 217, 0) \
232+ x(extent_past_end_of_inode, 218, 0) \
233+ x(dirent_empty_name, 219, 0) \
234+ x(dirent_val_too_big, 220, 0) \
235+ x(dirent_name_too_long, 221, 0) \
236+ x(dirent_name_embedded_nul, 222, 0) \
237+ x(dirent_name_dot_or_dotdot, 223, 0) \
238+ x(dirent_name_has_slash, 224, 0) \
239+ x(dirent_d_type_wrong, 225, 0) \
240+ x(inode_bi_parent_wrong, 226, 0) \
241+ x(dirent_in_missing_dir_inode, 227, 0) \
242+ x(dirent_in_non_dir_inode, 228, 0) \
243+ x(dirent_to_missing_inode, 229, 0) \
244+ x(dirent_to_missing_subvol, 230, 0) \
245+ x(dirent_to_itself, 231, 0) \
246+ x(quota_type_invalid, 232, 0) \
247+ x(xattr_val_size_too_small, 233, 0) \
248+ x(xattr_val_size_too_big, 234, 0) \
249+ x(xattr_invalid_type, 235, 0) \
250+ x(xattr_name_invalid_chars, 236, 0) \
251+ x(xattr_in_missing_inode, 237, 0) \
252+ x(root_subvol_missing, 238, 0) \
253+ x(root_dir_missing, 239, 0) \
254+ x(root_inode_not_dir, 240, 0) \
255+ x(dir_loop, 241, 0) \
256+ x(hash_table_key_duplicate, 242, 0) \
257+ x(hash_table_key_wrong_offset, 243, 0) \
258+ x(unlinked_inode_not_on_deleted_list, 244, 0) \
259+ x(reflink_p_front_pad_bad, 245, 0) \
260+ x(journal_entry_dup_same_device, 246, 0) \
261+ x(inode_bi_subvol_missing, 247, 0) \
262+ x(inode_bi_subvol_wrong, 248, 0) \
263+ x(inode_points_to_missing_dirent, 249, 0) \
264+ x(inode_points_to_wrong_dirent, 250, 0) \
265+ x(inode_bi_parent_nonzero, 251, 0) \
266+ x(dirent_to_missing_parent_subvol, 252, 0) \
267+ x(dirent_not_visible_in_parent_subvol, 253, 0) \
268+ x(subvol_fs_path_parent_wrong, 254, 0) \
269+ x(subvol_root_fs_path_parent_nonzero, 255, 0) \
270+ x(subvol_children_not_set, 256, 0) \
271+ x(subvol_children_bad, 257, 0) \
272+ x(subvol_loop, 258, 0) \
273+ x(subvol_unreachable, 259, 0) \
274+ x(btree_node_bkey_bad_u64s, 260, 0) \
275+ x(btree_node_topology_empty_interior_node, 261, 0) \
276+ x(btree_ptr_v2_min_key_bad, 262, 0) \
277+ x(btree_root_unreadable_and_scan_found_nothing, 263, 0) \
278+ x(snapshot_node_missing, 264, 0) \
279+ x(dup_backpointer_to_bad_csum_extent, 265, 0) \
280+ x(btree_bitmap_not_marked, 266, 0) \
281+ x(sb_clean_entry_overrun, 267, 0) \
282+ x(btree_ptr_v2_written_0, 268, 0) \
283+ x(subvol_snapshot_bad, 269, 0) \
284+ x(subvol_inode_bad, 270, 0) \
285+ x(alloc_key_stripe_sectors_wrong, 271, 0) \
286+ x(accounting_mismatch, 272, 0) \
287+ x(accounting_replicas_not_marked, 273, 0) \
288+ x(invalid_btree_id, 274, 0) \
289+ x(alloc_key_io_time_bad, 275, 0)
277290
278291 enum bch_sb_error_id {
279−#define x(t, n) BCH_FSCK_ERR_##t = n,
292+#define x(t, n, ...) BCH_FSCK_ERR_##t = n,
280293 BCH_SB_ERRS()
281294 #undef x
282295 BCH_SB_ERR_MAX
fs/bcachefs/snapshot.c+2−7
@@ -1565,13 +1565,6 @@ int bch2_delete_dead_snapshots(struct bch_fs *c) · 1564 unmodified lines
15651565 if (!test_and_clear_bit(BCH_FS_need_delete_dead_snapshots, &c->flags))
15661566 return 0;
15671567
1568− if (!test_bit(BCH_FS_started, &c->flags)) {
1569− ret = bch2_fs_read_write_early(c);
1570− bch_err_msg(c, ret, "deleting dead snapshots: error going rw");
1571− if (ret)
1572− return ret;
1573− }
1574−
15751568 trans = bch2_trans_get(c);
15761569
15771570 /*
@@ -1687,6 +1680,8 @@ void bch2_delete_dead_snapshots_work(struct work_struct *work) · 109 unmodified lines
16871680 {
16881681 struct bch_fs *c = container_of(work, struct bch_fs, snapshot_delete_work);
16891682
1683+ set_worker_desc("bcachefs-delete-dead-snapshots/%s", c->name);
1684+
16901685 bch2_delete_dead_snapshots(c);
16911686 bch2_write_ref_put(c, BCH_WRITE_REF_delete_dead_snapshots);
16921687 }
fs/bcachefs/str_hash.h+1−1
@@ -300,7 +300,7 @@ not_found: · 299 unmodified lines
300300 if (!found && (flags & STR_HASH_must_replace)) {
301301 ret = -BCH_ERR_ENOENT_str_hash_set_must_replace;
302302 } else if (found && (flags & STR_HASH_must_create)) {
303− ret = -EEXIST;
303+ ret = -BCH_ERR_EEXIST_str_hash_set;
304304 } else {
305305 if (!found && slot.path)
306306 swap(iter, slot);
fs/bcachefs/super-io.c+4−3
@@ -649,9 +649,10 @@ reread: · 648 unmodified lines
649649
650650 bytes = vstruct_bytes(sb->sb);
651651
652− if (bytes > 512ULL << min(BCH_SB_LAYOUT_SIZE_BITS_MAX, sb->sb->layout.sb_max_size_bits)) {
653− prt_printf(err, "Invalid superblock: too big (got %zu bytes, layout max %lu)",
654− bytes, 512UL << sb->sb->layout.sb_max_size_bits);
652+ u64 sb_size = 512ULL << min(BCH_SB_LAYOUT_SIZE_BITS_MAX, sb->sb->layout.sb_max_size_bits);
653+ if (bytes > sb_size) {
654+ prt_printf(err, "Invalid superblock: too big (got %zu bytes, layout max %llu)",
655+ bytes, sb_size);
655656 return -BCH_ERR_invalid_sb_too_big;
656657 }
657658
fs/bcachefs/super.c+7−6
@@ -912,9 +912,9 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) · 911 unmodified lines
912912 bch2_io_clock_init(&c->io_clock[WRITE]) ?:
913913 bch2_fs_journal_init(&c->journal) ?:
914914 bch2_fs_replicas_init(c) ?:
915+ bch2_fs_btree_iter_init(c) ?:
915916 bch2_fs_btree_cache_init(c) ?:
916917 bch2_fs_btree_key_cache_init(&c->btree_key_cache) ?:
917− bch2_fs_btree_iter_init(c) ?:
918918 bch2_fs_btree_interior_update_init(c) ?:
919919 bch2_fs_buckets_waiting_for_journal_init(c) ?:
920920 bch2_fs_btree_write_buffer_init(c) ?:
@@ -931,12 +931,13 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) · 10 unmodified lines
931931 if (ret)
932932 goto err;
933933
934− for (i = 0; i < c->sb.nr_devices; i++)
935− if (bch2_member_exists(c->disk_sb.sb, i) &&
936− bch2_dev_alloc(c, i)) {
937− ret = -EEXIST;
934+ for (i = 0; i < c->sb.nr_devices; i++) {
935+ if (!bch2_member_exists(c->disk_sb.sb, i))
936+ continue;
937+ ret = bch2_dev_alloc(c, i);
938+ if (ret)
938939 goto err;
939− }
940+ }
940941
941942 bch2_journal_entry_res_resize(&c->journal,
942943 &c->btree_root_journal_res,
fs/btrfs/bio.c+3−1
@@ -741,7 +741,9 @@ static bool btrfs_submit_chunk(struct btrfs_bio *bbio, int mirror_num) · 740 unmodified lines
741741 ret = btrfs_bio_csum(bbio);
742742 if (ret)
743743 goto fail_put_bio;
744− } else if (use_append) {
744+ } else if (use_append ||
745+ (btrfs_is_zoned(fs_info) && inode &&
746+ inode->flags & BTRFS_INODE_NODATASUM)) {
745747 ret = btrfs_alloc_dummy_sum(bbio);
746748 if (ret)
747749 goto fail_put_bio;
fs/btrfs/block-group.c+9−2
@@ -1785,6 +1785,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) · 1784 unmodified lines
17851785 container_of(work, struct btrfs_fs_info, reclaim_bgs_work);
17861786 struct btrfs_block_group *bg;
17871787 struct btrfs_space_info *space_info;
1788+ LIST_HEAD(retry_list);
17881789
17891790 if (!test_bit(BTRFS_FS_OPEN, &fs_info->flags))
17901791 return;
@@ -1921,8 +1922,11 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) · 130 unmodified lines
19211922 }
19221923
19231924 next:
1924− if (ret)
1925− btrfs_mark_bg_to_reclaim(bg);
1925+ if (ret) {
1926+ /* Refcount held by the reclaim_bgs list after splice. */
1927+ btrfs_get_block_group(bg);
1928+ list_add_tail(&bg->bg_list, &retry_list);
1929+ }
19261930 btrfs_put_block_group(bg);
19271931
19281932 mutex_unlock(&fs_info->reclaim_bgs_lock);
@@ -1942,6 +1946,9 @@ next: · 13 unmodified lines
19421946 spin_unlock(&fs_info->unused_bgs_lock);
19431947 mutex_unlock(&fs_info->reclaim_bgs_lock);
19441948 end:
1949+ spin_lock(&fs_info->unused_bgs_lock);
1950+ list_splice_tail(&retry_list, &fs_info->reclaim_bgs);
1951+ spin_unlock(&fs_info->unused_bgs_lock);
19451952 btrfs_exclop_finish(fs_info);
19461953 sb_end_write(fs_info->sb);
19471954 }
fs/nfsd/netlink.c+0−2
@@ -44,9 +44,7 @@ static const struct nla_policy nfsd_listener_set_nl_policy[NFSD_A_SERVER_SOCK_AD · 43 unmodified lines
4444 static const struct genl_split_ops nfsd_nl_ops[] = {
4545 {
4646 .cmd = NFSD_CMD_RPC_STATUS_GET,
47− .start = nfsd_nl_rpc_status_get_start,
4847 .dumpit = nfsd_nl_rpc_status_get_dumpit,
49− .done = nfsd_nl_rpc_status_get_done,
5048 .flags = GENL_CMD_CAP_DUMP,
5149 },
5250 {
fs/nfsd/netlink.h+0−3
@@ -15,9 +15,6 @@ · 14 unmodified lines
1515 extern const struct nla_policy nfsd_sock_nl_policy[NFSD_A_SOCK_TRANSPORT_NAME + 1];
1616 extern const struct nla_policy nfsd_version_nl_policy[NFSD_A_VERSION_ENABLED + 1];
1717
18−int nfsd_nl_rpc_status_get_start(struct netlink_callback *cb);
19−int nfsd_nl_rpc_status_get_done(struct netlink_callback *cb);
20−
2118 int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
2219 struct netlink_callback *cb);
2320 int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info);
fs/nfsd/nfsctl.c+11−37
@@ -1460,28 +1460,6 @@ static int create_proc_exports_entry(void) · 1459 unmodified lines
14601460
14611461 unsigned int nfsd_net_id;
14621462
1463−/**
1464− * nfsd_nl_rpc_status_get_start - Prepare rpc_status_get dumpit
1465− * @cb: netlink metadata and command arguments
1466− *
1467− * Return values:
1468− * %0: The rpc_status_get command may proceed
1469− * %-ENODEV: There is no NFSD running in this namespace
1470− */
1471−int nfsd_nl_rpc_status_get_start(struct netlink_callback *cb)
1472−{
1473− struct nfsd_net *nn = net_generic(sock_net(cb->skb->sk), nfsd_net_id);
1474− int ret = -ENODEV;
1475−
1476− mutex_lock(&nfsd_mutex);
1477− if (nn->nfsd_serv)
1478− ret = 0;
1479− else
1480− mutex_unlock(&nfsd_mutex);
1481−
1482− return ret;
1483−}
1484−
14851463 static int nfsd_genl_rpc_status_compose_msg(struct sk_buff *skb,
14861464 struct netlink_callback *cb,
14871465 struct nfsd_genl_rqstp *rqstp)
@@ -1558,8 +1536,16 @@ static int nfsd_genl_rpc_status_compose_msg(struct sk_buff *skb, · 70 unmodified lines
15581536 int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
15591537 struct netlink_callback *cb)
15601538 {
1561− struct nfsd_net *nn = net_generic(sock_net(skb->sk), nfsd_net_id);
15621539 int i, ret, rqstp_index = 0;
1540+ struct nfsd_net *nn;
1541+
1542+ mutex_lock(&nfsd_mutex);
1543+
1544+ nn = net_generic(sock_net(skb->sk), nfsd_net_id);
1545+ if (!nn->nfsd_serv) {
1546+ ret = -ENODEV;
1547+ goto out_unlock;
1548+ }
15631549
15641550 rcu_read_lock();
15651551
@@ -1636,22 +1622,10 @@ int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb, · 70 unmodified lines
16361622 ret = skb->len;
16371623 out:
16381624 rcu_read_unlock();
1639−
1640− return ret;
1641−}
1642−
1643−/**
1644− * nfsd_nl_rpc_status_get_done - rpc_status_get dumpit post-processing
1645− * @cb: netlink metadata and command arguments
1646− *
1647− * Return values:
1648− * %0: Success
1649− */
1650−int nfsd_nl_rpc_status_get_done(struct netlink_callback *cb)
1651−{
1625+out_unlock:
16521626 mutex_unlock(&nfsd_mutex);
16531627
1654− return 0;
1628+ return ret;
16551629 }
16561630
16571631 /**
fs/ocfs2/journal.c+107−85
@@ -479,12 +479,6 @@ bail: · 478 unmodified lines
479479 return status;
480480 }
481481
482−
483−struct ocfs2_triggers {
484− struct jbd2_buffer_trigger_type ot_triggers;
485− int ot_offset;
486−};
487−
488482 static inline struct ocfs2_triggers *to_ocfs2_trigger(struct jbd2_buffer_trigger_type *triggers)
489483 {
490484 return container_of(triggers, struct ocfs2_triggers, ot_triggers);
@@ -548,85 +542,76 @@ static void ocfs2_db_frozen_trigger(struct jbd2_buffer_trigger_type *triggers, · 57 unmodified lines
548542 static void ocfs2_abort_trigger(struct jbd2_buffer_trigger_type *triggers,
549543 struct buffer_head *bh)
550544 {
545+ struct ocfs2_triggers *ot = to_ocfs2_trigger(triggers);
546+
551547 mlog(ML_ERROR,
552548 "ocfs2_abort_trigger called by JBD2. bh = 0x%lx, "
553549 "bh->b_blocknr = %llu\n",
554550 (unsigned long)bh,
555551 (unsigned long long)bh->b_blocknr);
556552
557− ocfs2_error(bh->b_assoc_map->host->i_sb,
553+ ocfs2_error(ot->sb,
558554 "JBD2 has aborted our journal, ocfs2 cannot continue\n");
559555 }
560556
561−static struct ocfs2_triggers di_triggers = {
562− .ot_triggers = {
563− .t_frozen = ocfs2_frozen_trigger,
564− .t_abort = ocfs2_abort_trigger,
565− },
566− .ot_offset = offsetof(struct ocfs2_dinode, i_check),
567−};
568−
569−static struct ocfs2_triggers eb_triggers = {
570− .ot_triggers = {
571− .t_frozen = ocfs2_frozen_trigger,
572− .t_abort = ocfs2_abort_trigger,
573− },
574− .ot_offset = offsetof(struct ocfs2_extent_block, h_check),
575−};
576−
577−static struct ocfs2_triggers rb_triggers = {
578− .ot_triggers = {
579− .t_frozen = ocfs2_frozen_trigger,
580− .t_abort = ocfs2_abort_trigger,
581− },
582− .ot_offset = offsetof(struct ocfs2_refcount_block, rf_check),
583−};
584−
585−static struct ocfs2_triggers gd_triggers = {
586− .ot_triggers = {
587− .t_frozen = ocfs2_frozen_trigger,
588− .t_abort = ocfs2_abort_trigger,
589− },
590− .ot_offset = offsetof(struct ocfs2_group_desc, bg_check),
591−};
592−
593−static struct ocfs2_triggers db_triggers = {
594− .ot_triggers = {
595− .t_frozen = ocfs2_db_frozen_trigger,
596− .t_abort = ocfs2_abort_trigger,
597− },
598−};
557+static void ocfs2_setup_csum_triggers(struct super_block *sb,
558+ enum ocfs2_journal_trigger_type type,
559+ struct ocfs2_triggers *ot)
560+{
561+ BUG_ON(type >= OCFS2_JOURNAL_TRIGGER_COUNT);
599562
600−static struct ocfs2_triggers xb_triggers = {
601− .ot_triggers = {
602− .t_frozen = ocfs2_frozen_trigger,
603− .t_abort = ocfs2_abort_trigger,
604− },
605− .ot_offset = offsetof(struct ocfs2_xattr_block, xb_check),
606−};
563+ switch (type) {
564+ case OCFS2_JTR_DI:
565+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
566+ ot->ot_offset = offsetof(struct ocfs2_dinode, i_check);
567+ break;
568+ case OCFS2_JTR_EB:
569+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
570+ ot->ot_offset = offsetof(struct ocfs2_extent_block, h_check);
571+ break;
572+ case OCFS2_JTR_RB:
573+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
574+ ot->ot_offset = offsetof(struct ocfs2_refcount_block, rf_check);
575+ break;
576+ case OCFS2_JTR_GD:
577+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
578+ ot->ot_offset = offsetof(struct ocfs2_group_desc, bg_check);
579+ break;
580+ case OCFS2_JTR_DB:
581+ ot->ot_triggers.t_frozen = ocfs2_db_frozen_trigger;
582+ break;
583+ case OCFS2_JTR_XB:
584+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
585+ ot->ot_offset = offsetof(struct ocfs2_xattr_block, xb_check);
586+ break;
587+ case OCFS2_JTR_DQ:
588+ ot->ot_triggers.t_frozen = ocfs2_dq_frozen_trigger;
589+ break;
590+ case OCFS2_JTR_DR:
591+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
592+ ot->ot_offset = offsetof(struct ocfs2_dx_root_block, dr_check);
593+ break;
594+ case OCFS2_JTR_DL:
595+ ot->ot_triggers.t_frozen = ocfs2_frozen_trigger;
596+ ot->ot_offset = offsetof(struct ocfs2_dx_leaf, dl_check);
597+ break;
598+ case OCFS2_JTR_NONE:
599+ /* To make compiler happy... */
600+ return;
601+ }
607602
608−static struct ocfs2_triggers dq_triggers = {
609− .ot_triggers = {
610− .t_frozen = ocfs2_dq_frozen_trigger,
611− .t_abort = ocfs2_abort_trigger,
612− },
613−};
603+ ot->ot_triggers.t_abort = ocfs2_abort_trigger;
604+ ot->sb = sb;
605+}
614606
615−static struct ocfs2_triggers dr_triggers = {
616− .ot_triggers = {
617− .t_frozen = ocfs2_frozen_trigger,
618− .t_abort = ocfs2_abort_trigger,
619− },
620− .ot_offset = offsetof(struct ocfs2_dx_root_block, dr_check),
621−};
607+void ocfs2_initialize_journal_triggers(struct super_block *sb,
608+ struct ocfs2_triggers triggers[])
609+{
610+ enum ocfs2_journal_trigger_type type;
622611
623−static struct ocfs2_triggers dl_triggers = {
624− .ot_triggers = {
625− .t_frozen = ocfs2_frozen_trigger,
626− .t_abort = ocfs2_abort_trigger,
627− },
628− .ot_offset = offsetof(struct ocfs2_dx_leaf, dl_check),
629−};
612+ for (type = OCFS2_JTR_DI; type < OCFS2_JOURNAL_TRIGGER_COUNT; type++)
613+ ocfs2_setup_csum_triggers(sb, type, &triggers[type]);
614+}
630615
631616 static int __ocfs2_journal_access(handle_t *handle,
632617 struct ocfs2_caching_info *ci,
@@ -708,56 +693,91 @@ static int __ocfs2_journal_access(handle_t *handle, · 75 unmodified lines
708693 int ocfs2_journal_access_di(handle_t *handle, struct ocfs2_caching_info *ci,
709694 struct buffer_head *bh, int type)
710695 {
711− return __ocfs2_journal_access(handle, ci, bh, &di_triggers, type);
696+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
697+
698+ return __ocfs2_journal_access(handle, ci, bh,
699+ &osb->s_journal_triggers[OCFS2_JTR_DI],
700+ type);
712701 }
713702
714703 int ocfs2_journal_access_eb(handle_t *handle, struct ocfs2_caching_info *ci,
715704 struct buffer_head *bh, int type)
716705 {
717− return __ocfs2_journal_access(handle, ci, bh, &eb_triggers, type);
706+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
707+
708+ return __ocfs2_journal_access(handle, ci, bh,
709+ &osb->s_journal_triggers[OCFS2_JTR_EB],
710+ type);
718711 }
719712
720713 int ocfs2_journal_access_rb(handle_t *handle, struct ocfs2_caching_info *ci,
721714 struct buffer_head *bh, int type)
722715 {
723− return __ocfs2_journal_access(handle, ci, bh, &rb_triggers,
716+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
717+
718+ return __ocfs2_journal_access(handle, ci, bh,
719+ &osb->s_journal_triggers[OCFS2_JTR_RB],
724720 type);
725721 }
726722
727723 int ocfs2_journal_access_gd(handle_t *handle, struct ocfs2_caching_info *ci,
728724 struct buffer_head *bh, int type)
729725 {
730− return __ocfs2_journal_access(handle, ci, bh, &gd_triggers, type);
726+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
727+
728+ return __ocfs2_journal_access(handle, ci, bh,
729+ &osb->s_journal_triggers[OCFS2_JTR_GD],
730+ type);
731731 }
732732
733733 int ocfs2_journal_access_db(handle_t *handle, struct ocfs2_caching_info *ci,
734734 struct buffer_head *bh, int type)
735735 {
736− return __ocfs2_journal_access(handle, ci, bh, &db_triggers, type);
736+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
737+
738+ return __ocfs2_journal_access(handle, ci, bh,
739+ &osb->s_journal_triggers[OCFS2_JTR_DB],
740+ type);
737741 }
738742
739743 int ocfs2_journal_access_xb(handle_t *handle, struct ocfs2_caching_info *ci,
740744 struct buffer_head *bh, int type)
741745 {
742− return __ocfs2_journal_access(handle, ci, bh, &xb_triggers, type);
746+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
747+
748+ return __ocfs2_journal_access(handle, ci, bh,
749+ &osb->s_journal_triggers[OCFS2_JTR_XB],
750+ type);
743751 }
744752
745753 int ocfs2_journal_access_dq(handle_t *handle, struct ocfs2_caching_info *ci,
746754 struct buffer_head *bh, int type)
747755 {
748− return __ocfs2_journal_access(handle, ci, bh, &dq_triggers, type);
756+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
757+
758+ return __ocfs2_journal_access(handle, ci, bh,
759+ &osb->s_journal_triggers[OCFS2_JTR_DQ],
760+ type);
749761 }
750762
751763 int ocfs2_journal_access_dr(handle_t *handle, struct ocfs2_caching_info *ci,
752764 struct buffer_head *bh, int type)
753765 {
754− return __ocfs2_journal_access(handle, ci, bh, &dr_triggers, type);
766+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
767+
768+ return __ocfs2_journal_access(handle, ci, bh,
769+ &osb->s_journal_triggers[OCFS2_JTR_DR],
770+ type);
755771 }
756772
757773 int ocfs2_journal_access_dl(handle_t *handle, struct ocfs2_caching_info *ci,
758774 struct buffer_head *bh, int type)
759775 {
760− return __ocfs2_journal_access(handle, ci, bh, &dl_triggers, type);
776+ struct ocfs2_super *osb = OCFS2_SB(ocfs2_metadata_cache_get_super(ci));
777+
778+ return __ocfs2_journal_access(handle, ci, bh,
779+ &osb->s_journal_triggers[OCFS2_JTR_DL],
780+ type);
761781 }
762782
763783 int ocfs2_journal_access(handle_t *handle, struct ocfs2_caching_info *ci,
@@ -778,13 +798,15 @@ void ocfs2_journal_dirty(handle_t *handle, struct buffer_head *bh) · 14 unmodified lines
778798 if (!is_handle_aborted(handle)) {
779799 journal_t *journal = handle->h_transaction->t_journal;
780800
781− mlog(ML_ERROR, "jbd2_journal_dirty_metadata failed. "
782− "Aborting transaction and journal.\n");
801+ mlog(ML_ERROR, "jbd2_journal_dirty_metadata failed: "
802+ "handle type %u started at line %u, credits %u/%u "
803+ "errcode %d. Aborting transaction and journal.\n",
804+ handle->h_type, handle->h_line_no,
805+ handle->h_requested_credits,
806+ jbd2_handle_buffer_credits(handle), status);
783807 handle->h_err = status;
784808 jbd2_journal_abort_handle(handle);
785809 jbd2_journal_abort(journal, status);
786− ocfs2_abort(bh->b_assoc_map->host->i_sb,
787− "Journal already aborted.\n");
788810 }
789811 }
790812 }
fs/ocfs2/ocfs2.h+27−0
@@ -284,6 +284,30 @@ enum ocfs2_mount_options · 283 unmodified lines
284284 #define OCFS2_OSB_ERROR_FS 0x0004
285285 #define OCFS2_DEFAULT_ATIME_QUANTUM 60
286286
287+struct ocfs2_triggers {
288+ struct jbd2_buffer_trigger_type ot_triggers;
289+ int ot_offset;
290+ struct super_block *sb;
291+};
292+
293+enum ocfs2_journal_trigger_type {
294+ OCFS2_JTR_DI,
295+ OCFS2_JTR_EB,
296+ OCFS2_JTR_RB,
297+ OCFS2_JTR_GD,
298+ OCFS2_JTR_DB,
299+ OCFS2_JTR_XB,
300+ OCFS2_JTR_DQ,
301+ OCFS2_JTR_DR,
302+ OCFS2_JTR_DL,
303+ OCFS2_JTR_NONE /* This must be the last entry */
304+};
305+
306+#define OCFS2_JOURNAL_TRIGGER_COUNT OCFS2_JTR_NONE
307+
308+void ocfs2_initialize_journal_triggers(struct super_block *sb,
309+ struct ocfs2_triggers triggers[]);
310+
287311 struct ocfs2_journal;
288312 struct ocfs2_slot_info;
289313 struct ocfs2_recovery_map;
@@ -351,6 +375,9 @@ struct ocfs2_super · 61 unmodified lines
351375 struct ocfs2_journal *journal;
352376 unsigned long osb_commit_interval;
353377
378+ /* Journal triggers for checksum */
379+ struct ocfs2_triggers s_journal_triggers[OCFS2_JOURNAL_TRIGGER_COUNT];
380+
354381 struct delayed_work la_enable_wq;
355382
356383 /*
fs/ocfs2/super.c+3−1
@@ -1075,9 +1075,11 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) · 1074 unmodified lines
10751075 debugfs_create_file("fs_state", S_IFREG|S_IRUSR, osb->osb_debug_root,
10761076 osb, &ocfs2_osb_debug_fops);
10771077
1078− if (ocfs2_meta_ecc(osb))
1078+ if (ocfs2_meta_ecc(osb)) {
1079+ ocfs2_initialize_journal_triggers(sb, osb->s_journal_triggers);
10791080 ocfs2_blockcheck_stats_debugfs_install( &osb->osb_ecc_stats,
10801081 osb->osb_debug_root);
1082+ }
10811083
10821084 status = ocfs2_mount_volume(sb);
10831085 if (status < 0)
fs/overlayfs/dir.c+4−4
@@ -1314,10 +1314,6 @@ static int ovl_create_tmpfile(struct file *file, struct dentry *dentry, · 1313 unmodified lines
13141314 int flags = file->f_flags | OVL_OPEN_FLAGS;
13151315 int err;
13161316
1317− err = ovl_copy_up(dentry->d_parent);
1318− if (err)
1319− return err;
1320−
13211317 old_cred = ovl_override_creds(dentry->d_sb);
13221318 err = ovl_setup_cred_for_create(dentry, inode, mode, old_cred);
13231319 if (err)
@@ -1360,6 +1356,10 @@ static int ovl_tmpfile(struct mnt_idmap *idmap, struct inode *dir, · 36 unmodified lines
13601356 if (!OVL_FS(dentry->d_sb)->tmpfile)
13611357 return -EOPNOTSUPP;
13621358
1359+ err = ovl_copy_up(dentry->d_parent);
1360+ if (err)
1361+ return err;
1362+
13631363 err = ovl_want_write(dentry);
13641364 if (err)
13651365 return err;
fs/overlayfs/export.c+5−1
@@ -181,6 +181,10 @@ static int ovl_check_encode_origin(struct dentry *dentry) · 180 unmodified lines
181181 struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
182182 bool decodable = ofs->config.nfs_export;
183183
184+ /* No upper layer? */
185+ if (!ovl_upper_mnt(ofs))
186+ return 1;
187+
184188 /* Lower file handle for non-upper non-decodable */
185189 if (!ovl_dentry_upper(dentry) && !decodable)
186190 return 1;
@@ -209,7 +213,7 @@ static int ovl_check_encode_origin(struct dentry *dentry) · 22 unmodified lines
209213 * ovl_connect_layer() will try to make origin's layer "connected" by
210214 * copying up a "connectable" ancestor.
211215 */
212− if (d_is_dir(dentry) && ovl_upper_mnt(ofs) && decodable)
216+ if (d_is_dir(dentry) && decodable)
213217 return ovl_connect_layer(dentry);
214218
215219 /* Lower file handle for indexed and non-upper dir/non-dir */
fs/smb/client/cifsfs.c+1−1
@@ -134,7 +134,7 @@ module_param(enable_oplocks, bool, 0644); · 133 unmodified lines
134134 MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks. Default: y/Y/1");
135135
136136 module_param(enable_gcm_256, bool, 0644);
137−MODULE_PARM_DESC(enable_gcm_256, "Enable requesting strongest (256 bit) GCM encryption. Default: n/N/0");
137+MODULE_PARM_DESC(enable_gcm_256, "Enable requesting strongest (256 bit) GCM encryption. Default: y/Y/0");
138138
139139 module_param(require_gcm_256, bool, 0644);
140140 MODULE_PARM_DESC(require_gcm_256, "Require strongest (256 bit) GCM encryption. Default: n/N/0");
fs/smb/client/cifsglob.h+2−1
@@ -1494,6 +1494,8 @@ struct cifs_aio_ctx { · 1493 unmodified lines
14941494 struct cifs_io_request {
14951495 struct netfs_io_request rreq;
14961496 struct cifsFileInfo *cfile;
1497+ struct TCP_Server_Info *server;
1498+ pid_t pid;
14971499 };
14981500
14991501 /* asynchronous read support */
@@ -1504,7 +1506,6 @@ struct cifs_io_subrequest { · 4 unmodified lines
15041506 struct cifs_io_request *req;
15051507 };
15061508 ssize_t got_bytes;
1507− pid_t pid;
15081509 unsigned int xid;
15091510 int result;
15101511 bool have_xid;
fs/smb/client/cifssmb.c+4−4
@@ -1345,8 +1345,8 @@ cifs_async_readv(struct cifs_io_subrequest *rdata) · 1344 unmodified lines
13451345 if (rc)
13461346 return rc;
13471347
1348− smb->hdr.Pid = cpu_to_le16((__u16)rdata->pid);
1349− smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->pid >> 16));
1348+ smb->hdr.Pid = cpu_to_le16((__u16)rdata->req->pid);
1349+ smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->req->pid >> 16));
13501350
13511351 smb->AndXCommand = 0xFF; /* none */
13521352 smb->Fid = rdata->req->cfile->fid.netfid;
@@ -1689,8 +1689,8 @@ cifs_async_writev(struct cifs_io_subrequest *wdata) · 336 unmodified lines
16891689 if (rc)
16901690 goto async_writev_out;
16911691
1692− smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid);
1693− smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16));
1692+ smb->hdr.Pid = cpu_to_le16((__u16)wdata->req->pid);
1693+ smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->req->pid >> 16));
16941694
16951695 smb->AndXCommand = 0xFF; /* none */
16961696 smb->Fid = wdata->req->cfile->fid.netfid;
fs/smb/client/file.c+6−21
@@ -134,17 +134,15 @@ fail: · 133 unmodified lines
134134 static bool cifs_clamp_length(struct netfs_io_subrequest *subreq)
135135 {
136136 struct netfs_io_request *rreq = subreq->rreq;
137− struct TCP_Server_Info *server;
138137 struct cifs_io_subrequest *rdata = container_of(subreq, struct cifs_io_subrequest, subreq);
139138 struct cifs_io_request *req = container_of(subreq->rreq, struct cifs_io_request, rreq);
139+ struct TCP_Server_Info *server = req->server;
140140 struct cifs_sb_info *cifs_sb = CIFS_SB(rreq->inode->i_sb);
141141 size_t rsize = 0;
142142 int rc;
143143
144144 rdata->xid = get_xid();
145145 rdata->have_xid = true;
146−
147− server = cifs_pick_channel(tlink_tcon(req->cfile->tlink)->ses);
148146 rdata->server = server;
149147
150148 if (cifs_sb->ctx->rsize == 0)
@@ -179,15 +177,8 @@ static void cifs_req_issue_read(struct netfs_io_subrequest *subreq) · 28 unmodified lines
179177 struct netfs_io_request *rreq = subreq->rreq;
180178 struct cifs_io_subrequest *rdata = container_of(subreq, struct cifs_io_subrequest, subreq);
181179 struct cifs_io_request *req = container_of(subreq->rreq, struct cifs_io_request, rreq);
182− struct cifs_sb_info *cifs_sb = CIFS_SB(rreq->inode->i_sb);
183− pid_t pid;
184180 int rc = 0;
185181
186− if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
187− pid = req->cfile->pid;
188− else
189− pid = current->tgid; // Ummm... This may be a workqueue
190−
191182 cifs_dbg(FYI, "%s: op=%08x[%x] mapping=%p len=%zu/%zu\n",
192183 __func__, rreq->debug_id, subreq->debug_index, rreq->mapping,
193184 subreq->transferred, subreq->len);
@@ -201,16 +192,8 @@ static void cifs_req_issue_read(struct netfs_io_subrequest *subreq) · 7 unmodified lines
201192 }
202193
203194 __set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
204− rdata->pid = pid;
205−
206− rc = adjust_credits(rdata->server, &rdata->credits, rdata->subreq.len);
207− if (!rc) {
208− if (rdata->req->cfile->invalidHandle)
209− rc = -EAGAIN;
210− else
211− rc = rdata->server->ops->async_readv(rdata);
212− }
213195
196+ rc = rdata->server->ops->async_readv(rdata);
214197 out:
215198 if (rc)
216199 netfs_subreq_terminated(subreq, rc, false);
@@ -245,11 +228,15 @@ static int cifs_init_request(struct netfs_io_request *rreq, struct file *file) · 28 unmodified lines
245228
246229 rreq->rsize = cifs_sb->ctx->rsize;
247230 rreq->wsize = cifs_sb->ctx->wsize;
231+ req->pid = current->tgid; // Ummm... This may be a workqueue
248232
249233 if (file) {
250234 open_file = file->private_data;
251235 rreq->netfs_priv = file->private_data;
252236 req->cfile = cifsFileInfo_get(open_file);
237+ req->server = cifs_pick_channel(tlink_tcon(req->cfile->tlink)->ses);
238+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
239+ req->pid = req->cfile->pid;
253240 } else if (rreq->origin != NETFS_WRITEBACK) {
254241 WARN_ON_ONCE(1);
255242 return -EIO;
@@ -3200,8 +3187,6 @@ static int cifs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) · 2944 unmodified lines
32003187 {
32013188 ssize_t ret;
32023189
3203− WARN_ON_ONCE(iov_iter_count(iter) != PAGE_SIZE);
3204−
32053190 if (iov_iter_rw(iter) == READ)
32063191 ret = netfs_unbuffered_read_iter_locked(iocb, iter);
32073192 else
fs/smb/client/smb2pdu.c+14−5
@@ -4484,6 +4484,16 @@ smb2_new_read_req(void **buf, unsigned int *total_len, · 4483 unmodified lines
44844484 return rc;
44854485 }
44864486
4487+static void smb2_readv_worker(struct work_struct *work)
4488+{
4489+ struct cifs_io_subrequest *rdata =
4490+ container_of(work, struct cifs_io_subrequest, subreq.work);
4491+
4492+ netfs_subreq_terminated(&rdata->subreq,
4493+ (rdata->result == 0 || rdata->result == -EAGAIN) ?
4494+ rdata->got_bytes : rdata->result, true);
4495+}
4496+
44874497 static void
44884498 smb2_readv_callback(struct mid_q_entry *mid)
44894499 {
@@ -4578,9 +4588,8 @@ smb2_readv_callback(struct mid_q_entry *mid) · 88 unmodified lines
45784588 rdata->result = 0;
45794589 }
45804590 rdata->credits.value = 0;
4581− netfs_subreq_terminated(&rdata->subreq,
4582− (rdata->result == 0 || rdata->result == -EAGAIN) ?
4583− rdata->got_bytes : rdata->result, true);
4591+ INIT_WORK(&rdata->subreq.work, smb2_readv_worker);
4592+ queue_work(cifsiod_wq, &rdata->subreq.work);
45844593 release_mid(mid);
45854594 add_credits(server, &credits, 0);
45864595 }
@@ -4612,7 +4621,7 @@ smb2_async_readv(struct cifs_io_subrequest *rdata) · 25 unmodified lines
46124621 io_parms.length = rdata->subreq.len;
46134622 io_parms.persistent_fid = rdata->req->cfile->fid.persistent_fid;
46144623 io_parms.volatile_fid = rdata->req->cfile->fid.volatile_fid;
4615− io_parms.pid = rdata->pid;
4624+ io_parms.pid = rdata->req->pid;
46164625
46174626 rc = smb2_new_read_req(
46184627 (void **) &buf, &total_len, &io_parms, rdata, 0, 0);
@@ -4864,7 +4873,7 @@ smb2_async_writev(struct cifs_io_subrequest *wdata) · 245 unmodified lines
48644873 .length = wdata->subreq.len,
48654874 .persistent_fid = wdata->req->cfile->fid.persistent_fid,
48664875 .volatile_fid = wdata->req->cfile->fid.volatile_fid,
4867− .pid = wdata->pid,
4876+ .pid = wdata->req->pid,
48684877 };
48694878 io_parms = &_io_parms;
48704879
fs/xfs/xfs_inode.c+19−4
@@ -2548,11 +2548,26 @@ xfs_ifree_cluster( · 2547 unmodified lines
25482548 * This buffer may not have been correctly initialised as we
25492549 * didn't read it from disk. That's not important because we are
25502550 * only using to mark the buffer as stale in the log, and to
2551− * attach stale cached inodes on it. That means it will never be
2552− * dispatched for IO. If it is, we want to know about it, and we
2553− * want it to fail. We can acheive this by adding a write
2554− * verifier to the buffer.
2551+ * attach stale cached inodes on it.
2552+ *
2553+ * For the inode that triggered the cluster freeing, this
2554+ * attachment may occur in xfs_inode_item_precommit() after we
2555+ * have marked this buffer stale. If this buffer was not in
2556+ * memory before xfs_ifree_cluster() started, it will not be
2557+ * marked XBF_DONE and this will cause problems later in
2558+ * xfs_inode_item_precommit() when we trip over a (stale, !done)
2559+ * buffer to attached to the transaction.
2560+ *
2561+ * Hence we have to mark the buffer as XFS_DONE here. This is
2562+ * safe because we are also marking the buffer as XBF_STALE and
2563+ * XFS_BLI_STALE. That means it will never be dispatched for
2564+ * IO and it won't be unlocked until the cluster freeing has
2565+ * been committed to the journal and the buffer unpinned. If it
2566+ * is written, we want to know about it, and we want it to
2567+ * fail. We can acheive this by adding a write verifier to the
2568+ * buffer.
25552569 */
2570+ bp->b_flags |= XBF_DONE;
25562571 bp->b_ops = &xfs_inode_buf_ops;
25572572
25582573 /*
include/linux/bpf_verifier.h+2−0
@@ -746,6 +746,8 @@ struct bpf_verifier_env { · 745 unmodified lines
746746 /* Same as scratched_regs but for stack slots */
747747 u64 scratched_stack_slots;
748748 u64 prev_log_pos, prev_insn_print_pos;
749+ /* buffer used to temporary hold constants as scalar registers */
750+ struct bpf_reg_state fake_reg[2];
749751 /* buffer used to generate temporary string representations,
750752 * e.g., in reg_type_str() to generate reg_type string
751753 */
include/linux/btf.h+1−1
@@ -82,7 +82,7 @@ · 81 unmodified lines
8282 * as to avoid issues such as the compiler inlining or eliding either a static
8383 * kfunc, or a global kfunc in an LTO build.
8484 */
85−#define __bpf_kfunc __used noinline
85+#define __bpf_kfunc __used __retain noinline
8686
8787 #define __bpf_kfunc_start_defs() \
8888 __diag_push(); \
include/linux/compiler_types.h+23−0
@@ -143,6 +143,29 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { } · 142 unmodified lines
143143 # define __preserve_most
144144 #endif
145145
146+/*
147+ * Annotating a function/variable with __retain tells the compiler to place
148+ * the object in its own section and set the flag SHF_GNU_RETAIN. This flag
149+ * instructs the linker to retain the object during garbage-cleanup or LTO
150+ * phases.
151+ *
152+ * Note that the __used macro is also used to prevent functions or data
153+ * being optimized out, but operates at the compiler/IR-level and may still
154+ * allow unintended removal of objects during linking.
155+ *
156+ * Optional: only supported since gcc >= 11, clang >= 13
157+ *
158+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-retain-function-attribute
159+ * clang: https://clang.llvm.org/docs/AttributeReference.html#retain
160+ */
161+#if __has_attribute(__retain__) && \
162+ (defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || \
163+ defined(CONFIG_LTO_CLANG))
164+# define __retain __attribute__((__retain__))
165+#else
166+# define __retain
167+#endif
168+
146169 /* Compiler specific macros. */
147170 #ifdef __clang__
148171 #include <linux/compiler-clang.h>
include/linux/i2c.h+22−2
@@ -960,8 +960,6 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr); · 959 unmodified lines
960960 #define builtin_i2c_driver(__i2c_driver) \
961961 builtin_driver(__i2c_driver, i2c_add_driver)
962962
963−#endif /* I2C */
964−
965963 /* must call put_device() when done with returned i2c_client device */
966964 struct i2c_client *i2c_find_device_by_fwnode(struct fwnode_handle *fwnode);
967965
@@ -971,6 +969,28 @@ struct i2c_adapter *i2c_find_adapter_by_fwnode(struct fwnode_handle *fwnode); · 3 unmodified lines
971969 /* must call i2c_put_adapter() when done with returned i2c_adapter device */
972970 struct i2c_adapter *i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode);
973971
972+#else /* I2C */
973+
974+static inline struct i2c_client *
975+i2c_find_device_by_fwnode(struct fwnode_handle *fwnode)
976+{
977+ return NULL;
978+}
979+
980+static inline struct i2c_adapter *
981+i2c_find_adapter_by_fwnode(struct fwnode_handle *fwnode)
982+{
983+ return NULL;
984+}
985+
986+static inline struct i2c_adapter *
987+i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode)
988+{
989+ return NULL;
990+}
991+
992+#endif /* !I2C */
993+
974994 #if IS_ENABLED(CONFIG_OF)
975995 /* must call put_device() when done with returned i2c_client device */
976996 static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
include/linux/kcov.h+2−0
@@ -21,6 +21,8 @@ enum kcov_mode { · 20 unmodified lines
2121 KCOV_MODE_TRACE_PC = 2,
2222 /* Collecting comparison operands mode. */
2323 KCOV_MODE_TRACE_CMP = 3,
24+ /* The process owns a KCOV remote reference. */
25+ KCOV_MODE_REMOTE = 4,
2426 };
2527
2628 #define KCOV_IN_CTXSW (1 << 30)
include/linux/lsm_hook_defs.h+1−1
@@ -413,7 +413,7 @@ LSM_HOOK(void, LSM_RET_VOID, key_post_create_or_update, struct key *keyring, · 412 unmodified lines
413413
414414 #ifdef CONFIG_AUDIT
415415 LSM_HOOK(int, 0, audit_rule_init, u32 field, u32 op, char *rulestr,
416− void **lsmrule)
416+ void **lsmrule, gfp_t gfp)
417417 LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
418418 LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
419419 LSM_HOOK(void, LSM_RET_VOID, audit_rule_free, void *lsmrule)
include/linux/mm.h+1−8
@@ -3776,14 +3776,7 @@ DECLARE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); · 3775 unmodified lines
37763776 static inline bool want_init_on_free(void)
37773777 {
37783778 return static_branch_maybe(CONFIG_INIT_ON_FREE_DEFAULT_ON,
3779− &init_on_free);
3780−}
3781−
3782−DECLARE_STATIC_KEY_MAYBE(CONFIG_INIT_MLOCKED_ON_FREE_DEFAULT_ON, init_mlocked_on_free);
3783−static inline bool want_init_mlocked_on_free(void)
3784−{
3785− return static_branch_maybe(CONFIG_INIT_MLOCKED_ON_FREE_DEFAULT_ON,
3786− &init_mlocked_on_free);
3779+ &init_on_free);
37873780 }
37883781
37893782 extern bool _debug_pagealloc_enabled_early;
include/linux/numa.h+5−0
@@ -15,6 +15,11 @@ · 14 unmodified lines
1515 #define NUMA_NO_NODE (-1)
1616 #define NUMA_NO_MEMBLK (-1)
1717
18+static inline bool numa_valid_node(int nid)
19+{
20+ return nid >= 0 && nid < MAX_NUMNODES;
21+}
22+
1823 /* optionally keep NUMA memory info available post init */
1924 #ifdef CONFIG_NUMA_KEEP_MEMINFO
2025 #define __initdata_or_meminfo
include/linux/pagemap.h+4−0
@@ -381,6 +381,10 @@ static inline void mapping_set_large_folios(struct address_space *mapping) · 380 unmodified lines
381381 */
382382 static inline bool mapping_large_folio_support(struct address_space *mapping)
383383 {
384+ /* AS_LARGE_FOLIO_SUPPORT is only reasonable for pagecache folios */
385+ VM_WARN_ONCE((unsigned long)mapping & PAGE_MAPPING_ANON,
386+ "Anonymous mapping always supports large folio");
387+
384388 return IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
385389 test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
386390 }
include/linux/pgalloc_tag.h+8−3
@@ -37,6 +37,9 @@ static inline union codetag_ref *get_page_tag_ref(struct page *page) · 36 unmodified lines
3737
3838 static inline void put_page_tag_ref(union codetag_ref *ref)
3939 {
40+ if (WARN_ON(!ref))
41+ return;
42+
4043 page_ext_put(page_ext_from_codetag_ref(ref));
4144 }
4245
@@ -102,9 +105,11 @@ static inline struct alloc_tag *pgalloc_tag_get(struct page *page) · 59 unmodified lines
102105 union codetag_ref *ref = get_page_tag_ref(page);
103106
104107 alloc_tag_sub_check(ref);
105− if (ref && ref->ct)
106− tag = ct_to_alloc_tag(ref->ct);
107− put_page_tag_ref(ref);
108+ if (ref) {
109+ if (ref->ct)
110+ tag = ct_to_alloc_tag(ref->ct);
111+ put_page_tag_ref(ref);
112+ }
108113 }
109114
110115 return tag;
include/linux/regulator/consumer.h+7−0
@@ -250,6 +250,7 @@ int regulator_get_hardware_vsel_register(struct regulator *regulator, · 249 unmodified lines
250250 unsigned *vsel_mask);
251251 int regulator_list_hardware_vsel(struct regulator *regulator,
252252 unsigned selector);
253+int regulator_hardware_enable(struct regulator *regulator, bool enable);
253254
254255 /* regulator notifier block */
255256 int regulator_register_notifier(struct regulator *regulator,
@@ -571,6 +572,12 @@ static inline int regulator_list_hardware_vsel(struct regulator *regulator, · 315 unmodified lines
571572 return -EOPNOTSUPP;
572573 }
573574
575+static inline int regulator_hardware_enable(struct regulator *regulator,
576+ bool enable)
577+{
578+ return -EOPNOTSUPP;
579+}
580+
574581 static inline int regulator_register_notifier(struct regulator *regulator,
575582 struct notifier_block *nb)
576583 {
include/linux/security.h+3−2
@@ -2048,7 +2048,8 @@ static inline void security_key_post_create_or_update(struct key *keyring, · 2047 unmodified lines
20482048
20492049 #ifdef CONFIG_AUDIT
20502050 #ifdef CONFIG_SECURITY
2051−int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule);
2051+int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule,
2052+ gfp_t gfp);
20522053 int security_audit_rule_known(struct audit_krule *krule);
20532054 int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule);
20542055 void security_audit_rule_free(void *lsmrule);
@@ -2056,7 +2057,7 @@ void security_audit_rule_free(void *lsmrule); · 1 unmodified line
20562057 #else
20572058
20582059 static inline int security_audit_rule_init(u32 field, u32 op, char *rulestr,
2059− void **lsmrule)
2060+ void **lsmrule, gfp_t gfp)
20602061 {
20612062 return 0;
20622063 }
include/linux/spi/spi.h+3−2
@@ -1085,12 +1085,13 @@ struct spi_transfer { · 1084 unmodified lines
10851085 unsigned dummy_data:1;
10861086 unsigned cs_off:1;
10871087 unsigned cs_change:1;
1088− unsigned tx_nbits:3;
1089− unsigned rx_nbits:3;
1088+ unsigned tx_nbits:4;
1089+ unsigned rx_nbits:4;
10901090 unsigned timestamped:1;
10911091 #define SPI_NBITS_SINGLE 0x01 /* 1-bit transfer */
10921092 #define SPI_NBITS_DUAL 0x02 /* 2-bit transfer */
10931093 #define SPI_NBITS_QUAD 0x04 /* 4-bit transfer */
1094+#define SPI_NBITS_OCTAL 0x08 /* 8-bit transfer */
10941095 u8 bits_per_word;
10951096 struct spi_delay delay;
10961097 struct spi_delay cs_change_delay;
include/linux/string.h+1−1
@@ -289,7 +289,7 @@ extern void *kmemdup_noprof(const void *src, size_t len, gfp_t gfp) __realloc_si · 288 unmodified lines
289289
290290 extern void *kvmemdup(const void *src, size_t len, gfp_t gfp) __realloc_size(2);
291291 extern char *kmemdup_nul(const char *s, size_t len, gfp_t gfp);
292−extern void *kmemdup_array(const void *src, size_t element_size, size_t count, gfp_t gfp)
292+extern void *kmemdup_array(const void *src, size_t count, size_t element_size, gfp_t gfp)
293293 __realloc_size(2, 3);
294294
295295 /* lib/argv_split.c */
include/net/netns/netfilter.h+3−0
@@ -15,6 +15,9 @@ struct netns_nf { · 14 unmodified lines
1515 const struct nf_logger __rcu *nf_loggers[NFPROTO_NUMPROTO];
1616 #ifdef CONFIG_SYSCTL
1717 struct ctl_table_header *nf_log_dir_header;
18+#ifdef CONFIG_LWTUNNEL
19+ struct ctl_table_header *nf_lwtnl_dir_header;
20+#endif
1821 #endif
1922 struct nf_hook_entries __rcu *hooks_ipv4[NF_INET_NUMHOOKS];
2023 struct nf_hook_entries __rcu *hooks_ipv6[NF_INET_NUMHOOKS];
include/scsi/scsi_devinfo.h+3−1
@@ -69,8 +69,10 @@ · 68 unmodified lines
6969 #define BLIST_RETRY_ITF ((__force blist_flags_t)(1ULL << 32))
7070 /* Always retry ABORTED_COMMAND with ASC 0xc1 */
7171 #define BLIST_RETRY_ASC_C1 ((__force blist_flags_t)(1ULL << 33))
72+/* Do not query the IO Advice Hints Grouping mode page */
73+#define BLIST_SKIP_IO_HINTS ((__force blist_flags_t)(1ULL << 34))
7274
73−#define __BLIST_LAST_USED BLIST_RETRY_ASC_C1
75+#define __BLIST_LAST_USED BLIST_SKIP_IO_HINTS
7476
7577 #define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \
7678 (__force blist_flags_t) \
init/Kconfig+1−1
@@ -883,7 +883,7 @@ config GCC10_NO_ARRAY_BOUNDS · 882 unmodified lines
883883
884884 config CC_NO_ARRAY_BOUNDS
885885 bool
886− default y if CC_IS_GCC && GCC_VERSION >= 100000 && GCC10_NO_ARRAY_BOUNDS
886+ default y if CC_IS_GCC && GCC_VERSION >= 90000 && GCC10_NO_ARRAY_BOUNDS
887887
888888 # Currently, disable -Wstringop-overflow for GCC globally.
889889 config GCC_NO_STRINGOP_OVERFLOW
io_uring/rsrc.c+0−1
@@ -1068,7 +1068,6 @@ int io_import_fixed(int ddir, struct iov_iter *iter, · 1067 unmodified lines
10681068 * branch doesn't expect non PAGE_SIZE'd chunks.
10691069 */
10701070 iter->bvec = bvec;
1071− iter->nr_segs = bvec->bv_len;
10721071 iter->count -= offset;
10731072 iter->iov_offset = offset;
10741073 } else {
kernel/auditfilter.c+3−2
@@ -529,7 +529,8 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data, · 528 unmodified lines
529529 entry->rule.buflen += f_val;
530530 f->lsm_str = str;
531531 err = security_audit_rule_init(f->type, f->op, str,
532− (void **)&f->lsm_rule);
532+ (void **)&f->lsm_rule,
533+ GFP_KERNEL);
533534 /* Keep currently invalid fields around in case they
534535 * become valid after a policy reload. */
535536 if (err == -EINVAL) {
@@ -799,7 +800,7 @@ static inline int audit_dupe_lsm_field(struct audit_field *df, · 263 unmodified lines
799800
800801 /* our own (refreshed) copy of lsm_rule */
801802 ret = security_audit_rule_init(df->type, df->op, df->lsm_str,
802− (void **)&df->lsm_rule);
803+ (void **)&df->lsm_rule, GFP_KERNEL);
803804 /* Keep currently invalid fields around in case they
804805 * become valid after a policy reload. */
805806 if (ret == -EINVAL) {
kernel/bpf/verifier.c+16−9
@@ -4549,11 +4549,12 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env, · 4548 unmodified lines
45494549 state->stack[spi].spilled_ptr.id = 0;
45504550 } else if (!reg && !(off % BPF_REG_SIZE) && is_bpf_st_mem(insn) &&
45514551 env->bpf_capable) {
4552− struct bpf_reg_state fake_reg = {};
4552+ struct bpf_reg_state *tmp_reg = &env->fake_reg[0];
45534553
4554− __mark_reg_known(&fake_reg, insn->imm);
4555− fake_reg.type = SCALAR_VALUE;
4556− save_register_state(env, state, spi, &fake_reg, size);
4554+ memset(tmp_reg, 0, sizeof(*tmp_reg));
4555+ __mark_reg_known(tmp_reg, insn->imm);
4556+ tmp_reg->type = SCALAR_VALUE;
4557+ save_register_state(env, state, spi, tmp_reg, size);
45574558 } else if (reg && is_spillable_regtype(reg->type)) {
45584559 /* register containing pointer is being spilled into stack */
45594560 if (size != BPF_REG_SIZE) {
@@ -15113,7 +15114,6 @@ static int check_cond_jmp_op(struct bpf_verifier_env *env, · 10553 unmodified lines
1511315114 struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
1511415115 struct bpf_reg_state *dst_reg, *other_branch_regs, *src_reg = NULL;
1511515116 struct bpf_reg_state *eq_branch_regs;
15116− struct bpf_reg_state fake_reg = {};
1511715117 u8 opcode = BPF_OP(insn->code);
1511815118 bool is_jmp32;
1511915119 int pred = -1;
@@ -15179,7 +15179,8 @@ static int check_cond_jmp_op(struct bpf_verifier_env *env, · 59 unmodified lines
1517915179 verbose(env, "BPF_JMP/JMP32 uses reserved fields\n");
1518015180 return -EINVAL;
1518115181 }
15182− src_reg = &fake_reg;
15182+ src_reg = &env->fake_reg[0];
15183+ memset(src_reg, 0, sizeof(*src_reg));
1518315184 src_reg->type = SCALAR_VALUE;
1518415185 __mark_reg_known(src_reg, insn->imm);
1518515186 }
@@ -15239,10 +15240,16 @@ static int check_cond_jmp_op(struct bpf_verifier_env *env, · 53 unmodified lines
1523915240 &other_branch_regs[insn->src_reg],
1524015241 dst_reg, src_reg, opcode, is_jmp32);
1524115242 } else /* BPF_SRC(insn->code) == BPF_K */ {
15243+ /* reg_set_min_max() can mangle the fake_reg. Make a copy
15244+ * so that these are two different memory locations. The
15245+ * src_reg is not used beyond here in context of K.
15246+ */
15247+ memcpy(&env->fake_reg[1], &env->fake_reg[0],
15248+ sizeof(env->fake_reg[0]));
1524215249 err = reg_set_min_max(env,
1524315250 &other_branch_regs[insn->dst_reg],
15244− src_reg /* fake one */,
15245− dst_reg, src_reg /* same fake one */,
15251+ &env->fake_reg[0],
15252+ dst_reg, &env->fake_reg[1],
1524615253 opcode, is_jmp32);
1524715254 }
1524815255 if (err)
@@ -20313,7 +20320,7 @@ patch_map_ops_generic: · 5064 unmodified lines
2031320320 goto next_insn;
2031420321 }
2031520322
20316−#ifdef CONFIG_X86_64
20323+#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
2031720324 /* Implement bpf_get_smp_processor_id() inline. */
2031820325 if (insn->imm == BPF_FUNC_get_smp_processor_id &&
2031920326 prog->jit_requested && bpf_jit_supports_percpu_insn()) {
kernel/gcov/gcc_4_7.c+3−1
@@ -18,7 +18,9 @@ · 17 unmodified lines
1818 #include <linux/mm.h>
1919 #include "gcov.h"
2020
21−#if (__GNUC__ >= 10)
21+#if (__GNUC__ >= 14)
22+#define GCOV_COUNTERS 9
23+#elif (__GNUC__ >= 10)
2224 #define GCOV_COUNTERS 8
2325 #elif (__GNUC__ >= 7)
2426 #define GCOV_COUNTERS 9
kernel/kcov.c+1−0
@@ -632,6 +632,7 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 631 unmodified lines
632632 return -EINVAL;
633633 kcov->mode = mode;
634634 t->kcov = kcov;
635+ t->kcov_mode = KCOV_MODE_REMOTE;
635636 kcov->t = t;
636637 kcov->remote = true;
637638 kcov->remote_size = remote_arg->area_size;
kernel/pid_namespace.c+1−0
@@ -218,6 +218,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) · 217 unmodified lines
218218 */
219219 do {
220220 clear_thread_flag(TIF_SIGPENDING);
221+ clear_thread_flag(TIF_NOTIFY_SIGNAL);
221222 rc = kernel_wait4(-1, NULL, __WALL, NULL);
222223 } while (rc != -ECHILD);
223224
kernel/trace/Kconfig+2−2
@@ -1136,7 +1136,7 @@ config PREEMPTIRQ_DELAY_TEST · 1135 unmodified lines
11361136
11371137 config SYNTH_EVENT_GEN_TEST
11381138 tristate "Test module for in-kernel synthetic event generation"
1139− depends on SYNTH_EVENTS
1139+ depends on SYNTH_EVENTS && m
11401140 help
11411141 This option creates a test module to check the base
11421142 functionality of in-kernel synthetic event definition and
@@ -1149,7 +1149,7 @@ config SYNTH_EVENT_GEN_TEST · 6 unmodified lines
11491149
11501150 config KPROBE_EVENT_GEN_TEST
11511151 tristate "Test module for in-kernel kprobe event generation"
1152− depends on KPROBE_EVENTS
1152+ depends on KPROBE_EVENTS && m
11531153 help
11541154 This option creates a test module to check the base
11551155 functionality of in-kernel kprobe event definition.
lib/Kconfig+1−7
@@ -539,13 +539,7 @@ config CPUMASK_OFFSTACK · 538 unmodified lines
539539 stack overflow.
540540
541541 config FORCE_NR_CPUS
542− bool "Set number of CPUs at compile time"
543− depends on SMP && EXPERT && !COMPILE_TEST
544− help
545− Say Yes if you have NR_CPUS set to an actual number of possible
546− CPUs in your system, not to a default value. This forces the core
547− code to rely on compile-time value and optimize kernel routines
548− better.
542+ def_bool !SMP
549543
550544 config CPU_RMAP
551545 bool
lib/alloc_tag.c+13−3
@@ -227,6 +227,7 @@ struct page_ext_operations page_alloc_tagging_ops = { · 226 unmodified lines
227227 };
228228 EXPORT_SYMBOL(page_alloc_tagging_ops);
229229
230+#ifdef CONFIG_SYSCTL
230231 static struct ctl_table memory_allocation_profiling_sysctls[] = {
231232 {
232233 .procname = "mem_profiling",
@@ -241,6 +242,17 @@ static struct ctl_table memory_allocation_profiling_sysctls[] = { · 8 unmodified lines
241242 { }
242243 };
243244
245+static void __init sysctl_init(void)
246+{
247+ if (!mem_profiling_support)
248+ memory_allocation_profiling_sysctls[0].mode = 0444;
249+
250+ register_sysctl_init("vm", memory_allocation_profiling_sysctls);
251+}
252+#else /* CONFIG_SYSCTL */
253+static inline void sysctl_init(void) {}
254+#endif /* CONFIG_SYSCTL */
255+
244256 static int __init alloc_tag_init(void)
245257 {
246258 const struct codetag_type_desc desc = {
@@ -253,9 +265,7 @@ static int __init alloc_tag_init(void) · 6 unmodified lines
253265 if (IS_ERR(alloc_tag_cttype))
254266 return PTR_ERR(alloc_tag_cttype);
255267
256− if (!mem_profiling_support)
257− memory_allocation_profiling_sysctls[0].mode = 0444;
258− register_sysctl_init("vm", memory_allocation_profiling_sysctls);
268+ sysctl_init();
259269 procfs_init();
260270
261271 return 0;
lib/closure.c+8−2
@@ -17,12 +17,18 @@ static inline void closure_put_after_sub(struct closure *cl, int flags) · 16 unmodified lines
1717 {
1818 int r = flags & CLOSURE_REMAINING_MASK;
1919
20− BUG_ON(flags & CLOSURE_GUARD_MASK);
21− BUG_ON(!r && (flags & ~CLOSURE_DESTRUCTOR));
20+ if (WARN(flags & CLOSURE_GUARD_MASK,
21+ "closure has guard bits set: %x (%u)",
22+ flags & CLOSURE_GUARD_MASK, (unsigned) __fls(r)))
23+ r &= ~CLOSURE_GUARD_MASK;
2224
2325 if (!r) {
2426 smp_acquire__after_ctrl_dep();
2527
28+ WARN(flags & ~CLOSURE_DESTRUCTOR,
29+ "closure ref hit 0 with incorrect flags set: %x (%u)",
30+ flags & ~CLOSURE_DESTRUCTOR, (unsigned) __fls(flags));
31+
2632 cl->closure_get_happened = false;
2733
2834 if (cl->fn && !(flags & CLOSURE_DESTRUCTOR)) {
lib/fortify_kunit.c+1−1
@@ -374,7 +374,7 @@ static const char * const test_strs[] = { · 373 unmodified lines
374374 for (i = 0; i < ARRAY_SIZE(test_strs); i++) { \
375375 len = strlen(test_strs[i]); \
376376 KUNIT_EXPECT_EQ(test, __builtin_constant_p(len), 0); \
377− checker(len, kmemdup_array(test_strs[i], len, 1, gfp), \
377+ checker(len, kmemdup_array(test_strs[i], 1, len, gfp), \
378378 kfree(p)); \
379379 checker(len, kmemdup(test_strs[i], len, gfp), \
380380 kfree(p)); \
lib/overflow_kunit.c+17−3
@@ -1178,14 +1178,28 @@ struct foo { · 1177 unmodified lines
11781178 s16 array[] __counted_by(counter);
11791179 };
11801180
1181+struct bar {
1182+ int a;
1183+ u32 counter;
1184+ s16 array[];
1185+};
1186+
11811187 static void DEFINE_FLEX_test(struct kunit *test)
11821188 {
1183− DEFINE_RAW_FLEX(struct foo, two, array, 2);
1189+ /* Using _RAW_ on a __counted_by struct will initialize "counter" to zero */
1190+ DEFINE_RAW_FLEX(struct foo, two_but_zero, array, 2);
1191+#if __has_attribute(__counted_by__)
1192+ int expected_raw_size = sizeof(struct foo);
1193+#else
1194+ int expected_raw_size = sizeof(struct foo) + 2 * sizeof(s16);
1195+#endif
1196+ /* Without annotation, it will always be on-stack size. */
1197+ DEFINE_RAW_FLEX(struct bar, two, array, 2);
11841198 DEFINE_FLEX(struct foo, eight, array, counter, 8);
11851199 DEFINE_FLEX(struct foo, empty, array, counter, 0);
11861200
1187− KUNIT_EXPECT_EQ(test, __struct_size(two),
1188− sizeof(struct foo) + sizeof(s16) + sizeof(s16));
1201+ KUNIT_EXPECT_EQ(test, __struct_size(two_but_zero), expected_raw_size);
1202+ KUNIT_EXPECT_EQ(test, __struct_size(two), sizeof(struct bar) + 2 * sizeof(s16));
11891203 KUNIT_EXPECT_EQ(test, __struct_size(eight), 24);
11901204 KUNIT_EXPECT_EQ(test, __struct_size(empty), sizeof(struct foo));
11911205 }
mm/debug_vm_pgtable.c+5−26
@@ -40,22 +40,7 @@ · 39 unmodified lines
4040 * Please refer Documentation/mm/arch_pgtable_helpers.rst for the semantics
4141 * expectations that are being validated here. All future changes in here
4242 * or the documentation need to be in sync.
43− *
44− * On s390 platform, the lower 4 bits are used to identify given page table
45− * entry type. But these bits might affect the ability to clear entries with
46− * pxx_clear() because of how dynamic page table folding works on s390. So
47− * while loading up the entries do not change the lower 4 bits. It does not
48− * have affect any other platform. Also avoid the 62nd bit on ppc64 that is
49− * used to mark a pte entry.
5043 */
51−#define S390_SKIP_MASK GENMASK(3, 0)
52−#if __BITS_PER_LONG == 64
53−#define PPC64_SKIP_MASK GENMASK(62, 62)
54−#else
55−#define PPC64_SKIP_MASK 0x0
56−#endif
57−#define ARCH_SKIP_MASK (S390_SKIP_MASK | PPC64_SKIP_MASK)
58−#define RANDOM_ORVALUE (GENMASK(BITS_PER_LONG - 1, 0) & ~ARCH_SKIP_MASK)
5944 #define RANDOM_NZVALUE GENMASK(7, 0)
6045
6146 struct pgtable_debug_args {
@@ -511,8 +496,7 @@ static void __init pud_clear_tests(struct pgtable_debug_args *args) · 449 unmodified lines
511496 return;
512497
513498 pr_debug("Validating PUD clear\n");
514− pud = __pud(pud_val(pud) | RANDOM_ORVALUE);
515− WRITE_ONCE(*args->pudp, pud);
499+ WARN_ON(pud_none(pud));
516500 pud_clear(args->pudp);
517501 pud = READ_ONCE(*args->pudp);
518502 WARN_ON(!pud_none(pud));
@@ -548,8 +532,7 @@ static void __init p4d_clear_tests(struct pgtable_debug_args *args) · 29 unmodified lines
548532 return;
549533
550534 pr_debug("Validating P4D clear\n");
551− p4d = __p4d(p4d_val(p4d) | RANDOM_ORVALUE);
552− WRITE_ONCE(*args->p4dp, p4d);
535+ WARN_ON(p4d_none(p4d));
553536 p4d_clear(args->p4dp);
554537 p4d = READ_ONCE(*args->p4dp);
555538 WARN_ON(!p4d_none(p4d));
@@ -582,8 +565,7 @@ static void __init pgd_clear_tests(struct pgtable_debug_args *args) · 26 unmodified lines
582565 return;
583566
584567 pr_debug("Validating PGD clear\n");
585− pgd = __pgd(pgd_val(pgd) | RANDOM_ORVALUE);
586− WRITE_ONCE(*args->pgdp, pgd);
568+ WARN_ON(pgd_none(pgd));
587569 pgd_clear(args->pgdp);
588570 pgd = READ_ONCE(*args->pgdp);
589571 WARN_ON(!pgd_none(pgd));
@@ -634,10 +616,8 @@ static void __init pte_clear_tests(struct pgtable_debug_args *args) · 44 unmodified lines
634616 if (WARN_ON(!args->ptep))
635617 return;
636618
637−#ifndef CONFIG_RISCV
638− pte = __pte(pte_val(pte) | RANDOM_ORVALUE);
639−#endif
640619 set_pte_at(args->mm, args->vaddr, args->ptep, pte);
620+ WARN_ON(pte_none(pte));
641621 flush_dcache_page(page);
642622 barrier();
643623 ptep_clear(args->mm, args->vaddr, args->ptep);
@@ -650,8 +630,7 @@ static void __init pmd_clear_tests(struct pgtable_debug_args *args) · 6 unmodified lines
650630 pmd_t pmd = READ_ONCE(*args->pmdp);
651631
652632 pr_debug("Validating PMD clear\n");
653− pmd = __pmd(pmd_val(pmd) | RANDOM_ORVALUE);
654− WRITE_ONCE(*args->pmdp, pmd);
633+ WARN_ON(pmd_none(pmd));
655634 pmd_clear(args->pmdp);
656635 pmd = READ_ONCE(*args->pmdp);
657636 WARN_ON(!pmd_none(pmd));
mm/huge_memory.c+17−11
@@ -3009,30 +3009,36 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, · 3008 unmodified lines
30093009 if (new_order >= folio_order(folio))
30103010 return -EINVAL;
30113011
3012− /* Cannot split anonymous THP to order-1 */
3013− if (new_order == 1 && folio_test_anon(folio)) {
3014− VM_WARN_ONCE(1, "Cannot split to order-1 folio");
3015− return -EINVAL;
3016− }
3017−
3018− if (new_order) {
3019− /* Only swapping a whole PMD-mapped folio is supported */
3020− if (folio_test_swapcache(folio))
3012+ if (folio_test_anon(folio)) {
3013+ /* order-1 is not supported for anonymous THP. */
3014+ if (new_order == 1) {
3015+ VM_WARN_ONCE(1, "Cannot split to order-1 folio");
30213016 return -EINVAL;
3017+ }
3018+ } else if (new_order) {
30223019 /* Split shmem folio to non-zero order not supported */
30233020 if (shmem_mapping(folio->mapping)) {
30243021 VM_WARN_ONCE(1,
30253022 "Cannot split shmem folio to non-0 order");
30263023 return -EINVAL;
30273024 }
3028− /* No split if the file system does not support large folio */
3029− if (!mapping_large_folio_support(folio->mapping)) {
3025+ /*
3026+ * No split if the file system does not support large folio.
3027+ * Note that we might still have THPs in such mappings due to
3028+ * CONFIG_READ_ONLY_THP_FOR_FS. But in that case, the mapping
3029+ * does not actually support large folios properly.
3030+ */
3031+ if (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS) &&
3032+ !mapping_large_folio_support(folio->mapping)) {
30303033 VM_WARN_ONCE(1,
30313034 "Cannot split file folio to non-0 order");
30323035 return -EINVAL;
30333036 }
30343037 }
30353038
3039+ /* Only swapping a whole PMD-mapped folio is supported */
3040+ if (folio_test_swapcache(folio) && new_order)
3041+ return -EINVAL;
30363042
30373043 is_hzp = is_huge_zero_folio(folio);
30383044 if (is_hzp) {
mm/internal.h+0−1
@@ -588,7 +588,6 @@ extern void __putback_isolated_page(struct page *page, unsigned int order, · 587 unmodified lines
588588 extern void memblock_free_pages(struct page *page, unsigned long pfn,
589589 unsigned int order);
590590 extern void __free_pages_core(struct page *page, unsigned int order);
591−extern void kernel_init_pages(struct page *page, int numpages);
592591
593592 /*
594593 * This will have no effect, other than possibly generating a warning, if the
mm/memblock.c+7−21
@@ -754,7 +754,7 @@ bool __init_memblock memblock_validate_numa_coverage(unsigned long threshold_byt · 753 unmodified lines
754754
755755 /* calculate lose page */
756756 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
757− if (nid == NUMA_NO_NODE)
757+ if (!numa_valid_node(nid))
758758 nr_pages += end_pfn - start_pfn;
759759 }
760760
@@ -1061,7 +1061,7 @@ static bool should_skip_region(struct memblock_type *type, · 300 unmodified lines
10611061 return false;
10621062
10631063 /* only memory regions are associated with nodes, check it */
1064− if (nid != NUMA_NO_NODE && nid != m_nid)
1064+ if (numa_valid_node(nid) && nid != m_nid)
10651065 return true;
10661066
10671067 /* skip hotpluggable memory regions if needed */
@@ -1118,10 +1118,6 @@ void __next_mem_range(u64 *idx, int nid, enum memblock_flags flags, · 50 unmodified lines
11181118 int idx_a = *idx & 0xffffffff;
11191119 int idx_b = *idx >> 32;
11201120
1121− if (WARN_ONCE(nid == MAX_NUMNODES,
1122− "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
1123− nid = NUMA_NO_NODE;
1124−
11251121 for (; idx_a < type_a->cnt; idx_a++) {
11261122 struct memblock_region *m = &type_a->regions[idx_a];
11271123
@@ -1215,9 +1211,6 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, · 87 unmodified lines
12151211 int idx_a = *idx & 0xffffffff;
12161212 int idx_b = *idx >> 32;
12171213
1218− if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
1219− nid = NUMA_NO_NODE;
1220−
12211214 if (*idx == (u64)ULLONG_MAX) {
12221215 idx_a = type_a->cnt - 1;
12231216 if (type_b != NULL)
@@ -1303,7 +1296,7 @@ void __init_memblock __next_mem_pfn_range(int *idx, int nid, · 79 unmodified lines
13031296
13041297 if (PFN_UP(r->base) >= PFN_DOWN(r->base + r->size))
13051298 continue;
1306− if (nid == MAX_NUMNODES || nid == r_nid)
1299+ if (!numa_valid_node(nid) || nid == r_nid)
13071300 break;
13081301 }
13091302 if (*idx >= type->cnt) {
@@ -1339,10 +1332,6 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size, · 29 unmodified lines
13391332 int start_rgn, end_rgn;
13401333 int i, ret;
13411334
1342− if (WARN_ONCE(nid == MAX_NUMNODES,
1343− "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
1344− nid = NUMA_NO_NODE;
1345−
13461335 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
13471336 if (ret)
13481337 return ret;
@@ -1452,9 +1441,6 @@ phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, · 103 unmodified lines
14521441 enum memblock_flags flags = choose_memblock_flags();
14531442 phys_addr_t found;
14541443
1455− if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
1456− nid = NUMA_NO_NODE;
1457−
14581444 if (!align) {
14591445 /* Can't use WARNs this early in boot on powerpc */
14601446 dump_stack();
@@ -1467,7 +1453,7 @@ again: · 6 unmodified lines
14671453 if (found && !memblock_reserve(found, size))
14681454 goto done;
14691455
1470− if (nid != NUMA_NO_NODE && !exact_nid) {
1456+ if (numa_valid_node(nid) && !exact_nid) {
14711457 found = memblock_find_in_range_node(size, align, start,
14721458 end, NUMA_NO_NODE,
14731459 flags);
@@ -1987,7 +1973,7 @@ static void __init_memblock memblock_dump(struct memblock_type *type) · 513 unmodified lines
19871973 end = base + size - 1;
19881974 flags = rgn->flags;
19891975 #ifdef CONFIG_NUMA
1990− if (memblock_get_region_node(rgn) != MAX_NUMNODES)
1976+ if (numa_valid_node(memblock_get_region_node(rgn)))
19911977 snprintf(nid_buf, sizeof(nid_buf), " on node %d",
19921978 memblock_get_region_node(rgn));
19931979 #endif
@@ -2181,7 +2167,7 @@ static void __init memmap_init_reserved_pages(void) · 187 unmodified lines
21812167 start = region->base;
21822168 end = start + region->size;
21832169
2184− if (nid == NUMA_NO_NODE || nid >= MAX_NUMNODES)
2170+ if (!numa_valid_node(nid))
21852171 nid = early_pfn_to_nid(PFN_DOWN(start));
21862172
21872173 reserve_bootmem_region(start, end, nid);
@@ -2272,7 +2258,7 @@ static int memblock_debug_show(struct seq_file *m, void *private) · 84 unmodified lines
22722258
22732259 seq_printf(m, "%4d: ", i);
22742260 seq_printf(m, "%pa..%pa ", &reg->base, &end);
2275− if (nid != MAX_NUMNODES)
2261+ if (numa_valid_node(nid))
22762262 seq_printf(m, "%4d ", nid);
22772263 else
22782264 seq_printf(m, "%4c ", 'x');
mm/memcontrol.c+1−2
@@ -7745,8 +7745,7 @@ void __mem_cgroup_uncharge_folios(struct folio_batch *folios) · 7744 unmodified lines
77457745 * @new: Replacement folio.
77467746 *
77477747 * Charge @new as a replacement folio for @old. @old will
7748− * be uncharged upon free. This is only used by the page cache
7749− * (in replace_page_cache_folio()).
7748+ * be uncharged upon free.
77507749 *
77517750 * Both folios must be locked, @new->mapping must be set up.
77527751 */
mm/memory.c+10−10
@@ -1507,12 +1507,6 @@ static __always_inline void zap_present_folio_ptes(struct mmu_gather *tlb, · 1506 unmodified lines
15071507 if (unlikely(folio_mapcount(folio) < 0))
15081508 print_bad_pte(vma, addr, ptent, page);
15091509 }
1510−
1511− if (want_init_mlocked_on_free() && folio_test_mlocked(folio) &&
1512− !delay_rmap && folio_test_anon(folio)) {
1513− kernel_init_pages(page, folio_nr_pages(folio));
1514− }
1515−
15161510 if (unlikely(__tlb_remove_folio_pages(tlb, page, nr, delay_rmap))) {
15171511 *force_flush = true;
15181512 *force_break = true;
@@ -5106,10 +5100,16 @@ static void numa_rebuild_large_mapping(struct vm_fault *vmf, struct vm_area_stru · 3587 unmodified lines
51065100 bool ignore_writable, bool pte_write_upgrade)
51075101 {
51085102 int nr = pte_pfn(fault_pte) - folio_pfn(folio);
5109− unsigned long start = max(vmf->address - nr * PAGE_SIZE, vma->vm_start);
5110− unsigned long end = min(vmf->address + (folio_nr_pages(folio) - nr) * PAGE_SIZE, vma->vm_end);
5111− pte_t *start_ptep = vmf->pte - (vmf->address - start) / PAGE_SIZE;
5112− unsigned long addr;
5103+ unsigned long start, end, addr = vmf->address;
5104+ unsigned long addr_start = addr - (nr << PAGE_SHIFT);
5105+ unsigned long pt_start = ALIGN_DOWN(addr, PMD_SIZE);
5106+ pte_t *start_ptep;
5107+
5108+ /* Stay within the VMA and within the page table. */
5109+ start = max3(addr_start, pt_start, vma->vm_start);
5110+ end = min3(addr_start + folio_size(folio), pt_start + PMD_SIZE,
5111+ vma->vm_end);
5112+ start_ptep = vmf->pte - ((addr - start) >> PAGE_SHIFT);
51135113
51145114 /* Restore all PTEs' mapping of the large folio */
51155115 for (addr = start; addr != end; start_ptep++, addr += PAGE_SIZE) {
mm/migrate.c+7−1
@@ -1654,7 +1654,12 @@ static int migrate_pages_batch(struct list_head *from, · 1653 unmodified lines
16541654
16551655 /*
16561656 * The rare folio on the deferred split list should
1657− * be split now. It should not count as a failure.
1657+ * be split now. It should not count as a failure:
1658+ * but increment nr_failed because, without doing so,
1659+ * migrate_pages() may report success with (split but
1660+ * unmigrated) pages still on its fromlist; whereas it
1661+ * always reports success when its fromlist is empty.
1662+ *
16581663 * Only check it without removing it from the list.
16591664 * Since the folio can be on deferred_split_scan()
16601665 * local list and removing it can cause the local list
@@ -1669,6 +1674,7 @@ static int migrate_pages_batch(struct list_head *from, · 8 unmodified lines
16691674 if (nr_pages > 2 &&
16701675 !list_empty(&folio->_deferred_list)) {
16711676 if (try_split_folio(folio, split_folios) == 0) {
1677+ nr_failed++;
16721678 stats->nr_thp_split += is_thp;
16731679 stats->nr_split++;
16741680 continue;
mm/mm_init.c+7−36
@@ -2523,9 +2523,6 @@ EXPORT_SYMBOL(init_on_alloc); · 2522 unmodified lines
25232523 DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free);
25242524 EXPORT_SYMBOL(init_on_free);
25252525
2526−DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_MLOCKED_ON_FREE_DEFAULT_ON, init_mlocked_on_free);
2527−EXPORT_SYMBOL(init_mlocked_on_free);
2528−
25292526 static bool _init_on_alloc_enabled_early __read_mostly
25302527 = IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON);
25312528 static int __init early_init_on_alloc(char *buf)
@@ -2543,14 +2540,6 @@ static int __init early_init_on_free(char *buf) · 11 unmodified lines
25432540 }
25442541 early_param("init_on_free", early_init_on_free);
25452542
2546−static bool _init_mlocked_on_free_enabled_early __read_mostly
2547− = IS_ENABLED(CONFIG_INIT_MLOCKED_ON_FREE_DEFAULT_ON);
2548−static int __init early_init_mlocked_on_free(char *buf)
2549−{
2550− return kstrtobool(buf, &_init_mlocked_on_free_enabled_early);
2551−}
2552−early_param("init_mlocked_on_free", early_init_mlocked_on_free);
2553−
25542543 DEFINE_STATIC_KEY_MAYBE(CONFIG_DEBUG_VM, check_pages_enabled);
25552544
25562545 /*
@@ -2578,21 +2567,12 @@ static void __init mem_debugging_and_hardening_init(void) · 21 unmodified lines
25782567 }
25792568 #endif
25802569
2581− if ((_init_on_alloc_enabled_early || _init_on_free_enabled_early ||
2582− _init_mlocked_on_free_enabled_early) &&
2570+ if ((_init_on_alloc_enabled_early || _init_on_free_enabled_early) &&
25832571 page_poisoning_requested) {
25842572 pr_info("mem auto-init: CONFIG_PAGE_POISONING is on, "
2585− "will take precedence over init_on_alloc, init_on_free "
2586− "and init_mlocked_on_free\n");
2573+ "will take precedence over init_on_alloc and init_on_free\n");
25872574 _init_on_alloc_enabled_early = false;
25882575 _init_on_free_enabled_early = false;
2589− _init_mlocked_on_free_enabled_early = false;
2590− }
2591−
2592− if (_init_mlocked_on_free_enabled_early && _init_on_free_enabled_early) {
2593− pr_info("mem auto-init: init_on_free is on, "
2594− "will take precedence over init_mlocked_on_free\n");
2595− _init_mlocked_on_free_enabled_early = false;
25962576 }
25972577
25982578 if (_init_on_alloc_enabled_early) {
@@ -2609,17 +2589,9 @@ static void __init mem_debugging_and_hardening_init(void) · 10 unmodified lines
26092589 static_branch_disable(&init_on_free);
26102590 }
26112591
2612− if (_init_mlocked_on_free_enabled_early) {
2613− want_check_pages = true;
2614− static_branch_enable(&init_mlocked_on_free);
2615− } else {
2616− static_branch_disable(&init_mlocked_on_free);
2617− }
2618−
2619− if (IS_ENABLED(CONFIG_KMSAN) && (_init_on_alloc_enabled_early ||
2620− _init_on_free_enabled_early || _init_mlocked_on_free_enabled_early))
2621− pr_info("mem auto-init: please make sure init_on_alloc, init_on_free and "
2622− "init_mlocked_on_free are disabled when running KMSAN\n");
2592+ if (IS_ENABLED(CONFIG_KMSAN) &&
2593+ (_init_on_alloc_enabled_early || _init_on_free_enabled_early))
2594+ pr_info("mem auto-init: please make sure init_on_alloc and init_on_free are disabled when running KMSAN\n");
26232595
26242596 #ifdef CONFIG_DEBUG_PAGEALLOC
26252597 if (debug_pagealloc_enabled()) {
@@ -2658,10 +2630,9 @@ static void __init report_meminit(void) · 32 unmodified lines
26582630 else
26592631 stack = "off";
26602632
2661− pr_info("mem auto-init: stack:%s, heap alloc:%s, heap free:%s, mlocked free:%s\n",
2633+ pr_info("mem auto-init: stack:%s, heap alloc:%s, heap free:%s\n",
26622634 stack, want_init_on_alloc(GFP_KERNEL) ? "on" : "off",
2663− want_init_on_free() ? "on" : "off",
2664− want_init_mlocked_on_free() ? "on" : "off");
2635+ want_init_on_free() ? "on" : "off");
26652636 if (want_init_on_free())
26662637 pr_info("mem auto-init: clearing system memory may take some time...\n");
26672638 }
mm/page_alloc.c+1−1
@@ -1016,7 +1016,7 @@ static inline bool should_skip_kasan_poison(struct page *page) · 1015 unmodified lines
10161016 return page_kasan_tag(page) == KASAN_TAG_KERNEL;
10171017 }
10181018
1019−void kernel_init_pages(struct page *page, int numpages)
1019+static void kernel_init_pages(struct page *page, int numpages)
10201020 {
10211021 int i;
10221022
mm/page_table_check.c+10−1
@@ -73,6 +73,9 @@ static void page_table_check_clear(unsigned long pfn, unsigned long pgcnt) · 72 unmodified lines
7373 page = pfn_to_page(pfn);
7474 page_ext = page_ext_get(page);
7575
76+ if (!page_ext)
77+ return;
78+
7679 BUG_ON(PageSlab(page));
7780 anon = PageAnon(page);
7881
@@ -110,6 +113,9 @@ static void page_table_check_set(unsigned long pfn, unsigned long pgcnt, · 31 unmodified lines
110113 page = pfn_to_page(pfn);
111114 page_ext = page_ext_get(page);
112115
116+ if (!page_ext)
117+ return;
118+
113119 BUG_ON(PageSlab(page));
114120 anon = PageAnon(page);
115121
@@ -140,7 +146,10 @@ void __page_table_check_zero(struct page *page, unsigned int order) · 24 unmodified lines
140146 BUG_ON(PageSlab(page));
141147
142148 page_ext = page_ext_get(page);
143− BUG_ON(!page_ext);
149+
150+ if (!page_ext)
151+ return;
152+
144153 for (i = 0; i < (1ul << order); i++) {
145154 struct page_table_check *ptc = get_page_table_check(page_ext);
146155
mm/shmem.c+1−1
@@ -1786,7 +1786,7 @@ static int shmem_replace_folio(struct folio **foliop, gfp_t gfp, · 1785 unmodified lines
17861786 xa_lock_irq(&swap_mapping->i_pages);
17871787 error = shmem_replace_entry(swap_mapping, swap_index, old, new);
17881788 if (!error) {
1789− mem_cgroup_migrate(old, new);
1789+ mem_cgroup_replace_folio(old, new);
17901790 __lruvec_stat_mod_folio(new, NR_FILE_PAGES, 1);
17911791 __lruvec_stat_mod_folio(new, NR_SHMEM, 1);
17921792 __lruvec_stat_mod_folio(old, NR_FILE_PAGES, -1);
mm/util.c+2−2
@@ -139,14 +139,14 @@ EXPORT_SYMBOL(kmemdup_noprof); · 138 unmodified lines
139139 * kmemdup_array - duplicate a given array.
140140 *
141141 * @src: array to duplicate.
142− * @element_size: size of each element of array.
143142 * @count: number of elements to duplicate from array.
143+ * @element_size: size of each element of array.
144144 * @gfp: GFP mask to use.
145145 *
146146 * Return: duplicated array of @src or %NULL in case of error,
147147 * result is physically contiguous. Use kfree() to free.
148148 */
149−void *kmemdup_array(const void *src, size_t element_size, size_t count, gfp_t gfp)
149+void *kmemdup_array(const void *src, size_t count, size_t element_size, gfp_t gfp)
150150 {
151151 return kmemdup(src, size_mul(element_size, count), gfp);
152152 }
net/core/filter.c+5−0
@@ -1665,6 +1665,11 @@ static DEFINE_PER_CPU(struct bpf_scratchpad, bpf_sp); · 1664 unmodified lines
16651665 static inline int __bpf_try_make_writable(struct sk_buff *skb,
16661666 unsigned int write_len)
16671667 {
1668+#ifdef CONFIG_DEBUG_NET
1669+ /* Avoid a splat in pskb_may_pull_reason() */
1670+ if (write_len > INT_MAX)
1671+ return -EINVAL;
1672+#endif
16681673 return skb_ensure_writable(skb, write_len);
16691674 }
16701675
net/core/net_namespace.c+7−2
@@ -693,11 +693,16 @@ EXPORT_SYMBOL_GPL(__put_net); · 692 unmodified lines
693693 * get_net_ns - increment the refcount of the network namespace
694694 * @ns: common namespace (net)
695695 *
696− * Returns the net's common namespace.
696+ * Returns the net's common namespace or ERR_PTR() if ref is zero.
697697 */
698698 struct ns_common *get_net_ns(struct ns_common *ns)
699699 {
700− return &get_net(container_of(ns, struct net, ns))->ns;
700+ struct net *net;
701+
702+ net = maybe_get_net(container_of(ns, struct net, ns));
703+ if (net)
704+ return &net->ns;
705+ return ERR_PTR(-EINVAL);
701706 }
702707 EXPORT_SYMBOL_GPL(get_net_ns);
703708
net/core/netdev-genl.c+8−8
@@ -59,22 +59,22 @@ XDP_METADATA_KFUNC_xxx · 58 unmodified lines
5959 nla_put_u64_64bit(rsp, NETDEV_A_DEV_XDP_RX_METADATA_FEATURES,
6060 xdp_rx_meta, NETDEV_A_DEV_PAD) ||
6161 nla_put_u64_64bit(rsp, NETDEV_A_DEV_XSK_FEATURES,
62− xsk_features, NETDEV_A_DEV_PAD)) {
63− genlmsg_cancel(rsp, hdr);
64− return -EINVAL;
65− }
62+ xsk_features, NETDEV_A_DEV_PAD))
63+ goto err_cancel_msg;
6664
6765 if (netdev->xdp_features & NETDEV_XDP_ACT_XSK_ZEROCOPY) {
6866 if (nla_put_u32(rsp, NETDEV_A_DEV_XDP_ZC_MAX_SEGS,
69− netdev->xdp_zc_max_segs)) {
70− genlmsg_cancel(rsp, hdr);
71− return -EINVAL;
72− }
67+ netdev->xdp_zc_max_segs))
68+ goto err_cancel_msg;
7369 }
7470
7571 genlmsg_end(rsp, hdr);
7672
7773 return 0;
74+
75+err_cancel_msg:
76+ genlmsg_cancel(rsp, hdr);
77+ return -EMSGSIZE;
7878 }
7979
8080 static void
net/core/sock.c+3−0
@@ -3742,6 +3742,9 @@ void sk_common_release(struct sock *sk) · 3741 unmodified lines
37423742
37433743 sk->sk_prot->unhash(sk);
37443744
3745+ if (sk->sk_socket)
3746+ sk->sk_socket->sk = NULL;
3747+
37453748 /*
37463749 * In this point socket cannot receive new packets, but it is possible
37473750 * that some packets are in flight because some CPU runs receiver and
net/ipv4/cipso_ipv4.c+54−21
@@ -1810,6 +1810,29 @@ static int cipso_v4_genopt(unsigned char *buf, u32 buf_len, · 1809 unmodified lines
18101810 return CIPSO_V4_HDR_LEN + ret_val;
18111811 }
18121812
1813+static int cipso_v4_get_actual_opt_len(const unsigned char *data, int len)
1814+{
1815+ int iter = 0, optlen = 0;
1816+
1817+ /* determining the new total option length is tricky because of
1818+ * the padding necessary, the only thing i can think to do at
1819+ * this point is walk the options one-by-one, skipping the
1820+ * padding at the end to determine the actual option size and
1821+ * from there we can determine the new total option length
1822+ */
1823+ while (iter < len) {
1824+ if (data[iter] == IPOPT_END) {
1825+ break;
1826+ } else if (data[iter] == IPOPT_NOP) {
1827+ iter++;
1828+ } else {
1829+ iter += data[iter + 1];
1830+ optlen = iter;
1831+ }
1832+ }
1833+ return optlen;
1834+}
1835+
18131836 /**
18141837 * cipso_v4_sock_setattr - Add a CIPSO option to a socket
18151838 * @sk: the socket
@@ -1986,7 +2009,6 @@ static int cipso_v4_delopt(struct ip_options_rcu __rcu **opt_ptr) · 170 unmodified lines
19862009 u8 cipso_len;
19872010 u8 cipso_off;
19882011 unsigned char *cipso_ptr;
1989− int iter;
19902012 int optlen_new;
19912013
19922014 cipso_off = opt->opt.cipso - sizeof(struct iphdr);
@@ -2006,19 +2028,8 @@ static int cipso_v4_delopt(struct ip_options_rcu __rcu **opt_ptr) · 13 unmodified lines
20062028 memmove(cipso_ptr, cipso_ptr + cipso_len,
20072029 opt->opt.optlen - cipso_off - cipso_len);
20082030
2009− /* determining the new total option length is tricky because of
2010− * the padding necessary, the only thing i can think to do at
2011− * this point is walk the options one-by-one, skipping the
2012− * padding at the end to determine the actual option size and
2013− * from there we can determine the new total option length */
2014− iter = 0;
2015− optlen_new = 0;
2016− while (iter < opt->opt.optlen)
2017− if (opt->opt.__data[iter] != IPOPT_NOP) {
2018− iter += opt->opt.__data[iter + 1];
2019− optlen_new = iter;
2020− } else
2021− iter++;
2031+ optlen_new = cipso_v4_get_actual_opt_len(opt->opt.__data,
2032+ opt->opt.optlen);
20222033 hdr_delta = opt->opt.optlen;
20232034 opt->opt.optlen = (optlen_new + 3) & ~3;
20242035 hdr_delta -= opt->opt.optlen;
@@ -2238,7 +2249,8 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb, · 213 unmodified lines
22382249 */
22392250 int cipso_v4_skbuff_delattr(struct sk_buff *skb)
22402251 {
2241− int ret_val;
2252+ int ret_val, cipso_len, hdr_len_actual, new_hdr_len_actual, new_hdr_len,
2253+ hdr_len_delta;
22422254 struct iphdr *iph;
22432255 struct ip_options *opt = &IPCB(skb)->opt;
22442256 unsigned char *cipso_ptr;
@@ -2251,16 +2263,37 @@ int cipso_v4_skbuff_delattr(struct sk_buff *skb) · 6 unmodified lines
22512263 if (ret_val < 0)
22522264 return ret_val;
22532265
2254− /* the easiest thing to do is just replace the cipso option with noop
2255− * options since we don't change the size of the packet, although we
2256− * still need to recalculate the checksum */
2257−
22582266 iph = ip_hdr(skb);
22592267 cipso_ptr = (unsigned char *)iph + opt->cipso;
2260− memset(cipso_ptr, IPOPT_NOOP, cipso_ptr[1]);
2268+ cipso_len = cipso_ptr[1];
2269+
2270+ hdr_len_actual = sizeof(struct iphdr) +
2271+ cipso_v4_get_actual_opt_len((unsigned char *)(iph + 1),
2272+ opt->optlen);
2273+ new_hdr_len_actual = hdr_len_actual - cipso_len;
2274+ new_hdr_len = (new_hdr_len_actual + 3) & ~3;
2275+ hdr_len_delta = (iph->ihl << 2) - new_hdr_len;
2276+
2277+ /* 1. shift any options after CIPSO to the left */
2278+ memmove(cipso_ptr, cipso_ptr + cipso_len,
2279+ new_hdr_len_actual - opt->cipso);
2280+ /* 2. move the whole IP header to its new place */
2281+ memmove((unsigned char *)iph + hdr_len_delta, iph, new_hdr_len_actual);
2282+ /* 3. adjust the skb layout */
2283+ skb_pull(skb, hdr_len_delta);
2284+ skb_reset_network_header(skb);
2285+ iph = ip_hdr(skb);
2286+ /* 4. re-fill new padding with IPOPT_END (may now be longer) */
2287+ memset((unsigned char *)iph + new_hdr_len_actual, IPOPT_END,
2288+ new_hdr_len - new_hdr_len_actual);
2289+
2290+ opt->optlen -= hdr_len_delta;
22612291 opt->cipso = 0;
22622292 opt->is_changed = 1;
2263−
2293+ if (hdr_len_delta != 0) {
2294+ iph->ihl = new_hdr_len >> 2;
2295+ iph_set_totlen(iph, skb->len);
2296+ }
22642297 ip_send_check(iph);
22652298
22662299 return 0;
net/ipv4/tcp_ao.c+4−2
@@ -1968,8 +1968,10 @@ static int tcp_ao_info_cmd(struct sock *sk, unsigned short int family, · 1967 unmodified lines
19681968 first = true;
19691969 }
19701970
1971− if (cmd.ao_required && tcp_ao_required_verify(sk))
1972− return -EKEYREJECTED;
1971+ if (cmd.ao_required && tcp_ao_required_verify(sk)) {
1972+ err = -EKEYREJECTED;
1973+ goto out;
1974+ }
19731975
19741976 /* For sockets in TCP_CLOSED it's possible set keys that aren't
19751977 * matching the future peer (address/port/VRF/etc),
net/ipv4/tcp_input.c+1−0
@@ -6296,6 +6296,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, · 6295 unmodified lines
62966296 skb_rbtree_walk_from(data)
62976297 tcp_mark_skb_lost(sk, data);
62986298 tcp_xmit_retransmit_queue(sk);
6299+ tp->retrans_stamp = 0;
62996300 NET_INC_STATS(sock_net(sk),
63006301 LINUX_MIB_TCPFASTOPENACTIVEFAIL);
63016302 return true;
net/ipv6/ip6_fib.c+2−1
@@ -2514,7 +2514,8 @@ int __init fib6_init(void) · 2513 unmodified lines
25142514 goto out_kmem_cache_create;
25152515
25162516 ret = rtnl_register_module(THIS_MODULE, PF_INET6, RTM_GETROUTE, NULL,
2517− inet6_dump_fib, RTNL_FLAG_DUMP_UNLOCKED);
2517+ inet6_dump_fib, RTNL_FLAG_DUMP_UNLOCKED |
2518+ RTNL_FLAG_DUMP_SPLIT_NLM_DONE);
25182519 if (ret)
25192520 goto out_unregister_subsys;
25202521
net/ipv6/route.c+3−1
@@ -638,6 +638,8 @@ static void rt6_probe(struct fib6_nh *fib6_nh) · 637 unmodified lines
638638 rcu_read_lock();
639639 last_probe = READ_ONCE(fib6_nh->last_probe);
640640 idev = __in6_dev_get(dev);
641+ if (!idev)
642+ goto out;
641643 neigh = __ipv6_neigh_lookup_noref(dev, nh_gw);
642644 if (neigh) {
643645 if (READ_ONCE(neigh->nud_state) & NUD_VALID)
@@ -3603,7 +3605,7 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh, · 2959 unmodified lines
36033605 if (!dev)
36043606 goto out;
36053607
3606− if (idev->cnf.disable_ipv6) {
3608+ if (!idev || idev->cnf.disable_ipv6) {
36073609 NL_SET_ERR_MSG(extack, "IPv6 is disabled on nexthop device");
36083610 err = -EACCES;
36093611 goto out;
net/ipv6/seg6_local.c+4−4
@@ -941,8 +941,8 @@ static int input_action_end_dx6(struct sk_buff *skb, · 940 unmodified lines
941941
942942 if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
943943 return NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING,
944− dev_net(skb->dev), NULL, skb, NULL,
945− skb_dst(skb)->dev, input_action_end_dx6_finish);
944+ dev_net(skb->dev), NULL, skb, skb->dev,
945+ NULL, input_action_end_dx6_finish);
946946
947947 return input_action_end_dx6_finish(dev_net(skb->dev), NULL, skb);
948948 drop:
@@ -991,8 +991,8 @@ static int input_action_end_dx4(struct sk_buff *skb, · 42 unmodified lines
991991
992992 if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
993993 return NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING,
994− dev_net(skb->dev), NULL, skb, NULL,
995− skb_dst(skb)->dev, input_action_end_dx4_finish);
994+ dev_net(skb->dev), NULL, skb, skb->dev,
995+ NULL, input_action_end_dx4_finish);
996996
997997 return input_action_end_dx4_finish(dev_net(skb->dev), NULL, skb);
998998 drop:
net/ipv6/xfrm6_policy.c+7−1
@@ -56,12 +56,18 @@ static int xfrm6_get_saddr(struct net *net, int oif, · 55 unmodified lines
5656 {
5757 struct dst_entry *dst;
5858 struct net_device *dev;
59+ struct inet6_dev *idev;
5960
6061 dst = xfrm6_dst_lookup(net, 0, oif, NULL, daddr, mark);
6162 if (IS_ERR(dst))
6263 return -EHOSTUNREACH;
6364
64− dev = ip6_dst_idev(dst)->dev;
65+ idev = ip6_dst_idev(dst);
66+ if (!idev) {
67+ dst_release(dst);
68+ return -EHOSTUNREACH;
69+ }
70+ dev = idev->dev;
6571 ipv6_dev_get_saddr(dev_net(dev), dev, &daddr->in6, 0, &saddr->in6);
6672 dst_release(dst);
6773 return 0;
net/mac80211/driver-ops.c+17−0
@@ -311,6 +311,18 @@ int drv_assign_vif_chanctx(struct ieee80211_local *local, · 310 unmodified lines
311311 might_sleep();
312312 lockdep_assert_wiphy(local->hw.wiphy);
313313
314+ /*
315+ * We should perhaps push emulate chanctx down and only
316+ * make it call ->config() when the chanctx is actually
317+ * assigned here (and unassigned below), but that's yet
318+ * another change to all drivers to add assign/unassign
319+ * emulation callbacks. Maybe later.
320+ */
321+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
322+ local->emulate_chanctx &&
323+ !ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
324+ return 0;
325+
314326 if (!check_sdata_in_driver(sdata))
315327 return -EIO;
316328
@@ -338,6 +350,11 @@ void drv_unassign_vif_chanctx(struct ieee80211_local *local, · 21 unmodified lines
338350 might_sleep();
339351 lockdep_assert_wiphy(local->hw.wiphy);
340352
353+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
354+ local->emulate_chanctx &&
355+ !ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
356+ return;
357+
341358 if (!check_sdata_in_driver(sdata))
342359 return;
343360
net/mac80211/iface.c+10−12
@@ -686,6 +686,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do · 685 unmodified lines
686686 ieee80211_del_virtual_monitor(local);
687687
688688 ieee80211_recalc_idle(local);
689+ ieee80211_recalc_offload(local);
689690
690691 if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE))
691692 break;
@@ -1121,9 +1122,6 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local) · 429 unmodified lines
11211122 struct ieee80211_sub_if_data *sdata;
11221123 int ret;
11231124
1124− if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
1125− return 0;
1126−
11271125 ASSERT_RTNL();
11281126 lockdep_assert_wiphy(local->hw.wiphy);
11291127
@@ -1145,11 +1143,13 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local) · 15 unmodified lines
11451143
11461144 ieee80211_set_default_queues(sdata);
11471145
1148− ret = drv_add_interface(local, sdata);
1149− if (WARN_ON(ret)) {
1150− /* ok .. stupid driver, it asked for this! */
1151− kfree(sdata);
1152− return ret;
1146+ if (ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) {
1147+ ret = drv_add_interface(local, sdata);
1148+ if (WARN_ON(ret)) {
1149+ /* ok .. stupid driver, it asked for this! */
1150+ kfree(sdata);
1151+ return ret;
1152+ }
11531153 }
11541154
11551155 set_bit(SDATA_STATE_RUNNING, &sdata->state);
@@ -1187,9 +1187,6 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local) · 31 unmodified lines
11871187 {
11881188 struct ieee80211_sub_if_data *sdata;
11891189
1190− if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
1191− return;
1192−
11931190 ASSERT_RTNL();
11941191 lockdep_assert_wiphy(local->hw.wiphy);
11951192
@@ -1209,7 +1206,8 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local) · 13 unmodified lines
12091206
12101207 ieee80211_link_release_channel(&sdata->deflink);
12111208
1212− drv_remove_interface(local, sdata);
1209+ if (ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
1210+ drv_remove_interface(local, sdata);
12131211
12141212 kfree(sdata);
12151213 }
net/mac80211/scan.c+9−8
@@ -358,7 +358,8 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_sub_if_data *sdata) · 357 unmodified lines
358358 struct cfg80211_scan_request *req;
359359 struct cfg80211_chan_def chandef;
360360 u8 bands_used = 0;
361− int i, ielen, n_chans;
361+ int i, ielen;
362+ u32 *n_chans;
362363 u32 flags = 0;
363364
364365 req = rcu_dereference_protected(local->scan_req,
@@ -368,34 +369,34 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_sub_if_data *sdata) · 3 unmodified lines
368369 return false;
369370
370371 if (ieee80211_hw_check(&local->hw, SINGLE_SCAN_ON_ALL_BANDS)) {
372+ local->hw_scan_req->req.n_channels = req->n_channels;
373+
371374 for (i = 0; i < req->n_channels; i++) {
372375 local->hw_scan_req->req.channels[i] = req->channels[i];
373376 bands_used |= BIT(req->channels[i]->band);
374377 }
375−
376− n_chans = req->n_channels;
377378 } else {
378379 do {
379380 if (local->hw_scan_band == NUM_NL80211_BANDS)
380381 return false;
381382
382− n_chans = 0;
383+ n_chans = &local->hw_scan_req->req.n_channels;
384+ *n_chans = 0;
383385
384386 for (i = 0; i < req->n_channels; i++) {
385387 if (req->channels[i]->band !=
386388 local->hw_scan_band)
387389 continue;
388− local->hw_scan_req->req.channels[n_chans] =
390+ local->hw_scan_req->req.channels[(*n_chans)++] =
389391 req->channels[i];
390− n_chans++;
392+
391393 bands_used |= BIT(req->channels[i]->band);
392394 }
393395
394396 local->hw_scan_band++;
395− } while (!n_chans);
397+ } while (!*n_chans);
396398 }
397399
398− local->hw_scan_req->req.n_channels = n_chans;
399400 ieee80211_prepare_scan_chandef(&chandef);
400401
401402 if (req->flags & NL80211_SCAN_FLAG_MIN_PREQ_CONTENT)
net/mac80211/util.c+1−1
@@ -1843,7 +1843,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) · 1842 unmodified lines
18431843
18441844 /* add interfaces */
18451845 sdata = wiphy_dereference(local->hw.wiphy, local->monitor_sdata);
1846− if (sdata) {
1846+ if (sdata && ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) {
18471847 /* in HW restart it exists already */
18481848 WARN_ON(local->resuming);
18491849 res = drv_add_interface(local, sdata);
net/netfilter/core.c+11−2
@@ -815,12 +815,21 @@ int __init netfilter_init(void) · 814 unmodified lines
815815 if (ret < 0)
816816 goto err;
817817
818+#ifdef CONFIG_LWTUNNEL
819+ ret = netfilter_lwtunnel_init();
820+ if (ret < 0)
821+ goto err_lwtunnel_pernet;
822+#endif
818823 ret = netfilter_log_init();
819824 if (ret < 0)
820− goto err_pernet;
825+ goto err_log_pernet;
821826
822827 return 0;
823−err_pernet:
828+err_log_pernet:
829+#ifdef CONFIG_LWTUNNEL
830+ netfilter_lwtunnel_fini();
831+err_lwtunnel_pernet:
832+#endif
824833 unregister_pernet_subsys(&netfilter_net_ops);
825834 err:
826835 return ret;
net/netfilter/ipset/ip_set_core.c+6−5
@@ -53,12 +53,13 @@ MODULE_DESCRIPTION("core IP set support"); · 52 unmodified lines
5353 MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET);
5454
5555 /* When the nfnl mutex or ip_set_ref_lock is held: */
56−#define ip_set_dereference(p) \
57− rcu_dereference_protected(p, \
56+#define ip_set_dereference(inst) \
57+ rcu_dereference_protected((inst)->ip_set_list, \
5858 lockdep_nfnl_is_held(NFNL_SUBSYS_IPSET) || \
59− lockdep_is_held(&ip_set_ref_lock))
59+ lockdep_is_held(&ip_set_ref_lock) || \
60+ (inst)->is_deleted)
6061 #define ip_set(inst, id) \
61− ip_set_dereference((inst)->ip_set_list)[id]
62+ ip_set_dereference(inst)[id]
6263 #define ip_set_ref_netlink(inst,id) \
6364 rcu_dereference_raw((inst)->ip_set_list)[id]
6465 #define ip_set_dereference_nfnl(p) \
@@ -1133,7 +1134,7 @@ static int ip_set_create(struct sk_buff *skb, const struct nfnl_info *info, · 1068 unmodified lines
11331134 if (!list)
11341135 goto cleanup;
11351136 /* nfnl mutex is held, both lists are valid */
1136− tmp = ip_set_dereference(inst->ip_set_list);
1137+ tmp = ip_set_dereference(inst);
11371138 memcpy(list, tmp, sizeof(struct ip_set *) * inst->ip_set_max);
11381139 rcu_assign_pointer(inst->ip_set_list, list);
11391140 /* Make sure all current packets have passed through */
net/netfilter/nf_conntrack_standalone.c+0−15
@@ -22,9 +22,6 @@ · 21 unmodified lines
2222 #include <net/netfilter/nf_conntrack_acct.h>
2323 #include <net/netfilter/nf_conntrack_zones.h>
2424 #include <net/netfilter/nf_conntrack_timestamp.h>
25−#ifdef CONFIG_LWTUNNEL
26−#include <net/netfilter/nf_hooks_lwtunnel.h>
27−#endif
2825 #include <linux/rculist_nulls.h>
2926
3027 static bool enable_hooks __read_mostly;
@@ -612,9 +609,6 @@ enum nf_ct_sysctl_index { · 581 unmodified lines
612609 NF_SYSCTL_CT_PROTO_TIMEOUT_GRE,
613610 NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
614611 #endif
615−#ifdef CONFIG_LWTUNNEL
616− NF_SYSCTL_CT_LWTUNNEL,
617−#endif
618612
619613 NF_SYSCTL_CT_LAST_SYSCTL,
620614 };
@@ -946,15 +940,6 @@ static struct ctl_table nf_ct_sysctl_table[] = { · 325 unmodified lines
946940 .proc_handler = proc_dointvec_jiffies,
947941 },
948942 #endif
949−#ifdef CONFIG_LWTUNNEL
950− [NF_SYSCTL_CT_LWTUNNEL] = {
951− .procname = "nf_hooks_lwtunnel",
952− .data = NULL,
953− .maxlen = sizeof(int),
954− .mode = 0644,
955− .proc_handler = nf_hooks_lwtunnel_sysctl_handler,
956− },
957−#endif
958943 };
959944
960945 static struct ctl_table nf_ct_netfilter_table[] = {
net/netfilter/nf_hooks_lwtunnel.c+67−0
@@ -3,6 +3,9 @@ · 2 unmodified lines
33 #include <linux/sysctl.h>
44 #include <net/lwtunnel.h>
55 #include <net/netfilter/nf_hooks_lwtunnel.h>
6+#include <linux/netfilter.h>
7+
8+#include "nf_internals.h"
69
710 static inline int nf_hooks_lwtunnel_get(void)
811 {
@@ -50,4 +53,68 @@ int nf_hooks_lwtunnel_sysctl_handler(struct ctl_table *table, int write, · 41 unmodified lines
5053 return ret;
5154 }
5255 EXPORT_SYMBOL_GPL(nf_hooks_lwtunnel_sysctl_handler);
56+
57+static struct ctl_table nf_lwtunnel_sysctl_table[] = {
58+ {
59+ .procname = "nf_hooks_lwtunnel",
60+ .data = NULL,
61+ .maxlen = sizeof(int),
62+ .mode = 0644,
63+ .proc_handler = nf_hooks_lwtunnel_sysctl_handler,
64+ },
65+};
66+
67+static int __net_init nf_lwtunnel_net_init(struct net *net)
68+{
69+ struct ctl_table_header *hdr;
70+ struct ctl_table *table;
71+
72+ table = nf_lwtunnel_sysctl_table;
73+ if (!net_eq(net, &init_net)) {
74+ table = kmemdup(nf_lwtunnel_sysctl_table,
75+ sizeof(nf_lwtunnel_sysctl_table),
76+ GFP_KERNEL);
77+ if (!table)
78+ goto err_alloc;
79+ }
80+
81+ hdr = register_net_sysctl_sz(net, "net/netfilter", table,
82+ ARRAY_SIZE(nf_lwtunnel_sysctl_table));
83+ if (!hdr)
84+ goto err_reg;
85+
86+ net->nf.nf_lwtnl_dir_header = hdr;
87+
88+ return 0;
89+err_reg:
90+ if (!net_eq(net, &init_net))
91+ kfree(table);
92+err_alloc:
93+ return -ENOMEM;
94+}
95+
96+static void __net_exit nf_lwtunnel_net_exit(struct net *net)
97+{
98+ const struct ctl_table *table;
99+
100+ table = net->nf.nf_lwtnl_dir_header->ctl_table_arg;
101+ unregister_net_sysctl_table(net->nf.nf_lwtnl_dir_header);
102+ if (!net_eq(net, &init_net))
103+ kfree(table);
104+}
105+
106+static struct pernet_operations nf_lwtunnel_net_ops = {
107+ .init = nf_lwtunnel_net_init,
108+ .exit = nf_lwtunnel_net_exit,
109+};
110+
111+int __init netfilter_lwtunnel_init(void)
112+{
113+ return register_pernet_subsys(&nf_lwtunnel_net_ops);
114+}
115+
116+void netfilter_lwtunnel_fini(void)
117+{
118+ unregister_pernet_subsys(&nf_lwtunnel_net_ops);
119+}
53120 #endif /* CONFIG_SYSCTL */
net/netfilter/nf_internals.h+6−0
@@ -29,6 +29,12 @@ void nf_queue_nf_hook_drop(struct net *net); · 28 unmodified lines
2929 /* nf_log.c */
3030 int __init netfilter_log_init(void);
3131
32+#ifdef CONFIG_LWTUNNEL
33+/* nf_hooks_lwtunnel.c */
34+int __init netfilter_lwtunnel_init(void);
35+void netfilter_lwtunnel_fini(void);
36+#endif
37+
3238 /* core.c */
3339 void nf_hook_entries_delete_raw(struct nf_hook_entries __rcu **pp,
3440 const struct nf_hook_ops *reg);
net/netrom/nr_timer.c+2−1
@@ -121,7 +121,8 @@ static void nr_heartbeat_expiry(struct timer_list *t) · 120 unmodified lines
121121 is accepted() it isn't 'dead' so doesn't get removed. */
122122 if (sock_flag(sk, SOCK_DESTROY) ||
123123 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
124− sock_hold(sk);
124+ if (sk->sk_state == TCP_LISTEN)
125+ sock_hold(sk);
125126 bh_unlock_sock(sk);
126127 nr_destroy_socket(sk);
127128 goto out;
net/sched/act_api.c+1−2
@@ -830,7 +830,6 @@ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index, · 829 unmodified lines
830830 u32 max;
831831
832832 if (*index) {
833−again:
834833 rcu_read_lock();
835834 p = idr_find(&idrinfo->action_idr, *index);
836835
@@ -839,7 +838,7 @@ again: · 2 unmodified lines
839838 * index but did not assign the pointer yet.
840839 */
841840 rcu_read_unlock();
842− goto again;
841+ return -EAGAIN;
843842 }
844843
845844 if (!p) {
net/sched/act_ct.c+11−5
@@ -41,21 +41,26 @@ static struct workqueue_struct *act_ct_wq; · 40 unmodified lines
4141 static struct rhashtable zones_ht;
4242 static DEFINE_MUTEX(zones_mutex);
4343
44+struct zones_ht_key {
45+ struct net *net;
46+ u16 zone;
47+};
48+
4449 struct tcf_ct_flow_table {
4550 struct rhash_head node; /* In zones tables */
4651
4752 struct rcu_work rwork;
4853 struct nf_flowtable nf_ft;
4954 refcount_t ref;
50− u16 zone;
55+ struct zones_ht_key key;
5156
5257 bool dying;
5358 };
5459
5560 static const struct rhashtable_params zones_params = {
5661 .head_offset = offsetof(struct tcf_ct_flow_table, node),
57− .key_offset = offsetof(struct tcf_ct_flow_table, zone),
58− .key_len = sizeof_field(struct tcf_ct_flow_table, zone),
62+ .key_offset = offsetof(struct tcf_ct_flow_table, key),
63+ .key_len = sizeof_field(struct tcf_ct_flow_table, key),
5964 .automatic_shrinking = true,
6065 };
6166
@@ -316,11 +321,12 @@ static struct nf_flowtable_type flowtable_ct = { · 254 unmodified lines
316321
317322 static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params)
318323 {
324+ struct zones_ht_key key = { .net = net, .zone = params->zone };
319325 struct tcf_ct_flow_table *ct_ft;
320326 int err = -ENOMEM;
321327
322328 mutex_lock(&zones_mutex);
323− ct_ft = rhashtable_lookup_fast(&zones_ht, &params->zone, zones_params);
329+ ct_ft = rhashtable_lookup_fast(&zones_ht, &key, zones_params);
324330 if (ct_ft && refcount_inc_not_zero(&ct_ft->ref))
325331 goto out_unlock;
326332
@@ -329,7 +335,7 @@ static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params) · 2 unmodified lines
329335 goto err_alloc;
330336 refcount_set(&ct_ft->ref, 1);
331337
332− ct_ft->zone = params->zone;
338+ ct_ft->key = key;
333339 err = rhashtable_insert_fast(&zones_ht, &ct_ft->node, zones_params);
334340 if (err)
335341 goto err_insert;
net/sunrpc/svc_xprt.c+5−3
@@ -1421,12 +1421,13 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos) · 1420 unmodified lines
14211421
14221422 dprintk("svc_pool_stats_start, *pidx=%u\n", pidx);
14231423
1424+ if (!si->serv)
1425+ return NULL;
1426+
14241427 mutex_lock(si->mutex);
14251428
14261429 if (!pidx)
14271430 return SEQ_START_TOKEN;
1428− if (!si->serv)
1429− return NULL;
14301431 return pidx > si->serv->sv_nrpools ? NULL
14311432 : &si->serv->sv_pools[pidx - 1];
14321433 }
@@ -1458,7 +1459,8 @@ static void svc_pool_stats_stop(struct seq_file *m, void *p) · 25 unmodified lines
14581459 {
14591460 struct svc_info *si = m->private;
14601461
1461− mutex_unlock(si->mutex);
1462+ if (si->serv)
1463+ mutex_unlock(si->mutex);
14621464 }
14631465
14641466 static int svc_pool_stats_show(struct seq_file *m, void *p)
net/tipc/node.c+1−0
@@ -2105,6 +2105,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) · 2104 unmodified lines
21052105 } else {
21062106 n = tipc_node_find_by_id(net, ehdr->id);
21072107 }
2108+ skb_dst_force(skb);
21082109 tipc_crypto_rcv(net, (n) ? n->crypto_rx : NULL, &skb, b);
21092110 if (!skb)
21102111 return;
net/wireless/scan.c+9−3
@@ -3416,10 +3416,14 @@ int cfg80211_wext_siwscan(struct net_device *dev, · 3415 unmodified lines
34163416 wiphy = &rdev->wiphy;
34173417
34183418 /* Determine number of channels, needed to allocate creq */
3419− if (wreq && wreq->num_channels)
3419+ if (wreq && wreq->num_channels) {
3420+ /* Passed from userspace so should be checked */
3421+ if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES))
3422+ return -EINVAL;
34203423 n_channels = wreq->num_channels;
3421− else
3424+ } else {
34223425 n_channels = ieee80211_get_num_supported_channels(wiphy);
3426+ }
34233427
34243428 creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) +
34253429 n_channels * sizeof(void *),
@@ -3493,8 +3497,10 @@ int cfg80211_wext_siwscan(struct net_device *dev, · 67 unmodified lines
34933497 memcpy(creq->ssids[0].ssid, wreq->essid, wreq->essid_len);
34943498 creq->ssids[0].ssid_len = wreq->essid_len;
34953499 }
3496− if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE)
3500+ if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE) {
3501+ creq->ssids = NULL;
34973502 creq->n_ssids = 0;
3503+ }
34983504 }
34993505
35003506 for (i = 0; i < NUM_NL80211_BANDS; i++)
rust/kernel/alloc/vec_ext.rs+5−2
@@ -4,7 +4,6 @@ · 3 unmodified lines
44
55 use super::{AllocError, Flags};
66 use alloc::vec::Vec;
7−use core::ptr;
87
98 /// Extensions to [`Vec`].
109 pub trait VecExt<T>: Sized {
@@ -141,7 +140,11 @@ impl<T> VecExt<T> for Vec<T> { · 130 unmodified lines
141140 // `krealloc_aligned`. A `Vec<T>`'s `ptr` value is not guaranteed to be NULL and might be
142141 // dangling after being created with `Vec::new`. Instead, we can rely on `Vec<T>`'s capacity
143142 // to be zero if no memory has been allocated yet.
144− let ptr = if cap == 0 { ptr::null_mut() } else { old_ptr };
143+ let ptr = if cap == 0 {
144+ core::ptr::null_mut()
145+ } else {
146+ old_ptr
147+ };
145148
146149 // SAFETY: `ptr` is valid because it's either NULL or comes from a previous call to
147150 // `krealloc_aligned`. We also verified that the type is not a ZST.
security/Kconfig.hardening+0−15
@@ -255,21 +255,6 @@ config INIT_ON_FREE_DEFAULT_ON · 254 unmodified lines
255255 touching "cold" memory areas. Most cases see 3-5% impact. Some
256256 synthetic workloads have measured as high as 8%.
257257
258−config INIT_MLOCKED_ON_FREE_DEFAULT_ON
259− bool "Enable mlocked memory zeroing on free"
260− depends on !KMSAN
261− help
262− This config has the effect of setting "init_mlocked_on_free=1"
263− on the kernel command line. If it is enabled, all mlocked process
264− memory is zeroed when freed. This restriction to mlocked memory
265− improves performance over "init_on_free" but can still be used to
266− protect confidential data like key material from content exposures
267− to other processes, as well as live forensics and cold boot attacks.
268− Any non-mlocked memory is not cleared before it is reassigned. This
269− configuration can be overwritten by setting "init_mlocked_on_free=0"
270− on the command line. The "init_on_free" boot option takes
271− precedence over "init_mlocked_on_free".
272−
273258 config CC_HAS_ZERO_CALL_USED_REGS
274259 def_bool $(cc-option,-fzero-call-used-regs=used-gpr)
275260 # https://github.com/ClangBuiltLinux/linux/issues/1766
security/apparmor/audit.c+3−3
@@ -217,7 +217,7 @@ void aa_audit_rule_free(void *vrule) · 216 unmodified lines
217217 }
218218 }
219219
220−int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule)
220+int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule, gfp_t gfp)
221221 {
222222 struct aa_audit_rule *rule;
223223
@@ -230,14 +230,14 @@ int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule) · 6 unmodified lines
230230 return -EINVAL;
231231 }
232232
233− rule = kzalloc(sizeof(struct aa_audit_rule), GFP_KERNEL);
233+ rule = kzalloc(sizeof(struct aa_audit_rule), gfp);
234234
235235 if (!rule)
236236 return -ENOMEM;
237237
238238 /* Currently rules are treated as coming from the root ns */
239239 rule->label = aa_label_parse(&root_ns->unconfined->label, rulestr,
240− GFP_KERNEL, true, false);
240+ gfp, true, false);
241241 if (IS_ERR(rule->label)) {
242242 int err = PTR_ERR(rule->label);
243243 aa_audit_rule_free(rule);
security/apparmor/include/audit.h+1−1
@@ -200,7 +200,7 @@ static inline int complain_error(int error) · 199 unmodified lines
200200 }
201201
202202 void aa_audit_rule_free(void *vrule);
203−int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule);
203+int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule, gfp_t gfp);
204204 int aa_audit_rule_known(struct audit_krule *rule);
205205 int aa_audit_rule_match(u32 sid, u32 field, u32 op, void *vrule);
206206
security/integrity/ima/ima.h+1−1
@@ -546,7 +546,7 @@ static inline void ima_free_modsig(struct modsig *modsig) · 545 unmodified lines
546546 #else
547547
548548 static inline int ima_filter_rule_init(u32 field, u32 op, char *rulestr,
549− void **lsmrule)
549+ void **lsmrule, gfp_t gfp)
550550 {
551551 return -EINVAL;
552552 }
security/integrity/ima/ima_policy.c+9−6
@@ -401,7 +401,8 @@ static void ima_free_rule(struct ima_rule_entry *entry) · 400 unmodified lines
401401 kfree(entry);
402402 }
403403
404−static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry)
404+static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry,
405+ gfp_t gfp)
405406 {
406407 struct ima_rule_entry *nentry;
407408 int i;
@@ -410,7 +411,7 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry) · 2 unmodified lines
410411 * Immutable elements are copied over as pointers and data; only
411412 * lsm rules can change
412413 */
413− nentry = kmemdup(entry, sizeof(*nentry), GFP_KERNEL);
414+ nentry = kmemdup(entry, sizeof(*nentry), gfp);
414415 if (!nentry)
415416 return NULL;
416417
@@ -425,7 +426,8 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry) · 8 unmodified lines
425426
426427 ima_filter_rule_init(nentry->lsm[i].type, Audit_equal,
427428 nentry->lsm[i].args_p,
428− &nentry->lsm[i].rule);
429+ &nentry->lsm[i].rule,
430+ gfp);
429431 if (!nentry->lsm[i].rule)
430432 pr_warn("rule for LSM \'%s\' is undefined\n",
431433 nentry->lsm[i].args_p);
@@ -438,7 +440,7 @@ static int ima_lsm_update_rule(struct ima_rule_entry *entry) · 6 unmodified lines
438440 int i;
439441 struct ima_rule_entry *nentry;
440442
441− nentry = ima_lsm_copy_rule(entry);
443+ nentry = ima_lsm_copy_rule(entry, GFP_KERNEL);
442444 if (!nentry)
443445 return -ENOMEM;
444446
@@ -664,7 +666,7 @@ retry: · 219 unmodified lines
664666 }
665667
666668 if (rc == -ESTALE && !rule_reinitialized) {
667− lsm_rule = ima_lsm_copy_rule(rule);
669+ lsm_rule = ima_lsm_copy_rule(rule, GFP_ATOMIC);
668670 if (lsm_rule) {
669671 rule_reinitialized = true;
670672 goto retry;
@@ -1140,7 +1142,8 @@ static int ima_lsm_rule_init(struct ima_rule_entry *entry, · 469 unmodified lines
11401142 entry->lsm[lsm_rule].type = audit_type;
11411143 result = ima_filter_rule_init(entry->lsm[lsm_rule].type, Audit_equal,
11421144 entry->lsm[lsm_rule].args_p,
1143− &entry->lsm[lsm_rule].rule);
1145+ &entry->lsm[lsm_rule].rule,
1146+ GFP_KERNEL);
11441147 if (!entry->lsm[lsm_rule].rule) {
11451148 pr_warn("rule for LSM \'%s\' is undefined\n",
11461149 entry->lsm[lsm_rule].args_p);
security/security.c+4−2
@@ -5332,15 +5332,17 @@ void security_key_post_create_or_update(struct key *keyring, struct key *key, · 5331 unmodified lines
53325332 * @op: rule operator
53335333 * @rulestr: rule context
53345334 * @lsmrule: receive buffer for audit rule struct
5335+ * @gfp: GFP flag used for kmalloc
53355336 *
53365337 * Allocate and initialize an LSM audit rule structure.
53375338 *
53385339 * Return: Return 0 if @lsmrule has been successfully set, -EINVAL in case of
53395340 * an invalid rule.
53405341 */
5341−int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule)
5342+int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule,
5343+ gfp_t gfp)
53425344 {
5343− return call_int_hook(audit_rule_init, field, op, rulestr, lsmrule);
5345+ return call_int_hook(audit_rule_init, field, op, rulestr, lsmrule, gfp);
53445346 }
53455347
53465348 /**
security/selinux/include/audit.h+3−1
@@ -21,12 +21,14 @@ · 20 unmodified lines
2121 * @op: the operator the rule uses
2222 * @rulestr: the text "target" of the rule
2323 * @rule: pointer to the new rule structure returned via this
24+ * @gfp: GFP flag used for kmalloc
2425 *
2526 * Returns 0 if successful, -errno if not. On success, the rule structure
2627 * will be allocated internally. The caller must free this structure with
2728 * selinux_audit_rule_free() after use.
2829 */
29−int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **rule);
30+int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **rule,
31+ gfp_t gfp);
3032
3133 /**
3234 * selinux_audit_rule_free - free an selinux audit rule structure.
security/selinux/ss/services.c+3−2
@@ -3507,7 +3507,8 @@ void selinux_audit_rule_free(void *vrule) · 3506 unmodified lines
35073507 }
35083508 }
35093509
3510−int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule)
3510+int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule,
3511+ gfp_t gfp)
35113512 {
35123513 struct selinux_state *state = &selinux_state;
35133514 struct selinux_policy *policy;
@@ -3548,7 +3549,7 @@ int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule) · 34 unmodified lines
35483549 return -EINVAL;
35493550 }
35503551
3551− tmprule = kzalloc(sizeof(struct selinux_audit_rule), GFP_KERNEL);
3552+ tmprule = kzalloc(sizeof(struct selinux_audit_rule), gfp);
35523553 if (!tmprule)
35533554 return -ENOMEM;
35543555 context_init(&tmprule->au_ctxt);
security/smack/smack_lsm.c+3−1
@@ -4693,11 +4693,13 @@ static int smack_post_notification(const struct cred *w_cred, · 4692 unmodified lines
46934693 * @op: required testing operator (=, !=, >, <, ...)
46944694 * @rulestr: smack label to be audited
46954695 * @vrule: pointer to save our own audit rule representation
4696+ * @gfp: type of the memory for the allocation
46964697 *
46974698 * Prepare to audit cases where (@field @op @rulestr) is true.
46984699 * The label to be audited is created if necessay.
46994700 */
4700−static int smack_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule)
4701+static int smack_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule,
4702+ gfp_t gfp)
47014703 {
47024704 struct smack_known *skp;
47034705 char **rule = (char **)vrule;
security/yama/yama_lsm.c+1−0
@@ -111,6 +111,7 @@ static void report_access(const char *access, struct task_struct *target, · 110 unmodified lines
111111
112112 /**
113113 * yama_relation_cleanup - remove invalid entries from the relation list
114+ * @work: unused
114115 *
115116 */
116117 static void yama_relation_cleanup(struct work_struct *work)
sound/core/seq/seq_ump_convert.c+2−0
@@ -1075,6 +1075,8 @@ static const struct seq_ev_to_ump seq_ev_ump_encoders[] = { · 1074 unmodified lines
10751075 system_ev_to_ump_midi1, system_ev_to_ump_midi2 },
10761076 { SNDRV_SEQ_EVENT_SENSING, UMP_SYSTEM_STATUS_ACTIVE_SENSING,
10771077 system_ev_to_ump_midi1, system_ev_to_ump_midi2 },
1078+ { SNDRV_SEQ_EVENT_RESET, UMP_SYSTEM_STATUS_RESET,
1079+ system_ev_to_ump_midi1, system_ev_to_ump_midi2 },
10781080 };
10791081
10801082 static const struct seq_ev_to_ump *find_ump_encoder(int type)
sound/hda/intel-dsp-config.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 static int dsp_driver;
1919
2020 module_param(dsp_driver, int, 0444);
21−MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF)");
21+MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF, 4=AVS)");
2222
2323 #define FLAG_SST BIT(0)
2424 #define FLAG_SOF BIT(1)
sound/oss/dmasound/dmasound_core.c+1−0
@@ -204,6 +204,7 @@ module_param(numWriteBufs, int, 0); · 203 unmodified lines
204204 static unsigned int writeBufSize = DEFAULT_BUFF_SIZE ; /* in bytes */
205205 module_param(writeBufSize, int, 0);
206206
207+MODULE_DESCRIPTION("Atari/Amiga/Q40 core DMA sound driver");
207208 MODULE_LICENSE("GPL");
208209
209210 static int sq_unit = -1;
sound/pci/hda/Kconfig+2−0
@@ -162,6 +162,7 @@ config SND_HDA_SCODEC_CS35L56_I2C · 161 unmodified lines
162162 depends on ACPI || COMPILE_TEST
163163 depends on SND_SOC
164164 select FW_CS_DSP
165+ imply SERIAL_MULTI_INSTANTIATE
165166 select SND_HDA_GENERIC
166167 select SND_SOC_CS35L56_SHARED
167168 select SND_HDA_SCODEC_CS35L56
@@ -178,6 +179,7 @@ config SND_HDA_SCODEC_CS35L56_SPI · 10 unmodified lines
178179 depends on ACPI || COMPILE_TEST
179180 depends on SND_SOC
180181 select FW_CS_DSP
182+ imply SERIAL_MULTI_INSTANTIATE
181183 select SND_HDA_GENERIC
182184 select SND_SOC_CS35L56_SHARED
183185 select SND_HDA_SCODEC_CS35L56
sound/pci/hda/cs35l41_hda.c+3−3
@@ -1495,7 +1495,7 @@ static void cs35l41_hda_unbind(struct device *dev, struct device *master, void * · 1494 unmodified lines
14951495 if (comps[cs35l41->index].dev == dev) {
14961496 memset(&comps[cs35l41->index], 0, sizeof(*comps));
14971497 sleep_flags = lock_system_sleep();
1498− device_link_remove(&comps->codec->core.dev, cs35l41->dev);
1498+ device_link_remove(&cs35l41->codec->core.dev, cs35l41->dev);
14991499 unlock_system_sleep(sleep_flags);
15001500 }
15011501 }
@@ -2019,6 +2019,8 @@ void cs35l41_hda_remove(struct device *dev) · 517 unmodified lines
20192019 {
20202020 struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
20212021
2022+ component_del(cs35l41->dev, &cs35l41_hda_comp_ops);
2023+
20222024 pm_runtime_get_sync(cs35l41->dev);
20232025 pm_runtime_dont_use_autosuspend(cs35l41->dev);
20242026 pm_runtime_disable(cs35l41->dev);
@@ -2026,8 +2028,6 @@ void cs35l41_hda_remove(struct device *dev) · 1 unmodified line
20262028 if (cs35l41->halo_initialized)
20272029 cs35l41_remove_dsp(cs35l41);
20282030
2029− component_del(cs35l41->dev, &cs35l41_hda_comp_ops);
2030−
20312031 acpi_dev_put(cs35l41->dacpi);
20322032
20332033 pm_runtime_put_noidle(cs35l41->dev);
sound/pci/hda/cs35l41_hda_property.c+8−0
@@ -128,6 +128,10 @@ static const struct cs35l41_config cs35l41_config_table[] = { · 127 unmodified lines
128128 { "17AA38B5", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
129129 { "17AA38B6", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
130130 { "17AA38B7", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
131+ { "17AA38C7", 4, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, CS35L41_LEFT, CS35L41_RIGHT }, 0, 2, -1, 1000, 4500, 24 },
132+ { "17AA38C8", 4, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, CS35L41_LEFT, CS35L41_RIGHT }, 0, 2, -1, 1000, 4500, 24 },
133+ { "17AA38F9", 2, EXTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, 0, 0 }, 0, 2, -1, 0, 0, 0 },
134+ { "17AA38FA", 2, EXTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, 0, 0 }, 0, 2, -1, 0, 0, 0 },
131135 {}
132136 };
133137
@@ -529,6 +533,10 @@ static const struct cs35l41_prop_model cs35l41_prop_model_table[] = { · 395 unmodified lines
529533 { "CSC3551", "17AA38B5", generic_dsd_config },
530534 { "CSC3551", "17AA38B6", generic_dsd_config },
531535 { "CSC3551", "17AA38B7", generic_dsd_config },
536+ { "CSC3551", "17AA38C7", generic_dsd_config },
537+ { "CSC3551", "17AA38C8", generic_dsd_config },
538+ { "CSC3551", "17AA38F9", generic_dsd_config },
539+ { "CSC3551", "17AA38FA", generic_dsd_config },
532540 {}
533541 };
534542
sound/pci/hda/cs35l56_hda.c+7−2
@@ -735,6 +735,8 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void * · 734 unmodified lines
735735 if (comps[cs35l56->index].dev == dev)
736736 memset(&comps[cs35l56->index], 0, sizeof(*comps));
737737
738+ cs35l56->codec = NULL;
739+
738740 dev_dbg(cs35l56->base.dev, "Unbound\n");
739741 }
740742
@@ -840,6 +842,9 @@ static int cs35l56_hda_system_resume(struct device *dev) · 99 unmodified lines
840842
841843 cs35l56->suspended = false;
842844
845+ if (!cs35l56->codec)
846+ return 0;
847+
843848 ret = cs35l56_is_fw_reload_needed(&cs35l56->base);
844849 dev_dbg(cs35l56->base.dev, "fw_reload_needed: %d\n", ret);
845850 if (ret > 0) {
@@ -1072,12 +1077,12 @@ void cs35l56_hda_remove(struct device *dev) · 226 unmodified lines
10721077 {
10731078 struct cs35l56_hda *cs35l56 = dev_get_drvdata(dev);
10741079
1080+ component_del(cs35l56->base.dev, &cs35l56_hda_comp_ops);
1081+
10751082 pm_runtime_dont_use_autosuspend(cs35l56->base.dev);
10761083 pm_runtime_get_sync(cs35l56->base.dev);
10771084 pm_runtime_disable(cs35l56->base.dev);
10781085
1079− component_del(cs35l56->base.dev, &cs35l56_hda_comp_ops);
1080−
10811086 cs_dsp_remove(&cs35l56->cs_dsp);
10821087
10831088 kfree(cs35l56->system_name);
sound/pci/hda/patch_realtek.c+36−3
@@ -583,10 +583,14 @@ static void alc_shutup_pins(struct hda_codec *codec) · 582 unmodified lines
583583 switch (codec->core.vendor_id) {
584584 case 0x10ec0236:
585585 case 0x10ec0256:
586+ case 0x10ec0257:
586587 case 0x19e58326:
587588 case 0x10ec0283:
589+ case 0x10ec0285:
588590 case 0x10ec0286:
591+ case 0x10ec0287:
589592 case 0x10ec0288:
593+ case 0x10ec0295:
590594 case 0x10ec0298:
591595 alc_headset_mic_no_shutup(codec);
592596 break;
@@ -7520,6 +7524,7 @@ enum { · 6927 unmodified lines
75207524 ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
75217525 ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
75227526 ALC256_FIXUP_CHROME_BOOK,
7527+ ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7,
75237528 };
75247529
75257530 /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -7559,6 +7564,21 @@ static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec, · 33 unmodified lines
75597564 __snd_hda_apply_fixup(codec, id, action, 0);
75607565 }
75617566
7567+/* Similar to above the Lenovo Yoga Pro 7 14ARP8 PCI SSID matches the codec SSID of the
7568+ Legion Y9000X 2022 IAH7.*/
7569+static void alc287_fixup_lenovo_14arp8_legion_iah7(struct hda_codec *codec,
7570+ const struct hda_fixup *fix,
7571+ int action)
7572+{
7573+ int id;
7574+
7575+ if (codec->core.subsystem_id == 0x17aa386e)
7576+ id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion Y9000X 2022 IAH7 */
7577+ else
7578+ id = ALC285_FIXUP_SPEAKER2_TO_DAC1; /* Yoga Pro 7 14ARP8 */
7579+ __snd_hda_apply_fixup(codec, id, action, 0);
7580+}
7581+
75627582 /* Another hilarious PCI SSID conflict with Lenovo Legion Pro 7 16ARX8H (with
75637583 * TAS2781 codec) and Legion 7i 16IAX7 (with CS35L41 codec);
75647584 * we apply a corresponding fixup depending on the codec SSID instead
@@ -9658,6 +9678,10 @@ static const struct hda_fixup alc269_fixups[] = { · 2093 unmodified lines
96589678 .chained = true,
96599679 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
96609680 },
9681+ [ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7] = {
9682+ .type = HDA_FIXUP_FUNC,
9683+ .v.func = alc287_fixup_lenovo_14arp8_legion_iah7,
9684+ },
96619685 [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
96629686 .type = HDA_FIXUP_FUNC,
96639687 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
@@ -10194,6 +10218,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 530 unmodified lines
1019410218 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
1019510219 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
1019610220 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10221+ SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10222+ SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10223+ SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10224+ SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1019710225 SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
1019810226 SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
1019910227 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
@@ -10502,7 +10530,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 302 unmodified lines
1050210530 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
1050310531 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
1050410532 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10505− SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10533+ SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
1050610534 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
1050710535 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
1050810536 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
@@ -10516,7 +10544,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 7 unmodified lines
1051610544 SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
1051710545 SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
1051810546 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10519− SND_PCI_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2),
10547+ SND_PCI_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7 / Yoga Pro 7 14ARP8", ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7),
1052010548 SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7/7i", ALC287_FIXUP_LENOVO_LEGION_7),
1052110549 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
1052210550 SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
@@ -10527,6 +10555,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 4 unmodified lines
1052710555 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
1052810556 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
1052910557 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10558+ SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
1053010559 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
1053110560 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
1053210561 SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
@@ -10540,10 +10569,14 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 7 unmodified lines
1054010569 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
1054110570 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
1054210571 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10572+ SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10573+ SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
1054310574 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
1054410575 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
1054510576 SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
1054610577 SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10578+ SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10579+ SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
1054710580 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
1054810581 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
1054910582 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
@@ -10581,6 +10614,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 31 unmodified lines
1058110614 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
1058210615 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
1058310616 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10617+ SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1058410618 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
1058510619 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
1058610620 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
@@ -10605,7 +10639,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 18 unmodified lines
1060510639 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
1060610640 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
1060710641 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10608− SND_PCI_QUIRK(0xf111, 0x0005, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
1060910642 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
1061010643
1061110644 #if 0
sound/pci/hda/tas2781_hda_i2c.c+2−2
@@ -777,11 +777,11 @@ static void tas2781_hda_remove(struct device *dev) · 776 unmodified lines
777777 {
778778 struct tas2781_hda *tas_hda = dev_get_drvdata(dev);
779779
780+ component_del(tas_hda->dev, &tas2781_hda_comp_ops);
781+
780782 pm_runtime_get_sync(tas_hda->dev);
781783 pm_runtime_disable(tas_hda->dev);
782784
783− component_del(tas_hda->dev, &tas2781_hda_comp_ops);
784−
785785 pm_runtime_put_noidle(tas_hda->dev);
786786
787787 tasdevice_remove(tas_hda->priv);
tools/hv/Makefile+1−0
@@ -17,6 +17,7 @@ endif · 16 unmodified lines
1717 MAKEFLAGS += -r
1818
1919 override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
20+override CFLAGS += -Wno-address-of-packed-member
2021
2122 ALL_TARGETS := hv_kvp_daemon hv_vss_daemon
2223 ifneq ($(ARCH), aarch64)
tools/testing/selftests/bpf/prog_tests/verifier.c+2−0
@@ -53,6 +53,7 @@ · 52 unmodified lines
5353 #include "verifier_movsx.skel.h"
5454 #include "verifier_netfilter_ctx.skel.h"
5555 #include "verifier_netfilter_retcode.skel.h"
56+#include "verifier_or_jmp32_k.skel.h"
5657 #include "verifier_precision.skel.h"
5758 #include "verifier_prevent_map_lookup.skel.h"
5859 #include "verifier_raw_stack.skel.h"
@@ -170,6 +171,7 @@ void test_verifier_meta_access(void) { RUN(verifier_meta_access); } · 111 unmodified lines
170171 void test_verifier_movsx(void) { RUN(verifier_movsx); }
171172 void test_verifier_netfilter_ctx(void) { RUN(verifier_netfilter_ctx); }
172173 void test_verifier_netfilter_retcode(void) { RUN(verifier_netfilter_retcode); }
174+void test_verifier_or_jmp32_k(void) { RUN(verifier_or_jmp32_k); }
173175 void test_verifier_precision(void) { RUN(verifier_precision); }
174176 void test_verifier_prevent_map_lookup(void) { RUN(verifier_prevent_map_lookup); }
175177 void test_verifier_raw_stack(void) { RUN(verifier_raw_stack); }
tools/testing/selftests/bpf/progs/verifier_or_jmp32_k.c+41−0
@@ -0,0 +1,41 @@
1+// SPDX-License-Identifier: GPL-2.0
2+
3+#include <linux/bpf.h>
4+#include <bpf/bpf_helpers.h>
5+#include "bpf_misc.h"
6+
7+SEC("socket")
8+__description("or_jmp32_k: bit ops + branch on unknown value")
9+__failure
10+__msg("R0 invalid mem access 'scalar'")
11+__naked void or_jmp32_k(void)
12+{
13+ asm volatile (" \
14+ r0 = 0xffffffff; \
15+ r0 /= 1; \
16+ r1 = 0; \
17+ w1 = -1; \
18+ w1 >>= 1; \
19+ w0 &= w1; \
20+ w0 |= 2; \
21+ if w0 != 0x7ffffffd goto l1; \
22+ r0 = 1; \
23+ exit; \
24+l3: \
25+ r0 = 5; \
26+ *(u64*)(r0 - 8) = r0; \
27+ exit; \
28+l2: \
29+ w0 -= 0xe; \
30+ if w0 == 1 goto l3; \
31+ r0 = 4; \
32+ exit; \
33+l1: \
34+ w0 -= 0x7ffffff0; \
35+ if w0 s>= 0xe goto l2; \
36+ r0 = 3; \
37+ exit; \
38+" ::: __clobber_all);
39+}
40+
41+char _license[] SEC("license") = "GPL";
tools/testing/selftests/drivers/net/virtio_net/config+7−1
@@ -1,2 +1,8 @@
1−CONFIG_VIRTIO_NET=y
1+CONFIG_BPF_SYSCALL=y
2+CONFIG_CGROUP_BPF=y
3+CONFIG_IPV6=y
4+CONFIG_IPV6_MULTIPLE_TABLES=y
5+CONFIG_NET_L3_MASTER_DEV=y
6+CONFIG_NET_VRF=m
27 CONFIG_VIRTIO_DEBUG=y
8+CONFIG_VIRTIO_NET=y
tools/testing/selftests/fchmodat2/Makefile+10−1
@@ -1,6 +1,15 @@
11 # SPDX-License-Identifier: GPL-2.0-or-later
22
3−CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan $(KHDR_INCLUDES)
3+CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES)
4+
5+# gcc requires -static-libasan in order to ensure that Address Sanitizer's
6+# library is the first one loaded. However, clang already statically links the
7+# Address Sanitizer if -fsanitize is specified. Therefore, simply omit
8+# -static-libasan for clang builds.
9+ifeq ($(LLVM),)
10+ CFLAGS += -static-libasan
11+endif
12+
413 TEST_GEN_PROGS := fchmodat2_test
514
615 include ../lib.mk
tools/testing/selftests/filesystems/statmount/statmount_test.c+10−2
@@ -125,8 +125,16 @@ static uint32_t old_root_id, old_parent_id; · 124 unmodified lines
125125
126126 static void cleanup_namespace(void)
127127 {
128− fchdir(orig_root);
129− chroot(".");
128+ int ret;
129+
130+ ret = fchdir(orig_root);
131+ if (ret == -1)
132+ ksft_perror("fchdir to original root");
133+
134+ ret = chroot(".");
135+ if (ret == -1)
136+ ksft_perror("chroot to original root");
137+
130138 umount2(root_mntpoint, MNT_DETACH);
131139 rmdir(root_mntpoint);
132140 }
tools/testing/selftests/kvm/include/x86_64/processor.h+1−0
@@ -277,6 +277,7 @@ struct kvm_x86_cpu_property { · 276 unmodified lines
277277 #define X86_PROPERTY_MAX_EXT_LEAF KVM_X86_CPU_PROPERTY(0x80000000, 0, EAX, 0, 31)
278278 #define X86_PROPERTY_MAX_PHY_ADDR KVM_X86_CPU_PROPERTY(0x80000008, 0, EAX, 0, 7)
279279 #define X86_PROPERTY_MAX_VIRT_ADDR KVM_X86_CPU_PROPERTY(0x80000008, 0, EAX, 8, 15)
280+#define X86_PROPERTY_GUEST_MAX_PHY_ADDR KVM_X86_CPU_PROPERTY(0x80000008, 0, EAX, 16, 23)
280281 #define X86_PROPERTY_SEV_C_BIT KVM_X86_CPU_PROPERTY(0x8000001F, 0, EBX, 0, 5)
281282 #define X86_PROPERTY_PHYS_ADDR_REDUCTION KVM_X86_CPU_PROPERTY(0x8000001F, 0, EBX, 6, 11)
282283
tools/testing/selftests/kvm/lib/riscv/ucall.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #include "kvm_util.h"
1111 #include "processor.h"
12+#include "sbi.h"
1213
1314 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
1415 {
tools/testing/selftests/kvm/lib/x86_64/processor.c+13−2
@@ -1247,9 +1247,20 @@ unsigned long vm_compute_max_gfn(struct kvm_vm *vm) · 1246 unmodified lines
12471247 {
12481248 const unsigned long num_ht_pages = 12 << (30 - vm->page_shift); /* 12 GiB */
12491249 unsigned long ht_gfn, max_gfn, max_pfn;
1250− uint8_t maxphyaddr;
1250+ uint8_t maxphyaddr, guest_maxphyaddr;
12511251
1252− max_gfn = (1ULL << (vm->pa_bits - vm->page_shift)) - 1;
1252+ /*
1253+ * Use "guest MAXPHYADDR" from KVM if it's available. Guest MAXPHYADDR
1254+ * enumerates the max _mappable_ GPA, which can be less than the raw
1255+ * MAXPHYADDR, e.g. if MAXPHYADDR=52, KVM is using TDP, and the CPU
1256+ * doesn't support 5-level TDP.
1257+ */
1258+ guest_maxphyaddr = kvm_cpu_property(X86_PROPERTY_GUEST_MAX_PHY_ADDR);
1259+ guest_maxphyaddr = guest_maxphyaddr ?: vm->pa_bits;
1260+ TEST_ASSERT(guest_maxphyaddr <= vm->pa_bits,
1261+ "Guest MAXPHYADDR should never be greater than raw MAXPHYADDR");
1262+
1263+ max_gfn = (1ULL << (guest_maxphyaddr - vm->page_shift)) - 1;
12531264
12541265 /* Avoid reserved HyperTransport region on AMD processors. */
12551266 if (!host_cpu_is_amd)
tools/testing/selftests/kvm/riscv/ebreak_test.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 *
77 */
88 #include "kvm_util.h"
9+#include "ucall_common.h"
910
1011 #define LABEL_ADDRESS(v) ((uint64_t)&(v))
1112
tools/testing/selftests/kvm/riscv/sbi_pmu_test.c+1−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include "processor.h"
1616 #include "sbi.h"
1717 #include "arch_timer.h"
18+#include "ucall_common.h"
1819
1920 /* Maximum counters(firmware + hardware) */
2021 #define RISCV_MAX_PMU_COUNTERS 64
tools/testing/selftests/kvm/x86_64/sev_init2_tests.c+2−2
@@ -105,11 +105,11 @@ void test_features(uint32_t vm_type, uint64_t supported_features) · 104 unmodified lines
105105 int i;
106106
107107 for (i = 0; i < 64; i++) {
108− if (!(supported_features & (1u << i)))
108+ if (!(supported_features & BIT_ULL(i)))
109109 test_init2_invalid(vm_type,
110110 &(struct kvm_sev_init){ .vmsa_features = BIT_ULL(i) },
111111 "unknown feature");
112− else if (KNOWN_FEATURES & (1u << i))
112+ else if (KNOWN_FEATURES & BIT_ULL(i))
113113 test_init2(vm_type,
114114 &(struct kvm_sev_init){ .vmsa_features = BIT_ULL(i) });
115115 }
tools/testing/selftests/mm/map_fixed_noreplace.c+16−8
@@ -67,7 +67,8 @@ int main(void) · 66 unmodified lines
6767 dump_maps();
6868 ksft_exit_fail_msg("Error: munmap failed!?\n");
6969 }
70− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
70+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
71+ ksft_test_result_pass("mmap() 5*PAGE_SIZE at base\n");
7172
7273 addr = base_addr + page_size;
7374 size = 3 * page_size;
@@ -76,7 +77,8 @@ int main(void) · 2 unmodified lines
7677 dump_maps();
7778 ksft_exit_fail_msg("Error: first mmap() failed unexpectedly\n");
7879 }
79− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
80+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
81+ ksft_test_result_pass("mmap() 3*PAGE_SIZE at base+PAGE_SIZE\n");
8082
8183 /*
8284 * Exact same mapping again:
@@ -93,7 +95,8 @@ int main(void) · 10 unmodified lines
9395 dump_maps();
9496 ksft_exit_fail_msg("Error:1: mmap() succeeded when it shouldn't have\n");
9597 }
96− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
98+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
99+ ksft_test_result_pass("mmap() 5*PAGE_SIZE at base\n");
97100
98101 /*
99102 * Second mapping contained within first:
@@ -111,7 +114,8 @@ int main(void) · 11 unmodified lines
111114 dump_maps();
112115 ksft_exit_fail_msg("Error:2: mmap() succeeded when it shouldn't have\n");
113116 }
114− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
117+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
118+ ksft_test_result_pass("mmap() 2*PAGE_SIZE at base+PAGE_SIZE\n");
115119
116120 /*
117121 * Overlap end of existing mapping:
@@ -128,7 +132,8 @@ int main(void) · 10 unmodified lines
128132 dump_maps();
129133 ksft_exit_fail_msg("Error:3: mmap() succeeded when it shouldn't have\n");
130134 }
131− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
135+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
136+ ksft_test_result_pass("mmap() 2*PAGE_SIZE at base+(3*PAGE_SIZE)\n");
132137
133138 /*
134139 * Overlap start of existing mapping:
@@ -145,7 +150,8 @@ int main(void) · 10 unmodified lines
145150 dump_maps();
146151 ksft_exit_fail_msg("Error:4: mmap() succeeded when it shouldn't have\n");
147152 }
148− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
153+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
154+ ksft_test_result_pass("mmap() 2*PAGE_SIZE bytes at base\n");
149155
150156 /*
151157 * Adjacent to start of existing mapping:
@@ -162,7 +168,8 @@ int main(void) · 10 unmodified lines
162168 dump_maps();
163169 ksft_exit_fail_msg("Error:5: mmap() failed when it shouldn't have\n");
164170 }
165− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
171+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
172+ ksft_test_result_pass("mmap() PAGE_SIZE at base\n");
166173
167174 /*
168175 * Adjacent to end of existing mapping:
@@ -179,7 +186,8 @@ int main(void) · 10 unmodified lines
179186 dump_maps();
180187 ksft_exit_fail_msg("Error:6: mmap() failed when it shouldn't have\n");
181188 }
182− ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
189+ ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
190+ ksft_test_result_pass("mmap() PAGE_SIZE at base+(4*PAGE_SIZE)\n");
183191
184192 addr = base_addr;
185193 size = 5 * page_size;
tools/testing/selftests/net/Makefile+2−0
@@ -43,6 +43,8 @@ TEST_PROGS += srv6_hl2encap_red_l2vpn_test.sh · 42 unmodified lines
4343 TEST_PROGS += srv6_end_next_csid_l3vpn_test.sh
4444 TEST_PROGS += srv6_end_x_next_csid_l3vpn_test.sh
4545 TEST_PROGS += srv6_end_flavors_test.sh
46+TEST_PROGS += srv6_end_dx4_netfilter_test.sh
47+TEST_PROGS += srv6_end_dx6_netfilter_test.sh
4648 TEST_PROGS += vrf_strict_mode_test.sh
4749 TEST_PROGS += arp_ndisc_evict_nocarrier.sh
4850 TEST_PROGS += ndisc_unsolicited_na_test.sh
tools/testing/selftests/net/config+2−0
@@ -101,3 +101,5 @@ CONFIG_NETFILTER_XT_MATCH_POLICY=m · 100 unmodified lines
101101 CONFIG_CRYPTO_ARIA=y
102102 CONFIG_XFRM_INTERFACE=m
103103 CONFIG_XFRM_USER=m
104+CONFIG_IP_NF_MATCH_RPFILTER=m
105+CONFIG_IP6_NF_MATCH_RPFILTER=m
tools/testing/selftests/net/mptcp/userspace_pm.sh+28−18
@@ -160,10 +160,12 @@ make_connection() · 159 unmodified lines
160160 local is_v6=$1
161161 local app_port=$app4_port
162162 local connect_addr="10.0.1.1"
163+ local client_addr="10.0.1.2"
163164 local listen_addr="0.0.0.0"
164165 if [ "$is_v6" = "v6" ]
165166 then
166167 connect_addr="dead:beef:1::1"
168+ client_addr="dead:beef:1::2"
167169 listen_addr="::"
168170 app_port=$app6_port
169171 else
@@ -206,6 +208,7 @@ make_connection() · 36 unmodified lines
206208 [ "$server_serverside" = 1 ]
207209 then
208210 test_pass
211+ print_title "Connection info: ${client_addr}:${client_port} -> ${connect_addr}:${app_port}"
209212 else
210213 test_fail "Expected tokens (c:${client_token} - s:${server_token}) and server (c:${client_serverside} - s:${server_serverside})"
211214 mptcp_lib_result_print_all_tap
@@ -297,7 +300,7 @@ test_announce() · 85 unmodified lines
297300 ip netns exec "$ns2"\
298301 ./pm_nl_ctl ann 10.0.2.2 token "$client4_token" id $client_addr_id dev\
299302 ns2eth1
300− print_test "ADD_ADDR id:${client_addr_id} 10.0.2.2 (ns2) => ns1, reuse port"
303+ print_test "ADD_ADDR id:client 10.0.2.2 (ns2) => ns1, reuse port"
301304 sleep 0.5
302305 verify_announce_event $server_evts $ANNOUNCED $server4_token "10.0.2.2" $client_addr_id \
303306 "$client4_port"
@@ -306,7 +309,7 @@ test_announce() · 2 unmodified lines
306309 :>"$server_evts"
307310 ip netns exec "$ns2" ./pm_nl_ctl ann\
308311 dead:beef:2::2 token "$client6_token" id $client_addr_id dev ns2eth1
309− print_test "ADD_ADDR6 id:${client_addr_id} dead:beef:2::2 (ns2) => ns1, reuse port"
312+ print_test "ADD_ADDR6 id:client dead:beef:2::2 (ns2) => ns1, reuse port"
310313 sleep 0.5
311314 verify_announce_event "$server_evts" "$ANNOUNCED" "$server6_token" "dead:beef:2::2"\
312315 "$client_addr_id" "$client6_port" "v6"
@@ -316,7 +319,7 @@ test_announce() · 3 unmodified lines
316319 client_addr_id=$((client_addr_id+1))
317320 ip netns exec "$ns2" ./pm_nl_ctl ann 10.0.2.2 token "$client4_token" id\
318321 $client_addr_id dev ns2eth1 port $new4_port
319− print_test "ADD_ADDR id:${client_addr_id} 10.0.2.2 (ns2) => ns1, new port"
322+ print_test "ADD_ADDR id:client+1 10.0.2.2 (ns2) => ns1, new port"
320323 sleep 0.5
321324 verify_announce_event "$server_evts" "$ANNOUNCED" "$server4_token" "10.0.2.2"\
322325 "$client_addr_id" "$new4_port"
@@ -327,7 +330,7 @@ test_announce() · 4 unmodified lines
327330 # ADD_ADDR from the server to client machine reusing the subflow port
328331 ip netns exec "$ns1" ./pm_nl_ctl ann 10.0.2.1 token "$server4_token" id\
329332 $server_addr_id dev ns1eth2
330− print_test "ADD_ADDR id:${server_addr_id} 10.0.2.1 (ns1) => ns2, reuse port"
333+ print_test "ADD_ADDR id:server 10.0.2.1 (ns1) => ns2, reuse port"
331334 sleep 0.5
332335 verify_announce_event "$client_evts" "$ANNOUNCED" "$client4_token" "10.0.2.1"\
333336 "$server_addr_id" "$app4_port"
@@ -336,7 +339,7 @@ test_announce() · 2 unmodified lines
336339 :>"$client_evts"
337340 ip netns exec "$ns1" ./pm_nl_ctl ann dead:beef:2::1 token "$server6_token" id\
338341 $server_addr_id dev ns1eth2
339− print_test "ADD_ADDR6 id:${server_addr_id} dead:beef:2::1 (ns1) => ns2, reuse port"
342+ print_test "ADD_ADDR6 id:server dead:beef:2::1 (ns1) => ns2, reuse port"
340343 sleep 0.5
341344 verify_announce_event "$client_evts" "$ANNOUNCED" "$client6_token" "dead:beef:2::1"\
342345 "$server_addr_id" "$app6_port" "v6"
@@ -346,7 +349,7 @@ test_announce() · 3 unmodified lines
346349 server_addr_id=$((server_addr_id+1))
347350 ip netns exec "$ns1" ./pm_nl_ctl ann 10.0.2.1 token "$server4_token" id\
348351 $server_addr_id dev ns1eth2 port $new4_port
349− print_test "ADD_ADDR id:${server_addr_id} 10.0.2.1 (ns1) => ns2, new port"
352+ print_test "ADD_ADDR id:server+1 10.0.2.1 (ns1) => ns2, new port"
350353 sleep 0.5
351354 verify_announce_event "$client_evts" "$ANNOUNCED" "$client4_token" "10.0.2.1"\
352355 "$server_addr_id" "$new4_port"
@@ -380,7 +383,7 @@ test_remove() · 27 unmodified lines
380383 local invalid_token=$(( client4_token - 1 ))
381384 ip netns exec "$ns2" ./pm_nl_ctl rem token $invalid_token id\
382385 $client_addr_id > /dev/null 2>&1
383− print_test "RM_ADDR id:${client_addr_id} ns2 => ns1, invalid token"
386+ print_test "RM_ADDR id:client ns2 => ns1, invalid token"
384387 local type
385388 type=$(mptcp_lib_evts_get_info type "$server_evts")
386389 if [ "$type" = "" ]
@@ -394,7 +397,7 @@ test_remove() · 7 unmodified lines
394397 local invalid_id=$(( client_addr_id + 1 ))
395398 ip netns exec "$ns2" ./pm_nl_ctl rem token "$client4_token" id\
396399 $invalid_id > /dev/null 2>&1
397− print_test "RM_ADDR id:${invalid_id} ns2 => ns1, invalid id"
400+ print_test "RM_ADDR id:client+1 ns2 => ns1, invalid id"
398401 type=$(mptcp_lib_evts_get_info type "$server_evts")
399402 if [ "$type" = "" ]
400403 then
@@ -407,7 +410,7 @@ test_remove() · 6 unmodified lines
407410 :>"$server_evts"
408411 ip netns exec "$ns2" ./pm_nl_ctl rem token "$client4_token" id\
409412 $client_addr_id
410− print_test "RM_ADDR id:${client_addr_id} ns2 => ns1"
413+ print_test "RM_ADDR id:client ns2 => ns1"
411414 sleep 0.5
412415 verify_remove_event "$server_evts" "$REMOVED" "$server4_token" "$client_addr_id"
413416
@@ -416,7 +419,7 @@ test_remove() · 2 unmodified lines
416419 client_addr_id=$(( client_addr_id - 1 ))
417420 ip netns exec "$ns2" ./pm_nl_ctl rem token "$client4_token" id\
418421 $client_addr_id
419− print_test "RM_ADDR id:${client_addr_id} ns2 => ns1"
422+ print_test "RM_ADDR id:client-1 ns2 => ns1"
420423 sleep 0.5
421424 verify_remove_event "$server_evts" "$REMOVED" "$server4_token" "$client_addr_id"
422425
@@ -424,7 +427,7 @@ test_remove() · 1 unmodified line
424427 :>"$server_evts"
425428 ip netns exec "$ns2" ./pm_nl_ctl rem token "$client6_token" id\
426429 $client_addr_id
427− print_test "RM_ADDR6 id:${client_addr_id} ns2 => ns1"
430+ print_test "RM_ADDR6 id:client-1 ns2 => ns1"
428431 sleep 0.5
429432 verify_remove_event "$server_evts" "$REMOVED" "$server6_token" "$client_addr_id"
430433
@@ -434,7 +437,7 @@ test_remove() · 3 unmodified lines
434437 # RM_ADDR from the server to client machine
435438 ip netns exec "$ns1" ./pm_nl_ctl rem token "$server4_token" id\
436439 $server_addr_id
437− print_test "RM_ADDR id:${server_addr_id} ns1 => ns2"
440+ print_test "RM_ADDR id:server ns1 => ns2"
438441 sleep 0.5
439442 verify_remove_event "$client_evts" "$REMOVED" "$client4_token" "$server_addr_id"
440443
@@ -443,7 +446,7 @@ test_remove() · 2 unmodified lines
443446 server_addr_id=$(( server_addr_id - 1 ))
444447 ip netns exec "$ns1" ./pm_nl_ctl rem token "$server4_token" id\
445448 $server_addr_id
446− print_test "RM_ADDR id:${server_addr_id} ns1 => ns2"
449+ print_test "RM_ADDR id:server-1 ns1 => ns2"
447450 sleep 0.5
448451 verify_remove_event "$client_evts" "$REMOVED" "$client4_token" "$server_addr_id"
449452
@@ -451,7 +454,7 @@ test_remove() · 1 unmodified line
451454 :>"$client_evts"
452455 ip netns exec "$ns1" ./pm_nl_ctl rem token "$server6_token" id\
453456 $server_addr_id
454− print_test "RM_ADDR6 id:${server_addr_id} ns1 => ns2"
457+ print_test "RM_ADDR6 id:server-1 ns1 => ns2"
455458 sleep 0.5
456459 verify_remove_event "$client_evts" "$REMOVED" "$client6_token" "$server_addr_id"
457460 }
@@ -479,8 +482,14 @@ verify_subflow_events() · 21 unmodified lines
479482 local locid
480483 local remid
481484 local info
485+ local e_dport_txt
482486
483− info="${e_saddr} (${e_from}) => ${e_daddr}:${e_dport} (${e_to})"
487+ # only display the fixed ports
488+ if [ "${e_dport}" -ge "${app4_port}" ] && [ "${e_dport}" -le "${app6_port}" ]; then
489+ e_dport_txt=":${e_dport}"
490+ fi
491+
492+ info="${e_saddr} (${e_from}) => ${e_daddr}${e_dport_txt} (${e_to})"
484493
485494 if [ "$e_type" = "$SUB_ESTABLISHED" ]
486495 then
@@ -766,7 +775,7 @@ test_subflows_v4_v6_mix() · 279 unmodified lines
766775 :>"$client_evts"
767776 ip netns exec "$ns1" ./pm_nl_ctl ann 10.0.2.1 token "$server6_token" id\
768777 $server_addr_id dev ns1eth2
769− print_test "ADD_ADDR4 id:${server_addr_id} 10.0.2.1 (ns1) => ns2, reuse port"
778+ print_test "ADD_ADDR4 id:server 10.0.2.1 (ns1) => ns2, reuse port"
770779 sleep 0.5
771780 verify_announce_event "$client_evts" "$ANNOUNCED" "$client6_token" "10.0.2.1"\
772781 "$server_addr_id" "$app6_port"
@@ -861,7 +870,7 @@ test_listener() · 88 unmodified lines
861870 local listener_pid=$!
862871
863872 sleep 0.5
864− print_test "CREATE_LISTENER 10.0.2.2:$client4_port"
873+ print_test "CREATE_LISTENER 10.0.2.2 (client port)"
865874 verify_listener_events $client_evts $LISTENER_CREATED $AF_INET 10.0.2.2 $client4_port
866875
867876 # ADD_ADDR from client to server machine reusing the subflow port
@@ -878,13 +887,14 @@ test_listener() · 10 unmodified lines
878887 mptcp_lib_kill_wait $listener_pid
879888
880889 sleep 0.5
881− print_test "CLOSE_LISTENER 10.0.2.2:$client4_port"
890+ print_test "CLOSE_LISTENER 10.0.2.2 (client port)"
882891 verify_listener_events $client_evts $LISTENER_CLOSED $AF_INET 10.0.2.2 $client4_port
883892 }
884893
885894 print_title "Make connections"
886895 make_connection
887896 make_connection "v6"
897+print_title "Will be using address IDs ${client_addr_id} (client) and ${server_addr_id} (server)"
888898
889899 test_announce
890900 test_remove
tools/testing/selftests/net/openvswitch/openvswitch.sh+1−1
@@ -1,4 +1,4 @@
1−#!/bin/sh
1+#!/bin/bash
22 # SPDX-License-Identifier: GPL-2.0
33 #
44 # OVS kernel module self tests
tools/testing/selftests/net/openvswitch/ovs-dpctl.py+1−1
@@ -531,7 +531,7 @@ class ovsactions(nla): · 530 unmodified lines
531531 for flat_act in parse_flat_map:
532532 if parse_starts_block(actstr, flat_act[0], False):
533533 actstr = actstr[len(flat_act[0]):]
534− self["attrs"].append([flat_act[1]])
534+ self["attrs"].append([flat_act[1], True])
535535 actstr = actstr[strspn(actstr, ", ") :]
536536 parsed = True
537537
tools/testing/selftests/net/srv6_end_dx4_netfilter_test.sh+335−0
@@ -0,0 +1,335 @@
1+#!/bin/bash
2+# SPDX-License-Identifier: GPL-2.0
3+#
4+# author: Jianguo Wu <wujianguo@chinatelecom.cn>
5+#
6+# Mostly copied from tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh.
7+#
8+# This script is designed for testing the support of netfilter hooks for
9+# SRv6 End.DX4 behavior.
10+#
11+# Hereafter a network diagram is shown, where one tenants (named 100) offer
12+# IPv4 L3 VPN services allowing hosts to communicate with each other across
13+# an IPv6 network.
14+#
15+# Routers rt-1 and rt-2 implement IPv4 L3 VPN services leveraging the SRv6
16+# architecture. The key components for such VPNs are: a) SRv6 Encap behavior,
17+# b) SRv6 End.DX4 behavior.
18+#
19+# To explain how an IPv4 L3 VPN based on SRv6 works, let us briefly consider an
20+# example where, within the same domain of tenant 100, the host hs-1 pings
21+# the host hs-2.
22+#
23+# First of all, L2 reachability of the host hs-2 is taken into account by
24+# the router rt-1 which acts as an arp proxy.
25+#
26+# When the host hs-1 sends an IPv4 packet destined to hs-2, the router rt-1
27+# receives the packet on the internal veth-t100 interface, rt-1 contains the
28+# SRv6 Encap route for encapsulating the IPv4 packet in a IPv6 plus the Segment
29+# Routing Header (SRH) packet. This packet is sent through the (IPv6) core
30+# network up to the router rt-2 that receives it on veth0 interface.
31+#
32+# The rt-2 router uses the 'localsid' routing table to process incoming
33+# IPv6+SRH packets which belong to the VPN of the tenant 100. For each of these
34+# packets, the SRv6 End.DX4 behavior removes the outer IPv6+SRH headers and
35+# routs the packet to the specified nexthop. Afterwards, the packet is sent to
36+# the host hs-2 through the veth-t100 interface.
37+#
38+# The ping response follows the same processing but this time the role of rt-1
39+# and rt-2 are swapped.
40+#
41+# And when net.netfilter.nf_hooks_lwtunnel is set to 1 in rt-1 or rt-2, and a
42+# rpfilter iptables rule is added, SRv6 packets will go through netfilter PREROUTING
43+# hooks.
44+#
45+#
46+# +-------------------+ +-------------------+
47+# | | | |
48+# | hs-1 netns | | hs-2 netns |
49+# | | | |
50+# | +-------------+ | | +-------------+ |
51+# | | veth0 | | | | veth0 | |
52+# | | 10.0.0.1/24 | | | | 10.0.0.2/24 | |
53+# | +-------------+ | | +-------------+ |
54+# | . | | . |
55+# +-------------------+ +-------------------+
56+# . .
57+# . .
58+# . .
59+# +-----------------------------------+ +-----------------------------------+
60+# | . | | . |
61+# | +---------------+ | | +---------------- |
62+# | | veth-t100 | | | | veth-t100 | |
63+# | | 10.0.0.11/24 | +----------+ | | +----------+ | 10.0.0.22/24 | |
64+# | +-------+-------+ | route | | | | route | +-------+-------- |
65+# | | table | | | | table | |
66+# | +----------+ | | +----------+ |
67+# | +--------------+ | | +--------------+ |
68+# | | veth0 | | | | veth0 | |
69+# | | 2001:11::1/64 |.|...|.| 2001:11::2/64 | |
70+# | +--------------+ | | +--------------+ |
71+# | | | |
72+# | rt-1 netns | | rt-2 netns |
73+# | | | |
74+# +-----------------------------------+ +-----------------------------------+
75+#
76+# ~~~~~~~~~~~~~~~~~~~~~~~~~
77+# | Network configuration |
78+# ~~~~~~~~~~~~~~~~~~~~~~~~~
79+#
80+# rt-1: localsid table
81+# +----------------------------------------------------------------+
82+# |SID |Action |
83+# +----------------------------------------------------------------+
84+# |fc00:21:100::6004|apply SRv6 End.DX4 nh4 10.0.0.1 dev veth-t100 |
85+# +----------------------------------------------------------------+
86+#
87+# rt-1: route table
88+# +---------------------------------------------------+
89+# |host |Action |
90+# +---------------------------------------------------+
91+# |10.0.0.2 |apply seg6 encap segs fc00:12:100::6004|
92+# +---------------------------------------------------+
93+# |10.0.0.0/24|forward to dev veth_t100 |
94+# +---------------------------------------------------+
95+#
96+#
97+# rt-2: localsid table
98+# +---------------------------------------------------------------+
99+# |SID |Action |
100+# +---------------------------------------------------------------+
101+# |fc00:12:100::6004|apply SRv6 End.DX4 nh4 10.0.0.2 dev veth-t100|
102+# +---------------------------------------------------------------+
103+#
104+# rt-2: route table
105+# +---------------------------------------------------+
106+# |host |Action |
107+# +---------------------------------------------------+
108+# |10.0.0.1 |apply seg6 encap segs fc00:21:100::6004|
109+# +---------------------------------------------------+
110+# |10.0.0.0/24|forward to dev veth_t100 |
111+# +---------------------------------------------------+
112+#
113+
114+# Kselftest framework requirement - SKIP code is 4.
115+ksft_skip=4
116+
117+readonly IPv6_RT_NETWORK=2001:11
118+readonly IPv4_HS_NETWORK=10.0.0
119+readonly SID_LOCATOR=fc00
120+
121+PING_TIMEOUT_SEC=4
122+
123+ret=0
124+
125+PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
126+
127+log_test()
128+{
129+ local rc=$1
130+ local expected=$2
131+ local msg="$3"
132+
133+ if [ ${rc} -eq ${expected} ]; then
134+ nsuccess=$((nsuccess+1))
135+ printf "\n TEST: %-60s [ OK ]\n" "${msg}"
136+ else
137+ ret=1
138+ nfail=$((nfail+1))
139+ printf "\n TEST: %-60s [FAIL]\n" "${msg}"
140+ if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
141+ echo
142+ echo "hit enter to continue, 'q' to quit"
143+ read a
144+ [ "$a" = "q" ] && exit 1
145+ fi
146+ fi
147+}
148+
149+print_log_test_results()
150+{
151+ if [ "$TESTS" != "none" ]; then
152+ printf "\nTests passed: %3d\n" ${nsuccess}
153+ printf "Tests failed: %3d\n" ${nfail}
154+ fi
155+}
156+
157+log_section()
158+{
159+ echo
160+ echo "################################################################################"
161+ echo "TEST SECTION: $*"
162+ echo "################################################################################"
163+}
164+
165+cleanup()
166+{
167+ ip link del veth-rt-1 2>/dev/null || true
168+ ip link del veth-rt-2 2>/dev/null || true
169+
170+ # destroy routers rt-* and hosts hs-*
171+ for ns in $(ip netns show | grep -E 'rt-*|hs-*'); do
172+ ip netns del ${ns} || true
173+ done
174+}
175+
176+# Setup the basic networking for the routers
177+setup_rt_networking()
178+{
179+ local rt=$1
180+ local nsname=rt-${rt}
181+
182+ ip netns add ${nsname}
183+
184+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.accept_dad=0
185+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.default.accept_dad=0
186+
187+ ip link set veth-rt-${rt} netns ${nsname}
188+ ip -netns ${nsname} link set veth-rt-${rt} name veth0
189+
190+ ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 nodad
191+ ip -netns ${nsname} link set veth0 up
192+ ip -netns ${nsname} link set lo up
193+
194+ ip netns exec ${nsname} sysctl -wq net.ipv4.ip_forward=1
195+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.forwarding=1
196+}
197+
198+setup_rt_netfilter()
199+{
200+ local rt=$1
201+ local nsname=rt-${rt}
202+
203+ ip netns exec ${nsname} sysctl -wq net.netfilter.nf_hooks_lwtunnel=1
204+ ip netns exec ${nsname} iptables -t raw -A PREROUTING -m rpfilter --invert -j DROP
205+}
206+
207+setup_hs()
208+{
209+ local hs=$1
210+ local rt=$2
211+ local tid=$3
212+ local hsname=hs-${hs}
213+ local rtname=rt-${rt}
214+ local rtveth=veth-t${tid}
215+
216+ # set the networking for the host
217+ ip netns add ${hsname}
218+
219+ ip -netns ${hsname} link add veth0 type veth peer name ${rtveth}
220+ ip -netns ${hsname} link set ${rtveth} netns ${rtname}
221+ ip -netns ${hsname} addr add ${IPv4_HS_NETWORK}.${hs}/24 dev veth0
222+ ip -netns ${hsname} link set veth0 up
223+ ip -netns ${hsname} link set lo up
224+
225+ ip -netns ${rtname} addr add ${IPv4_HS_NETWORK}.${rt}${hs}/24 dev ${rtveth}
226+ ip -netns ${rtname} link set ${rtveth} up
227+
228+ ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.proxy_arp=1
229+}
230+
231+setup_vpn_config()
232+{
233+ local hssrc=$1
234+ local rtsrc=$2
235+ local hsdst=$3
236+ local rtdst=$4
237+ local tid=$5
238+
239+ local hssrc_name=hs-t${tid}-${hssrc}
240+ local hsdst_name=hs-t${tid}-${hsdst}
241+ local rtsrc_name=rt-${rtsrc}
242+ local rtdst_name=rt-${rtdst}
243+ local vpn_sid=${SID_LOCATOR}:${hssrc}${hsdst}:${tid}::6004
244+
245+ # set the encap route for encapsulating packets which arrive from the
246+ # host hssrc and destined to the access router rtsrc.
247+ ip -netns ${rtsrc_name} -4 route add ${IPv4_HS_NETWORK}.${hsdst}/32 \
248+ encap seg6 mode encap segs ${vpn_sid} dev veth0
249+ ip -netns ${rtsrc_name} -6 route add ${vpn_sid}/128 \
250+ via 2001:11::${rtdst} dev veth0
251+
252+ # set the decap route for decapsulating packets which arrive from
253+ # the rtdst router and destined to the hsdst host.
254+ ip -netns ${rtdst_name} -6 route add ${vpn_sid}/128 \
255+ encap seg6local action End.DX4 nh4 ${IPv4_HS_NETWORK}.${hsdst} dev veth-t${tid}
256+}
257+
258+setup()
259+{
260+ ip link add veth-rt-1 type veth peer name veth-rt-2
261+ # setup the networking for router rt-1 and router rt-2
262+ setup_rt_networking 1
263+ setup_rt_networking 2
264+
265+ # setup two hosts for the tenant 100.
266+ # - host hs-1 is directly connected to the router rt-1;
267+ # - host hs-2 is directly connected to the router rt-2.
268+ setup_hs 1 1 100
269+ setup_hs 2 2 100
270+
271+ # setup the IPv4 L3 VPN which connects the host hs-1 and host hs-2.
272+ setup_vpn_config 1 1 2 2 100 #args: src_host src_router dst_host dst_router tenant
273+ setup_vpn_config 2 2 1 1 100
274+}
275+
276+check_hs_connectivity()
277+{
278+ local hssrc=$1
279+ local hsdst=$2
280+ local tid=$3
281+
282+ ip netns exec hs-${hssrc} ping -c 1 -W ${PING_TIMEOUT_SEC} \
283+ ${IPv4_HS_NETWORK}.${hsdst} >/dev/null 2>&1
284+}
285+
286+check_and_log_hs_connectivity()
287+{
288+ local hssrc=$1
289+ local hsdst=$2
290+ local tid=$3
291+
292+ check_hs_connectivity ${hssrc} ${hsdst} ${tid}
293+ log_test $? 0 "Hosts connectivity: hs-${hssrc} -> hs-${hsdst} (tenant ${tid})"
294+}
295+
296+host_tests()
297+{
298+ log_section "SRv6 VPN connectivity test among hosts in the same tenant"
299+
300+ check_and_log_hs_connectivity 1 2 100
301+ check_and_log_hs_connectivity 2 1 100
302+}
303+
304+router_netfilter_tests()
305+{
306+ log_section "SRv6 VPN connectivity test with netfilter enabled in routers"
307+ setup_rt_netfilter 1
308+ setup_rt_netfilter 2
309+
310+ check_and_log_hs_connectivity 1 2 100
311+ check_and_log_hs_connectivity 2 1 100
312+}
313+
314+if [ "$(id -u)" -ne 0 ];then
315+ echo "SKIP: Need root privileges"
316+ exit $ksft_skip
317+fi
318+
319+if [ ! -x "$(command -v ip)" ]; then
320+ echo "SKIP: Could not run test without ip tool"
321+ exit $ksft_skip
322+fi
323+
324+cleanup &>/dev/null
325+
326+setup
327+
328+host_tests
329+router_netfilter_tests
330+
331+print_log_test_results
332+
333+cleanup &>/dev/null
334+
335+exit ${ret}
tools/testing/selftests/net/srv6_end_dx6_netfilter_test.sh+340−0
@@ -0,0 +1,340 @@
1+#!/bin/bash
2+# SPDX-License-Identifier: GPL-2.0
3+#
4+# author: Jianguo Wu <wujianguo@chinatelecom.cn>
5+#
6+# Mostly copied from tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh.
7+#
8+# This script is designed for testing the support of netfilter hooks for
9+# SRv6 End.DX4 behavior.
10+#
11+# Hereafter a network diagram is shown, where one tenants (named 100) offer
12+# IPv6 L3 VPN services allowing hosts to communicate with each other across
13+# an IPv6 network.
14+#
15+# Routers rt-1 and rt-2 implement IPv6 L3 VPN services leveraging the SRv6
16+# architecture. The key components for such VPNs are: a) SRv6 Encap behavior,
17+# b) SRv6 End.DX4 behavior.
18+#
19+# To explain how an IPv6 L3 VPN based on SRv6 works, let us briefly consider an
20+# example where, within the same domain of tenant 100, the host hs-1 pings
21+# the host hs-2.
22+#
23+# First of all, L2 reachability of the host hs-2 is taken into account by
24+# the router rt-1 which acts as an arp proxy.
25+#
26+# When the host hs-1 sends an IPv6 packet destined to hs-2, the router rt-1
27+# receives the packet on the internal veth-t100 interface, rt-1 contains the
28+# SRv6 Encap route for encapsulating the IPv6 packet in a IPv6 plus the Segment
29+# Routing Header (SRH) packet. This packet is sent through the (IPv6) core
30+# network up to the router rt-2 that receives it on veth0 interface.
31+#
32+# The rt-2 router uses the 'localsid' routing table to process incoming
33+# IPv6+SRH packets which belong to the VPN of the tenant 100. For each of these
34+# packets, the SRv6 End.DX4 behavior removes the outer IPv6+SRH headers and
35+# routs the packet to the specified nexthop. Afterwards, the packet is sent to
36+# the host hs-2 through the veth-t100 interface.
37+#
38+# The ping response follows the same processing but this time the role of rt-1
39+# and rt-2 are swapped.
40+#
41+# And when net.netfilter.nf_hooks_lwtunnel is set to 1 in rt-1 or rt-2, and a
42+# rpfilter iptables rule is added, SRv6 packets will go through netfilter PREROUTING
43+# hooks.
44+#
45+#
46+# +-------------------+ +-------------------+
47+# | | | |
48+# | hs-1 netns | | hs-2 netns |
49+# | | | |
50+# | +-------------+ | | +-------------+ |
51+# | | veth0 | | | | veth0 | |
52+# | | cafe::1/64 | | | | cafe::2/64 | |
53+# | +-------------+ | | +-------------+ |
54+# | . | | . |
55+# +-------------------+ +-------------------+
56+# . .
57+# . .
58+# . .
59+# +-----------------------------------+ +-----------------------------------+
60+# | . | | . |
61+# | +---------------+ | | +---------------- |
62+# | | veth-t100 | | | | veth-t100 | |
63+# | | cafe::11/64 | +----------+ | | +----------+ | cafe::22/64 | |
64+# | +-------+-------+ | route | | | | route | +-------+-------- |
65+# | | table | | | | table | |
66+# | +----------+ | | +----------+ |
67+# | +--------------+ | | +--------------+ |
68+# | | veth0 | | | | veth0 | |
69+# | | 2001:11::1/64 |.|...|.| 2001:11::2/64 | |
70+# | +--------------+ | | +--------------+ |
71+# | | | |
72+# | rt-1 netns | | rt-2 netns |
73+# | | | |
74+# +-----------------------------------+ +-----------------------------------+
75+#
76+# ~~~~~~~~~~~~~~~~~~~~~~~~~
77+# | Network configuration |
78+# ~~~~~~~~~~~~~~~~~~~~~~~~~
79+#
80+# rt-1: localsid table
81+# +----------------------------------------------------------------+
82+# |SID |Action |
83+# +----------------------------------------------------------------+
84+# |fc00:21:100::6004|apply SRv6 End.DX6 nh6 cafe::1 dev veth-t100 |
85+# +----------------------------------------------------------------+
86+#
87+# rt-1: route table
88+# +---------------------------------------------------+
89+# |host |Action |
90+# +---------------------------------------------------+
91+# |cafe::2 |apply seg6 encap segs fc00:12:100::6004|
92+# +---------------------------------------------------+
93+# |cafe::/64 |forward to dev veth_t100 |
94+# +---------------------------------------------------+
95+#
96+#
97+# rt-2: localsid table
98+# +---------------------------------------------------------------+
99+# |SID |Action |
100+# +---------------------------------------------------------------+
101+# |fc00:12:100::6004|apply SRv6 End.DX6 nh6 cafe::2 dev veth-t100 |
102+# +---------------------------------------------------------------+
103+#
104+# rt-2: route table
105+# +---------------------------------------------------+
106+# |host |Action |
107+# +---------------------------------------------------+
108+# |cafe::1 |apply seg6 encap segs fc00:21:100::6004|
109+# +---------------------------------------------------+
110+# |cafe::/64 |forward to dev veth_t100 |
111+# +---------------------------------------------------+
112+#
113+
114+# Kselftest framework requirement - SKIP code is 4.
115+ksft_skip=4
116+
117+readonly IPv6_RT_NETWORK=2001:11
118+readonly IPv6_HS_NETWORK=cafe
119+readonly SID_LOCATOR=fc00
120+
121+PING_TIMEOUT_SEC=4
122+
123+ret=0
124+
125+PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
126+
127+log_test()
128+{
129+ local rc=$1
130+ local expected=$2
131+ local msg="$3"
132+
133+ if [ ${rc} -eq ${expected} ]; then
134+ nsuccess=$((nsuccess+1))
135+ printf "\n TEST: %-60s [ OK ]\n" "${msg}"
136+ else
137+ ret=1
138+ nfail=$((nfail+1))
139+ printf "\n TEST: %-60s [FAIL]\n" "${msg}"
140+ if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
141+ echo
142+ echo "hit enter to continue, 'q' to quit"
143+ read a
144+ [ "$a" = "q" ] && exit 1
145+ fi
146+ fi
147+}
148+
149+print_log_test_results()
150+{
151+ if [ "$TESTS" != "none" ]; then
152+ printf "\nTests passed: %3d\n" ${nsuccess}
153+ printf "Tests failed: %3d\n" ${nfail}
154+ fi
155+}
156+
157+log_section()
158+{
159+ echo
160+ echo "################################################################################"
161+ echo "TEST SECTION: $*"
162+ echo "################################################################################"
163+}
164+
165+cleanup()
166+{
167+ ip link del veth-rt-1 2>/dev/null || true
168+ ip link del veth-rt-2 2>/dev/null || true
169+
170+ # destroy routers rt-* and hosts hs-*
171+ for ns in $(ip netns show | grep -E 'rt-*|hs-*'); do
172+ ip netns del ${ns} || true
173+ done
174+}
175+
176+# Setup the basic networking for the routers
177+setup_rt_networking()
178+{
179+ local rt=$1
180+ local nsname=rt-${rt}
181+
182+ ip netns add ${nsname}
183+
184+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.accept_dad=0
185+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.default.accept_dad=0
186+
187+ ip link set veth-rt-${rt} netns ${nsname}
188+ ip -netns ${nsname} link set veth-rt-${rt} name veth0
189+
190+ ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 nodad
191+ ip -netns ${nsname} link set veth0 up
192+ ip -netns ${nsname} link set lo up
193+
194+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.forwarding=1
195+}
196+
197+setup_rt_netfilter()
198+{
199+ local rt=$1
200+ local nsname=rt-${rt}
201+
202+ ip netns exec ${nsname} sysctl -wq net.netfilter.nf_hooks_lwtunnel=1
203+ ip netns exec ${nsname} ip6tables -t raw -A PREROUTING -m rpfilter --invert -j DROP
204+}
205+
206+setup_hs()
207+{
208+ local hs=$1
209+ local rt=$2
210+ local tid=$3
211+ local hsname=hs-${hs}
212+ local rtname=rt-${rt}
213+ local rtveth=veth-t${tid}
214+
215+ # set the networking for the host
216+ ip netns add ${hsname}
217+
218+ ip -netns ${hsname} link add veth0 type veth peer name ${rtveth}
219+ ip -netns ${hsname} link set ${rtveth} netns ${rtname}
220+ ip -netns ${hsname} addr add ${IPv6_HS_NETWORK}::${hs}/64 dev veth0 nodad
221+ ip -netns ${hsname} link set veth0 up
222+ ip -netns ${hsname} link set lo up
223+
224+ ip -netns ${rtname} addr add ${IPv6_HS_NETWORK}::${rt}${hs}/64 dev ${rtveth}
225+ ip -netns ${rtname} link set ${rtveth} up
226+
227+ ip netns exec ${rtname} sysctl -wq net.ipv6.conf.all.accept_dad=0
228+ ip netns exec ${rtname} sysctl -wq net.ipv6.conf.default.accept_dad=0
229+
230+ ip netns exec ${rtname} sysctl -wq net.ipv6.conf.${rtveth}.proxy_ndp=1
231+}
232+
233+setup_vpn_config()
234+{
235+ local hssrc=$1
236+ local rtsrc=$2
237+ local hsdst=$3
238+ local rtdst=$4
239+ local tid=$5
240+
241+ local hssrc_name=hs-t${tid}-${hssrc}
242+ local hsdst_name=hs-t${tid}-${hsdst}
243+ local rtsrc_name=rt-${rtsrc}
244+ local rtdst_name=rt-${rtdst}
245+ local rtveth=veth-t${tid}
246+ local vpn_sid=${SID_LOCATOR}:${hssrc}${hsdst}:${tid}::6004
247+
248+ ip -netns ${rtsrc_name} -6 neigh add proxy ${IPv6_HS_NETWORK}::${hsdst} dev ${rtveth}
249+
250+ # set the encap route for encapsulating packets which arrive from the
251+ # host hssrc and destined to the access router rtsrc.
252+ ip -netns ${rtsrc_name} -6 route add ${IPv6_HS_NETWORK}::${hsdst}/128 \
253+ encap seg6 mode encap segs ${vpn_sid} dev veth0
254+ ip -netns ${rtsrc_name} -6 route add ${vpn_sid}/128 \
255+ via 2001:11::${rtdst} dev veth0
256+
257+ # set the decap route for decapsulating packets which arrive from
258+ # the rtdst router and destined to the hsdst host.
259+ ip -netns ${rtdst_name} -6 route add ${vpn_sid}/128 \
260+ encap seg6local action End.DX6 nh6 ${IPv6_HS_NETWORK}::${hsdst} dev veth-t${tid}
261+}
262+
263+setup()
264+{
265+ ip link add veth-rt-1 type veth peer name veth-rt-2
266+ # setup the networking for router rt-1 and router rt-2
267+ setup_rt_networking 1
268+ setup_rt_networking 2
269+
270+ # setup two hosts for the tenant 100.
271+ # - host hs-1 is directly connected to the router rt-1;
272+ # - host hs-2 is directly connected to the router rt-2.
273+ setup_hs 1 1 100
274+ setup_hs 2 2 100
275+
276+ # setup the IPv4 L3 VPN which connects the host hs-1 and host hs-2.
277+ setup_vpn_config 1 1 2 2 100 #args: src_host src_router dst_host dst_router tenant
278+ setup_vpn_config 2 2 1 1 100
279+}
280+
281+check_hs_connectivity()
282+{
283+ local hssrc=$1
284+ local hsdst=$2
285+ local tid=$3
286+
287+ ip netns exec hs-${hssrc} ping -6 -c 1 -W ${PING_TIMEOUT_SEC} \
288+ ${IPv6_HS_NETWORK}::${hsdst} >/dev/null 2>&1
289+}
290+
291+check_and_log_hs_connectivity()
292+{
293+ local hssrc=$1
294+ local hsdst=$2
295+ local tid=$3
296+
297+ check_hs_connectivity ${hssrc} ${hsdst} ${tid}
298+ log_test $? 0 "Hosts connectivity: hs-${hssrc} -> hs-${hsdst} (tenant ${tid})"
299+}
300+
301+host_tests()
302+{
303+ log_section "SRv6 VPN connectivity test among hosts in the same tenant"
304+
305+ check_and_log_hs_connectivity 1 2 100
306+ check_and_log_hs_connectivity 2 1 100
307+}
308+
309+router_netfilter_tests()
310+{
311+ log_section "SRv6 VPN connectivity test with netfilter enabled in routers"
312+ setup_rt_netfilter 1
313+ setup_rt_netfilter 2
314+
315+ check_and_log_hs_connectivity 1 2 100
316+ check_and_log_hs_connectivity 2 1 100
317+}
318+
319+if [ "$(id -u)" -ne 0 ];then
320+ echo "SKIP: Need root privileges"
321+ exit $ksft_skip
322+fi
323+
324+if [ ! -x "$(command -v ip)" ]; then
325+ echo "SKIP: Could not run test without ip tool"
326+ exit $ksft_skip
327+fi
328+
329+cleanup &>/dev/null
330+
331+setup
332+
333+host_tests
334+router_netfilter_tests
335+
336+print_log_test_results
337+
338+cleanup &>/dev/null
339+
340+exit ${ret}
tools/testing/selftests/openat2/Makefile+12−2
@@ -1,8 +1,18 @@
11 # SPDX-License-Identifier: GPL-2.0-or-later
22
3−CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan
3+CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined
44 TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test
55
6+# gcc requires -static-libasan in order to ensure that Address Sanitizer's
7+# library is the first one loaded. However, clang already statically links the
8+# Address Sanitizer if -fsanitize is specified. Therefore, simply omit
9+# -static-libasan for clang builds.
10+ifeq ($(LLVM),)
11+ CFLAGS += -static-libasan
12+endif
13+
14+LOCAL_HDRS += helpers.h
15+
616 include ../lib.mk
717
8−$(TEST_GEN_PROGS): helpers.c helpers.h
18+$(TEST_GEN_PROGS): helpers.c
tools/testing/selftests/seccomp/seccomp_benchmark.c+3−3
@@ -194,14 +194,14 @@ int main(int argc, char *argv[]) · 193 unmodified lines
194194 ksft_set_plan(7);
195195
196196 ksft_print_msg("Running on:\n");
197− ksft_print_msg("");
197+ ksft_print_msg("%s", "");
198198 system("uname -a");
199199
200200 ksft_print_msg("Current BPF sysctl settings:\n");
201201 /* Avoid using "sysctl" which may not be installed. */
202− ksft_print_msg("");
202+ ksft_print_msg("%s", "");
203203 system("grep -H . /proc/sys/net/core/bpf_jit_enable");
204− ksft_print_msg("");
204+ ksft_print_msg("%s", "");
205205 system("grep -H . /proc/sys/net/core/bpf_jit_harden");
206206
207207 affinity();
virt/kvm/dirty_ring.c+3−0
@@ -55,6 +55,9 @@ static void kvm_reset_dirty_gfn(struct kvm *kvm, u32 slot, u64 offset, u64 mask) · 54 unmodified lines
5555 struct kvm_memory_slot *memslot;
5656 int as_id, id;
5757
58+ if (!mask)
59+ return;
60+
5861 as_id = slot >> 16;
5962 id = (u16)slot;
6063
virt/kvm/guest_memfd.c+3−2
@@ -510,8 +510,10 @@ int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot, · 509 unmodified lines
510510 }
511511
512512 if (folio_test_hwpoison(folio)) {
513+ folio_unlock(folio);
514+ folio_put(folio);
513515 r = -EHWPOISON;
514− goto out_unlock;
516+ goto out_fput;
515517 }
516518
517519 page = folio_file_page(folio, index);
@@ -522,7 +524,6 @@ int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot, · 4 unmodified lines
522524
523525 r = 0;
524526
525−out_unlock:
526527 folio_unlock(folio);
527528 out_fput:
528529 fput(file);
virt/kvm/kvm_main.c+10−9
@@ -651,7 +651,7 @@ static __always_inline kvm_mn_ret_t __kvm_handle_hva_range(struct kvm *kvm, · 650 unmodified lines
651651 range->on_lock(kvm);
652652
653653 if (IS_KVM_NULL_FN(range->handler))
654− break;
654+ goto mmu_unlock;
655655 }
656656 r.ret |= range->handler(kvm, &gfn_range);
657657 }
@@ -660,6 +660,7 @@ static __always_inline kvm_mn_ret_t __kvm_handle_hva_range(struct kvm *kvm, · 2 unmodified lines
660660 if (range->flush_on_ret && r.ret)
661661 kvm_flush_remote_tlbs(kvm);
662662
663+mmu_unlock:
663664 if (r.found_memslot)
664665 KVM_MMU_UNLOCK(kvm);
665666
@@ -4025,12 +4026,13 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me, bool yield_to_kernel_mode) · 3359 unmodified lines
40254026 {
40264027 struct kvm *kvm = me->kvm;
40274028 struct kvm_vcpu *vcpu;
4028− int last_boosted_vcpu = me->kvm->last_boosted_vcpu;
4029+ int last_boosted_vcpu;
40294030 unsigned long i;
40304031 int yielded = 0;
40314032 int try = 3;
40324033 int pass;
40334034
4035+ last_boosted_vcpu = READ_ONCE(kvm->last_boosted_vcpu);
40344036 kvm_vcpu_set_in_spin_loop(me, true);
40354037 /*
40364038 * We boost the priority of a VCPU that is runnable but not
@@ -4068,7 +4070,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me, bool yield_to_kernel_mode) · 31 unmodified lines
40684070
40694071 yielded = kvm_vcpu_yield_to(vcpu);
40704072 if (yielded > 0) {
4071− kvm->last_boosted_vcpu = i;
4073+ WRITE_ONCE(kvm->last_boosted_vcpu, i);
40724074 break;
40734075 } else if (yielded < 0) {
40744076 try--;
@@ -4427,7 +4429,7 @@ static long kvm_vcpu_ioctl(struct file *filp, · 352 unmodified lines
44274429 struct kvm_regs *kvm_regs;
44284430
44294431 r = -ENOMEM;
4430− kvm_regs = kzalloc(sizeof(struct kvm_regs), GFP_KERNEL_ACCOUNT);
4432+ kvm_regs = kzalloc(sizeof(struct kvm_regs), GFP_KERNEL);
44314433 if (!kvm_regs)
44324434 goto out;
44334435 r = kvm_arch_vcpu_ioctl_get_regs(vcpu, kvm_regs);
@@ -4454,8 +4456,7 @@ out_free1: · 20 unmodified lines
44544456 break;
44554457 }
44564458 case KVM_GET_SREGS: {
4457− kvm_sregs = kzalloc(sizeof(struct kvm_sregs),
4458− GFP_KERNEL_ACCOUNT);
4459+ kvm_sregs = kzalloc(sizeof(struct kvm_sregs), GFP_KERNEL);
44594460 r = -ENOMEM;
44604461 if (!kvm_sregs)
44614462 goto out;
@@ -4547,7 +4548,7 @@ out_free1: · 85 unmodified lines
45474548 break;
45484549 }
45494550 case KVM_GET_FPU: {
4550− fpu = kzalloc(sizeof(struct kvm_fpu), GFP_KERNEL_ACCOUNT);
4551+ fpu = kzalloc(sizeof(struct kvm_fpu), GFP_KERNEL);
45514552 r = -ENOMEM;
45524553 if (!fpu)
45534554 goto out;
@@ -6210,7 +6211,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm) · 1656 unmodified lines
62106211 active = kvm_active_vms;
62116212 mutex_unlock(&kvm_lock);
62126213
6213− env = kzalloc(sizeof(*env), GFP_KERNEL_ACCOUNT);
6214+ env = kzalloc(sizeof(*env), GFP_KERNEL);
62146215 if (!env)
62156216 return;
62166217
@@ -6226,7 +6227,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm) · 9 unmodified lines
62266227 add_uevent_var(env, "PID=%d", kvm->userspace_pid);
62276228
62286229 if (!IS_ERR(kvm->debugfs_dentry)) {
6229− char *tmp, *p = kmalloc(PATH_MAX, GFP_KERNEL_ACCOUNT);
6230+ char *tmp, *p = kmalloc(PATH_MAX, GFP_KERNEL);
62306231
62316232 if (p) {
62326233 tmp = dentry_path_raw(kvm->debugfs_dentry, p, PATH_MAX);