History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Cross-merge bpf fixes after downstream PR. No conflicts. Adjacent changes in: include/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/btf.c kernel/bpf/helpers.c kernel/bpf/syscall.c kernel/bpf/verifier.c kernel/trace/bpf_trace.c mm/slab_common.c tools/include/uapi/linux/bpf.h tools/testing/selftests/bpf/Makefile

Alexei Starovoitov committed 2 years ago

Commit bfa7b5c2 parents c6fb803 ae90f6a1167 files · +15425 −10300Browse files

Unified · Split

1167 files
  1. .mailmap +11 −0
  2. CREDITS +27 −27
  3. Documentation/admin-guide/LSM/ipe.rst +5 −2
  4. Documentation/arch/arm64/silicon-errata.rst +6 −0
  5. Documentation/core-api/protection-keys.rst +30 −8
  6. Documentation/devicetree/bindings/display/elgin,jg10309-01.yaml +54 −0
  7. Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml +17 −36
  8. Documentation/devicetree/bindings/iio/dac/adi,ad5696.yaml +2 −1
  9. Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml +23 −3
  10. Documentation/devicetree/bindings/misc/fsl,qoriq-mc.yaml +1 −1
  11. Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml +1 −0
  12. Documentation/devicetree/bindings/sound/davinci-mcasp-audio.yaml +1 −1
  13. Documentation/devicetree/bindings/sound/qcom,sm8250.yaml +1 −0
  14. Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 −1
  15. Documentation/devicetree/bindings/trivial-devices.yaml +0 −2
  16. Documentation/driver-api/wmi.rst +5 −6
  17. Documentation/filesystems/iomap/operations.rst +1 −1
  18. Documentation/filesystems/netfs_library.rst +0 −1
  19. Documentation/gpu/drm-kms-helpers.rst +2 −2
  20. Documentation/mm/damon/maintainer-profile.rst +19 −19
  21. Documentation/networking/tcp_ao.rst +10 −10
  22. Documentation/process/maintainer-netdev.rst +17 −0
  23. Documentation/process/maintainer-soc.rst +37 −5
  24. Documentation/scheduler/sched-ext.rst +1 −1
  25. Documentation/virt/kvm/api.rst +9 −7
  26. Documentation/virt/kvm/locking.rst +1 −1
  27. Documentation/wmi/devices/dell-wmi-ddv.rst +2 −2
  28. MAINTAINERS +101 −239
  29. Makefile +2 −2
  30. arch/Kconfig +12 −14
  31. arch/arm/boot/dts/broadcom/bcm2837-rpi-cm3-io3.dts +1 −1
  32. arch/arm64/Kconfig +4 −3
  33. arch/arm64/Makefile +1 −1
  34. arch/arm64/boot/dts/marvell/cn9130-sr-som.dtsi +1 −1
  35. arch/arm64/include/asm/cputype.h +2 −0
  36. arch/arm64/include/asm/kvm_asm.h +1 −0
  37. arch/arm64/include/asm/kvm_host.h +20 −12
  38. arch/arm64/include/asm/kvm_mmu.h +2 −1
  39. arch/arm64/include/asm/kvm_nested.h +3 −1
  40. arch/arm64/include/asm/uprobes.h +3 −5
  41. arch/arm64/kernel/asm-offsets.c +1 −0
  42. arch/arm64/kernel/cpu_errata.c +3 −0
  43. arch/arm64/kernel/probes/decode-insn.c +11 −5
  44. arch/arm64/kernel/probes/simulate-insn.c +7 −11
  45. arch/arm64/kernel/probes/uprobes.c +2 −2
  46. arch/arm64/kernel/process.c +3 −0
  47. arch/arm64/kvm/arm.c +5 −0
  48. arch/arm64/kvm/hyp/include/hyp/switch.h +1 −1
  49. arch/arm64/kvm/hyp/nvhe/hyp-init.S +29 −23
  50. arch/arm64/kvm/hyp/nvhe/hyp-main.c +7 −5
  51. arch/arm64/kvm/hyp/nvhe/pkvm.c +4 −2
  52. arch/arm64/kvm/hypercalls.c +6 −6
  53. arch/arm64/kvm/mmu.c +8 −7
  54. arch/arm64/kvm/nested.c +46 −7
  55. arch/arm64/kvm/sys_regs.c +70 −7
  56. arch/arm64/kvm/vgic/vgic-init.c +35 −6
  57. arch/arm64/kvm/vgic/vgic-kvm-device.c +6 −1
  58. arch/arm64/net/bpf_jit_comp.c +10 −2
  59. arch/loongarch/include/asm/bootinfo.h +4 −0
  60. arch/loongarch/include/asm/kasan.h +1 −1
  61. arch/loongarch/include/asm/loongarch.h +1 −1
  62. arch/loongarch/include/asm/pgalloc.h +11 −0
  63. arch/loongarch/include/asm/pgtable.h +7 −28
  64. arch/loongarch/kernel/process.c +9 −7
  65. arch/loongarch/kernel/setup.c +2 −1
  66. arch/loongarch/kernel/traps.c +5 −0
  67. arch/loongarch/kernel/vdso.c +4 −4
  68. arch/loongarch/kvm/timer.c +4 −3
  69. arch/loongarch/kvm/vcpu.c +1 −1
  70. arch/loongarch/mm/init.c +2 −0
  71. arch/loongarch/mm/pgtable.c +20 −0
  72. arch/powerpc/kernel/head_8xx.S +1 −0
  73. arch/powerpc/kernel/vdso/Makefile +1 −1
  74. arch/powerpc/platforms/powernv/opal-irqchip.c +1 −0
  75. arch/riscv/Kconfig +1 −2
  76. arch/riscv/include/asm/thread_info.h +6 −1
  77. arch/riscv/kvm/aia_imsic.c +4 −4
  78. arch/riscv/net/bpf_jit_comp64.c +5 −3
  79. arch/s390/configs/debug_defconfig +11 −2
  80. arch/s390/configs/defconfig +12 −2
  81. arch/s390/configs/zfcpdump_defconfig +1 −0
  82. arch/s390/include/asm/io.h +2 −0
  83. arch/s390/include/asm/perf_event.h +1 −0
  84. arch/s390/kvm/diag.c +1 −1
  85. arch/s390/kvm/gaccess.c +4 −0
  86. arch/s390/kvm/gaccess.h +8 −6
  87. arch/s390/pci/pci_event.c +9 −8
  88. arch/x86/entry/entry.S +5 −0
  89. arch/x86/entry/entry_32.S +4 −2
  90. arch/x86/include/asm/cpufeatures.h +3 −1
  91. arch/x86/include/asm/ftrace.h +2 −0
  92. arch/x86/include/asm/nospec-branch.h +10 −1
  93. arch/x86/include/asm/reboot.h +2 −2
  94. arch/x86/kernel/amd_nb.c +2 −0
  95. arch/x86/kernel/apic/apic.c +13 −1
  96. arch/x86/kernel/cpu/amd.c +2 −1
  97. arch/x86/kernel/cpu/bugs.c +32 −0
  98. arch/x86/kernel/cpu/common.c +3 −0
  99. arch/x86/kernel/cpu/resctrl/core.c +2 −2
  100. arch/x86/kernel/cpu/resctrl/ctrlmondata.c +14 −9
  101. arch/x86/kernel/kvm.c +4 −0
  102. arch/x86/kernel/reboot.c +2 −2
  103. arch/x86/kvm/Kconfig +6 −3
  104. arch/x86/kvm/Makefile +1 −1
  105. arch/x86/kvm/mmu/mmu.c +51 −12
  106. arch/x86/kvm/svm/nested.c +5 −1
  107. arch/x86/kvm/vmx/vmx.c +3 −3
  108. arch/x86/xen/enlighten_pv.c +4 −0
  109. block/blk-integrity.c +1 −2
  110. block/blk-iocost.c +4 −4
  111. block/blk-mq.c +6 −2
  112. block/blk-rq-qos.c +1 −1
  113. block/elevator.c +14 −7
  114. crypto/algapi.c +1 −1
  115. crypto/testmgr.c +11 −12
  116. drivers/accel/qaic/qaic_control.c +1 −1
  117. drivers/accel/qaic/qaic_data.c +3 −3
  118. drivers/acpi/apei/einj-cxl.c +1 −1
  119. drivers/acpi/battery.c +17 −11
  120. drivers/acpi/resource.c +15 −64
  121. drivers/acpi/video_detect.c +9 −0
  122. drivers/ata/libata-eh.c +14 −4
  123. drivers/base/power/common.c +15 −10
  124. drivers/block/aoe/aoecmd.c +12 −1
  125. drivers/block/drbd/drbd_int.h +0 −1
  126. drivers/block/drbd/drbd_main.c +0 −14
  127. drivers/block/ublk_drv.c +10 −1
  128. drivers/bluetooth/btusb.c +13 −6
  129. drivers/cdrom/cdrom.c +1 −1
  130. drivers/char/virtio_console.c +10 −8
  131. drivers/clk/clk_test.c +14 −47
  132. drivers/clk/rockchip/clk.c +1 −1
  133. drivers/clk/samsung/clk-exynosautov920.c +1 −0
  134. drivers/cpufreq/amd-pstate.c +24 −6
  135. drivers/cpufreq/intel_pstate.c +8 −8
  136. drivers/crypto/marvell/cesa/hash.c +6 −6
  137. drivers/dax/device.c +1 −1
  138. drivers/dma/ep93xx_dma.c +6 −3
  139. drivers/firmware/arm_ffa/driver.c +9 −4
  140. drivers/firmware/arm_scmi/driver.c +1 −3
  141. drivers/firmware/arm_scmi/transports/Makefile +4 −2
  142. drivers/firmware/arm_scmi/transports/mailbox.c +21 −11
  143. drivers/firmware/sysfb.c +3 −1
  144. drivers/gpio/gpio-aspeed.c +3 −1
  145. drivers/gpio/gpio-davinci.c +5 −5
  146. drivers/gpio/gpiolib.c +2 −2
  147. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2 −2
  148. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 −1
  149. drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +4 −7
  150. drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +3 −2
  151. drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +2 −2
  152. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +3 −3
  153. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 −1
  154. drivers/gpu/drm/amd/amdkfd/kfd_process.c +7 −4
  155. drivers/gpu/drm/amd/amdkfd/kfd_svm.c +26 −0
  156. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +22 −5
  157. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +4 −0
  158. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +13 −4
  159. drivers/gpu/drm/amd/display/dc/core/dc.c +34 −11
  160. drivers/gpu/drm/amd/display/dc/dc_types.h +1 −0
  161. drivers/gpu/drm/amd/display/dc/dml2/dml2_policy.c +0 −1
  162. drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +1 −0
  163. drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h +13 −13
  164. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +8 −4
  165. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +10 −12
  166. drivers/gpu/drm/ast/ast_sil164.c +2 −0
  167. drivers/gpu/drm/ast/ast_vga.c +2 −0
  168. drivers/gpu/drm/display/drm_dp_mst_topology.c +8 −2
  169. drivers/gpu/drm/display/drm_hdmi_state_helper.c +1 −3
  170. drivers/gpu/drm/drm_atomic_uapi.c +1 −1
  171. drivers/gpu/drm/drm_debugfs.c +1 −3
  172. drivers/gpu/drm/drm_fbdev_dma.c +2 −1
  173. drivers/gpu/drm/i915/display/intel_dp_mst.c +30 −10
  174. drivers/gpu/drm/i915/display/intel_fb.c +13 −0
  175. drivers/gpu/drm/i915/display/intel_fb.h +1 −0
  176. drivers/gpu/drm/i915/display/intel_hdcp.c +7 −3
  177. drivers/gpu/drm/i915/display/skl_universal_plane.c +11 −0
  178. drivers/gpu/drm/i915/gem/i915_gem_ttm.c +1 −1
  179. drivers/gpu/drm/mgag200/mgag200_drv.c +0 −38
  180. drivers/gpu/drm/mgag200/mgag200_drv.h +2 −12
  181. drivers/gpu/drm/mgag200/mgag200_g200.c +0 −5
  182. drivers/gpu/drm/mgag200/mgag200_g200eh.c +0 −5
  183. drivers/gpu/drm/mgag200/mgag200_g200eh3.c +0 −5
  184. drivers/gpu/drm/mgag200/mgag200_g200er.c +1 −9
  185. drivers/gpu/drm/mgag200/mgag200_g200ev.c +1 −9
  186. drivers/gpu/drm/mgag200/mgag200_g200ew3.c +0 −5
  187. drivers/gpu/drm/mgag200/mgag200_g200se.c +1 −9
  188. drivers/gpu/drm/mgag200/mgag200_g200wb.c +0 −5
  189. drivers/gpu/drm/mgag200/mgag200_mode.c +1 −76
  190. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +13 −3
  191. drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +13 −7
  192. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +42 −26
  193. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +5 −2
  194. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +4 −1
  195. drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +10 −9
  196. drivers/gpu/drm/msm/dsi/dsi_host.c +2 −2
  197. drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c +0 −9
  198. drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h +1 −1
  199. drivers/gpu/drm/nouveau/nouveau_dmem.c +1 −1
  200. drivers/gpu/drm/nouveau/nouveau_drm.c +1 −1
  201. drivers/gpu/drm/panel/panel-himax-hx83102.c +6 −6
  202. drivers/gpu/drm/panthor/panthor_drv.c +1 −0
  203. drivers/gpu/drm/panthor/panthor_mmu.c +8 −0
  204. drivers/gpu/drm/panthor/panthor_sched.c +25 −11
  205. drivers/gpu/drm/radeon/atombios_dp.c +2 −7
  206. drivers/gpu/drm/radeon/radeon_connectors.c +17 −0
  207. drivers/gpu/drm/radeon/radeon_encoders.c +1 −1
  208. drivers/gpu/drm/radeon/radeon_gem.c +0 −3
  209. drivers/gpu/drm/radeon/radeon_object.c +1 −0
  210. drivers/gpu/drm/scheduler/sched_entity.c +11 −3
  211. drivers/gpu/drm/scheduler/sched_main.c +13 −5
  212. drivers/gpu/drm/tegra/gr3d.c +33 −13
  213. drivers/gpu/drm/v3d/v3d_perfmon.c +8 −1
  214. drivers/gpu/drm/vboxvideo/hgsmi_base.c +9 −1
  215. drivers/gpu/drm/vboxvideo/vboxvideo.h +1 −3
  216. drivers/gpu/drm/vc4/vc4_perfmon.c +6 −1
  217. drivers/gpu/drm/vmwgfx/vmwgfx_blit.c +2 −4
  218. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 −2
  219. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 −30
  220. drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +0 −3
  221. drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +4 −0
  222. drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +6 −3
  223. drivers/gpu/drm/xe/regs/xe_gt_regs.h +10 −2
  224. drivers/gpu/drm/xe/xe_bo.c +2 −2
  225. drivers/gpu/drm/xe/xe_debugfs.c +1 −1
  226. drivers/gpu/drm/xe/xe_device.c +8 −8
  227. drivers/gpu/drm/xe/xe_device_types.h +15 −4
  228. drivers/gpu/drm/xe/xe_drm_client.c +8 −1
  229. drivers/gpu/drm/xe/xe_exec.c +4 −8
  230. drivers/gpu/drm/xe/xe_exec_queue.c +3 −3
  231. drivers/gpu/drm/xe/xe_gpu_scheduler.c +5 −0
  232. drivers/gpu/drm/xe/xe_gpu_scheduler.h +4 −0
  233. drivers/gpu/drm/xe/xe_gt.c +3 −2
  234. drivers/gpu/drm/xe/xe_gt_freq.c +2 −2
  235. drivers/gpu/drm/xe/xe_gt_mcr.c +1 −1
  236. drivers/gpu/drm/xe/xe_gt_pagefault.c +21 −18
  237. drivers/gpu/drm/xe/xe_gt_sysfs.c +1 −1
  238. drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +13 −16
  239. drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h +0 −1
  240. drivers/gpu/drm/xe/xe_guc_ct.c +26 −18
  241. drivers/gpu/drm/xe/xe_guc_submit.c +27 −70
  242. drivers/gpu/drm/xe/xe_guc_types.h +2 −7
  243. drivers/gpu/drm/xe/xe_oa.c +3 −6
  244. drivers/gpu/drm/xe/xe_pci.c +2 −0
  245. drivers/gpu/drm/xe/xe_pt.c +1 −1
  246. drivers/gpu/drm/xe/xe_query.c +5 −1
  247. drivers/gpu/drm/xe/xe_sync.c +1 −1
  248. drivers/gpu/drm/xe/xe_tuning.c +28 −0
  249. drivers/gpu/drm/xe/xe_vm.c +14 −22
  250. drivers/gpu/drm/xe/xe_wa.c +4 −0
  251. drivers/gpu/drm/xe/xe_wait_user_fence.c +0 −3
  252. drivers/gpu/host1x/context.c +1 −0
  253. drivers/gpu/host1x/dev.c +8 −10
  254. drivers/hid/amd-sfh-hid/amd_sfh_client.c +3 −11
  255. drivers/hid/hid-ids.h +4 −0
  256. drivers/hid/hid-lenovo.c +8 −0
  257. drivers/hid/hid-multitouch.c +13 −0
  258. drivers/hid/hid-plantronics.c +23 −0
  259. drivers/hid/i2c-hid/i2c-hid-core.c +10 −0
  260. drivers/hid/intel-ish-hid/ishtp-fw-loader.c +1 −1
  261. drivers/hid/wacom_wac.c +2 −0
  262. drivers/hwmon/Kconfig +6 −0
  263. drivers/hwmon/adt7475.c +1 −2
  264. drivers/hwmon/intel-m10-bmc-hwmon.c +1 −1
  265. drivers/hwmon/jc42.c +1 −1
  266. drivers/i2c/busses/i2c-stm32f7.c +3 −3
  267. drivers/iio/accel/Kconfig +2 −0
  268. drivers/iio/accel/bma400_core.c +2 −1
  269. drivers/iio/adc/Kconfig +11 −0
  270. drivers/iio/amplifiers/Kconfig +1 −0
  271. drivers/iio/chemical/Kconfig +2 −0
  272. drivers/iio/common/hid-sensors/hid-sensor-trigger.c +1 −1
  273. drivers/iio/dac/Kconfig +7 −0
  274. drivers/iio/dac/ltc2664.c +9 −8
  275. drivers/iio/frequency/Kconfig +18 −16
  276. drivers/iio/imu/bmi323/bmi323_core.c +11 −12
  277. drivers/iio/light/Kconfig +2 −0
  278. drivers/iio/light/opt3001.c +4 −0
  279. drivers/iio/light/veml6030.c +2 −3
  280. drivers/iio/magnetometer/Kconfig +2 −0
  281. drivers/iio/pressure/Kconfig +4 −0
  282. drivers/iio/proximity/Kconfig +2 −0
  283. drivers/iio/resolver/Kconfig +3 −0
  284. drivers/infiniband/core/addr.c +2 −0
  285. drivers/infiniband/core/nldev.c +2 −0
  286. drivers/infiniband/hw/bnxt_re/hw_counters.c +1 −1
  287. drivers/infiniband/hw/bnxt_re/ib_verbs.c +5 −1
  288. drivers/infiniband/hw/bnxt_re/main.c +25 −22
  289. drivers/infiniband/hw/bnxt_re/qplib_fp.c +5 −0
  290. drivers/infiniband/hw/bnxt_re/qplib_fp.h +1 −1
  291. drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +1 −1
  292. drivers/infiniband/hw/bnxt_re/qplib_res.c +5 −16
  293. drivers/infiniband/hw/bnxt_re/qplib_sp.c +10 −1
  294. drivers/infiniband/hw/bnxt_re/qplib_sp.h +1 −0
  295. drivers/infiniband/hw/cxgb4/cm.c +4 −5
  296. drivers/infiniband/hw/irdma/cm.c +1 −1
  297. drivers/infiniband/sw/siw/siw_qp_tx.c +2 −0
  298. drivers/infiniband/ulp/srpt/ib_srpt.c +68 −12
  299. drivers/input/joystick/xpad.c +3 −0
  300. drivers/input/touchscreen/zinitix.c +22 −12
  301. drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +2 −2
  302. drivers/iommu/arm/arm-smmu/arm-smmu-impl.c +2 −2
  303. drivers/iommu/intel/iommu.c +3 −1
  304. drivers/irqchip/Kconfig +0 −7
  305. drivers/irqchip/irq-gic-v3-its.c +12 −6
  306. drivers/irqchip/irq-mscc-ocelot.c +8 −2
  307. drivers/irqchip/irq-renesas-rzg2l.c +14 −2
  308. drivers/irqchip/irq-riscv-imsic-platform.c +1 −1
  309. drivers/irqchip/irq-riscv-intc.c +18 −1
  310. drivers/irqchip/irq-sifive-plic.c +17 −12
  311. drivers/misc/cardreader/Kconfig +2 −1
  312. drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c +2 −0
  313. drivers/misc/sgi-gru/grukservices.c +0 −2
  314. drivers/misc/sgi-gru/grumain.c +0 −4
  315. drivers/misc/sgi-gru/grutlbpurge.c +0 −2
  316. drivers/mmc/core/queue.c +2 −1
  317. drivers/mmc/host/mvsdio.c +18 −53
  318. drivers/mmc/host/sdhci-of-dwcmshc.c +8 −0
  319. drivers/net/dsa/b53/b53_common.c +13 −4
  320. drivers/net/dsa/lan9303-core.c +29 −0
  321. drivers/net/dsa/microchip/ksz_common.c +11 −10
  322. drivers/net/dsa/mv88e6xxx/chip.c +1 −1
  323. drivers/net/dsa/mv88e6xxx/chip.h +2 −4
  324. drivers/net/dsa/mv88e6xxx/port.c +1 −0
  325. drivers/net/dsa/mv88e6xxx/ptp.c +75 −33
  326. drivers/net/dsa/sja1105/sja1105_main.c +0 −1
  327. drivers/net/dsa/vitesse-vsc73xx-core.c +0 −1
  328. drivers/net/ethernet/adi/adin1110.c +2 −2
  329. drivers/net/ethernet/aeroflex/greth.c +2 −1
  330. drivers/net/ethernet/amd/mvme147.c +3 −4
  331. drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +1 −0
  332. drivers/net/ethernet/broadcom/bcmsysport.c +1 −0
  333. drivers/net/ethernet/broadcom/bnxt/bnxt.c +14 −8
  334. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +42 −28
  335. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h +7 −5
  336. drivers/net/ethernet/cadence/macb_main.c +11 −3
  337. drivers/net/ethernet/emulex/benet/be_main.c +5 −5
  338. drivers/net/ethernet/faraday/ftgmac100.c +6 −1
  339. drivers/net/ethernet/freescale/enetc/enetc.c +43 −13
  340. drivers/net/ethernet/freescale/enetc/enetc.h +1 −0
  341. drivers/net/ethernet/freescale/fec_main.c +4 −2
  342. drivers/net/ethernet/freescale/fman/mac.c +51 −17
  343. drivers/net/ethernet/freescale/fman/mac.h +5 −1
  344. drivers/net/ethernet/i825xx/sun3_82586.c +1 −0
  345. drivers/net/ethernet/ibm/emac/mal.c +3 −1
  346. drivers/net/ethernet/ibm/ibmvnic.c +4 −2
  347. drivers/net/ethernet/intel/e1000e/hw.h +2 −2
  348. drivers/net/ethernet/intel/e1000e/netdev.c +2 −2
  349. drivers/net/ethernet/intel/i40e/i40e_main.c +1 −0
  350. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 −0
  351. drivers/net/ethernet/intel/ice/ice_ddp.c +28 −30
  352. drivers/net/ethernet/intel/ice/ice_ddp.h +2 −2
  353. drivers/net/ethernet/intel/ice/ice_dpll.c +4 −2
  354. drivers/net/ethernet/intel/ice/ice_eswitch_br.c +4 −1
  355. drivers/net/ethernet/intel/ice/ice_eswitch_br.h +1 −0
  356. drivers/net/ethernet/intel/ice/ice_main.c +7 −32
  357. drivers/net/ethernet/intel/ice/ice_sriov.c +14 −5
  358. drivers/net/ethernet/intel/ice/ice_switch.c +0 −2
  359. drivers/net/ethernet/intel/ice/ice_tc_lib.c +11 −0
  360. drivers/net/ethernet/intel/ice/ice_vf_lib.c +8 −1
  361. drivers/net/ethernet/intel/ice/ice_vf_lib_private.h +0 −1
  362. drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c +57 −0
  363. drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.h +1 −0
  364. drivers/net/ethernet/intel/idpf/idpf_vf_dev.c +1 −0
  365. drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +2 −9
  366. drivers/net/ethernet/intel/igb/igb_main.c +4 −0
  367. drivers/net/ethernet/marvell/octeon_ep/octep_rx.c +59 −23
  368. drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +2 −2
  369. drivers/net/ethernet/mediatek/airoha_eth.c +5 −4
  370. drivers/net/ethernet/mediatek/mtk_eth_soc.c +1 −1
  371. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +6 −2
  372. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +3 −1
  373. drivers/net/ethernet/mellanox/mlx5/core/eq.c +6 −0
  374. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +3 −2
  375. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c +1 −3
  376. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.h +1 −0
  377. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c +2 −2
  378. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c +19 −3
  379. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +3 −6
  380. drivers/net/ethernet/microchip/lan743x_ptp.c +14 −21
  381. drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c +6 −6
  382. drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +2 −0
  383. drivers/net/ethernet/realtek/r8169_main.c +3 −1
  384. drivers/net/ethernet/renesas/ravb_main.c +12 −13
  385. drivers/net/ethernet/renesas/rtsn.c +1 −0
  386. drivers/net/ethernet/sfc/efx_channels.c +2 −1
  387. drivers/net/ethernet/sfc/siena/efx_channels.c +2 −1
  388. drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +12 −2
  389. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 −1
  390. drivers/net/ethernet/ti/am65-cpsw-nuss.c +13 −9
  391. drivers/net/ethernet/ti/icssg/icssg_config.c +2 −0
  392. drivers/net/ethernet/ti/icssg/icssg_prueth.c +1 −0
  393. drivers/net/ethernet/ti/icssg/icssg_prueth.h +2 −0
  394. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +2 −0
  395. drivers/net/hyperv/netvsc_drv.c +30 −0
  396. drivers/net/macsec.c +0 −18
  397. drivers/net/mdio/mdio-bcm-unimac.c +1 −0
  398. drivers/net/netconsole.c +7 −1
  399. drivers/net/netdevsim/dev.c +9 −6
  400. drivers/net/phy/aquantia/aquantia_main.c +33 −18
  401. drivers/net/phy/bcm84881.c +2 −2
  402. drivers/net/phy/dp83822.c +2 −2
  403. drivers/net/phy/dp83869.c +0 −1
  404. drivers/net/phy/phy_device.c +3 −2
  405. drivers/net/phy/realtek.c +23 −1
  406. drivers/net/plip/plip.c +1 −1
  407. drivers/net/ppp/ppp_async.c +1 −1
  408. drivers/net/pse-pd/pse_core.c +13 −2
  409. drivers/net/slip/slhc.c +34 −23
  410. drivers/net/usb/qmi_wwan.c +1 −0
  411. drivers/net/usb/usbnet.c +3 −1
  412. drivers/net/virtio_net.c +1 −1
  413. drivers/net/vmxnet3/vmxnet3_xdp.c +1 −1
  414. drivers/net/vxlan/vxlan_core.c +5 −1
  415. drivers/net/vxlan/vxlan_private.h +1 −1
  416. drivers/net/vxlan/vxlan_vnifilter.c +9 −10
  417. drivers/net/wwan/wwan_core.c +1 −1
  418. drivers/nvme/host/core.c +17 −24
  419. drivers/nvme/host/multipath.c +33 −7
  420. drivers/nvme/host/nvme.h +1 −0
  421. drivers/nvme/host/pci.c +16 −3
  422. drivers/nvme/host/tcp.c +4 −3
  423. drivers/nvme/target/loop.c +13 −0
  424. drivers/nvme/target/passthru.c +2 −4
  425. drivers/nvme/target/rdma.c +27 −29
  426. drivers/of/of_kunit_helpers.c +15 −0
  427. drivers/of/of_private.h +3 −0
  428. drivers/of/of_test.c +3 −0
  429. drivers/of/overlay_test.c +4 −1
  430. drivers/opp/core.c +3 −1
  431. drivers/parport/procfs.c +11 −11
  432. drivers/perf/riscv_pmu_legacy.c +2 −2
  433. drivers/perf/riscv_pmu_sbi.c +2 −2
  434. drivers/pinctrl/intel/Kconfig +1 −0
  435. drivers/pinctrl/intel/pinctrl-intel-platform.c +2 −3
  436. drivers/pinctrl/nuvoton/pinctrl-ma35.c +1 −1
  437. drivers/pinctrl/pinctrl-apple-gpio.c +3 −0
  438. drivers/pinctrl/pinctrl-aw9523.c +4 −2
  439. drivers/pinctrl/pinctrl-ocelot.c +4 −4
  440. drivers/pinctrl/sophgo/pinctrl-cv18xx.c +1 −1
  441. drivers/pinctrl/stm32/pinctrl-stm32.c +7 −2
  442. drivers/platform/x86/dell/dell-laptop.c +12 −3
  443. drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +1 −0
  444. drivers/platform/x86/intel/pmc/spt.c +0 −2
  445. drivers/platform/x86/intel/speed_select_if/isst_if_common.c +4 −1
  446. drivers/platform/x86/intel/tpmi_power_domains.c +1 −0
  447. drivers/platform/x86/x86-android-tablets/core.c +4 −2
  448. drivers/pmdomain/qcom/cpr.c +1 −1
  449. drivers/powercap/intel_rapl_msr.c +2 −0
  450. drivers/powercap/intel_rapl_tpmi.c +15 −4
  451. drivers/reset/reset-npcm.c +2 −2
  452. drivers/reset/starfive/reset-starfive-jh71x0.c +3 −0
  453. drivers/s390/char/sclp.c +2 −1
  454. drivers/s390/char/sclp_vt220.c +2 −2
  455. drivers/s390/crypto/ap_bus.c +1 −2
  456. drivers/s390/crypto/ap_bus.h +1 −1
  457. drivers/s390/crypto/ap_queue.c +20 −8
  458. drivers/s390/crypto/pkey_pckmo.c +1 −0
  459. drivers/scsi/fnic/fnic_main.c +1 −1
  460. drivers/scsi/mpi3mr/mpi3mr.h +2 −2
  461. drivers/scsi/mpi3mr/mpi3mr_transport.c +27 −15
  462. drivers/scsi/scsi_transport_fc.c +2 −2
  463. drivers/scsi/wd33c93.c +1 −1
  464. drivers/soc/fsl/qe/qmc.c +5 −6
  465. drivers/spi/atmel-quadspi.c +1 −1
  466. drivers/spi/spi-cadence.c +5 −3
  467. drivers/spi/spi-imx.c +1 −1
  468. drivers/spi/spi-s3c64xx.c +2 −2
  469. drivers/target/target_core_device.c +1 −1
  470. drivers/target/target_core_user.c +1 −1
  471. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0 −2
  472. drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c +24 −46
  473. drivers/thermal/thermal_core.c +2 −3
  474. drivers/thermal/thermal_core.h +3 −0
  475. drivers/thermal/thermal_netlink.c +3 −6
  476. drivers/tty/n_gsm.c +2 −0
  477. drivers/tty/serial/imx.c +15 −0
  478. drivers/tty/serial/qcom_geni_serial.c +48 −55
  479. drivers/tty/vt/vt.c +1 −1
  480. drivers/ufs/core/ufs-mcq.c +8 −7
  481. drivers/ufs/core/ufshcd.c +9 −20
  482. drivers/usb/dwc3/core.c +41 −8
  483. drivers/usb/dwc3/core.h +3 −4
  484. drivers/usb/dwc3/gadget.c +6 −15
  485. drivers/usb/gadget/function/f_uac2.c +3 −3
  486. drivers/usb/gadget/udc/core.c +1 −0
  487. drivers/usb/gadget/udc/dummy_hcd.c +15 −5
  488. drivers/usb/host/xhci-dbgcap.h +1 −0
  489. drivers/usb/host/xhci-dbgtty.c +50 −5
  490. drivers/usb/host/xhci-pci.c +5 −0
  491. drivers/usb/host/xhci-ring.c +30 −38
  492. drivers/usb/host/xhci-tegra.c +1 −1
  493. drivers/usb/host/xhci.h +1 −1
  494. drivers/usb/misc/Kconfig +12 −0
  495. drivers/usb/misc/onboard_usb_dev.c +4 −2
  496. drivers/usb/misc/yurex.c +9 −12
  497. drivers/usb/serial/option.c +8 −0
  498. drivers/usb/storage/unusual_devs.h +11 −0
  499. drivers/usb/typec/class.c +3 −0
  500. drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c +0 −1
  501. drivers/vdpa/octeon_ep/octep_vdpa_hw.c +6 −6
  502. drivers/vhost/scsi.c +15 −12
  503. drivers/video/fbdev/amifb.c +2 −2
  504. drivers/video/fbdev/arcfb.c +1 −1
  505. drivers/video/fbdev/atmel_lcdfb.c +1 −1
  506. drivers/video/fbdev/au1100fb.c +1 −1
  507. drivers/video/fbdev/au1200fb.c +1 −1
  508. drivers/video/fbdev/broadsheetfb.c +1 −1
  509. drivers/video/fbdev/bw2.c +1 −1
  510. drivers/video/fbdev/cg14.c +1 −1
  511. drivers/video/fbdev/cg3.c +1 −1
  512. drivers/video/fbdev/cg6.c +1 −1
  513. drivers/video/fbdev/clps711x-fb.c +1 −1
  514. drivers/video/fbdev/cobalt_lcdfb.c +1 −1
  515. drivers/video/fbdev/da8xx-fb.c +1 −1
  516. drivers/video/fbdev/ep93xx-fb.c +1 −1
  517. drivers/video/fbdev/ffb.c +1 −1
  518. drivers/video/fbdev/fsl-diu-fb.c +3 −3
  519. drivers/video/fbdev/gbefb.c +3 −3
  520. drivers/video/fbdev/goldfishfb.c +1 −1
  521. drivers/video/fbdev/grvga.c +1 −1
  522. drivers/video/fbdev/hecubafb.c +1 −1
  523. drivers/video/fbdev/hgafb.c +1 −1
  524. drivers/video/fbdev/hitfb.c +1 −1
  525. drivers/video/fbdev/imxfb.c +1 −1
  526. drivers/video/fbdev/leo.c +1 −1
  527. drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +1 −1
  528. drivers/video/fbdev/metronomefb.c +1 −1
  529. drivers/video/fbdev/ocfb.c +1 −1
  530. drivers/video/fbdev/offb.c +2 −2
  531. drivers/video/fbdev/omap/omapfb_main.c +1 −1
  532. drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c +1 −1
  533. drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c +1 −1
  534. drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c +1 −1
  535. drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c +1 −1
  536. drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c +1 −1
  537. drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c +1 −1
  538. drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c +1 −1
  539. drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +1 −1
  540. drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c +1 −1
  541. drivers/video/fbdev/omap2/omapfb/dss/core.c +3 −3
  542. drivers/video/fbdev/omap2/omapfb/dss/dispc.c +1 −1
  543. drivers/video/fbdev/omap2/omapfb/dss/dpi.c +2 −2
  544. drivers/video/fbdev/omap2/omapfb/dss/dsi.c +1 −1
  545. drivers/video/fbdev/omap2/omapfb/dss/dss.c +1 −1
  546. drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +3 −3
  547. drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +1 −1
  548. drivers/video/fbdev/omap2/omapfb/dss/sdi.c +3 −3
  549. drivers/video/fbdev/omap2/omapfb/dss/venc.c +3 −3
  550. drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 −1
  551. drivers/video/fbdev/p9100.c +1 −1
  552. drivers/video/fbdev/platinumfb.c +1 −1
  553. drivers/video/fbdev/pxa168fb.c +1 −1
  554. drivers/video/fbdev/pxa3xx-gcu.c +4 −4
  555. drivers/video/fbdev/pxafb.c +1 −1
  556. drivers/video/fbdev/s1d13xxxfb.c +1 −1
  557. drivers/video/fbdev/s3c-fb.c +1 −1
  558. drivers/video/fbdev/sh7760fb.c +1 −1
  559. drivers/video/fbdev/sh_mobile_lcdcfb.c +1 −1
  560. drivers/video/fbdev/simplefb.c +1 −1
  561. drivers/video/fbdev/sm501fb.c +1 −1
  562. drivers/video/fbdev/tcx.c +1 −1
  563. drivers/video/fbdev/uvesafb.c +1 −1
  564. drivers/video/fbdev/vesafb.c +1 −1
  565. drivers/video/fbdev/vfb.c +1 −1
  566. drivers/video/fbdev/vga16fb.c +1 −1
  567. drivers/video/fbdev/via/via-gpio.c +1 −1
  568. drivers/video/fbdev/via/via_i2c.c +1 −1
  569. drivers/video/fbdev/vt8500lcdfb.c +1 −1
  570. drivers/video/fbdev/wm8505fb.c +1 −1
  571. drivers/video/fbdev/wmt_ge_rops.c +1 −1
  572. drivers/video/fbdev/xilinxfb.c +1 −1
  573. drivers/virtio/virtio_ring.c +1 −1
  574. drivers/xen/Kconfig +0 −1
  575. drivers/xen/acpi.c +24 −0
  576. drivers/xen/privcmd.c +2 −4
  577. drivers/xen/xen-pciback/pci_stub.c +9 −2
  578. fs/9p/fid.c +2 −3
  579. fs/Kconfig +1 −1
  580. fs/afs/internal.h +2 −0
  581. fs/afs/rxrpc.c +59 −24
  582. fs/bcachefs/alloc_background.c +51 −26
  583. fs/bcachefs/alloc_background_format.h +1 −1
  584. fs/bcachefs/alloc_foreground.c +1 −1
  585. fs/bcachefs/bcachefs_format.h +2 −1
  586. fs/bcachefs/btree_gc.c +20 −10
  587. fs/bcachefs/btree_io.c +4 −3
  588. fs/bcachefs/btree_iter.c +3 −3
  589. fs/bcachefs/btree_iter.h +10 −0
  590. fs/bcachefs/btree_node_scan.c +3 −0
  591. fs/bcachefs/btree_trans_commit.c +2 −1
  592. fs/bcachefs/btree_update.c +2 −2
  593. fs/bcachefs/btree_update.h +1 −1
  594. fs/bcachefs/btree_update_interior.c +1 −3
  595. fs/bcachefs/buckets.c +5 −2
  596. fs/bcachefs/buckets.h +7 −5
  597. fs/bcachefs/chardev.c +1 −0
  598. fs/bcachefs/darray.c +14 −1
  599. fs/bcachefs/data_update.c +1 −0
  600. fs/bcachefs/dirent.c +0 −7
  601. fs/bcachefs/dirent.h +7 −0
  602. fs/bcachefs/disk_accounting.c +118 −37
  603. fs/bcachefs/ec.c +71 −37
  604. fs/bcachefs/errcode.h +2 −1
  605. fs/bcachefs/error.c +22 −6
  606. fs/bcachefs/error.h +3 −6
  607. fs/bcachefs/extents.h +10 −0
  608. fs/bcachefs/fs-io-buffered.c +6 −0
  609. fs/bcachefs/fs-io-direct.c +2 −1
  610. fs/bcachefs/fs-io-pagecache.c +45 −25
  611. fs/bcachefs/fs-io.c +1 −1
  612. fs/bcachefs/fs.c +130 −31
  613. fs/bcachefs/fs.h +3 −6
  614. fs/bcachefs/fsck.c +559 −254
  615. fs/bcachefs/fsck.h +1 −0
  616. fs/bcachefs/inode.c +272 −74
  617. fs/bcachefs/inode.h +33 −6
  618. fs/bcachefs/inode_format.h +5 −4
  619. fs/bcachefs/io_misc.c +43 −20
  620. fs/bcachefs/io_read.c +4 −4
  621. fs/bcachefs/io_write.c +2 −2
  622. fs/bcachefs/journal.c +19 −4
  623. fs/bcachefs/journal.h +1 −1
  624. fs/bcachefs/logged_ops.c +9 −7
  625. fs/bcachefs/logged_ops.h +1 −1
  626. fs/bcachefs/lru.c +20 −14
  627. fs/bcachefs/move.c +1 −1
  628. fs/bcachefs/movinggc.c +9 −3
  629. fs/bcachefs/opts.c +8 −2
  630. fs/bcachefs/opts.h +2 −1
  631. fs/bcachefs/quota.c +1 −1
  632. fs/bcachefs/rebalance.c +3 −1
  633. fs/bcachefs/recovery.c +3 −2
  634. fs/bcachefs/recovery_passes_types.h +1 −0
  635. fs/bcachefs/replicas.c +31 −8
  636. fs/bcachefs/sb-downgrade.c +4 −1
  637. fs/bcachefs/sb-errors_format.h +24 −17
  638. fs/bcachefs/sb-members.c +9 −1
  639. fs/bcachefs/snapshot.c +30 −99
  640. fs/bcachefs/snapshot.h +0 −3
  641. fs/bcachefs/str_hash.h +42 −18
  642. fs/bcachefs/subvolume.c +15 −8
  643. fs/bcachefs/subvolume.h +2 −0
  644. fs/bcachefs/super.c +25 −11
  645. fs/bcachefs/tests.c +2 −2
  646. fs/bcachefs/util.c +1 −1
  647. fs/bcachefs/xattr.c +1 −1
  648. fs/btrfs/backref.c +8 −4
  649. fs/btrfs/block-group.c +2 −0
  650. fs/btrfs/delayed-ref.c +40 −15
  651. fs/btrfs/delayed-ref.h +9 −1
  652. fs/btrfs/dir-item.c +2 −2
  653. fs/btrfs/disk-io.c +12 −1
  654. fs/btrfs/extent-tree.c +21 −5
  655. fs/btrfs/extent_io.c +16 −15
  656. fs/btrfs/extent_map.c +16 −15
  657. fs/btrfs/free-space-cache.c +2 −2
  658. fs/btrfs/free-space-cache.h +6 −0
  659. fs/btrfs/inode.c +7 −5
  660. fs/btrfs/messages.c +2 −1
  661. fs/btrfs/qgroup.c +17 −6
  662. fs/btrfs/qgroup.h +2 −0
  663. fs/btrfs/relocation.c +4 −73
  664. fs/btrfs/send.c +28 −7
  665. fs/btrfs/super.c +10 −2
  666. fs/btrfs/tree-log.c +3 −3
  667. fs/btrfs/volumes.h +6 −0
  668. fs/btrfs/zoned.c +1 −1
  669. fs/ceph/addr.c +5 −2
  670. fs/erofs/super.c +10 −3
  671. fs/erofs/zdata.c +9 −20
  672. fs/erofs/zmap.c +12 −20
  673. fs/ext4/fast_commit.c +11 −8
  674. fs/ext4/resize.c +10 −8
  675. fs/ext4/xattr.c +2 −1
  676. fs/f2fs/file.c +2 −1
  677. fs/fat/namei_vfat.c +1 −1
  678. fs/file.c +34 −61
  679. fs/inode.c +6 −4
  680. fs/iomap/buffered-io.c +36 −75
  681. fs/jfs/jfs_dmap.c +1 −1
  682. fs/namespace.c +3 −1
  683. fs/netfs/buffered_read.c +14 −33
  684. fs/netfs/locking.c +2 −1
  685. fs/netfs/read_collect.c +2 −0
  686. fs/nfs/callback_xdr.c +2 −0
  687. fs/nfs/client.c +1 −0
  688. fs/nfs/delegation.c +5 −0
  689. fs/nfs/localio.c +3 −4
  690. fs/nfs/nfs42proc.c +1 −1
  691. fs/nfs/nfs4state.c +1 −1
  692. fs/nfs_common/nfslocalio.c +4 −1
  693. fs/nfsd/filecache.c +5 −3
  694. fs/nfsd/localio.c +1 −1
  695. fs/nfsd/nfs4state.c +1 −0
  696. fs/nfsd/nfssvc.c +5 −5
  697. fs/nfsd/trace.h +3 −3
  698. fs/nilfs2/dir.c +25 −23
  699. fs/nilfs2/namei.c +26 −13
  700. fs/nilfs2/nilfs.h +1 −1
  701. fs/nilfs2/page.c +4 −2
  702. fs/notify/dnotify/dnotify.c +1 −2
  703. fs/notify/fanotify/fanotify_user.c +1 −1
  704. fs/notify/fsnotify.c +12 −9
  705. fs/notify/group.c +0 −11
  706. fs/notify/inotify/inotify_user.c +1 −1
  707. fs/notify/mark.c +6 −2
  708. fs/ntfs3/attrib.c +86 −10
  709. fs/ntfs3/attrlist.c +0 −53
  710. fs/ntfs3/file.c +138 −47
  711. fs/ntfs3/frecord.c +83 −14
  712. fs/ntfs3/fslog.c +17 −2
  713. fs/ntfs3/inode.c +14 −6
  714. fs/ntfs3/lib/lzx_decompress.c +1 −2
  715. fs/ntfs3/lznt.c +3 −0
  716. fs/ntfs3/namei.c +5 −5
  717. fs/ntfs3/ntfs_fs.h +5 −5
  718. fs/ntfs3/record.c +15 −16
  719. fs/ntfs3/run.c +5 −3
  720. fs/ntfs3/super.c +37 −33
  721. fs/ntfs3/xattr.c +1 −1
  722. fs/ocfs2/file.c +6 −3
  723. fs/open.c +2 −0
  724. fs/proc/fd.c +1 −1
  725. fs/proc/kcore.c +34 −2
  726. fs/proc/task_mmu.c +10 −6
  727. fs/smb/client/cifs_unicode.c +14 −3
  728. fs/smb/client/cifsacl.h +1 −1
  729. fs/smb/client/cifsencrypt.c +2 −1
  730. fs/smb/client/cifsfs.c +14 −3
  731. fs/smb/client/cifsglob.h +3 −2
  732. fs/smb/client/cifspdu.h +2 −2
  733. fs/smb/client/cifsproto.h +0 −9
  734. fs/smb/client/cifssmb.c +3 −3
  735. fs/smb/client/compress.c +0 −4
  736. fs/smb/client/connect.c +0 −12
  737. fs/smb/client/file.c +1 −1
  738. fs/smb/client/fs_context.h +1 −1
  739. fs/smb/client/inode.c +7 −1
  740. fs/smb/client/misc.c +1 −1
  741. fs/smb/client/netmisc.c +1 −1
  742. fs/smb/client/readdir.c +2 −2
  743. fs/smb/client/reparse.c +198 −5
  744. fs/smb/client/sess.c +1 −33
  745. fs/smb/client/smb1ops.c +1 −1
  746. fs/smb/client/smb2inode.c +24 −3
  747. fs/smb/client/smb2misc.c +14 −14
  748. fs/smb/client/smb2ops.c +16 −10
  749. fs/smb/client/smb2pdu.c +11 −2
  750. fs/smb/client/smb2proto.h +2 −1
  751. fs/smb/client/smb2transport.c +30 −2
  752. fs/smb/client/smbdirect.c +2 −2
  753. fs/smb/client/smbdirect.h +1 −1
  754. fs/smb/common/smbfsctl.h +4 −3
  755. fs/smb/server/auth.c +5 −1
  756. fs/smb/server/ksmbd_netlink.h +17 −0
  757. fs/smb/server/mgmt/user_config.c +37 −8
  758. fs/smb/server/mgmt/user_config.h +4 −1
  759. fs/smb/server/mgmt/user_session.c +21 −5
  760. fs/smb/server/mgmt/user_session.h +4 −0
  761. fs/smb/server/server.c +2 −0
  762. fs/smb/server/smb2pdu.c +7 −1
  763. fs/smb/server/smb_common.c +12 −3
  764. fs/smb/server/transport_ipc.c +60 −4
  765. fs/smb/server/transport_ipc.h +2 −0
  766. fs/udf/balloc.c +25 −13
  767. fs/udf/directory.c +16 −7
  768. fs/udf/inode.c +134 −68
  769. fs/udf/partition.c +4 −2
  770. fs/udf/super.c +2 −1
  771. fs/udf/truncate.c +34 −9
  772. fs/udf/udfdecl.h +9 −6
  773. fs/unicode/mkutf8data.c +0 −70
  774. fs/unicode/utf8data.c_shipped +3346 −3357
  775. fs/xfs/libxfs/xfs_alloc.c +2 −5
  776. fs/xfs/libxfs/xfs_alloc.h +1 −3
  777. fs/xfs/libxfs/xfs_attr.c +81 −109
  778. fs/xfs/libxfs/xfs_attr_leaf.c +22 −18
  779. fs/xfs/libxfs/xfs_attr_leaf.h +1 −1
  780. fs/xfs/libxfs/xfs_bmap.c +44 −96
  781. fs/xfs/libxfs/xfs_da_btree.c +3 −2
  782. fs/xfs/scrub/bmap_repair.c +1 −1
  783. fs/xfs/scrub/ialloc_repair.c +2 −2
  784. fs/xfs/xfs_aops.c +2 −2
  785. fs/xfs/xfs_bmap_util.c +7 −3
  786. fs/xfs/xfs_bmap_util.h +1 −1
  787. fs/xfs/xfs_file.c +88 −58
  788. fs/xfs/xfs_icache.c +23 −14
  789. fs/xfs/xfs_iomap.c +46 −21
  790. fs/xfs/xfs_log.h +0 −2
  791. fs/xfs/xfs_log_cil.c +4 −7
  792. fs/xfs/xfs_log_recover.c +1 −1
  793. fs/xfs/xfs_reflink.c +3 −0
  794. fs/xfs/xfs_reflink.h +19 −0
  795. include/drm/gpu_scheduler.h +1 −1
  796. include/linux/bpf.h +11 −3
  797. include/linux/bpf_types.h +1 −0
  798. include/linux/closure.h +35 −0
  799. include/linux/cpufreq.h +1 −5
  800. include/linux/fdtable.h +4 −4
  801. include/linux/fs.h +6 −1
  802. include/linux/fsl/enetc_mdio.h +2 −1
  803. include/linux/fsnotify_backend.h +3 −7
  804. include/linux/hdmi.h +9 −0
  805. include/linux/host1x.h +1 −0
  806. include/linux/huge_mm.h +18 −0
  807. include/linux/iomap.h +17 −3
  808. include/linux/irqchip/arm-gic-v4.h +3 −1
  809. include/linux/kvm_host.h +0 −2
  810. include/linux/mm.h +2 −1
  811. include/linux/netdevice.h +12 −0
  812. include/linux/nfs_fs_sb.h +1 −0
  813. include/linux/nfslocalio.h +15 −0
  814. include/linux/percpu.h +5 −1
  815. include/linux/sched.h +7 −2
  816. include/linux/sched/mm.h +4 −13
  817. include/linux/security.h +2 −2
  818. include/linux/soc/qcom/geni-se.h +1 −1
  819. include/linux/soundwire/sdw_intel.h +1 −1
  820. include/linux/task_work.h +4 −1
  821. include/net/bluetooth/bluetooth.h +1 −0
  822. include/net/genetlink.h +1 −2
  823. include/net/mctp.h +1 −1
  824. include/net/netns/xfrm.h +0 −1
  825. include/net/rtnetlink.h +17 −0
  826. include/net/sch_generic.h +0 −1
  827. include/net/sock.h +7 −0
  828. include/net/xfrm.h +15 −13
  829. include/sound/hdaudio.h +1 −1
  830. include/trace/events/btrfs.h +1 −1
  831. include/trace/events/dma.h +8 −8
  832. include/trace/events/huge_memory.h +2 −2
  833. include/trace/events/netfs.h +0 −1
  834. include/uapi/linux/bpf.h +8 −8
  835. include/uapi/linux/ublk_cmd.h +7 −1
  836. include/xen/acpi.h +9 −5
  837. init/Kconfig +6 −2
  838. io_uring/io_uring.c +5 −2
  839. io_uring/io_uring.h +9 −1
  840. io_uring/net.c +3 −1
  841. io_uring/rsrc.c +2 −1
  842. io_uring/rw.c +24 −20
  843. kernel/bpf/bpf_lsm.c +0 −4
  844. kernel/bpf/btf.c +11 −4
  845. kernel/bpf/devmap.c +7 −4
  846. kernel/bpf/helpers.c +5 −5
  847. kernel/bpf/inode.c +3 −2
  848. kernel/bpf/log.c +1 −2
  849. kernel/bpf/ringbuf.c +7 −7
  850. kernel/bpf/syscall.c +32 −13
  851. kernel/bpf/task_iter.c +1 −1
  852. kernel/bpf/verifier.c +60 −51
  853. kernel/events/core.c +1 −1
  854. kernel/fork.c +14 −18
  855. kernel/freezer.c +6 −1
  856. kernel/kthread.c +2 −0
  857. kernel/rcu/tasks.h +9 −0
  858. kernel/rcu/tree.c +5 −4
  859. kernel/rcu/tree_nocb.h +7 −1
  860. kernel/resource_kunit.c +14 −4
  861. kernel/sched/core.c +53 −29
  862. kernel/sched/deadline.c +1 −1
  863. kernel/sched/ext.c +123 −99
  864. kernel/sched/fair.c +7 −20
  865. kernel/sched/sched.h +4 −1
  866. kernel/sched/stats.h +33 −15
  867. kernel/sched/syscalls.c +9 −4
  868. kernel/task_work.c +13 −2
  869. kernel/time/posix-clock.c +3 −0
  870. kernel/time/tick-sched.c +6 −0
  871. kernel/trace/bpf_trace.c +19 −23
  872. kernel/trace/fgraph.c +23 −8
  873. kernel/trace/ring_buffer.c +32 −21
  874. kernel/trace/trace.c +16 −5
  875. kernel/trace/trace_eprobe.c +6 −1
  876. kernel/trace/trace_fprobe.c +5 −1
  877. kernel/trace/trace_hwlat.c +2 −0
  878. kernel/trace/trace_kprobe.c +5 −1
  879. kernel/trace/trace_osnoise.c +13 −9
  880. kernel/trace/trace_probe.c +1 −1
  881. kernel/trace/trace_selftest.c +1 −1
  882. kernel/trace/trace_uprobe.c +9 −4
  883. lib/Kconfig.debug +1 −1
  884. lib/Kconfig.kasan +5 −2
  885. lib/buildid.c +5 −0
  886. lib/codetag.c +3 −0
  887. lib/crypto/mpi/mpi-mul.c +1 −1
  888. lib/maple_tree.c +7 −7
  889. lib/objpool.c +1 −1
  890. lib/slub_kunit.c +12 −6
  891. mm/damon/tests/sysfs-kunit.h +1 −0
  892. mm/huge_memory.c +2 −13
  893. mm/kasan/init.c +7 −1
  894. mm/khugepaged.c +3 −3
  895. mm/memory.c +11 −6
  896. mm/mmap.c +21 −11
  897. mm/mremap.c +9 −2
  898. mm/secretmem.c +2 −2
  899. mm/shmem.c +1 −6
  900. mm/slab.h +7 −1
  901. mm/slab_common.c +3 −2
  902. mm/slub.c +3 −2
  903. mm/sparse-vmemmap.c +5 −0
  904. mm/swapfile.c +5 −4
  905. mm/vmscan.c +2 −2
  906. mm/zswap.c +0 −1
  907. net/9p/Kconfig +2 −0
  908. net/9p/client.c +11 −1
  909. net/bluetooth/af_bluetooth.c +25 −0
  910. net/bluetooth/bnep/core.c +1 −2
  911. net/bluetooth/hci_conn.c +3 −0
  912. net/bluetooth/hci_core.c +15 −9
  913. net/bluetooth/hci_sync.c +9 −3
  914. net/bluetooth/iso.c +13 −11
  915. net/bluetooth/rfcomm/sock.c +0 −2
  916. net/bluetooth/sco.c +12 −6
  917. net/bridge/br_netfilter_hooks.c +5 −0
  918. net/bridge/br_netlink.c +5 −1
  919. net/bridge/br_private.h +3 −2
  920. net/bridge/br_vlan.c +9 −10
  921. net/core/dst.c +12 −5
  922. net/core/filter.c +20 −30
  923. net/core/rtnetlink.c +29 −0
  924. net/core/sock_map.c +8 −0
  925. net/dsa/user.c +8 −3
  926. net/ipv4/devinet.c +25 −10
  927. net/ipv4/inet_connection_sock.c +16 −5
  928. net/ipv4/netfilter/nft_fib_ipv4.c +1 −3
  929. net/ipv4/tcp_input.c +38 −4
  930. net/ipv4/tcp_output.c +1 −4
  931. net/ipv4/udp.c +3 −1
  932. net/ipv4/xfrm4_policy.c +18 −22
  933. net/ipv6/netfilter/nft_fib_ipv6.c +3 −2
  934. net/ipv6/udp.c +3 −1
  935. net/ipv6/xfrm6_policy.c +16 −15
  936. net/l2tp/l2tp_netlink.c +2 −2
  937. net/mctp/af_mctp.c +5 −1
  938. net/mctp/device.c +18 −12
  939. net/mctp/neigh.c +19 −12
  940. net/mctp/route.c +23 −10
  941. net/mpls/af_mpls.c +21 −11
  942. net/mptcp/mib.c +3 −0
  943. net/mptcp/mib.h +3 −0
  944. net/mptcp/pm_netlink.c +4 −2
  945. net/mptcp/protocol.c +21 −3
  946. net/mptcp/protocol.h +1 −0
  947. net/mptcp/subflow.c +15 −2
  948. net/netfilter/nf_bpf_link.c +6 −1
  949. net/netfilter/xt_CHECKSUM.c +23 −10
  950. net/netfilter/xt_CLASSIFY.c +14 −2
  951. net/netfilter/xt_CONNSECMARK.c +25 −11
  952. net/netfilter/xt_CT.c +69 −37
  953. net/netfilter/xt_IDLETIMER.c +40 −19
  954. net/netfilter/xt_LED.c +27 −12
  955. net/netfilter/xt_NFLOG.c +25 −11
  956. net/netfilter/xt_RATEEST.c +27 −12
  957. net/netfilter/xt_SECMARK.c +25 −2
  958. net/netfilter/xt_TRACE.c +25 −11
  959. net/netfilter/xt_addrtype.c +13 −2
  960. net/netfilter/xt_cluster.c +23 −10
  961. net/netfilter/xt_connbytes.c +3 −1
  962. net/netfilter/xt_connlimit.c +27 −12
  963. net/netfilter/xt_connmark.c +25 −3
  964. net/netfilter/xt_mark.c +32 −10
  965. net/netlink/af_netlink.c +2 −1
  966. net/netlink/genetlink.c +14 −14
  967. net/phonet/pn_netlink.c +11 −17
  968. net/rxrpc/ar-internal.h +1 −1
  969. net/rxrpc/io_thread.c +8 −2
  970. net/rxrpc/local_object.c +1 −1
  971. net/rxrpc/sendmsg.c +5 −5
  972. net/sched/act_api.c +22 −1
  973. net/sched/sch_api.c +6 −1
  974. net/sched/sch_generic.c +7 −1
  975. net/sched/sch_taprio.c +14 −7
  976. net/sctp/socket.c +13 −5
  977. net/smc/smc_inet.c +11 −0
  978. net/smc/smc_pnet.c +1 −1
  979. net/smc/smc_wr.c +5 −1
  980. net/socket.c +6 −1
  981. net/sunrpc/svc.c +4 −7
  982. net/vmw_vsock/virtio_transport.c +4 −4
  983. net/vmw_vsock/virtio_transport_common.c +12 −2
  984. net/vmw_vsock/vsock_bpf.c +0 −8
  985. net/wireless/nl80211.c +2 −6
  986. net/xfrm/xfrm_device.c +8 −3
  987. net/xfrm/xfrm_policy.c +38 −15
  988. net/xfrm/xfrm_user.c +8 −2
  989. rust/kernel/device.rs +3 −12
  990. rust/kernel/firmware.rs +1 −1
  991. scripts/Kconfig.include +3 −0
  992. scripts/Makefile.compiler +7 −7
  993. scripts/Makefile.dtbs +3 −1
  994. scripts/include/list.h +50 −0
  995. scripts/kconfig/expr.c +1 −0
  996. scripts/kconfig/parser.y +8 −2
  997. scripts/kconfig/qconf.cc +3 −3
  998. scripts/package/builddeb +0 −1
  999. scripts/rustc-llvm-version.sh +22 −0
  1000. security/Kconfig.hardening +2 −2
  1001. security/ipe/Kconfig +19 −0
  1002. security/ipe/policy.c +15 −3
  1003. security/security.c +6 −4
  1004. security/tomoyo/Kconfig +0 −15
  1005. security/tomoyo/Makefile +1 −7
  1006. security/tomoyo/common.c +2 −12
  1007. security/tomoyo/common.h +0 −72
  1008. security/tomoyo/gc.c +0 −3
  1009. security/tomoyo/init.c +0 −366
  1010. security/tomoyo/load_policy.c +0 −12
  1011. security/tomoyo/proxy.c +0 −82
  1012. security/tomoyo/securityfs_if.c +3 −7
  1013. security/tomoyo/tomoyo.c +109 −1
  1014. security/tomoyo/util.c +3 −0
  1015. sound/Kconfig +1 −1
  1016. sound/aoa/codecs/onyx.c +1 −1
  1017. sound/aoa/codecs/tas.c +1 −1
  1018. sound/core/compress_offload.c +1 −1
  1019. sound/core/control.c +2 −0
  1020. sound/core/init.c +10 −4
  1021. sound/core/oss/mixer_oss.c +2 −2
  1022. sound/core/oss/rate.c +1 −1
  1023. sound/core/pcm_native.c +1 −1
  1024. sound/core/sound.c +1 −1
  1025. sound/hda/hdac_stream.c +6 −1
  1026. sound/hda/intel-sdw-acpi.c +22 −11
  1027. sound/isa/gus/gus_pcm.c +2 −2
  1028. sound/pci/hda/cs35l41_hda_i2c.c +1 −1
  1029. sound/pci/hda/hda_codec.c +1 −1
  1030. sound/pci/hda/hda_controller.c +1 −2
  1031. sound/pci/hda/hda_controller.h +1 −1
  1032. sound/pci/hda/hda_generic.c +2 −2
  1033. sound/pci/hda/hda_generic.h +0 −1
  1034. sound/pci/hda/hda_intel.c +1 −9
  1035. sound/pci/hda/patch_conexant.c +46 −13
  1036. sound/pci/hda/patch_cs8409.c +3 −2
  1037. sound/pci/hda/patch_realtek.c +84 −4
  1038. sound/pci/hda/tas2781_hda_i2c.c +1 −1
  1039. sound/soc/amd/acp/acp-sdw-sof-mach.c +0 −5
  1040. sound/soc/amd/yc/acp6x-mach.c +7 −0
  1041. sound/soc/atmel/mchp-pdmc.c +3 −0
  1042. sound/soc/codecs/cs35l45-tables.c +1 −1
  1043. sound/soc/codecs/cs35l45.h +1 −1
  1044. sound/soc/codecs/lpass-rx-macro.c +1 −1
  1045. sound/soc/fsl/fsl_sai.c +4 −1
  1046. sound/soc/fsl/fsl_sai.h +1 −0
  1047. sound/soc/fsl/imx-card.c +1 −0
  1048. sound/soc/intel/boards/sof_sdw.c +12 −0
  1049. sound/soc/intel/common/soc-acpi-intel-arl-match.c +2 −0
  1050. sound/soc/intel/common/soc-acpi-intel-rpl-match.c +1 −0
  1051. sound/soc/qcom/sm8250.c +1 −0
  1052. sound/soc/soc-topology.c +2 −2
  1053. sound/usb/line6/capture.c +1 −1
  1054. sound/usb/line6/capture.h +1 −1
  1055. sound/usb/line6/driver.c +2 −2
  1056. sound/usb/line6/driver.h +1 −1
  1057. sound/usb/line6/midi.c +1 −1
  1058. sound/usb/line6/midi.h +1 −1
  1059. sound/usb/line6/midibuf.c +1 −1
  1060. sound/usb/line6/midibuf.h +1 −1
  1061. sound/usb/line6/pcm.c +1 −1
  1062. sound/usb/line6/pcm.h +1 −1
  1063. sound/usb/line6/playback.c +1 −1
  1064. sound/usb/line6/playback.h +1 −1
  1065. sound/usb/line6/pod.c +1 −1
  1066. sound/usb/line6/podhd.c +1 −1
  1067. sound/usb/line6/toneport.c +1 −1
  1068. sound/usb/line6/variax.c +1 −1
  1069. sound/usb/mixer_scarlett2.c +2 −0
  1070. sound/usb/quirks.c +4 −0
  1071. sound/usb/stream.c +1 −0
  1072. tools/arch/arm64/include/asm/cputype.h +2 −0
  1073. tools/arch/arm64/vdso +0 −1
  1074. tools/arch/loongarch/vdso +0 −1
  1075. tools/arch/powerpc/vdso +0 −1
  1076. tools/arch/s390/vdso +0 −1
  1077. tools/arch/x86/include/asm/msr-index.h +2 −0
  1078. tools/arch/x86/vdso +0 −1
  1079. tools/build/feature/Makefile +4 −1
  1080. tools/include/uapi/linux/bpf.h +13 −12
  1081. tools/include/uapi/linux/in.h +1 −1
  1082. tools/perf/Makefile.config +5 −2
  1083. tools/perf/check-header_ignore_hunks/lib/list_sort.c +31 −0
  1084. tools/perf/check-headers.sh +28 −1
  1085. tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h +2 −2
  1086. tools/perf/trace/beauty/fs_at_flags.sh +5 −0
  1087. tools/perf/trace/beauty/include/linux/socket.h +1 −0
  1088. tools/perf/trace/beauty/include/uapi/linux/fcntl.h +60 −24
  1089. tools/perf/trace/beauty/include/uapi/linux/sched.h +1 −0
  1090. tools/perf/trace/beauty/include/uapi/sound/asound.h +16 −1
  1091. tools/perf/trace/beauty/msg_flags.c +4 −0
  1092. tools/perf/util/cs-etm.c +1 −1
  1093. tools/perf/util/dwarf-aux.h +1 −0
  1094. tools/perf/util/symbol.c +3 −0
  1095. tools/perf/util/vdso.c +3 −1
  1096. tools/sched_ext/include/scx/common.bpf.h +3 −3
  1097. tools/sched_ext/scx_qmap.bpf.c +2 −2
  1098. tools/testing/radix-tree/maple.c +110 −0
  1099. tools/testing/selftests/Makefile +5 −4
  1100. tools/testing/selftests/alsa/Makefile +4 −0
  1101. tools/testing/selftests/bpf/Makefile +20 −2
  1102. tools/testing/selftests/bpf/bpf_test_modorder_x/Makefile +19 −0
  1103. tools/testing/selftests/bpf/bpf_test_modorder_x/bpf_test_modorder_x.c +39 −0
  1104. tools/testing/selftests/bpf/bpf_test_modorder_y/Makefile +19 −0
  1105. tools/testing/selftests/bpf/bpf_test_modorder_y/bpf_test_modorder_y.c +39 −0
  1106. tools/testing/selftests/bpf/prog_tests/bpf_iter.c +22 −5
  1107. tools/testing/selftests/bpf/prog_tests/cgroup_ancestor.c +1 −1
  1108. tools/testing/selftests/bpf/prog_tests/cpumask.c +1 −0
  1109. tools/testing/selftests/bpf/prog_tests/fill_link_info.c +15 −3
  1110. tools/testing/selftests/bpf/prog_tests/kfunc_module_order.c +55 −0
  1111. tools/testing/selftests/bpf/prog_tests/netfilter_link_attach.c +40 −2
  1112. tools/testing/selftests/bpf/prog_tests/verifier.c +21 −0
  1113. tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c +117 −8
  1114. tools/testing/selftests/bpf/progs/cpumask_common.h +5 −0
  1115. tools/testing/selftests/bpf/progs/cpumask_failure.c +35 −0
  1116. tools/testing/selftests/bpf/progs/cpumask_success.c +76 −2
  1117. tools/testing/selftests/bpf/progs/kfunc_module_order.c +30 −0
  1118. tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c +1 −1
  1119. tools/testing/selftests/bpf/progs/verifier_const.c +30 −1
  1120. tools/testing/selftests/bpf/progs/verifier_linked_scalars.c +34 −0
  1121. tools/testing/selftests/bpf/progs/verifier_movsx.c +40 −0
  1122. tools/testing/selftests/bpf/progs/verifier_mtu.c +18 −0
  1123. tools/testing/selftests/bpf/progs/verifier_scalar_ids.c +67 −0
  1124. tools/testing/selftests/bpf/testing_helpers.c +22 −12
  1125. tools/testing/selftests/bpf/testing_helpers.h +2 −0
  1126. tools/testing/selftests/breakpoints/step_after_suspend_test.c +4 −1
  1127. tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +0 −2
  1128. tools/testing/selftests/core/.gitignore +1 −0
  1129. tools/testing/selftests/devices/probe/test_discoverable_devices.py +2 −2
  1130. tools/testing/selftests/exec/.gitignore +2 −1
  1131. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-profiler.tc +31 −0
  1132. tools/testing/selftests/hid/Makefile +3 −0
  1133. tools/testing/selftests/kvm/Makefile +3 −0
  1134. tools/testing/selftests/kvm/aarch64/set_id_regs.c +13 −3
  1135. tools/testing/selftests/kvm/memslot_modification_stress_test.c +2 −0
  1136. tools/testing/selftests/kvm/memslot_perf_test.c +6 −0
  1137. tools/testing/selftests/kvm/x86_64/cpuid_test.c +1 −1
  1138. tools/testing/selftests/mm/hmm-tests.c +1 −1
  1139. tools/testing/selftests/mm/khugepaged.c +1 −1
  1140. tools/testing/selftests/mm/uffd-common.c +3 −2
  1141. tools/testing/selftests/mm/uffd-common.h +1 −2
  1142. tools/testing/selftests/mm/uffd-unit-tests.c +15 −6
  1143. tools/testing/selftests/net/.gitignore +1 −0
  1144. tools/testing/selftests/net/forwarding/no_forwarding.sh +1 −1
  1145. tools/testing/selftests/net/lib/py/nsim.py +1 −0
  1146. tools/testing/selftests/net/mptcp/mptcp_join.sh +85 −30
  1147. tools/testing/selftests/net/netfilter/Makefile +1 −0
  1148. tools/testing/selftests/net/netfilter/config +2 −0
  1149. tools/testing/selftests/net/netfilter/conntrack_vrf.sh +33 −0
  1150. tools/testing/selftests/net/netfilter/vxlan_mtu_frag.sh +121 −0
  1151. tools/testing/selftests/net/rds/.gitignore +1 −0
  1152. tools/testing/selftests/net/rds/Makefile +1 −1
  1153. tools/testing/selftests/net/rds/test.py +4 −1
  1154. tools/testing/selftests/net/ynl.mk +4 −0
  1155. tools/testing/selftests/rseq/rseq.c +75 −35
  1156. tools/testing/selftests/rseq/rseq.h +2 −8
  1157. tools/testing/selftests/rtc/rtctest.c +10 −1
  1158. tools/testing/selftests/sched_ext/Makefile +32 −39
  1159. tools/testing/selftests/timers/posix_timers.c +8 −4
  1160. tools/testing/selftests/vDSO/Makefile +2 −4
  1161. tools/testing/selftests/vDSO/vdso_test_chacha.c +21 −15
  1162. tools/testing/selftests/vDSO/vdso_test_getrandom.c +39 −45
  1163. tools/testing/selftests/vDSO/vgetrandom-chacha.S +18 −0
  1164. tools/tracing/rtla/Makefile.rtla +1 −1
  1165. tools/tracing/rtla/src/osnoise_top.c +1 −1
  1166. tools/tracing/rtla/src/timerlat_top.c +2 −2
  1167. virt/kvm/kvm_main.c +1 −13
.mailmap+11−0
@@ -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>
@@ -203,12 +205,16 @@ Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> <ezequiel@collabora.com> · 124 unmodified lines
203205 Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
204206 Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@intel.com>
205207 Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@collabora.com>
208+Fangrui Song <i@maskray.me> <maskray@google.com>
206209 Felipe W Damasio <felipewd@terra.com.br>
207210 Felix Kuhling <fxkuehl@gmx.de>
208211 Felix Moeller <felix@derklecks.de>
209212 Fenglin Wu <quic_fenglinw@quicinc.com> <fenglinw@codeaurora.org>
210213 Filipe Lautert <filipe@icewall.org>
211214 Finn Thain <fthain@linux-m68k.org> <fthain@telegraphics.com.au>
215+Fiona Behrens <me@kloenk.dev>
216+Fiona Behrens <me@kloenk.dev> <me@kloenk.de>
217+Fiona Behrens <me@kloenk.dev> <fin@nyantec.com>
212218 Franck Bui-Huu <vagabon.xyz@gmail.com>
213219 Frank Rowand <frowand.list@gmail.com> <frank.rowand@am.sony.com>
214220 Frank Rowand <frowand.list@gmail.com> <frank.rowand@sony.com>
@@ -300,6 +306,11 @@ Jens Axboe <axboe@kernel.dk> <axboe@fb.com> · 85 unmodified lines
300306 Jens Axboe <axboe@kernel.dk> <axboe@meta.com>
301307 Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
302308 Jernej Skrabec <jernej.skrabec@gmail.com> <jernej.skrabec@siol.net>
309+Jesper Dangaard Brouer <hawk@kernel.org> <brouer@redhat.com>
310+Jesper Dangaard Brouer <hawk@kernel.org> <hawk@comx.dk>
311+Jesper Dangaard Brouer <hawk@kernel.org> <jbrouer@redhat.com>
312+Jesper Dangaard Brouer <hawk@kernel.org> <jdb@comx.dk>
313+Jesper Dangaard Brouer <hawk@kernel.org> <netoptimizer@brouer.com>
303314 Jessica Zhang <quic_jesszhan@quicinc.com> <jesszhan@codeaurora.org>
304315 Jilai Wang <quic_jilaiw@quicinc.com> <jilaiw@codeaurora.org>
305316 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/arch/arm64/silicon-errata.rst+6−0
@@ -146,6 +146,8 @@ stable kernels. · 145 unmodified lines
146146 +----------------+-----------------+-----------------+-----------------------------+
147147 | ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 |
148148 +----------------+-----------------+-----------------+-----------------------------+
149+| ARM | Cortex-A715 | #3456084 | ARM64_ERRATUM_3194386 |
150++----------------+-----------------+-----------------+-----------------------------+
149151 | ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
150152 +----------------+-----------------+-----------------+-----------------------------+
151153 | ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
@@ -186,6 +188,8 @@ stable kernels. · 34 unmodified lines
186188 +----------------+-----------------+-----------------+-----------------------------+
187189 | ARM | Neoverse-N2 | #3324339 | ARM64_ERRATUM_3194386 |
188190 +----------------+-----------------+-----------------+-----------------------------+
191+| ARM | Neoverse-N3 | #3456111 | ARM64_ERRATUM_3194386 |
192++----------------+-----------------+-----------------+-----------------------------+
189193 | ARM | Neoverse-V1 | #1619801 | N/A |
190194 +----------------+-----------------+-----------------+-----------------------------+
191195 | ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
@@ -289,3 +293,5 @@ stable kernels. · 97 unmodified lines
289293 +----------------+-----------------+-----------------+-----------------------------+
290294 | Microsoft | Azure Cobalt 100| #2253138 | ARM64_ERRATUM_2253138 |
291295 +----------------+-----------------+-----------------+-----------------------------+
296+| Microsoft | Azure Cobalt 100| #3324339 | ARM64_ERRATUM_3194386 |
297++----------------+-----------------+-----------------+-----------------------------+
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/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/sound/davinci-mcasp-audio.yaml+1−1
@@ -102,7 +102,7 @@ properties: · 101 unmodified lines
102102 default: 2
103103
104104 interrupts:
105− anyOf:
105+ oneOf:
106106 - minItems: 1
107107 items:
108108 - description: TX interrupt
Documentation/devicetree/bindings/sound/qcom,sm8250.yaml+1−0
@@ -30,6 +30,7 @@ properties: · 29 unmodified lines
3030 - qcom,apq8096-sndcard
3131 - qcom,qcm6490-idp-sndcard
3232 - qcom,qcs6490-rb3gen2-sndcard
33+ - qcom,qrb4210-rb2-sndcard
3334 - qcom,qrb5165-rb5-sndcard
3435 - qcom,sc7180-qdsp6-sndcard
3536 - qcom,sc8280xp-sndcard
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml+1−1
@@ -302,7 +302,7 @@ allOf: · 301 unmodified lines
302302 reg-names:
303303 items:
304304 enum:
305− - scu
305+ - sru
306306 - ssi
307307 - adg
308308 # for Gen2/Gen3
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/driver-api/wmi.rst+5−6
@@ -7,12 +7,11 @@ WMI Driver API · 6 unmodified lines
77 The WMI driver core supports a more modern bus-based interface for interacting
88 with WMI devices, and an older GUID-based interface. The latter interface is
99 considered to be deprecated, so new WMI drivers should generally avoid it since
10−it has some issues with multiple WMI devices and events sharing the same GUIDs
11−and/or notification IDs. The modern bus-based interface instead maps each
12−WMI device to a :c:type:`struct wmi_device <wmi_device>`, so it supports
13−WMI devices sharing GUIDs and/or notification IDs. Drivers can then register
14−a :c:type:`struct wmi_driver <wmi_driver>`, which will be bound to compatible
15−WMI devices by the driver core.
10+it has some issues with multiple WMI devices sharing the same GUID.
11+The modern bus-based interface instead maps each WMI device to a
12+:c:type:`struct wmi_device <wmi_device>`, so it supports WMI devices sharing the
13+same GUID. Drivers can then register a :c:type:`struct wmi_driver <wmi_driver>`
14+which will be bound to compatible WMI devices by the driver core.
1615
1716 .. kernel-doc:: include/linux/wmi.h
1817 :internal:
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/gpu/drm-kms-helpers.rst+2−2
@@ -181,7 +181,7 @@ Bridge Operations · 180 unmodified lines
181181 Bridge Connector Helper
182182 -----------------------
183183
184−.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c
184+.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
185185 :doc: overview
186186
187187
@@ -204,7 +204,7 @@ MIPI-DSI bridge operation · 16 unmodified lines
204204 Bridge Connector Helper Reference
205205 ---------------------------------
206206
207−.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c
207+.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
208208 :export:
209209
210210 Panel-Bridge Helper Reference
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/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/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/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.
Documentation/wmi/devices/dell-wmi-ddv.rst+2−2
@@ -8,7 +8,7 @@ Introduction · 7 unmodified lines
88 ============
99
1010 Many Dell notebooks made after ~2020 support a WMI-based interface for
11−retrieving various system data like battery temperature, ePPID, diagostic data
11+retrieving various system data like battery temperature, ePPID, diagnostic data
1212 and fan/thermal sensor data.
1313
1414 This interface is likely used by the `Dell Data Vault` software on Windows,
@@ -277,7 +277,7 @@ Reverse-Engineering the DDV WMI interface · 262 unmodified lines
277277 4. Try to deduce the meaning of a certain WMI method by comparing the control
278278 flow with other ACPI methods (_BIX or _BIF for battery related methods
279279 for example).
280−5. Use the built-in UEFI diagostics to view sensor types/values for fan/thermal
280+5. Use the built-in UEFI diagnostics to view sensor types/values for fan/thermal
281281 related methods (sometimes overwriting static ACPI data fields can be used
282282 to test different sensor type values, since on some machines this data is
283283 not reinitialized upon a warm reset).
MAINTAINERS+101−239
@@ -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
@@ -860,7 +854,7 @@ F: drivers/crypto/allwinner/ · 590 unmodified lines
860854
861855 ALLWINNER DMIC DRIVERS
862856 M: Ban Tao <fengzheng923@gmail.com>
863−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
857+L: linux-sound@vger.kernel.org
864858 S: Maintained
865859 F: Documentation/devicetree/bindings/sound/allwinner,sun50i-h6-dmic.yaml
866860 F: sound/soc/sunxi/sun50i-dmic.c
@@ -888,7 +882,6 @@ F: drivers/staging/media/sunxi/cedrus/ · 21 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
@@ -1517,7 +1510,7 @@ F: drivers/iio/gyro/adxrs290.c · 622 unmodified lines
15171510 ANALOG DEVICES INC ASOC CODEC DRIVERS
15181511 M: Lars-Peter Clausen <lars@metafoo.de>
15191512 M: Nuno Sá <nuno.sa@analog.com>
1520−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1513+L: linux-sound@vger.kernel.org
15211514 S: Supported
15221515 W: http://wiki.analog.com/
15231516 W: https://ez.analog.com/linux-software-drivers
@@ -1594,7 +1587,7 @@ F: drivers/rtc/rtc-goldfish.c · 70 unmodified lines
15941587 AOA (Apple Onboard Audio) ALSA DRIVER
15951588 M: Johannes Berg <johannes@sipsolutions.net>
15961589 L: linuxppc-dev@lists.ozlabs.org
1597−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1590+L: linux-sound@vger.kernel.org
15981591 S: Maintained
15991592 F: sound/aoa/
16001593
@@ -1761,8 +1754,8 @@ F: include/uapi/linux/if_arcnet.h · 160 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
@@ -2091,7 +2084,7 @@ F: drivers/crypto/amlogic/ · 322 unmodified lines
20912084
20922085 ARM/Amlogic Meson SoC Sound Drivers
20932086 M: Jerome Brunet <jbrunet@baylibre.com>
2094−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
2087+L: linux-sound@vger.kernel.org
20952088 S: Maintained
20962089 F: Documentation/devicetree/bindings/sound/amlogic*
20972090 F: sound/soc/meson/
@@ -2129,7 +2122,7 @@ F: drivers/*/*alpine* · 31 unmodified lines
21292122 ARM/APPLE MACHINE SOUND DRIVERS
21302123 M: Martin Povišer <povik+lin@cutebit.org>
21312124 L: asahi@lists.linux.dev
2132−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
2125+L: linux-sound@vger.kernel.org
21332126 S: Maintained
21342127 F: Documentation/devicetree/bindings/sound/adi,ssm3515.yaml
21352128 F: Documentation/devicetree/bindings/sound/apple,*
@@ -2263,12 +2256,6 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) · 127 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>
@@ -3732,7 +3719,7 @@ F: arch/arm/boot/dts/microchip/at91-tse850-3.dts · 1457 unmodified lines
37323719
37333720 AXENTIA ASOC DRIVERS
37343721 M: Peter Rosin <peda@axentia.se>
3735−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
3722+L: linux-sound@vger.kernel.org
37363723 S: Maintained
37373724 F: Documentation/devicetree/bindings/sound/axentia,*
37383725 F: sound/soc/atmel/tse850-pcm5142.c
@@ -3815,14 +3802,6 @@ F: drivers/video/backlight/ · 76 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>
@@ -4851,7 +4830,7 @@ F: include/uapi/linux/bsg.h · 1022 unmodified lines
48514830
48524831 BT87X AUDIO DRIVER
48534832 M: Clemens Ladisch <clemens@ladisch.de>
4854−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
4833+L: linux-sound@vger.kernel.org
48554834 S: Maintained
48564835 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
48574836 F: Documentation/sound/cards/bt87x.rst
@@ -4913,7 +4892,7 @@ F: drivers/net/can/bxcan.c · 55 unmodified lines
49134892
49144893 C-MEDIA CMI8788 DRIVER
49154894 M: Clemens Ladisch <clemens@ladisch.de>
4916−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
4895+L: linux-sound@vger.kernel.org
49174896 S: Maintained
49184897 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
49194898 F: sound/pci/oxygen/
@@ -6476,7 +6455,6 @@ F: drivers/mtd/nand/raw/denali* · 1556 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/
@@ -7832,6 +7810,8 @@ F: drivers/gpu/drm/xlnx/ · 1349 unmodified lines
78327810 DRM GPU SCHEDULER
78337811 M: Luben Tuikov <ltuikov89@gmail.com>
78347812 M: Matthew Brost <matthew.brost@intel.com>
7813+M: Danilo Krummrich <dakr@kernel.org>
7814+M: Philipp Stanner <pstanner@redhat.com>
78357815 L: dri-devel@lists.freedesktop.org
78367816 S: Maintained
78377817 T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
@@ -8252,7 +8232,7 @@ F: drivers/edac/ti_edac.c · 414 unmodified lines
82528232
82538233 EDIROL UA-101/UA-1000 DRIVER
82548234 M: Clemens Ladisch <clemens@ladisch.de>
8255−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
8235+L: linux-sound@vger.kernel.org
82568236 S: Maintained
82578237 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
82588238 F: sound/usb/misc/ua101.c
@@ -8814,7 +8794,7 @@ F: drivers/net/can/usb/f81604.c · 555 unmodified lines
88148794 FIREWIRE AUDIO DRIVERS and IEC 61883-1/6 PACKET STREAMING ENGINE
88158795 M: Clemens Ladisch <clemens@ladisch.de>
88168796 M: Takashi Sakamoto <o-takashi@sakamocchi.jp>
8817−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
8797+L: linux-sound@vger.kernel.org
88188798 S: Maintained
88198799 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
88208800 F: include/uapi/sound/firewire.h
@@ -8888,7 +8868,7 @@ F: drivers/input/joystick/fsia6b.c · 67 unmodified lines
88888868
88898869 FOCUSRITE SCARLETT2 MIXER DRIVER (Scarlett Gen 2+ and Clarett)
88908870 M: Geoffrey D. Bennett <g@b4.vu>
8891−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
8871+L: linux-sound@vger.kernel.org
88928872 S: Maintained
88938873 W: https://github.com/geoffreybennett/scarlett-gen2
88948874 B: https://github.com/geoffreybennett/scarlett-gen2/issues
@@ -8912,6 +8892,7 @@ F: include/linux/fortify-string.h · 17 unmodified lines
89128892 F: lib/fortify_kunit.c
89138893 F: lib/memcpy_kunit.c
89148894 F: lib/test_fortify/*
8895+K: \bunsafe_memcpy\b
89158896 K: \b__NO_FORTIFY\b
89168897
89178898 FPGA DFL DRIVERS
@@ -9209,7 +9190,7 @@ M: Shengjiu Wang <shengjiu.wang@gmail.com> · 291 unmodified lines
92099190 M: Xiubo Li <Xiubo.Lee@gmail.com>
92109191 R: Fabio Estevam <festevam@gmail.com>
92119192 R: Nicolin Chen <nicoleotsuka@gmail.com>
9212−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
9193+L: linux-sound@vger.kernel.org
92139194 L: linuxppc-dev@lists.ozlabs.org
92149195 S: Maintained
92159196 F: sound/soc/fsl/fsl*
@@ -9219,7 +9200,7 @@ FREESCALE SOC LPC32XX SOUND DRIVERS · 3 unmodified lines
92199200 M: J.M.B. Downing <jonathan.downing@nautel.com>
92209201 M: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
92219202 R: Vladimir Zapolskiy <vz@mleia.com>
9222−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
9203+L: linux-sound@vger.kernel.org
92239204 L: linuxppc-dev@lists.ozlabs.org
92249205 S: Maintained
92259206 F: Documentation/devicetree/bindings/sound/nxp,lpc3220-i2s.yaml
@@ -9227,7 +9208,7 @@ F: sound/soc/fsl/lpc3xxx-* · 1 unmodified line
92279208
92289209 FREESCALE SOC SOUND QMC DRIVER
92299210 M: Herve Codina <herve.codina@bootlin.com>
9230−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
9211+L: linux-sound@vger.kernel.org
92319212 L: linuxppc-dev@lists.ozlabs.org
92329213 S: Maintained
92339214 F: Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
@@ -9756,14 +9737,6 @@ F: drivers/gpio/gpiolib-cdev.c · 522 unmodified lines
97569737 F: include/uapi/linux/gpio.h
97579738 F: tools/gpio/
97589739
9759−GRE DEMULTIPLEXER DRIVER
9760−M: Dmitry Kozlov <xeb@mail.ru>
9761−L: netdev@vger.kernel.org
9762−S: Maintained
9763−F: include/net/gre.h
9764−F: net/ipv4/gre_demux.c
9765−F: net/ipv4/gre_offload.c
9766−
97679740 GRETH 10/100/1G Ethernet MAC device driver
97689741 M: Andreas Larsson <andreas@gaisler.com>
97699742 L: netdev@vger.kernel.org
@@ -10267,7 +10240,7 @@ F: Documentation/devicetree/bindings/arm/hisilicon/low-pin-count.yaml · 497 unmodified lines
1026710240 F: drivers/bus/hisi_lpc.c
1026810241
1026910242 HISILICON NETWORK SUBSYSTEM 3 DRIVER (HNS3)
10270−M: Yisen Zhuang <yisen.zhuang@huawei.com>
10243+M: Jian Shen <shenjian15@huawei.com>
1027110244 M: Salil Mehta <salil.mehta@huawei.com>
1027210245 M: Jijie Shao <shaojijie@huawei.com>
1027310246 L: netdev@vger.kernel.org
@@ -10276,7 +10249,7 @@ W: http://www.hisilicon.com · 2 unmodified lines
1027610249 F: drivers/net/ethernet/hisilicon/hns3/
1027710250
1027810251 HISILICON NETWORK SUBSYSTEM DRIVER
10279−M: Yisen Zhuang <yisen.zhuang@huawei.com>
10252+M: Jian Shen <shenjian15@huawei.com>
1028010253 M: Salil Mehta <salil.mehta@huawei.com>
1028110254 L: netdev@vger.kernel.org
1028210255 S: Maintained
@@ -11154,7 +11127,7 @@ F: drivers/iio/pressure/dps310.c · 871 unmodified lines
1115411127
1115511128 INFINEON PEB2466 ASoC CODEC
1115611129 M: Herve Codina <herve.codina@bootlin.com>
11157−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
11130+L: linux-sound@vger.kernel.org
1115811131 S: Maintained
1115911132 F: Documentation/devicetree/bindings/sound/infineon,peb2466.yaml
1116011133 F: sound/soc/codecs/peb2466.c
@@ -11280,10 +11253,10 @@ F: security/integrity/ · 119 unmodified lines
1128011253 F: security/integrity/ima/
1128111254
1128211255 INTEGRITY POLICY ENFORCEMENT (IPE)
11283−M: Fan Wu <wufan@linux.microsoft.com>
11256+M: Fan Wu <wufan@kernel.org>
1128411257 L: linux-security-module@vger.kernel.org
1128511258 S: Supported
11286−T: git https://github.com/microsoft/ipe.git
11259+T: git git://git.kernel.org/pub/scm/linux/kernel/git/wufan/ipe.git
1128711260 F: Documentation/admin-guide/LSM/ipe.rst
1128811261 F: Documentation/security/ipe.rst
1128911262 F: scripts/ipe/
@@ -11317,7 +11290,7 @@ M: Bard Liao <yung-chuan.liao@linux.intel.com> · 27 unmodified lines
1131711290 M: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1131811291 M: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1131911292 R: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
11320−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
11293+L: linux-sound@vger.kernel.org
1132111294 S: Supported
1132211295 F: sound/soc/intel/
1132311296
@@ -11496,7 +11469,7 @@ F: include/uapi/linux/idxd.h · 172 unmodified lines
1149611469
1149711470 INTEL IN FIELD SCAN (IFS) DEVICE
1149811471 M: Jithu Joseph <jithu.joseph@intel.com>
11499−R: Ashok Raj <ashok.raj@intel.com>
11472+R: Ashok Raj <ashok.raj.linux@gmail.com>
1150011473 R: Tony Luck <tony.luck@intel.com>
1150111474 S: Maintained
1150211475 F: drivers/platform/x86/intel/ifs
@@ -11601,6 +11574,16 @@ F: drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c · 98 unmodified lines
1160111574 F: drivers/crypto/intel/keembay/ocs-hcu.c
1160211575 F: drivers/crypto/intel/keembay/ocs-hcu.h
1160311576
11577+INTEL LA JOLLA COVE ADAPTER (LJCA) USB I/O EXPANDER DRIVERS
11578+M: Wentong Wu <wentong.wu@intel.com>
11579+M: Sakari Ailus <sakari.ailus@linux.intel.com>
11580+S: Maintained
11581+F: drivers/gpio/gpio-ljca.c
11582+F: drivers/i2c/busses/i2c-ljca.c
11583+F: drivers/spi/spi-ljca.c
11584+F: drivers/usb/misc/usb-ljca.c
11585+F: include/linux/usb/ljca.h
11586+
1160411587 INTEL MANAGEMENT ENGINE (mei)
1160511588 M: Tomas Winkler <tomas.winkler@intel.com>
1160611589 L: linux-kernel@vger.kernel.org
@@ -12001,7 +11984,7 @@ F: drivers/tty/ipwireless/ · 394 unmodified lines
1200111984
1200211985 IRON DEVICE AUDIO CODEC DRIVERS
1200311986 M: Kiseok Jo <kiseok.jo@irondevice.com>
12004−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
11987+L: linux-sound@vger.kernel.org
1200511988 S: Maintained
1200611989 F: Documentation/devicetree/bindings/sound/irondevice,*
1200711990 F: sound/soc/codecs/sma*
@@ -12239,6 +12222,7 @@ R: Dmitry Vyukov <dvyukov@google.com> · 231 unmodified lines
1223912222 R: Vincenzo Frascino <vincenzo.frascino@arm.com>
1224012223 L: kasan-dev@googlegroups.com
1224112224 S: Maintained
12225+B: https://bugzilla.kernel.org/buglist.cgi?component=Sanitizers&product=Memory%20Management
1224212226 F: Documentation/dev-tools/kasan.rst
1224312227 F: arch/*/include/asm/*kasan.h
1224412228 F: arch/*/mm/kasan_init*
@@ -12262,6 +12246,7 @@ R: Dmitry Vyukov <dvyukov@google.com> · 17 unmodified lines
1226212246 R: Andrey Konovalov <andreyknvl@gmail.com>
1226312247 L: kasan-dev@googlegroups.com
1226412248 S: Maintained
12249+B: https://bugzilla.kernel.org/buglist.cgi?component=Sanitizers&product=Memory%20Management
1226512250 F: Documentation/dev-tools/kcov.rst
1226612251 F: include/linux/kcov.h
1226712252 F: include/uapi/linux/kcov.h
@@ -12343,6 +12328,7 @@ F: include/linux/randomize_kstack.h · 75 unmodified lines
1234312328 F: kernel/configs/hardening.config
1234412329 F: lib/usercopy_kunit.c
1234512330 F: mm/usercopy.c
12331+F: security/Kconfig.hardening
1234612332 K: \b(add|choose)_random_kstack_offset\b
1234712333 K: \b__check_(object_size|heap_object)\b
1234812334 K: \b__counted_by\b
@@ -12459,7 +12445,7 @@ F: virt/kvm/* · 110 unmodified lines
1245912445 KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
1246012446 M: Marc Zyngier <maz@kernel.org>
1246112447 M: Oliver Upton <oliver.upton@linux.dev>
12462−R: James Morse <james.morse@arm.com>
12448+R: Joey Gouly <joey.gouly@arm.com>
1246312449 R: Suzuki K Poulose <suzuki.poulose@arm.com>
1246412450 R: Zenghui Yu <yuzenghui@huawei.com>
1246512451 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -12940,49 +12926,29 @@ LIBATA PATA ARASAN COMPACT FLASH CONTROLLER · 474 unmodified lines
1294012926 M: Viresh Kumar <vireshk@kernel.org>
1294112927 L: linux-ide@vger.kernel.org
1294212928 S: Maintained
12943−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1294412929 F: drivers/ata/pata_arasan_cf.c
1294512930 F: include/linux/pata_arasan_cf_data.h
1294612931
12947−LIBATA PATA DRIVERS
12948−R: Sergey Shtylyov <s.shtylyov@omp.ru>
12949−L: linux-ide@vger.kernel.org
12950−F: drivers/ata/ata_*.c
12951−F: drivers/ata/pata_*.c
12952−
1295312932 LIBATA PATA FARADAY FTIDE010 AND GEMINI SATA BRIDGE DRIVERS
1295412933 M: Linus Walleij <linus.walleij@linaro.org>
1295512934 L: linux-ide@vger.kernel.org
1295612935 S: Maintained
12957−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1295812936 F: drivers/ata/pata_ftide010.c
1295912937 F: drivers/ata/sata_gemini.c
1296012938 F: drivers/ata/sata_gemini.h
1296112939
1296212940 LIBATA SATA AHCI PLATFORM devices support
1296312941 M: Hans de Goede <hdegoede@redhat.com>
12964−M: Jens Axboe <axboe@kernel.dk>
1296512942 L: linux-ide@vger.kernel.org
1296612943 S: Maintained
12967−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1296812944 F: drivers/ata/ahci_platform.c
1296912945 F: drivers/ata/libahci_platform.c
1297012946 F: include/linux/ahci_platform.h
1297112947
12972−LIBATA SATA AHCI SYNOPSYS DWC CONTROLLER DRIVER
12973−M: Serge Semin <fancer.lancer@gmail.com>
12974−L: linux-ide@vger.kernel.org
12975−S: Maintained
12976−T: git git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata.git
12977−F: Documentation/devicetree/bindings/ata/baikal,bt1-ahci.yaml
12978−F: Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
12979−F: drivers/ata/ahci_dwc.c
12980−
1298112948 LIBATA SATA PROMISE TX2/TX4 CONTROLLER DRIVER
1298212949 M: Mikael Pettersson <mikpelinux@gmail.com>
1298312950 L: linux-ide@vger.kernel.org
1298412951 S: Maintained
12985−T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
1298612952 F: drivers/ata/sata_promise.*
1298712953
1298812954 LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)
@@ -13952,7 +13918,7 @@ F: drivers/media/i2c/max96717.c · 963 unmodified lines
1395213918
1395313919 MAX9860 MONO AUDIO VOICE CODEC DRIVER
1395413920 M: Peter Rosin <peda@axentia.se>
13955−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
13921+L: linux-sound@vger.kernel.org
1395613922 S: Maintained
1395713923 F: Documentation/devicetree/bindings/sound/max9860.txt
1395813924 F: sound/soc/codecs/max9860.*
@@ -14174,16 +14140,6 @@ S: Maintained · 215 unmodified lines
1417414140 T: git git://linuxtv.org/media_tree.git
1417514141 F: drivers/media/platform/nxp/imx-pxp.[ch]
1417614142
14177−MEDIA DRIVERS FOR ASCOT2E
14178−M: Sergey Kozlov <serjk@netup.ru>
14179−M: Abylay Ospan <aospan@netup.ru>
14180−L: linux-media@vger.kernel.org
14181−S: Supported
14182−W: https://linuxtv.org
14183−W: http://netup.tv/
14184−T: git git://linuxtv.org/media_tree.git
14185−F: drivers/media/dvb-frontends/ascot2e*
14186−
1418714143 MEDIA DRIVERS FOR CXD2099AR CI CONTROLLERS
1418814144 M: Jasmin Jessich <jasmin@anw.at>
1418914145 L: linux-media@vger.kernel.org
@@ -14192,16 +14148,6 @@ W: https://linuxtv.org · 2 unmodified lines
1419214148 T: git git://linuxtv.org/media_tree.git
1419314149 F: drivers/media/dvb-frontends/cxd2099*
1419414150
14195−MEDIA DRIVERS FOR CXD2841ER
14196−M: Sergey Kozlov <serjk@netup.ru>
14197−M: Abylay Ospan <aospan@netup.ru>
14198−L: linux-media@vger.kernel.org
14199−S: Supported
14200−W: https://linuxtv.org
14201−W: http://netup.tv/
14202−T: git git://linuxtv.org/media_tree.git
14203−F: drivers/media/dvb-frontends/cxd2841er*
14204−
1420514151 MEDIA DRIVERS FOR CXD2880
1420614152 M: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>
1420714153 L: linux-media@vger.kernel.org
@@ -14246,35 +14192,6 @@ F: drivers/media/platform/nxp/imx-mipi-csis.c · 38 unmodified lines
1424614192 F: drivers/media/platform/nxp/imx7-media-csi.c
1424714193 F: drivers/media/platform/nxp/imx8mq-mipi-csi2.c
1424814194
14249−MEDIA DRIVERS FOR HELENE
14250−M: Abylay Ospan <aospan@netup.ru>
14251−L: linux-media@vger.kernel.org
14252−S: Supported
14253−W: https://linuxtv.org
14254−W: http://netup.tv/
14255−T: git git://linuxtv.org/media_tree.git
14256−F: drivers/media/dvb-frontends/helene*
14257−
14258−MEDIA DRIVERS FOR HORUS3A
14259−M: Sergey Kozlov <serjk@netup.ru>
14260−M: Abylay Ospan <aospan@netup.ru>
14261−L: linux-media@vger.kernel.org
14262−S: Supported
14263−W: https://linuxtv.org
14264−W: http://netup.tv/
14265−T: git git://linuxtv.org/media_tree.git
14266−F: drivers/media/dvb-frontends/horus3a*
14267−
14268−MEDIA DRIVERS FOR LNBH25
14269−M: Sergey Kozlov <serjk@netup.ru>
14270−M: Abylay Ospan <aospan@netup.ru>
14271−L: linux-media@vger.kernel.org
14272−S: Supported
14273−W: https://linuxtv.org
14274−W: http://netup.tv/
14275−T: git git://linuxtv.org/media_tree.git
14276−F: drivers/media/dvb-frontends/lnbh25*
14277−
1427814195 MEDIA DRIVERS FOR MXL5XX TUNER DEMODULATORS
1427914196 L: linux-media@vger.kernel.org
1428014197 S: Orphan
@@ -14282,16 +14199,6 @@ W: https://linuxtv.org · 1 unmodified line
1428214199 T: git git://linuxtv.org/media_tree.git
1428314200 F: drivers/media/dvb-frontends/mxl5xx*
1428414201
14285−MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
14286−M: Sergey Kozlov <serjk@netup.ru>
14287−M: Abylay Ospan <aospan@netup.ru>
14288−L: linux-media@vger.kernel.org
14289−S: Supported
14290−W: https://linuxtv.org
14291−W: http://netup.tv/
14292−T: git git://linuxtv.org/media_tree.git
14293−F: drivers/media/pci/netup_unidvb/*
14294−
1429514202 MEDIA DRIVERS FOR NVIDIA TEGRA - VDE
1429614203 M: Dmitry Osipenko <digetx@gmail.com>
1429714204 L: linux-media@vger.kernel.org
@@ -14909,9 +14816,10 @@ N: include/linux/page[-_]* · 611 unmodified lines
1490914816
1491014817 MEMORY MAPPING
1491114818 M: Andrew Morton <akpm@linux-foundation.org>
14912−R: Liam R. Howlett <Liam.Howlett@oracle.com>
14819+M: Liam R. Howlett <Liam.Howlett@oracle.com>
14820+M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
1491314821 R: Vlastimil Babka <vbabka@suse.cz>
14914−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
14822+R: Jann Horn <jannh@google.com>
1491514823 L: linux-mm@kvack.org
1491614824 S: Maintained
1491714825 W: http://www.linux-mm.org
@@ -14934,13 +14842,6 @@ F: drivers/mtd/ · 16 unmodified lines
1493414842 F: include/linux/mtd/
1493514843 F: include/uapi/mtd/
1493614844
14937−MEMSENSING MICROSYSTEMS MSA311 DRIVER
14938−M: Dmitry Rokosov <ddrokosov@sberdevices.ru>
14939−L: linux-iio@vger.kernel.org
14940−S: Maintained
14941−F: Documentation/devicetree/bindings/iio/accel/memsensing,msa311.yaml
14942−F: drivers/iio/accel/msa311.c
14943−
1494414845 MEN A21 WATCHDOG DRIVER
1494514846 M: Johannes Thumshirn <morbidrsa@gmail.com>
1494614847 L: linux-watchdog@vger.kernel.org
@@ -15085,7 +14986,7 @@ F: drivers/spi/spi-at91-usart.c · 138 unmodified lines
1508514986
1508614987 MICROCHIP AUDIO ASOC DRIVERS
1508714988 M: Claudiu Beznea <claudiu.beznea@tuxon.dev>
15088−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
14989+L: linux-sound@vger.kernel.org
1508914990 S: Supported
1509014991 F: Documentation/devicetree/bindings/sound/atmel*
1509114992 F: Documentation/devicetree/bindings/sound/axentia,tse850-pcm5142.txt
@@ -15274,7 +15175,6 @@ F: drivers/tty/serial/8250/8250_pci1xxxx.c · 182 unmodified lines
1527415175
1527515176 MICROCHIP POLARFIRE FPGA DRIVERS
1527615177 M: Conor Dooley <conor.dooley@microchip.com>
15277−R: Vladimir Georgiev <v.georgiev@metrotek.ru>
1527815178 L: linux-fpga@vger.kernel.org
1527915179 S: Supported
1528015180 F: Documentation/devicetree/bindings/fpga/microchip,mpf-spi-fpga-mgr.yaml
@@ -15529,17 +15429,6 @@ F: arch/mips/ · 248 unmodified lines
1552915429 F: drivers/platform/mips/
1553015430 F: include/dt-bindings/mips/
1553115431
15532−MIPS BAIKAL-T1 PLATFORM
15533−M: Serge Semin <fancer.lancer@gmail.com>
15534−L: linux-mips@vger.kernel.org
15535−S: Supported
15536−F: Documentation/devicetree/bindings/bus/baikal,bt1-*.yaml
15537−F: Documentation/devicetree/bindings/clock/baikal,bt1-*.yaml
15538−F: drivers/bus/bt1-*.c
15539−F: drivers/clk/baikal-t1/
15540−F: drivers/memory/bt1-l2-ctl.c
15541−F: drivers/mtd/maps/physmap-bt1-rom.[ch]
15542−
1554315432 MIPS BOSTON DEVELOPMENT BOARD
1554415433 M: Paul Burton <paulburton@kernel.org>
1554515434 L: linux-mips@vger.kernel.org
@@ -15552,7 +15441,6 @@ F: include/dt-bindings/clock/boston-clock.h · 6 unmodified lines
1555215441
1555315442 MIPS CORE DRIVERS
1555415443 M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
15555−M: Serge Semin <fancer.lancer@gmail.com>
1555615444 L: linux-mips@vger.kernel.org
1555715445 S: Supported
1555815446 F: drivers/bus/mips_cdmm.c
@@ -15957,7 +15845,7 @@ F: include/linux/mtd/*nand*.h · 398 unmodified lines
1595715845
1595815846 NATIVE INSTRUMENTS USB SOUND INTERFACE DRIVER
1595915847 M: Daniel Mack <zonque@gmail.com>
15960−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
15848+L: linux-sound@vger.kernel.org
1596115849 S: Maintained
1596215850 W: http://www.native-instruments.com
1596315851 F: sound/usb/caiaq/
@@ -16088,6 +15976,7 @@ F: include/uapi/linux/net_dropmon.h · 124 unmodified lines
1608815976 F: net/core/drop_monitor.c
1608915977
1609015978 NETWORKING DRIVERS
15979+M: Andrew Lunn <andrew+netdev@lunn.ch>
1609115980 M: "David S. Miller" <davem@davemloft.net>
1609215981 M: Eric Dumazet <edumazet@google.com>
1609315982 M: Jakub Kicinski <kuba@kernel.org>
@@ -16153,6 +16042,7 @@ M: "David S. Miller" <davem@davemloft.net> · 59 unmodified lines
1615316042 M: Eric Dumazet <edumazet@google.com>
1615416043 M: Jakub Kicinski <kuba@kernel.org>
1615516044 M: Paolo Abeni <pabeni@redhat.com>
16045+R: Simon Horman <horms@kernel.org>
1615616046 L: netdev@vger.kernel.org
1615716047 S: Maintained
1615816048 P: Documentation/process/maintainer-netdev.rst
@@ -16195,10 +16085,22 @@ F: include/uapi/linux/rtnetlink.h · 36 unmodified lines
1619516085 F: lib/net_utils.c
1619616086 F: lib/random32.c
1619716087 F: net/
16088+F: samples/pktgen/
1619816089 F: tools/net/
1619916090 F: tools/testing/selftests/net/
16091+X: Documentation/networking/mac80211-injection.rst
16092+X: Documentation/networking/mac80211_hwsim/
16093+X: Documentation/networking/regulatory.rst
16094+X: include/net/cfg80211.h
16095+X: include/net/ieee80211_radiotap.h
16096+X: include/net/iw_handler.h
16097+X: include/net/mac80211.h
16098+X: include/net/wext.h
1620016099 X: net/9p/
1620116100 X: net/bluetooth/
16101+X: net/mac80211/
16102+X: net/rfkill/
16103+X: net/wireless/
1620216104
1620316105 NETWORKING [IPSEC]
1620416106 M: Steffen Klassert <steffen.klassert@secunet.com>
@@ -16508,12 +16410,6 @@ F: include/linux/ntb.h · 303 unmodified lines
1650816410 F: include/linux/ntb_transport.h
1650916411 F: tools/testing/selftests/ntb/
1651016412
16511−NTB IDT DRIVER
16512−M: Serge Semin <fancer.lancer@gmail.com>
16513−L: ntb@lists.linux.dev
16514−S: Supported
16515−F: drivers/ntb/hw/idt/
16516−
1651716413 NTB INTEL DRIVER
1651816414 M: Dave Jiang <dave.jiang@intel.com>
1651916415 L: ntb@lists.linux.dev
@@ -16728,7 +16624,7 @@ F: drivers/extcon/extcon-ptn5150.c · 208 unmodified lines
1672816624
1672916625 NXP SGTL5000 DRIVER
1673016626 M: Fabio Estevam <festevam@gmail.com>
16731−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
16627+L: linux-sound@vger.kernel.org
1673216628 S: Maintained
1673316629 F: Documentation/devicetree/bindings/sound/fsl,sgtl5000.yaml
1673416630 F: sound/soc/codecs/sgtl5000*
@@ -16752,7 +16648,7 @@ K: "nxp,tda998x" · 17 unmodified lines
1675216648
1675316649 NXP TFA9879 DRIVER
1675416650 M: Peter Rosin <peda@axentia.se>
16755−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
16651+L: linux-sound@vger.kernel.org
1675616652 S: Maintained
1675716653 F: Documentation/devicetree/bindings/sound/nxp,tfa9879.yaml
1675816654 F: sound/soc/codecs/tfa9879*
@@ -16764,7 +16660,7 @@ F: drivers/nfc/nxp-nci · 5 unmodified lines
1676416660
1676516661 NXP/Goodix TFA989X (TFA1) DRIVER
1676616662 M: Stephan Gerhold <stephan@gerhold.net>
16767−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
16663+L: linux-sound@vger.kernel.org
1676816664 S: Maintained
1676916665 F: Documentation/devicetree/bindings/sound/nxp,tfa989x.yaml
1677016666 F: sound/soc/codecs/tfa989x.c
@@ -16850,7 +16746,7 @@ F: include/uapi/misc/ocxl.h · 79 unmodified lines
1685016746 OMAP AUDIO SUPPORT
1685116747 M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1685216748 M: Jarkko Nikula <jarkko.nikula@bitmer.com>
16853−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
16749+L: linux-sound@vger.kernel.org
1685416750 L: linux-omap@vger.kernel.org
1685516751 S: Maintained
1685616752 F: sound/soc/ti/n810.c
@@ -17407,7 +17303,7 @@ F: include/linux/pm_opp.h · 550 unmodified lines
1740717303
1740817304 OPL4 DRIVER
1740917305 M: Clemens Ladisch <clemens@ladisch.de>
17410−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
17306+L: linux-sound@vger.kernel.org
1741117307 S: Maintained
1741217308 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
1741317309 F: sound/drivers/opl4/
@@ -18534,13 +18430,6 @@ F: drivers/pps/ · 1120 unmodified lines
1853418430 F: include/linux/pps*.h
1853518431 F: include/uapi/linux/pps.h
1853618432
18537−PPTP DRIVER
18538−M: Dmitry Kozlov <xeb@mail.ru>
18539−L: netdev@vger.kernel.org
18540−S: Maintained
18541−W: http://sourceforge.net/projects/accel-pptp
18542−F: drivers/net/ppp/pptp.c
18543−
1854418433 PRESSURE STALL INFORMATION (PSI)
1854518434 M: Johannes Weiner <hannes@cmpxchg.org>
1854618435 M: Suren Baghdasaryan <surenb@google.com>
@@ -18790,7 +18679,7 @@ F: drivers/crypto/intel/qat/ · 243 unmodified lines
1879018679
1879118680 QCOM AUDIO (ASoC) DRIVERS
1879218681 M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
18793−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
18682+L: linux-sound@vger.kernel.org
1879418683 L: linux-arm-msm@vger.kernel.org
1879518684 S: Supported
1879618685 F: Documentation/devicetree/bindings/soc/qcom/qcom,apr*
@@ -19514,6 +19403,14 @@ S: Maintained · 717 unmodified lines
1951419403 F: Documentation/tools/rtla/
1951519404 F: tools/tracing/rtla/
1951619405
19406+Real-time Linux (PREEMPT_RT)
19407+M: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
19408+M: Clark Williams <clrkwllms@kernel.org>
19409+M: Steven Rostedt <rostedt@goodmis.org>
19410+L: linux-rt-devel@lists.linux.dev
19411+S: Supported
19412+K: PREEMPT_RT
19413+
1951719414 REALTEK AUDIO CODECS
1951819415 M: Oder Chiou <oder_chiou@realtek.com>
1951919416 S: Maintained
@@ -19623,15 +19520,6 @@ S: Supported · 103 unmodified lines
1962319520 F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml
1962419521 F: drivers/i2c/busses/i2c-emev2.c
1962519522
19626−RENESAS ETHERNET AVB DRIVER
19627−R: Sergey Shtylyov <s.shtylyov@omp.ru>
19628−L: netdev@vger.kernel.org
19629−L: linux-renesas-soc@vger.kernel.org
19630−F: Documentation/devicetree/bindings/net/renesas,etheravb.yaml
19631−F: drivers/net/ethernet/renesas/Kconfig
19632−F: drivers/net/ethernet/renesas/Makefile
19633−F: drivers/net/ethernet/renesas/ravb*
19634−
1963519523 RENESAS ETHERNET SWITCH DRIVER
1963619524 R: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
1963719525 L: netdev@vger.kernel.org
@@ -19652,7 +19540,7 @@ F: drivers/net/ethernet/renesas/rtsn.* · 14 unmodified lines
1965219540
1965319541 RENESAS IDT821034 ASoC CODEC
1965419542 M: Herve Codina <herve.codina@bootlin.com>
19655−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
19543+L: linux-sound@vger.kernel.org
1965619544 S: Maintained
1965719545 F: Documentation/devicetree/bindings/sound/renesas,idt821034.yaml
1965819546 F: sound/soc/codecs/idt821034.c
@@ -19681,14 +19569,6 @@ F: Documentation/devicetree/bindings/i2c/renesas,rmobile-iic.yaml · 22 unmodified lines
1968119569 F: drivers/i2c/busses/i2c-rcar.c
1968219570 F: drivers/i2c/busses/i2c-sh_mobile.c
1968319571
19684−RENESAS R-CAR SATA DRIVER
19685−R: Sergey Shtylyov <s.shtylyov@omp.ru>
19686−L: linux-ide@vger.kernel.org
19687−L: linux-renesas-soc@vger.kernel.org
19688−S: Supported
19689−F: Documentation/devicetree/bindings/ata/renesas,rcar-sata.yaml
19690−F: drivers/ata/sata_rcar.c
19691−
1969219572 RENESAS R-CAR THERMAL DRIVERS
1969319573 M: Niklas Söderlund <niklas.soderlund@ragnatech.se>
1969419574 L: linux-renesas-soc@vger.kernel.org
@@ -19764,16 +19644,6 @@ S: Supported · 69 unmodified lines
1976419644 F: Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml
1976519645 F: drivers/i2c/busses/i2c-rzv2m.c
1976619646
19767−RENESAS SUPERH ETHERNET DRIVER
19768−R: Sergey Shtylyov <s.shtylyov@omp.ru>
19769−L: netdev@vger.kernel.org
19770−L: linux-renesas-soc@vger.kernel.org
19771−F: Documentation/devicetree/bindings/net/renesas,ether.yaml
19772−F: drivers/net/ethernet/renesas/Kconfig
19773−F: drivers/net/ethernet/renesas/Makefile
19774−F: drivers/net/ethernet/renesas/sh_eth*
19775−F: include/linux/sh_eth.h
19776−
1977719647 RENESAS USB PHY DRIVER
1977819648 M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
1977919649 L: linux-renesas-soc@vger.kernel.org
@@ -20403,7 +20273,7 @@ F: security/safesetid/ · 623 unmodified lines
2040320273
2040420274 SAMSUNG AUDIO (ASoC) DRIVERS
2040520275 M: Sylwester Nawrocki <s.nawrocki@samsung.com>
20406−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
20276+L: linux-sound@vger.kernel.org
2040720277 S: Maintained
2040820278 B: mailto:linux-samsung-soc@vger.kernel.org
2040920279 F: Documentation/devicetree/bindings/sound/samsung*
@@ -20939,7 +20809,7 @@ F: drivers/media/rc/serial_ir.c · 529 unmodified lines
2093920809
2094020810 SERIAL LOW-POWER INTER-CHIP MEDIA BUS (SLIMbus)
2094120811 M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
20942−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
20812+L: linux-sound@vger.kernel.org
2094320813 S: Maintained
2094420814 F: Documentation/devicetree/bindings/slimbus/
2094520815 F: drivers/slimbus/
@@ -21373,7 +21243,7 @@ F: Documentation/devicetree/bindings/i2c/socionext,synquacer-i2c.yaml · 427 unmodified lines
2137321243 F: drivers/i2c/busses/i2c-synquacer.c
2137421244
2137521245 SOCIONEXT UNIPHIER SOUND DRIVER
21376−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
21246+L: linux-sound@vger.kernel.org
2137721247 S: Orphan
2137821248 F: sound/soc/uniphier/
2137921249
@@ -21632,7 +21502,7 @@ F: tools/testing/selftests/alsa · 252 unmodified lines
2163221502
2163321503 SOUND - COMPRESSED AUDIO
2163421504 M: Vinod Koul <vkoul@kernel.org>
21635−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
21505+L: linux-sound@vger.kernel.org
2163621506 S: Supported
2163721507 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
2163821508 F: Documentation/sound/designs/compress-offload.rst
@@ -21695,7 +21565,7 @@ M: Vinod Koul <vkoul@kernel.org> · 56 unmodified lines
2169521565 M: Bard Liao <yung-chuan.liao@linux.intel.com>
2169621566 R: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
2169721567 R: Sanyog Kale <sanyog.r.kale@intel.com>
21698−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
21568+L: linux-sound@vger.kernel.org
2169921569 S: Supported
2170021570 T: git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git
2170121571 F: Documentation/driver-api/soundwire/
@@ -21768,8 +21638,8 @@ F: drivers/accessibility/speakup/ · 66 unmodified lines
2176821638 SPEAR PLATFORM/CLOCK/PINCTRL SUPPORT
2176921639 M: Viresh Kumar <vireshk@kernel.org>
2177021640 M: Shiraz Hashim <shiraz.linux.kernel@gmail.com>
21771−M: soc@kernel.org
2177221641 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
21642+L: soc@lists.linux.dev
2177321643 S: Maintained
2177421644 W: http://www.st.com/spear
2177521645 F: arch/arm/boot/dts/st/spear*
@@ -22168,7 +22038,7 @@ F: kernel/static_call.c · 392 unmodified lines
2216822038
2216922039 STI AUDIO (ASoC) DRIVERS
2217022040 M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
22171−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
22041+L: linux-sound@vger.kernel.org
2217222042 S: Maintained
2217322043 F: Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
2217422044 F: sound/soc/sti/
@@ -22189,7 +22059,7 @@ F: drivers/media/usb/stk1160/ · 14 unmodified lines
2218922059 STM32 AUDIO (ASoC) DRIVERS
2219022060 M: Olivier Moysan <olivier.moysan@foss.st.com>
2219122061 M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
22192−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
22062+L: linux-sound@vger.kernel.org
2219322063 S: Maintained
2219422064 F: Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
2219522065 F: Documentation/devicetree/bindings/sound/st,stm32-*.yaml
@@ -22427,19 +22297,11 @@ F: drivers/tty/serial/8250/8250_lpss.c · 231 unmodified lines
2242722297
2242822298 SYNOPSYS DESIGNWARE APB GPIO DRIVER
2242922299 M: Hoan Tran <hoan@os.amperecomputing.com>
22430−M: Serge Semin <fancer.lancer@gmail.com>
2243122300 L: linux-gpio@vger.kernel.org
2243222301 S: Maintained
2243322302 F: Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml
2243422303 F: drivers/gpio/gpio-dwapb.c
2243522304
22436−SYNOPSYS DESIGNWARE APB SSI DRIVER
22437−M: Serge Semin <fancer.lancer@gmail.com>
22438−L: linux-spi@vger.kernel.org
22439−S: Supported
22440−F: Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
22441−F: drivers/spi/spi-dw*
22442−
2244322305 SYNOPSYS DESIGNWARE AXI DMAC DRIVER
2244422306 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2244522307 S: Maintained
@@ -22892,7 +22754,7 @@ F: drivers/irqchip/irq-xtensa-* · 446 unmodified lines
2289222754
2289322755 TEXAS INSTRUMENTS ASoC DRIVERS
2289422756 M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
22895−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
22757+L: linux-sound@vger.kernel.org
2289622758 S: Maintained
2289722759 F: Documentation/devicetree/bindings/sound/davinci-mcasp-audio.yaml
2289822760 F: sound/soc/ti/
@@ -22901,7 +22763,7 @@ TEXAS INSTRUMENTS AUDIO (ASoC/HDA) DRIVERS · 2 unmodified lines
2290122763 M: Shenghao Ding <shenghao-ding@ti.com>
2290222764 M: Kevin Lu <kevin-lu@ti.com>
2290322765 M: Baojun Xu <baojun.xu@ti.com>
22904−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
22766+L: linux-sound@vger.kernel.org
2290522767 S: Maintained
2290622768 F: Documentation/devicetree/bindings/sound/tas2552.txt
2290722769 F: Documentation/devicetree/bindings/sound/ti,tas2562.yaml
@@ -23269,7 +23131,7 @@ F: drivers/soc/ti/* · 361 unmodified lines
2326923131 TI LM49xxx FAMILY ASoC CODEC DRIVERS
2327023132 M: M R Swami Reddy <mr.swami.reddy@ti.com>
2327123133 M: Vishwas A Deshpande <vishwas.a.deshpande@ti.com>
23272−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
23134+L: linux-sound@vger.kernel.org
2327323135 S: Maintained
2327423136 F: sound/soc/codecs/isabelle*
2327523137 F: sound/soc/codecs/lm49453*
@@ -23284,14 +23146,14 @@ F: drivers/iio/adc/ti-lmp92064.c · 8 unmodified lines
2328423146
2328523147 TI PCM3060 ASoC CODEC DRIVER
2328623148 M: Kirill Marinushkin <kmarinushkin@birdec.com>
23287−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
23149+L: linux-sound@vger.kernel.org
2328823150 S: Maintained
2328923151 F: Documentation/devicetree/bindings/sound/pcm3060.txt
2329023152 F: sound/soc/codecs/pcm3060*
2329123153
2329223154 TI TAS571X FAMILY ASoC CODEC DRIVER
2329323155 M: Kevin Cernekee <cernekee@chromium.org>
23294−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
23156+L: linux-sound@vger.kernel.org
2329523157 S: Odd Fixes
2329623158 F: sound/soc/codecs/tas571x*
2329723159
@@ -23319,7 +23181,7 @@ F: drivers/iio/adc/ti-tsc2046.c · 21 unmodified lines
2331923181
2332023182 TI TWL4030 SERIES SOC CODEC DRIVER
2332123183 M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
23322−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
23184+L: linux-sound@vger.kernel.org
2332323185 S: Maintained
2332423186 F: sound/soc/codecs/twl4030*
2332523187
@@ -23749,12 +23611,6 @@ L: linux-input@vger.kernel.org · 423 unmodified lines
2374923611 S: Maintained
2375023612 F: drivers/hid/hid-udraw-ps3.c
2375123613
23752−UFS FILESYSTEM
23753−M: Evgeniy Dushistov <dushistov@mail.ru>
23754−S: Maintained
23755−F: Documentation/admin-guide/ufs.rst
23756−F: fs/ufs/
23757−
2375823614 UHID USERSPACE HID IO DRIVER
2375923615 M: David Rheinsberg <david@readahead.eu>
2376023616 L: linux-input@vger.kernel.org
@@ -23995,7 +23851,7 @@ F: drivers/usb/storage/ · 234 unmodified lines
2399523851
2399623852 USB MIDI DRIVER
2399723853 M: Clemens Ladisch <clemens@ladisch.de>
23998−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
23854+L: linux-sound@vger.kernel.org
2399923855 S: Maintained
2400023856 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
2400123857 F: sound/usb/midi.*
@@ -24057,6 +23913,7 @@ USB RAW GADGET DRIVER · 55 unmodified lines
2405723913 R: Andrey Konovalov <andreyknvl@gmail.com>
2405823914 L: linux-usb@vger.kernel.org
2405923915 S: Maintained
23916+B: https://github.com/xairy/raw-gadget/issues
2406023917 F: Documentation/usb/raw-gadget.rst
2406123918 F: drivers/usb/gadget/legacy/raw_gadget.c
2406223919 F: include/uapi/linux/usb/raw_gadget.h
@@ -24173,8 +24030,12 @@ F: drivers/usb/host/xhci* · 110 unmodified lines
2417324030
2417424031 USER DATAGRAM PROTOCOL (UDP)
2417524032 M: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
24033+L: netdev@vger.kernel.org
2417624034 S: Maintained
2417724035 F: include/linux/udp.h
24036+F: include/net/udp.h
24037+F: include/trace/events/udp.h
24038+F: include/uapi/linux/udp.h
2417824039 F: net/ipv4/udp.c
2417924040 F: net/ipv6/udp.c
2418024041
@@ -24655,7 +24516,7 @@ VIRTIO SOUND DRIVER · 474 unmodified lines
2465524516 M: Anton Yakovlev <anton.yakovlev@opensynergy.com>
2465624517 M: "Michael S. Tsirkin" <mst@redhat.com>
2465724518 L: virtualization@lists.linux.dev
24658−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
24519+L: linux-sound@vger.kernel.org
2465924520 S: Maintained
2466024521 F: include/uapi/linux/virtio_snd.h
2466124522 F: sound/virtio/*
@@ -24724,9 +24585,10 @@ F: tools/testing/vsock/ · 62 unmodified lines
2472424585
2472524586 VMA
2472624587 M: Andrew Morton <akpm@linux-foundation.org>
24727−R: Liam R. Howlett <Liam.Howlett@oracle.com>
24588+M: Liam R. Howlett <Liam.Howlett@oracle.com>
24589+M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
2472824590 R: Vlastimil Babka <vbabka@suse.cz>
24729−R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
24591+R: Jann Horn <jannh@google.com>
2473024592 L: linux-mm@kvack.org
2473124593 S: Maintained
2473224594 W: https://www.linux-mm.org
@@ -25384,7 +25246,7 @@ F: include/xen/interface/io/usbif.h · 651 unmodified lines
2538425246 XEN SOUND FRONTEND DRIVER
2538525247 M: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
2538625248 L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
25387−L: alsa-devel@alsa-project.org (moderated for non-subscribers)
25249+L: linux-sound@vger.kernel.org
2538825250 S: Supported
2538925251 F: sound/xen/*
2539025252
@@ -25400,7 +25262,7 @@ F: include/xen/arm/swiotlb-xen.h · 9 unmodified lines
2540025262 F: include/xen/swiotlb-xen.h
2540125263
2540225264 XFS FILESYSTEM
25403−M: Chandan Babu R <chandan.babu@oracle.com>
25265+M: Carlos Maiolino <cem@kernel.org>
2540425266 R: Darrick J. Wong <djwong@kernel.org>
2540525267 L: linux-xfs@vger.kernel.org
2540625268 S: Supported
Makefile+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 12
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc4
66 NAME = Baby Opossum Posse
77
88 # *DOCUMENTATION*
@@ -1645,7 +1645,7 @@ help: · 1636 unmodified lines
16451645 echo '* dtbs - Build device tree blobs for enabled boards'; \
16461646 echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
16471647 echo ' dt_binding_check - Validate device tree binding documents and examples'; \
1648− echo ' dt_binding_schema - Build processed device tree binding schemas'; \
1648+ echo ' dt_binding_schemas - Build processed device tree binding schemas'; \
16491649 echo ' dtbs_check - Validate device tree source files';\
16501650 echo '')
16511651
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 >= 190000 || (!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 >= 190000 && 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/Kconfig+4−3
@@ -200,7 +200,8 @@ config ARM64 · 199 unmodified lines
200200 select HAVE_DMA_CONTIGUOUS
201201 select HAVE_DYNAMIC_FTRACE
202202 select HAVE_DYNAMIC_FTRACE_WITH_ARGS \
203− if $(cc-option,-fpatchable-function-entry=2)
203+ if (GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS || \
204+ CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS)
204205 select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS \
205206 if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS
206207 select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \
@@ -286,12 +287,10 @@ config CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS · 79 unmodified lines
286287 def_bool CC_IS_CLANG
287288 # https://github.com/ClangBuiltLinux/linux/issues/1507
288289 depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600))
289− select HAVE_DYNAMIC_FTRACE_WITH_ARGS
290290
291291 config GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS
292292 def_bool CC_IS_GCC
293293 depends on $(cc-option,-fpatchable-function-entry=2)
294− select HAVE_DYNAMIC_FTRACE_WITH_ARGS
295294
296295 config 64BIT
297296 def_bool y
@@ -1097,6 +1096,7 @@ config ARM64_ERRATUM_3194386 · 799 unmodified lines
10971096 * ARM Cortex-A78C erratum 3324346
10981097 * ARM Cortex-A78C erratum 3324347
10991098 * ARM Cortex-A710 erratam 3324338
1099+ * ARM Cortex-A715 errartum 3456084
11001100 * ARM Cortex-A720 erratum 3456091
11011101 * ARM Cortex-A725 erratum 3456106
11021102 * ARM Cortex-X1 erratum 3324344
@@ -1107,6 +1107,7 @@ config ARM64_ERRATUM_3194386 · 4 unmodified lines
11071107 * ARM Cortex-X925 erratum 3324334
11081108 * ARM Neoverse-N1 erratum 3324349
11091109 * ARM Neoverse N2 erratum 3324339
1110+ * ARM Neoverse-N3 erratum 3456111
11101111 * ARM Neoverse-V1 erratum 3324341
11111112 * ARM Neoverse V2 erratum 3324336
11121113 * ARM Neoverse-V3 erratum 3312417
arch/arm64/Makefile+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #
1111 # Copyright (C) 1995-2001 by Russell King
1212
13−LDFLAGS_vmlinux :=--no-undefined -X
13+LDFLAGS_vmlinux :=--no-undefined -X --pic-veneer
1414
1515 ifeq ($(CONFIG_RELOCATABLE), y)
1616 # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
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/cputype.h+2−0
@@ -94,6 +94,7 @@ · 93 unmodified lines
9494 #define ARM_CPU_PART_NEOVERSE_V3 0xD84
9595 #define ARM_CPU_PART_CORTEX_X925 0xD85
9696 #define ARM_CPU_PART_CORTEX_A725 0xD87
97+#define ARM_CPU_PART_NEOVERSE_N3 0xD8E
9798
9899 #define APM_CPU_PART_XGENE 0x000
99100 #define APM_CPU_VAR_POTENZA 0x00
@@ -176,6 +177,7 @@ · 76 unmodified lines
176177 #define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
177178 #define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)
178179 #define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)
180+#define MIDR_NEOVERSE_N3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N3)
179181 #define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
180182 #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
181183 #define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
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+20−12
@@ -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.
@@ -1441,11 +1448,6 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); · 1224 unmodified lines
14411448 sign_extend64(__val, id##_##fld##_WIDTH - 1); \
14421449 })
14431450
1444−#define expand_field_sign(id, fld, val) \
1445− (id##_##fld##_SIGNED ? \
1446− __expand_field_sign_signed(id, fld, val) : \
1447− __expand_field_sign_unsigned(id, fld, val))
1448−
14491451 #define get_idreg_field_unsigned(kvm, id, fld) \
14501452 ({ \
14511453 u64 __val = kvm_read_vm_id_reg((kvm), SYS_##id); \
@@ -1461,20 +1463,26 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); · 9 unmodified lines
14611463 #define get_idreg_field_enum(kvm, id, fld) \
14621464 get_idreg_field_unsigned(kvm, id, fld)
14631465
1464−#define get_idreg_field(kvm, id, fld) \
1466+#define kvm_cmp_feat_signed(kvm, id, fld, op, limit) \
1467+ (get_idreg_field_signed((kvm), id, fld) op __expand_field_sign_signed(id, fld, limit))
1468+
1469+#define kvm_cmp_feat_unsigned(kvm, id, fld, op, limit) \
1470+ (get_idreg_field_unsigned((kvm), id, fld) op __expand_field_sign_unsigned(id, fld, limit))
1471+
1472+#define kvm_cmp_feat(kvm, id, fld, op, limit) \
14651473 (id##_##fld##_SIGNED ? \
1466− get_idreg_field_signed(kvm, id, fld) : \
1467− get_idreg_field_unsigned(kvm, id, fld))
1474+ kvm_cmp_feat_signed(kvm, id, fld, op, limit) : \
1475+ kvm_cmp_feat_unsigned(kvm, id, fld, op, limit))
14681476
14691477 #define kvm_has_feat(kvm, id, fld, limit) \
1470− (get_idreg_field((kvm), id, fld) >= expand_field_sign(id, fld, limit))
1478+ kvm_cmp_feat(kvm, id, fld, >=, limit)
14711479
14721480 #define kvm_has_feat_enum(kvm, id, fld, val) \
1473− (get_idreg_field_unsigned((kvm), id, fld) == __expand_field_sign_unsigned(id, fld, val))
1481+ kvm_cmp_feat_unsigned(kvm, id, fld, ==, val)
14741482
14751483 #define kvm_has_feat_range(kvm, id, fld, min, max) \
1476− (get_idreg_field((kvm), id, fld) >= expand_field_sign(id, fld, min) && \
1477− get_idreg_field((kvm), id, fld) <= expand_field_sign(id, fld, max))
1484+ (kvm_cmp_feat(kvm, id, fld, >=, min) && \
1485+ kvm_cmp_feat(kvm, id, fld, <=, max))
14781486
14791487 /* Check for a given level of PAuth support */
14801488 #define kvm_has_pauth(k, l) \
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/cpu_errata.c+3−0
@@ -439,6 +439,7 @@ static const struct midr_range erratum_spec_ssbs_list[] = { · 438 unmodified lines
439439 MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
440440 MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C),
441441 MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
442+ MIDR_ALL_VERSIONS(MIDR_CORTEX_A715),
442443 MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
443444 MIDR_ALL_VERSIONS(MIDR_CORTEX_A725),
444445 MIDR_ALL_VERSIONS(MIDR_CORTEX_X1),
@@ -447,8 +448,10 @@ static const struct midr_range erratum_spec_ssbs_list[] = { · 2 unmodified lines
447448 MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
448449 MIDR_ALL_VERSIONS(MIDR_CORTEX_X4),
449450 MIDR_ALL_VERSIONS(MIDR_CORTEX_X925),
451+ MIDR_ALL_VERSIONS(MIDR_MICROSOFT_AZURE_COBALT_100),
450452 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
451453 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
454+ MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N3),
452455 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
453456 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
454457 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
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/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/include/hyp/switch.h+1−1
@@ -338,7 +338,7 @@ static inline void __hyp_sve_save_host(void) · 337 unmodified lines
338338 struct cpu_sve_state *sve_state = *host_data_ptr(sve_state);
339339
340340 sve_state->zcr_el1 = read_sysreg_el1(SYS_ZCR);
341− write_sysreg_s(ZCR_ELx_LEN_MASK, SYS_ZCR_EL2);
341+ write_sysreg_s(sve_vq_from_vl(kvm_host_sve_max_vl) - 1, SYS_ZCR_EL2);
342342 __sve_save_state(sve_state->sve_regs + sve_ffr_offset(kvm_host_sve_max_vl),
343343 &sve_state->fpsr,
344344 true);
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/hyp/nvhe/hyp-main.c+7−5
@@ -33,7 +33,7 @@ static void __hyp_sve_save_guest(struct kvm_vcpu *vcpu) · 32 unmodified lines
3333 */
3434 sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
3535 __sve_save_state(vcpu_sve_pffr(vcpu), &vcpu->arch.ctxt.fp_regs.fpsr, true);
36− write_sysreg_s(ZCR_ELx_LEN_MASK, SYS_ZCR_EL2);
36+ write_sysreg_s(sve_vq_from_vl(kvm_host_sve_max_vl) - 1, SYS_ZCR_EL2);
3737 }
3838
3939 static void __hyp_sve_restore_host(void)
@@ -45,10 +45,11 @@ static void __hyp_sve_restore_host(void) · 5 unmodified lines
4545 * the host. The layout of the data when saving the sve state depends
4646 * on the VL, so use a consistent (i.e., the maximum) host VL.
4747 *
48− * Setting ZCR_EL2 to ZCR_ELx_LEN_MASK sets the effective length
49− * supported by the system (or limited at EL3).
48+ * Note that this constrains the PE to the maximum shared VL
49+ * that was discovered, if we wish to use larger VLs this will
50+ * need to be revisited.
5051 */
51− write_sysreg_s(ZCR_ELx_LEN_MASK, SYS_ZCR_EL2);
52+ write_sysreg_s(sve_vq_from_vl(kvm_host_sve_max_vl) - 1, SYS_ZCR_EL2);
5253 __sve_restore_state(sve_state->sve_regs + sve_ffr_offset(kvm_host_sve_max_vl),
5354 &sve_state->fpsr,
5455 true);
@@ -488,7 +489,8 @@ void handle_trap(struct kvm_cpu_context *host_ctxt) · 433 unmodified lines
488489 case ESR_ELx_EC_SVE:
489490 cpacr_clear_set(0, CPACR_ELx_ZEN);
490491 isb();
491− sve_cond_update_zcr_vq(ZCR_ELx_LEN_MASK, SYS_ZCR_EL2);
492+ sve_cond_update_zcr_vq(sve_vq_from_vl(kvm_host_sve_max_vl) - 1,
493+ SYS_ZCR_EL2);
492494 break;
493495 case ESR_ELx_EC_IABT_LOW:
494496 case ESR_ELx_EC_DABT_LOW:
arch/arm64/kvm/hyp/nvhe/pkvm.c+4−2
@@ -574,12 +574,14 @@ int __pkvm_init_vcpu(pkvm_handle_t handle, struct kvm_vcpu *host_vcpu, · 573 unmodified lines
574574 unlock:
575575 hyp_spin_unlock(&vm_table_lock);
576576
577− if (ret)
577+ if (ret) {
578578 unmap_donated_memory(hyp_vcpu, sizeof(*hyp_vcpu));
579+ return ret;
580+ }
579581
580582 hyp_vcpu->vcpu.arch.cptr_el2 = kvm_get_reset_cptr_el2(&hyp_vcpu->vcpu);
581583
582− return ret;
584+ return 0;
583585 }
584586
585587 static void
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/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/kernel/vdso/Makefile+1−1
@@ -22,7 +22,7 @@ endif · 21 unmodified lines
2222
2323 ifneq ($(c-getrandom-y),)
2424 CFLAGS_vgetrandom-32.o += -include $(c-getrandom-y)
25− CFLAGS_vgetrandom-64.o += -include $(c-getrandom-y) $(call cc-option, -ffixed-r30)
25+ CFLAGS_vgetrandom-64.o += -include $(c-getrandom-y)
2626 endif
2727
2828 # Build rules
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−2
@@ -777,8 +777,7 @@ config IRQ_STACKS · 776 unmodified lines
777777 config THREAD_SIZE_ORDER
778778 int "Kernel stack size (in power-of-two numbers of page size)" if VMAP_STACK && EXPERT
779779 range 0 4
780− default 1 if 32BIT && !KASAN
781− default 3 if 64BIT && KASAN
780+ default 1 if 32BIT
782781 default 2
783782 help
784783 Specify the Pages of thread stack size (from 4KB to 64KB), which also
arch/riscv/include/asm/thread_info.h+6−1
@@ -13,7 +13,12 @@ · 12 unmodified lines
1313 #include <linux/sizes.h>
1414
1515 /* thread information allocation */
16−#define THREAD_SIZE_ORDER CONFIG_THREAD_SIZE_ORDER
16+#ifdef CONFIG_KASAN
17+#define KASAN_STACK_ORDER 1
18+#else
19+#define KASAN_STACK_ORDER 0
20+#endif
21+#define THREAD_SIZE_ORDER (CONFIG_THREAD_SIZE_ORDER + KASAN_STACK_ORDER)
1722 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
1823
1924 /*
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/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/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/ftrace.h+2−0
@@ -2,6 +2,8 @@ · 1 unmodified line
22 #ifndef _ASM_X86_FTRACE_H
33 #define _ASM_X86_FTRACE_H
44
5+#include <asm/ptrace.h>
6+
57 #ifdef CONFIG_FUNCTION_TRACER
68 #ifndef CC_USING_FENTRY
79 # error Compiler does not support fentry?
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/reboot.h+2−2
@@ -26,7 +26,7 @@ void __noreturn machine_real_restart(unsigned int type); · 25 unmodified lines
2626 #define MRR_APM 1
2727
2828 typedef void (cpu_emergency_virt_cb)(void);
29−#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
29+#if IS_ENABLED(CONFIG_KVM_X86)
3030 void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback);
3131 void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback);
3232 void cpu_emergency_disable_virtualization(void);
@@ -34,7 +34,7 @@ void cpu_emergency_disable_virtualization(void); · 1 unmodified line
3434 static inline void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback) {}
3535 static inline void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback) {}
3636 static inline void cpu_emergency_disable_virtualization(void) {}
37−#endif /* CONFIG_KVM_INTEL || CONFIG_KVM_AMD */
37+#endif /* CONFIG_KVM_X86 */
3838
3939 typedef void (*nmi_shootdown_cb)(int, struct pt_regs*);
4040 void nmi_shootdown_cpus(nmi_shootdown_cb callback);
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+3−0
@@ -1443,6 +1443,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) · 1442 unmodified lines
14431443 boot_cpu_has(X86_FEATURE_HYPERVISOR)))
14441444 setup_force_cpu_bug(X86_BUG_BHI);
14451445
1446+ if (cpu_has(c, X86_FEATURE_AMD_IBPB) && !cpu_has(c, X86_FEATURE_AMD_IBPB_RET))
1447+ setup_force_cpu_bug(X86_BUG_IBPB_NO_RET);
1448+
14461449 if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
14471450 return;
14481451
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/reboot.c+2−2
@@ -530,7 +530,7 @@ static inline void kb_wait(void) · 529 unmodified lines
530530
531531 static inline void nmi_shootdown_cpus_on_restart(void);
532532
533−#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
533+#if IS_ENABLED(CONFIG_KVM_X86)
534534 /* RCU-protected callback to disable virtualization prior to reboot. */
535535 static cpu_emergency_virt_cb __rcu *cpu_emergency_virt_callback;
536536
@@ -600,7 +600,7 @@ static void emergency_reboot_disable_virtualization(void) · 63 unmodified lines
600600 }
601601 #else
602602 static void emergency_reboot_disable_virtualization(void) { }
603−#endif /* CONFIG_KVM_INTEL || CONFIG_KVM_AMD */
603+#endif /* CONFIG_KVM_X86 */
604604
605605 void __attribute__((weak)) mach_reboot_fixups(void)
606606 {
arch/x86/kvm/Kconfig+6−3
@@ -17,8 +17,8 @@ menuconfig VIRTUALIZATION · 16 unmodified lines
1717
1818 if VIRTUALIZATION
1919
20−config KVM
21− tristate "Kernel-based Virtual Machine (KVM) support"
20+config KVM_X86
21+ def_tristate KVM if KVM_INTEL || KVM_AMD
2222 depends on X86_LOCAL_APIC
2323 select KVM_COMMON
2424 select KVM_GENERIC_MMU_NOTIFIER
@@ -44,7 +44,11 @@ config KVM · 19 unmodified lines
4444 select HAVE_KVM_PM_NOTIFIER if PM
4545 select KVM_GENERIC_HARDWARE_ENABLING
4646 select KVM_GENERIC_PRE_FAULT_MEMORY
47+ select KVM_GENERIC_PRIVATE_MEM if KVM_SW_PROTECTED_VM
4748 select KVM_WERROR if WERROR
49+
50+config KVM
51+ tristate "Kernel-based Virtual Machine (KVM) support"
4852 help
4953 Support hosting fully virtualized guest machines using hardware
5054 virtualization extensions. You will need a fairly recent
@@ -77,7 +81,6 @@ config KVM_SW_PROTECTED_VM · 26 unmodified lines
7781 bool "Enable support for KVM software-protected VMs"
7882 depends on EXPERT
7983 depends on KVM && X86_64
80− select KVM_GENERIC_PRIVATE_MEM
8184 help
8285 Enable support for KVM software-protected VMs. Currently, software-
8386 protected VMs are purely a development and testing vehicle for
arch/x86/kvm/Makefile+1−1
@@ -32,7 +32,7 @@ kvm-intel-y += vmx/vmx_onhyperv.o vmx/hyperv_evmcs.o · 31 unmodified lines
3232 kvm-amd-y += svm/svm_onhyperv.o
3333 endif
3434
35−obj-$(CONFIG_KVM) += kvm.o
35+obj-$(CONFIG_KVM_X86) += kvm.o
3636 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
3737 obj-$(CONFIG_KVM_AMD) += kvm-amd.o
3838
arch/x86/kvm/mmu/mmu.c+51−12
@@ -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,
@@ -7047,14 +7058,42 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm) · 5485 unmodified lines
70477058 kvm_mmu_zap_all(kvm);
70487059 }
70497060
7050−/*
7051− * Zapping leaf SPTEs with memslot range when a memslot is moved/deleted.
7052− *
7053− * Zapping non-leaf SPTEs, a.k.a. not-last SPTEs, isn't required, worst
7054− * case scenario we'll have unused shadow pages lying around until they
7055− * are recycled due to age or when the VM is destroyed.
7056− */
7057−static void kvm_mmu_zap_memslot_leafs(struct kvm *kvm, struct kvm_memory_slot *slot)
7061+static void kvm_mmu_zap_memslot_pages_and_flush(struct kvm *kvm,
7062+ struct kvm_memory_slot *slot,
7063+ bool flush)
7064+{
7065+ LIST_HEAD(invalid_list);
7066+ unsigned long i;
7067+
7068+ if (list_empty(&kvm->arch.active_mmu_pages))
7069+ goto out_flush;
7070+
7071+ /*
7072+ * Since accounting information is stored in struct kvm_arch_memory_slot,
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().
7076+ */
7077+ for (i = 0; i < slot->npages; i++) {
7078+ struct kvm_mmu_page *sp;
7079+ gfn_t gfn = slot->base_gfn + i;
7080+
7081+ for_each_gfn_valid_sp_with_gptes(kvm, sp, gfn)
7082+ kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list);
7083+
7084+ if (need_resched() || rwlock_needbreak(&kvm->mmu_lock)) {
7085+ kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, flush);
7086+ flush = false;
7087+ cond_resched_rwlock_write(&kvm->mmu_lock);
7088+ }
7089+ }
7090+
7091+out_flush:
7092+ kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, flush);
7093+}
7094+
7095+static void kvm_mmu_zap_memslot(struct kvm *kvm,
7096+ struct kvm_memory_slot *slot)
70587097 {
70597098 struct kvm_gfn_range range = {
70607099 .slot = slot,
@@ -7062,11 +7101,11 @@ static void kvm_mmu_zap_memslot_leafs(struct kvm *kvm, struct kvm_memory_slot *s · 1 unmodified line
70627101 .end = slot->base_gfn + slot->npages,
70637102 .may_block = true,
70647103 };
7104+ bool flush;
70657105
70667106 write_lock(&kvm->mmu_lock);
7067− if (kvm_unmap_gfn_range(kvm, &range))
7068− kvm_flush_remote_tlbs_memslot(kvm, slot);
7069−
7107+ flush = kvm_unmap_gfn_range(kvm, &range);
7108+ kvm_mmu_zap_memslot_pages_and_flush(kvm, slot, flush);
70707109 write_unlock(&kvm->mmu_lock);
70717110 }
70727111
@@ -7082,7 +7121,7 @@ void kvm_arch_flush_shadow_memslot(struct kvm *kvm, · 9 unmodified lines
70827121 if (kvm_memslot_flush_zap_all(kvm))
70837122 kvm_mmu_zap_all_fast(kvm);
70847123 else
7085− kvm_mmu_zap_memslot_leafs(kvm, slot);
7124+ kvm_mmu_zap_memslot(kvm, slot);
70867125 }
70877126
70887127 void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm, u64 gen)
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/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-integrity.c+1−2
@@ -56,8 +56,7 @@ new_segment: · 55 unmodified lines
5656
5757 /**
5858 * blk_rq_map_integrity_sg - Map integrity metadata into a scatterlist
59− * @q: request queue
60− * @bio: bio with integrity metadata attached
59+ * @rq: request to map
6160 * @sglist: target scatterlist
6261 *
6362 * Description: Map the integrity vectors in request into a
block/blk-iocost.c+4−4
@@ -3166,7 +3166,7 @@ static u64 ioc_qos_prfill(struct seq_file *sf, struct blkg_policy_data *pd, · 3165 unmodified lines
31663166 if (!dname)
31673167 return 0;
31683168
3169− spin_lock_irq(&ioc->lock);
3169+ spin_lock(&ioc->lock);
31703170 seq_printf(sf, "%s enable=%d ctrl=%s rpct=%u.%02u rlat=%u wpct=%u.%02u wlat=%u min=%u.%02u max=%u.%02u\n",
31713171 dname, ioc->enabled, ioc->user_qos_params ? "user" : "auto",
31723172 ioc->params.qos[QOS_RPPM] / 10000,
@@ -3179,7 +3179,7 @@ static u64 ioc_qos_prfill(struct seq_file *sf, struct blkg_policy_data *pd, · 6 unmodified lines
31793179 ioc->params.qos[QOS_MIN] % 10000 / 100,
31803180 ioc->params.qos[QOS_MAX] / 10000,
31813181 ioc->params.qos[QOS_MAX] % 10000 / 100);
3182− spin_unlock_irq(&ioc->lock);
3182+ spin_unlock(&ioc->lock);
31833183 return 0;
31843184 }
31853185
@@ -3366,14 +3366,14 @@ static u64 ioc_cost_model_prfill(struct seq_file *sf, · 180 unmodified lines
33663366 if (!dname)
33673367 return 0;
33683368
3369− spin_lock_irq(&ioc->lock);
3369+ spin_lock(&ioc->lock);
33703370 seq_printf(sf, "%s ctrl=%s model=linear "
33713371 "rbps=%llu rseqiops=%llu rrandiops=%llu "
33723372 "wbps=%llu wseqiops=%llu wrandiops=%llu\n",
33733373 dname, ioc->user_cost_model ? "user" : "auto",
33743374 u[I_LCOEF_RBPS], u[I_LCOEF_RSEQIOPS], u[I_LCOEF_RRANDIOPS],
33753375 u[I_LCOEF_WBPS], u[I_LCOEF_WSEQIOPS], u[I_LCOEF_WRANDIOPS]);
3376− spin_unlock_irq(&ioc->lock);
3376+ spin_unlock(&ioc->lock);
33773377 return 0;
33783378 }
33793379
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/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/apei/einj-cxl.c+1−1
@@ -63,7 +63,7 @@ static int cxl_dport_get_sbdf(struct pci_dev *dport_dev, u64 *sbdf) · 62 unmodified lines
6363 seg = bridge->domain_nr;
6464
6565 bus = pbus->number;
66− *sbdf = (seg << 24) | (bus << 16) | dport_dev->devfn;
66+ *sbdf = (seg << 24) | (bus << 16) | (dport_dev->devfn << 8);
6767
6868 return 0;
6969 }
drivers/acpi/battery.c+17−11
@@ -703,28 +703,35 @@ static LIST_HEAD(acpi_battery_list); · 702 unmodified lines
703703 static LIST_HEAD(battery_hook_list);
704704 static DEFINE_MUTEX(hook_mutex);
705705
706−static void __battery_hook_unregister(struct acpi_battery_hook *hook, int lock)
706+static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook)
707707 {
708708 struct acpi_battery *battery;
709+
709710 /*
710711 * In order to remove a hook, we first need to
711712 * de-register all the batteries that are registered.
712713 */
713− if (lock)
714− mutex_lock(&hook_mutex);
715714 list_for_each_entry(battery, &acpi_battery_list, list) {
716715 if (!hook->remove_battery(battery->bat, hook))
717716 power_supply_changed(battery->bat);
718717 }
719− list_del(&hook->list);
720− if (lock)
721− mutex_unlock(&hook_mutex);
718+ list_del_init(&hook->list);
719+
722720 pr_info("extension unregistered: %s\n", hook->name);
723721 }
724722
725723 void battery_hook_unregister(struct acpi_battery_hook *hook)
726724 {
727− __battery_hook_unregister(hook, 1);
725+ mutex_lock(&hook_mutex);
726+ /*
727+ * Ignore already unregistered battery hooks. This might happen
728+ * if a battery hook was previously unloaded due to an error when
729+ * adding a new battery.
730+ */
731+ if (!list_empty(&hook->list))
732+ battery_hook_unregister_unlocked(hook);
733+
734+ mutex_unlock(&hook_mutex);
728735 }
729736 EXPORT_SYMBOL_GPL(battery_hook_unregister);
730737
@@ -733,7 +740,6 @@ void battery_hook_register(struct acpi_battery_hook *hook) · 2 unmodified lines
733740 struct acpi_battery *battery;
734741
735742 mutex_lock(&hook_mutex);
736− INIT_LIST_HEAD(&hook->list);
737743 list_add(&hook->list, &battery_hook_list);
738744 /*
739745 * Now that the driver is registered, we need
@@ -750,7 +756,7 @@ void battery_hook_register(struct acpi_battery_hook *hook) · 10 unmodified lines
750756 * hooks.
751757 */
752758 pr_err("extension failed to load: %s", hook->name);
753− __battery_hook_unregister(hook, 0);
759+ battery_hook_unregister_unlocked(hook);
754760 goto end;
755761 }
756762
@@ -804,7 +810,7 @@ static void battery_hook_add_battery(struct acpi_battery *battery) · 47 unmodified lines
804810 */
805811 pr_err("error in extension, unloading: %s",
806812 hook_node->name);
807− __battery_hook_unregister(hook_node, 0);
813+ battery_hook_unregister_unlocked(hook_node);
808814 }
809815 }
810816 mutex_unlock(&hook_mutex);
@@ -837,7 +843,7 @@ static void __exit battery_hook_exit(void) · 26 unmodified lines
837843 * need to remove the hooks.
838844 */
839845 list_for_each_entry_safe(hook, ptr, &battery_hook_list, list) {
840− __battery_hook_unregister(hook, 1);
846+ battery_hook_unregister(hook);
841847 }
842848 mutex_destroy(&hook_mutex);
843849 }
drivers/acpi/resource.c+15−64
@@ -441,108 +441,59 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { · 440 unmodified lines
441441 },
442442 },
443443 {
444− /* Asus ExpertBook B1402CBA */
444+ /* Asus Vivobook X1704VAP */
445445 .matches = {
446446 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
447− DMI_MATCH(DMI_BOARD_NAME, "B1402CBA"),
447+ DMI_MATCH(DMI_BOARD_NAME, "X1704VAP"),
448448 },
449449 },
450450 {
451− /* Asus ExpertBook B1402CVA */
451+ /* Asus ExpertBook B1402C* */
452452 .matches = {
453453 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
454− DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"),
454+ DMI_MATCH(DMI_BOARD_NAME, "B1402C"),
455455 },
456456 },
457457 {
458− /* Asus ExpertBook B1502CBA */
458+ /* Asus ExpertBook B1502C* */
459459 .matches = {
460460 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
461− DMI_MATCH(DMI_BOARD_NAME, "B1502CBA"),
461+ DMI_MATCH(DMI_BOARD_NAME, "B1502C"),
462462 },
463463 },
464464 {
465− /* Asus ExpertBook B1502CGA */
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, "B1502CGA"),
468+ DMI_MATCH(DMI_BOARD_NAME, "B2402"),
469469 },
470470 },
471− {
472− /* Asus ExpertBook B1502CVA */
473− .matches = {
474− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
475− DMI_MATCH(DMI_BOARD_NAME, "B1502CVA"),
476− },
477− },
478471 {
479− /* Asus ExpertBook B2402CBA */
472+ /* Asus ExpertBook B2502 (B2502CBA / B2502FBA / B2502CVA / B2502FVA) */
480473 .matches = {
481474 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
482− DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
475+ DMI_MATCH(DMI_BOARD_NAME, "B2502"),
483476 },
484477 },
485478 {
486− /* Asus ExpertBook B2402FBA */
479+ /* Asus Vivobook Go E1404GA* */
487480 .matches = {
488481 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
489− DMI_MATCH(DMI_BOARD_NAME, "B2402FBA"),
482+ DMI_MATCH(DMI_BOARD_NAME, "E1404GA"),
490483 },
491484 },
492485 {
493− /* Asus ExpertBook B2502 */
494− .matches = {
495− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
496− DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"),
497− },
498− },
499− {
500− /* Asus ExpertBook B2502FBA */
501− .matches = {
502− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
503− DMI_MATCH(DMI_BOARD_NAME, "B2502FBA"),
504− },
505− },
506− {
507− /* Asus Vivobook Go E1404GAB */
508− .matches = {
509− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
510− DMI_MATCH(DMI_BOARD_NAME, "E1404GAB"),
511− },
512− },
513− {
514− /* Asus Vivobook E1504GA */
486+ /* Asus Vivobook E1504GA* */
515487 .matches = {
516488 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
517489 DMI_MATCH(DMI_BOARD_NAME, "E1504GA"),
518490 },
519491 },
520492 {
521− /* Asus Vivobook E1504GAB */
522− .matches = {
523− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
524− DMI_MATCH(DMI_BOARD_NAME, "E1504GAB"),
525− },
526− },
527− {
528− /* Asus Vivobook Pro N6506MV */
529− .matches = {
530− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
531− DMI_MATCH(DMI_BOARD_NAME, "N6506MV"),
532− },
533− },
534− {
535− /* Asus Vivobook Pro N6506MU */
536− .matches = {
537− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
538− DMI_MATCH(DMI_BOARD_NAME, "N6506MU"),
539− },
540− },
541− {
542− /* Asus Vivobook Pro N6506MJ */
493+ /* Asus Vivobook Pro N6506M* */
543494 .matches = {
544495 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
545− DMI_MATCH(DMI_BOARD_NAME, "N6506MJ"),
496+ DMI_MATCH(DMI_BOARD_NAME, "N6506M"),
546497 },
547498 },
548499 {
drivers/acpi/video_detect.c+9−0
@@ -844,6 +844,15 @@ static const struct dmi_system_id video_detect_dmi_table[] = { · 843 unmodified lines
844844 * controller board in their ACPI tables (and may even have one), but
845845 * which need native backlight control nevertheless.
846846 */
847+ {
848+ /* https://github.com/zabbly/linux/issues/26 */
849+ .callback = video_detect_force_native,
850+ /* Dell OptiPlex 5480 AIO */
851+ .matches = {
852+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
853+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 5480 AIO"),
854+ },
855+ },
847856 {
848857 /* https://bugzilla.redhat.com/show_bug.cgi?id=2303936 */
849858 .callback = video_detect_force_native,
drivers/ata/libata-eh.c+14−4
@@ -4099,10 +4099,20 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap) · 4098 unmodified lines
40994099
41004100 WARN_ON(ap->pflags & ATA_PFLAG_SUSPENDED);
41014101
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);
4102+ /*
4103+ * We will reach this point for all of the PM events:
4104+ * PM_EVENT_SUSPEND (if runtime pm, PM_EVENT_AUTO will also be set)
4105+ * PM_EVENT_FREEZE, and PM_EVENT_HIBERNATE.
4106+ *
4107+ * We do not want to perform disk spin down for PM_EVENT_FREEZE.
4108+ * (Spin down will be performed by the subsequent PM_EVENT_HIBERNATE.)
4109+ */
4110+ if (!(ap->pm_mesg.event & PM_EVENT_FREEZE)) {
4111+ /* Set all devices attached to the port in standby mode */
4112+ ata_for_each_link(link, ap, HOST_FIRST) {
4113+ ata_for_each_dev(dev, link, ENABLED)
4114+ ata_dev_power_set_standby(dev);
4115+ }
41064116 }
41074117
41084118 /*
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/aoe/aoecmd.c+12−1
@@ -361,6 +361,7 @@ ata_rw_frameinit(struct frame *f) · 360 unmodified lines
361361 }
362362
363363 ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit;
364+ dev_hold(t->ifp->nd);
364365 skb->dev = t->ifp->nd;
365366 }
366367
@@ -401,6 +402,8 @@ aoecmd_ata_rw(struct aoedev *d) · 34 unmodified lines
401402 __skb_queue_head_init(&queue);
402403 __skb_queue_tail(&queue, skb);
403404 aoenet_xmit(&queue);
405+ } else {
406+ dev_put(f->t->ifp->nd);
404407 }
405408 return 1;
406409 }
@@ -483,10 +486,13 @@ resend(struct aoedev *d, struct frame *f) · 76 unmodified lines
483486 memcpy(h->dst, t->addr, sizeof h->dst);
484487 memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src);
485488
489+ dev_hold(t->ifp->nd);
486490 skb->dev = t->ifp->nd;
487491 skb = skb_clone(skb, GFP_ATOMIC);
488− if (skb == NULL)
492+ if (skb == NULL) {
493+ dev_put(t->ifp->nd);
489494 return;
495+ }
490496 f->sent = ktime_get();
491497 __skb_queue_head_init(&queue);
492498 __skb_queue_tail(&queue, skb);
@@ -617,6 +623,8 @@ probe(struct aoetgt *t) · 124 unmodified lines
617623 __skb_queue_head_init(&queue);
618624 __skb_queue_tail(&queue, skb);
619625 aoenet_xmit(&queue);
626+ } else {
627+ dev_put(f->t->ifp->nd);
620628 }
621629 }
622630
@@ -1395,6 +1403,7 @@ aoecmd_ata_id(struct aoedev *d) · 772 unmodified lines
13951403 ah->cmdstat = ATA_CMD_ID_ATA;
13961404 ah->lba3 = 0xa0;
13971405
1406+ dev_hold(t->ifp->nd);
13981407 skb->dev = t->ifp->nd;
13991408
14001409 d->rttavg = RTTAVG_INIT;
@@ -1404,6 +1413,8 @@ aoecmd_ata_id(struct aoedev *d) · 3 unmodified lines
14041413 skb = skb_clone(skb, GFP_ATOMIC);
14051414 if (skb)
14061415 f->sent = ktime_get();
1416+ else
1417+ dev_put(t->ifp->nd);
14071418
14081419 return skb;
14091420 }
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/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/cpufreq/intel_pstate.c+8−8
@@ -1845,7 +1845,7 @@ static void intel_pstate_notify_work(struct work_struct *work) · 1844 unmodified lines
18451845 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0);
18461846 }
18471847
1848−static DEFINE_SPINLOCK(hwp_notify_lock);
1848+static DEFINE_RAW_SPINLOCK(hwp_notify_lock);
18491849 static cpumask_t hwp_intr_enable_mask;
18501850
18511851 #define HWP_GUARANTEED_PERF_CHANGE_STATUS BIT(0)
@@ -1868,7 +1868,7 @@ void notify_hwp_interrupt(void) · 16 unmodified lines
18681868 if (!(value & status_mask))
18691869 return;
18701870
1871− spin_lock_irqsave(&hwp_notify_lock, flags);
1871+ raw_spin_lock_irqsave(&hwp_notify_lock, flags);
18721872
18731873 if (!cpumask_test_cpu(this_cpu, &hwp_intr_enable_mask))
18741874 goto ack_intr;
@@ -1876,13 +1876,13 @@ void notify_hwp_interrupt(void) · 1 unmodified line
18761876 schedule_delayed_work(&all_cpu_data[this_cpu]->hwp_notify_work,
18771877 msecs_to_jiffies(10));
18781878
1879− spin_unlock_irqrestore(&hwp_notify_lock, flags);
1879+ raw_spin_unlock_irqrestore(&hwp_notify_lock, flags);
18801880
18811881 return;
18821882
18831883 ack_intr:
18841884 wrmsrl_safe(MSR_HWP_STATUS, 0);
1885− spin_unlock_irqrestore(&hwp_notify_lock, flags);
1885+ raw_spin_unlock_irqrestore(&hwp_notify_lock, flags);
18861886 }
18871887
18881888 static void intel_pstate_disable_hwp_interrupt(struct cpudata *cpudata)
@@ -1895,9 +1895,9 @@ static void intel_pstate_disable_hwp_interrupt(struct cpudata *cpudata) · 6 unmodified lines
18951895 /* wrmsrl_on_cpu has to be outside spinlock as this can result in IPC */
18961896 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00);
18971897
1898− spin_lock_irq(&hwp_notify_lock);
1898+ raw_spin_lock_irq(&hwp_notify_lock);
18991899 cancel_work = cpumask_test_and_clear_cpu(cpudata->cpu, &hwp_intr_enable_mask);
1900− spin_unlock_irq(&hwp_notify_lock);
1900+ raw_spin_unlock_irq(&hwp_notify_lock);
19011901
19021902 if (cancel_work)
19031903 cancel_delayed_work_sync(&cpudata->hwp_notify_work);
@@ -1912,10 +1912,10 @@ static void intel_pstate_enable_hwp_interrupt(struct cpudata *cpudata) · 8 unmodified lines
19121912 if (boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) {
19131913 u64 interrupt_mask = HWP_GUARANTEED_PERF_CHANGE_REQ;
19141914
1915− spin_lock_irq(&hwp_notify_lock);
1915+ raw_spin_lock_irq(&hwp_notify_lock);
19161916 INIT_DELAYED_WORK(&cpudata->hwp_notify_work, intel_pstate_notify_work);
19171917 cpumask_set_cpu(cpudata->cpu, &hwp_intr_enable_mask);
1918− spin_unlock_irq(&hwp_notify_lock);
1918+ raw_spin_unlock_irq(&hwp_notify_lock);
19191919
19201920 if (cpu_feature_enabled(X86_FEATURE_HWP_HIGHEST_PERF_CHANGE))
19211921 interrupt_mask |= HWP_HIGHEST_PERF_CHANGE_REQ;
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/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/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/sysfb.c+3−1
@@ -67,9 +67,11 @@ static bool sysfb_unregister(void) · 66 unmodified lines
6767 void sysfb_disable(struct device *dev)
6868 {
6969 struct screen_info *si = &screen_info;
70+ struct device *parent;
7071
7172 mutex_lock(&disable_lock);
72− if (!dev || dev == sysfb_parent_dev(si)) {
73+ parent = sysfb_parent_dev(si);
74+ if (!dev || !parent || dev == parent) {
7375 sysfb_unregister();
7476 disabled = true;
7577 }
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-davinci.c+5−5
@@ -253,7 +253,7 @@ static int davinci_gpio_probe(struct platform_device *pdev) · 252 unmodified lines
253253 * serve as EDMA event triggers.
254254 */
255255
256−static void gpio_irq_disable(struct irq_data *d)
256+static void gpio_irq_mask(struct irq_data *d)
257257 {
258258 struct davinci_gpio_regs __iomem *g = irq2regs(d);
259259 uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
@@ -262,7 +262,7 @@ static void gpio_irq_disable(struct irq_data *d) · 2 unmodified lines
262262 writel_relaxed(mask, &g->clr_rising);
263263 }
264264
265−static void gpio_irq_enable(struct irq_data *d)
265+static void gpio_irq_unmask(struct irq_data *d)
266266 {
267267 struct davinci_gpio_regs __iomem *g = irq2regs(d);
268268 uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
@@ -288,8 +288,8 @@ static int gpio_irq_type(struct irq_data *d, unsigned trigger) · 19 unmodified lines
288288
289289 static struct irq_chip gpio_irqchip = {
290290 .name = "GPIO",
291− .irq_enable = gpio_irq_enable,
292− .irq_disable = gpio_irq_disable,
291+ .irq_unmask = gpio_irq_unmask,
292+ .irq_mask = gpio_irq_mask,
293293 .irq_set_type = gpio_irq_type,
294294 .flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
295295 };
@@ -472,7 +472,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) · 176 unmodified lines
472472 return PTR_ERR(clk);
473473 }
474474
475− if (chips->gpio_unbanked) {
475+ if (!chips->gpio_unbanked) {
476476 irq = devm_irq_alloc_descs(dev, -1, 0, ngpio, 0);
477477 if (irq < 0) {
478478 dev_err(dev, "Couldn't allocate IRQ numbers\n");
drivers/gpio/gpiolib.c+2−2
@@ -114,12 +114,12 @@ const char *gpiod_get_label(struct gpio_desc *desc) · 113 unmodified lines
114114 srcu_read_lock_held(&desc->gdev->desc_srcu));
115115
116116 if (test_bit(FLAG_USED_AS_IRQ, &flags))
117− return label->str ?: "interrupt";
117+ return label ? label->str : "interrupt";
118118
119119 if (!test_bit(FLAG_REQUESTED, &flags))
120120 return NULL;
121121
122− return label->str;
122+ return label ? label->str : NULL;
123123 }
124124
125125 static void desc_free_label(struct rcu_head *rh)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+2−2
@@ -1439,8 +1439,8 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, · 1438 unmodified lines
14391439 list_add_tail(&vm->vm_list_node,
14401440 &(vm->process_info->vm_list_head));
14411441 vm->process_info->n_vms++;
1442−
1443− *ef = dma_fence_get(&vm->process_info->eviction_fence->base);
1442+ if (ef)
1443+ *ef = dma_fence_get(&vm->process_info->eviction_fence->base);
14441444 mutex_unlock(&vm->process_info->lock);
14451445
14461446 return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+1−1
@@ -265,7 +265,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, · 264 unmodified lines
265265
266266 /* Only a single BO list is allowed to simplify handling. */
267267 if (p->bo_list)
268− ret = -EINVAL;
268+ goto free_partial_kdata;
269269
270270 ret = amdgpu_cs_p1_bo_handles(p, p->chunks[i].kdata);
271271 if (ret)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c+4−7
@@ -1635,11 +1635,9 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev) · 1634 unmodified lines
16351635 {
16361636 int r;
16371637
1638− if (!amdgpu_sriov_vf(adev)) {
1639− r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
1640− if (r)
1641− return r;
1642− }
1638+ r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
1639+ if (r)
1640+ return r;
16431641
16441642 r = device_create_file(adev->dev, &dev_attr_run_cleaner_shader);
16451643 if (r)
@@ -1650,8 +1648,7 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev) · 4 unmodified lines
16501648
16511649 void amdgpu_gfx_sysfs_isolation_shader_fini(struct amdgpu_device *adev)
16521650 {
1653− if (!amdgpu_sriov_vf(adev))
1654− device_remove_file(adev->dev, &dev_attr_enforce_isolation);
1651+ device_remove_file(adev->dev, &dev_attr_enforce_isolation);
16551652 device_remove_file(adev->dev, &dev_attr_run_cleaner_shader);
16561653 }
16571654
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c+3−2
@@ -1203,8 +1203,10 @@ int amdgpu_mes_add_ring(struct amdgpu_device *adev, int gang_id, · 1202 unmodified lines
12031203
12041204 r = amdgpu_ring_init(adev, ring, 1024, NULL, 0,
12051205 AMDGPU_RING_PRIO_DEFAULT, NULL);
1206− if (r)
1206+ if (r) {
1207+ amdgpu_mes_unlock(&adev->mes);
12071208 goto clean_up_memory;
1209+ }
12081210
12091211 amdgpu_mes_ring_to_queue_props(adev, ring, &qprops);
12101212
@@ -1237,7 +1239,6 @@ clean_up_ring: · 26 unmodified lines
12371239 amdgpu_ring_fini(ring);
12381240 clean_up_memory:
12391241 kfree(ring);
1240− amdgpu_mes_unlock(&adev->mes);
12411242 return r;
12421243 }
12431244
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c+2−2
@@ -621,7 +621,7 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe) · 620 unmodified lines
621621
622622 if (amdgpu_mes_log_enable) {
623623 mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;
624− mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr = mes->event_log_gpu_addr;
624+ mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr = mes->event_log_gpu_addr + pipe * AMDGPU_MES_LOG_BUFFER_SIZE;
625625 }
626626
627627 return mes_v12_0_submit_pkt_and_poll_completion(mes, pipe,
@@ -1336,7 +1336,7 @@ static int mes_v12_0_sw_init(void *handle) · 708 unmodified lines
13361336 adev->mes.kiq_hw_fini = &mes_v12_0_kiq_hw_fini;
13371337 adev->mes.enable_legacy_queue_map = true;
13381338
1339− adev->mes.event_log_size = AMDGPU_MES_LOG_BUFFER_SIZE;
1339+ adev->mes.event_log_size = adev->enable_uni_mes ? (AMDGPU_MAX_MES_PIPES * AMDGPU_MES_LOG_BUFFER_SIZE) : AMDGPU_MES_LOG_BUFFER_SIZE;
13401340
13411341 r = amdgpu_mes_init(adev);
13421342 if (r)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+3−3
@@ -1148,7 +1148,7 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep, · 1147 unmodified lines
11481148
11491149 if (flags & KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM)
11501150 size >>= 1;
1151− WRITE_ONCE(pdd->vram_usage, pdd->vram_usage + PAGE_ALIGN(size));
1151+ atomic64_add(PAGE_ALIGN(size), &pdd->vram_usage);
11521152 }
11531153
11541154 mutex_unlock(&p->mutex);
@@ -1219,7 +1219,7 @@ static int kfd_ioctl_free_memory_of_gpu(struct file *filep, · 64 unmodified lines
12191219 kfd_process_device_remove_obj_handle(
12201220 pdd, GET_IDR_HANDLE(args->handle));
12211221
1222− WRITE_ONCE(pdd->vram_usage, pdd->vram_usage - size);
1222+ atomic64_sub(size, &pdd->vram_usage);
12231223
12241224 err_unlock:
12251225 err_pdd:
@@ -2347,7 +2347,7 @@ static int criu_restore_memory_of_gpu(struct kfd_process_device *pdd, · 1121 unmodified lines
23472347 } else if (bo_bucket->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
23482348 bo_bucket->restored_offset = offset;
23492349 /* Update the VRAM usage count */
2350− WRITE_ONCE(pdd->vram_usage, pdd->vram_usage + bo_bucket->size);
2350+ atomic64_add(bo_bucket->size, &pdd->vram_usage);
23512351 }
23522352 return 0;
23532353 }
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+1−1
@@ -775,7 +775,7 @@ struct kfd_process_device { · 774 unmodified lines
775775 enum kfd_pdd_bound bound;
776776
777777 /* VRAM usage */
778− uint64_t vram_usage;
778+ atomic64_t vram_usage;
779779 struct attribute attr_vram;
780780 char vram_filename[MAX_SYSFS_FILENAME_LEN];
781781
drivers/gpu/drm/amd/amdkfd/kfd_process.c+7−4
@@ -332,7 +332,7 @@ static ssize_t kfd_procfs_show(struct kobject *kobj, struct attribute *attr, · 331 unmodified lines
332332 } else if (strncmp(attr->name, "vram_", 5) == 0) {
333333 struct kfd_process_device *pdd = container_of(attr, struct kfd_process_device,
334334 attr_vram);
335− return snprintf(buffer, PAGE_SIZE, "%llu\n", READ_ONCE(pdd->vram_usage));
335+ return snprintf(buffer, PAGE_SIZE, "%llu\n", atomic64_read(&pdd->vram_usage));
336336 } else if (strncmp(attr->name, "sdma_", 5) == 0) {
337337 struct kfd_process_device *pdd = container_of(attr, struct kfd_process_device,
338338 attr_sdma);
@@ -1625,7 +1625,7 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, · 1286 unmodified lines
16251625 pdd->bound = PDD_UNBOUND;
16261626 pdd->already_dequeued = false;
16271627 pdd->runtime_inuse = false;
1628− pdd->vram_usage = 0;
1628+ atomic64_set(&pdd->vram_usage, 0);
16291629 pdd->sdma_past_activity_counter = 0;
16301630 pdd->user_gpu_id = dev->id;
16311631 atomic64_set(&pdd->evict_duration_counter, 0);
@@ -1702,12 +1702,15 @@ int kfd_process_device_init_vm(struct kfd_process_device *pdd, · 70 unmodified lines
17021702
17031703 ret = amdgpu_amdkfd_gpuvm_acquire_process_vm(dev->adev, avm,
17041704 &p->kgd_process_info,
1705− &ef);
1705+ p->ef ? NULL : &ef);
17061706 if (ret) {
17071707 dev_err(dev->adev->dev, "Failed to create process VM object\n");
17081708 return ret;
17091709 }
1710− RCU_INIT_POINTER(p->ef, ef);
1710+
1711+ if (!p->ef)
1712+ RCU_INIT_POINTER(p->ef, ef);
1713+
17111714 pdd->drm_priv = drm_file->private_data;
17121715
17131716 ret = kfd_process_device_reserve_ib_mem(pdd);
drivers/gpu/drm/amd/amdkfd/kfd_svm.c+26−0
@@ -405,6 +405,27 @@ static void svm_range_bo_release(struct kref *kref) · 404 unmodified lines
405405 spin_lock(&svm_bo->list_lock);
406406 }
407407 spin_unlock(&svm_bo->list_lock);
408+
409+ if (mmget_not_zero(svm_bo->eviction_fence->mm)) {
410+ struct kfd_process_device *pdd;
411+ struct kfd_process *p;
412+ struct mm_struct *mm;
413+
414+ mm = svm_bo->eviction_fence->mm;
415+ /*
416+ * The forked child process takes svm_bo device pages ref, svm_bo could be
417+ * released after parent process is gone.
418+ */
419+ p = kfd_lookup_process_by_mm(mm);
420+ if (p) {
421+ pdd = kfd_get_process_device_data(svm_bo->node, p);
422+ if (pdd)
423+ atomic64_sub(amdgpu_bo_size(svm_bo->bo), &pdd->vram_usage);
424+ kfd_unref_process(p);
425+ }
426+ mmput(mm);
427+ }
428+
408429 if (!dma_fence_is_signaled(&svm_bo->eviction_fence->base))
409430 /* We're not in the eviction worker. Signal the fence. */
410431 dma_fence_signal(&svm_bo->eviction_fence->base);
@@ -532,6 +553,7 @@ int · 121 unmodified lines
532553 svm_range_vram_node_new(struct kfd_node *node, struct svm_range *prange,
533554 bool clear)
534555 {
556+ struct kfd_process_device *pdd;
535557 struct amdgpu_bo_param bp;
536558 struct svm_range_bo *svm_bo;
537559 struct amdgpu_bo_user *ubo;
@@ -623,6 +645,10 @@ svm_range_vram_node_new(struct kfd_node *node, struct svm_range *prange, · 85 unmodified lines
623645 list_add(&prange->svm_bo_list, &svm_bo->range_list);
624646 spin_unlock(&svm_bo->list_lock);
625647
648+ pdd = svm_range_get_pdd_by_node(prange, node);
649+ if (pdd)
650+ atomic64_add(amdgpu_bo_size(bo), &pdd->vram_usage);
651+
626652 return 0;
627653
628654 reserve_bo_failed:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+22−5
@@ -770,6 +770,12 @@ static void dmub_hpd_callback(struct amdgpu_device *adev, · 769 unmodified lines
770770 return;
771771 }
772772
773+ /* Skip DMUB HPD IRQ in suspend/resume. We will probe them later. */
774+ if (notify->type == DMUB_NOTIFICATION_HPD && adev->in_suspend) {
775+ DRM_INFO("Skip DMUB HPD IRQ callback in suspend/resume\n");
776+ return;
777+ }
778+
773779 link_index = notify->link_index;
774780 link = adev->dm.dc->links[link_index];
775781 dev = adev->dm.ddev;
@@ -2026,7 +2032,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1250 unmodified lines
20262032 DRM_ERROR("amdgpu: failed to initialize vblank_workqueue.\n");
20272033 }
20282034
2029− if (adev->dm.dc->caps.ips_support && adev->dm.dc->config.disable_ips == DMUB_IPS_ENABLE)
2035+ if (adev->dm.dc->caps.ips_support &&
2036+ adev->dm.dc->config.disable_ips != DMUB_IPS_DISABLE_ALL)
20302037 adev->dm.idle_workqueue = idle_create_workqueue(adev);
20312038
20322039 if (adev->dm.dc->caps.max_links > 0 && adev->family >= AMDGPU_FAMILY_RV) {
@@ -2965,10 +2972,11 @@ static int dm_suspend(void *handle) · 932 unmodified lines
29652972
29662973 hpd_rx_irq_work_suspend(dm);
29672974
2968− if (adev->dm.dc->caps.ips_support)
2969− dc_allow_idle_optimizations(adev->dm.dc, true);
2970−
29712975 dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);
2976+
2977+ if (dm->dc->caps.ips_support && adev->in_s0ix)
2978+ dc_allow_idle_optimizations(dm->dc, true);
2979+
29722980 dc_dmub_srv_set_power_state(dm->dc->ctx->dmub_srv, DC_ACPI_CM_POWER_STATE_D3);
29732981
29742982 return 0;
@@ -6735,12 +6743,21 @@ create_stream_for_sink(struct drm_connector *connector, · 3760 unmodified lines
67356743 if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
67366744 stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
67376745 stream->signal == SIGNAL_TYPE_EDP) {
6746+ const struct dc_edid_caps *edid_caps;
6747+ unsigned int disable_colorimetry = 0;
6748+
6749+ if (aconnector->dc_sink) {
6750+ edid_caps = &aconnector->dc_sink->edid_caps;
6751+ disable_colorimetry = edid_caps->panel_patch.disable_colorimetry;
6752+ }
6753+
67386754 //
67396755 // should decide stream support vsc sdp colorimetry capability
67406756 // before building vsc info packet
67416757 //
67426758 stream->use_vsc_sdp_for_colorimetry = stream->link->dpcd_caps.dpcd_rev.raw >= 0x14 &&
6743− stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED;
6759+ stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED &&
6760+ !disable_colorimetry;
67446761
67456762 if (stream->out_transfer_func.tf == TRANSFER_FUNCTION_GAMMA22)
67466763 tf = TRANSFER_FUNC_GAMMA_22;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c+4−0
@@ -73,6 +73,10 @@ static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps) · 72 unmodified lines
7373 DRM_DEBUG_DRIVER("Clearing DPCD 0x317 on monitor with panel id %X\n", panel_id);
7474 edid_caps->panel_patch.remove_sink_ext_caps = true;
7575 break;
76+ case drm_edid_encode_panel_id('S', 'D', 'C', 0x4154):
77+ DRM_DEBUG_DRIVER("Disabling VSC on monitor with panel id %X\n", panel_id);
78+ edid_caps->panel_patch.disable_colorimetry = true;
79+ break;
7680 default:
7781 return;
7882 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+13−4
@@ -1027,6 +1027,7 @@ static int try_disable_dsc(struct drm_atomic_state *state, · 1026 unmodified lines
10271027 int remaining_to_try = 0;
10281028 int ret;
10291029 uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link);
1030+ int var_pbn;
10301031
10311032 for (i = 0; i < count; i++) {
10321033 if (vars[i + k].dsc_enabled
@@ -1057,13 +1058,18 @@ static int try_disable_dsc(struct drm_atomic_state *state, · 24 unmodified lines
10571058 break;
10581059
10591060 DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index);
1061+ var_pbn = vars[next_index].pbn;
10601062 vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
10611063 ret = drm_dp_atomic_find_time_slots(state,
10621064 params[next_index].port->mgr,
10631065 params[next_index].port,
10641066 vars[next_index].pbn);
1065− if (ret < 0)
1067+ if (ret < 0) {
1068+ DRM_DEBUG_DRIVER("%s:%d MST_DSC index #%d, failed to set pbn to the state, %d\n",
1069+ __func__, __LINE__, next_index, ret);
1070+ vars[next_index].pbn = var_pbn;
10661071 return ret;
1072+ }
10671073
10681074 ret = drm_dp_mst_atomic_check(state);
10691075 if (ret == 0) {
@@ -1071,14 +1077,17 @@ static int try_disable_dsc(struct drm_atomic_state *state, · 1 unmodified line
10711077 vars[next_index].dsc_enabled = false;
10721078 vars[next_index].bpp_x16 = 0;
10731079 } else {
1074− DRM_DEBUG_DRIVER("MST_DSC index #%d, restore minimum compression\n", next_index);
1075− vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
1080+ DRM_DEBUG_DRIVER("MST_DSC index #%d, restore optimized pbn value\n", next_index);
1081+ vars[next_index].pbn = var_pbn;
10761082 ret = drm_dp_atomic_find_time_slots(state,
10771083 params[next_index].port->mgr,
10781084 params[next_index].port,
10791085 vars[next_index].pbn);
1080− if (ret < 0)
1086+ if (ret < 0) {
1087+ DRM_DEBUG_DRIVER("%s:%d MST_DSC index #%d, failed to set pbn to the state, %d\n",
1088+ __func__, __LINE__, next_index, ret);
10811089 return ret;
1090+ }
10821091 }
10831092
10841093 tried[next_index] = true;
drivers/gpu/drm/amd/display/dc/core/dc.c+34−11
@@ -5065,11 +5065,26 @@ static bool update_planes_and_stream_v3(struct dc *dc, · 5064 unmodified lines
50655065 return true;
50665066 }
50675067
5068+static void clear_update_flags(struct dc_surface_update *srf_updates,
5069+ int surface_count, struct dc_stream_state *stream)
5070+{
5071+ int i;
5072+
5073+ if (stream)
5074+ stream->update_flags.raw = 0;
5075+
5076+ for (i = 0; i < surface_count; i++)
5077+ if (srf_updates[i].surface)
5078+ srf_updates[i].surface->update_flags.raw = 0;
5079+}
5080+
50685081 bool dc_update_planes_and_stream(struct dc *dc,
50695082 struct dc_surface_update *srf_updates, int surface_count,
50705083 struct dc_stream_state *stream,
50715084 struct dc_stream_update *stream_update)
50725085 {
5086+ bool ret = false;
5087+
50735088 dc_exit_ips_for_hw_access(dc);
50745089 /*
50755090 * update planes and stream version 3 separates FULL and FAST updates
@@ -5086,10 +5101,16 @@ bool dc_update_planes_and_stream(struct dc *dc, · 10 unmodified lines
50865101 * features as they are now transparent to the new sequence.
50875102 */
50885103 if (dc->ctx->dce_version >= DCN_VERSION_4_01)
5089− return update_planes_and_stream_v3(dc, srf_updates,
5104+ ret = update_planes_and_stream_v3(dc, srf_updates,
50905105 surface_count, stream, stream_update);
5091− return update_planes_and_stream_v2(dc, srf_updates,
5106+ else
5107+ ret = update_planes_and_stream_v2(dc, srf_updates,
50925108 surface_count, stream, stream_update);
5109+
5110+ if (ret)
5111+ clear_update_flags(srf_updates, surface_count, stream);
5112+
5113+ return ret;
50935114 }
50945115
50955116 void dc_commit_updates_for_stream(struct dc *dc,
@@ -5099,6 +5120,8 @@ void dc_commit_updates_for_stream(struct dc *dc, · 3 unmodified lines
50995120 struct dc_stream_update *stream_update,
51005121 struct dc_state *state)
51015122 {
5123+ bool ret = false;
5124+
51025125 dc_exit_ips_for_hw_access(dc);
51035126 /* TODO: Since change commit sequence can have a huge impact,
51045127 * we decided to only enable it for DCN3x. However, as soon as
@@ -5106,17 +5129,17 @@ void dc_commit_updates_for_stream(struct dc *dc, · 1 unmodified line
51065129 * the new sequence for all ASICs.
51075130 */
51085131 if (dc->ctx->dce_version >= DCN_VERSION_4_01) {
5109− update_planes_and_stream_v3(dc, srf_updates, surface_count,
5132+ ret = update_planes_and_stream_v3(dc, srf_updates, surface_count,
51105133 stream, stream_update);
5111− return;
5112− }
5113− if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
5114− update_planes_and_stream_v2(dc, srf_updates, surface_count,
5134+ } else if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
5135+ ret = update_planes_and_stream_v2(dc, srf_updates, surface_count,
51155136 stream, stream_update);
5116− return;
5117− }
5118− update_planes_and_stream_v1(dc, srf_updates, surface_count, stream,
5119− stream_update, state);
5137+ } else
5138+ ret = update_planes_and_stream_v1(dc, srf_updates, surface_count, stream,
5139+ stream_update, state);
5140+
5141+ if (ret)
5142+ clear_update_flags(srf_updates, surface_count, stream);
51205143 }
51215144
51225145 uint8_t dc_get_current_stream_count(struct dc *dc)
drivers/gpu/drm/amd/display/dc/dc_types.h+1−0
@@ -178,6 +178,7 @@ struct dc_panel_patch { · 177 unmodified lines
178178 unsigned int skip_avmute;
179179 unsigned int mst_start_top_delay;
180180 unsigned int remove_sink_ext_caps;
181+ unsigned int disable_colorimetry;
181182 };
182183
183184 struct dc_edid_caps {
drivers/gpu/drm/amd/display/dc/dml2/dml2_policy.c+0−1
@@ -303,7 +303,6 @@ 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;
307306 policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/
308307 policy->UseOnlyMaxPrefetchModes = 1;
309308 }
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c+1−0
@@ -766,6 +766,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 765 unmodified lines
766766 .disable_dmub_reallow_idle = false,
767767 .static_screen_wait_frames = 2,
768768 .notify_dpia_hr_bw = true,
769+ .min_disp_clk_khz = 50000,
769770 };
770771
771772 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h+13−13
@@ -60,7 +60,7 @@ struct vi_dpm_level { · 59 unmodified lines
6060
6161 struct vi_dpm_table {
6262 uint32_t count;
63− struct vi_dpm_level dpm_level[] __counted_by(count);
63+ struct vi_dpm_level dpm_level[];
6464 };
6565
6666 #define PCIE_PERF_REQ_REMOVE_REGISTRY 0
@@ -91,7 +91,7 @@ struct phm_set_power_state_input { · 24 unmodified lines
9191
9292 struct phm_clock_array {
9393 uint32_t count;
94− uint32_t values[] __counted_by(count);
94+ uint32_t values[];
9595 };
9696
9797 struct phm_clock_voltage_dependency_record {
@@ -123,7 +123,7 @@ struct phm_acpclock_voltage_dependency_record { · 25 unmodified lines
123123
124124 struct phm_clock_voltage_dependency_table {
125125 uint32_t count;
126− struct phm_clock_voltage_dependency_record entries[] __counted_by(count);
126+ struct phm_clock_voltage_dependency_record entries[];
127127 };
128128
129129 struct phm_phase_shedding_limits_record {
@@ -140,7 +140,7 @@ struct phm_uvd_clock_voltage_dependency_record { · 10 unmodified lines
140140
141141 struct phm_uvd_clock_voltage_dependency_table {
142142 uint8_t count;
143− struct phm_uvd_clock_voltage_dependency_record entries[] __counted_by(count);
143+ struct phm_uvd_clock_voltage_dependency_record entries[];
144144 };
145145
146146 struct phm_acp_clock_voltage_dependency_record {
@@ -150,7 +150,7 @@ struct phm_acp_clock_voltage_dependency_record { · 3 unmodified lines
150150
151151 struct phm_acp_clock_voltage_dependency_table {
152152 uint32_t count;
153− struct phm_acp_clock_voltage_dependency_record entries[] __counted_by(count);
153+ struct phm_acp_clock_voltage_dependency_record entries[];
154154 };
155155
156156 struct phm_vce_clock_voltage_dependency_record {
@@ -161,32 +161,32 @@ struct phm_vce_clock_voltage_dependency_record { · 4 unmodified lines
161161
162162 struct phm_phase_shedding_limits_table {
163163 uint32_t count;
164− struct phm_phase_shedding_limits_record entries[] __counted_by(count);
164+ struct phm_phase_shedding_limits_record entries[];
165165 };
166166
167167 struct phm_vceclock_voltage_dependency_table {
168168 uint8_t count;
169− struct phm_vceclock_voltage_dependency_record entries[] __counted_by(count);
169+ struct phm_vceclock_voltage_dependency_record entries[];
170170 };
171171
172172 struct phm_uvdclock_voltage_dependency_table {
173173 uint8_t count;
174− struct phm_uvdclock_voltage_dependency_record entries[] __counted_by(count);
174+ struct phm_uvdclock_voltage_dependency_record entries[];
175175 };
176176
177177 struct phm_samuclock_voltage_dependency_table {
178178 uint8_t count;
179− struct phm_samuclock_voltage_dependency_record entries[] __counted_by(count);
179+ struct phm_samuclock_voltage_dependency_record entries[];
180180 };
181181
182182 struct phm_acpclock_voltage_dependency_table {
183183 uint32_t count;
184− struct phm_acpclock_voltage_dependency_record entries[] __counted_by(count);
184+ struct phm_acpclock_voltage_dependency_record entries[];
185185 };
186186
187187 struct phm_vce_clock_voltage_dependency_table {
188188 uint8_t count;
189− struct phm_vce_clock_voltage_dependency_record entries[] __counted_by(count);
189+ struct phm_vce_clock_voltage_dependency_record entries[];
190190 };
191191
192192
@@ -393,7 +393,7 @@ union phm_cac_leakage_record { · 200 unmodified lines
393393
394394 struct phm_cac_leakage_table {
395395 uint32_t count;
396− union phm_cac_leakage_record entries[] __counted_by(count);
396+ union phm_cac_leakage_record entries[];
397397 };
398398
399399 struct phm_samu_clock_voltage_dependency_record {
@@ -404,7 +404,7 @@ struct phm_samu_clock_voltage_dependency_record { · 4 unmodified lines
404404
405405 struct phm_samu_clock_voltage_dependency_table {
406406 uint8_t count;
407− struct phm_samu_clock_voltage_dependency_record entries[] __counted_by(count);
407+ struct phm_samu_clock_voltage_dependency_record entries[];
408408 };
409409
410410 struct phm_cac_tdp_table {
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+8−4
@@ -1264,7 +1264,11 @@ static int smu_sw_init(void *handle) · 1263 unmodified lines
12641264 smu->workload_prority[PP_SMC_POWER_PROFILE_VR] = 4;
12651265 smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
12661266 smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
1267− smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
1267+
1268+ if (smu->is_apu)
1269+ smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
1270+ else
1271+ smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
12681272
12691273 smu->workload_setting[0] = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
12701274 smu->workload_setting[1] = PP_SMC_POWER_PROFILE_FULLSCREEN3D;
@@ -2226,7 +2230,7 @@ static int smu_bump_power_profile_mode(struct smu_context *smu, · 955 unmodified lines
22262230 static int smu_adjust_power_state_dynamic(struct smu_context *smu,
22272231 enum amd_dpm_forced_level level,
22282232 bool skip_display_settings,
2229− bool force_update)
2233+ bool init)
22302234 {
22312235 int ret = 0;
22322236 int index = 0;
@@ -2255,7 +2259,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu, · 22 unmodified lines
22552259 }
22562260 }
22572261
2258− if (force_update || smu_dpm_ctx->dpm_level != level) {
2262+ if (smu_dpm_ctx->dpm_level != level) {
22592263 ret = smu_asic_set_performance_level(smu, level);
22602264 if (ret) {
22612265 dev_err(smu->adev->dev, "Failed to set performance level!");
@@ -2272,7 +2276,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu, · 10 unmodified lines
22722276 index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;
22732277 workload[0] = smu->workload_setting[index];
22742278
2275− if (force_update || smu->power_profile_mode != workload[0])
2279+ if (init || smu->power_profile_mode != workload[0])
22762280 smu_bump_power_profile_mode(smu, workload, 0);
22772281 }
22782282
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+10−12
@@ -2555,18 +2555,16 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 2554 unmodified lines
25552555 workload_mask = 1 << workload_type;
25562556
25572557 /* Add optimizations for SMU13.0.0/10. Reuse the power saving profile */
2558− if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_COMPUTE) {
2559− if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0) &&
2560− ((smu->adev->pm.fw_version == 0x004e6601) ||
2561− (smu->adev->pm.fw_version >= 0x004e7300))) ||
2562− (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 10) &&
2563− smu->adev->pm.fw_version >= 0x00504500)) {
2564− workload_type = smu_cmn_to_asic_specific_index(smu,
2565− CMN2ASIC_MAPPING_WORKLOAD,
2566− PP_SMC_POWER_PROFILE_POWERSAVING);
2567− if (workload_type >= 0)
2568− workload_mask |= 1 << workload_type;
2569− }
2558+ if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0) &&
2559+ ((smu->adev->pm.fw_version == 0x004e6601) ||
2560+ (smu->adev->pm.fw_version >= 0x004e7300))) ||
2561+ (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 10) &&
2562+ smu->adev->pm.fw_version >= 0x00504500)) {
2563+ workload_type = smu_cmn_to_asic_specific_index(smu,
2564+ CMN2ASIC_MAPPING_WORKLOAD,
2565+ PP_SMC_POWER_PROFILE_POWERSAVING);
2566+ if (workload_type >= 0)
2567+ workload_mask |= 1 << workload_type;
25702568 }
25712569
25722570 ret = smu_cmn_send_smc_msg_with_param(smu,
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/display/drm_dp_mst_topology.c+8−2
@@ -6083,6 +6083,7 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 6082 unmodified lines
60836083 struct drm_dp_aux *immediate_upstream_aux;
60846084 struct drm_dp_mst_port *fec_port;
60856085 struct drm_dp_desc desc = {};
6086+ u8 upstream_dsc;
60866087 u8 endpoint_fec;
60876088 u8 endpoint_dsc;
60886089
@@ -6109,8 +6110,6 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 20 unmodified lines
61096110
61106111 /* DP-to-DP peer device */
61116112 if (drm_dp_mst_is_virtual_dpcd(immediate_upstream_port)) {
6112− u8 upstream_dsc;
6113−
61146113 if (drm_dp_dpcd_read(&port->aux,
61156114 DP_DSC_SUPPORT, &endpoint_dsc, 1) != 1)
61166115 return NULL;
@@ -6156,6 +6155,13 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 39 unmodified lines
61566155 if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD)) {
61576156 u8 dpcd_ext[DP_RECEIVER_CAP_SIZE];
61586157
6158+ if (drm_dp_dpcd_read(immediate_upstream_aux,
6159+ DP_DSC_SUPPORT, &upstream_dsc, 1) != 1)
6160+ return NULL;
6161+
6162+ if (!(upstream_dsc & DP_DSC_DECOMPRESSION_IS_SUPPORTED))
6163+ return NULL;
6164+
61596165 if (drm_dp_read_dpcd_caps(immediate_upstream_aux, dpcd_ext) < 0)
61606166 return NULL;
61616167
drivers/gpu/drm/display/drm_hdmi_state_helper.c+1−3
@@ -521,8 +521,6 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, · 520 unmodified lines
521521 }
522522 EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check);
523523
524−#define HDMI_MAX_INFOFRAME_SIZE 29
525−
526524 static int clear_device_infoframe(struct drm_connector *connector,
527525 enum hdmi_infoframe_type type)
528526 {
@@ -563,7 +561,7 @@ static int write_device_infoframe(struct drm_connector *connector, · 34 unmodified lines
563561 {
564562 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs;
565563 struct drm_device *dev = connector->dev;
566− u8 buffer[HDMI_MAX_INFOFRAME_SIZE];
564+ u8 buffer[HDMI_INFOFRAME_SIZE(MAX)];
567565 int ret;
568566 int len;
569567
drivers/gpu/drm/drm_atomic_uapi.c+1−1
@@ -543,7 +543,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, · 542 unmodified lines
543543 &state->fb_damage_clips,
544544 val,
545545 -1,
546− sizeof(struct drm_rect),
546+ sizeof(struct drm_mode_rect),
547547 &replaced);
548548 return ret;
549549 } else if (property == plane->scaling_filter_property) {
drivers/gpu/drm/drm_debugfs.c+1−3
@@ -520,8 +520,6 @@ static const struct file_operations drm_connector_fops = { · 519 unmodified lines
520520 .write = connector_write
521521 };
522522
523−#define HDMI_MAX_INFOFRAME_SIZE 29
524−
525523 static ssize_t
526524 audio_infoframe_read(struct file *filp, char __user *ubuf, size_t count, loff_t *ppos)
527525 {
@@ -579,7 +577,7 @@ static ssize_t _f##_read_infoframe(struct file *filp, \ · 51 unmodified lines
579577 struct drm_connector *connector; \
580578 union hdmi_infoframe *frame; \
581579 struct drm_device *dev; \
582− u8 buf[HDMI_MAX_INFOFRAME_SIZE]; \
580+ u8 buf[HDMI_INFOFRAME_SIZE(MAX)]; \
583581 ssize_t len = 0; \
584582 \
585583 connector = filp->private_data; \
drivers/gpu/drm/drm_fbdev_dma.c+2−1
@@ -50,7 +50,8 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info) · 49 unmodified lines
5050 if (!fb_helper->dev)
5151 return;
5252
53− fb_deferred_io_cleanup(info);
53+ if (info->fbdefio)
54+ fb_deferred_io_cleanup(info);
5455 drm_fb_helper_fini(fb_helper);
5556
5657 drm_client_buffer_vunmap(fb_helper->buffer);
drivers/gpu/drm/i915/display/intel_dp_mst.c+30−10
@@ -89,25 +89,19 @@ static int intel_dp_mst_max_dpt_bpp(const struct intel_crtc_state *crtc_state, · 88 unmodified lines
8989
9090 static int intel_dp_mst_bw_overhead(const struct intel_crtc_state *crtc_state,
9191 const struct intel_connector *connector,
92− bool ssc, bool dsc, int bpp_x16)
92+ bool ssc, int dsc_slice_count, int bpp_x16)
9393 {
9494 const struct drm_display_mode *adjusted_mode =
9595 &crtc_state->hw.adjusted_mode;
9696 unsigned long flags = DRM_DP_BW_OVERHEAD_MST;
97− int dsc_slice_count = 0;
9897 int overhead;
9998
10099 flags |= intel_dp_is_uhbr(crtc_state) ? DRM_DP_BW_OVERHEAD_UHBR : 0;
101100 flags |= ssc ? DRM_DP_BW_OVERHEAD_SSC_REF_CLK : 0;
102101 flags |= crtc_state->fec_enable ? DRM_DP_BW_OVERHEAD_FEC : 0;
103102
104− if (dsc) {
103+ if (dsc_slice_count)
105104 flags |= DRM_DP_BW_OVERHEAD_DSC;
106− dsc_slice_count = intel_dp_dsc_get_slice_count(connector,
107− adjusted_mode->clock,
108− adjusted_mode->hdisplay,
109− crtc_state->joiner_pipes);
110− }
111105
112106 overhead = drm_dp_bw_overhead(crtc_state->lane_count,
113107 adjusted_mode->hdisplay,
@@ -153,6 +147,19 @@ static int intel_dp_mst_calc_pbn(int pixel_clock, int bpp_x16, int bw_overhead) · 39 unmodified lines
153147 return DIV_ROUND_UP(effective_data_rate * 64, 54 * 1000);
154148 }
155149
150+static int intel_dp_mst_dsc_get_slice_count(const struct intel_connector *connector,
151+ const struct intel_crtc_state *crtc_state)
152+{
153+ const struct drm_display_mode *adjusted_mode =
154+ &crtc_state->hw.adjusted_mode;
155+ int num_joined_pipes = crtc_state->joiner_pipes;
156+
157+ return intel_dp_dsc_get_slice_count(connector,
158+ adjusted_mode->clock,
159+ adjusted_mode->hdisplay,
160+ num_joined_pipes);
161+}
162+
156163 static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
157164 struct intel_crtc_state *crtc_state,
158165 int max_bpp,
@@ -172,6 +179,7 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, · 13 unmodified lines
172179 const struct drm_display_mode *adjusted_mode =
173180 &crtc_state->hw.adjusted_mode;
174181 int bpp, slots = -EINVAL;
182+ int dsc_slice_count = 0;
175183 int max_dpt_bpp;
176184 int ret = 0;
177185
@@ -203,6 +211,15 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, · 25 unmodified lines
203211 drm_dbg_kms(&i915->drm, "Looking for slots in range min bpp %d max bpp %d\n",
204212 min_bpp, max_bpp);
205213
214+ if (dsc) {
215+ dsc_slice_count = intel_dp_mst_dsc_get_slice_count(connector, crtc_state);
216+ if (!dsc_slice_count) {
217+ drm_dbg_kms(&i915->drm, "Can't get valid DSC slice count\n");
218+
219+ return -ENOSPC;
220+ }
221+ }
222+
206223 for (bpp = max_bpp; bpp >= min_bpp; bpp -= step) {
207224 int local_bw_overhead;
208225 int remote_bw_overhead;
@@ -216,9 +233,9 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, · 7 unmodified lines
216233 intel_dp_output_bpp(crtc_state->output_format, bpp));
217234
218235 local_bw_overhead = intel_dp_mst_bw_overhead(crtc_state, connector,
219− false, dsc, link_bpp_x16);
236+ false, dsc_slice_count, link_bpp_x16);
220237 remote_bw_overhead = intel_dp_mst_bw_overhead(crtc_state, connector,
221− true, dsc, link_bpp_x16);
238+ true, dsc_slice_count, link_bpp_x16);
222239
223240 intel_dp_mst_compute_m_n(crtc_state, connector,
224241 local_bw_overhead,
@@ -449,6 +466,9 @@ hblank_expansion_quirk_needs_dsc(const struct intel_connector *connector, · 224 unmodified lines
449466 if (mode_hblank_period_ns(adjusted_mode) > hblank_limit)
450467 return false;
451468
469+ if (!intel_dp_mst_dsc_get_slice_count(connector, crtc_state))
470+ return false;
471+
452472 return true;
453473 }
454474
drivers/gpu/drm/i915/display/intel_fb.c+13−0
@@ -438,6 +438,19 @@ bool intel_fb_needs_64k_phys(u64 modifier) · 437 unmodified lines
438438 INTEL_PLANE_CAP_NEED64K_PHYS);
439439 }
440440
441+/**
442+ * intel_fb_is_tile4_modifier: Check if a modifier is a tile4 modifier type
443+ * @modifier: Modifier to check
444+ *
445+ * Returns:
446+ * Returns %true if @modifier is a tile4 modifier.
447+ */
448+bool intel_fb_is_tile4_modifier(u64 modifier)
449+{
450+ return plane_caps_contain_any(lookup_modifier(modifier)->plane_caps,
451+ INTEL_PLANE_CAP_TILING_4);
452+}
453+
441454 static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md,
442455 u8 display_ver_from, u8 display_ver_until)
443456 {
drivers/gpu/drm/i915/display/intel_fb.h+1−0
@@ -35,6 +35,7 @@ bool intel_fb_is_ccs_modifier(u64 modifier); · 34 unmodified lines
3535 bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier);
3636 bool intel_fb_is_mc_ccs_modifier(u64 modifier);
3737 bool intel_fb_needs_64k_phys(u64 modifier);
38+bool intel_fb_is_tile4_modifier(u64 modifier);
3839
3940 bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane);
4041 int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb);
drivers/gpu/drm/i915/display/intel_hdcp.c+7−3
@@ -1094,7 +1094,8 @@ static void intel_hdcp_update_value(struct intel_connector *connector, · 1093 unmodified lines
10941094 hdcp->value = value;
10951095 if (update_property) {
10961096 drm_connector_get(&connector->base);
1097− queue_work(i915->unordered_wq, &hdcp->prop_work);
1097+ if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
1098+ drm_connector_put(&connector->base);
10981099 }
10991100 }
11001101
@@ -2524,7 +2525,8 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, · 1423 unmodified lines
25242525 mutex_lock(&hdcp->mutex);
25252526 hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
25262527 drm_connector_get(&connector->base);
2527− queue_work(i915->unordered_wq, &hdcp->prop_work);
2528+ if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
2529+ drm_connector_put(&connector->base);
25282530 mutex_unlock(&hdcp->mutex);
25292531 }
25302532
@@ -2541,7 +2543,9 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, · 10 unmodified lines
25412543 */
25422544 if (!desired_and_not_enabled && !content_protection_type_changed) {
25432545 drm_connector_get(&connector->base);
2544− queue_work(i915->unordered_wq, &hdcp->prop_work);
2546+ if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
2547+ drm_connector_put(&connector->base);
2548+
25452549 }
25462550 }
25472551
drivers/gpu/drm/i915/display/skl_universal_plane.c+11−0
@@ -1591,6 +1591,17 @@ static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state, · 1590 unmodified lines
15911591 return -EINVAL;
15921592 }
15931593
1594+ /*
1595+ * Display20 onward tile4 hflip is not supported
1596+ */
1597+ if (rotation & DRM_MODE_REFLECT_X &&
1598+ intel_fb_is_tile4_modifier(fb->modifier) &&
1599+ DISPLAY_VER(dev_priv) >= 20) {
1600+ drm_dbg_kms(&dev_priv->drm,
1601+ "horizontal flip is not supported with tile4 surface formats\n");
1602+ return -EINVAL;
1603+ }
1604+
15941605 if (drm_rotation_90_or_270(rotation)) {
15951606 if (!intel_fb_supports_90_270_rotation(to_intel_framebuffer(fb))) {
15961607 drm_dbg_kms(&dev_priv->drm,
drivers/gpu/drm/i915/gem/i915_gem_ttm.c+1−1
@@ -1131,7 +1131,7 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) · 1130 unmodified lines
11311131 GEM_WARN_ON(!i915_ttm_cpu_maps_iomem(bo->resource));
11321132 }
11331133
1134− if (wakeref & CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND)
1134+ if (wakeref && CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND != 0)
11351135 intel_wakeref_auto(&to_i915(obj->base.dev)->runtime_pm.userfault_wakeref,
11361136 msecs_to_jiffies_timeout(CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND));
11371137
drivers/gpu/drm/mgag200/mgag200_drv.c+0−38
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #include <drm/drm_managed.h>
1919 #include <drm/drm_module.h>
2020 #include <drm/drm_pciids.h>
21−#include <drm/drm_vblank.h>
2221
2322 #include "mgag200_drv.h"
2423
@@ -85,34 +84,6 @@ resource_size_t mgag200_probe_vram(void __iomem *mem, resource_size_t size) · 60 unmodified lines
8584 return offset - 65536;
8685 }
8786
88−static irqreturn_t mgag200_irq_handler(int irq, void *arg)
89−{
90− struct drm_device *dev = arg;
91− struct mga_device *mdev = to_mga_device(dev);
92− struct drm_crtc *crtc;
93− u32 status, ien;
94−
95− status = RREG32(MGAREG_STATUS);
96−
97− if (status & MGAREG_STATUS_VLINEPEN) {
98− ien = RREG32(MGAREG_IEN);
99− if (!(ien & MGAREG_IEN_VLINEIEN))
100− goto out;
101−
102− crtc = drm_crtc_from_index(dev, 0);
103− if (WARN_ON_ONCE(!crtc))
104− goto out;
105− drm_crtc_handle_vblank(crtc);
106−
107− WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
108−
109− return IRQ_HANDLED;
110− }
111−
112−out:
113− return IRQ_NONE;
114−}
115−
11687 /*
11788 * DRM driver
11889 */
@@ -196,7 +167,6 @@ int mgag200_device_init(struct mga_device *mdev, · 77 unmodified lines
196167 const struct mgag200_device_funcs *funcs)
197168 {
198169 struct drm_device *dev = &mdev->base;
199− struct pci_dev *pdev = to_pci_dev(dev->dev);
200170 u8 crtcext3, misc;
201171 int ret;
202172
@@ -223,14 +193,6 @@ int mgag200_device_init(struct mga_device *mdev, · 20 unmodified lines
223193 mutex_unlock(&mdev->rmmio_lock);
224194
225195 WREG32(MGAREG_IEN, 0);
226− WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
227−
228− ret = devm_request_irq(&pdev->dev, pdev->irq, mgag200_irq_handler, IRQF_SHARED,
229− dev->driver->name, dev);
230− if (ret) {
231− drm_err(dev, "Failed to acquire interrupt, error %d\n", ret);
232− return ret;
233− }
234196
235197 return 0;
236198 }
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
@@ -331,7 +331,7 @@ nouveau_accel_ce_init(struct nouveau_drm *drm) · 330 unmodified lines
331331 return;
332332 }
333333
334− ret = nouveau_channel_new(&drm->client, false, runm, NvDmaFB, NvDmaTT, &drm->cechan);
334+ ret = nouveau_channel_new(&drm->client, true, runm, NvDmaFB, NvDmaTT, &drm->cechan);
335335 if (ret)
336336 NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
337337 }
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_drv.c+1−0
@@ -1383,6 +1383,7 @@ static const struct file_operations panthor_drm_driver_fops = { · 1382 unmodified lines
13831383 .read = drm_read,
13841384 .llseek = noop_llseek,
13851385 .mmap = panthor_mmap,
1386+ .fop_flags = FOP_UNSIGNED_OFFSET,
13861387 };
13871388
13881389 #ifdef CONFIG_DEBUG_FS
drivers/gpu/drm/panthor/panthor_mmu.c+8−0
@@ -1251,9 +1251,17 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx, · 1250 unmodified lines
12511251 goto err_cleanup;
12521252 }
12531253
1254+ /* drm_gpuvm_bo_obtain_prealloc() will call drm_gpuvm_bo_put() on our
1255+ * pre-allocated BO if the <BO,VM> association exists. Given we
1256+ * only have one ref on preallocated_vm_bo, drm_gpuvm_bo_destroy() will
1257+ * be called immediately, and we have to hold the VM resv lock when
1258+ * calling this function.
1259+ */
1260+ dma_resv_lock(panthor_vm_resv(vm), NULL);
12541261 mutex_lock(&bo->gpuva_list_lock);
12551262 op_ctx->map.vm_bo = drm_gpuvm_bo_obtain_prealloc(preallocated_vm_bo);
12561263 mutex_unlock(&bo->gpuva_list_lock);
1264+ dma_resv_unlock(panthor_vm_resv(vm));
12571265
12581266 /* If the a vm_bo for this <VM,BO> combination exists, it already
12591267 * retains a pin ref, and we can release the one we took earlier.
drivers/gpu/drm/panthor/panthor_sched.c+25−11
@@ -1103,7 +1103,13 @@ cs_slot_sync_queue_state_locked(struct panthor_device *ptdev, u32 csg_id, u32 cs · 1102 unmodified lines
11031103 list_move_tail(&group->wait_node,
11041104 &group->ptdev->scheduler->groups.waiting);
11051105 }
1106− group->blocked_queues |= BIT(cs_id);
1106+
1107+ /* The queue is only blocked if there's no deferred operation
1108+ * pending, which can be checked through the scoreboard status.
1109+ */
1110+ if (!cs_iface->output->status_scoreboards)
1111+ group->blocked_queues |= BIT(cs_id);
1112+
11071113 queue->syncwait.gpu_va = cs_iface->output->status_wait_sync_ptr;
11081114 queue->syncwait.ref = cs_iface->output->status_wait_sync_value;
11091115 status_wait_cond = cs_iface->output->status_wait & CS_STATUS_WAIT_SYNC_COND_MASK;
@@ -2046,6 +2052,7 @@ static void · 936 unmodified lines
20462052 tick_ctx_cleanup(struct panthor_scheduler *sched,
20472053 struct panthor_sched_tick_ctx *ctx)
20482054 {
2055+ struct panthor_device *ptdev = sched->ptdev;
20492056 struct panthor_group *group, *tmp;
20502057 u32 i;
20512058
@@ -2054,7 +2061,7 @@ tick_ctx_cleanup(struct panthor_scheduler *sched, · 2 unmodified lines
20542061 /* If everything went fine, we should only have groups
20552062 * to be terminated in the old_groups lists.
20562063 */
2057− drm_WARN_ON(&group->ptdev->base, !ctx->csg_upd_failed_mask &&
2064+ drm_WARN_ON(&ptdev->base, !ctx->csg_upd_failed_mask &&
20582065 group_can_run(group));
20592066
20602067 if (!group_can_run(group)) {
@@ -2077,7 +2084,7 @@ tick_ctx_cleanup(struct panthor_scheduler *sched, · 16 unmodified lines
20772084 /* If everything went fine, the groups to schedule lists should
20782085 * be empty.
20792086 */
2080− drm_WARN_ON(&group->ptdev->base,
2087+ drm_WARN_ON(&ptdev->base,
20812088 !ctx->csg_upd_failed_mask && !list_empty(&ctx->groups[i]));
20822089
20832090 list_for_each_entry_safe(group, tmp, &ctx->groups[i], run_node) {
@@ -3242,6 +3249,18 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle) · 1158 unmodified lines
32423249 return 0;
32433250 }
32443251
3252+static struct panthor_group *group_from_handle(struct panthor_group_pool *pool,
3253+ u32 group_handle)
3254+{
3255+ struct panthor_group *group;
3256+
3257+ xa_lock(&pool->xa);
3258+ group = group_get(xa_load(&pool->xa, group_handle));
3259+ xa_unlock(&pool->xa);
3260+
3261+ return group;
3262+}
3263+
32453264 int panthor_group_get_state(struct panthor_file *pfile,
32463265 struct drm_panthor_group_get_state *get_state)
32473266 {
@@ -3253,7 +3272,7 @@ int panthor_group_get_state(struct panthor_file *pfile, · 5 unmodified lines
32533272 if (get_state->pad)
32543273 return -EINVAL;
32553274
3256− group = group_get(xa_load(&gpool->xa, get_state->group_handle));
3275+ group = group_from_handle(gpool, get_state->group_handle);
32573276 if (!group)
32583277 return -EINVAL;
32593278
@@ -3384,7 +3403,7 @@ panthor_job_create(struct panthor_file *pfile, · 124 unmodified lines
33843403 job->call_info.latest_flush = qsubmit->latest_flush;
33853404 INIT_LIST_HEAD(&job->node);
33863405
3387− job->group = group_get(xa_load(&gpool->xa, group_handle));
3406+ job->group = group_from_handle(gpool, group_handle);
33883407 if (!job->group) {
33893408 ret = -EINVAL;
33903409 goto err_put_job;
@@ -3424,13 +3443,8 @@ void panthor_job_update_resvs(struct drm_exec *exec, struct drm_sched_job *sched · 33 unmodified lines
34243443 {
34253444 struct panthor_job *job = container_of(sched_job, struct panthor_job, base);
34263445
3427− /* Still not sure why we want USAGE_WRITE for external objects, since I
3428− * was assuming this would be handled through explicit syncs being imported
3429− * to external BOs with DMA_BUF_IOCTL_IMPORT_SYNC_FILE, but other drivers
3430− * seem to pass DMA_RESV_USAGE_WRITE, so there must be a good reason.
3431− */
34323446 panthor_vm_update_resvs(job->group->vm, exec, &sched_job->s_fence->finished,
3433− DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
3447+ DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_BOOKKEEP);
34343448 }
34353449
34363450 void panthor_sched_unplug(struct panthor_device *ptdev)
drivers/gpu/drm/radeon/atombios_dp.c+2−7
@@ -228,10 +228,8 @@ void radeon_dp_aux_init(struct radeon_connector *radeon_connector) · 227 unmodified lines
228228 {
229229 struct drm_device *dev = radeon_connector->base.dev;
230230 struct radeon_device *rdev = dev->dev_private;
231− int ret;
232231
233232 radeon_connector->ddc_bus->rec.hpd = radeon_connector->hpd.hpd;
234− radeon_connector->ddc_bus->aux.dev = radeon_connector->base.kdev;
235233 radeon_connector->ddc_bus->aux.drm_dev = radeon_connector->base.dev;
236234 if (ASIC_IS_DCE5(rdev)) {
237235 if (radeon_auxch)
@@ -242,11 +240,8 @@ void radeon_dp_aux_init(struct radeon_connector *radeon_connector) · 4 unmodified lines
242240 radeon_connector->ddc_bus->aux.transfer = radeon_dp_aux_transfer_atom;
243241 }
244242
245− ret = drm_dp_aux_register(&radeon_connector->ddc_bus->aux);
246− if (!ret)
247− radeon_connector->ddc_bus->has_aux = true;
248−
249− WARN(ret, "drm_dp_aux_register() failed with error %d\n", ret);
243+ drm_dp_aux_init(&radeon_connector->ddc_bus->aux);
244+ radeon_connector->ddc_bus->has_aux = true;
250245 }
251246
252247 /***** general DP utility functions *****/
drivers/gpu/drm/radeon/radeon_connectors.c+17−0
@@ -1786,6 +1786,20 @@ static enum drm_mode_status radeon_dp_mode_valid(struct drm_connector *connector · 1785 unmodified lines
17861786 return MODE_OK;
17871787 }
17881788
1789+static int
1790+radeon_connector_late_register(struct drm_connector *connector)
1791+{
1792+ struct radeon_connector *radeon_connector = to_radeon_connector(connector);
1793+ int r = 0;
1794+
1795+ if (radeon_connector->ddc_bus->has_aux) {
1796+ radeon_connector->ddc_bus->aux.dev = radeon_connector->base.kdev;
1797+ r = drm_dp_aux_register(&radeon_connector->ddc_bus->aux);
1798+ }
1799+
1800+ return r;
1801+}
1802+
17891803 static const struct drm_connector_helper_funcs radeon_dp_connector_helper_funcs = {
17901804 .get_modes = radeon_dp_get_modes,
17911805 .mode_valid = radeon_dp_mode_valid,
@@ -1800,6 +1814,7 @@ static const struct drm_connector_funcs radeon_dp_connector_funcs = { · 8 unmodified lines
18001814 .early_unregister = radeon_connector_unregister,
18011815 .destroy = radeon_connector_destroy,
18021816 .force = radeon_dvi_force,
1817+ .late_register = radeon_connector_late_register,
18031818 };
18041819
18051820 static const struct drm_connector_funcs radeon_edp_connector_funcs = {
@@ -1810,6 +1825,7 @@ static const struct drm_connector_funcs radeon_edp_connector_funcs = { · 4 unmodified lines
18101825 .early_unregister = radeon_connector_unregister,
18111826 .destroy = radeon_connector_destroy,
18121827 .force = radeon_dvi_force,
1828+ .late_register = radeon_connector_late_register,
18131829 };
18141830
18151831 static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = {
@@ -1820,6 +1836,7 @@ static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = { · 4 unmodified lines
18201836 .early_unregister = radeon_connector_unregister,
18211837 .destroy = radeon_connector_destroy,
18221838 .force = radeon_dvi_force,
1839+ .late_register = radeon_connector_late_register,
18231840 };
18241841
18251842 void
drivers/gpu/drm/radeon/radeon_encoders.c+1−1
@@ -43,7 +43,7 @@ static uint32_t radeon_encoder_clones(struct drm_encoder *encoder) · 42 unmodified lines
4343 struct radeon_device *rdev = dev->dev_private;
4444 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
4545 struct drm_encoder *clone_encoder;
46− uint32_t index_mask = 0;
46+ uint32_t index_mask = drm_encoder_mask(encoder);
4747 int count;
4848
4949 /* DIG routing gets problematic */
drivers/gpu/drm/radeon/radeon_gem.c+0−3
@@ -44,8 +44,6 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj); · 43 unmodified lines
4444 int radeon_gem_prime_pin(struct drm_gem_object *obj);
4545 void radeon_gem_prime_unpin(struct drm_gem_object *obj);
4646
47−const struct drm_gem_object_funcs radeon_gem_object_funcs;
48−
4947 static vm_fault_t radeon_gem_fault(struct vm_fault *vmf)
5048 {
5149 struct ttm_buffer_object *bo = vmf->vma->vm_private_data;
@@ -132,7 +130,6 @@ retry: · 80 unmodified lines
132130 return r;
133131 }
134132 *obj = &robj->tbo.base;
135− (*obj)->funcs = &radeon_gem_object_funcs;
136133 robj->pid = task_pid_nr(current);
137134
138135 mutex_lock(&rdev->gem.mutex);
drivers/gpu/drm/radeon/radeon_object.c+1−0
@@ -151,6 +151,7 @@ int radeon_bo_create(struct radeon_device *rdev, · 150 unmodified lines
151151 if (bo == NULL)
152152 return -ENOMEM;
153153 drm_gem_private_object_init(rdev_to_drm(rdev), &bo->tbo.base, size);
154+ bo->tbo.base.funcs = &radeon_gem_object_funcs;
154155 bo->rdev = rdev;
155156 bo->surface_reg = -1;
156157 INIT_LIST_HEAD(&bo->list);
drivers/gpu/drm/scheduler/sched_entity.c+11−3
@@ -133,8 +133,10 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity, · 132 unmodified lines
133133 {
134134 WARN_ON(!num_sched_list || !sched_list);
135135
136+ spin_lock(&entity->rq_lock);
136137 entity->sched_list = sched_list;
137138 entity->num_sched_list = num_sched_list;
139+ spin_unlock(&entity->rq_lock);
138140 }
139141 EXPORT_SYMBOL(drm_sched_entity_modify_sched);
140142
@@ -380,7 +382,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f, · 239 unmodified lines
380382 container_of(cb, struct drm_sched_entity, cb);
381383
382384 drm_sched_entity_clear_dep(f, cb);
383− drm_sched_wakeup(entity->rq->sched, entity);
385+ drm_sched_wakeup(entity->rq->sched);
384386 }
385387
386388 /**
@@ -597,6 +599,9 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) · 210 unmodified lines
597599
598600 /* first job wakes up scheduler */
599601 if (first) {
602+ struct drm_gpu_scheduler *sched;
603+ struct drm_sched_rq *rq;
604+
600605 /* Add the entity to the run queue */
601606 spin_lock(&entity->rq_lock);
602607 if (entity->stopped) {
@@ -606,13 +611,16 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) · 3 unmodified lines
606611 return;
607612 }
608613
609− drm_sched_rq_add_entity(entity->rq, entity);
614+ rq = entity->rq;
615+ sched = rq->sched;
616+
617+ drm_sched_rq_add_entity(rq, entity);
610618 spin_unlock(&entity->rq_lock);
611619
612620 if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
613621 drm_sched_rq_update_fifo(entity, submit_ts);
614622
615− drm_sched_wakeup(entity->rq->sched, entity);
623+ drm_sched_wakeup(sched);
616624 }
617625 }
618626 EXPORT_SYMBOL(drm_sched_entity_push_job);
drivers/gpu/drm/scheduler/sched_main.c+13−5
@@ -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
@@ -1013,15 +1019,12 @@ EXPORT_SYMBOL(drm_sched_job_cleanup); · 920 unmodified lines
10131019 /**
10141020 * drm_sched_wakeup - Wake up the scheduler if it is ready to queue
10151021 * @sched: scheduler instance
1016− * @entity: the scheduler entity
10171022 *
10181023 * Wake up the scheduler if we can queue jobs.
10191024 */
1020−void drm_sched_wakeup(struct drm_gpu_scheduler *sched,
1021− struct drm_sched_entity *entity)
1025+void drm_sched_wakeup(struct drm_gpu_scheduler *sched)
10221026 {
1023− if (drm_sched_can_queue(sched, entity))
1024− drm_sched_run_job_queue(sched);
1027+ drm_sched_run_job_queue(sched);
10251028 }
10261029
10271030 /**
@@ -1272,7 +1275,12 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, · 244 unmodified lines
12721275 sched->submit_wq = submit_wq;
12731276 sched->own_submit_wq = false;
12741277 } else {
1278+#ifdef CONFIG_LOCKDEP
1279+ sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name, 0,
1280+ &drm_sched_lockdep_map);
1281+#else
12751282 sched->submit_wq = alloc_ordered_workqueue(name, 0);
1283+#endif
12761284 if (!sched->submit_wq)
12771285 return -ENOMEM;
12781286
drivers/gpu/drm/tegra/gr3d.c+33−13
@@ -46,7 +46,6 @@ struct gr3d { · 45 unmodified lines
4646 unsigned int nclocks;
4747 struct reset_control_bulk_data resets[RST_GR3D_MAX];
4848 unsigned int nresets;
49− struct dev_pm_domain_list *pd_list;
5049
5150 DECLARE_BITMAP(addr_regs, GR3D_NUM_REGS);
5251 };
@@ -370,12 +369,18 @@ static int gr3d_power_up_legacy_domain(struct device *dev, const char *name, · 317 unmodified lines
370369 return 0;
371370 }
372371
372+static void gr3d_del_link(void *link)
373+{
374+ device_link_del(link);
375+}
376+
373377 static int gr3d_init_power(struct device *dev, struct gr3d *gr3d)
374378 {
375− struct dev_pm_domain_attach_data pd_data = {
376− .pd_names = (const char *[]) { "3d0", "3d1" },
377− .num_pd_names = 2,
378− };
379+ static const char * const opp_genpd_names[] = { "3d0", "3d1", NULL };
380+ const u32 link_flags = DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME;
381+ struct device **opp_virt_devs, *pd_dev;
382+ struct device_link *link;
383+ unsigned int i;
379384 int err;
380385
381386 err = of_count_phandle_with_args(dev->of_node, "power-domains",
@@ -409,10 +414,29 @@ static int gr3d_init_power(struct device *dev, struct gr3d *gr3d) · 27 unmodified lines
409414 if (dev->pm_domain)
410415 return 0;
411416
412− err = dev_pm_domain_attach_list(dev, &pd_data, &gr3d->pd_list);
413− if (err < 0)
417+ err = devm_pm_opp_attach_genpd(dev, opp_genpd_names, &opp_virt_devs);
418+ if (err)
414419 return err;
415420
421+ for (i = 0; opp_genpd_names[i]; i++) {
422+ pd_dev = opp_virt_devs[i];
423+ if (!pd_dev) {
424+ dev_err(dev, "failed to get %s power domain\n",
425+ opp_genpd_names[i]);
426+ return -EINVAL;
427+ }
428+
429+ link = device_link_add(dev, pd_dev, link_flags);
430+ if (!link) {
431+ dev_err(dev, "failed to link to %s\n", dev_name(pd_dev));
432+ return -EINVAL;
433+ }
434+
435+ err = devm_add_action_or_reset(dev, gr3d_del_link, link);
436+ if (err)
437+ return err;
438+ }
439+
416440 return 0;
417441 }
418442
@@ -503,13 +527,13 @@ static int gr3d_probe(struct platform_device *pdev) · 84 unmodified lines
503527
504528 err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev);
505529 if (err)
506− goto err;
530+ return err;
507531
508532 err = host1x_client_register(&gr3d->client.base);
509533 if (err < 0) {
510534 dev_err(&pdev->dev, "failed to register host1x client: %d\n",
511535 err);
512− goto err;
536+ return err;
513537 }
514538
515539 /* initialize address register map */
@@ -517,9 +541,6 @@ static int gr3d_probe(struct platform_device *pdev) · 1 unmodified line
517541 set_bit(gr3d_addr_regs[i], gr3d->addr_regs);
518542
519543 return 0;
520−err:
521− dev_pm_domain_detach_list(gr3d->pd_list);
522− return err;
523544 }
524545
525546 static void gr3d_remove(struct platform_device *pdev)
@@ -528,7 +549,6 @@ static void gr3d_remove(struct platform_device *pdev) · 2 unmodified lines
528549
529550 pm_runtime_disable(&pdev->dev);
530551 host1x_client_unregister(&gr3d->client.base);
531− dev_pm_domain_detach_list(gr3d->pd_list);
532552 }
533553
534554 static int __maybe_unused gr3d_runtime_suspend(struct device *dev)
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/vboxvideo/hgsmi_base.c+9−1
@@ -139,7 +139,15 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, · 138 unmodified lines
139139 flags |= VBOX_MOUSE_POINTER_VISIBLE;
140140 }
141141
142− p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len, HGSMI_CH_VBVA,
142+ /*
143+ * The 4 extra bytes come from switching struct vbva_mouse_pointer_shape
144+ * from having a 4 bytes fixed array at the end to using a proper VLA
145+ * at the end. These 4 extra bytes were not subtracted from sizeof(*p)
146+ * before the switch to the VLA, so this way the behavior is unchanged.
147+ * Chances are these 4 extra bytes are not necessary but they are kept
148+ * to avoid regressions.
149+ */
150+ p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len + 4, HGSMI_CH_VBVA,
143151 VBVA_MOUSE_POINTER_SHAPE);
144152 if (!p)
145153 return -ENOMEM;
drivers/gpu/drm/vboxvideo/vboxvideo.h+1−3
@@ -351,10 +351,8 @@ struct vbva_mouse_pointer_shape { · 350 unmodified lines
351351 * Bytes in the gap between the AND and the XOR mask are undefined.
352352 * XOR mask scanlines have no gap between them and size of XOR mask is:
353353 * xor_len = width * 4 * height.
354− *
355− * Preallocate 4 bytes for accessing actual data as p->data.
356354 */
357− u8 data[4];
355+ u8 data[];
358356 } __packed;
359357
360358 /* pointer is visible */
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+10−2
@@ -169,6 +169,8 @@ · 168 unmodified lines
169169 #define XEHP_SLICE_COMMON_ECO_CHICKEN1 XE_REG_MCR(0x731c, XE_REG_OPTION_MASKED)
170170 #define MSC_MSAA_REODER_BUF_BYPASS_DISABLE REG_BIT(14)
171171
172+#define XE2LPM_CCCHKNREG1 XE_REG(0x82a8)
173+
172174 #define VF_PREEMPTION XE_REG(0x83a4, XE_REG_OPTION_MASKED)
173175 #define PREEMPTION_VERTEX_COUNT REG_GENMASK(15, 0)
174176
@@ -378,6 +380,9 @@ · 203 unmodified lines
378380 #define L3SQCREG3 XE_REG_MCR(0xb108)
379381 #define COMPPWOVERFETCHEN REG_BIT(28)
380382
383+#define SCRATCH3_LBCF XE_REG_MCR(0xb154)
384+#define RWFLUSHALLEN REG_BIT(17)
385+
381386 #define XEHP_L3SQCREG5 XE_REG_MCR(0xb158)
382387 #define L3_PWM_TIMER_INIT_VAL_MASK REG_GENMASK(9, 0)
383388
@@ -388,8 +393,11 @@ · 4 unmodified lines
388393
389394 #define XE2_GLOBAL_INVAL XE_REG(0xb404)
390395
391−#define SCRATCH1LPFC XE_REG(0xb474)
392−#define EN_L3_RW_CCS_CACHE_FLUSH REG_BIT(0)
396+#define XE2LPM_L3SQCREG2 XE_REG_MCR(0xb604)
397+
398+#define XE2LPM_L3SQCREG3 XE_REG_MCR(0xb608)
399+
400+#define XE2LPM_SCRATCH3_LBCF XE_REG_MCR(0xb654)
393401
394402 #define XE2LPM_L3SQCREG5 XE_REG_MCR(0xb658)
395403
drivers/gpu/drm/xe/xe_bo.c+2−2
@@ -680,8 +680,8 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict, · 679 unmodified lines
680680 tt_has_data = ttm && (ttm_tt_is_populated(ttm) ||
681681 (ttm->page_flags & TTM_TT_FLAG_SWAPPED));
682682
683− move_lacks_source = handle_system_ccs ? (!bo->ccs_cleared) :
684− (!mem_type_is_vram(old_mem_type) && !tt_has_data);
683+ move_lacks_source = !old_mem || (handle_system_ccs ? (!bo->ccs_cleared) :
684+ (!mem_type_is_vram(old_mem_type) && !tt_has_data));
685685
686686 needs_clear = (ttm && ttm->page_flags & TTM_TT_FLAG_ZERO_ALLOC) ||
687687 (!ttm && ttm_bo->type == ttm_bo_type_device);
drivers/gpu/drm/xe/xe_debugfs.c+1−1
@@ -187,7 +187,7 @@ void xe_debugfs_register(struct xe_device *xe) · 186 unmodified lines
187187 debugfs_create_file("forcewake_all", 0400, root, xe,
188188 &forcewake_all_fops);
189189
190− debugfs_create_file("wedged_mode", 0400, root, xe,
190+ debugfs_create_file("wedged_mode", 0600, root, xe,
191191 &wedged_mode_fops);
192192
193193 for (mem_type = XE_PL_VRAM0; mem_type <= XE_PL_VRAM1; ++mem_type) {
drivers/gpu/drm/xe/xe_device.c+8−8
@@ -171,10 +171,8 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file) · 170 unmodified lines
171171 xe_exec_queue_kill(q);
172172 xe_exec_queue_put(q);
173173 }
174− mutex_lock(&xef->vm.lock);
175174 xa_for_each(&xef->vm.xa, idx, vm)
176175 xe_vm_close_and_put(vm);
177− mutex_unlock(&xef->vm.lock);
178176
179177 xe_file_put(xef);
180178
@@ -298,6 +296,9 @@ static void xe_device_destroy(struct drm_device *dev, void *dummy) · 117 unmodified lines
298296 if (xe->unordered_wq)
299297 destroy_workqueue(xe->unordered_wq);
300298
299+ if (xe->destroy_wq)
300+ destroy_workqueue(xe->destroy_wq);
301+
301302 ttm_device_fini(&xe->ttm);
302303 }
303304
@@ -336,9 +337,7 @@ struct xe_device *xe_device_create(struct pci_dev *pdev, · 32 unmodified lines
336337
337338 init_waitqueue_head(&xe->ufence_wq);
338339
339− err = drmm_mutex_init(&xe->drm, &xe->usm.lock);
340− if (err)
341− goto err;
340+ init_rwsem(&xe->usm.lock);
342341
343342 xa_init_flags(&xe->usm.asid_to_vm, XA_FLAGS_ALLOC);
344343
@@ -363,8 +362,9 @@ struct xe_device *xe_device_create(struct pci_dev *pdev, · 18 unmodified lines
363362 xe->preempt_fence_wq = alloc_ordered_workqueue("xe-preempt-fence-wq", 0);
364363 xe->ordered_wq = alloc_ordered_workqueue("xe-ordered-wq", 0);
365364 xe->unordered_wq = alloc_workqueue("xe-unordered-wq", 0, 0);
365+ xe->destroy_wq = alloc_workqueue("xe-destroy-wq", 0, 0);
366366 if (!xe->ordered_wq || !xe->unordered_wq ||
367− !xe->preempt_fence_wq) {
367+ !xe->preempt_fence_wq || !xe->destroy_wq) {
368368 /*
369369 * Cleanup done in xe_device_destroy via
370370 * drmm_add_action_or_reset register above
@@ -980,13 +980,13 @@ void xe_device_declare_wedged(struct xe_device *xe) · 609 unmodified lines
980980 return;
981981 }
982982
983+ xe_pm_runtime_get_noresume(xe);
984+
983985 if (drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe)) {
984986 drm_err(&xe->drm, "Failed to register xe_device_wedged_fini clean-up. Although device is wedged.\n");
985987 return;
986988 }
987989
988− xe_pm_runtime_get_noresume(xe);
989−
990990 if (!atomic_xchg(&xe->wedged.flag, 1)) {
991991 xe->needs_flr_on_fini = true;
992992 drm_err(&xe->drm,
drivers/gpu/drm/xe/xe_device_types.h+15−4
@@ -369,7 +369,7 @@ struct xe_device { · 368 unmodified lines
369369 /** @usm.next_asid: next ASID, used to cyclical alloc asids */
370370 u32 next_asid;
371371 /** @usm.lock: protects UM state */
372− struct mutex lock;
372+ struct rw_semaphore lock;
373373 } usm;
374374
375375 /** @pinned: pinned BO state */
@@ -396,6 +396,9 @@ struct xe_device { · 20 unmodified lines
396396 /** @unordered_wq: used to serialize unordered work, mostly display */
397397 struct workqueue_struct *unordered_wq;
398398
399+ /** @destroy_wq: used to serialize user destroy work, like queue */
400+ struct workqueue_struct *destroy_wq;
401+
399402 /** @tiles: device tiles */
400403 struct xe_tile tiles[XE_MAX_TILES_PER_DEVICE];
401404
@@ -567,15 +570,23 @@ struct xe_file { · 165 unmodified lines
567570 struct {
568571 /** @vm.xe: xarray to store VMs */
569572 struct xarray xa;
570− /** @vm.lock: protects file VM state */
573+ /**
574+ * @vm.lock: Protects VM lookup + reference and removal a from
575+ * file xarray. Not an intended to be an outer lock which does
576+ * thing while being held.
577+ */
571578 struct mutex lock;
572579 } vm;
573580
574581 /** @exec_queue: Submission exec queue state for file */
575582 struct {
576− /** @exec_queue.xe: xarray to store engines */
583+ /** @exec_queue.xa: xarray to store exece queues */
577584 struct xarray xa;
578− /** @exec_queue.lock: protects file engine state */
585+ /**
586+ * @exec_queue.lock: Protects exec queue lookup + reference and
587+ * removal a frommfile xarray. Not an intended to be an outer
588+ * lock which does thing while being held.
589+ */
579590 struct mutex lock;
580591 } exec_queue;
581592
drivers/gpu/drm/xe/xe_drm_client.c+8−1
@@ -283,8 +283,15 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file) · 282 unmodified lines
283283
284284 /* Accumulate all the exec queues from this client */
285285 mutex_lock(&xef->exec_queue.lock);
286− xa_for_each(&xef->exec_queue.xa, i, q)
286+ xa_for_each(&xef->exec_queue.xa, i, q) {
287+ xe_exec_queue_get(q);
288+ mutex_unlock(&xef->exec_queue.lock);
289+
287290 xe_exec_queue_update_run_ticks(q);
291+
292+ mutex_lock(&xef->exec_queue.lock);
293+ xe_exec_queue_put(q);
294+ }
288295 mutex_unlock(&xef->exec_queue.lock);
289296
290297 /* Get the total GPU cycles */
drivers/gpu/drm/xe/xe_exec.c+4−8
@@ -41,11 +41,6 @@ · 40 unmodified lines
4141 * user knows an exec writes to a BO and reads from the BO in the next exec, it
4242 * is the user's responsibility to pass in / out fence between the two execs).
4343 *
44− * Implicit dependencies for external BOs are handled by using the dma-buf
45− * implicit dependency uAPI (TODO: add link). To make this works each exec must
46− * install the job's fence into the DMA_RESV_USAGE_WRITE slot of every external
47− * BO mapped in the VM.
48− *
4944 * We do not allow a user to trigger a bind at exec time rather we have a VM
5045 * bind IOCTL which uses the same in / out fence interface as exec. In that
5146 * sense, a VM bind is basically the same operation as an exec from the user
@@ -59,8 +54,8 @@ · 7 unmodified lines
5954 * behind any pending kernel operations on any external BOs in VM or any BOs
6055 * private to the VM. This is accomplished by the rebinds waiting on BOs
6156 * DMA_RESV_USAGE_KERNEL slot (kernel ops) and kernel ops waiting on all BOs
62− * slots (inflight execs are in the DMA_RESV_USAGE_BOOKING for private BOs and
63− * in DMA_RESV_USAGE_WRITE for external BOs).
57+ * slots (inflight execs are in the DMA_RESV_USAGE_BOOKKEEP for private BOs and
58+ * for external BOs).
6459 *
6560 * Rebinds / dma-resv usage applies to non-compute mode VMs only as for compute
6661 * mode VMs we use preempt fences and a rebind worker (TODO: add link).
@@ -304,7 +299,8 @@ retry: · 237 unmodified lines
304299 xe_sched_job_arm(job);
305300 if (!xe_vm_in_lr_mode(vm))
306301 drm_gpuvm_resv_add_fence(&vm->gpuvm, exec, &job->drm.s_fence->finished,
307− DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
302+ DMA_RESV_USAGE_BOOKKEEP,
303+ DMA_RESV_USAGE_BOOKKEEP);
308304
309305 for (i = 0; i < num_syncs; i++) {
310306 xe_sync_entry_signal(&syncs[i], &job->drm.s_fence->finished);
drivers/gpu/drm/xe/xe_exec_queue.c+3−3
@@ -635,14 +635,14 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data, · 634 unmodified lines
635635 }
636636 }
637637
638− mutex_lock(&xef->exec_queue.lock);
638+ q->xef = xe_file_get(xef);
639+
640+ /* user id alloc must always be last in ioctl to prevent UAF */
639641 err = xa_alloc(&xef->exec_queue.xa, &id, q, xa_limit_32b, GFP_KERNEL);
640− mutex_unlock(&xef->exec_queue.lock);
641642 if (err)
642643 goto kill_exec_queue;
643644
644645 args->exec_queue_id = id;
645− q->xef = xe_file_get(xef);
646646
647647 return 0;
648648
drivers/gpu/drm/xe/xe_gpu_scheduler.c+5−0
@@ -90,6 +90,11 @@ void xe_sched_submission_stop(struct xe_gpu_scheduler *sched) · 89 unmodified lines
9090 cancel_work_sync(&sched->work_process_msg);
9191 }
9292
93+void xe_sched_submission_resume_tdr(struct xe_gpu_scheduler *sched)
94+{
95+ drm_sched_resume_timeout(&sched->base, sched->base.timeout);
96+}
97+
9398 void xe_sched_add_msg(struct xe_gpu_scheduler *sched,
9499 struct xe_sched_msg *msg)
95100 {
drivers/gpu/drm/xe/xe_gpu_scheduler.h+4−0
@@ -22,6 +22,8 @@ void xe_sched_fini(struct xe_gpu_scheduler *sched); · 21 unmodified lines
2222 void xe_sched_submission_start(struct xe_gpu_scheduler *sched);
2323 void xe_sched_submission_stop(struct xe_gpu_scheduler *sched);
2424
25+void xe_sched_submission_resume_tdr(struct xe_gpu_scheduler *sched);
26+
2527 void xe_sched_add_msg(struct xe_gpu_scheduler *sched,
2628 struct xe_sched_msg *msg);
2729 void xe_sched_add_msg_locked(struct xe_gpu_scheduler *sched,
@@ -61,7 +63,9 @@ xe_sched_invalidate_job(struct xe_sched_job *job, int threshold) · 33 unmodified lines
6163 static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
6264 struct xe_sched_job *job)
6365 {
66+ spin_lock(&sched->base.job_list_lock);
6467 list_add(&job->drm.list, &sched->base.pending_list);
68+ spin_unlock(&sched->base.job_list_lock);
6569 }
6670
6771 static inline
drivers/gpu/drm/xe/xe_gt.c+3−2
@@ -108,7 +108,6 @@ static void xe_gt_enable_host_l2_vram(struct xe_gt *gt) · 107 unmodified lines
108108 return;
109109
110110 if (!xe_gt_is_media_type(gt)) {
111− xe_mmio_write32(gt, SCRATCH1LPFC, EN_L3_RW_CCS_CACHE_FLUSH);
112111 reg = xe_gt_mcr_unicast_read_any(gt, XE2_GAMREQSTRM_CTRL);
113112 reg |= CG_DIS_CNTLBUS;
114113 xe_gt_mcr_multicast_write(gt, XE2_GAMREQSTRM_CTRL, reg);
@@ -874,7 +873,9 @@ int xe_gt_sanitize_freq(struct xe_gt *gt) · 759 unmodified lines
874873 int ret = 0;
875874
876875 if ((!xe_uc_fw_is_available(&gt->uc.gsc.fw) ||
877− xe_uc_fw_is_loaded(&gt->uc.gsc.fw)) && XE_WA(gt, 22019338487))
876+ xe_uc_fw_is_loaded(&gt->uc.gsc.fw) ||
877+ xe_uc_fw_is_in_error_state(&gt->uc.gsc.fw)) &&
878+ XE_WA(gt, 22019338487))
878879 ret = xe_guc_pc_restore_stashed_freq(&gt->uc.guc.pc);
879880
880881 return ret;
drivers/gpu/drm/xe/xe_gt_freq.c+2−2
@@ -237,11 +237,11 @@ int xe_gt_freq_init(struct xe_gt *gt) · 236 unmodified lines
237237 if (!gt->freq)
238238 return -ENOMEM;
239239
240− err = devm_add_action(xe->drm.dev, freq_fini, gt->freq);
240+ err = sysfs_create_files(gt->freq, freq_attrs);
241241 if (err)
242242 return err;
243243
244− err = sysfs_create_files(gt->freq, freq_attrs);
244+ err = devm_add_action_or_reset(xe->drm.dev, freq_fini, gt->freq);
245245 if (err)
246246 return err;
247247
drivers/gpu/drm/xe/xe_gt_mcr.c+1−1
@@ -439,7 +439,7 @@ void xe_gt_mcr_init(struct xe_gt *gt) · 438 unmodified lines
439439 if (gt->info.type == XE_GT_TYPE_MEDIA) {
440440 drm_WARN_ON(&xe->drm, MEDIA_VER(xe) < 13);
441441
442− if (MEDIA_VER(xe) >= 20) {
442+ if (MEDIA_VERx100(xe) >= 1301) {
443443 gt->steering[OADDRM].ranges = xe2lpm_gpmxmt_steering_table;
444444 gt->steering[INSTANCE0].ranges = xe2lpm_instance0_steering_table;
445445 } else {
drivers/gpu/drm/xe/xe_gt_pagefault.c+21−18
@@ -185,6 +185,21 @@ unlock_dma_resv: · 184 unmodified lines
185185 return err;
186186 }
187187
188+static struct xe_vm *asid_to_vm(struct xe_device *xe, u32 asid)
189+{
190+ struct xe_vm *vm;
191+
192+ down_read(&xe->usm.lock);
193+ vm = xa_load(&xe->usm.asid_to_vm, asid);
194+ if (vm && xe_vm_in_fault_mode(vm))
195+ xe_vm_get(vm);
196+ else
197+ vm = ERR_PTR(-EINVAL);
198+ up_read(&xe->usm.lock);
199+
200+ return vm;
201+}
202+
188203 static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
189204 {
190205 struct xe_device *xe = gt_to_xe(gt);
@@ -197,16 +212,9 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf) · 6 unmodified lines
197212 if (pf->trva_fault)
198213 return -EFAULT;
199214
200− /* ASID to VM */
201− mutex_lock(&xe->usm.lock);
202− vm = xa_load(&xe->usm.asid_to_vm, pf->asid);
203− if (vm && xe_vm_in_fault_mode(vm))
204− xe_vm_get(vm);
205− else
206− vm = NULL;
207− mutex_unlock(&xe->usm.lock);
208− if (!vm)
209− return -EINVAL;
215+ vm = asid_to_vm(xe, pf->asid);
216+ if (IS_ERR(vm))
217+ return PTR_ERR(vm);
210218
211219 /*
212220 * TODO: Change to read lock? Using write lock for simplicity.
@@ -548,14 +556,9 @@ static int handle_acc(struct xe_gt *gt, struct acc *acc) · 335 unmodified lines
548556 if (acc->access_type != ACC_TRIGGER)
549557 return -EINVAL;
550558
551− /* ASID to VM */
552− mutex_lock(&xe->usm.lock);
553− vm = xa_load(&xe->usm.asid_to_vm, acc->asid);
554− if (vm)
555− xe_vm_get(vm);
556− mutex_unlock(&xe->usm.lock);
557− if (!vm || !xe_vm_in_fault_mode(vm))
558− return -EINVAL;
559+ vm = asid_to_vm(xe, acc->asid);
560+ if (IS_ERR(vm))
561+ return PTR_ERR(vm);
559562
560563 down_read(&vm->lock);
561564
drivers/gpu/drm/xe/xe_gt_sysfs.c+1−1
@@ -51,5 +51,5 @@ int xe_gt_sysfs_init(struct xe_gt *gt) · 50 unmodified lines
5151
5252 gt->sysfs = &kg->base;
5353
54− return devm_add_action(xe->drm.dev, gt_sysfs_fini, gt);
54+ return devm_add_action_or_reset(xe->drm.dev, gt_sysfs_fini, gt);
5555 }
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c+13−16
@@ -37,6 +37,15 @@ static long tlb_timeout_jiffies(struct xe_gt *gt) · 36 unmodified lines
3737 return hw_tlb_timeout + 2 * delay;
3838 }
3939
40+static void xe_gt_tlb_invalidation_fence_fini(struct xe_gt_tlb_invalidation_fence *fence)
41+{
42+ if (WARN_ON_ONCE(!fence->gt))
43+ return;
44+
45+ xe_pm_runtime_put(gt_to_xe(fence->gt));
46+ fence->gt = NULL; /* fini() should be called once */
47+}
48+
4049 static void
4150 __invalidation_fence_signal(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence)
4251 {
@@ -204,7 +213,7 @@ static int send_tlb_invalidation(struct xe_guc *guc, · 161 unmodified lines
204213 tlb_timeout_jiffies(gt));
205214 }
206215 spin_unlock_irq(&gt->tlb_invalidation.pending_lock);
207− } else if (ret < 0) {
216+ } else {
208217 __invalidation_fence_signal(xe, fence);
209218 }
210219 if (!ret) {
@@ -267,10 +276,8 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt) · 56 unmodified lines
267276
268277 xe_gt_tlb_invalidation_fence_init(gt, &fence, true);
269278 ret = xe_gt_tlb_invalidation_guc(gt, &fence);
270− if (ret < 0) {
271− xe_gt_tlb_invalidation_fence_fini(&fence);
279+ if (ret)
272280 return ret;
273− }
274281
275282 xe_gt_tlb_invalidation_fence_wait(&fence);
276283 } else if (xe_device_uc_enabled(xe) && !xe_device_wedged(xe)) {
@@ -496,7 +503,8 @@ static const struct dma_fence_ops invalidation_fence_ops = { · 219 unmodified lines
496503 * @stack: fence is stack variable
497504 *
498505 * Initialize TLB invalidation fence for use. xe_gt_tlb_invalidation_fence_fini
499− * must be called if fence is not signaled.
506+ * will be automatically called when fence is signalled (all fences must signal),
507+ * even on error.
500508 */
501509 void xe_gt_tlb_invalidation_fence_init(struct xe_gt *gt,
502510 struct xe_gt_tlb_invalidation_fence *fence,
@@ -516,14 +524,3 @@ void xe_gt_tlb_invalidation_fence_init(struct xe_gt *gt, · 13 unmodified lines
516524 dma_fence_get(&fence->base);
517525 fence->gt = gt;
518526 }
519−
520−/**
521− * xe_gt_tlb_invalidation_fence_fini - Finalize TLB invalidation fence
522− * @fence: TLB invalidation fence to finalize
523− *
524− * Drop PM ref which fence took durinig init.
525− */
526−void xe_gt_tlb_invalidation_fence_fini(struct xe_gt_tlb_invalidation_fence *fence)
527−{
528− xe_pm_runtime_put(gt_to_xe(fence->gt));
529−}
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h+0−1
@@ -28,7 +28,6 @@ int xe_guc_tlb_invalidation_done_handler(struct xe_guc *guc, u32 *msg, u32 len); · 27 unmodified lines
2828 void xe_gt_tlb_invalidation_fence_init(struct xe_gt *gt,
2929 struct xe_gt_tlb_invalidation_fence *fence,
3030 bool stack);
31−void xe_gt_tlb_invalidation_fence_fini(struct xe_gt_tlb_invalidation_fence *fence);
3231
3332 static inline void
3433 xe_gt_tlb_invalidation_fence_wait(struct xe_gt_tlb_invalidation_fence *fence)
drivers/gpu/drm/xe/xe_guc_ct.c+26−18
@@ -667,16 +667,12 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, · 666 unmodified lines
667667 num_g2h = 1;
668668
669669 if (g2h_fence_needs_alloc(g2h_fence)) {
670− void *ptr;
671−
672670 g2h_fence->seqno = next_ct_seqno(ct, true);
673− ptr = xa_store(&ct->fence_lookup,
674− g2h_fence->seqno,
675− g2h_fence, GFP_ATOMIC);
676− if (IS_ERR(ptr)) {
677− ret = PTR_ERR(ptr);
671+ ret = xa_err(xa_store(&ct->fence_lookup,
672+ g2h_fence->seqno, g2h_fence,
673+ GFP_ATOMIC));
674+ if (ret)
678675 goto out;
679− }
680676 }
681677
682678 seqno = g2h_fence->seqno;
@@ -879,14 +875,11 @@ retry: · 196 unmodified lines
879875 retry_same_fence:
880876 ret = guc_ct_send(ct, action, len, 0, 0, &g2h_fence);
881877 if (unlikely(ret == -ENOMEM)) {
882− void *ptr;
883−
884878 /* Retry allocation /w GFP_KERNEL */
885− ptr = xa_store(&ct->fence_lookup,
886− g2h_fence.seqno,
887− &g2h_fence, GFP_KERNEL);
888− if (IS_ERR(ptr))
889− return PTR_ERR(ptr);
879+ ret = xa_err(xa_store(&ct->fence_lookup, g2h_fence.seqno,
880+ &g2h_fence, GFP_KERNEL));
881+ if (ret)
882+ return ret;
890883
891884 goto retry_same_fence;
892885 } else if (unlikely(ret)) {
@@ -903,16 +896,26 @@ retry_same_fence: · 10 unmodified lines
903896 }
904897
905898 ret = wait_event_timeout(ct->g2h_fence_wq, g2h_fence.done, HZ);
899+
900+ /*
901+ * Ensure we serialize with completion side to prevent UAF with fence going out of scope on
902+ * the stack, since we have no clue if it will fire after the timeout before we can erase
903+ * from the xa. Also we have some dependent loads and stores below for which we need the
904+ * correct ordering, and we lack the needed barriers.
905+ */
906+ mutex_lock(&ct->lock);
906907 if (!ret) {
907− xe_gt_err(gt, "Timed out wait for G2H, fence %u, action %04x",
908− g2h_fence.seqno, action[0]);
908+ xe_gt_err(gt, "Timed out wait for G2H, fence %u, action %04x, done %s",
909+ g2h_fence.seqno, action[0], str_yes_no(g2h_fence.done));
909910 xa_erase_irq(&ct->fence_lookup, g2h_fence.seqno);
911+ mutex_unlock(&ct->lock);
910912 return -ETIME;
911913 }
912914
913915 if (g2h_fence.retry) {
914916 xe_gt_dbg(gt, "H2G action %#x retrying: reason %#x\n",
915917 action[0], g2h_fence.reason);
918+ mutex_unlock(&ct->lock);
916919 goto retry;
917920 }
918921 if (g2h_fence.fail) {
@@ -921,7 +924,12 @@ retry_same_fence: · 2 unmodified lines
921924 ret = -EIO;
922925 }
923926
924− return ret > 0 ? response_buffer ? g2h_fence.response_len : g2h_fence.response_data : ret;
927+ if (ret > 0)
928+ ret = response_buffer ? g2h_fence.response_len : g2h_fence.response_data;
929+
930+ mutex_unlock(&ct->lock);
931+
932+ return ret;
925933 }
926934
927935 /**
drivers/gpu/drm/xe/xe_guc_submit.c+27−70
@@ -224,64 +224,11 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q) · 223 unmodified lines
224224 EXEC_QUEUE_STATE_BANNED));
225225 }
226226
227−#ifdef CONFIG_PROVE_LOCKING
228−static int alloc_submit_wq(struct xe_guc *guc)
229−{
230− int i;
231−
232− for (i = 0; i < NUM_SUBMIT_WQ; ++i) {
233− guc->submission_state.submit_wq_pool[i] =
234− alloc_ordered_workqueue("submit_wq", 0);
235− if (!guc->submission_state.submit_wq_pool[i])
236− goto err_free;
237− }
238−
239− return 0;
240−
241−err_free:
242− while (i)
243− destroy_workqueue(guc->submission_state.submit_wq_pool[--i]);
244−
245− return -ENOMEM;
246−}
247−
248−static void free_submit_wq(struct xe_guc *guc)
249−{
250− int i;
251−
252− for (i = 0; i < NUM_SUBMIT_WQ; ++i)
253− destroy_workqueue(guc->submission_state.submit_wq_pool[i]);
254−}
255−
256−static struct workqueue_struct *get_submit_wq(struct xe_guc *guc)
257−{
258− int idx = guc->submission_state.submit_wq_idx++ % NUM_SUBMIT_WQ;
259−
260− return guc->submission_state.submit_wq_pool[idx];
261−}
262−#else
263−static int alloc_submit_wq(struct xe_guc *guc)
264−{
265− return 0;
266−}
267−
268−static void free_submit_wq(struct xe_guc *guc)
269−{
270−
271−}
272−
273−static struct workqueue_struct *get_submit_wq(struct xe_guc *guc)
274−{
275− return NULL;
276−}
277−#endif
278−
279227 static void guc_submit_fini(struct drm_device *drm, void *arg)
280228 {
281229 struct xe_guc *guc = arg;
282230
283231 xa_destroy(&guc->submission_state.exec_queue_lookup);
284− free_submit_wq(guc);
285232 }
286233
287234 static void guc_submit_wedged_fini(void *arg)
@@ -290,9 +237,15 @@ static void guc_submit_wedged_fini(void *arg) · 2 unmodified lines
290237 struct xe_exec_queue *q;
291238 unsigned long index;
292239
293− xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
294− if (exec_queue_wedged(q))
240+ mutex_lock(&guc->submission_state.lock);
241+ xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
242+ if (exec_queue_wedged(q)) {
243+ mutex_unlock(&guc->submission_state.lock);
295244 xe_exec_queue_put(q);
245+ mutex_lock(&guc->submission_state.lock);
246+ }
247+ }
248+ mutex_unlock(&guc->submission_state.lock);
296249 }
297250
298251 static const struct xe_exec_queue_ops guc_exec_queue_ops;
@@ -337,14 +290,12 @@ int xe_guc_submit_init(struct xe_guc *guc, unsigned int num_ids) · 38 unmodified lines
337290 if (err)
338291 return err;
339292
340− err = alloc_submit_wq(guc);
341− if (err)
342− return err;
343−
344293 gt->exec_queue_ops = &guc_exec_queue_ops;
345294
346295 xa_init(&guc->submission_state.exec_queue_lookup);
347296
297+ init_waitqueue_head(&guc->submission_state.fini_wq);
298+
348299 primelockdep(guc);
349300
350301 return drmm_add_action_or_reset(&xe->drm, guc_submit_fini, guc);
@@ -361,12 +312,14 @@ static void __release_guc_id(struct xe_guc *guc, struct xe_exec_queue *q, u32 xa · 10 unmodified lines
361312
362313 xe_guc_id_mgr_release_locked(&guc->submission_state.idm,
363314 q->guc->id, q->width);
315+
316+ if (xa_empty(&guc->submission_state.exec_queue_lookup))
317+ wake_up(&guc->submission_state.fini_wq);
364318 }
365319
366320 static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q)
367321 {
368322 int ret;
369− void *ptr;
370323 int i;
371324
372325 /*
@@ -386,12 +339,10 @@ static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q) · 13 unmodified lines
386339 q->guc->id = ret;
387340
388341 for (i = 0; i < q->width; ++i) {
389− ptr = xa_store(&guc->submission_state.exec_queue_lookup,
390− q->guc->id + i, q, GFP_NOWAIT);
391− if (IS_ERR(ptr)) {
392− ret = PTR_ERR(ptr);
342+ ret = xa_err(xa_store(&guc->submission_state.exec_queue_lookup,
343+ q->guc->id + i, q, GFP_NOWAIT));
344+ if (ret)
393345 goto err_release;
394− }
395346 }
396347
397348 return 0;
@@ -1079,10 +1030,13 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 681 unmodified lines
10791030
10801031 /*
10811032 * TDR has fired before free job worker. Common if exec queue
1082− * immediately closed after last fence signaled.
1033+ * immediately closed after last fence signaled. Add back to pending
1034+ * list so job can be freed and kick scheduler ensuring free job is not
1035+ * lost.
10831036 */
10841037 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &job->fence->flags)) {
1085− guc_exec_queue_free_job(drm_job);
1038+ xe_sched_add_pending_job(sched, job);
1039+ xe_sched_submission_start(sched);
10861040
10871041 return DRM_GPU_SCHED_STAT_NOMINAL;
10881042 }
@@ -1268,13 +1222,16 @@ static void __guc_exec_queue_fini_async(struct work_struct *w) · 179 unmodified lines
12681222
12691223 static void guc_exec_queue_fini_async(struct xe_exec_queue *q)
12701224 {
1225+ struct xe_guc *guc = exec_queue_to_guc(q);
1226+ struct xe_device *xe = guc_to_xe(guc);
1227+
12711228 INIT_WORK(&q->guc->fini_async, __guc_exec_queue_fini_async);
12721229
12731230 /* We must block on kernel engines so slabs are empty on driver unload */
12741231 if (q->flags & EXEC_QUEUE_FLAG_PERMANENT || exec_queue_wedged(q))
12751232 __guc_exec_queue_fini_async(&q->guc->fini_async);
12761233 else
1277− queue_work(system_wq, &q->guc->fini_async);
1234+ queue_work(xe->destroy_wq, &q->guc->fini_async);
12781235 }
12791236
12801237 static void __guc_exec_queue_fini(struct xe_guc *guc, struct xe_exec_queue *q)
@@ -1452,8 +1409,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) · 171 unmodified lines
14521409 timeout = (q->vm && xe_vm_in_lr_mode(q->vm)) ? MAX_SCHEDULE_TIMEOUT :
14531410 msecs_to_jiffies(q->sched_props.job_timeout_ms);
14541411 err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops,
1455− get_submit_wq(guc),
1456− q->lrc[0]->ring.size / MAX_JOB_SIZE_BYTES, 64,
1412+ NULL, q->lrc[0]->ring.size / MAX_JOB_SIZE_BYTES, 64,
14571413 timeout, guc_to_gt(guc)->ordered_wq, NULL,
14581414 q->name, gt_to_xe(q->gt)->drm.dev);
14591415 if (err)
@@ -1796,6 +1752,7 @@ static void guc_exec_queue_start(struct xe_exec_queue *q) · 336 unmodified lines
17961752 }
17971753
17981754 xe_sched_submission_start(sched);
1755+ xe_sched_submission_resume_tdr(sched);
17991756 }
18001757
18011758 int xe_guc_submit_start(struct xe_guc *guc)
drivers/gpu/drm/xe/xe_guc_types.h+2−7
@@ -72,15 +72,10 @@ struct xe_guc { · 71 unmodified lines
7272 atomic_t stopped;
7373 /** @submission_state.lock: protects submission state */
7474 struct mutex lock;
75−#ifdef CONFIG_PROVE_LOCKING
76−#define NUM_SUBMIT_WQ 256
77− /** @submission_state.submit_wq_pool: submission ordered workqueues pool */
78− struct workqueue_struct *submit_wq_pool[NUM_SUBMIT_WQ];
79− /** @submission_state.submit_wq_idx: submission ordered workqueue index */
80− int submit_wq_idx;
81−#endif
8275 /** @submission_state.enabled: submission is enabled */
8376 bool enabled;
77+ /** @submission_state.fini_wq: submit fini wait queue */
78+ wait_queue_head_t fini_wq;
8479 } submission_state;
8580 /** @hwconfig: Hardware config state */
8681 struct {
drivers/gpu/drm/xe/xe_oa.c+3−6
@@ -709,8 +709,7 @@ static int xe_oa_configure_oar_context(struct xe_oa_stream *stream, bool enable) · 708 unmodified lines
709709 {
710710 RING_CONTEXT_CONTROL(stream->hwe->mmio_base),
711711 regs_offset + CTX_CONTEXT_CONTROL,
712− _MASKED_FIELD(CTX_CTRL_OAC_CONTEXT_ENABLE,
713− enable ? CTX_CTRL_OAC_CONTEXT_ENABLE : 0)
712+ _MASKED_BIT_ENABLE(CTX_CTRL_OAC_CONTEXT_ENABLE),
714713 },
715714 };
716715 struct xe_oa_reg reg_lri = { OAR_OACONTROL, oacontrol };
@@ -742,10 +741,8 @@ static int xe_oa_configure_oac_context(struct xe_oa_stream *stream, bool enable) · 25 unmodified lines
742741 {
743742 RING_CONTEXT_CONTROL(stream->hwe->mmio_base),
744743 regs_offset + CTX_CONTEXT_CONTROL,
745− _MASKED_FIELD(CTX_CTRL_OAC_CONTEXT_ENABLE,
746− enable ? CTX_CTRL_OAC_CONTEXT_ENABLE : 0) |
747− _MASKED_FIELD(CTX_CTRL_RUN_ALONE,
748− enable ? CTX_CTRL_RUN_ALONE : 0),
744+ _MASKED_BIT_ENABLE(CTX_CTRL_OAC_CONTEXT_ENABLE) |
745+ _MASKED_FIELD(CTX_CTRL_RUN_ALONE, enable ? CTX_CTRL_RUN_ALONE : 0),
749746 },
750747 };
751748 struct xe_oa_reg reg_lri = { OAC_OACONTROL, oacontrol };
drivers/gpu/drm/xe/xe_pci.c+2−0
@@ -924,6 +924,8 @@ static int xe_pci_resume(struct device *dev) · 923 unmodified lines
924924 if (err)
925925 return err;
926926
927+ pci_restore_state(pdev);
928+
927929 err = pci_enable_device(pdev);
928930 if (err)
929931 return err;
drivers/gpu/drm/xe/xe_pt.c+1−1
@@ -2188,5 +2188,5 @@ void xe_pt_update_ops_abort(struct xe_tile *tile, struct xe_vma_ops *vops) · 2187 unmodified lines
21882188 pt_op->num_entries);
21892189 }
21902190
2191− xe_bo_put_commit(&vops->pt_update_ops[tile->id].deferred);
2191+ xe_pt_update_ops_fini(tile, vops);
21922192 }
drivers/gpu/drm/xe/xe_query.c+5−1
@@ -161,7 +161,11 @@ query_engine_cycles(struct xe_device *xe, · 160 unmodified lines
161161 cpu_clock);
162162
163163 xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
164− resp.width = 36;
164+
165+ if (GRAPHICS_VER(xe) >= 20)
166+ resp.width = 64;
167+ else
168+ resp.width = 36;
165169
166170 /* Only write to the output fields of user query */
167171 if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp))
drivers/gpu/drm/xe/xe_sync.c+1−1
@@ -58,7 +58,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr, · 57 unmodified lines
5858 if (!access_ok(ptr, sizeof(*ptr)))
5959 return ERR_PTR(-EFAULT);
6060
61− ufence = kmalloc(sizeof(*ufence), GFP_KERNEL);
61+ ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
6262 if (!ufence)
6363 return ERR_PTR(-ENOMEM);
6464
drivers/gpu/drm/xe/xe_tuning.c+28−0
@@ -42,20 +42,48 @@ static const struct xe_rtp_entry_sr gt_tunings[] = { · 41 unmodified lines
4242 XE_RTP_ACTIONS(CLR(CCCHKNREG1, ENCOMPPERFFIX),
4343 SET(CCCHKNREG1, L3CMPCTRL))
4444 },
45+ { XE_RTP_NAME("Tuning: Compression Overfetch - media"),
46+ XE_RTP_RULES(MEDIA_VERSION(2000)),
47+ XE_RTP_ACTIONS(CLR(XE2LPM_CCCHKNREG1, ENCOMPPERFFIX),
48+ SET(XE2LPM_CCCHKNREG1, L3CMPCTRL))
49+ },
4550 { XE_RTP_NAME("Tuning: Enable compressible partial write overfetch in L3"),
4651 XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
4752 XE_RTP_ACTIONS(SET(L3SQCREG3, COMPPWOVERFETCHEN))
4853 },
54+ { XE_RTP_NAME("Tuning: Enable compressible partial write overfetch in L3 - media"),
55+ XE_RTP_RULES(MEDIA_VERSION(2000)),
56+ XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG3, COMPPWOVERFETCHEN))
57+ },
4958 { XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only"),
5059 XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
5160 XE_RTP_ACTIONS(SET(L3SQCREG2,
5261 COMPMEMRD256BOVRFETCHEN))
5362 },
63+ { XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only - media"),
64+ XE_RTP_RULES(MEDIA_VERSION(2000)),
65+ XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG2,
66+ COMPMEMRD256BOVRFETCHEN))
67+ },
5468 { XE_RTP_NAME("Tuning: Stateless compression control"),
5569 XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
5670 XE_RTP_ACTIONS(FIELD_SET(STATELESS_COMPRESSION_CTRL, UNIFIED_COMPRESSION_FORMAT,
5771 REG_FIELD_PREP(UNIFIED_COMPRESSION_FORMAT, 0)))
5872 },
73+ { XE_RTP_NAME("Tuning: Stateless compression control - media"),
74+ XE_RTP_RULES(MEDIA_VERSION_RANGE(1301, 2000)),
75+ XE_RTP_ACTIONS(FIELD_SET(STATELESS_COMPRESSION_CTRL, UNIFIED_COMPRESSION_FORMAT,
76+ REG_FIELD_PREP(UNIFIED_COMPRESSION_FORMAT, 0)))
77+ },
78+ { XE_RTP_NAME("Tuning: L3 RW flush all Cache"),
79+ XE_RTP_RULES(GRAPHICS_VERSION(2004)),
80+ XE_RTP_ACTIONS(SET(SCRATCH3_LBCF, RWFLUSHALLEN))
81+ },
82+ { XE_RTP_NAME("Tuning: L3 RW flush all cache - media"),
83+ XE_RTP_RULES(MEDIA_VERSION(2000)),
84+ XE_RTP_ACTIONS(SET(XE2LPM_SCRATCH3_LBCF, RWFLUSHALLEN))
85+ },
86+
5987 {}
6088 };
6189
drivers/gpu/drm/xe/xe_vm.c+14−22
@@ -1613,7 +1613,7 @@ void xe_vm_close_and_put(struct xe_vm *vm) · 1612 unmodified lines
16131613
16141614 up_write(&vm->lock);
16151615
1616− mutex_lock(&xe->usm.lock);
1616+ down_write(&xe->usm.lock);
16171617 if (vm->usm.asid) {
16181618 void *lookup;
16191619
@@ -1623,7 +1623,7 @@ void xe_vm_close_and_put(struct xe_vm *vm) · 3 unmodified lines
16231623 lookup = xa_erase(&xe->usm.asid_to_vm, vm->usm.asid);
16241624 xe_assert(xe, lookup == vm);
16251625 }
1626− mutex_unlock(&xe->usm.lock);
1626+ up_write(&xe->usm.lock);
16271627
16281628 for_each_tile(tile, xe, id)
16291629 xe_range_fence_tree_fini(&vm->rftree[id]);
@@ -1765,25 +1765,18 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data, · 135 unmodified lines
17651765 if (IS_ERR(vm))
17661766 return PTR_ERR(vm);
17671767
1768− mutex_lock(&xef->vm.lock);
1769− err = xa_alloc(&xef->vm.xa, &id, vm, xa_limit_32b, GFP_KERNEL);
1770− mutex_unlock(&xef->vm.lock);
1771− if (err)
1772− goto err_close_and_put;
1773−
17741768 if (xe->info.has_asid) {
1775− mutex_lock(&xe->usm.lock);
1769+ down_write(&xe->usm.lock);
17761770 err = xa_alloc_cyclic(&xe->usm.asid_to_vm, &asid, vm,
17771771 XA_LIMIT(1, XE_MAX_ASID - 1),
17781772 &xe->usm.next_asid, GFP_KERNEL);
1779− mutex_unlock(&xe->usm.lock);
1773+ up_write(&xe->usm.lock);
17801774 if (err < 0)
1781− goto err_free_id;
1775+ goto err_close_and_put;
17821776
17831777 vm->usm.asid = asid;
17841778 }
17851779
1786− args->vm_id = id;
17871780 vm->xef = xe_file_get(xef);
17881781
17891782 /* Record BO memory for VM pagetable created against client */
@@ -1796,12 +1789,15 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data, · 6 unmodified lines
17961789 args->reserved[0] = xe_bo_main_addr(vm->pt_root[0]->bo, XE_PAGE_SIZE);
17971790 #endif
17981791
1792+ /* user id alloc must always be last in ioctl to prevent UAF */
1793+ err = xa_alloc(&xef->vm.xa, &id, vm, xa_limit_32b, GFP_KERNEL);
1794+ if (err)
1795+ goto err_close_and_put;
1796+
1797+ args->vm_id = id;
1798+
17991799 return 0;
18001800
1801−err_free_id:
1802− mutex_lock(&xef->vm.lock);
1803− xa_erase(&xef->vm.xa, id);
1804− mutex_unlock(&xef->vm.lock);
18051801 err_close_and_put:
18061802 xe_vm_close_and_put(vm);
18071803
@@ -3203,10 +3199,8 @@ int xe_vm_invalidate_vma(struct xe_vma *vma) · 1395 unmodified lines
32033199
32043200 ret = xe_gt_tlb_invalidation_vma(tile->primary_gt,
32053201 &fence[fence_id], vma);
3206− if (ret < 0) {
3207− xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]);
3202+ if (ret)
32083203 goto wait;
3209− }
32103204 ++fence_id;
32113205
32123206 if (!tile->media_gt)
@@ -3218,10 +3212,8 @@ int xe_vm_invalidate_vma(struct xe_vma *vma) · 5 unmodified lines
32183212
32193213 ret = xe_gt_tlb_invalidation_vma(tile->media_gt,
32203214 &fence[fence_id], vma);
3221− if (ret < 0) {
3222− xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]);
3215+ if (ret)
32233216 goto wait;
3224− }
32253217 ++fence_id;
32263218 }
32273219 }
drivers/gpu/drm/xe/xe_wa.c+4−0
@@ -710,6 +710,10 @@ static const struct xe_rtp_entry_sr lrc_was[] = { · 709 unmodified lines
710710 DIS_PARTIAL_AUTOSTRIP |
711711 DIS_AUTOSTRIP))
712712 },
713+ { XE_RTP_NAME("15016589081"),
714+ XE_RTP_RULES(GRAPHICS_VERSION(2004), ENGINE_CLASS(RENDER)),
715+ XE_RTP_ACTIONS(SET(CHICKEN_RASTER_1, DIS_CLIP_NEGATIVE_BOUNDING_BOX))
716+ },
713717
714718 /* Xe2_HPG */
715719 { XE_RTP_NAME("15010599737"),
drivers/gpu/drm/xe/xe_wait_user_fence.c+0−3
@@ -169,9 +169,6 @@ int xe_wait_user_fence_ioctl(struct drm_device *dev, void *data, · 168 unmodified lines
169169 args->timeout = 0;
170170 }
171171
172− if (!timeout && !(err < 0))
173− err = -ETIME;
174−
175172 if (q)
176173 xe_exec_queue_put(q);
177174
drivers/gpu/host1x/context.c+1−0
@@ -58,6 +58,7 @@ int host1x_memory_context_list_init(struct host1x *host1x) · 57 unmodified lines
5858 ctx->dev.parent = host1x->dev;
5959 ctx->dev.release = host1x_memory_context_release;
6060
61+ ctx->dev.dma_parms = &ctx->dma_parms;
6162 dma_set_max_seg_size(&ctx->dev, UINT_MAX);
6263
6364 err = device_add(&ctx->dev);
drivers/gpu/host1x/dev.c+8−10
@@ -625,12 +625,6 @@ static int host1x_probe(struct platform_device *pdev) · 624 unmodified lines
625625 goto free_contexts;
626626 }
627627
628− err = host1x_intr_init(host);
629− if (err) {
630− dev_err(&pdev->dev, "failed to initialize interrupts\n");
631− goto deinit_syncpt;
632− }
633−
634628 pm_runtime_enable(&pdev->dev);
635629
636630 err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev);
@@ -642,6 +636,12 @@ static int host1x_probe(struct platform_device *pdev) · 5 unmodified lines
642636 if (err)
643637 goto pm_disable;
644638
639+ err = host1x_intr_init(host);
640+ if (err) {
641+ dev_err(&pdev->dev, "failed to initialize interrupts\n");
642+ goto pm_put;
643+ }
644+
645645 host1x_debug_init(host);
646646
647647 err = host1x_register(host);
@@ -658,13 +658,11 @@ unregister: · 10 unmodified lines
658658 host1x_unregister(host);
659659 deinit_debugfs:
660660 host1x_debug_deinit(host);
661−
661+ host1x_intr_deinit(host);
662+pm_put:
662663 pm_runtime_put_sync_suspend(&pdev->dev);
663664 pm_disable:
664665 pm_runtime_disable(&pdev->dev);
665−
666− host1x_intr_deinit(host);
667−deinit_syncpt:
668666 host1x_syncpt_deinit(host);
669667 free_contexts:
670668 host1x_memory_context_list_free(&host->context_list);
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/i2c/busses/i2c-stm32f7.c+3−3
@@ -2395,7 +2395,7 @@ static int __maybe_unused stm32f7_i2c_runtime_suspend(struct device *dev) · 2394 unmodified lines
23952395 struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
23962396
23972397 if (!stm32f7_i2c_is_slave_registered(i2c_dev))
2398− clk_disable_unprepare(i2c_dev->clk);
2398+ clk_disable(i2c_dev->clk);
23992399
24002400 return 0;
24012401 }
@@ -2406,9 +2406,9 @@ static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev) · 4 unmodified lines
24062406 int ret;
24072407
24082408 if (!stm32f7_i2c_is_slave_registered(i2c_dev)) {
2409− ret = clk_prepare_enable(i2c_dev->clk);
2409+ ret = clk_enable(i2c_dev->clk);
24102410 if (ret) {
2411− dev_err(dev, "failed to prepare_enable clock\n");
2411+ dev_err(dev, "failed to enable clock\n");
24122412 return ret;
24132413 }
24142414 }
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/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+7−0
@@ -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.
@@ -483,6 +489,7 @@ config STM32_DAC · 124 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/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+2−3
@@ -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) {
@@ -780,7 +779,7 @@ static int veml6030_hw_init(struct iio_dev *indio_dev) · 672 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+5−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);
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+1−1
@@ -525,7 +525,7 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw, · 524 unmodified lines
525525 /* failed with status */
526526 dev_err(&rcfw->pdev->dev, "cmdq[%#x]=%#x status %#x\n",
527527 cookie, opcode, evnt->status);
528− rc = -EFAULT;
528+ rc = -EIO;
529529 }
530530
531531 return rc;
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/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/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/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/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+12−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,13 @@ 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+ return -EINVAL;
3815+
38093816 /*
38103817 * Changing affinity is mega expensive, so let's be as lazy as
38113818 * we can and only do it if we really have to. Also, if mapped
@@ -4463,9 +4470,8 @@ static int its_vpe_init(struct its_vpe *vpe) · 651 unmodified lines
44634470 raw_spin_lock_init(&vpe->vpe_lock);
44644471 vpe->vpe_id = vpe_id;
44654472 vpe->vpt_page = vpt_page;
4466− if (gic_rdists->has_rvpeid)
4467− atomic_set(&vpe->vmapp_count, 0);
4468− else
4473+ atomic_set(&vpe->vmapp_count, 0);
4474+ if (!gic_rdists->has_rvpeid)
44694475 vpe->vpe_proxy_event = -1;
44704476
44714477 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/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/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/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/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+4−2
@@ -656,6 +656,8 @@ ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv, · 655 unmodified lines
656656 struct ice_dpll_pin *p = pin_priv;
657657 struct ice_dpll *d = dpll_priv;
658658
659+ if (state == DPLL_PIN_STATE_SELECTABLE)
660+ return -EINVAL;
659661 if (!enable && p->state[d->dpll_idx] == DPLL_PIN_STATE_DISCONNECTED)
660662 return 0;
661663
@@ -1843,6 +1845,8 @@ ice_dpll_init_rclk_pins(struct ice_pf *pf, struct ice_dpll_pin *pin, · 1181 unmodified lines
18431845 struct dpll_pin *parent;
18441846 int ret, i;
18451847
1848+ if (WARN_ON((!vsi || !vsi->netdev)))
1849+ return -EINVAL;
18461850 ret = ice_dpll_get_pins(pf, pin, start_idx, ICE_DPLL_RCLK_NUM_PER_PF,
18471851 pf->dplls.clock_id);
18481852 if (ret)
@@ -1858,8 +1862,6 @@ ice_dpll_init_rclk_pins(struct ice_pf *pf, struct ice_dpll_pin *pin, · 9 unmodified lines
18581862 if (ret)
18591863 goto unregister_pins;
18601864 }
1861− if (WARN_ON((!vsi || !vsi->netdev)))
1862− return -EINVAL;
18631865 dpll_netdev_pin_set(vsi->netdev, pf->dplls.rclk.pin);
18641866
18651867 return 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_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+4−0
@@ -9651,6 +9651,10 @@ static void igb_io_resume(struct pci_dev *pdev) · 9650 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/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/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/stmmac_main.c+1−1
@@ -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);
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/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+0−18
@@ -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
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/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+1−0
@@ -1426,6 +1426,7 @@ static const struct usb_device_id products[] = { · 1425 unmodified lines
14261426 {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */
14271427 {QMI_QUIRK_SET_DTR(0x2c7c, 0x030e, 4)}, /* Quectel EM05GV2 */
14281428 {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */
1429+ {QMI_QUIRK_SET_DTR(0x2cb7, 0x0112, 0)}, /* Fibocom FG132 */
14291430 {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
14301431 {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
14311432 {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
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/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+17−24
@@ -1292,14 +1292,12 @@ static void nvme_queue_keep_alive_work(struct nvme_ctrl *ctrl) · 1291 unmodified lines
12921292 queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
12931293 }
12941294
1295−static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq,
1296− blk_status_t status)
1295+static void nvme_keep_alive_finish(struct request *rq,
1296+ blk_status_t status, struct nvme_ctrl *ctrl)
12971297 {
1298− struct nvme_ctrl *ctrl = rq->end_io_data;
1299− unsigned long flags;
1300− bool startka = false;
13011298 unsigned long rtt = jiffies - (rq->deadline - rq->timeout);
13021299 unsigned long delay = nvme_keep_alive_work_period(ctrl);
1300+ enum nvme_ctrl_state state = nvme_ctrl_state(ctrl);
13031301
13041302 /*
13051303 * Subtract off the keepalive RTT so nvme_keep_alive_work runs
@@ -1313,25 +1311,17 @@ static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq, · 7 unmodified lines
13131311 delay = 0;
13141312 }
13151313
1316− blk_mq_free_request(rq);
1317−
13181314 if (status) {
13191315 dev_err(ctrl->device,
13201316 "failed nvme_keep_alive_end_io error=%d\n",
13211317 status);
1322− return RQ_END_IO_NONE;
1318+ return;
13231319 }
13241320
13251321 ctrl->ka_last_check_time = jiffies;
13261322 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)
1323+ if (state == NVME_CTRL_LIVE || state == NVME_CTRL_CONNECTING)
13331324 queue_delayed_work(nvme_wq, &ctrl->ka_work, delay);
1334− return RQ_END_IO_NONE;
13351325 }
13361326
13371327 static void nvme_keep_alive_work(struct work_struct *work)
@@ -1340,6 +1330,7 @@ static void nvme_keep_alive_work(struct work_struct *work) · 2 unmodified lines
13401330 struct nvme_ctrl, ka_work);
13411331 bool comp_seen = ctrl->comp_seen;
13421332 struct request *rq;
1333+ blk_status_t status;
13431334
13441335 ctrl->ka_last_check_time = jiffies;
13451336
@@ -1362,9 +1353,9 @@ static void nvme_keep_alive_work(struct work_struct *work) · 16 unmodified lines
13621353 nvme_init_request(rq, &ctrl->ka_cmd);
13631354
13641355 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);
1356+ status = blk_execute_rq(rq, false);
1357+ nvme_keep_alive_finish(rq, status, ctrl);
1358+ blk_mq_free_request(rq);
13681359 }
13691360
13701361 static void nvme_start_keep_alive(struct nvme_ctrl *ctrl)
@@ -2458,8 +2449,13 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl) · 1087 unmodified lines
24582449 else
24592450 ctrl->ctrl_config = NVME_CC_CSS_NVM;
24602451
2461− if (ctrl->cap & NVME_CAP_CRMS_CRWMS && ctrl->cap & NVME_CAP_CRMS_CRIMS)
2462− ctrl->ctrl_config |= NVME_CC_CRIME;
2452+ /*
2453+ * Setting CRIME results in CSTS.RDY before the media is ready. This
2454+ * makes it possible for media related commands to return the error
2455+ * NVME_SC_ADMIN_COMMAND_MEDIA_NOT_READY. Until the driver is
2456+ * restructured to handle retries, disable CC.CRIME.
2457+ */
2458+ ctrl->ctrl_config &= ~NVME_CC_CRIME;
24632459
24642460 ctrl->ctrl_config |= (NVME_CTRL_PAGE_SHIFT - 12) << NVME_CC_MPS_SHIFT;
24652461 ctrl->ctrl_config |= NVME_CC_AMS_RR | NVME_CC_SHN_NONE;
@@ -2489,10 +2485,7 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl) · 23 unmodified lines
24892485 * devices are known to get this wrong. Use the larger of the
24902486 * two values.
24912487 */
2492− if (ctrl->ctrl_config & NVME_CC_CRIME)
2493− ready_timeout = NVME_CRTO_CRIMT(crto);
2494− else
2495− ready_timeout = NVME_CRTO_CRWMT(crto);
2488+ ready_timeout = NVME_CRTO_CRWMT(crto);
24962489
24972490 if (ready_timeout < timeout)
24982491 dev_warn_once(ctrl->device, "bad crto:%x cap:%llx\n",
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/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/perf/riscv_pmu_legacy.c+2−2
@@ -22,13 +22,13 @@ static int pmu_legacy_ctr_get_idx(struct perf_event *event) · 21 unmodified lines
2222 struct perf_event_attr *attr = &event->attr;
2323
2424 if (event->attr.type != PERF_TYPE_HARDWARE)
25− return -EOPNOTSUPP;
25+ return -ENOENT;
2626 if (attr->config == PERF_COUNT_HW_CPU_CYCLES)
2727 return RISCV_PMU_LEGACY_CYCLE;
2828 else if (attr->config == PERF_COUNT_HW_INSTRUCTIONS)
2929 return RISCV_PMU_LEGACY_INSTRET;
3030 else
31− return -EOPNOTSUPP;
31+ return -ENOENT;
3232 }
3333
3434 /* For legacy config & counter index are same */
drivers/perf/riscv_pmu_sbi.c+2−2
@@ -309,7 +309,7 @@ static void pmu_sbi_check_event(struct sbi_pmu_event_data *edata) · 308 unmodified lines
309309 ret.value, 0x1, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0);
310310 } else if (ret.error == SBI_ERR_NOT_SUPPORTED) {
311311 /* This event cannot be monitored by any counter */
312− edata->event_idx = -EINVAL;
312+ edata->event_idx = -ENOENT;
313313 }
314314 }
315315
@@ -556,7 +556,7 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig) · 240 unmodified lines
556556 }
557557 break;
558558 default:
559− ret = -EINVAL;
559+ ret = -ENOENT;
560560 break;
561561 }
562562
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/dell/dell-laptop.c+12−3
@@ -2391,12 +2391,18 @@ static struct attribute *dell_battery_attrs[] = { · 2390 unmodified lines
23912391 };
23922392 ATTRIBUTE_GROUPS(dell_battery);
23932393
2394+static bool dell_battery_supported(struct power_supply *battery)
2395+{
2396+ /* We currently only support the primary battery */
2397+ return strcmp(battery->desc->name, "BAT0") == 0;
2398+}
2399+
23942400 static int dell_battery_add(struct power_supply *battery,
23952401 struct acpi_battery_hook *hook)
23962402 {
2397− /* this currently only supports the primary battery */
2398− if (strcmp(battery->desc->name, "BAT0") != 0)
2399− return -ENODEV;
2403+ /* Return 0 instead of an error to avoid being unloaded */
2404+ if (!dell_battery_supported(battery))
2405+ return 0;
24002406
24012407 return device_add_groups(&battery->dev, dell_battery_groups);
24022408 }
@@ -2404,6 +2410,9 @@ static int dell_battery_add(struct power_supply *battery, · 1 unmodified line
24042410 static int dell_battery_remove(struct power_supply *battery,
24052411 struct acpi_battery_hook *hook)
24062412 {
2413+ if (!dell_battery_supported(battery))
2414+ return 0;
2415+
24072416 device_remove_groups(&battery->dev, dell_battery_groups);
24082417 return 0;
24092418 }
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c+1−0
@@ -521,6 +521,7 @@ static int __init sysman_init(void) · 520 unmodified lines
521521 int ret = 0;
522522
523523 if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) &&
524+ !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Alienware", NULL) &&
524525 !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) {
525526 pr_err("Unable to run on non-Dell system\n");
526527 return -ENODEV;
drivers/platform/x86/intel/pmc/spt.c+0−2
@@ -130,8 +130,6 @@ const struct pmc_reg_map spt_reg_map = { · 129 unmodified lines
130130 .ppfear_buckets = SPT_PPFEAR_NUM_ENTRIES,
131131 .pm_cfg_offset = SPT_PMC_PM_CFG_OFFSET,
132132 .pm_read_disable_bit = SPT_PMC_READ_DISABLE_BIT,
133− .acpi_pm_tmr_ctl_offset = SPT_PMC_ACPI_PM_TMR_CTL_OFFSET,
134− .acpi_pm_tmr_disable_bit = SPT_PMC_BIT_ACPI_PM_TMR_DISABLE,
135133 .ltr_ignore_max = SPT_NUM_IP_IGN_ALLOWED,
136134 .pm_vric1_offset = SPT_PMC_VRIC1_OFFSET,
137135 };
drivers/platform/x86/intel/speed_select_if/isst_if_common.c+4−1
@@ -316,7 +316,9 @@ static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn · 315 unmodified lines
316316 cpu >= nr_cpu_ids || cpu >= num_possible_cpus())
317317 return NULL;
318318
319− pkg_id = topology_physical_package_id(cpu);
319+ pkg_id = topology_logical_package_id(cpu);
320+ if (pkg_id >= topology_max_packages())
321+ return NULL;
320322
321323 bus_number = isst_cpu_info[cpu].bus_info[bus_no];
322324 if (bus_number < 0)
@@ -807,6 +809,7 @@ static const struct x86_cpu_id isst_cpu_ids[] = { · 484 unmodified lines
807809 X86_MATCH_VFM(INTEL_GRANITERAPIDS_X, SST_HPM_SUPPORTED),
808810 X86_MATCH_VFM(INTEL_ICELAKE_D, 0),
809811 X86_MATCH_VFM(INTEL_ICELAKE_X, 0),
812+ X86_MATCH_VFM(INTEL_PANTHERCOVE_X, SST_HPM_SUPPORTED),
810813 X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, 0),
811814 X86_MATCH_VFM(INTEL_SKYLAKE_X, SST_MBOX_SUPPORTED),
812815 {}
drivers/platform/x86/intel/tpmi_power_domains.c+1−0
@@ -82,6 +82,7 @@ static const struct x86_cpu_id tpmi_cpu_ids[] = { · 81 unmodified lines
8282 X86_MATCH_VFM(INTEL_ATOM_CRESTMONT_X, NULL),
8383 X86_MATCH_VFM(INTEL_ATOM_CRESTMONT, NULL),
8484 X86_MATCH_VFM(INTEL_GRANITERAPIDS_D, NULL),
85+ X86_MATCH_VFM(INTEL_PANTHERCOVE_X, NULL),
8586 {}
8687 };
8788 MODULE_DEVICE_TABLE(x86cpu, tpmi_cpu_ids);
drivers/platform/x86/x86-android-tablets/core.c+4−2
@@ -390,8 +390,9 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) · 389 unmodified lines
390390 for (i = 0; i < pdev_count; i++) {
391391 pdevs[i] = platform_device_register_full(&dev_info->pdev_info[i]);
392392 if (IS_ERR(pdevs[i])) {
393+ ret = PTR_ERR(pdevs[i]);
393394 x86_android_tablet_remove(pdev);
394− return PTR_ERR(pdevs[i]);
395+ return ret;
395396 }
396397 }
397398
@@ -443,8 +444,9 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) · 45 unmodified lines
443444 PLATFORM_DEVID_AUTO,
444445 &pdata, sizeof(pdata));
445446 if (IS_ERR(pdevs[pdev_count])) {
447+ ret = PTR_ERR(pdevs[pdev_count]);
446448 x86_android_tablet_remove(pdev);
447− return PTR_ERR(pdevs[pdev_count]);
449+ return ret;
448450 }
449451 pdev_count++;
450452 }
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/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_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/spi/atmel-quadspi.c+1−1
@@ -377,7 +377,7 @@ static int atmel_qspi_set_cfg(struct atmel_qspi *aq, · 376 unmodified lines
377377 */
378378 if (!(aq->mr & QSPI_MR_SMM)) {
379379 aq->mr |= QSPI_MR_SMM;
380− atmel_qspi_write(aq->scr, aq, QSPI_MR);
380+ atmel_qspi_write(aq->mr, aq, QSPI_MR);
381381 }
382382
383383 /* Clear pending interrupts */
drivers/spi/spi-cadence.c+5−3
@@ -678,8 +678,8 @@ static int cdns_spi_probe(struct platform_device *pdev) · 677 unmodified lines
678678
679679 clk_dis_all:
680680 if (!spi_controller_is_target(ctlr)) {
681− pm_runtime_set_suspended(&pdev->dev);
682681 pm_runtime_disable(&pdev->dev);
682+ pm_runtime_set_suspended(&pdev->dev);
683683 }
684684 remove_ctlr:
685685 spi_controller_put(ctlr);
@@ -701,8 +701,10 @@ static void cdns_spi_remove(struct platform_device *pdev) · 15 unmodified lines
701701
702702 cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE);
703703
704− pm_runtime_set_suspended(&pdev->dev);
705− pm_runtime_disable(&pdev->dev);
704+ if (!spi_controller_is_target(ctlr)) {
705+ pm_runtime_disable(&pdev->dev);
706+ pm_runtime_set_suspended(&pdev->dev);
707+ }
706708
707709 spi_unregister_controller(ctlr);
708710 }
drivers/spi/spi-imx.c+1−1
@@ -1865,8 +1865,8 @@ out_register_controller: · 1864 unmodified lines
18651865 spi_imx_sdma_exit(spi_imx);
18661866 out_runtime_pm_put:
18671867 pm_runtime_dont_use_autosuspend(spi_imx->dev);
1868− pm_runtime_set_suspended(&pdev->dev);
18691868 pm_runtime_disable(spi_imx->dev);
1869+ pm_runtime_set_suspended(&pdev->dev);
18701870
18711871 clk_disable_unprepare(spi_imx->clk_ipg);
18721872 out_put_per:
drivers/spi/spi-s3c64xx.c+2−2
@@ -245,7 +245,7 @@ static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd) · 244 unmodified lines
245245 loops = msecs_to_loops(1);
246246 do {
247247 val = readl(regs + S3C64XX_SPI_STATUS);
248− } while (TX_FIFO_LVL(val, sdd) && loops--);
248+ } while (TX_FIFO_LVL(val, sdd) && --loops);
249249
250250 if (loops == 0)
251251 dev_warn(&sdd->pdev->dev, "Timed out flushing TX FIFO\n");
@@ -258,7 +258,7 @@ static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd) · 6 unmodified lines
258258 readl(regs + S3C64XX_SPI_RX_DATA);
259259 else
260260 break;
261− } while (loops--);
261+ } while (--loops);
262262
263263 if (loops == 0)
264264 dev_warn(&sdd->pdev->dev, "Timed out flushing RX FIFO\n");
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/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+9−20
@@ -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
@@ -10210,7 +10197,9 @@ static void ufshcd_wl_shutdown(struct device *dev) · 3718 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/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+5−0
@@ -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
drivers/usb/host/xhci-ring.c+30−38
@@ -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;
@@ -2775,6 +2775,29 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 1745 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) {
2856− /* give back previous TD, start handling new */
2857− xhci_dbg(xhci, "Missing TD completion event after mid TD error\n");
2858− ep_ring->dequeue = td->last_trb;
2859− ep_ring->deq_seg = td->last_trb_seg;
2860− inc_deq(xhci, ep_ring);
2861− xhci_td_cleanup(xhci, td, ep_ring, td->status);
2862− td = td_next;
2863− }
2864− }
2865−
2866− if (!ep_seg) {
2867− /* HC is busted, give up! */
2868− xhci_err(xhci,
2869− "ERROR Transfer event TRB DMA ptr not "
2870− "part of current TD ep_index %d "
2871− "comp_code %u\n", ep_index,
2872− trb_comp_code);
2873− trb_in_td(xhci, td, ep_trb_dma, true);
2862+ /* HC is busted, give up! */
2863+ xhci_err(xhci,
2864+ "ERROR Transfer event TRB DMA ptr not part of current TD ep_index %d comp_code %u\n",
2865+ ep_index, trb_comp_code);
2866+ trb_in_td(xhci, td, ep_trb_dma, true);
28742867
2875− return -ESHUTDOWN;
2876− }
2868+ return -ESHUTDOWN;
28772869 }
28782870
28792871 if (ep->skip) {
drivers/usb/host/xhci-tegra.c+1−1
@@ -2183,7 +2183,7 @@ static int tegra_xusb_enter_elpg(struct tegra_xusb *tegra, bool runtime) · 2182 unmodified lines
21832183 goto out;
21842184 }
21852185
2186− for (i = 0; i < tegra->num_usb_phys; i++) {
2186+ for (i = 0; i < xhci->usb2_rhub.num_ports; i++) {
21872187 if (!xhci->usb2_rhub.ports[i])
21882188 continue;
21892189 portsc = readl(xhci->usb2_rhub.ports[i]->addr);
drivers/usb/host/xhci.h+1−1
@@ -1001,7 +1001,7 @@ enum xhci_setup_dev { · 1000 unmodified lines
10011001 /* Set TR Dequeue Pointer command TRB fields, 6.4.3.9 */
10021002 #define TRB_TO_STREAM_ID(p) ((((p) & (0xffff << 16)) >> 16))
10031003 #define STREAM_ID_FOR_TRB(p) ((((p)) & 0xffff) << 16)
1004−#define SCT_FOR_TRB(p) (((p) << 1) & 0x7)
1004+#define SCT_FOR_TRB(p) (((p) & 0x7) << 1)
10051005
10061006 /* Link TRB specific fields */
10071007 #define TRB_TC (1<<1)
drivers/usb/misc/Kconfig+12−0
@@ -331,3 +331,15 @@ config USB_ONBOARD_DEV · 330 unmodified lines
331331 this config will enable the driver and it will automatically
332332 match the state of the USB subsystem. If this driver is a
333333 module it will be called onboard_usb_dev.
334+
335+config USB_ONBOARD_DEV_USB5744
336+ bool "Onboard USB Microchip usb5744 hub with SMBus support"
337+ depends on (USB_ONBOARD_DEV && I2C=y) || (USB_ONBOARD_DEV=m && I2C=m)
338+ help
339+ Say Y here if you want to support onboard USB Microchip usb5744
340+ hub that requires SMBus initialization.
341+
342+ This options enables usb5744 i2c default initialization sequence
343+ during hub start-up configuration stage. It is must to enable this
344+ option on AMD Kria KR260 Robotics Starter Kit as this hub is
345+ connected to USB-SD converter which mounts the root filesystem.
drivers/usb/misc/onboard_usb_dev.c+4−2
@@ -311,7 +311,7 @@ static void onboard_dev_attach_usb_driver(struct work_struct *work) · 310 unmodified lines
311311
312312 static int onboard_dev_5744_i2c_init(struct i2c_client *client)
313313 {
314−#if IS_ENABLED(CONFIG_I2C)
314+#if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744)
315315 struct device *dev = &client->dev;
316316 int ret;
317317
@@ -394,9 +394,11 @@ static int onboard_dev_probe(struct platform_device *pdev) · 76 unmodified lines
394394
395395 i2c_node = of_parse_phandle(pdev->dev.of_node, "i2c-bus", 0);
396396 if (i2c_node) {
397− struct i2c_client *client;
397+ struct i2c_client *client = NULL;
398398
399+#if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744)
399400 client = of_find_i2c_device_by_node(i2c_node);
401+#endif
400402 of_node_put(i2c_node);
401403
402404 if (!client) {
drivers/usb/misc/yurex.c+9−12
@@ -34,8 +34,6 @@ · 33 unmodified lines
3434 #define YUREX_BUF_SIZE 8
3535 #define YUREX_WRITE_TIMEOUT (HZ*2)
3636
37−#define MAX_S64_STRLEN 20 /* {-}922337203685477580{7,8} */
38−
3937 /* table of devices that work with this driver */
4038 static struct usb_device_id yurex_table[] = {
4139 { USB_DEVICE(YUREX_VENDOR_ID, YUREX_PRODUCT_ID) },
@@ -402,8 +400,9 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count, · 360 unmodified lines
402400 loff_t *ppos)
403401 {
404402 struct usb_yurex *dev;
405− int len = 0;
406− char in_buffer[MAX_S64_STRLEN];
403+ int len;
404+ char in_buffer[20];
405+ unsigned long flags;
407406
408407 dev = file->private_data;
409408
@@ -413,16 +412,14 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count, · 3 unmodified lines
413412 return -ENODEV;
414413 }
415414
416− if (WARN_ON_ONCE(dev->bbu > S64_MAX || dev->bbu < S64_MIN)) {
417− mutex_unlock(&dev->io_mutex);
418− return -EIO;
419− }
420−
421− spin_lock_irq(&dev->lock);
422− scnprintf(in_buffer, MAX_S64_STRLEN, "%lld\n", dev->bbu);
423− spin_unlock_irq(&dev->lock);
415+ spin_lock_irqsave(&dev->lock, flags);
416+ len = snprintf(in_buffer, 20, "%lld\n", dev->bbu);
417+ spin_unlock_irqrestore(&dev->lock, flags);
424418 mutex_unlock(&dev->io_mutex);
425419
420+ if (WARN_ON_ONCE(len >= sizeof(in_buffer)))
421+ return -EIO;
422+
426423 return simple_read_from_buffer(buffer, count, ppos, in_buffer, len);
427424 }
428425
drivers/usb/serial/option.c+8−0
@@ -279,6 +279,7 @@ static void option_instat_callback(struct urb *urb); · 278 unmodified lines
279279 #define QUECTEL_PRODUCT_EG912Y 0x6001
280280 #define QUECTEL_PRODUCT_EC200S_CN 0x6002
281281 #define QUECTEL_PRODUCT_EC200A 0x6005
282+#define QUECTEL_PRODUCT_EG916Q 0x6007
282283 #define QUECTEL_PRODUCT_EM061K_LWW 0x6008
283284 #define QUECTEL_PRODUCT_EM061K_LCN 0x6009
284285 #define QUECTEL_PRODUCT_EC200T 0x6026
@@ -1270,6 +1271,7 @@ static const struct usb_device_id option_ids[] = { · 985 unmodified lines
12701271 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
12711272 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
12721273 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG912Y, 0xff, 0, 0) },
1274+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG916Q, 0xff, 0x00, 0x00) },
12731275 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
12741276
12751277 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
@@ -1380,10 +1382,16 @@ static const struct usb_device_id option_ids[] = { · 104 unmodified lines
13801382 .driver_info = NCTRL(0) | RSVD(1) },
13811383 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a0, 0xff), /* Telit FN20C04 (rmnet) */
13821384 .driver_info = RSVD(0) | NCTRL(3) },
1385+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a2, 0xff), /* Telit FN920C04 (MBIM) */
1386+ .driver_info = NCTRL(4) },
13831387 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a4, 0xff), /* Telit FN20C04 (rmnet) */
13841388 .driver_info = RSVD(0) | NCTRL(3) },
1389+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a7, 0xff), /* Telit FN920C04 (MBIM) */
1390+ .driver_info = NCTRL(4) },
13851391 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a9, 0xff), /* Telit FN20C04 (rmnet) */
13861392 .driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
1393+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10aa, 0xff), /* Telit FN920C04 (MBIM) */
1394+ .driver_info = NCTRL(3) | RSVD(4) | RSVD(5) },
13871395 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
13881396 .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
13891397 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
drivers/usb/storage/unusual_devs.h+11−0
@@ -2423,6 +2423,17 @@ UNUSUAL_DEV( 0xc251, 0x4003, 0x0100, 0x0100, · 2422 unmodified lines
24232423 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
24242424 US_FL_NOT_LOCKABLE),
24252425
2426+/*
2427+ * Reported by Icenowy Zheng <uwu@icenowy.me>
2428+ * This is an interface for vendor-specific cryptic commands instead
2429+ * of real USB storage device.
2430+ */
2431+UNUSUAL_DEV( 0xe5b7, 0x0811, 0x0100, 0x0100,
2432+ "ZhuHai JieLi Technology",
2433+ "JieLi BR21",
2434+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
2435+ US_FL_IGNORE_DEVICE),
2436+
24262437 /* Reported by Andrew Simmons <andrew.simmons@gmail.com> */
24272438 UNUSUAL_DEV( 0xed06, 0x4500, 0x0001, 0x0001,
24282439 "DataStor",
drivers/usb/typec/class.c+3−0
@@ -519,6 +519,7 @@ static void typec_altmode_release(struct device *dev) · 518 unmodified lines
519519 typec_altmode_put_partner(alt);
520520
521521 altmode_id_remove(alt->adev.dev.parent, alt->id);
522+ put_device(alt->adev.dev.parent);
522523 kfree(alt);
523524 }
524525
@@ -568,6 +569,8 @@ typec_register_altmode(struct device *parent, · 43 unmodified lines
568569 alt->adev.dev.type = &typec_altmode_dev_type;
569570 dev_set_name(&alt->adev.dev, "%s.%u", dev_name(parent), id);
570571
572+ get_device(alt->adev.dev.parent);
573+
571574 /* Link partners and plugs with the ports */
572575 if (!is_port)
573576 typec_altmode_set_partner(alt);
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c+0−1
@@ -432,7 +432,6 @@ static int qcom_pmic_typec_port_get_cc(struct tcpc_dev *tcpc, · 431 unmodified lines
432432 val = TYPEC_CC_RP_DEF;
433433 break;
434434 }
435− val = TYPEC_CC_RP_DEF;
436435 }
437436
438437 if (misc & CC_ORIENTATION)
drivers/vdpa/octeon_ep/octep_vdpa_hw.c+6−6
@@ -475,11 +475,11 @@ int octep_hw_caps_read(struct octep_hw *oct_hw, struct pci_dev *pdev) · 474 unmodified lines
475475 dev_err(dev, "Incomplete PCI capabilities");
476476 return -EIO;
477477 }
478− dev_info(dev, "common cfg mapped at: 0x%016llx\n", (u64)(uintptr_t)oct_hw->common_cfg);
479− dev_info(dev, "device cfg mapped at: 0x%016llx\n", (u64)(uintptr_t)oct_hw->dev_cfg);
480− dev_info(dev, "isr cfg mapped at: 0x%016llx\n", (u64)(uintptr_t)oct_hw->isr);
481− dev_info(dev, "notify base: 0x%016llx, notify off multiplier: %u\n",
482− (u64)(uintptr_t)oct_hw->notify_base, oct_hw->notify_off_multiplier);
478+ dev_info(dev, "common cfg mapped at: %p\n", oct_hw->common_cfg);
479+ dev_info(dev, "device cfg mapped at: %p\n", oct_hw->dev_cfg);
480+ dev_info(dev, "isr cfg mapped at: %p\n", oct_hw->isr);
481+ dev_info(dev, "notify base: %p, notify off multiplier: %u\n",
482+ oct_hw->notify_base, oct_hw->notify_off_multiplier);
483483
484484 oct_hw->config_size = octep_get_config_size(oct_hw);
485485 oct_hw->features = octep_hw_get_dev_features(oct_hw);
@@ -511,7 +511,7 @@ int octep_hw_caps_read(struct octep_hw *oct_hw, struct pci_dev *pdev) · 25 unmodified lines
511511 }
512512 mbox = octep_get_mbox(oct_hw);
513513 octep_mbox_init(mbox);
514− dev_info(dev, "mbox mapped at: 0x%016llx\n", (u64)(uintptr_t)mbox);
514+ dev_info(dev, "mbox mapped at: %p\n", mbox);
515515
516516 return 0;
517517 }
drivers/vhost/scsi.c+15−12
@@ -1029,20 +1029,23 @@ vhost_scsi_get_req(struct vhost_virtqueue *vq, struct vhost_scsi_ctx *vc, · 1028 unmodified lines
10291029 /* virtio-scsi spec requires byte 0 of the lun to be 1 */
10301030 vq_err(vq, "Illegal virtio-scsi lun: %u\n", *vc->lunp);
10311031 } else {
1032− struct vhost_scsi_tpg **vs_tpg, *tpg;
1033−
1034− vs_tpg = vhost_vq_get_backend(vq); /* validated at handler entry */
1035−
1036− tpg = READ_ONCE(vs_tpg[*vc->target]);
1037− if (unlikely(!tpg)) {
1038− vq_err(vq, "Target 0x%x does not exist\n", *vc->target);
1039− } else {
1040− if (tpgp)
1041− *tpgp = tpg;
1042− ret = 0;
1032+ struct vhost_scsi_tpg **vs_tpg, *tpg = NULL;
1033+
1034+ if (vc->target) {
1035+ /* validated at handler entry */
1036+ vs_tpg = vhost_vq_get_backend(vq);
1037+ tpg = READ_ONCE(vs_tpg[*vc->target]);
1038+ if (unlikely(!tpg)) {
1039+ vq_err(vq, "Target 0x%x does not exist\n", *vc->target);
1040+ goto out;
1041+ }
10431042 }
1044− }
10451043
1044+ if (tpgp)
1045+ *tpgp = tpg;
1046+ ret = 0;
1047+ }
1048+out:
10461049 return ret;
10471050 }
10481051
drivers/video/fbdev/amifb.c+2−2
@@ -3774,8 +3774,8 @@ static void __exit amifb_remove(struct platform_device *pdev) · 3773 unmodified lines
37743774 * triggers a section mismatch warning.
37753775 */
37763776 static struct platform_driver amifb_driver __refdata = {
3777− .remove_new = __exit_p(amifb_remove),
3778− .driver = {
3777+ .remove = __exit_p(amifb_remove),
3778+ .driver = {
37793779 .name = "amiga-video",
37803780 },
37813781 };
drivers/video/fbdev/arcfb.c+1−1
@@ -548,7 +548,7 @@ static void arcfb_remove(struct platform_device *dev) · 547 unmodified lines
548548
549549 static struct platform_driver arcfb_driver = {
550550 .probe = arcfb_probe,
551− .remove_new = arcfb_remove,
551+ .remove = arcfb_remove,
552552 .driver = {
553553 .name = "arcfb",
554554 },
drivers/video/fbdev/atmel_lcdfb.c+1−1
@@ -1299,7 +1299,7 @@ static int atmel_lcdfb_resume(struct platform_device *pdev) · 1298 unmodified lines
12991299
13001300 static struct platform_driver atmel_lcdfb_driver = {
13011301 .probe = atmel_lcdfb_probe,
1302− .remove_new = atmel_lcdfb_remove,
1302+ .remove = atmel_lcdfb_remove,
13031303 .suspend = atmel_lcdfb_suspend,
13041304 .resume = atmel_lcdfb_resume,
13051305 .driver = {
drivers/video/fbdev/au1100fb.c+1−1
@@ -588,7 +588,7 @@ static struct platform_driver au1100fb_driver = { · 587 unmodified lines
588588 .name = "au1100-lcd",
589589 },
590590 .probe = au1100fb_drv_probe,
591− .remove_new = au1100fb_drv_remove,
591+ .remove = au1100fb_drv_remove,
592592 .suspend = au1100fb_drv_suspend,
593593 .resume = au1100fb_drv_resume,
594594 };
drivers/video/fbdev/au1200fb.c+1−1
@@ -1833,7 +1833,7 @@ static struct platform_driver au1200fb_driver = { · 1832 unmodified lines
18331833 .pm = AU1200FB_PMOPS,
18341834 },
18351835 .probe = au1200fb_drv_probe,
1836− .remove_new = au1200fb_drv_remove,
1836+ .remove = au1200fb_drv_remove,
18371837 };
18381838 module_platform_driver(au1200fb_driver);
18391839
drivers/video/fbdev/broadsheetfb.c+1−1
@@ -1151,7 +1151,7 @@ static void broadsheetfb_remove(struct platform_device *dev) · 1150 unmodified lines
11511151
11521152 static struct platform_driver broadsheetfb_driver = {
11531153 .probe = broadsheetfb_probe,
1154− .remove_new = broadsheetfb_remove,
1154+ .remove = broadsheetfb_remove,
11551155 .driver = {
11561156 .name = "broadsheetfb",
11571157 },
drivers/video/fbdev/bw2.c+1−1
@@ -372,7 +372,7 @@ static struct platform_driver bw2_driver = { · 371 unmodified lines
372372 .of_match_table = bw2_match,
373373 },
374374 .probe = bw2_probe,
375− .remove_new = bw2_remove,
375+ .remove = bw2_remove,
376376 };
377377
378378 static int __init bw2_init(void)
drivers/video/fbdev/cg14.c+1−1
@@ -590,7 +590,7 @@ static struct platform_driver cg14_driver = { · 589 unmodified lines
590590 .of_match_table = cg14_match,
591591 },
592592 .probe = cg14_probe,
593− .remove_new = cg14_remove,
593+ .remove = cg14_remove,
594594 };
595595
596596 static int __init cg14_init(void)
drivers/video/fbdev/cg3.c+1−1
@@ -458,7 +458,7 @@ static struct platform_driver cg3_driver = { · 457 unmodified lines
458458 .of_match_table = cg3_match,
459459 },
460460 .probe = cg3_probe,
461− .remove_new = cg3_remove,
461+ .remove = cg3_remove,
462462 };
463463
464464 static int __init cg3_init(void)
drivers/video/fbdev/cg6.c+1−1
@@ -858,7 +858,7 @@ static struct platform_driver cg6_driver = { · 857 unmodified lines
858858 .of_match_table = cg6_match,
859859 },
860860 .probe = cg6_probe,
861− .remove_new = cg6_remove,
861+ .remove = cg6_remove,
862862 };
863863
864864 static int __init cg6_init(void)
drivers/video/fbdev/clps711x-fb.c+1−1
@@ -371,7 +371,7 @@ static struct platform_driver clps711x_fb_driver = { · 370 unmodified lines
371371 .of_match_table = clps711x_fb_dt_ids,
372372 },
373373 .probe = clps711x_fb_probe,
374− .remove_new = clps711x_fb_remove,
374+ .remove = clps711x_fb_remove,
375375 };
376376 module_platform_driver(clps711x_fb_driver);
377377
drivers/video/fbdev/cobalt_lcdfb.c+1−1
@@ -344,7 +344,7 @@ static void cobalt_lcdfb_remove(struct platform_device *dev) · 343 unmodified lines
344344
345345 static struct platform_driver cobalt_lcdfb_driver = {
346346 .probe = cobalt_lcdfb_probe,
347− .remove_new = cobalt_lcdfb_remove,
347+ .remove = cobalt_lcdfb_remove,
348348 .driver = {
349349 .name = "cobalt-lcd",
350350 },
drivers/video/fbdev/da8xx-fb.c+1−1
@@ -1652,7 +1652,7 @@ static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume); · 1651 unmodified lines
16521652
16531653 static struct platform_driver da8xx_fb_driver = {
16541654 .probe = fb_probe,
1655− .remove_new = fb_remove,
1655+ .remove = fb_remove,
16561656 .driver = {
16571657 .name = DRIVER_NAME,
16581658 .pm = &fb_pm_ops,
drivers/video/fbdev/ep93xx-fb.c+1−1
@@ -592,7 +592,7 @@ static void ep93xxfb_remove(struct platform_device *pdev) · 591 unmodified lines
592592
593593 static struct platform_driver ep93xxfb_driver = {
594594 .probe = ep93xxfb_probe,
595− .remove_new = ep93xxfb_remove,
595+ .remove = ep93xxfb_remove,
596596 .driver = {
597597 .name = "ep93xx-fb",
598598 },
drivers/video/fbdev/ffb.c+1−1
@@ -1053,7 +1053,7 @@ static struct platform_driver ffb_driver = { · 1052 unmodified lines
10531053 .of_match_table = ffb_match,
10541054 },
10551055 .probe = ffb_probe,
1056− .remove_new = ffb_remove,
1056+ .remove = ffb_remove,
10571057 };
10581058
10591059 static int __init ffb_init(void)
drivers/video/fbdev/fsl-diu-fb.c+3−3
@@ -1876,12 +1876,12 @@ static const struct of_device_id fsl_diu_match[] = { · 1875 unmodified lines
18761876 MODULE_DEVICE_TABLE(of, fsl_diu_match);
18771877
18781878 static struct platform_driver fsl_diu_driver = {
1879− .driver = {
1879+ .driver = {
18801880 .name = "fsl-diu-fb",
18811881 .of_match_table = fsl_diu_match,
18821882 },
1883− .probe = fsl_diu_probe,
1884− .remove_new = fsl_diu_remove,
1883+ .probe = fsl_diu_probe,
1884+ .remove = fsl_diu_remove,
18851885 .suspend = fsl_diu_suspend,
18861886 .resume = fsl_diu_resume,
18871887 };
drivers/video/fbdev/gbefb.c+3−3
@@ -1247,10 +1247,10 @@ static void gbefb_remove(struct platform_device* p_dev) · 1246 unmodified lines
12471247
12481248 static struct platform_driver gbefb_driver = {
12491249 .probe = gbefb_probe,
1250− .remove_new = gbefb_remove,
1251− .driver = {
1250+ .remove = gbefb_remove,
1251+ .driver = {
12521252 .name = "gbefb",
1253− .dev_groups = gbefb_groups,
1253+ .dev_groups = gbefb_groups,
12541254 },
12551255 };
12561256
drivers/video/fbdev/goldfishfb.c+1−1
@@ -311,7 +311,7 @@ MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match); · 310 unmodified lines
311311
312312 static struct platform_driver goldfish_fb_driver = {
313313 .probe = goldfish_fb_probe,
314− .remove_new = goldfish_fb_remove,
314+ .remove = goldfish_fb_remove,
315315 .driver = {
316316 .name = "goldfish_fb",
317317 .of_match_table = goldfish_fb_of_match,
drivers/video/fbdev/grvga.c+1−1
@@ -540,7 +540,7 @@ static struct platform_driver grvga_driver = { · 539 unmodified lines
540540 .of_match_table = svgactrl_of_match,
541541 },
542542 .probe = grvga_probe,
543− .remove_new = grvga_remove,
543+ .remove = grvga_remove,
544544 };
545545
546546 module_platform_driver(grvga_driver);
drivers/video/fbdev/hecubafb.c+1−1
@@ -235,7 +235,7 @@ static void hecubafb_remove(struct platform_device *dev) · 234 unmodified lines
235235
236236 static struct platform_driver hecubafb_driver = {
237237 .probe = hecubafb_probe,
238− .remove_new = hecubafb_remove,
238+ .remove = hecubafb_remove,
239239 .driver = {
240240 .name = "hecubafb",
241241 },
drivers/video/fbdev/hgafb.c+1−1
@@ -629,7 +629,7 @@ static void hgafb_remove(struct platform_device *pdev) · 628 unmodified lines
629629
630630 static struct platform_driver hgafb_driver = {
631631 .probe = hgafb_probe,
632− .remove_new = hgafb_remove,
632+ .remove = hgafb_remove,
633633 .driver = {
634634 .name = "hgafb",
635635 },
drivers/video/fbdev/hitfb.c+1−1
@@ -476,7 +476,7 @@ static const struct dev_pm_ops hitfb_dev_pm_ops = { · 475 unmodified lines
476476
477477 static struct platform_driver hitfb_driver = {
478478 .probe = hitfb_probe,
479− .remove_new = hitfb_remove,
479+ .remove = hitfb_remove,
480480 .driver = {
481481 .name = "hitfb",
482482 .pm = &hitfb_dev_pm_ops,
drivers/video/fbdev/imxfb.c+1−1
@@ -1105,7 +1105,7 @@ static struct platform_driver imxfb_driver = { · 1104 unmodified lines
11051105 .pm = pm_sleep_ptr(&imxfb_pm_ops),
11061106 },
11071107 .probe = imxfb_probe,
1108− .remove_new = imxfb_remove,
1108+ .remove = imxfb_remove,
11091109 .id_table = imxfb_devtype,
11101110 };
11111111 module_platform_driver(imxfb_driver);
drivers/video/fbdev/leo.c+1−1
@@ -657,7 +657,7 @@ static struct platform_driver leo_driver = { · 656 unmodified lines
657657 .of_match_table = leo_match,
658658 },
659659 .probe = leo_probe,
660− .remove_new = leo_remove,
660+ .remove = leo_remove,
661661 };
662662
663663 static int __init leo_init(void)
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c+1−1
@@ -834,7 +834,7 @@ static struct platform_driver of_platform_mb862xxfb_driver = { · 833 unmodified lines
834834 .of_match_table = of_platform_mb862xx_tbl,
835835 },
836836 .probe = of_platform_mb862xx_probe,
837− .remove_new = of_platform_mb862xx_remove,
837+ .remove = of_platform_mb862xx_remove,
838838 };
839839 #endif
840840
drivers/video/fbdev/metronomefb.c+1−1
@@ -707,7 +707,7 @@ static void metronomefb_remove(struct platform_device *dev) · 706 unmodified lines
707707
708708 static struct platform_driver metronomefb_driver = {
709709 .probe = metronomefb_probe,
710− .remove_new = metronomefb_remove,
710+ .remove = metronomefb_remove,
711711 .driver = {
712712 .name = "metronomefb",
713713 },
drivers/video/fbdev/ocfb.c+1−1
@@ -391,7 +391,7 @@ MODULE_DEVICE_TABLE(of, ocfb_match); · 390 unmodified lines
391391
392392 static struct platform_driver ocfb_driver = {
393393 .probe = ocfb_probe,
394− .remove_new = ocfb_remove,
394+ .remove = ocfb_remove,
395395 .driver = {
396396 .name = "ocfb_fb",
397397 .of_match_table = ocfb_match,
drivers/video/fbdev/offb.c+2−2
@@ -673,7 +673,7 @@ static struct platform_driver offb_driver_bootx_noscreen = { · 672 unmodified lines
673673 .name = "bootx-noscreen",
674674 },
675675 .probe = offb_probe_bootx_noscreen,
676− .remove_new = offb_remove,
676+ .remove = offb_remove,
677677 };
678678
679679 static int offb_probe_display(struct platform_device *pdev)
@@ -695,7 +695,7 @@ static struct platform_driver offb_driver_display = { · 15 unmodified lines
695695 .of_match_table = offb_of_match_display,
696696 },
697697 .probe = offb_probe_display,
698− .remove_new = offb_remove,
698+ .remove = offb_remove,
699699 };
700700
701701 static int __init offb_init(void)
drivers/video/fbdev/omap/omapfb_main.c+1−1
@@ -1825,7 +1825,7 @@ static int omapfb_resume(struct platform_device *pdev) · 1824 unmodified lines
18251825
18261826 static struct platform_driver omapfb_driver = {
18271827 .probe = omapfb_probe,
1828− .remove_new = omapfb_remove,
1828+ .remove = omapfb_remove,
18291829 .suspend = omapfb_suspend,
18301830 .resume = omapfb_resume,
18311831 .driver = {
drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c+1−1
@@ -245,7 +245,7 @@ MODULE_DEVICE_TABLE(of, tvc_of_match); · 244 unmodified lines
245245
246246 static struct platform_driver tvc_connector_driver = {
247247 .probe = tvc_probe,
248− .remove_new = tvc_remove,
248+ .remove = tvc_remove,
249249 .driver = {
250250 .name = "connector-analog-tv",
251251 .of_match_table = tvc_of_match,
drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c+1−1
@@ -328,7 +328,7 @@ MODULE_DEVICE_TABLE(of, dvic_of_match); · 327 unmodified lines
328328
329329 static struct platform_driver dvi_connector_driver = {
330330 .probe = dvic_probe,
331− .remove_new = dvic_remove,
331+ .remove = dvic_remove,
332332 .driver = {
333333 .name = "connector-dvi",
334334 .of_match_table = dvic_of_match,
drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c+1−1
@@ -272,7 +272,7 @@ MODULE_DEVICE_TABLE(of, hdmic_of_match); · 271 unmodified lines
272272
273273 static struct platform_driver hdmi_connector_driver = {
274274 .probe = hdmic_probe,
275− .remove_new = hdmic_remove,
275+ .remove = hdmic_remove,
276276 .driver = {
277277 .name = "connector-hdmi",
278278 .of_match_table = hdmic_of_match,
drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c+1−1
@@ -258,7 +258,7 @@ MODULE_DEVICE_TABLE(of, opa362_of_match); · 257 unmodified lines
258258
259259 static struct platform_driver opa362_driver = {
260260 .probe = opa362_probe,
261− .remove_new = opa362_remove,
261+ .remove = opa362_remove,
262262 .driver = {
263263 .name = "amplifier-opa362",
264264 .of_match_table = opa362_of_match,
drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c+1−1
@@ -245,7 +245,7 @@ MODULE_DEVICE_TABLE(of, tfp410_of_match); · 244 unmodified lines
245245
246246 static struct platform_driver tfp410_driver = {
247247 .probe = tfp410_probe,
248− .remove_new = tfp410_remove,
248+ .remove = tfp410_remove,
249249 .driver = {
250250 .name = "tfp410",
251251 .of_match_table = tfp410_of_match,
drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c+1−1
@@ -311,7 +311,7 @@ MODULE_DEVICE_TABLE(of, tpd_of_match); · 310 unmodified lines
311311
312312 static struct platform_driver tpd_driver = {
313313 .probe = tpd_probe,
314− .remove_new = tpd_remove,
314+ .remove = tpd_remove,
315315 .driver = {
316316 .name = "tpd12s015",
317317 .of_match_table = tpd_of_match,
drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c+1−1
@@ -234,7 +234,7 @@ MODULE_DEVICE_TABLE(of, panel_dpi_of_match); · 233 unmodified lines
234234
235235 static struct platform_driver panel_dpi_driver = {
236236 .probe = panel_dpi_probe,
237− .remove_new = panel_dpi_remove,
237+ .remove = panel_dpi_remove,
238238 .driver = {
239239 .name = "panel-dpi",
240240 .of_match_table = panel_dpi_of_match,
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c+1−1
@@ -1275,7 +1275,7 @@ MODULE_DEVICE_TABLE(of, dsicm_of_match); · 1274 unmodified lines
12751275
12761276 static struct platform_driver dsicm_driver = {
12771277 .probe = dsicm_probe,
1278− .remove_new = dsicm_remove,
1278+ .remove = dsicm_remove,
12791279 .driver = {
12801280 .name = "panel-dsi-cm",
12811281 .of_match_table = dsicm_of_match,
drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c+1−1
@@ -315,7 +315,7 @@ MODULE_DEVICE_TABLE(of, sharp_ls_of_match); · 314 unmodified lines
315315
316316 static struct platform_driver sharp_ls_driver = {
317317 .probe = sharp_ls_probe,
318− .remove_new = sharp_ls_remove,
318+ .remove = sharp_ls_remove,
319319 .driver = {
320320 .name = "panel-sharp-ls037v7dw01",
321321 .of_match_table = sharp_ls_of_match,
drivers/video/fbdev/omap2/omapfb/dss/core.c+3−3
@@ -185,10 +185,10 @@ static void omap_dss_shutdown(struct platform_device *pdev) · 184 unmodified lines
185185 }
186186
187187 static struct platform_driver omap_dss_driver = {
188− .remove_new = omap_dss_remove,
188+ .remove = omap_dss_remove,
189189 .shutdown = omap_dss_shutdown,
190− .driver = {
191− .name = "omapdss",
190+ .driver = {
191+ .name = "omapdss",
192192 },
193193 };
194194
drivers/video/fbdev/omap2/omapfb/dss/dispc.c+1−1
@@ -4072,7 +4072,7 @@ static const struct of_device_id dispc_of_match[] = { · 4071 unmodified lines
40724072
40734073 static struct platform_driver omap_dispchw_driver = {
40744074 .probe = dispc_probe,
4075− .remove_new = dispc_remove,
4075+ .remove = dispc_remove,
40764076 .driver = {
40774077 .name = "omapdss_dispc",
40784078 .pm = &dispc_pm_ops,
drivers/video/fbdev/omap2/omapfb/dss/dpi.c+2−2
@@ -817,8 +817,8 @@ static void dpi_remove(struct platform_device *pdev) · 816 unmodified lines
817817
818818 static struct platform_driver omap_dpi_driver = {
819819 .probe = dpi_probe,
820− .remove_new = dpi_remove,
821− .driver = {
820+ .remove = dpi_remove,
821+ .driver = {
822822 .name = "omapdss_dpi",
823823 .suppress_bind_attrs = true,
824824 },
drivers/video/fbdev/omap2/omapfb/dss/dsi.c+1−1
@@ -5565,7 +5565,7 @@ static const struct of_device_id dsi_of_match[] = { · 5564 unmodified lines
55655565
55665566 static struct platform_driver omap_dsihw_driver = {
55675567 .probe = dsi_probe,
5568− .remove_new = dsi_remove,
5568+ .remove = dsi_remove,
55695569 .driver = {
55705570 .name = "omapdss_dsi",
55715571 .pm = &dsi_pm_ops,
drivers/video/fbdev/omap2/omapfb/dss/dss.c+1−1
@@ -1278,7 +1278,7 @@ MODULE_DEVICE_TABLE(of, dss_of_match); · 1277 unmodified lines
12781278
12791279 static struct platform_driver omap_dsshw_driver = {
12801280 .probe = dss_probe,
1281− .remove_new = dss_remove,
1281+ .remove = dss_remove,
12821282 .driver = {
12831283 .name = "omapdss_dss",
12841284 .pm = &dss_pm_ops,
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c+3−3
@@ -792,9 +792,9 @@ static const struct of_device_id hdmi_of_match[] = { · 791 unmodified lines
792792
793793 static struct platform_driver omapdss_hdmihw_driver = {
794794 .probe = hdmi4_probe,
795− .remove_new = hdmi4_remove,
796− .driver = {
797− .name = "omapdss_hdmi",
795+ .remove = hdmi4_remove,
796+ .driver = {
797+ .name = "omapdss_hdmi",
798798 .pm = &hdmi_pm_ops,
799799 .of_match_table = hdmi_of_match,
800800 .suppress_bind_attrs = true,
drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c+1−1
@@ -834,7 +834,7 @@ static const struct of_device_id hdmi_of_match[] = { · 833 unmodified lines
834834
835835 static struct platform_driver omapdss_hdmihw_driver = {
836836 .probe = hdmi5_probe,
837− .remove_new = hdmi5_remove,
837+ .remove = hdmi5_remove,
838838 .driver = {
839839 .name = "omapdss_hdmi5",
840840 .pm = &hdmi_pm_ops,
drivers/video/fbdev/omap2/omapfb/dss/sdi.c+3−3
@@ -382,9 +382,9 @@ static void sdi_remove(struct platform_device *pdev) · 381 unmodified lines
382382
383383 static struct platform_driver omap_sdi_driver = {
384384 .probe = sdi_probe,
385− .remove_new = sdi_remove,
386− .driver = {
387− .name = "omapdss_sdi",
385+ .remove = sdi_remove,
386+ .driver = {
387+ .name = "omapdss_sdi",
388388 .suppress_bind_attrs = true,
389389 },
390390 };
drivers/video/fbdev/omap2/omapfb/dss/venc.c+3−3
@@ -920,9 +920,9 @@ static const struct of_device_id venc_of_match[] = { · 919 unmodified lines
920920
921921 static struct platform_driver omap_venchw_driver = {
922922 .probe = venc_probe,
923− .remove_new = venc_remove,
924− .driver = {
925− .name = "omapdss_venc",
923+ .remove = venc_remove,
924+ .driver = {
925+ .name = "omapdss_venc",
926926 .pm = &venc_pm_ops,
927927 .of_match_table = venc_of_match,
928928 .suppress_bind_attrs = true,
drivers/video/fbdev/omap2/omapfb/omapfb-main.c+1−1
@@ -2614,7 +2614,7 @@ static void omapfb_remove(struct platform_device *pdev) · 2613 unmodified lines
26142614
26152615 static struct platform_driver omapfb_driver = {
26162616 .probe = omapfb_probe,
2617− .remove_new = omapfb_remove,
2617+ .remove = omapfb_remove,
26182618 .driver = {
26192619 .name = "omapfb",
26202620 },
drivers/video/fbdev/p9100.c+1−1
@@ -347,7 +347,7 @@ static struct platform_driver p9100_driver = { · 346 unmodified lines
347347 .of_match_table = p9100_match,
348348 },
349349 .probe = p9100_probe,
350− .remove_new = p9100_remove,
350+ .remove = p9100_remove,
351351 };
352352
353353 static int __init p9100_init(void)
drivers/video/fbdev/platinumfb.c+1−1
@@ -668,7 +668,7 @@ static struct platform_driver platinum_driver = · 667 unmodified lines
668668 .of_match_table = platinumfb_match,
669669 },
670670 .probe = platinumfb_probe,
671− .remove_new = platinumfb_remove,
671+ .remove = platinumfb_remove,
672672 };
673673
674674 static int __init platinumfb_init(void)
drivers/video/fbdev/pxa168fb.c+1−1
@@ -799,7 +799,7 @@ static struct platform_driver pxa168fb_driver = { · 798 unmodified lines
799799 .name = "pxa168-fb",
800800 },
801801 .probe = pxa168fb_probe,
802− .remove_new = pxa168fb_remove,
802+ .remove = pxa168fb_remove,
803803 };
804804
805805 module_platform_driver(pxa168fb_driver);
drivers/video/fbdev/pxa3xx-gcu.c+4−4
@@ -696,10 +696,10 @@ MODULE_DEVICE_TABLE(of, pxa3xx_gcu_of_match); · 695 unmodified lines
696696 #endif
697697
698698 static struct platform_driver pxa3xx_gcu_driver = {
699− .probe = pxa3xx_gcu_probe,
700− .remove_new = pxa3xx_gcu_remove,
701− .driver = {
702− .name = DRV_NAME,
699+ .probe = pxa3xx_gcu_probe,
700+ .remove = pxa3xx_gcu_remove,
701+ .driver = {
702+ .name = DRV_NAME,
703703 .of_match_table = of_match_ptr(pxa3xx_gcu_of_match),
704704 },
705705 };
drivers/video/fbdev/pxafb.c+1−1
@@ -2427,7 +2427,7 @@ MODULE_DEVICE_TABLE(of, pxafb_of_dev_id); · 2426 unmodified lines
24272427
24282428 static struct platform_driver pxafb_driver = {
24292429 .probe = pxafb_probe,
2430− .remove_new = pxafb_remove,
2430+ .remove = pxafb_remove,
24312431 .driver = {
24322432 .name = "pxa2xx-fb",
24332433 .of_match_table = pxafb_of_dev_id,
drivers/video/fbdev/s1d13xxxfb.c+1−1
@@ -1001,7 +1001,7 @@ static int s1d13xxxfb_resume(struct platform_device *dev) · 1000 unmodified lines
10011001
10021002 static struct platform_driver s1d13xxxfb_driver = {
10031003 .probe = s1d13xxxfb_probe,
1004− .remove_new = s1d13xxxfb_remove,
1004+ .remove = s1d13xxxfb_remove,
10051005 #ifdef CONFIG_PM
10061006 .suspend = s1d13xxxfb_suspend,
10071007 .resume = s1d13xxxfb_resume,
drivers/video/fbdev/s3c-fb.c+1−1
@@ -1789,7 +1789,7 @@ static const struct dev_pm_ops s3cfb_pm_ops = { · 1788 unmodified lines
17891789
17901790 static struct platform_driver s3c_fb_driver = {
17911791 .probe = s3c_fb_probe,
1792− .remove_new = s3c_fb_remove,
1792+ .remove = s3c_fb_remove,
17931793 .id_table = s3c_fb_driver_ids,
17941794 .driver = {
17951795 .name = "s3c-fb",
drivers/video/fbdev/sh7760fb.c+1−1
@@ -575,7 +575,7 @@ static struct platform_driver sh7760_lcdc_driver = { · 574 unmodified lines
575575 .name = "sh7760-lcdc",
576576 },
577577 .probe = sh7760fb_probe,
578− .remove_new = sh7760fb_remove,
578+ .remove = sh7760fb_remove,
579579 };
580580
581581 module_platform_driver(sh7760_lcdc_driver);
drivers/video/fbdev/sh_mobile_lcdcfb.c+1−1
@@ -2648,7 +2648,7 @@ static struct platform_driver sh_mobile_lcdc_driver = { · 2647 unmodified lines
26482648 .pm = &sh_mobile_lcdc_dev_pm_ops,
26492649 },
26502650 .probe = sh_mobile_lcdc_probe,
2651− .remove_new = sh_mobile_lcdc_remove,
2651+ .remove = sh_mobile_lcdc_remove,
26522652 };
26532653
26542654 module_platform_driver(sh_mobile_lcdc_driver);
drivers/video/fbdev/simplefb.c+1−1
@@ -677,7 +677,7 @@ static struct platform_driver simplefb_driver = { · 676 unmodified lines
677677 .of_match_table = simplefb_of_match,
678678 },
679679 .probe = simplefb_probe,
680− .remove_new = simplefb_remove,
680+ .remove = simplefb_remove,
681681 };
682682
683683 module_platform_driver(simplefb_driver);
drivers/video/fbdev/sm501fb.c+1−1
@@ -2211,7 +2211,7 @@ static int sm501fb_resume(struct platform_device *pdev) · 2210 unmodified lines
22112211
22122212 static struct platform_driver sm501fb_driver = {
22132213 .probe = sm501fb_probe,
2214− .remove_new = sm501fb_remove,
2214+ .remove = sm501fb_remove,
22152215 .suspend = sm501fb_suspend,
22162216 .resume = sm501fb_resume,
22172217 .driver = {
drivers/video/fbdev/tcx.c+1−1
@@ -505,7 +505,7 @@ static struct platform_driver tcx_driver = { · 504 unmodified lines
505505 .of_match_table = tcx_match,
506506 },
507507 .probe = tcx_probe,
508− .remove_new = tcx_remove,
508+ .remove = tcx_remove,
509509 };
510510
511511 static int __init tcx_init(void)
drivers/video/fbdev/uvesafb.c+1−1
@@ -1794,7 +1794,7 @@ static void uvesafb_remove(struct platform_device *dev) · 1793 unmodified lines
17941794
17951795 static struct platform_driver uvesafb_driver = {
17961796 .probe = uvesafb_probe,
1797− .remove_new = uvesafb_remove,
1797+ .remove = uvesafb_remove,
17981798 .driver = {
17991799 .name = "uvesafb",
18001800 },
drivers/video/fbdev/vesafb.c+1−1
@@ -515,7 +515,7 @@ static struct platform_driver vesafb_driver = { · 514 unmodified lines
515515 .name = "vesa-framebuffer",
516516 },
517517 .probe = vesafb_probe,
518− .remove_new = vesafb_remove,
518+ .remove = vesafb_remove,
519519 };
520520
521521 module_platform_driver(vesafb_driver);
drivers/video/fbdev/vfb.c+1−1
@@ -493,7 +493,7 @@ static void vfb_remove(struct platform_device *dev) · 492 unmodified lines
493493
494494 static struct platform_driver vfb_driver = {
495495 .probe = vfb_probe,
496− .remove_new = vfb_remove,
496+ .remove = vfb_remove,
497497 .driver = {
498498 .name = "vfb",
499499 },
drivers/video/fbdev/vga16fb.c+1−1
@@ -1417,7 +1417,7 @@ MODULE_DEVICE_TABLE(platform, vga16fb_driver_id_table); · 1416 unmodified lines
14171417
14181418 static struct platform_driver vga16fb_driver = {
14191419 .probe = vga16fb_probe,
1420− .remove_new = vga16fb_remove,
1420+ .remove = vga16fb_remove,
14211421 .driver = {
14221422 .name = "vga16fb",
14231423 },
drivers/video/fbdev/via/via-gpio.c+1−1
@@ -292,7 +292,7 @@ static struct platform_driver via_gpio_driver = { · 291 unmodified lines
292292 .name = "viafb-gpio",
293293 },
294294 .probe = viafb_gpio_probe,
295− .remove_new = viafb_gpio_remove,
295+ .remove = viafb_gpio_remove,
296296 };
297297
298298 int viafb_gpio_init(void)
drivers/video/fbdev/via/via_i2c.c+1−1
@@ -265,7 +265,7 @@ static struct platform_driver via_i2c_driver = { · 264 unmodified lines
265265 .name = "viafb-i2c",
266266 },
267267 .probe = viafb_i2c_probe,
268− .remove_new = viafb_i2c_remove,
268+ .remove = viafb_i2c_remove,
269269 };
270270
271271 int viafb_i2c_init(void)
drivers/video/fbdev/vt8500lcdfb.c+1−1
@@ -471,7 +471,7 @@ static const struct of_device_id via_dt_ids[] = { · 470 unmodified lines
471471
472472 static struct platform_driver vt8500lcd_driver = {
473473 .probe = vt8500lcd_probe,
474− .remove_new = vt8500lcd_remove,
474+ .remove = vt8500lcd_remove,
475475 .driver = {
476476 .name = "vt8500-lcd",
477477 .of_match_table = of_match_ptr(via_dt_ids),
drivers/video/fbdev/wm8505fb.c+1−1
@@ -392,7 +392,7 @@ static const struct of_device_id wmt_dt_ids[] = { · 391 unmodified lines
392392
393393 static struct platform_driver wm8505fb_driver = {
394394 .probe = wm8505fb_probe,
395− .remove_new = wm8505fb_remove,
395+ .remove = wm8505fb_remove,
396396 .driver = {
397397 .name = DRIVER_NAME,
398398 .of_match_table = wmt_dt_ids,
drivers/video/fbdev/wmt_ge_rops.c+1−1
@@ -159,7 +159,7 @@ static const struct of_device_id wmt_dt_ids[] = { · 158 unmodified lines
159159
160160 static struct platform_driver wmt_ge_rops_driver = {
161161 .probe = wmt_ge_rops_probe,
162− .remove_new = wmt_ge_rops_remove,
162+ .remove = wmt_ge_rops_remove,
163163 .driver = {
164164 .name = "wmt_ge_rops",
165165 .of_match_table = wmt_dt_ids,
drivers/video/fbdev/xilinxfb.c+1−1
@@ -488,7 +488,7 @@ MODULE_DEVICE_TABLE(of, xilinxfb_of_match); · 487 unmodified lines
488488
489489 static struct platform_driver xilinxfb_of_driver = {
490490 .probe = xilinxfb_of_probe,
491− .remove_new = xilinxfb_of_remove,
491+ .remove = xilinxfb_of_remove,
492492 .driver = {
493493 .name = DRIVER_NAME,
494494 .of_match_table = xilinxfb_of_match,
drivers/virtio/virtio_ring.c+1−1
@@ -2588,7 +2588,7 @@ irqreturn_t vring_interrupt(int irq, void *_vq) · 2587 unmodified lines
25882588
25892589 /* Just a hint for performance: so it's ok that this can be racy! */
25902590 if (vq->event)
2591− vq->event_triggered = true;
2591+ data_race(vq->event_triggered = true);
25922592
25932593 pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback);
25942594 if (vq->vq.callback)
drivers/xen/Kconfig+0−1
@@ -261,7 +261,6 @@ config XEN_SCSI_BACKEND · 260 unmodified lines
261261 config XEN_PRIVCMD
262262 tristate "Xen hypercall passthrough driver"
263263 depends on XEN
264− imply CONFIG_XEN_PCIDEV_BACKEND
265264 default m
266265 help
267266 The hypercall passthrough driver allows privileged user programs to
drivers/xen/acpi.c+24−0
@@ -125,3 +125,27 @@ int xen_acpi_get_gsi_info(struct pci_dev *dev, · 124 unmodified lines
125125 return 0;
126126 }
127127 EXPORT_SYMBOL_GPL(xen_acpi_get_gsi_info);
128+
129+static get_gsi_from_sbdf_t get_gsi_from_sbdf;
130+static DEFINE_RWLOCK(get_gsi_from_sbdf_lock);
131+
132+void xen_acpi_register_get_gsi_func(get_gsi_from_sbdf_t func)
133+{
134+ write_lock(&get_gsi_from_sbdf_lock);
135+ get_gsi_from_sbdf = func;
136+ write_unlock(&get_gsi_from_sbdf_lock);
137+}
138+EXPORT_SYMBOL_GPL(xen_acpi_register_get_gsi_func);
139+
140+int xen_acpi_get_gsi_from_sbdf(u32 sbdf)
141+{
142+ int ret = -EOPNOTSUPP;
143+
144+ read_lock(&get_gsi_from_sbdf_lock);
145+ if (get_gsi_from_sbdf)
146+ ret = get_gsi_from_sbdf(sbdf);
147+ read_unlock(&get_gsi_from_sbdf_lock);
148+
149+ return ret;
150+}
151+EXPORT_SYMBOL_GPL(xen_acpi_get_gsi_from_sbdf);
drivers/xen/privcmd.c+2−4
@@ -850,15 +850,13 @@ out: · 849 unmodified lines
850850 static long privcmd_ioctl_pcidev_get_gsi(struct file *file, void __user *udata)
851851 {
852852 #if defined(CONFIG_XEN_ACPI)
853− int rc = -EINVAL;
853+ int rc;
854854 struct privcmd_pcidev_get_gsi kdata;
855855
856856 if (copy_from_user(&kdata, udata, sizeof(kdata)))
857857 return -EFAULT;
858858
859− if (IS_REACHABLE(CONFIG_XEN_PCIDEV_BACKEND))
860− rc = pcistub_get_gsi_from_sbdf(kdata.sbdf);
861−
859+ rc = xen_acpi_get_gsi_from_sbdf(kdata.sbdf);
862860 if (rc < 0)
863861 return rc;
864862
drivers/xen/xen-pciback/pci_stub.c+9−2
@@ -227,7 +227,7 @@ static struct pci_dev *pcistub_device_get_pci_dev(struct xen_pcibk_device *pdev, · 226 unmodified lines
227227 }
228228
229229 #ifdef CONFIG_XEN_ACPI
230−int pcistub_get_gsi_from_sbdf(unsigned int sbdf)
230+static int pcistub_get_gsi_from_sbdf(unsigned int sbdf)
231231 {
232232 struct pcistub_device *psdev;
233233 int domain = (sbdf >> 16) & 0xffff;
@@ -242,7 +242,6 @@ int pcistub_get_gsi_from_sbdf(unsigned int sbdf) · 8 unmodified lines
242242
243243 return psdev->gsi;
244244 }
245−EXPORT_SYMBOL_GPL(pcistub_get_gsi_from_sbdf);
246245 #endif
247246
248247 struct pci_dev *pcistub_get_pci_dev_by_slot(struct xen_pcibk_device *pdev,
@@ -1757,11 +1756,19 @@ static int __init xen_pcibk_init(void) · 1508 unmodified lines
17571756 bus_register_notifier(&pci_bus_type, &pci_stub_nb);
17581757 #endif
17591758
1759+#ifdef CONFIG_XEN_ACPI
1760+ xen_acpi_register_get_gsi_func(pcistub_get_gsi_from_sbdf);
1761+#endif
1762+
17601763 return err;
17611764 }
17621765
17631766 static void __exit xen_pcibk_cleanup(void)
17641767 {
1768+#ifdef CONFIG_XEN_ACPI
1769+ xen_acpi_register_get_gsi_func(NULL);
1770+#endif
1771+
17651772 #ifdef CONFIG_PCI_IOV
17661773 bus_unregister_notifier(&pci_bus_type, &pci_stub_nb);
17671774 #endif
fs/9p/fid.c+2−3
@@ -131,10 +131,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any) · 130 unmodified lines
131131 }
132132 }
133133 spin_unlock(&dentry->d_lock);
134− } else {
135− if (dentry->d_inode)
136− ret = v9fs_fid_find_inode(dentry->d_inode, false, uid, any);
137134 }
135+ if (!ret && dentry->d_inode)
136+ ret = v9fs_fid_find_inode(dentry->d_inode, false, uid, any);
138137
139138 return ret;
140139 }
fs/Kconfig+1−1
@@ -388,7 +388,7 @@ config NFS_COMMON · 387 unmodified lines
388388
389389 config NFS_COMMON_LOCALIO_SUPPORT
390390 tristate
391− default n
391+ depends on NFS_LOCALIO
392392 default y if NFSD=y || NFS_FS=y
393393 default m if NFSD=m && NFS_FS=m
394394 select SUNRPC
fs/afs/internal.h+2−0
@@ -130,6 +130,7 @@ struct afs_call { · 129 unmodified lines
130130 wait_queue_head_t waitq; /* processes awaiting completion */
131131 struct work_struct async_work; /* async I/O processor */
132132 struct work_struct work; /* actual work processor */
133+ struct work_struct free_work; /* Deferred free processor */
133134 struct rxrpc_call *rxcall; /* RxRPC call handle */
134135 struct rxrpc_peer *peer; /* Remote endpoint */
135136 struct key *key; /* security for this call */
@@ -1331,6 +1332,7 @@ extern int __net_init afs_open_socket(struct afs_net *); · 1195 unmodified lines
13311332 extern void __net_exit afs_close_socket(struct afs_net *);
13321333 extern void afs_charge_preallocation(struct work_struct *);
13331334 extern void afs_put_call(struct afs_call *);
1335+void afs_deferred_put_call(struct afs_call *call);
13341336 void afs_make_call(struct afs_call *call, gfp_t gfp);
13351337 void afs_wait_for_call_to_complete(struct afs_call *call);
13361338 extern struct afs_call *afs_alloc_flat_call(struct afs_net *,
fs/afs/rxrpc.c+59−24
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 struct workqueue_struct *afs_async_calls;
2020
21+static void afs_deferred_free_worker(struct work_struct *work);
2122 static void afs_wake_up_call_waiter(struct sock *, struct rxrpc_call *, unsigned long);
2223 static void afs_wake_up_async_call(struct sock *, struct rxrpc_call *, unsigned long);
2324 static void afs_process_async_call(struct work_struct *);
@@ -149,6 +150,7 @@ static struct afs_call *afs_alloc_call(struct afs_net *net, · 125 unmodified lines
149150 call->debug_id = atomic_inc_return(&rxrpc_debug_id);
150151 refcount_set(&call->ref, 1);
151152 INIT_WORK(&call->async_work, afs_process_async_call);
153+ INIT_WORK(&call->free_work, afs_deferred_free_worker);
152154 init_waitqueue_head(&call->waitq);
153155 spin_lock_init(&call->state_lock);
154156 call->iter = &call->def_iter;
@@ -159,6 +161,36 @@ static struct afs_call *afs_alloc_call(struct afs_net *net, · 4 unmodified lines
159161 return call;
160162 }
161163
164+static void afs_free_call(struct afs_call *call)
165+{
166+ struct afs_net *net = call->net;
167+ int o;
168+
169+ ASSERT(!work_pending(&call->async_work));
170+
171+ rxrpc_kernel_put_peer(call->peer);
172+
173+ if (call->rxcall) {
174+ rxrpc_kernel_shutdown_call(net->socket, call->rxcall);
175+ rxrpc_kernel_put_call(net->socket, call->rxcall);
176+ call->rxcall = NULL;
177+ }
178+ if (call->type->destructor)
179+ call->type->destructor(call);
180+
181+ afs_unuse_server_notime(call->net, call->server, afs_server_trace_put_call);
182+ kfree(call->request);
183+
184+ o = atomic_read(&net->nr_outstanding_calls);
185+ trace_afs_call(call->debug_id, afs_call_trace_free, 0, o,
186+ __builtin_return_address(0));
187+ kfree(call);
188+
189+ o = atomic_dec_return(&net->nr_outstanding_calls);
190+ if (o == 0)
191+ wake_up_var(&net->nr_outstanding_calls);
192+}
193+
162194 /*
163195 * Dispose of a reference on a call.
164196 */
@@ -173,32 +205,34 @@ void afs_put_call(struct afs_call *call) · 8 unmodified lines
173205 o = atomic_read(&net->nr_outstanding_calls);
174206 trace_afs_call(debug_id, afs_call_trace_put, r - 1, o,
175207 __builtin_return_address(0));
208+ if (zero)
209+ afs_free_call(call);
210+}
176211
177− if (zero) {
178− ASSERT(!work_pending(&call->async_work));
179− ASSERT(call->type->name != NULL);
180−
181− rxrpc_kernel_put_peer(call->peer);
182−
183− if (call->rxcall) {
184− rxrpc_kernel_shutdown_call(net->socket, call->rxcall);
185− rxrpc_kernel_put_call(net->socket, call->rxcall);
186− call->rxcall = NULL;
187− }
188− if (call->type->destructor)
189− call->type->destructor(call);
212+static void afs_deferred_free_worker(struct work_struct *work)
213+{
214+ struct afs_call *call = container_of(work, struct afs_call, free_work);
190215
191− afs_unuse_server_notime(call->net, call->server, afs_server_trace_put_call);
192− kfree(call->request);
216+ afs_free_call(call);
217+}
193218
194− trace_afs_call(call->debug_id, afs_call_trace_free, 0, o,
195− __builtin_return_address(0));
196− kfree(call);
219+/*
220+ * Dispose of a reference on a call, deferring the cleanup to a workqueue
221+ * to avoid lock recursion.
222+ */
223+void afs_deferred_put_call(struct afs_call *call)
224+{
225+ struct afs_net *net = call->net;
226+ unsigned int debug_id = call->debug_id;
227+ bool zero;
228+ int r, o;
197229
198− o = atomic_dec_return(&net->nr_outstanding_calls);
199− if (o == 0)
200− wake_up_var(&net->nr_outstanding_calls);
201− }
230+ zero = __refcount_dec_and_test(&call->ref, &r);
231+ o = atomic_read(&net->nr_outstanding_calls);
232+ trace_afs_call(debug_id, afs_call_trace_put, r - 1, o,
233+ __builtin_return_address(0));
234+ if (zero)
235+ schedule_work(&call->free_work);
202236 }
203237
204238 static struct afs_call *afs_get_call(struct afs_call *call,
@@ -640,7 +674,8 @@ static void afs_wake_up_call_waiter(struct sock *sk, struct rxrpc_call *rxcall, · 435 unmodified lines
640674 }
641675
642676 /*
643− * wake up an asynchronous call
677+ * Wake up an asynchronous call. The caller is holding the call notify
678+ * spinlock around this, so we can't call afs_put_call().
644679 */
645680 static void afs_wake_up_async_call(struct sock *sk, struct rxrpc_call *rxcall,
646681 unsigned long call_user_ID)
@@ -657,7 +692,7 @@ static void afs_wake_up_async_call(struct sock *sk, struct rxrpc_call *rxcall, · 10 unmodified lines
657692 __builtin_return_address(0));
658693
659694 if (!queue_work(afs_async_calls, &call->async_work))
660− afs_put_call(call);
695+ afs_deferred_put_call(call);
661696 }
662697 }
663698
fs/bcachefs/alloc_background.c+51−26
@@ -332,7 +332,6 @@ void bch2_alloc_v4_swab(struct bkey_s k) · 331 unmodified lines
332332 a->io_time[1] = swab64(a->io_time[1]);
333333 a->stripe = swab32(a->stripe);
334334 a->nr_external_backpointers = swab32(a->nr_external_backpointers);
335− a->fragmentation_lru = swab64(a->fragmentation_lru);
336335 a->stripe_sectors = swab32(a->stripe_sectors);
337336
338337 bps = alloc_v4_backpointers(a);
@@ -347,6 +346,7 @@ void bch2_alloc_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c · 8 unmodified lines
347346 {
348347 struct bch_alloc_v4 _a;
349348 const struct bch_alloc_v4 *a = bch2_alloc_to_v4(k, &_a);
349+ struct bch_dev *ca = c ? bch2_dev_bucket_tryget_noerror(c, k.k->p) : NULL;
350350
351351 prt_newline(out);
352352 printbuf_indent_add(out, 2);
@@ -364,9 +364,13 @@ void bch2_alloc_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c · 11 unmodified lines
364364 prt_printf(out, "stripe_redundancy %u\n", a->stripe_redundancy);
365365 prt_printf(out, "io_time[READ] %llu\n", a->io_time[READ]);
366366 prt_printf(out, "io_time[WRITE] %llu\n", a->io_time[WRITE]);
367− prt_printf(out, "fragmentation %llu\n", a->fragmentation_lru);
367+
368+ if (ca)
369+ prt_printf(out, "fragmentation %llu\n", alloc_lru_idx_fragmentation(*a, ca));
368370 prt_printf(out, "bp_start %llu\n", BCH_ALLOC_V4_BACKPOINTERS_START(a));
369371 printbuf_indent_sub(out, 2);
372+
373+ bch2_dev_put(ca);
370374 }
371375
372376 void __bch2_alloc_to_v4(struct bkey_s_c k, struct bch_alloc_v4 *out)
@@ -635,6 +639,16 @@ int bch2_alloc_read(struct bch_fs *c) · 262 unmodified lines
635639 continue;
636640 }
637641
642+ if (k.k->p.offset < ca->mi.first_bucket) {
643+ bch2_btree_iter_set_pos(&iter, POS(k.k->p.inode, ca->mi.first_bucket));
644+ continue;
645+ }
646+
647+ if (k.k->p.offset >= ca->mi.nbuckets) {
648+ bch2_btree_iter_set_pos(&iter, POS(k.k->p.inode + 1, 0));
649+ continue;
650+ }
651+
638652 struct bch_alloc_v4 a;
639653 *bucket_gen(ca, k.k->p.offset) = bch2_alloc_to_v4(k, &a)->gen;
640654 0;
@@ -882,12 +896,13 @@ int bch2_trigger_alloc(struct btree_trans *trans, · 241 unmodified lines
882896 goto err;
883897 }
884898
885− new_a->fragmentation_lru = alloc_lru_idx_fragmentation(*new_a, ca);
886− if (old_a->fragmentation_lru != new_a->fragmentation_lru) {
899+ old_lru = alloc_lru_idx_fragmentation(*old_a, ca);
900+ new_lru = alloc_lru_idx_fragmentation(*new_a, ca);
901+ if (old_lru != new_lru) {
887902 ret = bch2_lru_change(trans,
888903 BCH_LRU_FRAGMENTATION_START,
889904 bucket_to_u64(new.k->p),
890− old_a->fragmentation_lru, new_a->fragmentation_lru);
905+ old_lru, new_lru);
891906 if (ret)
892907 goto err;
893908 }
@@ -1629,18 +1644,22 @@ static int bch2_check_alloc_to_lru_ref(struct btree_trans *trans, · 735 unmodified lines
16291644 if (ret)
16301645 return ret;
16311646
1647+ struct bch_dev *ca = bch2_dev_tryget_noerror(c, alloc_k.k->p.inode);
1648+ if (!ca)
1649+ return 0;
1650+
16321651 a = bch2_alloc_to_v4(alloc_k, &a_convert);
16331652
1634− if (a->fragmentation_lru) {
1653+ u64 lru_idx = alloc_lru_idx_fragmentation(*a, ca);
1654+ if (lru_idx) {
16351655 ret = bch2_lru_check_set(trans, BCH_LRU_FRAGMENTATION_START,
1636− a->fragmentation_lru,
1637− alloc_k, last_flushed);
1656+ lru_idx, alloc_k, last_flushed);
16381657 if (ret)
1639− return ret;
1658+ goto err;
16401659 }
16411660
16421661 if (a->data_type != BCH_DATA_cached)
1643− return 0;
1662+ goto err;
16441663
16451664 if (fsck_err_on(!a->io_time[READ],
16461665 trans, alloc_key_cached_but_read_time_zero,
@@ -1669,6 +1688,7 @@ static int bch2_check_alloc_to_lru_ref(struct btree_trans *trans, · 22 unmodified lines
16691688 goto err;
16701689 err:
16711690 fsck_err:
1691+ bch2_dev_put(ca);
16721692 printbuf_exit(&buf);
16731693 return ret;
16741694 }
@@ -1957,7 +1977,7 @@ static void bch2_do_discards_fast_work(struct work_struct *work) · 282 unmodified lines
19571977 ca->mi.bucket_size,
19581978 GFP_KERNEL);
19591979
1960− int ret = bch2_trans_do(c, NULL, NULL,
1980+ int ret = bch2_trans_commit_do(c, NULL, NULL,
19611981 BCH_WATERMARK_btree|
19621982 BCH_TRANS_COMMIT_no_enospc,
19631983 bch2_clear_bucket_needs_discard(trans, POS(ca->dev_idx, bucket)));
@@ -2117,14 +2137,15 @@ static void bch2_do_invalidates_work(struct work_struct *work) · 153 unmodified lines
21172137
21182138 struct bkey_s_c k = next_lru_key(trans, &iter, ca, &wrapped);
21192139 ret = bkey_err(k);
2120− if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2121− continue;
21222140 if (ret)
2123− break;
2141+ goto restart_err;
21242142 if (!k.k)
21252143 break;
21262144
21272145 ret = invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate);
2146+restart_err:
2147+ if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2148+ continue;
21282149 if (ret)
21292150 break;
21302151
@@ -2330,24 +2351,19 @@ int bch2_dev_remove_alloc(struct bch_fs *c, struct bch_dev *ca) · 199 unmodified lines
23302351
23312352 /* Bucket IO clocks: */
23322353
2333−int bch2_bucket_io_time_reset(struct btree_trans *trans, unsigned dev,
2334− size_t bucket_nr, int rw)
2354+static int __bch2_bucket_io_time_reset(struct btree_trans *trans, unsigned dev,
2355+ size_t bucket_nr, int rw)
23352356 {
23362357 struct bch_fs *c = trans->c;
2337− struct btree_iter iter;
2338− struct bkey_i_alloc_v4 *a;
2339− u64 now;
2340− int ret = 0;
23412358
2342− if (bch2_trans_relock(trans))
2343− bch2_trans_begin(trans);
2344−
2345− a = bch2_trans_start_alloc_update_noupdate(trans, &iter, POS(dev, bucket_nr));
2346− ret = PTR_ERR_OR_ZERO(a);
2359+ struct btree_iter iter;
2360+ struct bkey_i_alloc_v4 *a =
2361+ bch2_trans_start_alloc_update_noupdate(trans, &iter, POS(dev, bucket_nr));
2362+ int ret = PTR_ERR_OR_ZERO(a);
23472363 if (ret)
23482364 return ret;
23492365
2350− now = bch2_current_io_time(c, rw);
2366+ u64 now = bch2_current_io_time(c, rw);
23512367 if (a->v.io_time[rw] == now)
23522368 goto out;
23532369
@@ -2360,6 +2376,15 @@ out: · 6 unmodified lines
23602376 return ret;
23612377 }
23622378
2379+int bch2_bucket_io_time_reset(struct btree_trans *trans, unsigned dev,
2380+ size_t bucket_nr, int rw)
2381+{
2382+ if (bch2_trans_relock(trans))
2383+ bch2_trans_begin(trans);
2384+
2385+ return nested_lockrestart_do(trans, __bch2_bucket_io_time_reset(trans, dev, bucket_nr, rw));
2386+}
2387+
23632388 /* Startup/shutdown (ro/rw): */
23642389
23652390 void bch2_recalc_capacity(struct bch_fs *c)
fs/bcachefs/alloc_background_format.h+1−1
@@ -70,7 +70,7 @@ struct bch_alloc_v4 { · 69 unmodified lines
7070 __u32 stripe;
7171 __u32 nr_external_backpointers;
7272 /* end of fields in original version of alloc_v4 */
73− __u64 fragmentation_lru;
73+ __u64 _fragmentation_lru; /* obsolete */
7474 __u32 stripe_sectors;
7575 __u32 pad;
7676 } __packed __aligned(8);
fs/bcachefs/alloc_foreground.c+1−1
@@ -684,7 +684,7 @@ struct open_bucket *bch2_bucket_alloc(struct bch_fs *c, struct bch_dev *ca, · 683 unmodified lines
684684 struct bch_dev_usage usage;
685685 struct open_bucket *ob;
686686
687− bch2_trans_do(c, NULL, NULL, 0,
687+ bch2_trans_do(c,
688688 PTR_ERR_OR_ZERO(ob = bch2_bucket_alloc_trans(trans, ca, watermark,
689689 data_type, cl, false, &usage)));
690690 return ob;
fs/bcachefs/bcachefs_format.h+2−1
@@ -678,7 +678,8 @@ struct bch_sb_field_ext { · 677 unmodified lines
678678 x(disk_accounting_v2, BCH_VERSION(1, 9)) \
679679 x(disk_accounting_v3, BCH_VERSION(1, 10)) \
680680 x(disk_accounting_inum, BCH_VERSION(1, 11)) \
681− x(rebalance_work_acct_fix, BCH_VERSION(1, 12))
681+ x(rebalance_work_acct_fix, BCH_VERSION(1, 12)) \
682+ x(inode_has_child_snapshots, BCH_VERSION(1, 13))
682683
683684 enum bcachefs_metadata_version {
684685 bcachefs_metadata_version_min = 9,
fs/bcachefs/btree_gc.c+20−10
@@ -820,15 +820,23 @@ static int bch2_alloc_write_key(struct btree_trans *trans, · 819 unmodified lines
820820 * fix that here:
821821 */
822822 alloc_data_type_set(&gc, gc.data_type);
823−
824823 if (gc.data_type != old_gc.data_type ||
825824 gc.dirty_sectors != old_gc.dirty_sectors) {
826825 ret = bch2_alloc_key_to_dev_counters(trans, ca, &old_gc, &gc, BTREE_TRIGGER_gc);
827826 if (ret)
828827 return ret;
829− }
830828
831− gc.fragmentation_lru = alloc_lru_idx_fragmentation(gc, ca);
829+ /*
830+ * Ugly: alloc_key_to_dev_counters(..., BTREE_TRIGGER_gc) is not
831+ * safe w.r.t. transaction restarts, so fixup the gc_bucket so
832+ * we don't run it twice:
833+ */
834+ percpu_down_read(&c->mark_lock);
835+ struct bucket *gc_m = gc_bucket(ca, iter->pos.offset);
836+ gc_m->data_type = gc.data_type;
837+ gc_m->dirty_sectors = gc.dirty_sectors;
838+ percpu_up_read(&c->mark_lock);
839+ }
832840
833841 if (fsck_err_on(new.data_type != gc.data_type,
834842 trans, alloc_key_data_type_wrong,
@@ -857,7 +865,6 @@ static int bch2_alloc_write_key(struct btree_trans *trans, · 22 unmodified lines
857865 copy_bucket_field(alloc_key_cached_sectors_wrong, cached_sectors);
858866 copy_bucket_field(alloc_key_stripe_wrong, stripe);
859867 copy_bucket_field(alloc_key_stripe_redundancy_wrong, stripe_redundancy);
860− copy_bucket_field(alloc_key_fragmentation_lru_wrong, fragmentation_lru);
861868 #undef copy_bucket_field
862869
863870 if (!bch2_alloc_v4_cmp(*old, new))
@@ -1227,17 +1234,20 @@ int bch2_gc_gens(struct bch_fs *c) · 363 unmodified lines
12271234 u64 b, start_time = local_clock();
12281235 int ret;
12291236
1230− /*
1231− * Ideally we would be using state_lock and not gc_gens_lock here, but that
1232− * introduces a deadlock in the RO path - we currently take the state
1233− * lock at the start of going RO, thus the gc thread may get stuck:
1234− */
12351237 if (!mutex_trylock(&c->gc_gens_lock))
12361238 return 0;
12371239
12381240 trace_and_count(c, gc_gens_start, c);
12391241
1240− down_read(&c->state_lock);
1242+ /*
1243+ * We have to use trylock here. Otherwise, we would
1244+ * introduce a deadlock in the RO path - we take the
1245+ * state lock at the start of going RO.
1246+ */
1247+ if (!down_read_trylock(&c->state_lock)) {
1248+ mutex_unlock(&c->gc_gens_lock);
1249+ return 0;
1250+ }
12411251
12421252 for_each_member_device(c, ca) {
12431253 struct bucket_gens *gens = bucket_gens(ca);
fs/bcachefs/btree_io.c+4−3
@@ -1838,10 +1838,11 @@ static void btree_node_write_done(struct bch_fs *c, struct btree *b) · 1837 unmodified lines
18381838 struct btree_trans *trans = bch2_trans_get(c);
18391839
18401840 btree_node_lock_nopath_nofail(trans, &b->c, SIX_LOCK_read);
1841− __btree_node_write_done(c, b);
1842− six_unlock_read(&b->c.lock);
18431841
1842+ /* we don't need transaction context anymore after we got the lock. */
18441843 bch2_trans_put(trans);
1844+ __btree_node_write_done(c, b);
1845+ six_unlock_read(&b->c.lock);
18451846 }
18461847
18471848 static void btree_node_write_work(struct work_struct *work)
@@ -1870,7 +1871,7 @@ static void btree_node_write_work(struct work_struct *work) · 22 unmodified lines
18701871
18711872 }
18721873 } else {
1873− ret = bch2_trans_do(c, NULL, NULL, 0,
1874+ ret = bch2_trans_do(c,
18741875 bch2_btree_node_update_key_get_iter(trans, b, &wbio->key,
18751876 BCH_WATERMARK_interior_updates|
18761877 BCH_TRANS_COMMIT_journal_reclaim|
fs/bcachefs/btree_iter.c+3−3
@@ -2381,9 +2381,9 @@ struct bkey_s_c bch2_btree_iter_peek_upto(struct btree_iter *iter, struct bpos e · 2380 unmodified lines
23812381 else
23822382 iter_pos = bkey_max(iter->pos, bkey_start_pos(k.k));
23832383
2384− if (unlikely(!(iter->flags & BTREE_ITER_is_extents)
2385− ? bkey_gt(iter_pos, end)
2386− : bkey_ge(iter_pos, end)))
2384+ if (unlikely(iter->flags & BTREE_ITER_all_snapshots ? bpos_gt(iter_pos, end) :
2385+ iter->flags & BTREE_ITER_is_extents ? bkey_ge(iter_pos, end) :
2386+ bkey_gt(iter_pos, end)))
23872387 goto end;
23882388
23892389 break;
fs/bcachefs/btree_iter.h+10−0
@@ -857,6 +857,14 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *); · 856 unmodified lines
857857 for_each_btree_key_upto_norestart(_trans, _iter, _btree_id, _start,\
858858 SPOS_MAX, _flags, _k, _ret)
859859
860+#define for_each_btree_key_reverse_norestart(_trans, _iter, _btree_id, \
861+ _start, _flags, _k, _ret) \
862+ for (bch2_trans_iter_init((_trans), &(_iter), (_btree_id), \
863+ (_start), (_flags)); \
864+ (_k) = bch2_btree_iter_peek_prev_type(&(_iter), _flags), \
865+ !((_ret) = bkey_err(_k)) && (_k).k; \
866+ bch2_btree_iter_rewind(&(_iter)))
867+
860868 #define for_each_btree_key_continue_norestart(_iter, _flags, _k, _ret) \
861869 for_each_btree_key_upto_continue_norestart(_iter, SPOS_MAX, _flags, _k, _ret)
862870
@@ -904,6 +912,8 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *); · 41 unmodified lines
904912 _ret; \
905913 })
906914
915+#define bch2_trans_do(_c, _do) bch2_trans_run(_c, lockrestart_do(trans, _do))
916+
907917 struct btree_trans *__bch2_trans_get(struct bch_fs *, unsigned);
908918 void bch2_trans_put(struct btree_trans *);
909919
fs/bcachefs/btree_node_scan.c+3−0
@@ -171,6 +171,9 @@ static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca, · 170 unmodified lines
171171 if (BTREE_NODE_LEVEL(bn) >= BTREE_MAX_DEPTH)
172172 return;
173173
174+ if (BTREE_NODE_ID(bn) >= BTREE_ID_NR_MAX)
175+ return;
176+
174177 rcu_read_lock();
175178 struct found_btree_node n = {
176179 .btree_id = BTREE_NODE_ID(bn),
fs/bcachefs/btree_trans_commit.c+2−1
@@ -832,7 +832,8 @@ revert_fs_usage: · 831 unmodified lines
832832 for (struct jset_entry *entry2 = trans->journal_entries;
833833 entry2 != entry;
834834 entry2 = vstruct_next(entry2))
835− if (jset_entry_is_key(entry2) && entry2->start->k.type == KEY_TYPE_accounting) {
835+ if (entry2->type == BCH_JSET_ENTRY_write_buffer_keys &&
836+ entry2->start->k.type == KEY_TYPE_accounting) {
836837 struct bkey_s_accounting a = bkey_i_to_s_accounting(entry2->start);
837838
838839 bch2_accounting_neg(a);
fs/bcachefs/btree_update.c+2−2
@@ -668,7 +668,7 @@ int bch2_btree_insert(struct bch_fs *c, enum btree_id id, struct bkey_i *k, · 667 unmodified lines
668668 struct disk_reservation *disk_res, int flags,
669669 enum btree_iter_update_trigger_flags iter_flags)
670670 {
671− return bch2_trans_do(c, disk_res, NULL, flags,
671+ return bch2_trans_commit_do(c, disk_res, NULL, flags,
672672 bch2_btree_insert_trans(trans, id, k, iter_flags));
673673 }
674674
@@ -865,7 +865,7 @@ __bch2_fs_log_msg(struct bch_fs *c, unsigned commit_flags, const char *fmt, · 190 unmodified lines
865865 memcpy(l->d, buf.buf, buf.pos);
866866 c->journal.early_journal_entries.nr += jset_u64s(u64s);
867867 } else {
868− ret = bch2_trans_do(c, NULL, NULL,
868+ ret = bch2_trans_commit_do(c, NULL, NULL,
869869 BCH_TRANS_COMMIT_lazy_rw|commit_flags,
870870 __bch2_trans_log_msg(trans, &buf, u64s));
871871 }
fs/bcachefs/btree_update.h+1−1
@@ -192,7 +192,7 @@ static inline int bch2_trans_commit(struct btree_trans *trans, · 191 unmodified lines
192192 nested_lockrestart_do(_trans, _do ?: bch2_trans_commit(_trans, (_disk_res),\
193193 (_journal_seq), (_flags)))
194194
195−#define bch2_trans_do(_c, _disk_res, _journal_seq, _flags, _do) \
195+#define bch2_trans_commit_do(_c, _disk_res, _journal_seq, _flags, _do) \
196196 bch2_trans_run(_c, commit_do(trans, _disk_res, _journal_seq, _flags, _do))
197197
198198 #define trans_for_each_update(_trans, _i) \
fs/bcachefs/btree_update_interior.c+1−3
@@ -2239,10 +2239,8 @@ static void async_btree_node_rewrite_work(struct work_struct *work) · 2238 unmodified lines
22392239 struct async_btree_rewrite *a =
22402240 container_of(work, struct async_btree_rewrite, work);
22412241 struct bch_fs *c = a->c;
2242− int ret;
22432242
2244− ret = bch2_trans_do(c, NULL, NULL, 0,
2245− async_btree_node_rewrite_trans(trans, a));
2243+ int ret = bch2_trans_do(c, async_btree_node_rewrite_trans(trans, a));
22462244 bch_err_fn_ratelimited(c, ret);
22472245 bch2_write_ref_put(c, BCH_WRITE_REF_node_rewrite);
22482246 kfree(a);
fs/bcachefs/buckets.c+5−2
@@ -1160,11 +1160,11 @@ int bch2_trans_mark_dev_sbs(struct bch_fs *c) · 1159 unmodified lines
11601160 #define SECTORS_CACHE 1024
11611161
11621162 int __bch2_disk_reservation_add(struct bch_fs *c, struct disk_reservation *res,
1163− u64 sectors, int flags)
1163+ u64 sectors, enum bch_reservation_flags flags)
11641164 {
11651165 struct bch_fs_pcpu *pcpu;
11661166 u64 old, get;
1167− s64 sectors_available;
1167+ u64 sectors_available;
11681168 int ret;
11691169
11701170 percpu_down_read(&c->mark_lock);
@@ -1202,6 +1202,9 @@ recalculate: · 31 unmodified lines
12021202 percpu_u64_set(&c->pcpu->sectors_available, 0);
12031203 sectors_available = avail_factor(__bch2_fs_usage_read_short(c).free);
12041204
1205+ if (sectors_available && (flags & BCH_DISK_RESERVATION_PARTIAL))
1206+ sectors = min(sectors, sectors_available);
1207+
12051208 if (sectors <= sectors_available ||
12061209 (flags & BCH_DISK_RESERVATION_NOFAIL)) {
12071210 atomic64_set(&c->sectors_available,
fs/bcachefs/buckets.h+7−5
@@ -344,14 +344,16 @@ static inline void bch2_disk_reservation_put(struct bch_fs *c, · 343 unmodified lines
344344 }
345345 }
346346
347−#define BCH_DISK_RESERVATION_NOFAIL (1 << 0)
347+enum bch_reservation_flags {
348+ BCH_DISK_RESERVATION_NOFAIL = 1 << 0,
349+ BCH_DISK_RESERVATION_PARTIAL = 1 << 1,
350+};
348351
349−int __bch2_disk_reservation_add(struct bch_fs *,
350− struct disk_reservation *,
351− u64, int);
352+int __bch2_disk_reservation_add(struct bch_fs *, struct disk_reservation *,
353+ u64, enum bch_reservation_flags);
352354
353355 static inline int bch2_disk_reservation_add(struct bch_fs *c, struct disk_reservation *res,
354− u64 sectors, int flags)
356+ u64 sectors, enum bch_reservation_flags flags)
355357 {
356358 #ifdef __KERNEL__
357359 u64 old, new;
fs/bcachefs/chardev.c+1−0
@@ -225,6 +225,7 @@ static long bch2_ioctl_fsck_offline(struct bch_ioctl_fsck_offline __user *user_a · 224 unmodified lines
225225
226226 opt_set(thr->opts, stdio, (u64)(unsigned long)&thr->thr.stdio);
227227 opt_set(thr->opts, read_only, 1);
228+ opt_set(thr->opts, ratelimit_errors, 0);
228229
229230 /* We need request_key() to be called before we punt to kthread: */
230231 opt_set(thr->opts, nostart, true);
fs/bcachefs/darray.c+14−1
@@ -2,6 +2,7 @@ · 1 unmodified line
22
33 #include <linux/log2.h>
44 #include <linux/slab.h>
5+#include <linux/vmalloc.h>
56 #include "darray.h"
67
78 int __bch2_darray_resize_noprof(darray_char *d, size_t element_size, size_t new_size, gfp_t gfp)
@@ -9,7 +10,19 @@ int __bch2_darray_resize_noprof(darray_char *d, size_t element_size, size_t new_ · 1 unmodified line
910 if (new_size > d->size) {
1011 new_size = roundup_pow_of_two(new_size);
1112
12− void *data = kvmalloc_array_noprof(new_size, element_size, gfp);
13+ /*
14+ * This is a workaround: kvmalloc() doesn't support > INT_MAX
15+ * allocations, but vmalloc() does.
16+ * The limit needs to be lifted from kvmalloc, and when it does
17+ * we'll go back to just using that.
18+ */
19+ size_t bytes;
20+ if (unlikely(check_mul_overflow(new_size, element_size, &bytes)))
21+ return -ENOMEM;
22+
23+ void *data = likely(bytes < INT_MAX)
24+ ? kvmalloc_noprof(bytes, gfp)
25+ : vmalloc_noprof(bytes);
1326 if (!data)
1427 return -ENOMEM;
1528
fs/bcachefs/data_update.c+1−0
@@ -80,6 +80,7 @@ static bool bkey_nocow_lock(struct bch_fs *c, struct moving_context *ctxt, struc · 79 unmodified lines
8080 if (ptr2 == ptr)
8181 break;
8282
83+ ca = bch2_dev_have_ref(c, ptr2->dev);
8384 bucket = PTR_BUCKET_POS(ca, ptr2);
8485 bch2_bucket_nocow_unlock(&c->nocow_locks, bucket, 0);
8586 }
fs/bcachefs/dirent.c+0−7
@@ -250,13 +250,6 @@ int bch2_dirent_create(struct btree_trans *trans, subvol_inum dir, · 249 unmodified lines
250250 return ret;
251251 }
252252
253−static void dirent_copy_target(struct bkey_i_dirent *dst,
254− struct bkey_s_c_dirent src)
255−{
256− dst->v.d_inum = src.v->d_inum;
257− dst->v.d_type = src.v->d_type;
258−}
259−
260253 int bch2_dirent_read_target(struct btree_trans *trans, subvol_inum dir,
261254 struct bkey_s_c_dirent d, subvol_inum *target)
262255 {
fs/bcachefs/dirent.h+7−0
@@ -34,6 +34,13 @@ static inline unsigned dirent_val_u64s(unsigned len) · 33 unmodified lines
3434 int bch2_dirent_read_target(struct btree_trans *, subvol_inum,
3535 struct bkey_s_c_dirent, subvol_inum *);
3636
37+static inline void dirent_copy_target(struct bkey_i_dirent *dst,
38+ struct bkey_s_c_dirent src)
39+{
40+ dst->v.d_inum = src.v->d_inum;
41+ dst->v.d_type = src.v->d_type;
42+}
43+
3744 int bch2_dirent_create_snapshot(struct btree_trans *, u32, u64, u32,
3845 const struct bch_hash_info *, u8,
3946 const struct qstr *, u64, u64 *,
fs/bcachefs/disk_accounting.c+118−37
@@ -242,6 +242,14 @@ void bch2_accounting_swab(struct bkey_s k) · 241 unmodified lines
242242 *p = swab64(*p);
243243 }
244244
245+static inline void __accounting_to_replicas(struct bch_replicas_entry_v1 *r,
246+ struct disk_accounting_pos acc)
247+{
248+ unsafe_memcpy(r, &acc.replicas,
249+ replicas_entry_bytes(&acc.replicas),
250+ "variable length struct");
251+}
252+
245253 static inline bool accounting_to_replicas(struct bch_replicas_entry_v1 *r, struct bpos p)
246254 {
247255 struct disk_accounting_pos acc_k;
@@ -249,9 +257,7 @@ static inline bool accounting_to_replicas(struct bch_replicas_entry_v1 *r, struc · 1 unmodified line
249257
250258 switch (acc_k.type) {
251259 case BCH_DISK_ACCOUNTING_replicas:
252− unsafe_memcpy(r, &acc_k.replicas,
253− replicas_entry_bytes(&acc_k.replicas),
254− "variable length struct");
260+ __accounting_to_replicas(r, acc_k);
255261 return true;
256262 default:
257263 return false;
@@ -608,6 +614,81 @@ static int accounting_read_key(struct btree_trans *trans, struct bkey_s_c k) · 350 unmodified lines
608614 return ret;
609615 }
610616
617+static int bch2_disk_accounting_validate_late(struct btree_trans *trans,
618+ struct disk_accounting_pos acc,
619+ u64 *v, unsigned nr)
620+{
621+ struct bch_fs *c = trans->c;
622+ struct printbuf buf = PRINTBUF;
623+ int ret = 0, invalid_dev = -1;
624+
625+ switch (acc.type) {
626+ case BCH_DISK_ACCOUNTING_replicas: {
627+ struct bch_replicas_padded r;
628+ __accounting_to_replicas(&r.e, acc);
629+
630+ for (unsigned i = 0; i < r.e.nr_devs; i++)
631+ if (r.e.devs[i] != BCH_SB_MEMBER_INVALID &&
632+ !bch2_dev_exists(c, r.e.devs[i])) {
633+ invalid_dev = r.e.devs[i];
634+ goto invalid_device;
635+ }
636+
637+ /*
638+ * All replicas entry checks except for invalid device are done
639+ * in bch2_accounting_validate
640+ */
641+ BUG_ON(bch2_replicas_entry_validate(&r.e, c, &buf));
642+
643+ if (fsck_err_on(!bch2_replicas_marked_locked(c, &r.e),
644+ trans, accounting_replicas_not_marked,
645+ "accounting not marked in superblock replicas\n %s",
646+ (printbuf_reset(&buf),
647+ bch2_accounting_key_to_text(&buf, &acc),
648+ buf.buf))) {
649+ /*
650+ * We're not RW yet and still single threaded, dropping
651+ * and retaking lock is ok:
652+ */
653+ percpu_up_write(&c->mark_lock);
654+ ret = bch2_mark_replicas(c, &r.e);
655+ if (ret)
656+ goto fsck_err;
657+ percpu_down_write(&c->mark_lock);
658+ }
659+ break;
660+ }
661+
662+ case BCH_DISK_ACCOUNTING_dev_data_type:
663+ if (!bch2_dev_exists(c, acc.dev_data_type.dev)) {
664+ invalid_dev = acc.dev_data_type.dev;
665+ goto invalid_device;
666+ }
667+ break;
668+ }
669+
670+fsck_err:
671+ printbuf_exit(&buf);
672+ return ret;
673+invalid_device:
674+ if (fsck_err(trans, accounting_to_invalid_device,
675+ "accounting entry points to invalid device %i\n %s",
676+ invalid_dev,
677+ (printbuf_reset(&buf),
678+ bch2_accounting_key_to_text(&buf, &acc),
679+ buf.buf))) {
680+ for (unsigned i = 0; i < nr; i++)
681+ v[i] = -v[i];
682+
683+ ret = commit_do(trans, NULL, NULL, 0,
684+ bch2_disk_accounting_mod(trans, &acc, v, nr, false)) ?:
685+ -BCH_ERR_remove_disk_accounting_entry;
686+ } else {
687+ ret = -BCH_ERR_remove_disk_accounting_entry;
688+ }
689+ goto fsck_err;
690+}
691+
611692 /*
612693 * At startup time, initialize the in memory accounting from the btree (and
613694 * journal)
@@ -666,44 +747,42 @@ int bch2_accounting_read(struct bch_fs *c) · 52 unmodified lines
666747 }
667748 keys->gap = keys->nr = dst - keys->data;
668749
669− percpu_down_read(&c->mark_lock);
670− for (unsigned i = 0; i < acc->k.nr; i++) {
671− u64 v[BCH_ACCOUNTING_MAX_COUNTERS];
672− bch2_accounting_mem_read_counters(acc, i, v, ARRAY_SIZE(v), false);
750+ percpu_down_write(&c->mark_lock);
751+ unsigned i = 0;
752+ while (i < acc->k.nr) {
753+ unsigned idx = inorder_to_eytzinger0(i, acc->k.nr);
673754
674− if (bch2_is_zero(v, sizeof(v[0]) * acc->k.data[i].nr_counters))
675− continue;
755+ struct disk_accounting_pos acc_k;
756+ bpos_to_disk_accounting_pos(&acc_k, acc->k.data[idx].pos);
676757
677− struct bch_replicas_padded r;
678− if (!accounting_to_replicas(&r.e, acc->k.data[i].pos))
679− continue;
758+ u64 v[BCH_ACCOUNTING_MAX_COUNTERS];
759+ bch2_accounting_mem_read_counters(acc, idx, v, ARRAY_SIZE(v), false);
680760
681761 /*
682− * If the replicas entry is invalid it'll get cleaned up by
683− * check_allocations:
762+ * If the entry counters are zeroed, it should be treated as
763+ * nonexistent - it might point to an invalid device.
764+ *
765+ * Remove it, so that if it's re-added it gets re-marked in the
766+ * superblock:
684767 */
685− if (bch2_replicas_entry_validate(&r.e, c, &buf))
768+ ret = bch2_is_zero(v, sizeof(v[0]) * acc->k.data[idx].nr_counters)
769+ ? -BCH_ERR_remove_disk_accounting_entry
770+ : bch2_disk_accounting_validate_late(trans, acc_k,
771+ v, acc->k.data[idx].nr_counters);
772+
773+ if (ret == -BCH_ERR_remove_disk_accounting_entry) {
774+ free_percpu(acc->k.data[idx].v[0]);
775+ free_percpu(acc->k.data[idx].v[1]);
776+ darray_remove_item(&acc->k, &acc->k.data[idx]);
777+ eytzinger0_sort(acc->k.data, acc->k.nr, sizeof(acc->k.data[0]),
778+ accounting_pos_cmp, NULL);
779+ ret = 0;
686780 continue;
687−
688− struct disk_accounting_pos k;
689− bpos_to_disk_accounting_pos(&k, acc->k.data[i].pos);
690−
691− if (fsck_err_on(!bch2_replicas_marked_locked(c, &r.e),
692− trans, accounting_replicas_not_marked,
693− "accounting not marked in superblock replicas\n %s",
694− (printbuf_reset(&buf),
695− bch2_accounting_key_to_text(&buf, &k),
696− buf.buf))) {
697− /*
698− * We're not RW yet and still single threaded, dropping
699− * and retaking lock is ok:
700− */
701− percpu_up_read(&c->mark_lock);
702− ret = bch2_mark_replicas(c, &r.e);
703− if (ret)
704− goto fsck_err;
705− percpu_down_read(&c->mark_lock);
706781 }
782+
783+ if (ret)
784+ goto fsck_err;
785+ i++;
707786 }
708787
709788 preempt_disable();
@@ -742,7 +821,7 @@ int bch2_accounting_read(struct bch_fs *c) · 32 unmodified lines
742821 }
743822 preempt_enable();
744823 fsck_err:
745− percpu_up_read(&c->mark_lock);
824+ percpu_up_write(&c->mark_lock);
746825 err:
747826 printbuf_exit(&buf);
748827 bch2_trans_put(trans);
@@ -777,8 +856,10 @@ int bch2_dev_usage_init(struct bch_dev *ca, bool gc) · 28 unmodified lines
777856 };
778857 u64 v[3] = { ca->mi.nbuckets - ca->mi.first_bucket, 0, 0 };
779858
780− int ret = bch2_trans_do(c, NULL, NULL, 0,
781− bch2_disk_accounting_mod(trans, &acc, v, ARRAY_SIZE(v), gc));
859+ int ret = bch2_trans_do(c, ({
860+ bch2_disk_accounting_mod(trans, &acc, v, ARRAY_SIZE(v), gc) ?:
861+ (!gc ? bch2_trans_commit(trans, NULL, NULL, 0) : 0);
862+ }));
782863 bch_err_fn(c, ret);
783864 return ret;
784865 }
fs/bcachefs/ec.c+71−37
@@ -124,6 +124,11 @@ int bch2_stripe_validate(struct bch_fs *c, struct bkey_s_c k, · 123 unmodified lines
124124 "incorrect value size (%zu < %u)",
125125 bkey_val_u64s(k.k), stripe_val_u64s(s));
126126
127+ bkey_fsck_err_on(s->csum_granularity_bits >= 64,
128+ c, stripe_csum_granularity_bad,
129+ "invalid csum granularity (%u >= 64)",
130+ s->csum_granularity_bits);
131+
127132 ret = bch2_bkey_ptrs_validate(c, k, flags);
128133 fsck_err:
129134 return ret;
@@ -145,7 +150,11 @@ void bch2_stripe_to_text(struct printbuf *out, struct bch_fs *c, · 15 unmodified lines
145150 nr_data,
146151 s.nr_redundant);
147152 bch2_prt_csum_type(out, s.csum_type);
148− prt_printf(out, " gran %u", 1U << s.csum_granularity_bits);
153+ prt_str(out, " gran ");
154+ if (s.csum_granularity_bits < 64)
155+ prt_printf(out, "%llu", 1ULL << s.csum_granularity_bits);
156+ else
157+ prt_printf(out, "(invalid shift %u)", s.csum_granularity_bits);
149158
150159 if (s.disk_label) {
151160 prt_str(out, " label");
@@ -257,12 +266,12 @@ static int __mark_stripe_bucket(struct btree_trans *trans, · 105 unmodified lines
257266 if (!deleting) {
258267 a->stripe = s.k->p.offset;
259268 a->stripe_redundancy = s.v->nr_redundant;
269+ alloc_data_type_set(a, data_type);
260270 } else {
261271 a->stripe = 0;
262272 a->stripe_redundancy = 0;
273+ alloc_data_type_set(a, BCH_DATA_user);
263274 }
264−
265− alloc_data_type_set(a, data_type);
266275 err:
267276 printbuf_exit(&buf);
268277 return ret;
@@ -1177,7 +1186,7 @@ static void ec_stripe_delete_work(struct work_struct *work) · 908 unmodified lines
11771186 if (!idx)
11781187 break;
11791188
1180− int ret = bch2_trans_do(c, NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
1189+ int ret = bch2_trans_commit_do(c, NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
11811190 ec_stripe_delete(trans, idx));
11821191 bch_err_fn(c, ret);
11831192 if (ret)
@@ -1197,47 +1206,62 @@ void bch2_do_stripe_deletes(struct bch_fs *c) · 13 unmodified lines
11971206 /* stripe creation: */
11981207
11991208 static int ec_stripe_key_update(struct btree_trans *trans,
1200− struct bkey_i_stripe *new,
1201− bool create)
1209+ struct bkey_i_stripe *old,
1210+ struct bkey_i_stripe *new)
12021211 {
12031212 struct bch_fs *c = trans->c;
1204− struct btree_iter iter;
1205− struct bkey_s_c k;
1206− int ret;
1213+ bool create = !old;
12071214
1208− k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_stripes,
1209− new->k.p, BTREE_ITER_intent);
1210− ret = bkey_err(k);
1215+ struct btree_iter iter;
1216+ struct bkey_s_c k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_stripes,
1217+ new->k.p, BTREE_ITER_intent);
1218+ int ret = bkey_err(k);
12111219 if (ret)
12121220 goto err;
12131221
1214− if (k.k->type != (create ? KEY_TYPE_deleted : KEY_TYPE_stripe)) {
1215− bch2_fs_inconsistent(c, "error %s stripe: got existing key type %s",
1216− create ? "creating" : "updating",
1217− bch2_bkey_types[k.k->type]);
1222+ if (bch2_fs_inconsistent_on(k.k->type != (create ? KEY_TYPE_deleted : KEY_TYPE_stripe),
1223+ c, "error %s stripe: got existing key type %s",
1224+ create ? "creating" : "updating",
1225+ bch2_bkey_types[k.k->type])) {
12181226 ret = -EINVAL;
12191227 goto err;
12201228 }
12211229
12221230 if (k.k->type == KEY_TYPE_stripe) {
1223− const struct bch_stripe *old = bkey_s_c_to_stripe(k).v;
1224− unsigned i;
1231+ const struct bch_stripe *v = bkey_s_c_to_stripe(k).v;
12251232
1226− if (old->nr_blocks != new->v.nr_blocks) {
1227− bch_err(c, "error updating stripe: nr_blocks does not match");
1228− ret = -EINVAL;
1229− goto err;
1230− }
1233+ BUG_ON(old->v.nr_blocks != new->v.nr_blocks);
1234+ BUG_ON(old->v.nr_blocks != v->nr_blocks);
12311235
1232− for (i = 0; i < new->v.nr_blocks; i++) {
1233− unsigned v = stripe_blockcount_get(old, i);
1236+ for (unsigned i = 0; i < new->v.nr_blocks; i++) {
1237+ unsigned sectors = stripe_blockcount_get(v, i);
12341238
1235− BUG_ON(v &&
1236− (old->ptrs[i].dev != new->v.ptrs[i].dev ||
1237− old->ptrs[i].gen != new->v.ptrs[i].gen ||
1238− old->ptrs[i].offset != new->v.ptrs[i].offset));
1239+ if (!bch2_extent_ptr_eq(old->v.ptrs[i], new->v.ptrs[i]) && sectors) {
1240+ struct printbuf buf = PRINTBUF;
12391241
1240− stripe_blockcount_set(&new->v, i, v);
1242+ prt_printf(&buf, "stripe changed nonempty block %u", i);
1243+ prt_str(&buf, "\nold: ");
1244+ bch2_bkey_val_to_text(&buf, c, k);
1245+ prt_str(&buf, "\nnew: ");
1246+ bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(&new->k_i));
1247+ bch2_fs_inconsistent(c, "%s", buf.buf);
1248+ printbuf_exit(&buf);
1249+ ret = -EINVAL;
1250+ goto err;
1251+ }
1252+
1253+ /*
1254+ * If the stripe ptr changed underneath us, it must have
1255+ * been dev_remove_stripes() -> * invalidate_stripe_to_dev()
1256+ */
1257+ if (!bch2_extent_ptr_eq(old->v.ptrs[i], v->ptrs[i])) {
1258+ BUG_ON(v->ptrs[i].dev != BCH_SB_MEMBER_INVALID);
1259+
1260+ if (bch2_extent_ptr_eq(old->v.ptrs[i], new->v.ptrs[i]))
1261+ new->v.ptrs[i].dev = BCH_SB_MEMBER_INVALID;
1262+ }
1263+
1264+ stripe_blockcount_set(&new->v, i, sectors);
12411265 }
12421266 }
12431267
@@ -1495,12 +1519,14 @@ static void ec_stripe_create(struct ec_stripe_new *s) · 251 unmodified lines
14951519 goto err;
14961520 }
14971521
1498− ret = bch2_trans_do(c, &s->res, NULL,
1499− BCH_TRANS_COMMIT_no_check_rw|
1500− BCH_TRANS_COMMIT_no_enospc,
1501− ec_stripe_key_update(trans,
1502− bkey_i_to_stripe(&s->new_stripe.key),
1503− !s->have_existing_stripe));
1522+ ret = bch2_trans_commit_do(c, &s->res, NULL,
1523+ BCH_TRANS_COMMIT_no_check_rw|
1524+ BCH_TRANS_COMMIT_no_enospc,
1525+ ec_stripe_key_update(trans,
1526+ s->have_existing_stripe
1527+ ? bkey_i_to_stripe(&s->existing_stripe.key)
1528+ : NULL,
1529+ bkey_i_to_stripe(&s->new_stripe.key)));
15041530 bch_err_msg(c, ret, "creating stripe key");
15051531 if (ret) {
15061532 goto err;
@@ -1876,7 +1902,15 @@ static int new_stripe_alloc_buckets(struct btree_trans *trans, struct ec_stripe_ · 369 unmodified lines
18761902 bitmap_and(devs.d, devs.d, c->rw_devs[BCH_DATA_user].d, BCH_SB_MEMBERS_MAX);
18771903
18781904 for_each_set_bit(i, h->s->blocks_gotten, v->nr_blocks) {
1879− __clear_bit(v->ptrs[i].dev, devs.d);
1905+ /*
1906+ * Note: we don't yet repair invalid blocks (failed/removed
1907+ * devices) when reusing stripes - we still need a codepath to
1908+ * walk backpointers and update all extents that point to that
1909+ * block when updating the stripe
1910+ */
1911+ if (v->ptrs[i].dev != BCH_SB_MEMBER_INVALID)
1912+ __clear_bit(v->ptrs[i].dev, devs.d);
1913+
18801914 if (i < h->s->nr_data)
18811915 nr_have_data++;
18821916 else
fs/bcachefs/errcode.h+2−1
@@ -268,7 +268,8 @@ · 267 unmodified lines
268268 x(BCH_ERR_nopromote, nopromote_no_writes) \
269269 x(BCH_ERR_nopromote, nopromote_enomem) \
270270 x(0, invalid_snapshot_node) \
271− x(0, option_needs_open_fs)
271+ x(0, option_needs_open_fs) \
272+ x(0, remove_disk_accounting_entry)
272273
273274 enum bch_errcode {
274275 BCH_ERR_START = 2048,
fs/bcachefs/error.c+22−6
@@ -251,7 +251,10 @@ int __bch2_fsck_err(struct bch_fs *c, · 250 unmodified lines
251251 * delete the key)
252252 * - and we don't need to warn if we're not prompting
253253 */
254− WARN_ON(!(flags & FSCK_AUTOFIX) && !trans && bch2_current_has_btree_trans(c));
254+ WARN_ON((flags & FSCK_CAN_FIX) &&
255+ !(flags & FSCK_AUTOFIX) &&
256+ !trans &&
257+ bch2_current_has_btree_trans(c));
255258
256259 if ((flags & FSCK_CAN_FIX) &&
257260 test_bit(err, c->sb.errors_silent))
@@ -393,6 +396,14 @@ int __bch2_fsck_err(struct bch_fs *c, · 135 unmodified lines
393396 !(flags & FSCK_CAN_IGNORE)))
394397 ret = -BCH_ERR_fsck_errors_not_fixed;
395398
399+ bool exiting =
400+ test_bit(BCH_FS_fsck_running, &c->flags) &&
401+ (ret != -BCH_ERR_fsck_fix &&
402+ ret != -BCH_ERR_fsck_ignore);
403+
404+ if (exiting)
405+ print = true;
406+
396407 if (print) {
397408 if (bch2_fs_stdio_redirect(c))
398409 bch2_print(c, "%s\n", out->buf);
@@ -400,9 +411,7 @@ int __bch2_fsck_err(struct bch_fs *c, · 1 unmodified line
400411 bch2_print_string_as_lines(KERN_ERR, out->buf);
401412 }
402413
403− if (test_bit(BCH_FS_fsck_running, &c->flags) &&
404− (ret != -BCH_ERR_fsck_fix &&
405− ret != -BCH_ERR_fsck_ignore))
414+ if (exiting)
406415 bch_err(c, "Unable to continue, halting");
407416 else if (suppressing)
408417 bch_err(c, "Ratelimiting new instances of previous error");
@@ -430,10 +439,17 @@ err: · 21 unmodified lines
430439
431440 int __bch2_bkey_fsck_err(struct bch_fs *c,
432441 struct bkey_s_c k,
433− enum bch_fsck_flags flags,
442+ enum bch_validate_flags validate_flags,
434443 enum bch_sb_error_id err,
435444 const char *fmt, ...)
436445 {
446+ if (validate_flags & BCH_VALIDATE_silent)
447+ return -BCH_ERR_fsck_delete_bkey;
448+
449+ unsigned fsck_flags = 0;
450+ if (!(validate_flags & (BCH_VALIDATE_write|BCH_VALIDATE_commit)))
451+ fsck_flags |= FSCK_AUTOFIX|FSCK_CAN_FIX;
452+
437453 struct printbuf buf = PRINTBUF;
438454 va_list args;
439455
@@ -445,7 +461,7 @@ int __bch2_bkey_fsck_err(struct bch_fs *c, · 5 unmodified lines
445461 va_end(args);
446462 prt_str(&buf, ": delete?");
447463
448− int ret = __bch2_fsck_err(c, NULL, flags, err, "%s", buf.buf);
464+ int ret = __bch2_fsck_err(c, NULL, fsck_flags, err, "%s", buf.buf);
449465 printbuf_exit(&buf);
450466 return ret;
451467 }
fs/bcachefs/error.h+3−6
@@ -167,10 +167,11 @@ void bch2_flush_fsck_errs(struct bch_fs *); · 166 unmodified lines
167167 #define fsck_err_on(cond, c, _err_type, ...) \
168168 __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
169169
170+enum bch_validate_flags;
170171 __printf(5, 6)
171172 int __bch2_bkey_fsck_err(struct bch_fs *,
172173 struct bkey_s_c,
173− enum bch_fsck_flags,
174+ enum bch_validate_flags,
174175 enum bch_sb_error_id,
175176 const char *, ...);
176177
@@ -180,11 +181,7 @@ int __bch2_bkey_fsck_err(struct bch_fs *, · 3 unmodified lines
180181 */
181182 #define bkey_fsck_err(c, _err_type, _err_msg, ...) \
182183 do { \
183− if ((flags & BCH_VALIDATE_silent)) { \
184− ret = -BCH_ERR_fsck_delete_bkey; \
185− goto fsck_err; \
186− } \
187− int _ret = __bch2_bkey_fsck_err(c, k, FSCK_CAN_FIX|FSCK_AUTOFIX,\
184+ int _ret = __bch2_bkey_fsck_err(c, k, flags, \
188185 BCH_FSCK_ERR_##_err_type, \
189186 _err_msg, ##__VA_ARGS__); \
190187 if (_ret != -BCH_ERR_fsck_fix && \
fs/bcachefs/extents.h+10−0
@@ -695,6 +695,16 @@ void bch2_bkey_ptrs_to_text(struct printbuf *, struct bch_fs *, · 694 unmodified lines
695695 int bch2_bkey_ptrs_validate(struct bch_fs *, struct bkey_s_c,
696696 enum bch_validate_flags);
697697
698+static inline bool bch2_extent_ptr_eq(struct bch_extent_ptr ptr1,
699+ struct bch_extent_ptr ptr2)
700+{
701+ return (ptr1.cached == ptr2.cached &&
702+ ptr1.unwritten == ptr2.unwritten &&
703+ ptr1.offset == ptr2.offset &&
704+ ptr1.dev == ptr2.dev &&
705+ ptr1.dev == ptr2.dev);
706+}
707+
698708 void bch2_ptr_swab(struct bkey_s);
699709
700710 const struct bch_extent_rebalance *bch2_bkey_rebalance_opts(struct bkey_s_c);
fs/bcachefs/fs-io-buffered.c+6−0
@@ -856,6 +856,12 @@ static int __bch2_buffered_write(struct bch_inode_info *inode, · 855 unmodified lines
856856 folios_trunc(&fs, fi);
857857 end = min(end, folio_end_pos(darray_last(fs)));
858858 } else {
859+ if (!folio_test_uptodate(f)) {
860+ ret = bch2_read_single_folio(f, mapping);
861+ if (ret)
862+ goto out;
863+ }
864+
859865 folios_trunc(&fs, fi + 1);
860866 end = f_pos + f_reserved;
861867 }
fs/bcachefs/fs-io-direct.c+2−1
@@ -369,6 +369,7 @@ static noinline void bch2_dio_write_flush(struct dio_write *dio) · 368 unmodified lines
369369
370370 static __always_inline long bch2_dio_write_done(struct dio_write *dio)
371371 {
372+ struct bch_fs *c = dio->op.c;
372373 struct kiocb *req = dio->req;
373374 struct bch_inode_info *inode = dio->inode;
374375 bool sync = dio->sync;
@@ -387,7 +388,7 @@ static __always_inline long bch2_dio_write_done(struct dio_write *dio) · 12 unmodified lines
387388 ret = dio->op.error ?: ((long) dio->written << 9);
388389 bio_put(&dio->op.wbio.bio);
389390
390− bch2_write_ref_put(dio->op.c, BCH_WRITE_REF_dio_write);
391+ bch2_write_ref_put(c, BCH_WRITE_REF_dio_write);
391392
392393 /* inode->i_dio_count is our ref on inode and thus bch_fs */
393394 inode_dio_end(&inode->v);
fs/bcachefs/fs-io-pagecache.c+45−25
@@ -399,14 +399,17 @@ void bch2_folio_reservation_put(struct bch_fs *c, · 398 unmodified lines
399399 bch2_quota_reservation_put(c, inode, &res->quota);
400400 }
401401
402−int bch2_folio_reservation_get(struct bch_fs *c,
402+static int __bch2_folio_reservation_get(struct bch_fs *c,
403403 struct bch_inode_info *inode,
404404 struct folio *folio,
405405 struct bch2_folio_reservation *res,
406− size_t offset, size_t len)
406+ size_t offset, size_t len,
407+ bool partial)
407408 {
408409 struct bch_folio *s = bch2_folio_create(folio, 0);
409410 unsigned i, disk_sectors = 0, quota_sectors = 0;
411+ struct disk_reservation disk_res = {};
412+ size_t reserved = len;
410413 int ret;
411414
412415 if (!s)
@@ -422,48 +425,65 @@ int bch2_folio_reservation_get(struct bch_fs *c, · 9 unmodified lines
422425 }
423426
424427 if (disk_sectors) {
425− ret = bch2_disk_reservation_add(c, &res->disk, disk_sectors, 0);
428+ ret = bch2_disk_reservation_add(c, &disk_res, disk_sectors,
429+ partial ? BCH_DISK_RESERVATION_PARTIAL : 0);
426430 if (unlikely(ret))
427431 return ret;
432+
433+ if (unlikely(disk_res.sectors != disk_sectors)) {
434+ disk_sectors = quota_sectors = 0;
435+
436+ for (i = round_down(offset, block_bytes(c)) >> 9;
437+ i < round_up(offset + len, block_bytes(c)) >> 9;
438+ i++) {
439+ disk_sectors += sectors_to_reserve(&s->s[i], res->disk.nr_replicas);
440+ if (disk_sectors > disk_res.sectors) {
441+ /*
442+ * Make sure to get a reservation that's
443+ * aligned to the filesystem blocksize:
444+ */
445+ unsigned reserved_offset = round_down(i << 9, block_bytes(c));
446+ reserved = clamp(reserved_offset, offset, offset + len) - offset;
447+
448+ if (!reserved) {
449+ bch2_disk_reservation_put(c, &disk_res);
450+ return -BCH_ERR_ENOSPC_disk_reservation;
451+ }
452+ break;
453+ }
454+ quota_sectors += s->s[i].state == SECTOR_unallocated;
455+ }
456+ }
428457 }
429458
430459 if (quota_sectors) {
431460 ret = bch2_quota_reservation_add(c, inode, &res->quota, quota_sectors, true);
432461 if (unlikely(ret)) {
433− struct disk_reservation tmp = { .sectors = disk_sectors };
434−
435− bch2_disk_reservation_put(c, &tmp);
436− res->disk.sectors -= disk_sectors;
462+ bch2_disk_reservation_put(c, &disk_res);
437463 return ret;
438464 }
439465 }
440466
441− return 0;
467+ res->disk.sectors += disk_res.sectors;
468+ return partial ? reserved : 0;
442469 }
443470
444−ssize_t bch2_folio_reservation_get_partial(struct bch_fs *c,
471+int bch2_folio_reservation_get(struct bch_fs *c,
445472 struct bch_inode_info *inode,
446473 struct folio *folio,
447474 struct bch2_folio_reservation *res,
448475 size_t offset, size_t len)
449476 {
450− size_t l, reserved = 0;
451− int ret;
452−
453− while ((l = len - reserved)) {
454− while ((ret = bch2_folio_reservation_get(c, inode, folio, res, offset, l))) {
455− if ((offset & (block_bytes(c) - 1)) + l <= block_bytes(c))
456− return reserved ?: ret;
457−
458− len = reserved + l;
459− l /= 2;
460− }
461−
462− offset += l;
463− reserved += l;
464− }
477+ return __bch2_folio_reservation_get(c, inode, folio, res, offset, len, false);
478+}
465479
466− return reserved;
480+ssize_t bch2_folio_reservation_get_partial(struct bch_fs *c,
481+ struct bch_inode_info *inode,
482+ struct folio *folio,
483+ struct bch2_folio_reservation *res,
484+ size_t offset, size_t len)
485+{
486+ return __bch2_folio_reservation_get(c, inode, folio, res, offset, len, true);
467487 }
468488
469489 static void bch2_clear_folio_bits(struct folio *folio)
fs/bcachefs/fs-io.c+1−1
@@ -182,7 +182,7 @@ static int bch2_flush_inode(struct bch_fs *c, · 181 unmodified lines
182182
183183 struct bch_inode_unpacked u;
184184 int ret = bch2_inode_find_by_inum(c, inode_inum(inode), &u) ?:
185− bch2_journal_flush_seq(&c->journal, u.bi_journal_seq) ?:
185+ bch2_journal_flush_seq(&c->journal, u.bi_journal_seq, TASK_INTERRUPTIBLE) ?:
186186 bch2_inode_flush_nocow_writes(c, inode);
187187 bch2_write_ref_put(c, BCH_WRITE_REF_fsync);
188188 return ret;
fs/bcachefs/fs.c+130−31
@@ -157,6 +157,20 @@ static bool subvol_inum_eq(subvol_inum a, subvol_inum b) · 156 unmodified lines
157157 return a.subvol == b.subvol && a.inum == b.inum;
158158 }
159159
160+static u32 bch2_vfs_inode_hash_fn(const void *data, u32 len, u32 seed)
161+{
162+ const subvol_inum *inum = data;
163+
164+ return jhash(&inum->inum, sizeof(inum->inum), seed);
165+}
166+
167+static u32 bch2_vfs_inode_obj_hash_fn(const void *data, u32 len, u32 seed)
168+{
169+ const struct bch_inode_info *inode = data;
170+
171+ return bch2_vfs_inode_hash_fn(&inode->ei_inum, sizeof(inode->ei_inum), seed);
172+}
173+
160174 static int bch2_vfs_inode_cmp_fn(struct rhashtable_compare_arg *arg,
161175 const void *obj)
162176 {
@@ -170,26 +184,111 @@ static const struct rhashtable_params bch2_vfs_inodes_params = { · 7 unmodified lines
170184 .head_offset = offsetof(struct bch_inode_info, hash),
171185 .key_offset = offsetof(struct bch_inode_info, ei_inum),
172186 .key_len = sizeof(subvol_inum),
187+ .hashfn = bch2_vfs_inode_hash_fn,
188+ .obj_hashfn = bch2_vfs_inode_obj_hash_fn,
173189 .obj_cmpfn = bch2_vfs_inode_cmp_fn,
174190 .automatic_shrinking = true,
175191 };
176192
177−static void __wait_on_freeing_inode(struct inode *inode)
193+int bch2_inode_or_descendents_is_open(struct btree_trans *trans, struct bpos p)
178194 {
179− wait_queue_head_t *wq;
180− DEFINE_WAIT_BIT(wait, &inode->i_state, __I_NEW);
181− wq = bit_waitqueue(&inode->i_state, __I_NEW);
182− prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
183− spin_unlock(&inode->i_lock);
184− schedule();
185− finish_wait(wq, &wait.wq_entry);
195+ struct bch_fs *c = trans->c;
196+ struct rhashtable *ht = &c->vfs_inodes_table;
197+ subvol_inum inum = (subvol_inum) { .inum = p.offset };
198+ DARRAY(u32) subvols;
199+ int ret = 0;
200+
201+ if (!test_bit(BCH_FS_started, &c->flags))
202+ return false;
203+
204+ darray_init(&subvols);
205+restart_from_top:
206+
207+ /*
208+ * Tweaked version of __rhashtable_lookup(); we need to get a list of
209+ * subvolumes in which the given inode number is open.
210+ *
211+ * For this to work, we don't include the subvolume ID in the key that
212+ * we hash - all inodes with the same inode number regardless of
213+ * subvolume will hash to the same slot.
214+ *
215+ * This will be less than ideal if the same file is ever open
216+ * simultaneously in many different snapshots:
217+ */
218+ rcu_read_lock();
219+ struct rhash_lock_head __rcu *const *bkt;
220+ struct rhash_head *he;
221+ unsigned int hash;
222+ struct bucket_table *tbl = rht_dereference_rcu(ht->tbl, ht);
223+restart:
224+ hash = rht_key_hashfn(ht, tbl, &inum, bch2_vfs_inodes_params);
225+ bkt = rht_bucket(tbl, hash);
226+ do {
227+ struct bch_inode_info *inode;
228+
229+ rht_for_each_entry_rcu_from(inode, he, rht_ptr_rcu(bkt), tbl, hash, hash) {
230+ if (inode->ei_inum.inum == inum.inum) {
231+ ret = darray_push_gfp(&subvols, inode->ei_inum.subvol,
232+ GFP_NOWAIT|__GFP_NOWARN);
233+ if (ret) {
234+ rcu_read_unlock();
235+ ret = darray_make_room(&subvols, 1);
236+ if (ret)
237+ goto err;
238+ subvols.nr = 0;
239+ goto restart_from_top;
240+ }
241+ }
242+ }
243+ /* An object might have been moved to a different hash chain,
244+ * while we walk along it - better check and retry.
245+ */
246+ } while (he != RHT_NULLS_MARKER(bkt));
247+
248+ /* Ensure we see any new tables. */
249+ smp_rmb();
250+
251+ tbl = rht_dereference_rcu(tbl->future_tbl, ht);
252+ if (unlikely(tbl))
253+ goto restart;
254+ rcu_read_unlock();
255+
256+ darray_for_each(subvols, i) {
257+ u32 snap;
258+ ret = bch2_subvolume_get_snapshot(trans, *i, &snap);
259+ if (ret)
260+ goto err;
261+
262+ ret = bch2_snapshot_is_ancestor(c, snap, p.snapshot);
263+ if (ret)
264+ break;
265+ }
266+err:
267+ darray_exit(&subvols);
268+ return ret;
186269 }
187270
188−struct bch_inode_info *__bch2_inode_hash_find(struct bch_fs *c, subvol_inum inum)
271+static struct bch_inode_info *__bch2_inode_hash_find(struct bch_fs *c, subvol_inum inum)
189272 {
190273 return rhashtable_lookup_fast(&c->vfs_inodes_table, &inum, bch2_vfs_inodes_params);
191274 }
192275
276+static void __wait_on_freeing_inode(struct bch_fs *c,
277+ struct bch_inode_info *inode,
278+ subvol_inum inum)
279+{
280+ wait_queue_head_t *wq;
281+ struct wait_bit_queue_entry wait;
282+
283+ wq = inode_bit_waitqueue(&wait, &inode->v, __I_NEW);
284+ prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
285+ spin_unlock(&inode->v.i_lock);
286+
287+ if (__bch2_inode_hash_find(c, inum) == inode)
288+ schedule_timeout(HZ * 10);
289+ finish_wait(wq, &wait.wq_entry);
290+}
291+
193292 static struct bch_inode_info *bch2_inode_hash_find(struct bch_fs *c, struct btree_trans *trans,
194293 subvol_inum inum)
195294 {
@@ -204,10 +303,10 @@ repeat: · 8 unmodified lines
204303 }
205304 if ((inode->v.i_state & (I_FREEING|I_WILL_FREE))) {
206305 if (!trans) {
207− __wait_on_freeing_inode(&inode->v);
306+ __wait_on_freeing_inode(c, inode, inum);
208307 } else {
209308 bch2_trans_unlock(trans);
210− __wait_on_freeing_inode(&inode->v);
309+ __wait_on_freeing_inode(c, inode, inum);
211310 int ret = bch2_trans_relock(trans);
212311 if (ret)
213312 return ERR_PTR(ret);
@@ -232,6 +331,11 @@ static void bch2_inode_hash_remove(struct bch_fs *c, struct bch_inode_info *inod · 18 unmodified lines
232331 &inode->hash, bch2_vfs_inodes_params);
233332 BUG_ON(ret);
234333 inode->v.i_hash.pprev = NULL;
334+ /*
335+ * This pairs with the bch2_inode_hash_find() ->
336+ * __wait_on_freeing_inode() path
337+ */
338+ inode_wake_up_bit(&inode->v, __I_NEW);
235339 }
236340 }
237341
@@ -243,7 +347,8 @@ static struct bch_inode_info *bch2_inode_hash_insert(struct bch_fs *c, · 5 unmodified lines
243347
244348 set_bit(EI_INODE_HASHED, &inode->ei_flags);
245349 retry:
246− if (unlikely(rhashtable_lookup_insert_fast(&c->vfs_inodes_table,
350+ if (unlikely(rhashtable_lookup_insert_key(&c->vfs_inodes_table,
351+ &inode->ei_inum,
247352 &inode->hash,
248353 bch2_vfs_inodes_params))) {
249354 old = bch2_inode_hash_find(c, trans, inode->ei_inum);
@@ -291,10 +396,10 @@ static struct inode *bch2_alloc_inode(struct super_block *sb) · 41 unmodified lines
291396 BUG();
292397 }
293398
294−static struct bch_inode_info *__bch2_new_inode(struct bch_fs *c)
399+static struct bch_inode_info *__bch2_new_inode(struct bch_fs *c, gfp_t gfp)
295400 {
296401 struct bch_inode_info *inode = alloc_inode_sb(c->vfs_sb,
297− bch2_inode_cache, GFP_NOFS);
402+ bch2_inode_cache, gfp);
298403 if (!inode)
299404 return NULL;
300405
@@ -306,7 +411,7 @@ static struct bch_inode_info *__bch2_new_inode(struct bch_fs *c) · 5 unmodified lines
306411 mutex_init(&inode->ei_quota_lock);
307412 memset(&inode->ei_devs_need_flush, 0, sizeof(inode->ei_devs_need_flush));
308413
309− if (unlikely(inode_init_always(c->vfs_sb, &inode->v))) {
414+ if (unlikely(inode_init_always_gfp(c->vfs_sb, &inode->v, gfp))) {
310415 kmem_cache_free(bch2_inode_cache, inode);
311416 return NULL;
312417 }
@@ -319,12 +424,10 @@ static struct bch_inode_info *__bch2_new_inode(struct bch_fs *c) · 6 unmodified lines
319424 */
320425 static struct bch_inode_info *bch2_new_inode(struct btree_trans *trans)
321426 {
322− struct bch_inode_info *inode =
323− memalloc_flags_do(PF_MEMALLOC_NORECLAIM|PF_MEMALLOC_NOWARN,
324− __bch2_new_inode(trans->c));
427+ struct bch_inode_info *inode = __bch2_new_inode(trans->c, GFP_NOWAIT);
325428
326429 if (unlikely(!inode)) {
327− int ret = drop_locks_do(trans, (inode = __bch2_new_inode(trans->c)) ? 0 : -ENOMEM);
430+ int ret = drop_locks_do(trans, (inode = __bch2_new_inode(trans->c, GFP_NOFS)) ? 0 : -ENOMEM);
328431 if (ret && inode) {
329432 __destroy_inode(&inode->v);
330433 kmem_cache_free(bch2_inode_cache, inode);
@@ -398,7 +501,7 @@ __bch2_create(struct mnt_idmap *idmap, · 67 unmodified lines
398501 if (ret)
399502 return ERR_PTR(ret);
400503 #endif
401− inode = __bch2_new_inode(c);
504+ inode = __bch2_new_inode(c, GFP_NOFS);
402505 if (unlikely(!inode)) {
403506 inode = ERR_PTR(-ENOMEM);
404507 goto err;
@@ -553,7 +656,7 @@ static struct dentry *bch2_lookup(struct inode *vdir, struct dentry *dentry, · 148 unmodified lines
553656 struct bch_hash_info hash = bch2_hash_info_init(c, &dir->ei_inode);
554657
555658 struct bch_inode_info *inode;
556− bch2_trans_do(c, NULL, NULL, 0,
659+ bch2_trans_do(c,
557660 PTR_ERR_OR_ZERO(inode = bch2_lookup_trans(trans, inode_inum(dir),
558661 &hash, &dentry->d_name)));
559662 if (IS_ERR(inode))
@@ -766,7 +869,7 @@ static int bch2_rename2(struct mnt_idmap *idmap, · 206 unmodified lines
766869 ret = bch2_subvol_is_ro_trans(trans, src_dir->ei_inum.subvol) ?:
767870 bch2_subvol_is_ro_trans(trans, dst_dir->ei_inum.subvol);
768871 if (ret)
769− goto err;
872+ goto err_tx_restart;
770873
771874 if (inode_attr_changing(dst_dir, src_inode, Inode_opt_project)) {
772875 ret = bch2_fs_quota_transfer(c, src_inode,
@@ -1163,7 +1266,7 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info, · 390 unmodified lines
11631266 bch2_trans_iter_init(trans, &iter, BTREE_ID_extents,
11641267 POS(ei->v.i_ino, start), 0);
11651268
1166− while (true) {
1269+ while (!ret || bch2_err_matches(ret, BCH_ERR_transaction_restart)) {
11671270 enum btree_id data_btree = BTREE_ID_extents;
11681271
11691272 bch2_trans_begin(trans);
@@ -1171,14 +1274,14 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info, · 1 unmodified line
11711274 u32 snapshot;
11721275 ret = bch2_subvolume_get_snapshot(trans, ei->ei_inum.subvol, &snapshot);
11731276 if (ret)
1174− goto err;
1277+ continue;
11751278
11761279 bch2_btree_iter_set_snapshot(&iter, snapshot);
11771280
11781281 k = bch2_btree_iter_peek_upto(&iter, end);
11791282 ret = bkey_err(k);
11801283 if (ret)
1181− goto err;
1284+ continue;
11821285
11831286 if (!k.k)
11841287 break;
@@ -1198,7 +1301,7 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info, · 13 unmodified lines
11981301 ret = bch2_read_indirect_extent(trans, &data_btree,
11991302 &offset_into_extent, &cur);
12001303 if (ret)
1201− break;
1304+ continue;
12021305
12031306 k = bkey_i_to_s_c(cur.k);
12041307 bch2_bkey_buf_realloc(&prev, c, k.k->u64s);
@@ -1226,10 +1329,6 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info, · 21 unmodified lines
12261329
12271330 bch2_btree_iter_set_pos(&iter,
12281331 POS(iter.pos.inode, iter.pos.offset + sectors));
1229−err:
1230− if (ret &&
1231− !bch2_err_matches(ret, BCH_ERR_transaction_restart))
1232− break;
12331332 }
12341333 bch2_trans_iter_exit(trans, &iter);
12351334
@@ -1937,7 +2036,7 @@ static int bch2_show_options(struct seq_file *seq, struct dentry *root) · 701 unmodified lines
19372036 bch2_opts_to_text(&buf, c->opts, c, c->disk_sb.sb,
19382037 OPT_MOUNT, OPT_HIDDEN, OPT_SHOW_MOUNT_STYLE);
19392038 printbuf_nul_terminate(&buf);
1940− seq_puts(seq, buf.buf);
2039+ seq_printf(seq, ",%s", buf.buf);
19412040
19422041 int ret = buf.allocation_failure ? -ENOMEM : 0;
19432042 printbuf_exit(&buf);
fs/bcachefs/fs.h+3−6
@@ -54,8 +54,6 @@ static inline subvol_inum inode_inum(struct bch_inode_info *inode) · 53 unmodified lines
5454 return inode->ei_inum;
5555 }
5656
57−struct bch_inode_info *__bch2_inode_hash_find(struct bch_fs *, subvol_inum);
58−
5957 /*
6058 * Set if we've gotten a btree error for this inode, and thus the vfs inode and
6159 * btree inode may be inconsistent:
@@ -148,6 +146,8 @@ struct bch_inode_info * · 86 unmodified lines
148146 __bch2_create(struct mnt_idmap *, struct bch_inode_info *,
149147 struct dentry *, umode_t, dev_t, subvol_inum, unsigned);
150148
149+int bch2_inode_or_descendents_is_open(struct btree_trans *trans, struct bpos p);
150+
151151 int bch2_fs_quota_transfer(struct bch_fs *,
152152 struct bch_inode_info *,
153153 struct bch_qid,
@@ -198,10 +198,7 @@ int bch2_vfs_init(void); · 44 unmodified lines
198198
199199 #define bch2_inode_update_after_write(_trans, _inode, _inode_u, _fields) ({ do {} while (0); })
200200
201−static inline struct bch_inode_info *__bch2_inode_hash_find(struct bch_fs *c, subvol_inum inum)
202−{
203− return NULL;
204−}
201+static inline int bch2_inode_or_descendents_is_open(struct btree_trans *trans, struct bpos p) { return 0; }
205202
206203 static inline void bch2_evict_subvolume_inodes(struct bch_fs *c,
207204 snapshot_id_list *s) {}
fs/bcachefs/fsck.c+559−254
@@ -28,8 +28,8 @@ static bool inode_points_to_dirent(struct bch_inode_unpacked *inode, · 27 unmodified lines
2828 inode->bi_dir_offset == d.k->p.offset;
2929 }
3030
31−static bool dirent_points_to_inode_nowarn(struct bkey_s_c_dirent d,
32− struct bch_inode_unpacked *inode)
31+static int dirent_points_to_inode_nowarn(struct bkey_s_c_dirent d,
32+ struct bch_inode_unpacked *inode)
3333 {
3434 if (d.v->d_type == DT_SUBVOL
3535 ? le32_to_cpu(d.v->d_child_subvol) == inode->bi_subvol
@@ -137,16 +137,15 @@ found: · 101 unmodified lines
137137 return ret;
138138 }
139139
140−static int lookup_inode(struct btree_trans *trans, u64 inode_nr,
141− struct bch_inode_unpacked *inode,
142− u32 *snapshot)
140+static int lookup_inode(struct btree_trans *trans, u64 inode_nr, u32 snapshot,
141+ struct bch_inode_unpacked *inode)
143142 {
144143 struct btree_iter iter;
145144 struct bkey_s_c k;
146145 int ret;
147146
148147 k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_inodes,
149− SPOS(0, inode_nr, *snapshot), 0);
148+ SPOS(0, inode_nr, snapshot), 0);
150149 ret = bkey_err(k);
151150 if (ret)
152151 goto err;
@@ -154,8 +153,6 @@ static int lookup_inode(struct btree_trans *trans, u64 inode_nr, · 1 unmodified line
154153 ret = bkey_is_inode(k.k)
155154 ? bch2_inode_unpack(k, inode)
156155 : -BCH_ERR_ENOENT_inode;
157− if (!ret)
158− *snapshot = iter.pos.snapshot;
159156 err:
160157 bch2_trans_iter_exit(trans, &iter);
161158 return ret;
@@ -250,8 +247,7 @@ static int lookup_lostfound(struct btree_trans *trans, u32 snapshot, · 88 unmodified lines
250247
251248 struct bch_inode_unpacked root_inode;
252249 struct bch_hash_info root_hash_info;
253− u32 root_inode_snapshot = snapshot;
254− ret = lookup_inode(trans, root_inum.inum, &root_inode, &root_inode_snapshot);
250+ ret = lookup_inode(trans, root_inum.inum, snapshot, &root_inode);
255251 bch_err_msg(c, ret, "looking up root inode %llu for subvol %u",
256252 root_inum.inum, le32_to_cpu(st.master_subvol));
257253 if (ret)
@@ -277,17 +273,23 @@ static int lookup_lostfound(struct btree_trans *trans, u32 snapshot, · 19 unmodified lines
277273 * The bch2_check_dirents pass has already run, dangling dirents
278274 * shouldn't exist here:
279275 */
280− ret = lookup_inode(trans, inum, lostfound, &snapshot);
276+ ret = lookup_inode(trans, inum, snapshot, lostfound);
281277 bch_err_msg(c, ret, "looking up lost+found %llu:%u in (root inode %llu, snapshot root %u)",
282278 inum, snapshot, root_inum.inum, bch2_snapshot_root(c, snapshot));
283279 return ret;
284280
285281 create_lostfound:
282+ /*
283+ * we always create lost+found in the root snapshot; we don't want
284+ * different branches of the snapshot tree to have different lost+found
285+ */
286+ snapshot = le32_to_cpu(st.root_snapshot);
286287 /*
287288 * XXX: we could have a nicer log message here if we had a nice way to
288289 * walk backpointers to print a path
289290 */
290− bch_notice(c, "creating lost+found in snapshot %u", le32_to_cpu(st.root_snapshot));
291+ bch_notice(c, "creating lost+found in subvol %llu snapshot %u",
292+ root_inum.subvol, le32_to_cpu(st.root_snapshot));
291293
292294 u64 now = bch2_current_time(c);
293295 struct btree_iter lostfound_iter = { NULL };
@@ -296,6 +298,7 @@ create_lostfound: · 2 unmodified lines
296298 bch2_inode_init_early(c, lostfound);
297299 bch2_inode_init_late(lostfound, now, 0, 0, S_IFDIR|0700, 0, &root_inode);
298300 lostfound->bi_dir = root_inode.bi_inum;
301+ lostfound->bi_snapshot = le32_to_cpu(st.root_snapshot);
299302
300303 root_inode.bi_nlink++;
301304
@@ -323,19 +326,54 @@ err: · 21 unmodified lines
323326 return ret;
324327 }
325328
326−static int reattach_inode(struct btree_trans *trans,
327− struct bch_inode_unpacked *inode,
328− u32 inode_snapshot)
329+static inline bool inode_should_reattach(struct bch_inode_unpacked *inode)
330+{
331+ if (inode->bi_inum == BCACHEFS_ROOT_INO &&
332+ inode->bi_subvol == BCACHEFS_ROOT_SUBVOL)
333+ return false;
334+
335+ return !inode->bi_dir && !(inode->bi_flags & BCH_INODE_unlinked);
336+}
337+
338+static int maybe_delete_dirent(struct btree_trans *trans, struct bpos d_pos, u32 snapshot)
339+{
340+ struct btree_iter iter;
341+ struct bkey_s_c k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_dirents,
342+ SPOS(d_pos.inode, d_pos.offset, snapshot),
343+ BTREE_ITER_intent|
344+ BTREE_ITER_with_updates);
345+ int ret = bkey_err(k);
346+ if (ret)
347+ return ret;
348+
349+ if (bpos_eq(k.k->p, d_pos)) {
350+ /*
351+ * delet_at() doesn't work because the update path doesn't
352+ * internally use BTREE_ITER_with_updates yet
353+ */
354+ struct bkey_i *k = bch2_trans_kmalloc(trans, sizeof(*k));
355+ ret = PTR_ERR_OR_ZERO(k);
356+ if (ret)
357+ goto err;
358+
359+ bkey_init(&k->k);
360+ k->k.type = KEY_TYPE_whiteout;
361+ k->k.p = iter.pos;
362+ ret = bch2_trans_update(trans, &iter, k, BTREE_UPDATE_internal_snapshot_node);
363+ }
364+err:
365+ bch2_trans_iter_exit(trans, &iter);
366+ return ret;
367+}
368+
369+static int reattach_inode(struct btree_trans *trans, struct bch_inode_unpacked *inode)
329370 {
330371 struct bch_fs *c = trans->c;
331− struct bch_hash_info dir_hash;
332372 struct bch_inode_unpacked lostfound;
333373 char name_buf[20];
334− struct qstr name;
335− u64 dir_offset = 0;
336− u32 dirent_snapshot = inode_snapshot;
337374 int ret;
338375
376+ u32 dirent_snapshot = inode->bi_snapshot;
339377 if (inode->bi_subvol) {
340378 inode->bi_parent_subvol = BCACHEFS_ROOT_SUBVOL;
341379
@@ -354,17 +392,22 @@ static int reattach_inode(struct btree_trans *trans, · 12 unmodified lines
354392 if (ret)
355393 return ret;
356394
357− if (S_ISDIR(inode->bi_mode)) {
358− lostfound.bi_nlink++;
395+ lostfound.bi_nlink += S_ISDIR(inode->bi_mode);
359396
360− ret = __bch2_fsck_write_inode(trans, &lostfound, U32_MAX);
361− if (ret)
362− return ret;
397+ /* ensure lost+found inode is also present in inode snapshot */
398+ if (!inode->bi_subvol) {
399+ BUG_ON(!bch2_snapshot_is_ancestor(c, inode->bi_snapshot, lostfound.bi_snapshot));
400+ lostfound.bi_snapshot = inode->bi_snapshot;
363401 }
364402
365− dir_hash = bch2_hash_info_init(c, &lostfound);
403+ ret = __bch2_fsck_write_inode(trans, &lostfound);
404+ if (ret)
405+ return ret;
406+
407+ struct bch_hash_info dir_hash = bch2_hash_info_init(c, &lostfound);
408+ struct qstr name = (struct qstr) QSTR(name_buf);
366409
367− name = (struct qstr) QSTR(name_buf);
410+ inode->bi_dir = lostfound.bi_inum;
368411
369412 ret = bch2_dirent_create_snapshot(trans,
370413 inode->bi_parent_subvol, lostfound.bi_inum,
@@ -373,17 +416,70 @@ static int reattach_inode(struct btree_trans *trans, · 2 unmodified lines
373416 inode_d_type(inode),
374417 &name,
375418 inode->bi_subvol ?: inode->bi_inum,
376− &dir_offset,
419+ &inode->bi_dir_offset,
377420 STR_HASH_must_create);
378421 if (ret) {
379422 bch_err_msg(c, ret, "error creating dirent");
380423 return ret;
381424 }
382425
383− inode->bi_dir = lostfound.bi_inum;
384− inode->bi_dir_offset = dir_offset;
426+ ret = __bch2_fsck_write_inode(trans, inode);
427+ if (ret)
428+ return ret;
429+
430+ /*
431+ * Fix up inodes in child snapshots: if they should also be reattached
432+ * update the backpointer field, if they should not be we need to emit
433+ * whiteouts for the dirent we just created.
434+ */
435+ if (!inode->bi_subvol && bch2_snapshot_is_leaf(c, inode->bi_snapshot) <= 0) {
436+ snapshot_id_list whiteouts_done;
437+ struct btree_iter iter;
438+ struct bkey_s_c k;
439+
440+ darray_init(&whiteouts_done);
441+
442+ for_each_btree_key_reverse_norestart(trans, iter,
443+ BTREE_ID_inodes, SPOS(0, inode->bi_inum, inode->bi_snapshot - 1),
444+ BTREE_ITER_all_snapshots|BTREE_ITER_intent, k, ret) {
445+ if (k.k->p.offset != inode->bi_inum)
446+ break;
447+
448+ if (!bkey_is_inode(k.k) ||
449+ !bch2_snapshot_is_ancestor(c, k.k->p.snapshot, inode->bi_snapshot) ||
450+ snapshot_list_has_ancestor(c, &whiteouts_done, k.k->p.snapshot))
451+ continue;
452+
453+ struct bch_inode_unpacked child_inode;
454+ bch2_inode_unpack(k, &child_inode);
455+
456+ if (!inode_should_reattach(&child_inode)) {
457+ ret = maybe_delete_dirent(trans,
458+ SPOS(lostfound.bi_inum, inode->bi_dir_offset,
459+ dirent_snapshot),
460+ k.k->p.snapshot);
461+ if (ret)
462+ break;
463+
464+ ret = snapshot_list_add(c, &whiteouts_done, k.k->p.snapshot);
465+ if (ret)
466+ break;
467+ } else {
468+ iter.snapshot = k.k->p.snapshot;
469+ child_inode.bi_dir = inode->bi_dir;
470+ child_inode.bi_dir_offset = inode->bi_dir_offset;
471+
472+ ret = bch2_inode_write_flags(trans, &iter, &child_inode,
473+ BTREE_UPDATE_internal_snapshot_node);
474+ if (ret)
475+ break;
476+ }
477+ }
478+ darray_exit(&whiteouts_done);
479+ bch2_trans_iter_exit(trans, &iter);
480+ }
385481
386− return __bch2_fsck_write_inode(trans, inode, inode_snapshot);
482+ return ret;
387483 }
388484
389485 static int remove_backpointer(struct btree_trans *trans,
@@ -422,7 +518,7 @@ static int reattach_subvol(struct btree_trans *trans, struct bkey_s_c_subvolume · 32 unmodified lines
422518 if (ret)
423519 return ret;
424520
425− ret = reattach_inode(trans, &inode, le32_to_cpu(s.v->snapshot));
521+ ret = reattach_inode(trans, &inode);
426522 bch_err_msg(c, ret, "reattaching inode %llu", inode.bi_inum);
427523 return ret;
428524 }
@@ -540,8 +636,9 @@ static int reconstruct_inode(struct btree_trans *trans, enum btree_id btree, u32 · 111 unmodified lines
540636 bch2_inode_init_late(&new_inode, bch2_current_time(c), 0, 0, i_mode|0600, 0, NULL);
541637 new_inode.bi_size = i_size;
542638 new_inode.bi_inum = inum;
639+ new_inode.bi_snapshot = snapshot;
543640
544− return __bch2_fsck_write_inode(trans, &new_inode, snapshot);
641+ return __bch2_fsck_write_inode(trans, &new_inode);
545642 }
546643
547644 struct snapshots_seen {
@@ -832,35 +929,138 @@ static int get_visible_inodes(struct btree_trans *trans, · 284 unmodified lines
832929 return ret;
833930 }
834931
835−static int hash_redo_key(struct btree_trans *trans,
836− const struct bch_hash_desc desc,
837− struct bch_hash_info *hash_info,
838− struct btree_iter *k_iter, struct bkey_s_c k)
932+static int dirent_has_target(struct btree_trans *trans, struct bkey_s_c_dirent d)
839933 {
840− struct bkey_i *delete;
841− struct bkey_i *tmp;
934+ if (d.v->d_type == DT_SUBVOL) {
935+ u32 snap;
936+ u64 inum;
937+ int ret = subvol_lookup(trans, le32_to_cpu(d.v->d_child_subvol), &snap, &inum);
938+ if (ret && !bch2_err_matches(ret, ENOENT))
939+ return ret;
940+ return !ret;
941+ } else {
942+ struct btree_iter iter;
943+ struct bkey_s_c k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_inodes,
944+ SPOS(0, le64_to_cpu(d.v->d_inum), d.k->p.snapshot), 0);
945+ int ret = bkey_err(k);
946+ if (ret)
947+ return ret;
948+
949+ ret = bkey_is_inode(k.k);
950+ bch2_trans_iter_exit(trans, &iter);
951+ return ret;
952+ }
953+}
842954
843− delete = bch2_trans_kmalloc(trans, sizeof(*delete));
844− if (IS_ERR(delete))
845− return PTR_ERR(delete);
955+/*
956+ * Prefer to delete the first one, since that will be the one at the wrong
957+ * offset:
958+ * return value: 0 -> delete k1, 1 -> delete k2
959+ */
960+static int hash_pick_winner(struct btree_trans *trans,
961+ const struct bch_hash_desc desc,
962+ struct bch_hash_info *hash_info,
963+ struct bkey_s_c k1,
964+ struct bkey_s_c k2)
965+{
966+ if (bkey_val_bytes(k1.k) == bkey_val_bytes(k2.k) &&
967+ !memcmp(k1.v, k2.v, bkey_val_bytes(k1.k)))
968+ return 0;
846969
847− tmp = bch2_bkey_make_mut_noupdate(trans, k);
848− if (IS_ERR(tmp))
849− return PTR_ERR(tmp);
970+ switch (desc.btree_id) {
971+ case BTREE_ID_dirents: {
972+ int ret = dirent_has_target(trans, bkey_s_c_to_dirent(k1));
973+ if (ret < 0)
974+ return ret;
975+ if (!ret)
976+ return 0;
850977
851− bkey_init(&delete->k);
852− delete->k.p = k_iter->pos;
853− return bch2_btree_iter_traverse(k_iter) ?:
854− bch2_trans_update(trans, k_iter, delete, 0) ?:
855− bch2_hash_set_in_snapshot(trans, desc, hash_info,
856− (subvol_inum) { 0, k.k->p.inode },
857− k.k->p.snapshot, tmp,
858− STR_HASH_must_create|
859− BTREE_UPDATE_internal_snapshot_node) ?:
860− bch2_trans_commit(trans, NULL, NULL, BCH_TRANS_COMMIT_no_enospc);
978+ ret = dirent_has_target(trans, bkey_s_c_to_dirent(k2));
979+ if (ret < 0)
980+ return ret;
981+ if (!ret)
982+ return 1;
983+ return 2;
984+ }
985+ default:
986+ return 0;
987+ }
988+}
989+
990+static int fsck_update_backpointers(struct btree_trans *trans,
991+ struct snapshots_seen *s,
992+ const struct bch_hash_desc desc,
993+ struct bch_hash_info *hash_info,
994+ struct bkey_i *new)
995+{
996+ if (new->k.type != KEY_TYPE_dirent)
997+ return 0;
998+
999+ struct bkey_i_dirent *d = bkey_i_to_dirent(new);
1000+ struct inode_walker target = inode_walker_init();
1001+ int ret = 0;
1002+
1003+ if (d->v.d_type == DT_SUBVOL) {
1004+ BUG();
1005+ } else {
1006+ ret = get_visible_inodes(trans, &target, s, le64_to_cpu(d->v.d_inum));
1007+ if (ret)
1008+ goto err;
1009+
1010+ darray_for_each(target.inodes, i) {
1011+ i->inode.bi_dir_offset = d->k.p.offset;
1012+ ret = __bch2_fsck_write_inode(trans, &i->inode);
1013+ if (ret)
1014+ goto err;
1015+ }
1016+ }
1017+err:
1018+ inode_walker_exit(&target);
1019+ return ret;
1020+}
1021+
1022+static int fsck_rename_dirent(struct btree_trans *trans,
1023+ struct snapshots_seen *s,
1024+ const struct bch_hash_desc desc,
1025+ struct bch_hash_info *hash_info,
1026+ struct bkey_s_c_dirent old)
1027+{
1028+ struct qstr old_name = bch2_dirent_get_name(old);
1029+ struct bkey_i_dirent *new = bch2_trans_kmalloc(trans, bkey_bytes(old.k) + 32);
1030+ int ret = PTR_ERR_OR_ZERO(new);
1031+ if (ret)
1032+ return ret;
1033+
1034+ bkey_dirent_init(&new->k_i);
1035+ dirent_copy_target(new, old);
1036+ new->k.p = old.k->p;
1037+
1038+ for (unsigned i = 0; i < 1000; i++) {
1039+ unsigned len = sprintf(new->v.d_name, "%.*s.fsck_renamed-%u",
1040+ old_name.len, old_name.name, i);
1041+ unsigned u64s = BKEY_U64s + dirent_val_u64s(len);
1042+
1043+ if (u64s > U8_MAX)
1044+ return -EINVAL;
1045+
1046+ new->k.u64s = u64s;
1047+
1048+ ret = bch2_hash_set_in_snapshot(trans, bch2_dirent_hash_desc, hash_info,
1049+ (subvol_inum) { 0, old.k->p.inode },
1050+ old.k->p.snapshot, &new->k_i,
1051+ BTREE_UPDATE_internal_snapshot_node);
1052+ if (!bch2_err_matches(ret, EEXIST))
1053+ break;
1054+ }
1055+
1056+ if (ret)
1057+ return ret;
1058+
1059+ return fsck_update_backpointers(trans, s, desc, hash_info, &new->k_i);
8611060 }
8621061
8631062 static int hash_check_key(struct btree_trans *trans,
1063+ struct snapshots_seen *s,
8641064 const struct bch_hash_desc desc,
8651065 struct bch_hash_info *hash_info,
8661066 struct btree_iter *k_iter, struct bkey_s_c hash_k)
@@ -889,16 +1089,9 @@ static int hash_check_key(struct btree_trans *trans, · 22 unmodified lines
8891089 if (bkey_eq(k.k->p, hash_k.k->p))
8901090 break;
8911091
892− if (fsck_err_on(k.k->type == desc.key_type &&
893− !desc.cmp_bkey(k, hash_k),
894− trans, hash_table_key_duplicate,
895− "duplicate hash table keys:\n%s",
896− (printbuf_reset(&buf),
897− bch2_bkey_val_to_text(&buf, c, hash_k),
898− buf.buf))) {
899− ret = bch2_hash_delete_at(trans, desc, hash_info, k_iter, 0) ?: 1;
900− break;
901− }
1092+ if (k.k->type == desc.key_type &&
1093+ !desc.cmp_bkey(k, hash_k))
1094+ goto duplicate_entries;
9021095
9031096 if (bkey_deleted(k.k)) {
9041097 bch2_trans_iter_exit(trans, &iter);
@@ -911,18 +1104,66 @@ out: · 6 unmodified lines
9111104 return ret;
9121105 bad_hash:
9131106 if (fsck_err(trans, hash_table_key_wrong_offset,
914− "hash table key at wrong offset: btree %s inode %llu offset %llu, hashed to %llu\n%s",
1107+ "hash table key at wrong offset: btree %s inode %llu offset %llu, hashed to %llu\n %s",
9151108 bch2_btree_id_str(desc.btree_id), hash_k.k->p.inode, hash_k.k->p.offset, hash,
9161109 (printbuf_reset(&buf),
9171110 bch2_bkey_val_to_text(&buf, c, hash_k), buf.buf))) {
918− ret = hash_redo_key(trans, desc, hash_info, k_iter, hash_k);
919− bch_err_fn(c, ret);
1111+ struct bkey_i *new = bch2_bkey_make_mut_noupdate(trans, hash_k);
1112+ if (IS_ERR(new))
1113+ return PTR_ERR(new);
1114+
1115+ k = bch2_hash_set_or_get_in_snapshot(trans, &iter, desc, hash_info,
1116+ (subvol_inum) { 0, hash_k.k->p.inode },
1117+ hash_k.k->p.snapshot, new,
1118+ STR_HASH_must_create|
1119+ BTREE_ITER_with_updates|
1120+ BTREE_UPDATE_internal_snapshot_node);
1121+ ret = bkey_err(k);
9201122 if (ret)
921− return ret;
922− ret = -BCH_ERR_transaction_restart_nested;
1123+ goto out;
1124+ if (k.k)
1125+ goto duplicate_entries;
1126+
1127+ ret = bch2_hash_delete_at(trans, desc, hash_info, k_iter,
1128+ BTREE_UPDATE_internal_snapshot_node) ?:
1129+ fsck_update_backpointers(trans, s, desc, hash_info, new) ?:
1130+ bch2_trans_commit(trans, NULL, NULL, BCH_TRANS_COMMIT_no_enospc) ?:
1131+ -BCH_ERR_transaction_restart_nested;
1132+ goto out;
9231133 }
9241134 fsck_err:
9251135 goto out;
1136+duplicate_entries:
1137+ ret = hash_pick_winner(trans, desc, hash_info, hash_k, k);
1138+ if (ret < 0)
1139+ goto out;
1140+
1141+ if (!fsck_err(trans, hash_table_key_duplicate,
1142+ "duplicate hash table keys%s:\n%s",
1143+ ret != 2 ? "" : ", both point to valid inodes",
1144+ (printbuf_reset(&buf),
1145+ bch2_bkey_val_to_text(&buf, c, hash_k),
1146+ prt_newline(&buf),
1147+ bch2_bkey_val_to_text(&buf, c, k),
1148+ buf.buf)))
1149+ goto out;
1150+
1151+ switch (ret) {
1152+ case 0:
1153+ ret = bch2_hash_delete_at(trans, desc, hash_info, k_iter, 0);
1154+ break;
1155+ case 1:
1156+ ret = bch2_hash_delete_at(trans, desc, hash_info, &iter, 0);
1157+ break;
1158+ case 2:
1159+ ret = fsck_rename_dirent(trans, s, desc, hash_info, bkey_s_c_to_dirent(hash_k)) ?:
1160+ bch2_hash_delete_at(trans, desc, hash_info, k_iter, 0);
1161+ goto out;
1162+ }
1163+
1164+ ret = bch2_trans_commit(trans, NULL, NULL, 0) ?:
1165+ -BCH_ERR_transaction_restart_nested;
1166+ goto out;
9261167 }
9271168
9281169 static struct bkey_s_c_dirent dirent_get_by_pos(struct btree_trans *trans,
@@ -988,7 +1229,6 @@ static int check_inode_dirent_inode(struct btree_trans *trans, · 59 unmodified lines
9881229 */
9891230 inode->bi_dir = 0;
9901231 inode->bi_dir_offset = 0;
991− inode->bi_flags &= ~BCH_INODE_backptr_untrusted;
9921232 *write_inode = true;
9931233 }
9941234
@@ -1000,30 +1240,40 @@ fsck_err: · 5 unmodified lines
10001240 return ret;
10011241 }
10021242
1003−static bool bch2_inode_is_open(struct bch_fs *c, struct bpos p)
1243+static int get_snapshot_root_inode(struct btree_trans *trans,
1244+ struct bch_inode_unpacked *root,
1245+ u64 inum)
10041246 {
1005− subvol_inum inum = {
1006− .subvol = snapshot_t(c, p.snapshot)->subvol,
1007− .inum = p.offset,
1008− };
1247+ struct btree_iter iter;
1248+ struct bkey_s_c k;
1249+ int ret = 0;
10091250
1010− /* snapshot tree corruption, can't safely delete */
1011− if (!inum.subvol) {
1012− bch_warn_ratelimited(c, "%s(): snapshot %u has no subvol, unlinked but can't safely delete", __func__, p.snapshot);
1013− return true;
1251+ for_each_btree_key_reverse_norestart(trans, iter, BTREE_ID_inodes,
1252+ SPOS(0, inum, U32_MAX),
1253+ BTREE_ITER_all_snapshots, k, ret) {
1254+ if (k.k->p.offset != inum)
1255+ break;
1256+ if (bkey_is_inode(k.k))
1257+ goto found_root;
10141258 }
1015−
1016− return __bch2_inode_hash_find(c, inum) != NULL;
1259+ if (ret)
1260+ goto err;
1261+ BUG();
1262+found_root:
1263+ BUG_ON(bch2_inode_unpack(k, root));
1264+err:
1265+ bch2_trans_iter_exit(trans, &iter);
1266+ return ret;
10171267 }
10181268
10191269 static int check_inode(struct btree_trans *trans,
10201270 struct btree_iter *iter,
10211271 struct bkey_s_c k,
1022− struct bch_inode_unpacked *prev,
1023− struct snapshots_seen *s,
1024− bool full)
1272+ struct bch_inode_unpacked *snapshot_root,
1273+ struct snapshots_seen *s)
10251274 {
10261275 struct bch_fs *c = trans->c;
1276+ struct printbuf buf = PRINTBUF;
10271277 struct bch_inode_unpacked u;
10281278 bool do_update = false;
10291279 int ret;
@@ -1043,45 +1293,75 @@ static int check_inode(struct btree_trans *trans, · 13 unmodified lines
10431293
10441294 BUG_ON(bch2_inode_unpack(k, &u));
10451295
1046− if (!full &&
1047− !(u.bi_flags & (BCH_INODE_i_size_dirty|
1048− BCH_INODE_i_sectors_dirty|
1049− BCH_INODE_unlinked)))
1050− return 0;
1051−
1052− if (prev->bi_inum != u.bi_inum)
1053− *prev = u;
1296+ if (snapshot_root->bi_inum != u.bi_inum) {
1297+ ret = get_snapshot_root_inode(trans, snapshot_root, u.bi_inum);
1298+ if (ret)
1299+ goto err;
1300+ }
10541301
1055− if (fsck_err_on(prev->bi_hash_seed != u.bi_hash_seed ||
1056− inode_d_type(prev) != inode_d_type(&u),
1302+ if (fsck_err_on(u.bi_hash_seed != snapshot_root->bi_hash_seed ||
1303+ INODE_STR_HASH(&u) != INODE_STR_HASH(snapshot_root),
10571304 trans, inode_snapshot_mismatch,
10581305 "inodes in different snapshots don't match")) {
1059− bch_err(c, "repair not implemented yet");
1060− return -BCH_ERR_fsck_repair_unimplemented;
1306+ u.bi_hash_seed = snapshot_root->bi_hash_seed;
1307+ SET_INODE_STR_HASH(&u, INODE_STR_HASH(snapshot_root));
1308+ do_update = true;
10611309 }
10621310
1063− if ((u.bi_flags & (BCH_INODE_i_size_dirty|BCH_INODE_unlinked)) &&
1064− bch2_key_has_snapshot_overwrites(trans, BTREE_ID_inodes, k.k->p)) {
1065− struct bpos new_min_pos;
1066−
1067− ret = bch2_propagate_key_to_snapshot_leaves(trans, iter->btree_id, k, &new_min_pos);
1311+ if (u.bi_dir || u.bi_dir_offset) {
1312+ ret = check_inode_dirent_inode(trans, &u, &do_update);
10681313 if (ret)
10691314 goto err;
1315+ }
10701316
1071− u.bi_flags &= ~BCH_INODE_i_size_dirty|BCH_INODE_unlinked;
1317+ if (fsck_err_on(u.bi_dir && (u.bi_flags & BCH_INODE_unlinked),
1318+ trans, inode_unlinked_but_has_dirent,
1319+ "inode unlinked but has dirent\n%s",
1320+ (printbuf_reset(&buf),
1321+ bch2_inode_unpacked_to_text(&buf, &u),
1322+ buf.buf))) {
1323+ u.bi_flags &= ~BCH_INODE_unlinked;
1324+ do_update = true;
1325+ }
10721326
1073− ret = __bch2_fsck_write_inode(trans, &u, iter->pos.snapshot);
1327+ if (S_ISDIR(u.bi_mode) && (u.bi_flags & BCH_INODE_unlinked)) {
1328+ /* Check for this early so that check_unreachable_inode() will reattach it */
10741329
1075− bch_err_msg(c, ret, "in fsck updating inode");
1076− if (ret)
1077− return ret;
1330+ ret = bch2_empty_dir_snapshot(trans, k.k->p.offset, 0, k.k->p.snapshot);
1331+ if (ret && ret != -BCH_ERR_ENOTEMPTY_dir_not_empty)
1332+ goto err;
10781333
1079− if (!bpos_eq(new_min_pos, POS_MIN))
1080− bch2_btree_iter_set_pos(iter, bpos_predecessor(new_min_pos));
1081− return 0;
1334+ fsck_err_on(ret, trans, inode_dir_unlinked_but_not_empty,
1335+ "dir unlinked but not empty\n%s",
1336+ (printbuf_reset(&buf),
1337+ bch2_inode_unpacked_to_text(&buf, &u),
1338+ buf.buf));
1339+ u.bi_flags &= ~BCH_INODE_unlinked;
1340+ do_update = true;
1341+ ret = 0;
1342+ }
1343+
1344+ ret = bch2_inode_has_child_snapshots(trans, k.k->p);
1345+ if (ret < 0)
1346+ goto err;
1347+
1348+ if (fsck_err_on(ret != !!(u.bi_flags & BCH_INODE_has_child_snapshot),
1349+ trans, inode_has_child_snapshots_wrong,
1350+ "inode has_child_snapshots flag wrong (should be %u)\n%s",
1351+ ret,
1352+ (printbuf_reset(&buf),
1353+ bch2_inode_unpacked_to_text(&buf, &u),
1354+ buf.buf))) {
1355+ if (ret)
1356+ u.bi_flags |= BCH_INODE_has_child_snapshot;
1357+ else
1358+ u.bi_flags &= ~BCH_INODE_has_child_snapshot;
1359+ do_update = true;
10821360 }
1361+ ret = 0;
10831362
1084− if (u.bi_flags & BCH_INODE_unlinked) {
1363+ if ((u.bi_flags & BCH_INODE_unlinked) &&
1364+ !(u.bi_flags & BCH_INODE_has_child_snapshot)) {
10851365 if (!test_bit(BCH_FS_started, &c->flags)) {
10861366 /*
10871367 * If we're not in online fsck, don't delete unlinked
@@ -1095,7 +1375,7 @@ static int check_inode(struct btree_trans *trans, · 7 unmodified lines
10951375 */
10961376 ret = check_inode_deleted_list(trans, k.k->p);
10971377 if (ret < 0)
1098− return ret;
1378+ goto err_noprint;
10991379
11001380 fsck_err_on(!ret,
11011381 trans, unlinked_inode_not_on_deleted_list,
@@ -1106,83 +1386,22 @@ static int check_inode(struct btree_trans *trans, · 4 unmodified lines
11061386 if (ret)
11071387 goto err;
11081388 } else {
1109− if (fsck_err_on(bch2_inode_is_open(c, k.k->p),
1389+ ret = bch2_inode_or_descendents_is_open(trans, k.k->p);
1390+ if (ret < 0)
1391+ goto err;
1392+
1393+ if (fsck_err_on(!ret,
11101394 trans, inode_unlinked_and_not_open,
11111395 "inode %llu%u unlinked and not open",
11121396 u.bi_inum, u.bi_snapshot)) {
11131397 ret = bch2_inode_rm_snapshot(trans, u.bi_inum, iter->pos.snapshot);
11141398 bch_err_msg(c, ret, "in fsck deleting inode");
1115− return ret;
1399+ goto err_noprint;
11161400 }
1401+ ret = 0;
11171402 }
11181403 }
11191404
1120− /* i_size_dirty is vestigal, since we now have logged ops for truncate * */
1121− if (u.bi_flags & BCH_INODE_i_size_dirty &&
1122− (!test_bit(BCH_FS_clean_recovery, &c->flags) ||
1123− fsck_err(trans, inode_i_size_dirty_but_clean,
1124− "filesystem marked clean, but inode %llu has i_size dirty",
1125− u.bi_inum))) {
1126− bch_verbose(c, "truncating inode %llu", u.bi_inum);
1127−
1128− /*
1129− * XXX: need to truncate partial blocks too here - or ideally
1130− * just switch units to bytes and that issue goes away
1131− */
1132− ret = bch2_btree_delete_range_trans(trans, BTREE_ID_extents,
1133− SPOS(u.bi_inum, round_up(u.bi_size, block_bytes(c)) >> 9,
1134− iter->pos.snapshot),
1135− POS(u.bi_inum, U64_MAX),
1136− 0, NULL);
1137− bch_err_msg(c, ret, "in fsck truncating inode");
1138− if (ret)
1139− return ret;
1140−
1141− /*
1142− * We truncated without our normal sector accounting hook, just
1143− * make sure we recalculate it:
1144− */
1145− u.bi_flags |= BCH_INODE_i_sectors_dirty;
1146−
1147− u.bi_flags &= ~BCH_INODE_i_size_dirty;
1148− do_update = true;
1149− }
1150−
1151− /* i_sectors_dirty is vestigal, i_sectors is always updated transactionally */
1152− if (u.bi_flags & BCH_INODE_i_sectors_dirty &&
1153− (!test_bit(BCH_FS_clean_recovery, &c->flags) ||
1154− fsck_err(trans, inode_i_sectors_dirty_but_clean,
1155− "filesystem marked clean, but inode %llu has i_sectors dirty",
1156− u.bi_inum))) {
1157− s64 sectors;
1158−
1159− bch_verbose(c, "recounting sectors for inode %llu",
1160− u.bi_inum);
1161−
1162− sectors = bch2_count_inode_sectors(trans, u.bi_inum, iter->pos.snapshot);
1163− if (sectors < 0) {
1164− bch_err_msg(c, sectors, "in fsck recounting inode sectors");
1165− return sectors;
1166− }
1167−
1168− u.bi_sectors = sectors;
1169− u.bi_flags &= ~BCH_INODE_i_sectors_dirty;
1170− do_update = true;
1171− }
1172−
1173− if (u.bi_flags & BCH_INODE_backptr_untrusted) {
1174− u.bi_dir = 0;
1175− u.bi_dir_offset = 0;
1176− u.bi_flags &= ~BCH_INODE_backptr_untrusted;
1177− do_update = true;
1178− }
1179−
1180− if (u.bi_dir || u.bi_dir_offset) {
1181− ret = check_inode_dirent_inode(trans, &u, &do_update);
1182− if (ret)
1183− goto err;
1184− }
1185−
11861405 if (fsck_err_on(u.bi_parent_subvol &&
11871406 (u.bi_subvol == 0 ||
11881407 u.bi_subvol == BCACHEFS_ROOT_SUBVOL),
@@ -1224,21 +1443,22 @@ static int check_inode(struct btree_trans *trans, · 35 unmodified lines
12241443 }
12251444 do_update:
12261445 if (do_update) {
1227− ret = __bch2_fsck_write_inode(trans, &u, iter->pos.snapshot);
1446+ ret = __bch2_fsck_write_inode(trans, &u);
12281447 bch_err_msg(c, ret, "in fsck updating inode");
12291448 if (ret)
1230− return ret;
1449+ goto err_noprint;
12311450 }
12321451 err:
12331452 fsck_err:
12341453 bch_err_fn(c, ret);
1454+err_noprint:
1455+ printbuf_exit(&buf);
12351456 return ret;
12361457 }
12371458
12381459 int bch2_check_inodes(struct bch_fs *c)
12391460 {
1240− bool full = c->opts.fsck;
1241− struct bch_inode_unpacked prev = { 0 };
1461+ struct bch_inode_unpacked snapshot_root = {};
12421462 struct snapshots_seen s;
12431463
12441464 snapshots_seen_init(&s);
@@ -1248,13 +1468,104 @@ int bch2_check_inodes(struct bch_fs *c) · 3 unmodified lines
12481468 POS_MIN,
12491469 BTREE_ITER_prefetch|BTREE_ITER_all_snapshots, k,
12501470 NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
1251− check_inode(trans, &iter, k, &prev, &s, full)));
1471+ check_inode(trans, &iter, k, &snapshot_root, &s)));
12521472
12531473 snapshots_seen_exit(&s);
12541474 bch_err_fn(c, ret);
12551475 return ret;
12561476 }
12571477
1478+static int find_oldest_inode_needs_reattach(struct btree_trans *trans,
1479+ struct bch_inode_unpacked *inode)
1480+{
1481+ struct bch_fs *c = trans->c;
1482+ struct btree_iter iter;
1483+ struct bkey_s_c k;
1484+ int ret = 0;
1485+
1486+ /*
1487+ * We look for inodes to reattach in natural key order, leaves first,
1488+ * but we should do the reattach at the oldest version that needs to be
1489+ * reattached:
1490+ */
1491+ for_each_btree_key_norestart(trans, iter,
1492+ BTREE_ID_inodes,
1493+ SPOS(0, inode->bi_inum, inode->bi_snapshot + 1),
1494+ BTREE_ITER_all_snapshots, k, ret) {
1495+ if (k.k->p.offset != inode->bi_inum)
1496+ break;
1497+
1498+ if (!bch2_snapshot_is_ancestor(c, inode->bi_snapshot, k.k->p.snapshot))
1499+ continue;
1500+
1501+ if (!bkey_is_inode(k.k))
1502+ break;
1503+
1504+ struct bch_inode_unpacked parent_inode;
1505+ bch2_inode_unpack(k, &parent_inode);
1506+
1507+ if (!inode_should_reattach(&parent_inode))
1508+ break;
1509+
1510+ *inode = parent_inode;
1511+ }
1512+ bch2_trans_iter_exit(trans, &iter);
1513+
1514+ return ret;
1515+}
1516+
1517+static int check_unreachable_inode(struct btree_trans *trans,
1518+ struct btree_iter *iter,
1519+ struct bkey_s_c k)
1520+{
1521+ struct printbuf buf = PRINTBUF;
1522+ int ret = 0;
1523+
1524+ if (!bkey_is_inode(k.k))
1525+ return 0;
1526+
1527+ struct bch_inode_unpacked inode;
1528+ BUG_ON(bch2_inode_unpack(k, &inode));
1529+
1530+ if (!inode_should_reattach(&inode))
1531+ return 0;
1532+
1533+ ret = find_oldest_inode_needs_reattach(trans, &inode);
1534+ if (ret)
1535+ return ret;
1536+
1537+ if (fsck_err(trans, inode_unreachable,
1538+ "unreachable inode:\n%s",
1539+ (bch2_inode_unpacked_to_text(&buf, &inode),
1540+ buf.buf)))
1541+ ret = reattach_inode(trans, &inode);
1542+fsck_err:
1543+ printbuf_exit(&buf);
1544+ return ret;
1545+}
1546+
1547+/*
1548+ * Reattach unreachable (but not unlinked) inodes
1549+ *
1550+ * Run after check_inodes() and check_dirents(), so we node that inode
1551+ * backpointer fields point to valid dirents, and every inode that has a dirent
1552+ * that points to it has its backpointer field set - so we're just looking for
1553+ * non-unlinked inodes without backpointers:
1554+ *
1555+ * XXX: this is racy w.r.t. hardlink removal in online fsck
1556+ */
1557+int bch2_check_unreachable_inodes(struct bch_fs *c)
1558+{
1559+ int ret = bch2_trans_run(c,
1560+ for_each_btree_key_commit(trans, iter, BTREE_ID_inodes,
1561+ POS_MIN,
1562+ BTREE_ITER_prefetch|BTREE_ITER_all_snapshots, k,
1563+ NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
1564+ check_unreachable_inode(trans, &iter, k)));
1565+ bch_err_fn(c, ret);
1566+ return ret;
1567+}
1568+
12581569 static inline bool btree_matches_i_mode(enum btree_id btree, unsigned mode)
12591570 {
12601571 switch (btree) {
@@ -1347,7 +1658,7 @@ static int check_i_sectors_notnested(struct btree_trans *trans, struct inode_wal · 86 unmodified lines
13471658 w->last_pos.inode, i->snapshot,
13481659 i->inode.bi_sectors, i->count)) {
13491660 i->inode.bi_sectors = i->count;
1350− ret = bch2_fsck_write_inode(trans, &i->inode, i->snapshot);
1661+ ret = bch2_fsck_write_inode(trans, &i->inode);
13511662 if (ret)
13521663 break;
13531664 }
@@ -1657,8 +1968,7 @@ static int check_extent(struct btree_trans *trans, struct btree_iter *iter, · 303 unmodified lines
16571968 !key_visible_in_snapshot(c, s, i->snapshot, k.k->p.snapshot))
16581969 continue;
16591970
1660− if (fsck_err_on(!(i->inode.bi_flags & BCH_INODE_i_size_dirty) &&
1661− k.k->p.offset > round_up(i->inode.bi_size, block_bytes(c)) >> 9 &&
1971+ if (fsck_err_on(k.k->p.offset > round_up(i->inode.bi_size, block_bytes(c)) >> 9 &&
16621972 !bkey_extent_is_reservation(k),
16631973 trans, extent_past_end_of_inode,
16641974 "extent type past end of inode %llu:%u, i_size %llu\n %s",
@@ -1789,7 +2099,7 @@ static int check_subdir_count_notnested(struct btree_trans *trans, struct inode_ · 124 unmodified lines
17892099 "directory %llu:%u with wrong i_nlink: got %u, should be %llu",
17902100 w->last_pos.inode, i->snapshot, i->inode.bi_nlink, i->count)) {
17912101 i->inode.bi_nlink = i->count;
1792− ret = bch2_fsck_write_inode(trans, &i->inode, i->snapshot);
2102+ ret = bch2_fsck_write_inode(trans, &i->inode);
17932103 if (ret)
17942104 break;
17952105 }
@@ -1810,8 +2120,7 @@ noinline_for_stack · 14 unmodified lines
18102120 static int check_dirent_inode_dirent(struct btree_trans *trans,
18112121 struct btree_iter *iter,
18122122 struct bkey_s_c_dirent d,
1813− struct bch_inode_unpacked *target,
1814− u32 target_snapshot)
2123+ struct bch_inode_unpacked *target)
18152124 {
18162125 struct bch_fs *c = trans->c;
18172126 struct printbuf buf = PRINTBUF;
@@ -1821,6 +2130,32 @@ static int check_dirent_inode_dirent(struct btree_trans *trans, · 3 unmodified lines
18212130 if (inode_points_to_dirent(target, d))
18222131 return 0;
18232132
2133+ if (!target->bi_dir &&
2134+ !target->bi_dir_offset) {
2135+ fsck_err_on(S_ISDIR(target->bi_mode),
2136+ trans, inode_dir_missing_backpointer,
2137+ "directory with missing backpointer\n%s",
2138+ (printbuf_reset(&buf),
2139+ bch2_bkey_val_to_text(&buf, c, d.s_c),
2140+ prt_printf(&buf, "\n"),
2141+ bch2_inode_unpacked_to_text(&buf, target),
2142+ buf.buf));
2143+
2144+ fsck_err_on(target->bi_flags & BCH_INODE_unlinked,
2145+ trans, inode_unlinked_but_has_dirent,
2146+ "inode unlinked but has dirent\n%s",
2147+ (printbuf_reset(&buf),
2148+ bch2_bkey_val_to_text(&buf, c, d.s_c),
2149+ prt_printf(&buf, "\n"),
2150+ bch2_inode_unpacked_to_text(&buf, target),
2151+ buf.buf));
2152+
2153+ target->bi_flags &= ~BCH_INODE_unlinked;
2154+ target->bi_dir = d.k->p.inode;
2155+ target->bi_dir_offset = d.k->p.offset;
2156+ return __bch2_fsck_write_inode(trans, target);
2157+ }
2158+
18242159 if (bch2_inode_should_have_bp(target) &&
18252160 !fsck_err(trans, inode_wrong_backpointer,
18262161 "dirent points to inode that does not point back:\n %s",
@@ -1830,15 +2165,8 @@ static int check_dirent_inode_dirent(struct btree_trans *trans, · 3 unmodified lines
18302165 buf.buf)))
18312166 goto err;
18322167
1833− if (!target->bi_dir &&
1834− !target->bi_dir_offset) {
1835− target->bi_dir = d.k->p.inode;
1836− target->bi_dir_offset = d.k->p.offset;
1837− return __bch2_fsck_write_inode(trans, target, target_snapshot);
1838− }
1839−
18402168 struct bkey_s_c_dirent bp_dirent = dirent_get_by_pos(trans, &bp_iter,
1841− SPOS(target->bi_dir, target->bi_dir_offset, target_snapshot));
2169+ SPOS(target->bi_dir, target->bi_dir_offset, target->bi_snapshot));
18422170 ret = bkey_err(bp_dirent);
18432171 if (ret && !bch2_err_matches(ret, ENOENT))
18442172 goto err;
@@ -1851,14 +2179,14 @@ static int check_dirent_inode_dirent(struct btree_trans *trans, · 6 unmodified lines
18512179 "inode %llu:%u has wrong backpointer:\n"
18522180 "got %llu:%llu\n"
18532181 "should be %llu:%llu",
1854− target->bi_inum, target_snapshot,
2182+ target->bi_inum, target->bi_snapshot,
18552183 target->bi_dir,
18562184 target->bi_dir_offset,
18572185 d.k->p.inode,
18582186 d.k->p.offset)) {
18592187 target->bi_dir = d.k->p.inode;
18602188 target->bi_dir_offset = d.k->p.offset;
1861− ret = __bch2_fsck_write_inode(trans, target, target_snapshot);
2189+ ret = __bch2_fsck_write_inode(trans, target);
18622190 goto out;
18632191 }
18642192
@@ -1873,7 +2201,7 @@ static int check_dirent_inode_dirent(struct btree_trans *trans, · 8 unmodified lines
18732201 trans, inode_dir_multiple_links,
18742202 "%s %llu:%u with multiple links\n%s",
18752203 S_ISDIR(target->bi_mode) ? "directory" : "subvolume",
1876− target->bi_inum, target_snapshot, buf.buf)) {
2204+ target->bi_inum, target->bi_snapshot, buf.buf)) {
18772205 ret = __remove_dirent(trans, d.k->p);
18782206 goto out;
18792207 }
@@ -1886,10 +2214,10 @@ static int check_dirent_inode_dirent(struct btree_trans *trans, · 6 unmodified lines
18862214 if (fsck_err_on(backpointer_exists && !target->bi_nlink,
18872215 trans, inode_multiple_links_but_nlink_0,
18882216 "inode %llu:%u type %s has multiple links but i_nlink 0\n%s",
1889− target->bi_inum, target_snapshot, bch2_d_types[d.v->d_type], buf.buf)) {
2217+ target->bi_inum, target->bi_snapshot, bch2_d_types[d.v->d_type], buf.buf)) {
18902218 target->bi_nlink++;
18912219 target->bi_flags &= ~BCH_INODE_unlinked;
1892− ret = __bch2_fsck_write_inode(trans, target, target_snapshot);
2220+ ret = __bch2_fsck_write_inode(trans, target);
18932221 if (ret)
18942222 goto err;
18952223 }
@@ -1906,15 +2234,14 @@ noinline_for_stack · 10 unmodified lines
19062234 static int check_dirent_target(struct btree_trans *trans,
19072235 struct btree_iter *iter,
19082236 struct bkey_s_c_dirent d,
1909− struct bch_inode_unpacked *target,
1910− u32 target_snapshot)
2237+ struct bch_inode_unpacked *target)
19112238 {
19122239 struct bch_fs *c = trans->c;
19132240 struct bkey_i_dirent *n;

204 more 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+272−74

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

fs/bcachefs/inode.h+33−6

This diff is large: its 74 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+43−20

This diff is large: its 169 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/logged_ops.c+9−7

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

fs/bcachefs/logged_ops.h+1−1

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

fs/bcachefs/lru.c+20−14

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

fs/bcachefs/move.c+1−1

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

fs/bcachefs/movinggc.c+9−3

This diff is large: its 31 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+3−2

This diff is large: its 19 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+4−1

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

fs/bcachefs/sb-errors_format.h+24−17

This diff is large: its 125 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+15−8

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

fs/bcachefs/subvolume.h+2−0

This diff is large: its 9 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/util.c+1−1

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

fs/bcachefs/xattr.c+1−1

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

fs/btrfs/backref.c+8−4

This diff is large: its 19 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/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+12−1

This diff is large: its 27 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+16−15

This diff is large: its 62 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+7−5

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

fs/btrfs/messages.c+2−1

This diff is large: its 10 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/relocation.c+4−73

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

fs/btrfs/send.c+28−7

This diff is large: its 76 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.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/ceph/addr.c+5−2

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

fs/erofs/super.c+10−3

This diff is large: its 29 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/ext4/fast_commit.c+11−8

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

fs/ext4/resize.c+10−8

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

fs/ext4/xattr.c+2−1

This diff is large: its 17 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/file.c+34−61

This diff is large: its 172 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+36−75

This diff is large: its 159 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+5−3

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

fs/nfsd/localio.c+1−1

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

fs/nfsd/nfs4state.c+1−0

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

fs/nfsd/nfssvc.c+5−5

This diff is large: its 39 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+26−13

This diff is large: its 85 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+4−2

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

fs/notify/dnotify/dnotify.c+1−2

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

fs/notify/fanotify/fanotify_user.c+1−1

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

fs/notify/fsnotify.c+12−9

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

fs/notify/group.c+0−11

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

fs/notify/inotify/inotify_user.c+1−1

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

fs/notify/mark.c+6−2

This diff is large: its 22 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+6−3

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

fs/open.c+2−0

This diff is large: its 9 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/cifsacl.h+1−1

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

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

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

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

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

fs/smb/client/cifsglob.h+3−2

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

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

This diff is large: its 18 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/cifssmb.c+3−3

This diff is large: its 27 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/file.c+1−1

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

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

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

fs/smb/client/inode.c+7−1

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

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

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

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

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

fs/smb/client/readdir.c+2−2

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

fs/smb/client/reparse.c+198−5

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

fs/smb/client/sess.c+1−33

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

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

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

fs/smb/client/smb2inode.c+24−3

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

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

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

fs/smb/client/smb2ops.c+16−10

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

fs/smb/client/smb2pdu.c+11−2

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

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

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

fs/smb/client/smb2transport.c+30−2

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

fs/smb/client/smbdirect.c+2−2

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

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

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

fs/smb/common/smbfsctl.h+4−3

This diff is large: its 25 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/udf/balloc.c+25−13

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

fs/udf/directory.c+16−7

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

fs/udf/inode.c+134−68

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

fs/udf/partition.c+4−2

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

fs/udf/super.c+2−1

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

fs/udf/truncate.c+34−9

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

fs/udf/udfdecl.h+9−6

This diff is large: its 29 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/xfs/libxfs/xfs_alloc.c+2−5

This diff is large: its 34 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/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_file.c+88−58

This diff is large: its 186 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_iomap.c+46−21

This diff is large: its 125 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−1

This diff is large: its 9 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.

include/drm/gpu_scheduler.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_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/cpufreq.h+1−5

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

include/linux/fdtable.h+4−4

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

include/linux/fs.h+6−1

This diff is large: its 14 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/fsnotify_backend.h+3−7

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

include/linux/hdmi.h+9−0

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

include/linux/host1x.h+1−0

This diff is large: its 8 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/iomap.h+17−3

This diff is large: its 34 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/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/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/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/task_work.h+4−1

This diff is large: its 16 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/genetlink.h+1−2

This diff is large: its 15 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/sound/hdaudio.h+1−1

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

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

This diff is large: its 9 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/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.c+5−2

This diff is large: its 28 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/net.c+3−1

This diff is large: its 25 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+24−20

This diff is large: its 88 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/devmap.c+7−4

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

kernel/bpf/helpers.c+5−5

This diff is large: its 45 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/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+60−51

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

kernel/events/core.c+1−1

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

kernel/fork.c+14−18

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

kernel/freezer.c+6−1

This diff is large: its 14 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.c+5−4

This diff is large: its 17 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_kunit.c+14−4

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

kernel/sched/core.c+53−29

This diff is large: its 231 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+123−99

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

kernel/sched/fair.c+7−20

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

kernel/sched/sched.h+4−1

This diff is large: its 33 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+23−8

This diff is large: its 58 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+16−5

This diff is large: its 43 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_hwlat.c+2−0

This diff is large: its 9 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_osnoise.c+13−9

This diff is large: its 69 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/Kconfig.kasan+5−2

This diff is large: its 22 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/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+12−6

This diff is large: its 37 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/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/khugepaged.c+3−3

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

mm/memory.c+11−6

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

mm/mmap.c+21−11

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

mm/mremap.c+9−2

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

mm/secretmem.c+2−2

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

mm/shmem.c+1−6

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

mm/slab.h+7−1

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

mm/slab_common.c+3−2

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

mm/slub.c+3−2

This diff is large: its 26 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+5−4

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

mm/vmscan.c+2−2

This diff is large: its 11 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+9−3

This diff is large: its 19 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/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/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+29−0

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

net/core/sock_map.c+8−0

This diff is large: its 36 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/netfilter/nft_fib_ipv4.c+1−3

This diff is large: its 18 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/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/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+21−3

This diff is large: its 39 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/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/sch_api.c+6−1

This diff is large: its 21 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/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/nl80211.c+2−6

This diff is large: its 24 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.dtbs+3−1

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

scripts/include/list.h+50−0

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

scripts/kconfig/expr.c+1−0

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

scripts/kconfig/parser.y+8−2

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

scripts/kconfig/qconf.cc+3−3

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

scripts/package/builddeb+0−1

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

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

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

security/Kconfig.hardening+2−2

This diff is large: its 18 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.

security/tomoyo/Kconfig+0−15

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

security/tomoyo/Makefile+1−7

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

security/tomoyo/common.c+2−12

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

security/tomoyo/common.h+0−72

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

security/tomoyo/gc.c+0−3

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

security/tomoyo/init.c+0−366

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

security/tomoyo/load_policy.c+0−12

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

security/tomoyo/proxy.c+0−82

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

security/tomoyo/securityfs_if.c+3−7

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

security/tomoyo/tomoyo.crenamed from security/tomoyo/hooks.h+109−1

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

security/tomoyo/util.c+3−0

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

sound/Kconfig+1−1

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

sound/aoa/codecs/onyx.c+1−1

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

sound/aoa/codecs/tas.c+1−1

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

sound/core/compress_offload.c+1−1

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

sound/core/control.c+2−0

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

sound/core/init.c+10−4

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

sound/core/oss/mixer_oss.c+2−2

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

sound/core/oss/rate.c+1−1

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

sound/core/pcm_native.c+1−1

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

sound/core/sound.c+1−1

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

sound/hda/hdac_stream.c+6−1

This diff is large: its 35 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/isa/gus/gus_pcm.c+2−2

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

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

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

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

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

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

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

sound/pci/hda/hda_controller.h+1−1

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

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

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

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

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

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

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

sound/pci/hda/patch_conexant.c+46−13

This diff is large: its 122 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+84−4

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

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

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

sound/soc/amd/acp/acp-sdw-sof-mach.c+0−5

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

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

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

sound/soc/atmel/mchp-pdmc.c+3−0

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

sound/soc/codecs/cs35l45-tables.c+1−1

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

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

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

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

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

sound/soc/fsl/fsl_sai.c+4−1

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

sound/soc/fsl/fsl_sai.h+1−0

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

sound/soc/fsl/imx-card.c+1−0

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

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

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

sound/soc/intel/common/soc-acpi-intel-arl-match.c+2−0

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

sound/soc/intel/common/soc-acpi-intel-rpl-match.c+1−0

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

sound/soc/qcom/sm8250.c+1−0

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

sound/soc/soc-topology.c+2−2

This diff is large: its 18 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/podhd.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_scarlett2.c+2−0

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

sound/usb/quirks.c+4−0

This diff is large: its 18 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+2−0

This diff is large: its 16 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+2−0

This diff is large: its 9 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/uapi/linux/bpf.h+13−12

This diff is large: its 55 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/perf/Makefile.config+5−2

This diff is large: its 22 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+28−1

This diff is large: its 50 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/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/symbol.c+3−0

This diff is large: its 10 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+3−3

This diff is large: its 20 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/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/alsa/Makefile+4−0

This diff is large: its 10 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/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_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/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/breakpoints/step_after_suspend_test.c+4−1

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

tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c+0−2

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

tools/testing/selftests/core/.gitignore+1−0

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

tools/testing/selftests/devices/probe/test_discoverable_devices.py+2−2

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

tools/testing/selftests/exec/.gitignore+2−1

This diff is large: its 10 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+3−0

This diff is large: its 10 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/memslot_modification_stress_test.c+2−0

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

tools/testing/selftests/kvm/memslot_perf_test.c+6−0

This diff is large: its 35 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-common.c+3−2

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

tools/testing/selftests/mm/uffd-common.h+1−2

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

tools/testing/selftests/mm/uffd-unit-tests.c+15−6

This diff is large: its 65 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/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_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_vrf.sh+33−0

This diff is large: its 71 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/rtc/rtctest.c+10−1

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

tools/testing/selftests/sched_ext/Makefile+32−39

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

tools/testing/selftests/timers/posix_timers.c+8−4

This diff is large: its 22 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+39−45

This diff is large: its 207 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/tracing/rtla/Makefile.rtla+1−1

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

tools/tracing/rtla/src/osnoise_top.c+1−1

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

tools/tracing/rtla/src/timerlat_top.c+2−2

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

virt/kvm/kvm_main.c+1−13

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