History

Backmerge v6.12-rc6 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next

Backmerge Linus tree for some drm-fixes needed for msm and xe merges.

Dave Airlie committed 2 years ago

Commit 30169bb2 parents bcfe43f 59b723c1329 files · +18685 −12595Browse files

Unified · Split

1329 files
  1. .mailmap +14 −2
  2. CREDITS +27 −27
  3. Documentation/admin-guide/LSM/ipe.rst +5 −2
  4. Documentation/admin-guide/pm/cpufreq.rst +10 −10
  5. Documentation/core-api/protection-keys.rst +30 −8
  6. Documentation/devicetree/bindings/display/elgin,jg10309-01.yaml +54 −0
  7. Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml +10 −14
  8. Documentation/devicetree/bindings/display/mediatek/mediatek,split.yaml +19 −0
  9. Documentation/devicetree/bindings/iio/adc/adi,ad7380.yaml +21 −0
  10. Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml +17 −36
  11. Documentation/devicetree/bindings/iio/dac/adi,ad5696.yaml +2 −1
  12. Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml +23 −3
  13. Documentation/devicetree/bindings/misc/fsl,qoriq-mc.yaml +1 −1
  14. Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml +1 −0
  15. Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml +3 −2
  16. Documentation/devicetree/bindings/sound/davinci-mcasp-audio.yaml +9 −9
  17. Documentation/devicetree/bindings/sound/rockchip,rk3308-codec.yaml +4 −0
  18. Documentation/devicetree/bindings/trivial-devices.yaml +0 −2
  19. Documentation/filesystems/caching/cachefiles.rst +1 −1
  20. Documentation/filesystems/iomap/operations.rst +1 −1
  21. Documentation/filesystems/netfs_library.rst +0 −1
  22. Documentation/iio/ad7380.rst +11 −2
  23. Documentation/mm/damon/maintainer-profile.rst +19 −19
  24. Documentation/networking/packet_mmap.rst +3 −2
  25. Documentation/networking/tcp_ao.rst +10 −10
  26. Documentation/process/maintainer-netdev.rst +17 −0
  27. Documentation/process/maintainer-soc.rst +37 −5
  28. Documentation/rust/arch-support.rst +1 −1
  29. Documentation/scheduler/sched-ext.rst +1 −1
  30. Documentation/userspace-api/mseal.rst +148 −159
  31. Documentation/virt/kvm/api.rst +9 −7
  32. Documentation/virt/kvm/locking.rst +1 −1
  33. MAINTAINERS +63 −147
  34. Makefile +1 −1
  35. arch/Kconfig +12 −14
  36. arch/arm/boot/dts/broadcom/bcm2837-rpi-cm3-io3.dts +1 −1
  37. arch/arm64/boot/dts/marvell/cn9130-sr-som.dtsi +1 −1
  38. arch/arm64/include/asm/kvm_asm.h +1 −0
  39. arch/arm64/include/asm/kvm_host.h +7 −0
  40. arch/arm64/include/asm/kvm_mmu.h +2 −1
  41. arch/arm64/include/asm/kvm_nested.h +3 −1
  42. arch/arm64/include/asm/uprobes.h +3 −5
  43. arch/arm64/kernel/asm-offsets.c +1 −0
  44. arch/arm64/kernel/probes/decode-insn.c +11 −5
  45. arch/arm64/kernel/probes/simulate-insn.c +7 −11
  46. arch/arm64/kernel/probes/uprobes.c +2 −2
  47. arch/arm64/kernel/process.c +3 −0
  48. arch/arm64/kernel/signal.c +78 −14
  49. arch/arm64/kvm/arm.c +5 −0
  50. arch/arm64/kvm/hyp/nvhe/hyp-init.S +29 −23
  51. arch/arm64/kvm/hypercalls.c +6 −6
  52. arch/arm64/kvm/mmu.c +8 −7
  53. arch/arm64/kvm/nested.c +46 −7
  54. arch/arm64/kvm/sys_regs.c +70 −7
  55. arch/arm64/kvm/vgic/vgic-init.c +35 −6
  56. arch/arm64/kvm/vgic/vgic-kvm-device.c +6 −1
  57. arch/arm64/net/bpf_jit_comp.c +10 −2
  58. arch/loongarch/include/asm/bootinfo.h +4 −0
  59. arch/loongarch/include/asm/kasan.h +1 −1
  60. arch/loongarch/include/asm/loongarch.h +1 −1
  61. arch/loongarch/include/asm/pgalloc.h +11 −0
  62. arch/loongarch/include/asm/pgtable.h +7 −28
  63. arch/loongarch/kernel/process.c +9 −7
  64. arch/loongarch/kernel/setup.c +2 −1
  65. arch/loongarch/kernel/traps.c +5 −0
  66. arch/loongarch/kernel/vdso.c +4 −4
  67. arch/loongarch/kvm/timer.c +4 −3
  68. arch/loongarch/kvm/vcpu.c +1 −1
  69. arch/loongarch/mm/init.c +2 −0
  70. arch/loongarch/mm/pgtable.c +20 −0
  71. arch/mips/kernel/cmpxchg.c +1 −0
  72. arch/powerpc/kernel/head_8xx.S +1 −0
  73. arch/powerpc/platforms/powernv/opal-irqchip.c +1 −0
  74. arch/riscv/Kconfig +1 −1
  75. arch/riscv/errata/Makefile +6 −0
  76. arch/riscv/kernel/Makefile +5 −0
  77. arch/riscv/kernel/acpi.c +2 −2
  78. arch/riscv/kernel/asm-offsets.c +0 −2
  79. arch/riscv/kernel/cacheinfo.c +5 −2
  80. arch/riscv/kernel/cpu-hotplug.c +1 −1
  81. arch/riscv/kernel/efi-header.S +1 −1
  82. arch/riscv/kernel/pi/Makefile +5 −1
  83. arch/riscv/kernel/traps_misaligned.c +0 −2
  84. arch/riscv/kernel/vdso/Makefile +1 −0
  85. arch/riscv/kvm/aia_imsic.c +4 −4
  86. arch/riscv/net/bpf_jit_comp64.c +5 −3
  87. arch/s390/configs/debug_defconfig +11 −2
  88. arch/s390/configs/defconfig +12 −2
  89. arch/s390/configs/zfcpdump_defconfig +1 −0
  90. arch/s390/include/asm/io.h +2 −0
  91. arch/s390/include/asm/perf_event.h +1 −0
  92. arch/s390/kvm/diag.c +1 −1
  93. arch/s390/kvm/gaccess.c +4 −0
  94. arch/s390/kvm/gaccess.h +8 −6
  95. arch/s390/pci/pci_event.c +9 −8
  96. arch/x86/Kconfig +1 −0
  97. arch/x86/entry/entry.S +5 −0
  98. arch/x86/entry/entry_32.S +4 −2
  99. arch/x86/include/asm/amd_nb.h +4 −1
  100. arch/x86/include/asm/cpufeatures.h +3 −1
  101. arch/x86/include/asm/nospec-branch.h +10 −1
  102. arch/x86/include/asm/runtime-const.h +2 −2
  103. arch/x86/include/asm/uaccess_64.h +24 −19
  104. arch/x86/kernel/amd_nb.c +2 −0
  105. arch/x86/kernel/apic/apic.c +13 −1
  106. arch/x86/kernel/cpu/amd.c +2 −1
  107. arch/x86/kernel/cpu/bugs.c +32 −0
  108. arch/x86/kernel/cpu/common.c +13 −0
  109. arch/x86/kernel/cpu/microcode/amd.c +35 −16
  110. arch/x86/kernel/cpu/resctrl/core.c +2 −2
  111. arch/x86/kernel/cpu/resctrl/ctrlmondata.c +14 −9
  112. arch/x86/kernel/kvm.c +4 −0
  113. arch/x86/kernel/traps.c +6 −6
  114. arch/x86/kernel/vmlinux.lds.S +1 −0
  115. arch/x86/kvm/mmu/mmu.c +17 −10
  116. arch/x86/kvm/svm/nested.c +5 −1
  117. arch/x86/kvm/vmx/vmx.c +3 −3
  118. arch/x86/lib/getuser.S +7 −2
  119. arch/x86/virt/svm/sev.c +2 −0
  120. arch/x86/xen/enlighten_pv.c +4 −0
  121. block/blk-map.c +17 −41
  122. block/blk-mq.c +6 −2
  123. block/blk-rq-qos.c +1 −1
  124. block/elevator.c +14 −7
  125. crypto/algapi.c +1 −1
  126. crypto/testmgr.c +11 −12
  127. drivers/accel/ivpu/ivpu_debugfs.c +9 −0
  128. drivers/accel/ivpu/ivpu_hw.c +1 −0
  129. drivers/accel/ivpu/ivpu_hw.h +1 −0
  130. drivers/accel/ivpu/ivpu_hw_ip.c +4 −1
  131. drivers/accel/qaic/qaic_control.c +1 −1
  132. drivers/accel/qaic/qaic_data.c +3 −3
  133. drivers/acpi/button.c +11 −0
  134. drivers/acpi/cppc_acpi.c +22 −9
  135. drivers/acpi/prmt.c +23 −6
  136. drivers/acpi/resource.c +15 −64
  137. drivers/ata/libata-eh.c +15 −4
  138. drivers/base/core.c +40 −8
  139. drivers/base/module.c +0 −4
  140. drivers/base/power/common.c +15 −10
  141. drivers/block/drbd/drbd_int.h +0 −1
  142. drivers/block/drbd/drbd_main.c +0 −14
  143. drivers/block/ublk_drv.c +10 −1
  144. drivers/bluetooth/btusb.c +13 −6
  145. drivers/cdrom/cdrom.c +1 −1
  146. drivers/char/tpm/tpm-chip.c +10 −0
  147. drivers/char/tpm/tpm-dev-common.c +3 −0
  148. drivers/char/tpm/tpm-interface.c +4 −2
  149. drivers/char/tpm/tpm2-sessions.c +60 −40
  150. drivers/char/virtio_console.c +10 −8
  151. drivers/clk/clk_test.c +14 −47
  152. drivers/clk/rockchip/clk.c +1 −1
  153. drivers/clk/samsung/clk-exynosautov920.c +1 −0
  154. drivers/cpufreq/amd-pstate.c +24 −6
  155. drivers/crypto/marvell/cesa/hash.c +6 −6
  156. drivers/cxl/Kconfig +1 −0
  157. drivers/cxl/Makefile +14 −6
  158. drivers/cxl/acpi.c +7 −0
  159. drivers/cxl/core/cdat.c +3 −0
  160. drivers/cxl/core/hdm.c +42 −8
  161. drivers/cxl/core/port.c +10 −3
  162. drivers/cxl/core/region.c +46 −45
  163. drivers/cxl/core/trace.h +14 −3
  164. drivers/cxl/cxl.h +2 −1
  165. drivers/cxl/port.c +16 −1
  166. drivers/dax/device.c +1 −1
  167. drivers/dma/ep93xx_dma.c +6 −3
  168. drivers/dma/sh/rz-dmac.c +14 −11
  169. drivers/dma/ti/k3-udma.c +47 −15
  170. drivers/firewire/core-topology.c +1 −1
  171. drivers/firmware/arm_ffa/driver.c +9 −4
  172. drivers/firmware/arm_scmi/driver.c +1 −3
  173. drivers/firmware/arm_scmi/transports/Makefile +4 −2
  174. drivers/firmware/arm_scmi/transports/mailbox.c +21 −11
  175. drivers/firmware/arm_sdei.c +1 −1
  176. drivers/gpio/gpio-aspeed.c +3 −1
  177. drivers/gpio/gpio-sloppy-logic-analyzer.c +3 −1
  178. drivers/gpio/gpiolib-swnode.c +1 −1
  179. drivers/gpio/gpiolib.c +3 −1
  180. drivers/gpu/drm/amd/display/dc/dml2/dml2_policy.c +1 −0
  181. drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +3 −1
  182. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +3 −3
  183. drivers/gpu/drm/ast/ast_sil164.c +2 −0
  184. drivers/gpu/drm/ast/ast_vga.c +2 −0
  185. drivers/gpu/drm/bridge/aux-bridge.c +2 −1
  186. drivers/gpu/drm/bridge/tc358767.c +1 −0
  187. drivers/gpu/drm/drm_fbdev_dma.c +2 −1
  188. drivers/gpu/drm/i915/Kconfig +1 −2
  189. drivers/gpu/drm/i915/display/intel_dp_mst.c +30 −12
  190. drivers/gpu/drm/mediatek/mtk_crtc.c +2 −2
  191. drivers/gpu/drm/mediatek/mtk_ddp_comp.c +2 −0
  192. drivers/gpu/drm/mediatek/mtk_ddp_comp.h +10 −0
  193. drivers/gpu/drm/mediatek/mtk_disp_drv.h +2 −0
  194. drivers/gpu/drm/mediatek/mtk_disp_ovl.c +55 −19
  195. drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c +7 −0
  196. drivers/gpu/drm/mediatek/mtk_dp.c +84 −1
  197. drivers/gpu/drm/mediatek/mtk_ethdr.c +7 −0
  198. drivers/gpu/drm/mediatek/mtk_ethdr.h +1 −0
  199. drivers/gpu/drm/mediatek/mtk_plane.c +7 −8
  200. drivers/gpu/drm/mediatek/mtk_plane.h +2 −2
  201. drivers/gpu/drm/mgag200/mgag200_drv.c +0 −38
  202. drivers/gpu/drm/mgag200/mgag200_drv.h +2 −12
  203. drivers/gpu/drm/mgag200/mgag200_g200.c +0 −5
  204. drivers/gpu/drm/mgag200/mgag200_g200eh.c +0 −5
  205. drivers/gpu/drm/mgag200/mgag200_g200eh3.c +0 −5
  206. drivers/gpu/drm/mgag200/mgag200_g200er.c +1 −9
  207. drivers/gpu/drm/mgag200/mgag200_g200ev.c +1 −9
  208. drivers/gpu/drm/mgag200/mgag200_g200ew3.c +0 −5
  209. drivers/gpu/drm/mgag200/mgag200_g200se.c +1 −9
  210. drivers/gpu/drm/mgag200/mgag200_g200wb.c +0 −5
  211. drivers/gpu/drm/mgag200/mgag200_mode.c +1 −76
  212. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +13 −3
  213. drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +13 −7
  214. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +42 −26
  215. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +5 −2
  216. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +4 −1
  217. drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +10 −9
  218. drivers/gpu/drm/msm/dsi/dsi_host.c +2 −2
  219. drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c +0 −9
  220. drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h +1 −1
  221. drivers/gpu/drm/nouveau/nouveau_dmem.c +1 −1
  222. drivers/gpu/drm/nouveau/nouveau_drm.c +1 −1
  223. drivers/gpu/drm/panel/panel-himax-hx83102.c +6 −6
  224. drivers/gpu/drm/panthor/panthor_fw.c +2 −2
  225. drivers/gpu/drm/panthor/panthor_gem.c +8 −3
  226. drivers/gpu/drm/panthor/panthor_mmu.c +13 −3
  227. drivers/gpu/drm/panthor/panthor_mmu.h +1 −0
  228. drivers/gpu/drm/panthor/panthor_sched.c +16 −4
  229. drivers/gpu/drm/scheduler/sched_main.c +13 −1
  230. drivers/gpu/drm/tegra/drm.c +2 −2
  231. drivers/gpu/drm/tests/drm_connector_test.c +12 −12
  232. drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +4 −4
  233. drivers/gpu/drm/tests/drm_kunit_helpers.c +42 −0
  234. drivers/gpu/drm/v3d/v3d_perfmon.c +8 −1
  235. drivers/gpu/drm/vc4/vc4_perfmon.c +6 −1
  236. drivers/gpu/drm/vmwgfx/vmwgfx_blit.c +2 −4
  237. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 −2
  238. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 −30
  239. drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +0 −3
  240. drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +4 −0
  241. drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +6 −3
  242. drivers/gpu/drm/xe/regs/xe_gt_regs.h +0 −6
  243. drivers/gpu/drm/xe/xe_force_wake.c +9 −3
  244. drivers/gpu/drm/xe/xe_ggtt.c +10 −0
  245. drivers/gpu/drm/xe/xe_guc_ct.c +18 −0
  246. drivers/gpu/drm/xe/xe_guc_submit.c +25 −83
  247. drivers/gpu/drm/xe/xe_guc_types.h +0 −7
  248. drivers/gpu/drm/xe/xe_sync.c +2 −1
  249. drivers/hid/amd-sfh-hid/amd_sfh_client.c +3 −11
  250. drivers/hid/hid-ids.h +4 −0
  251. drivers/hid/hid-lenovo.c +8 −0
  252. drivers/hid/hid-multitouch.c +13 −0
  253. drivers/hid/hid-plantronics.c +23 −0
  254. drivers/hid/i2c-hid/i2c-hid-core.c +10 −0
  255. drivers/hid/intel-ish-hid/ishtp-fw-loader.c +1 −1
  256. drivers/hid/wacom_wac.c +2 −0
  257. drivers/hwmon/Kconfig +6 −0
  258. drivers/hwmon/adt7475.c +1 −2
  259. drivers/hwmon/intel-m10-bmc-hwmon.c +1 −1
  260. drivers/hwmon/jc42.c +1 −1
  261. drivers/iio/accel/Kconfig +2 −0
  262. drivers/iio/accel/bma400_core.c +2 −1
  263. drivers/iio/adc/Kconfig +11 −0
  264. drivers/iio/adc/ad7124.c +1 −1
  265. drivers/iio/adc/ad7380.c +78 −58
  266. drivers/iio/amplifiers/Kconfig +1 −0
  267. drivers/iio/chemical/Kconfig +2 −0
  268. drivers/iio/common/hid-sensors/hid-sensor-trigger.c +1 −1
  269. drivers/iio/dac/Kconfig +8 −1
  270. drivers/iio/dac/ltc2664.c +9 −8
  271. drivers/iio/frequency/Kconfig +18 −16
  272. drivers/iio/imu/bmi323/bmi323_core.c +11 −12
  273. drivers/iio/industrialio-gts-helper.c +3 −1
  274. drivers/iio/light/Kconfig +2 −0
  275. drivers/iio/light/opt3001.c +4 −0
  276. drivers/iio/light/veml6030.c +3 −4
  277. drivers/iio/magnetometer/Kconfig +2 −0
  278. drivers/iio/pressure/Kconfig +4 −0
  279. drivers/iio/proximity/Kconfig +2 −0
  280. drivers/iio/resolver/Kconfig +3 −0
  281. drivers/infiniband/core/addr.c +2 −0
  282. drivers/infiniband/core/nldev.c +2 −0
  283. drivers/infiniband/hw/bnxt_re/hw_counters.c +1 −1
  284. drivers/infiniband/hw/bnxt_re/ib_verbs.c +5 −1
  285. drivers/infiniband/hw/bnxt_re/main.c +25 −22
  286. drivers/infiniband/hw/bnxt_re/qplib_fp.c +9 −0
  287. drivers/infiniband/hw/bnxt_re/qplib_fp.h +1 −1
  288. drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +20 −20
  289. drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +2 −0
  290. drivers/infiniband/hw/bnxt_re/qplib_res.c +5 −16
  291. drivers/infiniband/hw/bnxt_re/qplib_sp.c +10 −1
  292. drivers/infiniband/hw/bnxt_re/qplib_sp.h +1 −0
  293. drivers/infiniband/hw/cxgb4/cm.c +4 −5
  294. drivers/infiniband/hw/cxgb4/provider.c +1 −0
  295. drivers/infiniband/hw/irdma/cm.c +1 −1
  296. drivers/infiniband/hw/mlx5/qp.c +2 −2
  297. drivers/infiniband/sw/siw/siw_qp_tx.c +2 −0
  298. drivers/infiniband/ulp/srpt/ib_srpt.c +68 −12
  299. drivers/input/input.c +73 −61
  300. drivers/input/joystick/xpad.c +3 −0
  301. drivers/input/keyboard/adp5588-keys.c +4 −2
  302. drivers/input/touchscreen/edt-ft5x06.c +18 −1
  303. drivers/input/touchscreen/zinitix.c +22 −12
  304. drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +2 −2
  305. drivers/iommu/arm/arm-smmu/arm-smmu-impl.c +2 −2
  306. drivers/iommu/intel/iommu.c +3 −1
  307. drivers/irqchip/Kconfig +0 −7
  308. drivers/irqchip/irq-gic-v3-its.c +22 −6
  309. drivers/irqchip/irq-mscc-ocelot.c +8 −2
  310. drivers/irqchip/irq-renesas-rzg2l.c +14 −2
  311. drivers/irqchip/irq-riscv-imsic-platform.c +1 −1
  312. drivers/irqchip/irq-riscv-intc.c +18 −1
  313. drivers/irqchip/irq-sifive-plic.c +17 −12
  314. drivers/md/md.c +23 −1
  315. drivers/md/raid10.c +5 −2
  316. drivers/misc/cardreader/Kconfig +2 −1
  317. drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c +2 −0
  318. drivers/misc/mei/client.c +2 −2
  319. drivers/misc/sgi-gru/grukservices.c +0 −2
  320. drivers/misc/sgi-gru/grumain.c +0 −4
  321. drivers/misc/sgi-gru/grutlbpurge.c +0 −2
  322. drivers/mmc/core/queue.c +2 −1
  323. drivers/mmc/host/mvsdio.c +18 −53
  324. drivers/mmc/host/sdhci-of-dwcmshc.c +8 −0
  325. drivers/net/dsa/b53/b53_common.c +13 −4
  326. drivers/net/dsa/lan9303-core.c +29 −0
  327. drivers/net/dsa/microchip/ksz_common.c +11 −10
  328. drivers/net/dsa/mv88e6xxx/chip.c +1 −1
  329. drivers/net/dsa/mv88e6xxx/chip.h +2 −4
  330. drivers/net/dsa/mv88e6xxx/port.c +1 −0
  331. drivers/net/dsa/mv88e6xxx/ptp.c +75 −33
  332. drivers/net/dsa/sja1105/sja1105_main.c +0 −1
  333. drivers/net/dsa/vitesse-vsc73xx-core.c +0 −1
  334. drivers/net/ethernet/adi/adin1110.c +2 −2
  335. drivers/net/ethernet/aeroflex/greth.c +2 −1
  336. drivers/net/ethernet/amd/mvme147.c +3 −4
  337. drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +1 −0
  338. drivers/net/ethernet/broadcom/bcmsysport.c +1 −0
  339. drivers/net/ethernet/broadcom/bnxt/bnxt.c +14 −8
  340. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +42 −28
  341. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h +7 −5
  342. drivers/net/ethernet/cadence/macb_main.c +11 −3
  343. drivers/net/ethernet/emulex/benet/be_main.c +5 −5
  344. drivers/net/ethernet/faraday/ftgmac100.c +6 −1
  345. drivers/net/ethernet/freescale/enetc/enetc.c +43 −13
  346. drivers/net/ethernet/freescale/enetc/enetc.h +1 −0
  347. drivers/net/ethernet/freescale/fec_main.c +4 −2
  348. drivers/net/ethernet/freescale/fman/mac.c +51 −17
  349. drivers/net/ethernet/freescale/fman/mac.h +5 −1
  350. drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +3 −1
  351. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +58 −1
  352. drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +2 −0
  353. drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +33 −0
  354. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +36 −9
  355. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c +3 −0
  356. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c +5 −4
  357. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +33 −7
  358. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c +5 −4
  359. drivers/net/ethernet/i825xx/sun3_82586.c +1 −0
  360. drivers/net/ethernet/ibm/emac/mal.c +3 −1
  361. drivers/net/ethernet/ibm/ibmvnic.c +4 −2
  362. drivers/net/ethernet/intel/e1000e/hw.h +2 −2
  363. drivers/net/ethernet/intel/e1000e/netdev.c +2 −2
  364. drivers/net/ethernet/intel/i40e/i40e_main.c +1 −0
  365. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 −0
  366. drivers/net/ethernet/intel/ice/devlink/devlink_port.c +6 −0
  367. drivers/net/ethernet/intel/ice/ice_ddp.c +28 −30
  368. drivers/net/ethernet/intel/ice/ice_ddp.h +2 −2
  369. drivers/net/ethernet/intel/ice/ice_dpll.c +74 −2
  370. drivers/net/ethernet/intel/ice/ice_eswitch_br.c +4 −1
  371. drivers/net/ethernet/intel/ice/ice_eswitch_br.h +1 −0
  372. drivers/net/ethernet/intel/ice/ice_main.c +7 −32
  373. drivers/net/ethernet/intel/ice/ice_ptp_hw.c +19 −2
  374. drivers/net/ethernet/intel/ice/ice_ptp_hw.h +1 −0
  375. drivers/net/ethernet/intel/ice/ice_sriov.c +14 −5
  376. drivers/net/ethernet/intel/ice/ice_switch.c +0 −2
  377. drivers/net/ethernet/intel/ice/ice_tc_lib.c +11 −0
  378. drivers/net/ethernet/intel/ice/ice_vf_lib.c +8 −1
  379. drivers/net/ethernet/intel/ice/ice_vf_lib_private.h +0 −1
  380. drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c +57 −0
  381. drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.h +1 −0
  382. drivers/net/ethernet/intel/idpf/idpf_vf_dev.c +1 −0
  383. drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +2 −9
  384. drivers/net/ethernet/intel/igb/igb_main.c +5 −1
  385. drivers/net/ethernet/marvell/octeon_ep/octep_rx.c +59 −23
  386. drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +2 −2
  387. drivers/net/ethernet/mediatek/airoha_eth.c +5 −4
  388. drivers/net/ethernet/mediatek/mtk_eth_soc.c +1 −1
  389. drivers/net/ethernet/mediatek/mtk_wed_wo.h +2 −2
  390. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +6 −2
  391. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +3 −1
  392. drivers/net/ethernet/mellanox/mlx5/core/eq.c +6 −0
  393. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +3 −2
  394. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c +1 −3
  395. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.h +1 −0
  396. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c +2 −2
  397. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c +19 −3
  398. drivers/net/ethernet/mellanox/mlxsw/pci.c +17 −8
  399. drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c +24 −2
  400. drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c +7 −0
  401. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +3 −6
  402. drivers/net/ethernet/microchip/lan743x_ptp.c +14 −21
  403. drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c +6 −6
  404. drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +2 −0
  405. drivers/net/ethernet/realtek/r8169_main.c +3 −1
  406. drivers/net/ethernet/renesas/ravb_main.c +12 −13
  407. drivers/net/ethernet/renesas/rtsn.c +1 −0
  408. drivers/net/ethernet/sfc/efx_channels.c +2 −1
  409. drivers/net/ethernet/sfc/siena/efx_channels.c +2 −1
  410. drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +12 −2
  411. drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +8 −0
  412. drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h +2 −0
  413. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +18 −6
  414. drivers/net/ethernet/ti/am65-cpsw-nuss.c +13 −9
  415. drivers/net/ethernet/ti/icssg/icssg_config.c +2 −0
  416. drivers/net/ethernet/ti/icssg/icssg_prueth.c +1 −0
  417. drivers/net/ethernet/ti/icssg/icssg_prueth.h +2 −0
  418. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +2 −0
  419. drivers/net/gtp.c +13 −9
  420. drivers/net/hyperv/netvsc_drv.c +30 −0
  421. drivers/net/macsec.c +1 −20
  422. drivers/net/mctp/mctp-i2c.c +3 −0
  423. drivers/net/mdio/mdio-bcm-unimac.c +1 −0
  424. drivers/net/netconsole.c +7 −1
  425. drivers/net/netdevsim/dev.c +9 −6
  426. drivers/net/netdevsim/fib.c +3 −1
  427. drivers/net/phy/aquantia/aquantia_main.c +33 −18
  428. drivers/net/phy/bcm84881.c +2 −2
  429. drivers/net/phy/dp83822.c +2 −2
  430. drivers/net/phy/dp83869.c +0 −1
  431. drivers/net/phy/phy_device.c +3 −2
  432. drivers/net/phy/realtek.c +23 −1
  433. drivers/net/plip/plip.c +1 −1
  434. drivers/net/ppp/ppp_async.c +1 −1
  435. drivers/net/pse-pd/pse_core.c +13 −2
  436. drivers/net/slip/slhc.c +34 −23
  437. drivers/net/usb/qmi_wwan.c +2 −0
  438. drivers/net/usb/r8152.c +1 −0
  439. drivers/net/usb/usbnet.c +3 −1
  440. drivers/net/virtio_net.c +1 −1
  441. drivers/net/vmxnet3/vmxnet3_xdp.c +1 −1
  442. drivers/net/vxlan/vxlan_core.c +5 −1
  443. drivers/net/vxlan/vxlan_private.h +1 −1
  444. drivers/net/vxlan/vxlan_vnifilter.c +9 −10
  445. drivers/net/wireless/ath/ath10k/wmi-tlv.c +6 −1
  446. drivers/net/wireless/ath/ath10k/wmi.c +2 −0
  447. drivers/net/wireless/ath/ath11k/dp_rx.c +5 −2
  448. drivers/net/wireless/ath/wil6210/txrx.c +1 −1
  449. drivers/net/wireless/broadcom/brcm80211/Kconfig +1 −0
  450. drivers/net/wireless/intel/ipw2x00/ipw2100.c +1 −1
  451. drivers/net/wireless/intel/ipw2x00/ipw2200.h +1 −1
  452. drivers/net/wireless/intel/iwlegacy/common.c +14 −1
  453. drivers/net/wireless/intel/iwlegacy/common.h +12 −0
  454. drivers/net/wireless/intel/iwlwifi/fw/acpi.c +58 −38
  455. drivers/net/wireless/intel/iwlwifi/fw/init.c +3 −1
  456. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +19 −9
  457. drivers/net/wireless/intel/iwlwifi/iwl-drv.h +3 −0
  458. drivers/net/wireless/intel/iwlwifi/mvm/d3.c +2 −0
  459. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +4 −6
  460. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +10 −2
  461. drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +23 −11
  462. drivers/net/wireless/intel/iwlwifi/mvm/scan.c +3 −3
  463. drivers/net/wireless/marvell/libertas/radiotap.h +2 −2
  464. drivers/net/wireless/mediatek/mt76/mcu.c +5 −2
  465. drivers/net/wireless/microchip/wilc1000/mon.c +2 −2
  466. drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c +0 −1
  467. drivers/net/wireless/realtek/rtw88/usb.c +0 −1
  468. drivers/net/wireless/realtek/rtw89/coex.c +2 −0
  469. drivers/net/wireless/realtek/rtw89/pci.c +41 −7
  470. drivers/net/wireless/virtual/mac80211_hwsim.c +2 −2
  471. drivers/net/wwan/wwan_core.c +1 −1
  472. drivers/nvme/host/core.c +59 −38
  473. drivers/nvme/host/ioctl.c +5 −2
  474. drivers/nvme/host/multipath.c +33 −7
  475. drivers/nvme/host/nvme.h +1 −0
  476. drivers/nvme/host/pci.c +16 −3
  477. drivers/nvme/host/tcp.c +4 −3
  478. drivers/nvme/target/auth.c +1 −0
  479. drivers/nvme/target/loop.c +13 −0
  480. drivers/nvme/target/passthru.c +2 −4
  481. drivers/nvme/target/rdma.c +27 −29
  482. drivers/of/of_kunit_helpers.c +15 −0
  483. drivers/of/of_private.h +3 −0
  484. drivers/of/of_test.c +3 −0
  485. drivers/of/overlay_test.c +4 −1
  486. drivers/opp/core.c +3 −1
  487. drivers/parport/procfs.c +11 −11
  488. drivers/pci/pci.c +9 −5
  489. drivers/pci/probe.c +2 −0
  490. drivers/pci/pwrctl/pci-pwrctl-pwrseq.c +50 −5
  491. drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c +9 −3
  492. drivers/phy/broadcom/phy-brcm-usb-init.c +2 −0
  493. drivers/phy/cadence/phy-cadence-sierra.c +11 −10
  494. drivers/phy/freescale/phy-fsl-imx8m-pcie.c +5 −5
  495. drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1 −2
  496. drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +4 −4
  497. drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c +1 −0
  498. drivers/phy/qualcomm/phy-qcom-qmp-usb.c +1 −0
  499. drivers/phy/qualcomm/phy-qcom-qmp-usbc.c +1 −0
  500. drivers/phy/rockchip/Kconfig +1 −0
  501. drivers/phy/starfive/phy-jh7110-usb.c +16 −0
  502. drivers/phy/tegra/xusb.c +2 −0
  503. drivers/phy/ti/phy-j721e-wiz.c +2 −2
  504. drivers/pinctrl/intel/Kconfig +1 −0
  505. drivers/pinctrl/intel/pinctrl-intel-platform.c +2 −3
  506. drivers/pinctrl/nuvoton/pinctrl-ma35.c +1 −1
  507. drivers/pinctrl/pinctrl-apple-gpio.c +3 −0
  508. drivers/pinctrl/pinctrl-aw9523.c +4 −2
  509. drivers/pinctrl/pinctrl-ocelot.c +4 −4
  510. drivers/pinctrl/sophgo/pinctrl-cv18xx.c +1 −1
  511. drivers/pinctrl/stm32/pinctrl-stm32.c +7 −2
  512. drivers/platform/x86/asus-wmi.c +10 −0
  513. drivers/platform/x86/dell/dell-wmi-base.c +9 −0
  514. drivers/platform/x86/intel/pmc/adl.c +0 −2
  515. drivers/platform/x86/intel/pmc/cnp.c +0 −2
  516. drivers/platform/x86/intel/pmc/core.c +0 −46
  517. drivers/platform/x86/intel/pmc/core.h +0 −8
  518. drivers/platform/x86/intel/pmc/core_ssram.c +3 −1
  519. drivers/platform/x86/intel/pmc/icl.c +0 −2
  520. drivers/platform/x86/intel/pmc/mtl.c +0 −2
  521. drivers/platform/x86/intel/pmc/tgl.c +0 −2
  522. drivers/pmdomain/qcom/cpr.c +1 −1
  523. drivers/powercap/dtpm_devfreq.c +1 −1
  524. drivers/powercap/intel_rapl_msr.c +2 −0
  525. drivers/powercap/intel_rapl_tpmi.c +15 −4
  526. drivers/reset/reset-npcm.c +2 −2
  527. drivers/reset/starfive/reset-starfive-jh71x0.c +3 −0
  528. drivers/s390/char/sclp.c +2 −1
  529. drivers/s390/char/sclp_vt220.c +2 −2
  530. drivers/s390/crypto/ap_bus.c +1 −2
  531. drivers/s390/crypto/ap_bus.h +1 −1
  532. drivers/s390/crypto/ap_queue.c +20 −8
  533. drivers/s390/crypto/pkey_pckmo.c +1 −0
  534. drivers/scsi/fnic/fnic_main.c +1 −1
  535. drivers/scsi/mpi3mr/mpi3mr.h +2 −2
  536. drivers/scsi/mpi3mr/mpi3mr_transport.c +27 −15
  537. drivers/scsi/scsi_debug.c +4 −6
  538. drivers/scsi/scsi_transport_fc.c +2 −2
  539. drivers/scsi/wd33c93.c +1 −1
  540. drivers/soc/fsl/qe/qmc.c +5 −6
  541. drivers/soundwire/intel_ace2x.c +6 −13
  542. drivers/spi/spi-fsl-dspi.c +5 −1
  543. drivers/spi/spi-geni-qcom.c +5 −3
  544. drivers/spi/spi-mtk-snfi.c +1 −1
  545. drivers/spi/spi-stm32.c +1 −0
  546. drivers/staging/iio/frequency/ad9832.c +5 −2
  547. drivers/target/target_core_device.c +1 −1
  548. drivers/target/target_core_user.c +1 −1
  549. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0 −2
  550. drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c +24 −46
  551. drivers/thermal/thermal_core.c +2 −3
  552. drivers/thermal/thermal_core.h +3 −0
  553. drivers/thermal/thermal_netlink.c +3 −6
  554. drivers/thunderbolt/retimer.c +3 −2
  555. drivers/thunderbolt/tb.c +42 −6
  556. drivers/tty/n_gsm.c +2 −0
  557. drivers/tty/serial/imx.c +15 −0
  558. drivers/tty/serial/qcom_geni_serial.c +48 −55
  559. drivers/tty/vt/vt.c +1 −1
  560. drivers/ufs/core/ufs-mcq.c +8 −7
  561. drivers/ufs/core/ufshcd.c +10 −21
  562. drivers/usb/core/usb-acpi.c +2 −2
  563. drivers/usb/dwc2/params.c +0 −1
  564. drivers/usb/dwc3/core.c +41 −8
  565. drivers/usb/dwc3/core.h +3 −4
  566. drivers/usb/dwc3/gadget.c +6 −15
  567. drivers/usb/gadget/function/f_uac2.c +3 −3
  568. drivers/usb/gadget/udc/core.c +1 −0
  569. drivers/usb/gadget/udc/dummy_hcd.c +15 −5
  570. drivers/usb/host/xhci-dbgcap.h +1 −0
  571. drivers/usb/host/xhci-dbgtty.c +50 −5
  572. drivers/usb/host/xhci-pci.c +9 −2
  573. drivers/usb/host/xhci-ring.c +38 −46
  574. drivers/usb/host/xhci-tegra.c +1 −1
  575. drivers/usb/host/xhci.h +1 −1
  576. drivers/usb/misc/Kconfig +12 −0
  577. drivers/usb/misc/onboard_usb_dev.c +4 −2
  578. drivers/usb/misc/yurex.c +9 −12
  579. drivers/usb/phy/phy.c +1 −1
  580. drivers/usb/serial/option.c +8 −0
  581. drivers/usb/storage/unusual_devs.h +11 −0
  582. drivers/usb/typec/class.c +7 −2
  583. drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +6 −4
  584. drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c +0 −1
  585. drivers/usb/typec/tcpm/tcpm.c +7 −3
  586. drivers/vdpa/octeon_ep/octep_vdpa_hw.c +6 −6
  587. drivers/vhost/scsi.c +15 −12
  588. drivers/video/fbdev/Kconfig +1 −14
  589. drivers/video/fbdev/Makefile +0 −1
  590. drivers/video/fbdev/amifb.c +2 −2
  591. drivers/video/fbdev/arcfb.c +1 −1
  592. drivers/video/fbdev/atmel_lcdfb.c +1 −1
  593. drivers/video/fbdev/au1100fb.c +1 −1
  594. drivers/video/fbdev/au1200fb.c +1 −1
  595. drivers/video/fbdev/broadsheetfb.c +1 −1
  596. drivers/video/fbdev/bw2.c +2 −2
  597. drivers/video/fbdev/cg14.c +2 −2
  598. drivers/video/fbdev/cg3.c +2 −2
  599. drivers/video/fbdev/cg6.c +2 −2
  600. drivers/video/fbdev/clps711x-fb.c +1 −1
  601. drivers/video/fbdev/cobalt_lcdfb.c +1 −1
  602. drivers/video/fbdev/da8xx-fb.c +0 −1665
  603. drivers/video/fbdev/ep93xx-fb.c +1 −1
  604. drivers/video/fbdev/ffb.c +2 −2
  605. drivers/video/fbdev/fsl-diu-fb.c +3 −3
  606. drivers/video/fbdev/gbefb.c +3 −3
  607. drivers/video/fbdev/goldfishfb.c +1 −1
  608. drivers/video/fbdev/grvga.c +1 −1
  609. drivers/video/fbdev/hecubafb.c +1 −1
  610. drivers/video/fbdev/hgafb.c +1 −1
  611. drivers/video/fbdev/hitfb.c +1 −1
  612. drivers/video/fbdev/imxfb.c +1 −1
  613. drivers/video/fbdev/leo.c +2 −2
  614. drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +1 −1
  615. drivers/video/fbdev/metronomefb.c +1 −1
  616. drivers/video/fbdev/nvidia/nv_hw.c +4 −4
  617. drivers/video/fbdev/ocfb.c +1 −1
  618. drivers/video/fbdev/offb.c +2 −2
  619. drivers/video/fbdev/omap/omapfb_main.c +1 −1
  620. drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c +1 −1
  621. drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c +1 −1
  622. drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c +1 −1
  623. drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c +1 −1
  624. drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c +1 −1
  625. drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c +1 −1
  626. drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c +1 −1
  627. drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +1 −1
  628. drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c +1 −1
  629. drivers/video/fbdev/omap2/omapfb/dss/core.c +3 −3
  630. drivers/video/fbdev/omap2/omapfb/dss/dispc.c +1 −1
  631. drivers/video/fbdev/omap2/omapfb/dss/dpi.c +2 −2
  632. drivers/video/fbdev/omap2/omapfb/dss/dsi.c +1 −1
  633. drivers/video/fbdev/omap2/omapfb/dss/dss.c +1 −1
  634. drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +3 −3
  635. drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +1 −1
  636. drivers/video/fbdev/omap2/omapfb/dss/sdi.c +3 −3
  637. drivers/video/fbdev/omap2/omapfb/dss/venc.c +3 −3
  638. drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 −1
  639. drivers/video/fbdev/p9100.c +2 −2
  640. drivers/video/fbdev/platinumfb.c +1 −1
  641. drivers/video/fbdev/pxa168fb.c +1 −1
  642. drivers/video/fbdev/pxa3xx-gcu.c +4 −4
  643. drivers/video/fbdev/pxafb.c +1 −1
  644. drivers/video/fbdev/s1d13xxxfb.c +1 −1
  645. drivers/video/fbdev/s3c-fb.c +1 −1
  646. drivers/video/fbdev/sbuslib.c +1 −1
  647. drivers/video/fbdev/sbuslib.h +1 −1
  648. drivers/video/fbdev/sh7760fb.c +1 −1
  649. drivers/video/fbdev/sh_mobile_lcdcfb.c +1 −1
  650. drivers/video/fbdev/simplefb.c +1 −1
  651. drivers/video/fbdev/sm501fb.c +1 −1
  652. drivers/video/fbdev/sstfb.c +7 −2
  653. drivers/video/fbdev/tcx.c +2 −2
  654. drivers/video/fbdev/uvesafb.c +1 −1
  655. drivers/video/fbdev/vesafb.c +1 −1
  656. drivers/video/fbdev/vfb.c +1 −1
  657. drivers/video/fbdev/vga16fb.c +1 −1
  658. drivers/video/fbdev/via/via-gpio.c +1 −1
  659. drivers/video/fbdev/via/via_i2c.c +1 −1
  660. drivers/video/fbdev/vt8500lcdfb.c +1 −1
  661. drivers/video/fbdev/wm8505fb.c +1 −1
  662. drivers/video/fbdev/wmt_ge_rops.c +1 −1
  663. drivers/video/fbdev/xilinxfb.c +1 −1
  664. drivers/virtio/virtio_ring.c +1 −1
  665. drivers/xen/Kconfig +0 −1
  666. drivers/xen/acpi.c +24 −0
  667. drivers/xen/privcmd.c +2 −4
  668. drivers/xen/xen-pciback/pci_stub.c +9 −2
  669. fs/9p/fid.c +2 −3
  670. fs/9p/v9fs.h +27 −7
  671. fs/9p/v9fs_vfs.h +1 −1
  672. fs/9p/vfs_inode.c +82 −47
  673. fs/9p/vfs_inode_dotl.c +81 −31
  674. fs/9p/vfs_super.c +1 −1
  675. fs/Kconfig +1 −1
  676. fs/afs/dir.c +25 −0
  677. fs/afs/dir_edit.c +89 −2
  678. fs/afs/internal.h +4 −0
  679. fs/afs/rxrpc.c +59 −24
  680. fs/autofs/dev-ioctl.c +2 −3
  681. fs/backing-file.c +4 −4
  682. fs/bcachefs/alloc_background.c +31 −16
  683. fs/bcachefs/alloc_background.h +3 −0
  684. fs/bcachefs/alloc_foreground.c +17 −4
  685. fs/bcachefs/bcachefs.h +1 −0
  686. fs/bcachefs/bcachefs_format.h +2 −1
  687. fs/bcachefs/btree_gc.c +20 −7
  688. fs/bcachefs/btree_io.c +4 −3
  689. fs/bcachefs/btree_iter.c +16 −3
  690. fs/bcachefs/btree_iter.h +10 −0
  691. fs/bcachefs/btree_node_scan.c +3 −0
  692. fs/bcachefs/btree_update.c +2 −2
  693. fs/bcachefs/btree_update.h +1 −1
  694. fs/bcachefs/btree_update_interior.c +1 −3
  695. fs/bcachefs/buckets.c +5 −2
  696. fs/bcachefs/buckets.h +7 −5
  697. fs/bcachefs/chardev.c +1 −0
  698. fs/bcachefs/darray.c +14 −1
  699. fs/bcachefs/data_update.c +13 −9
  700. fs/bcachefs/data_update.h +2 −1
  701. fs/bcachefs/dirent.c +0 −7
  702. fs/bcachefs/dirent.h +7 −0
  703. fs/bcachefs/disk_accounting.c +118 −37
  704. fs/bcachefs/ec.c +75 −37
  705. fs/bcachefs/errcode.h +4 −1
  706. fs/bcachefs/error.c +4 −1
  707. fs/bcachefs/extents.c +70 −16
  708. fs/bcachefs/extents.h +14 −1
  709. fs/bcachefs/fs-io-buffered.c +6 −0
  710. fs/bcachefs/fs-io-direct.c +2 −1
  711. fs/bcachefs/fs-io-pagecache.c +45 −25
  712. fs/bcachefs/fs-io.c +14 −5
  713. fs/bcachefs/fs.c +112 −22
  714. fs/bcachefs/fs.h +3 −6
  715. fs/bcachefs/fsck.c +448 −197
  716. fs/bcachefs/fsck.h +1 −0
  717. fs/bcachefs/inode.c +257 −45
  718. fs/bcachefs/inode.h +11 −0
  719. fs/bcachefs/inode_format.h +5 −4
  720. fs/bcachefs/io_misc.c +1 −1
  721. fs/bcachefs/io_read.c +4 −4
  722. fs/bcachefs/io_write.c +2 −2
  723. fs/bcachefs/journal.c +19 −4
  724. fs/bcachefs/journal.h +1 −1
  725. fs/bcachefs/move.c +1 −1
  726. fs/bcachefs/opts.c +8 −2
  727. fs/bcachefs/opts.h +2 −1
  728. fs/bcachefs/quota.c +1 −1
  729. fs/bcachefs/rebalance.c +3 −1
  730. fs/bcachefs/recovery.c +14 −5
  731. fs/bcachefs/recovery_passes_types.h +1 −0
  732. fs/bcachefs/replicas.c +31 −8
  733. fs/bcachefs/sb-downgrade.c +7 −1
  734. fs/bcachefs/sb-errors_format.h +7 −3
  735. fs/bcachefs/sb-members.c +9 −1
  736. fs/bcachefs/snapshot.c +30 −99
  737. fs/bcachefs/snapshot.h +0 −3
  738. fs/bcachefs/str_hash.h +42 −18
  739. fs/bcachefs/subvolume.c +3 −4
  740. fs/bcachefs/super-io.c +5 −0
  741. fs/bcachefs/super.c +25 −11
  742. fs/bcachefs/tests.c +2 −2
  743. fs/bcachefs/xattr.c +1 −1
  744. fs/btrfs/bio.c +13 −24
  745. fs/btrfs/bio.h +3 −0
  746. fs/btrfs/block-group.c +2 −0
  747. fs/btrfs/defrag.c +5 −5
  748. fs/btrfs/delayed-ref.c +40 −15
  749. fs/btrfs/delayed-ref.h +9 −1
  750. fs/btrfs/dir-item.c +2 −2
  751. fs/btrfs/disk-io.c +1 −1
  752. fs/btrfs/extent-tree.c +21 −5
  753. fs/btrfs/extent_io.c +16 −15
  754. fs/btrfs/extent_map.c +22 −16
  755. fs/btrfs/free-space-cache.c +2 −2
  756. fs/btrfs/free-space-cache.h +6 −0
  757. fs/btrfs/inode.c +2 −5
  758. fs/btrfs/qgroup.c +17 −6
  759. fs/btrfs/qgroup.h +2 −0
  760. fs/btrfs/send.c +1 −3
  761. fs/btrfs/super.c +10 −2
  762. fs/btrfs/tree-log.c +3 −3
  763. fs/btrfs/volumes.c +1 −0
  764. fs/btrfs/volumes.h +6 −0
  765. fs/btrfs/zoned.c +1 −1
  766. fs/dax.c +28 −17
  767. fs/erofs/super.c +13 −4
  768. fs/erofs/zdata.c +9 −20
  769. fs/erofs/zmap.c +12 −20
  770. fs/f2fs/file.c +2 −1
  771. fs/fat/namei_vfat.c +1 −1
  772. fs/fuse/file.c +12 −6
  773. fs/fuse/passthrough.c +4 −5
  774. fs/inode.c +6 −4
  775. fs/iomap/buffered-io.c +37 −91
  776. fs/jfs/jfs_dmap.c +1 −1
  777. fs/namespace.c +3 −1
  778. fs/netfs/buffered_read.c +14 −33
  779. fs/netfs/locking.c +2 −1
  780. fs/netfs/read_collect.c +2 −0
  781. fs/nfs/callback_xdr.c +2 −0
  782. fs/nfs/client.c +1 −0
  783. fs/nfs/delegation.c +5 −0
  784. fs/nfs/localio.c +3 −4
  785. fs/nfs/nfs42proc.c +1 −1
  786. fs/nfs/nfs4state.c +1 −1
  787. fs/nfs_common/nfslocalio.c +4 −1
  788. fs/nfsd/filecache.c +4 −2
  789. fs/nfsd/localio.c +1 −1
  790. fs/nfsd/nfs4proc.c +3 −5
  791. fs/nfsd/nfs4state.c +42 −9
  792. fs/nfsd/nfssvc.c +5 −5
  793. fs/nfsd/state.h +2 −0
  794. fs/nfsd/trace.h +3 −3
  795. fs/nilfs2/dir.c +25 −23
  796. fs/nilfs2/namei.c +29 −13
  797. fs/nilfs2/nilfs.h +1 −1
  798. fs/nilfs2/page.c +5 −2
  799. fs/ntfs3/attrib.c +86 −10
  800. fs/ntfs3/attrlist.c +0 −53
  801. fs/ntfs3/file.c +138 −47
  802. fs/ntfs3/frecord.c +83 −14
  803. fs/ntfs3/fslog.c +17 −2
  804. fs/ntfs3/inode.c +14 −6
  805. fs/ntfs3/lib/lzx_decompress.c +1 −2
  806. fs/ntfs3/lznt.c +3 −0
  807. fs/ntfs3/namei.c +5 −5
  808. fs/ntfs3/ntfs_fs.h +5 −5
  809. fs/ntfs3/record.c +15 −16
  810. fs/ntfs3/run.c +5 −3
  811. fs/ntfs3/super.c +37 −33
  812. fs/ntfs3/xattr.c +1 −1
  813. fs/ocfs2/file.c +14 −3
  814. fs/open.c +2 −0
  815. fs/overlayfs/file.c +7 −2
  816. fs/proc/fd.c +1 −1
  817. fs/proc/kcore.c +34 −2
  818. fs/proc/task_mmu.c +10 −6
  819. fs/smb/client/cifs_unicode.c +14 −3
  820. fs/smb/client/cifsfs.c +1 −1
  821. fs/smb/client/cifsproto.h +0 −9
  822. fs/smb/client/compress.c +0 −4
  823. fs/smb/client/connect.c +0 −12
  824. fs/smb/client/fs_context.c +7 −0
  825. fs/smb/client/reparse.c +161 −3
  826. fs/smb/client/sess.c +0 −32
  827. fs/smb/client/smb2inode.c +2 −1
  828. fs/smb/client/smb2ops.c +2 −1
  829. fs/smb/client/smb2pdu.c +9 −0
  830. fs/smb/client/smb2proto.h +1 −0
  831. fs/smb/server/auth.c +5 −1
  832. fs/smb/server/ksmbd_netlink.h +17 −0
  833. fs/smb/server/mgmt/user_config.c +37 −8
  834. fs/smb/server/mgmt/user_config.h +4 −1
  835. fs/smb/server/mgmt/user_session.c +21 −5
  836. fs/smb/server/mgmt/user_session.h +4 −0
  837. fs/smb/server/server.c +2 −0
  838. fs/smb/server/smb2pdu.c +7 −1
  839. fs/smb/server/smb_common.c +12 −3
  840. fs/smb/server/transport_ipc.c +60 −4
  841. fs/smb/server/transport_ipc.h +2 −0
  842. fs/squashfs/file_direct.c +5 −4
  843. fs/super.c +20 −6
  844. fs/unicode/mkutf8data.c +0 −70
  845. fs/unicode/utf8data.c_shipped +3346 −3357
  846. fs/userfaultfd.c +28 −0
  847. fs/xfs/libxfs/xfs_ag.c +28 −47
  848. fs/xfs/libxfs/xfs_ag.h +6 −5
  849. fs/xfs/libxfs/xfs_alloc.c +3 −6
  850. fs/xfs/libxfs/xfs_alloc.h +1 −3
  851. fs/xfs/libxfs/xfs_attr.c +81 −109
  852. fs/xfs/libxfs/xfs_attr_leaf.c +22 −18
  853. fs/xfs/libxfs/xfs_attr_leaf.h +1 −1
  854. fs/xfs/libxfs/xfs_bmap.c +44 −96
  855. fs/xfs/libxfs/xfs_da_btree.c +3 −2
  856. fs/xfs/scrub/bmap_repair.c +1 −1
  857. fs/xfs/scrub/ialloc_repair.c +2 −2
  858. fs/xfs/scrub/repair.c +5 −3
  859. fs/xfs/xfs_aops.c +2 −2
  860. fs/xfs/xfs_bmap_util.c +7 −3
  861. fs/xfs/xfs_bmap_util.h +1 −1
  862. fs/xfs/xfs_buf_item_recover.c +70 −0
  863. fs/xfs/xfs_file.c +88 −58
  864. fs/xfs/xfs_filestream.c +48 −51
  865. fs/xfs/xfs_fsops.c +9 −11
  866. fs/xfs/xfs_icache.c +23 −14
  867. fs/xfs/xfs_inode.c +1 −1
  868. fs/xfs/xfs_inode.h +5 −0
  869. fs/xfs/xfs_ioctl.c +2 −2
  870. fs/xfs/xfs_iomap.c +47 −22
  871. fs/xfs/xfs_log.h +0 −2
  872. fs/xfs/xfs_log_cil.c +4 −7
  873. fs/xfs/xfs_log_recover.c +1 −8
  874. fs/xfs/xfs_mount.c +4 −5
  875. fs/xfs/xfs_reflink.c +3 −0
  876. fs/xfs/xfs_reflink.h +19 −0
  877. fs/xfs/xfs_trace.h +5 −10
  878. include/acpi/cppc_acpi.h +1 −1
  879. include/drm/drm_kunit_helpers.h +4 −0
  880. include/linux/alloc_tag.h +10 −6
  881. include/linux/backing-file.h +1 −1
  882. include/linux/bpf.h +11 −3
  883. include/linux/bpf_mem_alloc.h +3 −0
  884. include/linux/bpf_types.h +1 −0
  885. include/linux/closure.h +35 −0
  886. include/linux/compiler-gcc.h +4 −0
  887. include/linux/device.h +3 −0
  888. include/linux/fs.h +6 −1
  889. include/linux/fs_context.h +6 −0
  890. include/linux/fsl/enetc_mdio.h +2 −1
  891. include/linux/huge_mm.h +18 −0
  892. include/linux/input.h +9 −1
  893. include/linux/iomap.h +36 −3
  894. include/linux/irqchip/arm-gic-v4.h +3 −1
  895. include/linux/ksm.h +4 −6
  896. include/linux/kvm_host.h +0 −2
  897. include/linux/mm.h +2 −1
  898. include/linux/mmzone.h +3 −4
  899. include/linux/netdevice.h +12 −0
  900. include/linux/nfs_fs_sb.h +1 −0
  901. include/linux/nfslocalio.h +15 −0
  902. include/linux/page-flags.h +8 −0
  903. include/linux/percpu.h +5 −1
  904. include/linux/sched.h +7 −2
  905. include/linux/sched/mm.h +4 −13
  906. include/linux/security.h +2 −2
  907. include/linux/soc/qcom/geni-se.h +1 −1
  908. include/linux/soundwire/sdw_intel.h +1 −1
  909. include/linux/swap.h +1 −0
  910. include/linux/task_work.h +4 −1
  911. include/linux/tick.h +8 −0
  912. include/linux/uaccess.h +15 −6
  913. include/linux/userfaultfd_k.h +5 −0
  914. include/net/bluetooth/bluetooth.h +1 −0
  915. include/net/cfg80211.h +44 −0
  916. include/net/genetlink.h +1 −2
  917. include/net/ieee80211_radiotap.h +24 −19
  918. include/net/ip_tunnels.h +1 −1
  919. include/net/mctp.h +1 −1
  920. include/net/netns/xfrm.h +0 −1
  921. include/net/rtnetlink.h +17 −0
  922. include/net/sch_generic.h +0 −1
  923. include/net/sock.h +7 −0
  924. include/net/xfrm.h +15 −13
  925. include/trace/events/afs.h +6 −1
  926. include/trace/events/dma.h +8 −8
  927. include/trace/events/huge_memory.h +2 −2
  928. include/trace/events/netfs.h +0 −1
  929. include/uapi/linux/bpf.h +8 −8
  930. include/uapi/linux/ublk_cmd.h +7 −1
  931. include/uapi/sound/asoc.h +1 −1
  932. include/video/da8xx-fb.h +0 −94
  933. include/xen/acpi.h +9 −5
  934. init/Kconfig +6 −2
  935. io_uring/io_uring.h +9 −1
  936. io_uring/rsrc.c +2 −1
  937. io_uring/rw.c +45 −22
  938. kernel/bpf/bpf_lsm.c +0 −4
  939. kernel/bpf/btf.c +11 −4
  940. kernel/bpf/cgroup.c +18 −1
  941. kernel/bpf/devmap.c +7 −4
  942. kernel/bpf/helpers.c +49 −15
  943. kernel/bpf/inode.c +3 −2
  944. kernel/bpf/log.c +1 −2
  945. kernel/bpf/lpm_trie.c +1 −1
  946. kernel/bpf/memalloc.c +13 −1
  947. kernel/bpf/ringbuf.c +7 −7
  948. kernel/bpf/syscall.c +32 −13
  949. kernel/bpf/task_iter.c +1 −1
  950. kernel/bpf/verifier.c +68 −66
  951. kernel/cgroup/cgroup.c +2 −2
  952. kernel/events/core.c +2 −2
  953. kernel/fork.c +8 −6
  954. kernel/freezer.c +6 −1
  955. kernel/irq/msi.c +1 −1
  956. kernel/kthread.c +2 −0
  957. kernel/rcu/tasks.h +9 −0
  958. kernel/rcu/tree_nocb.h +7 −1
  959. kernel/resource.c +1 −3
  960. kernel/resource_kunit.c +14 −4
  961. kernel/sched/core.c +54 −30
  962. kernel/sched/deadline.c +1 −1
  963. kernel/sched/ext.c +152 −113
  964. kernel/sched/ext.h +1 −1
  965. kernel/sched/fair.c +23 −29
  966. kernel/sched/sched.h +36 −3
  967. kernel/sched/stats.h +33 −15
  968. kernel/sched/syscalls.c +9 −4
  969. kernel/task_work.c +13 −2
  970. kernel/time/posix-clock.c +3 −0
  971. kernel/time/tick-sched.c +6 −0
  972. kernel/trace/bpf_trace.c +19 −23
  973. kernel/trace/fgraph.c +26 −15
  974. kernel/trace/ring_buffer.c +32 −21
  975. kernel/trace/trace.c +3 −3
  976. kernel/trace/trace_eprobe.c +6 −1
  977. kernel/trace/trace_fprobe.c +5 −1
  978. kernel/trace/trace_kprobe.c +5 −1
  979. kernel/trace/trace_probe.c +1 −1
  980. kernel/trace/trace_selftest.c +1 −1
  981. kernel/trace/trace_uprobe.c +9 −4
  982. lib/Kconfig.debug +1 −1
  983. lib/buildid.c +5 −0
  984. lib/codetag.c +3 −0
  985. lib/crypto/mpi/mpi-mul.c +1 −1
  986. lib/iov_iter.c +15 −10
  987. lib/maple_tree.c +7 −7
  988. lib/objpool.c +1 −1
  989. lib/slub_kunit.c +1 −1
  990. mm/Kconfig +0 −1
  991. mm/damon/tests/sysfs-kunit.h +1 −0
  992. mm/gup.c +19 −14
  993. mm/huge_memory.c +2 −13
  994. mm/kasan/init.c +7 −1
  995. mm/kasan/kasan_test_c.c +0 −27
  996. mm/khugepaged.c +3 −3
  997. mm/memory.c +24 −8
  998. mm/migrate.c +3 −2
  999. mm/mmap.c +84 −35
  1000. mm/mremap.c +9 −2
  1001. mm/numa_memblks.c +1 −1
  1002. mm/page_alloc.c +5 −5
  1003. mm/page_io.c +2 −2
  1004. mm/pagewalk.c +11 −5
  1005. mm/rmap.c +3 −6
  1006. mm/secretmem.c +2 −2
  1007. mm/shmem.c +3 −6
  1008. mm/shrinker.c +5 −3
  1009. mm/slab_common.c +1 −1
  1010. mm/sparse-vmemmap.c +5 −0
  1011. mm/swapfile.c +35 −23
  1012. mm/vma.c +15 −8
  1013. mm/vma.h +17 −9
  1014. mm/vmscan.c +56 −50
  1015. mm/zswap.c +0 −1
  1016. net/9p/Kconfig +2 −0
  1017. net/9p/client.c +11 −1
  1018. net/bluetooth/af_bluetooth.c +25 −0
  1019. net/bluetooth/bnep/core.c +1 −2
  1020. net/bluetooth/hci_conn.c +3 −0
  1021. net/bluetooth/hci_core.c +15 −9
  1022. net/bluetooth/hci_sync.c +20 −10
  1023. net/bluetooth/iso.c +13 −11
  1024. net/bluetooth/rfcomm/sock.c +0 −2
  1025. net/bluetooth/sco.c +12 −6
  1026. net/bpf/test_run.c +1 −0
  1027. net/bridge/br_netfilter_hooks.c +5 −0
  1028. net/bridge/br_netlink.c +5 −1
  1029. net/bridge/br_private.h +3 −2
  1030. net/bridge/br_vlan.c +9 −10
  1031. net/core/dev.c +4 −0
  1032. net/core/dst.c +12 −5
  1033. net/core/filter.c +20 −30
  1034. net/core/rtnetlink.c +31 −2
  1035. net/core/sock_map.c +12 −0
  1036. net/dsa/user.c +8 −3
  1037. net/ipv4/devinet.c +25 −10
  1038. net/ipv4/inet_connection_sock.c +16 −5
  1039. net/ipv4/ip_tunnel.c +1 −1
  1040. net/ipv4/netfilter/nft_fib_ipv4.c +1 −3
  1041. net/ipv4/tcp_bpf.c +4 −3
  1042. net/ipv4/tcp_input.c +38 −4
  1043. net/ipv4/tcp_output.c +1 −4
  1044. net/ipv4/udp.c +3 −1
  1045. net/ipv4/xfrm4_policy.c +18 −22
  1046. net/ipv6/netfilter/nf_reject_ipv6.c +7 −8
  1047. net/ipv6/netfilter/nft_fib_ipv6.c +3 −2
  1048. net/ipv6/udp.c +3 −1
  1049. net/ipv6/xfrm6_policy.c +16 −15
  1050. net/l2tp/l2tp_netlink.c +2 −2
  1051. net/mac80211/Kconfig +1 −1
  1052. net/mac80211/cfg.c +16 −9
  1053. net/mac80211/ieee80211_i.h +6 −4
  1054. net/mac80211/key.c +25 −17
  1055. net/mac80211/link.c +4 −3
  1056. net/mac80211/main.c +2 −0
  1057. net/mctp/af_mctp.c +5 −1
  1058. net/mctp/device.c +18 −12
  1059. net/mctp/neigh.c +19 −12
  1060. net/mctp/route.c +23 −10
  1061. net/mpls/af_mpls.c +21 −11
  1062. net/mptcp/mib.c +3 −0
  1063. net/mptcp/mib.h +3 −0
  1064. net/mptcp/pm_netlink.c +4 −2
  1065. net/mptcp/protocol.c +23 −3
  1066. net/mptcp/protocol.h +1 −0
  1067. net/mptcp/subflow.c +15 −2
  1068. net/netfilter/nf_bpf_link.c +6 −1
  1069. net/netfilter/nft_payload.c +3 −0
  1070. net/netfilter/x_tables.c +1 −1
  1071. net/netfilter/xt_CHECKSUM.c +23 −10
  1072. net/netfilter/xt_CLASSIFY.c +14 −2
  1073. net/netfilter/xt_CONNSECMARK.c +25 −11
  1074. net/netfilter/xt_CT.c +69 −37
  1075. net/netfilter/xt_IDLETIMER.c +40 −19
  1076. net/netfilter/xt_LED.c +27 −12
  1077. net/netfilter/xt_NFLOG.c +25 −11
  1078. net/netfilter/xt_RATEEST.c +27 −12
  1079. net/netfilter/xt_SECMARK.c +25 −2
  1080. net/netfilter/xt_TRACE.c +25 −11
  1081. net/netfilter/xt_addrtype.c +13 −2
  1082. net/netfilter/xt_cluster.c +23 −10
  1083. net/netfilter/xt_connbytes.c +3 −1
  1084. net/netfilter/xt_connlimit.c +27 −12
  1085. net/netfilter/xt_connmark.c +25 −3
  1086. net/netfilter/xt_mark.c +32 −10
  1087. net/netlink/af_netlink.c +2 −1
  1088. net/netlink/genetlink.c +14 −14
  1089. net/phonet/pn_netlink.c +11 −17
  1090. net/rxrpc/ar-internal.h +1 −1
  1091. net/rxrpc/io_thread.c +8 −2
  1092. net/rxrpc/local_object.c +1 −1
  1093. net/rxrpc/sendmsg.c +5 −5
  1094. net/sched/act_api.c +22 −1
  1095. net/sched/cls_api.c +1 −0
  1096. net/sched/sch_api.c +7 −2
  1097. net/sched/sch_generic.c +7 −1
  1098. net/sched/sch_taprio.c +14 −7
  1099. net/sctp/socket.c +13 −5
  1100. net/smc/smc_inet.c +11 −0
  1101. net/smc/smc_pnet.c +1 −1
  1102. net/smc/smc_wr.c +5 −1
  1103. net/socket.c +6 −1
  1104. net/sunrpc/svc.c +4 −7
  1105. net/sunrpc/xprtrdma/ib_client.c +1 −0
  1106. net/vmw_vsock/virtio_transport.c +4 −4
  1107. net/vmw_vsock/virtio_transport_common.c +12 −2
  1108. net/vmw_vsock/vsock_bpf.c +0 −8
  1109. net/wireless/core.c +8 −0
  1110. net/wireless/nl80211.c +2 −6
  1111. net/wireless/scan.c +4 −0
  1112. net/xfrm/xfrm_device.c +8 −3
  1113. net/xfrm/xfrm_policy.c +38 −15
  1114. net/xfrm/xfrm_user.c +8 −2
  1115. rust/kernel/device.rs +3 −12
  1116. rust/kernel/firmware.rs +1 −1
  1117. scripts/Kconfig.include +3 −0
  1118. scripts/Makefile.compiler +7 −7
  1119. scripts/Makefile.package +6 −1
  1120. scripts/kconfig/menu.c +12 −1
  1121. scripts/mod/file2alias.c +6 −6
  1122. scripts/mod/sumversion.c +3 −2
  1123. scripts/package/builddeb +1 −1
  1124. scripts/package/install-extmod-build +2 −4
  1125. scripts/package/mkdebian +9 −1
  1126. scripts/rustc-llvm-version.sh +22 −0
  1127. security/ipe/Kconfig +19 −0
  1128. security/ipe/policy.c +15 −3
  1129. security/security.c +6 −4
  1130. sound/Kconfig +1 −1
  1131. sound/firewire/amdtp-stream.c +3 −0
  1132. sound/hda/intel-dsp-config.c +4 −0
  1133. sound/hda/intel-sdw-acpi.c +22 −11
  1134. sound/pci/hda/Kconfig +1 −1
  1135. sound/pci/hda/patch_conexant.c +19 −0
  1136. sound/pci/hda/patch_cs8409.c +3 −2
  1137. sound/pci/hda/patch_realtek.c +137 −25
  1138. sound/soc/amd/yc/acp6x-mach.c +14 −0
  1139. sound/soc/codecs/aw88399.c +1 −1
  1140. sound/soc/codecs/cs42l51.c +5 −2
  1141. sound/soc/codecs/lpass-rx-macro.c +7 −8
  1142. sound/soc/codecs/max98388.c +1 −0
  1143. sound/soc/codecs/pcm3060-i2c.c +2 −2
  1144. sound/soc/codecs/pcm3060-spi.c +2 −2
  1145. sound/soc/codecs/pcm3060.c +2 −2
  1146. sound/soc/codecs/pcm3060.h +1 −1
  1147. sound/soc/codecs/rt5640.c +15 −12
  1148. sound/soc/codecs/rt722-sdca-sdw.c +1 −1
  1149. sound/soc/codecs/wcd937x.c +10 −2
  1150. sound/soc/codecs/wcd937x.h +4 −0
  1151. sound/soc/fsl/fsl_esai.c +2 −2
  1152. sound/soc/fsl/fsl_micfil.c +80 −1
  1153. sound/soc/intel/atom/sst/sst_acpi.c +55 −9
  1154. sound/soc/intel/avs/core.c +2 −1
  1155. sound/soc/intel/avs/pcm.c +19 −0
  1156. sound/soc/intel/avs/pcm.h +16 −0
  1157. sound/soc/intel/boards/bytcr_rt5640.c +45 −3
  1158. sound/soc/intel/common/soc-acpi-intel-lnl-match.c +38 −0
  1159. sound/soc/loongson/loongson_card.c +1 −0
  1160. sound/soc/qcom/Kconfig +2 −0
  1161. sound/soc/qcom/lpass-cpu.c +2 −0
  1162. sound/soc/qcom/sc7280.c +9 −1
  1163. sound/soc/qcom/sdm845.c +6 −1
  1164. sound/soc/sh/rcar/core.c +5 −2
  1165. sound/soc/soc-dapm.c +4 −2
  1166. sound/soc/sof/amd/acp-loader.c +4 −1
  1167. sound/soc/sof/amd/acp.c +3 −1
  1168. sound/soc/sof/intel/hda-dai-ops.c +10 −13
  1169. sound/soc/sof/intel/hda-dai.c +33 −4
  1170. sound/soc/sof/intel/hda-loader.c +0 −17
  1171. sound/soc/sof/ipc4-topology.c +13 −2
  1172. sound/usb/line6/capture.c +1 −1
  1173. sound/usb/line6/capture.h +1 −1
  1174. sound/usb/line6/driver.c +2 −2
  1175. sound/usb/line6/driver.h +1 −1
  1176. sound/usb/line6/midi.c +1 −1
  1177. sound/usb/line6/midi.h +1 −1
  1178. sound/usb/line6/midibuf.c +1 −1
  1179. sound/usb/line6/midibuf.h +1 −1
  1180. sound/usb/line6/pcm.c +1 −1
  1181. sound/usb/line6/pcm.h +1 −1
  1182. sound/usb/line6/playback.c +1 −1
  1183. sound/usb/line6/playback.h +1 −1
  1184. sound/usb/line6/pod.c +1 −1
  1185. sound/usb/line6/toneport.c +1 −1
  1186. sound/usb/line6/variax.c +1 −1
  1187. sound/usb/mixer_quirks.c +3 −0
  1188. sound/usb/mixer_scarlett2.c +2 −0
  1189. sound/usb/stream.c +1 −0
  1190. tools/arch/arm64/include/asm/cputype.h +4 −0
  1191. tools/arch/arm64/vdso +0 −1
  1192. tools/arch/loongarch/vdso +0 −1
  1193. tools/arch/powerpc/vdso +0 −1
  1194. tools/arch/s390/vdso +0 −1
  1195. tools/arch/x86/include/asm/msr-index.h +22 −14
  1196. tools/arch/x86/include/uapi/asm/kvm.h +1 −0
  1197. tools/arch/x86/include/uapi/asm/unistd_32.h +3 −0
  1198. tools/arch/x86/include/uapi/asm/unistd_64.h +3 −0
  1199. tools/arch/x86/vdso +0 −1
  1200. tools/build/feature/Makefile +4 −1
  1201. tools/include/linux/bits.h +15 −0
  1202. tools/include/linux/unaligned.h +1 −10
  1203. tools/include/uapi/linux/bits.h +3 −0
  1204. tools/include/uapi/linux/bpf.h +13 −12
  1205. tools/include/uapi/linux/const.h +17 −0
  1206. tools/include/uapi/linux/in.h +1 −1
  1207. tools/include/vdso/unaligned.h +15 −0
  1208. tools/mm/page-types.c +5 −4
  1209. tools/mm/slabinfo.c +3 −1
  1210. tools/perf/Makefile.config +7 −4
  1211. tools/perf/builtin-trace.c +1 −1
  1212. tools/perf/check-header_ignore_hunks/lib/list_sort.c +31 −0
  1213. tools/perf/check-headers.sh +29 −1
  1214. tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh +54 −15
  1215. tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h +2 −2
  1216. tools/perf/trace/beauty/fs_at_flags.sh +5 −0
  1217. tools/perf/trace/beauty/include/linux/socket.h +1 −0
  1218. tools/perf/trace/beauty/include/uapi/linux/fcntl.h +60 −24
  1219. tools/perf/trace/beauty/include/uapi/linux/sched.h +1 −0
  1220. tools/perf/trace/beauty/include/uapi/sound/asound.h +16 −1
  1221. tools/perf/trace/beauty/msg_flags.c +4 −0
  1222. tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c +20 −2
  1223. tools/perf/util/cap.c +3 −7
  1224. tools/perf/util/cs-etm.c +1 −1
  1225. tools/perf/util/dwarf-aux.h +1 −0
  1226. tools/perf/util/python.c +3 −0
  1227. tools/perf/util/symbol.c +3 −0
  1228. tools/perf/util/syscalltbl.c +10 −0
  1229. tools/perf/util/vdso.c +3 −1
  1230. tools/sched_ext/include/scx/common.bpf.h +4 −4
  1231. tools/sched_ext/scx_qmap.bpf.c +2 −2
  1232. tools/testing/cxl/test/cxl.c +108 −92
  1233. tools/testing/cxl/test/mem.c +1 −0
  1234. tools/testing/radix-tree/maple.c +110 −0
  1235. tools/testing/selftests/Makefile +5 −4
  1236. tools/testing/selftests/bpf/Makefile +20 −2
  1237. tools/testing/selftests/bpf/bpf_test_modorder_x/Makefile +19 −0
  1238. tools/testing/selftests/bpf/bpf_test_modorder_x/bpf_test_modorder_x.c +39 −0
  1239. tools/testing/selftests/bpf/bpf_test_modorder_y/Makefile +19 −0
  1240. tools/testing/selftests/bpf/bpf_test_modorder_y/bpf_test_modorder_y.c +39 −0
  1241. tools/testing/selftests/bpf/map_tests/lpm_trie_map_get_next_key.c +109 −0
  1242. tools/testing/selftests/bpf/prog_tests/bpf_iter.c +22 −5
  1243. tools/testing/selftests/bpf/prog_tests/cgroup_ancestor.c +1 −1
  1244. tools/testing/selftests/bpf/prog_tests/cpumask.c +1 −0
  1245. tools/testing/selftests/bpf/prog_tests/fill_link_info.c +15 −3
  1246. tools/testing/selftests/bpf/prog_tests/kfunc_module_order.c +55 −0
  1247. tools/testing/selftests/bpf/prog_tests/netfilter_link_attach.c +40 −2
  1248. tools/testing/selftests/bpf/prog_tests/verifier.c +21 −0
  1249. tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c +117 −8
  1250. tools/testing/selftests/bpf/progs/cpumask_common.h +5 −0
  1251. tools/testing/selftests/bpf/progs/cpumask_failure.c +35 −0
  1252. tools/testing/selftests/bpf/progs/cpumask_success.c +76 −2
  1253. tools/testing/selftests/bpf/progs/kfunc_module_order.c +30 −0
  1254. tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c +1 −1
  1255. tools/testing/selftests/bpf/progs/verifier_bits_iter.c +58 −3
  1256. tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c +0 −55
  1257. tools/testing/selftests/bpf/progs/verifier_const.c +30 −1
  1258. tools/testing/selftests/bpf/progs/verifier_linked_scalars.c +34 −0
  1259. tools/testing/selftests/bpf/progs/verifier_movsx.c +40 −0
  1260. tools/testing/selftests/bpf/progs/verifier_mtu.c +18 −0
  1261. tools/testing/selftests/bpf/progs/verifier_scalar_ids.c +67 −0
  1262. tools/testing/selftests/bpf/progs/verifier_search_pruning.c +23 −0
  1263. tools/testing/selftests/bpf/testing_helpers.c +22 −12
  1264. tools/testing/selftests/bpf/testing_helpers.h +2 −0
  1265. tools/testing/selftests/bpf/veristat.cfg +1 −0
  1266. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-profiler.tc +31 −0
  1267. tools/testing/selftests/hid/Makefile +1 −0
  1268. tools/testing/selftests/intel_pstate/run.sh +7 −2
  1269. tools/testing/selftests/kvm/Makefile +3 −0
  1270. tools/testing/selftests/kvm/aarch64/set_id_regs.c +13 −3
  1271. tools/testing/selftests/kvm/x86_64/cpuid_test.c +1 −1
  1272. tools/testing/selftests/mm/hmm-tests.c +1 −1
  1273. tools/testing/selftests/mm/khugepaged.c +1 −1
  1274. tools/testing/selftests/mm/uffd-unit-tests.c +5 −0
  1275. tools/testing/selftests/mount_setattr/mount_setattr_test.c +9 −0
  1276. tools/testing/selftests/net/.gitignore +1 −0
  1277. tools/testing/selftests/net/forwarding/ip6gre_flat.sh +14 −0
  1278. tools/testing/selftests/net/forwarding/ip6gre_flat_key.sh +14 −0
  1279. tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh +14 −0
  1280. tools/testing/selftests/net/forwarding/ip6gre_hier.sh +14 −0
  1281. tools/testing/selftests/net/forwarding/ip6gre_hier_key.sh +14 −0
  1282. tools/testing/selftests/net/forwarding/ip6gre_hier_keys.sh +14 −0
  1283. tools/testing/selftests/net/forwarding/ip6gre_lib.sh +80 −0
  1284. tools/testing/selftests/net/forwarding/no_forwarding.sh +1 −1
  1285. tools/testing/selftests/net/lib/py/nsim.py +1 −0
  1286. tools/testing/selftests/net/mptcp/mptcp_connect.sh +9 −0
  1287. tools/testing/selftests/net/mptcp/mptcp_join.sh +85 −30
  1288. tools/testing/selftests/net/netfilter/Makefile +1 −0
  1289. tools/testing/selftests/net/netfilter/config +2 −0
  1290. tools/testing/selftests/net/netfilter/conntrack_dump_flush.c +3 −3
  1291. tools/testing/selftests/net/netfilter/conntrack_vrf.sh +33 −0
  1292. tools/testing/selftests/net/netfilter/nft_flowtable.sh +21 −18
  1293. tools/testing/selftests/net/netfilter/vxlan_mtu_frag.sh +121 −0
  1294. tools/testing/selftests/net/rds/.gitignore +1 −0
  1295. tools/testing/selftests/net/rds/Makefile +1 −1
  1296. tools/testing/selftests/net/rds/test.py +4 −1
  1297. tools/testing/selftests/net/ynl.mk +4 −0
  1298. tools/testing/selftests/rseq/rseq.c +75 −35
  1299. tools/testing/selftests/rseq/rseq.h +2 −8
  1300. tools/testing/selftests/sched_ext/Makefile +33 −40
  1301. tools/testing/selftests/sched_ext/create_dsq.bpf.c +3 −3
  1302. tools/testing/selftests/sched_ext/ddsp_bogus_dsq_fail.bpf.c +2 −2
  1303. tools/testing/selftests/sched_ext/ddsp_vtimelocal_fail.bpf.c +2 −2
  1304. tools/testing/selftests/sched_ext/dsp_local_on.bpf.c +4 −4
  1305. tools/testing/selftests/sched_ext/enq_last_no_enq_fails.bpf.c +8 −0
  1306. tools/testing/selftests/sched_ext/enq_last_no_enq_fails.c +7 −3
  1307. tools/testing/selftests/sched_ext/enq_select_cpu_fails.bpf.c +2 −2
  1308. tools/testing/selftests/sched_ext/exit.bpf.c +12 −10
  1309. tools/testing/selftests/sched_ext/hotplug.bpf.c +4 −4
  1310. tools/testing/selftests/sched_ext/init_enable_count.bpf.c +4 −4
  1311. tools/testing/selftests/sched_ext/maximal.bpf.c +29 −29
  1312. tools/testing/selftests/sched_ext/maybe_null.bpf.c +3 −3
  1313. tools/testing/selftests/sched_ext/maybe_null_fail_dsp.bpf.c +2 −2
  1314. tools/testing/selftests/sched_ext/maybe_null_fail_yld.bpf.c +2 −2
  1315. tools/testing/selftests/sched_ext/prog_run.bpf.c +1 −1
  1316. tools/testing/selftests/sched_ext/select_cpu_dfl.bpf.c +1 −1
  1317. tools/testing/selftests/sched_ext/select_cpu_dfl_nodispatch.bpf.c +3 −3
  1318. tools/testing/selftests/sched_ext/select_cpu_dispatch.bpf.c +1 −1
  1319. tools/testing/selftests/sched_ext/select_cpu_dispatch_bad_dsq.bpf.c +2 −2
  1320. tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf.c +2 −2
  1321. tools/testing/selftests/sched_ext/select_cpu_vtime.bpf.c +6 −6
  1322. tools/testing/selftests/vDSO/Makefile +2 −4
  1323. tools/testing/selftests/vDSO/vdso_test_chacha.c +21 −15
  1324. tools/testing/selftests/vDSO/vdso_test_getrandom.c +34 −42
  1325. tools/testing/selftests/vDSO/vgetrandom-chacha.S +18 −0
  1326. tools/testing/selftests/watchdog/watchdog-test.c +6 −0
  1327. tools/testing/vma/vma.c +40 −0
  1328. tools/usb/usbip/src/usbip_detach.c +1 −0
  1329. virt/kvm/kvm_main.c +1 −13
.mailmap+14−2
@@ -73,6 +73,8 @@ Andrey Ryabinin <ryabinin.a.a@gmail.com> <aryabinin@virtuozzo.com> · 72 unmodified lines
7373 Andrzej Hajda <andrzej.hajda@intel.com> <a.hajda@samsung.com>
7474 André Almeida <andrealmeid@igalia.com> <andrealmeid@collabora.com>
7575 Andy Adamson <andros@citi.umich.edu>
76+Andy Chiu <andybnac@gmail.com> <andy.chiu@sifive.com>
77+Andy Chiu <andybnac@gmail.com> <taochiu@synology.com>
7678 Andy Shevchenko <andy@kernel.org> <andy@smile.org.ua>
7779 Andy Shevchenko <andy@kernel.org> <ext-andriy.shevchenko@nokia.com>
7880 Anilkumar Kolli <quic_akolli@quicinc.com> <akolli@codeaurora.org>
@@ -197,18 +199,23 @@ Elliot Berman <quic_eberman@quicinc.com> <eberman@codeaurora.org> · 118 unmodified lines
197199 Enric Balletbo i Serra <eballetbo@kernel.org> <enric.balletbo@collabora.com>
198200 Enric Balletbo i Serra <eballetbo@kernel.org> <eballetbo@iseebcn.com>
199201 Erik Kaneda <erik.kaneda@intel.com> <erik.schmauss@intel.com>
200−Eugen Hristev <eugen.hristev@collabora.com> <eugen.hristev@microchip.com>
202+Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@microchip.com>
203+Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@collabora.com>
201204 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
202205 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> <ezequiel@collabora.com>
203206 Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
204207 Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@intel.com>
205208 Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@collabora.com>
209+Fangrui Song <i@maskray.me> <maskray@google.com>
206210 Felipe W Damasio <felipewd@terra.com.br>
207211 Felix Kuhling <fxkuehl@gmx.de>
208212 Felix Moeller <felix@derklecks.de>
209213 Fenglin Wu <quic_fenglinw@quicinc.com> <fenglinw@codeaurora.org>
210214 Filipe Lautert <filipe@icewall.org>
211215 Finn Thain <fthain@linux-m68k.org> <fthain@telegraphics.com.au>
216+Fiona Behrens <me@kloenk.dev>
217+Fiona Behrens <me@kloenk.dev> <me@kloenk.de>
218+Fiona Behrens <me@kloenk.dev> <fin@nyantec.com>
212219 Franck Bui-Huu <vagabon.xyz@gmail.com>
213220 Frank Rowand <frowand.list@gmail.com> <frank.rowand@am.sony.com>
214221 Frank Rowand <frowand.list@gmail.com> <frank.rowand@sony.com>
@@ -276,7 +283,7 @@ Jan Glauber <jan.glauber@gmail.com> <jglauber@cavium.com> · 61 unmodified lines
276283 Jan Kuliga <jtkuliga.kdev@gmail.com> <jankul@alatek.krakow.pl>
277284 Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@linux.intel.com>
278285 Jarkko Sakkinen <jarkko@kernel.org> <jarkko@profian.com>
279−Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@tuni.fi>
286+Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@parity.io>
280287 Jason Gunthorpe <jgg@ziepe.ca> <jgg@mellanox.com>
281288 Jason Gunthorpe <jgg@ziepe.ca> <jgg@nvidia.com>
282289 Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com>
@@ -300,6 +307,11 @@ Jens Axboe <axboe@kernel.dk> <axboe@fb.com> · 17 unmodified lines
300307 Jens Axboe <axboe@kernel.dk> <axboe@meta.com>
301308 Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
302309 Jernej Skrabec <jernej.skrabec@gmail.com> <jernej.skrabec@siol.net>
310+Jesper Dangaard Brouer <hawk@kernel.org> <brouer@redhat.com>
311+Jesper Dangaard Brouer <hawk@kernel.org> <hawk@comx.dk>
312+Jesper Dangaard Brouer <hawk@kernel.org> <jbrouer@redhat.com>
313+Jesper Dangaard Brouer <hawk@kernel.org> <jdb@comx.dk>
314+Jesper Dangaard Brouer <hawk@kernel.org> <netoptimizer@brouer.com>
303315 Jessica Zhang <quic_jesszhan@quicinc.com> <jesszhan@codeaurora.org>
304316 Jilai Wang <quic_jilaiw@quicinc.com> <jilaiw@codeaurora.org>
305317 Jiri Kosina <jikos@kernel.org> <jikos@jikos.cz>
CREDITS+27−27
@@ -1358,10 +1358,6 @@ D: Major kbuild rework during the 2.5 cycle · 1357 unmodified lines
13581358 D: ISDN Maintainer
13591359 S: USA
13601360
1361−N: Gerrit Renker
1362−E: gerrit@erg.abdn.ac.uk
1363−D: DCCP protocol support.
1364−
13651361 N: Philip Gladstone
13661362 E: philip@gladstonefamily.net
13671363 D: Kernel / timekeeping stuff
@@ -1677,11 +1673,6 @@ W: http://www.carumba.com/ · 309 unmodified lines
16771673 D: bug toaster (A1 sauce makes all the difference)
16781674 D: Random linux hacker
16791675
1680−N: James Hogan
1681−E: jhogan@kernel.org
1682−D: Metag architecture maintainer
1683−D: TZ1090 SoC maintainer
1684−
16851676 N: Tim Hockin
16861677 E: thockin@hockin.org
16871678 W: http://www.hockin.org/~thockin
@@ -1697,6 +1688,11 @@ D: hwmon subsystem maintainer · 9 unmodified lines
16971688 D: i2c-sis96x and i2c-stub SMBus drivers
16981689 S: USA
16991690
1691+N: James Hogan
1692+E: jhogan@kernel.org
1693+D: Metag architecture maintainer
1694+D: TZ1090 SoC maintainer
1695+
17001696 N: Dirk Hohndel
17011697 E: hohndel@suse.de
17021698 D: The XFree86[tm] Project
@@ -1872,6 +1868,10 @@ S: K osmidomkum 723 · 169 unmodified lines
18721868 S: 160 00 Praha 6
18731869 S: Czech Republic
18741870
1871+N: Seth Jennings
1872+E: sjenning@redhat.com
1873+D: Creation and maintenance of zswap
1874+
18751875 N: Jeremy Kerr
18761876 D: Maintainer of SPU File System
18771877
@@ -2188,19 +2188,6 @@ N: Mike Kravetz · 310 unmodified lines
21882188 E: mike.kravetz@oracle.com
21892189 D: Maintenance and development of the hugetlb subsystem
21902190
2191−N: Seth Jennings
2192−E: sjenning@redhat.com
2193−D: Creation and maintenance of zswap
2194−
2195−N: Dan Streetman
2196−E: ddstreet@ieee.org
2197−D: Maintenance and development of zswap
2198−D: Creation and maintenance of the zpool API
2199−
2200−N: Vitaly Wool
2201−E: vitaly.wool@konsulko.com
2202−D: Maintenance and development of zswap
2203−
22042191 N: Andreas S. Krebs
22052192 E: akrebs@altavista.net
22062193 D: CYPRESS CY82C693 chipset IDE, Digital's PC-Alpha 164SX boards
@@ -3191,6 +3178,11 @@ N: Ken Pizzini · 984 unmodified lines
31913178 E: ken@halcyon.com
31923179 D: CDROM driver "sonycd535" (Sony CDU-535/531)
31933180
3181+N: Mathieu Poirier
3182+E: mathieu.poirier@linaro.org
3183+D: CoreSight kernel subsystem, Maintainer 2014-2022
3184+D: Perf tool support for CoreSight
3185+
31943186 N: Stelian Pop
31953187 E: stelian@popies.net
31963188 P: 1024D/EDBB6147 7B36 0E07 04BC 11DC A7A0 D3F7 7185 9E7A EDBB 6147
@@ -3300,6 +3292,10 @@ S: Schlossbergring 9 · 103 unmodified lines
33003292 S: 79098 Freiburg
33013293 S: Germany
33023294
3295+N: Gerrit Renker
3296+E: gerrit@erg.abdn.ac.uk
3297+D: DCCP protocol support.
3298+
33033299 N: Thomas Renninger
33043300 E: trenn@suse.de
33053301 D: cpupowerutils
@@ -3576,11 +3572,6 @@ D: several improvements to system programs · 270 unmodified lines
35763572 S: Oldenburg
35773573 S: Germany
35783574
3579−N: Mathieu Poirier
3580−E: mathieu.poirier@linaro.org
3581−D: CoreSight kernel subsystem, Maintainer 2014-2022
3582−D: Perf tool support for CoreSight
3583−
35843575 N: Robert Schwebel
35853576 E: robert@schwebel.de
35863577 W: https://www.schwebel.de
@@ -3771,6 +3762,11 @@ S: Chr. Winthersvej 1 B, st.th. · 184 unmodified lines
37713762 S: DK-1860 Frederiksberg C
37723763 S: Denmark
37733764
3765+N: Dan Streetman
3766+E: ddstreet@ieee.org
3767+D: Maintenance and development of zswap
3768+D: Creation and maintenance of the zpool API
3769+
37743770 N: Drew Sullivan
37753771 E: drew@ss.org
37763772 W: http://www.ss.org/
@@ -4286,6 +4282,10 @@ S: Pipers Way · 509 unmodified lines
42864282 S: Swindon. SN3 1RJ
42874283 S: England
42884284
4285+N: Vitaly Wool
4286+E: vitaly.wool@konsulko.com
4287+D: Maintenance and development of zswap
4288+
42894289 N: Chris Wright
42904290 E: chrisw@sous-sol.org
42914291 D: hacking on LSM framework and security modules.
Documentation/admin-guide/LSM/ipe.rst+5−2
@@ -223,7 +223,10 @@ are signed through the PKCS#7 message format to enforce some level of · 222 unmodified lines
223223 authorization of the policies (prohibiting an attacker from gaining
224224 unconstrained root, and deploying an "allow all" policy). These
225225 policies must be signed by a certificate that chains to the
226−``SYSTEM_TRUSTED_KEYRING``. With openssl, the policy can be signed by::
226+``SYSTEM_TRUSTED_KEYRING``, or to the secondary and/or platform keyrings if
227+``CONFIG_IPE_POLICY_SIG_SECONDARY_KEYRING`` and/or
228+``CONFIG_IPE_POLICY_SIG_PLATFORM_KEYRING`` are enabled, respectively.
229+With openssl, the policy can be signed by::
227230
228231 openssl smime -sign \
229232 -in "$MY_POLICY" \
@@ -266,7 +269,7 @@ in the kernel. This file is write-only and accepts a PKCS#7 signed · 36 unmodified lines
266269 policy. Two checks will always be performed on this policy: First, the
267270 ``policy_names`` must match with the updated version and the existing
268271 version. Second the updated policy must have a policy version greater than
269−or equal to the currently-running version. This is to prevent rollback attacks.
272+the currently-running version. This is to prevent rollback attacks.
270273
271274 The ``delete`` file is used to remove a policy that is no longer needed.
272275 This file is write-only and accepts a value of ``1`` to delete the policy.
Documentation/admin-guide/pm/cpufreq.rst+10−10
@@ -425,8 +425,8 @@ This governor exposes only one tunable: · 424 unmodified lines
425425
426426 ``rate_limit_us``
427427 Minimum time (in microseconds) that has to pass between two consecutive
428− runs of governor computations (default: 1000 times the scaling driver's
429− transition latency).
428+ runs of governor computations (default: 1.5 times the scaling driver's
429+ transition latency or the maximum 2ms).
430430
431431 The purpose of this tunable is to reduce the scheduler context overhead
432432 of the governor which might be excessive without it.
@@ -474,17 +474,17 @@ This governor exposes the following tunables: · 41 unmodified lines
474474 This is how often the governor's worker routine should run, in
475475 microseconds.
476476
477− Typically, it is set to values of the order of 10000 (10 ms). Its
478− default value is equal to the value of ``cpuinfo_transition_latency``
479− for each policy this governor is attached to (but since the unit here
480− is greater by 1000, this means that the time represented by
481− ``sampling_rate`` is 1000 times greater than the transition latency by
482− default).
477+ Typically, it is set to values of the order of 2000 (2 ms). Its
478+ default value is to add a 50% breathing room
479+ to ``cpuinfo_transition_latency`` on each policy this governor is
480+ attached to. The minimum is typically the length of two scheduler
481+ ticks.
483482
484483 If this tunable is per-policy, the following shell command sets the time
485− represented by it to be 750 times as high as the transition latency::
484+ represented by it to be 1.5 times as high as the transition latency
485+ (the default)::
486486
487− # echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) > ondemand/sampling_rate
487+ # echo `$(($(cat cpuinfo_transition_latency) * 3 / 2)) > ondemand/sampling_rate
488488
489489 ``up_threshold``
490490 If the estimated CPU load is above this value (in percent), the governor
Documentation/core-api/protection-keys.rst+30−8
@@ -12,7 +12,10 @@ Pkeys Userspace (PKU) is a feature which can be found on: · 11 unmodified lines
1212 * Intel server CPUs, Skylake and later
1313 * Intel client CPUs, Tiger Lake (11th Gen Core) and later
1414 * Future AMD CPUs
15+ * arm64 CPUs implementing the Permission Overlay Extension (FEAT_S1POE)
1516
17+x86_64
18+======
1619 Pkeys work by dedicating 4 previously Reserved bits in each page table entry to
1720 a "protection key", giving 16 possible keys.
1821
@@ -28,6 +31,22 @@ register. The feature is only available in 64-bit mode, even though there is · 9 unmodified lines
2831 theoretically space in the PAE PTEs. These permissions are enforced on data
2932 access only and have no effect on instruction fetches.
3033
34+arm64
35+=====
36+
37+Pkeys use 3 bits in each page table entry, to encode a "protection key index",
38+giving 8 possible keys.
39+
40+Protections for each key are defined with a per-CPU user-writable system
41+register (POR_EL0). This is a 64-bit register encoding read, write and execute
42+overlay permissions for each protection key index.
43+
44+Being a CPU register, POR_EL0 is inherently thread-local, potentially giving
45+each thread a different set of protections from every other thread.
46+
47+Unlike x86_64, the protection key permissions also apply to instruction
48+fetches.
49+
3150 Syscalls
3251 ========
3352
@@ -38,11 +57,10 @@ There are 3 system calls which directly interact with pkeys:: · 4 unmodified lines
3857 int pkey_mprotect(unsigned long start, size_t len,
3958 unsigned long prot, int pkey);
4059
41−Before a pkey can be used, it must first be allocated with
42−pkey_alloc(). An application calls the WRPKRU instruction
43−directly in order to change access permissions to memory covered
44−with a key. In this example WRPKRU is wrapped by a C function
45−called pkey_set().
60+Before a pkey can be used, it must first be allocated with pkey_alloc(). An
61+application writes to the architecture specific CPU register directly in order
62+to change access permissions to memory covered with a key. In this example
63+this is wrapped by a C function called pkey_set().
4664 ::
4765
4866 int real_prot = PROT_READ|PROT_WRITE;
@@ -64,9 +82,9 @@ is no longer in use:: · 15 unmodified lines
6482 munmap(ptr, PAGE_SIZE);
6583 pkey_free(pkey);
6684
67−.. note:: pkey_set() is a wrapper for the RDPKRU and WRPKRU instructions.
68− An example implementation can be found in
69− tools/testing/selftests/x86/protection_keys.c.
85+.. note:: pkey_set() is a wrapper around writing to the CPU register.
86+ Example implementations can be found in
87+ tools/testing/selftests/mm/pkey-{arm64,powerpc,x86}.h
7088
7189 Behavior
7290 ========
@@ -96,3 +114,7 @@ with a read():: · 23 unmodified lines
96114 The kernel will send a SIGSEGV in both cases, but si_code will be set
97115 to SEGV_PKERR when violating protection keys versus SEGV_ACCERR when
98116 the plain mprotect() permissions are violated.
117+
118+Note that kernel accesses from a kthread (such as io_uring) will use a default
119+value for the protection key register and so will not be consistent with
120+userspace's value of the register or mprotect().
Documentation/devicetree/bindings/display/elgin,jg10309-01.yaml+54−0
@@ -0,0 +1,54 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/display/elgin,jg10309-01.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Elgin JG10309-01 SPI-controlled display
8+
9+maintainers:
10+ - Fabio Estevam <festevam@gmail.com>
11+
12+description: |
13+ The Elgin JG10309-01 SPI-controlled display is used on the RV1108-Elgin-r1
14+ board and is a custom display.
15+
16+allOf:
17+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
18+
19+properties:
20+ compatible:
21+ const: elgin,jg10309-01
22+
23+ reg:
24+ maxItems: 1
25+
26+ spi-max-frequency:
27+ maximum: 24000000
28+
29+ spi-cpha: true
30+
31+ spi-cpol: true
32+
33+required:
34+ - compatible
35+ - reg
36+ - spi-cpha
37+ - spi-cpol
38+
39+additionalProperties: false
40+
41+examples:
42+ - |
43+ spi {
44+ #address-cells = <1>;
45+ #size-cells = <0>;
46+
47+ display@0 {
48+ compatible = "elgin,jg10309-01";
49+ reg = <0>;
50+ spi-max-frequency = <24000000>;
51+ spi-cpha;
52+ spi-cpol;
53+ };
54+ };
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml+10−14
@@ -63,6 +63,16 @@ properties: · 62 unmodified lines
6363 - const: sleep
6464
6565 power-domains:
66+ description: |
67+ The MediaTek DPI module is typically associated with one of the
68+ following multimedia power domains:
69+ POWER_DOMAIN_DISPLAY
70+ POWER_DOMAIN_VDOSYS
71+ POWER_DOMAIN_MM
72+ The specific power domain used varies depending on the SoC design.
73+
74+ It is recommended to explicitly add the appropriate power domain
75+ property to the DPI node in the device tree.
6676 maxItems: 1
6777
6878 port:
@@ -79,20 +89,6 @@ required: · 10 unmodified lines
7989 - clock-names
8090 - port
8191
82−allOf:
83− - if:
84− not:
85− properties:
86− compatible:
87− contains:
88− enum:
89− - mediatek,mt6795-dpi
90− - mediatek,mt8173-dpi
91− - mediatek,mt8186-dpi
92− then:
93− properties:
94− power-domains: false
95−
9692 additionalProperties: false
9793
9894 examples:
Documentation/devicetree/bindings/display/mediatek/mediatek,split.yaml+19−0
@@ -38,6 +38,7 @@ properties: · 37 unmodified lines
3838 description: A phandle and PM domain specifier as defined by bindings of
3939 the power controller specified by phandle. See
4040 Documentation/devicetree/bindings/power/power-domain.yaml for details.
41+ maxItems: 1
4142
4243 mediatek,gce-client-reg:
4344 description:
@@ -57,6 +58,9 @@ properties: · 13 unmodified lines
5758 clocks:
5859 items:
5960 - description: SPLIT Clock
61+ - description: Used for interfacing with the HDMI RX signal source.
62+ - description: Paired with receiving HDMI RX metadata.
63+ minItems: 1
6064
6165 required:
6266 - compatible
@@ -72,9 +76,24 @@ allOf: · 9 unmodified lines
7276 const: mediatek,mt8195-mdp3-split
7377
7478 then:
79+ properties:
80+ clocks:
81+ minItems: 3
82+
7583 required:
7684 - mediatek,gce-client-reg
7785
86+ - if:
87+ properties:
88+ compatible:
89+ contains:
90+ const: mediatek,mt8173-disp-split
91+
92+ then:
93+ properties:
94+ clocks:
95+ maxItems: 1
96+
7897 additionalProperties: false
7998
8099 examples:
Documentation/devicetree/bindings/iio/adc/adi,ad7380.yaml+21−0
@@ -67,6 +67,10 @@ properties: · 66 unmodified lines
6767 A 2.5V to 3.3V supply for the external reference voltage. When omitted,
6868 the internal 2.5V reference is used.
6969
70+ refin-supply:
71+ description:
72+ A 2.5V to 3.3V supply for external reference voltage, for ad7380-4 only.
73+
7074 aina-supply:
7175 description:
7276 The common mode voltage supply for the AINA- pin on pseudo-differential
@@ -135,6 +139,23 @@ allOf: · 62 unmodified lines
135139 ainc-supply: false
136140 aind-supply: false
137141
142+ # ad7380-4 uses refin-supply as external reference.
143+ # All other chips from ad738x family use refio as optional external reference.
144+ # When refio-supply is omitted, internal reference is used.
145+ - if:
146+ properties:
147+ compatible:
148+ enum:
149+ - adi,ad7380-4
150+ then:
151+ properties:
152+ refio-supply: false
153+ required:
154+ - refin-supply
155+ else:
156+ properties:
157+ refin-supply: false
158+
138159 examples:
139160 - |
140161 #include <dt-bindings/interrupt-controller/irq.h>
Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml+17−36
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 $id: http://devicetree.org/schemas/iio/dac/adi,ad5686.yaml#
55 $schema: http://devicetree.org/meta-schemas/core.yaml#
66
7−title: Analog Devices AD5360 and similar DACs
7+title: Analog Devices AD5360 and similar SPI DACs
88
99 maintainers:
1010 - Michael Hennerich <michael.hennerich@analog.com>
@@ -12,41 +12,22 @@ maintainers: · 1 unmodified line
1212
1313 properties:
1414 compatible:
15− oneOf:
16− - description: SPI devices
17− enum:
18− - adi,ad5310r
19− - adi,ad5672r
20− - adi,ad5674r
21− - adi,ad5676
22− - adi,ad5676r
23− - adi,ad5679r
24− - adi,ad5681r
25− - adi,ad5682r
26− - adi,ad5683
27− - adi,ad5683r
28− - adi,ad5684
29− - adi,ad5684r
30− - adi,ad5685r
31− - adi,ad5686
32− - adi,ad5686r
33− - description: I2C devices
34− enum:
35− - adi,ad5311r
36− - adi,ad5337r
37− - adi,ad5338r
38− - adi,ad5671r
39− - adi,ad5675r
40− - adi,ad5691r
41− - adi,ad5692r
42− - adi,ad5693
43− - adi,ad5693r
44− - adi,ad5694
45− - adi,ad5694r
46− - adi,ad5695r
47− - adi,ad5696
48− - adi,ad5696r
49−
15+ enum:
16+ - adi,ad5310r
17+ - adi,ad5672r
18+ - adi,ad5674r
19+ - adi,ad5676
20+ - adi,ad5676r
21+ - adi,ad5679r
22+ - adi,ad5681r
23+ - adi,ad5682r
24+ - adi,ad5683
25+ - adi,ad5683r
26+ - adi,ad5684
27+ - adi,ad5684r
28+ - adi,ad5685r
29+ - adi,ad5686
30+ - adi,ad5686r
5031
5132 reg:
5233 maxItems: 1
Documentation/devicetree/bindings/iio/dac/adi,ad5696.yaml+2−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 $id: http://devicetree.org/schemas/iio/dac/adi,ad5696.yaml#
55 $schema: http://devicetree.org/meta-schemas/core.yaml#
66
7−title: Analog Devices AD5696 and similar multi-channel DACs
7+title: Analog Devices AD5696 and similar I2C multi-channel DACs
88
99 maintainers:
1010 - Michael Auchter <michael.auchter@ni.com>
@@ -16,6 +16,7 @@ properties: · 5 unmodified lines
1616 compatible:
1717 enum:
1818 - adi,ad5311r
19+ - adi,ad5337r
1920 - adi,ad5338r
2021 - adi,ad5671r
2122 - adi,ad5675r
Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml+23−3
@@ -82,9 +82,6 @@ allOf: · 81 unmodified lines
8282 enum:
8383 - fsl,ls1043a-extirq
8484 - fsl,ls1046a-extirq
85− - fsl,ls1088a-extirq
86− - fsl,ls2080a-extirq
87− - fsl,lx2160a-extirq
8885 then:
8986 properties:
9087 interrupt-map:
@@ -95,6 +92,29 @@ allOf: · 4 unmodified lines
9592 - const: 0xf
9693 - const: 0
9794
95+ - if:
96+ properties:
97+ compatible:
98+ contains:
99+ enum:
100+ - fsl,ls1088a-extirq
101+ - fsl,ls2080a-extirq
102+ - fsl,lx2160a-extirq
103+# The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
104+# function to parser interrupt-map. So it doesn't consider '#address-size'
105+# in parent interrupt controller, such as GIC.
106+#
107+# When dt-binding verify interrupt-map, item data matrix is spitted at
108+# incorrect position. Remove interrupt-map restriction because it always
109+# wrong.
110+
111+ then:
112+ properties:
113+ interrupt-map-mask:
114+ items:
115+ - const: 0xf
116+ - const: 0
117+
98118 additionalProperties: false
99119
100120 examples:
Documentation/devicetree/bindings/misc/fsl,qoriq-mc.yaml+1−1
@@ -113,7 +113,7 @@ properties: · 112 unmodified lines
113113
114114 msi-parent:
115115 deprecated: true
116− $ref: /schemas/types.yaml#/definitions/phandle
116+ maxItems: 1
117117 description:
118118 Describes the MSI controller node handling message
119119 interrupts for the MC. When there is no translation
Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml+1−0
@@ -26,6 +26,7 @@ properties: · 25 unmodified lines
2626 - brcm,asp-v2.1-mdio
2727 - brcm,asp-v2.2-mdio
2828 - brcm,unimac-mdio
29+ - brcm,bcm6846-mdio
2930
3031 reg:
3132 minItems: 1
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml+3−2
@@ -154,8 +154,6 @@ allOf: · 153 unmodified lines
154154 - qcom,sm8550-qmp-gen4x2-pcie-phy
155155 - qcom,sm8650-qmp-gen3x2-pcie-phy
156156 - qcom,sm8650-qmp-gen4x2-pcie-phy
157− - qcom,x1e80100-qmp-gen3x2-pcie-phy
158− - qcom,x1e80100-qmp-gen4x2-pcie-phy
159157 then:
160158 properties:
161159 clocks:
@@ -171,6 +169,8 @@ allOf: · 9 unmodified lines
171169 - qcom,sc8280xp-qmp-gen3x1-pcie-phy
172170 - qcom,sc8280xp-qmp-gen3x2-pcie-phy
173171 - qcom,sc8280xp-qmp-gen3x4-pcie-phy
172+ - qcom,x1e80100-qmp-gen3x2-pcie-phy
173+ - qcom,x1e80100-qmp-gen4x2-pcie-phy
174174 - qcom,x1e80100-qmp-gen4x4-pcie-phy
175175 then:
176176 properties:
@@ -201,6 +201,7 @@ allOf: · 24 unmodified lines
201201 - qcom,sm8550-qmp-gen4x2-pcie-phy
202202 - qcom,sm8650-qmp-gen4x2-pcie-phy
203203 - qcom,x1e80100-qmp-gen4x2-pcie-phy
204+ - qcom,x1e80100-qmp-gen4x4-pcie-phy
204205 then:
205206 properties:
206207 resets:
Documentation/devicetree/bindings/sound/davinci-mcasp-audio.yaml+9−9
@@ -102,21 +102,21 @@ properties: · 101 unmodified lines
102102 default: 2
103103
104104 interrupts:
105− oneOf:
106− - minItems: 1
107− items:
108− - description: TX interrupt
109− - description: RX interrupt
110− - items:
111− - description: common/combined interrupt
105+ minItems: 1
106+ maxItems: 2
112107
113108 interrupt-names:
114109 oneOf:
115− - minItems: 1
110+ - description: TX interrupt
111+ const: tx
112+ - description: RX interrupt
113+ const: rx
114+ - description: TX and RX interrupts
116115 items:
117116 - const: tx
118117 - const: rx
119− - const: common
118+ - description: Common/combined interrupt
119+ const: common
120120
121121 fck_parent:
122122 $ref: /schemas/types.yaml#/definitions/string
Documentation/devicetree/bindings/sound/rockchip,rk3308-codec.yaml+4−0
@@ -48,6 +48,10 @@ properties: · 47 unmodified lines
4848 - const: mclk_rx
4949 - const: hclk
5050
51+ port:
52+ $ref: audio-graph-port.yaml#
53+ unevaluatedProperties: false
54+
5155 resets:
5256 maxItems: 1
5357
Documentation/devicetree/bindings/trivial-devices.yaml+0−2
@@ -101,8 +101,6 @@ properties: · 100 unmodified lines
101101 - domintech,dmard09
102102 # DMARD10: 3-axis Accelerometer
103103 - domintech,dmard10
104− # Elgin SPI-controlled LCD
105− - elgin,jg10309-01
106104 # MMA7660FC: 3-Axis Orientation/Motion Detection Sensor
107105 - fsl,mma7660
108106 # MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
Documentation/filesystems/caching/cachefiles.rst+1−1
@@ -115,7 +115,7 @@ set up cache ready for use. The following script commands are available: · 114 unmodified lines
115115
116116 This mask can also be set through sysfs, eg::
117117
118− echo 5 >/sys/modules/cachefiles/parameters/debug
118+ echo 5 > /sys/module/cachefiles/parameters/debug
119119
120120
121121 Starting the Cache
Documentation/filesystems/iomap/operations.rst+1−1
@@ -208,7 +208,7 @@ The filesystem must arrange to `cancel · 207 unmodified lines
208208 such `reservations
209209 <https://lore.kernel.org/linux-xfs/20220817093627.GZ3600936@dread.disaster.area/>`_
210210 because writeback will not consume the reservation.
211−The ``iomap_file_buffered_write_punch_delalloc`` can be called from a
211+The ``iomap_write_delalloc_release`` can be called from a
212212 ``->iomap_end`` function to find all the clean areas of the folios
213213 caching a fresh (``IOMAP_F_NEW``) delalloc mapping.
214214 It takes the ``invalidate_lock``.
Documentation/filesystems/netfs_library.rst+0−1
@@ -592,4 +592,3 @@ API Function Reference · 591 unmodified lines
592592
593593 .. kernel-doc:: include/linux/netfs.h
594594 .. kernel-doc:: fs/netfs/buffered_read.c
595−.. kernel-doc:: fs/netfs/io.c
Documentation/iio/ad7380.rst+11−2
@@ -41,13 +41,22 @@ supports only 1 SDO line. · 40 unmodified lines
4141 Reference voltage
4242 -----------------
4343
44−2 possible reference voltage sources are supported:
44+ad7380-4
45+~~~~~~~~
46+
47+ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be
48+declared in the device tree as ``refin-supply``.
49+
50+All other devices from ad738x family
51+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+All other devices from ad738x support 2 possible reference voltage sources:
4554
4655 - Internal reference (2.5V)
4756 - External reference (2.5V to 3.3V)
4857
4958 The source is determined by the device tree. If ``refio-supply`` is present,
50−then the external reference is used, else the internal reference is used.
59+then it is used as external reference, else the internal reference is used.
5160
5261 Oversampling and resolution boost
5362 ---------------------------------
Documentation/mm/damon/maintainer-profile.rst+19−19
@@ -7,26 +7,26 @@ The DAMON subsystem covers the files that are listed in 'DATA ACCESS MONITOR' · 6 unmodified lines
77 section of 'MAINTAINERS' file.
88
99 The mailing lists for the subsystem are damon@lists.linux.dev and
10−linux-mm@kvack.org. Patches should be made against the mm-unstable `tree
11−<https://git.kernel.org/akpm/mm/h/mm-unstable>` whenever possible and posted to
12−the mailing lists.
10+linux-mm@kvack.org. Patches should be made against the `mm-unstable tree
11+<https://git.kernel.org/akpm/mm/h/mm-unstable>`_ whenever possible and posted
12+to the mailing lists.
1313
1414 SCM Trees
1515 ---------
1616
1717 There are multiple Linux trees for DAMON development. Patches under
1818 development or testing are queued in `damon/next
19−<https://git.kernel.org/sj/h/damon/next>` by the DAMON maintainer.
19+<https://git.kernel.org/sj/h/damon/next>`_ by the DAMON maintainer.
2020 Sufficiently reviewed patches will be queued in `mm-unstable
21−<https://git.kernel.org/akpm/mm/h/mm-unstable>` by the memory management
21+<https://git.kernel.org/akpm/mm/h/mm-unstable>`_ by the memory management
2222 subsystem maintainer. After more sufficient tests, the patches will be queued
23−in `mm-stable <https://git.kernel.org/akpm/mm/h/mm-stable>` , and finally
23+in `mm-stable <https://git.kernel.org/akpm/mm/h/mm-stable>`_, and finally
2424 pull-requested to the mainline by the memory management subsystem maintainer.
2525
26−Note again the patches for mm-unstable `tree
27−<https://git.kernel.org/akpm/mm/h/mm-unstable>` are queued by the memory
26+Note again the patches for `mm-unstable tree
27+<https://git.kernel.org/akpm/mm/h/mm-unstable>`_ are queued by the memory
2828 management subsystem maintainer. If the patches requires some patches in
29−damon/next `tree <https://git.kernel.org/sj/h/damon/next>` which not yet merged
29+`damon/next tree <https://git.kernel.org/sj/h/damon/next>`_ which not yet merged
3030 in mm-unstable, please make sure the requirement is clearly specified.
3131
3232 Submit checklist addendum
@@ -37,25 +37,25 @@ When making DAMON changes, you should do below. · 4 unmodified lines
3737 - Build changes related outputs including kernel and documents.
3838 - Ensure the builds introduce no new errors or warnings.
3939 - Run and ensure no new failures for DAMON `selftests
40− <https://github.com/awslabs/damon-tests/blob/master/corr/run.sh#L49>` and
40+ <https://github.com/damonitor/damon-tests/blob/master/corr/run.sh#L49>`_ and
4141 `kunittests
42− <https://github.com/awslabs/damon-tests/blob/master/corr/tests/kunit.sh>`.
42+ <https://github.com/damonitor/damon-tests/blob/master/corr/tests/kunit.sh>`_.
4343
4444 Further doing below and putting the results will be helpful.
4545
4646 - Run `damon-tests/corr
47− <https://github.com/awslabs/damon-tests/tree/master/corr>` for normal
47+ <https://github.com/damonitor/damon-tests/tree/master/corr>`_ for normal
4848 changes.
4949 - Run `damon-tests/perf
50− <https://github.com/awslabs/damon-tests/tree/master/perf>` for performance
50+ <https://github.com/damonitor/damon-tests/tree/master/perf>`_ for performance
5151 changes.
5252
5353 Key cycle dates
5454 ---------------
5555
5656 Patches can be sent anytime. Key cycle dates of the `mm-unstable
57−<https://git.kernel.org/akpm/mm/h/mm-unstable>` and `mm-stable
58−<https://git.kernel.org/akpm/mm/h/mm-stable>` trees depend on the memory
57+<https://git.kernel.org/akpm/mm/h/mm-unstable>`_ and `mm-stable
58+<https://git.kernel.org/akpm/mm/h/mm-stable>`_ trees depend on the memory
5959 management subsystem maintainer.
6060
6161 Review cadence
@@ -72,13 +72,13 @@ Mailing tool · 10 unmodified lines
7272 Like many other Linux kernel subsystems, DAMON uses the mailing lists
7373 (damon@lists.linux.dev and linux-mm@kvack.org) as the major communication
7474 channel. There is a simple tool called `HacKerMaiL
75−<https://github.com/damonitor/hackermail>` (``hkml``), which is for people who
75+<https://github.com/damonitor/hackermail>`_ (``hkml``), which is for people who
7676 are not very familiar with the mailing lists based communication. The tool
7777 could be particularly helpful for DAMON community members since it is developed
7878 and maintained by DAMON maintainer. The tool is also officially announced to
7979 support DAMON and general Linux kernel development workflow.
8080
81−In other words, `hkml <https://github.com/damonitor/hackermail>` is a mailing
81+In other words, `hkml <https://github.com/damonitor/hackermail>`_ is a mailing
8282 tool for DAMON community, which DAMON maintainer is committed to support.
8383 Please feel free to try and report issues or feature requests for the tool to
8484 the maintainer.
@@ -98,8 +98,8 @@ slots, and attendees should reserve one of those at least 24 hours before the · 13 unmodified lines
9898 time slot, by reaching out to the maintainer.
9999
100100 Schedules and available reservation time slots are available at the Google `doc
101−<https://docs.google.com/document/d/1v43Kcj3ly4CYqmAkMaZzLiM2GEnWfgdGbZAH3mi2vpM/edit?usp=sharing>`.
101+<https://docs.google.com/document/d/1v43Kcj3ly4CYqmAkMaZzLiM2GEnWfgdGbZAH3mi2vpM/edit?usp=sharing>`_.
102102 There is also a public Google `calendar
103−<https://calendar.google.com/calendar/u/0?cid=ZDIwOTA4YTMxNjc2MDQ3NTIyMmUzYTM5ZmQyM2U4NDA0ZGIwZjBiYmJlZGQxNDM0MmY4ZTRjOTE0NjdhZDRiY0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t>`
103+<https://calendar.google.com/calendar/u/0?cid=ZDIwOTA4YTMxNjc2MDQ3NTIyMmUzYTM5ZmQyM2U4NDA0ZGIwZjBiYmJlZGQxNDM0MmY4ZTRjOTE0NjdhZDRiY0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t>`_
104104 that has the events. Anyone can subscribe it. DAMON maintainer will also
105105 provide periodic reminder to the mailing list (damon@lists.linux.dev).
Documentation/networking/packet_mmap.rst+3−2
@@ -16,7 +16,7 @@ ii) transmit network traffic, or any other that needs raw · 15 unmodified lines
1616
1717 Howto can be found at:
1818
19− https://sites.google.com/site/packetmmap/
19+ https://web.archive.org/web/20220404160947/https://sites.google.com/site/packetmmap/
2020
2121 Please send your comments to
2222 - Ulisses Alonso Camaró <uaca@i.hate.spam.alumni.uv.es>
@@ -166,7 +166,8 @@ As capture, each frame contains two parts:: · 143 unmodified lines
166166 /* bind socket to eth0 */
167167 bind(this->socket, (struct sockaddr *)&my_addr, sizeof(struct sockaddr_ll));
168168
169− A complete tutorial is available at: https://sites.google.com/site/packetmmap/
169+ A complete tutorial is available at:
170+ https://web.archive.org/web/20220404160947/https://sites.google.com/site/packetmmap/
170171
171172 By default, the user should put data at::
172173
Documentation/networking/tcp_ao.rst+10−10
@@ -9,7 +9,7 @@ segments between trusted peers. It adds a new TCP header option with · 8 unmodified lines
99 a Message Authentication Code (MAC). MACs are produced from the content
1010 of a TCP segment using a hashing function with a password known to both peers.
1111 The intent of TCP-AO is to deprecate TCP-MD5 providing better security,
12−key rotation and support for variety of hashing algorithms.
12+key rotation and support for a variety of hashing algorithms.
1313
1414 1. Introduction
1515 ===============
@@ -164,9 +164,9 @@ A: It should not, no action needs to be performed [7.5.2.e]:: · 148 unmodified lines
164164 is not available, no action is required (RNextKeyID of a received
165165 segment needs to match the MKT’s SendID).
166166
167−Q: How current_key is set and when does it change? It is a user-triggered
168−change, or is it by a request from the remote peer? Is it set by the user
169−explicitly, or by a matching rule?
167+Q: How is current_key set, and when does it change? Is it a user-triggered
168+change, or is it triggered by a request from the remote peer? Is it set by the
169+user explicitly, or by a matching rule?
170170
171171 A: current_key is set by RNextKeyID [6.1]::
172172
@@ -233,8 +233,8 @@ always have one current_key [3.3]:: · 60 unmodified lines
233233
234234 Q: Can a non-TCP-AO connection become a TCP-AO-enabled one?
235235
236−A: No: for already established non-TCP-AO connection it would be impossible
237−to switch using TCP-AO as the traffic key generation requires the initial
236+A: No: for an already established non-TCP-AO connection it would be impossible
237+to switch to using TCP-AO, as the traffic key generation requires the initial
238238 sequence numbers. Paraphrasing, starting using TCP-AO would require
239239 re-establishing the TCP connection.
240240
@@ -292,7 +292,7 @@ no transparency is really needed and modern BGP daemons already have · 51 unmodified lines
292292
293293 Linux provides a set of ``setsockopt()s`` and ``getsockopt()s`` that let
294294 userspace manage TCP-AO on a per-socket basis. In order to add/delete MKTs
295−``TCP_AO_ADD_KEY`` and ``TCP_AO_DEL_KEY`` TCP socket options must be used
295+``TCP_AO_ADD_KEY`` and ``TCP_AO_DEL_KEY`` TCP socket options must be used.
296296 It is not allowed to add a key on an established non-TCP-AO connection
297297 as well as to remove the last key from TCP-AO connection.
298298
@@ -361,7 +361,7 @@ not implemented. · 62 unmodified lines
361361 4. ``setsockopt()`` vs ``accept()`` race
362362 ========================================
363363
364−In contrast with TCP-MD5 established connection which has just one key,
364+In contrast with an established TCP-MD5 connection which has just one key,
365365 TCP-AO connections may have many keys, which means that accepted connections
366366 on a listen socket may have any amount of keys as well. As copying all those
367367 keys on a first properly signed SYN would make the request socket bigger, that
@@ -374,7 +374,7 @@ keys from sockets that were already established, but not yet ``accept()``'ed, · 6 unmodified lines
374374 hanging in the accept queue.
375375
376376 The reverse is valid as well: if userspace adds a new key for a peer on
377−a listener socket, the established sockets in accept queue won't
377+a listener socket, the established sockets in the accept queue won't
378378 have the new keys.
379379
380380 At this moment, the resolution for the two races:
@@ -382,7 +382,7 @@ At this moment, the resolution for the two races: · 1 unmodified line
382382 and ``setsockopt(TCP_AO_DEL_KEY)`` vs ``accept()`` is delegated to userspace.
383383 This means that it's expected that userspace would check the MKTs on the socket
384384 that was returned by ``accept()`` to verify that any key rotation that
385−happened on listen socket is reflected on the newly established connection.
385+happened on the listen socket is reflected on the newly established connection.
386386
387387 This is a similar "do-nothing" approach to TCP-MD5 from the kernel side and
388388 may be changed later by introducing new flags to ``tcp_ao_add``
Documentation/process/maintainer-netdev.rst+17−0
@@ -355,6 +355,8 @@ just do it. As a result, a sequence of smaller series gets merged quicker and · 354 unmodified lines
355355 with better review coverage. Re-posting large series also increases the mailing
356356 list traffic.
357357
358+.. _rcs:
359+
358360 Local variable ordering ("reverse xmas tree", "RCS")
359361 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
360362
@@ -391,6 +393,21 @@ APIs and helpers, especially scoped iterators. However, direct use of · 30 unmodified lines
391393 ``__free()`` within networking core and drivers is discouraged.
392394 Similar guidance applies to declaring variables mid-function.
393395
396+Clean-up patches
397+~~~~~~~~~~~~~~~~
398+
399+Netdev discourages patches which perform simple clean-ups, which are not in
400+the context of other work. For example:
401+
402+* Addressing ``checkpatch.pl`` warnings
403+* Addressing :ref:`Local variable ordering<rcs>` issues
404+* Conversions to device-managed APIs (``devm_`` helpers)
405+
406+This is because it is felt that the churn that such changes produce comes
407+at a greater cost than the value of such clean-ups.
408+
409+Conversely, spelling and grammar fixes are not discouraged.
410+
394411 Resending after review
395412 ~~~~~~~~~~~~~~~~~~~~~~
396413
Documentation/process/maintainer-soc.rst+37−5
@@ -30,10 +30,13 @@ tree as a dedicated branch covering multiple subsystems. · 29 unmodified lines
3030 The main SoC tree is housed on git.kernel.org:
3131 https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/
3232
33+Maintainers
34+-----------
35+
3336 Clearly this is quite a wide range of topics, which no one person, or even
3437 small group of people are capable of maintaining. Instead, the SoC subsystem
35−is comprised of many submaintainers, each taking care of individual platforms
36−and driver subdirectories.
38+is comprised of many submaintainers (platform maintainers), each taking care of
39+individual platforms and driver subdirectories.
3740 In this regard, "platform" usually refers to a series of SoCs from a given
3841 vendor, for example, Nvidia's series of Tegra SoCs. Many submaintainers operate
3942 on a vendor level, responsible for multiple product lines. For several reasons,
@@ -43,14 +46,43 @@ MAINTAINERS file. · 3 unmodified lines
4346
4447 Most of these submaintainers have their own trees where they stage patches,
4548 sending pull requests to the main SoC tree. These trees are usually, but not
46−always, listed in MAINTAINERS. The main SoC maintainers can be reached via the
47−alias soc@kernel.org if there is no platform-specific maintainer, or if they
48−are unresponsive.
49+always, listed in MAINTAINERS.
4950
5051 What the SoC tree is not, however, is a location for architecture-specific code
5152 changes. Each architecture has its own maintainers that are responsible for
5253 architectural details, CPU errata and the like.
5354
55+Submitting Patches for Given SoC
56+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57+
58+All typical platform related patches should be sent via SoC submaintainers
59+(platform-specific maintainers). This includes also changes to per-platform or
60+shared defconfigs (scripts/get_maintainer.pl might not provide correct
61+addresses in such case).
62+
63+Submitting Patches to the Main SoC Maintainers
64+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65+
66+The main SoC maintainers can be reached via the alias soc@kernel.org only in
67+following cases:
68+
69+1. There are no platform-specific maintainers.
70+
71+2. Platform-specific maintainers are unresponsive.
72+
73+3. Introducing a completely new SoC platform. Such new SoC work should be sent
74+ first to common mailing lists, pointed out by scripts/get_maintainer.pl, for
75+ community review. After positive community review, work should be sent to
76+ soc@kernel.org in one patchset containing new arch/foo/Kconfig entry, DTS
77+ files, MAINTAINERS file entry and optionally initial drivers with their
78+ Devicetree bindings. The MAINTAINERS file entry should list new
79+ platform-specific maintainers, who are going to be responsible for handling
80+ patches for the platform from now on.
81+
82+Note that the soc@kernel.org is usually not the place to discuss the patches,
83+thus work sent to this address should be already considered as acceptable by
84+the community.
85+
5486 Information for (new) Submaintainers
5587 ------------------------------------
5688
Documentation/rust/arch-support.rst+1−1
@@ -17,7 +17,7 @@ Architecture Level of support Constraints · 16 unmodified lines
1717 ============= ================ ==============================================
1818 ``arm64`` Maintained Little Endian only.
1919 ``loongarch`` Maintained \-
20−``riscv`` Maintained ``riscv64`` only.
20+``riscv`` Maintained ``riscv64`` and LLVM/Clang only.
2121 ``um`` Maintained \-
2222 ``x86`` Maintained ``x86_64`` only.
2323 ============= ================ ==============================================
Documentation/scheduler/sched-ext.rst+1−1
@@ -66,7 +66,7 @@ BPF scheduler and reverts all tasks back to CFS. · 65 unmodified lines
6666 .. code-block:: none
6767
6868 # make -j16 -C tools/sched_ext
69− # tools/sched_ext/scx_simple
69+ # tools/sched_ext/build/bin/scx_simple
7070 local=0 global=3
7171 local=5 global=24
7272 local=9 global=44
Documentation/userspace-api/mseal.rst+148−159
@@ -23,177 +23,166 @@ applications can additionally seal security critical data at runtime. · 22 unmodified lines
2323 A similar feature already exists in the XNU kernel with the
2424 VM_FLAGS_PERMANENT flag [1] and on OpenBSD with the mimmutable syscall [2].
2525
26−User API
27−========
28−mseal()
29−-----------
30−The mseal() syscall has the following signature:
31−
32−``int mseal(void addr, size_t len, unsigned long flags)``
33−
34−**addr/len**: virtual memory address range.
35−
36−The address range set by ``addr``/``len`` must meet:
37− - The start address must be in an allocated VMA.
38− - The start address must be page aligned.
39− - The end address (``addr`` + ``len``) must be in an allocated VMA.
40− - no gap (unallocated memory) between start and end address.
41−
42−The ``len`` will be paged aligned implicitly by the kernel.
43−
44−**flags**: reserved for future use.
45−
46−**return values**:
47−
48−- ``0``: Success.
49−
50−- ``-EINVAL``:
51− - Invalid input ``flags``.
52− - The start address (``addr``) is not page aligned.
53− - Address range (``addr`` + ``len``) overflow.
54−
55−- ``-ENOMEM``:
56− - The start address (``addr``) is not allocated.
57− - The end address (``addr`` + ``len``) is not allocated.
58− - A gap (unallocated memory) between start and end address.
59−
60−- ``-EPERM``:
61− - sealing is supported only on 64-bit CPUs, 32-bit is not supported.
62−
63−- For above error cases, users can expect the given memory range is
64− unmodified, i.e. no partial update.
65−
66−- There might be other internal errors/cases not listed here, e.g.
67− error during merging/splitting VMAs, or the process reaching the max
68− number of supported VMAs. In those cases, partial updates to the given
69− memory range could happen. However, those cases should be rare.
70−
71−**Blocked operations after sealing**:
72− Unmapping, moving to another location, and shrinking the size,
73− via munmap() and mremap(), can leave an empty space, therefore
74− can be replaced with a VMA with a new set of attributes.
75−
76− Moving or expanding a different VMA into the current location,
77− via mremap().
78−
79− Modifying a VMA via mmap(MAP_FIXED).
80−
81− Size expansion, via mremap(), does not appear to pose any
82− specific risks to sealed VMAs. It is included anyway because
83− the use case is unclear. In any case, users can rely on
84− merging to expand a sealed VMA.
85−
86− mprotect() and pkey_mprotect().
87−
88− Some destructive madvice() behaviors (e.g. MADV_DONTNEED)
89− for anonymous memory, when users don't have write permission to the
90− memory. Those behaviors can alter region contents by discarding pages,
91− effectively a memset(0) for anonymous memory.
92−
93− Kernel will return -EPERM for blocked operations.
94−
95− For blocked operations, one can expect the given address is unmodified,
96− i.e. no partial update. Note, this is different from existing mm
97− system call behaviors, where partial updates are made till an error is
98− found and returned to userspace. To give an example:
99−
100− Assume following code sequence:
101−
102− - ptr = mmap(null, 8192, PROT_NONE);
103− - munmap(ptr + 4096, 4096);
104− - ret1 = mprotect(ptr, 8192, PROT_READ);
105− - mseal(ptr, 4096);
106− - ret2 = mprotect(ptr, 8192, PROT_NONE);
107−
108− ret1 will be -ENOMEM, the page from ptr is updated to PROT_READ.
109−
110− ret2 will be -EPERM, the page remains to be PROT_READ.
111−
112−**Note**:
113−
114−- mseal() only works on 64-bit CPUs, not 32-bit CPU.
115−
116−- users can call mseal() multiple times, mseal() on an already sealed memory
117− is a no-action (not error).
118−
119−- munseal() is not supported.
120−
121−Use cases:
122−==========
26+SYSCALL
27+=======
28+mseal syscall signature
29+-----------------------
30+ ``int mseal(void \* addr, size_t len, unsigned long flags)``
31+
32+ **addr**/**len**: virtual memory address range.
33+ The address range set by **addr**/**len** must meet:
34+ - The start address must be in an allocated VMA.
35+ - The start address must be page aligned.
36+ - The end address (**addr** + **len**) must be in an allocated VMA.
37+ - no gap (unallocated memory) between start and end address.
38+
39+ The ``len`` will be paged aligned implicitly by the kernel.
40+
41+ **flags**: reserved for future use.
42+
43+ **Return values**:
44+ - **0**: Success.
45+ - **-EINVAL**:
46+ * Invalid input ``flags``.
47+ * The start address (``addr``) is not page aligned.
48+ * Address range (``addr`` + ``len``) overflow.
49+ - **-ENOMEM**:
50+ * The start address (``addr``) is not allocated.
51+ * The end address (``addr`` + ``len``) is not allocated.
52+ * A gap (unallocated memory) between start and end address.
53+ - **-EPERM**:
54+ * sealing is supported only on 64-bit CPUs, 32-bit is not supported.
55+
56+ **Note about error return**:
57+ - For above error cases, users can expect the given memory range is
58+ unmodified, i.e. no partial update.
59+ - There might be other internal errors/cases not listed here, e.g.
60+ error during merging/splitting VMAs, or the process reaching the maximum
61+ number of supported VMAs. In those cases, partial updates to the given
62+ memory range could happen. However, those cases should be rare.
63+
64+ **Architecture support**:
65+ mseal only works on 64-bit CPUs, not 32-bit CPUs.
66+
67+ **Idempotent**:
68+ users can call mseal multiple times. mseal on an already sealed memory
69+ is a no-action (not error).
70+
71+ **no munseal**
72+ Once mapping is sealed, it can't be unsealed. The kernel should never
73+ have munseal, this is consistent with other sealing feature, e.g.
74+ F_SEAL_SEAL for file.
75+
76+Blocked mm syscall for sealed mapping
77+-------------------------------------
78+ It might be important to note: **once the mapping is sealed, it will
79+ stay in the process's memory until the process terminates**.
80+
81+ Example::
82+
83+ *ptr = mmap(0, 4096, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
84+ rc = mseal(ptr, 4096, 0);
85+ /* munmap will fail */
86+ rc = munmap(ptr, 4096);
87+ assert(rc < 0);
88+
89+ Blocked mm syscall:
90+ - munmap
91+ - mmap
92+ - mremap
93+ - mprotect and pkey_mprotect
94+ - some destructive madvise behaviors: MADV_DONTNEED, MADV_FREE,
95+ MADV_DONTNEED_LOCKED, MADV_FREE, MADV_DONTFORK, MADV_WIPEONFORK
96+
97+ The first set of syscalls to block is munmap, mremap, mmap. They can
98+ either leave an empty space in the address space, therefore allowing
99+ replacement with a new mapping with new set of attributes, or can
100+ overwrite the existing mapping with another mapping.
101+
102+ mprotect and pkey_mprotect are blocked because they changes the
103+ protection bits (RWX) of the mapping.
104+
105+ Certain destructive madvise behaviors, specifically MADV_DONTNEED,
106+ MADV_FREE, MADV_DONTNEED_LOCKED, and MADV_WIPEONFORK, can introduce
107+ risks when applied to anonymous memory by threads lacking write
108+ permissions. Consequently, these operations are prohibited under such
109+ conditions. The aforementioned behaviors have the potential to modify
110+ region contents by discarding pages, effectively performing a memset(0)
111+ operation on the anonymous memory.
112+
113+ Kernel will return -EPERM for blocked syscalls.
114+
115+ When blocked syscall return -EPERM due to sealing, the memory regions may
116+ or may not be changed, depends on the syscall being blocked:
117+
118+ - munmap: munmap is atomic. If one of VMAs in the given range is
119+ sealed, none of VMAs are updated.
120+ - mprotect, pkey_mprotect, madvise: partial update might happen, e.g.
121+ when mprotect over multiple VMAs, mprotect might update the beginning
122+ VMAs before reaching the sealed VMA and return -EPERM.
123+ - mmap and mremap: undefined behavior.
124+
125+Use cases
126+=========
123127 - glibc:
124128 The dynamic linker, during loading ELF executables, can apply sealing to
125− non-writable memory segments.
126−
127−- Chrome browser: protect some security sensitive data-structures.
129+ mapping segments.
128130
129−Notes on which memory to seal:
130−==============================
131+- Chrome browser: protect some security sensitive data structures.
131132
132−It might be important to note that sealing changes the lifetime of a mapping,
133−i.e. the sealed mapping won’t be unmapped till the process terminates or the
134−exec system call is invoked. Applications can apply sealing to any virtual
135−memory region from userspace, but it is crucial to thoroughly analyze the
136−mapping's lifetime prior to apply the sealing.
133+When not to use mseal
134+=====================
135+Applications can apply sealing to any virtual memory region from userspace,
136+but it is *crucial to thoroughly analyze the mapping's lifetime* prior to
137+apply the sealing. This is because the sealed mapping *won’t be unmapped*
138+until the process terminates or the exec system call is invoked.
137139
138140 For example:
141+ - aio/shm
142+ aio/shm can call mmap and munmap on behalf of userspace, e.g.
143+ ksys_shmdt() in shm.c. The lifetimes of those mapping are not tied to
144+ the lifetime of the process. If those memories are sealed from userspace,
145+ then munmap will fail, causing leaks in VMA address space during the
146+ lifetime of the process.
147+
148+ - ptr allocated by malloc (heap)
149+ Don't use mseal on the memory ptr return from malloc().
150+ malloc() is implemented by allocator, e.g. by glibc. Heap manager might
151+ allocate a ptr from brk or mapping created by mmap.
152+ If an app calls mseal on a ptr returned from malloc(), this can affect
153+ the heap manager's ability to manage the mappings; the outcome is
154+ non-deterministic.
155+
156+ Example::
157+
158+ ptr = malloc(size);
159+ /* don't call mseal on ptr return from malloc. */
160+ mseal(ptr, size);
161+ /* free will success, allocator can't shrink heap lower than ptr */
162+ free(ptr);
163+
164+mseal doesn't block
165+===================
166+In a nutshell, mseal blocks certain mm syscall from modifying some of VMA's
167+attributes, such as protection bits (RWX). Sealed mappings doesn't mean the
168+memory is immutable.
139169
140−- aio/shm
141−
142− aio/shm can call mmap()/munmap() on behalf of userspace, e.g. ksys_shmdt() in
143− shm.c. The lifetime of those mapping are not tied to the lifetime of the
144− process. If those memories are sealed from userspace, then munmap() will fail,
145− causing leaks in VMA address space during the lifetime of the process.
146−
147−- Brk (heap)
148−
149− Currently, userspace applications can seal parts of the heap by calling
150− malloc() and mseal().
151− let's assume following calls from user space:
152−
153− - ptr = malloc(size);
154− - mprotect(ptr, size, RO);
155− - mseal(ptr, size);
156− - free(ptr);
157−
158− Technically, before mseal() is added, the user can change the protection of
159− the heap by calling mprotect(RO). As long as the user changes the protection
160− back to RW before free(), the memory range can be reused.
161−
162− Adding mseal() into the picture, however, the heap is then sealed partially,
163− the user can still free it, but the memory remains to be RO. If the address
164− is re-used by the heap manager for another malloc, the process might crash
165− soon after. Therefore, it is important not to apply sealing to any memory
166− that might get recycled.
167−
168− Furthermore, even if the application never calls the free() for the ptr,
169− the heap manager may invoke the brk system call to shrink the size of the
170− heap. In the kernel, the brk-shrink will call munmap(). Consequently,
171− depending on the location of the ptr, the outcome of brk-shrink is
172− nondeterministic.
173−
174−
175−Additional notes:
176−=================
177170 As Jann Horn pointed out in [3], there are still a few ways to write
178−to RO memory, which is, in a way, by design. Those cases are not covered
179−by mseal(). If applications want to block such cases, sandbox tools (such as
180−seccomp, LSM, etc) might be considered.
171+to RO memory, which is, in a way, by design. And those could be blocked
172+by different security measures.
181173
182174 Those cases are:
183175
184−- Write to read-only memory through /proc/self/mem interface.
185−- Write to read-only memory through ptrace (such as PTRACE_POKETEXT).
186−- userfaultfd.
176+ - Write to read-only memory through /proc/self/mem interface (FOLL_FORCE).
177+ - Write to read-only memory through ptrace (such as PTRACE_POKETEXT).
178+ - userfaultfd.
187179
188180 The idea that inspired this patch comes from Stephen Röttger’s work in V8
189181 CFI [4]. Chrome browser in ChromeOS will be the first user of this API.
190182
191−Reference:
192−==========
193−[1] https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/osfmk/mach/vm_statistics.h#L274
194−
195−[2] https://man.openbsd.org/mimmutable.2
196−
197−[3] https://lore.kernel.org/lkml/CAG48ez3ShUYey+ZAFsU2i1RpQn0a5eOs2hzQ426FkcgnfUGLvA@mail.gmail.com
198−
199−[4] https://docs.google.com/document/d/1O2jwK4dxI3nRcOJuPYkonhTkNQfbmwdvxQMyXgeaRHo/edit#heading=h.bvaojj9fu6hc
183+Reference
184+=========
185+- [1] https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/osfmk/mach/vm_statistics.h#L274
186+- [2] https://man.openbsd.org/mimmutable.2
187+- [3] https://lore.kernel.org/lkml/CAG48ez3ShUYey+ZAFsU2i1RpQn0a5eOs2hzQ426FkcgnfUGLvA@mail.gmail.com
188+- [4] https://docs.google.com/document/d/1O2jwK4dxI3nRcOJuPYkonhTkNQfbmwdvxQMyXgeaRHo/edit#heading=h.bvaojj9fu6hc
Documentation/virt/kvm/api.rst+9−7
@@ -8098,13 +8098,15 @@ KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS By default, KVM emulates MONITOR/MWAIT (if · 8097 unmodified lines
80988098 KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT is
80998099 disabled.
81008100
8101−KVM_X86_QUIRK_SLOT_ZAP_ALL By default, KVM invalidates all SPTEs in
8102− fast way for memslot deletion when VM type
8103− is KVM_X86_DEFAULT_VM.
8104− When this quirk is disabled or when VM type
8105− is other than KVM_X86_DEFAULT_VM, KVM zaps
8106− only leaf SPTEs that are within the range of
8107− the memslot being deleted.
8101+KVM_X86_QUIRK_SLOT_ZAP_ALL By default, for KVM_X86_DEFAULT_VM VMs, KVM
8102+ invalidates all SPTEs in all memslots and
8103+ address spaces when a memslot is deleted or
8104+ moved. When this quirk is disabled (or the
8105+ VM type isn't KVM_X86_DEFAULT_VM), KVM only
8106+ ensures the backing memory of the deleted
8107+ or moved memslot isn't reachable, i.e KVM
8108+ _may_ invalidate only SPTEs related to the
8109+ memslot.
81088110 =================================== ============================================
81098111
81108112 7.32 KVM_CAP_MAX_VCPU_ID
Documentation/virt/kvm/locking.rst+1−1
@@ -136,7 +136,7 @@ For direct sp, we can easily avoid it since the spte of direct sp is fixed · 135 unmodified lines
136136 to gfn. For indirect sp, we disabled fast page fault for simplicity.
137137
138138 A solution for indirect sp could be to pin the gfn, for example via
139−kvm_vcpu_gfn_to_pfn_atomic, before the cmpxchg. After the pinning:
139+gfn_to_pfn_memslot_atomic, before the cmpxchg. After the pinning:
140140
141141 - We have held the refcount of pfn; that means the pfn can not be freed and
142142 be reused for another gfn.
MAINTAINERS+63−147
@@ -258,12 +258,6 @@ L: linux-acenic@sunsite.dk · 257 unmodified lines
258258 S: Maintained
259259 F: drivers/net/ethernet/alteon/acenic*
260260
261−ACER ASPIRE 1 EMBEDDED CONTROLLER DRIVER
262−M: Nikita Travkin <nikita@trvn.ru>
263−S: Maintained
264−F: Documentation/devicetree/bindings/platform/acer,aspire1-ec.yaml
265−F: drivers/platform/arm64/acer-aspire1-ec.c
266−
267261 ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER
268262 M: Peter Kaestle <peter@piie.net>
269263 L: platform-driver-x86@vger.kernel.org
@@ -888,7 +882,6 @@ F: drivers/staging/media/sunxi/cedrus/ · 618 unmodified lines
888882
889883 ALPHA PORT
890884 M: Richard Henderson <richard.henderson@linaro.org>
891−M: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
892885 M: Matt Turner <mattst88@gmail.com>
893886 L: linux-alpha@vger.kernel.org
894887 S: Odd Fixes
@@ -1761,8 +1754,8 @@ F: include/uapi/linux/if_arcnet.h · 866 unmodified lines
17611754 ARM AND ARM64 SoC SUB-ARCHITECTURES (COMMON PARTS)
17621755 M: Arnd Bergmann <arnd@arndb.de>
17631756 M: Olof Johansson <olof@lixom.net>
1764−M: soc@kernel.org
17651757 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1758+L: soc@lists.linux.dev
17661759 S: Maintained
17671760 P: Documentation/process/maintainer-soc.rst
17681761 C: irc://irc.libera.chat/armlinux
@@ -2263,12 +2256,6 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) · 494 unmodified lines
22632256 S: Maintained
22642257 F: arch/arm/mach-ep93xx/ts72xx.c
22652258
2266−ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
2267−M: Alexander Shiyan <shc_work@mail.ru>
2268−L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2269−S: Odd Fixes
2270−N: clps711x
2271−
22722259 ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
22732260 M: Hartley Sweeten <hsweeten@visionengravers.com>
22742261 M: Alexander Sverdlin <alexander.sverdlin@gmail.com>
@@ -3815,14 +3802,6 @@ F: drivers/video/backlight/ · 1540 unmodified lines
38153802 F: include/linux/backlight.h
38163803 F: include/linux/pwm_backlight.h
38173804
3818−BAIKAL-T1 PVT HARDWARE MONITOR DRIVER
3819−M: Serge Semin <fancer.lancer@gmail.com>
3820−L: linux-hwmon@vger.kernel.org
3821−S: Supported
3822−F: Documentation/devicetree/bindings/hwmon/baikal,bt1-pvt.yaml
3823−F: Documentation/hwmon/bt1-pvt.rst
3824−F: drivers/hwmon/bt1-pvt.[ch]
3825−
38263805 BARCO P50 GPIO DRIVER
38273806 M: Santosh Kumar Yadav <santoshkumar.yadav@barco.com>
38283807 M: Peter Korsgaard <peter.korsgaard@barco.com>
@@ -6476,7 +6455,6 @@ F: drivers/mtd/nand/raw/denali* · 2647 unmodified lines
64766455
64776456 DESIGNWARE EDMA CORE IP DRIVER
64786457 M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
6479−R: Serge Semin <fancer.lancer@gmail.com>
64806458 L: dmaengine@vger.kernel.org
64816459 S: Maintained
64826460 F: drivers/dma/dw-edma/
@@ -9757,6 +9735,7 @@ F: include/dt-bindings/gpio/ · 3274 unmodified lines
97579735 F: include/linux/gpio.h
97589736 F: include/linux/gpio/
97599737 F: include/linux/of_gpio.h
9738+K: (devm_)?gpio_(request|free|direction|get|set)
97609739
97619740 GPIO UAPI
97629741 M: Bartosz Golaszewski <brgl@bgdev.pl>
@@ -9771,14 +9750,6 @@ F: drivers/gpio/gpiolib-cdev.c · 8 unmodified lines
97719750 F: include/uapi/linux/gpio.h
97729751 F: tools/gpio/
97739752
9774−GRE DEMULTIPLEXER DRIVER
9775−M: Dmitry Kozlov <xeb@mail.ru>
9776−L: netdev@vger.kernel.org
9777−S: Maintained
9778−F: include/net/gre.h
9779−F: net/ipv4/gre_demux.c
9780−F: net/ipv4/gre_offload.c
9781−
97829753 GRETH 10/100/1G Ethernet MAC device driver
97839754 M: Andreas Larsson <andreas@gaisler.com>
97849755 L: netdev@vger.kernel.org
@@ -10282,7 +10253,7 @@ F: Documentation/devicetree/bindings/arm/hisilicon/low-pin-count.yaml · 497 unmodified lines
1028210253 F: drivers/bus/hisi_lpc.c
1028310254
1028410255 HISILICON NETWORK SUBSYSTEM 3 DRIVER (HNS3)
10285−M: Yisen Zhuang <yisen.zhuang@huawei.com>
10256+M: Jian Shen <shenjian15@huawei.com>
1028610257 M: Salil Mehta <salil.mehta@huawei.com>
1028710258 M: Jijie Shao <shaojijie@huawei.com>
1028810259 L: netdev@vger.kernel.org
@@ -10291,7 +10262,7 @@ W: http://www.hisilicon.com · 2 unmodified lines
1029110262 F: drivers/net/ethernet/hisilicon/hns3/
1029210263
1029310264 HISILICON NETWORK SUBSYSTEM DRIVER
10294−M: Yisen Zhuang <yisen.zhuang@huawei.com>
10265+M: Jian Shen <shenjian15@huawei.com>
1029510266 M: Salil Mehta <salil.mehta@huawei.com>
1029610267 L: netdev@vger.kernel.org
1029710268 S: Maintained
@@ -11295,10 +11266,10 @@ F: security/integrity/ · 997 unmodified lines
1129511266 F: security/integrity/ima/
1129611267
1129711268 INTEGRITY POLICY ENFORCEMENT (IPE)
11298−M: Fan Wu <wufan@linux.microsoft.com>
11269+M: Fan Wu <wufan@kernel.org>
1129911270 L: linux-security-module@vger.kernel.org
1130011271 S: Supported
11301−T: git https://github.com/microsoft/ipe.git
11272+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wufan/ipe.git
1130211273 F: Documentation/admin-guide/LSM/ipe.rst
1130311274 F: Documentation/security/ipe.rst
1130411275 F: scripts/ipe/
@@ -11616,6 +11587,16 @@ F: drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c · 311 unmodified lines
1161611587 F: drivers/crypto/intel/keembay/ocs-hcu.c
1161711588 F: drivers/crypto/intel/keembay/ocs-hcu.h
1161811589
11590+INTEL LA JOLLA COVE ADAPTER (LJCA) USB I/O EXPANDER DRIVERS
11591+M: Wentong Wu <wentong.wu@intel.com>
11592+M: Sakari Ailus <sakari.ailus@linux.intel.com>
11593+S: Maintained
11594+F: drivers/gpio/gpio-ljca.c
11595+F: drivers/i2c/busses/i2c-ljca.c
11596+F: drivers/spi/spi-ljca.c
11597+F: drivers/usb/misc/usb-ljca.c
11598+F: include/linux/usb/ljca.h
11599+
1161911600 INTEL MANAGEMENT ENGINE (mei)
1162011601 M: Tomas Winkler <tomas.winkler@intel.com>
1162111602 L: linux-kernel@vger.kernel.org
@@ -12254,6 +12235,7 @@ R: Dmitry Vyukov <dvyukov@google.com> · 632 unmodified lines
1225412235 R: Vincenzo Frascino <vincenzo.frascino@arm.com>
1225512236 L: kasan-dev@googlegroups.com
1225612237 S: Maintained
12238+B: https://bugzilla.kernel.org/buglist.cgi?component=Sanitizers&product=Memory%20Management
1225712239 F: Documentation/dev-tools/kasan.rst
1225812240 F: arch/*/include/asm/*kasan.h
1225912241 F: arch/*/mm/kasan_init*
@@ -12277,6 +12259,7 @@ R: Dmitry Vyukov <dvyukov@google.com> · 17 unmodified lines
1227712259 R: Andrey Konovalov <andreyknvl@gmail.com>
1227812260 L: kasan-dev@googlegroups.com
1227912261 S: Maintained
12262+B: https://bugzilla.kernel.org/buglist.cgi?component=Sanitizers&product=Memory%20Management
1228012263 F: Documentation/dev-tools/kcov.rst
1228112264 F: include/linux/kcov.h
1228212265 F: include/uapi/linux/kcov.h
@@ -12956,49 +12939,29 @@ LIBATA PATA ARASAN COMPACT FLASH CONTROLLER · 673 unmodified lines
1295612939 M: Viresh Kumar <vireshk@kernel.org>
1295712940 L: linux-ide@vger.kernel.org
1295812941 S: Maintained
12959−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1296012942 F: drivers/ata/pata_arasan_cf.c
1296112943 F: include/linux/pata_arasan_cf_data.h
1296212944
12963−LIBATA PATA DRIVERS
12964−R: Sergey Shtylyov <s.shtylyov@omp.ru>
12965−L: linux-ide@vger.kernel.org
12966−F: drivers/ata/ata_*.c
12967−F: drivers/ata/pata_*.c
12968−
1296912945 LIBATA PATA FARADAY FTIDE010 AND GEMINI SATA BRIDGE DRIVERS
1297012946 M: Linus Walleij <linus.walleij@linaro.org>
1297112947 L: linux-ide@vger.kernel.org
1297212948 S: Maintained
12973−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1297412949 F: drivers/ata/pata_ftide010.c
1297512950 F: drivers/ata/sata_gemini.c
1297612951 F: drivers/ata/sata_gemini.h
1297712952
1297812953 LIBATA SATA AHCI PLATFORM devices support
1297912954 M: Hans de Goede <hdegoede@redhat.com>
12980−M: Jens Axboe <axboe@kernel.dk>
1298112955 L: linux-ide@vger.kernel.org
1298212956 S: Maintained
12983−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1298412957 F: drivers/ata/ahci_platform.c
1298512958 F: drivers/ata/libahci_platform.c
1298612959 F: include/linux/ahci_platform.h
1298712960
12988−LIBATA SATA AHCI SYNOPSYS DWC CONTROLLER DRIVER
12989−M: Serge Semin <fancer.lancer@gmail.com>
12990−L: linux-ide@vger.kernel.org
12991−S: Maintained
12992−T: git git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata.git
12993−F: Documentation/devicetree/bindings/ata/baikal,bt1-ahci.yaml
12994−F: Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
12995−F: drivers/ata/ahci_dwc.c
12996−
1299712961 LIBATA SATA PROMISE TX2/TX4 CONTROLLER DRIVER
1299812962 M: Mikael Pettersson <mikpelinux@gmail.com>
1299912963 L: linux-ide@vger.kernel.org
1300012964 S: Maintained
13001−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1300212965 F: drivers/ata/sata_promise.*
1300312966
1300412967 LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)
@@ -14191,8 +14154,7 @@ T: git git://linuxtv.org/media_tree.git · 1186 unmodified lines
1419114154 F: drivers/media/platform/nxp/imx-pxp.[ch]
1419214155
1419314156 MEDIA DRIVERS FOR ASCOT2E
14194−M: Sergey Kozlov <serjk@netup.ru>
14195−M: Abylay Ospan <aospan@netup.ru>
14157+M: Abylay Ospan <aospan@amazon.com>
1419614158 L: linux-media@vger.kernel.org
1419714159 S: Supported
1419814160 W: https://linuxtv.org
@@ -14209,8 +14171,7 @@ T: git git://linuxtv.org/media_tree.git · 10 unmodified lines
1420914171 F: drivers/media/dvb-frontends/cxd2099*
1421014172
1421114173 MEDIA DRIVERS FOR CXD2841ER
14212−M: Sergey Kozlov <serjk@netup.ru>
14213−M: Abylay Ospan <aospan@netup.ru>
14174+M: Abylay Ospan <aospan@amazon.com>
1421414175 L: linux-media@vger.kernel.org
1421514176 S: Supported
1421614177 W: https://linuxtv.org
@@ -14263,7 +14224,7 @@ F: drivers/media/platform/nxp/imx7-media-csi.c · 46 unmodified lines
1426314224 F: drivers/media/platform/nxp/imx8mq-mipi-csi2.c
1426414225
1426514226 MEDIA DRIVERS FOR HELENE
14266−M: Abylay Ospan <aospan@netup.ru>
14227+M: Abylay Ospan <aospan@amazon.com>
1426714228 L: linux-media@vger.kernel.org
1426814229 S: Supported
1426914230 W: https://linuxtv.org
@@ -14272,8 +14233,7 @@ T: git git://linuxtv.org/media_tree.git · 2 unmodified lines
1427214233 F: drivers/media/dvb-frontends/helene*
1427314234
1427414235 MEDIA DRIVERS FOR HORUS3A
14275−M: Sergey Kozlov <serjk@netup.ru>
14276−M: Abylay Ospan <aospan@netup.ru>
14236+M: Abylay Ospan <aospan@amazon.com>
1427714237 L: linux-media@vger.kernel.org
1427814238 S: Supported
1427914239 W: https://linuxtv.org
@@ -14282,8 +14242,7 @@ T: git git://linuxtv.org/media_tree.git · 2 unmodified lines
1428214242 F: drivers/media/dvb-frontends/horus3a*
1428314243
1428414244 MEDIA DRIVERS FOR LNBH25
14285−M: Sergey Kozlov <serjk@netup.ru>
14286−M: Abylay Ospan <aospan@netup.ru>
14245+M: Abylay Ospan <aospan@amazon.com>
1428714246 L: linux-media@vger.kernel.org
1428814247 S: Supported
1428914248 W: https://linuxtv.org
@@ -14299,8 +14258,7 @@ T: git git://linuxtv.org/media_tree.git · 9 unmodified lines
1429914258 F: drivers/media/dvb-frontends/mxl5xx*
1430014259
1430114260 MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
14302−M: Sergey Kozlov <serjk@netup.ru>
14303−M: Abylay Ospan <aospan@netup.ru>
14261+M: Abylay Ospan <aospan@amazon.com>
1430414262 L: linux-media@vger.kernel.org
1430514263 S: Supported
1430614264 W: https://linuxtv.org
@@ -14925,9 +14883,10 @@ N: include/linux/page[-_]* · 618 unmodified lines
1492514883
1492614884 MEMORY MAPPING
1492714885 M: Andrew Morton <akpm@linux-foundation.org>
14928−R: Liam R. Howlett <Liam.Howlett@oracle.com>
14886+M: Liam R. Howlett <Liam.Howlett@oracle.com>
14887+M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
1492914888 R: Vlastimil Babka <vbabka@suse.cz>
14930−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
14889+R: Jann Horn <jannh@google.com>
1493114890 L: linux-mm@kvack.org
1493214891 S: Maintained
1493314892 W: http://www.linux-mm.org
@@ -14950,13 +14909,6 @@ F: drivers/mtd/ · 16 unmodified lines
1495014909 F: include/linux/mtd/
1495114910 F: include/uapi/mtd/
1495214911
14953−MEMSENSING MICROSYSTEMS MSA311 DRIVER
14954−M: Dmitry Rokosov <ddrokosov@sberdevices.ru>
14955−L: linux-iio@vger.kernel.org
14956−S: Maintained
14957−F: Documentation/devicetree/bindings/iio/accel/memsensing,msa311.yaml
14958−F: drivers/iio/accel/msa311.c
14959−
1496014912 MEN A21 WATCHDOG DRIVER
1496114913 M: Johannes Thumshirn <morbidrsa@gmail.com>
1496214914 L: linux-watchdog@vger.kernel.org
@@ -15101,6 +15053,7 @@ F: drivers/spi/spi-at91-usart.c · 138 unmodified lines
1510115053
1510215054 MICROCHIP AUDIO ASOC DRIVERS
1510315055 M: Claudiu Beznea <claudiu.beznea@tuxon.dev>
15056+M: Andrei Simion <andrei.simion@microchip.com>
1510415057 L: linux-sound@vger.kernel.org
1510515058 S: Supported
1510615059 F: Documentation/devicetree/bindings/sound/atmel*
@@ -15209,6 +15162,7 @@ F: include/video/atmel_lcdc.h · 102 unmodified lines
1520915162
1521015163 MICROCHIP MCP16502 PMIC DRIVER
1521115164 M: Claudiu Beznea <claudiu.beznea@tuxon.dev>
15165+M: Andrei Simion <andrei.simion@microchip.com>
1521215166 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1521315167 S: Supported
1521415168 F: Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
@@ -15290,7 +15244,6 @@ F: drivers/tty/serial/8250/8250_pci1xxxx.c · 75 unmodified lines
1529015244
1529115245 MICROCHIP POLARFIRE FPGA DRIVERS
1529215246 M: Conor Dooley <conor.dooley@microchip.com>
15293−R: Vladimir Georgiev <v.georgiev@metrotek.ru>
1529415247 L: linux-fpga@vger.kernel.org
1529515248 S: Supported
1529615249 F: Documentation/devicetree/bindings/fpga/microchip,mpf-spi-fpga-mgr.yaml
@@ -15340,6 +15293,7 @@ F: drivers/spi/spi-atmel.* · 43 unmodified lines
1534015293
1534115294 MICROCHIP SSC DRIVER
1534215295 M: Claudiu Beznea <claudiu.beznea@tuxon.dev>
15296+M: Andrei Simion <andrei.simion@microchip.com>
1534315297 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1534415298 S: Supported
1534515299 F: Documentation/devicetree/bindings/misc/atmel-ssc.txt
@@ -15545,17 +15499,6 @@ F: arch/mips/ · 199 unmodified lines
1554515499 F: drivers/platform/mips/
1554615500 F: include/dt-bindings/mips/
1554715501
15548−MIPS BAIKAL-T1 PLATFORM
15549−M: Serge Semin <fancer.lancer@gmail.com>
15550−L: linux-mips@vger.kernel.org
15551−S: Supported
15552−F: Documentation/devicetree/bindings/bus/baikal,bt1-*.yaml
15553−F: Documentation/devicetree/bindings/clock/baikal,bt1-*.yaml
15554−F: drivers/bus/bt1-*.c
15555−F: drivers/clk/baikal-t1/
15556−F: drivers/memory/bt1-l2-ctl.c
15557−F: drivers/mtd/maps/physmap-bt1-rom.[ch]
15558−
1555915502 MIPS BOSTON DEVELOPMENT BOARD
1556015503 M: Paul Burton <paulburton@kernel.org>
1556115504 L: linux-mips@vger.kernel.org
@@ -15568,7 +15511,6 @@ F: include/dt-bindings/clock/boston-clock.h · 6 unmodified lines
1556815511
1556915512 MIPS CORE DRIVERS
1557015513 M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
15571−M: Serge Semin <fancer.lancer@gmail.com>
1557215514 L: linux-mips@vger.kernel.org
1557315515 S: Supported
1557415516 F: drivers/bus/mips_cdmm.c
@@ -16104,6 +16046,7 @@ F: include/uapi/linux/net_dropmon.h · 529 unmodified lines
1610416046 F: net/core/drop_monitor.c
1610516047
1610616048 NETWORKING DRIVERS
16049+M: Andrew Lunn <andrew+netdev@lunn.ch>
1610716050 M: "David S. Miller" <davem@davemloft.net>
1610816051 M: Eric Dumazet <edumazet@google.com>
1610916052 M: Jakub Kicinski <kuba@kernel.org>
@@ -16169,6 +16112,7 @@ M: "David S. Miller" <davem@davemloft.net> · 59 unmodified lines
1616916112 M: Eric Dumazet <edumazet@google.com>
1617016113 M: Jakub Kicinski <kuba@kernel.org>
1617116114 M: Paolo Abeni <pabeni@redhat.com>
16115+R: Simon Horman <horms@kernel.org>
1617216116 L: netdev@vger.kernel.org
1617316117 S: Maintained
1617416118 P: Documentation/process/maintainer-netdev.rst
@@ -16211,10 +16155,22 @@ F: include/uapi/linux/rtnetlink.h · 36 unmodified lines
1621116155 F: lib/net_utils.c
1621216156 F: lib/random32.c
1621316157 F: net/
16158+F: samples/pktgen/
1621416159 F: tools/net/
1621516160 F: tools/testing/selftests/net/
16161+X: Documentation/networking/mac80211-injection.rst
16162+X: Documentation/networking/mac80211_hwsim/
16163+X: Documentation/networking/regulatory.rst
16164+X: include/net/cfg80211.h
16165+X: include/net/ieee80211_radiotap.h
16166+X: include/net/iw_handler.h
16167+X: include/net/mac80211.h
16168+X: include/net/wext.h
1621616169 X: net/9p/
1621716170 X: net/bluetooth/
16171+X: net/mac80211/
16172+X: net/rfkill/
16173+X: net/wireless/
1621816174
1621916175 NETWORKING [IPSEC]
1622016176 M: Steffen Klassert <steffen.klassert@secunet.com>
@@ -16524,12 +16480,6 @@ F: include/linux/ntb.h · 303 unmodified lines
1652416480 F: include/linux/ntb_transport.h
1652516481 F: tools/testing/selftests/ntb/
1652616482
16527−NTB IDT DRIVER
16528−M: Serge Semin <fancer.lancer@gmail.com>
16529−L: ntb@lists.linux.dev
16530−S: Supported
16531−F: drivers/ntb/hw/idt/
16532−
1653316483 NTB INTEL DRIVER
1653416484 M: Dave Jiang <dave.jiang@intel.com>
1653516485 L: ntb@lists.linux.dev
@@ -18550,13 +18500,6 @@ F: drivers/pps/ · 2014 unmodified lines
1855018500 F: include/linux/pps*.h
1855118501 F: include/uapi/linux/pps.h
1855218502
18553−PPTP DRIVER
18554−M: Dmitry Kozlov <xeb@mail.ru>
18555−L: netdev@vger.kernel.org
18556−S: Maintained
18557−W: http://sourceforge.net/projects/accel-pptp
18558−F: drivers/net/ppp/pptp.c
18559−
1856018503 PRESSURE STALL INFORMATION (PSI)
1856118504 M: Johannes Weiner <hannes@cmpxchg.org>
1856218505 M: Suren Baghdasaryan <surenb@google.com>
@@ -19530,6 +19473,14 @@ S: Maintained · 967 unmodified lines
1953019473 F: Documentation/tools/rtla/
1953119474 F: tools/tracing/rtla/
1953219475
19476+Real-time Linux (PREEMPT_RT)
19477+M: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
19478+M: Clark Williams <clrkwllms@kernel.org>
19479+M: Steven Rostedt <rostedt@goodmis.org>
19480+L: linux-rt-devel@lists.linux.dev
19481+S: Supported
19482+K: PREEMPT_RT
19483+
1953319484 REALTEK AUDIO CODECS
1953419485 M: Oder Chiou <oder_chiou@realtek.com>
1953519486 S: Maintained
@@ -19639,15 +19590,6 @@ S: Supported · 103 unmodified lines
1963919590 F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml
1964019591 F: drivers/i2c/busses/i2c-emev2.c
1964119592
19642−RENESAS ETHERNET AVB DRIVER
19643−R: Sergey Shtylyov <s.shtylyov@omp.ru>
19644−L: netdev@vger.kernel.org
19645−L: linux-renesas-soc@vger.kernel.org
19646−F: Documentation/devicetree/bindings/net/renesas,etheravb.yaml
19647−F: drivers/net/ethernet/renesas/Kconfig
19648−F: drivers/net/ethernet/renesas/Makefile
19649−F: drivers/net/ethernet/renesas/ravb*
19650−
1965119593 RENESAS ETHERNET SWITCH DRIVER
1965219594 R: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
1965319595 L: netdev@vger.kernel.org
@@ -19697,14 +19639,6 @@ F: Documentation/devicetree/bindings/i2c/renesas,rmobile-iic.yaml · 43 unmodified lines
1969719639 F: drivers/i2c/busses/i2c-rcar.c
1969819640 F: drivers/i2c/busses/i2c-sh_mobile.c
1969919641
19700−RENESAS R-CAR SATA DRIVER
19701−R: Sergey Shtylyov <s.shtylyov@omp.ru>
19702−L: linux-ide@vger.kernel.org
19703−L: linux-renesas-soc@vger.kernel.org
19704−S: Supported
19705−F: Documentation/devicetree/bindings/ata/renesas,rcar-sata.yaml
19706−F: drivers/ata/sata_rcar.c
19707−
1970819642 RENESAS R-CAR THERMAL DRIVERS
1970919643 M: Niklas Söderlund <niklas.soderlund@ragnatech.se>
1971019644 L: linux-renesas-soc@vger.kernel.org
@@ -19780,16 +19714,6 @@ S: Supported · 69 unmodified lines
1978019714 F: Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml
1978119715 F: drivers/i2c/busses/i2c-rzv2m.c
1978219716
19783−RENESAS SUPERH ETHERNET DRIVER
19784−R: Sergey Shtylyov <s.shtylyov@omp.ru>
19785−L: netdev@vger.kernel.org
19786−L: linux-renesas-soc@vger.kernel.org
19787−F: Documentation/devicetree/bindings/net/renesas,ether.yaml
19788−F: drivers/net/ethernet/renesas/Kconfig
19789−F: drivers/net/ethernet/renesas/Makefile
19790−F: drivers/net/ethernet/renesas/sh_eth*
19791−F: include/linux/sh_eth.h
19792−
1979319717 RENESAS USB PHY DRIVER
1979419718 M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
1979519719 L: linux-renesas-soc@vger.kernel.org
@@ -21784,8 +21708,8 @@ F: drivers/accessibility/speakup/ · 1988 unmodified lines
2178421708 SPEAR PLATFORM/CLOCK/PINCTRL SUPPORT
2178521709 M: Viresh Kumar <vireshk@kernel.org>
2178621710 M: Shiraz Hashim <shiraz.linux.kernel@gmail.com>
21787−M: soc@kernel.org
2178821711 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
21712+L: soc@lists.linux.dev
2178921713 S: Maintained
2179021714 W: http://www.st.com/spear
2179121715 F: arch/arm/boot/dts/st/spear*
@@ -22443,19 +22367,11 @@ F: drivers/tty/serial/8250/8250_lpss.c · 651 unmodified lines
2244322367
2244422368 SYNOPSYS DESIGNWARE APB GPIO DRIVER
2244522369 M: Hoan Tran <hoan@os.amperecomputing.com>
22446−M: Serge Semin <fancer.lancer@gmail.com>
2244722370 L: linux-gpio@vger.kernel.org
2244822371 S: Maintained
2244922372 F: Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml
2245022373 F: drivers/gpio/gpio-dwapb.c
2245122374
22452−SYNOPSYS DESIGNWARE APB SSI DRIVER
22453−M: Serge Semin <fancer.lancer@gmail.com>
22454−L: linux-spi@vger.kernel.org
22455−S: Supported
22456−F: Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
22457−F: drivers/spi/spi-dw*
22458−
2245922375 SYNOPSYS DESIGNWARE AXI DMAC DRIVER
2246022376 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2246122377 S: Maintained
@@ -23299,7 +23215,7 @@ F: Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml · 837 unmodified lines
2329923215 F: drivers/iio/adc/ti-lmp92064.c
2330023216
2330123217 TI PCM3060 ASoC CODEC DRIVER
23302−M: Kirill Marinushkin <kmarinushkin@birdec.com>
23218+M: Kirill Marinushkin <k.marinushkin@gmail.com>
2330323219 L: linux-sound@vger.kernel.org
2330423220 S: Maintained
2330523221 F: Documentation/devicetree/bindings/sound/pcm3060.txt
@@ -23765,12 +23681,6 @@ L: linux-input@vger.kernel.org · 459 unmodified lines
2376523681 S: Maintained
2376623682 F: drivers/hid/hid-udraw-ps3.c
2376723683
23768−UFS FILESYSTEM
23769−M: Evgeniy Dushistov <dushistov@mail.ru>
23770−S: Maintained
23771−F: Documentation/admin-guide/ufs.rst
23772−F: fs/ufs/
23773−
2377423684 UHID USERSPACE HID IO DRIVER
2377523685 M: David Rheinsberg <david@readahead.eu>
2377623686 L: linux-input@vger.kernel.org
@@ -24073,6 +23983,7 @@ USB RAW GADGET DRIVER · 296 unmodified lines
2407323983 R: Andrey Konovalov <andreyknvl@gmail.com>
2407423984 L: linux-usb@vger.kernel.org
2407523985 S: Maintained
23986+B: https://github.com/xairy/raw-gadget/issues
2407623987 F: Documentation/usb/raw-gadget.rst
2407723988 F: drivers/usb/gadget/legacy/raw_gadget.c
2407823989 F: include/uapi/linux/usb/raw_gadget.h
@@ -24189,8 +24100,12 @@ F: drivers/usb/host/xhci* · 110 unmodified lines
2418924100
2419024101 USER DATAGRAM PROTOCOL (UDP)
2419124102 M: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
24103+L: netdev@vger.kernel.org
2419224104 S: Maintained
2419324105 F: include/linux/udp.h
24106+F: include/net/udp.h
24107+F: include/trace/events/udp.h
24108+F: include/uapi/linux/udp.h
2419424109 F: net/ipv4/udp.c
2419524110 F: net/ipv6/udp.c
2419624111
@@ -24741,9 +24656,10 @@ F: tools/testing/vsock/ · 544 unmodified lines
2474124656
2474224657 VMA
2474324658 M: Andrew Morton <akpm@linux-foundation.org>
24744−R: Liam R. Howlett <Liam.Howlett@oracle.com>
24659+M: Liam R. Howlett <Liam.Howlett@oracle.com>
24660+M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
2474524661 R: Vlastimil Babka <vbabka@suse.cz>
24746−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
24662+R: Jann Horn <jannh@google.com>
2474724663 L: linux-mm@kvack.org
2474824664 S: Maintained
2474924665 W: https://www.linux-mm.org
@@ -25417,7 +25333,7 @@ F: include/xen/arm/swiotlb-xen.h · 667 unmodified lines
2541725333 F: include/xen/swiotlb-xen.h
2541825334
2541925335 XFS FILESYSTEM
25420−M: Chandan Babu R <chandan.babu@oracle.com>
25336+M: Carlos Maiolino <cem@kernel.org>
2542125337 R: Darrick J. Wong <djwong@kernel.org>
2542225338 L: linux-xfs@vger.kernel.org
2542325339 S: Supported
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 12
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
5+EXTRAVERSION = -rc6
66 NAME = Baby Opossum Posse
77
88 # *DOCUMENTATION*
arch/Kconfig+12−14
@@ -838,7 +838,7 @@ config CFI_CLANG · 837 unmodified lines
838838 config CFI_ICALL_NORMALIZE_INTEGERS
839839 bool "Normalize CFI tags for integers"
840840 depends on CFI_CLANG
841− depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
841+ depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
842842 help
843843 This option normalizes the CFI tags for integer types so that all
844844 integer types of the same size and signedness receive the same CFI
@@ -851,21 +851,19 @@ config CFI_ICALL_NORMALIZE_INTEGERS · 6 unmodified lines
851851
852852 This option is necessary for using CFI with Rust. If unsure, say N.
853853
854−config HAVE_CFI_ICALL_NORMALIZE_INTEGERS
855− def_bool !GCOV_KERNEL && !KASAN
856− depends on CFI_CLANG
854+config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
855+ def_bool y
857856 depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
858− help
859− Is CFI_ICALL_NORMALIZE_INTEGERS supported with the set of compilers
860− currently in use?
857+ # With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
858+ depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
861859
862− This option defaults to false if GCOV or KASAN is enabled, as there is
863− an LLVM bug that makes normalized integers tags incompatible with
864− KASAN and GCOV. Kconfig currently does not have the infrastructure to
865− detect whether your rustc compiler contains the fix for this bug, so
866− it is assumed that it doesn't. If your compiler has the fix, you can
867− explicitly enable this option in your config file. The Kconfig logic
868− needed to detect this will be added in a future kernel release.
860+config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
861+ def_bool y
862+ depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
863+ depends on RUSTC_VERSION >= 107900
864+ # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
865+ depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
866+ (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
869867
870868 config CFI_PERMISSIVE
871869 bool "Use CFI in permissive mode"
arch/arm/boot/dts/broadcom/bcm2837-rpi-cm3-io3.dts+1−1
@@ -77,7 +77,7 @@ · 76 unmodified lines
7777 };
7878
7979 &hdmi {
80− hpd-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
80+ hpd-gpios = <&expgpio 0 GPIO_ACTIVE_LOW>;
8181 power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
8282 status = "okay";
8383 };
arch/arm64/boot/dts/marvell/cn9130-sr-som.dtsi+1−1
@@ -136,7 +136,7 @@ · 135 unmodified lines
136136 };
137137
138138 cp0_mdio_pins: cp0-mdio-pins {
139− marvell,pins = "mpp40", "mpp41";
139+ marvell,pins = "mpp0", "mpp1";
140140 marvell,function = "ge";
141141 };
142142
arch/arm64/include/asm/kvm_asm.h+1−0
@@ -178,6 +178,7 @@ struct kvm_nvhe_init_params { · 177 unmodified lines
178178 unsigned long hcr_el2;
179179 unsigned long vttbr;
180180 unsigned long vtcr;
181+ unsigned long tmp;
181182 };
182183
183184 /*
arch/arm64/include/asm/kvm_host.h+7−0
@@ -51,6 +51,7 @@ · 50 unmodified lines
5151 #define KVM_REQ_RELOAD_PMU KVM_ARCH_REQ(5)
5252 #define KVM_REQ_SUSPEND KVM_ARCH_REQ(6)
5353 #define KVM_REQ_RESYNC_PMU_EL0 KVM_ARCH_REQ(7)
54+#define KVM_REQ_NESTED_S2_UNMAP KVM_ARCH_REQ(8)
5455
5556 #define KVM_DIRTY_LOG_MANUAL_CAPS (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | \
5657 KVM_DIRTY_LOG_INITIALLY_SET)
@@ -211,6 +212,12 @@ struct kvm_s2_mmu { · 154 unmodified lines
211212 */
212213 bool nested_stage2_enabled;
213214
215+ /*
216+ * true when this MMU needs to be unmapped before being used for a new
217+ * purpose.
218+ */
219+ bool pending_unmap;
220+
214221 /*
215222 * 0: Nobody is currently using this, check vttbr for validity
216223 * >0: Somebody is actively using this.
arch/arm64/include/asm/kvm_mmu.h+2−1
@@ -166,7 +166,8 @@ int create_hyp_exec_mappings(phys_addr_t phys_addr, size_t size, · 165 unmodified lines
166166 int create_hyp_stack(phys_addr_t phys_addr, unsigned long *haddr);
167167 void __init free_hyp_pgds(void);
168168
169−void kvm_stage2_unmap_range(struct kvm_s2_mmu *mmu, phys_addr_t start, u64 size);
169+void kvm_stage2_unmap_range(struct kvm_s2_mmu *mmu, phys_addr_t start,
170+ u64 size, bool may_block);
170171 void kvm_stage2_flush_range(struct kvm_s2_mmu *mmu, phys_addr_t addr, phys_addr_t end);
171172 void kvm_stage2_wp_range(struct kvm_s2_mmu *mmu, phys_addr_t addr, phys_addr_t end);
172173
arch/arm64/include/asm/kvm_nested.h+3−1
@@ -78,6 +78,8 @@ extern void kvm_s2_mmu_iterate_by_vmid(struct kvm *kvm, u16 vmid, · 77 unmodified lines
7878 extern void kvm_vcpu_load_hw_mmu(struct kvm_vcpu *vcpu);
7979 extern void kvm_vcpu_put_hw_mmu(struct kvm_vcpu *vcpu);
8080
81+extern void check_nested_vcpu_requests(struct kvm_vcpu *vcpu);
82+
8183 struct kvm_s2_trans {
8284 phys_addr_t output;
8385 unsigned long block_size;
@@ -124,7 +126,7 @@ extern int kvm_s2_handle_perm_fault(struct kvm_vcpu *vcpu, · 40 unmodified lines
124126 struct kvm_s2_trans *trans);
125127 extern int kvm_inject_s2_fault(struct kvm_vcpu *vcpu, u64 esr_el2);
126128 extern void kvm_nested_s2_wp(struct kvm *kvm);
127−extern void kvm_nested_s2_unmap(struct kvm *kvm);
129+extern void kvm_nested_s2_unmap(struct kvm *kvm, bool may_block);
128130 extern void kvm_nested_s2_flush(struct kvm *kvm);
129131
130132 unsigned long compute_tlb_inval_range(struct kvm_s2_mmu *mmu, u64 val);
arch/arm64/include/asm/uprobes.h+3−5
@@ -10,11 +10,9 @@ · 9 unmodified lines
1010 #include <asm/insn.h>
1111 #include <asm/probes.h>
1212
13−#define MAX_UINSN_BYTES AARCH64_INSN_SIZE
14−
1513 #define UPROBE_SWBP_INSN cpu_to_le32(BRK64_OPCODE_UPROBES)
1614 #define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE
17−#define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
15+#define UPROBE_XOL_SLOT_BYTES AARCH64_INSN_SIZE
1816
1917 typedef __le32 uprobe_opcode_t;
2018
@@ -23,8 +21,8 @@ struct arch_uprobe_task { · 2 unmodified lines
2321
2422 struct arch_uprobe {
2523 union {
26− u8 insn[MAX_UINSN_BYTES];
27− u8 ixol[MAX_UINSN_BYTES];
24+ __le32 insn;
25+ __le32 ixol;
2826 };
2927 struct arch_probe_insn api;
3028 bool simulate;
arch/arm64/kernel/asm-offsets.c+1−0
@@ -146,6 +146,7 @@ int main(void) · 145 unmodified lines
146146 DEFINE(NVHE_INIT_HCR_EL2, offsetof(struct kvm_nvhe_init_params, hcr_el2));
147147 DEFINE(NVHE_INIT_VTTBR, offsetof(struct kvm_nvhe_init_params, vttbr));
148148 DEFINE(NVHE_INIT_VTCR, offsetof(struct kvm_nvhe_init_params, vtcr));
149+ DEFINE(NVHE_INIT_TMP, offsetof(struct kvm_nvhe_init_params, tmp));
149150 #endif
150151 #ifdef CONFIG_CPU_PM
151152 DEFINE(CPU_CTX_SP, offsetof(struct cpu_suspend_ctx, sp));
arch/arm64/kernel/probes/decode-insn.c+11−5
@@ -99,10 +99,6 @@ arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *api) · 98 unmodified lines
9999 aarch64_insn_is_blr(insn) ||
100100 aarch64_insn_is_ret(insn)) {
101101 api->handler = simulate_br_blr_ret;
102− } else if (aarch64_insn_is_ldr_lit(insn)) {
103− api->handler = simulate_ldr_literal;
104− } else if (aarch64_insn_is_ldrsw_lit(insn)) {
105− api->handler = simulate_ldrsw_literal;
106102 } else {
107103 /*
108104 * Instruction cannot be stepped out-of-line and we don't
@@ -140,6 +136,17 @@ arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi) · 31 unmodified lines
140136 probe_opcode_t insn = le32_to_cpu(*addr);
141137 probe_opcode_t *scan_end = NULL;
142138 unsigned long size = 0, offset = 0;
139+ struct arch_probe_insn *api = &asi->api;
140+
141+ if (aarch64_insn_is_ldr_lit(insn)) {
142+ api->handler = simulate_ldr_literal;
143+ decoded = INSN_GOOD_NO_SLOT;
144+ } else if (aarch64_insn_is_ldrsw_lit(insn)) {
145+ api->handler = simulate_ldrsw_literal;
146+ decoded = INSN_GOOD_NO_SLOT;
147+ } else {
148+ decoded = arm_probe_decode_insn(insn, &asi->api);
149+ }
143150
144151 /*
145152 * If there's a symbol defined in front of and near enough to
@@ -157,7 +164,6 @@ arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi) · 11 unmodified lines
157164 else
158165 scan_end = addr - MAX_ATOMIC_CONTEXT_SIZE;
159166 }
160− decoded = arm_probe_decode_insn(insn, &asi->api);
161167
162168 if (decoded != INSN_REJECTED && scan_end)
163169 if (is_probed_address_atomic(addr - 1, scan_end))
arch/arm64/kernel/probes/simulate-insn.c+7−11
@@ -171,17 +171,15 @@ simulate_tbz_tbnz(u32 opcode, long addr, struct pt_regs *regs) · 170 unmodified lines
171171 void __kprobes
172172 simulate_ldr_literal(u32 opcode, long addr, struct pt_regs *regs)
173173 {
174− u64 *load_addr;
174+ unsigned long load_addr;
175175 int xn = opcode & 0x1f;
176− int disp;
177176
178− disp = ldr_displacement(opcode);
179− load_addr = (u64 *) (addr + disp);
177+ load_addr = addr + ldr_displacement(opcode);
180178
181179 if (opcode & (1 << 30)) /* x0-x30 */
182− set_x_reg(regs, xn, *load_addr);
180+ set_x_reg(regs, xn, READ_ONCE(*(u64 *)load_addr));
183181 else /* w0-w30 */
184− set_w_reg(regs, xn, *load_addr);
182+ set_w_reg(regs, xn, READ_ONCE(*(u32 *)load_addr));
185183
186184 instruction_pointer_set(regs, instruction_pointer(regs) + 4);
187185 }
@@ -189,14 +187,12 @@ simulate_ldr_literal(u32 opcode, long addr, struct pt_regs *regs) · 1 unmodified line
189187 void __kprobes
190188 simulate_ldrsw_literal(u32 opcode, long addr, struct pt_regs *regs)
191189 {
192− s32 *load_addr;
190+ unsigned long load_addr;
193191 int xn = opcode & 0x1f;
194− int disp;
195192
196− disp = ldr_displacement(opcode);
197− load_addr = (s32 *) (addr + disp);
193+ load_addr = addr + ldr_displacement(opcode);
198194
199− set_x_reg(regs, xn, *load_addr);
195+ set_x_reg(regs, xn, READ_ONCE(*(s32 *)load_addr));
200196
201197 instruction_pointer_set(regs, instruction_pointer(regs) + 4);
202198 }
arch/arm64/kernel/probes/uprobes.c+2−2
@@ -42,7 +42,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, · 41 unmodified lines
4242 else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE))
4343 return -EINVAL;
4444
45− insn = *(probe_opcode_t *)(&auprobe->insn[0]);
45+ insn = le32_to_cpu(auprobe->insn);
4646
4747 switch (arm_probe_decode_insn(insn, &auprobe->api)) {
4848 case INSN_REJECTED:
@@ -108,7 +108,7 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) · 59 unmodified lines
108108 if (!auprobe->simulate)
109109 return false;
110110
111− insn = *(probe_opcode_t *)(&auprobe->insn[0]);
111+ insn = le32_to_cpu(auprobe->insn);
112112 addr = instruction_pointer(regs);
113113
114114 if (auprobe->api.handler)
arch/arm64/kernel/process.c+3−0
@@ -412,6 +412,9 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) · 411 unmodified lines
412412
413413 p->thread.cpu_context.x19 = (unsigned long)args->fn;
414414 p->thread.cpu_context.x20 = (unsigned long)args->fn_arg;
415+
416+ if (system_supports_poe())
417+ p->thread.por_el0 = POR_EL0_INIT;
415418 }
416419 p->thread.cpu_context.pc = (unsigned long)ret_from_fork;
417420 p->thread.cpu_context.sp = (unsigned long)childregs;
arch/arm64/kernel/signal.c+78−14
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/ratelimit.h>
2020 #include <linux/rseq.h>
2121 #include <linux/syscalls.h>
22+#include <linux/pkeys.h>
2223
2324 #include <asm/daifflags.h>
2425 #include <asm/debug-monitors.h>
@@ -66,10 +67,63 @@ struct rt_sigframe_user_layout { · 41 unmodified lines
6667 unsigned long end_offset;
6768 };
6869
70+/*
71+ * Holds any EL0-controlled state that influences unprivileged memory accesses.
72+ * This includes both accesses done in userspace and uaccess done in the kernel.
73+ *
74+ * This state needs to be carefully managed to ensure that it doesn't cause
75+ * uaccess to fail when setting up the signal frame, and the signal handler
76+ * itself also expects a well-defined state when entered.
77+ */
78+struct user_access_state {
79+ u64 por_el0;
80+};
81+
6982 #define BASE_SIGFRAME_SIZE round_up(sizeof(struct rt_sigframe), 16)
7083 #define TERMINATOR_SIZE round_up(sizeof(struct _aarch64_ctx), 16)
7184 #define EXTRA_CONTEXT_SIZE round_up(sizeof(struct extra_context), 16)
7285
86+/*
87+ * Save the user access state into ua_state and reset it to disable any
88+ * restrictions.
89+ */
90+static void save_reset_user_access_state(struct user_access_state *ua_state)
91+{
92+ if (system_supports_poe()) {
93+ u64 por_enable_all = 0;
94+
95+ for (int pkey = 0; pkey < arch_max_pkey(); pkey++)
96+ por_enable_all |= POE_RXW << (pkey * POR_BITS_PER_PKEY);
97+
98+ ua_state->por_el0 = read_sysreg_s(SYS_POR_EL0);
99+ write_sysreg_s(por_enable_all, SYS_POR_EL0);
100+ /* Ensure that any subsequent uaccess observes the updated value */
101+ isb();
102+ }
103+}
104+
105+/*
106+ * Set the user access state for invoking the signal handler.
107+ *
108+ * No uaccess should be done after that function is called.
109+ */
110+static void set_handler_user_access_state(void)
111+{
112+ if (system_supports_poe())
113+ write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0);
114+}
115+
116+/*
117+ * Restore the user access state to the values saved in ua_state.
118+ *
119+ * No uaccess should be done after that function is called.
120+ */
121+static void restore_user_access_state(const struct user_access_state *ua_state)
122+{
123+ if (system_supports_poe())
124+ write_sysreg_s(ua_state->por_el0, SYS_POR_EL0);
125+}
126+
73127 static void init_user_layout(struct rt_sigframe_user_layout *user)
74128 {
75129 const size_t reserved_size =
@@ -261,18 +315,20 @@ static int restore_fpmr_context(struct user_ctxs *user) · 185 unmodified lines
261315 return err;
262316 }
263317
264−static int preserve_poe_context(struct poe_context __user *ctx)
318+static int preserve_poe_context(struct poe_context __user *ctx,
319+ const struct user_access_state *ua_state)
265320 {
266321 int err = 0;
267322
268323 __put_user_error(POE_MAGIC, &ctx->head.magic, err);
269324 __put_user_error(sizeof(*ctx), &ctx->head.size, err);
270− __put_user_error(read_sysreg_s(SYS_POR_EL0), &ctx->por_el0, err);
325+ __put_user_error(ua_state->por_el0, &ctx->por_el0, err);
271326
272327 return err;
273328 }
274329
275−static int restore_poe_context(struct user_ctxs *user)
330+static int restore_poe_context(struct user_ctxs *user,
331+ struct user_access_state *ua_state)
276332 {
277333 u64 por_el0;
278334 int err = 0;
@@ -282,7 +338,7 @@ static int restore_poe_context(struct user_ctxs *user) · 3 unmodified lines
282338
283339 __get_user_error(por_el0, &(user->poe->por_el0), err);
284340 if (!err)
285− write_sysreg_s(por_el0, SYS_POR_EL0);
341+ ua_state->por_el0 = por_el0;
286342
287343 return err;
288344 }
@@ -850,7 +906,8 @@ invalid: · 561 unmodified lines
850906 }
851907
852908 static int restore_sigframe(struct pt_regs *regs,
853− struct rt_sigframe __user *sf)
909+ struct rt_sigframe __user *sf,
910+ struct user_access_state *ua_state)
854911 {
855912 sigset_t set;
856913 int i, err;
@@ -899,7 +956,7 @@ static int restore_sigframe(struct pt_regs *regs, · 42 unmodified lines
899956 err = restore_zt_context(&user);
900957
901958 if (err == 0 && system_supports_poe() && user.poe)
902− err = restore_poe_context(&user);
959+ err = restore_poe_context(&user, ua_state);
903960
904961 return err;
905962 }
@@ -908,6 +965,7 @@ SYSCALL_DEFINE0(rt_sigreturn) · 2 unmodified lines
908965 {
909966 struct pt_regs *regs = current_pt_regs();
910967 struct rt_sigframe __user *frame;
968+ struct user_access_state ua_state;
911969
912970 /* Always make any pending restarted system calls return -EINTR */
913971 current->restart_block.fn = do_no_restart_syscall;
@@ -924,12 +982,14 @@ SYSCALL_DEFINE0(rt_sigreturn) · 10 unmodified lines
924982 if (!access_ok(frame, sizeof (*frame)))
925983 goto badframe;
926984
927− if (restore_sigframe(regs, frame))
985+ if (restore_sigframe(regs, frame, &ua_state))
928986 goto badframe;
929987
930988 if (restore_altstack(&frame->uc.uc_stack))
931989 goto badframe;
932990
991+ restore_user_access_state(&ua_state);
992+
933993 return regs->regs[0];
934994
935995 badframe:
@@ -1035,7 +1095,8 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user, · 99 unmodified lines
10351095 }
10361096
10371097 static int setup_sigframe(struct rt_sigframe_user_layout *user,
1038− struct pt_regs *regs, sigset_t *set)
1098+ struct pt_regs *regs, sigset_t *set,
1099+ const struct user_access_state *ua_state)
10391100 {
10401101 int i, err = 0;
10411102 struct rt_sigframe __user *sf = user->sigframe;
@@ -1097,10 +1158,9 @@ static int setup_sigframe(struct rt_sigframe_user_layout *user, · 55 unmodified lines
10971158 struct poe_context __user *poe_ctx =
10981159 apply_user_offset(user, user->poe_offset);
10991160
1100− err |= preserve_poe_context(poe_ctx);
1161+ err |= preserve_poe_context(poe_ctx, ua_state);
11011162 }
11021163
1103−
11041164 /* ZA state if present */
11051165 if (system_supports_sme() && err == 0 && user->za_offset) {
11061166 struct za_context __user *za_ctx =
@@ -1237,9 +1297,6 @@ static void setup_return(struct pt_regs *regs, struct k_sigaction *ka, · 130 unmodified lines
12371297 sme_smstop();
12381298 }
12391299
1240− if (system_supports_poe())
1241− write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0);
1242−
12431300 if (ka->sa.sa_flags & SA_RESTORER)
12441301 sigtramp = ka->sa.sa_restorer;
12451302 else
@@ -1253,6 +1310,7 @@ static int setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, · 7 unmodified lines
12531310 {
12541311 struct rt_sigframe_user_layout user;
12551312 struct rt_sigframe __user *frame;
1313+ struct user_access_state ua_state;
12561314 int err = 0;
12571315
12581316 fpsimd_signal_preserve_current_state();
@@ -1260,13 +1318,14 @@ static int setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, · 1 unmodified line
12601318 if (get_sigframe(&user, ksig, regs))
12611319 return 1;
12621320
1321+ save_reset_user_access_state(&ua_state);
12631322 frame = user.sigframe;
12641323
12651324 __put_user_error(0, &frame->uc.uc_flags, err);
12661325 __put_user_error(NULL, &frame->uc.uc_link, err);
12671326
12681327 err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
1269− err |= setup_sigframe(&user, regs, set);
1328+ err |= setup_sigframe(&user, regs, set, &ua_state);
12701329 if (err == 0) {
12711330 setup_return(regs, &ksig->ka, &user, usig);
12721331 if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
@@ -1276,6 +1335,11 @@ static int setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, · 3 unmodified lines
12761335 }
12771336 }
12781337
1338+ if (err == 0)
1339+ set_handler_user_access_state();
1340+ else
1341+ restore_user_access_state(&ua_state);
1342+
12791343 return err;
12801344 }
12811345
arch/arm64/kvm/arm.c+5−0
@@ -997,6 +997,9 @@ static int kvm_vcpu_suspend(struct kvm_vcpu *vcpu) · 996 unmodified lines
997997 static int check_vcpu_requests(struct kvm_vcpu *vcpu)
998998 {
999999 if (kvm_request_pending(vcpu)) {
1000+ if (kvm_check_request(KVM_REQ_VM_DEAD, vcpu))
1001+ return -EIO;
1002+
10001003 if (kvm_check_request(KVM_REQ_SLEEP, vcpu))
10011004 kvm_vcpu_sleep(vcpu);
10021005
@@ -1031,6 +1034,8 @@ static int check_vcpu_requests(struct kvm_vcpu *vcpu) · 28 unmodified lines
10311034
10321035 if (kvm_dirty_ring_check_request(vcpu))
10331036 return 0;
1037+
1038+ check_nested_vcpu_requests(vcpu);
10341039 }
10351040
10361041 return 1;
arch/arm64/kvm/hyp/nvhe/hyp-init.S+29−23
@@ -24,28 +24,25 @@ · 23 unmodified lines
2424 .align 11
2525
2626 SYM_CODE_START(__kvm_hyp_init)
27− ventry __invalid // Synchronous EL2t
28− ventry __invalid // IRQ EL2t
29− ventry __invalid // FIQ EL2t
30− ventry __invalid // Error EL2t
27+ ventry . // Synchronous EL2t
28+ ventry . // IRQ EL2t
29+ ventry . // FIQ EL2t
30+ ventry . // Error EL2t
3131
32− ventry __invalid // Synchronous EL2h
33− ventry __invalid // IRQ EL2h
34− ventry __invalid // FIQ EL2h
35− ventry __invalid // Error EL2h
32+ ventry . // Synchronous EL2h
33+ ventry . // IRQ EL2h
34+ ventry . // FIQ EL2h
35+ ventry . // Error EL2h
3636
3737 ventry __do_hyp_init // Synchronous 64-bit EL1
38− ventry __invalid // IRQ 64-bit EL1
39− ventry __invalid // FIQ 64-bit EL1
40− ventry __invalid // Error 64-bit EL1
38+ ventry . // IRQ 64-bit EL1
39+ ventry . // FIQ 64-bit EL1
40+ ventry . // Error 64-bit EL1
4141
42− ventry __invalid // Synchronous 32-bit EL1
43− ventry __invalid // IRQ 32-bit EL1
44− ventry __invalid // FIQ 32-bit EL1
45− ventry __invalid // Error 32-bit EL1
46−
47−__invalid:
48− b .
42+ ventry . // Synchronous 32-bit EL1
43+ ventry . // IRQ 32-bit EL1
44+ ventry . // FIQ 32-bit EL1
45+ ventry . // Error 32-bit EL1
4946
5047 /*
5148 * Only uses x0..x3 so as to not clobber callee-saved SMCCC registers.
@@ -76,6 +73,13 @@ __do_hyp_init: · 24 unmodified lines
7673 eret
7774 SYM_CODE_END(__kvm_hyp_init)
7875
76+SYM_CODE_START_LOCAL(__kvm_init_el2_state)
77+ /* Initialize EL2 CPU state to sane values. */
78+ init_el2_state // Clobbers x0..x2
79+ finalise_el2_state
80+ ret
81+SYM_CODE_END(__kvm_init_el2_state)
82+
7983 /*
8084 * Initialize the hypervisor in EL2.
8185 *
@@ -102,9 +106,12 @@ SYM_CODE_START_LOCAL(___kvm_hyp_init) · 20 unmodified lines
102106 // TPIDR_EL2 is used to preserve x0 across the macro maze...
103107 isb
104108 msr tpidr_el2, x0
105− init_el2_state
106− finalise_el2_state
109+ str lr, [x0, #NVHE_INIT_TMP]
110+
111+ bl __kvm_init_el2_state
112+
107113 mrs x0, tpidr_el2
114+ ldr lr, [x0, #NVHE_INIT_TMP]
108115
109116 1:
110117 ldr x1, [x0, #NVHE_INIT_TPIDR_EL2]
@@ -199,9 +206,8 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu) · 88 unmodified lines
199206
200207 2: msr SPsel, #1 // We want to use SP_EL{1,2}
201208
202− /* Initialize EL2 CPU state to sane values. */
203− init_el2_state // Clobbers x0..x2
204− finalise_el2_state
209+ bl __kvm_init_el2_state
210+
205211 __init_el2_nvhe_prepare_eret
206212
207213 /* Enable MMU, set vectors and stack. */
arch/arm64/kvm/hypercalls.c+6−6
@@ -317,7 +317,7 @@ int kvm_smccc_call_handler(struct kvm_vcpu *vcpu) · 316 unmodified lines
317317 * to the guest, and hide SSBS so that the
318318 * guest stays protected.
319319 */
320− if (cpus_have_final_cap(ARM64_SSBS))
320+ if (kvm_has_feat(vcpu->kvm, ID_AA64PFR1_EL1, SSBS, IMP))
321321 break;
322322 fallthrough;
323323 case SPECTRE_UNAFFECTED:
@@ -428,7 +428,7 @@ int kvm_arm_copy_fw_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) · 104 unmodified lines
428428 * Convert the workaround level into an easy-to-compare number, where higher
429429 * values mean better protection.
430430 */
431−static int get_kernel_wa_level(u64 regid)
431+static int get_kernel_wa_level(struct kvm_vcpu *vcpu, u64 regid)
432432 {
433433 switch (regid) {
434434 case KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1:
@@ -449,7 +449,7 @@ static int get_kernel_wa_level(u64 regid) · 14 unmodified lines
449449 * don't have any FW mitigation if SSBS is there at
450450 * all times.
451451 */
452− if (cpus_have_final_cap(ARM64_SSBS))
452+ if (kvm_has_feat(vcpu->kvm, ID_AA64PFR1_EL1, SSBS, IMP))
453453 return KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL;
454454 fallthrough;
455455 case SPECTRE_UNAFFECTED:
@@ -486,7 +486,7 @@ int kvm_arm_get_fw_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 30 unmodified lines
486486 case KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1:
487487 case KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2:
488488 case KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3:
489− val = get_kernel_wa_level(reg->id) & KVM_REG_FEATURE_LEVEL_MASK;
489+ val = get_kernel_wa_level(vcpu, reg->id) & KVM_REG_FEATURE_LEVEL_MASK;
490490 break;
491491 case KVM_REG_ARM_STD_BMAP:
492492 val = READ_ONCE(smccc_feat->std_bmap);
@@ -588,7 +588,7 @@ int kvm_arm_set_fw_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 95 unmodified lines
588588 if (val & ~KVM_REG_FEATURE_LEVEL_MASK)
589589 return -EINVAL;
590590
591− if (get_kernel_wa_level(reg->id) < val)
591+ if (get_kernel_wa_level(vcpu, reg->id) < val)
592592 return -EINVAL;
593593
594594 return 0;
@@ -624,7 +624,7 @@ int kvm_arm_set_fw_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 29 unmodified lines
624624 * We can deal with NOT_AVAIL on NOT_REQUIRED, but not the
625625 * other way around.
626626 */
627− if (get_kernel_wa_level(reg->id) < wa_level)
627+ if (get_kernel_wa_level(vcpu, reg->id) < wa_level)
628628 return -EINVAL;
629629
630630 return 0;
arch/arm64/kvm/mmu.c+8−7
@@ -328,9 +328,10 @@ static void __unmap_stage2_range(struct kvm_s2_mmu *mmu, phys_addr_t start, u64 · 327 unmodified lines
328328 may_block));
329329 }
330330
331−void kvm_stage2_unmap_range(struct kvm_s2_mmu *mmu, phys_addr_t start, u64 size)
331+void kvm_stage2_unmap_range(struct kvm_s2_mmu *mmu, phys_addr_t start,
332+ u64 size, bool may_block)
332333 {
333− __unmap_stage2_range(mmu, start, size, true);
334+ __unmap_stage2_range(mmu, start, size, may_block);
334335 }
335336
336337 void kvm_stage2_flush_range(struct kvm_s2_mmu *mmu, phys_addr_t addr, phys_addr_t end)
@@ -1015,7 +1016,7 @@ static void stage2_unmap_memslot(struct kvm *kvm, · 678 unmodified lines
10151016
10161017 if (!(vma->vm_flags & VM_PFNMAP)) {
10171018 gpa_t gpa = addr + (vm_start - memslot->userspace_addr);
1018− kvm_stage2_unmap_range(&kvm->arch.mmu, gpa, vm_end - vm_start);
1019+ kvm_stage2_unmap_range(&kvm->arch.mmu, gpa, vm_end - vm_start, true);
10191020 }
10201021 hva = vm_end;
10211022 } while (hva < reg_end);
@@ -1042,7 +1043,7 @@ void stage2_unmap_vm(struct kvm *kvm) · 20 unmodified lines
10421043 kvm_for_each_memslot(memslot, bkt, slots)
10431044 stage2_unmap_memslot(kvm, memslot);
10441045
1045− kvm_nested_s2_unmap(kvm);
1046+ kvm_nested_s2_unmap(kvm, true);
10461047
10471048 write_unlock(&kvm->mmu_lock);
10481049 mmap_read_unlock(current->mm);
@@ -1912,7 +1913,7 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range) · 863 unmodified lines
19121913 (range->end - range->start) << PAGE_SHIFT,
19131914 range->may_block);
19141915
1915− kvm_nested_s2_unmap(kvm);
1916+ kvm_nested_s2_unmap(kvm, range->may_block);
19161917 return false;
19171918 }
19181919
@@ -2179,8 +2180,8 @@ void kvm_arch_flush_shadow_memslot(struct kvm *kvm, · 260 unmodified lines
21792180 phys_addr_t size = slot->npages << PAGE_SHIFT;
21802181
21812182 write_lock(&kvm->mmu_lock);
2182− kvm_stage2_unmap_range(&kvm->arch.mmu, gpa, size);
2183− kvm_nested_s2_unmap(kvm);
2183+ kvm_stage2_unmap_range(&kvm->arch.mmu, gpa, size, true);
2184+ kvm_nested_s2_unmap(kvm, true);
21842185 write_unlock(&kvm->mmu_lock);
21852186 }
21862187
arch/arm64/kvm/nested.c+46−7
@@ -632,9 +632,9 @@ static struct kvm_s2_mmu *get_s2_mmu_nested(struct kvm_vcpu *vcpu) · 631 unmodified lines
632632 /* Set the scene for the next search */
633633 kvm->arch.nested_mmus_next = (i + 1) % kvm->arch.nested_mmus_size;
634634
635− /* Clear the old state */
635+ /* Make sure we don't forget to do the laundry */
636636 if (kvm_s2_mmu_valid(s2_mmu))
637− kvm_stage2_unmap_range(s2_mmu, 0, kvm_phys_size(s2_mmu));
637+ s2_mmu->pending_unmap = true;
638638
639639 /*
640640 * The virtual VMID (modulo CnP) will be used as a key when matching
@@ -650,6 +650,16 @@ static struct kvm_s2_mmu *get_s2_mmu_nested(struct kvm_vcpu *vcpu) · 9 unmodified lines
650650
651651 out:
652652 atomic_inc(&s2_mmu->refcnt);
653+
654+ /*
655+ * Set the vCPU request to perform an unmap, even if the pending unmap
656+ * originates from another vCPU. This guarantees that the MMU has been
657+ * completely unmapped before any vCPU actually uses it, and allows
658+ * multiple vCPUs to lend a hand with completing the unmap.
659+ */
660+ if (s2_mmu->pending_unmap)
661+ kvm_make_request(KVM_REQ_NESTED_S2_UNMAP, vcpu);
662+
653663 return s2_mmu;
654664 }
655665
@@ -663,6 +673,13 @@ void kvm_init_nested_s2_mmu(struct kvm_s2_mmu *mmu) · 7 unmodified lines
663673
664674 void kvm_vcpu_load_hw_mmu(struct kvm_vcpu *vcpu)
665675 {
676+ /*
677+ * The vCPU kept its reference on the MMU after the last put, keep
678+ * rolling with it.
679+ */
680+ if (vcpu->arch.hw_mmu)
681+ return;
682+
666683 if (is_hyp_ctxt(vcpu)) {
667684 vcpu->arch.hw_mmu = &vcpu->kvm->arch.mmu;
668685 } else {
@@ -674,10 +691,18 @@ void kvm_vcpu_load_hw_mmu(struct kvm_vcpu *vcpu) · 5 unmodified lines
674691
675692 void kvm_vcpu_put_hw_mmu(struct kvm_vcpu *vcpu)
676693 {
677− if (kvm_is_nested_s2_mmu(vcpu->kvm, vcpu->arch.hw_mmu)) {
694+ /*
695+ * Keep a reference on the associated stage-2 MMU if the vCPU is
696+ * scheduling out and not in WFI emulation, suggesting it is likely to
697+ * reuse the MMU sometime soon.
698+ */
699+ if (vcpu->scheduled_out && !vcpu_get_flag(vcpu, IN_WFI))
700+ return;
701+
702+ if (kvm_is_nested_s2_mmu(vcpu->kvm, vcpu->arch.hw_mmu))
678703 atomic_dec(&vcpu->arch.hw_mmu->refcnt);
679− vcpu->arch.hw_mmu = NULL;
680− }
704+
705+ vcpu->arch.hw_mmu = NULL;
681706 }
682707
683708 /*
@@ -730,7 +755,7 @@ void kvm_nested_s2_wp(struct kvm *kvm) · 46 unmodified lines
730755 }
731756 }
732757
733−void kvm_nested_s2_unmap(struct kvm *kvm)
758+void kvm_nested_s2_unmap(struct kvm *kvm, bool may_block)
734759 {
735760 int i;
736761
@@ -740,7 +765,7 @@ void kvm_nested_s2_unmap(struct kvm *kvm) · 3 unmodified lines
740765 struct kvm_s2_mmu *mmu = &kvm->arch.nested_mmus[i];
741766
742767 if (kvm_s2_mmu_valid(mmu))
743− kvm_stage2_unmap_range(mmu, 0, kvm_phys_size(mmu));
768+ kvm_stage2_unmap_range(mmu, 0, kvm_phys_size(mmu), may_block);
744769 }
745770 }
746771
@@ -1184,3 +1209,17 @@ int kvm_init_nv_sysregs(struct kvm *kvm) · 437 unmodified lines
11841209
11851210 return 0;
11861211 }
1212+
1213+void check_nested_vcpu_requests(struct kvm_vcpu *vcpu)
1214+{
1215+ if (kvm_check_request(KVM_REQ_NESTED_S2_UNMAP, vcpu)) {
1216+ struct kvm_s2_mmu *mmu = vcpu->arch.hw_mmu;
1217+
1218+ write_lock(&vcpu->kvm->mmu_lock);
1219+ if (mmu->pending_unmap) {
1220+ kvm_stage2_unmap_range(mmu, 0, kvm_phys_size(mmu), true);
1221+ mmu->pending_unmap = false;
1222+ }
1223+ write_unlock(&vcpu->kvm->mmu_lock);
1224+ }
1225+}
arch/arm64/kvm/sys_regs.c+70−7
@@ -1527,6 +1527,14 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu, · 1526 unmodified lines
15271527 val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_MTE);
15281528
15291529 val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_SME);
1530+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_RNDR_trap);
1531+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_NMI);
1532+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_MTE_frac);
1533+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_GCS);
1534+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_THE);
1535+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_MTEX);
1536+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_DF2);
1537+ val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_PFAR);
15301538 break;
15311539 case SYS_ID_AA64PFR2_EL1:
15321540 /* We only expose FPMR */
@@ -1550,7 +1558,8 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu, · 17 unmodified lines
15501558 val &= ~ID_AA64MMFR2_EL1_CCIDX_MASK;
15511559 break;
15521560 case SYS_ID_AA64MMFR3_EL1:
1553− val &= ID_AA64MMFR3_EL1_TCRX | ID_AA64MMFR3_EL1_S1POE;
1561+ val &= ID_AA64MMFR3_EL1_TCRX | ID_AA64MMFR3_EL1_S1POE |
1562+ ID_AA64MMFR3_EL1_S1PIE;
15541563 break;
15551564 case SYS_ID_MMFR4_EL1:
15561565 val &= ~ARM64_FEATURE_MASK(ID_MMFR4_EL1_CCIDX);
@@ -1985,7 +1994,7 @@ static u64 reset_clidr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) · 428 unmodified lines
19851994 * one cache line.
19861995 */
19871996 if (kvm_has_mte(vcpu->kvm))
1988− clidr |= 2 << CLIDR_TTYPE_SHIFT(loc);
1997+ clidr |= 2ULL << CLIDR_TTYPE_SHIFT(loc);
19891998
19901999 __vcpu_sys_reg(vcpu, r->reg) = clidr;
19912000
@@ -2376,7 +2385,19 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 384 unmodified lines
23762385 ID_AA64PFR0_EL1_RAS |
23772386 ID_AA64PFR0_EL1_AdvSIMD |
23782387 ID_AA64PFR0_EL1_FP), },
2379− ID_SANITISED(ID_AA64PFR1_EL1),
2388+ ID_WRITABLE(ID_AA64PFR1_EL1, ~(ID_AA64PFR1_EL1_PFAR |
2389+ ID_AA64PFR1_EL1_DF2 |
2390+ ID_AA64PFR1_EL1_MTEX |
2391+ ID_AA64PFR1_EL1_THE |
2392+ ID_AA64PFR1_EL1_GCS |
2393+ ID_AA64PFR1_EL1_MTE_frac |
2394+ ID_AA64PFR1_EL1_NMI |
2395+ ID_AA64PFR1_EL1_RNDR_trap |
2396+ ID_AA64PFR1_EL1_SME |
2397+ ID_AA64PFR1_EL1_RES0 |
2398+ ID_AA64PFR1_EL1_MPAM_frac |
2399+ ID_AA64PFR1_EL1_RAS_frac |
2400+ ID_AA64PFR1_EL1_MTE)),
23802401 ID_WRITABLE(ID_AA64PFR2_EL1, ID_AA64PFR2_EL1_FPMR),
23812402 ID_UNALLOCATED(4,3),
23822403 ID_WRITABLE(ID_AA64ZFR0_EL1, ~ID_AA64ZFR0_EL1_RES0),
@@ -2390,7 +2411,21 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 7 unmodified lines
23902411 .get_user = get_id_reg,
23912412 .set_user = set_id_aa64dfr0_el1,
23922413 .reset = read_sanitised_id_aa64dfr0_el1,
2393− .val = ID_AA64DFR0_EL1_PMUVer_MASK |
2414+ /*
2415+ * Prior to FEAT_Debugv8.9, the architecture defines context-aware
2416+ * breakpoints (CTX_CMPs) as the highest numbered breakpoints (BRPs).
2417+ * KVM does not trap + emulate the breakpoint registers, and as such
2418+ * cannot support a layout that misaligns with the underlying hardware.
2419+ * While it may be possible to describe a subset that aligns with
2420+ * hardware, just prevent changes to BRPs and CTX_CMPs altogether for
2421+ * simplicity.
2422+ *
2423+ * See DDI0487K.a, section D2.8.3 Breakpoint types and linking
2424+ * of breakpoints for more details.
2425+ */
2426+ .val = ID_AA64DFR0_EL1_DoubleLock_MASK |
2427+ ID_AA64DFR0_EL1_WRPs_MASK |
2428+ ID_AA64DFR0_EL1_PMUVer_MASK |
23942429 ID_AA64DFR0_EL1_DebugVer_MASK, },
23952430 ID_SANITISED(ID_AA64DFR1_EL1),
23962431 ID_UNALLOCATED(5,2),
@@ -2433,6 +2468,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 36 unmodified lines
24332468 ID_AA64MMFR2_EL1_NV |
24342469 ID_AA64MMFR2_EL1_CCIDX)),
24352470 ID_WRITABLE(ID_AA64MMFR3_EL1, (ID_AA64MMFR3_EL1_TCRX |
2471+ ID_AA64MMFR3_EL1_S1PIE |
24362472 ID_AA64MMFR3_EL1_S1POE)),
24372473 ID_SANITISED(ID_AA64MMFR4_EL1),
24382474 ID_UNALLOCATED(7,5),
@@ -2903,7 +2939,7 @@ static bool handle_alle1is(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 464 unmodified lines
29032939 * Drop all shadow S2s, resulting in S1/S2 TLBIs for each of the
29042940 * corresponding VMIDs.
29052941 */
2906− kvm_nested_s2_unmap(vcpu->kvm);
2942+ kvm_nested_s2_unmap(vcpu->kvm, true);
29072943
29082944 write_unlock(&vcpu->kvm->mmu_lock);
29092945
@@ -2955,7 +2991,30 @@ union tlbi_info { · 45 unmodified lines
29552991 static void s2_mmu_unmap_range(struct kvm_s2_mmu *mmu,
29562992 const union tlbi_info *info)
29572993 {
2958− kvm_stage2_unmap_range(mmu, info->range.start, info->range.size);
2994+ /*
2995+ * The unmap operation is allowed to drop the MMU lock and block, which
2996+ * means that @mmu could be used for a different context than the one
2997+ * currently being invalidated.
2998+ *
2999+ * This behavior is still safe, as:
3000+ *
3001+ * 1) The vCPU(s) that recycled the MMU are responsible for invalidating
3002+ * the entire MMU before reusing it, which still honors the intent
3003+ * of a TLBI.
3004+ *
3005+ * 2) Until the guest TLBI instruction is 'retired' (i.e. increment PC
3006+ * and ERET to the guest), other vCPUs are allowed to use stale
3007+ * translations.
3008+ *
3009+ * 3) Accidentally unmapping an unrelated MMU context is nonfatal, and
3010+ * at worst may cause more aborts for shadow stage-2 fills.
3011+ *
3012+ * Dropping the MMU lock also implies that shadow stage-2 fills could
3013+ * happen behind the back of the TLBI. This is still safe, though, as
3014+ * the L1 needs to put its stage-2 in a consistent state before doing
3015+ * the TLBI.
3016+ */
3017+ kvm_stage2_unmap_range(mmu, info->range.start, info->range.size, true);
29593018 }
29603019
29613020 static bool handle_vmalls12e1is(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
@@ -3050,7 +3109,11 @@ static void s2_mmu_unmap_ipa(struct kvm_s2_mmu *mmu, · 88 unmodified lines
30503109 max_size = compute_tlb_inval_range(mmu, info->ipa.addr);
30513110 base_addr &= ~(max_size - 1);
30523111
3053− kvm_stage2_unmap_range(mmu, base_addr, max_size);
3112+ /*
3113+ * See comment in s2_mmu_unmap_range() for why this is allowed to
3114+ * reschedule.
3115+ */
3116+ kvm_stage2_unmap_range(mmu, base_addr, max_size, true);
30543117 }
30553118
30563119 static bool handle_ipas2e1is(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
arch/arm64/kvm/vgic/vgic-init.c+35−6
@@ -417,8 +417,28 @@ static void __kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu) · 416 unmodified lines
417417 kfree(vgic_cpu->private_irqs);
418418 vgic_cpu->private_irqs = NULL;
419419
420− if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)
420+ if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
421+ /*
422+ * If this vCPU is being destroyed because of a failed creation
423+ * then unregister the redistributor to avoid leaving behind a
424+ * dangling pointer to the vCPU struct.
425+ *
426+ * vCPUs that have been successfully created (i.e. added to
427+ * kvm->vcpu_array) get unregistered in kvm_vgic_destroy(), as
428+ * this function gets called while holding kvm->arch.config_lock
429+ * in the VM teardown path and would otherwise introduce a lock
430+ * inversion w.r.t. kvm->srcu.
431+ *
432+ * vCPUs that failed creation are torn down outside of the
433+ * kvm->arch.config_lock and do not get unregistered in
434+ * kvm_vgic_destroy(), meaning it is both safe and necessary to
435+ * do so here.
436+ */
437+ if (kvm_get_vcpu_by_id(vcpu->kvm, vcpu->vcpu_id) != vcpu)
438+ vgic_unregister_redist_iodev(vcpu);
439+
421440 vgic_cpu->rd_iodev.base_addr = VGIC_ADDR_UNDEF;
441+ }
422442 }
423443
424444 void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
@@ -524,22 +544,31 @@ int kvm_vgic_map_resources(struct kvm *kvm) · 99 unmodified lines
524544 if (ret)
525545 goto out;
526546
527− dist->ready = true;
528547 dist_base = dist->vgic_dist_base;
529548 mutex_unlock(&kvm->arch.config_lock);
530549
531550 ret = vgic_register_dist_iodev(kvm, dist_base, type);
532− if (ret)
551+ if (ret) {
533552 kvm_err("Unable to register VGIC dist MMIO regions\n");
553+ goto out_slots;
554+ }
534555
556+ /*
557+ * kvm_io_bus_register_dev() guarantees all readers see the new MMIO
558+ * registration before returning through synchronize_srcu(), which also
559+ * implies a full memory barrier. As such, marking the distributor as
560+ * 'ready' here is guaranteed to be ordered after all vCPUs having seen
561+ * a completely configured distributor.
562+ */
563+ dist->ready = true;
535564 goto out_slots;
536565 out:
537566 mutex_unlock(&kvm->arch.config_lock);
538567 out_slots:
539− mutex_unlock(&kvm->slots_lock);
540−
541568 if (ret)
542− kvm_vgic_destroy(kvm);
569+ kvm_vm_dead(kvm);
570+
571+ mutex_unlock(&kvm->slots_lock);
543572
544573 return ret;
545574 }
arch/arm64/kvm/vgic/vgic-kvm-device.c+6−1
@@ -236,7 +236,12 @@ static int vgic_set_common_attr(struct kvm_device *dev, · 235 unmodified lines
236236
237237 mutex_lock(&dev->kvm->arch.config_lock);
238238
239− if (vgic_ready(dev->kvm) || dev->kvm->arch.vgic.nr_spis)
239+ /*
240+ * Either userspace has already configured NR_IRQS or
241+ * the vgic has already been initialized and vgic_init()
242+ * supplied a default amount of SPIs.
243+ */
244+ if (dev->kvm->arch.vgic.nr_spis)
240245 ret = -EBUSY;
241246 else
242247 dev->kvm->arch.vgic.nr_spis =
arch/arm64/net/bpf_jit_comp.c+10−2
@@ -2220,7 +2220,11 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im, · 2219 unmodified lines
22202220 emit(A64_STR64I(A64_R(20), A64_SP, regs_off + 8), ctx);
22212221
22222222 if (flags & BPF_TRAMP_F_CALL_ORIG) {
2223− emit_a64_mov_i64(A64_R(0), (const u64)im, ctx);
2223+ /* for the first pass, assume the worst case */
2224+ if (!ctx->image)
2225+ ctx->idx += 4;
2226+ else
2227+ emit_a64_mov_i64(A64_R(0), (const u64)im, ctx);
22242228 emit_call((const u64)__bpf_tramp_enter, ctx);
22252229 }
22262230
@@ -2264,7 +2268,11 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im, · 37 unmodified lines
22642268
22652269 if (flags & BPF_TRAMP_F_CALL_ORIG) {
22662270 im->ip_epilogue = ctx->ro_image + ctx->idx;
2267− emit_a64_mov_i64(A64_R(0), (const u64)im, ctx);
2271+ /* for the first pass, assume the worst case */
2272+ if (!ctx->image)
2273+ ctx->idx += 4;
2274+ else
2275+ emit_a64_mov_i64(A64_R(0), (const u64)im, ctx);
22682276 emit_call((const u64)__bpf_tramp_exit, ctx);
22692277 }
22702278
arch/loongarch/include/asm/bootinfo.h+4−0
@@ -26,6 +26,10 @@ struct loongson_board_info { · 25 unmodified lines
2626
2727 #define NR_WORDS DIV_ROUND_UP(NR_CPUS, BITS_PER_LONG)
2828
29+/*
30+ * The "core" of cores_per_node and cores_per_package stands for a
31+ * logical core, which means in a SMT system it stands for a thread.
32+ */
2933 struct loongson_system_configuration {
3034 int nr_cpus;
3135 int nr_nodes;
arch/loongarch/include/asm/kasan.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616 #define XRANGE_SHIFT (48)
1717
1818 /* Valid address length */
19−#define XRANGE_SHADOW_SHIFT (PGDIR_SHIFT + PAGE_SHIFT - 3)
19+#define XRANGE_SHADOW_SHIFT min(cpu_vabits, VA_BITS)
2020 /* Used for taking out the valid address */
2121 #define XRANGE_SHADOW_MASK GENMASK_ULL(XRANGE_SHADOW_SHIFT - 1, 0)
2222 /* One segment whole address space size */
arch/loongarch/include/asm/loongarch.h+1−1
@@ -250,7 +250,7 @@ · 249 unmodified lines
250250 #define CSR_ESTAT_IS_WIDTH 15
251251 #define CSR_ESTAT_IS (_ULCAST_(0x7fff) << CSR_ESTAT_IS_SHIFT)
252252
253−#define LOONGARCH_CSR_ERA 0x6 /* ERA */
253+#define LOONGARCH_CSR_ERA 0x6 /* Exception return address */
254254
255255 #define LOONGARCH_CSR_BADV 0x7 /* Bad virtual address */
256256
arch/loongarch/include/asm/pgalloc.h+11−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010
1111 #define __HAVE_ARCH_PMD_ALLOC_ONE
1212 #define __HAVE_ARCH_PUD_ALLOC_ONE
13+#define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
1314 #include <asm-generic/pgalloc.h>
1415
1516 static inline void pmd_populate_kernel(struct mm_struct *mm,
@@ -44,6 +45,16 @@ extern void pagetable_init(void); · 28 unmodified lines
4445
4546 extern pgd_t *pgd_alloc(struct mm_struct *mm);
4647
48+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
49+{
50+ pte_t *pte = __pte_alloc_one_kernel(mm);
51+
52+ if (pte)
53+ kernel_pte_init(pte);
54+
55+ return pte;
56+}
57+
4758 #define __pte_free_tlb(tlb, pte, address) \
4859 do { \
4960 pagetable_pte_dtor(page_ptdesc(pte)); \
arch/loongarch/include/asm/pgtable.h+7−28
@@ -269,6 +269,7 @@ extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp, pm · 268 unmodified lines
269269 extern void pgd_init(void *addr);
270270 extern void pud_init(void *addr);
271271 extern void pmd_init(void *addr);
272+extern void kernel_pte_init(void *addr);
272273
273274 /*
274275 * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that
@@ -325,39 +326,17 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) · 50 unmodified lines
325326 {
326327 WRITE_ONCE(*ptep, pteval);
327328
328− if (pte_val(pteval) & _PAGE_GLOBAL) {
329− pte_t *buddy = ptep_buddy(ptep);
330− /*
331− * Make sure the buddy is global too (if it's !none,
332− * it better already be global)
333− */
334− if (pte_none(ptep_get(buddy))) {
335329 #ifdef CONFIG_SMP
336− /*
337− * For SMP, multiple CPUs can race, so we need
338− * to do this atomically.
339− */
340− __asm__ __volatile__(
341− __AMOR "$zero, %[global], %[buddy] \n"
342− : [buddy] "+ZB" (buddy->pte)
343− : [global] "r" (_PAGE_GLOBAL)
344− : "memory");
345−
346− DBAR(0b11000); /* o_wrw = 0b11000 */
347−#else /* !CONFIG_SMP */
348− WRITE_ONCE(*buddy, __pte(pte_val(ptep_get(buddy)) | _PAGE_GLOBAL));
349−#endif /* CONFIG_SMP */
350− }
351− }
330+ if (pte_val(pteval) & _PAGE_GLOBAL)
331+ DBAR(0b11000); /* o_wrw = 0b11000 */
332+#endif
352333 }
353334
354335 static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
355336 {
356− /* Preserve global status for the pair */
357− if (pte_val(ptep_get(ptep_buddy(ptep))) & _PAGE_GLOBAL)
358− set_pte(ptep, __pte(_PAGE_GLOBAL));
359− else
360− set_pte(ptep, __pte(0));
337+ pte_t pte = ptep_get(ptep);
338+ pte_val(pte) &= _PAGE_GLOBAL;
339+ set_pte(ptep, pte);
361340 }
362341
363342 #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
arch/loongarch/kernel/process.c+9−7
@@ -293,13 +293,15 @@ unsigned long stack_top(void) · 292 unmodified lines
293293 {
294294 unsigned long top = TASK_SIZE & PAGE_MASK;
295295
296− /* Space for the VDSO & data page */
297− top -= PAGE_ALIGN(current->thread.vdso->size);
298− top -= VVAR_SIZE;
299−
300− /* Space to randomize the VDSO base */
301− if (current->flags & PF_RANDOMIZE)
302− top -= VDSO_RANDOMIZE_SIZE;
296+ if (current->thread.vdso) {
297+ /* Space for the VDSO & data page */
298+ top -= PAGE_ALIGN(current->thread.vdso->size);
299+ top -= VVAR_SIZE;
300+
301+ /* Space to randomize the VDSO base */
302+ if (current->flags & PF_RANDOMIZE)
303+ top -= VDSO_RANDOMIZE_SIZE;
304+ }
303305
304306 return top;
305307 }
arch/loongarch/kernel/setup.c+2−1
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 #define SMBIOS_FREQHIGH_OFFSET 0x17
5656 #define SMBIOS_FREQLOW_MASK 0xFF
5757 #define SMBIOS_CORE_PACKAGE_OFFSET 0x23
58+#define SMBIOS_THREAD_PACKAGE_OFFSET 0x25
5859 #define LOONGSON_EFI_ENABLE (1 << 3)
5960
6061 unsigned long fw_arg0, fw_arg1, fw_arg2;
@@ -125,7 +126,7 @@ static void __init parse_cpu_table(const struct dmi_header *dm) · 64 unmodified lines
125126 cpu_clock_freq = freq_temp * 1000000;
126127
127128 loongson_sysconf.cpuname = (void *)dmi_string_parse(dm, dmi_data[16]);
128− loongson_sysconf.cores_per_package = *(dmi_data + SMBIOS_CORE_PACKAGE_OFFSET);
129+ loongson_sysconf.cores_per_package = *(dmi_data + SMBIOS_THREAD_PACKAGE_OFFSET);
129130
130131 pr_info("CpuClock = %llu\n", cpu_clock_freq);
131132 }
arch/loongarch/kernel/traps.c+5−0
@@ -555,6 +555,9 @@ asmlinkage void noinstr do_ale(struct pt_regs *regs) · 554 unmodified lines
555555 #else
556556 unsigned int *pc;
557557
558+ if (regs->csr_prmd & CSR_PRMD_PIE)
559+ local_irq_enable();
560+
558561 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, regs->csr_badvaddr);
559562
560563 /*
@@ -579,6 +582,8 @@ sigbus: · 18 unmodified lines
579582 die_if_kernel("Kernel ale access", regs);
580583 force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)regs->csr_badvaddr);
581584 out:
585+ if (regs->csr_prmd & CSR_PRMD_PIE)
586+ local_irq_disable();
582587 #endif
583588 irqentry_exit(regs, state);
584589 }
arch/loongarch/kernel/vdso.c+4−4
@@ -34,7 +34,6 @@ static union { · 33 unmodified lines
3434 struct loongarch_vdso_data vdata;
3535 } loongarch_vdso_data __page_aligned_data;
3636
37−static struct page *vdso_pages[] = { NULL };
3837 struct vdso_data *vdso_data = generic_vdso_data.data;
3938 struct vdso_pcpu_data *vdso_pdata = loongarch_vdso_data.vdata.pdata;
4039 struct vdso_rng_data *vdso_rng_data = &loongarch_vdso_data.vdata.rng_data;
@@ -85,10 +84,8 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm, · 44 unmodified lines
8584
8685 struct loongarch_vdso_info vdso_info = {
8786 .vdso = vdso_start,
88− .size = PAGE_SIZE,
8987 .code_mapping = {
9088 .name = "[vdso]",
91− .pages = vdso_pages,
9289 .mremap = vdso_mremap,
9390 },
9491 .data_mapping = {
@@ -103,11 +100,14 @@ static int __init init_vdso(void) · 8 unmodified lines
103100 unsigned long i, cpu, pfn;
104101
105102 BUG_ON(!PAGE_ALIGNED(vdso_info.vdso));
106− BUG_ON(!PAGE_ALIGNED(vdso_info.size));
107103
108104 for_each_possible_cpu(cpu)
109105 vdso_pdata[cpu].node = cpu_to_node(cpu);
110106
107+ vdso_info.size = PAGE_ALIGN(vdso_end - vdso_start);
108+ vdso_info.code_mapping.pages =
109+ kcalloc(vdso_info.size / PAGE_SIZE, sizeof(struct page *), GFP_KERNEL);
110+
111111 pfn = __phys_to_pfn(__pa_symbol(vdso_info.vdso));
112112 for (i = 0; i < vdso_info.size / PAGE_SIZE; i++)
113113 vdso_info.code_mapping.pages[i] = pfn_to_page(pfn + i);
arch/loongarch/kvm/timer.c+4−3
@@ -161,10 +161,11 @@ static void _kvm_save_timer(struct kvm_vcpu *vcpu) · 160 unmodified lines
161161 if (kvm_vcpu_is_blocking(vcpu)) {
162162
163163 /*
164− * HRTIMER_MODE_PINNED is suggested since vcpu may run in
165− * the same physical cpu in next time
164+ * HRTIMER_MODE_PINNED_HARD is suggested since vcpu may run in
165+ * the same physical cpu in next time, and the timer should run
166+ * in hardirq context even in the PREEMPT_RT case.
166167 */
167− hrtimer_start(&vcpu->arch.swtimer, expire, HRTIMER_MODE_ABS_PINNED);
168+ hrtimer_start(&vcpu->arch.swtimer, expire, HRTIMER_MODE_ABS_PINNED_HARD);
168169 }
169170 }
170171
arch/loongarch/kvm/vcpu.c+1−1
@@ -1457,7 +1457,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 1456 unmodified lines
14571457 vcpu->arch.vpid = 0;
14581458 vcpu->arch.flush_gpa = INVALID_GPA;
14591459
1460− hrtimer_init(&vcpu->arch.swtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED);
1460+ hrtimer_init(&vcpu->arch.swtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
14611461 vcpu->arch.swtimer.function = kvm_swtimer_wakeup;
14621462
14631463 vcpu->arch.handle_exit = kvm_handle_exit;
arch/loongarch/mm/init.c+2−0
@@ -201,7 +201,9 @@ pte_t * __init populate_kernel_pte(unsigned long addr) · 200 unmodified lines
201201 pte = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
202202 if (!pte)
203203 panic("%s: Failed to allocate memory\n", __func__);
204+
204205 pmd_populate_kernel(&init_mm, pmd, pte);
206+ kernel_pte_init(pte);
205207 }
206208
207209 return pte_offset_kernel(pmd, addr);
arch/loongarch/mm/pgtable.c+20−0
@@ -116,6 +116,26 @@ void pud_init(void *addr) · 115 unmodified lines
116116 EXPORT_SYMBOL_GPL(pud_init);
117117 #endif
118118
119+void kernel_pte_init(void *addr)
120+{
121+ unsigned long *p, *end;
122+
123+ p = (unsigned long *)addr;
124+ end = p + PTRS_PER_PTE;
125+
126+ do {
127+ p[0] = _PAGE_GLOBAL;
128+ p[1] = _PAGE_GLOBAL;
129+ p[2] = _PAGE_GLOBAL;
130+ p[3] = _PAGE_GLOBAL;
131+ p[4] = _PAGE_GLOBAL;
132+ p += 8;
133+ p[-3] = _PAGE_GLOBAL;
134+ p[-2] = _PAGE_GLOBAL;
135+ p[-1] = _PAGE_GLOBAL;
136+ } while (p != end);
137+}
138+
119139 pmd_t mk_pmd(struct page *page, pgprot_t prot)
120140 {
121141 pmd_t pmd;
arch/mips/kernel/cmpxchg.c+1−0
@@ -102,3 +102,4 @@ unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old, · 101 unmodified lines
102102 return old;
103103 }
104104 }
105+EXPORT_SYMBOL(__cmpxchg_small);
arch/powerpc/kernel/head_8xx.S+1−0
@@ -494,6 +494,7 @@ FixupDAR:/* Entry point for dcbx workaround. */ · 493 unmodified lines
494494 bctr /* jump into table */
495495 152:
496496 mfdar r11
497+ mtdar r10
497498 mtctr r11 /* restore ctr reg from DAR */
498499 mfspr r11, SPRN_SPRG_THREAD
499500 stw r10, DAR(r11)
arch/powerpc/platforms/powernv/opal-irqchip.c+1−0
@@ -282,6 +282,7 @@ int __init opal_event_init(void) · 281 unmodified lines
282282 name, NULL);
283283 if (rc) {
284284 pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start);
285+ kfree(name);
285286 continue;
286287 }
287288 }
arch/riscv/Kconfig+1−1
@@ -177,7 +177,7 @@ config RISCV · 176 unmodified lines
177177 select HAVE_REGS_AND_STACK_ACCESS_API
178178 select HAVE_RETHOOK if !XIP_KERNEL
179179 select HAVE_RSEQ
180− select HAVE_RUST if RUSTC_SUPPORTS_RISCV
180+ select HAVE_RUST if RUSTC_SUPPORTS_RISCV && CC_IS_CLANG
181181 select HAVE_SAMPLE_FTRACE_DIRECT
182182 select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
183183 select HAVE_STACKPROTECTOR
arch/riscv/errata/Makefile+6−0
@@ -2,6 +2,12 @@ ifdef CONFIG_RELOCATABLE · 1 unmodified line
22 KBUILD_CFLAGS += -fno-pie
33 endif
44
5+ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
6+ifdef CONFIG_FORTIFY_SOURCE
7+KBUILD_CFLAGS += -D__NO_FORTIFY
8+endif
9+endif
10+
511 obj-$(CONFIG_ERRATA_ANDES) += andes/
612 obj-$(CONFIG_ERRATA_SIFIVE) += sifive/
713 obj-$(CONFIG_ERRATA_THEAD) += thead/
arch/riscv/kernel/Makefile+5−0
@@ -36,6 +36,11 @@ KASAN_SANITIZE_alternative.o := n · 35 unmodified lines
3636 KASAN_SANITIZE_cpufeature.o := n
3737 KASAN_SANITIZE_sbi_ecall.o := n
3838 endif
39+ifdef CONFIG_FORTIFY_SOURCE
40+CFLAGS_alternative.o += -D__NO_FORTIFY
41+CFLAGS_cpufeature.o += -D__NO_FORTIFY
42+CFLAGS_sbi_ecall.o += -D__NO_FORTIFY
43+endif
3944 endif
4045
4146 extra-y += vmlinux.lds
arch/riscv/kernel/acpi.c+2−2
@@ -210,7 +210,7 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size) · 209 unmodified lines
210210 if (!size)
211211 return NULL;
212212
213− return early_ioremap(phys, size);
213+ return early_memremap(phys, size);
214214 }
215215
216216 void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
@@ -218,7 +218,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size) · 1 unmodified line
218218 if (!map || !size)
219219 return;
220220
221− early_iounmap(map, size);
221+ early_memunmap(map, size);
222222 }
223223
224224 void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
arch/riscv/kernel/asm-offsets.c+0−2
@@ -4,8 +4,6 @@ · 3 unmodified lines
44 * Copyright (C) 2017 SiFive
55 */
66
7−#define GENERATING_ASM_OFFSETS
8−
97 #include <linux/kbuild.h>
108 #include <linux/mm.h>
119 #include <linux/sched.h>
arch/riscv/kernel/cacheinfo.c+5−2
@@ -80,8 +80,7 @@ int populate_cache_leaves(unsigned int cpu) · 79 unmodified lines
8080 {
8181 struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
8282 struct cacheinfo *this_leaf = this_cpu_ci->info_list;
83− struct device_node *np = of_cpu_device_node_get(cpu);
84− struct device_node *prev = NULL;
83+ struct device_node *np, *prev;
8584 int levels = 1, level = 1;
8685
8786 if (!acpi_disabled) {
@@ -105,6 +104,10 @@ int populate_cache_leaves(unsigned int cpu) · 17 unmodified lines
105104 return 0;
106105 }
107106
107+ np = of_cpu_device_node_get(cpu);
108+ if (!np)
109+ return -ENOENT;
110+
108111 if (of_property_read_bool(np, "cache-size"))
109112 ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
110113 if (of_property_read_bool(np, "i-cache-size"))
arch/riscv/kernel/cpu-hotplug.c+1−1
@@ -58,7 +58,7 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu) · 57 unmodified lines
5858 if (cpu_ops->cpu_is_stopped)
5959 ret = cpu_ops->cpu_is_stopped(cpu);
6060 if (ret)
61− pr_warn("CPU%d may not have stopped: %d\n", cpu, ret);
61+ pr_warn("CPU%u may not have stopped: %d\n", cpu, ret);
6262 }
6363
6464 /*
arch/riscv/kernel/efi-header.S+1−1
@@ -64,7 +64,7 @@ extra_header_fields: · 63 unmodified lines
6464 .long efi_header_end - _start // SizeOfHeaders
6565 .long 0 // CheckSum
6666 .short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem
67− .short 0 // DllCharacteristics
67+ .short IMAGE_DLL_CHARACTERISTICS_NX_COMPAT // DllCharacteristics
6868 .quad 0 // SizeOfStackReserve
6969 .quad 0 // SizeOfStackCommit
7070 .quad 0 // SizeOfHeapReserve
arch/riscv/kernel/pi/Makefile+5−1
@@ -16,8 +16,12 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS)) · 15 unmodified lines
1616 KBUILD_CFLAGS += -mcmodel=medany
1717
1818 CFLAGS_cmdline_early.o += -D__NO_FORTIFY
19−CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
2019 CFLAGS_fdt_early.o += -D__NO_FORTIFY
20+# lib/string.c already defines __NO_FORTIFY
21+CFLAGS_ctype.o += -D__NO_FORTIFY
22+CFLAGS_lib-fdt.o += -D__NO_FORTIFY
23+CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
24+CFLAGS_archrandom_early.o += -D__NO_FORTIFY
2125
2226 $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
2327 --remove-section=.note.gnu.property \
arch/riscv/kernel/traps_misaligned.c+0−2
@@ -136,8 +136,6 @@ · 135 unmodified lines
136136 #define REG_PTR(insn, pos, regs) \
137137 (ulong *)((ulong)(regs) + REG_OFFSET(insn, pos))
138138
139−#define GET_RM(insn) (((insn) >> 12) & 7)
140−
141139 #define GET_RS1(insn, regs) (*REG_PTR(insn, SH_RS1, regs))
142140 #define GET_RS2(insn, regs) (*REG_PTR(insn, SH_RS2, regs))
143141 #define GET_RS1S(insn, regs) (*REG_PTR(RVC_RS1S(insn), 0, regs))
arch/riscv/kernel/vdso/Makefile+1−0
@@ -18,6 +18,7 @@ obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o · 17 unmodified lines
1818
1919 ccflags-y := -fno-stack-protector
2020 ccflags-y += -DDISABLE_BRANCH_PROFILING
21+ccflags-y += -fno-builtin
2122
2223 ifneq ($(c-gettimeofday-y),)
2324 CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
arch/riscv/kvm/aia_imsic.c+4−4
@@ -55,7 +55,7 @@ struct imsic { · 54 unmodified lines
5555 /* IMSIC SW-file */
5656 struct imsic_mrif *swfile;
5757 phys_addr_t swfile_pa;
58− spinlock_t swfile_extirq_lock;
58+ raw_spinlock_t swfile_extirq_lock;
5959 };
6060
6161 #define imsic_vs_csr_read(__c) \
@@ -622,7 +622,7 @@ static void imsic_swfile_extirq_update(struct kvm_vcpu *vcpu) · 560 unmodified lines
622622 * interruptions between reading topei and updating pending status.
623623 */
624624
625− spin_lock_irqsave(&imsic->swfile_extirq_lock, flags);
625+ raw_spin_lock_irqsave(&imsic->swfile_extirq_lock, flags);
626626
627627 if (imsic_mrif_atomic_read(mrif, &mrif->eidelivery) &&
628628 imsic_mrif_topei(mrif, imsic->nr_eix, imsic->nr_msis))
@@ -630,7 +630,7 @@ static void imsic_swfile_extirq_update(struct kvm_vcpu *vcpu) · 1 unmodified line
630630 else
631631 kvm_riscv_vcpu_unset_interrupt(vcpu, IRQ_VS_EXT);
632632
633− spin_unlock_irqrestore(&imsic->swfile_extirq_lock, flags);
633+ raw_spin_unlock_irqrestore(&imsic->swfile_extirq_lock, flags);
634634 }
635635
636636 static void imsic_swfile_read(struct kvm_vcpu *vcpu, bool clear,
@@ -1051,7 +1051,7 @@ int kvm_riscv_vcpu_aia_imsic_init(struct kvm_vcpu *vcpu) · 414 unmodified lines
10511051 }
10521052 imsic->swfile = page_to_virt(swfile_page);
10531053 imsic->swfile_pa = page_to_phys(swfile_page);
1054− spin_lock_init(&imsic->swfile_extirq_lock);
1054+ raw_spin_lock_init(&imsic->swfile_extirq_lock);
10551055
10561056 /* Setup IO device */
10571057 kvm_iodevice_init(&imsic->iodev, &imsic_iodoev_ops);
arch/riscv/net/bpf_jit_comp64.c+5−3
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #define RV_MAX_REG_ARGS 8
1919 #define RV_FENTRY_NINSNS 2
2020 #define RV_FENTRY_NBYTES (RV_FENTRY_NINSNS * 4)
21+#define RV_KCFI_NINSNS (IS_ENABLED(CONFIG_CFI_CLANG) ? 1 : 0)
2122 /* imm that allows emit_imm to emit max count insns */
2223 #define RV_MAX_COUNT_IMM 0x7FFF7FF7FF7FF7FF
2324
@@ -271,7 +272,8 @@ static void __build_epilogue(bool is_tail_call, struct rv_jit_context *ctx) · 247 unmodified lines
271272 if (!is_tail_call)
272273 emit_addiw(RV_REG_A0, RV_REG_A5, 0, ctx);
273274 emit_jalr(RV_REG_ZERO, is_tail_call ? RV_REG_T3 : RV_REG_RA,
274− is_tail_call ? (RV_FENTRY_NINSNS + 1) * 4 : 0, /* skip reserved nops and TCC init */
275+ /* kcfi, fentry and TCC init insns will be skipped on tailcall */
276+ is_tail_call ? (RV_KCFI_NINSNS + RV_FENTRY_NINSNS + 1) * 4 : 0,
275277 ctx);
276278 }
277279
@@ -548,8 +550,8 @@ static void emit_atomic(u8 rd, u8 rs, s16 off, s32 imm, bool is64, · 270 unmodified lines
548550 rv_lr_w(r0, 0, rd, 0, 0), ctx);
549551 jmp_offset = ninsns_rvoff(8);
550552 emit(rv_bne(RV_REG_T2, r0, jmp_offset >> 1), ctx);
551− emit(is64 ? rv_sc_d(RV_REG_T3, rs, rd, 0, 0) :
552− rv_sc_w(RV_REG_T3, rs, rd, 0, 0), ctx);
553+ emit(is64 ? rv_sc_d(RV_REG_T3, rs, rd, 0, 1) :
554+ rv_sc_w(RV_REG_T3, rs, rd, 0, 1), ctx);
553555 jmp_offset = ninsns_rvoff(-6);
554556 emit(rv_bne(RV_REG_T3, 0, jmp_offset >> 1), ctx);
555557 emit(rv_fence(0x3, 0x3), ctx);
arch/s390/configs/debug_defconfig+11−2
@@ -50,7 +50,6 @@ CONFIG_NUMA=y · 49 unmodified lines
5050 CONFIG_HZ_100=y
5151 CONFIG_CERT_STORE=y
5252 CONFIG_EXPOLINE=y
53−# CONFIG_EXPOLINE_EXTERN is not set
5453 CONFIG_EXPOLINE_AUTO=y
5554 CONFIG_CHSC_SCH=y
5655 CONFIG_VFIO_CCW=m
@@ -95,6 +94,7 @@ CONFIG_BINFMT_MISC=m · 38 unmodified lines
9594 CONFIG_ZSWAP=y
9695 CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y
9796 CONFIG_ZSMALLOC_STAT=y
97+CONFIG_SLAB_BUCKETS=y
9898 CONFIG_SLUB_STATS=y
9999 # CONFIG_COMPAT_BRK is not set
100100 CONFIG_MEMORY_HOTPLUG=y
@@ -426,6 +426,13 @@ CONFIG_DEVTMPFS_SAFE=y · 325 unmodified lines
426426 # CONFIG_FW_LOADER is not set
427427 CONFIG_CONNECTOR=y
428428 CONFIG_ZRAM=y
429+CONFIG_ZRAM_BACKEND_LZ4=y
430+CONFIG_ZRAM_BACKEND_LZ4HC=y
431+CONFIG_ZRAM_BACKEND_ZSTD=y
432+CONFIG_ZRAM_BACKEND_DEFLATE=y
433+CONFIG_ZRAM_BACKEND_842=y
434+CONFIG_ZRAM_BACKEND_LZO=y
435+CONFIG_ZRAM_DEF_COMP_DEFLATE=y
429436 CONFIG_BLK_DEV_LOOP=m
430437 CONFIG_BLK_DEV_DRBD=m
431438 CONFIG_BLK_DEV_NBD=m
@@ -486,6 +493,7 @@ CONFIG_DM_UEVENT=y · 54 unmodified lines
486493 CONFIG_DM_FLAKEY=m
487494 CONFIG_DM_VERITY=m
488495 CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
496+CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=y
489497 CONFIG_DM_SWITCH=m
490498 CONFIG_DM_INTEGRITY=m
491499 CONFIG_DM_VDO=m
@@ -535,6 +543,7 @@ CONFIG_NLMON=m · 43 unmodified lines
535543 CONFIG_MLX4_EN=m
536544 CONFIG_MLX5_CORE=m
537545 CONFIG_MLX5_CORE_EN=y
546+# CONFIG_NET_VENDOR_META is not set
538547 # CONFIG_NET_VENDOR_MICREL is not set
539548 # CONFIG_NET_VENDOR_MICROCHIP is not set
540549 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -695,6 +704,7 @@ CONFIG_NFSD=m · 154 unmodified lines
695704 CONFIG_NFSD_V3_ACL=y
696705 CONFIG_NFSD_V4=y
697706 CONFIG_NFSD_V4_SECURITY_LABEL=y
707+# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
698708 CONFIG_CIFS=m
699709 CONFIG_CIFS_UPCALL=y
700710 CONFIG_CIFS_XATTR=y
@@ -740,7 +750,6 @@ CONFIG_CRYPTO_DH=m · 39 unmodified lines
740750 CONFIG_CRYPTO_ECDH=m
741751 CONFIG_CRYPTO_ECDSA=m
742752 CONFIG_CRYPTO_ECRDSA=m
743−CONFIG_CRYPTO_SM2=m
744753 CONFIG_CRYPTO_CURVE25519=m
745754 CONFIG_CRYPTO_AES_TI=m
746755 CONFIG_CRYPTO_ANUBIS=m
arch/s390/configs/defconfig+12−2
@@ -48,7 +48,6 @@ CONFIG_NUMA=y · 47 unmodified lines
4848 CONFIG_HZ_100=y
4949 CONFIG_CERT_STORE=y
5050 CONFIG_EXPOLINE=y
51−# CONFIG_EXPOLINE_EXTERN is not set
5251 CONFIG_EXPOLINE_AUTO=y
5352 CONFIG_CHSC_SCH=y
5453 CONFIG_VFIO_CCW=m
@@ -89,6 +88,7 @@ CONFIG_BINFMT_MISC=m · 34 unmodified lines
8988 CONFIG_ZSWAP=y
9089 CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y
9190 CONFIG_ZSMALLOC_STAT=y
91+CONFIG_SLAB_BUCKETS=y
9292 # CONFIG_COMPAT_BRK is not set
9393 CONFIG_MEMORY_HOTPLUG=y
9494 CONFIG_MEMORY_HOTREMOVE=y
@@ -416,6 +416,13 @@ CONFIG_DEVTMPFS_SAFE=y · 321 unmodified lines
416416 # CONFIG_FW_LOADER is not set
417417 CONFIG_CONNECTOR=y
418418 CONFIG_ZRAM=y
419+CONFIG_ZRAM_BACKEND_LZ4=y
420+CONFIG_ZRAM_BACKEND_LZ4HC=y
421+CONFIG_ZRAM_BACKEND_ZSTD=y
422+CONFIG_ZRAM_BACKEND_DEFLATE=y
423+CONFIG_ZRAM_BACKEND_842=y
424+CONFIG_ZRAM_BACKEND_LZO=y
425+CONFIG_ZRAM_DEF_COMP_DEFLATE=y
419426 CONFIG_BLK_DEV_LOOP=m
420427 CONFIG_BLK_DEV_DRBD=m
421428 CONFIG_BLK_DEV_NBD=m
@@ -476,6 +483,7 @@ CONFIG_DM_UEVENT=y · 54 unmodified lines
476483 CONFIG_DM_FLAKEY=m
477484 CONFIG_DM_VERITY=m
478485 CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
486+CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=y
479487 CONFIG_DM_SWITCH=m
480488 CONFIG_DM_INTEGRITY=m
481489 CONFIG_DM_VDO=m
@@ -525,6 +533,7 @@ CONFIG_NLMON=m · 43 unmodified lines
525533 CONFIG_MLX4_EN=m
526534 CONFIG_MLX5_CORE=m
527535 CONFIG_MLX5_CORE_EN=y
536+# CONFIG_NET_VENDOR_META is not set
528537 # CONFIG_NET_VENDOR_MICREL is not set
529538 # CONFIG_NET_VENDOR_MICROCHIP is not set
530539 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -682,6 +691,7 @@ CONFIG_NFSD=m · 151 unmodified lines
682691 CONFIG_NFSD_V3_ACL=y
683692 CONFIG_NFSD_V4=y
684693 CONFIG_NFSD_V4_SECURITY_LABEL=y
694+# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
685695 CONFIG_CIFS=m
686696 CONFIG_CIFS_UPCALL=y
687697 CONFIG_CIFS_XATTR=y
@@ -726,7 +736,6 @@ CONFIG_CRYPTO_DH=m · 38 unmodified lines
726736 CONFIG_CRYPTO_ECDH=m
727737 CONFIG_CRYPTO_ECDSA=m
728738 CONFIG_CRYPTO_ECRDSA=m
729−CONFIG_CRYPTO_SM2=m
730739 CONFIG_CRYPTO_CURVE25519=m
731740 CONFIG_CRYPTO_AES_TI=m
732741 CONFIG_CRYPTO_ANUBIS=m
@@ -767,6 +776,7 @@ CONFIG_CRYPTO_LZ4=m · 34 unmodified lines
767776 CONFIG_CRYPTO_LZ4HC=m
768777 CONFIG_CRYPTO_ZSTD=m
769778 CONFIG_CRYPTO_ANSI_CPRNG=m
779+CONFIG_CRYPTO_JITTERENTROPY_OSR=1
770780 CONFIG_CRYPTO_USER_API_HASH=m
771781 CONFIG_CRYPTO_USER_API_SKCIPHER=m
772782 CONFIG_CRYPTO_USER_API_RNG=m
arch/s390/configs/zfcpdump_defconfig+1−0
@@ -49,6 +49,7 @@ CONFIG_ZFCP=y · 48 unmodified lines
4949 # CONFIG_HVC_IUCV is not set
5050 # CONFIG_HW_RANDOM_S390 is not set
5151 # CONFIG_HMC_DRV is not set
52+# CONFIG_S390_UV_UAPI is not set
5253 # CONFIG_S390_TAPE is not set
5354 # CONFIG_VMCP is not set
5455 # CONFIG_MONWRITER is not set
arch/s390/include/asm/io.h+2−0
@@ -16,8 +16,10 @@ · 15 unmodified lines
1616 #include <asm/pci_io.h>
1717
1818 #define xlate_dev_mem_ptr xlate_dev_mem_ptr
19+#define kc_xlate_dev_mem_ptr xlate_dev_mem_ptr
1920 void *xlate_dev_mem_ptr(phys_addr_t phys);
2021 #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
22+#define kc_unxlate_dev_mem_ptr unxlate_dev_mem_ptr
2123 void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
2224
2325 #define IO_SPACE_LIMIT 0
arch/s390/include/asm/perf_event.h+1−0
@@ -49,6 +49,7 @@ struct perf_sf_sde_regs { · 48 unmodified lines
4949 };
5050
5151 #define perf_arch_fetch_caller_regs(regs, __ip) do { \
52+ (regs)->psw.mask = 0; \
5253 (regs)->psw.addr = (__ip); \
5354 (regs)->gprs[15] = (unsigned long)__builtin_frame_address(0) - \
5455 offsetof(struct stack_frame, back_chain); \
arch/s390/kvm/diag.c+1−1
@@ -77,7 +77,7 @@ static int __diag_page_ref_service(struct kvm_vcpu *vcpu) · 76 unmodified lines
7777 vcpu->stat.instruction_diagnose_258++;
7878 if (vcpu->run->s.regs.gprs[rx] & 7)
7979 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
80− rc = read_guest(vcpu, vcpu->run->s.regs.gprs[rx], rx, &parm, sizeof(parm));
80+ rc = read_guest_real(vcpu, vcpu->run->s.regs.gprs[rx], &parm, sizeof(parm));
8181 if (rc)
8282 return kvm_s390_inject_prog_cond(vcpu, rc);
8383 if (parm.parm_version != 2 || parm.parm_len < 5 || parm.code != 0x258)
arch/s390/kvm/gaccess.c+4−0
@@ -828,6 +828,8 @@ static int access_guest_page(struct kvm *kvm, enum gacc_mode mode, gpa_t gpa, · 827 unmodified lines
828828 const gfn_t gfn = gpa_to_gfn(gpa);
829829 int rc;
830830
831+ if (!gfn_to_memslot(kvm, gfn))
832+ return PGM_ADDRESSING;
831833 if (mode == GACC_STORE)
832834 rc = kvm_write_guest_page(kvm, gfn, data, offset, len);
833835 else
@@ -985,6 +987,8 @@ int access_guest_real(struct kvm_vcpu *vcpu, unsigned long gra, · 151 unmodified lines
985987 gra += fragment_len;
986988 data += fragment_len;
987989 }
990+ if (rc > 0)
991+ vcpu->arch.pgm.code = rc;
988992 return rc;
989993 }
990994
arch/s390/kvm/gaccess.h+8−6
@@ -405,11 +405,12 @@ int read_guest_abs(struct kvm_vcpu *vcpu, unsigned long gpa, void *data, · 404 unmodified lines
405405 * @len: number of bytes to copy
406406 *
407407 * Copy @len bytes from @data (kernel space) to @gra (guest real address).
408− * It is up to the caller to ensure that the entire guest memory range is
409− * valid memory before calling this function.
410408 * Guest low address and key protection are not checked.
411409 *
412− * Returns zero on success or -EFAULT on error.
410+ * Returns zero on success, -EFAULT when copying from @data failed, or
411+ * PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info
412+ * is also stored to allow injecting into the guest (if applicable) using
413+ * kvm_s390_inject_prog_cond().
413414 *
414415 * If an error occurs data may have been copied partially to guest memory.
415416 */
@@ -428,11 +429,12 @@ int write_guest_real(struct kvm_vcpu *vcpu, unsigned long gra, void *data, · 12 unmodified lines
428429 * @len: number of bytes to copy
429430 *
430431 * Copy @len bytes from @gra (guest real address) to @data (kernel space).
431− * It is up to the caller to ensure that the entire guest memory range is
432− * valid memory before calling this function.
433432 * Guest key protection is not checked.
434433 *
435− * Returns zero on success or -EFAULT on error.
434+ * Returns zero on success, -EFAULT when copying to @data failed, or
435+ * PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info
436+ * is also stored to allow injecting into the guest (if applicable) using
437+ * kvm_s390_inject_prog_cond().
436438 *
437439 * If an error occurs data may have been copied partially to kernel space.
438440 */
arch/s390/pci/pci_event.c+9−8
@@ -280,18 +280,19 @@ static void __zpci_event_error(struct zpci_ccdf_err *ccdf) · 279 unmodified lines
280280 goto no_pdev;
281281
282282 switch (ccdf->pec) {
283− case 0x003a: /* Service Action or Error Recovery Successful */
283+ case 0x002a: /* Error event concerns FMB */
284+ case 0x002b:
285+ case 0x002c:
286+ break;
287+ case 0x0040: /* Service Action or Error Recovery Failed */
288+ case 0x003b:
289+ zpci_event_io_failure(pdev, pci_channel_io_perm_failure);
290+ break;
291+ default: /* PCI function left in the error state attempt to recover */
284292 ers_res = zpci_event_attempt_error_recovery(pdev);
285293 if (ers_res != PCI_ERS_RESULT_RECOVERED)
286294 zpci_event_io_failure(pdev, pci_channel_io_perm_failure);
287295 break;
288− default:
289− /*
290− * Mark as frozen not permanently failed because the device
291− * could be subsequently recovered by the platform.
292− */
293− zpci_event_io_failure(pdev, pci_channel_io_frozen);
294− break;
295296 }
296297 pci_dev_put(pdev);
297298 no_pdev:
arch/x86/Kconfig+1−0
@@ -2257,6 +2257,7 @@ config RANDOMIZE_MEMORY_PHYSICAL_PADDING · 2256 unmodified lines
22572257 config ADDRESS_MASKING
22582258 bool "Linear Address Masking support"
22592259 depends on X86_64
2260+ depends on COMPILE_TEST || !CPU_MITIGATIONS # wait for LASS
22602261 help
22612262 Linear Address Masking (LAM) modifies the checking that is applied
22622263 to 64-bit linear addresses, allowing software to use of the
arch/x86/entry/entry.S+5−0
@@ -9,6 +9,8 @@ · 8 unmodified lines
99 #include <asm/unwind_hints.h>
1010 #include <asm/segment.h>
1111 #include <asm/cache.h>
12+#include <asm/cpufeatures.h>
13+#include <asm/nospec-branch.h>
1214
1315 #include "calling.h"
1416
@@ -19,6 +21,9 @@ SYM_FUNC_START(entry_ibpb) · 4 unmodified lines
1921 movl $PRED_CMD_IBPB, %eax
2022 xorl %edx, %edx
2123 wrmsr
24+
25+ /* Make sure IBPB clears return stack preductions too. */
26+ FILL_RETURN_BUFFER %rax, RSB_CLEAR_LOOPS, X86_BUG_IBPB_NO_RET
2227 RET
2328 SYM_FUNC_END(entry_ibpb)
2429 /* For KVM */
arch/x86/entry/entry_32.S+4−2
@@ -871,6 +871,8 @@ SYM_FUNC_START(entry_SYSENTER_32) · 870 unmodified lines
871871
872872 /* Now ready to switch the cr3 */
873873 SWITCH_TO_USER_CR3 scratch_reg=%eax
874+ /* Clobbers ZF */
875+ CLEAR_CPU_BUFFERS
874876
875877 /*
876878 * Restore all flags except IF. (We restore IF separately because
@@ -881,7 +883,6 @@ SYM_FUNC_START(entry_SYSENTER_32) · 4 unmodified lines
881883 BUG_IF_WRONG_CR3 no_user_check=1
882884 popfl
883885 popl %eax
884− CLEAR_CPU_BUFFERS
885886
886887 /*
887888 * Return back to the vDSO, which will pop ecx and edx.
@@ -1144,7 +1145,6 @@ SYM_CODE_START(asm_exc_nmi) · 256 unmodified lines
11441145
11451146 /* Not on SYSENTER stack. */
11461147 call exc_nmi
1147− CLEAR_CPU_BUFFERS
11481148 jmp .Lnmi_return
11491149
11501150 .Lnmi_from_sysenter_stack:
@@ -1165,6 +1165,7 @@ SYM_CODE_START(asm_exc_nmi) · 14 unmodified lines
11651165
11661166 CHECK_AND_APPLY_ESPFIX
11671167 RESTORE_ALL_NMI cr3_reg=%edi pop=4
1168+ CLEAR_CPU_BUFFERS
11681169 jmp .Lirq_return
11691170
11701171 #ifdef CONFIG_X86_ESPFIX32
@@ -1206,6 +1207,7 @@ SYM_CODE_START(asm_exc_nmi) · 35 unmodified lines
12061207 * 1 - orig_ax
12071208 */
12081209 lss (1+5+6)*4(%esp), %esp # back to espfix stack
1210+ CLEAR_CPU_BUFFERS
12091211 jmp .Lirq_return
12101212 #endif
12111213 SYM_CODE_END(asm_exc_nmi)
arch/x86/include/asm/amd_nb.h+4−1
@@ -116,7 +116,10 @@ static inline bool amd_gart_present(void) · 115 unmodified lines
116116
117117 #define amd_nb_num(x) 0
118118 #define amd_nb_has_feature(x) false
119−#define node_to_amd_nb(x) NULL
119+static inline struct amd_northbridge *node_to_amd_nb(int node)
120+{
121+ return NULL;
122+}
120123 #define amd_gart_present(x) false
121124
122125 #endif
arch/x86/include/asm/cpufeatures.h+3−1
@@ -215,7 +215,7 @@ · 214 unmodified lines
215215 #define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE ( 7*32+23) /* Disable Speculative Store Bypass. */
216216 #define X86_FEATURE_LS_CFG_SSBD ( 7*32+24) /* AMD SSBD implementation via LS_CFG MSR */
217217 #define X86_FEATURE_IBRS ( 7*32+25) /* "ibrs" Indirect Branch Restricted Speculation */
218−#define X86_FEATURE_IBPB ( 7*32+26) /* "ibpb" Indirect Branch Prediction Barrier */
218+#define X86_FEATURE_IBPB ( 7*32+26) /* "ibpb" Indirect Branch Prediction Barrier without a guaranteed RSB flush */
219219 #define X86_FEATURE_STIBP ( 7*32+27) /* "stibp" Single Thread Indirect Branch Predictors */
220220 #define X86_FEATURE_ZEN ( 7*32+28) /* Generic flag for all Zen and newer */
221221 #define X86_FEATURE_L1TF_PTEINV ( 7*32+29) /* L1TF workaround PTE inversion */
@@ -348,6 +348,7 @@ · 126 unmodified lines
348348 #define X86_FEATURE_CPPC (13*32+27) /* "cppc" Collaborative Processor Performance Control */
349349 #define X86_FEATURE_AMD_PSFD (13*32+28) /* Predictive Store Forwarding Disable */
350350 #define X86_FEATURE_BTC_NO (13*32+29) /* Not vulnerable to Branch Type Confusion */
351+#define X86_FEATURE_AMD_IBPB_RET (13*32+30) /* IBPB clears return address predictor */
351352 #define X86_FEATURE_BRS (13*32+31) /* "brs" Branch Sampling available */
352353
353354 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
@@ -523,4 +524,5 @@ · 169 unmodified lines
523524 #define X86_BUG_DIV0 X86_BUG(1*32 + 1) /* "div0" AMD DIV0 speculation bug */
524525 #define X86_BUG_RFDS X86_BUG(1*32 + 2) /* "rfds" CPU is vulnerable to Register File Data Sampling */
525526 #define X86_BUG_BHI X86_BUG(1*32 + 3) /* "bhi" CPU is affected by Branch History Injection */
527+#define X86_BUG_IBPB_NO_RET X86_BUG(1*32 + 4) /* "ibpb_no_ret" IBPB omits return target predictions */
526528 #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/nospec-branch.h+10−1
@@ -323,7 +323,16 @@ · 322 unmodified lines
323323 * Note: Only the memory operand variant of VERW clears the CPU buffers.
324324 */
325325 .macro CLEAR_CPU_BUFFERS
326− ALTERNATIVE "", __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF
326+#ifdef CONFIG_X86_64
327+ ALTERNATIVE "", "verw mds_verw_sel(%rip)", X86_FEATURE_CLEAR_CPU_BUF
328+#else
329+ /*
330+ * In 32bit mode, the memory operand must be a %cs reference. The data
331+ * segments may not be usable (vm86 mode), and the stack segment may not
332+ * be flat (ESPFIX32).
333+ */
334+ ALTERNATIVE "", "verw %cs:mds_verw_sel", X86_FEATURE_CLEAR_CPU_BUF
335+#endif
327336 .endm
328337
329338 #ifdef CONFIG_X86_64
arch/x86/include/asm/runtime-const.h+2−2
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 typeof(sym) __ret; \
77 asm_inline("mov %1,%0\n1:\n" \
88 ".pushsection runtime_ptr_" #sym ",\"a\"\n\t" \
9− ".long 1b - %c2 - .\n\t" \
9+ ".long 1b - %c2 - .\n" \
1010 ".popsection" \
1111 :"=r" (__ret) \
1212 :"i" ((unsigned long)0x0123456789abcdefull), \
@@ -20,7 +20,7 @@ · 7 unmodified lines
2020 typeof(0u+(val)) __ret = (val); \
2121 asm_inline("shrl $12,%k0\n1:\n" \
2222 ".pushsection runtime_shift_" #sym ",\"a\"\n\t" \
23− ".long 1b - 1 - .\n\t" \
23+ ".long 1b - 1 - .\n" \
2424 ".popsection" \
2525 :"+r" (__ret)); \
2626 __ret; })
arch/x86/include/asm/uaccess_64.h+24−19
@@ -12,6 +12,13 @@ · 11 unmodified lines
1212 #include <asm/cpufeatures.h>
1313 #include <asm/page.h>
1414 #include <asm/percpu.h>
15+#include <asm/runtime-const.h>
16+
17+/*
18+ * Virtual variable: there's no actual backing store for this,
19+ * it can purely be used as 'runtime_const_ptr(USER_PTR_MAX)'
20+ */
21+extern unsigned long USER_PTR_MAX;
1522
1623 #ifdef CONFIG_ADDRESS_MASKING
1724 /*
@@ -46,19 +53,24 @@ static inline unsigned long __untagged_addr_remote(struct mm_struct *mm, · 28 unmodified lines
4653
4754 #endif
4855
49−/*
50− * The virtual address space space is logically divided into a kernel
51− * half and a user half. When cast to a signed type, user pointers
52− * are positive and kernel pointers are negative.
53− */
54−#define valid_user_address(x) ((__force long)(x) >= 0)
56+#define valid_user_address(x) \
57+ ((__force unsigned long)(x) <= runtime_const_ptr(USER_PTR_MAX))
5558
5659 /*
5760 * Masking the user address is an alternative to a conditional
5861 * user_access_begin that can avoid the fencing. This only works
5962 * for dense accesses starting at the address.
6063 */
61−#define mask_user_address(x) ((typeof(x))((long)(x)|((long)(x)>>63)))
64+static inline void __user *mask_user_address(const void __user *ptr)
65+{
66+ unsigned long mask;
67+ asm("cmp %1,%0\n\t"
68+ "sbb %0,%0"
69+ :"=r" (mask)
70+ :"r" (ptr),
71+ "0" (runtime_const_ptr(USER_PTR_MAX)));
72+ return (__force void __user *)(mask | (__force unsigned long)ptr);
73+}
6274 #define masked_user_access_begin(x) ({ \
6375 __auto_type __masked_ptr = (x); \
6476 __masked_ptr = mask_user_address(__masked_ptr); \
@@ -69,23 +81,16 @@ static inline unsigned long __untagged_addr_remote(struct mm_struct *mm, · 4 unmodified lines
6981 * arbitrary values in those bits rather then masking them off.
7082 *
7183 * Enforce two rules:
72− * 1. 'ptr' must be in the user half of the address space
84+ * 1. 'ptr' must be in the user part of the address space
7385 * 2. 'ptr+size' must not overflow into kernel addresses
7486 *
75− * Note that addresses around the sign change are not valid addresses,
76− * and will GP-fault even with LAM enabled if the sign bit is set (see
77− * "CR3.LAM_SUP" that can narrow the canonicality check if we ever
78− * enable it, but not remove it entirely).
79− *
80− * So the "overflow into kernel addresses" does not imply some sudden
81− * exact boundary at the sign bit, and we can allow a lot of slop on the
82− * size check.
87+ * Note that we always have at least one guard page between the
88+ * max user address and the non-canonical gap, allowing us to
89+ * ignore small sizes entirely.
8390 *
8491 * In fact, we could probably remove the size check entirely, since
8592 * any kernel accesses will be in increasing address order starting
86− * at 'ptr', and even if the end might be in kernel space, we'll
87− * hit the GP faults for non-canonical accesses before we ever get
88− * there.
93+ * at 'ptr'.
8994 *
9095 * That's a separate optimization, for now just handle the small
9196 * constant case.
arch/x86/kernel/amd_nb.c+2−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4
4545 #define PCI_DEVICE_ID_AMD_19H_M78H_DF_F4 0x12fc
4646 #define PCI_DEVICE_ID_AMD_1AH_M00H_DF_F4 0x12c4
47+#define PCI_DEVICE_ID_AMD_1AH_M20H_DF_F4 0x16fc
4748 #define PCI_DEVICE_ID_AMD_1AH_M60H_DF_F4 0x124c
4849 #define PCI_DEVICE_ID_AMD_1AH_M70H_DF_F4 0x12bc
4950 #define PCI_DEVICE_ID_AMD_MI200_DF_F4 0x14d4
@@ -127,6 +128,7 @@ static const struct pci_device_id amd_nb_link_ids[] = { · 77 unmodified lines
127128 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F4) },
128129 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) },
129130 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M00H_DF_F4) },
131+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M20H_DF_F4) },
130132 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M60H_DF_F4) },
131133 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M70H_DF_F4) },
132134 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI200_DF_F4) },
arch/x86/kernel/apic/apic.c+13−1
@@ -440,7 +440,19 @@ static int lapic_timer_shutdown(struct clock_event_device *evt) · 439 unmodified lines
440440 v = apic_read(APIC_LVTT);
441441 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
442442 apic_write(APIC_LVTT, v);
443− apic_write(APIC_TMICT, 0);
443+
444+ /*
445+ * Setting APIC_LVT_MASKED (above) should be enough to tell
446+ * the hardware that this timer will never fire. But AMD
447+ * erratum 411 and some Intel CPU behavior circa 2024 say
448+ * otherwise. Time for belt and suspenders programming: mask
449+ * the timer _and_ zero the counter registers:
450+ */
451+ if (v & APIC_LVT_TIMER_TSCDEADLINE)
452+ wrmsrl(MSR_IA32_TSC_DEADLINE, 0);
453+ else
454+ apic_write(APIC_TMICT, 0);
455+
444456 return 0;
445457 }
446458
arch/x86/kernel/cpu/amd.c+2−1
@@ -1202,5 +1202,6 @@ void amd_check_microcode(void) · 1201 unmodified lines
12021202 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
12031203 return;
12041204
1205− on_each_cpu(zenbleed_check_cpu, NULL, 1);
1205+ if (cpu_feature_enabled(X86_FEATURE_ZEN2))
1206+ on_each_cpu(zenbleed_check_cpu, NULL, 1);
12061207 }
arch/x86/kernel/cpu/bugs.c+32−0
@@ -1115,8 +1115,25 @@ do_cmd_auto: · 1114 unmodified lines
11151115
11161116 case RETBLEED_MITIGATION_IBPB:
11171117 setup_force_cpu_cap(X86_FEATURE_ENTRY_IBPB);
1118+
1119+ /*
1120+ * IBPB on entry already obviates the need for
1121+ * software-based untraining so clear those in case some
1122+ * other mitigation like SRSO has selected them.
1123+ */
1124+ setup_clear_cpu_cap(X86_FEATURE_UNRET);
1125+ setup_clear_cpu_cap(X86_FEATURE_RETHUNK);
1126+
11181127 setup_force_cpu_cap(X86_FEATURE_IBPB_ON_VMEXIT);
11191128 mitigate_smt = true;
1129+
1130+ /*
1131+ * There is no need for RSB filling: entry_ibpb() ensures
1132+ * all predictions, including the RSB, are invalidated,
1133+ * regardless of IBPB implementation.
1134+ */
1135+ setup_clear_cpu_cap(X86_FEATURE_RSB_VMEXIT);
1136+
11201137 break;
11211138
11221139 case RETBLEED_MITIGATION_STUFF:
@@ -2627,6 +2644,14 @@ static void __init srso_select_mitigation(void) · 1504 unmodified lines
26272644 if (has_microcode) {
26282645 setup_force_cpu_cap(X86_FEATURE_ENTRY_IBPB);
26292646 srso_mitigation = SRSO_MITIGATION_IBPB;
2647+
2648+ /*
2649+ * IBPB on entry already obviates the need for
2650+ * software-based untraining so clear those in case some
2651+ * other mitigation like Retbleed has selected them.
2652+ */
2653+ setup_clear_cpu_cap(X86_FEATURE_UNRET);
2654+ setup_clear_cpu_cap(X86_FEATURE_RETHUNK);
26302655 }
26312656 } else {
26322657 pr_err("WARNING: kernel not compiled with MITIGATION_IBPB_ENTRY.\n");
@@ -2638,6 +2663,13 @@ static void __init srso_select_mitigation(void) · 5 unmodified lines
26382663 if (!boot_cpu_has(X86_FEATURE_ENTRY_IBPB) && has_microcode) {
26392664 setup_force_cpu_cap(X86_FEATURE_IBPB_ON_VMEXIT);
26402665 srso_mitigation = SRSO_MITIGATION_IBPB_ON_VMEXIT;
2666+
2667+ /*
2668+ * There is no need for RSB filling: entry_ibpb() ensures
2669+ * all predictions, including the RSB, are invalidated,
2670+ * regardless of IBPB implementation.
2671+ */
2672+ setup_clear_cpu_cap(X86_FEATURE_RSB_VMEXIT);
26412673 }
26422674 } else {
26432675 pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n");
arch/x86/kernel/cpu/common.c+13−0
@@ -69,6 +69,7 @@ · 68 unmodified lines
6969 #include <asm/sev.h>
7070 #include <asm/tdx.h>
7171 #include <asm/posted_intr.h>
72+#include <asm/runtime-const.h>
7273
7374 #include "cpu.h"
7475
@@ -1443,6 +1444,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) · 1368 unmodified lines
14431444 boot_cpu_has(X86_FEATURE_HYPERVISOR)))
14441445 setup_force_cpu_bug(X86_BUG_BHI);
14451446
1447+ if (cpu_has(c, X86_FEATURE_AMD_IBPB) && !cpu_has(c, X86_FEATURE_AMD_IBPB_RET))
1448+ setup_force_cpu_bug(X86_BUG_IBPB_NO_RET);
1449+
14461450 if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
14471451 return;
14481452
@@ -2386,6 +2390,15 @@ void __init arch_cpu_finalize_init(void) · 937 unmodified lines
23862390 alternative_instructions();
23872391
23882392 if (IS_ENABLED(CONFIG_X86_64)) {
2393+ unsigned long USER_PTR_MAX = TASK_SIZE_MAX-1;
2394+
2395+ /*
2396+ * Enable this when LAM is gated on LASS support
2397+ if (cpu_feature_enabled(X86_FEATURE_LAM))
2398+ USER_PTR_MAX = (1ul << 63) - PAGE_SIZE - 1;
2399+ */
2400+ runtime_const_init(ptr, USER_PTR_MAX);
2401+
23892402 /*
23902403 * Make sure the first 2MB area is not mapped by huge pages
23912404 * There are typically fixed size MTRRs in there and overlapping
arch/x86/kernel/cpu/microcode/amd.c+35−16
@@ -584,7 +584,7 @@ void __init load_ucode_amd_bsp(struct early_load_data *ed, unsigned int cpuid_1_ · 583 unmodified lines
584584 native_rdmsr(MSR_AMD64_PATCH_LEVEL, ed->new_rev, dummy);
585585 }
586586
587−static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t size);
587+static enum ucode_state _load_microcode_amd(u8 family, const u8 *data, size_t size);
588588
589589 static int __init save_microcode_in_initrd(void)
590590 {
@@ -605,7 +605,7 @@ static int __init save_microcode_in_initrd(void) · 14 unmodified lines
605605 if (!desc.mc)
606606 return -EINVAL;
607607
608− ret = load_microcode_amd(x86_family(cpuid_1_eax), desc.data, desc.size);
608+ ret = _load_microcode_amd(x86_family(cpuid_1_eax), desc.data, desc.size);
609609 if (ret > UCODE_UPDATED)
610610 return -EINVAL;
611611
@@ -613,16 +613,19 @@ static int __init save_microcode_in_initrd(void) · 1 unmodified line
613613 }
614614 early_initcall(save_microcode_in_initrd);
615615
616−static inline bool patch_cpus_equivalent(struct ucode_patch *p, struct ucode_patch *n)
616+static inline bool patch_cpus_equivalent(struct ucode_patch *p,
617+ struct ucode_patch *n,
618+ bool ignore_stepping)
617619 {
618620 /* Zen and newer hardcode the f/m/s in the patch ID */
619621 if (x86_family(bsp_cpuid_1_eax) >= 0x17) {
620622 union cpuid_1_eax p_cid = ucode_rev_to_cpuid(p->patch_id);
621623 union cpuid_1_eax n_cid = ucode_rev_to_cpuid(n->patch_id);
622624
623− /* Zap stepping */
624− p_cid.stepping = 0;
625− n_cid.stepping = 0;
625+ if (ignore_stepping) {
626+ p_cid.stepping = 0;
627+ n_cid.stepping = 0;
628+ }
626629
627630 return p_cid.full == n_cid.full;
628631 } else {
@@ -644,13 +647,13 @@ static struct ucode_patch *cache_find_patch(struct ucode_cpu_info *uci, u16 equi · 15 unmodified lines
644647 WARN_ON_ONCE(!n.patch_id);
645648
646649 list_for_each_entry(p, &microcode_cache, plist)
647− if (patch_cpus_equivalent(p, &n))
650+ if (patch_cpus_equivalent(p, &n, false))
648651 return p;
649652
650653 return NULL;
651654 }
652655
653−static inline bool patch_newer(struct ucode_patch *p, struct ucode_patch *n)
656+static inline int patch_newer(struct ucode_patch *p, struct ucode_patch *n)
654657 {
655658 /* Zen and newer hardcode the f/m/s in the patch ID */
656659 if (x86_family(bsp_cpuid_1_eax) >= 0x17) {
@@ -659,6 +662,9 @@ static inline bool patch_newer(struct ucode_patch *p, struct ucode_patch *n) · 2 unmodified lines
659662 zp.ucode_rev = p->patch_id;
660663 zn.ucode_rev = n->patch_id;
661664
665+ if (zn.stepping != zp.stepping)
666+ return -1;
667+
662668 return zn.rev > zp.rev;
663669 } else {
664670 return n->patch_id > p->patch_id;
@@ -668,10 +674,14 @@ static inline bool patch_newer(struct ucode_patch *p, struct ucode_patch *n) · 3 unmodified lines
668674 static void update_cache(struct ucode_patch *new_patch)
669675 {
670676 struct ucode_patch *p;
677+ int ret;
671678
672679 list_for_each_entry(p, &microcode_cache, plist) {
673− if (patch_cpus_equivalent(p, new_patch)) {
674− if (!patch_newer(p, new_patch)) {
680+ if (patch_cpus_equivalent(p, new_patch, true)) {
681+ ret = patch_newer(p, new_patch);
682+ if (ret < 0)
683+ continue;
684+ else if (!ret) {
675685 /* we already have the latest patch */
676686 kfree(new_patch->data);
677687 kfree(new_patch);
@@ -944,21 +954,30 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, · 266 unmodified lines
944954 return UCODE_OK;
945955 }
946956
947−static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t size)
957+static enum ucode_state _load_microcode_amd(u8 family, const u8 *data, size_t size)
948958 {
949− struct cpuinfo_x86 *c;
950− unsigned int nid, cpu;
951− struct ucode_patch *p;
952959 enum ucode_state ret;
953960
954961 /* free old equiv table */
955962 free_equiv_cpu_table();
956963
957964 ret = __load_microcode_amd(family, data, size);
958− if (ret != UCODE_OK) {
965+ if (ret != UCODE_OK)
959966 cleanup();
967+
968+ return ret;
969+}
970+
971+static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t size)
972+{
973+ struct cpuinfo_x86 *c;
974+ unsigned int nid, cpu;
975+ struct ucode_patch *p;
976+ enum ucode_state ret;
977+
978+ ret = _load_microcode_amd(family, data, size);
979+ if (ret != UCODE_OK)
960980 return ret;
961− }
962981
963982 for_each_node(nid) {
964983 cpu = cpumask_first(cpumask_of_node(nid));
arch/x86/kernel/cpu/resctrl/core.c+2−2
@@ -207,7 +207,7 @@ static inline bool rdt_get_mb_table(struct rdt_resource *r) · 206 unmodified lines
207207 return false;
208208 }
209209
210−static bool __get_mem_config_intel(struct rdt_resource *r)
210+static __init bool __get_mem_config_intel(struct rdt_resource *r)
211211 {
212212 struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
213213 union cpuid_0x10_3_eax eax;
@@ -241,7 +241,7 @@ static bool __get_mem_config_intel(struct rdt_resource *r) · 27 unmodified lines
241241 return true;
242242 }
243243
244−static bool __rdt_get_mem_config_amd(struct rdt_resource *r)
244+static __init bool __rdt_get_mem_config_amd(struct rdt_resource *r)
245245 {
246246 struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
247247 u32 eax, ebx, ecx, edx, subleaf;
arch/x86/kernel/cpu/resctrl/ctrlmondata.c+14−9
@@ -29,10 +29,10 @@ · 28 unmodified lines
2929 * hardware. The allocated bandwidth percentage is rounded to the next
3030 * control step available on the hardware.
3131 */
32−static bool bw_validate(char *buf, unsigned long *data, struct rdt_resource *r)
32+static bool bw_validate(char *buf, u32 *data, struct rdt_resource *r)
3333 {
34− unsigned long bw;
3534 int ret;
35+ u32 bw;
3636
3737 /*
3838 * Only linear delay values is supported for current Intel SKUs.
@@ -42,16 +42,21 @@ static bool bw_validate(char *buf, unsigned long *data, struct rdt_resource *r) · 3 unmodified lines
4242 return false;
4343 }
4444
45− ret = kstrtoul(buf, 10, &bw);
45+ ret = kstrtou32(buf, 10, &bw);
4646 if (ret) {
47− rdt_last_cmd_printf("Non-decimal digit in MB value %s\n", buf);
47+ rdt_last_cmd_printf("Invalid MB value %s\n", buf);
4848 return false;
4949 }
5050
51− if ((bw < r->membw.min_bw || bw > r->default_ctrl) &&
52− !is_mba_sc(r)) {
53− rdt_last_cmd_printf("MB value %ld out of range [%d,%d]\n", bw,
54− r->membw.min_bw, r->default_ctrl);
51+ /* Nothing else to do if software controller is enabled. */
52+ if (is_mba_sc(r)) {
53+ *data = bw;
54+ return true;
55+ }
56+
57+ if (bw < r->membw.min_bw || bw > r->default_ctrl) {
58+ rdt_last_cmd_printf("MB value %u out of range [%d,%d]\n",
59+ bw, r->membw.min_bw, r->default_ctrl);
5560 return false;
5661 }
5762
@@ -65,7 +70,7 @@ int parse_bw(struct rdt_parse_data *data, struct resctrl_schema *s, · 7 unmodified lines
6570 struct resctrl_staged_config *cfg;
6671 u32 closid = data->rdtgrp->closid;
6772 struct rdt_resource *r = s->res;
68− unsigned long bw_val;
73+ u32 bw_val;
6974
7075 cfg = &d->staged_config[s->conf_type];
7176 if (cfg->have_new_ctrl) {
arch/x86/kernel/kvm.c+4−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <asm/apic.h>
3838 #include <asm/apicdef.h>
3939 #include <asm/hypervisor.h>
40+#include <asm/mtrr.h>
4041 #include <asm/tlb.h>
4142 #include <asm/cpuidle_haltpoll.h>
4243 #include <asm/ptrace.h>
@@ -980,6 +981,9 @@ static void __init kvm_init_platform(void) · 937 unmodified lines
980981 }
981982 kvmclock_init();
982983 x86_platform.apic_post_init = kvm_apic_init;
984+
985+ /* Set WB as the default cache mode for SEV-SNP and TDX */
986+ mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
983987 }
984988
985989 #if defined(CONFIG_AMD_MEM_ENCRYPT)
arch/x86/kernel/traps.c+6−6
@@ -261,12 +261,6 @@ static noinstr bool handle_bug(struct pt_regs *regs) · 260 unmodified lines
261261 int ud_type;
262262 u32 imm;
263263
264− /*
265− * Normally @regs are unpoisoned by irqentry_enter(), but handle_bug()
266− * is a rare case that uses @regs without passing them to
267− * irqentry_enter().
268− */
269− kmsan_unpoison_entry_regs(regs);
270264 ud_type = decode_bug(regs->ip, &imm);
271265 if (ud_type == BUG_NONE)
272266 return handled;
@@ -275,6 +269,12 @@ static noinstr bool handle_bug(struct pt_regs *regs) · 2 unmodified lines
275269 * All lies, just get the WARN/BUG out.
276270 */
277271 instrumentation_begin();
272+ /*
273+ * Normally @regs are unpoisoned by irqentry_enter(), but handle_bug()
274+ * is a rare case that uses @regs without passing them to
275+ * irqentry_enter().
276+ */
277+ kmsan_unpoison_entry_regs(regs);
278278 /*
279279 * Since we're emulating a CALL with exceptions, restore the interrupt
280280 * state to what it was at the exception site.
arch/x86/kernel/vmlinux.lds.S+1−0
@@ -358,6 +358,7 @@ SECTIONS · 357 unmodified lines
358358 #endif
359359
360360 RUNTIME_CONST_VARIABLES
361+ RUNTIME_CONST(ptr, USER_PTR_MAX)
361362
362363 . = ALIGN(PAGE_SIZE);
363364
arch/x86/kvm/mmu/mmu.c+17−10
@@ -1556,6 +1556,17 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range) · 1555 unmodified lines
15561556 {
15571557 bool flush = false;
15581558
1559+ /*
1560+ * To prevent races with vCPUs faulting in a gfn using stale data,
1561+ * zapping a gfn range must be protected by mmu_invalidate_in_progress
1562+ * (and mmu_invalidate_seq). The only exception is memslot deletion;
1563+ * in that case, SRCU synchronization ensures that SPTEs are zapped
1564+ * after all vCPUs have unlocked SRCU, guaranteeing that vCPUs see the
1565+ * invalid slot.
1566+ */
1567+ lockdep_assert_once(kvm->mmu_invalidate_in_progress ||
1568+ lockdep_is_held(&kvm->slots_lock));
1569+
15591570 if (kvm_memslots_have_rmaps(kvm))
15601571 flush = __kvm_rmap_zap_gfn_range(kvm, range->slot,
15611572 range->start, range->end,
@@ -1884,14 +1895,10 @@ static bool sp_has_gptes(struct kvm_mmu_page *sp) · 322 unmodified lines
18841895 if (is_obsolete_sp((_kvm), (_sp))) { \
18851896 } else
18861897
1887−#define for_each_gfn_valid_sp(_kvm, _sp, _gfn) \
1898+#define for_each_gfn_valid_sp_with_gptes(_kvm, _sp, _gfn) \
18881899 for_each_valid_sp(_kvm, _sp, \
18891900 &(_kvm)->arch.mmu_page_hash[kvm_page_table_hashfn(_gfn)]) \
1890− if ((_sp)->gfn != (_gfn)) {} else
1891−
1892−#define for_each_gfn_valid_sp_with_gptes(_kvm, _sp, _gfn) \
1893− for_each_gfn_valid_sp(_kvm, _sp, _gfn) \
1894− if (!sp_has_gptes(_sp)) {} else
1901+ if ((_sp)->gfn != (_gfn) || !sp_has_gptes(_sp)) {} else
18951902
18961903 static bool kvm_sync_page_check(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
18971904 {
@@ -7063,15 +7070,15 @@ static void kvm_mmu_zap_memslot_pages_and_flush(struct kvm *kvm, · 5165 unmodified lines
70637070
70647071 /*
70657072 * Since accounting information is stored in struct kvm_arch_memory_slot,
7066− * shadow pages deletion (e.g. unaccount_shadowed()) requires that all
7067− * gfns with a shadow page have a corresponding memslot. Do so before
7068− * the memslot goes away.
7073+ * all MMU pages that are shadowing guest PTEs must be zapped before the
7074+ * memslot is deleted, as freeing such pages after the memslot is freed
7075+ * will result in use-after-free, e.g. in unaccount_shadowed().
70697076 */
70707077 for (i = 0; i < slot->npages; i++) {
70717078 struct kvm_mmu_page *sp;
70727079 gfn_t gfn = slot->base_gfn + i;
70737080
7074− for_each_gfn_valid_sp(kvm, sp, gfn)
7081+ for_each_gfn_valid_sp_with_gptes(kvm, sp, gfn)
70757082 kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list);
70767083
70777084 if (need_resched() || rwlock_needbreak(&kvm->mmu_lock)) {
arch/x86/kvm/svm/nested.c+5−1
@@ -63,8 +63,12 @@ static u64 nested_svm_get_tdp_pdptr(struct kvm_vcpu *vcpu, int index) · 62 unmodified lines
6363 u64 pdpte;
6464 int ret;
6565
66+ /*
67+ * Note, nCR3 is "assumed" to be 32-byte aligned, i.e. the CPU ignores
68+ * nCR3[4:0] when loading PDPTEs from memory.
69+ */
6670 ret = kvm_vcpu_read_guest_page(vcpu, gpa_to_gfn(cr3), &pdpte,
67− offset_in_page(cr3) + index * 8, 8);
71+ (cr3 & GENMASK(11, 5)) + index * 8, 8);
6872 if (ret)
6973 return 0;
7074 return pdpte;
arch/x86/kvm/vmx/vmx.c+3−3
@@ -4888,9 +4888,6 @@ void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 4887 unmodified lines
48884888 vmx->hv_deadline_tsc = -1;
48894889 kvm_set_cr8(vcpu, 0);
48904890
4891− vmx_segment_cache_clear(vmx);
4892− kvm_register_mark_available(vcpu, VCPU_EXREG_SEGMENTS);
4893−
48944891 seg_setup(VCPU_SREG_CS);
48954892 vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
48964893 vmcs_writel(GUEST_CS_BASE, 0xffff0000ul);
@@ -4917,6 +4914,9 @@ void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 20 unmodified lines
49174914 vmcs_writel(GUEST_IDTR_BASE, 0);
49184915 vmcs_write32(GUEST_IDTR_LIMIT, 0xffff);
49194916
4917+ vmx_segment_cache_clear(vmx);
4918+ kvm_register_mark_available(vcpu, VCPU_EXREG_SEGMENTS);
4919+
49204920 vmcs_write32(GUEST_ACTIVITY_STATE, GUEST_ACTIVITY_ACTIVE);
49214921 vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, 0);
49224922 vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS, 0);
arch/x86/lib/getuser.S+7−2
@@ -39,8 +39,13 @@ · 38 unmodified lines
3939
4040 .macro check_range size:req
4141 .if IS_ENABLED(CONFIG_X86_64)
42− mov %rax, %rdx
43− sar $63, %rdx
42+ movq $0x0123456789abcdef,%rdx
43+ 1:
44+ .pushsection runtime_ptr_USER_PTR_MAX,"a"
45+ .long 1b - 8 - .
46+ .popsection
47+ cmp %rax, %rdx
48+ sbb %rdx, %rdx
4449 or %rdx, %rax
4550 .else
4651 cmp $TASK_SIZE_MAX-\size+1, %eax
arch/x86/virt/svm/sev.c+2−0
@@ -173,6 +173,8 @@ static void __init __snp_fixup_e820_tables(u64 pa) · 172 unmodified lines
173173 e820__range_update(pa, PMD_SIZE, E820_TYPE_RAM, E820_TYPE_RESERVED);
174174 e820__range_update_table(e820_table_kexec, pa, PMD_SIZE, E820_TYPE_RAM, E820_TYPE_RESERVED);
175175 e820__range_update_table(e820_table_firmware, pa, PMD_SIZE, E820_TYPE_RAM, E820_TYPE_RESERVED);
176+ if (!memblock_is_region_reserved(pa, PMD_SIZE))
177+ memblock_reserve(pa, PMD_SIZE);
176178 }
177179 }
178180
arch/x86/xen/enlighten_pv.c+4−0
@@ -1032,6 +1032,10 @@ static u64 xen_do_read_msr(unsigned int msr, int *err) · 1031 unmodified lines
10321032 switch (msr) {
10331033 case MSR_IA32_APICBASE:
10341034 val &= ~X2APIC_ENABLE;
1035+ if (smp_processor_id() == 0)
1036+ val |= MSR_IA32_APICBASE_BSP;
1037+ else
1038+ val &= ~MSR_IA32_APICBASE_BSP;
10351039 break;
10361040 }
10371041 return val;
block/blk-map.c+17−41
@@ -561,57 +561,33 @@ EXPORT_SYMBOL(blk_rq_append_bio); · 560 unmodified lines
561561 /* Prepare bio for passthrough IO given ITER_BVEC iter */
562562 static int blk_rq_map_user_bvec(struct request *rq, const struct iov_iter *iter)
563563 {
564− struct request_queue *q = rq->q;
565− size_t nr_iter = iov_iter_count(iter);
566− size_t nr_segs = iter->nr_segs;
567− struct bio_vec *bvecs, *bvprvp = NULL;
568− const struct queue_limits *lim = &q->limits;
569− unsigned int nsegs = 0, bytes = 0;
564+ const struct queue_limits *lim = &rq->q->limits;
565+ unsigned int max_bytes = lim->max_hw_sectors << SECTOR_SHIFT;
566+ unsigned int nsegs;
570567 struct bio *bio;
571− size_t i;
568+ int ret;
572569
573− if (!nr_iter || (nr_iter >> SECTOR_SHIFT) > queue_max_hw_sectors(q))
574− return -EINVAL;
575− if (nr_segs > queue_max_segments(q))
570+ if (!iov_iter_count(iter) || iov_iter_count(iter) > max_bytes)
576571 return -EINVAL;
577572
578− /* no iovecs to alloc, as we already have a BVEC iterator */
573+ /* reuse the bvecs from the iterator instead of allocating new ones */
579574 bio = blk_rq_map_bio_alloc(rq, 0, GFP_KERNEL);
580− if (bio == NULL)
575+ if (!bio)
581576 return -ENOMEM;
582−
583577 bio_iov_bvec_set(bio, (struct iov_iter *)iter);
584− blk_rq_bio_prep(rq, bio, nr_segs);
585−
586− /* loop to perform a bunch of sanity checks */
587− bvecs = (struct bio_vec *)iter->bvec;
588− for (i = 0; i < nr_segs; i++) {
589− struct bio_vec *bv = &bvecs[i];
590578
591− /*
592− * If the queue doesn't support SG gaps and adding this
593− * offset would create a gap, fallback to copy.
594− */
595− if (bvprvp && bvec_gap_to_prev(lim, bvprvp, bv->bv_offset)) {
596− blk_mq_map_bio_put(bio);
597− return -EREMOTEIO;
598− }
599− /* check full condition */
600− if (nsegs >= nr_segs || bytes > UINT_MAX - bv->bv_len)
601− goto put_bio;
602− if (bytes + bv->bv_len > nr_iter)
603− goto put_bio;
604− if (bv->bv_offset + bv->bv_len > PAGE_SIZE)
605− goto put_bio;
606−
607− nsegs++;
608− bytes += bv->bv_len;
609− bvprvp = bv;
579+ /* check that the data layout matches the hardware restrictions */
580+ ret = bio_split_rw_at(bio, lim, &nsegs, max_bytes);
581+ if (ret) {
582+ /* if we would have to split the bio, copy instead */
583+ if (ret > 0)
584+ ret = -EREMOTEIO;
585+ blk_mq_map_bio_put(bio);
586+ return ret;
610587 }
588+
589+ blk_rq_bio_prep(rq, bio, nsegs);
611590 return 0;
612−put_bio:
613− blk_mq_map_bio_put(bio);
614− return -EINVAL;
615591 }
616592
617593 /**
block/blk-mq.c+6−2
@@ -4310,6 +4310,12 @@ int blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, · 4309 unmodified lines
43104310 /* mark the queue as mq asap */
43114311 q->mq_ops = set->ops;
43124312
4313+ /*
4314+ * ->tag_set has to be setup before initialize hctx, which cpuphp
4315+ * handler needs it for checking queue mapping
4316+ */
4317+ q->tag_set = set;
4318+
43134319 if (blk_mq_alloc_ctxs(q))
43144320 goto err_exit;
43154321
@@ -4328,8 +4334,6 @@ int blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, · 12 unmodified lines
43284334 INIT_WORK(&q->timeout_work, blk_mq_timeout_work);
43294335 blk_queue_rq_timeout(q, set->timeout ? set->timeout : 30 * HZ);
43304336
4331− q->tag_set = set;
4332−
43334337 q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT;
43344338
43354339 INIT_DELAYED_WORK(&q->requeue_work, blk_mq_requeue_work);
block/blk-rq-qos.c+1−1
@@ -219,8 +219,8 @@ static int rq_qos_wake_function(struct wait_queue_entry *curr, · 218 unmodified lines
219219
220220 data->got_token = true;
221221 smp_wmb();
222− list_del_init(&curr->entry);
223222 wake_up_process(data->task);
223+ list_del_init_careful(&curr->entry);
224224 return 1;
225225 }
226226
block/elevator.c+14−7
@@ -106,8 +106,7 @@ static struct elevator_type *__elevator_find(const char *name) · 105 unmodified lines
106106 return NULL;
107107 }
108108
109−static struct elevator_type *elevator_find_get(struct request_queue *q,
110− const char *name)
109+static struct elevator_type *elevator_find_get(const char *name)
111110 {
112111 struct elevator_type *e;
113112
@@ -551,7 +550,7 @@ EXPORT_SYMBOL_GPL(elv_unregister); · 437 unmodified lines
551550 static inline bool elv_support_iosched(struct request_queue *q)
552551 {
553552 if (!queue_is_mq(q) ||
554− (q->tag_set && (q->tag_set->flags & BLK_MQ_F_NO_SCHED)))
553+ (q->tag_set->flags & BLK_MQ_F_NO_SCHED))
555554 return false;
556555 return true;
557556 }
@@ -562,14 +561,14 @@ static inline bool elv_support_iosched(struct request_queue *q) · 4 unmodified lines
562561 */
563562 static struct elevator_type *elevator_get_default(struct request_queue *q)
564563 {
565− if (q->tag_set && q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
564+ if (q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
566565 return NULL;
567566
568567 if (q->nr_hw_queues != 1 &&
569568 !blk_mq_is_shared_tags(q->tag_set->flags))
570569 return NULL;
571570
572− return elevator_find_get(q, "mq-deadline");
571+ return elevator_find_get("mq-deadline");
573572 }
574573
575574 /*
@@ -697,7 +696,7 @@ static int elevator_change(struct request_queue *q, const char *elevator_name) · 121 unmodified lines
697696 if (q->elevator && elevator_match(q->elevator->type, elevator_name))
698697 return 0;
699698
700− e = elevator_find_get(q, elevator_name);
699+ e = elevator_find_get(elevator_name);
701700 if (!e)
702701 return -EINVAL;
703702 ret = elevator_switch(q, e);
@@ -709,13 +708,21 @@ int elv_iosched_load_module(struct gendisk *disk, const char *buf, · 5 unmodified lines
709708 size_t count)
710709 {
711710 char elevator_name[ELV_NAME_MAX];
711+ struct elevator_type *found;
712+ const char *name;
712713
713714 if (!elv_support_iosched(disk->queue))
714715 return -EOPNOTSUPP;
715716
716717 strscpy(elevator_name, buf, sizeof(elevator_name));
718+ name = strstrip(elevator_name);
717719
718− request_module("%s-iosched", strstrip(elevator_name));
720+ spin_lock(&elv_list_lock);
721+ found = __elevator_find(name);
722+ spin_unlock(&elv_list_lock);
723+
724+ if (!found)
725+ request_module("%s-iosched", name);
719726
720727 return 0;
721728 }
crypto/algapi.c+1−1
@@ -373,7 +373,7 @@ found: · 372 unmodified lines
373373 q->cra_flags |= CRYPTO_ALG_DEAD;
374374 alg = test->adult;
375375
376− if (list_empty(&alg->cra_list))
376+ if (crypto_is_dead(alg))
377377 goto complete;
378378
379379 if (err == -ECANCELED)
crypto/testmgr.c+11−12
@@ -1940,7 +1940,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, · 1939 unmodified lines
19401940 atfm = crypto_alloc_ahash(driver, type, mask);
19411941 if (IS_ERR(atfm)) {
19421942 if (PTR_ERR(atfm) == -ENOENT)
1943− return -ENOENT;
1943+ return 0;
19441944 pr_err("alg: hash: failed to allocate transform for %s: %ld\n",
19451945 driver, PTR_ERR(atfm));
19461946 return PTR_ERR(atfm);
@@ -2706,7 +2706,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, · 759 unmodified lines
27062706 tfm = crypto_alloc_aead(driver, type, mask);
27072707 if (IS_ERR(tfm)) {
27082708 if (PTR_ERR(tfm) == -ENOENT)
2709− return -ENOENT;
2709+ return 0;
27102710 pr_err("alg: aead: failed to allocate transform for %s: %ld\n",
27112711 driver, PTR_ERR(tfm));
27122712 return PTR_ERR(tfm);
@@ -3285,7 +3285,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, · 572 unmodified lines
32853285 tfm = crypto_alloc_skcipher(driver, type, mask);
32863286 if (IS_ERR(tfm)) {
32873287 if (PTR_ERR(tfm) == -ENOENT)
3288− return -ENOENT;
3288+ return 0;
32893289 pr_err("alg: skcipher: failed to allocate transform for %s: %ld\n",
32903290 driver, PTR_ERR(tfm));
32913291 return PTR_ERR(tfm);
@@ -3700,7 +3700,7 @@ static int alg_test_cipher(const struct alg_test_desc *desc, · 408 unmodified lines
37003700 tfm = crypto_alloc_cipher(driver, type, mask);
37013701 if (IS_ERR(tfm)) {
37023702 if (PTR_ERR(tfm) == -ENOENT)
3703− return -ENOENT;
3703+ return 0;
37043704 printk(KERN_ERR "alg: cipher: Failed to load transform for "
37053705 "%s: %ld\n", driver, PTR_ERR(tfm));
37063706 return PTR_ERR(tfm);
@@ -3726,7 +3726,7 @@ static int alg_test_comp(const struct alg_test_desc *desc, const char *driver, · 19 unmodified lines
37263726 acomp = crypto_alloc_acomp(driver, type, mask);
37273727 if (IS_ERR(acomp)) {
37283728 if (PTR_ERR(acomp) == -ENOENT)
3729− return -ENOENT;
3729+ return 0;
37303730 pr_err("alg: acomp: Failed to load transform for %s: %ld\n",
37313731 driver, PTR_ERR(acomp));
37323732 return PTR_ERR(acomp);
@@ -3740,7 +3740,7 @@ static int alg_test_comp(const struct alg_test_desc *desc, const char *driver, · 7 unmodified lines
37403740 comp = crypto_alloc_comp(driver, type, mask);
37413741 if (IS_ERR(comp)) {
37423742 if (PTR_ERR(comp) == -ENOENT)
3743− return -ENOENT;
3743+ return 0;
37443744 pr_err("alg: comp: Failed to load transform for %s: %ld\n",
37453745 driver, PTR_ERR(comp));
37463746 return PTR_ERR(comp);
@@ -3818,7 +3818,7 @@ static int alg_test_cprng(const struct alg_test_desc *desc, const char *driver, · 71 unmodified lines
38183818 rng = crypto_alloc_rng(driver, type, mask);
38193819 if (IS_ERR(rng)) {
38203820 if (PTR_ERR(rng) == -ENOENT)
3821− return -ENOENT;
3821+ return 0;
38223822 printk(KERN_ERR "alg: cprng: Failed to load transform for %s: "
38233823 "%ld\n", driver, PTR_ERR(rng));
38243824 return PTR_ERR(rng);
@@ -3846,12 +3846,11 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, · 21 unmodified lines
38463846
38473847 drng = crypto_alloc_rng(driver, type, mask);
38483848 if (IS_ERR(drng)) {
3849+ kfree_sensitive(buf);
38493850 if (PTR_ERR(drng) == -ENOENT)
3850− goto out_no_rng;
3851+ return 0;
38513852 printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for "
38523853 "%s\n", driver);
3853−out_no_rng:
3854− kfree_sensitive(buf);
38553854 return PTR_ERR(drng);
38563855 }
38573856
@@ -4095,7 +4094,7 @@ static int alg_test_kpp(const struct alg_test_desc *desc, const char *driver, · 237 unmodified lines
40954094 tfm = crypto_alloc_kpp(driver, type, mask);
40964095 if (IS_ERR(tfm)) {
40974096 if (PTR_ERR(tfm) == -ENOENT)
4098− return -ENOENT;
4097+ return 0;
40994098 pr_err("alg: kpp: Failed to load tfm for %s: %ld\n",
41004099 driver, PTR_ERR(tfm));
41014100 return PTR_ERR(tfm);
@@ -4325,7 +4324,7 @@ static int alg_test_akcipher(const struct alg_test_desc *desc, · 223 unmodified lines
43254324 tfm = crypto_alloc_akcipher(driver, type, mask);
43264325 if (IS_ERR(tfm)) {
43274326 if (PTR_ERR(tfm) == -ENOENT)
4328− return -ENOENT;
4327+ return 0;
43294328 pr_err("alg: akcipher: Failed to load tfm for %s: %ld\n",
43304329 driver, PTR_ERR(tfm));
43314330 return PTR_ERR(tfm);
drivers/accel/ivpu/ivpu_debugfs.c+9−0
@@ -116,6 +116,14 @@ static int reset_pending_show(struct seq_file *s, void *v) · 115 unmodified lines
116116 return 0;
117117 }
118118
119+static int firewall_irq_counter_show(struct seq_file *s, void *v)
120+{
121+ struct ivpu_device *vdev = seq_to_ivpu(s);
122+
123+ seq_printf(s, "%d\n", atomic_read(&vdev->hw->firewall_irq_counter));
124+ return 0;
125+}
126+
119127 static const struct drm_debugfs_info vdev_debugfs_list[] = {
120128 {"bo_list", bo_list_show, 0},
121129 {"fw_name", fw_name_show, 0},
@@ -125,6 +133,7 @@ static const struct drm_debugfs_info vdev_debugfs_list[] = { · 3 unmodified lines
125133 {"last_bootmode", last_bootmode_show, 0},
126134 {"reset_counter", reset_counter_show, 0},
127135 {"reset_pending", reset_pending_show, 0},
136+ {"firewall_irq_counter", firewall_irq_counter_show, 0},
128137 };
129138
130139 static int dvfs_mode_get(void *data, u64 *dvfs_mode)
drivers/accel/ivpu/ivpu_hw.c+1−0
@@ -252,6 +252,7 @@ int ivpu_hw_init(struct ivpu_device *vdev) · 251 unmodified lines
252252 platform_init(vdev);
253253 wa_init(vdev);
254254 timeouts_init(vdev);
255+ atomic_set(&vdev->hw->firewall_irq_counter, 0);
255256
256257 return 0;
257258 }
drivers/accel/ivpu/ivpu_hw.h+1−0
@@ -51,6 +51,7 @@ struct ivpu_hw_info { · 50 unmodified lines
5151 int dma_bits;
5252 ktime_t d0i3_entry_host_ts;
5353 u64 d0i3_entry_vpu_ts;
54+ atomic_t firewall_irq_counter;
5455 };
5556
5657 int ivpu_hw_init(struct ivpu_device *vdev);
drivers/accel/ivpu/ivpu_hw_ip.c+4−1
@@ -1073,7 +1073,10 @@ static void irq_wdt_mss_handler(struct ivpu_device *vdev) · 1072 unmodified lines
10731073
10741074 static void irq_noc_firewall_handler(struct ivpu_device *vdev)
10751075 {
1076− ivpu_pm_trigger_recovery(vdev, "NOC Firewall IRQ");
1076+ atomic_inc(&vdev->hw->firewall_irq_counter);
1077+
1078+ ivpu_dbg(vdev, IRQ, "NOC Firewall interrupt detected, counter %d\n",
1079+ atomic_read(&vdev->hw->firewall_irq_counter));
10771080 }
10781081
10791082 /* Handler for IRQs from NPU core */
drivers/accel/qaic/qaic_control.c+1−1
@@ -496,7 +496,7 @@ static int encode_addr_size_pairs(struct dma_xfer *xfer, struct wrapper_list *wr · 495 unmodified lines
496496 nents = sgt->nents;
497497 nents_dma = nents;
498498 *size = QAIC_MANAGE_EXT_MSG_LENGTH - msg_hdr_len - sizeof(**out_trans);
499− for_each_sgtable_sg(sgt, sg, i) {
499+ for_each_sgtable_dma_sg(sgt, sg, i) {
500500 *size -= sizeof(*asp);
501501 /* Save 1K for possible follow-up transactions. */
502502 if (*size < SZ_1K) {
drivers/accel/qaic/qaic_data.c+3−3
@@ -184,7 +184,7 @@ static int clone_range_of_sgt_for_slice(struct qaic_device *qdev, struct sg_tabl · 183 unmodified lines
184184 nents = 0;
185185
186186 size = size ? size : PAGE_SIZE;
187− for (sg = sgt_in->sgl; sg; sg = sg_next(sg)) {
187+ for_each_sgtable_dma_sg(sgt_in, sg, j) {
188188 len = sg_dma_len(sg);
189189
190190 if (!len)
@@ -221,7 +221,7 @@ static int clone_range_of_sgt_for_slice(struct qaic_device *qdev, struct sg_tabl · 30 unmodified lines
221221
222222 /* copy relevant sg node and fix page and length */
223223 sgn = sgf;
224− for_each_sgtable_sg(sgt, sg, j) {
224+ for_each_sgtable_dma_sg(sgt, sg, j) {
225225 memcpy(sg, sgn, sizeof(*sg));
226226 if (sgn == sgf) {
227227 sg_dma_address(sg) += offf;
@@ -301,7 +301,7 @@ static int encode_reqs(struct qaic_device *qdev, struct bo_slice *slice, · 73 unmodified lines
301301 * fence.
302302 */
303303 dev_addr = req->dev_addr;
304− for_each_sgtable_sg(slice->sgt, sg, i) {
304+ for_each_sgtable_dma_sg(slice->sgt, sg, i) {
305305 slice->reqs[i].cmd = cmd;
306306 slice->reqs[i].src_addr = cpu_to_le64(slice->dir == DMA_TO_DEVICE ?
307307 sg_dma_address(sg) : dev_addr);
drivers/acpi/button.c+11−0
@@ -130,6 +130,17 @@ static const struct dmi_system_id dmi_lid_quirks[] = { · 129 unmodified lines
130130 },
131131 .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
132132 },
133+ {
134+ /*
135+ * Samsung galaxybook2 ,initial _LID device notification returns
136+ * lid closed.
137+ */
138+ .matches = {
139+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
140+ DMI_MATCH(DMI_PRODUCT_NAME, "750XED"),
141+ },
142+ .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
143+ },
133144 {}
134145 };
135146
drivers/acpi/cppc_acpi.c+22−9
@@ -867,7 +867,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) · 866 unmodified lines
867867
868868 /* Store CPU Logical ID */
869869 cpc_ptr->cpu_id = pr->id;
870− spin_lock_init(&cpc_ptr->rmw_lock);
870+ raw_spin_lock_init(&cpc_ptr->rmw_lock);
871871
872872 /* Parse PSD data for this CPU */
873873 ret = acpi_get_psd(cpc_ptr, handle);
@@ -1087,6 +1087,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) · 213 unmodified lines
10871087 int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
10881088 struct cpc_reg *reg = &reg_res->cpc_entry.reg;
10891089 struct cpc_desc *cpc_desc;
1090+ unsigned long flags;
10901091
10911092 size = GET_BIT_WIDTH(reg);
10921093
@@ -1126,7 +1127,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) · 33 unmodified lines
11261127 return -ENODEV;
11271128 }
11281129
1129− spin_lock(&cpc_desc->rmw_lock);
1130+ raw_spin_lock_irqsave(&cpc_desc->rmw_lock, flags);
11301131 switch (size) {
11311132 case 8:
11321133 prev_val = readb_relaxed(vaddr);
@@ -1141,7 +1142,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) · 8 unmodified lines
11411142 prev_val = readq_relaxed(vaddr);
11421143 break;
11431144 default:
1144− spin_unlock(&cpc_desc->rmw_lock);
1145+ raw_spin_unlock_irqrestore(&cpc_desc->rmw_lock, flags);
11451146 return -EFAULT;
11461147 }
11471148 val = MASK_VAL_WRITE(reg, prev_val, val);
@@ -1174,7 +1175,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) · 26 unmodified lines
11741175 }
11751176
11761177 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
1177− spin_unlock(&cpc_desc->rmw_lock);
1178+ raw_spin_unlock_irqrestore(&cpc_desc->rmw_lock, flags);
11781179
11791180 return ret_val;
11801181 }
@@ -1916,9 +1917,15 @@ unsigned int cppc_perf_to_khz(struct cppc_perf_caps *caps, unsigned int perf) · 735 unmodified lines
19161917 u64 mul, div;
19171918
19181919 if (caps->lowest_freq && caps->nominal_freq) {
1919− mul = caps->nominal_freq - caps->lowest_freq;
1920+ /* Avoid special case when nominal_freq is equal to lowest_freq */
1921+ if (caps->lowest_freq == caps->nominal_freq) {
1922+ mul = caps->nominal_freq;
1923+ div = caps->nominal_perf;
1924+ } else {
1925+ mul = caps->nominal_freq - caps->lowest_freq;
1926+ div = caps->nominal_perf - caps->lowest_perf;
1927+ }
19201928 mul *= KHZ_PER_MHZ;
1921− div = caps->nominal_perf - caps->lowest_perf;
19221929 offset = caps->nominal_freq * KHZ_PER_MHZ -
19231930 div64_u64(caps->nominal_perf * mul, div);
19241931 } else {
@@ -1939,11 +1946,17 @@ unsigned int cppc_khz_to_perf(struct cppc_perf_caps *caps, unsigned int freq) · 14 unmodified lines
19391946 {
19401947 s64 retval, offset = 0;
19411948 static u64 max_khz;
1942− u64 mul, div;
1949+ u64 mul, div;
19431950
19441951 if (caps->lowest_freq && caps->nominal_freq) {
1945− mul = caps->nominal_perf - caps->lowest_perf;
1946− div = caps->nominal_freq - caps->lowest_freq;
1952+ /* Avoid special case when nominal_freq is equal to lowest_freq */
1953+ if (caps->lowest_freq == caps->nominal_freq) {
1954+ mul = caps->nominal_perf;
1955+ div = caps->nominal_freq;
1956+ } else {
1957+ mul = caps->nominal_perf - caps->lowest_perf;
1958+ div = caps->nominal_freq - caps->lowest_freq;
1959+ }
19471960 /*
19481961 * We don't need to convert to kHz for computing offset and can
19491962 * directly use nominal_freq and lowest_freq as the div64_u64
drivers/acpi/prmt.c+23−6
@@ -52,7 +52,7 @@ struct prm_context_buffer { · 51 unmodified lines
5252 static LIST_HEAD(prm_module_list);
5353
5454 struct prm_handler_info {
55− guid_t guid;
55+ efi_guid_t guid;
5656 efi_status_t (__efiapi *handler_addr)(u64, void *);
5757 u64 static_data_buffer_addr;
5858 u64 acpi_param_buffer_addr;
@@ -72,17 +72,21 @@ struct prm_module_info { · 13 unmodified lines
7272 struct prm_handler_info handlers[] __counted_by(handler_count);
7373 };
7474
75−static u64 efi_pa_va_lookup(u64 pa)
75+static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa)
7676 {
7777 efi_memory_desc_t *md;
7878 u64 pa_offset = pa & ~PAGE_MASK;
7979 u64 page = pa & PAGE_MASK;
8080
8181 for_each_efi_memory_desc(md) {
82− if (md->phys_addr < pa && pa < md->phys_addr + PAGE_SIZE * md->num_pages)
82+ if ((md->attribute & EFI_MEMORY_RUNTIME) &&
83+ (md->phys_addr < pa && pa < md->phys_addr + PAGE_SIZE * md->num_pages)) {
8384 return pa_offset + md->virt_addr + page - md->phys_addr;
85+ }
8486 }
8587
88+ pr_warn("Failed to find VA for GUID: %pUL, PA: 0x%llx", guid, pa);
89+
8690 return 0;
8791 }
8892
@@ -148,9 +152,15 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) · 59 unmodified lines
148152 th = &tm->handlers[cur_handler];
149153
150154 guid_copy(&th->guid, (guid_t *)handler_info->handler_guid);
151− th->handler_addr = (void *)efi_pa_va_lookup(handler_info->handler_address);
152− th->static_data_buffer_addr = efi_pa_va_lookup(handler_info->static_data_buffer_address);
153− th->acpi_param_buffer_addr = efi_pa_va_lookup(handler_info->acpi_param_buffer_address);
155+ th->handler_addr =
156+ (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
157+
158+ th->static_data_buffer_addr =
159+ efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address);
160+
161+ th->acpi_param_buffer_addr =
162+ efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address);
163+
154164 } while (++cur_handler < tm->handler_count && (handler_info = get_next_handler(handler_info)));
155165
156166 return 0;
@@ -277,6 +287,13 @@ static acpi_status acpi_platformrt_space_handler(u32 function, · 120 unmodified lines
277287 if (!handler || !module)
278288 goto invalid_guid;
279289
290+ if (!handler->handler_addr ||
291+ !handler->static_data_buffer_addr ||
292+ !handler->acpi_param_buffer_addr) {
293+ buffer->prm_status = PRM_HANDLER_ERROR;
294+ return AE_OK;
295+ }
296+
280297 ACPI_COPY_NAMESEG(context.signature, "PRMC");
281298 context.revision = 0x0;
282299 context.reserved = 0x0;
drivers/acpi/resource.c+15−64
@@ -448,73 +448,31 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { · 447 unmodified lines
448448 },
449449 },
450450 {
451− /* Asus ExpertBook B1402CBA */
451+ /* Asus ExpertBook B1402C* */
452452 .matches = {
453453 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
454− DMI_MATCH(DMI_BOARD_NAME, "B1402CBA"),
454+ DMI_MATCH(DMI_BOARD_NAME, "B1402C"),
455455 },
456456 },
457457 {
458− /* Asus ExpertBook B1402CVA */
458+ /* Asus ExpertBook B1502C* */
459459 .matches = {
460460 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
461− DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"),
461+ DMI_MATCH(DMI_BOARD_NAME, "B1502C"),
462462 },
463463 },
464464 {
465− /* Asus ExpertBook B1502CBA */
465+ /* Asus ExpertBook B2402 (B2402CBA / B2402FBA / B2402CVA / B2402FVA) */
466466 .matches = {
467467 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
468− DMI_MATCH(DMI_BOARD_NAME, "B1502CBA"),
468+ DMI_MATCH(DMI_BOARD_NAME, "B2402"),
469469 },
470470 },
471471 {
472− /* Asus ExpertBook B1502CGA */
472+ /* Asus ExpertBook B2502 (B2502CBA / B2502FBA / B2502CVA / B2502FVA) */
473473 .matches = {
474474 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
475− DMI_MATCH(DMI_BOARD_NAME, "B1502CGA"),
476− },
477− },
478− {
479− /* Asus ExpertBook B1502CVA */
480− .matches = {
481− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
482− DMI_MATCH(DMI_BOARD_NAME, "B1502CVA"),
483− },
484− },
485− {
486− /* Asus ExpertBook B2402CBA */
487− .matches = {
488− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
489− DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
490− },
491− },
492− {
493− /* Asus ExpertBook B2402FBA */
494− .matches = {
495− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
496− DMI_MATCH(DMI_BOARD_NAME, "B2402FBA"),
497− },
498− },
499− {
500− /* Asus ExpertBook B2502 */
501− .matches = {
502− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
503− DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"),
504− },
505− },
506− {
507− /* Asus ExpertBook B2502FBA */
508− .matches = {
509− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
510− DMI_MATCH(DMI_BOARD_NAME, "B2502FBA"),
511− },
512− },
513− {
514− /* Asus ExpertBook B2502CVA */
515− .matches = {
516− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
517− DMI_MATCH(DMI_BOARD_NAME, "B2502CVA"),
475+ DMI_MATCH(DMI_BOARD_NAME, "B2502"),
518476 },
519477 },
520478 {
@@ -532,31 +490,24 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { · 11 unmodified lines
532490 },
533491 },
534492 {
535− /* Asus Vivobook Pro N6506MV */
536− .matches = {
537− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
538− DMI_MATCH(DMI_BOARD_NAME, "N6506MV"),
539− },
540− },
541− {
542− /* Asus Vivobook Pro N6506MU */
493+ /* Asus Vivobook Pro N6506M* */
543494 .matches = {
544495 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
545− DMI_MATCH(DMI_BOARD_NAME, "N6506MU"),
496+ DMI_MATCH(DMI_BOARD_NAME, "N6506M"),
546497 },
547498 },
548499 {
549− /* Asus Vivobook Pro N6506MJ */
500+ /* LG Electronics 17U70P */
550501 .matches = {
551− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
552− DMI_MATCH(DMI_BOARD_NAME, "N6506MJ"),
502+ DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
503+ DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
553504 },
554505 },
555506 {
556− /* LG Electronics 17U70P */
507+ /* LG Electronics 16T90SP */
557508 .matches = {
558509 DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
559− DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
510+ DMI_MATCH(DMI_BOARD_NAME, "16T90SP"),
560511 },
561512 },
562513 { }
drivers/ata/libata-eh.c+15−4
@@ -651,6 +651,7 @@ void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, · 650 unmodified lines
651651 /* the scmd has an associated qc */
652652 if (!(qc->flags & ATA_QCFLAG_EH)) {
653653 /* which hasn't failed yet, timeout */
654+ set_host_byte(scmd, DID_TIME_OUT);
654655 qc->err_mask |= AC_ERR_TIMEOUT;
655656 qc->flags |= ATA_QCFLAG_EH;
656657 nr_timedout++;
@@ -4099,10 +4100,20 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap) · 3442 unmodified lines
40994100
41004101 WARN_ON(ap->pflags & ATA_PFLAG_SUSPENDED);
41014102
4102− /* Set all devices attached to the port in standby mode */
4103− ata_for_each_link(link, ap, HOST_FIRST) {
4104− ata_for_each_dev(dev, link, ENABLED)
4105− ata_dev_power_set_standby(dev);
4103+ /*
4104+ * We will reach this point for all of the PM events:
4105+ * PM_EVENT_SUSPEND (if runtime pm, PM_EVENT_AUTO will also be set)
4106+ * PM_EVENT_FREEZE, and PM_EVENT_HIBERNATE.
4107+ *
4108+ * We do not want to perform disk spin down for PM_EVENT_FREEZE.
4109+ * (Spin down will be performed by the subsequent PM_EVENT_HIBERNATE.)
4110+ */
4111+ if (!(ap->pm_mesg.event & PM_EVENT_FREEZE)) {
4112+ /* Set all devices attached to the port in standby mode */
4113+ ata_for_each_link(link, ap, HOST_FIRST) {
4114+ ata_for_each_dev(dev, link, ENABLED)
4115+ ata_dev_power_set_standby(dev);
4116+ }
41064117 }
41074118
41084119 /*
drivers/base/core.c+40−8
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <linux/of.h>
2727 #include <linux/of_device.h>
2828 #include <linux/pm_runtime.h>
29−#include <linux/rcupdate.h>
3029 #include <linux/sched/mm.h>
3130 #include <linux/sched/signal.h>
3231 #include <linux/slab.h>
@@ -2634,7 +2633,6 @@ static const char *dev_uevent_name(const struct kobject *kobj) · 2601 unmodified lines
26342633 static int dev_uevent(const struct kobject *kobj, struct kobj_uevent_env *env)
26352634 {
26362635 const struct device *dev = kobj_to_dev(kobj);
2637− struct device_driver *driver;
26382636 int retval = 0;
26392637
26402638 /* add device node properties if present */
@@ -2663,12 +2661,8 @@ static int dev_uevent(const struct kobject *kobj, struct kobj_uevent_env *env) · 22 unmodified lines
26632661 if (dev->type && dev->type->name)
26642662 add_uevent_var(env, "DEVTYPE=%s", dev->type->name);
26652663
2666− /* Synchronize with module_remove_driver() */
2667− rcu_read_lock();
2668− driver = READ_ONCE(dev->driver);
2669− if (driver)
2670− add_uevent_var(env, "DRIVER=%s", driver->name);
2671− rcu_read_unlock();
2664+ if (dev->driver)
2665+ add_uevent_var(env, "DRIVER=%s", dev->driver->name);
26722666
26732667 /* Add common DT information about the device */
26742668 of_device_uevent(dev, env);
@@ -2738,8 +2732,11 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr, · 63 unmodified lines
27382732 if (!env)
27392733 return -ENOMEM;
27402734
2735+ /* Synchronize with really_probe() */
2736+ device_lock(dev);
27412737 /* let the kset specific function add its keys */
27422738 retval = kset->uevent_ops->uevent(&dev->kobj, env);
2739+ device_unlock(dev);
27432740 if (retval)
27442741 goto out;
27452742
@@ -4037,6 +4034,41 @@ int device_for_each_child_reverse(struct device *parent, void *data, · 1291 unmodified lines
40374034 }
40384035 EXPORT_SYMBOL_GPL(device_for_each_child_reverse);
40394036
4037+/**
4038+ * device_for_each_child_reverse_from - device child iterator in reversed order.
4039+ * @parent: parent struct device.
4040+ * @from: optional starting point in child list
4041+ * @fn: function to be called for each device.
4042+ * @data: data for the callback.
4043+ *
4044+ * Iterate over @parent's child devices, starting at @from, and call @fn
4045+ * for each, passing it @data. This helper is identical to
4046+ * device_for_each_child_reverse() when @from is NULL.
4047+ *
4048+ * @fn is checked each iteration. If it returns anything other than 0,
4049+ * iteration stop and that value is returned to the caller of
4050+ * device_for_each_child_reverse_from();
4051+ */
4052+int device_for_each_child_reverse_from(struct device *parent,
4053+ struct device *from, const void *data,
4054+ int (*fn)(struct device *, const void *))
4055+{
4056+ struct klist_iter i;
4057+ struct device *child;
4058+ int error = 0;
4059+
4060+ if (!parent->p)
4061+ return 0;
4062+
4063+ klist_iter_init_node(&parent->p->klist_children, &i,
4064+ (from ? &from->p->knode_parent : NULL));
4065+ while ((child = prev_device(&i)) && !error)
4066+ error = fn(child, data);
4067+ klist_iter_exit(&i);
4068+ return error;
4069+}
4070+EXPORT_SYMBOL_GPL(device_for_each_child_reverse_from);
4071+
40404072 /**
40414073 * device_find_child - device iterator for locating a particular device.
40424074 * @parent: parent struct device
drivers/base/module.c+0−4
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 #include <linux/errno.h>
88 #include <linux/slab.h>
99 #include <linux/string.h>
10−#include <linux/rcupdate.h>
1110 #include "base.h"
1211
1312 static char *make_driver_name(const struct device_driver *drv)
@@ -102,9 +101,6 @@ void module_remove_driver(const struct device_driver *drv) · 88 unmodified lines
102101 if (!drv)
103102 return;
104103
105− /* Synchronize with dev_uevent() */
106− synchronize_rcu();
107−
108104 sysfs_remove_link(&drv->p->kobj, "module");
109105
110106 if (drv->owner)
drivers/base/power/common.c+15−10
@@ -195,6 +195,7 @@ int dev_pm_domain_attach_list(struct device *dev, · 194 unmodified lines
195195 struct device *pd_dev = NULL;
196196 int ret, i, num_pds = 0;
197197 bool by_id = true;
198+ size_t size;
198199 u32 pd_flags = data ? data->pd_flags : 0;
199200 u32 link_flags = pd_flags & PD_FLAG_NO_DEV_LINK ? 0 :
200201 DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME;
@@ -217,19 +218,17 @@ int dev_pm_domain_attach_list(struct device *dev, · 16 unmodified lines
217218 if (num_pds <= 0)
218219 return 0;
219220
220− pds = devm_kzalloc(dev, sizeof(*pds), GFP_KERNEL);
221+ pds = kzalloc(sizeof(*pds), GFP_KERNEL);
221222 if (!pds)
222223 return -ENOMEM;
223224
224− pds->pd_devs = devm_kcalloc(dev, num_pds, sizeof(*pds->pd_devs),
225− GFP_KERNEL);
226− if (!pds->pd_devs)
227− return -ENOMEM;
228−
229− pds->pd_links = devm_kcalloc(dev, num_pds, sizeof(*pds->pd_links),
230− GFP_KERNEL);
231− if (!pds->pd_links)
232− return -ENOMEM;
225+ size = sizeof(*pds->pd_devs) + sizeof(*pds->pd_links);
226+ pds->pd_devs = kcalloc(num_pds, size, GFP_KERNEL);
227+ if (!pds->pd_devs) {
228+ ret = -ENOMEM;
229+ goto free_pds;
230+ }
231+ pds->pd_links = (void *)(pds->pd_devs + num_pds);
233232
234233 if (link_flags && pd_flags & PD_FLAG_DEV_LINK_ON)
235234 link_flags |= DL_FLAG_RPM_ACTIVE;
@@ -272,6 +271,9 @@ err_attach: · 36 unmodified lines
272271 device_link_del(pds->pd_links[i]);
273272 dev_pm_domain_detach(pds->pd_devs[i], true);
274273 }
274+ kfree(pds->pd_devs);
275+free_pds:
276+ kfree(pds);
275277 return ret;
276278 }
277279 EXPORT_SYMBOL_GPL(dev_pm_domain_attach_list);
@@ -363,6 +365,9 @@ void dev_pm_domain_detach_list(struct dev_pm_domain_list *list) · 85 unmodified lines
363365 device_link_del(list->pd_links[i]);
364366 dev_pm_domain_detach(list->pd_devs[i], true);
365367 }
368+
369+ kfree(list->pd_devs);
370+ kfree(list);
366371 }
367372 EXPORT_SYMBOL_GPL(dev_pm_domain_detach_list);
368373
drivers/block/drbd/drbd_int.h+0−1
@@ -1364,7 +1364,6 @@ extern struct bio_set drbd_io_bio_set; · 1363 unmodified lines
13641364
13651365 extern struct mutex resources_mutex;
13661366
1367−extern int conn_lowest_minor(struct drbd_connection *connection);
13681367 extern enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor);
13691368 extern void drbd_destroy_device(struct kref *kref);
13701369 extern void drbd_delete_device(struct drbd_device *device);
drivers/block/drbd/drbd_main.c+0−14
@@ -471,20 +471,6 @@ void _drbd_thread_stop(struct drbd_thread *thi, int restart, int wait) · 470 unmodified lines
471471 wait_for_completion(&thi->stop);
472472 }
473473
474−int conn_lowest_minor(struct drbd_connection *connection)
475−{
476− struct drbd_peer_device *peer_device;
477− int vnr = 0, minor = -1;
478−
479− rcu_read_lock();
480− peer_device = idr_get_next(&connection->peer_devices, &vnr);
481− if (peer_device)
482− minor = device_to_minor(peer_device->device);
483− rcu_read_unlock();
484−
485− return minor;
486−}
487−
488474 #ifdef CONFIG_SMP
489475 /*
490476 * drbd_calc_cpu_mask() - Generate CPU masks, spread over all CPUs
drivers/block/ublk_drv.c+10−1
@@ -2380,10 +2380,19 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd) · 2379 unmodified lines
23802380 * TODO: provide forward progress for RECOVERY handler, so that
23812381 * unprivileged device can benefit from it
23822382 */
2383− if (info.flags & UBLK_F_UNPRIVILEGED_DEV)
2383+ if (info.flags & UBLK_F_UNPRIVILEGED_DEV) {
23842384 info.flags &= ~(UBLK_F_USER_RECOVERY_REISSUE |
23852385 UBLK_F_USER_RECOVERY);
23862386
2387+ /*
2388+ * For USER_COPY, we depends on userspace to fill request
2389+ * buffer by pwrite() to ublk char device, which can't be
2390+ * used for unprivileged device
2391+ */
2392+ if (info.flags & UBLK_F_USER_COPY)
2393+ return -EINVAL;
2394+ }
2395+
23872396 /* the created device is always owned by current user */
23882397 ublk_store_owner_uid_gid(&info.owner_uid, &info.owner_gid);
23892398
drivers/bluetooth/btusb.c+13−6
@@ -1345,10 +1345,15 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags) · 1344 unmodified lines
13451345 if (!urb)
13461346 return -ENOMEM;
13471347
1348− /* Use maximum HCI Event size so the USB stack handles
1349− * ZPL/short-transfer automatically.
1350− */
1351− size = HCI_MAX_EVENT_SIZE;
1348+ if (le16_to_cpu(data->udev->descriptor.idVendor) == 0x0a12 &&
1349+ le16_to_cpu(data->udev->descriptor.idProduct) == 0x0001)
1350+ /* Fake CSR devices don't seem to support sort-transter */
1351+ size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
1352+ else
1353+ /* Use maximum HCI Event size so the USB stack handles
1354+ * ZPL/short-transfer automatically.
1355+ */
1356+ size = HCI_MAX_EVENT_SIZE;
13521357
13531358 buf = kmalloc(size, mem_flags);
13541359 if (!buf) {
@@ -4041,8 +4046,10 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message) · 2686 unmodified lines
40414046
40424047 BT_DBG("intf %p", intf);
40434048
4044− /* Don't suspend if there are connections */
4045− if (hci_conn_count(data->hdev))
4049+ /* Don't auto-suspend if there are connections; external suspend calls
4050+ * shall never fail.
4051+ */
4052+ if (PMSG_IS_AUTO(message) && hci_conn_count(data->hdev))
40464053 return -EBUSY;
40474054
40484055 if (data->suspend_count++)
drivers/cdrom/cdrom.c+1−1
@@ -2313,7 +2313,7 @@ static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi, · 2312 unmodified lines
23132313 return -EINVAL;
23142314
23152315 /* Prevent arg from speculatively bypassing the length check */
2316− barrier_nospec();
2316+ arg = array_index_nospec(arg, cdi->capacity);
23172317
23182318 info = kmalloc(sizeof(*info), GFP_KERNEL);
23192319 if (!info)
drivers/char/tpm/tpm-chip.c+10−0
@@ -674,6 +674,16 @@ EXPORT_SYMBOL_GPL(tpm_chip_register); · 673 unmodified lines
674674 */
675675 void tpm_chip_unregister(struct tpm_chip *chip)
676676 {
677+#ifdef CONFIG_TCG_TPM2_HMAC
678+ int rc;
679+
680+ rc = tpm_try_get_ops(chip);
681+ if (!rc) {
682+ tpm2_end_auth_session(chip);
683+ tpm_put_ops(chip);
684+ }
685+#endif
686+
677687 tpm_del_legacy_sysfs(chip);
678688 if (tpm_is_hwrng_enabled(chip))
679689 hwrng_unregister(&chip->hwrng);
drivers/char/tpm/tpm-dev-common.c+3−0
@@ -27,6 +27,9 @@ static ssize_t tpm_dev_transmit(struct tpm_chip *chip, struct tpm_space *space, · 26 unmodified lines
2727 struct tpm_header *header = (void *)buf;
2828 ssize_t ret, len;
2929
30+ if (chip->flags & TPM_CHIP_FLAG_TPM2)
31+ tpm2_end_auth_session(chip);
32+
3033 ret = tpm2_prepare_space(chip, space, buf, bufsiz);
3134 /* If the command is not implemented by the TPM, synthesize a
3235 * response with a TPM2_RC_COMMAND_CODE return for user-space.
drivers/char/tpm/tpm-interface.c+4−2
@@ -379,10 +379,12 @@ int tpm_pm_suspend(struct device *dev) · 378 unmodified lines
379379
380380 rc = tpm_try_get_ops(chip);
381381 if (!rc) {
382− if (chip->flags & TPM_CHIP_FLAG_TPM2)
382+ if (chip->flags & TPM_CHIP_FLAG_TPM2) {
383+ tpm2_end_auth_session(chip);
383384 tpm2_shutdown(chip, TPM2_SU_STATE);
384− else
385+ } else {
385386 rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);
387+ }
386388
387389 tpm_put_ops(chip);
388390 }
drivers/char/tpm/tpm2-sessions.c+60−40
@@ -333,6 +333,9 @@ void tpm_buf_append_hmac_session(struct tpm_chip *chip, struct tpm_buf *buf, · 332 unmodified lines
333333 }
334334
335335 #ifdef CONFIG_TCG_TPM2_HMAC
336+ /* The first write to /dev/tpm{rm0} will flush the session. */
337+ attributes |= TPM2_SA_CONTINUE_SESSION;
338+
336339 /*
337340 * The Architecture Guide requires us to strip trailing zeros
338341 * before computing the HMAC
@@ -484,7 +487,8 @@ static void tpm2_KDFe(u8 z[EC_PT_SZ], const char *str, u8 *pt_u, u8 *pt_v, · 145 unmodified lines
484487 sha256_final(&sctx, out);
485488 }
486489
487−static void tpm_buf_append_salt(struct tpm_buf *buf, struct tpm_chip *chip)
490+static void tpm_buf_append_salt(struct tpm_buf *buf, struct tpm_chip *chip,
491+ struct tpm2_auth *auth)
488492 {
489493 struct crypto_kpp *kpp;
490494 struct kpp_request *req;
@@ -543,7 +547,7 @@ static void tpm_buf_append_salt(struct tpm_buf *buf, struct tpm_chip *chip) · 52 unmodified lines
543547 sg_set_buf(&s[0], chip->null_ec_key_x, EC_PT_SZ);
544548 sg_set_buf(&s[1], chip->null_ec_key_y, EC_PT_SZ);
545549 kpp_request_set_input(req, s, EC_PT_SZ*2);
546− sg_init_one(d, chip->auth->salt, EC_PT_SZ);
550+ sg_init_one(d, auth->salt, EC_PT_SZ);
547551 kpp_request_set_output(req, d, EC_PT_SZ);
548552 crypto_kpp_compute_shared_secret(req);
549553 kpp_request_free(req);
@@ -554,8 +558,7 @@ static void tpm_buf_append_salt(struct tpm_buf *buf, struct tpm_chip *chip) · 4 unmodified lines
554558 * This works because KDFe fully consumes the secret before it
555559 * writes the salt
556560 */
557− tpm2_KDFe(chip->auth->salt, "SECRET", x, chip->null_ec_key_x,
558− chip->auth->salt);
561+ tpm2_KDFe(auth->salt, "SECRET", x, chip->null_ec_key_x, auth->salt);
559562
560563 out:
561564 crypto_free_kpp(kpp);
@@ -853,7 +856,9 @@ int tpm_buf_check_hmac_response(struct tpm_chip *chip, struct tpm_buf *buf, · 291 unmodified lines
853856 if (rc)
854857 /* manually close the session if it wasn't consumed */
855858 tpm2_flush_context(chip, auth->handle);
856− memzero_explicit(auth, sizeof(*auth));
859+
860+ kfree_sensitive(auth);
861+ chip->auth = NULL;
857862 } else {
858863 /* reset for next use */
859864 auth->session = TPM_HEADER_SIZE;
@@ -881,7 +886,8 @@ void tpm2_end_auth_session(struct tpm_chip *chip) · 21 unmodified lines
881886 return;
882887
883888 tpm2_flush_context(chip, auth->handle);
884− memzero_explicit(auth, sizeof(*auth));
889+ kfree_sensitive(auth);
890+ chip->auth = NULL;
885891 }
886892 EXPORT_SYMBOL(tpm2_end_auth_session);
887893
@@ -915,33 +921,37 @@ static int tpm2_parse_start_auth_session(struct tpm2_auth *auth, · 27 unmodified lines
915921
916922 static int tpm2_load_null(struct tpm_chip *chip, u32 *null_key)
917923 {
918− int rc;
919924 unsigned int offset = 0; /* dummy offset for null seed context */
920925 u8 name[SHA256_DIGEST_SIZE + 2];
926+ u32 tmp_null_key;
927+ int rc;
921928
922929 rc = tpm2_load_context(chip, chip->null_key_context, &offset,
923− null_key);
924− if (rc != -EINVAL)
925− return rc;
930+ &tmp_null_key);
931+ if (rc != -EINVAL) {
932+ if (!rc)
933+ *null_key = tmp_null_key;
934+ goto err;
935+ }
926936
927− /* an integrity failure may mean the TPM has been reset */
928− dev_err(&chip->dev, "NULL key integrity failure!\n");
929− /* check the null name against what we know */
930− tpm2_create_primary(chip, TPM2_RH_NULL, NULL, name);
931− if (memcmp(name, chip->null_key_name, sizeof(name)) == 0)
932− /* name unchanged, assume transient integrity failure */
933− return rc;
934− /*
935− * Fatal TPM failure: the NULL seed has actually changed, so
936− * the TPM must have been illegally reset. All in-kernel TPM
937− * operations will fail because the NULL primary can't be
938− * loaded to salt the sessions, but disable the TPM anyway so
939− * userspace programmes can't be compromised by it.
940− */
941− dev_err(&chip->dev, "NULL name has changed, disabling TPM due to interference\n");
937+ /* Try to re-create null key, given the integrity failure: */
938+ rc = tpm2_create_primary(chip, TPM2_RH_NULL, &tmp_null_key, name);
939+ if (rc)
940+ goto err;
941+
942+ /* Return null key if the name has not been changed: */
943+ if (!memcmp(name, chip->null_key_name, sizeof(name))) {
944+ *null_key = tmp_null_key;
945+ return 0;
946+ }
947+
948+ /* Deduce from the name change TPM interference: */
949+ dev_err(&chip->dev, "null key integrity check failed\n");
950+ tpm2_flush_context(chip, tmp_null_key);
942951 chip->flags |= TPM_CHIP_FLAG_DISABLE;
943952
944− return rc;
953+err:
954+ return rc ? -ENODEV : 0;
945955 }
946956
947957 /**
@@ -958,16 +968,20 @@ static int tpm2_load_null(struct tpm_chip *chip, u32 *null_key) · 10 unmodified lines
958968 */
959969 int tpm2_start_auth_session(struct tpm_chip *chip)
960970 {
971+ struct tpm2_auth *auth;
961972 struct tpm_buf buf;
962− struct tpm2_auth *auth = chip->auth;
963− int rc;
964973 u32 null_key;
974+ int rc;
965975
966− if (!auth) {
967− dev_warn_once(&chip->dev, "auth session is not active\n");
976+ if (chip->auth) {
977+ dev_warn_once(&chip->dev, "auth session is active\n");
968978 return 0;
969979 }
970980
981+ auth = kzalloc(sizeof(*auth), GFP_KERNEL);
982+ if (!auth)
983+ return -ENOMEM;
984+
971985 rc = tpm2_load_null(chip, &null_key);
972986 if (rc)
973987 goto out;
@@ -988,7 +1002,7 @@ int tpm2_start_auth_session(struct tpm_chip *chip) · 14 unmodified lines
9881002 tpm_buf_append(&buf, auth->our_nonce, sizeof(auth->our_nonce));
9891003
9901004 /* append encrypted salt and squirrel away unencrypted in auth */
991− tpm_buf_append_salt(&buf, chip);
1005+ tpm_buf_append_salt(&buf, chip, auth);
9921006 /* session type (HMAC, audit or policy) */
9931007 tpm_buf_append_u8(&buf, TPM2_SE_HMAC);
9941008
@@ -1010,10 +1024,13 @@ int tpm2_start_auth_session(struct tpm_chip *chip) · 15 unmodified lines
10101024
10111025 tpm_buf_destroy(&buf);
10121026
1013− if (rc)
1014− goto out;
1027+ if (rc == TPM2_RC_SUCCESS) {
1028+ chip->auth = auth;
1029+ return 0;
1030+ }
10151031
1016− out:
1032+out:
1033+ kfree_sensitive(auth);
10171034 return rc;
10181035 }
10191036 EXPORT_SYMBOL(tpm2_start_auth_session);
@@ -1347,18 +1364,21 @@ static int tpm2_create_null_primary(struct tpm_chip *chip) · 327 unmodified lines
13471364 *
13481365 * Derive and context save the null primary and allocate memory in the
13491366 * struct tpm_chip for the authorizations.
1367+ *
1368+ * Return:
1369+ * * 0 - OK
1370+ * * -errno - A system error
1371+ * * TPM_RC - A TPM error
13501372 */
13511373 int tpm2_sessions_init(struct tpm_chip *chip)
13521374 {
13531375 int rc;
13541376
13551377 rc = tpm2_create_null_primary(chip);
1356− if (rc)
1357− dev_err(&chip->dev, "TPM: security failed (NULL seed derivation): %d\n", rc);
1358−
1359− chip->auth = kmalloc(sizeof(*chip->auth), GFP_KERNEL);
1360− if (!chip->auth)
1361− return -ENOMEM;
1378+ if (rc) {
1379+ dev_err(&chip->dev, "null key creation failed with %d\n", rc);
1380+ return rc;
1381+ }
13621382
13631383 return rc;
13641384 }
drivers/char/virtio_console.c+10−8
@@ -2006,25 +2006,27 @@ static int virtcons_probe(struct virtio_device *vdev) · 2005 unmodified lines
20062006 multiport = true;
20072007 }
20082008
2009− err = init_vqs(portdev);
2010− if (err < 0) {
2011− dev_err(&vdev->dev, "Error %d initializing vqs\n", err);
2012− goto free_chrdev;
2013− }
2014−
20152009 spin_lock_init(&portdev->ports_lock);
20162010 INIT_LIST_HEAD(&portdev->ports);
20172011 INIT_LIST_HEAD(&portdev->list);
20182012
2019− virtio_device_ready(portdev->vdev);
2020−
20212013 INIT_WORK(&portdev->config_work, &config_work_handler);
20222014 INIT_WORK(&portdev->control_work, &control_work_handler);
20232015
20242016 if (multiport) {
20252017 spin_lock_init(&portdev->c_ivq_lock);
20262018 spin_lock_init(&portdev->c_ovq_lock);
2019+ }
20272020
2021+ err = init_vqs(portdev);
2022+ if (err < 0) {
2023+ dev_err(&vdev->dev, "Error %d initializing vqs\n", err);
2024+ goto free_chrdev;
2025+ }
2026+
2027+ virtio_device_ready(portdev->vdev);
2028+
2029+ if (multiport) {
20282030 err = fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
20292031 if (err < 0) {
20302032 dev_err(&vdev->dev,
drivers/clk/clk_test.c+14−47
@@ -473,7 +473,7 @@ clk_multiple_parents_mux_test_init(struct kunit *test) · 472 unmodified lines
473473 &clk_dummy_rate_ops,
474474 0);
475475 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1;
476− ret = clk_hw_register(NULL, &ctx->parents_ctx[0].hw);
476+ ret = clk_hw_register_kunit(test, NULL, &ctx->parents_ctx[0].hw);
477477 if (ret)
478478 return ret;
479479
@@ -481,7 +481,7 @@ clk_multiple_parents_mux_test_init(struct kunit *test) · 1 unmodified line
481481 &clk_dummy_rate_ops,
482482 0);
483483 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2;
484− ret = clk_hw_register(NULL, &ctx->parents_ctx[1].hw);
484+ ret = clk_hw_register_kunit(test, NULL, &ctx->parents_ctx[1].hw);
485485 if (ret)
486486 return ret;
487487
@@ -489,23 +489,13 @@ clk_multiple_parents_mux_test_init(struct kunit *test) · 1 unmodified line
489489 ctx->hw.init = CLK_HW_INIT_PARENTS("test-mux", parents,
490490 &clk_multiple_parents_mux_ops,
491491 CLK_SET_RATE_PARENT);
492− ret = clk_hw_register(NULL, &ctx->hw);
492+ ret = clk_hw_register_kunit(test, NULL, &ctx->hw);
493493 if (ret)
494494 return ret;
495495
496496 return 0;
497497 }
498498
499−static void
500−clk_multiple_parents_mux_test_exit(struct kunit *test)
501−{
502− struct clk_multiple_parent_ctx *ctx = test->priv;
503−
504− clk_hw_unregister(&ctx->hw);
505− clk_hw_unregister(&ctx->parents_ctx[0].hw);
506− clk_hw_unregister(&ctx->parents_ctx[1].hw);
507−}
508−
509499 /*
510500 * Test that for a clock with multiple parents, clk_get_parent()
511501 * actually returns the current one.
@@ -561,18 +551,18 @@ clk_test_multiple_parents_mux_set_range_set_parent_get_rate(struct kunit *test) · 49 unmodified lines
561551 {
562552 struct clk_multiple_parent_ctx *ctx = test->priv;
563553 struct clk_hw *hw = &ctx->hw;
564− struct clk *clk = clk_hw_get_clk(hw, NULL);
554+ struct clk *clk = clk_hw_get_clk_kunit(test, hw, NULL);
565555 struct clk *parent1, *parent2;
566556 unsigned long rate;
567557 int ret;
568558
569559 kunit_skip(test, "This needs to be fixed in the core.");
570560
571− parent1 = clk_hw_get_clk(&ctx->parents_ctx[0].hw, NULL);
561+ parent1 = clk_hw_get_clk_kunit(test, &ctx->parents_ctx[0].hw, NULL);
572562 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent1);
573563 KUNIT_ASSERT_TRUE(test, clk_is_match(clk_get_parent(clk), parent1));
574564
575− parent2 = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
565+ parent2 = clk_hw_get_clk_kunit(test, &ctx->parents_ctx[1].hw, NULL);
576566 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent2);
577567
578568 ret = clk_set_rate(parent1, DUMMY_CLOCK_RATE_1);
@@ -593,10 +583,6 @@ clk_test_multiple_parents_mux_set_range_set_parent_get_rate(struct kunit *test) · 14 unmodified lines
593583 KUNIT_ASSERT_GT(test, rate, 0);
594584 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 - 1000);
595585 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_1 + 1000);
596−
597− clk_put(parent2);
598− clk_put(parent1);
599− clk_put(clk);
600586 }
601587
602588 static struct kunit_case clk_multiple_parents_mux_test_cases[] = {
@@ -617,7 +603,6 @@ static struct kunit_suite · 14 unmodified lines
617603 clk_multiple_parents_mux_test_suite = {
618604 .name = "clk-multiple-parents-mux-test",
619605 .init = clk_multiple_parents_mux_test_init,
620− .exit = clk_multiple_parents_mux_test_exit,
621606 .test_cases = clk_multiple_parents_mux_test_cases,
622607 };
623608
@@ -637,29 +622,20 @@ clk_orphan_transparent_multiple_parent_mux_test_init(struct kunit *test) · 13 unmodified lines
637622 &clk_dummy_rate_ops,
638623 0);
639624 ctx->parents_ctx[1].rate = DUMMY_CLOCK_INIT_RATE;
640− ret = clk_hw_register(NULL, &ctx->parents_ctx[1].hw);
625+ ret = clk_hw_register_kunit(test, NULL, &ctx->parents_ctx[1].hw);
641626 if (ret)
642627 return ret;
643628
644629 ctx->hw.init = CLK_HW_INIT_PARENTS("test-orphan-mux", parents,
645630 &clk_multiple_parents_mux_ops,
646631 CLK_SET_RATE_PARENT);
647− ret = clk_hw_register(NULL, &ctx->hw);
632+ ret = clk_hw_register_kunit(test, NULL, &ctx->hw);
648633 if (ret)
649634 return ret;
650635
651636 return 0;
652637 }
653638
654−static void
655−clk_orphan_transparent_multiple_parent_mux_test_exit(struct kunit *test)
656−{
657− struct clk_multiple_parent_ctx *ctx = test->priv;
658−
659− clk_hw_unregister(&ctx->hw);
660− clk_hw_unregister(&ctx->parents_ctx[1].hw);
661−}
662−
663639 /*
664640 * Test that, for a mux whose current parent hasn't been registered yet and is
665641 * thus orphan, clk_get_parent() will return NULL.
@@ -912,7 +888,7 @@ clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate(st · 246 unmodified lines
912888 {
913889 struct clk_multiple_parent_ctx *ctx = test->priv;
914890 struct clk_hw *hw = &ctx->hw;
915− struct clk *clk = clk_hw_get_clk(hw, NULL);
891+ struct clk *clk = clk_hw_get_clk_kunit(test, hw, NULL);
916892 struct clk *parent;
917893 unsigned long rate;
918894 int ret;
@@ -921,7 +897,7 @@ clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate(st · 2 unmodified lines
921897
922898 clk_hw_set_rate_range(hw, DUMMY_CLOCK_RATE_1, DUMMY_CLOCK_RATE_2);
923899
924− parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
900+ parent = clk_hw_get_clk_kunit(test, &ctx->parents_ctx[1].hw, NULL);
925901 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent);
926902
927903 ret = clk_set_parent(clk, parent);
@@ -931,9 +907,6 @@ clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate(st · 3 unmodified lines
931907 KUNIT_ASSERT_GT(test, rate, 0);
932908 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1);
933909 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2);
934−
935− clk_put(parent);
936− clk_put(clk);
937910 }
938911
939912 static struct kunit_case clk_orphan_transparent_multiple_parent_mux_test_cases[] = {
@@ -961,7 +934,6 @@ static struct kunit_case clk_orphan_transparent_multiple_parent_mux_test_cases[] · 21 unmodified lines
961934 static struct kunit_suite clk_orphan_transparent_multiple_parent_mux_test_suite = {
962935 .name = "clk-orphan-transparent-multiple-parent-mux-test",
963936 .init = clk_orphan_transparent_multiple_parent_mux_test_init,
964− .exit = clk_orphan_transparent_multiple_parent_mux_test_exit,
965937 .test_cases = clk_orphan_transparent_multiple_parent_mux_test_cases,
966938 };
967939
@@ -986,7 +958,7 @@ static int clk_single_parent_mux_test_init(struct kunit *test) · 18 unmodified lines
986958 &clk_dummy_rate_ops,
987959 0);
988960
989− ret = clk_hw_register(NULL, &ctx->parent_ctx.hw);
961+ ret = clk_hw_register_kunit(test, NULL, &ctx->parent_ctx.hw);
990962 if (ret)
991963 return ret;
992964
@@ -994,7 +966,7 @@ static int clk_single_parent_mux_test_init(struct kunit *test) · 1 unmodified line
994966 &clk_dummy_single_parent_ops,
995967 CLK_SET_RATE_PARENT);
996968
997− ret = clk_hw_register(NULL, &ctx->hw);
969+ ret = clk_hw_register_kunit(test, NULL, &ctx->hw);
998970 if (ret)
999971 return ret;
1000972
@@ -1060,7 +1032,7 @@ clk_test_single_parent_mux_set_range_disjoint_child_last(struct kunit *test) · 59 unmodified lines
10601032 {
10611033 struct clk_single_parent_ctx *ctx = test->priv;
10621034 struct clk_hw *hw = &ctx->hw;
1063− struct clk *clk = clk_hw_get_clk(hw, NULL);
1035+ struct clk *clk = clk_hw_get_clk_kunit(test, hw, NULL);
10641036 struct clk *parent;
10651037 int ret;
10661038
@@ -1074,8 +1046,6 @@ clk_test_single_parent_mux_set_range_disjoint_child_last(struct kunit *test) · 7 unmodified lines
10741046
10751047 ret = clk_set_rate_range(clk, 3000, 4000);
10761048 KUNIT_EXPECT_LT(test, ret, 0);
1077−
1078− clk_put(clk);
10791049 }
10801050
10811051 /*
@@ -1092,7 +1062,7 @@ clk_test_single_parent_mux_set_range_disjoint_parent_last(struct kunit *test) · 10 unmodified lines
10921062 {
10931063 struct clk_single_parent_ctx *ctx = test->priv;
10941064 struct clk_hw *hw = &ctx->hw;
1095− struct clk *clk = clk_hw_get_clk(hw, NULL);
1065+ struct clk *clk = clk_hw_get_clk_kunit(test, hw, NULL);
10961066 struct clk *parent;
10971067 int ret;
10981068
@@ -1106,8 +1076,6 @@ clk_test_single_parent_mux_set_range_disjoint_parent_last(struct kunit *test) · 7 unmodified lines
11061076
11071077 ret = clk_set_rate_range(parent, 3000, 4000);
11081078 KUNIT_EXPECT_LT(test, ret, 0);
1109−
1110− clk_put(clk);
11111079 }
11121080
11131081 /*
@@ -1238,7 +1206,6 @@ static struct kunit_suite · 124 unmodified lines
12381206 clk_single_parent_mux_test_suite = {
12391207 .name = "clk-single-parent-mux-test",
12401208 .init = clk_single_parent_mux_test_init,
1241− .exit = clk_single_parent_mux_test_exit,
12421209 .test_cases = clk_single_parent_mux_test_cases,
12431210 };
12441211
drivers/clk/rockchip/clk.c+1−1
@@ -439,7 +439,7 @@ unsigned long rockchip_clk_find_max_clk_id(struct rockchip_clk_branch *list, · 438 unmodified lines
439439 if (list->id > max)
440440 max = list->id;
441441 if (list->child && list->child->id > max)
442− max = list->id;
442+ max = list->child->id;
443443 }
444444
445445 return max;
drivers/clk/samsung/clk-exynosautov920.c+1−0
@@ -1155,6 +1155,7 @@ static const struct of_device_id exynosautov920_cmu_of_match[] = { · 1154 unmodified lines
11551155 .compatible = "samsung,exynosautov920-cmu-peric0",
11561156 .data = &peric0_cmu_info,
11571157 },
1158+ { }
11581159 };
11591160
11601161 static struct platform_driver exynosautov920_cmu_driver __refdata = {
drivers/cpufreq/amd-pstate.c+24−6
@@ -536,11 +536,16 @@ static int amd_pstate_verify(struct cpufreq_policy_data *policy) · 535 unmodified lines
536536
537537 static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
538538 {
539− u32 max_limit_perf, min_limit_perf, lowest_perf;
539+ u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf;
540540 struct amd_cpudata *cpudata = policy->driver_data;
541541
542− max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
543− min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
542+ if (cpudata->boost_supported && !policy->boost_enabled)
543+ max_perf = READ_ONCE(cpudata->nominal_perf);
544+ else
545+ max_perf = READ_ONCE(cpudata->highest_perf);
546+
547+ max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
548+ min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
544549
545550 lowest_perf = READ_ONCE(cpudata->lowest_perf);
546551 if (min_limit_perf < lowest_perf)
@@ -1201,11 +1206,21 @@ static int amd_pstate_register_driver(int mode) · 654 unmodified lines
12011206 return -EINVAL;
12021207
12031208 cppc_state = mode;
1209+
1210+ ret = amd_pstate_enable(true);
1211+ if (ret) {
1212+ pr_err("failed to enable cppc during amd-pstate driver registration, return %d\n",
1213+ ret);
1214+ amd_pstate_driver_cleanup();
1215+ return ret;
1216+ }
1217+
12041218 ret = cpufreq_register_driver(current_pstate_driver);
12051219 if (ret) {
12061220 amd_pstate_driver_cleanup();
12071221 return ret;
12081222 }
1223+
12091224 return 0;
12101225 }
12111226
@@ -1496,10 +1511,13 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy) · 284 unmodified lines
14961511 u64 value;
14971512 s16 epp;
14981513
1499− max_perf = READ_ONCE(cpudata->highest_perf);
1514+ if (cpudata->boost_supported && !policy->boost_enabled)
1515+ max_perf = READ_ONCE(cpudata->nominal_perf);
1516+ else
1517+ max_perf = READ_ONCE(cpudata->highest_perf);
15001518 min_perf = READ_ONCE(cpudata->lowest_perf);
1501− max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
1502− min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
1519+ max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
1520+ min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
15031521
15041522 if (min_limit_perf < min_perf)
15051523 min_limit_perf = min_perf;
drivers/crypto/marvell/cesa/hash.c+6−6
@@ -947,7 +947,7 @@ struct ahash_alg mv_md5_alg = { · 946 unmodified lines
947947 .base = {
948948 .cra_name = "md5",
949949 .cra_driver_name = "mv-md5",
950− .cra_priority = 300,
950+ .cra_priority = 0,
951951 .cra_flags = CRYPTO_ALG_ASYNC |
952952 CRYPTO_ALG_ALLOCATES_MEMORY |
953953 CRYPTO_ALG_KERN_DRIVER_ONLY,
@@ -1018,7 +1018,7 @@ struct ahash_alg mv_sha1_alg = { · 64 unmodified lines
10181018 .base = {
10191019 .cra_name = "sha1",
10201020 .cra_driver_name = "mv-sha1",
1021− .cra_priority = 300,
1021+ .cra_priority = 0,
10221022 .cra_flags = CRYPTO_ALG_ASYNC |
10231023 CRYPTO_ALG_ALLOCATES_MEMORY |
10241024 CRYPTO_ALG_KERN_DRIVER_ONLY,
@@ -1092,7 +1092,7 @@ struct ahash_alg mv_sha256_alg = { · 67 unmodified lines
10921092 .base = {
10931093 .cra_name = "sha256",
10941094 .cra_driver_name = "mv-sha256",
1095− .cra_priority = 300,
1095+ .cra_priority = 0,
10961096 .cra_flags = CRYPTO_ALG_ASYNC |
10971097 CRYPTO_ALG_ALLOCATES_MEMORY |
10981098 CRYPTO_ALG_KERN_DRIVER_ONLY,
@@ -1302,7 +1302,7 @@ struct ahash_alg mv_ahmac_md5_alg = { · 203 unmodified lines
13021302 .base = {
13031303 .cra_name = "hmac(md5)",
13041304 .cra_driver_name = "mv-hmac-md5",
1305− .cra_priority = 300,
1305+ .cra_priority = 0,
13061306 .cra_flags = CRYPTO_ALG_ASYNC |
13071307 CRYPTO_ALG_ALLOCATES_MEMORY |
13081308 CRYPTO_ALG_KERN_DRIVER_ONLY,
@@ -1373,7 +1373,7 @@ struct ahash_alg mv_ahmac_sha1_alg = { · 64 unmodified lines
13731373 .base = {
13741374 .cra_name = "hmac(sha1)",
13751375 .cra_driver_name = "mv-hmac-sha1",
1376− .cra_priority = 300,
1376+ .cra_priority = 0,
13771377 .cra_flags = CRYPTO_ALG_ASYNC |
13781378 CRYPTO_ALG_ALLOCATES_MEMORY |
13791379 CRYPTO_ALG_KERN_DRIVER_ONLY,
@@ -1444,7 +1444,7 @@ struct ahash_alg mv_ahmac_sha256_alg = { · 64 unmodified lines
14441444 .base = {
14451445 .cra_name = "hmac(sha256)",
14461446 .cra_driver_name = "mv-hmac-sha256",
1447− .cra_priority = 300,
1447+ .cra_priority = 0,
14481448 .cra_flags = CRYPTO_ALG_ASYNC |
14491449 CRYPTO_ALG_ALLOCATES_MEMORY |
14501450 CRYPTO_ALG_KERN_DRIVER_ONLY,
drivers/cxl/Kconfig+1−0
@@ -60,6 +60,7 @@ config CXL_ACPI · 59 unmodified lines
6060 default CXL_BUS
6161 select ACPI_TABLE_LIB
6262 select ACPI_HMAT
63+ select CXL_PORT
6364 help
6465 Enable support for host managed device memory (HDM) resources
6566 published by a platform's ACPI CXL memory layout description. See
drivers/cxl/Makefile+14−6
@@ -1,13 +1,21 @@
11 # SPDX-License-Identifier: GPL-2.0
2+
3+# Order is important here for the built-in case:
4+# - 'core' first for fundamental init
5+# - 'port' before platform root drivers like 'acpi' so that CXL-root ports
6+# are immediately enabled
7+# - 'mem' and 'pmem' before endpoint drivers so that memdevs are
8+# immediately enabled
9+# - 'pci' last, also mirrors the hardware enumeration hierarchy
210 obj-y += core/
3−obj-$(CONFIG_CXL_PCI) += cxl_pci.o
4−obj-$(CONFIG_CXL_MEM) += cxl_mem.o
11+obj-$(CONFIG_CXL_PORT) += cxl_port.o
512 obj-$(CONFIG_CXL_ACPI) += cxl_acpi.o
613 obj-$(CONFIG_CXL_PMEM) += cxl_pmem.o
7−obj-$(CONFIG_CXL_PORT) += cxl_port.o
14+obj-$(CONFIG_CXL_MEM) += cxl_mem.o
15+obj-$(CONFIG_CXL_PCI) += cxl_pci.o
816
9−cxl_mem-y := mem.o
10−cxl_pci-y := pci.o
17+cxl_port-y := port.o
1118 cxl_acpi-y := acpi.o
1219 cxl_pmem-y := pmem.o security.o
13−cxl_port-y := port.o
20+cxl_mem-y := mem.o
21+cxl_pci-y := pci.o
drivers/cxl/acpi.c+7−0
@@ -924,6 +924,13 @@ static void __exit cxl_acpi_exit(void) · 923 unmodified lines
924924
925925 /* load before dax_hmem sees 'Soft Reserved' CXL ranges */
926926 subsys_initcall(cxl_acpi_init);
927+
928+/*
929+ * Arrange for host-bridge ports to be active synchronous with
930+ * cxl_acpi_probe() exit.
931+ */
932+MODULE_SOFTDEP("pre: cxl_port");
933+
927934 module_exit(cxl_acpi_exit);
928935 MODULE_DESCRIPTION("CXL ACPI: Platform Support");
929936 MODULE_LICENSE("GPL v2");
drivers/cxl/core/cdat.c+3−0
@@ -641,6 +641,9 @@ static int cxl_endpoint_gather_bandwidth(struct cxl_region *cxlr, · 640 unmodified lines
641641 void *ptr;
642642 int rc;
643643
644+ if (!dev_is_pci(cxlds->dev))
645+ return -ENODEV;
646+
644647 if (cxlds->rcd)
645648 return -ENODEV;
646649
drivers/cxl/core/hdm.c+42−8
@@ -712,7 +712,44 @@ static int cxl_decoder_commit(struct cxl_decoder *cxld) · 711 unmodified lines
712712 return 0;
713713 }
714714
715−static int cxl_decoder_reset(struct cxl_decoder *cxld)
715+static int commit_reap(struct device *dev, const void *data)
716+{
717+ struct cxl_port *port = to_cxl_port(dev->parent);
718+ struct cxl_decoder *cxld;
719+
720+ if (!is_switch_decoder(dev) && !is_endpoint_decoder(dev))
721+ return 0;
722+
723+ cxld = to_cxl_decoder(dev);
724+ if (port->commit_end == cxld->id &&
725+ ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)) {
726+ port->commit_end--;
727+ dev_dbg(&port->dev, "reap: %s commit_end: %d\n",
728+ dev_name(&cxld->dev), port->commit_end);
729+ }
730+
731+ return 0;
732+}
733+
734+void cxl_port_commit_reap(struct cxl_decoder *cxld)
735+{
736+ struct cxl_port *port = to_cxl_port(cxld->dev.parent);
737+
738+ lockdep_assert_held_write(&cxl_region_rwsem);
739+
740+ /*
741+ * Once the highest committed decoder is disabled, free any other
742+ * decoders that were pinned allocated by out-of-order release.
743+ */
744+ port->commit_end--;
745+ dev_dbg(&port->dev, "reap: %s commit_end: %d\n", dev_name(&cxld->dev),
746+ port->commit_end);
747+ device_for_each_child_reverse_from(&port->dev, &cxld->dev, NULL,
748+ commit_reap);
749+}
750+EXPORT_SYMBOL_NS_GPL(cxl_port_commit_reap, CXL);
751+
752+static void cxl_decoder_reset(struct cxl_decoder *cxld)
716753 {
717754 struct cxl_port *port = to_cxl_port(cxld->dev.parent);
718755 struct cxl_hdm *cxlhdm = dev_get_drvdata(&port->dev);
@@ -721,14 +758,14 @@ static int cxl_decoder_reset(struct cxl_decoder *cxld) · 2 unmodified lines
721758 u32 ctrl;
722759
723760 if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)
724− return 0;
761+ return;
725762
726− if (port->commit_end != id) {
763+ if (port->commit_end == id)
764+ cxl_port_commit_reap(cxld);
765+ else
727766 dev_dbg(&port->dev,
728767 "%s: out of order reset, expected decoder%d.%d\n",
729768 dev_name(&cxld->dev), port->id, port->commit_end);
730− return -EBUSY;
731− }
732769
733770 down_read(&cxl_dpa_rwsem);
734771 ctrl = readl(hdm + CXL_HDM_DECODER0_CTRL_OFFSET(id));
@@ -741,7 +778,6 @@ static int cxl_decoder_reset(struct cxl_decoder *cxld) · 6 unmodified lines
741778 writel(0, hdm + CXL_HDM_DECODER0_BASE_LOW_OFFSET(id));
742779 up_read(&cxl_dpa_rwsem);
743780
744− port->commit_end--;
745781 cxld->flags &= ~CXL_DECODER_F_ENABLE;
746782
747783 /* Userspace is now responsible for reconfiguring this decoder */
@@ -751,8 +787,6 @@ static int cxl_decoder_reset(struct cxl_decoder *cxld) · 3 unmodified lines
751787 cxled = to_cxl_endpoint_decoder(&cxld->dev);
752788 cxled->state = CXL_DECODER_STATE_MANUAL;
753789 }
754−
755− return 0;
756790 }
757791
758792 static int cxl_setup_hdm_decoder_from_dvsec(
drivers/cxl/core/port.c+10−3
@@ -2084,11 +2084,18 @@ static void cxl_bus_remove(struct device *dev) · 2083 unmodified lines
20842084
20852085 static struct workqueue_struct *cxl_bus_wq;
20862086
2087−static void cxl_bus_rescan_queue(struct work_struct *w)
2087+static int cxl_rescan_attach(struct device *dev, void *data)
20882088 {
2089− int rc = bus_rescan_devices(&cxl_bus_type);
2089+ int rc = device_attach(dev);
2090+
2091+ dev_vdbg(dev, "rescan: %s\n", rc ? "attach" : "detached");
20902092
2091− pr_debug("CXL bus rescan result: %d\n", rc);
2093+ return 0;
2094+}
2095+
2096+static void cxl_bus_rescan_queue(struct work_struct *w)
2097+{
2098+ bus_for_each_dev(&cxl_bus_type, NULL, NULL, cxl_rescan_attach);
20922099 }
20932100
20942101 void cxl_bus_rescan(void)
drivers/cxl/core/region.c+46−45
@@ -232,8 +232,8 @@ static int cxl_region_invalidate_memregion(struct cxl_region *cxlr) · 231 unmodified lines
232232 "Bypassing cpu_cache_invalidate_memregion() for testing!\n");
233233 return 0;
234234 } else {
235− dev_err(&cxlr->dev,
236− "Failed to synchronize CPU cache state\n");
235+ dev_WARN(&cxlr->dev,
236+ "Failed to synchronize CPU cache state\n");
237237 return -ENXIO;
238238 }
239239 }
@@ -242,19 +242,17 @@ static int cxl_region_invalidate_memregion(struct cxl_region *cxlr) · 2 unmodified lines
242242 return 0;
243243 }
244244
245−static int cxl_region_decode_reset(struct cxl_region *cxlr, int count)
245+static void cxl_region_decode_reset(struct cxl_region *cxlr, int count)
246246 {
247247 struct cxl_region_params *p = &cxlr->params;
248− int i, rc = 0;
248+ int i;
249249
250250 /*
251− * Before region teardown attempt to flush, and if the flush
252− * fails cancel the region teardown for data consistency
253− * concerns
251+ * Before region teardown attempt to flush, evict any data cached for
252+ * this region, or scream loudly about missing arch / platform support
253+ * for CXL teardown.
254254 */
255− rc = cxl_region_invalidate_memregion(cxlr);
256− if (rc)
257− return rc;
255+ cxl_region_invalidate_memregion(cxlr);
258256
259257 for (i = count - 1; i >= 0; i--) {
260258 struct cxl_endpoint_decoder *cxled = p->targets[i];
@@ -277,23 +275,17 @@ static int cxl_region_decode_reset(struct cxl_region *cxlr, int count) · 16 unmodified lines
277275 cxl_rr = cxl_rr_load(iter, cxlr);
278276 cxld = cxl_rr->decoder;
279277 if (cxld->reset)
280− rc = cxld->reset(cxld);
281− if (rc)
282− return rc;
278+ cxld->reset(cxld);
283279 set_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags);
284280 }
285281
286282 endpoint_reset:
287− rc = cxled->cxld.reset(&cxled->cxld);
288− if (rc)
289− return rc;
283+ cxled->cxld.reset(&cxled->cxld);
290284 set_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags);
291285 }
292286
293287 /* all decoders associated with this region have been torn down */
294288 clear_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags);
295−
296− return 0;
297289 }
298290
299291 static int commit_decoder(struct cxl_decoder *cxld)
@@ -409,16 +401,8 @@ static ssize_t commit_store(struct device *dev, struct device_attribute *attr, · 109 unmodified lines
409401 * still pending.
410402 */
411403 if (p->state == CXL_CONFIG_RESET_PENDING) {
412− rc = cxl_region_decode_reset(cxlr, p->interleave_ways);
413− /*
414− * Revert to committed since there may still be active
415− * decoders associated with this region, or move forward
416− * to active to mark the reset successful
417− */
418− if (rc)
419− p->state = CXL_CONFIG_COMMIT;
420− else
421− p->state = CXL_CONFIG_ACTIVE;
404+ cxl_region_decode_reset(cxlr, p->interleave_ways);
405+ p->state = CXL_CONFIG_ACTIVE;
422406 }
423407 }
424408
@@ -794,26 +778,50 @@ out: · 369 unmodified lines
794778 return rc;
795779 }
796780
781+static int check_commit_order(struct device *dev, const void *data)
782+{
783+ struct cxl_decoder *cxld = to_cxl_decoder(dev);
784+
785+ /*
786+ * if port->commit_end is not the only free decoder, then out of
787+ * order shutdown has occurred, block further allocations until
788+ * that is resolved
789+ */
790+ if (((cxld->flags & CXL_DECODER_F_ENABLE) == 0))
791+ return -EBUSY;
792+ return 0;
793+}
794+
797795 static int match_free_decoder(struct device *dev, void *data)
798796 {
797+ struct cxl_port *port = to_cxl_port(dev->parent);
799798 struct cxl_decoder *cxld;
800− int *id = data;
799+ int rc;
801800
802801 if (!is_switch_decoder(dev))
803802 return 0;
804803
805804 cxld = to_cxl_decoder(dev);
806805
807− /* enforce ordered allocation */
808− if (cxld->id != *id)
806+ if (cxld->id != port->commit_end + 1)
809807 return 0;
810808
811− if (!cxld->region)
812− return 1;
813−
814− (*id)++;
809+ if (cxld->region) {
810+ dev_dbg(dev->parent,
811+ "next decoder to commit (%s) is already reserved (%s)\n",
812+ dev_name(dev), dev_name(&cxld->region->dev));
813+ return 0;
814+ }
815815
816− return 0;
816+ rc = device_for_each_child_reverse_from(dev->parent, dev, NULL,
817+ check_commit_order);
818+ if (rc) {
819+ dev_dbg(dev->parent,
820+ "unable to allocate %s due to out of order shutdown\n",
821+ dev_name(dev));
822+ return 0;
823+ }
824+ return 1;
817825 }
818826
819827 static int match_auto_decoder(struct device *dev, void *data)
@@ -840,7 +848,6 @@ cxl_region_find_decoder(struct cxl_port *port, · 20 unmodified lines
840848 struct cxl_region *cxlr)
841849 {
842850 struct device *dev;
843− int id = 0;
844851
845852 if (port == cxled_to_port(cxled))
846853 return &cxled->cxld;
@@ -849,7 +856,7 @@ cxl_region_find_decoder(struct cxl_port *port, · 2 unmodified lines
849856 dev = device_find_child(&port->dev, &cxlr->params,
850857 match_auto_decoder);
851858 else
852− dev = device_find_child(&port->dev, &id, match_free_decoder);
859+ dev = device_find_child(&port->dev, NULL, match_free_decoder);
853860 if (!dev)
854861 return NULL;
855862 /*
@@ -2054,13 +2061,7 @@ static int cxl_region_detach(struct cxl_endpoint_decoder *cxled) · 1198 unmodified lines
20542061 get_device(&cxlr->dev);
20552062
20562063 if (p->state > CXL_CONFIG_ACTIVE) {
2057− /*
2058− * TODO: tear down all impacted regions if a device is
2059− * removed out of order
2060− */
2061− rc = cxl_region_decode_reset(cxlr, p->interleave_ways);
2062− if (rc)
2063− goto out;
2064+ cxl_region_decode_reset(cxlr, p->interleave_ways);
20642065 p->state = CXL_CONFIG_ACTIVE;
20652066 }
20662067
drivers/cxl/core/trace.h+14−3
@@ -279,7 +279,7 @@ TRACE_EVENT(cxl_generic_event, · 278 unmodified lines
279279 #define CXL_GMER_MEM_EVT_TYPE_ECC_ERROR 0x00
280280 #define CXL_GMER_MEM_EVT_TYPE_INV_ADDR 0x01
281281 #define CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x02
282−#define show_mem_event_type(type) __print_symbolic(type, \
282+#define show_gmer_mem_event_type(type) __print_symbolic(type, \
283283 { CXL_GMER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \
284284 { CXL_GMER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \
285285 { CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \
@@ -373,7 +373,7 @@ TRACE_EVENT(cxl_general_media, · 87 unmodified lines
373373 "hpa=%llx region=%s region_uuid=%pUb",
374374 __entry->dpa, show_dpa_flags(__entry->dpa_flags),
375375 show_event_desc_flags(__entry->descriptor),
376− show_mem_event_type(__entry->type),
376+ show_gmer_mem_event_type(__entry->type),
377377 show_trans_type(__entry->transaction_type),
378378 __entry->channel, __entry->rank, __entry->device,
379379 __print_hex(__entry->comp_id, CXL_EVENT_GEN_MED_COMP_ID_SIZE),
@@ -391,6 +391,17 @@ TRACE_EVENT(cxl_general_media, · 11 unmodified lines
391391 * DRAM Event Record defines many fields the same as the General Media Event
392392 * Record. Reuse those definitions as appropriate.
393393 */
394+#define CXL_DER_MEM_EVT_TYPE_ECC_ERROR 0x00
395+#define CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR 0x01
396+#define CXL_DER_MEM_EVT_TYPE_INV_ADDR 0x02
397+#define CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x03
398+#define show_dram_mem_event_type(type) __print_symbolic(type, \
399+ { CXL_DER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \
400+ { CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR, "Scrub Media ECC Error" }, \
401+ { CXL_DER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \
402+ { CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \
403+)
404+
394405 #define CXL_DER_VALID_CHANNEL BIT(0)
395406 #define CXL_DER_VALID_RANK BIT(1)
396407 #define CXL_DER_VALID_NIBBLE BIT(2)
@@ -477,7 +488,7 @@ TRACE_EVENT(cxl_dram, · 80 unmodified lines
477488 "hpa=%llx region=%s region_uuid=%pUb",
478489 __entry->dpa, show_dpa_flags(__entry->dpa_flags),
479490 show_event_desc_flags(__entry->descriptor),
480− show_mem_event_type(__entry->type),
491+ show_dram_mem_event_type(__entry->type),
481492 show_trans_type(__entry->transaction_type),
482493 __entry->channel, __entry->rank, __entry->nibble_mask,
483494 __entry->bank_group, __entry->bank,
drivers/cxl/cxl.h+2−1
@@ -359,7 +359,7 @@ struct cxl_decoder { · 358 unmodified lines
359359 struct cxl_region *region;
360360 unsigned long flags;
361361 int (*commit)(struct cxl_decoder *cxld);
362− int (*reset)(struct cxl_decoder *cxld);
362+ void (*reset)(struct cxl_decoder *cxld);
363363 };
364364
365365 /*
@@ -730,6 +730,7 @@ static inline bool is_cxl_root(struct cxl_port *port) · 364 unmodified lines
730730 int cxl_num_decoders_committed(struct cxl_port *port);
731731 bool is_cxl_port(const struct device *dev);
732732 struct cxl_port *to_cxl_port(const struct device *dev);
733+void cxl_port_commit_reap(struct cxl_decoder *cxld);
733734 struct pci_bus;
734735 int devm_cxl_register_pci_bus(struct device *host, struct device *uport_dev,
735736 struct pci_bus *bus);
drivers/cxl/port.c+16−1
@@ -208,7 +208,22 @@ static struct cxl_driver cxl_port_driver = { · 207 unmodified lines
208208 },
209209 };
210210
211−module_cxl_driver(cxl_port_driver);
211+static int __init cxl_port_init(void)
212+{
213+ return cxl_driver_register(&cxl_port_driver);
214+}
215+/*
216+ * Be ready to immediately enable ports emitted by the platform CXL root
217+ * (e.g. cxl_acpi) when CONFIG_CXL_PORT=y.
218+ */
219+subsys_initcall(cxl_port_init);
220+
221+static void __exit cxl_port_exit(void)
222+{
223+ cxl_driver_unregister(&cxl_port_driver);
224+}
225+module_exit(cxl_port_exit);
226+
212227 MODULE_DESCRIPTION("CXL: Port enumeration and services");
213228 MODULE_LICENSE("GPL v2");
214229 MODULE_IMPORT_NS(CXL);
drivers/dax/device.c+1−1
@@ -86,7 +86,7 @@ static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn, · 85 unmodified lines
8686 nr_pages = 1;
8787
8888 pgoff = linear_page_index(vmf->vma,
89− ALIGN(vmf->address, fault_size));
89+ ALIGN_DOWN(vmf->address, fault_size));
9090
9191 for (i = 0; i < nr_pages; i++) {
9292 struct page *page = pfn_to_page(pfn_t_to_pfn(pfn) + i);
drivers/dma/ep93xx_dma.c+6−3
@@ -1391,11 +1391,12 @@ static struct ep93xx_dma_engine *ep93xx_dma_of_probe(struct platform_device *pde · 1390 unmodified lines
13911391 INIT_LIST_HEAD(&dma_dev->channels);
13921392 for (i = 0; i < edma->num_channels; i++) {
13931393 struct ep93xx_dma_chan *edmac = &edma->channels[i];
1394+ int len;
13941395
13951396 edmac->chan.device = dma_dev;
13961397 edmac->regs = devm_platform_ioremap_resource(pdev, i);
13971398 if (IS_ERR(edmac->regs))
1398− return edmac->regs;
1399+ return ERR_CAST(edmac->regs);
13991400
14001401 edmac->irq = fwnode_irq_get(dev_fwnode(dev), i);
14011402 if (edmac->irq < 0)
@@ -1404,9 +1405,11 @@ static struct ep93xx_dma_engine *ep93xx_dma_of_probe(struct platform_device *pde · 2 unmodified lines
14041405 edmac->edma = edma;
14051406
14061407 if (edma->m2m)
1407− snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i);
1408+ len = snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i);
14081409 else
1409− snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i);
1410+ len = snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i);
1411+ if (len >= sizeof(dma_clk_name))
1412+ return ERR_PTR(-ENOBUFS);
14101413
14111414 edmac->clk = devm_clk_get(dev, dma_clk_name);
14121415 if (IS_ERR(edmac->clk)) {
drivers/dma/sh/rz-dmac.c+14−11
@@ -601,22 +601,25 @@ static int rz_dmac_config(struct dma_chan *chan, · 600 unmodified lines
601601 struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
602602 u32 val;
603603
604− channel->src_per_address = config->src_addr;
605604 channel->dst_per_address = config->dst_addr;
606−
607− val = rz_dmac_ds_to_val_mapping(config->dst_addr_width);
608− if (val == CHCFG_DS_INVALID)
609− return -EINVAL;
610−
611605 channel->chcfg &= ~CHCFG_FILL_DDS_MASK;
612− channel->chcfg |= FIELD_PREP(CHCFG_FILL_DDS_MASK, val);
606+ if (channel->dst_per_address) {
607+ val = rz_dmac_ds_to_val_mapping(config->dst_addr_width);
608+ if (val == CHCFG_DS_INVALID)
609+ return -EINVAL;
613610
614− val = rz_dmac_ds_to_val_mapping(config->src_addr_width);
615− if (val == CHCFG_DS_INVALID)
616− return -EINVAL;
611+ channel->chcfg |= FIELD_PREP(CHCFG_FILL_DDS_MASK, val);
612+ }
617613
614+ channel->src_per_address = config->src_addr;
618615 channel->chcfg &= ~CHCFG_FILL_SDS_MASK;
619− channel->chcfg |= FIELD_PREP(CHCFG_FILL_SDS_MASK, val);
616+ if (channel->src_per_address) {
617+ val = rz_dmac_ds_to_val_mapping(config->src_addr_width);
618+ if (val == CHCFG_DS_INVALID)
619+ return -EINVAL;
620+
621+ channel->chcfg |= FIELD_PREP(CHCFG_FILL_SDS_MASK, val);
622+ }
620623
621624 return 0;
622625 }
drivers/dma/ti/k3-udma.c+47−15
@@ -3185,27 +3185,40 @@ static int udma_configure_statictr(struct udma_chan *uc, struct udma_desc *d, · 3184 unmodified lines
31853185
31863186 d->static_tr.elcnt = elcnt;
31873187
3188− /*
3189− * PDMA must to close the packet when the channel is in packet mode.
3190− * For TR mode when the channel is not cyclic we also need PDMA to close
3191− * the packet otherwise the transfer will stall because PDMA holds on
3192− * the data it has received from the peripheral.
3193− */
31943188 if (uc->config.pkt_mode || !uc->cyclic) {
3189+ /*
3190+ * PDMA must close the packet when the channel is in packet mode.
3191+ * For TR mode when the channel is not cyclic we also need PDMA
3192+ * to close the packet otherwise the transfer will stall because
3193+ * PDMA holds on the data it has received from the peripheral.
3194+ */
31953195 unsigned int div = dev_width * elcnt;
31963196
31973197 if (uc->cyclic)
31983198 d->static_tr.bstcnt = d->residue / d->sglen / div;
31993199 else
32003200 d->static_tr.bstcnt = d->residue / div;
3201+ } else if (uc->ud->match_data->type == DMA_TYPE_BCDMA &&
3202+ uc->config.dir == DMA_DEV_TO_MEM &&
3203+ uc->cyclic) {
3204+ /*
3205+ * For cyclic mode with BCDMA we have to set EOP in each TR to
3206+ * prevent short packet errors seen on channel teardown. So the
3207+ * PDMA must close the packet after every TR transfer by setting
3208+ * burst count equal to the number of bytes transferred.
3209+ */
3210+ struct cppi5_tr_type1_t *tr_req = d->hwdesc[0].tr_req_base;
32013211
3202− if (uc->config.dir == DMA_DEV_TO_MEM &&
3203− d->static_tr.bstcnt > uc->ud->match_data->statictr_z_mask)
3204− return -EINVAL;
3212+ d->static_tr.bstcnt =
3213+ (tr_req->icnt0 * tr_req->icnt1) / dev_width;
32053214 } else {
32063215 d->static_tr.bstcnt = 0;
32073216 }
32083217
3218+ if (uc->config.dir == DMA_DEV_TO_MEM &&
3219+ d->static_tr.bstcnt > uc->ud->match_data->statictr_z_mask)
3220+ return -EINVAL;
3221+
32093222 return 0;
32103223 }
32113224
@@ -3450,8 +3463,9 @@ udma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, · 238 unmodified lines
34503463 /* static TR for remote PDMA */
34513464 if (udma_configure_statictr(uc, d, dev_width, burst)) {
34523465 dev_err(uc->ud->dev,
3453− "%s: StaticTR Z is limited to maximum 4095 (%u)\n",
3454− __func__, d->static_tr.bstcnt);
3466+ "%s: StaticTR Z is limited to maximum %u (%u)\n",
3467+ __func__, uc->ud->match_data->statictr_z_mask,
3468+ d->static_tr.bstcnt);
34553469
34563470 udma_free_hwdesc(uc, d);
34573471 kfree(d);
@@ -3476,6 +3490,7 @@ udma_prep_dma_cyclic_tr(struct udma_chan *uc, dma_addr_t buf_addr, · 18 unmodified lines
34763490 u16 tr0_cnt0, tr0_cnt1, tr1_cnt0;
34773491 unsigned int i;
34783492 int num_tr;
3493+ u32 period_csf = 0;
34793494
34803495 num_tr = udma_get_tr_counters(period_len, __ffs(buf_addr), &tr0_cnt0,
34813496 &tr0_cnt1, &tr1_cnt0);
@@ -3498,6 +3513,20 @@ udma_prep_dma_cyclic_tr(struct udma_chan *uc, dma_addr_t buf_addr, · 16 unmodified lines
34983513 period_addr = buf_addr |
34993514 ((u64)uc->config.asel << K3_ADDRESS_ASEL_SHIFT);
35003515
3516+ /*
3517+ * For BCDMA <-> PDMA transfers, the EOP flag needs to be set on the
3518+ * last TR of a descriptor, to mark the packet as complete.
3519+ * This is required for getting the teardown completion message in case
3520+ * of TX, and to avoid short-packet error in case of RX.
3521+ *
3522+ * As we are in cyclic mode, we do not know which period might be the
3523+ * last one, so set the flag for each period.
3524+ */
3525+ if (uc->config.ep_type == PSIL_EP_PDMA_XY &&
3526+ uc->ud->match_data->type == DMA_TYPE_BCDMA) {
3527+ period_csf = CPPI5_TR_CSF_EOP;
3528+ }
3529+
35013530 for (i = 0; i < periods; i++) {
35023531 int tr_idx = i * num_tr;
35033532
@@ -3525,8 +3554,10 @@ udma_prep_dma_cyclic_tr(struct udma_chan *uc, dma_addr_t buf_addr, · 21 unmodified lines
35253554 }
35263555
35273556 if (!(flags & DMA_PREP_INTERRUPT))
3528− cppi5_tr_csf_set(&tr_req[tr_idx].flags,
3529− CPPI5_TR_CSF_SUPR_EVT);
3557+ period_csf |= CPPI5_TR_CSF_SUPR_EVT;
3558+
3559+ if (period_csf)
3560+ cppi5_tr_csf_set(&tr_req[tr_idx].flags, period_csf);
35303561
35313562 period_addr += period_len;
35323563 }
@@ -3655,8 +3686,9 @@ udma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, · 122 unmodified lines
36553686 /* static TR for remote PDMA */
36563687 if (udma_configure_statictr(uc, d, dev_width, burst)) {
36573688 dev_err(uc->ud->dev,
3658− "%s: StaticTR Z is limited to maximum 4095 (%u)\n",
3659− __func__, d->static_tr.bstcnt);
3689+ "%s: StaticTR Z is limited to maximum %u (%u)\n",
3690+ __func__, uc->ud->match_data->statictr_z_mask,
3691+ d->static_tr.bstcnt);
36603692
36613693 udma_free_hwdesc(uc, d);
36623694 kfree(d);
drivers/firewire/core-topology.c+1−1
@@ -204,7 +204,7 @@ static struct fw_node *build_tree(struct fw_card *card, const u32 *sid, int self · 203 unmodified lines
204204 // the node->ports array where the parent node should be. Later,
205205 // when we handle the parent node, we fix up the reference.
206206 ++parent_count;
207− node->color = i;
207+ node->color = port_index;
208208 break;
209209
210210 case PHY_PACKET_SELF_ID_PORT_STATUS_CHILD:
drivers/firmware/arm_ffa/driver.c+9−4
@@ -481,11 +481,16 @@ static int ffa_msg_send_direct_req2(u16 src_id, u16 dst_id, const uuid_t *uuid, · 480 unmodified lines
481481 struct ffa_send_direct_data2 *data)
482482 {
483483 u32 src_dst_ids = PACK_TARGET_INFO(src_id, dst_id);
484+ union {
485+ uuid_t uuid;
486+ __le64 regs[2];
487+ } uuid_regs = { .uuid = *uuid };
484488 ffa_value_t ret, args = {
485− .a0 = FFA_MSG_SEND_DIRECT_REQ2, .a1 = src_dst_ids,
489+ .a0 = FFA_MSG_SEND_DIRECT_REQ2,
490+ .a1 = src_dst_ids,
491+ .a2 = le64_to_cpu(uuid_regs.regs[0]),
492+ .a3 = le64_to_cpu(uuid_regs.regs[1]),
486493 };
487−
488− export_uuid((u8 *)&args.a2, uuid);
489494 memcpy((void *)&args + offsetof(ffa_value_t, a4), data, sizeof(*data));
490495
491496 invoke_ffa_fn(args, &ret);
@@ -496,7 +501,7 @@ static int ffa_msg_send_direct_req2(u16 src_id, u16 dst_id, const uuid_t *uuid, · 4 unmodified lines
496501 return ffa_to_linux_errno((int)ret.a2);
497502
498503 if (ret.a0 == FFA_MSG_SEND_DIRECT_RESP2) {
499− memcpy(data, &ret.a4, sizeof(*data));
504+ memcpy(data, (void *)&ret + offsetof(ffa_value_t, a4), sizeof(*data));
500505 return 0;
501506 }
502507
drivers/firmware/arm_scmi/driver.c+1−3
@@ -2976,10 +2976,8 @@ static struct scmi_debug_info *scmi_debugfs_common_setup(struct scmi_info *info) · 2975 unmodified lines
29762976 dbg->top_dentry = top_dentry;
29772977
29782978 if (devm_add_action_or_reset(info->dev,
2979− scmi_debugfs_common_cleanup, dbg)) {
2980− scmi_debugfs_common_cleanup(dbg);
2979+ scmi_debugfs_common_cleanup, dbg))
29812980 return NULL;
2982− }
29832981
29842982 return dbg;
29852983 }
drivers/firmware/arm_scmi/transports/Makefile+4−2
@@ -1,8 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0-only
2−scmi_transport_mailbox-objs := mailbox.o
3−obj-$(CONFIG_ARM_SCMI_TRANSPORT_MAILBOX) += scmi_transport_mailbox.o
2+# Keep before scmi_transport_mailbox.o to allow precedence
3+# while matching the compatible.
44 scmi_transport_smc-objs := smc.o
55 obj-$(CONFIG_ARM_SCMI_TRANSPORT_SMC) += scmi_transport_smc.o
6+scmi_transport_mailbox-objs := mailbox.o
7+obj-$(CONFIG_ARM_SCMI_TRANSPORT_MAILBOX) += scmi_transport_mailbox.o
68 scmi_transport_optee-objs := optee.o
79 obj-$(CONFIG_ARM_SCMI_TRANSPORT_OPTEE) += scmi_transport_optee.o
810 scmi_transport_virtio-objs := virtio.o
drivers/firmware/arm_scmi/transports/mailbox.c+21−11
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 * @chan_platform_receiver: Optional Platform Receiver mailbox unidirectional channel
2626 * @cinfo: SCMI channel info
2727 * @shmem: Transmit/Receive shared memory area
28+ * @chan_lock: Lock that prevents multiple xfers from being queued
2829 */
2930 struct scmi_mailbox {
3031 struct mbox_client cl;
@@ -33,6 +34,7 @@ struct scmi_mailbox { · 2 unmodified lines
3334 struct mbox_chan *chan_platform_receiver;
3435 struct scmi_chan_info *cinfo;
3536 struct scmi_shared_mem __iomem *shmem;
37+ struct mutex chan_lock;
3638 };
3739
3840 #define client_to_scmi_mailbox(c) container_of(c, struct scmi_mailbox, cl)
@@ -238,6 +240,7 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, · 199 unmodified lines
238240
239241 cinfo->transport_info = smbox;
240242 smbox->cinfo = cinfo;
243+ mutex_init(&smbox->chan_lock);
241244
242245 return 0;
243246 }
@@ -267,13 +270,23 @@ static int mailbox_send_message(struct scmi_chan_info *cinfo, · 23 unmodified lines
267270 struct scmi_mailbox *smbox = cinfo->transport_info;
268271 int ret;
269272
270− ret = mbox_send_message(smbox->chan, xfer);
273+ /*
274+ * The mailbox layer has its own queue. However the mailbox queue
275+ * confuses the per message SCMI timeouts since the clock starts when
276+ * the message is submitted into the mailbox queue. So when multiple
277+ * messages are queued up the clock starts on all messages instead of
278+ * only the one inflight.
279+ */
280+ mutex_lock(&smbox->chan_lock);
271281
272− /* mbox_send_message returns non-negative value on success, so reset */
273− if (ret > 0)
274− ret = 0;
282+ ret = mbox_send_message(smbox->chan, xfer);
283+ /* mbox_send_message returns non-negative value on success */
284+ if (ret < 0) {
285+ mutex_unlock(&smbox->chan_lock);
286+ return ret;
287+ }
275288
276− return ret;
289+ return 0;
277290 }
278291
279292 static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret,
@@ -281,13 +294,10 @@ static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret, · 1 unmodified line
281294 {
282295 struct scmi_mailbox *smbox = cinfo->transport_info;
283296
284− /*
285− * NOTE: we might prefer not to need the mailbox ticker to manage the
286− * transfer queueing since the protocol layer queues things by itself.
287− * Unfortunately, we have to kick the mailbox framework after we have
288− * received our message.
289− */
290297 mbox_client_txdone(smbox->chan, ret);
298+
299+ /* Release channel */
300+ mutex_unlock(&smbox->chan_lock);
291301 }
292302
293303 static void mailbox_fetch_response(struct scmi_chan_info *cinfo,
drivers/firmware/arm_sdei.c+1−1
@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev) · 762 unmodified lines
763763 int err;
764764
765765 /* unregister private events */
766− cpuhp_remove_state(sdei_entry_point);
766+ cpuhp_remove_state(sdei_hp_state);
767767
768768 err = sdei_unregister_shared();
769769 if (err)
drivers/gpio/gpio-aspeed.c+3−1
@@ -406,6 +406,8 @@ static void __aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset, · 405 unmodified lines
406406 gpio->dcache[GPIO_BANK(offset)] = reg;
407407
408408 iowrite32(reg, addr);
409+ /* Flush write */
410+ ioread32(addr);
409411 }
410412
411413 static void aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset,
@@ -1191,7 +1193,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) · 779 unmodified lines
11911193 if (!gpio_id)
11921194 return -EINVAL;
11931195
1194− gpio->clk = of_clk_get(pdev->dev.of_node, 0);
1196+ gpio->clk = devm_clk_get_enabled(&pdev->dev, NULL);
11951197 if (IS_ERR(gpio->clk)) {
11961198 dev_warn(&pdev->dev,
11971199 "Failed to get clock from devicetree, debouncing disabled\n");
drivers/gpio/gpio-sloppy-logic-analyzer.c+3−1
@@ -234,7 +234,9 @@ static int gpio_la_poll_probe(struct platform_device *pdev) · 233 unmodified lines
234234 if (!priv)
235235 return -ENOMEM;
236236
237− devm_mutex_init(dev, &priv->blob_lock);
237+ ret = devm_mutex_init(dev, &priv->blob_lock);
238+ if (ret)
239+ return ret;
238240
239241 fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE);
240242
drivers/gpio/gpiolib-swnode.c+1−1
@@ -64,7 +64,7 @@ struct gpio_desc *swnode_find_gpio(struct fwnode_handle *fwnode, · 63 unmodified lines
6464 struct fwnode_reference_args args;
6565 struct gpio_desc *desc;
6666 char propname[32]; /* 32 is max size of property name */
67− int ret;
67+ int ret = 0;
6868
6969 swnode = to_software_node(fwnode);
7070 if (!swnode)
drivers/gpio/gpiolib.c+3−1
@@ -4926,6 +4926,8 @@ static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos) · 4925 unmodified lines
49264926 return NULL;
49274927
49284928 s->private = priv;
4929+ if (*pos > 0)
4930+ priv->newline = true;
49294931 priv->idx = srcu_read_lock(&gpio_devices_srcu);
49304932
49314933 list_for_each_entry_srcu(gdev, &gpio_devices, list,
@@ -4969,7 +4971,7 @@ static int gpiolib_seq_show(struct seq_file *s, void *v) · 37 unmodified lines
49694971
49704972 gc = srcu_dereference(gdev->chip, &gdev->srcu);
49714973 if (!gc) {
4972− seq_printf(s, "%s%s: (dangling chip)",
4974+ seq_printf(s, "%s%s: (dangling chip)\n",
49734975 priv->newline ? "\n" : "",
49744976 dev_name(&gdev->dev));
49754977 return 0;
drivers/gpu/drm/amd/display/dc/dml2/dml2_policy.c+1−0
@@ -303,6 +303,7 @@ void build_unoptimized_policy_settings(enum dml_project_id project, struct dml_m · 302 unmodified lines
303303 if (project == dml_project_dcn35 ||
304304 project == dml_project_dcn351) {
305305 policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false;
306+ policy->EnhancedPrefetchScheduleAccelerationFinal = 0;
306307 policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/
307308 policy->UseOnlyMaxPrefetchModes = 1;
308309 }
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c+3−1
@@ -242,7 +242,9 @@ static int vangogh_tables_init(struct smu_context *smu) · 241 unmodified lines
242242 goto err0_out;
243243 smu_table->metrics_time = 0;
244244
245− smu_table->gpu_metrics_table_size = max(sizeof(struct gpu_metrics_v2_3), sizeof(struct gpu_metrics_v2_2));
245+ smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v2_2);
246+ smu_table->gpu_metrics_table_size = max(smu_table->gpu_metrics_table_size, sizeof(struct gpu_metrics_v2_3));
247+ smu_table->gpu_metrics_table_size = max(smu_table->gpu_metrics_table_size, sizeof(struct gpu_metrics_v2_4));
246248 smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
247249 if (!smu_table->gpu_metrics_table)
248250 goto err1_out;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+3−3
@@ -2473,7 +2473,7 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 2472 unmodified lines
24732473 DpmActivityMonitorCoeffInt_t *activity_monitor =
24742474 &(activity_monitor_external.DpmActivityMonitorCoeffInt);
24752475 int workload_type, ret = 0;
2476− u32 workload_mask;
2476+ u32 workload_mask, selected_workload_mask;
24772477
24782478 smu->power_profile_mode = input[size];
24792479
@@ -2540,7 +2540,7 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 60 unmodified lines
25402540 if (workload_type < 0)
25412541 return -EINVAL;
25422542
2543− workload_mask = 1 << workload_type;
2543+ selected_workload_mask = workload_mask = 1 << workload_type;
25442544
25452545 /* Add optimizations for SMU13.0.0/10. Reuse the power saving profile */
25462546 if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0) &&
@@ -2560,7 +2560,7 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 13 unmodified lines
25602560 workload_mask,
25612561 NULL);
25622562 if (!ret)
2563− smu->workload_mask = workload_mask;
2563+ smu->workload_mask = selected_workload_mask;
25642564
25652565 return ret;
25662566 }
drivers/gpu/drm/ast/ast_sil164.c+2−0
@@ -29,6 +29,8 @@ static int ast_sil164_connector_helper_get_modes(struct drm_connector *connector · 28 unmodified lines
2929 if (ast_connector->physical_status == connector_status_connected) {
3030 count = drm_connector_helper_get_modes(connector);
3131 } else {
32+ drm_edid_connector_update(connector, NULL);
33+
3234 /*
3335 * There's no EDID data without a connected monitor. Set BMC-
3436 * compatible modes in this case. The XGA default resolution
drivers/gpu/drm/ast/ast_vga.c+2−0
@@ -29,6 +29,8 @@ static int ast_vga_connector_helper_get_modes(struct drm_connector *connector) · 28 unmodified lines
2929 if (ast_connector->physical_status == connector_status_connected) {
3030 count = drm_connector_helper_get_modes(connector);
3131 } else {
32+ drm_edid_connector_update(connector, NULL);
33+
3234 /*
3335 * There's no EDID data without a connected monitor. Set BMC-
3436 * compatible modes in this case. The XGA default resolution
drivers/gpu/drm/bridge/aux-bridge.c+2−1
@@ -58,9 +58,10 @@ int drm_aux_bridge_register(struct device *parent) · 57 unmodified lines
5858 adev->id = ret;
5959 adev->name = "aux_bridge";
6060 adev->dev.parent = parent;
61− adev->dev.of_node = of_node_get(parent->of_node);
6261 adev->dev.release = drm_aux_bridge_release;
6362
63+ device_set_of_node_from_dev(&adev->dev, parent);
64+
6465 ret = auxiliary_device_init(adev);
6566 if (ret) {
6667 ida_free(&drm_aux_bridge_ida, adev->id);
drivers/gpu/drm/bridge/tc358767.c+1−0
@@ -2412,6 +2412,7 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc) · 2411 unmodified lines
24122412 if (tc->pre_emphasis[0] < 0 || tc->pre_emphasis[0] > 2 ||
24132413 tc->pre_emphasis[1] < 0 || tc->pre_emphasis[1] > 2) {
24142414 dev_err(dev, "Incorrect Pre-Emphasis setting, use either 0=0dB 1=3.5dB 2=6dB\n");
2415+ of_node_put(node);
24152416 return -EINVAL;
24162417 }
24172418 }
drivers/gpu/drm/drm_fbdev_dma.c+2−1
@@ -48,7 +48,8 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info) · 47 unmodified lines
4848 if (!fb_helper->dev)
4949 return;
5050
51− fb_deferred_io_cleanup(info);
51+ if (info->fbdefio)
52+ fb_deferred_io_cleanup(info);
5253 drm_fb_helper_fini(fb_helper);
5354
5455 drm_client_buffer_vunmap(fb_helper->buffer);
drivers/gpu/drm/i915/Kconfig+1−2
@@ -125,9 +125,8 @@ config DRM_I915_USERPTR · 124 unmodified lines
125125 config DRM_I915_GVT_KVMGT
126126 tristate "Enable KVM host support Intel GVT-g graphics virtualization"
127127 depends on DRM_I915
128− depends on X86
128+ depends on KVM_X86
129129 depends on 64BIT
130− depends on KVM
131130 depends on VFIO
132131 select DRM_I915_GVT
133132 select KVM_EXTERNAL_WRITE_TRACKING
drivers/gpu/drm/i915/display/intel_dp_mst.c+30−12
@@ -90,27 +90,19 @@ static int intel_dp_mst_max_dpt_bpp(const struct intel_crtc_state *crtc_state, · 89 unmodified lines
9090
9191 static int intel_dp_mst_bw_overhead(const struct intel_crtc_state *crtc_state,
9292 const struct intel_connector *connector,
93− bool ssc, bool dsc, int bpp_x16)
93+ bool ssc, int dsc_slice_count, int bpp_x16)
9494 {
9595 const struct drm_display_mode *adjusted_mode =
9696 &crtc_state->hw.adjusted_mode;
9797 unsigned long flags = DRM_DP_BW_OVERHEAD_MST;
98− int dsc_slice_count = 0;
9998 int overhead;
10099
101100 flags |= intel_dp_is_uhbr(crtc_state) ? DRM_DP_BW_OVERHEAD_UHBR : 0;
102101 flags |= ssc ? DRM_DP_BW_OVERHEAD_SSC_REF_CLK : 0;
103102 flags |= crtc_state->fec_enable ? DRM_DP_BW_OVERHEAD_FEC : 0;
104103
105− if (dsc) {
106− int num_joined_pipes = intel_crtc_num_joined_pipes(crtc_state);
107−
104+ if (dsc_slice_count)
108105 flags |= DRM_DP_BW_OVERHEAD_DSC;
109− dsc_slice_count = intel_dp_dsc_get_slice_count(connector,
110− adjusted_mode->clock,
111− adjusted_mode->hdisplay,
112− num_joined_pipes);
113− }
114106
115107 overhead = drm_dp_bw_overhead(crtc_state->lane_count,
116108 adjusted_mode->hdisplay,
@@ -156,6 +148,19 @@ static int intel_dp_mst_calc_pbn(int pixel_clock, int bpp_x16, int bw_overhead) · 39 unmodified lines
156148 return DIV_ROUND_UP(effective_data_rate * 64, 54 * 1000);
157149 }
158150
151+static int intel_dp_mst_dsc_get_slice_count(const struct intel_connector *connector,
152+ const struct intel_crtc_state *crtc_state)
153+{
154+ const struct drm_display_mode *adjusted_mode =
155+ &crtc_state->hw.adjusted_mode;
156+ int num_joined_pipes = crtc_state->joiner_pipes;
157+
158+ return intel_dp_dsc_get_slice_count(connector,
159+ adjusted_mode->clock,
160+ adjusted_mode->hdisplay,
161+ num_joined_pipes);
162+}
163+
159164 static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
160165 struct intel_crtc_state *crtc_state,
161166 int max_bpp,
@@ -175,6 +180,7 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, · 13 unmodified lines
175180 const struct drm_display_mode *adjusted_mode =
176181 &crtc_state->hw.adjusted_mode;
177182 int bpp, slots = -EINVAL;
183+ int dsc_slice_count = 0;
178184 int max_dpt_bpp;
179185 int ret = 0;
180186
@@ -206,6 +212,15 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, · 25 unmodified lines
206212 drm_dbg_kms(&i915->drm, "Looking for slots in range min bpp %d max bpp %d\n",
207213 min_bpp, max_bpp);
208214
215+ if (dsc) {
216+ dsc_slice_count = intel_dp_mst_dsc_get_slice_count(connector, crtc_state);
217+ if (!dsc_slice_count) {
218+ drm_dbg_kms(&i915->drm, "Can't get valid DSC slice count\n");
219+
220+ return -ENOSPC;
221+ }
222+ }
223+
209224 for (bpp = max_bpp; bpp >= min_bpp; bpp -= step) {
210225 int local_bw_overhead;
211226 int remote_bw_overhead;
@@ -219,9 +234,9 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, · 7 unmodified lines
219234 intel_dp_output_bpp(crtc_state->output_format, bpp));
220235
221236 local_bw_overhead = intel_dp_mst_bw_overhead(crtc_state, connector,
222− false, dsc, link_bpp_x16);
237+ false, dsc_slice_count, link_bpp_x16);
223238 remote_bw_overhead = intel_dp_mst_bw_overhead(crtc_state, connector,
224− true, dsc, link_bpp_x16);
239+ true, dsc_slice_count, link_bpp_x16);
225240
226241 intel_dp_mst_compute_m_n(crtc_state, connector,
227242 local_bw_overhead,
@@ -452,6 +467,9 @@ hblank_expansion_quirk_needs_dsc(const struct intel_connector *connector, · 224 unmodified lines
452467 if (mode_hblank_period_ns(adjusted_mode) > hblank_limit)
453468 return false;
454469
470+ if (!intel_dp_mst_dsc_get_slice_count(connector, crtc_state))
471+ return false;
472+
455473 return true;
456474 }
457475
drivers/gpu/drm/mediatek/mtk_crtc.c+2−2
@@ -127,9 +127,8 @@ static void mtk_crtc_destroy(struct drm_crtc *crtc) · 126 unmodified lines
127127
128128 mtk_mutex_put(mtk_crtc->mutex);
129129 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
130− cmdq_pkt_destroy(&mtk_crtc->cmdq_client, &mtk_crtc->cmdq_handle);
131−
132130 if (mtk_crtc->cmdq_client.chan) {
131+ cmdq_pkt_destroy(&mtk_crtc->cmdq_client, &mtk_crtc->cmdq_handle);
133132 mbox_free_channel(mtk_crtc->cmdq_client.chan);
134133 mtk_crtc->cmdq_client.chan = NULL;
135134 }
@@ -913,6 +912,7 @@ static int mtk_crtc_init_comp_planes(struct drm_device *drm_dev, · 777 unmodified lines
913912 BIT(pipe),
914913 mtk_crtc_plane_type(mtk_crtc->layer_nr, num_planes),
915914 mtk_ddp_comp_supported_rotations(comp),
915+ mtk_ddp_comp_get_blend_modes(comp),
916916 mtk_ddp_comp_get_formats(comp),
917917 mtk_ddp_comp_get_num_formats(comp), i);
918918 if (ret)
drivers/gpu/drm/mediatek/mtk_ddp_comp.c+2−0
@@ -363,6 +363,7 @@ static const struct mtk_ddp_comp_funcs ddp_ovl = { · 362 unmodified lines
363363 .layer_config = mtk_ovl_layer_config,
364364 .bgclr_in_on = mtk_ovl_bgclr_in_on,
365365 .bgclr_in_off = mtk_ovl_bgclr_in_off,
366+ .get_blend_modes = mtk_ovl_get_blend_modes,
366367 .get_formats = mtk_ovl_get_formats,
367368 .get_num_formats = mtk_ovl_get_num_formats,
368369 };
@@ -416,6 +417,7 @@ static const struct mtk_ddp_comp_funcs ddp_ovl_adaptor = { · 47 unmodified lines
416417 .disconnect = mtk_ovl_adaptor_disconnect,
417418 .add = mtk_ovl_adaptor_add_comp,
418419 .remove = mtk_ovl_adaptor_remove_comp,
420+ .get_blend_modes = mtk_ovl_adaptor_get_blend_modes,
419421 .get_formats = mtk_ovl_adaptor_get_formats,
420422 .get_num_formats = mtk_ovl_adaptor_get_num_formats,
421423 .mode_valid = mtk_ovl_adaptor_mode_valid,
drivers/gpu/drm/mediatek/mtk_ddp_comp.h+10−0
@@ -80,6 +80,7 @@ struct mtk_ddp_comp_funcs { · 79 unmodified lines
8080 void (*ctm_set)(struct device *dev,
8181 struct drm_crtc_state *state);
8282 struct device * (*dma_dev_get)(struct device *dev);
83+ u32 (*get_blend_modes)(struct device *dev);
8384 const u32 *(*get_formats)(struct device *dev);
8485 size_t (*get_num_formats)(struct device *dev);
8586 void (*connect)(struct device *dev, struct device *mmsys_dev, unsigned int next);
@@ -266,6 +267,15 @@ static inline struct device *mtk_ddp_comp_dma_dev_get(struct mtk_ddp_comp *comp) · 180 unmodified lines
266267 return comp->dev;
267268 }
268269
270+static inline
271+u32 mtk_ddp_comp_get_blend_modes(struct mtk_ddp_comp *comp)
272+{
273+ if (comp->funcs && comp->funcs->get_blend_modes)
274+ return comp->funcs->get_blend_modes(comp->dev);
275+
276+ return 0;
277+}
278+
269279 static inline
270280 const u32 *mtk_ddp_comp_get_formats(struct mtk_ddp_comp *comp)
271281 {
drivers/gpu/drm/mediatek/mtk_disp_drv.h+2−0
@@ -103,6 +103,7 @@ void mtk_ovl_register_vblank_cb(struct device *dev, · 102 unmodified lines
103103 void mtk_ovl_unregister_vblank_cb(struct device *dev);
104104 void mtk_ovl_enable_vblank(struct device *dev);
105105 void mtk_ovl_disable_vblank(struct device *dev);
106+u32 mtk_ovl_get_blend_modes(struct device *dev);
106107 const u32 *mtk_ovl_get_formats(struct device *dev);
107108 size_t mtk_ovl_get_num_formats(struct device *dev);
108109
@@ -131,6 +132,7 @@ void mtk_ovl_adaptor_start(struct device *dev); · 22 unmodified lines
131132 void mtk_ovl_adaptor_stop(struct device *dev);
132133 unsigned int mtk_ovl_adaptor_layer_nr(struct device *dev);
133134 struct device *mtk_ovl_adaptor_dma_dev_get(struct device *dev);
135+u32 mtk_ovl_adaptor_get_blend_modes(struct device *dev);
134136 const u32 *mtk_ovl_adaptor_get_formats(struct device *dev);
135137 size_t mtk_ovl_adaptor_get_num_formats(struct device *dev);
136138 enum drm_mode_status mtk_ovl_adaptor_mode_valid(struct device *dev,
drivers/gpu/drm/mediatek/mtk_disp_ovl.c+55−19
@@ -65,8 +65,8 @@ · 64 unmodified lines
6565 #define OVL_CON_CLRFMT_RGB (1 << 12)
6666 #define OVL_CON_CLRFMT_ARGB8888 (2 << 12)
6767 #define OVL_CON_CLRFMT_RGBA8888 (3 << 12)
68−#define OVL_CON_CLRFMT_ABGR8888 (OVL_CON_CLRFMT_RGBA8888 | OVL_CON_BYTE_SWAP)
69−#define OVL_CON_CLRFMT_BGRA8888 (OVL_CON_CLRFMT_ARGB8888 | OVL_CON_BYTE_SWAP)
68+#define OVL_CON_CLRFMT_ABGR8888 (OVL_CON_CLRFMT_ARGB8888 | OVL_CON_BYTE_SWAP)
69+#define OVL_CON_CLRFMT_BGRA8888 (OVL_CON_CLRFMT_RGBA8888 | OVL_CON_BYTE_SWAP)
7070 #define OVL_CON_CLRFMT_UYVY (4 << 12)
7171 #define OVL_CON_CLRFMT_YUYV (5 << 12)
7272 #define OVL_CON_MTX_YUV_TO_RGB (6 << 16)
@@ -146,6 +146,7 @@ struct mtk_disp_ovl_data { · 73 unmodified lines
146146 bool fmt_rgb565_is_0;
147147 bool smi_id_en;
148148 bool supports_afbc;
149+ const u32 blend_modes;
149150 const u32 *formats;
150151 size_t num_formats;
151152 bool supports_clrfmt_ext;
@@ -214,6 +215,13 @@ void mtk_ovl_disable_vblank(struct device *dev) · 62 unmodified lines
214215 writel_relaxed(0x0, ovl->regs + DISP_REG_OVL_INTEN);
215216 }
216217
218+u32 mtk_ovl_get_blend_modes(struct device *dev)
219+{
220+ struct mtk_disp_ovl *ovl = dev_get_drvdata(dev);
221+
222+ return ovl->data->blend_modes;
223+}
224+
217225 const u32 *mtk_ovl_get_formats(struct device *dev)
218226 {
219227 struct mtk_disp_ovl *ovl = dev_get_drvdata(dev);
@@ -386,14 +394,27 @@ void mtk_ovl_layer_off(struct device *dev, unsigned int idx, · 166 unmodified lines
386394 DISP_REG_OVL_RDMA_CTRL(idx));
387395 }
388396
389−static unsigned int ovl_fmt_convert(struct mtk_disp_ovl *ovl, unsigned int fmt,
390− unsigned int blend_mode)
397+static unsigned int mtk_ovl_fmt_convert(struct mtk_disp_ovl *ovl,
398+ struct mtk_plane_state *state)
391399 {
392− /* The return value in switch "MEM_MODE_INPUT_FORMAT_XXX"
393− * is defined in mediatek HW data sheet.
394− * The alphabet order in XXX is no relation to data
395− * arrangement in memory.
400+ unsigned int fmt = state->pending.format;
401+ unsigned int blend_mode = DRM_MODE_BLEND_COVERAGE;
402+
403+ /*
404+ * For the platforms where OVL_CON_CLRFMT_MAN is defined in the hardware data sheet
405+ * and supports premultiplied color formats, such as OVL_CON_CLRFMT_PARGB8888.
406+ *
407+ * Check blend_modes in the driver data to see if premultiplied mode is supported.
408+ * If not, use coverage mode instead to set it to the supported color formats.
409+ *
410+ * Current DRM assumption is that alpha is default premultiplied, so the bitmask of
411+ * blend_modes must include BIT(DRM_MODE_BLEND_PREMULTI). Otherwise, mtk_plane_init()
412+ * will get an error return from drm_plane_create_blend_mode_property() and
413+ * state->base.pixel_blend_mode should not be used.
396414 */
415+ if (ovl->data->blend_modes & BIT(DRM_MODE_BLEND_PREMULTI))
416+ blend_mode = state->base.pixel_blend_mode;
417+
397418 switch (fmt) {
398419 default:
399420 case DRM_FORMAT_RGB565:
@@ -471,20 +492,26 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx, · 71 unmodified lines
471492 return;
472493 }
473494
474− con = ovl_fmt_convert(ovl, fmt, blend_mode);
495+ con = mtk_ovl_fmt_convert(ovl, state);
475496 if (state->base.fb) {
476− con |= OVL_CON_AEN;
477497 con |= state->base.alpha & OVL_CON_ALPHA;
478− }
479498
480− /* CONST_BLD must be enabled for XRGB formats although the alpha channel
481− * can be ignored, or OVL will still read the value from memory.
482− * For RGB888 related formats, whether CONST_BLD is enabled or not won't
483− * affect the result. Therefore we use !has_alpha as the condition.
484− */
485− if ((state->base.fb && !state->base.fb->format->has_alpha) ||
486− blend_mode == DRM_MODE_BLEND_PIXEL_NONE)
487− ignore_pixel_alpha = OVL_CONST_BLEND;
499+ /*
500+ * For blend_modes supported SoCs, always enable alpha blending.
501+ * For blend_modes unsupported SoCs, enable alpha blending when has_alpha is set.
502+ */
503+ if (blend_mode || state->base.fb->format->has_alpha)
504+ con |= OVL_CON_AEN;
505+
506+ /*
507+ * Although the alpha channel can be ignored, CONST_BLD must be enabled
508+ * for XRGB format, otherwise OVL will still read the value from memory.
509+ * For RGB888 related formats, whether CONST_BLD is enabled or not won't
510+ * affect the result. Therefore we use !has_alpha as the condition.
511+ */
512+ if (blend_mode == DRM_MODE_BLEND_PIXEL_NONE || !state->base.fb->format->has_alpha)
513+ ignore_pixel_alpha = OVL_CONST_BLEND;
514+ }
488515
489516 if (pending->rotation & DRM_MODE_REFLECT_Y) {
490517 con |= OVL_CON_VIRT_FLIP;
@@ -663,6 +690,9 @@ static const struct mtk_disp_ovl_data mt8192_ovl_driver_data = { · 172 unmodified lines
663690 .layer_nr = 4,
664691 .fmt_rgb565_is_0 = true,
665692 .smi_id_en = true,
693+ .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) |
694+ BIT(DRM_MODE_BLEND_COVERAGE) |
695+ BIT(DRM_MODE_BLEND_PIXEL_NONE),
666696 .formats = mt8173_formats,
667697 .num_formats = ARRAY_SIZE(mt8173_formats),
668698 };
@@ -673,6 +703,9 @@ static const struct mtk_disp_ovl_data mt8192_ovl_2l_driver_data = { · 4 unmodified lines
673703 .layer_nr = 2,
674704 .fmt_rgb565_is_0 = true,
675705 .smi_id_en = true,
706+ .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) |
707+ BIT(DRM_MODE_BLEND_COVERAGE) |
708+ BIT(DRM_MODE_BLEND_PIXEL_NONE),
676709 .formats = mt8173_formats,
677710 .num_formats = ARRAY_SIZE(mt8173_formats),
678711 };
@@ -684,6 +717,9 @@ static const struct mtk_disp_ovl_data mt8195_ovl_driver_data = { · 5 unmodified lines
684717 .fmt_rgb565_is_0 = true,
685718 .smi_id_en = true,
686719 .supports_afbc = true,
720+ .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) |
721+ BIT(DRM_MODE_BLEND_COVERAGE) |
722+ BIT(DRM_MODE_BLEND_PIXEL_NONE),
687723 .formats = mt8195_formats,
688724 .num_formats = ARRAY_SIZE(mt8195_formats),
689725 .supports_clrfmt_ext = true,
drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c+7−0
@@ -400,6 +400,13 @@ void mtk_ovl_adaptor_disable_vblank(struct device *dev) · 399 unmodified lines
400400 mtk_ethdr_disable_vblank(ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]);
401401 }
402402
403+u32 mtk_ovl_adaptor_get_blend_modes(struct device *dev)
404+{
405+ struct mtk_disp_ovl_adaptor *ovl_adaptor = dev_get_drvdata(dev);
406+
407+ return mtk_ethdr_get_blend_modes(ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]);
408+}
409+
403410 const u32 *mtk_ovl_adaptor_get_formats(struct device *dev)
404411 {
405412 struct mtk_disp_ovl_adaptor *ovl_adaptor = dev_get_drvdata(dev);
drivers/gpu/drm/mediatek/mtk_dp.c+84−1
@@ -145,6 +145,89 @@ struct mtk_dp_data { · 144 unmodified lines
145145 u16 audio_m_div2_bit;
146146 };
147147
148+static const struct mtk_dp_efuse_fmt mt8188_dp_efuse_fmt[MTK_DP_CAL_MAX] = {
149+ [MTK_DP_CAL_GLB_BIAS_TRIM] = {
150+ .idx = 0,
151+ .shift = 10,
152+ .mask = 0x1f,
153+ .min_val = 1,
154+ .max_val = 0x1e,
155+ .default_val = 0xf,
156+ },
157+ [MTK_DP_CAL_CLKTX_IMPSE] = {
158+ .idx = 0,
159+ .shift = 15,
160+ .mask = 0xf,
161+ .min_val = 1,
162+ .max_val = 0xe,
163+ .default_val = 0x8,
164+ },
165+ [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_0] = {
166+ .idx = 1,
167+ .shift = 0,
168+ .mask = 0xf,
169+ .min_val = 1,
170+ .max_val = 0xe,
171+ .default_val = 0x8,
172+ },
173+ [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_1] = {
174+ .idx = 1,
175+ .shift = 8,
176+ .mask = 0xf,
177+ .min_val = 1,
178+ .max_val = 0xe,
179+ .default_val = 0x8,
180+ },
181+ [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_2] = {
182+ .idx = 1,
183+ .shift = 16,
184+ .mask = 0xf,
185+ .min_val = 1,
186+ .max_val = 0xe,
187+ .default_val = 0x8,
188+ },
189+ [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_3] = {
190+ .idx = 1,
191+ .shift = 24,
192+ .mask = 0xf,
193+ .min_val = 1,
194+ .max_val = 0xe,
195+ .default_val = 0x8,
196+ },
197+ [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_0] = {
198+ .idx = 1,
199+ .shift = 4,
200+ .mask = 0xf,
201+ .min_val = 1,
202+ .max_val = 0xe,
203+ .default_val = 0x8,
204+ },
205+ [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_1] = {
206+ .idx = 1,
207+ .shift = 12,
208+ .mask = 0xf,
209+ .min_val = 1,
210+ .max_val = 0xe,
211+ .default_val = 0x8,
212+ },
213+ [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_2] = {
214+ .idx = 1,
215+ .shift = 20,
216+ .mask = 0xf,
217+ .min_val = 1,
218+ .max_val = 0xe,
219+ .default_val = 0x8,
220+ },
221+ [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_3] = {
222+ .idx = 1,
223+ .shift = 28,
224+ .mask = 0xf,
225+ .min_val = 1,
226+ .max_val = 0xe,
227+ .default_val = 0x8,
228+ },
229+};
230+
148231 static const struct mtk_dp_efuse_fmt mt8195_edp_efuse_fmt[MTK_DP_CAL_MAX] = {
149232 [MTK_DP_CAL_GLB_BIAS_TRIM] = {
150233 .idx = 3,
@@ -2771,7 +2854,7 @@ static SIMPLE_DEV_PM_OPS(mtk_dp_pm_ops, mtk_dp_suspend, mtk_dp_resume); · 2620 unmodified lines
27712854 static const struct mtk_dp_data mt8188_dp_data = {
27722855 .bridge_type = DRM_MODE_CONNECTOR_DisplayPort,
27732856 .smc_cmd = MTK_DP_SIP_ATF_VIDEO_UNMUTE,
2774− .efuse_fmt = mt8195_dp_efuse_fmt,
2857+ .efuse_fmt = mt8188_dp_efuse_fmt,
27752858 .audio_supported = true,
27762859 .audio_pkt_in_hblank_area = true,
27772860 .audio_m_div2_bit = MT8188_AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_DIV_2,
drivers/gpu/drm/mediatek/mtk_ethdr.c+7−0
@@ -145,6 +145,13 @@ static irqreturn_t mtk_ethdr_irq_handler(int irq, void *dev_id) · 144 unmodified lines
145145 return IRQ_HANDLED;
146146 }
147147
148+u32 mtk_ethdr_get_blend_modes(struct device *dev)
149+{
150+ return BIT(DRM_MODE_BLEND_PREMULTI) |
151+ BIT(DRM_MODE_BLEND_COVERAGE) |
152+ BIT(DRM_MODE_BLEND_PIXEL_NONE);
153+}
154+
148155 void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,
149156 struct mtk_plane_state *state,
150157 struct cmdq_pkt *cmdq_pkt)
drivers/gpu/drm/mediatek/mtk_ethdr.h+1−0
@@ -13,6 +13,7 @@ void mtk_ethdr_clk_disable(struct device *dev); · 12 unmodified lines
1313 void mtk_ethdr_config(struct device *dev, unsigned int w,
1414 unsigned int h, unsigned int vrefresh,
1515 unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
16+u32 mtk_ethdr_get_blend_modes(struct device *dev);
1617 void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,
1718 struct mtk_plane_state *state,
1819 struct cmdq_pkt *cmdq_pkt);
drivers/gpu/drm/mediatek/mtk_plane.c+7−8
@@ -320,8 +320,8 @@ static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { · 319 unmodified lines
320320
321321 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
322322 unsigned long possible_crtcs, enum drm_plane_type type,
323− unsigned int supported_rotations, const u32 *formats,
324− size_t num_formats, unsigned int plane_idx)
323+ unsigned int supported_rotations, const u32 blend_modes,
324+ const u32 *formats, size_t num_formats, unsigned int plane_idx)
325325 {
326326 int err;
327327
@@ -366,12 +366,11 @@ int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane, · 38 unmodified lines
366366 if (err)
367367 DRM_ERROR("failed to create property: alpha\n");
368368
369− err = drm_plane_create_blend_mode_property(plane,
370− BIT(DRM_MODE_BLEND_PREMULTI) |
371− BIT(DRM_MODE_BLEND_COVERAGE) |
372− BIT(DRM_MODE_BLEND_PIXEL_NONE));
373− if (err)
374− DRM_ERROR("failed to create property: blend_mode\n");
369+ if (blend_modes) {
370+ err = drm_plane_create_blend_mode_property(plane, blend_modes);
371+ if (err)
372+ DRM_ERROR("failed to create property: blend_mode\n");
373+ }
375374
376375 drm_plane_helper_add(plane, &mtk_plane_helper_funcs);
377376
drivers/gpu/drm/mediatek/mtk_plane.h+2−2
@@ -48,6 +48,6 @@ to_mtk_plane_state(struct drm_plane_state *state) · 47 unmodified lines
4848
4949 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
5050 unsigned long possible_crtcs, enum drm_plane_type type,
51− unsigned int supported_rotations, const u32 *formats,
52− size_t num_formats, unsigned int plane_idx);
51+ unsigned int supported_rotations, const u32 blend_modes,
52+ const u32 *formats, size_t num_formats, unsigned int plane_idx);
5353 #endif
drivers/gpu/drm/mgag200/mgag200_drv.c+0−38
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 #include <drm/drm_managed.h>
2121 #include <drm/drm_module.h>
2222 #include <drm/drm_pciids.h>
23−#include <drm/drm_vblank.h>
2423
2524 #include "mgag200_drv.h"
2625
@@ -87,34 +86,6 @@ resource_size_t mgag200_probe_vram(void __iomem *mem, resource_size_t size) · 60 unmodified lines
8786 return offset - 65536;
8887 }
8988
90−static irqreturn_t mgag200_irq_handler(int irq, void *arg)
91−{
92− struct drm_device *dev = arg;
93− struct mga_device *mdev = to_mga_device(dev);
94− struct drm_crtc *crtc;
95− u32 status, ien;
96−
97− status = RREG32(MGAREG_STATUS);
98−
99− if (status & MGAREG_STATUS_VLINEPEN) {
100− ien = RREG32(MGAREG_IEN);
101− if (!(ien & MGAREG_IEN_VLINEIEN))
102− goto out;
103−
104− crtc = drm_crtc_from_index(dev, 0);
105− if (WARN_ON_ONCE(!crtc))
106− goto out;
107− drm_crtc_handle_vblank(crtc);
108−
109− WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
110−
111− return IRQ_HANDLED;
112− }
113−
114−out:
115− return IRQ_NONE;
116−}
117−
11889 /*
11990 * DRM driver
12091 */
@@ -199,7 +170,6 @@ int mgag200_device_init(struct mga_device *mdev, · 78 unmodified lines
199170 const struct mgag200_device_funcs *funcs)
200171 {
201172 struct drm_device *dev = &mdev->base;
202− struct pci_dev *pdev = to_pci_dev(dev->dev);
203173 u8 crtcext3, misc;
204174 int ret;
205175
@@ -226,14 +196,6 @@ int mgag200_device_init(struct mga_device *mdev, · 20 unmodified lines
226196 mutex_unlock(&mdev->rmmio_lock);
227197
228198 WREG32(MGAREG_IEN, 0);
229− WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
230−
231− ret = devm_request_irq(&pdev->dev, pdev->irq, mgag200_irq_handler, IRQF_SHARED,
232− dev->driver->name, dev);
233− if (ret) {
234− drm_err(dev, "Failed to acquire interrupt, error %d\n", ret);
235− return ret;
236− }
237199
238200 return 0;
239201 }
drivers/gpu/drm/mgag200/mgag200_drv.h+2−12
@@ -391,24 +391,17 @@ int mgag200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_st · 390 unmodified lines
391391 void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *old_state);
392392 void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state);
393393 void mgag200_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *old_state);
394−bool mgag200_crtc_helper_get_scanout_position(struct drm_crtc *crtc, bool in_vblank_irq,
395− int *vpos, int *hpos,
396− ktime_t *stime, ktime_t *etime,
397− const struct drm_display_mode *mode);
398394
399395 #define MGAG200_CRTC_HELPER_FUNCS \
400396 .mode_valid = mgag200_crtc_helper_mode_valid, \
401397 .atomic_check = mgag200_crtc_helper_atomic_check, \
402398 .atomic_flush = mgag200_crtc_helper_atomic_flush, \
403399 .atomic_enable = mgag200_crtc_helper_atomic_enable, \
404− .atomic_disable = mgag200_crtc_helper_atomic_disable, \
405− .get_scanout_position = mgag200_crtc_helper_get_scanout_position
400+ .atomic_disable = mgag200_crtc_helper_atomic_disable
406401
407402 void mgag200_crtc_reset(struct drm_crtc *crtc);
408403 struct drm_crtc_state *mgag200_crtc_atomic_duplicate_state(struct drm_crtc *crtc);
409404 void mgag200_crtc_atomic_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state);
410−int mgag200_crtc_enable_vblank(struct drm_crtc *crtc);
411−void mgag200_crtc_disable_vblank(struct drm_crtc *crtc);
412405
413406 #define MGAG200_CRTC_FUNCS \
414407 .reset = mgag200_crtc_reset, \
@@ -416,10 +409,7 @@ void mgag200_crtc_disable_vblank(struct drm_crtc *crtc); · 1 unmodified line
416409 .set_config = drm_atomic_helper_set_config, \
417410 .page_flip = drm_atomic_helper_page_flip, \
418411 .atomic_duplicate_state = mgag200_crtc_atomic_duplicate_state, \
419− .atomic_destroy_state = mgag200_crtc_atomic_destroy_state, \
420− .enable_vblank = mgag200_crtc_enable_vblank, \
421− .disable_vblank = mgag200_crtc_disable_vblank, \
422− .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp
412+ .atomic_destroy_state = mgag200_crtc_atomic_destroy_state
423413
424414 void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mode *mode,
425415 bool set_vidrst);
drivers/gpu/drm/mgag200/mgag200_g200.c+0−5
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_drv.h>
99 #include <drm/drm_gem_atomic_helper.h>
1010 #include <drm/drm_probe_helper.h>
11−#include <drm/drm_vblank.h>
1211
1312 #include "mgag200_drv.h"
1413
@@ -404,9 +403,5 @@ struct mga_device *mgag200_g200_device_create(struct pci_dev *pdev, const struct · 389 unmodified lines
404403 drm_mode_config_reset(dev);
405404 drm_kms_helper_poll_init(dev);
406405
407− ret = drm_vblank_init(dev, 1);
408− if (ret)
409− return ERR_PTR(ret);
410−
411406 return mdev;
412407 }
drivers/gpu/drm/mgag200/mgag200_g200eh.c+0−5
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_drv.h>
99 #include <drm/drm_gem_atomic_helper.h>
1010 #include <drm/drm_probe_helper.h>
11−#include <drm/drm_vblank.h>
1211
1312 #include "mgag200_drv.h"
1413
@@ -276,9 +275,5 @@ struct mga_device *mgag200_g200eh_device_create(struct pci_dev *pdev, const stru · 261 unmodified lines
276275 drm_mode_config_reset(dev);
277276 drm_kms_helper_poll_init(dev);
278277
279− ret = drm_vblank_init(dev, 1);
280− if (ret)
281− return ERR_PTR(ret);
282−
283278 return mdev;
284279 }
drivers/gpu/drm/mgag200/mgag200_g200eh3.c+0−5
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 #include <drm/drm_drv.h>
88 #include <drm/drm_gem_atomic_helper.h>
99 #include <drm/drm_probe_helper.h>
10−#include <drm/drm_vblank.h>
1110
1211 #include "mgag200_drv.h"
1312
@@ -181,9 +180,5 @@ struct mga_device *mgag200_g200eh3_device_create(struct pci_dev *pdev, · 167 unmodified lines
181180 drm_mode_config_reset(dev);
182181 drm_kms_helper_poll_init(dev);
183182
184− ret = drm_vblank_init(dev, 1);
185− if (ret)
186− return ERR_PTR(ret);
187−
188183 return mdev;
189184 }
drivers/gpu/drm/mgag200/mgag200_g200er.c+1−9
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_drv.h>
99 #include <drm/drm_gem_atomic_helper.h>
1010 #include <drm/drm_probe_helper.h>
11−#include <drm/drm_vblank.h>
1211
1312 #include "mgag200_drv.h"
1413
@@ -206,8 +205,6 @@ static void mgag200_g200er_crtc_helper_atomic_enable(struct drm_crtc *crtc, · 191 unmodified lines
206205 mgag200_crtc_set_gamma_linear(mdev, format);
207206
208207 mgag200_enable_display(mdev);
209−
210− drm_crtc_vblank_on(crtc);
211208 }
212209
213210 static const struct drm_crtc_helper_funcs mgag200_g200er_crtc_helper_funcs = {
@@ -215,8 +212,7 @@ static const struct drm_crtc_helper_funcs mgag200_g200er_crtc_helper_funcs = { · 1 unmodified line
215212 .atomic_check = mgag200_crtc_helper_atomic_check,
216213 .atomic_flush = mgag200_crtc_helper_atomic_flush,
217214 .atomic_enable = mgag200_g200er_crtc_helper_atomic_enable,
218− .atomic_disable = mgag200_crtc_helper_atomic_disable,
219− .get_scanout_position = mgag200_crtc_helper_get_scanout_position,
215+ .atomic_disable = mgag200_crtc_helper_atomic_disable
220216 };
221217
222218 static const struct drm_crtc_funcs mgag200_g200er_crtc_funcs = {
@@ -312,9 +308,5 @@ struct mga_device *mgag200_g200er_device_create(struct pci_dev *pdev, const stru · 89 unmodified lines
312308 drm_mode_config_reset(dev);
313309 drm_kms_helper_poll_init(dev);
314310
315− ret = drm_vblank_init(dev, 1);
316− if (ret)
317− return ERR_PTR(ret);
318−
319311 return mdev;
320312 }
drivers/gpu/drm/mgag200/mgag200_g200ev.c+1−9
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_drv.h>
99 #include <drm/drm_gem_atomic_helper.h>
1010 #include <drm/drm_probe_helper.h>
11−#include <drm/drm_vblank.h>
1211
1312 #include "mgag200_drv.h"
1413
@@ -207,8 +206,6 @@ static void mgag200_g200ev_crtc_helper_atomic_enable(struct drm_crtc *crtc, · 192 unmodified lines
207206 mgag200_crtc_set_gamma_linear(mdev, format);
208207
209208 mgag200_enable_display(mdev);
210−
211− drm_crtc_vblank_on(crtc);
212209 }
213210
214211 static const struct drm_crtc_helper_funcs mgag200_g200ev_crtc_helper_funcs = {
@@ -216,8 +213,7 @@ static const struct drm_crtc_helper_funcs mgag200_g200ev_crtc_helper_funcs = { · 1 unmodified line
216213 .atomic_check = mgag200_crtc_helper_atomic_check,
217214 .atomic_flush = mgag200_crtc_helper_atomic_flush,
218215 .atomic_enable = mgag200_g200ev_crtc_helper_atomic_enable,
219− .atomic_disable = mgag200_crtc_helper_atomic_disable,
220− .get_scanout_position = mgag200_crtc_helper_get_scanout_position,
216+ .atomic_disable = mgag200_crtc_helper_atomic_disable
221217 };
222218
223219 static const struct drm_crtc_funcs mgag200_g200ev_crtc_funcs = {
@@ -317,9 +313,5 @@ struct mga_device *mgag200_g200ev_device_create(struct pci_dev *pdev, const stru · 93 unmodified lines
317313 drm_mode_config_reset(dev);
318314 drm_kms_helper_poll_init(dev);
319315
320− ret = drm_vblank_init(dev, 1);
321− if (ret)
322− return ERR_PTR(ret);
323−
324316 return mdev;
325317 }
drivers/gpu/drm/mgag200/mgag200_g200ew3.c+0−5
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 #include <drm/drm_drv.h>
88 #include <drm/drm_gem_atomic_helper.h>
99 #include <drm/drm_probe_helper.h>
10−#include <drm/drm_vblank.h>
1110
1211 #include "mgag200_drv.h"
1312
@@ -199,9 +198,5 @@ struct mga_device *mgag200_g200ew3_device_create(struct pci_dev *pdev, · 185 unmodified lines
199198 drm_mode_config_reset(dev);
200199 drm_kms_helper_poll_init(dev);
201200
202− ret = drm_vblank_init(dev, 1);
203− if (ret)
204− return ERR_PTR(ret);
205−
206201 return mdev;
207202 }
drivers/gpu/drm/mgag200/mgag200_g200se.c+1−9
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_drv.h>
99 #include <drm/drm_gem_atomic_helper.h>
1010 #include <drm/drm_probe_helper.h>
11−#include <drm/drm_vblank.h>
1211
1312 #include "mgag200_drv.h"
1413
@@ -338,8 +337,6 @@ static void mgag200_g200se_crtc_helper_atomic_enable(struct drm_crtc *crtc, · 323 unmodified lines
338337 mgag200_crtc_set_gamma_linear(mdev, format);
339338
340339 mgag200_enable_display(mdev);
341−
342− drm_crtc_vblank_on(crtc);
343340 }
344341
345342 static const struct drm_crtc_helper_funcs mgag200_g200se_crtc_helper_funcs = {
@@ -347,8 +344,7 @@ static const struct drm_crtc_helper_funcs mgag200_g200se_crtc_helper_funcs = { · 1 unmodified line
347344 .atomic_check = mgag200_crtc_helper_atomic_check,
348345 .atomic_flush = mgag200_crtc_helper_atomic_flush,
349346 .atomic_enable = mgag200_g200se_crtc_helper_atomic_enable,
350− .atomic_disable = mgag200_crtc_helper_atomic_disable,
351− .get_scanout_position = mgag200_crtc_helper_get_scanout_position,
347+ .atomic_disable = mgag200_crtc_helper_atomic_disable
352348 };
353349
354350 static const struct drm_crtc_funcs mgag200_g200se_crtc_funcs = {
@@ -517,9 +513,5 @@ struct mga_device *mgag200_g200se_device_create(struct pci_dev *pdev, const stru · 162 unmodified lines
517513 drm_mode_config_reset(dev);
518514 drm_kms_helper_poll_init(dev);
519515
520− ret = drm_vblank_init(dev, 1);
521− if (ret)
522− return ERR_PTR(ret);
523−
524516 return mdev;
525517 }
drivers/gpu/drm/mgag200/mgag200_g200wb.c+0−5
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_drv.h>
99 #include <drm/drm_gem_atomic_helper.h>
1010 #include <drm/drm_probe_helper.h>
11−#include <drm/drm_vblank.h>
1211
1312 #include "mgag200_drv.h"
1413
@@ -323,9 +322,5 @@ struct mga_device *mgag200_g200wb_device_create(struct pci_dev *pdev, const stru · 308 unmodified lines
323322 drm_mode_config_reset(dev);
324323 drm_kms_helper_poll_init(dev);
325324
326− ret = drm_vblank_init(dev, 1);
327− if (ret)
328− return ERR_PTR(ret);
329−
330325 return mdev;
331326 }
drivers/gpu/drm/mgag200/mgag200_mode.c+1−76
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #include <drm/drm_gem_framebuffer_helper.h>
2323 #include <drm/drm_panic.h>
2424 #include <drm/drm_print.h>
25−#include <drm/drm_vblank.h>
2625
2726 #include "mgag200_ddc.h"
2827 #include "mgag200_drv.h"
@@ -227,14 +226,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod · 198 unmodified lines
227226 vblkstr = mode->crtc_vblank_start;
228227 vblkend = vtotal + 1;
229228
230− /*
231− * There's no VBLANK interrupt on Matrox chipsets, so we use
232− * the VLINE interrupt instead. It triggers when the current
233− * <linecomp> has been reached. For VBLANK, this is the first
234− * non-visible line at the bottom of the screen. Therefore,
235− * keep <linecomp> in sync with <vblkstr>.
236− */
237− linecomp = vblkstr;
229+ linecomp = vdispend;
238230
239231 misc = RREG8(MGA_MISC_IN);
240232
@@ -645,8 +637,6 @@ void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_s · 404 unmodified lines
645637 struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state);
646638 struct drm_device *dev = crtc->dev;
647639 struct mga_device *mdev = to_mga_device(dev);
648− struct drm_pending_vblank_event *event;
649− unsigned long flags;
650640
651641 if (crtc_state->enable && crtc_state->color_mgmt_changed) {
652642 const struct drm_format_info *format = mgag200_crtc_state->format;
@@ -656,18 +646,6 @@ void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_s · 3 unmodified lines
656646 else
657647 mgag200_crtc_set_gamma_linear(mdev, format);
658648 }
659−
660− event = crtc->state->event;
661− if (event) {
662− crtc->state->event = NULL;
663−
664− spin_lock_irqsave(&dev->event_lock, flags);
665− if (drm_crtc_vblank_get(crtc) != 0)
666− drm_crtc_send_vblank_event(crtc, event);
667− else
668− drm_crtc_arm_vblank_event(crtc, event);
669− spin_unlock_irqrestore(&dev->event_lock, flags);
670− }
671649 }
672650
673651 void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state)
@@ -692,44 +670,15 @@ void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_ · 18 unmodified lines
692670 mgag200_crtc_set_gamma_linear(mdev, format);
693671
694672 mgag200_enable_display(mdev);
695−
696− drm_crtc_vblank_on(crtc);
697673 }
698674
699675 void mgag200_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *old_state)
700676 {
701677 struct mga_device *mdev = to_mga_device(crtc->dev);
702678
703− drm_crtc_vblank_off(crtc);
704−
705679 mgag200_disable_display(mdev);
706680 }
707681
708−bool mgag200_crtc_helper_get_scanout_position(struct drm_crtc *crtc, bool in_vblank_irq,
709− int *vpos, int *hpos,
710− ktime_t *stime, ktime_t *etime,
711− const struct drm_display_mode *mode)
712−{
713− struct mga_device *mdev = to_mga_device(crtc->dev);
714− u32 vcount;
715−
716− if (stime)
717− *stime = ktime_get();
718−
719− if (vpos) {
720− vcount = RREG32(MGAREG_VCOUNT);
721− *vpos = vcount & GENMASK(11, 0);
722− }
723−
724− if (hpos)
725− *hpos = mode->htotal >> 1; // near middle of scanline on average
726−
727− if (etime)
728− *etime = ktime_get();
729−
730− return true;
731−}
732−
733682 void mgag200_crtc_reset(struct drm_crtc *crtc)
734683 {
735684 struct mgag200_crtc_state *mgag200_crtc_state;
@@ -774,30 +723,6 @@ void mgag200_crtc_atomic_destroy_state(struct drm_crtc *crtc, struct drm_crtc_st · 38 unmodified lines
774723 kfree(mgag200_crtc_state);
775724 }
776725
777−int mgag200_crtc_enable_vblank(struct drm_crtc *crtc)
778−{
779− struct mga_device *mdev = to_mga_device(crtc->dev);
780− u32 ien;
781−
782− WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
783−
784− ien = RREG32(MGAREG_IEN);
785− ien |= MGAREG_IEN_VLINEIEN;
786− WREG32(MGAREG_IEN, ien);
787−
788− return 0;
789−}
790−
791−void mgag200_crtc_disable_vblank(struct drm_crtc *crtc)
792−{
793− struct mga_device *mdev = to_mga_device(crtc->dev);
794− u32 ien;
795−
796− ien = RREG32(MGAREG_IEN);
797− ien &= ~(MGAREG_IEN_VLINEIEN);
798− WREG32(MGAREG_IEN, ien);
799−}
800−
801726 /*
802727 * Mode config
803728 */
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+13−3
@@ -101,9 +101,10 @@ static void get_stats_counter(struct msm_ringbuffer *ring, u32 counter, · 100 unmodified lines
101101 }
102102
103103 static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu,
104− struct msm_ringbuffer *ring, struct msm_file_private *ctx)
104+ struct msm_ringbuffer *ring, struct msm_gem_submit *submit)
105105 {
106106 bool sysprof = refcount_read(&a6xx_gpu->base.base.sysprof_active) > 1;
107+ struct msm_file_private *ctx = submit->queue->ctx;
107108 struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
108109 phys_addr_t ttbr;
109110 u32 asid;
@@ -115,6 +116,15 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu, · 5 unmodified lines
115116 if (msm_iommu_pagetable_params(ctx->aspace->mmu, &ttbr, &asid))
116117 return;
117118
119+ if (adreno_gpu->info->family >= ADRENO_7XX_GEN1) {
120+ /* Wait for previous submit to complete before continuing: */
121+ OUT_PKT7(ring, CP_WAIT_TIMESTAMP, 4);
122+ OUT_RING(ring, 0);
123+ OUT_RING(ring, lower_32_bits(rbmemptr(ring, fence)));
124+ OUT_RING(ring, upper_32_bits(rbmemptr(ring, fence)));
125+ OUT_RING(ring, submit->seqno - 1);
126+ }
127+
118128 if (!sysprof) {
119129 if (!adreno_is_a7xx(adreno_gpu)) {
120130 /* Turn off protected mode to write to special registers */
@@ -193,7 +203,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 72 unmodified lines
193203 struct msm_ringbuffer *ring = submit->ring;
194204 unsigned int i, ibs = 0;
195205
196− a6xx_set_pagetable(a6xx_gpu, ring, submit->queue->ctx);
206+ a6xx_set_pagetable(a6xx_gpu, ring, submit);
197207
198208 get_stats_counter(ring, REG_A6XX_RBBM_PERFCTR_CP(0),
199209 rbmemptr_stats(ring, index, cpcycles_start));
@@ -283,7 +293,7 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 83 unmodified lines
283293 OUT_PKT7(ring, CP_THREAD_CONTROL, 1);
284294 OUT_RING(ring, CP_THREAD_CONTROL_0_SYNC_THREADS | CP_SET_THREAD_BR);
285295
286− a6xx_set_pagetable(a6xx_gpu, ring, submit->queue->ctx);
296+ a6xx_set_pagetable(a6xx_gpu, ring, submit);
287297
288298 get_stats_counter(ring, REG_A7XX_RBBM_PERFCTR_CP(0),
289299 rbmemptr_stats(ring, index, cpcycles_start));
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c+13−7
@@ -711,12 +711,13 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc) · 710 unmodified lines
711711 _dpu_crtc_complete_flip(crtc);
712712 }
713713
714−static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
714+static int _dpu_crtc_check_and_setup_lm_bounds(struct drm_crtc *crtc,
715715 struct drm_crtc_state *state)
716716 {
717717 struct dpu_crtc_state *cstate = to_dpu_crtc_state(state);
718718 struct drm_display_mode *adj_mode = &state->adjusted_mode;
719719 u32 crtc_split_width = adj_mode->hdisplay / cstate->num_mixers;
720+ struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
720721 int i;
721722
722723 for (i = 0; i < cstate->num_mixers; i++) {
@@ -727,7 +728,12 @@ static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc, · 4 unmodified lines
727728 r->y2 = adj_mode->vdisplay;
728729
729730 trace_dpu_crtc_setup_lm_bounds(DRMID(crtc), i, r);
731+
732+ if (drm_rect_width(r) > dpu_kms->catalog->caps->max_mixer_width)
733+ return -E2BIG;
730734 }
735+
736+ return 0;
731737 }
732738
733739 static void _dpu_crtc_get_pcc_coeff(struct drm_crtc_state *state,
@@ -803,7 +809,7 @@ static void dpu_crtc_atomic_begin(struct drm_crtc *crtc, · 69 unmodified lines
803809
804810 DRM_DEBUG_ATOMIC("crtc%d\n", crtc->base.id);
805811
806− _dpu_crtc_setup_lm_bounds(crtc, crtc->state);
812+ _dpu_crtc_check_and_setup_lm_bounds(crtc, crtc->state);
807813
808814 /* encoder will trigger pending mask now */
809815 drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask)
@@ -1091,9 +1097,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, · 281 unmodified lines
10911097
10921098 dpu_core_perf_crtc_update(crtc, 0);
10931099
1094− memset(cstate->mixers, 0, sizeof(cstate->mixers));
1095− cstate->num_mixers = 0;
1096−
10971100 /* disable clk & bw control until clk & bw properties are set */
10981101 cstate->bw_control = false;
10991102 cstate->bw_split_vote = false;
@@ -1192,8 +1195,11 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, · 92 unmodified lines
11921195 if (crtc_state->active_changed)
11931196 crtc_state->mode_changed = true;
11941197
1195− if (cstate->num_mixers)
1196− _dpu_crtc_setup_lm_bounds(crtc, crtc_state);
1198+ if (cstate->num_mixers) {
1199+ rc = _dpu_crtc_check_and_setup_lm_bounds(crtc, crtc_state);
1200+ if (rc)
1201+ return rc;
1202+ }
11971203
11981204 /* FIXME: move this to dpu_plane_atomic_check? */
11991205 drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) {
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c+42−26
@@ -624,6 +624,40 @@ static struct msm_display_topology dpu_encoder_get_topology( · 623 unmodified lines
624624 return topology;
625625 }
626626
627+static void dpu_encoder_assign_crtc_resources(struct dpu_kms *dpu_kms,
628+ struct drm_encoder *drm_enc,
629+ struct dpu_global_state *global_state,
630+ struct drm_crtc_state *crtc_state)
631+{
632+ struct dpu_crtc_state *cstate;
633+ struct dpu_hw_blk *hw_ctl[MAX_CHANNELS_PER_ENC];
634+ struct dpu_hw_blk *hw_lm[MAX_CHANNELS_PER_ENC];
635+ struct dpu_hw_blk *hw_dspp[MAX_CHANNELS_PER_ENC];
636+ int num_lm, num_ctl, num_dspp, i;
637+
638+ cstate = to_dpu_crtc_state(crtc_state);
639+
640+ memset(cstate->mixers, 0, sizeof(cstate->mixers));
641+
642+ num_ctl = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
643+ drm_enc->base.id, DPU_HW_BLK_CTL, hw_ctl, ARRAY_SIZE(hw_ctl));
644+ num_lm = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
645+ drm_enc->base.id, DPU_HW_BLK_LM, hw_lm, ARRAY_SIZE(hw_lm));
646+ num_dspp = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
647+ drm_enc->base.id, DPU_HW_BLK_DSPP, hw_dspp,
648+ ARRAY_SIZE(hw_dspp));
649+
650+ for (i = 0; i < num_lm; i++) {
651+ int ctl_idx = (i < num_ctl) ? i : (num_ctl-1);
652+
653+ cstate->mixers[i].hw_lm = to_dpu_hw_mixer(hw_lm[i]);
654+ cstate->mixers[i].lm_ctl = to_dpu_hw_ctl(hw_ctl[ctl_idx]);
655+ cstate->mixers[i].hw_dspp = i < num_dspp ? to_dpu_hw_dspp(hw_dspp[i]) : NULL;
656+ }
657+
658+ cstate->num_mixers = num_lm;
659+}
660+
627661 static int dpu_encoder_virt_atomic_check(
628662 struct drm_encoder *drm_enc,
629663 struct drm_crtc_state *crtc_state,
@@ -692,6 +726,9 @@ static int dpu_encoder_virt_atomic_check( · 62 unmodified lines
692726 if (!crtc_state->active_changed || crtc_state->enable)
693727 ret = dpu_rm_reserve(&dpu_kms->rm, global_state,
694728 drm_enc, crtc_state, topology);
729+ if (!ret)
730+ dpu_encoder_assign_crtc_resources(dpu_kms, drm_enc,
731+ global_state, crtc_state);
695732 }
696733
697734 trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags);
@@ -1093,14 +1130,11 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, · 395 unmodified lines
10931130 struct dpu_encoder_virt *dpu_enc;
10941131 struct msm_drm_private *priv;
10951132 struct dpu_kms *dpu_kms;
1096− struct dpu_crtc_state *cstate;
10971133 struct dpu_global_state *global_state;
10981134 struct dpu_hw_blk *hw_pp[MAX_CHANNELS_PER_ENC];
10991135 struct dpu_hw_blk *hw_ctl[MAX_CHANNELS_PER_ENC];
1100− struct dpu_hw_blk *hw_lm[MAX_CHANNELS_PER_ENC];
1101− struct dpu_hw_blk *hw_dspp[MAX_CHANNELS_PER_ENC] = { NULL };
11021136 struct dpu_hw_blk *hw_dsc[MAX_CHANNELS_PER_ENC];
1103− int num_lm, num_ctl, num_pp, num_dsc;
1137+ int num_ctl, num_pp, num_dsc;
11041138 unsigned int dsc_mask = 0;
11051139 int i;
11061140
@@ -1129,11 +1163,6 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, · 22 unmodified lines
11291163 ARRAY_SIZE(hw_pp));
11301164 num_ctl = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
11311165 drm_enc->base.id, DPU_HW_BLK_CTL, hw_ctl, ARRAY_SIZE(hw_ctl));
1132− num_lm = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
1133− drm_enc->base.id, DPU_HW_BLK_LM, hw_lm, ARRAY_SIZE(hw_lm));
1134− dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
1135− drm_enc->base.id, DPU_HW_BLK_DSPP, hw_dspp,
1136− ARRAY_SIZE(hw_dspp));
11371166
11381167 for (i = 0; i < MAX_CHANNELS_PER_ENC; i++)
11391168 dpu_enc->hw_pp[i] = i < num_pp ? to_dpu_hw_pingpong(hw_pp[i])
@@ -1159,36 +1188,23 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, · 19 unmodified lines
11591188 dpu_enc->cur_master->hw_cdm = hw_cdm ? to_dpu_hw_cdm(hw_cdm) : NULL;
11601189 }
11611190
1162− cstate = to_dpu_crtc_state(crtc_state);
1163−
1164− for (i = 0; i < num_lm; i++) {
1165− int ctl_idx = (i < num_ctl) ? i : (num_ctl-1);
1166−
1167− cstate->mixers[i].hw_lm = to_dpu_hw_mixer(hw_lm[i]);
1168− cstate->mixers[i].lm_ctl = to_dpu_hw_ctl(hw_ctl[ctl_idx]);
1169− cstate->mixers[i].hw_dspp = to_dpu_hw_dspp(hw_dspp[i]);
1170− }
1171−
1172− cstate->num_mixers = num_lm;
1173−
11741191 for (i = 0; i < dpu_enc->num_phys_encs; i++) {
11751192 struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
11761193
1177− if (!dpu_enc->hw_pp[i]) {
1194+ phys->hw_pp = dpu_enc->hw_pp[i];
1195+ if (!phys->hw_pp) {
11781196 DPU_ERROR_ENC(dpu_enc,
11791197 "no pp block assigned at idx: %d\n", i);
11801198 return;
11811199 }
11821200
1183− if (!hw_ctl[i]) {
1201+ phys->hw_ctl = i < num_ctl ? to_dpu_hw_ctl(hw_ctl[i]) : NULL;
1202+ if (!phys->hw_ctl) {
11841203 DPU_ERROR_ENC(dpu_enc,
11851204 "no ctl block assigned at idx: %d\n", i);
11861205 return;
11871206 }
11881207
1189− phys->hw_pp = dpu_enc->hw_pp[i];
1190− phys->hw_ctl = to_dpu_hw_ctl(hw_ctl[i]);
1191−
11921208 phys->cached_mode = crtc_state->adjusted_mode;
11931209 if (phys->ops.atomic_mode_set)
11941210 phys->ops.atomic_mode_set(phys, crtc_state, conn_state);
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c+5−2
@@ -302,7 +302,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine( · 301 unmodified lines
302302 intf_cfg.stream_sel = 0; /* Don't care value for video mode */
303303 intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
304304 intf_cfg.dsc = dpu_encoder_helper_get_dsc(phys_enc);
305− if (phys_enc->hw_pp->merge_3d)
305+ if (intf_cfg.mode_3d && phys_enc->hw_pp->merge_3d)
306306 intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx;
307307
308308 spin_lock_irqsave(phys_enc->enc_spinlock, lock_flags);
@@ -440,10 +440,12 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc) · 131 unmodified lines
440440 struct dpu_hw_ctl *ctl;
441441 const struct msm_format *fmt;
442442 u32 fmt_fourcc;
443+ u32 mode_3d;
443444
444445 ctl = phys_enc->hw_ctl;
445446 fmt_fourcc = dpu_encoder_get_drm_fmt(phys_enc);
446447 fmt = mdp_get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0);
448+ mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
447449
448450 DPU_DEBUG_VIDENC(phys_enc, "\n");
449451
@@ -466,7 +468,8 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc) · 16 unmodified lines
466468 goto skip_flush;
467469
468470 ctl->ops.update_pending_flush_intf(ctl, phys_enc->hw_intf->idx);
469− if (ctl->ops.update_pending_flush_merge_3d && phys_enc->hw_pp->merge_3d)
471+ if (mode_3d && ctl->ops.update_pending_flush_merge_3d &&
472+ phys_enc->hw_pp->merge_3d)
470473 ctl->ops.update_pending_flush_merge_3d(ctl, phys_enc->hw_pp->merge_3d->idx);
471474
472475 if (ctl->ops.update_pending_flush_cdm && phys_enc->hw_cdm)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c+4−1
@@ -275,6 +275,7 @@ static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc) · 274 unmodified lines
275275 struct dpu_hw_pingpong *hw_pp;
276276 struct dpu_hw_cdm *hw_cdm;
277277 u32 pending_flush = 0;
278+ u32 mode_3d;
278279
279280 if (!phys_enc)
280281 return;
@@ -283,6 +284,7 @@ static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc) · 2 unmodified lines
283284 hw_pp = phys_enc->hw_pp;
284285 hw_ctl = phys_enc->hw_ctl;
285286 hw_cdm = phys_enc->hw_cdm;
287+ mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
286288
287289 DPU_DEBUG("[wb:%d]\n", hw_wb->idx - WB_0);
288290
@@ -294,7 +296,8 @@ static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc) · 5 unmodified lines
294296 if (hw_ctl->ops.update_pending_flush_wb)
295297 hw_ctl->ops.update_pending_flush_wb(hw_ctl, hw_wb->idx);
296298
297− if (hw_ctl->ops.update_pending_flush_merge_3d && hw_pp && hw_pp->merge_3d)
299+ if (mode_3d && hw_ctl->ops.update_pending_flush_merge_3d &&
300+ hw_pp && hw_pp->merge_3d)
298301 hw_ctl->ops.update_pending_flush_merge_3d(hw_ctl,
299302 hw_pp->merge_3d->idx);
300303
drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c+10−9
@@ -26,7 +26,7 @@ static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *b · 25 unmodified lines
2626 end_addr = base_addr + aligned_len;
2727
2828 if (!(*reg))
29− *reg = kzalloc(len_padded, GFP_KERNEL);
29+ *reg = kvzalloc(len_padded, GFP_KERNEL);
3030
3131 if (*reg)
3232 dump_addr = *reg;
@@ -48,20 +48,21 @@ static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *b · 15 unmodified lines
4848 }
4949 }
5050
51−static void msm_disp_state_print_regs(u32 **reg, u32 len, void __iomem *base_addr,
52− struct drm_printer *p)
51+static void msm_disp_state_print_regs(const u32 *dump_addr, u32 len,
52+ void __iomem *base_addr, struct drm_printer *p)
5353 {
5454 int i;
55− u32 *dump_addr = NULL;
5655 void __iomem *addr;
5756 u32 num_rows;
5857
58+ if (!dump_addr) {
59+ drm_printf(p, "Registers not stored\n");
60+ return;
61+ }
62+
5963 addr = base_addr;
6064 num_rows = len / REG_DUMP_ALIGN;
6165
62− if (*reg)
63− dump_addr = *reg;
64−
6566 for (i = 0; i < num_rows; i++) {
6667 drm_printf(p, "0x%lx : %08x %08x %08x %08x\n",
6768 (unsigned long)(addr - base_addr),
@@ -89,7 +90,7 @@ void msm_disp_state_print(struct msm_disp_state *state, struct drm_printer *p) · 21 unmodified lines
8990
9091 list_for_each_entry_safe(block, tmp, &state->blocks, node) {
9192 drm_printf(p, "====================%s================\n", block->name);
92− msm_disp_state_print_regs(&block->state, block->size, block->base_addr, p);
93+ msm_disp_state_print_regs(block->state, block->size, block->base_addr, p);
9394 }
9495
9596 drm_printf(p, "===================dpu drm state================\n");
@@ -161,7 +162,7 @@ void msm_disp_state_free(void *data) · 65 unmodified lines
161162
162163 list_for_each_entry_safe(block, tmp, &disp_state->blocks, node) {
163164 list_del(&block->node);
164− kfree(block->state);
165+ kvfree(block->state);
165166 kfree(block);
166167 }
167168
drivers/gpu/drm/msm/dsi/dsi_host.c+2−2
@@ -542,7 +542,7 @@ static unsigned long dsi_adjust_pclk_for_compression(const struct drm_display_mo · 541 unmodified lines
542542
543543 int new_htotal = mode->htotal - mode->hdisplay + new_hdisplay;
544544
545− return new_htotal * mode->vtotal * drm_mode_vrefresh(mode);
545+ return mult_frac(mode->clock * 1000u, new_htotal, mode->htotal);
546546 }
547547
548548 static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode,
@@ -550,7 +550,7 @@ static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, · 1 unmodified line
550550 {
551551 unsigned long pclk_rate;
552552
553− pclk_rate = mode->clock * 1000;
553+ pclk_rate = mode->clock * 1000u;
554554
555555 if (dsc)
556556 pclk_rate = dsi_adjust_pclk_for_compression(mode, dsc);
drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c+0−9
@@ -153,15 +153,6 @@ static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk) · 152 unmodified lines
153153 return dividend - 1;
154154 }
155155
156−static inline u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
157−{
158− u64 fdata = ((u64)pll_cmp) * ref_clk * 10;
159−
160− do_div(fdata, HDMI_PLL_CMP_CNT);
161−
162− return fdata;
163−}
164−
165156 #define HDMI_REF_CLOCK_HZ ((u64)19200000)
166157 #define HDMI_MHZ_TO_HZ ((u64)1000000)
167158 static int pll_get_post_div(struct hdmi_8998_post_divider *pd, u64 bclk)
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h+1−1
@@ -210,7 +210,7 @@ struct nvkm_gsp { · 209 unmodified lines
210210 } *rm;
211211
212212 struct {
213− struct mutex mutex;;
213+ struct mutex mutex;
214214 struct idr idr;
215215 } client_id;
216216
drivers/gpu/drm/nouveau/nouveau_dmem.c+1−1
@@ -193,7 +193,7 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf) · 192 unmodified lines
193193 if (!spage || !(src & MIGRATE_PFN_MIGRATE))
194194 goto done;
195195
196− dpage = alloc_page_vma(GFP_HIGHUSER, vmf->vma, vmf->address);
196+ dpage = alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vmf->vma, vmf->address);
197197 if (!dpage)
198198 goto done;
199199
drivers/gpu/drm/nouveau/nouveau_drm.c+1−1
@@ -332,7 +332,7 @@ nouveau_accel_ce_init(struct nouveau_drm *drm) · 331 unmodified lines
332332 return;
333333 }
334334
335− ret = nouveau_channel_new(&drm->client, false, runm, NvDmaFB, NvDmaTT, &drm->cechan);
335+ ret = nouveau_channel_new(&drm->client, true, runm, NvDmaFB, NvDmaTT, &drm->cechan);
336336 if (ret)
337337 NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
338338 }
drivers/gpu/drm/panel/panel-himax-hx83102.c+6−6
@@ -298,7 +298,7 @@ static int ivo_t109nw41_init(struct hx83102 *ctx) · 297 unmodified lines
298298 msleep(60);
299299
300300 hx83102_enable_extended_cmds(&dsi_ctx, true);
301− mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETPOWER, 0x2c, 0xed, 0xed, 0x0f, 0xcf, 0x42,
301+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETPOWER, 0x2c, 0xed, 0xed, 0x27, 0xe7, 0x52,
302302 0xf5, 0x39, 0x36, 0x36, 0x36, 0x36, 0x32, 0x8b, 0x11, 0x65, 0x00, 0x88,
303303 0xfa, 0xff, 0xff, 0x8f, 0xff, 0x08, 0xd6, 0x33);
304304 mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETDISP, 0x00, 0x47, 0xb0, 0x80, 0x00, 0x12,
@@ -343,11 +343,11 @@ static int ivo_t109nw41_init(struct hx83102 *ctx) · 38 unmodified lines
343343 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
344344 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
345345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
346− mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETGMA, 0x04, 0x04, 0x06, 0x0a, 0x0a, 0x05,
347− 0x12, 0x14, 0x17, 0x13, 0x2c, 0x33, 0x39, 0x4b, 0x4c, 0x56, 0x61, 0x78,
348− 0x7a, 0x41, 0x50, 0x68, 0x73, 0x04, 0x04, 0x06, 0x0a, 0x0a, 0x05, 0x12,
349− 0x14, 0x17, 0x13, 0x2c, 0x33, 0x39, 0x4b, 0x4c, 0x56, 0x61, 0x78, 0x7a,
350− 0x41, 0x50, 0x68, 0x73);
346+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETGMA, 0x00, 0x07, 0x10, 0x17, 0x1c, 0x33,
347+ 0x48, 0x50, 0x57, 0x50, 0x68, 0x6e, 0x71, 0x7f, 0x81, 0x8a, 0x8e, 0x9b,
348+ 0x9c, 0x4d, 0x56, 0x5d, 0x73, 0x00, 0x07, 0x10, 0x17, 0x1c, 0x33, 0x48,
349+ 0x50, 0x57, 0x50, 0x68, 0x6e, 0x71, 0x7f, 0x81, 0x8a, 0x8e, 0x9b, 0x9c,
350+ 0x4d, 0x56, 0x5d, 0x73);
351351 mipi_dsi_dcs_write_seq_multi(&dsi_ctx, HX83102_SETTP1, 0x07, 0x10, 0x10, 0x1a, 0x26, 0x9e,
352352 0x00, 0x4f, 0xa0, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0a, 0x02,
353353 0x02, 0x00, 0x33, 0x02, 0x04, 0x18, 0x01);
drivers/gpu/drm/panthor/panthor_fw.c+2−2
@@ -500,6 +500,7 @@ static int panthor_fw_load_section_entry(struct panthor_device *ptdev, · 499 unmodified lines
500500 struct panthor_fw_binary_iter *iter,
501501 u32 ehdr)
502502 {
503+ ssize_t vm_pgsz = panthor_vm_page_size(ptdev->fw->vm);
503504 struct panthor_fw_binary_section_entry_hdr hdr;
504505 struct panthor_fw_section *section;
505506 u32 section_size;
@@ -528,8 +529,7 @@ static int panthor_fw_load_section_entry(struct panthor_device *ptdev, · 22 unmodified lines
528529 return -EINVAL;
529530 }
530531
531− if ((hdr.va.start & ~PAGE_MASK) != 0 ||
532− (hdr.va.end & ~PAGE_MASK) != 0) {
532+ if (!IS_ALIGNED(hdr.va.start, vm_pgsz) || !IS_ALIGNED(hdr.va.end, vm_pgsz)) {
533533 drm_err(&ptdev->base, "Firmware corrupted, virtual addresses not page aligned: 0x%x-0x%x\n",
534534 hdr.va.start, hdr.va.end);
535535 return -EINVAL;
drivers/gpu/drm/panthor/panthor_gem.c+8−3
@@ -44,8 +44,7 @@ void panthor_kernel_bo_destroy(struct panthor_kernel_bo *bo) · 43 unmodified lines
4444 to_panthor_bo(bo->obj)->exclusive_vm_root_gem != panthor_vm_root_gem(vm)))
4545 goto out_free_bo;
4646
47− ret = panthor_vm_unmap_range(vm, bo->va_node.start,
48− panthor_kernel_bo_size(bo));
47+ ret = panthor_vm_unmap_range(vm, bo->va_node.start, bo->va_node.size);
4948 if (ret)
5049 goto out_free_bo;
5150
@@ -95,10 +94,16 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm, · 43 unmodified lines
9594 }
9695
9796 bo = to_panthor_bo(&obj->base);
98− size = obj->base.size;
9997 kbo->obj = &obj->base;
10098 bo->flags = bo_flags;
10199
100+ /* The system and GPU MMU page size might differ, which becomes a
101+ * problem for FW sections that need to be mapped at explicit address
102+ * since our PAGE_SIZE alignment might cover a VA range that's
103+ * expected to be used for another section.
104+ * Make sure we never map more than we need.
105+ */
106+ size = ALIGN(size, panthor_vm_page_size(vm));
102107 ret = panthor_vm_alloc_va(vm, gpu_va, size, &kbo->va_node);
103108 if (ret)
104109 goto err_put_obj;
drivers/gpu/drm/panthor/panthor_mmu.c+13−3
@@ -826,6 +826,14 @@ void panthor_vm_idle(struct panthor_vm *vm) · 825 unmodified lines
826826 mutex_unlock(&ptdev->mmu->as.slots_lock);
827827 }
828828
829+u32 panthor_vm_page_size(struct panthor_vm *vm)
830+{
831+ const struct io_pgtable *pgt = io_pgtable_ops_to_pgtable(vm->pgtbl_ops);
832+ u32 pg_shift = ffs(pgt->cfg.pgsize_bitmap) - 1;
833+
834+ return 1u << pg_shift;
835+}
836+
829837 static void panthor_vm_stop(struct panthor_vm *vm)
830838 {
831839 drm_sched_stop(&vm->sched, NULL);
@@ -1025,12 +1033,13 @@ int · 193 unmodified lines
10251033 panthor_vm_alloc_va(struct panthor_vm *vm, u64 va, u64 size,
10261034 struct drm_mm_node *va_node)
10271035 {
1036+ ssize_t vm_pgsz = panthor_vm_page_size(vm);
10281037 int ret;
10291038
1030− if (!size || (size & ~PAGE_MASK))
1039+ if (!size || !IS_ALIGNED(size, vm_pgsz))
10311040 return -EINVAL;
10321041
1033− if (va != PANTHOR_VM_KERNEL_AUTO_VA && (va & ~PAGE_MASK))
1042+ if (va != PANTHOR_VM_KERNEL_AUTO_VA && !IS_ALIGNED(va, vm_pgsz))
10341043 return -EINVAL;
10351044
10361045 mutex_lock(&vm->mm_lock);
@@ -2366,11 +2375,12 @@ panthor_vm_bind_prepare_op_ctx(struct drm_file *file, · 1329 unmodified lines
23662375 const struct drm_panthor_vm_bind_op *op,
23672376 struct panthor_vm_op_ctx *op_ctx)
23682377 {
2378+ ssize_t vm_pgsz = panthor_vm_page_size(vm);
23692379 struct drm_gem_object *gem;
23702380 int ret;
23712381
23722382 /* Aligned on page size. */
2373− if ((op->va | op->size) & ~PAGE_MASK)
2383+ if (!IS_ALIGNED(op->va | op->size, vm_pgsz))
23742384 return -EINVAL;
23752385
23762386 switch (op->flags & DRM_PANTHOR_VM_BIND_OP_TYPE_MASK) {
drivers/gpu/drm/panthor/panthor_mmu.h+1−0
@@ -30,6 +30,7 @@ panthor_vm_get_bo_for_va(struct panthor_vm *vm, u64 va, u64 *bo_offset); · 29 unmodified lines
3030
3131 int panthor_vm_active(struct panthor_vm *vm);
3232 void panthor_vm_idle(struct panthor_vm *vm);
33+u32 panthor_vm_page_size(struct panthor_vm *vm);
3334 int panthor_vm_as(struct panthor_vm *vm);
3435 int panthor_vm_flush_all(struct panthor_vm *vm);
3536
drivers/gpu/drm/panthor/panthor_sched.c+16−4
@@ -602,10 +602,11 @@ struct panthor_group { · 601 unmodified lines
602602 * @timedout: True when a timeout occurred on any of the queues owned by
603603 * this group.
604604 *
605− * Timeouts can be reported by drm_sched or by the FW. In any case, any
606− * timeout situation is unrecoverable, and the group becomes useless.
607− * We simply wait for all references to be dropped so we can release the
608− * group object.
605+ * Timeouts can be reported by drm_sched or by the FW. If a reset is required,
606+ * and the group can't be suspended, this also leads to a timeout. In any case,
607+ * any timeout situation is unrecoverable, and the group becomes useless. We
608+ * simply wait for all references to be dropped so we can release the group
609+ * object.
609610 */
610611 bool timedout;
611612
@@ -2687,6 +2688,12 @@ void panthor_sched_suspend(struct panthor_device *ptdev) · 2075 unmodified lines
26872688 csgs_upd_ctx_init(&upd_ctx);
26882689 while (slot_mask) {
26892690 u32 csg_id = ffs(slot_mask) - 1;
2691+ struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id];
2692+
2693+ /* We consider group suspension failures as fatal and flag the
2694+ * group as unusable by setting timedout=true.
2695+ */
2696+ csg_slot->group->timedout = true;
26902697
26912698 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id,
26922699 CSG_STATE_TERMINATE,
@@ -3688,6 +3695,11 @@ panthor_job_create(struct panthor_file *pfile, · 995 unmodified lines
36883695 goto err_put_job;
36893696 }
36903697
3698+ if (!group_can_run(job->group)) {
3699+ ret = -EINVAL;
3700+ goto err_put_job;
3701+ }
3702+
36913703 if (job->queue_idx >= job->group->queue_count ||
36923704 !job->group->queues[job->queue_idx]) {
36933705 ret = -EINVAL;
drivers/gpu/drm/scheduler/sched_main.c+13−1
@@ -87,6 +87,12 @@ · 86 unmodified lines
8787 #define CREATE_TRACE_POINTS
8888 #include "gpu_scheduler_trace.h"
8989
90+#ifdef CONFIG_LOCKDEP
91+static struct lockdep_map drm_sched_lockdep_map = {
92+ .name = "drm_sched_lockdep_map"
93+};
94+#endif
95+
9096 #define to_drm_sched_job(sched_job) \
9197 container_of((sched_job), struct drm_sched_job, queue_node)
9298
@@ -1286,7 +1292,13 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, · 1193 unmodified lines
12861292 sched->submit_wq = submit_wq;
12871293 sched->own_submit_wq = false;
12881294 } else {
1289− sched->submit_wq = alloc_ordered_workqueue(name, 0);
1295+#ifdef CONFIG_LOCKDEP
1296+ sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name,
1297+ WQ_MEM_RECLAIM,
1298+ &drm_sched_lockdep_map);
1299+#else
1300+ sched->submit_wq = alloc_ordered_workqueue(name, WQ_MEM_RECLAIM);
1301+#endif
12901302 if (!sched->submit_wq)
12911303 return -ENOMEM;
12921304
drivers/gpu/drm/tegra/drm.c+2−2
@@ -1156,8 +1156,8 @@ static int host1x_drm_probe(struct host1x_device *dev) · 1155 unmodified lines
11561156
11571157 if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) {
11581158 tegra->domain = iommu_paging_domain_alloc(dma_dev);
1159− if (!tegra->domain) {
1160− err = -ENOMEM;
1159+ if (IS_ERR(tegra->domain)) {
1160+ err = PTR_ERR(tegra->domain);
11611161 goto free;
11621162 }
11631163
drivers/gpu/drm/tests/drm_connector_test.c+12−12
@@ -996,7 +996,7 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb(struct kunit *test) · 995 unmodified lines
996996 unsigned long long rate;
997997 struct drm_device *drm = &priv->drm;
998998
999− mode = drm_display_mode_from_cea_vic(drm, 16);
999+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
10001000 KUNIT_ASSERT_NOT_NULL(test, mode);
10011001
10021002 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1017,7 +1017,7 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc(struct kunit *test) · 14 unmodified lines
10171017 unsigned long long rate;
10181018 struct drm_device *drm = &priv->drm;
10191019
1020− mode = drm_display_mode_from_cea_vic(drm, 16);
1020+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
10211021 KUNIT_ASSERT_NOT_NULL(test, mode);
10221022
10231023 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1038,7 +1038,7 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1(struct kunit *t · 14 unmodified lines
10381038 unsigned long long rate;
10391039 struct drm_device *drm = &priv->drm;
10401040
1041− mode = drm_display_mode_from_cea_vic(drm, 1);
1041+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
10421042 KUNIT_ASSERT_NOT_NULL(test, mode);
10431043
10441044 rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_RGB);
@@ -1056,7 +1056,7 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc(struct kunit *test) · 11 unmodified lines
10561056 unsigned long long rate;
10571057 struct drm_device *drm = &priv->drm;
10581058
1059− mode = drm_display_mode_from_cea_vic(drm, 16);
1059+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
10601060 KUNIT_ASSERT_NOT_NULL(test, mode);
10611061
10621062 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1077,7 +1077,7 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1(struct kunit *t · 14 unmodified lines
10771077 unsigned long long rate;
10781078 struct drm_device *drm = &priv->drm;
10791079
1080− mode = drm_display_mode_from_cea_vic(drm, 1);
1080+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
10811081 KUNIT_ASSERT_NOT_NULL(test, mode);
10821082
10831083 rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_RGB);
@@ -1095,7 +1095,7 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_double(struct kunit *test) · 11 unmodified lines
10951095 unsigned long long rate;
10961096 struct drm_device *drm = &priv->drm;
10971097
1098− mode = drm_display_mode_from_cea_vic(drm, 6);
1098+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 6);
10991099 KUNIT_ASSERT_NOT_NULL(test, mode);
11001100
11011101 KUNIT_ASSERT_TRUE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1118,7 +1118,7 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv420_valid(struct kunit · 16 unmodified lines
11181118 unsigned long long rate;
11191119 unsigned int vic = *(unsigned int *)test->param_value;
11201120
1121− mode = drm_display_mode_from_cea_vic(drm, vic);
1121+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic);
11221122 KUNIT_ASSERT_NOT_NULL(test, mode);
11231123
11241124 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1155,7 +1155,7 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc(struct kuni · 30 unmodified lines
11551155 drm_hdmi_compute_mode_clock_yuv420_vic_valid_tests[0];
11561156 unsigned long long rate;
11571157
1158− mode = drm_display_mode_from_cea_vic(drm, vic);
1158+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic);
11591159 KUNIT_ASSERT_NOT_NULL(test, mode);
11601160
11611161 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1180,7 +1180,7 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc(struct kuni · 18 unmodified lines
11801180 drm_hdmi_compute_mode_clock_yuv420_vic_valid_tests[0];
11811181 unsigned long long rate;
11821182
1183− mode = drm_display_mode_from_cea_vic(drm, vic);
1183+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic);
11841184 KUNIT_ASSERT_NOT_NULL(test, mode);
11851185
11861186 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1203,7 +1203,7 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc(struct kunit · 16 unmodified lines
12031203 struct drm_device *drm = &priv->drm;
12041204 unsigned long long rate;
12051205
1206− mode = drm_display_mode_from_cea_vic(drm, 16);
1206+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
12071207 KUNIT_ASSERT_NOT_NULL(test, mode);
12081208
12091209 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1225,7 +1225,7 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc(struct kuni · 15 unmodified lines
12251225 struct drm_device *drm = &priv->drm;
12261226 unsigned long long rate;
12271227
1228− mode = drm_display_mode_from_cea_vic(drm, 16);
1228+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
12291229 KUNIT_ASSERT_NOT_NULL(test, mode);
12301230
12311231 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
@@ -1247,7 +1247,7 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc(struct kuni · 15 unmodified lines
12471247 struct drm_device *drm = &priv->drm;
12481248 unsigned long long rate;
12491249
1250− mode = drm_display_mode_from_cea_vic(drm, 16);
1250+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
12511251 KUNIT_ASSERT_NOT_NULL(test, mode);
12521252
12531253 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c+4−4
@@ -441,7 +441,7 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_vic_1(struct kunit *test) · 440 unmodified lines
441441 ctx = drm_kunit_helper_acquire_ctx_alloc(test);
442442 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
443443
444− mode = drm_display_mode_from_cea_vic(drm, 1);
444+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
445445 KUNIT_ASSERT_NOT_NULL(test, mode);
446446
447447 drm = &priv->drm;
@@ -555,7 +555,7 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_vic_1(struct kunit *test) · 107 unmodified lines
555555 ctx = drm_kunit_helper_acquire_ctx_alloc(test);
556556 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
557557
558− mode = drm_display_mode_from_cea_vic(drm, 1);
558+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
559559 KUNIT_ASSERT_NOT_NULL(test, mode);
560560
561561 drm = &priv->drm;
@@ -671,7 +671,7 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te · 109 unmodified lines
671671 ctx = drm_kunit_helper_acquire_ctx_alloc(test);
672672 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
673673
674− mode = drm_display_mode_from_cea_vic(drm, 1);
674+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
675675 KUNIT_ASSERT_NOT_NULL(test, mode);
676676
677677 drm = &priv->drm;
@@ -1263,7 +1263,7 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) · 585 unmodified lines
12631263 ctx = drm_kunit_helper_acquire_ctx_alloc(test);
12641264 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
12651265
1266− mode = drm_display_mode_from_cea_vic(drm, 1);
1266+ mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
12671267 KUNIT_ASSERT_NOT_NULL(test, mode);
12681268
12691269 /*
drivers/gpu/drm/tests/drm_kunit_helpers.c+42−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <drm/drm_atomic.h>
44 #include <drm/drm_atomic_helper.h>
55 #include <drm/drm_drv.h>
6+#include <drm/drm_edid.h>
67 #include <drm/drm_fourcc.h>
78 #include <drm/drm_kunit_helpers.h>
89 #include <drm/drm_managed.h>
@@ -311,6 +312,47 @@ drm_kunit_helper_create_crtc(struct kunit *test, · 302 unmodified lines
311312 }
312313 EXPORT_SYMBOL_GPL(drm_kunit_helper_create_crtc);
313314
315+static void kunit_action_drm_mode_destroy(void *ptr)
316+{
317+ struct drm_display_mode *mode = ptr;
318+
319+ drm_mode_destroy(NULL, mode);
320+}
321+
322+/**
323+ * drm_kunit_display_mode_from_cea_vic() - return a mode for CEA VIC
324+ for a KUnit test
325+ * @test: The test context object
326+ * @dev: DRM device
327+ * @video_code: CEA VIC of the mode
328+ *
329+ * Creates a new mode matching the specified CEA VIC for a KUnit test.
330+ *
331+ * Resources will be cleaned up automatically.
332+ *
333+ * Returns: A new drm_display_mode on success or NULL on failure
334+ */
335+struct drm_display_mode *
336+drm_kunit_display_mode_from_cea_vic(struct kunit *test, struct drm_device *dev,
337+ u8 video_code)
338+{
339+ struct drm_display_mode *mode;
340+ int ret;
341+
342+ mode = drm_display_mode_from_cea_vic(dev, video_code);
343+ if (!mode)
344+ return NULL;
345+
346+ ret = kunit_add_action_or_reset(test,
347+ kunit_action_drm_mode_destroy,
348+ mode);
349+ if (ret)
350+ return NULL;
351+
352+ return mode;
353+}
354+EXPORT_SYMBOL_GPL(drm_kunit_display_mode_from_cea_vic);
355+
314356 MODULE_AUTHOR("Maxime Ripard <maxime@cerno.tech>");
315357 MODULE_DESCRIPTION("KUnit test suite helper functions");
316358 MODULE_LICENSE("GPL");
drivers/gpu/drm/v3d/v3d_perfmon.c+8−1
@@ -306,6 +306,11 @@ void v3d_perfmon_open_file(struct v3d_file_priv *v3d_priv) · 305 unmodified lines
306306 static int v3d_perfmon_idr_del(int id, void *elem, void *data)
307307 {
308308 struct v3d_perfmon *perfmon = elem;
309+ struct v3d_dev *v3d = (struct v3d_dev *)data;
310+
311+ /* If the active perfmon is being destroyed, stop it first */
312+ if (perfmon == v3d->active_perfmon)
313+ v3d_perfmon_stop(v3d, perfmon, false);
309314
310315 v3d_perfmon_put(perfmon);
311316
@@ -314,8 +319,10 @@ static int v3d_perfmon_idr_del(int id, void *elem, void *data) · 2 unmodified lines
314319
315320 void v3d_perfmon_close_file(struct v3d_file_priv *v3d_priv)
316321 {
322+ struct v3d_dev *v3d = v3d_priv->v3d;
323+
317324 mutex_lock(&v3d_priv->perfmon.lock);
318− idr_for_each(&v3d_priv->perfmon.idr, v3d_perfmon_idr_del, NULL);
325+ idr_for_each(&v3d_priv->perfmon.idr, v3d_perfmon_idr_del, v3d);
319326 idr_destroy(&v3d_priv->perfmon.idr);
320327 mutex_unlock(&v3d_priv->perfmon.lock);
321328 mutex_destroy(&v3d_priv->perfmon.lock);
drivers/gpu/drm/vc4/vc4_perfmon.c+6−1
@@ -116,6 +116,11 @@ void vc4_perfmon_open_file(struct vc4_file *vc4file) · 115 unmodified lines
116116 static int vc4_perfmon_idr_del(int id, void *elem, void *data)
117117 {
118118 struct vc4_perfmon *perfmon = elem;
119+ struct vc4_dev *vc4 = (struct vc4_dev *)data;
120+
121+ /* If the active perfmon is being destroyed, stop it first */
122+ if (perfmon == vc4->active_perfmon)
123+ vc4_perfmon_stop(vc4, perfmon, false);
119124
120125 vc4_perfmon_put(perfmon);
121126
@@ -130,7 +135,7 @@ void vc4_perfmon_close_file(struct vc4_file *vc4file) · 8 unmodified lines
130135 return;
131136
132137 mutex_lock(&vc4file->perfmon.lock);
133− idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, NULL);
138+ idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, vc4);
134139 idr_destroy(&vc4file->perfmon.idr);
135140 mutex_unlock(&vc4file->perfmon.lock);
136141 mutex_destroy(&vc4file->perfmon.lock);
drivers/gpu/drm/vmwgfx/vmwgfx_blit.c+2−4
@@ -635,10 +635,8 @@ out: · 634 unmodified lines
635635 kunmap_atomic(d.src_addr);
636636 if (d.dst_addr)
637637 kunmap_atomic(d.dst_addr);
638− if (src_pages)
639− kvfree(src_pages);
640− if (dst_pages)
641− kvfree(dst_pages);
638+ kvfree(src_pages);
639+ kvfree(dst_pages);
642640
643641 return ret;
644642 }
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+2−2
@@ -62,7 +62,7 @@ · 61 unmodified lines
6262 #define VMWGFX_DRIVER_MINOR 20
6363 #define VMWGFX_DRIVER_PATCHLEVEL 0
6464 #define VMWGFX_FIFO_STATIC_SIZE (1024*1024)
65−#define VMWGFX_MAX_DISPLAYS 16
65+#define VMWGFX_NUM_DISPLAY_UNITS 8
6666 #define VMWGFX_CMD_BOUNCE_INIT_SIZE 32768
6767
6868 #define VMWGFX_MIN_INITIAL_WIDTH 1280
@@ -82,7 +82,7 @@ · 13 unmodified lines
8282 #define VMWGFX_NUM_GB_CONTEXT 256
8383 #define VMWGFX_NUM_GB_SHADER 20000
8484 #define VMWGFX_NUM_GB_SURFACE 32768
85−#define VMWGFX_NUM_GB_SCREEN_TARGET VMWGFX_MAX_DISPLAYS
85+#define VMWGFX_NUM_GB_SCREEN_TARGET VMWGFX_NUM_DISPLAY_UNITS
8686 #define VMWGFX_NUM_DXCONTEXT 256
8787 #define VMWGFX_NUM_DXQUERY 512
8888 #define VMWGFX_NUM_MOB (VMWGFX_NUM_GB_CONTEXT +\
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+4−30
@@ -1283,7 +1283,6 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, · 1282 unmodified lines
12831283 {
12841284 struct drm_device *dev = &dev_priv->drm;
12851285 struct vmw_framebuffer_surface *vfbs;
1286− enum SVGA3dSurfaceFormat format;
12871286 struct vmw_surface *surface;
12881287 int ret;
12891288
@@ -1320,34 +1319,6 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, · 30 unmodified lines
13201319 return -EINVAL;
13211320 }
13221321
1323− switch (mode_cmd->pixel_format) {
1324− case DRM_FORMAT_ARGB8888:
1325− format = SVGA3D_A8R8G8B8;
1326− break;
1327− case DRM_FORMAT_XRGB8888:
1328− format = SVGA3D_X8R8G8B8;
1329− break;
1330− case DRM_FORMAT_RGB565:
1331− format = SVGA3D_R5G6B5;
1332− break;
1333− case DRM_FORMAT_XRGB1555:
1334− format = SVGA3D_A1R5G5B5;
1335− break;
1336− default:
1337− DRM_ERROR("Invalid pixel format: %p4cc\n",
1338− &mode_cmd->pixel_format);
1339− return -EINVAL;
1340− }
1341−
1342− /*
1343− * For DX, surface format validation is done when surface->scanout
1344− * is set.
1345− */
1346− if (!has_sm4_context(dev_priv) && format != surface->metadata.format) {
1347− DRM_ERROR("Invalid surface format for requested mode.\n");
1348− return -EINVAL;
1349− }
1350−
13511322 vfbs = kzalloc(sizeof(*vfbs), GFP_KERNEL);
13521323 if (!vfbs) {
13531324 ret = -ENOMEM;
@@ -1539,6 +1510,7 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, · 185 unmodified lines
15391510 DRM_ERROR("Surface size cannot exceed %dx%d\n",
15401511 dev_priv->texture_max_width,
15411512 dev_priv->texture_max_height);
1513+ ret = -EINVAL;
15421514 goto err_out;
15431515 }
15441516
@@ -2225,7 +2197,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, · 680 unmodified lines
22252197 struct drm_mode_config *mode_config = &dev->mode_config;
22262198 struct drm_vmw_update_layout_arg *arg =
22272199 (struct drm_vmw_update_layout_arg *)data;
2228− void __user *user_rects;
2200+ const void __user *user_rects;
22292201 struct drm_vmw_rect *rects;
22302202 struct drm_rect *drm_rects;
22312203 unsigned rects_size;
@@ -2237,6 +2209,8 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, · 5 unmodified lines
22372209 VMWGFX_MIN_INITIAL_HEIGHT};
22382210 vmw_du_update_layout(dev_priv, 1, &def_rect);
22392211 return 0;
2212+ } else if (arg->num_outputs > VMWGFX_NUM_DISPLAY_UNITS) {
2213+ return -E2BIG;
22402214 }
22412215
22422216 rects_size = arg->num_outputs * sizeof(struct drm_vmw_rect);
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h+0−3
@@ -199,9 +199,6 @@ struct vmw_kms_dirty { · 198 unmodified lines
199199 s32 unit_y2;
200200 };
201201
202−#define VMWGFX_NUM_DISPLAY_UNITS 8
203−
204−
205202 #define vmw_framebuffer_to_vfb(x) \
206203 container_of(x, struct vmw_framebuffer, base)
207204 #define vmw_framebuffer_to_vfbs(x) \
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c+4−0
@@ -886,6 +886,10 @@ static int vmw_stdu_connector_atomic_check(struct drm_connector *conn, · 885 unmodified lines
886886 struct drm_crtc_state *new_crtc_state;
887887
888888 conn_state = drm_atomic_get_connector_state(state, conn);
889+
890+ if (IS_ERR(conn_state))
891+ return PTR_ERR(conn_state);
892+
889893 du = vmw_connector_to_stdu(conn);
890894
891895 if (!conn_state->crtc)
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c+6−3
@@ -2276,9 +2276,12 @@ int vmw_dumb_create(struct drm_file *file_priv, · 2275 unmodified lines
22762276 const struct SVGA3dSurfaceDesc *desc = vmw_surface_get_desc(format);
22772277 SVGA3dSurfaceAllFlags flags = SVGA3D_SURFACE_HINT_TEXTURE |
22782278 SVGA3D_SURFACE_HINT_RENDERTARGET |
2279− SVGA3D_SURFACE_SCREENTARGET |
2280− SVGA3D_SURFACE_BIND_SHADER_RESOURCE |
2281− SVGA3D_SURFACE_BIND_RENDER_TARGET;
2279+ SVGA3D_SURFACE_SCREENTARGET;
2280+
2281+ if (vmw_surface_is_dx_screen_target_format(format)) {
2282+ flags |= SVGA3D_SURFACE_BIND_SHADER_RESOURCE |
2283+ SVGA3D_SURFACE_BIND_RENDER_TARGET;
2284+ }
22822285
22832286 /*
22842287 * Without mob support we're just going to use raw memory buffer
drivers/gpu/drm/xe/regs/xe_gt_regs.h+0−6
@@ -410,12 +410,6 @@ · 409 unmodified lines
410410
411411 #define XE2LPM_SCRATCH3_LBCF XE_REG_MCR(0xb654)
412412
413−#define XE2LPM_L3SQCREG2 XE_REG_MCR(0xb604)
414−
415−#define XE2LPM_L3SQCREG3 XE_REG_MCR(0xb608)
416−
417−#define XE2LPM_SCRATCH3_LBCF XE_REG_MCR(0xb654)
418−
419413 #define XE2LPM_L3SQCREG5 XE_REG_MCR(0xb658)
420414
421415 #define XE2_TDF_CTRL XE_REG(0xb418)
drivers/gpu/drm/xe/xe_force_wake.c+9−3
@@ -115,9 +115,15 @@ static int __domain_wait(struct xe_gt *gt, struct xe_force_wake_domain *domain, · 114 unmodified lines
115115 XE_FORCE_WAKE_ACK_TIMEOUT_MS * USEC_PER_MSEC,
116116 &value, true);
117117 if (ret)
118− xe_gt_notice(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
119− domain->id, str_wake_sleep(wake), ERR_PTR(ret),
120− domain->reg_ack.addr, value);
118+ xe_gt_err(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
119+ domain->id, str_wake_sleep(wake), ERR_PTR(ret),
120+ domain->reg_ack.addr, value);
121+ if (value == ~0) {
122+ xe_gt_err(gt,
123+ "Force wake domain %d: %s. MMIO unreliable (forcewake register returns 0xFFFFFFFF)!\n",
124+ domain->id, str_wake_sleep(wake));
125+ ret = -EIO;
126+ }
121127
122128 return ret;
123129 }
drivers/gpu/drm/xe/xe_ggtt.c+10−0
@@ -401,6 +401,16 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt) · 400 unmodified lines
401401
402402 static void xe_ggtt_invalidate(struct xe_ggtt *ggtt)
403403 {
404+ struct xe_device *xe = tile_to_xe(ggtt->tile);
405+
406+ /*
407+ * XXX: Barrier for GGTT pages. Unsure exactly why this required but
408+ * without this LNL is having issues with the GuC reading scratch page
409+ * vs. correct GGTT page. Not particularly a hot code path so blindly
410+ * do a mmio read here which results in GuC reading correct GGTT page.
411+ */
412+ xe_mmio_read32(&xe_root_mmio_gt(xe)->mmio, VF_CAP_REG);
413+
404414 /* Each GT in a tile has its own TLB to cache GGTT lookups */
405415 ggtt_invalidate_gt_tlb(ggtt->tile->primary_gt);
406416 ggtt_invalidate_gt_tlb(ggtt->tile->media_gt);
drivers/gpu/drm/xe/xe_guc_ct.c+18−0
@@ -1018,6 +1018,24 @@ retry_same_fence: · 1017 unmodified lines
10181018
10191019 ret = wait_event_timeout(ct->g2h_fence_wq, g2h_fence.done, HZ);
10201020
1021+ /*
1022+ * Occasionally it is seen that the G2H worker starts running after a delay of more than
1023+ * a second even after being queued and activated by the Linux workqueue subsystem. This
1024+ * leads to G2H timeout error. The root cause of issue lies with scheduling latency of
1025+ * Lunarlake Hybrid CPU. Issue dissappears if we disable Lunarlake atom cores from BIOS
1026+ * and this is beyond xe kmd.
1027+ *
1028+ * TODO: Drop this change once workqueue scheduling delay issue is fixed on LNL Hybrid CPU.
1029+ */
1030+ if (!ret) {
1031+ flush_work(&ct->g2h_worker);
1032+ if (g2h_fence.done) {
1033+ xe_gt_warn(gt, "G2H fence %u, action %04x, done\n",
1034+ g2h_fence.seqno, action[0]);
1035+ ret = 1;
1036+ }
1037+ }
1038+
10211039 /*
10221040 * Ensure we serialize with completion side to prevent UAF with fence going out of scope on
10231041 * the stack, since we have no clue if it will fire after the timeout before we can erase
drivers/gpu/drm/xe/xe_guc_submit.c+25−83
@@ -225,80 +225,11 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q) · 224 unmodified lines
225225 EXEC_QUEUE_STATE_BANNED));
226226 }
227227
228−#ifdef CONFIG_PROVE_LOCKING
229−static int alloc_submit_wq(struct xe_guc *guc)
230−{
231− int i;
232−
233− for (i = 0; i < NUM_SUBMIT_WQ; ++i) {
234− guc->submission_state.submit_wq_pool[i] =
235− alloc_ordered_workqueue("submit_wq", 0);
236− if (!guc->submission_state.submit_wq_pool[i])
237− goto err_free;
238− }
239−
240− return 0;
241−
242−err_free:
243− while (i)
244− destroy_workqueue(guc->submission_state.submit_wq_pool[--i]);
245−
246− return -ENOMEM;
247−}
248−
249−static void free_submit_wq(struct xe_guc *guc)
250−{
251− int i;
252−
253− for (i = 0; i < NUM_SUBMIT_WQ; ++i)
254− destroy_workqueue(guc->submission_state.submit_wq_pool[i]);
255−}
256−
257−static struct workqueue_struct *get_submit_wq(struct xe_guc *guc)
258−{
259− int idx = guc->submission_state.submit_wq_idx++ % NUM_SUBMIT_WQ;
260−
261− return guc->submission_state.submit_wq_pool[idx];
262−}
263−#else
264−static int alloc_submit_wq(struct xe_guc *guc)
265−{
266− return 0;
267−}
268−
269−static void free_submit_wq(struct xe_guc *guc)
270−{
271−
272−}
273−
274−static struct workqueue_struct *get_submit_wq(struct xe_guc *guc)
275−{
276− return NULL;
277−}
278−#endif
279−
280−static void xe_guc_submit_fini(struct xe_guc *guc)
281−{
282− struct xe_device *xe = guc_to_xe(guc);
283− struct xe_gt *gt = guc_to_gt(guc);
284− int ret;
285−
286− ret = wait_event_timeout(guc->submission_state.fini_wq,
287− xa_empty(&guc->submission_state.exec_queue_lookup),
288− HZ * 5);
289−
290− drain_workqueue(xe->destroy_wq);
291−
292− xe_gt_assert(gt, ret);
293−}
294−
295228 static void guc_submit_fini(struct drm_device *drm, void *arg)
296229 {
297230 struct xe_guc *guc = arg;
298231
299− xe_guc_submit_fini(guc);
300232 xa_destroy(&guc->submission_state.exec_queue_lookup);
301− free_submit_wq(guc);
302233 }
303234
304235 static void guc_submit_wedged_fini(void *arg)
@@ -360,10 +291,6 @@ int xe_guc_submit_init(struct xe_guc *guc, unsigned int num_ids) · 55 unmodified lines
360291 if (err)
361292 return err;
362293
363− err = alloc_submit_wq(guc);
364− if (err)
365− return err;
366−
367294 gt->exec_queue_ops = &guc_exec_queue_ops;
368295
369296 xa_init(&guc->submission_state.exec_queue_lookup);
@@ -990,12 +917,22 @@ static void xe_guc_exec_queue_lr_cleanup(struct work_struct *w) · 620 unmodified lines
990917 static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job)
991918 {
992919 struct xe_gt *gt = guc_to_gt(exec_queue_to_guc(q));
993− u32 ctx_timestamp = xe_lrc_ctx_timestamp(q->lrc[0]);
994− u32 ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
920+ u32 ctx_timestamp, ctx_job_timestamp;
995921 u32 timeout_ms = q->sched_props.job_timeout_ms;
996922 u32 diff;
997923 u64 running_time_ms;
998924
925+ if (!xe_sched_job_started(job)) {
926+ xe_gt_warn(gt, "Check job timeout: seqno=%u, lrc_seqno=%u, guc_id=%d, not started",
927+ xe_sched_job_seqno(job), xe_sched_job_lrc_seqno(job),
928+ q->guc->id);
929+
930+ return xe_sched_invalidate_job(job, 2);
931+ }
932+
933+ ctx_timestamp = xe_lrc_ctx_timestamp(q->lrc[0]);
934+ ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
935+
999936 /*
1000937 * Counter wraps at ~223s at the usual 19.2MHz, be paranoid catch
1001938 * possible overflows with a high timeout.
@@ -1124,10 +1061,6 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 122 unmodified lines
11241061 exec_queue_killed_or_banned_or_wedged(q) ||
11251062 exec_queue_destroyed(q);
11261063
1127− /* Job hasn't started, can't be timed out */
1128− if (!skip_timeout_check && !xe_sched_job_started(job))
1129− goto rearm;
1130−
11311064 /*
11321065 * If devcoredump not captured and GuC capture for the job is not ready
11331066 * do manual capture first and decide later if we need to use it
@@ -1499,8 +1432,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) · 365 unmodified lines
14991432 timeout = (q->vm && xe_vm_in_lr_mode(q->vm)) ? MAX_SCHEDULE_TIMEOUT :
15001433 msecs_to_jiffies(q->sched_props.job_timeout_ms);
15011434 err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops,
1502− get_submit_wq(guc),
1503− q->lrc[0]->ring.size / MAX_JOB_SIZE_BYTES, 64,
1435+ NULL, q->lrc[0]->ring.size / MAX_JOB_SIZE_BYTES, 64,
15041436 timeout, guc_to_gt(guc)->ordered_wq, NULL,
15051437 q->name, gt_to_xe(q->gt)->drm.dev);
15061438 if (err)
@@ -1817,8 +1749,13 @@ void xe_guc_submit_stop(struct xe_guc *guc) · 310 unmodified lines
18171749
18181750 mutex_lock(&guc->submission_state.lock);
18191751
1820− xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
1752+ xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
1753+ /* Prevent redundant attempts to stop parallel queues */
1754+ if (q->guc->id != index)
1755+ continue;
1756+
18211757 guc_exec_queue_stop(guc, q);
1758+ }
18221759
18231760 mutex_unlock(&guc->submission_state.lock);
18241761
@@ -1856,8 +1793,13 @@ int xe_guc_submit_start(struct xe_guc *guc) · 31 unmodified lines
18561793
18571794 mutex_lock(&guc->submission_state.lock);
18581795 atomic_dec(&guc->submission_state.stopped);
1859− xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
1796+ xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
1797+ /* Prevent redundant attempts to start parallel queues */
1798+ if (q->guc->id != index)
1799+ continue;
1800+
18601801 guc_exec_queue_start(q);
1802+ }
18611803 mutex_unlock(&guc->submission_state.lock);
18621804
18631805 wake_up_all(&guc->ct.wq);
drivers/gpu/drm/xe/xe_guc_types.h+0−7
@@ -74,13 +74,6 @@ struct xe_guc { · 73 unmodified lines
7474 atomic_t stopped;
7575 /** @submission_state.lock: protects submission state */
7676 struct mutex lock;
77−#ifdef CONFIG_PROVE_LOCKING
78−#define NUM_SUBMIT_WQ 256
79− /** @submission_state.submit_wq_pool: submission ordered workqueues pool */
80− struct workqueue_struct *submit_wq_pool[NUM_SUBMIT_WQ];
81− /** @submission_state.submit_wq_idx: submission ordered workqueue index */
82− int submit_wq_idx;
83−#endif
8477 /** @submission_state.enabled: submission is enabled */
8578 bool enabled;
8679 /** @submission_state.fini_wq: submit fini wait queue */
drivers/gpu/drm/xe/xe_sync.c+2−1
@@ -54,8 +54,9 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr, · 53 unmodified lines
5454 {
5555 struct xe_user_fence *ufence;
5656 u64 __user *ptr = u64_to_user_ptr(addr);
57+ u64 __maybe_unused prefetch_val;
5758
58− if (!access_ok(ptr, sizeof(*ptr)))
59+ if (get_user(prefetch_val, ptr))
5960 return ERR_PTR(-EFAULT);
6061
6162 ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
drivers/hid/amd-sfh-hid/amd_sfh_client.c+3−11
@@ -236,9 +236,9 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) · 235 unmodified lines
236236 cl_data->in_data = in_data;
237237
238238 for (i = 0; i < cl_data->num_hid_devices; i++) {
239− in_data->sensor_virt_addr[i] = dma_alloc_coherent(dev, sizeof(int) * 8,
240− &cl_data->sensor_dma_addr[i],
241− GFP_KERNEL);
239+ in_data->sensor_virt_addr[i] = dmam_alloc_coherent(dev, sizeof(int) * 8,
240+ &cl_data->sensor_dma_addr[i],
241+ GFP_KERNEL);
242242 if (!in_data->sensor_virt_addr[i]) {
243243 rc = -ENOMEM;
244244 goto cleanup;
@@ -331,7 +331,6 @@ cleanup: · 86 unmodified lines
331331 int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
332332 {
333333 struct amdtp_cl_data *cl_data = privdata->cl_data;
334− struct amd_input_data *in_data = cl_data->in_data;
335334 int i, status;
336335
337336 for (i = 0; i < cl_data->num_hid_devices; i++) {
@@ -351,12 +350,5 @@ int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata) · 13 unmodified lines
351350 cancel_delayed_work_sync(&cl_data->work_buffer);
352351 amdtp_hid_remove(cl_data);
353352
354− for (i = 0; i < cl_data->num_hid_devices; i++) {
355− if (in_data->sensor_virt_addr[i]) {
356− dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
357− in_data->sensor_virt_addr[i],
358− cl_data->sensor_dma_addr[i]);
359− }
360− }
361353 return 0;
362354 }
drivers/hid/hid-ids.h+4−0
@@ -509,6 +509,7 @@ · 508 unmodified lines
509509 #define I2C_DEVICE_ID_GOODIX_01E8 0x01e8
510510 #define I2C_DEVICE_ID_GOODIX_01E9 0x01e9
511511 #define I2C_DEVICE_ID_GOODIX_01F0 0x01f0
512+#define I2C_DEVICE_ID_GOODIX_0D42 0x0d42
512513
513514 #define USB_VENDOR_ID_GOODTOUCH 0x1aad
514515 #define USB_DEVICE_ID_GOODTOUCH_000f 0x000f
@@ -868,6 +869,7 @@ · 353 unmodified lines
868869 #define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1 0xc539
869870 #define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1_1 0xc53f
870871 #define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_POWERPLAY 0xc53a
872+#define USB_DEVICE_ID_LOGITECH_BOLT_RECEIVER 0xc548
871873 #define USB_DEVICE_ID_SPACETRAVELLER 0xc623
872874 #define USB_DEVICE_ID_SPACENAVIGATOR 0xc626
873875 #define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704
@@ -1036,6 +1038,8 @@ · 162 unmodified lines
10361038 #define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3220_SERIES 0xc056
10371039 #define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3215_SERIES 0xc057
10381040 #define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES 0xc058
1041+#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3325_SERIES 0x430c
1042+#define USB_DEVICE_ID_PLANTRONICS_ENCOREPRO_500_SERIES 0x431e
10391043
10401044 #define USB_VENDOR_ID_PANASONIC 0x04da
10411045 #define USB_DEVICE_ID_PANABOARD_UBT780 0x1044
drivers/hid/hid-lenovo.c+8−0
@@ -473,6 +473,7 @@ static int lenovo_input_mapping(struct hid_device *hdev, · 472 unmodified lines
473473 return lenovo_input_mapping_tp10_ultrabook_kbd(hdev, hi, field,
474474 usage, bit, max);
475475 case USB_DEVICE_ID_LENOVO_X1_TAB:
476+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
476477 return lenovo_input_mapping_x1_tab_kbd(hdev, hi, field, usage, bit, max);
477478 default:
478479 return 0;
@@ -583,6 +584,7 @@ static ssize_t attr_fn_lock_store(struct device *dev, · 104 unmodified lines
583584 break;
584585 case USB_DEVICE_ID_LENOVO_TP10UBKBD:
585586 case USB_DEVICE_ID_LENOVO_X1_TAB:
587+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
586588 ret = lenovo_led_set_tp10ubkbd(hdev, TP10UBKBD_FN_LOCK_LED, value);
587589 if (ret)
588590 return ret;
@@ -776,6 +778,7 @@ static int lenovo_event(struct hid_device *hdev, struct hid_field *field, · 187 unmodified lines
776778 return lenovo_event_cptkbd(hdev, field, usage, value);
777779 case USB_DEVICE_ID_LENOVO_TP10UBKBD:
778780 case USB_DEVICE_ID_LENOVO_X1_TAB:
781+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
779782 return lenovo_event_tp10ubkbd(hdev, field, usage, value);
780783 default:
781784 return 0;
@@ -1056,6 +1059,7 @@ static int lenovo_led_brightness_set(struct led_classdev *led_cdev, · 274 unmodified lines
10561059 break;
10571060 case USB_DEVICE_ID_LENOVO_TP10UBKBD:
10581061 case USB_DEVICE_ID_LENOVO_X1_TAB:
1062+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
10591063 ret = lenovo_led_set_tp10ubkbd(hdev, tp10ubkbd_led[led_nr], value);
10601064 break;
10611065 }
@@ -1286,6 +1290,7 @@ static int lenovo_probe(struct hid_device *hdev, · 224 unmodified lines
12861290 break;
12871291 case USB_DEVICE_ID_LENOVO_TP10UBKBD:
12881292 case USB_DEVICE_ID_LENOVO_X1_TAB:
1293+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
12891294 ret = lenovo_probe_tp10ubkbd(hdev);
12901295 break;
12911296 default:
@@ -1372,6 +1377,7 @@ static void lenovo_remove(struct hid_device *hdev) · 80 unmodified lines
13721377 break;
13731378 case USB_DEVICE_ID_LENOVO_TP10UBKBD:
13741379 case USB_DEVICE_ID_LENOVO_X1_TAB:
1380+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
13751381 lenovo_remove_tp10ubkbd(hdev);
13761382 break;
13771383 }
@@ -1421,6 +1427,8 @@ static const struct hid_device_id lenovo_devices[] = { · 43 unmodified lines
14211427 */
14221428 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
14231429 USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB) },
1430+ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
1431+ USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB3) },
14241432 { }
14251433 };
14261434
drivers/hid/hid-multitouch.c+13−0
@@ -2026,6 +2026,10 @@ static const struct hid_device_id mt_devices[] = { · 2025 unmodified lines
20262026 HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
20272027 USB_VENDOR_ID_ELAN, 0x3148) },
20282028
2029+ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU,
2030+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2031+ USB_VENDOR_ID_ELAN, 0x32ae) },
2032+
20292033 /* Elitegroup panel */
20302034 { .driver_data = MT_CLS_SERIAL,
20312035 MT_USB_DEVICE(USB_VENDOR_ID_ELITEGROUP,
@@ -2095,6 +2099,11 @@ static const struct hid_device_id mt_devices[] = { · 63 unmodified lines
20952099 HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
20962100 0x347d, 0x7853) },
20972101
2102+ /* HONOR MagicBook Art 14 touchpad */
2103+ { .driver_data = MT_CLS_VTL,
2104+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2105+ 0x35cc, 0x0104) },
2106+
20982107 /* Ilitek dual touch panel */
20992108 { .driver_data = MT_CLS_NSMU,
21002109 MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,
@@ -2137,6 +2146,10 @@ static const struct hid_device_id mt_devices[] = { · 36 unmodified lines
21372146 HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_MULTITOUCH_WIN_8,
21382147 USB_VENDOR_ID_LOGITECH,
21392148 USB_DEVICE_ID_LOGITECH_CASA_TOUCHPAD) },
2149+ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU,
2150+ HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
2151+ USB_VENDOR_ID_LOGITECH,
2152+ USB_DEVICE_ID_LOGITECH_BOLT_RECEIVER) },
21402153
21412154 /* MosArt panels */
21422155 { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
drivers/hid/hid-plantronics.c+23−0
@@ -38,8 +38,10 @@ · 37 unmodified lines
3838 (usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER)
3939
4040 #define PLT_QUIRK_DOUBLE_VOLUME_KEYS BIT(0)
41+#define PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS BIT(1)
4142
4243 #define PLT_DOUBLE_KEY_TIMEOUT 5 /* ms */
44+#define PLT_FOLLOWED_OPPOSITE_KEY_TIMEOUT 220 /* ms */
4345
4446 struct plt_drv_data {
4547 unsigned long device_type;
@@ -137,6 +139,21 @@ static int plantronics_event(struct hid_device *hdev, struct hid_field *field, · 91 unmodified lines
137139
138140 drv_data->last_volume_key_ts = cur_ts;
139141 }
142+ if (drv_data->quirks & PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS) {
143+ unsigned long prev_ts, cur_ts;
144+
145+ /* Usages are filtered in plantronics_usages. */
146+
147+ if (!value) /* Handle key presses only. */
148+ return 0;
149+
150+ prev_ts = drv_data->last_volume_key_ts;
151+ cur_ts = jiffies;
152+ if (jiffies_to_msecs(cur_ts - prev_ts) <= PLT_FOLLOWED_OPPOSITE_KEY_TIMEOUT)
153+ return 1; /* Ignore the followed opposite volume key. */
154+
155+ drv_data->last_volume_key_ts = cur_ts;
156+ }
140157
141158 return 0;
142159 }
@@ -210,6 +227,12 @@ static const struct hid_device_id plantronics_devices[] = { · 67 unmodified lines
210227 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
211228 USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES),
212229 .driver_data = PLT_QUIRK_DOUBLE_VOLUME_KEYS },
230+ { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
231+ USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3325_SERIES),
232+ .driver_data = PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS },
233+ { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
234+ USB_DEVICE_ID_PLANTRONICS_ENCOREPRO_500_SERIES),
235+ .driver_data = PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS },
213236 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
214237 { }
215238 };
drivers/hid/i2c-hid/i2c-hid-core.c+10−0
@@ -50,6 +50,7 @@ · 49 unmodified lines
5050 #define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(3)
5151 #define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(4)
5252 #define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND BIT(5)
53+#define I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME BIT(6)
5354
5455 /* Command opcodes */
5556 #define I2C_HID_OPCODE_RESET 0x01
@@ -140,6 +141,8 @@ static const struct i2c_hid_quirks { · 84 unmodified lines
140141 { USB_VENDOR_ID_ELAN, HID_ANY_ID,
141142 I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET |
142143 I2C_HID_QUIRK_BOGUS_IRQ },
144+ { I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_0D42,
145+ I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME },
143146 { 0, 0 }
144147 };
145148
@@ -981,6 +984,13 @@ static int i2c_hid_core_resume(struct i2c_hid *ihid) · 835 unmodified lines
981984 return -ENXIO;
982985 }
983986
987+ /* On Goodix 27c6:0d42 wait extra time before device wakeup.
988+ * It's not clear why but if we send wakeup too early, the device will
989+ * never trigger input interrupts.
990+ */
991+ if (ihid->quirks & I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME)
992+ msleep(1500);
993+
984994 /* Instead of resetting device, simply powers the device on. This
985995 * solves "incomplete reports" on Raydium devices 2386:3118 and
986996 * 2386:4B33 and fixes various SIS touchscreens no longer sending
drivers/hid/intel-ish-hid/ishtp-fw-loader.c+1−1
@@ -635,7 +635,7 @@ static int ish_fw_xfer_direct_dma(struct ishtp_cl_data *client_data, · 634 unmodified lines
635635 const struct firmware *fw,
636636 const struct shim_fw_info fw_info)
637637 {
638− int rv;
638+ int rv = 0;
639639 void *dma_buf;
640640 dma_addr_t dma_buf_phy;
641641 u32 fragment_offset, fragment_size, payload_max_size;
drivers/hid/wacom_wac.c+2−0
@@ -2567,6 +2567,8 @@ static void wacom_wac_pen_report(struct hid_device *hdev, · 2566 unmodified lines
25672567 /* Going into range select tool */
25682568 if (wacom_wac->hid_data.invert_state)
25692569 wacom_wac->tool[0] = BTN_TOOL_RUBBER;
2570+ else if (wacom_wac->features.quirks & WACOM_QUIRK_AESPEN)
2571+ wacom_wac->tool[0] = BTN_TOOL_PEN;
25702572 else if (wacom_wac->id[0])
25712573 wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);
25722574 else
drivers/hwmon/Kconfig+6−0
@@ -162,6 +162,7 @@ config SENSORS_ADM9240 · 161 unmodified lines
162162 tristate "Analog Devices ADM9240 and compatibles"
163163 depends on I2C
164164 select HWMON_VID
165+ select REGMAP_I2C
165166 help
166167 If you say yes here you get support for Analog Devices ADM9240,
167168 Dallas DS1780, National Semiconductor LM81 sensor chips.
@@ -223,6 +224,7 @@ config SENSORS_ADT7462 · 55 unmodified lines
223224 config SENSORS_ADT7470
224225 tristate "Analog Devices ADT7470"
225226 depends on I2C
227+ select REGMAP_I2C
226228 help
227229 If you say yes here you get support for the Analog Devices
228230 ADT7470 temperature monitoring chips.
@@ -999,6 +1001,7 @@ config SENSORS_LTC2990 · 770 unmodified lines
9991001 config SENSORS_LTC2991
10001002 tristate "Analog Devices LTC2991"
10011003 depends on I2C
1004+ select REGMAP_I2C
10021005 help
10031006 If you say yes here you get support for Analog Devices LTC2991
10041007 Octal I2C Voltage, Current, and Temperature Monitor. The LTC2991
@@ -1146,6 +1149,7 @@ config SENSORS_MAX1619 · 141 unmodified lines
11461149 config SENSORS_MAX1668
11471150 tristate "Maxim MAX1668 and compatibles"
11481151 depends on I2C
1152+ select REGMAP_I2C
11491153 help
11501154 If you say yes here you get support for MAX1668, MAX1989 and
11511155 MAX1805 chips.
@@ -1275,6 +1279,7 @@ config SENSORS_MAX31790 · 123 unmodified lines
12751279 config SENSORS_MC34VR500
12761280 tristate "NXP MC34VR500 hardware monitoring driver"
12771281 depends on I2C
1282+ select REGMAP_I2C
12781283 help
12791284 If you say yes here you get support for the temperature and input
12801285 voltage sensors of the NXP MC34VR500.
@@ -2312,6 +2317,7 @@ config SENSORS_TMP464 · 1031 unmodified lines
23122317 config SENSORS_TMP513
23132318 tristate "Texas Instruments TMP513 and compatibles"
23142319 depends on I2C
2320+ select REGMAP_I2C
23152321 help
23162322 If you say yes here you get support for Texas Instruments TMP512,
23172323 and TMP513 temperature and power supply sensor chips.
drivers/hwmon/adt7475.c+1−2
@@ -1735,11 +1735,10 @@ static int adt7475_pwm_properties_parse_args(struct fwnode_handle *fwnode, · 1734 unmodified lines
17351735 static int adt7475_fan_pwm_config(struct i2c_client *client)
17361736 {
17371737 struct adt7475_data *data = i2c_get_clientdata(client);
1738− struct fwnode_handle *child;
17391738 struct adt7475_pwm_config cfg = {};
17401739 int ret;
17411740
1742− device_for_each_child_node(&client->dev, child) {
1741+ device_for_each_child_node_scoped(&client->dev, child) {
17431742 if (!fwnode_property_present(child, "pwms"))
17441743 continue;
17451744
drivers/hwmon/intel-m10-bmc-hwmon.c+1−1
@@ -358,7 +358,7 @@ static const struct m10bmc_sdata n6000bmc_temp_tbl[] = { · 357 unmodified lines
358358 { 0x4f0, 0x4f4, 0x4f8, 0x52c, 0x0, 500, "Board Top Near FPGA Temperature" },
359359 { 0x4fc, 0x500, 0x504, 0x52c, 0x0, 500, "Board Bottom Near CVL Temperature" },
360360 { 0x508, 0x50c, 0x510, 0x52c, 0x0, 500, "Board Top East Near VRs Temperature" },
361− { 0x514, 0x518, 0x51c, 0x52c, 0x0, 500, "Columbiaville Die Temperature" },
361+ { 0x514, 0x518, 0x51c, 0x52c, 0x0, 500, "CVL Die Temperature" },
362362 { 0x520, 0x524, 0x528, 0x52c, 0x0, 500, "Board Rear Side Temperature" },
363363 { 0x530, 0x534, 0x538, 0x52c, 0x0, 500, "Board Front Side Temperature" },
364364 { 0x53c, 0x540, 0x544, 0x0, 0x0, 500, "QSFP1 Case Temperature" },
drivers/hwmon/jc42.c+1−1
@@ -417,7 +417,7 @@ static int jc42_detect(struct i2c_client *client, struct i2c_board_info *info) · 416 unmodified lines
417417 return -ENODEV;
418418
419419 if ((devid & TSE2004_DEVID_MASK) == TSE2004_DEVID &&
420− (cap & 0x00e7) != 0x00e7)
420+ (cap & 0x0062) != 0x0062)
421421 return -ENODEV;
422422
423423 for (i = 0; i < ARRAY_SIZE(jc42_chips); i++) {
drivers/iio/accel/Kconfig+2−0
@@ -447,6 +447,8 @@ config IIO_ST_ACCEL_SPI_3AXIS · 446 unmodified lines
447447
448448 config IIO_KX022A
449449 tristate
450+ select IIO_BUFFER
451+ select IIO_TRIGGERED_BUFFER
450452
451453 config IIO_KX022A_SPI
452454 tristate "Kionix KX022A tri-axis digital accelerometer SPI interface"
drivers/iio/accel/bma400_core.c+2−1
@@ -1218,7 +1218,8 @@ static int bma400_activity_event_en(struct bma400_data *data, · 1217 unmodified lines
12181218 static int bma400_tap_event_en(struct bma400_data *data,
12191219 enum iio_event_direction dir, int state)
12201220 {
1221− unsigned int mask, field_value;
1221+ unsigned int mask;
1222+ unsigned int field_value = 0;
12221223 int ret;
12231224
12241225 /*
drivers/iio/adc/Kconfig+11−0
@@ -52,6 +52,8 @@ config AD4695 · 51 unmodified lines
5252 tristate "Analog Device AD4695 ADC Driver"
5353 depends on SPI
5454 select REGMAP_SPI
55+ select IIO_BUFFER
56+ select IIO_TRIGGERED_BUFFER
5557 help
5658 Say yes here to build support for Analog Devices AD4695 and similar
5759 analog to digital converters (ADC).
@@ -328,6 +330,8 @@ config AD7923 · 270 unmodified lines
328330 config AD7944
329331 tristate "Analog Devices AD7944 and similar ADCs driver"
330332 depends on SPI
333+ select IIO_BUFFER
334+ select IIO_TRIGGERED_BUFFER
331335 help
332336 Say yes here to build support for Analog Devices
333337 AD7944, AD7985, AD7986 ADCs.
@@ -1481,6 +1485,8 @@ config TI_ADS8344 · 1147 unmodified lines
14811485 config TI_ADS8688
14821486 tristate "Texas Instruments ADS8688"
14831487 depends on SPI
1488+ select IIO_BUFFER
1489+ select IIO_TRIGGERED_BUFFER
14841490 help
14851491 If you say yes here you get support for Texas Instruments ADS8684 and
14861492 and ADS8688 ADC chips
@@ -1491,6 +1497,8 @@ config TI_ADS8688 · 4 unmodified lines
14911497 config TI_ADS124S08
14921498 tristate "Texas Instruments ADS124S08"
14931499 depends on SPI
1500+ select IIO_BUFFER
1501+ select IIO_TRIGGERED_BUFFER
14941502 help
14951503 If you say yes here you get support for Texas Instruments ADS124S08
14961504 and ADS124S06 ADC chips
@@ -1525,6 +1533,9 @@ config TI_AM335X_ADC · 28 unmodified lines
15251533 config TI_LMP92064
15261534 tristate "Texas Instruments LMP92064 ADC driver"
15271535 depends on SPI
1536+ select REGMAP_SPI
1537+ select IIO_BUFFER
1538+ select IIO_TRIGGERED_BUFFER
15281539 help
15291540 Say yes here to build support for the LMP92064 Precision Current and Voltage
15301541 sensor.
drivers/iio/adc/ad7124.c+1−1
@@ -637,7 +637,7 @@ static int ad7124_write_raw(struct iio_dev *indio_dev, · 636 unmodified lines
637637
638638 switch (info) {
639639 case IIO_CHAN_INFO_SAMP_FREQ:
640− if (val2 != 0) {
640+ if (val2 != 0 || val == 0) {
641641 ret = -EINVAL;
642642 break;
643643 }
drivers/iio/adc/ad7380.c+78−58
@@ -75,6 +75,7 @@ · 74 unmodified lines
7575 #define T_CONVERT_NS 190 /* conversion time */
7676 #define T_CONVERT_0_NS 10 /* 1st conversion start time (oversampling) */
7777 #define T_CONVERT_X_NS 500 /* xth conversion start time (oversampling) */
78+#define T_POWERUP_US 5000 /* Power up */
7879
7980 struct ad7380_timing_specs {
8081 const unsigned int t_csh_ns; /* CS minimum high time */
@@ -86,6 +87,9 @@ struct ad7380_chip_info { · 5 unmodified lines
8687 unsigned int num_channels;
8788 unsigned int num_simult_channels;
8889 bool has_mux;
90+ const char * const *supplies;
91+ unsigned int num_supplies;
92+ bool external_ref_only;
8993 const char * const *vcm_supplies;
9094 unsigned int num_vcm_supplies;
9195 const unsigned long *available_scan_masks;
@@ -243,6 +247,10 @@ DEFINE_AD7380_8_CHANNEL(ad7386_4_channels, 16, 0, u); · 151 unmodified lines
243247 DEFINE_AD7380_8_CHANNEL(ad7387_4_channels, 14, 0, u);
244248 DEFINE_AD7380_8_CHANNEL(ad7388_4_channels, 12, 0, u);
245249
250+static const char * const ad7380_supplies[] = {
251+ "vcc", "vlogic",
252+};
253+
246254 static const char * const ad7380_2_channel_vcm_supplies[] = {
247255 "aina", "ainb",
248256 };
@@ -338,6 +346,8 @@ static const struct ad7380_chip_info ad7380_chip_info = { · 89 unmodified lines
338346 .channels = ad7380_channels,
339347 .num_channels = ARRAY_SIZE(ad7380_channels),
340348 .num_simult_channels = 2,
349+ .supplies = ad7380_supplies,
350+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
341351 .available_scan_masks = ad7380_2_channel_scan_masks,
342352 .timing_specs = &ad7380_timing,
343353 };
@@ -347,6 +357,8 @@ static const struct ad7380_chip_info ad7381_chip_info = { · 3 unmodified lines
347357 .channels = ad7381_channels,
348358 .num_channels = ARRAY_SIZE(ad7381_channels),
349359 .num_simult_channels = 2,
360+ .supplies = ad7380_supplies,
361+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
350362 .available_scan_masks = ad7380_2_channel_scan_masks,
351363 .timing_specs = &ad7380_timing,
352364 };
@@ -356,6 +368,8 @@ static const struct ad7380_chip_info ad7383_chip_info = { · 3 unmodified lines
356368 .channels = ad7383_channels,
357369 .num_channels = ARRAY_SIZE(ad7383_channels),
358370 .num_simult_channels = 2,
371+ .supplies = ad7380_supplies,
372+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
359373 .vcm_supplies = ad7380_2_channel_vcm_supplies,
360374 .num_vcm_supplies = ARRAY_SIZE(ad7380_2_channel_vcm_supplies),
361375 .available_scan_masks = ad7380_2_channel_scan_masks,
@@ -367,6 +381,8 @@ static const struct ad7380_chip_info ad7384_chip_info = { · 5 unmodified lines
367381 .channels = ad7384_channels,
368382 .num_channels = ARRAY_SIZE(ad7384_channels),
369383 .num_simult_channels = 2,
384+ .supplies = ad7380_supplies,
385+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
370386 .vcm_supplies = ad7380_2_channel_vcm_supplies,
371387 .num_vcm_supplies = ARRAY_SIZE(ad7380_2_channel_vcm_supplies),
372388 .available_scan_masks = ad7380_2_channel_scan_masks,
@@ -378,6 +394,8 @@ static const struct ad7380_chip_info ad7386_chip_info = { · 5 unmodified lines
378394 .channels = ad7386_channels,
379395 .num_channels = ARRAY_SIZE(ad7386_channels),
380396 .num_simult_channels = 2,
397+ .supplies = ad7380_supplies,
398+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
381399 .has_mux = true,
382400 .available_scan_masks = ad7380_2x2_channel_scan_masks,
383401 .timing_specs = &ad7380_timing,
@@ -388,6 +406,8 @@ static const struct ad7380_chip_info ad7387_chip_info = { · 4 unmodified lines
388406 .channels = ad7387_channels,
389407 .num_channels = ARRAY_SIZE(ad7387_channels),
390408 .num_simult_channels = 2,
409+ .supplies = ad7380_supplies,
410+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
391411 .has_mux = true,
392412 .available_scan_masks = ad7380_2x2_channel_scan_masks,
393413 .timing_specs = &ad7380_timing,
@@ -398,6 +418,8 @@ static const struct ad7380_chip_info ad7388_chip_info = { · 4 unmodified lines
398418 .channels = ad7388_channels,
399419 .num_channels = ARRAY_SIZE(ad7388_channels),
400420 .num_simult_channels = 2,
421+ .supplies = ad7380_supplies,
422+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
401423 .has_mux = true,
402424 .available_scan_masks = ad7380_2x2_channel_scan_masks,
403425 .timing_specs = &ad7380_timing,
@@ -408,6 +430,9 @@ static const struct ad7380_chip_info ad7380_4_chip_info = { · 4 unmodified lines
408430 .channels = ad7380_4_channels,
409431 .num_channels = ARRAY_SIZE(ad7380_4_channels),
410432 .num_simult_channels = 4,
433+ .supplies = ad7380_supplies,
434+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
435+ .external_ref_only = true,
411436 .available_scan_masks = ad7380_4_channel_scan_masks,
412437 .timing_specs = &ad7380_4_timing,
413438 };
@@ -417,6 +442,8 @@ static const struct ad7380_chip_info ad7381_4_chip_info = { · 3 unmodified lines
417442 .channels = ad7381_4_channels,
418443 .num_channels = ARRAY_SIZE(ad7381_4_channels),
419444 .num_simult_channels = 4,
445+ .supplies = ad7380_supplies,
446+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
420447 .available_scan_masks = ad7380_4_channel_scan_masks,
421448 .timing_specs = &ad7380_4_timing,
422449 };
@@ -426,6 +453,8 @@ static const struct ad7380_chip_info ad7383_4_chip_info = { · 3 unmodified lines
426453 .channels = ad7383_4_channels,
427454 .num_channels = ARRAY_SIZE(ad7383_4_channels),
428455 .num_simult_channels = 4,
456+ .supplies = ad7380_supplies,
457+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
429458 .vcm_supplies = ad7380_4_channel_vcm_supplies,
430459 .num_vcm_supplies = ARRAY_SIZE(ad7380_4_channel_vcm_supplies),
431460 .available_scan_masks = ad7380_4_channel_scan_masks,
@@ -437,6 +466,8 @@ static const struct ad7380_chip_info ad7384_4_chip_info = { · 5 unmodified lines
437466 .channels = ad7384_4_channels,
438467 .num_channels = ARRAY_SIZE(ad7384_4_channels),
439468 .num_simult_channels = 4,
469+ .supplies = ad7380_supplies,
470+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
440471 .vcm_supplies = ad7380_4_channel_vcm_supplies,
441472 .num_vcm_supplies = ARRAY_SIZE(ad7380_4_channel_vcm_supplies),
442473 .available_scan_masks = ad7380_4_channel_scan_masks,
@@ -448,6 +479,8 @@ static const struct ad7380_chip_info ad7386_4_chip_info = { · 5 unmodified lines
448479 .channels = ad7386_4_channels,
449480 .num_channels = ARRAY_SIZE(ad7386_4_channels),
450481 .num_simult_channels = 4,
482+ .supplies = ad7380_supplies,
483+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
451484 .has_mux = true,
452485 .available_scan_masks = ad7380_2x4_channel_scan_masks,
453486 .timing_specs = &ad7380_4_timing,
@@ -458,6 +491,8 @@ static const struct ad7380_chip_info ad7387_4_chip_info = { · 4 unmodified lines
458491 .channels = ad7387_4_channels,
459492 .num_channels = ARRAY_SIZE(ad7387_4_channels),
460493 .num_simult_channels = 4,
494+ .supplies = ad7380_supplies,
495+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
461496 .has_mux = true,
462497 .available_scan_masks = ad7380_2x4_channel_scan_masks,
463498 .timing_specs = &ad7380_4_timing,
@@ -468,6 +503,8 @@ static const struct ad7380_chip_info ad7388_4_chip_info = { · 4 unmodified lines
468503 .channels = ad7388_4_channels,
469504 .num_channels = ARRAY_SIZE(ad7388_4_channels),
470505 .num_simult_channels = 4,
506+ .supplies = ad7380_supplies,
507+ .num_supplies = ARRAY_SIZE(ad7380_supplies),
471508 .has_mux = true,
472509 .available_scan_masks = ad7380_2x4_channel_scan_masks,
473510 .timing_specs = &ad7380_4_timing,
@@ -956,7 +993,7 @@ static const struct iio_info ad7380_info = { · 482 unmodified lines
956993 .debugfs_reg_access = &ad7380_debugfs_reg_access,
957994 };
958995
959−static int ad7380_init(struct ad7380_state *st, struct regulator *vref)
996+static int ad7380_init(struct ad7380_state *st, bool external_ref_en)
960997 {
961998 int ret;
962999
@@ -968,13 +1005,13 @@ static int ad7380_init(struct ad7380_state *st, struct regulator *vref) · 5 unmodified lines
9681005 if (ret < 0)
9691006 return ret;
9701007
971− /* select internal or external reference voltage */
972− ret = regmap_update_bits(st->regmap, AD7380_REG_ADDR_CONFIG1,
973− AD7380_CONFIG1_REFSEL,
974− FIELD_PREP(AD7380_CONFIG1_REFSEL,
975− vref ? 1 : 0));
976− if (ret < 0)
977− return ret;
1008+ if (external_ref_en) {
1009+ /* select external reference voltage */
1010+ ret = regmap_set_bits(st->regmap, AD7380_REG_ADDR_CONFIG1,
1011+ AD7380_CONFIG1_REFSEL);
1012+ if (ret < 0)
1013+ return ret;
1014+ }
9781015
9791016 /* This is the default value after reset. */
9801017 st->oversampling_ratio = 1;
@@ -987,16 +1024,11 @@ static int ad7380_init(struct ad7380_state *st, struct regulator *vref) · 6 unmodified lines
9871024 FIELD_PREP(AD7380_CONFIG2_SDO, 1));
9881025 }
9891026
990−static void ad7380_regulator_disable(void *p)
991−{
992− regulator_disable(p);
993−}
994−
9951027 static int ad7380_probe(struct spi_device *spi)
9961028 {
9971029 struct iio_dev *indio_dev;
9981030 struct ad7380_state *st;
999− struct regulator *vref;
1031+ bool external_ref_en;
10001032 int ret, i;
10011033
10021034 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
@@ -1009,36 +1041,38 @@ static int ad7380_probe(struct spi_device *spi) · 6 unmodified lines
10091041 if (!st->chip_info)
10101042 return dev_err_probe(&spi->dev, -EINVAL, "missing match data\n");
10111043
1012− vref = devm_regulator_get_optional(&spi->dev, "refio");
1013− if (IS_ERR(vref)) {
1014− if (PTR_ERR(vref) != -ENODEV)
1015− return dev_err_probe(&spi->dev, PTR_ERR(vref),
1016− "Failed to get refio regulator\n");
1017−
1018− vref = NULL;
1019− }
1044+ ret = devm_regulator_bulk_get_enable(&spi->dev, st->chip_info->num_supplies,
1045+ st->chip_info->supplies);
10201046
1021− /*
1022− * If there is no REFIO supply, then it means that we are using
1023− * the internal 2.5V reference, otherwise REFIO is reference voltage.
1024− */
1025− if (vref) {
1026− ret = regulator_enable(vref);
1027− if (ret)
1028− return ret;
1029−
1030− ret = devm_add_action_or_reset(&spi->dev,
1031− ad7380_regulator_disable, vref);
1032− if (ret)
1033− return ret;
1047+ if (ret)
1048+ return dev_err_probe(&spi->dev, ret,
1049+ "Failed to enable power supplies\n");
1050+ fsleep(T_POWERUP_US);
10341051
1035− ret = regulator_get_voltage(vref);
1052+ if (st->chip_info->external_ref_only) {
1053+ ret = devm_regulator_get_enable_read_voltage(&spi->dev,
1054+ "refin");
10361055 if (ret < 0)
1037− return ret;
1056+ return dev_err_probe(&spi->dev, ret,
1057+ "Failed to get refin regulator\n");
10381058
10391059 st->vref_mv = ret / 1000;
1060+
1061+ /* these chips don't have a register bit for this */
1062+ external_ref_en = false;
10401063 } else {
1041− st->vref_mv = AD7380_INTERNAL_REF_MV;
1064+ /*
1065+ * If there is no REFIO supply, then it means that we are using
1066+ * the internal reference, otherwise REFIO is reference voltage.
1067+ */
1068+ ret = devm_regulator_get_enable_read_voltage(&spi->dev,
1069+ "refio");
1070+ if (ret < 0 && ret != -ENODEV)
1071+ return dev_err_probe(&spi->dev, ret,
1072+ "Failed to get refio regulator\n");
1073+
1074+ external_ref_en = ret != -ENODEV;
1075+ st->vref_mv = external_ref_en ? ret / 1000 : AD7380_INTERNAL_REF_MV;
10421076 }
10431077
10441078 if (st->chip_info->num_vcm_supplies > ARRAY_SIZE(st->vcm_mv))
@@ -1050,27 +1084,13 @@ static int ad7380_probe(struct spi_device *spi) · 5 unmodified lines
10501084 * input pin.
10511085 */
10521086 for (i = 0; i < st->chip_info->num_vcm_supplies; i++) {
1053− struct regulator *vcm;
1054−
1055− vcm = devm_regulator_get(&spi->dev,
1056− st->chip_info->vcm_supplies[i]);
1057− if (IS_ERR(vcm))
1058− return dev_err_probe(&spi->dev, PTR_ERR(vcm),
1059− "Failed to get %s regulator\n",
1060− st->chip_info->vcm_supplies[i]);
1087+ const char *vcm = st->chip_info->vcm_supplies[i];
10611088
1062− ret = regulator_enable(vcm);
1063− if (ret)
1064− return ret;
1065−
1066− ret = devm_add_action_or_reset(&spi->dev,
1067− ad7380_regulator_disable, vcm);
1068− if (ret)
1069− return ret;
1070−
1071− ret = regulator_get_voltage(vcm);
1089+ ret = devm_regulator_get_enable_read_voltage(&spi->dev, vcm);
10721090 if (ret < 0)
1073− return ret;
1091+ return dev_err_probe(&spi->dev, ret,
1092+ "Failed to get %s regulator\n",
1093+ vcm);
10741094
10751095 st->vcm_mv[i] = ret / 1000;
10761096 }
@@ -1135,7 +1155,7 @@ static int ad7380_probe(struct spi_device *spi) · 58 unmodified lines
11351155 if (ret)
11361156 return ret;
11371157
1138− ret = ad7380_init(st, vref);
1158+ ret = ad7380_init(st, external_ref_en);
11391159 if (ret)
11401160 return ret;
11411161
drivers/iio/amplifiers/Kconfig+1−0
@@ -27,6 +27,7 @@ config AD8366 · 26 unmodified lines
2727 config ADA4250
2828 tristate "Analog Devices ADA4250 Instrumentation Amplifier"
2929 depends on SPI
30+ select REGMAP_SPI
3031 help
3132 Say yes here to build support for Analog Devices ADA4250
3233 SPI Amplifier's support. The driver provides direct access via
drivers/iio/chemical/Kconfig+2−0
@@ -80,6 +80,8 @@ config ENS160 · 79 unmodified lines
8080 tristate "ScioSense ENS160 sensor driver"
8181 depends on (I2C || SPI)
8282 select REGMAP
83+ select IIO_BUFFER
84+ select IIO_TRIGGERED_BUFFER
8385 select ENS160_I2C if I2C
8486 select ENS160_SPI if SPI
8587 help
drivers/iio/common/hid-sensors/hid-sensor-trigger.c+1−1
@@ -32,7 +32,7 @@ static ssize_t _hid_sensor_set_report_latency(struct device *dev, · 31 unmodified lines
3232 latency = integer * 1000 + fract / 1000;
3333 ret = hid_sensor_set_report_latency(attrb, latency);
3434 if (ret < 0)
35− return len;
35+ return ret;
3636
3737 attrb->latency_ms = hid_sensor_get_report_latency(attrb);
3838
drivers/iio/dac/Kconfig+8−1
@@ -9,6 +9,8 @@ menu "Digital to analog converters" · 8 unmodified lines
99 config AD3552R
1010 tristate "Analog Devices AD3552R DAC driver"
1111 depends on SPI_MASTER
12+ select IIO_BUFFER
13+ select IIO_TRIGGERED_BUFFER
1214 help
1315 Say yes here to build support for Analog Devices AD3552R
1416 Digital to Analog Converter.
@@ -252,6 +254,8 @@ config AD5764 · 237 unmodified lines
252254 config AD5766
253255 tristate "Analog Devices AD5766/AD5767 DAC driver"
254256 depends on SPI_MASTER
257+ select IIO_BUFFER
258+ select IIO_TRIGGERED_BUFFER
255259 help
256260 Say yes here to build support for Analog Devices AD5766, AD5767
257261 Digital to Analog Converter.
@@ -262,6 +266,7 @@ config AD5766 · 4 unmodified lines
262266 config AD5770R
263267 tristate "Analog Devices AD5770R IDAC driver"
264268 depends on SPI_MASTER
269+ select REGMAP_SPI
265270 help
266271 Say yes here to build support for Analog Devices AD5770R Digital to
267272 Analog Converter.
@@ -353,6 +358,7 @@ config LPC18XX_DAC · 85 unmodified lines
353358 config LTC1660
354359 tristate "Linear Technology LTC1660/LTC1665 DAC SPI driver"
355360 depends on SPI
361+ select REGMAP_SPI
356362 help
357363 Say yes here to build support for Linear Technology
358364 LTC1660 and LTC1665 Digital to Analog Converters.
@@ -374,7 +380,7 @@ config LTC2632 · 15 unmodified lines
374380 config LTC2664
375381 tristate "Analog Devices LTC2664 and LTC2672 DAC SPI driver"
376382 depends on SPI
377− select REGMAP
383+ select REGMAP_SPI
378384 help
379385 Say yes here to build support for Analog Devices
380386 LTC2664 and LTC2672 converters (DAC).
@@ -483,6 +489,7 @@ config STM32_DAC · 102 unmodified lines
483489
484490 config STM32_DAC_CORE
485491 tristate
492+ select REGMAP_MMIO
486493
487494 config TI_DAC082S085
488495 tristate "Texas Instruments 8/10/12-bit 2/4-channel DAC driver"
drivers/iio/dac/ltc2664.c+9−8
@@ -516,7 +516,7 @@ static int ltc2664_channel_config(struct ltc2664_state *st) · 515 unmodified lines
516516 const struct ltc2664_chip_info *chip_info = st->chip_info;
517517 struct device *dev = &st->spi->dev;
518518 u32 reg, tmp[2], mspan;
519− int ret, span = 0;
519+ int ret;
520520
521521 mspan = LTC2664_MSPAN_SOFTSPAN;
522522 ret = device_property_read_u32(dev, "adi,manual-span-operation-config",
@@ -579,20 +579,21 @@ static int ltc2664_channel_config(struct ltc2664_state *st) · 56 unmodified lines
579579 ret = fwnode_property_read_u32_array(child, "output-range-microvolt",
580580 tmp, ARRAY_SIZE(tmp));
581581 if (!ret && mspan == LTC2664_MSPAN_SOFTSPAN) {
582− chan->span = ltc2664_set_span(st, tmp[0] / 1000,
583− tmp[1] / 1000, reg);
584− if (span < 0)
585− return dev_err_probe(dev, span,
582+ ret = ltc2664_set_span(st, tmp[0] / 1000, tmp[1] / 1000, reg);
583+ if (ret < 0)
584+ return dev_err_probe(dev, ret,
586585 "Failed to set span\n");
586+ chan->span = ret;
587587 }
588588
589589 ret = fwnode_property_read_u32_array(child, "output-range-microamp",
590590 tmp, ARRAY_SIZE(tmp));
591591 if (!ret) {
592− chan->span = ltc2664_set_span(st, 0, tmp[1] / 1000, reg);
593− if (span < 0)
594− return dev_err_probe(dev, span,
592+ ret = ltc2664_set_span(st, 0, tmp[1] / 1000, reg);
593+ if (ret < 0)
594+ return dev_err_probe(dev, ret,
595595 "Failed to set span\n");
596+ chan->span = ret;
596597 }
597598 }
598599
drivers/iio/frequency/Kconfig+18−16
@@ -53,6 +53,7 @@ config ADF4371 · 52 unmodified lines
5353 config ADF4377
5454 tristate "Analog Devices ADF4377 Microwave Wideband Synthesizer"
5555 depends on SPI && COMMON_CLK
56+ select REGMAP_SPI
5657 help
5758 Say yes here to build support for Analog Devices ADF4377 Microwave
5859 Wideband Synthesizer.
@@ -91,25 +92,26 @@ config ADMV1014 · 32 unmodified lines
9192 module will be called admv1014.
9293
9394 config ADMV4420
94− tristate "Analog Devices ADMV4420 K Band Downconverter"
95− depends on SPI
96− help
97− Say yes here to build support for Analog Devices K Band
98− Downconverter with integrated Fractional-N PLL and VCO.
95+ tristate "Analog Devices ADMV4420 K Band Downconverter"
96+ depends on SPI
97+ select REGMAP_SPI
98+ help
99+ Say yes here to build support for Analog Devices K Band
100+ Downconverter with integrated Fractional-N PLL and VCO.
99101
100− To compile this driver as a module, choose M here: the
101− module will be called admv4420.
102+ To compile this driver as a module, choose M here: the
103+ module will be called admv4420.
102104
103105 config ADRF6780
104− tristate "Analog Devices ADRF6780 Microwave Upconverter"
105− depends on SPI
106− depends on COMMON_CLK
107− help
108− Say yes here to build support for Analog Devices ADRF6780
109− 5.9 GHz to 23.6 GHz, Wideband, Microwave Upconverter.
110−
111− To compile this driver as a module, choose M here: the
112− module will be called adrf6780.
106+ tristate "Analog Devices ADRF6780 Microwave Upconverter"
107+ depends on SPI
108+ depends on COMMON_CLK
109+ help
110+ Say yes here to build support for Analog Devices ADRF6780
111+ 5.9 GHz to 23.6 GHz, Wideband, Microwave Upconverter.
112+
113+ To compile this driver as a module, choose M here: the
114+ module will be called adrf6780.
113115
114116 endmenu
115117 endmenu
drivers/iio/imu/bmi323/bmi323_core.c+11−12
@@ -2172,7 +2172,6 @@ int bmi323_core_probe(struct device *dev) · 2171 unmodified lines
21722172 }
21732173 EXPORT_SYMBOL_NS_GPL(bmi323_core_probe, IIO_BMI323);
21742174
2175−#if defined(CONFIG_PM)
21762175 static int bmi323_core_runtime_suspend(struct device *dev)
21772176 {
21782177 struct iio_dev *indio_dev = dev_get_drvdata(dev);
@@ -2199,12 +2198,12 @@ static int bmi323_core_runtime_suspend(struct device *dev) · 20 unmodified lines
21992198 }
22002199
22012200 for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) {
2202− ret = bmi323_read_ext_reg(data, bmi323_reg_savestate[i],
2203− &savestate->reg_settings[i]);
2201+ ret = bmi323_read_ext_reg(data, bmi323_ext_reg_savestate[i],
2202+ &savestate->ext_reg_settings[i]);
22042203 if (ret) {
22052204 dev_err(data->dev,
22062205 "Error reading bmi323 external reg 0x%x: %d\n",
2207− bmi323_reg_savestate[i], ret);
2206+ bmi323_ext_reg_savestate[i], ret);
22082207 return ret;
22092208 }
22102209 }
@@ -2232,8 +2231,10 @@ static int bmi323_core_runtime_resume(struct device *dev) · 21 unmodified lines
22322231 * after being reset in the lower power state by runtime-pm.
22332232 */
22342233 ret = bmi323_init(data);
2235− if (!ret)
2234+ if (ret) {
2235+ dev_err(data->dev, "Device power-on and init failed: %d", ret);
22362236 return ret;
2237+ }
22372238
22382239 /* Register must be cleared before changing an active config */
22392240 ret = regmap_write(data->regmap, BMI323_FEAT_IO0_REG, 0);
@@ -2243,12 +2244,12 @@ static int bmi323_core_runtime_resume(struct device *dev) · 3 unmodified lines
22432244 }
22442245
22452246 for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) {
2246− ret = bmi323_write_ext_reg(data, bmi323_reg_savestate[i],
2247− savestate->reg_settings[i]);
2247+ ret = bmi323_write_ext_reg(data, bmi323_ext_reg_savestate[i],
2248+ savestate->ext_reg_settings[i]);
22482249 if (ret) {
22492250 dev_err(data->dev,
22502251 "Error writing bmi323 external reg 0x%x: %d\n",
2251− bmi323_reg_savestate[i], ret);
2252+ bmi323_ext_reg_savestate[i], ret);
22522253 return ret;
22532254 }
22542255 }
@@ -2293,11 +2294,9 @@ static int bmi323_core_runtime_resume(struct device *dev) · 38 unmodified lines
22932294 return iio_device_resume_triggering(indio_dev);
22942295 }
22952296
2296−#endif
2297−
22982297 const struct dev_pm_ops bmi323_core_pm_ops = {
2299− SET_RUNTIME_PM_OPS(bmi323_core_runtime_suspend,
2300− bmi323_core_runtime_resume, NULL)
2298+ RUNTIME_PM_OPS(bmi323_core_runtime_suspend,
2299+ bmi323_core_runtime_resume, NULL)
23012300 };
23022301 EXPORT_SYMBOL_NS_GPL(bmi323_core_pm_ops, IIO_BMI323);
23032302
drivers/iio/industrialio-gts-helper.c+3−1
@@ -307,13 +307,15 @@ static int iio_gts_build_avail_scale_table(struct iio_gts *gts) · 306 unmodified lines
307307 if (ret)
308308 goto err_free_out;
309309
310+ for (i = 0; i < gts->num_itime; i++)
311+ kfree(per_time_gains[i]);
310312 kfree(per_time_gains);
311313 gts->per_time_avail_scale_tables = per_time_scales;
312314
313315 return 0;
314316
315317 err_free_out:
316− for (i--; i; i--) {
318+ for (i--; i >= 0; i--) {
317319 kfree(per_time_scales[i]);
318320 kfree(per_time_gains[i]);
319321 }
drivers/iio/light/Kconfig+2−0
@@ -335,6 +335,8 @@ config ROHM_BU27008 · 334 unmodified lines
335335 depends on I2C
336336 select REGMAP_I2C
337337 select IIO_GTS_HELPER
338+ select IIO_BUFFER
339+ select IIO_TRIGGERED_BUFFER
338340 help
339341 Enable support for the ROHM BU27008 color sensor.
340342 The ROHM BU27008 is a sensor with 5 photodiodes (red, green,
drivers/iio/light/opt3001.c+4−0
@@ -138,6 +138,10 @@ static const struct opt3001_scale opt3001_scales[] = { · 137 unmodified lines
138138 .val = 20966,
139139 .val2 = 400000,
140140 },
141+ {
142+ .val = 41932,
143+ .val2 = 800000,
144+ },
141145 {
142146 .val = 83865,
143147 .val2 = 600000,
drivers/iio/light/veml6030.c+3−4
@@ -99,9 +99,8 @@ static const char * const period_values[] = { · 98 unmodified lines
9999 static ssize_t in_illuminance_period_available_show(struct device *dev,
100100 struct device_attribute *attr, char *buf)
101101 {
102+ struct veml6030_data *data = iio_priv(dev_to_iio_dev(dev));
102103 int ret, reg, x;
103− struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
104− struct veml6030_data *data = iio_priv(indio_dev);
105104
106105 ret = regmap_read(data->regmap, VEML6030_REG_ALS_CONF, &reg);
107106 if (ret) {
@@ -523,7 +522,7 @@ static int veml6030_read_raw(struct iio_dev *indio_dev, · 415 unmodified lines
523522 }
524523 if (mask == IIO_CHAN_INFO_PROCESSED) {
525524 *val = (reg * data->cur_resolution) / 10000;
526− *val2 = (reg * data->cur_resolution) % 10000;
525+ *val2 = (reg * data->cur_resolution) % 10000 * 100;
527526 return IIO_VAL_INT_PLUS_MICRO;
528527 }
529528 *val = reg;
@@ -780,7 +779,7 @@ static int veml6030_hw_init(struct iio_dev *indio_dev) · 250 unmodified lines
780779
781780 /* Cache currently active measurement parameters */
782781 data->cur_gain = 3;
783− data->cur_resolution = 4608;
782+ data->cur_resolution = 5376;
784783 data->cur_integration_time = 3;
785784
786785 return ret;
drivers/iio/magnetometer/Kconfig+2−0
@@ -11,6 +11,8 @@ config AF8133J · 10 unmodified lines
1111 depends on I2C
1212 depends on OF
1313 select REGMAP_I2C
14+ select IIO_BUFFER
15+ select IIO_TRIGGERED_BUFFER
1416 help
1517 Say yes here to build support for Voltafield AF8133J I2C-based
1618 3-axis magnetometer chip.
drivers/iio/pressure/Kconfig+4−0
@@ -19,6 +19,9 @@ config ABP060MG · 18 unmodified lines
1919 config ROHM_BM1390
2020 tristate "ROHM BM1390GLV-Z pressure sensor driver"
2121 depends on I2C
22+ select REGMAP_I2C
23+ select IIO_BUFFER
24+ select IIO_TRIGGERED_BUFFER
2225 help
2326 Support for the ROHM BM1390 pressure sensor. The BM1390GLV-Z
2427 can measure pressures ranging from 300 hPa to 1300 hPa with
@@ -253,6 +256,7 @@ config MS5637 · 228 unmodified lines
253256 config SDP500
254257 tristate "Sensirion SDP500 differential pressure sensor I2C driver"
255258 depends on I2C
259+ select CRC8
256260 help
257261 Say Y here to build support for Sensirion SDP500 differential pressure
258262 sensor I2C driver.
drivers/iio/proximity/Kconfig+2−0
@@ -86,6 +86,8 @@ config LIDAR_LITE_V2 · 85 unmodified lines
8686 config MB1232
8787 tristate "MaxSonar I2CXL family ultrasonic sensors"
8888 depends on I2C
89+ select IIO_BUFFER
90+ select IIO_TRIGGERED_BUFFER
8991 help
9092 Say Y to build a driver for the ultrasonic sensors I2CXL of
9193 MaxBotix which have an i2c interface. It can be used to measure
drivers/iio/resolver/Kconfig+3−0
@@ -31,6 +31,9 @@ config AD2S1210 · 30 unmodified lines
3131 depends on SPI
3232 depends on COMMON_CLK
3333 depends on GPIOLIB || COMPILE_TEST
34+ select REGMAP
35+ select IIO_BUFFER
36+ select IIO_TRIGGERED_BUFFER
3437 help
3538 Say yes here to build support for Analog Devices spi resolver
3639 to digital converters, ad2s1210, provides direct access via sysfs.
drivers/infiniband/core/addr.c+2−0
@@ -269,6 +269,8 @@ rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in) · 268 unmodified lines
269269 break;
270270 #endif
271271 }
272+ if (!ret && dev && is_vlan_dev(dev))
273+ dev = vlan_dev_real_dev(dev);
272274 return ret ? ERR_PTR(ret) : dev;
273275 }
274276
drivers/infiniband/core/nldev.c+2−0
@@ -2816,6 +2816,8 @@ int rdma_nl_notify_event(struct ib_device *device, u32 port_num, · 2815 unmodified lines
28162816 nlh = nlmsg_put(skb, 0, 0,
28172817 RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_MONITOR),
28182818 0, 0);
2819+ if (!nlh)
2820+ goto err_free;
28192821
28202822 switch (type) {
28212823 case RDMA_REGISTER_EVENT:
drivers/infiniband/hw/bnxt_re/hw_counters.c+1−1
@@ -366,7 +366,7 @@ int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev, · 365 unmodified lines
366366 goto done;
367367 }
368368 }
369− if (rdev->pacing.dbr_pacing)
369+ if (rdev->pacing.dbr_pacing && bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx))
370370 bnxt_re_copy_db_pacing_stats(rdev, stats);
371371 }
372372
drivers/infiniband/hw/bnxt_re/ib_verbs.c+5−1
@@ -1307,7 +1307,11 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp, · 1306 unmodified lines
13071307 0 : BNXT_QPLIB_RESERVED_QP_WRS;
13081308 entries = bnxt_re_init_depth(entries + diff + 1, uctx);
13091309 sq->max_wqe = min_t(u32, entries, dev_attr->max_qp_wqes + diff + 1);
1310− sq->max_sw_wqe = bnxt_qplib_get_depth(sq, qplqp->wqe_mode, true);
1310+ if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE)
1311+ sq->max_sw_wqe = bnxt_qplib_get_depth(sq, qplqp->wqe_mode, true);
1312+ else
1313+ sq->max_sw_wqe = sq->max_wqe;
1314+
13111315 }
13121316 sq->q_full_delta = diff + 1;
13131317 /*
drivers/infiniband/hw/bnxt_re/main.c+25−22
@@ -188,8 +188,11 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev) · 187 unmodified lines
188188
189189 bnxt_re_set_db_offset(rdev);
190190 rc = bnxt_qplib_map_db_bar(&rdev->qplib_res);
191− if (rc)
191+ if (rc) {
192+ kfree(rdev->chip_ctx);
193+ rdev->chip_ctx = NULL;
192194 return rc;
195+ }
193196
194197 if (bnxt_qplib_determine_atomics(en_dev->pdev))
195198 ibdev_info(&rdev->ibdev,
@@ -531,6 +534,7 @@ static bool is_dbr_fifo_full(struct bnxt_re_dev *rdev) · 335 unmodified lines
531534 static void __wait_for_fifo_occupancy_below_th(struct bnxt_re_dev *rdev)
532535 {
533536 struct bnxt_qplib_db_pacing_data *pacing_data = rdev->qplib_res.pacing_data;
537+ u32 retry_fifo_check = 1000;
534538 u32 fifo_occup;
535539
536540 /* loop shouldn't run infintely as the occupancy usually goes
@@ -544,6 +548,14 @@ static void __wait_for_fifo_occupancy_below_th(struct bnxt_re_dev *rdev) · 7 unmodified lines
544548
545549 if (fifo_occup < pacing_data->pacing_th)
546550 break;
551+ if (!retry_fifo_check--) {
552+ dev_info_once(rdev_to_dev(rdev),
553+ "%s: fifo_occup = 0x%xfifo_max_depth = 0x%x pacing_th = 0x%x\n",
554+ __func__, fifo_occup, pacing_data->fifo_max_depth,
555+ pacing_data->pacing_th);
556+ break;
557+ }
558+
547559 }
548560 }
549561
@@ -957,7 +969,7 @@ static int bnxt_re_register_ib(struct bnxt_re_dev *rdev) · 407 unmodified lines
957969 return ib_register_device(ibdev, "bnxt_re%d", &rdev->en_dev->pdev->dev);
958970 }
959971
960−static struct bnxt_re_dev *bnxt_re_dev_add(struct bnxt_aux_priv *aux_priv,
972+static struct bnxt_re_dev *bnxt_re_dev_add(struct auxiliary_device *adev,
961973 struct bnxt_en_dev *en_dev)
962974 {
963975 struct bnxt_re_dev *rdev;
@@ -973,6 +985,7 @@ static struct bnxt_re_dev *bnxt_re_dev_add(struct bnxt_aux_priv *aux_priv, · 9 unmodified lines
973985 rdev->nb.notifier_call = NULL;
974986 rdev->netdev = en_dev->net;
975987 rdev->en_dev = en_dev;
988+ rdev->adev = adev;
976989 rdev->id = rdev->en_dev->pdev->devfn;
977990 INIT_LIST_HEAD(&rdev->qp_list);
978991 mutex_init(&rdev->qp_lock);
@@ -1025,12 +1038,15 @@ static int bnxt_re_handle_unaffi_async_event(struct creq_func_event · 46 unmodified lines
10251038 static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event,
10261039 struct bnxt_re_qp *qp)
10271040 {
1028− struct bnxt_re_srq *srq = container_of(qp->qplib_qp.srq, struct bnxt_re_srq,
1029− qplib_srq);
10301041 struct creq_qp_error_notification *err_event;
1042+ struct bnxt_re_srq *srq = NULL;
10311043 struct ib_event event = {};
10321044 unsigned int flags;
10331045
1046+ if (qp->qplib_qp.srq)
1047+ srq = container_of(qp->qplib_qp.srq, struct bnxt_re_srq,
1048+ qplib_srq);
1049+
10341050 if (qp->qplib_qp.state == CMDQ_MODIFY_QP_NEW_STATE_ERR &&
10351051 rdma_is_kernel_res(&qp->ib_qp.res)) {
10361052 flags = bnxt_re_lock_cqs(qp);
@@ -1258,15 +1274,9 @@ static int bnxt_re_cqn_handler(struct bnxt_qplib_nq *nq, · 221 unmodified lines
12581274 {
12591275 struct bnxt_re_cq *cq = container_of(handle, struct bnxt_re_cq,
12601276 qplib_cq);
1261− u32 *cq_ptr;
12621277
1263− if (cq->ib_cq.comp_handler) {
1264− if (cq->uctx_cq_page) {
1265− cq_ptr = (u32 *)cq->uctx_cq_page;
1266− *cq_ptr = cq->qplib_cq.toggle;
1267− }
1278+ if (cq->ib_cq.comp_handler)
12681279 (*cq->ib_cq.comp_handler)(&cq->ib_cq, cq->ib_cq.cq_context);
1269− }
12701280
12711281 return 0;
12721282 }
@@ -1823,7 +1833,6 @@ static void bnxt_re_update_en_info_rdev(struct bnxt_re_dev *rdev, · 550 unmodified lines
18231833 */
18241834 rtnl_lock();
18251835 en_info->rdev = rdev;
1826− rdev->adev = adev;
18271836 rtnl_unlock();
18281837 }
18291838
@@ -1840,7 +1849,7 @@ static int bnxt_re_add_device(struct auxiliary_device *adev, u8 op_type) · 10 unmodified lines
18401849 en_dev = en_info->en_dev;
18411850
18421851
1843− rdev = bnxt_re_dev_add(aux_priv, en_dev);
1852+ rdev = bnxt_re_dev_add(adev, en_dev);
18441853 if (!rdev || !rdev_to_dev(rdev)) {
18451854 rc = -ENOMEM;
18461855 goto exit;
@@ -1865,12 +1874,14 @@ static int bnxt_re_add_device(struct auxiliary_device *adev, u8 op_type) · 18 unmodified lines
18651874 rdev->nb.notifier_call = NULL;
18661875 pr_err("%s: Cannot register to netdevice_notifier",
18671876 ROCE_DRV_MODULE_NAME);
1868− return rc;
1877+ goto re_dev_unreg;
18691878 }
18701879 bnxt_re_setup_cc(rdev, true);
18711880
18721881 return 0;
18731882
1883+re_dev_unreg:
1884+ ib_unregister_device(&rdev->ibdev);
18741885 re_dev_uninit:
18751886 bnxt_re_update_en_info_rdev(NULL, en_info, adev);
18761887 bnxt_re_dev_uninit(rdev, BNXT_RE_COMPLETE_REMOVE);
@@ -2014,15 +2025,7 @@ static int bnxt_re_probe(struct auxiliary_device *adev, · 137 unmodified lines
20142025 auxiliary_set_drvdata(adev, en_info);
20152026
20162027 rc = bnxt_re_add_device(adev, BNXT_RE_COMPLETE_INIT);
2017− if (rc)
2018− goto err;
20192028 mutex_unlock(&bnxt_re_mutex);
2020− return 0;
2021−
2022−err:
2023− mutex_unlock(&bnxt_re_mutex);
2024− bnxt_re_remove(adev);
2025−
20262029 return rc;
20272030 }
20282031
drivers/infiniband/hw/bnxt_re/qplib_fp.c+9−0
@@ -327,6 +327,7 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t) · 326 unmodified lines
327327 case NQ_BASE_TYPE_CQ_NOTIFICATION:
328328 {
329329 struct nq_cn *nqcne = (struct nq_cn *)nqe;
330+ struct bnxt_re_cq *cq_p;
330331
331332 q_handle = le32_to_cpu(nqcne->cq_handle_low);
332333 q_handle |= (u64)le32_to_cpu(nqcne->cq_handle_high)
@@ -337,6 +338,10 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t) · 4 unmodified lines
337338 cq->toggle = (le16_to_cpu(nqe->info10_type) &
338339 NQ_CN_TOGGLE_MASK) >> NQ_CN_TOGGLE_SFT;
339340 cq->dbinfo.toggle = cq->toggle;
341+ cq_p = container_of(cq, struct bnxt_re_cq, qplib_cq);
342+ if (cq_p->uctx_cq_page)
343+ *((u32 *)cq_p->uctx_cq_page) = cq->toggle;
344+
340345 bnxt_qplib_armen_db(&cq->dbinfo,
341346 DBC_DBC_TYPE_CQ_ARMENA);
342347 spin_lock_bh(&cq->compl_lock);
@@ -1527,9 +1532,11 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res, · 1184 unmodified lines
15271532 u32 tbl_indx;
15281533 int rc;
15291534
1535+ spin_lock_bh(&rcfw->tbl_lock);
15301536 tbl_indx = map_qp_id_to_tbl_indx(qp->id, rcfw);
15311537 rcfw->qp_tbl[tbl_indx].qp_id = BNXT_QPLIB_QP_ID_INVALID;
15321538 rcfw->qp_tbl[tbl_indx].qp_handle = NULL;
1539+ spin_unlock_bh(&rcfw->tbl_lock);
15331540
15341541 bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req,
15351542 CMDQ_BASE_OPCODE_DESTROY_QP,
@@ -1540,8 +1547,10 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res, · 4 unmodified lines
15401547 sizeof(resp), 0);
15411548 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg);
15421549 if (rc) {
1550+ spin_lock_bh(&rcfw->tbl_lock);
15431551 rcfw->qp_tbl[tbl_indx].qp_id = qp->id;
15441552 rcfw->qp_tbl[tbl_indx].qp_handle = qp;
1553+ spin_unlock_bh(&rcfw->tbl_lock);
15451554 return rc;
15461555 }
15471556
drivers/infiniband/hw/bnxt_re/qplib_fp.h+1−1
@@ -170,7 +170,7 @@ struct bnxt_qplib_swqe { · 169 unmodified lines
170170 };
171171 u32 q_key;
172172 u32 dst_qp;
173− u16 avid;
173+ u32 avid;
174174 } send;
175175
176176 /* Send Raw Ethernet and QP1 */
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c+20−20
@@ -290,7 +290,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, · 289 unmodified lines
290290 struct bnxt_qplib_hwq *hwq;
291291 u32 sw_prod, cmdq_prod;
292292 struct pci_dev *pdev;
293− unsigned long flags;
294293 u16 cookie;
295294 u8 *preq;
296295
@@ -301,7 +300,7 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, · 4 unmodified lines
301300 /* Cmdq are in 16-byte units, each request can consume 1 or more
302301 * cmdqe
303302 */
304− spin_lock_irqsave(&hwq->lock, flags);
303+ spin_lock_bh(&hwq->lock);
305304 required_slots = bnxt_qplib_get_cmd_slots(msg->req);
306305 free_slots = HWQ_FREE_SLOTS(hwq);
307306 cookie = cmdq->seq_num & RCFW_MAX_COOKIE_VALUE;
@@ -311,7 +310,7 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, · 3 unmodified lines
311310 dev_info_ratelimited(&pdev->dev,
312311 "CMDQ is full req/free %d/%d!",
313312 required_slots, free_slots);
314− spin_unlock_irqrestore(&hwq->lock, flags);
313+ spin_unlock_bh(&hwq->lock);
315314 return -EAGAIN;
316315 }
317316 if (msg->block)
@@ -367,7 +366,7 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, · 49 unmodified lines
367366 wmb();
368367 writel(cmdq_prod, cmdq->cmdq_mbox.prod);
369368 writel(RCFW_CMDQ_TRIG_VAL, cmdq->cmdq_mbox.db);
370− spin_unlock_irqrestore(&hwq->lock, flags);
369+ spin_unlock_bh(&hwq->lock);
371370 /* Return the CREQ response pointer */
372371 return 0;
373372 }
@@ -486,7 +485,6 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw, · 112 unmodified lines
486485 {
487486 struct creq_qp_event *evnt = (struct creq_qp_event *)msg->resp;
488487 struct bnxt_qplib_crsqe *crsqe;
489− unsigned long flags;
490488 u16 cookie;
491489 int rc;
492490 u8 opcode;
@@ -512,12 +510,12 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw, · 19 unmodified lines
512510 rc = __poll_for_resp(rcfw, cookie);
513511
514512 if (rc) {
515− spin_lock_irqsave(&rcfw->cmdq.hwq.lock, flags);
513+ spin_lock_bh(&rcfw->cmdq.hwq.lock);
516514 crsqe = &rcfw->crsqe_tbl[cookie];
517515 crsqe->is_waiter_alive = false;
518516 if (rc == -ENODEV)
519517 set_bit(FIRMWARE_STALL_DETECTED, &rcfw->cmdq.flags);
520− spin_unlock_irqrestore(&rcfw->cmdq.hwq.lock, flags);
518+ spin_unlock_bh(&rcfw->cmdq.hwq.lock);
521519 return -ETIMEDOUT;
522520 }
523521
@@ -525,7 +523,7 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw, · 1 unmodified line
525523 /* failed with status */
526524 dev_err(&rcfw->pdev->dev, "cmdq[%#x]=%#x status %#x\n",
527525 cookie, opcode, evnt->status);
528− rc = -EFAULT;
526+ rc = -EIO;
529527 }
530528
531529 return rc;
@@ -628,7 +626,6 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, · 96 unmodified lines
628626 u16 cookie, blocked = 0;
629627 bool is_waiter_alive;
630628 struct pci_dev *pdev;
631− unsigned long flags;
632629 u32 wait_cmds = 0;
633630 int rc = 0;
634631
@@ -637,17 +634,21 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, · 2 unmodified lines
637634 case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION:
638635 err_event = (struct creq_qp_error_notification *)qp_event;
639636 qp_id = le32_to_cpu(err_event->xid);
637+ spin_lock(&rcfw->tbl_lock);
640638 tbl_indx = map_qp_id_to_tbl_indx(qp_id, rcfw);
641639 qp = rcfw->qp_tbl[tbl_indx].qp_handle;
640+ if (!qp) {
641+ spin_unlock(&rcfw->tbl_lock);
642+ break;
643+ }
644+ bnxt_qplib_mark_qp_error(qp);
645+ rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp);
646+ spin_unlock(&rcfw->tbl_lock);
642647 dev_dbg(&pdev->dev, "Received QP error notification\n");
643648 dev_dbg(&pdev->dev,
644649 "qpid 0x%x, req_err=0x%x, resp_err=0x%x\n",
645650 qp_id, err_event->req_err_state_reason,
646651 err_event->res_err_state_reason);
647− if (!qp)
648− break;
649− bnxt_qplib_mark_qp_error(qp);
650− rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp);
651652 break;
652653 default:
653654 /*
@@ -659,8 +660,7 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, · 5 unmodified lines
659660 *
660661 */
661662
662− spin_lock_irqsave_nested(&hwq->lock, flags,
663− SINGLE_DEPTH_NESTING);
663+ spin_lock_nested(&hwq->lock, SINGLE_DEPTH_NESTING);
664664 cookie = le16_to_cpu(qp_event->cookie);
665665 blocked = cookie & RCFW_CMD_IS_BLOCKING;
666666 cookie &= RCFW_MAX_COOKIE_VALUE;
@@ -672,7 +672,7 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, · 5 unmodified lines
672672 dev_info(&pdev->dev,
673673 "rcfw timedout: cookie = %#x, free_slots = %d",
674674 cookie, crsqe->free_slots);
675− spin_unlock_irqrestore(&hwq->lock, flags);
675+ spin_unlock(&hwq->lock);
676676 return rc;
677677 }
678678
@@ -720,7 +720,7 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, · 41 unmodified lines
720720 __destroy_timedout_ah(rcfw,
721721 (struct creq_create_ah_resp *)
722722 qp_event);
723− spin_unlock_irqrestore(&hwq->lock, flags);
723+ spin_unlock(&hwq->lock);
724724 }
725725 *num_wait += wait_cmds;
726726 return rc;
@@ -734,12 +734,11 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t) · 7 unmodified lines
734734 u32 type, budget = CREQ_ENTRY_POLL_BUDGET;
735735 struct bnxt_qplib_hwq *hwq = &creq->hwq;
736736 struct creq_base *creqe;
737− unsigned long flags;
738737 u32 num_wakeup = 0;
739738 u32 hw_polled = 0;
740739
741740 /* Service the CREQ until budget is over */
742− spin_lock_irqsave(&hwq->lock, flags);
741+ spin_lock_bh(&hwq->lock);
743742 while (budget > 0) {
744743 creqe = bnxt_qplib_get_qe(hwq, hwq->cons, NULL);
745744 if (!CREQ_CMP_VALID(creqe, creq->creq_db.dbinfo.flags))
@@ -782,7 +781,7 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t) · 36 unmodified lines
782781 if (hw_polled)
783782 bnxt_qplib_ring_nq_db(&creq->creq_db.dbinfo,
784783 rcfw->res->cctx, true);
785− spin_unlock_irqrestore(&hwq->lock, flags);
784+ spin_unlock_bh(&hwq->lock);
786785 if (num_wakeup)
787786 wake_up_nr(&rcfw->cmdq.waitq, num_wakeup);
788787 }
@@ -978,6 +977,7 @@ int bnxt_qplib_alloc_rcfw_channel(struct bnxt_qplib_res *res, · 189 unmodified lines
978977 GFP_KERNEL);
979978 if (!rcfw->qp_tbl)
980979 goto fail;
980+ spin_lock_init(&rcfw->tbl_lock);
981981
982982 rcfw->max_timeout = res->cctx->hwrm_cmd_max_timeout;
983983
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h+2−0
@@ -224,6 +224,8 @@ struct bnxt_qplib_rcfw { · 223 unmodified lines
224224 struct bnxt_qplib_crsqe *crsqe_tbl;
225225 int qp_tbl_size;
226226 struct bnxt_qplib_qp_node *qp_tbl;
227+ /* To synchronize the qp-handle hash table */
228+ spinlock_t tbl_lock;
227229 u64 oos_prev;
228230 u32 init_oos_stats;
229231 u32 cmdq_depth;
drivers/infiniband/hw/bnxt_re/qplib_res.c+5−16
@@ -244,6 +244,8 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq, · 243 unmodified lines
244244 sginfo.pgsize = npde * pg_size;
245245 sginfo.npages = 1;
246246 rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_0], &sginfo);
247+ if (rc)
248+ goto fail;
247249
248250 /* Alloc PBL pages */
249251 sginfo.npages = npbl;
@@ -255,22 +257,9 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq, · 5 unmodified lines
255257 dst_virt_ptr =
256258 (dma_addr_t **)hwq->pbl[PBL_LVL_0].pg_arr;
257259 src_phys_ptr = hwq->pbl[PBL_LVL_1].pg_map_arr;
258− if (hwq_attr->type == HWQ_TYPE_MR) {
259− /* For MR it is expected that we supply only 1 contigous
260− * page i.e only 1 entry in the PDL that will contain
261− * all the PBLs for the user supplied memory region
262− */
263− for (i = 0; i < hwq->pbl[PBL_LVL_1].pg_count;
264− i++)
265− dst_virt_ptr[0][i] = src_phys_ptr[i] |
266− flag;
267− } else {
268− for (i = 0; i < hwq->pbl[PBL_LVL_1].pg_count;
269− i++)
270− dst_virt_ptr[PTR_PG(i)][PTR_IDX(i)] =
271− src_phys_ptr[i] |
272− PTU_PDE_VALID;
273− }
260+ for (i = 0; i < hwq->pbl[PBL_LVL_1].pg_count; i++)
261+ dst_virt_ptr[0][i] = src_phys_ptr[i] | flag;
262+
274263 /* Alloc or init PTEs */
275264 rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_2],
276265 hwq_attr->sginfo);
drivers/infiniband/hw/bnxt_re/qplib_sp.c+10−1
@@ -140,6 +140,8 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, · 139 unmodified lines
140140 min_t(u32, sb->max_sge_var_wqe, BNXT_VAR_MAX_SGE) : 6;
141141 attr->max_cq = le32_to_cpu(sb->max_cq);
142142 attr->max_cq_wqes = le32_to_cpu(sb->max_cqe);
143+ if (!bnxt_qplib_is_chip_gen_p7(rcfw->res->cctx))
144+ attr->max_cq_wqes = min_t(u32, BNXT_QPLIB_MAX_CQ_WQES, attr->max_cq_wqes);
143145 attr->max_cq_sges = attr->max_qp_sges;
144146 attr->max_mr = le32_to_cpu(sb->max_mr);
145147 attr->max_mw = le32_to_cpu(sb->max_mw);
@@ -157,7 +159,14 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, · 11 unmodified lines
157159 if (!bnxt_qplib_is_chip_gen_p7(rcfw->res->cctx))
158160 attr->l2_db_size = (sb->l2_db_space_size + 1) *
159161 (0x01 << RCFW_DBR_BASE_PAGE_SHIFT);
160− attr->max_sgid = BNXT_QPLIB_NUM_GIDS_SUPPORTED;
162+ /*
163+ * Read the max gid supported by HW.
164+ * For each entry in HW GID in HW table, we consume 2
165+ * GID entries in the kernel GID table. So max_gid reported
166+ * to stack can be up to twice the value reported by the HW, up to 256 gids.
167+ */
168+ attr->max_sgid = le32_to_cpu(sb->max_gid);
169+ attr->max_sgid = min_t(u32, BNXT_QPLIB_NUM_GIDS_SUPPORTED, 2 * attr->max_sgid);
161170 attr->dev_cap_flags = le16_to_cpu(sb->dev_cap_flags);
162171 attr->dev_cap_flags2 = le16_to_cpu(sb->dev_cap_ext_flags_2);
163172
drivers/infiniband/hw/bnxt_re/qplib_sp.h+1−0
@@ -56,6 +56,7 @@ struct bnxt_qplib_dev_attr { · 55 unmodified lines
5656 u32 max_qp_wqes;
5757 u32 max_qp_sges;
5858 u32 max_cq;
59+#define BNXT_QPLIB_MAX_CQ_WQES 0xfffff
5960 u32 max_cq_wqes;
6061 u32 max_cq_sges;
6162 u32 max_mr;
drivers/infiniband/hw/cxgb4/cm.c+4−5
@@ -2086,7 +2086,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, · 2085 unmodified lines
20862086 err = -ENOMEM;
20872087 if (n->dev->flags & IFF_LOOPBACK) {
20882088 if (iptype == 4)
2089− pdev = ip_dev_find(&init_net, *(__be32 *)peer_ip);
2089+ pdev = __ip_dev_find(&init_net, *(__be32 *)peer_ip, false);
20902090 else if (IS_ENABLED(CONFIG_IPV6))
20912091 for_each_netdev(&init_net, pdev) {
20922092 if (ipv6_chk_addr(&init_net,
@@ -2101,12 +2101,12 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, · 8 unmodified lines
21012101 err = -ENODEV;
21022102 goto out;
21032103 }
2104+ if (is_vlan_dev(pdev))
2105+ pdev = vlan_dev_real_dev(pdev);
21042106 ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
21052107 n, pdev, rt_tos2priority(tos));
2106− if (!ep->l2t) {
2107− dev_put(pdev);
2108+ if (!ep->l2t)
21082109 goto out;
2109− }
21102110 ep->mtu = pdev->mtu;
21112111 ep->tx_chan = cxgb4_port_chan(pdev);
21122112 ep->smac_idx = ((struct port_info *)netdev_priv(pdev))->smt_idx;
@@ -2119,7 +2119,6 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, · 6 unmodified lines
21192119 ep->rss_qid = cdev->rdev.lldi.rxq_ids[
21202120 cxgb4_port_idx(pdev) * step];
21212121 set_tcp_window(ep, (struct port_info *)netdev_priv(pdev));
2122− dev_put(pdev);
21232122 } else {
21242123 pdev = get_real_dev(n->dev);
21252124 ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
drivers/infiniband/hw/cxgb4/provider.c+1−0
@@ -473,6 +473,7 @@ static const struct ib_device_ops c4iw_dev_ops = { · 472 unmodified lines
473473 .fill_res_cq_entry = c4iw_fill_res_cq_entry,
474474 .fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry,
475475 .fill_res_mr_entry = c4iw_fill_res_mr_entry,
476+ .fill_res_qp_entry = c4iw_fill_res_qp_entry,
476477 .get_dev_fw_str = get_dev_fw_str,
477478 .get_dma_mr = c4iw_get_dma_mr,
478479 .get_hw_stats = c4iw_get_mib,
drivers/infiniband/hw/irdma/cm.c+1−1
@@ -3631,7 +3631,7 @@ void irdma_free_lsmm_rsrc(struct irdma_qp *iwqp) · 3630 unmodified lines
36313631 /**
36323632 * irdma_accept - registered call for connection to be accepted
36333633 * @cm_id: cm information for passive connection
3634− * @conn_param: accpet parameters
3634+ * @conn_param: accept parameters
36353635 */
36363636 int irdma_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
36373637 {
drivers/infiniband/hw/mlx5/qp.c+2−2
@@ -4268,14 +4268,14 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, · 4267 unmodified lines
42684268 MLX5_SET(qpc, qpc, retry_count, attr->retry_cnt);
42694269
42704270 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && attr->max_rd_atomic)
4271− MLX5_SET(qpc, qpc, log_sra_max, ilog2(attr->max_rd_atomic));
4271+ MLX5_SET(qpc, qpc, log_sra_max, fls(attr->max_rd_atomic - 1));
42724272
42734273 if (attr_mask & IB_QP_SQ_PSN)
42744274 MLX5_SET(qpc, qpc, next_send_psn, attr->sq_psn);
42754275
42764276 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && attr->max_dest_rd_atomic)
42774277 MLX5_SET(qpc, qpc, log_rra_max,
4278− ilog2(attr->max_dest_rd_atomic));
4278+ fls(attr->max_dest_rd_atomic - 1));
42794279
42804280 if (attr_mask & (IB_QP_ACCESS_FLAGS | IB_QP_MAX_DEST_RD_ATOMIC)) {
42814281 err = set_qpc_atomic_flags(qp, attr, attr_mask, qpc);
drivers/infiniband/sw/siw/siw_qp_tx.c+2−0
@@ -331,6 +331,8 @@ static int siw_tcp_sendpages(struct socket *s, struct page **page, int offset, · 330 unmodified lines
331331 msg.msg_flags &= ~MSG_MORE;
332332
333333 tcp_rate_check_app_limited(sk);
334+ if (!sendpage_ok(page[i]))
335+ msg.msg_flags &= ~MSG_SPLICE_PAGES;
334336 bvec_set_page(&bvec, page[i], bytes, offset);
335337 iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, size);
336338
drivers/infiniband/ulp/srpt/ib_srpt.c+68−12
@@ -68,6 +68,8 @@ MODULE_LICENSE("Dual BSD/GPL"); · 67 unmodified lines
6868 static u64 srpt_service_guid;
6969 static DEFINE_SPINLOCK(srpt_dev_lock); /* Protects srpt_dev_list. */
7070 static LIST_HEAD(srpt_dev_list); /* List of srpt_device structures. */
71+static DEFINE_MUTEX(srpt_mc_mutex); /* Protects srpt_memory_caches. */
72+static DEFINE_XARRAY(srpt_memory_caches); /* See also srpt_memory_cache_entry */
7173
7274 static unsigned srp_max_req_size = DEFAULT_MAX_REQ_SIZE;
7375 module_param(srp_max_req_size, int, 0444);
@@ -105,6 +107,63 @@ static void srpt_recv_done(struct ib_cq *cq, struct ib_wc *wc); · 31 unmodified lines
105107 static void srpt_send_done(struct ib_cq *cq, struct ib_wc *wc);
106108 static void srpt_process_wait_list(struct srpt_rdma_ch *ch);
107109
110+/* Type of the entries in srpt_memory_caches. */
111+struct srpt_memory_cache_entry {
112+ refcount_t ref;
113+ struct kmem_cache *c;
114+};
115+
116+static struct kmem_cache *srpt_cache_get(unsigned int object_size)
117+{
118+ struct srpt_memory_cache_entry *e;
119+ char name[32];
120+ void *res;
121+
122+ guard(mutex)(&srpt_mc_mutex);
123+ e = xa_load(&srpt_memory_caches, object_size);
124+ if (e) {
125+ refcount_inc(&e->ref);
126+ return e->c;
127+ }
128+ snprintf(name, sizeof(name), "srpt-%u", object_size);
129+ e = kmalloc(sizeof(*e), GFP_KERNEL);
130+ if (!e)
131+ return NULL;
132+ refcount_set(&e->ref, 1);
133+ e->c = kmem_cache_create(name, object_size, /*align=*/512, 0, NULL);
134+ if (!e->c)
135+ goto free_entry;
136+ res = xa_store(&srpt_memory_caches, object_size, e, GFP_KERNEL);
137+ if (xa_is_err(res))
138+ goto destroy_cache;
139+ return e->c;
140+
141+destroy_cache:
142+ kmem_cache_destroy(e->c);
143+
144+free_entry:
145+ kfree(e);
146+ return NULL;
147+}
148+
149+static void srpt_cache_put(struct kmem_cache *c)
150+{
151+ struct srpt_memory_cache_entry *e = NULL;
152+ unsigned long object_size;
153+
154+ guard(mutex)(&srpt_mc_mutex);
155+ xa_for_each(&srpt_memory_caches, object_size, e)
156+ if (e->c == c)
157+ break;
158+ if (WARN_ON_ONCE(!e))
159+ return;
160+ if (!refcount_dec_and_test(&e->ref))
161+ return;
162+ WARN_ON_ONCE(xa_erase(&srpt_memory_caches, object_size) != e);
163+ kmem_cache_destroy(e->c);
164+ kfree(e);
165+}
166+
108167 /*
109168 * The only allowed channel state changes are those that change the channel
110169 * state into a state with a higher numerical value. Hence the new > prev test.
@@ -2119,13 +2178,13 @@ static void srpt_release_channel_work(struct work_struct *w) · 2008 unmodified lines
21192178 ch->sport->sdev, ch->rq_size,
21202179 ch->rsp_buf_cache, DMA_TO_DEVICE);
21212180
2122− kmem_cache_destroy(ch->rsp_buf_cache);
2181+ srpt_cache_put(ch->rsp_buf_cache);
21232182
21242183 srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_recv_ring,
21252184 sdev, ch->rq_size,
21262185 ch->req_buf_cache, DMA_FROM_DEVICE);
21272186
2128− kmem_cache_destroy(ch->req_buf_cache);
2187+ srpt_cache_put(ch->req_buf_cache);
21292188
21302189 kref_put(&ch->kref, srpt_free_ch);
21312190 }
@@ -2245,8 +2304,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, · 113 unmodified lines
22452304 INIT_LIST_HEAD(&ch->cmd_wait_list);
22462305 ch->max_rsp_size = ch->sport->port_attrib.srp_max_rsp_size;
22472306
2248− ch->rsp_buf_cache = kmem_cache_create("srpt-rsp-buf", ch->max_rsp_size,
2249− 512, 0, NULL);
2307+ ch->rsp_buf_cache = srpt_cache_get(ch->max_rsp_size);
22502308 if (!ch->rsp_buf_cache)
22512309 goto free_ch;
22522310
@@ -2280,8 +2338,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, · 27 unmodified lines
22802338 alignment_offset = round_up(imm_data_offset, 512) -
22812339 imm_data_offset;
22822340 req_sz = alignment_offset + imm_data_offset + srp_max_req_size;
2283− ch->req_buf_cache = kmem_cache_create("srpt-req-buf", req_sz,
2284− 512, 0, NULL);
2341+ ch->req_buf_cache = srpt_cache_get(req_sz);
22852342 if (!ch->req_buf_cache)
22862343 goto free_rsp_ring;
22872344
@@ -2478,7 +2535,7 @@ free_recv_ring: · 190 unmodified lines
24782535 ch->req_buf_cache, DMA_FROM_DEVICE);
24792536
24802537 free_recv_cache:
2481− kmem_cache_destroy(ch->req_buf_cache);
2538+ srpt_cache_put(ch->req_buf_cache);
24822539
24832540 free_rsp_ring:
24842541 srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring,
@@ -2486,7 +2543,7 @@ free_rsp_ring: · 1 unmodified line
24862543 ch->rsp_buf_cache, DMA_TO_DEVICE);
24872544
24882545 free_rsp_cache:
2489− kmem_cache_destroy(ch->rsp_buf_cache);
2546+ srpt_cache_put(ch->rsp_buf_cache);
24902547
24912548 free_ch:
24922549 if (rdma_cm_id)
@@ -3055,7 +3112,7 @@ static void srpt_free_srq(struct srpt_device *sdev) · 562 unmodified lines
30553112 srpt_free_ioctx_ring((struct srpt_ioctx **)sdev->ioctx_ring, sdev,
30563113 sdev->srq_size, sdev->req_buf_cache,
30573114 DMA_FROM_DEVICE);
3058− kmem_cache_destroy(sdev->req_buf_cache);
3115+ srpt_cache_put(sdev->req_buf_cache);
30593116 sdev->srq = NULL;
30603117 }
30613118
@@ -3082,8 +3139,7 @@ static int srpt_alloc_srq(struct srpt_device *sdev) · 20 unmodified lines
30823139 pr_debug("create SRQ #wr= %d max_allow=%d dev= %s\n", sdev->srq_size,
30833140 sdev->device->attrs.max_srq_wr, dev_name(&device->dev));
30843141
3085− sdev->req_buf_cache = kmem_cache_create("srpt-srq-req-buf",
3086− srp_max_req_size, 0, 0, NULL);
3142+ sdev->req_buf_cache = srpt_cache_get(srp_max_req_size);
30873143 if (!sdev->req_buf_cache)
30883144 goto free_srq;
30893145
@@ -3105,7 +3161,7 @@ static int srpt_alloc_srq(struct srpt_device *sdev) · 15 unmodified lines
31053161 return 0;
31063162
31073163 free_cache:
3108− kmem_cache_destroy(sdev->req_buf_cache);
3164+ srpt_cache_put(sdev->req_buf_cache);
31093165
31103166 free_srq:
31113167 ib_destroy_srq(srq);
drivers/input/input.c+73−61
@@ -119,12 +119,12 @@ static void input_pass_values(struct input_dev *dev, · 118 unmodified lines
119119
120120 handle = rcu_dereference(dev->grab);
121121 if (handle) {
122− count = handle->handler->events(handle, vals, count);
122+ count = handle->handle_events(handle, vals, count);
123123 } else {
124124 list_for_each_entry_rcu(handle, &dev->h_list, d_node)
125125 if (handle->open) {
126− count = handle->handler->events(handle, vals,
127− count);
126+ count = handle->handle_events(handle, vals,
127+ count);
128128 if (!count)
129129 break;
130130 }
@@ -2534,57 +2534,6 @@ static int input_handler_check_methods(const struct input_handler *handler) · 2403 unmodified lines
25342534 return 0;
25352535 }
25362536
2537−/*
2538− * An implementation of input_handler's events() method that simply
2539− * invokes handler->event() method for each event one by one.
2540− */
2541−static unsigned int input_handler_events_default(struct input_handle *handle,
2542− struct input_value *vals,
2543− unsigned int count)
2544−{
2545− struct input_handler *handler = handle->handler;
2546− struct input_value *v;
2547−
2548− for (v = vals; v != vals + count; v++)
2549− handler->event(handle, v->type, v->code, v->value);
2550−
2551− return count;
2552−}
2553−
2554−/*
2555− * An implementation of input_handler's events() method that invokes
2556− * handler->filter() method for each event one by one and removes events
2557− * that were filtered out from the "vals" array.
2558− */
2559−static unsigned int input_handler_events_filter(struct input_handle *handle,
2560− struct input_value *vals,
2561− unsigned int count)
2562−{
2563− struct input_handler *handler = handle->handler;
2564− struct input_value *end = vals;
2565− struct input_value *v;
2566−
2567− for (v = vals; v != vals + count; v++) {
2568− if (handler->filter(handle, v->type, v->code, v->value))
2569− continue;
2570− if (end != v)
2571− *end = *v;
2572− end++;
2573− }
2574−
2575− return end - vals;
2576−}
2577−
2578−/*
2579− * An implementation of input_handler's events() method that does nothing.
2580− */
2581−static unsigned int input_handler_events_null(struct input_handle *handle,
2582− struct input_value *vals,
2583− unsigned int count)
2584−{
2585− return count;
2586−}
2587−
25882537 /**
25892538 * input_register_handler - register a new input handler
25902539 * @handler: handler to be registered
@@ -2604,13 +2553,6 @@ int input_register_handler(struct input_handler *handler) · 13 unmodified lines
26042553
26052554 INIT_LIST_HEAD(&handler->h_list);
26062555
2607− if (handler->filter)
2608− handler->events = input_handler_events_filter;
2609− else if (handler->event)
2610− handler->events = input_handler_events_default;
2611− else if (!handler->events)
2612− handler->events = input_handler_events_null;
2613−
26142556 error = mutex_lock_interruptible(&input_mutex);
26152557 if (error)
26162558 return error;
@@ -2684,6 +2626,75 @@ int input_handler_for_each_handle(struct input_handler *handler, void *data, · 67 unmodified lines
26842626 }
26852627 EXPORT_SYMBOL(input_handler_for_each_handle);
26862628
2629+/*
2630+ * An implementation of input_handle's handle_events() method that simply
2631+ * invokes handler->event() method for each event one by one.
2632+ */
2633+static unsigned int input_handle_events_default(struct input_handle *handle,
2634+ struct input_value *vals,
2635+ unsigned int count)
2636+{
2637+ struct input_handler *handler = handle->handler;
2638+ struct input_value *v;
2639+
2640+ for (v = vals; v != vals + count; v++)
2641+ handler->event(handle, v->type, v->code, v->value);
2642+
2643+ return count;
2644+}
2645+
2646+/*
2647+ * An implementation of input_handle's handle_events() method that invokes
2648+ * handler->filter() method for each event one by one and removes events
2649+ * that were filtered out from the "vals" array.
2650+ */
2651+static unsigned int input_handle_events_filter(struct input_handle *handle,
2652+ struct input_value *vals,
2653+ unsigned int count)
2654+{
2655+ struct input_handler *handler = handle->handler;
2656+ struct input_value *end = vals;
2657+ struct input_value *v;
2658+
2659+ for (v = vals; v != vals + count; v++) {
2660+ if (handler->filter(handle, v->type, v->code, v->value))
2661+ continue;
2662+ if (end != v)
2663+ *end = *v;
2664+ end++;
2665+ }
2666+
2667+ return end - vals;
2668+}
2669+
2670+/*
2671+ * An implementation of input_handle's handle_events() method that does nothing.
2672+ */
2673+static unsigned int input_handle_events_null(struct input_handle *handle,
2674+ struct input_value *vals,
2675+ unsigned int count)
2676+{
2677+ return count;
2678+}
2679+
2680+/*
2681+ * Sets up appropriate handle->event_handler based on the input_handler
2682+ * associated with the handle.
2683+ */
2684+static void input_handle_setup_event_handler(struct input_handle *handle)
2685+{
2686+ struct input_handler *handler = handle->handler;
2687+
2688+ if (handler->filter)
2689+ handle->handle_events = input_handle_events_filter;
2690+ else if (handler->event)
2691+ handle->handle_events = input_handle_events_default;
2692+ else if (handler->events)
2693+ handle->handle_events = handler->events;
2694+ else
2695+ handle->handle_events = input_handle_events_null;
2696+}
2697+
26872698 /**
26882699 * input_register_handle - register a new input handle
26892700 * @handle: handle to register
@@ -2701,6 +2712,7 @@ int input_register_handle(struct input_handle *handle) · 11 unmodified lines
27012712 struct input_dev *dev = handle->dev;
27022713 int error;
27032714
2715+ input_handle_setup_event_handler(handle);
27042716 /*
27052717 * We take dev->mutex here to prevent race with
27062718 * input_release_device().
drivers/input/joystick/xpad.c+3−0
@@ -218,6 +218,7 @@ static const struct xpad_device { · 217 unmodified lines
218218 { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX },
219219 { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX },
220220 { 0x0d2f, 0x0002, "Andamiro Pump It Up pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
221+ { 0x0db0, 0x1901, "Micro Star International Xbox360 Controller for Windows", 0, XTYPE_XBOX360 },
221222 { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX },
222223 { 0x0e4c, 0x1103, "Radica Gamester Reflex", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX },
223224 { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX },
@@ -373,6 +374,7 @@ static const struct xpad_device { · 149 unmodified lines
373374 { 0x294b, 0x3404, "Snakebyte GAMEPAD RGB X", 0, XTYPE_XBOXONE },
374375 { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
375376 { 0x2dc8, 0x3106, "8BitDo Pro 2 Wired Controller", 0, XTYPE_XBOX360 },
377+ { 0x2dc8, 0x310a, "8BitDo Ultimate 2C Wireless Controller", 0, XTYPE_XBOX360 },
376378 { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
377379 { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
378380 { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
@@ -492,6 +494,7 @@ static const struct usb_device_id xpad_table[] = { · 113 unmodified lines
492494 XPAD_XBOX360_VENDOR(0x07ff), /* Mad Catz Gamepad */
493495 XPAD_XBOXONE_VENDOR(0x0b05), /* ASUS controllers */
494496 XPAD_XBOX360_VENDOR(0x0c12), /* Zeroplus X-Box 360 controllers */
497+ XPAD_XBOX360_VENDOR(0x0db0), /* Micro Star International X-Box 360 controllers */
495498 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f Xbox 360 controllers */
496499 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f Xbox One controllers */
497500 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori controllers */
drivers/input/keyboard/adp5588-keys.c+4−2
@@ -822,7 +822,8 @@ static int adp5588_suspend(struct device *dev) · 821 unmodified lines
822822 {
823823 struct i2c_client *client = to_i2c_client(dev);
824824
825− disable_irq(client->irq);
825+ if (client->irq)
826+ disable_irq(client->irq);
826827
827828 return 0;
828829 }
@@ -831,7 +832,8 @@ static int adp5588_resume(struct device *dev) · 2 unmodified lines
831832 {
832833 struct i2c_client *client = to_i2c_client(dev);
833834
834− enable_irq(client->irq);
835+ if (client->irq)
836+ enable_irq(client->irq);
835837
836838 return 0;
837839 }
drivers/input/touchscreen/edt-ft5x06.c+18−1
@@ -1121,6 +1121,14 @@ static void edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata) · 1120 unmodified lines
11211121 }
11221122 }
11231123
1124+static void edt_ft5x06_exit_regmap(void *arg)
1125+{
1126+ struct edt_ft5x06_ts_data *data = arg;
1127+
1128+ if (!IS_ERR_OR_NULL(data->regmap))
1129+ regmap_exit(data->regmap);
1130+}
1131+
11241132 static void edt_ft5x06_disable_regulators(void *arg)
11251133 {
11261134 struct edt_ft5x06_ts_data *data = arg;
@@ -1154,6 +1162,16 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) · 27 unmodified lines
11541162 return PTR_ERR(tsdata->regmap);
11551163 }
11561164
1165+ /*
1166+ * We are not using devm_regmap_init_i2c() and instead install a
1167+ * custom action because we may replace regmap with M06-specific one
1168+ * and we need to make sure that it will not be released too early.
1169+ */
1170+ error = devm_add_action_or_reset(&client->dev, edt_ft5x06_exit_regmap,
1171+ tsdata);
1172+ if (error)
1173+ return error;
1174+
11571175 chip_data = device_get_match_data(&client->dev);
11581176 if (!chip_data)
11591177 chip_data = (const struct edt_i2c_chip_data *)id->driver_data;
@@ -1347,7 +1365,6 @@ static void edt_ft5x06_ts_remove(struct i2c_client *client) · 187 unmodified lines
13471365 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
13481366
13491367 edt_ft5x06_ts_teardown_debugfs(tsdata);
1350− regmap_exit(tsdata->regmap);
13511368 }
13521369
13531370 static int edt_ft5x06_ts_suspend(struct device *dev)
drivers/input/touchscreen/zinitix.c+22−12
@@ -645,19 +645,29 @@ static int zinitix_ts_probe(struct i2c_client *client) · 644 unmodified lines
645645 return error;
646646 }
647647
648− bt541->num_keycodes = device_property_count_u32(&client->dev, "linux,keycodes");
649− if (bt541->num_keycodes > ARRAY_SIZE(bt541->keycodes)) {
650− dev_err(&client->dev, "too many keys defined (%d)\n", bt541->num_keycodes);
651− return -EINVAL;
652− }
648+ if (device_property_present(&client->dev, "linux,keycodes")) {
649+ bt541->num_keycodes = device_property_count_u32(&client->dev,
650+ "linux,keycodes");
651+ if (bt541->num_keycodes < 0) {
652+ dev_err(&client->dev, "Failed to count keys (%d)\n",
653+ bt541->num_keycodes);
654+ return bt541->num_keycodes;
655+ } else if (bt541->num_keycodes > ARRAY_SIZE(bt541->keycodes)) {
656+ dev_err(&client->dev, "Too many keys defined (%d)\n",
657+ bt541->num_keycodes);
658+ return -EINVAL;
659+ }
653660
654− error = device_property_read_u32_array(&client->dev, "linux,keycodes",
655− bt541->keycodes,
656− bt541->num_keycodes);
657− if (error) {
658− dev_err(&client->dev,
659− "Unable to parse \"linux,keycodes\" property: %d\n", error);
660− return error;
661+ error = device_property_read_u32_array(&client->dev,
662+ "linux,keycodes",
663+ bt541->keycodes,
664+ bt541->num_keycodes);
665+ if (error) {
666+ dev_err(&client->dev,
667+ "Unable to parse \"linux,keycodes\" property: %d\n",
668+ error);
669+ return error;
670+ }
661671 }
662672
663673 error = zinitix_init_input_dev(bt541);
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c+2−2
@@ -1420,7 +1420,7 @@ static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master) · 1419 unmodified lines
14201420 cd_table->s1fmt = STRTAB_STE_0_S1FMT_LINEAR;
14211421 cd_table->linear.num_ents = max_contexts;
14221422
1423− l1size = max_contexts * sizeof(struct arm_smmu_cd),
1423+ l1size = max_contexts * sizeof(struct arm_smmu_cd);
14241424 cd_table->linear.table = dma_alloc_coherent(smmu->dev, l1size,
14251425 &cd_table->cdtab_dma,
14261426 GFP_KERNEL);
@@ -3625,7 +3625,7 @@ static int arm_smmu_init_strtab_2lvl(struct arm_smmu_device *smmu) · 2198 unmodified lines
36253625 u32 l1size;
36263626 struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
36273627 unsigned int last_sid_idx =
3628− arm_smmu_strtab_l1_idx((1 << smmu->sid_bits) - 1);
3628+ arm_smmu_strtab_l1_idx((1ULL << smmu->sid_bits) - 1);
36293629
36303630 /* Calculate the L1 size, capped to the SIDSIZE. */
36313631 cfg->l2.num_l1_ents = min(last_sid_idx + 1, STRTAB_MAX_L1_ENTRIES);
drivers/iommu/arm/arm-smmu/arm-smmu-impl.c+2−2
@@ -130,7 +130,7 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu) · 129 unmodified lines
130130
131131 /*
132132 * Disable MMU-500's not-particularly-beneficial next-page
133− * prefetcher for the sake of errata #841119 and #826419.
133+ * prefetcher for the sake of at least 5 known errata.
134134 */
135135 for (i = 0; i < smmu->num_context_banks; ++i) {
136136 reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
@@ -138,7 +138,7 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu) · 1 unmodified line
138138 arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg);
139139 reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
140140 if (reg & ARM_MMU500_ACTLR_CPRE)
141− dev_warn_once(smmu->dev, "Failed to disable prefetcher [errata #841119 and #826419], check ACR.CACHE_LOCK\n");
141+ dev_warn_once(smmu->dev, "Failed to disable prefetcher for errata workarounds, check SACR.CACHE_LOCK\n");
142142 }
143143
144144 return 0;
drivers/iommu/intel/iommu.c+3−1
@@ -3340,8 +3340,10 @@ static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *op · 3339 unmodified lines
33403340 */
33413341 static void domain_context_clear(struct device_domain_info *info)
33423342 {
3343− if (!dev_is_pci(info->dev))
3343+ if (!dev_is_pci(info->dev)) {
33443344 domain_context_clear_one(info, info->bus, info->devfn);
3345+ return;
3346+ }
33453347
33463348 pci_for_each_dma_alias(to_pci_dev(info->dev),
33473349 &domain_context_clear_one_cb, info);
drivers/irqchip/Kconfig+0−7
@@ -45,13 +45,6 @@ config ARM_GIC_V3_ITS · 44 unmodified lines
4545 select IRQ_MSI_LIB
4646 default ARM_GIC_V3
4747
48−config ARM_GIC_V3_ITS_PCI
49− bool
50− depends on ARM_GIC_V3_ITS
51− depends on PCI
52− depends on PCI_MSI
53− default ARM_GIC_V3_ITS
54−
5548 config ARM_GIC_V3_ITS_FSL_MC
5649 bool
5750 depends on ARM_GIC_V3_ITS
drivers/irqchip/irq-gic-v3-its.c+22−6
@@ -797,8 +797,8 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, · 796 unmodified lines
797797 its_encode_valid(cmd, desc->its_vmapp_cmd.valid);
798798
799799 if (!desc->its_vmapp_cmd.valid) {
800+ alloc = !atomic_dec_return(&desc->its_vmapp_cmd.vpe->vmapp_count);
800801 if (is_v4_1(its)) {
801− alloc = !atomic_dec_return(&desc->its_vmapp_cmd.vpe->vmapp_count);
802802 its_encode_alloc(cmd, alloc);
803803 /*
804804 * Unmapping a VPE is self-synchronizing on GICv4.1,
@@ -817,13 +817,13 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, · 12 unmodified lines
817817 its_encode_vpt_addr(cmd, vpt_addr);
818818 its_encode_vpt_size(cmd, LPI_NRBITS - 1);
819819
820+ alloc = !atomic_fetch_inc(&desc->its_vmapp_cmd.vpe->vmapp_count);
821+
820822 if (!is_v4_1(its))
821823 goto out;
822824
823825 vconf_addr = virt_to_phys(page_address(desc->its_vmapp_cmd.vpe->its_vm->vprop_page));
824826
825− alloc = !atomic_fetch_inc(&desc->its_vmapp_cmd.vpe->vmapp_count);
826−
827827 its_encode_alloc(cmd, alloc);
828828
829829 /*
@@ -3806,6 +3806,23 @@ static int its_vpe_set_affinity(struct irq_data *d, · 2976 unmodified lines
38063806 struct cpumask *table_mask;
38073807 unsigned long flags;
38083808
3809+ /*
3810+ * Check if we're racing against a VPE being destroyed, for
3811+ * which we don't want to allow a VMOVP.
3812+ */
3813+ if (!atomic_read(&vpe->vmapp_count)) {
3814+ if (gic_requires_eager_mapping())
3815+ return -EINVAL;
3816+
3817+ /*
3818+ * If we lazily map the VPEs, this isn't an error and
3819+ * we can exit cleanly.
3820+ */
3821+ cpu = cpumask_first(mask_val);
3822+ irq_data_update_effective_affinity(d, cpumask_of(cpu));
3823+ return IRQ_SET_MASK_OK_DONE;
3824+ }
3825+
38093826 /*
38103827 * Changing affinity is mega expensive, so let's be as lazy as
38113828 * we can and only do it if we really have to. Also, if mapped
@@ -4463,9 +4480,8 @@ static int its_vpe_init(struct its_vpe *vpe) · 651 unmodified lines
44634480 raw_spin_lock_init(&vpe->vpe_lock);
44644481 vpe->vpe_id = vpe_id;
44654482 vpe->vpt_page = vpt_page;
4466− if (gic_rdists->has_rvpeid)
4467− atomic_set(&vpe->vmapp_count, 0);
4468− else
4483+ atomic_set(&vpe->vmapp_count, 0);
4484+ if (!gic_rdists->has_rvpeid)
44694485 vpe->vpe_proxy_event = -1;
44704486
44714487 return 0;
drivers/irqchip/irq-mscc-ocelot.c+8−2
@@ -37,7 +37,7 @@ static struct chip_props ocelot_props = { · 36 unmodified lines
3737 .reg_off_ena_clr = 0x1c,
3838 .reg_off_ena_set = 0x20,
3939 .reg_off_ident = 0x38,
40− .reg_off_trigger = 0x5c,
40+ .reg_off_trigger = 0x4,
4141 .n_irq = 24,
4242 };
4343
@@ -70,7 +70,7 @@ static struct chip_props jaguar2_props = { · 26 unmodified lines
7070 .reg_off_ena_clr = 0x1c,
7171 .reg_off_ena_set = 0x20,
7272 .reg_off_ident = 0x38,
73− .reg_off_trigger = 0x5c,
73+ .reg_off_trigger = 0x4,
7474 .n_irq = 29,
7575 };
7676
@@ -84,6 +84,12 @@ static void ocelot_irq_unmask(struct irq_data *data) · 7 unmodified lines
8484 u32 val;
8585
8686 irq_gc_lock(gc);
87+ /*
88+ * Clear sticky bits for edge mode interrupts.
89+ * Serval has only one trigger register replication, but the adjacent
90+ * register is always read as zero, so there's no need to handle this
91+ * case separately.
92+ */
8793 val = irq_reg_readl(gc, ICPU_CFG_INTR_INTR_TRIGGER(p, 0)) |
8894 irq_reg_readl(gc, ICPU_CFG_INTR_INTR_TRIGGER(p, 1));
8995 if (!(val & mask))
drivers/irqchip/irq-renesas-rzg2l.c+14−2
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 */
99
1010 #include <linux/bitfield.h>
11+#include <linux/cleanup.h>
1112 #include <linux/clk.h>
1213 #include <linux/err.h>
1314 #include <linux/io.h>
@@ -530,12 +531,12 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irqc_priv *priv, · 516 unmodified lines
530531 static int rzg2l_irqc_common_init(struct device_node *node, struct device_node *parent,
531532 const struct irq_chip *irq_chip)
532533 {
534+ struct platform_device *pdev = of_find_device_by_node(node);
535+ struct device *dev __free(put_device) = pdev ? &pdev->dev : NULL;
533536 struct irq_domain *irq_domain, *parent_domain;
534− struct platform_device *pdev;
535537 struct reset_control *resetn;
536538 int ret;
537539
538− pdev = of_find_device_by_node(node);
539540 if (!pdev)
540541 return -ENODEV;
541542
@@ -591,6 +592,17 @@ static int rzg2l_irqc_common_init(struct device_node *node, struct device_node * · 49 unmodified lines
591592
592593 register_syscore_ops(&rzg2l_irqc_syscore_ops);
593594
595+ /*
596+ * Prevent the cleanup function from invoking put_device by assigning
597+ * NULL to dev.
598+ *
599+ * make coccicheck will complain about missing put_device calls, but
600+ * those are false positives, as dev will be automatically "put" via
601+ * __free_put_device on the failing path.
602+ * On the successful path we don't actually want to "put" dev.
603+ */
604+ dev = NULL;
605+
594606 return 0;
595607
596608 pm_put:
drivers/irqchip/irq-riscv-imsic-platform.c+1−1
@@ -341,7 +341,7 @@ int imsic_irqdomain_init(void) · 340 unmodified lines
341341 imsic->fwnode, global->hart_index_bits, global->guest_index_bits);
342342 pr_info("%pfwP: group-index-bits: %d, group-index-shift: %d\n",
343343 imsic->fwnode, global->group_index_bits, global->group_index_shift);
344− pr_info("%pfwP: per-CPU IDs %d at base PPN %pa\n",
344+ pr_info("%pfwP: per-CPU IDs %d at base address %pa\n",
345345 imsic->fwnode, global->nr_ids, &global->base_addr);
346346 pr_info("%pfwP: total %d interrupts available\n",
347347 imsic->fwnode, num_possible_cpus() * (global->nr_ids - 1));
drivers/irqchip/irq-riscv-intc.c+18−1
@@ -265,7 +265,7 @@ struct rintc_data { · 264 unmodified lines
265265 };
266266
267267 static u32 nr_rintc;
268−static struct rintc_data *rintc_acpi_data[NR_CPUS];
268+static struct rintc_data **rintc_acpi_data;
269269
270270 #define for_each_matching_plic(_plic_id) \
271271 unsigned int _plic; \
@@ -329,13 +329,30 @@ int acpi_rintc_get_imsic_mmio_info(u32 index, struct resource *res) · 57 unmodified lines
329329 return 0;
330330 }
331331
332+static int __init riscv_intc_acpi_match(union acpi_subtable_headers *header,
333+ const unsigned long end)
334+{
335+ return 0;
336+}
337+
332338 static int __init riscv_intc_acpi_init(union acpi_subtable_headers *header,
333339 const unsigned long end)
334340 {
335341 struct acpi_madt_rintc *rintc;
336342 struct fwnode_handle *fn;
343+ int count;
337344 int rc;
338345
346+ if (!rintc_acpi_data) {
347+ count = acpi_table_parse_madt(ACPI_MADT_TYPE_RINTC, riscv_intc_acpi_match, 0);
348+ if (count <= 0)
349+ return -EINVAL;
350+
351+ rintc_acpi_data = kcalloc(count, sizeof(*rintc_acpi_data), GFP_KERNEL);
352+ if (!rintc_acpi_data)
353+ return -ENOMEM;
354+ }
355+
339356 rintc = (struct acpi_madt_rintc *)header;
340357 rintc_acpi_data[nr_rintc] = kzalloc(sizeof(*rintc_acpi_data[0]), GFP_KERNEL);
341358 if (!rintc_acpi_data[nr_rintc])
drivers/irqchip/irq-sifive-plic.c+17−12
@@ -126,16 +126,6 @@ static inline void plic_irq_toggle(const struct cpumask *mask, · 125 unmodified lines
126126 }
127127 }
128128
129−static void plic_irq_enable(struct irq_data *d)
130−{
131− plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 1);
132−}
133−
134−static void plic_irq_disable(struct irq_data *d)
135−{
136− plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 0);
137−}
138−
139129 static void plic_irq_unmask(struct irq_data *d)
140130 {
141131 struct plic_priv *priv = irq_data_get_irq_chip_data(d);
@@ -150,6 +140,17 @@ static void plic_irq_mask(struct irq_data *d) · 8 unmodified lines
150140 writel(0, priv->regs + PRIORITY_BASE + d->hwirq * PRIORITY_PER_ID);
151141 }
152142
143+static void plic_irq_enable(struct irq_data *d)
144+{
145+ plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 1);
146+ plic_irq_unmask(d);
147+}
148+
149+static void plic_irq_disable(struct irq_data *d)
150+{
151+ plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 0);
152+}
153+
153154 static void plic_irq_eoi(struct irq_data *d)
154155 {
155156 struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
@@ -626,8 +627,10 @@ static int plic_probe(struct fwnode_handle *fwnode) · 470 unmodified lines
626627
627628 handler->enable_save = kcalloc(DIV_ROUND_UP(nr_irqs, 32),
628629 sizeof(*handler->enable_save), GFP_KERNEL);
629− if (!handler->enable_save)
630+ if (!handler->enable_save) {
631+ error = -ENOMEM;
630632 goto fail_cleanup_contexts;
633+ }
631634 done:
632635 for (hwirq = 1; hwirq <= nr_irqs; hwirq++) {
633636 plic_toggle(handler, hwirq, 0);
@@ -639,8 +642,10 @@ done: · 5 unmodified lines
639642
640643 priv->irqdomain = irq_domain_create_linear(fwnode, nr_irqs + 1,
641644 &plic_irqdomain_ops, priv);
642− if (WARN_ON(!priv->irqdomain))
645+ if (WARN_ON(!priv->irqdomain)) {
646+ error = -ENOMEM;
643647 goto fail_cleanup_contexts;
648+ }
644649
645650 /*
646651 * We can have multiple PLIC instances so setup global state
drivers/md/md.c+23−1
@@ -546,6 +546,26 @@ static int mddev_set_closing_and_sync_blockdev(struct mddev *mddev, int opener_n · 545 unmodified lines
546546 return 0;
547547 }
548548
549+/*
550+ * The only difference from bio_chain_endio() is that the current
551+ * bi_status of bio does not affect the bi_status of parent.
552+ */
553+static void md_end_flush(struct bio *bio)
554+{
555+ struct bio *parent = bio->bi_private;
556+
557+ /*
558+ * If any flush io error before the power failure,
559+ * disk data may be lost.
560+ */
561+ if (bio->bi_status)
562+ pr_err("md: %pg flush io error %d\n", bio->bi_bdev,
563+ blk_status_to_errno(bio->bi_status));
564+
565+ bio_put(bio);
566+ bio_endio(parent);
567+}
568+
549569 bool md_flush_request(struct mddev *mddev, struct bio *bio)
550570 {
551571 struct md_rdev *rdev;
@@ -565,7 +585,9 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio) · 13 unmodified lines
565585 new = bio_alloc_bioset(rdev->bdev, 0,
566586 REQ_OP_WRITE | REQ_PREFLUSH, GFP_NOIO,
567587 &mddev->bio_set);
568− bio_chain(new, bio);
588+ new->bi_private = bio;
589+ new->bi_end_io = md_end_flush;
590+ bio_inc_remaining(bio);
569591 submit_bio(new);
570592 }
571593
drivers/md/raid10.c+5−2
@@ -4061,9 +4061,12 @@ static int raid10_run(struct mddev *mddev) · 4060 unmodified lines
40614061 }
40624062
40634063 if (!mddev_is_dm(conf->mddev)) {
4064− ret = raid10_set_queue_limits(mddev);
4065− if (ret)
4064+ int err = raid10_set_queue_limits(mddev);
4065+
4066+ if (err) {
4067+ ret = err;
40664068 goto out_free_conf;
4069+ }
40674070 }
40684071
40694072 /* need to check that every block has at least one working mirror */
drivers/misc/cardreader/Kconfig+2−1
@@ -16,7 +16,8 @@ config MISC_RTSX_PCI · 15 unmodified lines
1616 select MFD_CORE
1717 help
1818 This supports for Realtek PCI-Express card reader including rts5209,
19− rts5227, rts522A, rts5229, rts5249, rts524A, rts525A, rtl8411, rts5260.
19+ rts5227, rts5228, rts522A, rts5229, rts5249, rts524A, rts525A, rtl8411,
20+ rts5260, rts5261, rts5264.
2021 Realtek card readers support access to many types of memory cards,
2122 such as Memory Stick, Memory Stick Pro, Secure Digital and
2223 MultiMediaCard.
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c+2−0
@@ -364,6 +364,7 @@ static int pci1xxxx_otp_eeprom_probe(struct auxiliary_device *aux_dev, · 363 unmodified lines
364364 if (is_eeprom_responsive(priv)) {
365365 priv->nvmem_config_eeprom.type = NVMEM_TYPE_EEPROM;
366366 priv->nvmem_config_eeprom.name = EEPROM_NAME;
367+ priv->nvmem_config_eeprom.id = NVMEM_DEVID_AUTO;
367368 priv->nvmem_config_eeprom.dev = &aux_dev->dev;
368369 priv->nvmem_config_eeprom.owner = THIS_MODULE;
369370 priv->nvmem_config_eeprom.reg_read = pci1xxxx_eeprom_read;
@@ -383,6 +384,7 @@ static int pci1xxxx_otp_eeprom_probe(struct auxiliary_device *aux_dev, · 13 unmodified lines
383384
384385 priv->nvmem_config_otp.type = NVMEM_TYPE_OTP;
385386 priv->nvmem_config_otp.name = OTP_NAME;
387+ priv->nvmem_config_otp.id = NVMEM_DEVID_AUTO;
386388 priv->nvmem_config_otp.dev = &aux_dev->dev;
387389 priv->nvmem_config_otp.owner = THIS_MODULE;
388390 priv->nvmem_config_otp.reg_read = pci1xxxx_otp_read;
drivers/misc/mei/client.c+2−2
@@ -321,7 +321,7 @@ void mei_io_cb_free(struct mei_cl_cb *cb) · 320 unmodified lines
321321 return;
322322
323323 list_del(&cb->list);
324− kfree(cb->buf.data);
324+ kvfree(cb->buf.data);
325325 kfree(cb->ext_hdr);
326326 kfree(cb);
327327 }
@@ -497,7 +497,7 @@ struct mei_cl_cb *mei_cl_alloc_cb(struct mei_cl *cl, size_t length, · 169 unmodified lines
497497 if (length == 0)
498498 return cb;
499499
500− cb->buf.data = kmalloc(roundup(length, MEI_SLOT_SIZE), GFP_KERNEL);
500+ cb->buf.data = kvmalloc(roundup(length, MEI_SLOT_SIZE), GFP_KERNEL);
501501 if (!cb->buf.data) {
502502 mei_io_cb_free(cb);
503503 return NULL;
drivers/misc/sgi-gru/grukservices.c+0−2
@@ -258,7 +258,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr) · 257 unmodified lines
258258 int lcpu;
259259
260260 BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES);
261− preempt_disable();
262261 bs = gru_lock_kernel_context(-1);
263262 lcpu = uv_blade_processor_id();
264263 *cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE;
@@ -272,7 +271,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr) · 7 unmodified lines
272271 static void gru_free_cpu_resources(void *cb, void *dsr)
273272 {
274273 gru_unlock_kernel_context(uv_numa_blade_id());
275− preempt_enable();
276274 }
277275
278276 /*
drivers/misc/sgi-gru/grumain.c+0−4
@@ -937,10 +937,8 @@ vm_fault_t gru_fault(struct vm_fault *vmf) · 936 unmodified lines
937937
938938 again:
939939 mutex_lock(&gts->ts_ctxlock);
940− preempt_disable();
941940
942941 if (gru_check_context_placement(gts)) {
943− preempt_enable();
944942 mutex_unlock(&gts->ts_ctxlock);
945943 gru_unload_context(gts, 1);
946944 return VM_FAULT_NOPAGE;
@@ -949,7 +947,6 @@ again: · 2 unmodified lines
949947 if (!gts->ts_gru) {
950948 STAT(load_user_context);
951949 if (!gru_assign_gru_context(gts)) {
952− preempt_enable();
953950 mutex_unlock(&gts->ts_ctxlock);
954951 set_current_state(TASK_INTERRUPTIBLE);
955952 schedule_timeout(GRU_ASSIGN_DELAY); /* true hack ZZZ */
@@ -965,7 +962,6 @@ again: · 9 unmodified lines
965962 vma->vm_page_prot);
966963 }
967964
968− preempt_enable();
969965 mutex_unlock(&gts->ts_ctxlock);
970966
971967 return VM_FAULT_NOPAGE;
drivers/misc/sgi-gru/grutlbpurge.c+0−2
@@ -65,7 +65,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state · 64 unmodified lines
6565 struct gru_tlb_global_handle *tgh;
6666 int n;
6767
68− preempt_disable();
6968 if (uv_numa_blade_id() == gru->gs_blade_id)
7069 n = get_on_blade_tgh(gru);
7170 else
@@ -79,7 +78,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state · 7 unmodified lines
7978 static void get_unlock_tgh_handle(struct gru_tlb_global_handle *tgh)
8079 {
8180 unlock_tgh_handle(tgh);
82− preempt_enable();
8381 }
8482
8583 /*
drivers/mmc/core/queue.c+2−1
@@ -388,7 +388,8 @@ static struct gendisk *mmc_alloc_disk(struct mmc_queue *mq, · 387 unmodified lines
388388
389389 blk_queue_rq_timeout(mq->queue, 60 * HZ);
390390
391− dma_set_max_seg_size(mmc_dev(host), queue_max_segment_size(mq->queue));
391+ if (mmc_dev(host)->dma_parms)
392+ dma_set_max_seg_size(mmc_dev(host), queue_max_segment_size(mq->queue));
392393
393394 INIT_WORK(&mq->recovery_work, mmc_mq_recovery_handler);
394395 INIT_WORK(&mq->complete_work, mmc_blk_mq_complete_work);
drivers/mmc/host/mvsdio.c+18−53
@@ -38,9 +38,8 @@ struct mvsd_host { · 37 unmodified lines
3838 unsigned int xfer_mode;
3939 unsigned int intr_en;
4040 unsigned int ctrl;
41− bool use_pio;
42− struct sg_mapping_iter sg_miter;
4341 unsigned int pio_size;
42+ void *pio_ptr;
4443 unsigned int sg_frags;
4544 unsigned int ns_per_clk;
4645 unsigned int clock;
@@ -115,18 +114,11 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data) · 68 unmodified lines
115114 * data when the buffer is not aligned on a 64 byte
116115 * boundary.
117116 */
118− unsigned int miter_flags = SG_MITER_ATOMIC; /* Used from IRQ */
119−
120− if (data->flags & MMC_DATA_READ)
121− miter_flags |= SG_MITER_TO_SG;
122− else
123− miter_flags |= SG_MITER_FROM_SG;
124−
125117 host->pio_size = data->blocks * data->blksz;
126− sg_miter_start(&host->sg_miter, data->sg, data->sg_len, miter_flags);
118+ host->pio_ptr = sg_virt(data->sg);
127119 if (!nodma)
128− dev_dbg(host->dev, "fallback to PIO for data\n");
129− host->use_pio = true;
120+ dev_dbg(host->dev, "fallback to PIO for data at 0x%p size %d\n",
121+ host->pio_ptr, host->pio_size);
130122 return 1;
131123 } else {
132124 dma_addr_t phys_addr;
@@ -137,7 +129,6 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data) · 4 unmodified lines
137129 phys_addr = sg_dma_address(data->sg);
138130 mvsd_write(MVSD_SYS_ADDR_LOW, (u32)phys_addr & 0xffff);
139131 mvsd_write(MVSD_SYS_ADDR_HI, (u32)phys_addr >> 16);
140− host->use_pio = false;
141132 return 0;
142133 }
143134 }
@@ -297,8 +288,8 @@ static u32 mvsd_finish_data(struct mvsd_host *host, struct mmc_data *data, · 153 unmodified lines
297288 {
298289 void __iomem *iobase = host->base;
299290
300− if (host->use_pio) {
301− sg_miter_stop(&host->sg_miter);
291+ if (host->pio_ptr) {
292+ host->pio_ptr = NULL;
302293 host->pio_size = 0;
303294 } else {
304295 dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_frags,
@@ -353,12 +344,9 @@ static u32 mvsd_finish_data(struct mvsd_host *host, struct mmc_data *data, · 48 unmodified lines
353344 static irqreturn_t mvsd_irq(int irq, void *dev)
354345 {
355346 struct mvsd_host *host = dev;
356− struct sg_mapping_iter *sgm = &host->sg_miter;
357347 void __iomem *iobase = host->base;
358348 u32 intr_status, intr_done_mask;
359349 int irq_handled = 0;
360− u16 *p;
361− int s;
362350
363351 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
364352 dev_dbg(host->dev, "intr 0x%04x intr_en 0x%04x hw_state 0x%04x\n",
@@ -382,36 +370,15 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 17 unmodified lines
382370 spin_lock(&host->lock);
383371
384372 /* PIO handling, if needed. Messy business... */
385− if (host->use_pio) {
386− /*
387− * As we set sgm->consumed this always gives a valid buffer
388− * position.
389− */
390− if (!sg_miter_next(sgm)) {
391− /* This should not happen */
392− dev_err(host->dev, "ran out of scatter segments\n");
393− spin_unlock(&host->lock);
394− host->intr_en &=
395− ~(MVSD_NOR_RX_READY | MVSD_NOR_RX_FIFO_8W |
396− MVSD_NOR_TX_AVAIL | MVSD_NOR_TX_FIFO_8W);
397− mvsd_write(MVSD_NOR_INTR_EN, host->intr_en);
398− return IRQ_HANDLED;
399− }
400− p = sgm->addr;
401− s = sgm->length;
402− if (s > host->pio_size)
403− s = host->pio_size;
404− }
405−
406− if (host->use_pio &&
373+ if (host->pio_size &&
407374 (intr_status & host->intr_en &
408375 (MVSD_NOR_RX_READY | MVSD_NOR_RX_FIFO_8W))) {
409−
376+ u16 *p = host->pio_ptr;
377+ int s = host->pio_size;
410378 while (s >= 32 && (intr_status & MVSD_NOR_RX_FIFO_8W)) {
411379 readsw(iobase + MVSD_FIFO, p, 16);
412380 p += 16;
413381 s -= 32;
414− sgm->consumed += 32;
415382 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
416383 }
417384 /*
@@ -424,7 +391,6 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 6 unmodified lines
424391 put_unaligned(mvsd_read(MVSD_FIFO), p++);
425392 put_unaligned(mvsd_read(MVSD_FIFO), p++);
426393 s -= 4;
427− sgm->consumed += 4;
428394 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
429395 }
430396 if (s && s < 4 && (intr_status & MVSD_NOR_RX_READY)) {
@@ -432,13 +398,10 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 1 unmodified line
432398 val[0] = mvsd_read(MVSD_FIFO);
433399 val[1] = mvsd_read(MVSD_FIFO);
434400 memcpy(p, ((void *)&val) + 4 - s, s);
435− sgm->consumed += s;
436401 s = 0;
437402 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
438403 }
439− /* PIO transfer done */
440− host->pio_size -= sgm->consumed;
441− if (host->pio_size == 0) {
404+ if (s == 0) {
442405 host->intr_en &=
443406 ~(MVSD_NOR_RX_READY | MVSD_NOR_RX_FIFO_8W);
444407 mvsd_write(MVSD_NOR_INTR_EN, host->intr_en);
@@ -450,10 +413,14 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 5 unmodified lines
450413 }
451414 dev_dbg(host->dev, "pio %d intr 0x%04x hw_state 0x%04x\n",
452415 s, intr_status, mvsd_read(MVSD_HW_STATE));
416+ host->pio_ptr = p;
417+ host->pio_size = s;
453418 irq_handled = 1;
454− } else if (host->use_pio &&
419+ } else if (host->pio_size &&
455420 (intr_status & host->intr_en &
456421 (MVSD_NOR_TX_AVAIL | MVSD_NOR_TX_FIFO_8W))) {
422+ u16 *p = host->pio_ptr;
423+ int s = host->pio_size;
457424 /*
458425 * The TX_FIFO_8W bit is unreliable. When set, bursting
459426 * 16 halfwords all at once in the FIFO drops data. Actually
@@ -464,7 +431,6 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 4 unmodified lines
464431 mvsd_write(MVSD_FIFO, get_unaligned(p++));
465432 mvsd_write(MVSD_FIFO, get_unaligned(p++));
466433 s -= 4;
467− sgm->consumed += 4;
468434 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
469435 }
470436 if (s < 4) {
@@ -473,13 +439,10 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 2 unmodified lines
473439 memcpy(((void *)&val) + 4 - s, p, s);
474440 mvsd_write(MVSD_FIFO, val[0]);
475441 mvsd_write(MVSD_FIFO, val[1]);
476− sgm->consumed += s;
477442 s = 0;
478443 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
479444 }
480− /* PIO transfer done */
481− host->pio_size -= sgm->consumed;
482− if (host->pio_size == 0) {
445+ if (s == 0) {
483446 host->intr_en &=
484447 ~(MVSD_NOR_TX_AVAIL | MVSD_NOR_TX_FIFO_8W);
485448 mvsd_write(MVSD_NOR_INTR_EN, host->intr_en);
@@ -487,6 +450,8 @@ static irqreturn_t mvsd_irq(int irq, void *dev) · 1 unmodified line
487450 }
488451 dev_dbg(host->dev, "pio %d intr 0x%04x hw_state 0x%04x\n",
489452 s, intr_status, mvsd_read(MVSD_HW_STATE));
453+ host->pio_ptr = p;
454+ host->pio_size = s;
490455 irq_handled = 1;
491456 }
492457
drivers/mmc/host/sdhci-of-dwcmshc.c+8−0
@@ -852,6 +852,14 @@ static void th1520_sdhci_reset(struct sdhci_host *host, u8 mask) · 851 unmodified lines
852852
853853 sdhci_reset(host, mask);
854854
855+ /* The T-Head 1520 SoC does not comply with the SDHCI specification
856+ * regarding the "Software Reset for CMD line should clear 'Command
857+ * Complete' in the Normal Interrupt Status Register." Clear the bit
858+ * here to compensate for this quirk.
859+ */
860+ if (mask & SDHCI_RESET_CMD)
861+ sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
862+
855863 if (priv->flags & FLAG_IO_FIXED_1V8) {
856864 ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
857865 if (!(ctrl_2 & SDHCI_CTRL_VDD_180)) {
drivers/net/dsa/b53/b53_common.c+13−4
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <linux/phylink.h>
2828 #include <linux/etherdevice.h>
2929 #include <linux/if_bridge.h>
30+#include <linux/if_vlan.h>
3031 #include <net/dsa.h>
3132
3233 #include "b53_regs.h"
@@ -224,6 +225,9 @@ static const struct b53_mib_desc b53_mibs_58xx[] = { · 191 unmodified lines
224225
225226 #define B53_MIBS_58XX_SIZE ARRAY_SIZE(b53_mibs_58xx)
226227
228+#define B53_MAX_MTU_25 (1536 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN)
229+#define B53_MAX_MTU (9720 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN)
230+
227231 static int b53_do_vlan_op(struct b53_device *dev, u8 op)
228232 {
229233 unsigned int i;
@@ -2254,20 +2258,25 @@ static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu) · 2024 unmodified lines
22542258 bool allow_10_100;
22552259
22562260 if (is5325(dev) || is5365(dev))
2257− return -EOPNOTSUPP;
2261+ return 0;
22582262
22592263 if (!dsa_is_cpu_port(ds, port))
22602264 return 0;
22612265
2262− enable_jumbo = (mtu >= JMS_MIN_SIZE);
2263− allow_10_100 = (dev->chip_id == BCM583XX_DEVICE_ID);
2266+ enable_jumbo = (mtu > ETH_DATA_LEN);
2267+ allow_10_100 = !is63xx(dev);
22642268
22652269 return b53_set_jumbo(dev, enable_jumbo, allow_10_100);
22662270 }
22672271
22682272 static int b53_get_max_mtu(struct dsa_switch *ds, int port)
22692273 {
2270− return JMS_MAX_SIZE;
2274+ struct b53_device *dev = ds->priv;
2275+
2276+ if (is5325(dev) || is5365(dev))
2277+ return B53_MAX_MTU_25;
2278+
2279+ return B53_MAX_MTU;
22712280 }
22722281
22732282 static const struct phylink_mac_ops b53_phylink_mac_ops = {
drivers/net/dsa/lan9303-core.c+29−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <linux/module.h>
77 #include <linux/gpio/consumer.h>
88 #include <linux/regmap.h>
9+#include <linux/iopoll.h>
910 #include <linux/mutex.h>
1011 #include <linux/mii.h>
1112 #include <linux/of.h>
@@ -839,6 +840,8 @@ static void lan9303_handle_reset(struct lan9303 *chip) · 827 unmodified lines
839840 if (!chip->reset_gpio)
840841 return;
841842
843+ gpiod_set_value_cansleep(chip->reset_gpio, 1);
844+
842845 if (chip->reset_duration != 0)
843846 msleep(chip->reset_duration);
844847
@@ -864,8 +867,34 @@ static int lan9303_disable_processing(struct lan9303 *chip) · 19 unmodified lines
864867 static int lan9303_check_device(struct lan9303 *chip)
865868 {
866869 int ret;
870+ int err;
867871 u32 reg;
868872
873+ /* In I2C-managed configurations this polling loop will clash with
874+ * switch's reading of EEPROM right after reset and this behaviour is
875+ * not configurable. While lan9303_read() already has quite long retry
876+ * timeout, seems not all cases are being detected as arbitration error.
877+ *
878+ * According to datasheet, EEPROM loader has 30ms timeout (in case of
879+ * missing EEPROM).
880+ *
881+ * Loading of the largest supported EEPROM is expected to take at least
882+ * 5.9s.
883+ */
884+ err = read_poll_timeout(lan9303_read, ret,
885+ !ret && reg & LAN9303_HW_CFG_READY,
886+ 20000, 6000000, false,
887+ chip->regmap, LAN9303_HW_CFG, &reg);
888+ if (ret) {
889+ dev_err(chip->dev, "failed to read HW_CFG reg: %pe\n",
890+ ERR_PTR(ret));
891+ return ret;
892+ }
893+ if (err) {
894+ dev_err(chip->dev, "HW_CFG not ready: 0x%08x\n", reg);
895+ return err;
896+ }
897+
869898 ret = lan9303_read(chip->regmap, LAN9303_CHIP_REV, &reg);
870899 if (ret) {
871900 dev_err(chip->dev, "failed to read chip revision register: %d\n",
drivers/net/dsa/microchip/ksz_common.c+11−10
@@ -2733,26 +2733,27 @@ static u32 ksz_get_phy_flags(struct dsa_switch *ds, int port) · 2732 unmodified lines
27332733 return MICREL_KSZ8_P1_ERRATA;
27342734 break;
27352735 case KSZ8567_CHIP_ID:
2736+ /* KSZ8567R Errata DS80000752C Module 4 */
2737+ case KSZ8765_CHIP_ID:
2738+ case KSZ8794_CHIP_ID:
2739+ case KSZ8795_CHIP_ID:
2740+ /* KSZ879x/KSZ877x/KSZ876x Errata DS80000687C Module 2 */
27362741 case KSZ9477_CHIP_ID:
2742+ /* KSZ9477S Errata DS80000754A Module 4 */
27372743 case KSZ9567_CHIP_ID:
2744+ /* KSZ9567S Errata DS80000756A Module 4 */
27382745 case KSZ9896_CHIP_ID:
2746+ /* KSZ9896C Errata DS80000757A Module 3 */
27392747 case KSZ9897_CHIP_ID:
2740− /* KSZ9477 Errata DS80000754C
2741− *
2742− * Module 4: Energy Efficient Ethernet (EEE) feature select must
2743− * be manually disabled
2748+ /* KSZ9897R Errata DS80000758C Module 4 */
2749+ /* Energy Efficient Ethernet (EEE) feature select must be manually disabled
27442750 * The EEE feature is enabled by default, but it is not fully
27452751 * operational. It must be manually disabled through register
27462752 * controls. If not disabled, the PHY ports can auto-negotiate
27472753 * to enable EEE, and this feature can cause link drops when
27482754 * linked to another device supporting EEE.
27492755 *
2750− * The same item appears in the errata for the KSZ9567, KSZ9896,
2751− * and KSZ9897.
2752− *
2753− * A similar item appears in the errata for the KSZ8567, but
2754− * provides an alternative workaround. For now, use the simple
2755− * workaround of disabling the EEE feature for this device too.
2756+ * The same item appears in the errata for all switches above.
27562757 */
27572758 return MICREL_NO_EEE;
27582759 }
drivers/net/dsa/mv88e6xxx/chip.c+1−1
@@ -6347,7 +6347,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { · 6346 unmodified lines
63476347 .invalid_port_mask = BIT(1) | BIT(2) | BIT(8),
63486348 .num_internal_phys = 5,
63496349 .internal_phys_offset = 3,
6350− .max_vid = 4095,
6350+ .max_vid = 8191,
63516351 .max_sid = 63,
63526352 .port_base_addr = 0x0,
63536353 .phy_base_addr = 0x0,
drivers/net/dsa/mv88e6xxx/chip.h+2−4
@@ -206,6 +206,7 @@ struct mv88e6xxx_gpio_ops; · 205 unmodified lines
206206 struct mv88e6xxx_avb_ops;
207207 struct mv88e6xxx_ptp_ops;
208208 struct mv88e6xxx_pcs_ops;
209+struct mv88e6xxx_cc_coeffs;
209210
210211 struct mv88e6xxx_irq {
211212 u16 masked;
@@ -408,6 +409,7 @@ struct mv88e6xxx_chip { · 196 unmodified lines
408409 struct cyclecounter tstamp_cc;
409410 struct timecounter tstamp_tc;
410411 struct delayed_work overflow_work;
412+ const struct mv88e6xxx_cc_coeffs *cc_coeffs;
411413
412414 struct ptp_clock *ptp_clock;
413415 struct ptp_clock_info ptp_clock_info;
@@ -731,10 +733,6 @@ struct mv88e6xxx_ptp_ops { · 317 unmodified lines
731733 int arr1_sts_reg;
732734 int dep_sts_reg;
733735 u32 rx_filters;
734− u32 cc_shift;
735− u32 cc_mult;
736− u32 cc_mult_num;
737− u32 cc_mult_dem;
738736 };
739737
740738 struct mv88e6xxx_pcs_ops {
drivers/net/dsa/mv88e6xxx/port.c+1−0
@@ -1713,6 +1713,7 @@ int mv88e6393x_port_set_policy(struct mv88e6xxx_chip *chip, int port, · 1712 unmodified lines
17131713 ptr = shift / 8;
17141714 shift %= 8;
17151715 mask >>= ptr * 8;
1716+ ptr <<= 8;
17161717
17171718 err = mv88e6393x_port_policy_read(chip, port, ptr, &reg);
17181719 if (err)
drivers/net/dsa/mv88e6xxx/ptp.c+75−33
@@ -18,6 +18,13 @@ · 17 unmodified lines
1818
1919 #define MV88E6XXX_MAX_ADJ_PPB 1000000
2020
21+struct mv88e6xxx_cc_coeffs {
22+ u32 cc_shift;
23+ u32 cc_mult;
24+ u32 cc_mult_num;
25+ u32 cc_mult_dem;
26+};
27+
2128 /* Family MV88E6250:
2229 * Raw timestamps are in units of 10-ns clock periods.
2330 *
@@ -25,22 +32,43 @@ · 1 unmodified line
2532 * simplifies to
2633 * clkadj = scaled_ppm * 2^7 / 5^5
2734 */
28−#define MV88E6250_CC_SHIFT 28
29−#define MV88E6250_CC_MULT (10 << MV88E6250_CC_SHIFT)
30−#define MV88E6250_CC_MULT_NUM (1 << 7)
31−#define MV88E6250_CC_MULT_DEM 3125ULL
35+#define MV88E6XXX_CC_10NS_SHIFT 28
36+static const struct mv88e6xxx_cc_coeffs mv88e6xxx_cc_10ns_coeffs = {
37+ .cc_shift = MV88E6XXX_CC_10NS_SHIFT,
38+ .cc_mult = 10 << MV88E6XXX_CC_10NS_SHIFT,
39+ .cc_mult_num = 1 << 7,
40+ .cc_mult_dem = 3125ULL,
41+};
3242
33−/* Other families:
43+/* Other families except MV88E6393X in internal clock mode:
3444 * Raw timestamps are in units of 8-ns clock periods.
3545 *
3646 * clkadj = scaled_ppm * 8*2^28 / (10^6 * 2^16)
3747 * simplifies to
3848 * clkadj = scaled_ppm * 2^9 / 5^6
3949 */
40−#define MV88E6XXX_CC_SHIFT 28
41−#define MV88E6XXX_CC_MULT (8 << MV88E6XXX_CC_SHIFT)
42−#define MV88E6XXX_CC_MULT_NUM (1 << 9)
43−#define MV88E6XXX_CC_MULT_DEM 15625ULL
50+#define MV88E6XXX_CC_8NS_SHIFT 28
51+static const struct mv88e6xxx_cc_coeffs mv88e6xxx_cc_8ns_coeffs = {
52+ .cc_shift = MV88E6XXX_CC_8NS_SHIFT,
53+ .cc_mult = 8 << MV88E6XXX_CC_8NS_SHIFT,
54+ .cc_mult_num = 1 << 9,
55+ .cc_mult_dem = 15625ULL
56+};
57+
58+/* Family MV88E6393X using internal clock:
59+ * Raw timestamps are in units of 4-ns clock periods.
60+ *
61+ * clkadj = scaled_ppm * 4*2^28 / (10^6 * 2^16)
62+ * simplifies to
63+ * clkadj = scaled_ppm * 2^8 / 5^6
64+ */
65+#define MV88E6XXX_CC_4NS_SHIFT 28
66+static const struct mv88e6xxx_cc_coeffs mv88e6xxx_cc_4ns_coeffs = {
67+ .cc_shift = MV88E6XXX_CC_4NS_SHIFT,
68+ .cc_mult = 4 << MV88E6XXX_CC_4NS_SHIFT,
69+ .cc_mult_num = 1 << 8,
70+ .cc_mult_dem = 15625ULL
71+};
4472
4573 #define TAI_EVENT_WORK_INTERVAL msecs_to_jiffies(100)
4674
@@ -83,6 +111,33 @@ static int mv88e6352_set_gpio_func(struct mv88e6xxx_chip *chip, int pin, · 36 unmodified lines
83111 return chip->info->ops->gpio_ops->set_pctl(chip, pin, func);
84112 }
85113
114+static const struct mv88e6xxx_cc_coeffs *
115+mv88e6xxx_cc_coeff_get(struct mv88e6xxx_chip *chip)
116+{
117+ u16 period_ps;
118+ int err;
119+
120+ err = mv88e6xxx_tai_read(chip, MV88E6XXX_TAI_CLOCK_PERIOD, &period_ps, 1);
121+ if (err) {
122+ dev_err(chip->dev, "failed to read cycle counter period: %d\n",
123+ err);
124+ return ERR_PTR(err);
125+ }
126+
127+ switch (period_ps) {
128+ case 4000:
129+ return &mv88e6xxx_cc_4ns_coeffs;
130+ case 8000:
131+ return &mv88e6xxx_cc_8ns_coeffs;
132+ case 10000:
133+ return &mv88e6xxx_cc_10ns_coeffs;
134+ default:
135+ dev_err(chip->dev, "unexpected cycle counter period of %u ps\n",
136+ period_ps);
137+ return ERR_PTR(-ENODEV);
138+ }
139+}
140+
86141 static u64 mv88e6352_ptp_clock_read(const struct cyclecounter *cc)
87142 {
88143 struct mv88e6xxx_chip *chip = cc_to_chip(cc);
@@ -204,7 +259,6 @@ out: · 115 unmodified lines
204259 static int mv88e6xxx_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
205260 {
206261 struct mv88e6xxx_chip *chip = ptp_to_chip(ptp);
207− const struct mv88e6xxx_ptp_ops *ptp_ops = chip->info->ops->ptp_ops;
208262 int neg_adj = 0;
209263 u32 diff, mult;
210264 u64 adj;
@@ -214,10 +268,10 @@ static int mv88e6xxx_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) · 3 unmodified lines
214268 scaled_ppm = -scaled_ppm;
215269 }
216270
217− mult = ptp_ops->cc_mult;
218− adj = ptp_ops->cc_mult_num;
271+ mult = chip->cc_coeffs->cc_mult;
272+ adj = chip->cc_coeffs->cc_mult_num;
219273 adj *= scaled_ppm;
220− diff = div_u64(adj, ptp_ops->cc_mult_dem);
274+ diff = div_u64(adj, chip->cc_coeffs->cc_mult_dem);
221275
222276 mv88e6xxx_reg_lock(chip);
223277
@@ -364,10 +418,6 @@ const struct mv88e6xxx_ptp_ops mv88e6165_ptp_ops = { · 140 unmodified lines
364418 (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) |
365419 (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) |
366420 (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ),
367− .cc_shift = MV88E6XXX_CC_SHIFT,
368− .cc_mult = MV88E6XXX_CC_MULT,
369− .cc_mult_num = MV88E6XXX_CC_MULT_NUM,
370− .cc_mult_dem = MV88E6XXX_CC_MULT_DEM,
371421 };
372422
373423 const struct mv88e6xxx_ptp_ops mv88e6250_ptp_ops = {
@@ -391,10 +441,6 @@ const struct mv88e6xxx_ptp_ops mv88e6250_ptp_ops = { · 17 unmodified lines
391441 (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) |
392442 (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) |
393443 (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ),
394− .cc_shift = MV88E6250_CC_SHIFT,
395− .cc_mult = MV88E6250_CC_MULT,
396− .cc_mult_num = MV88E6250_CC_MULT_NUM,
397− .cc_mult_dem = MV88E6250_CC_MULT_DEM,
398444 };
399445
400446 const struct mv88e6xxx_ptp_ops mv88e6352_ptp_ops = {
@@ -418,10 +464,6 @@ const struct mv88e6xxx_ptp_ops mv88e6352_ptp_ops = { · 17 unmodified lines
418464 (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) |
419465 (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) |
420466 (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ),
421− .cc_shift = MV88E6XXX_CC_SHIFT,
422− .cc_mult = MV88E6XXX_CC_MULT,
423− .cc_mult_num = MV88E6XXX_CC_MULT_NUM,
424− .cc_mult_dem = MV88E6XXX_CC_MULT_DEM,
425467 };
426468
427469 const struct mv88e6xxx_ptp_ops mv88e6390_ptp_ops = {
@@ -446,10 +488,6 @@ const struct mv88e6xxx_ptp_ops mv88e6390_ptp_ops = { · 18 unmodified lines
446488 (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) |
447489 (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) |
448490 (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ),
449− .cc_shift = MV88E6XXX_CC_SHIFT,
450− .cc_mult = MV88E6XXX_CC_MULT,
451− .cc_mult_num = MV88E6XXX_CC_MULT_NUM,
452− .cc_mult_dem = MV88E6XXX_CC_MULT_DEM,
453491 };
454492
455493 static u64 mv88e6xxx_ptp_clock_read(const struct cyclecounter *cc)
@@ -462,10 +500,10 @@ static u64 mv88e6xxx_ptp_clock_read(const struct cyclecounter *cc) · 6 unmodified lines
462500 return 0;
463501 }
464502
465−/* With a 125MHz input clock, the 32-bit timestamp counter overflows in ~34.3
503+/* With a 250MHz input clock, the 32-bit timestamp counter overflows in ~17.2
466504 * seconds; this task forces periodic reads so that we don't miss any.
467505 */
468−#define MV88E6XXX_TAI_OVERFLOW_PERIOD (HZ * 16)
506+#define MV88E6XXX_TAI_OVERFLOW_PERIOD (HZ * 8)
469507 static void mv88e6xxx_ptp_overflow_check(struct work_struct *work)
470508 {
471509 struct delayed_work *dw = to_delayed_work(work);
@@ -484,11 +522,15 @@ int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip) · 12 unmodified lines
484522 int i;
485523
486524 /* Set up the cycle counter */
525+ chip->cc_coeffs = mv88e6xxx_cc_coeff_get(chip);
526+ if (IS_ERR(chip->cc_coeffs))
527+ return PTR_ERR(chip->cc_coeffs);
528+
487529 memset(&chip->tstamp_cc, 0, sizeof(chip->tstamp_cc));
488530 chip->tstamp_cc.read = mv88e6xxx_ptp_clock_read;
489531 chip->tstamp_cc.mask = CYCLECOUNTER_MASK(32);
490− chip->tstamp_cc.mult = ptp_ops->cc_mult;
491− chip->tstamp_cc.shift = ptp_ops->cc_shift;
532+ chip->tstamp_cc.mult = chip->cc_coeffs->cc_mult;
533+ chip->tstamp_cc.shift = chip->cc_coeffs->cc_shift;
492534
493535 timecounter_init(&chip->tstamp_tc, &chip->tstamp_cc,
494536 ktime_to_ns(ktime_get_real()));
drivers/net/dsa/sja1105/sja1105_main.c+0−1
@@ -3158,7 +3158,6 @@ static int sja1105_setup(struct dsa_switch *ds) · 3157 unmodified lines
31583158 * TPID is ETH_P_SJA1105, and the VLAN ID is the port pvid.
31593159 */
31603160 ds->vlan_filtering_is_global = true;
3161− ds->untag_bridge_pvid = true;
31623161 ds->fdb_isolation = true;
31633162 ds->max_num_bridges = DSA_TAG_8021Q_MAX_NUM_BRIDGES;
31643163
drivers/net/dsa/vitesse-vsc73xx-core.c+0−1
@@ -851,7 +851,6 @@ static int vsc73xx_setup(struct dsa_switch *ds) · 850 unmodified lines
851851
852852 dev_info(vsc->dev, "set up the switch\n");
853853
854− ds->untag_bridge_pvid = true;
855854 ds->max_num_bridges = DSA_TAG_8021Q_MAX_NUM_BRIDGES;
856855 ds->fdb_isolation = true;
857856
drivers/net/ethernet/adi/adin1110.c+2−2
@@ -318,11 +318,11 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv) · 317 unmodified lines
318318 * from the ADIN1110 frame header.
319319 */
320320 if (frame_size < ADIN1110_FRAME_HEADER_LEN + ADIN1110_FEC_LEN)
321− return ret;
321+ return -EINVAL;
322322
323323 round_len = adin1110_round_len(frame_size);
324324 if (round_len < 0)
325− return ret;
325+ return -EINVAL;
326326
327327 frame_size_no_fcs = frame_size - ADIN1110_FRAME_HEADER_LEN - ADIN1110_FEC_LEN;
328328 memset(priv->data, 0, ADIN1110_RD_HEADER_LEN);
drivers/net/ethernet/aeroflex/greth.c+2−1
@@ -484,7 +484,7 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev) · 483 unmodified lines
484484
485485 if (unlikely(skb->len > MAX_FRAME_SIZE)) {
486486 dev->stats.tx_errors++;
487− goto out;
487+ goto len_error;
488488 }
489489
490490 /* Save skb pointer. */
@@ -575,6 +575,7 @@ frag_map_error: · 84 unmodified lines
575575 map_error:
576576 if (net_ratelimit())
577577 dev_warn(greth->dev, "Could not create TX DMA mapping\n");
578+len_error:
578579 dev_kfree_skb(skb);
579580 out:
580581 return err;
drivers/net/ethernet/amd/mvme147.c+3−4
@@ -105,10 +105,6 @@ static struct net_device * __init mvme147lance_probe(void) · 104 unmodified lines
105105 macaddr[3] = address&0xff;
106106 eth_hw_addr_set(dev, macaddr);
107107
108− printk("%s: MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n",
109− dev->name, dev->base_addr, MVME147_LANCE_IRQ,
110− dev->dev_addr);
111−
112108 lp = netdev_priv(dev);
113109 lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 32K */
114110 if (!lp->ram) {
@@ -138,6 +134,9 @@ static struct net_device * __init mvme147lance_probe(void) · 23 unmodified lines
138134 return ERR_PTR(err);
139135 }
140136
137+ netdev_info(dev, "MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n",
138+ dev->base_addr, MVME147_LANCE_IRQ, dev->dev_addr);
139+
141140 return dev;
142141 }
143142
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c+1−0
@@ -322,6 +322,7 @@ static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev) · 321 unmodified lines
322322 }
323323 /* Rewind so we do not have a hole */
324324 spb_index = intf->tx_spb_index;
325+ dev_kfree_skb(skb);
325326 return NETDEV_TX_OK;
326327 }
327328
drivers/net/ethernet/broadcom/bcmsysport.c+1−0
@@ -1359,6 +1359,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, · 1358 unmodified lines
13591359 netif_err(priv, tx_err, dev, "DMA map failed at %p (len=%d)\n",
13601360 skb->data, skb_len);
13611361 ret = NETDEV_TX_OK;
1362+ dev_kfree_skb_any(skb);
13621363 goto out;
13631364 }
13641365
drivers/net/ethernet/broadcom/bnxt/bnxt.c+14−8
@@ -2254,10 +2254,11 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, · 2253 unmodified lines
22542254
22552255 if (!bnxt_get_rx_ts_p5(bp, &ts, cmpl_ts)) {
22562256 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
2257+ unsigned long flags;
22572258
2258− spin_lock_bh(&ptp->ptp_lock);
2259+ spin_lock_irqsave(&ptp->ptp_lock, flags);
22592260 ns = timecounter_cyc2time(&ptp->tc, ts);
2260− spin_unlock_bh(&ptp->ptp_lock);
2261+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
22612262 memset(skb_hwtstamps(skb), 0,
22622263 sizeof(*skb_hwtstamps(skb)));
22632264 skb_hwtstamps(skb)->hwtstamp = ns_to_ktime(ns);
@@ -2757,17 +2758,18 @@ static int bnxt_async_event_process(struct bnxt *bp, · 493 unmodified lines
27572758 case ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE:
27582759 if (BNXT_PTP_USE_RTC(bp)) {
27592760 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
2761+ unsigned long flags;
27602762 u64 ns;
27612763
27622764 if (!ptp)
27632765 goto async_event_process_exit;
27642766
2765− spin_lock_bh(&ptp->ptp_lock);
2767+ spin_lock_irqsave(&ptp->ptp_lock, flags);
27662768 bnxt_ptp_update_current_time(bp);
27672769 ns = (((u64)BNXT_EVENT_PHC_RTC_UPDATE(data1) <<
27682770 BNXT_PHC_BITS) | ptp->current_time);
27692771 bnxt_ptp_rtc_timecounter_init(ptp, ns);
2770− spin_unlock_bh(&ptp->ptp_lock);
2772+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
27712773 }
27722774 break;
27732775 }
@@ -13494,9 +13496,11 @@ static void bnxt_force_fw_reset(struct bnxt *bp) · 10720 unmodified lines
1349413496 return;
1349513497
1349613498 if (ptp) {
13497− spin_lock_bh(&ptp->ptp_lock);
13499+ unsigned long flags;
13500+
13501+ spin_lock_irqsave(&ptp->ptp_lock, flags);
1349813502 set_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
13499− spin_unlock_bh(&ptp->ptp_lock);
13503+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
1350013504 } else {
1350113505 set_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1350213506 }
@@ -13561,9 +13565,11 @@ void bnxt_fw_reset(struct bnxt *bp) · 58 unmodified lines
1356113565 int n = 0, tmo;
1356213566
1356313567 if (ptp) {
13564− spin_lock_bh(&ptp->ptp_lock);
13568+ unsigned long flags;
13569+
13570+ spin_lock_irqsave(&ptp->ptp_lock, flags);
1356513571 set_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
13566− spin_unlock_bh(&ptp->ptp_lock);
13572+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
1356713573 } else {
1356813574 set_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1356913575 }
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c+42−28
@@ -62,13 +62,14 @@ static int bnxt_ptp_settime(struct ptp_clock_info *ptp_info, · 61 unmodified lines
6262 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg,
6363 ptp_info);
6464 u64 ns = timespec64_to_ns(ts);
65+ unsigned long flags;
6566
6667 if (BNXT_PTP_USE_RTC(ptp->bp))
6768 return bnxt_ptp_cfg_settime(ptp->bp, ns);
6869
69− spin_lock_bh(&ptp->ptp_lock);
70+ spin_lock_irqsave(&ptp->ptp_lock, flags);
7071 timecounter_init(&ptp->tc, &ptp->cc, ns);
71− spin_unlock_bh(&ptp->ptp_lock);
72+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
7273 return 0;
7374 }
7475
@@ -100,13 +101,14 @@ static int bnxt_refclk_read(struct bnxt *bp, struct ptp_system_timestamp *sts, · 25 unmodified lines
100101 static void bnxt_ptp_get_current_time(struct bnxt *bp)
101102 {
102103 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
104+ unsigned long flags;
103105
104106 if (!ptp)
105107 return;
106− spin_lock_bh(&ptp->ptp_lock);
108+ spin_lock_irqsave(&ptp->ptp_lock, flags);
107109 WRITE_ONCE(ptp->old_time, ptp->current_time);
108110 bnxt_refclk_read(bp, NULL, &ptp->current_time);
109− spin_unlock_bh(&ptp->ptp_lock);
111+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
110112 }
111113
112114 static int bnxt_hwrm_port_ts_query(struct bnxt *bp, u32 flags, u64 *ts,
@@ -149,17 +151,18 @@ static int bnxt_ptp_gettimex(struct ptp_clock_info *ptp_info, · 36 unmodified lines
149151 {
150152 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg,
151153 ptp_info);
154+ unsigned long flags;
152155 u64 ns, cycles;
153156 int rc;
154157
155− spin_lock_bh(&ptp->ptp_lock);
158+ spin_lock_irqsave(&ptp->ptp_lock, flags);
156159 rc = bnxt_refclk_read(ptp->bp, sts, &cycles);
157160 if (rc) {
158− spin_unlock_bh(&ptp->ptp_lock);
161+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
159162 return rc;
160163 }
161164 ns = timecounter_cyc2time(&ptp->tc, cycles);
162− spin_unlock_bh(&ptp->ptp_lock);
165+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
163166 *ts = ns_to_timespec64(ns);
164167
165168 return 0;
@@ -177,6 +180,7 @@ void bnxt_ptp_update_current_time(struct bnxt *bp) · 11 unmodified lines
177180 static int bnxt_ptp_adjphc(struct bnxt_ptp_cfg *ptp, s64 delta)
178181 {
179182 struct hwrm_port_mac_cfg_input *req;
183+ unsigned long flags;
180184 int rc;
181185
182186 rc = hwrm_req_init(ptp->bp, req, HWRM_PORT_MAC_CFG);
@@ -190,9 +194,9 @@ static int bnxt_ptp_adjphc(struct bnxt_ptp_cfg *ptp, s64 delta) · 7 unmodified lines
190194 if (rc) {
191195 netdev_err(ptp->bp->dev, "ptp adjphc failed. rc = %x\n", rc);
192196 } else {
193− spin_lock_bh(&ptp->ptp_lock);
197+ spin_lock_irqsave(&ptp->ptp_lock, flags);
194198 bnxt_ptp_update_current_time(ptp->bp);
195− spin_unlock_bh(&ptp->ptp_lock);
199+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
196200 }
197201
198202 return rc;
@@ -202,13 +206,14 @@ static int bnxt_ptp_adjtime(struct ptp_clock_info *ptp_info, s64 delta) · 3 unmodified lines
202206 {
203207 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg,
204208 ptp_info);
209+ unsigned long flags;
205210
206211 if (BNXT_PTP_USE_RTC(ptp->bp))
207212 return bnxt_ptp_adjphc(ptp, delta);
208213
209− spin_lock_bh(&ptp->ptp_lock);
214+ spin_lock_irqsave(&ptp->ptp_lock, flags);
210215 timecounter_adjtime(&ptp->tc, delta);
211− spin_unlock_bh(&ptp->ptp_lock);
216+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
212217 return 0;
213218 }
214219
@@ -236,14 +241,15 @@ static int bnxt_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm) · 21 unmodified lines
236241 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg,
237242 ptp_info);
238243 struct bnxt *bp = ptp->bp;
244+ unsigned long flags;
239245
240246 if (!BNXT_MH(bp))
241247 return bnxt_ptp_adjfine_rtc(bp, scaled_ppm);
242248
243− spin_lock_bh(&ptp->ptp_lock);
249+ spin_lock_irqsave(&ptp->ptp_lock, flags);
244250 timecounter_read(&ptp->tc);
245251 ptp->cc.mult = adjust_by_scaled_ppm(ptp->cmult, scaled_ppm);
246− spin_unlock_bh(&ptp->ptp_lock);
252+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
247253 return 0;
248254 }
249255
@@ -251,12 +257,13 @@ void bnxt_ptp_pps_event(struct bnxt *bp, u32 data1, u32 data2) · 1 unmodified line
251257 {
252258 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
253259 struct ptp_clock_event event;
260+ unsigned long flags;
254261 u64 ns, pps_ts;
255262
256263 pps_ts = EVENT_PPS_TS(data2, data1);
257− spin_lock_bh(&ptp->ptp_lock);
264+ spin_lock_irqsave(&ptp->ptp_lock, flags);
258265 ns = timecounter_cyc2time(&ptp->tc, pps_ts);
259− spin_unlock_bh(&ptp->ptp_lock);
266+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
260267
261268 switch (EVENT_DATA2_PPS_EVENT_TYPE(data2)) {
262269 case ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_INTERNAL:
@@ -393,16 +400,17 @@ static int bnxt_get_target_cycles(struct bnxt_ptp_cfg *ptp, u64 target_ns, · 130 unmodified lines
393400 {
394401 u64 cycles_now;
395402 u64 nsec_now, nsec_delta;
403+ unsigned long flags;
396404 int rc;
397405
398− spin_lock_bh(&ptp->ptp_lock);
406+ spin_lock_irqsave(&ptp->ptp_lock, flags);
399407 rc = bnxt_refclk_read(ptp->bp, NULL, &cycles_now);
400408 if (rc) {
401− spin_unlock_bh(&ptp->ptp_lock);
409+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
402410 return rc;
403411 }
404412 nsec_now = timecounter_cyc2time(&ptp->tc, cycles_now);
405− spin_unlock_bh(&ptp->ptp_lock);
413+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
406414
407415 nsec_delta = target_ns - nsec_now;
408416 *cycles_delta = div64_u64(nsec_delta << ptp->cc.shift, ptp->cc.mult);
@@ -689,6 +697,7 @@ static int bnxt_stamp_tx_skb(struct bnxt *bp, int slot) · 280 unmodified lines
689697 struct skb_shared_hwtstamps timestamp;
690698 struct bnxt_ptp_tx_req *txts_req;
691699 unsigned long now = jiffies;
700+ unsigned long flags;
692701 u64 ts = 0, ns = 0;
693702 u32 tmo = 0;
694703 int rc;
@@ -702,9 +711,9 @@ static int bnxt_stamp_tx_skb(struct bnxt *bp, int slot) · 7 unmodified lines
702711 tmo, slot);
703712 if (!rc) {
704713 memset(&timestamp, 0, sizeof(timestamp));
705− spin_lock_bh(&ptp->ptp_lock);
714+ spin_lock_irqsave(&ptp->ptp_lock, flags);
706715 ns = timecounter_cyc2time(&ptp->tc, ts);
707− spin_unlock_bh(&ptp->ptp_lock);
716+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
708717 timestamp.hwtstamp = ns_to_ktime(ns);
709718 skb_tstamp_tx(txts_req->tx_skb, &timestamp);
710719 ptp->stats.ts_pkts++;
@@ -730,6 +739,7 @@ static long bnxt_ptp_ts_aux_work(struct ptp_clock_info *ptp_info) · 19 unmodified lines
730739 unsigned long now = jiffies;
731740 struct bnxt *bp = ptp->bp;
732741 u16 cons = ptp->txts_cons;
742+ unsigned long flags;
733743 u32 num_requests;
734744 int rc = 0;
735745
@@ -757,9 +767,9 @@ next_slot: · 21 unmodified lines
757767 bnxt_ptp_get_current_time(bp);
758768 ptp->next_period = now + HZ;
759769 if (time_after_eq(now, ptp->next_overflow_check)) {
760− spin_lock_bh(&ptp->ptp_lock);
770+ spin_lock_irqsave(&ptp->ptp_lock, flags);
761771 timecounter_read(&ptp->tc);
762− spin_unlock_bh(&ptp->ptp_lock);
772+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
763773 ptp->next_overflow_check = now + BNXT_PHC_OVERFLOW_PERIOD;
764774 }
765775 if (rc == -EAGAIN)
@@ -819,6 +829,7 @@ void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi, · 53 unmodified lines
819829 u32 opaque = tscmp->tx_ts_cmp_opaque;
820830 struct bnxt_tx_ring_info *txr;
821831 struct bnxt_sw_tx_bd *tx_buf;
832+ unsigned long flags;
822833 u64 ts, ns;
823834 u16 cons;
824835
@@ -833,9 +844,9 @@ void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi, · 8 unmodified lines
833844 le32_to_cpu(tscmp->tx_ts_cmp_flags_type),
834845 le32_to_cpu(tscmp->tx_ts_cmp_errors_v));
835846 } else {
836− spin_lock_bh(&ptp->ptp_lock);
847+ spin_lock_irqsave(&ptp->ptp_lock, flags);
837848 ns = timecounter_cyc2time(&ptp->tc, ts);
838− spin_unlock_bh(&ptp->ptp_lock);
849+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
839850 timestamp.hwtstamp = ns_to_ktime(ns);
840851 skb_tstamp_tx(tx_buf->skb, &timestamp);
841852 }
@@ -975,6 +986,7 @@ void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns) · 133 unmodified lines
975986 int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg)
976987 {
977988 struct timespec64 tsp;
989+ unsigned long flags;
978990 u64 ns;
979991 int rc;
980992
@@ -993,9 +1005,9 @@ int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg) · 12 unmodified lines
9931005 if (rc)
9941006 return rc;
9951007 }
996− spin_lock_bh(&bp->ptp_cfg->ptp_lock);
1008+ spin_lock_irqsave(&bp->ptp_cfg->ptp_lock, flags);
9971009 bnxt_ptp_rtc_timecounter_init(bp->ptp_cfg, ns);
998− spin_unlock_bh(&bp->ptp_cfg->ptp_lock);
1010+ spin_unlock_irqrestore(&bp->ptp_cfg->ptp_lock, flags);
9991011
10001012 return 0;
10011013 }
@@ -1063,10 +1075,12 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg) · 61 unmodified lines
10631075 atomic64_set(&ptp->stats.ts_err, 0);
10641076
10651077 if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
1066− spin_lock_bh(&ptp->ptp_lock);
1078+ unsigned long flags;
1079+
1080+ spin_lock_irqsave(&ptp->ptp_lock, flags);
10671081 bnxt_refclk_read(bp, NULL, &ptp->current_time);
10681082 WRITE_ONCE(ptp->old_time, ptp->current_time);
1069− spin_unlock_bh(&ptp->ptp_lock);
1083+ spin_unlock_irqrestore(&ptp->ptp_lock, flags);
10701084 ptp_schedule_worker(ptp->ptp_clock, 0);
10711085 }
10721086 ptp->txts_tmo = BNXT_PTP_DFLT_TX_TMO;
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h+7−5
@@ -146,11 +146,13 @@ struct bnxt_ptp_cfg { · 145 unmodified lines
146146 };
147147
148148 #if BITS_PER_LONG == 32
149−#define BNXT_READ_TIME64(ptp, dst, src) \
150−do { \
151− spin_lock_bh(&(ptp)->ptp_lock); \
152− (dst) = (src); \
153− spin_unlock_bh(&(ptp)->ptp_lock); \
149+#define BNXT_READ_TIME64(ptp, dst, src) \
150+do { \
151+ unsigned long flags; \
152+ \
153+ spin_lock_irqsave(&(ptp)->ptp_lock, flags); \
154+ (dst) = (src); \
155+ spin_unlock_irqrestore(&(ptp)->ptp_lock, flags); \
154156 } while (0)
155157 #else
156158 #define BNXT_READ_TIME64(ptp, dst, src) \
drivers/net/ethernet/cadence/macb_main.c+11−3
@@ -930,9 +930,6 @@ static int macb_mdiobus_register(struct macb *bp) · 929 unmodified lines
930930 return ret;
931931 }
932932
933− if (of_phy_is_fixed_link(np))
934− return mdiobus_register(bp->mii_bus);
935−
936933 /* Only create the PHY from the device tree if at least one PHY is
937934 * described. Otherwise scan the entire MDIO bus. We do this to support
938935 * old device tree that did not follow the best practices and did not
@@ -953,8 +950,19 @@ static int macb_mdiobus_register(struct macb *bp) · 14 unmodified lines
953950
954951 static int macb_mii_init(struct macb *bp)
955952 {
953+ struct device_node *child, *np = bp->pdev->dev.of_node;
956954 int err = -ENXIO;
957955
956+ /* With fixed-link, we don't need to register the MDIO bus,
957+ * except if we have a child named "mdio" in the device tree.
958+ * In that case, some devices may be attached to the MACB's MDIO bus.
959+ */
960+ child = of_get_child_by_name(np, "mdio");
961+ if (child)
962+ of_node_put(child);
963+ else if (of_phy_is_fixed_link(np))
964+ return macb_mii_probe(bp->dev);
965+
958966 /* Enable management port */
959967 macb_writel(bp, NCR, MACB_BIT(MPE));
960968
drivers/net/ethernet/emulex/benet/be_main.c+5−5
@@ -1381,10 +1381,8 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev) · 1380 unmodified lines
13811381 be_get_wrb_params_from_skb(adapter, skb, &wrb_params);
13821382
13831383 wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
1384− if (unlikely(!wrb_cnt)) {
1385− dev_kfree_skb_any(skb);
1386− goto drop;
1387− }
1384+ if (unlikely(!wrb_cnt))
1385+ goto drop_skb;
13881386
13891387 /* if os2bmc is enabled and if the pkt is destined to bmc,
13901388 * enqueue the pkt a 2nd time with mgmt bit set.
@@ -1393,7 +1391,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev) · 2 unmodified lines
13931391 BE_WRB_F_SET(wrb_params.features, OS2BMC, 1);
13941392 wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
13951393 if (unlikely(!wrb_cnt))
1396− goto drop;
1394+ goto drop_skb;
13971395 else
13981396 skb_get(skb);
13991397 }
@@ -1407,6 +1405,8 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev) · 7 unmodified lines
14071405 be_xmit_flush(adapter, txo);
14081406
14091407 return NETDEV_TX_OK;
1408+drop_skb:
1409+ dev_kfree_skb_any(skb);
14101410 drop:
14111411 tx_stats(txo)->tx_drv_drops++;
14121412 /* Flush the already enqueued tx requests */
drivers/net/ethernet/faraday/ftgmac100.c+6−1
@@ -1906,7 +1906,12 @@ static int ftgmac100_probe(struct platform_device *pdev) · 1905 unmodified lines
19061906 goto err_phy_connect;
19071907 }
19081908
1909− phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, NULL);
1909+ phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, np);
1910+ if (IS_ERR(phydev)) {
1911+ dev_err(&pdev->dev, "failed to register fixed PHY device\n");
1912+ err = PTR_ERR(phydev);
1913+ goto err_phy_connect;
1914+ }
19101915 err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
19111916 PHY_INTERFACE_MODE_MII);
19121917 if (err) {
drivers/net/ethernet/freescale/enetc/enetc.c+43−13
@@ -902,6 +902,7 @@ static bool enetc_clean_tx_ring(struct enetc_bdr *tx_ring, int napi_budget) · 901 unmodified lines
902902
903903 if (unlikely(tx_frm_cnt && netif_carrier_ok(ndev) &&
904904 __netif_subqueue_stopped(ndev, tx_ring->index) &&
905+ !test_bit(ENETC_TX_DOWN, &priv->flags) &&
905906 (enetc_bd_unused(tx_ring) >= ENETC_TXBDS_MAX_NEEDED))) {
906907 netif_wake_subqueue(ndev, tx_ring->index);
907908 }
@@ -1377,6 +1378,9 @@ int enetc_xdp_xmit(struct net_device *ndev, int num_frames, · 469 unmodified lines
13771378 int xdp_tx_bd_cnt, i, k;
13781379 int xdp_tx_frm_cnt = 0;
13791380
1381+ if (unlikely(test_bit(ENETC_TX_DOWN, &priv->flags)))
1382+ return -ENETDOWN;
1383+
13801384 enetc_lock_mdio();
13811385
13821386 tx_ring = priv->xdp_tx_ring[smp_processor_id()];
@@ -1521,7 +1525,6 @@ static void enetc_xdp_drop(struct enetc_bdr *rx_ring, int rx_ring_first, · 138 unmodified lines
15211525 &rx_ring->rx_swbd[rx_ring_first]);
15221526 enetc_bdr_idx_inc(rx_ring, &rx_ring_first);
15231527 }
1524− rx_ring->stats.xdp_drops++;
15251528 }
15261529
15271530 static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring,
@@ -1586,6 +1589,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, · 58 unmodified lines
15861589 fallthrough;
15871590 case XDP_DROP:
15881591 enetc_xdp_drop(rx_ring, orig_i, i);
1592+ rx_ring->stats.xdp_drops++;
15891593 break;
15901594 case XDP_PASS:
15911595 rxbd = orig_rxbd;
@@ -1602,6 +1606,12 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, · 10 unmodified lines
16021606 break;
16031607 case XDP_TX:
16041608 tx_ring = priv->xdp_tx_ring[rx_ring->index];
1609+ if (unlikely(test_bit(ENETC_TX_DOWN, &priv->flags))) {
1610+ enetc_xdp_drop(rx_ring, orig_i, i);
1611+ tx_ring->stats.xdp_tx_drops++;
1612+ break;
1613+ }
1614+
16051615 xdp_tx_bd_cnt = enetc_rx_swbd_to_xdp_tx_swbd(xdp_tx_arr,
16061616 rx_ring,
16071617 orig_i, i);
@@ -2223,18 +2233,24 @@ static void enetc_enable_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring) · 615 unmodified lines
22232233 enetc_rxbdr_wr(hw, idx, ENETC_RBMR, rbmr);
22242234 }
22252235
2226−static void enetc_enable_bdrs(struct enetc_ndev_priv *priv)
2236+static void enetc_enable_rx_bdrs(struct enetc_ndev_priv *priv)
22272237 {
22282238 struct enetc_hw *hw = &priv->si->hw;
22292239 int i;
22302240
2231− for (i = 0; i < priv->num_tx_rings; i++)
2232− enetc_enable_txbdr(hw, priv->tx_ring[i]);
2233−
22342241 for (i = 0; i < priv->num_rx_rings; i++)
22352242 enetc_enable_rxbdr(hw, priv->rx_ring[i]);
22362243 }
22372244
2245+static void enetc_enable_tx_bdrs(struct enetc_ndev_priv *priv)
2246+{
2247+ struct enetc_hw *hw = &priv->si->hw;
2248+ int i;
2249+
2250+ for (i = 0; i < priv->num_tx_rings; i++)
2251+ enetc_enable_txbdr(hw, priv->tx_ring[i]);
2252+}
2253+
22382254 static void enetc_disable_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring)
22392255 {
22402256 int idx = rx_ring->index;
@@ -2251,18 +2267,24 @@ static void enetc_disable_txbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring) · 10 unmodified lines
22512267 enetc_txbdr_wr(hw, idx, ENETC_TBMR, 0);
22522268 }
22532269
2254−static void enetc_disable_bdrs(struct enetc_ndev_priv *priv)
2270+static void enetc_disable_rx_bdrs(struct enetc_ndev_priv *priv)
22552271 {
22562272 struct enetc_hw *hw = &priv->si->hw;
22572273 int i;
22582274
2259− for (i = 0; i < priv->num_tx_rings; i++)
2260− enetc_disable_txbdr(hw, priv->tx_ring[i]);
2261−
22622275 for (i = 0; i < priv->num_rx_rings; i++)
22632276 enetc_disable_rxbdr(hw, priv->rx_ring[i]);
22642277 }
22652278
2279+static void enetc_disable_tx_bdrs(struct enetc_ndev_priv *priv)
2280+{
2281+ struct enetc_hw *hw = &priv->si->hw;
2282+ int i;
2283+
2284+ for (i = 0; i < priv->num_tx_rings; i++)
2285+ enetc_disable_txbdr(hw, priv->tx_ring[i]);
2286+}
2287+
22662288 static void enetc_wait_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring)
22672289 {
22682290 int delay = 8, timeout = 100;
@@ -2460,9 +2482,13 @@ void enetc_start(struct net_device *ndev) · 191 unmodified lines
24602482 enable_irq(irq);
24612483 }
24622484
2463− enetc_enable_bdrs(priv);
2485+ enetc_enable_tx_bdrs(priv);
2486+
2487+ enetc_enable_rx_bdrs(priv);
24642488
24652489 netif_tx_start_all_queues(ndev);
2490+
2491+ clear_bit(ENETC_TX_DOWN, &priv->flags);
24662492 }
24672493 EXPORT_SYMBOL_GPL(enetc_start);
24682494
@@ -2520,9 +2546,15 @@ void enetc_stop(struct net_device *ndev) · 51 unmodified lines
25202546 struct enetc_ndev_priv *priv = netdev_priv(ndev);
25212547 int i;
25222548
2549+ set_bit(ENETC_TX_DOWN, &priv->flags);
2550+
25232551 netif_tx_stop_all_queues(ndev);
25242552
2525− enetc_disable_bdrs(priv);
2553+ enetc_disable_rx_bdrs(priv);
2554+
2555+ enetc_wait_bdrs(priv);
2556+
2557+ enetc_disable_tx_bdrs(priv);
25262558
25272559 for (i = 0; i < priv->bdr_int_num; i++) {
25282560 int irq = pci_irq_vector(priv->si->pdev,
@@ -2533,8 +2565,6 @@ void enetc_stop(struct net_device *ndev) · 4 unmodified lines
25332565 napi_disable(&priv->int_vector[i]->napi);
25342566 }
25352567
2536− enetc_wait_bdrs(priv);
2537−
25382568 enetc_clear_interrupts(priv);
25392569 }
25402570 EXPORT_SYMBOL_GPL(enetc_stop);
drivers/net/ethernet/freescale/enetc/enetc.h+1−0
@@ -325,6 +325,7 @@ enum enetc_active_offloads { · 324 unmodified lines
325325
326326 enum enetc_flags_bit {
327327 ENETC_TX_ONESTEP_TSTAMP_IN_PROGRESS = 0,
328+ ENETC_TX_DOWN,
328329 };
329330
330331 /* interrupt coalescing modes */
drivers/net/ethernet/freescale/fec_main.c+4−2
@@ -1077,7 +1077,8 @@ fec_restart(struct net_device *ndev) · 1076 unmodified lines
10771077 u32 rcntl = OPT_FRAME_SIZE | 0x04;
10781078 u32 ecntl = FEC_ECR_ETHEREN;
10791079
1080− fec_ptp_save_state(fep);
1080+ if (fep->bufdesc_ex)
1081+ fec_ptp_save_state(fep);
10811082
10821083 /* Whack a reset. We should wait for this.
10831084 * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
@@ -1340,7 +1341,8 @@ fec_stop(struct net_device *ndev) · 256 unmodified lines
13401341 netdev_err(ndev, "Graceful transmit stop did not complete!\n");
13411342 }
13421343
1343− fec_ptp_save_state(fep);
1344+ if (fep->bufdesc_ex)
1345+ fec_ptp_save_state(fep);
13441346
13451347 /* Whack a reset. We should wait for this.
13461348 * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
drivers/net/ethernet/freescale/fman/mac.c+51−17
@@ -197,55 +197,67 @@ static int mac_probe(struct platform_device *_of_dev) · 196 unmodified lines
197197 err = -EINVAL;
198198 goto _return_of_node_put;
199199 }
200+ mac_dev->fman_dev = &of_dev->dev;
200201
201202 /* Get the FMan cell-index */
202203 err = of_property_read_u32(dev_node, "cell-index", &val);
203204 if (err) {
204205 dev_err(dev, "failed to read cell-index for %pOF\n", dev_node);
205206 err = -EINVAL;
206− goto _return_of_node_put;
207+ goto _return_dev_put;
207208 }
208209 /* cell-index 0 => FMan id 1 */
209210 fman_id = (u8)(val + 1);
210211
211− priv->fman = fman_bind(&of_dev->dev);
212+ priv->fman = fman_bind(mac_dev->fman_dev);
212213 if (!priv->fman) {
213214 dev_err(dev, "fman_bind(%pOF) failed\n", dev_node);
214215 err = -ENODEV;
215− goto _return_of_node_put;
216+ goto _return_dev_put;
216217 }
217218
219+ /* Two references have been taken in of_find_device_by_node()
220+ * and fman_bind(). Release one of them here. The second one
221+ * will be released in mac_remove().
222+ */
223+ put_device(mac_dev->fman_dev);
218224 of_node_put(dev_node);
225+ dev_node = NULL;
219226
220227 /* Get the address of the memory mapped registers */
221228 mac_dev->res = platform_get_mem_or_io(_of_dev, 0);
222229 if (!mac_dev->res) {
223230 dev_err(dev, "could not get registers\n");
224− return -EINVAL;
231+ err = -EINVAL;
232+ goto _return_dev_put;
225233 }
226234
227235 err = devm_request_resource(dev, fman_get_mem_region(priv->fman),
228236 mac_dev->res);
229237 if (err) {
230238 dev_err_probe(dev, err, "could not request resource\n");
231− return err;
239+ goto _return_dev_put;
232240 }
233241
234242 mac_dev->vaddr = devm_ioremap(dev, mac_dev->res->start,
235243 resource_size(mac_dev->res));
236244 if (!mac_dev->vaddr) {
237245 dev_err(dev, "devm_ioremap() failed\n");
238− return -EIO;
246+ err = -EIO;
247+ goto _return_dev_put;
239248 }
240249
241− if (!of_device_is_available(mac_node))
242− return -ENODEV;
250+ if (!of_device_is_available(mac_node)) {
251+ err = -ENODEV;
252+ goto _return_dev_put;
253+ }
243254
244255 /* Get the cell-index */
245256 err = of_property_read_u32(mac_node, "cell-index", &val);
246257 if (err) {
247258 dev_err(dev, "failed to read cell-index for %pOF\n", mac_node);
248− return -EINVAL;
259+ err = -EINVAL;
260+ goto _return_dev_put;
249261 }
250262 priv->cell_index = (u8)val;
251263
@@ -259,22 +271,26 @@ static int mac_probe(struct platform_device *_of_dev) · 7 unmodified lines
259271 if (unlikely(nph < 0)) {
260272 dev_err(dev, "of_count_phandle_with_args(%pOF, fsl,fman-ports) failed\n",
261273 mac_node);
262− return nph;
274+ err = nph;
275+ goto _return_dev_put;
263276 }
264277
265278 if (nph != ARRAY_SIZE(mac_dev->port)) {
266279 dev_err(dev, "Not supported number of fman-ports handles of mac node %pOF from device tree\n",
267280 mac_node);
268− return -EINVAL;
281+ err = -EINVAL;
282+ goto _return_dev_put;
269283 }
270284
271− for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) {
285+ /* PORT_NUM determines the size of the port array */
286+ for (i = 0; i < PORT_NUM; i++) {
272287 /* Find the port node */
273288 dev_node = of_parse_phandle(mac_node, "fsl,fman-ports", i);
274289 if (!dev_node) {
275290 dev_err(dev, "of_parse_phandle(%pOF, fsl,fman-ports) failed\n",
276291 mac_node);
277− return -EINVAL;
292+ err = -EINVAL;
293+ goto _return_dev_arr_put;
278294 }
279295
280296 of_dev = of_find_device_by_node(dev_node);
@@ -282,17 +298,24 @@ static int mac_probe(struct platform_device *_of_dev) · 1 unmodified line
282298 dev_err(dev, "of_find_device_by_node(%pOF) failed\n",
283299 dev_node);
284300 err = -EINVAL;
285− goto _return_of_node_put;
301+ goto _return_dev_arr_put;
286302 }
303+ mac_dev->fman_port_devs[i] = &of_dev->dev;
287304
288− mac_dev->port[i] = fman_port_bind(&of_dev->dev);
305+ mac_dev->port[i] = fman_port_bind(mac_dev->fman_port_devs[i]);
289306 if (!mac_dev->port[i]) {
290307 dev_err(dev, "dev_get_drvdata(%pOF) failed\n",
291308 dev_node);
292309 err = -EINVAL;
293− goto _return_of_node_put;
310+ goto _return_dev_arr_put;
294311 }
312+ /* Two references have been taken in of_find_device_by_node()
313+ * and fman_port_bind(). Release one of them here. The second
314+ * one will be released in mac_remove().
315+ */
316+ put_device(mac_dev->fman_port_devs[i]);
295317 of_node_put(dev_node);
318+ dev_node = NULL;
296319 }
297320
298321 /* Get the PHY connection type */
@@ -312,7 +335,7 @@ static int mac_probe(struct platform_device *_of_dev) · 13 unmodified lines
312335
313336 err = init(mac_dev, mac_node, &params);
314337 if (err < 0)
315− return err;
338+ goto _return_dev_arr_put;
316339
317340 if (!is_zero_ether_addr(mac_dev->addr))
318341 dev_info(dev, "FMan MAC address: %pM\n", mac_dev->addr);
@@ -327,6 +350,12 @@ static int mac_probe(struct platform_device *_of_dev) · 8 unmodified lines
327350
328351 return err;
329352
353+_return_dev_arr_put:
354+ /* mac_dev is kzalloc'ed */
355+ for (i = 0; i < PORT_NUM; i++)
356+ put_device(mac_dev->fman_port_devs[i]);
357+_return_dev_put:
358+ put_device(mac_dev->fman_dev);
330359 _return_of_node_put:
331360 of_node_put(dev_node);
332361 return err;
@@ -335,6 +364,11 @@ _return_of_node_put: · 2 unmodified lines
335364 static void mac_remove(struct platform_device *pdev)
336365 {
337366 struct mac_device *mac_dev = platform_get_drvdata(pdev);
367+ int i;
368+
369+ for (i = 0; i < PORT_NUM; i++)
370+ put_device(mac_dev->fman_port_devs[i]);
371+ put_device(mac_dev->fman_dev);
338372
339373 platform_device_unregister(mac_dev->priv->eth_dev);
340374 }
drivers/net/ethernet/freescale/fman/mac.h+5−1
@@ -19,12 +19,13 @@ · 18 unmodified lines
1919 struct fman_mac;
2020 struct mac_priv_s;
2121
22+#define PORT_NUM 2
2223 struct mac_device {
2324 void __iomem *vaddr;
2425 struct device *dev;
2526 struct resource *res;
2627 u8 addr[ETH_ALEN];
27− struct fman_port *port[2];
28+ struct fman_port *port[PORT_NUM];
2829 struct phylink *phylink;
2930 struct phylink_config phylink_config;
3031 phy_interface_t phy_if;
@@ -52,6 +53,9 @@ struct mac_device { · 21 unmodified lines
5253
5354 struct fman_mac *fman_mac;
5455 struct mac_priv_s *priv;
56+
57+ struct device *fman_dev;
58+ struct device *fman_port_devs[PORT_NUM];
5559 };
5660
5761 static inline struct mac_device
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c+3−1
@@ -1293,8 +1293,10 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer, · 1292 unmodified lines
12931293
12941294 /* save the buffer addr until the last read operation */
12951295 *save_buf = read_buf;
1296+ }
12961297
1297− /* get data ready for the first time to read */
1298+ /* get data ready for the first time to read */
1299+ if (!*ppos) {
12981300 ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd,
12991301 read_buf, hns3_dbg_cmd[index].buf_len);
13001302 if (ret)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+58−1
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/irq.h>
1212 #include <linux/ip.h>
1313 #include <linux/ipv6.h>
14+#include <linux/iommu.h>
1415 #include <linux/module.h>
1516 #include <linux/pci.h>
1617 #include <linux/skbuff.h>
@@ -380,6 +381,24 @@ static const struct hns3_rx_ptype hns3_rx_ptype_tbl[] = { · 363 unmodified lines
380381 #define HNS3_INVALID_PTYPE \
381382 ARRAY_SIZE(hns3_rx_ptype_tbl)
382383
384+static void hns3_dma_map_sync(struct device *dev, unsigned long iova)
385+{
386+ struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
387+ struct iommu_iotlb_gather iotlb_gather;
388+ size_t granule;
389+
390+ if (!domain || !iommu_is_dma_domain(domain))
391+ return;
392+
393+ granule = 1 << __ffs(domain->pgsize_bitmap);
394+ iova = ALIGN_DOWN(iova, granule);
395+ iotlb_gather.start = iova;
396+ iotlb_gather.end = iova + granule - 1;
397+ iotlb_gather.pgsize = granule;
398+
399+ iommu_iotlb_sync(domain, &iotlb_gather);
400+}
401+
383402 static irqreturn_t hns3_irq_handle(int irq, void *vector)
384403 {
385404 struct hns3_enet_tqp_vector *tqp_vector = vector;
@@ -1032,6 +1051,8 @@ static bool hns3_can_use_tx_sgl(struct hns3_enet_ring *ring, · 646 unmodified lines
10321051 static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
10331052 {
10341053 u32 alloc_size = ring->tqp->handle->kinfo.tx_spare_buf_size;
1054+ struct net_device *netdev = ring_to_netdev(ring);
1055+ struct hns3_nic_priv *priv = netdev_priv(netdev);
10351056 struct hns3_tx_spare *tx_spare;
10361057 struct page *page;
10371058 dma_addr_t dma;
@@ -1073,6 +1094,7 @@ static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring) · 35 unmodified lines
10731094 tx_spare->buf = page_address(page);
10741095 tx_spare->len = PAGE_SIZE << order;
10751096 ring->tx_spare = tx_spare;
1097+ ring->tx_copybreak = priv->tx_copybreak;
10761098 return;
10771099
10781100 dma_mapping_error:
@@ -1724,7 +1746,9 @@ static int hns3_map_and_fill_desc(struct hns3_enet_ring *ring, void *priv, · 645 unmodified lines
17241746 unsigned int type)
17251747 {
17261748 struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use];
1749+ struct hnae3_handle *handle = ring->tqp->handle;
17271750 struct device *dev = ring_to_dev(ring);
1751+ struct hnae3_ae_dev *ae_dev;
17281752 unsigned int size;
17291753 dma_addr_t dma;
17301754
@@ -1756,6 +1780,13 @@ static int hns3_map_and_fill_desc(struct hns3_enet_ring *ring, void *priv, · 25 unmodified lines
17561780 return -ENOMEM;
17571781 }
17581782
1783+ /* Add a SYNC command to sync io-pgtale to avoid errors in pgtable
1784+ * prefetch
1785+ */
1786+ ae_dev = hns3_get_ae_dev(handle);
1787+ if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3)
1788+ hns3_dma_map_sync(dev, dma);
1789+
17591790 desc_cb->priv = priv;
17601791 desc_cb->length = size;
17611792 desc_cb->dma = dma;
@@ -2452,7 +2483,6 @@ static int hns3_nic_set_features(struct net_device *netdev, · 690 unmodified lines
24522483 return ret;
24532484 }
24542485
2455− netdev->features = features;
24562486 return 0;
24572487 }
24582488
@@ -4868,6 +4898,30 @@ static void hns3_nic_dealloc_vector_data(struct hns3_nic_priv *priv) · 2409 unmodified lines
48684898 devm_kfree(&pdev->dev, priv->tqp_vector);
48694899 }
48704900
4901+static void hns3_update_tx_spare_buf_config(struct hns3_nic_priv *priv)
4902+{
4903+#define HNS3_MIN_SPARE_BUF_SIZE (2 * 1024 * 1024)
4904+#define HNS3_MAX_PACKET_SIZE (64 * 1024)
4905+
4906+ struct iommu_domain *domain = iommu_get_domain_for_dev(priv->dev);
4907+ struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
4908+ struct hnae3_handle *handle = priv->ae_handle;
4909+
4910+ if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V3)
4911+ return;
4912+
4913+ if (!(domain && iommu_is_dma_domain(domain)))
4914+ return;
4915+
4916+ priv->min_tx_copybreak = HNS3_MAX_PACKET_SIZE;
4917+ priv->min_tx_spare_buf_size = HNS3_MIN_SPARE_BUF_SIZE;
4918+
4919+ if (priv->tx_copybreak < priv->min_tx_copybreak)
4920+ priv->tx_copybreak = priv->min_tx_copybreak;
4921+ if (handle->kinfo.tx_spare_buf_size < priv->min_tx_spare_buf_size)
4922+ handle->kinfo.tx_spare_buf_size = priv->min_tx_spare_buf_size;
4923+}
4924+
48714925 static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv,
48724926 unsigned int ring_type)
48734927 {
@@ -5101,6 +5155,7 @@ int hns3_init_all_ring(struct hns3_nic_priv *priv) · 227 unmodified lines
51015155 int i, j;
51025156 int ret;
51035157
5158+ hns3_update_tx_spare_buf_config(priv);
51045159 for (i = 0; i < ring_num; i++) {
51055160 ret = hns3_alloc_ring_memory(&priv->ring[i]);
51065161 if (ret) {
@@ -5305,6 +5360,8 @@ static int hns3_client_init(struct hnae3_handle *handle) · 198 unmodified lines
53055360 priv->ae_handle = handle;
53065361 priv->tx_timeout_count = 0;
53075362 priv->max_non_tso_bd_num = ae_dev->dev_specs.max_non_tso_bd_num;
5363+ priv->min_tx_copybreak = 0;
5364+ priv->min_tx_spare_buf_size = 0;
53085365 set_bit(HNS3_NIC_STATE_DOWN, &priv->state);
53095366
53105367 handle->msg_enable = netif_msg_init(debug, DEFAULT_MSG_LEVEL);
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h+2−0
@@ -596,6 +596,8 @@ struct hns3_nic_priv { · 595 unmodified lines
596596 struct hns3_enet_coalesce rx_coal;
597597 u32 tx_copybreak;
598598 u32 rx_copybreak;
599+ u32 min_tx_copybreak;
600+ u32 min_tx_spare_buf_size;
599601 };
600602
601603 union l3_hdr_info {
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c+33−0
@@ -1933,6 +1933,31 @@ static int hns3_set_tx_spare_buf_size(struct net_device *netdev, · 1932 unmodified lines
19331933 return ret;
19341934 }
19351935
1936+static int hns3_check_tx_copybreak(struct net_device *netdev, u32 copybreak)
1937+{
1938+ struct hns3_nic_priv *priv = netdev_priv(netdev);
1939+
1940+ if (copybreak < priv->min_tx_copybreak) {
1941+ netdev_err(netdev, "tx copybreak %u should be no less than %u!\n",
1942+ copybreak, priv->min_tx_copybreak);
1943+ return -EINVAL;
1944+ }
1945+ return 0;
1946+}
1947+
1948+static int hns3_check_tx_spare_buf_size(struct net_device *netdev, u32 buf_size)
1949+{
1950+ struct hns3_nic_priv *priv = netdev_priv(netdev);
1951+
1952+ if (buf_size < priv->min_tx_spare_buf_size) {
1953+ netdev_err(netdev,
1954+ "tx spare buf size %u should be no less than %u!\n",
1955+ buf_size, priv->min_tx_spare_buf_size);
1956+ return -EINVAL;
1957+ }
1958+ return 0;
1959+}
1960+
19361961 static int hns3_set_tunable(struct net_device *netdev,
19371962 const struct ethtool_tunable *tuna,
19381963 const void *data)
@@ -1949,6 +1974,10 @@ static int hns3_set_tunable(struct net_device *netdev, · 10 unmodified lines
19491974
19501975 switch (tuna->id) {
19511976 case ETHTOOL_TX_COPYBREAK:
1977+ ret = hns3_check_tx_copybreak(netdev, *(u32 *)data);
1978+ if (ret)
1979+ return ret;
1980+
19521981 priv->tx_copybreak = *(u32 *)data;
19531982
19541983 for (i = 0; i < h->kinfo.num_tqps; i++)
@@ -1963,6 +1992,10 @@ static int hns3_set_tunable(struct net_device *netdev, · 8 unmodified lines
19631992
19641993 break;
19651994 case ETHTOOL_TX_COPYBREAK_BUF_SIZE:
1995+ ret = hns3_check_tx_spare_buf_size(netdev, *(u32 *)data);
1996+ if (ret)
1997+ return ret;
1998+
19661999 old_tx_spare_buf_size = h->kinfo.tx_spare_buf_size;
19672000 new_tx_spare_buf_size = *(u32 *)data;
19682001 netdev_info(netdev, "request to set tx spare buf size from %u to %u\n",
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+36−9
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <linux/etherdevice.h>
77 #include <linux/init.h>
88 #include <linux/interrupt.h>
9+#include <linux/irq.h>
910 #include <linux/kernel.h>
1011 #include <linux/module.h>
1112 #include <linux/netdevice.h>
@@ -3584,6 +3585,17 @@ static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf, · 3572 unmodified lines
35843585 return ret;
35853586 }
35863587
3588+static void hclge_set_reset_pending(struct hclge_dev *hdev,
3589+ enum hnae3_reset_type reset_type)
3590+{
3591+ /* When an incorrect reset type is executed, the get_reset_level
3592+ * function generates the HNAE3_NONE_RESET flag. As a result, this
3593+ * type do not need to pending.
3594+ */
3595+ if (reset_type != HNAE3_NONE_RESET)
3596+ set_bit(reset_type, &hdev->reset_pending);
3597+}
3598+
35873599 static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
35883600 {
35893601 u32 cmdq_src_reg, msix_src_reg, hw_err_src_reg;
@@ -3604,7 +3616,7 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval) · 14 unmodified lines
36043616 */
36053617 if (BIT(HCLGE_VECTOR0_IMPRESET_INT_B) & msix_src_reg) {
36063618 dev_info(&hdev->pdev->dev, "IMP reset interrupt\n");
3607− set_bit(HNAE3_IMP_RESET, &hdev->reset_pending);
3619+ hclge_set_reset_pending(hdev, HNAE3_IMP_RESET);
36083620 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state);
36093621 *clearval = BIT(HCLGE_VECTOR0_IMPRESET_INT_B);
36103622 hdev->rst_stats.imp_rst_cnt++;
@@ -3614,7 +3626,7 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval) · 3 unmodified lines
36143626 if (BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B) & msix_src_reg) {
36153627 dev_info(&hdev->pdev->dev, "global reset interrupt\n");
36163628 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state);
3617− set_bit(HNAE3_GLOBAL_RESET, &hdev->reset_pending);
3629+ hclge_set_reset_pending(hdev, HNAE3_GLOBAL_RESET);
36183630 *clearval = BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B);
36193631 hdev->rst_stats.global_rst_cnt++;
36203632 return HCLGE_VECTOR0_EVENT_RST;
@@ -3769,7 +3781,7 @@ static int hclge_misc_irq_init(struct hclge_dev *hdev) · 148 unmodified lines
37693781 snprintf(hdev->misc_vector.name, HNAE3_INT_NAME_LEN, "%s-misc-%s",
37703782 HCLGE_NAME, pci_name(hdev->pdev));
37713783 ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle,
3772− 0, hdev->misc_vector.name, hdev);
3784+ IRQ_NOAUTOEN, hdev->misc_vector.name, hdev);
37733785 if (ret) {
37743786 hclge_free_vector(hdev, 0);
37753787 dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n",
@@ -4062,7 +4074,7 @@ static void hclge_do_reset(struct hclge_dev *hdev) · 286 unmodified lines
40624074 case HNAE3_FUNC_RESET:
40634075 dev_info(&pdev->dev, "PF reset requested\n");
40644076 /* schedule again to check later */
4065− set_bit(HNAE3_FUNC_RESET, &hdev->reset_pending);
4077+ hclge_set_reset_pending(hdev, HNAE3_FUNC_RESET);
40664078 hclge_reset_task_schedule(hdev);
40674079 break;
40684080 default:
@@ -4096,6 +4108,8 @@ static enum hnae3_reset_type hclge_get_reset_level(struct hnae3_ae_dev *ae_dev, · 27 unmodified lines
40964108 clear_bit(HNAE3_FLR_RESET, addr);
40974109 }
40984110
4111+ clear_bit(HNAE3_NONE_RESET, addr);
4112+
40994113 if (hdev->reset_type != HNAE3_NONE_RESET &&
41004114 rst_level < hdev->reset_type)
41014115 return HNAE3_NONE_RESET;
@@ -4237,7 +4251,7 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev) · 135 unmodified lines
42374251 return false;
42384252 } else if (hdev->rst_stats.reset_fail_cnt < MAX_RESET_FAIL_CNT) {
42394253 hdev->rst_stats.reset_fail_cnt++;
4240− set_bit(hdev->reset_type, &hdev->reset_pending);
4254+ hclge_set_reset_pending(hdev, hdev->reset_type);
42414255 dev_info(&hdev->pdev->dev,
42424256 "re-schedule reset task(%u)\n",
42434257 hdev->rst_stats.reset_fail_cnt);
@@ -4480,8 +4494,20 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle) · 236 unmodified lines
44804494 static void hclge_set_def_reset_request(struct hnae3_ae_dev *ae_dev,
44814495 enum hnae3_reset_type rst_type)
44824496 {
4497+#define HCLGE_SUPPORT_RESET_TYPE \
4498+ (BIT(HNAE3_FLR_RESET) | BIT(HNAE3_FUNC_RESET) | \
4499+ BIT(HNAE3_GLOBAL_RESET) | BIT(HNAE3_IMP_RESET))
4500+
44834501 struct hclge_dev *hdev = ae_dev->priv;
44844502
4503+ if (!(BIT(rst_type) & HCLGE_SUPPORT_RESET_TYPE)) {
4504+ /* To prevent reset triggered by hclge_reset_event */
4505+ set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request);
4506+ dev_warn(&hdev->pdev->dev, "unsupported reset type %d\n",
4507+ rst_type);
4508+ return;
4509+ }
4510+
44854511 set_bit(rst_type, &hdev->default_reset_request);
44864512 }
44874513
@@ -11891,9 +11917,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) · 7403 unmodified lines
1189111917
1189211918 hclge_init_rxd_adv_layout(hdev);
1189311919
11894− /* Enable MISC vector(vector0) */
11895− hclge_enable_vector(&hdev->misc_vector, true);
11896−
1189711920 ret = hclge_init_wol(hdev);
1189811921 if (ret)
1189911922 dev_warn(&pdev->dev,
@@ -11906,6 +11929,10 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) · 6 unmodified lines
1190611929 hclge_state_init(hdev);
1190711930 hdev->last_reset_time = jiffies;
1190811931
11932+ /* Enable MISC vector(vector0) */
11933+ enable_irq(hdev->misc_vector.vector_irq);
11934+ hclge_enable_vector(&hdev->misc_vector, true);
11935+
1190911936 dev_info(&hdev->pdev->dev, "%s driver initialization finished.\n",
1191011937 HCLGE_DRIVER_NAME);
1191111938
@@ -12311,7 +12338,7 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) · 399 unmodified lines
1231112338
1231212339 /* Disable MISC vector(vector0) */
1231312340 hclge_enable_vector(&hdev->misc_vector, false);
12314− synchronize_irq(hdev->misc_vector.vector_irq);
12341+ disable_irq(hdev->misc_vector.vector_irq);
1231512342
1231612343 /* Disable all hw interrupts */
1231712344 hclge_config_mac_tnl_int(hdev, false);
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c+3−0
@@ -58,6 +58,9 @@ bool hclge_ptp_set_tx_info(struct hnae3_handle *handle, struct sk_buff *skb) · 57 unmodified lines
5858 struct hclge_dev *hdev = vport->back;
5959 struct hclge_ptp *ptp = hdev->ptp;
6060
61+ if (!ptp)
62+ return false;
63+
6164 if (!test_bit(HCLGE_PTP_FLAG_TX_EN, &ptp->flags) ||
6265 test_and_set_bit(HCLGE_STATE_PTP_TX_HANDLING, &hdev->state)) {
6366 ptp->tx_skipped++;
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c+5−4
@@ -510,9 +510,9 @@ out: · 509 unmodified lines
510510 static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data,
511511 struct hnae3_knic_private_info *kinfo)
512512 {
513−#define HCLGE_RING_REG_OFFSET 0x200
514513 #define HCLGE_RING_INT_REG_OFFSET 0x4
515514
515+ struct hnae3_queue *tqp;
516516 int i, j, reg_num;
517517 int data_num_sum;
518518 u32 *reg = data;
@@ -533,10 +533,11 @@ static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data, · 14 unmodified lines
533533 reg_num = ARRAY_SIZE(ring_reg_addr_list);
534534 for (j = 0; j < kinfo->num_tqps; j++) {
535535 reg += hclge_reg_get_tlv(HCLGE_REG_TAG_RING, reg_num, reg);
536+ tqp = kinfo->tqp[j];
536537 for (i = 0; i < reg_num; i++)
537− *reg++ = hclge_read_dev(&hdev->hw,
538− ring_reg_addr_list[i] +
539− HCLGE_RING_REG_OFFSET * j);
538+ *reg++ = readl_relaxed(tqp->io_base -
539+ HCLGE_TQP_REG_OFFSET +
540+ ring_reg_addr_list[i]);
540541 }
541542 data_num_sum += (reg_num + HCLGE_REG_TLV_SPACE) * kinfo->num_tqps;
542543
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+33−7
@@ -1395,6 +1395,17 @@ static int hclgevf_notify_roce_client(struct hclgevf_dev *hdev, · 1394 unmodified lines
13951395 return ret;
13961396 }
13971397
1398+static void hclgevf_set_reset_pending(struct hclgevf_dev *hdev,
1399+ enum hnae3_reset_type reset_type)
1400+{
1401+ /* When an incorrect reset type is executed, the get_reset_level
1402+ * function generates the HNAE3_NONE_RESET flag. As a result, this
1403+ * type do not need to pending.
1404+ */
1405+ if (reset_type != HNAE3_NONE_RESET)
1406+ set_bit(reset_type, &hdev->reset_pending);
1407+}
1408+
13981409 static int hclgevf_reset_wait(struct hclgevf_dev *hdev)
13991410 {
14001411 #define HCLGEVF_RESET_WAIT_US 20000
@@ -1544,7 +1555,7 @@ static void hclgevf_reset_err_handle(struct hclgevf_dev *hdev) · 143 unmodified lines
15441555 hdev->rst_stats.rst_fail_cnt);
15451556
15461557 if (hdev->rst_stats.rst_fail_cnt < HCLGEVF_RESET_MAX_FAIL_CNT)
1547− set_bit(hdev->reset_type, &hdev->reset_pending);
1558+ hclgevf_set_reset_pending(hdev, hdev->reset_type);
15481559
15491560 if (hclgevf_is_reset_pending(hdev)) {
15501561 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
@@ -1664,6 +1675,8 @@ static enum hnae3_reset_type hclgevf_get_reset_level(unsigned long *addr) · 113 unmodified lines
16641675 clear_bit(HNAE3_FLR_RESET, addr);
16651676 }
16661677
1678+ clear_bit(HNAE3_NONE_RESET, addr);
1679+
16671680 return rst_level;
16681681 }
16691682
@@ -1673,14 +1686,15 @@ static void hclgevf_reset_event(struct pci_dev *pdev, · 3 unmodified lines
16731686 struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev);
16741687 struct hclgevf_dev *hdev = ae_dev->priv;
16751688
1676− dev_info(&hdev->pdev->dev, "received reset request from VF enet\n");
1677−
16781689 if (hdev->default_reset_request)
16791690 hdev->reset_level =
16801691 hclgevf_get_reset_level(&hdev->default_reset_request);
16811692 else
16821693 hdev->reset_level = HNAE3_VF_FUNC_RESET;
16831694
1695+ dev_info(&hdev->pdev->dev, "received reset request from VF enet, reset level is %d\n",
1696+ hdev->reset_level);
1697+
16841698 /* reset of this VF requested */
16851699 set_bit(HCLGEVF_RESET_REQUESTED, &hdev->reset_state);
16861700 hclgevf_reset_task_schedule(hdev);
@@ -1691,8 +1705,20 @@ static void hclgevf_reset_event(struct pci_dev *pdev, · 4 unmodified lines
16911705 static void hclgevf_set_def_reset_request(struct hnae3_ae_dev *ae_dev,
16921706 enum hnae3_reset_type rst_type)
16931707 {
1708+#define HCLGEVF_SUPPORT_RESET_TYPE \
1709+ (BIT(HNAE3_VF_RESET) | BIT(HNAE3_VF_FUNC_RESET) | \
1710+ BIT(HNAE3_VF_PF_FUNC_RESET) | BIT(HNAE3_VF_FULL_RESET) | \
1711+ BIT(HNAE3_FLR_RESET) | BIT(HNAE3_VF_EXP_RESET))
1712+
16941713 struct hclgevf_dev *hdev = ae_dev->priv;
16951714
1715+ if (!(BIT(rst_type) & HCLGEVF_SUPPORT_RESET_TYPE)) {
1716+ /* To prevent reset triggered by hclge_reset_event */
1717+ set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request);
1718+ dev_info(&hdev->pdev->dev, "unsupported reset type %d\n",
1719+ rst_type);
1720+ return;
1721+ }
16961722 set_bit(rst_type, &hdev->default_reset_request);
16971723 }
16981724
@@ -1849,14 +1875,14 @@ static void hclgevf_reset_service_task(struct hclgevf_dev *hdev) · 150 unmodified lines
18491875 */
18501876 if (hdev->reset_attempts > HCLGEVF_MAX_RESET_ATTEMPTS_CNT) {
18511877 /* prepare for full reset of stack + pcie interface */
1852− set_bit(HNAE3_VF_FULL_RESET, &hdev->reset_pending);
1878+ hclgevf_set_reset_pending(hdev, HNAE3_VF_FULL_RESET);
18531879
18541880 /* "defer" schedule the reset task again */
18551881 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
18561882 } else {
18571883 hdev->reset_attempts++;
18581884
1859− set_bit(hdev->reset_level, &hdev->reset_pending);
1885+ hclgevf_set_reset_pending(hdev, hdev->reset_level);
18601886 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
18611887 }
18621888 hclgevf_reset_task_schedule(hdev);
@@ -1979,7 +2005,7 @@ static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev, · 116 unmodified lines
19792005 rst_ing_reg = hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING);
19802006 dev_info(&hdev->pdev->dev,
19812007 "receive reset interrupt 0x%x!\n", rst_ing_reg);
1982− set_bit(HNAE3_VF_RESET, &hdev->reset_pending);
2008+ hclgevf_set_reset_pending(hdev, HNAE3_VF_RESET);
19832009 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
19842010 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state);
19852011 *clearval = ~(1U << HCLGEVF_VECTOR0_RST_INT_B);
@@ -2289,6 +2315,7 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev) · 303 unmodified lines
22892315 clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
22902316
22912317 INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
2318+ timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
22922319
22932320 mutex_init(&hdev->mbx_resp.mbx_mutex);
22942321 sema_init(&hdev->reset_sem, 1);
@@ -2988,7 +3015,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev) · 693 unmodified lines
29883015 HCLGEVF_DRIVER_NAME);
29893016
29903017 hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
2991− timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
29923018
29933019 return 0;
29943020
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c+5−4
@@ -123,10 +123,10 @@ int hclgevf_get_regs_len(struct hnae3_handle *handle) · 122 unmodified lines
123123 void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version,
124124 void *data)
125125 {
126−#define HCLGEVF_RING_REG_OFFSET 0x200
127126 #define HCLGEVF_RING_INT_REG_OFFSET 0x4
128127
129128 struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
129+ struct hnae3_queue *tqp;
130130 int i, j, reg_um;
131131 u32 *reg = data;
132132
@@ -147,10 +147,11 @@ void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version, · 14 unmodified lines
147147 reg_um = ARRAY_SIZE(ring_reg_addr_list);
148148 for (j = 0; j < hdev->num_tqps; j++) {
149149 reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_um, reg);
150+ tqp = &hdev->htqp[j].q;
150151 for (i = 0; i < reg_um; i++)
151− *reg++ = hclgevf_read_dev(&hdev->hw,
152− ring_reg_addr_list[i] +
153− HCLGEVF_RING_REG_OFFSET * j);
152+ *reg++ = readl_relaxed(tqp->io_base -
153+ HCLGEVF_TQP_REG_OFFSET +
154+ ring_reg_addr_list[i]);
154155 }
155156
156157 reg_um = ARRAY_SIZE(tqp_intr_reg_addr_list);
drivers/net/ethernet/i825xx/sun3_82586.c+1−0
@@ -1012,6 +1012,7 @@ sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev) · 1011 unmodified lines
10121012 if(skb->len > XMIT_BUFF_SIZE)
10131013 {
10141014 printk("%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n",dev->name,XMIT_BUFF_SIZE,skb->len);
1015+ dev_kfree_skb(skb);
10151016 return NETDEV_TX_OK;
10161017 }
10171018
drivers/net/ethernet/ibm/emac/mal.c+3−1
@@ -578,7 +578,7 @@ static int mal_probe(struct platform_device *ofdev) · 577 unmodified lines
578578 printk(KERN_ERR "%pOF: Support for 405EZ not enabled!\n",
579579 ofdev->dev.of_node);
580580 err = -ENODEV;
581− goto fail;
581+ goto fail_unmap;
582582 #endif
583583 }
584584
@@ -742,6 +742,8 @@ static void mal_remove(struct platform_device *ofdev) · 157 unmodified lines
742742
743743 free_netdev(mal->dummy_dev);
744744
745+ dcr_unmap(mal->dcr_host, 0x100);
746+
745747 dma_free_coherent(&ofdev->dev,
746748 sizeof(struct mal_descriptor) *
747749 (NUM_TX_BUFF * mal->num_tx_chans +
drivers/net/ethernet/ibm/ibmvnic.c+4−2
@@ -2472,9 +2472,11 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 2471 unmodified lines
24722472 /* if we are going to send_subcrq_direct this then we need to
24732473 * update the checksum before copying the data into ltb. Essentially
24742474 * these packets force disable CSO so that we can guarantee that
2475− * FW does not need header info and we can send direct.
2475+ * FW does not need header info and we can send direct. Also, vnic
2476+ * server must be able to xmit standard packets without header data
24762477 */
2477− if (!skb_is_gso(skb) && !ind_bufp->index && !netdev_xmit_more()) {
2478+ if (*hdrs == 0 && !skb_is_gso(skb) &&
2479+ !ind_bufp->index && !netdev_xmit_more()) {
24782480 use_scrq_send_direct = true;
24792481 if (skb->ip_summed == CHECKSUM_PARTIAL &&
24802482 skb_checksum_help(skb))
drivers/net/ethernet/intel/e1000e/hw.h+2−2
@@ -108,8 +108,8 @@ struct e1000_hw; · 107 unmodified lines
108108 #define E1000_DEV_ID_PCH_RPL_I219_V22 0x0DC8
109109 #define E1000_DEV_ID_PCH_MTP_I219_LM18 0x550A
110110 #define E1000_DEV_ID_PCH_MTP_I219_V18 0x550B
111−#define E1000_DEV_ID_PCH_MTP_I219_LM19 0x550C
112−#define E1000_DEV_ID_PCH_MTP_I219_V19 0x550D
111+#define E1000_DEV_ID_PCH_ADP_I219_LM19 0x550C
112+#define E1000_DEV_ID_PCH_ADP_I219_V19 0x550D
113113 #define E1000_DEV_ID_PCH_LNP_I219_LM20 0x550E
114114 #define E1000_DEV_ID_PCH_LNP_I219_V20 0x550F
115115 #define E1000_DEV_ID_PCH_LNP_I219_LM21 0x5510
drivers/net/ethernet/intel/e1000e/netdev.c+2−2
@@ -7899,10 +7899,10 @@ static const struct pci_device_id e1000_pci_tbl[] = { · 7898 unmodified lines
78997899 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_adp },
79007900 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_adp },
79017901 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_adp },
7902+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM19), board_pch_adp },
7903+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V19), board_pch_adp },
79027904 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_mtp },
79037905 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_mtp },
7904− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_mtp },
7905− { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_mtp },
79067906 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_mtp },
79077907 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_mtp },
79087908 { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_mtp },
drivers/net/ethernet/intel/i40e/i40e_main.c+1−0
@@ -1734,6 +1734,7 @@ struct i40e_mac_filter *i40e_add_mac_filter(struct i40e_vsi *vsi, · 1733 unmodified lines
17341734 struct hlist_node *h;
17351735 int bkt;
17361736
1737+ lockdep_assert_held(&vsi->mac_filter_hash_lock);
17371738 if (vsi->info.pvid)
17381739 return i40e_add_filter(vsi, macaddr,
17391740 le16_to_cpu(vsi->info.pvid));
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+2−0
@@ -2213,8 +2213,10 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) · 2212 unmodified lines
22132213 vfres->vsi_res[0].qset_handle
22142214 = le16_to_cpu(vsi->info.qs_handle[0]);
22152215 if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) && !vf->pf_set_mac) {
2216+ spin_lock_bh(&vsi->mac_filter_hash_lock);
22162217 i40e_del_mac_filter(vsi, vf->default_lan_addr.addr);
22172218 eth_zero_addr(vf->default_lan_addr.addr);
2219+ spin_unlock_bh(&vsi->mac_filter_hash_lock);
22182220 }
22192221 ether_addr_copy(vfres->vsi_res[0].default_mac_addr,
22202222 vf->default_lan_addr.addr);
drivers/net/ethernet/intel/ice/devlink/devlink_port.c+6−0
@@ -989,5 +989,11 @@ ice_devlink_port_new(struct devlink *devlink, · 988 unmodified lines
989989 if (err)
990990 return err;
991991
992+ if (!ice_is_eswitch_mode_switchdev(pf)) {
993+ NL_SET_ERR_MSG_MOD(extack,
994+ "SF ports are only supported in eswitch switchdev mode");
995+ return -EOPNOTSUPP;
996+ }
997+
992998 return ice_alloc_dynamic_port(pf, new_attr, extack, devlink_port);
993999 }
drivers/net/ethernet/intel/ice/ice_ddp.c+28−30
@@ -31,7 +31,7 @@ static const struct ice_tunnel_type_scan tnls[] = { · 30 unmodified lines
3131 * Verifies various attributes of the package file, including length, format
3232 * version, and the requirement of at least one segment.
3333 */
34−static enum ice_ddp_state ice_verify_pkg(struct ice_pkg_hdr *pkg, u32 len)
34+static enum ice_ddp_state ice_verify_pkg(const struct ice_pkg_hdr *pkg, u32 len)
3535 {
3636 u32 seg_count;
3737 u32 i;
@@ -57,13 +57,13 @@ static enum ice_ddp_state ice_verify_pkg(struct ice_pkg_hdr *pkg, u32 len) · 19 unmodified lines
5757 /* all segments must fit within length */
5858 for (i = 0; i < seg_count; i++) {
5959 u32 off = le32_to_cpu(pkg->seg_offset[i]);
60− struct ice_generic_seg_hdr *seg;
60+ const struct ice_generic_seg_hdr *seg;
6161
6262 /* segment header must fit */
6363 if (len < off + sizeof(*seg))
6464 return ICE_DDP_PKG_INVALID_FILE;
6565
66− seg = (struct ice_generic_seg_hdr *)((u8 *)pkg + off);
66+ seg = (void *)pkg + off;
6767
6868 /* segment body must fit */
6969 if (len < off + le32_to_cpu(seg->seg_size))
@@ -119,13 +119,13 @@ static enum ice_ddp_state ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver) · 49 unmodified lines
119119 *
120120 * This helper function validates a buffer's header.
121121 */
122−static struct ice_buf_hdr *ice_pkg_val_buf(struct ice_buf *buf)
122+static const struct ice_buf_hdr *ice_pkg_val_buf(const struct ice_buf *buf)
123123 {
124− struct ice_buf_hdr *hdr;
124+ const struct ice_buf_hdr *hdr;
125125 u16 section_count;
126126 u16 data_end;
127127
128− hdr = (struct ice_buf_hdr *)buf->buf;
128+ hdr = (const struct ice_buf_hdr *)buf->buf;
129129 /* verify data */
130130 section_count = le16_to_cpu(hdr->section_count);
131131 if (section_count < ICE_MIN_S_COUNT || section_count > ICE_MAX_S_COUNT)
@@ -165,8 +165,8 @@ static struct ice_buf_table *ice_find_buf_table(struct ice_seg *ice_seg) · 33 unmodified lines
165165 * unexpected value has been detected (for example an invalid section count or
166166 * an invalid buffer end value).
167167 */
168−static struct ice_buf_hdr *ice_pkg_enum_buf(struct ice_seg *ice_seg,
169− struct ice_pkg_enum *state)
168+static const struct ice_buf_hdr *ice_pkg_enum_buf(struct ice_seg *ice_seg,
169+ struct ice_pkg_enum *state)
170170 {
171171 if (ice_seg) {
172172 state->buf_table = ice_find_buf_table(ice_seg);
@@ -1800,9 +1800,9 @@ int ice_update_pkg(struct ice_hw *hw, struct ice_buf *bufs, u32 count) · 1627 unmodified lines
18001800 * success it returns a pointer to the segment header, otherwise it will
18011801 * return NULL.
18021802 */
1803−static struct ice_generic_seg_hdr *
1803+static const struct ice_generic_seg_hdr *
18041804 ice_find_seg_in_pkg(struct ice_hw *hw, u32 seg_type,
1805− struct ice_pkg_hdr *pkg_hdr)
1805+ const struct ice_pkg_hdr *pkg_hdr)
18061806 {
18071807 u32 i;
18081808
@@ -1813,11 +1813,9 @@ ice_find_seg_in_pkg(struct ice_hw *hw, u32 seg_type, · 4 unmodified lines
18131813
18141814 /* Search all package segments for the requested segment type */
18151815 for (i = 0; i < le32_to_cpu(pkg_hdr->seg_count); i++) {
1816− struct ice_generic_seg_hdr *seg;
1816+ const struct ice_generic_seg_hdr *seg;
18171817
1818− seg = (struct ice_generic_seg_hdr
1819− *)((u8 *)pkg_hdr +
1820− le32_to_cpu(pkg_hdr->seg_offset[i]));
1818+ seg = (void *)pkg_hdr + le32_to_cpu(pkg_hdr->seg_offset[i]);
18211819
18221820 if (le32_to_cpu(seg->seg_type) == seg_type)
18231821 return seg;
@@ -2354,12 +2352,12 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size, · 530 unmodified lines
23542352 *
23552353 * Return: zero when update was successful, negative values otherwise.
23562354 */
2357−int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)
2355+int ice_cfg_tx_topo(struct ice_hw *hw, const void *buf, u32 len)
23582356 {
2359− u8 *current_topo, *new_topo = NULL;
2360− struct ice_run_time_cfg_seg *seg;
2361− struct ice_buf_hdr *section;
2362− struct ice_pkg_hdr *pkg_hdr;
2357+ u8 *new_topo = NULL, *topo __free(kfree) = NULL;
2358+ const struct ice_run_time_cfg_seg *seg;
2359+ const struct ice_buf_hdr *section;
2360+ const struct ice_pkg_hdr *pkg_hdr;
23632361 enum ice_ddp_state state;
23642362 u16 offset, size = 0;
23652363 u32 reg = 0;
@@ -2375,15 +2373,13 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len) · 9 unmodified lines
23752373 return -EOPNOTSUPP;
23762374 }
23772375
2378− current_topo = kzalloc(ICE_AQ_MAX_BUF_LEN, GFP_KERNEL);
2379− if (!current_topo)
2376+ topo = kzalloc(ICE_AQ_MAX_BUF_LEN, GFP_KERNEL);
2377+ if (!topo)
23802378 return -ENOMEM;
23812379
2382− /* Get the current Tx topology */
2383− status = ice_get_set_tx_topo(hw, current_topo, ICE_AQ_MAX_BUF_LEN, NULL,
2384− &flags, false);
2385−
2386− kfree(current_topo);
2380+ /* Get the current Tx topology flags */
2381+ status = ice_get_set_tx_topo(hw, topo, ICE_AQ_MAX_BUF_LEN, NULL, &flags,
2382+ false);
23872383
23882384 if (status) {
23892385 ice_debug(hw, ICE_DBG_INIT, "Get current topology is failed\n");
@@ -2419,7 +2415,7 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len) · 29 unmodified lines
24192415 goto update_topo;
24202416 }
24212417
2422− pkg_hdr = (struct ice_pkg_hdr *)buf;
2418+ pkg_hdr = (const struct ice_pkg_hdr *)buf;
24232419 state = ice_verify_pkg(pkg_hdr, len);
24242420 if (state) {
24252421 ice_debug(hw, ICE_DBG_INIT, "Failed to verify pkg (err: %d)\n",
@@ -2428,7 +2424,7 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len) · 2 unmodified lines
24282424 }
24292425
24302426 /* Find runtime configuration segment */
2431− seg = (struct ice_run_time_cfg_seg *)
2427+ seg = (const struct ice_run_time_cfg_seg *)
24322428 ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE_RUN_TIME_CFG, pkg_hdr);
24332429 if (!seg) {
24342430 ice_debug(hw, ICE_DBG_INIT, "5 layer topology segment is missing\n");
@@ -2461,8 +2457,10 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len) · 26 unmodified lines
24612457 return -EIO;
24622458 }
24632459
2464− /* Get the new topology buffer */
2465− new_topo = ((u8 *)section) + offset;
2460+ /* Get the new topology buffer, reuse current topo copy mem */
2461+ static_assert(ICE_PKG_BUF_SIZE == ICE_AQ_MAX_BUF_LEN);
2462+ new_topo = topo;
2463+ memcpy(new_topo, (u8 *)section + offset, size);
24662464
24672465 update_topo:
24682466 /* Acquire global lock to make sure that set topology issued
drivers/net/ethernet/intel/ice/ice_ddp.h+2−2
@@ -438,7 +438,7 @@ struct ice_pkg_enum { · 437 unmodified lines
438438 u32 buf_idx;
439439
440440 u32 type;
441− struct ice_buf_hdr *buf;
441+ const struct ice_buf_hdr *buf;
442442 u32 sect_idx;
443443 void *sect;
444444 u32 sect_type;
@@ -467,6 +467,6 @@ ice_pkg_enum_entry(struct ice_seg *ice_seg, struct ice_pkg_enum *state, · 22 unmodified lines
467467 void *ice_pkg_enum_section(struct ice_seg *ice_seg, struct ice_pkg_enum *state,
468468 u32 sect_type);
469469
470−int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len);
470+int ice_cfg_tx_topo(struct ice_hw *hw, const void *buf, u32 len);
471471
472472 #endif
drivers/net/ethernet/intel/ice/ice_dpll.c+74−2
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #define ICE_DPLL_PIN_IDX_INVALID 0xff
1111 #define ICE_DPLL_RCLK_NUM_PER_PF 1
1212 #define ICE_DPLL_PIN_ESYNC_PULSE_HIGH_PERCENT 25
13+#define ICE_DPLL_PIN_GEN_RCLK_FREQ 1953125
1314
1415 /**
1516 * enum ice_dpll_pin_type - enumerate ice pin types:
@@ -656,6 +657,8 @@ ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv, · 640 unmodified lines
656657 struct ice_dpll_pin *p = pin_priv;
657658 struct ice_dpll *d = dpll_priv;
658659
660+ if (state == DPLL_PIN_STATE_SELECTABLE)
661+ return -EINVAL;
659662 if (!enable && p->state[d->dpll_idx] == DPLL_PIN_STATE_DISCONNECTED)
660663 return 0;
661664
@@ -1843,6 +1846,8 @@ ice_dpll_init_rclk_pins(struct ice_pf *pf, struct ice_dpll_pin *pin, · 1181 unmodified lines
18431846 struct dpll_pin *parent;
18441847 int ret, i;
18451848
1849+ if (WARN_ON((!vsi || !vsi->netdev)))
1850+ return -EINVAL;
18461851 ret = ice_dpll_get_pins(pf, pin, start_idx, ICE_DPLL_RCLK_NUM_PER_PF,
18471852 pf->dplls.clock_id);
18481853 if (ret)
@@ -1858,8 +1863,6 @@ ice_dpll_init_rclk_pins(struct ice_pf *pf, struct ice_dpll_pin *pin, · 9 unmodified lines
18581863 if (ret)
18591864 goto unregister_pins;
18601865 }
1861− if (WARN_ON((!vsi || !vsi->netdev)))
1862− return -EINVAL;
18631866 dpll_netdev_pin_set(vsi->netdev, pf->dplls.rclk.pin);
18641867
18651868 return 0;
@@ -2061,6 +2064,73 @@ static int ice_dpll_init_worker(struct ice_pf *pf) · 195 unmodified lines
20612064 return 0;
20622065 }
20632066
2067+/**
2068+ * ice_dpll_init_info_pins_generic - initializes generic pins info
2069+ * @pf: board private structure
2070+ * @input: if input pins initialized
2071+ *
2072+ * Init information for generic pins, cache them in PF's pins structures.
2073+ *
2074+ * Return:
2075+ * * 0 - success
2076+ * * negative - init failure reason
2077+ */
2078+static int ice_dpll_init_info_pins_generic(struct ice_pf *pf, bool input)
2079+{
2080+ struct ice_dpll *de = &pf->dplls.eec, *dp = &pf->dplls.pps;
2081+ static const char labels[][sizeof("99")] = {
2082+ "0", "1", "2", "3", "4", "5", "6", "7", "8",
2083+ "9", "10", "11", "12", "13", "14", "15" };
2084+ u32 cap = DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE;
2085+ enum ice_dpll_pin_type pin_type;
2086+ int i, pin_num, ret = -EINVAL;
2087+ struct ice_dpll_pin *pins;
2088+ u32 phase_adj_max;
2089+
2090+ if (input) {
2091+ pin_num = pf->dplls.num_inputs;
2092+ pins = pf->dplls.inputs;
2093+ phase_adj_max = pf->dplls.input_phase_adj_max;
2094+ pin_type = ICE_DPLL_PIN_TYPE_INPUT;
2095+ cap |= DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE;
2096+ } else {
2097+ pin_num = pf->dplls.num_outputs;
2098+ pins = pf->dplls.outputs;
2099+ phase_adj_max = pf->dplls.output_phase_adj_max;
2100+ pin_type = ICE_DPLL_PIN_TYPE_OUTPUT;
2101+ }
2102+ if (pin_num > ARRAY_SIZE(labels))
2103+ return ret;
2104+
2105+ for (i = 0; i < pin_num; i++) {
2106+ pins[i].idx = i;
2107+ pins[i].prop.board_label = labels[i];
2108+ pins[i].prop.phase_range.min = phase_adj_max;
2109+ pins[i].prop.phase_range.max = -phase_adj_max;
2110+ pins[i].prop.capabilities = cap;
2111+ pins[i].pf = pf;
2112+ ret = ice_dpll_pin_state_update(pf, &pins[i], pin_type, NULL);
2113+ if (ret)
2114+ break;
2115+ if (input && pins[i].freq == ICE_DPLL_PIN_GEN_RCLK_FREQ)
2116+ pins[i].prop.type = DPLL_PIN_TYPE_MUX;
2117+ else
2118+ pins[i].prop.type = DPLL_PIN_TYPE_EXT;
2119+ if (!input)
2120+ continue;
2121+ ret = ice_aq_get_cgu_ref_prio(&pf->hw, de->dpll_idx, i,
2122+ &de->input_prio[i]);
2123+ if (ret)
2124+ break;
2125+ ret = ice_aq_get_cgu_ref_prio(&pf->hw, dp->dpll_idx, i,
2126+ &dp->input_prio[i]);
2127+ if (ret)
2128+ break;
2129+ }
2130+
2131+ return ret;
2132+}
2133+
20642134 /**
20652135 * ice_dpll_init_info_direct_pins - initializes direct pins info
20662136 * @pf: board private structure
@@ -2099,6 +2169,8 @@ ice_dpll_init_info_direct_pins(struct ice_pf *pf, · 32 unmodified lines
20992169 default:
21002170 return -EINVAL;
21012171 }
2172+ if (num_pins != ice_cgu_get_num_pins(hw, input))
2173+ return ice_dpll_init_info_pins_generic(pf, input);
21022174
21032175 for (i = 0; i < num_pins; i++) {
21042176 caps = 0;
drivers/net/ethernet/intel/ice/ice_eswitch_br.c+4−1
@@ -582,10 +582,13 @@ ice_eswitch_br_switchdev_event(struct notifier_block *nb, · 581 unmodified lines
582582 return NOTIFY_DONE;
583583 }
584584
585−static void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge)
585+void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge)
586586 {
587587 struct ice_esw_br_fdb_entry *entry, *tmp;
588588
589+ if (!bridge)
590+ return;
591+
589592 list_for_each_entry_safe(entry, tmp, &bridge->fdb_list, list)
590593 ice_eswitch_br_fdb_entry_notify_and_cleanup(bridge, entry);
591594 }
drivers/net/ethernet/intel/ice/ice_eswitch_br.h+1−0
@@ -117,5 +117,6 @@ void · 116 unmodified lines
117117 ice_eswitch_br_offloads_deinit(struct ice_pf *pf);
118118 int
119119 ice_eswitch_br_offloads_init(struct ice_pf *pf);
120+void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge);
120121
121122 #endif /* _ICE_ESWITCH_BR_H_ */
drivers/net/ethernet/intel/ice/ice_main.c+7−32
@@ -87,7 +87,8 @@ ice_indr_setup_tc_cb(struct net_device *netdev, struct Qdisc *sch, · 86 unmodified lines
8787
8888 bool netif_is_ice(const struct net_device *dev)
8989 {
90− return dev && (dev->netdev_ops == &ice_netdev_ops);
90+ return dev && (dev->netdev_ops == &ice_netdev_ops ||
91+ dev->netdev_ops == &ice_netdev_safe_mode_ops);
9192 }
9293
9394 /**
@@ -520,25 +521,6 @@ static void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked) · 426 unmodified lines
520521 pf->vf_agg_node[node].num_vsis = 0;
521522 }
522523
523−/**
524− * ice_clear_sw_switch_recipes - clear switch recipes
525− * @pf: board private structure
526− *
527− * Mark switch recipes as not created in sw structures. There are cases where
528− * rules (especially advanced rules) need to be restored, either re-read from
529− * hardware or added again. For example after the reset. 'recp_created' flag
530− * prevents from doing that and need to be cleared upfront.
531− */
532−static void ice_clear_sw_switch_recipes(struct ice_pf *pf)
533−{
534− struct ice_sw_recipe *recp;
535− u8 i;
536−
537− recp = pf->hw.switch_info->recp_list;
538− for (i = 0; i < ICE_MAX_NUM_RECIPES; i++)
539− recp[i].recp_created = false;
540−}
541−
542524 /**
543525 * ice_prepare_for_reset - prep for reset
544526 * @pf: board private structure
@@ -575,8 +557,9 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type) · 30 unmodified lines
575557 mutex_unlock(&pf->vfs.table_lock);
576558
577559 if (ice_is_eswitch_mode_switchdev(pf)) {
578− if (reset_type != ICE_RESET_PFR)
579− ice_clear_sw_switch_recipes(pf);
560+ rtnl_lock();
561+ ice_eswitch_br_fdb_flush(pf->eswitch.br_offloads->bridge);
562+ rtnl_unlock();
580563 }
581564
582565 /* release ADQ specific HW and SW resources */
@@ -4536,16 +4519,10 @@ ice_init_tx_topology(struct ice_hw *hw, const struct firmware *firmware) · 3953 unmodified lines
45364519 u8 num_tx_sched_layers = hw->num_tx_sched_layers;
45374520 struct ice_pf *pf = hw->back;
45384521 struct device *dev;
4539− u8 *buf_copy;
45404522 int err;
45414523
45424524 dev = ice_pf_to_dev(pf);
4543− /* ice_cfg_tx_topo buf argument is not a constant,
4544− * so we have to make a copy
4545− */
4546− buf_copy = kmemdup(firmware->data, firmware->size, GFP_KERNEL);
4547−
4548− err = ice_cfg_tx_topo(hw, buf_copy, firmware->size);
4525+ err = ice_cfg_tx_topo(hw, firmware->data, firmware->size);
45494526 if (!err) {
45504527 if (hw->num_tx_sched_layers > num_tx_sched_layers)
45514528 dev_info(dev, "Tx scheduling layers switching feature disabled\n");
@@ -4773,14 +4750,12 @@ int ice_init_dev(struct ice_pf *pf) · 221 unmodified lines
47734750 ice_init_feature_support(pf);
47744751
47754752 err = ice_init_ddp_config(hw, pf);
4776− if (err)
4777− return err;
47784753
47794754 /* if ice_init_ddp_config fails, ICE_FLAG_ADV_FEATURES bit won't be
47804755 * set in pf->state, which will cause ice_is_safe_mode to return
47814756 * true
47824757 */
4783− if (ice_is_safe_mode(pf)) {
4758+ if (err || ice_is_safe_mode(pf)) {
47844759 /* we already got function/device capabilities but these don't
47854760 * reflect what the driver needs to do in safe mode. Instead of
47864761 * adding conditional logic everywhere to ignore these
drivers/net/ethernet/intel/ice/ice_ptp_hw.c+19−2
@@ -34,7 +34,6 @@ static const struct ice_cgu_pin_desc ice_e810t_sfp_cgu_inputs[] = { · 33 unmodified lines
3434 ARRAY_SIZE(ice_cgu_pin_freq_common), ice_cgu_pin_freq_common },
3535 { "GNSS-1PPS", ZL_REF4P, DPLL_PIN_TYPE_GNSS,
3636 ARRAY_SIZE(ice_cgu_pin_freq_1_hz), ice_cgu_pin_freq_1_hz },
37− { "OCXO", ZL_REF4N, DPLL_PIN_TYPE_INT_OSCILLATOR, 0, },
3837 };
3938
4039 static const struct ice_cgu_pin_desc ice_e810t_qsfp_cgu_inputs[] = {
@@ -52,7 +51,6 @@ static const struct ice_cgu_pin_desc ice_e810t_qsfp_cgu_inputs[] = { · 11 unmodified lines
5251 ARRAY_SIZE(ice_cgu_pin_freq_common), ice_cgu_pin_freq_common },
5352 { "GNSS-1PPS", ZL_REF4P, DPLL_PIN_TYPE_GNSS,
5453 ARRAY_SIZE(ice_cgu_pin_freq_1_hz), ice_cgu_pin_freq_1_hz },
55− { "OCXO", ZL_REF4N, DPLL_PIN_TYPE_INT_OSCILLATOR, },
5654 };
5755
5856 static const struct ice_cgu_pin_desc ice_e810t_sfp_cgu_outputs[] = {
@@ -5964,6 +5962,25 @@ ice_cgu_get_pin_desc(struct ice_hw *hw, bool input, int *size) · 5905 unmodified lines
59645962 return t;
59655963 }
59665964
5965+/**
5966+ * ice_cgu_get_num_pins - get pin description array size
5967+ * @hw: pointer to the hw struct
5968+ * @input: if request is done against input or output pins
5969+ *
5970+ * Return: size of pin description array for given hw.
5971+ */
5972+int ice_cgu_get_num_pins(struct ice_hw *hw, bool input)
5973+{
5974+ const struct ice_cgu_pin_desc *t;
5975+ int size;
5976+
5977+ t = ice_cgu_get_pin_desc(hw, input, &size);
5978+ if (t)
5979+ return size;
5980+
5981+ return 0;
5982+}
5983+
59675984 /**
59685985 * ice_cgu_get_pin_type - get pin's type
59695986 * @hw: pointer to the hw struct
drivers/net/ethernet/intel/ice/ice_ptp_hw.h+1−0
@@ -404,6 +404,7 @@ int ice_read_sma_ctrl_e810t(struct ice_hw *hw, u8 *data); · 403 unmodified lines
404404 int ice_write_sma_ctrl_e810t(struct ice_hw *hw, u8 data);
405405 int ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data);
406406 bool ice_is_pca9575_present(struct ice_hw *hw);
407+int ice_cgu_get_num_pins(struct ice_hw *hw, bool input);
407408 enum dpll_pin_type ice_cgu_get_pin_type(struct ice_hw *hw, u8 pin, bool input);
408409 struct dpll_pin_frequency *
409410 ice_cgu_get_pin_freq_supp(struct ice_hw *hw, u8 pin, bool input, u8 *num);
drivers/net/ethernet/intel/ice/ice_sriov.c+14−5
@@ -1096,8 +1096,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count) · 1095 unmodified lines
10961096 return -ENOENT;
10971097
10981098 vsi = ice_get_vf_vsi(vf);
1099− if (!vsi)
1099+ if (!vsi) {
1100+ ice_put_vf(vf);
11001101 return -ENOENT;
1102+ }
11011103
11021104 prev_msix = vf->num_msix;
11031105 prev_queues = vf->num_vf_qs;
@@ -1119,7 +1121,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count) · 15 unmodified lines
11191121 if (vf->first_vector_idx < 0)
11201122 goto unroll;
11211123
1122− if (ice_vf_reconfig_vsi(vf) || ice_vf_init_host_cfg(vf, vsi)) {
1124+ vsi->req_txq = queues;
1125+ vsi->req_rxq = queues;
1126+
1127+ if (ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT)) {
11231128 /* Try to rebuild with previous values */
11241129 needs_rebuild = true;
11251130 goto unroll;
@@ -1142,12 +1147,16 @@ unroll: · 16 unmodified lines
11421147 vf->num_msix = prev_msix;
11431148 vf->num_vf_qs = prev_queues;
11441149 vf->first_vector_idx = ice_sriov_get_irqs(pf, vf->num_msix);
1145− if (vf->first_vector_idx < 0)
1150+ if (vf->first_vector_idx < 0) {
1151+ ice_put_vf(vf);
11461152 return -EINVAL;
1153+ }
11471154
11481155 if (needs_rebuild) {
1149− ice_vf_reconfig_vsi(vf);
1150− ice_vf_init_host_cfg(vf, vsi);
1156+ vsi->req_txq = prev_queues;
1157+ vsi->req_rxq = prev_queues;
1158+
1159+ ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
11511160 }
11521161
11531162 ice_ena_vf_mappings(vf);
drivers/net/ethernet/intel/ice/ice_switch.c+0−2
@@ -6322,8 +6322,6 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id, · 6321 unmodified lines
63226322 if (!itr->vsi_list_info ||
63236323 !test_bit(vsi_handle, itr->vsi_list_info->vsi_map))
63246324 continue;
6325− /* Clearing it so that the logic can add it back */
6326− clear_bit(vsi_handle, itr->vsi_list_info->vsi_map);
63276325 f_entry.fltr_info.vsi_handle = vsi_handle;
63286326 f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI;
63296327 /* update the src in case it is VSI num */
drivers/net/ethernet/intel/ice/ice_tc_lib.c+11−0
@@ -819,6 +819,17 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr) · 818 unmodified lines
819819 rule_info.sw_act.flag |= ICE_FLTR_TX;
820820 rule_info.sw_act.src = vsi->idx;
821821 rule_info.flags_info.act = ICE_SINGLE_ACT_LAN_ENABLE;
822+ /* This is a specific case. The destination VSI index is
823+ * overwritten by the source VSI index. This type of filter
824+ * should allow the packet to go to the LAN, not to the
825+ * VSI passed here. It should set LAN_EN bit only. However,
826+ * the VSI must be a valid one. Setting source VSI index
827+ * here is safe. Even if the result from switch is set LAN_EN
828+ * and LB_EN (which normally will pass the packet to this VSI)
829+ * packet won't be seen on the VSI, because local loopback is
830+ * turned off.
831+ */
832+ rule_info.sw_act.vsi_handle = vsi->idx;
822833 } else {
823834 /* VF to VF */
824835 rule_info.sw_act.flag |= ICE_FLTR_TX;
drivers/net/ethernet/intel/ice/ice_vf_lib.c+8−1
@@ -256,7 +256,7 @@ static void ice_vf_pre_vsi_rebuild(struct ice_vf *vf) · 255 unmodified lines
256256 *
257257 * It brings the VSI down and then reconfigures it with the hardware.
258258 */
259−int ice_vf_reconfig_vsi(struct ice_vf *vf)
259+static int ice_vf_reconfig_vsi(struct ice_vf *vf)
260260 {
261261 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
262262 struct ice_pf *pf = vf->pf;
@@ -335,6 +335,13 @@ static int ice_vf_rebuild_host_vlan_cfg(struct ice_vf *vf, struct ice_vsi *vsi) · 72 unmodified lines
335335
336336 err = vlan_ops->add_vlan(vsi, &vf->port_vlan_info);
337337 } else {
338+ /* clear possible previous port vlan config */
339+ err = ice_vsi_clear_port_vlan(vsi);
340+ if (err) {
341+ dev_err(dev, "failed to clear port VLAN via VSI parameters for VF %u, error %d\n",
342+ vf->vf_id, err);
343+ return err;
344+ }
338345 err = ice_vsi_add_vlan_zero(vsi);
339346 }
340347
drivers/net/ethernet/intel/ice/ice_vf_lib_private.h+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #warning "Only include ice_vf_lib_private.h in CONFIG_PCI_IOV virtualization files"
2424 #endif
2525
26−int ice_vf_reconfig_vsi(struct ice_vf *vf);
2726 void ice_initialize_vf_entry(struct ice_vf *vf);
2827 void ice_dis_vf_qs(struct ice_vf *vf);
2928 int ice_check_vf_init(struct ice_vf *vf);
drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c+57−0
@@ -787,3 +787,60 @@ int ice_vsi_clear_outer_port_vlan(struct ice_vsi *vsi) · 786 unmodified lines
787787 kfree(ctxt);
788788 return err;
789789 }
790+
791+int ice_vsi_clear_port_vlan(struct ice_vsi *vsi)
792+{
793+ struct ice_hw *hw = &vsi->back->hw;
794+ struct ice_vsi_ctx *ctxt;
795+ int err;
796+
797+ ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
798+ if (!ctxt)
799+ return -ENOMEM;
800+
801+ ctxt->info = vsi->info;
802+
803+ ctxt->info.port_based_outer_vlan = 0;
804+ ctxt->info.port_based_inner_vlan = 0;
805+
806+ ctxt->info.inner_vlan_flags =
807+ FIELD_PREP(ICE_AQ_VSI_INNER_VLAN_TX_MODE_M,
808+ ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL);
809+ if (ice_is_dvm_ena(hw)) {
810+ ctxt->info.inner_vlan_flags |=
811+ FIELD_PREP(ICE_AQ_VSI_INNER_VLAN_EMODE_M,
812+ ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING);
813+ ctxt->info.outer_vlan_flags =
814+ FIELD_PREP(ICE_AQ_VSI_OUTER_VLAN_TX_MODE_M,
815+ ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ALL);
816+ ctxt->info.outer_vlan_flags |=
817+ FIELD_PREP(ICE_AQ_VSI_OUTER_TAG_TYPE_M,
818+ ICE_AQ_VSI_OUTER_TAG_VLAN_8100);
819+ ctxt->info.outer_vlan_flags |=
820+ ICE_AQ_VSI_OUTER_VLAN_EMODE_NOTHING <<
821+ ICE_AQ_VSI_OUTER_VLAN_EMODE_S;
822+ }
823+
824+ ctxt->info.sw_flags2 &= ~ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA;
825+ ctxt->info.valid_sections =
826+ cpu_to_le16(ICE_AQ_VSI_PROP_OUTER_TAG_VALID |
827+ ICE_AQ_VSI_PROP_VLAN_VALID |
828+ ICE_AQ_VSI_PROP_SW_VALID);
829+
830+ err = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
831+ if (err) {
832+ dev_err(ice_pf_to_dev(vsi->back), "update VSI for clearing port based VLAN failed, err %d aq_err %s\n",
833+ err, ice_aq_str(hw->adminq.sq_last_status));
834+ } else {
835+ vsi->info.port_based_outer_vlan =
836+ ctxt->info.port_based_outer_vlan;
837+ vsi->info.port_based_inner_vlan =
838+ ctxt->info.port_based_inner_vlan;
839+ vsi->info.outer_vlan_flags = ctxt->info.outer_vlan_flags;
840+ vsi->info.inner_vlan_flags = ctxt->info.inner_vlan_flags;
841+ vsi->info.sw_flags2 = ctxt->info.sw_flags2;
842+ }
843+
844+ kfree(ctxt);
845+ return err;
846+}
drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.h+1−0
@@ -36,5 +36,6 @@ int ice_vsi_ena_outer_insertion(struct ice_vsi *vsi, u16 tpid); · 35 unmodified lines
3636 int ice_vsi_dis_outer_insertion(struct ice_vsi *vsi);
3737 int ice_vsi_set_outer_port_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan);
3838 int ice_vsi_clear_outer_port_vlan(struct ice_vsi *vsi);
39+int ice_vsi_clear_port_vlan(struct ice_vsi *vsi);
3940
4041 #endif /* _ICE_VSI_VLAN_LIB_H_ */
drivers/net/ethernet/intel/idpf/idpf_vf_dev.c+1−0
@@ -99,6 +99,7 @@ static int idpf_vf_intr_reg_init(struct idpf_vport *vport) · 98 unmodified lines
9999 intr->dyn_ctl_intena_m = VF_INT_DYN_CTLN_INTENA_M;
100100 intr->dyn_ctl_intena_msk_m = VF_INT_DYN_CTLN_INTENA_MSK_M;
101101 intr->dyn_ctl_itridx_s = VF_INT_DYN_CTLN_ITR_INDX_S;
102+ intr->dyn_ctl_intrvl_s = VF_INT_DYN_CTLN_INTERVAL_S;
102103 intr->dyn_ctl_wb_on_itr_m = VF_INT_DYN_CTLN_WB_ON_ITR_M;
103104
104105 spacing = IDPF_ITR_IDX_SPACING(reg_vals[vec_id].itrn_index_spacing,
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c+2−9
@@ -666,7 +666,7 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter, · 665 unmodified lines
666666
667667 if (ctlq_msg->data_len) {
668668 payload = ctlq_msg->ctx.indirect.payload->va;
669− payload_size = ctlq_msg->ctx.indirect.payload->size;
669+ payload_size = ctlq_msg->data_len;
670670 }
671671
672672 xn->reply_sz = payload_size;
@@ -1295,10 +1295,6 @@ int idpf_send_create_vport_msg(struct idpf_adapter *adapter, · 622 unmodified lines
12951295 err = reply_sz;
12961296 goto free_vport_params;
12971297 }
1298− if (reply_sz < IDPF_CTLQ_MAX_BUF_LEN) {
1299− err = -EIO;
1300− goto free_vport_params;
1301− }
13021298
13031299 return 0;
13041300
@@ -2602,9 +2598,6 @@ int idpf_send_get_rx_ptype_msg(struct idpf_vport *vport) · 1297 unmodified lines
26022598 if (reply_sz < 0)
26032599 return reply_sz;
26042600
2605− if (reply_sz < IDPF_CTLQ_MAX_BUF_LEN)
2606− return -EIO;
2607−
26082601 ptypes_recvd += le16_to_cpu(ptype_info->num_ptypes);
26092602 if (ptypes_recvd > max_ptype)
26102603 return -EINVAL;
@@ -3088,9 +3081,9 @@ void idpf_vc_core_deinit(struct idpf_adapter *adapter) · 477 unmodified lines
30883081 if (!test_bit(IDPF_VC_CORE_INIT, adapter->flags))
30893082 return;
30903083
3091− idpf_vc_xn_shutdown(adapter->vcxn_mngr);
30923084 idpf_deinit_task(adapter);
30933085 idpf_intr_rel(adapter);
3086+ idpf_vc_xn_shutdown(adapter->vcxn_mngr);
30943087
30953088 cancel_delayed_work_sync(&adapter->serv_task);
30963089 cancel_delayed_work_sync(&adapter->mbx_task);
drivers/net/ethernet/intel/igb/igb_main.c+5−1
@@ -907,7 +907,7 @@ static int igb_request_msix(struct igb_adapter *adapter) · 906 unmodified lines
907907 int i, err = 0, vector = 0, free_vector = 0;
908908
909909 err = request_irq(adapter->msix_entries[vector].vector,
910− igb_msix_other, 0, netdev->name, adapter);
910+ igb_msix_other, IRQF_NO_THREAD, netdev->name, adapter);
911911 if (err)
912912 goto err_out;
913913
@@ -9651,6 +9651,10 @@ static void igb_io_resume(struct pci_dev *pdev) · 8737 unmodified lines
96519651 struct igb_adapter *adapter = netdev_priv(netdev);
96529652
96539653 if (netif_running(netdev)) {
9654+ if (!test_bit(__IGB_DOWN, &adapter->state)) {
9655+ dev_dbg(&pdev->dev, "Resuming from non-fatal error, do nothing.\n");
9656+ return;
9657+ }
96549658 if (igb_up(adapter)) {
96559659 dev_err(&pdev->dev, "igb_up failed after reset\n");
96569660 return;
drivers/net/ethernet/marvell/octeon_ep/octep_rx.c+59−23
@@ -336,6 +336,51 @@ static int octep_oq_check_hw_for_pkts(struct octep_device *oct, · 335 unmodified lines
336336 return new_pkts;
337337 }
338338
339+/**
340+ * octep_oq_next_pkt() - Move to the next packet in Rx queue.
341+ *
342+ * @oq: Octeon Rx queue data structure.
343+ * @buff_info: Current packet buffer info.
344+ * @read_idx: Current packet index in the ring.
345+ * @desc_used: Current packet descriptor number.
346+ *
347+ * Free the resources associated with a packet.
348+ * Increment packet index in the ring and packet descriptor number.
349+ */
350+static void octep_oq_next_pkt(struct octep_oq *oq,
351+ struct octep_rx_buffer *buff_info,
352+ u32 *read_idx, u32 *desc_used)
353+{
354+ dma_unmap_page(oq->dev, oq->desc_ring[*read_idx].buffer_ptr,
355+ PAGE_SIZE, DMA_FROM_DEVICE);
356+ buff_info->page = NULL;
357+ (*read_idx)++;
358+ (*desc_used)++;
359+ if (*read_idx == oq->max_count)
360+ *read_idx = 0;
361+}
362+
363+/**
364+ * octep_oq_drop_rx() - Free the resources associated with a packet.
365+ *
366+ * @oq: Octeon Rx queue data structure.
367+ * @buff_info: Current packet buffer info.
368+ * @read_idx: Current packet index in the ring.
369+ * @desc_used: Current packet descriptor number.
370+ *
371+ */
372+static void octep_oq_drop_rx(struct octep_oq *oq,
373+ struct octep_rx_buffer *buff_info,
374+ u32 *read_idx, u32 *desc_used)
375+{
376+ int data_len = buff_info->len - oq->max_single_buffer_size;
377+
378+ while (data_len > 0) {
379+ octep_oq_next_pkt(oq, buff_info, read_idx, desc_used);
380+ data_len -= oq->buffer_size;
381+ };
382+}
383+
339384 /**
340385 * __octep_oq_process_rx() - Process hardware Rx queue and push to stack.
341386 *
@@ -367,10 +412,7 @@ static int __octep_oq_process_rx(struct octep_device *oct, · 25 unmodified lines
367412 desc_used = 0;
368413 for (pkt = 0; pkt < pkts_to_process; pkt++) {
369414 buff_info = (struct octep_rx_buffer *)&oq->buff_info[read_idx];
370− dma_unmap_page(oq->dev, oq->desc_ring[read_idx].buffer_ptr,
371− PAGE_SIZE, DMA_FROM_DEVICE);
372415 resp_hw = page_address(buff_info->page);
373− buff_info->page = NULL;
374416
375417 /* Swap the length field that is in Big-Endian to CPU */
376418 buff_info->len = be64_to_cpu(resp_hw->length);
@@ -394,36 +436,33 @@ static int __octep_oq_process_rx(struct octep_device *oct, · 17 unmodified lines
394436 data_offset = OCTEP_OQ_RESP_HW_SIZE;
395437 rx_ol_flags = 0;
396438 }
439+
440+ octep_oq_next_pkt(oq, buff_info, &read_idx, &desc_used);
441+
442+ skb = build_skb((void *)resp_hw, PAGE_SIZE);
443+ if (!skb) {
444+ octep_oq_drop_rx(oq, buff_info,
445+ &read_idx, &desc_used);
446+ oq->stats.alloc_failures++;
447+ continue;
448+ }
449+ skb_reserve(skb, data_offset);
450+
397451 rx_bytes += buff_info->len;
398452
399453 if (buff_info->len <= oq->max_single_buffer_size) {
400− skb = build_skb((void *)resp_hw, PAGE_SIZE);
401− skb_reserve(skb, data_offset);
402454 skb_put(skb, buff_info->len);
403− read_idx++;
404− desc_used++;
405− if (read_idx == oq->max_count)
406− read_idx = 0;
407455 } else {
408456 struct skb_shared_info *shinfo;
409457 u16 data_len;
410458
411− skb = build_skb((void *)resp_hw, PAGE_SIZE);
412− skb_reserve(skb, data_offset);
413459 /* Head fragment includes response header(s);
414460 * subsequent fragments contains only data.
415461 */
416462 skb_put(skb, oq->max_single_buffer_size);
417− read_idx++;
418− desc_used++;
419− if (read_idx == oq->max_count)
420− read_idx = 0;
421−
422463 shinfo = skb_shinfo(skb);
423464 data_len = buff_info->len - oq->max_single_buffer_size;
424465 while (data_len) {
425− dma_unmap_page(oq->dev, oq->desc_ring[read_idx].buffer_ptr,
426− PAGE_SIZE, DMA_FROM_DEVICE);
427466 buff_info = (struct octep_rx_buffer *)
428467 &oq->buff_info[read_idx];
429468 if (data_len < oq->buffer_size) {
@@ -438,11 +477,8 @@ static int __octep_oq_process_rx(struct octep_device *oct, · 8 unmodified lines
438477 buff_info->page, 0,
439478 buff_info->len,
440479 buff_info->len);
441− buff_info->page = NULL;
442− read_idx++;
443− desc_used++;
444− if (read_idx == oq->max_count)
445− read_idx = 0;
480+
481+ octep_oq_next_pkt(oq, buff_info, &read_idx, &desc_used);
446482 }
447483 }
448484
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c+2−2
@@ -2411,7 +2411,7 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, · 2410 unmodified lines
24112411 NIX_AF_TL3_TL2X_LINKX_CFG(tl2_tl3_link_schq, link));
24122412 if (!(cfg & BIT_ULL(12)))
24132413 continue;
2414− bmap |= (1 << i);
2414+ bmap |= BIT_ULL(i);
24152415 cfg &= ~BIT_ULL(12);
24162416 rvu_write64(rvu, blkaddr,
24172417 NIX_AF_TL3_TL2X_LINKX_CFG(tl2_tl3_link_schq, link), cfg);
@@ -2432,7 +2432,7 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, · 14 unmodified lines
24322432
24332433 /* Set NIX_AF_TL3_TL2_LINKX_CFG[ENA] for the TL3/TL2 queue */
24342434 for (i = 0; i < (rvu->hw->cgx_links + rvu->hw->lbk_links); i++) {
2435− if (!(bmap & (1 << i)))
2435+ if (!(bmap & BIT_ULL(i)))
24362436 continue;
24372437 cfg = rvu_read64(rvu, blkaddr,
24382438 NIX_AF_TL3_TL2X_LINKX_CFG(tl2_tl3_link_schq, link));
drivers/net/ethernet/mediatek/airoha_eth.c+5−4
@@ -2471,10 +2471,6 @@ static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb, · 2470 unmodified lines
24712471 e->dma_addr = addr;
24722472 e->dma_len = len;
24732473
2474− airoha_qdma_rmw(qdma, REG_TX_CPU_IDX(qid),
2475− TX_RING_CPU_IDX_MASK,
2476− FIELD_PREP(TX_RING_CPU_IDX_MASK, index));
2477−
24782474 data = skb_frag_address(frag);
24792475 len = skb_frag_size(frag);
24802476 }
@@ -2483,6 +2479,11 @@ static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb, · 2 unmodified lines
24832479 q->queued += i;
24842480
24852481 skb_tx_timestamp(skb);
2482+ if (!netdev_xmit_more())
2483+ airoha_qdma_rmw(qdma, REG_TX_CPU_IDX(qid),
2484+ TX_RING_CPU_IDX_MASK,
2485+ FIELD_PREP(TX_RING_CPU_IDX_MASK, q->head));
2486+
24862487 if (q->ndesc - q->queued < q->free_thr)
24872488 netif_tx_stop_queue(txq);
24882489
drivers/net/ethernet/mediatek/mtk_eth_soc.c+1−1
@@ -1171,7 +1171,7 @@ static int mtk_init_fq_dma(struct mtk_eth *eth) · 1170 unmodified lines
11711171 if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
11721172 return -ENOMEM;
11731173
1174− for (i = 0; i < cnt; i++) {
1174+ for (i = 0; i < len; i++) {
11751175 struct mtk_tx_dma_v2 *txd;
11761176
11771177 txd = eth->scratch_ring + (j * MTK_FQ_DMA_LENGTH + i) * soc->tx.desc_size;
drivers/net/ethernet/mediatek/mtk_wed_wo.h+2−2
@@ -91,8 +91,8 @@ enum mtk_wed_dummy_cr_idx { · 90 unmodified lines
9191 #define MT7981_FIRMWARE_WO "mediatek/mt7981_wo.bin"
9292 #define MT7986_FIRMWARE_WO0 "mediatek/mt7986_wo_0.bin"
9393 #define MT7986_FIRMWARE_WO1 "mediatek/mt7986_wo_1.bin"
94−#define MT7988_FIRMWARE_WO0 "mediatek/mt7988_wo_0.bin"
95−#define MT7988_FIRMWARE_WO1 "mediatek/mt7988_wo_1.bin"
94+#define MT7988_FIRMWARE_WO0 "mediatek/mt7988/mt7988_wo_0.bin"
95+#define MT7988_FIRMWARE_WO1 "mediatek/mt7988/mt7988_wo_1.bin"
9696
9797 #define MTK_WO_MCU_CFG_LS_BASE 0
9898 #define MTK_WO_MCU_CFG_LS_HW_VER_ADDR (MTK_WO_MCU_CFG_LS_BASE + 0x000)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+6−2
@@ -1765,6 +1765,10 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force · 1764 unmodified lines
17651765 }
17661766 }
17671767
1768+#define MLX5_MAX_MANAGE_PAGES_CMD_ENT 1
1769+#define MLX5_CMD_MASK ((1UL << (cmd->vars.max_reg_cmds + \
1770+ MLX5_MAX_MANAGE_PAGES_CMD_ENT)) - 1)
1771+
17681772 static void mlx5_cmd_trigger_completions(struct mlx5_core_dev *dev)
17691773 {
17701774 struct mlx5_cmd *cmd = &dev->cmd;
@@ -1776,7 +1780,7 @@ static void mlx5_cmd_trigger_completions(struct mlx5_core_dev *dev) · 5 unmodified lines
17761780 /* wait for pending handlers to complete */
17771781 mlx5_eq_synchronize_cmd_irq(dev);
17781782 spin_lock_irqsave(&dev->cmd.alloc_lock, flags);
1779− vector = ~dev->cmd.vars.bitmask & ((1ul << (1 << dev->cmd.vars.log_sz)) - 1);
1783+ vector = ~dev->cmd.vars.bitmask & MLX5_CMD_MASK;
17801784 if (!vector)
17811785 goto no_trig;
17821786
@@ -2361,7 +2365,7 @@ int mlx5_cmd_enable(struct mlx5_core_dev *dev) · 578 unmodified lines
23612365
23622366 cmd->state = MLX5_CMDIF_STATE_DOWN;
23632367 cmd->vars.max_reg_cmds = (1 << cmd->vars.log_sz) - 1;
2364− cmd->vars.bitmask = (1UL << cmd->vars.max_reg_cmds) - 1;
2368+ cmd->vars.bitmask = MLX5_CMD_MASK;
23652369
23662370 sema_init(&cmd->vars.sem, cmd->vars.max_reg_cmds);
23672371 sema_init(&cmd->vars.pages_sem, 1);
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+3−1
@@ -6509,7 +6509,9 @@ static void _mlx5e_remove(struct auxiliary_device *adev) · 6508 unmodified lines
65096509 mlx5e_dcbnl_delete_app(priv);
65106510 unregister_netdev(priv->netdev);
65116511 _mlx5e_suspend(adev, false);
6512− priv->profile->cleanup(priv);
6512+ /* Avoid cleanup if profile rollback failed. */
6513+ if (priv->profile)
6514+ priv->profile->cleanup(priv);
65136515 mlx5e_destroy_netdev(priv);
65146516 mlx5e_devlink_port_unregister(mlx5e_dev);
65156517 mlx5e_destroy_devlink(mlx5e_dev);
drivers/net/ethernet/mellanox/mlx5/core/eq.c+6−0
@@ -1061,6 +1061,12 @@ int mlx5_comp_eqn_get(struct mlx5_core_dev *dev, u16 vecidx, int *eqn) · 1060 unmodified lines
10611061 struct mlx5_eq_comp *eq;
10621062 int ret = 0;
10631063
1064+ if (vecidx >= table->max_comp_eqs) {
1065+ mlx5_core_dbg(dev, "Requested vector index %u should be less than %u",
1066+ vecidx, table->max_comp_eqs);
1067+ return -EINVAL;
1068+ }
1069+
10641070 mutex_lock(&table->comp_lock);
10651071 eq = xa_load(&table->comp_eqs, vecidx);
10661072 if (eq) {
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+3−2
@@ -1489,7 +1489,7 @@ int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int num_vfs) · 1488 unmodified lines
14891489 }
14901490
14911491 if (err)
1492− goto abort;
1492+ goto err_esw_enable;
14931493
14941494 esw->fdb_table.flags |= MLX5_ESW_FDB_CREATED;
14951495
@@ -1503,7 +1503,8 @@ int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int num_vfs) · 7 unmodified lines
15031503
15041504 return 0;
15051505
1506−abort:
1506+err_esw_enable:
1507+ mlx5_eq_notifier_unregister(esw->dev, &esw->nb);
15071508 mlx5_esw_acls_ns_cleanup(esw);
15081509 return err;
15091510 }
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c+1−3
@@ -691,7 +691,6 @@ static int hws_bwc_matcher_move(struct mlx5hws_bwc_matcher *bwc_matcher) · 690 unmodified lines
691691 static int
692692 hws_bwc_matcher_rehash_size(struct mlx5hws_bwc_matcher *bwc_matcher)
693693 {
694− u32 num_of_rules;
695694 int ret;
696695
697696 /* If the current matcher size is already at its max size, we can't
@@ -705,8 +704,7 @@ hws_bwc_matcher_rehash_size(struct mlx5hws_bwc_matcher *bwc_matcher) · 7 unmodified lines
705704 * Need to check again if we really need rehash.
706705 * If the reason for rehash was size, but not any more - skip rehash.
707706 */
708− num_of_rules = __atomic_load_n(&bwc_matcher->num_of_rules, __ATOMIC_RELAXED);
709− if (!hws_bwc_matcher_rehash_size_needed(bwc_matcher, num_of_rules))
707+ if (!hws_bwc_matcher_rehash_size_needed(bwc_matcher, bwc_matcher->num_of_rules))
710708 return 0;
711709
712710 /* Now we're done all the checking - do the rehash:
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.h+1−0
@@ -46,6 +46,7 @@ struct mlx5hws_context { · 45 unmodified lines
4646 struct mlx5hws_send_engine *send_queue;
4747 size_t queues;
4848 struct mutex *bwc_send_queue_locks; /* protect BWC queues */
49+ struct lock_class_key *bwc_lock_class_keys;
4950 struct list_head tbl_list;
5051 struct mlx5hws_context_debug_info debug_info;
5152 struct xarray peer_ctx_xa;
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c+2−2
@@ -1925,7 +1925,7 @@ mlx5hws_definer_calc_layout(struct mlx5hws_context *ctx, · 1924 unmodified lines
19251925 ret = hws_definer_conv_match_params_to_hl(ctx, mt, match_hl);
19261926 if (ret) {
19271927 mlx5hws_err(ctx, "Failed to convert items to header layout\n");
1928− goto free_fc;
1928+ goto free_match_hl;
19291929 }
19301930
19311931 /* Find the match definer layout for header layout match union */
@@ -1946,7 +1946,7 @@ mlx5hws_definer_calc_layout(struct mlx5hws_context *ctx, · 14 unmodified lines
19461946
19471947 free_fc:
19481948 kfree(mt->fc);
1949−
1949+free_match_hl:
19501950 kfree(match_hl);
19511951 return ret;
19521952 }
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c+19−3
@@ -941,14 +941,18 @@ static void __hws_send_queues_close(struct mlx5hws_context *ctx, u16 queues) · 940 unmodified lines
941941
942942 static void hws_send_queues_bwc_locks_destroy(struct mlx5hws_context *ctx)
943943 {
944− int bwc_queues = ctx->queues - 1;
944+ int bwc_queues = mlx5hws_bwc_queues(ctx);
945945 int i;
946946
947947 if (!mlx5hws_context_bwc_supported(ctx))
948948 return;
949949
950− for (i = 0; i < bwc_queues; i++)
950+ for (i = 0; i < bwc_queues; i++) {
951951 mutex_destroy(&ctx->bwc_send_queue_locks[i]);
952+ lockdep_unregister_key(ctx->bwc_lock_class_keys + i);
953+ }
954+
955+ kfree(ctx->bwc_lock_class_keys);
952956 kfree(ctx->bwc_send_queue_locks);
953957 }
954958
@@ -977,10 +981,22 @@ static int hws_bwc_send_queues_init(struct mlx5hws_context *ctx) · 22 unmodified lines
977981 if (!ctx->bwc_send_queue_locks)
978982 return -ENOMEM;
979983
980− for (i = 0; i < bwc_queues; i++)
984+ ctx->bwc_lock_class_keys = kcalloc(bwc_queues,
985+ sizeof(*ctx->bwc_lock_class_keys),
986+ GFP_KERNEL);
987+ if (!ctx->bwc_lock_class_keys)
988+ goto err_lock_class_keys;
989+
990+ for (i = 0; i < bwc_queues; i++) {
981991 mutex_init(&ctx->bwc_send_queue_locks[i]);
992+ lockdep_register_key(ctx->bwc_lock_class_keys + i);
993+ }
982994
983995 return 0;
996+
997+err_lock_class_keys:
998+ kfree(ctx->bwc_send_queue_locks);
999+ return -ENOMEM;
9841000 }
9851001
9861002 int mlx5hws_send_queues_open(struct mlx5hws_context *ctx,
drivers/net/ethernet/mellanox/mlxsw/pci.c+17−8
@@ -389,15 +389,27 @@ static void mlxsw_pci_wqe_frag_unmap(struct mlxsw_pci *mlxsw_pci, char *wqe, · 388 unmodified lines
389389 dma_unmap_single(&pdev->dev, mapaddr, frag_len, direction);
390390 }
391391
392−static struct sk_buff *mlxsw_pci_rdq_build_skb(struct page *pages[],
392+static struct sk_buff *mlxsw_pci_rdq_build_skb(struct mlxsw_pci_queue *q,
393+ struct page *pages[],
393394 u16 byte_count)
394395 {
396+ struct mlxsw_pci_queue *cq = q->u.rdq.cq;
395397 unsigned int linear_data_size;
398+ struct page_pool *page_pool;
396399 struct sk_buff *skb;
397400 int page_index = 0;
398401 bool linear_only;
399402 void *data;
400403
404+ linear_only = byte_count + MLXSW_PCI_RX_BUF_SW_OVERHEAD <= PAGE_SIZE;
405+ linear_data_size = linear_only ? byte_count :
406+ PAGE_SIZE -
407+ MLXSW_PCI_RX_BUF_SW_OVERHEAD;
408+
409+ page_pool = cq->u.cq.page_pool;
410+ page_pool_dma_sync_for_cpu(page_pool, pages[page_index],
411+ MLXSW_PCI_SKB_HEADROOM, linear_data_size);
412+
401413 data = page_address(pages[page_index]);
402414 net_prefetch(data);
403415
@@ -405,11 +417,6 @@ static struct sk_buff *mlxsw_pci_rdq_build_skb(struct page *pages[], · 1 unmodified line
405417 if (unlikely(!skb))
406418 return ERR_PTR(-ENOMEM);
407419
408− linear_only = byte_count + MLXSW_PCI_RX_BUF_SW_OVERHEAD <= PAGE_SIZE;
409− linear_data_size = linear_only ? byte_count :
410− PAGE_SIZE -
411− MLXSW_PCI_RX_BUF_SW_OVERHEAD;
412−
413420 skb_reserve(skb, MLXSW_PCI_SKB_HEADROOM);
414421 skb_put(skb, linear_data_size);
415422
@@ -425,6 +432,7 @@ static struct sk_buff *mlxsw_pci_rdq_build_skb(struct page *pages[], · 9 unmodified lines
425432
426433 page = pages[page_index];
427434 frag_size = min(byte_count, PAGE_SIZE);
435+ page_pool_dma_sync_for_cpu(page_pool, page, 0, frag_size);
428436 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
429437 page, 0, frag_size, PAGE_SIZE);
430438 byte_count -= frag_size;
@@ -760,7 +768,7 @@ static void mlxsw_pci_cqe_rdq_handle(struct mlxsw_pci *mlxsw_pci, · 329 unmodified lines
760768 if (err)
761769 goto out;
762770
763− skb = mlxsw_pci_rdq_build_skb(pages, byte_count);
771+ skb = mlxsw_pci_rdq_build_skb(q, pages, byte_count);
764772 if (IS_ERR(skb)) {
765773 dev_err_ratelimited(&pdev->dev, "Failed to build skb for RDQ\n");
766774 mlxsw_pci_rdq_pages_recycle(q, pages, num_sg_entries);
@@ -988,12 +996,13 @@ static int mlxsw_pci_cq_page_pool_init(struct mlxsw_pci_queue *q, · 221 unmodified lines
988996 if (cq_type != MLXSW_PCI_CQ_RDQ)
989997 return 0;
990998
991− pp_params.flags = PP_FLAG_DMA_MAP;
999+ pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
9921000 pp_params.pool_size = MLXSW_PCI_WQE_COUNT * mlxsw_pci->num_sg_entries;
9931001 pp_params.nid = dev_to_node(&mlxsw_pci->pdev->dev);
9941002 pp_params.dev = &mlxsw_pci->pdev->dev;
9951003 pp_params.napi = &q->u.cq.napi;
9961004 pp_params.dma_dir = DMA_FROM_DEVICE;
1005+ pp_params.max_len = PAGE_SIZE;
9971006
9981007 page_pool = page_pool_create(&pp_params);
9991008 if (IS_ERR(page_pool))
drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c+24−2
@@ -481,11 +481,33 @@ mlxsw_sp_ipip_ol_netdev_change_gre6(struct mlxsw_sp *mlxsw_sp, · 480 unmodified lines
481481 struct mlxsw_sp_ipip_entry *ipip_entry,
482482 struct netlink_ext_ack *extack)
483483 {
484+ u32 new_kvdl_index, old_kvdl_index = ipip_entry->dip_kvdl_index;
485+ struct in6_addr old_addr6 = ipip_entry->parms.daddr.addr6;
484486 struct mlxsw_sp_ipip_parms new_parms;
487+ int err;
485488
486489 new_parms = mlxsw_sp_ipip_netdev_parms_init_gre6(ipip_entry->ol_dev);
487− return mlxsw_sp_ipip_ol_netdev_change_gre(mlxsw_sp, ipip_entry,
488− &new_parms, extack);
490+
491+ err = mlxsw_sp_ipv6_addr_kvdl_index_get(mlxsw_sp,
492+ &new_parms.daddr.addr6,
493+ &new_kvdl_index);
494+ if (err)
495+ return err;
496+ ipip_entry->dip_kvdl_index = new_kvdl_index;
497+
498+ err = mlxsw_sp_ipip_ol_netdev_change_gre(mlxsw_sp, ipip_entry,
499+ &new_parms, extack);
500+ if (err)
501+ goto err_change_gre;
502+
503+ mlxsw_sp_ipv6_addr_put(mlxsw_sp, &old_addr6);
504+
505+ return 0;
506+
507+err_change_gre:
508+ ipip_entry->dip_kvdl_index = old_kvdl_index;
509+ mlxsw_sp_ipv6_addr_put(mlxsw_sp, &new_parms.daddr.addr6);
510+ return err;
489511 }
490512
491513 static int
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c+7−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include "spectrum.h"
1717 #include "spectrum_ptp.h"
1818 #include "core.h"
19+#include "txheader.h"
1920
2021 #define MLXSW_SP1_PTP_CLOCK_CYCLES_SHIFT 29
2122 #define MLXSW_SP1_PTP_CLOCK_FREQ_KHZ 156257 /* 6.4nSec */
@@ -1684,6 +1685,12 @@ int mlxsw_sp_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core, · 1662 unmodified lines
16841685 struct sk_buff *skb,
16851686 const struct mlxsw_tx_info *tx_info)
16861687 {
1688+ if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) {
1689+ this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
1690+ dev_kfree_skb_any(skb);
1691+ return -ENOMEM;
1692+ }
1693+
16871694 mlxsw_sp_txhdr_construct(skb, tx_info);
16881695 return 0;
16891696 }
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+3−6
@@ -3197,7 +3197,6 @@ mlxsw_sp_nexthop_sh_counter_get(struct mlxsw_sp *mlxsw_sp, · 3196 unmodified lines
31973197 {
31983198 struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
31993199 struct mlxsw_sp_nexthop_counter *nhct;
3200− void *ptr;
32013200 int err;
32023201
32033202 nhct = xa_load(&nh_grp->nhgi->nexthop_counters, nh->id);
@@ -3210,12 +3209,10 @@ mlxsw_sp_nexthop_sh_counter_get(struct mlxsw_sp *mlxsw_sp, · 6 unmodified lines
32103209 if (IS_ERR(nhct))
32113210 return nhct;
32123211
3213− ptr = xa_store(&nh_grp->nhgi->nexthop_counters, nh->id, nhct,
3214− GFP_KERNEL);
3215− if (IS_ERR(ptr)) {
3216− err = PTR_ERR(ptr);
3212+ err = xa_err(xa_store(&nh_grp->nhgi->nexthop_counters, nh->id, nhct,
3213+ GFP_KERNEL));
3214+ if (err)
32173215 goto err_store;
3218− }
32193216
32203217 return nhct;
32213218
drivers/net/ethernet/microchip/lan743x_ptp.c+14−21
@@ -401,28 +401,21 @@ static int lan743x_ptpci_settime64(struct ptp_clock_info *ptpci, · 400 unmodified lines
401401 u32 nano_seconds = 0;
402402 u32 seconds = 0;
403403
404− if (ts) {
405− if (ts->tv_sec > 0xFFFFFFFFLL ||
406− ts->tv_sec < 0) {
407− netif_warn(adapter, drv, adapter->netdev,
408− "ts->tv_sec out of range, %lld\n",
409− ts->tv_sec);
410− return -ERANGE;
411− }
412− if (ts->tv_nsec >= 1000000000L ||
413− ts->tv_nsec < 0) {
414− netif_warn(adapter, drv, adapter->netdev,
415− "ts->tv_nsec out of range, %ld\n",
416− ts->tv_nsec);
417− return -ERANGE;
418− }
419− seconds = ts->tv_sec;
420− nano_seconds = ts->tv_nsec;
421− lan743x_ptp_clock_set(adapter, seconds, nano_seconds, 0);
422− } else {
423− netif_warn(adapter, drv, adapter->netdev, "ts == NULL\n");
424− return -EINVAL;
404+ if (ts->tv_sec > 0xFFFFFFFFLL) {
405+ netif_warn(adapter, drv, adapter->netdev,
406+ "ts->tv_sec out of range, %lld\n",
407+ ts->tv_sec);
408+ return -ERANGE;
409+ }
410+ if (ts->tv_nsec < 0) {
411+ netif_warn(adapter, drv, adapter->netdev,
412+ "ts->tv_nsec out of range, %ld\n",
413+ ts->tv_nsec);
414+ return -ERANGE;
425415 }
416+ seconds = ts->tv_sec;
417+ nano_seconds = ts->tv_nsec;
418+ lan743x_ptp_clock_set(adapter, seconds, nano_seconds, 0);
426419
427420 return 0;
428421 }
drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c+6−6
@@ -31,10 +31,10 @@ static u64 sparx5_mirror_port_get(struct sparx5 *sparx5, u32 idx) · 30 unmodified lines
3131 /* Add port to mirror (only front ports) */
3232 static void sparx5_mirror_port_add(struct sparx5 *sparx5, u32 idx, u32 portno)
3333 {
34− u32 val, reg = portno;
34+ u64 reg = portno;
35+ u32 val;
3536
36− reg = portno / BITS_PER_BYTE;
37− val = BIT(portno % BITS_PER_BYTE);
37+ val = BIT(do_div(reg, 32));
3838
3939 if (reg == 0)
4040 return spx5_rmw(val, val, sparx5, ANA_AC_PROBE_PORT_CFG(idx));
@@ -45,10 +45,10 @@ static void sparx5_mirror_port_add(struct sparx5 *sparx5, u32 idx, u32 portno) · 4 unmodified lines
4545 /* Delete port from mirror (only front ports) */
4646 static void sparx5_mirror_port_del(struct sparx5 *sparx5, u32 idx, u32 portno)
4747 {
48− u32 val, reg = portno;
48+ u64 reg = portno;
49+ u32 val;
4950
50− reg = portno / BITS_PER_BYTE;
51− val = BIT(portno % BITS_PER_BYTE);
51+ val = BIT(do_div(reg, 32));
5252
5353 if (reg == 0)
5454 return spx5_rmw(0, val, sparx5, ANA_AC_PROBE_PORT_CFG(idx));
drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c+2−0
@@ -1444,6 +1444,8 @@ static void vcap_api_encode_rule_test(struct kunit *test) · 1443 unmodified lines
14441444
14451445 ret = vcap_del_rule(&test_vctrl, &test_netdev, id);
14461446 KUNIT_EXPECT_EQ(test, 0, ret);
1447+
1448+ vcap_free_rule(rule);
14471449 }
14481450
14491451 static void vcap_api_set_rule_counter_test(struct kunit *test)
drivers/net/ethernet/realtek/r8169_main.c+3−1
@@ -4682,7 +4682,9 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) · 4681 unmodified lines
46824682 if ((status & 0xffff) == 0xffff || !(status & tp->irq_mask))
46834683 return IRQ_NONE;
46844684
4685− if (unlikely(status & SYSErr)) {
4685+ /* At least RTL8168fp may unexpectedly set the SYSErr bit */
4686+ if (unlikely(status & SYSErr &&
4687+ tp->mac_version <= RTL_GIGA_MAC_VER_06)) {
46864688 rtl8169_pcierr_interrupt(tp->dev);
46874689 goto out;
46884690 }
drivers/net/ethernet/renesas/ravb_main.c+12−13
@@ -1750,20 +1750,19 @@ static int ravb_get_ts_info(struct net_device *ndev, · 1749 unmodified lines
17501750 struct ravb_private *priv = netdev_priv(ndev);
17511751 const struct ravb_hw_info *hw_info = priv->info;
17521752
1753− info->so_timestamping =
1754− SOF_TIMESTAMPING_TX_SOFTWARE |
1755− SOF_TIMESTAMPING_TX_HARDWARE |
1756− SOF_TIMESTAMPING_RX_HARDWARE |
1757− SOF_TIMESTAMPING_RAW_HARDWARE;
1758− info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
1759− info->rx_filters =
1760− (1 << HWTSTAMP_FILTER_NONE) |
1761− (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
1762− (1 << HWTSTAMP_FILTER_ALL);
1763− if (hw_info->gptp || hw_info->ccc_gac)
1753+ if (hw_info->gptp || hw_info->ccc_gac) {
1754+ info->so_timestamping =
1755+ SOF_TIMESTAMPING_TX_SOFTWARE |
1756+ SOF_TIMESTAMPING_TX_HARDWARE |
1757+ SOF_TIMESTAMPING_RX_HARDWARE |
1758+ SOF_TIMESTAMPING_RAW_HARDWARE;
1759+ info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
1760+ info->rx_filters =
1761+ (1 << HWTSTAMP_FILTER_NONE) |
1762+ (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
1763+ (1 << HWTSTAMP_FILTER_ALL);
17641764 info->phc_index = ptp_clock_index(priv->ptp.clock);
1765− else
1766− info->phc_index = 0;
1765+ }
17671766
17681767 return 0;
17691768 }
drivers/net/ethernet/renesas/rtsn.c+1−0
@@ -1057,6 +1057,7 @@ static netdev_tx_t rtsn_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 1056 unmodified lines
10571057 if (skb->len >= TX_DS) {
10581058 priv->stats.tx_dropped++;
10591059 priv->stats.tx_errors++;
1060+ dev_kfree_skb_any(skb);
10601061 goto out;
10611062 }
10621063
drivers/net/ethernet/sfc/efx_channels.c+2−1
@@ -1260,7 +1260,8 @@ static int efx_poll(struct napi_struct *napi, int budget) · 1259 unmodified lines
12601260
12611261 spent = efx_process_channel(channel, budget);
12621262
1263− xdp_do_flush();
1263+ if (budget)
1264+ xdp_do_flush();
12641265
12651266 if (spent < budget) {
12661267 if (efx_channel_has_rx_queue(channel) &&
drivers/net/ethernet/sfc/siena/efx_channels.c+2−1
@@ -1285,7 +1285,8 @@ static int efx_poll(struct napi_struct *napi, int budget) · 1284 unmodified lines
12851285
12861286 spent = efx_process_channel(channel, budget);
12871287
1288− xdp_do_flush();
1288+ if (budget)
1289+ xdp_do_flush();
12891290
12901291 if (spent < budget) {
12911292 if (efx_channel_has_rx_queue(channel) &&
drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c+12−2
@@ -127,10 +127,12 @@ static int mgbe_uphy_lane_bringup_serdes_up(struct net_device *ndev, void *mgbe_ · 126 unmodified lines
127127 value &= ~XPCS_WRAP_UPHY_RX_CONTROL_AUX_RX_IDDQ;
128128 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
129129
130+ usleep_range(10, 20); /* 50ns min delay needed as per HW design */
130131 value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
131132 value &= ~XPCS_WRAP_UPHY_RX_CONTROL_RX_SLEEP;
132133 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
133134
135+ usleep_range(10, 20); /* 500ns min delay needed as per HW design */
134136 value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
135137 value |= XPCS_WRAP_UPHY_RX_CONTROL_RX_CAL_EN;
136138 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
@@ -143,22 +145,30 @@ static int mgbe_uphy_lane_bringup_serdes_up(struct net_device *ndev, void *mgbe_ · 6 unmodified lines
143145 return err;
144146 }
145147
148+ usleep_range(10, 20); /* 50ns min delay needed as per HW design */
146149 value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
147150 value |= XPCS_WRAP_UPHY_RX_CONTROL_RX_DATA_EN;
148151 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
149152
150153 value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
151− value |= XPCS_WRAP_UPHY_RX_CONTROL_RX_CDR_RESET;
154+ value &= ~XPCS_WRAP_UPHY_RX_CONTROL_RX_PCS_PHY_RDY;
152155 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
153156
157+ usleep_range(10, 20); /* 50ns min delay needed as per HW design */
154158 value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
155− value &= ~XPCS_WRAP_UPHY_RX_CONTROL_RX_CDR_RESET;
159+ value |= XPCS_WRAP_UPHY_RX_CONTROL_RX_CDR_RESET;
156160 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
157161
162+ usleep_range(10, 20); /* 50ns min delay needed as per HW design */
158163 value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
159164 value |= XPCS_WRAP_UPHY_RX_CONTROL_RX_PCS_PHY_RDY;
160165 writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
161166
167+ msleep(30); /* 30ms delay needed as per HW design */
168+ value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
169+ value &= ~XPCS_WRAP_UPHY_RX_CONTROL_RX_CDR_RESET;
170+ writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
171+
162172 err = readl_poll_timeout(mgbe->xpcs + XPCS_WRAP_IRQ_STATUS, value,
163173 value & XPCS_WRAP_IRQ_STATUS_PCS_LINK_STS,
164174 500, 500 * 2000);
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c+8−0
@@ -203,8 +203,12 @@ static void _dwmac4_dump_dma_regs(struct stmmac_priv *priv, · 202 unmodified lines
203203 readl(ioaddr + DMA_CHAN_TX_CONTROL(dwmac4_addrs, channel));
204204 reg_space[DMA_CHAN_RX_CONTROL(default_addrs, channel) / 4] =
205205 readl(ioaddr + DMA_CHAN_RX_CONTROL(dwmac4_addrs, channel));
206+ reg_space[DMA_CHAN_TX_BASE_ADDR_HI(default_addrs, channel) / 4] =
207+ readl(ioaddr + DMA_CHAN_TX_BASE_ADDR_HI(dwmac4_addrs, channel));
206208 reg_space[DMA_CHAN_TX_BASE_ADDR(default_addrs, channel) / 4] =
207209 readl(ioaddr + DMA_CHAN_TX_BASE_ADDR(dwmac4_addrs, channel));
210+ reg_space[DMA_CHAN_RX_BASE_ADDR_HI(default_addrs, channel) / 4] =
211+ readl(ioaddr + DMA_CHAN_RX_BASE_ADDR_HI(dwmac4_addrs, channel));
208212 reg_space[DMA_CHAN_RX_BASE_ADDR(default_addrs, channel) / 4] =
209213 readl(ioaddr + DMA_CHAN_RX_BASE_ADDR(dwmac4_addrs, channel));
210214 reg_space[DMA_CHAN_TX_END_ADDR(default_addrs, channel) / 4] =
@@ -225,8 +229,12 @@ static void _dwmac4_dump_dma_regs(struct stmmac_priv *priv, · 14 unmodified lines
225229 readl(ioaddr + DMA_CHAN_CUR_TX_DESC(dwmac4_addrs, channel));
226230 reg_space[DMA_CHAN_CUR_RX_DESC(default_addrs, channel) / 4] =
227231 readl(ioaddr + DMA_CHAN_CUR_RX_DESC(dwmac4_addrs, channel));
232+ reg_space[DMA_CHAN_CUR_TX_BUF_ADDR_HI(default_addrs, channel) / 4] =
233+ readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR_HI(dwmac4_addrs, channel));
228234 reg_space[DMA_CHAN_CUR_TX_BUF_ADDR(default_addrs, channel) / 4] =
229235 readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR(dwmac4_addrs, channel));
236+ reg_space[DMA_CHAN_CUR_RX_BUF_ADDR_HI(default_addrs, channel) / 4] =
237+ readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR_HI(dwmac4_addrs, channel));
230238 reg_space[DMA_CHAN_CUR_RX_BUF_ADDR(default_addrs, channel) / 4] =
231239 readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR(dwmac4_addrs, channel));
232240 reg_space[DMA_CHAN_STATUS(default_addrs, channel) / 4] =
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h+2−0
@@ -127,7 +127,9 @@ static inline u32 dma_chanx_base_addr(const struct dwmac4_addrs *addrs, · 126 unmodified lines
127127 #define DMA_CHAN_SLOT_CTRL_STATUS(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x3c)
128128 #define DMA_CHAN_CUR_TX_DESC(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x44)
129129 #define DMA_CHAN_CUR_RX_DESC(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x4c)
130+#define DMA_CHAN_CUR_TX_BUF_ADDR_HI(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x50)
130131 #define DMA_CHAN_CUR_TX_BUF_ADDR(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x54)
132+#define DMA_CHAN_CUR_RX_BUF_ADDR_HI(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x58)
131133 #define DMA_CHAN_CUR_RX_BUF_ADDR(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x5c)
132134 #define DMA_CHAN_STATUS(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x60)
133135
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+18−6
@@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, · 2034 unmodified lines
20352035 rx_q->queue_index = queue;
20362036 rx_q->priv_data = priv;
20372037
2038− pp_params.flags = PP_FLAG_DMA_MAP | (xdp_prog ? PP_FLAG_DMA_SYNC_DEV : 0);
2038+ pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
20392039 pp_params.pool_size = dma_conf->dma_rx_size;
20402040 num_pages = DIV_ROUND_UP(dma_conf->dma_buf_sz, PAGE_SIZE);
20412041 pp_params.order = ilog2(num_pages);
@@ -4304,11 +4304,6 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) · 2262 unmodified lines
43044304 if (dma_mapping_error(priv->device, des))
43054305 goto dma_map_err;
43064306
4307− tx_q->tx_skbuff_dma[first_entry].buf = des;
4308− tx_q->tx_skbuff_dma[first_entry].len = skb_headlen(skb);
4309− tx_q->tx_skbuff_dma[first_entry].map_as_page = false;
4310− tx_q->tx_skbuff_dma[first_entry].buf_type = STMMAC_TXBUF_T_SKB;
4311−
43124307 if (priv->dma_cap.addr64 <= 32) {
43134308 first->des0 = cpu_to_le32(des);
43144309
@@ -4327,6 +4322,23 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) · 12 unmodified lines
43274322
43284323 stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0), queue);
43294324
4325+ /* In case two or more DMA transmit descriptors are allocated for this
4326+ * non-paged SKB data, the DMA buffer address should be saved to
4327+ * tx_q->tx_skbuff_dma[].buf corresponding to the last descriptor,
4328+ * and leave the other tx_q->tx_skbuff_dma[].buf as NULL to guarantee
4329+ * that stmmac_tx_clean() does not unmap the entire DMA buffer too early
4330+ * since the tail areas of the DMA buffer can be accessed by DMA engine
4331+ * sooner or later.
4332+ * By saving the DMA buffer address to tx_q->tx_skbuff_dma[].buf
4333+ * corresponding to the last descriptor, stmmac_tx_clean() will unmap
4334+ * this DMA buffer right after the DMA engine completely finishes the
4335+ * full buffer transmission.
4336+ */
4337+ tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des;
4338+ tx_q->tx_skbuff_dma[tx_q->cur_tx].len = skb_headlen(skb);
4339+ tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = false;
4340+ tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type = STMMAC_TXBUF_T_SKB;
4341+
43304342 /* Prepare fragments */
43314343 for (i = 0; i < nfrags; i++) {
43324344 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
drivers/net/ethernet/ti/am65-cpsw-nuss.c+13−9
@@ -2744,10 +2744,9 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx) · 2743 unmodified lines
27442744 return 0;
27452745
27462746 /* alloc netdev */
2747− port->ndev = devm_alloc_etherdev_mqs(common->dev,
2748− sizeof(struct am65_cpsw_ndev_priv),
2749− AM65_CPSW_MAX_QUEUES,
2750− AM65_CPSW_MAX_QUEUES);
2747+ port->ndev = alloc_etherdev_mqs(sizeof(struct am65_cpsw_ndev_priv),
2748+ AM65_CPSW_MAX_QUEUES,
2749+ AM65_CPSW_MAX_QUEUES);
27512750 if (!port->ndev) {
27522751 dev_err(dev, "error allocating slave net_device %u\n",
27532752 port->port_id);
@@ -2868,8 +2867,12 @@ static void am65_cpsw_nuss_cleanup_ndev(struct am65_cpsw_common *common) · 114 unmodified lines
28682867
28692868 for (i = 0; i < common->port_num; i++) {
28702869 port = &common->ports[i];
2871− if (port->ndev && port->ndev->reg_state == NETREG_REGISTERED)
2870+ if (!port->ndev)
2871+ continue;
2872+ if (port->ndev->reg_state == NETREG_REGISTERED)
28722873 unregister_netdev(port->ndev);
2874+ free_netdev(port->ndev);
2875+ port->ndev = NULL;
28732876 }
28742877 }
28752878
@@ -3613,16 +3616,17 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) · 737 unmodified lines
36133616
36143617 ret = am65_cpsw_nuss_init_ndevs(common);
36153618 if (ret)
3616− goto err_free_phylink;
3619+ goto err_ndevs_clear;
36173620
36183621 ret = am65_cpsw_nuss_register_ndevs(common);
36193622 if (ret)
3620− goto err_free_phylink;
3623+ goto err_ndevs_clear;
36213624
36223625 pm_runtime_put(dev);
36233626 return 0;
36243627
3625−err_free_phylink:
3628+err_ndevs_clear:
3629+ am65_cpsw_nuss_cleanup_ndev(common);
36263630 am65_cpsw_nuss_phylink_cleanup(common);
36273631 am65_cpts_release(common->cpts);
36283632 err_of_clear:
@@ -3652,13 +3656,13 @@ static void am65_cpsw_nuss_remove(struct platform_device *pdev) · 23 unmodified lines
36523656 return;
36533657 }
36543658
3655− am65_cpsw_unregister_devlink(common);
36563659 am65_cpsw_unregister_notifiers(common);
36573660
36583661 /* must unregister ndevs here because DD release_driver routine calls
36593662 * dma_deconfigure(dev) before devres_release_all(dev)
36603663 */
36613664 am65_cpsw_nuss_cleanup_ndev(common);
3665+ am65_cpsw_unregister_devlink(common);
36623666 am65_cpsw_nuss_phylink_cleanup(common);
36633667 am65_cpts_release(common->cpts);
36643668 am65_cpsw_disable_serdes_phy(common);
drivers/net/ethernet/ti/icssg/icssg_config.c+2−0
@@ -735,6 +735,7 @@ void icssg_vtbl_modify(struct prueth_emac *emac, u8 vid, u8 port_mask, · 734 unmodified lines
735735 u8 fid_c1;
736736
737737 tbl = prueth->vlan_tbl;
738+ spin_lock(&prueth->vtbl_lock);
738739 fid_c1 = tbl[vid].fid_c1;
739740
740741 /* FID_C1: bit0..2 port membership mask,
@@ -750,6 +751,7 @@ void icssg_vtbl_modify(struct prueth_emac *emac, u8 vid, u8 port_mask, · 9 unmodified lines
750751 }
751752
752753 tbl[vid].fid_c1 = fid_c1;
754+ spin_unlock(&prueth->vtbl_lock);
753755 }
754756 EXPORT_SYMBOL_GPL(icssg_vtbl_modify);
755757
drivers/net/ethernet/ti/icssg/icssg_prueth.c+1−0
@@ -1442,6 +1442,7 @@ static int prueth_probe(struct platform_device *pdev) · 1441 unmodified lines
14421442 icss_iep_init_fw(prueth->iep1);
14431443 }
14441444
1445+ spin_lock_init(&prueth->vtbl_lock);
14451446 /* setup netdev interfaces */
14461447 if (eth0_node) {
14471448 ret = prueth_netdev_init(prueth, eth0_node);
drivers/net/ethernet/ti/icssg/icssg_prueth.h+2−0
@@ -296,6 +296,8 @@ struct prueth { · 295 unmodified lines
296296 bool is_switchmode_supported;
297297 unsigned char switch_id[MAX_PHYS_ITEM_ID_LEN];
298298 int default_vlan;
299+ /** @vtbl_lock: Lock for vtbl in shared memory */
300+ spinlock_t vtbl_lock;
299301 };
300302
301303 struct emac_tx_ts_response {
drivers/net/ethernet/xilinx/xilinx_axienet_main.c+2−0
@@ -1051,6 +1051,7 @@ axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 1050 unmodified lines
10511051 if (net_ratelimit())
10521052 netdev_err(ndev, "TX DMA mapping error\n");
10531053 ndev->stats.tx_dropped++;
1054+ dev_kfree_skb_any(skb);
10541055 return NETDEV_TX_OK;
10551056 }
10561057 desc_set_phys_addr(lp, phys, cur_p);
@@ -1071,6 +1072,7 @@ axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 14 unmodified lines
10711072 ndev->stats.tx_dropped++;
10721073 axienet_free_tx_chain(lp, orig_tail_ptr, ii + 1,
10731074 true, NULL, 0);
1075+ dev_kfree_skb_any(skb);
10741076 return NETDEV_TX_OK;
10751077 }
10761078 desc_set_phys_addr(lp, phys, cur_p);
drivers/net/gtp.c+13−9
@@ -1702,20 +1702,24 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]) · 1701 unmodified lines
17021702 return -EINVAL;
17031703
17041704 if (data[IFLA_GTP_FD0]) {
1705− u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]);
1705+ int fd0 = nla_get_u32(data[IFLA_GTP_FD0]);
17061706
1707− sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp);
1708− if (IS_ERR(sk0))
1709− return PTR_ERR(sk0);
1707+ if (fd0 >= 0) {
1708+ sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp);
1709+ if (IS_ERR(sk0))
1710+ return PTR_ERR(sk0);
1711+ }
17101712 }
17111713
17121714 if (data[IFLA_GTP_FD1]) {
1713− u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]);
1715+ int fd1 = nla_get_u32(data[IFLA_GTP_FD1]);
17141716
1715− sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp);
1716− if (IS_ERR(sk1u)) {
1717− gtp_encap_disable_sock(sk0);
1718− return PTR_ERR(sk1u);
1717+ if (fd1 >= 0) {
1718+ sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp);
1719+ if (IS_ERR(sk1u)) {
1720+ gtp_encap_disable_sock(sk0);
1721+ return PTR_ERR(sk1u);
1722+ }
17191723 }
17201724 }
17211725
drivers/net/hyperv/netvsc_drv.c+30−0
@@ -2798,6 +2798,31 @@ static struct hv_driver netvsc_drv = { · 2797 unmodified lines
27982798 },
27992799 };
28002800
2801+/* Set VF's namespace same as the synthetic NIC */
2802+static void netvsc_event_set_vf_ns(struct net_device *ndev)
2803+{
2804+ struct net_device_context *ndev_ctx = netdev_priv(ndev);
2805+ struct net_device *vf_netdev;
2806+ int ret;
2807+
2808+ vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
2809+ if (!vf_netdev)
2810+ return;
2811+
2812+ if (!net_eq(dev_net(ndev), dev_net(vf_netdev))) {
2813+ ret = dev_change_net_namespace(vf_netdev, dev_net(ndev),
2814+ "eth%d");
2815+ if (ret)
2816+ netdev_err(vf_netdev,
2817+ "Cannot move to same namespace as %s: %d\n",
2818+ ndev->name, ret);
2819+ else
2820+ netdev_info(vf_netdev,
2821+ "Moved VF to namespace with: %s\n",
2822+ ndev->name);
2823+ }
2824+}
2825+
28012826 /*
28022827 * On Hyper-V, every VF interface is matched with a corresponding
28032828 * synthetic interface. The synthetic interface is presented first
@@ -2810,6 +2835,11 @@ static int netvsc_netdev_event(struct notifier_block *this, · 6 unmodified lines
28102835 struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
28112836 int ret = 0;
28122837
2838+ if (event_dev->netdev_ops == &device_ops && event == NETDEV_REGISTER) {
2839+ netvsc_event_set_vf_ns(event_dev);
2840+ return NOTIFY_DONE;
2841+ }
2842+
28132843 ret = check_dev_is_matching_vf(event_dev);
28142844 if (ret != 0)
28152845 return NOTIFY_DONE;
drivers/net/macsec.c+1−20
@@ -154,19 +154,6 @@ static struct macsec_rx_sa *macsec_rxsa_get(struct macsec_rx_sa __rcu *ptr) · 153 unmodified lines
154154 return sa;
155155 }
156156
157−static struct macsec_rx_sa *macsec_active_rxsa_get(struct macsec_rx_sc *rx_sc)
158−{
159− struct macsec_rx_sa *sa = NULL;
160− int an;
161−
162− for (an = 0; an < MACSEC_NUM_AN; an++) {
163− sa = macsec_rxsa_get(rx_sc->sa[an]);
164− if (sa)
165− break;
166− }
167− return sa;
168−}
169−
170157 static void free_rx_sc_rcu(struct rcu_head *head)
171158 {
172159 struct macsec_rx_sc *rx_sc = container_of(head, struct macsec_rx_sc, rcu_head);
@@ -1208,15 +1195,12 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb) · 1035 unmodified lines
12081195 /* If validateFrames is Strict or the C bit in the
12091196 * SecTAG is set, discard
12101197 */
1211− struct macsec_rx_sa *active_rx_sa = macsec_active_rxsa_get(rx_sc);
12121198 if (hdr->tci_an & MACSEC_TCI_C ||
12131199 secy->validate_frames == MACSEC_VALIDATE_STRICT) {
12141200 u64_stats_update_begin(&rxsc_stats->syncp);
12151201 rxsc_stats->stats.InPktsNotUsingSA++;
12161202 u64_stats_update_end(&rxsc_stats->syncp);
12171203 DEV_STATS_INC(secy->netdev, rx_errors);
1218− if (active_rx_sa)
1219− this_cpu_inc(active_rx_sa->stats->InPktsNotUsingSA);
12201204 goto drop_nosa;
12211205 }
12221206
@@ -1226,8 +1210,6 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb) · 3 unmodified lines
12261210 u64_stats_update_begin(&rxsc_stats->syncp);
12271211 rxsc_stats->stats.InPktsUnusedSA++;
12281212 u64_stats_update_end(&rxsc_stats->syncp);
1229− if (active_rx_sa)
1230− this_cpu_inc(active_rx_sa->stats->InPktsUnusedSA);
12311213 goto deliver;
12321214 }
12331215
@@ -3816,8 +3798,7 @@ static void macsec_free_netdev(struct net_device *dev) · 2582 unmodified lines
38163798 {
38173799 struct macsec_dev *macsec = macsec_priv(dev);
38183800
3819− if (macsec->secy.tx_sc.md_dst)
3820− metadata_dst_free(macsec->secy.tx_sc.md_dst);
3801+ dst_release(&macsec->secy.tx_sc.md_dst->dst);
38213802 free_percpu(macsec->stats);
38223803 free_percpu(macsec->secy.tx_sc.stats);
38233804
drivers/net/mctp/mctp-i2c.c+3−0
@@ -588,6 +588,9 @@ static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev, · 587 unmodified lines
588588 if (len > MCTP_I2C_MAXMTU)
589589 return -EMSGSIZE;
590590
591+ if (!daddr || !saddr)
592+ return -EINVAL;
593+
591594 lldst = *((u8 *)daddr);
592595 llsrc = *((u8 *)saddr);
593596
drivers/net/mdio/mdio-bcm-unimac.c+1−0
@@ -337,6 +337,7 @@ static const struct of_device_id unimac_mdio_ids[] = { · 336 unmodified lines
337337 { .compatible = "brcm,asp-v2.2-mdio", },
338338 { .compatible = "brcm,asp-v2.1-mdio", },
339339 { .compatible = "brcm,asp-v2.0-mdio", },
340+ { .compatible = "brcm,bcm6846-mdio", },
340341 { .compatible = "brcm,genet-mdio-v5", },
341342 { .compatible = "brcm,genet-mdio-v4", },
342343 { .compatible = "brcm,genet-mdio-v3", },
drivers/net/netconsole.c+7−1
@@ -1161,8 +1161,14 @@ static void send_ext_msg_udp(struct netconsole_target *nt, const char *msg, · 1160 unmodified lines
11611161
11621162 this_chunk = min(userdata_len - sent_userdata,
11631163 MAX_PRINT_CHUNK - preceding_bytes);
1164− if (WARN_ON_ONCE(this_chunk <= 0))
1164+ if (WARN_ON_ONCE(this_chunk < 0))
1165+ /* this_chunk could be zero if all the previous
1166+ * message used all the buffer. This is not a
1167+ * problem, userdata will be sent in the next
1168+ * iteration
1169+ */
11651170 return;
1171+
11661172 memcpy(buf + this_header + this_offset,
11671173 userdata + sent_userdata,
11681174 this_chunk);
drivers/net/netdevsim/dev.c+9−6
@@ -836,7 +836,8 @@ static void nsim_dev_trap_report_work(struct work_struct *work) · 835 unmodified lines
836836 nsim_dev = nsim_trap_data->nsim_dev;
837837
838838 if (!devl_trylock(priv_to_devlink(nsim_dev))) {
839− schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw, 1);
839+ queue_delayed_work(system_unbound_wq,
840+ &nsim_dev->trap_data->trap_report_dw, 1);
840841 return;
841842 }
842843
@@ -848,11 +849,12 @@ static void nsim_dev_trap_report_work(struct work_struct *work) · 5 unmodified lines
848849 continue;
849850
850851 nsim_dev_trap_report(nsim_dev_port);
852+ cond_resched();
851853 }
852854 devl_unlock(priv_to_devlink(nsim_dev));
853−
854− schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw,
855− msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
855+ queue_delayed_work(system_unbound_wq,
856+ &nsim_dev->trap_data->trap_report_dw,
857+ msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
856858 }
857859
858860 static int nsim_dev_traps_init(struct devlink *devlink)
@@ -907,8 +909,9 @@ static int nsim_dev_traps_init(struct devlink *devlink) · 48 unmodified lines
907909
908910 INIT_DELAYED_WORK(&nsim_dev->trap_data->trap_report_dw,
909911 nsim_dev_trap_report_work);
910− schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw,
911− msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
912+ queue_delayed_work(system_unbound_wq,
913+ &nsim_dev->trap_data->trap_report_dw,
914+ msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
912915
913916 return 0;
914917
drivers/net/netdevsim/fib.c+3−1
@@ -1377,10 +1377,12 @@ static ssize_t nsim_nexthop_bucket_activity_write(struct file *file, · 1376 unmodified lines
13771377
13781378 if (pos != 0)
13791379 return -EINVAL;
1380− if (size > sizeof(buf))
1380+ if (size > sizeof(buf) - 1)
13811381 return -EINVAL;
13821382 if (copy_from_user(buf, user_buf, size))
13831383 return -EFAULT;
1384+ buf[size] = 0;
1385+
13841386 if (sscanf(buf, "%u %hu", &nhid, &bucket_index) != 2)
13851387 return -EINVAL;
13861388
drivers/net/phy/aquantia/aquantia_main.c+33−18
@@ -537,12 +537,6 @@ static int aqcs109_config_init(struct phy_device *phydev) · 536 unmodified lines
537537 if (!ret)
538538 aqr107_chip_info(phydev);
539539
540− /* AQCS109 belongs to a chip family partially supporting 10G and 5G.
541− * PMA speed ability bits are the same for all members of the family,
542− * AQCS109 however supports speeds up to 2.5G only.
543− */
544− phy_set_max_speed(phydev, SPEED_2500);
545−
546540 return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
547541 }
548542
@@ -731,6 +725,31 @@ static int aqr113c_fill_interface_modes(struct phy_device *phydev) · 182 unmodified lines
731725 return aqr107_fill_interface_modes(phydev);
732726 }
733727
728+static int aqr115c_get_features(struct phy_device *phydev)
729+{
730+ unsigned long *supported = phydev->supported;
731+
732+ /* PHY supports speeds up to 2.5G with autoneg. PMA capabilities
733+ * are not useful.
734+ */
735+ linkmode_or(supported, supported, phy_gbit_features);
736+ linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, supported);
737+
738+ return 0;
739+}
740+
741+static int aqr111_get_features(struct phy_device *phydev)
742+{
743+ /* PHY supports speeds up to 5G with autoneg. PMA capabilities
744+ * are not useful.
745+ */
746+ aqr115c_get_features(phydev);
747+ linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
748+ phydev->supported);
749+
750+ return 0;
751+}
752+
734753 static int aqr113c_config_init(struct phy_device *phydev)
735754 {
736755 int ret;
@@ -767,15 +786,6 @@ static int aqr107_probe(struct phy_device *phydev) · 30 unmodified lines
767786 return aqr_hwmon_probe(phydev);
768787 }
769788
770−static int aqr111_config_init(struct phy_device *phydev)
771−{
772− /* AQR111 reports supporting speed up to 10G,
773− * however only speeds up to 5G are supported.
774− */
775− phy_set_max_speed(phydev, SPEED_5000);
776−
777− return aqr107_config_init(phydev);
778−}
779789
780790 static struct phy_driver aqr_driver[] = {
781791 {
@@ -853,6 +863,7 @@ static struct phy_driver aqr_driver[] = { · 71 unmodified lines
853863 .get_sset_count = aqr107_get_sset_count,
854864 .get_strings = aqr107_get_strings,
855865 .get_stats = aqr107_get_stats,
866+ .get_features = aqr115c_get_features,
856867 .link_change_notify = aqr107_link_change_notify,
857868 .led_brightness_set = aqr_phy_led_brightness_set,
858869 .led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -865,7 +876,7 @@ static struct phy_driver aqr_driver[] = { · 6 unmodified lines
865876 .name = "Aquantia AQR111",
866877 .probe = aqr107_probe,
867878 .get_rate_matching = aqr107_get_rate_matching,
868− .config_init = aqr111_config_init,
879+ .config_init = aqr107_config_init,
869880 .config_aneg = aqr_config_aneg,
870881 .config_intr = aqr_config_intr,
871882 .handle_interrupt = aqr_handle_interrupt,
@@ -877,6 +888,7 @@ static struct phy_driver aqr_driver[] = { · 5 unmodified lines
877888 .get_sset_count = aqr107_get_sset_count,
878889 .get_strings = aqr107_get_strings,
879890 .get_stats = aqr107_get_stats,
891+ .get_features = aqr111_get_features,
880892 .link_change_notify = aqr107_link_change_notify,
881893 .led_brightness_set = aqr_phy_led_brightness_set,
882894 .led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -889,7 +901,7 @@ static struct phy_driver aqr_driver[] = { · 6 unmodified lines
889901 .name = "Aquantia AQR111B0",
890902 .probe = aqr107_probe,
891903 .get_rate_matching = aqr107_get_rate_matching,
892− .config_init = aqr111_config_init,
904+ .config_init = aqr107_config_init,
893905 .config_aneg = aqr_config_aneg,
894906 .config_intr = aqr_config_intr,
895907 .handle_interrupt = aqr_handle_interrupt,
@@ -901,6 +913,7 @@ static struct phy_driver aqr_driver[] = { · 5 unmodified lines
901913 .get_sset_count = aqr107_get_sset_count,
902914 .get_strings = aqr107_get_strings,
903915 .get_stats = aqr107_get_stats,
916+ .get_features = aqr111_get_features,
904917 .link_change_notify = aqr107_link_change_notify,
905918 .led_brightness_set = aqr_phy_led_brightness_set,
906919 .led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -1010,7 +1023,7 @@ static struct phy_driver aqr_driver[] = { · 103 unmodified lines
10101023 .name = "Aquantia AQR114C",
10111024 .probe = aqr107_probe,
10121025 .get_rate_matching = aqr107_get_rate_matching,
1013− .config_init = aqr111_config_init,
1026+ .config_init = aqr107_config_init,
10141027 .config_aneg = aqr_config_aneg,
10151028 .config_intr = aqr_config_intr,
10161029 .handle_interrupt = aqr_handle_interrupt,
@@ -1022,6 +1035,7 @@ static struct phy_driver aqr_driver[] = { · 5 unmodified lines
10221035 .get_sset_count = aqr107_get_sset_count,
10231036 .get_strings = aqr107_get_strings,
10241037 .get_stats = aqr107_get_stats,
1038+ .get_features = aqr111_get_features,
10251039 .link_change_notify = aqr107_link_change_notify,
10261040 .led_brightness_set = aqr_phy_led_brightness_set,
10271041 .led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -1046,6 +1060,7 @@ static struct phy_driver aqr_driver[] = { · 18 unmodified lines
10461060 .get_sset_count = aqr107_get_sset_count,
10471061 .get_strings = aqr107_get_strings,
10481062 .get_stats = aqr107_get_stats,
1063+ .get_features = aqr115c_get_features,
10491064 .link_change_notify = aqr107_link_change_notify,
10501065 .led_brightness_set = aqr_phy_led_brightness_set,
10511066 .led_hw_is_supported = aqr_phy_led_hw_is_supported,
drivers/net/phy/bcm84881.c+2−2
@@ -132,7 +132,7 @@ static int bcm84881_aneg_done(struct phy_device *phydev) · 131 unmodified lines
132132
133133 bmsr = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_C22 + MII_BMSR);
134134 if (bmsr < 0)
135− return val;
135+ return bmsr;
136136
137137 return !!(val & MDIO_AN_STAT1_COMPLETE) &&
138138 !!(bmsr & BMSR_ANEGCOMPLETE);
@@ -158,7 +158,7 @@ static int bcm84881_read_status(struct phy_device *phydev) · 19 unmodified lines
158158
159159 bmsr = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_C22 + MII_BMSR);
160160 if (bmsr < 0)
161− return val;
161+ return bmsr;
162162
163163 phydev->autoneg_complete = !!(val & MDIO_AN_STAT1_COMPLETE) &&
164164 !!(bmsr & BMSR_ANEGCOMPLETE);
drivers/net/phy/dp83822.c+2−2
@@ -45,8 +45,8 @@ · 44 unmodified lines
4545 /* Control Register 2 bits */
4646 #define DP83822_FX_ENABLE BIT(14)
4747
48−#define DP83822_HW_RESET BIT(15)
49−#define DP83822_SW_RESET BIT(14)
48+#define DP83822_SW_RESET BIT(15)
49+#define DP83822_DIG_RESTART BIT(14)
5050
5151 /* PHY STS bits */
5252 #define DP83822_PHYSTS_DUPLEX BIT(2)
drivers/net/phy/dp83869.c+0−1
@@ -645,7 +645,6 @@ static int dp83869_configure_fiber(struct phy_device *phydev, · 644 unmodified lines
645645 phydev->supported);
646646
647647 linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported);
648− linkmode_set_bit(ADVERTISED_FIBRE, phydev->advertising);
649648
650649 if (dp83869->mode == DP83869_RGMII_1000_BASE) {
651650 linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
drivers/net/phy/phy_device.c+3−2
@@ -3326,10 +3326,11 @@ static __maybe_unused int phy_led_hw_is_supported(struct led_classdev *led_cdev, · 3325 unmodified lines
33263326
33273327 static void phy_leds_unregister(struct phy_device *phydev)
33283328 {
3329− struct phy_led *phyled;
3329+ struct phy_led *phyled, *tmp;
33303330
3331− list_for_each_entry(phyled, &phydev->leds, list) {
3331+ list_for_each_entry_safe(phyled, tmp, &phydev->leds, list) {
33323332 led_classdev_unregister(&phyled->led_cdev);
3333+ list_del(&phyled->list);
33333334 }
33343335 }
33353336
drivers/net/phy/realtek.c+23−1
@@ -1081,6 +1081,16 @@ static int rtl8221b_vn_cg_c45_match_phy_device(struct phy_device *phydev) · 1080 unmodified lines
10811081 return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, true);
10821082 }
10831083
1084+static int rtl8251b_c22_match_phy_device(struct phy_device *phydev)
1085+{
1086+ return rtlgen_is_c45_match(phydev, RTL_8251B, false);
1087+}
1088+
1089+static int rtl8251b_c45_match_phy_device(struct phy_device *phydev)
1090+{
1091+ return rtlgen_is_c45_match(phydev, RTL_8251B, true);
1092+}
1093+
10841094 static int rtlgen_resume(struct phy_device *phydev)
10851095 {
10861096 int ret = genphy_resume(phydev);
@@ -1418,7 +1428,7 @@ static struct phy_driver realtek_drvs[] = { · 331 unmodified lines
14181428 .suspend = genphy_c45_pma_suspend,
14191429 .resume = rtlgen_c45_resume,
14201430 }, {
1421− PHY_ID_MATCH_EXACT(0x001cc862),
1431+ .match_phy_device = rtl8251b_c45_match_phy_device,
14221432 .name = "RTL8251B 5Gbps PHY",
14231433 .get_features = rtl822x_get_features,
14241434 .config_aneg = rtl822x_config_aneg,
@@ -1427,6 +1437,18 @@ static struct phy_driver realtek_drvs[] = { · 2 unmodified lines
14271437 .resume = rtlgen_resume,
14281438 .read_page = rtl821x_read_page,
14291439 .write_page = rtl821x_write_page,
1440+ }, {
1441+ .match_phy_device = rtl8251b_c22_match_phy_device,
1442+ .name = "RTL8126A-internal 5Gbps PHY",
1443+ .get_features = rtl822x_get_features,
1444+ .config_aneg = rtl822x_config_aneg,
1445+ .read_status = rtl822x_read_status,
1446+ .suspend = genphy_suspend,
1447+ .resume = rtlgen_resume,
1448+ .read_page = rtl821x_read_page,
1449+ .write_page = rtl821x_write_page,
1450+ .read_mmd = rtl822x_read_mmd,
1451+ .write_mmd = rtl822x_write_mmd,
14301452 }, {
14311453 PHY_ID_MATCH_EXACT(0x001ccad0),
14321454 .name = "RTL8224 2.5Gbps PHY",
drivers/net/plip/plip.c+1−1
@@ -815,7 +815,7 @@ plip_send_packet(struct net_device *dev, struct net_local *nl, · 814 unmodified lines
815815 return HS_TIMEOUT;
816816 }
817817 }
818− break;
818+ fallthrough;
819819
820820 case PLIP_PK_LENGTH_LSB:
821821 if (plip_send(nibble_timeout, dev,
drivers/net/ppp/ppp_async.c+1−1
@@ -542,7 +542,7 @@ ppp_async_encode(struct asyncppp *ap) · 541 unmodified lines
542542 * and 7 (code-reject) must be sent as though no options
543543 * had been negotiated.
544544 */
545− islcp = proto == PPP_LCP && 1 <= data[2] && data[2] <= 7;
545+ islcp = proto == PPP_LCP && count >= 3 && 1 <= data[2] && data[2] <= 7;
546546
547547 if (i == 0) {
548548 if (islcp)
drivers/net/pse-pd/pse_core.c+13−2
@@ -113,7 +113,7 @@ static void pse_release_pis(struct pse_controller_dev *pcdev) · 112 unmodified lines
113113 {
114114 int i;
115115
116− for (i = 0; i <= pcdev->nr_lines; i++) {
116+ for (i = 0; i < pcdev->nr_lines; i++) {
117117 of_node_put(pcdev->pi[i].pairset[0].np);
118118 of_node_put(pcdev->pi[i].pairset[1].np);
119119 of_node_put(pcdev->pi[i].np);
@@ -647,7 +647,7 @@ static int of_pse_match_pi(struct pse_controller_dev *pcdev, · 527 unmodified lines
647647 {
648648 int i;
649649
650− for (i = 0; i <= pcdev->nr_lines; i++) {
650+ for (i = 0; i < pcdev->nr_lines; i++) {
651651 if (pcdev->pi[i].np == np)
652652 return i;
653653 }
@@ -785,6 +785,17 @@ static int pse_ethtool_c33_set_config(struct pse_control *psec, · 131 unmodified lines
785785 */
786786 switch (config->c33_admin_control) {
787787 case ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED:
788+ /* We could have mismatch between admin_state_enabled and
789+ * state reported by regulator_is_enabled. This can occur when
790+ * the PI is forcibly turn off by the controller. Call
791+ * regulator_disable on that case to fix the counters state.
792+ */
793+ if (psec->pcdev->pi[psec->id].admin_state_enabled &&
794+ !regulator_is_enabled(psec->ps)) {
795+ err = regulator_disable(psec->ps);
796+ if (err)
797+ break;
798+ }
788799 if (!psec->pcdev->pi[psec->id].admin_state_enabled)
789800 err = regulator_enable(psec->ps);
790801 break;
drivers/net/slip/slhc.c+34−23
@@ -643,46 +643,57 @@ bad: · 642 unmodified lines
643643 int
644644 slhc_remember(struct slcompress *comp, unsigned char *icp, int isize)
645645 {
646− struct cstate *cs;
647− unsigned ihl;
648−
646+ const struct tcphdr *th;
649647 unsigned char index;
648+ struct iphdr *iph;
649+ struct cstate *cs;
650+ unsigned int ihl;
650651
651− if(isize < 20) {
652− /* The packet is shorter than a legal IP header */
652+ /* The packet is shorter than a legal IP header.
653+ * Also make sure isize is positive.
654+ */
655+ if (isize < (int)sizeof(struct iphdr)) {
656+runt:
653657 comp->sls_i_runt++;
654− return slhc_toss( comp );
658+ return slhc_toss(comp);
655659 }
660+ iph = (struct iphdr *)icp;
656661 /* Peek at the IP header's IHL field to find its length */
657− ihl = icp[0] & 0xf;
658− if(ihl < 20 / 4){
659− /* The IP header length field is too small */
660− comp->sls_i_runt++;
661− return slhc_toss( comp );
662− }
663− index = icp[9];
664− icp[9] = IPPROTO_TCP;
662+ ihl = iph->ihl;
663+ /* The IP header length field is too small,
664+ * or packet is shorter than the IP header followed
665+ * by minimal tcp header.
666+ */
667+ if (ihl < 5 || isize < ihl * 4 + sizeof(struct tcphdr))
668+ goto runt;
669+
670+ index = iph->protocol;
671+ iph->protocol = IPPROTO_TCP;
665672
666673 if (ip_fast_csum(icp, ihl)) {
667674 /* Bad IP header checksum; discard */
668675 comp->sls_i_badcheck++;
669− return slhc_toss( comp );
676+ return slhc_toss(comp);
670677 }
671− if(index > comp->rslot_limit) {
678+ if (index > comp->rslot_limit) {
672679 comp->sls_i_error++;
673680 return slhc_toss(comp);
674681 }
675−
682+ th = (struct tcphdr *)(icp + ihl * 4);
683+ if (th->doff < sizeof(struct tcphdr) / 4)
684+ goto runt;
685+ if (isize < ihl * 4 + th->doff * 4)
686+ goto runt;
676687 /* Update local state */
677688 cs = &comp->rstate[comp->recv_current = index];
678689 comp->flags &=~ SLF_TOSS;
679− memcpy(&cs->cs_ip,icp,20);
680− memcpy(&cs->cs_tcp,icp + ihl*4,20);
690+ memcpy(&cs->cs_ip, iph, sizeof(*iph));
691+ memcpy(&cs->cs_tcp, th, sizeof(*th));
681692 if (ihl > 5)
682− memcpy(cs->cs_ipopt, icp + sizeof(struct iphdr), (ihl - 5) * 4);
683− if (cs->cs_tcp.doff > 5)
684− memcpy(cs->cs_tcpopt, icp + ihl*4 + sizeof(struct tcphdr), (cs->cs_tcp.doff - 5) * 4);
685− cs->cs_hsize = ihl*2 + cs->cs_tcp.doff*2;
693+ memcpy(cs->cs_ipopt, &iph[1], (ihl - 5) * 4);
694+ if (th->doff > 5)
695+ memcpy(cs->cs_tcpopt, &th[1], (th->doff - 5) * 4);
696+ cs->cs_hsize = ihl*2 + th->doff*2;
686697 cs->initialized = true;
687698 /* Put headers back on packet
688699 * Neither header checksum is recalculated
drivers/net/usb/qmi_wwan.c+2−0
@@ -1076,6 +1076,7 @@ static const struct usb_device_id products[] = { · 1075 unmodified lines
10761076 USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
10771077 .driver_info = (unsigned long)&qmi_wwan_info,
10781078 },
1079+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0122)}, /* Quectel RG650V */
10791080 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
10801081 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
10811082 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
@@ -1426,6 +1427,7 @@ static const struct usb_device_id products[] = { · 344 unmodified lines
14261427 {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */
14271428 {QMI_QUIRK_SET_DTR(0x2c7c, 0x030e, 4)}, /* Quectel EM05GV2 */
14281429 {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */
1430+ {QMI_QUIRK_SET_DTR(0x2cb7, 0x0112, 0)}, /* Fibocom FG132 */
14291431 {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
14301432 {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
14311433 {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
drivers/net/usb/r8152.c+1−0
@@ -10069,6 +10069,7 @@ static const struct usb_device_id rtl8152_table[] = { · 10068 unmodified lines
1006910069 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) },
1007010070 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) },
1007110071 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) },
10072+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3098) },
1007210073 { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) },
1007310074 { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) },
1007410075 { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) },
drivers/net/usb/usbnet.c+3−1
@@ -1767,7 +1767,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) · 1766 unmodified lines
17671767 // can rename the link if it knows better.
17681768 if ((dev->driver_info->flags & FLAG_ETHER) != 0 &&
17691769 ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 ||
1770− (net->dev_addr [0] & 0x02) == 0))
1770+ /* somebody touched it*/
1771+ !is_zero_ether_addr(net->dev_addr)))
17711772 strscpy(net->name, "eth%d", sizeof(net->name));
17721773 /* WLAN devices should always be named "wlan%d" */
17731774 if ((dev->driver_info->flags & FLAG_WLAN) != 0)
@@ -1870,6 +1871,7 @@ out1: · 96 unmodified lines
18701871 * may trigger an error resubmitting itself and, worse,
18711872 * schedule a timer. So we kill it all just in case.
18721873 */
1874+ usbnet_mark_going_away(dev);
18731875 cancel_work_sync(&dev->kevent);
18741876 del_timer_sync(&dev->delay);
18751877 free_netdev(net);
drivers/net/virtio_net.c+1−1
@@ -4155,7 +4155,7 @@ struct virtnet_stats_ctx { · 4154 unmodified lines
41554155 u32 desc_num[3];
41564156
41574157 /* The actual supported stat types. */
4158− u32 bitmap[3];
4158+ u64 bitmap[3];
41594159
41604160 /* Used to calculate the reply buffer size. */
41614161 u32 size[3];
drivers/net/vmxnet3/vmxnet3_xdp.c+1−1
@@ -148,7 +148,7 @@ vmxnet3_xdp_xmit_frame(struct vmxnet3_adapter *adapter, · 147 unmodified lines
148148 } else { /* XDP buffer from page pool */
149149 page = virt_to_page(xdpf->data);
150150 tbi->dma_addr = page_pool_get_dma_addr(page) +
151− VMXNET3_XDP_HEADROOM;
151+ (xdpf->data - (void *)xdpf);
152152 dma_sync_single_for_device(&adapter->pdev->dev,
153153 tbi->dma_addr, buf_size,
154154 DMA_TO_DEVICE);
drivers/net/vxlan/vxlan_core.c+5−1
@@ -4913,9 +4913,13 @@ static int __init vxlan_init_module(void) · 4912 unmodified lines
49134913 if (rc)
49144914 goto out4;
49154915
4916− vxlan_vnifilter_init();
4916+ rc = vxlan_vnifilter_init();
4917+ if (rc)
4918+ goto out5;
49174919
49184920 return 0;
4921+out5:
4922+ rtnl_link_unregister(&vxlan_link_ops);
49194923 out4:
49204924 unregister_switchdev_notifier(&vxlan_switchdev_notifier_block);
49214925 out3:
drivers/net/vxlan/vxlan_private.h+1−1
@@ -202,7 +202,7 @@ int vxlan_vni_in_use(struct net *src_net, struct vxlan_dev *vxlan, · 201 unmodified lines
202202 int vxlan_vnigroup_init(struct vxlan_dev *vxlan);
203203 void vxlan_vnigroup_uninit(struct vxlan_dev *vxlan);
204204
205−void vxlan_vnifilter_init(void);
205+int vxlan_vnifilter_init(void);
206206 void vxlan_vnifilter_uninit(void);
207207 void vxlan_vnifilter_count(struct vxlan_dev *vxlan, __be32 vni,
208208 struct vxlan_vni_node *vninode,
drivers/net/vxlan/vxlan_vnifilter.c+9−10
@@ -992,19 +992,18 @@ static int vxlan_vnifilter_process(struct sk_buff *skb, struct nlmsghdr *nlh, · 991 unmodified lines
992992 return err;
993993 }
994994
995−void vxlan_vnifilter_init(void)
995+static const struct rtnl_msg_handler vxlan_vnifilter_rtnl_msg_handlers[] = {
996+ {THIS_MODULE, PF_BRIDGE, RTM_GETTUNNEL, NULL, vxlan_vnifilter_dump, 0},
997+ {THIS_MODULE, PF_BRIDGE, RTM_NEWTUNNEL, vxlan_vnifilter_process, NULL, 0},
998+ {THIS_MODULE, PF_BRIDGE, RTM_DELTUNNEL, vxlan_vnifilter_process, NULL, 0},
999+};
1000+
1001+int vxlan_vnifilter_init(void)
9961002 {
997− rtnl_register_module(THIS_MODULE, PF_BRIDGE, RTM_GETTUNNEL, NULL,
998− vxlan_vnifilter_dump, 0);
999− rtnl_register_module(THIS_MODULE, PF_BRIDGE, RTM_NEWTUNNEL,
1000− vxlan_vnifilter_process, NULL, 0);
1001− rtnl_register_module(THIS_MODULE, PF_BRIDGE, RTM_DELTUNNEL,
1002− vxlan_vnifilter_process, NULL, 0);
1003+ return rtnl_register_many(vxlan_vnifilter_rtnl_msg_handlers);
10031004 }
10041005
10051006 void vxlan_vnifilter_uninit(void)
10061007 {
1007− rtnl_unregister(PF_BRIDGE, RTM_GETTUNNEL);
1008− rtnl_unregister(PF_BRIDGE, RTM_NEWTUNNEL);
1009− rtnl_unregister(PF_BRIDGE, RTM_DELTUNNEL);
1008+ rtnl_unregister_many(vxlan_vnifilter_rtnl_msg_handlers);
10101009 }
drivers/net/wireless/ath/ath10k/wmi-tlv.c+6−1
@@ -3043,9 +3043,14 @@ ath10k_wmi_tlv_op_cleanup_mgmt_tx_send(struct ath10k *ar, · 3042 unmodified lines
30433043 struct sk_buff *msdu)
30443044 {
30453045 struct ath10k_skb_cb *cb = ATH10K_SKB_CB(msdu);
3046+ struct ath10k_mgmt_tx_pkt_addr *pkt_addr;
30463047 struct ath10k_wmi *wmi = &ar->wmi;
30473048
3048− idr_remove(&wmi->mgmt_pending_tx, cb->msdu_id);
3049+ spin_lock_bh(&ar->data_lock);
3050+ pkt_addr = idr_remove(&wmi->mgmt_pending_tx, cb->msdu_id);
3051+ spin_unlock_bh(&ar->data_lock);
3052+
3053+ kfree(pkt_addr);
30493054
30503055 return 0;
30513056 }
drivers/net/wireless/ath/ath10k/wmi.c+2−0
@@ -2441,6 +2441,7 @@ wmi_process_mgmt_tx_comp(struct ath10k *ar, struct mgmt_tx_compl_params *param) · 2440 unmodified lines
24412441 dma_unmap_single(ar->dev, pkt_addr->paddr,
24422442 msdu->len, DMA_TO_DEVICE);
24432443 info = IEEE80211_SKB_CB(msdu);
2444+ kfree(pkt_addr);
24442445
24452446 if (param->status) {
24462447 info->flags &= ~IEEE80211_TX_STAT_ACK;
@@ -9612,6 +9613,7 @@ static int ath10k_wmi_mgmt_tx_clean_up_pending(int msdu_id, void *ptr, · 7165 unmodified lines
96129613 dma_unmap_single(ar->dev, pkt_addr->paddr,
96139614 msdu->len, DMA_TO_DEVICE);
96149615 ieee80211_free_txskb(ar->hw, msdu);
9616+ kfree(pkt_addr);
96159617
96169618 return 0;
96179619 }
drivers/net/wireless/ath/ath11k/dp_rx.c+5−2
@@ -5291,8 +5291,11 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, · 5290 unmodified lines
52915291 hal_status == HAL_TLV_STATUS_PPDU_DONE) {
52925292 rx_mon_stats->status_ppdu_done++;
52935293 pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE;
5294− ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi);
5295− pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
5294+ if (!ab->hw_params.full_monitor_mode) {
5295+ ath11k_dp_rx_mon_dest_process(ar, mac_id,
5296+ budget, napi);
5297+ pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
5298+ }
52965299 }
52975300
52985301 if (ppdu_info->peer_id == HAL_INVALID_PEERID ||
drivers/net/wireless/ath/wil6210/txrx.c+1−1
@@ -306,7 +306,7 @@ static void wil_rx_add_radiotap_header(struct wil6210_priv *wil, · 305 unmodified lines
306306 struct sk_buff *skb)
307307 {
308308 struct wil6210_rtap {
309− struct ieee80211_radiotap_header rthdr;
309+ struct ieee80211_radiotap_header_fixed rthdr;
310310 /* fields should be in the order of bits in rthdr.it_present */
311311 /* flags */
312312 u8 flags;
drivers/net/wireless/broadcom/brcm80211/Kconfig+1−0
@@ -27,6 +27,7 @@ source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig" · 26 unmodified lines
2727 config BRCM_TRACING
2828 bool "Broadcom device tracing"
2929 depends on BRCMSMAC || BRCMFMAC
30+ depends on TRACING
3031 help
3132 If you say Y here, the Broadcom wireless drivers will register
3233 with ftrace to dump event information into the trace ringbuffer.
drivers/net/wireless/intel/ipw2x00/ipw2100.c+1−1
@@ -2518,7 +2518,7 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i, · 2517 unmodified lines
25182518 * to build this manually element by element, we can write it much
25192519 * more efficiently than we can parse it. ORDER MATTERS HERE */
25202520 struct ipw_rt_hdr {
2521− struct ieee80211_radiotap_header rt_hdr;
2521+ struct ieee80211_radiotap_header_fixed rt_hdr;
25222522 s8 rt_dbmsignal; /* signal in dbM, kluged to signed */
25232523 } *ipw_rt;
25242524
drivers/net/wireless/intel/ipw2x00/ipw2200.h+1−1
@@ -1143,7 +1143,7 @@ struct ipw_prom_priv { · 1142 unmodified lines
11431143 * structure is provided regardless of any bits unset.
11441144 */
11451145 struct ipw_rt_hdr {
1146− struct ieee80211_radiotap_header rt_hdr;
1146+ struct ieee80211_radiotap_header_fixed rt_hdr;
11471147 u64 rt_tsf; /* TSF */ /* XXX */
11481148 u8 rt_flags; /* radiotap packet flags */
11491149 u8 rt_rate; /* rate in 500kb/s */
drivers/net/wireless/intel/iwlegacy/common.c+14−1
@@ -3122,6 +3122,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd) · 3121 unmodified lines
31223122 struct il_cmd_meta *out_meta;
31233123 dma_addr_t phys_addr;
31243124 unsigned long flags;
3125+ u8 *out_payload;
31253126 u32 idx;
31263127 u16 fix_size;
31273128
@@ -3157,6 +3158,16 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd) · 29 unmodified lines
31573158 out_cmd = txq->cmd[idx];
31583159 out_meta = &txq->meta[idx];
31593160
3161+ /* The payload is in the same place in regular and huge
3162+ * command buffers, but we need to let the compiler know when
3163+ * we're using a larger payload buffer to avoid "field-
3164+ * spanning write" warnings at run-time for huge commands.
3165+ */
3166+ if (cmd->flags & CMD_SIZE_HUGE)
3167+ out_payload = ((struct il_device_cmd_huge *)out_cmd)->cmd.payload;
3168+ else
3169+ out_payload = out_cmd->cmd.payload;
3170+
31603171 if (WARN_ON(out_meta->flags & CMD_MAPPED)) {
31613172 spin_unlock_irqrestore(&il->hcmd_lock, flags);
31623173 return -ENOSPC;
@@ -3170,7 +3181,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd) · 7 unmodified lines
31703181 out_meta->callback = cmd->callback;
31713182
31723183 out_cmd->hdr.cmd = cmd->id;
3173− memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len);
3184+ memcpy(out_payload, cmd->data, cmd->len);
31743185
31753186 /* At this point, the out_cmd now has all of the incoming cmd
31763187 * information */
@@ -4962,6 +4973,8 @@ il_pci_resume(struct device *device) · 1785 unmodified lines
49624973 */
49634974 pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);
49644975
4976+ _il_wr(il, CSR_INT, 0xffffffff);
4977+ _il_wr(il, CSR_FH_INT_STATUS, 0xffffffff);
49654978 il_enable_interrupts(il);
49664979
49674980 if (!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
drivers/net/wireless/intel/iwlegacy/common.h+12−0
@@ -560,6 +560,18 @@ struct il_device_cmd { · 559 unmodified lines
560560
561561 #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct il_device_cmd))
562562
563+/**
564+ * struct il_device_cmd_huge
565+ *
566+ * For use when sending huge commands.
567+ */
568+struct il_device_cmd_huge {
569+ struct il_cmd_header hdr; /* uCode API */
570+ union {
571+ u8 payload[IL_MAX_CMD_SIZE - sizeof(struct il_cmd_header)];
572+ } __packed cmd;
573+} __packed;
574+
563575 struct il_host_cmd {
564576 const void *data;
565577 unsigned long reply_page;
drivers/net/wireless/intel/iwlwifi/fw/acpi.c+58−38
@@ -429,38 +429,28 @@ out_free: · 428 unmodified lines
429429 return ret;
430430 }
431431
432−static int iwl_acpi_sar_set_profile(union acpi_object *table,
433− struct iwl_sar_profile *profile,
434− bool enabled, u8 num_chains,
435− u8 num_sub_bands)
432+static int
433+iwl_acpi_parse_chains_table(union acpi_object *table,
434+ struct iwl_sar_profile_chain *chains,
435+ u8 num_chains, u8 num_sub_bands)
436436 {
437− int i, j, idx = 0;
438−
439− /*
440− * The table from ACPI is flat, but we store it in a
441− * structured array.
442− */
443− for (i = 0; i < BIOS_SAR_MAX_CHAINS_PER_PROFILE; i++) {
444− for (j = 0; j < BIOS_SAR_MAX_SUB_BANDS_NUM; j++) {
437+ for (u8 chain = 0; chain < num_chains; chain++) {
438+ for (u8 subband = 0; subband < BIOS_SAR_MAX_SUB_BANDS_NUM;
439+ subband++) {
445440 /* if we don't have the values, use the default */
446− if (i >= num_chains || j >= num_sub_bands) {
447− profile->chains[i].subbands[j] = 0;
441+ if (subband >= num_sub_bands) {
442+ chains[chain].subbands[subband] = 0;
443+ } else if (table->type != ACPI_TYPE_INTEGER ||
444+ table->integer.value > U8_MAX) {
445+ return -EINVAL;
448446 } else {
449− if (table[idx].type != ACPI_TYPE_INTEGER ||
450− table[idx].integer.value > U8_MAX)
451− return -EINVAL;
452−
453− profile->chains[i].subbands[j] =
454− table[idx].integer.value;
455−
456− idx++;
447+ chains[chain].subbands[subband] =
448+ table->integer.value;
449+ table++;
457450 }
458451 }
459452 }
460453
461− /* Only if all values were valid can the profile be enabled */
462− profile->enabled = enabled;
463−
464454 return 0;
465455 }
466456
@@ -543,9 +533,11 @@ read_table: · 76 unmodified lines
543533 /* The profile from WRDS is officially profile 1, but goes
544534 * into sar_profiles[0] (because we don't have a profile 0).
545535 */
546− ret = iwl_acpi_sar_set_profile(table, &fwrt->sar_profiles[0],
547− flags & IWL_SAR_ENABLE_MSK,
548− num_chains, num_sub_bands);
536+ ret = iwl_acpi_parse_chains_table(table, fwrt->sar_profiles[0].chains,
537+ num_chains, num_sub_bands);
538+ if (!ret && flags & IWL_SAR_ENABLE_MSK)
539+ fwrt->sar_profiles[0].enabled = true;
540+
549541 out_free:
550542 kfree(data);
551543 return ret;
@@ -557,7 +549,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) · 5 unmodified lines
557549 bool enabled;
558550 int i, n_profiles, tbl_rev, pos;
559551 int ret = 0;
560− u8 num_chains, num_sub_bands;
552+ u8 num_sub_bands;
561553
562554 data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD);
563555 if (IS_ERR(data))
@@ -573,7 +565,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) · 9 unmodified lines
573565 goto out_free;
574566 }
575567
576− num_chains = ACPI_SAR_NUM_CHAINS_REV2;
577568 num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV2;
578569
579570 goto read_table;
@@ -589,7 +580,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) · 9 unmodified lines
589580 goto out_free;
590581 }
591582
592− num_chains = ACPI_SAR_NUM_CHAINS_REV1;
593583 num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV1;
594584
595585 goto read_table;
@@ -605,7 +595,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) · 9 unmodified lines
605595 goto out_free;
606596 }
607597
608− num_chains = ACPI_SAR_NUM_CHAINS_REV0;
609598 num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV0;
610599
611600 goto read_table;
@@ -637,23 +626,54 @@ read_table: · 25 unmodified lines
637626 /* the tables start at element 3 */
638627 pos = 3;
639628
629+ BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV0 != ACPI_SAR_NUM_CHAINS_REV1);
630+ BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV2 != 2 * ACPI_SAR_NUM_CHAINS_REV0);
631+
632+ /* parse non-cdb chains for all profiles */
640633 for (i = 0; i < n_profiles; i++) {
641634 union acpi_object *table = &wifi_pkg->package.elements[pos];
635+
642636 /* The EWRD profiles officially go from 2 to 4, but we
643637 * save them in sar_profiles[1-3] (because we don't
644638 * have profile 0). So in the array we start from 1.
645639 */
646− ret = iwl_acpi_sar_set_profile(table,
647− &fwrt->sar_profiles[i + 1],
648− enabled, num_chains,
649− num_sub_bands);
640+ ret = iwl_acpi_parse_chains_table(table,
641+ fwrt->sar_profiles[i + 1].chains,
642+ ACPI_SAR_NUM_CHAINS_REV0,
643+ num_sub_bands);
650644 if (ret < 0)
651− break;
645+ goto out_free;
652646
653647 /* go to the next table */
654− pos += num_chains * num_sub_bands;
648+ pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands;
655649 }
656650
651+ /* non-cdb table revisions */
652+ if (tbl_rev < 2)
653+ goto set_enabled;
654+
655+ /* parse cdb chains for all profiles */
656+ for (i = 0; i < n_profiles; i++) {
657+ struct iwl_sar_profile_chain *chains;
658+ union acpi_object *table;
659+
660+ table = &wifi_pkg->package.elements[pos];
661+ chains = &fwrt->sar_profiles[i + 1].chains[ACPI_SAR_NUM_CHAINS_REV0];
662+ ret = iwl_acpi_parse_chains_table(table,
663+ chains,
664+ ACPI_SAR_NUM_CHAINS_REV0,
665+ num_sub_bands);
666+ if (ret < 0)
667+ goto out_free;
668+
669+ /* go to the next table */
670+ pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands;
671+ }
672+
673+set_enabled:
674+ for (i = 0; i < n_profiles; i++)
675+ fwrt->sar_profiles[i + 1].enabled = enabled;
676+
657677 out_free:
658678 kfree(data);
659679 return ret;
drivers/net/wireless/intel/iwlwifi/fw/init.c+3−1
@@ -39,10 +39,12 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, · 38 unmodified lines
3939 }
4040 IWL_EXPORT_SYMBOL(iwl_fw_runtime_init);
4141
42+/* Assumes the appropriate lock is held by the caller */
4243 void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt)
4344 {
4445 iwl_fw_suspend_timestamp(fwrt);
45− iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, NULL);
46+ iwl_dbg_tlv_time_point_sync(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START,
47+ NULL);
4648 }
4749 IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend);
4850
drivers/net/wireless/intel/iwlwifi/iwl-drv.c+19−9
@@ -1413,25 +1413,35 @@ _iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op) · 1412 unmodified lines
14131413 const struct iwl_op_mode_ops *ops = op->ops;
14141414 struct dentry *dbgfs_dir = NULL;
14151415 struct iwl_op_mode *op_mode = NULL;
1416+ int retry, max_retry = !!iwlwifi_mod_params.fw_restart * IWL_MAX_INIT_RETRY;
14161417
14171418 /* also protects start/stop from racing against each other */
14181419 lockdep_assert_held(&iwlwifi_opmode_table_mtx);
14191420
1421+ for (retry = 0; retry <= max_retry; retry++) {
1422+
14201423 #ifdef CONFIG_IWLWIFI_DEBUGFS
1421− drv->dbgfs_op_mode = debugfs_create_dir(op->name,
1422− drv->dbgfs_drv);
1423− dbgfs_dir = drv->dbgfs_op_mode;
1424+ drv->dbgfs_op_mode = debugfs_create_dir(op->name,
1425+ drv->dbgfs_drv);
1426+ dbgfs_dir = drv->dbgfs_op_mode;
14241427 #endif
14251428
1426− op_mode = ops->start(drv->trans, drv->trans->cfg,
1427− &drv->fw, dbgfs_dir);
1428− if (op_mode)
1429− return op_mode;
1429+ op_mode = ops->start(drv->trans, drv->trans->cfg,
1430+ &drv->fw, dbgfs_dir);
1431+
1432+ if (op_mode)
1433+ return op_mode;
1434+
1435+ if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status))
1436+ break;
1437+
1438+ IWL_ERR(drv, "retry init count %d\n", retry);
14301439
14311440 #ifdef CONFIG_IWLWIFI_DEBUGFS
1432− debugfs_remove_recursive(drv->dbgfs_op_mode);
1433− drv->dbgfs_op_mode = NULL;
1441+ debugfs_remove_recursive(drv->dbgfs_op_mode);
1442+ drv->dbgfs_op_mode = NULL;
14341443 #endif
1444+ }
14351445
14361446 return NULL;
14371447 }
drivers/net/wireless/intel/iwlwifi/iwl-drv.h+3−0
@@ -98,6 +98,9 @@ void iwl_drv_stop(struct iwl_drv *drv); · 97 unmodified lines
9898 #define VISIBLE_IF_IWLWIFI_KUNIT static
9999 #endif
100100
101+/* max retry for init flow */
102+#define IWL_MAX_INIT_RETRY 2
103+
101104 #define FW_NAME_PRE_BUFSIZE 64
102105 struct iwl_trans;
103106 const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf);
drivers/net/wireless/intel/iwlwifi/mvm/d3.c+2−0
@@ -1398,7 +1398,9 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) · 1397 unmodified lines
13981398
13991399 iwl_mvm_pause_tcm(mvm, true);
14001400
1401+ mutex_lock(&mvm->mutex);
14011402 iwl_fw_runtime_suspend(&mvm->fwrt);
1403+ mutex_unlock(&mvm->mutex);
14021404
14031405 return __iwl_mvm_suspend(hw, wowlan, false);
14041406 }
drivers/net/wireless/intel/iwlwifi/mvm/fw.c+4−6
@@ -1307,8 +1307,8 @@ static void iwl_mvm_disconnect_iterator(void *data, u8 *mac, · 1306 unmodified lines
13071307 void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
13081308 {
13091309 u32 error_log_size = mvm->fw->ucode_capa.error_log_size;
1310+ u32 status = 0;
13101311 int ret;
1311− u32 resp;
13121312
13131313 struct iwl_fw_error_recovery_cmd recovery_cmd = {
13141314 .flags = cpu_to_le32(flags),
@@ -1316,7 +1316,6 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) · 1 unmodified line
13161316 };
13171317 struct iwl_host_cmd host_cmd = {
13181318 .id = WIDE_ID(SYSTEM_GROUP, FW_ERROR_RECOVERY_CMD),
1319− .flags = CMD_WANT_SKB,
13201319 .data = {&recovery_cmd, },
13211320 .len = {sizeof(recovery_cmd), },
13221321 };
@@ -1336,7 +1335,7 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) · 13 unmodified lines
13361335 recovery_cmd.buf_size = cpu_to_le32(error_log_size);
13371336 }
13381337
1339− ret = iwl_mvm_send_cmd(mvm, &host_cmd);
1338+ ret = iwl_mvm_send_cmd_status(mvm, &host_cmd, &status);
13401339 kfree(mvm->error_recovery_buf);
13411340 mvm->error_recovery_buf = NULL;
13421341
@@ -1347,11 +1346,10 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) · 4 unmodified lines
13471346
13481347 /* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */
13491348 if (flags & ERROR_RECOVERY_UPDATE_DB) {
1350− resp = le32_to_cpu(*(__le32 *)host_cmd.resp_pkt->data);
1351− if (resp) {
1349+ if (status) {
13521350 IWL_ERR(mvm,
13531351 "Failed to send recovery cmd blob was invalid %d\n",
1354− resp);
1352+ status);
13551353
13561354 ieee80211_iterate_interfaces(mvm->hw, 0,
13571355 iwl_mvm_disconnect_iterator,
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+10−2
@@ -1293,12 +1293,14 @@ int iwl_mvm_mac_start(struct ieee80211_hw *hw) · 1292 unmodified lines
12931293 {
12941294 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
12951295 int ret;
1296+ int retry, max_retry = 0;
12961297
12971298 mutex_lock(&mvm->mutex);
12981299
12991300 /* we are starting the mac not in error flow, and restart is enabled */
13001301 if (!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) &&
13011302 iwlwifi_mod_params.fw_restart) {
1303+ max_retry = IWL_MAX_INIT_RETRY;
13021304 /*
13031305 * This will prevent mac80211 recovery flows to trigger during
13041306 * init failures
@@ -1306,7 +1308,13 @@ int iwl_mvm_mac_start(struct ieee80211_hw *hw) · 1 unmodified line
13061308 set_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
13071309 }
13081310
1309− ret = __iwl_mvm_mac_start(mvm);
1311+ for (retry = 0; retry <= max_retry; retry++) {
1312+ ret = __iwl_mvm_mac_start(mvm);
1313+ if (!ret)
1314+ break;
1315+
1316+ IWL_ERR(mvm, "mac start retry %d\n", retry);
1317+ }
13101318 clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
13111319
13121320 mutex_unlock(&mvm->mutex);
@@ -1970,7 +1978,6 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, · 657 unmodified lines
19701978 mvm->p2p_device_vif = NULL;
19711979 }
19721980
1973− iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf);
19741981 iwl_mvm_mac_ctxt_remove(mvm, vif);
19751982
19761983 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);
@@ -1979,6 +1986,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, · 2 unmodified lines
19791986 mvm->monitor_on = false;
19801987
19811988 out:
1989+ iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf);
19821990 if (vif->type == NL80211_IFTYPE_AP ||
19831991 vif->type == NL80211_IFTYPE_ADHOC) {
19841992 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->deflink.mcast_sta);
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c+23−11
@@ -41,8 +41,6 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw, · 40 unmodified lines
4141 /* reset deflink MLO parameters */
4242 mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
4343 mvmvif->deflink.active = 0;
44− /* the first link always points to the default one */
45− mvmvif->link[0] = &mvmvif->deflink;
4644
4745 ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif);
4846 if (ret)
@@ -60,9 +58,19 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw, · 11 unmodified lines
6058 IEEE80211_VIF_SUPPORTS_CQM_RSSI;
6159 }
6260
63− ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
64− if (ret)
65− goto out_free_bf;
61+ /* We want link[0] to point to the default link, unless we have MLO and
62+ * in this case this will be modified later by .change_vif_links()
63+ * If we are in the restart flow with an MLD connection, we will wait
64+ * to .change_vif_links() to setup the links.
65+ */
66+ if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) ||
67+ !ieee80211_vif_is_mld(vif)) {
68+ mvmvif->link[0] = &mvmvif->deflink;
69+
70+ ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
71+ if (ret)
72+ goto out_free_bf;
73+ }
6674
6775 /* Save a pointer to p2p device vif, so it can later be used to
6876 * update the p2p device MAC when a GO is started/stopped
@@ -350,11 +358,6 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, · 281 unmodified lines
350358 rcu_read_unlock();
351359 }
352360
353− if (vif->type == NL80211_IFTYPE_STATION)
354− iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif,
355− link_conf,
356− false);
357−
358361 /* then activate */
359362 ret = iwl_mvm_link_changed(mvm, vif, link_conf,
360363 LINK_CONTEXT_MODIFY_ACTIVE |
@@ -363,6 +366,11 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, · 2 unmodified lines
363366 if (ret)
364367 goto out;
365368
369+ if (vif->type == NL80211_IFTYPE_STATION)
370+ iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif,
371+ link_conf,
372+ false);
373+
366374 /*
367375 * Power state must be updated before quotas,
368376 * otherwise fw will complain.
@@ -1194,7 +1202,11 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, · 825 unmodified lines
11941202
11951203 mutex_lock(&mvm->mutex);
11961204
1197− if (old_links == 0) {
1205+ /* If we're in RESTART flow, the default link wasn't added in
1206+ * drv_add_interface(), and link[0] doesn't point to it.
1207+ */
1208+ if (old_links == 0 && !test_bit(IWL_MVM_STATUS_IN_HW_RESTART,
1209+ &mvm->status)) {
11981210 err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
11991211 if (err)
12001212 goto out_err;
drivers/net/wireless/intel/iwlwifi/mvm/scan.c+3−3
@@ -1774,7 +1774,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm, · 1773 unmodified lines
17741774 &cp->channel_config[ch_cnt];
17751775
17761776 u32 s_ssid_bitmap = 0, bssid_bitmap = 0, flags = 0;
1777− u8 j, k, n_s_ssids = 0, n_bssids = 0;
1777+ u8 k, n_s_ssids = 0, n_bssids = 0;
17781778 u8 max_s_ssids, max_bssids;
17791779 bool force_passive = false, found = false, allow_passive = true,
17801780 unsolicited_probe_on_chan = false, psc_no_listen = false;
@@ -1799,7 +1799,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm, · 18 unmodified lines
17991799 cfg->v5.iter_count = 1;
18001800 cfg->v5.iter_interval = 0;
18011801
1802− for (j = 0; j < params->n_6ghz_params; j++) {
1802+ for (u32 j = 0; j < params->n_6ghz_params; j++) {
18031803 s8 tmp_psd_20;
18041804
18051805 if (!(scan_6ghz_params[j].channel_idx == i))
@@ -1873,7 +1873,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm, · 67 unmodified lines
18731873 * SSID.
18741874 * TODO: improve this logic
18751875 */
1876− for (j = 0; j < params->n_6ghz_params; j++) {
1876+ for (u32 j = 0; j < params->n_6ghz_params; j++) {
18771877 if (!(scan_6ghz_params[j].channel_idx == i))
18781878 continue;
18791879
drivers/net/wireless/marvell/libertas/radiotap.h+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #include <net/ieee80211_radiotap.h>
33
44 struct tx_radiotap_hdr {
5− struct ieee80211_radiotap_header hdr;
5+ struct ieee80211_radiotap_header_fixed hdr;
66 u8 rate;
77 u8 txpower;
88 u8 rts_retries;
@@ -31,7 +31,7 @@ struct tx_radiotap_hdr { · 22 unmodified lines
3131 #define IEEE80211_FC_DSTODS 0x0300
3232
3333 struct rx_radiotap_hdr {
34− struct ieee80211_radiotap_header hdr;
34+ struct ieee80211_radiotap_header_fixed hdr;
3535 u8 flags;
3636 u8 rate;
3737 u8 antsignal;
drivers/net/wireless/mediatek/mt76/mcu.c+5−2
@@ -84,13 +84,16 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb, · 83 unmodified lines
8484 mutex_lock(&dev->mcu.mutex);
8585
8686 if (dev->mcu_ops->mcu_skb_prepare_msg) {
87+ orig_skb = skb;
8788 ret = dev->mcu_ops->mcu_skb_prepare_msg(dev, skb, cmd, &seq);
8889 if (ret < 0)
8990 goto out;
9091 }
9192
9293 retry:
93− orig_skb = skb_get(skb);
94+ /* orig skb might be needed for retry, mcu_skb_send_msg consumes it */
95+ if (orig_skb)
96+ skb_get(orig_skb);
9497 ret = dev->mcu_ops->mcu_skb_send_msg(dev, skb, cmd, &seq);
9598 if (ret < 0)
9699 goto out;
@@ -105,7 +108,7 @@ retry: · 8 unmodified lines
105108 do {
106109 skb = mt76_mcu_get_response(dev, expires);
107110 if (!skb && !test_bit(MT76_MCU_RESET, &dev->phy.state) &&
108− retry++ < dev->mcu_ops->max_retry) {
111+ orig_skb && retry++ < dev->mcu_ops->max_retry) {
109112 dev_err(dev->dev, "Retry message %08x (seq %d)\n",
110113 cmd, seq);
111114 skb = orig_skb;
drivers/net/wireless/microchip/wilc1000/mon.c+2−2
@@ -7,12 +7,12 @@ · 6 unmodified lines
77 #include "cfg80211.h"
88
99 struct wilc_wfi_radiotap_hdr {
10− struct ieee80211_radiotap_header hdr;
10+ struct ieee80211_radiotap_header_fixed hdr;
1111 u8 rate;
1212 } __packed;
1313
1414 struct wilc_wfi_radiotap_cb_hdr {
15− struct ieee80211_radiotap_header hdr;
15+ struct ieee80211_radiotap_header_fixed hdr;
1616 u8 rate;
1717 u8 dump;
1818 u16 tx_flags;
drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c+0−1
@@ -352,7 +352,6 @@ static const struct usb_device_id rtl8192d_usb_ids[] = { · 351 unmodified lines
352352 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8194, rtl92du_hal_cfg)},
353353 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8111, rtl92du_hal_cfg)},
354354 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x0193, rtl92du_hal_cfg)},
355− {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8171, rtl92du_hal_cfg)},
356355 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0xe194, rtl92du_hal_cfg)},
357356 {RTL_USB_DEVICE(0x2019, 0xab2c, rtl92du_hal_cfg)},
358357 {RTL_USB_DEVICE(0x2019, 0xab2d, rtl92du_hal_cfg)},
drivers/net/wireless/realtek/rtw88/usb.c+0−1
@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(struct rtw_dev *rtwdev, bool enable) · 770 unmodified lines
771771 u8 size, timeout;
772772 u16 val16;
773773
774− rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
775774 rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
776775 rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
777776
drivers/net/wireless/realtek/rtw89/coex.c+2−0
@@ -6445,6 +6445,8 @@ static void _update_wl_info_v7(struct rtw89_dev *rtwdev, u8 rid) · 6444 unmodified lines
64456445
64466446 /* todo DBCC related event */
64476447 rtw89_debug(rtwdev, RTW89_DBG_BTC, "[BTC] wl_info phy_now=%d\n", phy_now);
6448+ rtw89_debug(rtwdev, RTW89_DBG_BTC,
6449+ "[BTC] rlink cnt_2g=%d cnt_5g=%d\n", cnt_2g, cnt_5g);
64486450
64496451 if (wl_rinfo->dbcc_en != rtwdev->dbcc_en) {
64506452 wl_rinfo->dbcc_chg = 1;
drivers/net/wireless/realtek/rtw89/pci.c+41−7
@@ -3026,24 +3026,54 @@ static void rtw89_pci_declaim_device(struct rtw89_dev *rtwdev, · 3025 unmodified lines
30263026 pci_disable_device(pdev);
30273027 }
30283028
3029−static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev)
3029+static bool rtw89_pci_chip_is_manual_dac(struct rtw89_dev *rtwdev)
30303030 {
3031− struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
30323031 const struct rtw89_chip_info *chip = rtwdev->chip;
30333032
3034− if (!rtwpci->enable_dac)
3035− return;
3036−
30373033 switch (chip->chip_id) {
30383034 case RTL8852A:
30393035 case RTL8852B:
30403036 case RTL8851B:
30413037 case RTL8852BT:
3042− break;
3038+ return true;
30433039 default:
3044− return;
3040+ return false;
3041+ }
3042+}
3043+
3044+static bool rtw89_pci_is_dac_compatible_bridge(struct rtw89_dev *rtwdev)
3045+{
3046+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
3047+ struct pci_dev *bridge = pci_upstream_bridge(rtwpci->pdev);
3048+
3049+ if (!rtw89_pci_chip_is_manual_dac(rtwdev))
3050+ return true;
3051+
3052+ if (!bridge)
3053+ return false;
3054+
3055+ switch (bridge->vendor) {
3056+ case PCI_VENDOR_ID_INTEL:
3057+ return true;
3058+ case PCI_VENDOR_ID_ASMEDIA:
3059+ if (bridge->device == 0x2806)
3060+ return true;
3061+ break;
30453062 }
30463063
3064+ return false;
3065+}
3066+
3067+static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev)
3068+{
3069+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
3070+
3071+ if (!rtwpci->enable_dac)
3072+ return;
3073+
3074+ if (!rtw89_pci_chip_is_manual_dac(rtwdev))
3075+ return;
3076+
30473077 rtw89_pci_config_byte_set(rtwdev, RTW89_PCIE_L1_CTRL, RTW89_PCIE_BIT_EN_64BITS);
30483078 }
30493079
@@ -3061,6 +3091,9 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev, · 11 unmodified lines
30613091 goto err;
30623092 }
30633093
3094+ if (!rtw89_pci_is_dac_compatible_bridge(rtwdev))
3095+ goto no_dac;
3096+
30643097 ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36));
30653098 if (!ret) {
30663099 rtwpci->enable_dac = true;
@@ -3073,6 +3106,7 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev, · 6 unmodified lines
30733106 goto err_release_regions;
30743107 }
30753108 }
3109+no_dac:
30763110
30773111 resource_len = pci_resource_len(pdev, bar_id);
30783112 rtwpci->mmap = pci_iomap(pdev, bar_id, resource_len);
drivers/net/wireless/virtual/mac80211_hwsim.c+2−2
@@ -763,7 +763,7 @@ static const struct rhashtable_params hwsim_rht_params = { · 762 unmodified lines
763763 };
764764
765765 struct hwsim_radiotap_hdr {
766− struct ieee80211_radiotap_header hdr;
766+ struct ieee80211_radiotap_header_fixed hdr;
767767 __le64 rt_tsft;
768768 u8 rt_flags;
769769 u8 rt_rate;
@@ -772,7 +772,7 @@ struct hwsim_radiotap_hdr { · 2 unmodified lines
772772 } __packed;
773773
774774 struct hwsim_radiotap_ack_hdr {
775− struct ieee80211_radiotap_header hdr;
775+ struct ieee80211_radiotap_header_fixed hdr;
776776 u8 rt_flags;
777777 u8 pad;
778778 __le16 rt_channel;
drivers/net/wwan/wwan_core.c+1−1
@@ -1038,7 +1038,7 @@ static const struct nla_policy wwan_rtnl_policy[IFLA_WWAN_MAX + 1] = { · 1037 unmodified lines
10381038
10391039 static struct rtnl_link_ops wwan_rtnl_link_ops __read_mostly = {
10401040 .kind = "wwan",
1041− .maxtype = __IFLA_WWAN_MAX,
1041+ .maxtype = IFLA_WWAN_MAX,
10421042 .alloc = wwan_rtnl_alloc,
10431043 .validate = wwan_rtnl_validate,
10441044 .newlink = wwan_rtnl_newlink,
drivers/nvme/host/core.c+59−38
@@ -91,6 +91,17 @@ module_param(apst_secondary_latency_tol_us, ulong, 0644); · 90 unmodified lines
9191 MODULE_PARM_DESC(apst_secondary_latency_tol_us,
9292 "secondary APST latency tolerance in us");
9393
94+/*
95+ * Older kernels didn't enable protection information if it was at an offset.
96+ * Newer kernels do, so it breaks reads on the upgrade if such formats were
97+ * used in prior kernels since the metadata written did not contain a valid
98+ * checksum.
99+ */
100+static bool disable_pi_offsets = false;
101+module_param(disable_pi_offsets, bool, 0444);
102+MODULE_PARM_DESC(disable_pi_offsets,
103+ "disable protection information if it has an offset");
104+
94105 /*
95106 * nvme_wq - hosts nvme related works that are not reset or delete
96107 * nvme_reset_wq - hosts nvme reset works
@@ -1292,14 +1303,12 @@ static void nvme_queue_keep_alive_work(struct nvme_ctrl *ctrl) · 1195 unmodified lines
12921303 queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
12931304 }
12941305
1295−static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq,
1296− blk_status_t status)
1306+static void nvme_keep_alive_finish(struct request *rq,
1307+ blk_status_t status, struct nvme_ctrl *ctrl)
12971308 {
1298− struct nvme_ctrl *ctrl = rq->end_io_data;
1299− unsigned long flags;
1300− bool startka = false;
13011309 unsigned long rtt = jiffies - (rq->deadline - rq->timeout);
13021310 unsigned long delay = nvme_keep_alive_work_period(ctrl);
1311+ enum nvme_ctrl_state state = nvme_ctrl_state(ctrl);
13031312
13041313 /*
13051314 * Subtract off the keepalive RTT so nvme_keep_alive_work runs
@@ -1313,25 +1322,17 @@ static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq, · 7 unmodified lines
13131322 delay = 0;
13141323 }
13151324
1316− blk_mq_free_request(rq);
1317−
13181325 if (status) {
13191326 dev_err(ctrl->device,
13201327 "failed nvme_keep_alive_end_io error=%d\n",
13211328 status);
1322− return RQ_END_IO_NONE;
1329+ return;
13231330 }
13241331
13251332 ctrl->ka_last_check_time = jiffies;
13261333 ctrl->comp_seen = false;
1327− spin_lock_irqsave(&ctrl->lock, flags);
1328− if (ctrl->state == NVME_CTRL_LIVE ||
1329− ctrl->state == NVME_CTRL_CONNECTING)
1330− startka = true;
1331− spin_unlock_irqrestore(&ctrl->lock, flags);
1332− if (startka)
1334+ if (state == NVME_CTRL_LIVE || state == NVME_CTRL_CONNECTING)
13331335 queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
1334− return RQ_END_IO_NONE;
13351336 }
13361337
13371338 static void nvme_keep_alive_work(struct work_struct *work)
@@ -1340,6 +1341,7 @@ static void nvme_keep_alive_work(struct work_struct *work) · 2 unmodified lines
13401341 struct nvme_ctrl, ka_work);
13411342 bool comp_seen = ctrl->comp_seen;
13421343 struct request *rq;
1344+ blk_status_t status;
13431345
13441346 ctrl->ka_last_check_time = jiffies;
13451347
@@ -1362,9 +1364,9 @@ static void nvme_keep_alive_work(struct work_struct *work) · 16 unmodified lines
13621364 nvme_init_request(rq, &ctrl->ka_cmd);
13631365
13641366 rq->timeout = ctrl->kato * HZ;
1365− rq->end_io = nvme_keep_alive_end_io;
1366− rq->end_io_data = ctrl;
1367− blk_execute_rq_nowait(rq, false);
1367+ status = blk_execute_rq(rq, false);
1368+ nvme_keep_alive_finish(rq, status, ctrl);
1369+ blk_mq_free_request(rq);
13681370 }
13691371
13701372 static void nvme_start_keep_alive(struct nvme_ctrl *ctrl)
@@ -1399,17 +1401,30 @@ static void nvme_update_keep_alive(struct nvme_ctrl *ctrl, · 28 unmodified lines
13991401 nvme_start_keep_alive(ctrl);
14001402 }
14011403
1402−/*
1403− * In NVMe 1.0 the CNS field was just a binary controller or namespace
1404− * flag, thus sending any new CNS opcodes has a big chance of not working.
1405− * Qemu unfortunately had that bug after reporting a 1.1 version compliance
1406− * (but not for any later version).
1407− */
1408−static bool nvme_ctrl_limited_cns(struct nvme_ctrl *ctrl)
1404+static bool nvme_id_cns_ok(struct nvme_ctrl *ctrl, u8 cns)
14091405 {
1410− if (ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS)
1411− return ctrl->vs < NVME_VS(1, 2, 0);
1412− return ctrl->vs < NVME_VS(1, 1, 0);
1406+ /*
1407+ * The CNS field occupies a full byte starting with NVMe 1.2
1408+ */
1409+ if (ctrl->vs >= NVME_VS(1, 2, 0))
1410+ return true;
1411+
1412+ /*
1413+ * NVMe 1.1 expanded the CNS value to two bits, which means values
1414+ * larger than that could get truncated and treated as an incorrect
1415+ * value.
1416+ *
1417+ * Qemu implemented 1.0 behavior for controllers claiming 1.1
1418+ * compliance, so they need to be quirked here.
1419+ */
1420+ if (ctrl->vs >= NVME_VS(1, 1, 0) &&
1421+ !(ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS))
1422+ return cns <= 3;
1423+
1424+ /*
1425+ * NVMe 1.0 used a single bit for the CNS value.
1426+ */
1427+ return cns <= 1;
14131428 }
14141429
14151430 static int nvme_identify_ctrl(struct nvme_ctrl *dev, struct nvme_id_ctrl **id)
@@ -1922,8 +1937,12 @@ static void nvme_configure_metadata(struct nvme_ctrl *ctrl, · 506 unmodified lines
19221937
19231938 if (head->pi_size && head->ms >= head->pi_size)
19241939 head->pi_type = id->dps & NVME_NS_DPS_PI_MASK;
1925− if (!(id->dps & NVME_NS_DPS_PI_FIRST))
1926− info->pi_offset = head->ms - head->pi_size;
1940+ if (!(id->dps & NVME_NS_DPS_PI_FIRST)) {
1941+ if (disable_pi_offsets)
1942+ head->pi_type = 0;
1943+ else
1944+ info->pi_offset = head->ms - head->pi_size;
1945+ }
19271946
19281947 if (ctrl->ops->flags & NVME_F_FABRICS) {
19291948 /*
@@ -2458,8 +2477,13 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl) · 528 unmodified lines
24582477 else
24592478 ctrl->ctrl_config = NVME_CC_CSS_NVM;
24602479
2461− if (ctrl->cap & NVME_CAP_CRMS_CRWMS && ctrl->cap & NVME_CAP_CRMS_CRIMS)
2462− ctrl->ctrl_config |= NVME_CC_CRIME;
2480+ /*
2481+ * Setting CRIME results in CSTS.RDY before the media is ready. This
2482+ * makes it possible for media related commands to return the error
2483+ * NVME_SC_ADMIN_COMMAND_MEDIA_NOT_READY. Until the driver is
2484+ * restructured to handle retries, disable CC.CRIME.
2485+ */
2486+ ctrl->ctrl_config &= ~NVME_CC_CRIME;
24632487
24642488 ctrl->ctrl_config |= (NVME_CTRL_PAGE_SHIFT - 12) << NVME_CC_MPS_SHIFT;
24652489 ctrl->ctrl_config |= NVME_CC_AMS_RR | NVME_CC_SHN_NONE;
@@ -2489,10 +2513,7 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl) · 23 unmodified lines
24892513 * devices are known to get this wrong. Use the larger of the
24902514 * two values.
24912515 */
2492− if (ctrl->ctrl_config & NVME_CC_CRIME)
2493− ready_timeout = NVME_CRTO_CRIMT(crto);
2494− else
2495− ready_timeout = NVME_CRTO_CRWMT(crto);
2516+ ready_timeout = NVME_CRTO_CRWMT(crto);
24962517
24972518 if (ready_timeout < timeout)
24982519 dev_warn_once(ctrl->device, "bad crto:%x cap:%llx\n",
@@ -3111,7 +3132,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl) · 612 unmodified lines
31113132 ctrl->max_zeroes_sectors = 0;
31123133
31133134 if (ctrl->subsys->subtype != NVME_NQN_NVME ||
3114− nvme_ctrl_limited_cns(ctrl) ||
3135+ !nvme_id_cns_ok(ctrl, NVME_ID_CNS_CS_CTRL) ||
31153136 test_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags))
31163137 return 0;
31173138
@@ -4207,7 +4228,7 @@ static void nvme_scan_work(struct work_struct *work) · 1089 unmodified lines
42074228 }
42084229
42094230 mutex_lock(&ctrl->scan_lock);
4210− if (nvme_ctrl_limited_cns(ctrl)) {
4231+ if (!nvme_id_cns_ok(ctrl, NVME_ID_CNS_NS_ACTIVE_LIST)) {
42114232 nvme_scan_ns_sequential(ctrl);
42124233 } else {
42134234 /*
drivers/nvme/host/ioctl.c+5−2
@@ -421,10 +421,13 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req, · 420 unmodified lines
421421 struct io_uring_cmd *ioucmd = req->end_io_data;
422422 struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
423423
424− if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
424+ if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {
425425 pdu->status = -EINTR;
426− else
426+ } else {
427427 pdu->status = nvme_req(req)->status;
428+ if (!pdu->status)
429+ pdu->status = blk_status_to_errno(err);
430+ }
428431 pdu->result = le64_to_cpu(nvme_req(req)->result.u64);
429432
430433 /*
drivers/nvme/host/multipath.c+33−7
@@ -431,7 +431,6 @@ static bool nvme_available_path(struct nvme_ns_head *head) · 430 unmodified lines
431431 case NVME_CTRL_LIVE:
432432 case NVME_CTRL_RESETTING:
433433 case NVME_CTRL_CONNECTING:
434− /* fallthru */
435434 return true;
436435 default:
437436 break;
@@ -580,6 +579,20 @@ static int nvme_add_ns_head_cdev(struct nvme_ns_head *head) · 142 unmodified lines
580579 return ret;
581580 }
582581
582+static void nvme_partition_scan_work(struct work_struct *work)
583+{
584+ struct nvme_ns_head *head =
585+ container_of(work, struct nvme_ns_head, partition_scan_work);
586+
587+ if (WARN_ON_ONCE(!test_and_clear_bit(GD_SUPPRESS_PART_SCAN,
588+ &head->disk->state)))
589+ return;
590+
591+ mutex_lock(&head->disk->open_mutex);
592+ bdev_disk_changed(head->disk, false);
593+ mutex_unlock(&head->disk->open_mutex);
594+}
595+
583596 static void nvme_requeue_work(struct work_struct *work)
584597 {
585598 struct nvme_ns_head *head =
@@ -606,6 +619,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head) · 20 unmodified lines
606619 bio_list_init(&head->requeue_list);
607620 spin_lock_init(&head->requeue_lock);
608621 INIT_WORK(&head->requeue_work, nvme_requeue_work);
622+ INIT_WORK(&head->partition_scan_work, nvme_partition_scan_work);
609623
610624 /*
611625 * Add a multipath node if the subsystems supports multiple controllers.
@@ -629,6 +643,16 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head) · 17 unmodified lines
629643 return PTR_ERR(head->disk);
630644 head->disk->fops = &nvme_ns_head_ops;
631645 head->disk->private_data = head;
646+
647+ /*
648+ * We need to suppress the partition scan from occuring within the
649+ * controller's scan_work context. If a path error occurs here, the IO
650+ * will wait until a path becomes available or all paths are torn down,
651+ * but that action also occurs within scan_work, so it would deadlock.
652+ * Defer the partion scan to a different context that does not block
653+ * scan_work.
654+ */
655+ set_bit(GD_SUPPRESS_PART_SCAN, &head->disk->state);
632656 sprintf(head->disk->disk_name, "nvme%dn%d",
633657 ctrl->subsys->instance, head->instance);
634658 return 0;
@@ -655,6 +679,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns) · 20 unmodified lines
655679 return;
656680 }
657681 nvme_add_ns_head_cdev(head);
682+ kblockd_schedule_work(&head->partition_scan_work);
658683 }
659684
660685 mutex_lock(&head->lock);
@@ -974,14 +999,14 @@ void nvme_mpath_shutdown_disk(struct nvme_ns_head *head) · 313 unmodified lines
974999 return;
9751000 if (test_and_clear_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
9761001 nvme_cdev_del(&head->cdev, &head->cdev_device);
1002+ /*
1003+ * requeue I/O after NVME_NSHEAD_DISK_LIVE has been cleared
1004+ * to allow multipath to fail all I/O.
1005+ */
1006+ synchronize_srcu(&head->srcu);
1007+ kblockd_schedule_work(&head->requeue_work);
9771008 del_gendisk(head->disk);
9781009 }
979− /*
980− * requeue I/O after NVME_NSHEAD_DISK_LIVE has been cleared
981− * to allow multipath to fail all I/O.
982− */
983− synchronize_srcu(&head->srcu);
984− kblockd_schedule_work(&head->requeue_work);
9851010 }
9861011
9871012 void nvme_mpath_remove_disk(struct nvme_ns_head *head)
@@ -991,6 +1016,7 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head) · 3 unmodified lines
9911016 /* make sure all pending bios are cleaned up */
9921017 kblockd_schedule_work(&head->requeue_work);
9931018 flush_work(&head->requeue_work);
1019+ flush_work(&head->partition_scan_work);
9941020 put_disk(head->disk);
9951021 }
9961022
drivers/nvme/host/nvme.h+1−0
@@ -494,6 +494,7 @@ struct nvme_ns_head { · 493 unmodified lines
494494 struct bio_list requeue_list;
495495 spinlock_t requeue_lock;
496496 struct work_struct requeue_work;
497+ struct work_struct partition_scan_work;
497498 struct mutex lock;
498499 unsigned long flags;
499500 #define NVME_NSHEAD_DISK_LIVE 0
drivers/nvme/host/pci.c+16−3
@@ -2506,17 +2506,29 @@ static unsigned int nvme_pci_nr_maps(struct nvme_dev *dev) · 2505 unmodified lines
25062506 return 1;
25072507 }
25082508
2509−static void nvme_pci_update_nr_queues(struct nvme_dev *dev)
2509+static bool nvme_pci_update_nr_queues(struct nvme_dev *dev)
25102510 {
25112511 if (!dev->ctrl.tagset) {
25122512 nvme_alloc_io_tag_set(&dev->ctrl, &dev->tagset, &nvme_mq_ops,
25132513 nvme_pci_nr_maps(dev), sizeof(struct nvme_iod));
2514− return;
2514+ return true;
2515+ }
2516+
2517+ /* Give up if we are racing with nvme_dev_disable() */
2518+ if (!mutex_trylock(&dev->shutdown_lock))
2519+ return false;
2520+
2521+ /* Check if nvme_dev_disable() has been executed already */
2522+ if (!dev->online_queues) {
2523+ mutex_unlock(&dev->shutdown_lock);
2524+ return false;
25152525 }
25162526
25172527 blk_mq_update_nr_hw_queues(&dev->tagset, dev->online_queues - 1);
25182528 /* free previously allocated queues that are no longer usable */
25192529 nvme_free_queues(dev, dev->online_queues);
2530+ mutex_unlock(&dev->shutdown_lock);
2531+ return true;
25202532 }
25212533
25222534 static int nvme_pci_enable(struct nvme_dev *dev)
@@ -2797,7 +2809,8 @@ static void nvme_reset_work(struct work_struct *work) · 274 unmodified lines
27972809 nvme_dbbuf_set(dev);
27982810 nvme_unquiesce_io_queues(&dev->ctrl);
27992811 nvme_wait_freeze(&dev->ctrl);
2800− nvme_pci_update_nr_queues(dev);
2812+ if (!nvme_pci_update_nr_queues(dev))
2813+ goto out;
28012814 nvme_unfreeze(&dev->ctrl);
28022815 } else {
28032816 dev_warn(dev->ctrl.device, "IO queues lost\n");
drivers/nvme/host/tcp.c+4−3
@@ -2644,10 +2644,11 @@ static int nvme_tcp_get_address(struct nvme_ctrl *ctrl, char *buf, int size) · 2643 unmodified lines
26442644
26452645 len = nvmf_get_address(ctrl, buf, size);
26462646
2647+ if (!test_bit(NVME_TCP_Q_LIVE, &queue->flags))
2648+ return len;
2649+
26472650 mutex_lock(&queue->queue_lock);
26482651
2649− if (!test_bit(NVME_TCP_Q_LIVE, &queue->flags))
2650− goto done;
26512652 ret = kernel_getsockname(queue->sock, (struct sockaddr *)&src_addr);
26522653 if (ret > 0) {
26532654 if (len > 0)
@@ -2655,7 +2656,7 @@ static int nvme_tcp_get_address(struct nvme_ctrl *ctrl, char *buf, int size) · 1 unmodified line
26552656 len += scnprintf(buf + len, size - len, "%ssrc_addr=%pISc\n",
26562657 (len) ? "," : "", &src_addr);
26572658 }
2658−done:
2659+
26592660 mutex_unlock(&queue->queue_lock);
26602661
26612662 return len;
drivers/nvme/target/auth.c+1−0
@@ -115,6 +115,7 @@ int nvmet_setup_dhgroup(struct nvmet_ctrl *ctrl, u8 dhgroup_id) · 114 unmodified lines
115115 pr_debug("%s: ctrl %d failed to generate private key, err %d\n",
116116 __func__, ctrl->cntlid, ret);
117117 kfree_sensitive(ctrl->dh_key);
118+ ctrl->dh_key = NULL;
118119 return ret;
119120 }
120121 ctrl->dh_keysize = crypto_kpp_maxsize(ctrl->dh_tfm);
drivers/nvme/target/loop.c+13−0
@@ -265,6 +265,13 @@ static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl) · 264 unmodified lines
265265 {
266266 if (!test_and_clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags))
267267 return;
268+ /*
269+ * It's possible that some requests might have been added
270+ * after admin queue is stopped/quiesced. So now start the
271+ * queue to flush these requests to the completion.
272+ */
273+ nvme_unquiesce_admin_queue(&ctrl->ctrl);
274+
268275 nvmet_sq_destroy(&ctrl->queues[0].nvme_sq);
269276 nvme_remove_admin_tag_set(&ctrl->ctrl);
270277 }
@@ -297,6 +304,12 @@ static void nvme_loop_destroy_io_queues(struct nvme_loop_ctrl *ctrl) · 26 unmodified lines
297304 nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
298305 }
299306 ctrl->ctrl.queue_count = 1;
307+ /*
308+ * It's possible that some requests might have been added
309+ * after io queue is stopped/quiesced. So now start the
310+ * queue to flush these requests to the completion.
311+ */
312+ nvme_unquiesce_io_queues(&ctrl->ctrl);
300313 }
301314
302315 static int nvme_loop_init_io_queues(struct nvme_loop_ctrl *ctrl)
drivers/nvme/target/passthru.c+2−4
@@ -535,10 +535,6 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req) · 534 unmodified lines
535535 break;
536536 case nvme_admin_identify:
537537 switch (req->cmd->identify.cns) {
538− case NVME_ID_CNS_CTRL:
539− req->execute = nvmet_passthru_execute_cmd;
540− req->p.use_workqueue = true;
541− return NVME_SC_SUCCESS;
542538 case NVME_ID_CNS_CS_CTRL:
543539 switch (req->cmd->identify.csi) {
544540 case NVME_CSI_ZNS:
@@ -547,7 +543,9 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req) · 2 unmodified lines
547543 return NVME_SC_SUCCESS;
548544 }
549545 return NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
546+ case NVME_ID_CNS_CTRL:
550547 case NVME_ID_CNS_NS:
548+ case NVME_ID_CNS_NS_DESC_LIST:
551549 req->execute = nvmet_passthru_execute_cmd;
552550 req->p.use_workqueue = true;
553551 return NVME_SC_SUCCESS;
drivers/nvme/target/rdma.c+27−29
@@ -39,6 +39,8 @@ · 38 unmodified lines
3939
4040 #define NVMET_RDMA_BACKLOG 128
4141
42+#define NVMET_RDMA_DISCRETE_RSP_TAG -1
43+
4244 struct nvmet_rdma_srq;
4345
4446 struct nvmet_rdma_cmd {
@@ -75,7 +77,7 @@ struct nvmet_rdma_rsp { · 30 unmodified lines
7577 u32 invalidate_rkey;
7678
7779 struct list_head wait_list;
78− struct list_head free_list;
80+ int tag;
7981 };
8082
8183 enum nvmet_rdma_queue_state {
@@ -98,8 +100,7 @@ struct nvmet_rdma_queue { · 16 unmodified lines
98100 struct nvmet_sq nvme_sq;
99101
100102 struct nvmet_rdma_rsp *rsps;
101− struct list_head free_rsps;
102− spinlock_t rsps_lock;
103+ struct sbitmap rsp_tags;
103104 struct nvmet_rdma_cmd *cmds;
104105
105106 struct work_struct release_work;
@@ -172,7 +173,8 @@ static void nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue); · 66 unmodified lines
172173 static void nvmet_rdma_free_rsp(struct nvmet_rdma_device *ndev,
173174 struct nvmet_rdma_rsp *r);
174175 static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev,
175− struct nvmet_rdma_rsp *r);
176+ struct nvmet_rdma_rsp *r,
177+ int tag);
176178
177179 static const struct nvmet_fabrics_ops nvmet_rdma_ops;
178180
@@ -210,15 +212,12 @@ static inline bool nvmet_rdma_need_data_out(struct nvmet_rdma_rsp *rsp) · 31 unmodified lines
210212 static inline struct nvmet_rdma_rsp *
211213 nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue)
212214 {
213− struct nvmet_rdma_rsp *rsp;
214− unsigned long flags;
215+ struct nvmet_rdma_rsp *rsp = NULL;
216+ int tag;
215217
216− spin_lock_irqsave(&queue->rsps_lock, flags);
217− rsp = list_first_entry_or_null(&queue->free_rsps,
218− struct nvmet_rdma_rsp, free_list);
219− if (likely(rsp))
220− list_del(&rsp->free_list);
221− spin_unlock_irqrestore(&queue->rsps_lock, flags);
218+ tag = sbitmap_get(&queue->rsp_tags);
219+ if (tag >= 0)
220+ rsp = &queue->rsps[tag];
222221
223222 if (unlikely(!rsp)) {
224223 int ret;
@@ -226,13 +225,12 @@ nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue) · 1 unmodified line
226225 rsp = kzalloc(sizeof(*rsp), GFP_KERNEL);
227226 if (unlikely(!rsp))
228227 return NULL;
229− ret = nvmet_rdma_alloc_rsp(queue->dev, rsp);
228+ ret = nvmet_rdma_alloc_rsp(queue->dev, rsp,
229+ NVMET_RDMA_DISCRETE_RSP_TAG);
230230 if (unlikely(ret)) {
231231 kfree(rsp);
232232 return NULL;
233233 }
234−
235− rsp->allocated = true;
236234 }
237235
238236 return rsp;
@@ -241,17 +239,13 @@ nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue) · 2 unmodified lines
241239 static inline void
242240 nvmet_rdma_put_rsp(struct nvmet_rdma_rsp *rsp)
243241 {
244− unsigned long flags;
245−
246− if (unlikely(rsp->allocated)) {
242+ if (unlikely(rsp->tag == NVMET_RDMA_DISCRETE_RSP_TAG)) {
247243 nvmet_rdma_free_rsp(rsp->queue->dev, rsp);
248244 kfree(rsp);
249245 return;
250246 }
251247
252− spin_lock_irqsave(&rsp->queue->rsps_lock, flags);
253− list_add_tail(&rsp->free_list, &rsp->queue->free_rsps);
254− spin_unlock_irqrestore(&rsp->queue->rsps_lock, flags);
248+ sbitmap_clear_bit(&rsp->queue->rsp_tags, rsp->tag);
255249 }
256250
257251 static void nvmet_rdma_free_inline_pages(struct nvmet_rdma_device *ndev,
@@ -404,7 +398,7 @@ static void nvmet_rdma_free_cmds(struct nvmet_rdma_device *ndev, · 146 unmodified lines
404398 }
405399
406400 static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev,
407− struct nvmet_rdma_rsp *r)
401+ struct nvmet_rdma_rsp *r, int tag)
408402 {
409403 /* NVMe CQE / RDMA SEND */
410404 r->req.cqe = kmalloc(sizeof(*r->req.cqe), GFP_KERNEL);
@@ -432,6 +426,7 @@ static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev, · 21 unmodified lines
432426 r->read_cqe.done = nvmet_rdma_read_data_done;
433427 /* Data Out / RDMA WRITE */
434428 r->write_cqe.done = nvmet_rdma_write_data_done;
429+ r->tag = tag;
435430
436431 return 0;
437432
@@ -454,21 +449,23 @@ nvmet_rdma_alloc_rsps(struct nvmet_rdma_queue *queue) · 16 unmodified lines
454449 {
455450 struct nvmet_rdma_device *ndev = queue->dev;
456451 int nr_rsps = queue->recv_queue_size * 2;
457− int ret = -EINVAL, i;
452+ int ret = -ENOMEM, i;
453+
454+ if (sbitmap_init_node(&queue->rsp_tags, nr_rsps, -1, GFP_KERNEL,
455+ NUMA_NO_NODE, false, true))
456+ goto out;
458457
459458 queue->rsps = kcalloc(nr_rsps, sizeof(struct nvmet_rdma_rsp),
460459 GFP_KERNEL);
461460 if (!queue->rsps)
462− goto out;
461+ goto out_free_sbitmap;
463462
464463 for (i = 0; i < nr_rsps; i++) {
465464 struct nvmet_rdma_rsp *rsp = &queue->rsps[i];
466465
467− ret = nvmet_rdma_alloc_rsp(ndev, rsp);
466+ ret = nvmet_rdma_alloc_rsp(ndev, rsp, i);
468467 if (ret)
469468 goto out_free;
470−
471− list_add_tail(&rsp->free_list, &queue->free_rsps);
472469 }
473470
474471 return 0;
@@ -477,6 +474,8 @@ out_free: · 2 unmodified lines
477474 while (--i >= 0)
478475 nvmet_rdma_free_rsp(ndev, &queue->rsps[i]);
479476 kfree(queue->rsps);
477+out_free_sbitmap:
478+ sbitmap_free(&queue->rsp_tags);
480479 out:
481480 return ret;
482481 }
@@ -489,6 +488,7 @@ static void nvmet_rdma_free_rsps(struct nvmet_rdma_queue *queue) · 6 unmodified lines
489488 for (i = 0; i < nr_rsps; i++)
490489 nvmet_rdma_free_rsp(ndev, &queue->rsps[i]);
491490 kfree(queue->rsps);
491+ sbitmap_free(&queue->rsp_tags);
492492 }
493493
494494 static int nvmet_rdma_post_recv(struct nvmet_rdma_device *ndev,
@@ -1447,8 +1447,6 @@ nvmet_rdma_alloc_queue(struct nvmet_rdma_device *ndev, · 952 unmodified lines
14471447 INIT_LIST_HEAD(&queue->rsp_wait_list);
14481448 INIT_LIST_HEAD(&queue->rsp_wr_wait_list);
14491449 spin_lock_init(&queue->rsp_wr_wait_lock);
1450− INIT_LIST_HEAD(&queue->free_rsps);
1451− spin_lock_init(&queue->rsps_lock);
14521450 INIT_LIST_HEAD(&queue->queue_list);
14531451
14541452 queue->idx = ida_alloc(&nvmet_rdma_queue_ida, GFP_KERNEL);
drivers/of/of_kunit_helpers.c+15−0
@@ -10,6 +10,19 @@ · 9 unmodified lines
1010 #include <kunit/test.h>
1111 #include <kunit/resource.h>
1212
13+#include "of_private.h"
14+
15+/**
16+ * of_root_kunit_skip() - Skip test if the root node isn't populated
17+ * @test: test to skip if the root node isn't populated
18+ */
19+void of_root_kunit_skip(struct kunit *test)
20+{
21+ if (IS_ENABLED(CONFIG_ARM64) && IS_ENABLED(CONFIG_ACPI) && !of_root)
22+ kunit_skip(test, "arm64+acpi doesn't populate a root node");
23+}
24+EXPORT_SYMBOL_GPL(of_root_kunit_skip);
25+
1326 #if defined(CONFIG_OF_OVERLAY) && defined(CONFIG_OF_EARLY_FLATTREE)
1427
1528 static void of_overlay_fdt_apply_kunit_exit(void *ovcs_id)
@@ -36,6 +49,8 @@ int of_overlay_fdt_apply_kunit(struct kunit *test, void *overlay_fdt, · 20 unmodified lines
3649 int ret;
3750 int *copy_id;
3851
52+ of_root_kunit_skip(test);
53+
3954 copy_id = kunit_kmalloc(test, sizeof(*copy_id), GFP_KERNEL);
4055 if (!copy_id)
4156 return -ENOMEM;
drivers/of/of_private.h+3−0
@@ -42,6 +42,9 @@ extern raw_spinlock_t devtree_lock; · 41 unmodified lines
4242 extern struct list_head aliases_lookup;
4343 extern struct kset *of_kset;
4444
45+struct kunit;
46+extern void of_root_kunit_skip(struct kunit *test);
47+
4548 #if defined(CONFIG_OF_DYNAMIC)
4649 extern int of_property_notify(int action, struct device_node *np,
4750 struct property *prop, struct property *old_prop);
drivers/of/of_test.c+3−0
@@ -7,6 +7,8 @@ · 6 unmodified lines
77
88 #include <kunit/test.h>
99
10+#include "of_private.h"
11+
1012 /*
1113 * Test that the root node "/" can be found by path.
1214 */
@@ -36,6 +38,7 @@ static struct kunit_case of_dtb_test_cases[] = { · 23 unmodified lines
3638
3739 static int of_dtb_test_init(struct kunit *test)
3840 {
41+ of_root_kunit_skip(test);
3942 if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
4043 kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE");
4144
drivers/of/overlay_test.c+4−1
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 #include <kunit/of.h>
1212 #include <kunit/test.h>
1313
14+#include "of_private.h"
15+
1416 static const char * const kunit_node_name = "kunit-test";
1517 static const char * const kunit_compatible = "test,empty";
1618
@@ -62,6 +64,7 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test) · 45 unmodified lines
6264 struct device *dev;
6365 struct device_node *np;
6466
67+ of_root_kunit_skip(test);
6568 if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
6669 kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node");
6770
@@ -73,7 +76,7 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test) · 5 unmodified lines
7376
7477 np = of_find_node_by_name(NULL, kunit_node_name);
7578 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, np);
76− of_node_put_kunit(test, np);
79+ of_node_put_kunit(&fake, np);
7780
7881 pdev = of_find_device_by_node(np);
7982 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pdev);
drivers/opp/core.c+3−1
@@ -2630,8 +2630,10 @@ int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) · 2629 unmodified lines
26302630
26312631 /* Attach genpds */
26322632 if (config->genpd_names) {
2633− if (config->required_devs)
2633+ if (config->required_devs) {
2634+ ret = -EINVAL;
26342635 goto err;
2636+ }
26352637
26362638 ret = _opp_attach_genpd(opp_table, dev, config->genpd_names,
26372639 config->virt_devs);
drivers/parport/procfs.c+11−11
@@ -51,12 +51,12 @@ static int do_active_device(const struct ctl_table *table, int write, · 50 unmodified lines
5151
5252 for (dev = port->devices; dev ; dev = dev->next) {
5353 if(dev == port->cad) {
54− len += snprintf(buffer, sizeof(buffer), "%s\n", dev->name);
54+ len += scnprintf(buffer, sizeof(buffer), "%s\n", dev->name);
5555 }
5656 }
5757
5858 if(!len) {
59− len += snprintf(buffer, sizeof(buffer), "%s\n", "none");
59+ len += scnprintf(buffer, sizeof(buffer), "%s\n", "none");
6060 }
6161
6262 if (len > *lenp)
@@ -87,19 +87,19 @@ static int do_autoprobe(const struct ctl_table *table, int write, · 24 unmodified lines
8787 }
8888
8989 if ((str = info->class_name) != NULL)
90− len += snprintf (buffer + len, sizeof(buffer) - len, "CLASS:%s;\n", str);
90+ len += scnprintf (buffer + len, sizeof(buffer) - len, "CLASS:%s;\n", str);
9191
9292 if ((str = info->model) != NULL)
93− len += snprintf (buffer + len, sizeof(buffer) - len, "MODEL:%s;\n", str);
93+ len += scnprintf (buffer + len, sizeof(buffer) - len, "MODEL:%s;\n", str);
9494
9595 if ((str = info->mfr) != NULL)
96− len += snprintf (buffer + len, sizeof(buffer) - len, "MANUFACTURER:%s;\n", str);
96+ len += scnprintf (buffer + len, sizeof(buffer) - len, "MANUFACTURER:%s;\n", str);
9797
9898 if ((str = info->description) != NULL)
99− len += snprintf (buffer + len, sizeof(buffer) - len, "DESCRIPTION:%s;\n", str);
99+ len += scnprintf (buffer + len, sizeof(buffer) - len, "DESCRIPTION:%s;\n", str);
100100
101101 if ((str = info->cmdset) != NULL)
102− len += snprintf (buffer + len, sizeof(buffer) - len, "COMMAND SET:%s;\n", str);
102+ len += scnprintf (buffer + len, sizeof(buffer) - len, "COMMAND SET:%s;\n", str);
103103
104104 if (len > *lenp)
105105 len = *lenp;
@@ -128,7 +128,7 @@ static int do_hardware_base_addr(const struct ctl_table *table, int write, · 22 unmodified lines
128128 if (write) /* permissions prevent this anyway */
129129 return -EACCES;
130130
131− len += snprintf (buffer, sizeof(buffer), "%lu\t%lu\n", port->base, port->base_hi);
131+ len += scnprintf (buffer, sizeof(buffer), "%lu\t%lu\n", port->base, port->base_hi);
132132
133133 if (len > *lenp)
134134 len = *lenp;
@@ -155,7 +155,7 @@ static int do_hardware_irq(const struct ctl_table *table, int write, · 20 unmodified lines
155155 if (write) /* permissions prevent this anyway */
156156 return -EACCES;
157157
158− len += snprintf (buffer, sizeof(buffer), "%d\n", port->irq);
158+ len += scnprintf (buffer, sizeof(buffer), "%d\n", port->irq);
159159
160160 if (len > *lenp)
161161 len = *lenp;
@@ -182,7 +182,7 @@ static int do_hardware_dma(const struct ctl_table *table, int write, · 20 unmodified lines
182182 if (write) /* permissions prevent this anyway */
183183 return -EACCES;
184184
185− len += snprintf (buffer, sizeof(buffer), "%d\n", port->dma);
185+ len += scnprintf (buffer, sizeof(buffer), "%d\n", port->dma);
186186
187187 if (len > *lenp)
188188 len = *lenp;
@@ -213,7 +213,7 @@ static int do_hardware_modes(const struct ctl_table *table, int write, · 24 unmodified lines
213213 #define printmode(x) \
214214 do { \
215215 if (port->modes & PARPORT_MODE_##x) \
216− len += snprintf(buffer + len, sizeof(buffer) - len, "%s%s", f++ ? "," : "", #x); \
216+ len += scnprintf(buffer + len, sizeof(buffer) - len, "%s%s", f++ ? "," : "", #x); \
217217 } while (0)
218218 int f = 0;
219219 printmode(PCSPP);
drivers/pci/pci.c+9−5
@@ -1067,8 +1067,15 @@ static void pci_std_enable_acs(struct pci_dev *dev, struct pci_acs *caps) · 1066 unmodified lines
10671067 static void pci_enable_acs(struct pci_dev *dev)
10681068 {
10691069 struct pci_acs caps;
1070+ bool enable_acs = false;
10701071 int pos;
10711072
1073+ /* If an iommu is present we start with kernel default caps */
1074+ if (pci_acs_enable) {
1075+ if (pci_dev_specific_enable_acs(dev))
1076+ enable_acs = true;
1077+ }
1078+
10721079 pos = dev->acs_cap;
10731080 if (!pos)
10741081 return;
@@ -1077,11 +1084,8 @@ static void pci_enable_acs(struct pci_dev *dev) · 2 unmodified lines
10771084 pci_read_config_word(dev, pos + PCI_ACS_CTRL, &caps.ctrl);
10781085 caps.fw_ctrl = caps.ctrl;
10791086
1080− /* If an iommu is present we start with kernel default caps */
1081− if (pci_acs_enable) {
1082− if (pci_dev_specific_enable_acs(dev))
1083− pci_std_enable_acs(dev, &caps);
1084− }
1087+ if (enable_acs)
1088+ pci_std_enable_acs(dev, &caps);
10851089
10861090 /*
10871091 * Always apply caps from the command line, even if there is no iommu.
drivers/pci/probe.c+2−0
@@ -3105,7 +3105,9 @@ int pci_host_probe(struct pci_host_bridge *bridge) · 3104 unmodified lines
31053105 list_for_each_entry(child, &bus->children, node)
31063106 pcie_bus_configure_settings(child);
31073107
3108+ pci_lock_rescan_remove();
31083109 pci_bus_add_devices(bus);
3110+ pci_unlock_rescan_remove();
31093111 return 0;
31103112 }
31113113 EXPORT_SYMBOL_GPL(pci_host_probe);
drivers/pci/pwrctl/pci-pwrctl-pwrseq.c+50−5
@@ -6,9 +6,9 @@ · 5 unmodified lines
66 #include <linux/device.h>
77 #include <linux/mod_devicetable.h>
88 #include <linux/module.h>
9−#include <linux/of.h>
109 #include <linux/pci-pwrctl.h>
1110 #include <linux/platform_device.h>
11+#include <linux/property.h>
1212 #include <linux/pwrseq/consumer.h>
1313 #include <linux/slab.h>
1414 #include <linux/types.h>
@@ -18,6 +18,40 @@ struct pci_pwrctl_pwrseq_data { · 3 unmodified lines
1818 struct pwrseq_desc *pwrseq;
1919 };
2020
21+struct pci_pwrctl_pwrseq_pdata {
22+ const char *target;
23+ /*
24+ * Called before doing anything else to perform device-specific
25+ * verification between requesting the power sequencing handle.
26+ */
27+ int (*validate_device)(struct device *dev);
28+};
29+
30+static int pci_pwrctl_pwrseq_qcm_wcn_validate_device(struct device *dev)
31+{
32+ /*
33+ * Old device trees for some platforms already define wifi nodes for
34+ * the WCN family of chips since before power sequencing was added
35+ * upstream.
36+ *
37+ * These nodes don't consume the regulator outputs from the PMU, and
38+ * if we allow this driver to bind to one of such "incomplete" nodes,
39+ * we'll see a kernel log error about the indefinite probe deferral.
40+ *
41+ * Check the existence of the regulator supply that exists on all
42+ * WCN models before moving forward.
43+ */
44+ if (!device_property_present(dev, "vddaon-supply"))
45+ return -ENODEV;
46+
47+ return 0;
48+}
49+
50+static const struct pci_pwrctl_pwrseq_pdata pci_pwrctl_pwrseq_qcom_wcn_pdata = {
51+ .target = "wlan",
52+ .validate_device = pci_pwrctl_pwrseq_qcm_wcn_validate_device,
53+};
54+
2155 static void devm_pci_pwrctl_pwrseq_power_off(void *data)
2256 {
2357 struct pwrseq_desc *pwrseq = data;
@@ -27,15 +61,26 @@ static void devm_pci_pwrctl_pwrseq_power_off(void *data) · 3 unmodified lines
2761
2862 static int pci_pwrctl_pwrseq_probe(struct platform_device *pdev)
2963 {
64+ const struct pci_pwrctl_pwrseq_pdata *pdata;
3065 struct pci_pwrctl_pwrseq_data *data;
3166 struct device *dev = &pdev->dev;
3267 int ret;
3368
69+ pdata = device_get_match_data(dev);
70+ if (!pdata || !pdata->target)
71+ return -EINVAL;
72+
73+ if (pdata->validate_device) {
74+ ret = pdata->validate_device(dev);
75+ if (ret)
76+ return ret;
77+ }
78+
3479 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
3580 if (!data)
3681 return -ENOMEM;
3782
38− data->pwrseq = devm_pwrseq_get(dev, of_device_get_match_data(dev));
83+ data->pwrseq = devm_pwrseq_get(dev, pdata->target);
3984 if (IS_ERR(data->pwrseq))
4085 return dev_err_probe(dev, PTR_ERR(data->pwrseq),
4186 "Failed to get the power sequencer\n");
@@ -64,17 +109,17 @@ static const struct of_device_id pci_pwrctl_pwrseq_of_match[] = { · 22 unmodified lines
64109 {
65110 /* ATH11K in QCA6390 package. */
66111 .compatible = "pci17cb,1101",
67− .data = "wlan",
112+ .data = &pci_pwrctl_pwrseq_qcom_wcn_pdata,
68113 },
69114 {
70115 /* ATH11K in WCN6855 package. */
71116 .compatible = "pci17cb,1103",
72− .data = "wlan",
117+ .data = &pci_pwrctl_pwrseq_qcom_wcn_pdata,
73118 },
74119 {
75120 /* ATH12K in WCN7850 package. */
76121 .compatible = "pci17cb,1107",
77− .data = "wlan",
122+ .data = &pci_pwrctl_pwrseq_qcom_wcn_pdata,
78123 },
79124 { }
80125 };
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c+9−3
@@ -153,7 +153,9 @@ static void xhci_soft_reset(struct brcm_usb_init_params *params, · 152 unmodified lines
153153 } else {
154154 USB_CTRL_SET(ctrl, USB_PM, XHC_SOFT_RESETB);
155155 /* Required for COMMONONN to be set */
156− USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG, U2_FREECLK_EXISTS);
156+ if (params->supported_port_modes != USB_CTLR_MODE_DRD)
157+ USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG,
158+ U2_FREECLK_EXISTS);
157159 }
158160 }
159161
@@ -328,8 +330,12 @@ static void usb_init_common_7216(struct brcm_usb_init_params *params) · 168 unmodified lines
328330 /* 1 millisecond - for USB clocks to settle down */
329331 usleep_range(1000, 2000);
330332
331− /* Disable PHY when port is suspended */
332− USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);
333+ /*
334+ * Disable PHY when port is suspended
335+ * Does not work in DRD mode
336+ */
337+ if (params->supported_port_modes != USB_CTLR_MODE_DRD)
338+ USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);
333339
334340 usb_wake_enable_7216(params, false);
335341 usb_init_common(params);
drivers/phy/broadcom/phy-brcm-usb-init.c+2−0
@@ -220,6 +220,8 @@ usb_reg_bits_map_table[BRCM_FAMILY_COUNT][USB_CTRL_SELECTOR_COUNT] = { · 219 unmodified lines
220220 0, /* USB_CTRL_SETUP_SCB2_EN_MASK */
221221 0, /* USB_CTRL_SETUP_SS_EHCI64BIT_EN_MASK */
222222 0, /* USB_CTRL_SETUP_STRAP_IPP_SEL_MASK */
223+ 0, /* USB_CTRL_SETUP_OC3_DISABLE_PORT0_MASK */
224+ 0, /* USB_CTRL_SETUP_OC3_DISABLE_PORT1_MASK */
223225 0, /* USB_CTRL_SETUP_OC3_DISABLE_MASK */
224226 0, /* USB_CTRL_PLL_CTL_PLL_IDDQ_PWRDN_MASK */
225227 0, /* USB_CTRL_USB_PM_BDC_SOFT_RESETB_MASK */
drivers/phy/cadence/phy-cadence-sierra.c+11−10
@@ -174,8 +174,9 @@ · 173 unmodified lines
174174 #define SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG 0x150
175175 #define SIERRA_DEQ_TAU_CTRL2_PREG 0x151
176176 #define SIERRA_DEQ_TAU_CTRL3_PREG 0x152
177−#define SIERRA_DEQ_OPENEYE_CTRL_PREG 0x158
177+#define SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG 0x158
178178 #define SIERRA_DEQ_CONCUR_EPIOFFSET_MODE_PREG 0x159
179+#define SIERRA_DEQ_OPENEYE_CTRL_PREG 0x15C
179180 #define SIERRA_DEQ_PICTRL_PREG 0x161
180181 #define SIERRA_CPICAL_TMRVAL_MODE1_PREG 0x170
181182 #define SIERRA_CPICAL_TMRVAL_MODE0_PREG 0x171
@@ -1733,7 +1734,7 @@ static const struct cdns_reg_pairs ml_pcie_100_no_ssc_ln_regs[] = { · 1551 unmodified lines
17331734 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
17341735 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
17351736 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
1736− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
1737+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
17371738 {0x002B, SIERRA_CPI_TRIM_PREG},
17381739 {0x0003, SIERRA_EPI_CTRL_PREG},
17391740 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -1797,7 +1798,7 @@ static const struct cdns_reg_pairs ti_ml_pcie_100_no_ssc_ln_regs[] = { · 57 unmodified lines
17971798 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
17981799 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
17991800 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
1800− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
1801+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
18011802 {0x002B, SIERRA_CPI_TRIM_PREG},
18021803 {0x0003, SIERRA_EPI_CTRL_PREG},
18031804 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -1874,7 +1875,7 @@ static const struct cdns_reg_pairs ml_pcie_100_int_ssc_ln_regs[] = { · 70 unmodified lines
18741875 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
18751876 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
18761877 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
1877− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
1878+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
18781879 {0x002B, SIERRA_CPI_TRIM_PREG},
18791880 {0x0003, SIERRA_EPI_CTRL_PREG},
18801881 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -1941,7 +1942,7 @@ static const struct cdns_reg_pairs ti_ml_pcie_100_int_ssc_ln_regs[] = { · 60 unmodified lines
19411942 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
19421943 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
19431944 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
1944− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
1945+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
19451946 {0x002B, SIERRA_CPI_TRIM_PREG},
19461947 {0x0003, SIERRA_EPI_CTRL_PREG},
19471948 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -2012,7 +2013,7 @@ static const struct cdns_reg_pairs ml_pcie_100_ext_ssc_ln_regs[] = { · 64 unmodified lines
20122013 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
20132014 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
20142015 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
2015− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
2016+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
20162017 {0x002B, SIERRA_CPI_TRIM_PREG},
20172018 {0x0003, SIERRA_EPI_CTRL_PREG},
20182019 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -2079,7 +2080,7 @@ static const struct cdns_reg_pairs ti_ml_pcie_100_ext_ssc_ln_regs[] = { · 60 unmodified lines
20792080 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
20802081 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
20812082 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
2082− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
2083+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
20832084 {0x002B, SIERRA_CPI_TRIM_PREG},
20842085 {0x0003, SIERRA_EPI_CTRL_PREG},
20852086 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -2140,7 +2141,7 @@ static const struct cdns_reg_pairs cdns_pcie_ln_regs_no_ssc[] = { · 54 unmodified lines
21402141 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
21412142 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
21422143 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
2143− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
2144+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
21442145 {0x002B, SIERRA_CPI_TRIM_PREG},
21452146 {0x0003, SIERRA_EPI_CTRL_PREG},
21462147 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -2215,7 +2216,7 @@ static const struct cdns_reg_pairs cdns_pcie_ln_regs_int_ssc[] = { · 68 unmodified lines
22152216 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
22162217 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
22172218 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
2218− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
2219+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
22192220 {0x002B, SIERRA_CPI_TRIM_PREG},
22202221 {0x0003, SIERRA_EPI_CTRL_PREG},
22212222 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
@@ -2284,7 +2285,7 @@ static const struct cdns_reg_pairs cdns_pcie_ln_regs_ext_ssc[] = { · 62 unmodified lines
22842285 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG},
22852286 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG},
22862287 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG},
2287− {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG},
2288+ {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG},
22882289 {0x002B, SIERRA_CPI_TRIM_PREG},
22892290 {0x0003, SIERRA_EPI_CTRL_PREG},
22902291 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
drivers/phy/freescale/phy-fsl-imx8m-pcie.c+5−5
@@ -141,11 +141,6 @@ static int imx8_pcie_phy_power_on(struct phy *phy) · 140 unmodified lines
141141 IMX8MM_GPR_PCIE_REF_CLK_PLL);
142142 usleep_range(100, 200);
143143
144− /* Do the PHY common block reset */
145− regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14,
146− IMX8MM_GPR_PCIE_CMN_RST,
147− IMX8MM_GPR_PCIE_CMN_RST);
148−
149144 switch (imx8_phy->drvdata->variant) {
150145 case IMX8MP:
151146 reset_control_deassert(imx8_phy->perst);
@@ -156,6 +151,11 @@ static int imx8_pcie_phy_power_on(struct phy *phy) · 4 unmodified lines
156151 break;
157152 }
158153
154+ /* Do the PHY common block reset */
155+ regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14,
156+ IMX8MM_GPR_PCIE_CMN_RST,
157+ IMX8MM_GPR_PCIE_CMN_RST);
158+
159159 /* Polling to check the phy is ready or not. */
160160 ret = readl_poll_timeout(imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG075,
161161 val, val == ANA_PLL_DONE, 10, 20000);
drivers/phy/qualcomm/phy-qcom-qmp-combo.c+1−2
@@ -3673,6 +3673,7 @@ static int qmp_combo_probe(struct platform_device *pdev) · 3672 unmodified lines
36733673 return -ENOMEM;
36743674
36753675 qmp->dev = dev;
3676+ dev_set_drvdata(dev, qmp);
36763677
36773678 qmp->orientation = TYPEC_ORIENTATION_NORMAL;
36783679
@@ -3749,8 +3750,6 @@ static int qmp_combo_probe(struct platform_device *pdev) · 70 unmodified lines
37493750
37503751 phy_set_drvdata(qmp->dp_phy, qmp);
37513752
3752− dev_set_drvdata(dev, qmp);
3753−
37543753 if (usb_np == dev->of_node)
37553754 phy_provider = devm_of_phy_provider_register(dev, qmp_combo_phy_xlate);
37563755 else
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c+4−4
@@ -3661,8 +3661,8 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x2_pciephy_cfg = { · 3660 unmodified lines
36613661
36623662 .reset_list = sdm845_pciephy_reset_l,
36633663 .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
3664− .vreg_list = sm8550_qmp_phy_vreg_l,
3665− .num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l),
3664+ .vreg_list = qmp_phy_vreg_l,
3665+ .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
36663666 .regs = pciephy_v6_regs_layout,
36673667
36683668 .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
@@ -3695,8 +3695,8 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = { · 26 unmodified lines
36953695
36963696 .reset_list = sdm845_pciephy_reset_l,
36973697 .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
3698− .vreg_list = sm8550_qmp_phy_vreg_l,
3699− .num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l),
3698+ .vreg_list = qmp_phy_vreg_l,
3699+ .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
37003700 .regs = pciephy_v6_regs_layout,
37013701
37023702 .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c+1−0
@@ -1248,6 +1248,7 @@ static int qmp_usb_legacy_probe(struct platform_device *pdev) · 1247 unmodified lines
12481248 return -ENOMEM;
12491249
12501250 qmp->dev = dev;
1251+ dev_set_drvdata(dev, qmp);
12511252
12521253 qmp->cfg = of_device_get_match_data(dev);
12531254 if (!qmp->cfg)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c+1−0
@@ -2179,6 +2179,7 @@ static int qmp_usb_probe(struct platform_device *pdev) · 2178 unmodified lines
21792179 return -ENOMEM;
21802180
21812181 qmp->dev = dev;
2182+ dev_set_drvdata(dev, qmp);
21822183
21832184 qmp->cfg = of_device_get_match_data(dev);
21842185 if (!qmp->cfg)
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c+1−0
@@ -1050,6 +1050,7 @@ static int qmp_usbc_probe(struct platform_device *pdev) · 1049 unmodified lines
10501050 return -ENOMEM;
10511051
10521052 qmp->dev = dev;
1053+ dev_set_drvdata(dev, qmp);
10531054
10541055 qmp->orientation = TYPEC_ORIENTATION_NORMAL;
10551056
drivers/phy/rockchip/Kconfig+1−0
@@ -86,6 +86,7 @@ config PHY_ROCKCHIP_PCIE · 85 unmodified lines
8686 config PHY_ROCKCHIP_SAMSUNG_HDPTX
8787 tristate "Rockchip Samsung HDMI/eDP Combo PHY driver"
8888 depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
89+ depends on COMMON_CLK
8990 depends on HAS_IOMEM
9091 select GENERIC_PHY
9192 select MFD_SYSCON
drivers/phy/starfive/phy-jh7110-usb.c+16−0
@@ -10,18 +10,24 @@ · 9 unmodified lines
1010 #include <linux/clk.h>
1111 #include <linux/err.h>
1212 #include <linux/io.h>
13+#include <linux/mfd/syscon.h>
1314 #include <linux/module.h>
1415 #include <linux/phy/phy.h>
1516 #include <linux/platform_device.h>
17+#include <linux/regmap.h>
1618 #include <linux/usb/of.h>
1719
1820 #define USB_125M_CLK_RATE 125000000
1921 #define USB_LS_KEEPALIVE_OFF 0x4
2022 #define USB_LS_KEEPALIVE_ENABLE BIT(4)
2123
24+#define USB_PDRSTN_SPLIT BIT(17)
25+#define SYSCON_USB_SPLIT_OFFSET 0x18
26+
2227 struct jh7110_usb2_phy {
2328 struct phy *phy;
2429 void __iomem *regs;
30+ struct regmap *sys_syscon;
2531 struct clk *usb_125m_clk;
2632 struct clk *app_125m;
2733 enum phy_mode mode;
@@ -61,6 +67,10 @@ static int usb2_phy_set_mode(struct phy *_phy, · 33 unmodified lines
6167 usb2_set_ls_keepalive(phy, (mode != PHY_MODE_USB_DEVICE));
6268 }
6369
70+ /* Connect usb 2.0 phy mode */
71+ regmap_update_bits(phy->sys_syscon, SYSCON_USB_SPLIT_OFFSET,
72+ USB_PDRSTN_SPLIT, USB_PDRSTN_SPLIT);
73+
6474 return 0;
6575 }
6676
@@ -129,6 +139,12 @@ static int jh7110_usb_phy_probe(struct platform_device *pdev) · 62 unmodified lines
129139 phy_set_drvdata(phy->phy, phy);
130140 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
131141
142+ phy->sys_syscon =
143+ syscon_regmap_lookup_by_compatible("starfive,jh7110-sys-syscon");
144+ if (IS_ERR(phy->sys_syscon))
145+ return dev_err_probe(dev, PTR_ERR(phy->sys_syscon),
146+ "Failed to get sys-syscon\n");
147+
132148 return PTR_ERR_OR_ZERO(phy_provider);
133149 }
134150
drivers/phy/tegra/xusb.c+2−0
@@ -699,6 +699,8 @@ static int tegra_xusb_setup_usb_role_switch(struct tegra_xusb_port *port) · 698 unmodified lines
699699 return -ENOMEM;
700700
701701 lane = tegra_xusb_find_lane(port->padctl, "usb2", port->index);
702+ if (IS_ERR(lane))
703+ return PTR_ERR(lane);
702704
703705 /*
704706 * Assign phy dev to usb-phy dev. Host/device drivers can use phy
drivers/phy/ti/phy-j721e-wiz.c+2−2
@@ -450,8 +450,8 @@ static int wiz_mode_select(struct wiz *wiz) · 449 unmodified lines
450450 } else if (wiz->lane_phy_type[i] == PHY_TYPE_USXGMII) {
451451 ret = regmap_field_write(wiz->p0_mac_src_sel[i], 0x3);
452452 ret = regmap_field_write(wiz->p0_rxfclk_sel[i], 0x3);
453− ret = regmap_field_write(wiz->p0_refclk_sel[i], 0x3);
454− mode = LANE_MODE_GEN1;
453+ ret = regmap_field_write(wiz->p0_refclk_sel[i], 0x2);
454+ mode = LANE_MODE_GEN2;
455455 } else {
456456 continue;
457457 }
drivers/pinctrl/intel/Kconfig+1−0
@@ -46,6 +46,7 @@ config PINCTRL_INTEL_PLATFORM · 45 unmodified lines
4646 of Intel PCH pins and using them as GPIOs. Currently the following
4747 Intel SoCs / platforms require this to be functional:
4848 - Lunar Lake
49+ - Panther Lake
4950
5051 config PINCTRL_ALDERLAKE
5152 tristate "Intel Alder Lake pinctrl and GPIO driver"
drivers/pinctrl/intel/pinctrl-intel-platform.c+2−3
@@ -90,7 +90,6 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev, · 89 unmodified lines
9090 struct intel_community *community,
9191 struct intel_platform_pins *pins)
9292 {
93− struct fwnode_handle *child;
9493 struct intel_padgroup *gpps;
9594 unsigned int group;
9695 size_t ngpps;
@@ -131,7 +130,7 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev, · 34 unmodified lines
131130 return -ENOMEM;
132131
133132 group = 0;
134− device_for_each_child_node(dev, child) {
133+ device_for_each_child_node_scoped(dev, child) {
135134 struct intel_padgroup *gpp = &gpps[group];
136135
137136 gpp->reg_num = group;
@@ -159,7 +158,7 @@ static int intel_platform_pinctrl_prepare_soc_data(struct device *dev, · 21 unmodified lines
159158 int ret;
160159
161160 /* Version 1.0 of the specification assumes only a single community per device node */
162− ncommunities = 1,
161+ ncommunities = 1;
163162 communities = devm_kcalloc(dev, ncommunities, sizeof(*communities), GFP_KERNEL);
164163 if (!communities)
165164 return -ENOMEM;
drivers/pinctrl/nuvoton/pinctrl-ma35.c+1−1
@@ -218,7 +218,7 @@ static int ma35_pinctrl_dt_node_to_map_func(struct pinctrl_dev *pctldev, · 217 unmodified lines
218218 }
219219
220220 map_num += grp->npins;
221− new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map), GFP_KERNEL);
221+ new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL);
222222 if (!new_map)
223223 return -ENOMEM;
224224
drivers/pinctrl/pinctrl-apple-gpio.c+3−0
@@ -474,6 +474,9 @@ static int apple_gpio_pinctrl_probe(struct platform_device *pdev) · 473 unmodified lines
474474 for (i = 0; i < npins; i++) {
475475 pins[i].number = i;
476476 pins[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "PIN%u", i);
477+ if (!pins[i].name)
478+ return -ENOMEM;
479+
477480 pins[i].drv_data = pctl;
478481 pin_names[i] = pins[i].name;
479482 pin_nums[i] = i;
drivers/pinctrl/pinctrl-aw9523.c+4−2
@@ -987,8 +987,10 @@ static int aw9523_probe(struct i2c_client *client) · 986 unmodified lines
987987 lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter));
988988
989989 pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL);
990− if (!pdesc)
991− return -ENOMEM;
990+ if (!pdesc) {
991+ ret = -ENOMEM;
992+ goto err_disable_vregs;
993+ }
992994
993995 ret = aw9523_hw_init(awi);
994996 if (ret)
drivers/pinctrl/pinctrl-ocelot.c+4−4
@@ -1955,21 +1955,21 @@ static void ocelot_irq_handler(struct irq_desc *desc) · 1954 unmodified lines
19551955 unsigned int reg = 0, irq, i;
19561956 unsigned long irqs;
19571957
1958+ chained_irq_enter(parent_chip, desc);
1959+
19581960 for (i = 0; i < info->stride; i++) {
19591961 regmap_read(info->map, id_reg + 4 * i, &reg);
19601962 if (!reg)
19611963 continue;
19621964
1963− chained_irq_enter(parent_chip, desc);
1964−
19651965 irqs = reg;
19661966
19671967 for_each_set_bit(irq, &irqs,
19681968 min(32U, info->desc->npins - 32 * i))
19691969 generic_handle_domain_irq(chip->irq.domain, irq + 32 * i);
1970−
1971− chained_irq_exit(parent_chip, desc);
19721970 }
1971+
1972+ chained_irq_exit(parent_chip, desc);
19731973 }
19741974
19751975 static int ocelot_gpiochip_register(struct platform_device *pdev,
drivers/pinctrl/sophgo/pinctrl-cv18xx.c+1−1
@@ -221,7 +221,7 @@ static int cv1800_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, · 220 unmodified lines
221221 if (!grpnames)
222222 return -ENOMEM;
223223
224− map = devm_kcalloc(dev, ngroups * 2, sizeof(*map), GFP_KERNEL);
224+ map = kcalloc(ngroups * 2, sizeof(*map), GFP_KERNEL);
225225 if (!map)
226226 return -ENOMEM;
227227
drivers/pinctrl/stm32/pinctrl-stm32.c+7−2
@@ -1374,10 +1374,15 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode · 1373 unmodified lines
13741374
13751375 for (i = 0; i < npins; i++) {
13761376 stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i);
1377− if (stm32_pin && stm32_pin->pin.name)
1377+ if (stm32_pin && stm32_pin->pin.name) {
13781378 names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s", stm32_pin->pin.name);
1379− else
1379+ if (!names[i]) {
1380+ err = -ENOMEM;
1381+ goto err_clk;
1382+ }
1383+ } else {
13801384 names[i] = NULL;
1385+ }
13811386 }
13821387
13831388 bank->gpio_chip.names = (const char * const *)names;
drivers/platform/x86/asus-wmi.c+10−0
@@ -3908,6 +3908,16 @@ static int platform_profile_setup(struct asus_wmi *asus) · 3907 unmodified lines
39083908 if (!asus->throttle_thermal_policy_dev)
39093909 return 0;
39103910
3911+ /*
3912+ * We need to set the default thermal profile during probe or otherwise
3913+ * the system will often remain in silent mode, causing low performance.
3914+ */
3915+ err = throttle_thermal_policy_set_default(asus);
3916+ if (err < 0) {
3917+ pr_warn("Failed to set default thermal profile\n");
3918+ return err;
3919+ }
3920+
39113921 dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n");
39123922
39133923 asus->platform_profile_handler.profile_get = asus_wmi_platform_profile_get;
drivers/platform/x86/dell/dell-wmi-base.c+9−0
@@ -264,6 +264,15 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = { · 263 unmodified lines
264264 /*Speaker Mute*/
265265 { KE_KEY, 0x109, { KEY_MUTE} },
266266
267+ /* S2Idle screen off */
268+ { KE_IGNORE, 0x120, { KEY_RESERVED }},
269+
270+ /* Leaving S4 or S2Idle suspend */
271+ { KE_IGNORE, 0x130, { KEY_RESERVED }},
272+
273+ /* Entering S2Idle suspend */
274+ { KE_IGNORE, 0x140, { KEY_RESERVED }},
275+
267276 /* Mic mute */
268277 { KE_KEY, 0x150, { KEY_MICMUTE } },
269278
drivers/platform/x86/intel/pmc/adl.c+0−2
@@ -295,8 +295,6 @@ const struct pmc_reg_map adl_reg_map = { · 294 unmodified lines
295295 .ppfear_buckets = CNP_PPFEAR_NUM_ENTRIES,
296296 .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
297297 .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
298− .acpi_pm_tmr_ctl_offset = SPT_PMC_ACPI_PM_TMR_CTL_OFFSET,
299− .acpi_pm_tmr_disable_bit = SPT_PMC_BIT_ACPI_PM_TMR_DISABLE,
300298 .ltr_ignore_max = ADL_NUM_IP_IGN_ALLOWED,
301299 .lpm_num_modes = ADL_LPM_NUM_MODES,
302300 .lpm_num_maps = ADL_LPM_NUM_MAPS,
drivers/platform/x86/intel/pmc/cnp.c+0−2
@@ -200,8 +200,6 @@ const struct pmc_reg_map cnp_reg_map = { · 199 unmodified lines
200200 .ppfear_buckets = CNP_PPFEAR_NUM_ENTRIES,
201201 .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
202202 .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
203− .acpi_pm_tmr_ctl_offset = SPT_PMC_ACPI_PM_TMR_CTL_OFFSET,
204− .acpi_pm_tmr_disable_bit = SPT_PMC_BIT_ACPI_PM_TMR_DISABLE,
205203 .ltr_ignore_max = CNP_NUM_IP_IGN_ALLOWED,
206204 .etr3_offset = ETR3_OFFSET,
207205 };
drivers/platform/x86/intel/pmc/core.c+0−46
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111
1212 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1313
14−#include <linux/acpi_pmtmr.h>
1514 #include <linux/bitfield.h>
1615 #include <linux/debugfs.h>
1716 #include <linux/delay.h>
@@ -1258,39 +1257,6 @@ static bool pmc_core_is_pson_residency_enabled(struct pmc_dev *pmcdev) · 1240 unmodified lines
12581257 return val == 1;
12591258 }
12601259
1261−/*
1262− * Enable or disable ACPI PM Timer
1263− *
1264− * This function is intended to be a callback for ACPI PM suspend/resume event.
1265− * The ACPI PM Timer is enabled on resume only if it was enabled during suspend.
1266− */
1267−static void pmc_core_acpi_pm_timer_suspend_resume(void *data, bool suspend)
1268−{
1269− struct pmc_dev *pmcdev = data;
1270− struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
1271− const struct pmc_reg_map *map = pmc->map;
1272− bool enabled;
1273− u32 reg;
1274−
1275− if (!map->acpi_pm_tmr_ctl_offset)
1276− return;
1277−
1278− guard(mutex)(&pmcdev->lock);
1279−
1280− if (!suspend && !pmcdev->enable_acpi_pm_timer_on_resume)
1281− return;
1282−
1283− reg = pmc_core_reg_read(pmc, map->acpi_pm_tmr_ctl_offset);
1284− enabled = !(reg & map->acpi_pm_tmr_disable_bit);
1285− if (suspend)
1286− reg |= map->acpi_pm_tmr_disable_bit;
1287− else
1288− reg &= ~map->acpi_pm_tmr_disable_bit;
1289− pmc_core_reg_write(pmc, map->acpi_pm_tmr_ctl_offset, reg);
1290−
1291− pmcdev->enable_acpi_pm_timer_on_resume = suspend && enabled;
1292−}
1293−
12941260 static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
12951261 {
12961262 debugfs_remove_recursive(pmcdev->dbgfs_dir);
@@ -1486,7 +1452,6 @@ static int pmc_core_probe(struct platform_device *pdev) · 189 unmodified lines
14861452 struct pmc_dev *pmcdev;
14871453 const struct x86_cpu_id *cpu_id;
14881454 int (*core_init)(struct pmc_dev *pmcdev);
1489− const struct pmc_reg_map *map;
14901455 struct pmc *primary_pmc;
14911456 int ret;
14921457
@@ -1545,11 +1510,6 @@ static int pmc_core_probe(struct platform_device *pdev) · 52 unmodified lines
15451510 pm_report_max_hw_sleep(FIELD_MAX(SLP_S0_RES_COUNTER_MASK) *
15461511 pmc_core_adjust_slp_s0_step(primary_pmc, 1));
15471512
1548− map = primary_pmc->map;
1549− if (map->acpi_pm_tmr_ctl_offset)
1550− acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume,
1551− pmcdev);
1552−
15531513 device_initialized = true;
15541514 dev_info(&pdev->dev, " initialized\n");
15551515
@@ -1559,12 +1519,6 @@ static int pmc_core_probe(struct platform_device *pdev) · 3 unmodified lines
15591519 static void pmc_core_remove(struct platform_device *pdev)
15601520 {
15611521 struct pmc_dev *pmcdev = platform_get_drvdata(pdev);
1562− const struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
1563− const struct pmc_reg_map *map = pmc->map;
1564−
1565− if (map->acpi_pm_tmr_ctl_offset)
1566− acpi_pmtmr_unregister_suspend_resume_callback();
1567−
15681522 pmc_core_dbgfs_unregister(pmcdev);
15691523 pmc_core_clean_structure(pdev);
15701524 }
drivers/platform/x86/intel/pmc/core.h+0−8
@@ -68,8 +68,6 @@ struct telem_endpoint; · 67 unmodified lines
6868 #define SPT_PMC_LTR_SCC 0x3A0
6969 #define SPT_PMC_LTR_ISH 0x3A4
7070
71−#define SPT_PMC_ACPI_PM_TMR_CTL_OFFSET 0x18FC
72−
7371 /* Sunrise Point: PGD PFET Enable Ack Status Registers */
7472 enum ppfear_regs {
7573 SPT_PMC_XRAM_PPFEAR0A = 0x590,
@@ -150,8 +148,6 @@ enum ppfear_regs { · 74 unmodified lines
150148 #define SPT_PMC_VRIC1_SLPS0LVEN BIT(13)
151149 #define SPT_PMC_VRIC1_XTALSDQDIS BIT(22)
152150
153−#define SPT_PMC_BIT_ACPI_PM_TMR_DISABLE BIT(1)
154−
155151 /* Cannonlake Power Management Controller register offsets */
156152 #define CNP_PMC_SLPS0_DBG_OFFSET 0x10B4
157153 #define CNP_PMC_PM_CFG_OFFSET 0x1818
@@ -355,8 +351,6 @@ struct pmc_reg_map { · 197 unmodified lines
355351 const u8 *lpm_reg_index;
356352 const u32 pson_residency_offset;
357353 const u32 pson_residency_counter_step;
358− const u32 acpi_pm_tmr_ctl_offset;
359− const u32 acpi_pm_tmr_disable_bit;
360354 };
361355
362356 /**
@@ -432,8 +426,6 @@ struct pmc_dev { · 69 unmodified lines
432426 u32 die_c6_offset;
433427 struct telem_endpoint *punit_ep;
434428 struct pmc_info *regmap_list;
435−
436− bool enable_acpi_pm_timer_on_resume;
437429 };
438430
439431 enum pmc_index {
drivers/platform/x86/intel/pmc/core_ssram.c+3−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #define LPM_REG_COUNT 28
3030 #define LPM_MODE_OFFSET 1
3131
32−DEFINE_FREE(pmc_core_iounmap, void __iomem *, iounmap(_T));
32+DEFINE_FREE(pmc_core_iounmap, void __iomem *, if (_T) iounmap(_T))
3333
3434 static u32 pmc_core_find_guid(struct pmc_info *list, const struct pmc_reg_map *map)
3535 {
@@ -262,6 +262,8 @@ pmc_core_ssram_get_pmc(struct pmc_dev *pmcdev, int pmc_idx, u32 offset) · 226 unmodified lines
262262
263263 ssram_base = ssram_pcidev->resource[0].start;
264264 tmp_ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);
265+ if (!tmp_ssram)
266+ return -ENOMEM;
265267
266268 if (pmc_idx != PMC_IDX_MAIN) {
267269 /*
drivers/platform/x86/intel/pmc/icl.c+0−2
@@ -46,8 +46,6 @@ const struct pmc_reg_map icl_reg_map = { · 45 unmodified lines
4646 .ppfear_buckets = ICL_PPFEAR_NUM_ENTRIES,
4747 .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
4848 .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
49− .acpi_pm_tmr_ctl_offset = SPT_PMC_ACPI_PM_TMR_CTL_OFFSET,
50− .acpi_pm_tmr_disable_bit = SPT_PMC_BIT_ACPI_PM_TMR_DISABLE,
5149 .ltr_ignore_max = ICL_NUM_IP_IGN_ALLOWED,
5250 .etr3_offset = ETR3_OFFSET,
5351 };
drivers/platform/x86/intel/pmc/mtl.c+0−2
@@ -462,8 +462,6 @@ const struct pmc_reg_map mtl_socm_reg_map = { · 461 unmodified lines
462462 .ppfear_buckets = MTL_SOCM_PPFEAR_NUM_ENTRIES,
463463 .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
464464 .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
465− .acpi_pm_tmr_ctl_offset = SPT_PMC_ACPI_PM_TMR_CTL_OFFSET,
466− .acpi_pm_tmr_disable_bit = SPT_PMC_BIT_ACPI_PM_TMR_DISABLE,
467465 .lpm_num_maps = ADL_LPM_NUM_MAPS,
468466 .ltr_ignore_max = MTL_SOCM_NUM_IP_IGN_ALLOWED,
469467 .lpm_res_counter_step_x2 = TGL_PMC_LPM_RES_COUNTER_STEP_X2,
drivers/platform/x86/intel/pmc/tgl.c+0−2
@@ -197,8 +197,6 @@ const struct pmc_reg_map tgl_reg_map = { · 196 unmodified lines
197197 .ppfear_buckets = ICL_PPFEAR_NUM_ENTRIES,
198198 .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
199199 .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
200− .acpi_pm_tmr_ctl_offset = SPT_PMC_ACPI_PM_TMR_CTL_OFFSET,
201− .acpi_pm_tmr_disable_bit = SPT_PMC_BIT_ACPI_PM_TMR_DISABLE,
202200 .ltr_ignore_max = TGL_NUM_IP_IGN_ALLOWED,
203201 .lpm_num_maps = TGL_LPM_NUM_MAPS,
204202 .lpm_res_counter_step_x2 = TGL_PMC_LPM_RES_COUNTER_STEP_X2,
drivers/pmdomain/qcom/cpr.c+1−1
@@ -1052,7 +1052,7 @@ static unsigned long cpr_get_opp_hz_for_req(struct dev_pm_opp *ref, · 1051 unmodified lines
10521052 of_parse_phandle(child_np, "required-opps", 0);
10531053
10541054 if (child_req_np == ref_np) {
1055− u64 rate;
1055+ u64 rate = 0;
10561056
10571057 of_property_read_u64(child_np, "opp-hz", &rate);
10581058 return (unsigned long) rate;
drivers/powercap/dtpm_devfreq.c+1−1
@@ -178,7 +178,7 @@ static int __dtpm_devfreq_setup(struct devfreq *devfreq, struct dtpm *parent) · 177 unmodified lines
178178 ret = dev_pm_qos_add_request(dev, &dtpm_devfreq->qos_req,
179179 DEV_PM_QOS_MAX_FREQUENCY,
180180 PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE);
181− if (ret) {
181+ if (ret < 0) {
182182 pr_err("Failed to add QoS request: %d\n", ret);
183183 goto out_dtpm_unregister;
184184 }
drivers/powercap/intel_rapl_msr.c+2−0
@@ -147,6 +147,8 @@ static const struct x86_cpu_id pl4_support_ids[] = { · 146 unmodified lines
147147 X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL),
148148 X86_MATCH_VFM(INTEL_METEORLAKE, NULL),
149149 X86_MATCH_VFM(INTEL_METEORLAKE_L, NULL),
150+ X86_MATCH_VFM(INTEL_ARROWLAKE_U, NULL),
151+ X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL),
150152 {}
151153 };
152154
drivers/powercap/intel_rapl_tpmi.c+15−4
@@ -15,7 +15,8 @@ · 14 unmodified lines
1515 #include <linux/module.h>
1616 #include <linux/slab.h>
1717
18−#define TPMI_RAPL_VERSION 1
18+#define TPMI_RAPL_MAJOR_VERSION 0
19+#define TPMI_RAPL_MINOR_VERSION 1
1920
2021 /* 1 header + 10 registers + 5 reserved. 8 bytes for each. */
2122 #define TPMI_RAPL_DOMAIN_SIZE 128
@@ -154,11 +155,21 @@ static int parse_one_domain(struct tpmi_rapl_package *trp, u32 offset) · 132 unmodified lines
154155 tpmi_domain_size = tpmi_domain_header >> 16 & 0xff;
155156 tpmi_domain_flags = tpmi_domain_header >> 32 & 0xffff;
156157
157− if (tpmi_domain_version != TPMI_RAPL_VERSION) {
158− pr_warn(FW_BUG "Unsupported version:%d\n", tpmi_domain_version);
158+ if (tpmi_domain_version == TPMI_VERSION_INVALID) {
159+ pr_warn(FW_BUG "Invalid version\n");
159160 return -ENODEV;
160161 }
161162
163+ if (TPMI_MAJOR_VERSION(tpmi_domain_version) != TPMI_RAPL_MAJOR_VERSION) {
164+ pr_warn(FW_BUG "Unsupported major version:%ld\n",
165+ TPMI_MAJOR_VERSION(tpmi_domain_version));
166+ return -ENODEV;
167+ }
168+
169+ if (TPMI_MINOR_VERSION(tpmi_domain_version) > TPMI_RAPL_MINOR_VERSION)
170+ pr_info("Ignore: Unsupported minor version:%ld\n",
171+ TPMI_MINOR_VERSION(tpmi_domain_version));
172+
162173 /* Domain size: in unit of 128 Bytes */
163174 if (tpmi_domain_size != 1) {
164175 pr_warn(FW_BUG "Invalid Domain size %d\n", tpmi_domain_size);
@@ -181,7 +192,7 @@ static int parse_one_domain(struct tpmi_rapl_package *trp, u32 offset) · 16 unmodified lines
181192 pr_warn(FW_BUG "System domain must support Domain Info register\n");
182193 return -ENODEV;
183194 }
184− tpmi_domain_info = readq(trp->base + offset + TPMI_RAPL_REG_DOMAIN_INFO);
195+ tpmi_domain_info = readq(trp->base + offset + TPMI_RAPL_REG_DOMAIN_INFO * 8);
185196 if (!(tpmi_domain_info & TPMI_RAPL_DOMAIN_ROOT))
186197 return 0;
187198 domain_type = RAPL_DOMAIN_PLATFORM;
drivers/reset/reset-npcm.c+2−2
@@ -405,8 +405,8 @@ static int npcm_rc_probe(struct platform_device *pdev) · 404 unmodified lines
405405 if (!of_property_read_u32(pdev->dev.of_node, "nuvoton,sw-reset-number",
406406 &rc->sw_reset_number)) {
407407 if (rc->sw_reset_number && rc->sw_reset_number < 5) {
408− rc->restart_nb.priority = 192,
409− rc->restart_nb.notifier_call = npcm_rc_restart,
408+ rc->restart_nb.priority = 192;
409+ rc->restart_nb.notifier_call = npcm_rc_restart;
410410 ret = register_restart_handler(&rc->restart_nb);
411411 if (ret)
412412 dev_warn(&pdev->dev, "failed to register restart handler\n");
drivers/reset/starfive/reset-starfive-jh71x0.c+3−0
@@ -94,6 +94,9 @@ static int jh71x0_reset_status(struct reset_controller_dev *rcdev, · 93 unmodified lines
9494 void __iomem *reg_status = data->status + offset * sizeof(u32);
9595 u32 value = readl(reg_status);
9696
97+ if (!data->asserted)
98+ return !(value & mask);
99+
97100 return !((value ^ data->asserted[offset]) & mask);
98101 }
99102
drivers/s390/char/sclp.c+2−1
@@ -1195,7 +1195,8 @@ sclp_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) · 1194 unmodified lines
11951195 }
11961196
11971197 static struct notifier_block sclp_reboot_notifier = {
1198− .notifier_call = sclp_reboot_event
1198+ .notifier_call = sclp_reboot_event,
1199+ .priority = INT_MIN,
11991200 };
12001201
12011202 static ssize_t con_pages_show(struct device_driver *dev, char *buf)
drivers/s390/char/sclp_vt220.c+2−2
@@ -319,7 +319,7 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request, · 318 unmodified lines
319319 buffer = (void *) ((addr_t) sccb + sccb->header.length);
320320
321321 if (convertlf) {
322− /* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/
322+ /* Perform Linefeed conversion (0x0a -> 0x0d 0x0a)*/
323323 for (from=0, to=0;
324324 (from < count) && (to < sclp_vt220_space_left(request));
325325 from++) {
@@ -328,8 +328,8 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request, · 2 unmodified lines
328328 /* Perform conversion */
329329 if (c == 0x0a) {
330330 if (to + 1 < sclp_vt220_space_left(request)) {
331− ((unsigned char *) buffer)[to++] = c;
332331 ((unsigned char *) buffer)[to++] = 0x0d;
332+ ((unsigned char *) buffer)[to++] = c;
333333 } else
334334 break;
335335
drivers/s390/crypto/ap_bus.c+1−2
@@ -1864,13 +1864,12 @@ static inline void ap_scan_domains(struct ap_card *ac) · 1863 unmodified lines
18641864 }
18651865 /* if no queue device exists, create a new one */
18661866 if (!aq) {
1867− aq = ap_queue_create(qid, ac->ap_dev.device_type);
1867+ aq = ap_queue_create(qid, ac);
18681868 if (!aq) {
18691869 AP_DBF_WARN("%s(%d,%d) ap_queue_create() failed\n",
18701870 __func__, ac->id, dom);
18711871 continue;
18721872 }
1873− aq->card = ac;
18741873 aq->config = !decfg;
18751874 aq->chkstop = chkstop;
18761875 aq->se_bstate = hwinfo.bs;
drivers/s390/crypto/ap_bus.h+1−1
@@ -272,7 +272,7 @@ int ap_test_config_usage_domain(unsigned int domain); · 271 unmodified lines
272272 int ap_test_config_ctrl_domain(unsigned int domain);
273273
274274 void ap_queue_init_reply(struct ap_queue *aq, struct ap_message *ap_msg);
275−struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type);
275+struct ap_queue *ap_queue_create(ap_qid_t qid, struct ap_card *ac);
276276 void ap_queue_prepare_remove(struct ap_queue *aq);
277277 void ap_queue_remove(struct ap_queue *aq);
278278 void ap_queue_init_state(struct ap_queue *aq);
drivers/s390/crypto/ap_queue.c+20−8
@@ -22,6 +22,11 @@ static void __ap_flush_queue(struct ap_queue *aq); · 21 unmodified lines
2222 * some AP queue helper functions
2323 */
2424
25+static inline bool ap_q_supported_in_se(struct ap_queue *aq)
26+{
27+ return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel;
28+}
29+
2530 static inline bool ap_q_supports_bind(struct ap_queue *aq)
2631 {
2732 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel;
@@ -1104,18 +1109,19 @@ static void ap_queue_device_release(struct device *dev) · 1076 unmodified lines
11041109 kfree(aq);
11051110 }
11061111
1107−struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type)
1112+struct ap_queue *ap_queue_create(ap_qid_t qid, struct ap_card *ac)
11081113 {
11091114 struct ap_queue *aq;
11101115
11111116 aq = kzalloc(sizeof(*aq), GFP_KERNEL);
11121117 if (!aq)
11131118 return NULL;
1119+ aq->card = ac;
11141120 aq->ap_dev.device.release = ap_queue_device_release;
11151121 aq->ap_dev.device.type = &ap_queue_type;
1116− aq->ap_dev.device_type = device_type;
1117− // add optional SE secure binding attributes group
1118− if (ap_sb_available() && is_prot_virt_guest())
1122+ aq->ap_dev.device_type = ac->ap_dev.device_type;
1123+ /* in SE environment add bind/associate attributes group */
1124+ if (ap_is_se_guest() && ap_q_supported_in_se(aq))
11191125 aq->ap_dev.device.groups = ap_queue_dev_sb_attr_groups;
11201126 aq->qid = qid;
11211127 spin_lock_init(&aq->lock);
@@ -1196,10 +1202,16 @@ bool ap_queue_usable(struct ap_queue *aq) · 74 unmodified lines
11961202 }
11971203
11981204 /* SE guest's queues additionally need to be bound */
1199− if (ap_q_needs_bind(aq) &&
1200− !(aq->se_bstate == AP_BS_Q_USABLE ||
1201− aq->se_bstate == AP_BS_Q_USABLE_NO_SECURE_KEY))
1202− rc = false;
1205+ if (ap_is_se_guest()) {
1206+ if (!ap_q_supported_in_se(aq)) {
1207+ rc = false;
1208+ goto unlock_and_out;
1209+ }
1210+ if (ap_q_needs_bind(aq) &&
1211+ !(aq->se_bstate == AP_BS_Q_USABLE ||
1212+ aq->se_bstate == AP_BS_Q_USABLE_NO_SECURE_KEY))
1213+ rc = false;
1214+ }
12031215
12041216 unlock_and_out:
12051217 spin_unlock_bh(&aq->lock);
drivers/s390/crypto/pkey_pckmo.c+1−0
@@ -324,6 +324,7 @@ static int pckmo_key2protkey(const u8 *key, u32 keylen, · 323 unmodified lines
324324 memcpy(protkey, t->protkey, t->len);
325325 *protkeylen = t->len;
326326 *protkeytype = t->keytype;
327+ rc = 0;
327328 break;
328329 }
329330 case TOKVER_CLEAR_KEY: {
drivers/scsi/fnic/fnic_main.c+1−1
@@ -830,7 +830,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 829 unmodified lines
830830 spin_lock_init(&fnic->vlans_lock);
831831 INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame);
832832 INIT_WORK(&fnic->event_work, fnic_handle_event);
833− INIT_WORK(&fnic->flush_work, fnic_flush_tx);
834833 skb_queue_head_init(&fnic->fip_frame_queue);
835834 INIT_LIST_HEAD(&fnic->evlist);
836835 INIT_LIST_HEAD(&fnic->vlans);
@@ -948,6 +947,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 111 unmodified lines
948947
949948 INIT_WORK(&fnic->link_work, fnic_handle_link);
950949 INIT_WORK(&fnic->frame_work, fnic_handle_frame);
950+ INIT_WORK(&fnic->flush_work, fnic_flush_tx);
951951 skb_queue_head_init(&fnic->frame_queue);
952952 skb_queue_head_init(&fnic->tx_queue);
953953
drivers/scsi/mpi3mr/mpi3mr.h+2−2
@@ -542,8 +542,8 @@ struct mpi3mr_hba_port { · 541 unmodified lines
542542 * @port_list: List of ports belonging to a SAS node
543543 * @num_phys: Number of phys associated with port
544544 * @marked_responding: used while refresing the sas ports
545− * @lowest_phy: lowest phy ID of current sas port
546− * @phy_mask: phy_mask of current sas port
545+ * @lowest_phy: lowest phy ID of current sas port, valid for controller port
546+ * @phy_mask: phy_mask of current sas port, valid for controller port
547547 * @hba_port: HBA port entry
548548 * @remote_identify: Attached device identification
549549 * @rphy: SAS transport layer rphy object
drivers/scsi/mpi3mr/mpi3mr_transport.c+27−15
@@ -590,12 +590,13 @@ static enum sas_linkrate mpi3mr_convert_phy_link_rate(u8 link_rate) · 589 unmodified lines
590590 * @mrioc: Adapter instance reference
591591 * @mr_sas_port: Internal Port object
592592 * @mr_sas_phy: Internal Phy object
593+ * @host_node: Flag to indicate this is a host_node
593594 *
594595 * Return: None.
595596 */
596597 static void mpi3mr_delete_sas_phy(struct mpi3mr_ioc *mrioc,
597598 struct mpi3mr_sas_port *mr_sas_port,
598− struct mpi3mr_sas_phy *mr_sas_phy)
599+ struct mpi3mr_sas_phy *mr_sas_phy, u8 host_node)
599600 {
600601 u64 sas_address = mr_sas_port->remote_identify.sas_address;
601602
@@ -605,9 +606,13 @@ static void mpi3mr_delete_sas_phy(struct mpi3mr_ioc *mrioc, · 3 unmodified lines
605606
606607 list_del(&mr_sas_phy->port_siblings);
607608 mr_sas_port->num_phys--;
608− mr_sas_port->phy_mask &= ~(1 << mr_sas_phy->phy_id);
609− if (mr_sas_port->lowest_phy == mr_sas_phy->phy_id)
610− mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
609+
610+ if (host_node) {
611+ mr_sas_port->phy_mask &= ~(1 << mr_sas_phy->phy_id);
612+
613+ if (mr_sas_port->lowest_phy == mr_sas_phy->phy_id)
614+ mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
615+ }
611616 sas_port_delete_phy(mr_sas_port->port, mr_sas_phy->phy);
612617 mr_sas_phy->phy_belongs_to_port = 0;
613618 }
@@ -617,12 +622,13 @@ static void mpi3mr_delete_sas_phy(struct mpi3mr_ioc *mrioc, · 3 unmodified lines
617622 * @mrioc: Adapter instance reference
618623 * @mr_sas_port: Internal Port object
619624 * @mr_sas_phy: Internal Phy object
625+ * @host_node: Flag to indicate this is a host_node
620626 *
621627 * Return: None.
622628 */
623629 static void mpi3mr_add_sas_phy(struct mpi3mr_ioc *mrioc,
624630 struct mpi3mr_sas_port *mr_sas_port,
625− struct mpi3mr_sas_phy *mr_sas_phy)
631+ struct mpi3mr_sas_phy *mr_sas_phy, u8 host_node)
626632 {
627633 u64 sas_address = mr_sas_port->remote_identify.sas_address;
628634
@@ -632,9 +638,12 @@ static void mpi3mr_add_sas_phy(struct mpi3mr_ioc *mrioc, · 3 unmodified lines
632638
633639 list_add_tail(&mr_sas_phy->port_siblings, &mr_sas_port->phy_list);
634640 mr_sas_port->num_phys++;
635− mr_sas_port->phy_mask |= (1 << mr_sas_phy->phy_id);
636− if (mr_sas_phy->phy_id < mr_sas_port->lowest_phy)
637− mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
641+ if (host_node) {
642+ mr_sas_port->phy_mask |= (1 << mr_sas_phy->phy_id);
643+
644+ if (mr_sas_phy->phy_id < mr_sas_port->lowest_phy)
645+ mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
646+ }
638647 sas_port_add_phy(mr_sas_port->port, mr_sas_phy->phy);
639648 mr_sas_phy->phy_belongs_to_port = 1;
640649 }
@@ -675,7 +684,7 @@ static void mpi3mr_add_phy_to_an_existing_port(struct mpi3mr_ioc *mrioc, · 34 unmodified lines
675684 if (srch_phy == mr_sas_phy)
676685 return;
677686 }
678− mpi3mr_add_sas_phy(mrioc, mr_sas_port, mr_sas_phy);
687+ mpi3mr_add_sas_phy(mrioc, mr_sas_port, mr_sas_phy, mr_sas_node->host_node);
679688 return;
680689 }
681690 }
@@ -736,7 +745,7 @@ static void mpi3mr_del_phy_from_an_existing_port(struct mpi3mr_ioc *mrioc, · 54 unmodified lines
736745 mpi3mr_delete_sas_port(mrioc, mr_sas_port);
737746 else
738747 mpi3mr_delete_sas_phy(mrioc, mr_sas_port,
739− mr_sas_phy);
748+ mr_sas_phy, mr_sas_node->host_node);
740749 return;
741750 }
742751 }
@@ -1028,7 +1037,7 @@ mpi3mr_alloc_hba_port(struct mpi3mr_ioc *mrioc, u16 port_id) · 285 unmodified lines
10281037 /**
10291038 * mpi3mr_get_hba_port_by_id - find hba port by id
10301039 * @mrioc: Adapter instance reference
1031− * @port_id - Port ID to search
1040+ * @port_id: Port ID to search
10321041 *
10331042 * Return: mpi3mr_hba_port reference for the matched port
10341043 */
@@ -1367,7 +1376,8 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, · 332 unmodified lines
13671376 mpi3mr_sas_port_sanity_check(mrioc, mr_sas_node,
13681377 mr_sas_port->remote_identify.sas_address, hba_port);
13691378
1370− if (mr_sas_node->num_phys >= sizeof(mr_sas_port->phy_mask) * 8)
1379+ if (mr_sas_node->host_node && mr_sas_node->num_phys >=
1380+ sizeof(mr_sas_port->phy_mask) * 8)
13711381 ioc_info(mrioc, "max port count %u could be too high\n",
13721382 mr_sas_node->num_phys);
13731383
@@ -1377,7 +1387,7 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, · 3 unmodified lines
13771387 (mr_sas_node->phy[i].hba_port != hba_port))
13781388 continue;
13791389
1380− if (i >= sizeof(mr_sas_port->phy_mask) * 8) {
1390+ if (mr_sas_node->host_node && (i >= sizeof(mr_sas_port->phy_mask) * 8)) {
13811391 ioc_warn(mrioc, "skipping port %u, max allowed value is %zu\n",
13821392 i, sizeof(mr_sas_port->phy_mask) * 8);
13831393 goto out_fail;
@@ -1385,7 +1395,8 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, · 1 unmodified line
13851395 list_add_tail(&mr_sas_node->phy[i].port_siblings,
13861396 &mr_sas_port->phy_list);
13871397 mr_sas_port->num_phys++;
1388− mr_sas_port->phy_mask |= (1 << i);
1398+ if (mr_sas_node->host_node)
1399+ mr_sas_port->phy_mask |= (1 << i);
13891400 }
13901401
13911402 if (!mr_sas_port->num_phys) {
@@ -1394,7 +1405,8 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, · 2 unmodified lines
13941405 goto out_fail;
13951406 }
13961407
1397− mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
1408+ if (mr_sas_node->host_node)
1409+ mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
13981410
13991411 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) {
14001412 tgtdev = mpi3mr_get_tgtdev_by_addr(mrioc,
drivers/scsi/scsi_debug.c+4−6
@@ -3651,7 +3651,7 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp, · 3650 unmodified lines
36513651 enum dma_data_direction dir;
36523652 struct scsi_data_buffer *sdb = &scp->sdb;
36533653 u8 *fsp;
3654− int i;
3654+ int i, total = 0;
36553655
36563656 /*
36573657 * Even though reads are inherently atomic (in this driver), we expect
@@ -3688,18 +3688,16 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp, · 30 unmodified lines
36883688 fsp + (block * sdebug_sector_size),
36893689 sdebug_sector_size, sg_skip, do_write);
36903690 sdeb_data_sector_unlock(sip, do_write);
3691− if (ret != sdebug_sector_size) {
3692− ret += (i * sdebug_sector_size);
3691+ total += ret;
3692+ if (ret != sdebug_sector_size)
36933693 break;
3694− }
36953694 sg_skip += sdebug_sector_size;
36963695 if (++block >= sdebug_store_sectors)
36973696 block = 0;
36983697 }
3699− ret = num * sdebug_sector_size;
37003698 sdeb_data_unlock(sip, atomic);
37013699
3702− return ret;
3700+ return total;
37033701 }
37043702
37053703 /* Returns number of bytes copied or -1 if error. */
drivers/scsi/scsi_transport_fc.c+2−2
@@ -1250,7 +1250,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev, · 1249 unmodified lines
12501250 */
12511251 if (rport->port_state == FC_PORTSTATE_ONLINE)
12521252 rport->port_state = port_state;
1253− else
1253+ else if (port_state != rport->port_state)
12541254 return -EINVAL;
12551255 } else if (port_state == FC_PORTSTATE_ONLINE) {
12561256 /*
@@ -1260,7 +1260,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev, · 3 unmodified lines
12601260 */
12611261 if (rport->port_state == FC_PORTSTATE_MARGINAL)
12621262 rport->port_state = port_state;
1263− else
1263+ else if (port_state != rport->port_state)
12641264 return -EINVAL;
12651265 } else
12661266 return -EINVAL;
drivers/scsi/wd33c93.c+1−1
@@ -831,7 +831,7 @@ wd33c93_intr(struct Scsi_Host *instance) · 830 unmodified lines
831831 /* construct an IDENTIFY message with correct disconnect bit */
832832
833833 hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun);
834− if (scsi_pointer->phase)
834+ if (WD33C93_scsi_pointer(cmd)->phase)
835835 hostdata->outgoing_msg[0] |= 0x40;
836836
837837 if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) {
drivers/soc/fsl/qe/qmc.c+5−6
@@ -1761,10 +1761,9 @@ static int qmc_qe_init_resources(struct qmc *qmc, struct platform_device *pdev) · 1760 unmodified lines
17611761 */
17621762 info = devm_qe_muram_alloc(qmc->dev, UCC_SLOW_PRAM_SIZE + 2 * 64,
17631763 ALIGNMENT_OF_UCC_SLOW_PRAM);
1764− if (IS_ERR_VALUE(info)) {
1765− dev_err(qmc->dev, "cannot allocate MURAM for PRAM");
1766− return -ENOMEM;
1767− }
1764+ if (info < 0)
1765+ return info;
1766+
17681767 if (!qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, qmc->qe_subblock,
17691768 QE_CR_PROTOCOL_UNSPECIFIED, info)) {
17701769 dev_err(qmc->dev, "QE_ASSIGN_PAGE_TO_DEVICE cmd failed");
@@ -2056,7 +2055,7 @@ static void qmc_remove(struct platform_device *pdev) · 285 unmodified lines
20562055 qmc_exit_xcc(qmc);
20572056 }
20582057
2059−static const struct qmc_data qmc_data_cpm1 = {
2058+static const struct qmc_data qmc_data_cpm1 __maybe_unused = {
20602059 .version = QMC_CPM1,
20612060 .tstate = 0x30000000,
20622061 .rstate = 0x31000000,
@@ -2066,7 +2065,7 @@ static const struct qmc_data qmc_data_cpm1 = { · 3 unmodified lines
20662065 .rpack = 0x00000000,
20672066 };
20682067
2069−static const struct qmc_data qmc_data_qe = {
2068+static const struct qmc_data qmc_data_qe __maybe_unused = {
20702069 .version = QMC_QE,
20712070 .tstate = 0x30000000,
20722071 .rstate = 0x30000000,
drivers/soundwire/intel_ace2x.c+6−13
@@ -376,11 +376,12 @@ static int intel_hw_params(struct snd_pcm_substream *substream, · 375 unmodified lines
376376 static int intel_prepare(struct snd_pcm_substream *substream,
377377 struct snd_soc_dai *dai)
378378 {
379+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
379380 struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
380381 struct sdw_intel *sdw = cdns_to_intel(cdns);
381382 struct sdw_cdns_dai_runtime *dai_runtime;
383+ struct snd_pcm_hw_params *hw_params;
382384 int ch, dir;
383− int ret = 0;
384385
385386 dai_runtime = cdns->dai_runtime_array[dai->id];
386387 if (!dai_runtime) {
@@ -389,12 +390,8 @@ static int intel_prepare(struct snd_pcm_substream *substream, · 2 unmodified lines
389390 return -EIO;
390391 }
391392
393+ hw_params = &rtd->dpcm[substream->stream].hw_params;
392394 if (dai_runtime->suspended) {
393− struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
394− struct snd_pcm_hw_params *hw_params;
395−
396− hw_params = &rtd->dpcm[substream->stream].hw_params;
397−
398395 dai_runtime->suspended = false;
399396
400397 /*
@@ -415,15 +412,11 @@ static int intel_prepare(struct snd_pcm_substream *substream, · 14 unmodified lines
415412 /* the SHIM will be configured in the callback functions */
416413
417414 sdw_cdns_config_stream(cdns, ch, dir, dai_runtime->pdi);
418−
419− /* Inform DSP about PDI stream number */
420− ret = intel_params_stream(sdw, substream, dai,
421− hw_params,
422− sdw->instance,
423− dai_runtime->pdi->intel_alh_id);
424415 }
425416
426− return ret;
417+ /* Inform DSP about PDI stream number */
418+ return intel_params_stream(sdw, substream, dai, hw_params, sdw->instance,
419+ dai_runtime->pdi->intel_alh_id);
427420 }
428421
429422 static int
drivers/spi/spi-fsl-dspi.c+5−1
@@ -1003,6 +1003,7 @@ static int dspi_setup(struct spi_device *spi) · 1002 unmodified lines
10031003 u32 cs_sck_delay = 0, sck_cs_delay = 0;
10041004 struct fsl_dspi_platform_data *pdata;
10051005 unsigned char pasc = 0, asc = 0;
1006+ struct gpio_desc *gpio_cs;
10061007 struct chip_data *chip;
10071008 unsigned long clkrate;
10081009 bool cs = true;
@@ -1077,7 +1078,10 @@ static int dspi_setup(struct spi_device *spi) · 68 unmodified lines
10771078 chip->ctar_val |= SPI_CTAR_LSBFE;
10781079 }
10791080
1080− gpiod_direction_output(spi_get_csgpiod(spi, 0), false);
1081+ gpio_cs = spi_get_csgpiod(spi, 0);
1082+ if (gpio_cs)
1083+ gpiod_direction_output(gpio_cs, false);
1084+
10811085 dspi_deassert_cs(spi, &cs);
10821086
10831087 spi_set_ctldata(spi, chip);
drivers/spi/spi-geni-qcom.c+5−3
@@ -1116,6 +1116,11 @@ static int spi_geni_probe(struct platform_device *pdev) · 1115 unmodified lines
11161116 init_completion(&mas->tx_reset_done);
11171117 init_completion(&mas->rx_reset_done);
11181118 spin_lock_init(&mas->lock);
1119+
1120+ ret = geni_icc_get(&mas->se, NULL);
1121+ if (ret)
1122+ return ret;
1123+
11191124 pm_runtime_use_autosuspend(&pdev->dev);
11201125 pm_runtime_set_autosuspend_delay(&pdev->dev, 250);
11211126 ret = devm_pm_runtime_enable(dev);
@@ -1125,9 +1130,6 @@ static int spi_geni_probe(struct platform_device *pdev) · 3 unmodified lines
11251130 if (device_property_read_bool(&pdev->dev, "spi-slave"))
11261131 spi->target = true;
11271132
1128− ret = geni_icc_get(&mas->se, NULL);
1129− if (ret)
1130− return ret;
11311133 /* Set the bus quota to a reasonable value for register access */
11321134 mas->se.icc_paths[GENI_TO_CORE].avg_bw = Bps_to_icc(CORE_2X_50_MHZ);
11331135 mas->se.icc_paths[CPU_TO_GENI].avg_bw = GENI_DEFAULT_BW;
drivers/spi/spi-mtk-snfi.c+1−1
@@ -1187,7 +1187,7 @@ cleanup: · 1186 unmodified lines
11871187
11881188 /**
11891189 * mtk_snand_is_page_ops() - check if the op is a controller supported page op.
1190− * @op spi-mem op to check
1190+ * @op: spi-mem op to check
11911191 *
11921192 * Check whether op can be executed with read_from_cache or program_load
11931193 * mode in the controller.
drivers/spi/spi-stm32.c+1−0
@@ -2044,6 +2044,7 @@ static const struct stm32_spi_cfg stm32mp25_spi_cfg = { · 2043 unmodified lines
20442044 .baud_rate_div_max = STM32H7_SPI_MBR_DIV_MAX,
20452045 .has_fifo = true,
20462046 .prevent_dma_burst = true,
2047+ .has_device_mode = true,
20472048 };
20482049
20492050 static const struct of_device_id stm32_spi_of_match[] = {
drivers/staging/iio/frequency/ad9832.c+5−2
@@ -129,12 +129,15 @@ static unsigned long ad9832_calc_freqreg(unsigned long mclk, unsigned long fout) · 128 unmodified lines
129129 static int ad9832_write_frequency(struct ad9832_state *st,
130130 unsigned int addr, unsigned long fout)
131131 {
132+ unsigned long clk_freq;
132133 unsigned long regval;
133134
134− if (fout > (clk_get_rate(st->mclk) / 2))
135+ clk_freq = clk_get_rate(st->mclk);
136+
137+ if (!clk_freq || fout > (clk_freq / 2))
135138 return -EINVAL;
136139
137− regval = ad9832_calc_freqreg(clk_get_rate(st->mclk), fout);
140+ regval = ad9832_calc_freqreg(clk_freq, fout);
138141
139142 st->freq_data[0] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) |
140143 (addr << ADD_SHIFT) |
drivers/target/target_core_device.c+1−1
@@ -691,7 +691,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) · 690 unmodified lines
691691
692692 dev->queues = kcalloc(nr_cpu_ids, sizeof(*dev->queues), GFP_KERNEL);
693693 if (!dev->queues) {
694− dev->transport->free_device(dev);
694+ hba->backend->ops->free_device(dev);
695695 return NULL;
696696 }
697697
drivers/target/target_core_user.c+1−1
@@ -2130,7 +2130,7 @@ static int tcmu_netlink_event_send(struct tcmu_dev *udev, · 2129 unmodified lines
21302130 }
21312131
21322132 ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
2133− TCMU_MCGRP_CONFIG, GFP_KERNEL);
2133+ TCMU_MCGRP_CONFIG);
21342134
21352135 /* Wait during an add as the listener may not be up yet */
21362136 if (ret == 0 ||
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c+0−2
@@ -416,7 +416,6 @@ err_del_legacy: · 415 unmodified lines
416416 if (!pci_info->no_legacy)
417417 proc_thermal_remove(proc_priv);
418418 proc_thermal_mmio_remove(pdev, proc_priv);
419− pci_disable_device(pdev);
420419
421420 return ret;
422421 }
@@ -438,7 +437,6 @@ static void proc_thermal_pci_remove(struct pci_dev *pdev) · 15 unmodified lines
438437 proc_thermal_mmio_remove(pdev, pci_info->proc_priv);
439438 if (!pci_info->no_legacy)
440439 proc_thermal_remove(proc_priv);
441− pci_disable_device(pdev);
442440 }
443441
444442 #ifdef CONFIG_PM_SLEEP
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c+24−46
@@ -13,48 +13,12 @@ static struct rapl_if_priv rapl_mmio_priv; · 12 unmodified lines
1313
1414 static const struct rapl_mmio_regs rapl_mmio_default = {
1515 .reg_unit = 0x5938,
16− .regs[RAPL_DOMAIN_PACKAGE] = { 0x59a0, 0x593c, 0x58f0, 0, 0x5930},
16+ .regs[RAPL_DOMAIN_PACKAGE] = { 0x59a0, 0x593c, 0x58f0, 0, 0x5930, 0x59b0},
1717 .regs[RAPL_DOMAIN_DRAM] = { 0x58e0, 0x58e8, 0x58ec, 0, 0},
18− .limits[RAPL_DOMAIN_PACKAGE] = BIT(POWER_LIMIT2),
18+ .limits[RAPL_DOMAIN_PACKAGE] = BIT(POWER_LIMIT2) | BIT(POWER_LIMIT4),
1919 .limits[RAPL_DOMAIN_DRAM] = BIT(POWER_LIMIT2),
2020 };
2121
22−static int rapl_mmio_cpu_online(unsigned int cpu)
23−{
24− struct rapl_package *rp;
25−
26− /* mmio rapl supports package 0 only for now */
27− if (topology_physical_package_id(cpu))
28− return 0;
29−
30− rp = rapl_find_package_domain_cpuslocked(cpu, &rapl_mmio_priv, true);
31− if (!rp) {
32− rp = rapl_add_package_cpuslocked(cpu, &rapl_mmio_priv, true);
33− if (IS_ERR(rp))
34− return PTR_ERR(rp);
35− }
36− cpumask_set_cpu(cpu, &rp->cpumask);
37− return 0;
38−}
39−
40−static int rapl_mmio_cpu_down_prep(unsigned int cpu)
41−{
42− struct rapl_package *rp;
43− int lead_cpu;
44−
45− rp = rapl_find_package_domain_cpuslocked(cpu, &rapl_mmio_priv, true);
46− if (!rp)
47− return 0;
48−
49− cpumask_clear_cpu(cpu, &rp->cpumask);
50− lead_cpu = cpumask_first(&rp->cpumask);
51− if (lead_cpu >= nr_cpu_ids)
52− rapl_remove_package_cpuslocked(rp);
53− else if (rp->lead_cpu == cpu)
54− rp->lead_cpu = lead_cpu;
55− return 0;
56−}
57−
5822 static int rapl_mmio_read_raw(int cpu, struct reg_action *ra)
5923 {
6024 if (!ra->reg.mmio)
@@ -82,6 +46,7 @@ static int rapl_mmio_write_raw(int cpu, struct reg_action *ra) · 21 unmodified lines
8246 int proc_thermal_rapl_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv)
8347 {
8448 const struct rapl_mmio_regs *rapl_regs = &rapl_mmio_default;
49+ struct rapl_package *rp;
8550 enum rapl_domain_reg_id reg;
8651 enum rapl_domain_type domain;
8752 int ret;
@@ -109,25 +74,38 @@ int proc_thermal_rapl_add(struct pci_dev *pdev, struct proc_thermal_device *proc · 21 unmodified lines
10974 return PTR_ERR(rapl_mmio_priv.control_type);
11075 }
11176
112− ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "powercap/rapl:online",
113− rapl_mmio_cpu_online, rapl_mmio_cpu_down_prep);
114− if (ret < 0) {
115− powercap_unregister_control_type(rapl_mmio_priv.control_type);
116− rapl_mmio_priv.control_type = NULL;
117− return ret;
77+ /* Register a RAPL package device for package 0 which is always online */
78+ rp = rapl_find_package_domain(0, &rapl_mmio_priv, false);
79+ if (rp) {
80+ ret = -EEXIST;
81+ goto err;
82+ }
83+
84+ rp = rapl_add_package(0, &rapl_mmio_priv, false);
85+ if (IS_ERR(rp)) {
86+ ret = PTR_ERR(rp);
87+ goto err;
11888 }
119− rapl_mmio_priv.pcap_rapl_online = ret;
12089
12190 return 0;
91+
92+err:
93+ powercap_unregister_control_type(rapl_mmio_priv.control_type);
94+ rapl_mmio_priv.control_type = NULL;
95+ return ret;
12296 }
12397 EXPORT_SYMBOL_GPL(proc_thermal_rapl_add);
12498
12599 void proc_thermal_rapl_remove(void)
126100 {
101+ struct rapl_package *rp;
102+
127103 if (IS_ERR_OR_NULL(rapl_mmio_priv.control_type))
128104 return;
129105
130− cpuhp_remove_state(rapl_mmio_priv.pcap_rapl_online);
106+ rp = rapl_find_package_domain(0, &rapl_mmio_priv, false);
107+ if (rp)
108+ rapl_remove_package(rp);
131109 powercap_unregister_control_type(rapl_mmio_priv.control_type);
132110 }
133111 EXPORT_SYMBOL_GPL(proc_thermal_rapl_remove);
drivers/thermal/thermal_core.c+2−3
@@ -728,6 +728,7 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id) · 727 unmodified lines
728728 mutex_lock(&thermal_list_lock);
729729 list_for_each_entry(tz, &thermal_tz_list, node) {
730730 if (tz->id == id) {
731+ get_device(&tz->device);
731732 match = tz;
732733 break;
733734 }
@@ -1605,14 +1606,12 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) · 871 unmodified lines
16051606 ida_destroy(&tz->ida);
16061607
16071608 device_del(&tz->device);
1608−
1609− kfree(tz->tzp);
1610−
16111609 put_device(&tz->device);
16121610
16131611 thermal_notify_tz_delete(tz);
16141612
16151613 wait_for_completion(&tz->removal);
1614+ kfree(tz->tzp);
16161615 kfree(tz);
16171616 }
16181617 EXPORT_SYMBOL_GPL(thermal_zone_device_unregister);
drivers/thermal/thermal_core.h+3−0
@@ -194,6 +194,9 @@ int for_each_thermal_governor(int (*cb)(struct thermal_governor *, void *), · 193 unmodified lines
194194
195195 struct thermal_zone_device *thermal_zone_get_by_id(int id);
196196
197+DEFINE_CLASS(thermal_zone_get_by_id, struct thermal_zone_device *,
198+ if (_T) put_device(&_T->device), thermal_zone_get_by_id(id), int id)
199+
197200 static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
198201 {
199202 return cdev->ops->get_requested_power && cdev->ops->state2power &&
drivers/thermal/thermal_netlink.c+3−6
@@ -443,7 +443,6 @@ static int thermal_genl_cmd_tz_get_trip(struct param *p) · 442 unmodified lines
443443 {
444444 struct sk_buff *msg = p->msg;
445445 const struct thermal_trip_desc *td;
446− struct thermal_zone_device *tz;
447446 struct nlattr *start_trip;
448447 int id;
449448
@@ -452,7 +451,7 @@ static int thermal_genl_cmd_tz_get_trip(struct param *p) · 2 unmodified lines
452451
453452 id = nla_get_u32(p->attrs[THERMAL_GENL_ATTR_TZ_ID]);
454453
455− tz = thermal_zone_get_by_id(id);
454+ CLASS(thermal_zone_get_by_id, tz)(id);
456455 if (!tz)
457456 return -EINVAL;
458457
@@ -488,7 +487,6 @@ out_cancel_nest: · 29 unmodified lines
488487 static int thermal_genl_cmd_tz_get_temp(struct param *p)
489488 {
490489 struct sk_buff *msg = p->msg;
491− struct thermal_zone_device *tz;
492490 int temp, ret, id;
493491
494492 if (!p->attrs[THERMAL_GENL_ATTR_TZ_ID])
@@ -496,7 +494,7 @@ static int thermal_genl_cmd_tz_get_temp(struct param *p) · 1 unmodified line
496494
497495 id = nla_get_u32(p->attrs[THERMAL_GENL_ATTR_TZ_ID]);
498496
499− tz = thermal_zone_get_by_id(id);
497+ CLASS(thermal_zone_get_by_id, tz)(id);
500498 if (!tz)
501499 return -EINVAL;
502500
@@ -514,7 +512,6 @@ static int thermal_genl_cmd_tz_get_temp(struct param *p) · 11 unmodified lines
514512 static int thermal_genl_cmd_tz_get_gov(struct param *p)
515513 {
516514 struct sk_buff *msg = p->msg;
517− struct thermal_zone_device *tz;
518515 int id, ret = 0;
519516
520517 if (!p->attrs[THERMAL_GENL_ATTR_TZ_ID])
@@ -522,7 +519,7 @@ static int thermal_genl_cmd_tz_get_gov(struct param *p) · 1 unmodified line
522519
523520 id = nla_get_u32(p->attrs[THERMAL_GENL_ATTR_TZ_ID]);
524521
525− tz = thermal_zone_get_by_id(id);
522+ CLASS(thermal_zone_get_by_id, tz)(id);
526523 if (!tz)
527524 return -EINVAL;
528525
drivers/thunderbolt/retimer.c+3−2
@@ -516,7 +516,7 @@ int tb_retimer_scan(struct tb_port *port, bool add) · 515 unmodified lines
516516 */
517517 tb_retimer_set_inbound_sbtx(port);
518518
519− for (i = 1; i <= TB_MAX_RETIMER_INDEX; i++) {
519+ for (max = 1, i = 1; i <= TB_MAX_RETIMER_INDEX; i++) {
520520 /*
521521 * Last retimer is true only for the last on-board
522522 * retimer (the one connected directly to the Type-C
@@ -527,9 +527,10 @@ int tb_retimer_scan(struct tb_port *port, bool add) · 4 unmodified lines
527527 last_idx = i;
528528 else if (ret < 0)
529529 break;
530+
531+ max = i;
530532 }
531533
532− max = i;
533534 ret = 0;
534535
535536 /* Add retimers if they do not exist already */
drivers/thunderbolt/tb.c+42−6
@@ -288,6 +288,24 @@ static void tb_increase_tmu_accuracy(struct tb_tunnel *tunnel) · 287 unmodified lines
288288 device_for_each_child(&sw->dev, NULL, tb_increase_switch_tmu_accuracy);
289289 }
290290
291+static int tb_switch_tmu_hifi_uni_required(struct device *dev, void *not_used)
292+{
293+ struct tb_switch *sw = tb_to_switch(dev);
294+
295+ if (sw && tb_switch_tmu_is_enabled(sw) &&
296+ tb_switch_tmu_is_configured(sw, TB_SWITCH_TMU_MODE_HIFI_UNI))
297+ return 1;
298+
299+ return device_for_each_child(dev, NULL,
300+ tb_switch_tmu_hifi_uni_required);
301+}
302+
303+static bool tb_tmu_hifi_uni_required(struct tb *tb)
304+{
305+ return device_for_each_child(&tb->dev, NULL,
306+ tb_switch_tmu_hifi_uni_required) == 1;
307+}
308+
291309 static int tb_enable_tmu(struct tb_switch *sw)
292310 {
293311 int ret;
@@ -302,12 +320,30 @@ static int tb_enable_tmu(struct tb_switch *sw) · 8 unmodified lines
302320 ret = tb_switch_tmu_configure(sw,
303321 TB_SWITCH_TMU_MODE_MEDRES_ENHANCED_UNI);
304322 if (ret == -EOPNOTSUPP) {
305− if (tb_switch_clx_is_enabled(sw, TB_CL1))
306− ret = tb_switch_tmu_configure(sw,
307− TB_SWITCH_TMU_MODE_LOWRES);
308− else
309− ret = tb_switch_tmu_configure(sw,
310− TB_SWITCH_TMU_MODE_HIFI_BI);
323+ if (tb_switch_clx_is_enabled(sw, TB_CL1)) {
324+ /*
325+ * Figure out uni-directional HiFi TMU requirements
326+ * currently in the domain. If there are no
327+ * uni-directional HiFi requirements we can put the TMU
328+ * into LowRes mode.
329+ *
330+ * Deliberately skip bi-directional HiFi links
331+ * as these work independently of other links
332+ * (and they do not allow any CL states anyway).
333+ */
334+ if (tb_tmu_hifi_uni_required(sw->tb))
335+ ret = tb_switch_tmu_configure(sw,
336+ TB_SWITCH_TMU_MODE_HIFI_UNI);
337+ else
338+ ret = tb_switch_tmu_configure(sw,
339+ TB_SWITCH_TMU_MODE_LOWRES);
340+ } else {
341+ ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_MODE_HIFI_BI);
342+ }
343+
344+ /* If not supported, fallback to bi-directional HiFi */
345+ if (ret == -EOPNOTSUPP)
346+ ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_MODE_HIFI_BI);
311347 }
312348 if (ret)
313349 return ret;
drivers/tty/n_gsm.c+2−0
@@ -3157,6 +3157,8 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc) · 3156 unmodified lines
31573157 mutex_unlock(&gsm->mutex);
31583158 /* Now wipe the queues */
31593159 tty_ldisc_flush(gsm->tty);
3160+
3161+ guard(spinlock_irqsave)(&gsm->tx_lock);
31603162 list_for_each_entry_safe(txq, ntxq, &gsm->tx_ctrl_list, list)
31613163 kfree(txq);
31623164 INIT_LIST_HEAD(&gsm->tx_ctrl_list);
drivers/tty/serial/imx.c+15−0
@@ -762,6 +762,21 @@ static irqreturn_t __imx_uart_rtsint(int irq, void *dev_id) · 761 unmodified lines
762762
763763 imx_uart_writel(sport, USR1_RTSD, USR1);
764764 usr1 = imx_uart_readl(sport, USR1) & USR1_RTSS;
765+ /*
766+ * Update sport->old_status here, so any follow-up calls to
767+ * imx_uart_mctrl_check() will be able to recognize that RTS
768+ * state changed since last imx_uart_mctrl_check() call.
769+ *
770+ * In case RTS has been detected as asserted here and later on
771+ * deasserted by the time imx_uart_mctrl_check() was called,
772+ * imx_uart_mctrl_check() can detect the RTS state change and
773+ * trigger uart_handle_cts_change() to unblock the port for
774+ * further TX transfers.
775+ */
776+ if (usr1 & USR1_RTSS)
777+ sport->old_status |= TIOCM_CTS;
778+ else
779+ sport->old_status &= ~TIOCM_CTS;
765780 uart_handle_cts_change(&sport->port, usr1);
766781 wake_up_interruptible(&sport->port.state->port.delta_msr_wait);
767782
drivers/tty/serial/qcom_geni_serial.c+48−55
@@ -147,6 +147,7 @@ static struct uart_driver qcom_geni_uart_driver; · 146 unmodified lines
147147
148148 static void __qcom_geni_serial_cancel_tx_cmd(struct uart_port *uport);
149149 static void qcom_geni_serial_cancel_tx_cmd(struct uart_port *uport);
150+static int qcom_geni_serial_port_setup(struct uart_port *uport);
150151
151152 static inline struct qcom_geni_serial_port *to_dev_port(struct uart_port *uport)
152153 {
@@ -395,6 +396,23 @@ static void qcom_geni_serial_poll_put_char(struct uart_port *uport, · 242 unmodified lines
395396 writel(c, uport->membase + SE_GENI_TX_FIFOn);
396397 qcom_geni_serial_poll_tx_done(uport);
397398 }
399+
400+static int qcom_geni_serial_poll_init(struct uart_port *uport)
401+{
402+ struct qcom_geni_serial_port *port = to_dev_port(uport);
403+ int ret;
404+
405+ if (!port->setup) {
406+ ret = qcom_geni_serial_port_setup(uport);
407+ if (ret)
408+ return ret;
409+ }
410+
411+ if (!qcom_geni_serial_secondary_active(uport))
412+ geni_se_setup_s_cmd(&port->se, UART_START_READ, 0);
413+
414+ return 0;
415+}
398416 #endif
399417
400418 #ifdef CONFIG_SERIAL_QCOM_GENI_CONSOLE
@@ -562,7 +580,7 @@ static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) · 161 unmodified lines
562580 }
563581 #endif /* CONFIG_SERIAL_QCOM_GENI_CONSOLE */
564582
565−static void handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop)
583+static void handle_rx_uart(struct uart_port *uport, u32 bytes)
566584 {
567585 struct qcom_geni_serial_port *port = to_dev_port(uport);
568586 struct tty_port *tport = &uport->state->port;
@@ -570,9 +588,8 @@ static void handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) · 1 unmodified line
570588
571589 ret = tty_insert_flip_string(tport, port->rx_buf, bytes);
572590 if (ret != bytes) {
573− dev_err(uport->dev, "%s:Unable to push data ret %d_bytes %d\n",
574− __func__, ret, bytes);
575− WARN_ON_ONCE(1);
591+ dev_err_ratelimited(uport->dev, "failed to push data (%d < %u)\n",
592+ ret, bytes);
576593 }
577594 uport->icount.rx += ret;
578595 tty_flip_buffer_push(tport);
@@ -787,17 +804,27 @@ static void qcom_geni_serial_start_rx_fifo(struct uart_port *uport) · 208 unmodified lines
787804 static void qcom_geni_serial_stop_rx_dma(struct uart_port *uport)
788805 {
789806 struct qcom_geni_serial_port *port = to_dev_port(uport);
807+ bool done;
790808
791809 if (!qcom_geni_serial_secondary_active(uport))
792810 return;
793811
794812 geni_se_cancel_s_cmd(&port->se);
795− qcom_geni_serial_poll_bit(uport, SE_GENI_S_IRQ_STATUS,
796− S_CMD_CANCEL_EN, true);
797−
798− if (qcom_geni_serial_secondary_active(uport))
813+ done = qcom_geni_serial_poll_bit(uport, SE_DMA_RX_IRQ_STAT,
814+ RX_EOT, true);
815+ if (done) {
816+ writel(RX_EOT | RX_DMA_DONE,
817+ uport->membase + SE_DMA_RX_IRQ_CLR);
818+ } else {
799819 qcom_geni_serial_abort_rx(uport);
800820
821+ writel(1, uport->membase + SE_DMA_RX_FSM_RST);
822+ qcom_geni_serial_poll_bit(uport, SE_DMA_RX_IRQ_STAT,
823+ RX_RESET_DONE, true);
824+ writel(RX_RESET_DONE | RX_DMA_DONE,
825+ uport->membase + SE_DMA_RX_IRQ_CLR);
826+ }
827+
801828 if (port->rx_dma_addr) {
802829 geni_se_rx_dma_unprep(&port->se, port->rx_dma_addr,
803830 DMA_RX_BUF_SIZE);
@@ -846,7 +873,7 @@ static void qcom_geni_serial_handle_rx_dma(struct uart_port *uport, bool drop) · 42 unmodified lines
846873 }
847874
848875 if (!drop)
849− handle_rx_uart(uport, rx_in, drop);
876+ handle_rx_uart(uport, rx_in);
850877
851878 ret = geni_se_rx_dma_prep(&port->se, port->rx_buf,
852879 DMA_RX_BUF_SIZE,
@@ -1096,10 +1123,12 @@ static void qcom_geni_serial_shutdown(struct uart_port *uport) · 243 unmodified lines
10961123 {
10971124 disable_irq(uport->irq);
10981125
1126+ uart_port_lock_irq(uport);
10991127 qcom_geni_serial_stop_tx(uport);
11001128 qcom_geni_serial_stop_rx(uport);
11011129
11021130 qcom_geni_serial_cancel_tx_cmd(uport);
1131+ uart_port_unlock_irq(uport);
11031132 }
11041133
11051134 static void qcom_geni_serial_flush_buffer(struct uart_port *uport)
@@ -1152,7 +1181,6 @@ static int qcom_geni_serial_port_setup(struct uart_port *uport) · 46 unmodified lines
11521181 false, true, true);
11531182 geni_se_init(&port->se, UART_RX_WM, port->rx_fifo_depth - 2);
11541183 geni_se_select_mode(&port->se, port->dev_data->mode);
1155− qcom_geni_serial_start_rx(uport);
11561184 port->setup = true;
11571185
11581186 return 0;
@@ -1168,6 +1196,11 @@ static int qcom_geni_serial_startup(struct uart_port *uport) · 9 unmodified lines
11681196 if (ret)
11691197 return ret;
11701198 }
1199+
1200+ uart_port_lock_irq(uport);
1201+ qcom_geni_serial_start_rx(uport);
1202+ uart_port_unlock_irq(uport);
1203+
11711204 enable_irq(uport->irq);
11721205
11731206 return 0;
@@ -1253,7 +1286,6 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, · 79 unmodified lines
12531286 unsigned int avg_bw_core;
12541287 unsigned long timeout;
12551288
1256− qcom_geni_serial_stop_rx(uport);
12571289 /* baud rate */
12581290 baud = uart_get_baud_rate(uport, termios, old, 300, 4000000);
12591291
@@ -1269,7 +1301,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, · 9 unmodified lines
12691301 dev_err(port->se.dev,
12701302 "Couldn't find suitable clock rate for %u\n",
12711303 baud * sampling_rate);
1272− goto out_restart_rx;
1304+ return;
12731305 }
12741306
12751307 dev_dbg(port->se.dev, "desired_rate = %u, clk_rate = %lu, clk_div = %u\n",
@@ -1360,8 +1392,6 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, · 84 unmodified lines
13601392 writel(stop_bit_len, uport->membase + SE_UART_TX_STOP_BIT_LEN);
13611393 writel(ser_clk_cfg, uport->membase + GENI_SER_M_CLK_CFG);
13621394 writel(ser_clk_cfg, uport->membase + GENI_SER_S_CLK_CFG);
1363−out_restart_rx:
1364− qcom_geni_serial_start_rx(uport);
13651395 }
13661396
13671397 #ifdef CONFIG_SERIAL_QCOM_GENI_CONSOLE
@@ -1582,7 +1612,7 @@ static const struct uart_ops qcom_geni_console_pops = { · 214 unmodified lines
15821612 #ifdef CONFIG_CONSOLE_POLL
15831613 .poll_get_char = qcom_geni_serial_get_char,
15841614 .poll_put_char = qcom_geni_serial_poll_put_char,
1585− .poll_init = qcom_geni_serial_port_setup,
1615+ .poll_init = qcom_geni_serial_poll_init,
15861616 #endif
15871617 .pm = qcom_geni_serial_pm,
15881618 };
@@ -1749,7 +1779,7 @@ static void qcom_geni_serial_remove(struct platform_device *pdev) · 160 unmodified lines
17491779 uart_remove_one_port(drv, &port->uport);
17501780 }
17511781
1752−static int qcom_geni_serial_sys_suspend(struct device *dev)
1782+static int qcom_geni_serial_suspend(struct device *dev)
17531783 {
17541784 struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
17551785 struct uart_port *uport = &port->uport;
@@ -1766,7 +1796,7 @@ static int qcom_geni_serial_sys_suspend(struct device *dev) · 10 unmodified lines
17661796 return uart_suspend_port(private_data->drv, uport);
17671797 }
17681798
1769−static int qcom_geni_serial_sys_resume(struct device *dev)
1799+static int qcom_geni_serial_resume(struct device *dev)
17701800 {
17711801 int ret;
17721802 struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
@@ -1781,38 +1811,6 @@ static int qcom_geni_serial_sys_resume(struct device *dev) · 8 unmodified lines
17811811 return ret;
17821812 }
17831813
1784−static int qcom_geni_serial_sys_hib_resume(struct device *dev)
1785−{
1786− int ret = 0;
1787− struct uart_port *uport;
1788− struct qcom_geni_private_data *private_data;
1789− struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
1790−
1791− uport = &port->uport;
1792− private_data = uport->private_data;
1793−
1794− if (uart_console(uport)) {
1795− geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ALWAYS);
1796− geni_icc_set_bw(&port->se);
1797− ret = uart_resume_port(private_data->drv, uport);
1798− /*
1799− * For hibernation usecase clients for
1800− * console UART won't call port setup during restore,
1801− * hence call port setup for console uart.
1802− */
1803− qcom_geni_serial_port_setup(uport);
1804− } else {
1805− /*
1806− * Peripheral register settings are lost during hibernation.
1807− * Update setup flag such that port setup happens again
1808− * during next session. Clients of HS-UART will close and
1809− * open the port during hibernation.
1810− */
1811− port->setup = false;
1812− }
1813− return ret;
1814−}
1815−
18161814 static const struct qcom_geni_device_data qcom_geni_console_data = {
18171815 .console = true,
18181816 .mode = GENI_SE_FIFO,
@@ -1824,12 +1822,7 @@ static const struct qcom_geni_device_data qcom_geni_uart_data = { · 5 unmodified lines
18241822 };
18251823
18261824 static const struct dev_pm_ops qcom_geni_serial_pm_ops = {
1827− .suspend = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1828− .resume = pm_sleep_ptr(qcom_geni_serial_sys_resume),
1829− .freeze = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1830− .poweroff = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1831− .restore = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume),
1832− .thaw = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume),
1825+ SYSTEM_SLEEP_PM_OPS(qcom_geni_serial_suspend, qcom_geni_serial_resume)
18331826 };
18341827
18351828 static const struct of_device_id qcom_geni_serial_match_table[] = {
drivers/tty/vt/vt.c+1−1
@@ -4726,7 +4726,7 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op) · 4725 unmodified lines
47264726 return -EINVAL;
47274727
47284728 if (op->data) {
4729− font.data = kvmalloc(max_font_size, GFP_KERNEL);
4729+ font.data = kvzalloc(max_font_size, GFP_KERNEL);
47304730 if (!font.data)
47314731 return -ENOMEM;
47324732 } else
drivers/ufs/core/ufs-mcq.c+8−7
@@ -539,7 +539,7 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag) · 538 unmodified lines
539539 struct scsi_cmnd *cmd = lrbp->cmd;
540540 struct ufs_hw_queue *hwq;
541541 void __iomem *reg, *opr_sqd_base;
542− u32 nexus, id, val;
542+ u32 nexus, id, val, rtc;
543543 int err;
544544
545545 if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
@@ -569,17 +569,18 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag) · 23 unmodified lines
569569 opr_sqd_base = mcq_opr_base(hba, OPR_SQD, id);
570570 writel(nexus, opr_sqd_base + REG_SQCTI);
571571
572− /* SQRTCy.ICU = 1 */
573− writel(SQ_ICU, opr_sqd_base + REG_SQRTC);
572+ /* Initiate Cleanup */
573+ writel(readl(opr_sqd_base + REG_SQRTC) | SQ_ICU,
574+ opr_sqd_base + REG_SQRTC);
574575
575576 /* Poll SQRTSy.CUS = 1. Return result from SQRTSy.RTC */
576577 reg = opr_sqd_base + REG_SQRTS;
577578 err = read_poll_timeout(readl, val, val & SQ_CUS, 20,
578579 MCQ_POLL_US, false, reg);
579− if (err)
580− dev_err(hba->dev, "%s: failed. hwq=%d, tag=%d err=%ld\n",
581− __func__, id, task_tag,
582− FIELD_GET(SQ_ICU_ERR_CODE_MASK, readl(reg)));
580+ rtc = FIELD_GET(SQ_ICU_ERR_CODE_MASK, readl(reg));
581+ if (err || rtc)
582+ dev_err(hba->dev, "%s: failed. hwq=%d, tag=%d err=%d RTC=%d\n",
583+ __func__, id, task_tag, err, rtc);
583584
584585 if (ufshcd_mcq_sq_start(hba, hwq))
585586 err = -ETIMEDOUT;
drivers/ufs/core/ufshcd.c+10−21
@@ -2933,9 +2933,8 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i) · 2932 unmodified lines
29332933 struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr;
29342934 dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr +
29352935 i * ufshcd_get_ucd_size(hba);
2936− u16 response_offset = offsetof(struct utp_transfer_cmd_desc,
2937− response_upiu);
2938− u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table);
2936+ u16 response_offset = le16_to_cpu(utrdlp[i].response_upiu_offset);
2937+ u16 prdt_offset = le16_to_cpu(utrdlp[i].prd_table_offset);
29392938
29402939 lrb->utr_descriptor_ptr = utrdlp + i;
29412940 lrb->utrd_dma_addr = hba->utrdl_dma_addr +
@@ -5417,10 +5416,12 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, · 2475 unmodified lines
54175416 }
54185417 break;
54195418 case OCS_ABORTED:
5420− result |= DID_ABORT << 16;
5421− break;
54225419 case OCS_INVALID_COMMAND_STATUS:
54235420 result |= DID_REQUEUE << 16;
5421+ dev_warn(hba->dev,
5422+ "OCS %s from controller for tag %d\n",
5423+ (ocs == OCS_ABORTED ? "aborted" : "invalid"),
5424+ lrbp->task_tag);
54245425 break;
54255426 case OCS_INVALID_CMD_TABLE_ATTR:
54265427 case OCS_INVALID_PRDT_ATTR:
@@ -6466,26 +6467,12 @@ static bool ufshcd_abort_one(struct request *rq, void *priv) · 1039 unmodified lines
64666467 struct scsi_device *sdev = cmd->device;
64676468 struct Scsi_Host *shost = sdev->host;
64686469 struct ufs_hba *hba = shost_priv(shost);
6469− struct ufshcd_lrb *lrbp = &hba->lrb[tag];
6470− struct ufs_hw_queue *hwq;
6471− unsigned long flags;
64726470
64736471 *ret = ufshcd_try_to_abort_task(hba, tag);
64746472 dev_err(hba->dev, "Aborting tag %d / CDB %#02x %s\n", tag,
64756473 hba->lrb[tag].cmd ? hba->lrb[tag].cmd->cmnd[0] : -1,
64766474 *ret ? "failed" : "succeeded");
64776475
6478− /* Release cmd in MCQ mode if abort succeeds */
6479− if (hba->mcq_enabled && (*ret == 0)) {
6480− hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(lrbp->cmd));
6481− if (!hwq)
6482− return 0;
6483− spin_lock_irqsave(&hwq->cq_lock, flags);
6484− if (ufshcd_cmd_inflight(lrbp->cmd))
6485− ufshcd_release_scsi_cmd(hba, lrbp);
6486− spin_unlock_irqrestore(&hwq->cq_lock, flags);
6487− }
6488−
64896476 return *ret == 0;
64906477 }
64916478
@@ -8232,7 +8219,7 @@ static void ufshcd_update_rtc(struct ufs_hba *hba) · 1740 unmodified lines
82328219
82338220 err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, QUERY_ATTR_IDN_SECONDS_PASSED,
82348221 0, 0, &val);
8235− ufshcd_rpm_put_sync(hba);
8222+ ufshcd_rpm_put(hba);
82368223
82378224 if (err)
82388225 dev_err(hba->dev, "%s: Failed to update rtc %d\n", __func__, err);
@@ -10210,7 +10197,9 @@ static void ufshcd_wl_shutdown(struct device *dev) · 1971 unmodified lines
1021010197 shost_for_each_device(sdev, hba->host) {
1021110198 if (sdev == hba->ufs_device_wlun)
1021210199 continue;
10213− scsi_device_quiesce(sdev);
10200+ mutex_lock(&sdev->state_mutex);
10201+ scsi_device_set_state(sdev, SDEV_OFFLINE);
10202+ mutex_unlock(&sdev->state_mutex);
1021410203 }
1021510204 __ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM);
1021610205
drivers/usb/core/usb-acpi.c+2−2
@@ -170,11 +170,11 @@ static int usb_acpi_add_usb4_devlink(struct usb_device *udev) · 169 unmodified lines
170170 struct fwnode_handle *nhi_fwnode __free(fwnode_handle) =
171171 fwnode_find_reference(dev_fwnode(&port_dev->dev), "usb4-host-interface", 0);
172172
173− if (IS_ERR(nhi_fwnode))
173+ if (IS_ERR(nhi_fwnode) || !nhi_fwnode->dev)
174174 return 0;
175175
176176 link = device_link_add(&port_dev->child->dev, nhi_fwnode->dev,
177− DL_FLAG_AUTOREMOVE_CONSUMER |
177+ DL_FLAG_STATELESS |
178178 DL_FLAG_RPM_ACTIVE |
179179 DL_FLAG_PM_RUNTIME);
180180 if (!link) {
drivers/usb/dwc2/params.c+0−1
@@ -23,7 +23,6 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg) · 22 unmodified lines
2323 p->max_transfer_size = 65535;
2424 p->max_packet_count = 511;
2525 p->ahbcfg = 0x10;
26− p->no_clock_gating = true;
2726 }
2827
2928 static void dwc2_set_his_params(struct dwc2_hsotg *hsotg)
drivers/usb/dwc3/core.c+41−8
@@ -544,6 +544,7 @@ static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned int length) · 543 unmodified lines
544544 int dwc3_event_buffers_setup(struct dwc3 *dwc)
545545 {
546546 struct dwc3_event_buffer *evt;
547+ u32 reg;
547548
548549 if (!dwc->ev_buf)
549550 return 0;
@@ -556,8 +557,10 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc) · 6 unmodified lines
556557 upper_32_bits(evt->dma));
557558 dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0),
558559 DWC3_GEVNTSIZ_SIZE(evt->length));
559− dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0);
560560
561+ /* Clear any stale event */
562+ reg = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
563+ dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), reg);
561564 return 0;
562565 }
563566
@@ -584,7 +587,10 @@ void dwc3_event_buffers_cleanup(struct dwc3 *dwc) · 20 unmodified lines
584587 dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(0), 0);
585588 dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), DWC3_GEVNTSIZ_INTMASK
586589 | DWC3_GEVNTSIZ_SIZE(0));
587− dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0);
590+
591+ /* Clear any stale event */
592+ reg = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
593+ dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), reg);
588594 }
589595
590596 static void dwc3_core_num_eps(struct dwc3 *dwc)
@@ -2336,6 +2342,11 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) · 1745 unmodified lines
23362342 u32 reg;
23372343 int i;
23382344
2345+ dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) &
2346+ DWC3_GUSB2PHYCFG_SUSPHY) ||
2347+ (dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)) &
2348+ DWC3_GUSB3PIPECTL_SUSPHY);
2349+
23392350 switch (dwc->current_dr_role) {
23402351 case DWC3_GCTL_PRTCAP_DEVICE:
23412352 if (pm_runtime_suspended(dwc->dev))
@@ -2387,6 +2398,15 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) · 45 unmodified lines
23872398 break;
23882399 }
23892400
2401+ if (!PMSG_IS_AUTO(msg)) {
2402+ /*
2403+ * TI AM62 platform requires SUSPHY to be
2404+ * enabled for system suspend to work.
2405+ */
2406+ if (!dwc->susphy_state)
2407+ dwc3_enable_susphy(dwc, true);
2408+ }
2409+
23902410 return 0;
23912411 }
23922412
@@ -2454,6 +2474,11 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg) · 61 unmodified lines
24542474 break;
24552475 }
24562476
2477+ if (!PMSG_IS_AUTO(msg)) {
2478+ /* restore SUSPHY state to that before system suspend. */
2479+ dwc3_enable_susphy(dwc, dwc->susphy_state);
2480+ }
2481+
24572482 return 0;
24582483 }
24592484
@@ -2499,7 +2524,11 @@ static int dwc3_runtime_resume(struct device *dev) · 39 unmodified lines
24992524
25002525 switch (dwc->current_dr_role) {
25012526 case DWC3_GCTL_PRTCAP_DEVICE:
2502− dwc3_gadget_process_pending_events(dwc);
2527+ if (dwc->pending_events) {
2528+ pm_runtime_put(dwc->dev);
2529+ dwc->pending_events = false;
2530+ enable_irq(dwc->irq_gadget);
2531+ }
25032532 break;
25042533 case DWC3_GCTL_PRTCAP_HOST:
25052534 default:
@@ -2552,7 +2581,7 @@ static int dwc3_suspend(struct device *dev) · 46 unmodified lines
25522581 static int dwc3_resume(struct device *dev)
25532582 {
25542583 struct dwc3 *dwc = dev_get_drvdata(dev);
2555− int ret;
2584+ int ret = 0;
25562585
25572586 pinctrl_pm_select_default_state(dev);
25582587
@@ -2560,14 +2589,12 @@ static int dwc3_resume(struct device *dev) · 1 unmodified line
25602589 pm_runtime_set_active(dev);
25612590
25622591 ret = dwc3_resume_common(dwc, PMSG_RESUME);
2563− if (ret) {
2592+ if (ret)
25642593 pm_runtime_set_suspended(dev);
2565− return ret;
2566− }
25672594
25682595 pm_runtime_enable(dev);
25692596
2570− return 0;
2597+ return ret;
25712598 }
25722599
25732600 static void dwc3_complete(struct device *dev)
@@ -2589,6 +2616,12 @@ static void dwc3_complete(struct device *dev) · 15 unmodified lines
25892616 static const struct dev_pm_ops dwc3_dev_pm_ops = {
25902617 SET_SYSTEM_SLEEP_PM_OPS(dwc3_suspend, dwc3_resume)
25912618 .complete = dwc3_complete,
2619+
2620+ /*
2621+ * Runtime suspend halts the controller on disconnection. It relies on
2622+ * platforms with custom connection notification to start the controller
2623+ * again.
2624+ */
25922625 SET_RUNTIME_PM_OPS(dwc3_runtime_suspend, dwc3_runtime_resume,
25932626 dwc3_runtime_idle)
25942627 };
drivers/usb/dwc3/core.h+3−4
@@ -1150,6 +1150,8 @@ struct dwc3_scratchpad_array { · 1149 unmodified lines
11501150 * @sys_wakeup: set if the device may do system wakeup.
11511151 * @wakeup_configured: set if the device is configured for remote wakeup.
11521152 * @suspended: set to track suspend event due to U3/L2.
1153+ * @susphy_state: state of DWC3_GUSB2PHYCFG_SUSPHY + DWC3_GUSB3PIPECTL_SUSPHY
1154+ * before PM suspend.
11531155 * @imod_interval: set the interrupt moderation interval in 250ns
11541156 * increments or 0 to disable.
11551157 * @max_cfg_eps: current max number of IN eps used across all USB configs.
@@ -1382,6 +1384,7 @@ struct dwc3 { · 226 unmodified lines
13821384 unsigned sys_wakeup:1;
13831385 unsigned wakeup_configured:1;
13841386 unsigned suspended:1;
1387+ unsigned susphy_state:1;
13851388
13861389 u16 imod_interval;
13871390
@@ -1675,7 +1678,6 @@ static inline void dwc3_otg_host_init(struct dwc3 *dwc) · 287 unmodified lines
16751678 #if !IS_ENABLED(CONFIG_USB_DWC3_HOST)
16761679 int dwc3_gadget_suspend(struct dwc3 *dwc);
16771680 int dwc3_gadget_resume(struct dwc3 *dwc);
1678−void dwc3_gadget_process_pending_events(struct dwc3 *dwc);
16791681 #else
16801682 static inline int dwc3_gadget_suspend(struct dwc3 *dwc)
16811683 {
@@ -1687,9 +1689,6 @@ static inline int dwc3_gadget_resume(struct dwc3 *dwc) · 5 unmodified lines
16871689 return 0;
16881690 }
16891691
1690−static inline void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
1691−{
1692−}
16931692 #endif /* !IS_ENABLED(CONFIG_USB_DWC3_HOST) */
16941693
16951694 #if IS_ENABLED(CONFIG_USB_DWC3_ULPI)
drivers/usb/dwc3/gadget.c+6−15
@@ -438,6 +438,10 @@ skip_status: · 437 unmodified lines
438438 dwc3_gadget_ep_get_transfer_index(dep);
439439 }
440440
441+ if (DWC3_DEPCMD_CMD(cmd) == DWC3_DEPCMD_ENDTRANSFER &&
442+ !(cmd & DWC3_DEPCMD_CMDIOC))
443+ mdelay(1);
444+
441445 if (saved_config) {
442446 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
443447 reg |= saved_config;
@@ -1715,12 +1719,10 @@ static int __dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool int · 1271 unmodified lines
17151719 WARN_ON_ONCE(ret);
17161720 dep->resource_index = 0;
17171721
1718− if (!interrupt) {
1719− mdelay(1);
1722+ if (!interrupt)
17201723 dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
1721− } else if (!ret) {
1724+ else if (!ret)
17221725 dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
1723− }
17241726
17251727 dep->flags &= ~DWC3_EP_DELAY_STOP;
17261728 return ret;
@@ -4728,14 +4730,3 @@ int dwc3_gadget_resume(struct dwc3 *dwc) · 3001 unmodified lines
47284730
47294731 return dwc3_gadget_soft_connect(dwc);
47304732 }
4731−
4732−void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
4733−{
4734− if (dwc->pending_events) {
4735− dwc3_interrupt(dwc->irq_gadget, dwc->ev_buf);
4736− dwc3_thread_interrupt(dwc->irq_gadget, dwc->ev_buf);
4737− pm_runtime_put(dwc->dev);
4738− dwc->pending_events = false;
4739− enable_irq(dwc->irq_gadget);
4740− }
4741−}
drivers/usb/gadget/function/f_uac2.c+3−3
@@ -2061,7 +2061,7 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item, \ · 2060 unmodified lines
20612061 const char *page, size_t len) \
20622062 { \
20632063 struct f_uac2_opts *opts = to_f_uac2_opts(item); \
2064− int ret = 0; \
2064+ int ret = len; \
20652065 \
20662066 mutex_lock(&opts->lock); \
20672067 if (opts->refcnt) { \
@@ -2072,8 +2072,8 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item, \ · 4 unmodified lines
20722072 if (len && page[len - 1] == '\n') \
20732073 len--; \
20742074 \
2075− ret = scnprintf(opts->name, min(sizeof(opts->name), len + 1), \
2076− "%s", page); \
2075+ scnprintf(opts->name, min(sizeof(opts->name), len + 1), \
2076+ "%s", page); \
20772077 \
20782078 end: \
20792079 mutex_unlock(&opts->lock); \
drivers/usb/gadget/udc/core.c+1−0
@@ -1696,6 +1696,7 @@ int usb_gadget_register_driver_owner(struct usb_gadget_driver *driver, · 1695 unmodified lines
16961696 driver->driver.bus = &gadget_bus_type;
16971697 driver->driver.owner = owner;
16981698 driver->driver.mod_name = mod_name;
1699+ driver->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
16991700 ret = driver_register(&driver->driver);
17001701 if (ret) {
17011702 pr_warn("%s: driver registration failed: %d\n",
drivers/usb/gadget/udc/dummy_hcd.c+15−5
@@ -254,6 +254,7 @@ struct dummy_hcd { · 253 unmodified lines
254254 u32 stream_en_ep;
255255 u8 num_stream[30 / 2];
256256
257+ unsigned timer_pending:1;
257258 unsigned active:1;
258259 unsigned old_active:1;
259260 unsigned resuming:1;
@@ -1303,9 +1304,11 @@ static int dummy_urb_enqueue( · 1043 unmodified lines
13031304 urb->error_count = 1; /* mark as a new urb */
13041305
13051306 /* kick the scheduler, it'll do the rest */
1306− if (!hrtimer_active(&dum_hcd->timer))
1307+ if (!dum_hcd->timer_pending) {
1308+ dum_hcd->timer_pending = 1;
13071309 hrtimer_start(&dum_hcd->timer, ns_to_ktime(DUMMY_TIMER_INT_NSECS),
13081310 HRTIMER_MODE_REL_SOFT);
1311+ }
13091312
13101313 done:
13111314 spin_unlock_irqrestore(&dum_hcd->dum->lock, flags);
@@ -1324,9 +1327,10 @@ static int dummy_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) · 12 unmodified lines
13241327 spin_lock_irqsave(&dum_hcd->dum->lock, flags);
13251328
13261329 rc = usb_hcd_check_unlink_urb(hcd, urb, status);
1327− if (!rc && dum_hcd->rh_state != DUMMY_RH_RUNNING &&
1328− !list_empty(&dum_hcd->urbp_list))
1330+ if (rc == 0 && !dum_hcd->timer_pending) {
1331+ dum_hcd->timer_pending = 1;
13291332 hrtimer_start(&dum_hcd->timer, ns_to_ktime(0), HRTIMER_MODE_REL_SOFT);
1333+ }
13301334
13311335 spin_unlock_irqrestore(&dum_hcd->dum->lock, flags);
13321336 return rc;
@@ -1813,6 +1817,7 @@ static enum hrtimer_restart dummy_timer(struct hrtimer *t) · 480 unmodified lines
18131817
18141818 /* look at each urb queued by the host side driver */
18151819 spin_lock_irqsave(&dum->lock, flags);
1820+ dum_hcd->timer_pending = 0;
18161821
18171822 if (!dum_hcd->udev) {
18181823 dev_err(dummy_dev(dum_hcd),
@@ -1994,8 +1999,10 @@ return_urb: · 175 unmodified lines
19941999 if (list_empty(&dum_hcd->urbp_list)) {
19952000 usb_put_dev(dum_hcd->udev);
19962001 dum_hcd->udev = NULL;
1997− } else if (dum_hcd->rh_state == DUMMY_RH_RUNNING) {
2002+ } else if (!dum_hcd->timer_pending &&
2003+ dum_hcd->rh_state == DUMMY_RH_RUNNING) {
19982004 /* want a 1 msec delay here */
2005+ dum_hcd->timer_pending = 1;
19992006 hrtimer_start(&dum_hcd->timer, ns_to_ktime(DUMMY_TIMER_INT_NSECS),
20002007 HRTIMER_MODE_REL_SOFT);
20012008 }
@@ -2390,8 +2397,10 @@ static int dummy_bus_resume(struct usb_hcd *hcd) · 388 unmodified lines
23902397 } else {
23912398 dum_hcd->rh_state = DUMMY_RH_RUNNING;
23922399 set_link_state(dum_hcd);
2393− if (!list_empty(&dum_hcd->urbp_list))
2400+ if (!list_empty(&dum_hcd->urbp_list)) {
2401+ dum_hcd->timer_pending = 1;
23942402 hrtimer_start(&dum_hcd->timer, ns_to_ktime(0), HRTIMER_MODE_REL_SOFT);
2403+ }
23952404 hcd->state = HC_STATE_RUNNING;
23962405 }
23972406 spin_unlock_irq(&dum_hcd->dum->lock);
@@ -2522,6 +2531,7 @@ static void dummy_stop(struct usb_hcd *hcd) · 124 unmodified lines
25222531 struct dummy_hcd *dum_hcd = hcd_to_dummy_hcd(hcd);
25232532
25242533 hrtimer_cancel(&dum_hcd->timer);
2534+ dum_hcd->timer_pending = 0;
25252535 device_remove_file(dummy_dev(dum_hcd), &dev_attr_urbs);
25262536 dev_info(dummy_dev(dum_hcd), "stopped\n");
25272537 }
drivers/usb/host/xhci-dbgcap.h+1−0
@@ -110,6 +110,7 @@ struct dbc_port { · 109 unmodified lines
110110 struct tasklet_struct push;
111111
112112 struct list_head write_pool;
113+ unsigned int tx_boundary;
113114
114115 bool registered;
115116 };
drivers/usb/host/xhci-dbgtty.c+50−5
@@ -24,6 +24,29 @@ static inline struct dbc_port *dbc_to_port(struct xhci_dbc *dbc) · 23 unmodified lines
2424 return dbc->priv;
2525 }
2626
27+static unsigned int
28+dbc_kfifo_to_req(struct dbc_port *port, char *packet)
29+{
30+ unsigned int len;
31+
32+ len = kfifo_len(&port->port.xmit_fifo);
33+
34+ if (len == 0)
35+ return 0;
36+
37+ len = min(len, DBC_MAX_PACKET);
38+
39+ if (port->tx_boundary)
40+ len = min(port->tx_boundary, len);
41+
42+ len = kfifo_out(&port->port.xmit_fifo, packet, len);
43+
44+ if (port->tx_boundary)
45+ port->tx_boundary -= len;
46+
47+ return len;
48+}
49+
2750 static int dbc_start_tx(struct dbc_port *port)
2851 __releases(&port->port_lock)
2952 __acquires(&port->port_lock)
@@ -36,7 +59,7 @@ static int dbc_start_tx(struct dbc_port *port) · 6 unmodified lines
3659
3760 while (!list_empty(pool)) {
3861 req = list_entry(pool->next, struct dbc_request, list_pool);
39− len = kfifo_out(&port->port.xmit_fifo, req->buf, DBC_MAX_PACKET);
62+ len = dbc_kfifo_to_req(port, req->buf);
4063 if (len == 0)
4164 break;
4265 do_tty_wake = true;
@@ -200,14 +223,32 @@ static ssize_t dbc_tty_write(struct tty_struct *tty, const u8 *buf, · 157 unmodified lines
200223 {
201224 struct dbc_port *port = tty->driver_data;
202225 unsigned long flags;
226+ unsigned int written = 0;
203227
204228 spin_lock_irqsave(&port->port_lock, flags);
205− if (count)
206− count = kfifo_in(&port->port.xmit_fifo, buf, count);
207− dbc_start_tx(port);
229+
230+ /*
231+ * Treat tty write as one usb transfer. Make sure the writes are turned
232+ * into TRB request having the same size boundaries as the tty writes.
233+ * Don't add data to kfifo before previous write is turned into TRBs
234+ */
235+ if (port->tx_boundary) {
236+ spin_unlock_irqrestore(&port->port_lock, flags);
237+ return 0;
238+ }
239+
240+ if (count) {
241+ written = kfifo_in(&port->port.xmit_fifo, buf, count);
242+
243+ if (written == count)
244+ port->tx_boundary = kfifo_len(&port->port.xmit_fifo);
245+
246+ dbc_start_tx(port);
247+ }
248+
208249 spin_unlock_irqrestore(&port->port_lock, flags);
209250
210− return count;
251+ return written;
211252 }
212253
213254 static int dbc_tty_put_char(struct tty_struct *tty, u8 ch)
@@ -241,6 +282,10 @@ static unsigned int dbc_tty_write_room(struct tty_struct *tty) · 27 unmodified lines
241282
242283 spin_lock_irqsave(&port->port_lock, flags);
243284 room = kfifo_avail(&port->port.xmit_fifo);
285+
286+ if (port->tx_boundary)
287+ room = 0;
288+
244289 spin_unlock_irqrestore(&port->port_lock, flags);
245290
246291 return room;
drivers/usb/host/xhci-pci.c+9−2
@@ -79,6 +79,7 @@ · 78 unmodified lines
7979 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142
8080 #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242
8181 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142
82+#define PCI_DEVICE_ID_ASMEDIA_3042_XHCI 0x3042
8283 #define PCI_DEVICE_ID_ASMEDIA_3242_XHCI 0x3242
8384
8485 #define PCI_DEVICE_ID_CADENCE 0x17CD
@@ -451,6 +452,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 366 unmodified lines
451452 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
452453 xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
453454
455+ if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
456+ pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)
457+ xhci->quirks |= XHCI_RESET_ON_RESUME;
458+
454459 if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
455460 xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
456461
@@ -635,7 +640,7 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id) · 178 unmodified lines
635640 pm_runtime_put_noidle(&dev->dev);
636641
637642 if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0)
638− pm_runtime_forbid(&dev->dev);
643+ pm_runtime_get(&dev->dev);
639644 else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
640645 pm_runtime_allow(&dev->dev);
641646
@@ -678,7 +683,9 @@ void xhci_pci_remove(struct pci_dev *dev) · 36 unmodified lines
678683
679684 xhci->xhc_state |= XHCI_STATE_REMOVING;
680685
681− if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
686+ if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0)
687+ pm_runtime_put(&dev->dev);
688+ else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
682689 pm_runtime_forbid(&dev->dev);
683690
684691 if (xhci->shared_hcd) {
drivers/usb/host/xhci-ring.c+38−46
@@ -1023,7 +1023,7 @@ static int xhci_invalidate_cancelled_tds(struct xhci_virt_ep *ep) · 1022 unmodified lines
10231023 td_to_noop(xhci, ring, cached_td, false);
10241024 cached_td->cancel_status = TD_CLEARED;
10251025 }
1026−
1026+ td_to_noop(xhci, ring, td, false);
10271027 td->cancel_status = TD_CLEARING_CACHE;
10281028 cached_td = td;
10291029 break;
@@ -1718,6 +1718,14 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, · 688 unmodified lines
17181718
17191719 trace_xhci_handle_command(xhci->cmd_ring, &cmd_trb->generic);
17201720
1721+ cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status));
1722+
1723+ /* If CMD ring stopped we own the trbs between enqueue and dequeue */
1724+ if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) {
1725+ complete_all(&xhci->cmd_ring_stop_completion);
1726+ return;
1727+ }
1728+
17211729 cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg,
17221730 cmd_trb);
17231731 /*
@@ -1734,14 +1742,6 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, · 10 unmodified lines
17341742
17351743 cancel_delayed_work(&xhci->cmd_timer);
17361744
1737− cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status));
1738−
1739− /* If CMD ring stopped we own the trbs between enqueue and dequeue */
1740− if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) {
1741− complete_all(&xhci->cmd_ring_stop_completion);
1742− return;
1743− }
1744−
17451745 if (cmd->command_trb != xhci->cmd_ring->dequeue) {
17461746 xhci_err(xhci,
17471747 "Command completion event does not match command\n");
@@ -2775,6 +2775,29 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 1027 unmodified lines
27752775 return 0;
27762776 }
27772777
2778+ /*
2779+ * xhci 4.10.2 states isoc endpoints should continue
2780+ * processing the next TD if there was an error mid TD.
2781+ * So host like NEC don't generate an event for the last
2782+ * isoc TRB even if the IOC flag is set.
2783+ * xhci 4.9.1 states that if there are errors in mult-TRB
2784+ * TDs xHC should generate an error for that TRB, and if xHC
2785+ * proceeds to the next TD it should genete an event for
2786+ * any TRB with IOC flag on the way. Other host follow this.
2787+ *
2788+ * We wait for the final IOC event, but if we get an event
2789+ * anywhere outside this TD, just give it back already.
2790+ */
2791+ td = list_first_entry_or_null(&ep_ring->td_list, struct xhci_td, td_list);
2792+
2793+ if (td && td->error_mid_td && !trb_in_td(xhci, td, ep_trb_dma, false)) {
2794+ xhci_dbg(xhci, "Missing TD completion event after mid TD error\n");
2795+ ep_ring->dequeue = td->last_trb;
2796+ ep_ring->deq_seg = td->last_trb_seg;
2797+ inc_deq(xhci, ep_ring);
2798+ xhci_td_cleanup(xhci, td, ep_ring, td->status);
2799+ }
2800+
27782801 if (list_empty(&ep_ring->td_list)) {
27792802 /*
27802803 * Don't print wanings if ring is empty due to a stopped endpoint generating an
@@ -2836,44 +2859,13 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 55 unmodified lines
28362859 return 0;
28372860 }
28382861
2839− /*
2840− * xhci 4.10.2 states isoc endpoints should continue
2841− * processing the next TD if there was an error mid TD.
2842− * So host like NEC don't generate an event for the last
2843− * isoc TRB even if the IOC flag is set.
2844− * xhci 4.9.1 states that if there are errors in mult-TRB
2845− * TDs xHC should generate an error for that TRB, and if xHC
2846− * proceeds to the next TD it should genete an event for
2847− * any TRB with IOC flag on the way. Other host follow this.
2848− * So this event might be for the next TD.
2849− */
2850− if (td->error_mid_td &&
2851− !list_is_last(&td->td_list, &ep_ring->td_list)) {
2852− struct xhci_td *td_next = list_next_entry(td, td_list);
2853−
2854− ep_seg = trb_in_td(xhci, td_next, ep_trb_dma, false);
2855− if (ep_seg) {

30 more lines aren’t shown here.

drivers/usb/host/xhci-tegra.c+1−1

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

drivers/usb/host/xhci.h+1−1

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

drivers/usb/misc/Kconfig+12−0

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

drivers/usb/misc/onboard_usb_dev.c+4−2

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

drivers/usb/misc/yurex.c+9−12

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

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

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

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

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

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

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

drivers/usb/typec/class.c+7−2

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

drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c+6−4

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

drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c+0−1

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

drivers/usb/typec/tcpm/tcpm.c+7−3

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

drivers/vdpa/octeon_ep/octep_vdpa_hw.c+6−6

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

drivers/vhost/scsi.c+15−12

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

drivers/video/fbdev/Kconfig+1−14

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

drivers/video/fbdev/Makefile+0−1

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

drivers/video/fbdev/amifb.c+2−2

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

drivers/video/fbdev/arcfb.c+1−1

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

drivers/video/fbdev/atmel_lcdfb.c+1−1

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

drivers/video/fbdev/au1100fb.c+1−1

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

drivers/video/fbdev/au1200fb.c+1−1

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

drivers/video/fbdev/broadsheetfb.c+1−1

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

drivers/video/fbdev/bw2.c+2−2

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

drivers/video/fbdev/cg14.c+2−2

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

drivers/video/fbdev/cg3.c+2−2

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

drivers/video/fbdev/cg6.c+2−2

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

drivers/video/fbdev/clps711x-fb.c+1−1

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

drivers/video/fbdev/cobalt_lcdfb.c+1−1

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

drivers/video/fbdev/da8xx-fb.c+0−1665

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

drivers/video/fbdev/ep93xx-fb.c+1−1

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

drivers/video/fbdev/ffb.c+2−2

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

drivers/video/fbdev/fsl-diu-fb.c+3−3

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

drivers/video/fbdev/gbefb.c+3−3

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

drivers/video/fbdev/goldfishfb.c+1−1

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

drivers/video/fbdev/grvga.c+1−1

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

drivers/video/fbdev/hecubafb.c+1−1

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

drivers/video/fbdev/hgafb.c+1−1

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

drivers/video/fbdev/hitfb.c+1−1

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

drivers/video/fbdev/imxfb.c+1−1

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

drivers/video/fbdev/leo.c+2−2

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

drivers/video/fbdev/mb862xx/mb862xxfbdrv.c+1−1

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

drivers/video/fbdev/metronomefb.c+1−1

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

drivers/video/fbdev/nvidia/nv_hw.c+4−4

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

drivers/video/fbdev/ocfb.c+1−1

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

drivers/video/fbdev/offb.c+2−2

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

drivers/video/fbdev/omap/omapfb_main.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c+1−1

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

drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c+1−1

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

drivers/video/fbdev/omap2/omapfb/dss/core.c+3−3

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

drivers/video/fbdev/omap2/omapfb/dss/dispc.c+1−1

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

drivers/video/fbdev/omap2/omapfb/dss/dpi.c+2−2

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

drivers/video/fbdev/omap2/omapfb/dss/dsi.c+1−1

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

drivers/video/fbdev/omap2/omapfb/dss/dss.c+1−1

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

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c+3−3

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

drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c+1−1

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

drivers/video/fbdev/omap2/omapfb/dss/sdi.c+3−3

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

drivers/video/fbdev/omap2/omapfb/dss/venc.c+3−3

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

drivers/video/fbdev/omap2/omapfb/omapfb-main.c+1−1

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

drivers/video/fbdev/p9100.c+2−2

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

drivers/video/fbdev/platinumfb.c+1−1

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

drivers/video/fbdev/pxa168fb.c+1−1

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

drivers/video/fbdev/pxa3xx-gcu.c+4−4

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

drivers/video/fbdev/pxafb.c+1−1

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

drivers/video/fbdev/s1d13xxxfb.c+1−1

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

drivers/video/fbdev/s3c-fb.c+1−1

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

drivers/video/fbdev/sbuslib.c+1−1

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

drivers/video/fbdev/sbuslib.h+1−1

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

drivers/video/fbdev/sh7760fb.c+1−1

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

drivers/video/fbdev/sh_mobile_lcdcfb.c+1−1

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

drivers/video/fbdev/simplefb.c+1−1

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

drivers/video/fbdev/sm501fb.c+1−1

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

drivers/video/fbdev/sstfb.c+7−2

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

drivers/video/fbdev/tcx.c+2−2

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

drivers/video/fbdev/uvesafb.c+1−1

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

drivers/video/fbdev/vesafb.c+1−1

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

drivers/video/fbdev/vfb.c+1−1

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

drivers/video/fbdev/vga16fb.c+1−1

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

drivers/video/fbdev/via/via-gpio.c+1−1

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

drivers/video/fbdev/via/via_i2c.c+1−1

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

drivers/video/fbdev/vt8500lcdfb.c+1−1

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

drivers/video/fbdev/wm8505fb.c+1−1

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

drivers/video/fbdev/wmt_ge_rops.c+1−1

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

drivers/video/fbdev/xilinxfb.c+1−1

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

drivers/virtio/virtio_ring.c+1−1

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

drivers/xen/Kconfig+0−1

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

drivers/xen/acpi.c+24−0

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

drivers/xen/privcmd.c+2−4

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

drivers/xen/xen-pciback/pci_stub.c+9−2

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

fs/9p/fid.c+2−3

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

fs/9p/v9fs.h+27−7

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

fs/9p/v9fs_vfs.h+1−1

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

fs/9p/vfs_inode.c+82−47

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

fs/9p/vfs_inode_dotl.c+81−31

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

fs/9p/vfs_super.c+1−1

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

fs/Kconfig+1−1

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

fs/afs/dir.c+25−0

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

fs/afs/dir_edit.c+89−2

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

fs/afs/internal.h+4−0

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

fs/afs/rxrpc.c+59−24

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

fs/autofs/dev-ioctl.c+2−3

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

fs/backing-file.c+4−4

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

fs/bcachefs/alloc_background.c+31−16

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

fs/bcachefs/alloc_background.h+3−0

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

fs/bcachefs/alloc_foreground.c+17−4

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

fs/bcachefs/bcachefs.h+1−0

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

fs/bcachefs/bcachefs_format.h+2−1

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

fs/bcachefs/btree_gc.c+20−7

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

fs/bcachefs/btree_io.c+4−3

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

fs/bcachefs/btree_iter.c+16−3

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

fs/bcachefs/btree_iter.h+10−0

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

fs/bcachefs/btree_node_scan.c+3−0

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

fs/bcachefs/btree_update.c+2−2

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

fs/bcachefs/btree_update.h+1−1

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

fs/bcachefs/btree_update_interior.c+1−3

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

fs/bcachefs/buckets.c+5−2

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

fs/bcachefs/buckets.h+7−5

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

fs/bcachefs/chardev.c+1−0

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

fs/bcachefs/darray.c+14−1

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

fs/bcachefs/data_update.c+13−9

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

fs/bcachefs/data_update.h+2−1

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

fs/bcachefs/dirent.c+0−7

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

fs/bcachefs/dirent.h+7−0

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

fs/bcachefs/disk_accounting.c+118−37

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

fs/bcachefs/ec.c+75−37

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

fs/bcachefs/errcode.h+4−1

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

fs/bcachefs/error.c+4−1

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

fs/bcachefs/extents.c+70−16

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

fs/bcachefs/extents.h+14−1

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

fs/bcachefs/fs-io-buffered.c+6−0

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

fs/bcachefs/fs-io-direct.c+2−1

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

fs/bcachefs/fs-io-pagecache.c+45−25

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

fs/bcachefs/fs-io.c+14−5

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

fs/bcachefs/fs.c+112−22

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

fs/bcachefs/fs.h+3−6

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

fs/bcachefs/fsck.c+448−197

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

fs/bcachefs/fsck.h+1−0

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

fs/bcachefs/inode.c+257−45

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

fs/bcachefs/inode.h+11−0

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

fs/bcachefs/inode_format.h+5−4

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

fs/bcachefs/io_misc.c+1−1

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

fs/bcachefs/io_read.c+4−4

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

fs/bcachefs/io_write.c+2−2

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

fs/bcachefs/journal.c+19−4

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

fs/bcachefs/journal.h+1−1

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

fs/bcachefs/move.c+1−1

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

fs/bcachefs/opts.c+8−2

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

fs/bcachefs/opts.h+2−1

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

fs/bcachefs/quota.c+1−1

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

fs/bcachefs/rebalance.c+3−1

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

fs/bcachefs/recovery.c+14−5

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

fs/bcachefs/recovery_passes_types.h+1−0

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

fs/bcachefs/replicas.c+31−8

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

fs/bcachefs/sb-downgrade.c+7−1

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

fs/bcachefs/sb-errors_format.h+7−3

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

fs/bcachefs/sb-members.c+9−1

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

fs/bcachefs/snapshot.c+30−99

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

fs/bcachefs/snapshot.h+0−3

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

fs/bcachefs/str_hash.h+42−18

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

fs/bcachefs/subvolume.c+3−4

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

fs/bcachefs/super-io.c+5−0

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

fs/bcachefs/super.c+25−11

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

fs/bcachefs/tests.c+2−2

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

fs/bcachefs/xattr.c+1−1

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

fs/btrfs/bio.c+13−24

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

fs/btrfs/bio.h+3−0

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

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

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

fs/btrfs/defrag.c+5−5

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

fs/btrfs/delayed-ref.c+40−15

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

fs/btrfs/delayed-ref.h+9−1

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

fs/btrfs/dir-item.c+2−2

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

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

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

fs/btrfs/extent-tree.c+21−5

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

fs/btrfs/extent_io.c+16−15

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

fs/btrfs/extent_map.c+22−16

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

fs/btrfs/free-space-cache.c+2−2

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

fs/btrfs/free-space-cache.h+6−0

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

fs/btrfs/inode.c+2−5

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

fs/btrfs/qgroup.c+17−6

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

fs/btrfs/qgroup.h+2−0

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

fs/btrfs/send.c+1−3

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

fs/btrfs/super.c+10−2

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

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

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

fs/btrfs/volumes.c+1−0

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

fs/btrfs/volumes.h+6−0

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

fs/btrfs/zoned.c+1−1

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

fs/dax.c+28−17

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

fs/erofs/super.c+13−4

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

fs/erofs/zdata.c+9−20

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

fs/erofs/zmap.c+12−20

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

fs/f2fs/file.c+2−1

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

fs/fat/namei_vfat.c+1−1

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

fs/fuse/file.c+12−6

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

fs/fuse/passthrough.c+4−5

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

fs/inode.c+6−4

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

fs/iomap/buffered-io.c+37−91

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

fs/jfs/jfs_dmap.c+1−1

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

fs/namespace.c+3−1

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

fs/netfs/buffered_read.c+14−33

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

fs/netfs/locking.c+2−1

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

fs/netfs/read_collect.c+2−0

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

fs/nfs/callback_xdr.c+2−0

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

fs/nfs/client.c+1−0

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

fs/nfs/delegation.c+5−0

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

fs/nfs/localio.c+3−4

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

fs/nfs/nfs42proc.c+1−1

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

fs/nfs/nfs4state.c+1−1

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

fs/nfs_common/nfslocalio.c+4−1

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

fs/nfsd/filecache.c+4−2

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

fs/nfsd/localio.c+1−1

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

fs/nfsd/nfs4proc.c+3−5

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

fs/nfsd/nfs4state.c+42−9

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

fs/nfsd/nfssvc.c+5−5

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

fs/nfsd/state.h+2−0

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

fs/nfsd/trace.h+3−3

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

fs/nilfs2/dir.c+25−23

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

fs/nilfs2/namei.c+29−13

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

fs/nilfs2/nilfs.h+1−1

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

fs/nilfs2/page.c+5−2

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

fs/ntfs3/attrib.c+86−10

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

fs/ntfs3/attrlist.c+0−53

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

fs/ntfs3/file.c+138−47

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

fs/ntfs3/frecord.c+83−14

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

fs/ntfs3/fslog.c+17−2

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

fs/ntfs3/inode.c+14−6

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

fs/ntfs3/lib/lzx_decompress.c+1−2

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

fs/ntfs3/lznt.c+3−0

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

fs/ntfs3/namei.c+5−5

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

fs/ntfs3/ntfs_fs.h+5−5

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

fs/ntfs3/record.c+15−16

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

fs/ntfs3/run.c+5−3

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

fs/ntfs3/super.c+37−33

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

fs/ntfs3/xattr.c+1−1

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

fs/ocfs2/file.c+14−3

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

fs/open.c+2−0

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

fs/overlayfs/file.c+7−2

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

fs/proc/fd.c+1−1

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

fs/proc/kcore.c+34−2

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

fs/proc/task_mmu.c+10−6

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

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

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

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

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

fs/smb/client/cifsproto.h+0−9

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

fs/smb/client/compress.c+0−4

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

fs/smb/client/connect.c+0−12

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

fs/smb/client/fs_context.c+7−0

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

fs/smb/client/reparse.c+161−3

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

fs/smb/client/sess.c+0−32

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

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

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

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

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

fs/smb/client/smb2pdu.c+9−0

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

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

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

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

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

fs/smb/server/ksmbd_netlink.h+17−0

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

fs/smb/server/mgmt/user_config.c+37−8

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

fs/smb/server/mgmt/user_config.h+4−1

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

fs/smb/server/mgmt/user_session.c+21−5

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

fs/smb/server/mgmt/user_session.h+4−0

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

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

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

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

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

fs/smb/server/smb_common.c+12−3

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

fs/smb/server/transport_ipc.c+60−4

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

fs/smb/server/transport_ipc.h+2−0

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

fs/squashfs/file_direct.c+5−4

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

fs/super.c+20−6

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

fs/unicode/mkutf8data.c+0−70

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

fs/unicode/utf8data.c_shipped+3346−3357

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

fs/userfaultfd.c+28−0

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

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

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

fs/xfs/libxfs/xfs_ag.h+6−5

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

fs/xfs/libxfs/xfs_alloc.c+3−6

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

fs/xfs/libxfs/xfs_alloc.h+1−3

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

fs/xfs/libxfs/xfs_attr.c+81−109

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

fs/xfs/libxfs/xfs_attr_leaf.c+22−18

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

fs/xfs/libxfs/xfs_attr_leaf.h+1−1

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

fs/xfs/libxfs/xfs_bmap.c+44−96

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

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

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

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

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

fs/xfs/scrub/ialloc_repair.c+2−2

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

fs/xfs/scrub/repair.c+5−3

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

fs/xfs/xfs_aops.c+2−2

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

fs/xfs/xfs_bmap_util.c+7−3

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

fs/xfs/xfs_bmap_util.h+1−1

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

fs/xfs/xfs_buf_item_recover.c+70−0

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

fs/xfs/xfs_file.c+88−58

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

fs/xfs/xfs_filestream.c+48−51

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

fs/xfs/xfs_fsops.c+9−11

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

fs/xfs/xfs_icache.c+23−14

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

fs/xfs/xfs_inode.c+1−1

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

fs/xfs/xfs_inode.h+5−0

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

fs/xfs/xfs_ioctl.c+2−2

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

fs/xfs/xfs_iomap.c+47−22

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

fs/xfs/xfs_log.h+0−2

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

fs/xfs/xfs_log_cil.c+4−7

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

fs/xfs/xfs_log_recover.c+1−8

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

fs/xfs/xfs_mount.c+4−5

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

fs/xfs/xfs_reflink.c+3−0

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

fs/xfs/xfs_reflink.h+19−0

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

fs/xfs/xfs_trace.h+5−10

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

include/acpi/cppc_acpi.h+1−1

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

include/drm/drm_kunit_helpers.h+4−0

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

include/linux/alloc_tag.h+10−6

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

include/linux/backing-file.h+1−1

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

include/linux/bpf.h+11−3

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

include/linux/bpf_mem_alloc.h+3−0

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

include/linux/bpf_types.h+1−0

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

include/linux/closure.h+35−0

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

include/linux/compiler-gcc.h+4−0

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

include/linux/device.h+3−0

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

include/linux/fs.h+6−1

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

include/linux/fs_context.h+6−0

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

include/linux/fsl/enetc_mdio.h+2−1

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

include/linux/huge_mm.h+18−0

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

include/linux/input.h+9−1

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

include/linux/iomap.h+36−3

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

include/linux/irqchip/arm-gic-v4.h+3−1

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

include/linux/ksm.h+4−6

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

include/linux/kvm_host.h+0−2

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

include/linux/mm.h+2−1

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

include/linux/mmzone.h+3−4

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

include/linux/netdevice.h+12−0

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

include/linux/nfs_fs_sb.h+1−0

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

include/linux/nfslocalio.h+15−0

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

include/linux/page-flags.h+8−0

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

include/linux/percpu.h+5−1

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

include/linux/sched.h+7−2

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

include/linux/sched/mm.h+4−13

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

include/linux/security.h+2−2

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

include/linux/soc/qcom/geni-se.h+1−1

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

include/linux/soundwire/sdw_intel.h+1−1

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

include/linux/swap.h+1−0

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

include/linux/task_work.h+4−1

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

include/linux/tick.h+8−0

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

include/linux/uaccess.h+15−6

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

include/linux/userfaultfd_k.h+5−0

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

include/net/bluetooth/bluetooth.h+1−0

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

include/net/cfg80211.h+44−0

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

include/net/genetlink.h+1−2

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

include/net/ieee80211_radiotap.h+24−19

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

include/net/ip_tunnels.h+1−1

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

include/net/mctp.h+1−1

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

include/net/netns/xfrm.h+0−1

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

include/net/rtnetlink.h+17−0

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

include/net/sch_generic.h+0−1

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

include/net/sock.h+7−0

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

include/net/xfrm.h+15−13

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

include/trace/events/afs.h+6−1

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

include/trace/events/dma.h+8−8

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

include/trace/events/huge_memory.h+2−2

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

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

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

include/uapi/linux/bpf.h+8−8

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

include/uapi/linux/ublk_cmd.h+7−1

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

include/uapi/sound/asoc.h+1−1

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

include/video/da8xx-fb.h+0−94

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

include/xen/acpi.h+9−5

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

init/Kconfig+6−2

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

io_uring/io_uring.h+9−1

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

io_uring/rsrc.c+2−1

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

io_uring/rw.c+45−22

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

kernel/bpf/bpf_lsm.c+0−4

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

kernel/bpf/btf.c+11−4

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

kernel/bpf/cgroup.c+18−1

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

kernel/bpf/devmap.c+7−4

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

kernel/bpf/helpers.c+49−15

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

kernel/bpf/inode.c+3−2

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

kernel/bpf/log.c+1−2

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

kernel/bpf/lpm_trie.c+1−1

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

kernel/bpf/memalloc.c+13−1

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

kernel/bpf/ringbuf.c+7−7

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

kernel/bpf/syscall.c+32−13

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

kernel/bpf/task_iter.c+1−1

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

kernel/bpf/verifier.c+68−66

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

kernel/cgroup/cgroup.c+2−2

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

kernel/events/core.c+2−2

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

kernel/fork.c+8−6

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

kernel/freezer.c+6−1

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

kernel/irq/msi.c+1−1

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

kernel/kthread.c+2−0

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

kernel/rcu/tasks.h+9−0

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

kernel/rcu/tree_nocb.h+7−1

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

kernel/resource.c+1−3

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

kernel/resource_kunit.c+14−4

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

kernel/sched/core.c+54−30

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

kernel/sched/deadline.c+1−1

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

kernel/sched/ext.c+152−113

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

kernel/sched/ext.h+1−1

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

kernel/sched/fair.c+23−29

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

kernel/sched/sched.h+36−3

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

kernel/sched/stats.h+33−15

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

kernel/sched/syscalls.c+9−4

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

kernel/task_work.c+13−2

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

kernel/time/posix-clock.c+3−0

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

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

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

kernel/trace/bpf_trace.c+19−23

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

kernel/trace/fgraph.c+26−15

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

kernel/trace/ring_buffer.c+32−21

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

kernel/trace/trace.c+3−3

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

kernel/trace/trace_eprobe.c+6−1

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

kernel/trace/trace_fprobe.c+5−1

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

kernel/trace/trace_kprobe.c+5−1

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

kernel/trace/trace_probe.c+1−1

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

kernel/trace/trace_selftest.c+1−1

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

kernel/trace/trace_uprobe.c+9−4

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

lib/Kconfig.debug+1−1

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

lib/buildid.c+5−0

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

lib/codetag.c+3−0

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

lib/crypto/mpi/mpi-mul.c+1−1

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

lib/iov_iter.c+15−10

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

lib/maple_tree.c+7−7

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

lib/objpool.c+1−1

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

lib/slub_kunit.c+1−1

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

mm/Kconfig+0−1

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

mm/damon/tests/sysfs-kunit.h+1−0

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

mm/gup.c+19−14

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

mm/huge_memory.c+2−13

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

mm/kasan/init.c+7−1

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

mm/kasan/kasan_test_c.c+0−27

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

mm/khugepaged.c+3−3

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

mm/memory.c+24−8

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

mm/migrate.c+3−2

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

mm/mmap.c+84−35

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

mm/mremap.c+9−2

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

mm/numa_memblks.c+1−1

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

mm/page_alloc.c+5−5

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

mm/page_io.c+2−2

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

mm/pagewalk.c+11−5

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

mm/rmap.c+3−6

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

mm/secretmem.c+2−2

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

mm/shmem.c+3−6

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

mm/shrinker.c+5−3

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

mm/slab_common.c+1−1

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

mm/sparse-vmemmap.c+5−0

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

mm/swapfile.c+35−23

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

mm/vma.c+15−8

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

mm/vma.h+17−9

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

mm/vmscan.c+56−50

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

mm/zswap.c+0−1

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

net/9p/Kconfig+2−0

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

net/9p/client.c+11−1

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

net/bluetooth/af_bluetooth.c+25−0

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

net/bluetooth/bnep/core.c+1−2

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

net/bluetooth/hci_conn.c+3−0

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

net/bluetooth/hci_core.c+15−9

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

net/bluetooth/hci_sync.c+20−10

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

net/bluetooth/iso.c+13−11

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

net/bluetooth/rfcomm/sock.c+0−2

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

net/bluetooth/sco.c+12−6

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

net/bpf/test_run.c+1−0

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

net/bridge/br_netfilter_hooks.c+5−0

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

net/bridge/br_netlink.c+5−1

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

net/bridge/br_private.h+3−2

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

net/bridge/br_vlan.c+9−10

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

net/core/dev.c+4−0

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

net/core/dst.c+12−5

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

net/core/filter.c+20−30

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

net/core/rtnetlink.c+31−2

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

net/core/sock_map.c+12−0

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

net/dsa/user.c+8−3

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

net/ipv4/devinet.c+25−10

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

net/ipv4/inet_connection_sock.c+16−5

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

net/ipv4/ip_tunnel.c+1−1

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

net/ipv4/netfilter/nft_fib_ipv4.c+1−3

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

net/ipv4/tcp_bpf.c+4−3

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

net/ipv4/tcp_input.c+38−4

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

net/ipv4/tcp_output.c+1−4

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

net/ipv4/udp.c+3−1

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

net/ipv4/xfrm4_policy.c+18−22

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

net/ipv6/netfilter/nf_reject_ipv6.c+7−8

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

net/ipv6/netfilter/nft_fib_ipv6.c+3−2

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

net/ipv6/udp.c+3−1

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

net/ipv6/xfrm6_policy.c+16−15

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

net/l2tp/l2tp_netlink.c+2−2

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

net/mac80211/Kconfig+1−1

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

net/mac80211/cfg.c+16−9

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

net/mac80211/ieee80211_i.h+6−4

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

net/mac80211/key.c+25−17

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

net/mac80211/link.c+4−3

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

net/mac80211/main.c+2−0

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

net/mctp/af_mctp.c+5−1

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

net/mctp/device.c+18−12

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

net/mctp/neigh.c+19−12

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

net/mctp/route.c+23−10

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

net/mpls/af_mpls.c+21−11

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

net/mptcp/mib.c+3−0

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

net/mptcp/mib.h+3−0

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

net/mptcp/pm_netlink.c+4−2

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

net/mptcp/protocol.c+23−3

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

net/mptcp/protocol.h+1−0

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

net/mptcp/subflow.c+15−2

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

net/netfilter/nf_bpf_link.c+6−1

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

net/netfilter/nft_payload.c+3−0

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

net/netfilter/x_tables.c+1−1

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

net/netfilter/xt_CHECKSUM.c+23−10

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

net/netfilter/xt_CLASSIFY.c+14−2

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

net/netfilter/xt_CONNSECMARK.c+25−11

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

net/netfilter/xt_CT.c+69−37

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

net/netfilter/xt_IDLETIMER.c+40−19

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

net/netfilter/xt_LED.c+27−12

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

net/netfilter/xt_NFLOG.c+25−11

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

net/netfilter/xt_RATEEST.c+27−12

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

net/netfilter/xt_SECMARK.c+25−2

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

net/netfilter/xt_TRACE.c+25−11

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

net/netfilter/xt_addrtype.c+13−2

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

net/netfilter/xt_cluster.c+23−10

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

net/netfilter/xt_connbytes.c+3−1

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

net/netfilter/xt_connlimit.c+27−12

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

net/netfilter/xt_connmark.c+25−3

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

net/netfilter/xt_mark.c+32−10

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

net/netlink/af_netlink.c+2−1

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

net/netlink/genetlink.c+14−14

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

net/phonet/pn_netlink.c+11−17

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

net/rxrpc/ar-internal.h+1−1

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

net/rxrpc/io_thread.c+8−2

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

net/rxrpc/local_object.c+1−1

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

net/rxrpc/sendmsg.c+5−5

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

net/sched/act_api.c+22−1

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

net/sched/cls_api.c+1−0

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

net/sched/sch_api.c+7−2

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

net/sched/sch_generic.c+7−1

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

net/sched/sch_taprio.c+14−7

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

net/sctp/socket.c+13−5

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

net/smc/smc_inet.c+11−0

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

net/smc/smc_pnet.c+1−1

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

net/smc/smc_wr.c+5−1

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

net/socket.c+6−1

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

net/sunrpc/svc.c+4−7

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

net/sunrpc/xprtrdma/ib_client.c+1−0

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

net/vmw_vsock/virtio_transport.c+4−4

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

net/vmw_vsock/virtio_transport_common.c+12−2

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

net/vmw_vsock/vsock_bpf.c+0−8

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

net/wireless/core.c+8−0

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

net/wireless/nl80211.c+2−6

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

net/wireless/scan.c+4−0

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

net/xfrm/xfrm_device.c+8−3

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

net/xfrm/xfrm_policy.c+38−15

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

net/xfrm/xfrm_user.c+8−2

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

rust/kernel/device.rs+3−12

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

rust/kernel/firmware.rs+1−1

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

scripts/Kconfig.include+3−0

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

scripts/Makefile.compiler+7−7

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

scripts/Makefile.package+6−1

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

scripts/kconfig/menu.c+12−1

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

scripts/mod/file2alias.c+6−6

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

scripts/mod/sumversion.c+3−2

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

scripts/package/builddeb+1−1

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

scripts/package/install-extmod-build+2−4

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

scripts/package/mkdebian+9−1

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

scripts/rustc-llvm-version.sh+22−0

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

security/ipe/Kconfig+19−0

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

security/ipe/policy.c+15−3

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

security/security.c+6−4

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

sound/Kconfig+1−1

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

sound/firewire/amdtp-stream.c+3−0

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

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

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

sound/hda/intel-sdw-acpi.c+22−11

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

sound/pci/hda/Kconfig+1−1

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

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

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

sound/pci/hda/patch_cs8409.c+3−2

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

sound/pci/hda/patch_realtek.c+137−25

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

sound/soc/amd/yc/acp6x-mach.c+14−0

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

sound/soc/codecs/aw88399.c+1−1

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

sound/soc/codecs/cs42l51.c+5−2

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

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

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

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

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

sound/soc/codecs/pcm3060-i2c.c+2−2

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

sound/soc/codecs/pcm3060-spi.c+2−2

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

sound/soc/codecs/pcm3060.c+2−2

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

sound/soc/codecs/pcm3060.h+1−1

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

sound/soc/codecs/rt5640.c+15−12

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

sound/soc/codecs/rt722-sdca-sdw.c+1−1

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

sound/soc/codecs/wcd937x.c+10−2

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

sound/soc/codecs/wcd937x.h+4−0

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

sound/soc/fsl/fsl_esai.c+2−2

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

sound/soc/fsl/fsl_micfil.c+80−1

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

sound/soc/intel/atom/sst/sst_acpi.c+55−9

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

sound/soc/intel/avs/core.c+2−1

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

sound/soc/intel/avs/pcm.c+19−0

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

sound/soc/intel/avs/pcm.h+16−0

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

sound/soc/intel/boards/bytcr_rt5640.c+45−3

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

sound/soc/intel/common/soc-acpi-intel-lnl-match.c+38−0

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

sound/soc/loongson/loongson_card.c+1−0

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

sound/soc/qcom/Kconfig+2−0

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

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

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

sound/soc/qcom/sc7280.c+9−1

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

sound/soc/qcom/sdm845.c+6−1

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

sound/soc/sh/rcar/core.c+5−2

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

sound/soc/soc-dapm.c+4−2

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

sound/soc/sof/amd/acp-loader.c+4−1

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

sound/soc/sof/amd/acp.c+3−1

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

sound/soc/sof/intel/hda-dai-ops.c+10−13

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

sound/soc/sof/intel/hda-dai.c+33−4

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

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

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

sound/soc/sof/ipc4-topology.c+13−2

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

sound/usb/line6/capture.c+1−1

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

sound/usb/line6/capture.h+1−1

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

sound/usb/line6/driver.c+2−2

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

sound/usb/line6/driver.h+1−1

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

sound/usb/line6/midi.c+1−1

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

sound/usb/line6/midi.h+1−1

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

sound/usb/line6/midibuf.c+1−1

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

sound/usb/line6/midibuf.h+1−1

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

sound/usb/line6/pcm.c+1−1

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

sound/usb/line6/pcm.h+1−1

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

sound/usb/line6/playback.c+1−1

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

sound/usb/line6/playback.h+1−1

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

sound/usb/line6/pod.c+1−1

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

sound/usb/line6/toneport.c+1−1

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

sound/usb/line6/variax.c+1−1

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

sound/usb/mixer_quirks.c+3−0

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

sound/usb/mixer_scarlett2.c+2−0

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

sound/usb/stream.c+1−0

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

tools/arch/arm64/include/asm/cputype.h+4−0

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

tools/arch/arm64/vdso+0−1

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

tools/arch/loongarch/vdso+0−1

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

tools/arch/powerpc/vdso+0−1

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

tools/arch/s390/vdso+0−1

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

tools/arch/x86/include/asm/msr-index.h+22−14

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

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

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

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

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

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

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

tools/arch/x86/vdso+0−1

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

tools/build/feature/Makefile+4−1

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

tools/include/linux/bits.h+15−0

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

tools/include/linux/unaligned.h+1−10

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

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

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

tools/include/uapi/linux/bpf.h+13−12

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

tools/include/uapi/linux/const.h+17−0

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

tools/include/uapi/linux/in.h+1−1

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

tools/include/vdso/unaligned.h+15−0

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

tools/mm/page-types.c+5−4

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

tools/mm/slabinfo.c+3−1

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

tools/perf/Makefile.config+7−4

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

tools/perf/builtin-trace.c+1−1

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

tools/perf/check-header_ignore_hunks/lib/list_sort.c+31−0

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

tools/perf/check-headers.sh+29−1

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

tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh+54−15

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

tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h+2−2

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

tools/perf/trace/beauty/fs_at_flags.sh+5−0

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

tools/perf/trace/beauty/include/linux/socket.h+1−0

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

tools/perf/trace/beauty/include/uapi/linux/fcntl.h+60−24

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

tools/perf/trace/beauty/include/uapi/linux/sched.h+1−0

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

tools/perf/trace/beauty/include/uapi/sound/asound.h+16−1

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

tools/perf/trace/beauty/msg_flags.c+4−0

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

tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c+20−2

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

tools/perf/util/cap.c+3−7

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

tools/perf/util/cs-etm.c+1−1

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

tools/perf/util/dwarf-aux.h+1−0

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

tools/perf/util/python.c+3−0

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

tools/perf/util/symbol.c+3−0

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

tools/perf/util/syscalltbl.c+10−0

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

tools/perf/util/vdso.c+3−1

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

tools/sched_ext/include/scx/common.bpf.h+4−4

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

tools/sched_ext/scx_qmap.bpf.c+2−2

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

tools/testing/cxl/test/cxl.c+108−92

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

tools/testing/cxl/test/mem.c+1−0

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

tools/testing/radix-tree/maple.c+110−0

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

tools/testing/selftests/Makefile+5−4

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

tools/testing/selftests/bpf/Makefile+20−2

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

tools/testing/selftests/bpf/bpf_test_modorder_x/Makefile+19−0

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

tools/testing/selftests/bpf/bpf_test_modorder_x/bpf_test_modorder_x.c+39−0

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

tools/testing/selftests/bpf/bpf_test_modorder_y/Makefile+19−0

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

tools/testing/selftests/bpf/bpf_test_modorder_y/bpf_test_modorder_y.c+39−0

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

tools/testing/selftests/bpf/map_tests/lpm_trie_map_get_next_key.c+109−0

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

tools/testing/selftests/bpf/prog_tests/bpf_iter.c+22−5

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

tools/testing/selftests/bpf/prog_tests/cgroup_ancestor.c+1−1

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

tools/testing/selftests/bpf/prog_tests/cpumask.c+1−0

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

tools/testing/selftests/bpf/prog_tests/fill_link_info.c+15−3

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

tools/testing/selftests/bpf/prog_tests/kfunc_module_order.c+55−0

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

tools/testing/selftests/bpf/prog_tests/netfilter_link_attach.c+40−2

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

tools/testing/selftests/bpf/prog_tests/verifier.c+21−0

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

tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c+117−8

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

tools/testing/selftests/bpf/progs/cpumask_common.h+5−0

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

tools/testing/selftests/bpf/progs/cpumask_failure.c+35−0

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

tools/testing/selftests/bpf/progs/cpumask_success.c+76−2

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

tools/testing/selftests/bpf/progs/kfunc_module_order.c+30−0

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

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

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

tools/testing/selftests/bpf/progs/verifier_bits_iter.c+58−3

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

tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c+0−55

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

tools/testing/selftests/bpf/progs/verifier_const.c+30−1

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

tools/testing/selftests/bpf/progs/verifier_linked_scalars.c+34−0

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

tools/testing/selftests/bpf/progs/verifier_movsx.c+40−0

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

tools/testing/selftests/bpf/progs/verifier_mtu.c+18−0

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

tools/testing/selftests/bpf/progs/verifier_scalar_ids.c+67−0

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

tools/testing/selftests/bpf/progs/verifier_search_pruning.c+23−0

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

tools/testing/selftests/bpf/testing_helpers.c+22−12

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

tools/testing/selftests/bpf/testing_helpers.h+2−0

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

tools/testing/selftests/bpf/veristat.cfg+1−0

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

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-profiler.tc+31−0

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

tools/testing/selftests/hid/Makefile+1−0

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

tools/testing/selftests/intel_pstate/run.sh+7−2

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

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

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

tools/testing/selftests/kvm/aarch64/set_id_regs.c+13−3

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

tools/testing/selftests/kvm/x86_64/cpuid_test.c+1−1

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

tools/testing/selftests/mm/hmm-tests.c+1−1

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

tools/testing/selftests/mm/khugepaged.c+1−1

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

tools/testing/selftests/mm/uffd-unit-tests.c+5−0

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

tools/testing/selftests/mount_setattr/mount_setattr_test.c+9−0

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

tools/testing/selftests/net/.gitignore+1−0

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

tools/testing/selftests/net/forwarding/ip6gre_flat.sh+14−0

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

tools/testing/selftests/net/forwarding/ip6gre_flat_key.sh+14−0

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

tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh+14−0

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

tools/testing/selftests/net/forwarding/ip6gre_hier.sh+14−0

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

tools/testing/selftests/net/forwarding/ip6gre_hier_key.sh+14−0

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

tools/testing/selftests/net/forwarding/ip6gre_hier_keys.sh+14−0

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

tools/testing/selftests/net/forwarding/ip6gre_lib.sh+80−0

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

tools/testing/selftests/net/forwarding/no_forwarding.sh+1−1

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

tools/testing/selftests/net/lib/py/nsim.py+1−0

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

tools/testing/selftests/net/mptcp/mptcp_connect.sh+9−0

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

tools/testing/selftests/net/mptcp/mptcp_join.sh+85−30

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

tools/testing/selftests/net/netfilter/Makefile+1−0

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

tools/testing/selftests/net/netfilter/config+2−0

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

tools/testing/selftests/net/netfilter/conntrack_dump_flush.c+3−3

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

tools/testing/selftests/net/netfilter/conntrack_vrf.sh+33−0

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

tools/testing/selftests/net/netfilter/nft_flowtable.sh+21−18

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

tools/testing/selftests/net/netfilter/vxlan_mtu_frag.sh+121−0

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

tools/testing/selftests/net/rds/.gitignore+1−0

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

tools/testing/selftests/net/rds/Makefile+1−1

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

tools/testing/selftests/net/rds/test.py+4−1

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

tools/testing/selftests/net/ynl.mk+4−0

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

tools/testing/selftests/rseq/rseq.c+75−35

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

tools/testing/selftests/rseq/rseq.h+2−8

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

tools/testing/selftests/sched_ext/Makefile+33−40

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

tools/testing/selftests/sched_ext/create_dsq.bpf.c+3−3

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

tools/testing/selftests/sched_ext/ddsp_bogus_dsq_fail.bpf.c+2−2

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

tools/testing/selftests/sched_ext/ddsp_vtimelocal_fail.bpf.c+2−2

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

tools/testing/selftests/sched_ext/dsp_local_on.bpf.c+4−4

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

tools/testing/selftests/sched_ext/enq_last_no_enq_fails.bpf.c+8−0

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

tools/testing/selftests/sched_ext/enq_last_no_enq_fails.c+7−3

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

tools/testing/selftests/sched_ext/enq_select_cpu_fails.bpf.c+2−2

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

tools/testing/selftests/sched_ext/exit.bpf.c+12−10

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

tools/testing/selftests/sched_ext/hotplug.bpf.c+4−4

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

tools/testing/selftests/sched_ext/init_enable_count.bpf.c+4−4

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

tools/testing/selftests/sched_ext/maximal.bpf.c+29−29

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

tools/testing/selftests/sched_ext/maybe_null.bpf.c+3−3

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

tools/testing/selftests/sched_ext/maybe_null_fail_dsp.bpf.c+2−2

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

tools/testing/selftests/sched_ext/maybe_null_fail_yld.bpf.c+2−2

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

tools/testing/selftests/sched_ext/prog_run.bpf.c+1−1

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

tools/testing/selftests/sched_ext/select_cpu_dfl.bpf.c+1−1

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

tools/testing/selftests/sched_ext/select_cpu_dfl_nodispatch.bpf.c+3−3

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

tools/testing/selftests/sched_ext/select_cpu_dispatch.bpf.c+1−1

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

tools/testing/selftests/sched_ext/select_cpu_dispatch_bad_dsq.bpf.c+2−2

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

tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf.c+2−2

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

tools/testing/selftests/sched_ext/select_cpu_vtime.bpf.c+6−6

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

tools/testing/selftests/vDSO/Makefile+2−4

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

tools/testing/selftests/vDSO/vdso_test_chacha.c+21−15

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

tools/testing/selftests/vDSO/vdso_test_getrandom.c+34−42

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

tools/testing/selftests/vDSO/vgetrandom-chacha.S+18−0

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

tools/testing/selftests/watchdog/watchdog-test.c+6−0

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

tools/testing/vma/vma.c+40−0

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

tools/usb/usbip/src/usbip_detach.c+1−0

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

virt/kvm/kvm_main.c+1−13

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