History

Merge tag 'noinstr-lds-2020-05-19' into core/rcu

Get the noinstr section and annotation markers to base the RCU parts on.

Thomas Gleixner committed 6 years ago

Commit 1ed09482 parents 68f0f26 6553896886 files · +9233 −4559Browse files

Unified · Split

886 files
  1. .clang-format +14 −4
  2. Documentation/admin-guide/device-mapper/dm-integrity.rst +9 −6
  3. Documentation/admin-guide/kernel-parameters.txt +1 −2
  4. Documentation/arm64/amu.rst +26 −21
  5. Documentation/devicetree/bindings/Makefile +12 −9
  6. Documentation/devicetree/bindings/display/panel/leadtek,ltk500hd1829.yaml +0 −1
  7. Documentation/devicetree/bindings/display/panel/lvds.yaml +9 −1
  8. Documentation/devicetree/bindings/display/panel/xinpeng,xpp055c272.yaml +0 −1
  9. Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml +3 −4
  10. Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml +1 −1
  11. Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +0 −2
  12. Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml +3 −3
  13. Documentation/devicetree/bindings/regulator/mps,mp5416.yaml +0 −1
  14. Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml +2 −1
  15. Documentation/devicetree/bindings/regulator/rohm,bd71828-regulator.yaml +5 −1
  16. Documentation/devicetree/bindings/regulator/rohm,bd71837-regulator.yaml +5 −1
  17. Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml +5 −1
  18. Documentation/devicetree/bindings/sound/rockchip-i2s.yaml +3 −0
  19. Documentation/devicetree/bindings/sound/rockchip-spdif.txt +0 −45
  20. Documentation/devicetree/bindings/sound/rockchip-spdif.yaml +101 −0
  21. Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml +1 −0
  22. Documentation/devicetree/bindings/usb/renesas,usbhs.yaml +1 −0
  23. Documentation/devicetree/bindings/usb/usb-xhci.txt +2 −1
  24. Documentation/filesystems/debugfs.rst +2 −2
  25. Documentation/kbuild/makefiles.rst +2 −1
  26. Documentation/networking/devlink/ice.rst +2 −2
  27. Documentation/networking/ip-sysctl.txt +7 −0
  28. Documentation/virt/kvm/index.rst +2 −0
  29. Documentation/virt/kvm/running-nested-guests.rst +276 −0
  30. MAINTAINERS +42 −46
  31. Makefile +12 −5
  32. arch/arc/include/asm/module.h +0 −5
  33. arch/arc/include/asm/vermagic.h +8 −0
  34. arch/arm/boot/dts/bcm2835-rpi.dtsi +3 −0
  35. arch/arm/boot/dts/bcm283x.dtsi +1 −0
  36. arch/arm/boot/dts/omap3-n950-n9.dtsi +5 −0
  37. arch/arm/crypto/chacha-glue.c +11 −3
  38. arch/arm/crypto/nhpoly1305-neon-glue.c +1 −1
  39. arch/arm/crypto/poly1305-glue.c +11 −4
  40. arch/arm/include/asm/futex.h +7 −2
  41. arch/arm/include/asm/module.h +0 −24
  42. arch/arm/include/asm/vermagic.h +31 −0
  43. arch/arm/mach-imx/Makefile +2 −0
  44. arch/arm64/crypto/chacha-neon-glue.c +11 −3
  45. arch/arm64/crypto/nhpoly1305-neon-glue.c +1 −1
  46. arch/arm64/crypto/poly1305-glue.c +11 −4
  47. arch/arm64/include/asm/module.h +0 −2
  48. arch/arm64/include/asm/pointer_auth.h +6 −3
  49. arch/arm64/include/asm/vermagic.h +10 −0
  50. arch/arm64/kernel/vdso/Makefile +1 −1
  51. arch/arm64/kvm/guest.c +7 −0
  52. arch/arm64/kvm/hyp/entry.S +23 −0
  53. arch/arm64/kvm/hyp/hyp-entry.S +0 −1
  54. arch/arm64/kvm/hyp/sysreg-sr.c +3 −14
  55. arch/arm64/mm/hugetlbpage.c +2 −0
  56. arch/h8300/kernel/.gitignore +2 −0
  57. arch/hexagon/include/asm/vermagic.h +4 −4
  58. arch/ia64/include/asm/module.h +0 −4
  59. arch/ia64/include/asm/vermagic.h +15 −0
  60. arch/mips/include/asm/module.h +0 −61
  61. arch/mips/include/asm/vermagic.h +66 −0
  62. arch/nds32/include/asm/vermagic.h +3 −5
  63. arch/powerpc/include/asm/module.h +0 −18
  64. arch/powerpc/include/asm/vermagic.h +20 −0
  65. arch/powerpc/kernel/entry_32.S +1 −1
  66. arch/powerpc/kernel/setup_64.c +2 −0
  67. arch/powerpc/kernel/vmlinux.lds.S +1 −0
  68. arch/powerpc/kvm/book3s_64_mmu_hv.c +5 −4
  69. arch/powerpc/kvm/book3s_64_mmu_radix.c +5 −4
  70. arch/powerpc/kvm/powerpc.c +1 −0
  71. arch/powerpc/mm/nohash/8xx.c +3 −0
  72. arch/powerpc/platforms/Kconfig.cputype +1 −1
  73. arch/riscv/Kconfig +1 −1
  74. arch/riscv/include/asm/csr.h +0 −3
  75. arch/riscv/include/asm/hwcap.h +22 −0
  76. arch/riscv/include/asm/module.h +0 −2
  77. arch/riscv/include/asm/set_memory.h +0 −8
  78. arch/riscv/include/asm/vermagic.h +9 −0
  79. arch/riscv/kernel/cpu_ops.c +2 −2
  80. arch/riscv/kernel/cpufeature.c +80 −3
  81. arch/riscv/kernel/sbi.c +10 −7
  82. arch/riscv/kernel/smp.c +2 −0
  83. arch/riscv/kernel/stacktrace.c +2 −2
  84. arch/riscv/kernel/vdso/Makefile +4 −4
  85. arch/riscv/kernel/vdso/note.S +12 −0
  86. arch/riscv/mm/init.c +2 −17
  87. arch/s390/boot/uv.c +0 −2
  88. arch/s390/kernel/diag.c +1 −1
  89. arch/s390/kernel/smp.c +2 −2
  90. arch/s390/kernel/trace.c +1 −1
  91. arch/s390/kernel/uv.c +2 −1
  92. arch/s390/kvm/interrupt.c +1 −1
  93. arch/s390/kvm/kvm-s390.c +4 −0
  94. arch/s390/kvm/priv.c +3 −1
  95. arch/s390/lib/uaccess.c +4 −0
  96. arch/s390/mm/pgalloc.c +14 −2
  97. arch/s390/pci/pci_irq.c +3 −2
  98. arch/sh/include/asm/module.h +0 −28
  99. arch/sh/include/asm/vermagic.h +34 −0
  100. arch/sh/mm/init.c +1 −1
  101. arch/um/Makefile +1 −0
  102. arch/x86/Kconfig +1 −1
  103. arch/x86/crypto/blake2s-glue.c +4 −6
  104. arch/x86/crypto/chacha_glue.c +11 −3
  105. arch/x86/crypto/nhpoly1305-avx2-glue.c +1 −1
  106. arch/x86/crypto/nhpoly1305-sse2-glue.c +1 −1
  107. arch/x86/crypto/poly1305_glue.c +6 −7
  108. arch/x86/entry/calling.h +21 −19
  109. arch/x86/entry/entry_64.S +7 −7
  110. arch/x86/events/intel/cstate.c +1 −0
  111. arch/x86/hyperv/hv_init.c +10 −2
  112. arch/x86/include/asm/ftrace.h +3 −2
  113. arch/x86/include/asm/kvm_host.h +2 −2
  114. arch/x86/include/asm/module.h +0 −60
  115. arch/x86/include/asm/mshyperv.h +2 −0
  116. arch/x86/include/asm/nospec-branch.h +0 −21
  117. arch/x86/include/asm/unwind.h +1 −1
  118. arch/x86/include/asm/vermagic.h +68 −0
  119. arch/x86/kernel/apic/apic.c +14 −13
  120. arch/x86/kernel/dumpstack_64.c +2 −1
  121. arch/x86/kernel/smpboot.c +33 −14
  122. arch/x86/kernel/unwind_frame.c +3 −0
  123. arch/x86/kernel/unwind_orc.c +74 −39
  124. arch/x86/kvm/Makefile +4 −0
  125. arch/x86/kvm/ioapic.c +5 −5
  126. arch/x86/kvm/svm/sev.c +6 −2
  127. arch/x86/kvm/svm/svm.c +3 −9
  128. arch/x86/kvm/svm/vmenter.S +9 −1
  129. arch/x86/kvm/vmx/nested.c +20 −3
  130. arch/x86/kvm/vmx/vmenter.S +3 −0
  131. arch/x86/kvm/vmx/vmx.c +1 −1
  132. arch/x86/kvm/x86.c +25 −17
  133. arch/x86/mm/pat/set_memory.c +8 −4
  134. arch/x86/net/bpf_jit_comp.c +15 −3
  135. arch/x86/net/bpf_jit_comp32.c +22 −6
  136. arch/xtensa/include/asm/vermagic.h +6 −9
  137. block/bfq-iosched.c +4 −2
  138. block/blk-cgroup.c +1 −1
  139. block/blk-iocost.c +73 −48
  140. block/partitions/core.c +1 −1
  141. crypto/lrw.c +3 −3
  142. crypto/xts.c +3 −3
  143. drivers/acpi/button.c +0 −12
  144. drivers/acpi/device_pm.c +2 −2
  145. drivers/acpi/pci_link.c +2 −2
  146. drivers/amba/bus.c +1 −0
  147. drivers/ata/sata_inic162x.c +1 −1
  148. drivers/base/component.c +5 −3
  149. drivers/base/core.c +6 −1
  150. drivers/base/dd.c +8 −12
  151. drivers/base/firmware_loader/fallback_table.c +0 −1
  152. drivers/base/platform.c +2 −0
  153. drivers/base/power/main.c +1 −1
  154. drivers/block/null_blk.h +19 −10
  155. drivers/block/null_blk_main.c +31 −31
  156. drivers/block/null_blk_zoned.c +33 −12
  157. drivers/block/virtio_blk.c +79 −8
  158. drivers/bus/mhi/core/init.c +3 −4
  159. drivers/bus/mhi/core/internal.h +0 −3
  160. drivers/bus/mhi/core/main.c +5 −13
  161. drivers/bus/mhi/core/pm.c +5 −1
  162. drivers/char/hw_random/virtio-rng.c +1 −0
  163. drivers/char/tpm/tpm-interface.c +1 −1
  164. drivers/char/tpm/tpm2-cmd.c +1 −0
  165. drivers/char/tpm/tpm_ibmvtpm.c +73 −63
  166. drivers/char/tpm/tpm_tis_core.c +7 −1
  167. drivers/counter/104-quad-8.c +160 −34
  168. drivers/cpufreq/intel_pstate.c +1 −1
  169. drivers/crypto/caam/caamalg.c +7 −3
  170. drivers/crypto/caam/caamhash.c +6 −2
  171. drivers/crypto/caam/caampkc.c +6 −2
  172. drivers/crypto/chelsio/chcr_ktls.c +48 −41
  173. drivers/dma-buf/dma-buf.c +4 −3
  174. drivers/dma/Kconfig +2 −1
  175. drivers/dma/dmaengine.c +26 −34
  176. drivers/dma/dmatest.c +3 −3
  177. drivers/dma/mmp_tdma.c +4 −1
  178. drivers/dma/pch_dma.c +1 −1
  179. drivers/dma/tegra20-apb-dma.c +9 −0
  180. drivers/dma/ti/k3-psil.c +1 −0
  181. drivers/dma/xilinx/xilinx_dma.c +10 −10
  182. drivers/firmware/efi/tpm.c +1 −1
  183. drivers/firmware/imx/Kconfig +2 −2
  184. drivers/firmware/xilinx/zynqmp-debug.c +1 −1
  185. drivers/fpga/dfl-pci.c +4 −2
  186. drivers/fpga/zynq-fpga.c +2 −1
  187. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 −5
  188. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 −1
  189. drivers/gpu/drm/amd/amdgpu/navi10_sdma_pkt_open.h +16 −0
  190. drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +13 −1
  191. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +52 −17
  192. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +9 −6
  193. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +2 −1
  194. drivers/gpu/drm/amd/display/dc/core/dc.c +2 −3
  195. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +27 −0
  196. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +4 −36
  197. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 −0
  198. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +10 −0
  199. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 −0
  200. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +1 −0
  201. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +15 −0
  202. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h +14 −6
  203. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +12 −2
  204. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 −1
  205. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +1 −0
  206. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c +1 −0
  207. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.h +2 −1
  208. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +27 −8
  209. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +1 −0
  210. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +33 −44
  211. drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c +4 −4
  212. drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +16 −0
  213. drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 −0
  214. drivers/gpu/drm/amd/display/dc/os_types.h +1 −1
  215. drivers/gpu/drm/amd/powerplay/amd_powerplay.c +5 −4
  216. drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +26 −0
  217. drivers/gpu/drm/amd/powerplay/renoir_ppt.c +6 −1
  218. drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +3 −0
  219. drivers/gpu/drm/drm_dp_mst_topology.c +7 −2
  220. drivers/gpu/drm/drm_edid.c +1 −1
  221. drivers/gpu/drm/drm_hdcp.c +7 −1
  222. drivers/gpu/drm/i915/display/intel_ddi.c +11 −3
  223. drivers/gpu/drm/i915/display/intel_display_power.c +6 −6
  224. drivers/gpu/drm/i915/display/intel_dp.c +2 −3
  225. drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 −0
  226. drivers/gpu/drm/i915/display/intel_hdmi.c +2 −1
  227. drivers/gpu/drm/i915/display/intel_sprite.c +12 −5
  228. drivers/gpu/drm/i915/gem/i915_gem_tiling.c +18 −2
  229. drivers/gpu/drm/i915/gem/selftests/huge_pages.c +8 −4
  230. drivers/gpu/drm/i915/gt/intel_rps.c +6 −3
  231. drivers/gpu/drm/i915/gt/intel_timeline.c +2 −0
  232. drivers/gpu/drm/i915/i915_drv.h +2 −0
  233. drivers/gpu/drm/i915/i915_irq.c +2 −4
  234. drivers/gpu/drm/i915/i915_reg.h +2 −2
  235. drivers/gpu/drm/i915/i915_vma.c +6 −4
  236. drivers/gpu/drm/ingenic/ingenic-drm.c +1 −0
  237. drivers/gpu/drm/meson/meson_dw_hdmi.c +1 −3
  238. drivers/gpu/drm/qxl/qxl_cmd.c +5 −5
  239. drivers/gpu/drm/qxl/qxl_display.c +3 −3
  240. drivers/gpu/drm/qxl/qxl_draw.c +4 −3
  241. drivers/gpu/drm/qxl/qxl_image.c +2 −1
  242. drivers/gpu/drm/qxl/qxl_ioctl.c +1 −4
  243. drivers/gpu/drm/scheduler/sched_main.c +1 −1
  244. drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +1 −1
  245. drivers/gpu/drm/tidss/tidss_crtc.c +13 −3
  246. drivers/gpu/drm/tidss/tidss_encoder.c +11 −3
  247. drivers/gpu/drm/tidss/tidss_plane.c +18 −6
  248. drivers/gpu/drm/virtio/virtgpu_drv.h +1 −0
  249. drivers/gpu/drm/virtio/virtgpu_gem.c +3 −0
  250. drivers/gpu/drm/virtio/virtgpu_ioctl.c +2 −2
  251. drivers/gpu/drm/virtio/virtgpu_kms.c +7 −11
  252. drivers/hid/Kconfig +1 −0
  253. drivers/hid/hid-alps.c +1 −0
  254. drivers/hid/hid-ids.h +7 −1
  255. drivers/hid/hid-lg-g15.c +4 −0
  256. drivers/hid/hid-multitouch.c +3 −0
  257. drivers/hid/hid-quirks.c +1 −0
  258. drivers/hid/i2c-hid/i2c-hid-core.c +2 −0
  259. drivers/hid/usbhid/hid-core.c +29 −8
  260. drivers/hid/usbhid/usbhid.h +1 −0
  261. drivers/hid/wacom_sys.c +3 −1
  262. drivers/hid/wacom_wac.c +22 −66
  263. drivers/hv/hv.c +1 −5
  264. drivers/hv/hv_trace.h +2 −2
  265. drivers/hv/vmbus_drv.c +34 −9
  266. drivers/i2c/busses/i2c-amd-mp2-pci.c +1 −1
  267. drivers/i2c/busses/i2c-aspeed.c +4 −1
  268. drivers/i2c/busses/i2c-bcm-iproc.c +3 −0
  269. drivers/i2c/busses/i2c-tegra.c +12 −24
  270. drivers/iio/adc/ad7192.c +47 −16
  271. drivers/iio/adc/ad7793.c +1 −1
  272. drivers/iio/adc/stm32-adc.c +28 −3
  273. drivers/iio/adc/ti-ads8344.c +3 −3
  274. drivers/iio/adc/xilinx-xadc-core.c +74 −21
  275. drivers/iio/common/st_sensors/st_sensors_core.c +1 −1
  276. drivers/iio/dac/ad5770r.c +1 −1
  277. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +10 −1
  278. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +3 −0
  279. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +16 −7
  280. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +23 −1
  281. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c +22 −7
  282. drivers/iio/industrialio-core.c +2 −5
  283. drivers/infiniband/core/cm.c +14 −12
  284. drivers/infiniband/core/rdma_core.c +4 −5
  285. drivers/infiniband/core/uverbs_main.c +4 −0
  286. drivers/infiniband/hw/i40iw/i40iw_ctrl.c +1 −1
  287. drivers/infiniband/hw/mlx4/main.c +2 −1
  288. drivers/infiniband/hw/mlx5/qp.c +3 −1
  289. drivers/infiniband/sw/rdmavt/cq.c +2 −2
  290. drivers/infiniband/sw/rdmavt/mmap.c +2 −2
  291. drivers/infiniband/sw/rdmavt/qp.c +2 −2
  292. drivers/infiniband/sw/rdmavt/srq.c +2 −2
  293. drivers/infiniband/sw/siw/siw_qp_tx.c +11 −4
  294. drivers/interconnect/qcom/bcm-voter.c +3 −2
  295. drivers/interconnect/qcom/osm-l3.c +2 −2
  296. drivers/interconnect/qcom/sdm845.c +8 −8
  297. drivers/iommu/Kconfig +2 −2
  298. drivers/iommu/amd_iommu.c +154 −44
  299. drivers/iommu/amd_iommu_init.c +1 −1
  300. drivers/iommu/amd_iommu_types.h +7 −2
  301. drivers/iommu/intel-iommu.c +2 −2
  302. drivers/iommu/iommu.c +2 −1
  303. drivers/iommu/qcom_iommu.c +4 −1
  304. drivers/iommu/virtio-iommu.c +1 −1
  305. drivers/md/dm-mpath.c +4 −2
  306. drivers/md/dm-verity-fec.c +1 −1
  307. drivers/md/dm-writecache.c +37 −15
  308. drivers/misc/mei/hw-me.c +8 −0
  309. drivers/misc/mei/hw-me.h +4 −0
  310. drivers/misc/mei/pci-me.c +3 −2
  311. drivers/misc/mic/Kconfig +1 −1
  312. drivers/mmc/core/mmc_ops.c +1 −1
  313. drivers/mmc/host/cqhci.c +10 −11
  314. drivers/mmc/host/meson-mx-sdio.c +1 −10
  315. drivers/mmc/host/sdhci-msm.c +2 −0
  316. drivers/mmc/host/sdhci-pci-core.c +3 −0
  317. drivers/mmc/host/sdhci-xenon.c +10 −0
  318. drivers/most/core.c +1 −1
  319. drivers/net/caif/Kconfig +1 −1
  320. drivers/net/dsa/b53/b53_common.c +33 −5
  321. drivers/net/dsa/b53/b53_regs.h +6 −2
  322. drivers/net/dsa/mv88e6xxx/Kconfig +1 −1
  323. drivers/net/dsa/mv88e6xxx/chip.c +0 −4
  324. drivers/net/dsa/ocelot/felix.c +1 −0
  325. drivers/net/dsa/ocelot/felix.h +1 −0
  326. drivers/net/dsa/ocelot/felix_vsc9959.c +1 −0
  327. drivers/net/dsa/sja1105/Kconfig +1 −0
  328. drivers/net/dsa/sja1105/sja1105_ptp.c +18 −8
  329. drivers/net/ethernet/amazon/ena/ena_netdev.h +1 −1
  330. drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +1 −1
  331. drivers/net/ethernet/broadcom/bcmsysport.c +2 −2
  332. drivers/net/ethernet/broadcom/bgmac-platform.c +2 −7
  333. drivers/net/ethernet/broadcom/bnxt/bnxt.c +13 −7
  334. drivers/net/ethernet/broadcom/bnxt/bnxt.h +0 −1
  335. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h +1 −1
  336. drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +2 −8
  337. drivers/net/ethernet/broadcom/genet/bcmgenet.c +5 −1
  338. drivers/net/ethernet/cadence/Kconfig +1 −1
  339. drivers/net/ethernet/cadence/macb_main.c +12 −12
  340. drivers/net/ethernet/cavium/Kconfig +1 −1
  341. drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +20 −7
  342. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +6 −21
  343. drivers/net/ethernet/chelsio/cxgb4/sge.c +37 −3
  344. drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +3 −0
  345. drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +1 −1
  346. drivers/net/ethernet/ibm/ibmvnic.c +2 −1
  347. drivers/net/ethernet/intel/e1000/e1000_main.c +1 −1
  348. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −2
  349. drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +3 −0
  350. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 −0
  351. drivers/net/ethernet/mellanox/mlx4/en_tx.c +13 −1
  352. drivers/net/ethernet/mellanox/mlx4/main.c +3 −1
  353. drivers/net/ethernet/mellanox/mlx5/core/Kconfig +4 −4
  354. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +5 −1
  355. drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +3 −3
  356. drivers/net/ethernet/mellanox/mlx5/core/en.h +2 −1
  357. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +12 −11
  358. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c +3 −0
  359. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +6 −1
  360. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +2 −7
  361. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +5 −3
  362. drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +5 −1
  363. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +9 −9
  364. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +13 −1
  365. drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c +2 −2
  366. drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c +2 −2
  367. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +1 −1
  368. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +10 −2
  369. drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +2 −1
  370. drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +2 −2
  371. drivers/net/ethernet/moxa/moxart_ether.c +1 −1
  372. drivers/net/ethernet/mscc/ocelot.c +11 −6
  373. drivers/net/ethernet/mscc/ocelot_regs.c +1 −0
  374. drivers/net/ethernet/natsemi/jazzsonic.c +4 −2
  375. drivers/net/ethernet/netronome/nfp/abm/main.c +1 −0
  376. drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +1 −2
  377. drivers/net/ethernet/pensando/ionic/ionic_lif.c +2 −2
  378. drivers/net/ethernet/sgi/meth.h +0 −16
  379. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +189 −0
  380. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h +23 −0
  381. drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +1 −0
  382. drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +6 −3
  383. drivers/net/ethernet/stmicro/stmmac/dwmac5.c +1 −1
  384. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +8 −4
  385. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +26 −6
  386. drivers/net/ethernet/ti/Kconfig +1 −2
  387. drivers/net/ethernet/ti/am65-cpsw-nuss.c +3 −2
  388. drivers/net/ethernet/toshiba/tc35815.c +1 −1
  389. drivers/net/ethernet/xscale/ixp4xx_eth.c +2 −0
  390. drivers/net/geneve.c +1 −1
  391. drivers/net/gtp.c +5 −4
  392. drivers/net/hyperv/netvsc_drv.c +2 −1
  393. drivers/net/ipa/gsi.c +9 −2
  394. drivers/net/ipa/gsi_reg.h +2 −0
  395. drivers/net/ipa/ipa_endpoint.c +2 −5
  396. drivers/net/macsec.c +12 −6
  397. drivers/net/macvlan.c +1 −1
  398. drivers/net/phy/bcm84881.c +3 −3
  399. drivers/net/phy/dp83640.c +1 −1
  400. drivers/net/phy/dp83822.c +14 −16
  401. drivers/net/phy/dp83tc811.c +12 −9
  402. drivers/net/phy/marvell10g.c +28 −2
  403. drivers/net/phy/microchip_t1.c +171 −0
  404. drivers/net/team/team.c +4 −0
  405. drivers/net/usb/qmi_wwan.c +1 −0
  406. drivers/net/vrf.c +6 −4
  407. drivers/net/vxlan.c +3 −3
  408. drivers/net/wimax/i2400m/usb-fw.c +1 −0
  409. drivers/net/wireguard/queueing.c +3 −1
  410. drivers/net/wireguard/receive.c +10 −11
  411. drivers/net/wireguard/selftest/ratelimiter.c +2 −2
  412. drivers/net/wireguard/send.c +10 −10
  413. drivers/net/wireguard/socket.c +0 −12
  414. drivers/net/wireless/intel/iwlegacy/3945-rs.c +1 −1
  415. drivers/net/wireless/intel/iwlegacy/4965-rs.c +1 −1
  416. drivers/net/wireless/intel/iwlwifi/dvm/rs.c +1 −1
  417. drivers/net/wireless/intel/iwlwifi/fw/acpi.c +7 −2
  418. drivers/net/wireless/intel/iwlwifi/fw/api/txq.h +3 −3
  419. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1 −1
  420. drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +2 −4
  421. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +11 −14
  422. drivers/net/wireless/intel/iwlwifi/mvm/rs.c +1 −1
  423. drivers/net/wireless/intel/iwlwifi/mvm/rx.c +11 −2
  424. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +7 −2
  425. drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +14 −4
  426. drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +3 −0
  427. drivers/net/wireless/mac80211_hwsim.c +1 −1
  428. drivers/net/wireless/realtek/rtlwifi/rc.c +1 −1
  429. drivers/nvme/host/core.c +3 −1
  430. drivers/nvme/host/pci.c +5 −1
  431. drivers/pci/quirks.c +7 −0
  432. drivers/phy/qualcomm/phy-qcom-qusb2.c +7 −0
  433. drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c +21 −11
  434. drivers/phy/tegra/Kconfig +2 −1
  435. drivers/platform/chrome/cros_ec_sensorhub.c +46 −34
  436. drivers/platform/chrome/cros_ec_sensorhub_ring.c +46 −27
  437. drivers/platform/x86/asus-nb-wmi.c +24 −0
  438. drivers/platform/x86/intel-uncore-frequency.c +1 −1
  439. drivers/platform/x86/intel_pmc_core.c +5 −19
  440. drivers/platform/x86/intel_pmc_core.h +0 −2
  441. drivers/platform/x86/surface3_power.c +2 −2
  442. drivers/platform/x86/thinkpad_acpi.c +1 −1
  443. drivers/platform/x86/xiaomi-wmi.c +2 −2
  444. drivers/ptp/ptp_ines.c +2 −2
  445. drivers/regulator/core.c +11 −14
  446. drivers/remoteproc/mtk_common.h +1 −1
  447. drivers/remoteproc/mtk_scp.c +3 −3
  448. drivers/remoteproc/qcom_q6v5_mss.c +20 −13
  449. drivers/remoteproc/remoteproc_sysfs.c +1 −0
  450. drivers/remoteproc/stm32_rproc.c +1 −0
  451. drivers/rpmsg/mtk_rpmsg.c +1 −0
  452. drivers/s390/net/qeth_core_main.c +5 −5
  453. drivers/scsi/Kconfig +1 −1
  454. drivers/scsi/ibmvscsi/ibmvfc.c +5 −0
  455. drivers/scsi/ibmvscsi/ibmvscsi.c +0 −4
  456. drivers/scsi/qla2xxx/qla_attr.c +1 −1
  457. drivers/scsi/qla2xxx/qla_mbx.c +1 −1
  458. drivers/scsi/qla2xxx/qla_os.c +17 −18
  459. drivers/scsi/scsi_lib.c +1 −0
  460. drivers/scsi/sg.c +3 −1
  461. drivers/soc/fsl/dpio/dpio-service.c +14 −5
  462. drivers/soc/fsl/dpio/qbman-portal.c +2 −4
  463. drivers/soc/imx/Kconfig +1 −0
  464. drivers/soc/xilinx/Kconfig +2 −2
  465. drivers/staging/comedi/comedi_fops.c +3 −1
  466. drivers/staging/comedi/drivers/dt2815.c +3 −0
  467. drivers/staging/gasket/apex_driver.c +0 −7
  468. drivers/staging/gasket/gasket_core.c +4 −0
  469. drivers/staging/gasket/gasket_sysfs.c +1 −2
  470. drivers/staging/gasket/gasket_sysfs.h +0 −4
  471. drivers/staging/ks7010/TODO +0 −1
  472. drivers/staging/vt6656/key.c +3 −11
  473. drivers/staging/vt6656/main_usb.c +17 −14
  474. drivers/staging/vt6656/usbpipe.c +2 −1
  475. drivers/target/target_core_iblock.c +1 −1
  476. drivers/thunderbolt/usb4.c +3 −0
  477. drivers/tty/hvc/Kconfig +1 −1
  478. drivers/tty/hvc/hvc_console.c +14 −9
  479. drivers/tty/rocket.c +14 −11
  480. drivers/tty/serial/Kconfig +1 −1
  481. drivers/tty/serial/owl-uart.c +7 −0
  482. drivers/tty/serial/sh-sci.c +10 −3
  483. drivers/tty/serial/sunhv.c +3 −0
  484. drivers/tty/serial/xilinx_uartps.c +50 −162
  485. drivers/tty/sysrq.c +2 −0
  486. drivers/tty/vt/vt.c +10 −4
  487. drivers/usb/chipidea/ci_hdrc_msm.c +1 −1
  488. drivers/usb/class/cdc-acm.c +31 −5
  489. drivers/usb/class/cdc-acm.h +4 −1
  490. drivers/usb/core/devio.c +2 −3
  491. drivers/usb/core/hub.c +15 −3
  492. drivers/usb/core/message.c +10 −3
  493. drivers/usb/core/quirks.c +4 −0
  494. drivers/usb/dwc3/core.h +6 −2
  495. drivers/usb/dwc3/gadget.c +47 −29
  496. drivers/usb/early/xhci-dbc.c +4 −4
  497. drivers/usb/early/xhci-dbc.h +16 −2
  498. drivers/usb/gadget/function/f_fs.c +4 −0
  499. drivers/usb/gadget/legacy/raw_gadget.c +42 −29
  500. drivers/usb/gadget/udc/atmel_usba_udc.c +2 −2
  501. drivers/usb/gadget/udc/bdc/bdc_ep.c +1 −1
  502. drivers/usb/host/xhci-hub.c +9 −0
  503. drivers/usb/host/xhci-ring.c +40 −6
  504. drivers/usb/host/xhci.c +7 −7
  505. drivers/usb/host/xhci.h +3 −2
  506. drivers/usb/misc/sisusbvga/sisusb.c +10 −10
  507. drivers/usb/misc/sisusbvga/sisusb_init.h +7 −7
  508. drivers/usb/serial/garmin_gps.c +2 −2
  509. drivers/usb/serial/qcserial.c +1 −0
  510. drivers/usb/storage/uas.c +43 −3
  511. drivers/usb/storage/unusual_devs.h +7 −0
  512. drivers/usb/storage/unusual_uas.h +7 −0
  513. drivers/usb/typec/bus.c +4 −1
  514. drivers/usb/typec/mux/intel_pmc_mux.c +6 −2
  515. drivers/usb/typec/mux/pi3usb30532.c +2 −2
  516. drivers/usb/typec/tcpm/tcpm.c +26 −0
  517. drivers/vdpa/Kconfig +6 −12
  518. drivers/vdpa/ifcvf/ifcvf_base.c +0 −2
  519. drivers/vdpa/ifcvf/ifcvf_main.c +1 −3
  520. drivers/vdpa/vdpa.c +1 −1
  521. drivers/vdpa/vdpa_sim/vdpa_sim.c +2 −2
  522. drivers/vfio/vfio_iommu_type1.c +5 −5
  523. drivers/vhost/Kconfig +16 −5
  524. drivers/vhost/net.c +15 −13
  525. drivers/vhost/scsi.c +7 −7
  526. drivers/vhost/test.c +7 −7
  527. drivers/vhost/vdpa.c +0 −5
  528. drivers/vhost/vhost.h +27 −0
  529. drivers/vhost/vringh.c +5 −0
  530. drivers/vhost/vsock.c +23 −12
  531. drivers/virtio/Kconfig +1 −1
  532. drivers/virtio/virtio_balloon.c +2 −2
  533. drivers/virtio/virtio_input.c +1 −0
  534. fs/afs/cmservice.c +1 −1
  535. fs/afs/fs_probe.c +1 −4
  536. fs/afs/internal.h +1 −3
  537. fs/afs/rotate.c +3 −3
  538. fs/afs/server.c +2 −5
  539. fs/afs/vl_rotate.c +2 −2
  540. fs/afs/volume.c +5 −3
  541. fs/block_dev.c +10 −1
  542. fs/btrfs/backref.c +1 −1
  543. fs/btrfs/block-group.c +14 −6
  544. fs/btrfs/discard.h +1 −1
  545. fs/btrfs/disk-io.c +32 −4
  546. fs/btrfs/relocation.c +1 −0
  547. fs/btrfs/transaction.c +11 −2
  548. fs/btrfs/tree-log.c +40 −3
  549. fs/buffer.c +1 −1
  550. fs/ceph/caps.c +2 −1
  551. fs/ceph/debugfs.c +1 −1
  552. fs/ceph/mds_client.c +3 −5
  553. fs/ceph/quota.c +2 −2
  554. fs/cifs/cifsglob.h +2 −1
  555. fs/cifs/connect.c +6 −0
  556. fs/cifs/misc.c +65 −17
  557. fs/cifs/smb2ops.c +5 −0
  558. fs/configfs/dir.c +1 −0
  559. fs/coredump.c +10 −0
  560. fs/debugfs/file.c +3 −12
  561. fs/eventpoll.c +33 −28
  562. fs/exfat/balloc.c +0 −3
  563. fs/exfat/exfat_fs.h +1 −0
  564. fs/exfat/file.c +2 −0
  565. fs/exfat/misc.c +13 −1
  566. fs/exfat/namei.c +7 −0
  567. fs/exfat/super.c +22 −31
  568. fs/io_uring.c +58 −75
  569. fs/ioctl.c +8 −0
  570. fs/iomap/fiemap.c +1 −4
  571. fs/nfs/nfs3acl.c +15 −7
  572. fs/nfs/nfs4proc.c +9 −2
  573. fs/nfs/pnfs.c +5 −6
  574. fs/nfs/super.c +1 −1
  575. fs/nfsd/nfs4callback.c +3 −1
  576. fs/nfsd/nfs4state.c +2 −0
  577. fs/ocfs2/dlmfs/dlmfs.c +12 −15
  578. fs/pnode.c +4 −5
  579. fs/proc/base.c +0 −1
  580. fs/proc/vmcore.c +3 −2
  581. fs/splice.c +18 −27
  582. fs/super.c +1 −1
  583. fs/vboxsf/super.c +1 −1
  584. include/asm-generic/Kbuild +1 −0
  585. include/asm-generic/sections.h +3 −0
  586. include/asm-generic/vermagic.h +7 −0
  587. include/asm-generic/vmlinux.lds.h +10 −0
  588. include/linux/amba/bus.h +1 −0
  589. include/linux/backing-dev-defs.h +1 −1
  590. include/linux/backing-dev.h +1 −8
  591. include/linux/compiler.h +53 −0
  592. include/linux/compiler_types.h +4 −0
  593. include/linux/debugfs.h +4 −8
  594. include/linux/dma-buf.h +1 −2
  595. include/linux/dmaengine.h +6 −6
  596. include/linux/fs.h +1 −1
  597. include/linux/iio/iio.h +1 −1
  598. include/linux/kvm_host.h +1 −1
  599. include/linux/lsm_hook_defs.h +1 −1
  600. include/linux/mhi.h +10 −6
  601. include/linux/nfs_xdr.h +2 −0
  602. include/linux/platform_data/cros_ec_sensorhub.h +1 −0
  603. include/linux/platform_device.h +1 −0
  604. include/linux/pnp.h +9 −20
  605. include/linux/stmmac.h +2 −0
  606. include/linux/sunrpc/clnt.h +12 −1
  607. include/linux/sunrpc/svc_rdma.h +1 −0
  608. include/linux/tcp.h +0 −51
  609. include/linux/tracepoint.h +1 −21
  610. include/linux/tty.h +1 −1
  611. include/linux/vdpa.h +1 −1
  612. include/linux/vermagic.h +5 −3
  613. include/linux/virtio.h +0 −1
  614. include/linux/virtio_net.h +24 −2
  615. include/linux/virtio_vsock.h +1 −0
  616. include/linux/vmalloc.h +1 −1
  617. include/linux/vringh.h +6 −0
  618. include/net/flow_offload.h +8 −1
  619. include/net/inet_ecn.h +55 −2
  620. include/net/ip6_fib.h +4 −0
  621. include/net/mac80211.h +3 −1
  622. include/net/mptcp.h +0 −3
  623. include/net/ndisc.h +1 −1
  624. include/net/net_namespace.h +7 −0
  625. include/net/sch_generic.h +1 −0
  626. include/net/tcp.h +1 −1
  627. include/soc/mscc/ocelot.h +1 −0
  628. include/soc/tegra/pmc.h +9 −6
  629. include/sound/soc-dai.h +0 −1
  630. include/sound/soc.h +3 −0
  631. include/trace/events/gpu_mem.h +1 −1
  632. include/trace/events/iocost.h +3 −3
  633. include/trace/events/rpcrdma.h +40 −22
  634. include/trace/events/wbt.h +4 −4
  635. include/trace/events/writeback.h +0 −1
  636. include/uapi/drm/amdgpu_drm.h +4 −0
  637. include/uapi/linux/bpf.h +2 −2
  638. include/uapi/linux/dlm_device.h +2 −2
  639. include/uapi/linux/dma-buf.h +6 −0
  640. include/uapi/linux/fiemap.h +1 −1
  641. include/uapi/linux/hyperv.h +2 −2
  642. include/uapi/linux/if_arcnet.h +3 −3
  643. include/uapi/linux/mmc/ioctl.h +1 −1
  644. include/uapi/linux/net_dropmon.h +2 −2
  645. include/uapi/linux/netfilter_bridge/ebt_among.h +1 −1
  646. include/uapi/linux/virtio_balloon.h +9 −2
  647. include/uapi/scsi/scsi_bsg_fc.h +1 −1
  648. include/vdso/datapage.h +2 −2
  649. init/Kconfig +0 −18
  650. init/initramfs.c +1 −1
  651. init/main.c +52 −17
  652. ipc/mqueue.c +26 −8
  653. kernel/audit.c +3 −0
  654. kernel/bpf/cpumap.c +1 −1
  655. kernel/bpf/syscall.c +10 −3
  656. kernel/bpf/verifier.c +28 −10
  657. kernel/events/core.c +10 −3
  658. kernel/exit.c +1 −0
  659. kernel/kcov.c +2 −2
  660. kernel/power/hibernate.c +7 −0
  661. kernel/sched/core.c +2 −7
  662. kernel/signal.c +5 −1
  663. kernel/trace/Kconfig +0 −1
  664. kernel/trace/ftrace.c +1 −0
  665. kernel/trace/preemptirq_delay_test.c +24 −6
  666. kernel/trace/trace.c +15 −1
  667. kernel/trace/trace_boot.c +8 −12
  668. kernel/trace/trace_events_hist.c +7 −0
  669. kernel/trace/trace_kprobe.c +7 −1
  670. kernel/trace/tracing_map.c +3 −3
  671. kernel/umh.c +5 −0
  672. lib/Kconfig.ubsan +6 −9
  673. lib/kunit/test.c +1 −1
  674. lib/mpi/longlong.h +17 −17
  675. mm/backing-dev.c +11 −2
  676. mm/gup.c +1 −1
  677. mm/hugetlb.c +8 −6
  678. mm/ksm.c +10 −2
  679. mm/madvise.c +18 −0
  680. mm/memcontrol.c +9 −6
  681. mm/page_alloc.c +9 −0
  682. mm/percpu.c +10 −4
  683. mm/shmem.c +8 −5
  684. mm/slub.c +40 −17
  685. mm/vmalloc.c +13 −3
  686. mm/vmscan.c +0 −1
  687. net/atm/common.c +11 −11
  688. net/atm/lec.c +6 −0
  689. net/batman-adv/bat_v_ogm.c +1 −1
  690. net/batman-adv/network-coding.c +1 −8
  691. net/batman-adv/sysfs.c +2 −1
  692. net/bridge/br_netlink.c +1 −0
  693. net/core/devlink.c +10 −2
  694. net/core/drop_monitor.c +7 −4
  695. net/core/neighbour.c +3 −3
  696. net/core/netclassid_cgroup.c +1 −3
  697. net/core/sock.c +0 −1
  698. net/dsa/dsa2.c +1 −1
  699. net/dsa/master.c +2 −1
  700. net/dsa/slave.c +6 −10
  701. net/hsr/hsr_slave.c +1 −1
  702. net/ipv4/fib_semantics.c +3 −3
  703. net/ipv4/tcp_input.c +0 −7
  704. net/ipv4/xfrm4_output.c +0 −2
  705. net/ipv6/ipv6_sockglue.c +6 −7
  706. net/ipv6/route.c +25 −0
  707. net/ipv6/rpl.c +4 −3
  708. net/ipv6/seg6.c +8 −2
  709. net/ipv6/xfrm6_output.c +0 −2
  710. net/mac80211/main.c +3 −2
  711. net/mac80211/rate.c +4 −11
  712. net/mac80211/rate.h +23 −0
  713. net/mac80211/rc80211_minstrel_ht.c +13 −6
  714. net/mac80211/sta_info.c +2 −1
  715. net/mptcp/options.c +41 −55
  716. net/mptcp/pm_netlink.c +7 −5
  717. net/mptcp/protocol.c +20 −10
  718. net/mptcp/protocol.h +44 −5
  719. net/mptcp/subflow.c +119 −52
  720. net/netfilter/nf_flow_table_core.c +4 −2
  721. net/netfilter/nf_nat_proto.c +3 −5
  722. net/netfilter/nfnetlink_osf.c +7 −5
  723. net/netlabel/Kconfig +1 −1
  724. net/netrom/nr_route.c +1 −0
  725. net/openvswitch/conntrack.c +2 −1
  726. net/openvswitch/datapath.c +3 −1
  727. net/sched/cls_api.c +16 −6
  728. net/sched/sch_choke.c +2 −1
  729. net/sched/sch_etf.c +4 −3
  730. net/sched/sch_fq_codel.c +1 −1
  731. net/sched/sch_sfq.c +9 −0
  732. net/sched/sch_skbprio.c +3 −0
  733. net/sctp/sm_make_chunk.c +5 −1
  734. net/sctp/sm_statefuns.c +3 −3
  735. net/sunrpc/cache.c +3 −2
  736. net/sunrpc/clnt.c +18 −6
  737. net/sunrpc/svc_xprt.c +2 −3
  738. net/sunrpc/svcsock.c +4 −0
  739. net/sunrpc/xprtrdma/rpc_rdma.c +11 −4
  740. net/sunrpc/xprtrdma/svc_rdma_backchannel.c +2 −0
  741. net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +22 −0
  742. net/sunrpc/xprtrdma/svc_rdma_rw.c +1 −2
  743. net/sunrpc/xprtrdma/svc_rdma_sendto.c +12 −17
  744. net/sunrpc/xprtrdma/svc_rdma_transport.c +0 −5
  745. net/sunrpc/xprtrdma/verbs.c +2 −1
  746. net/sunrpc/xprtsock.c +1 −0
  747. net/tipc/crypto.c +1 −0
  748. net/tipc/node.c +3 −1
  749. net/tipc/topsrv.c +3 −2
  750. net/tls/tls_sw.c +5 −2
  751. net/vmw_vsock/virtio_transport_common.c +4 −0
  752. net/x25/x25_dev.c +3 −1
  753. net/x25/x25_subr.c +6 −0
  754. samples/trace_events/trace-events-sample.h +1 −1
  755. samples/vfio-mdev/mdpy.c +1 −1
  756. scripts/Makefile.lib +1 −1
  757. scripts/checkpatch.pl +1 −1
  758. scripts/config +4 −1
  759. scripts/decodecode +1 −1
  760. scripts/gcc-plugins/Makefile +1 −0
  761. scripts/gcc-plugins/gcc-common.h +4 −0
  762. scripts/gcc-plugins/stackleak_plugin.c +2 −3
  763. scripts/gdb/linux/rbtree.py +2 −2
  764. scripts/kallsyms.c +1 −1
  765. scripts/mod/modpost.c +1 −1
  766. security/selinux/hooks.c +45 −25
  767. security/selinux/ss/conditional.c +1 −1
  768. sound/core/oss/pcm_plugin.c +6 −4
  769. sound/isa/opti9xx/miro.c +6 −3
  770. sound/isa/opti9xx/opti92x-ad1848.c +6 −3
  771. sound/pci/hda/hda_codec.c +17 −11
  772. sound/pci/hda/hda_intel.c +7 −20
  773. sound/pci/hda/patch_hdmi.c +14 −1
  774. sound/pci/hda/patch_realtek.c +9 −3
  775. sound/soc/amd/acp3x-rt5682-max9836.c +3 −3
  776. sound/soc/codecs/Kconfig +3 −0
  777. sound/soc/codecs/hdac_hdmi.c +3 −3
  778. sound/soc/codecs/madera.c +0 −4
  779. sound/soc/codecs/sgtl5000.c +34 −0
  780. sound/soc/codecs/sgtl5000.h +1 −0
  781. sound/soc/codecs/tas571x.c +15 −5
  782. sound/soc/codecs/wm8960.c +1 −2
  783. sound/soc/codecs/wsa881x.c +4 −0
  784. sound/soc/intel/common/soc-acpi-intel-cml-match.c +0 −8
  785. sound/soc/intel/common/soc-acpi-intel-icl-match.c +0 −8
  786. sound/soc/meson/axg-card.c +3 −1
  787. sound/soc/meson/gx-card.c +3 −1
  788. sound/soc/qcom/apq8096.c +1 −3
  789. sound/soc/qcom/qdsp6/q6afe-dai.c +16 −0
  790. sound/soc/qcom/sdm845.c +1 −3
  791. sound/soc/samsung/s3c-i2s-v2.c +0 −57
  792. sound/soc/samsung/s3c2412-i2s.c +56 −0
  793. sound/soc/sh/rcar/ssi.c +10 −1
  794. sound/soc/sh/rcar/ssiu.c +1 −1
  795. sound/soc/soc-dai.c +2 −9
  796. sound/soc/soc-dapm.c +75 −72
  797. sound/soc/soc-pcm.c +11 −2
  798. sound/soc/soc-topology.c +89 −26
  799. sound/soc/sof/intel/bdw.c +16 −0
  800. sound/soc/sof/intel/byt.c +48 −0
  801. sound/soc/stm/stm32_sai_sub.c +6 −8
  802. sound/usb/format.c +51 −0
  803. sound/usb/line6/podhd.c +5 −17
  804. sound/usb/mixer.c +34 −3
  805. sound/usb/mixer.h +10 −0
  806. sound/usb/mixer_maps.c +34 −3
  807. sound/usb/mixer_quirks.c +8 −4
  808. sound/usb/quirks-table.h +14 −84
  809. sound/usb/quirks.c +15 −1
  810. sound/usb/usx2y/usbusx2yaudio.c +2 −0
  811. tools/bootconfig/main.c +6 −3
  812. tools/bpf/bpftool/struct_ops.c +7 −1
  813. tools/bpf/runqslower/Makefile +1 −1
  814. tools/build/feature/test-sync-compare-and-swap.c +1 −1
  815. tools/cgroup/iocost_monitor.py +6 −1
  816. tools/include/uapi/linux/bpf.h +1 −1
  817. tools/lib/bpf/netlink.c +2 −0
  818. tools/objtool/check.c +14 −3
  819. tools/objtool/elf.c +1 −1
  820. tools/objtool/elf.h +5 −4
  821. tools/power/pm-graph/Makefile +4 −0
  822. tools/power/pm-graph/README +114 −10
  823. tools/power/pm-graph/bootgraph.py +1 −1
  824. tools/power/pm-graph/sleepgraph.8 +49 −16
  825. tools/power/pm-graph/sleepgraph.py +451 −344
  826. tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c +24 −6
  827. tools/testing/selftests/bpf/progs/connect4_prog.c +16 −12
  828. tools/testing/selftests/bpf/progs/freplace_connect4.c +18 −0
  829. tools/testing/selftests/bpf/progs/test_btf_haskv.c +5 −13
  830. tools/testing/selftests/bpf/progs/test_btf_newkv.c +5 −13
  831. tools/testing/selftests/bpf/progs/test_btf_nokv.c +5 −13
  832. tools/testing/selftests/bpf/test_btf.c +1 −1
  833. tools/testing/selftests/bpf/verifier/stack_ptr.c +40 −0
  834. tools/testing/selftests/bpf/verifier/value_illegal_alu.c +1 −0
  835. tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +146 −0
  836. tools/testing/selftests/ftrace/config +1 −0
  837. tools/testing/selftests/ftrace/ftracetest +30 −2
  838. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc +1 −4
  839. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc +2 −0
  840. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc +2 −0
  841. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-notrace-pid.tc +1 −4
  842. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc +1 −4
  843. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc +1 −1
  844. tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +1 −4
  845. tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc +1 −1
  846. tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc +1 −4
  847. tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +1 −4
  848. tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc +2 −0
  849. tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc +1 −4
  850. tools/testing/selftests/ftrace/test.d/functions +6 −0
  851. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc +1 −1
  852. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc +2 −0
  853. tools/testing/selftests/gpio/Makefile +6 −6
  854. tools/testing/selftests/intel_pstate/Makefile +1 −1
  855. tools/testing/selftests/ipc/msgque.c +1 −1
  856. tools/testing/selftests/kselftest/runner.sh +1 −1
  857. tools/testing/selftests/kselftest_deps.sh +272 −0
  858. tools/testing/selftests/kselftest_harness.h +3 −3
  859. tools/testing/selftests/kvm/Makefile +28 −1
  860. tools/testing/selftests/kvm/include/evmcs.h +2 −2
  861. tools/testing/selftests/kvm/lib/x86_64/vmx.c +3 −0
  862. tools/testing/selftests/memfd/Makefile +14 −3
  863. tools/testing/selftests/net/fib_nexthops.sh +23 −0
  864. tools/testing/selftests/net/fib_tests.sh +8 −2
  865. tools/testing/selftests/net/tcp_mmap.c +5 −2
  866. tools/testing/selftests/seccomp/seccomp_bpf.c +8 −6
  867. tools/testing/selftests/tpm2/test_smoke.sh +2 −11
  868. tools/testing/selftests/tpm2/test_space.sh +1 −8
  869. tools/testing/selftests/vm/Makefile +2 −2
  870. tools/testing/selftests/vm/run_vmtests +1 −1
  871. tools/testing/selftests/wireguard/netns.sh +51 −3
  872. tools/testing/selftests/wireguard/qemu/arch/powerpc64le.config +1 −0
  873. tools/testing/selftests/wireguard/qemu/debug.config +0 −1
  874. tools/virtio/Makefile +3 −2
  875. tools/virtio/asm/barrier.h +1 −0
  876. tools/virtio/generated/autoconf.h +0 −0
  877. tools/virtio/linux/compiler.h +1 −0
  878. tools/vm/Makefile +2 −0
  879. virt/kvm/arm/hyp/aarch32.c +6 −2
  880. virt/kvm/arm/psci.c +40 −0
  881. virt/kvm/arm/vgic/vgic-init.c +16 −3
  882. virt/kvm/arm/vgic/vgic-its.c +9 −2
  883. virt/kvm/arm/vgic/vgic-mmio-v2.c +10 −6
  884. virt/kvm/arm/vgic/vgic-mmio-v3.c +18 −13
  885. virt/kvm/arm/vgic/vgic-mmio.c +170 −58
  886. virt/kvm/arm/vgic/vgic-mmio.h +19 −0
.clang-format+14−4
@@ -142,10 +142,13 @@ ForEachMacros: · 141 unmodified lines
142142 - 'for_each_card_auxs'
143143 - 'for_each_card_auxs_safe'
144144 - 'for_each_card_components'
145+ - 'for_each_card_dapms'
145146 - 'for_each_card_pre_auxs'
146147 - 'for_each_card_prelinks'
147148 - 'for_each_card_rtds'
148149 - 'for_each_card_rtds_safe'
150+ - 'for_each_card_widgets'
151+ - 'for_each_card_widgets_safe'
149152 - 'for_each_cgroup_storage_type'
150153 - 'for_each_child_of_node'
151154 - 'for_each_clear_bit'
@@ -160,6 +163,7 @@ ForEachMacros: · 8 unmodified lines
160163 - 'for_each_cpu_and'
161164 - 'for_each_cpu_not'
162165 - 'for_each_cpu_wrap'
166+ - 'for_each_dapm_widgets'
163167 - 'for_each_dev_addr'
164168 - 'for_each_dev_scope'
165169 - 'for_each_displayid_db'
@@ -170,7 +174,6 @@ ForEachMacros: · 4 unmodified lines
170174 - 'for_each_dpcm_fe'
171175 - 'for_each_drhd_unit'
172176 - 'for_each_dss_dev'
173− - 'for_each_efi_handle'
174177 - 'for_each_efi_memory_desc'
175178 - 'for_each_efi_memory_desc_in_map'
176179 - 'for_each_element'
@@ -191,6 +194,7 @@ ForEachMacros: · 14 unmodified lines
191194 - 'for_each_ip_tunnel_rcu'
192195 - 'for_each_irq_nr'
193196 - 'for_each_link_codecs'
197+ - 'for_each_link_cpus'
194198 - 'for_each_link_platforms'
195199 - 'for_each_lru'
196200 - 'for_each_matching_node'
@@ -250,6 +254,7 @@ ForEachMacros: · 53 unmodified lines
250254 - 'for_each_pci_bridge'
251255 - 'for_each_pci_dev'
252256 - 'for_each_pci_msi_entry'
257+ - 'for_each_pcm_streams'
253258 - 'for_each_populated_zone'
254259 - 'for_each_possible_cpu'
255260 - 'for_each_present_cpu'
@@ -260,9 +265,12 @@ ForEachMacros: · 4 unmodified lines
260265 - 'for_each_property_of_node'
261266 - 'for_each_registered_fb'
262267 - 'for_each_reserved_mem_region'
263− - 'for_each_rtd_codec_dai'
264− - 'for_each_rtd_codec_dai_rollback'
268+ - 'for_each_rtd_codec_dais'
269+ - 'for_each_rtd_codec_dais_rollback'
265270 - 'for_each_rtd_components'
271+ - 'for_each_rtd_cpu_dais'
272+ - 'for_each_rtd_cpu_dais_rollback'
273+ - 'for_each_rtd_dais'
266274 - 'for_each_set_bit'
267275 - 'for_each_set_bit_from'
268276 - 'for_each_set_clump8'
@@ -334,6 +342,7 @@ ForEachMacros: · 65 unmodified lines
334342 - 'klp_for_each_object'
335343 - 'klp_for_each_object_safe'
336344 - 'klp_for_each_object_static'
345+ - 'kunit_suite_for_each_test_case'
337346 - 'kvm_for_each_memslot'
338347 - 'kvm_for_each_vcpu'
339348 - 'list_for_each'
@@ -387,6 +396,7 @@ ForEachMacros: · 47 unmodified lines
387396 - 'of_property_for_each_string'
388397 - 'of_property_for_each_u32'
389398 - 'pci_bus_for_each_resource'
399+ - 'pcm_for_each_format'
390400 - 'ping_portaddr_for_each_entry'
391401 - 'plist_for_each'
392402 - 'plist_for_each_continue'
@@ -482,7 +492,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false · 89 unmodified lines
482492 MacroBlockBegin: ''
483493 MacroBlockEnd: ''
484494 MaxEmptyLinesToKeep: 1
485−NamespaceIndentation: Inner
495+NamespaceIndentation: None
486496 #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
487497 ObjCBlockIndentWidth: 8
488498 ObjCSpaceAfterProperty: true
Documentation/admin-guide/device-mapper/dm-integrity.rst+9−6
@@ -182,12 +182,15 @@ fix_padding · 181 unmodified lines
182182 space-efficient. If this option is not present, large padding is
183183 used - that is for compatibility with older kernels.
184184
185−
186−The journal mode (D/J), buffer_sectors, journal_watermark, commit_time can
187−be changed when reloading the target (load an inactive table and swap the
188−tables with suspend and resume). The other arguments should not be changed
189−when reloading the target because the layout of disk data depend on them
190−and the reloaded target would be non-functional.
185+allow_discards
186+ Allow block discard requests (a.k.a. TRIM) for the integrity device.
187+ Discards are only allowed to devices using internal hash.
188+
189+The journal mode (D/J), buffer_sectors, journal_watermark, commit_time and
190+allow_discards can be changed when reloading the target (load an inactive
191+table and swap the tables with suspend and resume). The other arguments
192+should not be changed when reloading the target because the layout of disk
193+data depend on them and the reloaded target would be non-functional.
191194
192195
193196 The layout of the formatted block device:
Documentation/admin-guide/kernel-parameters.txt+1−2
@@ -5206,8 +5206,7 @@ · 5205 unmodified lines
52065206
52075207 usbcore.old_scheme_first=
52085208 [USB] Start with the old device initialization
5209− scheme, applies only to low and full-speed devices
5210− (default 0 = off).
5209+ scheme (default 0 = off).
52115210
52125211 usbcore.usbfs_memory_mb=
52135212 [USB] Memory limit (in MB) for buffers allocated by
Documentation/arm64/amu.rst+26−21
@@ -23,13 +23,14 @@ optional external memory-mapped interface. · 22 unmodified lines
2323
2424 Version 1 of the Activity Monitors architecture implements a counter group
2525 of four fixed and architecturally defined 64-bit event counters.
26− - CPU cycle counter: increments at the frequency of the CPU.
27− - Constant counter: increments at the fixed frequency of the system
28− clock.
29− - Instructions retired: increments with every architecturally executed
30− instruction.
31− - Memory stall cycles: counts instruction dispatch stall cycles caused by
32− misses in the last level cache within the clock domain.
26+
27+- CPU cycle counter: increments at the frequency of the CPU.
28+- Constant counter: increments at the fixed frequency of the system
29+ clock.
30+- Instructions retired: increments with every architecturally executed
31+ instruction.
32+- Memory stall cycles: counts instruction dispatch stall cycles caused by
33+ misses in the last level cache within the clock domain.
3334
3435 When in WFI or WFE these counters do not increment.
3536
@@ -57,11 +58,12 @@ counters, only the presence of the extension. · 21 unmodified lines
5758
5859 Firmware (code running at higher exception levels, e.g. arm-tf) support is
5960 needed to:
60− - Enable access for lower exception levels (EL2 and EL1) to the AMU
61− registers.
62− - Enable the counters. If not enabled these will read as 0.
63− - Save/restore the counters before/after the CPU is being put/brought up
64− from the 'off' power state.
61+
62+- Enable access for lower exception levels (EL2 and EL1) to the AMU
63+ registers.
64+- Enable the counters. If not enabled these will read as 0.
65+- Save/restore the counters before/after the CPU is being put/brought up
66+ from the 'off' power state.
6567
6668 When using kernels that have this feature enabled but boot with broken
6769 firmware the user may experience panics or lockups when accessing the
@@ -78,10 +80,11 @@ are not trapped in EL2/EL3. · 10 unmodified lines
7880
7981 The fixed counters of AMUv1 are accessible though the following system
8082 register definitions:
81− - SYS_AMEVCNTR0_CORE_EL0
82− - SYS_AMEVCNTR0_CONST_EL0
83− - SYS_AMEVCNTR0_INST_RET_EL0
84− - SYS_AMEVCNTR0_MEM_STALL_EL0
83+
84+- SYS_AMEVCNTR0_CORE_EL0
85+- SYS_AMEVCNTR0_CONST_EL0
86+- SYS_AMEVCNTR0_INST_RET_EL0
87+- SYS_AMEVCNTR0_MEM_STALL_EL0
8588
8689 Auxiliary platform specific counters can be accessed using
8790 SYS_AMEVCNTR1_EL0(n), where n is a value between 0 and 15.
@@ -93,9 +96,10 @@ Userspace access · 5 unmodified lines
9396 ----------------
9497
9598 Currently, access from userspace to the AMU registers is disabled due to:
96− - Security reasons: they might expose information about code executed in
97− secure mode.
98− - Purpose: AMU counters are intended for system management use.
99+
100+- Security reasons: they might expose information about code executed in
101+ secure mode.
102+- Purpose: AMU counters are intended for system management use.
99103
100104 Also, the presence of the feature is not visible to userspace.
101105
@@ -105,8 +109,9 @@ Virtualization · 3 unmodified lines
105109
106110 Currently, access from userspace (EL0) and kernelspace (EL1) on the KVM
107111 guest side is disabled due to:
108− - Security reasons: they might expose information about code executed
109− by other guests or the host.
112+
113+- Security reasons: they might expose information about code executed
114+ by other guests or the host.
110115
111116 Any attempt to access the AMU registers will result in an UNDEFINED
112117 exception being injected into the guest.
Documentation/devicetree/bindings/Makefile+12−9
@@ -2,6 +2,7 @@ · 1 unmodified line
22 DT_DOC_CHECKER ?= dt-doc-validate
33 DT_EXTRACT_EX ?= dt-extract-example
44 DT_MK_SCHEMA ?= dt-mk-schema
5+DT_MK_SCHEMA_USERONLY_FLAG := $(if $(DT_SCHEMA_FILES), -u)
56
67 quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<)
78 cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \
@@ -13,16 +14,18 @@ $(obj)/%.example.dts: $(src)/%.yaml FORCE · 5 unmodified lines
1314 # Use full schemas when checking %.example.dts
1415 DT_TMP_SCHEMA := $(obj)/processed-schema-examples.yaml
1516
17+find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
18+ -name 'processed-schema*' ! \
19+ -name '*.example.dt.yaml' \)
20+
1621 quiet_cmd_mk_schema = SCHEMA $@
17− cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs)
22+ cmd_mk_schema = rm -f $@ ; \
23+ $(if $(DT_MK_SCHEMA_FLAGS), \
24+ echo $(real-prereqs), \
25+ $(find_cmd)) | \
26+ xargs $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) >> $@
1827
19−DT_DOCS = $(addprefix $(src)/, \
20− $(shell \
21− cd $(srctree)/$(src) && \
22− find * \( -name '*.yaml' ! \
23− -name 'processed-schema*' ! \
24− -name '*.example.dt.yaml' \) \
25− ))
28+DT_DOCS = $(shell $(find_cmd) | sed -e 's|^$(srctree)/||')
2629
2730 DT_SCHEMA_FILES ?= $(DT_DOCS)
2831
@@ -37,7 +40,7 @@ override DTC_FLAGS := \ · 8 unmodified lines
3740 $(obj)/processed-schema-examples.yaml: $(DT_DOCS) FORCE
3841 $(call if_changed,mk_schema)
3942
40−$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u
43+$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := $(DT_MK_SCHEMA_USERONLY_FLAG)
4144 $(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE
4245 $(call if_changed,mk_schema)
4346
Documentation/devicetree/bindings/display/panel/leadtek,ltk500hd1829.yaml+0−1
@@ -37,7 +37,6 @@ examples: · 36 unmodified lines
3737 dsi {
3838 #address-cells = <1>;
3939 #size-cells = <0>;
40− reg = <0xff450000 0x1000>;
4140
4241 panel@0 {
4342 compatible = "leadtek,ltk500hd1829";
Documentation/devicetree/bindings/display/panel/lvds.yaml+9−1
@@ -96,12 +96,20 @@ properties: · 95 unmodified lines
9696 If set, reverse the bit order described in the data mappings below on all
9797 data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6.
9898
99+ port: true
100+ ports: true
101+
99102 required:
100103 - compatible
101104 - data-mapping
102105 - width-mm
103106 - height-mm
104107 - panel-timing
105− - port
108+
109+oneOf:
110+ - required:
111+ - port
112+ - required:
113+ - ports
106114
107115 ...
Documentation/devicetree/bindings/display/panel/xinpeng,xpp055c272.yaml+0−1
@@ -37,7 +37,6 @@ examples: · 36 unmodified lines
3737 dsi {
3838 #address-cells = <1>;
3939 #size-cells = <0>;
40− reg = <0xff450000 0x1000>;
4140
4241 panel@0 {
4342 compatible = "xinpeng,xpp055c272";
Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml+3−4
@@ -22,9 +22,7 @@ properties: · 21 unmodified lines
2222 const: socionext,uniphier-xdmac
2323
2424 reg:
25− items:
26− - description: XDMAC base register region (offset and length)
27− - description: XDMAC extension register region (offset and length)
25+ maxItems: 1
2826
2927 interrupts:
3028 maxItems: 1
@@ -49,12 +47,13 @@ required: · 18 unmodified lines
4947 - reg
5048 - interrupts
5149 - "#dma-cells"
50+ - dma-channels
5251
5352 examples:
5453 - |
5554 xdmac: dma-controller@5fc10000 {
5655 compatible = "socionext,uniphier-xdmac";
57− reg = <0x5fc10000 0x1000>, <0x5fc20000 0x800>;
56+ reg = <0x5fc10000 0x5300>;
5857 interrupts = <0 188 4>;
5958 #dma-cells = <2>;
6059 dma-channels = <16>;
Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml+1−1
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
22 %YAML 1.2
33 ---
4−$id: "http://devicetree.org/schemas/bindings/iio/adc/st,stm32-adc.yaml#"
4+$id: "http://devicetree.org/schemas/iio/adc/st,stm32-adc.yaml#"
55 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
66
77 title: STMicroelectronics STM32 ADC bindings
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml+0−2
@@ -259,8 +259,6 @@ properties: · 258 unmodified lines
259259
260260 additionalProperties: false
261261
262− additionalProperties: false
263−
264262 additionalProperties: false
265263
266264 required:
Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml+3−3
@@ -97,7 +97,7 @@ then: · 96 unmodified lines
9797 - $ref: /schemas/types.yaml#/definitions/uint32
9898 - minimum: 0
9999 maximum: 63
100− default: 0
100+ default: 32
101101
102102 qcom,charge-ctrl-value:
103103 description:
@@ -130,7 +130,7 @@ then: · 26 unmodified lines
130130 - $ref: /schemas/types.yaml#/definitions/uint32
131131 - minimum: 0
132132 maximum: 3
133− default: 2
133+ default: 0
134134
135135 qcom,preemphasis-width:
136136 description:
@@ -152,7 +152,7 @@ then: · 15 unmodified lines
152152 - $ref: /schemas/types.yaml#/definitions/uint32
153153 - minimum: 0
154154 maximum: 3
155− default: 0
155+ default: 1
156156
157157 required:
158158 - compatible
Documentation/devicetree/bindings/regulator/mps,mp5416.yaml+0−1
@@ -37,7 +37,6 @@ properties: · 36 unmodified lines
3737 type: object
3838
3939 additionalProperties: false
40− additionalProperties: false
4140
4241 required:
4342 - compatible
Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml+2−1
@@ -75,7 +75,8 @@ properties: · 74 unmodified lines
7575 description: |
7676 disables over voltage protection of this buck
7777
78− additionalProperties: false
78+ unevaluatedProperties: false
79+
7980 additionalProperties: false
8081
8182 required:
Documentation/devicetree/bindings/regulator/rohm,bd71828-regulator.yaml+5−1
@@ -35,6 +35,8 @@ patternProperties: · 34 unmodified lines
3535 description:
3636 should be "ldo1", ..., "ldo7"
3737
38+ unevaluatedProperties: false
39+
3840 "^BUCK[1-7]$":
3941 type: object
4042 allOf:
@@ -103,5 +105,7 @@ patternProperties: · 62 unmodified lines
103105
104106 required:
105107 - regulator-name
106− additionalProperties: false
108+
109+ unevaluatedProperties: false
110+
107111 additionalProperties: false
Documentation/devicetree/bindings/regulator/rohm,bd71837-regulator.yaml+5−1
@@ -41,6 +41,8 @@ patternProperties: · 40 unmodified lines
4141 description:
4242 should be "ldo1", ..., "ldo7"
4343
44+ unevaluatedProperties: false
45+
4446 "^BUCK[1-8]$":
4547 type: object
4648 allOf:
@@ -99,5 +101,7 @@ patternProperties: · 52 unmodified lines
99101
100102 required:
101103 - regulator-name
102− additionalProperties: false
104+
105+ unevaluatedProperties: false
106+
103107 additionalProperties: false
Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml+5−1
@@ -40,6 +40,8 @@ patternProperties: · 39 unmodified lines
4040 description:
4141 should be "ldo1", ..., "ldo6"
4242
43+ unevaluatedProperties: false
44+
4345 "^BUCK[1-6]$":
4446 type: object
4547 allOf:
@@ -93,5 +95,7 @@ patternProperties: · 47 unmodified lines
9395
9496 required:
9597 - regulator-name
96− additionalProperties: false
98+
99+ unevaluatedProperties: false
100+
97101 additionalProperties: false
Documentation/devicetree/bindings/sound/rockchip-i2s.yaml+3−0
@@ -56,6 +56,9 @@ properties: · 55 unmodified lines
5656 - const: tx
5757 - const: rx
5858
59+ power-domains:
60+ maxItems: 1
61+
5962 rockchip,capture-channels:
6063 allOf:
6164 - $ref: /schemas/types.yaml#/definitions/uint32
Documentation/devicetree/bindings/sound/rockchip-spdif.txt+0−45
@@ -1,45 +0,0 @@
1−* Rockchip SPDIF transceiver
2−
3−The S/PDIF audio block is a stereo transceiver that allows the
4−processor to receive and transmit digital audio via an coaxial cable or
5−a fibre cable.
6−
7−Required properties:
8−
9−- compatible: should be one of the following:
10− - "rockchip,rk3066-spdif"
11− - "rockchip,rk3188-spdif"
12− - "rockchip,rk3228-spdif"
13− - "rockchip,rk3288-spdif"
14− - "rockchip,rk3328-spdif"
15− - "rockchip,rk3366-spdif"
16− - "rockchip,rk3368-spdif"
17− - "rockchip,rk3399-spdif"
18−- reg: physical base address of the controller and length of memory mapped
19− region.
20−- interrupts: should contain the SPDIF interrupt.
21−- dmas: DMA specifiers for tx dma. See the DMA client binding,
22− Documentation/devicetree/bindings/dma/dma.txt
23−- dma-names: should be "tx"
24−- clocks: a list of phandle + clock-specifier pairs, one for each entry
25− in clock-names.
26−- clock-names: should contain following:
27− - "hclk": clock for SPDIF controller
28− - "mclk" : clock for SPDIF bus
29−
30−Required properties on RK3288:
31− - rockchip,grf: the phandle of the syscon node for the general register
32− file (GRF)
33−
34−Example for the rk3188 SPDIF controller:
35−
36−spdif: spdif@1011e000 {
37− compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
38− reg = <0x1011e000 0x2000>;
39− interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
40− dmas = <&dmac1_s 8>;
41− dma-names = "tx";
42− clock-names = "hclk", "mclk";
43− clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>;
44− #sound-dai-cells = <0>;
45−};
Documentation/devicetree/bindings/sound/rockchip-spdif.yaml+101−0
@@ -0,0 +1,101 @@
1+# SPDX-License-Identifier: GPL-2.0
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/sound/rockchip-spdif.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Rockchip SPDIF transceiver
8+
9+description:
10+ The S/PDIF audio block is a stereo transceiver that allows the
11+ processor to receive and transmit digital audio via a coaxial or
12+ fibre cable.
13+
14+maintainers:
15+ - Heiko Stuebner <heiko@sntech.de>
16+
17+properties:
18+ compatible:
19+ oneOf:
20+ - const: rockchip,rk3066-spdif
21+ - const: rockchip,rk3228-spdif
22+ - const: rockchip,rk3328-spdif
23+ - const: rockchip,rk3366-spdif
24+ - const: rockchip,rk3368-spdif
25+ - const: rockchip,rk3399-spdif
26+ - items:
27+ - enum:
28+ - rockchip,rk3188-spdif
29+ - rockchip,rk3288-spdif
30+ - const: rockchip,rk3066-spdif
31+
32+ reg:
33+ maxItems: 1
34+
35+ interrupts:
36+ maxItems: 1
37+
38+ clocks:
39+ items:
40+ - description: clock for SPDIF bus
41+ - description: clock for SPDIF controller
42+
43+ clock-names:
44+ items:
45+ - const: mclk
46+ - const: hclk
47+
48+ dmas:
49+ maxItems: 1
50+
51+ dma-names:
52+ const: tx
53+
54+ power-domains:
55+ maxItems: 1
56+
57+ rockchip,grf:
58+ $ref: /schemas/types.yaml#/definitions/phandle
59+ description:
60+ The phandle of the syscon node for the GRF register.
61+ Required property on RK3288.
62+
63+ "#sound-dai-cells":
64+ const: 0
65+
66+required:
67+ - compatible
68+ - reg
69+ - interrupts
70+ - clocks
71+ - clock-names
72+ - dmas
73+ - dma-names
74+ - "#sound-dai-cells"
75+
76+if:
77+ properties:
78+ compatible:
79+ contains:
80+ const: rockchip,rk3288-spdif
81+
82+then:
83+ required:
84+ - rockchip,grf
85+
86+additionalProperties: false
87+
88+examples:
89+ - |
90+ #include <dt-bindings/clock/rk3188-cru.h>
91+ #include <dt-bindings/interrupt-controller/arm-gic.h>
92+ spdif: spdif@1011e000 {
93+ compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
94+ reg = <0x1011e000 0x2000>;
95+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
96+ clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF>;
97+ clock-names = "mclk", "hclk";
98+ dmas = <&dmac1_s 8>;
99+ dma-names = "tx";
100+ #sound-dai-cells = <0>;
101+ };
Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml+1−0
@@ -18,6 +18,7 @@ properties: · 17 unmodified lines
1818 - renesas,r8a774c0-usb3-peri # RZ/G2E
1919 - renesas,r8a7795-usb3-peri # R-Car H3
2020 - renesas,r8a7796-usb3-peri # R-Car M3-W
21+ - renesas,r8a77961-usb3-peri # R-Car M3-W+
2122 - renesas,r8a77965-usb3-peri # R-Car M3-N
2223 - renesas,r8a77990-usb3-peri # R-Car E3
2324 - const: renesas,rcar-gen3-usb3-peri
Documentation/devicetree/bindings/usb/renesas,usbhs.yaml+1−0
@@ -40,6 +40,7 @@ properties: · 39 unmodified lines
4040 - renesas,usbhs-r8a774c0 # RZ/G2E
4141 - renesas,usbhs-r8a7795 # R-Car H3
4242 - renesas,usbhs-r8a7796 # R-Car M3-W
43+ - renesas,usbhs-r8a77961 # R-Car M3-W+
4344 - renesas,usbhs-r8a77965 # R-Car M3-N
4445 - renesas,usbhs-r8a77990 # R-Car E3
4546 - renesas,usbhs-r8a77995 # R-Car D3
Documentation/devicetree/bindings/usb/usb-xhci.txt+2−1
@@ -16,7 +16,8 @@ Required properties: · 15 unmodified lines
1616 - "renesas,xhci-r8a7791" for r8a7791 SoC
1717 - "renesas,xhci-r8a7793" for r8a7793 SoC
1818 - "renesas,xhci-r8a7795" for r8a7795 SoC
19− - "renesas,xhci-r8a7796" for r8a7796 SoC
19+ - "renesas,xhci-r8a7796" for r8a77960 SoC
20+ - "renesas,xhci-r8a77961" for r8a77961 SoC
2021 - "renesas,xhci-r8a77965" for r8a77965 SoC
2122 - "renesas,xhci-r8a77990" for r8a77990 SoC
2223 - "renesas,rcar-gen2-xhci" for a generic R-Car Gen2 or RZ/G1 compatible
Documentation/filesystems/debugfs.rst+2−2
@@ -79,8 +79,8 @@ created with any of:: · 78 unmodified lines
7979 struct dentry *parent, u8 *value);
8080 void debugfs_create_u16(const char *name, umode_t mode,
8181 struct dentry *parent, u16 *value);
82− struct dentry *debugfs_create_u32(const char *name, umode_t mode,
83− struct dentry *parent, u32 *value);
82+ void debugfs_create_u32(const char *name, umode_t mode,
83+ struct dentry *parent, u32 *value);
8484 void debugfs_create_u64(const char *name, umode_t mode,
8585 struct dentry *parent, u64 *value);
8686
Documentation/kbuild/makefiles.rst+2−1
@@ -1241,7 +1241,8 @@ When kbuild executes, the following steps are followed (roughly): · 1240 unmodified lines
12411241 will be displayed with "make KBUILD_VERBOSE=0".
12421242
12431243
1244−--- 6.9 Preprocessing linker scripts
1244+6.9 Preprocessing linker scripts
1245+--------------------------------
12451246
12461247 When the vmlinux image is built, the linker script
12471248 arch/$(ARCH)/kernel/vmlinux.lds is used.
Documentation/networking/devlink/ice.rst+2−2
@@ -61,8 +61,8 @@ The ``ice`` driver reports the following versions · 60 unmodified lines
6161 - running
6262 - ICE OS Default Package
6363 - The name of the DDP package that is active in the device. The DDP
64− package is loaded by the driver during initialization. Each varation
65− of DDP package shall have a unique name.
64+ package is loaded by the driver during initialization. Each
65+ variation of the DDP package has a unique name.
6666 * - ``fw.app``
6767 - running
6868 - 1.3.1.0
Documentation/networking/ip-sysctl.txt+7−0
@@ -983,6 +983,13 @@ ip_early_demux - BOOLEAN · 982 unmodified lines
983983 reduces overall throughput, in such case you should disable it.
984984 Default: 1
985985
986+ping_group_range - 2 INTEGERS
987+ Restrict ICMP_PROTO datagram sockets to users in the group range.
988+ The default is "1 0", meaning, that nobody (not even root) may
989+ create ping sockets. Setting it to "100 100" would grant permissions
990+ to the single group. "0 4294967295" would enable it for the world, "100
991+ 4294967295" would enable it for the users, but not daemons.
992+
986993 tcp_early_demux - BOOLEAN
987994 Enable early demux for established TCP sockets.
988995 Default: 1
Documentation/virt/kvm/index.rst+2−0
@@ -28,3 +28,5 @@ KVM · 27 unmodified lines
2828 arm/index
2929
3030 devices/index
31+
32+ running-nested-guests
Documentation/virt/kvm/running-nested-guests.rst+276−0
@@ -0,0 +1,276 @@
1+==============================
2+Running nested guests with KVM
3+==============================
4+
5+A nested guest is the ability to run a guest inside another guest (it
6+can be KVM-based or a different hypervisor). The straightforward
7+example is a KVM guest that in turn runs on a KVM guest (the rest of
8+this document is built on this example)::
9+
10+ .----------------. .----------------.
11+ | | | |
12+ | L2 | | L2 |
13+ | (Nested Guest) | | (Nested Guest) |
14+ | | | |
15+ |----------------'--'----------------|
16+ | |
17+ | L1 (Guest Hypervisor) |
18+ | KVM (/dev/kvm) |
19+ | |
20+ .------------------------------------------------------.
21+ | L0 (Host Hypervisor) |
22+ | KVM (/dev/kvm) |
23+ |------------------------------------------------------|
24+ | Hardware (with virtualization extensions) |
25+ '------------------------------------------------------'
26+
27+Terminology:
28+
29+- L0 – level-0; the bare metal host, running KVM
30+
31+- L1 – level-1 guest; a VM running on L0; also called the "guest
32+ hypervisor", as it itself is capable of running KVM.
33+
34+- L2 – level-2 guest; a VM running on L1, this is the "nested guest"
35+
36+.. note:: The above diagram is modelled after the x86 architecture;
37+ s390x, ppc64 and other architectures are likely to have
38+ a different design for nesting.
39+
40+ For example, s390x always has an LPAR (LogicalPARtition)
41+ hypervisor running on bare metal, adding another layer and
42+ resulting in at least four levels in a nested setup — L0 (bare
43+ metal, running the LPAR hypervisor), L1 (host hypervisor), L2
44+ (guest hypervisor), L3 (nested guest).
45+
46+ This document will stick with the three-level terminology (L0,
47+ L1, and L2) for all architectures; and will largely focus on
48+ x86.
49+
50+
51+Use Cases
52+---------
53+
54+There are several scenarios where nested KVM can be useful, to name a
55+few:
56+
57+- As a developer, you want to test your software on different operating
58+ systems (OSes). Instead of renting multiple VMs from a Cloud
59+ Provider, using nested KVM lets you rent a large enough "guest
60+ hypervisor" (level-1 guest). This in turn allows you to create
61+ multiple nested guests (level-2 guests), running different OSes, on
62+ which you can develop and test your software.
63+
64+- Live migration of "guest hypervisors" and their nested guests, for
65+ load balancing, disaster recovery, etc.
66+
67+- VM image creation tools (e.g. ``virt-install``, etc) often run
68+ their own VM, and users expect these to work inside a VM.
69+
70+- Some OSes use virtualization internally for security (e.g. to let
71+ applications run safely in isolation).
72+
73+
74+Enabling "nested" (x86)
75+-----------------------
76+
77+From Linux kernel v4.19 onwards, the ``nested`` KVM parameter is enabled
78+by default for Intel and AMD. (Though your Linux distribution might
79+override this default.)
80+
81+In case you are running a Linux kernel older than v4.19, to enable
82+nesting, set the ``nested`` KVM module parameter to ``Y`` or ``1``. To
83+persist this setting across reboots, you can add it in a config file, as
84+shown below:
85+
86+1. On the bare metal host (L0), list the kernel modules and ensure that
87+ the KVM modules::
88+
89+ $ lsmod | grep -i kvm
90+ kvm_intel 133627 0
91+ kvm 435079 1 kvm_intel
92+
93+2. Show information for ``kvm_intel`` module::
94+
95+ $ modinfo kvm_intel | grep -i nested
96+ parm: nested:bool
97+
98+3. For the nested KVM configuration to persist across reboots, place the
99+ below in ``/etc/modprobed/kvm_intel.conf`` (create the file if it
100+ doesn't exist)::
101+
102+ $ cat /etc/modprobe.d/kvm_intel.conf
103+ options kvm-intel nested=y
104+
105+4. Unload and re-load the KVM Intel module::
106+
107+ $ sudo rmmod kvm-intel
108+ $ sudo modprobe kvm-intel
109+
110+5. Verify if the ``nested`` parameter for KVM is enabled::
111+
112+ $ cat /sys/module/kvm_intel/parameters/nested
113+ Y
114+
115+For AMD hosts, the process is the same as above, except that the module
116+name is ``kvm-amd``.
117+
118+
119+Additional nested-related kernel parameters (x86)
120+-------------------------------------------------
121+
122+If your hardware is sufficiently advanced (Intel Haswell processor or
123+higher, which has newer hardware virt extensions), the following
124+additional features will also be enabled by default: "Shadow VMCS
125+(Virtual Machine Control Structure)", APIC Virtualization on your bare
126+metal host (L0). Parameters for Intel hosts::
127+
128+ $ cat /sys/module/kvm_intel/parameters/enable_shadow_vmcs
129+ Y
130+
131+ $ cat /sys/module/kvm_intel/parameters/enable_apicv
132+ Y
133+
134+ $ cat /sys/module/kvm_intel/parameters/ept
135+ Y
136+
137+.. note:: If you suspect your L2 (i.e. nested guest) is running slower,
138+ ensure the above are enabled (particularly
139+ ``enable_shadow_vmcs`` and ``ept``).
140+
141+
142+Starting a nested guest (x86)
143+-----------------------------
144+
145+Once your bare metal host (L0) is configured for nesting, you should be
146+able to start an L1 guest with::
147+
148+ $ qemu-kvm -cpu host [...]
149+
150+The above will pass through the host CPU's capabilities as-is to the
151+gues); or for better live migration compatibility, use a named CPU
152+model supported by QEMU. e.g.::
153+
154+ $ qemu-kvm -cpu Haswell-noTSX-IBRS,vmx=on
155+
156+then the guest hypervisor will subsequently be capable of running a
157+nested guest with accelerated KVM.
158+
159+
160+Enabling "nested" (s390x)
161+-------------------------
162+
163+1. On the host hypervisor (L0), enable the ``nested`` parameter on
164+ s390x::
165+
166+ $ rmmod kvm
167+ $ modprobe kvm nested=1
168+
169+.. note:: On s390x, the kernel parameter ``hpage`` is mutually exclusive
170+ with the ``nested`` paramter — i.e. to be able to enable
171+ ``nested``, the ``hpage`` parameter *must* be disabled.
172+
173+2. The guest hypervisor (L1) must be provided with the ``sie`` CPU
174+ feature — with QEMU, this can be done by using "host passthrough"
175+ (via the command-line ``-cpu host``).
176+
177+3. Now the KVM module can be loaded in the L1 (guest hypervisor)::
178+
179+ $ modprobe kvm
180+
181+
182+Live migration with nested KVM
183+------------------------------
184+
185+Migrating an L1 guest, with a *live* nested guest in it, to another
186+bare metal host, works as of Linux kernel 5.3 and QEMU 4.2.0 for
187+Intel x86 systems, and even on older versions for s390x.
188+
189+On AMD systems, once an L1 guest has started an L2 guest, the L1 guest
190+should no longer be migrated or saved (refer to QEMU documentation on
191+"savevm"/"loadvm") until the L2 guest shuts down. Attempting to migrate
192+or save-and-load an L1 guest while an L2 guest is running will result in
193+undefined behavior. You might see a ``kernel BUG!`` entry in ``dmesg``, a
194+kernel 'oops', or an outright kernel panic. Such a migrated or loaded L1
195+guest can no longer be considered stable or secure, and must be restarted.
196+Migrating an L1 guest merely configured to support nesting, while not
197+actually running L2 guests, is expected to function normally even on AMD
198+systems but may fail once guests are started.
199+
200+Migrating an L2 guest is always expected to succeed, so all the following
201+scenarios should work even on AMD systems:
202+
203+- Migrating a nested guest (L2) to another L1 guest on the *same* bare
204+ metal host.
205+
206+- Migrating a nested guest (L2) to another L1 guest on a *different*
207+ bare metal host.
208+
209+- Migrating a nested guest (L2) to a bare metal host.
210+
211+Reporting bugs from nested setups
212+-----------------------------------
213+
214+Debugging "nested" problems can involve sifting through log files across
215+L0, L1 and L2; this can result in tedious back-n-forth between the bug
216+reporter and the bug fixer.
217+
218+- Mention that you are in a "nested" setup. If you are running any kind
219+ of "nesting" at all, say so. Unfortunately, this needs to be called
220+ out because when reporting bugs, people tend to forget to even
221+ *mention* that they're using nested virtualization.
222+
223+- Ensure you are actually running KVM on KVM. Sometimes people do not
224+ have KVM enabled for their guest hypervisor (L1), which results in
225+ them running with pure emulation or what QEMU calls it as "TCG", but
226+ they think they're running nested KVM. Thus confusing "nested Virt"
227+ (which could also mean, QEMU on KVM) with "nested KVM" (KVM on KVM).
228+
229+Information to collect (generic)
230+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
231+
232+The following is not an exhaustive list, but a very good starting point:
233+
234+ - Kernel, libvirt, and QEMU version from L0
235+
236+ - Kernel, libvirt and QEMU version from L1
237+
238+ - QEMU command-line of L1 -- when using libvirt, you'll find it here:
239+ ``/var/log/libvirt/qemu/instance.log``
240+
241+ - QEMU command-line of L2 -- as above, when using libvirt, get the
242+ complete libvirt-generated QEMU command-line
243+
244+ - ``cat /sys/cpuinfo`` from L0
245+
246+ - ``cat /sys/cpuinfo`` from L1
247+
248+ - ``lscpu`` from L0
249+
250+ - ``lscpu`` from L1
251+
252+ - Full ``dmesg`` output from L0
253+
254+ - Full ``dmesg`` output from L1
255+
256+x86-specific info to collect
257+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
258+
259+Both the below commands, ``x86info`` and ``dmidecode``, should be
260+available on most Linux distributions with the same name:
261+
262+ - Output of: ``x86info -a`` from L0
263+
264+ - Output of: ``x86info -a`` from L1
265+
266+ - Output of: ``dmidecode`` from L0
267+
268+ - Output of: ``dmidecode`` from L1
269+
270+s390x-specific info to collect
271+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272+
273+Along with the earlier mentioned generic details, the below is
274+also recommended:
275+
276+ - ``/proc/sysinfo`` from L1; this will also include the info from L0
MAINTAINERS+42−46
@@ -189,7 +189,7 @@ F: drivers/net/hamradio/6pack.c · 188 unmodified lines
189189 M: Johannes Berg <johannes@sipsolutions.net>
190190 L: linux-wireless@vger.kernel.org
191191 S: Maintained
192−W: http://wireless.kernel.org/
192+W: https://wireless.wiki.kernel.org/
193193 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
194194 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
195195 F: Documentation/driver-api/80211/cfg80211.rst
@@ -505,7 +505,7 @@ F: drivers/hwmon/adm1029.c · 309 unmodified lines
505505 ADM8211 WIRELESS DRIVER
506506 L: linux-wireless@vger.kernel.org
507507 S: Orphan
508−W: http://wireless.kernel.org/
508+W: https://wireless.wiki.kernel.org/
509509 F: drivers/net/wireless/admtek/adm8211.*
510510
511511 ADP1653 FLASH CONTROLLER DRIVER
@@ -570,7 +570,7 @@ F: Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml · 58 unmodified lines
570570 F: drivers/input/misc/adxl34x.c
571571
572572 ADXL372 THREE-AXIS DIGITAL ACCELEROMETER DRIVER
573−M: Stefan Popa <stefan.popa@analog.com>
573+M: Michael Hennerich <michael.hennerich@analog.com>
574574 S: Supported
575575 W: http://ez.analog.com/community/linux-device-drivers
576576 F: Documentation/devicetree/bindings/iio/accel/adi,adxl372.yaml
@@ -922,7 +922,7 @@ F: arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi · 345 unmodified lines
922922 F: drivers/net/ethernet/amd/xgbe/
923923
924924 ANALOG DEVICES INC AD5686 DRIVER
925−M: Stefan Popa <stefan.popa@analog.com>
925+M: Michael Hennerich <Michael.Hennerich@analog.com>
926926 L: linux-pm@vger.kernel.org
927927 S: Supported
928928 W: http://ez.analog.com/community/linux-device-drivers
@@ -930,7 +930,7 @@ F: drivers/iio/dac/ad5686* · 1 unmodified line
930930 F: drivers/iio/dac/ad5696*
931931
932932 ANALOG DEVICES INC AD5758 DRIVER
933−M: Stefan Popa <stefan.popa@analog.com>
933+M: Michael Hennerich <Michael.Hennerich@analog.com>
934934 L: linux-iio@vger.kernel.org
935935 S: Supported
936936 W: http://ez.analog.com/community/linux-device-drivers
@@ -946,7 +946,7 @@ F: Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml · 9 unmodified lines
946946 F: drivers/iio/adc/ad7091r5.c
947947
948948 ANALOG DEVICES INC AD7124 DRIVER
949−M: Stefan Popa <stefan.popa@analog.com>
949+M: Michael Hennerich <Michael.Hennerich@analog.com>
950950 L: linux-iio@vger.kernel.org
951951 S: Supported
952952 W: http://ez.analog.com/community/linux-device-drivers
@@ -970,7 +970,7 @@ F: Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml · 17 unmodified lines
970970 F: drivers/iio/adc/ad7292.c
971971
972972 ANALOG DEVICES INC AD7606 DRIVER
973−M: Stefan Popa <stefan.popa@analog.com>
973+M: Michael Hennerich <Michael.Hennerich@analog.com>
974974 M: Beniamin Bia <beniamin.bia@analog.com>
975975 L: linux-iio@vger.kernel.org
976976 S: Supported
@@ -979,7 +979,7 @@ F: Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml · 2 unmodified lines
979979 F: drivers/iio/adc/ad7606.c
980980
981981 ANALOG DEVICES INC AD7768-1 DRIVER
982−M: Stefan Popa <stefan.popa@analog.com>
982+M: Michael Hennerich <Michael.Hennerich@analog.com>
983983 L: linux-iio@vger.kernel.org
984984 S: Supported
985985 W: http://ez.analog.com/community/linux-device-drivers
@@ -1040,7 +1040,7 @@ F: Documentation/devicetree/bindings/hwmon/adi,adm1177.yaml · 54 unmodified lines
10401040 F: drivers/hwmon/adm1177.c
10411041
10421042 ANALOG DEVICES INC ADP5061 DRIVER
1043−M: Stefan Popa <stefan.popa@analog.com>
1043+M: Michael Hennerich <Michael.Hennerich@analog.com>
10441044 L: linux-pm@vger.kernel.org
10451045 S: Supported
10461046 W: http://ez.analog.com/community/linux-device-drivers
@@ -1109,7 +1109,6 @@ F: drivers/iio/amplifiers/hmc425a.c · 62 unmodified lines
11091109 ANALOG DEVICES INC IIO DRIVERS
11101110 M: Lars-Peter Clausen <lars@metafoo.de>
11111111 M: Michael Hennerich <Michael.Hennerich@analog.com>
1112−M: Stefan Popa <stefan.popa@analog.com>
11131112 S: Supported
11141113 W: http://wiki.analog.com/
11151114 W: http://ez.analog.com/community/linux-device-drivers
@@ -2850,14 +2849,14 @@ M: Nick Kossifidis <mickflemm@gmail.com> · 1734 unmodified lines
28502849 M: Luis Chamberlain <mcgrof@kernel.org>
28512850 L: linux-wireless@vger.kernel.org
28522851 S: Maintained
2853−W: http://wireless.kernel.org/en/users/Drivers/ath5k
2852+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath5k
28542853 F: drivers/net/wireless/ath/ath5k/
28552854
28562855 ATHEROS ATH6KL WIRELESS DRIVER
28572856 M: Kalle Valo <kvalo@codeaurora.org>
28582857 L: linux-wireless@vger.kernel.org
28592858 S: Supported
2860−W: http://wireless.kernel.org/en/users/Drivers/ath6kl
2859+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath6kl
28612860 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
28622861 F: drivers/net/wireless/ath/ath6kl/
28632862
@@ -3020,7 +3019,7 @@ B43 WIRELESS DRIVER · 156 unmodified lines
30203019 L: linux-wireless@vger.kernel.org
30213020 L: b43-dev@lists.infradead.org
30223021 S: Odd Fixes
3023−W: http://wireless.kernel.org/en/users/Drivers/b43
3022+W: https://wireless.wiki.kernel.org/en/users/Drivers/b43
30243023 F: drivers/net/wireless/broadcom/b43/
30253024
30263025 B43LEGACY WIRELESS DRIVER
@@ -3028,7 +3027,7 @@ M: Larry Finger <Larry.Finger@lwfinger.net> · 1 unmodified line
30283027 L: linux-wireless@vger.kernel.org
30293028 L: b43-dev@lists.infradead.org
30303029 S: Maintained
3031−W: http://wireless.kernel.org/en/users/Drivers/b43
3030+W: https://wireless.wiki.kernel.org/en/users/Drivers/b43
30323031 F: drivers/net/wireless/broadcom/b43legacy/
30333032
30343033 BACKLIGHT CLASS/SUBSYSTEM
@@ -3658,7 +3657,7 @@ L: linux-btrfs@vger.kernel.org · 623 unmodified lines
36583657 S: Maintained
36593658 W: http://btrfs.wiki.kernel.org/
36603659 Q: http://patchwork.kernel.org/project/linux-btrfs/list/
3661−T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git
3660+T: git git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git
36623661 F: Documentation/filesystems/btrfs.rst
36633662 F: fs/btrfs/
36643663 F: include/linux/btrfs*
@@ -3843,7 +3842,7 @@ CARL9170 LINUX COMMUNITY WIRELESS DRIVER · 178 unmodified lines
38433842 M: Christian Lamparter <chunkeey@googlemail.com>
38443843 L: linux-wireless@vger.kernel.org
38453844 S: Maintained
3846−W: http://wireless.kernel.org/en/users/Drivers/carl9170
3845+W: https://wireless.wiki.kernel.org/en/users/Drivers/carl9170
38473846 F: drivers/net/wireless/ath/carl9170/
38483847
38493848 CAVIUM I2C DRIVER
@@ -3937,11 +3936,9 @@ F: arch/powerpc/platforms/cell/ · 87 unmodified lines
39373936 CEPH COMMON CODE (LIBCEPH)
39383937 M: Ilya Dryomov <idryomov@gmail.com>
39393938 M: Jeff Layton <jlayton@kernel.org>
3940−M: Sage Weil <sage@redhat.com>
39413939 L: ceph-devel@vger.kernel.org
39423940 S: Supported
39433941 W: http://ceph.com/
3944−T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
39453942 T: git git://github.com/ceph/ceph-client.git
39463943 F: include/linux/ceph/
39473944 F: include/linux/crush/
@@ -3949,12 +3946,10 @@ F: net/ceph/ · 1 unmodified line
39493946
39503947 CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)
39513948 M: Jeff Layton <jlayton@kernel.org>
3952−M: Sage Weil <sage@redhat.com>
39533949 M: Ilya Dryomov <idryomov@gmail.com>
39543950 L: ceph-devel@vger.kernel.org
39553951 S: Supported
39563952 W: http://ceph.com/
3957−T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
39583953 T: git git://github.com/ceph/ceph-client.git
39593954 F: Documentation/filesystems/ceph.rst
39603955 F: fs/ceph/
@@ -5176,6 +5171,7 @@ S: Maintained · 1215 unmodified lines
51765171 F: drivers/soc/fsl/dpio
51775172
51785173 DPAA2 ETHERNET DRIVER
5174+M: Ioana Ciornei <ioana.ciornei@nxp.com>
51795175 M: Ioana Radulescu <ruxandra.radulescu@nxp.com>
51805176 L: netdev@vger.kernel.org
51815177 S: Maintained
@@ -5935,9 +5931,9 @@ F: lib/dynamic_debug.c · 753 unmodified lines
59355931 DYNAMIC INTERRUPT MODERATION
59365932 M: Tal Gilboa <talgi@mellanox.com>
59375933 S: Maintained
5934+F: Documentation/networking/net_dim.rst
59385935 F: include/linux/dim.h
59395936 F: lib/dim/
5940−F: Documentation/networking/net_dim.rst
59415937
59425938 DZ DECSTATION DZ11 SERIAL DRIVER
59435939 M: "Maciej W. Rozycki" <macro@linux-mips.org>
@@ -7119,9 +7115,10 @@ F: include/uapi/asm-generic/ · 1175 unmodified lines
71197115
71207116 GENERIC PHY FRAMEWORK
71217117 M: Kishon Vijay Abraham I <kishon@ti.com>
7118+M: Vinod Koul <vkoul@kernel.org>
71227119 L: linux-kernel@vger.kernel.org
71237120 S: Supported
7124−T: git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git
7121+T: git git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git
71257122 F: Documentation/devicetree/bindings/phy/
71267123 F: drivers/phy/
71277124 F: include/linux/phy/
@@ -7746,11 +7743,6 @@ L: platform-driver-x86@vger.kernel.org · 618 unmodified lines
77467743 S: Orphan
77477744 F: drivers/platform/x86/tc1100-wmi.c
77487745
7749−HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
7750−M: Jaroslav Kysela <perex@perex.cz>
7751−S: Obsolete
7752−F: drivers/staging/hp/hp100.*
7753−
77547746 HPET: High Precision Event Timers driver
77557747 M: Clemens Ladisch <clemens@ladisch.de>
77567748 S: Maintained
@@ -9329,6 +9321,7 @@ M: Christian Borntraeger <borntraeger@de.ibm.com> · 1572 unmodified lines
93299321 M: Janosch Frank <frankja@linux.ibm.com>
93309322 R: David Hildenbrand <david@redhat.com>
93319323 R: Cornelia Huck <cohuck@redhat.com>
9324+R: Claudio Imbrenda <imbrenda@linux.ibm.com>
93329325 L: kvm@vger.kernel.org
93339326 S: Supported
93349327 W: http://www.ibm.com/developerworks/linux/linux390/
@@ -9416,6 +9409,13 @@ F: include/linux/keyctl.h · 81 unmodified lines
94169409 F: include/uapi/linux/keyctl.h
94179410 F: security/keys/
94189411
9412+KFIFO
9413+M: Stefani Seibold <stefani@seibold.net>
9414+S: Maintained
9415+F: include/linux/kfifo.h
9416+F: lib/kfifo.c
9417+F: samples/kfifo/
9418+
94199419 KGDB / KDB /debug_core
94209420 M: Jason Wessel <jason.wessel@windriver.com>
94219421 M: Daniel Thompson <daniel.thompson@linaro.org>
@@ -10067,7 +10067,7 @@ MAC80211 · 645 unmodified lines
1006710067 M: Johannes Berg <johannes@sipsolutions.net>
1006810068 L: linux-wireless@vger.kernel.org
1006910069 S: Maintained
10070−W: http://wireless.kernel.org/
10070+W: https://wireless.wiki.kernel.org/
1007110071 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
1007210072 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
1007310073 F: Documentation/networking/mac80211-injection.txt
@@ -10697,7 +10697,6 @@ MEDIATEK MT76 WIRELESS LAN DRIVER · 623 unmodified lines
1069710697 M: Felix Fietkau <nbd@nbd.name>
1069810698 M: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
1069910699 R: Ryder Lee <ryder.lee@mediatek.com>
10700−R: Roy Luo <royluo@google.com>
1070110700 L: linux-wireless@vger.kernel.org
1070210701 S: Maintained
1070310702 F: drivers/net/wireless/mediatek/mt76/
@@ -12648,7 +12647,7 @@ F: fs/orangefs/ · 1944 unmodified lines
1264812647 ORINOCO DRIVER
1264912648 L: linux-wireless@vger.kernel.org
1265012649 S: Orphan
12651−W: http://wireless.kernel.org/en/users/Drivers/orinoco
12650+W: https://wireless.wiki.kernel.org/en/users/Drivers/orinoco
1265212651 W: http://www.nongnu.org/orinoco/
1265312652 F: drivers/net/wireless/intersil/orinoco/
1265412653
@@ -12674,7 +12673,7 @@ P54 WIRELESS DRIVER · 19 unmodified lines
1267412673 M: Christian Lamparter <chunkeey@googlemail.com>
1267512674 L: linux-wireless@vger.kernel.org
1267612675 S: Maintained
12677−W: http://wireless.kernel.org/en/users/Drivers/p54
12676+W: https://wireless.wiki.kernel.org/en/users/Drivers/p54
1267812677 F: drivers/net/wireless/intersil/p54/
1267912678
1268012679 PACKING
@@ -13042,7 +13041,7 @@ F: drivers/pci/controller/pci-xgene-msi.c · 361 unmodified lines
1304213041
1304313042 PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
1304413043 M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
13045−R: Andrew Murray <amurray@thegoodpenguin.co.uk>
13044+R: Rob Herring <robh@kernel.org>
1304613045 L: linux-pci@vger.kernel.org
1304713046 S: Supported
1304813047 Q: http://patchwork.ozlabs.org/project/linux-pci/list/
@@ -13595,7 +13594,7 @@ PRISM54 WIRELESS DRIVER · 546 unmodified lines
1359513594 M: Luis Chamberlain <mcgrof@kernel.org>
1359613595 L: linux-wireless@vger.kernel.org
1359713596 S: Obsolete
13598−W: http://wireless.kernel.org/en/users/Drivers/p54
13597+W: https://wireless.wiki.kernel.org/en/users/Drivers/p54
1359913598 F: drivers/net/wireless/intersil/prism54/
1360013599
1360113600 PROC FILESYSTEM
@@ -13936,7 +13935,7 @@ QUALCOMM ATHEROS ATH10K WIRELESS DRIVER · 334 unmodified lines
1393613935 M: Kalle Valo <kvalo@codeaurora.org>
1393713936 L: ath10k@lists.infradead.org
1393813937 S: Supported
13939−W: http://wireless.kernel.org/en/users/Drivers/ath10k
13938+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
1394013939 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
1394113940 F: drivers/net/wireless/ath/ath10k/
1394213941
@@ -13951,7 +13950,7 @@ QUALCOMM ATHEROS ATH9K WIRELESS DRIVER · 8 unmodified lines
1395113950 M: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
1395213951 L: linux-wireless@vger.kernel.org
1395313952 S: Supported
13954−W: http://wireless.kernel.org/en/users/Drivers/ath9k
13953+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
1395513954 F: drivers/net/wireless/ath/ath9k/
1395613955
1395713956 QUALCOMM CAMERA SUBSYSTEM DRIVER
@@ -14048,13 +14047,12 @@ QUALCOMM WCN36XX WIRELESS DRIVER · 90 unmodified lines
1404814047 M: Kalle Valo <kvalo@codeaurora.org>
1404914048 L: wcn36xx@lists.infradead.org
1405014049 S: Supported
14051−W: http://wireless.kernel.org/en/users/Drivers/wcn36xx
14050+W: https://wireless.wiki.kernel.org/en/users/Drivers/wcn36xx
1405214051 T: git git://github.com/KrasnikovEugene/wcn36xx.git
1405314052 F: drivers/net/wireless/ath/wcn36xx/
1405414053
1405514054 QUANTENNA QTNFMAC WIRELESS DRIVER
1405614055 M: Igor Mitsyanko <imitsyanko@quantenna.com>
14057−M: Avinash Patil <avinashp@quantenna.com>
1405814056 M: Sergey Matyukevich <smatyukevich@quantenna.com>
1405914057 L: linux-wireless@vger.kernel.org
1406014058 S: Maintained
@@ -14096,12 +14094,10 @@ F: drivers/media/radio/radio-tea5777.c · 35 unmodified lines
1409614094
1409714095 RADOS BLOCK DEVICE (RBD)
1409814096 M: Ilya Dryomov <idryomov@gmail.com>
14099−M: Sage Weil <sage@redhat.com>
1410014097 R: Dongsheng Yang <dongsheng.yang@easystack.cn>
1410114098 L: ceph-devel@vger.kernel.org
1410214099 S: Supported
1410314100 W: http://ceph.com/
14104−T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
1410514101 T: git git://github.com/ceph/ceph-client.git
1410614102 F: Documentation/ABI/testing/sysfs-bus-rbd
1410714103 F: drivers/block/rbd.c
@@ -14276,7 +14272,7 @@ REALTEK WIRELESS DRIVER (rtlwifi family) · 168 unmodified lines
1427614272 M: Ping-Ke Shih <pkshih@realtek.com>
1427714273 L: linux-wireless@vger.kernel.org
1427814274 S: Maintained
14279−W: http://wireless.kernel.org/
14275+W: https://wireless.wiki.kernel.org/
1428014276 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
1428114277 F: drivers/net/wireless/realtek/rtlwifi/
1428214278
@@ -14411,7 +14407,7 @@ RFKILL · 128 unmodified lines
1441114407 M: Johannes Berg <johannes@sipsolutions.net>
1441214408 L: linux-wireless@vger.kernel.org
1441314409 S: Maintained
14414−W: http://wireless.kernel.org/
14410+W: https://wireless.wiki.kernel.org/
1441514411 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
1441614412 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
1441714413 F: Documentation/ABI/stable/sysfs-class-rfkill
@@ -14560,7 +14556,7 @@ F: drivers/media/dvb-frontends/rtl2832_sdr* · 142 unmodified lines
1456014556 RTL8180 WIRELESS DRIVER
1456114557 L: linux-wireless@vger.kernel.org
1456214558 S: Orphan
14563−W: http://wireless.kernel.org/
14559+W: https://wireless.wiki.kernel.org/
1456414560 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
1456514561 F: drivers/net/wireless/realtek/rtl818x/rtl8180/
1456614562
@@ -14570,7 +14566,7 @@ M: Hin-Tak Leung <htl10@users.sourceforge.net> · 3 unmodified lines
1457014566 M: Larry Finger <Larry.Finger@lwfinger.net>
1457114567 L: linux-wireless@vger.kernel.org
1457214568 S: Maintained
14573−W: http://wireless.kernel.org/
14569+W: https://wireless.wiki.kernel.org/
1457414570 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
1457514571 F: drivers/net/wireless/realtek/rtl818x/rtl8187/
1457614572
@@ -16925,8 +16921,8 @@ F: drivers/media/platform/ti-vpe/ · 2348 unmodified lines
1692516921 TI WILINK WIRELESS DRIVERS
1692616922 L: linux-wireless@vger.kernel.org
1692716923 S: Orphan
16928−W: http://wireless.kernel.org/en/users/Drivers/wl12xx
16929−W: http://wireless.kernel.org/en/users/Drivers/wl1251
16924+W: https://wireless.wiki.kernel.org/en/users/Drivers/wl12xx
16925+W: https://wireless.wiki.kernel.org/en/users/Drivers/wl1251
1693016926 T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
1693116927 F: drivers/net/wireless/ti/
1693216928 F: include/linux/wl12xx.h
@@ -18208,7 +18204,7 @@ M: Maya Erez <merez@codeaurora.org> · 1275 unmodified lines
1820818204 L: linux-wireless@vger.kernel.org
1820918205 L: wil6210@qti.qualcomm.com
1821018206 S: Supported
18211−W: http://wireless.kernel.org/en/users/Drivers/wil6210
18207+W: https://wireless.wiki.kernel.org/en/users/Drivers/wil6210
1821218208 F: drivers/net/wireless/ath/wil6210/
1821318209
1821418210 WIMAX STACK
Makefile+12−5
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 7
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
5+EXTRAVERSION = -rc5
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
@@ -729,10 +729,6 @@ else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE · 720 unmodified lines
729729 KBUILD_CFLAGS += -Os
730730 endif
731731
732−ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
733−KBUILD_CFLAGS += -Wno-maybe-uninitialized
734−endif
735−
736732 # Tell gcc to never replace conditional load with a non-conditional one
737733 KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
738734 KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
@@ -881,6 +877,17 @@ KBUILD_CFLAGS += -Wno-pointer-sign · 142 unmodified lines
881877 # disable stringop warnings in gcc 8+
882878 KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
883879
880+# We'll want to enable this eventually, but it's not going away for 5.7 at least
881+KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds)
882+KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
883+KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
884+
885+# Another good warning that we'll want to enable eventually
886+KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
887+
888+# Enabled with W=2, disabled by default as noisy
889+KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
890+
884891 # disable invalid "can't wrap" optimizations for signed / pointers
885892 KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
886893
arch/arc/include/asm/module.h+0−5
@@ -3,7 +3,6 @@ · 2 unmodified lines
33 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
44 *
55 * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
6−
76 */
87
98 #ifndef _ASM_ARC_MODULE_H
@@ -19,8 +18,4 @@ struct mod_arch_specific { · 9 unmodified lines
1918 const char *secstr;
2019 };
2120
22−#define MODULE_PROC_FAMILY "ARC700"
23−
24−#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
25−
2621 #endif /* _ASM_ARC_MODULE_H */
arch/arc/include/asm/vermagic.h+8−0
@@ -0,0 +1,8 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef _ASM_VERMAGIC_H
4+#define _ASM_VERMAGIC_H
5+
6+#define MODULE_ARCH_VERMAGIC "ARC700"
7+
8+#endif /* _ASM_VERMAGIC_H */
arch/arm/boot/dts/bcm2835-rpi.dtsi+3−0
@@ -14,6 +14,9 @@ · 13 unmodified lines
1414 soc {
1515 firmware: firmware {
1616 compatible = "raspberrypi,bcm2835-firmware", "simple-bus";
17+ #address-cells = <1>;
18+ #size-cells = <1>;
19+
1720 mboxes = <&mailbox>;
1821 dma-ranges;
1922 };
arch/arm/boot/dts/bcm283x.dtsi+1−0
@@ -372,6 +372,7 @@ · 371 unmodified lines
372372 "dsi0_ddr2",
373373 "dsi0_ddr";
374374
375+ status = "disabled";
375376 };
376377
377378 aux: aux@7e215000 {
arch/arm/boot/dts/omap3-n950-n9.dtsi+5−0
@@ -341,6 +341,11 @@ · 340 unmodified lines
341341 status = "disabled";
342342 };
343343
344+/* RNG not directly accessible on N950/N9. */
345+&rng_target {
346+ status = "disabled";
347+};
348+
344349 &usb_otg_hs {
345350 interface-type = <0>;
346351 usb-phy = <&usb2_phy>;
arch/arm/crypto/chacha-glue.c+11−3
@@ -91,9 +91,17 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes, · 90 unmodified lines
9191 return;
9292 }
9393
94− kernel_neon_begin();
95− chacha_doneon(state, dst, src, bytes, nrounds);
96− kernel_neon_end();
94+ do {
95+ unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
96+
97+ kernel_neon_begin();
98+ chacha_doneon(state, dst, src, todo, nrounds);
99+ kernel_neon_end();
100+
101+ bytes -= todo;
102+ src += todo;
103+ dst += todo;
104+ } while (bytes);
97105 }
98106 EXPORT_SYMBOL(chacha_crypt_arch);
99107
arch/arm/crypto/nhpoly1305-neon-glue.c+1−1
@@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc, · 29 unmodified lines
3030 return crypto_nhpoly1305_update(desc, src, srclen);
3131
3232 do {
33− unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
33+ unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3434
3535 kernel_neon_begin();
3636 crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);
arch/arm/crypto/poly1305-glue.c+11−4
@@ -160,13 +160,20 @@ void poly1305_update_arch(struct poly1305_desc_ctx *dctx, const u8 *src, · 159 unmodified lines
160160 unsigned int len = round_down(nbytes, POLY1305_BLOCK_SIZE);
161161
162162 if (static_branch_likely(&have_neon) && do_neon) {
163− kernel_neon_begin();
164− poly1305_blocks_neon(&dctx->h, src, len, 1);
165− kernel_neon_end();
163+ do {
164+ unsigned int todo = min_t(unsigned int, len, SZ_4K);
165+
166+ kernel_neon_begin();
167+ poly1305_blocks_neon(&dctx->h, src, todo, 1);
168+ kernel_neon_end();
169+
170+ len -= todo;
171+ src += todo;
172+ } while (len);
166173 } else {
167174 poly1305_blocks_arm(&dctx->h, src, len, 1);
175+ src += len;
168176 }
169− src += len;
170177 nbytes %= POLY1305_BLOCK_SIZE;
171178 }
172179
arch/arm/include/asm/futex.h+7−2
@@ -165,8 +165,13 @@ arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr) · 164 unmodified lines
165165 preempt_enable();
166166 #endif
167167
168− if (!ret)
169− *oval = oldval;
168+ /*
169+ * Store unconditionally. If ret != 0 the extra store is the least
170+ * of the worries but GCC cannot figure out that __futex_atomic_op()
171+ * is either setting ret to -EFAULT or storing the old value in
172+ * oldval which results in a uninitialized warning at the call site.
173+ */
174+ *oval = oldval;
170175
171176 return ret;
172177 }
arch/arm/include/asm/module.h+0−24
@@ -37,30 +37,6 @@ struct mod_arch_specific { · 36 unmodified lines
3737 struct module;
3838 u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
3939
40−/*
41− * Add the ARM architecture version to the version magic string
42− */
43−#define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
44−
45−/* Add __virt_to_phys patching state as well */
46−#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
47−#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
48−#else
49−#define MODULE_ARCH_VERMAGIC_P2V ""
50−#endif
51−
52−/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
53−#ifdef CONFIG_THUMB2_KERNEL
54−#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
55−#else
56−#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
57−#endif
58−
59−#define MODULE_ARCH_VERMAGIC \
60− MODULE_ARCH_VERMAGIC_ARMVSN \
61− MODULE_ARCH_VERMAGIC_ARMTHUMB \
62− MODULE_ARCH_VERMAGIC_P2V
63−
6440 #ifdef CONFIG_THUMB2_KERNEL
6541 #define HAVE_ARCH_KALLSYMS_SYMBOL_VALUE
6642 static inline unsigned long kallsyms_symbol_value(const Elf_Sym *sym)
arch/arm/include/asm/vermagic.h+31−0
@@ -0,0 +1,31 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_VERMAGIC_H
3+#define _ASM_VERMAGIC_H
4+
5+#include <linux/stringify.h>
6+
7+/*
8+ * Add the ARM architecture version to the version magic string
9+ */
10+#define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
11+
12+/* Add __virt_to_phys patching state as well */
13+#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
14+#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
15+#else
16+#define MODULE_ARCH_VERMAGIC_P2V ""
17+#endif
18+
19+/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
20+#ifdef CONFIG_THUMB2_KERNEL
21+#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
22+#else
23+#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
24+#endif
25+
26+#define MODULE_ARCH_VERMAGIC \
27+ MODULE_ARCH_VERMAGIC_ARMVSN \
28+ MODULE_ARCH_VERMAGIC_ARMTHUMB \
29+ MODULE_ARCH_VERMAGIC_P2V
30+
31+#endif /* _ASM_VERMAGIC_H */
arch/arm/mach-imx/Makefile+2−0
@@ -91,8 +91,10 @@ AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a · 90 unmodified lines
9191 obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o
9292 obj-$(CONFIG_SOC_IMX53) += suspend-imx53.o
9393 endif
94+ifeq ($(CONFIG_ARM_CPU_SUSPEND),y)
9495 AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a
9596 obj-$(CONFIG_SOC_IMX6) += resume-imx6.o
97+endif
9698 obj-$(CONFIG_SOC_IMX6) += pm-imx6.o
9799
98100 obj-$(CONFIG_SOC_IMX1) += mach-imx1.o
arch/arm64/crypto/chacha-neon-glue.c+11−3
@@ -87,9 +87,17 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes, · 86 unmodified lines
8787 !crypto_simd_usable())
8888 return chacha_crypt_generic(state, dst, src, bytes, nrounds);
8989
90− kernel_neon_begin();
91− chacha_doneon(state, dst, src, bytes, nrounds);
92− kernel_neon_end();
90+ do {
91+ unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
92+
93+ kernel_neon_begin();
94+ chacha_doneon(state, dst, src, todo, nrounds);
95+ kernel_neon_end();
96+
97+ bytes -= todo;
98+ src += todo;
99+ dst += todo;
100+ } while (bytes);
93101 }
94102 EXPORT_SYMBOL(chacha_crypt_arch);
95103
arch/arm64/crypto/nhpoly1305-neon-glue.c+1−1
@@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc, · 29 unmodified lines
3030 return crypto_nhpoly1305_update(desc, src, srclen);
3131
3232 do {
33− unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
33+ unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3434
3535 kernel_neon_begin();
3636 crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);
arch/arm64/crypto/poly1305-glue.c+11−4
@@ -143,13 +143,20 @@ void poly1305_update_arch(struct poly1305_desc_ctx *dctx, const u8 *src, · 142 unmodified lines
143143 unsigned int len = round_down(nbytes, POLY1305_BLOCK_SIZE);
144144
145145 if (static_branch_likely(&have_neon) && crypto_simd_usable()) {
146− kernel_neon_begin();
147− poly1305_blocks_neon(&dctx->h, src, len, 1);
148− kernel_neon_end();
146+ do {
147+ unsigned int todo = min_t(unsigned int, len, SZ_4K);
148+
149+ kernel_neon_begin();
150+ poly1305_blocks_neon(&dctx->h, src, todo, 1);
151+ kernel_neon_end();
152+
153+ len -= todo;
154+ src += todo;
155+ } while (len);
149156 } else {
150157 poly1305_blocks(&dctx->h, src, len, 1);
158+ src += len;
151159 }
152− src += len;
153160 nbytes %= POLY1305_BLOCK_SIZE;
154161 }
155162
arch/arm64/include/asm/module.h+0−2
@@ -7,8 +7,6 @@ · 6 unmodified lines
77
88 #include <asm-generic/module.h>
99
10−#define MODULE_ARCH_VERMAGIC "aarch64"
11−
1210 #ifdef CONFIG_ARM64_MODULE_PLTS
1311 struct mod_plt_sec {
1412 int plt_shndx;
arch/arm64/include/asm/pointer_auth.h+6−3
@@ -47,7 +47,7 @@ static inline void ptrauth_keys_init_user(struct ptrauth_keys_user *keys) · 46 unmodified lines
4747 get_random_bytes(&keys->apga, sizeof(keys->apga));
4848 }
4949
50−#define __ptrauth_key_install(k, v) \
50+#define __ptrauth_key_install_nosync(k, v) \
5151 do { \
5252 struct ptrauth_key __pki_v = (v); \
5353 write_sysreg_s(__pki_v.lo, SYS_ ## k ## KEYLO_EL1); \
@@ -62,8 +62,11 @@ static __always_inline void ptrauth_keys_init_kernel(struct ptrauth_keys_kernel · 8 unmodified lines
6262
6363 static __always_inline void ptrauth_keys_switch_kernel(struct ptrauth_keys_kernel *keys)
6464 {
65− if (system_supports_address_auth())
66− __ptrauth_key_install(APIA, keys->apia);
65+ if (!system_supports_address_auth())
66+ return;
67+
68+ __ptrauth_key_install_nosync(APIA, keys->apia);
69+ isb();
6770 }
6871
6972 extern int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg);
arch/arm64/include/asm/vermagic.h+10−0
@@ -0,0 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+/*
3+ * Copyright (C) 2012 ARM Ltd.
4+ */
5+#ifndef _ASM_VERMAGIC_H
6+#define _ASM_VERMAGIC_H
7+
8+#define MODULE_ARCH_VERMAGIC "aarch64"
9+
10+#endif /* _ASM_VERMAGIC_H */
arch/arm64/kernel/vdso/Makefile+1−1
@@ -32,7 +32,7 @@ UBSAN_SANITIZE := n · 31 unmodified lines
3232 OBJECT_FILES_NON_STANDARD := y
3333 KCOV_INSTRUMENT := n
3434
35−CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny
35+CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables
3636
3737 ifneq ($(c-gettimeofday-y),)
3838 CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
arch/arm64/kvm/guest.c+7−0
@@ -200,6 +200,13 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 199 unmodified lines
200200 }
201201
202202 memcpy((u32 *)regs + off, valp, KVM_REG_SIZE(reg->id));
203+
204+ if (*vcpu_cpsr(vcpu) & PSR_MODE32_BIT) {
205+ int i;
206+
207+ for (i = 0; i < 16; i++)
208+ *vcpu_reg32(vcpu, i) = (u32)*vcpu_reg32(vcpu, i);
209+ }
203210 out:
204211 return err;
205212 }
arch/arm64/kvm/hyp/entry.S+23−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 #define CPU_GP_REG_OFFSET(x) (CPU_GP_REGS + x)
2020 #define CPU_XREG_OFFSET(x) CPU_GP_REG_OFFSET(CPU_USER_PT_REGS + 8*x)
21+#define CPU_SP_EL0_OFFSET (CPU_XREG_OFFSET(30) + 8)
2122
2223 .text
2324 .pushsection .hyp.text, "ax"
@@ -47,6 +48,16 @@ · 23 unmodified lines
4748 ldp x29, lr, [\ctxt, #CPU_XREG_OFFSET(29)]
4849 .endm
4950
51+.macro save_sp_el0 ctxt, tmp
52+ mrs \tmp, sp_el0
53+ str \tmp, [\ctxt, #CPU_SP_EL0_OFFSET]
54+.endm
55+
56+.macro restore_sp_el0 ctxt, tmp
57+ ldr \tmp, [\ctxt, #CPU_SP_EL0_OFFSET]
58+ msr sp_el0, \tmp
59+.endm
60+
5061 /*
5162 * u64 __guest_enter(struct kvm_vcpu *vcpu,
5263 * struct kvm_cpu_context *host_ctxt);
@@ -60,6 +71,9 @@ SYM_FUNC_START(__guest_enter) · 7 unmodified lines
6071 // Store the host regs
6172 save_callee_saved_regs x1
6273
74+ // Save the host's sp_el0
75+ save_sp_el0 x1, x2
76+
6377 // Now the host state is stored if we have a pending RAS SError it must
6478 // affect the host. If any asynchronous exception is pending we defer
6579 // the guest entry. The DSB isn't necessary before v8.2 as any SError
@@ -83,6 +97,9 @@ alternative_else_nop_endif · 17 unmodified lines
8397 // when this feature is enabled for kernel code.
8498 ptrauth_switch_to_guest x29, x0, x1, x2
8599
100+ // Restore the guest's sp_el0
101+ restore_sp_el0 x29, x0
102+
86103 // Restore guest regs x0-x17
87104 ldp x0, x1, [x29, #CPU_XREG_OFFSET(0)]
88105 ldp x2, x3, [x29, #CPU_XREG_OFFSET(2)]
@@ -130,6 +147,9 @@ SYM_INNER_LABEL(__guest_exit, SYM_L_GLOBAL) · 41 unmodified lines
130147 // Store the guest regs x18-x29, lr
131148 save_callee_saved_regs x1
132149
150+ // Store the guest's sp_el0
151+ save_sp_el0 x1, x2
152+
133153 get_host_ctxt x2, x3
134154
135155 // Macro ptrauth_switch_to_guest format:
@@ -139,6 +159,9 @@ SYM_INNER_LABEL(__guest_exit, SYM_L_GLOBAL) · 3 unmodified lines
139159 // when this feature is enabled for kernel code.
140160 ptrauth_switch_to_host x1, x2, x3, x4, x5
141161
162+ // Restore the hosts's sp_el0
163+ restore_sp_el0 x2, x3
164+
142165 // Now restore the host regs
143166 restore_callee_saved_regs x2
144167
arch/arm64/kvm/hyp/hyp-entry.S+0−1
@@ -198,7 +198,6 @@ SYM_CODE_END(__hyp_panic) · 197 unmodified lines
198198 .macro invalid_vector label, target = __hyp_panic
199199 .align 2
200200 SYM_CODE_START(\label)
201−\label:
202201 b \target
203202 SYM_CODE_END(\label)
204203 .endm
arch/arm64/kvm/hyp/sysreg-sr.c+3−14
@@ -15,8 +15,9 @@ · 14 unmodified lines
1515 /*
1616 * Non-VHE: Both host and guest must save everything.
1717 *
18− * VHE: Host and guest must save mdscr_el1 and sp_el0 (and the PC and pstate,
19− * which are handled as part of the el2 return state) on every switch.
18+ * VHE: Host and guest must save mdscr_el1 and sp_el0 (and the PC and
19+ * pstate, which are handled as part of the el2 return state) on every
20+ * switch (sp_el0 is being dealt with in the assembly code).
2021 * tpidr_el0 and tpidrro_el0 only need to be switched when going
2122 * to host userspace or a different VCPU. EL1 registers only need to be
2223 * switched when potentially going to run a different VCPU. The latter two
@@ -26,12 +27,6 @@ · 3 unmodified lines
2627 static void __hyp_text __sysreg_save_common_state(struct kvm_cpu_context *ctxt)
2728 {
2829 ctxt->sys_regs[MDSCR_EL1] = read_sysreg(mdscr_el1);
29−
30− /*
31− * The host arm64 Linux uses sp_el0 to point to 'current' and it must
32− * therefore be saved/restored on every entry/exit to/from the guest.
33− */
34− ctxt->gp_regs.regs.sp = read_sysreg(sp_el0);
3530 }
3631
3732 static void __hyp_text __sysreg_save_user_state(struct kvm_cpu_context *ctxt)
@@ -99,12 +94,6 @@ NOKPROBE_SYMBOL(sysreg_save_guest_state_vhe); · 61 unmodified lines
9994 static void __hyp_text __sysreg_restore_common_state(struct kvm_cpu_context *ctxt)
10095 {
10196 write_sysreg(ctxt->sys_regs[MDSCR_EL1], mdscr_el1);
102−
103− /*
104− * The host arm64 Linux uses sp_el0 to point to 'current' and it must
105− * therefore be saved/restored on every entry/exit to/from the guest.
106− */
107− write_sysreg(ctxt->gp_regs.regs.sp, sp_el0);
10897 }
10998
11099 static void __hyp_text __sysreg_restore_user_state(struct kvm_cpu_context *ctxt)
arch/arm64/mm/hugetlbpage.c+2−0
@@ -230,6 +230,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, · 229 unmodified lines
230230 ptep = (pte_t *)pudp;
231231 } else if (sz == (CONT_PTE_SIZE)) {
232232 pmdp = pmd_alloc(mm, pudp, addr);
233+ if (!pmdp)
234+ return NULL;
233235
234236 WARN_ON(addr & (sz - 1));
235237 /*
arch/h8300/kernel/.gitignore+2−0
@@ -0,0 +1,2 @@
1+# SPDX-License-Identifier: GPL-2.0-only
2+vmlinux.lds
arch/hexagon/include/asm/vermagic.hrenamed from arch/hexagon/include/asm/module.h+4−4
@@ -3,11 +3,11 @@ · 2 unmodified lines
33 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
44 */
55
6−#ifndef _ASM_MODULE_H
7−#define _ASM_MODULE_H
6+#ifndef _ASM_VERMAGIC_H
7+#define _ASM_VERMAGIC_H
88
9−#include <asm-generic/module.h>
9+#include <linux/stringify.h>
1010
1111 #define MODULE_ARCH_VERMAGIC __stringify(PROCESSOR_MODEL_NAME) " "
1212
13−#endif
13+#endif /* _ASM_VERMAGIC_H */
arch/ia64/include/asm/module.h+0−4
@@ -26,10 +26,6 @@ struct mod_arch_specific { · 25 unmodified lines
2626 unsigned int next_got_entry; /* index of next available got entry */
2727 };
2828
29−#define MODULE_PROC_FAMILY "ia64"
30−#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY \
31− "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
32−
3329 #define ARCH_SHF_SMALL SHF_IA_64_SHORT
3430
3531 #endif /* _ASM_IA64_MODULE_H */
arch/ia64/include/asm/vermagic.h+15−0
@@ -0,0 +1,15 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2003 Hewlett-Packard Co
4+ * David Mosberger-Tang <davidm@hpl.hp.com>
5+ */
6+
7+#ifndef _ASM_VERMAGIC_H
8+#define _ASM_VERMAGIC_H
9+
10+#include <linux/stringify.h>
11+
12+#define MODULE_ARCH_VERMAGIC "ia64" \
13+ "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
14+
15+#endif /* _ASM_VERMAGIC_H */
arch/mips/include/asm/module.h+0−61
@@ -83,65 +83,4 @@ search_module_dbetables(unsigned long addr) · 82 unmodified lines
8383 }
8484 #endif
8585
86−#ifdef CONFIG_CPU_BMIPS
87−#define MODULE_PROC_FAMILY "BMIPS "
88−#elif defined CONFIG_CPU_MIPS32_R1
89−#define MODULE_PROC_FAMILY "MIPS32_R1 "
90−#elif defined CONFIG_CPU_MIPS32_R2
91−#define MODULE_PROC_FAMILY "MIPS32_R2 "
92−#elif defined CONFIG_CPU_MIPS32_R6
93−#define MODULE_PROC_FAMILY "MIPS32_R6 "
94−#elif defined CONFIG_CPU_MIPS64_R1
95−#define MODULE_PROC_FAMILY "MIPS64_R1 "
96−#elif defined CONFIG_CPU_MIPS64_R2
97−#define MODULE_PROC_FAMILY "MIPS64_R2 "
98−#elif defined CONFIG_CPU_MIPS64_R6
99−#define MODULE_PROC_FAMILY "MIPS64_R6 "
100−#elif defined CONFIG_CPU_R3000
101−#define MODULE_PROC_FAMILY "R3000 "
102−#elif defined CONFIG_CPU_TX39XX
103−#define MODULE_PROC_FAMILY "TX39XX "
104−#elif defined CONFIG_CPU_VR41XX
105−#define MODULE_PROC_FAMILY "VR41XX "
106−#elif defined CONFIG_CPU_R4X00
107−#define MODULE_PROC_FAMILY "R4X00 "
108−#elif defined CONFIG_CPU_TX49XX
109−#define MODULE_PROC_FAMILY "TX49XX "
110−#elif defined CONFIG_CPU_R5000
111−#define MODULE_PROC_FAMILY "R5000 "
112−#elif defined CONFIG_CPU_R5500
113−#define MODULE_PROC_FAMILY "R5500 "
114−#elif defined CONFIG_CPU_NEVADA
115−#define MODULE_PROC_FAMILY "NEVADA "
116−#elif defined CONFIG_CPU_R10000
117−#define MODULE_PROC_FAMILY "R10000 "
118−#elif defined CONFIG_CPU_RM7000
119−#define MODULE_PROC_FAMILY "RM7000 "
120−#elif defined CONFIG_CPU_SB1
121−#define MODULE_PROC_FAMILY "SB1 "
122−#elif defined CONFIG_CPU_LOONGSON32
123−#define MODULE_PROC_FAMILY "LOONGSON32 "
124−#elif defined CONFIG_CPU_LOONGSON2EF
125−#define MODULE_PROC_FAMILY "LOONGSON2EF "
126−#elif defined CONFIG_CPU_LOONGSON64
127−#define MODULE_PROC_FAMILY "LOONGSON64 "
128−#elif defined CONFIG_CPU_CAVIUM_OCTEON
129−#define MODULE_PROC_FAMILY "OCTEON "
130−#elif defined CONFIG_CPU_XLR
131−#define MODULE_PROC_FAMILY "XLR "
132−#elif defined CONFIG_CPU_XLP
133−#define MODULE_PROC_FAMILY "XLP "
134−#else
135−#error MODULE_PROC_FAMILY undefined for your processor configuration
136−#endif
137−
138−#ifdef CONFIG_32BIT
139−#define MODULE_KERNEL_TYPE "32BIT "
140−#elif defined CONFIG_64BIT
141−#define MODULE_KERNEL_TYPE "64BIT "
142−#endif
143−
144−#define MODULE_ARCH_VERMAGIC \
145− MODULE_PROC_FAMILY MODULE_KERNEL_TYPE
146−
14786 #endif /* _ASM_MODULE_H */
arch/mips/include/asm/vermagic.h+66−0
@@ -0,0 +1,66 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_VERMAGIC_H
3+#define _ASM_VERMAGIC_H
4+
5+#ifdef CONFIG_CPU_BMIPS
6+#define MODULE_PROC_FAMILY "BMIPS "
7+#elif defined CONFIG_CPU_MIPS32_R1
8+#define MODULE_PROC_FAMILY "MIPS32_R1 "
9+#elif defined CONFIG_CPU_MIPS32_R2
10+#define MODULE_PROC_FAMILY "MIPS32_R2 "
11+#elif defined CONFIG_CPU_MIPS32_R6
12+#define MODULE_PROC_FAMILY "MIPS32_R6 "
13+#elif defined CONFIG_CPU_MIPS64_R1
14+#define MODULE_PROC_FAMILY "MIPS64_R1 "
15+#elif defined CONFIG_CPU_MIPS64_R2
16+#define MODULE_PROC_FAMILY "MIPS64_R2 "
17+#elif defined CONFIG_CPU_MIPS64_R6
18+#define MODULE_PROC_FAMILY "MIPS64_R6 "
19+#elif defined CONFIG_CPU_R3000
20+#define MODULE_PROC_FAMILY "R3000 "
21+#elif defined CONFIG_CPU_TX39XX
22+#define MODULE_PROC_FAMILY "TX39XX "
23+#elif defined CONFIG_CPU_VR41XX
24+#define MODULE_PROC_FAMILY "VR41XX "
25+#elif defined CONFIG_CPU_R4X00
26+#define MODULE_PROC_FAMILY "R4X00 "
27+#elif defined CONFIG_CPU_TX49XX
28+#define MODULE_PROC_FAMILY "TX49XX "
29+#elif defined CONFIG_CPU_R5000
30+#define MODULE_PROC_FAMILY "R5000 "
31+#elif defined CONFIG_CPU_R5500
32+#define MODULE_PROC_FAMILY "R5500 "
33+#elif defined CONFIG_CPU_NEVADA
34+#define MODULE_PROC_FAMILY "NEVADA "
35+#elif defined CONFIG_CPU_R10000
36+#define MODULE_PROC_FAMILY "R10000 "
37+#elif defined CONFIG_CPU_RM7000
38+#define MODULE_PROC_FAMILY "RM7000 "
39+#elif defined CONFIG_CPU_SB1
40+#define MODULE_PROC_FAMILY "SB1 "
41+#elif defined CONFIG_CPU_LOONGSON32
42+#define MODULE_PROC_FAMILY "LOONGSON32 "
43+#elif defined CONFIG_CPU_LOONGSON2EF
44+#define MODULE_PROC_FAMILY "LOONGSON2EF "
45+#elif defined CONFIG_CPU_LOONGSON64
46+#define MODULE_PROC_FAMILY "LOONGSON64 "
47+#elif defined CONFIG_CPU_CAVIUM_OCTEON
48+#define MODULE_PROC_FAMILY "OCTEON "
49+#elif defined CONFIG_CPU_XLR
50+#define MODULE_PROC_FAMILY "XLR "
51+#elif defined CONFIG_CPU_XLP
52+#define MODULE_PROC_FAMILY "XLP "
53+#else
54+#error MODULE_PROC_FAMILY undefined for your processor configuration
55+#endif
56+
57+#ifdef CONFIG_32BIT
58+#define MODULE_KERNEL_TYPE "32BIT "
59+#elif defined CONFIG_64BIT
60+#define MODULE_KERNEL_TYPE "64BIT "
61+#endif
62+
63+#define MODULE_ARCH_VERMAGIC \
64+ MODULE_PROC_FAMILY MODULE_KERNEL_TYPE
65+
66+#endif /* _ASM_VERMAGIC_H */
arch/nds32/include/asm/vermagic.hrenamed from arch/nds32/include/asm/module.h+3−5
@@ -1,11 +1,9 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 // Copyright (C) 2005-2017 Andes Technology Corporation
33
4−#ifndef _ASM_NDS32_MODULE_H
5−#define _ASM_NDS32_MODULE_H
6−
7−#include <asm-generic/module.h>
4+#ifndef _ASM_VERMAGIC_H
5+#define _ASM_VERMAGIC_H
86
97 #define MODULE_ARCH_VERMAGIC "NDS32v3"
108
11−#endif /* _ASM_NDS32_MODULE_H */
9+#endif /* _ASM_VERMAGIC_H */
arch/powerpc/include/asm/module.h+0−18
@@ -3,28 +3,10 @@ · 2 unmodified lines
33 #define _ASM_POWERPC_MODULE_H
44 #ifdef __KERNEL__
55
6−/*
7− */
8−
96 #include <linux/list.h>
107 #include <asm/bug.h>
118 #include <asm-generic/module.h>
129
13−
14−#ifdef CONFIG_MPROFILE_KERNEL
15−#define MODULE_ARCH_VERMAGIC_FTRACE "mprofile-kernel "
16−#else
17−#define MODULE_ARCH_VERMAGIC_FTRACE ""
18−#endif
19−
20−#ifdef CONFIG_RELOCATABLE
21−#define MODULE_ARCH_VERMAGIC_RELOCATABLE "relocatable "
22−#else
23−#define MODULE_ARCH_VERMAGIC_RELOCATABLE ""
24−#endif
25−
26−#define MODULE_ARCH_VERMAGIC MODULE_ARCH_VERMAGIC_FTRACE MODULE_ARCH_VERMAGIC_RELOCATABLE
27−
2810 #ifndef __powerpc64__
2911 /*
3012 * Thanks to Paul M for explaining this.
arch/powerpc/include/asm/vermagic.h+20−0
@@ -0,0 +1,20 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_VERMAGIC_H
3+#define _ASM_VERMAGIC_H
4+
5+#ifdef CONFIG_MPROFILE_KERNEL
6+#define MODULE_ARCH_VERMAGIC_FTRACE "mprofile-kernel "
7+#else
8+#define MODULE_ARCH_VERMAGIC_FTRACE ""
9+#endif
10+
11+#ifdef CONFIG_RELOCATABLE
12+#define MODULE_ARCH_VERMAGIC_RELOCATABLE "relocatable "
13+#else
14+#define MODULE_ARCH_VERMAGIC_RELOCATABLE ""
15+#endif
16+
17+#define MODULE_ARCH_VERMAGIC \
18+ MODULE_ARCH_VERMAGIC_FTRACE MODULE_ARCH_VERMAGIC_RELOCATABLE
19+
20+#endif /* _ASM_VERMAGIC_H */
arch/powerpc/kernel/entry_32.S+1−1
@@ -732,7 +732,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPE) · 731 unmodified lines
732732 stw r10,_CCR(r1)
733733 stw r1,KSP(r3) /* Set old stack pointer */
734734
735− kuap_check r2, r4
735+ kuap_check r2, r0
736736 #ifdef CONFIG_SMP
737737 /* We need a sync somewhere here to make sure that if the
738738 * previous task gets rescheduled on another CPU, it sees all
arch/powerpc/kernel/setup_64.c+2−0
@@ -534,6 +534,8 @@ static bool __init parse_cache_info(struct device_node *np, · 533 unmodified lines
534534 lsizep = of_get_property(np, propnames[3], NULL);
535535 if (bsizep == NULL)
536536 bsizep = lsizep;
537+ if (lsizep == NULL)
538+ lsizep = bsizep;
537539 if (lsizep != NULL)
538540 lsize = be32_to_cpu(*lsizep);
539541 if (bsizep != NULL)
arch/powerpc/kernel/vmlinux.lds.S+1−0
@@ -90,6 +90,7 @@ SECTIONS · 89 unmodified lines
9090 #ifdef CONFIG_PPC64
9191 *(.tramp.ftrace.text);
9292 #endif
93+ NOINSTR_TEXT
9394 SCHED_TEXT
9495 CPUIDLE_TEXT
9596 LOCK_TEXT
arch/powerpc/kvm/book3s_64_mmu_hv.c+5−4
@@ -604,18 +604,19 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu, · 603 unmodified lines
604604 */
605605 local_irq_disable();
606606 ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
607+ pte = __pte(0);
608+ if (ptep)
609+ pte = *ptep;
610+ local_irq_enable();
607611 /*
608612 * If the PTE disappeared temporarily due to a THP
609613 * collapse, just return and let the guest try again.
610614 */
611− if (!ptep) {
612− local_irq_enable();
615+ if (!pte_present(pte)) {
613616 if (page)
614617 put_page(page);
615618 return RESUME_GUEST;
616619 }
617− pte = *ptep;
618− local_irq_enable();
619620 hpa = pte_pfn(pte) << PAGE_SHIFT;
620621 pte_size = PAGE_SIZE;
621622 if (shift)
arch/powerpc/kvm/book3s_64_mmu_radix.c+5−4
@@ -815,18 +815,19 @@ int kvmppc_book3s_instantiate_page(struct kvm_vcpu *vcpu, · 814 unmodified lines
815815 */
816816 local_irq_disable();
817817 ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
818+ pte = __pte(0);
819+ if (ptep)
820+ pte = *ptep;
821+ local_irq_enable();
818822 /*
819823 * If the PTE disappeared temporarily due to a THP
820824 * collapse, just return and let the guest try again.
821825 */
822− if (!ptep) {
823− local_irq_enable();
826+ if (!pte_present(pte)) {
824827 if (page)
825828 put_page(page);
826829 return RESUME_GUEST;
827830 }
828− pte = *ptep;
829− local_irq_enable();
830831
831832 /* If we're logging dirty pages, always map single pages */
832833 large_enable = !(memslot->flags & KVM_MEM_LOG_DIRTY_PAGES);
arch/powerpc/kvm/powerpc.c+1−0
@@ -521,6 +521,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 520 unmodified lines
521521 case KVM_CAP_IOEVENTFD:
522522 case KVM_CAP_DEVICE_CTRL:
523523 case KVM_CAP_IMMEDIATE_EXIT:
524+ case KVM_CAP_SET_GUEST_DEBUG:
524525 r = 1;
525526 break;
526527 case KVM_CAP_PPC_GUEST_DEBUG_SSTEP:
arch/powerpc/mm/nohash/8xx.c+3−0
@@ -185,6 +185,7 @@ void mmu_mark_initmem_nx(void) · 184 unmodified lines
185185 mmu_mapin_ram_chunk(etext8, einittext8, PAGE_KERNEL);
186186 }
187187 }
188+ _tlbil_all();
188189 }
189190
190191 #ifdef CONFIG_STRICT_KERNEL_RWX
@@ -199,6 +200,8 @@ void mmu_mark_rodata_ro(void) · 8 unmodified lines
199200 ~(LARGE_PAGE_SIZE_8M - 1)));
200201 mmu_patch_addis(&patch__dtlbmiss_romem_top, -__pa(_sinittext));
201202
203+ _tlbil_all();
204+
202205 /* Update page tables for PTDUMP and BDI */
203206 mmu_mapin_ram_chunk(0, sinittext, __pgprot(0));
204207 mmu_mapin_ram_chunk(0, etext, PAGE_KERNEL_ROX);
arch/powerpc/platforms/Kconfig.cputype+1−1
@@ -397,7 +397,7 @@ config PPC_KUAP · 396 unmodified lines
397397
398398 config PPC_KUAP_DEBUG
399399 bool "Extra debugging for Kernel Userspace Access Protection"
400− depends on PPC_KUAP && (PPC_RADIX_MMU || PPC_32)
400+ depends on PPC_KUAP && (PPC_RADIX_MMU || PPC32)
401401 help
402402 Add extra debugging for Kernel Userspace Access Protection (KUAP)
403403 If you're unsure, say N.
arch/riscv/Kconfig+1−1
@@ -60,7 +60,7 @@ config RISCV · 59 unmodified lines
6060 select ARCH_HAS_GIGANTIC_PAGE
6161 select ARCH_HAS_SET_DIRECT_MAP
6262 select ARCH_HAS_SET_MEMORY
63− select ARCH_HAS_STRICT_KERNEL_RWX
63+ select ARCH_HAS_STRICT_KERNEL_RWX if MMU
6464 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
6565 select SPARSEMEM_STATIC if 32BIT
6666 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
arch/riscv/include/asm/csr.h+0−3
@@ -51,13 +51,10 @@ · 50 unmodified lines
5151 #define CAUSE_IRQ_FLAG (_AC(1, UL) << (__riscv_xlen - 1))
5252
5353 /* Interrupt causes (minus the high bit) */
54−#define IRQ_U_SOFT 0
5554 #define IRQ_S_SOFT 1
5655 #define IRQ_M_SOFT 3
57−#define IRQ_U_TIMER 4
5856 #define IRQ_S_TIMER 5
5957 #define IRQ_M_TIMER 7
60−#define IRQ_U_EXT 8
6158 #define IRQ_S_EXT 9
6259 #define IRQ_M_EXT 11
6360
arch/riscv/include/asm/hwcap.h+22−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #ifndef _ASM_RISCV_HWCAP_H
99 #define _ASM_RISCV_HWCAP_H
1010
11+#include <linux/bits.h>
1112 #include <uapi/asm/hwcap.h>
1213
1314 #ifndef __ASSEMBLY__
@@ -22,6 +23,27 @@ enum { · 8 unmodified lines
2223 };
2324
2425 extern unsigned long elf_hwcap;
26+
27+#define RISCV_ISA_EXT_a ('a' - 'a')
28+#define RISCV_ISA_EXT_c ('c' - 'a')
29+#define RISCV_ISA_EXT_d ('d' - 'a')
30+#define RISCV_ISA_EXT_f ('f' - 'a')
31+#define RISCV_ISA_EXT_h ('h' - 'a')
32+#define RISCV_ISA_EXT_i ('i' - 'a')
33+#define RISCV_ISA_EXT_m ('m' - 'a')
34+#define RISCV_ISA_EXT_s ('s' - 'a')
35+#define RISCV_ISA_EXT_u ('u' - 'a')
36+
37+#define RISCV_ISA_EXT_MAX 64
38+
39+unsigned long riscv_isa_extension_base(const unsigned long *isa_bitmap);
40+
41+#define riscv_isa_extension_mask(ext) BIT_MASK(RISCV_ISA_EXT_##ext)
42+
43+bool __riscv_isa_extension_available(const unsigned long *isa_bitmap, int bit);
44+#define riscv_isa_extension_available(isa_bitmap, ext) \
45+ __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_##ext)
46+
2547 #endif
2648
2749 #endif /* _ASM_RISCV_HWCAP_H */
arch/riscv/include/asm/module.h+0−2
@@ -6,8 +6,6 @@ · 5 unmodified lines
66
77 #include <asm-generic/module.h>
88
9−#define MODULE_ARCH_VERMAGIC "riscv"
10−
119 struct module;
1210 unsigned long module_emit_got_entry(struct module *mod, unsigned long val);
1311 unsigned long module_emit_plt_entry(struct module *mod, unsigned long val);
arch/riscv/include/asm/set_memory.h+0−8
@@ -22,14 +22,6 @@ static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } · 21 unmodified lines
2222 static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
2323 #endif
2424
25−#ifdef CONFIG_STRICT_KERNEL_RWX
26−void set_kernel_text_ro(void);
27−void set_kernel_text_rw(void);
28−#else
29−static inline void set_kernel_text_ro(void) { }
30−static inline void set_kernel_text_rw(void) { }
31−#endif
32−
3325 int set_direct_map_invalid_noflush(struct page *page);
3426 int set_direct_map_default_noflush(struct page *page);
3527
arch/riscv/include/asm/vermagic.h+9−0
@@ -0,0 +1,9 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/* Copyright (C) 2017 Andes Technology Corporation */
3+
4+#ifndef _ASM_VERMAGIC_H
5+#define _ASM_VERMAGIC_H
6+
7+#define MODULE_ARCH_VERMAGIC "riscv"
8+
9+#endif /* _ASM_VERMAGIC_H */
arch/riscv/kernel/cpu_ops.c+2−2
@@ -15,8 +15,8 @@ · 14 unmodified lines
1515
1616 const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
1717
18−void *__cpu_up_stack_pointer[NR_CPUS];
19−void *__cpu_up_task_pointer[NR_CPUS];
18+void *__cpu_up_stack_pointer[NR_CPUS] __section(.data);
19+void *__cpu_up_task_pointer[NR_CPUS] __section(.data);
2020
2121 extern const struct cpu_operations cpu_ops_sbi;
2222 extern const struct cpu_operations cpu_ops_spinwait;
arch/riscv/kernel/cpufeature.c+80−3
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 * Copyright (C) 2017 SiFive
77 */
88
9+#include <linux/bitmap.h>
910 #include <linux/of.h>
1011 #include <asm/processor.h>
1112 #include <asm/hwcap.h>
@@ -13,15 +14,57 @@ · 1 unmodified line
1314 #include <asm/switch_to.h>
1415
1516 unsigned long elf_hwcap __read_mostly;
17+
18+/* Host ISA bitmap */
19+static DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX) __read_mostly;
20+
1621 #ifdef CONFIG_FPU
1722 bool has_fpu __read_mostly;
1823 #endif
1924
25+/**
26+ * riscv_isa_extension_base() - Get base extension word
27+ *
28+ * @isa_bitmap: ISA bitmap to use
29+ * Return: base extension word as unsigned long value
30+ *
31+ * NOTE: If isa_bitmap is NULL then Host ISA bitmap will be used.
32+ */
33+unsigned long riscv_isa_extension_base(const unsigned long *isa_bitmap)
34+{
35+ if (!isa_bitmap)
36+ return riscv_isa[0];
37+ return isa_bitmap[0];
38+}
39+EXPORT_SYMBOL_GPL(riscv_isa_extension_base);
40+
41+/**
42+ * __riscv_isa_extension_available() - Check whether given extension
43+ * is available or not
44+ *
45+ * @isa_bitmap: ISA bitmap to use
46+ * @bit: bit position of the desired extension
47+ * Return: true or false
48+ *
49+ * NOTE: If isa_bitmap is NULL then Host ISA bitmap will be used.
50+ */
51+bool __riscv_isa_extension_available(const unsigned long *isa_bitmap, int bit)
52+{
53+ const unsigned long *bmap = (isa_bitmap) ? isa_bitmap : riscv_isa;
54+
55+ if (bit >= RISCV_ISA_EXT_MAX)
56+ return false;
57+
58+ return test_bit(bit, bmap) ? true : false;
59+}
60+EXPORT_SYMBOL_GPL(__riscv_isa_extension_available);
61+
2062 void riscv_fill_hwcap(void)
2163 {
2264 struct device_node *node;
2365 const char *isa;
24− size_t i;
66+ char print_str[BITS_PER_LONG + 1];
67+ size_t i, j, isa_len;
2568 static unsigned long isa2hwcap[256] = {0};
2669
2770 isa2hwcap['i'] = isa2hwcap['I'] = COMPAT_HWCAP_ISA_I;
@@ -33,8 +76,11 @@ void riscv_fill_hwcap(void) · 5 unmodified lines
3376
3477 elf_hwcap = 0;
3578
79+ bitmap_zero(riscv_isa, RISCV_ISA_EXT_MAX);
80+
3681 for_each_of_cpu_node(node) {
3782 unsigned long this_hwcap = 0;
83+ unsigned long this_isa = 0;
3884
3985 if (riscv_of_processor_hartid(node) < 0)
4086 continue;
@@ -44,8 +90,24 @@ void riscv_fill_hwcap(void) · 3 unmodified lines
4490 continue;
4591 }
4692
47− for (i = 0; i < strlen(isa); ++i)
93+ i = 0;
94+ isa_len = strlen(isa);
95+#if IS_ENABLED(CONFIG_32BIT)
96+ if (!strncmp(isa, "rv32", 4))
97+ i += 4;
98+#elif IS_ENABLED(CONFIG_64BIT)
99+ if (!strncmp(isa, "rv64", 4))
100+ i += 4;
101+#endif
102+ for (; i < isa_len; ++i) {
48103 this_hwcap |= isa2hwcap[(unsigned char)(isa[i])];
104+ /*
105+ * TODO: X, Y and Z extension parsing for Host ISA
106+ * bitmap will be added in-future.
107+ */
108+ if ('a' <= isa[i] && isa[i] < 'x')
109+ this_isa |= (1UL << (isa[i] - 'a'));
110+ }
49111
50112 /*
51113 * All "okay" hart should have same isa. Set HWCAP based on
@@ -56,6 +118,11 @@ void riscv_fill_hwcap(void) · 4 unmodified lines
56118 elf_hwcap &= this_hwcap;
57119 else
58120 elf_hwcap = this_hwcap;
121+
122+ if (riscv_isa[0])
123+ riscv_isa[0] &= this_isa;
124+ else
125+ riscv_isa[0] = this_isa;
59126 }
60127
61128 /* We don't support systems with F but without D, so mask those out
@@ -65,7 +132,17 @@ void riscv_fill_hwcap(void) · 3 unmodified lines
65132 elf_hwcap &= ~COMPAT_HWCAP_ISA_F;
66133 }
67134
68− pr_info("elf_hwcap is 0x%lx\n", elf_hwcap);
135+ memset(print_str, 0, sizeof(print_str));
136+ for (i = 0, j = 0; i < BITS_PER_LONG; i++)
137+ if (riscv_isa[0] & BIT_MASK(i))
138+ print_str[j++] = (char)('a' + i);
139+ pr_info("riscv: ISA extensions %s\n", print_str);
140+
141+ memset(print_str, 0, sizeof(print_str));
142+ for (i = 0, j = 0; i < BITS_PER_LONG; i++)
143+ if (elf_hwcap & BIT_MASK(i))
144+ print_str[j++] = (char)('a' + i);
145+ pr_info("riscv: ELF capabilities %s\n", print_str);
69146
70147 #ifdef CONFIG_FPU
71148 if (elf_hwcap & (COMPAT_HWCAP_ISA_F | COMPAT_HWCAP_ISA_D))
arch/riscv/kernel/sbi.c+10−7
@@ -102,7 +102,7 @@ void sbi_shutdown(void) · 101 unmodified lines
102102 {
103103 sbi_ecall(SBI_EXT_0_1_SHUTDOWN, 0, 0, 0, 0, 0, 0, 0);
104104 }
105−EXPORT_SYMBOL(sbi_set_timer);
105+EXPORT_SYMBOL(sbi_shutdown);
106106
107107 /**
108108 * sbi_clear_ipi() - Clear any pending IPIs for the calling hart.
@@ -113,7 +113,7 @@ void sbi_clear_ipi(void) · 4 unmodified lines
113113 {
114114 sbi_ecall(SBI_EXT_0_1_CLEAR_IPI, 0, 0, 0, 0, 0, 0, 0);
115115 }
116−EXPORT_SYMBOL(sbi_shutdown);
116+EXPORT_SYMBOL(sbi_clear_ipi);
117117
118118 /**
119119 * sbi_set_timer_v01() - Program the timer for next timer event.
@@ -167,6 +167,11 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, · 47 unmodified lines
167167
168168 return result;
169169 }
170+
171+static void sbi_set_power_off(void)
172+{
173+ pm_power_off = sbi_shutdown;
174+}
170175 #else
171176 static void __sbi_set_timer_v01(uint64_t stime_value)
172177 {
@@ -191,6 +196,8 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, · 18 unmodified lines
191196
192197 return 0;
193198 }
199+
200+static void sbi_set_power_off(void) {}
194201 #endif /* CONFIG_RISCV_SBI_V01 */
195202
196203 static void __sbi_set_timer_v02(uint64_t stime_value)
@@ -540,16 +547,12 @@ static inline long sbi_get_firmware_version(void) · 343 unmodified lines
540547 return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION);
541548 }
542549
543−static void sbi_power_off(void)
544−{
545− sbi_shutdown();
546−}
547550
548551 int __init sbi_init(void)
549552 {
550553 int ret;
551554
552− pm_power_off = sbi_power_off;
555+ sbi_set_power_off();
553556 ret = sbi_get_spec_version();
554557 if (ret > 0)
555558 sbi_spec_version = ret;
arch/riscv/kernel/smp.c+2−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010
1111 #include <linux/cpu.h>
1212 #include <linux/interrupt.h>
13+#include <linux/module.h>
1314 #include <linux/profile.h>
1415 #include <linux/smp.h>
1516 #include <linux/sched.h>
@@ -63,6 +64,7 @@ void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out) · 47 unmodified lines
6364 for_each_cpu(cpu, in)
6465 cpumask_set_cpu(cpuid_to_hartid_map(cpu), out);
6566 }
67+EXPORT_SYMBOL_GPL(riscv_cpuid_to_hartid_mask);
6668
6769 bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
6870 {
arch/riscv/kernel/stacktrace.c+2−2
@@ -12,6 +12,8 @@ · 11 unmodified lines
1212 #include <linux/stacktrace.h>
1313 #include <linux/ftrace.h>
1414
15+register unsigned long sp_in_global __asm__("sp");
16+
1517 #ifdef CONFIG_FRAME_POINTER
1618
1719 struct stackframe {
@@ -19,8 +21,6 @@ struct stackframe { · 1 unmodified line
1921 unsigned long ra;
2022 };
2123
22−register unsigned long sp_in_global __asm__("sp");
23−
2424 void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
2525 bool (*fn)(unsigned long, void *), void *arg)
2626 {
arch/riscv/kernel/vdso/Makefile+4−4
@@ -12,7 +12,7 @@ vdso-syms += getcpu · 11 unmodified lines
1212 vdso-syms += flush_icache
1313
1414 # Files to link into the vdso
15−obj-vdso = $(patsubst %, %.o, $(vdso-syms))
15+obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1616
1717 # Build rules
1818 targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
@@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE · 14 unmodified lines
3333 $(call if_changed,vdsold)
3434
3535 # We also create a special relocatable object that should mirror the symbol
36−# table and layout of the linked DSO. With ld -R we can then refer to
37−# these symbols in the kernel code rather than hand-coded addresses.
36+# table and layout of the linked DSO. With ld --just-symbols we can then
37+# refer to these symbols in the kernel code rather than hand-coded addresses.
3838
3939 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
4040 -Wl,--build-id -Wl,--hash-style=both
4141 $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
4242 $(call if_changed,vdsold)
4343
44−LDFLAGS_vdso-syms.o := -r -R
44+LDFLAGS_vdso-syms.o := -r --just-symbols
4545 $(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
4646 $(call if_changed,ld)
4747
arch/riscv/kernel/vdso/note.S+12−0
@@ -0,0 +1,12 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
2+/*
3+ * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text.
4+ * Here we can supply some information useful to userland.
5+ */
6+
7+#include <linux/elfnote.h>
8+#include <linux/version.h>
9+
10+ELFNOTE_START(Linux, 0, "a")
11+ .long LINUX_VERSION_CODE
12+ELFNOTE_END
arch/riscv/mm/init.c+2−17
@@ -150,7 +150,8 @@ void __init setup_bootmem(void) · 149 unmodified lines
150150 memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
151151
152152 set_max_mapnr(PFN_DOWN(mem_size));
153− max_low_pfn = PFN_DOWN(memblock_end_of_DRAM());
153+ max_pfn = PFN_DOWN(memblock_end_of_DRAM());
154+ max_low_pfn = max_pfn;
154155
155156 #ifdef CONFIG_BLK_DEV_INITRD
156157 setup_initrd();
@@ -501,22 +502,6 @@ static inline void setup_vm_final(void) · 344 unmodified lines
501502 #endif /* CONFIG_MMU */
502503
503504 #ifdef CONFIG_STRICT_KERNEL_RWX
504−void set_kernel_text_rw(void)
505−{
506− unsigned long text_start = (unsigned long)_text;
507− unsigned long text_end = (unsigned long)_etext;
508−
509− set_memory_rw(text_start, (text_end - text_start) >> PAGE_SHIFT);
510−}
511−
512−void set_kernel_text_ro(void)
513−{
514− unsigned long text_start = (unsigned long)_text;
515− unsigned long text_end = (unsigned long)_etext;
516−
517− set_memory_ro(text_start, (text_end - text_start) >> PAGE_SHIFT);
518−}
519−
520505 void mark_rodata_ro(void)
521506 {
522507 unsigned long text_start = (unsigned long)_text;
arch/s390/boot/uv.c+0−2
@@ -7,9 +7,7 @@ · 6 unmodified lines
77 #ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
88 int __bootdata_preserved(prot_virt_guest);
99 #endif
10−#if IS_ENABLED(CONFIG_KVM)
1110 struct uv_info __bootdata_preserved(uv_info);
12−#endif
1311
1412 void uv_query_info(void)
1513 {
arch/s390/kernel/diag.c+1−1
@@ -133,7 +133,7 @@ void diag_stat_inc(enum diag_stat_enum nr) · 132 unmodified lines
133133 }
134134 EXPORT_SYMBOL(diag_stat_inc);
135135
136−void diag_stat_inc_norecursion(enum diag_stat_enum nr)
136+void notrace diag_stat_inc_norecursion(enum diag_stat_enum nr)
137137 {
138138 this_cpu_inc(diag_stat.counter[nr]);
139139 trace_s390_diagnose_norecursion(diag_map[nr].code);
arch/s390/kernel/smp.c+2−2
@@ -403,7 +403,7 @@ int smp_find_processor_id(u16 address) · 402 unmodified lines
403403 return -1;
404404 }
405405
406−bool arch_vcpu_is_preempted(int cpu)
406+bool notrace arch_vcpu_is_preempted(int cpu)
407407 {
408408 if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
409409 return false;
@@ -413,7 +413,7 @@ bool arch_vcpu_is_preempted(int cpu) · 3 unmodified lines
413413 }
414414 EXPORT_SYMBOL(arch_vcpu_is_preempted);
415415
416−void smp_yield_cpu(int cpu)
416+void notrace smp_yield_cpu(int cpu)
417417 {
418418 if (!MACHINE_HAS_DIAG9C)
419419 return;
arch/s390/kernel/trace.c+1−1
@@ -14,7 +14,7 @@ EXPORT_TRACEPOINT_SYMBOL(s390_diagnose); · 13 unmodified lines
1414
1515 static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth);
1616
17−void trace_s390_diagnose_norecursion(int diag_nr)
17+void notrace trace_s390_diagnose_norecursion(int diag_nr)
1818 {
1919 unsigned long flags;
2020 unsigned int *depth;
arch/s390/kernel/uv.c+2−1
@@ -23,10 +23,11 @@ · 22 unmodified lines
2323 int __bootdata_preserved(prot_virt_guest);
2424 #endif
2525
26+struct uv_info __bootdata_preserved(uv_info);
27+
2628 #if IS_ENABLED(CONFIG_KVM)
2729 int prot_virt_host;
2830 EXPORT_SYMBOL(prot_virt_host);
29−struct uv_info __bootdata_preserved(uv_info);
3031 EXPORT_SYMBOL(uv_info);
3132
3233 static int __init prot_virt_setup(char *val)
arch/s390/kvm/interrupt.c+1−1
@@ -393,7 +393,7 @@ static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu) · 392 unmodified lines
393393 if (psw_mchk_disabled(vcpu))
394394 active_mask &= ~IRQ_PEND_MCHK_MASK;
395395 /* PV guest cpus can have a single interruption injected at a time. */
396− if (kvm_s390_pv_cpu_is_protected(vcpu) &&
396+ if (kvm_s390_pv_cpu_get_handle(vcpu) &&
397397 vcpu->arch.sie_block->iictl != IICTL_CODE_NONE)
398398 active_mask &= ~(IRQ_PEND_EXT_II_MASK |
399399 IRQ_PEND_IO_MASK |
arch/s390/kvm/kvm-s390.c+4−0
@@ -545,6 +545,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 544 unmodified lines
545545 case KVM_CAP_S390_AIS:
546546 case KVM_CAP_S390_AIS_MIGRATION:
547547 case KVM_CAP_S390_VCPU_RESETS:
548+ case KVM_CAP_SET_GUEST_DEBUG:
548549 r = 1;
549550 break;
550551 case KVM_CAP_S390_HPAGE_1M:
@@ -1939,6 +1940,9 @@ static int gfn_to_memslot_approx(struct kvm_memslots *slots, gfn_t gfn) · 1388 unmodified lines
19391940 start = slot + 1;
19401941 }
19411942
1943+ if (start >= slots->used_slots)
1944+ return slots->used_slots - 1;
1945+
19421946 if (gfn >= memslots[start].base_gfn &&
19431947 gfn < memslots[start].base_gfn + memslots[start].npages) {
19441948 atomic_set(&slots->lru_slot, start);
arch/s390/kvm/priv.c+3−1
@@ -626,10 +626,12 @@ static int handle_pqap(struct kvm_vcpu *vcpu) · 625 unmodified lines
626626 * available for the guest are AQIC and TAPQ with the t bit set
627627 * since we do not set IC.3 (FIII) we currently will only intercept
628628 * the AQIC function code.
629+ * Note: running nested under z/VM can result in intercepts for other
630+ * function codes, e.g. PQAP(QCI). We do not support this and bail out.
629631 */
630632 reg0 = vcpu->run->s.regs.gprs[0];
631633 fc = (reg0 >> 24) & 0xff;
632− if (WARN_ON_ONCE(fc != 0x03))
634+ if (fc != 0x03)
633635 return -EOPNOTSUPP;
634636
635637 /* PQAP instruction is allowed for guest kernel only */
arch/s390/lib/uaccess.c+4−0
@@ -64,10 +64,13 @@ mm_segment_t enable_sacf_uaccess(void) · 63 unmodified lines
6464 {
6565 mm_segment_t old_fs;
6666 unsigned long asce, cr;
67+ unsigned long flags;
6768
6869 old_fs = current->thread.mm_segment;
6970 if (old_fs & 1)
7071 return old_fs;
72+ /* protect against a concurrent page table upgrade */
73+ local_irq_save(flags);
7174 current->thread.mm_segment |= 1;
7275 asce = S390_lowcore.kernel_asce;
7376 if (likely(old_fs == USER_DS)) {
@@ -83,6 +86,7 @@ mm_segment_t enable_sacf_uaccess(void) · 9 unmodified lines
8386 __ctl_load(asce, 7, 7);
8487 set_cpu_flag(CIF_ASCE_SECONDARY);
8588 }
89+ local_irq_restore(flags);
8690 return old_fs;
8791 }
8892 EXPORT_SYMBOL(enable_sacf_uaccess);
arch/s390/mm/pgalloc.c+14−2
@@ -70,8 +70,20 @@ static void __crst_table_upgrade(void *arg) · 69 unmodified lines
7070 {
7171 struct mm_struct *mm = arg;
7272
73− if (current->active_mm == mm)
74− set_user_asce(mm);
73+ /* we must change all active ASCEs to avoid the creation of new TLBs */
74+ if (current->active_mm == mm) {
75+ S390_lowcore.user_asce = mm->context.asce;
76+ if (current->thread.mm_segment == USER_DS) {
77+ __ctl_load(S390_lowcore.user_asce, 1, 1);
78+ /* Mark user-ASCE present in CR1 */
79+ clear_cpu_flag(CIF_ASCE_PRIMARY);
80+ }
81+ if (current->thread.mm_segment == USER_DS_SACF) {
82+ __ctl_load(S390_lowcore.user_asce, 7, 7);
83+ /* enable_sacf_uaccess does all or nothing */
84+ WARN_ON(!test_cpu_flag(CIF_ASCE_SECONDARY));
85+ }
86+ }
7587 __tlb_flush_local();
7688 }
7789
arch/s390/pci/pci_irq.c+3−2
@@ -115,7 +115,6 @@ static struct irq_chip zpci_irq_chip = { · 114 unmodified lines
115115 .name = "PCI-MSI",
116116 .irq_unmask = pci_msi_unmask_irq,
117117 .irq_mask = pci_msi_mask_irq,
118− .irq_set_affinity = zpci_set_irq_affinity,
119118 };
120119
121120 static void zpci_handle_cpu_local_irq(bool rescan)
@@ -276,7 +275,9 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) · 154 unmodified lines
276275 rc = -EIO;
277276 if (hwirq - bit >= msi_vecs)
278277 break;
279− irq = __irq_alloc_descs(-1, 0, 1, 0, THIS_MODULE, msi->affinity);
278+ irq = __irq_alloc_descs(-1, 0, 1, 0, THIS_MODULE,
279+ (irq_delivery == DIRECTED) ?
280+ msi->affinity : NULL);
280281 if (irq < 0)
281282 return -ENOMEM;
282283 rc = irq_set_msi_desc(irq, msi);
arch/sh/include/asm/module.h+0−28
@@ -11,32 +11,4 @@ struct mod_arch_specific { · 10 unmodified lines
1111 };
1212 #endif
1313
14−#ifdef CONFIG_CPU_LITTLE_ENDIAN
15−# ifdef CONFIG_CPU_SH2
16−# define MODULE_PROC_FAMILY "SH2LE "
17−# elif defined CONFIG_CPU_SH3
18−# define MODULE_PROC_FAMILY "SH3LE "
19−# elif defined CONFIG_CPU_SH4
20−# define MODULE_PROC_FAMILY "SH4LE "
21−# elif defined CONFIG_CPU_SH5
22−# define MODULE_PROC_FAMILY "SH5LE "
23−# else
24−# error unknown processor family
25−# endif
26−#else
27−# ifdef CONFIG_CPU_SH2
28−# define MODULE_PROC_FAMILY "SH2BE "
29−# elif defined CONFIG_CPU_SH3
30−# define MODULE_PROC_FAMILY "SH3BE "
31−# elif defined CONFIG_CPU_SH4
32−# define MODULE_PROC_FAMILY "SH4BE "
33−# elif defined CONFIG_CPU_SH5
34−# define MODULE_PROC_FAMILY "SH5BE "
35−# else
36−# error unknown processor family
37−# endif
38−#endif
39−
40−#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
41−
4214 #endif /* _ASM_SH_MODULE_H */
arch/sh/include/asm/vermagic.h+34−0
@@ -0,0 +1,34 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef _ASM_VERMAGIC_H
4+#define _ASM_VERMAGIC_H
5+
6+#ifdef CONFIG_CPU_LITTLE_ENDIAN
7+# ifdef CONFIG_CPU_SH2
8+# define MODULE_PROC_FAMILY "SH2LE "
9+# elif defined CONFIG_CPU_SH3
10+# define MODULE_PROC_FAMILY "SH3LE "
11+# elif defined CONFIG_CPU_SH4
12+# define MODULE_PROC_FAMILY "SH4LE "
13+# elif defined CONFIG_CPU_SH5
14+# define MODULE_PROC_FAMILY "SH5LE "
15+# else
16+# error unknown processor family
17+# endif
18+#else
19+# ifdef CONFIG_CPU_SH2
20+# define MODULE_PROC_FAMILY "SH2BE "
21+# elif defined CONFIG_CPU_SH3
22+# define MODULE_PROC_FAMILY "SH3BE "
23+# elif defined CONFIG_CPU_SH4
24+# define MODULE_PROC_FAMILY "SH4BE "
25+# elif defined CONFIG_CPU_SH5
26+# define MODULE_PROC_FAMILY "SH5BE "
27+# else
28+# error unknown processor family
29+# endif
30+#endif
31+
32+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
33+
34+#endif /* _ASM_VERMAGIC_H */
arch/sh/mm/init.c+1−1
@@ -412,7 +412,7 @@ int arch_add_memory(int nid, u64 start, u64 size, · 411 unmodified lines
412412 unsigned long nr_pages = size >> PAGE_SHIFT;
413413 int ret;
414414
415− if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot)
415+ if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot))
416416 return -EINVAL;
417417
418418 /* We only have ZONE_NORMAL, so this is easy.. */
arch/um/Makefile+1−0
@@ -140,6 +140,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) · 139 unmodified lines
140140 # When cleaning we don't include .config, so we don't include
141141 # TT or skas makefiles and don't clean skas_ptregs.h.
142142 CLEAN_FILES += linux x.i gmon.out
143+MRPROPER_DIRS += arch/$(SUBARCH)/include/generated
143144
144145 archclean:
145146 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
arch/x86/Kconfig+1−1
@@ -149,7 +149,7 @@ config X86 · 148 unmodified lines
149149 select HAVE_ARCH_TRACEHOOK
150150 select HAVE_ARCH_TRANSPARENT_HUGEPAGE
151151 select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64
152− select HAVE_ARCH_USERFAULTFD_WP if USERFAULTFD
152+ select HAVE_ARCH_USERFAULTFD_WP if X86_64 && USERFAULTFD
153153 select HAVE_ARCH_VMAP_STACK if X86_64
154154 select HAVE_ARCH_WITHIN_STACK_FRAMES
155155 select HAVE_ASM_MODVERSIONS
arch/x86/crypto/blake2s-glue.c+4−6
@@ -32,16 +32,16 @@ void blake2s_compress_arch(struct blake2s_state *state, · 31 unmodified lines
3232 const u32 inc)
3333 {
3434 /* SIMD disables preemption, so relax after processing each page. */
35− BUILD_BUG_ON(PAGE_SIZE / BLAKE2S_BLOCK_SIZE < 8);
35+ BUILD_BUG_ON(SZ_4K / BLAKE2S_BLOCK_SIZE < 8);
3636
3737 if (!static_branch_likely(&blake2s_use_ssse3) || !crypto_simd_usable()) {
3838 blake2s_compress_generic(state, block, nblocks, inc);
3939 return;
4040 }
4141
42− for (;;) {
42+ do {
4343 const size_t blocks = min_t(size_t, nblocks,
44− PAGE_SIZE / BLAKE2S_BLOCK_SIZE);
44+ SZ_4K / BLAKE2S_BLOCK_SIZE);
4545
4646 kernel_fpu_begin();
4747 if (IS_ENABLED(CONFIG_AS_AVX512) &&
@@ -52,10 +52,8 @@ void blake2s_compress_arch(struct blake2s_state *state, · 4 unmodified lines
5252 kernel_fpu_end();
5353
5454 nblocks -= blocks;
55− if (!nblocks)
56− break;
5755 block += blocks * BLAKE2S_BLOCK_SIZE;
58− }
56+ } while (nblocks);
5957 }
6058 EXPORT_SYMBOL(blake2s_compress_arch);
6159
arch/x86/crypto/chacha_glue.c+11−3
@@ -153,9 +153,17 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes, · 152 unmodified lines
153153 bytes <= CHACHA_BLOCK_SIZE)
154154 return chacha_crypt_generic(state, dst, src, bytes, nrounds);
155155
156− kernel_fpu_begin();
157− chacha_dosimd(state, dst, src, bytes, nrounds);
158− kernel_fpu_end();
156+ do {
157+ unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
158+
159+ kernel_fpu_begin();
160+ chacha_dosimd(state, dst, src, todo, nrounds);
161+ kernel_fpu_end();
162+
163+ bytes -= todo;
164+ src += todo;
165+ dst += todo;
166+ } while (bytes);
159167 }
160168 EXPORT_SYMBOL(chacha_crypt_arch);
161169
arch/x86/crypto/nhpoly1305-avx2-glue.c+1−1
@@ -29,7 +29,7 @@ static int nhpoly1305_avx2_update(struct shash_desc *desc, · 28 unmodified lines
2929 return crypto_nhpoly1305_update(desc, src, srclen);
3030
3131 do {
32− unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
32+ unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3333
3434 kernel_fpu_begin();
3535 crypto_nhpoly1305_update_helper(desc, src, n, _nh_avx2);
arch/x86/crypto/nhpoly1305-sse2-glue.c+1−1
@@ -29,7 +29,7 @@ static int nhpoly1305_sse2_update(struct shash_desc *desc, · 28 unmodified lines
2929 return crypto_nhpoly1305_update(desc, src, srclen);
3030
3131 do {
32− unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
32+ unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3333
3434 kernel_fpu_begin();
3535 crypto_nhpoly1305_update_helper(desc, src, n, _nh_sse2);
arch/x86/crypto/poly1305_glue.c+6−7
@@ -91,8 +91,8 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len, · 90 unmodified lines
9191 struct poly1305_arch_internal *state = ctx;
9292
9393 /* SIMD disables preemption, so relax after processing each page. */
94− BUILD_BUG_ON(PAGE_SIZE < POLY1305_BLOCK_SIZE ||
95− PAGE_SIZE % POLY1305_BLOCK_SIZE);
94+ BUILD_BUG_ON(SZ_4K < POLY1305_BLOCK_SIZE ||
95+ SZ_4K % POLY1305_BLOCK_SIZE);
9696
9797 if (!static_branch_likely(&poly1305_use_avx) ||
9898 (len < (POLY1305_BLOCK_SIZE * 18) && !state->is_base2_26) ||
@@ -102,8 +102,8 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len, · 3 unmodified lines
102102 return;
103103 }
104104
105− for (;;) {
106− const size_t bytes = min_t(size_t, len, PAGE_SIZE);
105+ do {
106+ const size_t bytes = min_t(size_t, len, SZ_4K);
107107
108108 kernel_fpu_begin();
109109 if (IS_ENABLED(CONFIG_AS_AVX512) && static_branch_likely(&poly1305_use_avx512))
@@ -113,11 +113,10 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len, · 3 unmodified lines
113113 else
114114 poly1305_blocks_avx(ctx, inp, bytes, padbit);
115115 kernel_fpu_end();
116+
116117 len -= bytes;
117− if (!len)
118− break;
119118 inp += bytes;
120− }
119+ } while (len);
121120 }
122121
123122 static void poly1305_simd_emit(void *ctx, u8 mac[POLY1305_DIGEST_SIZE],
arch/x86/entry/calling.h+21−19
@@ -98,13 +98,6 @@ For 32-bit we have the following conventions - kernel is built with · 97 unmodified lines
9898 #define SIZEOF_PTREGS 21*8
9999
100100 .macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0
101− /*
102− * Push registers and sanitize registers of values that a
103− * speculation attack might otherwise want to exploit. The
104− * lower registers are likely clobbered well before they
105− * could be put to use in a speculative execution gadget.
106− * Interleave XOR with PUSH for better uop scheduling:
107− */
108101 .if \save_ret
109102 pushq %rsi /* pt_regs->si */
110103 movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */
@@ -114,34 +107,43 @@ For 32-bit we have the following conventions - kernel is built with · 3 unmodified lines
114107 pushq %rsi /* pt_regs->si */
115108 .endif
116109 pushq \rdx /* pt_regs->dx */
117− xorl %edx, %edx /* nospec dx */
118110 pushq %rcx /* pt_regs->cx */
119− xorl %ecx, %ecx /* nospec cx */
120111 pushq \rax /* pt_regs->ax */
121112 pushq %r8 /* pt_regs->r8 */
122− xorl %r8d, %r8d /* nospec r8 */
123113 pushq %r9 /* pt_regs->r9 */
124− xorl %r9d, %r9d /* nospec r9 */
125114 pushq %r10 /* pt_regs->r10 */
126− xorl %r10d, %r10d /* nospec r10 */
127115 pushq %r11 /* pt_regs->r11 */
128− xorl %r11d, %r11d /* nospec r11*/
129116 pushq %rbx /* pt_regs->rbx */
130− xorl %ebx, %ebx /* nospec rbx*/
131117 pushq %rbp /* pt_regs->rbp */
132− xorl %ebp, %ebp /* nospec rbp*/
133118 pushq %r12 /* pt_regs->r12 */
134− xorl %r12d, %r12d /* nospec r12*/
135119 pushq %r13 /* pt_regs->r13 */
136− xorl %r13d, %r13d /* nospec r13*/
137120 pushq %r14 /* pt_regs->r14 */
138− xorl %r14d, %r14d /* nospec r14*/
139121 pushq %r15 /* pt_regs->r15 */
140− xorl %r15d, %r15d /* nospec r15*/
141122 UNWIND_HINT_REGS
123+
142124 .if \save_ret
143125 pushq %rsi /* return address on top of stack */
144126 .endif
127+
128+ /*
129+ * Sanitize registers of values that a speculation attack might
130+ * otherwise want to exploit. The lower registers are likely clobbered
131+ * well before they could be put to use in a speculative execution
132+ * gadget.
133+ */
134+ xorl %edx, %edx /* nospec dx */
135+ xorl %ecx, %ecx /* nospec cx */
136+ xorl %r8d, %r8d /* nospec r8 */
137+ xorl %r9d, %r9d /* nospec r9 */
138+ xorl %r10d, %r10d /* nospec r10 */
139+ xorl %r11d, %r11d /* nospec r11 */
140+ xorl %ebx, %ebx /* nospec rbx */
141+ xorl %ebp, %ebp /* nospec rbp */
142+ xorl %r12d, %r12d /* nospec r12 */
143+ xorl %r13d, %r13d /* nospec r13 */
144+ xorl %r14d, %r14d /* nospec r14 */
145+ xorl %r15d, %r15d /* nospec r15 */
146+
145147 .endm
146148
147149 .macro POP_REGS pop_rdi=1 skip_r11rcx=0
arch/x86/entry/entry_64.S+7−7
@@ -249,7 +249,6 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL) · 248 unmodified lines
249249 */
250250 syscall_return_via_sysret:
251251 /* rcx and r11 are already restored (see code above) */
252− UNWIND_HINT_EMPTY
253252 POP_REGS pop_rdi=0 skip_r11rcx=1
254253
255254 /*
@@ -258,6 +257,7 @@ syscall_return_via_sysret: · 2 unmodified lines
258257 */
259258 movq %rsp, %rdi
260259 movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp
260+ UNWIND_HINT_EMPTY
261261
262262 pushq RSP-RDI(%rdi) /* RSP */
263263 pushq (%rdi) /* RDI */
@@ -279,8 +279,7 @@ SYM_CODE_END(entry_SYSCALL_64) · 15 unmodified lines
279279 * %rdi: prev task
280280 * %rsi: next task
281281 */
282−SYM_CODE_START(__switch_to_asm)
283− UNWIND_HINT_FUNC
282+SYM_FUNC_START(__switch_to_asm)
284283 /*
285284 * Save callee-saved registers
286285 * This must match the order in inactive_task_frame
@@ -321,7 +320,7 @@ SYM_CODE_START(__switch_to_asm) · 34 unmodified lines
321320 popq %rbp
322321
323322 jmp __switch_to
324−SYM_CODE_END(__switch_to_asm)
323+SYM_FUNC_END(__switch_to_asm)
325324
326325 /*
327326 * A newly forked process directly context switches into this address.
@@ -512,7 +511,7 @@ SYM_CODE_END(spurious_entries_start) · 184 unmodified lines
512511 * +----------------------------------------------------+
513512 */
514513 SYM_CODE_START(interrupt_entry)
515− UNWIND_HINT_FUNC
514+ UNWIND_HINT_IRET_REGS offset=16
516515 ASM_CLAC
517516 cld
518517
@@ -544,9 +543,9 @@ SYM_CODE_START(interrupt_entry) · 25 unmodified lines
544543 pushq 5*8(%rdi) /* regs->eflags */
545544 pushq 4*8(%rdi) /* regs->cs */
546545 pushq 3*8(%rdi) /* regs->ip */
546+ UNWIND_HINT_IRET_REGS
547547 pushq 2*8(%rdi) /* regs->orig_ax */
548548 pushq 8(%rdi) /* return address */
549− UNWIND_HINT_FUNC
550549
551550 movq (%rdi), %rdi
552551 jmp 2f
@@ -637,6 +636,7 @@ SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL) · 84 unmodified lines
637636 */
638637 movq %rsp, %rdi
639638 movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp
639+ UNWIND_HINT_EMPTY
640640
641641 /* Copy the IRET frame to the trampoline stack. */
642642 pushq 6*8(%rdi) /* SS */
@@ -1739,7 +1739,7 @@ SYM_CODE_START(rewind_stack_do_exit) · 1096 unmodified lines
17391739
17401740 movq PER_CPU_VAR(cpu_current_top_of_stack), %rax
17411741 leaq -PTREGS_SIZE(%rax), %rsp
1742− UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE
1742+ UNWIND_HINT_REGS
17431743
17441744 call do_exit
17451745 SYM_CODE_END(rewind_stack_do_exit)
arch/x86/events/intel/cstate.c+1−0
@@ -643,6 +643,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { · 642 unmodified lines
643643 X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_PLUS, &glm_cstates),
644644 X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &glm_cstates),
645645 X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, &glm_cstates),
646+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &glm_cstates),
646647
647648 X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_L, &icl_cstates),
648649 X86_MATCH_INTEL_FAM6_MODEL(ICELAKE, &icl_cstates),
arch/x86/hyperv/hv_init.c+10−2
@@ -73,7 +73,8 @@ static int hv_cpu_init(unsigned int cpu) · 72 unmodified lines
7373 struct page *pg;
7474
7575 input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg);
76− pg = alloc_page(GFP_KERNEL);
76+ /* hv_cpu_init() can be called with IRQs disabled from hv_resume() */
77+ pg = alloc_page(irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
7778 if (unlikely(!pg))
7879 return -ENOMEM;
7980 *input_arg = page_address(pg);
@@ -254,6 +255,7 @@ static int __init hv_pci_init(void) · 174 unmodified lines
254255 static int hv_suspend(void)
255256 {
256257 union hv_x64_msr_hypercall_contents hypercall_msr;
258+ int ret;
257259
258260 /*
259261 * Reset the hypercall page as it is going to be invalidated
@@ -270,12 +272,17 @@ static int hv_suspend(void) · 10 unmodified lines
270272 hypercall_msr.enable = 0;
271273 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
272274
273− return 0;
275+ ret = hv_cpu_die(0);
276+ return ret;
274277 }
275278
276279 static void hv_resume(void)
277280 {
278281 union hv_x64_msr_hypercall_contents hypercall_msr;
282+ int ret;
283+
284+ ret = hv_cpu_init(0);
285+ WARN_ON(ret);
279286
280287 /* Re-enable the hypercall page */
281288 rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
@@ -288,6 +295,7 @@ static void hv_resume(void) · 6 unmodified lines
288295 hv_hypercall_pg_saved = NULL;
289296 }
290297
298+/* Note: when the ops are called, only CPU0 is online and IRQs are disabled. */
291299 static struct syscore_ops hv_syscore_ops = {
292300 .suspend = hv_suspend,
293301 .resume = hv_resume,
arch/x86/include/asm/ftrace.h+3−2
@@ -61,11 +61,12 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name · 60 unmodified lines
6161 {
6262 /*
6363 * Compare the symbol name with the system call name. Skip the
64− * "__x64_sys", "__ia32_sys" or simple "sys" prefix.
64+ * "__x64_sys", "__ia32_sys", "__do_sys" or simple "sys" prefix.
6565 */
6666 return !strcmp(sym + 3, name + 3) ||
6767 (!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
68− (!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
68+ (!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3)) ||
69+ (!strncmp(sym, "__do_sys", 8) && !strcmp(sym + 8, name + 3));
6970 }
7071
7172 #ifndef COMPILE_OFFSETS
arch/x86/include/asm/kvm_host.h+2−2
@@ -1663,8 +1663,8 @@ void kvm_set_msi_irq(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e, · 1662 unmodified lines
16631663 static inline bool kvm_irq_is_postable(struct kvm_lapic_irq *irq)
16641664 {
16651665 /* We can only post Fixed and LowPrio IRQs */
1666− return (irq->delivery_mode == dest_Fixed ||
1667− irq->delivery_mode == dest_LowestPrio);
1666+ return (irq->delivery_mode == APIC_DM_FIXED ||
1667+ irq->delivery_mode == APIC_DM_LOWEST);
16681668 }
16691669
16701670 static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)
arch/x86/include/asm/module.h+0−60
@@ -13,64 +13,4 @@ struct mod_arch_specific { · 12 unmodified lines
1313 #endif
1414 };
1515
16−#ifdef CONFIG_X86_64
17−/* X86_64 does not define MODULE_PROC_FAMILY */
18−#elif defined CONFIG_M486SX
19−#define MODULE_PROC_FAMILY "486SX "
20−#elif defined CONFIG_M486
21−#define MODULE_PROC_FAMILY "486 "
22−#elif defined CONFIG_M586
23−#define MODULE_PROC_FAMILY "586 "
24−#elif defined CONFIG_M586TSC
25−#define MODULE_PROC_FAMILY "586TSC "
26−#elif defined CONFIG_M586MMX
27−#define MODULE_PROC_FAMILY "586MMX "
28−#elif defined CONFIG_MCORE2
29−#define MODULE_PROC_FAMILY "CORE2 "
30−#elif defined CONFIG_MATOM
31−#define MODULE_PROC_FAMILY "ATOM "
32−#elif defined CONFIG_M686
33−#define MODULE_PROC_FAMILY "686 "
34−#elif defined CONFIG_MPENTIUMII
35−#define MODULE_PROC_FAMILY "PENTIUMII "
36−#elif defined CONFIG_MPENTIUMIII
37−#define MODULE_PROC_FAMILY "PENTIUMIII "
38−#elif defined CONFIG_MPENTIUMM
39−#define MODULE_PROC_FAMILY "PENTIUMM "
40−#elif defined CONFIG_MPENTIUM4
41−#define MODULE_PROC_FAMILY "PENTIUM4 "
42−#elif defined CONFIG_MK6
43−#define MODULE_PROC_FAMILY "K6 "
44−#elif defined CONFIG_MK7
45−#define MODULE_PROC_FAMILY "K7 "
46−#elif defined CONFIG_MK8
47−#define MODULE_PROC_FAMILY "K8 "
48−#elif defined CONFIG_MELAN
49−#define MODULE_PROC_FAMILY "ELAN "
50−#elif defined CONFIG_MCRUSOE
51−#define MODULE_PROC_FAMILY "CRUSOE "
52−#elif defined CONFIG_MEFFICEON
53−#define MODULE_PROC_FAMILY "EFFICEON "
54−#elif defined CONFIG_MWINCHIPC6
55−#define MODULE_PROC_FAMILY "WINCHIPC6 "
56−#elif defined CONFIG_MWINCHIP3D
57−#define MODULE_PROC_FAMILY "WINCHIP3D "
58−#elif defined CONFIG_MCYRIXIII
59−#define MODULE_PROC_FAMILY "CYRIXIII "
60−#elif defined CONFIG_MVIAC3_2
61−#define MODULE_PROC_FAMILY "VIAC3-2 "
62−#elif defined CONFIG_MVIAC7
63−#define MODULE_PROC_FAMILY "VIAC7 "
64−#elif defined CONFIG_MGEODEGX1
65−#define MODULE_PROC_FAMILY "GEODEGX1 "
66−#elif defined CONFIG_MGEODE_LX
67−#define MODULE_PROC_FAMILY "GEODE "
68−#else
69−#error unknown processor family
70−#endif
71−
72−#ifdef CONFIG_X86_32
73−# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
74−#endif
75−
7616 #endif /* _ASM_X86_MODULE_H */
arch/x86/include/asm/mshyperv.h+2−0
@@ -35,6 +35,8 @@ typedef int (*hyperv_fill_flush_list_func)( · 34 unmodified lines
3535 rdmsrl(HV_X64_MSR_SINT0 + int_num, val)
3636 #define hv_set_synint_state(int_num, val) \
3737 wrmsrl(HV_X64_MSR_SINT0 + int_num, val)
38+#define hv_recommend_using_aeoi() \
39+ (!(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED))
3840
3941 #define hv_get_crash_ctl(val) \
4042 rdmsrl(HV_X64_MSR_CRASH_CTL, val)
arch/x86/include/asm/nospec-branch.h+0−21
@@ -237,27 +237,6 @@ enum ssb_mitigation { · 236 unmodified lines
237237 extern char __indirect_thunk_start[];
238238 extern char __indirect_thunk_end[];
239239
240−/*
241− * On VMEXIT we must ensure that no RSB predictions learned in the guest
242− * can be followed in the host, by overwriting the RSB completely. Both
243− * retpoline and IBRS mitigations for Spectre v2 need this; only on future
244− * CPUs with IBRS_ALL *might* it be avoided.
245− */
246−static inline void vmexit_fill_RSB(void)
247−{
248−#ifdef CONFIG_RETPOLINE
249− unsigned long loops;
250−
251− asm volatile (ANNOTATE_NOSPEC_ALTERNATIVE
252− ALTERNATIVE("jmp 910f",
253− __stringify(__FILL_RETURN_BUFFER(%0, RSB_CLEAR_LOOPS, %1)),
254− X86_FEATURE_RETPOLINE)
255− "910:"
256− : "=r" (loops), ASM_CALL_CONSTRAINT
257− : : "memory" );
258−#endif
259−}
260−
261240 static __always_inline
262241 void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature)
263242 {
arch/x86/include/asm/unwind.h+1−1
@@ -19,7 +19,7 @@ struct unwind_state { · 18 unmodified lines
1919 #if defined(CONFIG_UNWINDER_ORC)
2020 bool signal, full_regs;
2121 unsigned long sp, bp, ip;
22− struct pt_regs *regs;
22+ struct pt_regs *regs, *prev_regs;
2323 #elif defined(CONFIG_UNWINDER_FRAME_POINTER)
2424 bool got_irq;
2525 unsigned long *bp, *orig_sp, ip;
arch/x86/include/asm/vermagic.h+68−0
@@ -0,0 +1,68 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef _ASM_VERMAGIC_H
4+#define _ASM_VERMAGIC_H
5+
6+#ifdef CONFIG_X86_64
7+/* X86_64 does not define MODULE_PROC_FAMILY */
8+#elif defined CONFIG_M486SX
9+#define MODULE_PROC_FAMILY "486SX "
10+#elif defined CONFIG_M486
11+#define MODULE_PROC_FAMILY "486 "
12+#elif defined CONFIG_M586
13+#define MODULE_PROC_FAMILY "586 "
14+#elif defined CONFIG_M586TSC
15+#define MODULE_PROC_FAMILY "586TSC "
16+#elif defined CONFIG_M586MMX
17+#define MODULE_PROC_FAMILY "586MMX "
18+#elif defined CONFIG_MCORE2
19+#define MODULE_PROC_FAMILY "CORE2 "
20+#elif defined CONFIG_MATOM
21+#define MODULE_PROC_FAMILY "ATOM "
22+#elif defined CONFIG_M686
23+#define MODULE_PROC_FAMILY "686 "
24+#elif defined CONFIG_MPENTIUMII
25+#define MODULE_PROC_FAMILY "PENTIUMII "
26+#elif defined CONFIG_MPENTIUMIII
27+#define MODULE_PROC_FAMILY "PENTIUMIII "
28+#elif defined CONFIG_MPENTIUMM
29+#define MODULE_PROC_FAMILY "PENTIUMM "
30+#elif defined CONFIG_MPENTIUM4
31+#define MODULE_PROC_FAMILY "PENTIUM4 "
32+#elif defined CONFIG_MK6
33+#define MODULE_PROC_FAMILY "K6 "
34+#elif defined CONFIG_MK7
35+#define MODULE_PROC_FAMILY "K7 "
36+#elif defined CONFIG_MK8
37+#define MODULE_PROC_FAMILY "K8 "
38+#elif defined CONFIG_MELAN
39+#define MODULE_PROC_FAMILY "ELAN "
40+#elif defined CONFIG_MCRUSOE
41+#define MODULE_PROC_FAMILY "CRUSOE "
42+#elif defined CONFIG_MEFFICEON
43+#define MODULE_PROC_FAMILY "EFFICEON "
44+#elif defined CONFIG_MWINCHIPC6
45+#define MODULE_PROC_FAMILY "WINCHIPC6 "
46+#elif defined CONFIG_MWINCHIP3D
47+#define MODULE_PROC_FAMILY "WINCHIP3D "
48+#elif defined CONFIG_MCYRIXIII
49+#define MODULE_PROC_FAMILY "CYRIXIII "
50+#elif defined CONFIG_MVIAC3_2
51+#define MODULE_PROC_FAMILY "VIAC3-2 "
52+#elif defined CONFIG_MVIAC7
53+#define MODULE_PROC_FAMILY "VIAC7 "
54+#elif defined CONFIG_MGEODEGX1
55+#define MODULE_PROC_FAMILY "GEODEGX1 "
56+#elif defined CONFIG_MGEODE_LX
57+#define MODULE_PROC_FAMILY "GEODE "
58+#else
59+#error unknown processor family
60+#endif
61+
62+#ifdef CONFIG_X86_32
63+# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
64+#else
65+# define MODULE_ARCH_VERMAGIC ""
66+#endif
67+
68+#endif /* _ASM_VERMAGIC_H */
arch/x86/kernel/apic/apic.c+14−13
@@ -352,8 +352,6 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) · 351 unmodified lines
352352 * According to Intel, MFENCE can do the serialization here.
353353 */
354354 asm volatile("mfence" : : : "memory");
355−
356− printk_once(KERN_DEBUG "TSC deadline timer enabled\n");
357355 return;
358356 }
359357
@@ -546,7 +544,7 @@ static struct clock_event_device lapic_clockevent = { · 186 unmodified lines
546544 };
547545 static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
548546
549−static u32 hsx_deadline_rev(void)
547+static __init u32 hsx_deadline_rev(void)
550548 {
551549 switch (boot_cpu_data.x86_stepping) {
552550 case 0x02: return 0x3a; /* EP */
@@ -556,7 +554,7 @@ static u32 hsx_deadline_rev(void) · 3 unmodified lines
556554 return ~0U;
557555 }
558556
559−static u32 bdx_deadline_rev(void)
557+static __init u32 bdx_deadline_rev(void)
560558 {
561559 switch (boot_cpu_data.x86_stepping) {
562560 case 0x02: return 0x00000011;
@@ -568,7 +566,7 @@ static u32 bdx_deadline_rev(void) · 5 unmodified lines
568566 return ~0U;
569567 }
570568
571−static u32 skx_deadline_rev(void)
569+static __init u32 skx_deadline_rev(void)
572570 {
573571 switch (boot_cpu_data.x86_stepping) {
574572 case 0x03: return 0x01000136;
@@ -581,7 +579,7 @@ static u32 skx_deadline_rev(void) · 6 unmodified lines
581579 return ~0U;
582580 }
583581
584−static const struct x86_cpu_id deadline_match[] = {
582+static const struct x86_cpu_id deadline_match[] __initconst = {
585583 X86_MATCH_INTEL_FAM6_MODEL( HASWELL_X, &hsx_deadline_rev),
586584 X86_MATCH_INTEL_FAM6_MODEL( BROADWELL_X, 0x0b000020),
587585 X86_MATCH_INTEL_FAM6_MODEL( BROADWELL_D, &bdx_deadline_rev),
@@ -603,18 +601,19 @@ static const struct x86_cpu_id deadline_match[] = { · 15 unmodified lines
603601 {},
604602 };
605603
606−static void apic_check_deadline_errata(void)
604+static __init bool apic_validate_deadline_timer(void)
607605 {
608606 const struct x86_cpu_id *m;
609607 u32 rev;
610608
611− if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER) ||
612− boot_cpu_has(X86_FEATURE_HYPERVISOR))
613− return;
609+ if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER))
610+ return false;
611+ if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
612+ return true;
614613
615614 m = x86_match_cpu(deadline_match);
616615 if (!m)
617− return;
616+ return true;
618617
619618 /*
620619 * Function pointers will have the MSB set due to address layout,
@@ -626,11 +625,12 @@ static void apic_check_deadline_errata(void) · 5 unmodified lines
626625 rev = (u32)m->driver_data;
627626
628627 if (boot_cpu_data.microcode >= rev)
629− return;
628+ return true;
630629
631630 setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
632631 pr_err(FW_BUG "TSC_DEADLINE disabled due to Errata; "
633632 "please update microcode to version: 0x%x (or later)\n", rev);
633+ return false;
634634 }
635635
636636 /*
@@ -2092,7 +2092,8 @@ void __init init_apic_mappings(void) · 1455 unmodified lines
20922092 {
20932093 unsigned int new_apicid;
20942094
2095− apic_check_deadline_errata();
2095+ if (apic_validate_deadline_timer())
2096+ pr_debug("TSC deadline timer available\n");
20962097
20972098 if (x2apic_mode) {
20982099 boot_cpu_physical_apicid = read_apic_id();
arch/x86/kernel/dumpstack_64.c+2−1
@@ -183,7 +183,8 @@ recursion_check: · 182 unmodified lines
183183 */
184184 if (visit_mask) {
185185 if (*visit_mask & (1UL << info->type)) {
186− printk_deferred_once(KERN_WARNING "WARNING: stack recursion on stack type %d\n", info->type);
186+ if (task == current)
187+ printk_deferred_once(KERN_WARNING "WARNING: stack recursion on stack type %d\n", info->type);
187188 goto unknown;
188189 }
189190 *visit_mask |= 1UL << info->type;
arch/x86/kernel/smpboot.c+33−14
@@ -147,7 +147,7 @@ static inline void smpboot_restore_warm_reset_vector(void) · 146 unmodified lines
147147 *((volatile u32 *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0;
148148 }
149149
150−static void init_freq_invariance(void);
150+static void init_freq_invariance(bool secondary);
151151
152152 /*
153153 * Report back to the Boot Processor during boot time or to the caller processor
@@ -185,7 +185,7 @@ static void smp_callin(void) · 31 unmodified lines
185185 */
186186 set_cpu_sibling_map(raw_smp_processor_id());
187187
188− init_freq_invariance();
188+ init_freq_invariance(true);
189189
190190 /*
191191 * Get our bogomips.
@@ -1341,7 +1341,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) · 1149 unmodified lines
13411341 set_sched_topology(x86_topology);
13421342
13431343 set_cpu_sibling_map(0);
1344− init_freq_invariance();
1344+ init_freq_invariance(false);
13451345 smp_sanity_check();
13461346
13471347 switch (apic_intr_mode) {
@@ -1877,9 +1877,6 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq, · 529 unmodified lines
18771877 int err, i;
18781878 u64 msr;
18791879
1880− if (!x86_match_cpu(has_knl_turbo_ratio_limits))
1881− return false;
1882−
18831880 err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq);
18841881 if (err)
18851882 return false;
@@ -1945,18 +1942,23 @@ static bool skx_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq, int size) · 59 unmodified lines
19451942
19461943 static bool core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq)
19471944 {
1945+ u64 msr;
19481946 int err;
19491947
19501948 err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq);
19511949 if (err)
19521950 return false;
19531951
1954− err = rdmsrl_safe(MSR_TURBO_RATIO_LIMIT, turbo_freq);
1952+ err = rdmsrl_safe(MSR_TURBO_RATIO_LIMIT, &msr);
19551953 if (err)
19561954 return false;
19571955
1958− *base_freq = (*base_freq >> 8) & 0xFF; /* max P state */
1959− *turbo_freq = (*turbo_freq >> 24) & 0xFF; /* 4C turbo */
1956+ *base_freq = (*base_freq >> 8) & 0xFF; /* max P state */
1957+ *turbo_freq = (msr >> 24) & 0xFF; /* 4C turbo */
1958+
1959+ /* The CPU may have less than 4 cores */
1960+ if (!*turbo_freq)
1961+ *turbo_freq = msr & 0xFF; /* 1C turbo */
19601962
19611963 return true;
19621964 }
@@ -1972,7 +1974,8 @@ static bool intel_set_max_freq_ratio(void) · 9 unmodified lines
19721974 skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
19731975 goto out;
19741976
1975− if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
1977+ if (x86_match_cpu(has_knl_turbo_ratio_limits) &&
1978+ knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
19761979 goto out;
19771980
19781981 if (x86_match_cpu(has_skx_turbo_ratio_limits) &&
@@ -1985,13 +1988,22 @@ static bool intel_set_max_freq_ratio(void) · 6 unmodified lines
19851988 return false;
19861989
19871990 out:
1991+ /*
1992+ * Some hypervisors advertise X86_FEATURE_APERFMPERF
1993+ * but then fill all MSR's with zeroes.
1994+ */
1995+ if (!base_freq) {
1996+ pr_debug("Couldn't determine cpu base frequency, necessary for scale-invariant accounting.\n");
1997+ return false;
1998+ }
1999+
19882000 arch_turbo_freq_ratio = div_u64(turbo_freq * SCHED_CAPACITY_SCALE,
19892001 base_freq);
19902002 arch_set_max_freq_ratio(turbo_disabled());
19912003 return true;
19922004 }
19932005
1994−static void init_counter_refs(void *arg)
2006+static void init_counter_refs(void)
19952007 {
19962008 u64 aperf, mperf;
19972009
@@ -2002,18 +2014,25 @@ static void init_counter_refs(void *arg) · 4 unmodified lines
20022014 this_cpu_write(arch_prev_mperf, mperf);
20032015 }
20042016
2005−static void init_freq_invariance(void)
2017+static void init_freq_invariance(bool secondary)
20062018 {
20072019 bool ret = false;
20082020
2009− if (smp_processor_id() != 0 || !boot_cpu_has(X86_FEATURE_APERFMPERF))
2021+ if (!boot_cpu_has(X86_FEATURE_APERFMPERF))
20102022 return;
20112023
2024+ if (secondary) {
2025+ if (static_branch_likely(&arch_scale_freq_key)) {
2026+ init_counter_refs();
2027+ }
2028+ return;
2029+ }
2030+
20122031 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
20132032 ret = intel_set_max_freq_ratio();
20142033
20152034 if (ret) {
2016− on_each_cpu(init_counter_refs, NULL, 1);
2035+ init_counter_refs();
20172036 static_branch_enable(&arch_scale_freq_key);
20182037 } else {
20192038 pr_debug("Couldn't determine max cpu frequency, necessary for scale-invariant accounting.\n");
arch/x86/kernel/unwind_frame.c+3−0
@@ -344,6 +344,9 @@ bad_address: · 343 unmodified lines
344344 if (IS_ENABLED(CONFIG_X86_32))
345345 goto the_end;
346346
347+ if (state->task != current)
348+ goto the_end;
349+
347350 if (state->regs) {
348351 printk_deferred_once(KERN_WARNING
349352 "WARNING: kernel stack regs at %p in %s:%d has bad 'bp' value %p\n",
arch/x86/kernel/unwind_orc.c+74−39
@@ -8,19 +8,21 @@ · 7 unmodified lines
88 #include <asm/orc_lookup.h>
99
1010 #define orc_warn(fmt, ...) \
11− printk_deferred_once(KERN_WARNING pr_fmt("WARNING: " fmt), ##__VA_ARGS__)
11+ printk_deferred_once(KERN_WARNING "WARNING: " fmt, ##__VA_ARGS__)
12+
13+#define orc_warn_current(args...) \
14+({ \
15+ if (state->task == current) \
16+ orc_warn(args); \
17+})
1218
1319 extern int __start_orc_unwind_ip[];
1420 extern int __stop_orc_unwind_ip[];
1521 extern struct orc_entry __start_orc_unwind[];
1622 extern struct orc_entry __stop_orc_unwind[];
1723
18−static DEFINE_MUTEX(sort_mutex);
19−int *cur_orc_ip_table = __start_orc_unwind_ip;
20−struct orc_entry *cur_orc_table = __start_orc_unwind;
21−
22−unsigned int lookup_num_blocks;
23−bool orc_init;
24+static bool orc_init __ro_after_init;
25+static unsigned int lookup_num_blocks __ro_after_init;
2426
2527 static inline unsigned long orc_ip(const int *ip)
2628 {
@@ -142,9 +144,6 @@ static struct orc_entry *orc_find(unsigned long ip) · 115 unmodified lines
142144 {
143145 static struct orc_entry *orc;
144146
145− if (!orc_init)
146− return NULL;
147−
148147 if (ip == 0)
149148 return &null_orc_entry;
150149
@@ -189,6 +188,10 @@ static struct orc_entry *orc_find(unsigned long ip) · 38 unmodified lines
189188
190189 #ifdef CONFIG_MODULES
191190
191+static DEFINE_MUTEX(sort_mutex);
192+static int *cur_orc_ip_table = __start_orc_unwind_ip;
193+static struct orc_entry *cur_orc_table = __start_orc_unwind;
194+
192195 static void orc_sort_swap(void *_a, void *_b, int size)
193196 {
194197 struct orc_entry *orc_a, *orc_b;
@@ -381,9 +384,38 @@ static bool deref_stack_iret_regs(struct unwind_state *state, unsigned long addr · 186 unmodified lines
381384 return true;
382385 }
383386
387+/*
388+ * If state->regs is non-NULL, and points to a full pt_regs, just get the reg
389+ * value from state->regs.
390+ *
391+ * Otherwise, if state->regs just points to IRET regs, and the previous frame
392+ * had full regs, it's safe to get the value from the previous regs. This can
393+ * happen when early/late IRQ entry code gets interrupted by an NMI.
394+ */
395+static bool get_reg(struct unwind_state *state, unsigned int reg_off,
396+ unsigned long *val)
397+{
398+ unsigned int reg = reg_off/8;
399+
400+ if (!state->regs)
401+ return false;
402+
403+ if (state->full_regs) {
404+ *val = ((unsigned long *)state->regs)[reg];
405+ return true;
406+ }
407+
408+ if (state->prev_regs) {
409+ *val = ((unsigned long *)state->prev_regs)[reg];
410+ return true;
411+ }
412+
413+ return false;
414+}
415+
384416 bool unwind_next_frame(struct unwind_state *state)
385417 {
386− unsigned long ip_p, sp, orig_ip = state->ip, prev_sp = state->sp;
418+ unsigned long ip_p, sp, tmp, orig_ip = state->ip, prev_sp = state->sp;
387419 enum stack_type prev_type = state->stack_info.type;
388420 struct orc_entry *orc;
389421 bool indirect = false;
@@ -445,43 +477,39 @@ bool unwind_next_frame(struct unwind_state *state) · 55 unmodified lines
445477 break;
446478
447479 case ORC_REG_R10:
448− if (!state->regs || !state->full_regs) {
449− orc_warn("missing regs for base reg R10 at ip %pB\n",
450− (void *)state->ip);
480+ if (!get_reg(state, offsetof(struct pt_regs, r10), &sp)) {
481+ orc_warn_current("missing R10 value at %pB\n",
482+ (void *)state->ip);
451483 goto err;
452484 }
453− sp = state->regs->r10;
454485 break;
455486
456487 case ORC_REG_R13:
457− if (!state->regs || !state->full_regs) {
458− orc_warn("missing regs for base reg R13 at ip %pB\n",
459− (void *)state->ip);
488+ if (!get_reg(state, offsetof(struct pt_regs, r13), &sp)) {
489+ orc_warn_current("missing R13 value at %pB\n",
490+ (void *)state->ip);
460491 goto err;
461492 }
462− sp = state->regs->r13;
463493 break;
464494
465495 case ORC_REG_DI:
466− if (!state->regs || !state->full_regs) {
467− orc_warn("missing regs for base reg DI at ip %pB\n",
468− (void *)state->ip);
496+ if (!get_reg(state, offsetof(struct pt_regs, di), &sp)) {
497+ orc_warn_current("missing RDI value at %pB\n",
498+ (void *)state->ip);
469499 goto err;
470500 }
471− sp = state->regs->di;
472501 break;
473502
474503 case ORC_REG_DX:
475− if (!state->regs || !state->full_regs) {
476− orc_warn("missing regs for base reg DX at ip %pB\n",
477− (void *)state->ip);
504+ if (!get_reg(state, offsetof(struct pt_regs, dx), &sp)) {
505+ orc_warn_current("missing DX value at %pB\n",
506+ (void *)state->ip);
478507 goto err;
479508 }
480− sp = state->regs->dx;
481509 break;
482510
483511 default:
484− orc_warn("unknown SP base reg %d for ip %pB\n",
512+ orc_warn("unknown SP base reg %d at %pB\n",
485513 orc->sp_reg, (void *)state->ip);
486514 goto err;
487515 }
@@ -504,44 +532,48 @@ bool unwind_next_frame(struct unwind_state *state) · 16 unmodified lines
504532
505533 state->sp = sp;
506534 state->regs = NULL;
535+ state->prev_regs = NULL;
507536 state->signal = false;
508537 break;
509538
510539 case ORC_TYPE_REGS:
511540 if (!deref_stack_regs(state, sp, &state->ip, &state->sp)) {
512− orc_warn("can't dereference registers at %p for ip %pB\n",
513− (void *)sp, (void *)orig_ip);
541+ orc_warn_current("can't access registers at %pB\n",
542+ (void *)orig_ip);
514543 goto err;
515544 }
516545
517546 state->regs = (struct pt_regs *)sp;
547+ state->prev_regs = NULL;
518548 state->full_regs = true;
519549 state->signal = true;
520550 break;
521551
522552 case ORC_TYPE_REGS_IRET:
523553 if (!deref_stack_iret_regs(state, sp, &state->ip, &state->sp)) {
524− orc_warn("can't dereference iret registers at %p for ip %pB\n",
525− (void *)sp, (void *)orig_ip);
554+ orc_warn_current("can't access iret registers at %pB\n",
555+ (void *)orig_ip);
526556 goto err;
527557 }
528558
559+ if (state->full_regs)
560+ state->prev_regs = state->regs;
529561 state->regs = (void *)sp - IRET_FRAME_OFFSET;
530562 state->full_regs = false;
531563 state->signal = true;
532564 break;
533565
534566 default:
535− orc_warn("unknown .orc_unwind entry type %d for ip %pB\n",
567+ orc_warn("unknown .orc_unwind entry type %d at %pB\n",
536568 orc->type, (void *)orig_ip);
537− break;
569+ goto err;
538570 }
539571
540572 /* Find BP: */
541573 switch (orc->bp_reg) {
542574 case ORC_REG_UNDEFINED:
543− if (state->regs && state->full_regs)
544− state->bp = state->regs->bp;
575+ if (get_reg(state, offsetof(struct pt_regs, bp), &tmp))
576+ state->bp = tmp;
545577 break;
546578
547579 case ORC_REG_PREV_SP:
@@ -564,8 +596,8 @@ bool unwind_next_frame(struct unwind_state *state) · 16 unmodified lines
564596 if (state->stack_info.type == prev_type &&
565597 on_stack(&state->stack_info, (void *)state->sp, sizeof(long)) &&
566598 state->sp <= prev_sp) {
567− orc_warn("stack going in the wrong direction? ip=%pB\n",
568− (void *)orig_ip);
599+ orc_warn_current("stack going in the wrong direction? at %pB\n",
600+ (void *)orig_ip);
569601 goto err;
570602 }
571603
@@ -585,6 +617,9 @@ EXPORT_SYMBOL_GPL(unwind_next_frame); · 13 unmodified lines
585617 void __unwind_start(struct unwind_state *state, struct task_struct *task,
586618 struct pt_regs *regs, unsigned long *first_frame)
587619 {
620+ if (!orc_init)
621+ goto done;
622+
588623 memset(state, 0, sizeof(*state));
589624 state->task = task;
590625
@@ -651,7 +686,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task, · 60 unmodified lines
651686 /* Otherwise, skip ahead to the user-specified starting frame: */
652687 while (!unwind_done(state) &&
653688 (!on_stack(&state->stack_info, first_frame, sizeof(long)) ||
654− state->sp <= (unsigned long)first_frame))
689+ state->sp < (unsigned long)first_frame))
655690 unwind_next_frame(state);
656691
657692 return;
arch/x86/kvm/Makefile+4−0
@@ -3,6 +3,10 @@ · 2 unmodified lines
33 ccflags-y += -Iarch/x86/kvm
44 ccflags-$(CONFIG_KVM_WERROR) += -Werror
55
6+ifeq ($(CONFIG_FRAME_POINTER),y)
7+OBJECT_FILES_NON_STANDARD_vmenter.o := y
8+endif
9+
610 KVM := ../../../virt/kvm
711
812 kvm-y += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
arch/x86/kvm/ioapic.c+5−5
@@ -225,12 +225,12 @@ static int ioapic_set_irq(struct kvm_ioapic *ioapic, unsigned int irq, · 224 unmodified lines
225225 }
226226
227227 /*
228− * AMD SVM AVIC accelerate EOI write and do not trap,
229− * in-kernel IOAPIC will not be able to receive the EOI.
230− * In this case, we do lazy update of the pending EOI when
231− * trying to set IOAPIC irq.
228+ * AMD SVM AVIC accelerate EOI write iff the interrupt is edge
229+ * triggered, in which case the in-kernel IOAPIC will not be able
230+ * to receive the EOI. In this case, we do a lazy update of the
231+ * pending EOI when trying to set IOAPIC irq.
232232 */
233− if (kvm_apicv_activated(ioapic->kvm))
233+ if (edge && kvm_apicv_activated(ioapic->kvm))
234234 ioapic_lazy_update_eoi(ioapic, irq);
235235
236236 /*
arch/x86/kvm/svm/sev.c+6−2
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/kernel.h>
1313 #include <linux/highmem.h>
1414 #include <linux/psp-sev.h>
15+#include <linux/pagemap.h>
1516 #include <linux/swap.h>
1617
1718 #include "x86.h"
@@ -344,7 +345,7 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr, · 326 unmodified lines
344345 return NULL;
345346
346347 /* Pin the user virtual address. */
347− npinned = get_user_pages_fast(uaddr, npages, FOLL_WRITE, pages);
348+ npinned = get_user_pages_fast(uaddr, npages, write ? FOLL_WRITE : 0, pages);
348349 if (npinned != npages) {
349350 pr_err("SEV: Failure locking %lu pages.\n", npages);
350351 goto err;
@@ -1117,7 +1118,7 @@ int __init sev_hardware_setup(void) · 766 unmodified lines
11171118 /* Maximum number of encrypted guests supported simultaneously */
11181119 max_sev_asid = cpuid_ecx(0x8000001F);
11191120
1120− if (!max_sev_asid)
1121+ if (!svm_sev_enabled())
11211122 return 1;
11221123
11231124 /* Minimum ASID value that should be used for SEV guest */
@@ -1156,6 +1157,9 @@ err: · 32 unmodified lines
11561157
11571158 void sev_hardware_teardown(void)
11581159 {
1160+ if (!svm_sev_enabled())
1161+ return;
1162+
11591163 bitmap_free(sev_asid_bitmap);
11601164 bitmap_free(sev_reclaim_asid_bitmap);
11611165
arch/x86/kvm/svm/svm.c+3−9
@@ -1752,6 +1752,8 @@ static int db_interception(struct vcpu_svm *svm) · 1751 unmodified lines
17521752 if (svm->vcpu.guest_debug &
17531753 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) {
17541754 kvm_run->exit_reason = KVM_EXIT_DEBUG;
1755+ kvm_run->debug.arch.dr6 = svm->vmcb->save.dr6;
1756+ kvm_run->debug.arch.dr7 = svm->vmcb->save.dr7;
17551757 kvm_run->debug.arch.pc =
17561758 svm->vmcb->save.cs.base + svm->vmcb->save.rip;
17571759 kvm_run->debug.arch.exception = DB_VECTOR;
@@ -3276,7 +3278,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu) · 1518 unmodified lines
32763278 svm_complete_interrupts(svm);
32773279 }
32783280
3279−bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
3281+void __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
32803282
32813283 static void svm_vcpu_run(struct kvm_vcpu *vcpu)
32823284 {
@@ -3330,13 +3332,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) · 47 unmodified lines
33303332 */
33313333 x86_spec_ctrl_set_guest(svm->spec_ctrl, svm->virt_spec_ctrl);
33323334
3333− local_irq_enable();
3334−
33353335 __svm_vcpu_run(svm->vmcb_pa, (unsigned long *)&svm->vcpu.arch.regs);
33363336
3337− /* Eliminate branch target predictions from guest mode */
3338− vmexit_fill_RSB();
3339−
33403337 #ifdef CONFIG_X86_64
33413338 wrmsrl(MSR_GS_BASE, svm->host.gs_base);
33423339 #else
@@ -3366,8 +3363,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) · 23 unmodified lines
33663363
33673364 reload_tss(vcpu);
33683365
3369− local_irq_disable();
3370−
33713366 x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
33723367
33733368 vcpu->arch.cr2 = svm->vmcb->save.cr2;
@@ -3411,7 +3406,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) · 37 unmodified lines
34113406
34123407 mark_all_clean(svm->vmcb);
34133408 }
3414−STACK_FRAME_NON_STANDARD(svm_vcpu_run);
34153409
34163410 static void svm_load_mmu_pgd(struct kvm_vcpu *vcpu, unsigned long root)
34173411 {
arch/x86/kvm/svm/vmenter.S+9−1
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <asm/asm.h>
44 #include <asm/bitsperlong.h>
55 #include <asm/kvm_vcpu_regs.h>
6+#include <asm/nospec-branch.h>
67
78 #define WORD_SIZE (BITS_PER_LONG / 8)
89
@@ -35,7 +36,6 @@ · 26 unmodified lines
3536 */
3637 SYM_FUNC_START(__svm_vcpu_run)
3738 push %_ASM_BP
38− mov %_ASM_SP, %_ASM_BP
3939 #ifdef CONFIG_X86_64
4040 push %r15
4141 push %r14
@@ -78,6 +78,7 @@ SYM_FUNC_START(__svm_vcpu_run) · 36 unmodified lines
7878 pop %_ASM_AX
7979
8080 /* Enter guest mode */
81+ sti
8182 1: vmload %_ASM_AX
8283 jmp 3f
8384 2: cmpb $0, kvm_rebooting
@@ -99,6 +100,13 @@ SYM_FUNC_START(__svm_vcpu_run) · 15 unmodified lines
99100 ud2
100101 _ASM_EXTABLE(5b, 6b)
101102 7:
103+ cli
104+
105+#ifdef CONFIG_RETPOLINE
106+ /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
107+ FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
108+#endif
109+
102110 /* "POP" @regs to RAX. */
103111 pop %_ASM_AX
104112
arch/x86/kvm/vmx/nested.c+20−3
@@ -5165,7 +5165,7 @@ static int handle_invept(struct kvm_vcpu *vcpu) · 5164 unmodified lines
51655165 */
51665166 break;
51675167 default:
5168− BUG_ON(1);
5168+ BUG();
51695169 break;
51705170 }
51715171
@@ -5533,8 +5533,25 @@ static bool nested_vmx_exit_handled_vmcs_access(struct kvm_vcpu *vcpu, · 361 unmodified lines
55335533 return 1 & (b >> (field & 7));
55345534 }
55355535
5536+static bool nested_vmx_exit_handled_mtf(struct vmcs12 *vmcs12)
5537+{
5538+ u32 entry_intr_info = vmcs12->vm_entry_intr_info_field;
5539+
5540+ if (nested_cpu_has_mtf(vmcs12))
5541+ return true;
5542+
5543+ /*
5544+ * An MTF VM-exit may be injected into the guest by setting the
5545+ * interruption-type to 7 (other event) and the vector field to 0. Such
5546+ * is the case regardless of the 'monitor trap flag' VM-execution
5547+ * control.
5548+ */
5549+ return entry_intr_info == (INTR_INFO_VALID_MASK
5550+ | INTR_TYPE_OTHER_EVENT);
5551+}
5552+
55365553 /*
5537− * Return 1 if we should exit from L2 to L1 to handle an exit, or 0 if we
5554+ * Return true if we should exit from L2 to L1 to handle an exit, or false if we
55385555 * should handle it ourselves in L0 (and then continue L2). Only call this
55395556 * when in is_guest_mode (L2).
55405557 */
@@ -5633,7 +5650,7 @@ bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason) · 92 unmodified lines
56335650 case EXIT_REASON_MWAIT_INSTRUCTION:
56345651 return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING);
56355652 case EXIT_REASON_MONITOR_TRAP_FLAG:
5636− return nested_cpu_has_mtf(vmcs12);
5653+ return nested_vmx_exit_handled_mtf(vmcs12);
56375654 case EXIT_REASON_MONITOR_INSTRUCTION:
56385655 return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_EXITING);
56395656 case EXIT_REASON_PAUSE_INSTRUCTION:
arch/x86/kvm/vmx/vmenter.S+3−0
@@ -82,6 +82,9 @@ SYM_FUNC_START(vmx_vmexit) · 81 unmodified lines
8282 /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
8383 FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
8484
85+ /* Clear RFLAGS.CF and RFLAGS.ZF to preserve VM-Exit, i.e. !VM-Fail. */
86+ or $1, %_ASM_AX
87+
8588 pop %_ASM_AX
8689 .Lvmexit_skip_rsb:
8790 #endif
arch/x86/kvm/vmx/vmx.c+1−1
@@ -4572,7 +4572,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu, · 4571 unmodified lines
45724572 */
45734573 static void kvm_machine_check(void)
45744574 {
4575−#if defined(CONFIG_X86_MCE) && defined(CONFIG_X86_64)
4575+#if defined(CONFIG_X86_MCE)
45764576 struct pt_regs regs = {
45774577 .cs = 3, /* Fake ring 3 no matter what the guest ran on */
45784578 .flags = X86_EFLAGS_IF,
arch/x86/kvm/x86.c+25−17
@@ -926,19 +926,6 @@ EXPORT_SYMBOL_GPL(kvm_set_xcr); · 925 unmodified lines
926926 __reserved_bits; \
927927 })
928928
929−static u64 kvm_host_cr4_reserved_bits(struct cpuinfo_x86 *c)
930−{
931− u64 reserved_bits = __cr4_reserved_bits(cpu_has, c);
932−
933− if (kvm_cpu_cap_has(X86_FEATURE_LA57))
934− reserved_bits &= ~X86_CR4_LA57;
935−
936− if (kvm_cpu_cap_has(X86_FEATURE_UMIP))
937− reserved_bits &= ~X86_CR4_UMIP;
938−
939− return reserved_bits;
940−}
941−
942929 static int kvm_valid_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
943930 {
944931 if (cr4 & cr4_reserved_bits)
@@ -3060,6 +3047,17 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 2115 unmodified lines
30603047 case MSR_IA32_PERF_CTL:
30613048 case MSR_AMD64_DC_CFG:
30623049 case MSR_F15H_EX_CFG:
3050+ /*
3051+ * Intel Sandy Bridge CPUs must support the RAPL (running average power
3052+ * limit) MSRs. Just return 0, as we do not want to expose the host
3053+ * data here. Do not conditionalize this on CPUID, as KVM does not do
3054+ * so for existing CPU-specific MSRs.
3055+ */
3056+ case MSR_RAPL_POWER_UNIT:
3057+ case MSR_PP0_ENERGY_STATUS: /* Power plane 0 (core) */
3058+ case MSR_PP1_ENERGY_STATUS: /* Power plane 1 (graphics uncore) */
3059+ case MSR_PKG_ENERGY_STATUS: /* Total package */
3060+ case MSR_DRAM_ENERGY_STATUS: /* DRAM controller */
30633061 msr_info->data = 0;
30643062 break;
30653063 case MSR_F15H_PERF_CTL0 ... MSR_F15H_PERF_CTR5:
@@ -3374,6 +3372,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 308 unmodified lines
33743372 case KVM_CAP_GET_MSR_FEATURES:
33753373 case KVM_CAP_MSR_PLATFORM_INFO:
33763374 case KVM_CAP_EXCEPTION_PAYLOAD:
3375+ case KVM_CAP_SET_GUEST_DEBUG:
33773376 r = 1;
33783377 break;
33793378 case KVM_CAP_SYNC_REGS:
@@ -5049,10 +5048,13 @@ set_identity_unlock: · 1669 unmodified lines
50495048 r = -EFAULT;
50505049 if (copy_from_user(&u.ps, argp, sizeof(u.ps)))
50515050 goto out;
5051+ mutex_lock(&kvm->lock);
50525052 r = -ENXIO;
50535053 if (!kvm->arch.vpit)
5054− goto out;
5054+ goto set_pit_out;
50555055 r = kvm_vm_ioctl_set_pit(kvm, &u.ps);
5056+set_pit_out:
5057+ mutex_unlock(&kvm->lock);
50565058 break;
50575059 }
50585060 case KVM_GET_PIT2: {
@@ -5072,10 +5074,13 @@ set_identity_unlock: · 13 unmodified lines
50725074 r = -EFAULT;
50735075 if (copy_from_user(&u.ps2, argp, sizeof(u.ps2)))
50745076 goto out;
5077+ mutex_lock(&kvm->lock);
50755078 r = -ENXIO;
50765079 if (!kvm->arch.vpit)
5077− goto out;
5080+ goto set_pit2_out;
50785081 r = kvm_vm_ioctl_set_pit2(kvm, &u.ps2);
5082+set_pit2_out:
5083+ mutex_unlock(&kvm->lock);
50795084 break;
50805085 }
50815086 case KVM_REINJECT_CONTROL: {
@@ -9658,7 +9663,9 @@ int kvm_arch_hardware_setup(void *opaque) · 4576 unmodified lines
96589663 if (!kvm_cpu_cap_has(X86_FEATURE_XSAVES))
96599664 supported_xss = 0;
96609665
9661− cr4_reserved_bits = kvm_host_cr4_reserved_bits(&boot_cpu_data);
9666+#define __kvm_cpu_cap_has(UNUSED_, f) kvm_cpu_cap_has(f)
9667+ cr4_reserved_bits = __cr4_reserved_bits(__kvm_cpu_cap_has, UNUSED_);
9668+#undef __kvm_cpu_cap_has
96629669
96639670 if (kvm_has_tsc_control) {
96649671 /*
@@ -9690,7 +9697,8 @@ int kvm_arch_check_processor_compat(void *opaque) · 25 unmodified lines
96909697
96919698 WARN_ON(!irqs_disabled());
96929699
9693− if (kvm_host_cr4_reserved_bits(c) != cr4_reserved_bits)
9700+ if (__cr4_reserved_bits(cpu_has, c) !=
9701+ __cr4_reserved_bits(cpu_has, &boot_cpu_data))
96949702 return -EIO;
96959703
96969704 return ops->check_processor_compatibility();
arch/x86/mm/pat/set_memory.c+8−4
@@ -43,7 +43,8 @@ struct cpa_data { · 42 unmodified lines
4343 unsigned long pfn;
4444 unsigned int flags;
4545 unsigned int force_split : 1,
46− force_static_prot : 1;
46+ force_static_prot : 1,
47+ force_flush_all : 1;
4748 struct page **pages;
4849 };
4950
@@ -355,10 +356,10 @@ static void cpa_flush(struct cpa_data *data, int cache) · 305 unmodified lines
355356 return;
356357 }
357358
358− if (cpa->numpages <= tlb_single_page_flush_ceiling)
359− on_each_cpu(__cpa_flush_tlb, cpa, 1);
360− else
359+ if (cpa->force_flush_all || cpa->numpages > tlb_single_page_flush_ceiling)
361360 flush_tlb_all();
361+ else
362+ on_each_cpu(__cpa_flush_tlb, cpa, 1);
362363
363364 if (!cache)
364365 return;
@@ -1598,6 +1599,8 @@ static int cpa_process_alias(struct cpa_data *cpa) · 1233 unmodified lines
15981599 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
15991600 alias_cpa.curpage = 0;
16001601
1602+ cpa->force_flush_all = 1;
1603+
16011604 ret = __change_page_attr_set_clr(&alias_cpa, 0);
16021605 if (ret)
16031606 return ret;
@@ -1618,6 +1621,7 @@ static int cpa_process_alias(struct cpa_data *cpa) · 14 unmodified lines
16181621 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
16191622 alias_cpa.curpage = 0;
16201623
1624+ cpa->force_flush_all = 1;
16211625 /*
16221626 * The high mapping range is imprecise, so ignore the
16231627 * return value.
arch/x86/net/bpf_jit_comp.c+15−3
@@ -158,6 +158,19 @@ static bool is_ereg(u32 reg) · 157 unmodified lines
158158 BIT(BPF_REG_AX));
159159 }
160160
161+/*
162+ * is_ereg_8l() == true if BPF register 'reg' is mapped to access x86-64
163+ * lower 8-bit registers dil,sil,bpl,spl,r8b..r15b, which need extra byte
164+ * of encoding. al,cl,dl,bl have simpler encoding.
165+ */
166+static bool is_ereg_8l(u32 reg)
167+{
168+ return is_ereg(reg) ||
169+ (1 << reg) & (BIT(BPF_REG_1) |
170+ BIT(BPF_REG_2) |
171+ BIT(BPF_REG_FP));
172+}
173+
161174 static bool is_axreg(u32 reg)
162175 {
163176 return reg == BPF_REG_0;
@@ -598,9 +611,8 @@ static void emit_stx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off) · 434 unmodified lines
598611 switch (size) {
599612 case BPF_B:
600613 /* Emit 'mov byte ptr [rax + off], al' */
601− if (is_ereg(dst_reg) || is_ereg(src_reg) ||
602− /* We have to add extra byte for x86 SIL, DIL regs */
603− src_reg == BPF_REG_1 || src_reg == BPF_REG_2)
614+ if (is_ereg(dst_reg) || is_ereg_8l(src_reg))
615+ /* Add extra byte for eregs or SIL,DIL,BPL in src_reg */
604616 EMIT2(add_2mod(0x40, dst_reg, src_reg), 0x88);
605617 else
606618 EMIT1(0x88);
arch/x86/net/bpf_jit_comp32.c+22−6
@@ -1847,14 +1847,16 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, · 1846 unmodified lines
18471847 case BPF_B:
18481848 case BPF_H:
18491849 case BPF_W:
1850− if (!bpf_prog->aux->verifier_zext)
1850+ if (bpf_prog->aux->verifier_zext)
18511851 break;
18521852 if (dstk) {
18531853 EMIT3(0xC7, add_1reg(0x40, IA32_EBP),
18541854 STACK_VAR(dst_hi));
18551855 EMIT(0x0, 4);
18561856 } else {
1857− EMIT3(0xC7, add_1reg(0xC0, dst_hi), 0);
1857+ /* xor dst_hi,dst_hi */
1858+ EMIT2(0x33,
1859+ add_2reg(0xC0, dst_hi, dst_hi));
18581860 }
18591861 break;
18601862 case BPF_DW:
@@ -2013,8 +2015,8 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, · 152 unmodified lines
20132015 case BPF_JMP | BPF_JSET | BPF_X:
20142016 case BPF_JMP32 | BPF_JSET | BPF_X: {
20152017 bool is_jmp64 = BPF_CLASS(insn->code) == BPF_JMP;
2016− u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
2017− u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
2018+ u8 dreg_lo = IA32_EAX;
2019+ u8 dreg_hi = IA32_EDX;
20182020 u8 sreg_lo = sstk ? IA32_ECX : src_lo;
20192021 u8 sreg_hi = sstk ? IA32_EBX : src_hi;
20202022
@@ -2026,6 +2028,13 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, · 5 unmodified lines
20262028 add_2reg(0x40, IA32_EBP,
20272029 IA32_EDX),
20282030 STACK_VAR(dst_hi));
2031+ } else {
2032+ /* mov dreg_lo,dst_lo */
2033+ EMIT2(0x89, add_2reg(0xC0, dreg_lo, dst_lo));
2034+ if (is_jmp64)
2035+ /* mov dreg_hi,dst_hi */
2036+ EMIT2(0x89,
2037+ add_2reg(0xC0, dreg_hi, dst_hi));
20292038 }
20302039
20312040 if (sstk) {
@@ -2050,8 +2059,8 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, · 18 unmodified lines
20502059 case BPF_JMP | BPF_JSET | BPF_K:
20512060 case BPF_JMP32 | BPF_JSET | BPF_K: {
20522061 bool is_jmp64 = BPF_CLASS(insn->code) == BPF_JMP;
2053− u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
2054− u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
2062+ u8 dreg_lo = IA32_EAX;
2063+ u8 dreg_hi = IA32_EDX;
20552064 u8 sreg_lo = IA32_ECX;
20562065 u8 sreg_hi = IA32_EBX;
20572066 u32 hi;
@@ -2064,6 +2073,13 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, · 6 unmodified lines
20642073 add_2reg(0x40, IA32_EBP,
20652074 IA32_EDX),
20662075 STACK_VAR(dst_hi));
2076+ } else {
2077+ /* mov dreg_lo,dst_lo */
2078+ EMIT2(0x89, add_2reg(0xC0, dreg_lo, dst_lo));
2079+ if (is_jmp64)
2080+ /* mov dreg_hi,dst_hi */
2081+ EMIT2(0x89,
2082+ add_2reg(0xC0, dreg_hi, dst_hi));
20672083 }
20682084
20692085 /* mov ecx,imm32 */
arch/xtensa/include/asm/vermagic.hrenamed from arch/xtensa/include/asm/module.h+6−9
@@ -1,8 +1,4 @@
11 /*
2− * include/asm-xtensa/module.h
3− *
4− * This file contains the module code specific to the Xtensa architecture.
5− *
62 * This file is subject to the terms and conditions of the GNU General Public
73 * License. See the file "COPYING" in the main directory of this archive
84 * for more details.
@@ -10,11 +6,12 @@ · 1 unmodified line
106 * Copyright (C) 2001 - 2005 Tensilica Inc.
117 */
128
13−#ifndef _XTENSA_MODULE_H
14−#define _XTENSA_MODULE_H
9+#ifndef _ASM_VERMAGIC_H
10+#define _ASM_VERMAGIC_H
1511
16−#define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " "
12+#include <linux/stringify.h>
13+#include <variant/core.h>
1714
18−#include <asm-generic/module.h>
15+#define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " "
1916
20−#endif /* _XTENSA_MODULE_H */
17+#endif /* _ASM_VERMAGIC_H */
block/bfq-iosched.c+4−2
@@ -123,6 +123,7 @@ · 122 unmodified lines
123123 #include <linux/ioprio.h>
124124 #include <linux/sbitmap.h>
125125 #include <linux/delay.h>
126+#include <linux/backing-dev.h>
126127
127128 #include "blk.h"
128129 #include "blk-mq.h"
@@ -4976,8 +4977,9 @@ bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic) · 4847 unmodified lines
49764977 ioprio_class = IOPRIO_PRIO_CLASS(bic->ioprio);
49774978 switch (ioprio_class) {
49784979 default:
4979− dev_err(bfqq->bfqd->queue->backing_dev_info->dev,
4980− "bfq: bad prio class %d\n", ioprio_class);
4980+ pr_err("bdi %s: bfq: bad prio class %d\n",
4981+ bdi_dev_name(bfqq->bfqd->queue->backing_dev_info),
4982+ ioprio_class);
49814983 /* fall through */
49824984 case IOPRIO_CLASS_NONE:
49834985 /*
block/blk-cgroup.c+1−1
@@ -496,7 +496,7 @@ const char *blkg_dev_name(struct blkcg_gq *blkg) · 495 unmodified lines
496496 {
497497 /* some drivers (floppy) instantiate a queue w/o disk registered */
498498 if (blkg->q->backing_dev_info->dev)
499− return dev_name(blkg->q->backing_dev_info->dev);
499+ return bdi_dev_name(blkg->q->backing_dev_info);
500500 return NULL;
501501 }
502502
block/blk-iocost.c+73−48
@@ -466,7 +466,7 @@ struct ioc_gq { · 465 unmodified lines
466466 */
467467 atomic64_t vtime;
468468 atomic64_t done_vtime;
469− atomic64_t abs_vdebt;
469+ u64 abs_vdebt;
470470 u64 last_vtime;
471471
472472 /*
@@ -1142,7 +1142,7 @@ static void iocg_kick_waitq(struct ioc_gq *iocg, struct ioc_now *now) · 669 unmodified lines
11421142 struct iocg_wake_ctx ctx = { .iocg = iocg };
11431143 u64 margin_ns = (u64)(ioc->period_us *
11441144 WAITQ_TIMER_MARGIN_PCT / 100) * NSEC_PER_USEC;
1145− u64 abs_vdebt, vdebt, vshortage, expires, oexpires;
1145+ u64 vdebt, vshortage, expires, oexpires;
11461146 s64 vbudget;
11471147 u32 hw_inuse;
11481148
@@ -1152,18 +1152,15 @@ static void iocg_kick_waitq(struct ioc_gq *iocg, struct ioc_now *now) · 3 unmodified lines
11521152 vbudget = now->vnow - atomic64_read(&iocg->vtime);
11531153
11541154 /* pay off debt */
1155− abs_vdebt = atomic64_read(&iocg->abs_vdebt);
1156− vdebt = abs_cost_to_cost(abs_vdebt, hw_inuse);
1155+ vdebt = abs_cost_to_cost(iocg->abs_vdebt, hw_inuse);
11571156 if (vdebt && vbudget > 0) {
11581157 u64 delta = min_t(u64, vbudget, vdebt);
11591158 u64 abs_delta = min(cost_to_abs_cost(delta, hw_inuse),
1160− abs_vdebt);
1159+ iocg->abs_vdebt);
11611160
11621161 atomic64_add(delta, &iocg->vtime);
11631162 atomic64_add(delta, &iocg->done_vtime);
1164− atomic64_sub(abs_delta, &iocg->abs_vdebt);
1165− if (WARN_ON_ONCE(atomic64_read(&iocg->abs_vdebt) < 0))
1166− atomic64_set(&iocg->abs_vdebt, 0);
1163+ iocg->abs_vdebt -= abs_delta;
11671164 }
11681165
11691166 /*
@@ -1219,12 +1216,18 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now, u64 cost) · 49 unmodified lines
12191216 u64 expires, oexpires;
12201217 u32 hw_inuse;
12211218
1219+ lockdep_assert_held(&iocg->waitq.lock);
1220+
12221221 /* debt-adjust vtime */
12231222 current_hweight(iocg, NULL, &hw_inuse);
1224− vtime += abs_cost_to_cost(atomic64_read(&iocg->abs_vdebt), hw_inuse);
1223+ vtime += abs_cost_to_cost(iocg->abs_vdebt, hw_inuse);
12251224
1226− /* clear or maintain depending on the overage */
1227− if (time_before_eq64(vtime, now->vnow)) {
1225+ /*
1226+ * Clear or maintain depending on the overage. Non-zero vdebt is what
1227+ * guarantees that @iocg is online and future iocg_kick_delay() will
1228+ * clear use_delay. Don't leave it on when there's no vdebt.
1229+ */
1230+ if (!iocg->abs_vdebt || time_before_eq64(vtime, now->vnow)) {
12281231 blkcg_clear_delay(blkg);
12291232 return false;
12301233 }
@@ -1258,9 +1261,12 @@ static enum hrtimer_restart iocg_delay_timer_fn(struct hrtimer *timer) · 27 unmodified lines
12581261 {
12591262 struct ioc_gq *iocg = container_of(timer, struct ioc_gq, delay_timer);
12601263 struct ioc_now now;
1264+ unsigned long flags;
12611265
1266+ spin_lock_irqsave(&iocg->waitq.lock, flags);
12621267 ioc_now(iocg->ioc, &now);
12631268 iocg_kick_delay(iocg, &now, 0);
1269+ spin_unlock_irqrestore(&iocg->waitq.lock, flags);
12641270
12651271 return HRTIMER_NORESTART;
12661272 }
@@ -1368,14 +1374,13 @@ static void ioc_timer_fn(struct timer_list *timer) · 101 unmodified lines
13681374 * should have woken up in the last period and expire idle iocgs.
13691375 */
13701376 list_for_each_entry_safe(iocg, tiocg, &ioc->active_iocgs, active_list) {
1371− if (!waitqueue_active(&iocg->waitq) &&
1372− !atomic64_read(&iocg->abs_vdebt) && !iocg_is_idle(iocg))
1377+ if (!waitqueue_active(&iocg->waitq) && iocg->abs_vdebt &&
1378+ !iocg_is_idle(iocg))
13731379 continue;
13741380
13751381 spin_lock(&iocg->waitq.lock);
13761382
1377− if (waitqueue_active(&iocg->waitq) ||
1378− atomic64_read(&iocg->abs_vdebt)) {
1383+ if (waitqueue_active(&iocg->waitq) || iocg->abs_vdebt) {
13791384 /* might be oversleeping vtime / hweight changes, kick */
13801385 iocg_kick_waitq(iocg, &now);
13811386 iocg_kick_delay(iocg, &now, 0);
@@ -1591,7 +1596,7 @@ skip_surplus_transfers: · 209 unmodified lines
15911596 vrate_min, vrate_max);
15921597 }
15931598
1594− trace_iocost_ioc_vrate_adj(ioc, vrate, &missed_ppm, rq_wait_pct,
1599+ trace_iocost_ioc_vrate_adj(ioc, vrate, missed_ppm, rq_wait_pct,
15951600 nr_lagging, nr_shortages,
15961601 nr_surpluses);
15971602
@@ -1600,7 +1605,7 @@ skip_surplus_transfers: · 2 unmodified lines
16001605 ioc->period_us * vrate * INUSE_MARGIN_PCT, 100);
16011606 } else if (ioc->busy_level != prev_busy_level || nr_lagging) {
16021607 trace_iocost_ioc_vrate_adj(ioc, atomic64_read(&ioc->vtime_rate),
1603− &missed_ppm, rq_wait_pct, nr_lagging,
1608+ missed_ppm, rq_wait_pct, nr_lagging,
16041609 nr_shortages, nr_surpluses);
16051610 }
16061611
@@ -1718,28 +1723,49 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio) · 111 unmodified lines
17181723 * tests are racy but the races aren't systemic - we only miss once
17191724 * in a while which is fine.
17201725 */
1721− if (!waitqueue_active(&iocg->waitq) &&
1722− !atomic64_read(&iocg->abs_vdebt) &&
1726+ if (!waitqueue_active(&iocg->waitq) && !iocg->abs_vdebt &&
17231727 time_before_eq64(vtime + cost, now.vnow)) {
17241728 iocg_commit_bio(iocg, bio, cost);
17251729 return;
17261730 }
17271731
17281732 /*
1729− * We're over budget. If @bio has to be issued regardless,
1730− * remember the abs_cost instead of advancing vtime.
1731− * iocg_kick_waitq() will pay off the debt before waking more IOs.
1733+ * We activated above but w/o any synchronization. Deactivation is
1734+ * synchronized with waitq.lock and we won't get deactivated as long
1735+ * as we're waiting or has debt, so we're good if we're activated
1736+ * here. In the unlikely case that we aren't, just issue the IO.
1737+ */
1738+ spin_lock_irq(&iocg->waitq.lock);
1739+
1740+ if (unlikely(list_empty(&iocg->active_list))) {
1741+ spin_unlock_irq(&iocg->waitq.lock);
1742+ iocg_commit_bio(iocg, bio, cost);
1743+ return;
1744+ }
1745+
1746+ /*
1747+ * We're over budget. If @bio has to be issued regardless, remember
1748+ * the abs_cost instead of advancing vtime. iocg_kick_waitq() will pay
1749+ * off the debt before waking more IOs.
1750+ *
17321751 * This way, the debt is continuously paid off each period with the
1733− * actual budget available to the cgroup. If we just wound vtime,
1734− * we would incorrectly use the current hw_inuse for the entire
1735− * amount which, for example, can lead to the cgroup staying
1736− * blocked for a long time even with substantially raised hw_inuse.
1752+ * actual budget available to the cgroup. If we just wound vtime, we
1753+ * would incorrectly use the current hw_inuse for the entire amount
1754+ * which, for example, can lead to the cgroup staying blocked for a
1755+ * long time even with substantially raised hw_inuse.
1756+ *
1757+ * An iocg with vdebt should stay online so that the timer can keep
1758+ * deducting its vdebt and [de]activate use_delay mechanism
1759+ * accordingly. We don't want to race against the timer trying to
1760+ * clear them and leave @iocg inactive w/ dangling use_delay heavily
1761+ * penalizing the cgroup and its descendants.
17371762 */
17381763 if (bio_issue_as_root_blkg(bio) || fatal_signal_pending(current)) {
1739− atomic64_add(abs_cost, &iocg->abs_vdebt);
1764+ iocg->abs_vdebt += abs_cost;
17401765 if (iocg_kick_delay(iocg, &now, cost))
17411766 blkcg_schedule_throttle(rqos->q,
17421767 (bio->bi_opf & REQ_SWAP) == REQ_SWAP);
1768+ spin_unlock_irq(&iocg->waitq.lock);
17431769 return;
17441770 }
17451771
@@ -1756,20 +1782,6 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio) · 10 unmodified lines
17561782 * All waiters are on iocg->waitq and the wait states are
17571783 * synchronized using waitq.lock.
17581784 */
1759− spin_lock_irq(&iocg->waitq.lock);
1760−
1761− /*
1762− * We activated above but w/o any synchronization. Deactivation is
1763− * synchronized with waitq.lock and we won't get deactivated as
1764− * long as we're waiting, so we're good if we're activated here.
1765− * In the unlikely case that we are deactivated, just issue the IO.
1766− */
1767− if (unlikely(list_empty(&iocg->active_list))) {
1768− spin_unlock_irq(&iocg->waitq.lock);
1769− iocg_commit_bio(iocg, bio, cost);
1770− return;
1771− }
1772−
17731785 init_waitqueue_func_entry(&wait.wait, iocg_wake_fn);
17741786 wait.wait.private = current;
17751787 wait.bio = bio;
@@ -1801,6 +1813,7 @@ static void ioc_rqos_merge(struct rq_qos *rqos, struct request *rq, · 25 unmodified lines
18011813 struct ioc_now now;
18021814 u32 hw_inuse;
18031815 u64 abs_cost, cost;
1816+ unsigned long flags;
18041817
18051818 /* bypass if disabled or for root cgroup */
18061819 if (!ioc->enabled || !iocg->level)
@@ -1820,15 +1833,28 @@ static void ioc_rqos_merge(struct rq_qos *rqos, struct request *rq, · 13 unmodified lines
18201833 iocg->cursor = bio_end;
18211834
18221835 /*
1823− * Charge if there's enough vtime budget and the existing request
1824− * has cost assigned. Otherwise, account it as debt. See debt
1825− * handling in ioc_rqos_throttle() for details.
1836+ * Charge if there's enough vtime budget and the existing request has
1837+ * cost assigned.
18261838 */
18271839 if (rq->bio && rq->bio->bi_iocost_cost &&
1828− time_before_eq64(atomic64_read(&iocg->vtime) + cost, now.vnow))
1840+ time_before_eq64(atomic64_read(&iocg->vtime) + cost, now.vnow)) {
18291841 iocg_commit_bio(iocg, bio, cost);
1830− else
1831− atomic64_add(abs_cost, &iocg->abs_vdebt);
1842+ return;
1843+ }
1844+
1845+ /*
1846+ * Otherwise, account it as debt if @iocg is online, which it should
1847+ * be for the vast majority of cases. See debt handling in
1848+ * ioc_rqos_throttle() for details.
1849+ */
1850+ spin_lock_irqsave(&iocg->waitq.lock, flags);
1851+ if (likely(!list_empty(&iocg->active_list))) {
1852+ iocg->abs_vdebt += abs_cost;
1853+ iocg_kick_delay(iocg, &now, cost);
1854+ } else {
1855+ iocg_commit_bio(iocg, bio, cost);
1856+ }
1857+ spin_unlock_irqrestore(&iocg->waitq.lock, flags);
18321858 }
18331859
18341860 static void ioc_rqos_done_bio(struct rq_qos *rqos, struct bio *bio)
@@ -1998,7 +2024,6 @@ static void ioc_pd_init(struct blkg_policy_data *pd) · 163 unmodified lines
19982024 iocg->ioc = ioc;
19992025 atomic64_set(&iocg->vtime, now.vnow);
20002026 atomic64_set(&iocg->done_vtime, now.vnow);
2001− atomic64_set(&iocg->abs_vdebt, 0);
20022027 atomic64_set(&iocg->active_period, atomic64_read(&ioc->cur_period));
20032028 INIT_LIST_HEAD(&iocg->active_list);
20042029 iocg->hweight_active = HWEIGHT_WHOLE;
block/partitions/core.c+1−1
@@ -496,7 +496,7 @@ int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev) · 495 unmodified lines
496496
497497 if (!disk_part_scan_enabled(disk))
498498 return 0;
499− if (bdev->bd_part_count || bdev->bd_openers > 1)
499+ if (bdev->bd_part_count)
500500 return -EBUSY;
501501 res = invalidate_partition(disk, 0);
502502 if (res)
crypto/lrw.c+3−3
@@ -287,7 +287,7 @@ static void exit_tfm(struct crypto_skcipher *tfm) · 286 unmodified lines
287287 crypto_free_skcipher(ctx->child);
288288 }
289289
290−static void free(struct skcipher_instance *inst)
290+static void free_inst(struct skcipher_instance *inst)
291291 {
292292 crypto_drop_skcipher(skcipher_instance_ctx(inst));
293293 kfree(inst);
@@ -400,12 +400,12 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb) · 106 unmodified lines
400400 inst->alg.encrypt = encrypt;
401401 inst->alg.decrypt = decrypt;
402402
403− inst->free = free;
403+ inst->free = free_inst;
404404
405405 err = skcipher_register_instance(tmpl, inst);
406406 if (err) {
407407 err_free_inst:
408− free(inst);
408+ free_inst(inst);
409409 }
410410 return err;
411411 }
crypto/xts.c+3−3
@@ -322,7 +322,7 @@ static void exit_tfm(struct crypto_skcipher *tfm) · 321 unmodified lines
322322 crypto_free_cipher(ctx->tweak);
323323 }
324324
325−static void free(struct skcipher_instance *inst)
325+static void free_inst(struct skcipher_instance *inst)
326326 {
327327 crypto_drop_skcipher(skcipher_instance_ctx(inst));
328328 kfree(inst);
@@ -434,12 +434,12 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb) · 105 unmodified lines
434434 inst->alg.encrypt = encrypt;
435435 inst->alg.decrypt = decrypt;
436436
437− inst->free = free;
437+ inst->free = free_inst;
438438
439439 err = skcipher_register_instance(tmpl, inst);
440440 if (err) {
441441 err_free_inst:
442− free(inst);
442+ free_inst(inst);
443443 }
444444 return err;
445445 }
drivers/acpi/button.c+0−12
@@ -87,18 +87,6 @@ static const struct dmi_system_id dmi_lid_quirks[] = { · 86 unmodified lines
8787 },
8888 .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_DISABLED,
8989 },
90− {
91− /*
92− * Asus T200TA, _LID keeps reporting closed after every second
93− * openening of the lid. Causing immediate re-suspend after
94− * opening every other open. Using LID_INIT_OPEN fixes this.
95− */
96− .matches = {
97− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
98− DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"),
99− },
100− .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
101− },
10290 {
10391 /* GP-electronic T701, _LID method points to a floating GPIO */
10492 .matches = {
drivers/acpi/device_pm.c+2−2
@@ -273,13 +273,13 @@ int acpi_device_set_power(struct acpi_device *device, int state) · 272 unmodified lines
273273 end:
274274 if (result) {
275275 dev_warn(&device->dev, "Failed to change power state to %s\n",
276− acpi_power_state_string(state));
276+ acpi_power_state_string(target_state));
277277 } else {
278278 device->power.state = target_state;
279279 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
280280 "Device [%s] transitioned to %s\n",
281281 device->pnp.bus_id,
282− acpi_power_state_string(state)));
282+ acpi_power_state_string(target_state)));
283283 }
284284
285285 return result;
drivers/acpi/pci_link.c+2−2
@@ -322,10 +322,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) · 321 unmodified lines
322322 resource->res.data.extended_irq.polarity =
323323 link->irq.polarity;
324324 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
325− resource->res.data.irq.shareable =
325+ resource->res.data.extended_irq.shareable =
326326 ACPI_EXCLUSIVE;
327327 else
328− resource->res.data.irq.shareable = ACPI_SHARED;
328+ resource->res.data.extended_irq.shareable = ACPI_SHARED;
329329 resource->res.data.extended_irq.interrupt_count = 1;
330330 resource->res.data.extended_irq.interrupts[0] = irq;
331331 /* ignore resource_source, it's optional */
drivers/amba/bus.c+1−0
@@ -645,6 +645,7 @@ static void amba_device_initialize(struct amba_device *dev, const char *name) · 644 unmodified lines
645645 dev->dev.release = amba_device_release;
646646 dev->dev.bus = &amba_bustype;
647647 dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
648+ dev->dev.dma_parms = &dev->dma_parms;
648649 dev->res.name = dev_name(&dev->dev);
649650 }
650651
drivers/ata/sata_inic162x.c+1−1
@@ -145,7 +145,7 @@ enum { · 144 unmodified lines
145145
146146 /* PORT_IDMA_CTL bits */
147147 IDMA_CTL_RST_ATA = (1 << 2), /* hardreset ATA bus */
148− IDMA_CTL_RST_IDMA = (1 << 5), /* reset IDMA machinary */
148+ IDMA_CTL_RST_IDMA = (1 << 5), /* reset IDMA machinery */
149149 IDMA_CTL_GO = (1 << 7), /* IDMA mode go */
150150 IDMA_CTL_ATA_NIEN = (1 << 8), /* ATA IRQ disable */
151151
drivers/base/component.c+5−3
@@ -256,7 +256,8 @@ static int try_to_bring_up_master(struct master *master, · 255 unmodified lines
256256 ret = master->ops->bind(master->dev);
257257 if (ret < 0) {
258258 devres_release_group(master->dev, NULL);
259− dev_info(master->dev, "master bind failed: %d\n", ret);
259+ if (ret != -EPROBE_DEFER)
260+ dev_info(master->dev, "master bind failed: %d\n", ret);
260261 return ret;
261262 }
262263
@@ -611,8 +612,9 @@ static int component_bind(struct component *component, struct master *master, · 348 unmodified lines
611612 devres_release_group(component->dev, NULL);
612613 devres_release_group(master->dev, NULL);
613614
614− dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
615− dev_name(component->dev), component->ops, ret);
615+ if (ret != -EPROBE_DEFER)
616+ dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
617+ dev_name(component->dev), component->ops, ret);
616618 }
617619
618620 return ret;
drivers/base/core.c+6−1
@@ -2370,6 +2370,11 @@ u32 fw_devlink_get_flags(void) · 2369 unmodified lines
23702370 return fw_devlink_flags;
23712371 }
23722372
2373+static bool fw_devlink_is_permissive(void)
2374+{
2375+ return fw_devlink_flags == DL_FLAG_SYNC_STATE_ONLY;
2376+}
2377+
23732378 /**
23742379 * device_add - add device to device hierarchy.
23752380 * @dev: device.
@@ -2524,7 +2529,7 @@ int device_add(struct device *dev) · 148 unmodified lines
25242529 if (fw_devlink_flags && is_fwnode_dev &&
25252530 fwnode_has_op(dev->fwnode, add_links)) {
25262531 fw_ret = fwnode_call_int_op(dev->fwnode, add_links, dev);
2527− if (fw_ret == -ENODEV)
2532+ if (fw_ret == -ENODEV && !fw_devlink_is_permissive())
25282533 device_link_wait_for_mandatory_supplier(dev);
25292534 else if (fw_ret)
25302535 device_link_wait_for_optional_supplier(dev);
drivers/base/dd.c+8−12
@@ -224,17 +224,9 @@ static int deferred_devs_show(struct seq_file *s, void *data) · 223 unmodified lines
224224 }
225225 DEFINE_SHOW_ATTRIBUTE(deferred_devs);
226226
227−#ifdef CONFIG_MODULES
228−/*
229− * In the case of modules, set the default probe timeout to
230− * 30 seconds to give userland some time to load needed modules
231− */
232−int driver_deferred_probe_timeout = 30;
233−#else
234−/* In the case of !modules, no probe timeout needed */
235−int driver_deferred_probe_timeout = -1;
236−#endif
227+int driver_deferred_probe_timeout;
237228 EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout);
229+static DECLARE_WAIT_QUEUE_HEAD(probe_timeout_waitqueue);
238230
239231 static int __init deferred_probe_timeout_setup(char *str)
240232 {
@@ -266,8 +258,8 @@ int driver_deferred_probe_check_state(struct device *dev) · 25 unmodified lines
266258 return -ENODEV;
267259 }
268260
269− if (!driver_deferred_probe_timeout) {
270− dev_WARN(dev, "deferred probe timeout, ignoring dependency");
261+ if (!driver_deferred_probe_timeout && initcalls_done) {
262+ dev_warn(dev, "deferred probe timeout, ignoring dependency");
271263 return -ETIMEDOUT;
272264 }
273265
@@ -284,6 +276,7 @@ static void deferred_probe_timeout_work_func(struct work_struct *work) · 10 unmodified lines
284276
285277 list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe)
286278 dev_info(private->device, "deferred probe pending");
279+ wake_up(&probe_timeout_waitqueue);
287280 }
288281 static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func);
289282
@@ -658,6 +651,9 @@ int driver_probe_done(void) · 368 unmodified lines
658651 */
659652 void wait_for_device_probe(void)
660653 {
654+ /* wait for probe timeout */
655+ wait_event(probe_timeout_waitqueue, !driver_deferred_probe_timeout);
656+
661657 /* wait for the deferred probe workqueue to finish */
662658 flush_work(&deferred_probe_work);
663659
drivers/base/firmware_loader/fallback_table.c+0−1
@@ -45,5 +45,4 @@ struct ctl_table firmware_config_table[] = { · 44 unmodified lines
4545 },
4646 { }
4747 };
48−EXPORT_SYMBOL_GPL(firmware_config_table);
4948 #endif
drivers/base/platform.c+2−0
@@ -380,6 +380,8 @@ struct platform_object { · 379 unmodified lines
380380 */
381381 static void setup_pdev_dma_masks(struct platform_device *pdev)
382382 {
383+ pdev->dev.dma_parms = &pdev->dma_parms;
384+
383385 if (!pdev->dev.coherent_dma_mask)
384386 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
385387 if (!pdev->dev.dma_mask) {
drivers/base/power/main.c+1−1
@@ -730,7 +730,7 @@ static bool dpm_async_fn(struct device *dev, async_func_t func) · 729 unmodified lines
730730
731731 if (is_async(dev)) {
732732 get_device(dev);
733− async_schedule(func, dev);
733+ async_schedule_dev(func, dev);
734734 return true;
735735 }
736736
drivers/block/null_blk.h+19−10
@@ -85,26 +85,35 @@ struct nullb { · 84 unmodified lines
8585 char disk_name[DISK_NAME_LEN];
8686 };
8787
88+blk_status_t null_process_cmd(struct nullb_cmd *cmd,
89+ enum req_opf op, sector_t sector,
90+ unsigned int nr_sectors);
91+
8892 #ifdef CONFIG_BLK_DEV_ZONED
89−int null_zone_init(struct nullb_device *dev);
90−void null_zone_exit(struct nullb_device *dev);
93+int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q);
94+int null_register_zoned_dev(struct nullb *nullb);
95+void null_free_zoned_dev(struct nullb_device *dev);
9196 int null_report_zones(struct gendisk *disk, sector_t sector,
9297 unsigned int nr_zones, report_zones_cb cb, void *data);
93−blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
94− enum req_opf op, sector_t sector,
95− sector_t nr_sectors);
98+blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd,
99+ enum req_opf op, sector_t sector,
100+ sector_t nr_sectors);
96101 size_t null_zone_valid_read_len(struct nullb *nullb,
97102 sector_t sector, unsigned int len);
98103 #else
99−static inline int null_zone_init(struct nullb_device *dev)
104+static inline int null_init_zoned_dev(struct nullb_device *dev,
105+ struct request_queue *q)
100106 {
101107 pr_err("CONFIG_BLK_DEV_ZONED not enabled\n");
102108 return -EINVAL;
103109 }
104−static inline void null_zone_exit(struct nullb_device *dev) {}
105−static inline blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
106− enum req_opf op, sector_t sector,
107− sector_t nr_sectors)
110+static inline int null_register_zoned_dev(struct nullb *nullb)
111+{
112+ return -ENODEV;
113+}
114+static inline void null_free_zoned_dev(struct nullb_device *dev) {}
115+static inline blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd,
116+ enum req_opf op, sector_t sector, sector_t nr_sectors)
108117 {
109118 return BLK_STS_NOTSUPP;
110119 }
drivers/block/null_blk_main.c+31−31
@@ -580,7 +580,7 @@ static void null_free_dev(struct nullb_device *dev) · 579 unmodified lines
580580 if (!dev)
581581 return;
582582
583− null_zone_exit(dev);
583+ null_free_zoned_dev(dev);
584584 badblocks_exit(&dev->badblocks);
585585 kfree(dev);
586586 }
@@ -1276,6 +1276,25 @@ static inline void nullb_complete_cmd(struct nullb_cmd *cmd) · 689 unmodified lines
12761276 }
12771277 }
12781278
1279+blk_status_t null_process_cmd(struct nullb_cmd *cmd,
1280+ enum req_opf op, sector_t sector,
1281+ unsigned int nr_sectors)
1282+{
1283+ struct nullb_device *dev = cmd->nq->dev;
1284+ blk_status_t ret;
1285+
1286+ if (dev->badblocks.shift != -1) {
1287+ ret = null_handle_badblocks(cmd, sector, nr_sectors);
1288+ if (ret != BLK_STS_OK)
1289+ return ret;
1290+ }
1291+
1292+ if (dev->memory_backed)
1293+ return null_handle_memory_backed(cmd, op);
1294+
1295+ return BLK_STS_OK;
1296+}
1297+
12791298 static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector,
12801299 sector_t nr_sectors, enum req_opf op)
12811300 {
@@ -1294,17 +1313,11 @@ static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector, · 12 unmodified lines
12941313 goto out;
12951314 }
12961315
1297− if (nullb->dev->badblocks.shift != -1) {
1298− cmd->error = null_handle_badblocks(cmd, sector, nr_sectors);
1299− if (cmd->error != BLK_STS_OK)
1300− goto out;
1301− }
1302−
1303− if (dev->memory_backed)
1304− cmd->error = null_handle_memory_backed(cmd, op);
1305−
1306− if (!cmd->error && dev->zoned)
1307− cmd->error = null_handle_zoned(cmd, op, sector, nr_sectors);
1316+ if (dev->zoned)
1317+ cmd->error = null_process_zoned_cmd(cmd, op,
1318+ sector, nr_sectors);
1319+ else
1320+ cmd->error = null_process_cmd(cmd, op, sector, nr_sectors);
13081321
13091322 out:
13101323 nullb_complete_cmd(cmd);
@@ -1605,19 +1618,12 @@ static int null_gendisk_register(struct nullb *nullb) · 294 unmodified lines
16051618 disk->queue = nullb->q;
16061619 strncpy(disk->disk_name, nullb->disk_name, DISK_NAME_LEN);
16071620
1608−#ifdef CONFIG_BLK_DEV_ZONED
16091621 if (nullb->dev->zoned) {
1610− if (queue_is_mq(nullb->q)) {
1611− int ret = blk_revalidate_disk_zones(disk);
1612− if (ret)
1613− return ret;
1614− } else {
1615− blk_queue_chunk_sectors(nullb->q,
1616− nullb->dev->zone_size_sects);
1617− nullb->q->nr_zones = blkdev_nr_zones(disk);
1618− }
1622+ int ret = null_register_zoned_dev(nullb);
1623+
1624+ if (ret)
1625+ return ret;
16191626 }
1620−#endif
16211627
16221628 add_disk(disk);
16231629 return 0;
@@ -1773,14 +1779,9 @@ static int null_add_dev(struct nullb_device *dev) · 149 unmodified lines
17731779 }
17741780
17751781 if (dev->zoned) {
1776− rv = null_zone_init(dev);
1782+ rv = null_init_zoned_dev(dev, nullb->q);
17771783 if (rv)
17781784 goto out_cleanup_blk_queue;
1779−
1780− nullb->q->limits.zoned = BLK_ZONED_HM;
1781− blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, nullb->q);
1782− blk_queue_required_elevator_features(nullb->q,
1783− ELEVATOR_F_ZBD_SEQ_WRITE);
17841785 }
17851786
17861787 nullb->q->queuedata = nullb;
@@ -1809,8 +1810,7 @@ static int null_add_dev(struct nullb_device *dev) · 22 unmodified lines
18091810
18101811 return 0;
18111812 out_cleanup_zone:
1812− if (dev->zoned)
1813− null_zone_exit(dev);
1813+ null_free_zoned_dev(dev);
18141814 out_cleanup_blk_queue:
18151815 blk_cleanup_queue(nullb->q);
18161816 out_cleanup_tags:
drivers/block/null_blk_zoned.c+33−12
@@ -13,7 +13,7 @@ static inline unsigned int null_zone_no(struct nullb_device *dev, sector_t sect) · 12 unmodified lines
1313 return sect >> ilog2(dev->zone_size_sects);
1414 }
1515
16−int null_zone_init(struct nullb_device *dev)
16+int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q)
1717 {
1818 sector_t dev_size = (sector_t)dev->size * 1024 * 1024;
1919 sector_t sector = 0;
@@ -61,10 +61,27 @@ int null_zone_init(struct nullb_device *dev) · 41 unmodified lines
6161 sector += dev->zone_size_sects;
6262 }
6363
64+ q->limits.zoned = BLK_ZONED_HM;
65+ blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
66+ blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE);
67+
68+ return 0;
69+}
70+
71+int null_register_zoned_dev(struct nullb *nullb)
72+{
73+ struct request_queue *q = nullb->q;
74+
75+ if (queue_is_mq(q))
76+ return blk_revalidate_disk_zones(nullb->disk);
77+
78+ blk_queue_chunk_sectors(q, nullb->dev->zone_size_sects);
79+ q->nr_zones = blkdev_nr_zones(nullb->disk);
80+
6481 return 0;
6582 }
6683
67−void null_zone_exit(struct nullb_device *dev)
84+void null_free_zoned_dev(struct nullb_device *dev)
6885 {
6986 kvfree(dev->zones);
7087 }
@@ -126,11 +143,16 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector, · 55 unmodified lines
126143 struct nullb_device *dev = cmd->nq->dev;
127144 unsigned int zno = null_zone_no(dev, sector);
128145 struct blk_zone *zone = &dev->zones[zno];
146+ blk_status_t ret;
147+
148+ trace_nullb_zone_op(cmd, zno, zone->cond);
149+
150+ if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL)
151+ return null_process_cmd(cmd, REQ_OP_WRITE, sector, nr_sectors);
129152
130153 switch (zone->cond) {
131154 case BLK_ZONE_COND_FULL:
132155 /* Cannot write to a full zone */
133− cmd->error = BLK_STS_IOERR;
134156 return BLK_STS_IOERR;
135157 case BLK_ZONE_COND_EMPTY:
136158 case BLK_ZONE_COND_IMP_OPEN:
@@ -143,19 +165,18 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector, · 6 unmodified lines
143165 if (zone->cond != BLK_ZONE_COND_EXP_OPEN)
144166 zone->cond = BLK_ZONE_COND_IMP_OPEN;
145167
168+ ret = null_process_cmd(cmd, REQ_OP_WRITE, sector, nr_sectors);
169+ if (ret != BLK_STS_OK)
170+ return ret;
171+
146172 zone->wp += nr_sectors;
147173 if (zone->wp == zone->start + zone->len)
148174 zone->cond = BLK_ZONE_COND_FULL;
149− break;
150− case BLK_ZONE_COND_NOT_WP:
151− break;
175+ return BLK_STS_OK;
152176 default:
153177 /* Invalid zone condition */
154178 return BLK_STS_IOERR;
155179 }
156−
157− trace_nullb_zone_op(cmd, zno, zone->cond);
158− return BLK_STS_OK;
159180 }
160181
161182 static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
@@ -216,8 +237,8 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op, · 54 unmodified lines
216237 return BLK_STS_OK;
217238 }
218239
219−blk_status_t null_handle_zoned(struct nullb_cmd *cmd, enum req_opf op,
220− sector_t sector, sector_t nr_sectors)
240+blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd, enum req_opf op,
241+ sector_t sector, sector_t nr_sectors)
221242 {
222243 switch (op) {
223244 case REQ_OP_WRITE:
@@ -229,6 +250,6 @@ blk_status_t null_handle_zoned(struct nullb_cmd *cmd, enum req_opf op, · 5 unmodified lines
229250 case REQ_OP_ZONE_FINISH:
230251 return null_zone_mgmt(cmd, op, sector);
231252 default:
232− return BLK_STS_OK;
253+ return null_process_cmd(cmd, op, sector, nr_sectors);
233254 }
234255 }
drivers/block/virtio_blk.c+79−8
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/blk-mq.h>
1616 #include <linux/blk-mq-virtio.h>
1717 #include <linux/numa.h>
18+#include <uapi/linux/virtio_ring.h>
1819
1920 #define PART_BITS 4
2021 #define VQ_NAME_LEN 16
@@ -32,6 +33,15 @@ struct virtio_blk_vq { · 11 unmodified lines
3233 } ____cacheline_aligned_in_smp;
3334
3435 struct virtio_blk {
36+ /*
37+ * This mutex must be held by anything that may run after
38+ * virtblk_remove() sets vblk->vdev to NULL.
39+ *
40+ * blk-mq, virtqueue processing, and sysfs attribute code paths are
41+ * shut down before vblk->vdev is set to NULL and therefore do not need
42+ * to hold this mutex.
43+ */
44+ struct mutex vdev_mutex;
3545 struct virtio_device *vdev;
3646
3747 /* The disk structure for the kernel. */
@@ -43,6 +53,13 @@ struct virtio_blk { · 5 unmodified lines
4353 /* Process context for config space updates */
4454 struct work_struct config_work;
4555
56+ /*
57+ * Tracks references from block_device_operations open/release and
58+ * virtio_driver probe/remove so this object can be freed once no
59+ * longer in use.
60+ */
61+ refcount_t refs;
62+
4663 /* What host tells us, plus 2 for header & tailer. */
4764 unsigned int sg_elems;
4865
@@ -294,10 +311,55 @@ out: · 245 unmodified lines
294311 return err;
295312 }
296313
314+static void virtblk_get(struct virtio_blk *vblk)
315+{
316+ refcount_inc(&vblk->refs);
317+}
318+
319+static void virtblk_put(struct virtio_blk *vblk)
320+{
321+ if (refcount_dec_and_test(&vblk->refs)) {
322+ ida_simple_remove(&vd_index_ida, vblk->index);
323+ mutex_destroy(&vblk->vdev_mutex);
324+ kfree(vblk);
325+ }
326+}
327+
328+static int virtblk_open(struct block_device *bd, fmode_t mode)
329+{
330+ struct virtio_blk *vblk = bd->bd_disk->private_data;
331+ int ret = 0;
332+
333+ mutex_lock(&vblk->vdev_mutex);
334+
335+ if (vblk->vdev)
336+ virtblk_get(vblk);
337+ else
338+ ret = -ENXIO;
339+
340+ mutex_unlock(&vblk->vdev_mutex);
341+ return ret;
342+}
343+
344+static void virtblk_release(struct gendisk *disk, fmode_t mode)
345+{
346+ struct virtio_blk *vblk = disk->private_data;
347+
348+ virtblk_put(vblk);
349+}
350+
297351 /* We provide getgeo only to please some old bootloader/partitioning tools */
298352 static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
299353 {
300354 struct virtio_blk *vblk = bd->bd_disk->private_data;
355+ int ret = 0;
356+
357+ mutex_lock(&vblk->vdev_mutex);
358+
359+ if (!vblk->vdev) {
360+ ret = -ENXIO;
361+ goto out;
362+ }
301363
302364 /* see if the host passed in geometry config */
303365 if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) {
@@ -313,11 +375,15 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo) · 9 unmodified lines
313375 geo->sectors = 1 << 5;
314376 geo->cylinders = get_capacity(bd->bd_disk) >> 11;
315377 }
316− return 0;
378+out:
379+ mutex_unlock(&vblk->vdev_mutex);
380+ return ret;
317381 }
318382
319383 static const struct block_device_operations virtblk_fops = {
320384 .owner = THIS_MODULE,
385+ .open = virtblk_open,
386+ .release = virtblk_release,
321387 .getgeo = virtblk_getgeo,
322388 };
323389
@@ -654,6 +720,10 @@ static int virtblk_probe(struct virtio_device *vdev) · 330 unmodified lines
654720 goto out_free_index;
655721 }
656722
723+ /* This reference is dropped in virtblk_remove(). */
724+ refcount_set(&vblk->refs, 1);
725+ mutex_init(&vblk->vdev_mutex);
726+
657727 vblk->vdev = vdev;
658728 vblk->sg_elems = sg_elems;
659729
@@ -819,8 +889,6 @@ out: · 159 unmodified lines
819889 static void virtblk_remove(struct virtio_device *vdev)
820890 {
821891 struct virtio_blk *vblk = vdev->priv;
822− int index = vblk->index;
823− int refc;
824892
825893 /* Make sure no work handler is accessing the device. */
826894 flush_work(&vblk->config_work);
@@ -830,18 +898,21 @@ static void virtblk_remove(struct virtio_device *vdev) · 3 unmodified lines
830898
831899 blk_mq_free_tag_set(&vblk->tag_set);
832900
901+ mutex_lock(&vblk->vdev_mutex);
902+
833903 /* Stop all the virtqueues. */
834904 vdev->config->reset(vdev);
835905
836− refc = kref_read(&disk_to_dev(vblk->disk)->kobj.kref);
906+ /* Virtqueues are stopped, nothing can use vblk->vdev anymore. */
907+ vblk->vdev = NULL;
908+
837909 put_disk(vblk->disk);
838910 vdev->config->del_vqs(vdev);
839911 kfree(vblk->vqs);
840− kfree(vblk);
841912
842− /* Only free device id if we don't have any users */
843− if (refc == 1)
844− ida_simple_remove(&vd_index_ida, index);
913+ mutex_unlock(&vblk->vdev_mutex);
914+
915+ virtblk_put(vblk);
845916 }
846917
847918 #ifdef CONFIG_PM_SLEEP
drivers/bus/mhi/core/init.c+3−4
@@ -812,10 +812,9 @@ int mhi_register_controller(struct mhi_controller *mhi_cntrl, · 811 unmodified lines
812812 if (!mhi_cntrl)
813813 return -EINVAL;
814814
815− if (!mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put)
816− return -EINVAL;
817−
818− if (!mhi_cntrl->status_cb || !mhi_cntrl->link_status)
815+ if (!mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put ||
816+ !mhi_cntrl->status_cb || !mhi_cntrl->read_reg ||
817+ !mhi_cntrl->write_reg)
819818 return -EINVAL;
820819
821820 ret = parse_config(mhi_cntrl, config);
drivers/bus/mhi/core/internal.h+0−3
@@ -11,9 +11,6 @@ · 10 unmodified lines
1111
1212 extern struct bus_type mhi_bus_type;
1313
14−/* MHI MMIO register mapping */
15−#define PCI_INVALID_READ(val) (val == U32_MAX)
16−
1714 #define MHIREGLEN (0x0)
1815 #define MHIREGLEN_MHIREGLEN_MASK (0xFFFFFFFF)
1916 #define MHIREGLEN_MHIREGLEN_SHIFT (0)
drivers/bus/mhi/core/main.c+5−13
@@ -18,16 +18,7 @@ · 17 unmodified lines
1818 int __must_check mhi_read_reg(struct mhi_controller *mhi_cntrl,
1919 void __iomem *base, u32 offset, u32 *out)
2020 {
21− u32 tmp = readl(base + offset);
22−
23− /* If there is any unexpected value, query the link status */
24− if (PCI_INVALID_READ(tmp) &&
25− mhi_cntrl->link_status(mhi_cntrl))
26− return -EIO;
27−
28− *out = tmp;
29−
30− return 0;
21+ return mhi_cntrl->read_reg(mhi_cntrl, base + offset, out);
3122 }
3223
3324 int __must_check mhi_read_reg_field(struct mhi_controller *mhi_cntrl,
@@ -49,7 +40,7 @@ int __must_check mhi_read_reg_field(struct mhi_controller *mhi_cntrl, · 15 unmodified lines
4940 void mhi_write_reg(struct mhi_controller *mhi_cntrl, void __iomem *base,
5041 u32 offset, u32 val)
5142 {
52− writel(val, base + offset);
43+ mhi_cntrl->write_reg(mhi_cntrl, base + offset, val);
5344 }
5445
5546 void mhi_write_reg_field(struct mhi_controller *mhi_cntrl, void __iomem *base,
@@ -294,7 +285,7 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) · 238 unmodified lines
294285 !(mhi_chan->ee_mask & BIT(mhi_cntrl->ee)))
295286 continue;
296287 mhi_dev = mhi_alloc_device(mhi_cntrl);
297− if (!mhi_dev)
288+ if (IS_ERR(mhi_dev))
298289 return;
299290
300291 mhi_dev->dev_type = MHI_DEVICE_XFER;
@@ -336,7 +327,8 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) · 35 unmodified lines
336327
337328 /* Channel name is same for both UL and DL */
338329 mhi_dev->chan_name = mhi_chan->name;
339− dev_set_name(&mhi_dev->dev, "%04x_%s", mhi_chan->chan,
330+ dev_set_name(&mhi_dev->dev, "%s_%s",
331+ dev_name(mhi_cntrl->cntrl_dev),
340332 mhi_dev->chan_name);
341333
342334 /* Init wakeup source if available */
drivers/bus/mhi/core/pm.c+5−1
@@ -902,7 +902,11 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntrl) · 901 unmodified lines
902902 MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state),
903903 msecs_to_jiffies(mhi_cntrl->timeout_ms));
904904
905− return (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -EIO;
905+ ret = (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -ETIMEDOUT;
906+ if (ret)
907+ mhi_power_down(mhi_cntrl, false);
908+
909+ return ret;
906910 }
907911 EXPORT_SYMBOL(mhi_sync_power_up);
908912
drivers/char/hw_random/virtio-rng.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/virtio.h>
1212 #include <linux/virtio_rng.h>
1313 #include <linux/module.h>
14+#include <linux/slab.h>
1415
1516 static DEFINE_IDA(rng_index_ida);
1617
drivers/char/tpm/tpm-interface.c+1−1
@@ -323,7 +323,7 @@ int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx, · 322 unmodified lines
323323
324324 for (i = 0; i < chip->nr_allocated_banks; i++) {
325325 if (digests[i].alg_id != chip->allocated_banks[i].alg_id) {
326− rc = EINVAL;
326+ rc = -EINVAL;
327327 goto out;
328328 }
329329 }
drivers/char/tpm/tpm2-cmd.c+1−0
@@ -681,6 +681,7 @@ out: · 680 unmodified lines
681681 rc = -ENODEV;
682682 return rc;
683683 }
684+EXPORT_SYMBOL_GPL(tpm2_get_cc_attrs_tbl);
684685
685686 /**
686687 * tpm2_startup - turn on the TPM
drivers/char/tpm/tpm_ibmvtpm.c+73−63
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
3− * Copyright (C) 2012 IBM Corporation
3+ * Copyright (C) 2012-2020 IBM Corporation
44 *
55 * Author: Ashley Lai <ashleydlai@gmail.com>
66 *
@@ -134,6 +134,64 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) · 127 unmodified lines
134134 return len;
135135 }
136136
137+/**
138+ * ibmvtpm_crq_send_init - Send a CRQ initialize message
139+ * @ibmvtpm: vtpm device struct
140+ *
141+ * Return:
142+ * 0 on success.
143+ * Non-zero on failure.
144+ */
145+static int ibmvtpm_crq_send_init(struct ibmvtpm_dev *ibmvtpm)
146+{
147+ int rc;
148+
149+ rc = ibmvtpm_send_crq_word(ibmvtpm->vdev, INIT_CRQ_CMD);
150+ if (rc != H_SUCCESS)
151+ dev_err(ibmvtpm->dev,
152+ "%s failed rc=%d\n", __func__, rc);
153+
154+ return rc;
155+}
156+
157+/**
158+ * tpm_ibmvtpm_resume - Resume from suspend
159+ *
160+ * @dev: device struct
161+ *
162+ * Return: Always 0.
163+ */
164+static int tpm_ibmvtpm_resume(struct device *dev)
165+{
166+ struct tpm_chip *chip = dev_get_drvdata(dev);
167+ struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
168+ int rc = 0;
169+
170+ do {
171+ if (rc)
172+ msleep(100);
173+ rc = plpar_hcall_norets(H_ENABLE_CRQ,
174+ ibmvtpm->vdev->unit_address);
175+ } while (rc == H_IN_PROGRESS || rc == H_BUSY || H_IS_LONG_BUSY(rc));
176+
177+ if (rc) {
178+ dev_err(dev, "Error enabling ibmvtpm rc=%d\n", rc);
179+ return rc;
180+ }
181+
182+ rc = vio_enable_interrupts(ibmvtpm->vdev);
183+ if (rc) {
184+ dev_err(dev, "Error vio_enable_interrupts rc=%d\n", rc);
185+ return rc;
186+ }
187+
188+ rc = ibmvtpm_crq_send_init(ibmvtpm);
189+ if (rc)
190+ dev_err(dev, "Error send_init rc=%d\n", rc);
191+
192+ return rc;
193+}
194+
137195 /**
138196 * tpm_ibmvtpm_send() - Send a TPM command
139197 * @chip: tpm chip struct
@@ -147,6 +205,7 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) · 7 unmodified lines
147205 static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
148206 {
149207 struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
208+ bool retry = true;
150209 int rc, sig;
151210
152211 if (!ibmvtpm->rtce_buf) {
@@ -180,18 +239,27 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count) · 27 unmodified lines
180239 */
181240 ibmvtpm->tpm_processing_cmd = true;
182241
242+again:
183243 rc = ibmvtpm_send_crq(ibmvtpm->vdev,
184244 IBMVTPM_VALID_CMD, VTPM_TPM_COMMAND,
185245 count, ibmvtpm->rtce_dma_handle);
186246 if (rc != H_SUCCESS) {
247+ /*
248+ * H_CLOSED can be returned after LPM resume. Call
249+ * tpm_ibmvtpm_resume() to re-enable the CRQ then retry
250+ * ibmvtpm_send_crq() once before failing.
251+ */
252+ if (rc == H_CLOSED && retry) {
253+ tpm_ibmvtpm_resume(ibmvtpm->dev);
254+ retry = false;
255+ goto again;
256+ }
187257 dev_err(ibmvtpm->dev, "tpm_ibmvtpm_send failed rc=%d\n", rc);
188− rc = 0;
189258 ibmvtpm->tpm_processing_cmd = false;
190− } else
191− rc = 0;
259+ }
192260
193261 spin_unlock(&ibmvtpm->rtce_lock);
194− return rc;
262+ return 0;
195263 }
196264
197265 static void tpm_ibmvtpm_cancel(struct tpm_chip *chip)
@@ -269,26 +337,6 @@ static int ibmvtpm_crq_send_init_complete(struct ibmvtpm_dev *ibmvtpm) · 71 unmodified lines
269337 return rc;
270338 }
271339
272−/**
273− * ibmvtpm_crq_send_init - Send a CRQ initialize message
274− * @ibmvtpm: vtpm device struct
275− *
276− * Return:
277− * 0 on success.
278− * Non-zero on failure.
279− */
280−static int ibmvtpm_crq_send_init(struct ibmvtpm_dev *ibmvtpm)
281−{
282− int rc;
283−
284− rc = ibmvtpm_send_crq_word(ibmvtpm->vdev, INIT_CRQ_CMD);
285− if (rc != H_SUCCESS)
286− dev_err(ibmvtpm->dev,
287− "ibmvtpm_crq_send_init failed rc=%d\n", rc);
288−
289− return rc;
290−}
291−
292340 /**
293341 * tpm_ibmvtpm_remove - ibm vtpm remove entry point
294342 * @vdev: vio device struct
@@ -401,44 +449,6 @@ static int ibmvtpm_reset_crq(struct ibmvtpm_dev *ibmvtpm) · 106 unmodified lines
401449 ibmvtpm->crq_dma_handle, CRQ_RES_BUF_SIZE);
402450 }
403451
404−/**
405− * tpm_ibmvtpm_resume - Resume from suspend
406− *
407− * @dev: device struct
408− *
409− * Return: Always 0.
410− */
411−static int tpm_ibmvtpm_resume(struct device *dev)
412−{
413− struct tpm_chip *chip = dev_get_drvdata(dev);
414− struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
415− int rc = 0;
416−
417− do {
418− if (rc)
419− msleep(100);
420− rc = plpar_hcall_norets(H_ENABLE_CRQ,
421− ibmvtpm->vdev->unit_address);
422− } while (rc == H_IN_PROGRESS || rc == H_BUSY || H_IS_LONG_BUSY(rc));
423−
424− if (rc) {
425− dev_err(dev, "Error enabling ibmvtpm rc=%d\n", rc);
426− return rc;
427− }
428−
429− rc = vio_enable_interrupts(ibmvtpm->vdev);
430− if (rc) {
431− dev_err(dev, "Error vio_enable_interrupts rc=%d\n", rc);
432− return rc;
433− }
434−
435− rc = ibmvtpm_crq_send_init(ibmvtpm);
436− if (rc)
437− dev_err(dev, "Error send_init rc=%d\n", rc);
438−
439− return rc;
440−}
441−
442452 static bool tpm_ibmvtpm_req_canceled(struct tpm_chip *chip, u8 status)
443453 {
444454 return (status == 0);
drivers/char/tpm/tpm_tis_core.c+7−1
@@ -433,6 +433,9 @@ static void disable_interrupts(struct tpm_chip *chip) · 432 unmodified lines
433433 u32 intmask;
434434 int rc;
435435
436+ if (priv->irq == 0)
437+ return;
438+
436439 rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
437440 if (rc < 0)
438441 intmask = 0;
@@ -1062,9 +1065,12 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, · 623 unmodified lines
10621065 if (irq) {
10631066 tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
10641067 irq);
1065− if (!(chip->flags & TPM_CHIP_FLAG_IRQ))
1068+ if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
10661069 dev_err(&chip->dev, FW_BUG
10671070 "TPM interrupt not working, polling instead\n");
1071+
1072+ disable_interrupts(chip);
1073+ }
10681074 } else {
10691075 tpm_tis_probe_irq(chip, intmask);
10701076 }
drivers/counter/104-quad-8.c+160−34
@@ -44,6 +44,7 @@ MODULE_PARM_DESC(base, "ACCES 104-QUAD-8 base addresses"); · 43 unmodified lines
4444 * @base: base port address of the IIO device
4545 */
4646 struct quad8_iio {
47+ struct mutex lock;
4748 struct counter_device counter;
4849 unsigned int fck_prescaler[QUAD8_NUM_COUNTERS];
4950 unsigned int preset[QUAD8_NUM_COUNTERS];
@@ -123,6 +124,8 @@ static int quad8_read_raw(struct iio_dev *indio_dev, · 73 unmodified lines
123124 /* Borrow XOR Carry effectively doubles count range */
124125 *val = (borrow ^ carry) << 24;
125126
127+ mutex_lock(&priv->lock);
128+
126129 /* Reset Byte Pointer; transfer Counter to Output Latch */
127130 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP | QUAD8_RLD_CNTR_OUT,
128131 base_offset + 1);
@@ -130,6 +133,8 @@ static int quad8_read_raw(struct iio_dev *indio_dev, · 1 unmodified line
130133 for (i = 0; i < 3; i++)
131134 *val |= (unsigned int)inb(base_offset) << (8 * i);
132135
136+ mutex_unlock(&priv->lock);
137+
133138 return IIO_VAL_INT;
134139 case IIO_CHAN_INFO_ENABLE:
135140 *val = priv->ab_enable[chan->channel];
@@ -160,6 +165,8 @@ static int quad8_write_raw(struct iio_dev *indio_dev, · 24 unmodified lines
160165 if ((unsigned int)val > 0xFFFFFF)
161166 return -EINVAL;
162167
168+ mutex_lock(&priv->lock);
169+
163170 /* Reset Byte Pointer */
164171 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP, base_offset + 1);
165172
@@ -183,12 +190,16 @@ static int quad8_write_raw(struct iio_dev *indio_dev, · 17 unmodified lines
183190 /* Reset Error flag */
184191 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_E, base_offset + 1);
185192
193+ mutex_unlock(&priv->lock);
194+
186195 return 0;
187196 case IIO_CHAN_INFO_ENABLE:
188197 /* only boolean values accepted */
189198 if (val < 0 || val > 1)
190199 return -EINVAL;
191200
201+ mutex_lock(&priv->lock);
202+
192203 priv->ab_enable[chan->channel] = val;
193204
194205 ior_cfg = val | priv->preset_enable[chan->channel] << 1;
@@ -196,11 +207,18 @@ static int quad8_write_raw(struct iio_dev *indio_dev, · 1 unmodified line
196207 /* Load I/O control configuration */
197208 outb(QUAD8_CTR_IOR | ior_cfg, base_offset + 1);
198209
210+ mutex_unlock(&priv->lock);
211+
199212 return 0;
200213 case IIO_CHAN_INFO_SCALE:
214+ mutex_lock(&priv->lock);
215+
201216 /* Quadrature scaling only available in quadrature mode */
202− if (!priv->quadrature_mode[chan->channel] && (val2 || val != 1))
217+ if (!priv->quadrature_mode[chan->channel] &&
218+ (val2 || val != 1)) {
219+ mutex_unlock(&priv->lock);
203220 return -EINVAL;
221+ }
204222
205223 /* Only three gain states (1, 0.5, 0.25) */
206224 if (val == 1 && !val2)
@@ -214,11 +232,15 @@ static int quad8_write_raw(struct iio_dev *indio_dev, · 7 unmodified lines
214232 priv->quadrature_scale[chan->channel] = 2;
215233 break;
216234 default:
235+ mutex_unlock(&priv->lock);
217236 return -EINVAL;
218237 }
219− else
238+ else {
239+ mutex_unlock(&priv->lock);
220240 return -EINVAL;
241+ }
221242
243+ mutex_unlock(&priv->lock);
222244 return 0;
223245 }
224246
@@ -255,6 +277,8 @@ static ssize_t quad8_write_preset(struct iio_dev *indio_dev, uintptr_t private, · 30 unmodified lines
255277 if (preset > 0xFFFFFF)
256278 return -EINVAL;
257279
280+ mutex_lock(&priv->lock);
281+
258282 priv->preset[chan->channel] = preset;
259283
260284 /* Reset Byte Pointer */
@@ -264,6 +288,8 @@ static ssize_t quad8_write_preset(struct iio_dev *indio_dev, uintptr_t private, · 3 unmodified lines
264288 for (i = 0; i < 3; i++)
265289 outb(preset >> (8 * i), base_offset);
266290
291+ mutex_unlock(&priv->lock);
292+
267293 return len;
268294 }
269295
@@ -293,6 +319,8 @@ static ssize_t quad8_write_set_to_preset_on_index(struct iio_dev *indio_dev, · 23 unmodified lines
293319 /* Preset enable is active low in Input/Output Control register */
294320 preset_enable = !preset_enable;
295321
322+ mutex_lock(&priv->lock);
323+
296324 priv->preset_enable[chan->channel] = preset_enable;
297325
298326 ior_cfg = priv->ab_enable[chan->channel] |
@@ -301,6 +329,8 @@ static ssize_t quad8_write_set_to_preset_on_index(struct iio_dev *indio_dev, · 2 unmodified lines
301329 /* Load I/O control configuration to Input / Output Control Register */
302330 outb(QUAD8_CTR_IOR | ior_cfg, base_offset);
303331
332+ mutex_unlock(&priv->lock);
333+
304334 return len;
305335 }
306336
@@ -358,6 +388,8 @@ static int quad8_set_count_mode(struct iio_dev *indio_dev, · 51 unmodified lines
358388 unsigned int mode_cfg = cnt_mode << 1;
359389 const int base_offset = priv->base + 2 * chan->channel + 1;
360390
391+ mutex_lock(&priv->lock);
392+
361393 priv->count_mode[chan->channel] = cnt_mode;
362394
363395 /* Add quadrature mode configuration */
@@ -367,6 +399,8 @@ static int quad8_set_count_mode(struct iio_dev *indio_dev, · 3 unmodified lines
367399 /* Load mode configuration to Counter Mode Register */
368400 outb(QUAD8_CTR_CMR | mode_cfg, base_offset);
369401
402+ mutex_unlock(&priv->lock);
403+
370404 return 0;
371405 }
372406
@@ -394,19 +428,26 @@ static int quad8_set_synchronous_mode(struct iio_dev *indio_dev, · 21 unmodified lines
394428 const struct iio_chan_spec *chan, unsigned int synchronous_mode)
395429 {
396430 struct quad8_iio *const priv = iio_priv(indio_dev);
397− const unsigned int idr_cfg = synchronous_mode |
398− priv->index_polarity[chan->channel] << 1;
399431 const int base_offset = priv->base + 2 * chan->channel + 1;
432+ unsigned int idr_cfg = synchronous_mode;
433+
434+ mutex_lock(&priv->lock);
435+
436+ idr_cfg |= priv->index_polarity[chan->channel] << 1;
400437
401438 /* Index function must be non-synchronous in non-quadrature mode */
402− if (synchronous_mode && !priv->quadrature_mode[chan->channel])
439+ if (synchronous_mode && !priv->quadrature_mode[chan->channel]) {
440+ mutex_unlock(&priv->lock);
403441 return -EINVAL;
442+ }
404443
405444 priv->synchronous_mode[chan->channel] = synchronous_mode;
406445
407446 /* Load Index Control configuration to Index Control Register */
408447 outb(QUAD8_CTR_IDR | idr_cfg, base_offset);
409448
449+ mutex_unlock(&priv->lock);
450+
410451 return 0;
411452 }
412453
@@ -434,8 +475,12 @@ static int quad8_set_quadrature_mode(struct iio_dev *indio_dev, · 21 unmodified lines
434475 const struct iio_chan_spec *chan, unsigned int quadrature_mode)
435476 {
436477 struct quad8_iio *const priv = iio_priv(indio_dev);
437− unsigned int mode_cfg = priv->count_mode[chan->channel] << 1;
438478 const int base_offset = priv->base + 2 * chan->channel + 1;
479+ unsigned int mode_cfg;
480+
481+ mutex_lock(&priv->lock);
482+
483+ mode_cfg = priv->count_mode[chan->channel] << 1;
439484
440485 if (quadrature_mode)
441486 mode_cfg |= (priv->quadrature_scale[chan->channel] + 1) << 3;
@@ -453,6 +498,8 @@ static int quad8_set_quadrature_mode(struct iio_dev *indio_dev, · 11 unmodified lines
453498 /* Load mode configuration to Counter Mode Register */
454499 outb(QUAD8_CTR_CMR | mode_cfg, base_offset);
455500
501+ mutex_unlock(&priv->lock);
502+
456503 return 0;
457504 }
458505
@@ -480,15 +527,20 @@ static int quad8_set_index_polarity(struct iio_dev *indio_dev, · 21 unmodified lines
480527 const struct iio_chan_spec *chan, unsigned int index_polarity)
481528 {
482529 struct quad8_iio *const priv = iio_priv(indio_dev);
483− const unsigned int idr_cfg = priv->synchronous_mode[chan->channel] |
484− index_polarity << 1;
485530 const int base_offset = priv->base + 2 * chan->channel + 1;
531+ unsigned int idr_cfg = index_polarity << 1;
532+
533+ mutex_lock(&priv->lock);
534+
535+ idr_cfg |= priv->synchronous_mode[chan->channel];
486536
487537 priv->index_polarity[chan->channel] = index_polarity;
488538
489539 /* Load Index Control configuration to Index Control Register */
490540 outb(QUAD8_CTR_IDR | idr_cfg, base_offset);
491541
542+ mutex_unlock(&priv->lock);
543+
492544 return 0;
493545 }
494546
@@ -589,7 +641,7 @@ static int quad8_signal_read(struct counter_device *counter, · 94 unmodified lines
589641 static int quad8_count_read(struct counter_device *counter,
590642 struct counter_count *count, unsigned long *val)
591643 {
592− const struct quad8_iio *const priv = counter->priv;
644+ struct quad8_iio *const priv = counter->priv;
593645 const int base_offset = priv->base + 2 * count->id;
594646 unsigned int flags;
595647 unsigned int borrow;
@@ -603,6 +655,8 @@ static int quad8_count_read(struct counter_device *counter, · 7 unmodified lines
603655 /* Borrow XOR Carry effectively doubles count range */
604656 *val = (unsigned long)(borrow ^ carry) << 24;
605657
658+ mutex_lock(&priv->lock);
659+
606660 /* Reset Byte Pointer; transfer Counter to Output Latch */
607661 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP | QUAD8_RLD_CNTR_OUT,
608662 base_offset + 1);
@@ -610,13 +664,15 @@ static int quad8_count_read(struct counter_device *counter, · 1 unmodified line
610664 for (i = 0; i < 3; i++)
611665 *val |= (unsigned long)inb(base_offset) << (8 * i);
612666
667+ mutex_unlock(&priv->lock);
668+
613669 return 0;
614670 }
615671
616672 static int quad8_count_write(struct counter_device *counter,
617673 struct counter_count *count, unsigned long val)
618674 {
619− const struct quad8_iio *const priv = counter->priv;
675+ struct quad8_iio *const priv = counter->priv;
620676 const int base_offset = priv->base + 2 * count->id;
621677 int i;
622678
@@ -624,6 +680,8 @@ static int quad8_count_write(struct counter_device *counter, · 1 unmodified line
624680 if (val > 0xFFFFFF)
625681 return -EINVAL;
626682
683+ mutex_lock(&priv->lock);
684+
627685 /* Reset Byte Pointer */
628686 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP, base_offset + 1);
629687
@@ -647,6 +705,8 @@ static int quad8_count_write(struct counter_device *counter, · 17 unmodified lines
647705 /* Reset Error flag */
648706 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_E, base_offset + 1);
649707
708+ mutex_unlock(&priv->lock);
709+
650710 return 0;
651711 }
652712
@@ -667,13 +727,13 @@ static enum counter_count_function quad8_count_functions_list[] = { · 14 unmodified lines
667727 static int quad8_function_get(struct counter_device *counter,
668728 struct counter_count *count, size_t *function)
669729 {
670− const struct quad8_iio *const priv = counter->priv;
730+ struct quad8_iio *const priv = counter->priv;
671731 const int id = count->id;
672− const unsigned int quadrature_mode = priv->quadrature_mode[id];
673− const unsigned int scale = priv->quadrature_scale[id];
674732
675− if (quadrature_mode)
676− switch (scale) {
733+ mutex_lock(&priv->lock);
734+
735+ if (priv->quadrature_mode[id])
736+ switch (priv->quadrature_scale[id]) {
677737 case 0:
678738 *function = QUAD8_COUNT_FUNCTION_QUADRATURE_X1;
679739 break;
@@ -687,6 +747,8 @@ static int quad8_function_get(struct counter_device *counter, · 7 unmodified lines
687747 else
688748 *function = QUAD8_COUNT_FUNCTION_PULSE_DIRECTION;
689749
750+ mutex_unlock(&priv->lock);
751+
690752 return 0;
691753 }
692754
@@ -697,10 +759,15 @@ static int quad8_function_set(struct counter_device *counter, · 4 unmodified lines
697759 const int id = count->id;
698760 unsigned int *const quadrature_mode = priv->quadrature_mode + id;
699761 unsigned int *const scale = priv->quadrature_scale + id;
700− unsigned int mode_cfg = priv->count_mode[id] << 1;
701762 unsigned int *const synchronous_mode = priv->synchronous_mode + id;
702− const unsigned int idr_cfg = priv->index_polarity[id] << 1;
703763 const int base_offset = priv->base + 2 * id + 1;
764+ unsigned int mode_cfg;
765+ unsigned int idr_cfg;
766+
767+ mutex_lock(&priv->lock);
768+
769+ mode_cfg = priv->count_mode[id] << 1;
770+ idr_cfg = priv->index_polarity[id] << 1;
704771
705772 if (function == QUAD8_COUNT_FUNCTION_PULSE_DIRECTION) {
706773 *quadrature_mode = 0;
@@ -736,6 +803,8 @@ static int quad8_function_set(struct counter_device *counter, · 29 unmodified lines
736803 /* Load mode configuration to Counter Mode Register */
737804 outb(QUAD8_CTR_CMR | mode_cfg, base_offset);
738805
806+ mutex_unlock(&priv->lock);
807+
739808 return 0;
740809 }
741810
@@ -852,15 +921,20 @@ static int quad8_index_polarity_set(struct counter_device *counter, · 110 unmodified lines
852921 {
853922 struct quad8_iio *const priv = counter->priv;
854923 const size_t channel_id = signal->id - 16;
855− const unsigned int idr_cfg = priv->synchronous_mode[channel_id] |
856− index_polarity << 1;
857924 const int base_offset = priv->base + 2 * channel_id + 1;
925+ unsigned int idr_cfg = index_polarity << 1;
926+
927+ mutex_lock(&priv->lock);
928+
929+ idr_cfg |= priv->synchronous_mode[channel_id];
858930
859931 priv->index_polarity[channel_id] = index_polarity;
860932
861933 /* Load Index Control configuration to Index Control Register */
862934 outb(QUAD8_CTR_IDR | idr_cfg, base_offset);
863935
936+ mutex_unlock(&priv->lock);
937+
864938 return 0;
865939 }
866940
@@ -887,19 +961,26 @@ static int quad8_synchronous_mode_set(struct counter_device *counter, · 20 unmodified lines
887961 {
888962 struct quad8_iio *const priv = counter->priv;
889963 const size_t channel_id = signal->id - 16;
890− const unsigned int idr_cfg = synchronous_mode |
891− priv->index_polarity[channel_id] << 1;
892964 const int base_offset = priv->base + 2 * channel_id + 1;
965+ unsigned int idr_cfg = synchronous_mode;
966+
967+ mutex_lock(&priv->lock);
968+
969+ idr_cfg |= priv->index_polarity[channel_id] << 1;
893970
894971 /* Index function must be non-synchronous in non-quadrature mode */
895− if (synchronous_mode && !priv->quadrature_mode[channel_id])
972+ if (synchronous_mode && !priv->quadrature_mode[channel_id]) {
973+ mutex_unlock(&priv->lock);
896974 return -EINVAL;
975+ }
897976
898977 priv->synchronous_mode[channel_id] = synchronous_mode;
899978
900979 /* Load Index Control configuration to Index Control Register */
901980 outb(QUAD8_CTR_IDR | idr_cfg, base_offset);
902981
982+ mutex_unlock(&priv->lock);
983+
903984 return 0;
904985 }
905986
@@ -964,6 +1045,8 @@ static int quad8_count_mode_set(struct counter_device *counter, · 58 unmodified lines
9641045 break;
9651046 }
9661047
1048+ mutex_lock(&priv->lock);
1049+
9671050 priv->count_mode[count->id] = cnt_mode;
9681051
9691052 /* Set count mode configuration value */
@@ -976,6 +1059,8 @@ static int quad8_count_mode_set(struct counter_device *counter, · 6 unmodified lines
9761059 /* Load mode configuration to Counter Mode Register */
9771060 outb(QUAD8_CTR_CMR | mode_cfg, base_offset);
9781061
1062+ mutex_unlock(&priv->lock);
1063+
9791064 return 0;
9801065 }
9811066
@@ -1017,6 +1102,8 @@ static ssize_t quad8_count_enable_write(struct counter_device *counter, · 35 unmodified lines
10171102 if (err)
10181103 return err;
10191104
1105+ mutex_lock(&priv->lock);
1106+
10201107 priv->ab_enable[count->id] = ab_enable;
10211108
10221109 ior_cfg = ab_enable | priv->preset_enable[count->id] << 1;
@@ -1024,6 +1111,8 @@ static ssize_t quad8_count_enable_write(struct counter_device *counter, · 1 unmodified line
10241111 /* Load I/O control configuration */
10251112 outb(QUAD8_CTR_IOR | ior_cfg, base_offset + 1);
10261113
1114+ mutex_unlock(&priv->lock);
1115+
10271116 return len;
10281117 }
10291118
@@ -1052,14 +1141,28 @@ static ssize_t quad8_count_preset_read(struct counter_device *counter, · 22 unmodified lines
10521141 return sprintf(buf, "%u\n", priv->preset[count->id]);
10531142 }
10541143
1144+static void quad8_preset_register_set(struct quad8_iio *quad8iio, int id,
1145+ unsigned int preset)
1146+{
1147+ const unsigned int base_offset = quad8iio->base + 2 * id;
1148+ int i;
1149+
1150+ quad8iio->preset[id] = preset;
1151+
1152+ /* Reset Byte Pointer */
1153+ outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP, base_offset + 1);
1154+
1155+ /* Set Preset Register */
1156+ for (i = 0; i < 3; i++)
1157+ outb(preset >> (8 * i), base_offset);
1158+}
1159+
10551160 static ssize_t quad8_count_preset_write(struct counter_device *counter,
10561161 struct counter_count *count, void *private, const char *buf, size_t len)
10571162 {
10581163 struct quad8_iio *const priv = counter->priv;
1059− const int base_offset = priv->base + 2 * count->id;
10601164 unsigned int preset;
10611165 int ret;
1062− int i;
10631166
10641167 ret = kstrtouint(buf, 0, &preset);
10651168 if (ret)
@@ -1069,14 +1172,11 @@ static ssize_t quad8_count_preset_write(struct counter_device *counter, · 3 unmodified lines
10691172 if (preset > 0xFFFFFF)
10701173 return -EINVAL;
10711174
1072− priv->preset[count->id] = preset;
1175+ mutex_lock(&priv->lock);
10731176
1074− /* Reset Byte Pointer */
1075− outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP, base_offset + 1);
1177+ quad8_preset_register_set(priv, count->id, preset);
10761178
1077− /* Set Preset Register */
1078− for (i = 0; i < 3; i++)
1079− outb(preset >> (8 * i), base_offset);
1179+ mutex_unlock(&priv->lock);
10801180
10811181 return len;
10821182 }
@@ -1084,15 +1184,20 @@ static ssize_t quad8_count_preset_write(struct counter_device *counter, · 1 unmodified line
10841184 static ssize_t quad8_count_ceiling_read(struct counter_device *counter,
10851185 struct counter_count *count, void *private, char *buf)
10861186 {
1087− const struct quad8_iio *const priv = counter->priv;
1187+ struct quad8_iio *const priv = counter->priv;
1188+
1189+ mutex_lock(&priv->lock);
10881190
10891191 /* Range Limit and Modulo-N count modes use preset value as ceiling */
10901192 switch (priv->count_mode[count->id]) {
10911193 case 1:
10921194 case 3:
1093− return quad8_count_preset_read(counter, count, private, buf);
1195+ mutex_unlock(&priv->lock);
1196+ return sprintf(buf, "%u\n", priv->preset[count->id]);
10941197 }
10951198
1199+ mutex_unlock(&priv->lock);
1200+
10961201 /* By default 0x1FFFFFF (25 bits unsigned) is maximum count */
10971202 return sprintf(buf, "33554431\n");
10981203 }
@@ -1101,15 +1206,29 @@ static ssize_t quad8_count_ceiling_write(struct counter_device *counter, · 2 unmodified lines
11011206 struct counter_count *count, void *private, const char *buf, size_t len)
11021207 {
11031208 struct quad8_iio *const priv = counter->priv;
1209+ unsigned int ceiling;
1210+ int ret;
1211+
1212+ ret = kstrtouint(buf, 0, &ceiling);
1213+ if (ret)
1214+ return ret;
1215+
1216+ /* Only 24-bit values are supported */
1217+ if (ceiling > 0xFFFFFF)
1218+ return -EINVAL;
1219+
1220+ mutex_lock(&priv->lock);
11041221
11051222 /* Range Limit and Modulo-N count modes use preset value as ceiling */
11061223 switch (priv->count_mode[count->id]) {
11071224 case 1:
11081225 case 3:
1109− return quad8_count_preset_write(counter, count, private, buf,
1110− len);
1226+ quad8_preset_register_set(priv, count->id, ceiling);
1227+ break;
11111228 }
11121229
1230+ mutex_unlock(&priv->lock);
1231+
11131232 return len;
11141233 }
11151234
@@ -1137,6 +1256,8 @@ static ssize_t quad8_count_preset_enable_write(struct counter_device *counter, · 21 unmodified lines
11371256 /* Preset enable is active low in Input/Output Control register */
11381257 preset_enable = !preset_enable;
11391258
1259+ mutex_lock(&priv->lock);
1260+
11401261 priv->preset_enable[count->id] = preset_enable;
11411262
11421263 ior_cfg = priv->ab_enable[count->id] | (unsigned int)preset_enable << 1;
@@ -1144,6 +1265,8 @@ static ssize_t quad8_count_preset_enable_write(struct counter_device *counter, · 1 unmodified line
11441265 /* Load I/O control configuration to Input / Output Control Register */
11451266 outb(QUAD8_CTR_IOR | ior_cfg, base_offset);
11461267
1268+ mutex_unlock(&priv->lock);
1269+
11471270 return len;
11481271 }
11491272
@@ -1429,6 +1552,9 @@ static int quad8_probe(struct device *dev, unsigned int id) · 279 unmodified lines
14291552 quad8iio->counter.priv = quad8iio;
14301553 quad8iio->base = base[id];
14311554
1555+ /* Initialize mutex */
1556+ mutex_init(&quad8iio->lock);
1557+
14321558 /* Reset all counters and disable interrupt function */
14331559 outb(QUAD8_CHAN_OP_RESET_COUNTERS, base[id] + QUAD8_REG_CHAN_OP);
14341560 /* Set initial configuration for all counters */
drivers/cpufreq/intel_pstate.c+1−1
@@ -1059,7 +1059,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b, · 1058 unmodified lines
10591059
10601060 update_turbo_state();
10611061 if (global.turbo_disabled) {
1062− pr_warn("Turbo disabled by BIOS or unavailable on processor\n");
1062+ pr_notice_once("Turbo disabled by BIOS or unavailable on processor\n");
10631063 mutex_unlock(&intel_pstate_limits_lock);
10641064 mutex_unlock(&intel_pstate_driver_lock);
10651065 return -EPERM;
drivers/crypto/caam/caamalg.c+7−3
@@ -963,10 +963,12 @@ static void aead_crypt_done(struct device *jrdev, u32 *desc, u32 err, · 962 unmodified lines
963963 struct caam_drv_private_jr *jrp = dev_get_drvdata(jrdev);
964964 struct aead_edesc *edesc;
965965 int ecode = 0;
966+ bool has_bklog;
966967
967968 dev_dbg(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
968969
969970 edesc = rctx->edesc;
971+ has_bklog = edesc->bklog;
970972
971973 if (err)
972974 ecode = caam_jr_strstatus(jrdev, err);
@@ -979,7 +981,7 @@ static void aead_crypt_done(struct device *jrdev, u32 *desc, u32 err, · 6 unmodified lines
979981 * If no backlog flag, the completion of the request is done
980982 * by CAAM, not crypto engine.
981983 */
982− if (!edesc->bklog)
984+ if (!has_bklog)
983985 aead_request_complete(req, ecode);
984986 else
985987 crypto_finalize_aead_request(jrp->engine, req, ecode);
@@ -995,10 +997,12 @@ static void skcipher_crypt_done(struct device *jrdev, u32 *desc, u32 err, · 9 unmodified lines
995997 struct caam_drv_private_jr *jrp = dev_get_drvdata(jrdev);
996998 int ivsize = crypto_skcipher_ivsize(skcipher);
997999 int ecode = 0;
1000+ bool has_bklog;
9981001
9991002 dev_dbg(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
10001003
10011004 edesc = rctx->edesc;
1005+ has_bklog = edesc->bklog;
10021006 if (err)
10031007 ecode = caam_jr_strstatus(jrdev, err);
10041008
@@ -1028,7 +1032,7 @@ static void skcipher_crypt_done(struct device *jrdev, u32 *desc, u32 err, · 23 unmodified lines
10281032 * If no backlog flag, the completion of the request is done
10291033 * by CAAM, not crypto engine.
10301034 */
1031− if (!edesc->bklog)
1035+ if (!has_bklog)
10321036 skcipher_request_complete(req, ecode);
10331037 else
10341038 crypto_finalize_skcipher_request(jrp->engine, req, ecode);
@@ -1711,7 +1715,7 @@ static struct skcipher_edesc *skcipher_edesc_alloc(struct skcipher_request *req, · 676 unmodified lines
17111715
17121716 if (ivsize || mapped_dst_nents > 1)
17131717 sg_to_sec4_set_last(edesc->sec4_sg + dst_sg_idx +
1714− mapped_dst_nents);
1718+ mapped_dst_nents - 1 + !!ivsize);
17151719
17161720 if (sec4_sg_bytes) {
17171721 edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg,
drivers/crypto/caam/caamhash.c+6−2
@@ -583,10 +583,12 @@ static inline void ahash_done_cpy(struct device *jrdev, u32 *desc, u32 err, · 582 unmodified lines
583583 struct caam_hash_state *state = ahash_request_ctx(req);
584584 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash);
585585 int ecode = 0;
586+ bool has_bklog;
586587
587588 dev_dbg(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
588589
589590 edesc = state->edesc;
591+ has_bklog = edesc->bklog;
590592
591593 if (err)
592594 ecode = caam_jr_strstatus(jrdev, err);
@@ -603,7 +605,7 @@ static inline void ahash_done_cpy(struct device *jrdev, u32 *desc, u32 err, · 10 unmodified lines
603605 * If no backlog flag, the completion of the request is done
604606 * by CAAM, not crypto engine.
605607 */
606− if (!edesc->bklog)
608+ if (!has_bklog)
607609 req->base.complete(&req->base, ecode);
608610 else
609611 crypto_finalize_hash_request(jrp->engine, req, ecode);
@@ -632,10 +634,12 @@ static inline void ahash_done_switch(struct device *jrdev, u32 *desc, u32 err, · 22 unmodified lines
632634 struct caam_hash_state *state = ahash_request_ctx(req);
633635 int digestsize = crypto_ahash_digestsize(ahash);
634636 int ecode = 0;
637+ bool has_bklog;
635638
636639 dev_dbg(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
637640
638641 edesc = state->edesc;
642+ has_bklog = edesc->bklog;
639643 if (err)
640644 ecode = caam_jr_strstatus(jrdev, err);
641645
@@ -663,7 +667,7 @@ static inline void ahash_done_switch(struct device *jrdev, u32 *desc, u32 err, · 21 unmodified lines
663667 * If no backlog flag, the completion of the request is done
664668 * by CAAM, not crypto engine.
665669 */
666− if (!edesc->bklog)
670+ if (!has_bklog)
667671 req->base.complete(&req->base, ecode);
668672 else
669673 crypto_finalize_hash_request(jrp->engine, req, ecode);
drivers/crypto/caam/caampkc.c+6−2
@@ -121,11 +121,13 @@ static void rsa_pub_done(struct device *dev, u32 *desc, u32 err, void *context) · 120 unmodified lines
121121 struct caam_drv_private_jr *jrp = dev_get_drvdata(dev);
122122 struct rsa_edesc *edesc;
123123 int ecode = 0;
124+ bool has_bklog;
124125
125126 if (err)
126127 ecode = caam_jr_strstatus(dev, err);
127128
128129 edesc = req_ctx->edesc;
130+ has_bklog = edesc->bklog;
129131
130132 rsa_pub_unmap(dev, edesc, req);
131133 rsa_io_unmap(dev, edesc, req);
@@ -135,7 +137,7 @@ static void rsa_pub_done(struct device *dev, u32 *desc, u32 err, void *context) · 3 unmodified lines
135137 * If no backlog flag, the completion of the request is done
136138 * by CAAM, not crypto engine.
137139 */
138− if (!edesc->bklog)
140+ if (!has_bklog)
139141 akcipher_request_complete(req, ecode);
140142 else
141143 crypto_finalize_akcipher_request(jrp->engine, req, ecode);
@@ -152,11 +154,13 @@ static void rsa_priv_f_done(struct device *dev, u32 *desc, u32 err, · 10 unmodified lines
152154 struct caam_rsa_req_ctx *req_ctx = akcipher_request_ctx(req);
153155 struct rsa_edesc *edesc;
154156 int ecode = 0;
157+ bool has_bklog;
155158
156159 if (err)
157160 ecode = caam_jr_strstatus(dev, err);
158161
159162 edesc = req_ctx->edesc;
163+ has_bklog = edesc->bklog;
160164
161165 switch (key->priv_form) {
162166 case FORM1:
@@ -176,7 +180,7 @@ static void rsa_priv_f_done(struct device *dev, u32 *desc, u32 err, · 13 unmodified lines
176180 * If no backlog flag, the completion of the request is done
177181 * by CAAM, not crypto engine.
178182 */
179− if (!edesc->bklog)
183+ if (!has_bklog)
180184 akcipher_request_complete(req, ecode);
181185 else
182186 crypto_finalize_akcipher_request(jrp->engine, req, ecode);
drivers/crypto/chelsio/chcr_ktls.c+48−41
@@ -120,12 +120,10 @@ out: · 119 unmodified lines
120120 static int chcr_ktls_update_connection_state(struct chcr_ktls_info *tx_info,
121121 int new_state)
122122 {
123− unsigned long flags;
124−
125123 /* This function can be called from both rx (interrupt context) and tx
126124 * queue contexts.
127125 */
128− spin_lock_irqsave(&tx_info->lock, flags);
126+ spin_lock_bh(&tx_info->lock);
129127 switch (tx_info->connection_state) {
130128 case KTLS_CONN_CLOSED:
131129 tx_info->connection_state = new_state;
@@ -169,7 +167,7 @@ static int chcr_ktls_update_connection_state(struct chcr_ktls_info *tx_info, · 37 unmodified lines
169167 pr_err("unknown KTLS connection state\n");
170168 break;
171169 }
172− spin_unlock_irqrestore(&tx_info->lock, flags);
170+ spin_unlock_bh(&tx_info->lock);
173171
174172 return tx_info->connection_state;
175173 }
@@ -675,41 +673,14 @@ int chcr_ktls_cpl_set_tcb_rpl(struct adapter *adap, unsigned char *input) · 499 unmodified lines
675673 return 0;
676674 }
677675
678−/*
679− * chcr_write_cpl_set_tcb_ulp: update tcb values.
680− * TCB is responsible to create tcp headers, so all the related values
681− * should be correctly updated.
682− * @tx_info - driver specific tls info.
683− * @q - tx queue on which packet is going out.
684− * @tid - TCB identifier.
685− * @pos - current index where should we start writing.
686− * @word - TCB word.
687− * @mask - TCB word related mask.
688− * @val - TCB word related value.
689− * @reply - set 1 if looking for TP response.
690− * return - next position to write.
691− */
692−static void *chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info,
693− struct sge_eth_txq *q, u32 tid,
694− void *pos, u16 word, u64 mask,
676+static void *__chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info,
677+ u32 tid, void *pos, u16 word, u64 mask,
695678 u64 val, u32 reply)
696679 {
697680 struct cpl_set_tcb_field_core *cpl;
698681 struct ulptx_idata *idata;
699682 struct ulp_txpkt *txpkt;
700− void *save_pos = NULL;
701− u8 buf[48] = {0};
702− int left;
703683
704− left = (void *)q->q.stat - pos;
705− if (unlikely(left < CHCR_SET_TCB_FIELD_LEN)) {
706− if (!left) {
707− pos = q->q.desc;
708− } else {
709− save_pos = pos;
710− pos = buf;
711− }
712− }
713684 /* ULP_TXPKT */
714685 txpkt = pos;
715686 txpkt->cmd_dest = htonl(ULPTX_CMD_V(ULP_TX_PKT) | ULP_TXPKT_DEST_V(0));
@@ -734,18 +705,54 @@ static void *chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info, · 18 unmodified lines
734705 idata = (struct ulptx_idata *)(cpl + 1);
735706 idata->cmd_more = htonl(ULPTX_CMD_V(ULP_TX_SC_NOOP));
736707 idata->len = htonl(0);
708+ pos = idata + 1;
737709
738− if (save_pos) {
739− pos = chcr_copy_to_txd(buf, &q->q, save_pos,
740− CHCR_SET_TCB_FIELD_LEN);
741− } else {
742− /* check again if we are at the end of the queue */
743− if (left == CHCR_SET_TCB_FIELD_LEN)
710+ return pos;
711+}
712+
713+
714+/*
715+ * chcr_write_cpl_set_tcb_ulp: update tcb values.
716+ * TCB is responsible to create tcp headers, so all the related values
717+ * should be correctly updated.
718+ * @tx_info - driver specific tls info.
719+ * @q - tx queue on which packet is going out.
720+ * @tid - TCB identifier.
721+ * @pos - current index where should we start writing.
722+ * @word - TCB word.
723+ * @mask - TCB word related mask.
724+ * @val - TCB word related value.
725+ * @reply - set 1 if looking for TP response.
726+ * return - next position to write.
727+ */
728+static void *chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info,
729+ struct sge_eth_txq *q, u32 tid,
730+ void *pos, u16 word, u64 mask,
731+ u64 val, u32 reply)
732+{
733+ int left = (void *)q->q.stat - pos;
734+
735+ if (unlikely(left < CHCR_SET_TCB_FIELD_LEN)) {
736+ if (!left) {
744737 pos = q->q.desc;
745− else
746− pos = idata + 1;
738+ } else {
739+ u8 buf[48] = {0};
740+
741+ __chcr_write_cpl_set_tcb_ulp(tx_info, tid, buf, word,
742+ mask, val, reply);
743+
744+ return chcr_copy_to_txd(buf, &q->q, pos,
745+ CHCR_SET_TCB_FIELD_LEN);
746+ }
747747 }
748748
749+ pos = __chcr_write_cpl_set_tcb_ulp(tx_info, tid, pos, word,
750+ mask, val, reply);
751+
752+ /* check again if we are at the end of the queue */
753+ if (left == CHCR_SET_TCB_FIELD_LEN)
754+ pos = q->q.desc;
755+
749756 return pos;
750757 }
751758
drivers/dma-buf/dma-buf.c+4−3
@@ -388,7 +388,8 @@ static long dma_buf_ioctl(struct file *file, · 387 unmodified lines
388388
389389 return ret;
390390
391− case DMA_BUF_SET_NAME:
391+ case DMA_BUF_SET_NAME_A:
392+ case DMA_BUF_SET_NAME_B:
392393 return dma_buf_set_name(dmabuf, (const char __user *)arg);
393394
394395 default:
@@ -655,8 +656,8 @@ EXPORT_SYMBOL_GPL(dma_buf_put); · 260 unmodified lines
655656 * calls attach() of dma_buf_ops to allow device-specific attach functionality
656657 * @dmabuf: [in] buffer to attach device to.
657658 * @dev: [in] device to be attached.
658− * @importer_ops [in] importer operations for the attachment
659− * @importer_priv [in] importer private pointer for the attachment
659+ * @importer_ops: [in] importer operations for the attachment
660+ * @importer_priv: [in] importer private pointer for the attachment
660661 *
661662 * Returns struct dma_buf_attachment pointer for this attachment. Attachments
662663 * must be cleaned up by calling dma_buf_detach().
drivers/dma/Kconfig+2−1
@@ -241,7 +241,8 @@ config FSL_RAID · 240 unmodified lines
241241
242242 config HISI_DMA
243243 tristate "HiSilicon DMA Engine support"
244− depends on ARM64 || (COMPILE_TEST && PCI_MSI)
244+ depends on ARM64 || COMPILE_TEST
245+ depends on PCI_MSI
245246 select DMA_ENGINE
246247 select DMA_VIRTUAL_CHANNELS
247248 help
drivers/dma/dmaengine.c+26−34
@@ -232,10 +232,6 @@ static void chan_dev_release(struct device *dev) · 231 unmodified lines
232232 struct dma_chan_dev *chan_dev;
233233
234234 chan_dev = container_of(dev, typeof(*chan_dev), device);
235− if (atomic_dec_and_test(chan_dev->idr_ref)) {
236− ida_free(&dma_ida, chan_dev->dev_id);
237− kfree(chan_dev->idr_ref);
238− }
239235 kfree(chan_dev);
240236 }
241237
@@ -1043,27 +1039,9 @@ static int get_dma_id(struct dma_device *device) · 801 unmodified lines
10431039 }
10441040
10451041 static int __dma_async_device_channel_register(struct dma_device *device,
1046− struct dma_chan *chan,
1047− int chan_id)
1042+ struct dma_chan *chan)
10481043 {
10491044 int rc = 0;
1050− int chancnt = device->chancnt;
1051− atomic_t *idr_ref;
1052− struct dma_chan *tchan;
1053−
1054− tchan = list_first_entry_or_null(&device->channels,
1055− struct dma_chan, device_node);
1056− if (!tchan)
1057− return -ENODEV;
1058−
1059− if (tchan->dev) {
1060− idr_ref = tchan->dev->idr_ref;
1061− } else {
1062− idr_ref = kmalloc(sizeof(*idr_ref), GFP_KERNEL);
1063− if (!idr_ref)
1064− return -ENOMEM;
1065− atomic_set(idr_ref, 0);
1066− }
10671045
10681046 chan->local = alloc_percpu(typeof(*chan->local));
10691047 if (!chan->local)
@@ -1079,29 +1057,36 @@ static int __dma_async_device_channel_register(struct dma_device *device, · 9 unmodified lines
10791057 * When the chan_id is a negative value, we are dynamically adding
10801058 * the channel. Otherwise we are static enumerating.
10811059 */
1082− chan->chan_id = chan_id < 0 ? chancnt : chan_id;
1060+ mutex_lock(&device->chan_mutex);
1061+ chan->chan_id = ida_alloc(&device->chan_ida, GFP_KERNEL);
1062+ mutex_unlock(&device->chan_mutex);
1063+ if (chan->chan_id < 0) {
1064+ pr_err("%s: unable to alloc ida for chan: %d\n",
1065+ __func__, chan->chan_id);
1066+ goto err_out;
1067+ }
1068+
10831069 chan->dev->device.class = &dma_devclass;
10841070 chan->dev->device.parent = device->dev;
10851071 chan->dev->chan = chan;
1086− chan->dev->idr_ref = idr_ref;
10871072 chan->dev->dev_id = device->dev_id;
1088− atomic_inc(idr_ref);
10891073 dev_set_name(&chan->dev->device, "dma%dchan%d",
10901074 device->dev_id, chan->chan_id);
1091−
10921075 rc = device_register(&chan->dev->device);
10931076 if (rc)
1094− goto err_out;
1077+ goto err_out_ida;
10951078 chan->client_count = 0;
1096− device->chancnt = chan->chan_id + 1;
1079+ device->chancnt++;
10971080
10981081 return 0;
10991082
1083+ err_out_ida:
1084+ mutex_lock(&device->chan_mutex);
1085+ ida_free(&device->chan_ida, chan->chan_id);
1086+ mutex_unlock(&device->chan_mutex);
11001087 err_out:
11011088 free_percpu(chan->local);
11021089 kfree(chan->dev);
1103− if (atomic_dec_return(idr_ref) == 0)
1104− kfree(idr_ref);
11051090 return rc;
11061091 }
11071092
@@ -1110,7 +1095,7 @@ int dma_async_device_channel_register(struct dma_device *device, · 2 unmodified lines
11101095 {
11111096 int rc;
11121097
1113− rc = __dma_async_device_channel_register(device, chan, -1);
1098+ rc = __dma_async_device_channel_register(device, chan);
11141099 if (rc < 0)
11151100 return rc;
11161101
@@ -1130,6 +1115,9 @@ static void __dma_async_device_channel_unregister(struct dma_device *device, · 13 unmodified lines
11301115 device->chancnt--;
11311116 chan->dev->chan = NULL;
11321117 mutex_unlock(&dma_list_mutex);
1118+ mutex_lock(&device->chan_mutex);
1119+ ida_free(&device->chan_ida, chan->chan_id);
1120+ mutex_unlock(&device->chan_mutex);
11331121 device_unregister(&chan->dev->device);
11341122 free_percpu(chan->local);
11351123 }
@@ -1152,7 +1140,7 @@ EXPORT_SYMBOL_GPL(dma_async_device_channel_unregister); · 16 unmodified lines
11521140 */
11531141 int dma_async_device_register(struct dma_device *device)
11541142 {
1155− int rc, i = 0;
1143+ int rc;
11561144 struct dma_chan* chan;
11571145
11581146 if (!device)
@@ -1257,9 +1245,12 @@ int dma_async_device_register(struct dma_device *device) · 98 unmodified lines
12571245 if (rc != 0)
12581246 return rc;
12591247
1248+ mutex_init(&device->chan_mutex);
1249+ ida_init(&device->chan_ida);
1250+
12601251 /* represent channels in sysfs. Probably want devs too */
12611252 list_for_each_entry(chan, &device->channels, device_node) {
1262− rc = __dma_async_device_channel_register(device, chan, i++);
1253+ rc = __dma_async_device_channel_register(device, chan);
12631254 if (rc < 0)
12641255 goto err_out;
12651256 }
@@ -1334,6 +1325,7 @@ void dma_async_device_unregister(struct dma_device *device) · 68 unmodified lines
13341325 */
13351326 dma_cap_set(DMA_PRIVATE, device->cap_mask);
13361327 dma_channel_rebalance();
1328+ ida_free(&dma_ida, device->dev_id);
13371329 dma_device_put(device);
13381330 mutex_unlock(&dma_list_mutex);
13391331 }
drivers/dma/dmatest.c+3−3
@@ -240,7 +240,7 @@ static bool is_threaded_test_run(struct dmatest_info *info) · 239 unmodified lines
240240 struct dmatest_thread *thread;
241241
242242 list_for_each_entry(thread, &dtc->threads, node) {
243− if (!thread->done)
243+ if (!thread->done && !thread->pending)
244244 return true;
245245 }
246246 }
@@ -662,8 +662,8 @@ static int dmatest_func(void *data) · 415 unmodified lines
662662 flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
663663
664664 ktime = ktime_get();
665− while (!kthread_should_stop()
666− && !(params->iterations && total_tests >= params->iterations)) {
665+ while (!(kthread_should_stop() ||
666+ (params->iterations && total_tests >= params->iterations))) {
667667 struct dma_async_tx_descriptor *tx = NULL;
668668 struct dmaengine_unmap_data *um;
669669 dma_addr_t *dsts;
drivers/dma/mmp_tdma.c+4−1
@@ -363,6 +363,8 @@ static void mmp_tdma_free_descriptor(struct mmp_tdma_chan *tdmac) · 362 unmodified lines
363363 gen_pool_free(gpool, (unsigned long)tdmac->desc_arr,
364364 size);
365365 tdmac->desc_arr = NULL;
366+ if (tdmac->status == DMA_ERROR)
367+ tdmac->status = DMA_COMPLETE;
366368
367369 return;
368370 }
@@ -443,7 +445,8 @@ static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic( · 74 unmodified lines
443445 if (!desc)
444446 goto err_out;
445447
446− mmp_tdma_config_write(chan, direction, &tdmac->slave_config);
448+ if (mmp_tdma_config_write(chan, direction, &tdmac->slave_config))
449+ goto err_out;
447450
448451 while (buf < buf_len) {
449452 desc = &tdmac->desc_arr[i];
drivers/dma/pch_dma.c+1−1
@@ -865,6 +865,7 @@ static int pch_dma_probe(struct pci_dev *pdev, · 864 unmodified lines
865865 }
866866
867867 pci_set_master(pdev);
868+ pd->dma.dev = &pdev->dev;
868869
869870 err = request_irq(pdev->irq, pd_irq, IRQF_SHARED, DRV_NAME, pd);
870871 if (err) {
@@ -880,7 +881,6 @@ static int pch_dma_probe(struct pci_dev *pdev, · 9 unmodified lines
880881 goto err_free_irq;
881882 }
882883
883− pd->dma.dev = &pdev->dev;
884884
885885 INIT_LIST_HEAD(&pd->dma.channels);
886886
drivers/dma/tegra20-apb-dma.c+9−0
@@ -816,6 +816,13 @@ static bool tegra_dma_eoc_interrupt_deasserted(struct tegra_dma_channel *tdc) · 815 unmodified lines
816816 static void tegra_dma_synchronize(struct dma_chan *dc)
817817 {
818818 struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
819+ int err;
820+
821+ err = pm_runtime_get_sync(tdc->tdma->dev);
822+ if (err < 0) {
823+ dev_err(tdc2dev(tdc), "Failed to synchronize DMA: %d\n", err);
824+ return;
825+ }
819826
820827 /*
821828 * CPU, which handles interrupt, could be busy in
@@ -825,6 +832,8 @@ static void tegra_dma_synchronize(struct dma_chan *dc) · 3 unmodified lines
825832 wait_event(tdc->wq, tegra_dma_eoc_interrupt_deasserted(tdc));
826833
827834 tasklet_kill(&tdc->tasklet);
835+
836+ pm_runtime_put(tdc->tdma->dev);
828837 }
829838
830839 static unsigned int tegra_dma_sg_bytes_xferred(struct tegra_dma_channel *tdc,
drivers/dma/ti/k3-psil.c+1−0
@@ -27,6 +27,7 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id) · 26 unmodified lines
2727 soc_ep_map = &j721e_ep_map;
2828 } else {
2929 pr_err("PSIL: No compatible machine found for map\n");
30+ mutex_unlock(&ep_map_mutex);
3031 return ERR_PTR(-ENOTSUPP);
3132 }
3233 pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
drivers/dma/xilinx/xilinx_dma.c+10−10
@@ -1230,16 +1230,16 @@ static enum dma_status xilinx_dma_tx_status(struct dma_chan *dchan, · 1229 unmodified lines
12301230 return ret;
12311231
12321232 spin_lock_irqsave(&chan->lock, flags);
1233−
1234− desc = list_last_entry(&chan->active_list,
1235− struct xilinx_dma_tx_descriptor, node);
1236− /*
1237− * VDMA and simple mode do not support residue reporting, so the
1238− * residue field will always be 0.
1239− */
1240− if (chan->has_sg && chan->xdev->dma_config->dmatype != XDMA_TYPE_VDMA)
1241− residue = xilinx_dma_get_residue(chan, desc);
1242−
1233+ if (!list_empty(&chan->active_list)) {
1234+ desc = list_last_entry(&chan->active_list,
1235+ struct xilinx_dma_tx_descriptor, node);
1236+ /*
1237+ * VDMA and simple mode do not support residue reporting, so the
1238+ * residue field will always be 0.
1239+ */
1240+ if (chan->has_sg && chan->xdev->dma_config->dmatype != XDMA_TYPE_VDMA)
1241+ residue = xilinx_dma_get_residue(chan, desc);
1242+ }
12431243 spin_unlock_irqrestore(&chan->lock, flags);
12441244
12451245 dma_set_residue(txstate, residue);
drivers/firmware/efi/tpm.c+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616 int efi_tpm_final_log_size;
1717 EXPORT_SYMBOL(efi_tpm_final_log_size);
1818
19−static int tpm2_calc_event_log_size(void *data, int count, void *size_info)
19+static int __init tpm2_calc_event_log_size(void *data, int count, void *size_info)
2020 {
2121 struct tcg_pcr_event2_head *header;
2222 int event_size, size = 0;
drivers/firmware/imx/Kconfig+2−2
@@ -12,7 +12,7 @@ config IMX_DSP · 11 unmodified lines
1212
1313 config IMX_SCU
1414 bool "IMX SCU Protocol driver"
15− depends on IMX_MBOX || COMPILE_TEST
15+ depends on IMX_MBOX
1616 help
1717 The System Controller Firmware (SCFW) is a low-level system function
1818 which runs on a dedicated Cortex-M core to provide power, clock, and
@@ -24,6 +24,6 @@ config IMX_SCU · 5 unmodified lines
2424
2525 config IMX_SCU_PD
2626 bool "IMX SCU Power Domain driver"
27− depends on IMX_SCU || COMPILE_TEST
27+ depends on IMX_SCU
2828 help
2929 The System Controller Firmware (SCFW) based power domain driver.
drivers/firmware/xilinx/zynqmp-debug.c+1−1
@@ -35,7 +35,7 @@ static struct pm_api_info pm_api_list[] = { · 34 unmodified lines
3535 PM_API(PM_QUERY_DATA),
3636 };
3737
38−struct dentry *firmware_debugfs_root;
38+static struct dentry *firmware_debugfs_root;
3939
4040 /**
4141 * zynqmp_pm_argument_value() - Extract argument value from a PM-API request
drivers/fpga/dfl-pci.c+4−2
@@ -248,11 +248,13 @@ static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs) · 247 unmodified lines
248248 return ret;
249249
250250 ret = pci_enable_sriov(pcidev, num_vfs);
251− if (ret)
251+ if (ret) {
252252 dfl_fpga_cdev_config_ports_pf(cdev);
253+ return ret;
254+ }
253255 }
254256
255− return ret;
257+ return num_vfs;
256258 }
257259
258260 static void cci_pci_remove(struct pci_dev *pcidev)
drivers/fpga/zynq-fpga.c+2−1
@@ -583,7 +583,8 @@ static int zynq_fpga_probe(struct platform_device *pdev) · 582 unmodified lines
583583
584584 priv->clk = devm_clk_get(dev, "ref_clk");
585585 if (IS_ERR(priv->clk)) {
586− dev_err(dev, "input clock not found\n");
586+ if (PTR_ERR(priv->clk) != -EPROBE_DEFER)
587+ dev_err(dev, "input clock not found\n");
587588 return PTR_ERR(priv->clk);
588589 }
589590
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+2−5
@@ -3372,15 +3372,12 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) · 3371 unmodified lines
33723372 }
33733373 }
33743374
3375− amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
3376− amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
3377−
3378− amdgpu_amdkfd_suspend(adev, !fbcon);
3379−
33803375 amdgpu_ras_suspend(adev);
33813376
33823377 r = amdgpu_device_ip_suspend_phase1(adev);
33833378
3379+ amdgpu_amdkfd_suspend(adev, !fbcon);
3380+
33843381 /* evict vram memory */
33853382 amdgpu_bo_evict_vram(adev);
33863383
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+2−1
@@ -85,9 +85,10 @@ · 84 unmodified lines
8585 * - 3.34.0 - Non-DC can flip correctly between buffers with different pitches
8686 * - 3.35.0 - Add drm_amdgpu_info_device::tcc_disabled_mask
8787 * - 3.36.0 - Allow reading more status registers on si/cik
88+ * - 3.37.0 - L2 is invalidated before SDMA IBs, needed for correctness
8889 */
8990 #define KMS_DRIVER_MAJOR 3
90−#define KMS_DRIVER_MINOR 36
91+#define KMS_DRIVER_MINOR 37
9192 #define KMS_DRIVER_PATCHLEVEL 0
9293
9394 int amdgpu_vram_limit = 0;
drivers/gpu/drm/amd/amdgpu/navi10_sdma_pkt_open.h+16−0
@@ -73,6 +73,22 @@ · 72 unmodified lines
7373 #define SDMA_OP_AQL_COPY 0
7474 #define SDMA_OP_AQL_BARRIER_OR 0
7575
76+#define SDMA_GCR_RANGE_IS_PA (1 << 18)
77+#define SDMA_GCR_SEQ(x) (((x) & 0x3) << 16)
78+#define SDMA_GCR_GL2_WB (1 << 15)
79+#define SDMA_GCR_GL2_INV (1 << 14)
80+#define SDMA_GCR_GL2_DISCARD (1 << 13)
81+#define SDMA_GCR_GL2_RANGE(x) (((x) & 0x3) << 11)
82+#define SDMA_GCR_GL2_US (1 << 10)
83+#define SDMA_GCR_GL1_INV (1 << 9)
84+#define SDMA_GCR_GLV_INV (1 << 8)
85+#define SDMA_GCR_GLK_INV (1 << 7)
86+#define SDMA_GCR_GLK_WB (1 << 6)
87+#define SDMA_GCR_GLM_INV (1 << 5)
88+#define SDMA_GCR_GLM_WB (1 << 4)
89+#define SDMA_GCR_GL1_RANGE(x) (((x) & 0x3) << 2)
90+#define SDMA_GCR_GLI_INV(x) (((x) & 0x3) << 0)
91+
7692 /*define for op field*/
7793 #define SDMA_PKT_HEADER_op_offset 0
7894 #define SDMA_PKT_HEADER_op_mask 0x000000FF
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c+13−1
@@ -382,6 +382,18 @@ static void sdma_v5_0_ring_emit_ib(struct amdgpu_ring *ring, · 381 unmodified lines
382382 unsigned vmid = AMDGPU_JOB_GET_VMID(job);
383383 uint64_t csa_mc_addr = amdgpu_sdma_get_csa_mc_addr(ring, vmid);
384384
385+ /* Invalidate L2, because if we don't do it, we might get stale cache
386+ * lines from previous IBs.
387+ */
388+ amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_GCR_REQ));
389+ amdgpu_ring_write(ring, 0);
390+ amdgpu_ring_write(ring, (SDMA_GCR_GL2_INV |
391+ SDMA_GCR_GL2_WB |
392+ SDMA_GCR_GLM_INV |
393+ SDMA_GCR_GLM_WB) << 16);
394+ amdgpu_ring_write(ring, 0xffffff80);
395+ amdgpu_ring_write(ring, 0xffff);
396+
385397 /* An IB packet must end on a 8 DW boundary--the next dword
386398 * must be on a 8-dword boundary. Our IB packet below is 6
387399 * dwords long, thus add x number of NOPs, such that, in
@@ -1595,7 +1607,7 @@ static const struct amdgpu_ring_funcs sdma_v5_0_ring_funcs = { · 1207 unmodified lines
15951607 SOC15_FLUSH_GPU_TLB_NUM_WREG * 3 +
15961608 SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 6 * 2 +
15971609 10 + 10 + 10, /* sdma_v5_0_ring_emit_fence x3 for user fence, vm fence */
1598− .emit_ib_size = 7 + 6, /* sdma_v5_0_ring_emit_ib */
1610+ .emit_ib_size = 5 + 7 + 6, /* sdma_v5_0_ring_emit_ib */
15991611 .emit_ib = sdma_v5_0_ring_emit_ib,
16001612 .emit_fence = sdma_v5_0_ring_emit_fence,
16011613 .emit_pipeline_sync = sdma_v5_0_ring_emit_pipeline_sync,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+52−17
@@ -2008,17 +2008,22 @@ void amdgpu_dm_update_connector_after_detect( · 2007 unmodified lines
20082008 dc_sink_retain(aconnector->dc_sink);
20092009 if (sink->dc_edid.length == 0) {
20102010 aconnector->edid = NULL;
2011− drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);
2011+ if (aconnector->dc_link->aux_mode) {
2012+ drm_dp_cec_unset_edid(
2013+ &aconnector->dm_dp_aux.aux);
2014+ }
20122015 } else {
20132016 aconnector->edid =
2014− (struct edid *) sink->dc_edid.raw_edid;
2015−
2017+ (struct edid *)sink->dc_edid.raw_edid;
20162018
20172019 drm_connector_update_edid_property(connector,
2018− aconnector->edid);
2019− drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
2020− aconnector->edid);
2020+ aconnector->edid);
2021+
2022+ if (aconnector->dc_link->aux_mode)
2023+ drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
2024+ aconnector->edid);
20212025 }
2026+
20222027 amdgpu_dm_update_freesync_caps(connector, aconnector->edid);
20232028 update_connector_ext_caps(aconnector);
20242029 } else {
@@ -3340,7 +3345,8 @@ fill_plane_dcc_attributes(struct amdgpu_device *adev, · 1315 unmodified lines
33403345 const union dc_tiling_info *tiling_info,
33413346 const uint64_t info,
33423347 struct dc_plane_dcc_param *dcc,
3343− struct dc_plane_address *address)
3348+ struct dc_plane_address *address,
3349+ bool force_disable_dcc)
33443350 {
33453351 struct dc *dc = adev->dm.dc;
33463352 struct dc_dcc_surface_param input;
@@ -3352,6 +3358,9 @@ fill_plane_dcc_attributes(struct amdgpu_device *adev, · 5 unmodified lines
33523358 memset(&input, 0, sizeof(input));
33533359 memset(&output, 0, sizeof(output));
33543360
3361+ if (force_disable_dcc)
3362+ return 0;
3363+
33553364 if (!offset)
33563365 return 0;
33573366
@@ -3401,7 +3410,8 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, · 43 unmodified lines
34013410 union dc_tiling_info *tiling_info,
34023411 struct plane_size *plane_size,
34033412 struct dc_plane_dcc_param *dcc,
3404− struct dc_plane_address *address)
3413+ struct dc_plane_address *address,
3414+ bool force_disable_dcc)
34053415 {
34063416 const struct drm_framebuffer *fb = &afb->base;
34073417 int ret;
@@ -3507,7 +3517,8 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, · 99 unmodified lines
35073517
35083518 ret = fill_plane_dcc_attributes(adev, afb, format, rotation,
35093519 plane_size, tiling_info,
3510− tiling_flags, dcc, address);
3520+ tiling_flags, dcc, address,
3521+ force_disable_dcc);
35113522 if (ret)
35123523 return ret;
35133524 }
@@ -3599,7 +3610,8 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, · 85 unmodified lines
35993610 const struct drm_plane_state *plane_state,
36003611 const uint64_t tiling_flags,
36013612 struct dc_plane_info *plane_info,
3602− struct dc_plane_address *address)
3613+ struct dc_plane_address *address,
3614+ bool force_disable_dcc)
36033615 {
36043616 const struct drm_framebuffer *fb = plane_state->fb;
36053617 const struct amdgpu_framebuffer *afb =
@@ -3681,7 +3693,8 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, · 75 unmodified lines
36813693 plane_info->rotation, tiling_flags,
36823694 &plane_info->tiling_info,
36833695 &plane_info->plane_size,
3684− &plane_info->dcc, address);
3696+ &plane_info->dcc, address,
3697+ force_disable_dcc);
36853698 if (ret)
36863699 return ret;
36873700
@@ -3704,6 +3717,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, · 16 unmodified lines
37043717 struct dc_plane_info plane_info;
37053718 uint64_t tiling_flags;
37063719 int ret;
3720+ bool force_disable_dcc = false;
37073721
37083722 ret = fill_dc_scaling_info(plane_state, &scaling_info);
37093723 if (ret)
@@ -3718,9 +3732,11 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, · 8 unmodified lines
37183732 if (ret)
37193733 return ret;
37203734
3735+ force_disable_dcc = adev->asic_type == CHIP_RAVEN && adev->in_suspend;
37213736 ret = fill_dc_plane_info_and_addr(adev, plane_state, tiling_flags,
37223737 &plane_info,
3723− &dc_plane_state->address);
3738+ &dc_plane_state->address,
3739+ force_disable_dcc);
37243740 if (ret)
37253741 return ret;
37263742
@@ -4664,6 +4680,7 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector) · 937 unmodified lines
46644680 i2c_del_adapter(&aconnector->i2c->base);
46654681 kfree(aconnector->i2c);
46664682 }
4683+ kfree(aconnector->dm_dp_aux.aux.name);
46674684
46684685 kfree(connector);
46694686 }
@@ -4723,10 +4740,19 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector) · 53 unmodified lines
47234740 static int
47244741 amdgpu_dm_connector_late_register(struct drm_connector *connector)
47254742 {
4726−#if defined(CONFIG_DEBUG_FS)
47274743 struct amdgpu_dm_connector *amdgpu_dm_connector =
47284744 to_amdgpu_dm_connector(connector);
4745+ int r;
47294746
4747+ if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
4748+ (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) {
4749+ amdgpu_dm_connector->dm_dp_aux.aux.dev = connector->kdev;
4750+ r = drm_dp_aux_register(&amdgpu_dm_connector->dm_dp_aux.aux);
4751+ if (r)
4752+ return r;
4753+ }
4754+
4755+#if defined(CONFIG_DEBUG_FS)
47304756 connector_debugfs_init(amdgpu_dm_connector);
47314757 #endif
47324758
@@ -5332,6 +5358,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · 599 unmodified lines
53325358 uint64_t tiling_flags;
53335359 uint32_t domain;
53345360 int r;
5361+ bool force_disable_dcc = false;
53355362
53365363 dm_plane_state_old = to_dm_plane_state(plane->state);
53375364 dm_plane_state_new = to_dm_plane_state(new_state);
@@ -5390,11 +5417,13 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · 52 unmodified lines
53905417 dm_plane_state_old->dc_state != dm_plane_state_new->dc_state) {
53915418 struct dc_plane_state *plane_state = dm_plane_state_new->dc_state;
53925419
5420+ force_disable_dcc = adev->asic_type == CHIP_RAVEN && adev->in_suspend;
53935421 fill_plane_buffer_attributes(
53945422 adev, afb, plane_state->format, plane_state->rotation,
53955423 tiling_flags, &plane_state->tiling_info,
53965424 &plane_state->plane_size, &plane_state->dcc,
5397− &plane_state->address);
5425+ &plane_state->address,
5426+ force_disable_dcc);
53985427 }
53995428
54005429 return 0;
@@ -6092,7 +6121,7 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, · 691 unmodified lines
60926121
60936122 if (connector_type == DRM_MODE_CONNECTOR_DisplayPort
60946123 || connector_type == DRM_MODE_CONNECTOR_eDP)
6095− amdgpu_dm_initialize_dp_connector(dm, aconnector);
6124+ amdgpu_dm_initialize_dp_connector(dm, aconnector, link->link_index);
60966125
60976126 out_free:
60986127 if (res) {
@@ -6666,7 +6695,12 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 567 unmodified lines
66666695 fill_dc_plane_info_and_addr(
66676696 dm->adev, new_plane_state, tiling_flags,
66686697 &bundle->plane_infos[planes_count],
6669− &bundle->flip_addrs[planes_count].address);
6698+ &bundle->flip_addrs[planes_count].address,
6699+ false);
6700+
6701+ DRM_DEBUG_DRIVER("plane: id=%d dcc_en=%d\n",
6702+ new_plane_state->plane->index,
6703+ bundle->plane_infos[planes_count].dcc.enable);
66706704
66716705 bundle->surface_updates[planes_count].plane_info =
66726706 &bundle->plane_infos[planes_count];
@@ -8086,7 +8120,8 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm, · 1413 unmodified lines
80868120 ret = fill_dc_plane_info_and_addr(
80878121 dm->adev, new_plane_state, tiling_flags,
80888122 plane_info,
8089− &flip_addr->address);
8123+ &flip_addr->address,
8124+ false);
80908125 if (ret)
80918126 goto cleanup;
80928127
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+9−6
@@ -156,16 +156,16 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector) · 155 unmodified lines
156156 to_amdgpu_dm_connector(connector);
157157 int r;
158158
159− amdgpu_dm_connector->dm_dp_aux.aux.dev = connector->kdev;
160− r = drm_dp_aux_register(&amdgpu_dm_connector->dm_dp_aux.aux);
161− if (r)
159+ r = drm_dp_mst_connector_late_register(connector,
160+ amdgpu_dm_connector->port);
161+ if (r < 0)
162162 return r;
163163
164164 #if defined(CONFIG_DEBUG_FS)
165165 connector_debugfs_init(amdgpu_dm_connector);
166166 #endif
167167
168− return r;
168+ return 0;
169169 }
170170
171171 static void
@@ -472,9 +472,12 @@ static const struct drm_dp_mst_topology_cbs dm_mst_cbs = { · 300 unmodified lines
472472 };
473473
474474 void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,
475− struct amdgpu_dm_connector *aconnector)
475+ struct amdgpu_dm_connector *aconnector,
476+ int link_index)
476477 {
477− aconnector->dm_dp_aux.aux.name = "dmdc";
478+ aconnector->dm_dp_aux.aux.name =
479+ kasprintf(GFP_KERNEL, "AMDGPU DM aux hw bus %d",
480+ link_index);
478481 aconnector->dm_dp_aux.aux.transfer = dm_dp_aux_transfer;
479482 aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc;
480483
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h+2−1
@@ -32,7 +32,8 @@ struct amdgpu_dm_connector; · 31 unmodified lines
3232 int dm_mst_get_pbn_divider(struct dc_link *link);
3333
3434 void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,
35− struct amdgpu_dm_connector *aconnector);
35+ struct amdgpu_dm_connector *aconnector,
36+ int link_index);
3637
3738 #if defined(CONFIG_DRM_AMD_DC_DCN)
3839 bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
drivers/gpu/drm/amd/display/dc/core/dc.c+2−3
@@ -834,11 +834,10 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context) · 833 unmodified lines
834834 static void wait_for_no_pipes_pending(struct dc *dc, struct dc_state *context)
835835 {
836836 int i;
837− int count = 0;
838− struct pipe_ctx *pipe;
839837 PERF_TRACE();
840838 for (i = 0; i < MAX_PIPES; i++) {
841− pipe = &context->res_ctx.pipe_ctx[i];
839+ int count = 0;
840+ struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
842841
843842 if (!pipe->plane_state)
844843 continue;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+27−0
@@ -2908,6 +2908,12 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd · 2907 unmodified lines
29082908 sizeof(hpd_irq_dpcd_data),
29092909 "Status: ");
29102910
2911+ for (i = 0; i < MAX_PIPES; i++) {
2912+ pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
2913+ if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link == link)
2914+ link->dc->hwss.blank_stream(pipe_ctx);
2915+ }
2916+
29112917 for (i = 0; i < MAX_PIPES; i++) {
29122918 pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
29132919 if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link == link)
@@ -2927,6 +2933,12 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd · 13 unmodified lines
29272933 if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
29282934 dc_link_reallocate_mst_payload(link);
29292935
2936+ for (i = 0; i < MAX_PIPES; i++) {
2937+ pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
2938+ if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link == link)
2939+ link->dc->hwss.unblank_stream(pipe_ctx, &previous_link_settings);
2940+ }
2941+
29302942 status = false;
29312943 if (out_link_loss)
29322944 *out_link_loss = true;
@@ -4227,6 +4239,21 @@ void dp_set_fec_enable(struct dc_link *link, bool enable) · 1294 unmodified lines
42274239 void dpcd_set_source_specific_data(struct dc_link *link)
42284240 {
42294241 const uint32_t post_oui_delay = 30; // 30ms
4242+ uint8_t dspc = 0;
4243+ enum dc_status ret = DC_ERROR_UNEXPECTED;
4244+
4245+ ret = core_link_read_dpcd(link, DP_DOWN_STREAM_PORT_COUNT, &dspc,
4246+ sizeof(dspc));
4247+
4248+ if (ret != DC_OK) {
4249+ DC_LOG_ERROR("Error in DP aux read transaction,"
4250+ " not writing source specific data\n");
4251+ return;
4252+ }
4253+
4254+ /* Return if OUI unsupported */
4255+ if (!(dspc & DP_OUI_SUPPORT))
4256+ return;
42304257
42314258 if (!link->dc->vendor_signature.is_valid) {
42324259 struct dpcd_amd_signature amd_signature;
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+4−36
@@ -231,34 +231,6 @@ struct dc_stream_status *dc_stream_get_status( · 230 unmodified lines
231231 return dc_stream_get_status_from_state(dc->current_state, stream);
232232 }
233233
234−static void delay_cursor_until_vupdate(struct pipe_ctx *pipe_ctx, struct dc *dc)
235−{
236−#if defined(CONFIG_DRM_AMD_DC_DCN)
237− unsigned int vupdate_line;
238− unsigned int lines_to_vupdate, us_to_vupdate, vpos, nvpos;
239− struct dc_stream_state *stream = pipe_ctx->stream;
240− unsigned int us_per_line;
241−
242− if (stream->ctx->asic_id.chip_family == FAMILY_RV &&
243− ASICREV_IS_RAVEN(stream->ctx->asic_id.hw_internal_rev)) {
244−
245− vupdate_line = dc->hwss.get_vupdate_offset_from_vsync(pipe_ctx);
246− if (!dc_stream_get_crtc_position(dc, &stream, 1, &vpos, &nvpos))
247− return;
248−
249− if (vpos >= vupdate_line)
250− return;
251−
252− us_per_line = stream->timing.h_total * 10000 / stream->timing.pix_clk_100hz;
253− lines_to_vupdate = vupdate_line - vpos;
254− us_to_vupdate = lines_to_vupdate * us_per_line;
255−
256− /* 70 us is a conservative estimate of cursor update time*/
257− if (us_to_vupdate < 70)
258− udelay(us_to_vupdate);
259− }
260−#endif
261−}
262234
263235 /**
264236 * dc_stream_set_cursor_attributes() - Update cursor attributes and set cursor surface address
@@ -298,9 +270,7 @@ bool dc_stream_set_cursor_attributes( · 33 unmodified lines
298270
299271 if (!pipe_to_program) {
300272 pipe_to_program = pipe_ctx;
301−
302− delay_cursor_until_vupdate(pipe_ctx, dc);
303− dc->hwss.pipe_control_lock(dc, pipe_to_program, true);
273+ dc->hwss.cursor_lock(dc, pipe_to_program, true);
304274 }
305275
306276 dc->hwss.set_cursor_attribute(pipe_ctx);
@@ -309,7 +279,7 @@ bool dc_stream_set_cursor_attributes( · 2 unmodified lines
309279 }
310280
311281 if (pipe_to_program)
312− dc->hwss.pipe_control_lock(dc, pipe_to_program, false);
282+ dc->hwss.cursor_lock(dc, pipe_to_program, false);
313283
314284 return true;
315285 }
@@ -349,16 +319,14 @@ bool dc_stream_set_cursor_position( · 33 unmodified lines
349319
350320 if (!pipe_to_program) {
351321 pipe_to_program = pipe_ctx;
352−
353− delay_cursor_until_vupdate(pipe_ctx, dc);
354− dc->hwss.pipe_control_lock(dc, pipe_to_program, true);
322+ dc->hwss.cursor_lock(dc, pipe_to_program, true);
355323 }
356324
357325 dc->hwss.set_cursor_position(pipe_ctx);
358326 }
359327
360328 if (pipe_to_program)
361− dc->hwss.pipe_control_lock(dc, pipe_to_program, false);
329+ dc->hwss.cursor_lock(dc, pipe_to_program, false);
362330
363331 return true;
364332 }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c+1−0
@@ -2757,6 +2757,7 @@ static const struct hw_sequencer_funcs dce110_funcs = { · 2756 unmodified lines
27572757 .disable_plane = dce110_power_down_fe,
27582758 .pipe_control_lock = dce_pipe_control_lock,
27592759 .interdependent_update_lock = NULL,
2760+ .cursor_lock = dce_pipe_control_lock,
27602761 .prepare_bandwidth = dce110_prepare_bandwidth,
27612762 .optimize_bandwidth = dce110_optimize_bandwidth,
27622763 .set_drr = set_drr,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c+10−0
@@ -1625,6 +1625,16 @@ void dcn10_pipe_control_lock( · 1624 unmodified lines
16251625 hws->funcs.verify_allow_pstate_change_high(dc);
16261626 }
16271627
1628+void dcn10_cursor_lock(struct dc *dc, struct pipe_ctx *pipe, bool lock)
1629+{
1630+ /* cursor lock is per MPCC tree, so only need to lock one pipe per stream */
1631+ if (!pipe || pipe->top_pipe)
1632+ return;
1633+
1634+ dc->res_pool->mpc->funcs->cursor_lock(dc->res_pool->mpc,
1635+ pipe->stream_res.opp->inst, lock);
1636+}
1637+
16281638 static bool wait_for_reset_trigger_to_occur(
16291639 struct dc_context *dc_ctx,
16301640 struct timing_generator *tg)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h+1−0
@@ -49,6 +49,7 @@ void dcn10_pipe_control_lock( · 48 unmodified lines
4949 struct dc *dc,
5050 struct pipe_ctx *pipe,
5151 bool lock);
52+void dcn10_cursor_lock(struct dc *dc, struct pipe_ctx *pipe, bool lock);
5253 void dcn10_blank_pixel_data(
5354 struct dc *dc,
5455 struct pipe_ctx *pipe_ctx,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c+1−0
@@ -50,6 +50,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { · 49 unmodified lines
5050 .disable_audio_stream = dce110_disable_audio_stream,
5151 .disable_plane = dcn10_disable_plane,
5252 .pipe_control_lock = dcn10_pipe_control_lock,
53+ .cursor_lock = dcn10_cursor_lock,
5354 .interdependent_update_lock = dcn10_lock_all_pipes,
5455 .prepare_bandwidth = dcn10_prepare_bandwidth,
5556 .optimize_bandwidth = dcn10_optimize_bandwidth,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c+15−0
@@ -223,6 +223,9 @@ struct mpcc *mpc1_insert_plane( · 222 unmodified lines
223223 REG_SET(MPCC_TOP_SEL[mpcc_id], 0, MPCC_TOP_SEL, dpp_id);
224224 REG_SET(MPCC_OPP_ID[mpcc_id], 0, MPCC_OPP_ID, tree->opp_id);
225225
226+ /* Configure VUPDATE lock set for this MPCC to map to the OPP */
227+ REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, tree->opp_id);
228+
226229 /* update mpc tree mux setting */
227230 if (tree->opp_list == insert_above_mpcc) {
228231 /* insert the toppest mpcc */
@@ -318,6 +321,7 @@ void mpc1_remove_mpcc( · 89 unmodified lines
318321 REG_SET(MPCC_TOP_SEL[mpcc_id], 0, MPCC_TOP_SEL, 0xf);
319322 REG_SET(MPCC_BOT_SEL[mpcc_id], 0, MPCC_BOT_SEL, 0xf);
320323 REG_SET(MPCC_OPP_ID[mpcc_id], 0, MPCC_OPP_ID, 0xf);
324+ REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, 0xf);
321325
322326 /* mark this mpcc as not in use */
323327 mpc10->mpcc_in_use_mask &= ~(1 << mpcc_id);
@@ -328,6 +332,7 @@ void mpc1_remove_mpcc( · 4 unmodified lines
328332 REG_SET(MPCC_TOP_SEL[mpcc_id], 0, MPCC_TOP_SEL, 0xf);
329333 REG_SET(MPCC_BOT_SEL[mpcc_id], 0, MPCC_BOT_SEL, 0xf);
330334 REG_SET(MPCC_OPP_ID[mpcc_id], 0, MPCC_OPP_ID, 0xf);
335+ REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, 0xf);
331336 }
332337 }
333338
@@ -361,6 +366,7 @@ void mpc1_mpc_init(struct mpc *mpc) · 27 unmodified lines
361366 REG_SET(MPCC_TOP_SEL[mpcc_id], 0, MPCC_TOP_SEL, 0xf);
362367 REG_SET(MPCC_BOT_SEL[mpcc_id], 0, MPCC_BOT_SEL, 0xf);
363368 REG_SET(MPCC_OPP_ID[mpcc_id], 0, MPCC_OPP_ID, 0xf);
369+ REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, 0xf);
364370
365371 mpc1_init_mpcc(&(mpc->mpcc_array[mpcc_id]), mpcc_id);
366372 }
@@ -381,6 +387,7 @@ void mpc1_mpc_init_single_inst(struct mpc *mpc, unsigned int mpcc_id) · 14 unmodified lines
381387 REG_SET(MPCC_TOP_SEL[mpcc_id], 0, MPCC_TOP_SEL, 0xf);
382388 REG_SET(MPCC_BOT_SEL[mpcc_id], 0, MPCC_BOT_SEL, 0xf);
383389 REG_SET(MPCC_OPP_ID[mpcc_id], 0, MPCC_OPP_ID, 0xf);
390+ REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, 0xf);
384391
385392 mpc1_init_mpcc(&(mpc->mpcc_array[mpcc_id]), mpcc_id);
386393
@@ -453,6 +460,13 @@ void mpc1_read_mpcc_state( · 66 unmodified lines
453460 MPCC_BUSY, &s->busy);
454461 }
455462
463+void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock)
464+{
465+ struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc);
466+
467+ REG_SET(CUR[opp_id], 0, CUR_VUPDATE_LOCK_SET, lock ? 1 : 0);
468+}
469+
456470 static const struct mpc_funcs dcn10_mpc_funcs = {
457471 .read_mpcc_state = mpc1_read_mpcc_state,
458472 .insert_plane = mpc1_insert_plane,
@@ -464,6 +478,7 @@ static const struct mpc_funcs dcn10_mpc_funcs = { · 5 unmodified lines
464478 .assert_mpcc_idle_before_connect = mpc1_assert_mpcc_idle_before_connect,
465479 .init_mpcc_list_from_hw = mpc1_init_mpcc_list_from_hw,
466480 .update_blending = mpc1_update_blending,
481+ .cursor_lock = mpc1_cursor_lock,
467482 .set_denorm = NULL,
468483 .set_denorm_clamp = NULL,
469484 .set_output_csc = NULL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h+14−6
@@ -39,11 +39,12 @@ · 38 unmodified lines
3939 SRII(MPCC_BG_G_Y, MPCC, inst),\
4040 SRII(MPCC_BG_R_CR, MPCC, inst),\
4141 SRII(MPCC_BG_B_CB, MPCC, inst),\
42− SRII(MPCC_BG_B_CB, MPCC, inst),\
43− SRII(MPCC_SM_CONTROL, MPCC, inst)
42+ SRII(MPCC_SM_CONTROL, MPCC, inst),\
43+ SRII(MPCC_UPDATE_LOCK_SEL, MPCC, inst)
4444
4545 #define MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0(inst) \
46− SRII(MUX, MPC_OUT, inst)
46+ SRII(MUX, MPC_OUT, inst),\
47+ VUPDATE_SRII(CUR, VUPDATE_LOCK_SET, inst)
4748
4849 #define MPC_COMMON_REG_VARIABLE_LIST \
4950 uint32_t MPCC_TOP_SEL[MAX_MPCC]; \
@@ -55,7 +56,9 @@ · 5 unmodified lines
5556 uint32_t MPCC_BG_R_CR[MAX_MPCC]; \
5657 uint32_t MPCC_BG_B_CB[MAX_MPCC]; \
5758 uint32_t MPCC_SM_CONTROL[MAX_MPCC]; \
58− uint32_t MUX[MAX_OPP];
59+ uint32_t MUX[MAX_OPP]; \
60+ uint32_t MPCC_UPDATE_LOCK_SEL[MAX_MPCC]; \
61+ uint32_t CUR[MAX_OPP];
5962
6063 #define MPC_COMMON_MASK_SH_LIST_DCN1_0(mask_sh)\
6164 SF(MPCC0_MPCC_TOP_SEL, MPCC_TOP_SEL, mask_sh),\
@@ -78,7 +81,8 @@ · 16 unmodified lines
7881 SF(MPCC0_MPCC_SM_CONTROL, MPCC_SM_FIELD_ALT, mask_sh),\
7982 SF(MPCC0_MPCC_SM_CONTROL, MPCC_SM_FORCE_NEXT_FRAME_POL, mask_sh),\
8083 SF(MPCC0_MPCC_SM_CONTROL, MPCC_SM_FORCE_NEXT_TOP_POL, mask_sh),\
81− SF(MPC_OUT0_MUX, MPC_OUT_MUX, mask_sh)
84+ SF(MPC_OUT0_MUX, MPC_OUT_MUX, mask_sh),\
85+ SF(MPCC0_MPCC_UPDATE_LOCK_SEL, MPCC_UPDATE_LOCK_SEL, mask_sh)
8286
8387 #define MPC_REG_FIELD_LIST(type) \
8488 type MPCC_TOP_SEL;\
@@ -101,7 +105,9 @@ · 16 unmodified lines
101105 type MPCC_SM_FIELD_ALT;\
102106 type MPCC_SM_FORCE_NEXT_FRAME_POL;\
103107 type MPCC_SM_FORCE_NEXT_TOP_POL;\
104− type MPC_OUT_MUX;
108+ type MPC_OUT_MUX;\
109+ type MPCC_UPDATE_LOCK_SEL;\
110+ type CUR_VUPDATE_LOCK_SET;
105111
106112 struct dcn_mpc_registers {
107113 MPC_COMMON_REG_VARIABLE_LIST
@@ -192,4 +198,6 @@ void mpc1_read_mpcc_state( · 84 unmodified lines
192198 int mpcc_inst,
193199 struct mpcc_state *s);
194200
201+void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock);
202+
195203 #endif
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c+12−2
@@ -181,6 +181,14 @@ enum dcn10_clk_src_array_id { · 180 unmodified lines
181181 .reg_name[id] = BASE(mm ## block ## id ## _ ## reg_name ## _BASE_IDX) + \
182182 mm ## block ## id ## _ ## reg_name
183183
184+#define VUPDATE_SRII(reg_name, block, id)\
185+ .reg_name[id] = BASE(mm ## reg_name ## 0 ## _ ## block ## id ## _BASE_IDX) + \
186+ mm ## reg_name ## 0 ## _ ## block ## id
187+
188+/* set field/register/bitfield name */
189+#define SFRB(field_name, reg_name, bitfield, post_fix)\
190+ .field_name = reg_name ## __ ## bitfield ## post_fix
191+
184192 /* NBIO */
185193 #define NBIO_BASE_INNER(seg) \
186194 NBIF_BASE__INST0_SEG ## seg
@@ -419,11 +427,13 @@ static const struct dcn_mpc_registers mpc_regs = { · 232 unmodified lines
419427 };
420428
421429 static const struct dcn_mpc_shift mpc_shift = {
422− MPC_COMMON_MASK_SH_LIST_DCN1_0(__SHIFT)
430+ MPC_COMMON_MASK_SH_LIST_DCN1_0(__SHIFT),\
431+ SFRB(CUR_VUPDATE_LOCK_SET, CUR0_VUPDATE_LOCK_SET0, CUR0_VUPDATE_LOCK_SET, __SHIFT)
423432 };
424433
425434 static const struct dcn_mpc_mask mpc_mask = {
426− MPC_COMMON_MASK_SH_LIST_DCN1_0(_MASK),
435+ MPC_COMMON_MASK_SH_LIST_DCN1_0(_MASK),\
436+ SFRB(CUR_VUPDATE_LOCK_SET, CUR0_VUPDATE_LOCK_SET0, CUR0_VUPDATE_LOCK_SET, _MASK)
427437 };
428438
429439 #define tg_regs(id)\
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c+2−1
@@ -2294,7 +2294,8 @@ void dcn20_fpga_init_hw(struct dc *dc) · 2293 unmodified lines
22942294
22952295 REG_UPDATE(DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_REFDIV, 2);
22962296 REG_UPDATE(DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_ENABLE, 1);
2297− REG_WRITE(REFCLK_CNTL, 0);
2297+ if (REG(REFCLK_CNTL))
2298+ REG_WRITE(REFCLK_CNTL, 0);
22982299 //
22992300
23002301
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c+1−0
@@ -52,6 +52,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = { · 51 unmodified lines
5252 .disable_plane = dcn20_disable_plane,
5353 .pipe_control_lock = dcn20_pipe_control_lock,
5454 .interdependent_update_lock = dcn10_lock_all_pipes,
55+ .cursor_lock = dcn10_cursor_lock,
5556 .prepare_bandwidth = dcn20_prepare_bandwidth,
5657 .optimize_bandwidth = dcn20_optimize_bandwidth,
5758 .update_bandwidth = dcn20_update_bandwidth,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c+1−0
@@ -545,6 +545,7 @@ const struct mpc_funcs dcn20_mpc_funcs = { · 544 unmodified lines
545545 .mpc_init = mpc1_mpc_init,
546546 .mpc_init_single_inst = mpc1_mpc_init_single_inst,
547547 .update_blending = mpc2_update_blending,
548+ .cursor_lock = mpc1_cursor_lock,
548549 .get_mpcc_for_dpp = mpc2_get_mpcc_for_dpp,
549550 .wait_for_idle = mpc2_assert_idle_mpcc,
550551 .assert_mpcc_idle_before_connect = mpc2_assert_mpcc_idle_before_connect,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.h+2−1
@@ -179,7 +179,8 @@ · 178 unmodified lines
179179 SF(MPC_OUT0_DENORM_CLAMP_G_Y, MPC_OUT_DENORM_CLAMP_MAX_G_Y, mask_sh),\
180180 SF(MPC_OUT0_DENORM_CLAMP_G_Y, MPC_OUT_DENORM_CLAMP_MIN_G_Y, mask_sh),\
181181 SF(MPC_OUT0_DENORM_CLAMP_B_CB, MPC_OUT_DENORM_CLAMP_MAX_B_CB, mask_sh),\
182− SF(MPC_OUT0_DENORM_CLAMP_B_CB, MPC_OUT_DENORM_CLAMP_MIN_B_CB, mask_sh)
182+ SF(MPC_OUT0_DENORM_CLAMP_B_CB, MPC_OUT_DENORM_CLAMP_MIN_B_CB, mask_sh),\
183+ SF(CUR_VUPDATE_LOCK_SET0, CUR_VUPDATE_LOCK_SET, mask_sh)
183184
184185 /*
185186 * DCN2 MPC_OCSC debug status register:
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c+27−8
@@ -508,6 +508,10 @@ enum dcn20_clk_src_array_id { · 507 unmodified lines
508508 .block ## _ ## reg_name[id] = BASE(mm ## block ## id ## _ ## reg_name ## _BASE_IDX) + \
509509 mm ## block ## id ## _ ## reg_name
510510
511+#define VUPDATE_SRII(reg_name, block, id)\
512+ .reg_name[id] = BASE(mm ## reg_name ## _ ## block ## id ## _BASE_IDX) + \
513+ mm ## reg_name ## _ ## block ## id
514+
511515 /* NBIO */
512516 #define NBIO_BASE_INNER(seg) \
513517 NBIO_BASE__INST0_SEG ## seg
@@ -3064,25 +3068,32 @@ validate_out: · 2550 unmodified lines
30643068 return out;
30653069 }
30663070
3067−
3068−bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context,
3069− bool fast_validate)
3071+/*
3072+ * This must be noinline to ensure anything that deals with FP registers
3073+ * is contained within this call; previously our compiling with hard-float
3074+ * would result in fp instructions being emitted outside of the boundaries
3075+ * of the DC_FP_START/END macros, which makes sense as the compiler has no
3076+ * idea about what is wrapped and what is not
3077+ *
3078+ * This is largely just a workaround to avoid breakage introduced with 5.6,
3079+ * ideally all fp-using code should be moved into its own file, only that
3080+ * should be compiled with hard-float, and all code exported from there
3081+ * should be strictly wrapped with DC_FP_START/END
3082+ */
3083+static noinline bool dcn20_validate_bandwidth_fp(struct dc *dc,
3084+ struct dc_state *context, bool fast_validate)
30703085 {
30713086 bool voltage_supported = false;
30723087 bool full_pstate_supported = false;
30733088 bool dummy_pstate_supported = false;
30743089 double p_state_latency_us;
30753090
3076− DC_FP_START();
30773091 p_state_latency_us = context->bw_ctx.dml.soc.dram_clock_change_latency_us;
30783092 context->bw_ctx.dml.soc.disable_dram_clock_change_vactive_support =
30793093 dc->debug.disable_dram_clock_change_vactive_support;
30803094
30813095 if (fast_validate) {
3082− voltage_supported = dcn20_validate_bandwidth_internal(dc, context, true);
3083−
3084− DC_FP_END();
3085− return voltage_supported;
3096+ return dcn20_validate_bandwidth_internal(dc, context, true);
30863097 }
30873098
30883099 // Best case, we support full UCLK switch latency
@@ -3111,7 +3122,15 @@ bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context, · 22 unmodified lines
31113122
31123123 restore_dml_state:
31133124 context->bw_ctx.dml.soc.dram_clock_change_latency_us = p_state_latency_us;
3125+ return voltage_supported;
3126+}
31143127
3128+bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context,
3129+ bool fast_validate)
3130+{
3131+ bool voltage_supported = false;
3132+ DC_FP_START();
3133+ voltage_supported = dcn20_validate_bandwidth_fp(dc, context, fast_validate);
31153134 DC_FP_END();
31163135 return voltage_supported;
31173136 }
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c+1−0
@@ -53,6 +53,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = { · 52 unmodified lines
5353 .disable_plane = dcn20_disable_plane,
5454 .pipe_control_lock = dcn20_pipe_control_lock,
5555 .interdependent_update_lock = dcn10_lock_all_pipes,
56+ .cursor_lock = dcn10_cursor_lock,
5657 .prepare_bandwidth = dcn20_prepare_bandwidth,
5758 .optimize_bandwidth = dcn20_optimize_bandwidth,
5859 .update_bandwidth = dcn20_update_bandwidth,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c+33−44
@@ -284,7 +284,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { · 283 unmodified lines
284284 .dram_channel_width_bytes = 4,
285285 .fabric_datapath_to_dcn_data_return_bytes = 32,
286286 .dcn_downspread_percent = 0.5,
287− .downspread_percent = 0.5,
287+ .downspread_percent = 0.38,
288288 .dram_page_open_time_ns = 50.0,
289289 .dram_rw_turnaround_time_ns = 17.5,
290290 .dram_return_buffer_per_channel_bytes = 8192,
@@ -340,6 +340,10 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { · 49 unmodified lines
340340 .block ## _ ## reg_name[id] = BASE(mm ## block ## id ## _ ## reg_name ## _BASE_IDX) + \
341341 mm ## block ## id ## _ ## reg_name
342342
343+#define VUPDATE_SRII(reg_name, block, id)\
344+ .reg_name[id] = BASE(mm ## reg_name ## _ ## block ## id ## _BASE_IDX) + \
345+ mm ## reg_name ## _ ## block ## id
346+
343347 /* NBIO */
344348 #define NBIO_BASE_INNER(seg) \
345349 NBIF0_BASE__INST0_SEG ## seg
@@ -1374,64 +1378,49 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param · 1028 unmodified lines
13741378 {
13751379 struct dcn21_resource_pool *pool = TO_DCN21_RES_POOL(dc->res_pool);
13761380 struct clk_limit_table *clk_table = &bw_params->clk_table;
1377− unsigned int i, j, k;
1378− int closest_clk_lvl;
1381+ struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
1382+ unsigned int i, j, closest_clk_lvl;
13791383
13801384 // Default clock levels are used for diags, which may lead to overclocking.
1381− if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment) && !IS_DIAG_DC(dc->ctx->dce_environment)) {
1385+ if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
13821386 dcn2_1_ip.max_num_otg = pool->base.res_cap->num_timing_generator;
13831387 dcn2_1_ip.max_num_dpp = pool->base.pipe_count;
13841388 dcn2_1_soc.num_chans = bw_params->num_channels;
13851389
1386− /* Vmin: leave lowest DCN clocks, override with dcfclk, fclk, memclk from fuse */
1387− dcn2_1_soc.clock_limits[0].state = 0;
1388− dcn2_1_soc.clock_limits[0].dcfclk_mhz = clk_table->entries[0].dcfclk_mhz;
1389− dcn2_1_soc.clock_limits[0].fabricclk_mhz = clk_table->entries[0].fclk_mhz;
1390− dcn2_1_soc.clock_limits[0].socclk_mhz = clk_table->entries[0].socclk_mhz;
1391− dcn2_1_soc.clock_limits[0].dram_speed_mts = clk_table->entries[0].memclk_mhz * 2;
1392−
1393− /*
1394− * Other levels: find closest DCN clocks that fit the given clock limit using dcfclk
1395− * as indicator
1396− */
1397−
1398− closest_clk_lvl = -1;
1399− /* index currently being filled */
1400− k = 1;
1401− for (i = 1; i < clk_table->num_entries; i++) {
1402− /* loop backwards, skip duplicate state*/
1403− for (j = dcn2_1_soc.num_states - 1; j >= k; j--) {
1390+ ASSERT(clk_table->num_entries);
1391+ for (i = 0; i < clk_table->num_entries; i++) {
1392+ /* loop backwards*/
1393+ for (closest_clk_lvl = 0, j = dcn2_1_soc.num_states - 1; j >= 0; j--) {
14041394 if ((unsigned int) dcn2_1_soc.clock_limits[j].dcfclk_mhz <= clk_table->entries[i].dcfclk_mhz) {
14051395 closest_clk_lvl = j;
14061396 break;
14071397 }
14081398 }
14091399
1410− /* if found a lvl that fits, use the DCN clks from it, if not, go to next clk limit*/
1411− if (closest_clk_lvl != -1) {
1412− dcn2_1_soc.clock_limits[k].state = i;
1413− dcn2_1_soc.clock_limits[k].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
1414− dcn2_1_soc.clock_limits[k].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
1415− dcn2_1_soc.clock_limits[k].socclk_mhz = clk_table->entries[i].socclk_mhz;
1416− dcn2_1_soc.clock_limits[k].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2;
1417−
1418− dcn2_1_soc.clock_limits[k].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
1419− dcn2_1_soc.clock_limits[k].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
1420− dcn2_1_soc.clock_limits[k].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
1421− dcn2_1_soc.clock_limits[k].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
1422− dcn2_1_soc.clock_limits[k].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
1423− dcn2_1_soc.clock_limits[k].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
1424− dcn2_1_soc.clock_limits[k].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
1425− k++;
1426− }
1400+ clock_limits[i].state = i;
1401+ clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
1402+ clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
1403+ clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
1404+ clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2;
1405+
1406+ clock_limits[i].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
1407+ clock_limits[i].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
1408+ clock_limits[i].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
1409+ clock_limits[i].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
1410+ clock_limits[i].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
1411+ clock_limits[i].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
1412+ clock_limits[i].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
1413+ }
1414+ for (i = 0; i < clk_table->num_entries; i++)
1415+ dcn2_1_soc.clock_limits[i] = clock_limits[i];
1416+ if (clk_table->num_entries) {
1417+ dcn2_1_soc.num_states = clk_table->num_entries;
1418+ /* duplicate last level */
1419+ dcn2_1_soc.clock_limits[dcn2_1_soc.num_states] = dcn2_1_soc.clock_limits[dcn2_1_soc.num_states - 1];
1420+ dcn2_1_soc.clock_limits[dcn2_1_soc.num_states].state = dcn2_1_soc.num_states;
14271421 }
1428− dcn2_1_soc.num_states = k;
14291422 }
14301423
1431− /* duplicate last level */
1432− dcn2_1_soc.clock_limits[dcn2_1_soc.num_states] = dcn2_1_soc.clock_limits[dcn2_1_soc.num_states - 1];
1433− dcn2_1_soc.clock_limits[dcn2_1_soc.num_states].state = dcn2_1_soc.num_states;
1434−
14351424 dml_init_instance(&dc->dml, &dcn2_1_soc, &dcn2_1_ip, DML_PROJECT_DCN21);
14361425 }
14371426
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c+4−4
@@ -1200,7 +1200,7 @@ static void dml_rq_dlg_get_dlg_params( · 1199 unmodified lines
12001200 min_hratio_fact_l = 1.0;
12011201 min_hratio_fact_c = 1.0;
12021202
1203− if (htaps_l <= 1)
1203+ if (hratio_l <= 1)
12041204 min_hratio_fact_l = 2.0;
12051205 else if (htaps_l <= 6) {
12061206 if ((hratio_l * 2.0) > 4.0)
@@ -1216,7 +1216,7 @@ static void dml_rq_dlg_get_dlg_params( · 9 unmodified lines
12161216
12171217 hscale_pixel_rate_l = min_hratio_fact_l * dppclk_freq_in_mhz;
12181218
1219− if (htaps_c <= 1)
1219+ if (hratio_c <= 1)
12201220 min_hratio_fact_c = 2.0;
12211221 else if (htaps_c <= 6) {
12221222 if ((hratio_c * 2.0) > 4.0)
@@ -1522,8 +1522,8 @@ static void dml_rq_dlg_get_dlg_params( · 299 unmodified lines
15221522
15231523 disp_dlg_regs->refcyc_per_vm_group_vblank = get_refcyc_per_vm_group_vblank(mode_lib, e2e_pipe_param, num_pipes, pipe_idx) * refclk_freq_in_mhz;
15241524 disp_dlg_regs->refcyc_per_vm_group_flip = get_refcyc_per_vm_group_flip(mode_lib, e2e_pipe_param, num_pipes, pipe_idx) * refclk_freq_in_mhz;
1525− disp_dlg_regs->refcyc_per_vm_req_vblank = get_refcyc_per_vm_req_vblank(mode_lib, e2e_pipe_param, num_pipes, pipe_idx) * refclk_freq_in_mhz;
1526− disp_dlg_regs->refcyc_per_vm_req_flip = get_refcyc_per_vm_req_flip(mode_lib, e2e_pipe_param, num_pipes, pipe_idx) * refclk_freq_in_mhz;
1525+ disp_dlg_regs->refcyc_per_vm_req_vblank = get_refcyc_per_vm_req_vblank(mode_lib, e2e_pipe_param, num_pipes, pipe_idx) * refclk_freq_in_mhz * dml_pow(2, 10);
1526+ disp_dlg_regs->refcyc_per_vm_req_flip = get_refcyc_per_vm_req_flip(mode_lib, e2e_pipe_param, num_pipes, pipe_idx) * refclk_freq_in_mhz * dml_pow(2, 10);
15271527
15281528 // Clamp to max for now
15291529 if (disp_dlg_regs->refcyc_per_vm_group_vblank >= (unsigned int)dml_pow(2, 23))
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h+16−0
@@ -210,6 +210,22 @@ struct mpc_funcs { · 209 unmodified lines
210210 struct mpcc_blnd_cfg *blnd_cfg,
211211 int mpcc_id);
212212
213+ /*
214+ * Lock cursor updates for the specified OPP.
215+ * OPP defines the set of MPCC that are locked together for cursor.
216+ *
217+ * Parameters:
218+ * [in] mpc - MPC context.
219+ * [in] opp_id - The OPP to lock cursor updates on
220+ * [in] lock - lock/unlock the OPP
221+ *
222+ * Return: void
223+ */
224+ void (*cursor_lock)(
225+ struct mpc *mpc,
226+ int opp_id,
227+ bool lock);
228+
213229 struct mpcc* (*get_mpcc_for_dpp)(
214230 struct mpc_tree *tree,
215231 int dpp_id);
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h+1−0
@@ -86,6 +86,7 @@ struct hw_sequencer_funcs { · 85 unmodified lines
8686 struct dc_state *context, bool lock);
8787 void (*set_flip_control_gsl)(struct pipe_ctx *pipe_ctx,
8888 bool flip_immediate);
89+ void (*cursor_lock)(struct dc *dc, struct pipe_ctx *pipe, bool lock);
8990
9091 /* Timing Related */
9192 void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
drivers/gpu/drm/amd/display/dc/os_types.h+1−1
@@ -108,7 +108,7 @@ · 107 unmodified lines
108108 #define ASSERT(expr) ASSERT_CRITICAL(expr)
109109
110110 #else
111−#define ASSERT(expr) WARN_ON(!(expr))
111+#define ASSERT(expr) WARN_ON_ONCE(!(expr))
112112 #endif
113113
114114 #define BREAK_TO_DEBUGGER() ASSERT(0)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c+5−4
@@ -1435,7 +1435,8 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap) · 1434 unmodified lines
14351435 if (!hwmgr)
14361436 return -EINVAL;
14371437
1438− if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_capability)
1438+ if (!(hwmgr->not_vf && amdgpu_dpm) ||
1439+ !hwmgr->hwmgr_func->get_asic_baco_capability)
14391440 return 0;
14401441
14411442 mutex_lock(&hwmgr->smu_lock);
@@ -1452,8 +1453,7 @@ static int pp_get_asic_baco_state(void *handle, int *state) · 10 unmodified lines
14521453 if (!hwmgr)
14531454 return -EINVAL;
14541455
1455− if (!(hwmgr->not_vf && amdgpu_dpm) ||
1456− !hwmgr->hwmgr_func->get_asic_baco_state)
1456+ if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_state)
14571457 return 0;
14581458
14591459 mutex_lock(&hwmgr->smu_lock);
@@ -1470,7 +1470,8 @@ static int pp_set_asic_baco_state(void *handle, int state) · 10 unmodified lines
14701470 if (!hwmgr)
14711471 return -EINVAL;
14721472
1473− if (!hwmgr->pm_en || !hwmgr->hwmgr_func->set_asic_baco_state)
1473+ if (!(hwmgr->not_vf && amdgpu_dpm) ||
1474+ !hwmgr->hwmgr_func->set_asic_baco_state)
14741475 return 0;
14751476
14761477 mutex_lock(&hwmgr->smu_lock);
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c+26−0
@@ -984,6 +984,32 @@ static int init_thermal_controller( · 983 unmodified lines
984984 struct pp_hwmgr *hwmgr,
985985 const ATOM_PPLIB_POWERPLAYTABLE *powerplay_table)
986986 {
987+ hwmgr->thermal_controller.ucType =
988+ powerplay_table->sThermalController.ucType;
989+ hwmgr->thermal_controller.ucI2cLine =
990+ powerplay_table->sThermalController.ucI2cLine;
991+ hwmgr->thermal_controller.ucI2cAddress =
992+ powerplay_table->sThermalController.ucI2cAddress;
993+
994+ hwmgr->thermal_controller.fanInfo.bNoFan =
995+ (0 != (powerplay_table->sThermalController.ucFanParameters &
996+ ATOM_PP_FANPARAMETERS_NOFAN));
997+
998+ hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution =
999+ powerplay_table->sThermalController.ucFanParameters &
1000+ ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK;
1001+
1002+ hwmgr->thermal_controller.fanInfo.ulMinRPM
1003+ = powerplay_table->sThermalController.ucFanMinRPM * 100UL;
1004+ hwmgr->thermal_controller.fanInfo.ulMaxRPM
1005+ = powerplay_table->sThermalController.ucFanMaxRPM * 100UL;
1006+
1007+ set_hw_cap(hwmgr,
1008+ ATOM_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType,
1009+ PHM_PlatformCaps_ThermalController);
1010+
1011+ hwmgr->thermal_controller.use_hw_fan_control = 1;
1012+
9871013 return 0;
9881014 }
9891015
drivers/gpu/drm/amd/powerplay/renoir_ppt.c+6−1
@@ -895,12 +895,17 @@ static int renoir_read_sensor(struct smu_context *smu, · 894 unmodified lines
895895
896896 static bool renoir_is_dpm_running(struct smu_context *smu)
897897 {
898+ struct amdgpu_device *adev = smu->adev;
899+
898900 /*
899901 * Util now, the pmfw hasn't exported the interface of SMU
900902 * feature mask to APU SKU so just force on all the feature
901903 * at early initial stage.
902904 */
903− return true;
905+ if (adev->in_suspend)
906+ return false;
907+ else
908+ return true;
904909
905910 }
906911
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c+3−0
@@ -485,6 +485,9 @@ static int anx6345_get_modes(struct drm_connector *connector) · 484 unmodified lines
485485
486486 num_modes += drm_add_edid_modes(connector, anx6345->edid);
487487
488+ /* Driver currently supports only 6bpc */
489+ connector->display_info.bpc = 6;
490+
488491 unlock:
489492 if (power_off)
490493 anx6345_poweroff(anx6345);
drivers/gpu/drm/drm_dp_mst_topology.c+7−2
@@ -3442,8 +3442,12 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, · 3441 unmodified lines
34423442 drm_dp_queue_down_tx(mgr, txmsg);
34433443
34443444 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
3445− if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
3446− ret = -EIO;
3445+ if (ret > 0) {
3446+ if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
3447+ ret = -EIO;
3448+ else
3449+ ret = size;
3450+ }
34473451
34483452 kfree(txmsg);
34493453 fail_put:
@@ -4295,6 +4299,7 @@ int drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state, · 845 unmodified lines
42954299 if (pos->vcpi) {
42964300 drm_dp_mst_put_port_malloc(port);
42974301 pos->vcpi = 0;
4302+ pos->pbn = 0;
42984303 }
42994304
43004305 return 0;
drivers/gpu/drm/drm_edid.c+1−1
@@ -5111,7 +5111,7 @@ static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *d · 5110 unmodified lines
51115111 struct drm_display_mode *mode;
51125112 unsigned pixel_clock = (timings->pixel_clock[0] |
51135113 (timings->pixel_clock[1] << 8) |
5114− (timings->pixel_clock[2] << 16));
5114+ (timings->pixel_clock[2] << 16)) + 1;
51155115 unsigned hactive = (timings->hactive[0] | timings->hactive[1] << 8) + 1;
51165116 unsigned hblank = (timings->hblank[0] | timings->hblank[1] << 8) + 1;
51175117 unsigned hsync = (timings->hsync[0] | (timings->hsync[1] & 0x7f) << 8) + 1;
drivers/gpu/drm/drm_hdcp.c+7−1
@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev, · 240 unmodified lines
241241
242242 ret = request_firmware_direct(&fw, (const char *)fw_name,
243243 drm_dev->dev);
244− if (ret < 0)
244+ if (ret < 0) {
245+ *revoked_ksv_cnt = 0;
246+ *revoked_ksv_list = NULL;
247+ ret = 0;
245248 goto exit;
249+ }
246250
247251 if (fw->size && fw->data)
248252 ret = drm_hdcp_srm_update(fw->data, fw->size, revoked_ksv_list,
@@ -287,6 +291,8 @@ int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · 38 unmodified lines
287291
288292 ret = drm_hdcp_request_srm(drm_dev, &revoked_ksv_list,
289293 &revoked_ksv_cnt);
294+ if (ret)
295+ return ret;
290296
291297 /* revoked_ksv_cnt will be zero when above function failed */
292298 for (i = 0; i < revoked_ksv_cnt; i++)
drivers/gpu/drm/i915/display/intel_ddi.c+11−3
@@ -3141,9 +3141,6 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, · 3140 unmodified lines
31413141 intel_dp_set_link_params(intel_dp, crtc_state->port_clock,
31423142 crtc_state->lane_count, is_mst);
31433143
3144− intel_dp->regs.dp_tp_ctl = DP_TP_CTL(port);
3145− intel_dp->regs.dp_tp_status = DP_TP_STATUS(port);
3146−
31473144 intel_edp_panel_on(intel_dp);
31483145
31493146 intel_ddi_clk_select(encoder, crtc_state);
@@ -3848,12 +3845,18 @@ void intel_ddi_get_config(struct intel_encoder *encoder, · 698 unmodified lines
38483845 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
38493846 struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
38503847 enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
3848+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
38513849 u32 temp, flags = 0;
38523850
38533851 /* XXX: DSI transcoder paranoia */
38543852 if (drm_WARN_ON(&dev_priv->drm, transcoder_is_dsi(cpu_transcoder)))
38553853 return;
38563854
3855+ if (INTEL_GEN(dev_priv) >= 12) {
3856+ intel_dp->regs.dp_tp_ctl = TGL_DP_TP_CTL(cpu_transcoder);
3857+ intel_dp->regs.dp_tp_status = TGL_DP_TP_STATUS(cpu_transcoder);
3858+ }
3859+
38573860 intel_dsc_get_config(encoder, pipe_config);
38583861
38593862 temp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder));
@@ -4173,6 +4176,7 @@ static const struct drm_encoder_funcs intel_ddi_funcs = { · 313 unmodified lines
41734176 static struct intel_connector *
41744177 intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port)
41754178 {
4179+ struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
41764180 struct intel_connector *connector;
41774181 enum port port = intel_dig_port->base.port;
41784182
@@ -4183,6 +4187,10 @@ intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port) · 4 unmodified lines
41834187 intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
41844188 intel_dig_port->dp.prepare_link_retrain =
41854189 intel_ddi_prepare_link_retrain;
4190+ if (INTEL_GEN(dev_priv) < 12) {
4191+ intel_dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
4192+ intel_dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
4193+ }
41864194
41874195 if (!intel_dp_init_connector(intel_dig_port, connector)) {
41884196 kfree(connector);
drivers/gpu/drm/i915/display/intel_display_power.c+6−6
@@ -4140,7 +4140,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = { · 4139 unmodified lines
41404140 {
41414141 .name = "AUX D TBT1",
41424142 .domains = TGL_AUX_D_TBT1_IO_POWER_DOMAINS,
4143− .ops = &hsw_power_well_ops,
4143+ .ops = &icl_tc_phy_aux_power_well_ops,
41444144 .id = DISP_PW_ID_NONE,
41454145 {
41464146 .hsw.regs = &icl_aux_power_well_regs,
@@ -4151,7 +4151,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = { · 4 unmodified lines
41514151 {
41524152 .name = "AUX E TBT2",
41534153 .domains = TGL_AUX_E_TBT2_IO_POWER_DOMAINS,
4154− .ops = &hsw_power_well_ops,
4154+ .ops = &icl_tc_phy_aux_power_well_ops,
41554155 .id = DISP_PW_ID_NONE,
41564156 {
41574157 .hsw.regs = &icl_aux_power_well_regs,
@@ -4162,7 +4162,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = { · 4 unmodified lines
41624162 {
41634163 .name = "AUX F TBT3",
41644164 .domains = TGL_AUX_F_TBT3_IO_POWER_DOMAINS,
4165− .ops = &hsw_power_well_ops,
4165+ .ops = &icl_tc_phy_aux_power_well_ops,
41664166 .id = DISP_PW_ID_NONE,
41674167 {
41684168 .hsw.regs = &icl_aux_power_well_regs,
@@ -4173,7 +4173,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = { · 4 unmodified lines
41734173 {
41744174 .name = "AUX G TBT4",
41754175 .domains = TGL_AUX_G_TBT4_IO_POWER_DOMAINS,
4176− .ops = &hsw_power_well_ops,
4176+ .ops = &icl_tc_phy_aux_power_well_ops,
41774177 .id = DISP_PW_ID_NONE,
41784178 {
41794179 .hsw.regs = &icl_aux_power_well_regs,
@@ -4184,7 +4184,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = { · 4 unmodified lines
41844184 {
41854185 .name = "AUX H TBT5",
41864186 .domains = TGL_AUX_H_TBT5_IO_POWER_DOMAINS,
4187− .ops = &hsw_power_well_ops,
4187+ .ops = &icl_tc_phy_aux_power_well_ops,
41884188 .id = DISP_PW_ID_NONE,
41894189 {
41904190 .hsw.regs = &icl_aux_power_well_regs,
@@ -4195,7 +4195,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = { · 4 unmodified lines
41954195 {
41964196 .name = "AUX I TBT6",
41974197 .domains = TGL_AUX_I_TBT6_IO_POWER_DOMAINS,
4198− .ops = &hsw_power_well_ops,
4198+ .ops = &icl_tc_phy_aux_power_well_ops,
41994199 .id = DISP_PW_ID_NONE,
42004200 {
42014201 .hsw.regs = &icl_aux_power_well_regs,
drivers/gpu/drm/i915/display/intel_dp.c+2−3
@@ -2517,9 +2517,6 @@ static void intel_dp_prepare(struct intel_encoder *encoder, · 2516 unmodified lines
25172517 intel_crtc_has_type(pipe_config,
25182518 INTEL_OUTPUT_DP_MST));
25192519
2520− intel_dp->regs.dp_tp_ctl = DP_TP_CTL(port);
2521− intel_dp->regs.dp_tp_status = DP_TP_STATUS(port);
2522−
25232520 /*
25242521 * There are four kinds of DP registers:
25252522 *
@@ -7836,6 +7833,8 @@ bool intel_dp_init(struct drm_i915_private *dev_priv, · 5310 unmodified lines
78367833
78377834 intel_dig_port->dp.output_reg = output_reg;
78387835 intel_dig_port->max_lanes = 4;
7836+ intel_dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
7837+ intel_dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
78397838
78407839 intel_encoder->type = INTEL_OUTPUT_DP;
78417840 intel_encoder->power_domain = intel_port_to_power_domain(port);
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c+1−0
@@ -342,6 +342,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector) · 341 unmodified lines
342342 */
343343 if (dev_priv->vbt.backlight.type !=
344344 INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
345+ i915_modparams.enable_dpcd_backlight != 1 &&
345346 !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
346347 DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
347348 DRM_DEV_INFO(dev->dev,
drivers/gpu/drm/i915/display/intel_hdmi.c+2−1
@@ -1536,7 +1536,8 @@ bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port) · 1535 unmodified lines
15361536 intel_de_write(i915, HDCP_RPRIME(i915, cpu_transcoder, port), ri.reg);
15371537
15381538 /* Wait for Ri prime match */
1539− if (wait_for(intel_de_read(i915, HDCP_STATUS(i915, cpu_transcoder, port)) &
1539+ if (wait_for((intel_de_read(i915, HDCP_STATUS(i915, cpu_transcoder, port)) &
1540+ (HDCP_STATUS_RI_MATCH | HDCP_STATUS_ENC)) ==
15401541 (HDCP_STATUS_RI_MATCH | HDCP_STATUS_ENC), 1)) {
15411542 DRM_ERROR("Ri' mismatch detected, link check failed (%x)\n",
15421543 intel_de_read(i915, HDCP_STATUS(i915, cpu_transcoder, port)));
drivers/gpu/drm/i915/display/intel_sprite.c+12−5
@@ -2817,19 +2817,25 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane, · 2816 unmodified lines
28172817 }
28182818 }
28192819
2820−static bool gen12_plane_supports_mc_ccs(enum plane_id plane_id)
2820+static bool gen12_plane_supports_mc_ccs(struct drm_i915_private *dev_priv,
2821+ enum plane_id plane_id)
28212822 {
2823+ /* Wa_14010477008:tgl[a0..c0] */
2824+ if (IS_TGL_REVID(dev_priv, TGL_REVID_A0, TGL_REVID_C0))
2825+ return false;
2826+
28222827 return plane_id < PLANE_SPRITE4;
28232828 }
28242829
28252830 static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
28262831 u32 format, u64 modifier)
28272832 {
2833+ struct drm_i915_private *dev_priv = to_i915(_plane->dev);
28282834 struct intel_plane *plane = to_intel_plane(_plane);
28292835
28302836 switch (modifier) {
28312837 case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
2832− if (!gen12_plane_supports_mc_ccs(plane->id))
2838+ if (!gen12_plane_supports_mc_ccs(dev_priv, plane->id))
28332839 return false;
28342840 /* fall through */
28352841 case DRM_FORMAT_MOD_LINEAR:
@@ -2998,9 +3004,10 @@ static const u32 *icl_get_plane_formats(struct drm_i915_private *dev_priv, · 162 unmodified lines
29983004 }
29993005 }
30003006
3001−static const u64 *gen12_get_plane_modifiers(enum plane_id plane_id)
3007+static const u64 *gen12_get_plane_modifiers(struct drm_i915_private *dev_priv,
3008+ enum plane_id plane_id)
30023009 {
3003− if (gen12_plane_supports_mc_ccs(plane_id))
3010+ if (gen12_plane_supports_mc_ccs(dev_priv, plane_id))
30043011 return gen12_plane_format_modifiers_mc_ccs;
30053012 else
30063013 return gen12_plane_format_modifiers_rc_ccs;
@@ -3070,7 +3077,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv, · 63 unmodified lines
30703077
30713078 plane->has_ccs = skl_plane_has_ccs(dev_priv, pipe, plane_id);
30723079 if (INTEL_GEN(dev_priv) >= 12) {
3073− modifiers = gen12_get_plane_modifiers(plane_id);
3080+ modifiers = gen12_get_plane_modifiers(dev_priv, plane_id);
30743081 plane_funcs = &gen12_plane_funcs;
30753082 } else {
30763083 if (plane->has_ccs)
drivers/gpu/drm/i915/gem/i915_gem_tiling.c+18−2
@@ -182,21 +182,35 @@ i915_gem_object_fence_prepare(struct drm_i915_gem_object *obj, · 181 unmodified lines
182182 int tiling_mode, unsigned int stride)
183183 {
184184 struct i915_ggtt *ggtt = &to_i915(obj->base.dev)->ggtt;
185− struct i915_vma *vma;
185+ struct i915_vma *vma, *vn;
186+ LIST_HEAD(unbind);
186187 int ret = 0;
187188
188189 if (tiling_mode == I915_TILING_NONE)
189190 return 0;
190191
191192 mutex_lock(&ggtt->vm.mutex);
193+
194+ spin_lock(&obj->vma.lock);
192195 for_each_ggtt_vma(vma, obj) {
196+ GEM_BUG_ON(vma->vm != &ggtt->vm);
197+
193198 if (i915_vma_fence_prepare(vma, tiling_mode, stride))
194199 continue;
195200
201+ list_move(&vma->vm_link, &unbind);
202+ }
203+ spin_unlock(&obj->vma.lock);
204+
205+ list_for_each_entry_safe(vma, vn, &unbind, vm_link) {
196206 ret = __i915_vma_unbind(vma);
197− if (ret)
207+ if (ret) {
208+ /* Restore the remaining vma on an error */
209+ list_splice(&unbind, &ggtt->vm.bound_list);
198210 break;
211+ }
199212 }
213+
200214 mutex_unlock(&ggtt->vm.mutex);
201215
202216 return ret;
@@ -268,6 +282,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj, · 65 unmodified lines
268282 }
269283 mutex_unlock(&obj->mm.lock);
270284
285+ spin_lock(&obj->vma.lock);
271286 for_each_ggtt_vma(vma, obj) {
272287 vma->fence_size =
273288 i915_gem_fence_size(i915, vma->size, tiling, stride);
@@ -278,6 +293,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj, · 4 unmodified lines
278293 if (vma->fence)
279294 vma->fence->dirty = true;
280295 }
296+ spin_unlock(&obj->vma.lock);
281297
282298 obj->tiling_and_stride = tiling | stride;
283299 i915_gem_object_unlock(obj);
drivers/gpu/drm/i915/gem/selftests/huge_pages.c+8−4
@@ -1477,8 +1477,10 @@ static int igt_ppgtt_pin_update(void *arg) · 1476 unmodified lines
14771477 unsigned int page_size = BIT(first);
14781478
14791479 obj = i915_gem_object_create_internal(dev_priv, page_size);
1480− if (IS_ERR(obj))
1481− return PTR_ERR(obj);
1480+ if (IS_ERR(obj)) {
1481+ err = PTR_ERR(obj);
1482+ goto out_vm;
1483+ }
14821484
14831485 vma = i915_vma_instance(obj, vm, NULL);
14841486 if (IS_ERR(vma)) {
@@ -1531,8 +1533,10 @@ static int igt_ppgtt_pin_update(void *arg) · 46 unmodified lines
15311533 }
15321534
15331535 obj = i915_gem_object_create_internal(dev_priv, PAGE_SIZE);
1534− if (IS_ERR(obj))
1535− return PTR_ERR(obj);
1536+ if (IS_ERR(obj)) {
1537+ err = PTR_ERR(obj);
1538+ goto out_vm;
1539+ }
15361540
15371541 vma = i915_vma_instance(obj, vm, NULL);
15381542 if (IS_ERR(vma)) {
drivers/gpu/drm/i915/gt/intel_rps.c+6−3
@@ -81,13 +81,14 @@ static void rps_enable_interrupts(struct intel_rps *rps) · 80 unmodified lines
8181 events = (GEN6_PM_RP_UP_THRESHOLD |
8282 GEN6_PM_RP_DOWN_THRESHOLD |
8383 GEN6_PM_RP_DOWN_TIMEOUT);
84−
8584 WRITE_ONCE(rps->pm_events, events);
85+
8686 spin_lock_irq(&gt->irq_lock);
8787 gen6_gt_pm_enable_irq(gt, rps->pm_events);
8888 spin_unlock_irq(&gt->irq_lock);
8989
90− set(gt->uncore, GEN6_PMINTRMSK, rps_pm_mask(rps, rps->cur_freq));
90+ intel_uncore_write(gt->uncore,
91+ GEN6_PMINTRMSK, rps_pm_mask(rps, rps->last_freq));
9192 }
9293
9394 static void gen6_rps_reset_interrupts(struct intel_rps *rps)
@@ -120,7 +121,9 @@ static void rps_disable_interrupts(struct intel_rps *rps) · 26 unmodified lines
120121 struct intel_gt *gt = rps_to_gt(rps);
121122
122123 WRITE_ONCE(rps->pm_events, 0);
123− set(gt->uncore, GEN6_PMINTRMSK, rps_pm_sanitize_mask(rps, ~0u));
124+
125+ intel_uncore_write(gt->uncore,
126+ GEN6_PMINTRMSK, rps_pm_sanitize_mask(rps, ~0u));
124127
125128 spin_lock_irq(&gt->irq_lock);
126129 gen6_gt_pm_disable_irq(gt, GEN6_PM_RPS_EVENTS);
drivers/gpu/drm/i915/gt/intel_timeline.c+2−0
@@ -521,6 +521,8 @@ int intel_timeline_read_hwsp(struct i915_request *from, · 520 unmodified lines
521521
522522 rcu_read_lock();
523523 cl = rcu_dereference(from->hwsp_cacheline);
524+ if (i915_request_completed(from)) /* confirm cacheline is valid */
525+ goto unlock;
524526 if (unlikely(!i915_active_acquire_if_busy(&cl->active)))
525527 goto unlock; /* seqno wrapped and completed! */
526528 if (unlikely(i915_request_completed(from)))
drivers/gpu/drm/i915/i915_drv.h+2−0
@@ -1507,6 +1507,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, · 1506 unmodified lines
15071507 (IS_ICELAKE(p) && IS_REVID(p, since, until))
15081508
15091509 #define TGL_REVID_A0 0x0
1510+#define TGL_REVID_B0 0x1
1511+#define TGL_REVID_C0 0x2
15101512
15111513 #define IS_TGL_REVID(p, since, until) \
15121514 (IS_TIGERLAKE(p) && IS_REVID(p, since, until))
drivers/gpu/drm/i915/i915_irq.c+2−4
@@ -3358,7 +3358,8 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) · 3357 unmodified lines
33583358 {
33593359 struct intel_uncore *uncore = &dev_priv->uncore;
33603360
3361− u32 de_pipe_masked = GEN8_PIPE_CDCLK_CRC_DONE;
3361+ u32 de_pipe_masked = gen8_de_pipe_fault_mask(dev_priv) |
3362+ GEN8_PIPE_CDCLK_CRC_DONE;
33623363 u32 de_pipe_enables;
33633364 u32 de_port_masked = GEN8_AUX_CHANNEL_A;
33643365 u32 de_port_enables;
@@ -3369,13 +3370,10 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) · 4 unmodified lines
33693370 de_misc_masked |= GEN8_DE_MISC_GSE;
33703371
33713372 if (INTEL_GEN(dev_priv) >= 9) {
3372− de_pipe_masked |= GEN9_DE_PIPE_IRQ_FAULT_ERRORS;
33733373 de_port_masked |= GEN9_AUX_CHANNEL_B | GEN9_AUX_CHANNEL_C |
33743374 GEN9_AUX_CHANNEL_D;
33753375 if (IS_GEN9_LP(dev_priv))
33763376 de_port_masked |= BXT_DE_PORT_GMBUS;
3377− } else {
3378− de_pipe_masked |= GEN8_DE_PIPE_IRQ_FAULT_ERRORS;
33793377 }
33803378
33813379 if (INTEL_GEN(dev_priv) >= 11)
drivers/gpu/drm/i915/i915_reg.h+2−2
@@ -34,8 +34,8 @@ · 33 unmodified lines
3434 * Follow the style described here for new macros, and while changing existing
3535 * macros. Do **not** mass change existing definitions just to update the style.
3636 *
37− * Layout
38− * ~~~~~~
37+ * File Layout
38+ * ~~~~~~~~~~~
3939 *
4040 * Keep helper macros near the top. For example, _PIPE() and friends.
4141 *
drivers/gpu/drm/i915/i915_vma.c+6−4
@@ -158,16 +158,18 @@ vma_create(struct drm_i915_gem_object *obj, · 157 unmodified lines
158158
159159 GEM_BUG_ON(!IS_ALIGNED(vma->size, I915_GTT_PAGE_SIZE));
160160
161+ spin_lock(&obj->vma.lock);
162+
161163 if (i915_is_ggtt(vm)) {
162164 if (unlikely(overflows_type(vma->size, u32)))
163− goto err_vma;
165+ goto err_unlock;
164166
165167 vma->fence_size = i915_gem_fence_size(vm->i915, vma->size,
166168 i915_gem_object_get_tiling(obj),
167169 i915_gem_object_get_stride(obj));
168170 if (unlikely(vma->fence_size < vma->size || /* overflow */
169171 vma->fence_size > vm->total))
170− goto err_vma;
172+ goto err_unlock;
171173
172174 GEM_BUG_ON(!IS_ALIGNED(vma->fence_size, I915_GTT_MIN_ALIGNMENT));
173175
@@ -179,8 +181,6 @@ vma_create(struct drm_i915_gem_object *obj, · 5 unmodified lines
179181 __set_bit(I915_VMA_GGTT_BIT, __i915_vma_flags(vma));
180182 }
181183
182− spin_lock(&obj->vma.lock);
183−
184184 rb = NULL;
185185 p = &obj->vma.tree.rb_node;
186186 while (*p) {
@@ -225,6 +225,8 @@ vma_create(struct drm_i915_gem_object *obj, · 38 unmodified lines
225225
226226 return vma;
227227
228+err_unlock:
229+ spin_unlock(&obj->vma.lock);
228230 err_vma:
229231 i915_vma_free(vma);
230232 return ERR_PTR(-E2BIG);
drivers/gpu/drm/ingenic/ingenic-drm.c+1−0
@@ -843,6 +843,7 @@ static const struct of_device_id ingenic_drm_of_match[] = { · 842 unmodified lines
843843 { .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
844844 { /* sentinel */ },
845845 };
846+MODULE_DEVICE_TABLE(of, ingenic_drm_of_match);
846847
847848 static struct platform_driver ingenic_drm_driver = {
848849 .driver = {
drivers/gpu/drm/meson/meson_dw_hdmi.c+1−3
@@ -1034,10 +1034,8 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, · 1033 unmodified lines
10341034 return PTR_ERR(dw_plat_data->regm);
10351035
10361036 irq = platform_get_irq(pdev, 0);
1037− if (irq < 0) {
1038− dev_err(dev, "Failed to get hdmi top irq\n");
1037+ if (irq < 0)
10391038 return irq;
1040− }
10411039
10421040 ret = devm_request_threaded_irq(dev, irq, dw_hdmi_top_irq,
10431041 dw_hdmi_top_thread_irq, IRQF_SHARED,
drivers/gpu/drm/qxl/qxl_cmd.c+5−5
@@ -480,9 +480,10 @@ int qxl_hw_surface_alloc(struct qxl_device *qdev, · 479 unmodified lines
480480 return ret;
481481
482482 ret = qxl_release_reserve_list(release, true);
483− if (ret)
483+ if (ret) {
484+ qxl_release_free(qdev, release);
484485 return ret;
485−
486+ }
486487 cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release);
487488 cmd->type = QXL_SURFACE_CMD_CREATE;
488489 cmd->flags = QXL_SURF_FLAG_KEEP_DATA;
@@ -499,8 +500,8 @@ int qxl_hw_surface_alloc(struct qxl_device *qdev, · 10 unmodified lines
499500 /* no need to add a release to the fence for this surface bo,
500501 since it is only released when we ask to destroy the surface
501502 and it would never signal otherwise */
502− qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false);
503503 qxl_release_fence_buffer_objects(release);
504+ qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false);
504505
505506 surf->hw_surf_alloc = true;
506507 spin_lock(&qdev->surf_id_idr_lock);
@@ -542,9 +543,8 @@ int qxl_hw_surface_dealloc(struct qxl_device *qdev, · 35 unmodified lines
542543 cmd->surface_id = id;
543544 qxl_release_unmap(qdev, release, &cmd->release_info);
544545
545− qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false);
546−
547546 qxl_release_fence_buffer_objects(release);
547+ qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false);
548548
549549 return 0;
550550 }
drivers/gpu/drm/qxl/qxl_display.c+3−3
@@ -510,8 +510,8 @@ static int qxl_primary_apply_cursor(struct drm_plane *plane) · 509 unmodified lines
510510 cmd->u.set.visible = 1;
511511 qxl_release_unmap(qdev, release, &cmd->release_info);
512512
513− qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
514513 qxl_release_fence_buffer_objects(release);
514+ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
515515
516516 return ret;
517517
@@ -652,8 +652,8 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 134 unmodified lines
652652 cmd->u.position.y = plane->state->crtc_y + fb->hot_y;
653653
654654 qxl_release_unmap(qdev, release, &cmd->release_info);
655− qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
656655 qxl_release_fence_buffer_objects(release);
656+ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
657657
658658 if (old_cursor_bo != NULL)
659659 qxl_bo_unpin(old_cursor_bo);
@@ -700,8 +700,8 @@ static void qxl_cursor_atomic_disable(struct drm_plane *plane, · 40 unmodified lines
700700 cmd->type = QXL_CURSOR_HIDE;
701701 qxl_release_unmap(qdev, release, &cmd->release_info);
702702
703− qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
704703 qxl_release_fence_buffer_objects(release);
704+ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
705705 }
706706
707707 static void qxl_update_dumb_head(struct qxl_device *qdev,
drivers/gpu/drm/qxl/qxl_draw.c+4−3
@@ -209,9 +209,10 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev, · 208 unmodified lines
209209 goto out_release_backoff;
210210
211211 rects = drawable_set_clipping(qdev, num_clips, clips_bo);
212− if (!rects)
212+ if (!rects) {
213+ ret = -EINVAL;
213214 goto out_release_backoff;
214−
215+ }
215216 drawable = (struct qxl_drawable *)qxl_release_map(qdev, release);
216217
217218 drawable->clip.type = SPICE_CLIP_TYPE_RECTS;
@@ -242,8 +243,8 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev, · 24 unmodified lines
242243 }
243244 qxl_bo_kunmap(clips_bo);
244245
245− qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false);
246246 qxl_release_fence_buffer_objects(release);
247+ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false);
247248
248249 out_release_backoff:
249250 if (ret)
drivers/gpu/drm/qxl/qxl_image.c+2−1
@@ -212,7 +212,8 @@ qxl_image_init_helper(struct qxl_device *qdev, · 211 unmodified lines
212212 break;
213213 default:
214214 DRM_ERROR("unsupported image bit depth\n");
215− return -EINVAL; /* TODO: cleanup */
215+ qxl_bo_kunmap_atomic_page(qdev, image_bo, ptr);
216+ return -EINVAL;
216217 }
217218 image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN;
218219 image->u.bitmap.x = width;
drivers/gpu/drm/qxl/qxl_ioctl.c+1−4
@@ -261,11 +261,8 @@ static int qxl_process_single_command(struct qxl_device *qdev, · 260 unmodified lines
261261 apply_surf_reloc(qdev, &reloc_info[i]);
262262 }
263263
264+ qxl_release_fence_buffer_objects(release);
264265 ret = qxl_push_command_ring_release(qdev, release, cmd->type, true);
265− if (ret)
266− qxl_release_backoff_reserve_list(release);
267− else
268− qxl_release_fence_buffer_objects(release);
269266
270267 out_free_bos:
271268 out_free_release:
drivers/gpu/drm/scheduler/sched_main.c+1−1
@@ -676,7 +676,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) · 675 unmodified lines
676676 */
677677 if ((sched->timeout != MAX_SCHEDULE_TIMEOUT &&
678678 !cancel_delayed_work(&sched->work_tdr)) ||
679− __kthread_should_park(sched->thread))
679+ kthread_should_park())
680680 return NULL;
681681
682682 spin_lock(&sched->job_list_lock);
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c+1−1
@@ -717,7 +717,7 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) · 716 unmodified lines
717717 struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
718718 struct sun6i_dsi *dsi = encoder_to_sun6i_dsi(encoder);
719719 struct mipi_dsi_device *device = dsi->device;
720− union phy_configure_opts opts = { 0 };
720+ union phy_configure_opts opts = { };
721721 struct phy_configure_opts_mipi_dphy *cfg = &opts.mipi_dphy;
722722 u16 delay;
723723 int err;
drivers/gpu/drm/tidss/tidss_crtc.c+13−3
@@ -379,9 +379,17 @@ static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc) · 378 unmodified lines
379379 return &state->base;
380380 }
381381
382+static void tidss_crtc_destroy(struct drm_crtc *crtc)
383+{
384+ struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
385+
386+ drm_crtc_cleanup(crtc);
387+ kfree(tcrtc);
388+}
389+
382390 static const struct drm_crtc_funcs tidss_crtc_funcs = {
383391 .reset = tidss_crtc_reset,
384− .destroy = drm_crtc_cleanup,
392+ .destroy = tidss_crtc_destroy,
385393 .set_config = drm_atomic_helper_set_config,
386394 .page_flip = drm_atomic_helper_page_flip,
387395 .atomic_duplicate_state = tidss_crtc_duplicate_state,
@@ -400,7 +408,7 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss, · 12 unmodified lines
400408 bool has_ctm = tidss->feat->vp_feat.color.has_ctm;
401409 int ret;
402410
403− tcrtc = devm_kzalloc(tidss->dev, sizeof(*tcrtc), GFP_KERNEL);
411+ tcrtc = kzalloc(sizeof(*tcrtc), GFP_KERNEL);
404412 if (!tcrtc)
405413 return ERR_PTR(-ENOMEM);
406414
@@ -411,8 +419,10 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss, · 4 unmodified lines
411419
412420 ret = drm_crtc_init_with_planes(&tidss->ddev, crtc, primary,
413421 NULL, &tidss_crtc_funcs, NULL);
414− if (ret < 0)
422+ if (ret < 0) {
423+ kfree(tcrtc);
415424 return ERR_PTR(ret);
425+ }
416426
417427 drm_crtc_helper_add(crtc, &tidss_crtc_helper_funcs);
418428
drivers/gpu/drm/tidss/tidss_encoder.c+11−3
@@ -55,12 +55,18 @@ static int tidss_encoder_atomic_check(struct drm_encoder *encoder, · 54 unmodified lines
5555 return 0;
5656 }
5757
58+static void tidss_encoder_destroy(struct drm_encoder *encoder)
59+{
60+ drm_encoder_cleanup(encoder);
61+ kfree(encoder);
62+}
63+
5864 static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
5965 .atomic_check = tidss_encoder_atomic_check,
6066 };
6167
6268 static const struct drm_encoder_funcs encoder_funcs = {
63− .destroy = drm_encoder_cleanup,
69+ .destroy = tidss_encoder_destroy,
6470 };
6571
6672 struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss,
@@ -69,7 +75,7 @@ struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss, · 2 unmodified lines
6975 struct drm_encoder *enc;
7076 int ret;
7177
72− enc = devm_kzalloc(tidss->dev, sizeof(*enc), GFP_KERNEL);
78+ enc = kzalloc(sizeof(*enc), GFP_KERNEL);
7379 if (!enc)
7480 return ERR_PTR(-ENOMEM);
7581
@@ -77,8 +83,10 @@ struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss, · 1 unmodified line
7783
7884 ret = drm_encoder_init(&tidss->ddev, enc, &encoder_funcs,
7985 encoder_type, NULL);
80− if (ret < 0)
86+ if (ret < 0) {
87+ kfree(enc);
8188 return ERR_PTR(ret);
89+ }
8290
8391 drm_encoder_helper_add(enc, &encoder_helper_funcs);
8492
drivers/gpu/drm/tidss/tidss_plane.c+18−6
@@ -141,6 +141,14 @@ static void tidss_plane_atomic_disable(struct drm_plane *plane, · 140 unmodified lines
141141 dispc_plane_enable(tidss->dispc, tplane->hw_plane_id, false);
142142 }
143143
144+static void drm_plane_destroy(struct drm_plane *plane)
145+{
146+ struct tidss_plane *tplane = to_tidss_plane(plane);
147+
148+ drm_plane_cleanup(plane);
149+ kfree(tplane);
150+}
151+
144152 static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
145153 .atomic_check = tidss_plane_atomic_check,
146154 .atomic_update = tidss_plane_atomic_update,
@@ -151,7 +159,7 @@ static const struct drm_plane_funcs tidss_plane_funcs = { · 4 unmodified lines
151159 .update_plane = drm_atomic_helper_update_plane,
152160 .disable_plane = drm_atomic_helper_disable_plane,
153161 .reset = drm_atomic_helper_plane_reset,
154− .destroy = drm_plane_cleanup,
162+ .destroy = drm_plane_destroy,
155163 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
156164 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
157165 };
@@ -175,7 +183,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, · 17 unmodified lines
175183 BIT(DRM_MODE_BLEND_COVERAGE));
176184 int ret;
177185
178− tplane = devm_kzalloc(tidss->dev, sizeof(*tplane), GFP_KERNEL);
186+ tplane = kzalloc(sizeof(*tplane), GFP_KERNEL);
179187 if (!tplane)
180188 return ERR_PTR(-ENOMEM);
181189
@@ -190,7 +198,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, · 8 unmodified lines
190198 formats, num_formats,
191199 NULL, type, NULL);
192200 if (ret < 0)
193− return ERR_PTR(ret);
201+ goto err;
194202
195203 drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs);
196204
@@ -203,15 +211,19 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, · 6 unmodified lines
203211 default_encoding,
204212 default_range);
205213 if (ret)
206− return ERR_PTR(ret);
214+ goto err;
207215
208216 ret = drm_plane_create_alpha_property(&tplane->plane);
209217 if (ret)
210− return ERR_PTR(ret);
218+ goto err;
211219
212220 ret = drm_plane_create_blend_mode_property(&tplane->plane, blend_modes);
213221 if (ret)
214− return ERR_PTR(ret);
222+ goto err;
215223
216224 return tplane;
225+
226+err:
227+ kfree(tplane);
228+ return ERR_PTR(ret);
217229 }
drivers/gpu/drm/virtio/virtgpu_drv.h+1−0
@@ -221,6 +221,7 @@ struct virtio_gpu_fpriv { · 220 unmodified lines
221221 /* virtio_ioctl.c */
222222 #define DRM_VIRTIO_NUM_IOCTLS 10
223223 extern struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS];
224+void virtio_gpu_create_context(struct drm_device *dev, struct drm_file *file);
224225
225226 /* virtio_kms.c */
226227 int virtio_gpu_init(struct drm_device *dev);
drivers/gpu/drm/virtio/virtgpu_gem.c+3−0
@@ -39,6 +39,9 @@ int virtio_gpu_gem_create(struct drm_file *file, · 38 unmodified lines
3939 int ret;
4040 u32 handle;
4141
42+ if (vgdev->has_virgl_3d)
43+ virtio_gpu_create_context(dev, file);
44+
4245 ret = virtio_gpu_object_create(vgdev, params, &obj, NULL);
4346 if (ret < 0)
4447 return ret;
drivers/gpu/drm/virtio/virtgpu_ioctl.c+2−2
@@ -27,14 +27,14 @@ · 26 unmodified lines
2727
2828 #include <linux/file.h>
2929 #include <linux/sync_file.h>
30+#include <linux/uaccess.h>
3031
3132 #include <drm/drm_file.h>
3233 #include <drm/virtgpu_drm.h>
3334
3435 #include "virtgpu_drv.h"
3536
36−static void virtio_gpu_create_context(struct drm_device *dev,
37− struct drm_file *file)
37+void virtio_gpu_create_context(struct drm_device *dev, struct drm_file *file)
3838 {
3939 struct virtio_gpu_device *vgdev = dev->dev_private;
4040 struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
drivers/gpu/drm/virtio/virtgpu_kms.c+7−11
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #include <linux/virtio.h>
2727 #include <linux/virtio_config.h>
28+#include <linux/virtio_ring.h>
2829
2930 #include <drm/drm_file.h>
3031
@@ -52,14 +53,6 @@ static void virtio_gpu_config_changed_work_func(struct work_struct *work) · 21 unmodified lines
5253 events_clear, &events_clear);
5354 }
5455
55−static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev,
56− uint32_t ctx_id)
57−{
58− virtio_gpu_cmd_context_destroy(vgdev, ctx_id);
59− virtio_gpu_notify(vgdev);
60− ida_free(&vgdev->ctx_id_ida, ctx_id - 1);
61−}
62−
6356 static void virtio_gpu_init_vq(struct virtio_gpu_queue *vgvq,
6457 void (*work_func)(struct work_struct *work))
6558 {
@@ -274,14 +267,17 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) · 208 unmodified lines
274267 void virtio_gpu_driver_postclose(struct drm_device *dev, struct drm_file *file)
275268 {
276269 struct virtio_gpu_device *vgdev = dev->dev_private;
277− struct virtio_gpu_fpriv *vfpriv;
270+ struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
278271
279272 if (!vgdev->has_virgl_3d)
280273 return;
281274
282− vfpriv = file->driver_priv;
275+ if (vfpriv->context_created) {
276+ virtio_gpu_cmd_context_destroy(vgdev, vfpriv->ctx_id);
277+ virtio_gpu_notify(vgdev);
278+ }
283279
284− virtio_gpu_context_destroy(vgdev, vfpriv->ctx_id);
280+ ida_free(&vgdev->ctx_id_ida, vfpriv->ctx_id - 1);
285281 mutex_destroy(&vfpriv->context_lock);
286282 kfree(vfpriv);
287283 file->driver_priv = NULL;
drivers/hid/Kconfig+1−0
@@ -1155,6 +1155,7 @@ config HID_ALPS · 1154 unmodified lines
11551155 config HID_MCP2221
11561156 tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
11571157 depends on USB_HID && I2C
1158+ depends on GPIOLIB
11581159 ---help---
11591160 Provides I2C and SMBUS host adapter functionality over USB-HID
11601161 through MCP2221 device.
drivers/hid/hid-alps.c+1−0
@@ -802,6 +802,7 @@ static int alps_probe(struct hid_device *hdev, const struct hid_device_id *id) · 801 unmodified lines
802802 break;
803803 case HID_DEVICE_ID_ALPS_U1_DUAL:
804804 case HID_DEVICE_ID_ALPS_U1:
805+ case HID_DEVICE_ID_ALPS_U1_UNICORN_LEGACY:
805806 data->dev_type = U1;
806807 break;
807808 default:
drivers/hid/hid-ids.h+7−1
@@ -79,10 +79,10 @@ · 78 unmodified lines
7979 #define HID_DEVICE_ID_ALPS_U1_DUAL_PTP 0x121F
8080 #define HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP 0x1220
8181 #define HID_DEVICE_ID_ALPS_U1 0x1215
82+#define HID_DEVICE_ID_ALPS_U1_UNICORN_LEGACY 0x121E
8283 #define HID_DEVICE_ID_ALPS_T4_BTNLESS 0x120C
8384 #define HID_DEVICE_ID_ALPS_1222 0x1222
8485
85−
8686 #define USB_VENDOR_ID_AMI 0x046b
8787 #define USB_DEVICE_ID_AMI_VIRT_KEYBOARD_AND_MOUSE 0xff10
8888
@@ -385,6 +385,7 @@ · 296 unmodified lines
385385 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349 0x7349
386386 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_73F7 0x73f7
387387 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001
388+#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002 0xc002
388389
389390 #define USB_VENDOR_ID_ELAN 0x04f3
390391 #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401
@@ -759,6 +760,7 @@ · 368 unmodified lines
759760 #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2 0xc218
760761 #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2 0xc219
761762 #define USB_DEVICE_ID_LOGITECH_G15_LCD 0xc222
763+#define USB_DEVICE_ID_LOGITECH_G11 0xc225
762764 #define USB_DEVICE_ID_LOGITECH_G15_V2_LCD 0xc227
763765 #define USB_DEVICE_ID_LOGITECH_G510 0xc22d
764766 #define USB_DEVICE_ID_LOGITECH_G510_USB_AUDIO 0xc22e
@@ -1097,6 +1099,9 @@ · 332 unmodified lines
10971099 #define USB_DEVICE_ID_SYMBOL_SCANNER_2 0x1300
10981100 #define USB_DEVICE_ID_SYMBOL_SCANNER_3 0x1200
10991101
1102+#define I2C_VENDOR_ID_SYNAPTICS 0x06cb
1103+#define I2C_PRODUCT_ID_SYNAPTICS_SYNA2393 0x7a13
1104+
11001105 #define USB_VENDOR_ID_SYNAPTICS 0x06cb
11011106 #define USB_DEVICE_ID_SYNAPTICS_TP 0x0001
11021107 #define USB_DEVICE_ID_SYNAPTICS_INT_TP 0x0002
@@ -1111,6 +1116,7 @@ · 8 unmodified lines
11111116 #define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10
11121117 #define USB_DEVICE_ID_SYNAPTICS_HD 0x0ac3
11131118 #define USB_DEVICE_ID_SYNAPTICS_QUAD_HD 0x1ac3
1119+#define USB_DEVICE_ID_SYNAPTICS_DELL_K12A 0x2819
11141120 #define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968
11151121 #define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710
11161122 #define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7
drivers/hid/hid-lg-g15.c+4−0
@@ -872,6 +872,10 @@ error_hw_stop: · 871 unmodified lines
872872 }
873873
874874 static const struct hid_device_id lg_g15_devices[] = {
875+ /* The G11 is a G15 without the LCD, treat it as a G15 */
876+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
877+ USB_DEVICE_ID_LOGITECH_G11),
878+ .driver_data = LG_G15 },
875879 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
876880 USB_DEVICE_ID_LOGITECH_G15_LCD),
877881 .driver_data = LG_G15 },
drivers/hid/hid-multitouch.c+3−0
@@ -1922,6 +1922,9 @@ static const struct hid_device_id mt_devices[] = { · 1921 unmodified lines
19221922 { .driver_data = MT_CLS_EGALAX_SERIAL,
19231923 MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
19241924 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001) },
1925+ { .driver_data = MT_CLS_EGALAX,
1926+ MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
1927+ USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002) },
19251928
19261929 /* Elitegroup panel */
19271930 { .driver_data = MT_CLS_SERIAL,
drivers/hid/hid-quirks.c+1−0
@@ -163,6 +163,7 @@ static const struct hid_device_id hid_quirks[] = { · 162 unmodified lines
163163 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS2), HID_QUIRK_NO_INIT_REPORTS },
164164 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_QUAD_HD), HID_QUIRK_NO_INIT_REPORTS },
165165 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP_V103), HID_QUIRK_NO_INIT_REPORTS },
166+ { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_DELL_K12A), HID_QUIRK_NO_INIT_REPORTS },
166167 { HID_USB_DEVICE(USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD), HID_QUIRK_BADPAD },
167168 { HID_USB_DEVICE(USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS), HID_QUIRK_MULTI_INPUT },
168169 { HID_USB_DEVICE(USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882), HID_QUIRK_NOGET },
drivers/hid/i2c-hid/i2c-hid-core.c+2−0
@@ -177,6 +177,8 @@ static const struct i2c_hid_quirks { · 176 unmodified lines
177177 I2C_HID_QUIRK_BOGUS_IRQ },
178178 { USB_VENDOR_ID_ALPS_JP, HID_ANY_ID,
179179 I2C_HID_QUIRK_RESET_ON_RESUME },
180+ { I2C_VENDOR_ID_SYNAPTICS, I2C_PRODUCT_ID_SYNAPTICS_SYNA2393,
181+ I2C_HID_QUIRK_RESET_ON_RESUME },
180182 { USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720,
181183 I2C_HID_QUIRK_BAD_INPUT_SIZE },
182184 { 0, 0 }
drivers/hid/usbhid/hid-core.c+29−8
@@ -682,16 +682,21 @@ static int usbhid_open(struct hid_device *hid) · 681 unmodified lines
682682 struct usbhid_device *usbhid = hid->driver_data;
683683 int res;
684684
685+ mutex_lock(&usbhid->mutex);
686+
685687 set_bit(HID_OPENED, &usbhid->iofl);
686688
687− if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
688− return 0;
689+ if (hid->quirks & HID_QUIRK_ALWAYS_POLL) {
690+ res = 0;
691+ goto Done;
692+ }
689693
690694 res = usb_autopm_get_interface(usbhid->intf);
691695 /* the device must be awake to reliably request remote wakeup */
692696 if (res < 0) {
693697 clear_bit(HID_OPENED, &usbhid->iofl);
694− return -EIO;
698+ res = -EIO;
699+ goto Done;
695700 }
696701
697702 usbhid->intf->needs_remote_wakeup = 1;
@@ -725,6 +730,9 @@ static int usbhid_open(struct hid_device *hid) · 27 unmodified lines
725730 msleep(50);
726731
727732 clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);
733+
734+ Done:
735+ mutex_unlock(&usbhid->mutex);
728736 return res;
729737 }
730738
@@ -732,6 +740,8 @@ static void usbhid_close(struct hid_device *hid) · 1 unmodified line
732740 {
733741 struct usbhid_device *usbhid = hid->driver_data;
734742
743+ mutex_lock(&usbhid->mutex);
744+
735745 /*
736746 * Make sure we don't restart data acquisition due to
737747 * a resumption we no longer care about by avoiding racing
@@ -743,12 +753,13 @@ static void usbhid_close(struct hid_device *hid) · 5 unmodified lines
743753 clear_bit(HID_IN_POLLING, &usbhid->iofl);
744754 spin_unlock_irq(&usbhid->lock);
745755
746− if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
747− return;
756+ if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL)) {
757+ hid_cancel_delayed_stuff(usbhid);
758+ usb_kill_urb(usbhid->urbin);
759+ usbhid->intf->needs_remote_wakeup = 0;
760+ }
748761
749− hid_cancel_delayed_stuff(usbhid);
750− usb_kill_urb(usbhid->urbin);
751− usbhid->intf->needs_remote_wakeup = 0;
762+ mutex_unlock(&usbhid->mutex);
752763 }
753764
754765 /*
@@ -1057,6 +1068,8 @@ static int usbhid_start(struct hid_device *hid) · 302 unmodified lines
10571068 unsigned int n, insize = 0;
10581069 int ret;
10591070
1071+ mutex_lock(&usbhid->mutex);
1072+
10601073 clear_bit(HID_DISCONNECTED, &usbhid->iofl);
10611074
10621075 usbhid->bufsize = HID_MIN_BUFFER_SIZE;
@@ -1177,6 +1190,8 @@ static int usbhid_start(struct hid_device *hid) · 114 unmodified lines
11771190 usbhid_set_leds(hid);
11781191 device_set_wakeup_enable(&dev->dev, 1);
11791192 }
1193+
1194+ mutex_unlock(&usbhid->mutex);
11801195 return 0;
11811196
11821197 fail:
@@ -1187,6 +1202,7 @@ fail: · 4 unmodified lines
11871202 usbhid->urbout = NULL;
11881203 usbhid->urbctrl = NULL;
11891204 hid_free_buffers(dev, hid);
1205+ mutex_unlock(&usbhid->mutex);
11901206 return ret;
11911207 }
11921208
@@ -1202,6 +1218,8 @@ static void usbhid_stop(struct hid_device *hid) · 9 unmodified lines
12021218 usbhid->intf->needs_remote_wakeup = 0;
12031219 }
12041220
1221+ mutex_lock(&usbhid->mutex);
1222+
12051223 clear_bit(HID_STARTED, &usbhid->iofl);
12061224 spin_lock_irq(&usbhid->lock); /* Sync with error and led handlers */
12071225 set_bit(HID_DISCONNECTED, &usbhid->iofl);
@@ -1222,6 +1240,8 @@ static void usbhid_stop(struct hid_device *hid) · 14 unmodified lines
12221240 usbhid->urbout = NULL;
12231241
12241242 hid_free_buffers(hid_to_usb_dev(hid), hid);
1243+
1244+ mutex_unlock(&usbhid->mutex);
12251245 }
12261246
12271247 static int usbhid_power(struct hid_device *hid, int lvl)
@@ -1382,6 +1402,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * · 154 unmodified lines
13821402 INIT_WORK(&usbhid->reset_work, hid_reset);
13831403 timer_setup(&usbhid->io_retry, hid_retry_timeout, 0);
13841404 spin_lock_init(&usbhid->lock);
1405+ mutex_init(&usbhid->mutex);
13851406
13861407 ret = hid_add_device(hid);
13871408 if (ret) {
drivers/hid/usbhid/usbhid.h+1−0
@@ -80,6 +80,7 @@ struct usbhid_device { · 79 unmodified lines
8080 dma_addr_t outbuf_dma; /* Output buffer dma */
8181 unsigned long last_out; /* record of last output for timeouts */
8282
83+ struct mutex mutex; /* start/stop/open/close */
8384 spinlock_t lock; /* fifo spinlock */
8485 unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
8586 struct timer_list io_retry; /* Retry timer */
drivers/hid/wacom_sys.c+3−1
@@ -319,9 +319,11 @@ static void wacom_feature_mapping(struct hid_device *hdev, · 318 unmodified lines
319319 data[0] = field->report->id;
320320 ret = wacom_get_report(hdev, HID_FEATURE_REPORT,
321321 data, n, WAC_CMD_RETRIES);
322− if (ret == n) {
322+ if (ret == n && features->type == HID_GENERIC) {
323323 ret = hid_report_raw_event(hdev,
324324 HID_FEATURE_REPORT, data, n, 0);
325+ } else if (ret == 2 && features->type != HID_GENERIC) {
326+ features->touch_max = data[1];
325327 } else {
326328 features->touch_max = 16;
327329 hid_warn(hdev, "wacom_feature_mapping: "
drivers/hid/wacom_wac.c+22−66
@@ -1427,11 +1427,13 @@ static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) · 1426 unmodified lines
14271427 {
14281428 struct input_dev *pad_input = wacom->pad_input;
14291429 unsigned char *data = wacom->data;
1430+ int nbuttons = wacom->features.numbered_buttons;
14301431
1431− int buttons = data[282] | ((data[281] & 0x40) << 2);
1432+ int expresskeys = data[282];
1433+ int center = (data[281] & 0x40) >> 6;
14321434 int ring = data[285] & 0x7F;
14331435 bool ringstatus = data[285] & 0x80;
1434− bool prox = buttons || ringstatus;
1436+ bool prox = expresskeys || center || ringstatus;
14351437
14361438 /* Fix touchring data: userspace expects 0 at left and increasing clockwise */
14371439 ring = 71 - ring;
@@ -1439,7 +1441,8 @@ static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) · 1 unmodified line
14391441 if (ring > 71)
14401442 ring -= 72;
14411443
1442− wacom_report_numbered_buttons(pad_input, 9, buttons);
1444+ wacom_report_numbered_buttons(pad_input, nbuttons,
1445+ expresskeys | (center << (nbuttons - 1)));
14431446
14441447 input_report_abs(pad_input, ABS_WHEEL, ringstatus ? ring : 0);
14451448
@@ -2637,9 +2640,25 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev, · 1191 unmodified lines
26372640 case HID_DG_TIPSWITCH:
26382641 hid_data->last_slot_field = equivalent_usage;
26392642 break;
2643+ case HID_DG_CONTACTCOUNT:
2644+ hid_data->cc_report = report->id;
2645+ hid_data->cc_index = i;
2646+ hid_data->cc_value_index = j;
2647+ break;
26402648 }
26412649 }
26422650 }
2651+
2652+ if (hid_data->cc_report != 0 &&
2653+ hid_data->cc_index >= 0) {
2654+ struct hid_field *field = report->field[hid_data->cc_index];
2655+ int value = field->value[hid_data->cc_value_index];
2656+ if (value)
2657+ hid_data->num_expected = value;
2658+ }
2659+ else {
2660+ hid_data->num_expected = wacom_wac->features.touch_max;
2661+ }
26432662 }
26442663
26452664 static void wacom_wac_finger_report(struct hid_device *hdev,
@@ -2649,7 +2668,6 @@ static void wacom_wac_finger_report(struct hid_device *hdev, · 3 unmodified lines
26492668 struct wacom_wac *wacom_wac = &wacom->wacom_wac;
26502669 struct input_dev *input = wacom_wac->touch_input;
26512670 unsigned touch_max = wacom_wac->features.touch_max;
2652− struct hid_data *hid_data = &wacom_wac->hid_data;
26532671
26542672 /* If more packets of data are expected, give us a chance to
26552673 * process them rather than immediately syncing a partial
@@ -2663,7 +2681,6 @@ static void wacom_wac_finger_report(struct hid_device *hdev, · 7 unmodified lines
26632681
26642682 input_sync(input);
26652683 wacom_wac->hid_data.num_received = 0;
2666− hid_data->num_expected = 0;
26672684
26682685 /* keep touch state for pen event */
26692686 wacom_wac->shared->touch_down = wacom_wac_finger_count_touches(wacom_wac);
@@ -2738,73 +2755,12 @@ static void wacom_report_events(struct hid_device *hdev, · 68 unmodified lines
27382755 }
27392756 }
27402757
2741−static void wacom_set_num_expected(struct hid_device *hdev,
2742− struct hid_report *report,
2743− int collection_index,
2744− struct hid_field *field,
2745− int field_index)
2746−{
2747− struct wacom *wacom = hid_get_drvdata(hdev);
2748− struct wacom_wac *wacom_wac = &wacom->wacom_wac;
2749− struct hid_data *hid_data = &wacom_wac->hid_data;
2750− unsigned int original_collection_level =
2751− hdev->collection[collection_index].level;
2752− bool end_collection = false;
2753− int i;
2754−
2755− if (hid_data->num_expected)
2756− return;
2757−
2758− // find the contact count value for this segment
2759− for (i = field_index; i < report->maxfield && !end_collection; i++) {
2760− struct hid_field *field = report->field[i];
2761− unsigned int field_level =
2762− hdev->collection[field->usage[0].collection_index].level;
2763− unsigned int j;
2764−
2765− if (field_level != original_collection_level)
2766− continue;
2767−
2768− for (j = 0; j < field->maxusage; j++) {
2769− struct hid_usage *usage = &field->usage[j];
2770−
2771− if (usage->collection_index != collection_index) {
2772− end_collection = true;
2773− break;
2774− }
2775− if (wacom_equivalent_usage(usage->hid) == HID_DG_CONTACTCOUNT) {
2776− hid_data->cc_report = report->id;
2777− hid_data->cc_index = i;
2778− hid_data->cc_value_index = j;
2779−
2780− if (hid_data->cc_report != 0 &&
2781− hid_data->cc_index >= 0) {
2782−
2783− struct hid_field *field =
2784− report->field[hid_data->cc_index];
2785− int value =
2786− field->value[hid_data->cc_value_index];
2787−
2788− if (value)
2789− hid_data->num_expected = value;
2790− }
2791− }
2792− }
2793− }
2794−
2795− if (hid_data->cc_report == 0 || hid_data->cc_index < 0)
2796− hid_data->num_expected = wacom_wac->features.touch_max;
2797−}
2798−
27992758 static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *report,
28002759 int collection_index, struct hid_field *field,
28012760 int field_index)
28022761 {
28032762 struct wacom *wacom = hid_get_drvdata(hdev);
28042763
2805− if (WACOM_FINGER_FIELD(field))
2806− wacom_set_num_expected(hdev, report, collection_index, field,
2807− field_index);
28082764 wacom_report_events(hdev, report, collection_index, field_index);
28092765
28102766 /*
drivers/hv/hv.c+1−5
@@ -184,11 +184,7 @@ void hv_synic_enable_regs(unsigned int cpu) · 183 unmodified lines
184184
185185 shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR;
186186 shared_sint.masked = false;
187− if (ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED)
188− shared_sint.auto_eoi = false;
189− else
190− shared_sint.auto_eoi = true;
191−
187+ shared_sint.auto_eoi = hv_recommend_using_aeoi();
192188 hv_set_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
193189
194190 /* Enable the global synic bit */
drivers/hv/hv_trace.h+2−2
@@ -286,8 +286,8 @@ TRACE_EVENT(vmbus_send_tl_connect_request, · 285 unmodified lines
286286 __field(int, ret)
287287 ),
288288 TP_fast_assign(
289− memcpy(__entry->guest_id, &msg->guest_endpoint_id.b, 16);
290− memcpy(__entry->host_id, &msg->host_service_id.b, 16);
289+ export_guid(__entry->guest_id, &msg->guest_endpoint_id);
290+ export_guid(__entry->host_id, &msg->host_service_id);
291291 __entry->ret = ret;
292292 ),
293293 TP_printk("sending guest_endpoint_id %pUl, host_service_id %pUl, "
drivers/hv/vmbus_drv.c+34−9
@@ -978,6 +978,9 @@ static int vmbus_resume(struct device *child_device) · 977 unmodified lines
978978
979979 return drv->resume(dev);
980980 }
981+#else
982+#define vmbus_suspend NULL
983+#define vmbus_resume NULL
981984 #endif /* CONFIG_PM_SLEEP */
982985
983986 /*
@@ -997,11 +1000,22 @@ static void vmbus_device_release(struct device *device) · 13 unmodified lines
9971000 }
9981001
9991002 /*
1000− * Note: we must use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS rather than
1001− * SET_SYSTEM_SLEEP_PM_OPS: see the comment before vmbus_bus_pm.
1003+ * Note: we must use the "noirq" ops: see the comment before vmbus_bus_pm.
1004+ *
1005+ * suspend_noirq/resume_noirq are set to NULL to support Suspend-to-Idle: we
1006+ * shouldn't suspend the vmbus devices upon Suspend-to-Idle, otherwise there
1007+ * is no way to wake up a Generation-2 VM.
1008+ *
1009+ * The other 4 ops are for hibernation.
10021010 */
1011+
10031012 static const struct dev_pm_ops vmbus_pm = {
1004− SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(vmbus_suspend, vmbus_resume)
1013+ .suspend_noirq = NULL,
1014+ .resume_noirq = NULL,
1015+ .freeze_noirq = vmbus_suspend,
1016+ .thaw_noirq = vmbus_resume,
1017+ .poweroff_noirq = vmbus_suspend,
1018+ .restore_noirq = vmbus_resume,
10051019 };
10061020
10071021 /* The one and only one */
@@ -2281,6 +2295,9 @@ static int vmbus_bus_resume(struct device *dev) · 1273 unmodified lines
22812295
22822296 return 0;
22832297 }
2298+#else
2299+#define vmbus_bus_suspend NULL
2300+#define vmbus_bus_resume NULL
22842301 #endif /* CONFIG_PM_SLEEP */
22852302
22862303 static const struct acpi_device_id vmbus_acpi_device_ids[] = {
@@ -2291,16 +2308,24 @@ static const struct acpi_device_id vmbus_acpi_device_ids[] = { · 4 unmodified lines
22912308 MODULE_DEVICE_TABLE(acpi, vmbus_acpi_device_ids);
22922309
22932310 /*
2294− * Note: we must use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS rather than
2295− * SET_SYSTEM_SLEEP_PM_OPS, otherwise NIC SR-IOV can not work, because the
2296− * "pci_dev_pm_ops" uses the "noirq" callbacks: in the resume path, the
2297− * pci "noirq" restore callback runs before "non-noirq" callbacks (see
2311+ * Note: we must use the "no_irq" ops, otherwise hibernation can not work with
2312+ * PCI device assignment, because "pci_dev_pm_ops" uses the "noirq" ops: in
2313+ * the resume path, the pci "noirq" restore op runs before "non-noirq" op (see
22982314 * resume_target_kernel() -> dpm_resume_start(), and hibernation_restore() ->
22992315 * dpm_resume_end()). This means vmbus_bus_resume() and the pci-hyperv's
2300− * resume callback must also run via the "noirq" callbacks.
2316+ * resume callback must also run via the "noirq" ops.
2317+ *
2318+ * Set suspend_noirq/resume_noirq to NULL for Suspend-to-Idle: see the comment
2319+ * earlier in this file before vmbus_pm.
23012320 */
2321+
23022322 static const struct dev_pm_ops vmbus_bus_pm = {
2303− SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(vmbus_bus_suspend, vmbus_bus_resume)
2323+ .suspend_noirq = NULL,
2324+ .resume_noirq = NULL,
2325+ .freeze_noirq = vmbus_bus_suspend,
2326+ .thaw_noirq = vmbus_bus_resume,
2327+ .poweroff_noirq = vmbus_bus_suspend,
2328+ .restore_noirq = vmbus_bus_resume
23042329 };
23052330
23062331 static struct acpi_driver vmbus_acpi_driver = {
drivers/i2c/busses/i2c-amd-mp2-pci.c+1−1
@@ -349,12 +349,12 @@ static int amd_mp2_pci_probe(struct pci_dev *pci_dev, · 348 unmodified lines
349349 if (!privdata)
350350 return -ENOMEM;
351351
352+ privdata->pci_dev = pci_dev;
352353 rc = amd_mp2_pci_init(privdata, pci_dev);
353354 if (rc)
354355 return rc;
355356
356357 mutex_init(&privdata->c2p_lock);
357− privdata->pci_dev = pci_dev;
358358
359359 pm_runtime_set_autosuspend_delay(&pci_dev->dev, 1000);
360360 pm_runtime_use_autosuspend(&pci_dev->dev);
drivers/i2c/busses/i2c-aspeed.c+4−1
@@ -603,6 +603,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) · 602 unmodified lines
603603 /* Ack all interrupts except for Rx done */
604604 writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE,
605605 bus->base + ASPEED_I2C_INTR_STS_REG);
606+ readl(bus->base + ASPEED_I2C_INTR_STS_REG);
606607 irq_remaining = irq_received;
607608
608609 #if IS_ENABLED(CONFIG_I2C_SLAVE)
@@ -645,9 +646,11 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) · 36 unmodified lines
645646 irq_received, irq_handled);
646647
647648 /* Ack Rx done */
648− if (irq_received & ASPEED_I2CD_INTR_RX_DONE)
649+ if (irq_received & ASPEED_I2CD_INTR_RX_DONE) {
649650 writel(ASPEED_I2CD_INTR_RX_DONE,
650651 bus->base + ASPEED_I2C_INTR_STS_REG);
652+ readl(bus->base + ASPEED_I2C_INTR_STS_REG);
653+ }
651654 spin_unlock(&bus->lock);
652655 return irq_remaining ? IRQ_NONE : IRQ_HANDLED;
653656 }
drivers/i2c/busses/i2c-bcm-iproc.c+3−0
@@ -360,6 +360,9 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, · 359 unmodified lines
360360 value = (u8)((val >> S_RX_DATA_SHIFT) & S_RX_DATA_MASK);
361361 i2c_slave_event(iproc_i2c->slave,
362362 I2C_SLAVE_WRITE_RECEIVED, &value);
363+ if (rx_status == I2C_SLAVE_RX_END)
364+ i2c_slave_event(iproc_i2c->slave,
365+ I2C_SLAVE_STOP, &value);
363366 }
364367 } else if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) {
365368 /* Master read other than start */
drivers/i2c/busses/i2c-tegra.c+12−24
@@ -996,13 +996,14 @@ tegra_i2c_poll_completion_timeout(struct tegra_i2c_dev *i2c_dev, · 995 unmodified lines
996996 do {
997997 u32 status = i2c_readl(i2c_dev, I2C_INT_STATUS);
998998
999− if (status)
999+ if (status) {
10001000 tegra_i2c_isr(i2c_dev->irq, i2c_dev);
10011001
1002− if (completion_done(complete)) {
1003− s64 delta = ktime_ms_delta(ktimeout, ktime);
1002+ if (completion_done(complete)) {
1003+ s64 delta = ktime_ms_delta(ktimeout, ktime);
10041004
1005− return msecs_to_jiffies(delta) ?: 1;
1005+ return msecs_to_jiffies(delta) ?: 1;
1006+ }
10061007 }
10071008
10081009 ktime = ktime_get();
@@ -1029,18 +1030,14 @@ tegra_i2c_wait_completion_timeout(struct tegra_i2c_dev *i2c_dev, · 20 unmodified lines
10291030 disable_irq(i2c_dev->irq);
10301031
10311032 /*
1032− * Under some rare circumstances (like running KASAN +
1033− * NFS root) CPU, which handles interrupt, may stuck in
1034− * uninterruptible state for a significant time. In this
1035− * case we will get timeout if I2C transfer is running on
1036− * a sibling CPU, despite of IRQ being raised.
1037− *
1038− * In order to handle this rare condition, the IRQ status
1039− * needs to be checked after timeout.
1033+ * There is a chance that completion may happen after IRQ
1034+ * synchronization, which is done by disable_irq().
10401035 */
1041− if (ret == 0)
1042− ret = tegra_i2c_poll_completion_timeout(i2c_dev,
1043− complete, 0);
1036+ if (ret == 0 && completion_done(complete)) {
1037+ dev_warn(i2c_dev->dev,
1038+ "completion done after timeout\n");
1039+ ret = 1;
1040+ }
10441041 }
10451042
10461043 return ret;
@@ -1219,15 +1216,6 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · 172 unmodified lines
12191216 time_left = tegra_i2c_wait_completion_timeout(
12201217 i2c_dev, &i2c_dev->dma_complete, xfer_time);
12211218
1222− /*
1223− * Synchronize DMA first, since dmaengine_terminate_sync()
1224− * performs synchronization after the transfer's termination
1225− * and we want to get a completion if transfer succeeded.
1226− */
1227− dmaengine_synchronize(i2c_dev->msg_read ?
1228− i2c_dev->rx_dma_chan :
1229− i2c_dev->tx_dma_chan);
1230−
12311219 dmaengine_terminate_sync(i2c_dev->msg_read ?
12321220 i2c_dev->rx_dma_chan :
12331221 i2c_dev->tx_dma_chan);
drivers/iio/adc/ad7192.c+47−16
@@ -125,10 +125,10 @@ · 124 unmodified lines
125125 #define AD7193_CH_AINCOM 0x600 /* AINCOM - AINCOM */
126126
127127 /* ID Register Bit Designations (AD7192_REG_ID) */
128−#define ID_AD7190 0x4
129−#define ID_AD7192 0x0
130−#define ID_AD7193 0x2
131−#define ID_AD7195 0x6
128+#define CHIPID_AD7190 0x4
129+#define CHIPID_AD7192 0x0
130+#define CHIPID_AD7193 0x2
131+#define CHIPID_AD7195 0x6
132132 #define AD7192_ID_MASK 0x0F
133133
134134 /* GPOCON Register Bit Designations (AD7192_REG_GPOCON) */
@@ -161,7 +161,20 @@ enum { · 26 unmodified lines
161161 AD7192_SYSCALIB_FULL_SCALE,
162162 };
163163
164+enum {
165+ ID_AD7190,
166+ ID_AD7192,
167+ ID_AD7193,
168+ ID_AD7195,
169+};
170+
171+struct ad7192_chip_info {
172+ unsigned int chip_id;
173+ const char *name;
174+};
175+
164176 struct ad7192_state {
177+ const struct ad7192_chip_info *chip_info;
165178 struct regulator *avdd;
166179 struct regulator *dvdd;
167180 struct clk *mclk;
@@ -172,7 +185,6 @@ struct ad7192_state { · 4 unmodified lines
172185 u32 conf;
173186 u32 scale_avail[8][2];
174187 u8 gpocon;
175− u8 devid;
176188 u8 clock_sel;
177189 struct mutex lock; /* protect sensor state */
178190 u8 syscalib_mode[8];
@@ -348,7 +360,7 @@ static int ad7192_setup(struct ad7192_state *st, struct device_node *np) · 169 unmodified lines
348360
349361 id &= AD7192_ID_MASK;
350362
351− if (id != st->devid)
363+ if (id != st->chip_info->chip_id)
352364 dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n",
353365 id);
354366
@@ -363,7 +375,7 @@ static int ad7192_setup(struct ad7192_state *st, struct device_node *np) · 8 unmodified lines
363375 st->mode |= AD7192_MODE_REJ60;
364376
365377 refin2_en = of_property_read_bool(np, "adi,refin2-pins-enable");
366− if (refin2_en && st->devid != ID_AD7195)
378+ if (refin2_en && st->chip_info->chip_id != CHIPID_AD7195)
367379 st->conf |= AD7192_CONF_REFSEL;
368380
369381 st->conf &= ~AD7192_CONF_CHOP;
@@ -859,12 +871,31 @@ static const struct iio_chan_spec ad7193_channels[] = { · 489 unmodified lines
859871 IIO_CHAN_SOFT_TIMESTAMP(14),
860872 };
861873
874+static const struct ad7192_chip_info ad7192_chip_info_tbl[] = {
875+ [ID_AD7190] = {
876+ .chip_id = CHIPID_AD7190,
877+ .name = "ad7190",
878+ },
879+ [ID_AD7192] = {
880+ .chip_id = CHIPID_AD7192,
881+ .name = "ad7192",
882+ },
883+ [ID_AD7193] = {
884+ .chip_id = CHIPID_AD7193,
885+ .name = "ad7193",
886+ },
887+ [ID_AD7195] = {
888+ .chip_id = CHIPID_AD7195,
889+ .name = "ad7195",
890+ },
891+};
892+
862893 static int ad7192_channels_config(struct iio_dev *indio_dev)
863894 {
864895 struct ad7192_state *st = iio_priv(indio_dev);
865896
866− switch (st->devid) {
867− case ID_AD7193:
897+ switch (st->chip_info->chip_id) {
898+ case CHIPID_AD7193:
868899 indio_dev->channels = ad7193_channels;
869900 indio_dev->num_channels = ARRAY_SIZE(ad7193_channels);
870901 break;
@@ -878,10 +909,10 @@ static int ad7192_channels_config(struct iio_dev *indio_dev) · 7 unmodified lines
878909 }
879910
880911 static const struct of_device_id ad7192_of_match[] = {
881− { .compatible = "adi,ad7190", .data = (void *)ID_AD7190 },
882− { .compatible = "adi,ad7192", .data = (void *)ID_AD7192 },
883− { .compatible = "adi,ad7193", .data = (void *)ID_AD7193 },
884− { .compatible = "adi,ad7195", .data = (void *)ID_AD7195 },
912+ { .compatible = "adi,ad7190", .data = &ad7192_chip_info_tbl[ID_AD7190] },
913+ { .compatible = "adi,ad7192", .data = &ad7192_chip_info_tbl[ID_AD7192] },
914+ { .compatible = "adi,ad7193", .data = &ad7192_chip_info_tbl[ID_AD7193] },
915+ { .compatible = "adi,ad7195", .data = &ad7192_chip_info_tbl[ID_AD7195] },
885916 {}
886917 };
887918 MODULE_DEVICE_TABLE(of, ad7192_of_match);
@@ -938,16 +969,16 @@ static int ad7192_probe(struct spi_device *spi) · 50 unmodified lines
938969 }
939970
940971 spi_set_drvdata(spi, indio_dev);
941− st->devid = (unsigned long)of_device_get_match_data(&spi->dev);
972+ st->chip_info = of_device_get_match_data(&spi->dev);
942973 indio_dev->dev.parent = &spi->dev;
943− indio_dev->name = spi_get_device_id(spi)->name;
974+ indio_dev->name = st->chip_info->name;
944975 indio_dev->modes = INDIO_DIRECT_MODE;
945976
946977 ret = ad7192_channels_config(indio_dev);
947978 if (ret < 0)
948979 goto error_disable_dvdd;
949980
950− if (st->devid == ID_AD7195)
981+ if (st->chip_info->chip_id == CHIPID_AD7195)
951982 indio_dev->info = &ad7195_info;
952983 else
953984 indio_dev->info = &ad7192_info;
drivers/iio/adc/ad7793.c+1−1
@@ -542,7 +542,7 @@ static const struct iio_info ad7797_info = { · 541 unmodified lines
542542 .read_raw = &ad7793_read_raw,
543543 .write_raw = &ad7793_write_raw,
544544 .write_raw_get_fmt = &ad7793_write_raw_get_fmt,
545− .attrs = &ad7793_attribute_group,
545+ .attrs = &ad7797_attribute_group,
546546 .validate_trigger = ad_sd_validate_trigger,
547547 };
548548
drivers/iio/adc/stm32-adc.c+28−3
@@ -1418,8 +1418,30 @@ static unsigned int stm32_adc_dma_residue(struct stm32_adc *adc) · 1417 unmodified lines
14181418 static void stm32_adc_dma_buffer_done(void *data)
14191419 {
14201420 struct iio_dev *indio_dev = data;
1421+ struct stm32_adc *adc = iio_priv(indio_dev);
1422+ int residue = stm32_adc_dma_residue(adc);
1423+
1424+ /*
1425+ * In DMA mode the trigger services of IIO are not used
1426+ * (e.g. no call to iio_trigger_poll).
1427+ * Calling irq handler associated to the hardware trigger is not
1428+ * relevant as the conversions have already been done. Data
1429+ * transfers are performed directly in DMA callback instead.
1430+ * This implementation avoids to call trigger irq handler that
1431+ * may sleep, in an atomic context (DMA irq handler context).
1432+ */
1433+ dev_dbg(&indio_dev->dev, "%s bufi=%d\n", __func__, adc->bufi);
14211434
1422− iio_trigger_poll_chained(indio_dev->trig);
1435+ while (residue >= indio_dev->scan_bytes) {
1436+ u16 *buffer = (u16 *)&adc->rx_buf[adc->bufi];
1437+
1438+ iio_push_to_buffers(indio_dev, buffer);
1439+
1440+ residue -= indio_dev->scan_bytes;
1441+ adc->bufi += indio_dev->scan_bytes;
1442+ if (adc->bufi >= adc->rx_buf_sz)
1443+ adc->bufi = 0;
1444+ }
14231445 }
14241446
14251447 static int stm32_adc_dma_start(struct iio_dev *indio_dev)
@@ -1845,6 +1867,7 @@ static int stm32_adc_probe(struct platform_device *pdev) · 419 unmodified lines
18451867 {
18461868 struct iio_dev *indio_dev;
18471869 struct device *dev = &pdev->dev;
1870+ irqreturn_t (*handler)(int irq, void *p) = NULL;
18481871 struct stm32_adc *adc;
18491872 int ret;
18501873
@@ -1911,9 +1934,11 @@ static int stm32_adc_probe(struct platform_device *pdev) · 60 unmodified lines
19111934 if (ret < 0)
19121935 return ret;
19131936
1937+ if (!adc->dma_chan)
1938+ handler = &stm32_adc_trigger_handler;
1939+
19141940 ret = iio_triggered_buffer_setup(indio_dev,
1915− &iio_pollfunc_store_time,
1916− &stm32_adc_trigger_handler,
1941+ &iio_pollfunc_store_time, handler,
19171942 &stm32_adc_buffer_setup_ops);
19181943 if (ret) {
19191944 dev_err(&pdev->dev, "buffer setup failed\n");
drivers/iio/adc/ti-ads8344.c+3−3
@@ -29,7 +29,7 @@ struct ads8344 { · 28 unmodified lines
2929 struct mutex lock;
3030
3131 u8 tx_buf ____cacheline_aligned;
32− u16 rx_buf;
32+ u8 rx_buf[3];
3333 };
3434
3535 #define ADS8344_VOLTAGE_CHANNEL(chan, si) \
@@ -89,11 +89,11 @@ static int ads8344_adc_conversion(struct ads8344 *adc, int channel, · 53 unmodified lines
8989
9090 udelay(9);
9191
92− ret = spi_read(spi, &adc->rx_buf, 2);
92+ ret = spi_read(spi, adc->rx_buf, sizeof(adc->rx_buf));
9393 if (ret)
9494 return ret;
9595
96− return adc->rx_buf;
96+ return adc->rx_buf[0] << 9 | adc->rx_buf[1] << 1 | adc->rx_buf[2] >> 7;
9797 }
9898
9999 static int ads8344_read_raw(struct iio_dev *iio,
drivers/iio/adc/xilinx-xadc-core.c+74−21
@@ -102,6 +102,16 @@ static const unsigned int XADC_ZYNQ_UNMASK_TIMEOUT = 500; · 101 unmodified lines
102102
103103 #define XADC_FLAGS_BUFFERED BIT(0)
104104
105+/*
106+ * The XADC hardware supports a samplerate of up to 1MSPS. Unfortunately it does
107+ * not have a hardware FIFO. Which means an interrupt is generated for each
108+ * conversion sequence. At 1MSPS sample rate the CPU in ZYNQ7000 is completely
109+ * overloaded by the interrupts that it soft-lockups. For this reason the driver
110+ * limits the maximum samplerate 150kSPS. At this rate the CPU is fairly busy,
111+ * but still responsive.
112+ */
113+#define XADC_MAX_SAMPLERATE 150000
114+
105115 static void xadc_write_reg(struct xadc *xadc, unsigned int reg,
106116 uint32_t val)
107117 {
@@ -674,7 +684,7 @@ static int xadc_trigger_set_state(struct iio_trigger *trigger, bool state) · 566 unmodified lines
674684
675685 spin_lock_irqsave(&xadc->lock, flags);
676686 xadc_read_reg(xadc, XADC_AXI_REG_IPIER, &val);
677− xadc_write_reg(xadc, XADC_AXI_REG_IPISR, val & XADC_AXI_INT_EOS);
687+ xadc_write_reg(xadc, XADC_AXI_REG_IPISR, XADC_AXI_INT_EOS);
678688 if (state)
679689 val |= XADC_AXI_INT_EOS;
680690 else
@@ -722,13 +732,14 @@ static int xadc_power_adc_b(struct xadc *xadc, unsigned int seq_mode) · 41 unmodified lines
722732 {
723733 uint16_t val;
724734
735+ /* Powerdown the ADC-B when it is not needed. */
725736 switch (seq_mode) {
726737 case XADC_CONF1_SEQ_SIMULTANEOUS:
727738 case XADC_CONF1_SEQ_INDEPENDENT:
728− val = XADC_CONF2_PD_ADC_B;
739+ val = 0;
729740 break;
730741 default:
731− val = 0;
742+ val = XADC_CONF2_PD_ADC_B;
732743 break;
733744 }
734745
@@ -797,6 +808,16 @@ static int xadc_preenable(struct iio_dev *indio_dev) · 62 unmodified lines
797808 if (ret)
798809 goto err;
799810
811+ /*
812+ * In simultaneous mode the upper and lower aux channels are samples at
813+ * the same time. In this mode the upper 8 bits in the sequencer
814+ * register are don't care and the lower 8 bits control two channels
815+ * each. As such we must set the bit if either the channel in the lower
816+ * group or the upper group is enabled.
817+ */
818+ if (seq_mode == XADC_CONF1_SEQ_SIMULTANEOUS)
819+ scan_mask = ((scan_mask >> 8) | scan_mask) & 0xff0000;
820+
800821 ret = xadc_write_adc_reg(xadc, XADC_REG_SEQ(1), scan_mask >> 16);
801822 if (ret)
802823 goto err;
@@ -823,11 +844,27 @@ static const struct iio_buffer_setup_ops xadc_buffer_ops = { · 20 unmodified lines
823844 .postdisable = &xadc_postdisable,
824845 };
825846
847+static int xadc_read_samplerate(struct xadc *xadc)
848+{
849+ unsigned int div;
850+ uint16_t val16;
851+ int ret;
852+
853+ ret = xadc_read_adc_reg(xadc, XADC_REG_CONF2, &val16);
854+ if (ret)
855+ return ret;
856+
857+ div = (val16 & XADC_CONF2_DIV_MASK) >> XADC_CONF2_DIV_OFFSET;
858+ if (div < 2)
859+ div = 2;
860+
861+ return xadc_get_dclk_rate(xadc) / div / 26;
862+}
863+
826864 static int xadc_read_raw(struct iio_dev *indio_dev,
827865 struct iio_chan_spec const *chan, int *val, int *val2, long info)
828866 {
829867 struct xadc *xadc = iio_priv(indio_dev);
830− unsigned int div;
831868 uint16_t val16;
832869 int ret;
833870
@@ -880,41 +917,31 @@ static int xadc_read_raw(struct iio_dev *indio_dev, · 46 unmodified lines
880917 *val = -((273150 << 12) / 503975);
881918 return IIO_VAL_INT;
882919 case IIO_CHAN_INFO_SAMP_FREQ:
883− ret = xadc_read_adc_reg(xadc, XADC_REG_CONF2, &val16);
884− if (ret)
920+ ret = xadc_read_samplerate(xadc);
921+ if (ret < 0)
885922 return ret;
886923
887− div = (val16 & XADC_CONF2_DIV_MASK) >> XADC_CONF2_DIV_OFFSET;
888− if (div < 2)
889− div = 2;
890−
891− *val = xadc_get_dclk_rate(xadc) / div / 26;
892−
924+ *val = ret;
893925 return IIO_VAL_INT;
894926 default:
895927 return -EINVAL;
896928 }
897929 }
898930
899−static int xadc_write_raw(struct iio_dev *indio_dev,
900− struct iio_chan_spec const *chan, int val, int val2, long info)
931+static int xadc_write_samplerate(struct xadc *xadc, int val)
901932 {
902− struct xadc *xadc = iio_priv(indio_dev);
903933 unsigned long clk_rate = xadc_get_dclk_rate(xadc);
904934 unsigned int div;
905935
906936 if (!clk_rate)
907937 return -EINVAL;
908938
909− if (info != IIO_CHAN_INFO_SAMP_FREQ)
910− return -EINVAL;
911−
912939 if (val <= 0)
913940 return -EINVAL;
914941
915942 /* Max. 150 kSPS */
916− if (val > 150000)
917− val = 150000;
943+ if (val > XADC_MAX_SAMPLERATE)
944+ val = XADC_MAX_SAMPLERATE;
918945
919946 val *= 26;
920947
@@ -927,7 +954,7 @@ static int xadc_write_raw(struct iio_dev *indio_dev, · 6 unmodified lines
927954 * limit.
928955 */
929956 div = clk_rate / val;
930− if (clk_rate / div / 26 > 150000)
957+ if (clk_rate / div / 26 > XADC_MAX_SAMPLERATE)
931958 div++;
932959 if (div < 2)
933960 div = 2;
@@ -938,6 +965,17 @@ static int xadc_write_raw(struct iio_dev *indio_dev, · 4 unmodified lines
938965 div << XADC_CONF2_DIV_OFFSET);
939966 }
940967
968+static int xadc_write_raw(struct iio_dev *indio_dev,
969+ struct iio_chan_spec const *chan, int val, int val2, long info)
970+{
971+ struct xadc *xadc = iio_priv(indio_dev);
972+
973+ if (info != IIO_CHAN_INFO_SAMP_FREQ)
974+ return -EINVAL;
975+
976+ return xadc_write_samplerate(xadc, val);
977+}
978+
941979 static const struct iio_event_spec xadc_temp_events[] = {
942980 {
943981 .type = IIO_EV_TYPE_THRESH,
@@ -1223,6 +1261,21 @@ static int xadc_probe(struct platform_device *pdev) · 279 unmodified lines
12231261 if (ret)
12241262 goto err_free_samplerate_trigger;
12251263
1264+ /*
1265+ * Make sure not to exceed the maximum samplerate since otherwise the
1266+ * resulting interrupt storm will soft-lock the system.
1267+ */
1268+ if (xadc->ops->flags & XADC_FLAGS_BUFFERED) {
1269+ ret = xadc_read_samplerate(xadc);
1270+ if (ret < 0)
1271+ goto err_free_samplerate_trigger;
1272+ if (ret > XADC_MAX_SAMPLERATE) {
1273+ ret = xadc_write_samplerate(xadc, XADC_MAX_SAMPLERATE);
1274+ if (ret < 0)
1275+ goto err_free_samplerate_trigger;
1276+ }
1277+ }
1278+
12261279 ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0,
12271280 dev_name(&pdev->dev), indio_dev);
12281281 if (ret)
drivers/iio/common/st_sensors/st_sensors_core.c+1−1
@@ -79,7 +79,7 @@ int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr) · 78 unmodified lines
7979 struct st_sensor_odr_avl odr_out = {0, 0};
8080 struct st_sensor_data *sdata = iio_priv(indio_dev);
8181
82− if (!sdata->sensor_settings->odr.addr)
82+ if (!sdata->sensor_settings->odr.mask)
8383 return 0;
8484
8585 err = st_sensors_match_odr(sdata->sensor_settings, odr, &odr_out);
drivers/iio/dac/ad5770r.c+1−1
@@ -525,7 +525,7 @@ static int ad5770r_channel_config(struct ad5770r_state *st) · 524 unmodified lines
525525 ret = fwnode_property_read_u32(child, "num", &num);
526526 if (ret)
527527 return ret;
528− if (num > AD5770R_MAX_CHANNELS)
528+ if (num >= AD5770R_MAX_CHANNELS)
529529 return -EINVAL;
530530
531531 ret = fwnode_property_read_u32_array(child,
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+10−1
@@ -1617,6 +1617,10 @@ static int __maybe_unused inv_mpu_resume(struct device *dev) · 1616 unmodified lines
16171617 if (result)
16181618 goto out_unlock;
16191619
1620+ pm_runtime_disable(dev);
1621+ pm_runtime_set_active(dev);
1622+ pm_runtime_enable(dev);
1623+
16201624 result = inv_mpu6050_switch_engine(st, true, st->suspended_sensors);
16211625 if (result)
16221626 goto out_unlock;
@@ -1638,13 +1642,18 @@ static int __maybe_unused inv_mpu_suspend(struct device *dev) · 15 unmodified lines
16381642
16391643 mutex_lock(&st->lock);
16401644
1645+ st->suspended_sensors = 0;
1646+ if (pm_runtime_suspended(dev)) {
1647+ result = 0;
1648+ goto out_unlock;
1649+ }
1650+
16411651 if (iio_buffer_enabled(indio_dev)) {
16421652 result = inv_mpu6050_prepare_fifo(st, false);
16431653 if (result)
16441654 goto out_unlock;
16451655 }
16461656
1647− st->suspended_sensors = 0;
16481657 if (st->chip_config.accl_en)
16491658 st->suspended_sensors |= INV_MPU6050_SENSOR_ACCL;
16501659 if (st->chip_config.gyro_en)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h+3−0
@@ -337,6 +337,7 @@ enum st_lsm6dsx_fifo_mode { · 336 unmodified lines
337337 * @gain: Configured sensor sensitivity.
338338 * @odr: Output data rate of the sensor [Hz].
339339 * @watermark: Sensor watermark level.
340+ * @decimator: Sensor decimation factor.
340341 * @sip: Number of samples in a given pattern.
341342 * @ts_ref: Sensor timestamp reference for hw one.
342343 * @ext_info: Sensor settings if it is connected to i2c controller
@@ -350,11 +351,13 @@ struct st_lsm6dsx_sensor { · 7 unmodified lines
350351 u32 odr;
351352
352353 u16 watermark;
354+ u8 decimator;
353355 u8 sip;
354356 s64 ts_ref;
355357
356358 struct {
357359 const struct st_lsm6dsx_ext_dev_settings *settings;
360+ u32 slv_odr;
358361 u8 addr;
359362 } ext_info;
360363 };
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c+16−7
@@ -93,6 +93,7 @@ st_lsm6dsx_get_decimator_val(struct st_lsm6dsx_sensor *sensor, u32 max_odr) · 92 unmodified lines
9393 break;
9494 }
9595
96+ sensor->decimator = decimator;
9697 return i == max_size ? 0 : st_lsm6dsx_decimator_table[i].val;
9798 }
9899
@@ -337,7 +338,7 @@ static inline int st_lsm6dsx_read_block(struct st_lsm6dsx_hw *hw, u8 addr, · 238 unmodified lines
337338 int st_lsm6dsx_read_fifo(struct st_lsm6dsx_hw *hw)
338339 {
339340 struct st_lsm6dsx_sensor *acc_sensor, *gyro_sensor, *ext_sensor = NULL;
340− int err, acc_sip, gyro_sip, ts_sip, ext_sip, read_len, offset;
341+ int err, sip, acc_sip, gyro_sip, ts_sip, ext_sip, read_len, offset;
341342 u16 fifo_len, pattern_len = hw->sip * ST_LSM6DSX_SAMPLE_SIZE;
342343 u16 fifo_diff_mask = hw->settings->fifo_ops.fifo_diff.mask;
343344 u8 gyro_buff[ST_LSM6DSX_IIO_BUFF_SIZE];
@@ -399,19 +400,20 @@ int st_lsm6dsx_read_fifo(struct st_lsm6dsx_hw *hw) · 55 unmodified lines
399400 acc_sip = acc_sensor->sip;
400401 ts_sip = hw->ts_sip;
401402 offset = 0;
403+ sip = 0;
402404
403405 while (acc_sip > 0 || gyro_sip > 0 || ext_sip > 0) {
404− if (gyro_sip > 0) {
406+ if (gyro_sip > 0 && !(sip % gyro_sensor->decimator)) {
405407 memcpy(gyro_buff, &hw->buff[offset],
406408 ST_LSM6DSX_SAMPLE_SIZE);
407409 offset += ST_LSM6DSX_SAMPLE_SIZE;
408410 }
409− if (acc_sip > 0) {
411+ if (acc_sip > 0 && !(sip % acc_sensor->decimator)) {
410412 memcpy(acc_buff, &hw->buff[offset],
411413 ST_LSM6DSX_SAMPLE_SIZE);
412414 offset += ST_LSM6DSX_SAMPLE_SIZE;
413415 }
414− if (ext_sip > 0) {
416+ if (ext_sip > 0 && !(sip % ext_sensor->decimator)) {
415417 memcpy(ext_buff, &hw->buff[offset],
416418 ST_LSM6DSX_SAMPLE_SIZE);
417419 offset += ST_LSM6DSX_SAMPLE_SIZE;
@@ -441,18 +443,25 @@ int st_lsm6dsx_read_fifo(struct st_lsm6dsx_hw *hw) · 23 unmodified lines
441443 offset += ST_LSM6DSX_SAMPLE_SIZE;
442444 }
443445
444− if (gyro_sip-- > 0)
446+ if (gyro_sip > 0 && !(sip % gyro_sensor->decimator)) {
445447 iio_push_to_buffers_with_timestamp(
446448 hw->iio_devs[ST_LSM6DSX_ID_GYRO],
447449 gyro_buff, gyro_sensor->ts_ref + ts);
448− if (acc_sip-- > 0)
450+ gyro_sip--;
451+ }
452+ if (acc_sip > 0 && !(sip % acc_sensor->decimator)) {
449453 iio_push_to_buffers_with_timestamp(
450454 hw->iio_devs[ST_LSM6DSX_ID_ACC],
451455 acc_buff, acc_sensor->ts_ref + ts);
452− if (ext_sip-- > 0)
456+ acc_sip--;
457+ }
458+ if (ext_sip > 0 && !(sip % ext_sensor->decimator)) {
453459 iio_push_to_buffers_with_timestamp(
454460 hw->iio_devs[ST_LSM6DSX_ID_EXT0],
455461 ext_buff, ext_sensor->ts_ref + ts);
462+ ext_sip--;
463+ }
464+ sip++;
456465 }
457466 }
458467
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c+23−1
@@ -2036,11 +2036,21 @@ static int st_lsm6dsx_init_hw_timer(struct st_lsm6dsx_hw *hw) · 2035 unmodified lines
20362036 return 0;
20372037 }
20382038
2039−static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw)
2039+static int st_lsm6dsx_reset_device(struct st_lsm6dsx_hw *hw)
20402040 {
20412041 const struct st_lsm6dsx_reg *reg;
20422042 int err;
20432043
2044+ /*
2045+ * flush hw FIFO before device reset in order to avoid
2046+ * possible races on interrupt line 1. If the first interrupt
2047+ * line is asserted during hw reset the device will work in
2048+ * I3C-only mode (if it is supported)
2049+ */
2050+ err = st_lsm6dsx_flush_fifo(hw);
2051+ if (err < 0 && err != -ENOTSUPP)
2052+ return err;
2053+
20442054 /* device sw reset */
20452055 reg = &hw->settings->reset;
20462056 err = regmap_update_bits(hw->regmap, reg->addr, reg->mask,
@@ -2059,6 +2069,18 @@ static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw) · 12 unmodified lines
20592069
20602070 msleep(50);
20612071
2072+ return 0;
2073+}
2074+
2075+static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw)
2076+{
2077+ const struct st_lsm6dsx_reg *reg;
2078+ int err;
2079+
2080+ err = st_lsm6dsx_reset_device(hw);
2081+ if (err < 0)
2082+ return err;
2083+
20622084 /* enable Block Data Update */
20632085 reg = &hw->settings->bdu;
20642086 err = regmap_update_bits(hw->regmap, reg->addr, reg->mask,
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c+22−7
@@ -421,7 +421,8 @@ int st_lsm6dsx_shub_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable) · 420 unmodified lines
421421
422422 settings = sensor->ext_info.settings;
423423 if (enable) {
424− err = st_lsm6dsx_shub_set_odr(sensor, sensor->odr);
424+ err = st_lsm6dsx_shub_set_odr(sensor,
425+ sensor->ext_info.slv_odr);
425426 if (err < 0)
426427 return err;
427428 } else {
@@ -459,7 +460,7 @@ st_lsm6dsx_shub_read_oneshot(struct st_lsm6dsx_sensor *sensor, · 31 unmodified lines
459460 if (err < 0)
460461 return err;
461462
462− delay = 1000000000 / sensor->odr;
463+ delay = 1000000000 / sensor->ext_info.slv_odr;
463464 usleep_range(delay, 2 * delay);
464465
465466 len = min_t(int, sizeof(data), ch->scan_type.realbits >> 3);
@@ -500,8 +501,8 @@ st_lsm6dsx_shub_read_raw(struct iio_dev *iio_dev, · 34 unmodified lines
500501 iio_device_release_direct_mode(iio_dev);
501502 break;
502503 case IIO_CHAN_INFO_SAMP_FREQ:
503− *val = sensor->odr / 1000;
504− *val2 = (sensor->odr % 1000) * 1000;
504+ *val = sensor->ext_info.slv_odr / 1000;
505+ *val2 = (sensor->ext_info.slv_odr % 1000) * 1000;
505506 ret = IIO_VAL_INT_PLUS_MICRO;
506507 break;
507508 case IIO_CHAN_INFO_SCALE:
@@ -535,8 +536,20 @@ st_lsm6dsx_shub_write_raw(struct iio_dev *iio_dev, · 27 unmodified lines
535536
536537 val = val * 1000 + val2 / 1000;
537538 err = st_lsm6dsx_shub_get_odr_val(sensor, val, &data);
538− if (!err)
539− sensor->odr = val;
539+ if (!err) {
540+ struct st_lsm6dsx_hw *hw = sensor->hw;
541+ struct st_lsm6dsx_sensor *ref_sensor;
542+ u8 odr_val;
543+ int odr;
544+
545+ ref_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_ACC]);
546+ odr = st_lsm6dsx_check_odr(ref_sensor, val, &odr_val);
547+ if (odr < 0)
548+ return odr;
549+
550+ sensor->ext_info.slv_odr = val;
551+ sensor->odr = odr;
552+ }
540553 break;
541554 }
542555 default:
@@ -613,6 +626,7 @@ st_lsm6dsx_shub_alloc_iiodev(struct st_lsm6dsx_hw *hw, · 70 unmodified lines
613626 const struct st_lsm6dsx_ext_dev_settings *info,
614627 u8 i2c_addr, const char *name)
615628 {
629+ enum st_lsm6dsx_sensor_id ref_id = ST_LSM6DSX_ID_ACC;
616630 struct iio_chan_spec *ext_channels;
617631 struct st_lsm6dsx_sensor *sensor;
618632 struct iio_dev *iio_dev;
@@ -628,7 +642,8 @@ st_lsm6dsx_shub_alloc_iiodev(struct st_lsm6dsx_hw *hw, · 9 unmodified lines
628642 sensor = iio_priv(iio_dev);
629643 sensor->id = id;
630644 sensor->hw = hw;
631− sensor->odr = info->odr_table.odr_avl[0].milli_hz;
645+ sensor->odr = hw->settings->odr_table[ref_id].odr_avl[0].milli_hz;
646+ sensor->ext_info.slv_odr = info->odr_table.odr_avl[0].milli_hz;
632647 sensor->gain = info->fs_table.fs_avl[0].gain;
633648 sensor->ext_info.settings = info;
634649 sensor->ext_info.addr = i2c_addr;
drivers/iio/industrialio-core.c+2−5
@@ -915,14 +915,11 @@ static ssize_t iio_write_channel_info(struct device *dev, · 914 unmodified lines
915915 return -EINVAL;
916916 integer = ch;
917917 } else {
918− ret = iio_str_to_fixpoint(buf, fract_mult, &integer, &fract);
918+ ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
919+ scale_db);
919920 if (ret)
920921 return ret;
921922 }
922− ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
923− scale_db);
924− if (ret)
925− return ret;
926923
927924 ret = indio_dev->info->write_raw(indio_dev, this_attr->c,
928925 integer, fract, this_attr->address);
drivers/infiniband/core/cm.c+14−12
@@ -862,7 +862,7 @@ static struct cm_id_private *cm_alloc_id_priv(struct ib_device *device, · 861 unmodified lines
862862
863863 ret = xa_alloc_cyclic_irq(&cm.local_id_table, &id, NULL, xa_limit_32b,
864864 &cm.local_id_next, GFP_KERNEL);
865− if (ret)
865+ if (ret < 0)
866866 goto error;
867867 cm_id_priv->id.local_id = (__force __be32)id ^ cm.random_id_operand;
868868
@@ -1828,11 +1828,9 @@ static void cm_format_mra(struct cm_mra_msg *mra_msg, · 959 unmodified lines
18281828
18291829 static void cm_format_rej(struct cm_rej_msg *rej_msg,
18301830 struct cm_id_private *cm_id_priv,
1831− enum ib_cm_rej_reason reason,
1832− void *ari,
1833− u8 ari_length,
1834− const void *private_data,
1835− u8 private_data_len)
1831+ enum ib_cm_rej_reason reason, void *ari,
1832+ u8 ari_length, const void *private_data,
1833+ u8 private_data_len, enum ib_cm_state state)
18361834 {
18371835 lockdep_assert_held(&cm_id_priv->lock);
18381836
@@ -1840,7 +1838,7 @@ static void cm_format_rej(struct cm_rej_msg *rej_msg, · 1 unmodified line
18401838 IBA_SET(CM_REJ_REMOTE_COMM_ID, rej_msg,
18411839 be32_to_cpu(cm_id_priv->id.remote_id));
18421840
1843− switch(cm_id_priv->id.state) {
1841+ switch (state) {
18441842 case IB_CM_REQ_RCVD:
18451843 IBA_SET(CM_REJ_LOCAL_COMM_ID, rej_msg, be32_to_cpu(0));
18461844 IBA_SET(CM_REJ_MESSAGE_REJECTED, rej_msg, CM_MSG_RESPONSE_REQ);
@@ -1905,8 +1903,9 @@ static void cm_dup_req_handler(struct cm_work *work, · 58 unmodified lines
19051903 cm_id_priv->private_data_len);
19061904 break;
19071905 case IB_CM_TIMEWAIT:
1908− cm_format_rej((struct cm_rej_msg *) msg->mad, cm_id_priv,
1909− IB_CM_REJ_STALE_CONN, NULL, 0, NULL, 0);
1906+ cm_format_rej((struct cm_rej_msg *)msg->mad, cm_id_priv,
1907+ IB_CM_REJ_STALE_CONN, NULL, 0, NULL, 0,
1908+ IB_CM_TIMEWAIT);
19101909 break;
19111910 default:
19121911 goto unlock;
@@ -2904,6 +2903,7 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv, · 991 unmodified lines
29042903 u8 ari_length, const void *private_data,
29052904 u8 private_data_len)
29062905 {
2906+ enum ib_cm_state state = cm_id_priv->id.state;
29072907 struct ib_mad_send_buf *msg;
29082908 int ret;
29092909
@@ -2913,7 +2913,7 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv, · 3 unmodified lines
29132913 (ari && ari_length > IB_CM_REJ_ARI_LENGTH))
29142914 return -EINVAL;
29152915
2916− switch (cm_id_priv->id.state) {
2916+ switch (state) {
29172917 case IB_CM_REQ_SENT:
29182918 case IB_CM_MRA_REQ_RCVD:
29192919 case IB_CM_REQ_RCVD:
@@ -2925,7 +2925,8 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv, · 5 unmodified lines
29252925 if (ret)
29262926 return ret;
29272927 cm_format_rej((struct cm_rej_msg *)msg->mad, cm_id_priv, reason,
2928− ari, ari_length, private_data, private_data_len);
2928+ ari, ari_length, private_data, private_data_len,
2929+ state);
29292930 break;
29302931 case IB_CM_REP_SENT:
29312932 case IB_CM_MRA_REP_RCVD:
@@ -2934,7 +2935,8 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv, · 2 unmodified lines
29342935 if (ret)
29352936 return ret;
29362937 cm_format_rej((struct cm_rej_msg *)msg->mad, cm_id_priv, reason,
2937− ari, ari_length, private_data, private_data_len);
2938+ ari, ari_length, private_data, private_data_len,
2939+ state);
29382940 break;
29392941 default:
29402942 pr_debug("%s: local_id %d, cm_id->state: %d\n", __func__,
drivers/infiniband/core/rdma_core.c+4−5
@@ -360,7 +360,7 @@ lookup_get_fd_uobject(const struct uverbs_api_object *obj, · 359 unmodified lines
360360 * uverbs_uobject_fd_release(), and the caller is expected to ensure
361361 * that release is never done while a call to lookup is possible.
362362 */
363− if (f->f_op != fd_type->fops) {
363+ if (f->f_op != fd_type->fops || uobject->ufile != ufile) {
364364 fput(f);
365365 return ERR_PTR(-EBADF);
366366 }
@@ -474,16 +474,15 @@ alloc_begin_fd_uobject(const struct uverbs_api_object *obj, · 107 unmodified lines
474474 filp = anon_inode_getfile(fd_type->name, fd_type->fops, NULL,
475475 fd_type->flags);
476476 if (IS_ERR(filp)) {
477+ uverbs_uobject_put(uobj);
477478 uobj = ERR_CAST(filp);
478− goto err_uobj;
479+ goto err_fd;
479480 }
480481 uobj->object = filp;
481482
482483 uobj->id = new_fd;
483484 return uobj;
484485
485−err_uobj:
486− uverbs_uobject_put(uobj);
487486 err_fd:
488487 put_unused_fd(new_fd);
489488 return uobj;
@@ -679,7 +678,6 @@ void rdma_lookup_put_uobject(struct ib_uobject *uobj, · 189 unmodified lines
679678 enum rdma_lookup_mode mode)
680679 {
681680 assert_uverbs_usecnt(uobj, mode);
682− uobj->uapi_object->type_class->lookup_put(uobj, mode);
683681 /*
684682 * In order to unlock an object, either decrease its usecnt for
685683 * read access or zero it in case of exclusive access. See
@@ -696,6 +694,7 @@ void rdma_lookup_put_uobject(struct ib_uobject *uobj, · 10 unmodified lines
696694 break;
697695 }
698696
697+ uobj->uapi_object->type_class->lookup_put(uobj, mode);
699698 /* Pairs with the kref obtained by type->lookup_get */
700699 uverbs_uobject_put(uobj);
701700 }
drivers/infiniband/core/uverbs_main.c+4−0
@@ -820,6 +820,10 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) · 819 unmodified lines
820820 ret = mmget_not_zero(mm);
821821 if (!ret) {
822822 list_del_init(&priv->list);
823+ if (priv->entry) {
824+ rdma_user_mmap_entry_put(priv->entry);
825+ priv->entry = NULL;
826+ }
823827 mm = NULL;
824828 continue;
825829 }
drivers/infiniband/hw/i40iw/i40iw_ctrl.c+1−1
@@ -1046,7 +1046,7 @@ i40iw_sc_query_rdma_features(struct i40iw_sc_cqp *cqp, · 1045 unmodified lines
10461046 u64 header;
10471047
10481048 wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch);
1049− if (wqe)
1049+ if (!wqe)
10501050 return I40IW_ERR_RING_FULL;
10511051
10521052 set_64bit_val(wqe, 32, feat_mem->pa);
drivers/infiniband/hw/mlx4/main.c+2−1
@@ -1499,8 +1499,9 @@ static int __mlx4_ib_create_default_rules( · 1498 unmodified lines
14991499 int i;
15001500
15011501 for (i = 0; i < ARRAY_SIZE(pdefault_rules->rules_create_list); i++) {
1502+ union ib_flow_spec ib_spec = {};
15021503 int ret;
1503− union ib_flow_spec ib_spec;
1504+
15041505 switch (pdefault_rules->rules_create_list[i]) {
15051506 case 0:
15061507 /* no rule */
drivers/infiniband/hw/mlx5/qp.c+3−1
@@ -5558,7 +5558,9 @@ static void to_rdma_ah_attr(struct mlx5_ib_dev *ibdev, · 5557 unmodified lines
55585558 rdma_ah_set_path_bits(ah_attr, path->grh_mlid & 0x7f);
55595559 rdma_ah_set_static_rate(ah_attr,
55605560 path->static_rate ? path->static_rate - 5 : 0);
5561− if (path->grh_mlid & (1 << 7)) {
5561+
5562+ if (path->grh_mlid & (1 << 7) ||
5563+ ah_attr->type == RDMA_AH_ATTR_TYPE_ROCE) {
55625564 u32 tc_fl = be32_to_cpu(path->tclass_flowlabel);
55635565
55645566 rdma_ah_set_grh(ah_attr, NULL,
drivers/infiniband/sw/rdmavt/cq.c+2−2
@@ -248,8 +248,8 @@ int rvt_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, · 247 unmodified lines
248248 */
249249 if (udata && udata->outlen >= sizeof(__u64)) {
250250 cq->ip = rvt_create_mmap_info(rdi, sz, udata, u_wc);
251− if (!cq->ip) {
252− err = -ENOMEM;
251+ if (IS_ERR(cq->ip)) {
252+ err = PTR_ERR(cq->ip);
253253 goto bail_wc;
254254 }
255255
drivers/infiniband/sw/rdmavt/mmap.c+2−2
@@ -154,7 +154,7 @@ done: · 153 unmodified lines
154154 * @udata: user data (must be valid!)
155155 * @obj: opaque pointer to a cq, wq etc
156156 *
157− * Return: rvt_mmap struct on success
157+ * Return: rvt_mmap struct on success, ERR_PTR on failure
158158 */
159159 struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi, u32 size,
160160 struct ib_udata *udata, void *obj)
@@ -166,7 +166,7 @@ struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi, u32 size, · 5 unmodified lines
166166
167167 ip = kmalloc_node(sizeof(*ip), GFP_KERNEL, rdi->dparms.node);
168168 if (!ip)
169− return ip;
169+ return ERR_PTR(-ENOMEM);
170170
171171 size = PAGE_ALIGN(size);
172172
drivers/infiniband/sw/rdmavt/qp.c+2−2
@@ -1244,8 +1244,8 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd, · 1243 unmodified lines
12441244
12451245 qp->ip = rvt_create_mmap_info(rdi, s, udata,
12461246 qp->r_rq.wq);
1247− if (!qp->ip) {
1248− ret = ERR_PTR(-ENOMEM);
1247+ if (IS_ERR(qp->ip)) {
1248+ ret = ERR_CAST(qp->ip);
12491249 goto bail_qpn;
12501250 }
12511251
drivers/infiniband/sw/rdmavt/srq.c+2−2
@@ -111,8 +111,8 @@ int rvt_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *srq_init_attr, · 110 unmodified lines
111111 u32 s = sizeof(struct rvt_rwq) + srq->rq.size * sz;
112112
113113 srq->ip = rvt_create_mmap_info(dev, s, udata, srq->rq.wq);
114− if (!srq->ip) {
115− ret = -ENOMEM;
114+ if (IS_ERR(srq->ip)) {
115+ ret = PTR_ERR(srq->ip);
116116 goto bail_wq;
117117 }
118118
drivers/infiniband/sw/siw/siw_qp_tx.c+11−4
@@ -920,20 +920,27 @@ static int siw_fastreg_mr(struct ib_pd *pd, struct siw_sqe *sqe) · 919 unmodified lines
920920 {
921921 struct ib_mr *base_mr = (struct ib_mr *)(uintptr_t)sqe->base_mr;
922922 struct siw_device *sdev = to_siw_dev(pd->device);
923− struct siw_mem *mem = siw_mem_id2obj(sdev, sqe->rkey >> 8);
923+ struct siw_mem *mem;
924924 int rv = 0;
925925
926926 siw_dbg_pd(pd, "STag 0x%08x\n", sqe->rkey);
927927
928− if (unlikely(!mem || !base_mr)) {
928+ if (unlikely(!base_mr)) {
929929 pr_warn("siw: fastreg: STag 0x%08x unknown\n", sqe->rkey);
930930 return -EINVAL;
931931 }
932+
932933 if (unlikely(base_mr->rkey >> 8 != sqe->rkey >> 8)) {
933934 pr_warn("siw: fastreg: STag 0x%08x: bad MR\n", sqe->rkey);
934− rv = -EINVAL;
935− goto out;
935+ return -EINVAL;
936936 }
937+
938+ mem = siw_mem_id2obj(sdev, sqe->rkey >> 8);
939+ if (unlikely(!mem)) {
940+ pr_warn("siw: fastreg: STag 0x%08x unknown\n", sqe->rkey);
941+ return -EINVAL;
942+ }
943+
937944 if (unlikely(mem->pd != pd)) {
938945 pr_warn("siw: fastreg: PD mismatch\n");
939946 rv = -EINVAL;
drivers/interconnect/qcom/bcm-voter.c+3−2
@@ -96,6 +96,8 @@ static inline void tcs_cmd_gen(struct tcs_cmd *cmd, u64 vote_x, u64 vote_y, · 95 unmodified lines
9696 if (!cmd)
9797 return;
9898
99+ memset(cmd, 0, sizeof(*cmd));
100+
99101 if (vote_x == 0 && vote_y == 0)
100102 valid = false;
101103
@@ -112,8 +114,7 @@ static inline void tcs_cmd_gen(struct tcs_cmd *cmd, u64 vote_x, u64 vote_y, · 10 unmodified lines
112114 * Set the wait for completion flag on command that need to be completed
113115 * before the next command.
114116 */
115− if (commit)
116− cmd->wait = true;
117+ cmd->wait = commit;
117118 }
118119
119120 static void tcs_list_gen(struct list_head *bcm_list, int bucket,
drivers/interconnect/qcom/osm-l3.c+2−2
@@ -78,7 +78,7 @@ static struct qcom_icc_node *sdm845_osm_l3_nodes[] = { · 77 unmodified lines
7878 [SLAVE_OSM_L3] = &sdm845_osm_l3,
7979 };
8080
81−const static struct qcom_icc_desc sdm845_icc_osm_l3 = {
81+static const struct qcom_icc_desc sdm845_icc_osm_l3 = {
8282 .nodes = sdm845_osm_l3_nodes,
8383 .num_nodes = ARRAY_SIZE(sdm845_osm_l3_nodes),
8484 };
@@ -91,7 +91,7 @@ static struct qcom_icc_node *sc7180_osm_l3_nodes[] = { · 6 unmodified lines
9191 [SLAVE_OSM_L3] = &sc7180_osm_l3,
9292 };
9393
94−const static struct qcom_icc_desc sc7180_icc_osm_l3 = {
94+static const struct qcom_icc_desc sc7180_icc_osm_l3 = {
9595 .nodes = sc7180_osm_l3_nodes,
9696 .num_nodes = ARRAY_SIZE(sc7180_osm_l3_nodes),
9797 };
drivers/interconnect/qcom/sdm845.c+8−8
@@ -192,7 +192,7 @@ static struct qcom_icc_node *aggre1_noc_nodes[] = { · 191 unmodified lines
192192 [SLAVE_ANOC_PCIE_A1NOC_SNOC] = &qns_pcie_a1noc_snoc,
193193 };
194194
195−const static struct qcom_icc_desc sdm845_aggre1_noc = {
195+static const struct qcom_icc_desc sdm845_aggre1_noc = {
196196 .nodes = aggre1_noc_nodes,
197197 .num_nodes = ARRAY_SIZE(aggre1_noc_nodes),
198198 .bcms = aggre1_noc_bcms,
@@ -220,7 +220,7 @@ static struct qcom_icc_node *aggre2_noc_nodes[] = { · 21 unmodified lines
220220 [SLAVE_SERVICE_A2NOC] = &srvc_aggre2_noc,
221221 };
222222
223−const static struct qcom_icc_desc sdm845_aggre2_noc = {
223+static const struct qcom_icc_desc sdm845_aggre2_noc = {
224224 .nodes = aggre2_noc_nodes,
225225 .num_nodes = ARRAY_SIZE(aggre2_noc_nodes),
226226 .bcms = aggre2_noc_bcms,
@@ -281,7 +281,7 @@ static struct qcom_icc_node *config_noc_nodes[] = { · 54 unmodified lines
281281 [SLAVE_SERVICE_CNOC] = &srvc_cnoc,
282282 };
283283
284−const static struct qcom_icc_desc sdm845_config_noc = {
284+static const struct qcom_icc_desc sdm845_config_noc = {
285285 .nodes = config_noc_nodes,
286286 .num_nodes = ARRAY_SIZE(config_noc_nodes),
287287 .bcms = config_noc_bcms,
@@ -297,7 +297,7 @@ static struct qcom_icc_node *dc_noc_nodes[] = { · 9 unmodified lines
297297 [SLAVE_MEM_NOC_CFG] = &qhs_memnoc,
298298 };
299299
300−const static struct qcom_icc_desc sdm845_dc_noc = {
300+static const struct qcom_icc_desc sdm845_dc_noc = {
301301 .nodes = dc_noc_nodes,
302302 .num_nodes = ARRAY_SIZE(dc_noc_nodes),
303303 .bcms = dc_noc_bcms,
@@ -315,7 +315,7 @@ static struct qcom_icc_node *gladiator_noc_nodes[] = { · 11 unmodified lines
315315 [SLAVE_SERVICE_GNOC] = &srvc_gnoc,
316316 };
317317
318−const static struct qcom_icc_desc sdm845_gladiator_noc = {
318+static const struct qcom_icc_desc sdm845_gladiator_noc = {
319319 .nodes = gladiator_noc_nodes,
320320 .num_nodes = ARRAY_SIZE(gladiator_noc_nodes),
321321 .bcms = gladiator_noc_bcms,
@@ -350,7 +350,7 @@ static struct qcom_icc_node *mem_noc_nodes[] = { · 28 unmodified lines
350350 [SLAVE_EBI1] = &ebi,
351351 };
352352
353−const static struct qcom_icc_desc sdm845_mem_noc = {
353+static const struct qcom_icc_desc sdm845_mem_noc = {
354354 .nodes = mem_noc_nodes,
355355 .num_nodes = ARRAY_SIZE(mem_noc_nodes),
356356 .bcms = mem_noc_bcms,
@@ -384,7 +384,7 @@ static struct qcom_icc_node *mmss_noc_nodes[] = { · 27 unmodified lines
384384 [SLAVE_CAMNOC_UNCOMP] = &qns_camnoc_uncomp,
385385 };
386386
387−const static struct qcom_icc_desc sdm845_mmss_noc = {
387+static const struct qcom_icc_desc sdm845_mmss_noc = {
388388 .nodes = mmss_noc_nodes,
389389 .num_nodes = ARRAY_SIZE(mmss_noc_nodes),
390390 .bcms = mmss_noc_bcms,
@@ -430,7 +430,7 @@ static struct qcom_icc_node *system_noc_nodes[] = { · 39 unmodified lines
430430 [SLAVE_TCU] = &xs_sys_tcu_cfg,
431431 };
432432
433−const static struct qcom_icc_desc sdm845_system_noc = {
433+static const struct qcom_icc_desc sdm845_system_noc = {
434434 .nodes = system_noc_nodes,
435435 .num_nodes = ARRAY_SIZE(system_noc_nodes),
436436 .bcms = system_noc_bcms,
drivers/iommu/Kconfig+2−2
@@ -362,7 +362,7 @@ config IPMMU_VMSA · 361 unmodified lines
362362
363363 config SPAPR_TCE_IOMMU
364364 bool "sPAPR TCE IOMMU Support"
365− depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
365+ depends on PPC_POWERNV || PPC_PSERIES
366366 select IOMMU_API
367367 help
368368 Enables bits of IOMMU API required by VFIO. The iommu_ops
@@ -457,7 +457,7 @@ config S390_AP_IOMMU · 88 unmodified lines
457457
458458 config MTK_IOMMU
459459 bool "MTK IOMMU Support"
460− depends on ARM || ARM64 || COMPILE_TEST
460+ depends on HAS_DMA
461461 depends on ARCH_MEDIATEK || COMPILE_TEST
462462 select ARM_DMA_USE_IOMMU
463463 select IOMMU_API
drivers/iommu/amd_iommu.c+154−44
@@ -101,6 +101,8 @@ struct kmem_cache *amd_iommu_irq_cache; · 100 unmodified lines
101101 static void update_domain(struct protection_domain *domain);
102102 static int protection_domain_init(struct protection_domain *domain);
103103 static void detach_device(struct device *dev);
104+static void update_and_flush_device_table(struct protection_domain *domain,
105+ struct domain_pgtable *pgtable);
104106
105107 /****************************************************************************
106108 *
@@ -151,6 +153,26 @@ static struct protection_domain *to_pdomain(struct iommu_domain *dom) · 44 unmodified lines
151153 return container_of(dom, struct protection_domain, domain);
152154 }
153155
156+static void amd_iommu_domain_get_pgtable(struct protection_domain *domain,
157+ struct domain_pgtable *pgtable)
158+{
159+ u64 pt_root = atomic64_read(&domain->pt_root);
160+
161+ pgtable->root = (u64 *)(pt_root & PAGE_MASK);
162+ pgtable->mode = pt_root & 7; /* lowest 3 bits encode pgtable mode */
163+}
164+
165+static u64 amd_iommu_domain_encode_pgtable(u64 *root, int mode)
166+{
167+ u64 pt_root;
168+
169+ /* lowest 3 bits encode pgtable mode */
170+ pt_root = mode & 7;
171+ pt_root |= (u64)root;
172+
173+ return pt_root;
174+}
175+
154176 static struct iommu_dev_data *alloc_dev_data(u16 devid)
155177 {
156178 struct iommu_dev_data *dev_data;
@@ -1397,13 +1419,18 @@ static struct page *free_sub_pt(unsigned long root, int mode, · 1240 unmodified lines
13971419
13981420 static void free_pagetable(struct protection_domain *domain)
13991421 {
1400− unsigned long root = (unsigned long)domain->pt_root;
1422+ struct domain_pgtable pgtable;
14011423 struct page *freelist = NULL;
1424+ unsigned long root;
14021425
1403− BUG_ON(domain->mode < PAGE_MODE_NONE ||
1404− domain->mode > PAGE_MODE_6_LEVEL);
1426+ amd_iommu_domain_get_pgtable(domain, &pgtable);
1427+ atomic64_set(&domain->pt_root, 0);
14051428
1406− freelist = free_sub_pt(root, domain->mode, freelist);
1429+ BUG_ON(pgtable.mode < PAGE_MODE_NONE ||
1430+ pgtable.mode > PAGE_MODE_6_LEVEL);
1431+
1432+ root = (unsigned long)pgtable.root;
1433+ freelist = free_sub_pt(root, pgtable.mode, freelist);
14071434
14081435 free_page_list(freelist);
14091436 }
@@ -1417,24 +1444,39 @@ static bool increase_address_space(struct protection_domain *domain, · 7 unmodified lines
14171444 unsigned long address,
14181445 gfp_t gfp)
14191446 {
1447+ struct domain_pgtable pgtable;
14201448 unsigned long flags;
1421− bool ret = false;
1422− u64 *pte;
1449+ bool ret = true;
1450+ u64 *pte, root;
14231451
14241452 spin_lock_irqsave(&domain->lock, flags);
14251453
1426− if (address <= PM_LEVEL_SIZE(domain->mode) ||
1427− WARN_ON_ONCE(domain->mode == PAGE_MODE_6_LEVEL))
1454+ amd_iommu_domain_get_pgtable(domain, &pgtable);
1455+
1456+ if (address <= PM_LEVEL_SIZE(pgtable.mode))
1457+ goto out;
1458+
1459+ ret = false;
1460+ if (WARN_ON_ONCE(pgtable.mode == PAGE_MODE_6_LEVEL))
14281461 goto out;
14291462
14301463 pte = (void *)get_zeroed_page(gfp);
14311464 if (!pte)
14321465 goto out;
14331466
1434− *pte = PM_LEVEL_PDE(domain->mode,
1435− iommu_virt_to_phys(domain->pt_root));
1436− domain->pt_root = pte;
1437− domain->mode += 1;
1467+ *pte = PM_LEVEL_PDE(pgtable.mode, iommu_virt_to_phys(pgtable.root));
1468+
1469+ pgtable.root = pte;
1470+ pgtable.mode += 1;
1471+ update_and_flush_device_table(domain, &pgtable);
1472+ domain_flush_complete(domain);
1473+
1474+ /*
1475+ * Device Table needs to be updated and flushed before the new root can
1476+ * be published.
1477+ */
1478+ root = amd_iommu_domain_encode_pgtable(pte, pgtable.mode);
1479+ atomic64_set(&domain->pt_root, root);
14381480
14391481 ret = true;
14401482
@@ -1451,16 +1493,29 @@ static u64 *alloc_pte(struct protection_domain *domain, · 10 unmodified lines
14511493 gfp_t gfp,
14521494 bool *updated)
14531495 {
1496+ struct domain_pgtable pgtable;
14541497 int level, end_lvl;
14551498 u64 *pte, *page;
14561499
14571500 BUG_ON(!is_power_of_2(page_size));
14581501
1459− while (address > PM_LEVEL_SIZE(domain->mode))
1460− *updated = increase_address_space(domain, address, gfp) || *updated;
1502+ amd_iommu_domain_get_pgtable(domain, &pgtable);
1503+
1504+ while (address > PM_LEVEL_SIZE(pgtable.mode)) {
1505+ /*
1506+ * Return an error if there is no memory to update the
1507+ * page-table.
1508+ */
1509+ if (!increase_address_space(domain, address, gfp))
1510+ return NULL;
1511+
1512+ /* Read new values to check if update was successful */
1513+ amd_iommu_domain_get_pgtable(domain, &pgtable);
1514+ }
1515+
14611516
1462− level = domain->mode - 1;
1463− pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
1517+ level = pgtable.mode - 1;
1518+ pte = &pgtable.root[PM_LEVEL_INDEX(level, address)];
14641519 address = PAGE_SIZE_ALIGN(address, page_size);
14651520 end_lvl = PAGE_SIZE_LEVEL(page_size);
14661521
@@ -1536,16 +1591,19 @@ static u64 *fetch_pte(struct protection_domain *domain, · 69 unmodified lines
15361591 unsigned long address,
15371592 unsigned long *page_size)
15381593 {
1594+ struct domain_pgtable pgtable;
15391595 int level;
15401596 u64 *pte;
15411597
15421598 *page_size = 0;
15431599
1544− if (address > PM_LEVEL_SIZE(domain->mode))
1600+ amd_iommu_domain_get_pgtable(domain, &pgtable);
1601+
1602+ if (address > PM_LEVEL_SIZE(pgtable.mode))
15451603 return NULL;
15461604
1547− level = domain->mode - 1;
1548− pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
1605+ level = pgtable.mode - 1;
1606+ pte = &pgtable.root[PM_LEVEL_INDEX(level, address)];
15491607 *page_size = PTE_LEVEL_PAGE_SIZE(level);
15501608
15511609 while (level > 0) {
@@ -1660,7 +1718,13 @@ out: · 108 unmodified lines
16601718 unsigned long flags;
16611719
16621720 spin_lock_irqsave(&dom->lock, flags);
1663− update_domain(dom);
1721+ /*
1722+ * Flush domain TLB(s) and wait for completion. Any Device-Table
1723+ * Updates and flushing already happened in
1724+ * increase_address_space().
1725+ */
1726+ domain_flush_tlb_pde(dom);
1727+ domain_flush_complete(dom);
16641728 spin_unlock_irqrestore(&dom->lock, flags);
16651729 }
16661730
@@ -1806,6 +1870,7 @@ static void dma_ops_domain_free(struct protection_domain *domain) · 139 unmodified lines
18061870 static struct protection_domain *dma_ops_domain_alloc(void)
18071871 {
18081872 struct protection_domain *domain;
1873+ u64 *pt_root, root;
18091874
18101875 domain = kzalloc(sizeof(struct protection_domain), GFP_KERNEL);
18111876 if (!domain)
@@ -1814,12 +1879,14 @@ static struct protection_domain *dma_ops_domain_alloc(void) · 2 unmodified lines
18141879 if (protection_domain_init(domain))
18151880 goto free_domain;
18161881
1817− domain->mode = PAGE_MODE_3_LEVEL;
1818− domain->pt_root = (void *)get_zeroed_page(GFP_KERNEL);
1819− domain->flags = PD_DMA_OPS_MASK;
1820− if (!domain->pt_root)
1882+ pt_root = (void *)get_zeroed_page(GFP_KERNEL);
1883+ if (!pt_root)
18211884 goto free_domain;
18221885
1886+ root = amd_iommu_domain_encode_pgtable(pt_root, PAGE_MODE_3_LEVEL);
1887+ atomic64_set(&domain->pt_root, root);
1888+ domain->flags = PD_DMA_OPS_MASK;
1889+
18231890 if (iommu_get_dma_cookie(&domain->domain) == -ENOMEM)
18241891 goto free_domain;
18251892
@@ -1841,16 +1908,17 @@ static bool dma_ops_domain(struct protection_domain *domain) · 15 unmodified lines
18411908 }
18421909
18431910 static void set_dte_entry(u16 devid, struct protection_domain *domain,
1911+ struct domain_pgtable *pgtable,
18441912 bool ats, bool ppr)
18451913 {
18461914 u64 pte_root = 0;
18471915 u64 flags = 0;
18481916 u32 old_domid;
18491917
1850− if (domain->mode != PAGE_MODE_NONE)
1851− pte_root = iommu_virt_to_phys(domain->pt_root);
1918+ if (pgtable->mode != PAGE_MODE_NONE)
1919+ pte_root = iommu_virt_to_phys(pgtable->root);
18521920
1853− pte_root |= (domain->mode & DEV_ENTRY_MODE_MASK)
1921+ pte_root |= (pgtable->mode & DEV_ENTRY_MODE_MASK)
18541922 << DEV_ENTRY_MODE_SHIFT;
18551923 pte_root |= DTE_FLAG_IR | DTE_FLAG_IW | DTE_FLAG_V | DTE_FLAG_TV;
18561924
@@ -1923,6 +1991,7 @@ static void clear_dte_entry(u16 devid) · 66 unmodified lines
19231991 static void do_attach(struct iommu_dev_data *dev_data,
19241992 struct protection_domain *domain)
19251993 {
1994+ struct domain_pgtable pgtable;
19261995 struct amd_iommu *iommu;
19271996 bool ats;
19281997
@@ -1938,7 +2007,9 @@ static void do_attach(struct iommu_dev_data *dev_data, · 9 unmodified lines
19382007 domain->dev_cnt += 1;
19392008
19402009 /* Update device table */
1941− set_dte_entry(dev_data->devid, domain, ats, dev_data->iommu_v2);
2010+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2011+ set_dte_entry(dev_data->devid, domain, &pgtable,
2012+ ats, dev_data->iommu_v2);
19422013 clone_aliases(dev_data->pdev);
19432014
19442015 device_flush_dte(dev_data);
@@ -2249,23 +2320,36 @@ static int amd_iommu_domain_get_attr(struct iommu_domain *domain, · 304 unmodified lines
22492320 *
22502321 *****************************************************************************/
22512322
2252−static void update_device_table(struct protection_domain *domain)
2323+static void update_device_table(struct protection_domain *domain,
2324+ struct domain_pgtable *pgtable)
22532325 {
22542326 struct iommu_dev_data *dev_data;
22552327
22562328 list_for_each_entry(dev_data, &domain->dev_list, list) {
2257− set_dte_entry(dev_data->devid, domain, dev_data->ats.enabled,
2258− dev_data->iommu_v2);
2329+ set_dte_entry(dev_data->devid, domain, pgtable,
2330+ dev_data->ats.enabled, dev_data->iommu_v2);
22592331 clone_aliases(dev_data->pdev);
22602332 }
22612333 }
22622334
2335+static void update_and_flush_device_table(struct protection_domain *domain,
2336+ struct domain_pgtable *pgtable)
2337+{
2338+ update_device_table(domain, pgtable);
2339+ domain_flush_devices(domain);
2340+}
2341+
22632342 static void update_domain(struct protection_domain *domain)
22642343 {
2265− update_device_table(domain);
2344+ struct domain_pgtable pgtable;
22662345
2267− domain_flush_devices(domain);
2346+ /* Update device table */
2347+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2348+ update_and_flush_device_table(domain, &pgtable);
2349+
2350+ /* Flush domain TLB(s) and wait for completion */
22682351 domain_flush_tlb_pde(domain);
2352+ domain_flush_complete(domain);
22692353 }
22702354
22712355 int __init amd_iommu_init_api(void)
@@ -2375,6 +2459,7 @@ out_err: · 103 unmodified lines
23752459 static struct iommu_domain *amd_iommu_domain_alloc(unsigned type)
23762460 {
23772461 struct protection_domain *pdomain;
2462+ u64 *pt_root, root;
23782463
23792464 switch (type) {
23802465 case IOMMU_DOMAIN_UNMANAGED:
@@ -2382,13 +2467,15 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type) · 1 unmodified line
23822467 if (!pdomain)
23832468 return NULL;
23842469
2385− pdomain->mode = PAGE_MODE_3_LEVEL;
2386− pdomain->pt_root = (void *)get_zeroed_page(GFP_KERNEL);
2387− if (!pdomain->pt_root) {
2470+ pt_root = (void *)get_zeroed_page(GFP_KERNEL);
2471+ if (!pt_root) {
23882472 protection_domain_free(pdomain);
23892473 return NULL;
23902474 }
23912475
2476+ root = amd_iommu_domain_encode_pgtable(pt_root, PAGE_MODE_3_LEVEL);
2477+ atomic64_set(&pdomain->pt_root, root);
2478+
23922479 pdomain->domain.geometry.aperture_start = 0;
23932480 pdomain->domain.geometry.aperture_end = ~0ULL;
23942481 pdomain->domain.geometry.force_aperture = true;
@@ -2406,7 +2493,7 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type) · 11 unmodified lines
24062493 if (!pdomain)
24072494 return NULL;
24082495
2409− pdomain->mode = PAGE_MODE_NONE;
2496+ atomic64_set(&pdomain->pt_root, PAGE_MODE_NONE);
24102497 break;
24112498 default:
24122499 return NULL;
@@ -2418,6 +2505,7 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type) · 5 unmodified lines
24182505 static void amd_iommu_domain_free(struct iommu_domain *dom)
24192506 {
24202507 struct protection_domain *domain;
2508+ struct domain_pgtable pgtable;
24212509
24222510 domain = to_pdomain(dom);
24232511
@@ -2435,7 +2523,9 @@ static void amd_iommu_domain_free(struct iommu_domain *dom) · 11 unmodified lines
24352523 dma_ops_domain_free(domain);
24362524 break;
24372525 default:
2438− if (domain->mode != PAGE_MODE_NONE)
2526+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2527+
2528+ if (pgtable.mode != PAGE_MODE_NONE)
24392529 free_pagetable(domain);
24402530
24412531 if (domain->flags & PD_IOMMUV2_MASK)
@@ -2518,10 +2608,12 @@ static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova, · 76 unmodified lines
25182608 gfp_t gfp)
25192609 {
25202610 struct protection_domain *domain = to_pdomain(dom);
2611+ struct domain_pgtable pgtable;
25212612 int prot = 0;
25222613 int ret;
25232614
2524− if (domain->mode == PAGE_MODE_NONE)
2615+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2616+ if (pgtable.mode == PAGE_MODE_NONE)
25252617 return -EINVAL;
25262618
25272619 if (iommu_prot & IOMMU_READ)
@@ -2541,8 +2633,10 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova, · 13 unmodified lines
25412633 struct iommu_iotlb_gather *gather)
25422634 {
25432635 struct protection_domain *domain = to_pdomain(dom);
2636+ struct domain_pgtable pgtable;
25442637
2545− if (domain->mode == PAGE_MODE_NONE)
2638+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2639+ if (pgtable.mode == PAGE_MODE_NONE)
25462640 return 0;
25472641
25482642 return iommu_unmap_page(domain, iova, page_size);
@@ -2553,9 +2647,11 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, · 4 unmodified lines
25532647 {
25542648 struct protection_domain *domain = to_pdomain(dom);
25552649 unsigned long offset_mask, pte_pgsize;
2650+ struct domain_pgtable pgtable;
25562651 u64 *pte, __pte;
25572652
2558− if (domain->mode == PAGE_MODE_NONE)
2653+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2654+ if (pgtable.mode == PAGE_MODE_NONE)
25592655 return iova;
25602656
25612657 pte = fetch_pte(domain, iova, &pte_pgsize);
@@ -2708,16 +2804,26 @@ EXPORT_SYMBOL(amd_iommu_unregister_ppr_notifier); · 146 unmodified lines
27082804 void amd_iommu_domain_direct_map(struct iommu_domain *dom)
27092805 {
27102806 struct protection_domain *domain = to_pdomain(dom);
2807+ struct domain_pgtable pgtable;
27112808 unsigned long flags;
2809+ u64 pt_root;
27122810
27132811 spin_lock_irqsave(&domain->lock, flags);
27142812
2813+ /* First save pgtable configuration*/
2814+ amd_iommu_domain_get_pgtable(domain, &pgtable);
2815+
27152816 /* Update data structure */
2716− domain->mode = PAGE_MODE_NONE;
2817+ pt_root = amd_iommu_domain_encode_pgtable(NULL, PAGE_MODE_NONE);
2818+ atomic64_set(&domain->pt_root, pt_root);
27172819
27182820 /* Make changes visible to IOMMUs */
27192821 update_domain(domain);
27202822
2823+ /* Restore old pgtable in domain->ptroot to free page-table */
2824+ pt_root = amd_iommu_domain_encode_pgtable(pgtable.root, pgtable.mode);
2825+ atomic64_set(&domain->pt_root, pt_root);
2826+
27212827 /* Page-table is not visible to IOMMU anymore, so free it */
27222828 free_pagetable(domain);
27232829
@@ -2908,9 +3014,11 @@ static u64 *__get_gcr3_pte(u64 *root, int level, int pasid, bool alloc) · 184 unmodified lines
29083014 static int __set_gcr3(struct protection_domain *domain, int pasid,
29093015 unsigned long cr3)
29103016 {
3017+ struct domain_pgtable pgtable;
29113018 u64 *pte;
29123019
2913− if (domain->mode != PAGE_MODE_NONE)
3020+ amd_iommu_domain_get_pgtable(domain, &pgtable);
3021+ if (pgtable.mode != PAGE_MODE_NONE)
29143022 return -EINVAL;
29153023
29163024 pte = __get_gcr3_pte(domain->gcr3_tbl, domain->glx, pasid, true);
@@ -2924,9 +3032,11 @@ static int __set_gcr3(struct protection_domain *domain, int pasid, · 7 unmodified lines
29243032
29253033 static int __clear_gcr3(struct protection_domain *domain, int pasid)
29263034 {
3035+ struct domain_pgtable pgtable;
29273036 u64 *pte;
29283037
2929− if (domain->mode != PAGE_MODE_NONE)
3038+ amd_iommu_domain_get_pgtable(domain, &pgtable);
3039+ if (pgtable.mode != PAGE_MODE_NONE)
29303040 return -EINVAL;
29313041
29323042 pte = __get_gcr3_pte(domain->gcr3_tbl, domain->glx, pasid, false);
drivers/iommu/amd_iommu_init.c+1−1
@@ -2936,7 +2936,7 @@ static int __init parse_amd_iommu_intr(char *str) · 2935 unmodified lines
29362936 {
29372937 for (; *str; ++str) {
29382938 if (strncmp(str, "legacy", 6) == 0) {
2939− amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY;
2939+ amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY_GA;
29402940 break;
29412941 }
29422942 if (strncmp(str, "vapic", 5) == 0) {
drivers/iommu/amd_iommu_types.h+7−2
@@ -468,8 +468,7 @@ struct protection_domain { · 467 unmodified lines
468468 iommu core code */
469469 spinlock_t lock; /* mostly used to lock the page table*/
470470 u16 id; /* the domain id written to the device table */
471− int mode; /* paging mode (0-6 levels) */
472− u64 *pt_root; /* page table root pointer */
471+ atomic64_t pt_root; /* pgtable root and pgtable mode */
473472 int glx; /* Number of levels for GCR3 table */
474473 u64 *gcr3_tbl; /* Guest CR3 table */
475474 unsigned long flags; /* flags to find out type of domain */
@@ -477,6 +476,12 @@ struct protection_domain { · 1 unmodified line
477476 unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
478477 };
479478
479+/* For decocded pt_root */
480+struct domain_pgtable {
481+ int mode;
482+ u64 *root;
483+};
484+
480485 /*
481486 * Structure where we save information about one hardware AMD IOMMU in the
482487 * system.
drivers/iommu/intel-iommu.c+2−2
@@ -371,11 +371,11 @@ int dmar_disabled = 0; · 370 unmodified lines
371371 int dmar_disabled = 1;
372372 #endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */
373373
374−#ifdef INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
374+#ifdef CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
375375 int intel_iommu_sm = 1;
376376 #else
377377 int intel_iommu_sm;
378−#endif /* INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
378+#endif /* CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
379379
380380 int intel_iommu_enabled = 0;
381381 EXPORT_SYMBOL_GPL(intel_iommu_enabled);
drivers/iommu/iommu.c+2−1
@@ -170,6 +170,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev) · 169 unmodified lines
170170
171171 static void dev_iommu_free(struct device *dev)
172172 {
173+ iommu_fwspec_free(dev);
173174 kfree(dev->iommu);
174175 dev->iommu = NULL;
175176 }
@@ -1428,7 +1429,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) · 1252 unmodified lines
14281429
14291430 return group;
14301431 }
1431−EXPORT_SYMBOL(iommu_group_get_for_dev);
1432+EXPORT_SYMBOL_GPL(iommu_group_get_for_dev);
14321433
14331434 struct iommu_domain *iommu_group_default_domain(struct iommu_group *group)
14341435 {
drivers/iommu/qcom_iommu.c+4−1
@@ -824,8 +824,11 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) · 823 unmodified lines
824824 qcom_iommu->dev = dev;
825825
826826 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
827− if (res)
827+ if (res) {
828828 qcom_iommu->local_base = devm_ioremap_resource(dev, res);
829+ if (IS_ERR(qcom_iommu->local_base))
830+ return PTR_ERR(qcom_iommu->local_base);
831+ }
829832
830833 qcom_iommu->iface_clk = devm_clk_get(dev, "iface");
831834 if (IS_ERR(qcom_iommu->iface_clk)) {
drivers/iommu/virtio-iommu.c+1−1
@@ -453,7 +453,7 @@ static int viommu_add_resv_mem(struct viommu_endpoint *vdev, · 452 unmodified lines
453453 if (!region)
454454 return -ENOMEM;
455455
456− list_add(&vdev->resv_regions, &region->list);
456+ list_add(&region->list, &vdev->resv_regions);
457457 return 0;
458458 }
459459
drivers/md/dm-mpath.c+4−2
@@ -585,10 +585,12 @@ static struct pgpath *__map_bio(struct multipath *m, struct bio *bio) · 584 unmodified lines
585585
586586 /* Do we need to select a new pgpath? */
587587 pgpath = READ_ONCE(m->current_pgpath);
588− queue_io = test_bit(MPATHF_QUEUE_IO, &m->flags);
589− if (!pgpath || !queue_io)
588+ if (!pgpath || !test_bit(MPATHF_QUEUE_IO, &m->flags))
590589 pgpath = choose_pgpath(m, bio->bi_iter.bi_size);
591590
591+ /* MPATHF_QUEUE_IO might have been cleared by choose_pgpath. */
592+ queue_io = test_bit(MPATHF_QUEUE_IO, &m->flags);
593+
592594 if ((pgpath && queue_io) ||
593595 (!pgpath && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))) {
594596 /* Queue for the daemon to resubmit */
drivers/md/dm-verity-fec.c+1−1
@@ -435,7 +435,7 @@ int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io, · 434 unmodified lines
435435 fio->level++;
436436
437437 if (type == DM_VERITY_BLOCK_TYPE_METADATA)
438− block += v->data_blocks;
438+ block = block - v->hash_start + v->data_blocks;
439439
440440 /*
441441 * For RS(M, N), the continuous FEC data is divided into blocks of N
drivers/md/dm-writecache.c+37−15
@@ -931,6 +931,24 @@ static int writecache_alloc_entries(struct dm_writecache *wc) · 930 unmodified lines
931931 return 0;
932932 }
933933
934+static int writecache_read_metadata(struct dm_writecache *wc, sector_t n_sectors)
935+{
936+ struct dm_io_region region;
937+ struct dm_io_request req;
938+
939+ region.bdev = wc->ssd_dev->bdev;
940+ region.sector = wc->start_sector;
941+ region.count = n_sectors;
942+ req.bi_op = REQ_OP_READ;
943+ req.bi_op_flags = REQ_SYNC;
944+ req.mem.type = DM_IO_VMA;
945+ req.mem.ptr.vma = (char *)wc->memory_map;
946+ req.client = wc->dm_io;
947+ req.notify.fn = NULL;
948+
949+ return dm_io(&req, 1, &region, NULL);
950+}
951+
934952 static void writecache_resume(struct dm_target *ti)
935953 {
936954 struct dm_writecache *wc = ti->private;
@@ -941,8 +959,18 @@ static void writecache_resume(struct dm_target *ti) · 4 unmodified lines
941959
942960 wc_lock(wc);
943961
944− if (WC_MODE_PMEM(wc))
962+ if (WC_MODE_PMEM(wc)) {
945963 persistent_memory_invalidate_cache(wc->memory_map, wc->memory_map_size);
964+ } else {
965+ r = writecache_read_metadata(wc, wc->metadata_sectors);
966+ if (r) {
967+ size_t sb_entries_offset;
968+ writecache_error(wc, r, "unable to read metadata: %d", r);
969+ sb_entries_offset = offsetof(struct wc_memory_superblock, entries);
970+ memset((char *)wc->memory_map + sb_entries_offset, -1,
971+ (wc->metadata_sectors << SECTOR_SHIFT) - sb_entries_offset);
972+ }
973+ }
946974
947975 wc->tree = RB_ROOT;
948976 INIT_LIST_HEAD(&wc->lru);
@@ -2102,6 +2130,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) · 1153 unmodified lines
21022130 ti->error = "Invalid block size";
21032131 goto bad;
21042132 }
2133+ if (wc->block_size < bdev_logical_block_size(wc->dev->bdev) ||
2134+ wc->block_size < bdev_logical_block_size(wc->ssd_dev->bdev)) {
2135+ r = -EINVAL;
2136+ ti->error = "Block size is smaller than device logical block size";
2137+ goto bad;
2138+ }
21052139 wc->block_size_bits = __ffs(wc->block_size);
21062140
21072141 wc->max_writeback_jobs = MAX_WRITEBACK_JOBS;
@@ -2200,8 +2234,6 @@ invalid_optional: · 92 unmodified lines
22002234 goto bad;
22012235 }
22022236 } else {
2203− struct dm_io_region region;
2204− struct dm_io_request req;
22052237 size_t n_blocks, n_metadata_blocks;
22062238 uint64_t n_bitmap_bits;
22072239
@@ -2258,19 +2290,9 @@ invalid_optional: · 50 unmodified lines
22582290 goto bad;
22592291 }
22602292
2261− region.bdev = wc->ssd_dev->bdev;
2262− region.sector = wc->start_sector;
2263− region.count = wc->metadata_sectors;
2264− req.bi_op = REQ_OP_READ;
2265− req.bi_op_flags = REQ_SYNC;
2266− req.mem.type = DM_IO_VMA;
2267− req.mem.ptr.vma = (char *)wc->memory_map;
2268− req.client = wc->dm_io;
2269− req.notify.fn = NULL;
2270−
2271− r = dm_io(&req, 1, &region, NULL);
2293+ r = writecache_read_metadata(wc, wc->block_size >> SECTOR_SHIFT);
22722294 if (r) {
2273− ti->error = "Unable to read metadata";
2295+ ti->error = "Unable to read first block of metadata";
22742296 goto bad;
22752297 }
22762298 }
drivers/misc/mei/hw-me.c+8−0
@@ -1465,6 +1465,13 @@ static const struct mei_cfg mei_me_pch12_cfg = { · 1464 unmodified lines
14651465 MEI_CFG_DMA_128,
14661466 };
14671467
1468+/* LBG with quirk for SPS Firmware exclusion */
1469+static const struct mei_cfg mei_me_pch12_sps_cfg = {
1470+ MEI_CFG_PCH8_HFS,
1471+ MEI_CFG_FW_VER_SUPP,
1472+ MEI_CFG_FW_SPS,
1473+};
1474+
14681475 /* Tiger Lake and newer devices */
14691476 static const struct mei_cfg mei_me_pch15_cfg = {
14701477 MEI_CFG_PCH8_HFS,
@@ -1487,6 +1494,7 @@ static const struct mei_cfg *const mei_cfg_list[] = { · 16 unmodified lines
14871494 [MEI_ME_PCH8_CFG] = &mei_me_pch8_cfg,
14881495 [MEI_ME_PCH8_SPS_CFG] = &mei_me_pch8_sps_cfg,
14891496 [MEI_ME_PCH12_CFG] = &mei_me_pch12_cfg,
1497+ [MEI_ME_PCH12_SPS_CFG] = &mei_me_pch12_sps_cfg,
14901498 [MEI_ME_PCH15_CFG] = &mei_me_pch15_cfg,
14911499 };
14921500
drivers/misc/mei/hw-me.h+4−0
@@ -80,6 +80,9 @@ struct mei_me_hw { · 79 unmodified lines
8080 * servers platforms with quirk for
8181 * SPS firmware exclusion.
8282 * @MEI_ME_PCH12_CFG: Platform Controller Hub Gen12 and newer
83+ * @MEI_ME_PCH12_SPS_CFG: Platform Controller Hub Gen12 and newer
84+ * servers platforms with quirk for
85+ * SPS firmware exclusion.
8386 * @MEI_ME_PCH15_CFG: Platform Controller Hub Gen15 and newer
8487 * @MEI_ME_NUM_CFG: Upper Sentinel.
8588 */
@@ -93,6 +96,7 @@ enum mei_cfg_idx { · 7 unmodified lines
9396 MEI_ME_PCH8_CFG,
9497 MEI_ME_PCH8_SPS_CFG,
9598 MEI_ME_PCH12_CFG,
99+ MEI_ME_PCH12_SPS_CFG,
96100 MEI_ME_PCH15_CFG,
97101 MEI_ME_NUM_CFG,
98102 };
drivers/misc/mei/pci-me.c+3−2
@@ -70,7 +70,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 69 unmodified lines
7070 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, MEI_ME_PCH8_CFG)},
7171 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_CFG)},
7272 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_CFG)},
73− {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_CFG)},
73+ {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_SPS_CFG)},
7474
7575 {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, MEI_ME_PCH8_CFG)},
7676 {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, MEI_ME_PCH8_CFG)},
@@ -203,11 +203,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 126 unmodified lines
203203 }
204204 hw = to_me_hw(dev);
205205 hw->mem_addr = pcim_iomap_table(pdev)[0];
206− hw->irq = pdev->irq;
207206 hw->read_fws = mei_me_read_fws;
208207
209208 pci_enable_msi(pdev);
210209
210+ hw->irq = pdev->irq;
211+
211212 /* request and enable interrupt */
212213 irqflags = pci_dev_msi_enabled(pdev) ? IRQF_ONESHOT : IRQF_SHARED;
213214
drivers/misc/mic/Kconfig+1−1
@@ -116,7 +116,7 @@ config MIC_COSM · 115 unmodified lines
116116
117117 config VOP
118118 tristate "VOP Driver"
119− depends on VOP_BUS
119+ depends on VOP_BUS && VHOST_DPN
120120 select VHOST_RING
121121 select VIRTIO
122122 help
drivers/mmc/core/mmc_ops.c+1−1
@@ -878,7 +878,7 @@ static int mmc_send_hpi_cmd(struct mmc_card *card) · 877 unmodified lines
878878 * Issued High Priority Interrupt, and check for card status
879879 * until out-of prg-state.
880880 */
881−int mmc_interrupt_hpi(struct mmc_card *card)
881+static int mmc_interrupt_hpi(struct mmc_card *card)
882882 {
883883 int err;
884884 u32 status;
drivers/mmc/host/cqhci.c+10−11
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #include <linux/delay.h>
66 #include <linux/highmem.h>
77 #include <linux/io.h>
8+#include <linux/iopoll.h>
89 #include <linux/module.h>
910 #include <linux/dma-mapping.h>
1011 #include <linux/slab.h>
@@ -349,12 +350,16 @@ static int cqhci_enable(struct mmc_host *mmc, struct mmc_card *card) · 338 unmodified lines
349350 /* CQHCI is idle and should halt immediately, so set a small timeout */
350351 #define CQHCI_OFF_TIMEOUT 100
351352
353+static u32 cqhci_read_ctl(struct cqhci_host *cq_host)
354+{
355+ return cqhci_readl(cq_host, CQHCI_CTL);
356+}
357+
352358 static void cqhci_off(struct mmc_host *mmc)
353359 {
354360 struct cqhci_host *cq_host = mmc->cqe_private;
355− ktime_t timeout;
356− bool timed_out;
357361 u32 reg;
362+ int err;
358363
359364 if (!cq_host->enabled || !mmc->cqe_on || cq_host->recovery_halt)
360365 return;
@@ -364,15 +369,9 @@ static void cqhci_off(struct mmc_host *mmc) · 3 unmodified lines
364369
365370 cqhci_writel(cq_host, CQHCI_HALT, CQHCI_CTL);
366371
367− timeout = ktime_add_us(ktime_get(), CQHCI_OFF_TIMEOUT);
368− while (1) {
369− timed_out = ktime_compare(ktime_get(), timeout) > 0;
370− reg = cqhci_readl(cq_host, CQHCI_CTL);
371− if ((reg & CQHCI_HALT) || timed_out)
372− break;
373− }
374−
375− if (timed_out)
372+ err = readx_poll_timeout(cqhci_read_ctl, cq_host, reg,
373+ reg & CQHCI_HALT, 0, CQHCI_OFF_TIMEOUT);
374+ if (err < 0)
376375 pr_err("%s: cqhci: CQE stuck on\n", mmc_hostname(mmc));
377376 else
378377 pr_debug("%s: cqhci: CQE off\n", mmc_hostname(mmc));
drivers/mmc/host/meson-mx-sdio.c+1−10
@@ -357,14 +357,6 @@ static void meson_mx_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) · 356 unmodified lines
357357 meson_mx_mmc_start_cmd(mmc, mrq->cmd);
358358 }
359359
360−static int meson_mx_mmc_card_busy(struct mmc_host *mmc)
361−{
362− struct meson_mx_mmc_host *host = mmc_priv(mmc);
363− u32 irqc = readl(host->base + MESON_MX_SDIO_IRQC);
364−
365− return !!(irqc & MESON_MX_SDIO_IRQC_FORCE_DATA_DAT_MASK);
366−}
367−
368360 static void meson_mx_mmc_read_response(struct mmc_host *mmc,
369361 struct mmc_command *cmd)
370362 {
@@ -506,7 +498,6 @@ static void meson_mx_mmc_timeout(struct timer_list *t) · 135 unmodified lines
506498 static struct mmc_host_ops meson_mx_mmc_ops = {
507499 .request = meson_mx_mmc_request,
508500 .set_ios = meson_mx_mmc_set_ios,
509− .card_busy = meson_mx_mmc_card_busy,
510501 .get_cd = mmc_gpio_get_cd,
511502 .get_ro = mmc_gpio_get_ro,
512503 };
@@ -570,7 +561,7 @@ static int meson_mx_mmc_add_host(struct meson_mx_mmc_host *host) · 57 unmodified lines
570561 mmc->f_max = clk_round_rate(host->cfg_div_clk,
571562 clk_get_rate(host->parent_clk));
572563
573− mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23;
564+ mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23 | MMC_CAP_WAIT_WHILE_BUSY;
574565 mmc->ops = &meson_mx_mmc_ops;
575566
576567 ret = mmc_of_parse(mmc);
drivers/mmc/host/sdhci-msm.c+2−0
@@ -2087,6 +2087,8 @@ static int sdhci_msm_probe(struct platform_device *pdev) · 2086 unmodified lines
20872087 goto clk_disable;
20882088 }
20892089
2090+ msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY;
2091+
20902092 pm_runtime_get_noresume(&pdev->dev);
20912093 pm_runtime_set_active(&pdev->dev);
20922094 pm_runtime_enable(&pdev->dev);
drivers/mmc/host/sdhci-pci-core.c+3−0
@@ -601,6 +601,9 @@ static int intel_select_drive_strength(struct mmc_card *card, · 600 unmodified lines
601601 struct sdhci_pci_slot *slot = sdhci_priv(host);
602602 struct intel_host *intel_host = sdhci_pci_priv(slot);
603603
604+ if (!(mmc_driver_type_mask(intel_host->drv_strength) & card_drv))
605+ return 0;
606+
604607 return intel_host->drv_strength;
605608 }
606609
drivers/mmc/host/sdhci-xenon.c+10−0
@@ -235,6 +235,16 @@ static void xenon_voltage_switch(struct sdhci_host *host) · 234 unmodified lines
235235 {
236236 /* Wait for 5ms after set 1.8V signal enable bit */
237237 usleep_range(5000, 5500);
238+
239+ /*
240+ * For some reason the controller's Host Control2 register reports
241+ * the bit representing 1.8V signaling as 0 when read after it was
242+ * written as 1. Subsequent read reports 1.
243+ *
244+ * Since this may cause some issues, do an empty read of the Host
245+ * Control2 register here to circumvent this.
246+ */
247+ sdhci_readw(host, SDHCI_HOST_CONTROL2);
238248 }
239249
240250 static const struct sdhci_ops sdhci_xenon_ops = {
drivers/most/core.c+1−1
@@ -1483,7 +1483,7 @@ static void __exit most_exit(void) · 1482 unmodified lines
14831483 ida_destroy(&mdev_id);
14841484 }
14851485
1486−module_init(most_init);
1486+subsys_initcall(most_init);
14871487 module_exit(most_exit);
14881488 MODULE_LICENSE("GPL");
14891489 MODULE_AUTHOR("Christian Gromm <christian.gromm@microchip.com>");
drivers/net/caif/Kconfig+1−1
@@ -50,7 +50,7 @@ config CAIF_HSI · 49 unmodified lines
5050
5151 config CAIF_VIRTIO
5252 tristate "CAIF virtio transport driver"
53− depends on CAIF && HAS_DMA
53+ depends on CAIF && HAS_DMA && VHOST_DPN
5454 select VHOST_RING
5555 select VIRTIO
5656 select GENERIC_ALLOCATOR
drivers/net/dsa/b53/b53_common.c+33−5
@@ -1474,6 +1474,10 @@ static int b53_arl_rw_op(struct b53_device *dev, unsigned int op) · 1473 unmodified lines
14741474 reg |= ARLTBL_RW;
14751475 else
14761476 reg &= ~ARLTBL_RW;
1477+ if (dev->vlan_enabled)
1478+ reg &= ~ARLTBL_IVL_SVL_SELECT;
1479+ else
1480+ reg |= ARLTBL_IVL_SVL_SELECT;
14771481 b53_write8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL, reg);
14781482
14791483 return b53_arl_op_wait(dev);
@@ -1483,6 +1487,7 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, · 3 unmodified lines
14831487 u16 vid, struct b53_arl_entry *ent, u8 *idx,
14841488 bool is_valid)
14851489 {
1490+ DECLARE_BITMAP(free_bins, B53_ARLTBL_MAX_BIN_ENTRIES);
14861491 unsigned int i;
14871492 int ret;
14881493
@@ -1490,6 +1495,8 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, · 1 unmodified line
14901495 if (ret)
14911496 return ret;
14921497
1498+ bitmap_zero(free_bins, dev->num_arl_entries);
1499+
14931500 /* Read the bins */
14941501 for (i = 0; i < dev->num_arl_entries; i++) {
14951502 u64 mac_vid;
@@ -1501,13 +1508,24 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, · 5 unmodified lines
15011508 B53_ARLTBL_DATA_ENTRY(i), &fwd_entry);
15021509 b53_arl_to_entry(ent, mac_vid, fwd_entry);
15031510
1504− if (!(fwd_entry & ARLTBL_VALID))
1511+ if (!(fwd_entry & ARLTBL_VALID)) {
1512+ set_bit(i, free_bins);
15051513 continue;
1514+ }
15061515 if ((mac_vid & ARLTBL_MAC_MASK) != mac)
15071516 continue;
1517+ if (dev->vlan_enabled &&
1518+ ((mac_vid >> ARLTBL_VID_S) & ARLTBL_VID_MASK) != vid)
1519+ continue;
15081520 *idx = i;
1521+ return 0;
15091522 }
15101523
1524+ if (bitmap_weight(free_bins, dev->num_arl_entries) == 0)
1525+ return -ENOSPC;
1526+
1527+ *idx = find_first_bit(free_bins, dev->num_arl_entries);
1528+
15111529 return -ENOENT;
15121530 }
15131531
@@ -1537,10 +1555,21 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, · 23 unmodified lines
15371555 if (op)
15381556 return ret;
15391557
1540− /* We could not find a matching MAC, so reset to a new entry */
1541− if (ret) {
1558+ switch (ret) {
1559+ case -ENOSPC:
1560+ dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n",
1561+ addr, vid);
1562+ return is_valid ? ret : 0;
1563+ case -ENOENT:
1564+ /* We could not find a matching MAC, so reset to a new entry */
1565+ dev_dbg(dev->dev, "{%pM,%.4d} not found, using idx: %d\n",
1566+ addr, vid, idx);
15421567 fwd_entry = 0;
1543− idx = 1;
1568+ break;
1569+ default:
1570+ dev_dbg(dev->dev, "{%pM,%.4d} found, using idx: %d\n",
1571+ addr, vid, idx);
1572+ break;
15441573 }
15451574
15461575 /* For multicast address, the port is a bitmask and the validity
@@ -1558,7 +1587,6 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, · 11 unmodified lines
15581587 ent.is_valid = !!(ent.port);
15591588 }
15601589
1561− ent.is_valid = is_valid;
15621590 ent.vid = vid;
15631591 ent.is_static = true;
15641592 ent.is_age = false;
drivers/net/dsa/b53/b53_regs.h+6−2
@@ -292,6 +292,7 @@ · 291 unmodified lines
292292 /* ARL Table Read/Write Register (8 bit) */
293293 #define B53_ARLTBL_RW_CTRL 0x00
294294 #define ARLTBL_RW BIT(0)
295+#define ARLTBL_IVL_SVL_SELECT BIT(6)
295296 #define ARLTBL_START_DONE BIT(7)
296297
297298 /* MAC Address Index Register (48 bit) */
@@ -304,7 +305,7 @@ · 6 unmodified lines
304305 *
305306 * BCM5325 and BCM5365 share most definitions below
306307 */
307−#define B53_ARLTBL_MAC_VID_ENTRY(n) (0x10 * (n))
308+#define B53_ARLTBL_MAC_VID_ENTRY(n) ((0x10 * (n)) + 0x10)
308309 #define ARLTBL_MAC_MASK 0xffffffffffffULL
309310 #define ARLTBL_VID_S 48
310311 #define ARLTBL_VID_MASK_25 0xff
@@ -316,13 +317,16 @@ · 5 unmodified lines
316317 #define ARLTBL_VALID_25 BIT(63)
317318
318319 /* ARL Table Data Entry N Registers (32 bit) */
319−#define B53_ARLTBL_DATA_ENTRY(n) ((0x10 * (n)) + 0x08)
320+#define B53_ARLTBL_DATA_ENTRY(n) ((0x10 * (n)) + 0x18)
320321 #define ARLTBL_DATA_PORT_ID_MASK 0x1ff
321322 #define ARLTBL_TC(tc) ((3 & tc) << 11)
322323 #define ARLTBL_AGE BIT(14)
323324 #define ARLTBL_STATIC BIT(15)
324325 #define ARLTBL_VALID BIT(16)
325326
327+/* Maximum number of bin entries in the ARL for all switches */
328+#define B53_ARLTBL_MAX_BIN_ENTRIES 4
329+
326330 /* ARL Search Control Register (8 bit) */
327331 #define B53_ARL_SRCH_CTL 0x50
328332 #define B53_ARL_SRCH_CTL_25 0x20
drivers/net/dsa/mv88e6xxx/Kconfig+1−1
@@ -24,8 +24,8 @@ config NET_DSA_MV88E6XXX_PTP · 23 unmodified lines
2424 bool "PTP support for Marvell 88E6xxx"
2525 default n
2626 depends on NET_DSA_MV88E6XXX_GLOBAL2
27+ depends on PTP_1588_CLOCK
2728 imply NETWORK_PHY_TIMESTAMPING
28− imply PTP_1588_CLOCK
2929 help
3030 Say Y to enable PTP hardware timestamping on Marvell 88E6xxx switch
3131 chips that support it.
drivers/net/dsa/mv88e6xxx/chip.c+0−4
@@ -3962,7 +3962,6 @@ static const struct mv88e6xxx_ops mv88e6190_ops = { · 3961 unmodified lines
39623962 .serdes_get_stats = mv88e6390_serdes_get_stats,
39633963 .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
39643964 .serdes_get_regs = mv88e6390_serdes_get_regs,
3965− .phylink_validate = mv88e6390_phylink_validate,
39663965 .gpio_ops = &mv88e6352_gpio_ops,
39673966 .phylink_validate = mv88e6390_phylink_validate,
39683967 };
@@ -4021,7 +4020,6 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = { · 52 unmodified lines
40214020 .serdes_get_stats = mv88e6390_serdes_get_stats,
40224021 .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
40234022 .serdes_get_regs = mv88e6390_serdes_get_regs,
4024− .phylink_validate = mv88e6390_phylink_validate,
40254023 .gpio_ops = &mv88e6352_gpio_ops,
40264024 .phylink_validate = mv88e6390x_phylink_validate,
40274025 };
@@ -4079,7 +4077,6 @@ static const struct mv88e6xxx_ops mv88e6191_ops = { · 51 unmodified lines
40794077 .serdes_get_stats = mv88e6390_serdes_get_stats,
40804078 .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
40814079 .serdes_get_regs = mv88e6390_serdes_get_regs,
4082− .phylink_validate = mv88e6390_phylink_validate,
40834080 .avb_ops = &mv88e6390_avb_ops,
40844081 .ptp_ops = &mv88e6352_ptp_ops,
40854082 .phylink_validate = mv88e6390_phylink_validate,
@@ -4235,7 +4232,6 @@ static const struct mv88e6xxx_ops mv88e6290_ops = { · 149 unmodified lines
42354232 .serdes_get_stats = mv88e6390_serdes_get_stats,
42364233 .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
42374234 .serdes_get_regs = mv88e6390_serdes_get_regs,
4238− .phylink_validate = mv88e6390_phylink_validate,
42394235 .gpio_ops = &mv88e6352_gpio_ops,
42404236 .avb_ops = &mv88e6390_avb_ops,
42414237 .ptp_ops = &mv88e6352_ptp_ops,
drivers/net/dsa/ocelot/felix.c+1−0
@@ -400,6 +400,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) · 399 unmodified lines
400400 ocelot->stats_layout = felix->info->stats_layout;
401401 ocelot->num_stats = felix->info->num_stats;
402402 ocelot->shared_queue_sz = felix->info->shared_queue_sz;
403+ ocelot->num_mact_rows = felix->info->num_mact_rows;
403404 ocelot->vcap_is2_keys = felix->info->vcap_is2_keys;
404405 ocelot->vcap_is2_actions= felix->info->vcap_is2_actions;
405406 ocelot->vcap = felix->info->vcap;
drivers/net/dsa/ocelot/felix.h+1−0
@@ -15,6 +15,7 @@ struct felix_info { · 14 unmodified lines
1515 const u32 *const *map;
1616 const struct ocelot_ops *ops;
1717 int shared_queue_sz;
18+ int num_mact_rows;
1819 const struct ocelot_stat_layout *stats_layout;
1920 unsigned int num_stats;
2021 int num_ports;
drivers/net/dsa/ocelot/felix_vsc9959.c+1−0
@@ -1220,6 +1220,7 @@ struct felix_info felix_info_vsc9959 = { · 1219 unmodified lines
12201220 .vcap_is2_actions = vsc9959_vcap_is2_actions,
12211221 .vcap = vsc9959_vcap_props,
12221222 .shared_queue_sz = 128 * 1024,
1223+ .num_mact_rows = 2048,
12231224 .num_ports = 6,
12241225 .switch_pci_bar = 4,
12251226 .imdio_pci_bar = 0,
drivers/net/dsa/sja1105/Kconfig+1−0
@@ -20,6 +20,7 @@ tristate "NXP SJA1105 Ethernet switch family support" · 19 unmodified lines
2020 config NET_DSA_SJA1105_PTP
2121 bool "Support for the PTP clock on the NXP SJA1105 Ethernet switch"
2222 depends on NET_DSA_SJA1105
23+ depends on PTP_1588_CLOCK
2324 help
2425 This enables support for timestamping and PTP clock manipulations in
2526 the SJA1105 DSA driver.
drivers/net/dsa/sja1105/sja1105_ptp.c+18−8
@@ -16,14 +16,15 @@ · 15 unmodified lines
1616
1717 /* PTPSYNCTS has no interrupt or update mechanism, because the intended
1818 * hardware use case is for the timestamp to be collected synchronously,
19− * immediately after the CAS_MASTER SJA1105 switch has triggered a CASSYNC
20− * pulse on the PTP_CLK pin. When used as a generic extts source, it needs
21− * polling and a comparison with the old value. The polling interval is just
22− * the Nyquist rate of a canonical PPS input (e.g. from a GPS module).
23− * Anything of higher frequency than 1 Hz will be lost, since there is no
24− * timestamp FIFO.
19+ * immediately after the CAS_MASTER SJA1105 switch has performed a CASSYNC
20+ * one-shot toggle (no return to level) on the PTP_CLK pin. When used as a
21+ * generic extts source, the PTPSYNCTS register needs polling and a comparison
22+ * with the old value. The polling interval is configured as the Nyquist rate
23+ * of a signal with 50% duty cycle and 1Hz frequency, which is sadly all that
24+ * this hardware can do (but may be enough for some setups). Anything of higher
25+ * frequency than 1 Hz will be lost, since there is no timestamp FIFO.
2526 */
26−#define SJA1105_EXTTS_INTERVAL (HZ / 2)
27+#define SJA1105_EXTTS_INTERVAL (HZ / 4)
2728
2829 /* This range is actually +/- SJA1105_MAX_ADJ_PPB
2930 * divided by 1000 (ppb -> ppm) and with a 16-bit
@@ -754,7 +755,16 @@ static int sja1105_extts_enable(struct sja1105_private *priv, · 724 unmodified lines
754755 return -EOPNOTSUPP;
755756
756757 /* Reject requests with unsupported flags */
757− if (extts->flags)
758+ if (extts->flags & ~(PTP_ENABLE_FEATURE |
759+ PTP_RISING_EDGE |
760+ PTP_FALLING_EDGE |
761+ PTP_STRICT_FLAGS))
762+ return -EOPNOTSUPP;
763+
764+ /* We can only enable time stamping on both edges, sadly. */
765+ if ((extts->flags & PTP_STRICT_FLAGS) &&
766+ (extts->flags & PTP_ENABLE_FEATURE) &&
767+ (extts->flags & PTP_EXTTS_EDGES) != PTP_EXTTS_EDGES)
758768 return -EOPNOTSUPP;
759769
760770 rc = sja1105_change_ptp_clk_pin_func(priv, PTP_PF_EXTTS);
drivers/net/ethernet/amazon/ena/ena_netdev.h+1−1
@@ -69,7 +69,7 @@ · 68 unmodified lines
6969 * 16kB.
7070 */
7171 #if PAGE_SIZE > SZ_16K
72−#define ENA_PAGE_SIZE SZ_16K
72+#define ENA_PAGE_SIZE (_AC(SZ_16K, UL))
7373 #else
7474 #define ENA_PAGE_SIZE PAGE_SIZE
7575 #endif
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c+1−1
@@ -57,7 +57,7 @@ static const struct aq_board_revision_s hw_atl_boards[] = { · 56 unmodified lines
5757 { AQ_DEVICE_ID_D108, AQ_HWREV_2, &hw_atl_ops_b0, &hw_atl_b0_caps_aqc108, },
5858 { AQ_DEVICE_ID_D109, AQ_HWREV_2, &hw_atl_ops_b0, &hw_atl_b0_caps_aqc109, },
5959
60− { AQ_DEVICE_ID_AQC100, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc107, },
60+ { AQ_DEVICE_ID_AQC100, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc100, },
6161 { AQ_DEVICE_ID_AQC107, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc107, },
6262 { AQ_DEVICE_ID_AQC108, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc108, },
6363 { AQ_DEVICE_ID_AQC109, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc109, },
drivers/net/ethernet/broadcom/bcmsysport.c+2−2
@@ -664,7 +664,8 @@ static struct sk_buff *bcm_sysport_rx_refill(struct bcm_sysport_priv *priv, · 663 unmodified lines
664664 dma_addr_t mapping;
665665
666666 /* Allocate a new SKB for a new packet */
667− skb = netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH);
667+ skb = __netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH,
668+ GFP_ATOMIC | __GFP_NOWARN);
668669 if (!skb) {
669670 priv->mib.alloc_rx_buff_failed++;
670671 netif_err(priv, rx_err, ndev, "SKB alloc failed\n");
@@ -2475,7 +2476,6 @@ static int bcm_sysport_probe(struct platform_device *pdev) · 1804 unmodified lines
24752476 priv->wol_irq = platform_get_irq(pdev, 1);
24762477 }
24772478 if (priv->irq0 <= 0 || (priv->irq1 <= 0 && !priv->is_lite)) {
2478− dev_err(&pdev->dev, "invalid interrupts\n");
24792479 ret = -EINVAL;
24802480 goto err_free_netdev;
24812481 }
drivers/net/ethernet/broadcom/bgmac-platform.c+2−7
@@ -202,13 +202,8 @@ static int bgmac_probe(struct platform_device *pdev) · 201 unmodified lines
202202 if (bgmac->irq < 0)
203203 return bgmac->irq;
204204
205− regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "amac_base");
206− if (!regs) {
207− dev_err(&pdev->dev, "Unable to obtain base resource\n");
208− return -EINVAL;
209− }
210−
211− bgmac->plat.base = devm_ioremap_resource(&pdev->dev, regs);
205+ bgmac->plat.base =
206+ devm_platform_ioremap_resource_byname(pdev, "amac_base");
212207 if (IS_ERR(bgmac->plat.base))
213208 return PTR_ERR(bgmac->plat.base);
214209
drivers/net/ethernet/broadcom/bnxt/bnxt.c+13−7
@@ -6642,7 +6642,7 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp, · 6641 unmodified lines
66426642 int rc;
66436643
66446644 if (!mem_size)
6645− return 0;
6645+ return -EINVAL;
66466646
66476647 ctx_pg->nr_pages = DIV_ROUND_UP(mem_size, BNXT_PAGE_SIZE);
66486648 if (ctx_pg->nr_pages > MAX_CTX_TOTAL_PAGES) {
@@ -9780,6 +9780,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, · 3131 unmodified lines
97809780 netdev_features_t features)
97819781 {
97829782 struct bnxt *bp = netdev_priv(dev);
9783+ netdev_features_t vlan_features;
97839784
97849785 if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
97859786 features &= ~NETIF_F_NTUPLE;
@@ -9796,12 +9797,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, · 10 unmodified lines
97969797 /* Both CTAG and STAG VLAN accelaration on the RX side have to be
97979798 * turned on or off together.
97989799 */
9799− if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) !=
9800− (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) {
9800+ vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX |
9801+ NETIF_F_HW_VLAN_STAG_RX);
9802+ if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX |
9803+ NETIF_F_HW_VLAN_STAG_RX)) {
98019804 if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
98029805 features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
98039806 NETIF_F_HW_VLAN_STAG_RX);
9804− else
9807+ else if (vlan_features)
98059808 features |= NETIF_F_HW_VLAN_CTAG_RX |
98069809 NETIF_F_HW_VLAN_STAG_RX;
98079810 }
@@ -12212,12 +12215,15 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) · 2404 unmodified lines
1221212215 bnxt_ulp_start(bp, err);
1221312216 }
1221412217
12215− if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
12216− dev_close(netdev);
12218+ if (result != PCI_ERS_RESULT_RECOVERED) {
12219+ if (netif_running(netdev))
12220+ dev_close(netdev);
12221+ pci_disable_device(pdev);
12222+ }
1221712223
1221812224 rtnl_unlock();
1221912225
12220− return PCI_ERS_RESULT_RECOVERED;
12226+ return result;
1222112227 }
1222212228
1222312229 /**
drivers/net/ethernet/broadcom/bnxt/bnxt.h+0−1
@@ -1066,7 +1066,6 @@ struct bnxt_vf_info { · 1065 unmodified lines
10661066 #define BNXT_VF_LINK_FORCED 0x4
10671067 #define BNXT_VF_LINK_UP 0x8
10681068 #define BNXT_VF_TRUST 0x10
1069− u32 func_flags; /* func cfg flags */
10701069 u32 min_tx_rate;
10711070 u32 max_tx_rate;
10721071 void *hwrm_cmd_req_addr;
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h+1−1
@@ -43,7 +43,7 @@ static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl) · 42 unmodified lines
4343 #define BNXT_NVM_CFG_VER_BITS 24
4444 #define BNXT_NVM_CFG_VER_BYTES 4
4545
46−#define BNXT_MSIX_VEC_MAX 1280
46+#define BNXT_MSIX_VEC_MAX 512
4747 #define BNXT_MSIX_VEC_MIN_MAX 128
4848
4949 enum bnxt_nvm_dir_type {
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c+2−8
@@ -85,11 +85,10 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting) · 84 unmodified lines
8585 if (old_setting == setting)
8686 return 0;
8787
88− func_flags = vf->func_flags;
8988 if (setting)
90− func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE;
89+ func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE;
9190 else
92− func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE;
91+ func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE;
9392 /*TODO: if the driver supports VLAN filter on guest VLAN,
9493 * the spoof check should also include vlan anti-spoofing
9594 */
@@ -98,7 +97,6 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting) · 2 unmodified lines
9897 req.flags = cpu_to_le32(func_flags);
9998 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
10099 if (!rc) {
101− vf->func_flags = func_flags;
102100 if (setting)
103101 vf->flags |= BNXT_VF_SPOOFCHK;
104102 else
@@ -228,7 +226,6 @@ int bnxt_set_vf_mac(struct net_device *dev, int vf_id, u8 *mac) · 123 unmodified lines
228226 memcpy(vf->mac_addr, mac, ETH_ALEN);
229227 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
230228 req.fid = cpu_to_le16(vf->fw_fid);
231− req.flags = cpu_to_le32(vf->func_flags);
232229 req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR);
233230 memcpy(req.dflt_mac_addr, mac, ETH_ALEN);
234231 return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
@@ -266,7 +263,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos, · 31 unmodified lines
266263
267264 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
268265 req.fid = cpu_to_le16(vf->fw_fid);
269− req.flags = cpu_to_le32(vf->func_flags);
270266 req.dflt_vlan = cpu_to_le16(vlan_tag);
271267 req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_VLAN);
272268 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
@@ -305,7 +301,6 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate, · 32 unmodified lines
305301 return 0;
306302 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
307303 req.fid = cpu_to_le16(vf->fw_fid);
308− req.flags = cpu_to_le32(vf->func_flags);
309304 req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_MAX_BW);
310305 req.max_bw = cpu_to_le32(max_tx_rate);
311306 req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_MIN_BW);
@@ -477,7 +472,6 @@ static void __bnxt_set_vf_params(struct bnxt *bp, int vf_id) · 165 unmodified lines
477472 vf = &bp->pf.vf[vf_id];
478473 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
479474 req.fid = cpu_to_le16(vf->fw_fid);
480− req.flags = cpu_to_le32(vf->func_flags);
481475
482476 if (is_valid_ether_addr(vf->mac_addr)) {
483477 req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR);
drivers/net/ethernet/broadcom/genet/bcmgenet.c+5−1
@@ -934,6 +934,8 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev, · 933 unmodified lines
934934 if (netif_running(dev))
935935 bcmgenet_update_mib_counters(priv);
936936
937+ dev->netdev_ops->ndo_get_stats(dev);
938+
937939 for (i = 0; i < BCMGENET_STATS_LEN; i++) {
938940 const struct bcmgenet_stats *s;
939941 char *p;
@@ -1622,7 +1624,8 @@ static struct sk_buff *bcmgenet_rx_refill(struct bcmgenet_priv *priv, · 682 unmodified lines
16221624 dma_addr_t mapping;
16231625
16241626 /* Allocate a new Rx skb */
1625− skb = netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT);
1627+ skb = __netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT,
1628+ GFP_ATOMIC | __GFP_NOWARN);
16261629 if (!skb) {
16271630 priv->mib.alloc_rx_buff_failed++;
16281631 netif_err(priv, rx_err, priv->dev,
@@ -3156,6 +3159,7 @@ static struct net_device_stats *bcmgenet_get_stats(struct net_device *dev) · 1527 unmodified lines
31563159 dev->stats.rx_packets = rx_packets;
31573160 dev->stats.rx_errors = rx_errors;
31583161 dev->stats.rx_missed_errors = rx_errors;
3162+ dev->stats.rx_dropped = rx_dropped;
31593163 return &dev->stats;
31603164 }
31613165
drivers/net/ethernet/cadence/Kconfig+1−1
@@ -35,8 +35,8 @@ config MACB · 34 unmodified lines
3535 config MACB_USE_HWSTAMP
3636 bool "Use IEEE 1588 hwstamp"
3737 depends on MACB
38+ depends on PTP_1588_CLOCK
3839 default y
39− imply PTP_1588_CLOCK
4040 ---help---
4141 Enable IEEE 1588 Precision Time Protocol (PTP) support for MACB.
4242
drivers/net/ethernet/cadence/macb_main.c+12−12
@@ -334,8 +334,10 @@ static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum) · 333 unmodified lines
334334 int status;
335335
336336 status = pm_runtime_get_sync(&bp->pdev->dev);
337− if (status < 0)
337+ if (status < 0) {
338+ pm_runtime_put_noidle(&bp->pdev->dev);
338339 goto mdio_pm_exit;
340+ }
339341
340342 status = macb_mdio_wait_for_idle(bp);
341343 if (status < 0)
@@ -386,8 +388,10 @@ static int macb_mdio_write(struct mii_bus *bus, int mii_id, int regnum, · 44 unmodified lines
386388 int status;
387389
388390 status = pm_runtime_get_sync(&bp->pdev->dev);
389− if (status < 0)
391+ if (status < 0) {
392+ pm_runtime_put_noidle(&bp->pdev->dev);
390393 goto mdio_pm_exit;
394+ }
391395
392396 status = macb_mdio_wait_for_idle(bp);
393397 if (status < 0)
@@ -3816,8 +3820,10 @@ static int at91ether_open(struct net_device *dev) · 3422 unmodified lines
38163820 int ret;
38173821
38183822 ret = pm_runtime_get_sync(&lp->pdev->dev);
3819− if (ret < 0)
3823+ if (ret < 0) {
3824+ pm_runtime_put_noidle(&lp->pdev->dev);
38203825 return ret;
3826+ }
38213827
38223828 /* Clear internal statistics */
38233829 ctl = macb_readl(lp, NCR);
@@ -4172,15 +4178,9 @@ static int fu540_c000_clk_init(struct platform_device *pdev, struct clk **pclk, · 348 unmodified lines
41724178
41734179 static int fu540_c000_init(struct platform_device *pdev)
41744180 {
4175− struct resource *res;
4176−
4177− res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
4178− if (!res)
4179− return -ENODEV;
4180−
4181− mgmt->reg = ioremap(res->start, resource_size(res));
4182− if (!mgmt->reg)
4183− return -ENOMEM;
4181+ mgmt->reg = devm_platform_ioremap_resource(pdev, 1);
4182+ if (IS_ERR(mgmt->reg))
4183+ return PTR_ERR(mgmt->reg);
41844184
41854185 return macb_init(pdev);
41864186 }
drivers/net/ethernet/cavium/Kconfig+1−1
@@ -54,7 +54,7 @@ config THUNDER_NIC_RGX · 53 unmodified lines
5454 config CAVIUM_PTP
5555 tristate "Cavium PTP coprocessor as PTP clock"
5656 depends on 64BIT && PCI
57− imply PTP_1588_CLOCK
57+ depends on PTP_1588_CLOCK
5858 ---help---
5959 This driver adds support for the Precision Time Protocol Clocks and
6060 Timestamping coprocessor (PTP) found on Cavium processors.
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c+20−7
@@ -1049,9 +1049,9 @@ static void cudbg_t4_fwcache(struct cudbg_init *pdbg_init, · 1048 unmodified lines
10491049 }
10501050 }
10511051
1052−static unsigned long cudbg_mem_region_size(struct cudbg_init *pdbg_init,
1053− struct cudbg_error *cudbg_err,
1054− u8 mem_type)
1052+static int cudbg_mem_region_size(struct cudbg_init *pdbg_init,
1053+ struct cudbg_error *cudbg_err,
1054+ u8 mem_type, unsigned long *region_size)
10551055 {
10561056 struct adapter *padap = pdbg_init->adap;
10571057 struct cudbg_meminfo mem_info;
@@ -1060,15 +1060,23 @@ static unsigned long cudbg_mem_region_size(struct cudbg_init *pdbg_init, · 2 unmodified lines
10601060
10611061 memset(&mem_info, 0, sizeof(struct cudbg_meminfo));
10621062 rc = cudbg_fill_meminfo(padap, &mem_info);
1063− if (rc)
1063+ if (rc) {
1064+ cudbg_err->sys_err = rc;
10641065 return rc;
1066+ }
10651067
10661068 cudbg_t4_fwcache(pdbg_init, cudbg_err);
10671069 rc = cudbg_meminfo_get_mem_index(padap, &mem_info, mem_type, &mc_idx);
1068− if (rc)
1070+ if (rc) {
1071+ cudbg_err->sys_err = rc;
10691072 return rc;
1073+ }
1074+
1075+ if (region_size)
1076+ *region_size = mem_info.avail[mc_idx].limit -
1077+ mem_info.avail[mc_idx].base;
10701078
1071− return mem_info.avail[mc_idx].limit - mem_info.avail[mc_idx].base;
1079+ return 0;
10721080 }
10731081
10741082 static int cudbg_collect_mem_region(struct cudbg_init *pdbg_init,
@@ -1076,7 +1084,12 @@ static int cudbg_collect_mem_region(struct cudbg_init *pdbg_init, · 1 unmodified line
10761084 struct cudbg_error *cudbg_err,
10771085 u8 mem_type)
10781086 {
1079− unsigned long size = cudbg_mem_region_size(pdbg_init, cudbg_err, mem_type);
1087+ unsigned long size = 0;
1088+ int rc;
1089+
1090+ rc = cudbg_mem_region_size(pdbg_init, cudbg_err, mem_type, &size);
1091+ if (rc)
1092+ return rc;
10801093
10811094 return cudbg_read_fw_mem(pdbg_init, dbg_buff, mem_type, size,
10821095 cudbg_err);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c+6−21
@@ -311,32 +311,17 @@ static int cxgb4_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) · 310 unmodified lines
311311 */
312312 static int cxgb4_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
313313 {
314− struct adapter *adapter = (struct adapter *)container_of(ptp,
315− struct adapter, ptp_clock_info);
316− struct fw_ptp_cmd c;
314+ struct adapter *adapter = container_of(ptp, struct adapter,
315+ ptp_clock_info);
317316 u64 ns;
318− int err;
319−
320− memset(&c, 0, sizeof(c));
321− c.op_to_portid = cpu_to_be32(FW_CMD_OP_V(FW_PTP_CMD) |
322− FW_CMD_REQUEST_F |
323− FW_CMD_READ_F |
324− FW_PTP_CMD_PORTID_V(0));
325− c.retval_len16 = cpu_to_be32(FW_CMD_LEN16_V(sizeof(c) / 16));
326− c.u.ts.sc = FW_PTP_SC_GET_TIME;
327317
328− err = t4_wr_mbox(adapter, adapter->mbox, &c, sizeof(c), &c);
329− if (err < 0) {
330− dev_err(adapter->pdev_dev,
331− "PTP: %s error %d\n", __func__, -err);
332− return err;
333− }
318+ ns = t4_read_reg(adapter, T5_PORT_REG(0, MAC_PORT_PTP_SUM_LO_A));
319+ ns |= (u64)t4_read_reg(adapter,
320+ T5_PORT_REG(0, MAC_PORT_PTP_SUM_HI_A)) << 32;
334321
335322 /* convert to timespec*/
336− ns = be64_to_cpu(c.u.ts.tm);
337323 *ts = ns_to_timespec64(ns);
338−
339− return err;
324+ return 0;
340325 }
341326
342327 /**
drivers/net/ethernet/chelsio/cxgb4/sge.c+37−3
@@ -2207,6 +2207,9 @@ static void ethofld_hard_xmit(struct net_device *dev, · 2206 unmodified lines
22072207 if (unlikely(skip_eotx_wr)) {
22082208 start = (u64 *)wr;
22092209 eosw_txq->state = next_state;
2210+ eosw_txq->cred -= wrlen16;
2211+ eosw_txq->ncompl++;
2212+ eosw_txq->last_compl = 0;
22102213 goto write_wr_headers;
22112214 }
22122215
@@ -2365,6 +2368,34 @@ netdev_tx_t t4_start_xmit(struct sk_buff *skb, struct net_device *dev) · 152 unmodified lines
23652368 return cxgb4_eth_xmit(skb, dev);
23662369 }
23672370
2371+static void eosw_txq_flush_pending_skbs(struct sge_eosw_txq *eosw_txq)
2372+{
2373+ int pktcount = eosw_txq->pidx - eosw_txq->last_pidx;
2374+ int pidx = eosw_txq->pidx;
2375+ struct sk_buff *skb;
2376+
2377+ if (!pktcount)
2378+ return;
2379+
2380+ if (pktcount < 0)
2381+ pktcount += eosw_txq->ndesc;
2382+
2383+ while (pktcount--) {
2384+ pidx--;
2385+ if (pidx < 0)
2386+ pidx += eosw_txq->ndesc;
2387+
2388+ skb = eosw_txq->desc[pidx].skb;
2389+ if (skb) {
2390+ dev_consume_skb_any(skb);
2391+ eosw_txq->desc[pidx].skb = NULL;
2392+ eosw_txq->inuse--;
2393+ }
2394+ }
2395+
2396+ eosw_txq->pidx = eosw_txq->last_pidx + 1;
2397+}
2398+
23682399 /**
23692400 * cxgb4_ethofld_send_flowc - Send ETHOFLD flowc request to bind eotid to tc.
23702401 * @dev - netdevice
@@ -2440,9 +2471,11 @@ int cxgb4_ethofld_send_flowc(struct net_device *dev, u32 eotid, u32 tc) · 69 unmodified lines
24402471 FW_FLOWC_MNEM_EOSTATE_CLOSING :
24412472 FW_FLOWC_MNEM_EOSTATE_ESTABLISHED);
24422473
2443− eosw_txq->cred -= len16;
2444− eosw_txq->ncompl++;
2445− eosw_txq->last_compl = 0;
2474+ /* Free up any pending skbs to ensure there's room for
2475+ * termination FLOWC.
2476+ */
2477+ if (tc == FW_SCHED_CLS_NONE)
2478+ eosw_txq_flush_pending_skbs(eosw_txq);
24462479
24472480 ret = eosw_txq_enqueue(eosw_txq, skb);
24482481 if (ret) {
@@ -2695,6 +2728,7 @@ static void ofldtxq_stop(struct sge_uld_txq *q, struct fw_wr_hdr *wr) · 246 unmodified lines
26952728 * is ever running at a time ...
26962729 */
26972730 static void service_ofldq(struct sge_uld_txq *q)
2731+ __must_hold(&q->sendq.lock)
26982732 {
26992733 u64 *pos, *before, *end;
27002734 int credits;
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h+3−0
@@ -1906,6 +1906,9 @@ · 1905 unmodified lines
19061906
19071907 #define MAC_PORT_CFG2_A 0x818
19081908
1909+#define MAC_PORT_PTP_SUM_LO_A 0x990
1910+#define MAC_PORT_PTP_SUM_HI_A 0x994
1911+
19091912 #define MPS_CMN_CTL_A 0x9000
19101913
19111914 #define COUNTPAUSEMCRX_S 5
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c+1−1
@@ -74,8 +74,8 @@ err_pci_mem_reg: · 73 unmodified lines
7474 pci_disable_device(pdev);
7575 err_pci_enable:
7676 err_mdiobus_alloc:
77− iounmap(port_regs);
7877 err_hw_alloc:
78+ iounmap(port_regs);
7979 err_ioremap:
8080 return err;
8181 }
drivers/net/ethernet/ibm/ibmvnic.c+2−1
@@ -2189,7 +2189,8 @@ static void __ibmvnic_reset(struct work_struct *work) · 2188 unmodified lines
21892189 rc = do_hard_reset(adapter, rwi, reset_state);
21902190 rtnl_unlock();
21912191 }
2192− } else {
2192+ } else if (!(rwi->reset_reason == VNIC_RESET_FATAL &&
2193+ adapter->from_passive_init)) {
21932194 rc = do_reset(adapter, rwi, reset_state);
21942195 }
21952196 kfree(rwi);
drivers/net/ethernet/intel/e1000/e1000_main.c+1−1
@@ -1476,7 +1476,7 @@ static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start, · 1475 unmodified lines
14761476 if (hw->mac_type == e1000_82545 ||
14771477 hw->mac_type == e1000_ce4100 ||
14781478 hw->mac_type == e1000_82546) {
1479− return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
1479+ return ((begin ^ (end - 1)) >> 16) == 0;
14801480 }
14811481
14821482 return true;
drivers/net/ethernet/intel/i40e/i40e_main.c+2−2
@@ -1611,7 +1611,7 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed, · 1610 unmodified lines
16111611 }
16121612 }
16131613 if (lut) {
1614− bool pf_lut = vsi->type == I40E_VSI_MAIN ? true : false;
1614+ bool pf_lut = vsi->type == I40E_VSI_MAIN;
16151615
16161616 ret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);
16171617 if (ret) {
@@ -11436,7 +11436,7 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed, · 9818 unmodified lines
1143611436 }
1143711437
1143811438 if (lut) {
11439− bool pf_lut = vsi->type == I40E_VSI_MAIN ? true : false;
11439+ bool pf_lut = vsi->type == I40E_VSI_MAIN;
1144011440
1144111441 ret = i40e_aq_get_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);
1144211442 if (ret) {
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c+3−0
@@ -1428,6 +1428,9 @@ int mvpp2_ethtool_cls_rule_del(struct mvpp2_port *port, · 1427 unmodified lines
14281428 struct mvpp2_ethtool_fs *efs;
14291429 int ret;
14301430
1431+ if (info->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW)
1432+ return -EINVAL;
1433+
14311434 efs = port->rfs_rules[info->fs.location];
14321435 if (!efs)
14331436 return -EINVAL;
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+2−0
@@ -4329,6 +4329,8 @@ static int mvpp2_ethtool_get_rxfh_context(struct net_device *dev, u32 *indir, · 4328 unmodified lines
43294329
43304330 if (!mvpp22_rss_is_supported())
43314331 return -EOPNOTSUPP;
4332+ if (rss_context >= MVPP22_N_RSS_TABLES)
4333+ return -EINVAL;
43324334
43334335 if (hfunc)
43344336 *hfunc = ETH_RSS_HASH_CRC32;
drivers/net/ethernet/mellanox/mlx4/en_tx.c+13−1
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include <linux/ip.h>
4444 #include <linux/ipv6.h>
4545 #include <linux/moduleparam.h>
46+#include <linux/indirect_call_wrapper.h>
4647
4748 #include "mlx4_en.h"
4849
@@ -261,6 +262,10 @@ static void mlx4_en_stamp_wqe(struct mlx4_en_priv *priv, · 212 unmodified lines
261262 }
262263 }
263264
265+INDIRECT_CALLABLE_DECLARE(u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
266+ struct mlx4_en_tx_ring *ring,
267+ int index, u64 timestamp,
268+ int napi_mode));
264269
265270 u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
266271 struct mlx4_en_tx_ring *ring,
@@ -329,6 +334,11 @@ u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv, · 62 unmodified lines
329334 return tx_info->nr_txbb;
330335 }
331336
337+INDIRECT_CALLABLE_DECLARE(u32 mlx4_en_recycle_tx_desc(struct mlx4_en_priv *priv,
338+ struct mlx4_en_tx_ring *ring,
339+ int index, u64 timestamp,
340+ int napi_mode));
341+
332342 u32 mlx4_en_recycle_tx_desc(struct mlx4_en_priv *priv,
333343 struct mlx4_en_tx_ring *ring,
334344 int index, u64 timestamp,
@@ -449,7 +459,9 @@ bool mlx4_en_process_tx_cq(struct net_device *dev, · 114 unmodified lines
449459 timestamp = mlx4_en_get_cqe_ts(cqe);
450460
451461 /* free next descriptor */
452− last_nr_txbb = ring->free_tx_desc(
462+ last_nr_txbb = INDIRECT_CALL_2(ring->free_tx_desc,
463+ mlx4_en_free_tx_desc,
464+ mlx4_en_recycle_tx_desc,
453465 priv, ring, ring_index,
454466 timestamp, napi_budget);
455467
drivers/net/ethernet/mellanox/mlx4/main.c+3−1
@@ -2550,6 +2550,7 @@ static int mlx4_allocate_default_counters(struct mlx4_dev *dev) · 2549 unmodified lines
25502550
25512551 if (!err || err == -ENOSPC) {
25522552 priv->def_counter[port] = idx;
2553+ err = 0;
25532554 } else if (err == -ENOENT) {
25542555 err = 0;
25552556 continue;
@@ -2600,7 +2601,8 @@ int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx, u8 usage) · 44 unmodified lines
26002601 MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
26012602 if (!err)
26022603 *idx = get_param_l(&out_param);
2603−
2604+ if (WARN_ON(err == -ENOSPC))
2605+ err = -EINVAL;
26042606 return err;
26052607 }
26062608 return __mlx4_counter_alloc(dev, idx);
drivers/net/ethernet/mellanox/mlx5/core/Kconfig+4−4
@@ -7,10 +7,10 @@ config MLX5_CORE · 6 unmodified lines
77 tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
88 depends on PCI
99 select NET_DEVLINK
10− imply PTP_1588_CLOCK
11− imply VXLAN
12− imply MLXFW
13− imply PCI_HYPERV_INTERFACE
10+ depends on VXLAN || !VXLAN
11+ depends on MLXFW || !MLXFW
12+ depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
13+ depends on PCI_HYPERV_INTERFACE || !PCI_HYPERV_INTERFACE
1414 default n
1515 ---help---
1616 Core driver for low level functionality of the ConnectX-4 and
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+5−1
@@ -888,7 +888,6 @@ static void cmd_work_handler(struct work_struct *work) · 887 unmodified lines
888888 }
889889
890890 cmd->ent_arr[ent->idx] = ent;
891− set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state);
892891 lay = get_inst(cmd, ent->idx);
893892 ent->lay = lay;
894893 memset(lay, 0, sizeof(*lay));
@@ -910,6 +909,7 @@ static void cmd_work_handler(struct work_struct *work) · 15 unmodified lines
910909
911910 if (ent->callback)
912911 schedule_delayed_work(&ent->cb_timeout_work, cb_timeout);
912+ set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state);
913913
914914 /* Skip sending command to fw if internal error */
915915 if (pci_channel_offline(dev->pdev) ||
@@ -922,6 +922,10 @@ static void cmd_work_handler(struct work_struct *work) · 6 unmodified lines
922922 MLX5_SET(mbox_out, ent->out, syndrome, drv_synd);
923923
924924 mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
925+ /* no doorbell, no need to keep the entry */
926+ free_ent(cmd, ent->idx);
927+ if (ent->callback)
928+ free_cmd(ent);
925929 return;
926930 }
927931
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c+3−3
@@ -935,7 +935,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) · 934 unmodified lines
935935 return NULL;
936936 }
937937
938− tracer = kzalloc(sizeof(*tracer), GFP_KERNEL);
938+ tracer = kvzalloc(sizeof(*tracer), GFP_KERNEL);
939939 if (!tracer)
940940 return ERR_PTR(-ENOMEM);
941941
@@ -982,7 +982,7 @@ destroy_workqueue: · 40 unmodified lines
982982 tracer->dev = NULL;
983983 destroy_workqueue(tracer->work_queue);
984984 free_tracer:
985− kfree(tracer);
985+ kvfree(tracer);
986986 return ERR_PTR(err);
987987 }
988988
@@ -1061,7 +1061,7 @@ void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer) · 72 unmodified lines
10611061 mlx5_fw_tracer_destroy_log_buf(tracer);
10621062 flush_workqueue(tracer->work_queue);
10631063 destroy_workqueue(tracer->work_queue);
1064− kfree(tracer);
1064+ kvfree(tracer);
10651065 }
10661066
10671067 static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void *data)
drivers/net/ethernet/mellanox/mlx5/core/en.h+2−1
@@ -367,6 +367,7 @@ enum { · 366 unmodified lines
367367 MLX5E_SQ_STATE_AM,
368368 MLX5E_SQ_STATE_TLS,
369369 MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE,
370+ MLX5E_SQ_STATE_PENDING_XSK_TX,
370371 };
371372
372373 struct mlx5e_sq_wqe_info {
@@ -960,7 +961,7 @@ void mlx5e_page_release_dynamic(struct mlx5e_rq *rq, · 587 unmodified lines
960961 void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe);
961962 void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe);
962963 bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq);
963−void mlx5e_poll_ico_cq(struct mlx5e_cq *cq);
964+int mlx5e_poll_ico_cq(struct mlx5e_cq *cq);
964965 bool mlx5e_post_rx_mpwqes(struct mlx5e_rq *rq);
965966 void mlx5e_dealloc_rx_wqe(struct mlx5e_rq *rq, u16 ix);
966967 void mlx5e_dealloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix);
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+12−11
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <net/flow_offload.h>
1313 #include <net/netfilter/nf_flow_table.h>
1414 #include <linux/workqueue.h>
15+#include <linux/xarray.h>
1516
1617 #include "esw/chains.h"
1718 #include "en/tc_ct.h"
@@ -35,7 +36,7 @@ struct mlx5_tc_ct_priv { · 17 unmodified lines
3536 struct mlx5_eswitch *esw;
3637 const struct net_device *netdev;
3738 struct idr fte_ids;
38− struct idr tuple_ids;
39+ struct xarray tuple_ids;
3940 struct rhashtable zone_ht;
4041 struct mlx5_flow_table *ct;
4142 struct mlx5_flow_table *ct_nat;
@@ -238,7 +239,7 @@ mlx5_tc_ct_entry_del_rule(struct mlx5_tc_ct_priv *ct_priv, · 196 unmodified lines
238239
239240 mlx5_eswitch_del_offloaded_rule(esw, zone_rule->rule, attr);
240241 mlx5_modify_header_dealloc(esw->dev, attr->modify_hdr);
241− idr_remove(&ct_priv->tuple_ids, zone_rule->tupleid);
242+ xa_erase(&ct_priv->tuple_ids, zone_rule->tupleid);
242243 }
243244
244245 static void
@@ -483,7 +484,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 238 unmodified lines
483484 struct mlx5_esw_flow_attr *attr = &zone_rule->attr;
484485 struct mlx5_eswitch *esw = ct_priv->esw;
485486 struct mlx5_flow_spec *spec = NULL;
486− u32 tupleid = 1;
487+ u32 tupleid;
487488 int err;
488489
489490 zone_rule->nat = nat;
@@ -493,12 +494,12 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 3 unmodified lines
493494 return -ENOMEM;
494495
495496 /* Get tuple unique id */
496− err = idr_alloc_u32(&ct_priv->tuple_ids, zone_rule, &tupleid,
497− TUPLE_ID_MAX, GFP_KERNEL);
497+ err = xa_alloc(&ct_priv->tuple_ids, &tupleid, zone_rule,
498+ XA_LIMIT(1, TUPLE_ID_MAX), GFP_KERNEL);
498499 if (err) {
499500 netdev_warn(ct_priv->netdev,
500501 "Failed to allocate tuple id, err: %d\n", err);
501− goto err_idr_alloc;
502+ goto err_xa_alloc;
502503 }
503504 zone_rule->tupleid = tupleid;
504505
@@ -539,8 +540,8 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 34 unmodified lines
539540 err_rule:
540541 mlx5_modify_header_dealloc(esw->dev, attr->modify_hdr);
541542 err_mod_hdr:
542− idr_remove(&ct_priv->tuple_ids, zone_rule->tupleid);
543−err_idr_alloc:
543+ xa_erase(&ct_priv->tuple_ids, zone_rule->tupleid);
544+err_xa_alloc:
544545 kfree(spec);
545546 return err;
546547 }
@@ -1299,7 +1300,7 @@ mlx5_tc_ct_init(struct mlx5_rep_uplink_priv *uplink_priv) · 752 unmodified lines
12991300 }
13001301
13011302 idr_init(&ct_priv->fte_ids);
1302− idr_init(&ct_priv->tuple_ids);
1303+ xa_init_flags(&ct_priv->tuple_ids, XA_FLAGS_ALLOC1);
13031304 mutex_init(&ct_priv->control_lock);
13041305 rhashtable_init(&ct_priv->zone_ht, &zone_params);
13051306
@@ -1334,7 +1335,7 @@ mlx5_tc_ct_clean(struct mlx5_rep_uplink_priv *uplink_priv) · 28 unmodified lines
13341335
13351336 rhashtable_destroy(&ct_priv->zone_ht);
13361337 mutex_destroy(&ct_priv->control_lock);
1337− idr_destroy(&ct_priv->tuple_ids);
1338+ xa_destroy(&ct_priv->tuple_ids);
13381339 idr_destroy(&ct_priv->fte_ids);
13391340 kfree(ct_priv);
13401341
@@ -1352,7 +1353,7 @@ mlx5e_tc_ct_restore_flow(struct mlx5_rep_uplink_priv *uplink_priv, · 11 unmodified lines
13521353 if (!ct_priv || !tupleid)
13531354 return true;
13541355
1355− zone_rule = idr_find(&ct_priv->tuple_ids, tupleid);
1356+ zone_rule = xa_load(&ct_priv->tuple_ids, tupleid);
13561357 if (!zone_rule)
13571358 return false;
13581359
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c+3−0
@@ -33,6 +33,9 @@ int mlx5e_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags) · 32 unmodified lines
3333 if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &c->xskicosq.state)))
3434 return 0;
3535
36+ if (test_and_set_bit(MLX5E_SQ_STATE_PENDING_XSK_TX, &c->xskicosq.state))
37+ return 0;
38+
3639 spin_lock(&c->xskicosq_lock);
3740 mlx5e_trigger_irq(&c->xskicosq);
3841 spin_unlock(&c->xskicosq_lock);
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+6−1
@@ -3583,7 +3583,12 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) · 3582 unmodified lines
35833583 struct mlx5e_vport_stats *vstats = &priv->stats.vport;
35843584 struct mlx5e_pport_stats *pstats = &priv->stats.pport;
35853585
3586− if (!mlx5e_monitor_counter_supported(priv)) {
3586+ /* In switchdev mode, monitor counters doesn't monitor
3587+ * rx/tx stats of 802_3. The update stats mechanism
3588+ * should keep the 802_3 layout counters updated
3589+ */
3590+ if (!mlx5e_monitor_counter_supported(priv) ||
3591+ mlx5e_is_uplink_rep(priv)) {
35873592 /* update HW stats in background for next time */
35883593 mlx5e_queue_update_stats(priv);
35893594 }
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+2−7
@@ -1773,19 +1773,14 @@ static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv) · 1772 unmodified lines
17731773
17741774 static int mlx5e_init_ul_rep_rx(struct mlx5e_priv *priv)
17751775 {
1776− int err = mlx5e_init_rep_rx(priv);
1777−
1778− if (err)
1779− return err;
1780−
17811776 mlx5e_create_q_counters(priv);
1782− return 0;
1777+ return mlx5e_init_rep_rx(priv);
17831778 }
17841779
17851780 static void mlx5e_cleanup_ul_rep_rx(struct mlx5e_priv *priv)
17861781 {
1787− mlx5e_destroy_q_counters(priv);
17881782 mlx5e_cleanup_rep_rx(priv);
1783+ mlx5e_destroy_q_counters(priv);
17891784 }
17901785
17911786 static int mlx5e_init_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+5−3
@@ -589,7 +589,7 @@ bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq) · 588 unmodified lines
589589 return !!err;
590590 }
591591
592−void mlx5e_poll_ico_cq(struct mlx5e_cq *cq)
592+int mlx5e_poll_ico_cq(struct mlx5e_cq *cq)
593593 {
594594 struct mlx5e_icosq *sq = container_of(cq, struct mlx5e_icosq, cq);
595595 struct mlx5_cqe64 *cqe;
@@ -597,11 +597,11 @@ void mlx5e_poll_ico_cq(struct mlx5e_cq *cq) · 1 unmodified line
597597 int i;
598598
599599 if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state)))
600− return;
600+ return 0;
601601
602602 cqe = mlx5_cqwq_get_cqe(&cq->wq);
603603 if (likely(!cqe))
604− return;
604+ return 0;
605605
606606 /* sq->cc must be updated only after mlx5_cqwq_update_db_record(),
607607 * otherwise a cq overrun may occur
@@ -650,6 +650,8 @@ void mlx5e_poll_ico_cq(struct mlx5e_cq *cq) · 42 unmodified lines
650650 sq->cc = sqcc;
651651
652652 mlx5_cqwq_update_db_record(&cq->wq);
653+
654+ return i;
653655 }
654656
655657 bool mlx5e_post_rx_mpwqes(struct mlx5e_rq *rq)
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c+5−1
@@ -152,7 +152,11 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget) · 151 unmodified lines
152152 mlx5e_post_rx_wqes,
153153 rq);
154154 if (xsk_open) {
155− mlx5e_poll_ico_cq(&c->xskicosq.cq);
155+ if (mlx5e_poll_ico_cq(&c->xskicosq.cq))
156+ /* Don't clear the flag if nothing was polled to prevent
157+ * queueing more WQEs and overflowing XSKICOSQ.
158+ */
159+ clear_bit(MLX5E_SQ_STATE_PENDING_XSK_TX, &c->xskicosq.state);
156160 busy |= mlx5e_poll_xdpsq_cq(&xsksq->cq);
157161 busy_xsk |= mlx5e_napi_xsk_post(xsksq, xskrq);
158162 }
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+9−9
@@ -1550,9 +1550,9 @@ static int esw_create_restore_table(struct mlx5_eswitch *esw) · 1549 unmodified lines
15501550 MLX5_FLOW_NAMESPACE_KERNEL, 1,
15511551 modact);
15521552 if (IS_ERR(mod_hdr)) {
1553+ err = PTR_ERR(mod_hdr);
15531554 esw_warn(dev, "Failed to create restore mod header, err: %d\n",
15541555 err);
1555− err = PTR_ERR(mod_hdr);
15561556 goto err_mod_hdr;
15571557 }
15581558
@@ -2219,10 +2219,12 @@ static int esw_offloads_steering_init(struct mlx5_eswitch *esw) · 660 unmodified lines
22192219 total_vports = num_vfs + MLX5_SPECIAL_VPORTS(esw->dev);
22202220
22212221 memset(&esw->fdb_table.offloads, 0, sizeof(struct offloads_fdb));
2222+ mutex_init(&esw->fdb_table.offloads.vports.lock);
2223+ hash_init(esw->fdb_table.offloads.vports.table);
22222224
22232225 err = esw_create_uplink_offloads_acl_tables(esw);
22242226 if (err)
2225− return err;
2227+ goto create_acl_err;
22262228
22272229 err = esw_create_offloads_table(esw, total_vports);
22282230 if (err)
@@ -2240,9 +2242,6 @@ static int esw_offloads_steering_init(struct mlx5_eswitch *esw) · 11 unmodified lines
22402242 if (err)
22412243 goto create_fg_err;
22422244
2243− mutex_init(&esw->fdb_table.offloads.vports.lock);
2244− hash_init(esw->fdb_table.offloads.vports.table);
2245−
22462245 return 0;
22472246
22482247 create_fg_err:
@@ -2253,18 +2252,19 @@ create_restore_err: · 4 unmodified lines
22532252 esw_destroy_offloads_table(esw);
22542253 create_offloads_err:
22552254 esw_destroy_uplink_offloads_acl_tables(esw);
2256−
2255+create_acl_err:
2256+ mutex_destroy(&esw->fdb_table.offloads.vports.lock);
22572257 return err;
22582258 }
22592259
22602260 static void esw_offloads_steering_cleanup(struct mlx5_eswitch *esw)
22612261 {
2262− mutex_destroy(&esw->fdb_table.offloads.vports.lock);
22632262 esw_destroy_vport_rx_group(esw);
22642263 esw_destroy_offloads_fdb_tables(esw);
22652264 esw_destroy_restore_table(esw);
22662265 esw_destroy_offloads_table(esw);
22672266 esw_destroy_uplink_offloads_acl_tables(esw);
2267+ mutex_destroy(&esw->fdb_table.offloads.vports.lock);
22682268 }
22692269
22702270 static void
@@ -2377,9 +2377,9 @@ int esw_offloads_enable(struct mlx5_eswitch *esw) · 106 unmodified lines
23772377 err_vports:
23782378 esw_offloads_unload_rep(esw, MLX5_VPORT_UPLINK);
23792379 err_uplink:
2380− esw_set_passing_vport_metadata(esw, false);
2381−err_steering_init:
23822380 esw_offloads_steering_cleanup(esw);
2381+err_steering_init:
2382+ esw_set_passing_vport_metadata(esw, false);
23832383 err_vport_metadata:
23842384 mlx5_rdma_disable_roce(esw->dev);
23852385 mutex_destroy(&esw->offloads.termtbl_mutex);
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c+13−1
@@ -695,6 +695,12 @@ static void dr_cq_event(struct mlx5_core_cq *mcq, · 694 unmodified lines
695695 pr_info("CQ event %u on CQ #%u\n", event, mcq->cqn);
696696 }
697697
698+static void dr_cq_complete(struct mlx5_core_cq *mcq,
699+ struct mlx5_eqe *eqe)
700+{
701+ pr_err("CQ completion CQ: #%u\n", mcq->cqn);
702+}
703+
698704 static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,
699705 struct mlx5_uars_page *uar,
700706 size_t ncqe)
@@ -756,6 +762,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, · 55 unmodified lines
756762 mlx5_fill_page_frag_array(&cq->wq_ctrl.buf, pas);
757763
758764 cq->mcq.event = dr_cq_event;
765+ cq->mcq.comp = dr_cq_complete;
759766
760767 err = mlx5_core_create_cq(mdev, &cq->mcq, in, inlen, out, sizeof(out));
761768 kvfree(in);
@@ -767,7 +774,12 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, · 5 unmodified lines
767774 cq->mcq.set_ci_db = cq->wq_ctrl.db.db;
768775 cq->mcq.arm_db = cq->wq_ctrl.db.db + 1;
769776 *cq->mcq.set_ci_db = 0;
770− *cq->mcq.arm_db = 0;
777+
778+ /* set no-zero value, in order to avoid the HW to run db-recovery on
779+ * CQ that used in polling mode.
780+ */
781+ *cq->mcq.arm_db = cpu_to_be32(2 << 28);
782+
771783 cq->mcq.vector = 0;
772784 cq->mcq.irqn = irqn;
773785 cq->mcq.uar = uar;
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c+2−2
@@ -380,7 +380,7 @@ struct mlxsw_afa_block *mlxsw_afa_block_create(struct mlxsw_afa *mlxsw_afa) · 379 unmodified lines
380380
381381 block = kzalloc(sizeof(*block), GFP_KERNEL);
382382 if (!block)
383− return NULL;
383+ return ERR_PTR(-ENOMEM);
384384 INIT_LIST_HEAD(&block->resource_list);
385385 block->afa = mlxsw_afa;
386386
@@ -408,7 +408,7 @@ err_second_set_create: · 21 unmodified lines
408408 mlxsw_afa_set_destroy(block->first_set);
409409 err_first_set_create:
410410 kfree(block);
411− return NULL;
411+ return ERR_PTR(-ENOMEM);
412412 }
413413 EXPORT_SYMBOL(mlxsw_afa_block_create);
414414
drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c+2−2
@@ -88,8 +88,8 @@ static int mlxsw_sp2_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv, · 87 unmodified lines
8888 * to be written using PEFA register to all indexes for all regions.
8989 */
9090 afa_block = mlxsw_afa_block_create(mlxsw_sp->afa);
91− if (!afa_block) {
92− err = -ENOMEM;
91+ if (IS_ERR(afa_block)) {
92+ err = PTR_ERR(afa_block);
9393 goto err_afa_block;
9494 }
9595 err = mlxsw_afa_block_continue(afa_block);
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c+1−1
@@ -464,7 +464,7 @@ mlxsw_sp_acl_rulei_create(struct mlxsw_sp_acl *acl, · 463 unmodified lines
464464
465465 rulei = kzalloc(sizeof(*rulei), GFP_KERNEL);
466466 if (!rulei)
467− return NULL;
467+ return ERR_PTR(-ENOMEM);
468468
469469 if (afa_block) {
470470 rulei->act_block = afa_block;
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c+10−2
@@ -986,8 +986,9 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp, · 985 unmodified lines
986986 unsigned int priority,
987987 struct mlxsw_afk_element_usage *elusage)
988988 {
989+ struct mlxsw_sp_acl_tcam_vchunk *vchunk, *vchunk2;
989990 struct mlxsw_sp_acl_tcam_vregion *vregion;
990− struct mlxsw_sp_acl_tcam_vchunk *vchunk;
991+ struct list_head *pos;
991992 int err;
992993
993994 if (priority == MLXSW_SP_ACL_TCAM_CATCHALL_PRIO)
@@ -1025,7 +1026,14 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp, · 31 unmodified lines
10251026 }
10261027
10271028 mlxsw_sp_acl_tcam_rehash_ctx_vregion_changed(vregion);
1028− list_add_tail(&vchunk->list, &vregion->vchunk_list);
1029+
1030+ /* Position the vchunk inside the list according to priority */
1031+ list_for_each(pos, &vregion->vchunk_list) {
1032+ vchunk2 = list_entry(pos, typeof(*vchunk2), list);
1033+ if (vchunk2->priority > priority)
1034+ break;
1035+ }
1036+ list_add_tail(&vchunk->list, pos);
10291037 mutex_unlock(&vregion->lock);
10301038
10311039 return vchunk;
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c+2−1
@@ -36,7 +36,8 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp, · 35 unmodified lines
3636 err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
3737 if (err)
3838 return err;
39− } else if (act->hw_stats != FLOW_ACTION_HW_STATS_DISABLED) {
39+ } else if (act->hw_stats != FLOW_ACTION_HW_STATS_DISABLED &&
40+ act->hw_stats != FLOW_ACTION_HW_STATS_DONT_CARE) {
4041 NL_SET_ERR_MSG_MOD(extack, "Unsupported action HW stats type");
4142 return -EOPNOTSUPP;
4243 }
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c+2−2
@@ -199,8 +199,8 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp, · 198 unmodified lines
199199 int err;
200200
201201 afa_block = mlxsw_afa_block_create(mlxsw_sp->afa);
202− if (!afa_block)
203− return ERR_PTR(-ENOMEM);
202+ if (IS_ERR(afa_block))
203+ return afa_block;
204204
205205 err = mlxsw_afa_block_append_allocated_counter(afa_block,
206206 counter_index);
drivers/net/ethernet/moxa/moxart_ether.c+1−1
@@ -564,7 +564,7 @@ static int moxart_remove(struct platform_device *pdev) · 563 unmodified lines
564564 struct net_device *ndev = platform_get_drvdata(pdev);
565565
566566 unregister_netdev(ndev);
567− free_irq(ndev->irq, ndev);
567+ devm_free_irq(&pdev->dev, ndev->irq, ndev);
568568 moxart_mac_free_memory(ndev);
569569 free_netdev(ndev);
570570
drivers/net/ethernet/mscc/ocelot.c+11−6
@@ -1031,10 +1031,8 @@ int ocelot_fdb_dump(struct ocelot *ocelot, int port, · 1030 unmodified lines
10311031 {
10321032 int i, j;
10331033
1034− /* Loop through all the mac tables entries. There are 1024 rows of 4
1035− * entries.
1036− */
1037− for (i = 0; i < 1024; i++) {
1034+ /* Loop through all the mac tables entries. */
1035+ for (i = 0; i < ocelot->num_mact_rows; i++) {
10381036 for (j = 0; j < 4; j++) {
10391037 struct ocelot_mact_entry entry;
10401038 bool is_static;
@@ -1453,8 +1451,15 @@ static void ocelot_port_attr_stp_state_set(struct ocelot *ocelot, int port, · 412 unmodified lines
14531451
14541452 void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs)
14551453 {
1456− ocelot_write(ocelot, ANA_AUTOAGE_AGE_PERIOD(msecs / 2),
1457− ANA_AUTOAGE);
1454+ unsigned int age_period = ANA_AUTOAGE_AGE_PERIOD(msecs / 2000);
1455+
1456+ /* Setting AGE_PERIOD to zero effectively disables automatic aging,
1457+ * which is clearly not what our intention is. So avoid that.
1458+ */
1459+ if (!age_period)
1460+ age_period = 1;
1461+
1462+ ocelot_rmw(ocelot, age_period, ANA_AUTOAGE_AGE_PERIOD_M, ANA_AUTOAGE);
14581463 }
14591464 EXPORT_SYMBOL(ocelot_set_ageing_time);
14601465
drivers/net/ethernet/mscc/ocelot_regs.c+1−0
@@ -431,6 +431,7 @@ int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) · 430 unmodified lines
431431 ocelot->stats_layout = ocelot_stats_layout;
432432 ocelot->num_stats = ARRAY_SIZE(ocelot_stats_layout);
433433 ocelot->shared_queue_sz = 224 * 1024;
434+ ocelot->num_mact_rows = 1024;
434435 ocelot->ops = ops;
435436
436437 ret = ocelot_regfields_init(ocelot, ocelot_regfields);
drivers/net/ethernet/natsemi/jazzsonic.c+4−2
@@ -208,11 +208,13 @@ static int jazz_sonic_probe(struct platform_device *pdev) · 207 unmodified lines
208208
209209 err = register_netdev(dev);
210210 if (err)
211− goto out1;
211+ goto undo_probe1;
212212
213213 return 0;
214214
215−out1:
215+undo_probe1:
216+ dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
217+ lp->descriptors, lp->descriptors_laddr);
216218 release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
217219 out:
218220 free_netdev(dev);
drivers/net/ethernet/netronome/nfp/abm/main.c+1−0
@@ -283,6 +283,7 @@ nfp_abm_vnic_set_mac(struct nfp_pf *pf, struct nfp_abm *abm, struct nfp_net *nn, · 282 unmodified lines
283283 if (!nfp_nsp_has_hwinfo_lookup(nsp)) {
284284 nfp_warn(pf->cpp, "NSP doesn't support PF MAC generation\n");
285285 eth_hw_addr_random(nn->dp.netdev);
286+ nfp_nsp_close(nsp);
286287 return;
287288 }
288289
drivers/net/ethernet/pensando/ionic/ionic_debugfs.c+1−2
@@ -170,8 +170,7 @@ void ionic_debugfs_add_qcq(struct ionic_lif *lif, struct ionic_qcq *qcq) · 169 unmodified lines
170170 debugfs_create_x64("base_pa", 0400, cq_dentry, &cq->base_pa);
171171 debugfs_create_u32("num_descs", 0400, cq_dentry, &cq->num_descs);
172172 debugfs_create_u32("desc_size", 0400, cq_dentry, &cq->desc_size);
173− debugfs_create_u8("done_color", 0400, cq_dentry,
174− (u8 *)&cq->done_color);
173+ debugfs_create_bool("done_color", 0400, cq_dentry, &cq->done_color);
175174
176175 debugfs_create_file("tail", 0400, cq_dentry, cq, &cq_tail_fops);
177176
drivers/net/ethernet/pensando/ionic/ionic_lif.c+2−2
@@ -2101,6 +2101,7 @@ static void ionic_lif_handle_fw_down(struct ionic_lif *lif) · 2100 unmodified lines
21012101 ionic_txrx_free(lif);
21022102 }
21032103 ionic_lifs_deinit(ionic);
2104+ ionic_reset(ionic);
21042105 ionic_qcqs_free(lif);
21052106
21062107 dev_info(ionic->dev, "FW Down: LIFs stopped\n");
@@ -2116,6 +2117,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) · 9 unmodified lines
21162117
21172118 dev_info(ionic->dev, "FW Up: restarting LIFs\n");
21182119
2120+ ionic_init_devinfo(ionic);
21192121 err = ionic_qcqs_alloc(lif);
21202122 if (err)
21212123 goto err_out;
@@ -2549,8 +2551,6 @@ int ionic_lifs_register(struct ionic *ionic) · 427 unmodified lines
25492551 dev_err(ionic->dev, "Cannot register net device, aborting\n");
25502552 return err;
25512553 }
2552−
2553− ionic_link_status_check_request(ionic->master_lif);
25542554 ionic->master_lif->registered = true;
25552555
25562556 return 0;
drivers/net/ethernet/sgi/meth.h+0−16
@@ -1,19 +1,3 @@
1−
2−/*
3− * snull.h -- definitions for the network module
4− *
5− * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet
6− * Copyright (C) 2001 O'Reilly & Associates
7− *
8− * The source code in this file can be freely used, adapted,
9− * and redistributed in source or binary form, so long as an
10− * acknowledgment appears in derived source files. The citation
11− * should list that the code comes from the book "Linux Device
12− * Drivers" by Alessandro Rubini and Jonathan Corbet, published
13− * by O'Reilly & Associates. No warranty is attached;
14− * we cannot take responsibility for errors or fitness for use.
15− */
16−
171 /* version dependencies have been confined to a separate file */
182
193 /* Tunable parameters */
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c+189−0
@@ -5,8 +5,13 @@ · 4 unmodified lines
55 #include <linux/clk-provider.h>
66 #include <linux/pci.h>
77 #include <linux/dmi.h>
8+#include "dwmac-intel.h"
89 #include "stmmac.h"
910
11+struct intel_priv_data {
12+ int mdio_adhoc_addr; /* mdio address for serdes & etc */
13+};
14+
1015 /* This struct is used to associate PCI Function of MAC controller on a board,
1116 * discovered via DMI, with the address of PHY connected to the MAC. The
1217 * negative value of the address means that MAC controller is not connected
@@ -49,6 +54,172 @@ static int stmmac_pci_find_phy_addr(struct pci_dev *pdev, · 36 unmodified lines
4954 return -ENODEV;
5055 }
5156
57+static int serdes_status_poll(struct stmmac_priv *priv, int phyaddr,
58+ int phyreg, u32 mask, u32 val)
59+{
60+ unsigned int retries = 10;
61+ int val_rd;
62+
63+ do {
64+ val_rd = mdiobus_read(priv->mii, phyaddr, phyreg);
65+ if ((val_rd & mask) == (val & mask))
66+ return 0;
67+ udelay(POLL_DELAY_US);
68+ } while (--retries);
69+
70+ return -ETIMEDOUT;
71+}
72+
73+static int intel_serdes_powerup(struct net_device *ndev, void *priv_data)
74+{
75+ struct intel_priv_data *intel_priv = priv_data;
76+ struct stmmac_priv *priv = netdev_priv(ndev);
77+ int serdes_phy_addr = 0;
78+ u32 data = 0;
79+
80+ if (!intel_priv->mdio_adhoc_addr)
81+ return 0;
82+
83+ serdes_phy_addr = intel_priv->mdio_adhoc_addr;
84+
85+ /* assert clk_req */
86+ data = mdiobus_read(priv->mii, serdes_phy_addr,
87+ SERDES_GCR0);
88+
89+ data |= SERDES_PLL_CLK;
90+
91+ mdiobus_write(priv->mii, serdes_phy_addr,
92+ SERDES_GCR0, data);
93+
94+ /* check for clk_ack assertion */
95+ data = serdes_status_poll(priv, serdes_phy_addr,
96+ SERDES_GSR0,
97+ SERDES_PLL_CLK,
98+ SERDES_PLL_CLK);
99+
100+ if (data) {
101+ dev_err(priv->device, "Serdes PLL clk request timeout\n");
102+ return data;
103+ }
104+
105+ /* assert lane reset */
106+ data = mdiobus_read(priv->mii, serdes_phy_addr,
107+ SERDES_GCR0);
108+
109+ data |= SERDES_RST;
110+
111+ mdiobus_write(priv->mii, serdes_phy_addr,
112+ SERDES_GCR0, data);
113+
114+ /* check for assert lane reset reflection */
115+ data = serdes_status_poll(priv, serdes_phy_addr,
116+ SERDES_GSR0,
117+ SERDES_RST,
118+ SERDES_RST);
119+
120+ if (data) {
121+ dev_err(priv->device, "Serdes assert lane reset timeout\n");
122+ return data;
123+ }
124+
125+ /* move power state to P0 */
126+ data = mdiobus_read(priv->mii, serdes_phy_addr,
127+ SERDES_GCR0);
128+
129+ data &= ~SERDES_PWR_ST_MASK;
130+ data |= SERDES_PWR_ST_P0 << SERDES_PWR_ST_SHIFT;
131+
132+ mdiobus_write(priv->mii, serdes_phy_addr,
133+ SERDES_GCR0, data);
134+
135+ /* Check for P0 state */
136+ data = serdes_status_poll(priv, serdes_phy_addr,
137+ SERDES_GSR0,
138+ SERDES_PWR_ST_MASK,
139+ SERDES_PWR_ST_P0 << SERDES_PWR_ST_SHIFT);
140+
141+ if (data) {
142+ dev_err(priv->device, "Serdes power state P0 timeout.\n");
143+ return data;
144+ }
145+
146+ return 0;
147+}
148+
149+static void intel_serdes_powerdown(struct net_device *ndev, void *intel_data)
150+{
151+ struct intel_priv_data *intel_priv = intel_data;
152+ struct stmmac_priv *priv = netdev_priv(ndev);
153+ int serdes_phy_addr = 0;
154+ u32 data = 0;
155+
156+ if (!intel_priv->mdio_adhoc_addr)
157+ return;
158+
159+ serdes_phy_addr = intel_priv->mdio_adhoc_addr;
160+
161+ /* move power state to P3 */
162+ data = mdiobus_read(priv->mii, serdes_phy_addr,
163+ SERDES_GCR0);
164+
165+ data &= ~SERDES_PWR_ST_MASK;
166+ data |= SERDES_PWR_ST_P3 << SERDES_PWR_ST_SHIFT;
167+
168+ mdiobus_write(priv->mii, serdes_phy_addr,
169+ SERDES_GCR0, data);
170+
171+ /* Check for P3 state */
172+ data = serdes_status_poll(priv, serdes_phy_addr,
173+ SERDES_GSR0,
174+ SERDES_PWR_ST_MASK,
175+ SERDES_PWR_ST_P3 << SERDES_PWR_ST_SHIFT);
176+
177+ if (data) {
178+ dev_err(priv->device, "Serdes power state P3 timeout\n");
179+ return;
180+ }
181+
182+ /* de-assert clk_req */
183+ data = mdiobus_read(priv->mii, serdes_phy_addr,
184+ SERDES_GCR0);
185+
186+ data &= ~SERDES_PLL_CLK;
187+
188+ mdiobus_write(priv->mii, serdes_phy_addr,
189+ SERDES_GCR0, data);
190+
191+ /* check for clk_ack de-assert */
192+ data = serdes_status_poll(priv, serdes_phy_addr,
193+ SERDES_GSR0,
194+ SERDES_PLL_CLK,
195+ (u32)~SERDES_PLL_CLK);
196+
197+ if (data) {
198+ dev_err(priv->device, "Serdes PLL clk de-assert timeout\n");
199+ return;
200+ }
201+
202+ /* de-assert lane reset */
203+ data = mdiobus_read(priv->mii, serdes_phy_addr,
204+ SERDES_GCR0);
205+
206+ data &= ~SERDES_RST;
207+
208+ mdiobus_write(priv->mii, serdes_phy_addr,
209+ SERDES_GCR0, data);
210+
211+ /* check for de-assert lane reset reflection */
212+ data = serdes_status_poll(priv, serdes_phy_addr,
213+ SERDES_GSR0,
214+ SERDES_RST,
215+ (u32)~SERDES_RST);
216+
217+ if (data) {
218+ dev_err(priv->device, "Serdes de-assert lane reset timeout\n");
219+ return;
220+ }
221+}
222+
52223 static void common_default_data(struct plat_stmmacenet_data *plat)
53224 {
54225 plat->clk_csr = 2; /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
@@ -189,6 +360,9 @@ static int ehl_sgmii_data(struct pci_dev *pdev, · 134 unmodified lines
189360 plat->phy_addr = 0;
190361 plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
191362
363+ plat->serdes_powerup = intel_serdes_powerup;
364+ plat->serdes_powerdown = intel_serdes_powerdown;
365+
192366 return ehl_common_data(pdev, plat);
193367 }
194368
@@ -233,6 +407,8 @@ static int ehl_pse0_sgmii1g_data(struct pci_dev *pdev, · 38 unmodified lines
233407 struct plat_stmmacenet_data *plat)
234408 {
235409 plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
410+ plat->serdes_powerup = intel_serdes_powerup;
411+ plat->serdes_powerdown = intel_serdes_powerdown;
236412 return ehl_pse0_common_data(pdev, plat);
237413 }
238414
@@ -263,6 +439,8 @@ static int ehl_pse1_sgmii1g_data(struct pci_dev *pdev, · 24 unmodified lines
263439 struct plat_stmmacenet_data *plat)
264440 {
265441 plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
442+ plat->serdes_powerup = intel_serdes_powerup;
443+ plat->serdes_powerdown = intel_serdes_powerdown;
266444 return ehl_pse1_common_data(pdev, plat);
267445 }
268446
@@ -291,6 +469,8 @@ static int tgl_sgmii_data(struct pci_dev *pdev, · 22 unmodified lines
291469 plat->bus_id = 1;
292470 plat->phy_addr = 0;
293471 plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
472+ plat->serdes_powerup = intel_serdes_powerup;
473+ plat->serdes_powerdown = intel_serdes_powerdown;
294474 return tgl_common_data(pdev, plat);
295475 }
296476
@@ -417,11 +597,17 @@ static int intel_eth_pci_probe(struct pci_dev *pdev, · 120 unmodified lines
417597 const struct pci_device_id *id)
418598 {
419599 struct stmmac_pci_info *info = (struct stmmac_pci_info *)id->driver_data;
600+ struct intel_priv_data *intel_priv;
420601 struct plat_stmmacenet_data *plat;
421602 struct stmmac_resources res;
422603 int i;
423604 int ret;
424605
606+ intel_priv = devm_kzalloc(&pdev->dev, sizeof(*intel_priv),
607+ GFP_KERNEL);
608+ if (!intel_priv)
609+ return -ENOMEM;
610+
425611 plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
426612 if (!plat)
427613 return -ENOMEM;
@@ -457,6 +643,9 @@ static int intel_eth_pci_probe(struct pci_dev *pdev, · 29 unmodified lines
457643
458644 pci_set_master(pdev);
459645
646+ plat->bsp_priv = intel_priv;
647+ intel_priv->mdio_adhoc_addr = 0x15;
648+
460649 ret = info->setup(pdev, plat);
461650 if (ret)
462651 return ret;
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h+23−0
@@ -0,0 +1,23 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/* Copyright (c) 2020, Intel Corporation
3+ * DWMAC Intel header file
4+ */
5+
6+#ifndef __DWMAC_INTEL_H__
7+#define __DWMAC_INTEL_H__
8+
9+#define POLL_DELAY_US 8
10+
11+/* SERDES Register */
12+#define SERDES_GSR0 0x5 /* Global Status Reg0 */
13+#define SERDES_GCR0 0xb /* Global Configuration Reg0 */
14+
15+/* SERDES defines */
16+#define SERDES_PLL_CLK BIT(0) /* PLL clk valid signal */
17+#define SERDES_RST BIT(2) /* Serdes Reset */
18+#define SERDES_PWR_ST_MASK GENMASK(6, 4) /* Serdes Power state*/
19+#define SERDES_PWR_ST_SHIFT 4
20+#define SERDES_PWR_ST_P0 0x0
21+#define SERDES_PWR_ST_P3 0x3
22+
23+#endif /* __DWMAC_INTEL_H__ */
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c+1−0
@@ -119,6 +119,7 @@ static int meson8b_init_rgmii_tx_clk(struct meson8b_dwmac *dwmac) · 118 unmodified lines
119119 { .div = 5, .val = 5, },
120120 { .div = 6, .val = 6, },
121121 { .div = 7, .val = 7, },
122+ { /* end of array */ }
122123 };
123124
124125 clk_configs = devm_kzalloc(dev, sizeof(*clk_configs), GFP_KERNEL);
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c+6−3
@@ -291,16 +291,19 @@ static int socfpga_gen5_set_phy_mode(struct socfpga_dwmac *dwmac) · 290 unmodified lines
291291 phymode == PHY_INTERFACE_MODE_MII ||
292292 phymode == PHY_INTERFACE_MODE_GMII ||
293293 phymode == PHY_INTERFACE_MODE_SGMII) {
294− ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2);
295294 regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG,
296295 &module);
297296 module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2));
298297 regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG,
299298 module);
300− } else {
301− ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2));
302299 }
303300
301+ if (dwmac->f2h_ptp_ref_clk)
302+ ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2);
303+ else
304+ ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK <<
305+ (reg_shift / 2));
306+
304307 regmap_write(sys_mgr_base_addr, reg_offset, ctrl);
305308
306309 /* Deassert reset for the phy configuration to be sampled by
drivers/net/ethernet/stmicro/stmmac/dwmac5.c+1−1
@@ -624,7 +624,7 @@ int dwmac5_est_configure(void __iomem *ioaddr, struct stmmac_est *cfg, · 623 unmodified lines
624624 total_offset += offset;
625625 }
626626
627− total_ctr = cfg->ctr[0] + cfg->ctr[1] * 1000000000;
627+ total_ctr = cfg->ctr[0] + cfg->ctr[1] * 1000000000ULL;
628628 total_ctr += total_offset;
629629
630630 ctr_low = do_div(total_ctr, 1000000000);
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c+8−4
@@ -27,12 +27,16 @@ static void config_sub_second_increment(void __iomem *ioaddr, · 26 unmodified lines
2727 unsigned long data;
2828 u32 reg_value;
2929
30− /* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second
31− * formula = (1/ptp_clock) * 1000000000
32− * where ptp_clock is 50MHz if fine method is used to update system
30+ /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second
31+ * increment to twice the number of nanoseconds of a clock cycle.
32+ * The calculation of the default_addend value by the caller will set it
33+ * to mid-range = 2^31 when the remainder of this division is zero,
34+ * which will make the accumulator overflow once every 2 ptp_clock
35+ * cycles, adding twice the number of nanoseconds of a clock cycle :
36+ * 2000000000ULL / ptp_clock.
3337 */
3438 if (value & PTP_TCR_TSCFUPDT)
35− data = (1000000000ULL / 50000000);
39+ data = (2000000000ULL / ptp_clock);
3640 else
3741 data = (1000000000ULL / ptp_clock);
3842
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+26−6
@@ -4060,7 +4060,7 @@ static int stmmac_set_features(struct net_device *netdev, · 4059 unmodified lines
40604060 /**
40614061 * stmmac_interrupt - main ISR
40624062 * @irq: interrupt number.
4063− * @dev_id: to pass the net device pointer.
4063+ * @dev_id: to pass the net device pointer (must be valid).
40644064 * Description: this is the main driver interrupt service routine.
40654065 * It can call:
40664066 * o DMA service routine (to manage incoming frame reception and transmission
@@ -4084,11 +4084,6 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id) · 17 unmodified lines
40844084 if (priv->irq_wake)
40854085 pm_wakeup_event(priv->device, 0);
40864086
4087− if (unlikely(!dev)) {
4088− netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
4089− return IRQ_NONE;
4090− }
4091−
40924087 /* Check if adapter is up */
40934088 if (test_bit(STMMAC_DOWN, &priv->state))
40944089 return IRQ_HANDLED;
@@ -4986,12 +4981,22 @@ int stmmac_dvr_probe(struct device *device, · 891 unmodified lines
49864981 goto error_netdev_register;
49874982 }
49884983
4984+ if (priv->plat->serdes_powerup) {
4985+ ret = priv->plat->serdes_powerup(ndev,
4986+ priv->plat->bsp_priv);
4987+
4988+ if (ret < 0)
4989+ goto error_serdes_powerup;
4990+ }
4991+
49894992 #ifdef CONFIG_DEBUG_FS
49904993 stmmac_init_fs(ndev);
49914994 #endif
49924995
49934996 return ret;
49944997
4998+error_serdes_powerup:
4999+ unregister_netdev(ndev);
49955000 error_netdev_register:
49965001 phylink_destroy(priv->phylink);
49975002 error_phy_setup:
@@ -5029,6 +5034,9 @@ int stmmac_dvr_remove(struct device *dev) · 31 unmodified lines
50295034
50305035 stmmac_stop_all_dma(priv);
50315036
5037+ if (priv->plat->serdes_powerdown)
5038+ priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
5039+
50325040 stmmac_mac_set(priv, priv->ioaddr, false);
50335041 netif_carrier_off(ndev);
50345042 unregister_netdev(ndev);
@@ -5081,6 +5089,9 @@ int stmmac_suspend(struct device *dev) · 46 unmodified lines
50815089 /* Stop TX/RX DMA */
50825090 stmmac_stop_all_dma(priv);
50835091
5092+ if (priv->plat->serdes_powerdown)
5093+ priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
5094+
50845095 /* Enable Power down mode by programming the PMT regs */
50855096 if (device_may_wakeup(priv->device)) {
50865097 stmmac_pmt(priv, priv->hw, priv->wolopts);
@@ -5143,6 +5154,7 @@ int stmmac_resume(struct device *dev) · 56 unmodified lines
51435154 {
51445155 struct net_device *ndev = dev_get_drvdata(dev);
51455156 struct stmmac_priv *priv = netdev_priv(ndev);
5157+ int ret;
51465158
51475159 if (!netif_running(ndev))
51485160 return 0;
@@ -5170,6 +5182,14 @@ int stmmac_resume(struct device *dev) · 21 unmodified lines
51705182 stmmac_mdio_reset(priv->mii);
51715183 }
51725184
5185+ if (priv->plat->serdes_powerup) {
5186+ ret = priv->plat->serdes_powerup(ndev,
5187+ priv->plat->bsp_priv);
5188+
5189+ if (ret < 0)
5190+ return ret;
5191+ }
5192+
51735193 netif_device_attach(ndev);
51745194
51755195 mutex_lock(&priv->lock);
drivers/net/ethernet/ti/Kconfig+1−2
@@ -90,9 +90,8 @@ config TI_CPTS · 89 unmodified lines
9090 config TI_CPTS_MOD
9191 tristate
9292 depends on TI_CPTS
93+ depends on PTP_1588_CLOCK
9394 default y if TI_CPSW=y || TI_KEYSTONE_NETCP=y || TI_CPSW_SWITCHDEV=y
94− select NET_PTP_CLASSIFY
95− imply PTP_1588_CLOCK
9695 default m
9796
9897 config TI_K3_AM65_CPSW_NUSS
drivers/net/ethernet/ti/am65-cpsw-nuss.c+3−2
@@ -1719,7 +1719,8 @@ static int am65_cpsw_nuss_ndev_add_napi_2g(struct am65_cpsw_common *common) · 1718 unmodified lines
17191719
17201720 ret = devm_request_irq(dev, tx_chn->irq,
17211721 am65_cpsw_nuss_tx_irq,
1722− 0, tx_chn->tx_chn_name, tx_chn);
1722+ IRQF_TRIGGER_HIGH,
1723+ tx_chn->tx_chn_name, tx_chn);
17231724 if (ret) {
17241725 dev_err(dev, "failure requesting tx%u irq %u, %d\n",
17251726 tx_chn->id, tx_chn->irq, ret);
@@ -1744,7 +1745,7 @@ static int am65_cpsw_nuss_ndev_reg_2g(struct am65_cpsw_common *common) · 18 unmodified lines
17441745
17451746 ret = devm_request_irq(dev, common->rx_chns.irq,
17461747 am65_cpsw_nuss_rx_irq,
1747− 0, dev_name(dev), common);
1748+ IRQF_TRIGGER_HIGH, dev_name(dev), common);
17481749 if (ret) {
17491750 dev_err(dev, "failure requesting rx irq %u, %d\n",
17501751 common->rx_chns.irq, ret);
drivers/net/ethernet/toshiba/tc35815.c+1−1
@@ -643,7 +643,7 @@ static int tc_mii_probe(struct net_device *dev) · 642 unmodified lines
643643 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, mask);
644644 linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, mask);
645645 }
646− linkmode_and(phydev->supported, phydev->supported, mask);
646+ linkmode_andnot(phydev->supported, phydev->supported, mask);
647647 linkmode_copy(phydev->advertising, phydev->supported);
648648
649649 lp->link = 0;
drivers/net/ethernet/xscale/ixp4xx_eth.c+2−0
@@ -1387,6 +1387,8 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) · 1386 unmodified lines
13871387 return -ENODEV;
13881388 regs_phys = res->start;
13891389 port->regs = devm_ioremap_resource(dev, res);
1390+ if (IS_ERR(port->regs))
1391+ return PTR_ERR(port->regs);
13901392
13911393 switch (port->id) {
13921394 case IXP4XX_ETH_NPEA:
drivers/net/geneve.c+1−1
@@ -1207,7 +1207,7 @@ static int geneve_validate(struct nlattr *tb[], struct nlattr *data[], · 1206 unmodified lines
12071207 enum ifla_geneve_df df = nla_get_u8(data[IFLA_GENEVE_DF]);
12081208
12091209 if (df < 0 || df > GENEVE_DF_MAX) {
1210− NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_GENEVE_DF],
1210+ NL_SET_ERR_MSG_ATTR(extack, data[IFLA_GENEVE_DF],
12111211 "Invalid DF attribute");
12121212 return -EINVAL;
12131213 }
drivers/net/gtp.c+5−4
@@ -1169,11 +1169,11 @@ out_unlock: · 1168 unmodified lines
11691169 static struct genl_family gtp_genl_family;
11701170
11711171 static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq,
1172− u32 type, struct pdp_ctx *pctx)
1172+ int flags, u32 type, struct pdp_ctx *pctx)
11731173 {
11741174 void *genlh;
11751175
1176− genlh = genlmsg_put(skb, snd_portid, snd_seq, &gtp_genl_family, 0,
1176+ genlh = genlmsg_put(skb, snd_portid, snd_seq, &gtp_genl_family, flags,
11771177 type);
11781178 if (genlh == NULL)
11791179 goto nlmsg_failure;
@@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) · 47 unmodified lines
12271227 goto err_unlock;
12281228 }
12291229
1230− err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid,
1231− info->snd_seq, info->nlhdr->nlmsg_type, pctx);
1230+ err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq,
1231+ 0, info->nlhdr->nlmsg_type, pctx);
12321232 if (err < 0)
12331233 goto err_unlock_free;
12341234
@@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, · 36 unmodified lines
12711271 gtp_genl_fill_info(skb,
12721272 NETLINK_CB(cb->skb).portid,
12731273 cb->nlh->nlmsg_seq,
1274+ NLM_F_MULTI,
12741275 cb->nlh->nlmsg_type, pctx)) {
12751276 cb->args[0] = i;
12761277 cb->args[1] = j;
drivers/net/hyperv/netvsc_drv.c+2−1
@@ -707,7 +707,8 @@ no_memory: · 706 unmodified lines
707707 goto drop;
708708 }
709709
710−static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *ndev)
710+static netdev_tx_t netvsc_start_xmit(struct sk_buff *skb,
711+ struct net_device *ndev)
711712 {
712713 return netvsc_xmit(skb, ndev, false);
713714 }
drivers/net/ipa/gsi.c+9−2
@@ -1041,6 +1041,7 @@ static void gsi_isr_gp_int1(struct gsi *gsi) · 1040 unmodified lines
10411041
10421042 complete(&gsi->completion);
10431043 }
1044+
10441045 /* Inter-EE interrupt handler */
10451046 static void gsi_isr_glob_ee(struct gsi *gsi)
10461047 {
@@ -1493,6 +1494,12 @@ static int gsi_generic_command(struct gsi *gsi, u32 channel_id, · 446 unmodified lines
14931494 struct completion *completion = &gsi->completion;
14941495 u32 val;
14951496
1497+ /* First zero the result code field */
1498+ val = ioread32(gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
1499+ val &= ~GENERIC_EE_RESULT_FMASK;
1500+ iowrite32(val, gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
1501+
1502+ /* Now issue the command */
14961503 val = u32_encode_bits(opcode, GENERIC_OPCODE_FMASK);
14971504 val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK);
14981505 val |= u32_encode_bits(GSI_EE_MODEM, GENERIC_EE_FMASK);
@@ -1798,9 +1805,9 @@ static int gsi_channel_init_one(struct gsi *gsi, · 299 unmodified lines
17981805
17991806 /* Worst case we need an event for every outstanding TRE */
18001807 if (data->channel.tre_count > data->channel.event_count) {
1801− dev_warn(gsi->dev, "channel %u limited to %u TREs\n",
1802− data->channel_id, data->channel.tre_count);
18031808 tre_count = data->channel.event_count;
1809+ dev_warn(gsi->dev, "channel %u limited to %u TREs\n",
1810+ data->channel_id, tre_count);
18041811 } else {
18051812 tre_count = data->channel.tre_count;
18061813 }
drivers/net/ipa/gsi_reg.h+2−0
@@ -410,6 +410,8 @@ · 409 unmodified lines
410410 #define INTER_EE_RESULT_FMASK GENMASK(2, 0)
411411 #define GENERIC_EE_RESULT_FMASK GENMASK(7, 5)
412412 #define GENERIC_EE_SUCCESS_FVAL 1
413+#define GENERIC_EE_INCORRECT_DIRECTION_FVAL 3
414+#define GENERIC_EE_INCORRECT_CHANNEL_FVAL 5
413415 #define GENERIC_EE_NO_RESOURCES_FVAL 7
414416 #define USB_MAX_PACKET_FMASK GENMASK(15, 15) /* 0: HS; 1: SS */
415417 #define MHI_BASE_CHANNEL_FMASK GENMASK(31, 24)
drivers/net/ipa/ipa_endpoint.c+2−5
@@ -1283,7 +1283,7 @@ static int ipa_endpoint_stop_rx_dma(struct ipa *ipa) · 1282 unmodified lines
12831283 */
12841284 int ipa_endpoint_stop(struct ipa_endpoint *endpoint)
12851285 {
1286− u32 retries = endpoint->toward_ipa ? 0 : IPA_ENDPOINT_STOP_RX_RETRIES;
1286+ u32 retries = IPA_ENDPOINT_STOP_RX_RETRIES;
12871287 int ret;
12881288
12891289 do {
@@ -1291,12 +1291,9 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint) · 1 unmodified line
12911291 struct gsi *gsi = &ipa->gsi;
12921292
12931293 ret = gsi_channel_stop(gsi, endpoint->channel_id);
1294− if (ret != -EAGAIN)
1294+ if (ret != -EAGAIN || endpoint->toward_ipa)
12951295 break;
12961296
1297− if (endpoint->toward_ipa)
1298− continue;
1299−
13001297 /* For IPA v3.5.1, send a DMA read task and check again */
13011298 if (ipa->version == IPA_VERSION_3_5_1) {
13021299 ret = ipa_endpoint_stop_rx_dma(ipa);
drivers/net/macsec.c+12−6
@@ -1305,7 +1305,8 @@ static struct crypto_aead *macsec_alloc_tfm(char *key, int key_len, int icv_len) · 1304 unmodified lines
13051305 struct crypto_aead *tfm;
13061306 int ret;
13071307
1308− tfm = crypto_alloc_aead("gcm(aes)", 0, 0);
1308+ /* Pick a sync gcm(aes) cipher to ensure order is preserved. */
1309+ tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC);
13091310
13101311 if (IS_ERR(tfm))
13111312 return tfm;
@@ -2640,11 +2641,12 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info) · 1328 unmodified lines
26402641 if (ret)
26412642 goto rollback;
26422643
2643− rtnl_unlock();
26442644 /* Force features update, since they are different for SW MACSec and
26452645 * HW offloading cases.
26462646 */
26472647 netdev_update_features(dev);
2648+
2649+ rtnl_unlock();
26482650 return 0;
26492651
26502652 rollback:
@@ -4002,11 +4004,11 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 1351 unmodified lines
40024004 struct netlink_ext_ack *extack)
40034005 {
40044006 struct macsec_dev *macsec = macsec_priv(dev);
4007+ rx_handler_func_t *rx_handler;
4008+ u8 icv_len = DEFAULT_ICV_LEN;
40054009 struct net_device *real_dev;
4006− int err;
4010+ int err, mtu;
40074011 sci_t sci;
4008− u8 icv_len = DEFAULT_ICV_LEN;
4009− rx_handler_func_t *rx_handler;
40104012
40114013 if (!tb[IFLA_LINK])
40124014 return -EINVAL;
@@ -4033,7 +4035,11 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 20 unmodified lines
40334035
40344036 if (data && data[IFLA_MACSEC_ICV_LEN])
40354037 icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]);
4036− dev->mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
4038+ mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
4039+ if (mtu < 0)
4040+ dev->mtu = 0;
4041+ else
4042+ dev->mtu = mtu;
40374043
40384044 rx_handler = rtnl_dereference(real_dev->rx_handler);
40394045 if (rx_handler && rx_handler != macsec_handle_frame)
drivers/net/macvlan.c+1−1
@@ -1704,7 +1704,7 @@ static int macvlan_device_event(struct notifier_block *unused, · 1703 unmodified lines
17041704 struct macvlan_dev,
17051705 list);
17061706
1707− if (macvlan_sync_address(vlan->dev, dev->dev_addr))
1707+ if (vlan && macvlan_sync_address(vlan->dev, dev->dev_addr))
17081708 return NOTIFY_BAD;
17091709
17101710 break;
drivers/net/phy/bcm84881.c+3−3
@@ -155,9 +155,6 @@ static int bcm84881_read_status(struct phy_device *phydev) · 154 unmodified lines
155155 if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete)
156156 phydev->link = false;
157157
158− if (!phydev->link)
159− return 0;
160−
161158 linkmode_zero(phydev->lp_advertising);
162159 phydev->speed = SPEED_UNKNOWN;
163160 phydev->duplex = DUPLEX_UNKNOWN;
@@ -165,6 +162,9 @@ static int bcm84881_read_status(struct phy_device *phydev) · 1 unmodified line
165162 phydev->asym_pause = 0;
166163 phydev->mdix = 0;
167164
165+ if (!phydev->link)
166+ return 0;
167+
168168 if (phydev->autoneg_complete) {
169169 val = genphy_c45_read_lpa(phydev);
170170 if (val < 0)
drivers/net/phy/dp83640.c+1−1
@@ -1120,7 +1120,7 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus) · 1119 unmodified lines
11201120 goto out;
11211121 }
11221122 dp83640_clock_init(clock, bus);
1123− list_add_tail(&phyter_clocks, &clock->list);
1123+ list_add_tail(&clock->list, &phyter_clocks);
11241124 out:
11251125 mutex_unlock(&phyter_clocks_lock);
11261126
drivers/net/phy/dp83822.c+14−16
@@ -137,19 +137,18 @@ static int dp83822_set_wol(struct phy_device *phydev, · 136 unmodified lines
137137 value &= ~DP83822_WOL_SECURE_ON;
138138 }
139139
140− value |= (DP83822_WOL_EN | DP83822_WOL_INDICATION_SEL |
141− DP83822_WOL_CLR_INDICATION);
142− phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG,
143− value);
140+ /* Clear any pending WoL interrupt */
141+ phy_read(phydev, MII_DP83822_MISR2);
142+
143+ value |= DP83822_WOL_EN | DP83822_WOL_INDICATION_SEL |
144+ DP83822_WOL_CLR_INDICATION;
145+
146+ return phy_write_mmd(phydev, DP83822_DEVADDR,
147+ MII_DP83822_WOL_CFG, value);
144148 } else {
145− value = phy_read_mmd(phydev, DP83822_DEVADDR,
146− MII_DP83822_WOL_CFG);
147− value &= ~DP83822_WOL_EN;
148− phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG,
149− value);
149+ return phy_clear_bits_mmd(phydev, DP83822_DEVADDR,
150+ MII_DP83822_WOL_CFG, DP83822_WOL_EN);
150151 }
151−
152− return 0;
153152 }
154153
155154 static void dp83822_get_wol(struct phy_device *phydev,
@@ -258,12 +257,11 @@ static int dp83822_config_intr(struct phy_device *phydev) · 102 unmodified lines
258257
259258 static int dp83822_config_init(struct phy_device *phydev)
260259 {
261− int value;
262−
263− value = DP83822_WOL_MAGIC_EN | DP83822_WOL_SECURE_ON | DP83822_WOL_EN;
260+ int value = DP83822_WOL_EN | DP83822_WOL_MAGIC_EN |
261+ DP83822_WOL_SECURE_ON;
264262
265− return phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG,
266− value);
263+ return phy_clear_bits_mmd(phydev, DP83822_DEVADDR,
264+ MII_DP83822_WOL_CFG, value);
267265 }
268266
269267 static int dp83822_phy_reset(struct phy_device *phydev)
drivers/net/phy/dp83tc811.c+12−9
@@ -139,16 +139,19 @@ static int dp83811_set_wol(struct phy_device *phydev, · 138 unmodified lines
139139 value &= ~DP83811_WOL_SECURE_ON;
140140 }
141141
142− value |= (DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL |
143− DP83811_WOL_CLR_INDICATION);
144− phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
145− value);
142+ /* Clear any pending WoL interrupt */
143+ phy_read(phydev, MII_DP83811_INT_STAT1);
144+
145+ value |= DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL |
146+ DP83811_WOL_CLR_INDICATION;
147+
148+ return phy_write_mmd(phydev, DP83811_DEVADDR,
149+ MII_DP83811_WOL_CFG, value);
146150 } else {
147− phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
148− DP83811_WOL_EN);
151+ return phy_clear_bits_mmd(phydev, DP83811_DEVADDR,
152+ MII_DP83811_WOL_CFG, DP83811_WOL_EN);
149153 }
150154
151− return 0;
152155 }
153156
154157 static void dp83811_get_wol(struct phy_device *phydev,
@@ -292,8 +295,8 @@ static int dp83811_config_init(struct phy_device *phydev) · 137 unmodified lines
292295
293296 value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN;
294297
295− return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
296− value);
298+ return phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
299+ value);
297300 }
298301
299302 static int dp83811_phy_reset(struct phy_device *phydev)
drivers/net/phy/marvell10g.c+28−2
@@ -66,6 +66,9 @@ enum { · 65 unmodified lines
6666 MV_PCS_CSSR1_SPD2_2500 = 0x0004,
6767 MV_PCS_CSSR1_SPD2_10000 = 0x0000,
6868
69+ /* Temperature read register (88E2110 only) */
70+ MV_PCS_TEMP = 0x8042,
71+
6972 /* These registers appear at 0x800X and 0xa00X - the 0xa00X control
7073 * registers appear to set themselves to the 0x800X when AN is
7174 * restarted, but status registers appear readable from either.
@@ -77,6 +80,7 @@ enum { · 5 unmodified lines
7780 MV_V2_PORT_CTRL = 0xf001,
7881 MV_V2_PORT_CTRL_SWRST = BIT(15),
7982 MV_V2_PORT_CTRL_PWRDOWN = BIT(11),
83+ /* Temperature control/read registers (88X3310 only) */
8084 MV_V2_TEMP_CTRL = 0xf08a,
8185 MV_V2_TEMP_CTRL_MASK = 0xc000,
8286 MV_V2_TEMP_CTRL_SAMPLE = 0x0000,
@@ -104,6 +108,24 @@ static umode_t mv3310_hwmon_is_visible(const void *data, · 21 unmodified lines
104108 return 0;
105109 }
106110
111+static int mv3310_hwmon_read_temp_reg(struct phy_device *phydev)
112+{
113+ return phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP);
114+}
115+
116+static int mv2110_hwmon_read_temp_reg(struct phy_device *phydev)
117+{
118+ return phy_read_mmd(phydev, MDIO_MMD_PCS, MV_PCS_TEMP);
119+}
120+
121+static int mv10g_hwmon_read_temp_reg(struct phy_device *phydev)
122+{
123+ if (phydev->drv->phy_id == MARVELL_PHY_ID_88X3310)
124+ return mv3310_hwmon_read_temp_reg(phydev);
125+ else /* MARVELL_PHY_ID_88E2110 */
126+ return mv2110_hwmon_read_temp_reg(phydev);
127+}
128+
107129 static int mv3310_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
108130 u32 attr, int channel, long *value)
109131 {
@@ -116,7 +138,7 @@ static int mv3310_hwmon_read(struct device *dev, enum hwmon_sensor_types type, · 6 unmodified lines
116138 }
117139
118140 if (type == hwmon_temp && attr == hwmon_temp_input) {
119− temp = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP);
141+ temp = mv10g_hwmon_read_temp_reg(phydev);
120142 if (temp < 0)
121143 return temp;
122144
@@ -169,6 +191,9 @@ static int mv3310_hwmon_config(struct phy_device *phydev, bool enable) · 46 unmodified lines
169191 u16 val;
170192 int ret;
171193
194+ if (phydev->drv->phy_id != MARVELL_PHY_ID_88X3310)
195+ return 0;
196+
172197 ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP,
173198 MV_V2_TEMP_UNKNOWN);
174199 if (ret < 0)
@@ -246,7 +271,8 @@ static int mv3310_power_up(struct phy_device *phydev) · 71 unmodified lines
246271 ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
247272 MV_V2_PORT_CTRL_PWRDOWN);
248273
249− if (priv->firmware_ver < 0x00030000)
274+ if (phydev->drv->phy_id != MARVELL_PHY_ID_88X3310 ||
275+ priv->firmware_ver < 0x00030000)
250276 return ret;
251277
252278 return phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
drivers/net/phy/microchip_t1.c+171−0
@@ -3,9 +3,21 @@ · 2 unmodified lines
33
44 #include <linux/kernel.h>
55 #include <linux/module.h>
6+#include <linux/delay.h>
67 #include <linux/mii.h>
78 #include <linux/phy.h>
89
10+/* External Register Control Register */
11+#define LAN87XX_EXT_REG_CTL (0x14)
12+#define LAN87XX_EXT_REG_CTL_RD_CTL (0x1000)
13+#define LAN87XX_EXT_REG_CTL_WR_CTL (0x0800)
14+
15+/* External Register Read Data Register */
16+#define LAN87XX_EXT_REG_RD_DATA (0x15)
17+
18+/* External Register Write Data Register */
19+#define LAN87XX_EXT_REG_WR_DATA (0x16)
20+
921 /* Interrupt Source Register */
1022 #define LAN87XX_INTERRUPT_SOURCE (0x18)
1123
@@ -14,9 +26,160 @@ · 2 unmodified lines
1426 #define LAN87XX_MASK_LINK_UP (0x0004)
1527 #define LAN87XX_MASK_LINK_DOWN (0x0002)
1628
29+/* phyaccess nested types */
30+#define PHYACC_ATTR_MODE_READ 0
31+#define PHYACC_ATTR_MODE_WRITE 1
32+#define PHYACC_ATTR_MODE_MODIFY 2
33+
34+#define PHYACC_ATTR_BANK_SMI 0
35+#define PHYACC_ATTR_BANK_MISC 1
36+#define PHYACC_ATTR_BANK_PCS 2
37+#define PHYACC_ATTR_BANK_AFE 3
38+#define PHYACC_ATTR_BANK_MAX 7
39+
1740 #define DRIVER_AUTHOR "Nisar Sayed <nisar.sayed@microchip.com>"
1841 #define DRIVER_DESC "Microchip LAN87XX T1 PHY driver"
1942
43+struct access_ereg_val {
44+ u8 mode;
45+ u8 bank;
46+ u8 offset;
47+ u16 val;
48+ u16 mask;
49+};
50+
51+static int access_ereg(struct phy_device *phydev, u8 mode, u8 bank,
52+ u8 offset, u16 val)
53+{
54+ u16 ereg = 0;
55+ int rc = 0;
56+
57+ if (mode > PHYACC_ATTR_MODE_WRITE || bank > PHYACC_ATTR_BANK_MAX)
58+ return -EINVAL;
59+
60+ if (bank == PHYACC_ATTR_BANK_SMI) {
61+ if (mode == PHYACC_ATTR_MODE_WRITE)
62+ rc = phy_write(phydev, offset, val);
63+ else
64+ rc = phy_read(phydev, offset);
65+ return rc;
66+ }
67+
68+ if (mode == PHYACC_ATTR_MODE_WRITE) {
69+ ereg = LAN87XX_EXT_REG_CTL_WR_CTL;
70+ rc = phy_write(phydev, LAN87XX_EXT_REG_WR_DATA, val);
71+ if (rc < 0)
72+ return rc;
73+ } else {
74+ ereg = LAN87XX_EXT_REG_CTL_RD_CTL;
75+ }
76+
77+ ereg |= (bank << 8) | offset;
78+
79+ rc = phy_write(phydev, LAN87XX_EXT_REG_CTL, ereg);
80+ if (rc < 0)
81+ return rc;
82+
83+ if (mode == PHYACC_ATTR_MODE_READ)
84+ rc = phy_read(phydev, LAN87XX_EXT_REG_RD_DATA);
85+
86+ return rc;
87+}
88+
89+static int access_ereg_modify_changed(struct phy_device *phydev,
90+ u8 bank, u8 offset, u16 val, u16 mask)
91+{
92+ int new = 0, rc = 0;
93+
94+ if (bank > PHYACC_ATTR_BANK_MAX)
95+ return -EINVAL;
96+
97+ rc = access_ereg(phydev, PHYACC_ATTR_MODE_READ, bank, offset, val);
98+ if (rc < 0)
99+ return rc;
100+
101+ new = val | (rc & (mask ^ 0xFFFF));
102+ rc = access_ereg(phydev, PHYACC_ATTR_MODE_WRITE, bank, offset, new);
103+
104+ return rc;
105+}
106+
107+static int lan87xx_phy_init(struct phy_device *phydev)
108+{
109+ static const struct access_ereg_val init[] = {
110+ /* TX Amplitude = 5 */
111+ {PHYACC_ATTR_MODE_MODIFY, PHYACC_ATTR_BANK_AFE, 0x0B,
112+ 0x000A, 0x001E},
113+ /* Clear SMI interrupts */
114+ {PHYACC_ATTR_MODE_READ, PHYACC_ATTR_BANK_SMI, 0x18,
115+ 0, 0},
116+ /* Clear MISC interrupts */
117+ {PHYACC_ATTR_MODE_READ, PHYACC_ATTR_BANK_MISC, 0x08,
118+ 0, 0},
119+ /* Turn on TC10 Ring Oscillator (ROSC) */
120+ {PHYACC_ATTR_MODE_MODIFY, PHYACC_ATTR_BANK_MISC, 0x20,
121+ 0x0020, 0x0020},
122+ /* WUR Detect Length to 1.2uS, LPC Detect Length to 1.09uS */
123+ {PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_PCS, 0x20,
124+ 0x283C, 0},
125+ /* Wake_In Debounce Length to 39uS, Wake_Out Length to 79uS */
126+ {PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_MISC, 0x21,
127+ 0x274F, 0},
128+ /* Enable Auto Wake Forward to Wake_Out, ROSC on, Sleep,
129+ * and Wake_In to wake PHY
130+ */
131+ {PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_MISC, 0x20,
132+ 0x80A7, 0},
133+ /* Enable WUP Auto Fwd, Enable Wake on MDI, Wakeup Debouncer
134+ * to 128 uS
135+ */
136+ {PHYACC_ATTR_MODE_WRITE, PHYACC_ATTR_BANK_MISC, 0x24,
137+ 0xF110, 0},
138+ /* Enable HW Init */
139+ {PHYACC_ATTR_MODE_MODIFY, PHYACC_ATTR_BANK_SMI, 0x1A,
140+ 0x0100, 0x0100},
141+ };
142+ int rc, i;
143+
144+ /* Start manual initialization procedures in Managed Mode */
145+ rc = access_ereg_modify_changed(phydev, PHYACC_ATTR_BANK_SMI,
146+ 0x1a, 0x0000, 0x0100);
147+ if (rc < 0)
148+ return rc;
149+
150+ /* Soft Reset the SMI block */
151+ rc = access_ereg_modify_changed(phydev, PHYACC_ATTR_BANK_SMI,
152+ 0x00, 0x8000, 0x8000);
153+ if (rc < 0)
154+ return rc;
155+
156+ /* Check to see if the self-clearing bit is cleared */
157+ usleep_range(1000, 2000);
158+ rc = access_ereg(phydev, PHYACC_ATTR_MODE_READ,
159+ PHYACC_ATTR_BANK_SMI, 0x00, 0);
160+ if (rc < 0)
161+ return rc;
162+ if ((rc & 0x8000) != 0)
163+ return -ETIMEDOUT;
164+
165+ /* PHY Initialization */
166+ for (i = 0; i < ARRAY_SIZE(init); i++) {
167+ if (init[i].mode == PHYACC_ATTR_MODE_MODIFY) {
168+ rc = access_ereg_modify_changed(phydev, init[i].bank,
169+ init[i].offset,
170+ init[i].val,
171+ init[i].mask);
172+ } else {
173+ rc = access_ereg(phydev, init[i].mode, init[i].bank,
174+ init[i].offset, init[i].val);
175+ }
176+ if (rc < 0)
177+ return rc;
178+ }
179+
180+ return 0;
181+}
182+
20183 static int lan87xx_phy_config_intr(struct phy_device *phydev)
21184 {
22185 int rc, val = 0;
@@ -40,6 +203,13 @@ static int lan87xx_phy_ack_interrupt(struct phy_device *phydev) · 17 unmodified lines
40203 return rc < 0 ? rc : 0;
41204 }
42205
206+static int lan87xx_config_init(struct phy_device *phydev)
207+{
208+ int rc = lan87xx_phy_init(phydev);
209+
210+ return rc < 0 ? rc : 0;
211+}
212+
43213 static struct phy_driver microchip_t1_phy_driver[] = {
44214 {
45215 .phy_id = 0x0007c150,
@@ -48,6 +218,7 @@ static struct phy_driver microchip_t1_phy_driver[] = { · 2 unmodified lines
48218
49219 .features = PHY_BASIC_T1_FEATURES,
50220
221+ .config_init = lan87xx_config_init,
51222 .config_aneg = genphy_config_aneg,
52223
53224 .ack_interrupt = lan87xx_phy_ack_interrupt,
drivers/net/team/team.c+4−0
@@ -468,6 +468,9 @@ static const struct team_mode *team_mode_get(const char *kind) · 467 unmodified lines
468468 struct team_mode_item *mitem;
469469 const struct team_mode *mode = NULL;
470470
471+ if (!try_module_get(THIS_MODULE))
472+ return NULL;
473+
471474 spin_lock(&mode_list_lock);
472475 mitem = __find_mode(kind);
473476 if (!mitem) {
@@ -483,6 +486,7 @@ static const struct team_mode *team_mode_get(const char *kind) · 9 unmodified lines
483486 }
484487
485488 spin_unlock(&mode_list_lock);
489+ module_put(THIS_MODULE);
486490 return mode;
487491 }
488492
drivers/net/usb/qmi_wwan.c+1−0
@@ -1359,6 +1359,7 @@ static const struct usb_device_id products[] = { · 1358 unmodified lines
13591359 {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
13601360 {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
13611361 {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
1362+ {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */
13621363 {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
13631364 {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */
13641365 {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
drivers/net/vrf.c+6−4
@@ -188,8 +188,8 @@ static netdev_tx_t vrf_process_v6_outbound(struct sk_buff *skb, · 187 unmodified lines
188188 fl6.flowi6_proto = iph->nexthdr;
189189 fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF;
190190
191− dst = ip6_route_output(net, NULL, &fl6);
192− if (dst == dst_null)
191+ dst = ip6_dst_lookup_flow(net, NULL, &fl6, NULL);
192+ if (IS_ERR(dst) || dst == dst_null)
193193 goto err;
194194
195195 skb_dst_drop(skb);
@@ -474,7 +474,8 @@ static struct sk_buff *vrf_ip6_out(struct net_device *vrf_dev, · 278 unmodified lines
474474 if (rt6_need_strict(&ipv6_hdr(skb)->daddr))
475475 return skb;
476476
477− if (qdisc_tx_is_default(vrf_dev))
477+ if (qdisc_tx_is_default(vrf_dev) ||
478+ IP6CB(skb)->flags & IP6SKB_XFRM_TRANSFORMED)
478479 return vrf_ip6_out_direct(vrf_dev, sk, skb);
479480
480481 return vrf_ip6_out_redirect(vrf_dev, skb);
@@ -686,7 +687,8 @@ static struct sk_buff *vrf_ip_out(struct net_device *vrf_dev, · 205 unmodified lines
686687 ipv4_is_lbcast(ip_hdr(skb)->daddr))
687688 return skb;
688689
689− if (qdisc_tx_is_default(vrf_dev))
690+ if (qdisc_tx_is_default(vrf_dev) ||
691+ IPCB(skb)->flags & IPSKB_XFRM_TRANSFORMED)
690692 return vrf_ip_out_direct(vrf_dev, sk, skb);
691693
692694 return vrf_ip_out_redirect(vrf_dev, skb);
drivers/net/vxlan.c+3−3
@@ -3144,7 +3144,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[], · 3143 unmodified lines
31443144 u32 id = nla_get_u32(data[IFLA_VXLAN_ID]);
31453145
31463146 if (id >= VXLAN_N_VID) {
3147− NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_VXLAN_ID],
3147+ NL_SET_ERR_MSG_ATTR(extack, data[IFLA_VXLAN_ID],
31483148 "VXLAN ID must be lower than 16777216");
31493149 return -ERANGE;
31503150 }
@@ -3155,7 +3155,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[], · 4 unmodified lines
31553155 = nla_data(data[IFLA_VXLAN_PORT_RANGE]);
31563156
31573157 if (ntohs(p->high) < ntohs(p->low)) {
3158− NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_VXLAN_PORT_RANGE],
3158+ NL_SET_ERR_MSG_ATTR(extack, data[IFLA_VXLAN_PORT_RANGE],
31593159 "Invalid source port range");
31603160 return -EINVAL;
31613161 }
@@ -3165,7 +3165,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[], · 3 unmodified lines
31653165 enum ifla_vxlan_df df = nla_get_u8(data[IFLA_VXLAN_DF]);
31663166
31673167 if (df < 0 || df > VXLAN_DF_MAX) {
3168− NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_VXLAN_DF],
3168+ NL_SET_ERR_MSG_ATTR(extack, data[IFLA_VXLAN_DF],
31693169 "Invalid DF attribute");
31703170 return -EINVAL;
31713171 }
drivers/net/wimax/i2400m/usb-fw.c+1−0
@@ -354,6 +354,7 @@ out: · 353 unmodified lines
354354 usb_autopm_put_interface(i2400mu->usb_iface);
355355 d_fnend(8, dev, "(i2400m %p ack %p size %zu) = %ld\n",
356356 i2400m, ack, ack_size, (long) result);
357+ usb_put_urb(&notif_urb);
357358 return result;
358359
359360 error_exceeded:
drivers/net/wireguard/queueing.c+3−1
@@ -35,8 +35,10 @@ int wg_packet_queue_init(struct crypt_queue *queue, work_func_t function, · 34 unmodified lines
3535 if (multicore) {
3636 queue->worker = wg_packet_percpu_multicore_worker_alloc(
3737 function, queue);
38− if (!queue->worker)
38+ if (!queue->worker) {
39+ ptr_ring_cleanup(&queue->ring, NULL);
3940 return -ENOMEM;
41+ }
4042 } else {
4143 INIT_WORK(&queue->work, function);
4244 }
drivers/net/wireguard/receive.c+10−11
@@ -226,21 +226,20 @@ void wg_packet_handshake_receive_worker(struct work_struct *work) · 225 unmodified lines
226226 static void keep_key_fresh(struct wg_peer *peer)
227227 {
228228 struct noise_keypair *keypair;
229− bool send = false;
229+ bool send;
230230
231231 if (peer->sent_lastminute_handshake)
232232 return;
233233
234234 rcu_read_lock_bh();
235235 keypair = rcu_dereference_bh(peer->keypairs.current_keypair);
236− if (likely(keypair && READ_ONCE(keypair->sending.is_valid)) &&
237− keypair->i_am_the_initiator &&
238− unlikely(wg_birthdate_has_expired(keypair->sending.birthdate,
239− REJECT_AFTER_TIME - KEEPALIVE_TIMEOUT - REKEY_TIMEOUT)))
240− send = true;
236+ send = keypair && READ_ONCE(keypair->sending.is_valid) &&
237+ keypair->i_am_the_initiator &&
238+ wg_birthdate_has_expired(keypair->sending.birthdate,
239+ REJECT_AFTER_TIME - KEEPALIVE_TIMEOUT - REKEY_TIMEOUT);
241240 rcu_read_unlock_bh();
242241
243− if (send) {
242+ if (unlikely(send)) {
244243 peer->sent_lastminute_handshake = true;
245244 wg_packet_send_queued_handshake_initiation(peer, false);
246245 }
@@ -393,13 +392,11 @@ static void wg_packet_consume_data_done(struct wg_peer *peer, · 146 unmodified lines
393392 len = ntohs(ip_hdr(skb)->tot_len);
394393 if (unlikely(len < sizeof(struct iphdr)))
395394 goto dishonest_packet_size;
396− if (INET_ECN_is_ce(PACKET_CB(skb)->ds))
397− IP_ECN_set_ce(ip_hdr(skb));
395+ INET_ECN_decapsulate(skb, PACKET_CB(skb)->ds, ip_hdr(skb)->tos);
398396 } else if (skb->protocol == htons(ETH_P_IPV6)) {
399397 len = ntohs(ipv6_hdr(skb)->payload_len) +
400398 sizeof(struct ipv6hdr);
401− if (INET_ECN_is_ce(PACKET_CB(skb)->ds))
402− IP6_ECN_set_ce(skb, ipv6_hdr(skb));
399+ INET_ECN_decapsulate(skb, PACKET_CB(skb)->ds, ipv6_get_dsfield(ipv6_hdr(skb)));
403400 } else {
404401 goto dishonest_packet_type;
405402 }
@@ -518,6 +515,8 @@ void wg_packet_decrypt_worker(struct work_struct *work) · 112 unmodified lines
518515 &PACKET_CB(skb)->keypair->receiving)) ?
519516 PACKET_STATE_CRYPTED : PACKET_STATE_DEAD;
520517 wg_queue_enqueue_per_peer_napi(skb, state);
518+ if (need_resched())
519+ cond_resched();
521520 }
522521 }
523522
drivers/net/wireguard/selftest/ratelimiter.c+2−2
@@ -120,9 +120,9 @@ bool __init wg_ratelimiter_selftest(void) · 119 unmodified lines
120120 enum { TRIALS_BEFORE_GIVING_UP = 5000 };
121121 bool success = false;
122122 int test = 0, trials;
123− struct sk_buff *skb4, *skb6;
123+ struct sk_buff *skb4, *skb6 = NULL;
124124 struct iphdr *hdr4;
125− struct ipv6hdr *hdr6;
125+ struct ipv6hdr *hdr6 = NULL;
126126
127127 if (IS_ENABLED(CONFIG_KASAN) || IS_ENABLED(CONFIG_UBSAN))
128128 return true;
drivers/net/wireguard/send.c+10−10
@@ -124,20 +124,17 @@ void wg_packet_send_handshake_cookie(struct wg_device *wg, · 123 unmodified lines
124124 static void keep_key_fresh(struct wg_peer *peer)
125125 {
126126 struct noise_keypair *keypair;
127− bool send = false;
127+ bool send;
128128
129129 rcu_read_lock_bh();
130130 keypair = rcu_dereference_bh(peer->keypairs.current_keypair);
131− if (likely(keypair && READ_ONCE(keypair->sending.is_valid)) &&
132− (unlikely(atomic64_read(&keypair->sending.counter.counter) >
133− REKEY_AFTER_MESSAGES) ||
134− (keypair->i_am_the_initiator &&
135− unlikely(wg_birthdate_has_expired(keypair->sending.birthdate,
136− REKEY_AFTER_TIME)))))
137− send = true;
131+ send = keypair && READ_ONCE(keypair->sending.is_valid) &&
132+ (atomic64_read(&keypair->sending.counter.counter) > REKEY_AFTER_MESSAGES ||
133+ (keypair->i_am_the_initiator &&
134+ wg_birthdate_has_expired(keypair->sending.birthdate, REKEY_AFTER_TIME)));
138135 rcu_read_unlock_bh();
139136
140− if (send)
137+ if (unlikely(send))
141138 wg_packet_send_queued_handshake_initiation(peer, false);
142139 }
143140
@@ -281,6 +278,8 @@ void wg_packet_tx_worker(struct work_struct *work) · 137 unmodified lines
281278
282279 wg_noise_keypair_put(keypair, false);
283280 wg_peer_put(peer);
281+ if (need_resched())
282+ cond_resched();
284283 }
285284 }
286285
@@ -304,7 +303,8 @@ void wg_packet_encrypt_worker(struct work_struct *work) · 17 unmodified lines
304303 }
305304 wg_queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first,
306305 state);
307−
306+ if (need_resched())
307+ cond_resched();
308308 }
309309 }
310310
drivers/net/wireguard/socket.c+0−12
@@ -76,12 +76,6 @@ static int send4(struct wg_device *wg, struct sk_buff *skb, · 75 unmodified lines
7676 net_dbg_ratelimited("%s: No route to %pISpfsc, error %d\n",
7777 wg->dev->name, &endpoint->addr, ret);
7878 goto err;
79− } else if (unlikely(rt->dst.dev == skb->dev)) {
80− ip_rt_put(rt);
81− ret = -ELOOP;
82− net_dbg_ratelimited("%s: Avoiding routing loop to %pISpfsc\n",
83− wg->dev->name, &endpoint->addr);
84− goto err;
8579 }
8680 if (cache)
8781 dst_cache_set_ip4(cache, &rt->dst, fl.saddr);
@@ -149,12 +143,6 @@ static int send6(struct wg_device *wg, struct sk_buff *skb, · 61 unmodified lines
149143 net_dbg_ratelimited("%s: No route to %pISpfsc, error %d\n",
150144 wg->dev->name, &endpoint->addr, ret);
151145 goto err;
152− } else if (unlikely(dst->dev == skb->dev)) {
153− dst_release(dst);
154− ret = -ELOOP;
155− net_dbg_ratelimited("%s: Avoiding routing loop to %pISpfsc\n",
156− wg->dev->name, &endpoint->addr);
157− goto err;
158146 }
159147 if (cache)
160148 dst_cache_set_ip6(cache, dst, &fl.saddr);
drivers/net/wireless/intel/iwlegacy/3945-rs.c+1−1
@@ -374,7 +374,7 @@ out: · 373 unmodified lines
374374 }
375375
376376 static void *
377−il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
377+il3945_rs_alloc(struct ieee80211_hw *hw)
378378 {
379379 return hw->priv;
380380 }
drivers/net/wireless/intel/iwlegacy/4965-rs.c+1−1
@@ -2474,7 +2474,7 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta, · 2473 unmodified lines
24742474 }
24752475
24762476 static void *
2477−il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
2477+il4965_rs_alloc(struct ieee80211_hw *hw)
24782478 {
24792479 return hw->priv;
24802480 }
drivers/net/wireless/intel/iwlwifi/dvm/rs.c+1−1
@@ -3019,7 +3019,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, · 3018 unmodified lines
30193019 cpu_to_le16(priv->lib->bt_params->agg_time_limit);
30203020 }
30213021
3022−static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
3022+static void *rs_alloc(struct ieee80211_hw *hw)
30233023 {
30243024 return hw->priv;
30253025 }
drivers/net/wireless/intel/iwlwifi/fw/acpi.c+7−2
@@ -296,9 +296,14 @@ int iwl_sar_select_profile(struct iwl_fw_runtime *fwrt, · 295 unmodified lines
296296 if (!prof->enabled) {
297297 IWL_DEBUG_RADIO(fwrt, "SAR profile %d is disabled.\n",
298298 profs[i]);
299− /* if one of the profiles is disabled, we fail all */
300− return -ENOENT;
299+ /*
300+ * if one of the profiles is disabled, we
301+ * ignore all of them and return 1 to
302+ * differentiate disabled from other failures.
303+ */
304+ return 1;
301305 }
306+
302307 IWL_DEBUG_INFO(fwrt,
303308 "SAR EWRD: chain %d profile index %d\n",
304309 i, profs[i]);
drivers/net/wireless/intel/iwlwifi/fw/api/txq.h+3−3
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11− * Copyright(c) 2019 Intel Corporation
11+ * Copyright(c) 2019 - 2020 Intel Corporation
1212 *
1313 * This program is free software; you can redistribute it and/or modify
1414 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@ · 16 unmodified lines
3131 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3232 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3333 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34− * Copyright(c) 2019 Intel Corporation
34+ * Copyright(c) 2019 - 2020 Intel Corporation
3535 * All rights reserved.
3636 *
3737 * Redistribution and use in source and binary forms, with or without
@@ -99,7 +99,7 @@ enum iwl_mvm_dqa_txq { · 61 unmodified lines
9999 IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
100100 IWL_MVM_DQA_AP_PROBE_RESP_QUEUE = 9,
101101 IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
102− IWL_MVM_DQA_MAX_DATA_QUEUE = 31,
102+ IWL_MVM_DQA_MAX_DATA_QUEUE = 30,
103103 };
104104
105105 enum iwl_mvm_tx_fifo {
drivers/net/wireless/intel/iwlwifi/iwl-drv.c+1−1
@@ -1467,7 +1467,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) · 1466 unmodified lines
14671467 kmemdup(pieces->dbg_conf_tlv[i],
14681468 pieces->dbg_conf_tlv_len[i],
14691469 GFP_KERNEL);
1470− if (!pieces->dbg_conf_tlv[i])
1470+ if (!drv->fw.dbg.conf_tlv[i])
14711471 goto out_free_fw;
14721472 }
14731473 }
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c+2−4
@@ -532,8 +532,7 @@ static struct ieee80211_sband_iftype_data iwl_he_capa[] = { · 531 unmodified lines
532532 IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US |
533533 IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8,
534534 .mac_cap_info[2] =
535− IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP |
536− IEEE80211_HE_MAC_CAP2_ACK_EN,
535+ IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP,
537536 .mac_cap_info[3] =
538537 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
539538 IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
@@ -617,8 +616,7 @@ static struct ieee80211_sband_iftype_data iwl_he_capa[] = { · 77 unmodified lines
617616 IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US |
618617 IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8,
619618 .mac_cap_info[2] =
620− IEEE80211_HE_MAC_CAP2_BSR |
621− IEEE80211_HE_MAC_CAP2_ACK_EN,
619+ IEEE80211_HE_MAC_CAP2_BSR,
622620 .mac_cap_info[3] =
623621 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
624622 IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
drivers/net/wireless/intel/iwlwifi/mvm/fw.c+11−14
@@ -727,6 +727,7 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b) · 726 unmodified lines
727727 struct iwl_dev_tx_power_cmd_v4 v4;
728728 } cmd;
729729
730+ int ret;
730731 u16 len = 0;
731732
732733 cmd.v5.v3.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS);
@@ -741,9 +742,14 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b) · 8 unmodified lines
741742 len = sizeof(cmd.v4.v3);
742743
743744
744− if (iwl_sar_select_profile(&mvm->fwrt, cmd.v5.v3.per_chain_restriction,
745− prof_a, prof_b))
746− return -ENOENT;
745+ ret = iwl_sar_select_profile(&mvm->fwrt,
746+ cmd.v5.v3.per_chain_restriction,
747+ prof_a, prof_b);
748+
749+ /* return on error or if the profile is disabled (positive number) */
750+ if (ret)
751+ return ret;
752+
747753 IWL_DEBUG_RADIO(mvm, "Sending REDUCE_TX_POWER_CMD per chain\n");
748754 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
749755 }
@@ -1034,16 +1040,7 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm) · 284 unmodified lines
10341040 "EWRD SAR BIOS table invalid or unavailable. (%d)\n",
10351041 ret);
10361042
1037− ret = iwl_mvm_sar_select_profile(mvm, 1, 1);
1038− /*
1039− * If we don't have profile 0 from BIOS, just skip it. This
1040− * means that SAR Geo will not be enabled either, even if we
1041− * have other valid profiles.
1042− */
1043− if (ret == -ENOENT)
1044− return 1;
1045−
1046− return ret;
1043+ return iwl_mvm_sar_select_profile(mvm, 1, 1);
10471044 }
10481045
10491046 static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm)
@@ -1272,7 +1269,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) · 222 unmodified lines
12721269 ret = iwl_mvm_sar_init(mvm);
12731270 if (ret == 0) {
12741271 ret = iwl_mvm_sar_geo_init(mvm);
1275− } else if (ret > 0 && !iwl_sar_get_wgds_table(&mvm->fwrt)) {
1272+ } else if (ret == -ENOENT && !iwl_sar_get_wgds_table(&mvm->fwrt)) {
12761273 /*
12771274 * If basic SAR is not available, we check for WGDS,
12781275 * which should *not* be available either. If it is
drivers/net/wireless/intel/iwlwifi/mvm/rs.c+1−1
@@ -3665,7 +3665,7 @@ static void rs_fill_lq_cmd(struct iwl_mvm *mvm, · 3664 unmodified lines
36653665 cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta));
36663666 }
36673667
3668−static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
3668+static void *rs_alloc(struct ieee80211_hw *hw)
36693669 {
36703670 return hw->priv;
36713671 }
drivers/net/wireless/intel/iwlwifi/mvm/rx.c+11−2
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11− * Copyright(c) 2018 - 2019 Intel Corporation
11+ * Copyright(c) 2018 - 2020 Intel Corporation
1212 *
1313 * This program is free software; you can redistribute it and/or modify
1414 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@ · 16 unmodified lines
3131 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3232 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3333 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34− * Copyright(c) 2018 - 2019 Intel Corporation
34+ * Copyright(c) 2018 - 2020 Intel Corporation
3535 * All rights reserved.
3636 *
3737 * Redistribution and use in source and binary forms, with or without
@@ -566,6 +566,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi, · 528 unmodified lines
566566
567567 struct iwl_mvm_stat_data {
568568 struct iwl_mvm *mvm;
569+ __le32 flags;
569570 __le32 mac_id;
570571 u8 beacon_filter_average_energy;
571572 void *general;
@@ -606,6 +607,13 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac, · 34 unmodified lines
606607 -general->beacon_average_energy[vif_id];
607608 }
608609
610+ /* make sure that beacon statistics don't go backwards with TCM
611+ * request to clear statistics
612+ */
613+ if (le32_to_cpu(data->flags) & IWL_STATISTICS_REPLY_FLG_CLEAR)
614+ mvmvif->beacon_stats.accu_num_beacons +=
615+ mvmvif->beacon_stats.num_beacons;
616+
609617 if (mvmvif->id != id)
610618 return;
611619
@@ -763,6 +771,7 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm, · 151 unmodified lines
763771
764772 flags = stats->flag;
765773 }
774+ data.flags = flags;
766775
767776 iwl_mvm_rx_stats_check_trigger(mvm, pkt);
768777
drivers/net/wireless/intel/iwlwifi/mvm/sta.c+7−2
@@ -722,6 +722,11 @@ static int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, · 721 unmodified lines
722722
723723 lockdep_assert_held(&mvm->mutex);
724724
725+ if (WARN(maxq >= mvm->trans->trans_cfg->base_params->num_of_queues,
726+ "max queue %d >= num_of_queues (%d)", maxq,
727+ mvm->trans->trans_cfg->base_params->num_of_queues))
728+ maxq = mvm->trans->trans_cfg->base_params->num_of_queues - 1;
729+
725730 /* This should not be hit with new TX path */
726731 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm)))
727732 return -ENOSPC;
@@ -1164,9 +1169,9 @@ static int iwl_mvm_inactivity_check(struct iwl_mvm *mvm, u8 alloc_for_sta) · 436 unmodified lines
11641169 inactive_tid_bitmap,
11651170 &unshare_queues,
11661171 &changetid_queues);
1167− if (ret >= 0 && free_queue < 0) {
1172+ if (ret && free_queue < 0) {
11681173 queue_owner = sta;
1169− free_queue = ret;
1174+ free_queue = i;
11701175 }
11711176 /* only unlock sta lock - we still need the queue info lock */
11721177 spin_unlock_bh(&mvmsta->lock);
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c+14−4
@@ -129,6 +129,18 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, · 128 unmodified lines
129129 int cmdq_size = max_t(u32, IWL_CMD_QUEUE_SIZE,
130130 trans->cfg->min_txq_size);
131131
132+ switch (trans_pcie->rx_buf_size) {
133+ case IWL_AMSDU_DEF:
134+ return -EINVAL;
135+ case IWL_AMSDU_2K:
136+ break;
137+ case IWL_AMSDU_4K:
138+ case IWL_AMSDU_8K:
139+ case IWL_AMSDU_12K:
140+ control_flags |= IWL_PRPH_SCRATCH_RB_SIZE_4K;
141+ break;
142+ }
143+
132144 /* Allocate prph scratch */
133145 prph_scratch = dma_alloc_coherent(trans->dev, sizeof(*prph_scratch),
134146 &trans_pcie->prph_scratch_dma_addr,
@@ -143,10 +155,8 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, · 8 unmodified lines
143155 cpu_to_le16((u16)iwl_read32(trans, CSR_HW_REV));
144156 prph_sc_ctrl->version.size = cpu_to_le16(sizeof(*prph_scratch) / 4);
145157
146− control_flags = IWL_PRPH_SCRATCH_RB_SIZE_4K |
147− IWL_PRPH_SCRATCH_MTR_MODE |
148− (IWL_PRPH_MTR_FORMAT_256B &
149− IWL_PRPH_SCRATCH_MTR_FORMAT);
158+ control_flags |= IWL_PRPH_SCRATCH_MTR_MODE;
159+ control_flags |= IWL_PRPH_MTR_FORMAT_256B & IWL_PRPH_SCRATCH_MTR_FORMAT;
150160
151161 /* initialize RX default queue */
152162 prph_sc_ctrl->rbd_cfg.free_rbd_addr =
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c+3−0
@@ -1418,6 +1418,9 @@ void iwl_trans_pcie_dyn_txq_free(struct iwl_trans *trans, int queue) · 1417 unmodified lines
14181418
14191419 iwl_pcie_gen2_txq_unmap(trans, queue);
14201420
1421+ iwl_pcie_gen2_txq_free_memory(trans, trans_pcie->txq[queue]);
1422+ trans_pcie->txq[queue] = NULL;
1423+
14211424 IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", queue);
14221425 }
14231426
drivers/net/wireless/mac80211_hwsim.c+1−1
@@ -4068,7 +4068,7 @@ static void hwsim_virtio_rx_work(struct work_struct *work) · 4067 unmodified lines
40684068 }
40694069 vq = hwsim_vqs[HWSIM_VQ_RX];
40704070 sg_init_one(sg, skb->head, skb_end_offset(skb));
4071− err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL);
4071+ err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_ATOMIC);
40724072 if (WARN(err, "virtqueue_add_inbuf returned %d\n", err))
40734073 nlmsg_free(skb);
40744074 else
drivers/net/wireless/realtek/rtlwifi/rc.c+1−1
@@ -261,7 +261,7 @@ static void rtl_rate_update(void *ppriv, · 260 unmodified lines
261261 {
262262 }
263263
264−static void *rtl_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
264+static void *rtl_rate_alloc(struct ieee80211_hw *hw)
265265 {
266266 struct rtl_priv *rtlpriv = rtl_priv(hw);
267267 return rtlpriv;
drivers/nvme/host/core.c+3−1
@@ -1110,7 +1110,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, · 1109 unmodified lines
11101110 * Don't treat an error as fatal, as we potentially already
11111111 * have a NGUID or EUI-64.
11121112 */
1113− if (status > 0)
1113+ if (status > 0 && !(status & NVME_SC_DNR))
11141114 status = 0;
11151115 goto free_data;
11161116 }
@@ -3642,6 +3642,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) · 2525 unmodified lines
36423642
36433643 return;
36443644 out_put_disk:
3645+ /* prevent double queue cleanup */
3646+ ns->disk->queue = NULL;
36453647 put_disk(ns->disk);
36463648 out_unlink_ns:
36473649 mutex_lock(&ctrl->subsys->lock);
drivers/nvme/host/pci.c+5−1
@@ -973,9 +973,13 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx) · 972 unmodified lines
973973
974974 static inline void nvme_update_cq_head(struct nvme_queue *nvmeq)
975975 {
976− if (++nvmeq->cq_head == nvmeq->q_depth) {
976+ u16 tmp = nvmeq->cq_head + 1;
977+
978+ if (tmp == nvmeq->q_depth) {
977979 nvmeq->cq_head = 0;
978980 nvmeq->cq_phase ^= 1;
981+ } else {
982+ nvmeq->cq_head = tmp;
979983 }
980984 }
981985
drivers/pci/quirks.c+7−0
@@ -5567,3 +5567,10 @@ static void pci_fixup_no_d0_pme(struct pci_dev *dev) · 5566 unmodified lines
55675567 dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
55685568 }
55695569 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
5570+
5571+static void apex_pci_fixup_class(struct pci_dev *pdev)
5572+{
5573+ pdev->class = (PCI_CLASS_SYSTEM_OTHER << 8) | pdev->class;
5574+}
5575+DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a,
5576+ PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);
drivers/phy/qualcomm/phy-qcom-qusb2.c+7−0
@@ -815,6 +815,13 @@ static const struct of_device_id qusb2_phy_of_match_table[] = { · 814 unmodified lines
815815 }, {
816816 .compatible = "qcom,msm8998-qusb2-phy",
817817 .data = &msm8998_phy_cfg,
818+ }, {
819+ /*
820+ * Deprecated. Only here to support legacy device
821+ * trees that didn't include "qcom,qusb2-v2-phy"
822+ */
823+ .compatible = "qcom,sdm845-qusb2-phy",
824+ .data = &qusb2_v2_phy_cfg,
818825 }, {
819826 .compatible = "qcom,qusb2-v2-phy",
820827 .data = &qusb2_v2_phy_cfg,
drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c+21−11
@@ -160,18 +160,11 @@ static int qcom_snps_hsphy_power_on(struct phy *phy) · 159 unmodified lines
160160 ret = regulator_bulk_enable(VREG_NUM, priv->vregs);
161161 if (ret)
162162 return ret;
163− ret = clk_bulk_prepare_enable(priv->num_clks, priv->clks);
164− if (ret)
165− goto err_disable_regulator;
163+
166164 qcom_snps_hsphy_disable_hv_interrupts(priv);
167165 qcom_snps_hsphy_exit_retention(priv);
168166
169167 return 0;
170−
171−err_disable_regulator:
172− regulator_bulk_disable(VREG_NUM, priv->vregs);
173−
174− return ret;
175168 }
176169
177170 static int qcom_snps_hsphy_power_off(struct phy *phy)
@@ -180,7 +173,6 @@ static int qcom_snps_hsphy_power_off(struct phy *phy) · 2 unmodified lines
180173
181174 qcom_snps_hsphy_enter_retention(priv);
182175 qcom_snps_hsphy_enable_hv_interrupts(priv);
183− clk_bulk_disable_unprepare(priv->num_clks, priv->clks);
184176 regulator_bulk_disable(VREG_NUM, priv->vregs);
185177
186178 return 0;
@@ -266,21 +258,39 @@ static int qcom_snps_hsphy_init(struct phy *phy) · 79 unmodified lines
266258 struct hsphy_priv *priv = phy_get_drvdata(phy);
267259 int ret;
268260
269− ret = qcom_snps_hsphy_reset(priv);
261+ ret = clk_bulk_prepare_enable(priv->num_clks, priv->clks);
270262 if (ret)
271263 return ret;
272264
265+ ret = qcom_snps_hsphy_reset(priv);
266+ if (ret)
267+ goto disable_clocks;
268+
273269 qcom_snps_hsphy_init_sequence(priv);
274270
275271 ret = qcom_snps_hsphy_por_reset(priv);
276272 if (ret)
277− return ret;
273+ goto disable_clocks;
274+
275+ return 0;
276+
277+disable_clocks:
278+ clk_bulk_disable_unprepare(priv->num_clks, priv->clks);
279+ return ret;
280+}
281+
282+static int qcom_snps_hsphy_exit(struct phy *phy)
283+{
284+ struct hsphy_priv *priv = phy_get_drvdata(phy);
285+
286+ clk_bulk_disable_unprepare(priv->num_clks, priv->clks);
278287
279288 return 0;
280289 }
281290
282291 static const struct phy_ops qcom_snps_hsphy_ops = {
283292 .init = qcom_snps_hsphy_init,
293+ .exit = qcom_snps_hsphy_exit,
284294 .power_on = qcom_snps_hsphy_power_on,
285295 .power_off = qcom_snps_hsphy_power_off,
286296 .set_mode = qcom_snps_hsphy_set_mode,
drivers/phy/tegra/Kconfig+2−1
@@ -1,7 +1,8 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 config PHY_TEGRA_XUSB
33 tristate "NVIDIA Tegra XUSB pad controller driver"
4− depends on ARCH_TEGRA
4+ depends on ARCH_TEGRA && USB_SUPPORT
5+ select USB_COMMON
56 select USB_CONN_GPIO
67 select USB_PHY
78 help
drivers/platform/chrome/cros_ec_sensorhub.c+46−34
@@ -52,28 +52,15 @@ static int cros_ec_sensorhub_register(struct device *dev, · 51 unmodified lines
5252 int sensor_type[MOTIONSENSE_TYPE_MAX] = { 0 };
5353 struct cros_ec_command *msg = sensorhub->msg;
5454 struct cros_ec_dev *ec = sensorhub->ec;
55− int ret, i, sensor_num;
55+ int ret, i;
5656 char *name;
5757
58− sensor_num = cros_ec_get_sensor_count(ec);
59− if (sensor_num < 0) {
60− dev_err(dev,
61− "Unable to retrieve sensor information (err:%d)\n",
62− sensor_num);
63− return sensor_num;
64− }
65−
66− sensorhub->sensor_num = sensor_num;
67− if (sensor_num == 0) {
68− dev_err(dev, "Zero sensors reported.\n");
69− return -EINVAL;
70− }
7158
7259 msg->version = 1;
7360 msg->insize = sizeof(struct ec_response_motion_sense);
7461 msg->outsize = sizeof(struct ec_params_motion_sense);
7562
76− for (i = 0; i < sensor_num; i++) {
63+ for (i = 0; i < sensorhub->sensor_num; i++) {
7764 sensorhub->params->cmd = MOTIONSENSE_CMD_INFO;
7865 sensorhub->params->info.sensor_num = i;
7966
@@ -140,8 +127,7 @@ static int cros_ec_sensorhub_probe(struct platform_device *pdev) · 60 unmodified lines
140127 struct cros_ec_dev *ec = dev_get_drvdata(dev->parent);
141128 struct cros_ec_sensorhub *data;
142129 struct cros_ec_command *msg;
143− int ret;
144− int i;
130+ int ret, i, sensor_num;
145131
146132 msg = devm_kzalloc(dev, sizeof(struct cros_ec_command) +
147133 max((u16)sizeof(struct ec_params_motion_sense),
@@ -166,10 +152,52 @@ static int cros_ec_sensorhub_probe(struct platform_device *pdev) · 18 unmodified lines
166152 dev_set_drvdata(dev, data);
167153
168154 /* Check whether this EC is a sensor hub. */
169− if (cros_ec_check_features(data->ec, EC_FEATURE_MOTION_SENSE)) {
155+ if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE)) {
156+ sensor_num = cros_ec_get_sensor_count(ec);
157+ if (sensor_num < 0) {
158+ dev_err(dev,
159+ "Unable to retrieve sensor information (err:%d)\n",
160+ sensor_num);
161+ return sensor_num;
162+ }
163+ if (sensor_num == 0) {
164+ dev_err(dev, "Zero sensors reported.\n");
165+ return -EINVAL;
166+ }
167+ data->sensor_num = sensor_num;
168+
169+ /*
170+ * Prepare the ring handler before enumering the
171+ * sensors.
172+ */
173+ if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) {
174+ ret = cros_ec_sensorhub_ring_allocate(data);
175+ if (ret)
176+ return ret;
177+ }
178+
179+ /* Enumerate the sensors.*/
170180 ret = cros_ec_sensorhub_register(dev, data);
171181 if (ret)
172182 return ret;
183+
184+ /*
185+ * When the EC does not have a FIFO, the sensors will query
186+ * their data themselves via sysfs or a software trigger.
187+ */
188+ if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) {
189+ ret = cros_ec_sensorhub_ring_add(data);
190+ if (ret)
191+ return ret;
192+ /*
193+ * The msg and its data is not under the control of the
194+ * ring handler.
195+ */
196+ return devm_add_action_or_reset(dev,
197+ cros_ec_sensorhub_ring_remove,
198+ data);
199+ }
200+
173201 } else {
174202 /*
175203 * If the device has sensors but does not claim to
@@ -184,22 +212,6 @@ static int cros_ec_sensorhub_probe(struct platform_device *pdev) · 8 unmodified lines
184212 }
185213 }
186214
187− /*
188− * If the EC does not have a FIFO, the sensors will query their data
189− * themselves via sysfs or a software trigger.
190− */
191− if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) {
192− ret = cros_ec_sensorhub_ring_add(data);
193− if (ret)
194− return ret;
195− /*
196− * The msg and its data is not under the control of the ring
197− * handler.
198− */
199− return devm_add_action_or_reset(dev,
200− cros_ec_sensorhub_ring_remove,
201− data);
202− }
203215
204216 return 0;
205217 }
drivers/platform/chrome/cros_ec_sensorhub_ring.c+46−27
@@ -957,17 +957,15 @@ static int cros_ec_sensorhub_event(struct notifier_block *nb, · 956 unmodified lines
957957 }
958958
959959 /**
960− * cros_ec_sensorhub_ring_add() - Add the FIFO functionality if the EC
961− * supports it.
960+ * cros_ec_sensorhub_ring_allocate() - Prepare the FIFO functionality if the EC
961+ * supports it.
962962 *
963963 * @sensorhub : Sensor Hub object.
964964 *
965965 * Return: 0 on success.
966966 */
967−int cros_ec_sensorhub_ring_add(struct cros_ec_sensorhub *sensorhub)
967+int cros_ec_sensorhub_ring_allocate(struct cros_ec_sensorhub *sensorhub)
968968 {
969− struct cros_ec_dev *ec = sensorhub->ec;
970− int ret;
971969 int fifo_info_length =
972970 sizeof(struct ec_response_motion_sense_fifo_info) +
973971 sizeof(u16) * sensorhub->sensor_num;
@@ -978,6 +976,49 @@ int cros_ec_sensorhub_ring_add(struct cros_ec_sensorhub *sensorhub) · 4 unmodified lines
978976 if (!sensorhub->fifo_info)
979977 return -ENOMEM;
980978
979+ /*
980+ * Allocate the callback area based on the number of sensors.
981+ * Add one for the sensor ring.
982+ */
983+ sensorhub->push_data = devm_kcalloc(sensorhub->dev,
984+ sensorhub->sensor_num,
985+ sizeof(*sensorhub->push_data),
986+ GFP_KERNEL);
987+ if (!sensorhub->push_data)
988+ return -ENOMEM;
989+
990+ sensorhub->tight_timestamps = cros_ec_check_features(
991+ sensorhub->ec,
992+ EC_FEATURE_MOTION_SENSE_TIGHT_TIMESTAMPS);
993+
994+ if (sensorhub->tight_timestamps) {
995+ sensorhub->batch_state = devm_kcalloc(sensorhub->dev,
996+ sensorhub->sensor_num,
997+ sizeof(*sensorhub->batch_state),
998+ GFP_KERNEL);
999+ if (!sensorhub->batch_state)
1000+ return -ENOMEM;
1001+ }
1002+
1003+ return 0;
1004+}
1005+
1006+/**
1007+ * cros_ec_sensorhub_ring_add() - Add the FIFO functionality if the EC
1008+ * supports it.
1009+ *
1010+ * @sensorhub : Sensor Hub object.
1011+ *
1012+ * Return: 0 on success.
1013+ */
1014+int cros_ec_sensorhub_ring_add(struct cros_ec_sensorhub *sensorhub)
1015+{
1016+ struct cros_ec_dev *ec = sensorhub->ec;
1017+ int ret;
1018+ int fifo_info_length =
1019+ sizeof(struct ec_response_motion_sense_fifo_info) +
1020+ sizeof(u16) * sensorhub->sensor_num;
1021+
9811022 /* Retrieve FIFO information */
9821023 sensorhub->msg->version = 2;
9831024 sensorhub->params->cmd = MOTIONSENSE_CMD_FIFO_INFO;
@@ -998,31 +1039,9 @@ int cros_ec_sensorhub_ring_add(struct cros_ec_sensorhub *sensorhub) · 14 unmodified lines
9981039 if (!sensorhub->ring)
9991040 return -ENOMEM;
10001041
1001− /*
1002− * Allocate the callback area based on the number of sensors.
1003− */
1004− sensorhub->push_data = devm_kcalloc(
1005− sensorhub->dev, sensorhub->sensor_num,
1006− sizeof(*sensorhub->push_data),
1007− GFP_KERNEL);
1008− if (!sensorhub->push_data)
1009− return -ENOMEM;
1010−
10111042 sensorhub->fifo_timestamp[CROS_EC_SENSOR_LAST_TS] =
10121043 cros_ec_get_time_ns();
10131044
1014− sensorhub->tight_timestamps = cros_ec_check_features(
1015− ec, EC_FEATURE_MOTION_SENSE_TIGHT_TIMESTAMPS);
1016−
1017− if (sensorhub->tight_timestamps) {
1018− sensorhub->batch_state = devm_kcalloc(sensorhub->dev,
1019− sensorhub->sensor_num,
1020− sizeof(*sensorhub->batch_state),
1021− GFP_KERNEL);
1022− if (!sensorhub->batch_state)
1023− return -ENOMEM;
1024− }
1025−
10261045 /* Register the notifier that will act as a top half interrupt. */
10271046 sensorhub->notifier.notifier_call = cros_ec_sensorhub_event;
10281047 ret = blocking_notifier_chain_register(&ec->ec_dev->event_notifier,
drivers/platform/x86/asus-nb-wmi.c+24−0
@@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = { · 514 unmodified lines
515515 .detect_quirks = asus_nb_wmi_quirks,
516516 };
517517
518+static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = {
519+ {
520+ /*
521+ * asus-nb-wm adds no functionality. The T100TA has a detachable
522+ * USB kbd, so no hotkeys and it has no WMI rfkill; and loading
523+ * asus-nb-wm causes the camera LED to turn and _stay_ on.
524+ */
525+ .matches = {
526+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
527+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
528+ },
529+ },
530+ {
531+ /* The Asus T200TA has the same issue as the T100TA */
532+ .matches = {
533+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
534+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"),
535+ },
536+ },
537+ {} /* Terminating entry */
538+};
518539
519540 static int __init asus_nb_wmi_init(void)
520541 {
542+ if (dmi_check_system(asus_nb_wmi_blacklist))
543+ return -ENODEV;
544+
521545 return asus_wmi_register_driver(&asus_nb_wmi_driver);
522546 }
523547
drivers/platform/x86/intel-uncore-frequency.c+1−1
@@ -53,7 +53,7 @@ static int uncore_max_entries __read_mostly; · 52 unmodified lines
5353 /* Storage for uncore data for all instances */
5454 static struct uncore_data *uncore_instances;
5555 /* Root of the all uncore sysfs kobjs */
56−struct kobject *uncore_root_kobj;
56+static struct kobject *uncore_root_kobj;
5757 /* Stores the CPU mask of the target CPUs to use during uncore read/write */
5858 static cpumask_t uncore_cpu_mask;
5959 /* CPU online callback register instance */
drivers/platform/x86/intel_pmc_core.c+5−19
@@ -255,7 +255,7 @@ static const struct pmc_bit_map *ext_cnp_pfear_map[] = { · 254 unmodified lines
255255 };
256256
257257 static const struct pmc_bit_map icl_pfear_map[] = {
258− /* Ice Lake generation onwards only */
258+ /* Ice Lake and Jasper Lake generation onwards only */
259259 {"RES_65", BIT(0)},
260260 {"RES_66", BIT(1)},
261261 {"RES_67", BIT(2)},
@@ -274,7 +274,7 @@ static const struct pmc_bit_map *ext_icl_pfear_map[] = { · 12 unmodified lines
274274 };
275275
276276 static const struct pmc_bit_map tgl_pfear_map[] = {
277− /* Tiger Lake, Elkhart Lake and Jasper Lake generation onwards only */
277+ /* Tiger Lake and Elkhart Lake generation onwards only */
278278 {"PSF9", BIT(0)},
279279 {"RES_66", BIT(1)},
280280 {"RES_67", BIT(2)},
@@ -692,7 +692,6 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev, · 411 unmodified lines
692692 kfree(lpm_regs);
693693 }
694694
695−#if IS_ENABLED(CONFIG_DEBUG_FS)
696695 static bool slps0_dbg_latch;
697696
698697 static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset)
@@ -1133,15 +1132,6 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev) · 434 unmodified lines
11331132 &pmc_core_substate_l_sts_regs_fops);
11341133 }
11351134 }
1136−#else
1137−static inline void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
1138−{
1139−}
1140−
1141−static inline void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
1142−{
1143−}
1144−#endif /* CONFIG_DEBUG_FS */
11451135
11461136 static const struct x86_cpu_id intel_pmc_core_ids[] = {
11471137 X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, &spt_reg_map),
@@ -1156,7 +1146,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = { · 8 unmodified lines
11561146 X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &tgl_reg_map),
11571147 X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &tgl_reg_map),
11581148 X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, &tgl_reg_map),
1159− X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &tgl_reg_map),
1149+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &icl_reg_map),
11601150 {}
11611151 };
11621152
@@ -1260,13 +1250,11 @@ static int pmc_core_remove(struct platform_device *pdev) · 97 unmodified lines
12601250 return 0;
12611251 }
12621252
1263−#ifdef CONFIG_PM_SLEEP
1264−
12651253 static bool warn_on_s0ix_failures;
12661254 module_param(warn_on_s0ix_failures, bool, 0644);
12671255 MODULE_PARM_DESC(warn_on_s0ix_failures, "Check and warn for S0ix failures");
12681256
1269−static int pmc_core_suspend(struct device *dev)
1257+static __maybe_unused int pmc_core_suspend(struct device *dev)
12701258 {
12711259 struct pmc_dev *pmcdev = dev_get_drvdata(dev);
12721260
@@ -1318,7 +1306,7 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev) · 45 unmodified lines
13181306 return false;
13191307 }
13201308
1321−static int pmc_core_resume(struct device *dev)
1309+static __maybe_unused int pmc_core_resume(struct device *dev)
13221310 {
13231311 struct pmc_dev *pmcdev = dev_get_drvdata(dev);
13241312 const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
@@ -1348,8 +1336,6 @@ static int pmc_core_resume(struct device *dev) · 23 unmodified lines
13481336 return 0;
13491337 }
13501338
1351−#endif
1352−
13531339 static const struct dev_pm_ops pmc_core_pm_ops = {
13541340 SET_LATE_SYSTEM_SLEEP_PM_OPS(pmc_core_suspend, pmc_core_resume)
13551341 };
drivers/platform/x86/intel_pmc_core.h+0−2
@@ -282,9 +282,7 @@ struct pmc_dev { · 281 unmodified lines
282282 u32 base_addr;
283283 void __iomem *regbase;
284284 const struct pmc_reg_map *map;
285−#if IS_ENABLED(CONFIG_DEBUG_FS)
286285 struct dentry *dbgfs_dir;
287−#endif /* CONFIG_DEBUG_FS */
288286 int pmc_xram_read_bit;
289287 struct mutex lock; /* generic mutex lock for PMC Core */
290288
drivers/platform/x86/surface3_power.c+2−2
@@ -522,8 +522,8 @@ static int mshw0011_probe(struct i2c_client *client) · 521 unmodified lines
522522 strlcpy(board_info.type, "MSHW0011-bat0", I2C_NAME_SIZE);
523523
524524 bat0 = i2c_acpi_new_device(dev, 1, &board_info);
525− if (!bat0)
526− return -ENOMEM;
525+ if (IS_ERR(bat0))
526+ return PTR_ERR(bat0);
527527
528528 data->bat0 = bat0;
529529 i2c_set_clientdata(bat0, data);
drivers/platform/x86/thinkpad_acpi.c+1−1
@@ -9548,7 +9548,7 @@ static ssize_t tpacpi_battery_store(int what, · 9547 unmodified lines
95489548 if (!battery_info.batteries[battery].start_support)
95499549 return -ENODEV;
95509550 /* valid values are [0, 99] */
9551− if (value < 0 || value > 99)
9551+ if (value > 99)
95529552 return -EINVAL;
95539553 if (value > battery_info.batteries[battery].charge_stop)
95549554 return -EINVAL;
drivers/platform/x86/xiaomi-wmi.c+2−2
@@ -23,7 +23,7 @@ struct xiaomi_wmi { · 22 unmodified lines
2323 unsigned int key_code;
2424 };
2525
26−int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
26+static int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
2727 {
2828 struct xiaomi_wmi *data;
2929
@@ -48,7 +48,7 @@ int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context) · 18 unmodified lines
4848 return input_register_device(data->input_dev);
4949 }
5050
51−void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
51+static void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
5252 {
5353 struct xiaomi_wmi *data;
5454
drivers/ptp/ptp_ines.c+2−2
@@ -400,8 +400,8 @@ static int ines_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr) · 399 unmodified lines
400400 ines_write32(port, ts_stat_rx, ts_stat_rx);
401401 ines_write32(port, ts_stat_tx, ts_stat_tx);
402402
403− port->rxts_enabled = ts_stat_rx == TS_ENABLE ? true : false;
404− port->txts_enabled = ts_stat_tx == TS_ENABLE ? true : false;
403+ port->rxts_enabled = ts_stat_rx == TS_ENABLE;
404+ port->txts_enabled = ts_stat_tx == TS_ENABLE;
405405
406406 spin_unlock_irqrestore(&port->lock, flags);
407407
drivers/regulator/core.c+11−14
@@ -5754,10 +5754,6 @@ static DECLARE_DELAYED_WORK(regulator_init_complete_work, · 5753 unmodified lines
57545754
57555755 static int __init regulator_init_complete(void)
57565756 {
5757− int delay = driver_deferred_probe_timeout;
5758−
5759− if (delay < 0)
5760− delay = 0;
57615757 /*
57625758 * Since DT doesn't provide an idiomatic mechanism for
57635759 * enabling full constraints and since it's much more natural
@@ -5768,17 +5764,18 @@ static int __init regulator_init_complete(void) · 4 unmodified lines
57685764 has_full_constraints = true;
57695765
57705766 /*
5771− * If driver_deferred_probe_timeout is set, we punt
5772− * completion for that many seconds since systems like
5773− * distros will load many drivers from userspace so consumers
5774− * might not always be ready yet, this is particularly an
5775− * issue with laptops where this might bounce the display off
5776− * then on. Ideally we'd get a notification from userspace
5777− * when this happens but we don't so just wait a bit and hope
5778− * we waited long enough. It'd be better if we'd only do
5779− * this on systems that need it.
5767+ * We punt completion for an arbitrary amount of time since
5768+ * systems like distros will load many drivers from userspace
5769+ * so consumers might not always be ready yet, this is
5770+ * particularly an issue with laptops where this might bounce
5771+ * the display off then on. Ideally we'd get a notification
5772+ * from userspace when this happens but we don't so just wait
5773+ * a bit and hope we waited long enough. It'd be better if
5774+ * we'd only do this on systems that need it, and a kernel
5775+ * command line option might be useful.
57805776 */
5781− schedule_delayed_work(&regulator_init_complete_work, delay * HZ);
5777+ schedule_delayed_work(&regulator_init_complete_work,
5778+ msecs_to_jiffies(30000));
57825779
57835780 return 0;
57845781 }
drivers/remoteproc/mtk_common.h+1−1
@@ -68,7 +68,7 @@ struct mtk_scp { · 67 unmodified lines
6868 wait_queue_head_t ack_wq;
6969
7070 void __iomem *cpu_addr;
71− phys_addr_t phys_addr;
71+ dma_addr_t dma_addr;
7272 size_t dram_size;
7373
7474 struct rproc_subdev *rpmsg_subdev;
drivers/remoteproc/mtk_scp.c+3−3
@@ -330,7 +330,7 @@ static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len) · 329 unmodified lines
330330 if (offset >= 0 && (offset + len) < scp->sram_size)
331331 return (void __force *)scp->sram_base + offset;
332332 } else {
333− offset = da - scp->phys_addr;
333+ offset = da - scp->dma_addr;
334334 if (offset >= 0 && (offset + len) < scp->dram_size)
335335 return (void __force *)scp->cpu_addr + offset;
336336 }
@@ -451,7 +451,7 @@ static int scp_map_memory_region(struct mtk_scp *scp) · 114 unmodified lines
451451 /* Reserved SCP code size */
452452 scp->dram_size = MAX_CODE_SIZE;
453453 scp->cpu_addr = dma_alloc_coherent(scp->dev, scp->dram_size,
454− &scp->phys_addr, GFP_KERNEL);
454+ &scp->dma_addr, GFP_KERNEL);
455455 if (!scp->cpu_addr)
456456 return -ENOMEM;
457457
@@ -461,7 +461,7 @@ static int scp_map_memory_region(struct mtk_scp *scp) · 3 unmodified lines
461461 static void scp_unmap_memory_region(struct mtk_scp *scp)
462462 {
463463 dma_free_coherent(scp->dev, scp->dram_size, scp->cpu_addr,
464− scp->phys_addr);
464+ scp->dma_addr);
465465 of_reserved_mem_device_release(scp->dev);
466466 }
467467
drivers/remoteproc/qcom_q6v5_mss.c+20−13
@@ -367,7 +367,7 @@ unroll_pd_votes: · 366 unmodified lines
367367 }
368368
369369 return ret;
370−};
370+}
371371
372372 static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
373373 size_t pd_count)
@@ -1527,7 +1527,7 @@ unroll_attach: · 1153 unmodified lines
15271527 dev_pm_domain_detach(devs[i], false);
15281528
15291529 return ret;
1530−};
1530+}
15311531
15321532 static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
15331533 size_t pd_count)
@@ -1675,7 +1675,7 @@ static int q6v5_probe(struct platform_device *pdev) · 141 unmodified lines
16751675 ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
16761676 1, &qproc->hexagon_mdt_image);
16771677 if (ret < 0 && ret != -EINVAL)
1678− return ret;
1678+ goto free_rproc;
16791679
16801680 platform_set_drvdata(pdev, qproc);
16811681
@@ -1766,17 +1766,23 @@ static int q6v5_probe(struct platform_device *pdev) · 84 unmodified lines
17661766 qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
17671767 if (IS_ERR(qproc->sysmon)) {
17681768 ret = PTR_ERR(qproc->sysmon);
1769− goto detach_proxy_pds;
1769+ goto remove_subdevs;
17701770 }
17711771
17721772 ret = rproc_add(rproc);
17731773 if (ret)
1774− goto detach_proxy_pds;
1774+ goto remove_sysmon_subdev;
17751775
17761776 return 0;
17771777
1778−detach_proxy_pds:
1778+remove_sysmon_subdev:
1779+ qcom_remove_sysmon_subdev(qproc->sysmon);
1780+remove_subdevs:
17791781 qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
1782+ qcom_remove_ssr_subdev(rproc, &qproc->ssr_subdev);
1783+ qcom_remove_smd_subdev(rproc, &qproc->smd_subdev);
1784+ qcom_remove_glink_subdev(rproc, &qproc->glink_subdev);
1785+detach_proxy_pds:
17801786 q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
17811787 detach_active_pds:
17821788 q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
@@ -1789,19 +1795,20 @@ free_rproc: · 6 unmodified lines
17891795 static int q6v5_remove(struct platform_device *pdev)
17901796 {
17911797 struct q6v5 *qproc = platform_get_drvdata(pdev);
1798+ struct rproc *rproc = qproc->rproc;
17921799
1793− rproc_del(qproc->rproc);
1800+ rproc_del(rproc);
17941801
17951802 qcom_remove_sysmon_subdev(qproc->sysmon);
1796− qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
1797− qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
1798− qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
1799− qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
1803+ qcom_remove_ipa_notify_subdev(rproc, &qproc->ipa_notify_subdev);
1804+ qcom_remove_ssr_subdev(rproc, &qproc->ssr_subdev);
1805+ qcom_remove_smd_subdev(rproc, &qproc->smd_subdev);
1806+ qcom_remove_glink_subdev(rproc, &qproc->glink_subdev);
18001807
1801− q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
18021808 q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
1809+ q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
18031810
1804− rproc_free(qproc->rproc);
1811+ rproc_free(rproc);
18051812
18061813 return 0;
18071814 }
drivers/remoteproc/remoteproc_sysfs.c+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 */
55
66 #include <linux/remoteproc.h>
7+#include <linux/slab.h>
78
89 #include "remoteproc_internal.h"
910
drivers/remoteproc/stm32_rproc.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/regmap.h>
2020 #include <linux/remoteproc.h>
2121 #include <linux/reset.h>
22+#include <linux/slab.h>
2223 #include <linux/workqueue.h>
2324
2425 #include "remoteproc_internal.h"
drivers/rpmsg/mtk_rpmsg.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/platform_device.h>
99 #include <linux/remoteproc.h>
1010 #include <linux/rpmsg/mtk_rpmsg.h>
11+#include <linux/slab.h>
1112 #include <linux/workqueue.h>
1213
1314 #include "rpmsg_internal.h"
drivers/s390/net/qeth_core_main.c+5−5
@@ -6717,17 +6717,17 @@ int qeth_stop(struct net_device *dev) · 6716 unmodified lines
67176717 unsigned int i;
67186718
67196719 /* Quiesce the NAPI instances: */
6720− qeth_for_each_output_queue(card, queue, i) {
6720+ qeth_for_each_output_queue(card, queue, i)
67216721 napi_disable(&queue->napi);
6722− del_timer_sync(&queue->timer);
6723− }
67246722
67256723 /* Stop .ndo_start_xmit, might still access queue->napi. */
67266724 netif_tx_disable(dev);
67276725
6728− /* Queues may get re-allocated, so remove the NAPIs here. */
6729− qeth_for_each_output_queue(card, queue, i)
6726+ qeth_for_each_output_queue(card, queue, i) {
6727+ del_timer_sync(&queue->timer);
6728+ /* Queues may get re-allocated, so remove the NAPIs. */
67306729 netif_napi_del(&queue->napi);
6730+ }
67316731 } else {
67326732 netif_tx_disable(dev);
67336733 }
drivers/scsi/Kconfig+1−1
@@ -127,7 +127,7 @@ config CHR_DEV_SG · 126 unmodified lines
127127
128128 For scanners, look at SANE (<http://www.sane-project.org/>). For CD
129129 writer software look at Cdrtools
130− (<http://cdrecord.berlios.de/private/cdrecord.html>)
130+ (<http://cdrtools.sourceforge.net/>)
131131 and for burning a "disk at once": CDRDAO
132132 (<http://cdrdao.sourceforge.net/>). Cdparanoia is a high
133133 quality digital reader of audio CDs (<http://www.xiph.org/paranoia/>).
drivers/scsi/ibmvscsi/ibmvfc.c+5−0
@@ -3640,6 +3640,11 @@ static void ibmvfc_tgt_implicit_logout_and_del(struct ibmvfc_target *tgt) · 3639 unmodified lines
36403640 struct ibmvfc_host *vhost = tgt->vhost;
36413641 struct ibmvfc_event *evt;
36423642
3643+ if (!vhost->logged_in) {
3644+ ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
3645+ return;
3646+ }
3647+
36433648 if (vhost->discovery_threads >= disc_threads)
36443649 return;
36453650
drivers/scsi/ibmvscsi/ibmvscsi.c+0−4
@@ -2320,16 +2320,12 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) · 2319 unmodified lines
23202320 static int ibmvscsi_remove(struct vio_dev *vdev)
23212321 {
23222322 struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev);
2323− unsigned long flags;
23242323
23252324 srp_remove_host(hostdata->host);
23262325 scsi_remove_host(hostdata->host);
23272326
23282327 purge_requests(hostdata, DID_ERROR);
2329−
2330− spin_lock_irqsave(hostdata->host->host_lock, flags);
23312328 release_event_pool(&hostdata->pool, hostdata);
2332− spin_unlock_irqrestore(hostdata->host->host_lock, flags);
23332329
23342330 ibmvscsi_release_crq_queue(&hostdata->queue, hostdata,
23352331 max_events);
drivers/scsi/qla2xxx/qla_attr.c+1−1
@@ -3031,11 +3031,11 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) · 3030 unmodified lines
30313031 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags))
30323032 msleep(1000);
30333033
3034− qla_nvme_delete(vha);
30353034
30363035 qla24xx_disable_vp(vha);
30373036 qla2x00_wait_for_sess_deletion(vha);
30383037
3038+ qla_nvme_delete(vha);
30393039 vha->flags.delete_progress = 1;
30403040
30413041 qlt_remove_target(ha, vha);
drivers/scsi/qla2xxx/qla_mbx.c+1−1
@@ -3153,7 +3153,7 @@ qla24xx_abort_command(srb_t *sp) · 3152 unmodified lines
31533153 ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x108c,
31543154 "Entered %s.\n", __func__);
31553155
3156− if (vha->flags.qpairs_available && sp->qpair)
3156+ if (sp->qpair)
31573157 req = sp->qpair->req;
31583158 else
31593159 return QLA_FUNCTION_FAILED;
drivers/scsi/qla2xxx/qla_os.c+17−18
@@ -3732,6 +3732,13 @@ qla2x00_remove_one(struct pci_dev *pdev) · 3731 unmodified lines
37323732 }
37333733 qla2x00_wait_for_hba_ready(base_vha);
37343734
3735+ /*
3736+ * if UNLOADING flag is already set, then continue unload,
3737+ * where it was set first.
3738+ */
3739+ if (test_and_set_bit(UNLOADING, &base_vha->dpc_flags))
3740+ return;
3741+
37353742 if (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha) ||
37363743 IS_QLA28XX(ha)) {
37373744 if (ha->flags.fw_started)
@@ -3750,15 +3757,6 @@ qla2x00_remove_one(struct pci_dev *pdev) · 12 unmodified lines
37503757
37513758 qla2x00_wait_for_sess_deletion(base_vha);
37523759
3753− /*
3754− * if UNLOAD flag is already set, then continue unload,
3755− * where it was set first.
3756− */
3757− if (test_bit(UNLOADING, &base_vha->dpc_flags))
3758− return;
3759−
3760− set_bit(UNLOADING, &base_vha->dpc_flags);
3761−
37623760 qla_nvme_delete(base_vha);
37633761
37643762 dma_free_coherent(&ha->pdev->dev,
@@ -4864,6 +4862,9 @@ qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) · 1099 unmodified lines
48644862 struct qla_work_evt *e;
48654863 uint8_t bail;
48664864
4865+ if (test_bit(UNLOADING, &vha->dpc_flags))
4866+ return NULL;
4867+
48674868 QLA_VHA_MARK_BUSY(vha, bail);
48684869 if (bail)
48694870 return NULL;
@@ -6628,13 +6629,6 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) · 1758 unmodified lines
66286629 struct pci_dev *pdev = ha->pdev;
66296630 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
66306631
6631− /*
6632− * if UNLOAD flag is already set, then continue unload,
6633− * where it was set first.
6634− */
6635− if (test_bit(UNLOADING, &base_vha->dpc_flags))
6636− return;
6637−
66386632 ql_log(ql_log_warn, base_vha, 0x015b,
66396633 "Disabling adapter.\n");
66406634
@@ -6645,9 +6639,14 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) · 4 unmodified lines
66456639 return;
66466640 }
66476641
6648− qla2x00_wait_for_sess_deletion(base_vha);
6642+ /*
6643+ * if UNLOADING flag is already set, then continue unload,
6644+ * where it was set first.
6645+ */
6646+ if (test_and_set_bit(UNLOADING, &base_vha->dpc_flags))
6647+ return;
66496648
6650− set_bit(UNLOADING, &base_vha->dpc_flags);
6649+ qla2x00_wait_for_sess_deletion(base_vha);
66516650
66526651 qla2x00_delete_all_vps(ha, base_vha);
66536652
drivers/scsi/scsi_lib.c+1−0
@@ -2284,6 +2284,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) · 2283 unmodified lines
22842284 switch (oldstate) {
22852285 case SDEV_RUNNING:
22862286 case SDEV_CREATED_BLOCK:
2287+ case SDEV_QUIESCE:
22872288 case SDEV_OFFLINE:
22882289 break;
22892290 default:
drivers/scsi/sg.c+3−1
@@ -685,8 +685,10 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) · 684 unmodified lines
685685 hp->flags = input_size; /* structure abuse ... */
686686 hp->pack_id = old_hdr.pack_id;
687687 hp->usr_ptr = NULL;
688− if (copy_from_user(cmnd, buf, cmd_size))
688+ if (copy_from_user(cmnd, buf, cmd_size)) {
689+ sg_remove_request(sfp, srp);
689690 return -EFAULT;
691+ }
690692 /*
691693 * SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV,
692694 * but is is possible that the app intended SG_DXFER_TO_DEV, because there
drivers/soc/fsl/dpio/dpio-service.c+14−5
@@ -478,12 +478,18 @@ int dpaa2_io_service_enqueue_multiple_desc_fq(struct dpaa2_io *d, · 477 unmodified lines
478478 const struct dpaa2_fd *fd,
479479 int nb)
480480 {
481− int i;
482− struct qbman_eq_desc ed[32];
481+ struct qbman_eq_desc *ed;
482+ int i, ret;
483+
484+ ed = kcalloc(sizeof(struct qbman_eq_desc), 32, GFP_KERNEL);
485+ if (!ed)
486+ return -ENOMEM;
483487
484488 d = service_select(d);
485− if (!d)
486− return -ENODEV;
489+ if (!d) {
490+ ret = -ENODEV;
491+ goto out;
492+ }
487493
488494 for (i = 0; i < nb; i++) {
489495 qbman_eq_desc_clear(&ed[i]);
@@ -491,7 +497,10 @@ int dpaa2_io_service_enqueue_multiple_desc_fq(struct dpaa2_io *d, · 1 unmodified line
491497 qbman_eq_desc_set_fq(&ed[i], fqid[i]);
492498 }
493499
494− return qbman_swp_enqueue_multiple_desc(d->swp, &ed[0], fd, nb);
500+ ret = qbman_swp_enqueue_multiple_desc(d->swp, &ed[0], fd, nb);
501+out:
502+ kfree(ed);
503+ return ret;
495504 }
496505 EXPORT_SYMBOL(dpaa2_io_service_enqueue_multiple_desc_fq);
497506
drivers/soc/fsl/dpio/qbman-portal.c+2−4
@@ -753,7 +753,7 @@ int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, · 752 unmodified lines
753753 if (!s->eqcr.available) {
754754 eqcr_ci = s->eqcr.ci;
755755 p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI_MEMBACK;
756− s->eqcr.ci = __raw_readl(p) & full_mask;
756+ s->eqcr.ci = *p & full_mask;
757757 s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
758758 eqcr_ci, s->eqcr.ci);
759759 if (!s->eqcr.available) {
@@ -823,7 +823,6 @@ int qbman_swp_enqueue_multiple_desc_direct(struct qbman_swp *s, · 63 unmodified lines
823823 const uint32_t *cl;
824824 uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask;
825825 int i, num_enqueued = 0;
826− uint64_t addr_cena;
827826
828827 half_mask = (s->eqcr.pi_ci_mask>>1);
829828 full_mask = s->eqcr.pi_ci_mask;
@@ -867,7 +866,6 @@ int qbman_swp_enqueue_multiple_desc_direct(struct qbman_swp *s, · 37 unmodified lines
867866
868867 /* Flush all the cacheline without load/store in between */
869868 eqcr_pi = s->eqcr.pi;
870− addr_cena = (uint64_t)s->addr_cena;
871869 for (i = 0; i < num_enqueued; i++)
872870 eqcr_pi++;
873871 s->eqcr.pi = eqcr_pi & full_mask;
@@ -901,7 +899,7 @@ int qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s, · 27 unmodified lines
901899 if (!s->eqcr.available) {
902900 eqcr_ci = s->eqcr.ci;
903901 p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI_MEMBACK;
904− s->eqcr.ci = __raw_readl(p) & full_mask;
902+ s->eqcr.ci = *p & full_mask;
905903 s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
906904 eqcr_ci, s->eqcr.ci);
907905 if (!s->eqcr.available)
drivers/soc/imx/Kconfig+1−0
@@ -21,6 +21,7 @@ config SOC_IMX8M · 20 unmodified lines
2121 bool "i.MX8M SoC family support"
2222 depends on ARCH_MXC || COMPILE_TEST
2323 default ARCH_MXC && ARM64
24+ select SOC_BUS
2425 help
2526 If you say yes here you get support for the NXP i.MX8M family
2627 support, it will provide the SoC info like SoC family,
drivers/soc/xilinx/Kconfig+2−2
@@ -19,7 +19,7 @@ config XILINX_VCU · 18 unmodified lines
1919
2020 config ZYNQMP_POWER
2121 bool "Enable Xilinx Zynq MPSoC Power Management driver"
22− depends on PM && ARCH_ZYNQMP
22+ depends on PM && ZYNQMP_FIRMWARE
2323 default y
2424 select MAILBOX
2525 select ZYNQMP_IPI_MBOX
@@ -35,7 +35,7 @@ config ZYNQMP_POWER · 9 unmodified lines
3535 config ZYNQMP_PM_DOMAINS
3636 bool "Enable Zynq MPSoC generic PM domains"
3737 default y
38− depends on PM && ARCH_ZYNQMP && ZYNQMP_FIRMWARE
38+ depends on PM && ZYNQMP_FIRMWARE
3939 select PM_GENERIC_DOMAINS
4040 help
4141 Say yes to enable device power management through PM domains
drivers/staging/comedi/comedi_fops.c+3−1
@@ -2725,8 +2725,10 @@ static int comedi_open(struct inode *inode, struct file *file) · 2724 unmodified lines
27252725 }
27262726
27272727 cfp = kzalloc(sizeof(*cfp), GFP_KERNEL);
2728− if (!cfp)
2728+ if (!cfp) {
2729+ comedi_dev_put(dev);
27292730 return -ENOMEM;
2731+ }
27302732
27312733 cfp->dev = dev;
27322734
drivers/staging/comedi/drivers/dt2815.c+3−0
@@ -92,6 +92,7 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, · 91 unmodified lines
9292 int ret;
9393
9494 for (i = 0; i < insn->n; i++) {
95+ /* FIXME: lo bit 0 chooses voltage output or current output */
9596 lo = ((data[i] & 0x0f) << 4) | (chan << 1) | 0x01;
9697 hi = (data[i] & 0xff0) >> 4;
9798
@@ -105,6 +106,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, · 7 unmodified lines
105106 if (ret)
106107 return ret;
107108
109+ outb(hi, dev->iobase + DT2815_DATA);
110+
108111 devpriv->ao_readback[chan] = data[i];
109112 }
110113 return i;
drivers/staging/gasket/apex_driver.c+0−7
@@ -570,13 +570,6 @@ static const struct pci_device_id apex_pci_ids[] = { · 569 unmodified lines
570570 { PCI_DEVICE(APEX_PCI_VENDOR_ID, APEX_PCI_DEVICE_ID) }, { 0 }
571571 };
572572
573−static void apex_pci_fixup_class(struct pci_dev *pdev)
574−{
575− pdev->class = (PCI_CLASS_SYSTEM_OTHER << 8) | pdev->class;
576−}
577−DECLARE_PCI_FIXUP_CLASS_HEADER(APEX_PCI_VENDOR_ID, APEX_PCI_DEVICE_ID,
578− PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);
579−
580573 static int apex_pci_probe(struct pci_dev *pci_dev,
581574 const struct pci_device_id *id)
582575 {
drivers/staging/gasket/gasket_core.c+4−0
@@ -925,6 +925,10 @@ do_map_region(const struct gasket_dev *gasket_dev, struct vm_area_struct *vma, · 924 unmodified lines
925925 gasket_get_bar_index(gasket_dev,
926926 (vma->vm_pgoff << PAGE_SHIFT) +
927927 driver_desc->legacy_mmap_address_offset);
928+
929+ if (bar_index < 0)
930+ return DO_MAP_REGION_INVALID;
931+
928932 phys_base = gasket_dev->bar_data[bar_index].phys_base + phys_offset;
929933 while (mapped_bytes < map_length) {
930934 /*
drivers/staging/gasket/gasket_sysfs.c+1−2
@@ -228,8 +228,7 @@ int gasket_sysfs_create_entries(struct device *device, · 227 unmodified lines
228228 }
229229
230230 mutex_lock(&mapping->mutex);
231− for (i = 0; strcmp(attrs[i].attr.attr.name, GASKET_ARRAY_END_MARKER);
232− i++) {
231+ for (i = 0; attrs[i].attr.attr.name != NULL; i++) {
233232 if (mapping->attribute_count == GASKET_SYSFS_MAX_NODES) {
234233 dev_err(device,
235234 "Maximum number of sysfs nodes reached for device\n");
drivers/staging/gasket/gasket_sysfs.h+0−4
@@ -30,10 +30,6 @@ · 29 unmodified lines
3030 */
3131 #define GASKET_SYSFS_MAX_NODES 196
3232
33−/* End markers for sysfs struct arrays. */
34−#define GASKET_ARRAY_END_TOKEN GASKET_RESERVED_ARRAY_END
35−#define GASKET_ARRAY_END_MARKER __stringify(GASKET_ARRAY_END_TOKEN)
36−
3733 /*
3834 * Terminator struct for a gasket_sysfs_attr array. Must be at the end of
3935 * all gasket_sysfs_attribute arrays.
drivers/staging/ks7010/TODO+0−1
@@ -30,5 +30,4 @@ Now the TODOs: · 29 unmodified lines
3030
3131 Please send any patches to:
3232 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33−Wolfram Sang <wsa@the-dreams.de>
3433 Linux Driver Project Developer List <driverdev-devel@linuxdriverproject.org>
drivers/staging/vt6656/key.c+3−11
@@ -83,9 +83,6 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, · 82 unmodified lines
8383 case VNT_KEY_PAIRWISE:
8484 key_mode |= mode;
8585 key_inx = 4;
86− /* Don't save entry for pairwise key for station mode */
87− if (priv->op_mode == NL80211_IFTYPE_STATION)
88− clear_bit(entry, &priv->key_entry_inuse);
8986 break;
9087 default:
9188 return -EINVAL;
@@ -109,7 +106,6 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, · 17 unmodified lines
109106 int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
110107 struct ieee80211_vif *vif, struct ieee80211_key_conf *key)
111108 {
112− struct ieee80211_bss_conf *conf = &vif->bss_conf;
113109 struct vnt_private *priv = hw->priv;
114110 u8 *mac_addr = NULL;
115111 u8 key_dec_mode = 0;
@@ -154,16 +150,12 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, · 38 unmodified lines
154150 return -EOPNOTSUPP;
155151 }
156152
157− if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
153+ if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
158154 vnt_set_keymode(hw, mac_addr, key, VNT_KEY_PAIRWISE,
159155 key_dec_mode, true);
160− } else {
161− vnt_set_keymode(hw, mac_addr, key, VNT_KEY_DEFAULTKEY,
156+ else
157+ vnt_set_keymode(hw, mac_addr, key, VNT_KEY_GROUP_ADDRESS,
162158 key_dec_mode, true);
163159
164− vnt_set_keymode(hw, (u8 *)conf->bssid, key,
165− VNT_KEY_GROUP_ADDRESS, key_dec_mode, true);
166− }
167−
168160 return 0;
169161 }
drivers/staging/vt6656/main_usb.c+17−14
@@ -625,8 +625,6 @@ static int vnt_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) · 624 unmodified lines
625625
626626 priv->op_mode = vif->type;
627627
628− vnt_set_bss_mode(priv);
629−
630628 /* LED blink on TX */
631629 vnt_mac_set_led(priv, LEDSTS_STS, LEDSTS_INTER);
632630
@@ -713,7 +711,6 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, · 80 unmodified lines
713711 priv->basic_rates = conf->basic_rates;
714712
715713 vnt_update_top_rates(priv);
716− vnt_set_bss_mode(priv);
717714
718715 dev_dbg(&priv->usb->dev, "basic rates %x\n", conf->basic_rates);
719716 }
@@ -742,11 +739,14 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, · 22 unmodified lines
742739 priv->short_slot_time = false;
743740
744741 vnt_set_short_slot_time(priv);
745− vnt_update_ifs(priv);
746742 vnt_set_vga_gain_offset(priv, priv->bb_vga[0]);
747743 vnt_update_pre_ed_threshold(priv, false);
748744 }
749745
746+ if (changed & (BSS_CHANGED_BASIC_RATES | BSS_CHANGED_ERP_PREAMBLE |
747+ BSS_CHANGED_ERP_SLOT))
748+ vnt_set_bss_mode(priv);
749+
750750 if (changed & BSS_CHANGED_TXPOWER)
751751 vnt_rf_setpower(priv, priv->current_rate,
752752 conf->chandef.chan->hw_value);
@@ -770,12 +770,15 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, · 17 unmodified lines
770770 vnt_mac_reg_bits_on(priv, MAC_REG_TFTCTL,
771771 TFTCTL_TSFCNTREN);
772772
773− vnt_adjust_tsf(priv, conf->beacon_rate->hw_value,
774− conf->sync_tsf, priv->current_tsf);
775−
776773 vnt_mac_set_beacon_interval(priv, conf->beacon_int);
777774
778775 vnt_reset_next_tbtt(priv, conf->beacon_int);
776+
777+ vnt_adjust_tsf(priv, conf->beacon_rate->hw_value,
778+ conf->sync_tsf, priv->current_tsf);
779+
780+ vnt_update_next_tbtt(priv,
781+ conf->sync_tsf, conf->beacon_int);
779782 } else {
780783 vnt_clear_current_tsf(priv);
781784
@@ -809,15 +812,11 @@ static void vnt_configure(struct ieee80211_hw *hw, · 27 unmodified lines
809812 {
810813 struct vnt_private *priv = hw->priv;
811814 u8 rx_mode = 0;
812− int rc;
813815
814816 *total_flags &= FIF_ALLMULTI | FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC;
815817
816− rc = vnt_control_in(priv, MESSAGE_TYPE_READ, MAC_REG_RCR,
817− MESSAGE_REQUEST_MACREG, sizeof(u8), &rx_mode);
818−
819− if (!rc)
820− rx_mode = RCR_MULTICAST | RCR_BROADCAST;
818+ vnt_control_in(priv, MESSAGE_TYPE_READ, MAC_REG_RCR,
819+ MESSAGE_REQUEST_MACREG, sizeof(u8), &rx_mode);
821820
822821 dev_dbg(&priv->usb->dev, "rx mode in = %x\n", rx_mode);
823822
@@ -856,8 +855,12 @@ static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, · 32 unmodified lines
856855 case SET_KEY:
857856 return vnt_set_keys(hw, sta, vif, key);
858857 case DISABLE_KEY:
859− if (test_bit(key->hw_key_idx, &priv->key_entry_inuse))
858+ if (test_bit(key->hw_key_idx, &priv->key_entry_inuse)) {
860859 clear_bit(key->hw_key_idx, &priv->key_entry_inuse);
860+
861+ vnt_mac_disable_keyentry(priv, key->hw_key_idx);
862+ }
863+
861864 default:
862865 break;
863866 }
drivers/staging/vt6656/usbpipe.c+2−1
@@ -207,7 +207,8 @@ static void vnt_int_process_data(struct vnt_private *priv) · 206 unmodified lines
207207 priv->wake_up_count =
208208 priv->hw->conf.listen_interval;
209209
210− --priv->wake_up_count;
210+ if (priv->wake_up_count)
211+ --priv->wake_up_count;
211212
212213 /* Turn on wake up to listen next beacon */
213214 if (priv->wake_up_count == 1)
drivers/target/target_core_iblock.c+1−1
@@ -432,7 +432,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) · 431 unmodified lines
432432 target_to_linux_sector(dev, cmd->t_task_lba),
433433 target_to_linux_sector(dev,
434434 sbc_get_write_same_sectors(cmd)),
435− GFP_KERNEL, false);
435+ GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);
436436 if (ret)
437437 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
438438
drivers/thunderbolt/usb4.c+3−0
@@ -182,6 +182,9 @@ static int usb4_switch_op(struct tb_switch *sw, u16 opcode, u8 *status) · 181 unmodified lines
182182 return ret;
183183
184184 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, ROUTER_CS_26, 1);
185+ if (ret)
186+ return ret;
187+
185188 if (val & ROUTER_CS_26_ONS)
186189 return -EOPNOTSUPP;
187190
drivers/tty/hvc/Kconfig+1−1
@@ -88,7 +88,7 @@ config HVC_DCC · 87 unmodified lines
8888
8989 config HVC_RISCV_SBI
9090 bool "RISC-V SBI console support"
91− depends on RISCV_SBI
91+ depends on RISCV_SBI_V01
9292 select HVC_DRIVER
9393 help
9494 This enables support for console output via RISC-V SBI calls, which
drivers/tty/hvc/hvc_console.c+14−9
@@ -302,10 +302,6 @@ int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops) · 301 unmodified lines
302302 vtermnos[index] = vtermno;
303303 cons_ops[index] = ops;
304304
305− /* reserve all indices up to and including this index */
306− if (last_hvc < index)
307− last_hvc = index;
308−
309305 /* check if we need to re-register the kernel console */
310306 hvc_check_console(index);
311307
@@ -960,13 +956,22 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data, · 648 unmodified lines
960956 cons_ops[i] == hp->ops)
961957 break;
962958
963− /* no matching slot, just use a counter */
964− if (i >= MAX_NR_HVC_CONSOLES)
965− i = ++last_hvc;
959+ if (i >= MAX_NR_HVC_CONSOLES) {
960+
961+ /* find 'empty' slot for console */
962+ for (i = 0; i < MAX_NR_HVC_CONSOLES && vtermnos[i] != -1; i++) {
963+ }
964+
965+ /* no matching slot, just use a counter */
966+ if (i == MAX_NR_HVC_CONSOLES)
967+ i = ++last_hvc + MAX_NR_HVC_CONSOLES;
968+ }
966969
967970 hp->index = i;
968− cons_ops[i] = ops;
969− vtermnos[i] = vtermno;
971+ if (i < MAX_NR_HVC_CONSOLES) {
972+ cons_ops[i] = ops;
973+ vtermnos[i] = vtermno;
974+ }
970975
971976 list_add_tail(&(hp->next), &hvc_structs);
972977 mutex_unlock(&hvc_structs_mutex);
drivers/tty/rocket.c+14−11
@@ -632,18 +632,21 @@ init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev) · 631 unmodified lines
632632 tty_port_init(&info->port);
633633 info->port.ops = &rocket_port_ops;
634634 info->flags &= ~ROCKET_MODE_MASK;
635− switch (pc104[board][line]) {
636− case 422:
637− info->flags |= ROCKET_MODE_RS422;
638− break;
639− case 485:
640− info->flags |= ROCKET_MODE_RS485;
641− break;
642− case 232:
643− default:
635+ if (board < ARRAY_SIZE(pc104) && line < ARRAY_SIZE(pc104_1))
636+ switch (pc104[board][line]) {
637+ case 422:
638+ info->flags |= ROCKET_MODE_RS422;
639+ break;
640+ case 485:
641+ info->flags |= ROCKET_MODE_RS485;
642+ break;
643+ case 232:
644+ default:
645+ info->flags |= ROCKET_MODE_RS232;
646+ break;
647+ }
648+ else
644649 info->flags |= ROCKET_MODE_RS232;
645− break;
646− }
647650
648651 info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR;
649652 if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) {
drivers/tty/serial/Kconfig+1−1
@@ -86,7 +86,7 @@ config SERIAL_EARLYCON_ARM_SEMIHOST · 85 unmodified lines
8686
8787 config SERIAL_EARLYCON_RISCV_SBI
8888 bool "Early console using RISC-V SBI"
89− depends on RISCV_SBI
89+ depends on RISCV_SBI_V01
9090 select SERIAL_CORE
9191 select SERIAL_CORE_CONSOLE
9292 select SERIAL_EARLYCON
drivers/tty/serial/owl-uart.c+7−0
@@ -680,6 +680,12 @@ static int owl_uart_probe(struct platform_device *pdev) · 679 unmodified lines
680680 return PTR_ERR(owl_port->clk);
681681 }
682682
683+ ret = clk_prepare_enable(owl_port->clk);
684+ if (ret) {
685+ dev_err(&pdev->dev, "could not enable clk\n");
686+ return ret;
687+ }
688+
683689 owl_port->port.dev = &pdev->dev;
684690 owl_port->port.line = pdev->id;
685691 owl_port->port.type = PORT_OWL;
@@ -712,6 +718,7 @@ static int owl_uart_remove(struct platform_device *pdev) · 26 unmodified lines
712718
713719 uart_remove_one_port(&owl_uart_driver, &owl_port->port);
714720 owl_uart_ports[pdev->id] = NULL;
721+ clk_disable_unprepare(owl_port->clk);
715722
716723 return 0;
717724 }
drivers/tty/serial/sh-sci.c+10−3
@@ -870,9 +870,16 @@ static void sci_receive_chars(struct uart_port *port) · 869 unmodified lines
870870 tty_insert_flip_char(tport, c, TTY_NORMAL);
871871 } else {
872872 for (i = 0; i < count; i++) {
873− char c = serial_port_in(port, SCxRDR);
874−
875− status = serial_port_in(port, SCxSR);
873+ char c;
874+
875+ if (port->type == PORT_SCIF ||
876+ port->type == PORT_HSCIF) {
877+ status = serial_port_in(port, SCxSR);
878+ c = serial_port_in(port, SCxRDR);
879+ } else {
880+ c = serial_port_in(port, SCxRDR);
881+ status = serial_port_in(port, SCxSR);
882+ }
876883 if (uart_handle_sysrq_char(port, c)) {
877884 count--; i--;
878885 continue;
drivers/tty/serial/sunhv.c+3−0
@@ -567,6 +567,9 @@ static int hv_probe(struct platform_device *op) · 566 unmodified lines
567567 sunserial_console_match(&sunhv_console, op->dev.of_node,
568568 &sunhv_reg, port->line, false);
569569
570+ /* We need to initialize lock even for non-registered console */
571+ spin_lock_init(&port->lock);
572+
570573 err = uart_add_one_port(&sunhv_reg, port);
571574 if (err)
572575 goto out_unregister_driver;
drivers/tty/serial/xilinx_uartps.c+50−162
@@ -26,13 +26,15 @@ · 25 unmodified lines
2626
2727 #define CDNS_UART_TTY_NAME "ttyPS"
2828 #define CDNS_UART_NAME "xuartps"
29+#define CDNS_UART_MAJOR 0 /* use dynamic node allocation */
30+#define CDNS_UART_MINOR 0 /* works best with devtmpfs */
31+#define CDNS_UART_NR_PORTS 16
2932 #define CDNS_UART_FIFO_SIZE 64 /* FIFO size */
3033 #define CDNS_UART_REGISTER_SPACE 0x1000
3134 #define TX_TIMEOUT 500000
3235
3336 /* Rx Trigger level */
3437 static int rx_trigger_level = 56;
35−static int uartps_major;
3638 module_param(rx_trigger_level, uint, 0444);
3739 MODULE_PARM_DESC(rx_trigger_level, "Rx trigger level, 1-63 bytes");
3840
@@ -188,7 +190,6 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255"); · 149 unmodified lines
188190 * @pclk: APB clock
189191 * @cdns_uart_driver: Pointer to UART driver
190192 * @baud: Current baud rate
191− * @id: Port ID
192193 * @clk_rate_change_nb: Notifier block for clock changes
193194 * @quirks: Flags for RXBS support.
194195 */
@@ -198,7 +199,6 @@ struct cdns_uart { · 3 unmodified lines
198199 struct clk *pclk;
199200 struct uart_driver *cdns_uart_driver;
200201 unsigned int baud;
201− int id;
202202 struct notifier_block clk_rate_change_nb;
203203 u32 quirks;
204204 bool cts_override;
@@ -1133,6 +1133,8 @@ static const struct uart_ops cdns_uart_ops = { · 928 unmodified lines
11331133 #endif
11341134 };
11351135
1136+static struct uart_driver cdns_uart_uart_driver;
1137+
11361138 #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
11371139 /**
11381140 * cdns_uart_console_putchar - write the character to the FIFO buffer
@@ -1272,6 +1274,16 @@ static int cdns_uart_console_setup(struct console *co, char *options) · 133 unmodified lines
12721274
12731275 return uart_set_options(port, co, baud, parity, bits, flow);
12741276 }
1277+
1278+static struct console cdns_uart_console = {
1279+ .name = CDNS_UART_TTY_NAME,
1280+ .write = cdns_uart_console_write,
1281+ .device = uart_console_device,
1282+ .setup = cdns_uart_console_setup,
1283+ .flags = CON_PRINTBUFFER,
1284+ .index = -1, /* Specified on the cmdline (e.g. console=ttyPS ) */
1285+ .data = &cdns_uart_uart_driver,
1286+};
12751287 #endif /* CONFIG_SERIAL_XILINX_PS_UART_CONSOLE */
12761288
12771289 #ifdef CONFIG_PM_SLEEP
@@ -1403,89 +1415,8 @@ static const struct of_device_id cdns_uart_of_match[] = { · 125 unmodified lines
14031415 };
14041416 MODULE_DEVICE_TABLE(of, cdns_uart_of_match);
14051417
1406−/*
1407− * Maximum number of instances without alias IDs but if there is alias
1408− * which target "< MAX_UART_INSTANCES" range this ID can't be used.
1409− */
1410−#define MAX_UART_INSTANCES 32
1411−
1412−/* Stores static aliases list */
1413−static DECLARE_BITMAP(alias_bitmap, MAX_UART_INSTANCES);
1414−static int alias_bitmap_initialized;
1415−
1416−/* Stores actual bitmap of allocated IDs with alias IDs together */
1417−static DECLARE_BITMAP(bitmap, MAX_UART_INSTANCES);
1418−/* Protect bitmap operations to have unique IDs */
1419−static DEFINE_MUTEX(bitmap_lock);
1420−
1421−static int cdns_get_id(struct platform_device *pdev)
1422−{
1423− int id, ret;
1424−
1425− mutex_lock(&bitmap_lock);
1426−
1427− /* Alias list is stable that's why get alias bitmap only once */
1428− if (!alias_bitmap_initialized) {
1429− ret = of_alias_get_alias_list(cdns_uart_of_match, "serial",
1430− alias_bitmap, MAX_UART_INSTANCES);
1431− if (ret && ret != -EOVERFLOW) {
1432− mutex_unlock(&bitmap_lock);
1433− return ret;
1434− }
1435−
1436− alias_bitmap_initialized++;
1437− }
1438−
1439− /* Make sure that alias ID is not taken by instance without alias */
1440− bitmap_or(bitmap, bitmap, alias_bitmap, MAX_UART_INSTANCES);
1441−
1442− dev_dbg(&pdev->dev, "Alias bitmap: %*pb\n",
1443− MAX_UART_INSTANCES, bitmap);
1444−
1445− /* Look for a serialN alias */
1446− id = of_alias_get_id(pdev->dev.of_node, "serial");
1447− if (id < 0) {
1448− dev_warn(&pdev->dev,
1449− "No serial alias passed. Using the first free id\n");
1450−
1451− /*
1452− * Start with id 0 and check if there is no serial0 alias
1453− * which points to device which is compatible with this driver.
1454− * If alias exists then try next free position.
1455− */
1456− id = 0;
1457−
1458− for (;;) {
1459− dev_info(&pdev->dev, "Checking id %d\n", id);
1460− id = find_next_zero_bit(bitmap, MAX_UART_INSTANCES, id);
1461−
1462− /* No free empty instance */
1463− if (id == MAX_UART_INSTANCES) {
1464− dev_err(&pdev->dev, "No free ID\n");
1465− mutex_unlock(&bitmap_lock);
1466− return -EINVAL;
1467− }
1468−
1469− dev_dbg(&pdev->dev, "The empty id is %d\n", id);
1470− /* Check if ID is empty */
1471− if (!test_and_set_bit(id, bitmap)) {
1472− /* Break the loop if bit is taken */
1473− dev_dbg(&pdev->dev,
1474− "Selected ID %d allocation passed\n",
1475− id);
1476− break;
1477− }
1478− dev_dbg(&pdev->dev,
1479− "Selected ID %d allocation failed\n", id);
1480− /* if taking bit fails then try next one */
1481− id++;
1482− }
1483− }
1484−
1485− mutex_unlock(&bitmap_lock);
1486−
1487− return id;
1488−}
1418+/* Temporary variable for storing number of instances */
1419+static int instances;
14891420
14901421 /**
14911422 * cdns_uart_probe - Platform driver probe
@@ -1495,16 +1426,11 @@ static int cdns_get_id(struct platform_device *pdev) · 3 unmodified lines
14951426 */
14961427 static int cdns_uart_probe(struct platform_device *pdev)
14971428 {
1498− int rc, irq;
1429+ int rc, id, irq;
14991430 struct uart_port *port;
15001431 struct resource *res;
15011432 struct cdns_uart *cdns_uart_data;
15021433 const struct of_device_id *match;
1503− struct uart_driver *cdns_uart_uart_driver;
1504− char *driver_name;
1505−#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
1506− struct console *cdns_uart_console;
1507−#endif
15081434
15091435 cdns_uart_data = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_data),
15101436 GFP_KERNEL);
@@ -1514,64 +1440,36 @@ static int cdns_uart_probe(struct platform_device *pdev) · 3 unmodified lines
15141440 if (!port)
15151441 return -ENOMEM;
15161442
1517− cdns_uart_uart_driver = devm_kzalloc(&pdev->dev,
1518− sizeof(*cdns_uart_uart_driver),
1519− GFP_KERNEL);
1520− if (!cdns_uart_uart_driver)
1521− return -ENOMEM;
1522−
1523− cdns_uart_data->id = cdns_get_id(pdev);
1524− if (cdns_uart_data->id < 0)
1525− return cdns_uart_data->id;
1443+ /* Look for a serialN alias */
1444+ id = of_alias_get_id(pdev->dev.of_node, "serial");
1445+ if (id < 0)
1446+ id = 0;
15261447
1527− /* There is a need to use unique driver name */
1528− driver_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s%d",
1529− CDNS_UART_NAME, cdns_uart_data->id);
1530− if (!driver_name) {
1531− rc = -ENOMEM;
1532− goto err_out_id;
1448+ if (id >= CDNS_UART_NR_PORTS) {
1449+ dev_err(&pdev->dev, "Cannot get uart_port structure\n");
1450+ return -ENODEV;
15331451 }
15341452
1535− cdns_uart_uart_driver->owner = THIS_MODULE;
1536− cdns_uart_uart_driver->driver_name = driver_name;
1537− cdns_uart_uart_driver->dev_name = CDNS_UART_TTY_NAME;
1538− cdns_uart_uart_driver->major = uartps_major;
1539− cdns_uart_uart_driver->minor = cdns_uart_data->id;
1540− cdns_uart_uart_driver->nr = 1;
1541−
1453+ if (!cdns_uart_uart_driver.state) {
1454+ cdns_uart_uart_driver.owner = THIS_MODULE;
1455+ cdns_uart_uart_driver.driver_name = CDNS_UART_NAME;
1456+ cdns_uart_uart_driver.dev_name = CDNS_UART_TTY_NAME;
1457+ cdns_uart_uart_driver.major = CDNS_UART_MAJOR;
1458+ cdns_uart_uart_driver.minor = CDNS_UART_MINOR;
1459+ cdns_uart_uart_driver.nr = CDNS_UART_NR_PORTS;
15421460 #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
1543− cdns_uart_console = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_console),
1544− GFP_KERNEL);
1545− if (!cdns_uart_console) {
1546− rc = -ENOMEM;
1547− goto err_out_id;
1548− }
1549−
1550− strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME,
1551− sizeof(cdns_uart_console->name));
1552− cdns_uart_console->index = cdns_uart_data->id;
1553− cdns_uart_console->write = cdns_uart_console_write;
1554− cdns_uart_console->device = uart_console_device;
1555− cdns_uart_console->setup = cdns_uart_console_setup;
1556− cdns_uart_console->flags = CON_PRINTBUFFER;
1557− cdns_uart_console->data = cdns_uart_uart_driver;
1558− cdns_uart_uart_driver->cons = cdns_uart_console;
1461+ cdns_uart_uart_driver.cons = &cdns_uart_console;
1462+ cdns_uart_console.index = id;
15591463 #endif
15601464
1561− rc = uart_register_driver(cdns_uart_uart_driver);
1562− if (rc < 0) {
1563− dev_err(&pdev->dev, "Failed to register driver\n");
1564− goto err_out_id;
1465+ rc = uart_register_driver(&cdns_uart_uart_driver);
1466+ if (rc < 0) {
1467+ dev_err(&pdev->dev, "Failed to register driver\n");
1468+ return rc;
1469+ }
15651470 }
15661471
1567− cdns_uart_data->cdns_uart_driver = cdns_uart_uart_driver;
1568−
1569− /*
1570− * Setting up proper name_base needs to be done after uart
1571− * registration because tty_driver structure is not filled.
1572− * name_base is 0 by default.
1573− */
1574− cdns_uart_uart_driver->tty_driver->name_base = cdns_uart_data->id;
1472+ cdns_uart_data->cdns_uart_driver = &cdns_uart_uart_driver;
15751473
15761474 match = of_match_node(cdns_uart_of_match, pdev->dev.of_node);
15771475 if (match && match->data) {
@@ -1649,6 +1547,7 @@ static int cdns_uart_probe(struct platform_device *pdev) · 71 unmodified lines
16491547 port->ops = &cdns_uart_ops;
16501548 port->fifosize = CDNS_UART_FIFO_SIZE;
16511549 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_XILINX_PS_UART_CONSOLE);
1550+ port->line = id;
16521551
16531552 /*
16541553 * Register the port.
@@ -1680,7 +1579,7 @@ static int cdns_uart_probe(struct platform_device *pdev) · 25 unmodified lines
16801579 console_port = port;
16811580 #endif
16821581
1683− rc = uart_add_one_port(cdns_uart_uart_driver, port);
1582+ rc = uart_add_one_port(&cdns_uart_uart_driver, port);
16841583 if (rc) {
16851584 dev_err(&pdev->dev,
16861585 "uart_add_one_port() failed; err=%i\n", rc);
@@ -1690,13 +1589,15 @@ static int cdns_uart_probe(struct platform_device *pdev) · 3 unmodified lines
16901589 #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
16911590 /* This is not port which is used for console that's why clean it up */
16921591 if (console_port == port &&
1693− !(cdns_uart_uart_driver->cons->flags & CON_ENABLED))
1592+ !(cdns_uart_uart_driver.cons->flags & CON_ENABLED))
16941593 console_port = NULL;
16951594 #endif
16961595
1697− uartps_major = cdns_uart_uart_driver->tty_driver->major;
16981596 cdns_uart_data->cts_override = of_property_read_bool(pdev->dev.of_node,
16991597 "cts-override");
1598+
1599+ instances++;
1600+
17001601 return 0;
17011602
17021603 err_out_pm_disable:
@@ -1712,12 +1613,8 @@ err_out_clk_disable: · 9 unmodified lines
17121613 err_out_clk_dis_pclk:
17131614 clk_disable_unprepare(cdns_uart_data->pclk);
17141615 err_out_unregister_driver:
1715− uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
1716−err_out_id:
1717− mutex_lock(&bitmap_lock);
1718− if (cdns_uart_data->id < MAX_UART_INSTANCES)
1719− clear_bit(cdns_uart_data->id, bitmap);
1720− mutex_unlock(&bitmap_lock);
1616+ if (!instances)
1617+ uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
17211618 return rc;
17221619 }
17231620
@@ -1740,10 +1637,6 @@ static int cdns_uart_remove(struct platform_device *pdev) · 16 unmodified lines
17401637 #endif
17411638 rc = uart_remove_one_port(cdns_uart_data->cdns_uart_driver, port);
17421639 port->mapbase = 0;
1743− mutex_lock(&bitmap_lock);
1744− if (cdns_uart_data->id < MAX_UART_INSTANCES)
1745− clear_bit(cdns_uart_data->id, bitmap);
1746− mutex_unlock(&bitmap_lock);
17471640 clk_disable_unprepare(cdns_uart_data->uartclk);
17481641 clk_disable_unprepare(cdns_uart_data->pclk);
17491642 pm_runtime_disable(&pdev->dev);
@@ -1756,13 +1649,8 @@ static int cdns_uart_remove(struct platform_device *pdev) · 6 unmodified lines
17561649 console_port = NULL;
17571650 #endif
17581651
1759− /* If this is last instance major number should be initialized */
1760− mutex_lock(&bitmap_lock);
1761− if (bitmap_empty(bitmap, MAX_UART_INSTANCES))
1762− uartps_major = 0;
1763− mutex_unlock(&bitmap_lock);
1764−
1765− uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
1652+ if (!--instances)
1653+ uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
17661654 return rc;
17671655 }
17681656
drivers/tty/sysrq.c+2−0
@@ -74,6 +74,7 @@ int sysrq_mask(void) · 73 unmodified lines
7474 return 1;
7575 return sysrq_enabled;
7676 }
77+EXPORT_SYMBOL_GPL(sysrq_mask);
7778
7879 /*
7980 * A value of 1 means 'all', other nonzero values are an op mask:
@@ -1058,6 +1059,7 @@ int sysrq_toggle_support(int enable_mask) · 978 unmodified lines
10581059
10591060 return 0;
10601061 }
1062+EXPORT_SYMBOL_GPL(sysrq_toggle_support);
10611063
10621064 static int __sysrq_swap_key_ops(int key, struct sysrq_key_op *insert_op_p,
10631065 struct sysrq_key_op *remove_op_p)
drivers/tty/vt/vt.c+10−4
@@ -81,6 +81,7 @@ · 80 unmodified lines
8181 #include <linux/errno.h>
8282 #include <linux/kd.h>
8383 #include <linux/slab.h>
84+#include <linux/vmalloc.h>
8485 #include <linux/major.h>
8586 #include <linux/mm.h>
8687 #include <linux/console.h>
@@ -350,7 +351,7 @@ static struct uni_screen *vc_uniscr_alloc(unsigned int cols, unsigned int rows) · 263 unmodified lines
350351 /* allocate everything in one go */
351352 memsize = cols * rows * sizeof(char32_t);
352353 memsize += rows * sizeof(char32_t *);
353− p = kmalloc(memsize, GFP_KERNEL);
354+ p = vmalloc(memsize);
354355 if (!p)
355356 return NULL;
356357
@@ -364,9 +365,14 @@ static struct uni_screen *vc_uniscr_alloc(unsigned int cols, unsigned int rows) · 7 unmodified lines
364365 return uniscr;
365366 }
366367
368+static void vc_uniscr_free(struct uni_screen *uniscr)
369+{
370+ vfree(uniscr);
371+}
372+
367373 static void vc_uniscr_set(struct vc_data *vc, struct uni_screen *new_uniscr)
368374 {
369− kfree(vc->vc_uni_screen);
375+ vc_uniscr_free(vc->vc_uni_screen);
370376 vc->vc_uni_screen = new_uniscr;
371377 }
372378
@@ -1206,7 +1212,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 833 unmodified lines
12061212 if (new_cols == vc->vc_cols && new_rows == vc->vc_rows)
12071213 return 0;
12081214
1209− if (new_screen_size > (4 << 20))
1215+ if (new_screen_size > KMALLOC_MAX_SIZE)
12101216 return -EINVAL;
12111217 newscreen = kzalloc(new_screen_size, GFP_USER);
12121218 if (!newscreen)
@@ -1229,7 +1235,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 16 unmodified lines
12291235 err = resize_screen(vc, new_cols, new_rows, user);
12301236 if (err) {
12311237 kfree(newscreen);
1232− kfree(new_uniscr);
1238+ vc_uniscr_free(new_uniscr);
12331239 return err;
12341240 }
12351241
drivers/usb/chipidea/ci_hdrc_msm.c+1−1
@@ -114,7 +114,7 @@ static int ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) · 113 unmodified lines
114114 hw_write_id_reg(ci, HS_PHY_GENCONFIG_2,
115115 HS_PHY_ULPI_TX_PKT_EN_CLR_FIX, 0);
116116
117− if (!IS_ERR(ci->platdata->vbus_extcon.edev)) {
117+ if (!IS_ERR(ci->platdata->vbus_extcon.edev) || ci->role_switch) {
118118 hw_write_id_reg(ci, HS_PHY_GENCONFIG_2,
119119 HS_PHY_SESS_VLD_CTRL_EN,
120120 HS_PHY_SESS_VLD_CTRL_EN);
drivers/usb/class/cdc-acm.c+31−5
@@ -412,9 +412,12 @@ static void acm_ctrl_irq(struct urb *urb) · 411 unmodified lines
412412
413413 exit:
414414 retval = usb_submit_urb(urb, GFP_ATOMIC);
415− if (retval && retval != -EPERM)
415+ if (retval && retval != -EPERM && retval != -ENODEV)
416416 dev_err(&acm->control->dev,
417417 "%s - usb_submit_urb failed: %d\n", __func__, retval);
418+ else
419+ dev_vdbg(&acm->control->dev,
420+ "control resubmission terminated %d\n", retval);
418421 }
419422
420423 static int acm_submit_read_urb(struct acm *acm, int index, gfp_t mem_flags)
@@ -430,6 +433,8 @@ static int acm_submit_read_urb(struct acm *acm, int index, gfp_t mem_flags) · 9 unmodified lines
430433 dev_err(&acm->data->dev,
431434 "urb %d failed submission with %d\n",
432435 index, res);
436+ } else {
437+ dev_vdbg(&acm->data->dev, "intended failure %d\n", res);
433438 }
434439 set_bit(index, &acm->read_urbs_free);
435440 return res;
@@ -471,6 +476,7 @@ static void acm_read_bulk_callback(struct urb *urb) · 35 unmodified lines
471476 int status = urb->status;
472477 bool stopped = false;
473478 bool stalled = false;
479+ bool cooldown = false;
474480
475481 dev_vdbg(&acm->data->dev, "got urb %d, len %d, status %d\n",
476482 rb->index, urb->actual_length, status);
@@ -497,6 +503,14 @@ static void acm_read_bulk_callback(struct urb *urb) · 20 unmodified lines
497503 __func__, status);
498504 stopped = true;
499505 break;
506+ case -EOVERFLOW:
507+ case -EPROTO:
508+ dev_dbg(&acm->data->dev,
509+ "%s - cooling babbling device\n", __func__);
510+ usb_mark_last_busy(acm->dev);
511+ set_bit(rb->index, &acm->urbs_in_error_delay);
512+ cooldown = true;
513+ break;
500514 default:
501515 dev_dbg(&acm->data->dev,
502516 "%s - nonzero urb status received: %d\n",
@@ -518,9 +532,11 @@ static void acm_read_bulk_callback(struct urb *urb) · 15 unmodified lines
518532 */
519533 smp_mb__after_atomic();
520534
521− if (stopped || stalled) {
535+ if (stopped || stalled || cooldown) {
522536 if (stalled)
523537 schedule_work(&acm->work);
538+ else if (cooldown)
539+ schedule_delayed_work(&acm->dwork, HZ / 2);
524540 return;
525541 }
526542
@@ -557,14 +573,20 @@ static void acm_softint(struct work_struct *work) · 30 unmodified lines
557573 struct acm *acm = container_of(work, struct acm, work);
558574
559575 if (test_bit(EVENT_RX_STALL, &acm->flags)) {
560− if (!(usb_autopm_get_interface(acm->data))) {
576+ smp_mb(); /* against acm_suspend() */
577+ if (!acm->susp_count) {
561578 for (i = 0; i < acm->rx_buflimit; i++)
562579 usb_kill_urb(acm->read_urbs[i]);
563580 usb_clear_halt(acm->dev, acm->in);
564581 acm_submit_read_urbs(acm, GFP_KERNEL);
565− usb_autopm_put_interface(acm->data);
582+ clear_bit(EVENT_RX_STALL, &acm->flags);
566583 }
567− clear_bit(EVENT_RX_STALL, &acm->flags);
584+ }
585+
586+ if (test_and_clear_bit(ACM_ERROR_DELAY, &acm->flags)) {
587+ for (i = 0; i < ACM_NR; i++)
588+ if (test_and_clear_bit(i, &acm->urbs_in_error_delay))
589+ acm_submit_read_urb(acm, i, GFP_NOIO);
568590 }
569591
570592 if (test_and_clear_bit(EVENT_TTY_WAKEUP, &acm->flags))
@@ -1333,6 +1355,7 @@ made_compressed_probe: · 762 unmodified lines
13331355 acm->readsize = readsize;
13341356 acm->rx_buflimit = num_rx_buf;
13351357 INIT_WORK(&acm->work, acm_softint);
1358+ INIT_DELAYED_WORK(&acm->dwork, acm_softint);
13361359 init_waitqueue_head(&acm->wioctl);
13371360 spin_lock_init(&acm->write_lock);
13381361 spin_lock_init(&acm->read_lock);
@@ -1542,6 +1565,7 @@ static void acm_disconnect(struct usb_interface *intf) · 203 unmodified lines
15421565
15431566 acm_kill_urbs(acm);
15441567 cancel_work_sync(&acm->work);
1568+ cancel_delayed_work_sync(&acm->dwork);
15451569
15461570 tty_unregister_device(acm_tty_driver, acm->minor);
15471571
@@ -1584,6 +1608,8 @@ static int acm_suspend(struct usb_interface *intf, pm_message_t message) · 36 unmodified lines
15841608
15851609 acm_kill_urbs(acm);
15861610 cancel_work_sync(&acm->work);
1611+ cancel_delayed_work_sync(&acm->dwork);
1612+ acm->urbs_in_error_delay = 0;
15871613
15881614 return 0;
15891615 }
drivers/usb/class/cdc-acm.h+4−1
@@ -109,8 +109,11 @@ struct acm { · 108 unmodified lines
109109 # define EVENT_TTY_WAKEUP 0
110110 # define EVENT_RX_STALL 1
111111 # define ACM_THROTTLED 2
112+# define ACM_ERROR_DELAY 3
113+ unsigned long urbs_in_error_delay; /* these need to be restarted after a delay */
112114 struct usb_cdc_line_coding line; /* bits, stop, parity */
113− struct work_struct work; /* work queue entry for line discipline waking up */
115+ struct work_struct work; /* work queue entry for various purposes*/
116+ struct delayed_work dwork; /* for cool downs needed in error recovery */
114117 unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */
115118 unsigned int ctrlout; /* output control lines (DTR, RTS) */
116119 struct async_icount iocount; /* counters for control line changes */
drivers/usb/core/devio.c+2−3
@@ -217,6 +217,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) · 216 unmodified lines
217217 {
218218 struct usb_memory *usbm = NULL;
219219 struct usb_dev_state *ps = file->private_data;
220+ struct usb_hcd *hcd = bus_to_hcd(ps->dev->bus);
220221 size_t size = vma->vm_end - vma->vm_start;
221222 void *mem;
222223 unsigned long flags;
@@ -250,9 +251,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) · 27 unmodified lines
250251 usbm->vma_use_count = 1;
251252 INIT_LIST_HEAD(&usbm->memlist);
252253
253− if (remap_pfn_range(vma, vma->vm_start,
254− virt_to_phys(usbm->mem) >> PAGE_SHIFT,
255− size, vma->vm_page_prot) < 0) {
254+ if (dma_mmap_coherent(hcd->self.sysdev, vma, mem, dma_handle, size)) {
256255 dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
257256 return -EAGAIN;
258257 }
drivers/usb/core/hub.c+15−3
@@ -1223,6 +1223,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) · 1222 unmodified lines
12231223 #ifdef CONFIG_PM
12241224 udev->reset_resume = 1;
12251225 #endif
1226+ /* Don't set the change_bits when the device
1227+ * was powered off.
1228+ */
1229+ if (test_bit(port1, hub->power_bits))
1230+ set_bit(port1, hub->change_bits);
12261231
12271232 } else {
12281233 /* The power session is gone; tell hub_wq */
@@ -2723,13 +2728,11 @@ static bool use_new_scheme(struct usb_device *udev, int retry, · 1494 unmodified lines
27232728 {
27242729 int old_scheme_first_port =
27252730 port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
2726− int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
27272731
27282732 if (udev->speed >= USB_SPEED_SUPER)
27292733 return false;
27302734
2731− return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first
2732− || quick_enumeration);
2735+ return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first);
27332736 }
27342737
27352738 /* Is a USB 3.0 port in the Inactive or Compliance Mode state?
@@ -3088,6 +3091,15 @@ static int check_port_resume_type(struct usb_device *udev, · 352 unmodified lines
30883091 if (portchange & USB_PORT_STAT_C_ENABLE)
30893092 usb_clear_port_feature(hub->hdev, port1,
30903093 USB_PORT_FEAT_C_ENABLE);
3094+
3095+ /*
3096+ * Whatever made this reset-resume necessary may have
3097+ * turned on the port1 bit in hub->change_bits. But after
3098+ * a successful reset-resume we want the bit to be clear;
3099+ * if it was on it would indicate that something happened
3100+ * following the reset-resume.
3101+ */
3102+ clear_bit(port1, hub->change_bits);
30913103 }
30923104
30933105 return status;
drivers/usb/core/message.c+10−3
@@ -589,12 +589,13 @@ void usb_sg_cancel(struct usb_sg_request *io) · 588 unmodified lines
589589 int i, retval;
590590
591591 spin_lock_irqsave(&io->lock, flags);
592− if (io->status) {
592+ if (io->status || io->count == 0) {
593593 spin_unlock_irqrestore(&io->lock, flags);
594594 return;
595595 }
596596 /* shut everything down */
597597 io->status = -ECONNRESET;
598+ io->count++; /* Keep the request alive until we're done */
598599 spin_unlock_irqrestore(&io->lock, flags);
599600
600601 for (i = io->entries - 1; i >= 0; --i) {
@@ -608,6 +609,12 @@ void usb_sg_cancel(struct usb_sg_request *io) · 7 unmodified lines
608609 dev_warn(&io->dev->dev, "%s, unlink --> %d\n",
609610 __func__, retval);
610611 }
612+
613+ spin_lock_irqsave(&io->lock, flags);
614+ io->count--;
615+ if (!io->count)
616+ complete(&io->complete);
617+ spin_unlock_irqrestore(&io->lock, flags);
611618 }
612619 EXPORT_SYMBOL_GPL(usb_sg_cancel);
613620
@@ -1137,11 +1144,11 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr, · 523 unmodified lines
11371144
11381145 if (usb_endpoint_out(epaddr)) {
11391146 ep = dev->ep_out[epnum];
1140− if (reset_hardware)
1147+ if (reset_hardware && epnum != 0)
11411148 dev->ep_out[epnum] = NULL;
11421149 } else {
11431150 ep = dev->ep_in[epnum];
1144− if (reset_hardware)
1151+ if (reset_hardware && epnum != 0)
11451152 dev->ep_in[epnum] = NULL;
11461153 }
11471154 if (ep) {
drivers/usb/core/quirks.c+4−0
@@ -430,6 +430,10 @@ static const struct usb_device_id usb_quirk_list[] = { · 429 unmodified lines
430430 /* Corsair K70 LUX */
431431 { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
432432
433+ /* Corsair K70 RGB RAPDIFIRE */
434+ { USB_DEVICE(0x1b1c, 0x1b38), .driver_info = USB_QUIRK_DELAY_INIT |
435+ USB_QUIRK_DELAY_CTRL_MSG },
436+
433437 /* MIDI keyboard WORLDE MINI */
434438 { USB_DEVICE(0x1c75, 0x0204), .driver_info =
435439 USB_QUIRK_CONFIG_INTF_STRINGS },
drivers/usb/dwc3/core.h+6−2
@@ -307,10 +307,14 @@ · 306 unmodified lines
307307
308308 /* Global TX Fifo Size Register */
309309 #define DWC31_GTXFIFOSIZ_TXFRAMNUM BIT(15) /* DWC_usb31 only */
310−#define DWC31_GTXFIFOSIZ_TXFDEF(n) ((n) & 0x7fff) /* DWC_usb31 only */
311−#define DWC3_GTXFIFOSIZ_TXFDEF(n) ((n) & 0xffff)
310+#define DWC31_GTXFIFOSIZ_TXFDEP(n) ((n) & 0x7fff) /* DWC_usb31 only */
311+#define DWC3_GTXFIFOSIZ_TXFDEP(n) ((n) & 0xffff)
312312 #define DWC3_GTXFIFOSIZ_TXFSTADDR(n) ((n) & 0xffff0000)
313313
314+/* Global RX Fifo Size Register */
315+#define DWC31_GRXFIFOSIZ_RXFDEP(n) ((n) & 0x7fff) /* DWC_usb31 only */
316+#define DWC3_GRXFIFOSIZ_RXFDEP(n) ((n) & 0xffff)
317+
314318 /* Global Event Size Registers */
315319 #define DWC3_GEVNTSIZ_INTMASK BIT(31)
316320 #define DWC3_GEVNTSIZ_SIZE(n) ((n) & 0xffff)
drivers/usb/dwc3/gadget.c+47−29
@@ -1728,7 +1728,6 @@ static int __dwc3_gadget_wakeup(struct dwc3 *dwc) · 1727 unmodified lines
17281728 u32 reg;
17291729
17301730 u8 link_state;
1731− u8 speed;
17321731
17331732 /*
17341733 * According to the Databook Remote wakeup request should
@@ -1738,16 +1737,13 @@ static int __dwc3_gadget_wakeup(struct dwc3 *dwc) · 3 unmodified lines
17381737 */
17391738 reg = dwc3_readl(dwc->regs, DWC3_DSTS);
17401739
1741− speed = reg & DWC3_DSTS_CONNECTSPD;
1742− if ((speed == DWC3_DSTS_SUPERSPEED) ||
1743− (speed == DWC3_DSTS_SUPERSPEED_PLUS))
1744− return 0;
1745−
17461740 link_state = DWC3_DSTS_USBLNKST(reg);
17471741
17481742 switch (link_state) {
1743+ case DWC3_LINK_STATE_RESET:
17491744 case DWC3_LINK_STATE_RX_DET: /* in HS, means Early Suspend */
17501745 case DWC3_LINK_STATE_U3: /* in HS, means SUSPEND */
1746+ case DWC3_LINK_STATE_RESUME:
17511747 break;
17521748 default:
17531749 return -EINVAL;
@@ -2227,7 +2223,6 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) · 473 unmodified lines
22272223 {
22282224 struct dwc3 *dwc = dep->dwc;
22292225 int mdwidth;
2230− int kbytes;
22312226 int size;
22322227
22332228 mdwidth = DWC3_MDWIDTH(dwc->hwparams.hwparams0);
@@ -2236,24 +2231,24 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) · 2 unmodified lines
22362231
22372232 size = dwc3_readl(dwc->regs, DWC3_GTXFIFOSIZ(dep->number >> 1));
22382233 if (dwc3_is_usb31(dwc))
2239− size = DWC31_GTXFIFOSIZ_TXFDEF(size);
2234+ size = DWC31_GTXFIFOSIZ_TXFDEP(size);
22402235 else
2241− size = DWC3_GTXFIFOSIZ_TXFDEF(size);
2236+ size = DWC3_GTXFIFOSIZ_TXFDEP(size);
22422237
22432238 /* FIFO Depth is in MDWDITH bytes. Multiply */
22442239 size *= mdwidth;
22452240
2246− kbytes = size / 1024;
2247− if (kbytes == 0)
2248− kbytes = 1;
2249−
22502241 /*
2251− * FIFO sizes account an extra MDWIDTH * (kbytes + 1) bytes for
2252− * internal overhead. We don't really know how these are used,
2253− * but documentation say it exists.
2242+ * To meet performance requirement, a minimum TxFIFO size of 3x
2243+ * MaxPacketSize is recommended for endpoints that support burst and a
2244+ * minimum TxFIFO size of 2x MaxPacketSize for endpoints that don't
2245+ * support burst. Use those numbers and we can calculate the max packet
2246+ * limit as below.
22542247 */
2255− size -= mdwidth * (kbytes + 1);
2256− size /= kbytes;
2248+ if (dwc->maximum_speed >= USB_SPEED_SUPER)
2249+ size /= 3;
2250+ else
2251+ size /= 2;
22572252
22582253 usb_ep_set_maxpacket_limit(&dep->endpoint, size);
22592254
@@ -2271,8 +2266,39 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) · 11 unmodified lines
22712266 static int dwc3_gadget_init_out_endpoint(struct dwc3_ep *dep)
22722267 {
22732268 struct dwc3 *dwc = dep->dwc;
2269+ int mdwidth;
2270+ int size;
2271+
2272+ mdwidth = DWC3_MDWIDTH(dwc->hwparams.hwparams0);
22742273
2275− usb_ep_set_maxpacket_limit(&dep->endpoint, 1024);
2274+ /* MDWIDTH is represented in bits, convert to bytes */
2275+ mdwidth /= 8;
2276+
2277+ /* All OUT endpoints share a single RxFIFO space */
2278+ size = dwc3_readl(dwc->regs, DWC3_GRXFIFOSIZ(0));
2279+ if (dwc3_is_usb31(dwc))
2280+ size = DWC31_GRXFIFOSIZ_RXFDEP(size);
2281+ else
2282+ size = DWC3_GRXFIFOSIZ_RXFDEP(size);
2283+
2284+ /* FIFO depth is in MDWDITH bytes */
2285+ size *= mdwidth;
2286+
2287+ /*
2288+ * To meet performance requirement, a minimum recommended RxFIFO size
2289+ * is defined as follow:
2290+ * RxFIFO size >= (3 x MaxPacketSize) +
2291+ * (3 x 8 bytes setup packets size) + (16 bytes clock crossing margin)
2292+ *
2293+ * Then calculate the max packet limit as below.
2294+ */
2295+ size -= (3 * 8) + 16;
2296+ if (size < 0)
2297+ size = 0;
2298+ else
2299+ size /= 3;
2300+
2301+ usb_ep_set_maxpacket_limit(&dep->endpoint, size);
22762302 dep->endpoint.max_streams = 15;
22772303 dep->endpoint.ops = &dwc3_gadget_ep_ops;
22782304 list_add_tail(&dep->endpoint.ep_list,
@@ -2484,14 +2510,7 @@ static int dwc3_gadget_ep_reclaim_trb_linear(struct dwc3_ep *dep, · 205 unmodified lines
24842510
24852511 static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req)
24862512 {
2487− /*
2488− * For OUT direction, host may send less than the setup
2489− * length. Return true for all OUT requests.
2490− */
2491− if (!req->direction)
2492− return true;
2493−
2494− return req->request.actual == req->request.length;
2513+ return req->num_pending_sgs == 0;
24952514 }
24962515
24972516 static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
@@ -2515,8 +2534,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, · 17 unmodified lines
25152534
25162535 req->request.actual = req->request.length - req->remaining;
25172536
2518− if (!dwc3_gadget_ep_request_completed(req) ||
2519− req->num_pending_sgs) {
2537+ if (!dwc3_gadget_ep_request_completed(req)) {
25202538 __dwc3_gadget_kick_transfer(dep);
25212539 goto out;
25222540 }
drivers/usb/early/xhci-dbc.c+4−4
@@ -728,19 +728,19 @@ static void xdbc_handle_tx_event(struct xdbc_trb *evt_trb) · 727 unmodified lines
728728 case COMP_USB_TRANSACTION_ERROR:
729729 case COMP_STALL_ERROR:
730730 default:
731− if (ep_id == XDBC_EPID_OUT)
731+ if (ep_id == XDBC_EPID_OUT || ep_id == XDBC_EPID_OUT_INTEL)
732732 xdbc.flags |= XDBC_FLAGS_OUT_STALL;
733− if (ep_id == XDBC_EPID_IN)
733+ if (ep_id == XDBC_EPID_IN || ep_id == XDBC_EPID_IN_INTEL)
734734 xdbc.flags |= XDBC_FLAGS_IN_STALL;
735735
736736 xdbc_trace("endpoint %d stalled\n", ep_id);
737737 break;
738738 }
739739
740− if (ep_id == XDBC_EPID_IN) {
740+ if (ep_id == XDBC_EPID_IN || ep_id == XDBC_EPID_IN_INTEL) {
741741 xdbc.flags &= ~XDBC_FLAGS_IN_PROCESS;
742742 xdbc_bulk_transfer(NULL, XDBC_MAX_PACKET, true);
743− } else if (ep_id == XDBC_EPID_OUT) {
743+ } else if (ep_id == XDBC_EPID_OUT || ep_id == XDBC_EPID_OUT_INTEL) {
744744 xdbc.flags &= ~XDBC_FLAGS_OUT_PROCESS;
745745 } else {
746746 xdbc_trace("invalid endpoint id %d\n", ep_id);
drivers/usb/early/xhci-dbc.h+16−2
@@ -120,8 +120,22 @@ struct xdbc_ring { · 119 unmodified lines
120120 u32 cycle_state;
121121 };
122122
123−#define XDBC_EPID_OUT 2
124−#define XDBC_EPID_IN 3
123+/*
124+ * These are the "Endpoint ID" (also known as "Context Index") values for the
125+ * OUT Transfer Ring and the IN Transfer Ring of a Debug Capability Context data
126+ * structure.
127+ * According to the "eXtensible Host Controller Interface for Universal Serial
128+ * Bus (xHCI)" specification, section "7.6.3.2 Endpoint Contexts and Transfer
129+ * Rings", these should be 0 and 1, and those are the values AMD machines give
130+ * you; but Intel machines seem to use the formula from section "4.5.1 Device
131+ * Context Index", which is supposed to be used for the Device Context only.
132+ * Luckily the values from Intel don't overlap with those from AMD, so we can
133+ * just test for both.
134+ */
135+#define XDBC_EPID_OUT 0
136+#define XDBC_EPID_IN 1
137+#define XDBC_EPID_OUT_INTEL 2
138+#define XDBC_EPID_IN_INTEL 3
125139
126140 struct xdbc_state {
127141 u16 vendor;
drivers/usb/gadget/function/f_fs.c+4−0
@@ -1813,6 +1813,10 @@ static void ffs_data_reset(struct ffs_data *ffs) · 1812 unmodified lines
18131813 ffs->state = FFS_READ_DESCRIPTORS;
18141814 ffs->setup_state = FFS_NO_SETUP;
18151815 ffs->flags = 0;
1816+
1817+ ffs->ms_os_descs_ext_prop_count = 0;
1818+ ffs->ms_os_descs_ext_prop_name_len = 0;
1819+ ffs->ms_os_descs_ext_prop_data_len = 0;
18161820 }
18171821
18181822
drivers/usb/gadget/legacy/raw_gadget.c+42−29
@@ -81,6 +81,7 @@ static int raw_event_queue_add(struct raw_event_queue *queue, · 80 unmodified lines
8181 static struct usb_raw_event *raw_event_queue_fetch(
8282 struct raw_event_queue *queue)
8383 {
84+ int ret;
8485 unsigned long flags;
8586 struct usb_raw_event *event;
8687
@@ -89,11 +90,18 @@ static struct usb_raw_event *raw_event_queue_fetch( · 2 unmodified lines
8990 * there's at least one event queued by decrementing the semaphore,
9091 * and then take the lock to protect queue struct fields.
9192 */
92− if (down_interruptible(&queue->sema))
93− return NULL;
93+ ret = down_interruptible(&queue->sema);
94+ if (ret)
95+ return ERR_PTR(ret);
9496 spin_lock_irqsave(&queue->lock, flags);
95− if (WARN_ON(!queue->size))
96− return NULL;
97+ /*
98+ * queue->size must have the same value as queue->sema counter (before
99+ * the down_interruptible() call above), so this check is a fail-safe.
100+ */
101+ if (WARN_ON(!queue->size)) {
102+ spin_unlock_irqrestore(&queue->lock, flags);
103+ return ERR_PTR(-ENODEV);
104+ }
97105 event = queue->events[0];
98106 queue->size--;
99107 memmove(&queue->events[0], &queue->events[1],
@@ -392,9 +400,8 @@ static int raw_ioctl_init(struct raw_dev *dev, unsigned long value) · 292 unmodified lines
392400 char *udc_device_name;
393401 unsigned long flags;
394402
395− ret = copy_from_user(&arg, (void __user *)value, sizeof(arg));
396− if (ret)
397− return ret;
403+ if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
404+ return -EFAULT;
398405
399406 switch (arg.speed) {
400407 case USB_SPEED_UNKNOWN:
@@ -501,15 +508,13 @@ out_unlock: · 100 unmodified lines
501508
502509 static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
503510 {
504− int ret = 0;
505511 struct usb_raw_event arg;
506512 unsigned long flags;
507513 struct usb_raw_event *event;
508514 uint32_t length;
509515
510− ret = copy_from_user(&arg, (void __user *)value, sizeof(arg));
511− if (ret)
512− return ret;
516+ if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
517+ return -EFAULT;
513518
514519 spin_lock_irqsave(&dev->lock, flags);
515520 if (dev->state != STATE_DEV_RUNNING) {
@@ -525,25 +530,31 @@ static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value) · 9 unmodified lines
525530 spin_unlock_irqrestore(&dev->lock, flags);
526531
527532 event = raw_event_queue_fetch(&dev->queue);
528− if (!event) {
533+ if (PTR_ERR(event) == -EINTR) {
529534 dev_dbg(&dev->gadget->dev, "event fetching interrupted\n");
530535 return -EINTR;
531536 }
537+ if (IS_ERR(event)) {
538+ dev_err(&dev->gadget->dev, "failed to fetch event\n");
539+ spin_lock_irqsave(&dev->lock, flags);
540+ dev->state = STATE_DEV_FAILED;
541+ spin_unlock_irqrestore(&dev->lock, flags);
542+ return -ENODEV;
543+ }
532544 length = min(arg.length, event->length);
533− ret = copy_to_user((void __user *)value, event,
534− sizeof(*event) + length);
535− return ret;
545+ if (copy_to_user((void __user *)value, event, sizeof(*event) + length))
546+ return -EFAULT;
547+
548+ return 0;
536549 }
537550
538551 static void *raw_alloc_io_data(struct usb_raw_ep_io *io, void __user *ptr,
539552 bool get_from_user)
540553 {
541− int ret;
542554 void *data;
543555
544− ret = copy_from_user(io, ptr, sizeof(*io));
545− if (ret)
546− return ERR_PTR(ret);
556+ if (copy_from_user(io, ptr, sizeof(*io)))
557+ return ERR_PTR(-EFAULT);
547558 if (io->ep >= USB_RAW_MAX_ENDPOINTS)
548559 return ERR_PTR(-EINVAL);
549560 if (!usb_raw_io_flags_valid(io->flags))
@@ -658,12 +669,13 @@ static int raw_ioctl_ep0_read(struct raw_dev *dev, unsigned long value) · 108 unmodified lines
658669 if (IS_ERR(data))
659670 return PTR_ERR(data);
660671 ret = raw_process_ep0_io(dev, &io, data, false);
661− if (ret < 0) {
662− kfree(data);
663− return ret;
664− }
672+ if (ret)
673+ goto free;
674+
665675 length = min(io.length, (unsigned int)ret);
666− ret = copy_to_user((void __user *)(value + sizeof(io)), data, length);
676+ if (copy_to_user((void __user *)(value + sizeof(io)), data, length))
677+ ret = -EFAULT;
678+free:
667679 kfree(data);
668680 return ret;
669681 }
@@ -952,12 +964,13 @@ static int raw_ioctl_ep_read(struct raw_dev *dev, unsigned long value) · 282 unmodified lines
952964 if (IS_ERR(data))
953965 return PTR_ERR(data);
954966 ret = raw_process_ep_io(dev, &io, data, false);
955− if (ret < 0) {
956− kfree(data);
957− return ret;
958− }
967+ if (ret)
968+ goto free;
969+
959970 length = min(io.length, (unsigned int)ret);
960− ret = copy_to_user((void __user *)(value + sizeof(io)), data, length);
971+ if (copy_to_user((void __user *)(value + sizeof(io)), data, length))
972+ ret = -EFAULT;
973+free:
961974 kfree(data);
962975 return ret;
963976 }
drivers/usb/gadget/udc/atmel_usba_udc.c+2−2
@@ -1951,10 +1951,10 @@ static irqreturn_t usba_vbus_irq_thread(int irq, void *devid) · 1950 unmodified lines
19511951 usba_start(udc);
19521952 } else {
19531953 udc->suspended = false;
1954− usba_stop(udc);
1955−
19561954 if (udc->driver->disconnect)
19571955 udc->driver->disconnect(&udc->gadget);
1956+
1957+ usba_stop(udc);
19581958 }
19591959 udc->vbus_prev = vbus;
19601960 }
drivers/usb/gadget/udc/bdc/bdc_ep.c+1−1
@@ -540,7 +540,7 @@ static void bdc_req_complete(struct bdc_ep *ep, struct bdc_req *req, · 539 unmodified lines
540540 {
541541 struct bdc *bdc = ep->bdc;
542542
543− if (req == NULL || &req->queue == NULL || &req->usb_req == NULL)
543+ if (req == NULL)
544544 return;
545545
546546 dev_dbg(bdc->dev, "%s ep:%s status:%d\n", __func__, ep->name, status);
drivers/usb/host/xhci-hub.c+9−0
@@ -1571,6 +1571,8 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) · 1570 unmodified lines
15711571 }
15721572 if ((temp & PORT_RC))
15731573 reset_change = true;
1574+ if (temp & PORT_OC)
1575+ status = 1;
15741576 }
15751577 if (!status && !reset_change) {
15761578 xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
@@ -1636,6 +1638,13 @@ retry: · 59 unmodified lines
16361638 port_index);
16371639 goto retry;
16381640 }
1641+ /* bail out if port detected a over-current condition */
1642+ if (t1 & PORT_OC) {
1643+ bus_state->bus_suspended = 0;
1644+ spin_unlock_irqrestore(&xhci->lock, flags);
1645+ xhci_dbg(xhci, "Bus suspend bailout, port over-current detected\n");
1646+ return -EBUSY;
1647+ }
16391648 /* suspend ports in U0, or bail out for new connect changes */
16401649 if ((t1 & PORT_PE) && (t1 & PORT_PLS_MASK) == XDEV_U0) {
16411650 if ((t1 & PORT_CSC) && wake_enabled) {
drivers/usb/host/xhci-ring.c+40−6
@@ -547,6 +547,23 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, · 546 unmodified lines
547547 stream_id);
548548 return;
549549 }
550+ /*
551+ * A cancelled TD can complete with a stall if HW cached the trb.
552+ * In this case driver can't find cur_td, but if the ring is empty we
553+ * can move the dequeue pointer to the current enqueue position.
554+ */
555+ if (!cur_td) {
556+ if (list_empty(&ep_ring->td_list)) {
557+ state->new_deq_seg = ep_ring->enq_seg;
558+ state->new_deq_ptr = ep_ring->enqueue;
559+ state->new_cycle_state = ep_ring->cycle_state;
560+ goto done;
561+ } else {
562+ xhci_warn(xhci, "Can't find new dequeue state, missing cur_td\n");
563+ return;
564+ }
565+ }
566+
550567 /* Dig out the cycle state saved by the xHC during the stop ep cmd */
551568 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
552569 "Finding endpoint context");
@@ -592,6 +609,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, · 39 unmodified lines
592609 state->new_deq_seg = new_seg;
593610 state->new_deq_ptr = new_deq;
594611
612+done:
595613 /* Don't update the ring cycle state for the producer (us). */
596614 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
597615 "Cycle state = 0x%x", state->new_cycle_state);
@@ -1856,8 +1874,8 @@ static void xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, · 1258 unmodified lines
18561874
18571875 if (reset_type == EP_HARD_RESET) {
18581876 ep->ep_state |= EP_HARD_CLEAR_TOGGLE;
1859− xhci_cleanup_stalled_ring(xhci, ep_index, stream_id, td);
1860− xhci_clear_hub_tt_buffer(xhci, td, ep);
1877+ xhci_cleanup_stalled_ring(xhci, slot_id, ep_index, stream_id,
1878+ td);
18611879 }
18621880 xhci_ring_cmd_db(xhci);
18631881 }
@@ -1978,11 +1996,18 @@ static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td, · 114 unmodified lines
19781996 if (trb_comp_code == COMP_STALL_ERROR ||
19791997 xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
19801998 trb_comp_code)) {
1981− /* Issue a reset endpoint command to clear the host side
1982− * halt, followed by a set dequeue command to move the
1983− * dequeue pointer past the TD.
1984− * The class driver clears the device side halt later.
1999+ /*
2000+ * xhci internal endpoint state will go to a "halt" state for
2001+ * any stall, including default control pipe protocol stall.
2002+ * To clear the host side halt we need to issue a reset endpoint
2003+ * command, followed by a set dequeue command to move past the
2004+ * TD.
2005+ * Class drivers clear the device side halt from a functional
2006+ * stall later. Hub TT buffer should only be cleared for FS/LS
2007+ * devices behind HS hubs for functional stalls.
19852008 */
2009+ if ((ep_index != 0) || (trb_comp_code != COMP_STALL_ERROR))
2010+ xhci_clear_hub_tt_buffer(xhci, td, ep);
19862011 xhci_cleanup_halted_endpoint(xhci, slot_id, ep_index,
19872012 ep_ring->stream_id, td, EP_HARD_RESET);
19882013 } else {
@@ -2539,6 +2564,15 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 550 unmodified lines
25392564 xhci_dbg(xhci, "td_list is empty while skip flag set. Clear skip flag for slot %u ep %u.\n",
25402565 slot_id, ep_index);
25412566 }
2567+ if (trb_comp_code == COMP_STALL_ERROR ||
2568+ xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
2569+ trb_comp_code)) {
2570+ xhci_cleanup_halted_endpoint(xhci, slot_id,
2571+ ep_index,
2572+ ep_ring->stream_id,
2573+ NULL,
2574+ EP_HARD_RESET);
2575+ }
25422576 goto cleanup;
25432577 }
25442578
drivers/usb/host/xhci.c+7−7
@@ -3031,19 +3031,19 @@ static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, · 3030 unmodified lines
30313031 added_ctxs, added_ctxs);
30323032 }
30333033
3034−void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index,
3035− unsigned int stream_id, struct xhci_td *td)
3034+void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int slot_id,
3035+ unsigned int ep_index, unsigned int stream_id,
3036+ struct xhci_td *td)
30363037 {
30373038 struct xhci_dequeue_state deq_state;
3038− struct usb_device *udev = td->urb->dev;
30393039
30403040 xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
30413041 "Cleaning up stalled endpoint ring");
30423042 /* We need to move the HW's dequeue pointer past this TD,
30433043 * or it will attempt to resend it on the next doorbell ring.
30443044 */
3045− xhci_find_new_dequeue_state(xhci, udev->slot_id,
3046− ep_index, stream_id, td, &deq_state);
3045+ xhci_find_new_dequeue_state(xhci, slot_id, ep_index, stream_id, td,
3046+ &deq_state);
30473047
30483048 if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg)
30493049 return;
@@ -3054,7 +3054,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index, · 4 unmodified lines
30543054 if (!(xhci->quirks & XHCI_RESET_EP_QUIRK)) {
30553055 xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
30563056 "Queueing new dequeue state");
3057− xhci_queue_new_dequeue_state(xhci, udev->slot_id,
3057+ xhci_queue_new_dequeue_state(xhci, slot_id,
30583058 ep_index, &deq_state);
30593059 } else {
30603060 /* Better hope no one uses the input context between now and the
@@ -3065,7 +3065,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index, · 4 unmodified lines
30653065 xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
30663066 "Setting up input context for "
30673067 "configure endpoint command");
3068− xhci_setup_input_ctx_for_quirk(xhci, udev->slot_id,
3068+ xhci_setup_input_ctx_for_quirk(xhci, slot_id,
30693069 ep_index, &deq_state);
30703070 }
30713071 }
drivers/usb/host/xhci.h+3−2
@@ -2116,8 +2116,9 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, · 2115 unmodified lines
21162116 void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
21172117 unsigned int slot_id, unsigned int ep_index,
21182118 struct xhci_dequeue_state *deq_state);
2119−void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index,
2120− unsigned int stream_id, struct xhci_td *td);
2119+void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int slot_id,
2120+ unsigned int ep_index, unsigned int stream_id,
2121+ struct xhci_td *td);
21212122 void xhci_stop_endpoint_command_watchdog(struct timer_list *t);
21222123 void xhci_handle_command_timeout(struct work_struct *work);
21232124
drivers/usb/misc/sisusbvga/sisusb.c+10−10
@@ -1199,18 +1199,18 @@ static int sisusb_read_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, · 1198 unmodified lines
11991199 /* High level: Gfx (indexed) register access */
12001200
12011201 #ifdef CONFIG_USB_SISUSBVGA_CON
1202−int sisusb_setreg(struct sisusb_usb_data *sisusb, int port, u8 data)
1202+int sisusb_setreg(struct sisusb_usb_data *sisusb, u32 port, u8 data)
12031203 {
12041204 return sisusb_write_memio_byte(sisusb, SISUSB_TYPE_IO, port, data);
12051205 }
12061206
1207−int sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data)
1207+int sisusb_getreg(struct sisusb_usb_data *sisusb, u32 port, u8 *data)
12081208 {
12091209 return sisusb_read_memio_byte(sisusb, SISUSB_TYPE_IO, port, data);
12101210 }
12111211 #endif
12121212
1213−int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port,
1213+int sisusb_setidxreg(struct sisusb_usb_data *sisusb, u32 port,
12141214 u8 index, u8 data)
12151215 {
12161216 int ret;
@@ -1220,7 +1220,7 @@ int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, · 3 unmodified lines
12201220 return ret;
12211221 }
12221222
1223−int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port,
1223+int sisusb_getidxreg(struct sisusb_usb_data *sisusb, u32 port,
12241224 u8 index, u8 *data)
12251225 {
12261226 int ret;
@@ -1230,7 +1230,7 @@ int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, · 3 unmodified lines
12301230 return ret;
12311231 }
12321232
1233−int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx,
1233+int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, u32 port, u8 idx,
12341234 u8 myand, u8 myor)
12351235 {
12361236 int ret;
@@ -1245,7 +1245,7 @@ int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, · 8 unmodified lines
12451245 }
12461246
12471247 static int sisusb_setidxregmask(struct sisusb_usb_data *sisusb,
1248− int port, u8 idx, u8 data, u8 mask)
1248+ u32 port, u8 idx, u8 data, u8 mask)
12491249 {
12501250 int ret;
12511251 u8 tmp;
@@ -1258,13 +1258,13 @@ static int sisusb_setidxregmask(struct sisusb_usb_data *sisusb, · 6 unmodified lines
12581258 return ret;
12591259 }
12601260
1261−int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port,
1261+int sisusb_setidxregor(struct sisusb_usb_data *sisusb, u32 port,
12621262 u8 index, u8 myor)
12631263 {
12641264 return sisusb_setidxregandor(sisusb, port, index, 0xff, myor);
12651265 }
12661266
1267−int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port,
1267+int sisusb_setidxregand(struct sisusb_usb_data *sisusb, u32 port,
12681268 u8 idx, u8 myand)
12691269 {
12701270 return sisusb_setidxregandor(sisusb, port, idx, myand, 0x00);
@@ -2785,8 +2785,8 @@ static loff_t sisusb_lseek(struct file *file, loff_t offset, int orig) · 1514 unmodified lines
27852785 static int sisusb_handle_command(struct sisusb_usb_data *sisusb,
27862786 struct sisusb_command *y, unsigned long arg)
27872787 {
2788− int retval, port, length;
2789− u32 address;
2788+ int retval, length;
2789+ u32 port, address;
27902790
27912791 /* All our commands require the device
27922792 * to be initialized.
drivers/usb/misc/sisusbvga/sisusb_init.h+7−7
@@ -812,17 +812,17 @@ static const struct SiS_VCLKData SiSUSB_VCLKData[] = { · 811 unmodified lines
812812 int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
813813 int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo);
814814
815−extern int sisusb_setreg(struct sisusb_usb_data *sisusb, int port, u8 data);
816−extern int sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 * data);
817−extern int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port,
815+extern int sisusb_setreg(struct sisusb_usb_data *sisusb, u32 port, u8 data);
816+extern int sisusb_getreg(struct sisusb_usb_data *sisusb, u32 port, u8 * data);
817+extern int sisusb_setidxreg(struct sisusb_usb_data *sisusb, u32 port,
818818 u8 index, u8 data);
819−extern int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port,
819+extern int sisusb_getidxreg(struct sisusb_usb_data *sisusb, u32 port,
820820 u8 index, u8 * data);
821−extern int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port,
821+extern int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, u32 port,
822822 u8 idx, u8 myand, u8 myor);
823−extern int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port,
823+extern int sisusb_setidxregor(struct sisusb_usb_data *sisusb, u32 port,
824824 u8 index, u8 myor);
825−extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port,
825+extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, u32 port,
826826 u8 idx, u8 myand);
827827
828828 void sisusb_delete(struct kref *kref);
drivers/usb/serial/garmin_gps.c+2−2
@@ -1138,8 +1138,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p, · 1137 unmodified lines
11381138 send it directly to the tty port */
11391139 if (garmin_data_p->flags & FLAGS_QUEUING) {
11401140 pkt_add(garmin_data_p, data, data_length);
1141− } else if (bulk_data ||
1142− getLayerId(data) == GARMIN_LAYERID_APPL) {
1141+ } else if (bulk_data || (data_length >= sizeof(u32) &&
1142+ getLayerId(data) == GARMIN_LAYERID_APPL)) {
11431143
11441144 spin_lock_irqsave(&garmin_data_p->lock, flags);
11451145 garmin_data_p->flags |= APP_RESP_SEEN;
drivers/usb/serial/qcserial.c+1−0
@@ -173,6 +173,7 @@ static const struct usb_device_id id_table[] = { · 172 unmodified lines
173173 {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
174174 {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */
175175 {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */
176+ {DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */
176177 {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */
177178 {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */
178179 {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
drivers/usb/storage/uas.c+43−3
@@ -81,6 +81,19 @@ static void uas_free_streams(struct uas_dev_info *devinfo); · 80 unmodified lines
8181 static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *prefix,
8282 int status);
8383
84+/*
85+ * This driver needs its own workqueue, as we need to control memory allocation.
86+ *
87+ * In the course of error handling and power management uas_wait_for_pending_cmnds()
88+ * needs to flush pending work items. In these contexts we cannot allocate memory
89+ * by doing block IO as we would deadlock. For the same reason we cannot wait
90+ * for anything allocating memory not heeding these constraints.
91+ *
92+ * So we have to control all work items that can be on the workqueue we flush.
93+ * Hence we cannot share a queue and need our own.
94+ */
95+static struct workqueue_struct *workqueue;
96+
8497 static void uas_do_work(struct work_struct *work)
8598 {
8699 struct uas_dev_info *devinfo =
@@ -109,7 +122,7 @@ static void uas_do_work(struct work_struct *work) · 22 unmodified lines
109122 if (!err)
110123 cmdinfo->state &= ~IS_IN_WORK_LIST;
111124 else
112− schedule_work(&devinfo->work);
125+ queue_work(workqueue, &devinfo->work);
113126 }
114127 out:
115128 spin_unlock_irqrestore(&devinfo->lock, flags);
@@ -134,7 +147,7 @@ static void uas_add_work(struct uas_cmd_info *cmdinfo) · 18 unmodified lines
134147
135148 lockdep_assert_held(&devinfo->lock);
136149 cmdinfo->state |= IS_IN_WORK_LIST;
137− schedule_work(&devinfo->work);
150+ queue_work(workqueue, &devinfo->work);
138151 }
139152
140153 static void uas_zap_pending(struct uas_dev_info *devinfo, int result)
@@ -190,6 +203,9 @@ static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *prefix, · 49 unmodified lines
190203 struct uas_cmd_info *ci = (void *)&cmnd->SCp;
191204 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
192205
206+ if (status == -ENODEV) /* too late */
207+ return;
208+
193209 scmd_printk(KERN_INFO, cmnd,
194210 "%s %d uas-tag %d inflight:%s%s%s%s%s%s%s%s%s%s%s%s ",
195211 prefix, status, cmdinfo->uas_tag,
@@ -1226,7 +1242,31 @@ static struct usb_driver uas_driver = { · 1030 unmodified lines
12261242 .id_table = uas_usb_ids,
12271243 };
12281244
1229−module_usb_driver(uas_driver);
1245+static int __init uas_init(void)
1246+{
1247+ int rv;
1248+
1249+ workqueue = alloc_workqueue("uas", WQ_MEM_RECLAIM, 0);
1250+ if (!workqueue)
1251+ return -ENOMEM;
1252+
1253+ rv = usb_register(&uas_driver);
1254+ if (rv) {
1255+ destroy_workqueue(workqueue);
1256+ return -ENOMEM;
1257+ }
1258+
1259+ return 0;
1260+}
1261+
1262+static void __exit uas_exit(void)
1263+{
1264+ usb_deregister(&uas_driver);
1265+ destroy_workqueue(workqueue);
1266+}
1267+
1268+module_init(uas_init);
1269+module_exit(uas_exit);
12301270
12311271 MODULE_LICENSE("GPL");
12321272 MODULE_IMPORT_NS(USB_STORAGE);
drivers/usb/storage/unusual_devs.h+7−0
@@ -2323,6 +2323,13 @@ UNUSUAL_DEV( 0x3340, 0xffff, 0x0000, 0x0000, · 2322 unmodified lines
23232323 USB_SC_DEVICE,USB_PR_DEVICE,NULL,
23242324 US_FL_MAX_SECTORS_64 ),
23252325
2326+/* Reported by Cyril Roelandt <tipecaml@gmail.com> */
2327+UNUSUAL_DEV( 0x357d, 0x7788, 0x0114, 0x0114,
2328+ "JMicron",
2329+ "USB to ATA/ATAPI Bridge",
2330+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
2331+ US_FL_BROKEN_FUA ),
2332+
23262333 /* Reported by Andrey Rahmatullin <wrar@altlinux.org> */
23272334 UNUSUAL_DEV( 0x4102, 0x1020, 0x0100, 0x0100,
23282335 "iRiver",
drivers/usb/storage/unusual_uas.h+7−0
@@ -28,6 +28,13 @@ · 27 unmodified lines
2828 * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org>
2929 */
3030
31+/* Reported-by: Julian Groß <julian.g@posteo.de> */
32+UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
33+ "LaCie",
34+ "2Big Quadra USB3",
35+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
36+ US_FL_NO_REPORT_OPCODES),
37+
3138 /*
3239 * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
3340 * commands in UAS mode. Observed with the 1.28 firmware; are there others?
drivers/usb/typec/bus.c+4−1
@@ -198,7 +198,10 @@ EXPORT_SYMBOL_GPL(typec_altmode_vdm); · 197 unmodified lines
198198 const struct typec_altmode *
199199 typec_altmode_get_partner(struct typec_altmode *adev)
200200 {
201− return adev ? &to_altmode(adev)->partner->adev : NULL;
201+ if (!adev || !to_altmode(adev)->partner)
202+ return NULL;
203+
204+ return &to_altmode(adev)->partner->adev;
202205 }
203206 EXPORT_SYMBOL_GPL(typec_altmode_get_partner);
204207
drivers/usb/typec/mux/intel_pmc_mux.c+6−2
@@ -157,6 +157,10 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) · 156 unmodified lines
157157 req.mode_data |= (state->mode - TYPEC_STATE_MODAL) <<
158158 PMC_USB_ALTMODE_DP_MODE_SHIFT;
159159
160+ if (data->status & DP_STATUS_HPD_STATE)
161+ req.mode_data |= PMC_USB_DP_HPD_LVL <<
162+ PMC_USB_ALTMODE_DP_MODE_SHIFT;
163+
160164 return pmc_usb_command(port, (void *)&req, sizeof(req));
161165 }
162166
@@ -298,11 +302,11 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index, · 135 unmodified lines
298302 struct typec_mux_desc mux_desc = { };
299303 int ret;
300304
301− ret = fwnode_property_read_u8(fwnode, "usb2-port", &port->usb2_port);
305+ ret = fwnode_property_read_u8(fwnode, "usb2-port-number", &port->usb2_port);
302306 if (ret)
303307 return ret;
304308
305− ret = fwnode_property_read_u8(fwnode, "usb3-port", &port->usb3_port);
309+ ret = fwnode_property_read_u8(fwnode, "usb3-port-number", &port->usb3_port);
306310 if (ret)
307311 return ret;
308312
drivers/usb/typec/mux/pi3usb30532.c+2−2
@@ -114,8 +114,8 @@ pi3usb30532_mux_set(struct typec_mux *mux, struct typec_mux_state *state) · 113 unmodified lines
114114 static int pi3usb30532_probe(struct i2c_client *client)
115115 {
116116 struct device *dev = &client->dev;
117− struct typec_switch_desc sw_desc;
118− struct typec_mux_desc mux_desc;
117+ struct typec_switch_desc sw_desc = { };
118+ struct typec_mux_desc mux_desc = { };
119119 struct pi3usb30532 *pi;
120120 int ret;
121121
drivers/usb/typec/tcpm/tcpm.c+26−0
@@ -3794,6 +3794,14 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1, · 3793 unmodified lines
37943794 */
37953795 break;
37963796
3797+ case PORT_RESET:
3798+ case PORT_RESET_WAIT_OFF:
3799+ /*
3800+ * State set back to default mode once the timer completes.
3801+ * Ignore CC changes here.
3802+ */
3803+ break;
3804+
37973805 default:
37983806 if (tcpm_port_is_disconnected(port))
37993807 tcpm_set_state(port, unattached_state(port), 0);
@@ -3855,6 +3863,15 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port) · 55 unmodified lines
38553863 case SRC_TRY_DEBOUNCE:
38563864 /* Do nothing, waiting for sink detection */
38573865 break;
3866+
3867+ case PORT_RESET:
3868+ case PORT_RESET_WAIT_OFF:
3869+ /*
3870+ * State set back to default mode once the timer completes.
3871+ * Ignore vbus changes here.
3872+ */
3873+ break;
3874+
38583875 default:
38593876 break;
38603877 }
@@ -3908,10 +3925,19 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port) · 47 unmodified lines
39083925 case PORT_RESET_WAIT_OFF:
39093926 tcpm_set_state(port, tcpm_default_state(port), 0);
39103927 break;
3928+
39113929 case SRC_TRY_WAIT:
39123930 case SRC_TRY_DEBOUNCE:
39133931 /* Do nothing, waiting for sink detection */
39143932 break;
3933+
3934+ case PORT_RESET:
3935+ /*
3936+ * State set back to default mode once the timer completes.
3937+ * Ignore vbus changes here.
3938+ */
3939+ break;
3940+
39153941 default:
39163942 if (port->pwr_role == TYPEC_SINK &&
39173943 port->attached)
drivers/vdpa/Kconfig+6−12
@@ -1,21 +1,16 @@
11 # SPDX-License-Identifier: GPL-2.0-only
2−config VDPA
3− tristate
2+menuconfig VDPA
3+ tristate "vDPA drivers"
44 help
55 Enable this module to support vDPA device that uses a
66 datapath which complies with virtio specifications with
77 vendor specific control path.
88
9−menuconfig VDPA_MENU
10− bool "VDPA drivers"
11− default n
12−
13−if VDPA_MENU
9+if VDPA
1410
1511 config VDPA_SIM
1612 tristate "vDPA device simulator"
17− depends on RUNTIME_TESTING_MENU
18− select VDPA
13+ depends on RUNTIME_TESTING_MENU && HAS_DMA && VHOST_DPN
1914 select VHOST_RING
2015 default n
2116 help
@@ -24,9 +19,8 @@ config VDPA_SIM · 2 unmodified lines
2419 development of vDPA.
2520
2621 config IFCVF
27− tristate "Intel IFC VF VDPA driver"
22+ tristate "Intel IFC VF vDPA driver"
2823 depends on PCI_MSI
29− select VDPA
3024 default n
3125 help
3226 This kernel module can drive Intel IFC VF NIC to offload
@@ -34,4 +28,4 @@ config IFCVF · 1 unmodified line
3428 To compile this driver as a module, choose M here: the module will
3529 be called ifcvf.
3630
37−endif # VDPA_MENU
31+endif # VDPA
drivers/vdpa/ifcvf/ifcvf_base.c+0−2
@@ -301,12 +301,10 @@ int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u64 num) · 300 unmodified lines
301301
302302 static int ifcvf_hw_enable(struct ifcvf_hw *hw)
303303 {
304− struct ifcvf_lm_cfg __iomem *ifcvf_lm;
305304 struct virtio_pci_common_cfg __iomem *cfg;
306305 struct ifcvf_adapter *ifcvf;
307306 u32 i;
308307
309− ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg;
310308 ifcvf = vf_to_adapter(hw);
311309 cfg = hw->common_cfg;
312310 ifc_iowrite16(IFCVF_MSI_CONFIG_OFF, &cfg->msix_config);
drivers/vdpa/ifcvf/ifcvf_main.c+1−3
@@ -31,11 +31,9 @@ static irqreturn_t ifcvf_intr_handler(int irq, void *arg) · 30 unmodified lines
3131 static int ifcvf_start_datapath(void *private)
3232 {
3333 struct ifcvf_hw *vf = ifcvf_private_to_vf(private);
34− struct ifcvf_adapter *ifcvf;
3534 u8 status;
3635 int ret;
3736
38− ifcvf = vf_to_adapter(vf);
3937 vf->nr_vring = IFCVF_MAX_QUEUE_PAIRS * 2;
4038 ret = ifcvf_start_hw(vf);
4139 if (ret < 0) {
@@ -228,7 +226,7 @@ static u32 ifcvf_vdpa_get_vendor_id(struct vdpa_device *vdpa_dev) · 186 unmodified lines
228226 return IFCVF_SUBSYS_VENDOR_ID;
229227 }
230228
231−static u16 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
229+static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
232230 {
233231 return IFCVF_QUEUE_ALIGNMENT;
234232 }
drivers/vdpa/vdpa.c+1−1
@@ -116,7 +116,7 @@ EXPORT_SYMBOL_GPL(__vdpa_alloc_device); · 115 unmodified lines
116116
117117 /**
118118 * vdpa_register_device - register a vDPA device
119− * Callers must have a succeed call of vdpa_init_device() before.
119+ * Callers must have a succeed call of vdpa_alloc_device() before.
120120 * @vdev: the vdpa device to be registered to vDPA bus
121121 *
122122 * Returns an error when fail to add to vDPA bus
drivers/vdpa/vdpa_sim/vdpa_sim.c+2−2
@@ -435,7 +435,7 @@ static u64 vdpasim_get_vq_state(struct vdpa_device *vdpa, u16 idx) · 434 unmodified lines
435435 return vrh->last_avail_idx;
436436 }
437437
438−static u16 vdpasim_get_vq_align(struct vdpa_device *vdpa)
438+static u32 vdpasim_get_vq_align(struct vdpa_device *vdpa)
439439 {
440440 return VDPASIM_QUEUE_ALIGN;
441441 }
@@ -488,7 +488,7 @@ static u8 vdpasim_get_status(struct vdpa_device *vdpa) · 46 unmodified lines
488488 status = vdpasim->status;
489489 spin_unlock(&vdpasim->lock);
490490
491− return vdpasim->status;
491+ return status;
492492 }
493493
494494 static void vdpasim_set_status(struct vdpa_device *vdpa, u8 status)
drivers/vfio/vfio_iommu_type1.c+5−5
@@ -342,8 +342,8 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr, · 341 unmodified lines
342342 vma = find_vma_intersection(mm, vaddr, vaddr + 1);
343343
344344 if (vma && vma->vm_flags & VM_PFNMAP) {
345− *pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
346− if (is_invalid_reserved_pfn(*pfn))
345+ if (!follow_pfn(vma, vaddr, pfn) &&
346+ is_invalid_reserved_pfn(*pfn))
347347 ret = 0;
348348 }
349349 done:
@@ -555,7 +555,7 @@ static int vfio_iommu_type1_pin_pages(void *iommu_data, · 205 unmodified lines
555555 continue;
556556 }
557557
558− remote_vaddr = dma->vaddr + iova - dma->iova;
558+ remote_vaddr = dma->vaddr + (iova - dma->iova);
559559 ret = vfio_pin_page_external(dma, remote_vaddr, &phys_pfn[i],
560560 do_accounting);
561561 if (ret)
@@ -2345,10 +2345,10 @@ static int vfio_iommu_type1_dma_rw_chunk(struct vfio_iommu *iommu, · 1783 unmodified lines
23452345 vaddr = dma->vaddr + offset;
23462346
23472347 if (write)
2348− *copied = __copy_to_user((void __user *)vaddr, data,
2348+ *copied = copy_to_user((void __user *)vaddr, data,
23492349 count) ? 0 : count;
23502350 else
2351− *copied = __copy_from_user(data, (void __user *)vaddr,
2351+ *copied = copy_from_user(data, (void __user *)vaddr,
23522352 count) ? 0 : count;
23532353 if (kthread)
23542354 unuse_mm(mm);
drivers/vhost/Kconfig+16−5
@@ -3,6 +3,8 @@ config VHOST_IOTLB · 2 unmodified lines
33 tristate
44 help
55 Generic IOTLB implementation for vhost and vringh.
6+ This option is selected by any driver which needs to support
7+ an IOMMU in software.
68
79 config VHOST_RING
810 tristate
@@ -11,6 +13,15 @@ config VHOST_RING · 2 unmodified lines
1113 This option is selected by any driver which needs to access
1214 the host side of a virtio ring.
1315
16+config VHOST_DPN
17+ bool
18+ depends on !ARM || AEABI
19+ default y
20+ help
21+ Anything selecting VHOST or VHOST_RING must depend on VHOST_DPN.
22+ This excludes the deprecated ARM ABI since that forces a 4 byte
23+ alignment on all structs - incompatible with virtio spec requirements.
24+
1425 config VHOST
1526 tristate
1627 select VHOST_IOTLB
@@ -26,7 +37,7 @@ if VHOST_MENU · 9 unmodified lines
2637
2738 config VHOST_NET
2839 tristate "Host kernel accelerator for virtio net"
29− depends on NET && EVENTFD && (TUN || !TUN) && (TAP || !TAP)
40+ depends on NET && EVENTFD && (TUN || !TUN) && (TAP || !TAP) && VHOST_DPN
3041 select VHOST
3142 ---help---
3243 This kernel module can be loaded in host kernel to accelerate
@@ -38,7 +49,7 @@ config VHOST_NET · 5 unmodified lines
3849
3950 config VHOST_SCSI
4051 tristate "VHOST_SCSI TCM fabric driver"
41− depends on TARGET_CORE && EVENTFD
52+ depends on TARGET_CORE && EVENTFD && VHOST_DPN
4253 select VHOST
4354 default n
4455 ---help---
@@ -47,7 +58,7 @@ config VHOST_SCSI · 2 unmodified lines
4758
4859 config VHOST_VSOCK
4960 tristate "vhost virtio-vsock driver"
50− depends on VSOCKETS && EVENTFD
61+ depends on VSOCKETS && EVENTFD && VHOST_DPN
5162 select VHOST
5263 select VIRTIO_VSOCKETS_COMMON
5364 default n
@@ -61,9 +72,9 @@ config VHOST_VSOCK · 7 unmodified lines
6172
6273 config VHOST_VDPA
6374 tristate "Vhost driver for vDPA-based backend"
64− depends on EVENTFD
75+ depends on EVENTFD && VHOST_DPN
6576 select VHOST
66− select VDPA
77+ depends on VDPA
6778 help
6879 This kernel module can be loaded in host kernel to accelerate
6980 guest virtio devices with the vDPA-based backends.
drivers/vhost/net.c+15−13
@@ -424,7 +424,7 @@ static void vhost_net_disable_vq(struct vhost_net *n, · 423 unmodified lines
424424 struct vhost_net_virtqueue *nvq =
425425 container_of(vq, struct vhost_net_virtqueue, vq);
426426 struct vhost_poll *poll = n->poll + (nvq - n->vqs);
427− if (!vq->private_data)
427+ if (!vhost_vq_get_backend(vq))
428428 return;
429429 vhost_poll_stop(poll);
430430 }
@@ -437,7 +437,7 @@ static int vhost_net_enable_vq(struct vhost_net *n, · 6 unmodified lines
437437 struct vhost_poll *poll = n->poll + (nvq - n->vqs);
438438 struct socket *sock;
439439
440− sock = vq->private_data;
440+ sock = vhost_vq_get_backend(vq);
441441 if (!sock)
442442 return 0;
443443
@@ -524,7 +524,7 @@ static void vhost_net_busy_poll(struct vhost_net *net, · 80 unmodified lines
524524 return;
525525
526526 vhost_disable_notify(&net->dev, vq);
527− sock = rvq->private_data;
527+ sock = vhost_vq_get_backend(rvq);
528528
529529 busyloop_timeout = poll_rx ? rvq->busyloop_timeout:
530530 tvq->busyloop_timeout;
@@ -570,8 +570,10 @@ static int vhost_net_tx_get_vq_desc(struct vhost_net *net, · 39 unmodified lines
570570
571571 if (r == tvq->num && tvq->busyloop_timeout) {
572572 /* Flush batched packets first */
573− if (!vhost_sock_zcopy(tvq->private_data))
574− vhost_tx_batch(net, tnvq, tvq->private_data, msghdr);
573+ if (!vhost_sock_zcopy(vhost_vq_get_backend(tvq)))
574+ vhost_tx_batch(net, tnvq,
575+ vhost_vq_get_backend(tvq),
576+ msghdr);
575577
576578 vhost_net_busy_poll(net, rvq, tvq, busyloop_intr, false);
577579
@@ -685,7 +687,7 @@ static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq, · 107 unmodified lines
685687 struct vhost_virtqueue *vq = &nvq->vq;
686688 struct vhost_net *net = container_of(vq->dev, struct vhost_net,
687689 dev);
688− struct socket *sock = vq->private_data;
690+ struct socket *sock = vhost_vq_get_backend(vq);
689691 struct page_frag *alloc_frag = &net->page_frag;
690692 struct virtio_net_hdr *gso;
691693 struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp];
@@ -952,7 +954,7 @@ static void handle_tx(struct vhost_net *net) · 260 unmodified lines
952954 struct socket *sock;
953955
954956 mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_TX);
955− sock = vq->private_data;
957+ sock = vhost_vq_get_backend(vq);
956958 if (!sock)
957959 goto out;
958960
@@ -1121,7 +1123,7 @@ static void handle_rx(struct vhost_net *net) · 162 unmodified lines
11211123 int recv_pkts = 0;
11221124
11231125 mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX);
1124− sock = vq->private_data;
1126+ sock = vhost_vq_get_backend(vq);
11251127 if (!sock)
11261128 goto out;
11271129
@@ -1345,9 +1347,9 @@ static struct socket *vhost_net_stop_vq(struct vhost_net *n, · 217 unmodified lines
13451347 container_of(vq, struct vhost_net_virtqueue, vq);
13461348
13471349 mutex_lock(&vq->mutex);
1348− sock = vq->private_data;
1350+ sock = vhost_vq_get_backend(vq);
13491351 vhost_net_disable_vq(n, vq);
1350− vq->private_data = NULL;
1352+ vhost_vq_set_backend(vq, NULL);
13511353 vhost_net_buf_unproduce(nvq);
13521354 nvq->rx_ring = NULL;
13531355 mutex_unlock(&vq->mutex);
@@ -1521,7 +1523,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) · 167 unmodified lines
15211523 }
15221524
15231525 /* start polling new socket */
1524− oldsock = vq->private_data;
1526+ oldsock = vhost_vq_get_backend(vq);
15251527 if (sock != oldsock) {
15261528 ubufs = vhost_net_ubuf_alloc(vq,
15271529 sock && vhost_sock_zcopy(sock));
@@ -1531,7 +1533,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) · 3 unmodified lines
15311533 }
15321534
15331535 vhost_net_disable_vq(n, vq);
1534− vq->private_data = sock;
1536+ vhost_vq_set_backend(vq, sock);
15351537 vhost_net_buf_unproduce(nvq);
15361538 r = vhost_vq_init_access(vq);
15371539 if (r)
@@ -1568,7 +1570,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) · 30 unmodified lines
15681570 return 0;
15691571
15701572 err_used:
1571− vq->private_data = oldsock;
1573+ vhost_vq_set_backend(vq, oldsock);
15721574 vhost_net_enable_vq(n, vq);
15731575 if (ubufs)
15741576 vhost_net_ubuf_put_wait_and_free(ubufs);
drivers/vhost/scsi.c+7−7
@@ -452,7 +452,7 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) · 451 unmodified lines
452452 unsigned out, in;
453453 int head, ret;
454454
455− if (!vq->private_data) {
455+ if (!vhost_vq_get_backend(vq)) {
456456 vs->vs_events_missed = true;
457457 return;
458458 }
@@ -892,7 +892,7 @@ vhost_scsi_get_req(struct vhost_virtqueue *vq, struct vhost_scsi_ctx *vc, · 433 unmodified lines
892892 } else {
893893 struct vhost_scsi_tpg **vs_tpg, *tpg;
894894
895− vs_tpg = vq->private_data; /* validated at handler entry */
895+ vs_tpg = vhost_vq_get_backend(vq); /* validated at handler entry */
896896
897897 tpg = READ_ONCE(vs_tpg[*vc->target]);
898898 if (unlikely(!tpg)) {
@@ -929,7 +929,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) · 30 unmodified lines
929929 * We can handle the vq only after the endpoint is setup by calling the
930930 * VHOST_SCSI_SET_ENDPOINT ioctl.
931931 */
932− vs_tpg = vq->private_data;
932+ vs_tpg = vhost_vq_get_backend(vq);
933933 if (!vs_tpg)
934934 goto out;
935935
@@ -1184,7 +1184,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) · 248 unmodified lines
11841184 * We can handle the vq only after the endpoint is setup by calling the
11851185 * VHOST_SCSI_SET_ENDPOINT ioctl.
11861186 */
1187− if (!vq->private_data)
1187+ if (!vhost_vq_get_backend(vq))
11881188 goto out;
11891189
11901190 memset(&vc, 0, sizeof(vc));
@@ -1322,7 +1322,7 @@ static void vhost_scsi_evt_handle_kick(struct vhost_work *work) · 131 unmodified lines
13221322 struct vhost_scsi *vs = container_of(vq->dev, struct vhost_scsi, dev);
13231323
13241324 mutex_lock(&vq->mutex);
1325− if (!vq->private_data)
1325+ if (!vhost_vq_get_backend(vq))
13261326 goto out;
13271327
13281328 if (vs->vs_events_missed)
@@ -1460,7 +1460,7 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs, · 131 unmodified lines
14601460 for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) {
14611461 vq = &vs->vqs[i].vq;
14621462 mutex_lock(&vq->mutex);
1463− vq->private_data = vs_tpg;
1463+ vhost_vq_set_backend(vq, vs_tpg);
14641464 vhost_vq_init_access(vq);
14651465 mutex_unlock(&vq->mutex);
14661466 }
@@ -1547,7 +1547,7 @@ vhost_scsi_clear_endpoint(struct vhost_scsi *vs, · 80 unmodified lines
15471547 for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) {
15481548 vq = &vs->vqs[i].vq;
15491549 mutex_lock(&vq->mutex);
1550− vq->private_data = NULL;
1550+ vhost_vq_set_backend(vq, NULL);
15511551 mutex_unlock(&vq->mutex);
15521552 }
15531553 }
drivers/vhost/test.c+7−7
@@ -49,7 +49,7 @@ static void handle_vq(struct vhost_test *n) · 48 unmodified lines
4949 void *private;
5050
5151 mutex_lock(&vq->mutex);
52− private = vq->private_data;
52+ private = vhost_vq_get_backend(vq);
5353 if (!private) {
5454 mutex_unlock(&vq->mutex);
5555 return;
@@ -120,7 +120,7 @@ static int vhost_test_open(struct inode *inode, struct file *f) · 64 unmodified lines
120120 vqs[VHOST_TEST_VQ] = &n->vqs[VHOST_TEST_VQ];
121121 n->vqs[VHOST_TEST_VQ].handle_kick = handle_vq_kick;
122122 vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX, UIO_MAXIOV,
123− VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT);
123+ VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT, NULL);
124124
125125 f->private_data = n;
126126
@@ -133,8 +133,8 @@ static void *vhost_test_stop_vq(struct vhost_test *n, · 6 unmodified lines
133133 void *private;
134134
135135 mutex_lock(&vq->mutex);
136− private = vq->private_data;
137− vq->private_data = NULL;
136+ private = vhost_vq_get_backend(vq);
137+ vhost_vq_set_backend(vq, NULL);
138138 mutex_unlock(&vq->mutex);
139139 return private;
140140 }
@@ -198,8 +198,8 @@ static long vhost_test_run(struct vhost_test *n, int test) · 57 unmodified lines
198198 priv = test ? n : NULL;
199199
200200 /* start polling new socket */
201− oldpriv = vq->private_data;
202− vq->private_data = priv;
201+ oldpriv = vhost_vq_get_backend(vq);
202+ vhost_vq_set_backend(vq, priv);
203203
204204 r = vhost_vq_init_access(&n->vqs[index]);
205205
@@ -225,7 +225,7 @@ static long vhost_test_reset_owner(struct vhost_test *n) · 19 unmodified lines
225225 {
226226 void *priv = NULL;
227227 long err;
228− struct vhost_umem *umem;
228+ struct vhost_iotlb *umem;
229229
230230 mutex_lock(&n->dev.mutex);
231231 err = vhost_dev_check_owner(&n->dev);
drivers/vhost/vdpa.c+0−5
@@ -296,7 +296,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd, · 295 unmodified lines
296296 struct vdpa_callback cb;
297297 struct vhost_virtqueue *vq;
298298 struct vhost_vring_state s;
299− u8 status;
300299 u32 idx;
301300 long r;
302301
@@ -310,8 +309,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd, · 7 unmodified lines
310309 idx = array_index_nospec(idx, v->nvqs);
311310 vq = &v->vqs[idx];
312311
313− status = ops->get_status(vdpa);
314−
315312 if (cmd == VHOST_VDPA_SET_VRING_ENABLE) {
316313 if (copy_from_user(&s, argp, sizeof(s)))
317314 return -EFAULT;
@@ -678,8 +675,6 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) · 360 unmodified lines
678675 int nvqs, i, r, opened;
679676
680677 v = container_of(inode->i_cdev, struct vhost_vdpa, cdev);
681− if (!v)
682− return -ENODEV;
683678
684679 opened = atomic_cmpxchg(&v->opened, 0, 1);
685680 if (opened)
drivers/vhost/vhost.h+27−0
@@ -231,6 +231,33 @@ enum { · 230 unmodified lines
231231 (1ULL << VIRTIO_F_VERSION_1)
232232 };
233233
234+/**
235+ * vhost_vq_set_backend - Set backend.
236+ *
237+ * @vq Virtqueue.
238+ * @private_data The private data.
239+ *
240+ * Context: Need to call with vq->mutex acquired.
241+ */
242+static inline void vhost_vq_set_backend(struct vhost_virtqueue *vq,
243+ void *private_data)
244+{
245+ vq->private_data = private_data;
246+}
247+
248+/**
249+ * vhost_vq_get_backend - Get backend.
250+ *
251+ * @vq Virtqueue.
252+ *
253+ * Context: Need to call with vq->mutex acquired.
254+ * Return: Private data previously set with vhost_vq_set_backend.
255+ */
256+static inline void *vhost_vq_get_backend(struct vhost_virtqueue *vq)
257+{
258+ return vq->private_data;
259+}
260+
234261 static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
235262 {
236263 return vq->acked_features & (1ULL << bit);
drivers/vhost/vringh.c+5−0
@@ -13,9 +13,11 @@ · 12 unmodified lines
1313 #include <linux/uaccess.h>
1414 #include <linux/slab.h>
1515 #include <linux/export.h>
16+#if IS_REACHABLE(CONFIG_VHOST_IOTLB)
1617 #include <linux/bvec.h>
1718 #include <linux/highmem.h>
1819 #include <linux/vhost_iotlb.h>
20+#endif
1921 #include <uapi/linux/virtio_config.h>
2022
2123 static __printf(1,2) __cold void vringh_bad(const char *fmt, ...)
@@ -1059,6 +1061,8 @@ int vringh_need_notify_kern(struct vringh *vrh) · 1037 unmodified lines
10591061 }
10601062 EXPORT_SYMBOL(vringh_need_notify_kern);
10611063
1064+#if IS_REACHABLE(CONFIG_VHOST_IOTLB)
1065+
10621066 static int iotlb_translate(const struct vringh *vrh,
10631067 u64 addr, u64 len, struct bio_vec iov[],
10641068 int iov_size, u32 perm)
@@ -1416,5 +1420,6 @@ int vringh_need_notify_iotlb(struct vringh *vrh) · 351 unmodified lines
14161420 }
14171421 EXPORT_SYMBOL(vringh_need_notify_iotlb);
14181422
1423+#endif
14191424
14201425 MODULE_LICENSE("GPL");
drivers/vhost/vsock.c+23−12
@@ -91,7 +91,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, · 90 unmodified lines
9191
9292 mutex_lock(&vq->mutex);
9393
94− if (!vq->private_data)
94+ if (!vhost_vq_get_backend(vq))
9595 goto out;
9696
9797 /* Avoid further vmexits, we're already processing the virtqueue */
@@ -181,14 +181,14 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, · 83 unmodified lines
181181 break;
182182 }
183183
184− vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len);
185− added = true;
186−
187− /* Deliver to monitoring devices all correctly transmitted
188− * packets.
184+ /* Deliver to monitoring devices all packets that we
185+ * will transmit.
189186 */
190187 virtio_transport_deliver_tap_pkt(pkt);
191188
189+ vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len);
190+ added = true;
191+
192192 pkt->off += payload_len;
193193 total_len += payload_len;
194194
@@ -196,6 +196,12 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, · 1 unmodified line
196196 * to send it with the next available buffer.
197197 */
198198 if (pkt->off < pkt->len) {
199+ /* We are queueing the same virtio_vsock_pkt to handle
200+ * the remaining bytes, and we want to deliver it
201+ * to monitoring devices in the next iteration.
202+ */
203+ pkt->tap_delivered = false;
204+
199205 spin_lock_bh(&vsock->send_pkt_list_lock);
200206 list_add(&pkt->list, &vsock->send_pkt_list);
201207 spin_unlock_bh(&vsock->send_pkt_list_lock);
@@ -440,7 +446,7 @@ static void vhost_vsock_handle_tx_kick(struct vhost_work *work) · 238 unmodified lines
440446
441447 mutex_lock(&vq->mutex);
442448
443− if (!vq->private_data)
449+ if (!vhost_vq_get_backend(vq))
444450 goto out;
445451
446452 vhost_disable_notify(&vsock->dev, vq);
@@ -533,8 +539,8 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) · 86 unmodified lines
533539 goto err_vq;
534540 }
535541
536− if (!vq->private_data) {
537− vq->private_data = vsock;
542+ if (!vhost_vq_get_backend(vq)) {
543+ vhost_vq_set_backend(vq, vsock);
538544 ret = vhost_vq_init_access(vq);
539545 if (ret)
540546 goto err_vq;
@@ -543,18 +549,23 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) · 2 unmodified lines
543549 mutex_unlock(&vq->mutex);
544550 }
545551
552+ /* Some packets may have been queued before the device was started,
553+ * let's kick the send worker to send them.
554+ */
555+ vhost_work_queue(&vsock->dev, &vsock->send_pkt_work);
556+
546557 mutex_unlock(&vsock->dev.mutex);
547558 return 0;
548559
549560 err_vq:
550− vq->private_data = NULL;
561+ vhost_vq_set_backend(vq, NULL);
551562 mutex_unlock(&vq->mutex);
552563
553564 for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
554565 vq = &vsock->vqs[i];
555566
556567 mutex_lock(&vq->mutex);
557− vq->private_data = NULL;
568+ vhost_vq_set_backend(vq, NULL);
558569 mutex_unlock(&vq->mutex);
559570 }
560571 err:
@@ -577,7 +588,7 @@ static int vhost_vsock_stop(struct vhost_vsock *vsock) · 16 unmodified lines
577588 struct vhost_virtqueue *vq = &vsock->vqs[i];
578589
579590 mutex_lock(&vq->mutex);
580− vq->private_data = NULL;
591+ vhost_vq_set_backend(vq, NULL);
581592 mutex_unlock(&vq->mutex);
582593 }
583594
drivers/virtio/Kconfig+1−1
@@ -45,7 +45,7 @@ config VIRTIO_PCI_LEGACY · 44 unmodified lines
4545
4646 config VIRTIO_VDPA
4747 tristate "vDPA driver for virtio devices"
48− select VDPA
48+ depends on VDPA
4949 select VIRTIO
5050 help
5151 This driver provides support for virtio based paravirtual
drivers/virtio/virtio_balloon.c+2−2
@@ -165,7 +165,7 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) · 164 unmodified lines
165165
166166 }
167167
168−int virtballoon_free_page_report(struct page_reporting_dev_info *pr_dev_info,
168+static int virtballoon_free_page_report(struct page_reporting_dev_info *pr_dev_info,
169169 struct scatterlist *sg, unsigned int nents)
170170 {
171171 struct virtio_balloon *vb =
@@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb) · 408 unmodified lines
580580 if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
581581 &vb->config_read_bitmap))
582582 virtio_cread(vb->vdev, struct virtio_balloon_config,
583− free_page_report_cmd_id,
583+ free_page_hint_cmd_id,
584584 &vb->cmd_id_received_cache);
585585
586586 return vb->cmd_id_received_cache;
drivers/virtio/virtio_input.c+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <linux/virtio.h>
44 #include <linux/virtio_config.h>
55 #include <linux/input.h>
6+#include <linux/slab.h>
67
78 #include <uapi/linux/virtio_ids.h>
89 #include <uapi/linux/virtio_input.h>
fs/afs/cmservice.c+1−1
@@ -169,7 +169,7 @@ static int afs_record_cm_probe(struct afs_call *call, struct afs_server *server) · 168 unmodified lines
169169
170170 spin_lock(&server->probe_lock);
171171
172− if (!test_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
172+ if (!test_and_set_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
173173 server->cm_epoch = call->epoch;
174174 server->probe.cm_epoch = call->epoch;
175175 goto out;
fs/afs/fs_probe.c+1−4
@@ -117,11 +117,8 @@ out: · 116 unmodified lines
117117 (unsigned int)rtt, ret);
118118
119119 have_result |= afs_fs_probe_done(server);
120− if (have_result) {
121− server->probe.have_result = true;
122− wake_up_var(&server->probe.have_result);
120+ if (have_result)
123121 wake_up_all(&server->probe_wq);
124− }
125122 }
126123
127124 /*
fs/afs/internal.h+1−3
@@ -533,12 +533,10 @@ struct afs_server { · 532 unmodified lines
533533 u32 abort_code;
534534 u32 cm_epoch;
535535 short error;
536− bool have_result;
537536 bool responded:1;
538537 bool is_yfs:1;
539538 bool not_yfs:1;
540539 bool local_failure:1;
541− bool no_epoch:1;
542540 bool cm_probed:1;
543541 bool said_rebooted:1;
544542 bool said_inconsistent:1;
@@ -1335,7 +1333,7 @@ extern struct afs_volume *afs_create_volume(struct afs_fs_context *); · 790 unmodified lines
13351333 extern void afs_activate_volume(struct afs_volume *);
13361334 extern void afs_deactivate_volume(struct afs_volume *);
13371335 extern void afs_put_volume(struct afs_cell *, struct afs_volume *);
1338−extern int afs_check_volume_status(struct afs_volume *, struct key *);
1336+extern int afs_check_volume_status(struct afs_volume *, struct afs_fs_cursor *);
13391337
13401338 /*
13411339 * write.c
fs/afs/rotate.c+3−3
@@ -192,7 +192,7 @@ bool afs_select_fileserver(struct afs_fs_cursor *fc) · 191 unmodified lines
192192 write_unlock(&vnode->volume->servers_lock);
193193
194194 set_bit(AFS_VOLUME_NEEDS_UPDATE, &vnode->volume->flags);
195− error = afs_check_volume_status(vnode->volume, fc->key);
195+ error = afs_check_volume_status(vnode->volume, fc);
196196 if (error < 0)
197197 goto failed_set_error;
198198
@@ -281,7 +281,7 @@ bool afs_select_fileserver(struct afs_fs_cursor *fc) · 82 unmodified lines
281281
282282 set_bit(AFS_VOLUME_WAIT, &vnode->volume->flags);
283283 set_bit(AFS_VOLUME_NEEDS_UPDATE, &vnode->volume->flags);
284− error = afs_check_volume_status(vnode->volume, fc->key);
284+ error = afs_check_volume_status(vnode->volume, fc);
285285 if (error < 0)
286286 goto failed_set_error;
287287
@@ -341,7 +341,7 @@ start: · 53 unmodified lines
341341 /* See if we need to do an update of the volume record. Note that the
342342 * volume may have moved or even have been deleted.
343343 */
344− error = afs_check_volume_status(vnode->volume, fc->key);
344+ error = afs_check_volume_status(vnode->volume, fc);
345345 if (error < 0)
346346 goto failed_set_error;
347347
fs/afs/server.c+2−5
@@ -594,12 +594,9 @@ retry: · 593 unmodified lines
594594 }
595595
596596 ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING,
597− TASK_INTERRUPTIBLE);
597+ (fc->flags & AFS_FS_CURSOR_INTR) ?
598+ TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
598599 if (ret == -ERESTARTSYS) {
599− if (!(fc->flags & AFS_FS_CURSOR_INTR) && server->addresses) {
600− _leave(" = t [intr]");
601− return true;
602− }
603600 fc->error = ret;
604601 _leave(" = f [intr]");
605602 return false;
fs/afs/vl_rotate.c+2−2
@@ -302,8 +302,8 @@ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc) · 301 unmodified lines
302302 pr_notice("VC: - nr=%u/%u/%u pf=%u\n",
303303 a->nr_ipv4, a->nr_addrs, a->max_addrs,
304304 a->preferred);
305− pr_notice("VC: - pr=%lx R=%lx F=%lx\n",
306− a->probed, a->responded, a->failed);
305+ pr_notice("VC: - R=%lx F=%lx\n",
306+ a->responded, a->failed);
307307 if (a == vc->ac.alist)
308308 pr_notice("VC: - current\n");
309309 }
fs/afs/volume.c+5−3
@@ -281,7 +281,7 @@ error: · 280 unmodified lines
281281 /*
282282 * Make sure the volume record is up to date.
283283 */
284−int afs_check_volume_status(struct afs_volume *volume, struct key *key)
284+int afs_check_volume_status(struct afs_volume *volume, struct afs_fs_cursor *fc)
285285 {
286286 time64_t now = ktime_get_real_seconds();
287287 int ret, retries = 0;
@@ -299,7 +299,7 @@ retry: · 11 unmodified lines
299299 }
300300
301301 if (!test_and_set_bit_lock(AFS_VOLUME_UPDATING, &volume->flags)) {
302− ret = afs_update_volume_status(volume, key);
302+ ret = afs_update_volume_status(volume, fc->key);
303303 clear_bit_unlock(AFS_VOLUME_WAIT, &volume->flags);
304304 clear_bit_unlock(AFS_VOLUME_UPDATING, &volume->flags);
305305 wake_up_bit(&volume->flags, AFS_VOLUME_WAIT);
@@ -312,7 +312,9 @@ retry: · 6 unmodified lines
312312 return 0;
313313 }
314314
315− ret = wait_on_bit(&volume->flags, AFS_VOLUME_WAIT, TASK_INTERRUPTIBLE);
315+ ret = wait_on_bit(&volume->flags, AFS_VOLUME_WAIT,
316+ (fc->flags & AFS_FS_CURSOR_INTR) ?
317+ TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
316318 if (ret == -ERESTARTSYS) {
317319 _leave(" = %d", ret);
318320 return ret;
fs/block_dev.c+10−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919 #include <linux/module.h>
2020 #include <linux/blkpg.h>
2121 #include <linux/magic.h>
22−#include <linux/dax.h>
2322 #include <linux/buffer_head.h>
2423 #include <linux/swap.h>
2524 #include <linux/pagevec.h>
@@ -1893,6 +1892,16 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part) · 1867 unmodified lines
18931892 struct gendisk *disk = bdev->bd_disk;
18941893 struct block_device *victim = NULL;
18951894
1895+ /*
1896+ * Sync early if it looks like we're the last one. If someone else
1897+ * opens the block device between now and the decrement of bd_openers
1898+ * then we did a sync that we didn't need to, but that's not the end
1899+ * of the world and we want to avoid long (could be several minute)
1900+ * syncs while holding the mutex.
1901+ */
1902+ if (bdev->bd_openers == 1)
1903+ sync_blockdev(bdev);
1904+
18961905 mutex_lock_nested(&bdev->bd_mutex, for_part);
18971906 if (for_part)
18981907 bdev->bd_part_count--;
fs/btrfs/backref.c+1−1
@@ -391,7 +391,7 @@ static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr) · 390 unmodified lines
391391 struct rb_node **p = &preftrees->direct.root.rb_root.rb_node;
392392 struct rb_node *parent = NULL;
393393 struct prelim_ref *ref = NULL;
394− struct prelim_ref target = {0};
394+ struct prelim_ref target = {};
395395 int result;
396396
397397 target.parent = bytenr;
fs/btrfs/block-group.c+14−6
@@ -916,7 +916,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, · 915 unmodified lines
916916 path = btrfs_alloc_path();
917917 if (!path) {
918918 ret = -ENOMEM;
919− goto out;
919+ goto out_put_group;
920920 }
921921
922922 /*
@@ -954,7 +954,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, · 31 unmodified lines
954954 ret = btrfs_orphan_add(trans, BTRFS_I(inode));
955955 if (ret) {
956956 btrfs_add_delayed_iput(inode);
957− goto out;
957+ goto out_put_group;
958958 }
959959 clear_nlink(inode);
960960 /* One for the block groups ref */
@@ -977,13 +977,13 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, · 16 unmodified lines
977977
978978 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1);
979979 if (ret < 0)
980− goto out;
980+ goto out_put_group;
981981 if (ret > 0)
982982 btrfs_release_path(path);
983983 if (ret == 0) {
984984 ret = btrfs_del_item(trans, tree_root, path);
985985 if (ret)
986− goto out;
986+ goto out_put_group;
987987 btrfs_release_path(path);
988988 }
989989
@@ -1102,9 +1102,9 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, · 112 unmodified lines
11021102
11031103 ret = remove_block_group_free_space(trans, block_group);
11041104 if (ret)
1105− goto out;
1105+ goto out_put_group;
11061106
1107− btrfs_put_block_group(block_group);
1107+ /* Once for the block groups rbtree */
11081108 btrfs_put_block_group(block_group);
11091109
11101110 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
@@ -1127,6 +1127,10 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, · 16 unmodified lines
11271127 /* once for the tree */
11281128 free_extent_map(em);
11291129 }
1130+
1131+out_put_group:
1132+ /* Once for the lookup reference */
1133+ btrfs_put_block_group(block_group);
11301134 out:
11311135 if (remove_rsv)
11321136 btrfs_delayed_refs_rsv_release(fs_info, 1);
@@ -1288,11 +1292,15 @@ static bool clean_pinned_extents(struct btrfs_trans_handle *trans, · 155 unmodified lines
12881292 if (ret)
12891293 goto err;
12901294 mutex_unlock(&fs_info->unused_bg_unpin_mutex);
1295+ if (prev_trans)
1296+ btrfs_put_transaction(prev_trans);
12911297
12921298 return true;
12931299
12941300 err:
12951301 mutex_unlock(&fs_info->unused_bg_unpin_mutex);
1302+ if (prev_trans)
1303+ btrfs_put_transaction(prev_trans);
12961304 btrfs_dec_block_group_ro(bg);
12971305 return false;
12981306 }
fs/btrfs/discard.h+1−1
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL-2.0
1+/* SPDX-License-Identifier: GPL-2.0 */
22
33 #ifndef BTRFS_DISCARD_H
44 #define BTRFS_DISCARD_H
fs/btrfs/disk-io.c+32−4
@@ -2036,9 +2036,6 @@ void btrfs_free_fs_roots(struct btrfs_fs_info *fs_info) · 2035 unmodified lines
20362036 for (i = 0; i < ret; i++)
20372037 btrfs_drop_and_free_fs_root(fs_info, gang[i]);
20382038 }
2039−
2040− if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state))
2041− btrfs_free_log_root_tree(NULL, fs_info);
20422039 }
20432040
20442041 static void btrfs_init_scrub(struct btrfs_fs_info *fs_info)
@@ -3888,7 +3885,7 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info, · 1843 unmodified lines
38883885 spin_unlock(&fs_info->fs_roots_radix_lock);
38893886
38903887 if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
3891− btrfs_free_log(NULL, root);
3888+ ASSERT(root->log_root == NULL);
38923889 if (root->reloc_root) {
38933890 btrfs_put_root(root->reloc_root);
38943891 root->reloc_root = NULL;
@@ -4211,6 +4208,36 @@ static void btrfs_error_commit_super(struct btrfs_fs_info *fs_info) · 316 unmodified lines
42114208 up_write(&fs_info->cleanup_work_sem);
42124209 }
42134210
4211+static void btrfs_drop_all_logs(struct btrfs_fs_info *fs_info)
4212+{
4213+ struct btrfs_root *gang[8];
4214+ u64 root_objectid = 0;
4215+ int ret;
4216+
4217+ spin_lock(&fs_info->fs_roots_radix_lock);
4218+ while ((ret = radix_tree_gang_lookup(&fs_info->fs_roots_radix,
4219+ (void **)gang, root_objectid,
4220+ ARRAY_SIZE(gang))) != 0) {
4221+ int i;
4222+
4223+ for (i = 0; i < ret; i++)
4224+ gang[i] = btrfs_grab_root(gang[i]);
4225+ spin_unlock(&fs_info->fs_roots_radix_lock);
4226+
4227+ for (i = 0; i < ret; i++) {
4228+ if (!gang[i])
4229+ continue;
4230+ root_objectid = gang[i]->root_key.objectid;
4231+ btrfs_free_log(NULL, gang[i]);
4232+ btrfs_put_root(gang[i]);
4233+ }
4234+ root_objectid++;
4235+ spin_lock(&fs_info->fs_roots_radix_lock);
4236+ }
4237+ spin_unlock(&fs_info->fs_roots_radix_lock);
4238+ btrfs_free_log_root_tree(NULL, fs_info);
4239+}
4240+
42144241 static void btrfs_destroy_ordered_extents(struct btrfs_root *root)
42154242 {
42164243 struct btrfs_ordered_extent *ordered;
@@ -4603,6 +4630,7 @@ static int btrfs_cleanup_transaction(struct btrfs_fs_info *fs_info) · 386 unmodified lines
46034630 btrfs_destroy_delayed_inodes(fs_info);
46044631 btrfs_assert_delayed_root_empty(fs_info);
46054632 btrfs_destroy_all_delalloc_inodes(fs_info);
4633+ btrfs_drop_all_logs(fs_info);
46064634 mutex_unlock(&fs_info->transaction_kthread_mutex);
46074635
46084636 return 0;
fs/btrfs/relocation.c+1−0
@@ -4559,6 +4559,7 @@ int btrfs_recover_relocation(struct btrfs_root *root) · 4558 unmodified lines
45594559 if (IS_ERR(fs_root)) {
45604560 err = PTR_ERR(fs_root);
45614561 list_add_tail(&reloc_root->root_list, &reloc_roots);
4562+ btrfs_end_transaction(trans);
45624563 goto out_unset;
45634564 }
45644565
fs/btrfs/transaction.c+11−2
@@ -662,10 +662,19 @@ again: · 661 unmodified lines
662662 }
663663
664664 got_it:
665− btrfs_record_root_in_trans(h, root);
666−
667665 if (!current->journal_info)
668666 current->journal_info = h;
667+
668+ /*
669+ * btrfs_record_root_in_trans() needs to alloc new extents, and may
670+ * call btrfs_join_transaction() while we're also starting a
671+ * transaction.
672+ *
673+ * Thus it need to be called after current->journal_info initialized,
674+ * or we can deadlock.
675+ */
676+ btrfs_record_root_in_trans(h, root);
677+
669678 return h;
670679
671680 join_fail:
fs/btrfs/tree-log.c+40−3
@@ -4226,6 +4226,9 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans, · 4225 unmodified lines
42264226 const u64 ino = btrfs_ino(inode);
42274227 struct btrfs_path *dst_path = NULL;
42284228 bool dropped_extents = false;
4229+ u64 truncate_offset = i_size;
4230+ struct extent_buffer *leaf;
4231+ int slot;
42294232 int ins_nr = 0;
42304233 int start_slot;
42314234 int ret;
@@ -4240,9 +4243,43 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans, · 8 unmodified lines
42404243 if (ret < 0)
42414244 goto out;
42424245
4246+ /*
4247+ * We must check if there is a prealloc extent that starts before the
4248+ * i_size and crosses the i_size boundary. This is to ensure later we
4249+ * truncate down to the end of that extent and not to the i_size, as
4250+ * otherwise we end up losing part of the prealloc extent after a log
4251+ * replay and with an implicit hole if there is another prealloc extent
4252+ * that starts at an offset beyond i_size.
4253+ */
4254+ ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY);
4255+ if (ret < 0)
4256+ goto out;
4257+
4258+ if (ret == 0) {
4259+ struct btrfs_file_extent_item *ei;
4260+
4261+ leaf = path->nodes[0];
4262+ slot = path->slots[0];
4263+ ei = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item);
4264+
4265+ if (btrfs_file_extent_type(leaf, ei) ==
4266+ BTRFS_FILE_EXTENT_PREALLOC) {
4267+ u64 extent_end;
4268+
4269+ btrfs_item_key_to_cpu(leaf, &key, slot);
4270+ extent_end = key.offset +
4271+ btrfs_file_extent_num_bytes(leaf, ei);
4272+
4273+ if (extent_end > i_size)
4274+ truncate_offset = extent_end;
4275+ }
4276+ } else {
4277+ ret = 0;
4278+ }
4279+
42434280 while (true) {
4244− struct extent_buffer *leaf = path->nodes[0];
4245− int slot = path->slots[0];
4281+ leaf = path->nodes[0];
4282+ slot = path->slots[0];
42464283
42474284 if (slot >= btrfs_header_nritems(leaf)) {
42484285 if (ins_nr > 0) {
@@ -4280,7 +4317,7 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans, · 31 unmodified lines
42804317 ret = btrfs_truncate_inode_items(trans,
42814318 root->log_root,
42824319 &inode->vfs_inode,
4283− i_size,
4320+ truncate_offset,
42844321 BTRFS_EXTENT_DATA_KEY);
42854322 } while (ret == -EAGAIN);
42864323 if (ret)
fs/buffer.c+1−1
@@ -967,7 +967,7 @@ grow_dev_page(struct block_device *bdev, sector_t block, · 966 unmodified lines
967967 struct page *page;
968968 struct buffer_head *bh;
969969 sector_t end_block;
970− int ret = 0; /* Will call free_more_memory() */
970+ int ret = 0;
971971 gfp_t gfp_mask;
972972
973973 gfp_mask = mapping_gfp_constraint(inode->i_mapping, ~__GFP_FS) | gfp;
fs/ceph/caps.c+2−1
@@ -2749,7 +2749,7 @@ int ceph_try_get_caps(struct inode *inode, int need, int want, · 2748 unmodified lines
27492749
27502750 ret = try_get_cap_refs(inode, need, want, 0, flags, got);
27512751 /* three special error codes */
2752− if (ret == -EAGAIN || ret == -EFBIG || ret == -EAGAIN)
2752+ if (ret == -EAGAIN || ret == -EFBIG || ret == -ESTALE)
27532753 ret = 0;
27542754 return ret;
27552755 }
@@ -3746,6 +3746,7 @@ retry: · 990 unmodified lines
37463746 WARN_ON(1);
37473747 tsession = NULL;
37483748 target = -1;
3749+ mutex_lock(&session->s_mutex);
37493750 }
37503751 goto retry;
37513752
fs/ceph/debugfs.c+1−1
@@ -271,7 +271,7 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) · 270 unmodified lines
271271 &congestion_kb_fops);
272272
273273 snprintf(name, sizeof(name), "../../bdi/%s",
274− dev_name(fsc->sb->s_bdi->dev));
274+ bdi_dev_name(fsc->sb->s_bdi));
275275 fsc->debugfs_bdi =
276276 debugfs_create_symlink("bdi",
277277 fsc->client->debugfs_dir,
fs/ceph/mds_client.c+3−5
@@ -3251,8 +3251,7 @@ static void handle_session(struct ceph_mds_session *session, · 3250 unmodified lines
32513251 void *end = p + msg->front.iov_len;
32523252 struct ceph_mds_session_head *h;
32533253 u32 op;
3254− u64 seq;
3255− unsigned long features = 0;
3254+ u64 seq, features = 0;
32563255 int wake = 0;
32573256 bool blacklisted = false;
32583257
@@ -3271,9 +3270,8 @@ static void handle_session(struct ceph_mds_session *session, · 12 unmodified lines
32713270 goto bad;
32723271 /* version >= 3, feature bits */
32733272 ceph_decode_32_safe(&p, end, len, bad);
3274− ceph_decode_need(&p, end, len, bad);
3275− memcpy(&features, p, min_t(size_t, len, sizeof(features)));
3276− p += len;
3273+ ceph_decode_64_safe(&p, end, features, bad);
3274+ p += len - sizeof(features);
32773275 }
32783276
32793277 mutex_lock(&mdsc->mutex);
fs/ceph/quota.c+2−2
@@ -159,8 +159,8 @@ static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc, · 158 unmodified lines
159159 }
160160
161161 if (IS_ERR(in)) {
162− pr_warn("Can't lookup inode %llx (err: %ld)\n",
163− realm->ino, PTR_ERR(in));
162+ dout("Can't lookup inode %llx (err: %ld)\n",
163+ realm->ino, PTR_ERR(in));
164164 qri->timeout = jiffies + msecs_to_jiffies(60 * 1000); /* XXX */
165165 } else {
166166 qri->timeout = 0;
fs/cifs/cifsglob.h+2−1
@@ -1891,7 +1891,8 @@ GLOBAL_EXTERN struct list_head cifs_tcp_ses_list; · 1890 unmodified lines
18911891 /*
18921892 * This lock protects the cifs_tcp_ses_list, the list of smb sessions per
18931893 * tcp session, and the list of tcon's per smb session. It also protects
1894− * the reference counters for the server, smb session, and tcon. Finally,
1894+ * the reference counters for the server, smb session, and tcon. It also
1895+ * protects some fields in the TCP_Server_Info struct such as dstaddr. Finally,
18951896 * changes to the tcon->tidStatus should be done while holding this lock.
18961897 * generally the locks should be taken in order tcp_ses_lock before
18971898 * tcon->open_file_lock and that before file->file_info_lock since the
fs/cifs/connect.c+6−0
@@ -375,8 +375,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server) · 374 unmodified lines
375375 return rc;
376376 }
377377
378+ spin_lock(&cifs_tcp_ses_lock);
378379 rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr,
379380 strlen(ipaddr));
381+ spin_unlock(&cifs_tcp_ses_lock);
380382 kfree(ipaddr);
381383
382384 return !rc ? -1 : 0;
@@ -3373,6 +3375,10 @@ cifs_find_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) · 2990 unmodified lines
33733375 spin_lock(&cifs_tcp_ses_lock);
33743376 list_for_each(tmp, &ses->tcon_list) {
33753377 tcon = list_entry(tmp, struct cifs_tcon, tcon_list);
3378+#ifdef CONFIG_CIFS_DFS_UPCALL
3379+ if (tcon->dfs_path)
3380+ continue;
3381+#endif
33763382 if (!match_tcon(tcon, volume_info))
33773383 continue;
33783384 ++tcon->tc_count;
fs/cifs/misc.c+65−17
@@ -1025,51 +1025,99 @@ int copy_path_name(char *dst, const char *src) · 1024 unmodified lines
10251025 }
10261026
10271027 struct super_cb_data {
1028− struct TCP_Server_Info *server;
1028+ void *data;
10291029 struct super_block *sb;
10301030 };
10311031
1032−static void super_cb(struct super_block *sb, void *arg)
1032+static void tcp_super_cb(struct super_block *sb, void *arg)
10331033 {
1034− struct super_cb_data *d = arg;
1034+ struct super_cb_data *sd = arg;
1035+ struct TCP_Server_Info *server = sd->data;
10351036 struct cifs_sb_info *cifs_sb;
10361037 struct cifs_tcon *tcon;
10371038
1038− if (d->sb)
1039+ if (sd->sb)
10391040 return;
10401041
10411042 cifs_sb = CIFS_SB(sb);
10421043 tcon = cifs_sb_master_tcon(cifs_sb);
1043− if (tcon->ses->server == d->server)
1044− d->sb = sb;
1044+ if (tcon->ses->server == server)
1045+ sd->sb = sb;
10451046 }
10461047
1047−struct super_block *cifs_get_tcp_super(struct TCP_Server_Info *server)
1048+static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void *),
1049+ void *data)
10481050 {
1049− struct super_cb_data d = {
1050− .server = server,
1051+ struct super_cb_data sd = {
1052+ .data = data,
10511053 .sb = NULL,
10521054 };
10531055
1054− iterate_supers_type(&cifs_fs_type, super_cb, &d);
1056+ iterate_supers_type(&cifs_fs_type, f, &sd);
10551057
1056− if (unlikely(!d.sb))
1057− return ERR_PTR(-ENOENT);
1058+ if (!sd.sb)
1059+ return ERR_PTR(-EINVAL);
10581060 /*
10591061 * Grab an active reference in order to prevent automounts (DFS links)
10601062 * of expiring and then freeing up our cifs superblock pointer while
10611063 * we're doing failover.
10621064 */
1063− cifs_sb_active(d.sb);
1064− return d.sb;
1065+ cifs_sb_active(sd.sb);
1066+ return sd.sb;
10651067 }
10661068
1067−void cifs_put_tcp_super(struct super_block *sb)
1069+static void __cifs_put_super(struct super_block *sb)
10681070 {
10691071 if (!IS_ERR_OR_NULL(sb))
10701072 cifs_sb_deactive(sb);
10711073 }
10721074
1075+struct super_block *cifs_get_tcp_super(struct TCP_Server_Info *server)
1076+{
1077+ return __cifs_get_super(tcp_super_cb, server);
1078+}
1079+
1080+void cifs_put_tcp_super(struct super_block *sb)
1081+{
1082+ __cifs_put_super(sb);
1083+}
1084+
1085+#ifdef CONFIG_CIFS_DFS_UPCALL
1086+static void tcon_super_cb(struct super_block *sb, void *arg)
1087+{
1088+ struct super_cb_data *sd = arg;
1089+ struct cifs_tcon *tcon = sd->data;
1090+ struct cifs_sb_info *cifs_sb;
1091+
1092+ if (sd->sb)
1093+ return;
1094+
1095+ cifs_sb = CIFS_SB(sb);
1096+ if (tcon->dfs_path && cifs_sb->origin_fullpath &&
1097+ !strcasecmp(tcon->dfs_path, cifs_sb->origin_fullpath))
1098+ sd->sb = sb;
1099+}
1100+
1101+static inline struct super_block *cifs_get_tcon_super(struct cifs_tcon *tcon)
1102+{
1103+ return __cifs_get_super(tcon_super_cb, tcon);
1104+}
1105+
1106+static inline void cifs_put_tcon_super(struct super_block *sb)
1107+{
1108+ __cifs_put_super(sb);
1109+}
1110+#else
1111+static inline struct super_block *cifs_get_tcon_super(struct cifs_tcon *tcon)
1112+{
1113+ return ERR_PTR(-EOPNOTSUPP);
1114+}
1115+
1116+static inline void cifs_put_tcon_super(struct super_block *sb)
1117+{
1118+}
1119+#endif
1120+
10731121 int update_super_prepath(struct cifs_tcon *tcon, const char *prefix,
10741122 size_t prefix_len)
10751123 {
@@ -1077,7 +1125,7 @@ int update_super_prepath(struct cifs_tcon *tcon, const char *prefix, · 1 unmodified line
10771125 struct cifs_sb_info *cifs_sb;
10781126 int rc = 0;
10791127
1080− sb = cifs_get_tcp_super(tcon->ses->server);
1128+ sb = cifs_get_tcon_super(tcon);
10811129 if (IS_ERR(sb))
10821130 return PTR_ERR(sb);
10831131
@@ -1099,6 +1147,6 @@ int update_super_prepath(struct cifs_tcon *tcon, const char *prefix, · 15 unmodified lines
10991147 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH;
11001148
11011149 out:
1102− cifs_put_tcp_super(sb);
1150+ cifs_put_tcon_super(sb);
11031151 return rc;
11041152 }
fs/cifs/smb2ops.c+5−0
@@ -687,6 +687,11 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, · 686 unmodified lines
687687 if (smb3_encryption_required(tcon))
688688 flags |= CIFS_TRANSFORM_REQ;
689689
690+ if (!server->ops->new_lease_key)
691+ return -EIO;
692+
693+ server->ops->new_lease_key(pfid);
694+
690695 memset(rqst, 0, sizeof(rqst));
691696 resp_buftype[0] = resp_buftype[1] = CIFS_NO_BUFFER;
692697 memset(rsp_iov, 0, sizeof(rsp_iov));
fs/configfs/dir.c+1−0
@@ -1519,6 +1519,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry) · 1518 unmodified lines
15191519 spin_lock(&configfs_dirent_lock);
15201520 configfs_detach_rollback(dentry);
15211521 spin_unlock(&configfs_dirent_lock);
1522+ config_item_put(parent_item);
15221523 return -EINTR;
15231524 }
15241525 frag->frag_dead = true;
fs/coredump.c+10−0
@@ -211,6 +211,8 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm, · 210 unmodified lines
211211 return -ENOMEM;
212212 (*argv)[(*argc)++] = 0;
213213 ++pat_ptr;
214+ if (!(*pat_ptr))
215+ return -ENOMEM;
214216 }
215217
216218 /* Repeat as long as we have more pattern to process and more output
@@ -786,6 +788,14 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 569 unmodified lines
786788 if (displaced)
787789 put_files_struct(displaced);
788790 if (!dump_interrupted()) {
791+ /*
792+ * umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would
793+ * have this set to NULL.
794+ */
795+ if (!cprm.file) {
796+ pr_info("Core dump to |%s disabled\n", cn.corename);
797+ goto close_fail;
798+ }
789799 file_start_write(cprm.file);
790800 core_dumped = binfmt->core_dump(&cprm);
791801 file_end_write(cprm.file);
fs/debugfs/file.c+3−12
@@ -506,20 +506,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u32_wo, NULL, debugfs_u32_set, "%llu\n"); · 505 unmodified lines
506506 * This function creates a file in debugfs with the given name that
507507 * contains the value of the variable @value. If the @mode variable is so
508508 * set, it can be read from, and written to.
509− *
510− * This function will return a pointer to a dentry if it succeeds. This
511− * pointer must be passed to the debugfs_remove() function when the file is
512− * to be removed (no automatic cleanup happens if your module is unloaded,
513− * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be
514− * returned.
515− *
516− * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will
517− * be returned.
518509 */
519−struct dentry *debugfs_create_u32(const char *name, umode_t mode,
520− struct dentry *parent, u32 *value)
510+void debugfs_create_u32(const char *name, umode_t mode, struct dentry *parent,
511+ u32 *value)
521512 {
522− return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u32,
513+ debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u32,
523514 &fops_u32_ro, &fops_u32_wo);
524515 }
525516 EXPORT_SYMBOL_GPL(debugfs_create_u32);
fs/eventpoll.c+33−28
@@ -1171,6 +1171,10 @@ static inline bool chain_epi_lockless(struct epitem *epi) · 1170 unmodified lines
11711171 {
11721172 struct eventpoll *ep = epi->ep;
11731173
1174+ /* Fast preliminary check */
1175+ if (epi->next != EP_UNACTIVE_PTR)
1176+ return false;
1177+
11741178 /* Check that the same epi has not been just chained from another CPU */
11751179 if (cmpxchg(&epi->next, EP_UNACTIVE_PTR, NULL) != EP_UNACTIVE_PTR)
11761180 return false;
@@ -1237,16 +1241,12 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v · 60 unmodified lines
12371241 * chained in ep->ovflist and requeued later on.
12381242 */
12391243 if (READ_ONCE(ep->ovflist) != EP_UNACTIVE_PTR) {
1240− if (epi->next == EP_UNACTIVE_PTR &&
1241− chain_epi_lockless(epi))
1244+ if (chain_epi_lockless(epi))
1245+ ep_pm_stay_awake_rcu(epi);
1246+ } else if (!ep_is_linked(epi)) {
1247+ /* In the usual case, add event to ready list. */
1248+ if (list_add_tail_lockless(&epi->rdllink, &ep->rdllist))
12421249 ep_pm_stay_awake_rcu(epi);
1243− goto out_unlock;
1244− }
1245−
1246− /* If this file is already in the ready list we exit soon */
1247− if (!ep_is_linked(epi) &&
1248− list_add_tail_lockless(&epi->rdllink, &ep->rdllist)) {
1249− ep_pm_stay_awake_rcu(epi);
12501250 }
12511251
12521252 /*
@@ -1822,7 +1822,6 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, · 569 unmodified lines
18221822 {
18231823 int res = 0, eavail, timed_out = 0;
18241824 u64 slack = 0;
1825− bool waiter = false;
18261825 wait_queue_entry_t wait;
18271826 ktime_t expires, *to = NULL;
18281827
@@ -1867,21 +1866,23 @@ fetch_events: · 38 unmodified lines
18671866 */
18681867 ep_reset_busy_poll_napi_id(ep);
18691868
1870− /*
1871− * We don't have any available event to return to the caller. We need
1872− * to sleep here, and we will be woken by ep_poll_callback() when events
1873− * become available.
1874− */
1875− if (!waiter) {
1876− waiter = true;
1877− init_waitqueue_entry(&wait, current);
1878−
1869+ do {
1870+ /*
1871+ * Internally init_wait() uses autoremove_wake_function(),
1872+ * thus wait entry is removed from the wait queue on each
1873+ * wakeup. Why it is important? In case of several waiters
1874+ * each new wakeup will hit the next waiter, giving it the
1875+ * chance to harvest new event. Otherwise wakeup can be
1876+ * lost. This is also good performance-wise, because on
1877+ * normal wakeup path no need to call __remove_wait_queue()
1878+ * explicitly, thus ep->lock is not taken, which halts the
1879+ * event delivery.
1880+ */
1881+ init_wait(&wait);
18791882 write_lock_irq(&ep->lock);
18801883 __add_wait_queue_exclusive(&ep->wq, &wait);
18811884 write_unlock_irq(&ep->lock);
1882− }
18831885
1884− for (;;) {
18851886 /*
18861887 * We don't want to sleep if the ep_poll_callback() sends us
18871888 * a wakeup in between. That's why we set the task state
@@ -1911,10 +1912,20 @@ fetch_events: · 23 unmodified lines
19111912 timed_out = 1;
19121913 break;
19131914 }
1914− }
1915+
1916+ /* We were woken up, thus go and try to harvest some events */
1917+ eavail = 1;
1918+
1919+ } while (0);
19151920
19161921 __set_current_state(TASK_RUNNING);
19171922
1923+ if (!list_empty_careful(&wait.entry)) {
1924+ write_lock_irq(&ep->lock);
1925+ __remove_wait_queue(&ep->wq, &wait);
1926+ write_unlock_irq(&ep->lock);
1927+ }
1928+
19181929 send_events:
19191930 /*
19201931 * Try to transfer events to user space. In case we get 0 events and
@@ -1925,12 +1936,6 @@ send_events: · 4 unmodified lines
19251936 !(res = ep_send_events(ep, events, maxevents)) && !timed_out)
19261937 goto fetch_events;
19271938
1928− if (waiter) {
1929− write_lock_irq(&ep->lock);
1930− __remove_wait_queue(&ep->wq, &wait);
1931− write_unlock_irq(&ep->lock);
1932− }
1933−
19341939 return res;
19351940 }
19361941
fs/exfat/balloc.c+0−3
@@ -91,7 +91,6 @@ static int exfat_allocate_bitmap(struct super_block *sb, · 90 unmodified lines
9191 }
9292 }
9393
94− sbi->pbr_bh = NULL;
9594 return 0;
9695 }
9796
@@ -137,8 +136,6 @@ void exfat_free_bitmap(struct exfat_sb_info *sbi) · 39 unmodified lines
137136 {
138137 int i;
139138
140− brelse(sbi->pbr_bh);
141−
142139 for (i = 0; i < sbi->map_sectors; i++)
143140 __brelse(sbi->vol_amap[i]);
144141
fs/exfat/exfat_fs.h+1−0
@@ -507,6 +507,7 @@ void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, ...) · 506 unmodified lines
507507 __printf(3, 4) __cold;
508508 void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
509509 u8 tz, __le16 time, __le16 date, u8 time_ms);
510+void exfat_truncate_atime(struct timespec64 *ts);
510511 void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
511512 u8 *tz, __le16 *time, __le16 *date, u8 *time_ms);
512513 unsigned short exfat_calc_chksum_2byte(void *data, int len,
fs/exfat/file.c+2−0
@@ -273,6 +273,7 @@ int exfat_getattr(const struct path *path, struct kstat *stat, · 272 unmodified lines
273273 struct exfat_inode_info *ei = EXFAT_I(inode);
274274
275275 generic_fillattr(inode, stat);
276+ exfat_truncate_atime(&stat->atime);
276277 stat->result_mask |= STATX_BTIME;
277278 stat->btime.tv_sec = ei->i_crtime.tv_sec;
278279 stat->btime.tv_nsec = ei->i_crtime.tv_nsec;
@@ -339,6 +340,7 @@ int exfat_setattr(struct dentry *dentry, struct iattr *attr) · 60 unmodified lines
339340 }
340341
341342 setattr_copy(inode, attr);
343+ exfat_truncate_atime(&inode->i_atime);
342344 mark_inode_dirty(inode);
343345
344346 out:
fs/exfat/misc.c+13−1
@@ -88,7 +88,8 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts, · 87 unmodified lines
8888 if (time_ms) {
8989 ts->tv_sec += time_ms / 100;
9090 ts->tv_nsec = (time_ms % 100) * 10 * NSEC_PER_MSEC;
91− }
91+ } else
92+ ts->tv_nsec = 0;
9293
9394 if (tz & EXFAT_TZ_VALID)
9495 /* Adjust timezone to UTC0. */
@@ -124,6 +125,17 @@ void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts, · 29 unmodified lines
124125 *tz = EXFAT_TZ_VALID;
125126 }
126127
128+/*
129+ * The timestamp for access_time has double seconds granularity.
130+ * (There is no 10msIncrement field for access_time unlike create/modify_time)
131+ * atime also has only a 2-second resolution.
132+ */
133+void exfat_truncate_atime(struct timespec64 *ts)
134+{
135+ ts->tv_sec = round_down(ts->tv_sec, 2);
136+ ts->tv_nsec = 0;
137+}
138+
127139 unsigned short exfat_calc_chksum_2byte(void *data, int len,
128140 unsigned short chksum, int type)
129141 {
fs/exfat/namei.c+7−0
@@ -595,6 +595,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, · 594 unmodified lines
595595 inode_inc_iversion(inode);
596596 inode->i_mtime = inode->i_atime = inode->i_ctime =
597597 EXFAT_I(inode)->i_crtime = current_time(inode);
598+ exfat_truncate_atime(&inode->i_atime);
598599 /* timestamp is already written, so mark_inode_dirty() is unneeded. */
599600
600601 d_instantiate(dentry, inode);
@@ -854,6 +855,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) · 253 unmodified lines
854855
855856 inode_inc_iversion(dir);
856857 dir->i_mtime = dir->i_atime = current_time(dir);
858+ exfat_truncate_atime(&dir->i_atime);
857859 if (IS_DIRSYNC(dir))
858860 exfat_sync_inode(dir);
859861 else
@@ -861,6 +863,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) · 1 unmodified line
861863
862864 clear_nlink(inode);
863865 inode->i_mtime = inode->i_atime = current_time(inode);
866+ exfat_truncate_atime(&inode->i_atime);
864867 exfat_unhash_inode(inode);
865868 exfat_d_version_set(dentry, inode_query_iversion(dir));
866869 unlock:
@@ -903,6 +906,7 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) · 36 unmodified lines
903906 inode_inc_iversion(inode);
904907 inode->i_mtime = inode->i_atime = inode->i_ctime =
905908 EXFAT_I(inode)->i_crtime = current_time(inode);
909+ exfat_truncate_atime(&inode->i_atime);
906910 /* timestamp is already written, so mark_inode_dirty() is unneeded. */
907911
908912 d_instantiate(dentry, inode);
@@ -1019,6 +1023,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) · 110 unmodified lines
10191023
10201024 inode_inc_iversion(dir);
10211025 dir->i_mtime = dir->i_atime = current_time(dir);
1026+ exfat_truncate_atime(&dir->i_atime);
10221027 if (IS_DIRSYNC(dir))
10231028 exfat_sync_inode(dir);
10241029 else
@@ -1027,6 +1032,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) · 2 unmodified lines
10271032
10281033 clear_nlink(inode);
10291034 inode->i_mtime = inode->i_atime = current_time(inode);
1035+ exfat_truncate_atime(&inode->i_atime);
10301036 exfat_unhash_inode(inode);
10311037 exfat_d_version_set(dentry, inode_query_iversion(dir));
10321038 unlock:
@@ -1387,6 +1393,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry, · 354 unmodified lines
13871393 inode_inc_iversion(new_dir);
13881394 new_dir->i_ctime = new_dir->i_mtime = new_dir->i_atime =
13891395 EXFAT_I(new_dir)->i_crtime = current_time(new_dir);
1396+ exfat_truncate_atime(&new_dir->i_atime);
13901397 if (IS_DIRSYNC(new_dir))
13911398 exfat_sync_inode(new_dir);
13921399 else
fs/exfat/super.c+22−31
@@ -49,6 +49,7 @@ static void exfat_put_super(struct super_block *sb) · 48 unmodified lines
4949 sync_blockdev(sb->s_bdev);
5050 exfat_set_vol_flags(sb, VOL_CLEAN);
5151 exfat_free_bitmap(sbi);
52+ brelse(sbi->pbr_bh);
5253 mutex_unlock(&sbi->s_lock);
5354
5455 call_rcu(&sbi->rcu, exfat_delayed_free);
@@ -100,7 +101,7 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf) · 45 unmodified lines
100101 int exfat_set_vol_flags(struct super_block *sb, unsigned short new_flag)
101102 {
102103 struct exfat_sb_info *sbi = EXFAT_SB(sb);
103− struct pbr64 *bpb;
104+ struct pbr64 *bpb = (struct pbr64 *)sbi->pbr_bh->b_data;
104105 bool sync = 0;
105106
106107 /* flags are not changed */
@@ -115,15 +116,6 @@ int exfat_set_vol_flags(struct super_block *sb, unsigned short new_flag) · 8 unmodified lines
115116 if (sb_rdonly(sb))
116117 return 0;
117118
118− if (!sbi->pbr_bh) {
119− sbi->pbr_bh = sb_bread(sb, 0);
120− if (!sbi->pbr_bh) {
121− exfat_msg(sb, KERN_ERR, "failed to read boot sector");
122− return -ENOMEM;
123− }
124− }
125−
126− bpb = (struct pbr64 *)sbi->pbr_bh->b_data;
127119 bpb->bsx.vol_flags = cpu_to_le16(new_flag);
128120
129121 if (new_flag == VOL_DIRTY && !buffer_dirty(sbi->pbr_bh))
@@ -159,7 +151,6 @@ static int exfat_show_options(struct seq_file *m, struct dentry *root) · 29 unmodified lines
159151 seq_puts(m, ",iocharset=utf8");
160152 else if (sbi->nls_io)
161153 seq_printf(m, ",iocharset=%s", sbi->nls_io->charset);
162− seq_printf(m, ",bps=%ld", sb->s_blocksize);
163154 if (opts->errors == EXFAT_ERRORS_CONT)
164155 seq_puts(m, ",errors=continue");
165156 else if (opts->errors == EXFAT_ERRORS_PANIC)
@@ -351,14 +342,15 @@ static int exfat_read_root(struct inode *inode) · 185 unmodified lines
351342 exfat_save_attr(inode, ATTR_SUBDIR);
352343 inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime =
353344 current_time(inode);
345+ exfat_truncate_atime(&inode->i_atime);
354346 exfat_cache_init_inode(inode);
355347 return 0;
356348 }
357349
358−static struct pbr *exfat_read_pbr_with_logical_sector(struct super_block *sb,
359− struct buffer_head **prev_bh)
350+static struct pbr *exfat_read_pbr_with_logical_sector(struct super_block *sb)
360351 {
361− struct pbr *p_pbr = (struct pbr *) (*prev_bh)->b_data;
352+ struct exfat_sb_info *sbi = EXFAT_SB(sb);
353+ struct pbr *p_pbr = (struct pbr *) (sbi->pbr_bh)->b_data;
362354 unsigned short logical_sect = 0;
363355
364356 logical_sect = 1 << p_pbr->bsx.f64.sect_size_bits;
@@ -378,26 +370,23 @@ static struct pbr *exfat_read_pbr_with_logical_sector(struct super_block *sb, · 13 unmodified lines
378370 }
379371
380372 if (logical_sect > sb->s_blocksize) {
381− struct buffer_head *bh = NULL;
382−
383− __brelse(*prev_bh);
384− *prev_bh = NULL;
373+ brelse(sbi->pbr_bh);
374+ sbi->pbr_bh = NULL;
385375
386376 if (!sb_set_blocksize(sb, logical_sect)) {
387377 exfat_msg(sb, KERN_ERR,
388378 "unable to set blocksize %u", logical_sect);
389379 return NULL;
390380 }
391− bh = sb_bread(sb, 0);
392− if (!bh) {
381+ sbi->pbr_bh = sb_bread(sb, 0);
382+ if (!sbi->pbr_bh) {
393383 exfat_msg(sb, KERN_ERR,
394384 "unable to read boot sector (logical sector size = %lu)",
395385 sb->s_blocksize);
396386 return NULL;
397387 }
398388
399− *prev_bh = bh;
400− p_pbr = (struct pbr *) bh->b_data;
389+ p_pbr = (struct pbr *)sbi->pbr_bh->b_data;
401390 }
402391 return p_pbr;
403392 }
@@ -408,21 +397,20 @@ static int __exfat_fill_super(struct super_block *sb) · 4 unmodified lines
408397 int ret;
409398 struct pbr *p_pbr;
410399 struct pbr64 *p_bpb;
411− struct buffer_head *bh;
412400 struct exfat_sb_info *sbi = EXFAT_SB(sb);
413401
414402 /* set block size to read super block */
415403 sb_min_blocksize(sb, 512);
416404
417405 /* read boot sector */
418− bh = sb_bread(sb, 0);
419− if (!bh) {
406+ sbi->pbr_bh = sb_bread(sb, 0);
407+ if (!sbi->pbr_bh) {
420408 exfat_msg(sb, KERN_ERR, "unable to read boot sector");
421409 return -EIO;
422410 }
423411
424412 /* PRB is read */
425− p_pbr = (struct pbr *)bh->b_data;
413+ p_pbr = (struct pbr *)sbi->pbr_bh->b_data;
426414
427415 /* check the validity of PBR */
428416 if (le16_to_cpu((p_pbr->signature)) != PBR_SIGNATURE) {
@@ -433,7 +421,7 @@ static int __exfat_fill_super(struct super_block *sb) · 4 unmodified lines
433421
434422
435423 /* check logical sector size */
436− p_pbr = exfat_read_pbr_with_logical_sector(sb, &bh);
424+ p_pbr = exfat_read_pbr_with_logical_sector(sb);
437425 if (!p_pbr) {
438426 ret = -EIO;
439427 goto free_bh;
@@ -514,7 +502,7 @@ free_alloc_bitmap: · 74 unmodified lines
514502 free_upcase_table:
515503 exfat_free_upcase_table(sbi);
516504 free_bh:
517− brelse(bh);
505+ brelse(sbi->pbr_bh);
518506 return ret;
519507 }
520508
@@ -531,17 +519,18 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc) · 10 unmodified lines
531519 if (opts->discard) {
532520 struct request_queue *q = bdev_get_queue(sb->s_bdev);
533521
534− if (!blk_queue_discard(q))
522+ if (!blk_queue_discard(q)) {
535523 exfat_msg(sb, KERN_WARNING,
536524 "mounting with \"discard\" option, but the device does not support discard");
537− opts->discard = 0;
525+ opts->discard = 0;
526+ }
538527 }
539528
540529 sb->s_flags |= SB_NODIRATIME;
541530 sb->s_magic = EXFAT_SUPER_MAGIC;
542531 sb->s_op = &exfat_sops;
543532
544− sb->s_time_gran = 1;
533+ sb->s_time_gran = 10 * NSEC_PER_MSEC;
545534 sb->s_time_min = EXFAT_MIN_TIMESTAMP_SECS;
546535 sb->s_time_max = EXFAT_MAX_TIMESTAMP_SECS;
547536
@@ -605,6 +594,7 @@ put_inode: · 57 unmodified lines
605594 free_table:
606595 exfat_free_upcase_table(sbi);
607596 exfat_free_bitmap(sbi);
597+ brelse(sbi->pbr_bh);
608598
609599 check_nls_io:
610600 unload_nls(sbi->nls_io);
@@ -717,6 +707,7 @@ static void __exit exit_exfat_fs(void) · 106 unmodified lines
717707 module_init(init_exfat_fs);
718708 module_exit(exit_exfat_fs);
719709
710+MODULE_ALIAS_FS("exfat");
720711 MODULE_LICENSE("GPL");
721712 MODULE_DESCRIPTION("exFAT filesystem support");
722713 MODULE_AUTHOR("Samsung Electronics Co., Ltd.");
fs/io_uring.c+58−75
@@ -524,6 +524,7 @@ enum { · 523 unmodified lines
524524 REQ_F_OVERFLOW_BIT,
525525 REQ_F_POLLED_BIT,
526526 REQ_F_BUFFER_SELECTED_BIT,
527+ REQ_F_NO_FILE_TABLE_BIT,
527528
528529 /* not a real bit, just to check we're not overflowing the space */
529530 __REQ_F_LAST_BIT,
@@ -577,6 +578,8 @@ enum { · 47 unmodified lines
577578 REQ_F_POLLED = BIT(REQ_F_POLLED_BIT),
578579 /* buffer already selected */
579580 REQ_F_BUFFER_SELECTED = BIT(REQ_F_BUFFER_SELECTED_BIT),
581+ /* doesn't need file table for this request */
582+ REQ_F_NO_FILE_TABLE = BIT(REQ_F_NO_FILE_TABLE_BIT),
580583 };
581584
582585 struct async_poll {
@@ -677,8 +680,6 @@ struct io_op_def { · 94 unmodified lines
677680 unsigned needs_mm : 1;
678681 /* needs req->file assigned */
679682 unsigned needs_file : 1;
680− /* needs req->file assigned IFF fd is >= 0 */
681− unsigned fd_non_neg : 1;
682683 /* hash wq insertion if file is a regular file */
683684 unsigned hash_reg_file : 1;
684685 /* unbound wq insertion if file is a non-regular file */
@@ -781,8 +782,6 @@ static const struct io_op_def io_op_defs[] = { · 96 unmodified lines
781782 .needs_file = 1,
782783 },
783784 [IORING_OP_OPENAT] = {
784− .needs_file = 1,
785− .fd_non_neg = 1,
786785 .file_table = 1,
787786 .needs_fs = 1,
788787 },
@@ -796,9 +795,8 @@ static const struct io_op_def io_op_defs[] = { · 7 unmodified lines
796795 },
797796 [IORING_OP_STATX] = {
798797 .needs_mm = 1,
799− .needs_file = 1,
800− .fd_non_neg = 1,
801798 .needs_fs = 1,
799+ .file_table = 1,
802800 },
803801 [IORING_OP_READ] = {
804802 .needs_mm = 1,
@@ -833,8 +831,6 @@ static const struct io_op_def io_op_defs[] = { · 28 unmodified lines
833831 .buffer_select = 1,
834832 },
835833 [IORING_OP_OPENAT2] = {
836− .needs_file = 1,
837− .fd_non_neg = 1,
838834 .file_table = 1,
839835 .needs_fs = 1,
840836 },
@@ -1291,7 +1287,7 @@ static struct io_kiocb *io_get_fallback_req(struct io_ring_ctx *ctx) · 450 unmodified lines
12911287 struct io_kiocb *req;
12921288
12931289 req = ctx->fallback_req;
1294− if (!test_and_set_bit_lock(0, (unsigned long *) ctx->fallback_req))
1290+ if (!test_and_set_bit_lock(0, (unsigned long *) &ctx->fallback_req))
12951291 return req;
12961292
12971293 return NULL;
@@ -1378,7 +1374,7 @@ static void __io_free_req(struct io_kiocb *req) · 80 unmodified lines
13781374 if (likely(!io_is_fallback_req(req)))
13791375 kmem_cache_free(req_cachep, req);
13801376 else
1381− clear_bit_unlock(0, (unsigned long *) req->ctx->fallback_req);
1377+ clear_bit_unlock(0, (unsigned long *) &req->ctx->fallback_req);
13821378 }
13831379
13841380 struct req_batch {
@@ -2034,7 +2030,7 @@ static struct file *__io_file_get(struct io_submit_state *state, int fd) · 649 unmodified lines
20342030 * any file. For now, just ensure that anything potentially problematic is done
20352031 * inline.
20362032 */
2037−static bool io_file_supports_async(struct file *file)
2033+static bool io_file_supports_async(struct file *file, int rw)
20382034 {
20392035 umode_t mode = file_inode(file)->i_mode;
20402036
@@ -2043,7 +2039,13 @@ static bool io_file_supports_async(struct file *file) · 2 unmodified lines
20432039 if (S_ISREG(mode) && file->f_op != &io_uring_fops)
20442040 return true;
20452041
2046− return false;
2042+ if (!(file->f_mode & FMODE_NOWAIT))
2043+ return false;
2044+
2045+ if (rw == READ)
2046+ return file->f_op->read_iter != NULL;
2047+
2048+ return file->f_op->write_iter != NULL;
20472049 }
20482050
20492051 static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
@@ -2571,7 +2573,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) · 521 unmodified lines
25712573 * If the file doesn't support async, mark it as REQ_F_MUST_PUNT so
25722574 * we know to async punt it even if it was opened O_NONBLOCK
25732575 */
2574− if (force_nonblock && !io_file_supports_async(req->file))
2576+ if (force_nonblock && !io_file_supports_async(req->file, READ))
25752577 goto copy_iov;
25762578
25772579 iov_count = iov_iter_count(&iter);
@@ -2594,7 +2596,8 @@ copy_iov: · 16 unmodified lines
25942596 if (ret)
25952597 goto out_free;
25962598 /* any defer here is final, must blocking retry */
2597− if (!(req->flags & REQ_F_NOWAIT))
2599+ if (!(req->flags & REQ_F_NOWAIT) &&
2600+ !file_can_poll(req->file))
25982601 req->flags |= REQ_F_MUST_PUNT;
25992602 return -EAGAIN;
26002603 }
@@ -2662,7 +2665,7 @@ static int io_write(struct io_kiocb *req, bool force_nonblock) · 61 unmodified lines
26622665 * If the file doesn't support async, mark it as REQ_F_MUST_PUNT so
26632666 * we know to async punt it even if it was opened O_NONBLOCK
26642667 */
2665− if (force_nonblock && !io_file_supports_async(req->file))
2668+ if (force_nonblock && !io_file_supports_async(req->file, WRITE))
26662669 goto copy_iov;
26672670
26682671 /* file path doesn't support NOWAIT for non-direct_IO */
@@ -2716,7 +2719,8 @@ copy_iov: · 47 unmodified lines
27162719 if (ret)
27172720 goto out_free;
27182721 /* any defer here is final, must blocking retry */
2719− req->flags |= REQ_F_MUST_PUNT;
2722+ if (!file_can_poll(req->file))
2723+ req->flags |= REQ_F_MUST_PUNT;
27202724 return -EAGAIN;
27212725 }
27222726 }
@@ -2756,15 +2760,6 @@ static int io_splice_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) · 33 unmodified lines
27562760 return 0;
27572761 }
27582762
2759−static bool io_splice_punt(struct file *file)
2760−{
2761− if (get_pipe_info(file))
2762− return false;
2763− if (!io_file_supports_async(file))
2764− return true;
2765− return !(file->f_flags & O_NONBLOCK);
2766−}
2767−
27682763 static int io_splice(struct io_kiocb *req, bool force_nonblock)
27692764 {
27702765 struct io_splice *sp = &req->splice;
@@ -2774,11 +2769,8 @@ static int io_splice(struct io_kiocb *req, bool force_nonblock) · 3 unmodified lines
27742769 loff_t *poff_in, *poff_out;
27752770 long ret;
27762771
2777− if (force_nonblock) {
2778− if (io_splice_punt(in) || io_splice_punt(out))
2779− return -EAGAIN;
2780− flags |= SPLICE_F_NONBLOCK;
2781− }
2772+ if (force_nonblock)
2773+ return -EAGAIN;
27822774
27832775 poff_in = (sp->off_in == -1) ? NULL : &sp->off_in;
27842776 poff_out = (sp->off_out == -1) ? NULL : &sp->off_out;
@@ -3355,8 +3347,12 @@ static int io_statx(struct io_kiocb *req, bool force_nonblock) · 570 unmodified lines
33553347 struct kstat stat;
33563348 int ret;
33573349
3358− if (force_nonblock)
3350+ if (force_nonblock) {
3351+ /* only need file table for an actual valid fd */
3352+ if (ctx->dfd == -1 || ctx->dfd == AT_FDCWD)
3353+ req->flags |= REQ_F_NO_FILE_TABLE;
33593354 return -EAGAIN;
3355+ }
33603356
33613357 if (vfs_stat_set_lookup_flags(&lookup_flags, ctx->how.flags))
33623358 return -EINVAL;
@@ -3502,7 +3498,7 @@ static void io_sync_file_range_finish(struct io_wq_work **workptr) · 139 unmodified lines
35023498 if (io_req_cancelled(req))
35033499 return;
35043500 __io_sync_file_range(req);
3505− io_put_req(req); /* put submission ref */
3501+ io_steal_work(req, workptr);
35063502 }
35073503
35083504 static int io_sync_file_range(struct io_kiocb *req, bool force_nonblock)
@@ -4200,17 +4196,17 @@ static void io_async_task_func(struct callback_head *cb) · 691 unmodified lines
42004196
42014197 spin_unlock_irq(&ctx->completion_lock);
42024198
4199+ /* restore ->work in case we need to retry again */
4200+ memcpy(&req->work, &apoll->work, sizeof(req->work));
4201+
42034202 if (canceled) {
42044203 kfree(apoll);
42054204 io_cqring_ev_posted(ctx);
42064205 req_set_fail_links(req);
4207− io_put_req(req);
4206+ io_double_put_req(req);
42084207 return;
42094208 }
42104209
4211− /* restore ->work in case we need to retry again */
4212− memcpy(&req->work, &apoll->work, sizeof(req->work));
4213−
42144210 __set_current_state(TASK_RUNNING);
42154211 mutex_lock(&ctx->uring_lock);
42164212 __io_queue_sqe(req, NULL);
@@ -4369,7 +4365,7 @@ static bool io_poll_remove_one(struct io_kiocb *req) · 152 unmodified lines
43694365
43704366 hash_del(&req->hash_node);
43714367
4372− if (apoll) {
4368+ if (do_complete && apoll) {
43734369 /*
43744370 * restore ->work because we need to call io_req_work_drop_env.
43754371 */
@@ -5015,7 +5011,7 @@ static int io_req_defer(struct io_kiocb *req, const struct io_uring_sqe *sqe) · 639 unmodified lines
50155011 int ret;
50165012
50175013 /* Still need defer if there is pending req in defer list. */
5018− if (!req_need_defer(req) && list_empty(&ctx->defer_list))
5014+ if (!req_need_defer(req) && list_empty_careful(&ctx->defer_list))
50195015 return 0;
50205016
50215017 if (!req->io && io_alloc_async_ctx(req))
@@ -5364,15 +5360,6 @@ static void io_wq_submit_work(struct io_wq_work **workptr) · 342 unmodified lines
53645360 io_steal_work(req, workptr);
53655361 }
53665362
5367−static int io_req_needs_file(struct io_kiocb *req, int fd)
5368−{
5369− if (!io_op_defs[req->opcode].needs_file)
5370− return 0;
5371− if ((fd == -1 || fd == AT_FDCWD) && io_op_defs[req->opcode].fd_non_neg)
5372− return 0;
5373− return 1;
5374−}
5375−
53765363 static inline struct file *io_file_from_index(struct io_ring_ctx *ctx,
53775364 int index)
53785365 {
@@ -5410,14 +5397,11 @@ static int io_file_get(struct io_submit_state *state, struct io_kiocb *req, · 31 unmodified lines
54105397 }
54115398
54125399 static int io_req_set_file(struct io_submit_state *state, struct io_kiocb *req,
5413− int fd, unsigned int flags)
5400+ int fd)
54145401 {
54155402 bool fixed;
54165403
5417− if (!io_req_needs_file(req, fd))
5418− return 0;
5419−
5420− fixed = (flags & IOSQE_FIXED_FILE);
5404+ fixed = (req->flags & REQ_F_FIXED_FILE) != 0;
54215405 if (unlikely(!fixed && req->needs_fixed_file))
54225406 return -EBADF;
54235407
@@ -5429,7 +5413,7 @@ static int io_grab_files(struct io_kiocb *req) · 5 unmodified lines
54295413 int ret = -EBADF;
54305414 struct io_ring_ctx *ctx = req->ctx;
54315415
5432− if (req->work.files)
5416+ if (req->work.files || (req->flags & REQ_F_NO_FILE_TABLE))
54335417 return 0;
54345418 if (!ctx->ring_file)
54355419 return -EBADF;
@@ -5794,7 +5778,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, · 358 unmodified lines
57945778 struct io_submit_state *state, bool async)
57955779 {
57965780 unsigned int sqe_flags;
5797− int id, fd;
5781+ int id;
57985782
57995783 /*
58005784 * All io need record the previous position, if LINK vs DARIN,
@@ -5846,8 +5830,10 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, · 45 unmodified lines
58465830 IOSQE_ASYNC | IOSQE_FIXED_FILE |
58475831 IOSQE_BUFFER_SELECT | IOSQE_IO_LINK);
58485832
5849− fd = READ_ONCE(sqe->fd);
5850− return io_req_set_file(state, req, fd, sqe_flags);
5833+ if (!io_op_defs[req->opcode].needs_file)
5834+ return 0;
5835+
5836+ return io_req_set_file(state, req, READ_ONCE(sqe->fd));
58515837 }
58525838
58535839 static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr,
@@ -7327,7 +7313,7 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx) · 1473 unmodified lines
73277313 * it could cause shutdown to hang.
73287314 */
73297315 while (ctx->sqo_thread && !wq_has_sleeper(&ctx->sqo_wait))
7330− cpu_relax();
7316+ cond_resched();
73317317
73327318 io_kill_timeouts(ctx);
73337319 io_poll_remove_all(ctx);
@@ -7356,11 +7342,9 @@ static int io_uring_release(struct inode *inode, struct file *file) · 22 unmodified lines
73567342 static void io_uring_cancel_files(struct io_ring_ctx *ctx,
73577343 struct files_struct *files)
73587344 {
7359− struct io_kiocb *req;
7360− DEFINE_WAIT(wait);
7361−
73627345 while (!list_empty_careful(&ctx->inflight_list)) {
7363− struct io_kiocb *cancel_req = NULL;
7346+ struct io_kiocb *cancel_req = NULL, *req;
7347+ DEFINE_WAIT(wait);
73647348
73657349 spin_lock_irq(&ctx->inflight_lock);
73667350 list_for_each_entry(req, &ctx->inflight_list, inflight_entry) {
@@ -7400,6 +7384,7 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx, · 33 unmodified lines
74007384 */
74017385 if (refcount_sub_and_test(2, &cancel_req->refs)) {
74027386 io_put_req(cancel_req);
7387+ finish_wait(&ctx->inflight_wait, &wait);
74037388 continue;
74047389 }
74057390 }
@@ -7407,8 +7392,8 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx, · 1 unmodified line
74077392 io_wq_cancel_work(ctx->io_wq, &cancel_req->work);
74087393 io_put_req(cancel_req);
74097394 schedule();
7395+ finish_wait(&ctx->inflight_wait, &wait);
74107396 }
7411− finish_wait(&ctx->inflight_wait, &wait);
74127397 }
74137398
74147399 static int io_uring_flush(struct file *file, void *data)
@@ -7757,7 +7742,8 @@ err: · 342 unmodified lines
77577742 return ret;
77587743 }
77597744
7760−static int io_uring_create(unsigned entries, struct io_uring_params *p)
7745+static int io_uring_create(unsigned entries, struct io_uring_params *p,
7746+ struct io_uring_params __user *params)
77617747 {
77627748 struct user_struct *user = NULL;
77637749 struct io_ring_ctx *ctx;
@@ -7849,6 +7835,14 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p) · 85 unmodified lines
78497835 p->cq_off.overflow = offsetof(struct io_rings, cq_overflow);
78507836 p->cq_off.cqes = offsetof(struct io_rings, cqes);
78517837
7838+ p->features = IORING_FEAT_SINGLE_MMAP | IORING_FEAT_NODROP |
7839+ IORING_FEAT_SUBMIT_STABLE | IORING_FEAT_RW_CUR_POS |
7840+ IORING_FEAT_CUR_PERSONALITY | IORING_FEAT_FAST_POLL;
7841+
7842+ if (copy_to_user(params, p, sizeof(*p))) {
7843+ ret = -EFAULT;
7844+ goto err;
7845+ }
78527846 /*
78537847 * Install ring fd as the very last thing, so we don't risk someone
78547848 * having closed it before we finish setup
@@ -7857,9 +7851,6 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p) · 2 unmodified lines
78577851 if (ret < 0)
78587852 goto err;
78597853
7860− p->features = IORING_FEAT_SINGLE_MMAP | IORING_FEAT_NODROP |
7861− IORING_FEAT_SUBMIT_STABLE | IORING_FEAT_RW_CUR_POS |
7862− IORING_FEAT_CUR_PERSONALITY | IORING_FEAT_FAST_POLL;
78637854 trace_io_uring_create(ret, ctx, p->sq_entries, p->cq_entries, p->flags);
78647855 return ret;
78657856 err:
@@ -7875,7 +7866,6 @@ err: · 9 unmodified lines
78757866 static long io_uring_setup(u32 entries, struct io_uring_params __user *params)
78767867 {
78777868 struct io_uring_params p;
7878− long ret;
78797869 int i;
78807870
78817871 if (copy_from_user(&p, params, sizeof(p)))
@@ -7890,14 +7880,7 @@ static long io_uring_setup(u32 entries, struct io_uring_params __user *params) · 8 unmodified lines
78907880 IORING_SETUP_CLAMP | IORING_SETUP_ATTACH_WQ))
78917881 return -EINVAL;
78927882
7893− ret = io_uring_create(entries, &p);
7894− if (ret < 0)
7895− return ret;
7896−
7897− if (copy_to_user(params, &p, sizeof(p)))
7898− return -EFAULT;
7899−
7900− return ret;
7883+ return io_uring_create(entries, &p, params);
79017884 }
79027885
79037886 SYSCALL_DEFINE2(io_uring_setup, u32, entries,
fs/ioctl.c+8−0
@@ -55,6 +55,7 @@ EXPORT_SYMBOL(vfs_ioctl); · 54 unmodified lines
5555 static int ioctl_fibmap(struct file *filp, int __user *p)
5656 {
5757 struct inode *inode = file_inode(filp);
58+ struct super_block *sb = inode->i_sb;
5859 int error, ur_block;
5960 sector_t block;
6061
@@ -71,6 +72,13 @@ static int ioctl_fibmap(struct file *filp, int __user *p) · 10 unmodified lines
7172 block = ur_block;
7273 error = bmap(inode, &block);
7374
75+ if (block > INT_MAX) {
76+ error = -ERANGE;
77+ pr_warn_ratelimited("[%s/%d] FS: %s File: %pD4 would truncate fibmap result\n",
78+ current->comm, task_pid_nr(current),
79+ sb->s_id, filp);
80+ }
81+
7482 if (error)
7583 ur_block = 0;
7684 else
fs/iomap/fiemap.c+1−4
@@ -117,10 +117,7 @@ iomap_bmap_actor(struct inode *inode, loff_t pos, loff_t length, · 116 unmodified lines
117117
118118 if (iomap->type == IOMAP_MAPPED) {
119119 addr = (pos - iomap->offset + iomap->addr) >> inode->i_blkbits;
120− if (addr > INT_MAX)
121− WARN(1, "would truncate bmap result\n");
122− else
123− *bno = addr;
120+ *bno = addr;
124121 }
125122 return 0;
126123 }
fs/nfs/nfs3acl.c+15−7
@@ -253,37 +253,45 @@ int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, · 252 unmodified lines
253253
254254 int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type)
255255 {
256− struct posix_acl *alloc = NULL, *dfacl = NULL;
256+ struct posix_acl *orig = acl, *dfacl = NULL, *alloc;
257257 int status;
258258
259259 if (S_ISDIR(inode->i_mode)) {
260260 switch(type) {
261261 case ACL_TYPE_ACCESS:
262− alloc = dfacl = get_acl(inode, ACL_TYPE_DEFAULT);
262+ alloc = get_acl(inode, ACL_TYPE_DEFAULT);
263263 if (IS_ERR(alloc))
264264 goto fail;
265+ dfacl = alloc;
265266 break;
266267
267268 case ACL_TYPE_DEFAULT:
268− dfacl = acl;
269− alloc = acl = get_acl(inode, ACL_TYPE_ACCESS);
269+ alloc = get_acl(inode, ACL_TYPE_ACCESS);
270270 if (IS_ERR(alloc))
271271 goto fail;
272+ dfacl = acl;
273+ acl = alloc;
272274 break;
273275 }
274276 }
275277
276278 if (acl == NULL) {
277− alloc = acl = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
279+ alloc = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
278280 if (IS_ERR(alloc))
279281 goto fail;
282+ acl = alloc;
280283 }
281284 status = __nfs3_proc_setacls(inode, acl, dfacl);
282− posix_acl_release(alloc);
285+out:
286+ if (acl != orig)
287+ posix_acl_release(acl);
288+ if (dfacl != orig)
289+ posix_acl_release(dfacl);
283290 return status;
284291
285292 fail:
286− return PTR_ERR(alloc);
293+ status = PTR_ERR(alloc);
294+ goto out;
287295 }
288296
289297 const struct xattr_handler *nfs3_xattr_handlers[] = {
fs/nfs/nfs4proc.c+9−2
@@ -7891,6 +7891,7 @@ static void · 7890 unmodified lines
78917891 nfs4_bind_one_conn_to_session_done(struct rpc_task *task, void *calldata)
78927892 {
78937893 struct nfs41_bind_conn_to_session_args *args = task->tk_msg.rpc_argp;
7894+ struct nfs41_bind_conn_to_session_res *res = task->tk_msg.rpc_resp;
78947895 struct nfs_client *clp = args->client;
78957896
78967897 switch (task->tk_status) {
@@ -7899,6 +7900,12 @@ nfs4_bind_one_conn_to_session_done(struct rpc_task *task, void *calldata) · 2 unmodified lines
78997900 nfs4_schedule_session_recovery(clp->cl_session,
79007901 task->tk_status);
79017902 }
7903+ if (args->dir == NFS4_CDFC4_FORE_OR_BOTH &&
7904+ res->dir != NFS4_CDFS4_BOTH) {
7905+ rpc_task_close_connection(task);
7906+ if (args->retries++ < MAX_BIND_CONN_TO_SESSION_RETRIES)
7907+ rpc_restart_call(task);
7908+ }
79027909 }
79037910
79047911 static const struct rpc_call_ops nfs4_bind_one_conn_to_session_ops = {
@@ -7921,6 +7928,7 @@ int nfs4_proc_bind_one_conn_to_session(struct rpc_clnt *clnt, · 16 unmodified lines
79217928 struct nfs41_bind_conn_to_session_args args = {
79227929 .client = clp,
79237930 .dir = NFS4_CDFC4_FORE_OR_BOTH,
7931+ .retries = 0,
79247932 };
79257933 struct nfs41_bind_conn_to_session_res res;
79267934 struct rpc_message msg = {
@@ -9191,8 +9199,7 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) · 1264 unmodified lines
91919199 nfs4_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0, 0);
91929200
91939201 task = rpc_run_task(&task_setup_data);
9194− if (IS_ERR(task))
9195− return ERR_CAST(task);
9202+
91969203 status = rpc_wait_for_completion_task(task);
91979204 if (status != 0)
91989205 goto out;
fs/nfs/pnfs.c+5−6
@@ -1332,13 +1332,15 @@ _pnfs_return_layout(struct inode *ino) · 1331 unmodified lines
13321332 !valid_layout) {
13331333 spin_unlock(&ino->i_lock);
13341334 dprintk("NFS: %s no layout segments to return\n", __func__);
1335− goto out_put_layout_hdr;
1335+ goto out_wait_layoutreturn;
13361336 }
13371337
13381338 send = pnfs_prepare_layoutreturn(lo, &stateid, &cred, NULL);
13391339 spin_unlock(&ino->i_lock);
13401340 if (send)
13411341 status = pnfs_send_layoutreturn(lo, &stateid, &cred, IOMODE_ANY, true);
1342+out_wait_layoutreturn:
1343+ wait_on_bit(&lo->plh_flags, NFS_LAYOUT_RETURN, TASK_UNINTERRUPTIBLE);
13421344 out_put_layout_hdr:
13431345 pnfs_free_lseg_list(&tmp_list);
13441346 pnfs_put_layout_hdr(lo);
@@ -1456,18 +1458,15 @@ retry: · 111 unmodified lines
14561458 /* lo ref dropped in pnfs_roc_release() */
14571459 layoutreturn = pnfs_prepare_layoutreturn(lo, &stateid, &lc_cred, &iomode);
14581460 /* If the creds don't match, we can't compound the layoutreturn */
1459− if (!layoutreturn)
1461+ if (!layoutreturn || cred_fscmp(cred, lc_cred) != 0)
14601462 goto out_noroc;
1461− if (cred_fscmp(cred, lc_cred) != 0)
1462− goto out_noroc_put_cred;
14631463
14641464 roc = layoutreturn;
14651465 pnfs_init_layoutreturn_args(args, lo, &stateid, iomode);
14661466 res->lrs_present = 0;
14671467 layoutreturn = false;
1468−
1469−out_noroc_put_cred:
14701468 put_cred(lc_cred);
1469+
14711470 out_noroc:
14721471 spin_unlock(&ino->i_lock);
14731472 rcu_read_unlock();
fs/nfs/super.c+1−1
@@ -185,7 +185,7 @@ static int __nfs_list_for_each_server(struct list_head *head, · 184 unmodified lines
185185
186186 rcu_read_lock();
187187 list_for_each_entry_rcu(server, head, client_link) {
188− if (!nfs_sb_active(server->super))
188+ if (!(server->super && nfs_sb_active(server->super)))
189189 continue;
190190 rcu_read_unlock();
191191 if (last)
fs/nfsd/nfs4callback.c+3−1
@@ -1312,6 +1312,7 @@ nfsd4_run_cb_work(struct work_struct *work) · 1311 unmodified lines
13121312 container_of(work, struct nfsd4_callback, cb_work);
13131313 struct nfs4_client *clp = cb->cb_clp;
13141314 struct rpc_clnt *clnt;
1315+ int flags;
13151316
13161317 if (cb->cb_need_restart) {
13171318 cb->cb_need_restart = false;
@@ -1340,7 +1341,8 @@ nfsd4_run_cb_work(struct work_struct *work) · 22 unmodified lines
13401341 }
13411342
13421343 cb->cb_msg.rpc_cred = clp->cl_cb_cred;
1343− rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | RPC_TASK_SOFTCONN,
1344+ flags = clp->cl_minorversion ? RPC_TASK_NOCONNECT : RPC_TASK_SOFTCONN;
1345+ rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | flags,
13441346 cb->cb_ops ? &nfsd4_cb_ops : &nfsd4_cb_probe_ops, cb);
13451347 }
13461348
fs/nfsd/nfs4state.c+2−0
@@ -267,6 +267,8 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh, · 266 unmodified lines
267267 if (!nbl) {
268268 nbl= kmalloc(sizeof(*nbl), GFP_KERNEL);
269269 if (nbl) {
270+ INIT_LIST_HEAD(&nbl->nbl_list);
271+ INIT_LIST_HEAD(&nbl->nbl_lru);
270272 fh_copy_shallow(&nbl->nbl_fh, fh);
271273 locks_init_lock(&nbl->nbl_lock);
272274 nfsd4_init_cb(&nbl->nbl_cb, lo->lo_owner.so_client,
fs/ocfs2/dlmfs/dlmfs.c+12−15
@@ -275,7 +275,6 @@ static ssize_t dlmfs_file_write(struct file *filp, · 274 unmodified lines
275275 loff_t *ppos)
276276 {
277277 int bytes_left;
278− ssize_t writelen;
279278 char *lvb_buf;
280279 struct inode *inode = file_inode(filp);
281280
@@ -285,32 +284,30 @@ static ssize_t dlmfs_file_write(struct file *filp, · 3 unmodified lines
285284 if (*ppos >= i_size_read(inode))
286285 return -ENOSPC;
287286
287+ /* don't write past the lvb */
288+ if (count > i_size_read(inode) - *ppos)
289+ count = i_size_read(inode) - *ppos;
290+
288291 if (!count)
289292 return 0;
290293
291294 if (!access_ok(buf, count))
292295 return -EFAULT;
293296
294− /* don't write past the lvb */
295− if ((count + *ppos) > i_size_read(inode))
296− writelen = i_size_read(inode) - *ppos;
297− else
298− writelen = count - *ppos;
299−
300− lvb_buf = kmalloc(writelen, GFP_NOFS);
297+ lvb_buf = kmalloc(count, GFP_NOFS);
301298 if (!lvb_buf)
302299 return -ENOMEM;
303300
304− bytes_left = copy_from_user(lvb_buf, buf, writelen);
305− writelen -= bytes_left;
306− if (writelen)
307− user_dlm_write_lvb(inode, lvb_buf, writelen);
301+ bytes_left = copy_from_user(lvb_buf, buf, count);
302+ count -= bytes_left;
303+ if (count)
304+ user_dlm_write_lvb(inode, lvb_buf, count);
308305
309306 kfree(lvb_buf);
310307
311− *ppos = *ppos + writelen;
312− mlog(0, "wrote %zd bytes\n", writelen);
313− return writelen;
308+ *ppos = *ppos + count;
309+ mlog(0, "wrote %zu bytes\n", count);
310+ return count;
314311 }
315312
316313 static void dlmfs_init_once(void *foo)
fs/pnode.c+4−5
@@ -261,14 +261,13 @@ static int propagate_one(struct mount *m) · 260 unmodified lines
261261 child = copy_tree(last_source, last_source->mnt.mnt_root, type);
262262 if (IS_ERR(child))
263263 return PTR_ERR(child);
264+ read_seqlock_excl(&mount_lock);
264265 mnt_set_mountpoint(m, mp, child);
266+ if (m->mnt_master != dest_master)
267+ SET_MNT_MARK(m->mnt_master);
268+ read_sequnlock_excl(&mount_lock);
265269 last_dest = m;
266270 last_source = child;
267− if (m->mnt_master != dest_master) {
268− read_seqlock_excl(&mount_lock);
269− SET_MNT_MARK(m->mnt_master);
270− read_sequnlock_excl(&mount_lock);
271− }
272271 hlist_add_head(&child->mnt_hash, list);
273272 return count_mounts(m->mnt_ns, child);
274273 }
fs/proc/base.c+0−1
@@ -3286,7 +3286,6 @@ static const struct inode_operations proc_tgid_base_inode_operations = { · 3285 unmodified lines
32863286 void proc_flush_pid(struct pid *pid)
32873287 {
32883288 proc_invalidate_siblings_dcache(&pid->inodes, &pid->lock);
3289− put_pid(pid);
32903289 }
32913290
32923291 static struct dentry *proc_pid_instantiate(struct dentry * dentry,
fs/proc/vmcore.c+3−2
@@ -266,7 +266,8 @@ static int vmcoredd_mmap_dumps(struct vm_area_struct *vma, unsigned long dst, · 265 unmodified lines
266266 if (start < offset + dump->size) {
267267 tsz = min(offset + (u64)dump->size - start, (u64)size);
268268 buf = dump->buf + start - offset;
269− if (remap_vmalloc_range_partial(vma, dst, buf, tsz)) {
269+ if (remap_vmalloc_range_partial(vma, dst, buf, 0,
270+ tsz)) {
270271 ret = -EFAULT;
271272 goto out_unlock;
272273 }
@@ -624,7 +625,7 @@ static int mmap_vmcore(struct file *file, struct vm_area_struct *vma) · 351 unmodified lines
624625 tsz = min(elfcorebuf_sz + elfnotes_sz - (size_t)start, size);
625626 kaddr = elfnotes_buf + start - elfcorebuf_sz - vmcoredd_orig_sz;
626627 if (remap_vmalloc_range_partial(vma, vma->vm_start + len,
627− kaddr, tsz))
628+ kaddr, 0, tsz))
628629 goto fail;
629630
630631 size -= tsz;
fs/splice.c+18−27
@@ -1118,6 +1118,10 @@ long do_splice(struct file *in, loff_t __user *off_in, · 1117 unmodified lines
11181118 loff_t offset;
11191119 long ret;
11201120
1121+ if (unlikely(!(in->f_mode & FMODE_READ) ||
1122+ !(out->f_mode & FMODE_WRITE)))
1123+ return -EBADF;
1124+
11211125 ipipe = get_pipe_info(in);
11221126 opipe = get_pipe_info(out);
11231127
@@ -1125,12 +1129,6 @@ long do_splice(struct file *in, loff_t __user *off_in, · 1 unmodified line
11251129 if (off_in || off_out)
11261130 return -ESPIPE;
11271131
1128− if (!(in->f_mode & FMODE_READ))
1129− return -EBADF;
1130−
1131− if (!(out->f_mode & FMODE_WRITE))
1132− return -EBADF;
1133−
11341132 /* Splicing to self would be fun, but... */
11351133 if (ipipe == opipe)
11361134 return -EINVAL;
@@ -1153,9 +1151,6 @@ long do_splice(struct file *in, loff_t __user *off_in, · 16 unmodified lines
11531151 offset = out->f_pos;
11541152 }
11551153
1156− if (unlikely(!(out->f_mode & FMODE_WRITE)))
1157− return -EBADF;
1158−
11591154 if (unlikely(out->f_flags & O_APPEND))
11601155 return -EINVAL;
11611156
@@ -1440,15 +1435,11 @@ SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in, · 278 unmodified lines
14401435 error = -EBADF;
14411436 in = fdget(fd_in);
14421437 if (in.file) {
1443− if (in.file->f_mode & FMODE_READ) {
1444− out = fdget(fd_out);
1445− if (out.file) {
1446− if (out.file->f_mode & FMODE_WRITE)
1447− error = do_splice(in.file, off_in,
1448− out.file, off_out,
1449− len, flags);
1450− fdput(out);
1451− }
1438+ out = fdget(fd_out);
1439+ if (out.file) {
1440+ error = do_splice(in.file, off_in, out.file, off_out,
1441+ len, flags);
1442+ fdput(out);
14521443 }
14531444 fdput(in);
14541445 }
@@ -1770,6 +1761,10 @@ static long do_tee(struct file *in, struct file *out, size_t len, · 315 unmodified lines
17701761 struct pipe_inode_info *opipe = get_pipe_info(out);
17711762 int ret = -EINVAL;
17721763
1764+ if (unlikely(!(in->f_mode & FMODE_READ) ||
1765+ !(out->f_mode & FMODE_WRITE)))
1766+ return -EBADF;
1767+
17731768 /*
17741769 * Duplicate the contents of ipipe to opipe without actually
17751770 * copying the data.
@@ -1795,7 +1790,7 @@ static long do_tee(struct file *in, struct file *out, size_t len, · 19 unmodified lines
17951790
17961791 SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
17971792 {
1798− struct fd in;
1793+ struct fd in, out;
17991794 int error;
18001795
18011796 if (unlikely(flags & ~SPLICE_F_ALL))
@@ -1807,14 +1802,10 @@ SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags) · 5 unmodified lines
18071802 error = -EBADF;
18081803 in = fdget(fdin);
18091804 if (in.file) {
1810− if (in.file->f_mode & FMODE_READ) {
1811− struct fd out = fdget(fdout);
1812− if (out.file) {
1813− if (out.file->f_mode & FMODE_WRITE)
1814− error = do_tee(in.file, out.file,
1815− len, flags);
1816− fdput(out);
1817− }
1805+ out = fdget(fdout);
1806+ if (out.file) {
1807+ error = do_tee(in.file, out.file, len, flags);
1808+ fdput(out);
18181809 }
18191810 fdput(in);
18201811 }
fs/super.c+1−1
@@ -1302,8 +1302,8 @@ int get_tree_bdev(struct fs_context *fc, · 1301 unmodified lines
13021302 mutex_lock(&bdev->bd_fsfreeze_mutex);
13031303 if (bdev->bd_fsfreeze_count > 0) {
13041304 mutex_unlock(&bdev->bd_fsfreeze_mutex);
1305− blkdev_put(bdev, mode);
13061305 warnf(fc, "%pg: Can't mount, blockdev is frozen", bdev);
1306+ blkdev_put(bdev, mode);
13071307 return -EBUSY;
13081308 }
13091309
fs/vboxsf/super.c+1−1
@@ -164,7 +164,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc) · 163 unmodified lines
164164 goto fail_free;
165165 }
166166
167− err = super_setup_bdi_name(sb, "vboxsf-%s.%d", fc->source, sbi->bdi_id);
167+ err = super_setup_bdi_name(sb, "vboxsf-%d", sbi->bdi_id);
168168 if (err)
169169 goto fail_free;
170170
include/asm-generic/Kbuild+1−0
@@ -56,6 +56,7 @@ mandatory-y += topology.h · 55 unmodified lines
5656 mandatory-y += trace_clock.h
5757 mandatory-y += uaccess.h
5858 mandatory-y += unaligned.h
59+mandatory-y += vermagic.h
5960 mandatory-y += vga.h
6061 mandatory-y += word-at-a-time.h
6162 mandatory-y += xor.h
include/asm-generic/sections.h+3−0
@@ -53,6 +53,9 @@ extern char __ctors_start[], __ctors_end[]; · 52 unmodified lines
5353 /* Start and end of .opd section - used for function descriptors. */
5454 extern char __start_opd[], __end_opd[];
5555
56+/* Start and end of instrumentation protected text section */
57+extern char __noinstr_text_start[], __noinstr_text_end[];
58+
5659 extern __visible const void __nosave_begin, __nosave_end;
5760
5861 /* Function descriptor handling (if any). Override in asm/sections.h */
include/asm-generic/vermagic.h+7−0
@@ -0,0 +1,7 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+#ifndef _ASM_GENERIC_VERMAGIC_H
3+#define _ASM_GENERIC_VERMAGIC_H
4+
5+#define MODULE_ARCH_VERMAGIC ""
6+
7+#endif /* _ASM_GENERIC_VERMAGIC_H */
include/asm-generic/vmlinux.lds.h+10−0
@@ -540,6 +540,15 @@ · 539 unmodified lines
540540 . = ALIGN((align)); \
541541 __end_rodata = .;
542542
543+/*
544+ * Non-instrumentable text section
545+ */
546+#define NOINSTR_TEXT \
547+ ALIGN_FUNCTION(); \
548+ __noinstr_text_start = .; \
549+ *(.noinstr.text) \
550+ __noinstr_text_end = .;
551+
543552 /*
544553 * .text section. Map to function alignment to avoid address changes
545554 * during second ld run in second ld pass when generating System.map
@@ -551,6 +560,7 @@ · 5 unmodified lines
551560 #define TEXT_TEXT \
552561 ALIGN_FUNCTION(); \
553562 *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \
563+ NOINSTR_TEXT \
554564 *(.text..refcount) \
555565 *(.ref.text) \
556566 MEM_KEEP(init.text*) \
include/linux/amba/bus.h+1−0
@@ -65,6 +65,7 @@ struct amba_device { · 64 unmodified lines
6565 struct device dev;
6666 struct resource res;
6767 struct clk *pclk;
68+ struct device_dma_parameters dma_parms;
6869 unsigned int periphid;
6970 unsigned int cid;
7071 struct amba_cs_uci_id uci;
include/linux/backing-dev-defs.h+1−1
@@ -54,7 +54,6 @@ enum wb_reason { · 53 unmodified lines
5454 WB_REASON_SYNC,
5555 WB_REASON_PERIODIC,
5656 WB_REASON_LAPTOP_TIMER,
57− WB_REASON_FREE_MORE_MEM,
5857 WB_REASON_FS_FREE_SPACE,
5958 /*
6059 * There is no bdi forker thread any more and works are done
@@ -220,6 +219,7 @@ struct backing_dev_info { · 159 unmodified lines
220219 wait_queue_head_t wb_waitq;
221220
222221 struct device *dev;
222+ char dev_name[64];
223223 struct device *owner;
224224
225225 struct timer_list laptop_mode_wb_timer;
include/linux/backing-dev.h+1−8
@@ -505,13 +505,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) · 504 unmodified lines
505505 (1 << WB_async_congested));
506506 }
507507
508−extern const char *bdi_unknown_name;
509−
510−static inline const char *bdi_dev_name(struct backing_dev_info *bdi)
511−{
512− if (!bdi || !bdi->dev)
513− return bdi_unknown_name;
514− return dev_name(bdi->dev);
515−}
508+const char *bdi_dev_name(struct backing_dev_info *bdi);
516509
517510 #endif /* _LINUX_BACKING_DEV_H */
include/linux/compiler.h+53−0
@@ -120,12 +120,65 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 119 unmodified lines
120120 /* Annotate a C jump table to allow objtool to follow the code flow */
121121 #define __annotate_jump_table __section(.rodata..c_jump_table)
122122
123+#ifdef CONFIG_DEBUG_ENTRY
124+/* Begin/end of an instrumentation safe region */
125+#define instrumentation_begin() ({ \
126+ asm volatile("%c0:\n\t" \
127+ ".pushsection .discard.instr_begin\n\t" \
128+ ".long %c0b - .\n\t" \
129+ ".popsection\n\t" : : "i" (__COUNTER__)); \
130+})
131+
132+/*
133+ * Because instrumentation_{begin,end}() can nest, objtool validation considers
134+ * _begin() a +1 and _end() a -1 and computes a sum over the instructions.
135+ * When the value is greater than 0, we consider instrumentation allowed.
136+ *
137+ * There is a problem with code like:
138+ *
139+ * noinstr void foo()
140+ * {
141+ * instrumentation_begin();
142+ * ...
143+ * if (cond) {
144+ * instrumentation_begin();
145+ * ...
146+ * instrumentation_end();
147+ * }
148+ * bar();
149+ * instrumentation_end();
150+ * }
151+ *
152+ * If instrumentation_end() would be an empty label, like all the other
153+ * annotations, the inner _end(), which is at the end of a conditional block,
154+ * would land on the instruction after the block.
155+ *
156+ * If we then consider the sum of the !cond path, we'll see that the call to
157+ * bar() is with a 0-value, even though, we meant it to happen with a positive
158+ * value.
159+ *
160+ * To avoid this, have _end() be a NOP instruction, this ensures it will be
161+ * part of the condition block and does not escape.
162+ */
163+#define instrumentation_end() ({ \
164+ asm volatile("%c0: nop\n\t" \
165+ ".pushsection .discard.instr_end\n\t" \
166+ ".long %c0b - .\n\t" \
167+ ".popsection\n\t" : : "i" (__COUNTER__)); \
168+})
169+#endif /* CONFIG_DEBUG_ENTRY */
170+
123171 #else
124172 #define annotate_reachable()
125173 #define annotate_unreachable()
126174 #define __annotate_jump_table
127175 #endif
128176
177+#ifndef instrumentation_begin
178+#define instrumentation_begin() do { } while(0)
179+#define instrumentation_end() do { } while(0)
180+#endif
181+
129182 #ifndef ASM_UNREACHABLE
130183 # define ASM_UNREACHABLE
131184 #endif
include/linux/compiler_types.h+4−0
@@ -118,6 +118,10 @@ struct ftrace_likely_data { · 117 unmodified lines
118118 #define notrace __attribute__((__no_instrument_function__))
119119 #endif
120120
121+/* Section for code which can't be instrumented at all */
122+#define noinstr \
123+ noinline notrace __attribute((__section__(".noinstr.text")))
124+
121125 /*
122126 * it doesn't make sense on ARM (currently the only user of __naked)
123127 * to trace naked functions because then mcount is called without
include/linux/debugfs.h+4−8
@@ -103,8 +103,8 @@ void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent, · 102 unmodified lines
103103 u8 *value);
104104 void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
105105 u16 *value);
106−struct dentry *debugfs_create_u32(const char *name, umode_t mode,
107− struct dentry *parent, u32 *value);
106+void debugfs_create_u32(const char *name, umode_t mode, struct dentry *parent,
107+ u32 *value);
108108 void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
109109 u64 *value);
110110 struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
@@ -250,12 +250,8 @@ static inline void debugfs_create_u8(const char *name, umode_t mode, · 139 unmodified lines
250250 static inline void debugfs_create_u16(const char *name, umode_t mode,
251251 struct dentry *parent, u16 *value) { }
252252
253−static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
254− struct dentry *parent,
255− u32 *value)
256−{
257− return ERR_PTR(-ENODEV);
258−}
253+static inline void debugfs_create_u32(const char *name, umode_t mode,
254+ struct dentry *parent, u32 *value) { }
259255
260256 static inline void debugfs_create_u64(const char *name, umode_t mode,
261257 struct dentry *parent, u64 *value) { }
include/linux/dma-buf.h+1−2
@@ -329,13 +329,12 @@ struct dma_buf { · 328 unmodified lines
329329
330330 /**
331331 * struct dma_buf_attach_ops - importer operations for an attachment
332− * @move_notify: [optional] notification that the DMA-buf is moving
333332 *
334333 * Attachment operations implemented by the importer.
335334 */
336335 struct dma_buf_attach_ops {
337336 /**
338− * @move_notify
337+ * @move_notify: [optional] notification that the DMA-buf is moving
339338 *
340339 * If this callback is provided the framework can avoid pinning the
341340 * backing store while mappings exists.
include/linux/dmaengine.h+6−6
@@ -83,9 +83,9 @@ enum dma_transfer_direction { · 82 unmodified lines
8383 /**
8484 * Interleaved Transfer Request
8585 * ----------------------------
86− * A chunk is collection of contiguous bytes to be transfered.
86+ * A chunk is collection of contiguous bytes to be transferred.
8787 * The gap(in bytes) between two chunks is called inter-chunk-gap(ICG).
88− * ICGs may or maynot change between chunks.
88+ * ICGs may or may not change between chunks.
8989 * A FRAME is the smallest series of contiguous {chunk,icg} pairs,
9090 * that when repeated an integral number of times, specifies the transfer.
9191 * A transfer template is specification of a Frame, the number of times
@@ -341,13 +341,11 @@ struct dma_chan { · 249 unmodified lines
341341 * @chan: driver channel device
342342 * @device: sysfs device
343343 * @dev_id: parent dma_device dev_id
344− * @idr_ref: reference count to gate release of dma_device dev_id
345344 */
346345 struct dma_chan_dev {
347346 struct dma_chan *chan;
348347 struct device device;
349348 int dev_id;
350− atomic_t *idr_ref;
351349 };
352350
353351 /**
@@ -835,6 +833,8 @@ struct dma_device { · 481 unmodified lines
835833 int dev_id;
836834 struct device *dev;
837835 struct module *owner;
836+ struct ida chan_ida;
837+ struct mutex chan_mutex; /* to protect chan_ida */
838838
839839 u32 src_addr_widths;
840840 u32 dst_addr_widths;
@@ -1069,7 +1069,7 @@ static inline int dmaengine_terminate_all(struct dma_chan *chan) · 228 unmodified lines
10691069 * dmaengine_synchronize() needs to be called before it is safe to free
10701070 * any memory that is accessed by previously submitted descriptors or before
10711071 * freeing any resources accessed from within the completion callback of any
1072− * perviously submitted descriptors.
1072+ * previously submitted descriptors.
10731073 *
10741074 * This function can be called from atomic context as well as from within a
10751075 * complete callback of a descriptor submitted on the same channel.
@@ -1091,7 +1091,7 @@ static inline int dmaengine_terminate_async(struct dma_chan *chan) · 15 unmodified lines
10911091 *
10921092 * Synchronizes to the DMA channel termination to the current context. When this
10931093 * function returns it is guaranteed that all transfers for previously issued
1094− * descriptors have stopped and and it is safe to free the memory assoicated
1094+ * descriptors have stopped and it is safe to free the memory associated
10951095 * with them. Furthermore it is guaranteed that all complete callback functions
10961096 * for a previously submitted descriptor have finished running and it is safe to
10971097 * free resources accessed from within the complete callbacks.
include/linux/fs.h+1−1
@@ -983,7 +983,7 @@ struct file_handle { · 982 unmodified lines
983983 __u32 handle_bytes;
984984 int handle_type;
985985 /* file identifier */
986− unsigned char f_handle[0];
986+ unsigned char f_handle[];
987987 };
988988
989989 static inline struct file *get_file(struct file *f)
include/linux/iio/iio.h+1−1
@@ -600,7 +600,7 @@ void iio_device_unregister(struct iio_dev *indio_dev); · 599 unmodified lines
600600 * 0 on success, negative error number on failure.
601601 */
602602 #define devm_iio_device_register(dev, indio_dev) \
603− __devm_iio_device_register((dev), (indio_dev), THIS_MODULE);
603+ __devm_iio_device_register((dev), (indio_dev), THIS_MODULE)
604604 int __devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev,
605605 struct module *this_mod);
606606 void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
include/linux/kvm_host.h+1−1
@@ -1048,7 +1048,7 @@ search_memslots(struct kvm_memslots *slots, gfn_t gfn) · 1047 unmodified lines
10481048 start = slot + 1;
10491049 }
10501050
1051− if (gfn >= memslots[start].base_gfn &&
1051+ if (start < slots->used_slots && gfn >= memslots[start].base_gfn &&
10521052 gfn < memslots[start].base_gfn + memslots[start].npages) {
10531053 atomic_set(&slots->lru_slot, start);
10541054 return &memslots[start];
include/linux/lsm_hook_defs.h+1−1
@@ -55,7 +55,7 @@ LSM_HOOK(void, LSM_RET_VOID, bprm_committing_creds, struct linux_binprm *bprm) · 54 unmodified lines
5555 LSM_HOOK(void, LSM_RET_VOID, bprm_committed_creds, struct linux_binprm *bprm)
5656 LSM_HOOK(int, 0, fs_context_dup, struct fs_context *fc,
5757 struct fs_context *src_sc)
58−LSM_HOOK(int, 0, fs_context_parse_param, struct fs_context *fc,
58+LSM_HOOK(int, -ENOPARAM, fs_context_parse_param, struct fs_context *fc,
5959 struct fs_parameter *param)
6060 LSM_HOOK(int, 0, sb_alloc_security, struct super_block *sb)
6161 LSM_HOOK(void, LSM_RET_VOID, sb_free_security, struct super_block *sb)
include/linux/mhi.h+10−6
@@ -53,9 +53,9 @@ enum mhi_callback { · 52 unmodified lines
5353 * @MHI_CHAIN: Linked transfer
5454 */
5555 enum mhi_flags {
56− MHI_EOB,
57− MHI_EOT,
58− MHI_CHAIN,
56+ MHI_EOB = BIT(0),
57+ MHI_EOT = BIT(1),
58+ MHI_CHAIN = BIT(2),
5959 };
6060
6161 /**
@@ -335,14 +335,15 @@ struct mhi_controller_config { · 273 unmodified lines
335335 * @syserr_worker: System error worker
336336 * @state_event: State change event
337337 * @status_cb: CB function to notify power states of the device (required)
338− * @link_status: CB function to query link status of the device (required)
339338 * @wake_get: CB function to assert device wake (optional)
340339 * @wake_put: CB function to de-assert device wake (optional)
341340 * @wake_toggle: CB function to assert and de-assert device wake (optional)
342341 * @runtime_get: CB function to controller runtime resume (required)
343− * @runtimet_put: CB function to decrement pm usage (required)
342+ * @runtime_put: CB function to decrement pm usage (required)
344343 * @map_single: CB function to create TRE buffer
345344 * @unmap_single: CB function to destroy TRE buffer
345+ * @read_reg: Read a MHI register via the physical link (required)
346+ * @write_reg: Write a MHI register via the physical link (required)
346347 * @buffer_len: Bounce buffer length
347348 * @bounce_buf: Use of bounce buffer
348349 * @fbc_download: MHI host needs to do complete image transfer (optional)
@@ -417,7 +418,6 @@ struct mhi_controller { · 68 unmodified lines
417418
418419 void (*status_cb)(struct mhi_controller *mhi_cntrl,
419420 enum mhi_callback cb);
420− int (*link_status)(struct mhi_controller *mhi_cntrl);
421421 void (*wake_get)(struct mhi_controller *mhi_cntrl, bool override);
422422 void (*wake_put)(struct mhi_controller *mhi_cntrl, bool override);
423423 void (*wake_toggle)(struct mhi_controller *mhi_cntrl);
@@ -427,6 +427,10 @@ struct mhi_controller { · 3 unmodified lines
427427 struct mhi_buf_info *buf);
428428 void (*unmap_single)(struct mhi_controller *mhi_cntrl,
429429 struct mhi_buf_info *buf);
430+ int (*read_reg)(struct mhi_controller *mhi_cntrl, void __iomem *addr,
431+ u32 *out);
432+ void (*write_reg)(struct mhi_controller *mhi_cntrl, void __iomem *addr,
433+ u32 val);
430434
431435 size_t buffer_len;
432436 bool bounce_buf;
include/linux/nfs_xdr.h+2−0
@@ -1317,11 +1317,13 @@ struct nfs41_impl_id { · 1316 unmodified lines
13171317 struct nfstime4 date;
13181318 };
13191319
1320+#define MAX_BIND_CONN_TO_SESSION_RETRIES 3
13201321 struct nfs41_bind_conn_to_session_args {
13211322 struct nfs_client *client;
13221323 struct nfs4_sessionid sessionid;
13231324 u32 dir;
13241325 bool use_conn_in_rdma_mode;
1326+ int retries;
13251327 };
13261328
13271329 struct nfs41_bind_conn_to_session_res {
include/linux/platform_data/cros_ec_sensorhub.h+1−0
@@ -185,6 +185,7 @@ int cros_ec_sensorhub_register_push_data(struct cros_ec_sensorhub *sensorhub, · 184 unmodified lines
185185 void cros_ec_sensorhub_unregister_push_data(struct cros_ec_sensorhub *sensorhub,
186186 u8 sensor_num);
187187
188+int cros_ec_sensorhub_ring_allocate(struct cros_ec_sensorhub *sensorhub);
188189 int cros_ec_sensorhub_ring_add(struct cros_ec_sensorhub *sensorhub);
189190 void cros_ec_sensorhub_ring_remove(void *arg);
190191 int cros_ec_sensorhub_ring_fifo_enable(struct cros_ec_sensorhub *sensorhub,
include/linux/platform_device.h+1−0
@@ -25,6 +25,7 @@ struct platform_device { · 24 unmodified lines
2525 bool id_auto;
2626 struct device dev;
2727 u64 platform_dma_mask;
28+ struct device_dma_parameters dma_parms;
2829 u32 num_resources;
2930 struct resource *resource;
3031
include/linux/pnp.h+9−20
@@ -220,10 +220,8 @@ struct pnp_card { · 219 unmodified lines
220220 #define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
221221 #define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
222222 #define to_pnp_card(n) container_of(n, struct pnp_card, dev)
223−#define pnp_for_each_card(card) \
224− for((card) = global_to_pnp_card(pnp_cards.next); \
225− (card) != global_to_pnp_card(&pnp_cards); \
226− (card) = global_to_pnp_card((card)->global_list.next))
223+#define pnp_for_each_card(card) \
224+ list_for_each_entry(card, &pnp_cards, global_list)
227225
228226 struct pnp_card_link {
229227 struct pnp_card *card;
@@ -276,14 +274,9 @@ struct pnp_dev { · 46 unmodified lines
276274 #define card_to_pnp_dev(n) list_entry(n, struct pnp_dev, card_list)
277275 #define protocol_to_pnp_dev(n) list_entry(n, struct pnp_dev, protocol_list)
278276 #define to_pnp_dev(n) container_of(n, struct pnp_dev, dev)
279−#define pnp_for_each_dev(dev) \
280− for((dev) = global_to_pnp_dev(pnp_global.next); \
281− (dev) != global_to_pnp_dev(&pnp_global); \
282− (dev) = global_to_pnp_dev((dev)->global_list.next))
283−#define card_for_each_dev(card,dev) \
284− for((dev) = card_to_pnp_dev((card)->devices.next); \
285− (dev) != card_to_pnp_dev(&(card)->devices); \
286− (dev) = card_to_pnp_dev((dev)->card_list.next))
277+#define pnp_for_each_dev(dev) list_for_each_entry(dev, &pnp_global, global_list)
278+#define card_for_each_dev(card, dev) \
279+ list_for_each_entry(dev, &(card)->devices, card_list)
287280 #define pnp_dev_name(dev) (dev)->name
288281
289282 static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
@@ -437,14 +430,10 @@ struct pnp_protocol { · 147 unmodified lines
437430 };
438431
439432 #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
440−#define protocol_for_each_card(protocol,card) \
441− for((card) = protocol_to_pnp_card((protocol)->cards.next); \
442− (card) != protocol_to_pnp_card(&(protocol)->cards); \
443− (card) = protocol_to_pnp_card((card)->protocol_list.next))
444−#define protocol_for_each_dev(protocol,dev) \
445− for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \
446− (dev) != protocol_to_pnp_dev(&(protocol)->devices); \
447− (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
433+#define protocol_for_each_card(protocol, card) \
434+ list_for_each_entry(card, &(protocol)->cards, protocol_list)
435+#define protocol_for_each_dev(protocol, dev) \
436+ list_for_each_entry(dev, &(protocol)->devices, protocol_list)
448437
449438 extern struct bus_type pnp_bus_type;
450439
include/linux/stmmac.h+2−0
@@ -177,6 +177,8 @@ struct plat_stmmacenet_data { · 176 unmodified lines
177177 struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES];
178178 struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES];
179179 void (*fix_mac_speed)(void *priv, unsigned int speed);
180+ int (*serdes_powerup)(struct net_device *ndev, void *priv);
181+ void (*serdes_powerdown)(struct net_device *ndev, void *priv);
180182 int (*init)(struct platform_device *pdev, void *priv);
181183 void (*exit)(struct platform_device *pdev, void *priv);
182184 struct mac_device_info *(*setup)(void *priv);
include/linux/sunrpc/clnt.h+12−1
@@ -71,7 +71,13 @@ struct rpc_clnt { · 70 unmodified lines
7171 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
7272 struct dentry *cl_debugfs; /* debugfs directory */
7373 #endif
74− struct rpc_xprt_iter cl_xpi;
74+ /* cl_work is only needed after cl_xpi is no longer used,
75+ * and that are of similar size
76+ */
77+ union {
78+ struct rpc_xprt_iter cl_xpi;
79+ struct work_struct cl_work;
80+ };
7581 const struct cred *cl_cred;
7682 };
7783
@@ -236,4 +242,9 @@ static inline int rpc_reply_expected(struct rpc_task *task) · 158 unmodified lines
236242 (task->tk_msg.rpc_proc->p_decode != NULL);
237243 }
238244
245+static inline void rpc_task_close_connection(struct rpc_task *task)
246+{
247+ if (task->tk_xprt)
248+ xprt_force_disconnect(task->tk_xprt);
249+}
239250 #endif /* _LINUX_SUNRPC_CLNT_H */
include/linux/sunrpc/svc_rdma.h+1−0
@@ -170,6 +170,7 @@ extern bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma); · 169 unmodified lines
170170 extern void svc_rdma_recv_ctxt_put(struct svcxprt_rdma *rdma,
171171 struct svc_rdma_recv_ctxt *ctxt);
172172 extern void svc_rdma_flush_recv_queues(struct svcxprt_rdma *rdma);
173+extern void svc_rdma_release_rqst(struct svc_rqst *rqstp);
173174 extern int svc_rdma_recvfrom(struct svc_rqst *);
174175
175176 /* svc_rdma_rw.c */
include/linux/tcp.h+0−51
@@ -78,47 +78,6 @@ struct tcp_sack_block { · 77 unmodified lines
7878 #define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */
7979 #define TCP_DSACK_SEEN (1 << 2) /*1 = DSACK was received from peer*/
8080
81−#if IS_ENABLED(CONFIG_MPTCP)
82−struct mptcp_options_received {
83− u64 sndr_key;
84− u64 rcvr_key;
85− u64 data_ack;
86− u64 data_seq;
87− u32 subflow_seq;
88− u16 data_len;
89− u16 mp_capable : 1,
90− mp_join : 1,
91− dss : 1,
92− add_addr : 1,
93− rm_addr : 1,
94− family : 4,
95− echo : 1,
96− backup : 1;
97− u32 token;
98− u32 nonce;
99− u64 thmac;
100− u8 hmac[20];
101− u8 join_id;
102− u8 use_map:1,
103− dsn64:1,
104− data_fin:1,
105− use_ack:1,
106− ack64:1,
107− mpc_map:1,
108− __unused:2;
109− u8 addr_id;
110− u8 rm_id;
111− union {
112− struct in_addr addr;
113−#if IS_ENABLED(CONFIG_MPTCP_IPV6)
114− struct in6_addr addr6;
115−#endif
116− };
117− u64 ahmac;
118− u16 port;
119−};
120−#endif
121−
12281 struct tcp_options_received {
12382 /* PAWS/RTTM data */
12483 int ts_recent_stamp;/* Time we stored ts_recent (for aging) */
@@ -136,9 +95,6 @@ struct tcp_options_received { · 11 unmodified lines
13695 u8 num_sacks; /* Number of SACK blocks */
13796 u16 user_mss; /* mss requested by user in ioctl */
13897 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
139−#if IS_ENABLED(CONFIG_MPTCP)
140− struct mptcp_options_received mptcp;
141−#endif
14298 };
14399
144100 static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
@@ -148,13 +104,6 @@ static inline void tcp_clear_options(struct tcp_options_received *rx_opt) · 3 unmodified lines
148104 #if IS_ENABLED(CONFIG_SMC)
149105 rx_opt->smc_ok = 0;
150106 #endif
151−#if IS_ENABLED(CONFIG_MPTCP)
152− rx_opt->mptcp.mp_capable = 0;
153− rx_opt->mptcp.mp_join = 0;
154− rx_opt->mptcp.add_addr = 0;
155− rx_opt->mptcp.rm_addr = 0;
156− rx_opt->mptcp.dss = 0;
157−#endif
158107 }
159108
160109 /* This is the max number of SACKS that we'll generate and process. It's safe
include/linux/tracepoint.h+1−21
@@ -156,8 +156,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) · 155 unmodified lines
156156 * Note, the proto and args passed in includes "__data" as the first parameter.
157157 * The reason for this is to handle the "void" prototype. If a tracepoint
158158 * has a "void" prototype, then it is invalid to declare a function
159− * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just
160− * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto".
159+ * as "(void *, void)".
161160 */
162161 #define __DO_TRACE(tp, proto, args, cond, rcuidle) \
163162 do { \
@@ -373,25 +372,6 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) · 209 unmodified lines
373372 # define __tracepoint_string
374373 #endif
375374
376−/*
377− * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype
378− * (void). "void" is a special value in a function prototype and can
379− * not be combined with other arguments. Since the DECLARE_TRACE()
380− * macro adds a data element at the beginning of the prototype,
381− * we need a way to differentiate "(void *data, proto)" from
382− * "(void *data, void)". The second prototype is invalid.
383− *
384− * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype
385− * and "void *__data" as the callback prototype.
386− *
387− * DECLARE_TRACE() passes "proto" as the tracepoint protoype and
388− * "void *__data, proto" as the callback prototype.
389− */
390−#define DECLARE_TRACE_NOARGS(name) \
391− __DECLARE_TRACE(name, void, , \
392− cpu_online(raw_smp_processor_id()), \

5 more lines aren’t shown here.

include/linux/tty.h+1−1

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

include/linux/vdpa.h+1−1

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

include/linux/vermagic.h+5−3

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

include/linux/virtio.h+0−1

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

include/linux/virtio_net.h+24−2

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

include/linux/virtio_vsock.h+1−0

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

include/linux/vmalloc.h+1−1

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

include/linux/vringh.h+6−0

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

include/net/flow_offload.h+8−1

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

include/net/inet_ecn.h+55−2

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

include/net/ip6_fib.h+4−0

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

include/net/mac80211.h+3−1

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

include/net/mptcp.h+0−3

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

include/net/ndisc.h+1−1

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

include/net/net_namespace.h+7−0

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

include/net/sch_generic.h+1−0

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

include/net/tcp.h+1−1

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

include/soc/mscc/ocelot.h+1−0

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

include/soc/tegra/pmc.h+9−6

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

include/sound/soc-dai.h+0−1

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

include/sound/soc.h+3−0

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

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

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

include/trace/events/iocost.h+3−3

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

include/trace/events/rpcrdma.h+40−22

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

include/trace/events/wbt.h+4−4

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

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

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

include/uapi/drm/amdgpu_drm.h+4−0

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

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

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

include/uapi/linux/dlm_device.h+2−2

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

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

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

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

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

include/uapi/linux/hyperv.h+2−2

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

include/uapi/linux/if_arcnet.h+3−3

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

include/uapi/linux/mmc/ioctl.h+1−1

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

include/uapi/linux/net_dropmon.h+2−2

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

include/uapi/linux/netfilter_bridge/ebt_among.h+1−1

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

include/uapi/linux/virtio_balloon.h+9−2

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

include/uapi/scsi/scsi_bsg_fc.h+1−1

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

include/vdso/datapage.h+2−2

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

init/Kconfig+0−18

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

init/initramfs.c+1−1

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

init/main.c+52−17

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

ipc/mqueue.c+26−8

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

kernel/audit.c+3−0

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

kernel/bpf/cpumap.c+1−1

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

kernel/bpf/syscall.c+10−3

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

kernel/bpf/verifier.c+28−10

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

kernel/events/core.c+10−3

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

kernel/exit.c+1−0

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

kernel/kcov.c+2−2

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

kernel/power/hibernate.c+7−0

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

kernel/sched/core.c+2−7

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

kernel/signal.c+5−1

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

kernel/trace/Kconfig+0−1

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

kernel/trace/ftrace.c+1−0

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

kernel/trace/preemptirq_delay_test.c+24−6

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

kernel/trace/trace.c+15−1

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

kernel/trace/trace_boot.c+8−12

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

kernel/trace/trace_events_hist.c+7−0

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

kernel/trace/trace_kprobe.c+7−1

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

kernel/trace/tracing_map.c+3−3

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

kernel/umh.c+5−0

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

lib/Kconfig.ubsan+6−9

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

lib/kunit/test.c+1−1

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

lib/mpi/longlong.h+17−17

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

mm/backing-dev.c+11−2

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

mm/gup.c+1−1

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

mm/hugetlb.c+8−6

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

mm/ksm.c+10−2

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

mm/madvise.c+18−0

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

mm/memcontrol.c+9−6

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

mm/page_alloc.c+9−0

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

mm/percpu.c+10−4

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

mm/shmem.c+8−5

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

mm/slub.c+40−17

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

mm/vmalloc.c+13−3

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

mm/vmscan.c+0−1

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

net/atm/common.c+11−11

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

net/atm/lec.c+6−0

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

net/batman-adv/bat_v_ogm.c+1−1

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

net/batman-adv/network-coding.c+1−8

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

net/batman-adv/sysfs.c+2−1

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

net/bridge/br_netlink.c+1−0

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

net/core/devlink.c+10−2

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

net/core/drop_monitor.c+7−4

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

net/core/neighbour.c+3−3

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

net/core/netclassid_cgroup.c+1−3

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

net/core/sock.c+0−1

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

net/dsa/dsa2.c+1−1

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

net/dsa/master.c+2−1

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

net/dsa/slave.c+6−10

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

net/hsr/hsr_slave.c+1−1

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

net/ipv4/fib_semantics.c+3−3

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

net/ipv4/tcp_input.c+0−7

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

net/ipv4/xfrm4_output.c+0−2

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

net/ipv6/ipv6_sockglue.c+6−7

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

net/ipv6/route.c+25−0

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

net/ipv6/rpl.c+4−3

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

net/ipv6/seg6.c+8−2

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

net/ipv6/xfrm6_output.c+0−2

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

net/mac80211/main.c+3−2

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

net/mac80211/rate.c+4−11

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

net/mac80211/rate.h+23−0

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

net/mac80211/rc80211_minstrel_ht.c+13−6

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

net/mac80211/sta_info.c+2−1

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

net/mptcp/options.c+41−55

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

net/mptcp/pm_netlink.c+7−5

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

net/mptcp/protocol.c+20−10

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

net/mptcp/protocol.h+44−5

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

net/mptcp/subflow.c+119−52

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

net/netfilter/nf_flow_table_core.c+4−2

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

net/netfilter/nf_nat_proto.c+3−5

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

net/netfilter/nfnetlink_osf.c+7−5

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

net/netlabel/Kconfig+1−1

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

net/netrom/nr_route.c+1−0

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

net/openvswitch/conntrack.c+2−1

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

net/openvswitch/datapath.c+3−1

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

net/sched/cls_api.c+16−6

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

net/sched/sch_choke.c+2−1

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

net/sched/sch_etf.c+4−3

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

net/sched/sch_fq_codel.c+1−1

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

net/sched/sch_sfq.c+9−0

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

net/sched/sch_skbprio.c+3−0

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

net/sctp/sm_make_chunk.c+5−1

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

net/sctp/sm_statefuns.c+3−3

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

net/sunrpc/cache.c+3−2

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

net/sunrpc/clnt.c+18−6

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

net/sunrpc/svc_xprt.c+2−3

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

net/sunrpc/svcsock.c+4−0

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

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

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

net/sunrpc/xprtrdma/svc_rdma_backchannel.c+2−0

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

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c+22−0

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

net/sunrpc/xprtrdma/svc_rdma_rw.c+1−2

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

net/sunrpc/xprtrdma/svc_rdma_sendto.c+12−17

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

net/sunrpc/xprtrdma/svc_rdma_transport.c+0−5

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

net/sunrpc/xprtrdma/verbs.c+2−1

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

net/sunrpc/xprtsock.c+1−0

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

net/tipc/crypto.c+1−0

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

net/tipc/node.c+3−1

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

net/tipc/topsrv.c+3−2

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

net/tls/tls_sw.c+5−2

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

net/vmw_vsock/virtio_transport_common.c+4−0

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

net/x25/x25_dev.c+3−1

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

net/x25/x25_subr.c+6−0

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

samples/trace_events/trace-events-sample.h+1−1

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

samples/vfio-mdev/mdpy.c+1−1

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

scripts/Makefile.lib+1−1

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

scripts/checkpatch.pl+1−1

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

scripts/config+4−1

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

scripts/decodecode+1−1

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

scripts/gcc-plugins/Makefile+1−0

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

scripts/gcc-plugins/gcc-common.h+4−0

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

scripts/gcc-plugins/stackleak_plugin.c+2−3

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

scripts/gdb/linux/rbtree.py+2−2

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

scripts/kallsyms.c+1−1

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

scripts/mod/modpost.c+1−1

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

security/selinux/hooks.c+45−25

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

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

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

sound/core/oss/pcm_plugin.c+6−4

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

sound/isa/opti9xx/miro.c+6−3

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

sound/isa/opti9xx/opti92x-ad1848.c+6−3

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

sound/pci/hda/hda_codec.c+17−11

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

sound/pci/hda/hda_intel.c+7−20

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

sound/pci/hda/patch_hdmi.c+14−1

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

sound/pci/hda/patch_realtek.c+9−3

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

sound/soc/amd/acp3x-rt5682-max9836.c+3−3

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

sound/soc/codecs/Kconfig+3−0

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

sound/soc/codecs/hdac_hdmi.c+3−3

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

sound/soc/codecs/madera.c+0−4

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

sound/soc/codecs/sgtl5000.c+34−0

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

sound/soc/codecs/sgtl5000.h+1−0

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

sound/soc/codecs/tas571x.c+15−5

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

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

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

sound/soc/codecs/wsa881x.c+4−0

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

sound/soc/intel/common/soc-acpi-intel-cml-match.c+0−8

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

sound/soc/intel/common/soc-acpi-intel-icl-match.c+0−8

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

sound/soc/meson/axg-card.c+3−1

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

sound/soc/meson/gx-card.c+3−1

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

sound/soc/qcom/apq8096.c+1−3

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

sound/soc/qcom/qdsp6/q6afe-dai.c+16−0

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

sound/soc/qcom/sdm845.c+1−3

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

sound/soc/samsung/s3c-i2s-v2.c+0−57

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

sound/soc/samsung/s3c2412-i2s.c+56−0

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

sound/soc/sh/rcar/ssi.c+10−1

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

sound/soc/sh/rcar/ssiu.c+1−1

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

sound/soc/soc-dai.c+2−9

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

sound/soc/soc-dapm.c+75−72

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

sound/soc/soc-pcm.c+11−2

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

sound/soc/soc-topology.c+89−26

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

sound/soc/sof/intel/bdw.c+16−0

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

sound/soc/sof/intel/byt.c+48−0

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

sound/soc/stm/stm32_sai_sub.c+6−8

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

sound/usb/format.c+51−0

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

sound/usb/line6/podhd.c+5−17

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

sound/usb/mixer.c+34−3

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

sound/usb/mixer.h+10−0

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

sound/usb/mixer_maps.c+34−3

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

sound/usb/mixer_quirks.c+8−4

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

sound/usb/quirks-table.h+14−84

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

sound/usb/quirks.c+15−1

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

sound/usb/usx2y/usbusx2yaudio.c+2−0

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

tools/bootconfig/main.c+6−3

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

tools/bpf/bpftool/struct_ops.c+7−1

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

tools/bpf/runqslower/Makefile+1−1

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

tools/build/feature/test-sync-compare-and-swap.c+1−1

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

tools/cgroup/iocost_monitor.py+6−1

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

tools/include/uapi/linux/bpf.h+1−1

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

tools/lib/bpf/netlink.c+2−0

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

tools/objtool/check.c+14−3

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

tools/objtool/elf.c+1−1

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

tools/objtool/elf.h+5−4

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

tools/power/pm-graph/Makefile+4−0

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

tools/power/pm-graph/README+114−10

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

tools/power/pm-graph/bootgraph.py+1−1

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

tools/power/pm-graph/sleepgraph.8+49−16

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

tools/power/pm-graph/sleepgraph.py+451−344

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

tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c+24−6

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

tools/testing/selftests/bpf/progs/connect4_prog.c+16−12

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

tools/testing/selftests/bpf/progs/freplace_connect4.c+18−0

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

tools/testing/selftests/bpf/progs/test_btf_haskv.c+5−13

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

tools/testing/selftests/bpf/progs/test_btf_newkv.c+5−13

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

tools/testing/selftests/bpf/progs/test_btf_nokv.c+5−13

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

tools/testing/selftests/bpf/test_btf.c+1−1

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

tools/testing/selftests/bpf/verifier/stack_ptr.c+40−0

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

tools/testing/selftests/bpf/verifier/value_illegal_alu.c+1−0

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

tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c+146−0

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

tools/testing/selftests/ftrace/config+1−0

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

tools/testing/selftests/ftrace/ftracetest+30−2

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

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc+1−4

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

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc+2−0

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc+2−0

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-notrace-pid.tc+1−4

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc+1−4

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc+1−1

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

tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc+1−4

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

tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc+1−1

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

tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc+1−4

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

tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc+1−4

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

tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc+2−0

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

tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc+1−4

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

tools/testing/selftests/ftrace/test.d/functions+6−0

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc+1−1

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

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc+2−0

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

tools/testing/selftests/gpio/Makefile+6−6

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

tools/testing/selftests/intel_pstate/Makefile+1−1

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

tools/testing/selftests/ipc/msgque.c+1−1

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

tools/testing/selftests/kselftest/runner.sh+1−1

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

tools/testing/selftests/kselftest_deps.sh+272−0

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

tools/testing/selftests/kselftest_harness.h+3−3

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

tools/testing/selftests/kvm/Makefile+28−1

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

tools/testing/selftests/kvm/include/evmcs.h+2−2

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

tools/testing/selftests/kvm/lib/x86_64/vmx.c+3−0

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

tools/testing/selftests/memfd/Makefile+14−3

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

tools/testing/selftests/net/fib_nexthops.sh+23−0

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

tools/testing/selftests/net/fib_tests.sh+8−2

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

tools/testing/selftests/net/tcp_mmap.c+5−2

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

tools/testing/selftests/seccomp/seccomp_bpf.c+8−6

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

tools/testing/selftests/tpm2/test_smoke.sh+2−11

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

tools/testing/selftests/tpm2/test_space.sh+1−8

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

tools/testing/selftests/vm/Makefile+2−2

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

tools/testing/selftests/vm/run_vmtests+1−1

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

tools/testing/selftests/wireguard/netns.sh+51−3

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

tools/testing/selftests/wireguard/qemu/arch/powerpc64le.config+1−0

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

tools/testing/selftests/wireguard/qemu/debug.config+0−1

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

tools/virtio/Makefile+3−2

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

tools/virtio/asm/barrier.h+1−0

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

tools/virtio/generated/autoconf.h+0−0

Empty file added.

tools/virtio/linux/compiler.h+1−0

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

tools/vm/Makefile+2−0

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

virt/kvm/arm/hyp/aarch32.c+6−2

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

virt/kvm/arm/psci.c+40−0

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

virt/kvm/arm/vgic/vgic-init.c+16−3

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

virt/kvm/arm/vgic/vgic-its.c+9−2

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

virt/kvm/arm/vgic/vgic-mmio-v2.c+10−6

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

virt/kvm/arm/vgic/vgic-mmio-v3.c+18−13

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

virt/kvm/arm/vgic/vgic-mmio.c+170−58

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

virt/kvm/arm/vgic/vgic-mmio.h+19−0

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t