History

Merge branch 'i2c/for-current-fixed' into i2c/for-5.8

Wolfram Sang committed 6 years ago

Commit f89c3262 parents 6fe12cd efa7fb4915 files · +9363 −5274Browse files

Unified · Split

915 files
  1. .clang-format +14 −4
  2. .mailmap +2 −0
  3. Documentation/admin-guide/device-mapper/dm-integrity.rst +9 −6
  4. Documentation/admin-guide/kernel-parameters.txt +1 −2
  5. Documentation/admin-guide/sysctl/kernel.rst +19 −28
  6. Documentation/arm64/amu.rst +26 −21
  7. Documentation/core-api/timekeeping.rst +3 −3
  8. Documentation/devicetree/bindings/Makefile +12 −9
  9. Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml +6 −0
  10. Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml +1 −1
  11. Documentation/devicetree/bindings/display/bridge/adi,adv7123.txt +2 −2
  12. Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt +2 −2
  13. Documentation/devicetree/bindings/display/panel/leadtek,ltk500hd1829.yaml +0 −1
  14. Documentation/devicetree/bindings/display/panel/lvds.yaml +9 −1
  15. Documentation/devicetree/bindings/display/panel/xinpeng,xpp055c272.yaml +0 −1
  16. Documentation/devicetree/bindings/dma/adi,axi-dmac.txt +1 −1
  17. Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml +3 −4
  18. Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml +2 −2
  19. Documentation/devicetree/bindings/hwmon/adt7475.yaml +1 −1
  20. Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml +1 −1
  21. Documentation/devicetree/bindings/iio/dac/ad5755.txt +1 −1
  22. Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml +46 −51
  23. Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml +1 −1
  24. Documentation/devicetree/bindings/interrupt-controller/loongson,liointc.yaml +2 −3
  25. Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +23 −18
  26. Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.yaml +3 −1
  27. Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml +3 −1
  28. Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +1 −3
  29. Documentation/devicetree/bindings/net/ethernet-phy.yaml +3 −0
  30. Documentation/devicetree/bindings/net/fsl-fec.txt +2 −0
  31. Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml +1 −0
  32. Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt +1 −1
  33. Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml +3 −3
  34. Documentation/devicetree/bindings/phy/ti,phy-j721e-wiz.yaml +1 −1
  35. Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml +12 −5
  36. Documentation/devicetree/bindings/regulator/mps,mp5416.yaml +0 −1
  37. Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml +2 −1
  38. Documentation/devicetree/bindings/regulator/rohm,bd71828-regulator.yaml +5 −1
  39. Documentation/devicetree/bindings/regulator/rohm,bd71837-regulator.yaml +5 −1
  40. Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml +5 −1
  41. Documentation/devicetree/bindings/rng/brcm,bcm2835.yaml +1 −1
  42. Documentation/devicetree/bindings/sound/rockchip-i2s.yaml +3 −0
  43. Documentation/devicetree/bindings/sound/rockchip-spdif.txt +0 −45
  44. Documentation/devicetree/bindings/sound/rockchip-spdif.yaml +101 −0
  45. Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml +1 −1
  46. Documentation/devicetree/bindings/usb/ingenic,musb.yaml +1 −1
  47. Documentation/devicetree/bindings/usb/qcom,dwc3.txt +2 −2
  48. Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml +1 −0
  49. Documentation/devicetree/bindings/usb/renesas,usbhs.yaml +1 −0
  50. Documentation/devicetree/bindings/usb/rockchip,dwc3.txt +1 −1
  51. Documentation/devicetree/bindings/usb/usb-xhci.txt +2 −1
  52. Documentation/filesystems/debugfs.rst +2 −2
  53. Documentation/hwmon/isl68137.rst +38 −38
  54. Documentation/kbuild/makefiles.rst +2 −1
  55. Documentation/networking/devlink/devlink-trap.rst +2 −0
  56. Documentation/networking/index.rst +1 −0
  57. Documentation/networking/ip-sysctl.txt +8 −1
  58. Documentation/networking/net_dim.rst +49 −47
  59. Documentation/x86/boot.rst +18 −3
  60. MAINTAINERS +55 −37
  61. Makefile +1 −1
  62. arch/arc/include/asm/module.h +0 −5
  63. arch/arc/include/asm/vermagic.h +8 −0
  64. arch/arm/boot/compressed/head.S +2 −1
  65. arch/arm/boot/dts/bcm2835-rpi.dtsi +3 −0
  66. arch/arm/boot/dts/bcm283x.dtsi +1 −0
  67. arch/arm/boot/dts/imx6qdl.dtsi +3 −3
  68. arch/arm/boot/dts/imx6qp.dtsi +0 −1
  69. arch/arm/boot/dts/omap3-n950-n9.dtsi +5 −0
  70. arch/arm/include/asm/module.h +0 −24
  71. arch/arm/include/asm/vermagic.h +31 −0
  72. arch/arm/mach-imx/Makefile +2 −0
  73. arch/arm/net/bpf_jit_32.c +34 −18
  74. arch/arm/xen/enlighten.c +1 −1
  75. arch/arm64/include/asm/module.h +0 −2
  76. arch/arm64/include/asm/pointer_auth.h +6 −3
  77. arch/arm64/include/asm/sysreg.h +3 −1
  78. arch/arm64/include/asm/vermagic.h +10 −0
  79. arch/arm64/kernel/vdso.c +1 −12
  80. arch/arm64/kernel/vdso/Makefile +1 −1
  81. arch/h8300/kernel/.gitignore +2 −0
  82. arch/hexagon/include/asm/vermagic.h +4 −4
  83. arch/ia64/include/asm/module.h +0 −4
  84. arch/ia64/include/asm/vermagic.h +15 −0
  85. arch/m68k/include/asm/Kbuild +0 −1
  86. arch/mips/include/asm/module.h +0 −61
  87. arch/mips/include/asm/vermagic.h +66 −0
  88. arch/nds32/include/asm/vermagic.h +3 −5
  89. arch/powerpc/include/asm/module.h +0 −18
  90. arch/powerpc/include/asm/vermagic.h +20 −0
  91. arch/powerpc/kernel/entry_32.S +1 −1
  92. arch/powerpc/kernel/setup_64.c +2 −0
  93. arch/powerpc/kvm/book3s_64_mmu_hv.c +5 −4
  94. arch/powerpc/kvm/book3s_64_mmu_radix.c +5 −4
  95. arch/powerpc/mm/nohash/8xx.c +3 −0
  96. arch/powerpc/platforms/Kconfig.cputype +1 −1
  97. arch/riscv/Kconfig +2 −2
  98. arch/riscv/include/asm/module.h +0 −2
  99. arch/riscv/include/asm/vermagic.h +9 −0
  100. arch/riscv/kernel/sbi.c +10 −7
  101. arch/riscv/kernel/stacktrace.c +2 −2
  102. arch/riscv/kernel/vdso/Makefile +3 −3
  103. arch/riscv/net/bpf_jit_comp64.c +32 −17
  104. arch/s390/boot/uv.c +0 −2
  105. arch/s390/kernel/diag.c +1 −1
  106. arch/s390/kernel/smp.c +2 −2
  107. arch/s390/kernel/trace.c +1 −1
  108. arch/s390/kernel/uv.c +2 −1
  109. arch/s390/kvm/interrupt.c +1 −1
  110. arch/s390/kvm/kvm-s390.c +3 −0
  111. arch/s390/lib/uaccess.c +4 −0
  112. arch/s390/mm/pgalloc.c +14 −2
  113. arch/s390/pci/pci_irq.c +3 −2
  114. arch/sh/include/asm/module.h +0 −28
  115. arch/sh/include/asm/vermagic.h +34 −0
  116. arch/sh/mm/init.c +1 −1
  117. arch/um/Makefile +1 −0
  118. arch/x86/Kconfig +1 −1
  119. arch/x86/events/intel/cstate.c +1 −0
  120. arch/x86/hyperv/hv_init.c +15 −3
  121. arch/x86/include/asm/efi.h +2 −0
  122. arch/x86/include/asm/microcode_amd.h +1 −1
  123. arch/x86/include/asm/module.h +0 −60
  124. arch/x86/include/asm/mshyperv.h +2 −0
  125. arch/x86/include/asm/nospec-branch.h +0 −21
  126. arch/x86/include/asm/vermagic.h +68 −0
  127. arch/x86/kernel/cpu/intel.c +36 −18
  128. arch/x86/kernel/cpu/mshyperv.c +12 −2
  129. arch/x86/kernel/cpu/resctrl/core.c +2 −0
  130. arch/x86/kernel/cpu/resctrl/internal.h +1 −0
  131. arch/x86/kernel/cpu/resctrl/rdtgroup.c +15 −1
  132. arch/x86/kernel/smpboot.c +33 −14
  133. arch/x86/kernel/umip.c +1 −1
  134. arch/x86/kvm/Makefile +4 −0
  135. arch/x86/kvm/svm/sev.c +5 −1
  136. arch/x86/kvm/svm/svm.c +1 −9
  137. arch/x86/kvm/svm/vmenter.S +9 −1
  138. arch/x86/kvm/vmx/nested.c +19 −2
  139. arch/x86/kvm/vmx/vmx.c +1 −1
  140. arch/x86/kvm/x86.c +19 −2
  141. arch/x86/net/bpf_jit_comp.c +15 −3
  142. arch/x86/net/bpf_jit_comp32.c +22 −6
  143. arch/x86/platform/efi/efi_64.c +12 −4
  144. arch/xtensa/include/asm/vermagic.h +6 −9
  145. block/blk-iocost.c +2 −2
  146. block/blk-mq.c +3 −1
  147. block/blk-wbt.c +2 −2
  148. block/partitions/core.c +1 −1
  149. drivers/acpi/button.c +0 −12
  150. drivers/acpi/device_pm.c +2 −2
  151. drivers/acpi/pci_link.c +2 −2
  152. drivers/ata/ahci.c +1 −0
  153. drivers/ata/sata_inic162x.c +1 −1
  154. drivers/base/firmware_loader/fallback_table.c +0 −1
  155. drivers/base/power/main.c +1 −1
  156. drivers/block/null_blk.h +19 −10
  157. drivers/block/null_blk_main.c +31 −31
  158. drivers/block/null_blk_zoned.c +33 −12
  159. drivers/block/rbd.c +19 −14
  160. drivers/block/virtio_blk.c +1 −0
  161. drivers/char/hw_random/virtio-rng.c +1 −0
  162. drivers/char/tpm/tpm-interface.c +1 −1
  163. drivers/char/tpm/tpm2-cmd.c +1 −0
  164. drivers/char/tpm/tpm_ibmvtpm.c +73 −63
  165. drivers/char/tpm/tpm_tis_core.c +7 −1
  166. drivers/clk/clk-asm9260.c +1 −1
  167. drivers/clk/mmp/clk-pll.c +32 −1
  168. drivers/clk/mmp/clk.c +0 −31
  169. drivers/clk/mmp/clk.h +0 −7
  170. drivers/clk/sprd/sc9863a-clk.c +2 −1
  171. drivers/counter/104-quad-8.c +160 −34
  172. drivers/cpufreq/intel_pstate.c +1 −1
  173. drivers/crypto/caam/caamalg.c +7 −3
  174. drivers/crypto/caam/caamhash.c +6 −2
  175. drivers/crypto/caam/caampkc.c +6 −2
  176. drivers/crypto/chelsio/chcr_ktls.c +2 −4
  177. drivers/dma-buf/dma-buf.c +4 −3
  178. drivers/dma/Kconfig +2 −1
  179. drivers/dma/dmaengine.c +26 −34
  180. drivers/dma/dmatest.c +3 −3
  181. drivers/dma/mmp_tdma.c +4 −1
  182. drivers/dma/pch_dma.c +1 −1
  183. drivers/dma/tegra20-apb-dma.c +9 −0
  184. drivers/dma/ti/k3-psil.c +1 −0
  185. drivers/dma/xilinx/xilinx_dma.c +10 −10
  186. drivers/firmware/efi/cper.c +1 −1
  187. drivers/firmware/efi/libstub/efistub.h +1 −1
  188. drivers/firmware/efi/libstub/file.c +14 −13
  189. drivers/firmware/efi/libstub/x86-stub.c +11 −7
  190. drivers/firmware/imx/Kconfig +2 −2
  191. drivers/firmware/xilinx/zynqmp-debug.c +1 −1
  192. drivers/fpga/dfl-pci.c +4 −2
  193. drivers/fpga/zynq-fpga.c +2 −1
  194. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +20 −2
  195. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 −1
  196. drivers/gpu/drm/amd/amdgpu/cik.c +0 −2
  197. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 −1
  198. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 −0
  199. drivers/gpu/drm/amd/amdgpu/navi10_sdma_pkt_open.h +16 −0
  200. drivers/gpu/drm/amd/amdgpu/nv.c +0 −4
  201. drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +13 −1
  202. drivers/gpu/drm/amd/amdgpu/soc15.c +0 −4
  203. drivers/gpu/drm/amd/amdgpu/vi.c +0 −2
  204. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +41 −11
  205. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +9 −6
  206. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +2 −1
  207. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +27 −0
  208. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +4 −36
  209. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 −0
  210. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +10 −0
  211. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 −0
  212. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +1 −0
  213. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +15 −0
  214. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h +14 −6
  215. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +12 −2
  216. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 −1
  217. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +1 −0
  218. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c +1 −0
  219. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.h +2 −1
  220. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +4 −0
  221. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +1 −0
  222. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +33 −44
  223. drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +16 −0
  224. drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 −0
  225. drivers/gpu/drm/amd/powerplay/amd_powerplay.c +5 −4
  226. drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +26 −0
  227. drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +4 −1
  228. drivers/gpu/drm/amd/powerplay/renoir_ppt.c +6 −1
  229. drivers/gpu/drm/amd/powerplay/smu_v11_0.c +6 −0
  230. drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +3 −0
  231. drivers/gpu/drm/drm_dp_mst_topology.c +7 −2
  232. drivers/gpu/drm/drm_edid.c +1 −1
  233. drivers/gpu/drm/i915/display/intel_ddi.c +11 −3
  234. drivers/gpu/drm/i915/display/intel_display_power.c +6 −6
  235. drivers/gpu/drm/i915/display/intel_dp.c +2 −3
  236. drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 −0
  237. drivers/gpu/drm/i915/display/intel_hdmi.c +2 −1
  238. drivers/gpu/drm/i915/display/intel_sprite.c +12 −5
  239. drivers/gpu/drm/i915/gem/i915_gem_tiling.c +18 −2
  240. drivers/gpu/drm/i915/gem/selftests/huge_pages.c +8 −4
  241. drivers/gpu/drm/i915/gt/intel_rps.c +6 −3
  242. drivers/gpu/drm/i915/gt/intel_timeline.c +2 −0
  243. drivers/gpu/drm/i915/gvt/kvmgt.c +22 −24
  244. drivers/gpu/drm/i915/i915_drv.h +2 −0
  245. drivers/gpu/drm/i915/i915_irq.c +2 −4
  246. drivers/gpu/drm/i915/i915_perf.c +11 −54
  247. drivers/gpu/drm/i915/i915_reg.h +2 −2
  248. drivers/gpu/drm/i915/i915_vma.c +6 −4
  249. drivers/gpu/drm/meson/meson_dw_hdmi.c +1 −3
  250. drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp108.c +3 −0
  251. drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c +16 −0
  252. drivers/gpu/drm/qxl/qxl_cmd.c +5 −5
  253. drivers/gpu/drm/qxl/qxl_display.c +3 −3
  254. drivers/gpu/drm/qxl/qxl_draw.c +4 −3
  255. drivers/gpu/drm/qxl/qxl_image.c +2 −1
  256. drivers/gpu/drm/qxl/qxl_ioctl.c +1 −4
  257. drivers/gpu/drm/scheduler/sched_main.c +1 −1
  258. drivers/gpu/drm/tidss/tidss_crtc.c +13 −3
  259. drivers/gpu/drm/tidss/tidss_encoder.c +11 −3
  260. drivers/gpu/drm/tidss/tidss_plane.c +18 −6
  261. drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 −0
  262. drivers/gpu/drm/virtio/virtgpu_kms.c +7 −11
  263. drivers/hv/channel_mgmt.c +3 −0
  264. drivers/hv/hv.c +1 −5
  265. drivers/hv/hv_debugfs.c +1 −1
  266. drivers/hv/hv_trace.h +2 −2
  267. drivers/hv/hyperv_vmbus.h +1 −1
  268. drivers/hv/vmbus_drv.c +78 −27
  269. drivers/hwmon/Kconfig +1 −1
  270. drivers/hwmon/drivetemp.c +6 −0
  271. drivers/hwmon/jc42.c +1 −1
  272. drivers/hwmon/k10temp.c +3 −3
  273. drivers/hwmon/pmbus/isl68137.c +85 −7
  274. drivers/i2c/algos/i2c-algo-pca.c +1 −1
  275. drivers/i2c/busses/i2c-altera.c +13 −6
  276. drivers/i2c/busses/i2c-amd-mp2-pci.c +1 −1
  277. drivers/i2c/busses/i2c-aspeed.c +4 −1
  278. drivers/i2c/busses/i2c-at91-master.c +17 −3
  279. drivers/i2c/busses/i2c-bcm-iproc.c +3 −0
  280. drivers/i2c/busses/i2c-designware-platdrv.c +10 −4
  281. drivers/i2c/i2c-core-base.c +17 −20
  282. drivers/i2c/i2c-core-of.c +1 −1
  283. drivers/i2c/muxes/i2c-demux-pinctrl.c +1 −0
  284. drivers/iio/adc/ad7192.c +47 −16
  285. drivers/iio/adc/ad7793.c +1 −1
  286. drivers/iio/adc/stm32-adc.c +28 −3
  287. drivers/iio/adc/ti-ads8344.c +3 −3
  288. drivers/iio/adc/xilinx-xadc-core.c +74 −21
  289. drivers/iio/common/st_sensors/st_sensors_core.c +1 −1
  290. drivers/iio/dac/ad5770r.c +1 −1
  291. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +10 −1
  292. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +3 −0
  293. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +16 −7
  294. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +23 −1
  295. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c +22 −7
  296. drivers/iio/industrialio-core.c +2 −5
  297. drivers/infiniband/core/cm.c +14 −12
  298. drivers/infiniband/core/rdma_core.c +4 −5
  299. drivers/infiniband/core/uverbs_main.c +4 −0
  300. drivers/infiniband/hw/i40iw/i40iw_ctrl.c +1 −1
  301. drivers/infiniband/hw/mlx4/main.c +2 −1
  302. drivers/infiniband/hw/mlx5/qp.c +3 −1
  303. drivers/infiniband/sw/rdmavt/cq.c +2 −2
  304. drivers/infiniband/sw/rdmavt/mmap.c +2 −2
  305. drivers/infiniband/sw/rdmavt/qp.c +2 −2
  306. drivers/infiniband/sw/rdmavt/srq.c +2 −2
  307. drivers/infiniband/sw/siw/siw_qp_tx.c +11 −4
  308. drivers/interconnect/qcom/bcm-voter.c +3 −2
  309. drivers/iommu/Kconfig +2 −2
  310. drivers/iommu/amd_iommu_init.c +1 −1
  311. drivers/iommu/intel-iommu.c +2 −2
  312. drivers/iommu/iommu.c +2 −1
  313. drivers/iommu/qcom_iommu.c +4 −1
  314. drivers/irqchip/irq-bcm7038-l1.c +1 −1
  315. drivers/irqchip/irq-gic-v3-its.c +20 −0
  316. drivers/irqchip/irq-gic-v3.c +7 −4
  317. drivers/irqchip/irq-mbigen.c +7 −1
  318. drivers/irqchip/irq-meson-gpio.c +10 −8
  319. drivers/irqchip/irq-mvebu-icu.c +1 −1
  320. drivers/irqchip/irq-sifive-plic.c +1 −1
  321. drivers/irqchip/irq-ti-sci-inta.c +2 −1
  322. drivers/isdn/hardware/mISDN/mISDNisar.c +2 −2
  323. drivers/md/dm-mpath.c +4 −2
  324. drivers/md/dm-verity-fec.c +1 −1
  325. drivers/md/dm-writecache.c +37 −15
  326. drivers/misc/mei/pci-me.c +2 −1
  327. drivers/misc/mic/Kconfig +1 −1
  328. drivers/mmc/core/mmc_ops.c +1 −1
  329. drivers/mmc/host/cqhci.c +10 −11
  330. drivers/mmc/host/meson-mx-sdio.c +1 −10
  331. drivers/mmc/host/sdhci-msm.c +2 −0
  332. drivers/mmc/host/sdhci-pci-core.c +3 −0
  333. drivers/mmc/host/sdhci-xenon.c +10 −0
  334. drivers/mtd/spi-nor/Makefile +2 −0
  335. drivers/net/caif/Kconfig +1 −1
  336. drivers/net/dsa/b53/b53_common.c +33 −5
  337. drivers/net/dsa/b53/b53_regs.h +6 −2
  338. drivers/net/dsa/mt7530.c +12 −91
  339. drivers/net/dsa/mt7530.h +7 −10
  340. drivers/net/dsa/mv88e6xxx/chip.c +3 −2
  341. drivers/net/dsa/ocelot/felix.c +1 −4
  342. drivers/net/ethernet/amd/xgbe/xgbe-drv.c +1 −1
  343. drivers/net/ethernet/broadcom/bcmsysport.c +2 −2
  344. drivers/net/ethernet/broadcom/bgmac-platform.c +11 −22
  345. drivers/net/ethernet/broadcom/genet/bcmgenet.c +5 −1
  346. drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +20 −7
  347. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +6 −21
  348. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +1 −1
  349. drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +3 −0
  350. drivers/net/ethernet/dec/tulip/tulip_core.c +1 −1
  351. drivers/net/ethernet/freescale/fec.h +7 −0
  352. drivers/net/ethernet/freescale/fec_main.c +120 −29
  353. drivers/net/ethernet/intel/e1000/e1000_main.c +1 −1
  354. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −2
  355. drivers/net/ethernet/marvell/mvneta.c +1 −1
  356. drivers/net/ethernet/mediatek/mtk_eth_soc.c +23 −1
  357. drivers/net/ethernet/mediatek/mtk_eth_soc.h +8 −0
  358. drivers/net/ethernet/mellanox/mlx4/en_tx.c +13 −1
  359. drivers/net/ethernet/mellanox/mlx5/core/Kconfig +4 −4
  360. drivers/net/ethernet/mellanox/mlx5/core/devlink.c +4 −1
  361. drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +3 −3
  362. drivers/net/ethernet/mellanox/mlx5/core/en.h +2 −1
  363. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +19 −23
  364. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c +3 −0
  365. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +7 −2
  366. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +5 −4
  367. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +5 −3
  368. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +5 −3
  369. drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +5 −1
  370. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +0 −1
  371. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +3 −9
  372. drivers/net/ethernet/mellanox/mlx5/core/health.c +1 −1
  373. drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c +2 −2
  374. drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c +2 −2
  375. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +1 −1
  376. drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +2 −2
  377. drivers/net/ethernet/mscc/ocelot.c +43 −41
  378. drivers/net/ethernet/mscc/ocelot.h +0 −2
  379. drivers/net/ethernet/neterion/s2io.c +1 −1
  380. drivers/net/ethernet/pensando/ionic/ionic_lif.c +27 −17
  381. drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c +43 −10
  382. drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h +1 −1
  383. drivers/net/ethernet/sgi/meth.h +0 −16
  384. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +189 −0
  385. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h +23 −0
  386. drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +1 −0
  387. drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +8 −3
  388. drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +2 −0
  389. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +8 −4
  390. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +23 −0
  391. drivers/net/ethernet/ti/am65-cpsw-nuss.c +3 −3
  392. drivers/net/ethernet/xscale/ixp4xx_eth.c +2 −0
  393. drivers/net/geneve.c +1 −1
  394. drivers/net/ipa/ipa_modem.c +2 −3
  395. drivers/net/macsec.c +9 −5
  396. drivers/net/macvlan.c +1 −1
  397. drivers/net/phy/bcm84881.c +3 −3
  398. drivers/net/phy/marvell.c +24 −22
  399. drivers/net/phy/marvell10g.c +34 −3
  400. drivers/net/phy/mdio_bus.c +1 −1
  401. drivers/net/phy/micrel.c +1 −1
  402. drivers/net/phy/microchip_t1.c +171 −0
  403. drivers/net/team/team.c +4 −0
  404. drivers/net/tun.c +2 −1
  405. drivers/net/vrf.c +6 −4
  406. drivers/net/vxlan.c +3 −3
  407. drivers/net/wimax/i2400m/usb-fw.c +1 −0
  408. drivers/net/wireless/ath/ath11k/thermal.h +2 −1
  409. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +9 −0
  410. drivers/net/wireless/intel/iwlegacy/3945-rs.c +1 −1
  411. drivers/net/wireless/intel/iwlegacy/4965-rs.c +1 −1
  412. drivers/net/wireless/intel/iwlwifi/dvm/rs.c +1 −1
  413. drivers/net/wireless/intel/iwlwifi/fw/acpi.c +7 −2
  414. drivers/net/wireless/intel/iwlwifi/fw/api/txq.h +3 −3
  415. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1 −1
  416. drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +2 −4
  417. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +11 −14
  418. drivers/net/wireless/intel/iwlwifi/mvm/rs.c +1 −1
  419. drivers/net/wireless/intel/iwlwifi/mvm/rx.c +11 −2
  420. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +7 −2
  421. drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +14 −4
  422. drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +3 −0
  423. drivers/net/wireless/mac80211_hwsim.c +7 −7
  424. drivers/net/wireless/realtek/rtlwifi/rc.c +1 −1
  425. drivers/net/wireless/realtek/rtw88/pci.c +3 −8
  426. drivers/nvme/host/core.c +2 −0
  427. drivers/of/overlay.c +2 −0
  428. drivers/of/unittest-data/overlay_bad_add_dup_prop.dts +19 −4
  429. drivers/of/unittest.c +19 −9
  430. drivers/opp/core.c +14 −0
  431. drivers/pci/quirks.c +7 −0
  432. drivers/phy/tegra/Kconfig +2 −1
  433. drivers/platform/chrome/cros_ec_sensorhub_ring.c +4 −4
  434. drivers/ptp/ptp_ines.c +2 −2
  435. drivers/remoteproc/mtk_common.h +1 −1
  436. drivers/remoteproc/mtk_scp.c +3 −3
  437. drivers/remoteproc/qcom_q6v5_mss.c +20 −13
  438. drivers/remoteproc/remoteproc_sysfs.c +1 −0
  439. drivers/remoteproc/stm32_rproc.c +1 −0
  440. drivers/rpmsg/mtk_rpmsg.c +1 −0
  441. drivers/s390/block/Kconfig +0 −1
  442. drivers/scsi/Kconfig +1 −1
  443. drivers/scsi/hisi_sas/Kconfig +1 −0
  444. drivers/scsi/qla2xxx/qla_dbg.c +2 −1
  445. drivers/scsi/qla2xxx/qla_init.c +0 −2
  446. drivers/scsi/qla2xxx/qla_isr.c +0 −1
  447. drivers/scsi/qla2xxx/qla_mbx.c +0 −2
  448. drivers/scsi/qla2xxx/qla_os.c +17 −18
  449. drivers/scsi/scsi_lib.c +1 −0
  450. drivers/scsi/sg.c +6 −2
  451. drivers/soc/fsl/dpio/dpio-service.c +14 −5
  452. drivers/soc/fsl/dpio/qbman-portal.c +2 −4
  453. drivers/soc/imx/Kconfig +1 −0
  454. drivers/soc/xilinx/Kconfig +2 −2
  455. drivers/staging/comedi/comedi_fops.c +3 −1
  456. drivers/staging/comedi/drivers/dt2815.c +3 −0
  457. drivers/staging/gasket/apex_driver.c +0 −7
  458. drivers/staging/gasket/gasket_sysfs.c +1 −2
  459. drivers/staging/gasket/gasket_sysfs.h +0 −4
  460. drivers/staging/vt6656/key.c +3 −11
  461. drivers/staging/vt6656/main_usb.c +17 −14
  462. drivers/staging/vt6656/usbpipe.c +2 −1
  463. drivers/target/target_core_fabric_lib.c +3 −2
  464. drivers/target/target_core_iblock.c +1 −1
  465. drivers/target/target_core_user.c +1 −0
  466. drivers/tty/hvc/Kconfig +1 −1
  467. drivers/tty/hvc/hvc_console.c +14 −9
  468. drivers/tty/rocket.c +14 −11
  469. drivers/tty/serial/Kconfig +1 −1
  470. drivers/tty/serial/bcm63xx_uart.c +3 −1
  471. drivers/tty/serial/owl-uart.c +7 −0
  472. drivers/tty/serial/sh-sci.c +10 −3
  473. drivers/tty/serial/sunhv.c +3 −0
  474. drivers/tty/serial/xilinx_uartps.c +49 −162
  475. drivers/tty/sysrq.c +2 −0
  476. drivers/tty/vt/vt.c +4 −3
  477. drivers/usb/class/cdc-acm.c +31 −5
  478. drivers/usb/class/cdc-acm.h +4 −1
  479. drivers/usb/core/hub.c +15 −3
  480. drivers/usb/core/message.c +8 −1
  481. drivers/usb/core/quirks.c +4 −0
  482. drivers/usb/dwc3/core.h +6 −2
  483. drivers/usb/dwc3/gadget.c +47 −29
  484. drivers/usb/early/xhci-dbc.c +4 −4
  485. drivers/usb/early/xhci-dbc.h +16 −2
  486. drivers/usb/gadget/function/f_fs.c +4 −0
  487. drivers/usb/gadget/legacy/raw_gadget.c +42 −29
  488. drivers/usb/gadget/udc/atmel_usba_udc.c +2 −2
  489. drivers/usb/gadget/udc/bdc/bdc_ep.c +1 −1
  490. drivers/usb/host/xhci-hub.c +9 −0
  491. drivers/usb/host/xhci-ring.c +40 −6
  492. drivers/usb/host/xhci.c +7 −7
  493. drivers/usb/host/xhci.h +3 −2
  494. drivers/usb/misc/sisusbvga/sisusb.c +10 −10
  495. drivers/usb/misc/sisusbvga/sisusb_init.h +7 −7
  496. drivers/usb/storage/uas.c +43 −3
  497. drivers/usb/storage/unusual_devs.h +7 −0
  498. drivers/usb/typec/bus.c +4 −1
  499. drivers/usb/typec/mux/pi3usb30532.c +2 −2
  500. drivers/usb/typec/tcpm/tcpm.c +26 −0
  501. drivers/vdpa/Kconfig +6 −12
  502. drivers/vdpa/ifcvf/ifcvf_base.c +0 −2
  503. drivers/vdpa/ifcvf/ifcvf_main.c +1 −3
  504. drivers/vdpa/vdpa.c +1 −1
  505. drivers/vdpa/vdpa_sim/vdpa_sim.c +2 −2
  506. drivers/vfio/vfio_iommu_type1.c +5 −5
  507. drivers/vhost/Kconfig +16 −5
  508. drivers/vhost/net.c +15 −13
  509. drivers/vhost/scsi.c +7 −7
  510. drivers/vhost/test.c +7 −7
  511. drivers/vhost/vdpa.c +0 −5
  512. drivers/vhost/vhost.h +27 −0
  513. drivers/vhost/vringh.c +5 −0
  514. drivers/vhost/vsock.c +7 −7
  515. drivers/virtio/Kconfig +1 −1
  516. drivers/virtio/virtio_balloon.c +2 −2
  517. drivers/virtio/virtio_input.c +1 −0
  518. drivers/watchdog/sp805_wdt.c +4 −0
  519. drivers/xen/xenbus/xenbus_client.c +8 −1
  520. fs/afs/cmservice.c +1 −1
  521. fs/afs/dir.c +67 −41
  522. fs/afs/dir_silly.c +15 −7
  523. fs/afs/fs_probe.c +1 −4
  524. fs/afs/fsclient.c +16 −11
  525. fs/afs/internal.h +1 −3
  526. fs/afs/rotate.c +3 −3
  527. fs/afs/server.c +2 −5
  528. fs/afs/vl_rotate.c +2 −2
  529. fs/afs/volume.c +5 −3
  530. fs/afs/yfsclient.c +14 −12
  531. fs/block_dev.c +10 −1
  532. fs/btrfs/backref.c +1 −1
  533. fs/btrfs/block-group.c +15 −6
  534. fs/btrfs/discard.h +1 −1
  535. fs/btrfs/disk-io.c +32 −4
  536. fs/btrfs/file.c +15 −0
  537. fs/btrfs/reflink.c +1 −0
  538. fs/btrfs/relocation.c +20 −4
  539. fs/btrfs/space-info.c +14 −6
  540. fs/btrfs/transaction.c +11 −2
  541. fs/btrfs/tree-log.c +54 −82
  542. fs/buffer.c +12 −1
  543. fs/ceph/dir.c +2 −2
  544. fs/ceph/file.c +2 −2
  545. fs/ceph/mds_client.h +1 −1
  546. fs/cifs/cifsglob.h +2 −1
  547. fs/cifs/cifssmb.c +4 −0
  548. fs/cifs/connect.c +6 −0
  549. fs/cifs/inode.c +1 −1
  550. fs/cifs/misc.c +65 −17
  551. fs/cifs/smb2ops.c +5 −0
  552. fs/cifs/smb2pdu.c +15 −0
  553. fs/cifs/smb2transport.c +2 −2
  554. fs/coredump.c +2 −0
  555. fs/debugfs/file.c +3 −12
  556. fs/exfat/balloc.c +0 −3
  557. fs/exfat/exfat_fs.h +1 −0
  558. fs/exfat/file.c +2 −0
  559. fs/exfat/misc.c +13 −1
  560. fs/exfat/namei.c +7 −0
  561. fs/exfat/super.c +22 −31
  562. fs/ext4/balloc.c +2 −2
  563. fs/ext4/ext4_jbd2.c +0 −3
  564. fs/ext4/extents.c +4 −4
  565. fs/ext4/ialloc.c +2 −2
  566. fs/ext4/inode.c +2 −2
  567. fs/ext4/mballoc.c +4 −2
  568. fs/ext4/super.c +1 −3
  569. fs/io_uring.c +192 −165
  570. fs/ioctl.c +8 −0
  571. fs/iomap/fiemap.c +1 −4
  572. fs/nfs/nfs3acl.c +15 −7
  573. fs/nfs/nfs4proc.c +9 −2
  574. fs/nfs/pnfs.c +7 −7
  575. fs/nfs/super.c +1 −1
  576. fs/nfsd/nfs4callback.c +3 −1
  577. fs/nfsd/nfs4state.c +2 −0
  578. fs/ocfs2/dlmfs/dlmfs.c +12 −15
  579. fs/pnode.c +4 −5
  580. fs/proc/base.c +13 −2
  581. fs/proc/root.c +7 −0
  582. fs/proc/vmcore.c +3 −2
  583. fs/super.c +1 −1
  584. fs/xfs/xfs_icache.c +10 −0
  585. fs/xfs/xfs_ioctl.c +4 −1
  586. fs/xfs/xfs_mount.h +5 −1
  587. fs/xfs/xfs_reflink.c +1 −0
  588. fs/xfs/xfs_super.c +22 −18
  589. include/asm-generic/Kbuild +1 −0
  590. include/asm-generic/mshyperv.h +1 −1
  591. include/asm-generic/vermagic.h +7 −0
  592. include/linux/backing-dev-defs.h +0 −1
  593. include/linux/bio.h +1 −1
  594. include/linux/blk-mq.h +1 −1
  595. include/linux/blk_types.h +1 −1
  596. include/linux/buffer_head.h +8 −0
  597. include/linux/can/dev/peak_canfd.h +2 −2
  598. include/linux/cpu_rmap.h +1 −1
  599. include/linux/debugfs.h +4 −8
  600. include/linux/digsig.h +2 −2
  601. include/linux/dirent.h +1 −1
  602. include/linux/dma-buf.h +1 −2
  603. include/linux/dmaengine.h +6 −6
  604. include/linux/enclosure.h +1 −1
  605. include/linux/energy_model.h +1 −1
  606. include/linux/ethtool.h +2 −2
  607. include/linux/genalloc.h +1 −1
  608. include/linux/i2c-mux.h +1 −1
  609. include/linux/i2c.h +1 −7
  610. include/linux/igmp.h +1 −1
  611. include/linux/ihex.h +1 −1
  612. include/linux/iio/iio.h +1 −1
  613. include/linux/irq.h +2 −4
  614. include/linux/irqchip/arm-gic-v3.h +2 −0
  615. include/linux/kvm_host.h +1 −1
  616. include/linux/list_lru.h +1 −1
  617. include/linux/memcontrol.h +2 −2
  618. include/linux/nfs_xdr.h +2 −0
  619. include/linux/platform_data/wilco-ec.h +1 −1
  620. include/linux/pnp.h +9 −20
  621. include/linux/posix_acl.h +1 −1
  622. include/linux/rio.h +2 −2
  623. include/linux/rslib.h +1 −1
  624. include/linux/sched/topology.h +1 −1
  625. include/linux/skbuff.h +1 −1
  626. include/linux/stmmac.h +2 −0
  627. include/linux/sunrpc/clnt.h +12 −1
  628. include/linux/sunrpc/svc_rdma.h +1 −0
  629. include/linux/swap.h +1 −1
  630. include/linux/ti_wilink_st.h +3 −3
  631. include/linux/tpm_eventlog.h +3 −3
  632. include/linux/tracepoint.h +1 −21
  633. include/linux/vdpa.h +1 −1
  634. include/linux/vermagic.h +5 −3
  635. include/linux/virtio.h +0 −1
  636. include/linux/vmalloc.h +1 −1
  637. include/linux/vringh.h +6 −0
  638. include/linux/xattr.h +1 −1
  639. include/net/cfg80211.h +10 −0
  640. include/net/ip6_route.h +1 −0
  641. include/net/mac80211.h +3 −1
  642. include/net/ndisc.h +1 −1
  643. include/net/netfilter/nf_tables.h +1 −1
  644. include/net/sock.h +3 −3
  645. include/net/tcp.h +1 −1
  646. include/soc/mscc/ocelot.h +3 −1
  647. include/soc/tegra/pmc.h +9 −6
  648. include/sound/hda_codec.h +5 −0
  649. include/sound/soc-dai.h +0 −1
  650. include/sound/soc.h +3 −0
  651. include/trace/events/iocost.h +3 −3
  652. include/trace/events/rpcrdma.h +40 −22
  653. include/trace/events/wbt.h +4 −4
  654. include/trace/events/writeback.h +0 −1
  655. include/uapi/drm/amdgpu_drm.h +4 −0
  656. include/uapi/linux/bpf.h +1 −1
  657. include/uapi/linux/btrfs.h +4 −6
  658. include/uapi/linux/dlm_device.h +2 −2
  659. include/uapi/linux/dma-buf.h +6 −0
  660. include/uapi/linux/fiemap.h +1 −1
  661. include/uapi/linux/hyperv.h +2 −2
  662. include/uapi/linux/netfilter/nf_tables.h +2 −0
  663. include/uapi/linux/netfilter/xt_IDLETIMER.h +1 −0
  664. include/uapi/linux/virtio_balloon.h +9 −2
  665. include/vdso/datapage.h +2 −2
  666. kernel/audit.c +3 −0
  667. kernel/bpf/bpf_lru_list.h +1 −1
  668. kernel/bpf/cpumap.c +1 −1
  669. kernel/bpf/syscall.c +17 −12
  670. kernel/bpf/verifier.c +29 −12
  671. kernel/events/core.c +10 −3
  672. kernel/exit.c +1 −0
  673. kernel/fork.c +10 −1
  674. kernel/irq/manage.c +0 −44
  675. kernel/power/hibernate.c +7 −0
  676. kernel/rcu/tree.c +1 −1
  677. kernel/sched/core.c +2 −7
  678. kernel/sched/cputime.c +2 −2
  679. kernel/sched/isolation.c +19 −2
  680. kernel/signal.c +10 −10
  681. kernel/time/namespace.c +14 −1
  682. kernel/trace/ftrace.c +1 −0
  683. kernel/trace/trace_events_hist.c +7 −0
  684. kernel/trace/trace_events_trigger.c +3 −7
  685. kernel/trace/tracing_map.c +3 −3
  686. lib/Kconfig.debug +2 −0
  687. lib/kunit/test.c +1 −1
  688. lib/mpi/longlong.h +17 −17
  689. mm/gup.c +1 −1
  690. mm/hugetlb.c +8 −6
  691. mm/ksm.c +10 −2
  692. mm/madvise.c +18 −0
  693. mm/mremap.c +12 −1
  694. mm/shmem.c +8 −5
  695. mm/slub.c +10 −2
  696. mm/vmalloc.c +13 −3
  697. net/core/dev.c +4 −2
  698. net/core/filter.c +1 −1
  699. net/core/net-sysfs.c +1 −1
  700. net/core/netclassid_cgroup.c +1 −3
  701. net/core/sock.c +1 −1
  702. net/dsa/port.c +6 −1
  703. net/dsa/slave.c +3 −5
  704. net/hsr/hsr_netlink.c +8 −2
  705. net/ipv4/devinet.c +9 −4
  706. net/ipv4/fib_semantics.c +3 −3
  707. net/ipv4/xfrm4_output.c +0 −2
  708. net/ipv6/icmp.c +20 −1
  709. net/ipv6/ipv6_sockglue.c +6 −7
  710. net/ipv6/rpl.c +4 −3
  711. net/ipv6/seg6.c +1 −1
  712. net/ipv6/xfrm6_output.c +0 −2
  713. net/l2tp/l2tp_netlink.c +8 −8
  714. net/mac80211/main.c +16 −13
  715. net/mac80211/mesh.c +7 −4
  716. net/mac80211/rate.c +4 −11
  717. net/mac80211/rate.h +23 −0
  718. net/mac80211/rc80211_minstrel_ht.c +13 −6
  719. net/mac80211/sta_info.c +2 −1
  720. net/mptcp/options.c +1 −2
  721. net/mptcp/pm_netlink.c +7 −5
  722. net/mptcp/protocol.c +27 −17
  723. net/mptcp/protocol.h +4 −4
  724. net/mptcp/subflow.c +71 −28
  725. net/netfilter/ipset/ip_set_core.c +2 −1
  726. net/netfilter/nf_flow_table_core.c +4 −2
  727. net/netfilter/nf_nat_proto.c +2 −2
  728. net/netfilter/nf_tables_api.c +4 −3
  729. net/netfilter/nft_lookup.c +7 −5
  730. net/netfilter/nft_set_bitmap.c +0 −1
  731. net/netfilter/nft_set_rbtree.c +11 −12
  732. net/netfilter/xt_IDLETIMER.c +3 −0
  733. net/netlabel/Kconfig +1 −1
  734. net/netrom/nr_route.c +1 −0
  735. net/openvswitch/conntrack.c +2 −1
  736. net/openvswitch/datapath.c +3 −1
  737. net/qrtr/qrtr.c +4 −3
  738. net/rds/message.c +9 −16
  739. net/rds/rdma.c +35 −30
  740. net/rds/rds.h +3 −17
  741. net/rds/send.c +4 −2
  742. net/rxrpc/local_object.c +0 −9
  743. net/rxrpc/output.c +12 −32
  744. net/sched/cls_api.c +1 −0
  745. net/sched/sch_etf.c +4 −3
  746. net/sctp/sm_make_chunk.c +5 −1
  747. net/sctp/sm_statefuns.c +3 −3
  748. net/sunrpc/cache.c +3 −2
  749. net/sunrpc/clnt.c +18 −6
  750. net/sunrpc/svc_xprt.c +2 −3
  751. net/sunrpc/svcsock.c +4 −0
  752. net/sunrpc/xprtrdma/rpc_rdma.c +11 −4
  753. net/sunrpc/xprtrdma/svc_rdma_backchannel.c +2 −0
  754. net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +22 −0
  755. net/sunrpc/xprtrdma/svc_rdma_rw.c +1 −2
  756. net/sunrpc/xprtrdma/svc_rdma_sendto.c +12 −17
  757. net/sunrpc/xprtrdma/svc_rdma_transport.c +0 −5
  758. net/sunrpc/xprtrdma/verbs.c +2 −1
  759. net/sunrpc/xprtsock.c +1 −0
  760. net/tipc/crypto.c +1 −0
  761. net/tipc/link.c +1 −1
  762. net/tipc/node.c +3 −1
  763. net/tls/tls_main.c +2 −2
  764. net/wireless/nl80211.c +2 −4
  765. net/x25/x25_dev.c +3 −1
  766. net/xdp/xdp_umem.c +2 −3
  767. net/xdp/xsk.c +3 −2
  768. samples/vfio-mdev/mdpy.c +1 −1
  769. scripts/Makefile.lib +1 −1
  770. scripts/checkpatch.pl +1 −1
  771. scripts/config +4 −1
  772. scripts/documentation-file-ref-check +1 −1
  773. scripts/dtc/Makefile +1 −1
  774. scripts/kernel-doc +1 −1
  775. security/keys/proc.c +2 −0
  776. security/selinux/hooks.c +45 −25
  777. security/selinux/ss/conditional.c +1 −1
  778. security/selinux/ss/policydb.c +4 −4
  779. sound/core/oss/pcm_plugin.c +6 −4
  780. sound/hda/Kconfig +4 −3
  781. sound/isa/opti9xx/miro.c +6 −3
  782. sound/isa/opti9xx/opti92x-ad1848.c +6 −3
  783. sound/pci/ctxfi/cthw20k1.c +7 −7
  784. sound/pci/hda/hda_codec.c +17 −11
  785. sound/pci/hda/hda_intel.c +56 −50
  786. sound/pci/hda/hda_intel.h +1 −0
  787. sound/pci/hda/patch_hdmi.c +14 −1
  788. sound/pci/hda/patch_realtek.c +10 −3
  789. sound/soc/amd/acp3x-rt5682-max9836.c +3 −3
  790. sound/soc/codecs/Kconfig +3 −0
  791. sound/soc/codecs/hdac_hdmi.c +3 −3
  792. sound/soc/codecs/madera.c +0 −4
  793. sound/soc/codecs/sgtl5000.c +34 −0
  794. sound/soc/codecs/sgtl5000.h +1 −0
  795. sound/soc/codecs/tas571x.c +15 −5
  796. sound/soc/codecs/wm8960.c +1 −2
  797. sound/soc/codecs/wsa881x.c +4 −0
  798. sound/soc/intel/common/soc-acpi-intel-cml-match.c +0 −8
  799. sound/soc/intel/common/soc-acpi-intel-icl-match.c +0 −8
  800. sound/soc/meson/axg-card.c +3 −1
  801. sound/soc/meson/gx-card.c +3 −1
  802. sound/soc/qcom/apq8096.c +1 −3
  803. sound/soc/qcom/qdsp6/q6afe-dai.c +16 −0
  804. sound/soc/qcom/sdm845.c +1 −3
  805. sound/soc/samsung/s3c-i2s-v2.c +0 −57
  806. sound/soc/samsung/s3c2412-i2s.c +56 −0
  807. sound/soc/sh/rcar/ssi.c +10 −1
  808. sound/soc/sh/rcar/ssiu.c +1 −1
  809. sound/soc/soc-dai.c +2 −9
  810. sound/soc/soc-dapm.c +75 −72
  811. sound/soc/soc-pcm.c +11 −2
  812. sound/soc/soc-topology.c +89 −26
  813. sound/soc/sof/intel/bdw.c +16 −0
  814. sound/soc/sof/intel/byt.c +48 −0
  815. sound/soc/stm/stm32_sai_sub.c +6 −8
  816. sound/usb/format.c +51 −0
  817. sound/usb/line6/podhd.c +5 −17
  818. sound/usb/mixer.c +52 −14
  819. sound/usb/mixer.h +10 −0
  820. sound/usb/mixer_maps.c +37 −4
  821. sound/usb/mixer_quirks.c +8 −4
  822. sound/usb/quirks-table.h +14 −84
  823. sound/usb/quirks.c +15 −1
  824. sound/usb/usx2y/usbusx2yaudio.c +2 −0
  825. tools/arch/x86/include/asm/cpufeatures.h +4 −1
  826. tools/arch/x86/include/asm/msr-index.h +9 −0
  827. tools/bpf/bpftool/struct_ops.c +10 −2
  828. tools/bpf/runqslower/Makefile +1 −1
  829. tools/build/feature/test-sync-compare-and-swap.c +1 −1
  830. tools/include/linux/bits.h +21 −3
  831. tools/include/linux/build_bug.h +82 −0
  832. tools/include/linux/compiler.h +26 −0
  833. tools/include/linux/const.h +1 −4
  834. tools/include/linux/kernel.h +1 −3
  835. tools/include/uapi/drm/drm.h +2 −0
  836. tools/include/uapi/drm/i915_drm.h +21 −0
  837. tools/include/uapi/linux/bpf.h +1 −1
  838. tools/include/uapi/linux/fscrypt.h +1 −0
  839. tools/include/uapi/linux/kvm.h +45 −2
  840. tools/include/uapi/linux/mman.h +3 −2
  841. tools/include/uapi/linux/sched.h +5 −0
  842. tools/include/uapi/linux/vhost.h +24 −0
  843. tools/include/vdso/bits.h +9 −0
  844. tools/include/vdso/const.h +10 −0
  845. tools/lib/bpf/libbpf.c +82 −44
  846. tools/lib/bpf/libbpf.h +1 −1
  847. tools/lib/bpf/netlink.c +5 −3
  848. tools/objtool/check.c +18 −8
  849. tools/objtool/elf.c +1 −1
  850. tools/objtool/elf.h +1 −1
  851. tools/objtool/orc_dump.c +27 −17
  852. tools/objtool/orc_gen.c +26 −7
  853. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +370 −370
  854. tools/perf/check-headers.sh +3 −0
  855. tools/perf/trace/beauty/clone.c +1 −0
  856. tools/perf/trace/beauty/mmap.c +1 −0
  857. tools/perf/util/setup.py +2 −0
  858. tools/perf/util/stat-shadow.c +5 −2
  859. tools/power/pm-graph/Makefile +4 −0
  860. tools/power/pm-graph/README +114 −10
  861. tools/power/pm-graph/bootgraph.py +1 −1
  862. tools/power/pm-graph/sleepgraph.8 +49 −16
  863. tools/power/pm-graph/sleepgraph.py +451 −344
  864. tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c +24 −6
  865. tools/testing/selftests/bpf/prog_tests/mmap.c +60 −2
  866. tools/testing/selftests/bpf/prog_tests/section_names.c +27 −15
  867. tools/testing/selftests/bpf/prog_tests/test_lsm.c +9 −9
  868. tools/testing/selftests/bpf/prog_tests/xdp_attach.c +29 −1
  869. tools/testing/selftests/bpf/prog_tests/xdp_info.c +68 −0
  870. tools/testing/selftests/bpf/progs/connect4_prog.c +16 −12
  871. tools/testing/selftests/bpf/progs/freplace_connect4.c +18 −0
  872. tools/testing/selftests/bpf/progs/lsm.c +4 −4
  873. tools/testing/selftests/bpf/progs/test_btf_haskv.c +5 −13
  874. tools/testing/selftests/bpf/progs/test_btf_newkv.c +5 −13
  875. tools/testing/selftests/bpf/progs/test_btf_nokv.c +5 −13
  876. tools/testing/selftests/bpf/test_btf.c +1 −1
  877. tools/testing/selftests/bpf/verifier/bounds.c +2 −2
  878. tools/testing/selftests/bpf/verifier/stack_ptr.c +40 −0
  879. tools/testing/selftests/bpf/verifier/value_illegal_alu.c +1 −0
  880. tools/testing/selftests/ftrace/config +1 −0
  881. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc +1 −4
  882. tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc +2 −0
  883. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc +2 −0
  884. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-notrace-pid.tc +1 −4
  885. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc +1 −4
  886. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc +1 −1
  887. tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +1 −4
  888. tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc +1 −1
  889. tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc +1 −4
  890. tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +1 −4
  891. tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc +2 −0
  892. tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc +1 −4
  893. tools/testing/selftests/ftrace/test.d/functions +6 −0
  894. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc +1 −1
  895. tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc +2 −0
  896. tools/testing/selftests/gpio/Makefile +6 −6
  897. tools/testing/selftests/intel_pstate/Makefile +1 −1
  898. tools/testing/selftests/ipc/msgque.c +1 −1
  899. tools/testing/selftests/kselftest/runner.sh +1 −1
  900. tools/testing/selftests/kselftest_deps.sh +272 −0
  901. tools/testing/selftests/kselftest_harness.h +3 −3
  902. tools/testing/selftests/memfd/Makefile +14 −3
  903. tools/testing/selftests/net/fib_nexthops.sh +23 −0
  904. tools/testing/selftests/net/fib_tests.sh +8 −2
  905. tools/testing/selftests/seccomp/seccomp_bpf.c +8 −6
  906. tools/testing/selftests/tc-testing/tdc.py +2 −3
  907. tools/testing/selftests/tpm2/test_smoke.sh +2 −11
  908. tools/testing/selftests/tpm2/test_space.sh +1 −8
  909. tools/testing/selftests/vm/Makefile +2 −2
  910. tools/testing/selftests/vm/run_vmtests +1 −1
  911. tools/virtio/Makefile +3 −2
  912. tools/virtio/asm/barrier.h +1 −0
  913. tools/virtio/generated/autoconf.h +0 −0
  914. tools/virtio/linux/compiler.h +1 −0
  915. tools/vm/Makefile +2 −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
.mailmap+2−0
@@ -288,6 +288,8 @@ Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@virtuozzo.com> · 287 unmodified lines
288288 Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@parallels.com>
289289 Takashi YOSHII <takashi.yoshii.zj@renesas.com>
290290 Will Deacon <will@kernel.org> <will.deacon@arm.com>
291+Wolfram Sang <wsa@kernel.org> <wsa@the-dreams.de>
292+Wolfram Sang <wsa@kernel.org> <w.sang@pengutronix.de>
291293 Yakir Yang <kuankuan.y@gmail.com> <ykk@rock-chips.com>
292294 Yusuke Goda <goda.yusuke@renesas.com>
293295 Gustavo Padovan <gustavo@las.ic.unicamp.br>
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
@@ -5187,8 +5187,7 @@ · 5186 unmodified lines
51875187
51885188 usbcore.old_scheme_first=
51895189 [USB] Start with the old device initialization
5190− scheme, applies only to low and full-speed devices
5191− (default 0 = off).
5190+ scheme (default 0 = off).
51925191
51935192 usbcore.usbfs_memory_mb=
51945193 [USB] Memory limit (in MB) for buffers allocated by
Documentation/admin-guide/sysctl/kernel.rst+19−28
@@ -390,9 +390,17 @@ When ``kptr_restrict`` is set to 2, kernel pointers printed using · 389 unmodified lines
390390 modprobe
391391 ========
392392
393−This gives the full path of the modprobe command which the kernel will
394−use to load modules. This can be used to debug module loading
395−requests::
393+The full path to the usermode helper for autoloading kernel modules,
394+by default "/sbin/modprobe". This binary is executed when the kernel
395+requests a module. For example, if userspace passes an unknown
396+filesystem type to mount(), then the kernel will automatically request
397+the corresponding filesystem module by executing this usermode helper.
398+This usermode helper should insert the needed module into the kernel.
399+
400+This sysctl only affects module autoloading. It has no effect on the
401+ability to explicitly insert modules.
402+
403+This sysctl can be used to debug module loading requests::
396404
397405 echo '#! /bin/sh' > /tmp/modprobe
398406 echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe
@@ -400,10 +408,15 @@ requests:: · 1 unmodified line
400408 chmod a+x /tmp/modprobe
401409 echo /tmp/modprobe > /proc/sys/kernel/modprobe
402410
403−This only applies when the *kernel* is requesting that the module be
404−loaded; it won't have any effect if the module is being loaded
405−explicitly using ``modprobe`` from userspace.
411+Alternatively, if this sysctl is set to the empty string, then module
412+autoloading is completely disabled. The kernel will not try to
413+execute a usermode helper at all, nor will it call the
414+kernel_module_request LSM hook.
406415
416+If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration,
417+then the configured static usermode helper overrides this sysctl,
418+except that the empty string is still accepted to completely disable
419+module autoloading as described above.
407420
408421 modules_disabled
409422 ================
@@ -446,28 +459,6 @@ Notes: · 36 unmodified lines
446459 successful IPC object allocation. If an IPC object allocation syscall
447460 fails, it is undefined if the value remains unmodified or is reset to -1.
448461
449−modprobe:
450−=========
451−
452−The path to the usermode helper for autoloading kernel modules, by
453−default "/sbin/modprobe". This binary is executed when the kernel
454−requests a module. For example, if userspace passes an unknown
455−filesystem type to mount(), then the kernel will automatically request
456−the corresponding filesystem module by executing this usermode helper.
457−This usermode helper should insert the needed module into the kernel.
458−
459−This sysctl only affects module autoloading. It has no effect on the
460−ability to explicitly insert modules.
461−
462−If this sysctl is set to the empty string, then module autoloading is
463−completely disabled. The kernel will not try to execute a usermode
464−helper at all, nor will it call the kernel_module_request LSM hook.
465−
466−If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration,
467−then the configured static usermode helper overrides this sysctl,
468−except that the empty string is still accepted to completely disable
469−module autoloading as described above.
470−
471462 nmi_watchdog
472463 ============
473464
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/core-api/timekeeping.rst+3−3
@@ -154,9 +154,9 @@ architectures. These are the recommended replacements: · 153 unmodified lines
154154
155155 Use ktime_get() or ktime_get_ts64() instead.
156156
157−.. c:function:: struct timeval do_gettimeofday( void )
158− struct timespec getnstimeofday( void )
159− struct timespec64 getnstimeofday64( void )
157+.. c:function:: void do_gettimeofday( struct timeval * )
158+ void getnstimeofday( struct timespec * )
159+ void getnstimeofday64( struct timespec64 * )
160160 void ktime_get_real_ts( struct timespec * )
161161
162162 ktime_get_real_ts64() is a direct replacement, but consider using
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/arm/sunxi/allwinner,sun4i-a10-mbus.yaml+6−0
@@ -42,6 +42,10 @@ properties: · 41 unmodified lines
4242 description:
4343 See section 2.3.9 of the DeviceTree Specification.
4444
45+ '#address-cells': true
46+
47+ '#size-cells': true
48+
4549 required:
4650 - "#interconnect-cells"
4751 - compatible
@@ -59,6 +63,8 @@ examples: · 11 unmodified lines
5963 compatible = "allwinner,sun5i-a13-mbus";
6064 reg = <0x01c01000 0x1000>;
6165 clocks = <&ccu CLK_MBUS>;
66+ #address-cells = <1>;
67+ #size-cells = <1>;
6268 dma-ranges = <0x00000000 0x40000000 0x20000000>;
6369 #interconnect-cells = <1>;
6470 };
Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml+1−1
@@ -91,7 +91,7 @@ required: · 90 unmodified lines
9191
9292 examples:
9393 - |
94− vco1: clock@00 {
94+ vco1: clock {
9595 compatible = "arm,impd1-vco1";
9696 #clock-cells = <0>;
9797 lock-offset = <0x08>;
Documentation/devicetree/bindings/display/bridge/adi,adv7123.txt+2−2
@@ -1,5 +1,5 @@
1−Analog Device ADV7123 Video DAC
2−-------------------------------
1+Analog Devices ADV7123 Video DAC
2+--------------------------------
33
44 The ADV7123 is a digital-to-analog converter that outputs VGA signals from a
55 parallel video input.
Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt+2−2
@@ -1,5 +1,5 @@
1−Analog Device ADV7511(W)/13/33/35 HDMI Encoders
2−-----------------------------------------
1+Analog Devices ADV7511(W)/13/33/35 HDMI Encoders
2+------------------------------------------------
33
44 The ADV7511, ADV7511W, ADV7513, ADV7533 and ADV7535 are HDMI audio and video
55 transmitters compatible with HDMI 1.4 and DVI 1.0. They support color space
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/adi,axi-dmac.txt+1−1
@@ -1,4 +1,4 @@
1−Analog Device AXI-DMAC DMA controller
1+Analog Devices AXI-DMAC DMA controller
22
33 Required properties:
44 - compatible: Must be "adi,axi-dmac-1.00.a".
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/hwmon/adi,axi-fan-control.yaml+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 # Copyright 2019 Analog Devices Inc.
33 %YAML 1.2
44 ---
5−$id: http://devicetree.org/schemas/bindings/hwmon/adi,axi-fan-control.yaml#
5+$id: http://devicetree.org/schemas/hwmon/adi,axi-fan-control.yaml#
66 $schema: http://devicetree.org/meta-schemas/core.yaml#
77
88 title: Analog Devices AXI FAN Control Device Tree Bindings
@@ -47,7 +47,7 @@ required: · 38 unmodified lines
4747
4848 examples:
4949 - |
50− fpga_axi: fpga-axi@0 {
50+ fpga_axi: fpga-axi {
5151 #address-cells = <0x2>;
5252 #size-cells = <0x1>;
5353
Documentation/devicetree/bindings/hwmon/adt7475.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/adt7475.yaml#
4+$id: http://devicetree.org/schemas/hwmon/adt7475.yaml#
55 $schema: http://devicetree.org/meta-schemas/core.yaml#
66
77 title: ADT7475 hwmon sensor
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/iio/dac/ad5755.txt+1−1
@@ -1,4 +1,4 @@
1−* Analog Device AD5755 IIO Multi-Channel DAC Linux Driver
1+* Analog Devices AD5755 IIO Multi-Channel DAC Linux Driver
22
33 Required properties:
44 - compatible: Has to contain one of the following:
Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml+46−51
@@ -2,7 +2,7 @@ · 1 unmodified line
22 # Copyright 2020 Analog Devices Inc.
33 %YAML 1.2
44 ---
5−$id: http://devicetree.org/schemas/bindings/iio/dac/adi,ad5770r.yaml#
5+$id: http://devicetree.org/schemas/iio/dac/adi,ad5770r.yaml#
66 $schema: http://devicetree.org/meta-schemas/core.yaml#
77
88 title: Analog Devices AD5770R DAC device driver
@@ -49,93 +49,86 @@ properties: · 40 unmodified lines
4949 asserted during driver probe.
5050 maxItems: 1
5151
52− channel0:
52+ channel@0:
5353 description: Represents an external channel which are
5454 connected to the DAC. Channel 0 can act both as a current
5555 source and sink.
5656 type: object
5757
5858 properties:
59− num:
59+ reg:
6060 description: This represents the channel number.
61− items:
62− const: 0
61+ const: 0
6362
6463 adi,range-microamp:
6564 description: Output range of the channel.
6665 oneOf:
67− - $ref: /schemas/types.yaml#/definitions/int32-array
6866 - items:
69− - enum: [0 300000]
70− - enum: [-60000 0]
71− - enum: [-60000 300000]
67+ - const: 0
68+ - const: 300000
69+ - items:
70+ - const: -60000
71+ - const: 0
72+ - items:
73+ - const: -60000
74+ - const: 300000
7275
73− channel1:
76+ channel@1:
7477 description: Represents an external channel which are
7578 connected to the DAC.
7679 type: object
7780
7881 properties:
79− num:
82+ reg:
8083 description: This represents the channel number.
81− items:
82− const: 1
84+ const: 1
8385
8486 adi,range-microamp:
8587 description: Output range of the channel.
86− oneOf:
87− - $ref: /schemas/types.yaml#/definitions/uint32-array
88− - items:
89− - enum: [0 140000]
90− - enum: [0 250000]
88+ items:
89+ - const: 0
90+ - enum: [ 140000, 250000 ]
9191
92− channel2:
92+ channel@2:
9393 description: Represents an external channel which are
9494 connected to the DAC.
9595 type: object
9696
9797 properties:
98− num:
98+ reg:
9999 description: This represents the channel number.
100− items:
101− const: 2
100+ const: 2
102101
103102 adi,range-microamp:
104103 description: Output range of the channel.
105− oneOf:
106− - $ref: /schemas/types.yaml#/definitions/uint32-array
107− - items:
108− - enum: [0 140000]
109− - enum: [0 250000]
104+ items:
105+ - const: 0
106+ - enum: [ 55000, 150000 ]
110107
111108 patternProperties:
112109 "^channel@([3-5])$":
113110 type: object
114111 description: Represents the external channels which are connected to the DAC.
115112 properties:
116− num:
113+ reg:
117114 description: This represents the channel number.
118− items:
119− minimum: 3
120− maximum: 5
115+ minimum: 3
116+ maximum: 5
121117
122118 adi,range-microamp:
123119 description: Output range of the channel.
124− oneOf:
125− - $ref: /schemas/types.yaml#/definitions/uint32-array
126− - items:
127− - enum: [0 45000]
128− - enum: [0 100000]
120+ items:
121+ - const: 0
122+ - enum: [ 45000, 100000 ]
129123
130124 required:
131125 - reg
132−- diff-channels
133−- channel0
134−- channel1
135−- channel2
136−- channel3
137−- channel4
138−- channel5
126+- channel@0
127+- channel@1
128+- channel@2
129+- channel@3
130+- channel@4
131+- channel@5
139132
140133 examples:
141134 - |
@@ -144,40 +137,42 @@ examples: · 2 unmodified lines
144137 #size-cells = <0>;
145138
146139 ad5770r@0 {
147− compatible = "ad5770r";
140+ compatible = "adi,ad5770r";
148141 reg = <0>;
149142 spi-max-frequency = <1000000>;
150143 vref-supply = <&vref>;
151144 adi,external-resistor;
152145 reset-gpios = <&gpio 22 0>;
146+ #address-cells = <1>;
147+ #size-cells = <0>;
153148
154149 channel@0 {
155− num = <0>;
156− adi,range-microamp = <(-60000) 300000>;
150+ reg = <0>;
151+ adi,range-microamp = <0 300000>;
157152 };
158153
159154 channel@1 {
160− num = <1>;
155+ reg = <1>;
161156 adi,range-microamp = <0 140000>;
162157 };
163158
164159 channel@2 {
165− num = <2>;
160+ reg = <2>;
166161 adi,range-microamp = <0 55000>;
167162 };
168163
169164 channel@3 {
170− num = <3>;
165+ reg = <3>;
171166 adi,range-microamp = <0 45000>;
172167 };
173168
174169 channel@4 {
175− num = <4>;
170+ reg = <4>;
176171 adi,range-microamp = <0 45000>;
177172 };
178173
179174 channel@5 {
180− num = <5>;
175+ reg = <5>;
181176 adi,range-microamp = <0 45000>;
182177 };
183178 };
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml+1−1
@@ -109,7 +109,7 @@ examples: · 108 unmodified lines
109109 - |
110110 #include <dt-bindings/gpio/gpio.h>
111111 #include <dt-bindings/interrupt-controller/arm-gic.h>
112− i2c@00000000 {
112+ i2c {
113113 #address-cells = <1>;
114114 #size-cells = <0>;
115115 edt-ft5x06@38 {
Documentation/devicetree/bindings/interrupt-controller/loongson,liointc.yaml+2−3
@@ -56,9 +56,8 @@ properties: · 55 unmodified lines
5656 cell with zero.
5757 allOf:
5858 - $ref: /schemas/types.yaml#/definitions/uint32-array
59− - items:
60− minItems: 4
61− maxItems: 4
59+ - minItems: 4
60+ maxItems: 4
6261
6362
6463 required:
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml+23−18
@@ -97,30 +97,35 @@ examples: · 96 unmodified lines
9797 #include <dt-bindings/clock/tegra186-clock.h>
9898 #include <dt-bindings/interrupt-controller/arm-gic.h>
9999
100− memory-controller@2c00000 {
101− compatible = "nvidia,tegra186-mc";
102− reg = <0x0 0x02c00000 0x0 0xb0000>;
103− interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
104−
100+ bus {
105101 #address-cells = <2>;
106102 #size-cells = <2>;
107103
108− ranges = <0x0 0x02c00000 0x02c00000 0x0 0xb0000>;
104+ memory-controller@2c00000 {
105+ compatible = "nvidia,tegra186-mc";
106+ reg = <0x0 0x02c00000 0x0 0xb0000>;
107+ interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
108+
109+ #address-cells = <2>;
110+ #size-cells = <2>;
111+
112+ ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>;
109113
110− /*
111− * Memory clients have access to all 40 bits that the memory
112− * controller can address.
113− */
114− dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
114+ /*
115+ * Memory clients have access to all 40 bits that the memory
116+ * controller can address.
117+ */
118+ dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
115119
116− external-memory-controller@2c60000 {
117− compatible = "nvidia,tegra186-emc";
118− reg = <0x0 0x02c60000 0x0 0x50000>;
119− interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
120− clocks = <&bpmp TEGRA186_CLK_EMC>;
121− clock-names = "emc";
120+ external-memory-controller@2c60000 {
121+ compatible = "nvidia,tegra186-emc";
122+ reg = <0x0 0x02c60000 0x0 0x50000>;
123+ interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
124+ clocks = <&bpmp TEGRA186_CLK_EMC>;
125+ clock-names = "emc";
122126
123− nvidia,bpmp = <&bpmp>;
127+ nvidia,bpmp = <&bpmp>;
128+ };
124129 };
125130 };
126131
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.yaml+3−1
@@ -123,7 +123,9 @@ examples: · 122 unmodified lines
123123 #include <dt-bindings/leds/common.h>
124124
125125 i2c {
126− pmic: pmic@4b {
126+ #address-cells = <1>;
127+ #size-cells = <0>;
128+ pmic: pmic@4b {
127129 compatible = "rohm,bd71837";
128130 reg = <0x4b>;
129131 interrupt-parent = <&gpio1>;
Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml+3−1
@@ -128,7 +128,9 @@ examples: · 127 unmodified lines
128128 #include <dt-bindings/leds/common.h>
129129
130130 i2c {
131− pmic: pmic@4b {
131+ #address-cells = <1>;
132+ #size-cells = <0>;
133+ pmic: pmic@4b {
132134 compatible = "rohm,bd71847";
133135 reg = <0x4b>;
134136 interrupt-parent = <&gpio1>;
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml+1−3
@@ -259,8 +259,6 @@ properties: · 258 unmodified lines
259259
260260 additionalProperties: false
261261
262− additionalProperties: false
263−
264262 additionalProperties: false
265263
266264 required:
@@ -274,7 +272,7 @@ examples: · 7 unmodified lines
274272 - |
275273 #include <dt-bindings/mfd/st,stpmic1.h>
276274 #include <dt-bindings/interrupt-controller/arm-gic.h>
277− i2c@0 {
275+ i2c {
278276 #address-cells = <1>;
279277 #size-cells = <0>;
280278 pmic@33 {
Documentation/devicetree/bindings/net/ethernet-phy.yaml+3−0
@@ -43,6 +43,9 @@ properties: · 42 unmodified lines
4343 second group of digits is the Phy Identifier 2 register,
4444 this is the chip vendor OUI bits 19:24, followed by 10
4545 bits of a vendor specific ID.
46+ - items:
47+ - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
48+ - const: ethernet-phy-ieee802.3-c22
4649 - items:
4750 - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
4851 - const: ethernet-phy-ieee802.3-c45
Documentation/devicetree/bindings/net/fsl-fec.txt+2−0
@@ -22,6 +22,8 @@ Optional properties: · 21 unmodified lines
2222 - fsl,err006687-workaround-present: If present indicates that the system has
2323 the hardware workaround for ERR006687 applied and does not need a software
2424 workaround.
25+- gpr: phandle of SoC general purpose register mode. Required for wake on LAN
26+ on some SoCs
2527 -interrupt-names: names of the interrupts listed in interrupts property in
2628 the same order. The defaults if not specified are
2729 __Number of interrupts__ __Default__
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml+1−0
@@ -48,6 +48,7 @@ examples: · 47 unmodified lines
4848
4949 switch@10 {
5050 compatible = "qca,qca8337";
51+ reg = <0x10>;
5152 /* ... */
5253 };
5354 };
Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt+1−1
@@ -29,7 +29,7 @@ Required properties for compatible string qcom,wcn399x-bt: · 28 unmodified lines
2929
3030 Optional properties for compatible string qcom,wcn399x-bt:
3131
32− - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt
32+ - max-speed: see Documentation/devicetree/bindings/serial/serial.yaml
3333 - firmware-name: specify the name of nvm firmware to load
3434 - clocks: clock provided to the controller
3535
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/phy/ti,phy-j721e-wiz.yaml+1−1
@@ -146,7 +146,7 @@ patternProperties: · 145 unmodified lines
146146 bindings specified in
147147 Documentation/devicetree/bindings/phy/phy-cadence-sierra.txt
148148 Torrent SERDES should follow the bindings specified in
149− Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
149+ Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
150150
151151 required:
152152 - compatible
Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml+12−5
@@ -31,10 +31,17 @@ additionalProperties: false · 30 unmodified lines
3131
3232 examples:
3333 - |
34− cros-ec@0 {
35− compatible = "google,cros-ec-spi";
36− cros_ec_pwm: ec-pwm {
37− compatible = "google,cros-ec-pwm";
38− #pwm-cells = <1>;
34+ spi {
35+ #address-cells = <1>;
36+ #size-cells = <0>;
37+
38+ cros-ec@0 {
39+ compatible = "google,cros-ec-spi";
40+ reg = <0>;
41+
42+ cros_ec_pwm: ec-pwm {
43+ compatible = "google,cros-ec-pwm";
44+ #pwm-cells = <1>;
45+ };
3946 };
4047 };
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/rng/brcm,bcm2835.yaml+1−1
@@ -39,7 +39,7 @@ additionalProperties: false · 38 unmodified lines
3939
4040 examples:
4141 - |
42− rng {
42+ rng@7e104000 {
4343 compatible = "brcm,bcm2835-rng";
4444 reg = <0x7e104000 0x10>;
4545 interrupts = <2 29>;
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/spi/qcom,spi-qcom-qspi.yaml+1−1
@@ -61,7 +61,7 @@ examples: · 60 unmodified lines
6161 #include <dt-bindings/clock/qcom,gcc-sdm845.h>
6262 #include <dt-bindings/interrupt-controller/arm-gic.h>
6363
64− soc: soc@0 {
64+ soc: soc {
6565 #address-cells = <2>;
6666 #size-cells = <2>;
6767
Documentation/devicetree/bindings/usb/ingenic,musb.yaml+1−1
@@ -56,7 +56,7 @@ additionalProperties: false · 55 unmodified lines
5656 examples:
5757 - |
5858 #include <dt-bindings/clock/jz4740-cgu.h>
59− usb_phy: usb-phy@0 {
59+ usb_phy: usb-phy {
6060 compatible = "usb-nop-xceiv";
6161 #phy-cells = <0>;
6262 };
Documentation/devicetree/bindings/usb/qcom,dwc3.txt+2−2
@@ -52,8 +52,8 @@ A child node must exist to represent the core DWC3 IP block. The name of · 51 unmodified lines
5252 the node is not important. The content of the node is defined in dwc3.txt.
5353
5454 Phy documentation is provided in the following places:
55−Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt - USB3 QMP PHY
56−Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt - USB2 QUSB2 PHY
55+Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt - USB3 QMP PHY
56+Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml - USB2 QUSB2 PHY
5757
5858 Example device nodes:
5959
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/rockchip,dwc3.txt+1−1
@@ -16,7 +16,7 @@ A child node must exist to represent the core DWC3 IP block. The name of · 15 unmodified lines
1616 the node is not important. The content of the node is defined in dwc3.txt.
1717
1818 Phy documentation is provided in the following places:
19−Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt - USB2.0 PHY
19+Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml - USB2.0 PHY
2020 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt - Type-C PHY
2121
2222 Example device nodes:
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/hwmon/isl68137.rst+38−38
@@ -16,7 +16,7 @@ Supported chips: · 15 unmodified lines
1616
1717 * Renesas ISL68220
1818
19− Prefix: 'raa_dmpvr2_2rail'
19+ Prefix: 'isl68220'
2020
2121 Addresses scanned: -
2222
@@ -26,7 +26,7 @@ Supported chips: · 3 unmodified lines
2626
2727 * Renesas ISL68221
2828
29− Prefix: 'raa_dmpvr2_3rail'
29+ Prefix: 'isl68221'
3030
3131 Addresses scanned: -
3232
@@ -36,7 +36,7 @@ Supported chips: · 3 unmodified lines
3636
3737 * Renesas ISL68222
3838
39− Prefix: 'raa_dmpvr2_2rail'
39+ Prefix: 'isl68222'
4040
4141 Addresses scanned: -
4242
@@ -46,7 +46,7 @@ Supported chips: · 3 unmodified lines
4646
4747 * Renesas ISL68223
4848
49− Prefix: 'raa_dmpvr2_2rail'
49+ Prefix: 'isl68223'
5050
5151 Addresses scanned: -
5252
@@ -56,7 +56,7 @@ Supported chips: · 3 unmodified lines
5656
5757 * Renesas ISL68224
5858
59− Prefix: 'raa_dmpvr2_3rail'
59+ Prefix: 'isl68224'
6060
6161 Addresses scanned: -
6262
@@ -66,7 +66,7 @@ Supported chips: · 3 unmodified lines
6666
6767 * Renesas ISL68225
6868
69− Prefix: 'raa_dmpvr2_2rail'
69+ Prefix: 'isl68225'
7070
7171 Addresses scanned: -
7272
@@ -76,7 +76,7 @@ Supported chips: · 3 unmodified lines
7676
7777 * Renesas ISL68226
7878
79− Prefix: 'raa_dmpvr2_3rail'
79+ Prefix: 'isl68226'
8080
8181 Addresses scanned: -
8282
@@ -86,7 +86,7 @@ Supported chips: · 3 unmodified lines
8686
8787 * Renesas ISL68227
8888
89− Prefix: 'raa_dmpvr2_1rail'
89+ Prefix: 'isl68227'
9090
9191 Addresses scanned: -
9292
@@ -96,7 +96,7 @@ Supported chips: · 3 unmodified lines
9696
9797 * Renesas ISL68229
9898
99− Prefix: 'raa_dmpvr2_3rail'
99+ Prefix: 'isl68229'
100100
101101 Addresses scanned: -
102102
@@ -106,7 +106,7 @@ Supported chips: · 3 unmodified lines
106106
107107 * Renesas ISL68233
108108
109− Prefix: 'raa_dmpvr2_2rail'
109+ Prefix: 'isl68233'
110110
111111 Addresses scanned: -
112112
@@ -116,7 +116,7 @@ Supported chips: · 3 unmodified lines
116116
117117 * Renesas ISL68239
118118
119− Prefix: 'raa_dmpvr2_3rail'
119+ Prefix: 'isl68239'
120120
121121 Addresses scanned: -
122122
@@ -126,7 +126,7 @@ Supported chips: · 3 unmodified lines
126126
127127 * Renesas ISL69222
128128
129− Prefix: 'raa_dmpvr2_2rail'
129+ Prefix: 'isl69222'
130130
131131 Addresses scanned: -
132132
@@ -136,7 +136,7 @@ Supported chips: · 3 unmodified lines
136136
137137 * Renesas ISL69223
138138
139− Prefix: 'raa_dmpvr2_3rail'
139+ Prefix: 'isl69223'
140140
141141 Addresses scanned: -
142142
@@ -146,7 +146,7 @@ Supported chips: · 3 unmodified lines
146146
147147 * Renesas ISL69224
148148
149− Prefix: 'raa_dmpvr2_2rail'
149+ Prefix: 'isl69224'
150150
151151 Addresses scanned: -
152152
@@ -156,7 +156,7 @@ Supported chips: · 3 unmodified lines
156156
157157 * Renesas ISL69225
158158
159− Prefix: 'raa_dmpvr2_2rail'
159+ Prefix: 'isl69225'
160160
161161 Addresses scanned: -
162162
@@ -166,7 +166,7 @@ Supported chips: · 3 unmodified lines
166166
167167 * Renesas ISL69227
168168
169− Prefix: 'raa_dmpvr2_3rail'
169+ Prefix: 'isl69227'
170170
171171 Addresses scanned: -
172172
@@ -176,7 +176,7 @@ Supported chips: · 3 unmodified lines
176176
177177 * Renesas ISL69228
178178
179− Prefix: 'raa_dmpvr2_3rail'
179+ Prefix: 'isl69228'
180180
181181 Addresses scanned: -
182182
@@ -186,7 +186,7 @@ Supported chips: · 3 unmodified lines
186186
187187 * Renesas ISL69234
188188
189− Prefix: 'raa_dmpvr2_2rail'
189+ Prefix: 'isl69234'
190190
191191 Addresses scanned: -
192192
@@ -196,7 +196,7 @@ Supported chips: · 3 unmodified lines
196196
197197 * Renesas ISL69236
198198
199− Prefix: 'raa_dmpvr2_2rail'
199+ Prefix: 'isl69236'
200200
201201 Addresses scanned: -
202202
@@ -206,7 +206,7 @@ Supported chips: · 3 unmodified lines
206206
207207 * Renesas ISL69239
208208
209− Prefix: 'raa_dmpvr2_3rail'
209+ Prefix: 'isl69239'
210210
211211 Addresses scanned: -
212212
@@ -216,7 +216,7 @@ Supported chips: · 3 unmodified lines
216216
217217 * Renesas ISL69242
218218
219− Prefix: 'raa_dmpvr2_2rail'
219+ Prefix: 'isl69242'
220220
221221 Addresses scanned: -
222222
@@ -226,7 +226,7 @@ Supported chips: · 3 unmodified lines
226226
227227 * Renesas ISL69243
228228
229− Prefix: 'raa_dmpvr2_1rail'
229+ Prefix: 'isl69243'
230230
231231 Addresses scanned: -
232232
@@ -236,7 +236,7 @@ Supported chips: · 3 unmodified lines
236236
237237 * Renesas ISL69247
238238
239− Prefix: 'raa_dmpvr2_2rail'
239+ Prefix: 'isl69247'
240240
241241 Addresses scanned: -
242242
@@ -246,7 +246,7 @@ Supported chips: · 3 unmodified lines
246246
247247 * Renesas ISL69248
248248
249− Prefix: 'raa_dmpvr2_2rail'
249+ Prefix: 'isl69248'
250250
251251 Addresses scanned: -
252252
@@ -256,7 +256,7 @@ Supported chips: · 3 unmodified lines
256256
257257 * Renesas ISL69254
258258
259− Prefix: 'raa_dmpvr2_2rail'
259+ Prefix: 'isl69254'
260260
261261 Addresses scanned: -
262262
@@ -266,7 +266,7 @@ Supported chips: · 3 unmodified lines
266266
267267 * Renesas ISL69255
268268
269− Prefix: 'raa_dmpvr2_2rail'
269+ Prefix: 'isl69255'
270270
271271 Addresses scanned: -
272272
@@ -276,7 +276,7 @@ Supported chips: · 3 unmodified lines
276276
277277 * Renesas ISL69256
278278
279− Prefix: 'raa_dmpvr2_2rail'
279+ Prefix: 'isl69256'
280280
281281 Addresses scanned: -
282282
@@ -286,7 +286,7 @@ Supported chips: · 3 unmodified lines
286286
287287 * Renesas ISL69259
288288
289− Prefix: 'raa_dmpvr2_2rail'
289+ Prefix: 'isl69259'
290290
291291 Addresses scanned: -
292292
@@ -296,7 +296,7 @@ Supported chips: · 3 unmodified lines
296296
297297 * Renesas ISL69260
298298
299− Prefix: 'raa_dmpvr2_2rail'
299+ Prefix: 'isl69260'
300300
301301 Addresses scanned: -
302302
@@ -306,7 +306,7 @@ Supported chips: · 3 unmodified lines
306306
307307 * Renesas ISL69268
308308
309− Prefix: 'raa_dmpvr2_2rail'
309+ Prefix: 'isl69268'
310310
311311 Addresses scanned: -
312312
@@ -316,7 +316,7 @@ Supported chips: · 3 unmodified lines
316316
317317 * Renesas ISL69269
318318
319− Prefix: 'raa_dmpvr2_3rail'
319+ Prefix: 'isl69269'
320320
321321 Addresses scanned: -
322322
@@ -326,7 +326,7 @@ Supported chips: · 3 unmodified lines
326326
327327 * Renesas ISL69298
328328
329− Prefix: 'raa_dmpvr2_2rail'
329+ Prefix: 'isl69298'
330330
331331 Addresses scanned: -
332332
@@ -336,7 +336,7 @@ Supported chips: · 3 unmodified lines
336336
337337 * Renesas RAA228000
338338
339− Prefix: 'raa_dmpvr2_hv'
339+ Prefix: 'raa228000'
340340
341341 Addresses scanned: -
342342
@@ -346,7 +346,7 @@ Supported chips: · 3 unmodified lines
346346
347347 * Renesas RAA228004
348348
349− Prefix: 'raa_dmpvr2_hv'
349+ Prefix: 'raa228004'
350350
351351 Addresses scanned: -
352352
@@ -356,7 +356,7 @@ Supported chips: · 3 unmodified lines
356356
357357 * Renesas RAA228006
358358
359− Prefix: 'raa_dmpvr2_hv'
359+ Prefix: 'raa228006'
360360
361361 Addresses scanned: -
362362
@@ -366,7 +366,7 @@ Supported chips: · 3 unmodified lines
366366
367367 * Renesas RAA228228
368368
369− Prefix: 'raa_dmpvr2_2rail'
369+ Prefix: 'raa228228'
370370
371371 Addresses scanned: -
372372
@@ -376,7 +376,7 @@ Supported chips: · 3 unmodified lines
376376
377377 * Renesas RAA229001
378378
379− Prefix: 'raa_dmpvr2_2rail'
379+ Prefix: 'raa229001'
380380
381381 Addresses scanned: -
382382
@@ -386,7 +386,7 @@ Supported chips: · 3 unmodified lines
386386
387387 * Renesas RAA229004
388388
389− Prefix: 'raa_dmpvr2_2rail'
389+ Prefix: 'raa229004'
390390
391391 Addresses scanned: -
392392
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/devlink-trap.rst+2−0
@@ -257,6 +257,8 @@ drivers: · 256 unmodified lines
257257 * :doc:`netdevsim`
258258 * :doc:`mlxsw`
259259
260+.. _Generic-Packet-Trap-Groups:
261+
260262 Generic Packet Trap Groups
261263 ==========================
262264
Documentation/networking/index.rst+1−0
@@ -22,6 +22,7 @@ Contents: · 21 unmodified lines
2222 z8530book
2323 msg_zerocopy
2424 failover
25+ net_dim
2526 net_failover
2627 phy
2728 sfp-phylink
Documentation/networking/ip-sysctl.txt+8−1
@@ -812,7 +812,7 @@ tcp_limit_output_bytes - INTEGER · 811 unmodified lines
812812 tcp_challenge_ack_limit - INTEGER
813813 Limits number of Challenge ACK sent per second, as recommended
814814 in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks)
815− Default: 100
815+ Default: 1000
816816
817817 tcp_rx_skb_cache - BOOLEAN
818818 Controls a per TCP socket cache of one skb, that might help
@@ -983,6 +983,13 @@ ip_early_demux - BOOLEAN · 164 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/networking/net_dim.rstrenamed from Documentation/networking/net_dim.txt+49−47
@@ -1,28 +1,20 @@
1+======================================================
12 Net DIM - Generic Network Dynamic Interrupt Moderation
23 ======================================================
34
4−Author:
5− Tal Gilboa <talgi@mellanox.com>
6−
7−
8−Contents
9−=========
5+:Author: Tal Gilboa <talgi@mellanox.com>
106
11−- Assumptions
12−- Introduction
13−- The Net DIM Algorithm
14−- Registering a Network Device to DIM
15−- Example
7+.. contents:: :depth: 2
168
17−Part 0: Assumptions
18−======================
9+Assumptions
10+===========
1911
2012 This document assumes the reader has basic knowledge in network drivers
2113 and in general interrupt moderation.
2214
2315
24−Part I: Introduction
25−======================
16+Introduction
17+============
2618
2719 Dynamic Interrupt Moderation (DIM) (in networking) refers to changing the
2820 interrupt moderation configuration of a channel in order to optimize packet
@@ -41,14 +33,15 @@ number of wanted packets per event. The Net DIM algorithm ascribes importance to · 12 unmodified lines
4133 increase bandwidth over reducing interrupt rate.
4234
4335
44−Part II: The Net DIM Algorithm
45−===============================
36+Net DIM Algorithm
37+=================
4638
4739 Each iteration of the Net DIM algorithm follows these steps:
48−1. Calculates new data sample.
49−2. Compares it to previous sample.
50−3. Makes a decision - suggests interrupt moderation configuration fields.
51−4. Applies a schedule work function, which applies suggested configuration.
40+
41+#. Calculates new data sample.
42+#. Compares it to previous sample.
43+#. Makes a decision - suggests interrupt moderation configuration fields.
44+#. Applies a schedule work function, which applies suggested configuration.
5245
5346 The first two steps are straightforward, both the new and the previous data are
5447 supplied by the driver registered to Net DIM. The previous data is the new data
@@ -89,19 +82,21 @@ manoeuvre as it may provide partial data or ignore the algorithm suggestion · 34 unmodified lines
8982 under some conditions.
9083
9184
92−Part III: Registering a Network Device to DIM
93−==============================================
85+Registering a Network Device to DIM
86+===================================
9487
95−Net DIM API exposes the main function net_dim(struct dim *dim,
96−struct dim_sample end_sample). This function is the entry point to the Net
88+Net DIM API exposes the main function net_dim().
89+This function is the entry point to the Net
9790 DIM algorithm and has to be called every time the driver would like to check if
9891 it should change interrupt moderation parameters. The driver should provide two
99−data structures: struct dim and struct dim_sample. Struct dim
92+data structures: :c:type:`struct dim <dim>` and
93+:c:type:`struct dim_sample <dim_sample>`. :c:type:`struct dim <dim>`
10094 describes the state of DIM for a specific object (RX queue, TX queue,
10195 other queues, etc.). This includes the current selected profile, previous data
10296 samples, the callback function provided by the driver and more.
103−Struct dim_sample describes a data sample, which will be compared to the
104−data sample stored in struct dim in order to decide on the algorithm's next
97+:c:type:`struct dim_sample <dim_sample>` describes a data sample,
98+which will be compared to the data sample stored in :c:type:`struct dim <dim>`
99+in order to decide on the algorithm's next
105100 step. The sample should include bytes, packets and interrupts, measured by
106101 the driver.
107102
@@ -110,9 +105,10 @@ main net_dim() function. The recommended method is to call net_dim() on each · 2 unmodified lines
110105 interrupt. Since Net DIM has a built-in moderation and it might decide to skip
111106 iterations under certain conditions, there is no need to moderate the net_dim()
112107 calls as well. As mentioned above, the driver needs to provide an object of type
113−struct dim to the net_dim() function call. It is advised for each entity
114−using Net DIM to hold a struct dim as part of its data structure and use it
115−as the main Net DIM API object. The struct dim_sample should hold the latest
108+:c:type:`struct dim <dim>` to the net_dim() function call. It is advised for
109+each entity using Net DIM to hold a :c:type:`struct dim <dim>` as part of its
110+data structure and use it as the main Net DIM API object.
111+The :c:type:`struct dim_sample <dim_sample>` should hold the latest
116112 bytes, packets and interrupts count. No need to perform any calculations, just
117113 include the raw data.
118114
@@ -124,19 +120,19 @@ the data flow. After the work is done, Net DIM algorithm needs to be set to · 5 unmodified lines
124120 the proper state in order to move to the next iteration.
125121
126122
127−Part IV: Example
128−=================
123+Example
124+=======
129125
130126 The following code demonstrates how to register a driver to Net DIM. The actual
131127 usage is not complete but it should make the outline of the usage clear.
132128
133−my_driver.c:
129+.. code-block:: c
134130
135−#include <linux/dim.h>
131+ #include <linux/dim.h>
136132
137−/* Callback for net DIM to schedule on a decision to change moderation */
138−void my_driver_do_dim_work(struct work_struct *work)
139−{
133+ /* Callback for net DIM to schedule on a decision to change moderation */
134+ void my_driver_do_dim_work(struct work_struct *work)
135+ {
140136 /* Get struct dim from struct work_struct */
141137 struct dim *dim = container_of(work, struct dim,
142138 work);
@@ -145,11 +141,11 @@ void my_driver_do_dim_work(struct work_struct *work) · 2 unmodified lines
145141
146142 /* Signal net DIM work is done and it should move to next iteration */
147143 dim->state = DIM_START_MEASURE;
148−}
144+ }
149145
150−/* My driver's interrupt handler */
151−int my_driver_handle_interrupt(struct my_driver_entity *my_entity, ...)
152−{
146+ /* My driver's interrupt handler */
147+ int my_driver_handle_interrupt(struct my_driver_entity *my_entity, ...)
148+ {
153149 ...
154150 /* A struct to hold current measured data */
155151 struct dim_sample dim_sample;
@@ -162,13 +158,19 @@ int my_driver_handle_interrupt(struct my_driver_entity *my_entity, ...) · 6 unmodified lines
162158 /* Call net DIM */
163159 net_dim(&my_entity->dim, dim_sample);
164160 ...
165−}
161+ }
166162
167−/* My entity's initialization function (my_entity was already allocated) */
168−int my_driver_init_my_entity(struct my_driver_entity *my_entity, ...)
169−{
163+ /* My entity's initialization function (my_entity was already allocated) */
164+ int my_driver_init_my_entity(struct my_driver_entity *my_entity, ...)
165+ {
170166 ...
171167 /* Initiate struct work_struct with my driver's callback function */
172168 INIT_WORK(&my_entity->dim.work, my_driver_do_dim_work);
173169 ...
174−}
170+ }
171+
172+Dynamic Interrupt Moderation (DIM) library API
173+==============================================
174+
175+.. kernel-doc:: include/linux/dim.h
176+ :internal:
Documentation/x86/boot.rst+18−3
@@ -1399,8 +1399,8 @@ must have read/write permission; CS must be __BOOT_CS and DS, ES, SS · 1398 unmodified lines
13991399 must be __BOOT_DS; interrupt must be disabled; %rsi must hold the base
14001400 address of the struct boot_params.
14011401
1402−EFI Handover Protocol
1403−=====================
1402+EFI Handover Protocol (deprecated)
1403+==================================
14041404
14051405 This protocol allows boot loaders to defer initialisation to the EFI
14061406 boot stub. The boot loader is required to load the kernel/initrd(s)
@@ -1408,6 +1408,12 @@ from the boot media and jump to the EFI handover protocol entry point · 1 unmodified line
14081408 which is hdr->handover_offset bytes from the beginning of
14091409 startup_{32,64}.
14101410
1411+The boot loader MUST respect the kernel's PE/COFF metadata when it comes
1412+to section alignment, the memory footprint of the executable image beyond
1413+the size of the file itself, and any other aspect of the PE/COFF header
1414+that may affect correct operation of the image as a PE/COFF binary in the
1415+execution context provided by the EFI firmware.
1416+
14111417 The function prototype for the handover entry point looks like this::
14121418
14131419 efi_main(void *handle, efi_system_table_t *table, struct boot_params *bp)
@@ -1419,9 +1425,18 @@ UEFI specification. 'bp' is the boot loader-allocated boot params. · 5 unmodified lines
14191425
14201426 The boot loader *must* fill out the following fields in bp::
14211427
1422− - hdr.code32_start
14231428 - hdr.cmd_line_ptr
14241429 - hdr.ramdisk_image (if applicable)
14251430 - hdr.ramdisk_size (if applicable)
14261431
14271432 All other fields should be zero.
1433+
1434+NOTE: The EFI Handover Protocol is deprecated in favour of the ordinary PE/COFF
1435+ entry point, combined with the LINUX_EFI_INITRD_MEDIA_GUID based initrd
1436+ loading protocol (refer to [0] for an example of the bootloader side of
1437+ this), which removes the need for any knowledge on the part of the EFI
1438+ bootloader regarding the internal representation of boot_params or any
1439+ requirements/limitations regarding the placement of the command line
1440+ and ramdisk in memory, or the placement of the kernel image itself.
1441+
1442+[0] https://github.com/u-boot/u-boot/commit/ec80b4735a593961fe701cc3a5d717d4739b0fd0
MAINTAINERS+55−37
@@ -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
@@ -1323,7 +1322,10 @@ ARM INTEGRATOR, VERSATILE AND REALVIEW SUPPORT · 207 unmodified lines
13231322 M: Linus Walleij <linus.walleij@linaro.org>
13241323 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
13251324 S: Maintained
1326−F: Documentation/devicetree/bindings/arm/arm-boards
1325+F: Documentation/devicetree/bindings/arm/arm,integrator.yaml
1326+F: Documentation/devicetree/bindings/arm/arm,realview.yaml
1327+F: Documentation/devicetree/bindings/arm/arm,versatile.yaml
1328+F: Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml
13271329 F: Documentation/devicetree/bindings/auxdisplay/arm-charlcd.txt
13281330 F: Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml
13291331 F: Documentation/devicetree/bindings/i2c/i2c-versatile.txt
@@ -2847,14 +2849,14 @@ M: Nick Kossifidis <mickflemm@gmail.com> · 1517 unmodified lines
28472849 M: Luis Chamberlain <mcgrof@kernel.org>
28482850 L: linux-wireless@vger.kernel.org
28492851 S: Maintained
2850−W: http://wireless.kernel.org/en/users/Drivers/ath5k
2852+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath5k
28512853 F: drivers/net/wireless/ath/ath5k/
28522854
28532855 ATHEROS ATH6KL WIRELESS DRIVER
28542856 M: Kalle Valo <kvalo@codeaurora.org>
28552857 L: linux-wireless@vger.kernel.org
28562858 S: Supported
2857−W: http://wireless.kernel.org/en/users/Drivers/ath6kl
2859+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath6kl
28582860 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
28592861 F: drivers/net/wireless/ath/ath6kl/
28602862
@@ -3017,7 +3019,7 @@ B43 WIRELESS DRIVER · 156 unmodified lines
30173019 L: linux-wireless@vger.kernel.org
30183020 L: b43-dev@lists.infradead.org
30193021 S: Odd Fixes
3020−W: http://wireless.kernel.org/en/users/Drivers/b43
3022+W: https://wireless.wiki.kernel.org/en/users/Drivers/b43
30213023 F: drivers/net/wireless/broadcom/b43/
30223024
30233025 B43LEGACY WIRELESS DRIVER
@@ -3025,7 +3027,7 @@ M: Larry Finger <Larry.Finger@lwfinger.net> · 1 unmodified line
30253027 L: linux-wireless@vger.kernel.org
30263028 L: b43-dev@lists.infradead.org
30273029 S: Maintained
3028−W: http://wireless.kernel.org/en/users/Drivers/b43
3030+W: https://wireless.wiki.kernel.org/en/users/Drivers/b43
30293031 F: drivers/net/wireless/broadcom/b43legacy/
30303032
30313033 BACKLIGHT CLASS/SUBSYSTEM
@@ -3655,7 +3657,7 @@ L: linux-btrfs@vger.kernel.org · 623 unmodified lines
36553657 S: Maintained
36563658 W: http://btrfs.wiki.kernel.org/
36573659 Q: http://patchwork.kernel.org/project/linux-btrfs/list/
3658−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
36593661 F: Documentation/filesystems/btrfs.rst
36603662 F: fs/btrfs/
36613663 F: include/linux/btrfs*
@@ -3840,7 +3842,7 @@ CARL9170 LINUX COMMUNITY WIRELESS DRIVER · 178 unmodified lines
38403842 M: Christian Lamparter <chunkeey@googlemail.com>
38413843 L: linux-wireless@vger.kernel.org
38423844 S: Maintained
3843−W: http://wireless.kernel.org/en/users/Drivers/carl9170
3845+W: https://wireless.wiki.kernel.org/en/users/Drivers/carl9170
38443846 F: drivers/net/wireless/ath/carl9170/
38453847
38463848 CAVIUM I2C DRIVER
@@ -5173,6 +5175,7 @@ S: Maintained · 1326 unmodified lines
51735175 F: drivers/soc/fsl/dpio
51745176
51755177 DPAA2 ETHERNET DRIVER
5178+M: Ioana Ciornei <ioana.ciornei@nxp.com>
51765179 M: Ioana Radulescu <ruxandra.radulescu@nxp.com>
51775180 L: netdev@vger.kernel.org
51785181 S: Maintained
@@ -5552,7 +5555,7 @@ M: Chen-Yu Tsai <wens@csie.org> · 373 unmodified lines
55525555 L: dri-devel@lists.freedesktop.org
55535556 S: Supported
55545557 T: git git://anongit.freedesktop.org/drm/drm-misc
5555−F: Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
5558+F: Documentation/devicetree/bindings/display/allwinner*
55565559 F: drivers/gpu/drm/sun4i/
55575560
55585561 DRM DRIVERS FOR AMLOGIC SOCS
@@ -5934,6 +5937,7 @@ M: Tal Gilboa <talgi@mellanox.com> · 375 unmodified lines
59345937 S: Maintained
59355938 F: include/linux/dim.h
59365939 F: lib/dim/
5940+F: Documentation/networking/net_dim.rst
59375941
59385942 DZ DECSTATION DZ11 SERIAL DRIVER
59395943 M: "Maciej W. Rozycki" <macro@linux-mips.org>
@@ -7945,7 +7949,7 @@ F: Documentation/i2c/busses/i2c-parport.rst · 2005 unmodified lines
79457949 F: drivers/i2c/busses/i2c-parport.c
79467950
79477951 I2C SUBSYSTEM
7948−M: Wolfram Sang <wsa@the-dreams.de>
7952+M: Wolfram Sang <wsa@kernel.org>
79497953 L: linux-i2c@vger.kernel.org
79507954 S: Maintained
79517955 W: https://i2c.wiki.kernel.org/
@@ -9325,6 +9329,7 @@ M: Christian Borntraeger <borntraeger@de.ibm.com> · 1373 unmodified lines
93259329 M: Janosch Frank <frankja@linux.ibm.com>
93269330 R: David Hildenbrand <david@redhat.com>
93279331 R: Cornelia Huck <cohuck@redhat.com>
9332+R: Claudio Imbrenda <imbrenda@linux.ibm.com>
93289333 L: kvm@vger.kernel.org
93299334 S: Supported
93309335 W: http://www.ibm.com/developerworks/linux/linux390/
@@ -9412,6 +9417,13 @@ F: include/linux/keyctl.h · 81 unmodified lines
94129417 F: include/uapi/linux/keyctl.h
94139418 F: security/keys/
94149419
9420+KFIFO
9421+M: Stefani Seibold <stefani@seibold.net>
9422+S: Maintained
9423+F: include/linux/kfifo.h
9424+F: lib/kfifo.c
9425+F: samples/kfifo/
9426+
94159427 KGDB / KDB /debug_core
94169428 M: Jason Wessel <jason.wessel@windriver.com>
94179429 M: Daniel Thompson <daniel.thompson@linaro.org>
@@ -10063,7 +10075,7 @@ MAC80211 · 645 unmodified lines
1006310075 M: Johannes Berg <johannes@sipsolutions.net>
1006410076 L: linux-wireless@vger.kernel.org
1006510077 S: Maintained
10066−W: http://wireless.kernel.org/
10078+W: https://wireless.wiki.kernel.org/
1006710079 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
1006810080 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
1006910081 F: Documentation/networking/mac80211-injection.txt
@@ -10658,6 +10670,13 @@ L: netdev@vger.kernel.org · 588 unmodified lines
1065810670 S: Maintained
1065910671 F: drivers/net/ethernet/mediatek/
1066010672
10673+MEDIATEK I2C CONTROLLER DRIVER
10674+M: Qii Wang <qii.wang@mediatek.com>
10675+L: linux-i2c@vger.kernel.org
10676+S: Maintained
10677+F: Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt
10678+F: drivers/i2c/busses/i2c-mt65xx.c
10679+
1066110680 MEDIATEK JPEG DRIVER
1066210681 M: Rick Chang <rick.chang@mediatek.com>
1066310682 M: Bin Liu <bin.liu@mediatek.com>
@@ -10693,7 +10712,6 @@ MEDIATEK MT76 WIRELESS LAN DRIVER · 29 unmodified lines
1069310712 M: Felix Fietkau <nbd@nbd.name>
1069410713 M: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
1069510714 R: Ryder Lee <ryder.lee@mediatek.com>
10696−R: Roy Luo <royluo@google.com>
1069710715 L: linux-wireless@vger.kernel.org
1069810716 S: Maintained
1069910717 F: drivers/net/wireless/mediatek/mt76/
@@ -12644,7 +12662,7 @@ F: fs/orangefs/ · 1944 unmodified lines
1264412662 ORINOCO DRIVER
1264512663 L: linux-wireless@vger.kernel.org
1264612664 S: Orphan
12647−W: http://wireless.kernel.org/en/users/Drivers/orinoco
12665+W: https://wireless.wiki.kernel.org/en/users/Drivers/orinoco
1264812666 W: http://www.nongnu.org/orinoco/
1264912667 F: drivers/net/wireless/intersil/orinoco/
1265012668
@@ -12670,7 +12688,7 @@ P54 WIRELESS DRIVER · 19 unmodified lines
1267012688 M: Christian Lamparter <chunkeey@googlemail.com>
1267112689 L: linux-wireless@vger.kernel.org
1267212690 S: Maintained
12673−W: http://wireless.kernel.org/en/users/Drivers/p54
12691+W: https://wireless.wiki.kernel.org/en/users/Drivers/p54
1267412692 F: drivers/net/wireless/intersil/p54/
1267512693
1267612694 PACKING
@@ -13038,7 +13056,7 @@ F: drivers/pci/controller/pci-xgene-msi.c · 361 unmodified lines
1303813056
1303913057 PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
1304013058 M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
13041−R: Andrew Murray <amurray@thegoodpenguin.co.uk>
13059+R: Rob Herring <robh@kernel.org>
1304213060 L: linux-pci@vger.kernel.org
1304313061 S: Supported
1304413062 Q: http://patchwork.ozlabs.org/project/linux-pci/list/
@@ -13591,7 +13609,7 @@ PRISM54 WIRELESS DRIVER · 546 unmodified lines
1359113609 M: Luis Chamberlain <mcgrof@kernel.org>
1359213610 L: linux-wireless@vger.kernel.org
1359313611 S: Obsolete
13594−W: http://wireless.kernel.org/en/users/Drivers/p54
13612+W: https://wireless.wiki.kernel.org/en/users/Drivers/p54
1359513613 F: drivers/net/wireless/intersil/prism54/
1359613614
1359713615 PROC FILESYSTEM
@@ -13853,7 +13871,8 @@ S: Maintained · 255 unmodified lines
1385313871 F: drivers/scsi/qla1280.[ch]
1385413872
1385513873 QLOGIC QLA2XXX FC-SCSI DRIVER
13856−M: hmadhani@marvell.com
13874+M: Nilesh Javali <njavali@marvell.com>
13875+M: GR-QLogic-Storage-Upstream@marvell.com
1385713876 L: linux-scsi@vger.kernel.org
1385813877 S: Supported
1385913878 F: Documentation/scsi/LICENSE.qla2xxx
@@ -13931,7 +13950,7 @@ QUALCOMM ATHEROS ATH10K WIRELESS DRIVER · 71 unmodified lines
1393113950 M: Kalle Valo <kvalo@codeaurora.org>
1393213951 L: ath10k@lists.infradead.org
1393313952 S: Supported
13934−W: http://wireless.kernel.org/en/users/Drivers/ath10k
13953+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
1393513954 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
1393613955 F: drivers/net/wireless/ath/ath10k/
1393713956
@@ -13946,7 +13965,7 @@ QUALCOMM ATHEROS ATH9K WIRELESS DRIVER · 8 unmodified lines
1394613965 M: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
1394713966 L: linux-wireless@vger.kernel.org
1394813967 S: Supported
13949−W: http://wireless.kernel.org/en/users/Drivers/ath9k
13968+W: https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
1395013969 F: drivers/net/wireless/ath/ath9k/
1395113970
1395213971 QUALCOMM CAMERA SUBSYSTEM DRIVER
@@ -14043,13 +14062,12 @@ QUALCOMM WCN36XX WIRELESS DRIVER · 90 unmodified lines
1404314062 M: Kalle Valo <kvalo@codeaurora.org>
1404414063 L: wcn36xx@lists.infradead.org
1404514064 S: Supported
14046−W: http://wireless.kernel.org/en/users/Drivers/wcn36xx
14065+W: https://wireless.wiki.kernel.org/en/users/Drivers/wcn36xx
1404714066 T: git git://github.com/KrasnikovEugene/wcn36xx.git
1404814067 F: drivers/net/wireless/ath/wcn36xx/
1404914068
1405014069 QUANTENNA QTNFMAC WIRELESS DRIVER
1405114070 M: Igor Mitsyanko <imitsyanko@quantenna.com>
14052−M: Avinash Patil <avinashp@quantenna.com>
1405314071 M: Sergey Matyukevich <smatyukevich@quantenna.com>
1405414072 L: linux-wireless@vger.kernel.org
1405514073 S: Maintained
@@ -14271,7 +14289,7 @@ REALTEK WIRELESS DRIVER (rtlwifi family) · 215 unmodified lines
1427114289 M: Ping-Ke Shih <pkshih@realtek.com>
1427214290 L: linux-wireless@vger.kernel.org
1427314291 S: Maintained
14274−W: http://wireless.kernel.org/
14292+W: https://wireless.wiki.kernel.org/
1427514293 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
1427614294 F: drivers/net/wireless/realtek/rtlwifi/
1427714295
@@ -14406,7 +14424,7 @@ RFKILL · 128 unmodified lines
1440614424 M: Johannes Berg <johannes@sipsolutions.net>
1440714425 L: linux-wireless@vger.kernel.org
1440814426 S: Maintained
14409−W: http://wireless.kernel.org/
14427+W: https://wireless.wiki.kernel.org/
1441014428 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
1441114429 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
1441214430 F: Documentation/ABI/stable/sysfs-class-rfkill
@@ -14555,7 +14573,7 @@ F: drivers/media/dvb-frontends/rtl2832_sdr* · 142 unmodified lines
1455514573 RTL8180 WIRELESS DRIVER
1455614574 L: linux-wireless@vger.kernel.org
1455714575 S: Orphan
14558−W: http://wireless.kernel.org/
14576+W: https://wireless.wiki.kernel.org/
1455914577 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
1456014578 F: drivers/net/wireless/realtek/rtl818x/rtl8180/
1456114579
@@ -14565,7 +14583,7 @@ M: Hin-Tak Leung <htl10@users.sourceforge.net> · 3 unmodified lines
1456514583 M: Larry Finger <Larry.Finger@lwfinger.net>
1456614584 L: linux-wireless@vger.kernel.org
1456714585 S: Maintained
14568−W: http://wireless.kernel.org/
14586+W: https://wireless.wiki.kernel.org/
1456914587 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
1457014588 F: drivers/net/wireless/realtek/rtl818x/rtl8187/
1457114589
@@ -16920,8 +16938,8 @@ F: drivers/media/platform/ti-vpe/ · 2348 unmodified lines
1692016938 TI WILINK WIRELESS DRIVERS
1692116939 L: linux-wireless@vger.kernel.org
1692216940 S: Orphan
16923−W: http://wireless.kernel.org/en/users/Drivers/wl12xx
16924−W: http://wireless.kernel.org/en/users/Drivers/wl1251
16941+W: https://wireless.wiki.kernel.org/en/users/Drivers/wl12xx
16942+W: https://wireless.wiki.kernel.org/en/users/Drivers/wl1251
1692516943 T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
1692616944 F: drivers/net/wireless/ti/
1692716945 F: include/linux/wl12xx.h
@@ -18203,7 +18221,7 @@ M: Maya Erez <merez@codeaurora.org> · 1275 unmodified lines
1820318221 L: linux-wireless@vger.kernel.org
1820418222 L: wil6210@qti.qualcomm.com
1820518223 S: Supported
18206−W: http://wireless.kernel.org/en/users/Drivers/wil6210
18224+W: https://wireless.wiki.kernel.org/en/users/Drivers/wil6210
1820718225 F: drivers/net/wireless/ath/wil6210/
1820818226
1820918227 WIMAX STACK
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 7
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc4
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
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/compressed/head.S+2−1
@@ -1450,7 +1450,8 @@ ENTRY(efi_enter_kernel) · 1449 unmodified lines
14501450 @ running beyond the PoU, and so calling cache_off below from
14511451 @ inside the PE/COFF loader allocated region is unsafe unless
14521452 @ we explicitly clean it to the PoC.
1453− adr r0, call_cache_fn @ region of code we will
1453+ ARM( adrl r0, call_cache_fn )
1454+ THUMB( adr r0, call_cache_fn ) @ region of code we will
14541455 adr r1, 0f @ run with MMU off
14551456 bl cache_clean_flush
14561457 bl cache_off
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/imx6qdl.dtsi+3−3
@@ -1039,13 +1039,13 @@ · 1038 unmodified lines
10391039 compatible = "fsl,imx6q-fec";
10401040 reg = <0x02188000 0x4000>;
10411041 interrupt-names = "int0", "pps";
1042− interrupts-extended =
1043− <&intc 0 118 IRQ_TYPE_LEVEL_HIGH>,
1044− <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
1042+ interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>,
1043+ <0 119 IRQ_TYPE_LEVEL_HIGH>;
10451044 clocks = <&clks IMX6QDL_CLK_ENET>,
10461045 <&clks IMX6QDL_CLK_ENET>,
10471046 <&clks IMX6QDL_CLK_ENET_REF>;
10481047 clock-names = "ipg", "ahb", "ptp";
1048+ gpr = <&gpr>;
10491049 status = "disabled";
10501050 };
10511051
arch/arm/boot/dts/imx6qp.dtsi+0−1
@@ -77,7 +77,6 @@ · 76 unmodified lines
7777 };
7878
7979 &fec {
80− /delete-property/interrupts-extended;
8180 interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>,
8281 <0 119 IRQ_TYPE_LEVEL_HIGH>;
8382 };
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/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/arm/net/bpf_jit_32.c+34−18
@@ -929,7 +929,11 @@ static inline void emit_a32_rsh_i64(const s8 dst[], · 928 unmodified lines
929929 rd = arm_bpf_get_reg64(dst, tmp, ctx);
930930
931931 /* Do LSR operation */
932− if (val < 32) {
932+ if (val == 0) {
933+ /* An immediate value of 0 encodes a shift amount of 32
934+ * for LSR. To shift by 0, don't do anything.
935+ */
936+ } else if (val < 32) {
933937 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx);
934938 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx);
935939 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx);
@@ -955,7 +959,11 @@ static inline void emit_a32_arsh_i64(const s8 dst[], · 19 unmodified lines
955959 rd = arm_bpf_get_reg64(dst, tmp, ctx);
956960
957961 /* Do ARSH operation */
958− if (val < 32) {
962+ if (val == 0) {
963+ /* An immediate value of 0 encodes a shift amount of 32
964+ * for ASR. To shift by 0, don't do anything.
965+ */
966+ } else if (val < 32) {
959967 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx);
960968 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx);
961969 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx);
@@ -992,21 +1000,35 @@ static inline void emit_a32_mul_r64(const s8 dst[], const s8 src[], · 30 unmodified lines
9921000 arm_bpf_put_reg32(dst_hi, rd[0], ctx);
9931001 }
9941002
1003+static bool is_ldst_imm(s16 off, const u8 size)
1004+{
1005+ s16 off_max = 0;
1006+
1007+ switch (size) {
1008+ case BPF_B:
1009+ case BPF_W:
1010+ off_max = 0xfff;
1011+ break;
1012+ case BPF_H:
1013+ off_max = 0xff;
1014+ break;
1015+ case BPF_DW:
1016+ /* Need to make sure off+4 does not overflow. */
1017+ off_max = 0xfff - 4;
1018+ break;
1019+ }
1020+ return -off_max <= off && off <= off_max;
1021+}
1022+
9951023 /* *(size *)(dst + off) = src */
9961024 static inline void emit_str_r(const s8 dst, const s8 src[],
997− s32 off, struct jit_ctx *ctx, const u8 sz){
1025+ s16 off, struct jit_ctx *ctx, const u8 sz){
9981026 const s8 *tmp = bpf2a32[TMP_REG_1];
999− s32 off_max;
10001027 s8 rd;
10011028
10021029 rd = arm_bpf_get_reg32(dst, tmp[1], ctx);
10031030
1004− if (sz == BPF_H)
1005− off_max = 0xff;
1006− else
1007− off_max = 0xfff;
1008−
1009− if (off < 0 || off > off_max) {
1031+ if (!is_ldst_imm(off, sz)) {
10101032 emit_a32_mov_i(tmp[0], off, ctx);
10111033 emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx);
10121034 rd = tmp[0];
@@ -1035,18 +1057,12 @@ static inline void emit_str_r(const s8 dst, const s8 src[], · 22 unmodified lines
10351057
10361058 /* dst = *(size*)(src + off) */
10371059 static inline void emit_ldx_r(const s8 dst[], const s8 src,
1038− s32 off, struct jit_ctx *ctx, const u8 sz){
1060+ s16 off, struct jit_ctx *ctx, const u8 sz){
10391061 const s8 *tmp = bpf2a32[TMP_REG_1];
10401062 const s8 *rd = is_stacked(dst_lo) ? tmp : dst;
10411063 s8 rm = src;
1042− s32 off_max;
1043−
1044− if (sz == BPF_H)
1045− off_max = 0xff;
1046− else
1047− off_max = 0xfff;
10481064
1049− if (off < 0 || off > off_max) {
1065+ if (!is_ldst_imm(off, sz)) {
10501066 emit_a32_mov_i(tmp[0], off, ctx);
10511067 emit(ARM_ADD_R(tmp[0], tmp[0], src), ctx);
10521068 rm = tmp[0];
arch/arm/xen/enlighten.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636
3737 #include <linux/mm.h>
3838
39−struct start_info _xen_start_info;
39+static struct start_info _xen_start_info;
4040 struct start_info *xen_start_info = &_xen_start_info;
4141 EXPORT_SYMBOL(xen_start_info);
4242
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/sysreg.h+3−1
@@ -49,7 +49,9 @@ · 48 unmodified lines
4949 #ifndef CONFIG_BROKEN_GAS_INST
5050
5151 #ifdef __ASSEMBLY__
52−#define __emit_inst(x) .inst (x)
52+// The space separator is omitted so that __emit_inst(x) can be parsed as
53+// either an assembler directive or an assembler macro argument.
54+#define __emit_inst(x) .inst(x)
5355 #else
5456 #define __emit_inst(x) ".inst " __stringify((x)) "\n\t"
5557 #endif
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.c+1−12
@@ -260,18 +260,7 @@ static int __aarch32_alloc_vdso_pages(void) · 259 unmodified lines
260260 if (ret)
261261 return ret;
262262
263− ret = aarch32_alloc_kuser_vdso_page();
264− if (ret) {
265− unsigned long c_vvar =
266− (unsigned long)page_to_virt(aarch32_vdso_pages[C_VVAR]);
267− unsigned long c_vdso =
268− (unsigned long)page_to_virt(aarch32_vdso_pages[C_VDSO]);
269−
270− free_page(c_vvar);
271− free_page(c_vdso);
272− }
273−
274− return ret;
263+ return aarch32_alloc_kuser_vdso_page();
275264 }
276265 #else
277266 static int __aarch32_alloc_vdso_pages(void)
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/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/m68k/include/asm/Kbuild+0−1
@@ -1,7 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0
22 generated-y += syscall_table.h
33 generic-y += extable.h
4−generic-y += hardirq.h
54 generic-y += kvm_para.h
65 generic-y += local64.h
76 generic-y += mcs_spinlock.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/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/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+2−2
@@ -55,12 +55,12 @@ config RISCV · 54 unmodified lines
5555 select ARCH_HAS_PTE_SPECIAL
5656 select ARCH_HAS_MMIOWB
5757 select ARCH_HAS_DEBUG_VIRTUAL
58− select HAVE_EBPF_JIT
58+ select HAVE_EBPF_JIT if MMU
5959 select EDAC_SUPPORT
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/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/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/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/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+3−3
@@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE · 32 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/net/bpf_jit_comp64.c+32−17
@@ -110,6 +110,16 @@ static bool is_32b_int(s64 val) · 109 unmodified lines
110110 return -(1L << 31) <= val && val < (1L << 31);
111111 }
112112
113+static bool in_auipc_jalr_range(s64 val)
114+{
115+ /*
116+ * auipc+jalr can reach any signed PC-relative offset in the range
117+ * [-2^31 - 2^11, 2^31 - 2^11).
118+ */
119+ return (-(1L << 31) - (1L << 11)) <= val &&
120+ val < ((1L << 31) - (1L << 11));
121+}
122+
113123 static void emit_imm(u8 rd, s64 val, struct rv_jit_context *ctx)
114124 {
115125 /* Note that the immediate from the add is sign-extended,
@@ -380,20 +390,24 @@ static void emit_sext_32_rd(u8 *rd, struct rv_jit_context *ctx) · 264 unmodified lines
380390 *rd = RV_REG_T2;
381391 }
382392
383−static void emit_jump_and_link(u8 rd, s64 rvoff, bool force_jalr,
384− struct rv_jit_context *ctx)
393+static int emit_jump_and_link(u8 rd, s64 rvoff, bool force_jalr,
394+ struct rv_jit_context *ctx)
385395 {
386396 s64 upper, lower;
387397
388398 if (rvoff && is_21b_int(rvoff) && !force_jalr) {
389399 emit(rv_jal(rd, rvoff >> 1), ctx);
390− return;
400+ return 0;
401+ } else if (in_auipc_jalr_range(rvoff)) {
402+ upper = (rvoff + (1 << 11)) >> 12;
403+ lower = rvoff & 0xfff;
404+ emit(rv_auipc(RV_REG_T1, upper), ctx);
405+ emit(rv_jalr(rd, RV_REG_T1, lower), ctx);
406+ return 0;
391407 }
392408
393− upper = (rvoff + (1 << 11)) >> 12;
394− lower = rvoff & 0xfff;
395− emit(rv_auipc(RV_REG_T1, upper), ctx);
396− emit(rv_jalr(rd, RV_REG_T1, lower), ctx);
409+ pr_err("bpf-jit: target offset 0x%llx is out of range\n", rvoff);
410+ return -ERANGE;
397411 }
398412
399413 static bool is_signed_bpf_cond(u8 cond)
@@ -407,18 +421,16 @@ static int emit_call(bool fixed, u64 addr, struct rv_jit_context *ctx) · 7 unmodified lines
407421 s64 off = 0;
408422 u64 ip;
409423 u8 rd;
424+ int ret;
410425
411426 if (addr && ctx->insns) {
412427 ip = (u64)(long)(ctx->insns + ctx->ninsns);
413428 off = addr - ip;
414− if (!is_32b_int(off)) {
415− pr_err("bpf-jit: target call addr %pK is out of range\n",
416− (void *)addr);
417− return -ERANGE;
418− }
419429 }
420430
421− emit_jump_and_link(RV_REG_RA, off, !fixed, ctx);
431+ ret = emit_jump_and_link(RV_REG_RA, off, !fixed, ctx);
432+ if (ret)
433+ return ret;
422434 rd = bpf_to_rv_reg(BPF_REG_0, ctx);
423435 emit(rv_addi(rd, RV_REG_A0, 0), ctx);
424436 return 0;
@@ -429,7 +441,7 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx, · 4 unmodified lines
429441 {
430442 bool is64 = BPF_CLASS(insn->code) == BPF_ALU64 ||
431443 BPF_CLASS(insn->code) == BPF_JMP;
432− int s, e, rvoff, i = insn - ctx->prog->insnsi;
444+ int s, e, rvoff, ret, i = insn - ctx->prog->insnsi;
433445 struct bpf_prog_aux *aux = ctx->prog->aux;
434446 u8 rd = -1, rs = -1, code = insn->code;
435447 s16 off = insn->off;
@@ -699,7 +711,9 @@ out_be: · 263 unmodified lines
699711 /* JUMP off */
700712 case BPF_JMP | BPF_JA:
701713 rvoff = rv_offset(i, off, ctx);
702− emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
714+ ret = emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
715+ if (ret)
716+ return ret;
703717 break;
704718
705719 /* IF (dst COND src) JUMP off */
@@ -801,7 +815,6 @@ out_be: · 95 unmodified lines
801815 case BPF_JMP | BPF_CALL:
802816 {
803817 bool fixed;
804− int ret;
805818 u64 addr;
806819
807820 mark_call(ctx);
@@ -826,7 +839,9 @@ out_be: · 18 unmodified lines
826839 break;
827840
828841 rvoff = epilogue_offset(ctx);
829− emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
842+ ret = emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
843+ if (ret)
844+ return ret;
830845 break;
831846
832847 /* dst = imm64 */
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+3−0
@@ -1939,6 +1939,9 @@ static int gfn_to_memslot_approx(struct kvm_memslots *slots, gfn_t gfn) · 1938 unmodified lines
19391939 start = slot + 1;
19401940 }
19411941
1942+ if (start >= slots->used_slots)
1943+ return slots->used_slots - 1;
1944+
19421945 if (gfn >= memslots[start].base_gfn &&
19431946 gfn < memslots[start].base_gfn + memslots[start].npages) {
19441947 atomic_set(&slots->lru_slot, start);
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/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+15−3
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/mm.h>
2121 #include <linux/hyperv.h>
2222 #include <linux/slab.h>
23+#include <linux/kernel.h>
2324 #include <linux/cpuhotplug.h>
2425 #include <linux/syscore_ops.h>
2526 #include <clocksource/hyperv_timer.h>
@@ -72,7 +73,8 @@ static int hv_cpu_init(unsigned int cpu) · 46 unmodified lines
7273 struct page *pg;
7374
7475 input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg);
75− 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);
7678 if (unlikely(!pg))
7779 return -ENOMEM;
7880 *input_arg = page_address(pg);
@@ -253,6 +255,7 @@ static int __init hv_pci_init(void) · 174 unmodified lines
253255 static int hv_suspend(void)
254256 {
255257 union hv_x64_msr_hypercall_contents hypercall_msr;
258+ int ret;
256259
257260 /*
258261 * Reset the hypercall page as it is going to be invalidated
@@ -269,12 +272,17 @@ static int hv_suspend(void) · 10 unmodified lines
269272 hypercall_msr.enable = 0;
270273 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
271274
272− return 0;
275+ ret = hv_cpu_die(0);
276+ return ret;
273277 }
274278
275279 static void hv_resume(void)
276280 {
277281 union hv_x64_msr_hypercall_contents hypercall_msr;
282+ int ret;
283+
284+ ret = hv_cpu_init(0);
285+ WARN_ON(ret);
278286
279287 /* Re-enable the hypercall page */
280288 rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
@@ -287,6 +295,7 @@ static void hv_resume(void) · 6 unmodified lines
287295 hv_hypercall_pg_saved = NULL;
288296 }
289297
298+/* Note: when the ops are called, only CPU0 is online and IRQs are disabled. */
290299 static struct syscore_ops hv_syscore_ops = {
291300 .suspend = hv_suspend,
292301 .resume = hv_resume,
@@ -419,11 +428,14 @@ void hyperv_cleanup(void) · 126 unmodified lines
419428 }
420429 EXPORT_SYMBOL_GPL(hyperv_cleanup);
421430
422−void hyperv_report_panic(struct pt_regs *regs, long err)
431+void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die)
423432 {
424433 static bool panic_reported;
425434 u64 guest_id;
426435
436+ if (in_die && !panic_on_oops)
437+ return;
438+
427439 /*
428440 * We prefer to report panic on 'die' chain as we have proper
429441 * registers to report, but if we miss it (e.g. on BUG()) we need
arch/x86/include/asm/efi.h+2−0
@@ -178,8 +178,10 @@ extern void efi_free_boot_services(void); · 177 unmodified lines
178178 extern pgd_t * __init efi_uv1_memmap_phys_prolog(void);
179179 extern void __init efi_uv1_memmap_phys_epilog(pgd_t *save_pgd);
180180
181+/* kexec external ABI */
181182 struct efi_setup_data {
182183 u64 fw_vendor;
184+ u64 __unused;
183185 u64 tables;
184186 u64 smbios;
185187 u64 reserved[8];
arch/x86/include/asm/microcode_amd.h+1−1
@@ -41,7 +41,7 @@ struct microcode_amd { · 40 unmodified lines
4141 unsigned int mpb[0];
4242 };
4343
44−#define PATCH_MAX_SIZE PAGE_SIZE
44+#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
4545
4646 #ifdef CONFIG_MICROCODE_AMD
4747 extern void __init load_ucode_amd_bsp(unsigned int family);
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/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/cpu/intel.c+36−18
@@ -1119,35 +1119,53 @@ void switch_to_sld(unsigned long tifn) · 1118 unmodified lines
11191119 sld_update_msr(!(tifn & _TIF_SLD));
11201120 }
11211121
1122−#define SPLIT_LOCK_CPU(model) {X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY}
1123−
11241122 /*
1125− * The following processors have the split lock detection feature. But
1126− * since they don't have the IA32_CORE_CAPABILITIES MSR, the feature cannot
1127− * be enumerated. Enable it by family and model matching on these
1128− * processors.
1123+ * Bits in the IA32_CORE_CAPABILITIES are not architectural, so they should
1124+ * only be trusted if it is confirmed that a CPU model implements a
1125+ * specific feature at a particular bit position.
1126+ *
1127+ * The possible driver data field values:
1128+ *
1129+ * - 0: CPU models that are known to have the per-core split-lock detection
1130+ * feature even though they do not enumerate IA32_CORE_CAPABILITIES.
1131+ *
1132+ * - 1: CPU models which may enumerate IA32_CORE_CAPABILITIES and if so use
1133+ * bit 5 to enumerate the per-core split-lock detection feature.
11291134 */
11301135 static const struct x86_cpu_id split_lock_cpu_ids[] __initconst = {
1131− SPLIT_LOCK_CPU(INTEL_FAM6_ICELAKE_X),
1132− SPLIT_LOCK_CPU(INTEL_FAM6_ICELAKE_L),
1136+ X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, 0),
1137+ X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_L, 0),
1138+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, 1),
1139+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, 1),
1140+ X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, 1),
11331141 {}
11341142 };
11351143
11361144 void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c)
11371145 {
1138− u64 ia32_core_caps = 0;
1146+ const struct x86_cpu_id *m;
1147+ u64 ia32_core_caps;
1148+
1149+ if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
1150+ return;
11391151
1140− if (c->x86_vendor != X86_VENDOR_INTEL)
1152+ m = x86_match_cpu(split_lock_cpu_ids);
1153+ if (!m)
11411154 return;
1142− if (cpu_has(c, X86_FEATURE_CORE_CAPABILITIES)) {
1143− /* Enumerate features reported in IA32_CORE_CAPABILITIES MSR. */
1155+
1156+ switch (m->driver_data) {
1157+ case 0:
1158+ break;
1159+ case 1:
1160+ if (!cpu_has(c, X86_FEATURE_CORE_CAPABILITIES))
1161+ return;
11441162 rdmsrl(MSR_IA32_CORE_CAPS, ia32_core_caps);
1145− } else if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
1146− /* Enumerate split lock detection by family and model. */
1147− if (x86_match_cpu(split_lock_cpu_ids))
1148− ia32_core_caps |= MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT;
1163+ if (!(ia32_core_caps & MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT))
1164+ return;
1165+ break;
1166+ default:
1167+ return;
11491168 }
11501169
1151− if (ia32_core_caps & MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT)
1152− split_lock_setup();
1170+ split_lock_setup();
11531171 }
arch/x86/kernel/cpu/mshyperv.c+12−2
@@ -227,8 +227,8 @@ static void __init ms_hyperv_init_platform(void) · 226 unmodified lines
227227 ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
228228 ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
229229
230− pr_info("Hyper-V: features 0x%x, hints 0x%x\n",
231− ms_hyperv.features, ms_hyperv.hints);
230+ pr_info("Hyper-V: features 0x%x, hints 0x%x, misc 0x%x\n",
231+ ms_hyperv.features, ms_hyperv.hints, ms_hyperv.misc_features);
232232
233233 ms_hyperv.max_vp_index = cpuid_eax(HYPERV_CPUID_IMPLEMENT_LIMITS);
234234 ms_hyperv.max_lp_index = cpuid_ebx(HYPERV_CPUID_IMPLEMENT_LIMITS);
@@ -263,6 +263,16 @@ static void __init ms_hyperv_init_platform(void) · 28 unmodified lines
263263 cpuid_eax(HYPERV_CPUID_NESTED_FEATURES);
264264 }
265265
266+ /*
267+ * Hyper-V expects to get crash register data or kmsg when
268+ * crash enlightment is available and system crashes. Set
269+ * crash_kexec_post_notifiers to be true to make sure that
270+ * calling crash enlightment interface before running kdump
271+ * kernel.
272+ */
273+ if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE)
274+ crash_kexec_post_notifiers = true;
275+
266276 #ifdef CONFIG_X86_LOCAL_APIC
267277 if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
268278 ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
arch/x86/kernel/cpu/resctrl/core.c+2−0
@@ -578,6 +578,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r) · 577 unmodified lines
578578 d->id = id;
579579 cpumask_set_cpu(cpu, &d->cpu_mask);
580580
581+ rdt_domain_reconfigure_cdp(r);
582+
581583 if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
582584 kfree(d);
583585 return;
arch/x86/kernel/cpu/resctrl/internal.h+1−0
@@ -601,5 +601,6 @@ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d); · 600 unmodified lines
601601 void __check_limbo(struct rdt_domain *d, bool force_free);
602602 bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r);
603603 bool cbm_validate_amd(char *buf, u32 *data, struct rdt_resource *r);
604+void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
604605
605606 #endif /* _ASM_X86_RESCTRL_INTERNAL_H */
arch/x86/kernel/cpu/resctrl/rdtgroup.c+15−1
@@ -1859,6 +1859,19 @@ static int set_cache_qos_cfg(int level, bool enable) · 1858 unmodified lines
18591859 return 0;
18601860 }
18611861
1862+/* Restore the qos cfg state when a domain comes online */
1863+void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
1864+{
1865+ if (!r->alloc_capable)
1866+ return;
1867+
1868+ if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
1869+ l2_qos_cfg_update(&r->alloc_enabled);
1870+
1871+ if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
1872+ l3_qos_cfg_update(&r->alloc_enabled);
1873+}
1874+
18621875 /*
18631876 * Enable or disable the MBA software controller
18641877 * which helps user specify bandwidth in MBps.
@@ -3072,7 +3085,8 @@ static int rdtgroup_rmdir(struct kernfs_node *kn) · 1207 unmodified lines
30723085 * If the rdtgroup is a mon group and parent directory
30733086 * is a valid "mon_groups" directory, remove the mon group.
30743087 */
3075− if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn) {
3088+ if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn &&
3089+ rdtgrp != &rdtgroup_default) {
30763090 if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP ||
30773091 rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) {
30783092 ret = rdtgroup_ctrl_remove(kn, rdtgrp);
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/umip.c+1−1
@@ -81,7 +81,7 @@ · 80 unmodified lines
8181 #define UMIP_INST_SLDT 3 /* 0F 00 /0 */
8282 #define UMIP_INST_STR 4 /* 0F 00 /1 */
8383
84−const char * const umip_insns[5] = {
84+static const char * const umip_insns[5] = {
8585 [UMIP_INST_SGDT] = "SGDT",
8686 [UMIP_INST_SIDT] = "SIDT",
8787 [UMIP_INST_SMSW] = "SMSW",
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/svm/sev.c+5−1
@@ -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"
@@ -1117,7 +1118,7 @@ int __init sev_hardware_setup(void) · 1099 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+1−9
@@ -3276,7 +3276,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu) · 3275 unmodified lines
32763276 svm_complete_interrupts(svm);
32773277 }
32783278
3279−bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
3279+void __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
32803280
32813281 static void svm_vcpu_run(struct kvm_vcpu *vcpu)
32823282 {
@@ -3330,13 +3330,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) · 47 unmodified lines
33303330 */
33313331 x86_spec_ctrl_set_guest(svm->spec_ctrl, svm->virt_spec_ctrl);
33323332
3333− local_irq_enable();
3334−
33353333 __svm_vcpu_run(svm->vmcb_pa, (unsigned long *)&svm->vcpu.arch.regs);
33363334
3337− /* Eliminate branch target predictions from guest mode */
3338− vmexit_fill_RSB();
3339−
33403335 #ifdef CONFIG_X86_64
33413336 wrmsrl(MSR_GS_BASE, svm->host.gs_base);
33423337 #else
@@ -3366,8 +3361,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) · 23 unmodified lines
33663361
33673362 reload_tss(vcpu);
33683363
3369− local_irq_disable();
3370−
33713364 x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
33723365
33733366 vcpu->arch.cr2 = svm->vmcb->save.cr2;
@@ -3411,7 +3404,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) · 37 unmodified lines
34113404
34123405 mark_all_clean(svm->vmcb);
34133406 }
3414−STACK_FRAME_NON_STANDARD(svm_vcpu_run);
34153407
34163408 static void svm_load_mmu_pgd(struct kvm_vcpu *vcpu, unsigned long root)
34173409 {
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+19−2
@@ -5533,8 +5533,25 @@ static bool nested_vmx_exit_handled_vmcs_access(struct kvm_vcpu *vcpu, · 5532 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/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+19−2
@@ -3060,6 +3060,17 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 3059 unmodified lines
30603060 case MSR_IA32_PERF_CTL:
30613061 case MSR_AMD64_DC_CFG:
30623062 case MSR_F15H_EX_CFG:
3063+ /*
3064+ * Intel Sandy Bridge CPUs must support the RAPL (running average power
3065+ * limit) MSRs. Just return 0, as we do not want to expose the host
3066+ * data here. Do not conditionalize this on CPUID, as KVM does not do
3067+ * so for existing CPU-specific MSRs.
3068+ */
3069+ case MSR_RAPL_POWER_UNIT:
3070+ case MSR_PP0_ENERGY_STATUS: /* Power plane 0 (core) */
3071+ case MSR_PP1_ENERGY_STATUS: /* Power plane 1 (graphics uncore) */
3072+ case MSR_PKG_ENERGY_STATUS: /* Total package */
3073+ case MSR_DRAM_ENERGY_STATUS: /* DRAM controller */
30633074 msr_info->data = 0;
30643075 break;
30653076 case MSR_F15H_PERF_CTL0 ... MSR_F15H_PERF_CTR5:
@@ -5049,10 +5060,13 @@ set_identity_unlock: · 1983 unmodified lines
50495060 r = -EFAULT;
50505061 if (copy_from_user(&u.ps, argp, sizeof(u.ps)))
50515062 goto out;
5063+ mutex_lock(&kvm->lock);
50525064 r = -ENXIO;
50535065 if (!kvm->arch.vpit)
5054− goto out;
5066+ goto set_pit_out;
50555067 r = kvm_vm_ioctl_set_pit(kvm, &u.ps);
5068+set_pit_out:
5069+ mutex_unlock(&kvm->lock);
50565070 break;
50575071 }
50585072 case KVM_GET_PIT2: {
@@ -5072,10 +5086,13 @@ set_identity_unlock: · 13 unmodified lines
50725086 r = -EFAULT;
50735087 if (copy_from_user(&u.ps2, argp, sizeof(u.ps2)))
50745088 goto out;
5089+ mutex_lock(&kvm->lock);
50755090 r = -ENXIO;
50765091 if (!kvm->arch.vpit)
5077− goto out;
5092+ goto set_pit2_out;
50785093 r = kvm_vm_ioctl_set_pit2(kvm, &u.ps2);
5094+set_pit2_out:
5095+ mutex_unlock(&kvm->lock);
50795096 break;
50805097 }
50815098 case KVM_REINJECT_CONTROL: {
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/x86/platform/efi/efi_64.c+12−4
@@ -202,7 +202,7 @@ virt_to_phys_or_null_size(void *va, unsigned long size) · 201 unmodified lines
202202
203203 int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
204204 {
205− unsigned long pfn, text, pf;
205+ unsigned long pfn, text, pf, rodata;
206206 struct page *page;
207207 unsigned npages;
208208 pgd_t *pgd = efi_mm.pgd;
@@ -256,7 +256,7 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) · 47 unmodified lines
256256
257257 efi_scratch.phys_stack = page_to_phys(page + 1); /* stack grows down */
258258
259− npages = (__end_rodata_aligned - _text) >> PAGE_SHIFT;
259+ npages = (_etext - _text) >> PAGE_SHIFT;
260260 text = __pa(_text);
261261 pfn = text >> PAGE_SHIFT;
262262
@@ -266,6 +266,14 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) · 3 unmodified lines
266266 return 1;
267267 }
268268
269+ npages = (__end_rodata - __start_rodata) >> PAGE_SHIFT;
270+ rodata = __pa(__start_rodata);
271+ pfn = rodata >> PAGE_SHIFT;
272+ if (kernel_map_pages_in_pgd(pgd, pfn, rodata, npages, pf)) {
273+ pr_err("Failed to map kernel rodata 1:1\n");
274+ return 1;
275+ }
276+
269277 return 0;
270278 }
271279
@@ -638,7 +646,7 @@ efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor, · 366 unmodified lines
638646 phys_vendor = virt_to_phys_or_null(vnd);
639647 phys_data = virt_to_phys_or_null_size(data, data_size);
640648
641− if (!phys_name || !phys_data)
649+ if (!phys_name || (data && !phys_data))
642650 status = EFI_INVALID_PARAMETER;
643651 else
644652 status = efi_thunk(set_variable, phys_name, phys_vendor,
@@ -669,7 +677,7 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 24 unmodified lines
669677 phys_vendor = virt_to_phys_or_null(vnd);
670678 phys_data = virt_to_phys_or_null_size(data, data_size);
671679
672− if (!phys_name || !phys_data)
680+ if (!phys_name || (data && !phys_data))
673681 status = EFI_INVALID_PARAMETER;
674682 else
675683 status = efi_thunk(set_variable, phys_name, phys_vendor,
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/blk-iocost.c+2−2
@@ -1591,7 +1591,7 @@ skip_surplus_transfers: · 1590 unmodified lines
15911591 vrate_min, vrate_max);
15921592 }
15931593
1594− trace_iocost_ioc_vrate_adj(ioc, vrate, &missed_ppm, rq_wait_pct,
1594+ trace_iocost_ioc_vrate_adj(ioc, vrate, missed_ppm, rq_wait_pct,
15951595 nr_lagging, nr_shortages,
15961596 nr_surpluses);
15971597
@@ -1600,7 +1600,7 @@ skip_surplus_transfers: · 2 unmodified lines
16001600 ioc->period_us * vrate * INUSE_MARGIN_PCT, 100);
16011601 } else if (ioc->busy_level != prev_busy_level || nr_lagging) {
16021602 trace_iocost_ioc_vrate_adj(ioc, atomic64_read(&ioc->vtime_rate),
1603− &missed_ppm, rq_wait_pct, nr_lagging,
1603+ missed_ppm, rq_wait_pct, nr_lagging,
16041604 nr_shortages, nr_surpluses);
16051605 }
16061606
block/blk-mq.c+3−1
@@ -1222,8 +1222,10 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 1221 unmodified lines
12221222 rq = list_first_entry(list, struct request, queuelist);
12231223
12241224 hctx = rq->mq_hctx;
1225− if (!got_budget && !blk_mq_get_dispatch_budget(hctx))
1225+ if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) {
1226+ blk_mq_put_driver_tag(rq);
12261227 break;
1228+ }
12271229
12281230 if (!blk_mq_get_driver_tag(rq)) {
12291231 /*
block/blk-wbt.c+2−2
@@ -313,7 +313,7 @@ static void scale_up(struct rq_wb *rwb) · 312 unmodified lines
313313 calc_wb_limits(rwb);
314314 rwb->unknown_cnt = 0;
315315 rwb_wake_all(rwb);
316− rwb_trace_step(rwb, "scale up");
316+ rwb_trace_step(rwb, tracepoint_string("scale up"));
317317 }
318318
319319 static void scale_down(struct rq_wb *rwb, bool hard_throttle)
@@ -322,7 +322,7 @@ static void scale_down(struct rq_wb *rwb, bool hard_throttle) · 2 unmodified lines
322322 return;
323323 calc_wb_limits(rwb);
324324 rwb->unknown_cnt = 0;
325− rwb_trace_step(rwb, "scale down");
325+ rwb_trace_step(rwb, tracepoint_string("scale down"));
326326 }
327327
328328 static void rwb_arm_timer(struct rq_wb *rwb)
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)
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/ata/ahci.c+1−0
@@ -410,6 +410,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 409 unmodified lines
410410 { PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */
411411 { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */
412412 { PCI_VDEVICE(INTEL, 0x34d3), board_ahci_mobile }, /* Ice Lake LP AHCI */
413+ { PCI_VDEVICE(INTEL, 0x02d3), board_ahci_mobile }, /* Comet Lake PCH-U AHCI */
413414 { PCI_VDEVICE(INTEL, 0x02d7), board_ahci_mobile }, /* Comet Lake PCH RAID */
414415
415416 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
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/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/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/rbd.c+19−14
@@ -3754,11 +3754,7 @@ static int __rbd_notify_op_lock(struct rbd_device *rbd_dev, · 3753 unmodified lines
37543754 static void rbd_notify_op_lock(struct rbd_device *rbd_dev,
37553755 enum rbd_notify_op notify_op)
37563756 {
3757− struct page **reply_pages;
3758− size_t reply_len;
3759−
3760− __rbd_notify_op_lock(rbd_dev, notify_op, &reply_pages, &reply_len);
3761− ceph_release_page_vector(reply_pages, calc_pages_for(0, reply_len));
3757+ __rbd_notify_op_lock(rbd_dev, notify_op, NULL, NULL);
37623758 }
37633759
37643760 static void rbd_notify_acquired_lock(struct work_struct *work)
@@ -4527,6 +4523,10 @@ static void cancel_tasks_sync(struct rbd_device *rbd_dev) · 762 unmodified lines
45274523 cancel_work_sync(&rbd_dev->unlock_work);
45284524 }
45294525
4526+/*
4527+ * header_rwsem must not be held to avoid a deadlock with
4528+ * rbd_dev_refresh() when flushing notifies.
4529+ */
45304530 static void rbd_unregister_watch(struct rbd_device *rbd_dev)
45314531 {
45324532 cancel_tasks_sync(rbd_dev);
@@ -6894,9 +6894,10 @@ static void rbd_print_dne(struct rbd_device *rbd_dev, bool is_snap) · 2361 unmodified lines
68946894
68956895 static void rbd_dev_image_release(struct rbd_device *rbd_dev)
68966896 {
6897− rbd_dev_unprobe(rbd_dev);
6898− if (rbd_dev->opts)
6897+ if (!rbd_is_ro(rbd_dev))
68996898 rbd_unregister_watch(rbd_dev);
6899+
6900+ rbd_dev_unprobe(rbd_dev);
69006901 rbd_dev->image_format = 0;
69016902 kfree(rbd_dev->spec->image_id);
69026903 rbd_dev->spec->image_id = NULL;
@@ -6907,6 +6908,9 @@ static void rbd_dev_image_release(struct rbd_device *rbd_dev) · 4 unmodified lines
69076908 * device. If this image is the one being mapped (i.e., not a
69086909 * parent), initiate a watch on its header object before using that
69096910 * object to get detailed information about the rbd image.
6911+ *
6912+ * On success, returns with header_rwsem held for write if called
6913+ * with @depth == 0.
69106914 */
69116915 static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
69126916 {
@@ -6936,11 +6940,14 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth) · 23 unmodified lines
69366940 }
69376941 }
69386942
6943+ if (!depth)
6944+ down_write(&rbd_dev->header_rwsem);
6945+
69396946 ret = rbd_dev_header_info(rbd_dev);
69406947 if (ret) {
69416948 if (ret == -ENOENT && !need_watch)
69426949 rbd_print_dne(rbd_dev, false);
6943− goto err_out_watch;
6950+ goto err_out_probe;
69446951 }
69456952
69466953 /*
@@ -6985,10 +6992,11 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth) · 38 unmodified lines
69856992 return 0;
69866993
69876994 err_out_probe:
6988− rbd_dev_unprobe(rbd_dev);
6989−err_out_watch:
6995+ if (!depth)
6996+ up_write(&rbd_dev->header_rwsem);
69906997 if (need_watch)
69916998 rbd_unregister_watch(rbd_dev);
6999+ rbd_dev_unprobe(rbd_dev);
69927000 err_out_format:
69937001 rbd_dev->image_format = 0;
69947002 kfree(rbd_dev->spec->image_id);
@@ -7050,12 +7058,9 @@ static ssize_t do_rbd_add(struct bus_type *bus, · 55 unmodified lines
70507058 goto err_out_rbd_dev;
70517059 }
70527060
7053− down_write(&rbd_dev->header_rwsem);
70547061 rc = rbd_dev_image_probe(rbd_dev, 0);
7055− if (rc < 0) {
7056− up_write(&rbd_dev->header_rwsem);
7062+ if (rc < 0)
70577063 goto err_out_rbd_dev;
7058− }
70597064
70607065 if (rbd_dev->opts->alloc_size > rbd_dev->layout.object_size) {
70617066 rbd_warn(rbd_dev, "alloc_size adjusted to %u",
drivers/block/virtio_blk.c+1−0
@@ -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
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/clk/clk-asm9260.c+1−1
@@ -276,7 +276,7 @@ static void __init asm9260_acc_init(struct device_node *np) · 275 unmodified lines
276276
277277 /* TODO: Convert to DT parent scheme */
278278 ref_clk = of_clk_get_parent_name(np, 0);
279− hw = __clk_hw_register_fixed_rate_with_accuracy(NULL, NULL, pll_clk,
279+ hw = __clk_hw_register_fixed_rate(NULL, NULL, pll_clk,
280280 ref_clk, NULL, NULL, 0, rate, 0,
281281 CLK_FIXED_RATE_PARENT_ACCURACY);
282282
drivers/clk/mmp/clk-pll.c+32−1
@@ -97,7 +97,7 @@ static const struct clk_ops mmp_clk_pll_ops = { · 96 unmodified lines
9797 .recalc_rate = mmp_clk_pll_recalc_rate,
9898 };
9999
100−struct clk *mmp_clk_register_pll(char *name,
100+static struct clk *mmp_clk_register_pll(char *name,
101101 unsigned long default_rate,
102102 void __iomem *enable_reg, u32 enable,
103103 void __iomem *reg, u8 shift,
@@ -137,3 +137,34 @@ struct clk *mmp_clk_register_pll(char *name, · 33 unmodified lines
137137
138138 return clk;
139139 }
140+
141+void mmp_register_pll_clks(struct mmp_clk_unit *unit,
142+ struct mmp_param_pll_clk *clks,
143+ void __iomem *base, int size)
144+{
145+ struct clk *clk;
146+ int i;
147+
148+ for (i = 0; i < size; i++) {
149+ void __iomem *reg = NULL;
150+
151+ if (clks[i].offset)
152+ reg = base + clks[i].offset;
153+
154+ clk = mmp_clk_register_pll(clks[i].name,
155+ clks[i].default_rate,
156+ base + clks[i].enable_offset,
157+ clks[i].enable,
158+ reg, clks[i].shift,
159+ clks[i].input_rate,
160+ base + clks[i].postdiv_offset,
161+ clks[i].postdiv_shift);
162+ if (IS_ERR(clk)) {
163+ pr_err("%s: failed to register clock %s\n",
164+ __func__, clks[i].name);
165+ continue;
166+ }
167+ if (clks[i].id)
168+ unit->clk_table[clks[i].id] = clk;
169+ }
170+}
drivers/clk/mmp/clk.c+0−31
@@ -176,37 +176,6 @@ void mmp_register_div_clks(struct mmp_clk_unit *unit, · 175 unmodified lines
176176 }
177177 }
178178
179−void mmp_register_pll_clks(struct mmp_clk_unit *unit,
180− struct mmp_param_pll_clk *clks,
181− void __iomem *base, int size)
182−{
183− struct clk *clk;
184− int i;
185−
186− for (i = 0; i < size; i++) {
187− void __iomem *reg = NULL;
188−
189− if (clks[i].offset)
190− reg = base + clks[i].offset;
191−
192− clk = mmp_clk_register_pll(clks[i].name,
193− clks[i].default_rate,
194− base + clks[i].enable_offset,
195− clks[i].enable,
196− reg, clks[i].shift,
197− clks[i].input_rate,
198− base + clks[i].postdiv_offset,
199− clks[i].postdiv_shift);
200− if (IS_ERR(clk)) {
201− pr_err("%s: failed to register clock %s\n",
202− __func__, clks[i].name);
203− continue;
204− }
205− if (clks[i].id)
206− unit->clk_table[clks[i].id] = clk;
207− }
208−}
209−
210179 void mmp_clk_add(struct mmp_clk_unit *unit, unsigned int id,
211180 struct clk *clk)
212181 {
drivers/clk/mmp/clk.h+0−7
@@ -238,13 +238,6 @@ void mmp_register_pll_clks(struct mmp_clk_unit *unit, · 237 unmodified lines
238238 struct mmp_param_pll_clk *clks,
239239 void __iomem *base, int size);
240240
241−extern struct clk *mmp_clk_register_pll(char *name,
242− unsigned long default_rate,
243− void __iomem *enable_reg, u32 enable,
244− void __iomem *reg, u8 shift,
245− unsigned long input_rate,
246− void __iomem *postdiv_reg, u8 postdiv_shift);
247−
248241 #define DEFINE_MIX_REG_INFO(w_d, s_d, w_m, s_m, fc) \
249242 { \
250243 .width_div = (w_d), \
drivers/clk/sprd/sc9863a-clk.c+2−1
@@ -1641,8 +1641,9 @@ static SPRD_SC_GATE_CLK_FW_NAME(i2c4_eb, "i2c4-eb", "ext-26m", 0x0, · 1640 unmodified lines
16411641 0x1000, BIT(12), 0, 0);
16421642 static SPRD_SC_GATE_CLK_FW_NAME(uart0_eb, "uart0-eb", "ext-26m", 0x0,
16431643 0x1000, BIT(13), 0, 0);
1644+/* uart1_eb is for console, don't gate even if unused */
16441645 static SPRD_SC_GATE_CLK_FW_NAME(uart1_eb, "uart1-eb", "ext-26m", 0x0,
1645− 0x1000, BIT(14), 0, 0);
1646+ 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
16461647 static SPRD_SC_GATE_CLK_FW_NAME(uart2_eb, "uart2-eb", "ext-26m", 0x0,
16471648 0x1000, BIT(15), 0, 0);
16481649 static SPRD_SC_GATE_CLK_FW_NAME(uart3_eb, "uart3-eb", "ext-26m", 0x0,
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+2−4
@@ -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 }
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/cper.c+1−1
@@ -101,7 +101,7 @@ void cper_print_bits(const char *pfx, unsigned int bits, · 100 unmodified lines
101101 if (!len)
102102 len = snprintf(buf, sizeof(buf), "%s%s", pfx, str);
103103 else
104− len += snprintf(buf+len, sizeof(buf)-len, ", %s", str);
104+ len += scnprintf(buf+len, sizeof(buf)-len, ", %s", str);
105105 }
106106 if (len)
107107 printk("%s\n", buf);
drivers/firmware/efi/libstub/efistub.h+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #define EFI_ALLOC_ALIGN EFI_PAGE_SIZE
2626 #endif
2727
28−#ifdef CONFIG_ARM
28+#if defined(CONFIG_ARM) || defined(CONFIG_X86)
2929 #define __efistub_global __section(.data)
3030 #else
3131 #define __efistub_global
drivers/firmware/efi/libstub/file.c+14−13
@@ -29,30 +29,31 @@ · 28 unmodified lines
2929 */
3030 #define EFI_READ_CHUNK_SIZE SZ_1M
3131
32+struct finfo {
33+ efi_file_info_t info;
34+ efi_char16_t filename[MAX_FILENAME_SIZE];
35+};
36+
3237 static efi_status_t efi_open_file(efi_file_protocol_t *volume,
33− efi_char16_t *filename_16,
38+ struct finfo *fi,
3439 efi_file_protocol_t **handle,
3540 unsigned long *file_size)
3641 {
37− struct {
38− efi_file_info_t info;
39− efi_char16_t filename[MAX_FILENAME_SIZE];
40− } finfo;
4142 efi_guid_t info_guid = EFI_FILE_INFO_ID;
4243 efi_file_protocol_t *fh;
4344 unsigned long info_sz;
4445 efi_status_t status;
4546
46− status = volume->open(volume, &fh, filename_16, EFI_FILE_MODE_READ, 0);
47+ status = volume->open(volume, &fh, fi->filename, EFI_FILE_MODE_READ, 0);
4748 if (status != EFI_SUCCESS) {
4849 pr_efi_err("Failed to open file: ");
49− efi_char16_printk(filename_16);
50+ efi_char16_printk(fi->filename);
5051 efi_printk("\n");
5152 return status;
5253 }
5354
54− info_sz = sizeof(finfo);
55− status = fh->get_info(fh, &info_guid, &info_sz, &finfo);
55+ info_sz = sizeof(struct finfo);
56+ status = fh->get_info(fh, &info_guid, &info_sz, fi);
5657 if (status != EFI_SUCCESS) {
5758 pr_efi_err("Failed to get file info\n");
5859 fh->close(fh);
@@ -60,7 +61,7 @@ static efi_status_t efi_open_file(efi_file_protocol_t *volume, · 1 unmodified line
6061 }
6162
6263 *handle = fh;
63− *file_size = finfo.info.file_size;
64+ *file_size = fi->info.file_size;
6465 return EFI_SUCCESS;
6566 }
6667
@@ -146,13 +147,13 @@ static efi_status_t handle_cmdline_files(efi_loaded_image_t *image, · 79 unmodified lines
146147
147148 alloc_addr = alloc_size = 0;
148149 do {
149− efi_char16_t filename[MAX_FILENAME_SIZE];
150+ struct finfo fi;
150151 unsigned long size;
151152 void *addr;
152153
153154 offset = find_file_option(cmdline, cmdline_len,
154155 optstr, optstr_size,
155− filename, ARRAY_SIZE(filename));
156+ fi.filename, ARRAY_SIZE(fi.filename));
156157
157158 if (!offset)
158159 break;
@@ -166,7 +167,7 @@ static efi_status_t handle_cmdline_files(efi_loaded_image_t *image, · 7 unmodified lines
166167 return status;
167168 }
168169
169− status = efi_open_file(volume, filename, &file, &size);
170+ status = efi_open_file(volume, &fi, &file, &size);
170171 if (status != EFI_SUCCESS)
171172 goto err_close_volume;
172173
drivers/firmware/efi/libstub/x86-stub.c+11−7
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 /* Maximum physical address for 64-bit kernel with 4-level paging */
2121 #define MAXMEM_X86_64_4LEVEL (1ull << 46)
2222
23−static efi_system_table_t *sys_table;
23+static efi_system_table_t *sys_table __efistub_global;
2424 extern const bool efi_is64;
2525 extern u32 image_offset;
2626
@@ -392,8 +392,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 365 unmodified lines
392392 image_base = efi_table_attr(image, image_base);
393393 image_offset = (void *)startup_32 - image_base;
394394
395− hdr = &((struct boot_params *)image_base)->hdr;
396−
397395 status = efi_allocate_pages(0x4000, (unsigned long *)&boot_params, ULONG_MAX);
398396 if (status != EFI_SUCCESS) {
399397 efi_printk("Failed to allocate lowmem for boot params\n");
@@ -742,8 +740,15 @@ unsigned long efi_main(efi_handle_t handle, · 342 unmodified lines
742740 * now use KERNEL_IMAGE_SIZE, which will be 512MiB, the same as what
743741 * KASLR uses.
744742 *
745− * Also relocate it if image_offset is zero, i.e. we weren't loaded by
746− * LoadImage, but we are not aligned correctly.
743+ * Also relocate it if image_offset is zero, i.e. the kernel wasn't
744+ * loaded by LoadImage, but rather by a bootloader that called the
745+ * handover entry. The reason we must always relocate in this case is
746+ * to handle the case of systemd-boot booting a unified kernel image,
747+ * which is a PE executable that contains the bzImage and an initrd as
748+ * COFF sections. The initrd section is placed after the bzImage
749+ * without ensuring that there are at least init_size bytes available
750+ * for the bzImage, and thus the compressed kernel's startup code may
751+ * overwrite the initrd unless it is moved out of the way.
747752 */
748753
749754 buffer_start = ALIGN(bzimage_addr - image_offset,
@@ -753,8 +758,7 @@ unsigned long efi_main(efi_handle_t handle, · 3 unmodified lines
753758 if ((buffer_start < LOAD_PHYSICAL_ADDR) ||
754759 (IS_ENABLED(CONFIG_X86_32) && buffer_end > KERNEL_IMAGE_SIZE) ||
755760 (IS_ENABLED(CONFIG_X86_64) && buffer_end > MAXMEM_X86_64_4LEVEL) ||
756− (image_offset == 0 && !IS_ALIGNED(bzimage_addr,
757− hdr->kernel_alignment))) {
761+ (image_offset == 0)) {
758762 status = efi_relocate_kernel(&bzimage_addr,
759763 hdr->init_size, hdr->init_size,
760764 hdr->pref_address,
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+20−2
@@ -2008,8 +2008,24 @@ static void amdgpu_device_fill_reset_magic(struct amdgpu_device *adev) · 2007 unmodified lines
20082008 */
20092009 static bool amdgpu_device_check_vram_lost(struct amdgpu_device *adev)
20102010 {
2011− return !!memcmp(adev->gart.ptr, adev->reset_magic,
2012− AMDGPU_RESET_MAGIC_NUM);
2011+ if (memcmp(adev->gart.ptr, adev->reset_magic,
2012+ AMDGPU_RESET_MAGIC_NUM))
2013+ return true;
2014+
2015+ if (!adev->in_gpu_reset)
2016+ return false;
2017+
2018+ /*
2019+ * For all ASICs with baco/mode1 reset, the VRAM is
2020+ * always assumed to be lost.
2021+ */
2022+ switch (amdgpu_asic_reset_method(adev)) {
2023+ case AMD_RESET_METHOD_BACO:
2024+ case AMD_RESET_METHOD_MODE1:
2025+ return true;
2026+ default:
2027+ return false;
2028+ }
20132029 }
20142030
20152031 /**
@@ -2340,6 +2356,8 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev) · 324 unmodified lines
23402356 {
23412357 int i, r;
23422358
2359+ amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
2360+ amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
23432361
23442362 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
23452363 if (!adev->ip_blocks[i].status.valid)
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/cik.c+0−2
@@ -1358,8 +1358,6 @@ static int cik_asic_reset(struct amdgpu_device *adev) · 1357 unmodified lines
13581358 int r;
13591359
13601360 if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
1361− if (!adev->in_suspend)
1362− amdgpu_inc_vram_lost(adev);
13631361 r = amdgpu_dpm_baco_reset(adev);
13641362 } else {
13651363 r = cik_asic_pci_config_reset(adev);
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+1−1
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_1_2_nv12[] = · 278 unmodified lines
279279
280280 #define DEFAULT_SH_MEM_CONFIG \
281281 ((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
282− (SH_MEM_ALIGNMENT_MODE_DWORD << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
282+ (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
283283 (SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \
284284 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))
285285
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+2−0
@@ -1234,6 +1234,8 @@ struct amdgpu_gfxoff_quirk { · 1233 unmodified lines
12341234 static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = {
12351235 /* https://bugzilla.kernel.org/show_bug.cgi?id=204689 */
12361236 { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
1237+ /* https://bugzilla.kernel.org/show_bug.cgi?id=207171 */
1238+ { 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 },
12371239 { 0, 0, 0, 0, 0 },
12381240 };
12391241
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/nv.c+0−4
@@ -351,8 +351,6 @@ static int nv_asic_reset(struct amdgpu_device *adev) · 350 unmodified lines
351351 struct smu_context *smu = &adev->smu;
352352
353353 if (nv_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
354− if (!adev->in_suspend)
355− amdgpu_inc_vram_lost(adev);
356354 ret = smu_baco_enter(smu);
357355 if (ret)
358356 return ret;
@@ -360,8 +358,6 @@ static int nv_asic_reset(struct amdgpu_device *adev) · 1 unmodified line
360358 if (ret)
361359 return ret;
362360 } else {
363− if (!adev->in_suspend)
364− amdgpu_inc_vram_lost(adev);
365361 ret = nv_asic_mode1_reset(adev);
366362 }
367363
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/amdgpu/soc15.c+0−4
@@ -569,14 +569,10 @@ static int soc15_asic_reset(struct amdgpu_device *adev) · 568 unmodified lines
569569
570570 switch (soc15_asic_reset_method(adev)) {
571571 case AMD_RESET_METHOD_BACO:
572− if (!adev->in_suspend)
573− amdgpu_inc_vram_lost(adev);
574572 return soc15_asic_baco_reset(adev);
575573 case AMD_RESET_METHOD_MODE2:
576574 return amdgpu_dpm_mode2_reset(adev);
577575 default:
578− if (!adev->in_suspend)
579− amdgpu_inc_vram_lost(adev);
580576 return soc15_asic_mode1_reset(adev);
581577 }
582578 }
drivers/gpu/drm/amd/amdgpu/vi.c+0−2
@@ -765,8 +765,6 @@ static int vi_asic_reset(struct amdgpu_device *adev) · 764 unmodified lines
765765 int r;
766766
767767 if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
768− if (!adev->in_suspend)
769− amdgpu_inc_vram_lost(adev);
770768 r = amdgpu_dpm_baco_reset(adev);
771769 } else {
772770 r = vi_asic_pci_config_reset(adev);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+41−11
@@ -3340,7 +3340,8 @@ fill_plane_dcc_attributes(struct amdgpu_device *adev, · 3339 unmodified lines
33403340 const union dc_tiling_info *tiling_info,
33413341 const uint64_t info,
33423342 struct dc_plane_dcc_param *dcc,
3343− struct dc_plane_address *address)
3343+ struct dc_plane_address *address,
3344+ bool force_disable_dcc)
33443345 {
33453346 struct dc *dc = adev->dm.dc;
33463347 struct dc_dcc_surface_param input;
@@ -3352,6 +3353,9 @@ fill_plane_dcc_attributes(struct amdgpu_device *adev, · 5 unmodified lines
33523353 memset(&input, 0, sizeof(input));
33533354 memset(&output, 0, sizeof(output));
33543355
3356+ if (force_disable_dcc)
3357+ return 0;
3358+
33553359 if (!offset)
33563360 return 0;
33573361
@@ -3401,7 +3405,8 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, · 43 unmodified lines
34013405 union dc_tiling_info *tiling_info,
34023406 struct plane_size *plane_size,
34033407 struct dc_plane_dcc_param *dcc,
3404− struct dc_plane_address *address)
3408+ struct dc_plane_address *address,
3409+ bool force_disable_dcc)
34053410 {
34063411 const struct drm_framebuffer *fb = &afb->base;
34073412 int ret;
@@ -3507,7 +3512,8 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, · 99 unmodified lines
35073512
35083513 ret = fill_plane_dcc_attributes(adev, afb, format, rotation,
35093514 plane_size, tiling_info,
3510− tiling_flags, dcc, address);
3515+ tiling_flags, dcc, address,
3516+ force_disable_dcc);
35113517 if (ret)
35123518 return ret;
35133519 }
@@ -3599,7 +3605,8 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, · 85 unmodified lines
35993605 const struct drm_plane_state *plane_state,
36003606 const uint64_t tiling_flags,
36013607 struct dc_plane_info *plane_info,
3602− struct dc_plane_address *address)
3608+ struct dc_plane_address *address,
3609+ bool force_disable_dcc)
36033610 {
36043611 const struct drm_framebuffer *fb = plane_state->fb;
36053612 const struct amdgpu_framebuffer *afb =
@@ -3681,7 +3688,8 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, · 75 unmodified lines
36813688 plane_info->rotation, tiling_flags,
36823689 &plane_info->tiling_info,
36833690 &plane_info->plane_size,
3684− &plane_info->dcc, address);
3691+ &plane_info->dcc, address,
3692+ force_disable_dcc);
36853693 if (ret)
36863694 return ret;
36873695
@@ -3704,6 +3712,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, · 16 unmodified lines
37043712 struct dc_plane_info plane_info;
37053713 uint64_t tiling_flags;
37063714 int ret;
3715+ bool force_disable_dcc = false;
37073716
37083717 ret = fill_dc_scaling_info(plane_state, &scaling_info);
37093718 if (ret)
@@ -3718,9 +3727,11 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, · 8 unmodified lines
37183727 if (ret)
37193728 return ret;
37203729
3730+ force_disable_dcc = adev->asic_type == CHIP_RAVEN && adev->in_suspend;
37213731 ret = fill_dc_plane_info_and_addr(adev, plane_state, tiling_flags,
37223732 &plane_info,
3723− &dc_plane_state->address);
3733+ &dc_plane_state->address,
3734+ force_disable_dcc);
37243735 if (ret)
37253736 return ret;
37263737
@@ -4664,6 +4675,7 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector) · 937 unmodified lines
46644675 i2c_del_adapter(&aconnector->i2c->base);
46654676 kfree(aconnector->i2c);
46664677 }
4678+ kfree(aconnector->dm_dp_aux.aux.name);
46674679
46684680 kfree(connector);
46694681 }
@@ -4723,10 +4735,19 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector) · 53 unmodified lines
47234735 static int
47244736 amdgpu_dm_connector_late_register(struct drm_connector *connector)
47254737 {
4726−#if defined(CONFIG_DEBUG_FS)
47274738 struct amdgpu_dm_connector *amdgpu_dm_connector =
47284739 to_amdgpu_dm_connector(connector);
4740+ int r;
4741+
4742+ if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
4743+ (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) {
4744+ amdgpu_dm_connector->dm_dp_aux.aux.dev = connector->kdev;
4745+ r = drm_dp_aux_register(&amdgpu_dm_connector->dm_dp_aux.aux);
4746+ if (r)
4747+ return r;
4748+ }
47294749
4750+#if defined(CONFIG_DEBUG_FS)
47304751 connector_debugfs_init(amdgpu_dm_connector);
47314752 #endif
47324753
@@ -5332,6 +5353,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · 599 unmodified lines
53325353 uint64_t tiling_flags;
53335354 uint32_t domain;
53345355 int r;
5356+ bool force_disable_dcc = false;
53355357
53365358 dm_plane_state_old = to_dm_plane_state(plane->state);
53375359 dm_plane_state_new = to_dm_plane_state(new_state);
@@ -5390,11 +5412,13 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · 52 unmodified lines
53905412 dm_plane_state_old->dc_state != dm_plane_state_new->dc_state) {
53915413 struct dc_plane_state *plane_state = dm_plane_state_new->dc_state;
53925414
5415+ force_disable_dcc = adev->asic_type == CHIP_RAVEN && adev->in_suspend;
53935416 fill_plane_buffer_attributes(
53945417 adev, afb, plane_state->format, plane_state->rotation,
53955418 tiling_flags, &plane_state->tiling_info,
53965419 &plane_state->plane_size, &plane_state->dcc,
5397− &plane_state->address);
5420+ &plane_state->address,
5421+ force_disable_dcc);
53985422 }
53995423
54005424 return 0;
@@ -6092,7 +6116,7 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, · 691 unmodified lines
60926116
60936117 if (connector_type == DRM_MODE_CONNECTOR_DisplayPort
60946118 || connector_type == DRM_MODE_CONNECTOR_eDP)
6095− amdgpu_dm_initialize_dp_connector(dm, aconnector);
6119+ amdgpu_dm_initialize_dp_connector(dm, aconnector, link->link_index);
60966120
60976121 out_free:
60986122 if (res) {
@@ -6666,7 +6690,12 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 567 unmodified lines
66666690 fill_dc_plane_info_and_addr(
66676691 dm->adev, new_plane_state, tiling_flags,
66686692 &bundle->plane_infos[planes_count],
6669− &bundle->flip_addrs[planes_count].address);
6693+ &bundle->flip_addrs[planes_count].address,
6694+ false);
6695+
6696+ DRM_DEBUG_DRIVER("plane: id=%d dcc_en=%d\n",
6697+ new_plane_state->plane->index,
6698+ bundle->plane_infos[planes_count].dcc.enable);
66706699
66716700 bundle->surface_updates[planes_count].plane_info =
66726701 &bundle->plane_infos[planes_count];
@@ -8086,7 +8115,8 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm, · 1413 unmodified lines
80868115 ret = fill_dc_plane_info_and_addr(
80878116 dm->adev, new_plane_state, tiling_flags,
80888117 plane_info,
8089− &flip_addr->address);
8118+ &flip_addr->address,
8119+ false);
80908120 if (ret)
80918121 goto cleanup;
80928122
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_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+4−0
@@ -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
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/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/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/hwmgr/smu7_hwmgr.c+4−1
@@ -3804,9 +3804,12 @@ static int smu7_trim_single_dpm_states(struct pp_hwmgr *hwmgr, · 3803 unmodified lines
38043804 {
38053805 uint32_t i;
38063806
3807+ /* force the trim if mclk_switching is disabled to prevent flicker */
3808+ bool force_trim = (low_limit == high_limit);
38073809 for (i = 0; i < dpm_table->count; i++) {
38083810 /*skip the trim if od is enabled*/
3809− if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit
3811+ if ((!hwmgr->od_enabled || force_trim)
3812+ && (dpm_table->dpm_levels[i].value < low_limit
38103813 || dpm_table->dpm_levels[i].value > high_limit))
38113814 dpm_table->dpm_levels[i].enabled = false;
38123815 else
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/amd/powerplay/smu_v11_0.c+6−0
@@ -1718,6 +1718,12 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state) · 1717 unmodified lines
17181718 if (ret)
17191719 goto out;
17201720
1721+ if (ras && ras->supported) {
1722+ ret = smu_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL);
1723+ if (ret)
1724+ goto out;
1725+ }
1726+
17211727 /* clear vbios scratch 6 and 7 for coming asic reinit */
17221728 WREG32(adev->bios_scratch_reg_offset + 6, 0);
17231729 WREG32(adev->bios_scratch_reg_offset + 7, 0);
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/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/gvt/kvmgt.c+22−24
@@ -131,6 +131,7 @@ struct kvmgt_vdev { · 130 unmodified lines
131131 struct work_struct release_work;
132132 atomic_t released;
133133 struct vfio_device *vfio_device;
134+ struct vfio_group *vfio_group;
134135 };
135136
136137 static inline struct kvmgt_vdev *kvmgt_vdev(struct intel_vgpu *vgpu)
@@ -151,6 +152,7 @@ static void gvt_unpin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn, · 14 unmodified lines
151152 unsigned long size)
152153 {
153154 struct drm_i915_private *i915 = vgpu->gvt->gt->i915;
155+ struct kvmgt_vdev *vdev = kvmgt_vdev(vgpu);
154156 int total_pages;
155157 int npage;
156158 int ret;
@@ -160,7 +162,7 @@ static void gvt_unpin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn, · 3 unmodified lines
160162 for (npage = 0; npage < total_pages; npage++) {
161163 unsigned long cur_gfn = gfn + npage;
162164
163− ret = vfio_unpin_pages(mdev_dev(kvmgt_vdev(vgpu)->mdev), &cur_gfn, 1);
165+ ret = vfio_group_unpin_pages(vdev->vfio_group, &cur_gfn, 1);
164166 drm_WARN_ON(&i915->drm, ret != 1);
165167 }
166168 }
@@ -169,6 +171,7 @@ static void gvt_unpin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn, · 2 unmodified lines
169171 static int gvt_pin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn,
170172 unsigned long size, struct page **page)
171173 {
174+ struct kvmgt_vdev *vdev = kvmgt_vdev(vgpu);
172175 unsigned long base_pfn = 0;
173176 int total_pages;
174177 int npage;
@@ -183,8 +186,8 @@ static int gvt_pin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn, · 8 unmodified lines
183186 unsigned long cur_gfn = gfn + npage;
184187 unsigned long pfn;
185188
186− ret = vfio_pin_pages(mdev_dev(kvmgt_vdev(vgpu)->mdev), &cur_gfn, 1,
187− IOMMU_READ | IOMMU_WRITE, &pfn);
189+ ret = vfio_group_pin_pages(vdev->vfio_group, &cur_gfn, 1,
190+ IOMMU_READ | IOMMU_WRITE, &pfn);
188191 if (ret != 1) {
189192 gvt_vgpu_err("vfio_pin_pages failed for gfn 0x%lx, ret %d\n",
190193 cur_gfn, ret);
@@ -792,6 +795,7 @@ static int intel_vgpu_open(struct mdev_device *mdev) · 601 unmodified lines
792795 struct kvmgt_vdev *vdev = kvmgt_vdev(vgpu);
793796 unsigned long events;
794797 int ret;
798+ struct vfio_group *vfio_group;
795799
796800 vdev->iommu_notifier.notifier_call = intel_vgpu_iommu_notifier;
797801 vdev->group_notifier.notifier_call = intel_vgpu_group_notifier;
@@ -814,6 +818,14 @@ static int intel_vgpu_open(struct mdev_device *mdev) · 16 unmodified lines
814818 goto undo_iommu;
815819 }
816820
821+ vfio_group = vfio_group_get_external_user_from_dev(mdev_dev(mdev));
822+ if (IS_ERR_OR_NULL(vfio_group)) {
823+ ret = !vfio_group ? -EFAULT : PTR_ERR(vfio_group);
824+ gvt_vgpu_err("vfio_group_get_external_user_from_dev failed\n");
825+ goto undo_register;
826+ }
827+ vdev->vfio_group = vfio_group;
828+
817829 /* Take a module reference as mdev core doesn't take
818830 * a reference for vendor driver.
819831 */
@@ -830,6 +842,10 @@ static int intel_vgpu_open(struct mdev_device *mdev) · 10 unmodified lines
830842 return ret;
831843
832844 undo_group:
845+ vfio_group_put_external_user(vdev->vfio_group);
846+ vdev->vfio_group = NULL;
847+
848+undo_register:
833849 vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
834850 &vdev->group_notifier);
835851
@@ -884,6 +900,7 @@ static void __intel_vgpu_release(struct intel_vgpu *vgpu) · 48 unmodified lines
884900 kvmgt_guest_exit(info);
885901
886902 intel_vgpu_release_msi_eventfd_ctx(vgpu);
903+ vfio_group_put_external_user(vdev->vfio_group);
887904
888905 vdev->kvm = NULL;
889906 vgpu->handle = 0;
@@ -2035,33 +2052,14 @@ static int kvmgt_rw_gpa(unsigned long handle, unsigned long gpa, · 1145 unmodified lines
20352052 void *buf, unsigned long len, bool write)
20362053 {
20372054 struct kvmgt_guest_info *info;
2038− struct kvm *kvm;
2039− int idx, ret;
2040− bool kthread = current->mm == NULL;
20412055
20422056 if (!handle_valid(handle))
20432057 return -ESRCH;
20442058
20452059 info = (struct kvmgt_guest_info *)handle;
2046− kvm = info->kvm;
2047−
2048− if (kthread) {
2049− if (!mmget_not_zero(kvm->mm))
2050− return -EFAULT;
2051− use_mm(kvm->mm);
2052− }
2053−
2054− idx = srcu_read_lock(&kvm->srcu);
2055− ret = write ? kvm_write_guest(kvm, gpa, buf, len) :
2056− kvm_read_guest(kvm, gpa, buf, len);
2057− srcu_read_unlock(&kvm->srcu, idx);
2058−
2059− if (kthread) {
2060− unuse_mm(kvm->mm);
2061− mmput(kvm->mm);
2062− }
20632060
2064− return ret;
2061+ return vfio_dma_rw(kvmgt_vdev(info->vgpu)->vfio_group,
2062+ gpa, buf, len, write);
20652063 }
20662064
20672065 static int kvmgt_read_gpa(unsigned long handle, unsigned long gpa,
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_perf.c+11−54
@@ -2940,49 +2940,6 @@ void i915_oa_init_reg_state(const struct intel_context *ce, · 2939 unmodified lines
29402940 gen8_update_reg_state_unlocked(ce, stream);
29412941 }
29422942
2943−/**
2944− * i915_perf_read_locked - &i915_perf_stream_ops->read with error normalisation
2945− * @stream: An i915 perf stream
2946− * @file: An i915 perf stream file
2947− * @buf: destination buffer given by userspace
2948− * @count: the number of bytes userspace wants to read
2949− * @ppos: (inout) file seek position (unused)
2950− *
2951− * Besides wrapping &i915_perf_stream_ops->read this provides a common place to
2952− * ensure that if we've successfully copied any data then reporting that takes
2953− * precedence over any internal error status, so the data isn't lost.
2954− *
2955− * For example ret will be -ENOSPC whenever there is more buffered data than
2956− * can be copied to userspace, but that's only interesting if we weren't able
2957− * to copy some data because it implies the userspace buffer is too small to
2958− * receive a single record (and we never split records).
2959− *
2960− * Another case with ret == -EFAULT is more of a grey area since it would seem
2961− * like bad form for userspace to ask us to overrun its buffer, but the user
2962− * knows best:
2963− *
2964− * http://yarchive.net/comp/linux/partial_reads_writes.html
2965− *
2966− * Returns: The number of bytes copied or a negative error code on failure.
2967− */
2968−static ssize_t i915_perf_read_locked(struct i915_perf_stream *stream,
2969− struct file *file,
2970− char __user *buf,
2971− size_t count,
2972− loff_t *ppos)
2973−{
2974− /* Note we keep the offset (aka bytes read) separate from any
2975− * error status so that the final check for whether we return
2976− * the bytes read with a higher precedence than any error (see
2977− * comment below) doesn't need to be handled/duplicated in
2978− * stream->ops->read() implementations.
2979− */
2980− size_t offset = 0;
2981− int ret = stream->ops->read(stream, buf, count, &offset);
2982−
2983− return offset ?: (ret ?: -EAGAIN);
2984−}
2985−
29862943 /**
29872944 * i915_perf_read - handles read() FOP for i915 perf stream FDs
29882945 * @file: An i915 perf stream file
@@ -3008,7 +2965,8 @@ static ssize_t i915_perf_read(struct file *file, · 19 unmodified lines
30082965 {
30092966 struct i915_perf_stream *stream = file->private_data;
30102967 struct i915_perf *perf = stream->perf;
3011− ssize_t ret;
2968+ size_t offset = 0;
2969+ int ret;
30122970
30132971 /* To ensure it's handled consistently we simply treat all reads of a
30142972 * disabled stream as an error. In particular it might otherwise lead
@@ -3031,13 +2989,12 @@ static ssize_t i915_perf_read(struct file *file, · 16 unmodified lines
30312989 return ret;
30322990
30332991 mutex_lock(&perf->lock);
3034− ret = i915_perf_read_locked(stream, file,
3035− buf, count, ppos);
2992+ ret = stream->ops->read(stream, buf, count, &offset);
30362993 mutex_unlock(&perf->lock);
3037− } while (ret == -EAGAIN);
2994+ } while (!offset && !ret);
30382995 } else {
30392996 mutex_lock(&perf->lock);
3040− ret = i915_perf_read_locked(stream, file, buf, count, ppos);
2997+ ret = stream->ops->read(stream, buf, count, &offset);
30412998 mutex_unlock(&perf->lock);
30422999 }
30433000
@@ -3048,15 +3005,15 @@ static ssize_t i915_perf_read(struct file *file, · 4 unmodified lines
30483005 * and read() returning -EAGAIN. Clearing the oa.pollin state here
30493006 * effectively ensures we back off until the next hrtimer callback
30503007 * before reporting another EPOLLIN event.
3008+ * The exception to this is if ops->read() returned -ENOSPC which means
3009+ * that more OA data is available than could fit in the user provided
3010+ * buffer. In this case we want the next poll() call to not block.
30513011 */
3052− if (ret >= 0 || ret == -EAGAIN) {
3053− /* Maybe make ->pollin per-stream state if we support multiple
3054− * concurrent streams in the future.
3055− */
3012+ if (ret != -ENOSPC)
30563013 stream->pollin = false;
3057− }
30583014
3059− return ret;
3015+ /* Possible values for ret are 0, -EFAULT, -ENOSPC, -EIO, ... */
3016+ return offset ?: (ret ?: -EAGAIN);
30603017 }
30613018
30623019 static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer)
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/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/nouveau/nvkm/engine/sec2/gp108.c+3−0
@@ -25,6 +25,9 @@ · 24 unmodified lines
2525 MODULE_FIRMWARE("nvidia/gp108/sec2/desc.bin");
2626 MODULE_FIRMWARE("nvidia/gp108/sec2/image.bin");
2727 MODULE_FIRMWARE("nvidia/gp108/sec2/sig.bin");
28+MODULE_FIRMWARE("nvidia/gv100/sec2/desc.bin");
29+MODULE_FIRMWARE("nvidia/gv100/sec2/image.bin");
30+MODULE_FIRMWARE("nvidia/gv100/sec2/sig.bin");
2831
2932 static const struct nvkm_sec2_fwif
3033 gp108_sec2_fwif[] = {
drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c+16−0
@@ -56,6 +56,22 @@ tu102_sec2_nofw(struct nvkm_sec2 *sec2, int ver, · 55 unmodified lines
5656 return 0;
5757 }
5858
59+MODULE_FIRMWARE("nvidia/tu102/sec2/desc.bin");
60+MODULE_FIRMWARE("nvidia/tu102/sec2/image.bin");
61+MODULE_FIRMWARE("nvidia/tu102/sec2/sig.bin");
62+MODULE_FIRMWARE("nvidia/tu104/sec2/desc.bin");
63+MODULE_FIRMWARE("nvidia/tu104/sec2/image.bin");
64+MODULE_FIRMWARE("nvidia/tu104/sec2/sig.bin");
65+MODULE_FIRMWARE("nvidia/tu106/sec2/desc.bin");
66+MODULE_FIRMWARE("nvidia/tu106/sec2/image.bin");
67+MODULE_FIRMWARE("nvidia/tu106/sec2/sig.bin");
68+MODULE_FIRMWARE("nvidia/tu116/sec2/desc.bin");
69+MODULE_FIRMWARE("nvidia/tu116/sec2/image.bin");
70+MODULE_FIRMWARE("nvidia/tu116/sec2/sig.bin");
71+MODULE_FIRMWARE("nvidia/tu117/sec2/desc.bin");
72+MODULE_FIRMWARE("nvidia/tu117/sec2/image.bin");
73+MODULE_FIRMWARE("nvidia/tu117/sec2/sig.bin");
74+
5975 static const struct nvkm_sec2_fwif
6076 tu102_sec2_fwif[] = {
6177 { 0, gp102_sec2_load, &tu102_sec2, &gp102_sec2_acr_1 },
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/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_ioctl.c+1−0
@@ -27,6 +27,7 @@ · 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>
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/hv/channel_mgmt.c+3−0
@@ -839,6 +839,9 @@ void vmbus_initiate_unload(bool crash) · 838 unmodified lines
839839 {
840840 struct vmbus_channel_message_header hdr;
841841
842+ if (xchg(&vmbus_connection.conn_state, DISCONNECTED) == DISCONNECTED)
843+ return;
844+
842845 /* Pre-Win2012R2 hosts don't support reconnect */
843846 if (vmbus_proto_version < VERSION_WIN8_1)
844847 return;
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_debugfs.c+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 #include "hyperv_vmbus.h"
1313
14−struct dentry *hv_debug_root;
14+static struct dentry *hv_debug_root;
1515
1616 static int hv_debugfs_delay_get(void *data, u64 *val)
1717 {
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/hyperv_vmbus.h+1−1
@@ -292,7 +292,7 @@ struct vmbus_msginfo { · 291 unmodified lines
292292 struct list_head msglist_entry;
293293
294294 /* The message itself */
295− unsigned char msg[0];
295+ unsigned char msg[];
296296 };
297297
298298
drivers/hv/vmbus_drv.c+78−27
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include <linux/kdebug.h>
3232 #include <linux/efi.h>
3333 #include <linux/random.h>
34+#include <linux/kernel.h>
3435 #include <linux/syscore_ops.h>
3536 #include <clocksource/hyperv_timer.h>
3637 #include "hyperv_vmbus.h"
@@ -48,14 +49,35 @@ static int hyperv_cpuhp_online; · 11 unmodified lines
4849
4950 static void *hv_panic_page;
5051
52+/*
53+ * Boolean to control whether to report panic messages over Hyper-V.
54+ *
55+ * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
56+ */
57+static int sysctl_record_panic_msg = 1;
58+
59+static int hyperv_report_reg(void)
60+{
61+ return !sysctl_record_panic_msg || !hv_panic_page;
62+}
63+
5164 static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
5265 void *args)
5366 {
5467 struct pt_regs *regs;
5568
56− regs = current_pt_regs();
69+ vmbus_initiate_unload(true);
5770
58− hyperv_report_panic(regs, val);
71+ /*
72+ * Hyper-V should be notified only once about a panic. If we will be
73+ * doing hyperv_report_panic_msg() later with kmsg data, don't do
74+ * the notification here.
75+ */
76+ if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
77+ && hyperv_report_reg()) {
78+ regs = current_pt_regs();
79+ hyperv_report_panic(regs, val, false);
80+ }
5981 return NOTIFY_DONE;
6082 }
6183
@@ -65,7 +87,13 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val, · 3 unmodified lines
6587 struct die_args *die = (struct die_args *)args;
6688 struct pt_regs *regs = die->regs;
6789
68− hyperv_report_panic(regs, val);
90+ /*
91+ * Hyper-V should be notified only once about a panic. If we will be
92+ * doing hyperv_report_panic_msg() later with kmsg data, don't do
93+ * the notification here.
94+ */
95+ if (hyperv_report_reg())
96+ hyperv_report_panic(regs, val, true);
6997 return NOTIFY_DONE;
7098 }
7199
@@ -950,6 +978,9 @@ static int vmbus_resume(struct device *child_device) · 878 unmodified lines
950978
951979 return drv->resume(dev);
952980 }
981+#else
982+#define vmbus_suspend NULL
983+#define vmbus_resume NULL
953984 #endif /* CONFIG_PM_SLEEP */
954985
955986 /*
@@ -969,11 +1000,22 @@ static void vmbus_device_release(struct device *device) · 13 unmodified lines
9691000 }
9701001
9711002 /*
972− * Note: we must use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS rather than
973− * 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.
9741010 */
1011+
9751012 static const struct dev_pm_ops vmbus_pm = {
976− 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,
9771019 };
9781020
9791021 /* The one and only one */
@@ -1252,13 +1294,6 @@ static void vmbus_isr(void) · 272 unmodified lines
12521294 add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
12531295 }
12541296
1255−/*
1256− * Boolean to control whether to report panic messages over Hyper-V.
1257− *
1258− * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
1259− */
1260−static int sysctl_record_panic_msg = 1;
1261−
12621297 /*
12631298 * Callback from kmsg_dump. Grab as much as possible from the end of the kmsg
12641299 * buffer and call into Hyper-V to transfer the data.
@@ -1382,19 +1417,29 @@ static int vmbus_bus_init(void) · 117 unmodified lines
13821417 hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
13831418 if (hv_panic_page) {
13841419 ret = kmsg_dump_register(&hv_kmsg_dumper);
1385− if (ret)
1420+ if (ret) {
13861421 pr_err("Hyper-V: kmsg dump register "
13871422 "error 0x%x\n", ret);
1423+ hv_free_hyperv_page(
1424+ (unsigned long)hv_panic_page);
1425+ hv_panic_page = NULL;
1426+ }
13881427 } else
13891428 pr_err("Hyper-V: panic message page memory "
13901429 "allocation failed");
13911430 }
13921431
13931432 register_die_notifier(&hyperv_die_block);
1394− atomic_notifier_chain_register(&panic_notifier_list,
1395− &hyperv_panic_block);
13961433 }
13971434
1435+ /*
1436+ * Always register the panic notifier because we need to unload
1437+ * the VMbus channel connection to prevent any VMbus
1438+ * activity after the VM panics.
1439+ */
1440+ atomic_notifier_chain_register(&panic_notifier_list,
1441+ &hyperv_panic_block);
1442+
13981443 vmbus_request_offers();
13991444
14001445 return 0;
@@ -1407,7 +1452,6 @@ err_alloc: · 6 unmodified lines
14071452 hv_remove_vmbus_irq();
14081453
14091454 bus_unregister(&hv_bus);
1410− hv_free_hyperv_page((unsigned long)hv_panic_page);
14111455 unregister_sysctl_table(hv_ctl_table_hdr);
14121456 hv_ctl_table_hdr = NULL;
14131457 return ret;
@@ -2204,8 +2248,6 @@ static int vmbus_bus_suspend(struct device *dev) · 790 unmodified lines
22042248
22052249 vmbus_initiate_unload(false);
22062250
2207− vmbus_connection.conn_state = DISCONNECTED;
2208−
22092251 /* Reset the event for the next resume. */
22102252 reinit_completion(&vmbus_connection.ready_for_resume_event);
22112253
@@ -2253,6 +2295,9 @@ static int vmbus_bus_resume(struct device *dev) · 41 unmodified lines
22532295
22542296 return 0;
22552297 }
2298+#else
2299+#define vmbus_bus_suspend NULL
2300+#define vmbus_bus_resume NULL
22562301 #endif /* CONFIG_PM_SLEEP */
22572302
22582303 static const struct acpi_device_id vmbus_acpi_device_ids[] = {
@@ -2263,16 +2308,24 @@ static const struct acpi_device_id vmbus_acpi_device_ids[] = { · 4 unmodified lines
22632308 MODULE_DEVICE_TABLE(acpi, vmbus_acpi_device_ids);
22642309
22652310 /*
2266− * Note: we must use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS rather than
2267− * SET_SYSTEM_SLEEP_PM_OPS, otherwise NIC SR-IOV can not work, because the
2268− * "pci_dev_pm_ops" uses the "noirq" callbacks: in the resume path, the
2269− * 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
22702314 * resume_target_kernel() -> dpm_resume_start(), and hibernation_restore() ->
22712315 * dpm_resume_end()). This means vmbus_bus_resume() and the pci-hyperv's
2272− * 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.
22732320 */
2321+
22742322 static const struct dev_pm_ops vmbus_bus_pm = {
2275− 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
22762329 };
22772330
22782331 static struct acpi_driver vmbus_acpi_driver = {
@@ -2289,7 +2342,6 @@ static void hv_kexec_handler(void) · 10 unmodified lines
22892342 {
22902343 hv_stimer_global_cleanup();
22912344 vmbus_initiate_unload(false);
2292− vmbus_connection.conn_state = DISCONNECTED;
22932345 /* Make sure conn_state is set as hv_synic_cleanup checks for it */
22942346 mb();
22952347 cpuhp_remove_state(hyperv_cpuhp_online);
@@ -2306,7 +2358,6 @@ static void hv_crash_handler(struct pt_regs *regs) · 10 unmodified lines
23062358 * doing the cleanup for current CPU only. This should be sufficient
23072359 * for kdump.
23082360 */
2309− vmbus_connection.conn_state = DISCONNECTED;
23102361 cpu = smp_processor_id();
23112362 hv_stimer_cleanup(cpu);
23122363 hv_synic_disable_regs(cpu);
drivers/hwmon/Kconfig+1−1
@@ -412,7 +412,7 @@ config SENSORS_DRIVETEMP · 411 unmodified lines
412412 hard disk drives.
413413
414414 This driver can also be built as a module. If so, the module
415− will be called satatemp.
415+ will be called drivetemp.
416416
417417 config SENSORS_DS620
418418 tristate "Dallas Semiconductor DS620"
drivers/hwmon/drivetemp.c+6−0
@@ -264,12 +264,18 @@ static int drivetemp_get_scttemp(struct drivetemp_data *st, u32 attr, long *val) · 263 unmodified lines
264264 return err;
265265 switch (attr) {
266266 case hwmon_temp_input:
267+ if (!temp_is_valid(buf[SCT_STATUS_TEMP]))
268+ return -ENODATA;
267269 *val = temp_from_sct(buf[SCT_STATUS_TEMP]);
268270 break;
269271 case hwmon_temp_lowest:
272+ if (!temp_is_valid(buf[SCT_STATUS_TEMP_LOWEST]))
273+ return -ENODATA;
270274 *val = temp_from_sct(buf[SCT_STATUS_TEMP_LOWEST]);
271275 break;
272276 case hwmon_temp_highest:
277+ if (!temp_is_valid(buf[SCT_STATUS_TEMP_HIGHEST]))
278+ return -ENODATA;
273279 *val = temp_from_sct(buf[SCT_STATUS_TEMP_HIGHEST]);
274280 break;
275281 default:
drivers/hwmon/jc42.c+1−1
@@ -506,7 +506,7 @@ static int jc42_probe(struct i2c_client *client, const struct i2c_device_id *id) · 505 unmodified lines
506506 }
507507 data->config = config;
508508
509− hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
509+ hwmon_dev = devm_hwmon_device_register_with_info(dev, "jc42",
510510 data, &jc42_chip_info,
511511 NULL);
512512 return PTR_ERR_OR_ZERO(hwmon_dev);
drivers/hwmon/k10temp.c+3−3
@@ -186,7 +186,7 @@ static long get_raw_temp(struct k10temp_data *data) · 185 unmodified lines
186186 return temp;
187187 }
188188
189−const char *k10temp_temp_label[] = {
189+static const char *k10temp_temp_label[] = {
190190 "Tctl",
191191 "Tdie",
192192 "Tccd1",
@@ -199,12 +199,12 @@ const char *k10temp_temp_label[] = { · 6 unmodified lines
199199 "Tccd8",
200200 };
201201
202−const char *k10temp_in_label[] = {
202+static const char *k10temp_in_label[] = {
203203 "Vcore",
204204 "Vsoc",
205205 };
206206
207−const char *k10temp_curr_label[] = {
207+static const char *k10temp_curr_label[] = {
208208 "Icore",
209209 "Isoc",
210210 };
drivers/hwmon/pmbus/isl68137.c+85−7
@@ -21,8 +21,50 @@ · 20 unmodified lines
2121 #define ISL68137_VOUT_AVS 0x30
2222 #define RAA_DMPVR2_READ_VMON 0xc8
2323
24−enum versions {
24+enum chips {
2525 isl68137,
26+ isl68220,
27+ isl68221,
28+ isl68222,
29+ isl68223,
30+ isl68224,
31+ isl68225,
32+ isl68226,
33+ isl68227,
34+ isl68229,
35+ isl68233,
36+ isl68239,
37+ isl69222,
38+ isl69223,
39+ isl69224,
40+ isl69225,
41+ isl69227,
42+ isl69228,
43+ isl69234,
44+ isl69236,
45+ isl69239,
46+ isl69242,
47+ isl69243,
48+ isl69247,
49+ isl69248,
50+ isl69254,
51+ isl69255,
52+ isl69256,
53+ isl69259,
54+ isl69260,
55+ isl69268,
56+ isl69269,
57+ isl69298,
58+ raa228000,
59+ raa228004,
60+ raa228006,
61+ raa228228,
62+ raa229001,
63+ raa229004,
64+};
65+
66+enum variants {
67+ raa_dmpvr1_2rail,
2668 raa_dmpvr2_1rail,
2769 raa_dmpvr2_2rail,
2870 raa_dmpvr2_3rail,
@@ -186,7 +228,7 @@ static int isl68137_probe(struct i2c_client *client, · 157 unmodified lines
186228 memcpy(info, &raa_dmpvr_info, sizeof(*info));
187229
188230 switch (id->driver_data) {
189− case isl68137:
231+ case raa_dmpvr1_2rail:
190232 info->pages = 2;
191233 info->R[PSC_VOLTAGE_IN] = 3;
192234 info->func[0] &= ~PMBUS_HAVE_VMON;
@@ -224,11 +266,47 @@ static int isl68137_probe(struct i2c_client *client, · 31 unmodified lines
224266 }
225267
226268 static const struct i2c_device_id raa_dmpvr_id[] = {
227− {"isl68137", isl68137},
228− {"raa_dmpvr2_1rail", raa_dmpvr2_1rail},
229− {"raa_dmpvr2_2rail", raa_dmpvr2_2rail},
230− {"raa_dmpvr2_3rail", raa_dmpvr2_3rail},
231− {"raa_dmpvr2_hv", raa_dmpvr2_hv},
269+ {"isl68137", raa_dmpvr1_2rail},
270+ {"isl68220", raa_dmpvr2_2rail},
271+ {"isl68221", raa_dmpvr2_3rail},
272+ {"isl68222", raa_dmpvr2_2rail},
273+ {"isl68223", raa_dmpvr2_2rail},
274+ {"isl68224", raa_dmpvr2_3rail},
275+ {"isl68225", raa_dmpvr2_2rail},
276+ {"isl68226", raa_dmpvr2_3rail},
277+ {"isl68227", raa_dmpvr2_1rail},
278+ {"isl68229", raa_dmpvr2_3rail},
279+ {"isl68233", raa_dmpvr2_2rail},
280+ {"isl68239", raa_dmpvr2_3rail},
281+
282+ {"isl69222", raa_dmpvr2_2rail},
283+ {"isl69223", raa_dmpvr2_3rail},
284+ {"isl69224", raa_dmpvr2_2rail},
285+ {"isl69225", raa_dmpvr2_2rail},
286+ {"isl69227", raa_dmpvr2_3rail},
287+ {"isl69228", raa_dmpvr2_3rail},
288+ {"isl69234", raa_dmpvr2_2rail},
289+ {"isl69236", raa_dmpvr2_2rail},
290+ {"isl69239", raa_dmpvr2_3rail},
291+ {"isl69242", raa_dmpvr2_2rail},
292+ {"isl69243", raa_dmpvr2_1rail},
293+ {"isl69247", raa_dmpvr2_2rail},
294+ {"isl69248", raa_dmpvr2_2rail},
295+ {"isl69254", raa_dmpvr2_2rail},
296+ {"isl69255", raa_dmpvr2_2rail},
297+ {"isl69256", raa_dmpvr2_2rail},
298+ {"isl69259", raa_dmpvr2_2rail},
299+ {"isl69260", raa_dmpvr2_2rail},
300+ {"isl69268", raa_dmpvr2_2rail},
301+ {"isl69269", raa_dmpvr2_3rail},
302+ {"isl69298", raa_dmpvr2_2rail},
303+
304+ {"raa228000", raa_dmpvr2_hv},
305+ {"raa228004", raa_dmpvr2_hv},
306+ {"raa228006", raa_dmpvr2_hv},
307+ {"raa228228", raa_dmpvr2_2rail},
308+ {"raa229001", raa_dmpvr2_2rail},
309+ {"raa229004", raa_dmpvr2_2rail},
232310 {}
233311 };
234312
drivers/i2c/algos/i2c-algo-pca.c+1−1
@@ -542,7 +542,7 @@ int i2c_pca_add_numbered_bus(struct i2c_adapter *adap) · 541 unmodified lines
542542 EXPORT_SYMBOL(i2c_pca_add_numbered_bus);
543543
544544 MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>, "
545− "Wolfram Sang <w.sang@pengutronix.de>");
545+ "Wolfram Sang <kernel@pengutronix.de>");
546546 MODULE_DESCRIPTION("I2C-Bus PCA9564/PCA9665 algorithm");
547547 MODULE_LICENSE("GPL");
548548
drivers/i2c/busses/i2c-altera.c+13−6
@@ -70,6 +70,7 @@ · 69 unmodified lines
7070 * @isr_mask: cached copy of local ISR enables.
7171 * @isr_status: cached copy of local ISR status.
7272 * @lock: spinlock for IRQ synchronization.
73+ * @isr_mutex: mutex for IRQ thread.
7374 */
7475 struct altr_i2c_dev {
7576 void __iomem *base;
@@ -86,6 +87,7 @@ struct altr_i2c_dev { · 10 unmodified lines
8687 u32 isr_mask;
8788 u32 isr_status;
8889 spinlock_t lock; /* IRQ synchronization */
90+ struct mutex isr_mutex;
8991 };
9092
9193 static void
@@ -245,10 +247,11 @@ static irqreturn_t altr_i2c_isr(int irq, void *_dev) · 153 unmodified lines
245247 struct altr_i2c_dev *idev = _dev;
246248 u32 status = idev->isr_status;
247249
250+ mutex_lock(&idev->isr_mutex);
248251 if (!idev->msg) {
249252 dev_warn(idev->dev, "unexpected interrupt\n");
250253 altr_i2c_int_clear(idev, ALTR_I2C_ALL_IRQ);
251− return IRQ_HANDLED;
254+ goto out;
252255 }
253256 read = (idev->msg->flags & I2C_M_RD) != 0;
254257
@@ -301,6 +304,8 @@ static irqreturn_t altr_i2c_isr(int irq, void *_dev) · 46 unmodified lines
301304 complete(&idev->msg_complete);
302305 dev_dbg(idev->dev, "Message Complete\n");
303306 }
307+out:
308+ mutex_unlock(&idev->isr_mutex);
304309
305310 return IRQ_HANDLED;
306311 }
@@ -312,6 +317,7 @@ static int altr_i2c_xfer_msg(struct altr_i2c_dev *idev, struct i2c_msg *msg) · 5 unmodified lines
312317 u32 value;
313318 u8 addr = i2c_8bit_addr_from_msg(msg);
314319
320+ mutex_lock(&idev->isr_mutex);
315321 idev->msg = msg;
316322 idev->msg_len = msg->len;
317323 idev->buf = msg->buf;
@@ -336,6 +342,7 @@ static int altr_i2c_xfer_msg(struct altr_i2c_dev *idev, struct i2c_msg *msg) · 18 unmodified lines
336342 altr_i2c_int_enable(idev, imask, true);
337343 altr_i2c_fill_tx_fifo(idev);
338344 }
345+ mutex_unlock(&idev->isr_mutex);
339346
340347 time_left = wait_for_completion_timeout(&idev->msg_complete,
341348 ALTR_I2C_XFER_TIMEOUT);
@@ -383,7 +390,6 @@ static int altr_i2c_probe(struct platform_device *pdev) · 41 unmodified lines
383390 {
384391 struct altr_i2c_dev *idev = NULL;
385392 int irq, ret;
386− u32 val;
387393
388394 idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL);
389395 if (!idev)
@@ -406,18 +412,19 @@ static int altr_i2c_probe(struct platform_device *pdev) · 16 unmodified lines
406412 idev->dev = &pdev->dev;
407413 init_completion(&idev->msg_complete);
408414 spin_lock_init(&idev->lock);
415+ mutex_init(&idev->isr_mutex);
409416
410− val = device_property_read_u32(idev->dev, "fifo-size",
417+ ret = device_property_read_u32(idev->dev, "fifo-size",
411418 &idev->fifo_size);
412− if (val) {
419+ if (ret) {
413420 dev_err(&pdev->dev, "FIFO size set to default of %d\n",
414421 ALTR_I2C_DFLT_FIFO_SZ);
415422 idev->fifo_size = ALTR_I2C_DFLT_FIFO_SZ;
416423 }
417424
418− val = device_property_read_u32(idev->dev, "clock-frequency",
425+ ret = device_property_read_u32(idev->dev, "clock-frequency",
419426 &idev->bus_clk_rate);
420− if (val) {
427+ if (ret) {
421428 dev_err(&pdev->dev, "Default to 100kHz\n");
422429 idev->bus_clk_rate = I2C_MAX_STANDARD_MODE_FREQ; /* default clock rate */
423430 }
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-at91-master.c+17−3
@@ -845,6 +845,18 @@ static int at91_init_twi_recovery_gpio(struct platform_device *pdev, · 844 unmodified lines
845845 PINCTRL_STATE_DEFAULT);
846846 dev->pinctrl_pins_gpio = pinctrl_lookup_state(dev->pinctrl,
847847 "gpio");
848+ if (IS_ERR(dev->pinctrl_pins_default) ||
849+ IS_ERR(dev->pinctrl_pins_gpio)) {
850+ dev_info(&pdev->dev, "pinctrl states incomplete for recovery\n");
851+ return -EINVAL;
852+ }
853+
854+ /*
855+ * pins will be taken as GPIO, so we might as well inform pinctrl about
856+ * this and move the state to GPIO
857+ */
858+ pinctrl_select_state(dev->pinctrl, dev->pinctrl_pins_gpio);
859+
848860 rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
849861 if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER)
850862 return -EPROBE_DEFER;
@@ -855,9 +867,7 @@ static int at91_init_twi_recovery_gpio(struct platform_device *pdev, · 4 unmodified lines
855867 return -EPROBE_DEFER;
856868
857869 if (IS_ERR(rinfo->sda_gpiod) ||
858− IS_ERR(rinfo->scl_gpiod) ||
859− IS_ERR(dev->pinctrl_pins_default) ||
860− IS_ERR(dev->pinctrl_pins_gpio)) {
870+ IS_ERR(rinfo->scl_gpiod)) {
861871 dev_info(&pdev->dev, "recovery information incomplete\n");
862872 if (!IS_ERR(rinfo->sda_gpiod)) {
863873 gpiod_put(rinfo->sda_gpiod);
@@ -867,9 +877,13 @@ static int at91_init_twi_recovery_gpio(struct platform_device *pdev, · 3 unmodified lines
867877 gpiod_put(rinfo->scl_gpiod);
868878 rinfo->scl_gpiod = NULL;
869879 }
880+ pinctrl_select_state(dev->pinctrl, dev->pinctrl_pins_default);
870881 return -EINVAL;
871882 }
872883
884+ /* change the state of the pins back to their default state */
885+ pinctrl_select_state(dev->pinctrl, dev->pinctrl_pins_default);
886+
873887 dev_info(&pdev->dev, "using scl, sda for recovery\n");
874888
875889 rinfo->prepare_recovery = at91_prepare_twi_recovery;
drivers/i2c/busses/i2c-bcm-iproc.c+3−0
@@ -361,6 +361,9 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, · 360 unmodified lines
361361 value = (u8)((val >> S_RX_DATA_SHIFT) & S_RX_DATA_MASK);
362362 i2c_slave_event(iproc_i2c->slave,
363363 I2C_SLAVE_WRITE_RECEIVED, &value);
364+ if (rx_status == I2C_SLAVE_RX_END)
365+ i2c_slave_event(iproc_i2c->slave,
366+ I2C_SLAVE_STOP, &value);
364367 }
365368 } else if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) {
366369 /* Master read other than start */
drivers/i2c/busses/i2c-designware-platdrv.c+10−4
@@ -314,10 +314,16 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) · 313 unmodified lines
314314 adap->dev.of_node = pdev->dev.of_node;
315315 adap->nr = -1;
316316
317− dev_pm_set_driver_flags(&pdev->dev,
318− DPM_FLAG_SMART_PREPARE |
319− DPM_FLAG_SMART_SUSPEND |
320− DPM_FLAG_LEAVE_SUSPENDED);
317+ if (dev->flags & ACCESS_NO_IRQ_SUSPEND) {
318+ dev_pm_set_driver_flags(&pdev->dev,
319+ DPM_FLAG_SMART_PREPARE |
320+ DPM_FLAG_LEAVE_SUSPENDED);
321+ } else {
322+ dev_pm_set_driver_flags(&pdev->dev,
323+ DPM_FLAG_SMART_PREPARE |
324+ DPM_FLAG_SMART_SUSPEND |
325+ DPM_FLAG_LEAVE_SUSPENDED);
326+ }
321327
322328 /* The code below assumes runtime PM to be disabled. */
323329 WARN_ON(pm_runtime_enabled(&pdev->dev));
drivers/i2c/i2c-core-base.c+17−20
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 * Mux support by Rodolfo Giometti <giometti@enneenne.com> and
88 * Michael Lawnick <michael.lawnick.ext@nsn.com>
99 *
10− * Copyright (C) 2013-2017 Wolfram Sang <wsa@the-dreams.de>
10+ * Copyright (C) 2013-2017 Wolfram Sang <wsa@kernel.org>
1111 */
1212
1313 #define pr_fmt(fmt) "i2c-core: " fmt
@@ -340,8 +340,10 @@ static int i2c_device_probe(struct device *dev) · 326 unmodified lines
340340 } else if (ACPI_COMPANION(dev)) {
341341 irq = i2c_acpi_get_irq(client);
342342 }
343− if (irq == -EPROBE_DEFER)
344− return irq;
343+ if (irq == -EPROBE_DEFER) {
344+ status = irq;
345+ goto put_sync_adapter;
346+ }
345347
346348 if (irq < 0)
347349 irq = 0;
@@ -355,15 +357,19 @@ static int i2c_device_probe(struct device *dev) · 7 unmodified lines
355357 */
356358 if (!driver->id_table &&
357359 !i2c_acpi_match_device(dev->driver->acpi_match_table, client) &&
358− !i2c_of_match_device(dev->driver->of_match_table, client))
359− return -ENODEV;
360+ !i2c_of_match_device(dev->driver->of_match_table, client)) {
361+ status = -ENODEV;
362+ goto put_sync_adapter;
363+ }
360364
361365 if (client->flags & I2C_CLIENT_WAKE) {
362366 int wakeirq;
363367
364368 wakeirq = of_irq_get_byname(dev->of_node, "wakeup");
365− if (wakeirq == -EPROBE_DEFER)
366− return wakeirq;
369+ if (wakeirq == -EPROBE_DEFER) {
370+ status = wakeirq;
371+ goto put_sync_adapter;
372+ }
367373
368374 device_init_wakeup(&client->dev, true);
369375
@@ -416,6 +422,10 @@ err_detach_pm_domain: · 46 unmodified lines
416422 err_clear_wakeup_irq:
417423 dev_pm_clear_wake_irq(&client->dev);
418424 device_init_wakeup(&client->dev, false);
425+put_sync_adapter:
426+ if (client->flags & I2C_CLIENT_HOST_NOTIFY)
427+ pm_runtime_put_sync(&client->adapter->dev);
428+
419429 return status;
420430 }
421431
@@ -2348,19 +2358,6 @@ i2c_new_scanned_device(struct i2c_adapter *adap, · 1926 unmodified lines
23482358 }
23492359 EXPORT_SYMBOL_GPL(i2c_new_scanned_device);
23502360
2351−struct i2c_client *
2352−i2c_new_probed_device(struct i2c_adapter *adap,
2353− struct i2c_board_info *info,
2354− unsigned short const *addr_list,
2355− int (*probe)(struct i2c_adapter *adap, unsigned short addr))
2356−{
2357− struct i2c_client *client;
2358−
2359− client = i2c_new_scanned_device(adap, info, addr_list, probe);
2360− return IS_ERR(client) ? NULL : client;
2361−}
2362−EXPORT_SYMBOL_GPL(i2c_new_probed_device);
2363−
23642361 struct i2c_adapter *i2c_get_adapter(int nr)
23652362 {
23662363 struct i2c_adapter *adapter;
drivers/i2c/i2c-core-of.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * Copyright (C) 2008 Jochen Friedrich <jochen@scram.de>
66 * based on a previous patch from Jon Smirl <jonsmirl@gmail.com>
77 *
8− * Copyright (C) 2013, 2018 Wolfram Sang <wsa@the-dreams.de>
8+ * Copyright (C) 2013, 2018 Wolfram Sang <wsa@kernel.org>
99 */
1010
1111 #include <dt-bindings/i2c/i2c.h>
drivers/i2c/muxes/i2c-demux-pinctrl.c+1−0
@@ -272,6 +272,7 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev) · 271 unmodified lines
272272 err_rollback_available:
273273 device_remove_file(&pdev->dev, &dev_attr_available_masters);
274274 err_rollback:
275+ i2c_demux_deactivate_master(priv);
275276 for (j = 0; j < i; j++) {
276277 of_node_put(priv->chan[j].parent_np);
277278 of_changeset_destroy(&priv->chan[j].chgset);
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/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_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/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/irqchip/irq-bcm7038-l1.c+1−1
@@ -416,7 +416,7 @@ static const struct irq_domain_ops bcm7038_l1_domain_ops = { · 415 unmodified lines
416416 .map = bcm7038_l1_map,
417417 };
418418
419−int __init bcm7038_l1_of_init(struct device_node *dn,
419+static int __init bcm7038_l1_of_init(struct device_node *dn,
420420 struct device_node *parent)
421421 {
422422 struct bcm7038_l1_chip *intc;
drivers/irqchip/irq-gic-v3-its.c+20−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/dma-iommu.h>
1515 #include <linux/efi.h>
1616 #include <linux/interrupt.h>
17+#include <linux/iopoll.h>
1718 #include <linux/irqdomain.h>
1819 #include <linux/list.h>
1920 #include <linux/log2.h>
@@ -3672,6 +3673,20 @@ out: · 3652 unmodified lines
36723673 return IRQ_SET_MASK_OK_DONE;
36733674 }
36743675
3676+static void its_wait_vpt_parse_complete(void)
3677+{
3678+ void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
3679+ u64 val;
3680+
3681+ if (!gic_rdists->has_vpend_valid_dirty)
3682+ return;
3683+
3684+ WARN_ON_ONCE(readq_relaxed_poll_timeout(vlpi_base + GICR_VPENDBASER,
3685+ val,
3686+ !(val & GICR_VPENDBASER_Dirty),
3687+ 10, 500));
3688+}
3689+
36753690 static void its_vpe_schedule(struct its_vpe *vpe)
36763691 {
36773692 void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
@@ -3702,6 +3717,8 @@ static void its_vpe_schedule(struct its_vpe *vpe) · 24 unmodified lines
37023717 val |= vpe->idai ? GICR_VPENDBASER_IDAI : 0;
37033718 val |= GICR_VPENDBASER_Valid;
37043719 gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);
3720+
3721+ its_wait_vpt_parse_complete();
37053722 }
37063723
37073724 static void its_vpe_deschedule(struct its_vpe *vpe)
@@ -3910,6 +3927,8 @@ static void its_vpe_4_1_schedule(struct its_vpe *vpe, · 202 unmodified lines
39103927 val |= FIELD_PREP(GICR_VPENDBASER_4_1_VPEID, vpe->vpe_id);
39113928
39123929 gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);
3930+
3931+ its_wait_vpt_parse_complete();
39133932 }
39143933
39153934 static void its_vpe_4_1_deschedule(struct its_vpe *vpe,
@@ -4035,6 +4054,7 @@ static int its_sgi_set_affinity(struct irq_data *d, · 119 unmodified lines
40354054 * not on the host (since they can only be targetting a vPE).
40364055 * Tell the kernel we've done whatever it asked for.
40374056 */
4057+ irq_data_update_effective_affinity(d, mask_val);
40384058 return IRQ_SET_MASK_OK;
40394059 }
40404060
drivers/irqchip/irq-gic-v3.c+7−4
@@ -873,6 +873,7 @@ static int __gic_update_rdist_properties(struct redist_region *region, · 872 unmodified lines
873873 gic_data.rdists.has_rvpeid &= !!(typer & GICR_TYPER_RVPEID);
874874 gic_data.rdists.has_direct_lpi &= (!!(typer & GICR_TYPER_DirectLPIS) |
875875 gic_data.rdists.has_rvpeid);
876+ gic_data.rdists.has_vpend_valid_dirty &= !!(typer & GICR_TYPER_DIRTY);
876877
877878 /* Detect non-sensical configurations */
878879 if (WARN_ON_ONCE(gic_data.rdists.has_rvpeid && !gic_data.rdists.has_vlpis)) {
@@ -893,10 +894,11 @@ static void gic_update_rdist_properties(void) · 14 unmodified lines
893894 if (WARN_ON(gic_data.ppi_nr == UINT_MAX))
894895 gic_data.ppi_nr = 0;
895896 pr_info("%d PPIs implemented\n", gic_data.ppi_nr);
896− pr_info("%sVLPI support, %sdirect LPI support, %sRVPEID support\n",
897− !gic_data.rdists.has_vlpis ? "no " : "",
898− !gic_data.rdists.has_direct_lpi ? "no " : "",
899− !gic_data.rdists.has_rvpeid ? "no " : "");
897+ if (gic_data.rdists.has_vlpis)
898+ pr_info("GICv4 features: %s%s%s\n",
899+ gic_data.rdists.has_direct_lpi ? "DirectLPI " : "",
900+ gic_data.rdists.has_rvpeid ? "RVPEID " : "",
901+ gic_data.rdists.has_vpend_valid_dirty ? "Valid+Dirty " : "");
900902 }
901903
902904 /* Check whether it's single security state view */
@@ -1620,6 +1622,7 @@ static int __init gic_init_bases(void __iomem *dist_base, · 717 unmodified lines
16201622 gic_data.rdists.has_rvpeid = true;
16211623 gic_data.rdists.has_vlpis = true;
16221624 gic_data.rdists.has_direct_lpi = true;
1625+ gic_data.rdists.has_vpend_valid_dirty = true;
16231626
16241627 if (WARN_ON(!gic_data.domain) || WARN_ON(!gic_data.rdists.rdist)) {
16251628 err = -ENOMEM;
drivers/irqchip/irq-mbigen.c+7−1
@@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain, · 219 unmodified lines
220220 return 0;
221221 }
222222
223+static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq,
224+ unsigned int nr_irqs)
225+{
226+ platform_msi_domain_free(domain, virq, nr_irqs);
227+}
228+
223229 static const struct irq_domain_ops mbigen_domain_ops = {
224230 .translate = mbigen_domain_translate,
225231 .alloc = mbigen_irq_domain_alloc,
226− .free = irq_domain_free_irqs_common,
232+ .free = mbigen_irq_domain_free,
227233 };
228234
229235 static int mbigen_of_create_domain(struct platform_device *pdev,
drivers/irqchip/irq-meson-gpio.c+10−8
@@ -144,12 +144,17 @@ struct meson_gpio_irq_controller { · 143 unmodified lines
144144 static void meson_gpio_irq_update_bits(struct meson_gpio_irq_controller *ctl,
145145 unsigned int reg, u32 mask, u32 val)
146146 {
147+ unsigned long flags;
147148 u32 tmp;
148149
150+ spin_lock_irqsave(&ctl->lock, flags);
151+
149152 tmp = readl_relaxed(ctl->base + reg);
150153 tmp &= ~mask;
151154 tmp |= val;
152155 writel_relaxed(tmp, ctl->base + reg);
156+
157+ spin_unlock_irqrestore(&ctl->lock, flags);
153158 }
154159
155160 static void meson_gpio_irq_init_dummy(struct meson_gpio_irq_controller *ctl)
@@ -196,14 +201,15 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_controller *ctl, · 40 unmodified lines
196201 unsigned long hwirq,
197202 u32 **channel_hwirq)
198203 {
204+ unsigned long flags;
199205 unsigned int idx;
200206
201− spin_lock(&ctl->lock);
207+ spin_lock_irqsave(&ctl->lock, flags);
202208
203209 /* Find a free channel */
204210 idx = find_first_zero_bit(ctl->channel_map, NUM_CHANNEL);
205211 if (idx >= NUM_CHANNEL) {
206− spin_unlock(&ctl->lock);
212+ spin_unlock_irqrestore(&ctl->lock, flags);
207213 pr_err("No channel available\n");
208214 return -ENOSPC;
209215 }
@@ -211,6 +217,8 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_controller *ctl, · 1 unmodified line
211217 /* Mark the channel as used */
212218 set_bit(idx, ctl->channel_map);
213219
220+ spin_unlock_irqrestore(&ctl->lock, flags);
221+
214222 /*
215223 * Setup the mux of the channel to route the signal of the pad
216224 * to the appropriate input of the GIC
@@ -225,8 +233,6 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_controller *ctl, · 8 unmodified lines
225233 */
226234 *channel_hwirq = &(ctl->channel_irqs[idx]);
227235
228− spin_unlock(&ctl->lock);
229−
230236 pr_debug("hwirq %lu assigned to channel %d - irq %u\n",
231237 hwirq, idx, **channel_hwirq);
232238
@@ -287,13 +293,9 @@ static int meson_gpio_irq_type_setup(struct meson_gpio_irq_controller *ctl, · 54 unmodified lines
287293 val |= REG_EDGE_POL_LOW(params, idx);
288294 }
289295
290− spin_lock(&ctl->lock);
291−
292296 meson_gpio_irq_update_bits(ctl, REG_EDGE_POL,
293297 REG_EDGE_POL_MASK(params, idx), val);
294298
295− spin_unlock(&ctl->lock);
296−
297299 return 0;
298300 }
299301
drivers/irqchip/irq-mvebu-icu.c+1−1
@@ -66,7 +66,7 @@ struct mvebu_icu_irq_data { · 65 unmodified lines
6666 unsigned int type;
6767 };
6868
69−DEFINE_STATIC_KEY_FALSE(legacy_bindings);
69+static DEFINE_STATIC_KEY_FALSE(legacy_bindings);
7070
7171 static void mvebu_icu_init(struct mvebu_icu *icu,
7272 struct mvebu_icu_msi_data *msi_data,
drivers/irqchip/irq-sifive-plic.c+1−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 #define CONTEXT_THRESHOLD 0x00
5757 #define CONTEXT_CLAIM 0x04
5858
59−#define PLIC_DISABLE_THRESHOLD 0xf
59+#define PLIC_DISABLE_THRESHOLD 0x7
6060 #define PLIC_ENABLE_THRESHOLD 0
6161
6262 struct plic_priv {
drivers/irqchip/irq-ti-sci-inta.c+2−1
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #define VINT_ENABLE_SET_OFFSET 0x0
3838 #define VINT_ENABLE_CLR_OFFSET 0x8
3939 #define VINT_STATUS_OFFSET 0x18
40+#define VINT_STATUS_MASKED_OFFSET 0x20
4041
4142 /**
4243 * struct ti_sci_inta_event_desc - Description of an event coming to
@@ -116,7 +117,7 @@ static void ti_sci_inta_irq_handler(struct irq_desc *desc) · 73 unmodified lines
116117 chained_irq_enter(irq_desc_get_chip(desc), desc);
117118
118119 val = readq_relaxed(inta->base + vint_desc->vint_id * 0x1000 +
119− VINT_STATUS_OFFSET);
120+ VINT_STATUS_MASKED_OFFSET);
120121
121122 for_each_set_bit(bit, &val, MAX_EVENTS_PER_VINT) {
122123 virq = irq_find_mapping(domain, vint_desc->events[bit].hwirq);
drivers/isdn/hardware/mISDN/mISDNisar.c+2−2
@@ -743,10 +743,10 @@ check_send(struct isar_hw *isar, u8 rdm) · 742 unmodified lines
743743 }
744744 }
745745
746−const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4",
746+static const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4",
747747 "300", "600", "1200", "2400", "4800", "7200",
748748 "9600nt", "9600t", "12000", "14400", "WRONG"};
749−const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21",
749+static const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21",
750750 "Bell103", "V23", "Bell202", "V17", "V29", "V27ter"};
751751
752752 static void
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/pci-me.c+2−1
@@ -203,11 +203,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 202 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/mtd/spi-nor/Makefile+2−0
@@ -18,3 +18,5 @@ spi-nor-objs += winbond.o · 17 unmodified lines
1818 spi-nor-objs += xilinx.o
1919 spi-nor-objs += xmc.o
2020 obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o
21+
22+obj-$(CONFIG_MTD_SPI_NOR) += controllers/
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/mt7530.c+12−91
@@ -66,58 +66,6 @@ static const struct mt7530_mib_desc mt7530_mib[] = { · 65 unmodified lines
6666 MIB_DESC(1, 0xb8, "RxArlDrop"),
6767 };
6868
69−static int
70−mt7623_trgmii_write(struct mt7530_priv *priv, u32 reg, u32 val)
71−{
72− int ret;
73−
74− ret = regmap_write(priv->ethernet, TRGMII_BASE(reg), val);
75− if (ret < 0)
76− dev_err(priv->dev,
77− "failed to priv write register\n");
78− return ret;
79−}
80−
81−static u32
82−mt7623_trgmii_read(struct mt7530_priv *priv, u32 reg)
83−{
84− int ret;
85− u32 val;
86−
87− ret = regmap_read(priv->ethernet, TRGMII_BASE(reg), &val);
88− if (ret < 0) {
89− dev_err(priv->dev,
90− "failed to priv read register\n");
91− return ret;
92− }
93−
94− return val;
95−}
96−
97−static void
98−mt7623_trgmii_rmw(struct mt7530_priv *priv, u32 reg,
99− u32 mask, u32 set)
100−{
101− u32 val;
102−
103− val = mt7623_trgmii_read(priv, reg);
104− val &= ~mask;
105− val |= set;
106− mt7623_trgmii_write(priv, reg, val);
107−}
108−
109−static void
110−mt7623_trgmii_set(struct mt7530_priv *priv, u32 reg, u32 val)
111−{
112− mt7623_trgmii_rmw(priv, reg, 0, val);
113−}
114−
115−static void
116−mt7623_trgmii_clear(struct mt7530_priv *priv, u32 reg, u32 val)
117−{
118− mt7623_trgmii_rmw(priv, reg, val, 0);
119−}
120−
12169 static int
12270 core_read_mmd_indirect(struct mt7530_priv *priv, int prtad, int devad)
12371 {
@@ -530,27 +478,6 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, int mode) · 406 unmodified lines
530478 for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
531479 mt7530_rmw(priv, MT7530_TRGMII_RD(i),
532480 RD_TAP_MASK, RD_TAP(16));
533− else
534− if (priv->id != ID_MT7621)
535− mt7623_trgmii_set(priv, GSW_INTF_MODE,
536− INTF_MODE_TRGMII);
537−
538− return 0;
539−}
540−
541−static int
542−mt7623_pad_clk_setup(struct dsa_switch *ds)
543−{
544− struct mt7530_priv *priv = ds->priv;
545− int i;
546−
547− for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
548− mt7623_trgmii_write(priv, GSW_TRGMII_TD_ODT(i),
549− TD_DM_DRVP(8) | TD_DM_DRVN(8));
550−
551− mt7623_trgmii_set(priv, GSW_TRGMII_RCK_CTRL, RX_RST | RXC_DQSISEL);
552− mt7623_trgmii_clear(priv, GSW_TRGMII_RCK_CTRL, RX_RST);
553−
554481 return 0;
555482 }
556483
@@ -846,8 +773,9 @@ mt7530_port_set_vlan_unaware(struct dsa_switch *ds, int port) · 289 unmodified lines
846773 */
847774 mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK,
848775 MT7530_PORT_MATRIX_MODE);
849− mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK,
850− VLAN_ATTR(MT7530_VLAN_TRANSPARENT));
776+ mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK,
777+ VLAN_ATTR(MT7530_VLAN_TRANSPARENT) |
778+ PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
851779
852780 for (i = 0; i < MT7530_NUM_PORTS; i++) {
853781 if (dsa_is_user_port(ds, i) &&
@@ -863,8 +791,8 @@ mt7530_port_set_vlan_unaware(struct dsa_switch *ds, int port) · 9 unmodified lines
863791 if (all_user_ports_removed) {
864792 mt7530_write(priv, MT7530_PCR_P(MT7530_CPU_PORT),
865793 PCR_MATRIX(dsa_user_ports(priv->ds)));
866− mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT),
867− PORT_SPEC_TAG);
794+ mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT), PORT_SPEC_TAG
795+ | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
868796 }
869797 }
870798
@@ -890,8 +818,9 @@ mt7530_port_set_vlan_aware(struct dsa_switch *ds, int port) · 19 unmodified lines
890818 /* Set the port as a user port which is to be able to recognize VID
891819 * from incoming packets before fetching entry within the VLAN table.
892820 */
893− mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK,
894− VLAN_ATTR(MT7530_VLAN_USER));
821+ mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK,
822+ VLAN_ATTR(MT7530_VLAN_USER) |
823+ PVC_EG_TAG(MT7530_VLAN_EG_DISABLED));
895824 }
896825
897826 static void
@@ -1303,10 +1232,6 @@ mt7530_setup(struct dsa_switch *ds) · 405 unmodified lines
13031232 dn = dsa_to_port(ds, MT7530_CPU_PORT)->master->dev.of_node->parent;
13041233
13051234 if (priv->id == ID_MT7530) {
1306− priv->ethernet = syscon_node_to_regmap(dn);
1307− if (IS_ERR(priv->ethernet))
1308− return PTR_ERR(priv->ethernet);
1309−
13101235 regulator_set_voltage(priv->core_pwr, 1000000, 1000000);
13111236 ret = regulator_enable(priv->core_pwr);
13121237 if (ret < 0) {
@@ -1380,6 +1305,10 @@ mt7530_setup(struct dsa_switch *ds) · 67 unmodified lines
13801305 mt7530_cpu_port_enable(priv, i);
13811306 else
13821307 mt7530_port_disable(ds, i);
1308+
1309+ /* Enable consistent egress tag */
1310+ mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
1311+ PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
13831312 }
13841313
13851314 /* Setup port 5 */
@@ -1468,14 +1397,6 @@ static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port, · 82 unmodified lines
14681397 /* Setup TX circuit incluing relevant PAD and driving */
14691398 mt7530_pad_clk_setup(ds, state->interface);
14701399
1471− if (priv->id == ID_MT7530) {
1472− /* Setup RX circuit, relevant PAD and driving on the
1473− * host which must be placed after the setup on the
1474− * device side is all finished.
1475− */
1476− mt7623_pad_clk_setup(ds);
1477− }
1478−
14791400 priv->p6_interface = state->interface;
14801401 break;
14811402 default:
drivers/net/dsa/mt7530.h+7−10
@@ -172,9 +172,16 @@ enum mt7530_port_mode { · 171 unmodified lines
172172 /* Register for port vlan control */
173173 #define MT7530_PVC_P(x) (0x2010 + ((x) * 0x100))
174174 #define PORT_SPEC_TAG BIT(5)
175+#define PVC_EG_TAG(x) (((x) & 0x7) << 8)
176+#define PVC_EG_TAG_MASK PVC_EG_TAG(7)
175177 #define VLAN_ATTR(x) (((x) & 0x3) << 6)
176178 #define VLAN_ATTR_MASK VLAN_ATTR(3)
177179
180+enum mt7530_vlan_port_eg_tag {
181+ MT7530_VLAN_EG_DISABLED = 0,
182+ MT7530_VLAN_EG_CONSISTENT = 1,
183+};
184+
178185 enum mt7530_vlan_port_attr {
179186 MT7530_VLAN_USER = 0,
180187 MT7530_VLAN_TRANSPARENT = 3,
@@ -277,7 +284,6 @@ enum mt7530_vlan_port_attr { · 96 unmodified lines
277284
278285 /* Registers for TRGMII on the both side */
279286 #define MT7530_TRGMII_RCK_CTRL 0x7a00
280−#define GSW_TRGMII_RCK_CTRL 0x300
281287 #define RX_RST BIT(31)
282288 #define RXC_DQSISEL BIT(30)
283289 #define DQSI1_TAP_MASK (0x7f << 8)
@@ -286,31 +292,24 @@ enum mt7530_vlan_port_attr { · 2 unmodified lines
286292 #define DQSI0_TAP(x) ((x) & 0x7f)
287293
288294 #define MT7530_TRGMII_RCK_RTT 0x7a04
289−#define GSW_TRGMII_RCK_RTT 0x304
290295 #define DQS1_GATE BIT(31)
291296 #define DQS0_GATE BIT(30)
292297
293298 #define MT7530_TRGMII_RD(x) (0x7a10 + (x) * 8)
294−#define GSW_TRGMII_RD(x) (0x310 + (x) * 8)
295299 #define BSLIP_EN BIT(31)
296300 #define EDGE_CHK BIT(30)
297301 #define RD_TAP_MASK 0x7f
298302 #define RD_TAP(x) ((x) & 0x7f)
299303
300−#define GSW_TRGMII_TXCTRL 0x340
301304 #define MT7530_TRGMII_TXCTRL 0x7a40
302305 #define TRAIN_TXEN BIT(31)
303306 #define TXC_INV BIT(30)
304307 #define TX_RST BIT(28)
305308
306309 #define MT7530_TRGMII_TD_ODT(i) (0x7a54 + 8 * (i))
307−#define GSW_TRGMII_TD_ODT(i) (0x354 + 8 * (i))
308310 #define TD_DM_DRVP(x) ((x) & 0xf)
309311 #define TD_DM_DRVN(x) (((x) & 0xf) << 4)
310312
311−#define GSW_INTF_MODE 0x390
312−#define INTF_MODE_TRGMII BIT(1)
313−
314313 #define MT7530_TRGMII_TCK_CTRL 0x7a78
315314 #define TCK_TAP(x) (((x) & 0xf) << 8)
316315
@@ -443,7 +442,6 @@ static const char *p5_intf_modes(unsigned int p5_interface) · 126 unmodified lines
443442 * @ds: The pointer to the dsa core structure
444443 * @bus: The bus used for the device and built-in PHY
445444 * @rstc: The pointer to reset control used by MCM
446− * @ethernet: The regmap used for access TRGMII-based registers
447445 * @core_pwr: The power supplied into the core
448446 * @io_pwr: The power supplied into the I/O
449447 * @reset: The descriptor for GPIO line tied to its reset pin
@@ -460,7 +458,6 @@ struct mt7530_priv { · 10 unmodified lines
460458 struct dsa_switch *ds;
461459 struct mii_bus *bus;
462460 struct reset_control *rstc;
463− struct regmap *ethernet;
464461 struct regulator *core_pwr;
465462 struct regulator *io_pwr;
466463 struct gpio_desc *reset;
drivers/net/dsa/mv88e6xxx/chip.c+3−2
@@ -709,7 +709,8 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port, · 708 unmodified lines
709709 ops = chip->info->ops;
710710
711711 mv88e6xxx_reg_lock(chip);
712− if (!mv88e6xxx_port_ppu_updates(chip, port) && ops->port_set_link)
712+ if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
713+ mode == MLO_AN_FIXED) && ops->port_set_link)
713714 err = ops->port_set_link(chip, port, LINK_FORCED_DOWN);
714715 mv88e6xxx_reg_unlock(chip);
715716
@@ -731,7 +732,7 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, · 15 unmodified lines
731732 ops = chip->info->ops;
732733
733734 mv88e6xxx_reg_lock(chip);
734− if (!mv88e6xxx_port_ppu_updates(chip, port)) {
735+ if (!mv88e6xxx_port_ppu_updates(chip, port) || mode == MLO_AN_FIXED) {
735736 /* FIXME: for an automedia port, should we force the link
736737 * down here - what if the link comes up due to "other" media
737738 * while we're bringing the port up, how is the exclusivity
drivers/net/dsa/ocelot/felix.c+1−4
@@ -46,11 +46,8 @@ static int felix_fdb_add(struct dsa_switch *ds, int port, · 45 unmodified lines
4646 const unsigned char *addr, u16 vid)
4747 {
4848 struct ocelot *ocelot = ds->priv;
49− bool vlan_aware;
5049
51− vlan_aware = dsa_port_is_vlan_filtering(dsa_to_port(ds, port));
52−
53− return ocelot_fdb_add(ocelot, port, addr, vid, vlan_aware);
50+ return ocelot_fdb_add(ocelot, port, addr, vid);
5451 }
5552
5653 static int felix_fdb_del(struct dsa_switch *ds, int port,
drivers/net/ethernet/amd/xgbe/xgbe-drv.c+1−1
@@ -514,7 +514,7 @@ static void xgbe_isr_task(unsigned long data) · 513 unmodified lines
514514 xgbe_disable_rx_tx_ints(pdata);
515515
516516 /* Turn on polling */
517− __napi_schedule_irqoff(&pdata->napi);
517+ __napi_schedule(&pdata->napi);
518518 }
519519 } else {
520520 /* Don't clear Rx/Tx status if doing per channel DMA
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+11−22
@@ -172,7 +172,6 @@ static int bgmac_probe(struct platform_device *pdev) · 171 unmodified lines
172172 {
173173 struct device_node *np = pdev->dev.of_node;
174174 struct bgmac *bgmac;
175− struct resource *regs;
176175 const u8 *mac_addr;
177176
178177 bgmac = bgmac_alloc(&pdev->dev);
@@ -202,31 +201,21 @@ static int bgmac_probe(struct platform_device *pdev) · 23 unmodified lines
202201 if (bgmac->irq < 0)
203202 return bgmac->irq;
204203
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);
204+ bgmac->plat.base =
205+ devm_platform_ioremap_resource_byname(pdev, "amac_base");
212206 if (IS_ERR(bgmac->plat.base))
213207 return PTR_ERR(bgmac->plat.base);
214208
215− regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "idm_base");
216− if (regs) {
217− bgmac->plat.idm_base = devm_ioremap_resource(&pdev->dev, regs);
218− if (IS_ERR(bgmac->plat.idm_base))
219− return PTR_ERR(bgmac->plat.idm_base);
220− bgmac->feature_flags &= ~BGMAC_FEAT_IDM_MASK;
221− }
209+ bgmac->plat.idm_base =
210+ devm_platform_ioremap_resource_byname(pdev, "idm_base");
211+ if (IS_ERR(bgmac->plat.idm_base))
212+ return PTR_ERR(bgmac->plat.idm_base);
213+ bgmac->feature_flags &= ~BGMAC_FEAT_IDM_MASK;
222214
223− regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nicpm_base");
224− if (regs) {
225− bgmac->plat.nicpm_base = devm_ioremap_resource(&pdev->dev,
226− regs);
227− if (IS_ERR(bgmac->plat.nicpm_base))
228− return PTR_ERR(bgmac->plat.nicpm_base);
229− }
215+ bgmac->plat.nicpm_base =
216+ devm_platform_ioremap_resource_byname(pdev, "nicpm_base");
217+ if (IS_ERR(bgmac->plat.nicpm_base))
218+ return PTR_ERR(bgmac->plat.nicpm_base);
230219
231220 bgmac->read = platform_bgmac_read;
232221 bgmac->write = platform_bgmac_write;
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/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/t4_hw.c+1−1
@@ -3742,7 +3742,7 @@ int t4_phy_fw_ver(struct adapter *adap, int *phy_fw_ver) · 3741 unmodified lines
37423742 FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_VERSION));
37433743 ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1,
37443744 &param, &val);
3745− if (ret < 0)
3745+ if (ret)
37463746 return ret;
37473747 *phy_fw_ver = val;
37483748 return 0;
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/dec/tulip/tulip_core.c+1−1
@@ -1277,7 +1277,7 @@ static const struct net_device_ops tulip_netdev_ops = { · 1276 unmodified lines
12771277 #endif
12781278 };
12791279
1280−const struct pci_device_id early_486_chipsets[] = {
1280+static const struct pci_device_id early_486_chipsets[] = {
12811281 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424) },
12821282 { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496) },
12831283 { },
drivers/net/ethernet/freescale/fec.h+7−0
@@ -488,6 +488,12 @@ struct fec_enet_priv_rx_q { · 487 unmodified lines
488488 struct sk_buff *rx_skbuff[RX_RING_SIZE];
489489 };
490490
491+struct fec_stop_mode_gpr {
492+ struct regmap *gpr;
493+ u8 reg;
494+ u8 bit;
495+};
496+
491497 /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and
492498 * tx_bd_base always point to the base of the buffer descriptors. The
493499 * cur_rx and cur_tx point to the currently available buffer.
@@ -562,6 +568,7 @@ struct fec_enet_private { · 68 unmodified lines
562568 int hwts_tx_en;
563569 struct delayed_work time_keep;
564570 struct regulator *reg_phy;
571+ struct fec_stop_mode_gpr stop_gpr;
565572
566573 unsigned int tx_align;
567574 unsigned int rx_align;
drivers/net/ethernet/freescale/fec_main.c+120−29
@@ -62,6 +62,8 @@ · 61 unmodified lines
6262 #include <linux/if_vlan.h>
6363 #include <linux/pinctrl/consumer.h>
6464 #include <linux/prefetch.h>
65+#include <linux/mfd/syscon.h>
66+#include <linux/regmap.h>
6567 #include <soc/imx/cpuidle.h>
6668
6769 #include <asm/cacheflush.h>
@@ -84,6 +86,56 @@ static void fec_enet_itr_coal_init(struct net_device *ndev); · 16 unmodified lines
8486 #define FEC_ENET_OPD_V 0xFFF0
8587 #define FEC_MDIO_PM_TIMEOUT 100 /* ms */
8688
89+struct fec_devinfo {
90+ u32 quirks;
91+ u8 stop_gpr_reg;
92+ u8 stop_gpr_bit;
93+};
94+
95+static const struct fec_devinfo fec_imx25_info = {
96+ .quirks = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR |
97+ FEC_QUIRK_HAS_FRREG,
98+};
99+
100+static const struct fec_devinfo fec_imx27_info = {
101+ .quirks = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG,
102+};
103+
104+static const struct fec_devinfo fec_imx28_info = {
105+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME |
106+ FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC |
107+ FEC_QUIRK_HAS_FRREG,
108+};
109+
110+static const struct fec_devinfo fec_imx6q_info = {
111+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
112+ FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
113+ FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358 |
114+ FEC_QUIRK_HAS_RACC,
115+ .stop_gpr_reg = 0x34,
116+ .stop_gpr_bit = 27,
117+};
118+
119+static const struct fec_devinfo fec_mvf600_info = {
120+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC,
121+};
122+
123+static const struct fec_devinfo fec_imx6x_info = {
124+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
125+ FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
126+ FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |
127+ FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
128+ FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE,
129+};
130+
131+static const struct fec_devinfo fec_imx6ul_info = {
132+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
133+ FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
134+ FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR007885 |
135+ FEC_QUIRK_BUG_CAPTURE | FEC_QUIRK_HAS_RACC |
136+ FEC_QUIRK_HAS_COALESCE,
137+};
138+
87139 static struct platform_device_id fec_devtype[] = {
88140 {
89141 /* keep it for coldfire */
@@ -91,39 +143,25 @@ static struct platform_device_id fec_devtype[] = { · 1 unmodified line
91143 .driver_data = 0,
92144 }, {
93145 .name = "imx25-fec",
94− .driver_data = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR |
95− FEC_QUIRK_HAS_FRREG,
146+ .driver_data = (kernel_ulong_t)&fec_imx25_info,
96147 }, {
97148 .name = "imx27-fec",
98− .driver_data = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG,
149+ .driver_data = (kernel_ulong_t)&fec_imx27_info,
99150 }, {
100151 .name = "imx28-fec",
101− .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME |
102− FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC |
103− FEC_QUIRK_HAS_FRREG,
152+ .driver_data = (kernel_ulong_t)&fec_imx28_info,
104153 }, {
105154 .name = "imx6q-fec",
106− .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
107− FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
108− FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358 |
109− FEC_QUIRK_HAS_RACC,
155+ .driver_data = (kernel_ulong_t)&fec_imx6q_info,
110156 }, {
111157 .name = "mvf600-fec",
112− .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC,
158+ .driver_data = (kernel_ulong_t)&fec_mvf600_info,
113159 }, {
114160 .name = "imx6sx-fec",
115− .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
116− FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
117− FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |
118− FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
119− FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE,
161+ .driver_data = (kernel_ulong_t)&fec_imx6x_info,
120162 }, {
121163 .name = "imx6ul-fec",
122− .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
123− FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
124− FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR007885 |
125− FEC_QUIRK_BUG_CAPTURE | FEC_QUIRK_HAS_RACC |
126− FEC_QUIRK_HAS_COALESCE,
164+ .driver_data = (kernel_ulong_t)&fec_imx6ul_info,
127165 }, {
128166 /* sentinel */
129167 }
@@ -1092,11 +1130,28 @@ fec_restart(struct net_device *ndev) · 962 unmodified lines
10921130
10931131 }
10941132
1133+static void fec_enet_stop_mode(struct fec_enet_private *fep, bool enabled)
1134+{
1135+ struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
1136+ struct fec_stop_mode_gpr *stop_gpr = &fep->stop_gpr;
1137+
1138+ if (stop_gpr->gpr) {
1139+ if (enabled)
1140+ regmap_update_bits(stop_gpr->gpr, stop_gpr->reg,
1141+ BIT(stop_gpr->bit),
1142+ BIT(stop_gpr->bit));
1143+ else
1144+ regmap_update_bits(stop_gpr->gpr, stop_gpr->reg,
1145+ BIT(stop_gpr->bit), 0);
1146+ } else if (pdata && pdata->sleep_mode_enable) {
1147+ pdata->sleep_mode_enable(enabled);
1148+ }
1149+}
1150+
10951151 static void
10961152 fec_stop(struct net_device *ndev)
10971153 {
10981154 struct fec_enet_private *fep = netdev_priv(ndev);
1099− struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
11001155 u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & (1 << 8);
11011156 u32 val;
11021157
@@ -1125,9 +1180,7 @@ fec_stop(struct net_device *ndev) · 22 unmodified lines
11251180 val = readl(fep->hwp + FEC_ECNTRL);
11261181 val |= (FEC_ECR_MAGICEN | FEC_ECR_SLEEP);
11271182 writel(val, fep->hwp + FEC_ECNTRL);
1128−
1129− if (pdata && pdata->sleep_mode_enable)
1130− pdata->sleep_mode_enable(true);
1183+ fec_enet_stop_mode(fep, true);
11311184 }
11321185 writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
11331186
@@ -3398,6 +3451,37 @@ static int fec_enet_get_irq_cnt(struct platform_device *pdev) · 2264 unmodified lines
33983451 return irq_cnt;
33993452 }
34003453
3454+static int fec_enet_init_stop_mode(struct fec_enet_private *fep,
3455+ struct fec_devinfo *dev_info,
3456+ struct device_node *np)
3457+{
3458+ struct device_node *gpr_np;
3459+ int ret = 0;
3460+
3461+ if (!dev_info)
3462+ return 0;
3463+
3464+ gpr_np = of_parse_phandle(np, "gpr", 0);
3465+ if (!gpr_np)
3466+ return 0;
3467+
3468+ fep->stop_gpr.gpr = syscon_node_to_regmap(gpr_np);
3469+ if (IS_ERR(fep->stop_gpr.gpr)) {
3470+ dev_err(&fep->pdev->dev, "could not find gpr regmap\n");
3471+ ret = PTR_ERR(fep->stop_gpr.gpr);
3472+ fep->stop_gpr.gpr = NULL;
3473+ goto out;
3474+ }
3475+
3476+ fep->stop_gpr.reg = dev_info->stop_gpr_reg;
3477+ fep->stop_gpr.bit = dev_info->stop_gpr_bit;
3478+
3479+out:
3480+ of_node_put(gpr_np);
3481+
3482+ return ret;
3483+}
3484+
34013485 static int
34023486 fec_probe(struct platform_device *pdev)
34033487 {
@@ -3413,6 +3497,7 @@ fec_probe(struct platform_device *pdev) · 9 unmodified lines
34133497 int num_rx_qs;
34143498 char irq_name[8];
34153499 int irq_cnt;
3500+ struct fec_devinfo *dev_info;
34163501
34173502 fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs);
34183503
@@ -3430,7 +3515,9 @@ fec_probe(struct platform_device *pdev) · 11 unmodified lines
34303515 of_id = of_match_device(fec_dt_ids, &pdev->dev);
34313516 if (of_id)
34323517 pdev->id_entry = of_id->data;
3433− fep->quirks = pdev->id_entry->driver_data;
3518+ dev_info = (struct fec_devinfo *)pdev->id_entry->driver_data;
3519+ if (dev_info)
3520+ fep->quirks = dev_info->quirks;
34343521
34353522 fep->netdev = ndev;
34363523 fep->num_rx_queues = num_rx_qs;
@@ -3464,6 +3551,10 @@ fec_probe(struct platform_device *pdev) · 27 unmodified lines
34643551 if (of_get_property(np, "fsl,magic-packet", NULL))
34653552 fep->wol_flag |= FEC_WOL_HAS_MAGIC_PACKET;
34663553
3554+ ret = fec_enet_init_stop_mode(fep, dev_info, np);
3555+ if (ret)
3556+ goto failed_stop_mode;
3557+
34673558 phy_node = of_parse_phandle(np, "phy-handle", 0);
34683559 if (!phy_node && of_phy_is_fixed_link(np)) {
34693560 ret = of_phy_register_fixed_link(np);
@@ -3632,6 +3723,7 @@ failed_clk: · 162 unmodified lines
36323723 if (of_phy_is_fixed_link(np))
36333724 of_phy_deregister_fixed_link(np);
36343725 of_node_put(phy_node);
3726+failed_stop_mode:
36353727 failed_phy:
36363728 dev_id--;
36373729 failed_ioremap:
@@ -3709,7 +3801,6 @@ static int __maybe_unused fec_resume(struct device *dev) · 71 unmodified lines
37093801 {
37103802 struct net_device *ndev = dev_get_drvdata(dev);
37113803 struct fec_enet_private *fep = netdev_priv(ndev);
3712− struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
37133804 int ret;
37143805 int val;
37153806
@@ -3727,8 +3818,8 @@ static int __maybe_unused fec_resume(struct device *dev) · 11 unmodified lines
37273818 goto failed_clk;
37283819 }
37293820 if (fep->wol_flag & FEC_WOL_FLAG_ENABLE) {
3730− if (pdata && pdata->sleep_mode_enable)
3731− pdata->sleep_mode_enable(false);
3821+ fec_enet_stop_mode(fep, false);
3822+
37323823 val = readl(fep->hwp + FEC_ECNTRL);
37333824 val &= ~(FEC_ECR_MAGICEN | FEC_ECR_SLEEP);
37343825 writel(val, fep->hwp + FEC_ECNTRL);
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/mvneta.c+1−1
@@ -5383,7 +5383,7 @@ static int __init mvneta_driver_init(void) · 5382 unmodified lines
53835383 {
53845384 int ret;
53855385
5386− ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "net/mvmeta:online",
5386+ ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "net/mvneta:online",
53875387 mvneta_cpu_online,
53885388 mvneta_cpu_down_prepare);
53895389 if (ret < 0)
drivers/net/ethernet/mediatek/mtk_eth_soc.c+23−1
@@ -65,6 +65,17 @@ u32 mtk_r32(struct mtk_eth *eth, unsigned reg) · 64 unmodified lines
6565 return __raw_readl(eth->base + reg);
6666 }
6767
68+u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg)
69+{
70+ u32 val;
71+
72+ val = mtk_r32(eth, reg);
73+ val &= ~mask;
74+ val |= set;
75+ mtk_w32(eth, val, reg);
76+ return reg;
77+}
78+
6879 static int mtk_mdio_busy_wait(struct mtk_eth *eth)
6980 {
7081 unsigned long t_start = jiffies;
@@ -193,7 +204,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode, · 122 unmodified lines
193204 struct mtk_mac *mac = container_of(config, struct mtk_mac,
194205 phylink_config);
195206 struct mtk_eth *eth = mac->hw;
196− u32 mcr_cur, mcr_new, sid;
207+ u32 mcr_cur, mcr_new, sid, i;
197208 int val, ge_mode, err;
198209
199210 /* MT76x8 has no hardware settings between for the MAC */
@@ -255,6 +266,17 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode, · 55 unmodified lines
255266 PHY_INTERFACE_MODE_TRGMII)
256267 mtk_gmac0_rgmii_adjust(mac->hw,
257268 state->speed);
269+
270+ /* mt7623_pad_clk_setup */
271+ for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
272+ mtk_w32(mac->hw,
273+ TD_DM_DRVP(8) | TD_DM_DRVN(8),
274+ TRGMII_TD_ODT(i));
275+
276+ /* Assert/release MT7623 RXC reset */
277+ mtk_m32(mac->hw, 0, RXC_RST | RXC_DQSISEL,
278+ TRGMII_RCK_CTRL);
279+ mtk_m32(mac->hw, RXC_RST, 0, TRGMII_RCK_CTRL);
258280 }
259281 }
260282
drivers/net/ethernet/mediatek/mtk_eth_soc.h+8−0
@@ -352,10 +352,13 @@ · 351 unmodified lines
352352 #define DQSI0(x) ((x << 0) & GENMASK(6, 0))
353353 #define DQSI1(x) ((x << 8) & GENMASK(14, 8))
354354 #define RXCTL_DMWTLAT(x) ((x << 16) & GENMASK(18, 16))
355+#define RXC_RST BIT(31)
355356 #define RXC_DQSISEL BIT(30)
356357 #define RCK_CTRL_RGMII_1000 (RXC_DQSISEL | RXCTL_DMWTLAT(2) | DQSI1(16))
357358 #define RCK_CTRL_RGMII_10_100 RXCTL_DMWTLAT(2)
358359
360+#define NUM_TRGMII_CTRL 5
361+
359362 /* TRGMII RXC control register */
360363 #define TRGMII_TCK_CTRL 0x10340
361364 #define TXCTL_DMWTLAT(x) ((x << 16) & GENMASK(18, 16))
@@ -363,6 +366,11 @@ · 1 unmodified line
363366 #define TCK_CTRL_RGMII_1000 TXCTL_DMWTLAT(2)
364367 #define TCK_CTRL_RGMII_10_100 (TXC_INV | TXCTL_DMWTLAT(2))
365368
369+/* TRGMII TX Drive Strength */
370+#define TRGMII_TD_ODT(i) (0x10354 + 8 * (i))
371+#define TD_DM_DRVP(x) ((x) & 0xf)
372+#define TD_DM_DRVN(x) (((x) & 0xf) << 4)
373+
366374 /* TRGMII Interface mode register */
367375 #define INTF_MODE 0x10390
368376 #define TRGMII_INTF_DIS BIT(0)
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/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/devlink.c+4−1
@@ -23,7 +23,10 @@ static int mlx5_devlink_flash_update(struct devlink *devlink, · 22 unmodified lines
2323 if (err)
2424 return err;
2525
26− return mlx5_firmware_flash(dev, fw, extack);
26+ err = mlx5_firmware_flash(dev, fw, extack);
27+ release_firmware(fw);
28+
29+ return err;
2730 }
2831
2932 static u8 mlx5_fw_ver_major(u32 version)
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+19−23
@@ -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;
@@ -67,11 +68,9 @@ struct mlx5_ct_ft { · 25 unmodified lines
6768 struct nf_flowtable *nf_ft;
6869 struct mlx5_tc_ct_priv *ct_priv;
6970 struct rhashtable ct_entries_ht;
70− struct list_head ct_entries_list;
7171 };
7272
7373 struct mlx5_ct_entry {
74− struct list_head list;
7574 u16 zone;
7675 struct rhash_head node;
7776 struct flow_rule *flow_rule;
@@ -240,7 +239,7 @@ mlx5_tc_ct_entry_del_rule(struct mlx5_tc_ct_priv *ct_priv, · 162 unmodified lines
240239
241240 mlx5_eswitch_del_offloaded_rule(esw, zone_rule->rule, attr);
242241 mlx5_modify_header_dealloc(esw->dev, attr->modify_hdr);
243− idr_remove(&ct_priv->tuple_ids, zone_rule->tupleid);
242+ xa_erase(&ct_priv->tuple_ids, zone_rule->tupleid);
244243 }
245244
246245 static void
@@ -485,7 +484,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 238 unmodified lines
485484 struct mlx5_esw_flow_attr *attr = &zone_rule->attr;
486485 struct mlx5_eswitch *esw = ct_priv->esw;
487486 struct mlx5_flow_spec *spec = NULL;
488− u32 tupleid = 1;
487+ u32 tupleid;
489488 int err;
490489
491490 zone_rule->nat = nat;
@@ -495,12 +494,12 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 3 unmodified lines
495494 return -ENOMEM;
496495
497496 /* Get tuple unique id */
498− err = idr_alloc_u32(&ct_priv->tuple_ids, zone_rule, &tupleid,
499− 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);
500499 if (err) {
501500 netdev_warn(ct_priv->netdev,
502501 "Failed to allocate tuple id, err: %d\n", err);
503− goto err_idr_alloc;
502+ goto err_xa_alloc;
504503 }
505504 zone_rule->tupleid = tupleid;
506505
@@ -541,8 +540,8 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, · 34 unmodified lines
541540 err_rule:
542541 mlx5_modify_header_dealloc(esw->dev, attr->modify_hdr);
543542 err_mod_hdr:
544− idr_remove(&ct_priv->tuple_ids, zone_rule->tupleid);
545−err_idr_alloc:
543+ xa_erase(&ct_priv->tuple_ids, zone_rule->tupleid);
544+err_xa_alloc:
546545 kfree(spec);
547546 return err;
548547 }
@@ -617,8 +616,6 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, · 68 unmodified lines
617616 if (err)
618617 goto err_insert;
619618
620− list_add(&entry->list, &ft->ct_entries_list);
621−
622619 return 0;
623620
624621 err_insert:
@@ -646,7 +643,6 @@ mlx5_tc_ct_block_flow_offload_del(struct mlx5_ct_ft *ft, · 21 unmodified lines
646643 WARN_ON(rhashtable_remove_fast(&ft->ct_entries_ht,
647644 &entry->node,
648645 cts_ht_params));
649− list_del(&entry->list);
650646 kfree(entry);
651647
652648 return 0;
@@ -818,7 +814,6 @@ mlx5_tc_ct_add_ft_cb(struct mlx5_tc_ct_priv *ct_priv, u16 zone, · 165 unmodified lines
818814 ft->zone = zone;
819815 ft->nf_ft = nf_ft;
820816 ft->ct_priv = ct_priv;
821− INIT_LIST_HEAD(&ft->ct_entries_list);
822817 refcount_set(&ft->refcount, 1);
823818
824819 err = rhashtable_init(&ft->ct_entries_ht, &cts_ht_params);
@@ -847,12 +842,12 @@ err_init: · 22 unmodified lines
847842 }
848843
849844 static void
850−mlx5_tc_ct_flush_ft(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft)
845+mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg)
851846 {
852− struct mlx5_ct_entry *entry;
847+ struct mlx5_tc_ct_priv *ct_priv = arg;
848+ struct mlx5_ct_entry *entry = ptr;
853849
854− list_for_each_entry(entry, &ft->ct_entries_list, list)
855− mlx5_tc_ct_entry_del_rules(ft->ct_priv, entry);
850+ mlx5_tc_ct_entry_del_rules(ct_priv, entry);
856851 }
857852
858853 static void
@@ -863,9 +858,10 @@ mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft) · 4 unmodified lines
863858
864859 nf_flow_table_offload_del_cb(ft->nf_ft,
865860 mlx5_tc_ct_block_flow_offload, ft);
866− mlx5_tc_ct_flush_ft(ct_priv, ft);
867861 rhashtable_remove_fast(&ct_priv->zone_ht, &ft->node, zone_params);
868− rhashtable_destroy(&ft->ct_entries_ht);
862+ rhashtable_free_and_destroy(&ft->ct_entries_ht,
863+ mlx5_tc_ct_flush_ft_entry,
864+ ct_priv);
869865 kfree(ft);
870866 }
871867
@@ -1304,7 +1300,7 @@ mlx5_tc_ct_init(struct mlx5_rep_uplink_priv *uplink_priv) · 432 unmodified lines
13041300 }
13051301
13061302 idr_init(&ct_priv->fte_ids);
1307− idr_init(&ct_priv->tuple_ids);
1303+ xa_init_flags(&ct_priv->tuple_ids, XA_FLAGS_ALLOC1);
13081304 mutex_init(&ct_priv->control_lock);
13091305 rhashtable_init(&ct_priv->zone_ht, &zone_params);
13101306
@@ -1339,7 +1335,7 @@ mlx5_tc_ct_clean(struct mlx5_rep_uplink_priv *uplink_priv) · 28 unmodified lines
13391335
13401336 rhashtable_destroy(&ct_priv->zone_ht);
13411337 mutex_destroy(&ct_priv->control_lock);
1342− idr_destroy(&ct_priv->tuple_ids);
1338+ xa_destroy(&ct_priv->tuple_ids);
13431339 idr_destroy(&ct_priv->fte_ids);
13441340 kfree(ct_priv);
13451341
@@ -1357,7 +1353,7 @@ mlx5e_tc_ct_restore_flow(struct mlx5_rep_uplink_priv *uplink_priv, · 11 unmodified lines
13571353 if (!ct_priv || !tupleid)
13581354 return true;
13591355
1360− zone_rule = idr_find(&ct_priv->tuple_ids, tupleid);
1356+ zone_rule = xa_load(&ct_priv->tuple_ids, tupleid);
13611357 if (!zone_rule)
13621358 return false;
13631359
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+7−2
@@ -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 }
@@ -5526,8 +5531,8 @@ static void mlx5e_remove(struct mlx5_core_dev *mdev, void *vpriv) · 1936 unmodified lines
55265531 #ifdef CONFIG_MLX5_CORE_EN_DCB
55275532 mlx5e_dcbnl_delete_app(priv);
55285533 #endif
5529− mlx5e_devlink_port_unregister(priv);
55305534 unregister_netdev(priv->netdev);
5535+ mlx5e_devlink_port_unregister(priv);
55315536 mlx5e_detach(mdev, vpriv);
55325537 mlx5e_destroy_netdev(priv);
55335538 }
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+5−4
@@ -2050,29 +2050,30 @@ static int register_devlink_port(struct mlx5_core_dev *dev, · 2049 unmodified lines
20502050 struct mlx5_eswitch_rep *rep = rpriv->rep;
20512051 struct netdev_phys_item_id ppid = {};
20522052 unsigned int dl_port_index = 0;
2053+ u16 pfnum;
20532054
20542055 if (!is_devlink_port_supported(dev, rpriv))
20552056 return 0;
20562057
20572058 mlx5e_rep_get_port_parent_id(rpriv->netdev, &ppid);
2059+ pfnum = PCI_FUNC(dev->pdev->devfn);
20582060
20592061 if (rep->vport == MLX5_VPORT_UPLINK) {
20602062 devlink_port_attrs_set(&rpriv->dl_port,
20612063 DEVLINK_PORT_FLAVOUR_PHYSICAL,
2062− PCI_FUNC(dev->pdev->devfn), false, 0,
2064+ pfnum, false, 0,
20632065 &ppid.id[0], ppid.id_len);
20642066 dl_port_index = vport_to_devlink_port_index(dev, rep->vport);
20652067 } else if (rep->vport == MLX5_VPORT_PF) {
20662068 devlink_port_attrs_pci_pf_set(&rpriv->dl_port,
20672069 &ppid.id[0], ppid.id_len,
2068− dev->pdev->devfn);
2070+ pfnum);
20692071 dl_port_index = rep->vport;
20702072 } else if (mlx5_eswitch_is_vf_vport(dev->priv.eswitch,
20712073 rpriv->rep->vport)) {
20722074 devlink_port_attrs_pci_vf_set(&rpriv->dl_port,
20732075 &ppid.id[0], ppid.id_len,
2074− dev->pdev->devfn,
2075− rep->vport - 1);
2076+ pfnum, rep->vport - 1);
20762077 dl_port_index = vport_to_devlink_port_index(dev, rep->vport);
20772078 }
20782079
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_tc.c+5−3
@@ -1343,7 +1343,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, · 1342 unmodified lines
13431343 if (err)
13441344 return err;
13451345
1346− if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) {
1346+ if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
1347+ !(attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR)) {
13471348 err = mlx5e_attach_mod_hdr(priv, flow, parse_attr);
13481349 dealloc_mod_hdr_actions(&parse_attr->mod_hdr_acts);
13491350 if (err)
@@ -3558,12 +3559,13 @@ static int add_vlan_pop_action(struct mlx5e_priv *priv, · 2208 unmodified lines
35583559 struct mlx5_esw_flow_attr *attr,
35593560 u32 *action)
35603561 {
3561− int nest_level = attr->parse_attr->filter_dev->lower_level;
35623562 struct flow_action_entry vlan_act = {
35633563 .id = FLOW_ACTION_VLAN_POP,
35643564 };
3565− int err = 0;
3565+ int nest_level, err = 0;
35663566
3567+ nest_level = attr->parse_attr->filter_dev->lower_level -
3568+ priv->netdev->lower_level;
35673569 while (nest_level--) {
35683570 err = parse_tc_vlan_action(priv, &vlan_act, attr, action);
35693571 if (err)
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.h+0−1
@@ -403,7 +403,6 @@ enum { · 402 unmodified lines
403403 MLX5_ESW_ATTR_FLAG_VLAN_HANDLED = BIT(0),
404404 MLX5_ESW_ATTR_FLAG_SLOW_PATH = BIT(1),
405405 MLX5_ESW_ATTR_FLAG_NO_IN_PORT = BIT(2),
406− MLX5_ESW_ATTR_FLAG_HAIRPIN = BIT(3),
407406 };
408407
409408 struct mlx5_esw_flow_attr {
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+3−9
@@ -300,7 +300,6 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, · 299 unmodified lines
300300 bool split = !!(attr->split_count);
301301 struct mlx5_flow_handle *rule;
302302 struct mlx5_flow_table *fdb;
303− bool hairpin = false;
304303 int j, i = 0;
305304
306305 if (esw->mode != MLX5_ESWITCH_OFFLOADS)
@@ -398,21 +397,16 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, · 91 unmodified lines
398397 goto err_esw_get;
399398 }
400399
401− if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec)) {
400+ if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec))
402401 rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, attr,
403402 &flow_act, dest, i);
404− hairpin = true;
405− } else {
403+ else
406404 rule = mlx5_add_flow_rules(fdb, spec, &flow_act, dest, i);
407− }
408405 if (IS_ERR(rule))
409406 goto err_add_rule;
410407 else
411408 atomic64_inc(&esw->offloads.num_flows);
412409
413− if (hairpin)
414− attr->flags |= MLX5_ESW_ATTR_FLAG_HAIRPIN;
415−
416410 return rule;
417411
418412 err_add_rule:
@@ -501,7 +495,7 @@ __mlx5_eswitch_del_rule(struct mlx5_eswitch *esw, · 82 unmodified lines
501495
502496 mlx5_del_flow_rules(rule);
503497
504− if (attr->flags & MLX5_ESW_ATTR_FLAG_HAIRPIN) {
498+ if (!(attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH)) {
505499 /* unref the term table */
506500 for (i = 0; i < MLX5_MAX_FLOW_FWD_VPORTS; i++) {
507501 if (attr->dests[i].termtbl)
drivers/net/ethernet/mellanox/mlx5/core/health.c+1−1
@@ -243,7 +243,7 @@ recover_from_sw_reset: · 242 unmodified lines
243243 if (mlx5_get_nic_state(dev) == MLX5_NIC_IFC_DISABLED)
244244 break;
245245
246− cond_resched();
246+ msleep(20);
247247 } while (!time_after(jiffies, end));
248248
249249 if (mlx5_get_nic_state(dev) != MLX5_NIC_IFC_DISABLED) {
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_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/mscc/ocelot.c+43−41
@@ -183,44 +183,47 @@ static void ocelot_vlan_mode(struct ocelot *ocelot, int port, · 182 unmodified lines
183183 ocelot_write(ocelot, val, ANA_VLANMASK);
184184 }
185185
186−void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port,
187− bool vlan_aware)
186+static int ocelot_port_set_native_vlan(struct ocelot *ocelot, int port,
187+ u16 vid)
188188 {
189189 struct ocelot_port *ocelot_port = ocelot->ports[port];
190− u32 val;
190+ u32 val = 0;
191191
192− if (vlan_aware)
193− val = ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA |
194− ANA_PORT_VLAN_CFG_VLAN_POP_CNT(1);
195− else
196− val = 0;
197− ocelot_rmw_gix(ocelot, val,
198− ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA |
199− ANA_PORT_VLAN_CFG_VLAN_POP_CNT_M,
200− ANA_PORT_VLAN_CFG, port);
192+ if (ocelot_port->vid != vid) {
193+ /* Always permit deleting the native VLAN (vid = 0) */
194+ if (ocelot_port->vid && vid) {
195+ dev_err(ocelot->dev,
196+ "Port already has a native VLAN: %d\n",
197+ ocelot_port->vid);
198+ return -EBUSY;
199+ }
200+ ocelot_port->vid = vid;
201+ }
202+
203+ ocelot_rmw_gix(ocelot, REW_PORT_VLAN_CFG_PORT_VID(vid),
204+ REW_PORT_VLAN_CFG_PORT_VID_M,
205+ REW_PORT_VLAN_CFG, port);
201206
202− if (vlan_aware && !ocelot_port->vid)
207+ if (ocelot_port->vlan_aware && !ocelot_port->vid)
203208 /* If port is vlan-aware and tagged, drop untagged and priority
204209 * tagged frames.
205210 */
206211 val = ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA |
207212 ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA |
208213 ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA;
209− else
210− val = 0;
211214 ocelot_rmw_gix(ocelot, val,
212215 ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA |
213216 ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA |
214217 ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA,
215218 ANA_PORT_DROP_CFG, port);
216219
217− if (vlan_aware) {
220+ if (ocelot_port->vlan_aware) {
218221 if (ocelot_port->vid)
219222 /* Tag all frames except when VID == DEFAULT_VLAN */
220− val |= REW_TAG_CFG_TAG_CFG(1);
223+ val = REW_TAG_CFG_TAG_CFG(1);
221224 else
222225 /* Tag all frames */
223− val |= REW_TAG_CFG_TAG_CFG(3);
226+ val = REW_TAG_CFG_TAG_CFG(3);
224227 } else {
225228 /* Port tagging disabled. */
226229 val = REW_TAG_CFG_TAG_CFG(0);
@@ -228,31 +231,31 @@ void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, · 1 unmodified line
228231 ocelot_rmw_gix(ocelot, val,
229232 REW_TAG_CFG_TAG_CFG_M,
230233 REW_TAG_CFG, port);
234+
235+ return 0;
231236 }
232−EXPORT_SYMBOL(ocelot_port_vlan_filtering);
233237
234−static int ocelot_port_set_native_vlan(struct ocelot *ocelot, int port,
235− u16 vid)
238+void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port,
239+ bool vlan_aware)
236240 {
237241 struct ocelot_port *ocelot_port = ocelot->ports[port];
242+ u32 val;
238243
239− if (ocelot_port->vid != vid) {
240− /* Always permit deleting the native VLAN (vid = 0) */
241− if (ocelot_port->vid && vid) {
242− dev_err(ocelot->dev,
243− "Port already has a native VLAN: %d\n",
244− ocelot_port->vid);
245− return -EBUSY;
246− }
247− ocelot_port->vid = vid;
248− }
244+ ocelot_port->vlan_aware = vlan_aware;
249245
250− ocelot_rmw_gix(ocelot, REW_PORT_VLAN_CFG_PORT_VID(vid),
251− REW_PORT_VLAN_CFG_PORT_VID_M,
252− REW_PORT_VLAN_CFG, port);
246+ if (vlan_aware)
247+ val = ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA |
248+ ANA_PORT_VLAN_CFG_VLAN_POP_CNT(1);
249+ else
250+ val = 0;
251+ ocelot_rmw_gix(ocelot, val,
252+ ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA |
253+ ANA_PORT_VLAN_CFG_VLAN_POP_CNT_M,
254+ ANA_PORT_VLAN_CFG, port);
253255
254− return 0;
256+ ocelot_port_set_native_vlan(ocelot, port, ocelot_port->vid);
255257 }
258+EXPORT_SYMBOL(ocelot_port_vlan_filtering);
256259
257260 /* Default vlan to clasify for untagged frames (may be zero) */
258261 static void ocelot_port_set_pvid(struct ocelot *ocelot, int port, u16 pvid)
@@ -873,12 +876,12 @@ static void ocelot_get_stats64(struct net_device *dev, · 614 unmodified lines
873876 }
874877
875878 int ocelot_fdb_add(struct ocelot *ocelot, int port,
876− const unsigned char *addr, u16 vid, bool vlan_aware)
879+ const unsigned char *addr, u16 vid)
877880 {
878881 struct ocelot_port *ocelot_port = ocelot->ports[port];
879882
880883 if (!vid) {
881− if (!vlan_aware)
884+ if (!ocelot_port->vlan_aware)
882885 /* If the bridge is not VLAN aware and no VID was
883886 * provided, set it to pvid to ensure the MAC entry
884887 * matches incoming untagged packets
@@ -905,7 +908,7 @@ static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], · 20 unmodified lines
905908 struct ocelot *ocelot = priv->port.ocelot;
906909 int port = priv->chip_port;
907910
908− return ocelot_fdb_add(ocelot, port, addr, vid, priv->vlan_aware);
911+ return ocelot_fdb_add(ocelot, port, addr, vid);
909912 }
910913
911914 int ocelot_fdb_del(struct ocelot *ocelot, int port,
@@ -1496,8 +1499,8 @@ static int ocelot_port_attr_set(struct net_device *dev, · 584 unmodified lines
14961499 ocelot_port_attr_ageing_set(ocelot, port, attr->u.ageing_time);
14971500 break;
14981501 case SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING:
1499− priv->vlan_aware = attr->u.vlan_filtering;
1500− ocelot_port_vlan_filtering(ocelot, port, priv->vlan_aware);
1502+ ocelot_port_vlan_filtering(ocelot, port,
1503+ attr->u.vlan_filtering);
15011504 break;
15021505 case SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED:
15031506 ocelot_port_attr_mc_set(ocelot, port, !attr->u.mc_disabled);
@@ -1868,7 +1871,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev, · 364 unmodified lines
18681871 } else {
18691872 err = ocelot_port_bridge_leave(ocelot, port,
18701873 info->upper_dev);
1871− priv->vlan_aware = false;
18721874 }
18731875 }
18741876 if (netif_is_lag_master(info->upper_dev)) {
drivers/net/ethernet/mscc/ocelot.h+0−2
@@ -56,8 +56,6 @@ struct ocelot_port_private { · 55 unmodified lines
5656 struct phy_device *phy;
5757 u8 chip_port;
5858
59− u8 vlan_aware;
60−
6159 struct phy *serdes;
6260
6361 struct ocelot_port_tc tc;
drivers/net/ethernet/neterion/s2io.c+1−1
@@ -5155,7 +5155,7 @@ static int do_s2io_delete_unicast_mc(struct s2io_nic *sp, u64 addr) · 5154 unmodified lines
51555155 /* read mac entries from CAM */
51565156 static u64 do_s2io_read_unicast_mc(struct s2io_nic *sp, int offset)
51575157 {
5158− u64 tmp64 = 0xffffffffffff0000ULL, val64;
5158+ u64 tmp64, val64;
51595159 struct XENA_dev_config __iomem *bar0 = sp->bar0;
51605160
51615161 /* read mac addr */
drivers/net/ethernet/pensando/ionic/ionic_lif.c+27−17
@@ -2127,6 +2127,8 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) · 2126 unmodified lines
21272127 if (lif->registered)
21282128 ionic_lif_set_netdev_info(lif);
21292129
2130+ ionic_rx_filter_replay(lif);
2131+
21302132 if (netif_running(lif->netdev)) {
21312133 err = ionic_txrx_alloc(lif);
21322134 if (err)
@@ -2206,9 +2208,9 @@ static void ionic_lif_deinit(struct ionic_lif *lif) · 73 unmodified lines
22062208 if (!test_bit(IONIC_LIF_F_FW_RESET, lif->state)) {
22072209 cancel_work_sync(&lif->deferred.work);
22082210 cancel_work_sync(&lif->tx_timeout_work);
2211+ ionic_rx_filters_deinit(lif);
22092212 }
22102213
2211− ionic_rx_filters_deinit(lif);
22122214 if (lif->netdev->features & NETIF_F_RXHASH)
22132215 ionic_lif_rss_deinit(lif);
22142216
@@ -2339,24 +2341,30 @@ static int ionic_station_set(struct ionic_lif *lif) · 124 unmodified lines
23392341 err = ionic_adminq_post_wait(lif, &ctx);
23402342 if (err)
23412343 return err;
2342−
2344+ netdev_dbg(lif->netdev, "found initial MAC addr %pM\n",
2345+ ctx.comp.lif_getattr.mac);
23432346 if (is_zero_ether_addr(ctx.comp.lif_getattr.mac))
23442347 return 0;
23452348
2346− memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len);
2347− addr.sa_family = AF_INET;
2348− err = eth_prepare_mac_addr_change(netdev, &addr);
2349− if (err) {
2350− netdev_warn(lif->netdev, "ignoring bad MAC addr from NIC %pM - err %d\n",
2351− addr.sa_data, err);
2352− return 0;
2353− }
2349+ if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) {
2350+ memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len);
2351+ addr.sa_family = AF_INET;
2352+ err = eth_prepare_mac_addr_change(netdev, &addr);
2353+ if (err) {
2354+ netdev_warn(lif->netdev, "ignoring bad MAC addr from NIC %pM - err %d\n",
2355+ addr.sa_data, err);
2356+ return 0;
2357+ }
23542358
2355− netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n",
2356− netdev->dev_addr);
2357− ionic_lif_addr(lif, netdev->dev_addr, false);
2359+ if (!is_zero_ether_addr(netdev->dev_addr)) {
2360+ netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n",
2361+ netdev->dev_addr);
2362+ ionic_lif_addr(lif, netdev->dev_addr, false);
2363+ }
2364+
2365+ eth_commit_mac_addr_change(netdev, &addr);
2366+ }
23582367
2359− eth_commit_mac_addr_change(netdev, &addr);
23602368 netdev_dbg(lif->netdev, "adding station MAC addr %pM\n",
23612369 netdev->dev_addr);
23622370 ionic_lif_addr(lif, netdev->dev_addr, true);
@@ -2421,9 +2429,11 @@ static int ionic_lif_init(struct ionic_lif *lif) · 58 unmodified lines
24212429 if (err)
24222430 goto err_out_notifyq_deinit;
24232431
2424− err = ionic_rx_filters_init(lif);
2425− if (err)
2426− goto err_out_notifyq_deinit;
2432+ if (!test_bit(IONIC_LIF_F_FW_RESET, lif->state)) {
2433+ err = ionic_rx_filters_init(lif);
2434+ if (err)
2435+ goto err_out_notifyq_deinit;
2436+ }
24272437
24282438 err = ionic_station_set(lif);
24292439 if (err)
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c+43−10
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
33
44 #include <linux/netdevice.h>
5+#include <linux/dynamic_debug.h>
56 #include <linux/etherdevice.h>
67
78 #include "ionic.h"
@@ -17,17 +18,49 @@ void ionic_rx_filter_free(struct ionic_lif *lif, struct ionic_rx_filter *f) · 9 unmodified lines
1718 devm_kfree(dev, f);
1819 }
1920
20−int ionic_rx_filter_del(struct ionic_lif *lif, struct ionic_rx_filter *f)
21+void ionic_rx_filter_replay(struct ionic_lif *lif)
2122 {
22− struct ionic_admin_ctx ctx = {
23− .work = COMPLETION_INITIALIZER_ONSTACK(ctx.work),
24− .cmd.rx_filter_del = {
25− .opcode = IONIC_CMD_RX_FILTER_DEL,
26− .filter_id = cpu_to_le32(f->filter_id),
27− },
28− };
29−
30− return ionic_adminq_post_wait(lif, &ctx);
23+ struct ionic_rx_filter_add_cmd *ac;
24+ struct ionic_admin_ctx ctx;
25+ struct ionic_rx_filter *f;
26+ struct hlist_head *head;
27+ struct hlist_node *tmp;
28+ unsigned int i;
29+ int err;
30+
31+ ac = &ctx.cmd.rx_filter_add;
32+
33+ for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) {
34+ head = &lif->rx_filters.by_id[i];
35+ hlist_for_each_entry_safe(f, tmp, head, by_id) {
36+ ctx.work = COMPLETION_INITIALIZER_ONSTACK(ctx.work);
37+ memcpy(ac, &f->cmd, sizeof(f->cmd));
38+ dev_dbg(&lif->netdev->dev, "replay filter command:\n");
39+ dynamic_hex_dump("cmd ", DUMP_PREFIX_OFFSET, 16, 1,
40+ &ctx.cmd, sizeof(ctx.cmd), true);
41+
42+ err = ionic_adminq_post_wait(lif, &ctx);
43+ if (err) {
44+ switch (le16_to_cpu(ac->match)) {
45+ case IONIC_RX_FILTER_MATCH_VLAN:
46+ netdev_info(lif->netdev, "Replay failed - %d: vlan %d\n",
47+ err,
48+ le16_to_cpu(ac->vlan.vlan));
49+ break;
50+ case IONIC_RX_FILTER_MATCH_MAC:
51+ netdev_info(lif->netdev, "Replay failed - %d: mac %pM\n",
52+ err, ac->mac.addr);
53+ break;
54+ case IONIC_RX_FILTER_MATCH_MAC_VLAN:
55+ netdev_info(lif->netdev, "Replay failed - %d: vlan %d mac %pM\n",
56+ err,
57+ le16_to_cpu(ac->vlan.vlan),
58+ ac->mac.addr);
59+ break;
60+ }
61+ }
62+ }
63+ }
3164 }
3265
3366 int ionic_rx_filters_init(struct ionic_lif *lif)
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h+1−1
@@ -24,7 +24,7 @@ struct ionic_rx_filters { · 23 unmodified lines
2424 };
2525
2626 void ionic_rx_filter_free(struct ionic_lif *lif, struct ionic_rx_filter *f);
27−int ionic_rx_filter_del(struct ionic_lif *lif, struct ionic_rx_filter *f);
27+void ionic_rx_filter_replay(struct ionic_lif *lif);
2828 int ionic_rx_filters_init(struct ionic_lif *lif);
2929 void ionic_rx_filters_deinit(struct ionic_lif *lif);
3030 int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index,
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+8−3
@@ -241,6 +241,8 @@ static int socfpga_set_phy_mode_common(int phymode, u32 *val) · 240 unmodified lines
241241 switch (phymode) {
242242 case PHY_INTERFACE_MODE_RGMII:
243243 case PHY_INTERFACE_MODE_RGMII_ID:
244+ case PHY_INTERFACE_MODE_RGMII_RXID:
245+ case PHY_INTERFACE_MODE_RGMII_TXID:
244246 *val = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII;
245247 break;
246248 case PHY_INTERFACE_MODE_MII:
@@ -289,16 +291,19 @@ static int socfpga_gen5_set_phy_mode(struct socfpga_dwmac *dwmac) · 42 unmodified lines
289291 phymode == PHY_INTERFACE_MODE_MII ||
290292 phymode == PHY_INTERFACE_MODE_GMII ||
291293 phymode == PHY_INTERFACE_MODE_SGMII) {
292− ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2);
293294 regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG,
294295 &module);
295296 module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2));
296297 regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG,
297298 module);
298− } else {
299− ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2));
300299 }
301300
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+
302307 regmap_write(sys_mgr_base_addr, reg_offset, ctrl);
303308
304309 /* Deassert reset for the phy configuration to be sampled by
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c+2−0
@@ -150,6 +150,8 @@ static int sun7i_gmac_probe(struct platform_device *pdev) · 149 unmodified lines
150150 plat_dat->init = sun7i_gmac_init;
151151 plat_dat->exit = sun7i_gmac_exit;
152152 plat_dat->fix_mac_speed = sun7i_fix_speed;
153+ plat_dat->tx_fifo_size = 4096;
154+ plat_dat->rx_fifo_size = 16384;
153155
154156 ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);
155157 if (ret)
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+23−0
@@ -4986,6 +4986,14 @@ int stmmac_dvr_probe(struct device *device, · 4985 unmodified lines
49864986 goto error_netdev_register;
49874987 }
49884988
4989+ if (priv->plat->serdes_powerup) {
4990+ ret = priv->plat->serdes_powerup(ndev,
4991+ priv->plat->bsp_priv);
4992+
4993+ if (ret < 0)
4994+ return ret;
4995+ }
4996+
49894997 #ifdef CONFIG_DEBUG_FS
49904998 stmmac_init_fs(ndev);
49914999 #endif
@@ -5029,6 +5037,9 @@ int stmmac_dvr_remove(struct device *dev) · 37 unmodified lines
50295037
50305038 stmmac_stop_all_dma(priv);
50315039
5040+ if (priv->plat->serdes_powerdown)
5041+ priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
5042+
50325043 stmmac_mac_set(priv, priv->ioaddr, false);
50335044 netif_carrier_off(ndev);
50345045 unregister_netdev(ndev);
@@ -5081,6 +5092,9 @@ int stmmac_suspend(struct device *dev) · 46 unmodified lines
50815092 /* Stop TX/RX DMA */
50825093 stmmac_stop_all_dma(priv);
50835094
5095+ if (priv->plat->serdes_powerdown)
5096+ priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
5097+
50845098 /* Enable Power down mode by programming the PMT regs */
50855099 if (device_may_wakeup(priv->device)) {
50865100 stmmac_pmt(priv, priv->hw, priv->wolopts);
@@ -5143,6 +5157,7 @@ int stmmac_resume(struct device *dev) · 56 unmodified lines
51435157 {
51445158 struct net_device *ndev = dev_get_drvdata(dev);
51455159 struct stmmac_priv *priv = netdev_priv(ndev);
5160+ int ret;
51465161
51475162 if (!netif_running(ndev))
51485163 return 0;
@@ -5170,6 +5185,14 @@ int stmmac_resume(struct device *dev) · 21 unmodified lines
51705185 stmmac_mdio_reset(priv->mii);
51715186 }
51725187
5188+ if (priv->plat->serdes_powerup) {
5189+ ret = priv->plat->serdes_powerup(ndev,
5190+ priv->plat->bsp_priv);
5191+
5192+ if (ret < 0)
5193+ return ret;
5194+ }
5195+
51735196 netif_device_attach(ndev);
51745197
51755198 mutex_lock(&priv->lock);
drivers/net/ethernet/ti/am65-cpsw-nuss.c+3−3
@@ -1372,7 +1372,7 @@ static int am65_cpsw_nuss_init_tx_chns(struct am65_cpsw_common *common) · 1371 unmodified lines
13721372 err:
13731373 i = devm_add_action(dev, am65_cpsw_nuss_free_tx_chns, common);
13741374 if (i) {
1375− dev_err(dev, "failed to add free_tx_chns action %d", i);
1375+ dev_err(dev, "Failed to add free_tx_chns action %d\n", i);
13761376 return i;
13771377 }
13781378
@@ -1481,7 +1481,7 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common) · 102 unmodified lines
14811481 err:
14821482 i = devm_add_action(dev, am65_cpsw_nuss_free_rx_chns, common);
14831483 if (i) {
1484− dev_err(dev, "failed to add free_rx_chns action %d", i);
1484+ dev_err(dev, "Failed to add free_rx_chns action %d\n", i);
14851485 return i;
14861486 }
14871487
@@ -1691,7 +1691,7 @@ static int am65_cpsw_nuss_init_ndev_2g(struct am65_cpsw_common *common) · 203 unmodified lines
16911691 ret = devm_add_action_or_reset(dev, am65_cpsw_pcpu_stats_free,
16921692 ndev_priv->stats);
16931693 if (ret) {
1694− dev_err(dev, "failed to add percpu stat free action %d", ret);
1694+ dev_err(dev, "Failed to add percpu stat free action %d\n", ret);
16951695 return ret;
16961696 }
16971697
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/ipa/ipa_modem.c+2−3
@@ -297,14 +297,13 @@ static void ipa_modem_crashed(struct ipa *ipa) · 296 unmodified lines
297297
298298 ret = ipa_endpoint_modem_exception_reset_all(ipa);
299299 if (ret)
300− dev_err(dev, "error %d resetting exception endpoint",
301− ret);
300+ dev_err(dev, "error %d resetting exception endpoint\n", ret);
302301
303302 ipa_endpoint_modem_pause_all(ipa, false);
304303
305304 ret = ipa_modem_stop(ipa);
306305 if (ret)
307− dev_err(dev, "error %d stopping modem", ret);
306+ dev_err(dev, "error %d stopping modem\n", ret);
308307
309308 /* Now prepare for the next modem boot */
310309 ret = ipa_mem_zero_modem(ipa);
drivers/net/macsec.c+9−5
@@ -3809,7 +3809,7 @@ static int macsec_changelink(struct net_device *dev, struct nlattr *tb[], · 3808 unmodified lines
38093809 struct netlink_ext_ack *extack)
38103810 {
38113811 struct macsec_dev *macsec = macsec_priv(dev);
3812− struct macsec_tx_sa tx_sc;
3812+ struct macsec_tx_sc tx_sc;
38133813 struct macsec_secy secy;
38143814 int ret;
38153815
@@ -4002,11 +4002,11 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 186 unmodified lines
40024002 struct netlink_ext_ack *extack)
40034003 {
40044004 struct macsec_dev *macsec = macsec_priv(dev);
4005+ rx_handler_func_t *rx_handler;
4006+ u8 icv_len = DEFAULT_ICV_LEN;
40054007 struct net_device *real_dev;
4006− int err;
4008+ int err, mtu;
40074009 sci_t sci;
4008− u8 icv_len = DEFAULT_ICV_LEN;
4009− rx_handler_func_t *rx_handler;
40104010
40114011 if (!tb[IFLA_LINK])
40124012 return -EINVAL;
@@ -4033,7 +4033,11 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 20 unmodified lines
40334033
40344034 if (data && data[IFLA_MACSEC_ICV_LEN])
40354035 icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]);
4036− dev->mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
4036+ mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
4037+ if (mtu < 0)
4038+ dev->mtu = 0;
4039+ else
4040+ dev->mtu = mtu;
40374041
40384042 rx_handler = rtnl_dereference(real_dev->rx_handler);
40394043 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/marvell.c+24−22
@@ -1263,6 +1263,30 @@ static int marvell_read_status_page_an(struct phy_device *phydev, · 1262 unmodified lines
12631263 int lpa;
12641264 int err;
12651265
1266+ if (!(status & MII_M1011_PHY_STATUS_RESOLVED)) {
1267+ phydev->link = 0;
1268+ return 0;
1269+ }
1270+
1271+ if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
1272+ phydev->duplex = DUPLEX_FULL;
1273+ else
1274+ phydev->duplex = DUPLEX_HALF;
1275+
1276+ switch (status & MII_M1011_PHY_STATUS_SPD_MASK) {
1277+ case MII_M1011_PHY_STATUS_1000:
1278+ phydev->speed = SPEED_1000;
1279+ break;
1280+
1281+ case MII_M1011_PHY_STATUS_100:
1282+ phydev->speed = SPEED_100;
1283+ break;
1284+
1285+ default:
1286+ phydev->speed = SPEED_10;
1287+ break;
1288+ }
1289+
12661290 if (!fiber) {
12671291 err = genphy_read_lpa(phydev);
12681292 if (err < 0)
@@ -1291,28 +1315,6 @@ static int marvell_read_status_page_an(struct phy_device *phydev, · 22 unmodified lines
12911315 }
12921316 }
12931317
1294− if (!(status & MII_M1011_PHY_STATUS_RESOLVED))
1295− return 0;
1296−
1297− if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
1298− phydev->duplex = DUPLEX_FULL;
1299− else
1300− phydev->duplex = DUPLEX_HALF;
1301−
1302− switch (status & MII_M1011_PHY_STATUS_SPD_MASK) {
1303− case MII_M1011_PHY_STATUS_1000:
1304− phydev->speed = SPEED_1000;
1305− break;
1306−
1307− case MII_M1011_PHY_STATUS_100:
1308− phydev->speed = SPEED_100;
1309− break;
1310−
1311− default:
1312− phydev->speed = SPEED_10;
1313− break;
1314− }
1315−
13161318 return 0;
13171319 }
13181320
drivers/net/phy/marvell10g.c+34−3
@@ -33,6 +33,8 @@ · 32 unmodified lines
3333 #define MV_PHY_ALASKA_NBT_QUIRK_REV (MARVELL_PHY_ID_88X3310 | 0xa)
3434
3535 enum {
36+ MV_PMA_FW_VER0 = 0xc011,
37+ MV_PMA_FW_VER1 = 0xc012,
3638 MV_PMA_BOOT = 0xc050,
3739 MV_PMA_BOOT_FATAL = BIT(0),
3840
@@ -73,7 +75,8 @@ enum { · 34 unmodified lines
7375
7476 /* Vendor2 MMD registers */
7577 MV_V2_PORT_CTRL = 0xf001,
76− MV_V2_PORT_CTRL_PWRDOWN = 0x0800,
78+ MV_V2_PORT_CTRL_SWRST = BIT(15),
79+ MV_V2_PORT_CTRL_PWRDOWN = BIT(11),
7780 MV_V2_TEMP_CTRL = 0xf08a,
7881 MV_V2_TEMP_CTRL_MASK = 0xc000,
7982 MV_V2_TEMP_CTRL_SAMPLE = 0x0000,
@@ -83,6 +86,8 @@ enum { · 3 unmodified lines
8386 };
8487
8588 struct mv3310_priv {
89+ u32 firmware_ver;
90+
8691 struct device *hwmon_dev;
8792 char *hwmon_name;
8893 };
@@ -235,8 +240,18 @@ static int mv3310_power_down(struct phy_device *phydev) · 146 unmodified lines
235240
236241 static int mv3310_power_up(struct phy_device *phydev)
237242 {
238− return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
239− MV_V2_PORT_CTRL_PWRDOWN);
243+ struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
244+ int ret;
245+
246+ ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
247+ MV_V2_PORT_CTRL_PWRDOWN);
248+
249+ if (phydev->drv->phy_id != MARVELL_PHY_ID_88X3310 ||
250+ priv->firmware_ver < 0x00030000)
251+ return ret;
252+
253+ return phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
254+ MV_V2_PORT_CTRL_SWRST);
240255 }
241256
242257 static int mv3310_reset(struct phy_device *phydev, u32 unit)
@@ -355,6 +370,22 @@ static int mv3310_probe(struct phy_device *phydev) · 112 unmodified lines
355370
356371 dev_set_drvdata(&phydev->mdio.dev, priv);
357372
373+ ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_FW_VER0);
374+ if (ret < 0)
375+ return ret;
376+
377+ priv->firmware_ver = ret << 16;
378+
379+ ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_FW_VER1);
380+ if (ret < 0)
381+ return ret;
382+
383+ priv->firmware_ver |= ret;
384+
385+ phydev_info(phydev, "Firmware version %u.%u.%u.%u\n",
386+ priv->firmware_ver >> 24, (priv->firmware_ver >> 16) & 255,
387+ (priv->firmware_ver >> 8) & 255, priv->firmware_ver & 255);
388+
358389 /* Powering down the port when not in use saves about 600mW */
359390 ret = mv3310_power_down(phydev);
360391 if (ret)
drivers/net/phy/mdio_bus.c+1−1
@@ -464,7 +464,7 @@ static struct class mdio_bus_class = { · 463 unmodified lines
464464
465465 /**
466466 * mdio_find_bus - Given the name of a mdiobus, find the mii_bus.
467− * @mdio_bus_np: Pointer to the mii_bus.
467+ * @mdio_name: The name of a mdiobus.
468468 *
469469 * Returns a reference to the mii_bus, or NULL if none found. The
470470 * embedded struct device will have its reference count incremented,
drivers/net/phy/micrel.c+1−1
@@ -1204,7 +1204,7 @@ static struct phy_driver ksphy_driver[] = { · 1203 unmodified lines
12041204 .driver_data = &ksz9021_type,
12051205 .probe = kszphy_probe,
12061206 .config_init = ksz9131_config_init,
1207− .read_status = ksz9031_read_status,
1207+ .read_status = genphy_read_status,
12081208 .ack_interrupt = kszphy_ack_interrupt,
12091209 .config_intr = kszphy_config_intr,
12101210 .get_sset_count = kszphy_get_sset_count,
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/tun.c+2−1
@@ -1888,6 +1888,7 @@ drop: · 1887 unmodified lines
18881888
18891889 skb_reset_network_header(skb);
18901890 skb_probe_transport_header(skb);
1891+ skb_record_rx_queue(skb, tfile->queue_index);
18911892
18921893 if (skb_xdp) {
18931894 struct bpf_prog *xdp_prog;
@@ -2459,6 +2460,7 @@ build: · 565 unmodified lines
24592460 skb->protocol = eth_type_trans(skb, tun->dev);
24602461 skb_reset_network_header(skb);
24612462 skb_probe_transport_header(skb);
2463+ skb_record_rx_queue(skb, tfile->queue_index);
24622464
24632465 if (skb_xdp) {
24642466 err = do_xdp_generic(xdp_prog, skb);
@@ -2470,7 +2472,6 @@ build: · 5 unmodified lines
24702472 !tfile->detached)
24712473 rxhash = __skb_get_hash_symmetric(skb);
24722474
2473− skb_record_rx_queue(skb, tfile->queue_index);
24742475 netif_receive_skb(skb);
24752476
24762477 /* No need for get_cpu_ptr() here since this function is
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/wireless/ath/ath11k/thermal.h+2−1
@@ -36,12 +36,13 @@ static inline int ath11k_thermal_register(struct ath11k_base *sc) · 35 unmodified lines
3636 return 0;
3737 }
3838
39−static inline void ath11k_thermal_unregister(struct ath11k *ar)
39+static inline void ath11k_thermal_unregister(struct ath11k_base *sc)
4040 {
4141 }
4242
4343 static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
4444 {
45+ return 0;
4546 }
4647
4748 static inline void ath11k_thermal_event_temperature(struct ath11k *ar,
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c+9−0
@@ -729,9 +729,18 @@ static int brcmf_net_mon_stop(struct net_device *ndev) · 728 unmodified lines
729729 return err;
730730 }
731731
732+static netdev_tx_t brcmf_net_mon_start_xmit(struct sk_buff *skb,
733+ struct net_device *ndev)
734+{
735+ dev_kfree_skb_any(skb);
736+
737+ return NETDEV_TX_OK;
738+}
739+
732740 static const struct net_device_ops brcmf_netdev_ops_mon = {
733741 .ndo_open = brcmf_net_mon_open,
734742 .ndo_stop = brcmf_net_mon_stop,
743+ .ndo_start_xmit = brcmf_net_mon_start_xmit,
735744 };
736745
737746 int brcmf_net_mon_attach(struct brcmf_if *ifp)
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+7−7
@@ -3669,9 +3669,9 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) · 3668 unmodified lines
36693669 }
36703670
36713671 if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
3672− hwname = kasprintf(GFP_KERNEL, "%.*s",
3673− nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
3674− (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
3672+ hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
3673+ nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
3674+ GFP_KERNEL);
36753675 if (!hwname)
36763676 return -ENOMEM;
36773677 param.hwname = hwname;
@@ -3691,9 +3691,9 @@ static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info) · 13 unmodified lines
36913691 if (info->attrs[HWSIM_ATTR_RADIO_ID]) {
36923692 idx = nla_get_u32(info->attrs[HWSIM_ATTR_RADIO_ID]);
36933693 } else if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
3694− hwname = kasprintf(GFP_KERNEL, "%.*s",
3695− nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
3696− (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
3694+ hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
3695+ nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
3696+ GFP_KERNEL);
36973697 if (!hwname)
36983698 return -ENOMEM;
36993699 } else
@@ -4068,7 +4068,7 @@ static void hwsim_virtio_rx_work(struct work_struct *work) · 368 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/net/wireless/realtek/rtw88/pci.c+3−8
@@ -1338,22 +1338,17 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev) · 1337 unmodified lines
13381338 rtw_pci_link_cfg(rtwdev);
13391339 }
13401340
1341−#ifdef CONFIG_PM
1342−static int rtw_pci_suspend(struct device *dev)
1341+static int __maybe_unused rtw_pci_suspend(struct device *dev)
13431342 {
13441343 return 0;
13451344 }
13461345
1347−static int rtw_pci_resume(struct device *dev)
1346+static int __maybe_unused rtw_pci_resume(struct device *dev)
13481347 {
13491348 return 0;
13501349 }
13511350
13521351 static SIMPLE_DEV_PM_OPS(rtw_pm_ops, rtw_pci_suspend, rtw_pci_resume);
1353−#define RTW_PM_OPS (&rtw_pm_ops)
1354−#else
1355−#define RTW_PM_OPS NULL
1356−#endif
13571352
13581353 static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev)
13591354 {
@@ -1582,7 +1577,7 @@ static struct pci_driver rtw_pci_driver = { · 222 unmodified lines
15821577 .id_table = rtw_pci_id_table,
15831578 .probe = rtw_pci_probe,
15841579 .remove = rtw_pci_remove,
1585− .driver.pm = RTW_PM_OPS,
1580+ .driver.pm = &rtw_pm_ops,
15861581 };
15871582 module_pci_driver(rtw_pci_driver);
15881583
drivers/nvme/host/core.c+2−0
@@ -3642,6 +3642,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) · 3641 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/of/overlay.c+2−0
@@ -261,6 +261,8 @@ static struct property *dup_and_fixup_symbol_prop( · 260 unmodified lines
261261
262262 of_property_set_flag(new_prop, OF_DYNAMIC);
263263
264+ kfree(target_path);
265+
264266 return new_prop;
265267
266268 err_free_new_prop:
drivers/of/unittest-data/overlay_bad_add_dup_prop.dts+19−4
@@ -3,22 +3,37 @@ · 2 unmodified lines
33 /plugin/;
44
55 /*
6− * &electric_1/motor-1 and &spin_ctrl_1 are the same node:
7− * /testcase-data-2/substation@100/motor-1
6+ * &electric_1/motor-1/electric and &spin_ctrl_1/electric are the same node:
7+ * /testcase-data-2/substation@100/motor-1/electric
88 *
99 * Thus the property "rpm_avail" in each fragment will
1010 * result in an attempt to update the same property twice.
1111 * This will result in an error and the overlay apply
1212 * will fail.
13+ *
14+ * The previous version of this test did not include the extra
15+ * level of node 'electric'. That resulted in the 'rpm_avail'
16+ * property being located in the pre-existing node 'motor-1'.
17+ * Modifying a property results in a WARNING that a memory leak
18+ * will occur if the overlay is removed. Since the overlay apply
19+ * fails, the memory leak does actually occur, and kmemleak will
20+ * further report the memory leak if CONFIG_DEBUG_KMEMLEAK is
21+ * enabled. Adding the overlay node 'electric' avoids the
22+ * memory leak and thus people who use kmemleak will not
23+ * have to debug this non-problem again.
1324 */
1425
1526 &electric_1 {
1627
1728 motor-1 {
18− rpm_avail = < 100 >;
29+ electric {
30+ rpm_avail = < 100 >;
31+ };
1932 };
2033 };
2134
2235 &spin_ctrl_1 {
23− rpm_avail = < 100 200 >;
36+ electric {
37+ rpm_avail = < 100 200 >;
38+ };
2439 };
drivers/of/unittest.c+19−9
@@ -861,6 +861,10 @@ static void __init of_unittest_changeset(void) · 860 unmodified lines
861861 unittest(!of_changeset_revert(&chgset), "revert failed\n");
862862
863863 of_changeset_destroy(&chgset);
864+
865+ of_node_put(n1);
866+ of_node_put(n2);
867+ of_node_put(n21);
864868 #endif
865869 }
866870
@@ -1243,10 +1247,13 @@ static void __init of_unittest_platform_populate(void) · 376 unmodified lines
12431247
12441248 of_platform_populate(np, match, NULL, &test_bus->dev);
12451249 for_each_child_of_node(np, child) {
1246− for_each_child_of_node(child, grandchild)
1247− unittest(of_find_device_by_node(grandchild),
1250+ for_each_child_of_node(child, grandchild) {
1251+ pdev = of_find_device_by_node(grandchild);
1252+ unittest(pdev,
12481253 "Could not create device for node '%pOFn'\n",
12491254 grandchild);
1255+ of_dev_put(pdev);
1256+ }
12501257 }
12511258
12521259 of_platform_depopulate(&test_bus->dev);
@@ -3087,8 +3094,11 @@ static __init void of_unittest_overlay_high_level(void) · 1834 unmodified lines
30873094 goto err_unlock;
30883095 }
30893096 if (__of_add_property(of_symbols, new_prop)) {
3097+ kfree(new_prop->name);
3098+ kfree(new_prop->value);
3099+ kfree(new_prop);
30903100 /* "name" auto-generated by unflatten */
3091− if (!strcmp(new_prop->name, "name"))
3101+ if (!strcmp(prop->name, "name"))
30923102 continue;
30933103 unittest(0, "duplicate property '%s' in overlay_base node __symbols__",
30943104 prop->name);
@@ -3171,21 +3181,21 @@ static __init void of_unittest_overlay_high_level(void) · 76 unmodified lines
31713181 "OF: overlay: ERROR: multiple fragments add and/or delete node /testcase-data-2/substation@100/motor-1/controller");
31723182
31733183 EXPECT_BEGIN(KERN_ERR,
3174− "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail");
3184+ "OF: overlay: ERROR: multiple fragments add and/or delete node /testcase-data-2/substation@100/motor-1/electric");
31753185 EXPECT_BEGIN(KERN_ERR,
3176− "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail");
3186+ "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/rpm_avail");
31773187 EXPECT_BEGIN(KERN_ERR,
3178− "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/rpm_avail");
3188+ "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/name");
31793189
31803190 unittest(overlay_data_apply("overlay_bad_add_dup_prop", NULL),
31813191 "Adding overlay 'overlay_bad_add_dup_prop' failed\n");
31823192
31833193 EXPECT_END(KERN_ERR,
3184− "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/rpm_avail");
3194+ "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/name");
31853195 EXPECT_END(KERN_ERR,
3186− "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail");
3196+ "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/rpm_avail");
31873197 EXPECT_END(KERN_ERR,
3188− "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail");
3198+ "OF: overlay: ERROR: multiple fragments add and/or delete node /testcase-data-2/substation@100/motor-1/electric");
31893199
31903200 unittest(overlay_data_apply("overlay_bad_phandle", NULL),
31913201 "Adding overlay 'overlay_bad_phandle' failed\n");
drivers/opp/core.c+14−0
@@ -819,6 +819,8 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) · 818 unmodified lines
819819 if (unlikely(!target_freq)) {
820820 if (opp_table->required_opp_tables) {
821821 ret = _set_required_opps(dev, opp_table, NULL);
822+ } else if (!_get_opp_count(opp_table)) {
823+ return 0;
822824 } else {
823825 dev_err(dev, "target frequency can't be 0\n");
824826 ret = -EINVAL;
@@ -849,6 +851,18 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) · 24 unmodified lines
849851 goto put_opp_table;
850852 }
851853
854+ /*
855+ * For IO devices which require an OPP on some platforms/SoCs
856+ * while just needing to scale the clock on some others
857+ * we look for empty OPP tables with just a clock handle and
858+ * scale only the clk. This makes dev_pm_opp_set_rate()
859+ * equivalent to a clk_set_rate()
860+ */
861+ if (!_get_opp_count(opp_table)) {
862+ ret = _generic_set_opp_clk_only(dev, clk, freq);
863+ goto put_opp_table;
864+ }
865+
852866 temp_freq = old_freq;
853867 old_opp = _find_freq_ceil(opp_table, &temp_freq);
854868 if (IS_ERR(old_opp)) {
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/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_ring.c+4−4
@@ -40,7 +40,7 @@ cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub, · 39 unmodified lines
4040 int id = sample->sensor_id;
4141 struct iio_dev *indio_dev;
4242
43− if (id > sensorhub->sensor_num)
43+ if (id >= sensorhub->sensor_num)
4444 return -EINVAL;
4545
4646 cb = sensorhub->push_data[id].push_data_cb;
@@ -820,7 +820,7 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub) · 773 unmodified lines
820820 if (fifo_info->count > sensorhub->fifo_size ||
821821 fifo_info->size != sensorhub->fifo_size) {
822822 dev_warn(sensorhub->dev,
823− "Mismatch EC data: count %d, size %d - expected %d",
823+ "Mismatch EC data: count %d, size %d - expected %d\n",
824824 fifo_info->count, fifo_info->size,
825825 sensorhub->fifo_size);
826826 goto error;
@@ -851,14 +851,14 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub) · 24 unmodified lines
851851 }
852852 if (number_data > fifo_info->count - i) {
853853 dev_warn(sensorhub->dev,
854− "Invalid EC data: too many entry received: %d, expected %d",
854+ "Invalid EC data: too many entry received: %d, expected %d\n",
855855 number_data, fifo_info->count - i);
856856 break;
857857 }
858858 if (out + number_data >
859859 sensorhub->ring + fifo_info->count) {
860860 dev_warn(sensorhub->dev,
861− "Too many samples: %d (%zd data) to %d entries for expected %d entries",
861+ "Too many samples: %d (%zd data) to %d entries for expected %d entries\n",
862862 i, out - sensorhub->ring, i + number_data,
863863 fifo_info->count);
864864 break;
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/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/block/Kconfig+0−1
@@ -26,7 +26,6 @@ config DASD · 25 unmodified lines
2626 def_tristate y
2727 prompt "Support for DASD devices"
2828 depends on CCW && BLOCK
29− select IOSCHED_DEADLINE
3029 help
3130 Enable this option if you want to access DASDs directly utilizing
3231 S/390s channel subsystem commands. This is necessary for running
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/hisi_sas/Kconfig+1−0
@@ -6,6 +6,7 @@ config SCSI_HISI_SAS · 5 unmodified lines
66 select SCSI_SAS_LIBSAS
77 select BLK_DEV_INTEGRITY
88 depends on ATA
9+ select SATA_HOST
910 help
1011 This driver supports HiSilicon's SAS HBA, including support based
1112 on platform device
drivers/scsi/qla2xxx/qla_dbg.c+2−1
@@ -2539,7 +2539,6 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...) · 2538 unmodified lines
25392539 {
25402540 va_list va;
25412541 struct va_format vaf;
2542− char pbuf[64];
25432542
25442543 va_start(va, fmt);
25452544
@@ -2547,6 +2546,8 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...) · 1 unmodified line
25472546 vaf.va = &va;
25482547
25492548 if (!ql_mask_match(level)) {
2549+ char pbuf[64];
2550+
25502551 if (vha != NULL) {
25512552 const struct pci_dev *pdev = vha->hw->pdev;
25522553 /* <module-name> <msg-id>:<host> Message */
drivers/scsi/qla2xxx/qla_init.c+0−2
@@ -3611,8 +3611,6 @@ qla24xx_detect_sfp(scsi_qla_host_t *vha) · 3610 unmodified lines
36113611 ha->lr_distance = LR_DISTANCE_5K;
36123612 }
36133613
3614− if (!vha->flags.init_done)
3615− rc = QLA_SUCCESS;
36163614 out:
36173615 ql_dbg(ql_dbg_async, vha, 0x507b,
36183616 "SFP detect: %s-Range SFP %s (nvr=%x ll=%x lr=%x lrd=%x).\n",
drivers/scsi/qla2xxx/qla_isr.c+0−1
@@ -87,7 +87,6 @@ qla24xx_process_abts(struct scsi_qla_host *vha, void *pkt) · 86 unmodified lines
8787 }
8888
8989 /* terminate exchange */
90− memset(rsp_els, 0, sizeof(*rsp_els));
9190 rsp_els->entry_type = ELS_IOCB_TYPE;
9291 rsp_els->entry_count = 1;
9392 rsp_els->nport_handle = ~0;
drivers/scsi/qla2xxx/qla_mbx.c+0−2
@@ -4894,8 +4894,6 @@ qla25xx_set_els_cmds_supported(scsi_qla_host_t *vha) · 4893 unmodified lines
48944894 return QLA_MEMORY_ALLOC_FAILED;
48954895 }
48964896
4897− memset(els_cmd_map, 0, ELS_CMD_MAP_SIZE);
4898−
48994897 els_cmd_map[index] |= 1 << bit;
49004898
49014899 mcp->mb[0] = MBC_SET_RNID_PARAMS;
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+6−2
@@ -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
@@ -793,8 +795,10 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, · 100 unmodified lines
793795 "sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n",
794796 (int) cmnd[0], (int) hp->cmd_len));
795797
796− if (hp->dxfer_len >= SZ_256M)
798+ if (hp->dxfer_len >= SZ_256M) {
799+ sg_remove_request(sfp, srp);
797800 return -EINVAL;
801+ }
798802
799803 k = sg_start_req(srp, cmnd);
800804 if (k) {
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_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/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_fabric_lib.c+3−2
@@ -63,7 +63,7 @@ static int fc_get_pr_transport_id( · 62 unmodified lines
6363 * encoded TransportID.
6464 */
6565 ptr = &se_nacl->initiatorname[0];
66− for (i = 0; i < 24; ) {
66+ for (i = 0; i < 23; ) {
6767 if (!strncmp(&ptr[i], ":", 1)) {
6868 i++;
6969 continue;
@@ -341,7 +341,8 @@ static char *iscsi_parse_pr_out_transport_id( · 271 unmodified lines
341341 *p = tolower(*p);
342342 p++;
343343 }
344− }
344+ } else
345+ *port_nexus_ptr = NULL;
345346
346347 return &buf[4];
347348 }
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/target/target_core_user.c+1−0
@@ -2073,6 +2073,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level) · 2072 unmodified lines
20732073 mb->cmd_tail = 0;
20742074 mb->cmd_head = 0;
20752075 tcmu_flush_dcache_range(mb, sizeof(*mb));
2076+ clear_bit(TCMU_DEV_BIT_BROKEN, &udev->flags);
20762077
20772078 del_timer(&udev->cmd_timer);
20782079
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/bcm63xx_uart.c+3−1
@@ -843,8 +843,10 @@ static int bcm_uart_probe(struct platform_device *pdev) · 842 unmodified lines
843843 if (IS_ERR(clk) && pdev->dev.of_node)
844844 clk = of_clk_get(pdev->dev.of_node, 0);
845845
846− if (IS_ERR(clk))
846+ if (IS_ERR(clk)) {
847+ clk_put(clk);
847848 return -ENODEV;
849+ }
848850
849851 port->iotype = UPIO_MEM;
850852 port->irq = res_irq->start;
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+49−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,35 @@ 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;
15591462 #endif
15601463
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;
1464+ rc = uart_register_driver(&cdns_uart_uart_driver);
1465+ if (rc < 0) {
1466+ dev_err(&pdev->dev, "Failed to register driver\n");
1467+ return rc;
1468+ }
15651469 }
15661470
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;
1471+ cdns_uart_data->cdns_uart_driver = &cdns_uart_uart_driver;
15751472
15761473 match = of_match_node(cdns_uart_of_match, pdev->dev.of_node);
15771474 if (match && match->data) {
@@ -1649,6 +1546,7 @@ static int cdns_uart_probe(struct platform_device *pdev) · 71 unmodified lines
16491546 port->ops = &cdns_uart_ops;
16501547 port->fifosize = CDNS_UART_FIFO_SIZE;
16511548 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_XILINX_PS_UART_CONSOLE);
1549+ port->line = id;
16521550
16531551 /*
16541552 * Register the port.
@@ -1680,7 +1578,7 @@ static int cdns_uart_probe(struct platform_device *pdev) · 25 unmodified lines
16801578 console_port = port;
16811579 #endif
16821580
1683− rc = uart_add_one_port(cdns_uart_uart_driver, port);
1581+ rc = uart_add_one_port(&cdns_uart_uart_driver, port);
16841582 if (rc) {
16851583 dev_err(&pdev->dev,
16861584 "uart_add_one_port() failed; err=%i\n", rc);
@@ -1690,13 +1588,15 @@ static int cdns_uart_probe(struct platform_device *pdev) · 3 unmodified lines
16901588 #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
16911589 /* This is not port which is used for console that's why clean it up */
16921590 if (console_port == port &&
1693− !(cdns_uart_uart_driver->cons->flags & CON_ENABLED))
1591+ !(cdns_uart_uart_driver.cons->flags & CON_ENABLED))
16941592 console_port = NULL;
16951593 #endif
16961594
1697− uartps_major = cdns_uart_uart_driver->tty_driver->major;
16981595 cdns_uart_data->cts_override = of_property_read_bool(pdev->dev.of_node,
16991596 "cts-override");
1597+
1598+ instances++;
1599+
17001600 return 0;
17011601
17021602 err_out_pm_disable:
@@ -1712,12 +1612,8 @@ err_out_clk_disable: · 9 unmodified lines
17121612 err_out_clk_dis_pclk:
17131613 clk_disable_unprepare(cdns_uart_data->pclk);
17141614 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);
1615+ if (!instances)
1616+ uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
17211617 return rc;
17221618 }
17231619
@@ -1740,10 +1636,6 @@ static int cdns_uart_remove(struct platform_device *pdev) · 16 unmodified lines
17401636 #endif
17411637 rc = uart_remove_one_port(cdns_uart_data->cdns_uart_driver, port);
17421638 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);
17471639 clk_disable_unprepare(cdns_uart_data->uartclk);
17481640 clk_disable_unprepare(cdns_uart_data->pclk);
17491641 pm_runtime_disable(&pdev->dev);
@@ -1756,13 +1648,8 @@ static int cdns_uart_remove(struct platform_device *pdev) · 6 unmodified lines
17561648 console_port = NULL;
17571649 #endif
17581650
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);
1651+ if (!--instances)
1652+ uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
17661653 return rc;
17671654 }
17681655
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+4−3
@@ -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
@@ -366,7 +367,7 @@ static struct uni_screen *vc_uniscr_alloc(unsigned int cols, unsigned int rows) · 9 unmodified lines
366367
367368 static void vc_uniscr_set(struct vc_data *vc, struct uni_screen *new_uniscr)
368369 {
369− kfree(vc->vc_uni_screen);
370+ vfree(vc->vc_uni_screen);
370371 vc->vc_uni_screen = new_uniscr;
371372 }
372373
@@ -1206,7 +1207,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 833 unmodified lines
12061207 if (new_cols == vc->vc_cols && new_rows == vc->vc_rows)
12071208 return 0;
12081209
1209− if (new_screen_size > (4 << 20))
1210+ if (new_screen_size > KMALLOC_MAX_SIZE)
12101211 return -EINVAL;
12111212 newscreen = kzalloc(new_screen_size, GFP_USER);
12121213 if (!newscreen)
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/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+8−1
@@ -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
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/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/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/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+7−7
@@ -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 */
@@ -440,7 +440,7 @@ static void vhost_vsock_handle_tx_kick(struct vhost_work *work) · 342 unmodified lines
440440
441441 mutex_lock(&vq->mutex);
442442
443− if (!vq->private_data)
443+ if (!vhost_vq_get_backend(vq))
444444 goto out;
445445
446446 vhost_disable_notify(&vsock->dev, vq);
@@ -533,8 +533,8 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) · 86 unmodified lines
533533 goto err_vq;
534534 }
535535
536− if (!vq->private_data) {
537− vq->private_data = vsock;
536+ if (!vhost_vq_get_backend(vq)) {
537+ vhost_vq_set_backend(vq, vsock);
538538 ret = vhost_vq_init_access(vq);
539539 if (ret)
540540 goto err_vq;
@@ -547,14 +547,14 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) · 6 unmodified lines
547547 return 0;
548548
549549 err_vq:
550− vq->private_data = NULL;
550+ vhost_vq_set_backend(vq, NULL);
551551 mutex_unlock(&vq->mutex);
552552
553553 for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
554554 vq = &vsock->vqs[i];
555555
556556 mutex_lock(&vq->mutex);
557− vq->private_data = NULL;
557+ vhost_vq_set_backend(vq, NULL);
558558 mutex_unlock(&vq->mutex);
559559 }
560560 err:
@@ -577,7 +577,7 @@ static int vhost_vsock_stop(struct vhost_vsock *vsock) · 16 unmodified lines
577577 struct vhost_virtqueue *vq = &vsock->vqs[i];
578578
579579 mutex_lock(&vq->mutex);
580− vq->private_data = NULL;
580+ vhost_vq_set_backend(vq, NULL);
581581 mutex_unlock(&vq->mutex);
582582 }
583583
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>
drivers/watchdog/sp805_wdt.c+4−0
@@ -137,10 +137,14 @@ wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd) · 136 unmodified lines
137137 {
138138 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
139139
140+ writel_relaxed(UNLOCK, wdt->base + WDTLOCK);
140141 writel_relaxed(0, wdt->base + WDTCONTROL);
141142 writel_relaxed(0, wdt->base + WDTLOAD);
142143 writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
143144
145+ /* Flush posted writes. */
146+ readl_relaxed(wdt->base + WDTLOCK);
147+
144148 return 0;
145149 }
146150
drivers/xen/xenbus/xenbus_client.c+8−1
@@ -448,7 +448,14 @@ EXPORT_SYMBOL_GPL(xenbus_free_evtchn); · 447 unmodified lines
448448 int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs,
449449 unsigned int nr_grefs, void **vaddr)
450450 {
451− return ring_ops->map(dev, gnt_refs, nr_grefs, vaddr);
451+ int err;
452+
453+ err = ring_ops->map(dev, gnt_refs, nr_grefs, vaddr);
454+ /* Some hypervisors are buggy and can return 1. */
455+ if (err > 0)
456+ err = GNTST_general_error;
457+
458+ return err;
452459 }
453460 EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc);
454461
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/dir.c+67−41
@@ -1032,7 +1032,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) · 1031 unmodified lines
10321032 struct dentry *parent;
10331033 struct inode *inode;
10341034 struct key *key;
1035− afs_dataversion_t dir_version;
1035+ afs_dataversion_t dir_version, invalid_before;
10361036 long de_version;
10371037 int ret;
10381038
@@ -1084,8 +1084,8 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) · 45 unmodified lines
10841084 if (de_version == (long)dir_version)
10851085 goto out_valid_noupdate;
10861086
1087− dir_version = dir->invalid_before;
1088− if (de_version - (long)dir_version >= 0)
1087+ invalid_before = dir->invalid_before;
1088+ if (de_version - (long)invalid_before >= 0)
10891089 goto out_valid;
10901090
10911091 _debug("dir modified");
@@ -1275,6 +1275,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) · 183 unmodified lines
12751275 struct afs_fs_cursor fc;
12761276 struct afs_vnode *dvnode = AFS_FS_I(dir);
12771277 struct key *key;
1278+ afs_dataversion_t data_version;
12781279 int ret;
12791280
12801281 mode |= S_IFDIR;
@@ -1295,7 +1296,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) · 14 unmodified lines
12951296
12961297 ret = -ERESTARTSYS;
12971298 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1298− afs_dataversion_t data_version = dvnode->status.data_version + 1;
1299+ data_version = dvnode->status.data_version + 1;
12991300
13001301 while (afs_select_fileserver(&fc)) {
13011302 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
@@ -1316,10 +1317,14 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) · 14 unmodified lines
13161317 goto error_key;
13171318 }
13181319
1319− if (ret == 0 &&
1320− test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
1321− afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid,
1322− afs_edit_dir_for_create);
1320+ if (ret == 0) {
1321+ down_write(&dvnode->validate_lock);
1322+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
1323+ dvnode->status.data_version == data_version)
1324+ afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid,
1325+ afs_edit_dir_for_create);
1326+ up_write(&dvnode->validate_lock);
1327+ }
13231328
13241329 key_put(key);
13251330 kfree(scb);
@@ -1360,6 +1365,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) · 34 unmodified lines
13601365 struct afs_fs_cursor fc;
13611366 struct afs_vnode *dvnode = AFS_FS_I(dir), *vnode = NULL;
13621367 struct key *key;
1368+ afs_dataversion_t data_version;
13631369 int ret;
13641370
13651371 _enter("{%llx:%llu},{%pd}",
@@ -1391,7 +1397,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) · 25 unmodified lines
13911397
13921398 ret = -ERESTARTSYS;
13931399 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1394− afs_dataversion_t data_version = dvnode->status.data_version + 1;
1400+ data_version = dvnode->status.data_version + 1;
13951401
13961402 while (afs_select_fileserver(&fc)) {
13971403 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
@@ -1404,9 +1410,12 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) · 6 unmodified lines
14041410 ret = afs_end_vnode_operation(&fc);
14051411 if (ret == 0) {
14061412 afs_dir_remove_subdir(dentry);
1407− if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
1413+ down_write(&dvnode->validate_lock);
1414+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
1415+ dvnode->status.data_version == data_version)
14081416 afs_edit_dir_remove(dvnode, &dentry->d_name,
14091417 afs_edit_dir_for_rmdir);
1418+ up_write(&dvnode->validate_lock);
14101419 }
14111420 }
14121421
@@ -1544,10 +1553,15 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry) · 131 unmodified lines
15441553 ret = afs_end_vnode_operation(&fc);
15451554 if (ret == 0 && !(scb[1].have_status || scb[1].have_error))
15461555 ret = afs_dir_remove_link(dvnode, dentry, key);
1547− if (ret == 0 &&
1548− test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
1549− afs_edit_dir_remove(dvnode, &dentry->d_name,
1550− afs_edit_dir_for_unlink);
1556+
1557+ if (ret == 0) {
1558+ down_write(&dvnode->validate_lock);
1559+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
1560+ dvnode->status.data_version == data_version)
1561+ afs_edit_dir_remove(dvnode, &dentry->d_name,
1562+ afs_edit_dir_for_unlink);
1563+ up_write(&dvnode->validate_lock);
1564+ }
15511565 }
15521566
15531567 if (need_rehash && ret < 0 && ret != -ENOENT)
@@ -1573,6 +1587,7 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, · 19 unmodified lines
15731587 struct afs_status_cb *scb;
15741588 struct afs_vnode *dvnode = AFS_FS_I(dir);
15751589 struct key *key;
1590+ afs_dataversion_t data_version;
15761591 int ret;
15771592
15781593 mode |= S_IFREG;
@@ -1597,7 +1612,7 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, · 18 unmodified lines
15971612
15981613 ret = -ERESTARTSYS;
15991614 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1600− afs_dataversion_t data_version = dvnode->status.data_version + 1;
1615+ data_version = dvnode->status.data_version + 1;
16011616
16021617 while (afs_select_fileserver(&fc)) {
16031618 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
@@ -1618,9 +1633,12 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, · 14 unmodified lines
16181633 goto error_key;
16191634 }
16201635
1621− if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
1636+ down_write(&dvnode->validate_lock);
1637+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
1638+ dvnode->status.data_version == data_version)
16221639 afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid,
16231640 afs_edit_dir_for_create);
1641+ up_write(&dvnode->validate_lock);
16241642
16251643 kfree(scb);
16261644 key_put(key);
@@ -1648,6 +1666,7 @@ static int afs_link(struct dentry *from, struct inode *dir, · 21 unmodified lines
16481666 struct afs_vnode *dvnode = AFS_FS_I(dir);
16491667 struct afs_vnode *vnode = AFS_FS_I(d_inode(from));
16501668 struct key *key;
1669+ afs_dataversion_t data_version;
16511670 int ret;
16521671
16531672 _enter("{%llx:%llu},{%llx:%llu},{%pd}",
@@ -1672,7 +1691,7 @@ static int afs_link(struct dentry *from, struct inode *dir, · 18 unmodified lines
16721691
16731692 ret = -ERESTARTSYS;
16741693 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1675− afs_dataversion_t data_version = dvnode->status.data_version + 1;
1694+ data_version = dvnode->status.data_version + 1;
16761695
16771696 if (mutex_lock_interruptible_nested(&vnode->io_lock, 1) < 0) {
16781697 afs_end_vnode_operation(&fc);
@@ -1702,9 +1721,12 @@ static int afs_link(struct dentry *from, struct inode *dir, · 23 unmodified lines
17021721 goto error_key;
17031722 }
17041723
1705− if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
1724+ down_write(&dvnode->validate_lock);
1725+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
1726+ dvnode->status.data_version == data_version)
17061727 afs_edit_dir_add(dvnode, &dentry->d_name, &vnode->fid,
17071728 afs_edit_dir_for_link);
1729+ up_write(&dvnode->validate_lock);
17081730
17091731 key_put(key);
17101732 kfree(scb);
@@ -1732,6 +1754,7 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, · 21 unmodified lines
17321754 struct afs_status_cb *scb;
17331755 struct afs_vnode *dvnode = AFS_FS_I(dir);
17341756 struct key *key;
1757+ afs_dataversion_t data_version;
17351758 int ret;
17361759
17371760 _enter("{%llx:%llu},{%pd},%s",
@@ -1759,7 +1782,7 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, · 21 unmodified lines
17591782
17601783 ret = -ERESTARTSYS;
17611784 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
1762− afs_dataversion_t data_version = dvnode->status.data_version + 1;
1785+ data_version = dvnode->status.data_version + 1;
17631786
17641787 while (afs_select_fileserver(&fc)) {
17651788 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
@@ -1780,9 +1803,12 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, · 14 unmodified lines
17801803 goto error_key;
17811804 }
17821805
1783− if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
1806+ down_write(&dvnode->validate_lock);
1807+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
1808+ dvnode->status.data_version == data_version)
17841809 afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid,
17851810 afs_edit_dir_for_symlink);
1811+ up_write(&dvnode->validate_lock);
17861812
17871813 key_put(key);
17881814 kfree(scb);
@@ -1812,6 +1838,8 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, · 23 unmodified lines
18121838 struct dentry *tmp = NULL, *rehash = NULL;
18131839 struct inode *new_inode;
18141840 struct key *key;
1841+ afs_dataversion_t orig_data_version;
1842+ afs_dataversion_t new_data_version;
18151843 bool new_negative = d_is_negative(new_dentry);
18161844 int ret;
18171845
@@ -1890,10 +1918,6 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, · 72 unmodified lines
18901918
18911919 ret = -ERESTARTSYS;
18921920 if (afs_begin_vnode_operation(&fc, orig_dvnode, key, true)) {
1893− afs_dataversion_t orig_data_version;
1894− afs_dataversion_t new_data_version;
1895− struct afs_status_cb *new_scb = &scb[1];
1896−
18971921 orig_data_version = orig_dvnode->status.data_version + 1;
18981922
18991923 if (orig_dvnode != new_dvnode) {
@@ -1904,7 +1928,6 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, · 4 unmodified lines
19041928 new_data_version = new_dvnode->status.data_version + 1;
19051929 } else {
19061930 new_data_version = orig_data_version;
1907− new_scb = &scb[0];
19081931 }
19091932
19101933 while (afs_select_fileserver(&fc)) {
@@ -1912,7 +1935,7 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, · 1 unmodified line
19121935 fc.cb_break_2 = afs_calc_vnode_cb_break(new_dvnode);
19131936 afs_fs_rename(&fc, old_dentry->d_name.name,
19141937 new_dvnode, new_dentry->d_name.name,
1915− &scb[0], new_scb);
1938+ &scb[0], &scb[1]);
19161939 }
19171940
19181941 afs_vnode_commit_status(&fc, orig_dvnode, fc.cb_break,
@@ -1930,18 +1953,25 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, · 11 unmodified lines
19301953 if (ret == 0) {
19311954 if (rehash)
19321955 d_rehash(rehash);
1933− if (test_bit(AFS_VNODE_DIR_VALID, &orig_dvnode->flags))
1934− afs_edit_dir_remove(orig_dvnode, &old_dentry->d_name,
1935− afs_edit_dir_for_rename_0);
1956+ down_write(&orig_dvnode->validate_lock);
1957+ if (test_bit(AFS_VNODE_DIR_VALID, &orig_dvnode->flags) &&
1958+ orig_dvnode->status.data_version == orig_data_version)
1959+ afs_edit_dir_remove(orig_dvnode, &old_dentry->d_name,
1960+ afs_edit_dir_for_rename_0);
1961+ if (orig_dvnode != new_dvnode) {
1962+ up_write(&orig_dvnode->validate_lock);
19361963
1937− if (!new_negative &&
1938− test_bit(AFS_VNODE_DIR_VALID, &new_dvnode->flags))
1939− afs_edit_dir_remove(new_dvnode, &new_dentry->d_name,
1940− afs_edit_dir_for_rename_1);
1964+ down_write(&new_dvnode->validate_lock);
1965+ }
1966+ if (test_bit(AFS_VNODE_DIR_VALID, &new_dvnode->flags) &&
1967+ orig_dvnode->status.data_version == new_data_version) {
1968+ if (!new_negative)
1969+ afs_edit_dir_remove(new_dvnode, &new_dentry->d_name,
1970+ afs_edit_dir_for_rename_1);
19411971
1942− if (test_bit(AFS_VNODE_DIR_VALID, &new_dvnode->flags))
19431972 afs_edit_dir_add(new_dvnode, &new_dentry->d_name,
19441973 &vnode->fid, afs_edit_dir_for_rename_2);
1974+ }
19451975
19461976 new_inode = d_inode(new_dentry);
19471977 if (new_inode) {
@@ -1957,14 +1987,10 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, · 9 unmodified lines
19571987 * Note that if we ever implement RENAME_EXCHANGE, we'll have
19581988 * to update both dentries with opposing dir versions.
19591989 */
1960− if (new_dvnode != orig_dvnode) {
1961− afs_update_dentry_version(&fc, old_dentry, &scb[1]);
1962− afs_update_dentry_version(&fc, new_dentry, &scb[1]);
1963− } else {
1964− afs_update_dentry_version(&fc, old_dentry, &scb[0]);
1965− afs_update_dentry_version(&fc, new_dentry, &scb[0]);
1966− }
1990+ afs_update_dentry_version(&fc, old_dentry, &scb[1]);
1991+ afs_update_dentry_version(&fc, new_dentry, &scb[1]);
19671992 d_move(old_dentry, new_dentry);
1993+ up_write(&new_dvnode->validate_lock);
19681994 goto error_tmp;
19691995 }
19701996
fs/afs/dir_silly.c+15−7
@@ -21,6 +21,7 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode · 20 unmodified lines
2121 {
2222 struct afs_fs_cursor fc;
2323 struct afs_status_cb *scb;
24+ afs_dataversion_t dir_data_version;
2425 int ret = -ERESTARTSYS;
2526
2627 _enter("%pd,%pd", old, new);
@@ -31,7 +32,7 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode · 4 unmodified lines
3132
3233 trace_afs_silly_rename(vnode, false);
3334 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) {
34− afs_dataversion_t dir_data_version = dvnode->status.data_version + 1;
35+ dir_data_version = dvnode->status.data_version + 1;
3536
3637 while (afs_select_fileserver(&fc)) {
3738 fc.cb_break = afs_calc_vnode_cb_break(dvnode);
@@ -54,12 +55,15 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode · 16 unmodified lines
5455 dvnode->silly_key = key_get(key);
5556 }
5657
57− if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
58+ down_write(&dvnode->validate_lock);
59+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
60+ dvnode->status.data_version == dir_data_version) {
5861 afs_edit_dir_remove(dvnode, &old->d_name,
5962 afs_edit_dir_for_silly_0);
60− if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
6163 afs_edit_dir_add(dvnode, &new->d_name,
6264 &vnode->fid, afs_edit_dir_for_silly_1);
65+ }
66+ up_write(&dvnode->validate_lock);
6367 }
6468
6569 kfree(scb);
@@ -181,10 +185,14 @@ static int afs_do_silly_unlink(struct afs_vnode *dvnode, struct afs_vnode *vnode · 115 unmodified lines
181185 clear_bit(AFS_VNODE_CB_PROMISED, &vnode->flags);
182186 }
183187 }
184− if (ret == 0 &&
185− test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags))
186− afs_edit_dir_remove(dvnode, &dentry->d_name,
187− afs_edit_dir_for_unlink);
188+ if (ret == 0) {
189+ down_write(&dvnode->validate_lock);
190+ if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) &&
191+ dvnode->status.data_version == dir_data_version)
192+ afs_edit_dir_remove(dvnode, &dentry->d_name,
193+ afs_edit_dir_for_unlink);
194+ up_write(&dvnode->validate_lock);
195+ }
188196 }
189197
190198 kfree(scb);
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/fsclient.c+16−11
@@ -65,6 +65,7 @@ static int xdr_decode_AFSFetchStatus(const __be32 **_bp, · 64 unmodified lines
6565 bool inline_error = (call->operation_ID == afs_FS_InlineBulkStatus);
6666 u64 data_version, size;
6767 u32 type, abort_code;
68+ int ret;
6869
6970 abort_code = ntohl(xdr->abort_code);
7071
@@ -78,7 +79,7 @@ static int xdr_decode_AFSFetchStatus(const __be32 **_bp, · 7 unmodified lines
7879 */
7980 status->abort_code = abort_code;
8081 scb->have_error = true;
81− return 0;
82+ goto good;
8283 }
8384
8485 pr_warn("Unknown AFSFetchStatus version %u\n", ntohl(xdr->if_version));
@@ -87,7 +88,8 @@ static int xdr_decode_AFSFetchStatus(const __be32 **_bp, · 2 unmodified lines
8788
8889 if (abort_code != 0 && inline_error) {
8990 status->abort_code = abort_code;
90− return 0;
91+ scb->have_error = true;
92+ goto good;
9193 }
9294
9395 type = ntohl(xdr->type);
@@ -123,13 +125,16 @@ static int xdr_decode_AFSFetchStatus(const __be32 **_bp, · 29 unmodified lines
123125 data_version |= (u64)ntohl(xdr->data_version_hi) << 32;
124126 status->data_version = data_version;
125127 scb->have_status = true;
126−
128+good:
129+ ret = 0;
130+advance:
127131 *_bp = (const void *)*_bp + sizeof(*xdr);
128− return 0;
132+ return ret;
129133
130134 bad:
131135 xdr_dump_bad(*_bp);
132− return afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status);
136+ ret = afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status);
137+ goto advance;
133138 }
134139
135140 static time64_t xdr_decode_expiry(struct afs_call *call, u32 expiry)
@@ -981,16 +986,16 @@ static int afs_deliver_fs_rename(struct afs_call *call) · 845 unmodified lines
981986 if (ret < 0)
982987 return ret;
983988
984− /* unmarshall the reply once we've received all of it */
989+ /* If the two dirs are the same, we have two copies of the same status
990+ * report, so we just decode it twice.
991+ */
985992 bp = call->buffer;
986993 ret = xdr_decode_AFSFetchStatus(&bp, call, call->out_dir_scb);
987994 if (ret < 0)
988995 return ret;
989− if (call->out_dir_scb != call->out_scb) {
990− ret = xdr_decode_AFSFetchStatus(&bp, call, call->out_scb);
991− if (ret < 0)
992− return ret;
993− }
996+ ret = xdr_decode_AFSFetchStatus(&bp, call, call->out_scb);
997+ if (ret < 0)
998+ return ret;
994999 xdr_decode_AFSVolSync(&bp, call->out_volsync);
9951000
9961001 _leave(" = 0 [done]");
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/afs/yfsclient.c+14−12
@@ -165,15 +165,15 @@ static void xdr_dump_bad(const __be32 *bp) · 164 unmodified lines
165165 int i;
166166
167167 pr_notice("YFS XDR: Bad status record\n");
168− for (i = 0; i < 5 * 4 * 4; i += 16) {
168+ for (i = 0; i < 6 * 4 * 4; i += 16) {
169169 memcpy(x, bp, 16);
170170 bp += 4;
171171 pr_notice("%03x: %08x %08x %08x %08x\n",
172172 i, ntohl(x[0]), ntohl(x[1]), ntohl(x[2]), ntohl(x[3]));
173173 }
174174
175− memcpy(x, bp, 4);
176− pr_notice("0x50: %08x\n", ntohl(x[0]));
175+ memcpy(x, bp, 8);
176+ pr_notice("0x60: %08x %08x\n", ntohl(x[0]), ntohl(x[1]));
177177 }
178178
179179 /*
@@ -186,13 +186,14 @@ static int xdr_decode_YFSFetchStatus(const __be32 **_bp, · 6 unmodified lines
186186 const struct yfs_xdr_YFSFetchStatus *xdr = (const void *)*_bp;
187187 struct afs_file_status *status = &scb->status;
188188 u32 type;
189+ int ret;
189190
190191 status->abort_code = ntohl(xdr->abort_code);
191192 if (status->abort_code != 0) {
192193 if (status->abort_code == VNOVNODE)
193194 status->nlink = 0;
194195 scb->have_error = true;
195− return 0;
196+ goto good;
196197 }
197198
198199 type = ntohl(xdr->type);
@@ -220,13 +221,16 @@ static int xdr_decode_YFSFetchStatus(const __be32 **_bp, · 21 unmodified lines
220221 status->size = xdr_to_u64(xdr->size);
221222 status->data_version = xdr_to_u64(xdr->data_version);
222223 scb->have_status = true;
223−
224+good:
225+ ret = 0;
226+advance:
224227 *_bp += xdr_size(xdr);
225− return 0;
228+ return ret;
226229
227230 bad:
228231 xdr_dump_bad(*_bp);
229− return afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status);
232+ ret = afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status);
233+ goto advance;
230234 }
231235
232236 /*
@@ -1153,11 +1157,9 @@ static int yfs_deliver_fs_rename(struct afs_call *call) · 920 unmodified lines
11531157 ret = xdr_decode_YFSFetchStatus(&bp, call, call->out_dir_scb);
11541158 if (ret < 0)
11551159 return ret;
1156− if (call->out_dir_scb != call->out_scb) {
1157− ret = xdr_decode_YFSFetchStatus(&bp, call, call->out_scb);
1158− if (ret < 0)
1159− return ret;
1160− }
1160+ ret = xdr_decode_YFSFetchStatus(&bp, call, call->out_scb);
1161+ if (ret < 0)
1162+ return ret;
11611163
11621164 xdr_decode_YFSVolSync(&bp, call->out_volsync);
11631165 _leave(" = 0 [done]");
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+15−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 }
@@ -3370,6 +3378,7 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info) · 2071 unmodified lines
33703378 space_info->bytes_reserved > 0 ||
33713379 space_info->bytes_may_use > 0))
33723380 btrfs_dump_space_info(info, space_info, 0, 0);
3381+ WARN_ON(space_info->reclaim_size > 0);
33733382 list_del(&space_info->list);
33743383 btrfs_sysfs_remove_space_info(space_info);
33753384 }
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/file.c+15−0
@@ -2097,6 +2097,21 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) · 2096 unmodified lines
20972097
20982098 atomic_inc(&root->log_batch);
20992099
2100+ /*
2101+ * If the inode needs a full sync, make sure we use a full range to
2102+ * avoid log tree corruption, due to hole detection racing with ordered
2103+ * extent completion for adjacent ranges and races between logging and
2104+ * completion of ordered extents for adjancent ranges - both races
2105+ * could lead to file extent items in the log with overlapping ranges.
2106+ * Do this while holding the inode lock, to avoid races with other
2107+ * tasks.
2108+ */
2109+ if (test_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
2110+ &BTRFS_I(inode)->runtime_flags)) {
2111+ start = 0;
2112+ end = LLONG_MAX;
2113+ }
2114+
21002115 /*
21012116 * Before we acquired the inode's lock, someone may have dirtied more
21022117 * pages in the target range. We need to make sure that writeback for
fs/btrfs/reflink.c+1−0
@@ -264,6 +264,7 @@ copy_inline_extent: · 263 unmodified lines
264264 size);
265265 inode_add_bytes(dst, datal);
266266 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(dst)->runtime_flags);
267+ ret = btrfs_inode_set_file_extent_range(BTRFS_I(dst), 0, aligned_end);
267268 out:
268269 if (!ret && !trans) {
269270 /*
fs/btrfs/relocation.c+20−4
@@ -611,8 +611,8 @@ static int should_ignore_root(struct btrfs_root *root) · 610 unmodified lines
611611 if (!reloc_root)
612612 return 0;
613613
614− if (btrfs_root_last_snapshot(&reloc_root->root_item) ==
615− root->fs_info->running_transaction->transid - 1)
614+ if (btrfs_header_generation(reloc_root->commit_root) ==
615+ root->fs_info->running_transaction->transid)
616616 return 0;
617617 /*
618618 * if there is reloc tree and it was created in previous
@@ -1527,8 +1527,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans, · 908 unmodified lines
15271527 int clear_rsv = 0;
15281528 int ret;
15291529
1530− if (!rc || !rc->create_reloc_tree ||
1531− root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID)
1530+ if (!rc)
15321531 return 0;
15331532
15341533 /*
@@ -1538,12 +1537,28 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans, · 3 unmodified lines
15381537 if (reloc_root_is_dead(root))
15391538 return 0;
15401539
1540+ /*
1541+ * This is subtle but important. We do not do
1542+ * record_root_in_transaction for reloc roots, instead we record their
1543+ * corresponding fs root, and then here we update the last trans for the
1544+ * reloc root. This means that we have to do this for the entire life
1545+ * of the reloc root, regardless of which stage of the relocation we are
1546+ * in.
1547+ */
15411548 if (root->reloc_root) {
15421549 reloc_root = root->reloc_root;
15431550 reloc_root->last_trans = trans->transid;
15441551 return 0;
15451552 }
15461553
1554+ /*
1555+ * We are merging reloc roots, we do not need new reloc trees. Also
1556+ * reloc trees never need their own reloc tree.
1557+ */
1558+ if (!rc->create_reloc_tree ||
1559+ root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID)
1560+ return 0;
1561+
15471562 if (!trans->reloc_reserved) {
15481563 rsv = trans->block_rsv;
15491564 trans->block_rsv = rc->block_rsv;
@@ -4544,6 +4559,7 @@ int btrfs_recover_relocation(struct btrfs_root *root) · 2994 unmodified lines
45444559 if (IS_ERR(fs_root)) {
45454560 err = PTR_ERR(fs_root);
45464561 list_add_tail(&reloc_root->root_list, &reloc_roots);
4562+ btrfs_end_transaction(trans);
45474563 goto out_unset;
45484564 }
45494565
fs/btrfs/space-info.c+14−6
@@ -361,6 +361,16 @@ int btrfs_can_overcommit(struct btrfs_fs_info *fs_info, · 360 unmodified lines
361361 return 0;
362362 }
363363
364+static void remove_ticket(struct btrfs_space_info *space_info,
365+ struct reserve_ticket *ticket)
366+{
367+ if (!list_empty(&ticket->list)) {
368+ list_del_init(&ticket->list);
369+ ASSERT(space_info->reclaim_size >= ticket->bytes);
370+ space_info->reclaim_size -= ticket->bytes;
371+ }
372+}
373+
364374 /*
365375 * This is for space we already have accounted in space_info->bytes_may_use, so
366376 * basically when we're returning space from block_rsv's.
@@ -388,9 +398,7 @@ again: · 21 unmodified lines
388398 btrfs_space_info_update_bytes_may_use(fs_info,
389399 space_info,
390400 ticket->bytes);
391− list_del_init(&ticket->list);
392− ASSERT(space_info->reclaim_size >= ticket->bytes);
393− space_info->reclaim_size -= ticket->bytes;
401+ remove_ticket(space_info, ticket);
394402 ticket->bytes = 0;
395403 space_info->tickets_id++;
396404 wake_up(&ticket->wait);
@@ -899,7 +907,7 @@ static bool maybe_fail_all_tickets(struct btrfs_fs_info *fs_info, · 502 unmodified lines
899907 btrfs_info(fs_info, "failing ticket with %llu bytes",
900908 ticket->bytes);
901909
902− list_del_init(&ticket->list);
910+ remove_ticket(space_info, ticket);
903911 ticket->error = -ENOSPC;
904912 wake_up(&ticket->wait);
905913
@@ -1063,7 +1071,7 @@ static void wait_reserve_ticket(struct btrfs_fs_info *fs_info, · 157 unmodified lines
10631071 * despite getting an error, resulting in a space leak
10641072 * (bytes_may_use counter of our space_info).
10651073 */
1066− list_del_init(&ticket->list);
1074+ remove_ticket(space_info, ticket);
10671075 ticket->error = -EINTR;
10681076 break;
10691077 }
@@ -1121,7 +1129,7 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info, · 51 unmodified lines
11211129 * either the async reclaim job deletes the ticket from the list
11221130 * or we delete it ourselves at wait_reserve_ticket().
11231131 */
1124− list_del_init(&ticket->list);
1132+ remove_ticket(space_info, ticket);
11251133 if (!ret)
11261134 ret = -ENOSPC;
11271135 }
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+54−82
@@ -96,8 +96,8 @@ enum { · 95 unmodified lines
9696 static int btrfs_log_inode(struct btrfs_trans_handle *trans,
9797 struct btrfs_root *root, struct btrfs_inode *inode,
9898 int inode_only,
99− u64 start,
100− u64 end,
99+ const loff_t start,
100+ const loff_t end,
101101 struct btrfs_log_ctx *ctx);
102102 static int link_to_fixup_dir(struct btrfs_trans_handle *trans,
103103 struct btrfs_root *root,
@@ -4226,6 +4226,9 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans, · 4122 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)
@@ -4533,15 +4570,13 @@ static int btrfs_log_all_xattrs(struct btrfs_trans_handle *trans, · 246 unmodified lines
45334570 static int btrfs_log_holes(struct btrfs_trans_handle *trans,
45344571 struct btrfs_root *root,
45354572 struct btrfs_inode *inode,
4536− struct btrfs_path *path,
4537− const u64 start,
4538− const u64 end)
4573+ struct btrfs_path *path)
45394574 {
45404575 struct btrfs_fs_info *fs_info = root->fs_info;
45414576 struct btrfs_key key;
45424577 const u64 ino = btrfs_ino(inode);
45434578 const u64 i_size = i_size_read(&inode->vfs_inode);
4544− u64 prev_extent_end = start;
4579+ u64 prev_extent_end = 0;
45454580 int ret;
45464581
45474582 if (!btrfs_fs_incompat(fs_info, NO_HOLES) || i_size == 0)
@@ -4549,21 +4584,14 @@ static int btrfs_log_holes(struct btrfs_trans_handle *trans, · 1 unmodified line
45494584
45504585 key.objectid = ino;
45514586 key.type = BTRFS_EXTENT_DATA_KEY;
4552− key.offset = start;
4587+ key.offset = 0;
45534588
45544589 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
45554590 if (ret < 0)
45564591 return ret;
45574592
4558− if (ret > 0 && path->slots[0] > 0) {
4559− btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0] - 1);
4560− if (key.objectid == ino && key.type == BTRFS_EXTENT_DATA_KEY)
4561− path->slots[0]--;
4562− }
4563−
45644593 while (true) {
45654594 struct extent_buffer *leaf = path->nodes[0];
4566− u64 extent_end;
45674595
45684596 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) {
45694597 ret = btrfs_next_leaf(root, path);
@@ -4580,18 +4608,9 @@ static int btrfs_log_holes(struct btrfs_trans_handle *trans, · 10 unmodified lines
45804608 if (key.objectid != ino || key.type != BTRFS_EXTENT_DATA_KEY)
45814609 break;
45824610
4583− extent_end = btrfs_file_extent_end(path);
4584− if (extent_end <= start)
4585− goto next_slot;
4586−
45874611 /* We have a hole, log it. */
45884612 if (prev_extent_end < key.offset) {
4589− u64 hole_len;
4590−
4591− if (key.offset >= end)
4592− hole_len = end - prev_extent_end;
4593− else
4594− hole_len = key.offset - prev_extent_end;
4613+ const u64 hole_len = key.offset - prev_extent_end;
45954614
45964615 /*
45974616 * Release the path to avoid deadlocks with other code
@@ -4621,20 +4640,16 @@ static int btrfs_log_holes(struct btrfs_trans_handle *trans, · 23 unmodified lines
46214640 leaf = path->nodes[0];
46224641 }
46234642
4624− prev_extent_end = min(extent_end, end);
4625− if (extent_end >= end)
4626− break;
4627−next_slot:
4643+ prev_extent_end = btrfs_file_extent_end(path);
46284644 path->slots[0]++;
46294645 cond_resched();
46304646 }
46314647
4632− if (prev_extent_end < end && prev_extent_end < i_size) {
4648+ if (prev_extent_end < i_size) {
46334649 u64 hole_len;
46344650
46354651 btrfs_release_path(path);
4636− hole_len = min(ALIGN(i_size, fs_info->sectorsize), end);
4637− hole_len -= prev_extent_end;
4652+ hole_len = ALIGN(i_size - prev_extent_end, fs_info->sectorsize);
46384653 ret = btrfs_insert_file_extent(trans, root->log_root,
46394654 ino, prev_extent_end, 0, 0,
46404655 hole_len, 0, hole_len,
@@ -4971,8 +4986,6 @@ static int copy_inode_items_to_log(struct btrfs_trans_handle *trans, · 330 unmodified lines
49714986 const u64 logged_isize,
49724987 const bool recursive_logging,
49734988 const int inode_only,
4974− const u64 start,
4975− const u64 end,
49764989 struct btrfs_log_ctx *ctx,
49774990 bool *need_log_inode_item)
49784991 {
@@ -4981,21 +4994,6 @@ static int copy_inode_items_to_log(struct btrfs_trans_handle *trans, · 2 unmodified lines
49814994 int ins_nr = 0;
49824995 int ret;
49834996
4984− /*
4985− * We must make sure we don't copy extent items that are entirely out of
4986− * the range [start, end - 1]. This is not just an optimization to avoid
4987− * copying but also needed to avoid a corruption where we end up with
4988− * file extent items in the log tree that have overlapping ranges - this
4989− * can happen if we race with ordered extent completion for ranges that
4990− * are outside our target range. For example we copy an extent item and
4991− * when we move to the next leaf, that extent was trimmed and a new one
4992− * covering a subrange of it, but with a higher key, was inserted - we
4993− * would then copy this other extent too, resulting in a log tree with
4994− * 2 extent items that represent overlapping ranges.
4995− *
4996− * We can copy the entire extents at the range bondaries however, even
4997− * if they cover an area outside the target range. That's ok.
4998− */
49994997 while (1) {
50004998 ret = btrfs_search_forward(root, min_key, path, trans->transid);
50014999 if (ret < 0)
@@ -5063,29 +5061,6 @@ again: · 61 unmodified lines
50635061 goto next_slot;
50645062 }
50655063
5066− if (min_key->type == BTRFS_EXTENT_DATA_KEY) {
5067− const u64 extent_end = btrfs_file_extent_end(path);
5068−
5069− if (extent_end <= start) {
5070− if (ins_nr > 0) {
5071− ret = copy_items(trans, inode, dst_path,
5072− path, ins_start_slot,
5073− ins_nr, inode_only,
5074− logged_isize);
5075− if (ret < 0)
5076− return ret;
5077− ins_nr = 0;
5078− }
5079− goto next_slot;
5080− }
5081− if (extent_end >= end) {
5082− ins_nr++;
5083− if (ins_nr == 1)
5084− ins_start_slot = path->slots[0];
5085− break;
5086− }
5087− }
5088−
50895064 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) {
50905065 ins_nr++;
50915066 goto next_slot;
@@ -5151,8 +5126,8 @@ next_key: · 59 unmodified lines
51515126 static int btrfs_log_inode(struct btrfs_trans_handle *trans,
51525127 struct btrfs_root *root, struct btrfs_inode *inode,
51535128 int inode_only,
5154− u64 start,
5155− u64 end,
5129+ const loff_t start,
5130+ const loff_t end,
51565131 struct btrfs_log_ctx *ctx)
51575132 {
51585133 struct btrfs_fs_info *fs_info = root->fs_info;
@@ -5180,9 +5155,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, · 21 unmodified lines
51805155 return -ENOMEM;
51815156 }
51825157
5183− start = ALIGN_DOWN(start, fs_info->sectorsize);
5184− end = ALIGN(end, fs_info->sectorsize);
5185−
51865158 min_key.objectid = ino;
51875159 min_key.type = BTRFS_INODE_ITEM_KEY;
51885160 min_key.offset = 0;
@@ -5298,8 +5270,8 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, · 109 unmodified lines
52985270
52995271 err = copy_inode_items_to_log(trans, inode, &min_key, &max_key,
53005272 path, dst_path, logged_isize,
5301− recursive_logging, inode_only,
5302− start, end, ctx, &need_log_inode_item);
5273+ recursive_logging, inode_only, ctx,
5274+ &need_log_inode_item);
53035275 if (err)
53045276 goto out_unlock;
53055277
@@ -5312,7 +5284,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, · 6 unmodified lines
53125284 if (max_key.type >= BTRFS_EXTENT_DATA_KEY && !fast_search) {
53135285 btrfs_release_path(path);
53145286 btrfs_release_path(dst_path);
5315− err = btrfs_log_holes(trans, root, inode, path, start, end);
5287+ err = btrfs_log_holes(trans, root, inode, path);
53165288 if (err)
53175289 goto out_unlock;
53185290 }
fs/buffer.c+12−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;
@@ -1371,6 +1371,17 @@ void __breadahead(struct block_device *bdev, sector_t block, unsigned size) · 397 unmodified lines
13711371 }
13721372 EXPORT_SYMBOL(__breadahead);
13731373
1374+void __breadahead_gfp(struct block_device *bdev, sector_t block, unsigned size,
1375+ gfp_t gfp)
1376+{
1377+ struct buffer_head *bh = __getblk_gfp(bdev, block, size, gfp);
1378+ if (likely(bh)) {
1379+ ll_rw_block(REQ_OP_READ, REQ_RAHEAD, 1, &bh);
1380+ brelse(bh);
1381+ }
1382+}
1383+EXPORT_SYMBOL(__breadahead_gfp);
1384+
13741385 /**
13751386 * __bread_gfp() - reads a specified block and returns the bh
13761387 * @bdev: the block_device to read from
fs/ceph/dir.c+2−2
@@ -1051,8 +1051,8 @@ static void ceph_async_unlink_cb(struct ceph_mds_client *mdsc, · 1050 unmodified lines
10511051
10521052 /* If op failed, mark everyone involved for errors */
10531053 if (result) {
1054− int pathlen;
1055− u64 base;
1054+ int pathlen = 0;
1055+ u64 base = 0;
10561056 char *path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
10571057 &base, 0);
10581058
fs/ceph/file.c+2−2
@@ -527,8 +527,8 @@ static void ceph_async_create_cb(struct ceph_mds_client *mdsc, · 526 unmodified lines
527527
528528 if (result) {
529529 struct dentry *dentry = req->r_dentry;
530− int pathlen;
531− u64 base;
530+ int pathlen = 0;
531+ u64 base = 0;
532532 char *path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
533533 &base, 0);
534534
fs/ceph/mds_client.h+1−1
@@ -521,7 +521,7 @@ extern void ceph_mdsc_pre_umount(struct ceph_mds_client *mdsc); · 520 unmodified lines
521521
522522 static inline void ceph_mdsc_free_path(char *path, int len)
523523 {
524− if (path)
524+ if (!IS_ERR_OR_NULL(path))
525525 __putname(path - (PATH_MAX - 1 - len));
526526 }
527527
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/cifssmb.c+4−0
@@ -594,6 +594,8 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr) · 593 unmodified lines
594594 cifs_max_pending);
595595 set_credits(server, server->maxReq);
596596 server->maxBuf = le16_to_cpu(rsp->MaxBufSize);
597+ /* set up max_read for readpages check */
598+ server->max_read = server->maxBuf;
597599 /* even though we do not use raw we might as well set this
598600 accurately, in case we ever find a need for it */
599601 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {
@@ -755,6 +757,8 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses) · 155 unmodified lines
755757 set_credits(server, server->maxReq);
756758 /* probably no need to store and check maxvcs */
757759 server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
760+ /* set up max_read for readpages check */
761+ server->max_read = server->maxBuf;
758762 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
759763 cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);
760764 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
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/inode.c+1−1
@@ -61,7 +61,7 @@ static void cifs_set_ops(struct inode *inode) · 60 unmodified lines
6161 }
6262
6363 /* check if server can support readpages */
64− if (cifs_sb_master_tcon(cifs_sb)->ses->server->maxBuf <
64+ if (cifs_sb_master_tcon(cifs_sb)->ses->server->max_read <
6565 PAGE_SIZE + MAX_CIFS_HDR_SIZE)
6666 inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
6767 else
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/cifs/smb2pdu.c+15−0
@@ -1552,6 +1552,21 @@ SMB2_sess_auth_rawntlmssp_authenticate(struct SMB2_sess_data *sess_data) · 1551 unmodified lines
15521552 }
15531553
15541554 rc = SMB2_sess_establish_session(sess_data);
1555+#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
1556+ if (ses->server->dialect < SMB30_PROT_ID) {
1557+ cifs_dbg(VFS, "%s: dumping generated SMB2 session keys\n", __func__);
1558+ /*
1559+ * The session id is opaque in terms of endianness, so we can't
1560+ * print it as a long long. we dump it as we got it on the wire
1561+ */
1562+ cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid),
1563+ &ses->Suid);
1564+ cifs_dbg(VFS, "Session Key %*ph\n",
1565+ SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response);
1566+ cifs_dbg(VFS, "Signing Key %*ph\n",
1567+ SMB3_SIGN_KEY_SIZE, ses->auth_key.response);
1568+ }
1569+#endif
15551570 out:
15561571 kfree(ntlmssp_blob);
15571572 SMB2_sess_free_buffer(sess_data);
fs/cifs/smb2transport.c+2−2
@@ -660,8 +660,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 659 unmodified lines
660660 return rc;
661661
662662 if (memcmp(server_response_sig, shdr->Signature, SMB2_SIGNATURE_SIZE)) {
663− dump_stack();
664− cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n", shdr->Command, shdr->MessageId);
663+ cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n",
664+ shdr->Command, shdr->MessageId);
665665 return -EACCES;
666666 } else
667667 return 0;
fs/coredump.c+2−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
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/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/ext4/balloc.c+2−2
@@ -410,7 +410,7 @@ verified: · 409 unmodified lines
410410 * Read the bitmap for a given block_group,and validate the
411411 * bits for block/inode/inode tables are set in the bitmaps
412412 *
413− * Return buffer_head on success or NULL in case of failure.
413+ * Return buffer_head on success or an ERR_PTR in case of failure.
414414 */
415415 struct buffer_head *
416416 ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group)
@@ -502,7 +502,7 @@ out: · 85 unmodified lines
502502 return ERR_PTR(err);
503503 }
504504
505−/* Returns 0 on success, 1 on error */
505+/* Returns 0 on success, -errno on error */
506506 int ext4_wait_block_bitmap(struct super_block *sb, ext4_group_t block_group,
507507 struct buffer_head *bh)
508508 {
fs/ext4/ext4_jbd2.c+0−3
@@ -338,9 +338,6 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, · 337 unmodified lines
338338 if (inode && inode_needs_sync(inode)) {
339339 sync_dirty_buffer(bh);
340340 if (buffer_req(bh) && !buffer_uptodate(bh)) {
341− struct ext4_super_block *es;
342−
343− es = EXT4_SB(inode->i_sb)->s_es;
344341 ext4_error_inode_err(inode, where, line,
345342 bh->b_blocknr, EIO,
346343 "IO error syncing itable block");
fs/ext4/extents.c+4−4
@@ -3374,8 +3374,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, · 3373 unmodified lines
33743374 (unsigned long long)map->m_lblk, map_len);
33753375
33763376 sbi = EXT4_SB(inode->i_sb);
3377− eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
3378− inode->i_sb->s_blocksize_bits;
3377+ eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
3378+ >> inode->i_sb->s_blocksize_bits;
33793379 if (eof_block < map->m_lblk + map_len)
33803380 eof_block = map->m_lblk + map_len;
33813381
@@ -3627,8 +3627,8 @@ static int ext4_split_convert_extents(handle_t *handle, · 245 unmodified lines
36273627 __func__, inode->i_ino,
36283628 (unsigned long long)map->m_lblk, map->m_len);
36293629
3630− eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
3631− inode->i_sb->s_blocksize_bits;
3630+ eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
3631+ >> inode->i_sb->s_blocksize_bits;
36323632 if (eof_block < map->m_lblk + map->m_len)
36333633 eof_block = map->m_lblk + map->m_len;
36343634 /*
fs/ext4/ialloc.c+2−2
@@ -113,7 +113,7 @@ verified: · 112 unmodified lines
113113 * Read the inode allocation bitmap for a given block_group, reading
114114 * into the specified slot in the superblock's bitmap cache.
115115 *
116− * Return buffer_head of bitmap on success or NULL.
116+ * Return buffer_head of bitmap on success, or an ERR_PTR on error.
117117 */
118118 static struct buffer_head *
119119 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
@@ -662,7 +662,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent, · 542 unmodified lines
662662 * block has been written back to disk. (Yes, these values are
663663 * somewhat arbitrary...)
664664 */
665−#define RECENTCY_MIN 5
665+#define RECENTCY_MIN 60
666666 #define RECENTCY_DIRTY 300
667667
668668 static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)
fs/ext4/inode.c+2−2
@@ -1973,7 +1973,7 @@ static int ext4_writepage(struct page *page, · 1972 unmodified lines
19731973 bool keep_towrite = false;
19741974
19751975 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) {
1976− ext4_invalidatepage(page, 0, PAGE_SIZE);
1976+ inode->i_mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
19771977 unlock_page(page);
19781978 return -EIO;
19791979 }
@@ -4364,7 +4364,7 @@ make_io: · 2384 unmodified lines
43644364 if (end > table)
43654365 end = table;
43664366 while (b <= end)
4367− sb_breadahead(sb, b++);
4367+ sb_breadahead_unmovable(sb, b++);
43684368 }
43694369
43704370 /*
fs/ext4/mballoc.c+4−2
@@ -1943,7 +1943,8 @@ void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac, · 1942 unmodified lines
19431943 int free;
19441944
19451945 free = e4b->bd_info->bb_free;
1946− BUG_ON(free <= 0);
1946+ if (WARN_ON(free <= 0))
1947+ return;
19471948
19481949 i = e4b->bd_info->bb_first_free;
19491950
@@ -1966,7 +1967,8 @@ void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac, · 16 unmodified lines
19661967 }
19671968
19681969 mb_find_extent(e4b, i, ac->ac_g_ex.fe_len, &ex);
1969− BUG_ON(ex.fe_len <= 0);
1970+ if (WARN_ON(ex.fe_len <= 0))
1971+ break;
19701972 if (free < ex.fe_len) {
19711973 ext4_grp_locked_error(sb, e4b->bd_group, 0, 0,
19721974 "%d free clusters as per "
fs/ext4/super.c+1−3
@@ -596,7 +596,6 @@ void __ext4_error_file(struct file *file, const char *function, · 595 unmodified lines
596596 {
597597 va_list args;
598598 struct va_format vaf;
599− struct ext4_super_block *es;
600599 struct inode *inode = file_inode(file);
601600 char pathname[80], *path;
602601
@@ -604,7 +603,6 @@ void __ext4_error_file(struct file *file, const char *function, · 1 unmodified line
604603 return;
605604
606605 trace_ext4_error(inode->i_sb, function, line);
607− es = EXT4_SB(inode->i_sb)->s_es;
608606 if (ext4_error_ratelimit(inode->i_sb)) {
609607 path = file_path(file, pathname, sizeof(pathname));
610608 if (IS_ERR(path))
@@ -4340,7 +4338,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) · 3729 unmodified lines
43404338 /* Pre-read the descriptors into the buffer cache */
43414339 for (i = 0; i < db_count; i++) {
43424340 block = descriptor_loc(sb, logical_sb_block, i);
4343− sb_breadahead(sb, block);
4341+ sb_breadahead_unmovable(sb, block);
43444342 }
43454343
43464344 for (i = 0; i < db_count; i++) {
fs/io_uring.c+192−165
@@ -357,7 +357,6 @@ struct io_timeout_data { · 356 unmodified lines
357357 struct hrtimer timer;
358358 struct timespec64 ts;
359359 enum hrtimer_mode mode;
360− u32 seq_offset;
361360 };
362361
363362 struct io_accept {
@@ -385,7 +384,7 @@ struct io_timeout { · 21 unmodified lines
385384 struct file *file;
386385 u64 addr;
387386 int flags;
388− unsigned count;
387+ u32 count;
389388 };
390389
391390 struct io_rw {
@@ -508,6 +507,7 @@ enum { · 116 unmodified lines
508507 REQ_F_FORCE_ASYNC_BIT = IOSQE_ASYNC_BIT,
509508 REQ_F_BUFFER_SELECT_BIT = IOSQE_BUFFER_SELECT_BIT,
510509
510+ REQ_F_LINK_HEAD_BIT,
511511 REQ_F_LINK_NEXT_BIT,
512512 REQ_F_FAIL_LINK_BIT,
513513 REQ_F_INFLIGHT_BIT,
@@ -524,6 +524,7 @@ enum { · 10 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,
@@ -543,6 +544,8 @@ enum { · 13 unmodified lines
543544 /* IOSQE_BUFFER_SELECT */
544545 REQ_F_BUFFER_SELECT = BIT(REQ_F_BUFFER_SELECT_BIT),
545546
547+ /* head of a link */
548+ REQ_F_LINK_HEAD = BIT(REQ_F_LINK_HEAD_BIT),
546549 /* already grabbed next link */
547550 REQ_F_LINK_NEXT = BIT(REQ_F_LINK_NEXT_BIT),
548551 /* fail rest of links */
@@ -575,6 +578,8 @@ enum { · 26 unmodified lines
575578 REQ_F_POLLED = BIT(REQ_F_POLLED_BIT),
576579 /* buffer already selected */
577580 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),
578583 };
579584
580585 struct async_poll {
@@ -797,6 +802,7 @@ static const struct io_op_def io_op_defs[] = { · 216 unmodified lines
797802 .needs_file = 1,
798803 .fd_non_neg = 1,
799804 .needs_fs = 1,
805+ .file_table = 1,
800806 },
801807 [IORING_OP_READ] = {
802808 .needs_mm = 1,
@@ -955,8 +961,8 @@ static inline bool __req_need_defer(struct io_kiocb *req) · 152 unmodified lines
955961 {
956962 struct io_ring_ctx *ctx = req->ctx;
957963
958− return req->sequence != ctx->cached_cq_tail + ctx->cached_sq_dropped
959− + atomic_read(&ctx->cached_cq_overflow);
964+ return req->sequence != ctx->cached_cq_tail
965+ + atomic_read(&ctx->cached_cq_overflow);
960966 }
961967
962968 static inline bool req_need_defer(struct io_kiocb *req)
@@ -1289,7 +1295,7 @@ static struct io_kiocb *io_get_fallback_req(struct io_ring_ctx *ctx) · 326 unmodified lines
12891295 struct io_kiocb *req;
12901296
12911297 req = ctx->fallback_req;
1292− if (!test_and_set_bit_lock(0, (unsigned long *) ctx->fallback_req))
1298+ if (!test_and_set_bit_lock(0, (unsigned long *) &ctx->fallback_req))
12931299 return req;
12941300
12951301 return NULL;
@@ -1376,7 +1382,7 @@ static void __io_free_req(struct io_kiocb *req) · 80 unmodified lines
13761382 if (likely(!io_is_fallback_req(req)))
13771383 kmem_cache_free(req_cachep, req);
13781384 else
1379− clear_bit_unlock(0, (unsigned long *) req->ctx->fallback_req);
1385+ clear_bit_unlock(0, (unsigned long *) &req->ctx->fallback_req);
13801386 }
13811387
13821388 struct req_batch {
@@ -1437,7 +1443,7 @@ static bool io_link_cancel_timeout(struct io_kiocb *req) · 54 unmodified lines
14371443 if (ret != -1) {
14381444 io_cqring_fill_event(req, -ECANCELED);
14391445 io_commit_cqring(ctx);
1440− req->flags &= ~REQ_F_LINK;
1446+ req->flags &= ~REQ_F_LINK_HEAD;
14411447 io_put_req(req);
14421448 return true;
14431449 }
@@ -1473,7 +1479,7 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr) · 29 unmodified lines
14731479
14741480 list_del_init(&req->link_list);
14751481 if (!list_empty(&nxt->link_list))
1476− nxt->flags |= REQ_F_LINK;
1482+ nxt->flags |= REQ_F_LINK_HEAD;
14771483 *nxtptr = nxt;
14781484 break;
14791485 }
@@ -1484,7 +1490,7 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr) · 4 unmodified lines
14841490 }
14851491
14861492 /*
1487− * Called if REQ_F_LINK is set, and we fail the head request
1493+ * Called if REQ_F_LINK_HEAD is set, and we fail the head request
14881494 */
14891495 static void io_fail_links(struct io_kiocb *req)
14901496 {
@@ -1517,7 +1523,7 @@ static void io_fail_links(struct io_kiocb *req) · 26 unmodified lines
15171523
15181524 static void io_req_find_next(struct io_kiocb *req, struct io_kiocb **nxt)
15191525 {
1520− if (likely(!(req->flags & REQ_F_LINK)))
1526+ if (likely(!(req->flags & REQ_F_LINK_HEAD)))
15211527 return;
15221528
15231529 /*
@@ -1669,7 +1675,7 @@ static inline unsigned int io_sqring_entries(struct io_ring_ctx *ctx) · 145 unmodified lines
16691675
16701676 static inline bool io_req_multi_free(struct req_batch *rb, struct io_kiocb *req)
16711677 {
1672− if ((req->flags & REQ_F_LINK) || io_is_fallback_req(req))
1678+ if ((req->flags & REQ_F_LINK_HEAD) || io_is_fallback_req(req))
16731679 return false;
16741680
16751681 if (!(req->flags & REQ_F_FIXED_FILE) || req->io)
@@ -2032,7 +2038,7 @@ static struct file *__io_file_get(struct io_submit_state *state, int fd) · 356 unmodified lines
20322038 * any file. For now, just ensure that anything potentially problematic is done
20332039 * inline.
20342040 */
2035−static bool io_file_supports_async(struct file *file)
2041+static bool io_file_supports_async(struct file *file, int rw)
20362042 {
20372043 umode_t mode = file_inode(file)->i_mode;
20382044
@@ -2041,7 +2047,13 @@ static bool io_file_supports_async(struct file *file) · 2 unmodified lines
20412047 if (S_ISREG(mode) && file->f_op != &io_uring_fops)
20422048 return true;
20432049
2044− return false;
2050+ if (!(file->f_mode & FMODE_NOWAIT))
2051+ return false;
2052+
2053+ if (rw == READ)
2054+ return file->f_op->read_iter != NULL;
2055+
2056+ return file->f_op->write_iter != NULL;
20452057 }
20462058
20472059 static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
@@ -2562,14 +2574,14 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) · 514 unmodified lines
25622574
25632575 req->result = 0;
25642576 io_size = ret;
2565− if (req->flags & REQ_F_LINK)
2577+ if (req->flags & REQ_F_LINK_HEAD)
25662578 req->result = io_size;
25672579
25682580 /*
25692581 * If the file doesn't support async, mark it as REQ_F_MUST_PUNT so
25702582 * we know to async punt it even if it was opened O_NONBLOCK
25712583 */
2572− if (force_nonblock && !io_file_supports_async(req->file))
2584+ if (force_nonblock && !io_file_supports_async(req->file, READ))
25732585 goto copy_iov;
25742586
25752587 iov_count = iov_iter_count(&iter);
@@ -2592,7 +2604,8 @@ copy_iov: · 16 unmodified lines
25922604 if (ret)
25932605 goto out_free;
25942606 /* any defer here is final, must blocking retry */
2595− if (!(req->flags & REQ_F_NOWAIT))
2607+ if (!(req->flags & REQ_F_NOWAIT) &&
2608+ !file_can_poll(req->file))
25962609 req->flags |= REQ_F_MUST_PUNT;
25972610 return -EAGAIN;
25982611 }
@@ -2653,14 +2666,14 @@ static int io_write(struct io_kiocb *req, bool force_nonblock) · 54 unmodified lines
26532666
26542667 req->result = 0;
26552668 io_size = ret;
2656− if (req->flags & REQ_F_LINK)
2669+ if (req->flags & REQ_F_LINK_HEAD)
26572670 req->result = io_size;
26582671
26592672 /*
26602673 * If the file doesn't support async, mark it as REQ_F_MUST_PUNT so
26612674 * we know to async punt it even if it was opened O_NONBLOCK
26622675 */
2663− if (force_nonblock && !io_file_supports_async(req->file))
2676+ if (force_nonblock && !io_file_supports_async(req->file, WRITE))
26642677 goto copy_iov;
26652678
26662679 /* file path doesn't support NOWAIT for non-direct_IO */
@@ -2714,7 +2727,8 @@ copy_iov: · 47 unmodified lines
27142727 if (ret)
27152728 goto out_free;
27162729 /* any defer here is final, must blocking retry */
2717− req->flags |= REQ_F_MUST_PUNT;
2730+ if (!file_can_poll(req->file))
2731+ req->flags |= REQ_F_MUST_PUNT;
27182732 return -EAGAIN;
27192733 }
27202734 }
@@ -2754,15 +2768,6 @@ static int io_splice_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) · 33 unmodified lines
27542768 return 0;
27552769 }
27562770
2757−static bool io_splice_punt(struct file *file)
2758−{
2759− if (get_pipe_info(file))
2760− return false;
2761− if (!io_file_supports_async(file))
2762− return true;
2763− return !(file->f_mode & O_NONBLOCK);
2764−}
2765−
27662771 static int io_splice(struct io_kiocb *req, bool force_nonblock)
27672772 {
27682773 struct io_splice *sp = &req->splice;
@@ -2772,11 +2777,8 @@ static int io_splice(struct io_kiocb *req, bool force_nonblock) · 3 unmodified lines
27722777 loff_t *poff_in, *poff_out;
27732778 long ret;
27742779
2775− if (force_nonblock) {
2776− if (io_splice_punt(in) || io_splice_punt(out))
2777− return -EAGAIN;
2778− flags |= SPLICE_F_NONBLOCK;
2779− }
2780+ if (force_nonblock)
2781+ return -EAGAIN;
27802782
27812783 poff_in = (sp->off_in == -1) ? NULL : &sp->off_in;
27822784 poff_out = (sp->off_out == -1) ? NULL : &sp->off_out;
@@ -3353,8 +3355,12 @@ static int io_statx(struct io_kiocb *req, bool force_nonblock) · 570 unmodified lines
33533355 struct kstat stat;
33543356 int ret;
33553357
3356− if (force_nonblock)
3358+ if (force_nonblock) {
3359+ /* only need file table for an actual valid fd */
3360+ if (ctx->dfd == -1 || ctx->dfd == AT_FDCWD)
3361+ req->flags |= REQ_F_NO_FILE_TABLE;
33573362 return -EAGAIN;
3363+ }
33583364
33593365 if (vfs_stat_set_lookup_flags(&lookup_flags, ctx->how.flags))
33603366 return -EINVAL;
@@ -3500,7 +3506,7 @@ static void io_sync_file_range_finish(struct io_wq_work **workptr) · 139 unmodified lines
35003506 if (io_req_cancelled(req))
35013507 return;
35023508 __io_sync_file_range(req);
3503− io_put_req(req); /* put submission ref */
3509+ io_steal_work(req, workptr);
35043510 }
35053511
35063512 static int io_sync_file_range(struct io_kiocb *req, bool force_nonblock)
@@ -4153,25 +4159,62 @@ static int __io_async_wake(struct io_kiocb *req, struct io_poll_iocb *poll, · 646 unmodified lines
41534159 return 1;
41544160 }
41554161
4162+static bool io_poll_rewait(struct io_kiocb *req, struct io_poll_iocb *poll)
4163+ __acquires(&req->ctx->completion_lock)
4164+{
4165+ struct io_ring_ctx *ctx = req->ctx;
4166+
4167+ if (!req->result && !READ_ONCE(poll->canceled)) {
4168+ struct poll_table_struct pt = { ._key = poll->events };
4169+
4170+ req->result = vfs_poll(req->file, &pt) & poll->events;
4171+ }
4172+
4173+ spin_lock_irq(&ctx->completion_lock);
4174+ if (!req->result && !READ_ONCE(poll->canceled)) {
4175+ add_wait_queue(poll->head, &poll->wait);
4176+ return true;
4177+ }
4178+
4179+ return false;
4180+}
4181+
41564182 static void io_async_task_func(struct callback_head *cb)
41574183 {
41584184 struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
41594185 struct async_poll *apoll = req->apoll;
41604186 struct io_ring_ctx *ctx = req->ctx;
4187+ bool canceled;
41614188
41624189 trace_io_uring_task_run(req->ctx, req->opcode, req->user_data);
41634190
4164− WARN_ON_ONCE(!list_empty(&req->apoll->poll.wait.entry));
4191+ if (io_poll_rewait(req, &apoll->poll)) {
4192+ spin_unlock_irq(&ctx->completion_lock);
4193+ return;
4194+ }
41654195
4166− if (hash_hashed(&req->hash_node)) {
4167− spin_lock_irq(&ctx->completion_lock);
4196+ if (hash_hashed(&req->hash_node))
41684197 hash_del(&req->hash_node);
4169− spin_unlock_irq(&ctx->completion_lock);
4198+
4199+ canceled = READ_ONCE(apoll->poll.canceled);
4200+ if (canceled) {
4201+ io_cqring_fill_event(req, -ECANCELED);
4202+ io_commit_cqring(ctx);
41704203 }
41714204
4205+ spin_unlock_irq(&ctx->completion_lock);
4206+
41724207 /* restore ->work in case we need to retry again */
41734208 memcpy(&req->work, &apoll->work, sizeof(req->work));
41744209
4210+ if (canceled) {
4211+ kfree(apoll);
4212+ io_cqring_ev_posted(ctx);
4213+ req_set_fail_links(req);
4214+ io_double_put_req(req);
4215+ return;
4216+ }
4217+
41754218 __set_current_state(TASK_RUNNING);
41764219 mutex_lock(&ctx->uring_lock);
41774220 __io_queue_sqe(req, NULL);
@@ -4315,11 +4358,13 @@ static bool __io_poll_remove_one(struct io_kiocb *req, · 137 unmodified lines
43154358
43164359 static bool io_poll_remove_one(struct io_kiocb *req)
43174360 {
4361+ struct async_poll *apoll = NULL;
43184362 bool do_complete;
43194363
43204364 if (req->opcode == IORING_OP_POLL_ADD) {
43214365 do_complete = __io_poll_remove_one(req, &req->poll);
43224366 } else {
4367+ apoll = req->apoll;
43234368 /* non-poll requests have submit ref still */
43244369 do_complete = __io_poll_remove_one(req, &req->apoll->poll);
43254370 if (do_complete)
@@ -4328,6 +4373,14 @@ static bool io_poll_remove_one(struct io_kiocb *req) · 2 unmodified lines
43284373
43294374 hash_del(&req->hash_node);
43304375
4376+ if (do_complete && apoll) {
4377+ /*
4378+ * restore ->work because we need to call io_req_work_drop_env.
4379+ */
4380+ memcpy(&req->work, &apoll->work, sizeof(req->work));
4381+ kfree(apoll);
4382+ }
4383+
43314384 if (do_complete) {
43324385 io_cqring_fill_event(req, -ECANCELED);
43334386 io_commit_cqring(req->ctx);
@@ -4342,7 +4395,7 @@ static void io_poll_remove_all(struct io_ring_ctx *ctx) · 8 unmodified lines
43424395 {
43434396 struct hlist_node *tmp;
43444397 struct io_kiocb *req;
4345− int i;
4398+ int posted = 0, i;
43464399
43474400 spin_lock_irq(&ctx->completion_lock);
43484401 for (i = 0; i < (1U << ctx->cancel_hash_bits); i++) {
@@ -4350,11 +4403,12 @@ static void io_poll_remove_all(struct io_ring_ctx *ctx) · 1 unmodified line
43504403
43514404 list = &ctx->cancel_hash[i];
43524405 hlist_for_each_entry_safe(req, tmp, list, hash_node)
4353− io_poll_remove_one(req);
4406+ posted += io_poll_remove_one(req);
43544407 }
43554408 spin_unlock_irq(&ctx->completion_lock);
43564409
4357− io_cqring_ev_posted(ctx);
4410+ if (posted)
4411+ io_cqring_ev_posted(ctx);
43584412 }
43594413
43604414 static int io_poll_cancel(struct io_ring_ctx *ctx, __u64 sqe_addr)
@@ -4423,18 +4477,11 @@ static void io_poll_task_handler(struct io_kiocb *req, struct io_kiocb **nxt) · 62 unmodified lines
44234477 struct io_ring_ctx *ctx = req->ctx;
44244478 struct io_poll_iocb *poll = &req->poll;
44254479
4426− if (!req->result && !READ_ONCE(poll->canceled)) {
4427− struct poll_table_struct pt = { ._key = poll->events };
4428−
4429− req->result = vfs_poll(req->file, &pt) & poll->events;
4430− }
4431−
4432− spin_lock_irq(&ctx->completion_lock);
4433− if (!req->result && !READ_ONCE(poll->canceled)) {
4434− add_wait_queue(poll->head, &poll->wait);
4480+ if (io_poll_rewait(req, poll)) {
44354481 spin_unlock_irq(&ctx->completion_lock);
44364482 return;
44374483 }
4484+
44384485 hash_del(&req->hash_node);
44394486 io_poll_complete(req, req->result, 0);
44404487 req->flags |= REQ_F_COMP_LOCKED;
@@ -4665,11 +4712,12 @@ static int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe, · 224 unmodified lines
46654712
46664713 static int io_timeout(struct io_kiocb *req)
46674714 {
4668− unsigned count;
46694715 struct io_ring_ctx *ctx = req->ctx;
46704716 struct io_timeout_data *data;
46714717 struct list_head *entry;
46724718 unsigned span = 0;
4719+ u32 count = req->timeout.count;
4720+ u32 seq = req->sequence;
46734721
46744722 data = &req->io->timeout;
46754723
@@ -4678,7 +4726,6 @@ static int io_timeout(struct io_kiocb *req) · 2 unmodified lines
46784726 * timeout event to be satisfied. If it isn't set, then this is
46794727 * a pure timeout request, sequence isn't used.
46804728 */
4681− count = req->timeout.count;
46824729 if (!count) {
46834730 req->flags |= REQ_F_TIMEOUT_NOSEQ;
46844731 spin_lock_irq(&ctx->completion_lock);
@@ -4686,8 +4733,7 @@ static int io_timeout(struct io_kiocb *req) · 1 unmodified line
46864733 goto add;
46874734 }
46884735
4689− req->sequence = ctx->cached_sq_head + count - 1;
4690− data->seq_offset = count;
4736+ req->sequence = seq + count;
46914737
46924738 /*
46934739 * Insertion sort, ensuring the first entry in the list is always
@@ -4696,26 +4742,26 @@ static int io_timeout(struct io_kiocb *req) · 2 unmodified lines
46964742 spin_lock_irq(&ctx->completion_lock);
46974743 list_for_each_prev(entry, &ctx->timeout_list) {
46984744 struct io_kiocb *nxt = list_entry(entry, struct io_kiocb, list);
4699− unsigned nxt_sq_head;
4745+ unsigned nxt_seq;
47004746 long long tmp, tmp_nxt;
4701− u32 nxt_offset = nxt->io->timeout.seq_offset;
4747+ u32 nxt_offset = nxt->timeout.count;
47024748
47034749 if (nxt->flags & REQ_F_TIMEOUT_NOSEQ)
47044750 continue;
47054751
47064752 /*
4707− * Since cached_sq_head + count - 1 can overflow, use type long
4753+ * Since seq + count can overflow, use type long
47084754 * long to store it.
47094755 */
4710− tmp = (long long)ctx->cached_sq_head + count - 1;
4711− nxt_sq_head = nxt->sequence - nxt_offset + 1;
4712− tmp_nxt = (long long)nxt_sq_head + nxt_offset - 1;
4756+ tmp = (long long)seq + count;
4757+ nxt_seq = nxt->sequence - nxt_offset;
4758+ tmp_nxt = (long long)nxt_seq + nxt_offset;
47134759
47144760 /*
47154761 * cached_sq_head may overflow, and it will never overflow twice
47164762 * once there is some timeout req still be valid.
47174763 */
4718− if (ctx->cached_sq_head < nxt_sq_head)
4764+ if (seq < nxt_seq)
47194765 tmp += UINT_MAX;
47204766
47214767 if (tmp > tmp_nxt)
@@ -4973,7 +5019,7 @@ static int io_req_defer(struct io_kiocb *req, const struct io_uring_sqe *sqe) · 251 unmodified lines
49735019 int ret;
49745020
49755021 /* Still need defer if there is pending req in defer list. */
4976− if (!req_need_defer(req) && list_empty(&ctx->defer_list))
5022+ if (!req_need_defer(req) && list_empty_careful(&ctx->defer_list))
49775023 return 0;
49785024
49795025 if (!req->io && io_alloc_async_ctx(req))
@@ -5387,7 +5433,7 @@ static int io_grab_files(struct io_kiocb *req) · 407 unmodified lines
53875433 int ret = -EBADF;
53885434 struct io_ring_ctx *ctx = req->ctx;
53895435
5390− if (req->work.files)
5436+ if (req->work.files || (req->flags & REQ_F_NO_FILE_TABLE))
53915437 return 0;
53925438 if (!ctx->ring_file)
53935439 return -EBADF;
@@ -5476,7 +5522,7 @@ static struct io_kiocb *io_prep_linked_timeout(struct io_kiocb *req) · 82 unmodified lines
54765522 {
54775523 struct io_kiocb *nxt;
54785524
5479− if (!(req->flags & REQ_F_LINK))
5525+ if (!(req->flags & REQ_F_LINK_HEAD))
54805526 return NULL;
54815527 /* for polled retry, if flag is set, we already went through here */
54825528 if (req->flags & REQ_F_POLLED)
@@ -5604,54 +5650,11 @@ static inline void io_queue_link_head(struct io_kiocb *req) · 121 unmodified lines
56045650 io_queue_sqe(req, NULL);
56055651 }
56065652
5607−#define SQE_VALID_FLAGS (IOSQE_FIXED_FILE|IOSQE_IO_DRAIN|IOSQE_IO_LINK| \
5608− IOSQE_IO_HARDLINK | IOSQE_ASYNC | \
5609− IOSQE_BUFFER_SELECT)
5610−
5611−static bool io_submit_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
5653+static int io_submit_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
56125654 struct io_submit_state *state, struct io_kiocb **link)
56135655 {
56145656 struct io_ring_ctx *ctx = req->ctx;
5615− unsigned int sqe_flags;
5616− int ret, id, fd;
5617−
5618− sqe_flags = READ_ONCE(sqe->flags);
5619−
5620− /* enforce forwards compatibility on users */
5621− if (unlikely(sqe_flags & ~SQE_VALID_FLAGS)) {
5622− ret = -EINVAL;
5623− goto err_req;
5624− }
5625−
5626− if ((sqe_flags & IOSQE_BUFFER_SELECT) &&
5627− !io_op_defs[req->opcode].buffer_select) {
5628− ret = -EOPNOTSUPP;
5629− goto err_req;
5630− }
5631−
5632− id = READ_ONCE(sqe->personality);
5633− if (id) {
5634− req->work.creds = idr_find(&ctx->personality_idr, id);
5635− if (unlikely(!req->work.creds)) {
5636− ret = -EINVAL;
5637− goto err_req;
5638− }
5639− get_cred(req->work.creds);
5640− }
5641−
5642− /* same numerical values with corresponding REQ_F_*, safe to copy */
5643− req->flags |= sqe_flags & (IOSQE_IO_DRAIN | IOSQE_IO_HARDLINK |
5644− IOSQE_ASYNC | IOSQE_FIXED_FILE |
5645− IOSQE_BUFFER_SELECT);
5646−
5647− fd = READ_ONCE(sqe->fd);
5648− ret = io_req_set_file(state, req, fd, sqe_flags);
5649− if (unlikely(ret)) {
5650−err_req:
5651− io_cqring_add_event(req, ret);
5652− io_double_put_req(req);
5653− return false;
5654− }
5657+ int ret;
56555658
56565659 /*
56575660 * If we already have a head request, queue this one for async
@@ -5670,42 +5673,39 @@ err_req: · 12 unmodified lines
56705673 * next after the link request. The last one is done via
56715674 * drain_next flag to persist the effect across calls.
56725675 */
5673− if (sqe_flags & IOSQE_IO_DRAIN) {
5676+ if (req->flags & REQ_F_IO_DRAIN) {
56745677 head->flags |= REQ_F_IO_DRAIN;
56755678 ctx->drain_next = 1;
56765679 }
5677− if (io_alloc_async_ctx(req)) {
5678− ret = -EAGAIN;
5679− goto err_req;
5680− }
5680+ if (io_alloc_async_ctx(req))
5681+ return -EAGAIN;
56815682
56825683 ret = io_req_defer_prep(req, sqe);
56835684 if (ret) {
56845685 /* fail even hard links since we don't submit */
56855686 head->flags |= REQ_F_FAIL_LINK;
5686− goto err_req;
5687+ return ret;
56875688 }
56885689 trace_io_uring_link(ctx, req, head);
56895690 list_add_tail(&req->link_list, &head->link_list);
56905691
56915692 /* last request of a link, enqueue the link */
5692− if (!(sqe_flags & (IOSQE_IO_LINK|IOSQE_IO_HARDLINK))) {
5693+ if (!(req->flags & (REQ_F_LINK | REQ_F_HARDLINK))) {
56935694 io_queue_link_head(head);
56945695 *link = NULL;
56955696 }
56965697 } else {
56975698 if (unlikely(ctx->drain_next)) {
56985699 req->flags |= REQ_F_IO_DRAIN;
5699− req->ctx->drain_next = 0;
5700+ ctx->drain_next = 0;
57005701 }
5701− if (sqe_flags & (IOSQE_IO_LINK|IOSQE_IO_HARDLINK)) {
5702− req->flags |= REQ_F_LINK;
5702+ if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK)) {
5703+ req->flags |= REQ_F_LINK_HEAD;
57035704 INIT_LIST_HEAD(&req->link_list);
57045705
5705− if (io_alloc_async_ctx(req)) {
5706− ret = -EAGAIN;
5707− goto err_req;
5708− }
5706+ if (io_alloc_async_ctx(req))
5707+ return -EAGAIN;
5708+
57095709 ret = io_req_defer_prep(req, sqe);
57105710 if (ret)
57115711 req->flags |= REQ_F_FAIL_LINK;
@@ -5715,7 +5715,7 @@ err_req: · 3 unmodified lines
57155715 }
57165716 }
57175717
5718− return true;
5718+ return 0;
57195719 }
57205720
57215721 /*
@@ -5789,15 +5789,23 @@ static inline void io_consume_sqe(struct io_ring_ctx *ctx) · 67 unmodified lines
57895789 ctx->cached_sq_head++;
57905790 }
57915791
5792−static void io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
5793− const struct io_uring_sqe *sqe)
5792+#define SQE_VALID_FLAGS (IOSQE_FIXED_FILE|IOSQE_IO_DRAIN|IOSQE_IO_LINK| \
5793+ IOSQE_IO_HARDLINK | IOSQE_ASYNC | \
5794+ IOSQE_BUFFER_SELECT)
5795+
5796+static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
5797+ const struct io_uring_sqe *sqe,
5798+ struct io_submit_state *state, bool async)
57945799 {
5800+ unsigned int sqe_flags;
5801+ int id, fd;
5802+
57955803 /*
57965804 * All io need record the previous position, if LINK vs DARIN,
57975805 * it can be used to mark the position of the first IO in the
57985806 * link list.
57995807 */
5800− req->sequence = ctx->cached_sq_head;
5808+ req->sequence = ctx->cached_sq_head - ctx->cached_sq_dropped;
58015809 req->opcode = READ_ONCE(sqe->opcode);
58025810 req->user_data = READ_ONCE(sqe->user_data);
58035811 req->io = NULL;
@@ -5808,17 +5816,50 @@ static void io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, · 4 unmodified lines
58085816 refcount_set(&req->refs, 2);
58095817 req->task = NULL;
58105818 req->result = 0;
5819+ req->needs_fixed_file = async;
58115820 INIT_IO_WORK(&req->work, io_wq_submit_work);
5821+
5822+ if (unlikely(req->opcode >= IORING_OP_LAST))
5823+ return -EINVAL;
5824+
5825+ if (io_op_defs[req->opcode].needs_mm && !current->mm) {
5826+ if (unlikely(!mmget_not_zero(ctx->sqo_mm)))
5827+ return -EFAULT;
5828+ use_mm(ctx->sqo_mm);
5829+ }
5830+
5831+ sqe_flags = READ_ONCE(sqe->flags);
5832+ /* enforce forwards compatibility on users */
5833+ if (unlikely(sqe_flags & ~SQE_VALID_FLAGS))
5834+ return -EINVAL;
5835+
5836+ if ((sqe_flags & IOSQE_BUFFER_SELECT) &&
5837+ !io_op_defs[req->opcode].buffer_select)
5838+ return -EOPNOTSUPP;
5839+
5840+ id = READ_ONCE(sqe->personality);
5841+ if (id) {
5842+ req->work.creds = idr_find(&ctx->personality_idr, id);
5843+ if (unlikely(!req->work.creds))
5844+ return -EINVAL;
5845+ get_cred(req->work.creds);
5846+ }
5847+
5848+ /* same numerical values with corresponding REQ_F_*, safe to copy */
5849+ req->flags |= sqe_flags & (IOSQE_IO_DRAIN | IOSQE_IO_HARDLINK |
5850+ IOSQE_ASYNC | IOSQE_FIXED_FILE |
5851+ IOSQE_BUFFER_SELECT | IOSQE_IO_LINK);
5852+
5853+ fd = READ_ONCE(sqe->fd);
5854+ return io_req_set_file(state, req, fd, sqe_flags);
58125855 }
58135856
58145857 static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr,
5815− struct file *ring_file, int ring_fd,
5816− struct mm_struct **mm, bool async)
5858+ struct file *ring_file, int ring_fd, bool async)
58175859 {
58185860 struct io_submit_state state, *statep = NULL;
58195861 struct io_kiocb *link = NULL;
58205862 int i, submitted = 0;
5821− bool mm_fault = false;
58225863
58235864 /* if we have a backlog and couldn't flush it all, return BUSY */
58245865 if (test_bit(0, &ctx->sq_check_overflow)) {
@@ -5858,34 +5899,23 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr, · 33 unmodified lines
58585899 break;
58595900 }
58605901
5861− io_init_req(ctx, req, sqe);
5902+ err = io_init_req(ctx, req, sqe, statep, async);
58625903 io_consume_sqe(ctx);
58635904 /* will complete beyond this point, count as submitted */
58645905 submitted++;
58655906
5866− if (unlikely(req->opcode >= IORING_OP_LAST)) {
5867− err = -EINVAL;
5907+ if (unlikely(err)) {
58685908 fail_req:
58695909 io_cqring_add_event(req, err);
58705910 io_double_put_req(req);
58715911 break;
58725912 }
58735913
5874− if (io_op_defs[req->opcode].needs_mm && !*mm) {
5875− mm_fault = mm_fault || !mmget_not_zero(ctx->sqo_mm);
5876− if (unlikely(mm_fault)) {
5877− err = -EFAULT;
5878− goto fail_req;
5879− }
5880− use_mm(ctx->sqo_mm);
5881− *mm = ctx->sqo_mm;
5882− }
5883−
5884− req->needs_fixed_file = async;
58855914 trace_io_uring_submit_sqe(ctx, req->opcode, req->user_data,
58865915 true, async);
5887− if (!io_submit_sqe(req, sqe, statep, &link))
5888− break;
5916+ err = io_submit_sqe(req, sqe, statep, &link);
5917+ if (err)
5918+ goto fail_req;
58895919 }
58905920
58915921 if (unlikely(submitted != nr)) {
@@ -5904,10 +5934,19 @@ fail_req: · 12 unmodified lines
59045934 return submitted;
59055935 }
59065936
5937+static inline void io_sq_thread_drop_mm(struct io_ring_ctx *ctx)
5938+{
5939+ struct mm_struct *mm = current->mm;
5940+
5941+ if (mm) {
5942+ unuse_mm(mm);
5943+ mmput(mm);
5944+ }
5945+}
5946+
59075947 static int io_sq_thread(void *data)
59085948 {
59095949 struct io_ring_ctx *ctx = data;
5910− struct mm_struct *cur_mm = NULL;
59115950 const struct cred *old_cred;
59125951 mm_segment_t old_fs;
59135952 DEFINE_WAIT(wait);
@@ -5948,11 +5987,7 @@ static int io_sq_thread(void *data) · 34 unmodified lines
59485987 * adding ourselves to the waitqueue, as the unuse/drop
59495988 * may sleep.
59505989 */
5951− if (cur_mm) {
5952− unuse_mm(cur_mm);
5953− mmput(cur_mm);
5954− cur_mm = NULL;
5955− }
5990+ io_sq_thread_drop_mm(ctx);
59565991
59575992 /*
59585993 * We're polling. If we're within the defined idle
@@ -6016,7 +6051,7 @@ static int io_sq_thread(void *data) · 57 unmodified lines
60166051 }
60176052
60186053 mutex_lock(&ctx->uring_lock);
6019− ret = io_submit_sqes(ctx, to_submit, NULL, -1, &cur_mm, true);
6054+ ret = io_submit_sqes(ctx, to_submit, NULL, -1, true);
60206055 mutex_unlock(&ctx->uring_lock);
60216056 timeout = jiffies + ctx->sq_thread_idle;
60226057 }
@@ -6025,10 +6060,7 @@ static int io_sq_thread(void *data) · 2 unmodified lines
60256060 task_work_run();
60266061
60276062 set_fs(old_fs);
6028− if (cur_mm) {
6029− unuse_mm(cur_mm);
6030− mmput(cur_mm);
6031− }
6063+ io_sq_thread_drop_mm(ctx);
60326064 revert_creds(old_cred);
60336065
60346066 kthread_parkme();
@@ -7299,7 +7331,7 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx) · 1264 unmodified lines
72997331 * it could cause shutdown to hang.
73007332 */
73017333 while (ctx->sqo_thread && !wq_has_sleeper(&ctx->sqo_wait))
7302− cpu_relax();
7334+ cond_resched();
73037335
73047336 io_kill_timeouts(ctx);
73057337 io_poll_remove_all(ctx);
@@ -7509,13 +7541,8 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, · 203 unmodified lines
75097541 wake_up(&ctx->sqo_wait);
75107542 submitted = to_submit;
75117543 } else if (to_submit) {
7512− struct mm_struct *cur_mm;
7513−
75147544 mutex_lock(&ctx->uring_lock);
7515− /* already have mm, so io_submit_sqes() won't try to grab it */
7516− cur_mm = ctx->sqo_mm;
7517− submitted = io_submit_sqes(ctx, to_submit, f.file, fd,
7518− &cur_mm, false);
7545+ submitted = io_submit_sqes(ctx, to_submit, f.file, fd, false);
75197546 mutex_unlock(&ctx->uring_lock);
75207547
75217548 if (submitted != to_submit)
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+7−7
@@ -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();
@@ -2023,6 +2022,7 @@ lookup_again: · 549 unmodified lines
20232022 goto lookup_again;
20242023 }
20252024
2025+ spin_unlock(&ino->i_lock);
20262026 first = true;
20272027 status = nfs4_select_rw_stateid(ctx->state,
20282028 iomode == IOMODE_RW ? FMODE_WRITE : FMODE_READ,
@@ -2032,12 +2032,12 @@ lookup_again: · 3 unmodified lines
20322032 trace_pnfs_update_layout(ino, pos, count,
20332033 iomode, lo, lseg,
20342034 PNFS_UPDATE_LAYOUT_INVALID_OPEN);
2035− spin_unlock(&ino->i_lock);
20362035 nfs4_schedule_stateid_recovery(server, ctx->state);
20372036 pnfs_clear_first_layoutget(lo);
20382037 pnfs_put_layout_hdr(lo);
20392038 goto lookup_again;
20402039 }
2040+ spin_lock(&ino->i_lock);
20412041 } else {
20422042 nfs4_stateid_copy(&stateid, &lo->plh_stateid);
20432043 }
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+13−2
@@ -1573,6 +1573,7 @@ static ssize_t timens_offsets_write(struct file *file, const char __user *buf, · 1572 unmodified lines
15731573 noffsets = 0;
15741574 for (pos = kbuf; pos; pos = next_line) {
15751575 struct proc_timens_offset *off = &offsets[noffsets];
1576+ char clock[10];
15761577 int err;
15771578
15781579 /* Find the end of line and ensure we don't look past it */
@@ -1584,10 +1585,21 @@ static ssize_t timens_offsets_write(struct file *file, const char __user *buf, · 5 unmodified lines
15841585 next_line = NULL;
15851586 }
15861587
1587− err = sscanf(pos, "%u %lld %lu", &off->clockid,
1588+ err = sscanf(pos, "%9s %lld %lu", clock,
15881589 &off->val.tv_sec, &off->val.tv_nsec);
15891590 if (err != 3 || off->val.tv_nsec >= NSEC_PER_SEC)
15901591 goto out;
1592+
1593+ clock[sizeof(clock) - 1] = 0;
1594+ if (strcmp(clock, "monotonic") == 0 ||
1595+ strcmp(clock, __stringify(CLOCK_MONOTONIC)) == 0)
1596+ off->clockid = CLOCK_MONOTONIC;
1597+ else if (strcmp(clock, "boottime") == 0 ||

16 more lines aren’t shown here.

fs/proc/root.c+7−0

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

fs/proc/vmcore.c+3−2

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

fs/super.c+1−1

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

fs/xfs/xfs_icache.c+10−0

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

fs/xfs/xfs_ioctl.c+4−1

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

fs/xfs/xfs_mount.h+5−1

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

fs/xfs/xfs_reflink.c+1−0

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

fs/xfs/xfs_super.c+22−18

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

include/asm-generic/Kbuild+1−0

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

include/asm-generic/mshyperv.h+1−1

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

include/asm-generic/vermagic.h+7−0

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

include/linux/backing-dev-defs.h+0−1

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

include/linux/bio.h+1−1

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

include/linux/blk-mq.h+1−1

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

include/linux/blk_types.h+1−1

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

include/linux/buffer_head.h+8−0

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

include/linux/can/dev/peak_canfd.h+2−2

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

include/linux/cpu_rmap.h+1−1

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

include/linux/debugfs.h+4−8

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

include/linux/digsig.h+2−2

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

include/linux/dirent.h+1−1

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

include/linux/dma-buf.h+1−2

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

include/linux/dmaengine.h+6−6

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

include/linux/enclosure.h+1−1

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

include/linux/energy_model.h+1−1

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

include/linux/ethtool.h+2−2

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

include/linux/genalloc.h+1−1

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

include/linux/i2c-mux.h+1−1

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

include/linux/i2c.h+1−7

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

include/linux/igmp.h+1−1

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

include/linux/ihex.h+1−1

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

include/linux/iio/iio.h+1−1

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

include/linux/irq.h+2−4

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

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

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

include/linux/kvm_host.h+1−1

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

include/linux/list_lru.h+1−1

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

include/linux/memcontrol.h+2−2

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

include/linux/nfs_xdr.h+2−0

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

include/linux/platform_data/wilco-ec.h+1−1

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

include/linux/pnp.h+9−20

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

include/linux/posix_acl.h+1−1

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

include/linux/rio.h+2−2

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

include/linux/rslib.h+1−1

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

include/linux/sched/topology.h+1−1

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

include/linux/skbuff.h+1−1

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

include/linux/stmmac.h+2−0

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

include/linux/sunrpc/clnt.h+12−1

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

include/linux/sunrpc/svc_rdma.h+1−0

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

include/linux/swap.h+1−1

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

include/linux/ti_wilink_st.h+3−3

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

include/linux/tpm_eventlog.h+3−3

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

include/linux/tracepoint.h+1−21

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

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

include/net/cfg80211.h+10−0

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

include/net/ip6_route.h+1−0

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

include/net/mac80211.h+3−1

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

include/net/ndisc.h+1−1

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

include/net/netfilter/nf_tables.h+1−1

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

include/net/sock.h+3−3

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

This diff is large: its 18 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/hda_codec.h+5−0

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

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

include/uapi/linux/btrfs.h+4−6

This diff is large: its 17 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/netfilter/nf_tables.h+2−0

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

include/uapi/linux/netfilter/xt_IDLETIMER.h+1−0

This diff is large: its 8 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/vdso/datapage.h+2−2

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

kernel/audit.c+3−0

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

kernel/bpf/bpf_lru_list.h+1−1

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

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

kernel/bpf/verifier.c+29−12

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

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

kernel/irq/manage.c+0−44

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

kernel/power/hibernate.c+7−0

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

kernel/rcu/tree.c+1−1

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

kernel/sched/core.c+2−7

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

kernel/sched/cputime.c+2−2

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

kernel/sched/isolation.c+19−2

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

kernel/signal.c+10−10

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

kernel/time/namespace.c+14−1

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

kernel/trace/ftrace.c+1−0

This diff is large: its 8 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_events_trigger.c+3−7

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

kernel/trace/tracing_map.c+3−3

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

lib/Kconfig.debug+2−0

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

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

mm/shmem.c+8−5

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

mm/slub.c+10−2

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

mm/vmalloc.c+13−3

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

net/core/dev.c+4−2

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

net/core/filter.c+1−1

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

net/core/net-sysfs.c+1−1

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

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

net/dsa/port.c+6−1

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

net/dsa/slave.c+3−5

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

net/hsr/hsr_netlink.c+8−2

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

net/ipv4/devinet.c+9−4

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

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

net/ipv6/icmp.c+20−1

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

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

net/ipv6/seg6.c+1−1

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

net/ipv6/xfrm6_output.c+0−2

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

net/l2tp/l2tp_netlink.c+8−8

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

net/mac80211/main.c+16−13

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

net/mac80211/mesh.c+7−4

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

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

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

net/mptcp/protocol.h+4−4

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

net/mptcp/subflow.c+71−28

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

net/netfilter/ipset/ip_set_core.c+2−1

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

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

net/netfilter/nf_tables_api.c+4−3

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

net/netfilter/nft_lookup.c+7−5

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

net/netfilter/nft_set_bitmap.c+0−1

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

net/netfilter/nft_set_rbtree.c+11−12

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

net/netfilter/xt_IDLETIMER.c+3−0

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

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

net/rds/message.c+9−16

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

net/rds/rdma.c+35−30

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

net/rds/rds.h+3−17

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

net/rds/send.c+4−2

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

net/rxrpc/local_object.c+0−9

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

net/rxrpc/output.c+12−32

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

net/sched/cls_api.c+1−0

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

net/sched/sch_etf.c+4−3

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

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

net/tipc/node.c+3−1

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

net/tls/tls_main.c+2−2

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

net/wireless/nl80211.c+2−4

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

net/x25/x25_dev.c+3−1

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

net/xdp/xdp_umem.c+2−3

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

net/xdp/xsk.c+3−2

This diff is large: its 12 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/documentation-file-ref-check+1−1

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

scripts/dtc/Makefile+1−1

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

scripts/kernel-doc+1−1

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

security/keys/proc.c+2−0

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.

security/selinux/ss/policydb.c+4−4

This diff is large: its 19 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/hda/Kconfig+4−3

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

This diff is large: its 63 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+56−50

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

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

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

This diff is large: its 55 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+52−14

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

This diff is large: its 78 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/arch/x86/include/asm/cpufeatures.h+4−1

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

tools/arch/x86/include/asm/msr-index.h+9−0

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

tools/bpf/bpftool/struct_ops.c+10−2

This diff is large: its 32 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/include/linux/bits.h+21−3

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

tools/include/linux/build_bug.h+82−0

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

tools/include/linux/compiler.h+26−0

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

tools/include/linux/const.h+1−4

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

tools/include/linux/kernel.h+1−3

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

tools/include/uapi/drm/drm.h+2−0

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

tools/include/uapi/drm/i915_drm.h+21−0

This diff is large: its 28 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/include/uapi/linux/fscrypt.h+1−0

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

tools/include/uapi/linux/kvm.h+45−2

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

tools/include/uapi/linux/mman.h+3−2

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

tools/include/uapi/linux/sched.h+5−0

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

tools/include/uapi/linux/vhost.h+24−0

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

tools/include/vdso/bits.h+9−0

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

tools/include/vdso/const.h+10−0

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

tools/lib/bpf/libbpf.c+82−44

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

tools/lib/bpf/libbpf.h+1−1

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

tools/lib/bpf/netlink.c+5−3

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

tools/objtool/check.c+18−8

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

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

tools/objtool/orc_dump.c+27−17

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

tools/objtool/orc_gen.c+26−7

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

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+370−370

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

tools/perf/check-headers.sh+3−0

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

tools/perf/trace/beauty/clone.c+1−0

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

tools/perf/trace/beauty/mmap.c+1−0

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

tools/perf/util/setup.py+2−0

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

tools/perf/util/stat-shadow.c+5−2

This diff is large: its 14 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/prog_tests/mmap.c+60−2

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

tools/testing/selftests/bpf/prog_tests/section_names.c+27−15

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

tools/testing/selftests/bpf/prog_tests/test_lsm.c+9−9

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

tools/testing/selftests/bpf/prog_tests/xdp_attach.c+29−1

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

tools/testing/selftests/bpf/prog_tests/xdp_info.c+68−0

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

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

This diff is large: its 18 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/ftrace/config+1−0

This diff is large: its 7 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/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/seccomp/seccomp_bpf.c+8−6

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

tools/testing/selftests/tc-testing/tdc.py+2−3

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