History

Merge branch 'linus' into locking/kcsan, to pick up fixes

Ingo Molnar committed 6 years ago

Commit df108462 parents a4654e9 5ad0ec0906 files · +8764 −4406Browse files

Unified · Split

906 files
  1. .clang-format +21 −4
  2. CREDITS +5 −0
  3. Documentation/admin-guide/acpi/fan_performance_states.rst +2 −2
  4. Documentation/admin-guide/bootconfig.rst +31 −3
  5. Documentation/admin-guide/kernel-parameters.txt +4 −0
  6. Documentation/arm64/silicon-errata.rst +2 −0
  7. Documentation/dev-tools/kunit/usage.rst +1 −0
  8. Documentation/devicetree/bindings/arm/arm,scmi.txt +1 −1
  9. Documentation/devicetree/bindings/arm/arm,scpi.txt +1 −1
  10. Documentation/devicetree/bindings/arm/bcm/brcm,bcm63138.txt +1 −1
  11. Documentation/devicetree/bindings/arm/cpus.yaml +1 −1
  12. Documentation/devicetree/bindings/arm/fsl.yaml +1 −1
  13. Documentation/devicetree/bindings/arm/hisilicon/hi3519-sysctrl.txt +1 −1
  14. Documentation/devicetree/bindings/arm/msm/qcom,idle-state.txt +1 −1
  15. Documentation/devicetree/bindings/arm/omap/mpu.txt +1 −1
  16. Documentation/devicetree/bindings/arm/psci.yaml +17 −19
  17. Documentation/devicetree/bindings/arm/stm32/st,mlahb.yaml +1 −1
  18. Documentation/devicetree/bindings/bus/allwinner,sun8i-a23-rsb.yaml +0 −1
  19. Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-osc-clk.yaml +1 −1
  20. Documentation/devicetree/bindings/clock/allwinner,sun9i-a80-gt-clk.yaml +1 −1
  21. Documentation/devicetree/bindings/clock/qcom,gcc-apq8064.yaml +1 −1
  22. Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tv-encoder.yaml +1 −5
  23. Documentation/devicetree/bindings/display/bridge/anx6345.yaml +2 −8
  24. Documentation/devicetree/bindings/display/panel/leadtek,ltk500hd1829.yaml +2 −0
  25. Documentation/devicetree/bindings/display/panel/xinpeng,xpp055c272.yaml +2 −0
  26. Documentation/devicetree/bindings/display/simple-framebuffer.yaml +1 −5
  27. Documentation/devicetree/bindings/display/tilcdc/tilcdc.txt +1 −1
  28. Documentation/devicetree/bindings/dma/ti/k3-udma.yaml +1 −13
  29. Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml +7 −7
  30. Documentation/devicetree/bindings/gpu/arm,mali-midgard.yaml +7 −7
  31. Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.yaml +1 −1
  32. Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1 −1
  33. Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt +1 −1
  34. Documentation/devicetree/bindings/leds/common.yaml +1 −1
  35. Documentation/devicetree/bindings/leds/register-bit-led.txt +1 −1
  36. Documentation/devicetree/bindings/media/ti,cal.yaml +1 −1
  37. Documentation/devicetree/bindings/memory-controllers/ti/emif.txt +1 −1
  38. Documentation/devicetree/bindings/mfd/max77650.yaml +2 −2
  39. Documentation/devicetree/bindings/mfd/tps65910.txt +2 −2
  40. Documentation/devicetree/bindings/mfd/twl-family.txt +0 −0
  41. Documentation/devicetree/bindings/mfd/zii,rave-sp.txt +1 −1
  42. Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt +1 −1
  43. Documentation/devicetree/bindings/mmc/mmc-controller.yaml +1 −0
  44. Documentation/devicetree/bindings/mtd/cadence-nand-controller.txt +1 −1
  45. Documentation/devicetree/bindings/net/brcm,bcm7445-switch-v4.0.txt +1 −1
  46. Documentation/devicetree/bindings/net/fsl-fman.txt +7 −0
  47. Documentation/devicetree/bindings/nvmem/nvmem.yaml +2 −0
  48. Documentation/devicetree/bindings/phy/allwinner,sun4i-a10-usb-phy.yaml +1 −1
  49. Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml +1 −1
  50. Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml +1 −1
  51. Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml +1 −1
  52. Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml +1 −1
  53. Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml +1 −1
  54. Documentation/devicetree/bindings/power/domain-idle-state.txt +0 −33
  55. Documentation/devicetree/bindings/power/domain-idle-state.yaml +64 −0
  56. Documentation/devicetree/bindings/power/power-domain.yaml +11 −13
  57. Documentation/devicetree/bindings/power/power_domain.txt +1 −1
  58. Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt +1 −1
  59. Documentation/devicetree/bindings/regulator/regulator.yaml +1 −1
  60. Documentation/devicetree/bindings/reset/intel,rcu-gw.yaml +5 −1
  61. Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt +1 −1
  62. Documentation/devicetree/bindings/sound/st,stm32-sai.txt +1 −1
  63. Documentation/devicetree/bindings/sound/st,stm32-spdifrx.txt +1 −1
  64. Documentation/devicetree/bindings/spi/st,stm32-spi.yaml +1 −1
  65. Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml +1 −1
  66. Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml +1 −1
  67. Documentation/devicetree/bindings/timer/allwinner,sun4i-a10-timer.yaml +1 −1
  68. Documentation/driver-api/dmaengine/client.rst +10 −4
  69. Documentation/filesystems/debugfs.txt +3 −3
  70. Documentation/filesystems/porting.rst +8 −0
  71. Documentation/hwmon/adm1177.rst +1 −2
  72. Documentation/kbuild/kbuild.rst +1 −1
  73. Documentation/kbuild/kconfig-macro-language.rst +1 −1
  74. Documentation/kbuild/makefiles.rst +4 −7
  75. Documentation/kbuild/modules.rst +2 −2
  76. Documentation/networking/devlink/devlink-region.rst +0 −3
  77. Documentation/networking/net_failover.rst +3 −3
  78. Documentation/networking/phy.rst +3 −2
  79. Documentation/networking/rds.txt +1 −1
  80. Documentation/power/index.rst +0 −1
  81. Documentation/sphinx/parallel-wrapper.sh +1 −1
  82. Documentation/virt/kvm/api.rst +18 −15
  83. Documentation/x86/index.rst +0 −1
  84. MAINTAINERS +16 −19
  85. Makefile +5 −3
  86. arch/Kconfig +3 −2
  87. arch/arc/Kconfig +2 −2
  88. arch/arc/configs/nps_defconfig +0 −2
  89. arch/arc/configs/nsimosci_defconfig +0 −2
  90. arch/arc/configs/nsimosci_hs_defconfig +0 −2
  91. arch/arc/configs/nsimosci_hs_smp_defconfig +0 −2
  92. arch/arc/include/asm/fpu.h +2 −0
  93. arch/arc/include/asm/linkage.h +2 −0
  94. arch/arc/kernel/setup.c +1 −1
  95. arch/arc/kernel/troubleshoot.c +12 −15
  96. arch/arm/Makefile +3 −1
  97. arch/arm/boot/compressed/Makefile +2 −2
  98. arch/arm/boot/dts/am437x-idk-evm.dts +2 −2
  99. arch/arm/boot/dts/bcm2711-rpi-4-b.dts +3 −0
  100. arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts +2 −0
  101. arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts +2 −0
  102. arch/arm/boot/dts/dra7-evm.dts +2 −2
  103. arch/arm/boot/dts/dra7-l4.dtsi +4 −0
  104. arch/arm/boot/dts/dra7.dtsi +2 −0
  105. arch/arm/boot/dts/dra76x.dtsi +5 −0
  106. arch/arm/boot/dts/dra7xx-clocks.dtsi +2 −10
  107. arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts +2 −2
  108. arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi +0 −1
  109. arch/arm/boot/dts/imx7-colibri.dtsi +0 −1
  110. arch/arm/boot/dts/imx7d.dtsi +3 −3
  111. arch/arm/boot/dts/ls1021a.dtsi +2 −2
  112. arch/arm/boot/dts/motorola-mapphone-common.dtsi +11 −2
  113. arch/arm/boot/dts/r8a7779.dtsi +1 −1
  114. arch/arm/configs/bcm2835_defconfig +1 −0
  115. arch/arm/configs/omap2plus_defconfig +1 −0
  116. arch/arm/configs/socfpga_defconfig +1 −0
  117. arch/arm/include/asm/kvm_host.h +0 −3
  118. arch/arm/kernel/vdso.c +2 −0
  119. arch/arm/lib/copy_from_user.S +1 −1
  120. arch/arm/mach-imx/Makefile +2 −0
  121. arch/arm/mach-imx/common.h +2 −2
  122. arch/arm/mach-imx/resume-imx6.S +24 −0
  123. arch/arm/mach-imx/suspend-imx6.S +0 −14
  124. arch/arm/mach-meson/Kconfig +0 −1
  125. arch/arm/mach-omap2/Makefile +1 −1
  126. arch/arm/mach-omap2/io.c +0 −2
  127. arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +1 −1
  128. arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +1 −0
  129. arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi +2 −0
  130. arch/arm64/boot/dts/freescale/imx8qxp-mek.dts +0 −5
  131. arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +3 −3
  132. arch/arm64/configs/defconfig +1 −1
  133. arch/arm64/include/asm/arch_gicv3.h +1 −1
  134. arch/arm64/include/asm/cache.h +1 −1
  135. arch/arm64/include/asm/cacheflush.h +1 −1
  136. arch/arm64/include/asm/cpufeature.h +5 −5
  137. arch/arm64/include/asm/io.h +2 −2
  138. arch/arm64/include/asm/kvm_emulate.h +24 −24
  139. arch/arm64/include/asm/kvm_host.h +0 −32
  140. arch/arm64/include/asm/kvm_hyp.h +7 −0
  141. arch/arm64/include/asm/kvm_mmu.h +2 −1
  142. arch/arm64/include/asm/mmu.h +1 −3
  143. arch/arm64/include/asm/pgtable-prot.h +4 −2
  144. arch/arm64/include/asm/unistd.h +1 −1
  145. arch/arm64/include/asm/virt.h +1 −1
  146. arch/arm64/kernel/smp.c +20 −5
  147. arch/arm64/kvm/hyp/switch.c +37 −2
  148. arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c +2 −2
  149. arch/arm64/mm/context.c +15 −5
  150. arch/mips/boot/dts/ingenic/ci20.dts +28 −16
  151. arch/mips/boot/dts/ingenic/jz4740.dtsi +9 −8
  152. arch/mips/boot/dts/ingenic/jz4780.dtsi +9 −8
  153. arch/mips/boot/dts/ingenic/x1000.dtsi +2 −4
  154. arch/mips/include/asm/sync.h +3 −1
  155. arch/mips/kernel/setup.c +2 −1
  156. arch/mips/kernel/vpe.c +1 −1
  157. arch/mips/vdso/Makefile +25 −3
  158. arch/powerpc/kernel/cputable.c +3 −1
  159. arch/powerpc/kernel/hw_breakpoint.c +7 −5
  160. arch/powerpc/kernel/vmlinux.lds.S +6 −0
  161. arch/powerpc/mm/mem.c +2 −0
  162. arch/riscv/Kconfig +1 −0
  163. arch/riscv/Kconfig.socs +24 −0
  164. arch/riscv/Makefile +4 −2
  165. arch/riscv/boot/.gitignore +2 −0
  166. arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +5 −0
  167. arch/riscv/configs/defconfig +3 −14
  168. arch/riscv/configs/rv32_defconfig +3 −15
  169. arch/riscv/include/asm/csr.h +12 −0
  170. arch/riscv/include/asm/syscall.h +0 −7
  171. arch/riscv/kernel/entry.S +3 −8
  172. arch/riscv/kernel/head.S +6 −0
  173. arch/riscv/kernel/module.c +16 −0
  174. arch/riscv/kernel/ptrace.c +5 −6
  175. arch/riscv/kernel/traps.c +2 −2
  176. arch/riscv/mm/init.c +1 −1
  177. arch/riscv/mm/kasan_init.c +31 −22
  178. arch/s390/include/asm/pgtable.h +6 −0
  179. arch/s390/kvm/kvm-s390.c +17 −1
  180. arch/s390/pci/pci.c +2 −2
  181. arch/x86/Makefile +3 −2
  182. arch/x86/crypto/Makefile +6 −1
  183. arch/x86/events/amd/uncore.c +7 −10
  184. arch/x86/include/asm/io_bitmap.h +8 −1
  185. arch/x86/include/asm/kvm_emulate.h +12 −2
  186. arch/x86/include/asm/kvm_host.h +2 −1
  187. arch/x86/include/asm/paravirt.h +7 −0
  188. arch/x86/include/asm/paravirt_types.h +4 −0
  189. arch/x86/include/asm/vmx.h +1 −1
  190. arch/x86/include/asm/vmxfeatures.h +1 −0
  191. arch/x86/include/uapi/asm/kvm.h +1 −0
  192. arch/x86/kernel/apic/vector.c +8 −6
  193. arch/x86/kernel/cpu/common.c +1 −1
  194. arch/x86/kernel/cpu/mce/intel.c +5 −4
  195. arch/x86/kernel/cpu/mce/therm_throt.c +7 −2
  196. arch/x86/kernel/kvm.c +44 −21
  197. arch/x86/kernel/paravirt.c +5 −0
  198. arch/x86/kernel/process.c +1 −1
  199. arch/x86/kvm/Kconfig +13 −0
  200. arch/x86/kvm/Makefile +1 −0
  201. arch/x86/kvm/emulate.c +15 −22
  202. arch/x86/kvm/ioapic.c +5 −2
  203. arch/x86/kvm/irq_comm.c +1 −1
  204. arch/x86/kvm/lapic.c +4 −5
  205. arch/x86/kvm/mmutrace.h +1 −1
  206. arch/x86/kvm/svm.c +42 −31
  207. arch/x86/kvm/vmx/capabilities.h +1 −0
  208. arch/x86/kvm/vmx/nested.c +69 −25
  209. arch/x86/kvm/vmx/nested.h +8 −2
  210. arch/x86/kvm/vmx/vmx.c +141 −22
  211. arch/x86/kvm/vmx/vmx.h +3 −0
  212. arch/x86/kvm/x86.c +11 −7
  213. arch/x86/mm/dump_pagetables.c +1 −6
  214. arch/x86/mm/ioremap.c +18 −0
  215. arch/x86/platform/efi/efi_64.c +52 −99
  216. arch/x86/xen/enlighten_pv.c +25 −0
  217. block/bfq-cgroup.c +5 −4
  218. block/blk-core.c +0 −6
  219. block/blk-flush.c +1 −1
  220. block/blk-iocost.c +1 −1
  221. block/blk-mq-sched.c +37 −7
  222. block/blk-mq-tag.c +2 −2
  223. block/blk-mq-tag.h +2 −2
  224. block/blk-mq.c +15 −13
  225. block/blk-mq.h +3 −2
  226. block/genhd.c +36 −0
  227. drivers/acpi/acpi_watchdog.c +12 −3
  228. drivers/android/binder.c +9 −0
  229. drivers/android/binder_internal.h +2 −0
  230. drivers/android/binderfs.c +6 −2
  231. drivers/atm/nicstar.c +1 −1
  232. drivers/auxdisplay/Kconfig +8 −8
  233. drivers/auxdisplay/charlcd.c +1 −1
  234. drivers/auxdisplay/img-ascii-lcd.c +1 −3
  235. drivers/base/core.c +20 −7
  236. drivers/base/platform.c +6 −19
  237. drivers/base/swnode.c +7 −7
  238. drivers/block/floppy.c +5 −2
  239. drivers/block/null_blk.h +0 −3
  240. drivers/block/null_blk_main.c +0 −2
  241. drivers/block/paride/pcd.c +1 −1
  242. drivers/block/virtio_blk.c +12 −5
  243. drivers/block/xen-blkfront.c +42 −38
  244. drivers/bus/ti-sysc.c +2 −2
  245. drivers/cdrom/gdrom.c +1 −1
  246. drivers/char/ipmi/ipmi_si_platform.c +2 −2
  247. drivers/clk/clk.c +2 −2
  248. drivers/clk/qcom/dispcc-sc7180.c +0 −19
  249. drivers/clk/qcom/videocc-sc7180.c +1 −1
  250. drivers/cpufreq/cpufreq.c +10 −2
  251. drivers/devfreq/devfreq.c +1 −3
  252. drivers/dma-buf/dma-buf.c +1 −0
  253. drivers/dma/coh901318.c +0 −4
  254. drivers/dma/idxd/cdev.c +2 −2
  255. drivers/dma/idxd/sysfs.c +23 −4
  256. drivers/dma/imx-sdma.c +3 −2
  257. drivers/dma/tegra20-apb-dma.c +1 −5
  258. drivers/dma/ti/k3-udma.c +361 −132
  259. drivers/edac/synopsys_edac.c +7 −15
  260. drivers/firmware/efi/efi.c +2 −2
  261. drivers/firmware/efi/efivars.c +23 −9
  262. drivers/firmware/imx/imx-scu.c +27 −0
  263. drivers/firmware/imx/misc.c +4 −4
  264. drivers/firmware/imx/scu-pd.c +1 −1
  265. drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 −3
  266. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 −0
  267. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 −1
  268. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1 −0
  269. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +52 −46
  270. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 −0
  271. drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +36 −1
  272. drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +1 −1
  273. drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +1 −1
  274. drivers/gpu/drm/amd/amdgpu/soc15.c +23 −2
  275. drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 −1
  276. drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +1 −1
  277. drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +1 −1
  278. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +84 −3
  279. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 −0
  280. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +11 −0
  281. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +2 −2
  282. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +0 −1
  283. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +114 −0
  284. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +0 −1
  285. drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_offset.h +2 −0
  286. drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +6 −3
  287. drivers/gpu/drm/amd/powerplay/navi10_ppt.c +13 −9
  288. drivers/gpu/drm/amd/powerplay/renoir_ppt.c +6 −5
  289. drivers/gpu/drm/amd/powerplay/smu_v11_0.c +5 −1
  290. drivers/gpu/drm/amd/powerplay/smu_v12_0.c +0 −3
  291. drivers/gpu/drm/arm/display/komeda/komeda_drv.c +2 −2
  292. drivers/gpu/drm/bochs/bochs_hw.c +2 −4
  293. drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +1 −2
  294. drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +26 −20
  295. drivers/gpu/drm/drm_dp_mst_topology.c +126 −58
  296. drivers/gpu/drm/drm_gem_shmem_helper.c +11 −5
  297. drivers/gpu/drm/drm_lease.c +2 −1
  298. drivers/gpu/drm/exynos/exynos5433_drm_decon.c +3 −2
  299. drivers/gpu/drm/exynos/exynos7_drm_decon.c +3 −2
  300. drivers/gpu/drm/exynos/exynos_drm_dma.c +19 −9
  301. drivers/gpu/drm/exynos/exynos_drm_drv.h +4 −2
  302. drivers/gpu/drm/exynos/exynos_drm_dsi.c +7 −5
  303. drivers/gpu/drm/exynos/exynos_drm_fimc.c +3 −2
  304. drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 −2
  305. drivers/gpu/drm/exynos/exynos_drm_g2d.c +3 −2
  306. drivers/gpu/drm/exynos/exynos_drm_gsc.c +3 −2
  307. drivers/gpu/drm/exynos/exynos_drm_rotator.c +3 −2
  308. drivers/gpu/drm/exynos/exynos_drm_scaler.c +4 −2
  309. drivers/gpu/drm/exynos/exynos_hdmi.c +12 −10
  310. drivers/gpu/drm/exynos/exynos_mixer.c +5 −2
  311. drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h +0 −1
  312. drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0 −20
  313. drivers/gpu/drm/i915/Makefile +1 −1
  314. drivers/gpu/drm/i915/display/intel_display_power.c +24 −5
  315. drivers/gpu/drm/i915/display/intel_psr.c +21 −4
  316. drivers/gpu/drm/i915/display/intel_psr.h +1 −0
  317. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +2 −1
  318. drivers/gpu/drm/i915/gem/i915_gem_object.c +1 −0
  319. drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +1 −3
  320. drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +1 −1
  321. drivers/gpu/drm/i915/gt/intel_gt_requests.c +11 −3
  322. drivers/gpu/drm/i915/gt/intel_lrc.c +30 −51
  323. drivers/gpu/drm/i915/gt/intel_timeline.c +6 −2
  324. drivers/gpu/drm/i915/gt/intel_workarounds.c +29 −15
  325. drivers/gpu/drm/i915/gvt/display.c +2 −1
  326. drivers/gpu/drm/i915/gvt/dmabuf.c +1 −1
  327. drivers/gpu/drm/i915/gvt/opregion.c +2 −3
  328. drivers/gpu/drm/i915/gvt/vgpu.c +10 −4
  329. drivers/gpu/drm/i915/i915_drv.c +3 −0
  330. drivers/gpu/drm/i915/i915_drv.h +1 −1
  331. drivers/gpu/drm/i915/i915_pci.c +2 −2
  332. drivers/gpu/drm/i915/i915_perf.c +41 −17
  333. drivers/gpu/drm/i915/i915_perf_types.h +2 −1
  334. drivers/gpu/drm/i915/i915_pmu.c +31 −28
  335. drivers/gpu/drm/i915/i915_pmu.h +9 −2
  336. drivers/gpu/drm/i915/i915_reg.h +1 −0
  337. drivers/gpu/drm/i915/i915_request.c +48 −21
  338. drivers/gpu/drm/i915/i915_request.h +2 −0
  339. drivers/gpu/drm/i915/i915_utils.h +5 −0
  340. drivers/gpu/drm/mediatek/mtk_drm_crtc.c +20 −10
  341. drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +1 −0
  342. drivers/gpu/drm/mediatek/mtk_drm_plane.c +7 −0
  343. drivers/gpu/drm/panfrost/panfrost_mmu.c +19 −25
  344. drivers/gpu/drm/radeon/radeon_drv.c +41 −2
  345. drivers/gpu/drm/radeon/radeon_kms.c +6 −0
  346. drivers/gpu/drm/sun4i/sun8i_mixer.c +92 −12
  347. drivers/gpu/drm/sun4i/sun8i_mixer.h +11 −0
  348. drivers/gpu/drm/sun4i/sun8i_vi_layer.c +58 −8
  349. drivers/gpu/drm/ttm/ttm_bo_util.c +1 −0
  350. drivers/gpu/drm/virtio/virtgpu_object.c +3 −2
  351. drivers/hid/hid-alps.c +1 −1
  352. drivers/hid/hid-apple.c +2 −1
  353. drivers/hid/hid-bigbenff.c +24 −7
  354. drivers/hid/hid-core.c +3 −1
  355. drivers/hid/hid-google-hammer.c +2 −0
  356. drivers/hid/hid-hyperv.c +2 −4
  357. drivers/hid/hid-ids.h +2 −0
  358. drivers/hid/hid-ite.c +3 −2
  359. drivers/hid/hid-logitech-hidpp.c +21 −22
  360. drivers/hid/hid-picolcd_fb.c +2 −2
  361. drivers/hid/hid-quirks.c +1 −0
  362. drivers/hid/hid-sensor-custom.c +3 −3
  363. drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +8 −0
  364. drivers/hid/usbhid/hiddev.c +1 −1
  365. drivers/hwmon/adt7462.c +1 −1
  366. drivers/hwmon/pmbus/xdpe12284.c +54 −0
  367. drivers/hwtracing/intel_th/msu.c +7 −6
  368. drivers/hwtracing/intel_th/pci.c +5 −0
  369. drivers/hwtracing/stm/p_sys-t.c +3 −3
  370. drivers/i2c/busses/i2c-altera.c +1 −1
  371. drivers/i2c/busses/i2c-designware-pcidrv.c +1 −0
  372. drivers/i2c/busses/i2c-gpio.c +1 −1
  373. drivers/i2c/busses/i2c-i801.c +12 −33
  374. drivers/i2c/busses/i2c-jz4780.c +2 −34
  375. drivers/i2c/i2c-core-acpi.c +9 −1
  376. drivers/ide/ide-gd.c +1 −1
  377. drivers/iio/accel/adxl372.c +1 −0
  378. drivers/iio/accel/st_accel_i2c.c +1 −1
  379. drivers/iio/adc/at91-sama5d2_adc.c +15 −0
  380. drivers/iio/adc/stm32-dfsdm-adc.c +10 −33
  381. drivers/iio/chemical/Kconfig +2 −0
  382. drivers/iio/light/vcnl4000.c +8 −7
  383. drivers/iio/magnetometer/ak8974.c +1 −1
  384. drivers/iio/proximity/ping.c +1 −1
  385. drivers/iio/trigger/stm32-timer-trigger.c +9 −2
  386. drivers/infiniband/core/cm.c +1 −0
  387. drivers/infiniband/core/cma.c +11 −4
  388. drivers/infiniband/core/core_priv.h +14 −0
  389. drivers/infiniband/core/iwcm.c +3 −1
  390. drivers/infiniband/core/nldev.c +2 −0
  391. drivers/infiniband/core/rw.c +20 −11
  392. drivers/infiniband/core/security.c +9 −5
  393. drivers/infiniband/core/umem_odp.c +19 −5
  394. drivers/infiniband/core/uverbs_cmd.c +0 −9
  395. drivers/infiniband/core/verbs.c +0 −10
  396. drivers/infiniband/hw/hfi1/verbs.c +3 −1
  397. drivers/infiniband/hw/mlx5/mlx5_ib.h +1 −0
  398. drivers/infiniband/hw/mlx5/odp.c +7 −10
  399. drivers/infiniband/hw/qib/qib_verbs.c +2 −0
  400. drivers/infiniband/sw/siw/siw_main.c +3 −3
  401. drivers/interconnect/core.c +9 −0
  402. drivers/iommu/amd_iommu.c +2 −2
  403. drivers/iommu/dma-iommu.c +8 −8
  404. drivers/iommu/dmar.c +17 −7
  405. drivers/iommu/intel-iommu-debugfs.c +35 −16
  406. drivers/iommu/intel-iommu.c +19 −9
  407. drivers/iommu/io-pgtable-arm.c +2 −2
  408. drivers/irqchip/irq-gic-v3.c +29 −1
  409. drivers/macintosh/therm_windtunnel.c +31 −21
  410. drivers/macintosh/windfarm_ad7417_sensor.c +7 −0
  411. drivers/macintosh/windfarm_fcu_controls.c +7 −0
  412. drivers/macintosh/windfarm_lm75_sensor.c +15 −1
  413. drivers/macintosh/windfarm_lm87_sensor.c +7 −0
  414. drivers/macintosh/windfarm_max6690_sensor.c +7 −0
  415. drivers/macintosh/windfarm_smu_sat.c +7 −0
  416. drivers/md/bcache/alloc.c +2 −16
  417. drivers/md/bcache/btree.c +0 −13
  418. drivers/md/dm-bio-record.h +15 −0
  419. drivers/md/dm-cache-target.c +3 −3
  420. drivers/md/dm-integrity.c +43 −41
  421. drivers/md/dm-mpath.c +1 −1
  422. drivers/md/dm-thin-metadata.c +1 −1
  423. drivers/md/dm-verity-target.c +1 −1
  424. drivers/md/dm-writecache.c +12 −4
  425. drivers/md/dm-zoned-target.c +5 −5
  426. drivers/md/dm.c +11 −11
  427. drivers/media/mc/mc-entity.c +2 −2
  428. drivers/media/platform/vicodec/codec-v4l2-fwht.c +9 −25
  429. drivers/media/usb/pulse8-cec/pulse8-cec.c +7 −5
  430. drivers/media/v4l2-core/v4l2-mem2mem.c +2 −2
  431. drivers/misc/altera-stapl/altera.c +6 −6
  432. drivers/misc/cardreader/rts5227.c +1 −1
  433. drivers/misc/cardreader/rts5249.c +2 −0
  434. drivers/misc/cardreader/rts5260.c +1 −1
  435. drivers/misc/cardreader/rts5261.c +1 −1
  436. drivers/misc/eeprom/at24.c +2 −1
  437. drivers/mmc/core/core.c +4 −1
  438. drivers/mmc/core/mmc.c +5 −2
  439. drivers/mmc/core/mmc_ops.c +4 −2
  440. drivers/mmc/host/rtsx_pci_sdmmc.c +8 −5
  441. drivers/mmc/host/sdhci-acpi.c +82 −2
  442. drivers/mmc/host/sdhci-cadence.c +16 −2
  443. drivers/mmc/host/sdhci-msm.c +1 −1
  444. drivers/mmc/host/sdhci-of-at91.c +6 −2
  445. drivers/mmc/host/sdhci-omap.c +3 −0
  446. drivers/mmc/host/sdhci-pci-gli.c +17 −0
  447. drivers/mmc/host/sdhci-tegra.c +3 −0
  448. drivers/net/bonding/bond_alb.c +10 −10
  449. drivers/net/can/dev.c +1 −0
  450. drivers/net/dsa/bcm_sf2.c +1 −2
  451. drivers/net/dsa/mv88e6xxx/chip.c +2 −0
  452. drivers/net/dsa/mv88e6xxx/global1.c +2 −2
  453. drivers/net/dsa/mv88e6xxx/global2.c +7 −1
  454. drivers/net/dsa/sja1105/sja1105_main.c +2 −1
  455. drivers/net/ethernet/broadcom/bcmsysport.c +1 −1
  456. drivers/net/ethernet/broadcom/bnxt/bnxt.c +4 −4
  457. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +5 −5
  458. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +13 −15
  459. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +24 −24
  460. drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +5 −5
  461. drivers/net/ethernet/broadcom/genet/bcmmii.c +1 −0
  462. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +27 −22
  463. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +108 −6
  464. drivers/net/ethernet/freescale/fec_main.c +3 −3
  465. drivers/net/ethernet/freescale/fman/Kconfig +28 −0
  466. drivers/net/ethernet/freescale/fman/fman.c +18 −0
  467. drivers/net/ethernet/freescale/fman/fman.h +5 −0
  468. drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h +1 −0
  469. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +1 −1
  470. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +42 −5
  471. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +1 −0
  472. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +3 −0
  473. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +1 −0
  474. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h +1 −1
  475. drivers/net/ethernet/huawei/hinic/hinic_hw_if.h +1 −0
  476. drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h +1 −0
  477. drivers/net/ethernet/huawei/hinic/hinic_main.c +2 −1
  478. drivers/net/ethernet/huawei/hinic/hinic_rx.c +2 −3
  479. drivers/net/ethernet/ibm/ibmvnic.c +22 −2
  480. drivers/net/ethernet/ibm/ibmvnic.h +5 −1
  481. drivers/net/ethernet/marvell/mvmdio.c +3 −3
  482. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 −2
  483. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +1 −2
  484. drivers/net/ethernet/mellanox/mlx5/core/lag.c +3 −8
  485. drivers/net/ethernet/mellanox/mlx5/core/lag.h +0 −1
  486. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +1 −1
  487. drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +1 −1
  488. drivers/net/ethernet/micrel/ks8851_mll.c +8 −6
  489. drivers/net/ethernet/mscc/ocelot.c +17 −11
  490. drivers/net/ethernet/pensando/ionic/ionic_lif.c +4 −4
  491. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +91 −95
  492. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h +2 −1
  493. drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c +5 −2
  494. drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c +0 −8
  495. drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.h +0 −1
  496. drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +1 −1
  497. drivers/net/ethernet/sfc/ef10.c +17 −15
  498. drivers/net/ethernet/sfc/efx.h +1 −0
  499. drivers/net/ethernet/sfc/efx_channels.c +1 −0
  500. drivers/net/ethernet/sfc/net_driver.h +0 −3
  501. drivers/net/ethernet/sfc/ptp.c +35 −3
  502. drivers/net/ethernet/sfc/tx.c +38 −0
  503. drivers/net/ethernet/sfc/tx_common.c +16 −13
  504. drivers/net/ethernet/sfc/tx_common.h +6 −0
  505. drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +2 −1
  506. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +8 −5
  507. drivers/net/ethernet/xilinx/ll_temac.h +4 −0
  508. drivers/net/ethernet/xilinx/ll_temac_main.c +171 −38
  509. drivers/net/hyperv/netvsc.c +1 −1
  510. drivers/net/hyperv/netvsc_drv.c +3 −0
  511. drivers/net/ipvlan/ipvlan_core.c +11 −8
  512. drivers/net/ipvlan/ipvlan_main.c +1 −4
  513. drivers/net/macsec.c +20 −5
  514. drivers/net/macvlan.c +2 −0
  515. drivers/net/phy/bcm63xx.c +1 −0
  516. drivers/net/phy/marvell.c +5 −0
  517. drivers/net/phy/mscc.c +2 −2
  518. drivers/net/phy/phy-c45.c +3 −3
  519. drivers/net/phy/phy.c +2 −1
  520. drivers/net/phy/phy_device.c +11 −6
  521. drivers/net/phy/phylink.c +7 −1
  522. drivers/net/slip/slhc.c +10 −4
  523. drivers/net/slip/slip.c +3 −0
  524. drivers/net/team/team.c +2 −0
  525. drivers/net/usb/qmi_wwan.c +3 −0
  526. drivers/net/usb/r8152.c +8 −0
  527. drivers/net/veth.c +1 −1
  528. drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +2 −1
  529. drivers/net/wireless/mediatek/mt76/dma.c +6 −3
  530. drivers/nvme/host/pci.c +1 −1
  531. drivers/of/of_mdio.c +1 −0
  532. drivers/pci/controller/pcie-brcmstb.c +1 −1
  533. drivers/perf/arm_pmu_acpi.c +2 −5
  534. drivers/perf/fsl_imx8_ddr_perf.c +6 −4
  535. drivers/phy/allwinner/phy-sun50i-usb3.c +1 −1
  536. drivers/phy/broadcom/phy-brcm-sata.c +65 −83
  537. drivers/phy/motorola/phy-mapphone-mdm6600.c +24 −3
  538. drivers/phy/phy-core.c +6 −12
  539. drivers/phy/ti/phy-gmii-sel.c +5 −5
  540. drivers/pinctrl/cirrus/pinctrl-madera-core.c +13 −0
  541. drivers/pinctrl/core.c +0 −1
  542. drivers/pinctrl/freescale/pinctrl-scu.c +2 −2
  543. drivers/pinctrl/meson/pinctrl-meson-gxl.c +2 −2
  544. drivers/pinctrl/pinctrl-falcon.c +1 −1
  545. drivers/pinctrl/qcom/pinctrl-msm.c +1 −2
  546. drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +1 −1
  547. drivers/platform/chrome/wilco_ec/properties.c +1 −1
  548. drivers/regulator/stm32-vrefbuf.c +2 −1
  549. drivers/reset/Kconfig +2 −1
  550. drivers/rtc/Kconfig +1 −0
  551. drivers/s390/block/dasd.c +24 −3
  552. drivers/s390/block/dasd_eckd.c +156 −7
  553. drivers/s390/block/dasd_int.h +13 −2
  554. drivers/s390/net/qeth_core.h +2 −2
  555. drivers/s390/net/qeth_core_main.c +118 −58
  556. drivers/s390/net/qeth_core_sys.c +4 −5
  557. drivers/s390/net/qeth_l2_main.c +1 −0
  558. drivers/s390/net/qeth_l3_main.c +1 −0
  559. drivers/s390/net/qeth_l3_sys.c +4 −5
  560. drivers/s390/scsi/zfcp_fsf.h +1 −1
  561. drivers/s390/scsi/zfcp_sysfs.c +1 −1
  562. drivers/scsi/ipr.c +2 −1
  563. drivers/scsi/ipr.h +1 −0
  564. drivers/scsi/libfc/fc_disc.c +2 −0
  565. drivers/scsi/sd_zbc.c +6 −1
  566. drivers/scsi/sr.c +1 −1
  567. drivers/scsi/ufs/ufshcd.c +14 −7
  568. drivers/slimbus/qcom-ngd-ctrl.c +3 −0
  569. drivers/soc/imx/soc-imx-scu.c +1 −1
  570. drivers/spi/atmel-quadspi.c +11 −0
  571. drivers/spi/spi-bcm63xx-hsspi.c +0 −1
  572. drivers/spi/spi-omap2-mcspi.c +64 −39
  573. drivers/spi/spi-pxa2xx.c +23 −0
  574. drivers/spi/spi-qup.c +7 −4
  575. drivers/spi/spi-zynqmp-gqspi.c +0 −3
  576. drivers/spi/spi.c +15 −17
  577. drivers/spi/spidev.c +5 −0
  578. drivers/staging/greybus/tools/loopback_test.c +11 −10
  579. drivers/staging/media/hantro/hantro_drv.c +2 −2
  580. drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 −0
  581. drivers/staging/speakup/main.c +1 −1
  582. drivers/staging/speakup/selection.c +0 −2
  583. drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt +1 −1
  584. drivers/staging/wfx/hif_tx.c +8 −7
  585. drivers/staging/wfx/hif_tx.h +1 −1
  586. drivers/staging/wfx/hif_tx_mib.h +10 −5
  587. drivers/staging/wfx/sta.c +15 −10
  588. drivers/tee/amdtee/Kconfig +1 −1
  589. drivers/tee/amdtee/core.c +24 −24
  590. drivers/thunderbolt/switch.c +1 −1
  591. drivers/tty/serdev/core.c +10 −0
  592. drivers/tty/serial/8250/8250_exar.c +33 −0
  593. drivers/tty/serial/fsl_lpuart.c +26 −15
  594. drivers/tty/serial/mvebu-uart.c +1 −1
  595. drivers/tty/tty_io.c +6 −8
  596. drivers/tty/vt/selection.c +18 −9
  597. drivers/tty/vt/vt.c +0 −2
  598. drivers/usb/cdns3/gadget.c +15 −4
  599. drivers/usb/chipidea/udc.c +4 −3
  600. drivers/usb/class/cdc-acm.c +21 −13
  601. drivers/usb/core/hub.c +6 −2
  602. drivers/usb/core/port.c +8 −2
  603. drivers/usb/core/quirks.c +9 −0
  604. drivers/usb/dwc3/gadget.c +8 −1
  605. drivers/usb/host/xhci-pci.c +2 −1
  606. drivers/usb/host/xhci-plat.c +1 −0
  607. drivers/usb/host/xhci-trace.h +6 −17
  608. drivers/usb/misc/usb251xb.c +16 −4
  609. drivers/usb/serial/option.c +2 −0
  610. drivers/usb/serial/pl2303.c +1 −0
  611. drivers/usb/serial/pl2303.h +1 −0
  612. drivers/usb/storage/unusual_devs.h +6 −0
  613. drivers/usb/typec/ucsi/displayport.c +11 −1
  614. drivers/vhost/net.c +1 −9
  615. drivers/video/backlight/Kconfig +7 −0
  616. drivers/video/backlight/Makefile +1 −0
  617. drivers/video/backlight/led_bl.c +260 −0
  618. drivers/video/console/vgacon.c +3 −0
  619. drivers/virtio/virtio_balloon.c +1 −1
  620. drivers/virtio/virtio_ring.c +2 −2
  621. drivers/watchdog/iTCO_vendor.h +2 −0
  622. drivers/watchdog/iTCO_vendor_support.c +9 −7
  623. drivers/watchdog/iTCO_wdt.c +16 −12
  624. drivers/watchdog/wdat_wdt.c +24 −1
  625. drivers/xen/xen-pciback/pciback.h +1 −1
  626. drivers/xen/xenbus/xenbus_comms.c +4 −0
  627. drivers/xen/xenbus/xenbus_probe.c +5 −5
  628. drivers/xen/xenbus/xenbus_probe_backend.c +3 −2
  629. drivers/xen/xenbus/xenbus_xs.c +6 −3
  630. fs/afs/addr_list.c +1 −1
  631. fs/afs/internal.h +1 −1
  632. fs/btrfs/inode.c +3 −1
  633. fs/cifs/cifs_dfs_ref.c +2 −0
  634. fs/cifs/cifsfs.c +2 −0
  635. fs/cifs/cifsglob.h +7 −0
  636. fs/cifs/cifsproto.h +3 −2
  637. fs/cifs/cifssmb.c +2 −1
  638. fs/cifs/dir.c +0 −1
  639. fs/cifs/file.c +14 −8
  640. fs/cifs/inode.c +11 −7
  641. fs/cifs/smb1ops.c +1 −1
  642. fs/cifs/smb2inode.c +2 −2
  643. fs/cifs/smb2ops.c +5 −2
  644. fs/cifs/smb2pdu.c +1 −0
  645. fs/crypto/keysetup.c +9 −0
  646. fs/debugfs/file.c +4 −13
  647. fs/ext4/super.c +3 −3
  648. fs/fat/inode.c +7 −12
  649. fs/fcntl.c +4 −2
  650. fs/fuse/dev.c +3 −3
  651. fs/fuse/fuse_i.h +2 −0
  652. fs/gfs2/inode.c +1 −1
  653. fs/inode.c +1 −0
  654. fs/io-wq.c +15 −62
  655. fs/io-wq.h +4 −12
  656. fs/io_uring.c +90 −64
  657. fs/jbd2/transaction.c +4 −4
  658. fs/locks.c +44 −16
  659. fs/nfs/client.c +1 −0
  660. fs/nfs/fs_context.c +9 −0
  661. fs/nfs/fscache.c +2 −0
  662. fs/nfs/namespace.c +1 −1
  663. fs/nfs/nfs4client.c +0 −1
  664. fs/open.c +0 −3
  665. fs/overlayfs/Kconfig +1 −0
  666. fs/overlayfs/file.c +6 −0
  667. fs/overlayfs/overlayfs.h +6 −1
  668. fs/overlayfs/super.c +8 −1
  669. fs/overlayfs/util.c +2 −2
  670. fs/zonefs/Kconfig +1 −0
  671. fs/zonefs/super.c +4 −4
  672. include/acpi/actypes.h +2 −1
  673. include/crypto/curve25519.h +4 −2
  674. include/drm/drm_dp_mst_helper.h +2 −2
  675. include/drm/drm_gem_shmem_helper.h +5 −0
  676. include/dt-bindings/clock/imx8mn-clock.h +2 −2
  677. include/linux/blkdev.h +1 −2
  678. include/linux/blktrace_api.h +13 −5
  679. include/linux/bootconfig.h +3 −0
  680. include/linux/cgroup.h +1 −0
  681. include/linux/debugfs.h +6 −7
  682. include/linux/device.h +11 −0
  683. include/linux/dmar.h +9 −5
  684. include/linux/fs.h +1 −0
  685. include/linux/futex.h +10 −7
  686. include/linux/genhd.h +1 −12
  687. include/linux/hid.h +1 −1
  688. include/linux/icmpv6.h +10 −6
  689. include/linux/inet_diag.h +12 −6
  690. include/linux/intel-iommu.h +2 −0
  691. include/linux/kvm_host.h +3 −1
  692. include/linux/mm.h +4 −0
  693. include/linux/mmc/host.h +1 −0
  694. include/linux/netfilter/ipset/ip_set.h +10 −1
  695. include/linux/of_clk.h +4 −4
  696. include/linux/phy.h +3 −0
  697. include/linux/platform_data/spi-omap2-mcspi.h +1 −0
  698. include/linux/platform_device.h +1 −1
  699. include/linux/rhashtable.h +1 −1
  700. include/linux/workqueue.h +16 −0
  701. include/net/fib_rules.h +1 −0
  702. include/soc/mscc/ocelot_dev.h +1 −1
  703. include/sound/soc.h +1 −1
  704. include/uapi/linux/dm-ioctl.h +2 −2
  705. include/uapi/linux/in.h +2 −0
  706. include/xen/interface/io/tpmif.h +1 −1
  707. include/xen/xenbus.h +2 −1
  708. init/Kconfig +3 −5
  709. init/main.c +22 −16
  710. kernel/audit.c +21 −19
  711. kernel/auditfilter.c +39 −32
  712. kernel/cgroup/cgroup-v1.c +2 −1
  713. kernel/cgroup/cgroup.c +30 −13
  714. kernel/exit.c +2 −2
  715. kernel/fork.c +1 −1
  716. kernel/futex.c +55 −38
  717. kernel/pid.c +10 −0
  718. kernel/power/snapshot.c +1 −1
  719. kernel/sched/fair.c +2 −0
  720. kernel/signal.c +14 −9
  721. kernel/sys.c +2 −0
  722. kernel/trace/Kconfig +2 −2
  723. kernel/trace/blktrace.c +86 −31
  724. kernel/trace/ftrace.c +2 −0
  725. kernel/trace/synth_event_gen_test.c +22 −22
  726. kernel/trace/trace.c +2 −0
  727. kernel/trace/trace_events_hist.c +101 −11
  728. kernel/workqueue.c +8 −6
  729. lib/bootconfig.c +27 −9
  730. lib/crypto/chacha20poly1305.c +3 −0
  731. mm/huge_memory.c +1 −2
  732. mm/memcontrol.c +2 −12
  733. mm/memory.c +27 −8
  734. mm/memory_hotplug.c +7 −1
  735. mm/mprotect.c +36 −2
  736. mm/shmem.c +0 −2
  737. mm/slub.c +13 −2
  738. mm/z3fold.c +0 −1
  739. net/batman-adv/bat_iv_ogm.c +4 −0
  740. net/bridge/br_device.c +2 −4
  741. net/caif/caif_dev.c +2 −1
  742. net/core/dev.c +2 −0
  743. net/core/devlink.c +44 −27
  744. net/core/netclassid_cgroup.c +37 −10
  745. net/core/sock.c +4 −1
  746. net/dsa/dsa_priv.h +2 −0
  747. net/dsa/port.c +35 −9
  748. net/dsa/slave.c +2 −6
  749. net/ethtool/bitset.c +2 −1
  750. net/ethtool/bitset.h +2 −0
  751. net/ieee802154/nl_policy.c +6 −0
  752. net/ipv4/cipso_ipv4.c +6 −1
  753. net/ipv4/gre_demux.c +10 −2
  754. net/ipv4/inet_connection_sock.c +20 −0
  755. net/ipv4/inet_diag.c +20 −24
  756. net/ipv4/raw_diag.c +3 −2
  757. net/ipv4/tcp_input.c +5 −1
  758. net/ipv4/udp_diag.c +3 −2
  759. net/ipv6/addrconf.c +40 −11
  760. net/ipv6/ipv6_sockglue.c +8 −2
  761. net/ipv6/seg6_iptunnel.c +1 −1
  762. net/ipv6/seg6_local.c +1 −1
  763. net/mac80211/mesh_hwmp.c +2 −1
  764. net/mac80211/mlme.c +1 −5
  765. net/mac80211/rx.c +1 −1
  766. net/mptcp/options.c +17 −2
  767. net/mptcp/protocol.c +6 −0
  768. net/netfilter/ipset/ip_set_core.c +24 −10
  769. net/netfilter/ipset/ip_set_hash_gen.h +440 −195
  770. net/netfilter/nf_conntrack_standalone.c +1 −1
  771. net/netfilter/nf_synproxy_core.c +1 −1
  772. net/netfilter/nf_tables_api.c +14 −8
  773. net/netfilter/nfnetlink_cthelper.c +2 −0
  774. net/netfilter/nft_chain_nat.c +1 −0
  775. net/netfilter/nft_payload.c +1 −0
  776. net/netfilter/nft_set_pipapo.c +4 −2
  777. net/netfilter/nft_tunnel.c +2 −0
  778. net/netfilter/x_tables.c +3 −3
  779. net/netfilter/xt_hashlimit.c +6 −10
  780. net/netfilter/xt_recent.c +1 −1
  781. net/netlink/af_netlink.c +1 −1
  782. net/netlink/genetlink.c +3 −2
  783. net/nfc/hci/core.c +16 −3
  784. net/nfc/netlink.c +4 −0
  785. net/openvswitch/datapath.c +1 −0
  786. net/packet/af_packet.c +7 −6
  787. net/sched/act_api.c +1 −0
  788. net/sched/sch_fq.c +1 −0
  789. net/sched/sch_taprio.c +10 −3
  790. net/sctp/diag.c +2 −6
  791. net/smc/af_smc.c +15 −10
  792. net/smc/smc_core.c +12 −0
  793. net/smc/smc_core.h +1 −1
  794. net/smc/smc_ib.c +3 −0
  795. net/tipc/netlink.c +1 −0
  796. net/unix/af_unix.c +4 −0
  797. net/vmw_vsock/af_vsock.c +12 −8
  798. net/vmw_vsock/hyperv_transport.c +0 −3
  799. net/vmw_vsock/virtio_transport_common.c +0 −2
  800. net/wireless/nl80211.c +8 −2
  801. net/wireless/reg.c +1 −1
  802. scripts/Kconfig.include +7 −0
  803. scripts/Makefile.extrawarn +1 −0
  804. scripts/Makefile.lib +3 −3
  805. scripts/export_report.pl +1 −1
  806. scripts/kallsyms.c +4 −4
  807. scripts/mod/modpost.c +14 −13
  808. scripts/parse-maintainers.pl +0 −0
  809. sound/core/oss/pcm_plugin.c +10 −2
  810. sound/core/seq/oss/seq_oss_midi.c +1 −0
  811. sound/core/seq/seq_virmidi.c +1 −0
  812. sound/mips/sgio2audio.c +0 −6
  813. sound/pci/hda/patch_realtek.c +52 −4
  814. sound/soc/codecs/Kconfig +1 −1
  815. sound/soc/codecs/pcm512x.c +5 −3
  816. sound/soc/codecs/rt1015.c +2 −1
  817. sound/soc/codecs/tas2562.c +3 −2
  818. sound/soc/intel/skylake/skl-debug.c +17 −15
  819. sound/soc/intel/skylake/skl-ssp-clk.c +3 −1
  820. sound/soc/meson/g12a-tohdmitx.c +6 −0
  821. sound/soc/soc-component.c +1 −1
  822. sound/soc/soc-compress.c +1 −1
  823. sound/soc/soc-dapm.c +1 −1
  824. sound/soc/soc-pcm.c +9 −9
  825. sound/soc/soc-topology.c +10 −7
  826. sound/soc/sof/ipc.c +1 −1
  827. sound/soc/stm/stm32_sai_sub.c +10 −8
  828. sound/usb/line6/driver.c +1 −1
  829. sound/usb/line6/midibuf.c +1 −1
  830. tools/arch/x86/include/asm/msr-index.h +2 −0
  831. tools/arch/x86/include/uapi/asm/kvm.h +1 −0
  832. tools/bootconfig/include/linux/printk.h +1 −4
  833. tools/bootconfig/main.c +32 −19
  834. tools/bootconfig/samples/bad-mixed-kv1.bconf +3 −0
  835. tools/bootconfig/samples/bad-mixed-kv2.bconf +3 −0
  836. tools/bootconfig/samples/bad-samekey.bconf +6 −0
  837. tools/bootconfig/test-bootconfig.sh +15 −3
  838. tools/include/uapi/asm/errno.h +7 −7
  839. tools/perf/Documentation/perf-config.txt +73 −1
  840. tools/perf/arch/arm/util/cs-etm.c +2 −16
  841. tools/perf/arch/arm64/util/arm-spe.c +12 −25
  842. tools/perf/arch/arm64/util/perf_regs.c +1 −1
  843. tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +2 −0
  844. tools/perf/arch/powerpc/util/perf_regs.c +2 −2
  845. tools/perf/arch/x86/util/auxtrace.c +7 −7
  846. tools/perf/arch/x86/util/event.c +6 −6
  847. tools/perf/arch/x86/util/header.c +2 −2
  848. tools/perf/arch/x86/util/intel-bts.c +14 −27
  849. tools/perf/arch/x86/util/intel-pt.c +17 −30
  850. tools/perf/arch/x86/util/machine.c +3 −3
  851. tools/perf/arch/x86/util/perf_regs.c +4 −4
  852. tools/perf/arch/x86/util/pmu.c +3 −3
  853. tools/perf/bench/bench.h +4 −0
  854. tools/perf/bench/epoll-ctl.c +4 −4
  855. tools/perf/bench/epoll-wait.c +6 −6
  856. tools/perf/bench/futex-hash.c +7 −6
  857. tools/perf/bench/futex-lock-pi.c +6 −6
  858. tools/perf/bench/futex-requeue.c +1 −0
  859. tools/perf/bench/futex-wake-parallel.c +1 −0
  860. tools/perf/bench/futex-wake.c +3 −2
  861. tools/perf/builtin-annotate.c +2 −2
  862. tools/perf/builtin-diff.c +2 −1
  863. tools/perf/builtin-probe.c +4 −2
  864. tools/perf/builtin-report.c +1 −1
  865. tools/perf/builtin-top.c +5 −3
  866. tools/perf/include/bpf/pid_filter.h +1 −1
  867. tools/perf/include/bpf/stdio.h +1 −1
  868. tools/perf/include/bpf/unistd.h +1 −1
  869. tools/perf/pmu-events/jevents.c +9 −6
  870. tools/perf/tests/bp_account.c +1 −1
  871. tools/perf/tests/shell/lib/probe_vfs_getname.sh +1 −1
  872. tools/perf/ui/browsers/annotate.c +9 −10
  873. tools/perf/ui/gtk/annotate.c +1 −1
  874. tools/perf/util/annotate.c +75 −119
  875. tools/perf/util/annotate.h +3 −6
  876. tools/perf/util/auxtrace.c +21 −1
  877. tools/perf/util/auxtrace.h +6 −0
  878. tools/perf/util/block-info.c +2 −1
  879. tools/perf/util/config.c +12 −0
  880. tools/perf/util/config.h +1 −0
  881. tools/perf/util/env.c +2 −2
  882. tools/perf/util/map.c +1 −1
  883. tools/perf/util/parse-events.c +2 −8
  884. tools/perf/util/probe-file.c +24 −4
  885. tools/perf/util/symbol.c +6 −7
  886. tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c +1 −1
  887. tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c +1 −1
  888. tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c +2 −0
  889. tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h +1 −1
  890. tools/testing/ktest/ktest.pl +8 −8
  891. tools/testing/ktest/sample.conf +11 −11
  892. tools/testing/kunit/kunit.py +12 −0
  893. tools/testing/kunit/kunit_kernel.py +16 −12
  894. tools/testing/selftests/ftrace/Makefile +1 −1
  895. tools/testing/selftests/livepatch/Makefile +2 −0
  896. tools/testing/selftests/lkdtm/.gitignore +2 −0
  897. tools/testing/selftests/net/fib_tests.sh +31 −3
  898. tools/testing/selftests/net/mptcp/Makefile +2 −0
  899. tools/testing/selftests/netfilter/nft_concat_range.sh +45 −10
  900. tools/testing/selftests/pidfd/.gitignore +1 −0
  901. tools/testing/selftests/rseq/Makefile +3 −1
  902. tools/testing/selftests/rtc/Makefile +2 −0
  903. tools/testing/selftests/tc-testing/config +1 −0
  904. usr/Kconfig +11 −11
  905. virt/kvm/arm/arm.c +0 −2
  906. virt/kvm/arm/trace.h +1 −0
.clang-format+21−4
@@ -86,6 +86,8 @@ ForEachMacros: · 85 unmodified lines
8686 - 'bio_for_each_segment_all'
8787 - 'bio_list_for_each'
8888 - 'bip_for_each_vec'
89+ - 'bitmap_for_each_clear_region'
90+ - 'bitmap_for_each_set_region'
8991 - 'blkg_for_each_descendant_post'
9092 - 'blkg_for_each_descendant_pre'
9193 - 'blk_queue_for_each_rl'
@@ -115,6 +117,7 @@ ForEachMacros: · 23 unmodified lines
115117 - 'drm_client_for_each_connector_iter'
116118 - 'drm_client_for_each_modeset'
117119 - 'drm_connector_for_each_possible_encoder'
120+ - 'drm_for_each_bridge_in_chain'
118121 - 'drm_for_each_connector_iter'
119122 - 'drm_for_each_crtc'
120123 - 'drm_for_each_encoder'
@@ -136,9 +139,10 @@ ForEachMacros: · 15 unmodified lines
136139 - 'for_each_bio'
137140 - 'for_each_board_func_rsrc'
138141 - 'for_each_bvec'
142+ - 'for_each_card_auxs'
143+ - 'for_each_card_auxs_safe'
139144 - 'for_each_card_components'
140− - 'for_each_card_links'
141− - 'for_each_card_links_safe'
145+ - 'for_each_card_pre_auxs'
142146 - 'for_each_card_prelinks'
143147 - 'for_each_card_rtds'
144148 - 'for_each_card_rtds_safe'
@@ -166,6 +170,7 @@ ForEachMacros: · 21 unmodified lines
166170 - 'for_each_dpcm_fe'
167171 - 'for_each_drhd_unit'
168172 - 'for_each_dss_dev'
173+ - 'for_each_efi_handle'
169174 - 'for_each_efi_memory_desc'
170175 - 'for_each_efi_memory_desc_in_map'
171176 - 'for_each_element'
@@ -190,6 +195,7 @@ ForEachMacros: · 18 unmodified lines
190195 - 'for_each_lru'
191196 - 'for_each_matching_node'
192197 - 'for_each_matching_node_and_match'
198+ - 'for_each_member'
193199 - 'for_each_memblock'
194200 - 'for_each_memblock_type'
195201 - 'for_each_memcg_cache_index'
@@ -200,9 +206,11 @@ ForEachMacros: · 4 unmodified lines
200206 - 'for_each_msi_entry'
201207 - 'for_each_msi_entry_safe'
202208 - 'for_each_net'
209+ - 'for_each_net_continue_reverse'
203210 - 'for_each_netdev'
204211 - 'for_each_netdev_continue'
205212 - 'for_each_netdev_continue_rcu'
213+ - 'for_each_netdev_continue_reverse'
206214 - 'for_each_netdev_feature'
207215 - 'for_each_netdev_in_bond_rcu'
208216 - 'for_each_netdev_rcu'
@@ -254,10 +262,10 @@ ForEachMacros: · 45 unmodified lines
254262 - 'for_each_reserved_mem_region'
255263 - 'for_each_rtd_codec_dai'
256264 - 'for_each_rtd_codec_dai_rollback'
257− - 'for_each_rtdcom'
258− - 'for_each_rtdcom_safe'
265+ - 'for_each_rtd_components'
259266 - 'for_each_set_bit'
260267 - 'for_each_set_bit_from'
268+ - 'for_each_set_clump8'
261269 - 'for_each_sg'
262270 - 'for_each_sg_dma_page'
263271 - 'for_each_sg_page'
@@ -267,6 +275,7 @@ ForEachMacros: · 3 unmodified lines
267275 - 'for_each_subelement_id'
268276 - '__for_each_thread'
269277 - 'for_each_thread'
278+ - 'for_each_wakeup_source'
270279 - 'for_each_zone'
271280 - 'for_each_zone_zonelist'
272281 - 'for_each_zone_zonelist_nodemask'
@@ -330,6 +339,7 @@ ForEachMacros: · 57 unmodified lines
330339 - 'list_for_each'
331340 - 'list_for_each_codec'
332341 - 'list_for_each_codec_safe'
342+ - 'list_for_each_continue'
333343 - 'list_for_each_entry'
334344 - 'list_for_each_entry_continue'
335345 - 'list_for_each_entry_continue_rcu'
@@ -351,6 +361,7 @@ ForEachMacros: · 15 unmodified lines
351361 - 'llist_for_each_entry'
352362 - 'llist_for_each_entry_safe'
353363 - 'llist_for_each_safe'
364+ - 'mci_for_each_dimm'
354365 - 'media_device_for_each_entity'
355366 - 'media_device_for_each_intf'
356367 - 'media_device_for_each_link'
@@ -444,10 +455,16 @@ ForEachMacros: · 87 unmodified lines
444455 - 'virtio_device_for_each_vq'
445456 - 'xa_for_each'
446457 - 'xa_for_each_marked'
458+ - 'xa_for_each_range'
447459 - 'xa_for_each_start'
448460 - 'xas_for_each'
449461 - 'xas_for_each_conflict'
450462 - 'xas_for_each_marked'
463+ - 'xbc_array_for_each_value'
464+ - 'xbc_for_each_key_value'
465+ - 'xbc_node_for_each_array_value'
466+ - 'xbc_node_for_each_child'
467+ - 'xbc_node_for_each_key_value'
451468 - 'zorro_for_each_dev'
452469
453470 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
CREDITS+5−0
@@ -567,6 +567,11 @@ D: Original author of Amiga FFS filesystem · 566 unmodified lines
567567 S: Orlando, Florida
568568 S: USA
569569
570+N: Paul Burton
571+E: paulburton@kernel.org
572+W: https://pburton.com
573+D: MIPS maintainer 2018-2020
574+
570575 N: Lennert Buytenhek
571576 E: kernel@wantstofly.org
572577 D: Original (2.4) rewrite of the ethernet bridging code
Documentation/admin-guide/acpi/fan_performance_states.rst+2−2
@@ -18,7 +18,7 @@ may look as follows:: · 17 unmodified lines
1818
1919 $ ls -l /sys/bus/acpi/devices/INT3404:00/
2020 total 0
21−...
21+ ...
2222 -r--r--r-- 1 root root 4096 Dec 13 20:38 state0
2323 -r--r--r-- 1 root root 4096 Dec 13 20:38 state1
2424 -r--r--r-- 1 root root 4096 Dec 13 20:38 state10
@@ -38,7 +38,7 @@ where each of the "state*" files represents one performance state of the fan · 13 unmodified lines
3838 and contains a colon-separated list of 5 integer numbers (fields) with the
3939 following interpretation::
4040
41−control_percent:trip_point_index:speed_rpm:noise_level_mdb:power_mw
41+ control_percent:trip_point_index:speed_rpm:noise_level_mdb:power_mw
4242
4343 * ``control_percent``: The percent value to be used to set the fan speed to a
4444 specific level using the _FSL object (0-100).
Documentation/admin-guide/bootconfig.rst+31−3
@@ -62,6 +62,30 @@ Or more shorter, written as following:: · 61 unmodified lines
6262 In both styles, same key words are automatically merged when parsing it
6363 at boot time. So you can append similar trees or key-values.
6464
65+Same-key Values
66+---------------
67+
68+It is prohibited that two or more values or arrays share a same-key.
69+For example,::
70+
71+ foo = bar, baz
72+ foo = qux # !ERROR! we can not re-define same key
73+
74+If you want to append the value to existing key as an array member,
75+you can use ``+=`` operator. For example::
76+
77+ foo = bar, baz
78+ foo += qux
79+
80+In this case, the key ``foo`` has ``bar``, ``baz`` and ``qux``.
81+
82+However, a sub-key and a value can not co-exist under a parent key.
83+For example, following config is NOT allowed.::
84+
85+ foo = value1
86+ foo.bar = value2 # !ERROR! subkey "bar" and value "value1" can NOT co-exist
87+
88+
6589 Comments
6690 --------
6791
@@ -102,9 +126,13 @@ Boot Kernel With a Boot Config · 34 unmodified lines
102126 ==============================
103127
104128 Since the boot configuration file is loaded with initrd, it will be added
105−to the end of the initrd (initramfs) image file. The Linux kernel decodes
106−the last part of the initrd image in memory to get the boot configuration
107−data.
129+to the end of the initrd (initramfs) image file with size, checksum and
130+12-byte magic word as below.
131+
132+[initrd][bootconfig][size(u32)][checksum(u32)][#BOOTCONFIG\n]
133+
134+The Linux kernel decodes the last part of the initrd image in memory to
135+get the boot configuration data.
108136 Because of this "piggyback" method, there is no need to change or
109137 update the boot loader and the kernel image itself.
110138
Documentation/admin-guide/kernel-parameters.txt+4−0
@@ -136,6 +136,10 @@ · 135 unmodified lines
136136 dynamic table installation which will install SSDT
137137 tables to /sys/firmware/acpi/tables/dynamic.
138138
139+ acpi_no_watchdog [HW,ACPI,WDT]
140+ Ignore the ACPI-based watchdog interface (WDAT) and let
141+ a native driver control the watchdog device instead.
142+
139143 acpi_rsdp= [ACPI,EFI,KEXEC]
140144 Pass the RSDP address to the kernel, mostly used
141145 on machines running EFI runtime service to boot the
Documentation/arm64/silicon-errata.rst+2−0
@@ -110,6 +110,8 @@ stable kernels. · 109 unmodified lines
110110 +----------------+-----------------+-----------------+-----------------------------+
111111 | Cavium | ThunderX GICv3 | #23154 | CAVIUM_ERRATUM_23154 |
112112 +----------------+-----------------+-----------------+-----------------------------+
113+| Cavium | ThunderX GICv3 | #38539 | N/A |
114++----------------+-----------------+-----------------+-----------------------------+
113115 | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
114116 +----------------+-----------------+-----------------+-----------------------------+
115117 | Cavium | ThunderX Core | #30115 | CAVIUM_ERRATUM_30115 |
Documentation/dev-tools/kunit/usage.rst+1−0
@@ -551,6 +551,7 @@ options to your ``.config``: · 550 unmodified lines
551551 Once the kernel is built and installed, a simple
552552
553553 .. code-block:: bash
554+
554555 modprobe example-test
555556
556557 ...will run the tests.
Documentation/devicetree/bindings/arm/arm,scmi.txt+1−1
@@ -102,7 +102,7 @@ Required sub-node properties: · 101 unmodified lines
102102 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
103103 [2] Documentation/devicetree/bindings/power/power-domain.yaml
104104 [3] Documentation/devicetree/bindings/thermal/thermal.txt
105−[4] Documentation/devicetree/bindings/sram/sram.txt
105+[4] Documentation/devicetree/bindings/sram/sram.yaml
106106 [5] Documentation/devicetree/bindings/reset/reset.txt
107107
108108 Example:
Documentation/devicetree/bindings/arm/arm,scpi.txt+1−1
@@ -109,7 +109,7 @@ Required properties: · 108 unmodified lines
109109 [0] http://infocenter.arm.com/help/topic/com.arm.doc.dui0922b/index.html
110110 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
111111 [2] Documentation/devicetree/bindings/thermal/thermal.txt
112−[3] Documentation/devicetree/bindings/sram/sram.txt
112+[3] Documentation/devicetree/bindings/sram/sram.yaml
113113 [4] Documentation/devicetree/bindings/power/power-domain.yaml
114114
115115 Example:
Documentation/devicetree/bindings/arm/bcm/brcm,bcm63138.txt+1−1
@@ -62,7 +62,7 @@ Timer node: · 61 unmodified lines
6262
6363 Syscon reboot node:
6464
65−See Documentation/devicetree/bindings/power/reset/syscon-reboot.txt for the
65+See Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml for the
6666 detailed list of properties, the two values defined below are specific to the
6767 BCM6328-style timer:
6868
Documentation/devicetree/bindings/arm/cpus.yaml+1−1
@@ -216,7 +216,7 @@ properties: · 215 unmodified lines
216216 $ref: '/schemas/types.yaml#/definitions/phandle-array'
217217 description: |
218218 List of phandles to idle state nodes supported
219− by this cpu (see ./idle-states.txt).
219+ by this cpu (see ./idle-states.yaml).
220220
221221 capacity-dmips-mhz:
222222 $ref: '/schemas/types.yaml#/definitions/uint32'
Documentation/devicetree/bindings/arm/fsl.yaml+1−1
@@ -160,7 +160,7 @@ properties: · 159 unmodified lines
160160 items:
161161 - enum:
162162 - armadeus,imx6dl-apf6 # APF6 (Solo) SoM
163− - armadeus,imx6dl-apf6dldev # APF6 (Solo) SoM on APF6Dev board
163+ - armadeus,imx6dl-apf6dev # APF6 (Solo) SoM on APF6Dev board
164164 - eckelmann,imx6dl-ci4x10
165165 - emtrion,emcon-mx6 # emCON-MX6S or emCON-MX6DL SoM
166166 - emtrion,emcon-mx6-avari # emCON-MX6S or emCON-MX6DL SoM on Avari Base
Documentation/devicetree/bindings/arm/hisilicon/hi3519-sysctrl.txt+1−1
@@ -1,7 +1,7 @@
11 * Hisilicon Hi3519 System Controller Block
22
33 This bindings use the following binding:
4−Documentation/devicetree/bindings/mfd/syscon.txt
4+Documentation/devicetree/bindings/mfd/syscon.yaml
55
66 Required properties:
77 - compatible: "hisilicon,hi3519-sysctrl".
Documentation/devicetree/bindings/arm/msm/qcom,idle-state.txt+1−1
@@ -81,4 +81,4 @@ Example: · 80 unmodified lines
8181 };
8282 };
8383
84−[1]. Documentation/devicetree/bindings/arm/idle-states.txt
84+[1]. Documentation/devicetree/bindings/arm/idle-states.yaml
Documentation/devicetree/bindings/arm/omap/mpu.txt+1−1
@@ -17,7 +17,7 @@ am335x and am437x only: · 16 unmodified lines
1717 - pm-sram: Phandles to ocmcram nodes to be used for power management.
1818 First should be type 'protect-exec' for the driver to use to copy
1919 and run PM functions, second should be regular pool to be used for
20− data region for code. See Documentation/devicetree/bindings/sram/sram.txt
20+ data region for code. See Documentation/devicetree/bindings/sram/sram.yaml
2121 for more details.
2222
2323 Examples:
Documentation/devicetree/bindings/arm/psci.yaml+17−19
@@ -100,13 +100,14 @@ properties: · 99 unmodified lines
100100 bindings in [1]) must specify this property.
101101
102102 [1] Kernel documentation - ARM idle states bindings
103− Documentation/devicetree/bindings/arm/idle-states.txt
104−
105− "#power-domain-cells":
106− description:
107− The number of cells in a PM domain specifier as per binding in [3].
108− Must be 0 as to represent a single PM domain.
103+ Documentation/devicetree/bindings/arm/idle-states.yaml
109104
105+patternProperties:
106+ "^power-domain-":
107+ allOf:
108+ - $ref: "../power/power-domain.yaml#"
109+ type: object
110+ description: |
110111 ARM systems can have multiple cores, sometimes in an hierarchical
111112 arrangement. This often, but not always, maps directly to the processor
112113 power topology of the system. Individual nodes in a topology have their
@@ -122,14 +123,8 @@ properties: · 9 unmodified lines
122123 helps to implement support for OSI mode and OS implementations may choose
123124 to mandate it.
124125
125− [3] Documentation/devicetree/bindings/power/power_domain.txt
126− [4] Documentation/devicetree/bindings/power/domain-idle-state.txt
127−
128− power-domains:
129− $ref: '/schemas/types.yaml#/definitions/phandle-array'
130− description:
131− List of phandles and PM domain specifiers, as defined by bindings of the
132− PM domain provider.
126+ [3] Documentation/devicetree/bindings/power/power-domain.yaml
127+ [4] Documentation/devicetree/bindings/power/domain-idle-state.yaml
133128
134129 required:
135130 - compatible
@@ -199,7 +194,7 @@ examples: · 63 unmodified lines
199194
200195 CPU0: cpu@0 {
201196 device_type = "cpu";
202− compatible = "arm,cortex-a53", "arm,armv8";
197+ compatible = "arm,cortex-a53";
203198 reg = <0x0>;
204199 enable-method = "psci";
205200 power-domains = <&CPU_PD0>;
@@ -208,7 +203,7 @@ examples: · 2 unmodified lines
208203
209204 CPU1: cpu@1 {
210205 device_type = "cpu";
211− compatible = "arm,cortex-a57", "arm,armv8";
206+ compatible = "arm,cortex-a53";
212207 reg = <0x100>;
213208 enable-method = "psci";
214209 power-domains = <&CPU_PD1>;
@@ -224,6 +219,9 @@ examples: · 9 unmodified lines
224219 exit-latency-us = <10>;
225220 min-residency-us = <100>;
226221 };
222+ };
223+
224+ domain-idle-states {
227225
228226 CLUSTER_RET: cluster-retention {
229227 compatible = "domain-idle-state";
@@ -247,19 +245,19 @@ examples: · 17 unmodified lines
247245 compatible = "arm,psci-1.0";
248246 method = "smc";
249247
250− CPU_PD0: cpu-pd0 {
248+ CPU_PD0: power-domain-cpu0 {
251249 #power-domain-cells = <0>;
252250 domain-idle-states = <&CPU_PWRDN>;
253251 power-domains = <&CLUSTER_PD>;
254252 };
255253
256− CPU_PD1: cpu-pd1 {
254+ CPU_PD1: power-domain-cpu1 {
257255 #power-domain-cells = <0>;
258256 domain-idle-states = <&CPU_PWRDN>;
259257 power-domains = <&CLUSTER_PD>;
260258 };
261259
262− CLUSTER_PD: cluster-pd {
260+ CLUSTER_PD: power-domain-cluster {
263261 #power-domain-cells = <0>;
264262 domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWRDN>;
265263 };
Documentation/devicetree/bindings/arm/stm32/st,mlahb.yaml+1−1
@@ -52,7 +52,7 @@ required: · 51 unmodified lines
5252
5353 examples:
5454 - |
55− mlahb: ahb {
55+ mlahb: ahb@38000000 {
5656 compatible = "st,mlahb", "simple-bus";
5757 #address-cells = <1>;
5858 #size-cells = <1>;
Documentation/devicetree/bindings/bus/allwinner,sun8i-a23-rsb.yaml+0−1
@@ -70,7 +70,6 @@ examples: · 69 unmodified lines
7070 #size-cells = <0>;
7171
7272 pmic@3e3 {
73− compatible = "...";
7473 reg = <0x3e3>;
7574
7675 /* ... */
Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-osc-clk.yaml+1−1
@@ -40,7 +40,7 @@ additionalProperties: false · 39 unmodified lines
4040
4141 examples:
4242 - |
43− osc24M: clk@01c20050 {
43+ osc24M: clk@1c20050 {
4444 #clock-cells = <0>;
4545 compatible = "allwinner,sun4i-a10-osc-clk";
4646 reg = <0x01c20050 0x4>;
Documentation/devicetree/bindings/clock/allwinner,sun9i-a80-gt-clk.yaml+1−1
@@ -41,7 +41,7 @@ additionalProperties: false · 40 unmodified lines
4141
4242 examples:
4343 - |
44− clk@0600005c {
44+ clk@600005c {
4545 #clock-cells = <0>;
4646 compatible = "allwinner,sun9i-a80-gt-clk";
4747 reg = <0x0600005c 0x4>;
Documentation/devicetree/bindings/clock/qcom,gcc-apq8064.yaml+1−1
@@ -42,7 +42,7 @@ properties: · 41 unmodified lines
4242 be part of GCC and hence the TSENS properties can also be part
4343 of the GCC/clock-controller node.
4444 For more details on the TSENS properties please refer
45− Documentation/devicetree/bindings/thermal/qcom-tsens.txt
45+ Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
4646
4747 nvmem-cell-names:
4848 minItems: 1
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tv-encoder.yaml+1−5
@@ -49,11 +49,7 @@ examples: · 48 unmodified lines
4949 resets = <&tcon_ch0_clk 0>;
5050
5151 port {
52− #address-cells = <1>;
53− #size-cells = <0>;
54−
55− tve0_in_tcon0: endpoint@0 {
56− reg = <0>;
52+ tve0_in_tcon0: endpoint {
5753 remote-endpoint = <&tcon0_out_tve0>;
5854 };
5955 };
Documentation/devicetree/bindings/display/bridge/anx6345.yaml+2−8
@@ -79,21 +79,15 @@ examples: · 78 unmodified lines
7979 #size-cells = <0>;
8080
8181 anx6345_in: port@0 {
82− #address-cells = <1>;
83− #size-cells = <0>;
8482 reg = <0>;
85− anx6345_in_tcon0: endpoint@0 {
86− reg = <0>;
83+ anx6345_in_tcon0: endpoint {
8784 remote-endpoint = <&tcon0_out_anx6345>;
8885 };
8986 };
9087
9188 anx6345_out: port@1 {
92− #address-cells = <1>;
93− #size-cells = <0>;
9489 reg = <1>;
95− anx6345_out_panel: endpoint@0 {
96− reg = <0>;
90+ anx6345_out_panel: endpoint {
9791 remote-endpoint = <&panel_in_edp>;
9892 };
9993 };
Documentation/devicetree/bindings/display/panel/leadtek,ltk500hd1829.yaml+2−0
@@ -37,6 +37,8 @@ examples: · 36 unmodified lines
3737 dsi@ff450000 {
3838 #address-cells = <1>;
3939 #size-cells = <0>;
40+ reg = <0xff450000 0x1000>;
41+
4042 panel@0 {
4143 compatible = "leadtek,ltk500hd1829";
4244 reg = <0>;
Documentation/devicetree/bindings/display/panel/xinpeng,xpp055c272.yaml+2−0
@@ -37,6 +37,8 @@ examples: · 36 unmodified lines
3737 dsi@ff450000 {
3838 #address-cells = <1>;
3939 #size-cells = <0>;
40+ reg = <0xff450000 0x1000>;
41+
4042 panel@0 {
4143 compatible = "xinpeng,xpp055c272";
4244 reg = <0>;
Documentation/devicetree/bindings/display/simple-framebuffer.yaml+1−5
@@ -174,10 +174,6 @@ examples: · 173 unmodified lines
174174 };
175175 };
176176
177− soc@1c00000 {
178− lcdc0: lcdc@1c0c000 {
179− compatible = "allwinner,sun4i-a10-lcdc";
180− };
181− };
177+ lcdc0: lcdc { };
182178
183179 ...
Documentation/devicetree/bindings/display/tilcdc/tilcdc.txt+1−1
@@ -37,7 +37,7 @@ Optional nodes: · 36 unmodified lines
3737 supports a single port with a single endpoint.
3838
3939 - See also Documentation/devicetree/bindings/display/tilcdc/panel.txt and
40− Documentation/devicetree/bindings/display/tilcdc/tfp410.txt for connecting
40+ Documentation/devicetree/bindings/display/bridge/ti,tfp410.txt for connecting
4141 tfp410 DVI encoder or lcd panel to lcdc
4242
4343 [1] There is an errata about AM335x color wiring. For 16-bit color mode
Documentation/devicetree/bindings/dma/ti/k3-udma.yaml+1−13
@@ -143,7 +143,7 @@ examples: · 142 unmodified lines
143143 #size-cells = <2>;
144144 dma-coherent;
145145 dma-ranges;
146− ranges;
146+ ranges = <0x0 0x30800000 0x0 0x30800000 0x0 0x05000000>;
147147
148148 ti,sci-dev-id = <118>;
149149
@@ -169,16 +169,4 @@ examples: · 19 unmodified lines
169169 ti,sci-rm-range-rflow = <0x6>; /* GP RFLOW */
170170 };
171171 };
172−
173− mcasp0: mcasp@02B00000 {
174− dmas = <&main_udmap 0xc400>, <&main_udmap 0x4400>;
175− dma-names = "tx", "rx";
176− };
177−
178− crypto: crypto@4E00000 {
179− compatible = "ti,sa2ul-crypto";
180−
181− dmas = <&main_udmap 0xc000>, <&main_udmap 0x4000>, <&main_udmap 0x4001>;
182− dma-names = "tx", "rx1", "rx2";
183− };
184172 };
Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml+7−7
@@ -84,31 +84,31 @@ examples: · 83 unmodified lines
8484 gpu_opp_table: opp_table0 {
8585 compatible = "operating-points-v2";
8686
87− opp@533000000 {
87+ opp-533000000 {
8888 opp-hz = /bits/ 64 <533000000>;
8989 opp-microvolt = <1250000>;
9090 };
91− opp@450000000 {
91+ opp-450000000 {
9292 opp-hz = /bits/ 64 <450000000>;
9393 opp-microvolt = <1150000>;
9494 };
95− opp@400000000 {
95+ opp-400000000 {
9696 opp-hz = /bits/ 64 <400000000>;
9797 opp-microvolt = <1125000>;
9898 };
99− opp@350000000 {
99+ opp-350000000 {
100100 opp-hz = /bits/ 64 <350000000>;
101101 opp-microvolt = <1075000>;
102102 };
103− opp@266000000 {
103+ opp-266000000 {
104104 opp-hz = /bits/ 64 <266000000>;
105105 opp-microvolt = <1025000>;
106106 };
107− opp@160000000 {
107+ opp-160000000 {
108108 opp-hz = /bits/ 64 <160000000>;
109109 opp-microvolt = <925000>;
110110 };
111− opp@100000000 {
111+ opp-100000000 {
112112 opp-hz = /bits/ 64 <100000000>;
113113 opp-microvolt = <912500>;
114114 };
Documentation/devicetree/bindings/gpu/arm,mali-midgard.yaml+7−7
@@ -138,31 +138,31 @@ examples: · 137 unmodified lines
138138 gpu_opp_table: opp_table0 {
139139 compatible = "operating-points-v2";
140140
141− opp@533000000 {
141+ opp-533000000 {
142142 opp-hz = /bits/ 64 <533000000>;
143143 opp-microvolt = <1250000>;
144144 };
145− opp@450000000 {
145+ opp-450000000 {
146146 opp-hz = /bits/ 64 <450000000>;
147147 opp-microvolt = <1150000>;
148148 };
149− opp@400000000 {
149+ opp-400000000 {
150150 opp-hz = /bits/ 64 <400000000>;
151151 opp-microvolt = <1125000>;
152152 };
153− opp@350000000 {
153+ opp-350000000 {
154154 opp-hz = /bits/ 64 <350000000>;
155155 opp-microvolt = <1075000>;
156156 };
157− opp@266000000 {
157+ opp-266000000 {
158158 opp-hz = /bits/ 64 <266000000>;
159159 opp-microvolt = <1025000>;
160160 };
161− opp@160000000 {
161+ opp-160000000 {
162162 opp-hz = /bits/ 64 <160000000>;
163163 opp-microvolt = <925000>;
164164 };
165− opp@100000000 {
165+ opp-100000000 {
166166 opp-hz = /bits/ 64 <100000000>;
167167 opp-microvolt = <912500>;
168168 };
Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.yaml+1−1
@@ -123,7 +123,7 @@ examples: · 122 unmodified lines
123123 samsung,syscon-phandle = <&pmu_system_controller>;
124124
125125 /* NTC thermistor is a hwmon device */
126− ncp15wb473@0 {
126+ ncp15wb473 {
127127 compatible = "murata,ncp15wb473";
128128 pullup-uv = <1800000>;
129129 pullup-ohm = <47000>;
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml+1−1
@@ -62,7 +62,7 @@ required: · 61 unmodified lines
6262
6363 examples:
6464 - |
65− i2c@00000000 {
65+ i2c {
6666 #address-cells = <1>;
6767 #size-cells = <0>;
6868 gt928@5d {
Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt+1−1
@@ -1,7 +1,7 @@
11 Texas Instruments TWL family (twl4030) pwrbutton module
22
33 This module is part of the TWL4030. For more details about the whole
4−chip see Documentation/devicetree/bindings/mfd/twl-familly.txt.
4+chip see Documentation/devicetree/bindings/mfd/twl-family.txt.
55
66 This module provides a simple power button event via an Interrupt.
77
Documentation/devicetree/bindings/leds/common.yaml+1−1
@@ -85,7 +85,7 @@ properties: · 84 unmodified lines
8585 # LED will act as a back-light, controlled by the framebuffer system
8686 - backlight
8787 # LED will turn on (but for leds-gpio see "default-state" property in
88− # Documentation/devicetree/bindings/leds/leds-gpio.txt)
88+ # Documentation/devicetree/bindings/leds/leds-gpio.yaml)
8989 - default-on
9090 # LED "double" flashes at a load average based rate
9191 - heartbeat
Documentation/devicetree/bindings/leds/register-bit-led.txt+1−1
@@ -5,7 +5,7 @@ where single bits in a certain register can turn on/off a · 4 unmodified lines
55 single LED. The register bit LEDs appear as children to the
66 syscon device, with the proper compatible string. For the
77 syscon bindings see:
8−Documentation/devicetree/bindings/mfd/syscon.txt
8+Documentation/devicetree/bindings/mfd/syscon.yaml
99
1010 Each LED is represented as a sub-node of the syscon device. Each
1111 node's name represents the name of the corresponding LED.
Documentation/devicetree/bindings/media/ti,cal.yaml+1−1
@@ -177,7 +177,7 @@ examples: · 176 unmodified lines
177177 };
178178 };
179179
180− i2c5: i2c@4807c000 {
180+ i2c {
181181 clock-frequency = <400000>;
182182 #address-cells = <1>;
183183 #size-cells = <0>;
Documentation/devicetree/bindings/memory-controllers/ti/emif.txt+1−1
@@ -32,7 +32,7 @@ Required only for "ti,emif-am3352" and "ti,emif-am4372": · 31 unmodified lines
3232 - sram : Phandles for generic sram driver nodes,
3333 first should be type 'protect-exec' for the driver to use to copy
3434 and run PM functions, second should be regular pool to be used for
35− data region for code. See Documentation/devicetree/bindings/sram/sram.txt
35+ data region for code. See Documentation/devicetree/bindings/sram/sram.yaml
3636 for more details.
3737
3838 Optional properties:
Documentation/devicetree/bindings/mfd/max77650.yaml+2−2
@@ -97,14 +97,14 @@ examples: · 96 unmodified lines
9797 regulators {
9898 compatible = "maxim,max77650-regulator";
9999
100− max77650_ldo: regulator@0 {
100+ max77650_ldo: regulator-ldo {
101101 regulator-compatible = "ldo";
102102 regulator-name = "max77650-ldo";
103103 regulator-min-microvolt = <1350000>;
104104 regulator-max-microvolt = <2937500>;
105105 };
106106
107− max77650_sbb0: regulator@1 {
107+ max77650_sbb0: regulator-sbb0 {
108108 regulator-compatible = "sbb0";
109109 regulator-name = "max77650-sbb0";
110110 regulator-min-microvolt = <800000>;
Documentation/devicetree/bindings/mfd/tps65910.txt+2−2
@@ -26,8 +26,8 @@ Required properties: · 25 unmodified lines
2626 ldo6, ldo7, ldo8
2727
2828 - xxx-supply: Input voltage supply regulator.
29− These entries are require if regulators are enabled for a device. Missing of these
30− properties can cause the regulator registration fails.
29+ These entries are required if regulators are enabled for a device. Missing these
30+ properties can cause the regulator registration to fail.
3131 If some of input supply is powered through battery or always-on supply then
3232 also it is require to have these parameters with proper node handle of always
3333 on power supply.
Documentation/devicetree/bindings/mfd/twl-family.txtrenamed from Documentation/devicetree/bindings/mfd/twl-familly.txt+0−0

File renamed without changes.

Documentation/devicetree/bindings/mfd/zii,rave-sp.txt+1−1
@@ -20,7 +20,7 @@ RAVE SP consists of the following sub-devices: · 19 unmodified lines
2020 Device Description
2121 ------ -----------
2222 rave-sp-wdt : Watchdog
23−rave-sp-nvmem : Interface to onborad EEPROM
23+rave-sp-nvmem : Interface to onboard EEPROM
2424 rave-sp-backlight : Display backlight
2525 rave-sp-hwmon : Interface to onboard hardware sensors
2626 rave-sp-leds : Interface to onboard LEDs
Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt+1−1
@@ -26,7 +26,7 @@ For generic IOMMU bindings, see · 25 unmodified lines
2626 Documentation/devicetree/bindings/iommu/iommu.txt.
2727
2828 For arm-smmu binding, see:
29−Documentation/devicetree/bindings/iommu/arm,smmu.txt.
29+Documentation/devicetree/bindings/iommu/arm,smmu.yaml.
3030
3131 Required properties:
3232
Documentation/devicetree/bindings/mmc/mmc-controller.yaml+1−0
@@ -370,6 +370,7 @@ examples: · 369 unmodified lines
370370 mmc3: mmc@1c12000 {
371371 #address-cells = <1>;
372372 #size-cells = <0>;
373+ reg = <0x1c12000 0x200>;
373374 pinctrl-names = "default";
374375 pinctrl-0 = <&mmc3_pins_a>;
375376 vmmc-supply = <&reg_vmmc3>;
Documentation/devicetree/bindings/mtd/cadence-nand-controller.txt+1−1
@@ -27,7 +27,7 @@ Required properties of NAND chips: · 26 unmodified lines
2727 - reg: shall contain the native Chip Select ids from 0 to max supported by
2828 the cadence nand flash controller
2929
30−See Documentation/devicetree/bindings/mtd/nand.txt for more details on
30+See Documentation/devicetree/bindings/mtd/nand-controller.yaml for more details on
3131 generic bindings.
3232
3333 Example:
Documentation/devicetree/bindings/net/brcm,bcm7445-switch-v4.0.txt+1−1
@@ -45,7 +45,7 @@ Optional properties: · 44 unmodified lines
4545 switch queue
4646
4747 - resets: a single phandle and reset identifier pair. See
48− Documentation/devicetree/binding/reset/reset.txt for details.
48+ Documentation/devicetree/bindings/reset/reset.txt for details.
4949
5050 - reset-names: If the "reset" property is specified, this property should have
5151 the value "switch" to denote the switch reset line.
Documentation/devicetree/bindings/net/fsl-fman.txt+7−0
@@ -110,6 +110,13 @@ PROPERTIES · 109 unmodified lines
110110 Usage: required
111111 Definition: See soc/fsl/qman.txt and soc/fsl/bman.txt
112112
113+- fsl,erratum-a050385
114+ Usage: optional
115+ Value type: boolean
116+ Definition: A boolean property. Indicates the presence of the
117+ erratum A050385 which indicates that DMA transactions that are
118+ split can result in a FMan lock.
119+
113120 =============================================================================
114121 FMan MURAM Node
115122
Documentation/devicetree/bindings/nvmem/nvmem.yaml+2−0
@@ -76,6 +76,8 @@ examples: · 75 unmodified lines
7676 qfprom: eeprom@700000 {
7777 #address-cells = <1>;
7878 #size-cells = <1>;
79+ reg = <0x00700000 0x100000>;
80+
7981 wp-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
8082
8183 /* ... */
Documentation/devicetree/bindings/phy/allwinner,sun4i-a10-usb-phy.yaml+1−1
@@ -86,7 +86,7 @@ examples: · 85 unmodified lines
8686 #include <dt-bindings/clock/sun4i-a10-ccu.h>
8787 #include <dt-bindings/reset/sun4i-a10-ccu.h>
8888
89− usbphy: phy@01c13400 {
89+ usbphy: phy@1c13400 {
9090 #phy-cells = <1>;
9191 compatible = "allwinner,sun4i-a10-usb-phy";
9292 reg = <0x01c13400 0x10>, <0x01c14800 0x4>, <0x01c1c800 0x4>;
Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml+1−1
@@ -17,7 +17,7 @@ description: |+ · 16 unmodified lines
1717 "aspeed,ast2400-scu", "syscon", "simple-mfd"
1818
1919 Refer to the the bindings described in
20− Documentation/devicetree/bindings/mfd/syscon.txt
20+ Documentation/devicetree/bindings/mfd/syscon.yaml
2121
2222 properties:
2323 compatible:
Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml+1−1
@@ -18,7 +18,7 @@ description: |+ · 17 unmodified lines
1818 "aspeed,g5-scu", "syscon", "simple-mfd"
1919
2020 Refer to the the bindings described in
21− Documentation/devicetree/bindings/mfd/syscon.txt
21+ Documentation/devicetree/bindings/mfd/syscon.yaml
2222
2323 properties:
2424 compatible:
Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml+1−1
@@ -17,7 +17,7 @@ description: |+ · 16 unmodified lines
1717 "aspeed,ast2600-scu", "syscon", "simple-mfd"
1818
1919 Refer to the the bindings described in
20− Documentation/devicetree/bindings/mfd/syscon.txt
20+ Documentation/devicetree/bindings/mfd/syscon.yaml
2121
2222 properties:
2323 compatible:
Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml+1−1
@@ -248,7 +248,7 @@ examples: · 247 unmodified lines
248248 };
249249
250250 //Example 3 pin groups
251− pinctrl@60020000 {
251+ pinctrl {
252252 usart1_pins_a: usart1-0 {
253253 pins1 {
254254 pinmux = <STM32_PINMUX('A', 9, AF7)>;
Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml+1−1
@@ -18,7 +18,7 @@ description: |+ · 17 unmodified lines
1818 "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon"
1919
2020 Refer to the the bindings described in
21− Documentation/devicetree/bindings/mfd/syscon.txt
21+ Documentation/devicetree/bindings/mfd/syscon.yaml
2222
2323 properties:
2424 compatible:
Documentation/devicetree/bindings/power/domain-idle-state.txt+0−33
@@ -1,33 +0,0 @@
1−PM Domain Idle State Node:
2−
3−A domain idle state node represents the state parameters that will be used to
4−select the state when there are no active components in the domain.
5−
6−The state node has the following parameters -
7−
8−- compatible:
9− Usage: Required
10− Value type: <string>
11− Definition: Must be "domain-idle-state".
12−
13−- entry-latency-us
14− Usage: Required
15− Value type: <prop-encoded-array>
16− Definition: u32 value representing worst case latency in
17− microseconds required to enter the idle state.
18− The exit-latency-us duration may be guaranteed
19− only after entry-latency-us has passed.
20−
21−- exit-latency-us
22− Usage: Required
23− Value type: <prop-encoded-array>
24− Definition: u32 value representing worst case latency
25− in microseconds required to exit the idle state.
26−
27−- min-residency-us
28− Usage: Required
29− Value type: <prop-encoded-array>
30− Definition: u32 value representing minimum residency duration
31− in microseconds after which the idle state will yield
32− power benefits after overcoming the overhead in entering
33−i the idle state.
Documentation/devicetree/bindings/power/domain-idle-state.yaml+64−0
@@ -0,0 +1,64 @@
1+# SPDX-License-Identifier: GPL-2.0
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/power/domain-idle-state.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: PM Domain Idle States binding description
8+
9+maintainers:
10+ - Ulf Hansson <ulf.hansson@linaro.org>
11+
12+description:
13+ A domain idle state node represents the state parameters that will be used to
14+ select the state when there are no active components in the PM domain.
15+
16+properties:
17+ $nodename:
18+ const: domain-idle-states
19+
20+patternProperties:
21+ "^(cpu|cluster|domain)-":
22+ type: object
23+ description:
24+ Each state node represents a domain idle state description.
25+
26+ properties:
27+ compatible:
28+ const: domain-idle-state
29+
30+ entry-latency-us:
31+ description:
32+ The worst case latency in microseconds required to enter the idle
33+ state. Note that, the exit-latency-us duration may be guaranteed only
34+ after the entry-latency-us has passed.
35+
36+ exit-latency-us:
37+ description:
38+ The worst case latency in microseconds required to exit the idle
39+ state.
40+
41+ min-residency-us:
42+ description:
43+ The minimum residency duration in microseconds after which the idle
44+ state will yield power benefits, after overcoming the overhead while
45+ entering the idle state.
46+
47+ required:
48+ - compatible
49+ - entry-latency-us
50+ - exit-latency-us
51+ - min-residency-us
52+
53+examples:
54+ - |
55+
56+ domain-idle-states {
57+ domain_retention: domain-retention {
58+ compatible = "domain-idle-state";
59+ entry-latency-us = <20>;
60+ exit-latency-us = <40>;
61+ min-residency-us = <80>;
62+ };
63+ };
64+...
Documentation/devicetree/bindings/power/power-domain.yaml+11−13
@@ -25,22 +25,20 @@ description: |+ · 24 unmodified lines
2525
2626 properties:
2727 $nodename:
28− pattern: "^(power-controller|power-domain)(@.*)?$"
28+ pattern: "^(power-controller|power-domain)([@-].*)?$"
2929
3030 domain-idle-states:
3131 $ref: /schemas/types.yaml#/definitions/phandle-array
32− description:
33− A phandle of an idle-state that shall be soaked into a generic domain
34− power state. The idle state definitions are compatible with
35− domain-idle-state specified in
36− Documentation/devicetree/bindings/power/domain-idle-state.txt
37− phandles that are not compatible with domain-idle-state will be ignored.
38− The domain-idle-state property reflects the idle state of this PM domain
39− and not the idle states of the devices or sub-domains in the PM domain.
40− Devices and sub-domains have their own idle-states independent
41− of the parent domain's idle states. In the absence of this property,
42− the domain would be considered as capable of being powered-on
43− or powered-off.
32+ description: |
33+ Phandles of idle states that defines the available states for the
34+ power-domain provider. The idle state definitions are compatible with the
35+ domain-idle-state bindings, specified in ./domain-idle-state.yaml.
36+
37+ Note that, the domain-idle-state property reflects the idle states of this
38+ PM domain and not the idle states of the devices or sub-domains in the PM
39+ domain. Devices and sub-domains have their own idle states independent of
40+ the parent domain's idle states. In the absence of this property, the
41+ domain would be considered as capable of being powered-on or powered-off.
4442
4543 operating-points-v2:
4644 $ref: /schemas/types.yaml#/definitions/phandle-array
Documentation/devicetree/bindings/power/power_domain.txt+1−1
@@ -109,4 +109,4 @@ Example: · 108 unmodified lines
109109 required-opps = <&domain1_opp_1>;
110110 };
111111
112−[1]. Documentation/devicetree/bindings/power/domain-idle-state.txt
112+[1]. Documentation/devicetree/bindings/power/domain-idle-state.yaml
Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt+1−1
@@ -161,7 +161,7 @@ The regulator node houses sub-nodes for each regulator within the device. Each · 160 unmodified lines
161161 sub-node is identified using the node's name, with valid values listed for each
162162 of the PMICs below.
163163
164−pm8005:
164+pm8004:
165165 s2, s5
166166
167167 pm8005:
Documentation/devicetree/bindings/regulator/regulator.yaml+1−1
@@ -191,7 +191,7 @@ patternProperties: · 190 unmodified lines
191191
192192 examples:
193193 - |
194− xyzreg: regulator@0 {
194+ xyzreg: regulator {
195195 regulator-min-microvolt = <1000000>;
196196 regulator-max-microvolt = <2500000>;
197197 regulator-always-on;
Documentation/devicetree/bindings/reset/intel,rcu-gw.yaml+5−1
@@ -23,7 +23,11 @@ properties: · 22 unmodified lines
2323 description: Global reset register offset and bit offset.
2424 allOf:
2525 - $ref: /schemas/types.yaml#/definitions/uint32-array
26− - maxItems: 2
26+ items:
27+ - description: Register offset
28+ - description: Register bit offset
29+ minimum: 0
30+ maximum: 31
2731
2832 "#reset-cells":
2933 minimum: 2
Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt+1−1
@@ -3,4 +3,4 @@ STMicroelectronics STM32MP1 Peripheral Reset Controller · 2 unmodified lines
33
44 The RCC IP is both a reset and a clock controller.
55
6−Please see Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.txt
6+Please see Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.yaml
Documentation/devicetree/bindings/sound/st,stm32-sai.txt+1−1
@@ -36,7 +36,7 @@ SAI subnodes required properties: · 35 unmodified lines
3636 - clock-names: Must contain "sai_ck".
3737 Must also contain "MCLK", if SAI shares a master clock,
3838 with a SAI set as MCLK clock provider.
39− - dmas: see Documentation/devicetree/bindings/dma/stm32-dma.txt
39+ - dmas: see Documentation/devicetree/bindings/dma/st,stm32-dma.yaml
4040 - dma-names: identifier string for each DMA request line
4141 "tx": if sai sub-block is configured as playback DAI
4242 "rx": if sai sub-block is configured as capture DAI
Documentation/devicetree/bindings/sound/st,stm32-spdifrx.txt+1−1
@@ -10,7 +10,7 @@ Required properties: · 9 unmodified lines
1010 - clock-names: must contain "kclk"
1111 - interrupts: cpu DAI interrupt line
1212 - dmas: DMA specifiers for audio data DMA and iec control flow DMA
13− See STM32 DMA bindings, Documentation/devicetree/bindings/dma/stm32-dma.txt
13+ See STM32 DMA bindings, Documentation/devicetree/bindings/dma/st,stm32-dma.yaml
1414 - dma-names: two dmas have to be defined, "rx" and "rx-ctrl"
1515
1616 Optional properties:
Documentation/devicetree/bindings/spi/st,stm32-spi.yaml+1−1
@@ -49,7 +49,7 @@ properties: · 48 unmodified lines
4949 dmas:
5050 description: |
5151 DMA specifiers for tx and rx dma. DMA fifo mode must be used. See
52− the STM32 DMA bindings Documentation/devicetree/bindings/dma/stm32-dma.txt.
52+ the STM32 DMA bindings Documentation/devicetree/bindings/dma/st,stm32-dma.yaml.
5353 items:
5454 - description: rx DMA channel
5555 - description: tx DMA channel
Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml+1−1
@@ -125,7 +125,7 @@ examples: · 124 unmodified lines
125125 #size-cells = <1>;
126126 ranges;
127127
128− sram_a: sram@00000000 {
128+ sram_a: sram@0 {
129129 compatible = "mmio-sram";
130130 reg = <0x00000000 0xc000>;
131131 #address-cells = <1>;
Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml+1−1
@@ -17,7 +17,7 @@ description: |+ · 16 unmodified lines
1717 "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
1818
1919 Refer to the the bindings described in
20− Documentation/devicetree/bindings/mfd/syscon.txt
20+ Documentation/devicetree/bindings/mfd/syscon.yaml
2121
2222 properties:
2323 compatible:
Documentation/devicetree/bindings/timer/allwinner,sun4i-a10-timer.yaml+1−1
@@ -87,7 +87,7 @@ additionalProperties: false · 86 unmodified lines
8787
8888 examples:
8989 - |
90− timer {
90+ timer@1c20c00 {
9191 compatible = "allwinner,sun4i-a10-timer";
9292 reg = <0x01c20c00 0x400>;
9393 interrupts = <22>,
Documentation/driver-api/dmaengine/client.rst+10−4
@@ -151,8 +151,8 @@ The details of these operations are: · 150 unmodified lines
151151 Note that callbacks will always be invoked from the DMA
152152 engines tasklet, never from interrupt context.
153153
154−Optional: per descriptor metadata
155−---------------------------------
154+ **Optional: per descriptor metadata**
155+
156156 DMAengine provides two ways for metadata support.
157157
158158 DESC_METADATA_CLIENT
@@ -199,12 +199,15 @@ Optional: per descriptor metadata · 40 unmodified lines
199199 DESC_METADATA_CLIENT
200200
201201 - DMA_MEM_TO_DEV / DEV_MEM_TO_MEM:
202+
202203 1. prepare the descriptor (dmaengine_prep_*)
203204 construct the metadata in the client's buffer
204205 2. use dmaengine_desc_attach_metadata() to attach the buffer to the
205206 descriptor
206207 3. submit the transfer
208+
207209 - DMA_DEV_TO_MEM:
210+
208211 1. prepare the descriptor (dmaengine_prep_*)
209212 2. use dmaengine_desc_attach_metadata() to attach the buffer to the
210213 descriptor
@@ -215,6 +218,7 @@ Optional: per descriptor metadata · 4 unmodified lines
215218 DESC_METADATA_ENGINE
216219
217220 - DMA_MEM_TO_DEV / DEV_MEM_TO_MEM:
221+
218222 1. prepare the descriptor (dmaengine_prep_*)
219223 2. use dmaengine_desc_get_metadata_ptr() to get the pointer to the
220224 engine's metadata area
@@ -222,7 +226,9 @@ Optional: per descriptor metadata · 1 unmodified line
222226 4. use dmaengine_desc_set_metadata_len() to tell the DMA engine the
223227 amount of data the client has placed into the metadata buffer
224228 5. submit the transfer
229+
225230 - DMA_DEV_TO_MEM:
231+
226232 1. prepare the descriptor (dmaengine_prep_*)
227233 2. submit the transfer
228234 3. on transfer completion, use dmaengine_desc_get_metadata_ptr() to get
@@ -278,8 +284,8 @@ Optional: per descriptor metadata · 49 unmodified lines
278284
279285 void dma_async_issue_pending(struct dma_chan *chan);
280286
281−Further APIs:
282−-------------
287+Further APIs
288+------------
283289
284290 1. Terminate APIs
285291
Documentation/filesystems/debugfs.txt+3−3
@@ -164,9 +164,9 @@ file. · 163 unmodified lines
164164 void __iomem *base;
165165 };
166166
167− struct dentry *debugfs_create_regset32(const char *name, umode_t mode,
168− struct dentry *parent,
169− struct debugfs_regset32 *regset);
167+ debugfs_create_regset32(const char *name, umode_t mode,
168+ struct dentry *parent,
169+ struct debugfs_regset32 *regset);
170170
171171 void debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs,
172172 int nregs, void __iomem *base, char *prefix);
Documentation/filesystems/porting.rst+8−0
@@ -850,3 +850,11 @@ business doing so. · 849 unmodified lines
850850 d_alloc_pseudo() is internal-only; uses outside of alloc_file_pseudo() are
851851 very suspect (and won't work in modules). Such uses are very likely to
852852 be misspelled d_alloc_anon().
853+
854+---
855+
856+**mandatory**
857+
858+[should've been added in 2016] stale comment in finish_open() nonwithstanding,
859+failure exits in ->atomic_open() instances should *NOT* fput() the file,
860+no matter what. Everything is handled by the caller.
Documentation/hwmon/adm1177.rst+1−2
@@ -20,8 +20,7 @@ Usage Notes · 19 unmodified lines
2020 -----------
2121
2222 This driver does not auto-detect devices. You will have to instantiate the
23−devices explicitly. Please see Documentation/i2c/instantiating-devices for
24−details.
23+devices explicitly. Please see :doc:`/i2c/instantiating-devices` for details.
2524
2625
2726 Sysfs entries
Documentation/kbuild/kbuild.rst+1−1
@@ -237,7 +237,7 @@ This is solely useful to speed up test compiles. · 236 unmodified lines
237237 KBUILD_EXTRA_SYMBOLS
238238 --------------------
239239 For modules that use symbols from other modules.
240−See more details in modules.txt.
240+See more details in modules.rst.
241241
242242 ALLSOURCE_ARCHS
243243 ---------------
Documentation/kbuild/kconfig-macro-language.rst+1−1
@@ -44,7 +44,7 @@ intermediate:: · 43 unmodified lines
4444 def_bool y
4545
4646 Then, Kconfig moves onto the evaluation stage to resolve inter-symbol
47−dependency as explained in kconfig-language.txt.
47+dependency as explained in kconfig-language.rst.
4848
4949
5050 Variables
Documentation/kbuild/makefiles.rst+4−7
@@ -765,7 +765,7 @@ is not sufficient this sometimes needs to be explicit. · 764 unmodified lines
765765 Example::
766766
767767 #arch/x86/boot/Makefile
768− subdir- := compressed/
768+ subdir- := compressed
769769
770770 The above assignment instructs kbuild to descend down in the
771771 directory compressed/ when "make clean" is executed.
@@ -924,7 +924,7 @@ When kbuild executes, the following steps are followed (roughly): · 152 unmodified lines
924924 $(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that
925925 are used for assembler.
926926
927− From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
927+ From commandline AFLAGS_MODULE shall be used (see kbuild.rst).
928928
929929 KBUILD_CFLAGS_KERNEL
930930 $(CC) options specific for built-in
@@ -937,7 +937,7 @@ When kbuild executes, the following steps are followed (roughly): · 6 unmodified lines
937937
938938 $(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
939939 are used for $(CC).
940− From commandline CFLAGS_MODULE shall be used (see kbuild.txt).
940+ From commandline CFLAGS_MODULE shall be used (see kbuild.rst).
941941
942942 KBUILD_LDFLAGS_MODULE
943943 Options for $(LD) when linking modules
@@ -945,7 +945,7 @@ When kbuild executes, the following steps are followed (roughly): · 1 unmodified line
945945 $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
946946 used when linking modules. This is often a linker script.
947947
948− From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
948+ From commandline LDFLAGS_MODULE shall be used (see kbuild.rst).
949949
950950 KBUILD_LDS
951951
@@ -1379,9 +1379,6 @@ See subsequent chapter for the syntax of the Kbuild file. · 427 unmodified lines
13791379 in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
13801380 a wrapper of the asm-generic one.
13811381
1382− The convention is to list one subdir per line and
1383− preferably in alphabetic order.
1384−
13851382 8 Kbuild Variables
13861383 ==================
13871384
Documentation/kbuild/modules.rst+2−2
@@ -470,9 +470,9 @@ build. · 469 unmodified lines
470470
471471 The syntax of the Module.symvers file is::
472472
473− <CRC> <Symbol> <Namespace> <Module> <Export Type>
473+ <CRC> <Symbol> <Module> <Export Type> <Namespace>
474474
475− 0xe1cc2a05 usb_stor_suspend USB_STORAGE drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL
475+ 0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
476476
477477 The fields are separated by tabs and values may be empty (e.g.
478478 if no namespace is defined for an exported symbol).
Documentation/networking/devlink/devlink-region.rst+0−3
@@ -40,9 +40,6 @@ example usage · 39 unmodified lines
4040 # Delete a snapshot using:
4141 $ devlink region del pci/0000:00:05.0/cr-space snapshot 1
4242
43− # Trigger (request) a snapshot be taken:
44− $ devlink region trigger pci/0000:00:05.0/cr-space
45−
4643 # Dump a snapshot:
4744 $ devlink region dump pci/0000:00:05.0/fw-health snapshot 1
4845 0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30
Documentation/networking/net_failover.rst+3−3
@@ -8,9 +8,9 @@ Overview · 7 unmodified lines
88 ========
99
1010 The net_failover driver provides an automated failover mechanism via APIs
11−to create and destroy a failover master netdev and mananges a primary and
11+to create and destroy a failover master netdev and manages a primary and
1212 standby slave netdevs that get registered via the generic failover
13−infrastructrure.
13+infrastructure.
1414
1515 The failover netdev acts a master device and controls 2 slave devices. The
1616 original paravirtual interface is registered as 'standby' slave netdev and
@@ -29,7 +29,7 @@ virtio-net accelerated datapath: STANDBY mode · 12 unmodified lines
2929 =============================================
3030
3131 net_failover enables hypervisor controlled accelerated datapath to virtio-net
32−enabled VMs in a transparent manner with no/minimal guest userspace chanages.
32+enabled VMs in a transparent manner with no/minimal guest userspace changes.
3333
3434 To support this, the hypervisor needs to enable VIRTIO_NET_F_STANDBY
3535 feature on the virtio-net interface and assign the same MAC address to both
Documentation/networking/phy.rst+3−2
@@ -487,8 +487,9 @@ phy_register_fixup_for_id():: · 486 unmodified lines
487487 The stubs set one of the two matching criteria, and set the other one to
488488 match anything.
489489
490−When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module,
491−unregister fixup and free allocate memory are required.
490+When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module load
491+time, the module needs to unregister the fixup and free allocated memory when
492+it's unloaded.
492493
493494 Call one of following function before unloading module::
494495
Documentation/networking/rds.txt+1−1
@@ -159,7 +159,7 @@ Socket Interface · 158 unmodified lines
159159 set SO_RDS_TRANSPORT on a socket for which the transport has
160160 been previously attached explicitly (by SO_RDS_TRANSPORT) or
161161 implicitly (via bind(2)) will return an error of EOPNOTSUPP.
162− An attempt to set SO_RDS_TRANSPPORT to RDS_TRANS_NONE will
162+ An attempt to set SO_RDS_TRANSPORT to RDS_TRANS_NONE will
163163 always return EINVAL.
164164
165165 RDMA for RDS
Documentation/power/index.rst+0−1
@@ -13,7 +13,6 @@ Power Management · 12 unmodified lines
1313 drivers-testing
1414 energy-model
1515 freezing-of-tasks
16− interface
1716 opp
1817 pci
1918 pm_qos_interface
Documentation/sphinx/parallel-wrapper.sh+1−1
@@ -30,4 +30,4 @@ if [ -n "$parallel" ] ; then · 29 unmodified lines
3030 parallel="-j$parallel"
3131 fi
3232
33−exec "$sphinx" "$parallel" "$@"
33+exec "$sphinx" $parallel "$@"
Documentation/virt/kvm/api.rst+18−15
@@ -4611,35 +4611,38 @@ unpins the VPA pages and releases all the device pages that are used to · 4610 unmodified lines
46114611 track the secure pages by hypervisor.
46124612
46134613 4.122 KVM_S390_NORMAL_RESET
4614+---------------------------
46144615
4615−Capability: KVM_CAP_S390_VCPU_RESETS
4616−Architectures: s390
4617−Type: vcpu ioctl
4618−Parameters: none
4619−Returns: 0
4616+:Capability: KVM_CAP_S390_VCPU_RESETS
4617+:Architectures: s390
4618+:Type: vcpu ioctl
4619+:Parameters: none
4620+:Returns: 0
46204621
46214622 This ioctl resets VCPU registers and control structures according to
46224623 the cpu reset definition in the POP (Principles Of Operation).
46234624
46244625 4.123 KVM_S390_INITIAL_RESET
4626+----------------------------
46254627
4626−Capability: none
4627−Architectures: s390
4628−Type: vcpu ioctl
4629−Parameters: none
4630−Returns: 0
4628+:Capability: none
4629+:Architectures: s390
4630+:Type: vcpu ioctl
4631+:Parameters: none
4632+:Returns: 0
46314633
46324634 This ioctl resets VCPU registers and control structures according to
46334635 the initial cpu reset definition in the POP. However, the cpu is not
46344636 put into ESA mode. This reset is a superset of the normal reset.
46354637
46364638 4.124 KVM_S390_CLEAR_RESET
4639+--------------------------
46374640
4638−Capability: KVM_CAP_S390_VCPU_RESETS
4639−Architectures: s390
4640−Type: vcpu ioctl
4641−Parameters: none
4642−Returns: 0
4641+:Capability: KVM_CAP_S390_VCPU_RESETS
4642+:Architectures: s390
4643+:Type: vcpu ioctl
4644+:Parameters: none
4645+:Returns: 0
46434646
46444647 This ioctl resets VCPU registers and control structures according to
46454648 the clear cpu reset definition in the POP. However, the cpu is not put
Documentation/x86/index.rst+0−1
@@ -19,7 +19,6 @@ x86-specific Documentation · 18 unmodified lines
1919 tlb
2020 mtrr
2121 pat
22− intel_mpx
2322 intel-iommu
2423 intel_txt
2524 amd-memory-encryption
MAINTAINERS+16−19
@@ -693,7 +693,7 @@ ALLWINNER CPUFREQ DRIVER · 692 unmodified lines
693693 M: Yangtao Li <tiny.windzz@gmail.com>
694694 L: linux-pm@vger.kernel.org
695695 S: Maintained
696−F: Documentation/devicetree/bindings/opp/sun50i-nvmem-cpufreq.txt
696+F: Documentation/devicetree/bindings/opp/allwinner,sun50i-h6-operating-points.yaml
697697 F: drivers/cpufreq/sun50i-cpufreq-nvmem.c
698698
699699 ALLWINNER CRYPTO DRIVERS
@@ -4017,7 +4017,7 @@ M: Cheng-Yi Chiang <cychiang@chromium.org> · 3317 unmodified lines
40174017 S: Maintained
40184018 R: Enric Balletbo i Serra <enric.balletbo@collabora.com>
40194019 R: Guenter Roeck <groeck@chromium.org>
4020−F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.txt
4020+F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
40214021 F: sound/soc/codecs/cros_ec_codec.*
40224022
40234023 CIRRUS LOGIC AUDIO CODEC DRIVERS
@@ -4073,7 +4073,6 @@ F: drivers/scsi/snic/ · 49 unmodified lines
40734073 CISCO VIC ETHERNET NIC DRIVER
40744074 M: Christian Benvenuti <benve@cisco.com>
40754075 M: Govindarajulu Varadarajan <_govind@gmx.com>
4076−M: Parvi Kaustubhi <pkaustub@cisco.com>
40774076 S: Supported
40784077 F: drivers/net/ethernet/cisco/enic/
40794078
@@ -4475,7 +4474,7 @@ L: linux-media@vger.kernel.org · 395 unmodified lines
44754474 T: git git://linuxtv.org/media_tree.git
44764475 S: Maintained
44774476 F: drivers/media/platform/sunxi/sun6i-csi/
4478−F: Documentation/devicetree/bindings/media/sun6i-csi.txt
4477+F: Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi.yaml
44794478
44804479 CW1200 WLAN driver
44814480 M: Solomon Peachy <pizza@shaftnet.org>
@@ -4572,7 +4571,7 @@ F: drivers/infiniband/hw/cxgb4/ · 90 unmodified lines
45724571 F: include/uapi/rdma/cxgb4-abi.h
45734572
45744573 CXGB4VF ETHERNET DRIVER (CXGB4VF)
4575−M: Casey Leedom <leedom@chelsio.com>
4574+M: Vishal Kulkarni <vishal@gmail.com>
45764575 L: netdev@vger.kernel.org
45774576 W: http://www.chelsio.com
45784577 S: Supported
@@ -5668,7 +5667,7 @@ L: dri-devel@lists.freedesktop.org · 1089 unmodified lines
56685667 T: git git://anongit.freedesktop.org/drm/drm-misc
56695668 S: Maintained
56705669 F: drivers/gpu/drm/stm
5671−F: Documentation/devicetree/bindings/display/st,stm32-ltdc.txt
5670+F: Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
56725671
56735672 DRM DRIVERS FOR TI LCDC
56745673 M: Jyri Sarha <jsarha@ti.com>
@@ -6198,7 +6197,6 @@ S: Supported · 523 unmodified lines
61986197 F: drivers/scsi/be2iscsi/
61996198
62006199 Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER (be2net)
6201−M: Sathya Perla <sathya.perla@broadcom.com>
62026200 M: Ajit Khaparde <ajit.khaparde@broadcom.com>
62036201 M: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
62046202 M: Somnath Kotur <somnath.kotur@broadcom.com>
@@ -7738,7 +7736,7 @@ Hyper-V CORE AND DRIVERS · 1533 unmodified lines
77387736 M: "K. Y. Srinivasan" <kys@microsoft.com>
77397737 M: Haiyang Zhang <haiyangz@microsoft.com>
77407738 M: Stephen Hemminger <sthemmin@microsoft.com>
7741−M: Sasha Levin <sashal@kernel.org>
7739+M: Wei Liu <wei.liu@kernel.org>
77427740 T: git git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
77437741 L: linux-hyperv@vger.kernel.org
77447742 S: Supported
@@ -10175,7 +10173,7 @@ MAXBOTIX ULTRASONIC RANGER IIO DRIVER · 2430 unmodified lines
1017510173 M: Andreas Klinger <ak@it-klinger.de>
1017610174 L: linux-iio@vger.kernel.org
1017710175 S: Maintained
10178−F: Documentation/devicetree/bindings/iio/proximity/maxbotix,mb1232.txt
10176+F: Documentation/devicetree/bindings/iio/proximity/maxbotix,mb1232.yaml
1017910177 F: drivers/iio/proximity/mb1232.c
1018010178
1018110179 MAXIM MAX77650 PMIC MFD DRIVER
@@ -10478,7 +10476,7 @@ M: Hugues Fruchet <hugues.fruchet@st.com> · 296 unmodified lines
1047810476 L: linux-media@vger.kernel.org
1047910477 T: git git://linuxtv.org/media_tree.git
1048010478 S: Supported
10481−F: Documentation/devicetree/bindings/media/st,stm32-dcmi.txt
10479+F: Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml
1048210480 F: drivers/media/platform/stm32/stm32-dcmi.c
1048310481
1048410482 MEDIA DRIVERS FOR NVIDIA TEGRA - VDE
@@ -11126,14 +11124,12 @@ S: Maintained · 641 unmodified lines
1112611124 F: drivers/usb/image/microtek.*
1112711125
1112811126 MIPS
11129−M: Ralf Baechle <ralf@linux-mips.org>
11130−M: Paul Burton <paulburton@kernel.org>
11127+M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1113111128 L: linux-mips@vger.kernel.org
1113211129 W: http://www.linux-mips.org/
11133−T: git git://git.linux-mips.org/pub/scm/ralf/linux.git
1113411130 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git
11135−Q: http://patchwork.linux-mips.org/project/linux-mips/list/
11136−S: Supported
11131+Q: https://patchwork.kernel.org/project/linux-mips/list/
11132+S: Maintained
1113711133 F: Documentation/devicetree/bindings/mips/
1113811134 F: Documentation/mips/
1113911135 F: arch/mips/
@@ -12752,7 +12748,7 @@ M: Tom Joseph <tjoseph@cadence.com> · 1612 unmodified lines
1275212748 L: linux-pci@vger.kernel.org
1275312749 S: Maintained
1275412750 F: Documentation/devicetree/bindings/pci/cdns,*.txt
12755−F: drivers/pci/controller/pcie-cadence*
12751+F: drivers/pci/controller/cadence/
1275612752
1275712753 PCI DRIVER FOR FREESCALE LAYERSCAPE
1275812754 M: Minghuan Lian <minghuan.Lian@nxp.com>
@@ -12965,7 +12961,6 @@ M: Robert Richter <rrichter@marvell.com> · 206 unmodified lines
1296512961 L: linux-pci@vger.kernel.org
1296612962 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1296712963 S: Supported
12968−F: Documentation/devicetree/bindings/pci/pci-thunder-*
1296912964 F: drivers/pci/controller/pci-thunder-*
1297012965
1297112966 PCIE DRIVER FOR HISILICON
@@ -14240,7 +14235,7 @@ F: include/dt-bindings/reset/ · 1268 unmodified lines
1424014235 F: include/linux/reset.h
1424114236 F: include/linux/reset/
1424214237 F: include/linux/reset-controller.h
14243−K: \b(?:devm_|of_)?reset_control(?:ler_[a-z]+|_[a-z_]+)?\b
14238+K: \b(?:devm_|of_)?reset_control(?:ler_[a-z]+|_[a-z_]+)?\b
1424414239
1424514240 RESTARTABLE SEQUENCES SUPPORT
1424614241 M: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
@@ -15935,7 +15930,7 @@ F: drivers/*/stm32-*timer* · 1688 unmodified lines
1593515930 F: drivers/pwm/pwm-stm32*
1593615931 F: include/linux/*/stm32-*tim*
1593715932 F: Documentation/ABI/testing/*timer-stm32
15938−F: Documentation/devicetree/bindings/*/stm32-*timer*
15933+F: Documentation/devicetree/bindings/*/*stm32-*timer*
1593915934 F: Documentation/devicetree/bindings/pwm/pwm-stm32*
1594015935
1594115936 STMMAC ETHERNET DRIVER
@@ -16094,6 +16089,8 @@ SYNOPSYS DESIGNWARE 8250 UART DRIVER · 152 unmodified lines
1609416089 R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1609516090 S: Maintained
1609616091 F: drivers/tty/serial/8250/8250_dw.c
16092+F: drivers/tty/serial/8250/8250_dwlib.*
16093+F: drivers/tty/serial/8250/8250_lpss.c
1609716094
1609816095 SYNOPSYS DESIGNWARE APB GPIO DRIVER
1609916096 M: Hoan Tran <hoan@os.amperecomputing.com>
Makefile+5−3
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 6
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc3
5+EXTRAVERSION = -rc6
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
@@ -68,6 +68,7 @@ unexport GREP_OPTIONS · 59 unmodified lines
6868 #
6969 # If KBUILD_VERBOSE equals 0 then the above command will be hidden.
7070 # If KBUILD_VERBOSE equals 1 then the above command is displayed.
71+# If KBUILD_VERBOSE equals 2 then give the reason why each target is rebuilt.
7172 #
7273 # To put more focus on warnings, be less verbose as default
7374 # Use 'make V=1' to see the full commands
@@ -1239,7 +1240,7 @@ ifneq ($(dtstree),) · 1165 unmodified lines
12391240 %.dtb: include/config/kernel.release scripts_dtc
12401241 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
12411242
1242−PHONY += dtbs dtbs_install dt_binding_check
1243+PHONY += dtbs dtbs_install dtbs_check
12431244 dtbs dtbs_check: include/config/kernel.release scripts_dtc
12441245 $(Q)$(MAKE) $(build)=$(dtstree)
12451246
@@ -1259,6 +1260,7 @@ PHONY += scripts_dtc · 13 unmodified lines
12591260 scripts_dtc: scripts_basic
12601261 $(Q)$(MAKE) $(build)=scripts/dtc
12611262
1263+PHONY += dt_binding_check
12621264 dt_binding_check: scripts_dtc
12631265 $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
12641266
@@ -1803,7 +1805,7 @@ existing-targets := $(wildcard $(sort $(targets))) · 538 unmodified lines
18031805
18041806 -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
18051807
1806−endif # config-targets
1808+endif # config-build
18071809 endif # mixed-build
18081810 endif # need-sub-make
18091811
arch/Kconfig+3−2
@@ -738,8 +738,9 @@ config HAVE_STACK_VALIDATION · 737 unmodified lines
738738 config HAVE_RELIABLE_STACKTRACE
739739 bool
740740 help
741− Architecture has a save_stack_trace_tsk_reliable() function which
742− only returns a stack trace if it can guarantee the trace is reliable.
741+ Architecture has either save_stack_trace_tsk_reliable() or
742+ arch_stack_walk_reliable() function which only returns a stack trace
743+ if it can guarantee the trace is reliable.
743744
744745 config HAVE_ARCH_HASH
745746 bool
arch/arc/Kconfig+2−2
@@ -154,7 +154,7 @@ config ARC_CPU_HS · 153 unmodified lines
154154 help
155155 Support for ARC HS38x Cores based on ARCv2 ISA
156156 The notable features are:
157− - SMP configurations of upto 4 core with coherency
157+ - SMP configurations of up to 4 cores with coherency
158158 - Optional L2 Cache and IO-Coherency
159159 - Revised Interrupt Architecture (multiple priorites, reg banks,
160160 auto stack switch, auto regfile save/restore)
@@ -192,7 +192,7 @@ config ARC_SMP_HALT_ON_RESET · 31 unmodified lines
192192 help
193193 In SMP configuration cores can be configured as Halt-on-reset
194194 or they could all start at same time. For Halt-on-reset, non
195− masters are parked until Master kicks them so they can start of
195+ masters are parked until Master kicks them so they can start off
196196 at designated entry point. For other case, all jump to common
197197 entry point and spin wait for Master's signal.
198198
arch/arc/configs/nps_defconfig+0−2
@@ -21,8 +21,6 @@ CONFIG_MODULES=y · 20 unmodified lines
2121 CONFIG_MODULE_FORCE_LOAD=y
2222 CONFIG_MODULE_UNLOAD=y
2323 # CONFIG_BLK_DEV_BSG is not set
24−# CONFIG_IOSCHED_DEADLINE is not set
25−# CONFIG_IOSCHED_CFQ is not set
2624 CONFIG_ARC_PLAT_EZNPS=y
2725 CONFIG_SMP=y
2826 CONFIG_NR_CPUS=4096
arch/arc/configs/nsimosci_defconfig+0−2
@@ -20,8 +20,6 @@ CONFIG_ISA_ARCOMPACT=y · 19 unmodified lines
2020 CONFIG_KPROBES=y
2121 CONFIG_MODULES=y
2222 # CONFIG_BLK_DEV_BSG is not set
23−# CONFIG_IOSCHED_DEADLINE is not set
24−# CONFIG_IOSCHED_CFQ is not set
2523 CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci"
2624 # CONFIG_COMPACTION is not set
2725 CONFIG_NET=y
arch/arc/configs/nsimosci_hs_defconfig+0−2
@@ -19,8 +19,6 @@ CONFIG_PERF_EVENTS=y · 18 unmodified lines
1919 CONFIG_KPROBES=y
2020 CONFIG_MODULES=y
2121 # CONFIG_BLK_DEV_BSG is not set
22−# CONFIG_IOSCHED_DEADLINE is not set
23−# CONFIG_IOSCHED_CFQ is not set
2422 CONFIG_ISA_ARCV2=y
2523 CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs"
2624 # CONFIG_COMPACTION is not set
arch/arc/configs/nsimosci_hs_smp_defconfig+0−2
@@ -14,8 +14,6 @@ CONFIG_PERF_EVENTS=y · 13 unmodified lines
1414 CONFIG_KPROBES=y
1515 CONFIG_MODULES=y
1616 # CONFIG_BLK_DEV_BSG is not set
17−# CONFIG_IOSCHED_DEADLINE is not set
18−# CONFIG_IOSCHED_CFQ is not set
1917 CONFIG_ISA_ARCV2=y
2018 CONFIG_SMP=y
2119 # CONFIG_ARC_TIMERS_64BIT is not set
arch/arc/include/asm/fpu.h+2−0
@@ -43,6 +43,8 @@ extern void fpu_init_task(struct pt_regs *regs); · 42 unmodified lines
4343
4444 #endif /* !CONFIG_ISA_ARCOMPACT */
4545
46+struct task_struct;
47+
4648 extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
4749
4850 #else /* !CONFIG_ARC_FPU_SAVE_RESTORE */
arch/arc/include/asm/linkage.h+2−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929 .endm
3030
3131 #define ASM_NL ` /* use '`' to mark new line in macro */
32+#define __ALIGN .align 4
33+#define __ALIGN_STR __stringify(__ALIGN)
3234
3335 /* annotation for data we want in DCCM - if enabled in .config */
3436 .macro ARCFP_DATA nm
arch/arc/kernel/setup.c+1−1
@@ -8,11 +8,11 @@ · 7 unmodified lines
88 #include <linux/delay.h>
99 #include <linux/root_dev.h>
1010 #include <linux/clk.h>
11−#include <linux/clk-provider.h>
1211 #include <linux/clocksource.h>
1312 #include <linux/console.h>
1413 #include <linux/module.h>
1514 #include <linux/cpu.h>
15+#include <linux/of_clk.h>
1616 #include <linux/of_fdt.h>
1717 #include <linux/of.h>
1818 #include <linux/cache.h>
arch/arc/kernel/troubleshoot.c+12−15
@@ -104,8 +104,7 @@ static void show_faulting_vma(unsigned long address) · 103 unmodified lines
104104 if (IS_ERR(nm))
105105 nm = "?";
106106 }
107− pr_info(" @off 0x%lx in [%s]\n"
108− " VMA: 0x%08lx to 0x%08lx\n",
107+ pr_info(" @off 0x%lx in [%s] VMA: 0x%08lx to 0x%08lx\n",
109108 vma->vm_start < TASK_UNMAPPED_BASE ?
110109 address : address - vma->vm_start,
111110 nm, vma->vm_start, vma->vm_end);
@@ -120,8 +119,6 @@ static void show_ecr_verbose(struct pt_regs *regs) · 8 unmodified lines
120119 unsigned int vec, cause_code;
121120 unsigned long address;
122121
123− pr_info("\n[ECR ]: 0x%08lx => ", regs->event);
124−
125122 /* For Data fault, this is data address not instruction addr */
126123 address = current->thread.fault_address;
127124
@@ -130,10 +127,10 @@ static void show_ecr_verbose(struct pt_regs *regs) · 2 unmodified lines
130127
131128 /* For DTLB Miss or ProtV, display the memory involved too */
132129 if (vec == ECR_V_DTLB_MISS) {
133− pr_cont("Invalid %s @ 0x%08lx by insn @ 0x%08lx\n",
130+ pr_cont("Invalid %s @ 0x%08lx by insn @ %pS\n",
134131 (cause_code == 0x01) ? "Read" :
135132 ((cause_code == 0x02) ? "Write" : "EX"),
136− address, regs->ret);
133+ address, (void *)regs->ret);
137134 } else if (vec == ECR_V_ITLB_MISS) {
138135 pr_cont("Insn could not be fetched\n");
139136 } else if (vec == ECR_V_MACH_CHK) {
@@ -191,31 +188,31 @@ void show_regs(struct pt_regs *regs) · 51 unmodified lines
191188
192189 show_ecr_verbose(regs);
193190
194− pr_info("[EFA ]: 0x%08lx\n[BLINK ]: %pS\n[ERET ]: %pS\n",
195− current->thread.fault_address,
196− (void *)regs->blink, (void *)regs->ret);
197−
198191 if (user_mode(regs))
199192 show_faulting_vma(regs->ret); /* faulting code, not data */
200193
201− pr_info("[STAT32]: 0x%08lx", regs->status32);
194+ pr_info("ECR: 0x%08lx EFA: 0x%08lx ERET: 0x%08lx\n",
195+ regs->event, current->thread.fault_address, regs->ret);
196+
197+ pr_info("STAT32: 0x%08lx", regs->status32);
202198
203199 #define STS_BIT(r, bit) r->status32 & STATUS_##bit##_MASK ? #bit" " : ""
204200
205201 #ifdef CONFIG_ISA_ARCOMPACT
206− pr_cont(" : %2s%2s%2s%2s%2s%2s%2s\n",
202+ pr_cont(" [%2s%2s%2s%2s%2s%2s%2s]",
207203 (regs->status32 & STATUS_U_MASK) ? "U " : "K ",
208204 STS_BIT(regs, DE), STS_BIT(regs, AE),
209205 STS_BIT(regs, A2), STS_BIT(regs, A1),
210206 STS_BIT(regs, E2), STS_BIT(regs, E1));
211207 #else
212− pr_cont(" : %2s%2s%2s%2s\n",
208+ pr_cont(" [%2s%2s%2s%2s]",
213209 STS_BIT(regs, IE),
214210 (regs->status32 & STATUS_U_MASK) ? "U " : "K ",
215211 STS_BIT(regs, DE), STS_BIT(regs, AE));
216212 #endif
217− pr_info("BTA: 0x%08lx\t SP: 0x%08lx\t FP: 0x%08lx\n",
218− regs->bta, regs->sp, regs->fp);
213+ pr_cont(" BTA: 0x%08lx\n", regs->bta);
214+ pr_info("BLK: %pS\n SP: 0x%08lx FP: 0x%08lx\n",
215+ (void *)regs->blink, regs->sp, regs->fp);
219216 pr_info("LPS: 0x%08lx\tLPE: 0x%08lx\tLPC: 0x%08lx\n",
220217 regs->lp_start, regs->lp_end, regs->lp_count);
221218
arch/arm/Makefile+3−1
@@ -307,13 +307,15 @@ endif · 306 unmodified lines
307307 ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
308308 prepare: stack_protector_prepare
309309 stack_protector_prepare: prepare0
310− $(eval KBUILD_CFLAGS += \
310+ $(eval SSP_PLUGIN_CFLAGS := \
311311 -fplugin-arg-arm_ssp_per_task_plugin-tso=$(shell \
312312 awk '{if ($$2 == "THREAD_SZ_ORDER") print $$3;}'\
313313 include/generated/asm-offsets.h) \
314314 -fplugin-arg-arm_ssp_per_task_plugin-offset=$(shell \
315315 awk '{if ($$2 == "TI_STACK_CANARY") print $$3;}'\
316316 include/generated/asm-offsets.h))
317+ $(eval KBUILD_CFLAGS += $(SSP_PLUGIN_CFLAGS))
318+ $(eval GCC_PLUGINS_CFLAGS += $(SSP_PLUGIN_CFLAGS))
317319 endif
318320
319321 all: $(notdir $(KBUILD_IMAGE))
arch/arm/boot/compressed/Makefile+2−2
@@ -101,7 +101,6 @@ clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S \ · 100 unmodified lines
101101 $(libfdt) $(libfdt_hdrs) hyp-stub.S
102102
103103 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
104−KBUILD_CFLAGS += $(DISABLE_ARM_SSP_PER_TASK_PLUGIN)
105104
106105 ifeq ($(CONFIG_FUNCTION_TRACER),y)
107106 ORIG_CFLAGS := $(KBUILD_CFLAGS)
@@ -117,7 +116,8 @@ CFLAGS_fdt_ro.o := $(nossp-flags-y) · 9 unmodified lines
117116 CFLAGS_fdt_rw.o := $(nossp-flags-y)
118117 CFLAGS_fdt_wip.o := $(nossp-flags-y)
119118
120−ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj)
119+ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \
120+ -I$(obj) $(DISABLE_ARM_SSP_PER_TASK_PLUGIN)
121121 asflags-y := -DZIMAGE
122122
123123 # Supply kernel BSS size to the decompressor via a linker symbol.
arch/arm/boot/dts/am437x-idk-evm.dts+2−2
@@ -526,11 +526,11 @@ · 525 unmodified lines
526526 * Supply voltage supervisor on board will not allow opp50 so
527527 * disable it and set opp100 as suspend OPP.
528528 */
529− opp50@300000000 {
529+ opp50-300000000 {
530530 status = "disabled";
531531 };
532532
533− opp100@600000000 {
533+ opp100-600000000 {
534534 opp-suspend;
535535 };
536536 };
arch/arm/boot/dts/bcm2711-rpi-4-b.dts+3−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 aliases {
2323 ethernet0 = &genet;
24+ pcie0 = &pcie0;
2425 };
2526
2627 leds {
@@ -31,6 +32,8 @@ · 4 unmodified lines
3132 pwr {
3233 label = "PWR";
3334 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
35+ default-state = "keep";
36+ linux,default-trigger = "default-on";
3437 };
3538 };
3639
arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts+2−0
@@ -26,6 +26,8 @@ · 25 unmodified lines
2626 pwr {
2727 label = "PWR";
2828 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
29+ default-state = "keep";
30+ linux,default-trigger = "default-on";
2931 };
3032 };
3133 };
arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts+2−0
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727 pwr {
2828 label = "PWR";
2929 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
30+ default-state = "keep";
31+ linux,default-trigger = "default-on";
3032 };
3133 };
3234
arch/arm/boot/dts/dra7-evm.dts+2−2
@@ -61,10 +61,10 @@ · 60 unmodified lines
6161 regulator-max-microvolt = <1800000>;
6262 };
6363
64− evm_3v3: fixedregulator-evm3v3 {
64+ vsys_3v3: fixedregulator-vsys3v3 {
6565 /* Output of Cntlr A of TPS43351-Q1 on dra7-evm */
6666 compatible = "regulator-fixed";
67− regulator-name = "evm_3v3";
67+ regulator-name = "vsys_3v3";
6868 regulator-min-microvolt = <3300000>;
6969 regulator-max-microvolt = <3300000>;
7070 vin-supply = <&evm_12v0>;
arch/arm/boot/dts/dra7-l4.dtsi+4−0
@@ -3474,6 +3474,7 @@ · 3473 unmodified lines
34743474 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER13_CLKCTRL 24>;
34753475 clock-names = "fck";
34763476 interrupts = <GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH>;
3477+ ti,timer-pwm;
34773478 };
34783479 };
34793480
@@ -3501,6 +3502,7 @@ · 21 unmodified lines
35013502 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER14_CLKCTRL 24>;
35023503 clock-names = "fck";
35033504 interrupts = <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>;
3505+ ti,timer-pwm;
35043506 };
35053507 };
35063508
@@ -3528,6 +3530,7 @@ · 21 unmodified lines
35283530 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>;
35293531 clock-names = "fck";
35303532 interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>;
3533+ ti,timer-pwm;
35313534 };
35323535 };
35333536
@@ -3555,6 +3558,7 @@ · 21 unmodified lines
35553558 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>;
35563559 clock-names = "fck";
35573560 interrupts = <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH>;
3561+ ti,timer-pwm;
35583562 };
35593563 };
35603564
arch/arm/boot/dts/dra7.dtsi+2−0
@@ -184,6 +184,7 @@ · 183 unmodified lines
184184 device_type = "pci";
185185 ranges = <0x81000000 0 0 0x03000 0 0x00010000
186186 0x82000000 0 0x20013000 0x13000 0 0xffed000>;
187+ dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
187188 bus-range = <0x00 0xff>;
188189 #interrupt-cells = <1>;
189190 num-lanes = <1>;
@@ -238,6 +239,7 @@ · 48 unmodified lines
238239 device_type = "pci";
239240 ranges = <0x81000000 0 0 0x03000 0 0x00010000
240241 0x82000000 0 0x30013000 0x13000 0 0xffed000>;
242+ dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
241243 bus-range = <0x00 0xff>;
242244 #interrupt-cells = <1>;
243245 num-lanes = <1>;
arch/arm/boot/dts/dra76x.dtsi+5−0
@@ -128,3 +128,8 @@ · 127 unmodified lines
128128 &usb4_tm {
129129 status = "disabled";
130130 };
131+
132+&mmc3 {
133+ /* dra76x is not affected by i887 */
134+ max-frequency = <96000000>;
135+};
arch/arm/boot/dts/dra7xx-clocks.dtsi+2−10
@@ -796,16 +796,6 @@ · 795 unmodified lines
796796 clock-div = <1>;
797797 };
798798
799− ipu1_gfclk_mux: ipu1_gfclk_mux@520 {
800− #clock-cells = <0>;
801− compatible = "ti,mux-clock";
802− clocks = <&dpll_abe_m2x2_ck>, <&dpll_core_h22x2_ck>;
803− ti,bit-shift = <24>;
804− reg = <0x0520>;
805− assigned-clocks = <&ipu1_gfclk_mux>;
806− assigned-clock-parents = <&dpll_core_h22x2_ck>;
807− };
808−
809799 dummy_ck: dummy_ck {
810800 #clock-cells = <0>;
811801 compatible = "fixed-clock";
@@ -1564,6 +1554,8 @@ · 752 unmodified lines
15641554 compatible = "ti,clkctrl";
15651555 reg = <0x20 0x4>;
15661556 #clock-cells = <2>;
1557+ assigned-clocks = <&ipu1_clkctrl DRA7_IPU1_MMU_IPU1_CLKCTRL 24>;
1558+ assigned-clock-parents = <&dpll_core_h22x2_ck>;
15671559 };
15681560
15691561 ipu_clkctrl: ipu-clkctrl@50 {
arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts+2−2
@@ -275,7 +275,7 @@ · 274 unmodified lines
275275
276276 /* SRAM on Colibri nEXT_CS0 */
277277 sram@0,0 {
278− compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
278+ compatible = "cypress,cy7c1019dv33-10zsxi", "mtd-ram";
279279 reg = <0 0 0x00010000>;
280280 #address-cells = <1>;
281281 #size-cells = <1>;
@@ -286,7 +286,7 @@ · 4 unmodified lines
286286
287287 /* SRAM on Colibri nEXT_CS1 */
288288 sram@1,0 {
289− compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
289+ compatible = "cypress,cy7c1019dv33-10zsxi", "mtd-ram";
290290 reg = <1 0 0x00010000>;
291291 #address-cells = <1>;
292292 #size-cells = <1>;
arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi+0−1
@@ -192,7 +192,6 @@ · 191 unmodified lines
192192 pinctrl-0 = <&pinctrl_usdhc4>;
193193 bus-width = <8>;
194194 non-removable;
195− vmmc-supply = <&vdd_emmc_1p8>;
196195 status = "disabled";
197196 };
198197
arch/arm/boot/dts/imx7-colibri.dtsi+0−1
@@ -336,7 +336,6 @@ · 335 unmodified lines
336336 assigned-clock-rates = <400000000>;
337337 bus-width = <8>;
338338 fsl,tuning-step = <2>;
339− max-frequency = <100000000>;
340339 vmmc-supply = <&reg_module_3v3>;
341340 vqmmc-supply = <&reg_DCDC3>;
342341 non-removable;
arch/arm/boot/dts/imx7d.dtsi+3−3
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 opp-hz = /bits/ 64 <792000000>;
4545 opp-microvolt = <1000000>;
4646 clock-latency-ns = <150000>;
47− opp-supported-hw = <0xd>, <0xf>;
47+ opp-supported-hw = <0xd>, <0x7>;
4848 opp-suspend;
4949 };
5050
@@ -52,7 +52,7 @@ · 1 unmodified line
5252 opp-hz = /bits/ 64 <996000000>;
5353 opp-microvolt = <1100000>;
5454 clock-latency-ns = <150000>;
55− opp-supported-hw = <0xc>, <0xf>;
55+ opp-supported-hw = <0xc>, <0x7>;
5656 opp-suspend;
5757 };
5858
@@ -60,7 +60,7 @@ · 1 unmodified line
6060 opp-hz = /bits/ 64 <1200000000>;
6161 opp-microvolt = <1225000>;
6262 clock-latency-ns = <150000>;
63− opp-supported-hw = <0x8>, <0xf>;
63+ opp-supported-hw = <0x8>, <0x3>;
6464 opp-suspend;
6565 };
6666 };
arch/arm/boot/dts/ls1021a.dtsi+2−2
@@ -747,7 +747,7 @@ · 746 unmodified lines
747747 };
748748
749749 mdio0: mdio@2d24000 {
750− compatible = "fsl,etsec2-mdio";
750+ compatible = "gianfar";
751751 device_type = "mdio";
752752 #address-cells = <1>;
753753 #size-cells = <0>;
@@ -756,7 +756,7 @@ · 2 unmodified lines
756756 };
757757
758758 mdio1: mdio@2d64000 {
759− compatible = "fsl,etsec2-mdio";
759+ compatible = "gianfar";
760760 device_type = "mdio";
761761 #address-cells = <1>;
762762 #size-cells = <0>;
arch/arm/boot/dts/motorola-mapphone-common.dtsi+11−2
@@ -182,6 +182,14 @@ · 181 unmodified lines
182182 pwm-names = "enable", "direction";
183183 direction-duty-cycle-ns = <10000000>;
184184 };
185+
186+ backlight: backlight {
187+ compatible = "led-backlight";
188+
189+ leds = <&backlight_led>;
190+ brightness-levels = <31 63 95 127 159 191 223 255>;
191+ default-brightness-level = <6>;
192+ };
185193 };
186194
187195 &dss {
@@ -205,6 +213,8 @@ · 17 unmodified lines
205213 vddi-supply = <&lcd_regulator>;
206214 reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* gpio101 */
207215
216+ backlight = <&backlight>;
217+
208218 width-mm = <50>;
209219 height-mm = <89>;
210220
@@ -393,12 +403,11 @@ · 182 unmodified lines
393403 ramp-up-us = <1024>;
394404 ramp-down-us = <8193>;
395405
396− led@0 {
406+ backlight_led: led@0 {
397407 reg = <0>;
398408 led-sources = <2>;
399409 ti,led-mode = <0>;
400410 label = ":backlight";
401− linux,default-trigger = "backlight";
402411 };
403412
404413 led@1 {
arch/arm/boot/dts/r8a7779.dtsi+1−1
@@ -377,7 +377,7 @@ · 376 unmodified lines
377377 };
378378
379379 sata: sata@fc600000 {
380− compatible = "renesas,sata-r8a7779", "renesas,rcar-sata";
380+ compatible = "renesas,sata-r8a7779";
381381 reg = <0xfc600000 0x200000>;
382382 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
383383 clocks = <&mstp1_clks R8A7779_CLK_SATA>;
arch/arm/configs/bcm2835_defconfig+1−0
@@ -178,6 +178,7 @@ CONFIG_SCHED_TRACER=y · 177 unmodified lines
178178 CONFIG_STACK_TRACER=y
179179 CONFIG_FUNCTION_PROFILER=y
180180 CONFIG_TEST_KSTRTOX=y
181+CONFIG_DEBUG_FS=y
181182 CONFIG_KGDB=y
182183 CONFIG_KGDB_KDB=y
183184 CONFIG_STRICT_DEVMEM=y
arch/arm/configs/omap2plus_defconfig+1−0
@@ -375,6 +375,7 @@ CONFIG_BACKLIGHT_GENERIC=m · 374 unmodified lines
375375 CONFIG_BACKLIGHT_PWM=m
376376 CONFIG_BACKLIGHT_PANDORA=m
377377 CONFIG_BACKLIGHT_GPIO=m
378+CONFIG_BACKLIGHT_LED=m
378379 CONFIG_FRAMEBUFFER_CONSOLE=y
379380 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
380381 CONFIG_LOGO=y
arch/arm/configs/socfpga_defconfig+1−0
@@ -157,6 +157,7 @@ CONFIG_NLS_ISO8859_1=y · 156 unmodified lines
157157 CONFIG_PRINTK_TIME=y
158158 CONFIG_DEBUG_INFO=y
159159 CONFIG_MAGIC_SYSRQ=y
160+CONFIG_DEBUG_FS=y
160161 CONFIG_DETECT_HUNG_TASK=y
161162 # CONFIG_SCHED_DEBUG is not set
162163 CONFIG_FUNCTION_TRACER=y
arch/arm/include/asm/kvm_host.h+0−3
@@ -392,9 +392,6 @@ static inline void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu) {} · 391 unmodified lines
392392 static inline void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) {}
393393 static inline void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu) {}
394394
395−static inline void kvm_arm_vhe_guest_enter(void) {}
396−static inline void kvm_arm_vhe_guest_exit(void) {}
397−
398395 #define KVM_BP_HARDEN_UNKNOWN -1
399396 #define KVM_BP_HARDEN_WA_NEEDED 0
400397 #define KVM_BP_HARDEN_NOT_REQUIRED 1
arch/arm/kernel/vdso.c+2−0
@@ -94,6 +94,8 @@ static bool __init cntvct_functional(void) · 93 unmodified lines
9494 * this.
9595 */
9696 np = of_find_compatible_node(NULL, NULL, "arm,armv7-timer");
97+ if (!np)
98+ np = of_find_compatible_node(NULL, NULL, "arm,armv8-timer");
9799 if (!np)
98100 goto out_put;
99101
arch/arm/lib/copy_from_user.S+1−1
@@ -118,7 +118,7 @@ ENTRY(arm_copy_from_user) · 117 unmodified lines
118118
119119 ENDPROC(arm_copy_from_user)
120120
121− .pushsection .fixup,"ax"
121+ .pushsection .text.fixup,"ax"
122122 .align 0
123123 copy_abort_preamble
124124 ldmfd sp!, {r1, r2, r3}
arch/arm/mach-imx/Makefile+2−0
@@ -91,6 +91,8 @@ 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+AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a
95+obj-$(CONFIG_SOC_IMX6) += resume-imx6.o
9496 obj-$(CONFIG_SOC_IMX6) += pm-imx6.o
9597
9698 obj-$(CONFIG_SOC_IMX1) += mach-imx1.o
arch/arm/mach-imx/common.h+2−2
@@ -109,17 +109,17 @@ void imx_cpu_die(unsigned int cpu); · 108 unmodified lines
109109 int imx_cpu_kill(unsigned int cpu);
110110
111111 #ifdef CONFIG_SUSPEND
112−void v7_cpu_resume(void);
113112 void imx53_suspend(void __iomem *ocram_vbase);
114113 extern const u32 imx53_suspend_sz;
115114 void imx6_suspend(void __iomem *ocram_vbase);
116115 #else
117−static inline void v7_cpu_resume(void) {}
118116 static inline void imx53_suspend(void __iomem *ocram_vbase) {}
119117 static const u32 imx53_suspend_sz;
120118 static inline void imx6_suspend(void __iomem *ocram_vbase) {}
121119 #endif
122120
121+void v7_cpu_resume(void);
122+
123123 void imx6_pm_ccm_init(const char *ccm_compat);
124124 void imx6q_pm_init(void);
125125 void imx6dl_pm_init(void);
arch/arm/mach-imx/resume-imx6.S+24−0
@@ -0,0 +1,24 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
2+/*
3+ * Copyright 2014 Freescale Semiconductor, Inc.
4+ */
5+
6+#include <linux/linkage.h>
7+#include <asm/assembler.h>
8+#include <asm/asm-offsets.h>
9+#include <asm/hardware/cache-l2x0.h>
10+#include "hardware.h"
11+
12+/*
13+ * The following code must assume it is running from physical address
14+ * where absolute virtual addresses to the data section have to be
15+ * turned into relative ones.
16+ */
17+
18+ENTRY(v7_cpu_resume)
19+ bl v7_invalidate_l1
20+#ifdef CONFIG_CACHE_L2X0
21+ bl l2c310_early_resume
22+#endif
23+ b cpu_resume
24+ENDPROC(v7_cpu_resume)
arch/arm/mach-imx/suspend-imx6.S+0−14
@@ -327,17 +327,3 @@ resume: · 326 unmodified lines
327327
328328 ret lr
329329 ENDPROC(imx6_suspend)
330−
331−/*
332− * The following code must assume it is running from physical address
333− * where absolute virtual addresses to the data section have to be
334− * turned into relative ones.
335− */
336−
337−ENTRY(v7_cpu_resume)
338− bl v7_invalidate_l1
339−#ifdef CONFIG_CACHE_L2X0
340− bl l2c310_early_resume
341−#endif
342− b cpu_resume
343−ENDPROC(v7_cpu_resume)
arch/arm/mach-meson/Kconfig+0−1
@@ -9,7 +9,6 @@ menuconfig ARCH_MESON · 8 unmodified lines
99 select CACHE_L2X0
1010 select PINCTRL
1111 select PINCTRL_MESON
12− select COMMON_CLK
1312 select HAVE_ARM_SCU if SMP
1413 select HAVE_ARM_TWD if SMP
1514
arch/arm/mach-omap2/Makefile+1−1
@@ -16,7 +16,7 @@ hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ · 15 unmodified lines
1616 clock-common = clock.o
1717 secure-common = omap-smc.o omap-secure.o
1818
19−obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
19+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
2020 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
2121 obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common)
2222 obj-$(CONFIG_SOC_AM33XX) += $(hwmod-common) $(secure-common)
arch/arm/mach-omap2/io.c+0−2
@@ -431,7 +431,6 @@ void __init omap2420_init_early(void) · 430 unmodified lines
431431 omap_hwmod_init_postsetup();
432432 omap_clk_soc_init = omap2420_dt_clk_init;
433433 rate_table = omap2420_rate_table;
434− omap_secure_init();
435434 }
436435
437436 void __init omap2420_init_late(void)
@@ -456,7 +455,6 @@ void __init omap2430_init_early(void) · 18 unmodified lines
456455 omap_hwmod_init_postsetup();
457456 omap_clk_soc_init = omap2430_dt_clk_init;
458457 rate_table = omap2430_rate_table;
459− omap_secure_init();
460458 }
461459
462460 void __init omap2430_init_late(void)
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts+1−1
@@ -327,7 +327,7 @@ · 326 unmodified lines
327327 #size-cells = <0>;
328328
329329 bus-width = <4>;
330− max-frequency = <50000000>;
330+ max-frequency = <60000000>;
331331
332332 non-removable;
333333 disable-wp;
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts+1−0
@@ -593,6 +593,7 @@ · 592 unmodified lines
593593 compatible = "brcm,bcm43438-bt";
594594 interrupt-parent = <&gpio_intc>;
595595 interrupts = <95 IRQ_TYPE_LEVEL_HIGH>;
596+ interrupt-names = "host-wakeup";
596597 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
597598 max-speed = <2000000>;
598599 clocks = <&wifi32k>;
arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi+2−0
@@ -20,6 +20,8 @@ · 19 unmodified lines
2020 };
2121
2222 &fman0 {
23+ fsl,erratum-a050385;
24+
2325 /* these aliases provide the FMan ports mapping */
2426 enet0: ethernet@e0000 {
2527 };
arch/arm64/boot/dts/freescale/imx8qxp-mek.dts+0−5
@@ -52,11 +52,6 @@ · 51 unmodified lines
5252 compatible = "ethernet-phy-ieee802.3-c22";
5353 reg = <0>;
5454 };
55−
56− ethphy1: ethernet-phy@1 {
57− compatible = "ethernet-phy-ieee802.3-c22";
58− reg = <1>;
59− };
6055 };
6156 };
6257
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi+3−3
@@ -102,7 +102,7 @@ · 101 unmodified lines
102102 };
103103
104104 gmac0: ethernet@ff800000 {
105− compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
105+ compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac";
106106 reg = <0xff800000 0x2000>;
107107 interrupts = <0 90 4>;
108108 interrupt-names = "macirq";
@@ -118,7 +118,7 @@ · 9 unmodified lines
118118 };
119119
120120 gmac1: ethernet@ff802000 {
121− compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
121+ compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac";
122122 reg = <0xff802000 0x2000>;
123123 interrupts = <0 91 4>;
124124 interrupt-names = "macirq";
@@ -134,7 +134,7 @@ · 9 unmodified lines
134134 };
135135
136136 gmac2: ethernet@ff804000 {
137− compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
137+ compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac";
138138 reg = <0xff804000 0x2000>;
139139 interrupts = <0 92 4>;
140140 interrupt-names = "macirq";
arch/arm64/configs/defconfig+1−1
@@ -773,7 +773,7 @@ CONFIG_ARCH_R8A774A1=y · 772 unmodified lines
773773 CONFIG_ARCH_R8A774B1=y
774774 CONFIG_ARCH_R8A774C0=y
775775 CONFIG_ARCH_R8A7795=y
776−CONFIG_ARCH_R8A7796=y
776+CONFIG_ARCH_R8A77960=y
777777 CONFIG_ARCH_R8A77961=y
778778 CONFIG_ARCH_R8A77965=y
779779 CONFIG_ARCH_R8A77970=y
arch/arm64/include/asm/arch_gicv3.h+1−1
@@ -32,7 +32,7 @@ static inline void gic_write_eoir(u32 irq) · 31 unmodified lines
3232 isb();
3333 }
3434
35−static inline void gic_write_dir(u32 irq)
35+static __always_inline void gic_write_dir(u32 irq)
3636 {
3737 write_sysreg_s(irq, SYS_ICC_DIR_EL1);
3838 isb();
arch/arm64/include/asm/cache.h+1−1
@@ -69,7 +69,7 @@ static inline int icache_is_aliasing(void) · 68 unmodified lines
6969 return test_bit(ICACHEF_ALIASING, &__icache_flags);
7070 }
7171
72−static inline int icache_is_vpipt(void)
72+static __always_inline int icache_is_vpipt(void)
7373 {
7474 return test_bit(ICACHEF_VPIPT, &__icache_flags);
7575 }
arch/arm64/include/asm/cacheflush.h+1−1
@@ -145,7 +145,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *, · 144 unmodified lines
145145 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
146146 extern void flush_dcache_page(struct page *);
147147
148−static inline void __flush_icache_all(void)
148+static __always_inline void __flush_icache_all(void)
149149 {
150150 if (cpus_have_const_cap(ARM64_HAS_CACHE_DIC))
151151 return;
arch/arm64/include/asm/cpufeature.h+5−5
@@ -435,13 +435,13 @@ cpuid_feature_extract_signed_field(u64 features, int field) · 434 unmodified lines
435435 return cpuid_feature_extract_signed_field_width(features, field, 4);
436436 }
437437
438−static inline unsigned int __attribute_const__
438+static __always_inline unsigned int __attribute_const__
439439 cpuid_feature_extract_unsigned_field_width(u64 features, int field, int width)
440440 {
441441 return (u64)(features << (64 - width - field)) >> (64 - width);
442442 }
443443
444−static inline unsigned int __attribute_const__
444+static __always_inline unsigned int __attribute_const__
445445 cpuid_feature_extract_unsigned_field(u64 features, int field)
446446 {
447447 return cpuid_feature_extract_unsigned_field_width(features, field, 4);
@@ -564,7 +564,7 @@ static inline bool system_supports_mixed_endian(void) · 116 unmodified lines
564564 return val == 0x1;
565565 }
566566
567−static inline bool system_supports_fpsimd(void)
567+static __always_inline bool system_supports_fpsimd(void)
568568 {
569569 return !cpus_have_const_cap(ARM64_HAS_NO_FPSIMD);
570570 }
@@ -575,13 +575,13 @@ static inline bool system_uses_ttbr0_pan(void) · 4 unmodified lines
575575 !cpus_have_const_cap(ARM64_HAS_PAN);
576576 }
577577
578−static inline bool system_supports_sve(void)
578+static __always_inline bool system_supports_sve(void)
579579 {
580580 return IS_ENABLED(CONFIG_ARM64_SVE) &&
581581 cpus_have_const_cap(ARM64_SVE);
582582 }
583583
584−static inline bool system_supports_cnp(void)
584+static __always_inline bool system_supports_cnp(void)
585585 {
586586 return IS_ENABLED(CONFIG_ARM64_CNP) &&
587587 cpus_have_const_cap(ARM64_HAS_CNP);
arch/arm64/include/asm/io.h+2−2
@@ -34,7 +34,7 @@ static inline void __raw_writew(u16 val, volatile void __iomem *addr) · 33 unmodified lines
3434 }
3535
3636 #define __raw_writel __raw_writel
37−static inline void __raw_writel(u32 val, volatile void __iomem *addr)
37+static __always_inline void __raw_writel(u32 val, volatile void __iomem *addr)
3838 {
3939 asm volatile("str %w0, [%1]" : : "rZ" (val), "r" (addr));
4040 }
@@ -69,7 +69,7 @@ static inline u16 __raw_readw(const volatile void __iomem *addr) · 28 unmodified lines
6969 }
7070
7171 #define __raw_readl __raw_readl
72−static inline u32 __raw_readl(const volatile void __iomem *addr)
72+static __always_inline u32 __raw_readl(const volatile void __iomem *addr)
7373 {
7474 u32 val;
7575 asm volatile(ALTERNATIVE("ldr %w0, [%1]",
arch/arm64/include/asm/kvm_emulate.h+24−24
@@ -36,7 +36,7 @@ void kvm_inject_undef32(struct kvm_vcpu *vcpu); · 35 unmodified lines
3636 void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr);
3737 void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr);
3838
39−static inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu)
39+static __always_inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu)
4040 {
4141 return !(vcpu->arch.hcr_el2 & HCR_RW);
4242 }
@@ -127,7 +127,7 @@ static inline void vcpu_set_vsesr(struct kvm_vcpu *vcpu, u64 vsesr) · 84 unmodified lines
127127 vcpu->arch.vsesr_el2 = vsesr;
128128 }
129129
130−static inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu)
130+static __always_inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu)
131131 {
132132 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pc;
133133 }
@@ -153,17 +153,17 @@ static inline void vcpu_write_elr_el1(const struct kvm_vcpu *vcpu, unsigned long · 19 unmodified lines
153153 *__vcpu_elr_el1(vcpu) = v;
154154 }
155155
156−static inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu)
156+static __always_inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu)
157157 {
158158 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pstate;
159159 }
160160
161−static inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu)
161+static __always_inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu)
162162 {
163163 return !!(*vcpu_cpsr(vcpu) & PSR_MODE32_BIT);
164164 }
165165
166−static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu)
166+static __always_inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu)
167167 {
168168 if (vcpu_mode_is_32bit(vcpu))
169169 return kvm_condition_valid32(vcpu);
@@ -181,13 +181,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu) · 11 unmodified lines
181181 * coming from a read of ESR_EL2. Otherwise, it may give the wrong result on
182182 * AArch32 with banked registers.
183183 */
184−static inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu,
184+static __always_inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu,
185185 u8 reg_num)
186186 {
187187 return (reg_num == 31) ? 0 : vcpu_gp_regs(vcpu)->regs.regs[reg_num];
188188 }
189189
190−static inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num,
190+static __always_inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num,
191191 unsigned long val)
192192 {
193193 if (reg_num != 31)
@@ -264,12 +264,12 @@ static inline bool vcpu_mode_priv(const struct kvm_vcpu *vcpu) · 70 unmodified lines
264264 return mode != PSR_MODE_EL0t;
265265 }
266266
267−static inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu)
267+static __always_inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu)
268268 {
269269 return vcpu->arch.fault.esr_el2;
270270 }
271271
272−static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu)
272+static __always_inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu)
273273 {
274274 u32 esr = kvm_vcpu_get_hsr(vcpu);
275275
@@ -279,12 +279,12 @@ static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) · 3 unmodified lines
279279 return -1;
280280 }
281281
282−static inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu)
282+static __always_inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu)
283283 {
284284 return vcpu->arch.fault.far_el2;
285285 }
286286
287−static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
287+static __always_inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
288288 {
289289 return ((phys_addr_t)vcpu->arch.fault.hpfar_el2 & HPFAR_MASK) << 8;
290290 }
@@ -299,7 +299,7 @@ static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu) · 8 unmodified lines
299299 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
300300 }
301301
302−static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
302+static __always_inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
303303 {
304304 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
305305 }
@@ -319,17 +319,17 @@ static inline bool kvm_vcpu_dabt_issf(const struct kvm_vcpu *vcpu) · 13 unmodified lines
319319 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SF);
320320 }
321321
322−static inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
322+static __always_inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
323323 {
324324 return (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT;
325325 }
326326
327−static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
327+static __always_inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
328328 {
329329 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
330330 }
331331
332−static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
332+static __always_inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
333333 {
334334 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||
335335 kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */
@@ -340,18 +340,18 @@ static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu) · 4 unmodified lines
340340 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);
341341 }
342342
343−static inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)
343+static __always_inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)
344344 {
345345 return 1 << ((kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SAS) >> ESR_ELx_SAS_SHIFT);
346346 }
347347
348348 /* This one is not specific to Data Abort */
349−static inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu)
349+static __always_inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu)
350350 {
351351 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_IL);
352352 }
353353
354−static inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu)
354+static __always_inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu)
355355 {
356356 return ESR_ELx_EC(kvm_vcpu_get_hsr(vcpu));
357357 }
@@ -361,17 +361,17 @@ static inline bool kvm_vcpu_trap_is_iabt(const struct kvm_vcpu *vcpu) · 3 unmodified lines
361361 return kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_IABT_LOW;
362362 }
363363
364−static inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)
364+static __always_inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)
365365 {
366366 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC;
367367 }
368368
369−static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
369+static __always_inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
370370 {
371371 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC_TYPE;
372372 }
373373
374−static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
374+static __always_inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
375375 {
376376 switch (kvm_vcpu_trap_get_fault(vcpu)) {
377377 case FSC_SEA:
@@ -390,7 +390,7 @@ static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) · 12 unmodified lines
390390 }
391391 }
392392
393−static inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)
393+static __always_inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)
394394 {
395395 u32 esr = kvm_vcpu_get_hsr(vcpu);
396396 return ESR_ELx_SYS64_ISS_RT(esr);
@@ -504,7 +504,7 @@ static inline unsigned long vcpu_data_host_to_guest(struct kvm_vcpu *vcpu, · 107 unmodified lines
504504 return data; /* Leave LE untouched */
505505 }
506506
507−static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)
507+static __always_inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)
508508 {
509509 if (vcpu_mode_is_32bit(vcpu))
510510 kvm_skip_instr32(vcpu, is_wide_instr);
@@ -519,7 +519,7 @@ static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr) · 8 unmodified lines
519519 * Skip an instruction which has been emulated at hyp while most guest sysregs
520520 * are live.
521521 */
522−static inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu)
522+static __always_inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu)
523523 {
524524 *vcpu_pc(vcpu) = read_sysreg_el2(SYS_ELR);
525525 vcpu->arch.ctxt.gp_regs.regs.pstate = read_sysreg_el2(SYS_SPSR);
arch/arm64/include/asm/kvm_host.h+0−32
@@ -626,38 +626,6 @@ static inline void kvm_set_pmu_events(u32 set, struct perf_event_attr *attr) {} · 625 unmodified lines
626626 static inline void kvm_clr_pmu_events(u32 clr) {}
627627 #endif
628628
629−static inline void kvm_arm_vhe_guest_enter(void)
630−{
631− local_daif_mask();
632−
633− /*
634− * Having IRQs masked via PMR when entering the guest means the GIC
635− * will not signal the CPU of interrupts of lower priority, and the
636− * only way to get out will be via guest exceptions.
637− * Naturally, we want to avoid this.
638− *
639− * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a
640− * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU.
641− */
642− pmr_sync();
643−}
644−
645−static inline void kvm_arm_vhe_guest_exit(void)
646−{
647− /*
648− * local_daif_restore() takes care to properly restore PSTATE.DAIF
649− * and the GIC PMR if the host is using IRQ priorities.
650− */
651− local_daif_restore(DAIF_PROCCTX_NOIRQ);
652−
653− /*
654− * When we exit from the guest we change a number of CPU configuration
655− * parameters, such as traps. Make sure these changes take effect
656− * before running the host or additional guests.
657− */
658− isb();
659−}
660−
661629 #define KVM_BP_HARDEN_UNKNOWN -1
662630 #define KVM_BP_HARDEN_WA_NEEDED 0
663631 #define KVM_BP_HARDEN_NOT_REQUIRED 1
arch/arm64/include/asm/kvm_hyp.h+7−0
@@ -47,6 +47,13 @@ · 46 unmodified lines
4747 #define read_sysreg_el2(r) read_sysreg_elx(r, _EL2, _EL1)
4848 #define write_sysreg_el2(v,r) write_sysreg_elx(v, r, _EL2, _EL1)
4949
50+/*
51+ * Without an __arch_swab32(), we fall back to ___constant_swab32(), but the
52+ * static inline can allow the compiler to out-of-line this. KVM always wants
53+ * the macro version as its always inlined.
54+ */
55+#define __kvm_swab32(x) ___constant_swab32(x)
56+
5057 int __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu);
5158
5259 void __vgic_v3_save_state(struct kvm_vcpu *vcpu);
arch/arm64/include/asm/kvm_mmu.h+2−1
@@ -93,7 +93,7 @@ void kvm_update_va_mask(struct alt_instr *alt, · 92 unmodified lines
9393 __le32 *origptr, __le32 *updptr, int nr_inst);
9494 void kvm_compute_layout(void);
9595
96−static inline unsigned long __kern_hyp_va(unsigned long v)
96+static __always_inline unsigned long __kern_hyp_va(unsigned long v)
9797 {
9898 asm volatile(ALTERNATIVE_CB("and %0, %0, #1\n"
9999 "ror %0, %0, #1\n"
@@ -473,6 +473,7 @@ static inline int kvm_write_guest_lock(struct kvm *kvm, gpa_t gpa, · 373 unmodified lines
473473 extern void *__kvm_bp_vect_base;
474474 extern int __kvm_harden_el2_vector_slot;
475475
476+/* This is only called on a VHE system */
476477 static inline void *kvm_get_hyp_vector(void)
477478 {
478479 struct bp_hardening_data *data = arm64_get_bp_hardening_data();
arch/arm64/include/asm/mmu.h+1−3
@@ -29,11 +29,9 @@ typedef struct { · 28 unmodified lines
2929 */
3030 #define ASID(mm) ((mm)->context.id.counter & 0xffff)
3131
32−extern bool arm64_use_ng_mappings;
33−
3432 static inline bool arm64_kernel_unmapped_at_el0(void)
3533 {
36− return arm64_use_ng_mappings;
34+ return cpus_have_const_cap(ARM64_UNMAP_KERNEL_AT_EL0);
3735 }
3836
3937 typedef void (*bp_hardening_cb_t)(void);
arch/arm64/include/asm/pgtable-prot.h+4−2
@@ -23,11 +23,13 @@ · 22 unmodified lines
2323
2424 #include <asm/pgtable-types.h>
2525
26+extern bool arm64_use_ng_mappings;
27+
2628 #define _PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
2729 #define _PROT_SECT_DEFAULT (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
2830
29−#define PTE_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PTE_NG : 0)
30−#define PMD_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PMD_SECT_NG : 0)
31+#define PTE_MAYBE_NG (arm64_use_ng_mappings ? PTE_NG : 0)
32+#define PMD_MAYBE_NG (arm64_use_ng_mappings ? PMD_SECT_NG : 0)
3133
3234 #define PROT_DEFAULT (_PROT_DEFAULT | PTE_MAYBE_NG)
3335 #define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_MAYBE_NG)
arch/arm64/include/asm/unistd.h+1−1
@@ -25,8 +25,8 @@ · 24 unmodified lines
2525 #define __NR_compat_gettimeofday 78
2626 #define __NR_compat_sigreturn 119
2727 #define __NR_compat_rt_sigreturn 173
28−#define __NR_compat_clock_getres 247
2928 #define __NR_compat_clock_gettime 263
29+#define __NR_compat_clock_getres 264
3030 #define __NR_compat_clock_gettime64 403
3131 #define __NR_compat_clock_getres_time64 406
3232
arch/arm64/include/asm/virt.h+1−1
@@ -83,7 +83,7 @@ static inline bool is_kernel_in_hyp_mode(void) · 82 unmodified lines
8383 return read_sysreg(CurrentEL) == CurrentEL_EL2;
8484 }
8585
86−static inline bool has_vhe(void)
86+static __always_inline bool has_vhe(void)
8787 {
8888 if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
8989 return true;
arch/arm64/kernel/smp.c+20−5
@@ -958,11 +958,22 @@ void tick_broadcast(const struct cpumask *mask) · 957 unmodified lines
958958 }
959959 #endif
960960
961+/*
962+ * The number of CPUs online, not counting this CPU (which may not be
963+ * fully online and so not counted in num_online_cpus()).
964+ */
965+static inline unsigned int num_other_online_cpus(void)
966+{
967+ unsigned int this_cpu_online = cpu_online(smp_processor_id());
968+
969+ return num_online_cpus() - this_cpu_online;
970+}
971+
961972 void smp_send_stop(void)
962973 {
963974 unsigned long timeout;
964975
965− if (num_online_cpus() > 1) {
976+ if (num_other_online_cpus()) {
966977 cpumask_t mask;
967978
968979 cpumask_copy(&mask, cpu_online_mask);
@@ -975,10 +986,10 @@ void smp_send_stop(void) · 6 unmodified lines
975986
976987 /* Wait up to one second for other CPUs to stop */
977988 timeout = USEC_PER_SEC;
978− while (num_online_cpus() > 1 && timeout--)
989+ while (num_other_online_cpus() && timeout--)
979990 udelay(1);
980991
981− if (num_online_cpus() > 1)
992+ if (num_other_online_cpus())
982993 pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
983994 cpumask_pr_args(cpu_online_mask));
984995
@@ -1001,7 +1012,11 @@ void crash_smp_send_stop(void) · 16 unmodified lines
10011012
10021013 cpus_stopped = 1;
10031014
1004− if (num_online_cpus() == 1) {
1015+ /*
1016+ * If this cpu is the only one alive at this point in time, online or
1017+ * not, there are no stop messages to be sent around, so just back out.
1018+ */
1019+ if (num_other_online_cpus() == 0) {
10051020 sdei_mask_local_cpu();
10061021 return;
10071022 }
@@ -1009,7 +1024,7 @@ void crash_smp_send_stop(void) · 1 unmodified line
10091024 cpumask_copy(&mask, cpu_online_mask);
10101025 cpumask_clear_cpu(smp_processor_id(), &mask);
10111026
1012− atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
1027+ atomic_set(&waiting_for_crash_ipi, num_other_online_cpus());
10131028
10141029 pr_crit("SMP: stopping secondary CPUs\n");
10151030 smp_cross_call(&mask, IPI_CPU_CRASH_STOP);
arch/arm64/kvm/hyp/switch.c+37−2
@@ -625,7 +625,7 @@ static void __hyp_text __pmu_switch_to_host(struct kvm_cpu_context *host_ctxt) · 624 unmodified lines
625625 }
626626
627627 /* Switch to the guest for VHE systems running in EL2 */
628−int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
628+static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
629629 {
630630 struct kvm_cpu_context *host_ctxt;
631631 struct kvm_cpu_context *guest_ctxt;
@@ -678,7 +678,42 @@ int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) · 46 unmodified lines
678678
679679 return exit_code;
680680 }
681−NOKPROBE_SYMBOL(kvm_vcpu_run_vhe);
681+NOKPROBE_SYMBOL(__kvm_vcpu_run_vhe);
682+
683+int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
684+{
685+ int ret;
686+
687+ local_daif_mask();
688+
689+ /*
690+ * Having IRQs masked via PMR when entering the guest means the GIC
691+ * will not signal the CPU of interrupts of lower priority, and the
692+ * only way to get out will be via guest exceptions.
693+ * Naturally, we want to avoid this.
694+ *
695+ * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a
696+ * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU.
697+ */
698+ pmr_sync();
699+
700+ ret = __kvm_vcpu_run_vhe(vcpu);
701+
702+ /*
703+ * local_daif_restore() takes care to properly restore PSTATE.DAIF
704+ * and the GIC PMR if the host is using IRQ priorities.
705+ */
706+ local_daif_restore(DAIF_PROCCTX_NOIRQ);
707+
708+ /*
709+ * When we exit from the guest we change a number of CPU configuration
710+ * parameters, such as traps. Make sure these changes take effect
711+ * before running the host or additional guests.
712+ */
713+ isb();
714+
715+ return ret;
716+}
682717
683718 /* Switch to the guest for legacy non-VHE systems */
684719 int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)
arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c+2−2
@@ -69,14 +69,14 @@ int __hyp_text __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu) · 68 unmodified lines
6969 u32 data = vcpu_get_reg(vcpu, rd);
7070 if (__is_be(vcpu)) {
7171 /* guest pre-swabbed data, undo this for writel() */
72− data = swab32(data);
72+ data = __kvm_swab32(data);
7373 }
7474 writel_relaxed(data, addr);
7575 } else {
7676 u32 data = readl_relaxed(addr);
7777 if (__is_be(vcpu)) {
7878 /* guest expects swabbed data */
79− data = swab32(data);
79+ data = __kvm_swab32(data);
8080 }
8181 vcpu_set_reg(vcpu, rd, data);
8282 }
arch/arm64/mm/context.c+15−5
@@ -260,14 +260,26 @@ asmlinkage void post_ttbr_update_workaround(void) · 259 unmodified lines
260260 CONFIG_CAVIUM_ERRATUM_27456));
261261 }
262262
263−static int asids_init(void)
263+static int asids_update_limit(void)
264264 {
265− asid_bits = get_cpu_asid_bits();
265+ unsigned long num_available_asids = NUM_USER_ASIDS;
266+
267+ if (arm64_kernel_unmapped_at_el0())
268+ num_available_asids /= 2;
266269 /*
267270 * Expect allocation after rollover to fail if we don't have at least
268271 * one more ASID than CPUs. ASID #0 is reserved for init_mm.
269272 */
270− WARN_ON(NUM_USER_ASIDS - 1 <= num_possible_cpus());
273+ WARN_ON(num_available_asids - 1 <= num_possible_cpus());
274+ pr_info("ASID allocator initialised with %lu entries\n",
275+ num_available_asids);
276+ return 0;
277+}
278+arch_initcall(asids_update_limit);
279+
280+static int asids_init(void)
281+{
282+ asid_bits = get_cpu_asid_bits();
271283 atomic64_set(&asid_generation, ASID_FIRST_VERSION);
272284 asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS), sizeof(*asid_map),
273285 GFP_KERNEL);
@@ -282,8 +294,6 @@ static int asids_init(void) · 8 unmodified lines
282294 */
283295 if (IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0))
284296 set_kpti_asid_bits();
285−
286− pr_info("ASID allocator initialised with %lu entries\n", NUM_USER_ASIDS);
287297 return 0;
288298 }
289299 early_initcall(asids_init);
arch/mips/boot/dts/ingenic/ci20.dts+28−16
@@ -4,6 +4,8 @@ · 3 unmodified lines
44 #include "jz4780.dtsi"
55 #include <dt-bindings/clock/ingenic,tcu.h>
66 #include <dt-bindings/gpio/gpio.h>
7+#include <dt-bindings/interrupt-controller/irq.h>
8+#include <dt-bindings/regulator/active-semi,8865-regulator.h>
79
810 / {
911 compatible = "img,ci20", "ingenic,jz4780";
@@ -163,63 +165,71 @@ · 153 unmodified lines
163165
164166 regulators {
165167 vddcore: SUDCDC1 {
166− regulator-name = "VDDCORE";
168+ regulator-name = "DCDC_REG1";
167169 regulator-min-microvolt = <1100000>;
168170 regulator-max-microvolt = <1100000>;
169171 regulator-always-on;
170172 };
171173 vddmem: SUDCDC2 {
172− regulator-name = "VDDMEM";
174+ regulator-name = "DCDC_REG2";
173175 regulator-min-microvolt = <1500000>;
174176 regulator-max-microvolt = <1500000>;
175177 regulator-always-on;
176178 };
177179 vcc_33: SUDCDC3 {
178− regulator-name = "VCC33";
180+ regulator-name = "DCDC_REG3";
179181 regulator-min-microvolt = <3300000>;
180182 regulator-max-microvolt = <3300000>;
181183 regulator-always-on;
182184 };
183185 vcc_50: SUDCDC4 {
184− regulator-name = "VCC50";
186+ regulator-name = "SUDCDC_REG4";
185187 regulator-min-microvolt = <5000000>;
186188 regulator-max-microvolt = <5000000>;
187189 regulator-always-on;
188190 };
189191 vcc_25: LDO_REG5 {
190− regulator-name = "VCC25";
192+ regulator-name = "LDO_REG5";
191193 regulator-min-microvolt = <2500000>;
192194 regulator-max-microvolt = <2500000>;
193195 regulator-always-on;
194196 };
195197 wifi_io: LDO_REG6 {
196− regulator-name = "WIFIIO";
198+ regulator-name = "LDO_REG6";
197199 regulator-min-microvolt = <2500000>;
198200 regulator-max-microvolt = <2500000>;
199201 regulator-always-on;
200202 };
201203 vcc_28: LDO_REG7 {
202− regulator-name = "VCC28";
204+ regulator-name = "LDO_REG7";
203205 regulator-min-microvolt = <2800000>;
204206 regulator-max-microvolt = <2800000>;
205207 regulator-always-on;
206208 };
207209 vcc_15: LDO_REG8 {
208− regulator-name = "VCC15";
210+ regulator-name = "LDO_REG8";
209211 regulator-min-microvolt = <1500000>;
210212 regulator-max-microvolt = <1500000>;
211213 regulator-always-on;
212214 };
213− vcc_18: LDO_REG9 {
214− regulator-name = "VCC18";
215− regulator-min-microvolt = <1800000>;
216− regulator-max-microvolt = <1800000>;
215+ vrtc_18: LDO_REG9 {
216+ regulator-name = "LDO_REG9";
217+ /* Despite the datasheet stating 3.3V
218+ * for REG9 and the driver expecting that,
219+ * REG9 outputs 1.8V.
220+ * Likely the CI20 uses a proprietary
221+ * factory programmed chip variant.
222+ * Since this is a simple on/off LDO the
223+ * exact values do not matter.
224+ */
225+ regulator-min-microvolt = <3300000>;
226+ regulator-max-microvolt = <3300000>;
217227 regulator-always-on;
218228 };
219229 vcc_11: LDO_REG10 {
220− regulator-name = "VCC11";
221− regulator-min-microvolt = <1100000>;
222− regulator-max-microvolt = <1100000>;
230+ regulator-name = "LDO_REG10";
231+ regulator-min-microvolt = <1200000>;
232+ regulator-max-microvolt = <1200000>;
223233 regulator-always-on;
224234 };
225235 };
@@ -261,7 +271,9 @@ · 35 unmodified lines
261271 rtc@51 {
262272 compatible = "nxp,pcf8563";
263273 reg = <0x51>;
264− interrupts = <110>;
274+
275+ interrupt-parent = <&gpf>;
276+ interrupts = <30 IRQ_TYPE_LEVEL_LOW>;
265277 };
266278 };
267279
arch/mips/boot/dts/ingenic/jz4740.dtsi+9−8
@@ -1,5 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <dt-bindings/clock/jz4740-cgu.h>
3+#include <dt-bindings/clock/ingenic,tcu.h>
34
45 / {
56 #address-cells = <1>;
@@ -45,14 +46,6 @@ · 39 unmodified lines
4546 #clock-cells = <1>;
4647 };
4748
48− watchdog: watchdog@10002000 {
49− compatible = "ingenic,jz4740-watchdog";
50− reg = <0x10002000 0x10>;
51−
52− clocks = <&cgu JZ4740_CLK_RTC>;
53− clock-names = "rtc";
54− };
55−
5649 tcu: timer@10002000 {
5750 compatible = "ingenic,jz4740-tcu", "simple-mfd";
5851 reg = <0x10002000 0x1000>;
@@ -73,6 +66,14 @@ · 14 unmodified lines
7366
7467 interrupt-parent = <&intc>;
7568 interrupts = <23 22 21>;
69+
70+ watchdog: watchdog@0 {
71+ compatible = "ingenic,jz4740-watchdog";
72+ reg = <0x0 0xc>;
73+
74+ clocks = <&tcu TCU_CLK_WDT>;
75+ clock-names = "wdt";
76+ };
7677 };
7778
7879 rtc_dev: rtc@10003000 {
arch/mips/boot/dts/ingenic/jz4780.dtsi+9−8
@@ -1,5 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <dt-bindings/clock/jz4780-cgu.h>
3+#include <dt-bindings/clock/ingenic,tcu.h>
34 #include <dt-bindings/dma/jz4780-dma.h>
45
56 / {
@@ -67,6 +68,14 @@ · 61 unmodified lines
6768
6869 interrupt-parent = <&intc>;
6970 interrupts = <27 26 25>;
71+
72+ watchdog: watchdog@0 {
73+ compatible = "ingenic,jz4780-watchdog";
74+ reg = <0x0 0xc>;
75+
76+ clocks = <&tcu TCU_CLK_WDT>;
77+ clock-names = "wdt";
78+ };
7079 };
7180
7281 rtc_dev: rtc@10003000 {
@@ -348,14 +357,6 @@ · 275 unmodified lines
348357 status = "disabled";
349358 };
350359
351− watchdog: watchdog@10002000 {
352− compatible = "ingenic,jz4780-watchdog";
353− reg = <0x10002000 0x10>;
354−
355− clocks = <&cgu JZ4780_CLK_RTCLK>;
356− clock-names = "rtc";
357− };
358−
359360 nemc: nemc@13410000 {
360361 compatible = "ingenic,jz4780-nemc";
361362 reg = <0x13410000 0x10000>;
arch/mips/boot/dts/ingenic/x1000.dtsi+2−4
@@ -1,4 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2+#include <dt-bindings/clock/ingenic,tcu.h>
23 #include <dt-bindings/clock/x1000-cgu.h>
34 #include <dt-bindings/dma/x1000-dma.h>
45
@@ -72,7 +73,7 @@ · 67 unmodified lines
7273 compatible = "ingenic,x1000-watchdog", "ingenic,jz4780-watchdog";
7374 reg = <0x0 0x10>;
7475
75− clocks = <&cgu X1000_CLK_RTCLK>;
76+ clocks = <&tcu TCU_CLK_WDT>;
7677 clock-names = "wdt";
7778 };
7879 };
@@ -158,7 +159,6 @@ · 79 unmodified lines
158159 i2c0: i2c-controller@10050000 {
159160 compatible = "ingenic,x1000-i2c";
160161 reg = <0x10050000 0x1000>;
161−
162162 #address-cells = <1>;
163163 #size-cells = <0>;
164164
@@ -173,7 +173,6 @@ · 8 unmodified lines
173173 i2c1: i2c-controller@10051000 {
174174 compatible = "ingenic,x1000-i2c";
175175 reg = <0x10051000 0x1000>;
176−
177176 #address-cells = <1>;
178177 #size-cells = <0>;
179178
@@ -188,7 +187,6 @@ · 8 unmodified lines
188187 i2c2: i2c-controller@10052000 {
189188 compatible = "ingenic,x1000-i2c";
190189 reg = <0x10052000 0x1000>;
191−
192190 #address-cells = <1>;
193191 #size-cells = <0>;
194192
arch/mips/include/asm/sync.h+3−1
@@ -155,9 +155,11 @@ · 154 unmodified lines
155155 * effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use
156156 * optimized memory barrier primitives."). Here we specify that the affected
157157 * sync instructions should be emitted twice.
158+ * Note that this expression is evaluated by the assembler (not the compiler),
159+ * and that the assembler evaluates '==' as 0 or -1, not 0 or 1.
158160 */
159161 #ifdef CONFIG_CPU_CAVIUM_OCTEON
160−# define __SYNC_rpt(type) (1 + (type == __SYNC_wmb))
162+# define __SYNC_rpt(type) (1 - (type == __SYNC_wmb))
161163 #else
162164 # define __SYNC_rpt(type) 1
163165 #endif
arch/mips/kernel/setup.c+2−1
@@ -605,7 +605,8 @@ static void __init bootcmdline_init(char **cmdline_p) · 604 unmodified lines
605605 * If we're configured to take boot arguments from DT, look for those
606606 * now.
607607 */
608− if (IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB))
608+ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB) ||
609+ IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND))
609610 of_scan_flat_dt(bootcmdline_scan_chosen, &dt_bootargs);
610611 #endif
611612
arch/mips/kernel/vpe.c+1−1
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v) · 133 unmodified lines
134134 {
135135 list_del(&v->list);
136136 if (v->load_addr)
137− release_progmem(v);
137+ release_progmem(v->load_addr);
138138 kfree(v);
139139 }
140140
arch/mips/vdso/Makefile+25−3
@@ -33,6 +33,7 @@ endif · 32 unmodified lines
3333 cflags-vdso := $(ccflags-vdso) \
3434 $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
3535 -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
36+ -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
3637 -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
3738 $(call cc-option, -fno-asynchronous-unwind-tables) \
3839 $(call cc-option, -fno-stack-protector)
@@ -51,6 +52,8 @@ endif · 12 unmodified lines
5152
5253 CFLAGS_REMOVE_vgettimeofday.o = -pg
5354
55+DISABLE_VDSO := n
56+
5457 #
5558 # For the pre-R6 code in arch/mips/vdso/vdso.h for locating
5659 # the base address of VDSO, the linker will emit a R_MIPS_PC32
@@ -64,11 +67,24 @@ CFLAGS_REMOVE_vgettimeofday.o = -pg · 7 unmodified lines
6467 ifndef CONFIG_CPU_MIPSR6
6568 ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
6669 $(warning MIPS VDSO requires binutils >= 2.25)
67− obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
68− ccflags-vdso += -DDISABLE_MIPS_VDSO
70+ DISABLE_VDSO := y
6971 endif
7072 endif
7173
74+#
75+# GCC (at least up to version 9.2) appears to emit function calls that make use
76+# of the GOT when targeting microMIPS, which we can't use in the VDSO due to
77+# the lack of relocations. As such, we disable the VDSO for microMIPS builds.
78+#
79+ifdef CONFIG_CPU_MICROMIPS
80+ DISABLE_VDSO := y
81+endif
82+
83+ifeq ($(DISABLE_VDSO),y)
84+ obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
85+ ccflags-vdso += -DDISABLE_MIPS_VDSO
86+endif
87+
7288 # VDSO linker flags.
7389 VDSO_LDFLAGS := \
7490 -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \
@@ -81,12 +97,18 @@ GCOV_PROFILE := n · 6 unmodified lines
8197 UBSAN_SANITIZE := n
8298 KCOV_INSTRUMENT := n
8399
100+# Check that we don't have PIC 'jalr t9' calls left
101+quiet_cmd_vdso_mips_check = VDSOCHK $@
102+ cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | egrep -h "jalr.*t9" > /dev/null; \
103+ then (echo >&2 "$@: PIC 'jalr t9' calls are not supported"; \
104+ rm -f $@; /bin/false); fi
105+
84106 #
85107 # Shared build commands.
86108 #
87109
88110 quiet_cmd_vdsold_and_vdso_check = LD $@
89− cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
111+ cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check); $(cmd_vdso_mips_check)
90112
91113 quiet_cmd_vdsold = VDSO $@
92114 cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \
arch/powerpc/kernel/cputable.c+3−1
@@ -2193,11 +2193,13 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset, · 2192 unmodified lines
21932193 * oprofile_cpu_type already has a value, then we are
21942194 * possibly overriding a real PVR with a logical one,
21952195 * and, in that case, keep the current value for
2196− * oprofile_cpu_type.
2196+ * oprofile_cpu_type. Futhermore, let's ensure that the
2197+ * fix for the PMAO bug is enabled on compatibility mode.
21972198 */
21982199 if (old.oprofile_cpu_type != NULL) {
21992200 t->oprofile_cpu_type = old.oprofile_cpu_type;
22002201 t->oprofile_type = old.oprofile_type;
2202+ t->cpu_features |= old.cpu_features & CPU_FTR_PMAO_BUG;
22012203 }
22022204 }
22032205
arch/powerpc/kernel/hw_breakpoint.c+7−5
@@ -331,11 +331,13 @@ int hw_breakpoint_handler(struct die_args *args) · 330 unmodified lines
331331 }
332332
333333 info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ;
334− if (!dar_within_range(regs->dar, info))
335− info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
336−
337− if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info))
338− goto out;
334+ if (IS_ENABLED(CONFIG_PPC_8xx)) {
335+ if (!dar_within_range(regs->dar, info))
336+ info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
337+ } else {
338+ if (!stepping_handler(regs, bp, info))
339+ goto out;
340+ }
339341
340342 /*
341343 * As a policy, the callback is invoked in a 'trigger-after-execute'
arch/powerpc/kernel/vmlinux.lds.S+6−0
@@ -303,6 +303,12 @@ SECTIONS · 302 unmodified lines
303303 *(.branch_lt)
304304 }
305305
306+#ifdef CONFIG_DEBUG_INFO_BTF
307+ .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
308+ *(.BTF)
309+ }
310+#endif
311+
306312 .opd : AT(ADDR(.opd) - LOAD_OFFSET) {
307313 __start_opd = .;
308314 KEEP(*(.opd))
arch/powerpc/mm/mem.c+2−0
@@ -373,7 +373,9 @@ static inline bool flush_coherent_icache(unsigned long addr) · 372 unmodified lines
373373 */
374374 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
375375 mb(); /* sync */
376+ allow_read_from_user((const void __user *)addr, L1_CACHE_BYTES);
376377 icbi((void *)addr);
378+ prevent_read_from_user((const void __user *)addr, L1_CACHE_BYTES);
377379 mb(); /* sync */
378380 isync();
379381 return true;
arch/riscv/Kconfig+1−0
@@ -121,6 +121,7 @@ config ARCH_FLATMEM_ENABLE · 120 unmodified lines
121121
122122 config ARCH_SPARSEMEM_ENABLE
123123 def_bool y
124+ depends on MMU
124125 select SPARSEMEM_VMEMMAP_ENABLE
125126
126127 config ARCH_SELECT_MEMORY_MODEL
arch/riscv/Kconfig.socs+24−0
@@ -10,4 +10,28 @@ config SOC_SIFIVE · 9 unmodified lines
1010 help
1111 This enables support for SiFive SoC platform hardware.
1212
13+config SOC_VIRT
14+ bool "QEMU Virt Machine"
15+ select VIRTIO_PCI
16+ select VIRTIO_BALLOON
17+ select VIRTIO_MMIO
18+ select VIRTIO_CONSOLE
19+ select VIRTIO_NET
20+ select NET_9P_VIRTIO
21+ select VIRTIO_BLK
22+ select SCSI_VIRTIO
23+ select DRM_VIRTIO_GPU
24+ select HW_RANDOM_VIRTIO
25+ select RPMSG_CHAR
26+ select RPMSG_VIRTIO
27+ select CRYPTO_DEV_VIRTIO
28+ select VIRTIO_INPUT
29+ select POWER_RESET_SYSCON
30+ select POWER_RESET_SYSCON_POWEROFF
31+ select GOLDFISH
32+ select RTC_DRV_GOLDFISH
33+ select SIFIVE_PLIC
34+ help
35+ This enables support for QEMU Virt Machine.
36+
1337 endmenu
arch/riscv/Makefile+4−2
@@ -13,8 +13,10 @@ LDFLAGS_vmlinux := · 12 unmodified lines
1313 ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
1414 LDFLAGS_vmlinux := --no-relax
1515 endif
16−KBUILD_AFLAGS_MODULE += -fPIC
17−KBUILD_CFLAGS_MODULE += -fPIC
16+
17+ifeq ($(CONFIG_64BIT)$(CONFIG_CMODEL_MEDLOW),yy)
18+KBUILD_CFLAGS_MODULE += -mcmodel=medany
19+endif
1820
1921 export BITS
2022 ifeq ($(CONFIG_ARCH_RV64I),y)
arch/riscv/boot/.gitignore+2−0
@@ -1,2 +1,4 @@
11 Image
22 Image.gz
3+loader
4+loader.lds
arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts+5−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright (c) 2018-2019 SiFive, Inc */
33
44 #include "fu540-c000.dtsi"
5+#include <dt-bindings/gpio/gpio.h>
56
67 /* Clock frequency (in Hz) of the PCB crystal for rtcclk */
78 #define RTCCLK_FREQ 1000000
@@ -41,6 +42,10 @@ · 33 unmodified lines
4142 clock-frequency = <RTCCLK_FREQ>;
4243 clock-output-names = "rtcclk";
4344 };
45+ gpio-restart {
46+ compatible = "gpio-restart";
47+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
48+ };
4449 };
4550
4651 &uart0 {
arch/riscv/configs/defconfig+3−14
@@ -15,6 +15,7 @@ CONFIG_BLK_DEV_INITRD=y · 14 unmodified lines
1515 CONFIG_EXPERT=y
1616 CONFIG_BPF_SYSCALL=y
1717 CONFIG_SOC_SIFIVE=y
18+CONFIG_SOC_VIRT=y
1819 CONFIG_SMP=y
1920 CONFIG_MODULES=y
2021 CONFIG_MODULE_UNLOAD=y
@@ -30,7 +31,6 @@ CONFIG_IP_PNP_BOOTP=y · 9 unmodified lines
3031 CONFIG_IP_PNP_RARP=y
3132 CONFIG_NETLINK_DIAG=y
3233 CONFIG_NET_9P=y
33−CONFIG_NET_9P_VIRTIO=y
3434 CONFIG_PCI=y
3535 CONFIG_PCIEPORTBUS=y
3636 CONFIG_PCI_HOST_GENERIC=y
@@ -38,15 +38,12 @@ CONFIG_PCIE_XILINX=y · 1 unmodified line
3838 CONFIG_DEVTMPFS=y
3939 CONFIG_DEVTMPFS_MOUNT=y
4040 CONFIG_BLK_DEV_LOOP=y
41−CONFIG_VIRTIO_BLK=y
4241 CONFIG_BLK_DEV_SD=y
4342 CONFIG_BLK_DEV_SR=y
44−CONFIG_SCSI_VIRTIO=y
4543 CONFIG_ATA=y
4644 CONFIG_SATA_AHCI=y
4745 CONFIG_SATA_AHCI_PLATFORM=y
4846 CONFIG_NETDEVICES=y
49−CONFIG_VIRTIO_NET=y
5047 CONFIG_MACB=y
5148 CONFIG_E1000E=y
5249 CONFIG_R8169=y
@@ -57,15 +54,13 @@ CONFIG_SERIAL_8250_CONSOLE=y · 4 unmodified lines
5754 CONFIG_SERIAL_OF_PLATFORM=y
5855 CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
5956 CONFIG_HVC_RISCV_SBI=y
60−CONFIG_VIRTIO_CONSOLE=y
6157 CONFIG_HW_RANDOM=y
62−CONFIG_HW_RANDOM_VIRTIO=y
6358 CONFIG_SPI=y
6459 CONFIG_SPI_SIFIVE=y
6560 # CONFIG_PTP_1588_CLOCK is not set
61+CONFIG_POWER_RESET=y
6662 CONFIG_DRM=y
6763 CONFIG_DRM_RADEON=y
68−CONFIG_DRM_VIRTIO_GPU=y
6964 CONFIG_FRAMEBUFFER_CONSOLE=y
7065 CONFIG_USB=y
7166 CONFIG_USB_XHCI_HCD=y
@@ -78,12 +73,7 @@ CONFIG_USB_STORAGE=y · 6 unmodified lines
7873 CONFIG_USB_UAS=y
7974 CONFIG_MMC=y
8075 CONFIG_MMC_SPI=y
81−CONFIG_VIRTIO_PCI=y
82−CONFIG_VIRTIO_BALLOON=y
83−CONFIG_VIRTIO_INPUT=y
84−CONFIG_VIRTIO_MMIO=y
85−CONFIG_RPMSG_CHAR=y
86−CONFIG_RPMSG_VIRTIO=y
76+CONFIG_RTC_CLASS=y
8777 CONFIG_EXT4_FS=y
8878 CONFIG_EXT4_FS_POSIX_ACL=y
8979 CONFIG_AUTOFS4_FS=y
@@ -98,7 +88,6 @@ CONFIG_NFS_V4_2=y · 8 unmodified lines
9888 CONFIG_ROOT_NFS=y
9989 CONFIG_9P_FS=y
10090 CONFIG_CRYPTO_USER_API_HASH=y
101−CONFIG_CRYPTO_DEV_VIRTIO=y
10291 CONFIG_PRINTK_TIME=y
10392 CONFIG_DEBUG_FS=y
10493 CONFIG_DEBUG_PAGEALLOC=y
arch/riscv/configs/rv32_defconfig+3−15
@@ -14,6 +14,7 @@ CONFIG_CHECKPOINT_RESTORE=y · 13 unmodified lines
1414 CONFIG_BLK_DEV_INITRD=y
1515 CONFIG_EXPERT=y
1616 CONFIG_BPF_SYSCALL=y
17+CONFIG_SOC_VIRT=y
1718 CONFIG_ARCH_RV32I=y
1819 CONFIG_SMP=y
1920 CONFIG_MODULES=y
@@ -30,7 +31,6 @@ CONFIG_IP_PNP_BOOTP=y · 10 unmodified lines
3031 CONFIG_IP_PNP_RARP=y
3132 CONFIG_NETLINK_DIAG=y
3233 CONFIG_NET_9P=y
33−CONFIG_NET_9P_VIRTIO=y
3434 CONFIG_PCI=y
3535 CONFIG_PCIEPORTBUS=y
3636 CONFIG_PCI_HOST_GENERIC=y
@@ -38,15 +38,12 @@ CONFIG_PCIE_XILINX=y · 1 unmodified line
3838 CONFIG_DEVTMPFS=y
3939 CONFIG_DEVTMPFS_MOUNT=y
4040 CONFIG_BLK_DEV_LOOP=y
41−CONFIG_VIRTIO_BLK=y
4241 CONFIG_BLK_DEV_SD=y
4342 CONFIG_BLK_DEV_SR=y
44−CONFIG_SCSI_VIRTIO=y
4543 CONFIG_ATA=y
4644 CONFIG_SATA_AHCI=y
4745 CONFIG_SATA_AHCI_PLATFORM=y
4846 CONFIG_NETDEVICES=y
49−CONFIG_VIRTIO_NET=y
5047 CONFIG_MACB=y
5148 CONFIG_E1000E=y
5249 CONFIG_R8169=y
@@ -57,13 +54,11 @@ CONFIG_SERIAL_8250_CONSOLE=y · 4 unmodified lines
5754 CONFIG_SERIAL_OF_PLATFORM=y
5855 CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
5956 CONFIG_HVC_RISCV_SBI=y
60−CONFIG_VIRTIO_CONSOLE=y
6157 CONFIG_HW_RANDOM=y
62−CONFIG_HW_RANDOM_VIRTIO=y
6358 # CONFIG_PTP_1588_CLOCK is not set
59+CONFIG_POWER_RESET=y
6460 CONFIG_DRM=y
6561 CONFIG_DRM_RADEON=y
66−CONFIG_DRM_VIRTIO_GPU=y
6762 CONFIG_FRAMEBUFFER_CONSOLE=y
6863 CONFIG_USB=y
6964 CONFIG_USB_XHCI_HCD=y
@@ -74,13 +69,7 @@ CONFIG_USB_OHCI_HCD=y · 4 unmodified lines
7469 CONFIG_USB_OHCI_HCD_PLATFORM=y
7570 CONFIG_USB_STORAGE=y
7671 CONFIG_USB_UAS=y
77−CONFIG_VIRTIO_PCI=y
78−CONFIG_VIRTIO_BALLOON=y
79−CONFIG_VIRTIO_INPUT=y
80−CONFIG_VIRTIO_MMIO=y
81−CONFIG_RPMSG_CHAR=y
82−CONFIG_RPMSG_VIRTIO=y
83−CONFIG_SIFIVE_PLIC=y
72+CONFIG_RTC_CLASS=y
8473 CONFIG_EXT4_FS=y
8574 CONFIG_EXT4_FS_POSIX_ACL=y
8675 CONFIG_AUTOFS4_FS=y
@@ -95,7 +84,6 @@ CONFIG_NFS_V4_2=y · 8 unmodified lines
9584 CONFIG_ROOT_NFS=y
9685 CONFIG_9P_FS=y
9786 CONFIG_CRYPTO_USER_API_HASH=y
98−CONFIG_CRYPTO_DEV_VIRTIO=y
9987 CONFIG_PRINTK_TIME=y
10088 CONFIG_DEBUG_FS=y
10189 CONFIG_DEBUG_PAGEALLOC=y
arch/riscv/include/asm/csr.h+12−0
@@ -72,6 +72,16 @@ · 71 unmodified lines
7272 #define EXC_LOAD_PAGE_FAULT 13
7373 #define EXC_STORE_PAGE_FAULT 15
7474
75+/* PMP configuration */
76+#define PMP_R 0x01
77+#define PMP_W 0x02
78+#define PMP_X 0x04
79+#define PMP_A 0x18
80+#define PMP_A_TOR 0x08
81+#define PMP_A_NA4 0x10
82+#define PMP_A_NAPOT 0x18
83+#define PMP_L 0x80
84+
7585 /* symbolic CSR names: */
7686 #define CSR_CYCLE 0xc00
7787 #define CSR_TIME 0xc01
@@ -100,6 +110,8 @@ · 22 unmodified lines
100110 #define CSR_MCAUSE 0x342
101111 #define CSR_MTVAL 0x343
102112 #define CSR_MIP 0x344
113+#define CSR_PMPCFG0 0x3a0
114+#define CSR_PMPADDR0 0x3b0
103115 #define CSR_MHARTID 0xf14
104116
105117 #ifdef CONFIG_RISCV_M_MODE
arch/riscv/include/asm/syscall.h+0−7
@@ -28,13 +28,6 @@ static inline int syscall_get_nr(struct task_struct *task, · 27 unmodified lines
2828 return regs->a7;
2929 }
3030
31−static inline void syscall_set_nr(struct task_struct *task,
32− struct pt_regs *regs,
33− int sysno)
34−{
35− regs->a7 = sysno;
36−}
37−
3831 static inline void syscall_rollback(struct task_struct *task,
3932 struct pt_regs *regs)
4033 {
arch/riscv/kernel/entry.S+3−8
@@ -228,20 +228,13 @@ check_syscall_nr: · 227 unmodified lines
228228 /* Check to make sure we don't jump to a bogus syscall number. */
229229 li t0, __NR_syscalls
230230 la s0, sys_ni_syscall
231− /*
232− * The tracer can change syscall number to valid/invalid value.
233− * We use syscall_set_nr helper in syscall_trace_enter thus we
234− * cannot trust the current value in a7 and have to reload from
235− * the current task pt_regs.
236− */
237− REG_L a7, PT_A7(sp)
238231 /*
239232 * Syscall number held in a7.
240233 * If syscall number is above allowed value, redirect to ni_syscall.
241234 */
242235 bge a7, t0, 1f
243236 /*
244− * Check if syscall is rejected by tracer or seccomp, i.e., a7 == -1.
237+ * Check if syscall is rejected by tracer, i.e., a7 == -1.
245238 * If yes, we pretend it was executed.
246239 */
247240 li t1, -1
@@ -334,6 +327,7 @@ work_resched: · 86 unmodified lines
334327 handle_syscall_trace_enter:
335328 move a0, sp
336329 call do_syscall_trace_enter
330+ move t0, a0
337331 REG_L a0, PT_A0(sp)
338332 REG_L a1, PT_A1(sp)
339333 REG_L a2, PT_A2(sp)
@@ -342,6 +336,7 @@ handle_syscall_trace_enter: · 2 unmodified lines
342336 REG_L a5, PT_A5(sp)
343337 REG_L a6, PT_A6(sp)
344338 REG_L a7, PT_A7(sp)
339+ bnez t0, ret_from_syscall_rejected
345340 j check_syscall_nr
346341 handle_syscall_trace_exit:
347342 move a0, sp
arch/riscv/kernel/head.S+6−0
@@ -58,6 +58,12 @@ _start_kernel: · 57 unmodified lines
5858 /* Reset all registers except ra, a0, a1 */
5959 call reset_regs
6060
61+ /* Setup a PMP to permit access to all of memory. */
62+ li a0, -1
63+ csrw CSR_PMPADDR0, a0
64+ li a0, (PMP_A_NAPOT | PMP_R | PMP_W | PMP_X)
65+ csrw CSR_PMPCFG0, a0
66+
6167 /*
6268 * The hartid in a0 is expected later on, and we have no firmware
6369 * to hand it to us.
arch/riscv/kernel/module.c+16−0
@@ -8,6 +8,10 @@ · 7 unmodified lines
88 #include <linux/err.h>
99 #include <linux/errno.h>
1010 #include <linux/moduleloader.h>
11+#include <linux/vmalloc.h>
12+#include <linux/sizes.h>
13+#include <asm/pgtable.h>
14+#include <asm/sections.h>
1115
1216 static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v)
1317 {
@@ -386,3 +390,15 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, · 372 unmodified lines
386390
387391 return 0;
388392 }
393+
394+#if defined(CONFIG_MMU) && defined(CONFIG_64BIT)
395+#define VMALLOC_MODULE_START \
396+ max(PFN_ALIGN((unsigned long)&_end - SZ_2G), VMALLOC_START)
397+void *module_alloc(unsigned long size)
398+{
399+ return __vmalloc_node_range(size, 1, VMALLOC_MODULE_START,
400+ VMALLOC_END, GFP_KERNEL,
401+ PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
402+ __builtin_return_address(0));
403+}
404+#endif
arch/riscv/kernel/ptrace.c+5−6
@@ -148,21 +148,19 @@ long arch_ptrace(struct task_struct *child, long request, · 147 unmodified lines
148148 * Allows PTRACE_SYSCALL to work. These are called from entry.S in
149149 * {handle,ret_from}_syscall.
150150 */
151−__visible void do_syscall_trace_enter(struct pt_regs *regs)
151+__visible int do_syscall_trace_enter(struct pt_regs *regs)
152152 {
153153 if (test_thread_flag(TIF_SYSCALL_TRACE))
154154 if (tracehook_report_syscall_entry(regs))
155− syscall_set_nr(current, regs, -1);
155+ return -1;
156156
157157 /*
158158 * Do the secure computing after ptrace; failures should be fast.
159159 * If this fails we might have return value in a0 from seccomp
160160 * (via SECCOMP_RET_ERRNO/TRACE).
161161 */
162− if (secure_computing() == -1) {
163− syscall_set_nr(current, regs, -1);
164− return;
165− }
162+ if (secure_computing() == -1)
163+ return -1;
166164
167165 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
168166 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
@@ -170,6 +168,7 @@ __visible void do_syscall_trace_enter(struct pt_regs *regs) · 1 unmodified line
170168 #endif
171169
172170 audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
171+ return 0;
173172 }
174173
175174 __visible void do_syscall_trace_exit(struct pt_regs *regs)
arch/riscv/kernel/traps.c+2−2
@@ -156,6 +156,6 @@ void __init trap_init(void) · 155 unmodified lines
156156 csr_write(CSR_SCRATCH, 0);
157157 /* Set the exception vector address */
158158 csr_write(CSR_TVEC, &handle_exception);
159− /* Enable all interrupts */
160− csr_write(CSR_IE, -1);
159+ /* Enable interrupts */
160+ csr_write(CSR_IE, IE_SIE | IE_EIE);
161161 }
arch/riscv/mm/init.c+1−1
@@ -131,7 +131,7 @@ void __init setup_bootmem(void) · 130 unmodified lines
131131 for_each_memblock(memory, reg) {
132132 phys_addr_t end = reg->base + reg->size;
133133
134− if (reg->base <= vmlinux_end && vmlinux_end <= end) {
134+ if (reg->base <= vmlinux_start && vmlinux_end <= end) {
135135 mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET);
136136
137137 /*
arch/riscv/mm/kasan_init.c+31−22
@@ -19,18 +19,20 @@ asmlinkage void __init kasan_early_init(void) · 18 unmodified lines
1919 for (i = 0; i < PTRS_PER_PTE; ++i)
2020 set_pte(kasan_early_shadow_pte + i,
2121 mk_pte(virt_to_page(kasan_early_shadow_page),
22− PAGE_KERNEL));
22+ PAGE_KERNEL));
2323
2424 for (i = 0; i < PTRS_PER_PMD; ++i)
2525 set_pmd(kasan_early_shadow_pmd + i,
26− pfn_pmd(PFN_DOWN(__pa((uintptr_t)kasan_early_shadow_pte)),
27− __pgprot(_PAGE_TABLE)));
26+ pfn_pmd(PFN_DOWN
27+ (__pa((uintptr_t) kasan_early_shadow_pte)),
28+ __pgprot(_PAGE_TABLE)));
2829
2930 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;
3031 i += PGDIR_SIZE, ++pgd)
3132 set_pgd(pgd,
32− pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))),
33− __pgprot(_PAGE_TABLE)));
33+ pfn_pgd(PFN_DOWN
34+ (__pa(((uintptr_t) kasan_early_shadow_pmd))),
35+ __pgprot(_PAGE_TABLE)));
3436
3537 /* init for swapper_pg_dir */
3638 pgd = pgd_offset_k(KASAN_SHADOW_START);
@@ -38,37 +40,43 @@ asmlinkage void __init kasan_early_init(void) · 1 unmodified line
3840 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;
3941 i += PGDIR_SIZE, ++pgd)
4042 set_pgd(pgd,
41− pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))),
42− __pgprot(_PAGE_TABLE)));
43+ pfn_pgd(PFN_DOWN
44+ (__pa(((uintptr_t) kasan_early_shadow_pmd))),
45+ __pgprot(_PAGE_TABLE)));
4346
4447 flush_tlb_all();
4548 }
4649
4750 static void __init populate(void *start, void *end)
4851 {
49− unsigned long i;
52+ unsigned long i, offset;
5053 unsigned long vaddr = (unsigned long)start & PAGE_MASK;
5154 unsigned long vend = PAGE_ALIGN((unsigned long)end);
5255 unsigned long n_pages = (vend - vaddr) / PAGE_SIZE;
56+ unsigned long n_ptes =
57+ ((n_pages + PTRS_PER_PTE) & -PTRS_PER_PTE) / PTRS_PER_PTE;
5358 unsigned long n_pmds =
54− (n_pages % PTRS_PER_PTE) ? n_pages / PTRS_PER_PTE + 1 :
55− n_pages / PTRS_PER_PTE;
59+ ((n_ptes + PTRS_PER_PMD) & -PTRS_PER_PMD) / PTRS_PER_PMD;
60+
61+ pte_t *pte =
62+ memblock_alloc(n_ptes * PTRS_PER_PTE * sizeof(pte_t), PAGE_SIZE);
63+ pmd_t *pmd =
64+ memblock_alloc(n_pmds * PTRS_PER_PMD * sizeof(pmd_t), PAGE_SIZE);
5665 pgd_t *pgd = pgd_offset_k(vaddr);
57− pmd_t *pmd = memblock_alloc(n_pmds * sizeof(pmd_t), PAGE_SIZE);
58− pte_t *pte = memblock_alloc(n_pages * sizeof(pte_t), PAGE_SIZE);
5966
6067 for (i = 0; i < n_pages; i++) {
6168 phys_addr_t phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
62−
63− set_pte(pte + i, pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
69+ set_pte(&pte[i], pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
6470 }
6571
66− for (i = 0; i < n_pmds; ++pgd, i += PTRS_PER_PMD)
67− set_pgd(pgd, pfn_pgd(PFN_DOWN(__pa(((uintptr_t)(pmd + i)))),
72+ for (i = 0, offset = 0; i < n_ptes; i++, offset += PTRS_PER_PTE)
73+ set_pmd(&pmd[i],
74+ pfn_pmd(PFN_DOWN(__pa(&pte[offset])),
6875 __pgprot(_PAGE_TABLE)));
6976
70− for (i = 0; i < n_pages; ++pmd, i += PTRS_PER_PTE)
71− set_pmd(pmd, pfn_pmd(PFN_DOWN(__pa((uintptr_t)(pte + i))),
77+ for (i = 0, offset = 0; i < n_pmds; i++, offset += PTRS_PER_PMD)
78+ set_pgd(&pgd[i],
79+ pfn_pgd(PFN_DOWN(__pa(&pmd[offset])),
7280 __pgprot(_PAGE_TABLE)));
7381
7482 flush_tlb_all();
@@ -81,7 +89,8 @@ void __init kasan_init(void) · 6 unmodified lines
8189 unsigned long i;
8290
8391 kasan_populate_early_shadow((void *)KASAN_SHADOW_START,
84− (void *)kasan_mem_to_shadow((void *)VMALLOC_END));
92+ (void *)kasan_mem_to_shadow((void *)
93+ VMALLOC_END));
8594
8695 for_each_memblock(memory, reg) {
8796 void *start = (void *)__va(reg->base);
@@ -90,14 +99,14 @@ void __init kasan_init(void) · 2 unmodified lines
9099 if (start >= end)
91100 break;
92101
93− populate(kasan_mem_to_shadow(start),
94− kasan_mem_to_shadow(end));
102+ populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end));
95103 };
96104
97105 for (i = 0; i < PTRS_PER_PTE; i++)
98106 set_pte(&kasan_early_shadow_pte[i],
99107 mk_pte(virt_to_page(kasan_early_shadow_page),
100− __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_ACCESSED)));
108+ __pgprot(_PAGE_PRESENT | _PAGE_READ |
109+ _PAGE_ACCESSED)));
101110
102111 memset(kasan_early_shadow_page, 0, PAGE_SIZE);
103112 init_task.kasan_depth = 0;
arch/s390/include/asm/pgtable.h+6−0
@@ -752,6 +752,12 @@ static inline int pmd_write(pmd_t pmd) · 751 unmodified lines
752752 return (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) != 0;
753753 }
754754
755+#define pud_write pud_write
756+static inline int pud_write(pud_t pud)
757+{
758+ return (pud_val(pud) & _REGION3_ENTRY_WRITE) != 0;
759+}
760+
755761 static inline int pmd_dirty(pmd_t pmd)
756762 {
757763 return (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0;
arch/s390/kvm/kvm-s390.c+17−1
@@ -3268,7 +3268,10 @@ static void kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu) · 3267 unmodified lines
32683268 /* Initial reset is a superset of the normal reset */
32693269 kvm_arch_vcpu_ioctl_normal_reset(vcpu);
32703270
3271− /* this equals initial cpu reset in pop, but we don't switch to ESA */
3271+ /*
3272+ * This equals initial cpu reset in pop, but we don't switch to ESA.
3273+ * We do not only reset the internal data, but also ...
3274+ */
32723275 vcpu->arch.sie_block->gpsw.mask = 0;
32733276 vcpu->arch.sie_block->gpsw.addr = 0;
32743277 kvm_s390_set_prefix(vcpu, 0);
@@ -3278,6 +3281,19 @@ static void kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu) · 3 unmodified lines
32783281 memset(vcpu->arch.sie_block->gcr, 0, sizeof(vcpu->arch.sie_block->gcr));
32793282 vcpu->arch.sie_block->gcr[0] = CR0_INITIAL_MASK;
32803283 vcpu->arch.sie_block->gcr[14] = CR14_INITIAL_MASK;
3284+
3285+ /* ... the data in sync regs */
3286+ memset(vcpu->run->s.regs.crs, 0, sizeof(vcpu->run->s.regs.crs));
3287+ vcpu->run->s.regs.ckc = 0;
3288+ vcpu->run->s.regs.crs[0] = CR0_INITIAL_MASK;
3289+ vcpu->run->s.regs.crs[14] = CR14_INITIAL_MASK;
3290+ vcpu->run->psw_addr = 0;
3291+ vcpu->run->psw_mask = 0;
3292+ vcpu->run->s.regs.todpr = 0;
3293+ vcpu->run->s.regs.cputm = 0;
3294+ vcpu->run->s.regs.ckc = 0;
3295+ vcpu->run->s.regs.pp = 0;
3296+ vcpu->run->s.regs.gbea = 1;
32813297 vcpu->run->s.regs.fpc = 0;
32823298 vcpu->arch.sie_block->gbea = 1;
32833299 vcpu->arch.sie_block->pp = 0;
arch/s390/pci/pci.c+2−2
@@ -424,7 +424,7 @@ static void zpci_map_resources(struct pci_dev *pdev) · 423 unmodified lines
424424
425425 if (zpci_use_mio(zdev))
426426 pdev->resource[i].start =
427− (resource_size_t __force) zdev->bars[i].mio_wb;
427+ (resource_size_t __force) zdev->bars[i].mio_wt;
428428 else
429429 pdev->resource[i].start = (resource_size_t __force)
430430 pci_iomap_range_fh(pdev, i, 0, 0);
@@ -531,7 +531,7 @@ static int zpci_setup_bus_resources(struct zpci_dev *zdev, · 100 unmodified lines
531531 flags |= IORESOURCE_MEM_64;
532532
533533 if (zpci_use_mio(zdev))
534− addr = (unsigned long) zdev->bars[i].mio_wb;
534+ addr = (unsigned long) zdev->bars[i].mio_wt;
535535 else
536536 addr = ZPCI_ADDR(entry);
537537 size = 1UL << zdev->bars[i].size;
arch/x86/Makefile+3−2
@@ -194,9 +194,10 @@ avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) · 193 unmodified lines
194194 avx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1)
195195 sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI=1)
196196 sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1)
197+adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1)
197198
198−KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
199−KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
199+KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr)
200+KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr)
200201
201202 KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
202203
arch/x86/crypto/Makefile+6−1
@@ -11,6 +11,7 @@ avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\ · 10 unmodified lines
1111 avx512_supported :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,yes,no)
1212 sha1_ni_supported :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,yes,no)
1313 sha256_ni_supported :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,yes,no)
14+adx_supported := $(call as-instr,adox %r10$(comma)%r10,yes,no)
1415
1516 obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o
1617
@@ -39,7 +40,11 @@ obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o · 22 unmodified lines
3940
4041 obj-$(CONFIG_CRYPTO_NHPOLY1305_SSE2) += nhpoly1305-sse2.o
4142 obj-$(CONFIG_CRYPTO_NHPOLY1305_AVX2) += nhpoly1305-avx2.o
42−obj-$(CONFIG_CRYPTO_CURVE25519_X86) += curve25519-x86_64.o
43+
44+# These modules require the assembler to support ADX.
45+ifeq ($(adx_supported),yes)
46+ obj-$(CONFIG_CRYPTO_CURVE25519_X86) += curve25519-x86_64.o
47+endif
4348
4449 # These modules require assembler to support AVX.
4550 ifeq ($(avx_supported),yes)
arch/x86/events/amd/uncore.c+7−10
@@ -190,15 +190,12 @@ static int amd_uncore_event_init(struct perf_event *event) · 189 unmodified lines
190190
191191 /*
192192 * NB and Last level cache counters (MSRs) are shared across all cores
193− * that share the same NB / Last level cache. Interrupts can be directed
194− * to a single target core, however, event counts generated by processes
195− * running on other cores cannot be masked out. So we do not support
196− * sampling and per-thread events.
193+ * that share the same NB / Last level cache. On family 16h and below,
194+ * Interrupts can be directed to a single target core, however, event
195+ * counts generated by processes running on other cores cannot be masked
196+ * out. So we do not support sampling and per-thread events via
197+ * CAP_NO_INTERRUPT, and we do not enable counter overflow interrupts:
197198 */
198− if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
199− return -EINVAL;
200−
201− /* and we do not enable counter overflow interrupts */
202199 hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;
203200 hwc->idx = -1;
204201
@@ -306,7 +303,7 @@ static struct pmu amd_nb_pmu = { · 101 unmodified lines
306303 .start = amd_uncore_start,
307304 .stop = amd_uncore_stop,
308305 .read = amd_uncore_read,
309− .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
306+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT,
310307 };
311308
312309 static struct pmu amd_llc_pmu = {
@@ -317,7 +314,7 @@ static struct pmu amd_llc_pmu = { · 4 unmodified lines
317314 .start = amd_uncore_start,
318315 .stop = amd_uncore_stop,
319316 .read = amd_uncore_read,
320− .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
317+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT,
321318 };
322319
323320 static struct amd_uncore *amd_uncore_alloc(unsigned int cpu)
arch/x86/include/asm/io_bitmap.h+8−1
@@ -19,7 +19,14 @@ struct task_struct; · 18 unmodified lines
1919 void io_bitmap_share(struct task_struct *tsk);
2020 void io_bitmap_exit(void);
2121
22−void tss_update_io_bitmap(void);
22+void native_tss_update_io_bitmap(void);
23+
24+#ifdef CONFIG_PARAVIRT_XXL
25+#include <asm/paravirt.h>
26+#else
27+#define tss_update_io_bitmap native_tss_update_io_bitmap
28+#endif
29+
2330 #else
2431 static inline void io_bitmap_share(struct task_struct *tsk) { }
2532 static inline void io_bitmap_exit(void) { }
arch/x86/include/asm/kvm_emulate.h+12−2
@@ -292,6 +292,14 @@ enum x86emul_mode { · 291 unmodified lines
292292 #define X86EMUL_SMM_MASK (1 << 6)
293293 #define X86EMUL_SMM_INSIDE_NMI_MASK (1 << 7)
294294
295+/*
296+ * fastop functions are declared as taking a never-defined fastop parameter,
297+ * so they can't be called from C directly.
298+ */
299+struct fastop;
300+
301+typedef void (*fastop_t)(struct fastop *);
302+
295303 struct x86_emulate_ctxt {
296304 const struct x86_emulate_ops *ops;
297305
@@ -324,7 +332,10 @@ struct x86_emulate_ctxt { · 26 unmodified lines
324332 struct operand src;
325333 struct operand src2;
326334 struct operand dst;
327− int (*execute)(struct x86_emulate_ctxt *ctxt);
335+ union {
336+ int (*execute)(struct x86_emulate_ctxt *ctxt);
337+ fastop_t fop;
338+ };
328339 int (*check_perm)(struct x86_emulate_ctxt *ctxt);
329340 /*
330341 * The following six fields are cleared together,
@@ -349,7 +360,6 @@ struct x86_emulate_ctxt { · 18 unmodified lines
349360 u64 d;
350361 unsigned long _eip;
351362 struct operand memop;
352− /* Fields above regs are cleared together. */
353363 unsigned long _regs[NR_VCPU_REGS];
354364 struct operand *memopp;
355365 struct fetch_cache fetch;
arch/x86/include/asm/kvm_host.h+2−1
@@ -1122,6 +1122,7 @@ struct kvm_x86_ops { · 1121 unmodified lines
11221122 int (*handle_exit)(struct kvm_vcpu *vcpu,
11231123 enum exit_fastpath_completion exit_fastpath);
11241124 int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);
1125+ void (*update_emulated_instruction)(struct kvm_vcpu *vcpu);
11251126 void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
11261127 u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu);
11271128 void (*patch_hypercall)(struct kvm_vcpu *vcpu,
@@ -1146,7 +1147,7 @@ struct kvm_x86_ops { · 18 unmodified lines
11461147 void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
11471148 void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);
11481149 void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu, hpa_t hpa);
1149− void (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
1150+ int (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
11501151 int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);
11511152 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
11521153 int (*set_identity_map_addr)(struct kvm *kvm, u64 ident_addr);
arch/x86/include/asm/paravirt.h+7−0
@@ -295,6 +295,13 @@ static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) · 294 unmodified lines
295295 PVOP_VCALL3(cpu.write_idt_entry, dt, entry, g);
296296 }
297297
298+#ifdef CONFIG_X86_IOPL_IOPERM
299+static inline void tss_update_io_bitmap(void)
300+{
301+ PVOP_VCALL0(cpu.update_io_bitmap);
302+}
303+#endif
304+
298305 static inline void paravirt_activate_mm(struct mm_struct *prev,
299306 struct mm_struct *next)
300307 {
arch/x86/include/asm/paravirt_types.h+4−0
@@ -140,6 +140,10 @@ struct pv_cpu_ops { · 139 unmodified lines
140140
141141 void (*load_sp0)(unsigned long sp0);
142142
143+#ifdef CONFIG_X86_IOPL_IOPERM
144+ void (*update_io_bitmap)(void);
145+#endif
146+
143147 void (*wbinvd)(void);
144148
145149 /* cpuid emulation, mostly so that caps bits can be disabled */
arch/x86/include/asm/vmx.h+1−1
@@ -72,7 +72,7 @@ · 71 unmodified lines
7272 #define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC)
7373 #define SECONDARY_EXEC_PT_USE_GPA VMCS_CONTROL_BIT(PT_USE_GPA)
7474 #define SECONDARY_EXEC_TSC_SCALING VMCS_CONTROL_BIT(TSC_SCALING)
75−#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE 0x04000000
75+#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE VMCS_CONTROL_BIT(USR_WAIT_PAUSE)
7676
7777 #define PIN_BASED_EXT_INTR_MASK VMCS_CONTROL_BIT(INTR_EXITING)
7878 #define PIN_BASED_NMI_EXITING VMCS_CONTROL_BIT(NMI_EXITING)
arch/x86/include/asm/vmxfeatures.h+1−0
@@ -81,6 +81,7 @@ · 80 unmodified lines
8181 #define VMX_FEATURE_MODE_BASED_EPT_EXEC ( 2*32+ 22) /* "ept_mode_based_exec" Enable separate EPT EXEC bits for supervisor vs. user */
8282 #define VMX_FEATURE_PT_USE_GPA ( 2*32+ 24) /* "" Processor Trace logs GPAs */
8383 #define VMX_FEATURE_TSC_SCALING ( 2*32+ 25) /* Scale hardware TSC when read in guest */
84+#define VMX_FEATURE_USR_WAIT_PAUSE ( 2*32+ 26) /* Enable TPAUSE, UMONITOR, UMWAIT in guest */
8485 #define VMX_FEATURE_ENCLV_EXITING ( 2*32+ 28) /* "" VM-Exit on ENCLV (leaf dependent) */
8586
8687 #endif /* _ASM_X86_VMXFEATURES_H */
arch/x86/include/uapi/asm/kvm.h+1−0
@@ -390,6 +390,7 @@ struct kvm_sync_regs { · 389 unmodified lines
390390 #define KVM_STATE_NESTED_GUEST_MODE 0x00000001
391391 #define KVM_STATE_NESTED_RUN_PENDING 0x00000002
392392 #define KVM_STATE_NESTED_EVMCS 0x00000004
393+#define KVM_STATE_NESTED_MTF_PENDING 0x00000008
393394
394395 #define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
395396 #define KVM_STATE_NESTED_SMM_VMXON 0x00000002
arch/x86/kernel/apic/vector.c+8−6
@@ -838,13 +838,15 @@ static void free_moved_vector(struct apic_chip_data *apicd) · 837 unmodified lines
838838 bool managed = apicd->is_managed;
839839
840840 /*
841− * This should never happen. Managed interrupts are not
842− * migrated except on CPU down, which does not involve the
843− * cleanup vector. But try to keep the accounting correct
844− * nevertheless.
841+ * Managed interrupts are usually not migrated away
842+ * from an online CPU, but CPU isolation 'managed_irq'
843+ * can make that happen.
844+ * 1) Activation does not take the isolation into account
845+ * to keep the code simple
846+ * 2) Migration away from an isolated CPU can happen when
847+ * a non-isolated CPU which is in the calculated
848+ * affinity mask comes online.
845849 */
846− WARN_ON_ONCE(managed);
847−
848850 trace_vector_free_moved(apicd->irq, cpu, vector, managed);
849851 irq_matrix_free(vector_matrix, cpu, vector, managed);
850852 per_cpu(vector_irq, cpu)[vector] = VECTOR_UNUSED;
arch/x86/kernel/cpu/common.c+1−1
@@ -445,7 +445,7 @@ static __always_inline void setup_pku(struct cpuinfo_x86 *c) · 444 unmodified lines
445445 * cpuid bit to be set. We need to ensure that we
446446 * update that bit in this CPU's "cpu_info".
447447 */
448− get_cpu_cap(c);
448+ set_cpu_cap(c, X86_FEATURE_OSPKE);
449449 }
450450
451451 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
arch/x86/kernel/cpu/mce/intel.c+5−4
@@ -493,17 +493,18 @@ static void intel_ppin_init(struct cpuinfo_x86 *c) · 492 unmodified lines
493493 return;
494494
495495 if ((val & 3UL) == 1UL) {
496− /* PPIN available but disabled: */
496+ /* PPIN locked in disabled mode */
497497 return;
498498 }
499499
500− /* If PPIN is disabled, but not locked, try to enable: */
501− if (!(val & 3UL)) {
500+ /* If PPIN is disabled, try to enable */
501+ if (!(val & 2UL)) {
502502 wrmsrl_safe(MSR_PPIN_CTL, val | 2UL);
503503 rdmsrl_safe(MSR_PPIN_CTL, &val);
504504 }
505505
506− if ((val & 3UL) == 2UL)
506+ /* Is the enable bit set? */
507+ if (val & 2UL)
507508 set_cpu_cap(c, X86_FEATURE_INTEL_PPIN);
508509 }
509510 }
arch/x86/kernel/cpu/mce/therm_throt.c+7−2
@@ -486,9 +486,14 @@ static int thermal_throttle_offline(unsigned int cpu) · 485 unmodified lines
486486 {
487487 struct thermal_state *state = &per_cpu(thermal_state, cpu);
488488 struct device *dev = get_cpu_device(cpu);
489+ u32 l;
490+
491+ /* Mask the thermal vector before draining evtl. pending work */
492+ l = apic_read(APIC_LVTTHMR);
493+ apic_write(APIC_LVTTHMR, l | APIC_LVT_MASKED);
489494
490− cancel_delayed_work(&state->package_throttle.therm_work);
491− cancel_delayed_work(&state->core_throttle.therm_work);
495+ cancel_delayed_work_sync(&state->package_throttle.therm_work);
496+ cancel_delayed_work_sync(&state->core_throttle.therm_work);
492497
493498 state->package_throttle.rate_control_active = false;
494499 state->core_throttle.rate_control_active = false;
arch/x86/kernel/kvm.c+44−21
@@ -425,7 +425,29 @@ static void __init sev_map_percpu_data(void) · 424 unmodified lines
425425 }
426426 }
427427
428+static bool pv_tlb_flush_supported(void)
429+{
430+ return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
431+ !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
432+ kvm_para_has_feature(KVM_FEATURE_STEAL_TIME));
433+}
434+
435+static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask);
436+
428437 #ifdef CONFIG_SMP
438+
439+static bool pv_ipi_supported(void)
440+{
441+ return kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI);
442+}
443+
444+static bool pv_sched_yield_supported(void)
445+{
446+ return (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
447+ !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
448+ kvm_para_has_feature(KVM_FEATURE_STEAL_TIME));
449+}
450+
429451 #define KVM_IPI_CLUSTER_SIZE (2 * BITS_PER_LONG)
430452
431453 static void __send_ipi_mask(const struct cpumask *mask, int vector)
@@ -490,12 +512,12 @@ static void kvm_send_ipi_mask(const struct cpumask *mask, int vector) · 58 unmodified lines
490512 static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector)
491513 {
492514 unsigned int this_cpu = smp_processor_id();
493− struct cpumask new_mask;
515+ struct cpumask *new_mask = this_cpu_cpumask_var_ptr(__pv_cpu_mask);
494516 const struct cpumask *local_mask;
495517
496− cpumask_copy(&new_mask, mask);
497− cpumask_clear_cpu(this_cpu, &new_mask);
498− local_mask = &new_mask;
518+ cpumask_copy(new_mask, mask);
519+ cpumask_clear_cpu(this_cpu, new_mask);
520+ local_mask = new_mask;
499521 __send_ipi_mask(local_mask, vector);
500522 }
501523
@@ -575,7 +597,6 @@ static void __init kvm_apf_trap_init(void) · 73 unmodified lines
575597 update_intr_gate(X86_TRAP_PF, async_page_fault);
576598 }
577599
578−static DEFINE_PER_CPU(cpumask_var_t, __pv_tlb_mask);
579600
580601 static void kvm_flush_tlb_others(const struct cpumask *cpumask,
581602 const struct flush_tlb_info *info)
@@ -583,7 +604,7 @@ static void kvm_flush_tlb_others(const struct cpumask *cpumask, · 1 unmodified line
583604 u8 state;
584605 int cpu;
585606 struct kvm_steal_time *src;
586− struct cpumask *flushmask = this_cpu_cpumask_var_ptr(__pv_tlb_mask);
607+ struct cpumask *flushmask = this_cpu_cpumask_var_ptr(__pv_cpu_mask);
587608
588609 cpumask_copy(flushmask, cpumask);
589610 /*
@@ -619,11 +640,10 @@ static void __init kvm_guest_init(void) · 29 unmodified lines
619640 pv_ops.time.steal_clock = kvm_steal_clock;
620641 }
621642
622− if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
623− !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
624− kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
643+ if (pv_tlb_flush_supported()) {
625644 pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
626645 pv_ops.mmu.tlb_remove_table = tlb_remove_table;
646+ pr_info("KVM setup pv remote TLB flush\n");
627647 }
628648
629649 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
@@ -632,9 +652,7 @@ static void __init kvm_guest_init(void) · 2 unmodified lines
632652 #ifdef CONFIG_SMP
633653 smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus;
634654 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;
635− if (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
636− !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
637− kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
655+ if (pv_sched_yield_supported()) {
638656 smp_ops.send_call_func_ipi = kvm_smp_send_call_func_ipi;
639657 pr_info("KVM setup pv sched yield\n");
640658 }
@@ -700,7 +718,7 @@ static uint32_t __init kvm_detect(void) · 59 unmodified lines
700718 static void __init kvm_apic_init(void)
701719 {
702720 #if defined(CONFIG_SMP)
703− if (kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI))
721+ if (pv_ipi_supported())
704722 kvm_setup_pv_ipi();
705723 #endif
706724 }
@@ -732,26 +750,31 @@ static __init int activate_jump_labels(void) · 25 unmodified lines
732750 }
733751 arch_initcall(activate_jump_labels);
734752
735−static __init int kvm_setup_pv_tlb_flush(void)
753+static __init int kvm_alloc_cpumask(void)
736754 {
737755 int cpu;
756+ bool alloc = false;
738757
739758 if (!kvm_para_available() || nopv)
740759 return 0;
741760
742− if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
743− !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
744− kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
761+ if (pv_tlb_flush_supported())
762+ alloc = true;
763+
764+#if defined(CONFIG_SMP)
765+ if (pv_ipi_supported())
766+ alloc = true;
767+#endif
768+
769+ if (alloc)
745770 for_each_possible_cpu(cpu) {
746− zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu),
771+ zalloc_cpumask_var_node(per_cpu_ptr(&__pv_cpu_mask, cpu),
747772 GFP_KERNEL, cpu_to_node(cpu));
748773 }
749− pr_info("KVM setup pv remote TLB flush\n");
750− }
751774
752775 return 0;
753776 }
754−arch_initcall(kvm_setup_pv_tlb_flush);
777+arch_initcall(kvm_alloc_cpumask);
755778
756779 #ifdef CONFIG_PARAVIRT_SPINLOCKS
757780
arch/x86/kernel/paravirt.c+5−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <asm/timer.h>
3131 #include <asm/special_insns.h>
3232 #include <asm/tlb.h>
33+#include <asm/io_bitmap.h>
3334
3435 /*
3536 * nop stub, which must not clobber anything *including the stack* to
@@ -341,6 +342,10 @@ struct paravirt_patch_template pv_ops = { · 305 unmodified lines
341342 .cpu.iret = native_iret,
342343 .cpu.swapgs = native_swapgs,
343344
345+#ifdef CONFIG_X86_IOPL_IOPERM
346+ .cpu.update_io_bitmap = native_tss_update_io_bitmap,
347+#endif
348+
344349 .cpu.start_context_switch = paravirt_nop,
345350 .cpu.end_context_switch = paravirt_nop,
346351
arch/x86/kernel/process.c+1−1
@@ -374,7 +374,7 @@ static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm) · 373 unmodified lines
374374 /**
375375 * tss_update_io_bitmap - Update I/O bitmap before exiting to usermode
376376 */
377−void tss_update_io_bitmap(void)
377+void native_tss_update_io_bitmap(void)
378378 {
379379 struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw);
380380 struct thread_struct *t = &current->thread;
arch/x86/kvm/Kconfig+13−0
@@ -59,6 +59,19 @@ config KVM · 58 unmodified lines
5959
6060 If unsure, say N.
6161
62+config KVM_WERROR
63+ bool "Compile KVM with -Werror"
64+ # KASAN may cause the build to fail due to larger frames
65+ default y if X86_64 && !KASAN
66+ # We use the dependency on !COMPILE_TEST to not be enabled
67+ # blindly in allmodconfig or allyesconfig configurations
68+ depends on (X86_64 && !KASAN) || !COMPILE_TEST
69+ depends on EXPERT
70+ help
71+ Add -Werror to the build flags for KVM.
72+
73+ If in doubt, say "N".
74+
6275 config KVM_INTEL
6376 tristate "KVM for Intel (and compatible) processors support"
6477 depends on KVM && IA32_FEAT_CTL
arch/x86/kvm/Makefile+1−0
@@ -1,6 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
22
33 ccflags-y += -Iarch/x86/kvm
4+ccflags-$(CONFIG_KVM_WERROR) += -Werror
45
56 KVM := ../../../virt/kvm
67
arch/x86/kvm/emulate.c+15−22
@@ -191,25 +191,6 @@ · 190 unmodified lines
191191 #define NR_FASTOP (ilog2(sizeof(ulong)) + 1)
192192 #define FASTOP_SIZE 8
193193
194−/*
195− * fastop functions have a special calling convention:
196− *
197− * dst: rax (in/out)
198− * src: rdx (in/out)
199− * src2: rcx (in)
200− * flags: rflags (in/out)
201− * ex: rsi (in:fastop pointer, out:zero if exception)
202− *
203− * Moreover, they are all exactly FASTOP_SIZE bytes long, so functions for
204− * different operand sizes can be reached by calculation, rather than a jump
205− * table (which would be bigger than the code).
206− *
207− * fastop functions are declared as taking a never-defined fastop parameter,
208− * so they can't be called from C directly.
209− */
210−
211−struct fastop;
212−
213194 struct opcode {
214195 u64 flags : 56;
215196 u64 intercept : 8;
@@ -311,8 +292,19 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) · 95 unmodified lines
311292 #define ON64(x)
312293 #endif
313294
314−typedef void (*fastop_t)(struct fastop *);
315−
295+/*
296+ * fastop functions have a special calling convention:
297+ *
298+ * dst: rax (in/out)
299+ * src: rdx (in/out)
300+ * src2: rcx (in)
301+ * flags: rflags (in/out)
302+ * ex: rsi (in:fastop pointer, out:zero if exception)
303+ *
304+ * Moreover, they are all exactly FASTOP_SIZE bytes long, so functions for
305+ * different operand sizes can be reached by calculation, rather than a jump
306+ * table (which would be bigger than the code).
307+ */
316308 static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
317309
318310 #define __FOP_FUNC(name) \
@@ -5181,6 +5173,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) · 4862 unmodified lines
51815173 ctxt->fetch.ptr = ctxt->fetch.data;
51825174 ctxt->fetch.end = ctxt->fetch.data + insn_len;
51835175 ctxt->opcode_len = 1;
5176+ ctxt->intercept = x86_intercept_none;
51845177 if (insn_len > 0)
51855178 memcpy(ctxt->fetch.data, insn, insn_len);
51865179 else {
@@ -5683,7 +5676,7 @@ special_insn: · 496 unmodified lines
56835676
56845677 if (ctxt->execute) {
56855678 if (ctxt->d & Fastop)
5686− rc = fastop(ctxt, (fastop_t)ctxt->execute);
5679+ rc = fastop(ctxt, ctxt->fop);
56875680 else
56885681 rc = ctxt->execute(ctxt);
56895682 if (rc != X86EMUL_CONTINUE)
arch/x86/kvm/ioapic.c+5−2
@@ -378,12 +378,15 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) · 377 unmodified lines
378378 if (e->fields.delivery_mode == APIC_DM_FIXED) {
379379 struct kvm_lapic_irq irq;
380380
381− irq.shorthand = APIC_DEST_NOSHORT;
382381 irq.vector = e->fields.vector;
383382 irq.delivery_mode = e->fields.delivery_mode << 8;
384− irq.dest_id = e->fields.dest_id;
385383 irq.dest_mode =
386384 kvm_lapic_irq_dest_mode(!!e->fields.dest_mode);
385+ irq.level = false;
386+ irq.trig_mode = e->fields.trig_mode;
387+ irq.shorthand = APIC_DEST_NOSHORT;
388+ irq.dest_id = e->fields.dest_id;
389+ irq.msi_redir_hint = false;
387390 bitmap_zero(&vcpu_bitmap, 16);
388391 kvm_bitmap_or_dest_vcpus(ioapic->kvm, &irq,
389392 &vcpu_bitmap);
arch/x86/kvm/irq_comm.c+1−1
@@ -417,7 +417,7 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, · 416 unmodified lines
417417
418418 kvm_set_msi_irq(vcpu->kvm, entry, &irq);
419419
420− if (irq.level &&
420+ if (irq.trig_mode &&
421421 kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,
422422 irq.dest_id, irq.dest_mode))
423423 __set_bit(irq.vector, ioapic_handled_vectors);
arch/x86/kvm/lapic.c+4−5
@@ -627,9 +627,11 @@ static inline bool pv_eoi_enabled(struct kvm_vcpu *vcpu) · 626 unmodified lines
627627 static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu)
628628 {
629629 u8 val;
630− if (pv_eoi_get_user(vcpu, &val) < 0)
630+ if (pv_eoi_get_user(vcpu, &val) < 0) {
631631 printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n",
632632 (unsigned long long)vcpu->arch.pv_eoi.msr_val);
633+ return false;
634+ }
633635 return val & 0x1;
634636 }
635637
@@ -1046,11 +1048,8 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 410 unmodified lines
10461048 apic->regs + APIC_TMR);
10471049 }
10481050
1049− if (vcpu->arch.apicv_active)
1050− kvm_x86_ops->deliver_posted_interrupt(vcpu, vector);
1051− else {
1051+ if (kvm_x86_ops->deliver_posted_interrupt(vcpu, vector)) {
10521052 kvm_lapic_set_irr(vector, apic);
1053−
10541053 kvm_make_request(KVM_REQ_EVENT, vcpu);
10551054 kvm_vcpu_kick(vcpu);
10561055 }
arch/x86/kvm/mmutrace.h+1−1
@@ -339,7 +339,7 @@ TRACE_EVENT( · 338 unmodified lines
339339 /* These depend on page entry type, so compute them now. */
340340 __field(bool, r)
341341 __field(bool, x)
342− __field(u8, u)
342+ __field(signed char, u)
343343 ),
344344
345345 TP_fast_assign(
arch/x86/kvm/svm.c+42−31
@@ -57,11 +57,13 @@ · 56 unmodified lines
5757 MODULE_AUTHOR("Qumranet");
5858 MODULE_LICENSE("GPL");
5959
60+#ifdef MODULE
6061 static const struct x86_cpu_id svm_cpu_id[] = {
6162 X86_FEATURE_MATCH(X86_FEATURE_SVM),
6263 {}
6364 };
6465 MODULE_DEVICE_TABLE(x86cpu, svm_cpu_id);
66+#endif
6567
6668 #define IOPM_ALLOC_ORDER 2
6769 #define MSRPM_ALLOC_ORDER 1
@@ -1005,33 +1007,32 @@ static void svm_cpu_uninit(int cpu) · 937 unmodified lines
10051007 static int svm_cpu_init(int cpu)
10061008 {
10071009 struct svm_cpu_data *sd;
1008− int r;
10091010
10101011 sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL);
10111012 if (!sd)
10121013 return -ENOMEM;
10131014 sd->cpu = cpu;
1014− r = -ENOMEM;
10151015 sd->save_area = alloc_page(GFP_KERNEL);
10161016 if (!sd->save_area)
1017− goto err_1;
1017+ goto free_cpu_data;
10181018
10191019 if (svm_sev_enabled()) {
1020− r = -ENOMEM;
10211020 sd->sev_vmcbs = kmalloc_array(max_sev_asid + 1,
10221021 sizeof(void *),
10231022 GFP_KERNEL);
10241023 if (!sd->sev_vmcbs)
1025− goto err_1;
1024+ goto free_save_area;
10261025 }
10271026
10281027 per_cpu(svm_data, cpu) = sd;
10291028
10301029 return 0;
10311030
1032−err_1:
1031+free_save_area:
1032+ __free_page(sd->save_area);
1033+free_cpu_data:
10331034 kfree(sd);
1034− return r;
1035+ return -ENOMEM;
10351036
10361037 }
10371038
@@ -1350,6 +1351,24 @@ static __init void svm_adjust_mmio_mask(void) · 312 unmodified lines
13501351 kvm_mmu_set_mmio_spte_mask(mask, mask, PT_WRITABLE_MASK | PT_USER_MASK);
13511352 }
13521353
1354+static void svm_hardware_teardown(void)
1355+{
1356+ int cpu;
1357+
1358+ if (svm_sev_enabled()) {
1359+ bitmap_free(sev_asid_bitmap);
1360+ bitmap_free(sev_reclaim_asid_bitmap);
1361+
1362+ sev_flush_asids();
1363+ }
1364+
1365+ for_each_possible_cpu(cpu)
1366+ svm_cpu_uninit(cpu);
1367+
1368+ __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
1369+ iopm_base = 0;
1370+}
1371+
13531372 static __init int svm_hardware_setup(void)
13541373 {
13551374 int cpu;
@@ -1463,29 +1482,10 @@ static __init int svm_hardware_setup(void) · 107 unmodified lines
14631482 return 0;
14641483
14651484 err:
1466− __free_pages(iopm_pages, IOPM_ALLOC_ORDER);
1467− iopm_base = 0;
1485+ svm_hardware_teardown();
14681486 return r;
14691487 }
14701488
1471−static __exit void svm_hardware_unsetup(void)
1472−{
1473− int cpu;
1474−
1475− if (svm_sev_enabled()) {
1476− bitmap_free(sev_asid_bitmap);
1477− bitmap_free(sev_reclaim_asid_bitmap);
1478−
1479− sev_flush_asids();
1480− }
1481−
1482− for_each_possible_cpu(cpu)
1483− svm_cpu_uninit(cpu);
1484−
1485− __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
1486− iopm_base = 0;
1487−}
1488−
14891489 static void init_seg(struct vmcb_seg *seg)
14901490 {
14911491 seg->selector = 0;
@@ -2196,8 +2196,9 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 704 unmodified lines
21962196 static int avic_init_vcpu(struct vcpu_svm *svm)
21972197 {
21982198 int ret;
2199+ struct kvm_vcpu *vcpu = &svm->vcpu;
21992200
2200− if (!kvm_vcpu_apicv_active(&svm->vcpu))
2201+ if (!avic || !irqchip_in_kernel(vcpu->kvm))
22012202 return 0;
22022203
22032204 ret = avic_init_backing_page(&svm->vcpu);
@@ -5232,6 +5233,9 @@ static void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) · 3028 unmodified lines
52325233 struct vmcb *vmcb = svm->vmcb;
52335234 bool activated = kvm_vcpu_apicv_active(vcpu);
52345235
5236+ if (!avic)
5237+ return;
5238+
52355239 if (activated) {
52365240 /**
52375241 * During AVIC temporary deactivation, guest could update
@@ -5255,8 +5259,11 @@ static void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) · 17 unmodified lines
52555259 return;
52565260 }
52575261
5258−static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
5262+static int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
52595263 {
5264+ if (!vcpu->arch.apicv_active)
5265+ return -1;
5266+
52605267 kvm_lapic_set_irr(vec, vcpu->arch.apic);
52615268 smp_mb__after_atomic();
52625269
@@ -5268,6 +5275,8 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) · 5 unmodified lines
52685275 put_cpu();
52695276 } else
52705277 kvm_vcpu_wake_up(vcpu);
5278+
5279+ return 0;
52715280 }
52725281
52735282 static bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
@@ -6303,7 +6312,8 @@ static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu, · 1029 unmodified lines
63036312 enum exit_fastpath_completion *exit_fastpath)
63046313 {
63056314 if (!is_guest_mode(vcpu) &&
6306− to_svm(vcpu)->vmcb->control.exit_code == EXIT_REASON_MSR_WRITE)
6315+ to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
6316+ to_svm(vcpu)->vmcb->control.exit_info_1)
63076317 *exit_fastpath = handle_fastpath_set_msr_irqoff(vcpu);
63086318 }
63096319
@@ -7378,7 +7388,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 1068 unmodified lines
73787388 .cpu_has_kvm_support = has_svm,
73797389 .disabled_by_bios = is_disabled,
73807390 .hardware_setup = svm_hardware_setup,
7381− .hardware_unsetup = svm_hardware_unsetup,
7391+ .hardware_unsetup = svm_hardware_teardown,
73827392 .check_processor_compatibility = svm_check_processor_compat,
73837393 .hardware_enable = svm_hardware_enable,
73847394 .hardware_disable = svm_hardware_disable,
@@ -7433,6 +7443,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 48 unmodified lines
74337443 .run = svm_vcpu_run,
74347444 .handle_exit = handle_exit,
74357445 .skip_emulated_instruction = skip_emulated_instruction,
7446+ .update_emulated_instruction = NULL,
74367447 .set_interrupt_shadow = svm_set_interrupt_shadow,
74377448 .get_interrupt_shadow = svm_get_interrupt_shadow,
74387449 .patch_hypercall = svm_patch_hypercall,
arch/x86/kvm/vmx/capabilities.h+1−0
@@ -12,6 +12,7 @@ extern bool __read_mostly enable_ept; · 11 unmodified lines
1212 extern bool __read_mostly enable_unrestricted_guest;
1313 extern bool __read_mostly enable_ept_ad_bits;
1414 extern bool __read_mostly enable_pml;
15+extern bool __read_mostly enable_apicv;
1516 extern int __read_mostly pt_mode;
1617
1718 #define PT_MODE_SYSTEM 0
arch/x86/kvm/vmx/nested.c+69−25
@@ -224,7 +224,7 @@ static inline void nested_release_evmcs(struct kvm_vcpu *vcpu) · 223 unmodified lines
224224 return;
225225
226226 kvm_vcpu_unmap(vcpu, &vmx->nested.hv_evmcs_map, true);
227− vmx->nested.hv_evmcs_vmptr = -1ull;
227+ vmx->nested.hv_evmcs_vmptr = 0;
228228 vmx->nested.hv_evmcs = NULL;
229229 }
230230
@@ -1923,7 +1923,8 @@ static int nested_vmx_handle_enlightened_vmptrld(struct kvm_vcpu *vcpu, · 1692 unmodified lines
19231923 if (!nested_enlightened_vmentry(vcpu, &evmcs_gpa))
19241924 return 1;
19251925
1926− if (unlikely(evmcs_gpa != vmx->nested.hv_evmcs_vmptr)) {
1926+ if (unlikely(!vmx->nested.hv_evmcs ||
1927+ evmcs_gpa != vmx->nested.hv_evmcs_vmptr)) {
19271928 if (!vmx->nested.hv_evmcs)
19281929 vmx->nested.current_vmptr = -1ull;
19291930
@@ -3161,10 +3162,10 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, · 1231 unmodified lines
31613162 * or KVM_SET_NESTED_STATE). Otherwise it's called from vmlaunch/vmresume.
31623163 *
31633164 * Returns:
3164− * NVMX_ENTRY_SUCCESS: Entered VMX non-root mode
3165− * NVMX_ENTRY_VMFAIL: Consistency check VMFail
3166− * NVMX_ENTRY_VMEXIT: Consistency check VMExit
3167− * NVMX_ENTRY_KVM_INTERNAL_ERROR: KVM internal error
3165+ * NVMX_VMENTRY_SUCCESS: Entered VMX non-root mode
3166+ * NVMX_VMENTRY_VMFAIL: Consistency check VMFail
3167+ * NVMX_VMENTRY_VMEXIT: Consistency check VMExit
3168+ * NVMX_VMENTRY_KVM_INTERNAL_ERROR: KVM internal error
31683169 */
31693170 enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
31703171 bool from_vmentry)
@@ -3609,8 +3610,15 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) · 438 unmodified lines
36093610 unsigned long exit_qual;
36103611 bool block_nested_events =
36113612 vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);
3613+ bool mtf_pending = vmx->nested.mtf_pending;
36123614 struct kvm_lapic *apic = vcpu->arch.apic;
36133615
3616+ /*
3617+ * Clear the MTF state. If a higher priority VM-exit is delivered first,
3618+ * this state is discarded.
3619+ */
3620+ vmx->nested.mtf_pending = false;
3621+
36143622 if (lapic_in_kernel(vcpu) &&
36153623 test_bit(KVM_APIC_INIT, &apic->pending_events)) {
36163624 if (block_nested_events)
@@ -3621,8 +3629,28 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) · 4 unmodified lines
36213629 return 0;
36223630 }
36233631
3632+ /*
3633+ * Process any exceptions that are not debug traps before MTF.
3634+ */
3635+ if (vcpu->arch.exception.pending &&
3636+ !vmx_pending_dbg_trap(vcpu) &&
3637+ nested_vmx_check_exception(vcpu, &exit_qual)) {
3638+ if (block_nested_events)
3639+ return -EBUSY;
3640+ nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
3641+ return 0;
3642+ }
3643+
3644+ if (mtf_pending) {
3645+ if (block_nested_events)
3646+ return -EBUSY;
3647+ nested_vmx_update_pending_dbg(vcpu);
3648+ nested_vmx_vmexit(vcpu, EXIT_REASON_MONITOR_TRAP_FLAG, 0, 0);
3649+ return 0;
3650+ }
3651+
36243652 if (vcpu->arch.exception.pending &&
3625− nested_vmx_check_exception(vcpu, &exit_qual)) {
3653+ nested_vmx_check_exception(vcpu, &exit_qual)) {
36263654 if (block_nested_events)
36273655 return -EBUSY;
36283656 nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
@@ -5285,24 +5313,17 @@ fail: · 1656 unmodified lines
52855313 return 1;
52865314 }
52875315
5288−
5289−static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
5290− struct vmcs12 *vmcs12)
5316+/*
5317+ * Return true if an IO instruction with the specified port and size should cause
5318+ * a VM-exit into L1.
5319+ */
5320+bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port,
5321+ int size)
52915322 {
5292− unsigned long exit_qualification;
5323+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
52935324 gpa_t bitmap, last_bitmap;
5294− unsigned int port;
5295− int size;
52965325 u8 b;
52975326
5298− if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
5299− return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING);
5300−
5301− exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
5302−
5303− port = exit_qualification >> 16;
5304− size = (exit_qualification & 7) + 1;
5305−
53065327 last_bitmap = (gpa_t)-1;
53075328 b = -1;
53085329
@@ -5329,8 +5350,26 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, · 20 unmodified lines
53295350 return false;
53305351 }
53315352
5353+static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
5354+ struct vmcs12 *vmcs12)
5355+{
5356+ unsigned long exit_qualification;
5357+ unsigned short port;
5358+ int size;
5359+
5360+ if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
5361+ return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING);
5362+
5363+ exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
5364+
5365+ port = exit_qualification >> 16;
5366+ size = (exit_qualification & 7) + 1;
5367+
5368+ return nested_vmx_check_io_bitmaps(vcpu, port, size);
5369+}
5370+
53325371 /*
5333− * Return 1 if we should exit from L2 to L1 to handle an MSR access access,
5372+ * Return 1 if we should exit from L2 to L1 to handle an MSR access,
53345373 * rather than handle it ourselves in L0. I.e., check whether L1 expressed
53355374 * disinterest in the current event (read or write a specific MSR) by using an
53365375 * MSR bitmap. This may be the case even when L0 doesn't use MSR bitmaps.
@@ -5712,6 +5751,9 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, · 375 unmodified lines
57125751
57135752 if (vmx->nested.nested_run_pending)
57145753 kvm_state.flags |= KVM_STATE_NESTED_RUN_PENDING;
5754+
5755+ if (vmx->nested.mtf_pending)
5756+ kvm_state.flags |= KVM_STATE_NESTED_MTF_PENDING;
57155757 }
57165758 }
57175759
@@ -5892,6 +5934,9 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 174 unmodified lines
58925934 vmx->nested.nested_run_pending =
58935935 !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
58945936
5937+ vmx->nested.mtf_pending =
5938+ !!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING);
5939+
58955940 ret = -EINVAL;
58965941 if (nested_cpu_has_shadow_vmcs(vmcs12) &&
58975942 vmcs12->vmcs_link_pointer != -1ull) {
@@ -5949,8 +5994,7 @@ void nested_vmx_set_vmcs_shadowing_bitmap(void) · 51 unmodified lines
59495994 * bit in the high half is on if the corresponding bit in the control field
59505995 * may be on. See also vmx_control_verify().
59515996 */
5952−void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
5953− bool apicv)
5997+void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
59545998 {
59555999 /*
59566000 * Note that as a general rule, the high half of the MSRs (bits in
@@ -5977,7 +6021,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps, · 20 unmodified lines
59776021 PIN_BASED_EXT_INTR_MASK |
59786022 PIN_BASED_NMI_EXITING |
59796023 PIN_BASED_VIRTUAL_NMIS |
5980− (apicv ? PIN_BASED_POSTED_INTR : 0);
6024+ (enable_apicv ? PIN_BASED_POSTED_INTR : 0);
59816025 msrs->pinbased_ctls_high |=
59826026 PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR |
59836027 PIN_BASED_VMX_PREEMPTION_TIMER;
arch/x86/kvm/vmx/nested.h+8−2
@@ -17,8 +17,7 @@ enum nvmx_vmentry_status { · 16 unmodified lines
1717 };
1818
1919 void vmx_leave_nested(struct kvm_vcpu *vcpu);
20−void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
21− bool apicv);
20+void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps);
2221 void nested_vmx_hardware_unsetup(void);
2322 __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));
2423 void nested_vmx_set_vmcs_shadowing_bitmap(void);
@@ -34,6 +33,8 @@ int vmx_get_vmx_msr(struct nested_vmx_msrs *msrs, u32 msr_index, u64 *pdata); · 9 unmodified lines
3433 int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,
3534 u32 vmx_instruction_info, bool wr, int len, gva_t *ret);
3635 void nested_vmx_pmu_entry_exit_ctls_update(struct kvm_vcpu *vcpu);
36+bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port,
37+ int size);
3738
3839 static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)
3940 {
@@ -175,6 +176,11 @@ static inline bool nested_cpu_has_virtual_nmis(struct vmcs12 *vmcs12) · 135 unmodified lines
175176 return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;
176177 }
177178
179+static inline int nested_cpu_has_mtf(struct vmcs12 *vmcs12)
180+{
181+ return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
182+}
183+
178184 static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
179185 {
180186 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);
arch/x86/kvm/vmx/vmx.c+141−22
@@ -64,11 +64,13 @@ · 63 unmodified lines
6464 MODULE_AUTHOR("Qumranet");
6565 MODULE_LICENSE("GPL");
6666
67+#ifdef MODULE
6768 static const struct x86_cpu_id vmx_cpu_id[] = {
6869 X86_FEATURE_MATCH(X86_FEATURE_VMX),
6970 {}
7071 };
7172 MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id);
73+#endif
7274
7375 bool __read_mostly enable_vpid = 1;
7476 module_param_named(vpid, enable_vpid, bool, 0444);
@@ -95,7 +97,7 @@ module_param(emulate_invalid_guest_state, bool, S_IRUGO); · 20 unmodified lines
9597 static bool __read_mostly fasteoi = 1;
9698 module_param(fasteoi, bool, S_IRUGO);
9799
98−static bool __read_mostly enable_apicv = 1;
100+bool __read_mostly enable_apicv = 1;
99101 module_param(enable_apicv, bool, S_IRUGO);
100102
101103 /*
@@ -1175,6 +1177,10 @@ void vmx_prepare_switch_to_guest(struct kvm_vcpu *vcpu) · 1073 unmodified lines
11751177 vmx->guest_msrs[i].mask);
11761178
11771179 }
1180+
1181+ if (vmx->nested.need_vmcs12_to_shadow_sync)
1182+ nested_sync_vmcs12_to_shadow(vcpu);
1183+
11781184 if (vmx->guest_state_loaded)
11791185 return;
11801186
@@ -1599,6 +1605,40 @@ static int skip_emulated_instruction(struct kvm_vcpu *vcpu) · 418 unmodified lines
15991605 return 1;
16001606 }
16011607
1608+
1609+/*
1610+ * Recognizes a pending MTF VM-exit and records the nested state for later
1611+ * delivery.
1612+ */
1613+static void vmx_update_emulated_instruction(struct kvm_vcpu *vcpu)
1614+{
1615+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
1616+ struct vcpu_vmx *vmx = to_vmx(vcpu);
1617+
1618+ if (!is_guest_mode(vcpu))
1619+ return;
1620+
1621+ /*
1622+ * Per the SDM, MTF takes priority over debug-trap exceptions besides
1623+ * T-bit traps. As instruction emulation is completed (i.e. at the
1624+ * instruction boundary), any #DB exception pending delivery must be a
1625+ * debug-trap. Record the pending MTF state to be delivered in
1626+ * vmx_check_nested_events().
1627+ */
1628+ if (nested_cpu_has_mtf(vmcs12) &&
1629+ (!vcpu->arch.exception.pending ||
1630+ vcpu->arch.exception.nr == DB_VECTOR))
1631+ vmx->nested.mtf_pending = true;
1632+ else
1633+ vmx->nested.mtf_pending = false;
1634+}
1635+
1636+static int vmx_skip_emulated_instruction(struct kvm_vcpu *vcpu)
1637+{
1638+ vmx_update_emulated_instruction(vcpu);
1639+ return skip_emulated_instruction(vcpu);
1640+}
1641+
16021642 static void vmx_clear_hlt(struct kvm_vcpu *vcpu)
16031643 {
16041644 /*
@@ -2298,6 +2338,17 @@ static void hardware_disable(void) · 693 unmodified lines
22982338 kvm_cpu_vmxoff();
22992339 }
23002340
2341+/*
2342+ * There is no X86_FEATURE for SGX yet, but anyway we need to query CPUID
2343+ * directly instead of going through cpu_has(), to ensure KVM is trapping
2344+ * ENCLS whenever it's supported in hardware. It does not matter whether
2345+ * the host OS supports or has enabled SGX.
2346+ */
2347+static bool cpu_has_sgx(void)
2348+{
2349+ return cpuid_eax(0) >= 0x12 && (cpuid_eax(0x12) & BIT(0));
2350+}
2351+
23012352 static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,
23022353 u32 msr, u32 *result)
23032354 {
@@ -2378,8 +2429,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf, · 74 unmodified lines
23782429 SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE |
23792430 SECONDARY_EXEC_PT_USE_GPA |
23802431 SECONDARY_EXEC_PT_CONCEAL_VMX |
2381− SECONDARY_EXEC_ENABLE_VMFUNC |
2382− SECONDARY_EXEC_ENCLS_EXITING;
2432+ SECONDARY_EXEC_ENABLE_VMFUNC;
2433+ if (cpu_has_sgx())
2434+ opt2 |= SECONDARY_EXEC_ENCLS_EXITING;
23832435 if (adjust_vmx_controls(min2, opt2,
23842436 MSR_IA32_VMX_PROCBASED_CTLS2,
23852437 &_cpu_based_2nd_exec_control) < 0)
@@ -3818,24 +3870,29 @@ static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, · 1432 unmodified lines
38183870 * 2. If target vcpu isn't running(root mode), kick it to pick up the
38193871 * interrupt from PIR in next vmentry.
38203872 */
3821−static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
3873+static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
38223874 {
38233875 struct vcpu_vmx *vmx = to_vmx(vcpu);
38243876 int r;
38253877
38263878 r = vmx_deliver_nested_posted_interrupt(vcpu, vector);
38273879 if (!r)
3828− return;
3880+ return 0;
3881+
3882+ if (!vcpu->arch.apicv_active)
3883+ return -1;
38293884
38303885 if (pi_test_and_set_pir(vector, &vmx->pi_desc))
3831− return;
3886+ return 0;
38323887
38333888 /* If a previous notification has sent the IPI, nothing to do. */
38343889 if (pi_test_and_set_on(&vmx->pi_desc))
3835− return;
3890+ return 0;
38363891
38373892 if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false))
38383893 kvm_vcpu_kick(vcpu);
3894+
3895+ return 0;
38393896 }
38403897
38413898 /*
@@ -6482,8 +6539,11 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 2640 unmodified lines
64826539 vmcs_write32(PLE_WINDOW, vmx->ple_window);
64836540 }
64846541
6485− if (vmx->nested.need_vmcs12_to_shadow_sync)
6486− nested_sync_vmcs12_to_shadow(vcpu);
6542+ /*
6543+ * We did this in prepare_switch_to_guest, because it needs to
6544+ * be within srcu_read_lock.
6545+ */
6546+ WARN_ON_ONCE(vmx->nested.need_vmcs12_to_shadow_sync);
64876547
64886548 if (kvm_register_is_dirty(vcpu, VCPU_REGS_RSP))
64896549 vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
@@ -6757,8 +6817,7 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 267 unmodified lines
67576817
67586818 if (nested)
67596819 nested_vmx_setup_ctls_msrs(&vmx->nested.msrs,
6760− vmx_capability.ept,
6761− kvm_vcpu_apicv_active(vcpu));
6820+ vmx_capability.ept);
67626821 else
67636822 memset(&vmx->nested.msrs, 0, sizeof(vmx->nested.msrs));
67646823
@@ -6839,8 +6898,7 @@ static int __init vmx_check_processor_compat(void) · 74 unmodified lines
68396898 if (setup_vmcs_config(&vmcs_conf, &vmx_cap) < 0)
68406899 return -EIO;
68416900 if (nested)
6842− nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept,
6843− enable_apicv);
6901+ nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept);
68446902 if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {
68456903 printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
68466904 smp_processor_id());
@@ -7101,6 +7159,40 @@ static void vmx_request_immediate_exit(struct kvm_vcpu *vcpu) · 254 unmodified lines
71017159 to_vmx(vcpu)->req_immediate_exit = true;
71027160 }
71037161
7162+static int vmx_check_intercept_io(struct kvm_vcpu *vcpu,
7163+ struct x86_instruction_info *info)
7164+{
7165+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
7166+ unsigned short port;
7167+ bool intercept;
7168+ int size;
7169+
7170+ if (info->intercept == x86_intercept_in ||
7171+ info->intercept == x86_intercept_ins) {
7172+ port = info->src_val;
7173+ size = info->dst_bytes;
7174+ } else {
7175+ port = info->dst_val;
7176+ size = info->src_bytes;
7177+ }
7178+
7179+ /*
7180+ * If the 'use IO bitmaps' VM-execution control is 0, IO instruction
7181+ * VM-exits depend on the 'unconditional IO exiting' VM-execution
7182+ * control.
7183+ *
7184+ * Otherwise, IO instruction VM-exits are controlled by the IO bitmaps.
7185+ */
7186+ if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
7187+ intercept = nested_cpu_has(vmcs12,
7188+ CPU_BASED_UNCOND_IO_EXITING);
7189+ else
7190+ intercept = nested_vmx_check_io_bitmaps(vcpu, port, size);
7191+
7192+ /* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */
7193+ return intercept ? X86EMUL_UNHANDLEABLE : X86EMUL_CONTINUE;
7194+}
7195+
71047196 static int vmx_check_intercept(struct kvm_vcpu *vcpu,
71057197 struct x86_instruction_info *info,
71067198 enum x86_intercept_stage stage)
@@ -7108,19 +7200,45 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu, · 1 unmodified line
71087200 struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
71097201 struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt;
71107202
7203+ switch (info->intercept) {
71117204 /*
71127205 * RDPID causes #UD if disabled through secondary execution controls.
71137206 * Because it is marked as EmulateOnUD, we need to intercept it here.
71147207 */
7115− if (info->intercept == x86_intercept_rdtscp &&
7116− !nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) {
7117− ctxt->exception.vector = UD_VECTOR;
7118− ctxt->exception.error_code_valid = false;
7119− return X86EMUL_PROPAGATE_FAULT;
7120− }
7208+ case x86_intercept_rdtscp:
7209+ if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) {
7210+ ctxt->exception.vector = UD_VECTOR;
7211+ ctxt->exception.error_code_valid = false;
7212+ return X86EMUL_PROPAGATE_FAULT;
7213+ }
7214+ break;
7215+
7216+ case x86_intercept_in:
7217+ case x86_intercept_ins:
7218+ case x86_intercept_out:
7219+ case x86_intercept_outs:
7220+ return vmx_check_intercept_io(vcpu, info);
7221+
7222+ case x86_intercept_lgdt:
7223+ case x86_intercept_lidt:
7224+ case x86_intercept_lldt:
7225+ case x86_intercept_ltr:
7226+ case x86_intercept_sgdt:
7227+ case x86_intercept_sidt:
7228+ case x86_intercept_sldt:
7229+ case x86_intercept_str:
7230+ if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_DESC))
7231+ return X86EMUL_CONTINUE;
7232+
7233+ /* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */
7234+ break;
71217235
71227236 /* TODO: check more intercepts... */
7123− return X86EMUL_CONTINUE;
7237+ default:
7238+ break;
7239+ }
7240+
7241+ return X86EMUL_UNHANDLEABLE;
71247242 }
71257243
71267244 #ifdef CONFIG_X86_64
@@ -7702,7 +7820,7 @@ static __init int hardware_setup(void) · 575 unmodified lines
77027820
77037821 if (nested) {
77047822 nested_vmx_setup_ctls_msrs(&vmcs_config.nested,
7705− vmx_capability.ept, enable_apicv);
7823+ vmx_capability.ept);
77067824
77077825 r = nested_vmx_hardware_setup(kvm_vmx_exit_handlers);
77087826 if (r)
@@ -7786,7 +7904,8 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 77 unmodified lines
77867904
77877905 .run = vmx_vcpu_run,
77887906 .handle_exit = vmx_handle_exit,
7789− .skip_emulated_instruction = skip_emulated_instruction,
7907+ .skip_emulated_instruction = vmx_skip_emulated_instruction,
7908+ .update_emulated_instruction = vmx_update_emulated_instruction,
77907909 .set_interrupt_shadow = vmx_set_interrupt_shadow,
77917910 .get_interrupt_shadow = vmx_get_interrupt_shadow,
77927911 .patch_hypercall = vmx_patch_hypercall,
arch/x86/kvm/vmx/vmx.h+3−0
@@ -150,6 +150,9 @@ struct nested_vmx { · 149 unmodified lines
150150 /* L2 must run next, and mustn't decide to exit to L1. */
151151 bool nested_run_pending;
152152
153+ /* Pending MTF VM-exit into L1. */
154+ bool mtf_pending;
155+
153156 struct loaded_vmcs vmcs02;
154157
155158 /*
arch/x86/kvm/x86.c+11−7
@@ -6891,6 +6891,8 @@ restart: · 6890 unmodified lines
68916891 kvm_rip_write(vcpu, ctxt->eip);
68926892 if (r && ctxt->tf)
68936893 r = kvm_vcpu_do_singlestep(vcpu);
6894+ if (kvm_x86_ops->update_emulated_instruction)
6895+ kvm_x86_ops->update_emulated_instruction(vcpu);
68946896 __kvm_set_rflags(vcpu, ctxt->eflags);
68956897 }
68966898
@@ -7188,14 +7190,16 @@ static void kvm_timer_init(void) · 291 unmodified lines
71887190
71897191 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
71907192 #ifdef CONFIG_CPU_FREQ
7191− struct cpufreq_policy policy;
7193+ struct cpufreq_policy *policy;
71927194 int cpu;
71937195
7194− memset(&policy, 0, sizeof(policy));
71957196 cpu = get_cpu();
7196− cpufreq_get_policy(&policy, cpu);
7197− if (policy.cpuinfo.max_freq)
7198− max_tsc_khz = policy.cpuinfo.max_freq;
7197+ policy = cpufreq_cpu_get(cpu);
7198+ if (policy) {
7199+ if (policy->cpuinfo.max_freq)
7200+ max_tsc_khz = policy->cpuinfo.max_freq;
7201+ cpufreq_cpu_put(policy);
7202+ }
71997203 put_cpu();
72007204 #endif
72017205 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
@@ -7306,12 +7310,12 @@ int kvm_arch_init(void *opaque) · 104 unmodified lines
73067310 }
73077311
73087312 if (!ops->cpu_has_kvm_support()) {
7309− printk(KERN_ERR "kvm: no hardware support\n");
7313+ pr_err_ratelimited("kvm: no hardware support\n");
73107314 r = -EOPNOTSUPP;
73117315 goto out;
73127316 }
73137317 if (ops->disabled_by_bios()) {
7314− printk(KERN_ERR "kvm: disabled by bios\n");
7318+ pr_err_ratelimited("kvm: disabled by bios\n");
73157319 r = -EOPNOTSUPP;
73167320 goto out;
73177321 }
arch/x86/mm/dump_pagetables.c+1−6
@@ -363,13 +363,8 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m, · 362 unmodified lines
363363 {
364364 const struct ptdump_range ptdump_ranges[] = {
365365 #ifdef CONFIG_X86_64
366−
367−#define normalize_addr_shift (64 - (__VIRTUAL_MASK_SHIFT + 1))
368−#define normalize_addr(u) ((signed long)((u) << normalize_addr_shift) >> \
369− normalize_addr_shift)
370−
371366 {0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},
372− {normalize_addr(PTRS_PER_PGD * PGD_LEVEL_MULT / 2), ~0UL},
367+ {GUARD_HOLE_END_ADDR, ~0UL},
373368 #else
374369 {0, ~0UL},
375370 #endif
arch/x86/mm/ioremap.c+18−0
@@ -106,6 +106,19 @@ static unsigned int __ioremap_check_encrypted(struct resource *res) · 105 unmodified lines
106106 return 0;
107107 }
108108
109+/*
110+ * The EFI runtime services data area is not covered by walk_mem_res(), but must
111+ * be mapped encrypted when SEV is active.
112+ */
113+static void __ioremap_check_other(resource_size_t addr, struct ioremap_desc *desc)
114+{
115+ if (!sev_active())
116+ return;
117+
118+ if (efi_mem_type(addr) == EFI_RUNTIME_SERVICES_DATA)
119+ desc->flags |= IORES_MAP_ENCRYPTED;
120+}
121+
109122 static int __ioremap_collect_map_flags(struct resource *res, void *arg)
110123 {
111124 struct ioremap_desc *desc = arg;
@@ -124,6 +137,9 @@ static int __ioremap_collect_map_flags(struct resource *res, void *arg) · 12 unmodified lines
124137 * To avoid multiple resource walks, this function walks resources marked as
125138 * IORESOURCE_MEM and IORESOURCE_BUSY and looking for system RAM and/or a
126139 * resource described not as IORES_DESC_NONE (e.g. IORES_DESC_ACPI_TABLES).
140+ *
141+ * After that, deal with misc other ranges in __ioremap_check_other() which do
142+ * not fall into the above category.
127143 */
128144 static void __ioremap_check_mem(resource_size_t addr, unsigned long size,
129145 struct ioremap_desc *desc)
@@ -135,6 +151,8 @@ static void __ioremap_check_mem(resource_size_t addr, unsigned long size, · 5 unmodified lines
135151 memset(desc, 0, sizeof(struct ioremap_desc));
136152
137153 walk_mem_res(start, end, desc, __ioremap_collect_map_flags);
154+
155+ __ioremap_check_other(addr, desc);
138156 }
139157
140158 /*
arch/x86/platform/efi/efi_64.c+52−99
@@ -180,7 +180,7 @@ void efi_sync_low_kernel_mappings(void) · 179 unmodified lines
180180 static inline phys_addr_t
181181 virt_to_phys_or_null_size(void *va, unsigned long size)
182182 {
183− bool bad_size;
183+ phys_addr_t pa;
184184
185185 if (!va)
186186 return 0;
@@ -188,16 +188,13 @@ virt_to_phys_or_null_size(void *va, unsigned long size) · 1 unmodified line
188188 if (virt_addr_valid(va))
189189 return virt_to_phys(va);
190190
191− /*
192− * A fully aligned variable on the stack is guaranteed not to
193− * cross a page bounary. Try to catch strings on the stack by
194− * checking that 'size' is a power of two.
195− */
196− bad_size = size > PAGE_SIZE || !is_power_of_2(size);
191+ pa = slow_virt_to_phys(va);
197192
198− WARN_ON(!IS_ALIGNED((unsigned long)va, size) || bad_size);
193+ /* check if the object crosses a page boundary */
194+ if (WARN_ON((pa ^ (pa + size - 1)) & PAGE_MASK))
195+ return 0;
199196
200− return slow_virt_to_phys(va);
197+ return pa;
201198 }
202199
203200 #define virt_to_phys_or_null(addr) \
@@ -568,85 +565,25 @@ efi_thunk_set_virtual_address_map(unsigned long memory_map_size, · 364 unmodified lines
568565
569566 static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)
570567 {
571− efi_status_t status;
572− u32 phys_tm, phys_tc;
573− unsigned long flags;
574−
575− spin_lock(&rtc_lock);
576− spin_lock_irqsave(&efi_runtime_lock, flags);
577−
578− phys_tm = virt_to_phys_or_null(tm);
579− phys_tc = virt_to_phys_or_null(tc);
580−
581− status = efi_thunk(get_time, phys_tm, phys_tc);
582−
583− spin_unlock_irqrestore(&efi_runtime_lock, flags);
584− spin_unlock(&rtc_lock);
585−
586− return status;
568+ return EFI_UNSUPPORTED;
587569 }
588570
589571 static efi_status_t efi_thunk_set_time(efi_time_t *tm)
590572 {
591− efi_status_t status;
592− u32 phys_tm;
593− unsigned long flags;
594−
595− spin_lock(&rtc_lock);
596− spin_lock_irqsave(&efi_runtime_lock, flags);
597−
598− phys_tm = virt_to_phys_or_null(tm);
599−
600− status = efi_thunk(set_time, phys_tm);
601−
602− spin_unlock_irqrestore(&efi_runtime_lock, flags);
603− spin_unlock(&rtc_lock);
604−
605− return status;
573+ return EFI_UNSUPPORTED;
606574 }
607575
608576 static efi_status_t
609577 efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
610578 efi_time_t *tm)
611579 {
612− efi_status_t status;
613− u32 phys_enabled, phys_pending, phys_tm;
614− unsigned long flags;
615−
616− spin_lock(&rtc_lock);
617− spin_lock_irqsave(&efi_runtime_lock, flags);
618−
619− phys_enabled = virt_to_phys_or_null(enabled);
620− phys_pending = virt_to_phys_or_null(pending);
621− phys_tm = virt_to_phys_or_null(tm);
622−
623− status = efi_thunk(get_wakeup_time, phys_enabled,
624− phys_pending, phys_tm);
625−
626− spin_unlock_irqrestore(&efi_runtime_lock, flags);
627− spin_unlock(&rtc_lock);
628−
629− return status;
580+ return EFI_UNSUPPORTED;
630581 }
631582
632583 static efi_status_t
633584 efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
634585 {
635− efi_status_t status;
636− u32 phys_tm;
637− unsigned long flags;
638−
639− spin_lock(&rtc_lock);
640− spin_lock_irqsave(&efi_runtime_lock, flags);
641−
642− phys_tm = virt_to_phys_or_null(tm);
643−
644− status = efi_thunk(set_wakeup_time, enabled, phys_tm);
645−
646− spin_unlock_irqrestore(&efi_runtime_lock, flags);
647− spin_unlock(&rtc_lock);
648−
649− return status;
586+ return EFI_UNSUPPORTED;
650587 }
651588
652589 static unsigned long efi_name_size(efi_char16_t *name)
@@ -658,6 +595,8 @@ static efi_status_t · 5 unmodified lines
658595 efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
659596 u32 *attr, unsigned long *data_size, void *data)
660597 {
598+ u8 buf[24] __aligned(8);
599+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
661600 efi_status_t status;
662601 u32 phys_name, phys_vendor, phys_attr;
663602 u32 phys_data_size, phys_data;
@@ -665,14 +604,19 @@ efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor, · 1 unmodified line
665604
666605 spin_lock_irqsave(&efi_runtime_lock, flags);
667606
607+ *vnd = *vendor;
608+
668609 phys_data_size = virt_to_phys_or_null(data_size);
669− phys_vendor = virt_to_phys_or_null(vendor);
610+ phys_vendor = virt_to_phys_or_null(vnd);
670611 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
671612 phys_attr = virt_to_phys_or_null(attr);
672613 phys_data = virt_to_phys_or_null_size(data, *data_size);
673614
674− status = efi_thunk(get_variable, phys_name, phys_vendor,
675− phys_attr, phys_data_size, phys_data);
615+ if (!phys_name || (data && !phys_data))
616+ status = EFI_INVALID_PARAMETER;
617+ else
618+ status = efi_thunk(get_variable, phys_name, phys_vendor,
619+ phys_attr, phys_data_size, phys_data);
676620
677621 spin_unlock_irqrestore(&efi_runtime_lock, flags);
678622
@@ -683,19 +627,25 @@ static efi_status_t · 4 unmodified lines
683627 efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
684628 u32 attr, unsigned long data_size, void *data)
685629 {
630+ u8 buf[24] __aligned(8);
631+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
686632 u32 phys_name, phys_vendor, phys_data;
687633 efi_status_t status;
688634 unsigned long flags;
689635
690636 spin_lock_irqsave(&efi_runtime_lock, flags);
691637
638+ *vnd = *vendor;
639+
692640 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
693− phys_vendor = virt_to_phys_or_null(vendor);
641+ phys_vendor = virt_to_phys_or_null(vnd);
694642 phys_data = virt_to_phys_or_null_size(data, data_size);
695643
696− /* If data_size is > sizeof(u32) we've got problems */
697− status = efi_thunk(set_variable, phys_name, phys_vendor,
698− attr, data_size, phys_data);
644+ if (!phys_name || !phys_data)
645+ status = EFI_INVALID_PARAMETER;
646+ else
647+ status = efi_thunk(set_variable, phys_name, phys_vendor,
648+ attr, data_size, phys_data);
699649
700650 spin_unlock_irqrestore(&efi_runtime_lock, flags);
701651
@@ -707,6 +657,8 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 5 unmodified lines
707657 u32 attr, unsigned long data_size,
708658 void *data)
709659 {
660+ u8 buf[24] __aligned(8);
661+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
710662 u32 phys_name, phys_vendor, phys_data;
711663 efi_status_t status;
712664 unsigned long flags;
@@ -714,13 +666,17 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 1 unmodified line
714666 if (!spin_trylock_irqsave(&efi_runtime_lock, flags))
715667 return EFI_NOT_READY;
716668
669+ *vnd = *vendor;
670+
717671 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
718− phys_vendor = virt_to_phys_or_null(vendor);
672+ phys_vendor = virt_to_phys_or_null(vnd);
719673 phys_data = virt_to_phys_or_null_size(data, data_size);
720674
721− /* If data_size is > sizeof(u32) we've got problems */
722− status = efi_thunk(set_variable, phys_name, phys_vendor,
723− attr, data_size, phys_data);
675+ if (!phys_name || !phys_data)
676+ status = EFI_INVALID_PARAMETER;
677+ else
678+ status = efi_thunk(set_variable, phys_name, phys_vendor,
679+ attr, data_size, phys_data);
724680
725681 spin_unlock_irqrestore(&efi_runtime_lock, flags);
726682
@@ -732,39 +688,36 @@ efi_thunk_get_next_variable(unsigned long *name_size, · 5 unmodified lines
732688 efi_char16_t *name,
733689 efi_guid_t *vendor)
734690 {
691+ u8 buf[24] __aligned(8);
692+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
735693 efi_status_t status;
736694 u32 phys_name_size, phys_name, phys_vendor;
737695 unsigned long flags;
738696
739697 spin_lock_irqsave(&efi_runtime_lock, flags);
740698
699+ *vnd = *vendor;
700+
741701 phys_name_size = virt_to_phys_or_null(name_size);
742− phys_vendor = virt_to_phys_or_null(vendor);
702+ phys_vendor = virt_to_phys_or_null(vnd);
743703 phys_name = virt_to_phys_or_null_size(name, *name_size);
744704
745− status = efi_thunk(get_next_variable, phys_name_size,
746− phys_name, phys_vendor);
705+ if (!phys_name)
706+ status = EFI_INVALID_PARAMETER;
707+ else
708+ status = efi_thunk(get_next_variable, phys_name_size,
709+ phys_name, phys_vendor);
747710
748711 spin_unlock_irqrestore(&efi_runtime_lock, flags);
749712
713+ *vendor = *vnd;
750714 return status;
751715 }
752716
753717 static efi_status_t
754718 efi_thunk_get_next_high_mono_count(u32 *count)
755719 {
756− efi_status_t status;
757− u32 phys_count;
758− unsigned long flags;
759−
760− spin_lock_irqsave(&efi_runtime_lock, flags);
761−
762− phys_count = virt_to_phys_or_null(count);
763− status = efi_thunk(get_next_high_mono_count, phys_count);
764−
765− spin_unlock_irqrestore(&efi_runtime_lock, flags);
766−
767− return status;
720+ return EFI_UNSUPPORTED;
768721 }
769722
770723 static void
arch/x86/xen/enlighten_pv.c+25−0
@@ -72,6 +72,9 @@ · 71 unmodified lines
7272 #include <asm/mwait.h>
7373 #include <asm/pci_x86.h>
7474 #include <asm/cpu.h>
75+#ifdef CONFIG_X86_IOPL_IOPERM
76+#include <asm/io_bitmap.h>
77+#endif
7578
7679 #ifdef CONFIG_ACPI
7780 #include <linux/acpi.h>
@@ -837,6 +840,25 @@ static void xen_load_sp0(unsigned long sp0) · 759 unmodified lines
837840 this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0);
838841 }
839842
843+#ifdef CONFIG_X86_IOPL_IOPERM
844+static void xen_update_io_bitmap(void)
845+{
846+ struct physdev_set_iobitmap iobitmap;
847+ struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw);
848+
849+ native_tss_update_io_bitmap();
850+
851+ iobitmap.bitmap = (uint8_t *)(&tss->x86_tss) +
852+ tss->x86_tss.io_bitmap_base;
853+ if (tss->x86_tss.io_bitmap_base == IO_BITMAP_OFFSET_INVALID)
854+ iobitmap.nr_ports = 0;
855+ else
856+ iobitmap.nr_ports = IO_BITMAP_BITS;
857+
858+ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap);
859+}
860+#endif
861+
840862 static void xen_io_delay(void)
841863 {
842864 }
@@ -1047,6 +1069,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { · 204 unmodified lines
10471069 .write_idt_entry = xen_write_idt_entry,
10481070 .load_sp0 = xen_load_sp0,
10491071
1072+#ifdef CONFIG_X86_IOPL_IOPERM
1073+ .update_io_bitmap = xen_update_io_bitmap,
1074+#endif
10501075 .io_delay = xen_io_delay,
10511076
10521077 /* Xen takes care of %gs when switching to usermode for us */
block/bfq-cgroup.c+5−4
@@ -610,12 +610,13 @@ struct bfq_group *bfq_find_set_group(struct bfq_data *bfqd, · 609 unmodified lines
610610 */
611611 entity = &bfqg->entity;
612612 for_each_entity(entity) {
613− bfqg = container_of(entity, struct bfq_group, entity);
614− if (bfqg != bfqd->root_group) {
615− parent = bfqg_parent(bfqg);
613+ struct bfq_group *curr_bfqg = container_of(entity,
614+ struct bfq_group, entity);
615+ if (curr_bfqg != bfqd->root_group) {
616+ parent = bfqg_parent(curr_bfqg);
616617 if (!parent)
617618 parent = bfqd->root_group;
618− bfq_group_set_parent(bfqg, parent);
619+ bfq_group_set_parent(curr_bfqg, parent);
619620 }
620621 }
621622
block/blk-core.c+0−6
@@ -1663,12 +1663,6 @@ int kblockd_schedule_work(struct work_struct *work) · 1662 unmodified lines
16631663 }
16641664 EXPORT_SYMBOL(kblockd_schedule_work);
16651665
1666−int kblockd_schedule_work_on(int cpu, struct work_struct *work)
1667−{
1668− return queue_work_on(cpu, kblockd_workqueue, work);
1669−}
1670−EXPORT_SYMBOL(kblockd_schedule_work_on);
1671−
16721666 int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork,
16731667 unsigned long delay)
16741668 {
block/blk-flush.c+1−1
@@ -412,7 +412,7 @@ void blk_insert_flush(struct request *rq) · 411 unmodified lines
412412 */
413413 if ((policy & REQ_FSEQ_DATA) &&
414414 !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
415− blk_mq_request_bypass_insert(rq, false);
415+ blk_mq_request_bypass_insert(rq, false, false);
416416 return;
417417 }
418418
block/blk-iocost.c+1−1
@@ -1318,7 +1318,7 @@ static bool iocg_is_idle(struct ioc_gq *iocg) · 1317 unmodified lines
13181318 return false;
13191319
13201320 /* is something in flight? */
1321− if (atomic64_read(&iocg->done_vtime) < atomic64_read(&iocg->vtime))
1321+ if (atomic64_read(&iocg->done_vtime) != atomic64_read(&iocg->vtime))
13221322 return false;
13231323
13241324 return true;
block/blk-mq-sched.c+37−7
@@ -361,13 +361,19 @@ static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx, · 360 unmodified lines
361361 bool has_sched,
362362 struct request *rq)
363363 {
364− /* dispatch flush rq directly */
365− if (rq->rq_flags & RQF_FLUSH_SEQ) {
366− spin_lock(&hctx->lock);
367− list_add(&rq->queuelist, &hctx->dispatch);
368− spin_unlock(&hctx->lock);
364+ /*
365+ * dispatch flush and passthrough rq directly
366+ *
367+ * passthrough request has to be added to hctx->dispatch directly.
368+ * For some reason, device may be in one situation which can't
369+ * handle FS request, so STS_RESOURCE is always returned and the
370+ * FS request will be added to hctx->dispatch. However passthrough
371+ * request may be required at that time for fixing the problem. If
372+ * passthrough request is added to scheduler queue, there isn't any
373+ * chance to dispatch it given we prioritize requests in hctx->dispatch.
374+ */
375+ if ((rq->rq_flags & RQF_FLUSH_SEQ) || blk_rq_is_passthrough(rq))
369376 return true;
370− }
371377
372378 if (has_sched)
373379 rq->rq_flags |= RQF_SORTED;
@@ -391,8 +397,32 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head, · 17 unmodified lines
391397
392398 WARN_ON(e && (rq->tag != -1));
393399
394− if (blk_mq_sched_bypass_insert(hctx, !!e, rq))
400+ if (blk_mq_sched_bypass_insert(hctx, !!e, rq)) {
401+ /*
402+ * Firstly normal IO request is inserted to scheduler queue or
403+ * sw queue, meantime we add flush request to dispatch queue(
404+ * hctx->dispatch) directly and there is at most one in-flight
405+ * flush request for each hw queue, so it doesn't matter to add
406+ * flush request to tail or front of the dispatch queue.
407+ *
408+ * Secondly in case of NCQ, flush request belongs to non-NCQ
409+ * command, and queueing it will fail when there is any
410+ * in-flight normal IO request(NCQ command). When adding flush
411+ * rq to the front of hctx->dispatch, it is easier to introduce
412+ * extra time to flush rq's latency because of S_SCHED_RESTART
413+ * compared with adding to the tail of dispatch queue, then
414+ * chance of flush merge is increased, and less flush requests
415+ * will be issued to controller. It is observed that ~10% time
416+ * is saved in blktests block/004 on disk attached to AHCI/NCQ
417+ * drive when adding flush rq to the front of hctx->dispatch.
418+ *
419+ * Simply queue flush rq to the front of hctx->dispatch so that
420+ * intensive flush workloads can benefit in case of NCQ HW.
421+ */
422+ at_head = (rq->rq_flags & RQF_FLUSH_SEQ) ? true : at_head;
423+ blk_mq_request_bypass_insert(rq, at_head, false);
395424 goto run;
425+ }
396426
397427 if (e && e->type->ops.insert_requests) {
398428 LIST_HEAD(list);
block/blk-mq-tag.c+2−2
@@ -183,8 +183,8 @@ found_tag: · 182 unmodified lines
183183 return tag + tag_offset;
184184 }
185185
186−void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,
187− struct blk_mq_ctx *ctx, unsigned int tag)
186+void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
187+ unsigned int tag)
188188 {
189189 if (!blk_mq_tag_is_reserved(tags, tag)) {
190190 const int real_tag = tag - tags->nr_reserved_tags;
block/blk-mq-tag.h+2−2
@@ -26,8 +26,8 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int r · 25 unmodified lines
2626 extern void blk_mq_free_tags(struct blk_mq_tags *tags);
2727
2828 extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);
29−extern void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,
30− struct blk_mq_ctx *ctx, unsigned int tag);
29+extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
30+ unsigned int tag);
3131 extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
3232 struct blk_mq_tags **tags,
3333 unsigned int depth, bool can_grow);
block/blk-mq.c+15−13
@@ -477,9 +477,9 @@ static void __blk_mq_free_request(struct request *rq) · 476 unmodified lines
477477 blk_pm_mark_last_busy(rq);
478478 rq->mq_hctx = NULL;
479479 if (rq->tag != -1)
480− blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
480+ blk_mq_put_tag(hctx->tags, ctx, rq->tag);
481481 if (sched_tag != -1)
482− blk_mq_put_tag(hctx, hctx->sched_tags, ctx, sched_tag);
482+ blk_mq_put_tag(hctx->sched_tags, ctx, sched_tag);
483483 blk_mq_sched_restart(hctx);
484484 blk_queue_exit(q);
485485 }
@@ -735,7 +735,7 @@ static void blk_mq_requeue_work(struct work_struct *work) · 249 unmodified lines
735735 * merge.
736736 */
737737 if (rq->rq_flags & RQF_DONTPREP)
738− blk_mq_request_bypass_insert(rq, false);
738+ blk_mq_request_bypass_insert(rq, false, false);
739739 else
740740 blk_mq_sched_insert_request(rq, true, false, false);
741741 }
@@ -1286,7 +1286,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 544 unmodified lines
12861286 q->mq_ops->commit_rqs(hctx);
12871287
12881288 spin_lock(&hctx->lock);
1289− list_splice_init(list, &hctx->dispatch);
1289+ list_splice_tail_init(list, &hctx->dispatch);
12901290 spin_unlock(&hctx->lock);
12911291
12921292 /*
@@ -1677,12 +1677,16 @@ void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, · 384 unmodified lines
16771677 * Should only be used carefully, when the caller knows we want to
16781678 * bypass a potential IO scheduler on the target device.
16791679 */
1680−void blk_mq_request_bypass_insert(struct request *rq, bool run_queue)
1680+void blk_mq_request_bypass_insert(struct request *rq, bool at_head,
1681+ bool run_queue)
16811682 {
16821683 struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
16831684
16841685 spin_lock(&hctx->lock);
1685− list_add_tail(&rq->queuelist, &hctx->dispatch);
1686+ if (at_head)
1687+ list_add(&rq->queuelist, &hctx->dispatch);
1688+ else
1689+ list_add_tail(&rq->queuelist, &hctx->dispatch);
16861690 spin_unlock(&hctx->lock);
16871691
16881692 if (run_queue)
@@ -1849,7 +1853,7 @@ insert: · 160 unmodified lines
18491853 if (bypass_insert)
18501854 return BLK_STS_RESOURCE;
18511855
1852− blk_mq_request_bypass_insert(rq, run_queue);
1856+ blk_mq_request_bypass_insert(rq, false, run_queue);
18531857 return BLK_STS_OK;
18541858 }
18551859
@@ -1876,7 +1880,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, · 20 unmodified lines
18761880
18771881 ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false, true);
18781882 if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
1879− blk_mq_request_bypass_insert(rq, true);
1883+ blk_mq_request_bypass_insert(rq, false, true);
18801884 else if (ret != BLK_STS_OK)
18811885 blk_mq_end_request(rq, ret);
18821886
@@ -1910,7 +1914,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx, · 27 unmodified lines
19101914 if (ret != BLK_STS_OK) {
19111915 if (ret == BLK_STS_RESOURCE ||
19121916 ret == BLK_STS_DEV_RESOURCE) {
1913− blk_mq_request_bypass_insert(rq,
1917+ blk_mq_request_bypass_insert(rq, false,
19141918 list_empty(list));
19151919 break;
19161920 }
@@ -3398,7 +3402,6 @@ static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb) · 1481 unmodified lines
33983402 }
33993403
34003404 static unsigned long blk_mq_poll_nsecs(struct request_queue *q,
3401− struct blk_mq_hw_ctx *hctx,
34023405 struct request *rq)
34033406 {
34043407 unsigned long ret = 0;
@@ -3431,7 +3434,6 @@ static unsigned long blk_mq_poll_nsecs(struct request_queue *q, · 26 unmodified lines
34313434 }
34323435
34333436 static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
3434− struct blk_mq_hw_ctx *hctx,
34353437 struct request *rq)
34363438 {
34373439 struct hrtimer_sleeper hs;
@@ -3451,7 +3453,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, · 13 unmodified lines
34513453 if (q->poll_nsec > 0)
34523454 nsecs = q->poll_nsec;
34533455 else
3454− nsecs = blk_mq_poll_nsecs(q, hctx, rq);
3456+ nsecs = blk_mq_poll_nsecs(q, rq);
34553457
34563458 if (!nsecs)
34573459 return false;
@@ -3506,7 +3508,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q, · 48 unmodified lines
35063508 return false;
35073509 }
35083510
3509− return blk_mq_poll_hybrid_sleep(q, hctx, rq);
3511+ return blk_mq_poll_hybrid_sleep(q, rq);
35103512 }
35113513
35123514 /**
block/blk-mq.h+3−2
@@ -66,7 +66,8 @@ int blk_mq_alloc_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, · 65 unmodified lines
6666 */
6767 void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
6868 bool at_head);
69−void blk_mq_request_bypass_insert(struct request *rq, bool run_queue);
69+void blk_mq_request_bypass_insert(struct request *rq, bool at_head,
70+ bool run_queue);
7071 void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
7172 struct list_head *list);
7273
@@ -199,7 +200,7 @@ static inline bool blk_mq_get_dispatch_budget(struct blk_mq_hw_ctx *hctx) · 126 unmodified lines
199200 static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
200201 struct request *rq)
201202 {
202− blk_mq_put_tag(hctx, hctx->tags, rq->mq_ctx, rq->tag);
203+ blk_mq_put_tag(hctx->tags, rq->mq_ctx, rq->tag);
203204 rq->tag = -1;
204205
205206 if (rq->rq_flags & RQF_MQ_INFLIGHT) {
block/genhd.c+36−0
@@ -301,6 +301,42 @@ struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector) · 300 unmodified lines
301301 }
302302 EXPORT_SYMBOL_GPL(disk_map_sector_rcu);
303303
304+/**
305+ * disk_has_partitions
306+ * @disk: gendisk of interest
307+ *
308+ * Walk through the partition table and check if valid partition exists.
309+ *
310+ * CONTEXT:
311+ * Don't care.
312+ *
313+ * RETURNS:
314+ * True if the gendisk has at least one valid non-zero size partition.
315+ * Otherwise false.
316+ */
317+bool disk_has_partitions(struct gendisk *disk)
318+{
319+ struct disk_part_tbl *ptbl;
320+ int i;
321+ bool ret = false;
322+
323+ rcu_read_lock();
324+ ptbl = rcu_dereference(disk->part_tbl);
325+
326+ /* Iterate partitions skipping the whole device at index 0 */
327+ for (i = 1; i < ptbl->len; i++) {
328+ if (rcu_dereference(ptbl->part[i])) {
329+ ret = true;
330+ break;
331+ }
332+ }
333+
334+ rcu_read_unlock();
335+
336+ return ret;
337+}
338+EXPORT_SYMBOL_GPL(disk_has_partitions);
339+
304340 /*
305341 * Can be deleted altogether. Later.
306342 *
drivers/acpi/acpi_watchdog.c+12−3
@@ -55,12 +55,14 @@ static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat) · 54 unmodified lines
5555 }
5656 #endif
5757
58+static bool acpi_no_watchdog;
59+
5860 static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
5961 {
6062 const struct acpi_table_wdat *wdat = NULL;
6163 acpi_status status;
6264
63− if (acpi_disabled)
65+ if (acpi_disabled || acpi_no_watchdog)
6466 return NULL;
6567
6668 status = acpi_get_table(ACPI_SIG_WDAT, 0,
@@ -88,6 +90,14 @@ bool acpi_has_watchdog(void) · 21 unmodified lines
8890 }
8991 EXPORT_SYMBOL_GPL(acpi_has_watchdog);
9092
93+/* ACPI watchdog can be disabled on boot command line */
94+static int __init disable_acpi_watchdog(char *str)
95+{
96+ acpi_no_watchdog = true;
97+ return 1;
98+}
99+__setup("acpi_no_watchdog", disable_acpi_watchdog);
100+
91101 void __init acpi_watchdog_init(void)
92102 {
93103 const struct acpi_wdat_entry *entries;
@@ -126,12 +136,11 @@ void __init acpi_watchdog_init(void) · 32 unmodified lines
126136 gas = &entries[i].register_region;
127137
128138 res.start = gas->address;
139+ res.end = res.start + ACPI_ACCESS_BYTE_WIDTH(gas->access_width) - 1;
129140 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
130141 res.flags = IORESOURCE_MEM;
131− res.end = res.start + ALIGN(gas->access_width, 4) - 1;
132142 } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
133143 res.flags = IORESOURCE_IO;
134− res.end = res.start + gas->access_width - 1;
135144 } else {
136145 pr_warn("Unsupported address space: %u\n",
137146 gas->space_id);
drivers/android/binder.c+9−0
@@ -5228,6 +5228,7 @@ static int binder_open(struct inode *nodp, struct file *filp) · 5227 unmodified lines
52285228 binder_dev = container_of(filp->private_data,
52295229 struct binder_device, miscdev);
52305230 }
5231+ refcount_inc(&binder_dev->ref);
52315232 proc->context = &binder_dev->context;
52325233 binder_alloc_init(&proc->alloc);
52335234
@@ -5405,6 +5406,7 @@ static int binder_node_release(struct binder_node *node, int refs) · 171 unmodified lines
54055406 static void binder_deferred_release(struct binder_proc *proc)
54065407 {
54075408 struct binder_context *context = proc->context;
5409+ struct binder_device *device;
54085410 struct rb_node *n;
54095411 int threads, nodes, incoming_refs, outgoing_refs, active_transactions;
54105412
@@ -5421,6 +5423,12 @@ static void binder_deferred_release(struct binder_proc *proc) · 10 unmodified lines
54215423 context->binder_context_mgr_node = NULL;
54225424 }
54235425 mutex_unlock(&context->context_mgr_node_lock);
5426+ device = container_of(proc->context, struct binder_device, context);
5427+ if (refcount_dec_and_test(&device->ref)) {
5428+ kfree(context->name);
5429+ kfree(device);
5430+ }
5431+ proc->context = NULL;
54245432 binder_inner_proc_lock(proc);
54255433 /*
54265434 * Make sure proc stays alive after we
@@ -6077,6 +6085,7 @@ static int __init init_binder_device(const char *name) · 650 unmodified lines
60776085 binder_device->miscdev.minor = MISC_DYNAMIC_MINOR;
60786086 binder_device->miscdev.name = name;
60796087
6088+ refcount_set(&binder_device->ref, 1);
60806089 binder_device->context.binder_context_mgr_uid = INVALID_UID;
60816090 binder_device->context.name = name;
60826091 mutex_init(&binder_device->context.context_mgr_node_lock);
drivers/android/binder_internal.h+2−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/list.h>
99 #include <linux/miscdevice.h>
1010 #include <linux/mutex.h>
11+#include <linux/refcount.h>
1112 #include <linux/stddef.h>
1213 #include <linux/types.h>
1314 #include <linux/uidgid.h>
@@ -33,6 +34,7 @@ struct binder_device { · 19 unmodified lines
3334 struct miscdevice miscdev;
3435 struct binder_context context;
3536 struct inode *binderfs_inode;
37+ refcount_t ref;
3638 };
3739
3840 /**
drivers/android/binderfs.c+6−2
@@ -154,6 +154,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 153 unmodified lines
154154 if (!name)
155155 goto err;
156156
157+ refcount_set(&device->ref, 1);
157158 device->binderfs_inode = inode;
158159 device->context.binder_context_mgr_uid = INVALID_UID;
159160 device->context.name = name;
@@ -257,8 +258,10 @@ static void binderfs_evict_inode(struct inode *inode) · 97 unmodified lines
257258 ida_free(&binderfs_minors, device->miscdev.minor);
258259 mutex_unlock(&binderfs_minors_mutex);
259260
260− kfree(device->context.name);
261− kfree(device);
261+ if (refcount_dec_and_test(&device->ref)) {
262+ kfree(device->context.name);
263+ kfree(device);
264+ }
262265 }
263266
264267 /**
@@ -445,6 +448,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) · 180 unmodified lines
445448 inode->i_uid = info->root_uid;
446449 inode->i_gid = info->root_gid;
447450
451+ refcount_set(&device->ref, 1);
448452 device->binderfs_inode = inode;
449453 device->miscdev.minor = minor;
450454
drivers/atm/nicstar.c+1−1
@@ -91,7 +91,7 @@ · 90 unmodified lines
9191 #ifdef GENERAL_DEBUG
9292 #define PRINTK(args...) printk(args)
9393 #else
94−#define PRINTK(args...)
94+#define PRINTK(args...) do {} while (0)
9595 #endif /* GENERAL_DEBUG */
9696
9797 #ifdef EXTRA_DEBUG
drivers/auxdisplay/Kconfig+8−8
@@ -111,7 +111,7 @@ config CFAG12864B · 110 unmodified lines
111111 If unsure, say N.
112112
113113 config CFAG12864B_RATE
114− int "Refresh rate (hertz)"
114+ int "Refresh rate (hertz)"
115115 depends on CFAG12864B
116116 default "20"
117117 ---help---
@@ -329,7 +329,7 @@ config PANEL_LCD_PROTO · 211 unmodified lines
329329
330330 config PANEL_LCD_PIN_E
331331 depends on PANEL_PROFILE="0" && PANEL_LCD="1" && PANEL_LCD_PROTO="0"
332− int "Parallel port pin number & polarity connected to the LCD E signal (-17...17) "
332+ int "Parallel port pin number & polarity connected to the LCD E signal (-17...17) "
333333 range -17 17
334334 default 14
335335 ---help---
@@ -344,7 +344,7 @@ config PANEL_LCD_PIN_E · 8 unmodified lines
344344
345345 config PANEL_LCD_PIN_RS
346346 depends on PANEL_PROFILE="0" && PANEL_LCD="1" && PANEL_LCD_PROTO="0"
347− int "Parallel port pin number & polarity connected to the LCD RS signal (-17...17) "
347+ int "Parallel port pin number & polarity connected to the LCD RS signal (-17...17) "
348348 range -17 17
349349 default 17
350350 ---help---
@@ -359,7 +359,7 @@ config PANEL_LCD_PIN_RS · 8 unmodified lines
359359
360360 config PANEL_LCD_PIN_RW
361361 depends on PANEL_PROFILE="0" && PANEL_LCD="1" && PANEL_LCD_PROTO="0"
362− int "Parallel port pin number & polarity connected to the LCD RW signal (-17...17) "
362+ int "Parallel port pin number & polarity connected to the LCD RW signal (-17...17) "
363363 range -17 17
364364 default 16
365365 ---help---
@@ -374,7 +374,7 @@ config PANEL_LCD_PIN_RW · 8 unmodified lines
374374
375375 config PANEL_LCD_PIN_SCL
376376 depends on PANEL_PROFILE="0" && PANEL_LCD="1" && PANEL_LCD_PROTO!="0"
377− int "Parallel port pin number & polarity connected to the LCD SCL signal (-17...17) "
377+ int "Parallel port pin number & polarity connected to the LCD SCL signal (-17...17) "
378378 range -17 17
379379 default 1
380380 ---help---
@@ -389,7 +389,7 @@ config PANEL_LCD_PIN_SCL · 8 unmodified lines
389389
390390 config PANEL_LCD_PIN_SDA
391391 depends on PANEL_PROFILE="0" && PANEL_LCD="1" && PANEL_LCD_PROTO!="0"
392− int "Parallel port pin number & polarity connected to the LCD SDA signal (-17...17) "
392+ int "Parallel port pin number & polarity connected to the LCD SDA signal (-17...17) "
393393 range -17 17
394394 default 2
395395 ---help---
@@ -404,12 +404,12 @@ config PANEL_LCD_PIN_SDA · 8 unmodified lines
404404
405405 config PANEL_LCD_PIN_BL
406406 depends on PANEL_PROFILE="0" && PANEL_LCD="1"
407− int "Parallel port pin number & polarity connected to the LCD backlight signal (-17...17) "
407+ int "Parallel port pin number & polarity connected to the LCD backlight signal (-17...17) "
408408 range -17 17
409409 default 0
410410 ---help---
411411 This describes the number of the parallel port pin to which the LCD 'BL' signal
412− has been connected. It can be :
412+ has been connected. It can be :
413413
414414 0 : no connection (eg: connected to ground)
415415 1..17 : directly connected to any of these pins on the DB25 plug
drivers/auxdisplay/charlcd.c+1−1
@@ -88,7 +88,7 @@ struct charlcd_priv { · 87 unmodified lines
8888 int len;
8989 } esc_seq;
9090
91− unsigned long long drvdata[0];
91+ unsigned long long drvdata[];
9292 };
9393
9494 #define charlcd_to_priv(p) container_of(p, struct charlcd_priv, lcd)
drivers/auxdisplay/img-ascii-lcd.c+1−3
@@ -356,7 +356,6 @@ static int img_ascii_lcd_probe(struct platform_device *pdev) · 355 unmodified lines
356356 const struct of_device_id *match;
357357 const struct img_ascii_lcd_config *cfg;
358358 struct img_ascii_lcd_ctx *ctx;
359− struct resource *res;
360359 int err;
361360
362361 match = of_match_device(img_ascii_lcd_matches, &pdev->dev);
@@ -378,8 +377,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev) · 15 unmodified lines
378377 &ctx->offset))
379378 return -EINVAL;
380379 } else {
381− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
382− ctx->base = devm_ioremap_resource(&pdev->dev, res);
380+ ctx->base = devm_platform_ioremap_resource(pdev, 0);
383381 if (IS_ERR(ctx->base))
384382 return PTR_ERR(ctx->base);
385383 }
drivers/base/core.c+20−7
@@ -718,6 +718,8 @@ static void __device_links_queue_sync_state(struct device *dev, · 717 unmodified lines
718718 {
719719 struct device_link *link;
720720
721+ if (!dev_has_sync_state(dev))
722+ return;
721723 if (dev->state_synced)
722724 return;
723725
@@ -745,25 +747,31 @@ static void __device_links_queue_sync_state(struct device *dev, · 21 unmodified lines
745747 /**
746748 * device_links_flush_sync_list - Call sync_state() on a list of devices
747749 * @list: List of devices to call sync_state() on
750+ * @dont_lock_dev: Device for which lock is already held by the caller
748751 *
749752 * Calls sync_state() on all the devices that have been queued for it. This
750− * function is used in conjunction with __device_links_queue_sync_state().
753+ * function is used in conjunction with __device_links_queue_sync_state(). The
754+ * @dont_lock_dev parameter is useful when this function is called from a
755+ * context where a device lock is already held.
751756 */
752−static void device_links_flush_sync_list(struct list_head *list)
757+static void device_links_flush_sync_list(struct list_head *list,
758+ struct device *dont_lock_dev)
753759 {
754760 struct device *dev, *tmp;
755761
756762 list_for_each_entry_safe(dev, tmp, list, links.defer_sync) {
757763 list_del_init(&dev->links.defer_sync);
758764
759− device_lock(dev);
765+ if (dev != dont_lock_dev)
766+ device_lock(dev);
760767
761768 if (dev->bus->sync_state)
762769 dev->bus->sync_state(dev);
763770 else if (dev->driver && dev->driver->sync_state)
764771 dev->driver->sync_state(dev);
765772
766− device_unlock(dev);
773+ if (dev != dont_lock_dev)
774+ device_unlock(dev);
767775
768776 put_device(dev);
769777 }
@@ -801,7 +809,7 @@ void device_links_supplier_sync_state_resume(void) · 31 unmodified lines
801809 out:
802810 device_links_write_unlock();
803811
804− device_links_flush_sync_list(&sync_list);
812+ device_links_flush_sync_list(&sync_list, NULL);
805813 }
806814
807815 static int sync_state_resume_initcall(void)
@@ -813,7 +821,7 @@ late_initcall(sync_state_resume_initcall); · 5 unmodified lines
813821
814822 static void __device_links_supplier_defer_sync(struct device *sup)
815823 {
816− if (list_empty(&sup->links.defer_sync))
824+ if (list_empty(&sup->links.defer_sync) && dev_has_sync_state(sup))
817825 list_add_tail(&sup->links.defer_sync, &deferred_sync);
818826 }
819827
@@ -865,6 +873,11 @@ void device_links_driver_bound(struct device *dev) · 45 unmodified lines
865873 driver_deferred_probe_add(link->consumer);
866874 }
867875
876+ if (defer_sync_state_count)
877+ __device_links_supplier_defer_sync(dev);
878+ else
879+ __device_links_queue_sync_state(dev, &sync_list);
880+
868881 list_for_each_entry(link, &dev->links.suppliers, c_node) {
869882 if (!(link->flags & DL_FLAG_MANAGED))
870883 continue;
@@ -883,7 +896,7 @@ void device_links_driver_bound(struct device *dev) · 12 unmodified lines
883896
884897 device_links_write_unlock();
885898
886− device_links_flush_sync_list(&sync_list);
899+ device_links_flush_sync_list(&sync_list, dev);
887900 }
888901
889902 static void device_link_drop_managed(struct device_link *link)
drivers/base/platform.c+6−19
@@ -363,10 +363,10 @@ static void setup_pdev_dma_masks(struct platform_device *pdev) · 362 unmodified lines
363363 {
364364 if (!pdev->dev.coherent_dma_mask)
365365 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
366− if (!pdev->dma_mask)
367− pdev->dma_mask = DMA_BIT_MASK(32);
368− if (!pdev->dev.dma_mask)
369− pdev->dev.dma_mask = &pdev->dma_mask;
366+ if (!pdev->dev.dma_mask) {
367+ pdev->platform_dma_mask = DMA_BIT_MASK(32);
368+ pdev->dev.dma_mask = &pdev->platform_dma_mask;
369+ }
370370 };
371371
372372 /**
@@ -662,20 +662,8 @@ struct platform_device *platform_device_register_full( · 289 unmodified lines
662662 pdev->dev.of_node_reused = pdevinfo->of_node_reused;
663663
664664 if (pdevinfo->dma_mask) {
665− /*
666− * This memory isn't freed when the device is put,
667− * I don't have a nice idea for that though. Conceptually
668− * dma_mask in struct device should not be a pointer.
669− * See http://thread.gmane.org/gmane.linux.kernel.pci/9081
670− */
671− pdev->dev.dma_mask =
672− kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
673− if (!pdev->dev.dma_mask)
674− goto err;
675−
676− kmemleak_ignore(pdev->dev.dma_mask);
677−
678− *pdev->dev.dma_mask = pdevinfo->dma_mask;
665+ pdev->platform_dma_mask = pdevinfo->dma_mask;
666+ pdev->dev.dma_mask = &pdev->platform_dma_mask;
679667 pdev->dev.coherent_dma_mask = pdevinfo->dma_mask;
680668 }
681669
@@ -700,7 +688,6 @@ struct platform_device *platform_device_register_full( · 18 unmodified lines
700688 if (ret) {
701689 err:
702690 ACPI_COMPANION_SET(&pdev->dev, NULL);
703− kfree(pdev->dev.dma_mask);
704691 platform_device_put(pdev);
705692 return ERR_PTR(ret);
706693 }
drivers/base/swnode.c+7−7
@@ -608,6 +608,13 @@ static void software_node_release(struct kobject *kobj) · 607 unmodified lines
608608 {
609609 struct swnode *swnode = kobj_to_swnode(kobj);
610610
611+ if (swnode->parent) {
612+ ida_simple_remove(&swnode->parent->child_ids, swnode->id);
613+ list_del(&swnode->entry);
614+ } else {
615+ ida_simple_remove(&swnode_root_ids, swnode->id);
616+ }
617+
611618 if (swnode->allocated) {
612619 property_entries_free(swnode->node->properties);
613620 kfree(swnode->node);
@@ -773,13 +780,6 @@ void fwnode_remove_software_node(struct fwnode_handle *fwnode) · 159 unmodified lines
773780 if (!swnode)
774781 return;
775782
776− if (swnode->parent) {
777− ida_simple_remove(&swnode->parent->child_ids, swnode->id);
778− list_del(&swnode->entry);
779− } else {
780− ida_simple_remove(&swnode_root_ids, swnode->id);
781− }
782−
783783 kobject_put(&swnode->kobj);
784784 }
785785 EXPORT_SYMBOL_GPL(fwnode_remove_software_node);
drivers/block/floppy.c+5−2
@@ -853,14 +853,17 @@ static void reset_fdc_info(int mode) · 852 unmodified lines
853853 /* selects the fdc and drive, and enables the fdc's input/dma. */
854854 static void set_fdc(int drive)
855855 {
856+ unsigned int new_fdc = fdc;
857+
856858 if (drive >= 0 && drive < N_DRIVE) {
857− fdc = FDC(drive);
859+ new_fdc = FDC(drive);
858860 current_drive = drive;
859861 }
860− if (fdc != 1 && fdc != 0) {
862+ if (new_fdc >= N_FDC) {
861863 pr_info("bad fdc value\n");
862864 return;
863865 }
866+ fdc = new_fdc;
864867 set_dor(fdc, ~0, 8);
865868 #if N_FDC > 1
866869 set_dor(1 - fdc, ~8, 0);
drivers/block/null_blk.h+0−3
@@ -14,9 +14,6 @@ · 13 unmodified lines
1414 #include <linux/fault-inject.h>
1515
1616 struct nullb_cmd {
17− struct list_head list;
18− struct llist_node ll_list;
19− struct __call_single_data csd;
2017 struct request *rq;
2118 struct bio *bio;
2219 unsigned int tag;
drivers/block/null_blk_main.c+0−2
@@ -1518,8 +1518,6 @@ static int setup_commands(struct nullb_queue *nq) · 1517 unmodified lines
15181518
15191519 for (i = 0; i < nq->queue_depth; i++) {
15201520 cmd = &nq->cmds[i];
1521− INIT_LIST_HEAD(&cmd->list);
1522− cmd->ll_list.next = NULL;
15231521 cmd->tag = -1U;
15241522 }
15251523
drivers/block/paride/pcd.c+1−1
@@ -276,7 +276,7 @@ static const struct block_device_operations pcd_bdops = { · 275 unmodified lines
276276 .release = pcd_block_release,
277277 .ioctl = pcd_block_ioctl,
278278 #ifdef CONFIG_COMPAT
279− .ioctl = blkdev_compat_ptr_ioctl,
279+ .compat_ioctl = blkdev_compat_ptr_ioctl,
280280 #endif
281281 .check_events = pcd_block_check_events,
282282 };
drivers/block/virtio_blk.c+12−5
@@ -245,13 +245,20 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, · 244 unmodified lines
245245 err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
246246 if (err) {
247247 virtqueue_kick(vblk->vqs[qid].vq);
248− blk_mq_stop_hw_queue(hctx);
248+ /* Don't stop the queue if -ENOMEM: we may have failed to
249+ * bounce the buffer due to global resource outage.
250+ */
251+ if (err == -ENOSPC)
252+ blk_mq_stop_hw_queue(hctx);
249253 spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
250− /* Out of mem doesn't actually happen, since we fall back
251− * to direct descriptors */
252− if (err == -ENOMEM || err == -ENOSPC)
254+ switch (err) {
255+ case -ENOSPC:
253256 return BLK_STS_DEV_RESOURCE;
254− return BLK_STS_IOERR;
257+ case -ENOMEM:
258+ return BLK_STS_RESOURCE;
259+ default:
260+ return BLK_STS_IOERR;
261+ }
255262 }
256263
257264 if (bd->last && virtqueue_kick_prepare(vblk->vqs[qid].vq))
drivers/block/xen-blkfront.c+42−38
@@ -213,6 +213,7 @@ struct blkfront_info · 212 unmodified lines
213213 struct blk_mq_tag_set tag_set;
214214 struct blkfront_ring_info *rinfo;
215215 unsigned int nr_rings;
216+ unsigned int rinfo_size;
216217 /* Save uncomplete reqs and bios for migration. */
217218 struct list_head requests;
218219 struct bio_list bio_list;
@@ -259,6 +260,18 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo); · 40 unmodified lines
259260 static void blkfront_gather_backend_features(struct blkfront_info *info);
260261 static int negotiate_mq(struct blkfront_info *info);
261262
263+#define for_each_rinfo(info, ptr, idx) \
264+ for ((ptr) = (info)->rinfo, (idx) = 0; \
265+ (idx) < (info)->nr_rings; \
266+ (idx)++, (ptr) = (void *)(ptr) + (info)->rinfo_size)
267+
268+static inline struct blkfront_ring_info *
269+get_rinfo(const struct blkfront_info *info, unsigned int i)
270+{
271+ BUG_ON(i >= info->nr_rings);
272+ return (void *)info->rinfo + i * info->rinfo_size;
273+}
274+
262275 static int get_id_from_freelist(struct blkfront_ring_info *rinfo)
263276 {
264277 unsigned long free = rinfo->shadow_free;
@@ -883,8 +896,7 @@ static blk_status_t blkif_queue_rq(struct blk_mq_hw_ctx *hctx, · 618 unmodified lines
883896 struct blkfront_info *info = hctx->queue->queuedata;
884897 struct blkfront_ring_info *rinfo = NULL;
885898
886− BUG_ON(info->nr_rings <= qid);
887− rinfo = &info->rinfo[qid];
899+ rinfo = get_rinfo(info, qid);
888900 blk_mq_start_request(qd->rq);
889901 spin_lock_irqsave(&rinfo->ring_lock, flags);
890902 if (RING_FULL(&rinfo->ring))
@@ -1181,6 +1193,7 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, · 290 unmodified lines
11811193 static void xlvbd_release_gendisk(struct blkfront_info *info)
11821194 {
11831195 unsigned int minor, nr_minors, i;
1196+ struct blkfront_ring_info *rinfo;
11841197
11851198 if (info->rq == NULL)
11861199 return;
@@ -1188,9 +1201,7 @@ static void xlvbd_release_gendisk(struct blkfront_info *info) · 1 unmodified line
11881201 /* No more blkif_request(). */
11891202 blk_mq_stop_hw_queues(info->rq);
11901203
1191− for (i = 0; i < info->nr_rings; i++) {
1192− struct blkfront_ring_info *rinfo = &info->rinfo[i];
1193−
1204+ for_each_rinfo(info, rinfo, i) {
11941205 /* No more gnttab callback work. */
11951206 gnttab_cancel_free_callback(&rinfo->callback);
11961207
@@ -1339,6 +1350,7 @@ free_shadow: · 142 unmodified lines
13391350 static void blkif_free(struct blkfront_info *info, int suspend)
13401351 {
13411352 unsigned int i;
1353+ struct blkfront_ring_info *rinfo;
13421354
13431355 /* Prevent new requests being issued until we fix things up. */
13441356 info->connected = suspend ?
@@ -1347,8 +1359,8 @@ static void blkif_free(struct blkfront_info *info, int suspend) · 2 unmodified lines
13471359 if (info->rq)
13481360 blk_mq_stop_hw_queues(info->rq);
13491361
1350− for (i = 0; i < info->nr_rings; i++)
1351− blkif_free_ring(&info->rinfo[i]);
1362+ for_each_rinfo(info, rinfo, i)
1363+ blkif_free_ring(rinfo);
13521364
13531365 kvfree(info->rinfo);
13541366 info->rinfo = NULL;
@@ -1775,6 +1787,7 @@ static int talk_to_blkback(struct xenbus_device *dev, · 420 unmodified lines
17751787 int err;
17761788 unsigned int i, max_page_order;
17771789 unsigned int ring_page_order;
1790+ struct blkfront_ring_info *rinfo;
17781791
17791792 if (!info)
17801793 return -ENODEV;
@@ -1788,9 +1801,7 @@ static int talk_to_blkback(struct xenbus_device *dev, · 7 unmodified lines
17881801 if (err)
17891802 goto destroy_blkring;
17901803
1791− for (i = 0; i < info->nr_rings; i++) {
1792− struct blkfront_ring_info *rinfo = &info->rinfo[i];
1793−
1804+ for_each_rinfo(info, rinfo, i) {
17941805 /* Create shared ring, alloc event channel. */
17951806 err = setup_blkring(dev, rinfo);
17961807 if (err)
@@ -1815,7 +1826,7 @@ again: · 18 unmodified lines
18151826
18161827 /* We already got the number of queues/rings in _probe */
18171828 if (info->nr_rings == 1) {
1818− err = write_per_ring_nodes(xbt, &info->rinfo[0], dev->nodename);
1829+ err = write_per_ring_nodes(xbt, info->rinfo, dev->nodename);
18191830 if (err)
18201831 goto destroy_blkring;
18211832 } else {
@@ -1837,10 +1848,10 @@ again: · 15 unmodified lines
18371848 goto abort_transaction;
18381849 }
18391850
1840− for (i = 0; i < info->nr_rings; i++) {
1851+ for_each_rinfo(info, rinfo, i) {
18411852 memset(path, 0, pathsize);
18421853 snprintf(path, pathsize, "%s/queue-%u", dev->nodename, i);
1843− err = write_per_ring_nodes(xbt, &info->rinfo[i], path);
1854+ err = write_per_ring_nodes(xbt, rinfo, path);
18441855 if (err) {
18451856 kfree(path);
18461857 goto destroy_blkring;
@@ -1868,9 +1879,8 @@ again: · 21 unmodified lines
18681879 goto destroy_blkring;
18691880 }
18701881
1871− for (i = 0; i < info->nr_rings; i++) {
1882+ for_each_rinfo(info, rinfo, i) {
18721883 unsigned int j;
1873− struct blkfront_ring_info *rinfo = &info->rinfo[i];
18741884
18751885 for (j = 0; j < BLK_RING_SIZE(info); j++)
18761886 rinfo->shadow[j].req.u.rw.id = j + 1;
@@ -1900,6 +1910,7 @@ static int negotiate_mq(struct blkfront_info *info) · 23 unmodified lines
19001910 {
19011911 unsigned int backend_max_queues;
19021912 unsigned int i;
1913+ struct blkfront_ring_info *rinfo;
19031914
19041915 BUG_ON(info->nr_rings);
19051916
@@ -1911,20 +1922,16 @@ static int negotiate_mq(struct blkfront_info *info) · 5 unmodified lines
19111922 if (!info->nr_rings)
19121923 info->nr_rings = 1;
19131924
1914− info->rinfo = kvcalloc(info->nr_rings,
1915− struct_size(info->rinfo, shadow,
1916− BLK_RING_SIZE(info)),
1917− GFP_KERNEL);
1925+ info->rinfo_size = struct_size(info->rinfo, shadow,
1926+ BLK_RING_SIZE(info));
1927+ info->rinfo = kvcalloc(info->nr_rings, info->rinfo_size, GFP_KERNEL);
19181928 if (!info->rinfo) {
19191929 xenbus_dev_fatal(info->xbdev, -ENOMEM, "allocating ring_info structure");
19201930 info->nr_rings = 0;
19211931 return -ENOMEM;
19221932 }
19231933
1924− for (i = 0; i < info->nr_rings; i++) {
1925− struct blkfront_ring_info *rinfo;
1926−
1927− rinfo = &info->rinfo[i];
1934+ for_each_rinfo(info, rinfo, i) {
19281935 INIT_LIST_HEAD(&rinfo->indirect_pages);
19291936 INIT_LIST_HEAD(&rinfo->grants);
19301937 rinfo->dev_info = info;
@@ -2017,6 +2024,7 @@ static int blkif_recover(struct blkfront_info *info) · 86 unmodified lines
20172024 int rc;
20182025 struct bio *bio;
20192026 unsigned int segs;
2027+ struct blkfront_ring_info *rinfo;
20202028
20212029 blkfront_gather_backend_features(info);
20222030 /* Reset limits changed by blk_mq_update_nr_hw_queues(). */
@@ -2024,9 +2032,7 @@ static int blkif_recover(struct blkfront_info *info) · 1 unmodified line
20242032 segs = info->max_indirect_segments ? : BLKIF_MAX_SEGMENTS_PER_REQUEST;
20252033 blk_queue_max_segments(info->rq, segs / GRANTS_PER_PSEG);
20262034
2027− for (r_index = 0; r_index < info->nr_rings; r_index++) {
2028− struct blkfront_ring_info *rinfo = &info->rinfo[r_index];
2029−
2035+ for_each_rinfo(info, rinfo, r_index) {
20302036 rc = blkfront_setup_indirect(rinfo);
20312037 if (rc)
20322038 return rc;
@@ -2036,10 +2042,7 @@ static int blkif_recover(struct blkfront_info *info) · 3 unmodified lines
20362042 /* Now safe for us to use the shared ring */
20372043 info->connected = BLKIF_STATE_CONNECTED;
20382044
2039− for (r_index = 0; r_index < info->nr_rings; r_index++) {
2040− struct blkfront_ring_info *rinfo;
2041−
2042− rinfo = &info->rinfo[r_index];
2045+ for_each_rinfo(info, rinfo, r_index) {
20432046 /* Kick any other new requests queued since we resumed */
20442047 kick_pending_request_queues(rinfo);
20452048 }
@@ -2072,13 +2075,13 @@ static int blkfront_resume(struct xenbus_device *dev) · 26 unmodified lines
20722075 struct blkfront_info *info = dev_get_drvdata(&dev->dev);
20732076 int err = 0;
20742077 unsigned int i, j;
2078+ struct blkfront_ring_info *rinfo;
20752079
20762080 dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename);
20772081
20782082 bio_list_init(&info->bio_list);
20792083 INIT_LIST_HEAD(&info->requests);
2080− for (i = 0; i < info->nr_rings; i++) {
2081− struct blkfront_ring_info *rinfo = &info->rinfo[i];
2084+ for_each_rinfo(info, rinfo, i) {
20822085 struct bio_list merge_bio;
20832086 struct blk_shadow *shadow = rinfo->shadow;
20842087
@@ -2337,6 +2340,7 @@ static void blkfront_connect(struct blkfront_info *info) · 252 unmodified lines
23372340 unsigned int binfo;
23382341 char *envp[] = { "RESIZE=1", NULL };
23392342 int err, i;
2343+ struct blkfront_ring_info *rinfo;
23402344
23412345 switch (info->connected) {
23422346 case BLKIF_STATE_CONNECTED:
@@ -2394,8 +2398,8 @@ static void blkfront_connect(struct blkfront_info *info) · 51 unmodified lines
23942398 "physical-sector-size",
23952399 sector_size);
23962400 blkfront_gather_backend_features(info);
2397− for (i = 0; i < info->nr_rings; i++) {
2398− err = blkfront_setup_indirect(&info->rinfo[i]);
2401+ for_each_rinfo(info, rinfo, i) {
2402+ err = blkfront_setup_indirect(rinfo);
23992403 if (err) {
24002404 xenbus_dev_fatal(info->xbdev, err, "setup_indirect at %s",
24012405 info->xbdev->otherend);
@@ -2416,8 +2420,8 @@ static void blkfront_connect(struct blkfront_info *info) · 14 unmodified lines
24162420
24172421 /* Kick pending requests. */
24182422 info->connected = BLKIF_STATE_CONNECTED;
2419− for (i = 0; i < info->nr_rings; i++)
2420− kick_pending_request_queues(&info->rinfo[i]);
2423+ for_each_rinfo(info, rinfo, i)
2424+ kick_pending_request_queues(rinfo);
24212425
24222426 device_add_disk(&info->xbdev->dev, info->gd, NULL);
24232427
@@ -2652,9 +2656,9 @@ static void purge_persistent_grants(struct blkfront_info *info) · 228 unmodified lines
26522656 {
26532657 unsigned int i;
26542658 unsigned long flags;
2659+ struct blkfront_ring_info *rinfo;
26552660
2656− for (i = 0; i < info->nr_rings; i++) {
2657− struct blkfront_ring_info *rinfo = &info->rinfo[i];
2661+ for_each_rinfo(info, rinfo, i) {
26582662 struct grant *gnt_list_entry, *tmp;
26592663
26602664 spin_lock_irqsave(&rinfo->ring_lock, flags);
drivers/bus/ti-sysc.c+2−2
@@ -1400,7 +1400,7 @@ static void sysc_init_revision_quirks(struct sysc *ddata) · 1399 unmodified lines
14001400 }
14011401
14021402 /* 1-wire needs module's internal clocks enabled for reset */
1403−static void sysc_clk_enable_quirk_hdq1w(struct sysc *ddata)
1403+static void sysc_pre_reset_quirk_hdq1w(struct sysc *ddata)
14041404 {
14051405 int offset = 0x0c; /* HDQ_CTRL_STATUS */
14061406 u16 val;
@@ -1488,7 +1488,7 @@ static void sysc_init_module_quirks(struct sysc *ddata) · 81 unmodified lines
14881488 return;
14891489
14901490 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_HDQ1W) {
1491− ddata->clk_enable_quirk = sysc_clk_enable_quirk_hdq1w;
1491+ ddata->clk_disable_quirk = sysc_pre_reset_quirk_hdq1w;
14921492
14931493 return;
14941494 }
drivers/cdrom/gdrom.c+1−1
@@ -519,7 +519,7 @@ static const struct block_device_operations gdrom_bdops = { · 518 unmodified lines
519519 .check_events = gdrom_bdops_check_events,
520520 .ioctl = gdrom_bdops_ioctl,
521521 #ifdef CONFIG_COMPAT
522− .ioctl = blkdev_compat_ptr_ioctl,
522+ .compat_ioctl = blkdev_compat_ptr_ioctl,
523523 #endif
524524 };
525525
drivers/char/ipmi/ipmi_si_platform.c+2−2
@@ -194,7 +194,7 @@ static int platform_ipmi_probe(struct platform_device *pdev) · 193 unmodified lines
194194 else
195195 io.slave_addr = slave_addr;
196196
197− io.irq = platform_get_irq(pdev, 0);
197+ io.irq = platform_get_irq_optional(pdev, 0);
198198 if (io.irq > 0)
199199 io.irq_setup = ipmi_std_irq_setup;
200200 else
@@ -378,7 +378,7 @@ static int acpi_ipmi_probe(struct platform_device *pdev) · 177 unmodified lines
378378 io.irq = tmp;
379379 io.irq_setup = acpi_gpe_irq_setup;
380380 } else {
381− int irq = platform_get_irq(pdev, 0);
381+ int irq = platform_get_irq_optional(pdev, 0);
382382
383383 if (irq > 0) {
384384 io.irq = irq;
drivers/clk/clk.c+2−2
@@ -4713,7 +4713,7 @@ EXPORT_SYMBOL(of_clk_get_by_name); · 4712 unmodified lines
47134713 *
47144714 * Returns: The number of clocks that are possible parents of this node
47154715 */
4716−unsigned int of_clk_get_parent_count(struct device_node *np)
4716+unsigned int of_clk_get_parent_count(const struct device_node *np)
47174717 {
47184718 int count;
47194719
@@ -4725,7 +4725,7 @@ unsigned int of_clk_get_parent_count(struct device_node *np) · 5 unmodified lines
47254725 }
47264726 EXPORT_SYMBOL_GPL(of_clk_get_parent_count);
47274727
4728−const char *of_clk_get_parent_name(struct device_node *np, int index)
4728+const char *of_clk_get_parent_name(const struct device_node *np, int index)
47294729 {
47304730 struct of_phandle_args clkspec;
47314731 struct property *prop;
drivers/clk/qcom/dispcc-sc7180.c+0−19
@@ -592,24 +592,6 @@ static struct clk_branch disp_cc_mdss_rot_clk = { · 591 unmodified lines
592592 },
593593 };
594594
595−static struct clk_branch disp_cc_mdss_rscc_ahb_clk = {
596− .halt_reg = 0x400c,
597− .halt_check = BRANCH_HALT,
598− .clkr = {
599− .enable_reg = 0x400c,
600− .enable_mask = BIT(0),
601− .hw.init = &(struct clk_init_data){
602− .name = "disp_cc_mdss_rscc_ahb_clk",
603− .parent_data = &(const struct clk_parent_data){
604− .hw = &disp_cc_mdss_ahb_clk_src.clkr.hw,
605− },
606− .num_parents = 1,
607− .flags = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT,
608− .ops = &clk_branch2_ops,
609− },
610− },
611−};
612−
613595 static struct clk_branch disp_cc_mdss_rscc_vsync_clk = {
614596 .halt_reg = 0x4008,
615597 .halt_check = BRANCH_HALT,
@@ -687,7 +669,6 @@ static struct clk_regmap *disp_cc_sc7180_clocks[] = { · 71 unmodified lines
687669 [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
688670 [DISP_CC_MDSS_ROT_CLK] = &disp_cc_mdss_rot_clk.clkr,
689671 [DISP_CC_MDSS_ROT_CLK_SRC] = &disp_cc_mdss_rot_clk_src.clkr,
690− [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr,
691672 [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr,
692673 [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
693674 [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
drivers/clk/qcom/videocc-sc7180.c+1−1
@@ -97,7 +97,7 @@ static struct clk_branch video_cc_vcodec0_axi_clk = { · 96 unmodified lines
9797
9898 static struct clk_branch video_cc_vcodec0_core_clk = {
9999 .halt_reg = 0x890,
100− .halt_check = BRANCH_HALT,
100+ .halt_check = BRANCH_HALT_VOTED,
101101 .clkr = {
102102 .enable_reg = 0x890,
103103 .enable_mask = BIT(0),
drivers/cpufreq/cpufreq.c+10−2
@@ -1076,9 +1076,17 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy) · 1075 unmodified lines
10761076 pol = policy->last_policy;
10771077 } else if (def_gov) {
10781078 pol = cpufreq_parse_policy(def_gov->name);
1079− } else {
1080− return -ENODATA;
1079+ /*
1080+ * In case the default governor is neiter "performance"
1081+ * nor "powersave", fall back to the initial policy
1082+ * value set by the driver.
1083+ */
1084+ if (pol == CPUFREQ_POLICY_UNKNOWN)
1085+ pol = policy->policy;
10811086 }
1087+ if (pol != CPUFREQ_POLICY_PERFORMANCE &&
1088+ pol != CPUFREQ_POLICY_POWERSAVE)
1089+ return -ENODATA;
10821090 }
10831091
10841092 return cpufreq_set_policy(policy, gov, pol);
drivers/devfreq/devfreq.c+1−3
@@ -738,7 +738,6 @@ struct devfreq *devfreq_add_device(struct device *dev, · 737 unmodified lines
738738 {
739739 struct devfreq *devfreq;
740740 struct devfreq_governor *governor;
741− static atomic_t devfreq_no = ATOMIC_INIT(-1);
742741 int err = 0;
743742
744743 if (!dev || !profile || !governor_name) {
@@ -800,8 +799,7 @@ struct devfreq *devfreq_add_device(struct device *dev, · 55 unmodified lines
800799 devfreq->suspend_freq = dev_pm_opp_get_suspend_opp_freq(dev);
801800 atomic_set(&devfreq->suspend_count, 0);
802801
803− dev_set_name(&devfreq->dev, "devfreq%d",
804− atomic_inc_return(&devfreq_no));
802+ dev_set_name(&devfreq->dev, "%s", dev_name(dev));
805803 err = device_register(&devfreq->dev);
806804 if (err) {
807805 mutex_unlock(&devfreq->lock);
drivers/dma-buf/dma-buf.c+1−0
@@ -108,6 +108,7 @@ static int dma_buf_release(struct inode *inode, struct file *file) · 107 unmodified lines
108108 dma_resv_fini(dmabuf->resv);
109109
110110 module_put(dmabuf->owner);
111+ kfree(dmabuf->name);
111112 kfree(dmabuf);
112113 return 0;
113114 }
drivers/dma/coh901318.c+0−4
@@ -1947,8 +1947,6 @@ static void dma_tc_handle(struct coh901318_chan *cohc) · 1946 unmodified lines
19471947 return;
19481948 }
19491949
1950− spin_lock(&cohc->lock);
1951−
19521950 /*
19531951 * When we reach this point, at least one queue item
19541952 * should have been moved over from cohc->queue to
@@ -1969,8 +1967,6 @@ static void dma_tc_handle(struct coh901318_chan *cohc) · 14 unmodified lines
19691967 if (coh901318_queue_start(cohc) == NULL)
19701968 cohc->busy = 0;
19711969
1972− spin_unlock(&cohc->lock);
1973−
19741970 /*
19751971 * This tasklet will remove items from cohc->active
19761972 * and thus terminates them.
drivers/dma/idxd/cdev.c+2−2
@@ -204,6 +204,7 @@ static int idxd_wq_cdev_dev_setup(struct idxd_wq *wq) · 203 unmodified lines
204204 minor = ida_simple_get(&cdev_ctx->minor_ida, 0, MINORMASK, GFP_KERNEL);
205205 if (minor < 0) {
206206 rc = minor;
207+ kfree(dev);
207208 goto ida_err;
208209 }
209210
@@ -212,7 +213,6 @@ static int idxd_wq_cdev_dev_setup(struct idxd_wq *wq) · 2 unmodified lines
212213 rc = device_register(dev);
213214 if (rc < 0) {
214215 dev_err(&idxd->pdev->dev, "device register failed\n");
215− put_device(dev);
216216 goto dev_reg_err;
217217 }
218218 idxd_cdev->minor = minor;
@@ -221,8 +221,8 @@ static int idxd_wq_cdev_dev_setup(struct idxd_wq *wq) · 2 unmodified lines
221221
222222 dev_reg_err:
223223 ida_simple_remove(&cdev_ctx->minor_ida, MINOR(dev->devt));
224+ put_device(dev);
224225 ida_err:
225− kfree(dev);
226226 idxd_cdev->dev = NULL;
227227 return rc;
228228 }
drivers/dma/idxd/sysfs.c+23−4
@@ -124,6 +124,7 @@ static int idxd_config_bus_probe(struct device *dev) · 123 unmodified lines
124124 rc = idxd_device_config(idxd);
125125 if (rc < 0) {
126126 spin_unlock_irqrestore(&idxd->dev_lock, flags);
127+ module_put(THIS_MODULE);
127128 dev_warn(dev, "Device config failed: %d\n", rc);
128129 return rc;
129130 }
@@ -132,6 +133,7 @@ static int idxd_config_bus_probe(struct device *dev) · 2 unmodified lines
132133 rc = idxd_device_enable(idxd);
133134 if (rc < 0) {
134135 spin_unlock_irqrestore(&idxd->dev_lock, flags);
136+ module_put(THIS_MODULE);
135137 dev_warn(dev, "Device enable failed: %d\n", rc);
136138 return rc;
137139 }
@@ -142,6 +144,7 @@ static int idxd_config_bus_probe(struct device *dev) · 4 unmodified lines
142144 rc = idxd_register_dma_device(idxd);
143145 if (rc < 0) {
144146 spin_unlock_irqrestore(&idxd->dev_lock, flags);
147+ module_put(THIS_MODULE);
145148 dev_dbg(dev, "Failed to register dmaengine device\n");
146149 return rc;
147150 }
@@ -516,7 +519,7 @@ static ssize_t group_tokens_reserved_store(struct device *dev, · 368 unmodified lines
516519 if (val > idxd->max_tokens)
517520 return -EINVAL;
518521
519− if (val > idxd->nr_tokens)
522+ if (val > idxd->nr_tokens + group->tokens_reserved)
520523 return -EINVAL;
521524
522525 group->tokens_reserved = val;
@@ -901,6 +904,20 @@ static ssize_t wq_size_show(struct device *dev, struct device_attribute *attr, · 378 unmodified lines
901904 return sprintf(buf, "%u\n", wq->size);
902905 }
903906
907+static int total_claimed_wq_size(struct idxd_device *idxd)
908+{
909+ int i;
910+ int wq_size = 0;
911+
912+ for (i = 0; i < idxd->max_wqs; i++) {
913+ struct idxd_wq *wq = &idxd->wqs[i];
914+
915+ wq_size += wq->size;
916+ }
917+
918+ return wq_size;
919+}
920+
904921 static ssize_t wq_size_store(struct device *dev,
905922 struct device_attribute *attr, const char *buf,
906923 size_t count)
@@ -920,7 +937,7 @@ static ssize_t wq_size_store(struct device *dev, · 13 unmodified lines
920937 if (wq->state != IDXD_WQ_DISABLED)
921938 return -EPERM;
922939
923− if (size > idxd->max_wq_size)
940+ if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size)
924941 return -EINVAL;
925942
926943 wq->size = size;
@@ -999,12 +1016,14 @@ static ssize_t wq_type_store(struct device *dev, · 72 unmodified lines
9991016 return -EPERM;
10001017
10011018 old_type = wq->type;
1002− if (sysfs_streq(buf, idxd_wq_type_names[IDXD_WQT_KERNEL]))
1019+ if (sysfs_streq(buf, idxd_wq_type_names[IDXD_WQT_NONE]))
1020+ wq->type = IDXD_WQT_NONE;
1021+ else if (sysfs_streq(buf, idxd_wq_type_names[IDXD_WQT_KERNEL]))
10031022 wq->type = IDXD_WQT_KERNEL;
10041023 else if (sysfs_streq(buf, idxd_wq_type_names[IDXD_WQT_USER]))
10051024 wq->type = IDXD_WQT_USER;
10061025 else
1007− wq->type = IDXD_WQT_NONE;
1026+ return -EINVAL;
10081027
10091028 /* If we are changing queue type, clear the name */
10101029 if (wq->type != old_type)
drivers/dma/imx-sdma.c+3−2
@@ -1331,13 +1331,14 @@ static void sdma_free_chan_resources(struct dma_chan *chan) · 1330 unmodified lines
13311331
13321332 sdma_channel_synchronize(chan);
13331333
1334− if (sdmac->event_id0)
1334+ if (sdmac->event_id0 >= 0)
13351335 sdma_event_disable(sdmac, sdmac->event_id0);
13361336 if (sdmac->event_id1)
13371337 sdma_event_disable(sdmac, sdmac->event_id1);
13381338
13391339 sdmac->event_id0 = 0;
13401340 sdmac->event_id1 = 0;
1341+ sdmac->context_loaded = false;
13411342
13421343 sdma_set_channel_priority(sdmac, 0);
13431344
@@ -1631,7 +1632,7 @@ static int sdma_config(struct dma_chan *chan, · 287 unmodified lines
16311632 memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
16321633
16331634 /* Set ENBLn earlier to make sure dma request triggered after that */
1634− if (sdmac->event_id0) {
1635+ if (sdmac->event_id0 >= 0) {
16351636 if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
16361637 return -EINVAL;
16371638 sdma_event_enable(sdmac, sdmac->event_id0);
drivers/dma/tegra20-apb-dma.c+1−5
@@ -281,7 +281,7 @@ static struct tegra_dma_desc *tegra_dma_desc_get( · 280 unmodified lines
281281
282282 /* Do not allocate if desc are waiting for ack */
283283 list_for_each_entry(dma_desc, &tdc->free_dma_desc, node) {
284− if (async_tx_test_ack(&dma_desc->txd)) {
284+ if (async_tx_test_ack(&dma_desc->txd) && !dma_desc->cb_count) {
285285 list_del(&dma_desc->node);
286286 spin_unlock_irqrestore(&tdc->lock, flags);
287287 dma_desc->txd.flags = 0;
@@ -756,10 +756,6 @@ static int tegra_dma_terminate_all(struct dma_chan *dc) · 468 unmodified lines
756756 bool was_busy;
757757
758758 spin_lock_irqsave(&tdc->lock, flags);
759− if (list_empty(&tdc->pending_sg_req)) {
760− spin_unlock_irqrestore(&tdc->lock, flags);
761− return 0;
762− }
763759
764760 if (!tdc->busy)
765761 goto skip_dma_stop;
drivers/dma/ti/k3-udma.c+361−132
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 */
66
77 #include <linux/kernel.h>
8+#include <linux/delay.h>
89 #include <linux/dmaengine.h>
910 #include <linux/dma-mapping.h>
1011 #include <linux/dmapool.h>
@@ -96,6 +97,24 @@ struct udma_match_data { · 85 unmodified lines
9697 u32 level_start_idx[];
9798 };
9899
100+struct udma_hwdesc {
101+ size_t cppi5_desc_size;
102+ void *cppi5_desc_vaddr;
103+ dma_addr_t cppi5_desc_paddr;
104+
105+ /* TR descriptor internal pointers */
106+ void *tr_req_base;
107+ struct cppi5_tr_resp_t *tr_resp_base;
108+};
109+
110+struct udma_rx_flush {
111+ struct udma_hwdesc hwdescs[2];
112+
113+ size_t buffer_size;
114+ void *buffer_vaddr;
115+ dma_addr_t buffer_paddr;
116+};
117+
99118 struct udma_dev {
100119 struct dma_device ddev;
101120 struct device *dev;
@@ -112,6 +131,8 @@ struct udma_dev { · 10 unmodified lines
112131 struct list_head desc_to_purge;
113132 spinlock_t lock;
114133
134+ struct udma_rx_flush rx_flush;
135+
115136 int tchan_cnt;
116137 int echan_cnt;
117138 int rchan_cnt;
@@ -130,16 +151,6 @@ struct udma_dev { · 12 unmodified lines
130151 u32 psil_base;
131152 };
132153
133−struct udma_hwdesc {
134− size_t cppi5_desc_size;
135− void *cppi5_desc_vaddr;
136− dma_addr_t cppi5_desc_paddr;
137−
138− /* TR descriptor internal pointers */
139− void *tr_req_base;
140− struct cppi5_tr_resp_t *tr_resp_base;
141−};
142−
143154 struct udma_desc {
144155 struct virt_dma_desc vd;
145156
@@ -169,7 +180,7 @@ enum udma_chan_state { · 23 unmodified lines
169180
170181 struct udma_tx_drain {
171182 struct delayed_work work;
172− unsigned long jiffie;
183+ ktime_t tstamp;
173184 u32 residue;
174185 };
175186
@@ -502,7 +513,7 @@ static bool udma_is_chan_paused(struct udma_chan *uc) · 326 unmodified lines
502513 {
503514 u32 val, pause_mask;
504515
505− switch (uc->desc->dir) {
516+ switch (uc->config.dir) {
506517 case DMA_DEV_TO_MEM:
507518 val = udma_rchanrt_read(uc->rchan,
508519 UDMA_RCHAN_RT_PEER_RT_EN_REG);
@@ -551,12 +562,17 @@ static void udma_sync_for_device(struct udma_chan *uc, int idx) · 42 unmodified lines
551562 }
552563 }
553564
565+static inline dma_addr_t udma_get_rx_flush_hwdesc_paddr(struct udma_chan *uc)
566+{
567+ return uc->ud->rx_flush.hwdescs[uc->config.pkt_mode].cppi5_desc_paddr;
568+}
569+
554570 static int udma_push_to_ring(struct udma_chan *uc, int idx)
555571 {
556572 struct udma_desc *d = uc->desc;
557−
558573 struct k3_ring *ring = NULL;
559− int ret = -EINVAL;
574+ dma_addr_t paddr;
575+ int ret;
560576
561577 switch (uc->config.dir) {
562578 case DMA_DEV_TO_MEM:
@@ -567,21 +583,37 @@ static int udma_push_to_ring(struct udma_chan *uc, int idx) · 4 unmodified lines
567583 ring = uc->tchan->t_ring;
568584 break;
569585 default:
570− break;
586+ return -EINVAL;
571587 }
572588
573− if (ring) {
574− dma_addr_t desc_addr = udma_curr_cppi5_desc_paddr(d, idx);
589+ /* RX flush packet: idx == -1 is only passed in case of DEV_TO_MEM */
590+ if (idx == -1) {
591+ paddr = udma_get_rx_flush_hwdesc_paddr(uc);
592+ } else {
593+ paddr = udma_curr_cppi5_desc_paddr(d, idx);
575594
576595 wmb(); /* Ensure that writes are not moved over this point */
577596 udma_sync_for_device(uc, idx);
578− ret = k3_ringacc_ring_push(ring, &desc_addr);
579− uc->in_ring_cnt++;
580597 }
581598
599+ ret = k3_ringacc_ring_push(ring, &paddr);
600+ if (!ret)
601+ uc->in_ring_cnt++;
602+
582603 return ret;
583604 }
584605
606+static bool udma_desc_is_rx_flush(struct udma_chan *uc, dma_addr_t addr)
607+{
608+ if (uc->config.dir != DMA_DEV_TO_MEM)
609+ return false;
610+
611+ if (addr == udma_get_rx_flush_hwdesc_paddr(uc))
612+ return true;
613+
614+ return false;
615+}
616+
585617 static int udma_pop_from_ring(struct udma_chan *uc, dma_addr_t *addr)
586618 {
587619 struct k3_ring *ring = NULL;
@@ -610,6 +642,10 @@ static int udma_pop_from_ring(struct udma_chan *uc, dma_addr_t *addr) · 22 unmodified lines
610642 if (cppi5_desc_is_tdcm(*addr))
611643 return ret;
612644
645+ /* Check for flush descriptor */
646+ if (udma_desc_is_rx_flush(uc, *addr))
647+ return -ENOENT;
648+
613649 d = udma_udma_desc_from_paddr(uc, *addr);
614650
615651 if (d)
@@ -890,6 +926,9 @@ static int udma_stop(struct udma_chan *uc) · 274 unmodified lines
890926
891927 switch (uc->config.dir) {
892928 case DMA_DEV_TO_MEM:
929+ if (!uc->cyclic && !uc->desc)
930+ udma_push_to_ring(uc, -1);
931+
893932 udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_PEER_RT_EN_REG,
894933 UDMA_PEER_RT_EN_ENABLE |
895934 UDMA_PEER_RT_EN_TEARDOWN);
@@ -946,9 +985,10 @@ static bool udma_is_desc_really_done(struct udma_chan *uc, struct udma_desc *d) · 50 unmodified lines
946985 peer_bcnt = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_PEER_BCNT_REG);
947986 bcnt = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_BCNT_REG);
948987
988+ /* Transfer is incomplete, store current residue and time stamp */
949989 if (peer_bcnt < bcnt) {
950990 uc->tx_drain.residue = bcnt - peer_bcnt;
951− uc->tx_drain.jiffie = jiffies;
991+ uc->tx_drain.tstamp = ktime_get();
952992 return false;
953993 }
954994
@@ -961,35 +1001,59 @@ static void udma_check_tx_completion(struct work_struct *work) · 6 unmodified lines
9611001 tx_drain.work.work);
9621002 bool desc_done = true;
9631003 u32 residue_diff;
964− unsigned long jiffie_diff, delay;
1004+ ktime_t time_diff;
1005+ unsigned long delay;
1006+
1007+ while (1) {
1008+ if (uc->desc) {
1009+ /* Get previous residue and time stamp */
1010+ residue_diff = uc->tx_drain.residue;
1011+ time_diff = uc->tx_drain.tstamp;
1012+ /*
1013+ * Get current residue and time stamp or see if
1014+ * transfer is complete
1015+ */
1016+ desc_done = udma_is_desc_really_done(uc, uc->desc);
1017+ }
9651018
966− if (uc->desc) {
967− residue_diff = uc->tx_drain.residue;
968− jiffie_diff = uc->tx_drain.jiffie;
969− desc_done = udma_is_desc_really_done(uc, uc->desc);
970− }
971−
972− if (!desc_done) {
973− jiffie_diff = uc->tx_drain.jiffie - jiffie_diff;
974− residue_diff -= uc->tx_drain.residue;
975− if (residue_diff) {
976− /* Try to guess when we should check next time */
977− residue_diff /= jiffie_diff;
978− delay = uc->tx_drain.residue / residue_diff / 3;
979− if (jiffies_to_msecs(delay) < 5)
980− delay = 0;
981− } else {
982− /* No progress, check again in 1 second */
983− delay = HZ;
1019+ if (!desc_done) {
1020+ /*
1021+ * Find the time delta and residue delta w.r.t
1022+ * previous poll
1023+ */
1024+ time_diff = ktime_sub(uc->tx_drain.tstamp,
1025+ time_diff) + 1;
1026+ residue_diff -= uc->tx_drain.residue;
1027+ if (residue_diff) {
1028+ /*
1029+ * Try to guess when we should check
1030+ * next time by calculating rate at
1031+ * which data is being drained at the
1032+ * peer device
1033+ */
1034+ delay = (time_diff / residue_diff) *
1035+ uc->tx_drain.residue;
1036+ } else {
1037+ /* No progress, check again in 1 second */
1038+ schedule_delayed_work(&uc->tx_drain.work, HZ);
1039+ break;
1040+ }
1041+
1042+ usleep_range(ktime_to_us(delay),
1043+ ktime_to_us(delay) + 10);
1044+ continue;
9841045 }
9851046
986− schedule_delayed_work(&uc->tx_drain.work, delay);
987− } else if (uc->desc) {
988− struct udma_desc *d = uc->desc;
1047+ if (uc->desc) {
1048+ struct udma_desc *d = uc->desc;
9891049
990− uc->bcnt += d->residue;
991− udma_start(uc);
992− vchan_cookie_complete(&d->vd);
1050+ uc->bcnt += d->residue;
1051+ udma_start(uc);
1052+ vchan_cookie_complete(&d->vd);
1053+ break;
1054+ }
1055+
1056+ break;
9931057 }
9941058 }
9951059
@@ -1033,29 +1097,27 @@ static irqreturn_t udma_ring_irq_handler(int irq, void *data) · 37 unmodified lines
10331097 goto out;
10341098 }
10351099
1036− if (uc->cyclic) {
1037− /* push the descriptor back to the ring */
1038− if (d == uc->desc) {
1100+ if (d == uc->desc) {
1101+ /* active descriptor */
1102+ if (uc->cyclic) {
10391103 udma_cyclic_packet_elapsed(uc);
10401104 vchan_cyclic_callback(&d->vd);
1041− }
1042− } else {
1043− bool desc_done = false;
1044−
1045− if (d == uc->desc) {
1046− desc_done = udma_is_desc_really_done(uc, d);
1047−
1048− if (desc_done) {
1105+ } else {
1106+ if (udma_is_desc_really_done(uc, d)) {
10491107 uc->bcnt += d->residue;
10501108 udma_start(uc);
1109+ vchan_cookie_complete(&d->vd);
10511110 } else {
10521111 schedule_delayed_work(&uc->tx_drain.work,
10531112 0);
10541113 }
10551114 }
1056−
1057− if (desc_done)
1058− vchan_cookie_complete(&d->vd);
1115+ } else {
1116+ /*
1117+ * terminated descriptor, mark the descriptor as
1118+ * completed to update the channel's cookie marker
1119+ */
1120+ dma_cookie_complete(&d->vd.tx);
10591121 }
10601122 }
10611123 out:
@@ -1965,36 +2027,81 @@ static struct udma_desc *udma_alloc_tr_desc(struct udma_chan *uc, · 903 unmodified lines
19652027 return d;
19662028 }
19672029
2030+/**
2031+ * udma_get_tr_counters - calculate TR counters for a given length
2032+ * @len: Length of the trasnfer
2033+ * @align_to: Preferred alignment
2034+ * @tr0_cnt0: First TR icnt0
2035+ * @tr0_cnt1: First TR icnt1
2036+ * @tr1_cnt0: Second (if used) TR icnt0
2037+ *
2038+ * For len < SZ_64K only one TR is enough, tr1_cnt0 is not updated
2039+ * For len >= SZ_64K two TRs are used in a simple way:
2040+ * First TR: SZ_64K-alignment blocks (tr0_cnt0, tr0_cnt1)
2041+ * Second TR: the remaining length (tr1_cnt0)
2042+ *
2043+ * Returns the number of TRs the length needs (1 or 2)
2044+ * -EINVAL if the length can not be supported
2045+ */
2046+static int udma_get_tr_counters(size_t len, unsigned long align_to,
2047+ u16 *tr0_cnt0, u16 *tr0_cnt1, u16 *tr1_cnt0)
2048+{
2049+ if (len < SZ_64K) {
2050+ *tr0_cnt0 = len;
2051+ *tr0_cnt1 = 1;
2052+
2053+ return 1;
2054+ }
2055+
2056+ if (align_to > 3)
2057+ align_to = 3;
2058+
2059+realign:
2060+ *tr0_cnt0 = SZ_64K - BIT(align_to);
2061+ if (len / *tr0_cnt0 >= SZ_64K) {
2062+ if (align_to) {
2063+ align_to--;
2064+ goto realign;
2065+ }
2066+ return -EINVAL;
2067+ }
2068+
2069+ *tr0_cnt1 = len / *tr0_cnt0;
2070+ *tr1_cnt0 = len % *tr0_cnt0;
2071+
2072+ return 2;
2073+}
2074+
19682075 static struct udma_desc *
19692076 udma_prep_slave_sg_tr(struct udma_chan *uc, struct scatterlist *sgl,
19702077 unsigned int sglen, enum dma_transfer_direction dir,
19712078 unsigned long tx_flags, void *context)
19722079 {
1973− enum dma_slave_buswidth dev_width;
19742080 struct scatterlist *sgent;
19752081 struct udma_desc *d;
1976− size_t tr_size;
19772082 struct cppi5_tr_type1_t *tr_req = NULL;
2083+ u16 tr0_cnt0, tr0_cnt1, tr1_cnt0;
19782084 unsigned int i;
1979− u32 burst;
2085+ size_t tr_size;
2086+ int num_tr = 0;
2087+ int tr_idx = 0;
19802088
1981− if (dir == DMA_DEV_TO_MEM) {
1982− dev_width = uc->cfg.src_addr_width;
1983− burst = uc->cfg.src_maxburst;
1984− } else if (dir == DMA_MEM_TO_DEV) {
1985− dev_width = uc->cfg.dst_addr_width;
1986− burst = uc->cfg.dst_maxburst;
1987− } else {
1988− dev_err(uc->ud->dev, "%s: bad direction?\n", __func__);
2089+ if (!is_slave_direction(dir)) {
2090+ dev_err(uc->ud->dev, "Only slave cyclic is supported\n");
19892091 return NULL;
19902092 }
19912093
1992− if (!burst)
1993− burst = 1;
2094+ /* estimate the number of TRs we will need */
2095+ for_each_sg(sgl, sgent, sglen, i) {
2096+ if (sg_dma_len(sgent) < SZ_64K)
2097+ num_tr++;
2098+ else
2099+ num_tr += 2;
2100+ }
19942101
19952102 /* Now allocate and setup the descriptor. */
19962103 tr_size = sizeof(struct cppi5_tr_type1_t);
1997− d = udma_alloc_tr_desc(uc, tr_size, sglen, dir);
2104+ d = udma_alloc_tr_desc(uc, tr_size, num_tr, dir);
19982105 if (!d)
19992106 return NULL;
20002107
@@ -2002,19 +2109,46 @@ udma_prep_slave_sg_tr(struct udma_chan *uc, struct scatterlist *sgl, · 1 unmodified line
20022109
20032110 tr_req = d->hwdesc[0].tr_req_base;
20042111 for_each_sg(sgl, sgent, sglen, i) {
2005− d->residue += sg_dma_len(sgent);
2112+ dma_addr_t sg_addr = sg_dma_address(sgent);
2113+
2114+ num_tr = udma_get_tr_counters(sg_dma_len(sgent), __ffs(sg_addr),
2115+ &tr0_cnt0, &tr0_cnt1, &tr1_cnt0);
2116+ if (num_tr < 0) {
2117+ dev_err(uc->ud->dev, "size %u is not supported\n",
2118+ sg_dma_len(sgent));
2119+ udma_free_hwdesc(uc, d);
2120+ kfree(d);
2121+ return NULL;
2122+ }
20062123
20072124 cppi5_tr_init(&tr_req[i].flags, CPPI5_TR_TYPE1, false, false,
20082125 CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
20092126 cppi5_tr_csf_set(&tr_req[i].flags, CPPI5_TR_CSF_SUPR_EVT);
20102127
2011− tr_req[i].addr = sg_dma_address(sgent);
2012− tr_req[i].icnt0 = burst * dev_width;
2013− tr_req[i].dim1 = burst * dev_width;
2014− tr_req[i].icnt1 = sg_dma_len(sgent) / tr_req[i].icnt0;
2128+ tr_req[tr_idx].addr = sg_addr;
2129+ tr_req[tr_idx].icnt0 = tr0_cnt0;
2130+ tr_req[tr_idx].icnt1 = tr0_cnt1;
2131+ tr_req[tr_idx].dim1 = tr0_cnt0;
2132+ tr_idx++;
2133+
2134+ if (num_tr == 2) {
2135+ cppi5_tr_init(&tr_req[tr_idx].flags, CPPI5_TR_TYPE1,
2136+ false, false,
2137+ CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
2138+ cppi5_tr_csf_set(&tr_req[tr_idx].flags,
2139+ CPPI5_TR_CSF_SUPR_EVT);
2140+
2141+ tr_req[tr_idx].addr = sg_addr + tr0_cnt1 * tr0_cnt0;
2142+ tr_req[tr_idx].icnt0 = tr1_cnt0;
2143+ tr_req[tr_idx].icnt1 = 1;
2144+ tr_req[tr_idx].dim1 = tr1_cnt0;
2145+ tr_idx++;
2146+ }
2147+
2148+ d->residue += sg_dma_len(sgent);
20152149 }
20162150
2017− cppi5_tr_csf_set(&tr_req[i - 1].flags, CPPI5_TR_CSF_EOP);
2151+ cppi5_tr_csf_set(&tr_req[tr_idx - 1].flags, CPPI5_TR_CSF_EOP);
20182152
20192153 return d;
20202154 }
@@ -2319,47 +2453,66 @@ udma_prep_dma_cyclic_tr(struct udma_chan *uc, dma_addr_t buf_addr, · 298 unmodified lines
23192453 size_t buf_len, size_t period_len,
23202454 enum dma_transfer_direction dir, unsigned long flags)
23212455 {
2322− enum dma_slave_buswidth dev_width;
23232456 struct udma_desc *d;
2324− size_t tr_size;
2457+ size_t tr_size, period_addr;
23252458 struct cppi5_tr_type1_t *tr_req;
2326− unsigned int i;
23272459 unsigned int periods = buf_len / period_len;
2328− u32 burst;
2460+ u16 tr0_cnt0, tr0_cnt1, tr1_cnt0;
2461+ unsigned int i;
2462+ int num_tr;
23292463
2330− if (dir == DMA_DEV_TO_MEM) {
2331− dev_width = uc->cfg.src_addr_width;
2332− burst = uc->cfg.src_maxburst;
2333− } else if (dir == DMA_MEM_TO_DEV) {
2334− dev_width = uc->cfg.dst_addr_width;
2335− burst = uc->cfg.dst_maxburst;
2336− } else {
2337− dev_err(uc->ud->dev, "%s: bad direction?\n", __func__);
2464+ if (!is_slave_direction(dir)) {
2465+ dev_err(uc->ud->dev, "Only slave cyclic is supported\n");
23382466 return NULL;
23392467 }
23402468
2341− if (!burst)
2342− burst = 1;
2469+ num_tr = udma_get_tr_counters(period_len, __ffs(buf_addr), &tr0_cnt0,
2470+ &tr0_cnt1, &tr1_cnt0);
2471+ if (num_tr < 0) {
2472+ dev_err(uc->ud->dev, "size %zu is not supported\n",
2473+ period_len);
2474+ return NULL;
2475+ }
23432476
23442477 /* Now allocate and setup the descriptor. */
23452478 tr_size = sizeof(struct cppi5_tr_type1_t);
2346− d = udma_alloc_tr_desc(uc, tr_size, periods, dir);
2479+ d = udma_alloc_tr_desc(uc, tr_size, periods * num_tr, dir);
23472480 if (!d)
23482481 return NULL;
23492482
23502483 tr_req = d->hwdesc[0].tr_req_base;
2484+ period_addr = buf_addr;
23512485 for (i = 0; i < periods; i++) {
2352− cppi5_tr_init(&tr_req[i].flags, CPPI5_TR_TYPE1, false, false,
2353− CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
2486+ int tr_idx = i * num_tr;
23542487
2355− tr_req[i].addr = buf_addr + period_len * i;
2356− tr_req[i].icnt0 = dev_width;
2357− tr_req[i].icnt1 = period_len / dev_width;
2358− tr_req[i].dim1 = dev_width;
2488+ cppi5_tr_init(&tr_req[tr_idx].flags, CPPI5_TR_TYPE1, false,
2489+ false, CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
2490+
2491+ tr_req[tr_idx].addr = period_addr;
2492+ tr_req[tr_idx].icnt0 = tr0_cnt0;
2493+ tr_req[tr_idx].icnt1 = tr0_cnt1;
2494+ tr_req[tr_idx].dim1 = tr0_cnt0;
2495+
2496+ if (num_tr == 2) {
2497+ cppi5_tr_csf_set(&tr_req[tr_idx].flags,
2498+ CPPI5_TR_CSF_SUPR_EVT);
2499+ tr_idx++;
2500+
2501+ cppi5_tr_init(&tr_req[tr_idx].flags, CPPI5_TR_TYPE1,
2502+ false, false,
2503+ CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
2504+
2505+ tr_req[tr_idx].addr = period_addr + tr0_cnt1 * tr0_cnt0;
2506+ tr_req[tr_idx].icnt0 = tr1_cnt0;
2507+ tr_req[tr_idx].icnt1 = 1;
2508+ tr_req[tr_idx].dim1 = tr1_cnt0;
2509+ }
23592510
23602511 if (!(flags & DMA_PREP_INTERRUPT))
2361− cppi5_tr_csf_set(&tr_req[i].flags,
2512+ cppi5_tr_csf_set(&tr_req[tr_idx].flags,
23622513 CPPI5_TR_CSF_SUPR_EVT);
2514+
2515+ period_addr += period_len;
23632516 }
23642517
23652518 return d;
@@ -2517,29 +2670,12 @@ udma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, · 151 unmodified lines
25172670 return NULL;
25182671 }
25192672
2520− if (len < SZ_64K) {
2521− num_tr = 1;
2522− tr0_cnt0 = len;
2523− tr0_cnt1 = 1;
2524− } else {
2525− unsigned long align_to = __ffs(src | dest);
2526−
2527− if (align_to > 3)
2528− align_to = 3;
2529− /*
2530− * Keep simple: tr0: SZ_64K-alignment blocks,
2531− * tr1: the remaining
2532− */
2533− num_tr = 2;
2534− tr0_cnt0 = (SZ_64K - BIT(align_to));
2535− if (len / tr0_cnt0 >= SZ_64K) {
2536− dev_err(uc->ud->dev, "size %zu is not supported\n",
2537− len);
2538− return NULL;
2539− }
2540−
2541− tr0_cnt1 = len / tr0_cnt0;
2542− tr1_cnt0 = len % tr0_cnt0;
2673+ num_tr = udma_get_tr_counters(len, __ffs(src | dest), &tr0_cnt0,
2674+ &tr0_cnt1, &tr1_cnt0);
2675+ if (num_tr < 0) {
2676+ dev_err(uc->ud->dev, "size %zu is not supported\n",
2677+ len);
2678+ return NULL;
25432679 }
25442680
25452681 d = udma_alloc_tr_desc(uc, tr_size, num_tr, DMA_MEM_TO_MEM);
@@ -2631,6 +2767,9 @@ static enum dma_status udma_tx_status(struct dma_chan *chan, · 85 unmodified lines
26312767
26322768 ret = dma_cookie_status(chan, cookie, txstate);
26332769
2770+ if (!udma_is_chan_running(uc))
2771+ ret = DMA_COMPLETE;
2772+
26342773 if (ret == DMA_IN_PROGRESS && udma_is_chan_paused(uc))
26352774 ret = DMA_PAUSED;
26362775
@@ -2697,11 +2836,8 @@ static int udma_pause(struct dma_chan *chan) · 60 unmodified lines
26972836 {
26982837 struct udma_chan *uc = to_udma_chan(chan);
26992838
2700− if (!uc->desc)
2701− return -EINVAL;
2702−
27032839 /* pause the channel */
2704− switch (uc->desc->dir) {
2840+ switch (uc->config.dir) {
27052841 case DMA_DEV_TO_MEM:
27062842 udma_rchanrt_update_bits(uc->rchan,
27072843 UDMA_RCHAN_RT_PEER_RT_EN_REG,
@@ -2730,11 +2866,8 @@ static int udma_resume(struct dma_chan *chan) · 22 unmodified lines
27302866 {
27312867 struct udma_chan *uc = to_udma_chan(chan);
27322868
2733− if (!uc->desc)
2734− return -EINVAL;
2735−
27362869 /* resume the channel */
2737− switch (uc->desc->dir) {
2870+ switch (uc->config.dir) {
27382871 case DMA_DEV_TO_MEM:
27392872 udma_rchanrt_update_bits(uc->rchan,
27402873 UDMA_RCHAN_RT_PEER_RT_EN_REG,
@@ -3248,6 +3381,98 @@ static int udma_setup_resources(struct udma_dev *ud) · 507 unmodified lines
32483381 return ch_count;
32493382 }
32503383
3384+static int udma_setup_rx_flush(struct udma_dev *ud)
3385+{
3386+ struct udma_rx_flush *rx_flush = &ud->rx_flush;
3387+ struct cppi5_desc_hdr_t *tr_desc;
3388+ struct cppi5_tr_type1_t *tr_req;
3389+ struct cppi5_host_desc_t *desc;
3390+ struct device *dev = ud->dev;
3391+ struct udma_hwdesc *hwdesc;
3392+ size_t tr_size;
3393+
3394+ /* Allocate 1K buffer for discarded data on RX channel teardown */
3395+ rx_flush->buffer_size = SZ_1K;
3396+ rx_flush->buffer_vaddr = devm_kzalloc(dev, rx_flush->buffer_size,
3397+ GFP_KERNEL);
3398+ if (!rx_flush->buffer_vaddr)
3399+ return -ENOMEM;
3400+
3401+ rx_flush->buffer_paddr = dma_map_single(dev, rx_flush->buffer_vaddr,
3402+ rx_flush->buffer_size,
3403+ DMA_TO_DEVICE);
3404+ if (dma_mapping_error(dev, rx_flush->buffer_paddr))
3405+ return -ENOMEM;
3406+
3407+ /* Set up descriptor to be used for TR mode */
3408+ hwdesc = &rx_flush->hwdescs[0];
3409+ tr_size = sizeof(struct cppi5_tr_type1_t);
3410+ hwdesc->cppi5_desc_size = cppi5_trdesc_calc_size(tr_size, 1);
3411+ hwdesc->cppi5_desc_size = ALIGN(hwdesc->cppi5_desc_size,
3412+ ud->desc_align);
3413+
3414+ hwdesc->cppi5_desc_vaddr = devm_kzalloc(dev, hwdesc->cppi5_desc_size,
3415+ GFP_KERNEL);
3416+ if (!hwdesc->cppi5_desc_vaddr)
3417+ return -ENOMEM;
3418+
3419+ hwdesc->cppi5_desc_paddr = dma_map_single(dev, hwdesc->cppi5_desc_vaddr,
3420+ hwdesc->cppi5_desc_size,
3421+ DMA_TO_DEVICE);
3422+ if (dma_mapping_error(dev, hwdesc->cppi5_desc_paddr))
3423+ return -ENOMEM;
3424+
3425+ /* Start of the TR req records */
3426+ hwdesc->tr_req_base = hwdesc->cppi5_desc_vaddr + tr_size;
3427+ /* Start address of the TR response array */
3428+ hwdesc->tr_resp_base = hwdesc->tr_req_base + tr_size;
3429+
3430+ tr_desc = hwdesc->cppi5_desc_vaddr;
3431+ cppi5_trdesc_init(tr_desc, 1, tr_size, 0, 0);
3432+ cppi5_desc_set_pktids(tr_desc, 0, CPPI5_INFO1_DESC_FLOWID_DEFAULT);
3433+ cppi5_desc_set_retpolicy(tr_desc, 0, 0);
3434+
3435+ tr_req = hwdesc->tr_req_base;
3436+ cppi5_tr_init(&tr_req->flags, CPPI5_TR_TYPE1, false, false,
3437+ CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
3438+ cppi5_tr_csf_set(&tr_req->flags, CPPI5_TR_CSF_SUPR_EVT);
3439+
3440+ tr_req->addr = rx_flush->buffer_paddr;
3441+ tr_req->icnt0 = rx_flush->buffer_size;
3442+ tr_req->icnt1 = 1;
3443+
3444+ /* Set up descriptor to be used for packet mode */
3445+ hwdesc = &rx_flush->hwdescs[1];
3446+ hwdesc->cppi5_desc_size = ALIGN(sizeof(struct cppi5_host_desc_t) +
3447+ CPPI5_INFO0_HDESC_EPIB_SIZE +
3448+ CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE,
3449+ ud->desc_align);
3450+
3451+ hwdesc->cppi5_desc_vaddr = devm_kzalloc(dev, hwdesc->cppi5_desc_size,
3452+ GFP_KERNEL);
3453+ if (!hwdesc->cppi5_desc_vaddr)
3454+ return -ENOMEM;
3455+
3456+ hwdesc->cppi5_desc_paddr = dma_map_single(dev, hwdesc->cppi5_desc_vaddr,
3457+ hwdesc->cppi5_desc_size,
3458+ DMA_TO_DEVICE);
3459+ if (dma_mapping_error(dev, hwdesc->cppi5_desc_paddr))
3460+ return -ENOMEM;
3461+
3462+ desc = hwdesc->cppi5_desc_vaddr;
3463+ cppi5_hdesc_init(desc, 0, 0);
3464+ cppi5_desc_set_pktids(&desc->hdr, 0, CPPI5_INFO1_DESC_FLOWID_DEFAULT);
3465+ cppi5_desc_set_retpolicy(&desc->hdr, 0, 0);
3466+
3467+ cppi5_hdesc_attach_buf(desc,
3468+ rx_flush->buffer_paddr, rx_flush->buffer_size,
3469+ rx_flush->buffer_paddr, rx_flush->buffer_size);
3470+
3471+ dma_sync_single_for_device(dev, hwdesc->cppi5_desc_paddr,
3472+ hwdesc->cppi5_desc_size, DMA_TO_DEVICE);
3473+ return 0;
3474+}
3475+
32513476 #define TI_UDMAC_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
32523477 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
32533478 BIT(DMA_SLAVE_BUSWIDTH_3_BYTES) | \
@@ -3361,6 +3586,10 @@ static int udma_probe(struct platform_device *pdev) · 107 unmodified lines
33613586 if (ud->desc_align < dma_get_cache_alignment())
33623587 ud->desc_align = dma_get_cache_alignment();
33633588
3589+ ret = udma_setup_rx_flush(ud);
3590+ if (ret)
3591+ return ret;
3592+
33643593 for (i = 0; i < ud->tchan_cnt; i++) {
33653594 struct udma_tchan *tchan = &ud->tchans[i];
33663595
drivers/edac/synopsys_edac.c+7−15
@@ -479,20 +479,14 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p) · 478 unmodified lines
479479 pinf = &p->ceinfo;
480480 if (!priv->p_data->quirks) {
481481 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
482− "DDR ECC error type:%s Row %d Bank %d Col %d ",
483− "CE", pinf->row, pinf->bank, pinf->col);
484− snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
485− "Bit Position: %d Data: 0x%08x\n",
482+ "DDR ECC error type:%s Row %d Bank %d Col %d Bit Position: %d Data: 0x%08x",
483+ "CE", pinf->row, pinf->bank, pinf->col,
486484 pinf->bitpos, pinf->data);
487485 } else {
488486 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
489− "DDR ECC error type:%s Row %d Bank %d Col %d ",
490− "CE", pinf->row, pinf->bank, pinf->col);
491− snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
492− "BankGroup Number %d Block Number %d ",
493− pinf->bankgrpnr, pinf->blknr);
494− snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
495− "Bit Position: %d Data: 0x%08x\n",
487+ "DDR ECC error type:%s Row %d Bank %d Col %d BankGroup Number %d Block Number %d Bit Position: %d Data: 0x%08x",
488+ "CE", pinf->row, pinf->bank, pinf->col,
489+ pinf->bankgrpnr, pinf->blknr,
496490 pinf->bitpos, pinf->data);
497491 }
498492
@@ -509,10 +503,8 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p) · 10 unmodified lines
509503 "UE", pinf->row, pinf->bank, pinf->col);
510504 } else {
511505 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
512− "DDR ECC error type :%s Row %d Bank %d Col %d ",
513− "UE", pinf->row, pinf->bank, pinf->col);
514− snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
515− "BankGroup Number %d Block Number %d",
506+ "DDR ECC error type :%s Row %d Bank %d Col %d BankGroup Number %d Block Number %d",
507+ "UE", pinf->row, pinf->bank, pinf->col,
516508 pinf->bankgrpnr, pinf->blknr);
517509 }
518510
drivers/firmware/efi/efi.c+2−2
@@ -552,7 +552,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, · 551 unmodified lines
552552
553553 seed = early_memremap(efi.rng_seed, sizeof(*seed));
554554 if (seed != NULL) {
555− size = seed->size;
555+ size = READ_ONCE(seed->size);
556556 early_memunmap(seed, sizeof(*seed));
557557 } else {
558558 pr_err("Could not map UEFI random seed!\n");
@@ -562,7 +562,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, · 3 unmodified lines
562562 sizeof(*seed) + size);
563563 if (seed != NULL) {
564564 pr_notice("seeding entropy pool\n");
565− add_bootloader_randomness(seed->bits, seed->size);
565+ add_bootloader_randomness(seed->bits, size);
566566 early_memunmap(seed, sizeof(*seed) + size);
567567 } else {
568568 pr_err("Could not map UEFI random seed!\n");
drivers/firmware/efi/efivars.c+23−9
@@ -83,13 +83,16 @@ static ssize_t · 82 unmodified lines
8383 efivar_attr_read(struct efivar_entry *entry, char *buf)
8484 {
8585 struct efi_variable *var = &entry->var;
86+ unsigned long size = sizeof(var->Data);
8687 char *str = buf;
88+ int ret;
8789
8890 if (!entry || !buf)
8991 return -EINVAL;
9092
91− var->DataSize = 1024;
92− if (efivar_entry_get(entry, &var->Attributes, &var->DataSize, var->Data))
93+ ret = efivar_entry_get(entry, &var->Attributes, &size, var->Data);
94+ var->DataSize = size;
95+ if (ret)
9396 return -EIO;
9497
9598 if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
@@ -116,13 +119,16 @@ static ssize_t · 20 unmodified lines
116119 efivar_size_read(struct efivar_entry *entry, char *buf)
117120 {
118121 struct efi_variable *var = &entry->var;
122+ unsigned long size = sizeof(var->Data);
119123 char *str = buf;
124+ int ret;
120125
121126 if (!entry || !buf)
122127 return -EINVAL;
123128
124− var->DataSize = 1024;
125− if (efivar_entry_get(entry, &var->Attributes, &var->DataSize, var->Data))
129+ ret = efivar_entry_get(entry, &var->Attributes, &size, var->Data);
130+ var->DataSize = size;
131+ if (ret)
126132 return -EIO;
127133
128134 str += sprintf(str, "0x%lx\n", var->DataSize);
@@ -133,12 +139,15 @@ static ssize_t · 4 unmodified lines
133139 efivar_data_read(struct efivar_entry *entry, char *buf)
134140 {
135141 struct efi_variable *var = &entry->var;
142+ unsigned long size = sizeof(var->Data);
143+ int ret;
136144
137145 if (!entry || !buf)
138146 return -EINVAL;
139147
140− var->DataSize = 1024;
141− if (efivar_entry_get(entry, &var->Attributes, &var->DataSize, var->Data))
148+ ret = efivar_entry_get(entry, &var->Attributes, &size, var->Data);
149+ var->DataSize = size;
150+ if (ret)
142151 return -EIO;
143152
144153 memcpy(buf, var->Data, var->DataSize);
@@ -199,6 +208,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) · 54 unmodified lines
199208 u8 *data;
200209 int err;
201210
211+ if (!entry || !buf)
212+ return -EINVAL;
213+
202214 if (in_compat_syscall()) {
203215 struct compat_efi_variable *compat;
204216
@@ -250,14 +262,16 @@ efivar_show_raw(struct efivar_entry *entry, char *buf) · 45 unmodified lines
250262 {
251263 struct efi_variable *var = &entry->var;
252264 struct compat_efi_variable *compat;
265+ unsigned long datasize = sizeof(var->Data);
253266 size_t size;
267+ int ret;
254268
255269 if (!entry || !buf)
256270 return 0;
257271
258− var->DataSize = 1024;
259− if (efivar_entry_get(entry, &entry->var.Attributes,
260− &entry->var.DataSize, entry->var.Data))
272+ ret = efivar_entry_get(entry, &var->Attributes, &datasize, var->Data);
273+ var->DataSize = datasize;
274+ if (ret)
261275 return -EIO;
262276
263277 if (in_compat_syscall()) {
drivers/firmware/imx/imx-scu.c+27−0
@@ -29,6 +29,7 @@ struct imx_sc_chan { · 28 unmodified lines
2929 struct mbox_client cl;
3030 struct mbox_chan *ch;
3131 int idx;
32+ struct completion tx_done;
3233 };
3334
3435 struct imx_sc_ipc {
@@ -100,6 +101,14 @@ int imx_scu_get_handle(struct imx_sc_ipc **ipc) · 65 unmodified lines
100101 }
101102 EXPORT_SYMBOL(imx_scu_get_handle);
102103
104+/* Callback called when the word of a message is ack-ed, eg read by SCU */
105+static void imx_scu_tx_done(struct mbox_client *cl, void *mssg, int r)
106+{
107+ struct imx_sc_chan *sc_chan = container_of(cl, struct imx_sc_chan, cl);
108+
109+ complete(&sc_chan->tx_done);
110+}
111+
103112 static void imx_scu_rx_callback(struct mbox_client *c, void *msg)
104113 {
105114 struct imx_sc_chan *sc_chan = container_of(c, struct imx_sc_chan, cl);
@@ -149,6 +158,19 @@ static int imx_scu_ipc_write(struct imx_sc_ipc *sc_ipc, void *msg) · 43 unmodified lines
149158
150159 for (i = 0; i < hdr->size; i++) {
151160 sc_chan = &sc_ipc->chans[i % 4];
161+
162+ /*
163+ * SCU requires that all messages words are written
164+ * sequentially but linux MU driver implements multiple
165+ * independent channels for each register so ordering between
166+ * different channels must be ensured by SCU API interface.
167+ *
168+ * Wait for tx_done before every send to ensure that no
169+ * queueing happens at the mailbox channel level.
170+ */
171+ wait_for_completion(&sc_chan->tx_done);
172+ reinit_completion(&sc_chan->tx_done);
173+
152174 ret = mbox_send_message(sc_chan->ch, &data[i]);
153175 if (ret < 0)
154176 return ret;
@@ -247,6 +269,11 @@ static int imx_scu_probe(struct platform_device *pdev) · 92 unmodified lines
247269 cl->knows_txdone = true;
248270 cl->rx_callback = imx_scu_rx_callback;
249271
272+ /* Initial tx_done completion as "done" */
273+ cl->tx_done = imx_scu_tx_done;
274+ init_completion(&sc_chan->tx_done);
275+ complete(&sc_chan->tx_done);
276+
250277 sc_chan->sc_ipc = sc_ipc;
251278 sc_chan->idx = i % 4;
252279 sc_chan->ch = mbox_request_channel_byname(cl, chan_name);
drivers/firmware/imx/misc.c+4−4
@@ -16,7 +16,7 @@ struct imx_sc_msg_req_misc_set_ctrl { · 15 unmodified lines
1616 u32 ctrl;
1717 u32 val;
1818 u16 resource;
19−} __packed;
19+} __packed __aligned(4);
2020
2121 struct imx_sc_msg_req_cpu_start {
2222 struct imx_sc_rpc_msg hdr;
@@ -24,18 +24,18 @@ struct imx_sc_msg_req_cpu_start { · 1 unmodified line
2424 u32 address_lo;
2525 u16 resource;
2626 u8 enable;
27−} __packed;
27+} __packed __aligned(4);
2828
2929 struct imx_sc_msg_req_misc_get_ctrl {
3030 struct imx_sc_rpc_msg hdr;
3131 u32 ctrl;
3232 u16 resource;
33−} __packed;
33+} __packed __aligned(4);
3434
3535 struct imx_sc_msg_resp_misc_get_ctrl {
3636 struct imx_sc_rpc_msg hdr;
3737 u32 val;
38−} __packed;
38+} __packed __aligned(4);
3939
4040 /*
4141 * This function sets a miscellaneous control value.
drivers/firmware/imx/scu-pd.c+1−1
@@ -61,7 +61,7 @@ struct imx_sc_msg_req_set_resource_power_mode { · 60 unmodified lines
6161 struct imx_sc_rpc_msg hdr;
6262 u16 resource;
6363 u8 mode;
64−} __packed;
64+} __packed __aligned(4);
6565
6666 #define IMX_SCU_PD_NAME_SIZE 20
6767 struct imx_sc_pm_domain {
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c+3−3
@@ -781,11 +781,11 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf, · 780 unmodified lines
781781 ssize_t result = 0;
782782 uint32_t offset, se, sh, cu, wave, simd, thread, bank, *data;
783783
784− if (size & 3 || *pos & 3)
784+ if (size > 4096 || size & 3 || *pos & 3)
785785 return -EINVAL;
786786
787787 /* decode offset */
788− offset = *pos & GENMASK_ULL(11, 0);
788+ offset = (*pos & GENMASK_ULL(11, 0)) >> 2;
789789 se = (*pos & GENMASK_ULL(19, 12)) >> 12;
790790 sh = (*pos & GENMASK_ULL(27, 20)) >> 20;
791791 cu = (*pos & GENMASK_ULL(35, 28)) >> 28;
@@ -823,7 +823,7 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf, · 31 unmodified lines
823823 while (size) {
824824 uint32_t value;
825825
826− value = data[offset++];
826+ value = data[result >> 2];
827827 r = put_user(value, (uint32_t *)buf);
828828 if (r) {
829829 result = r;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+4−0
@@ -3913,6 +3913,8 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive, · 3912 unmodified lines
39133913 if (r)
39143914 goto out;
39153915
3916+ amdgpu_fbdev_set_suspend(tmp_adev, 0);
3917+
39163918 /* must succeed. */
39173919 amdgpu_ras_resume(tmp_adev);
39183920
@@ -4086,6 +4088,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · 167 unmodified lines
40864088 */
40874089 amdgpu_unregister_gpu_instance(tmp_adev);
40884090
4091+ amdgpu_fbdev_set_suspend(adev, 1);
4092+
40894093 /* disable ras on ALL IPs */
40904094 if (!(in_ras_intr && !use_baco) &&
40914095 amdgpu_device_ip_need_full_reset(tmp_adev))
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+1−1
@@ -1389,7 +1389,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe, · 1388 unmodified lines
13891389
13901390 static struct drm_driver kms_driver = {
13911391 .driver_features =
1392− DRIVER_USE_AGP | DRIVER_ATOMIC |
1392+ DRIVER_ATOMIC |
13931393 DRIVER_GEM |
13941394 DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ |
13951395 DRIVER_SYNCOBJ_TIMELINE,
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h+1−0
@@ -195,6 +195,7 @@ struct amdgpu_gmc { · 194 unmodified lines
195195 uint32_t srbm_soft_reset;
196196 bool prt_warning;
197197 uint64_t stolen_size;
198+ uint32_t sdpif_register;
198199 /* apertures */
199200 u64 shared_aperture_start;
200201 u64 shared_aperture_end;
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+52−46
@@ -52,7 +52,7 @@ · 51 unmodified lines
5252 * 1. Primary ring
5353 * 2. Async ring
5454 */
55−#define GFX10_NUM_GFX_RINGS 2
55+#define GFX10_NUM_GFX_RINGS_NV1X 1
5656 #define GFX10_MEC_HPD_SIZE 2048
5757
5858 #define F32_CE_PROGRAM_RAM_SIZE 65536
@@ -1304,7 +1304,7 @@ static int gfx_v10_0_sw_init(void *handle) · 1245 unmodified lines
13041304 case CHIP_NAVI14:
13051305 case CHIP_NAVI12:
13061306 adev->gfx.me.num_me = 1;
1307− adev->gfx.me.num_pipe_per_me = 2;
1307+ adev->gfx.me.num_pipe_per_me = 1;
13081308 adev->gfx.me.num_queue_per_pipe = 1;
13091309 adev->gfx.mec.num_mec = 2;
13101310 adev->gfx.mec.num_pipe_per_mec = 4;
@@ -2710,18 +2710,20 @@ static int gfx_v10_0_cp_gfx_start(struct amdgpu_device *adev) · 1399 unmodified lines
27102710 amdgpu_ring_commit(ring);
27112711
27122712 /* submit cs packet to copy state 0 to next available state */
2713− ring = &adev->gfx.gfx_ring[1];
2714− r = amdgpu_ring_alloc(ring, 2);
2715− if (r) {
2716− DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r);
2717− return r;
2718− }
2719−
2720− amdgpu_ring_write(ring, PACKET3(PACKET3_CLEAR_STATE, 0));
2721− amdgpu_ring_write(ring, 0);
2713+ if (adev->gfx.num_gfx_rings > 1) {
2714+ /* maximum supported gfx ring is 2 */
2715+ ring = &adev->gfx.gfx_ring[1];
2716+ r = amdgpu_ring_alloc(ring, 2);
2717+ if (r) {
2718+ DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r);
2719+ return r;
2720+ }
27222721
2723− amdgpu_ring_commit(ring);
2722+ amdgpu_ring_write(ring, PACKET3(PACKET3_CLEAR_STATE, 0));
2723+ amdgpu_ring_write(ring, 0);
27242724
2725+ amdgpu_ring_commit(ring);
2726+ }
27252727 return 0;
27262728 }
27272729
@@ -2818,39 +2820,41 @@ static int gfx_v10_0_cp_gfx_resume(struct amdgpu_device *adev) · 90 unmodified lines
28182820 mutex_unlock(&adev->srbm_mutex);
28192821
28202822 /* Init gfx ring 1 for pipe 1 */
2821− mutex_lock(&adev->srbm_mutex);
2822− gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID1);
2823− ring = &adev->gfx.gfx_ring[1];
2824− rb_bufsz = order_base_2(ring->ring_size / 8);
2825− tmp = REG_SET_FIELD(0, CP_RB1_CNTL, RB_BUFSZ, rb_bufsz);
2826− tmp = REG_SET_FIELD(tmp, CP_RB1_CNTL, RB_BLKSZ, rb_bufsz - 2);
2827− WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp);
2828− /* Initialize the ring buffer's write pointers */
2829− ring->wptr = 0;
2830− WREG32_SOC15(GC, 0, mmCP_RB1_WPTR, lower_32_bits(ring->wptr));
2831− WREG32_SOC15(GC, 0, mmCP_RB1_WPTR_HI, upper_32_bits(ring->wptr));
2832− /* Set the wb address wether it's enabled or not */
2833− rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs * 4);
2834− WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR, lower_32_bits(rptr_addr));
2835− WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR_HI, upper_32_bits(rptr_addr) &
2836− CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK);
2837− wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs * 4);
2838− WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_LO,
2839− lower_32_bits(wptr_gpu_addr));
2840− WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_HI,
2841− upper_32_bits(wptr_gpu_addr));
2842−
2843− mdelay(1);
2844− WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp);
2845−
2846− rb_addr = ring->gpu_addr >> 8;
2847− WREG32_SOC15(GC, 0, mmCP_RB1_BASE, rb_addr);
2848− WREG32_SOC15(GC, 0, mmCP_RB1_BASE_HI, upper_32_bits(rb_addr));
2849− WREG32_SOC15(GC, 0, mmCP_RB1_ACTIVE, 1);
2850−
2851− gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
2852− mutex_unlock(&adev->srbm_mutex);
2853−
2823+ if (adev->gfx.num_gfx_rings > 1) {
2824+ mutex_lock(&adev->srbm_mutex);
2825+ gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID1);
2826+ /* maximum supported gfx ring is 2 */
2827+ ring = &adev->gfx.gfx_ring[1];
2828+ rb_bufsz = order_base_2(ring->ring_size / 8);
2829+ tmp = REG_SET_FIELD(0, CP_RB1_CNTL, RB_BUFSZ, rb_bufsz);
2830+ tmp = REG_SET_FIELD(tmp, CP_RB1_CNTL, RB_BLKSZ, rb_bufsz - 2);
2831+ WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp);
2832+ /* Initialize the ring buffer's write pointers */
2833+ ring->wptr = 0;
2834+ WREG32_SOC15(GC, 0, mmCP_RB1_WPTR, lower_32_bits(ring->wptr));
2835+ WREG32_SOC15(GC, 0, mmCP_RB1_WPTR_HI, upper_32_bits(ring->wptr));
2836+ /* Set the wb address wether it's enabled or not */
2837+ rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs * 4);
2838+ WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR, lower_32_bits(rptr_addr));
2839+ WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR_HI, upper_32_bits(rptr_addr) &
2840+ CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK);
2841+ wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs * 4);
2842+ WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_LO,
2843+ lower_32_bits(wptr_gpu_addr));
2844+ WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_HI,
2845+ upper_32_bits(wptr_gpu_addr));
2846+
2847+ mdelay(1);
2848+ WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp);
2849+
2850+ rb_addr = ring->gpu_addr >> 8;
2851+ WREG32_SOC15(GC, 0, mmCP_RB1_BASE, rb_addr);
2852+ WREG32_SOC15(GC, 0, mmCP_RB1_BASE_HI, upper_32_bits(rb_addr));
2853+ WREG32_SOC15(GC, 0, mmCP_RB1_ACTIVE, 1);
2854+
2855+ gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
2856+ mutex_unlock(&adev->srbm_mutex);
2857+ }
28542858 /* Switch to pipe 0 */
28552859 mutex_lock(&adev->srbm_mutex);
28562860 gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID0);
@@ -3513,6 +3517,7 @@ static int gfx_v10_0_kcq_init_queue(struct amdgpu_ring *ring) · 656 unmodified lines
35133517
35143518 /* reset ring buffer */
35153519 ring->wptr = 0;
3520+ atomic64_set((atomic64_t *)&adev->wb.wb[ring->wptr_offs], 0);
35163521 amdgpu_ring_clear_ring(ring);
35173522 } else {
35183523 amdgpu_ring_clear_ring(ring);
@@ -3966,7 +3971,8 @@ static int gfx_v10_0_early_init(void *handle) · 447 unmodified lines
39663971 {
39673972 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
39683973
3969− adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS;
3974+ adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_NV1X;
3975+
39703976 adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS;
39713977
39723978 gfx_v10_0_set_kiq_pm4_funcs(adev);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+1−0
@@ -3663,6 +3663,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring) · 3662 unmodified lines
36633663
36643664 /* reset ring buffer */
36653665 ring->wptr = 0;
3666+ atomic64_set((atomic64_t *)&adev->wb.wb[ring->wptr_offs], 0);
36663667 amdgpu_ring_clear_ring(ring);
36673668 } else {
36683669 amdgpu_ring_clear_ring(ring);
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c+36−1
@@ -1271,6 +1271,19 @@ static void gmc_v9_0_init_golden_registers(struct amdgpu_device *adev) · 1270 unmodified lines
12711271 }
12721272 }
12731273
1274+/**
1275+ * gmc_v9_0_restore_registers - restores regs
1276+ *
1277+ * @adev: amdgpu_device pointer
1278+ *
1279+ * This restores register values, saved at suspend.
1280+ */
1281+static void gmc_v9_0_restore_registers(struct amdgpu_device *adev)
1282+{
1283+ if (adev->asic_type == CHIP_RAVEN)
1284+ WREG32(mmDCHUBBUB_SDPIF_MMIO_CNTRL_0, adev->gmc.sdpif_register);
1285+}
1286+
12741287 /**
12751288 * gmc_v9_0_gart_enable - gart enable
12761289 *
@@ -1376,6 +1389,20 @@ static int gmc_v9_0_hw_init(void *handle) · 99 unmodified lines
13761389 return r;
13771390 }
13781391
1392+/**
1393+ * gmc_v9_0_save_registers - saves regs
1394+ *
1395+ * @adev: amdgpu_device pointer
1396+ *
1397+ * This saves potential register values that should be
1398+ * restored upon resume
1399+ */
1400+static void gmc_v9_0_save_registers(struct amdgpu_device *adev)
1401+{
1402+ if (adev->asic_type == CHIP_RAVEN)
1403+ adev->gmc.sdpif_register = RREG32(mmDCHUBBUB_SDPIF_MMIO_CNTRL_0);
1404+}
1405+
13791406 /**
13801407 * gmc_v9_0_gart_disable - gart disable
13811408 *
@@ -1412,9 +1439,16 @@ static int gmc_v9_0_hw_fini(void *handle) · 30 unmodified lines
14121439
14131440 static int gmc_v9_0_suspend(void *handle)
14141441 {
1442+ int r;
14151443 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
14161444
1417− return gmc_v9_0_hw_fini(adev);
1445+ r = gmc_v9_0_hw_fini(adev);
1446+ if (r)
1447+ return r;
1448+
1449+ gmc_v9_0_save_registers(adev);
1450+
1451+ return 0;
14181452 }
14191453
14201454 static int gmc_v9_0_resume(void *handle)
@@ -1422,6 +1456,7 @@ static int gmc_v9_0_resume(void *handle) · 1 unmodified line
14221456 int r;
14231457 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
14241458
1459+ gmc_v9_0_restore_registers(adev);
14251460 r = gmc_v9_0_hw_init(adev);
14261461 if (r)
14271462 return r;
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c+1−1
@@ -693,7 +693,7 @@ static int jpeg_v2_0_set_clockgating_state(void *handle, · 692 unmodified lines
693693 bool enable = (state == AMD_CG_STATE_GATE);
694694
695695 if (enable) {
696− if (jpeg_v2_0_is_idle(handle))
696+ if (!jpeg_v2_0_is_idle(handle))
697697 return -EBUSY;
698698 jpeg_v2_0_enable_clock_gating(adev);
699699 } else {
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c+1−1
@@ -477,7 +477,7 @@ static int jpeg_v2_5_set_clockgating_state(void *handle, · 476 unmodified lines
477477 continue;
478478
479479 if (enable) {
480− if (jpeg_v2_5_is_idle(handle))
480+ if (!jpeg_v2_5_is_idle(handle))
481481 return -EBUSY;
482482 jpeg_v2_5_enable_clock_gating(adev, i);
483483 } else {
drivers/gpu/drm/amd/amdgpu/soc15.c+23−2
@@ -89,6 +89,13 @@ · 88 unmodified lines
8989 #define HDP_MEM_POWER_CTRL__RC_MEM_POWER_CTRL_EN_MASK 0x00010000L
9090 #define HDP_MEM_POWER_CTRL__RC_MEM_POWER_LS_EN_MASK 0x00020000L
9191 #define mmHDP_MEM_POWER_CTRL_BASE_IDX 0
92+
93+/* for Vega20/arcturus regiter offset change */
94+#define mmROM_INDEX_VG20 0x00e4
95+#define mmROM_INDEX_VG20_BASE_IDX 0
96+#define mmROM_DATA_VG20 0x00e5
97+#define mmROM_DATA_VG20_BASE_IDX 0
98+
9299 /*
93100 * Indirect registers accessor
94101 */
@@ -309,6 +316,8 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev, · 214 unmodified lines
309316 {
310317 u32 *dw_ptr;
311318 u32 i, length_dw;
319+ uint32_t rom_index_offset;
320+ uint32_t rom_data_offset;
312321
313322 if (bios == NULL)
314323 return false;
@@ -321,11 +330,23 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev, · 6 unmodified lines
321330 dw_ptr = (u32 *)bios;
322331 length_dw = ALIGN(length_bytes, 4) / 4;
323332
333+ switch (adev->asic_type) {
334+ case CHIP_VEGA20:
335+ case CHIP_ARCTURUS:
336+ rom_index_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX_VG20);
337+ rom_data_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA_VG20);
338+ break;
339+ default:
340+ rom_index_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX);
341+ rom_data_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA);
342+ break;
343+ }
344+
324345 /* set rom index to 0 */
325− WREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX), 0);
346+ WREG32(rom_index_offset, 0);
326347 /* read out the rom data */
327348 for (i = 0; i < length_dw; i++)
328− dw_ptr[i] = RREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA));
349+ dw_ptr[i] = RREG32(rom_data_offset);
329350
330351 return true;
331352 }
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c+1−1
@@ -1352,7 +1352,7 @@ static int vcn_v1_0_set_clockgating_state(void *handle, · 1351 unmodified lines
13521352
13531353 if (enable) {
13541354 /* wait for STATUS to clear */
1355− if (vcn_v1_0_is_idle(handle))
1355+ if (!vcn_v1_0_is_idle(handle))
13561356 return -EBUSY;
13571357 vcn_v1_0_enable_clock_gating(adev);
13581358 } else {
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c+1−1
@@ -1217,7 +1217,7 @@ static int vcn_v2_0_set_clockgating_state(void *handle, · 1216 unmodified lines
12171217
12181218 if (enable) {
12191219 /* wait for STATUS to clear */
1220− if (vcn_v2_0_is_idle(handle))
1220+ if (!vcn_v2_0_is_idle(handle))
12211221 return -EBUSY;
12221222 vcn_v2_0_enable_clock_gating(adev);
12231223 } else {
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c+1−1
@@ -1672,7 +1672,7 @@ static int vcn_v2_5_set_clockgating_state(void *handle, · 1671 unmodified lines
16721672 return 0;
16731673
16741674 if (enable) {
1675− if (vcn_v2_5_is_idle(handle))
1675+ if (!vcn_v2_5_is_idle(handle))
16761676 return -EBUSY;
16771677 vcn_v2_5_enable_clock_gating(adev);
16781678 } else {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+84−3
@@ -522,8 +522,9 @@ static void dm_dcn_crtc_high_irq(void *interrupt_params) · 521 unmodified lines
522522
523523 acrtc_state = to_dm_crtc_state(acrtc->base.state);
524524
525− DRM_DEBUG_DRIVER("crtc:%d, vupdate-vrr:%d\n", acrtc->crtc_id,
526− amdgpu_dm_vrr_active(acrtc_state));
525+ DRM_DEBUG_DRIVER("crtc:%d, vupdate-vrr:%d, planes:%d\n", acrtc->crtc_id,
526+ amdgpu_dm_vrr_active(acrtc_state),
527+ acrtc_state->active_planes);
527528
528529 amdgpu_dm_crtc_handle_crc_irq(&acrtc->base);
529530 drm_crtc_handle_vblank(&acrtc->base);
@@ -543,7 +544,18 @@ static void dm_dcn_crtc_high_irq(void *interrupt_params) · 13 unmodified lines
543544 &acrtc_state->vrr_params.adjust);
544545 }
545546
546− if (acrtc->pflip_status == AMDGPU_FLIP_SUBMITTED) {
547+ /*
548+ * If there aren't any active_planes then DCH HUBP may be clock-gated.
549+ * In that case, pageflip completion interrupts won't fire and pageflip
550+ * completion events won't get delivered. Prevent this by sending
551+ * pending pageflip events from here if a flip is still pending.
552+ *
553+ * If any planes are enabled, use dm_pflip_high_irq() instead, to
554+ * avoid race conditions between flip programming and completion,
555+ * which could cause too early flip completion events.
556+ */
557+ if (acrtc->pflip_status == AMDGPU_FLIP_SUBMITTED &&
558+ acrtc_state->active_planes == 0) {
547559 if (acrtc->event) {
548560 drm_crtc_send_vblank_event(&acrtc->base, acrtc->event);
549561 acrtc->event = NULL;
@@ -1422,6 +1434,73 @@ static void s3_handle_mst(struct drm_device *dev, bool suspend) · 872 unmodified lines
14221434 drm_kms_helper_hotplug_event(dev);
14231435 }
14241436
1437+static int amdgpu_dm_smu_write_watermarks_table(struct amdgpu_device *adev)
1438+{
1439+ struct smu_context *smu = &adev->smu;
1440+ int ret = 0;
1441+
1442+ if (!is_support_sw_smu(adev))
1443+ return 0;
1444+
1445+ /* This interface is for dGPU Navi1x.Linux dc-pplib interface depends
1446+ * on window driver dc implementation.
1447+ * For Navi1x, clock settings of dcn watermarks are fixed. the settings
1448+ * should be passed to smu during boot up and resume from s3.
1449+ * boot up: dc calculate dcn watermark clock settings within dc_create,
1450+ * dcn20_resource_construct
1451+ * then call pplib functions below to pass the settings to smu:
1452+ * smu_set_watermarks_for_clock_ranges
1453+ * smu_set_watermarks_table
1454+ * navi10_set_watermarks_table
1455+ * smu_write_watermarks_table
1456+ *
1457+ * For Renoir, clock settings of dcn watermark are also fixed values.
1458+ * dc has implemented different flow for window driver:
1459+ * dc_hardware_init / dc_set_power_state
1460+ * dcn10_init_hw
1461+ * notify_wm_ranges
1462+ * set_wm_ranges
1463+ * -- Linux
1464+ * smu_set_watermarks_for_clock_ranges
1465+ * renoir_set_watermarks_table
1466+ * smu_write_watermarks_table
1467+ *
1468+ * For Linux,
1469+ * dc_hardware_init -> amdgpu_dm_init
1470+ * dc_set_power_state --> dm_resume
1471+ *
1472+ * therefore, this function apply to navi10/12/14 but not Renoir
1473+ * *
1474+ */
1475+ switch(adev->asic_type) {
1476+ case CHIP_NAVI10:
1477+ case CHIP_NAVI14:
1478+ case CHIP_NAVI12:
1479+ break;
1480+ default:
1481+ return 0;
1482+ }
1483+
1484+ mutex_lock(&smu->mutex);
1485+
1486+ /* pass data to smu controller */
1487+ if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
1488+ !(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
1489+ ret = smu_write_watermarks_table(smu);
1490+
1491+ if (ret) {
1492+ mutex_unlock(&smu->mutex);
1493+ DRM_ERROR("Failed to update WMTABLE!\n");
1494+ return ret;
1495+ }
1496+ smu->watermarks_bitmap |= WATERMARKS_LOADED;
1497+ }
1498+
1499+ mutex_unlock(&smu->mutex);
1500+
1501+ return 0;
1502+}
1503+
14251504 /**
14261505 * dm_hw_init() - Initialize DC device
14271506 * @handle: The base driver device containing the amdgpu_dm device.
@@ -1700,6 +1779,8 @@ static int dm_resume(void *handle) · 272 unmodified lines
17001779
17011780 amdgpu_dm_irq_resume_late(adev);
17021781
1782+ amdgpu_dm_smu_write_watermarks_table(adev);
1783+
17031784 return 0;
17041785 }
17051786
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+1−0
@@ -451,6 +451,7 @@ static void dm_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr, · 450 unmodified lines
451451 aconnector->dc_sink);
452452 dc_sink_release(aconnector->dc_sink);
453453 aconnector->dc_sink = NULL;
454+ aconnector->dc_link->cur_link_settings.lane_count = 0;
454455 }
455456
456457 drm_connector_unregister(connector);
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+11−0
@@ -3401,6 +3401,17 @@ static bool retrieve_link_cap(struct dc_link *link) · 3400 unmodified lines
34013401 sink_id.ieee_device_id,
34023402 sizeof(sink_id.ieee_device_id));
34033403
3404+ /* Quirk Apple MBP 2017 15" Retina panel: Wrong DP_MAX_LINK_RATE */
3405+ {
3406+ uint8_t str_mbp_2017[] = { 101, 68, 21, 101, 98, 97 };
3407+
3408+ if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
3409+ !memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2017,
3410+ sizeof(str_mbp_2017))) {
3411+ link->reported_link_cap.link_rate = 0x0c;
3412+ }
3413+ }
3414+
34043415 core_link_read_dpcd(
34053416 link,
34063417 DP_SINK_HW_REVISION_START,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c+2−2
@@ -840,8 +840,8 @@ static void hubbub1_det_request_size( · 839 unmodified lines
840840
841841 hubbub1_get_blk256_size(&blk256_width, &blk256_height, bpe);
842842
843− swath_bytes_horz_wc = height * blk256_height * bpe;
844− swath_bytes_vert_wc = width * blk256_width * bpe;
843+ swath_bytes_horz_wc = width * blk256_height * bpe;
844+ swath_bytes_vert_wc = height * blk256_width * bpe;
845845
846846 *req128_horz_wc = (2 * swath_bytes_horz_wc <= detile_buf_size) ?
847847 false : /* full 256B request */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c+0−1
@@ -108,7 +108,6 @@ static const struct hwseq_private_funcs dcn20_private_funcs = { · 107 unmodified lines
108108 .enable_power_gating_plane = dcn20_enable_power_gating_plane,
109109 .dpp_pg_control = dcn20_dpp_pg_control,
110110 .hubp_pg_control = dcn20_hubp_pg_control,
111− .dsc_pg_control = NULL,
112111 .update_odm = dcn20_update_odm,
113112 .dsc_pg_control = dcn20_dsc_pg_control,
114113 .get_surface_visual_confirm_color = dcn10_get_surface_visual_confirm_color,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c+114−0
@@ -335,6 +335,117 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_0_soc = { · 334 unmodified lines
335335 .use_urgent_burst_bw = 0
336336 };
337337
338+struct _vcs_dpi_soc_bounding_box_st dcn2_0_nv14_soc = {
339+ .clock_limits = {
340+ {
341+ .state = 0,
342+ .dcfclk_mhz = 560.0,
343+ .fabricclk_mhz = 560.0,
344+ .dispclk_mhz = 513.0,
345+ .dppclk_mhz = 513.0,
346+ .phyclk_mhz = 540.0,
347+ .socclk_mhz = 560.0,
348+ .dscclk_mhz = 171.0,
349+ .dram_speed_mts = 8960.0,
350+ },
351+ {
352+ .state = 1,
353+ .dcfclk_mhz = 694.0,
354+ .fabricclk_mhz = 694.0,
355+ .dispclk_mhz = 642.0,
356+ .dppclk_mhz = 642.0,
357+ .phyclk_mhz = 600.0,
358+ .socclk_mhz = 694.0,
359+ .dscclk_mhz = 214.0,
360+ .dram_speed_mts = 11104.0,
361+ },
362+ {
363+ .state = 2,
364+ .dcfclk_mhz = 875.0,
365+ .fabricclk_mhz = 875.0,
366+ .dispclk_mhz = 734.0,
367+ .dppclk_mhz = 734.0,
368+ .phyclk_mhz = 810.0,
369+ .socclk_mhz = 875.0,
370+ .dscclk_mhz = 245.0,
371+ .dram_speed_mts = 14000.0,
372+ },
373+ {
374+ .state = 3,
375+ .dcfclk_mhz = 1000.0,
376+ .fabricclk_mhz = 1000.0,
377+ .dispclk_mhz = 1100.0,
378+ .dppclk_mhz = 1100.0,
379+ .phyclk_mhz = 810.0,
380+ .socclk_mhz = 1000.0,
381+ .dscclk_mhz = 367.0,
382+ .dram_speed_mts = 16000.0,
383+ },
384+ {
385+ .state = 4,
386+ .dcfclk_mhz = 1200.0,
387+ .fabricclk_mhz = 1200.0,
388+ .dispclk_mhz = 1284.0,
389+ .dppclk_mhz = 1284.0,
390+ .phyclk_mhz = 810.0,
391+ .socclk_mhz = 1200.0,
392+ .dscclk_mhz = 428.0,
393+ .dram_speed_mts = 16000.0,
394+ },
395+ /*Extra state, no dispclk ramping*/
396+ {
397+ .state = 5,
398+ .dcfclk_mhz = 1200.0,
399+ .fabricclk_mhz = 1200.0,
400+ .dispclk_mhz = 1284.0,
401+ .dppclk_mhz = 1284.0,
402+ .phyclk_mhz = 810.0,
403+ .socclk_mhz = 1200.0,
404+ .dscclk_mhz = 428.0,
405+ .dram_speed_mts = 16000.0,
406+ },
407+ },
408+ .num_states = 5,
409+ .sr_exit_time_us = 8.6,
410+ .sr_enter_plus_exit_time_us = 10.9,
411+ .urgent_latency_us = 4.0,
412+ .urgent_latency_pixel_data_only_us = 4.0,
413+ .urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
414+ .urgent_latency_vm_data_only_us = 4.0,
415+ .urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
416+ .urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
417+ .urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
418+ .pct_ideal_dram_sdp_bw_after_urgent_pixel_only = 40.0,
419+ .pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm = 40.0,
420+ .pct_ideal_dram_sdp_bw_after_urgent_vm_only = 40.0,
421+ .max_avg_sdp_bw_use_normal_percent = 40.0,
422+ .max_avg_dram_bw_use_normal_percent = 40.0,
423+ .writeback_latency_us = 12.0,
424+ .ideal_dram_bw_after_urgent_percent = 40.0,
425+ .max_request_size_bytes = 256,
426+ .dram_channel_width_bytes = 2,
427+ .fabric_datapath_to_dcn_data_return_bytes = 64,
428+ .dcn_downspread_percent = 0.5,
429+ .downspread_percent = 0.38,
430+ .dram_page_open_time_ns = 50.0,
431+ .dram_rw_turnaround_time_ns = 17.5,
432+ .dram_return_buffer_per_channel_bytes = 8192,
433+ .round_trip_ping_latency_dcfclk_cycles = 131,
434+ .urgent_out_of_order_return_per_channel_bytes = 256,
435+ .channel_interleave_bytes = 256,
436+ .num_banks = 8,
437+ .num_chans = 8,
438+ .vmm_page_size_bytes = 4096,
439+ .dram_clock_change_latency_us = 404.0,
440+ .dummy_pstate_latency_us = 5.0,
441+ .writeback_dram_clock_change_latency_us = 23.0,
442+ .return_bus_width_bytes = 64,
443+ .dispclk_dppclk_vco_speed_mhz = 3850,
444+ .xfc_bus_transport_time_us = 20,
445+ .xfc_xbuf_latency_tolerance_us = 4,
446+ .use_urgent_burst_bw = 0
447+};
448+
338449 struct _vcs_dpi_soc_bounding_box_st dcn2_0_nv12_soc = { 0 };
339450
340451 #ifndef mmDP0_DP_DPHY_INTERNAL_CTRL
@@ -3291,6 +3402,9 @@ void dcn20_patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st · 2950 unmodified lines
32913402 static struct _vcs_dpi_soc_bounding_box_st *get_asic_rev_soc_bb(
32923403 uint32_t hw_internal_rev)
32933404 {
3405+ if (ASICREV_IS_NAVI14_M(hw_internal_rev))
3406+ return &dcn2_0_nv14_soc;
3407+
32943408 if (ASICREV_IS_NAVI12_P(hw_internal_rev))
32953409 return &dcn2_0_nv12_soc;
32963410
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c+0−1
@@ -116,7 +116,6 @@ static const struct hwseq_private_funcs dcn21_private_funcs = { · 115 unmodified lines
116116 .enable_power_gating_plane = dcn20_enable_power_gating_plane,
117117 .dpp_pg_control = dcn20_dpp_pg_control,
118118 .hubp_pg_control = dcn20_hubp_pg_control,
119− .dsc_pg_control = NULL,
120119 .update_odm = dcn20_update_odm,
121120 .dsc_pg_control = dcn20_dsc_pg_control,
122121 .get_surface_visual_confirm_color = dcn10_get_surface_visual_confirm_color,
drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_offset.h+2−0
@@ -7376,6 +7376,8 @@ · 7375 unmodified lines
73767376 #define mmCRTC4_CRTC_DRR_CONTROL 0x0f3e
73777377 #define mmCRTC4_CRTC_DRR_CONTROL_BASE_IDX 2
73787378
7379+#define mmDCHUBBUB_SDPIF_MMIO_CNTRL_0 0x395d
7380+#define mmDCHUBBUB_SDPIF_MMIO_CNTRL_0_BASE_IDX 2
73797381
73807382 // addressBlock: dce_dc_fmt4_dispdec
73817383 // base address: 0x2000
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c+6−3
@@ -222,7 +222,7 @@ int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type, · 221 unmodified lines
222222 {
223223 int ret = 0;
224224
225− if (min <= 0 && max <= 0)
225+ if (min < 0 && max < 0)
226226 return -EINVAL;
227227
228228 if (!smu_clk_dpm_is_enabled(smu, clk_type))
@@ -2006,8 +2006,11 @@ int smu_set_watermarks_for_clock_ranges(struct smu_context *smu, · 1777 unmodified lines
20062006 smu_feature_is_enabled(smu, SMU_FEATURE_DPM_DCEFCLK_BIT) &&
20072007 smu_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
20082008 smu_set_watermarks_table(smu, table, clock_ranges);
2009− smu->watermarks_bitmap |= WATERMARKS_EXIST;
2010− smu->watermarks_bitmap &= ~WATERMARKS_LOADED;
2009+
2010+ if (!(smu->watermarks_bitmap & WATERMARKS_EXIST)) {
2011+ smu->watermarks_bitmap |= WATERMARKS_EXIST;
2012+ smu->watermarks_bitmap &= ~WATERMARKS_LOADED;
2013+ }
20112014 }
20122015
20132016 mutex_unlock(&smu->mutex);
drivers/gpu/drm/amd/powerplay/navi10_ppt.c+13−9
@@ -1062,15 +1062,6 @@ static int navi10_display_config_changed(struct smu_context *smu) · 1061 unmodified lines
10621062 {
10631063 int ret = 0;
10641064
1065− if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
1066− !(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
1067− ret = smu_write_watermarks_table(smu);
1068− if (ret)
1069− return ret;
1070−
1071− smu->watermarks_bitmap |= WATERMARKS_LOADED;
1072− }
1073−
10741065 if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
10751066 smu_feature_is_supported(smu, SMU_FEATURE_DPM_DCEFCLK_BIT) &&
10761067 smu_feature_is_supported(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
@@ -1493,6 +1484,7 @@ static int navi10_set_watermarks_table(struct smu_context *smu, · 416 unmodified lines
14931484 *clock_ranges)
14941485 {
14951486 int i;
1487+ int ret = 0;
14961488 Watermarks_t *table = watermarks;
14971489
14981490 if (!table || !clock_ranges)
@@ -1544,6 +1536,18 @@ static int navi10_set_watermarks_table(struct smu_context *smu, · 45 unmodified lines
15441536 clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id;
15451537 }
15461538
1539+ smu->watermarks_bitmap |= WATERMARKS_EXIST;
1540+
1541+ /* pass data to smu controller */
1542+ if (!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
1543+ ret = smu_write_watermarks_table(smu);
1544+ if (ret) {
1545+ pr_err("Failed to update WMTABLE!");
1546+ return ret;
1547+ }
1548+ smu->watermarks_bitmap |= WATERMARKS_LOADED;
1549+ }
1550+
15471551 return 0;
15481552 }
15491553
drivers/gpu/drm/amd/powerplay/renoir_ppt.c+6−5
@@ -111,8 +111,8 @@ static struct smu_12_0_cmn2aisc_mapping renoir_clk_map[SMU_CLK_COUNT] = { · 110 unmodified lines
111111 CLK_MAP(GFXCLK, CLOCK_GFXCLK),
112112 CLK_MAP(SCLK, CLOCK_GFXCLK),
113113 CLK_MAP(SOCCLK, CLOCK_SOCCLK),
114− CLK_MAP(UCLK, CLOCK_UMCCLK),
115− CLK_MAP(MCLK, CLOCK_UMCCLK),
114+ CLK_MAP(UCLK, CLOCK_FCLK),
115+ CLK_MAP(MCLK, CLOCK_FCLK),
116116 };
117117
118118 static struct smu_12_0_cmn2aisc_mapping renoir_table_map[SMU_TABLE_COUNT] = {
@@ -280,7 +280,7 @@ static int renoir_print_clk_levels(struct smu_context *smu, · 161 unmodified lines
280280 break;
281281 case SMU_MCLK:
282282 count = NUM_MEMCLK_DPM_LEVELS;
283− cur_value = metrics.ClockFrequency[CLOCK_UMCCLK];
283+ cur_value = metrics.ClockFrequency[CLOCK_FCLK];
284284 break;
285285 case SMU_DCEFCLK:
286286 count = NUM_DCFCLK_DPM_LEVELS;
@@ -806,9 +806,10 @@ static int renoir_set_watermarks_table( · 519 unmodified lines
806806 clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id;
807807 }
808808
809+ smu->watermarks_bitmap |= WATERMARKS_EXIST;
810+
809811 /* pass data to smu controller */
810− if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
811− !(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
812+ if (!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
812813 ret = smu_write_watermarks_table(smu);
813814 if (ret) {
814815 pr_err("Failed to update WMTABLE!");
drivers/gpu/drm/amd/powerplay/smu_v11_0.c+5−1
@@ -978,8 +978,12 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) · 977 unmodified lines
978978 struct smu_11_0_max_sustainable_clocks *max_sustainable_clocks;
979979 int ret = 0;
980980
981− max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
981+ if (!smu->smu_table.max_sustainable_clocks)
982+ max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
982983 GFP_KERNEL);
984+ else
985+ max_sustainable_clocks = smu->smu_table.max_sustainable_clocks;
986+
983987 smu->smu_table.max_sustainable_clocks = (void *)max_sustainable_clocks;
984988
985989 max_sustainable_clocks->uclock = smu->smu_table.boot_values.uclk / 100;
drivers/gpu/drm/amd/powerplay/smu_v12_0.c+0−3
@@ -458,9 +458,6 @@ int smu_v12_0_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_ · 457 unmodified lines
458458 {
459459 int ret = 0;
460460
461− if (max < min)
462− return -EINVAL;
463−
464461 switch (clk_type) {
465462 case SMU_GFXCLK:
466463 case SMU_SCLK:
drivers/gpu/drm/arm/display/komeda/komeda_drv.c+2−2
@@ -146,14 +146,14 @@ static const struct of_device_id komeda_of_match[] = { · 145 unmodified lines
146146
147147 MODULE_DEVICE_TABLE(of, komeda_of_match);
148148
149−static int komeda_rt_pm_suspend(struct device *dev)
149+static int __maybe_unused komeda_rt_pm_suspend(struct device *dev)
150150 {
151151 struct komeda_drv *mdrv = dev_get_drvdata(dev);
152152
153153 return komeda_dev_suspend(mdrv->mdev);
154154 }
155155
156−static int komeda_rt_pm_resume(struct device *dev)
156+static int __maybe_unused komeda_rt_pm_resume(struct device *dev)
157157 {
158158 struct komeda_drv *mdrv = dev_get_drvdata(dev);
159159
drivers/gpu/drm/bochs/bochs_hw.c+2−4
@@ -156,10 +156,8 @@ int bochs_hw_init(struct drm_device *dev) · 155 unmodified lines
156156 size = min(size, mem);
157157 }
158158
159− if (pci_request_region(pdev, 0, "bochs-drm") != 0) {
160− DRM_ERROR("Cannot request framebuffer\n");
161− return -EBUSY;
162− }
159+ if (pci_request_region(pdev, 0, "bochs-drm") != 0)
160+ DRM_WARN("Cannot request framebuffer, boot fb still active?\n");
163161
164162 bochs->fb_map = ioremap(addr, size);
165163 if (bochs->fb_map == NULL) {
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c+1−2
@@ -210,8 +210,7 @@ static int anx6345_dp_link_training(struct anx6345 *anx6345) · 209 unmodified lines
210210 if (err)
211211 return err;
212212
213− dpcd[0] = drm_dp_max_link_rate(anx6345->dpcd);
214− dpcd[0] = drm_dp_link_rate_to_bw_code(dpcd[0]);
213+ dpcd[0] = dp_bw;
215214 err = regmap_write(anx6345->map[I2C_IDX_DPTX],
216215 SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
217216 if (err)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+26−20
@@ -1624,28 +1624,34 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode) · 1623 unmodified lines
16241624 frame.colorspace = HDMI_COLORSPACE_RGB;
16251625
16261626 /* Set up colorimetry */
1627− switch (hdmi->hdmi_data.enc_out_encoding) {
1628− case V4L2_YCBCR_ENC_601:
1629− if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV601)
1630− frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
1631− else
1627+ if (!hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) {
1628+ switch (hdmi->hdmi_data.enc_out_encoding) {
1629+ case V4L2_YCBCR_ENC_601:
1630+ if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV601)
1631+ frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
1632+ else
1633+ frame.colorimetry = HDMI_COLORIMETRY_ITU_601;
1634+ frame.extended_colorimetry =
1635+ HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
1636+ break;
1637+ case V4L2_YCBCR_ENC_709:
1638+ if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV709)
1639+ frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
1640+ else
1641+ frame.colorimetry = HDMI_COLORIMETRY_ITU_709;
1642+ frame.extended_colorimetry =
1643+ HDMI_EXTENDED_COLORIMETRY_XV_YCC_709;
1644+ break;
1645+ default: /* Carries no data */
16321646 frame.colorimetry = HDMI_COLORIMETRY_ITU_601;
1647+ frame.extended_colorimetry =
1648+ HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
1649+ break;
1650+ }
1651+ } else {
1652+ frame.colorimetry = HDMI_COLORIMETRY_NONE;
16331653 frame.extended_colorimetry =
1634− HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
1635− break;
1636− case V4L2_YCBCR_ENC_709:
1637− if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV709)
1638− frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
1639− else
1640− frame.colorimetry = HDMI_COLORIMETRY_ITU_709;
1641− frame.extended_colorimetry =
1642− HDMI_EXTENDED_COLORIMETRY_XV_YCC_709;
1643− break;
1644− default: /* Carries no data */
1645− frame.colorimetry = HDMI_COLORIMETRY_ITU_601;
1646− frame.extended_colorimetry =
1647− HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
1648− break;
1654+ HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
16491655 }
16501656
16511657 frame.scan_mode = HDMI_SCAN_MODE_NONE;
drivers/gpu/drm/drm_dp_mst_topology.c+126−58
@@ -1935,7 +1935,7 @@ static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port, · 1934 unmodified lines
19351935 return parent_lct + 1;
19361936 }
19371937
1938−static bool drm_dp_mst_is_dp_mst_end_device(u8 pdt, bool mcs)
1938+static bool drm_dp_mst_is_end_device(u8 pdt, bool mcs)
19391939 {
19401940 switch (pdt) {
19411941 case DP_PEER_DEVICE_DP_LEGACY_CONV:
@@ -1965,13 +1965,13 @@ drm_dp_port_set_pdt(struct drm_dp_mst_port *port, u8 new_pdt, · 23 unmodified lines
19651965
19661966 /* Teardown the old pdt, if there is one */
19671967 if (port->pdt != DP_PEER_DEVICE_NONE) {
1968− if (drm_dp_mst_is_dp_mst_end_device(port->pdt, port->mcs)) {
1968+ if (drm_dp_mst_is_end_device(port->pdt, port->mcs)) {
19691969 /*
19701970 * If the new PDT would also have an i2c bus,
19711971 * don't bother with reregistering it
19721972 */
19731973 if (new_pdt != DP_PEER_DEVICE_NONE &&
1974− drm_dp_mst_is_dp_mst_end_device(new_pdt, new_mcs)) {
1974+ drm_dp_mst_is_end_device(new_pdt, new_mcs)) {
19751975 port->pdt = new_pdt;
19761976 port->mcs = new_mcs;
19771977 return 0;
@@ -1991,7 +1991,7 @@ drm_dp_port_set_pdt(struct drm_dp_mst_port *port, u8 new_pdt, · 13 unmodified lines
19911991 port->mcs = new_mcs;
19921992
19931993 if (port->pdt != DP_PEER_DEVICE_NONE) {
1994− if (drm_dp_mst_is_dp_mst_end_device(port->pdt, port->mcs)) {
1994+ if (drm_dp_mst_is_end_device(port->pdt, port->mcs)) {
19951995 /* add i2c over sideband */
19961996 ret = drm_dp_mst_register_i2c_bus(&port->aux);
19971997 } else {
@@ -2172,7 +2172,7 @@ drm_dp_mst_port_add_connector(struct drm_dp_mst_branch *mstb, · 174 unmodified lines
21722172 }
21732173
21742174 if (port->pdt != DP_PEER_DEVICE_NONE &&
2175− drm_dp_mst_is_dp_mst_end_device(port->pdt, port->mcs)) {
2175+ drm_dp_mst_is_end_device(port->pdt, port->mcs)) {
21762176 port->cached_edid = drm_get_edid(port->connector,
21772177 &port->aux.ddc);
21782178 drm_connector_set_tile_property(port->connector);
@@ -2302,14 +2302,18 @@ drm_dp_mst_handle_link_address_port(struct drm_dp_mst_branch *mstb, · 123 unmodified lines
23022302 mutex_unlock(&mgr->lock);
23032303 }
23042304
2305− if (old_ddps != port->ddps) {
2306− if (port->ddps) {
2307− if (!port->input) {
2308− drm_dp_send_enum_path_resources(mgr, mstb,
2309− port);
2310− }
2305+ /*
2306+ * Reprobe PBN caps on both hotplug, and when re-probing the link
2307+ * for our parent mstb
2308+ */
2309+ if (old_ddps != port->ddps || !created) {
2310+ if (port->ddps && !port->input) {
2311+ ret = drm_dp_send_enum_path_resources(mgr, mstb,
2312+ port);
2313+ if (ret == 1)
2314+ changed = true;
23112315 } else {
2312− port->available_pbn = 0;
2316+ port->full_pbn = 0;
23132317 }
23142318 }
23152319
@@ -2401,11 +2405,10 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 85 unmodified lines
24012405 port->ddps = conn_stat->displayport_device_plug_status;
24022406
24032407 if (old_ddps != port->ddps) {
2404− if (port->ddps) {
2405− dowork = true;
2406− } else {
2407− port->available_pbn = 0;
2408− }
2408+ if (port->ddps && !port->input)
2409+ drm_dp_send_enum_path_resources(mgr, mstb, port);
2410+ else
2411+ port->full_pbn = 0;
24092412 }
24102413
24112414 new_pdt = port->input ? DP_PEER_DEVICE_NONE : conn_stat->peer_device_type;
@@ -2556,13 +2559,6 @@ static int drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *mg · 144 unmodified lines
25562559 if (port->input || !port->ddps)
25572560 continue;
25582561
2559− if (!port->available_pbn) {
2560− drm_modeset_lock(&mgr->base.lock, NULL);
2561− drm_dp_send_enum_path_resources(mgr, mstb, port);
2562− drm_modeset_unlock(&mgr->base.lock);
2563− changed = true;
2564− }
2565−
25662562 if (port->mstb)
25672563 mstb_child = drm_dp_mst_topology_get_mstb_validated(
25682564 mgr, port->mstb);
@@ -2990,6 +2986,7 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, · 421 unmodified lines
29902986
29912987 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
29922988 if (ret > 0) {
2989+ ret = 0;
29932990 path_res = &txmsg->reply.u.path_resources;
29942991
29952992 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) {
@@ -3002,14 +2999,22 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, · 6 unmodified lines
30022999 path_res->port_number,
30033000 path_res->full_payload_bw_number,
30043001 path_res->avail_payload_bw_number);
3005− port->available_pbn =
3006− path_res->avail_payload_bw_number;
3002+
3003+ /*
3004+ * If something changed, make sure we send a
3005+ * hotplug
3006+ */
3007+ if (port->full_pbn != path_res->full_payload_bw_number ||
3008+ port->fec_capable != path_res->fec_capable)
3009+ ret = 1;
3010+
3011+ port->full_pbn = path_res->full_payload_bw_number;
30073012 port->fec_capable = path_res->fec_capable;
30083013 }
30093014 }
30103015
30113016 kfree(txmsg);
3012− return 0;
3017+ return ret;
30133018 }
30143019
30153020 static struct drm_dp_mst_port *drm_dp_get_last_connected_port_to_mstb(struct drm_dp_mst_branch *mstb)
@@ -3596,13 +3601,9 @@ drm_dp_mst_topology_mgr_invalidate_mstb(struct drm_dp_mst_branch *mstb) · 580 unmodified lines
35963601 /* The link address will need to be re-sent on resume */
35973602 mstb->link_address_sent = false;
35983603
3599− list_for_each_entry(port, &mstb->ports, next) {
3600− /* The PBN for each port will also need to be re-probed */
3601− port->available_pbn = 0;
3602−
3604+ list_for_each_entry(port, &mstb->ports, next)
36033605 if (port->mstb)
36043606 drm_dp_mst_topology_mgr_invalidate_mstb(port->mstb);
3605− }
36063607 }
36073608
36083609 /**
@@ -4829,41 +4830,102 @@ static bool drm_dp_mst_port_downstream_of_branch(struct drm_dp_mst_port *port, · 1220 unmodified lines
48294830 return false;
48304831 }
48314832
4832−static inline
4833−int drm_dp_mst_atomic_check_bw_limit(struct drm_dp_mst_branch *branch,
4834− struct drm_dp_mst_topology_state *mst_state)
4833+static int
4834+drm_dp_mst_atomic_check_port_bw_limit(struct drm_dp_mst_port *port,
4835+ struct drm_dp_mst_topology_state *state);
4836+
4837+static int
4838+drm_dp_mst_atomic_check_mstb_bw_limit(struct drm_dp_mst_branch *mstb,
4839+ struct drm_dp_mst_topology_state *state)
48354840 {
4836− struct drm_dp_mst_port *port;
48374841 struct drm_dp_vcpi_allocation *vcpi;
4838− int pbn_limit = 0, pbn_used = 0;
4842+ struct drm_dp_mst_port *port;
4843+ int pbn_used = 0, ret;
4844+ bool found = false;
48394845
4840− list_for_each_entry(port, &branch->ports, next) {
4841− if (port->mstb)
4842− if (drm_dp_mst_atomic_check_bw_limit(port->mstb, mst_state))
4843− return -ENOSPC;
4846+ /* Check that we have at least one port in our state that's downstream
4847+ * of this branch, otherwise we can skip this branch
4848+ */
4849+ list_for_each_entry(vcpi, &state->vcpis, next) {
4850+ if (!vcpi->pbn ||
4851+ !drm_dp_mst_port_downstream_of_branch(vcpi->port, mstb))
4852+ continue;
48444853
4845− if (port->available_pbn > 0)
4846− pbn_limit = port->available_pbn;
4854+ found = true;
4855+ break;
48474856 }
4848− DRM_DEBUG_ATOMIC("[MST BRANCH:%p] branch has %d PBN available\n",
4849− branch, pbn_limit);
4857+ if (!found)
4858+ return 0;
48504859
4851− list_for_each_entry(vcpi, &mst_state->vcpis, next) {
4852− if (!vcpi->pbn)
4853− continue;
4860+ if (mstb->port_parent)
4861+ DRM_DEBUG_ATOMIC("[MSTB:%p] [MST PORT:%p] Checking bandwidth limits on [MSTB:%p]\n",
4862+ mstb->port_parent->parent, mstb->port_parent,
4863+ mstb);
4864+ else
4865+ DRM_DEBUG_ATOMIC("[MSTB:%p] Checking bandwidth limits\n",
4866+ mstb);
4867+
4868+ list_for_each_entry(port, &mstb->ports, next) {
4869+ ret = drm_dp_mst_atomic_check_port_bw_limit(port, state);
4870+ if (ret < 0)
4871+ return ret;
48544872
4855− if (drm_dp_mst_port_downstream_of_branch(vcpi->port, branch))
4856− pbn_used += vcpi->pbn;
4873+ pbn_used += ret;
48574874 }
4858− DRM_DEBUG_ATOMIC("[MST BRANCH:%p] branch used %d PBN\n",
4859− branch, pbn_used);
48604875
4861− if (pbn_used > pbn_limit) {
4862− DRM_DEBUG_ATOMIC("[MST BRANCH:%p] No available bandwidth\n",
4863− branch);
4876+ return pbn_used;
4877+}
4878+
4879+static int
4880+drm_dp_mst_atomic_check_port_bw_limit(struct drm_dp_mst_port *port,
4881+ struct drm_dp_mst_topology_state *state)
4882+{
4883+ struct drm_dp_vcpi_allocation *vcpi;
4884+ int pbn_used = 0;
4885+
4886+ if (port->pdt == DP_PEER_DEVICE_NONE)
4887+ return 0;
4888+
4889+ if (drm_dp_mst_is_end_device(port->pdt, port->mcs)) {
4890+ bool found = false;
4891+
4892+ list_for_each_entry(vcpi, &state->vcpis, next) {
4893+ if (vcpi->port != port)
4894+ continue;
4895+ if (!vcpi->pbn)
4896+ return 0;
4897+
4898+ found = true;
4899+ break;
4900+ }
4901+ if (!found)
4902+ return 0;
4903+
4904+ /* This should never happen, as it means we tried to
4905+ * set a mode before querying the full_pbn
4906+ */
4907+ if (WARN_ON(!port->full_pbn))
4908+ return -EINVAL;
4909+
4910+ pbn_used = vcpi->pbn;
4911+ } else {
4912+ pbn_used = drm_dp_mst_atomic_check_mstb_bw_limit(port->mstb,
4913+ state);
4914+ if (pbn_used <= 0)
4915+ return pbn_used;
4916+ }
4917+
4918+ if (pbn_used > port->full_pbn) {
4919+ DRM_DEBUG_ATOMIC("[MSTB:%p] [MST PORT:%p] required PBN of %d exceeds port limit of %d\n",
4920+ port->parent, port, pbn_used,
4921+ port->full_pbn);
48644922 return -ENOSPC;
48654923 }
4866− return 0;
4924+
4925+ DRM_DEBUG_ATOMIC("[MSTB:%p] [MST PORT:%p] uses %d out of %d PBN\n",
4926+ port->parent, port, pbn_used, port->full_pbn);
4927+
4928+ return pbn_used;
48674929 }
48684930
48694931 static inline int
@@ -5061,9 +5123,15 @@ int drm_dp_mst_atomic_check(struct drm_atomic_state *state) · 191 unmodified lines
50615123 ret = drm_dp_mst_atomic_check_vcpi_alloc_limit(mgr, mst_state);
50625124 if (ret)
50635125 break;
5064− ret = drm_dp_mst_atomic_check_bw_limit(mgr->mst_primary, mst_state);
5065− if (ret)
5126+
5127+ mutex_lock(&mgr->lock);
5128+ ret = drm_dp_mst_atomic_check_mstb_bw_limit(mgr->mst_primary,
5129+ mst_state);
5130+ mutex_unlock(&mgr->lock);
5131+ if (ret < 0)
50665132 break;
5133+ else
5134+ ret = 0;
50675135 }
50685136
50695137 return ret;
drivers/gpu/drm/drm_gem_shmem_helper.c+11−5
@@ -254,11 +254,16 @@ static void *drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem) · 253 unmodified lines
254254 if (ret)
255255 goto err_zero_use;
256256
257− if (obj->import_attach)
257+ if (obj->import_attach) {
258258 shmem->vaddr = dma_buf_vmap(obj->import_attach->dmabuf);
259− else
259+ } else {
260+ pgprot_t prot = PAGE_KERNEL;
261+
262+ if (!shmem->map_cached)
263+ prot = pgprot_writecombine(prot);
260264 shmem->vaddr = vmap(shmem->pages, obj->size >> PAGE_SHIFT,
261− VM_MAP, pgprot_writecombine(PAGE_KERNEL));
265+ VM_MAP, prot);
266+ }
262267
263268 if (!shmem->vaddr) {
264269 DRM_DEBUG_KMS("Failed to vmap pages\n");
@@ -540,8 +545,9 @@ int drm_gem_shmem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) · 275 unmodified lines
540545 }
541546
542547 vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND;
543− vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
544− vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
548+ vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
549+ if (!shmem->map_cached)
550+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
545551 vma->vm_ops = &drm_gem_shmem_vm_ops;
546552
547553 return 0;
drivers/gpu/drm/drm_lease.c+2−1
@@ -542,10 +542,12 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, · 541 unmodified lines
542542 }
543543
544544 DRM_DEBUG_LEASE("Creating lease\n");
545+ /* lessee will take the ownership of leases */
545546 lessee = drm_lease_create(lessor, &leases);
546547
547548 if (IS_ERR(lessee)) {
548549 ret = PTR_ERR(lessee);
550+ idr_destroy(&leases);
549551 goto out_leases;
550552 }
551553
@@ -580,7 +582,6 @@ out_lessee: · 28 unmodified lines
580582
581583 out_leases:
582584 put_unused_fd(fd);
583− idr_destroy(&leases);
584585
585586 DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret);
586587 return ret;
drivers/gpu/drm/exynos/exynos5433_drm_decon.c+3−2
@@ -55,6 +55,7 @@ static const char * const decon_clks_name[] = { · 54 unmodified lines
5555 struct decon_context {
5656 struct device *dev;
5757 struct drm_device *drm_dev;
58+ void *dma_priv;
5859 struct exynos_drm_crtc *crtc;
5960 struct exynos_drm_plane planes[WINDOWS_NR];
6061 struct exynos_drm_plane_config configs[WINDOWS_NR];
@@ -644,7 +645,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data) · 583 unmodified lines
644645
645646 decon_clear_channels(ctx->crtc);
646647
647− return exynos_drm_register_dma(drm_dev, dev);
648+ return exynos_drm_register_dma(drm_dev, dev, &ctx->dma_priv);
648649 }
649650
650651 static void decon_unbind(struct device *dev, struct device *master, void *data)
@@ -654,7 +655,7 @@ static void decon_unbind(struct device *dev, struct device *master, void *data) · 3 unmodified lines
654655 decon_atomic_disable(ctx->crtc);
655656
656657 /* detach this sub driver from iommu mapping if supported. */
657− exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev);
658+ exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev, &ctx->dma_priv);
658659 }
659660
660661 static const struct component_ops decon_component_ops = {
drivers/gpu/drm/exynos/exynos7_drm_decon.c+3−2
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 struct decon_context {
4141 struct device *dev;
4242 struct drm_device *drm_dev;
43+ void *dma_priv;
4344 struct exynos_drm_crtc *crtc;
4445 struct exynos_drm_plane planes[WINDOWS_NR];
4546 struct exynos_drm_plane_config configs[WINDOWS_NR];
@@ -127,13 +128,13 @@ static int decon_ctx_initialize(struct decon_context *ctx, · 81 unmodified lines
127128
128129 decon_clear_channels(ctx->crtc);
129130
130− return exynos_drm_register_dma(drm_dev, ctx->dev);
131+ return exynos_drm_register_dma(drm_dev, ctx->dev, &ctx->dma_priv);
131132 }
132133
133134 static void decon_ctx_remove(struct decon_context *ctx)
134135 {
135136 /* detach this sub driver from iommu mapping if supported. */
136− exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev);
137+ exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev, &ctx->dma_priv);
137138 }
138139
139140 static u32 decon_calc_clkdiv(struct decon_context *ctx,
drivers/gpu/drm/exynos/exynos_drm_dma.c+19−9
@@ -58,7 +58,7 @@ static inline void clear_dma_max_seg_size(struct device *dev) · 57 unmodified lines
5858 * mapping.
5959 */
6060 static int drm_iommu_attach_device(struct drm_device *drm_dev,
61− struct device *subdrv_dev)
61+ struct device *subdrv_dev, void **dma_priv)
6262 {
6363 struct exynos_drm_private *priv = drm_dev->dev_private;
6464 int ret;
@@ -74,7 +74,14 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, · 9 unmodified lines
7474 return ret;
7575
7676 if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
77− if (to_dma_iommu_mapping(subdrv_dev))
77+ /*
78+ * Keep the original DMA mapping of the sub-device and
79+ * restore it on Exynos DRM detach, otherwise the DMA
80+ * framework considers it as IOMMU-less during the next
81+ * probe (in case of deferred probe or modular build)
82+ */
83+ *dma_priv = to_dma_iommu_mapping(subdrv_dev);
84+ if (*dma_priv)
7885 arm_iommu_detach_device(subdrv_dev);
7986
8087 ret = arm_iommu_attach_device(subdrv_dev, priv->mapping);
@@ -98,19 +105,21 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, · 17 unmodified lines
98105 * mapping
99106 */
100107 static void drm_iommu_detach_device(struct drm_device *drm_dev,
101− struct device *subdrv_dev)
108+ struct device *subdrv_dev, void **dma_priv)
102109 {
103110 struct exynos_drm_private *priv = drm_dev->dev_private;
104111
105− if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU))
112+ if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
106113 arm_iommu_detach_device(subdrv_dev);
107− else if (IS_ENABLED(CONFIG_IOMMU_DMA))
114+ arm_iommu_attach_device(subdrv_dev, *dma_priv);
115+ } else if (IS_ENABLED(CONFIG_IOMMU_DMA))
108116 iommu_detach_device(priv->mapping, subdrv_dev);
109117
110118 clear_dma_max_seg_size(subdrv_dev);
111119 }
112120
113−int exynos_drm_register_dma(struct drm_device *drm, struct device *dev)
121+int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,
122+ void **dma_priv)
114123 {
115124 struct exynos_drm_private *priv = drm->dev_private;
116125
@@ -137,13 +146,14 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev) · 20 unmodified lines
137146 priv->mapping = mapping;
138147 }
139148
140− return drm_iommu_attach_device(drm, dev);
149+ return drm_iommu_attach_device(drm, dev, dma_priv);
141150 }
142151
143−void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev)
152+void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev,
153+ void **dma_priv)
144154 {
145155 if (IS_ENABLED(CONFIG_EXYNOS_IOMMU))
146− drm_iommu_detach_device(drm, dev);
156+ drm_iommu_detach_device(drm, dev, dma_priv);
147157 }
148158
149159 void exynos_drm_cleanup_dma(struct drm_device *drm)
drivers/gpu/drm/exynos/exynos_drm_drv.h+4−2
@@ -223,8 +223,10 @@ static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) · 222 unmodified lines
223223 return priv->mapping ? true : false;
224224 }
225225
226−int exynos_drm_register_dma(struct drm_device *drm, struct device *dev);
227−void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev);
226+int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,
227+ void **dma_priv);
228+void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev,
229+ void **dma_priv);
228230 void exynos_drm_cleanup_dma(struct drm_device *drm);
229231
230232 #ifdef CONFIG_DRM_EXYNOS_DPI
drivers/gpu/drm/exynos/exynos_drm_dsi.c+7−5
@@ -1773,8 +1773,9 @@ static int exynos_dsi_probe(struct platform_device *pdev) · 1772 unmodified lines
17731773 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies),
17741774 dsi->supplies);
17751775 if (ret) {
1776− dev_info(dev, "failed to get regulators: %d\n", ret);
1777− return -EPROBE_DEFER;
1776+ if (ret != -EPROBE_DEFER)
1777+ dev_info(dev, "failed to get regulators: %d\n", ret);
1778+ return ret;
17781779 }
17791780
17801781 dsi->clks = devm_kcalloc(dev,
@@ -1787,9 +1788,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) · 6 unmodified lines
17871788 dsi->clks[i] = devm_clk_get(dev, clk_names[i]);
17881789 if (IS_ERR(dsi->clks[i])) {
17891790 if (strcmp(clk_names[i], "sclk_mipi") == 0) {
1790− strcpy(clk_names[i], OLD_SCLK_MIPI_CLK_NAME);
1791− i--;
1792− continue;
1791+ dsi->clks[i] = devm_clk_get(dev,
1792+ OLD_SCLK_MIPI_CLK_NAME);
1793+ if (!IS_ERR(dsi->clks[i]))
1794+ continue;
17931795 }
17941796
17951797 dev_info(dev, "failed to get the clock: %s\n",
drivers/gpu/drm/exynos/exynos_drm_fimc.c+3−2
@@ -97,6 +97,7 @@ struct fimc_scaler { · 96 unmodified lines
9797 struct fimc_context {
9898 struct exynos_drm_ipp ipp;
9999 struct drm_device *drm_dev;
100+ void *dma_priv;
100101 struct device *dev;
101102 struct exynos_drm_ipp_task *task;
102103 struct exynos_drm_ipp_formats *formats;
@@ -1133,7 +1134,7 @@ static int fimc_bind(struct device *dev, struct device *master, void *data) · 1030 unmodified lines
11331134
11341135 ctx->drm_dev = drm_dev;
11351136 ipp->drm_dev = drm_dev;
1136− exynos_drm_register_dma(drm_dev, dev);
1137+ exynos_drm_register_dma(drm_dev, dev, &ctx->dma_priv);
11371138
11381139 exynos_drm_ipp_register(dev, ipp, &ipp_funcs,
11391140 DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE |
@@ -1153,7 +1154,7 @@ static void fimc_unbind(struct device *dev, struct device *master, · 13 unmodified lines
11531154 struct exynos_drm_ipp *ipp = &ctx->ipp;
11541155
11551156 exynos_drm_ipp_unregister(dev, ipp);
1156− exynos_drm_unregister_dma(drm_dev, dev);
1157+ exynos_drm_unregister_dma(drm_dev, dev, &ctx->dma_priv);
11571158 }
11581159
11591160 static const struct component_ops fimc_component_ops = {
drivers/gpu/drm/exynos/exynos_drm_fimd.c+3−2
@@ -167,6 +167,7 @@ static struct fimd_driver_data exynos5420_fimd_driver_data = { · 166 unmodified lines
167167 struct fimd_context {
168168 struct device *dev;
169169 struct drm_device *drm_dev;
170+ void *dma_priv;
170171 struct exynos_drm_crtc *crtc;
171172 struct exynos_drm_plane planes[WINDOWS_NR];
172173 struct exynos_drm_plane_config configs[WINDOWS_NR];
@@ -1090,7 +1091,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) · 917 unmodified lines
10901091 if (is_drm_iommu_supported(drm_dev))
10911092 fimd_clear_channels(ctx->crtc);
10921093
1093− return exynos_drm_register_dma(drm_dev, dev);
1094+ return exynos_drm_register_dma(drm_dev, dev, &ctx->dma_priv);
10941095 }
10951096
10961097 static void fimd_unbind(struct device *dev, struct device *master,
@@ -1100,7 +1101,7 @@ static void fimd_unbind(struct device *dev, struct device *master, · 3 unmodified lines
11001101
11011102 fimd_atomic_disable(ctx->crtc);
11021103
1103− exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev);
1104+ exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev, &ctx->dma_priv);
11041105
11051106 if (ctx->encoder)
11061107 exynos_dpi_remove(ctx->encoder);
drivers/gpu/drm/exynos/exynos_drm_g2d.c+3−2
@@ -232,6 +232,7 @@ struct g2d_runqueue_node { · 231 unmodified lines
232232
233233 struct g2d_data {
234234 struct device *dev;
235+ void *dma_priv;
235236 struct clk *gate_clk;
236237 void __iomem *regs;
237238 int irq;
@@ -1409,7 +1410,7 @@ static int g2d_bind(struct device *dev, struct device *master, void *data) · 1171 unmodified lines
14091410 return ret;
14101411 }
14111412
1412− ret = exynos_drm_register_dma(drm_dev, dev);
1413+ ret = exynos_drm_register_dma(drm_dev, dev, &g2d->dma_priv);
14131414 if (ret < 0) {
14141415 dev_err(dev, "failed to enable iommu.\n");
14151416 g2d_fini_cmdlist(g2d);
@@ -1434,7 +1435,7 @@ static void g2d_unbind(struct device *dev, struct device *master, void *data) · 18 unmodified lines
14341435 priv->g2d_dev = NULL;
14351436
14361437 cancel_work_sync(&g2d->runqueue_work);
1437− exynos_drm_unregister_dma(g2d->drm_dev, dev);
1438+ exynos_drm_unregister_dma(g2d->drm_dev, dev, &g2d->dma_priv);
14381439 }
14391440
14401441 static const struct component_ops g2d_component_ops = {
drivers/gpu/drm/exynos/exynos_drm_gsc.c+3−2
@@ -97,6 +97,7 @@ struct gsc_scaler { · 96 unmodified lines
9797 struct gsc_context {
9898 struct exynos_drm_ipp ipp;
9999 struct drm_device *drm_dev;
100+ void *dma_priv;
100101 struct device *dev;
101102 struct exynos_drm_ipp_task *task;
102103 struct exynos_drm_ipp_formats *formats;
@@ -1169,7 +1170,7 @@ static int gsc_bind(struct device *dev, struct device *master, void *data) · 1066 unmodified lines
11691170
11701171 ctx->drm_dev = drm_dev;
11711172 ctx->drm_dev = drm_dev;
1172− exynos_drm_register_dma(drm_dev, dev);
1173+ exynos_drm_register_dma(drm_dev, dev, &ctx->dma_priv);
11731174
11741175 exynos_drm_ipp_register(dev, ipp, &ipp_funcs,
11751176 DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE |
@@ -1189,7 +1190,7 @@ static void gsc_unbind(struct device *dev, struct device *master, · 13 unmodified lines
11891190 struct exynos_drm_ipp *ipp = &ctx->ipp;
11901191
11911192 exynos_drm_ipp_unregister(dev, ipp);
1192− exynos_drm_unregister_dma(drm_dev, dev);
1193+ exynos_drm_unregister_dma(drm_dev, dev, &ctx->dma_priv);
11931194 }
11941195
11951196 static const struct component_ops gsc_component_ops = {
drivers/gpu/drm/exynos/exynos_drm_rotator.c+3−2
@@ -56,6 +56,7 @@ struct rot_variant { · 55 unmodified lines
5656 struct rot_context {
5757 struct exynos_drm_ipp ipp;
5858 struct drm_device *drm_dev;
59+ void *dma_priv;
5960 struct device *dev;
6061 void __iomem *regs;
6162 struct clk *clock;
@@ -243,7 +244,7 @@ static int rotator_bind(struct device *dev, struct device *master, void *data) · 181 unmodified lines
243244
244245 rot->drm_dev = drm_dev;
245246 ipp->drm_dev = drm_dev;
246− exynos_drm_register_dma(drm_dev, dev);
247+ exynos_drm_register_dma(drm_dev, dev, &rot->dma_priv);
247248
248249 exynos_drm_ipp_register(dev, ipp, &ipp_funcs,
249250 DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE,
@@ -261,7 +262,7 @@ static void rotator_unbind(struct device *dev, struct device *master, · 11 unmodified lines
261262 struct exynos_drm_ipp *ipp = &rot->ipp;
262263
263264 exynos_drm_ipp_unregister(dev, ipp);
264− exynos_drm_unregister_dma(rot->drm_dev, rot->dev);
265+ exynos_drm_unregister_dma(rot->drm_dev, rot->dev, &rot->dma_priv);
265266 }
266267
267268 static const struct component_ops rotator_component_ops = {
drivers/gpu/drm/exynos/exynos_drm_scaler.c+4−2
@@ -39,6 +39,7 @@ struct scaler_data { · 38 unmodified lines
3939 struct scaler_context {
4040 struct exynos_drm_ipp ipp;
4141 struct drm_device *drm_dev;
42+ void *dma_priv;
4243 struct device *dev;
4344 void __iomem *regs;
4445 struct clk *clock[SCALER_MAX_CLK];
@@ -450,7 +451,7 @@ static int scaler_bind(struct device *dev, struct device *master, void *data) · 405 unmodified lines
450451
451452 scaler->drm_dev = drm_dev;
452453 ipp->drm_dev = drm_dev;
453− exynos_drm_register_dma(drm_dev, dev);
454+ exynos_drm_register_dma(drm_dev, dev, &scaler->dma_priv);
454455
455456 exynos_drm_ipp_register(dev, ipp, &ipp_funcs,
456457 DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE |
@@ -470,7 +471,8 @@ static void scaler_unbind(struct device *dev, struct device *master, · 13 unmodified lines
470471 struct exynos_drm_ipp *ipp = &scaler->ipp;
471472
472473 exynos_drm_ipp_unregister(dev, ipp);
473− exynos_drm_unregister_dma(scaler->drm_dev, scaler->dev);
474+ exynos_drm_unregister_dma(scaler->drm_dev, scaler->dev,
475+ &scaler->dma_priv);
474476 }
475477
476478 static const struct component_ops scaler_component_ops = {
drivers/gpu/drm/exynos/exynos_hdmi.c+12−10
@@ -1805,18 +1805,10 @@ static int hdmi_resources_init(struct hdmi_context *hdata) · 1804 unmodified lines
18051805
18061806 hdata->reg_hdmi_en = devm_regulator_get_optional(dev, "hdmi-en");
18071807
1808− if (PTR_ERR(hdata->reg_hdmi_en) != -ENODEV) {
1808+ if (PTR_ERR(hdata->reg_hdmi_en) != -ENODEV)
18091809 if (IS_ERR(hdata->reg_hdmi_en))
18101810 return PTR_ERR(hdata->reg_hdmi_en);
18111811
1812− ret = regulator_enable(hdata->reg_hdmi_en);
1813− if (ret) {
1814− DRM_DEV_ERROR(dev,
1815− "failed to enable hdmi-en regulator\n");
1816− return ret;
1817− }
1818− }
1819−
18201812 return hdmi_bridge_init(hdata);
18211813 }
18221814
@@ -2023,6 +2015,15 @@ static int hdmi_probe(struct platform_device *pdev) · 200 unmodified lines
20232015 }
20242016 }
20252017
2018+ if (!IS_ERR(hdata->reg_hdmi_en)) {
2019+ ret = regulator_enable(hdata->reg_hdmi_en);
2020+ if (ret) {
2021+ DRM_DEV_ERROR(dev,
2022+ "failed to enable hdmi-en regulator\n");
2023+ goto err_hdmiphy;
2024+ }
2025+ }
2026+
20262027 pm_runtime_enable(dev);
20272028
20282029 audio_infoframe = &hdata->audio.infoframe;
@@ -2047,7 +2048,8 @@ err_unregister_audio: · 18 unmodified lines
20472048
20482049 err_rpm_disable:
20492050 pm_runtime_disable(dev);
2050−
2051+ if (!IS_ERR(hdata->reg_hdmi_en))
2052+ regulator_disable(hdata->reg_hdmi_en);
20512053 err_hdmiphy:
20522054 if (hdata->hdmiphy_port)
20532055 put_device(&hdata->hdmiphy_port->dev);
drivers/gpu/drm/exynos/exynos_mixer.c+5−2
@@ -94,6 +94,7 @@ struct mixer_context { · 93 unmodified lines
9494 struct platform_device *pdev;
9595 struct device *dev;
9696 struct drm_device *drm_dev;
97+ void *dma_priv;
9798 struct exynos_drm_crtc *crtc;
9899 struct exynos_drm_plane planes[MIXER_WIN_NR];
99100 unsigned long flags;
@@ -894,12 +895,14 @@ static int mixer_initialize(struct mixer_context *mixer_ctx, · 794 unmodified lines
894895 }
895896 }
896897
897− return exynos_drm_register_dma(drm_dev, mixer_ctx->dev);
898+ return exynos_drm_register_dma(drm_dev, mixer_ctx->dev,
899+ &mixer_ctx->dma_priv);
898900 }
899901
900902 static void mixer_ctx_remove(struct mixer_context *mixer_ctx)
901903 {
902− exynos_drm_unregister_dma(mixer_ctx->drm_dev, mixer_ctx->dev);
904+ exynos_drm_unregister_dma(mixer_ctx->drm_dev, mixer_ctx->dev,
905+ &mixer_ctx->dma_priv);
903906 }
904907
905908 static int mixer_enable_vblank(struct exynos_drm_crtc *crtc)
drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h+0−1
@@ -83,7 +83,6 @@ · 82 unmodified lines
8383 #define VSIZE_OFST 20
8484 #define LDI_INT_EN 0x741C
8585 #define FRAME_END_INT_EN_OFST 1
86−#define UNDERFLOW_INT_EN_OFST 2
8786 #define LDI_CTRL 0x7420
8887 #define BPP_OFST 3
8988 #define DATA_GATE_EN BIT(2)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c+0−20
@@ -46,7 +46,6 @@ struct ade_hw_ctx { · 45 unmodified lines
4646 struct clk *media_noc_clk;
4747 struct clk *ade_pix_clk;
4848 struct reset_control *reset;
49− struct work_struct display_reset_wq;
5049 bool power_on;
5150 int irq;
5251
@@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *ctx) · 83 unmodified lines
136135 */
137136 ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
138137 FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
139− ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 1);
140138 }
141139
142140 static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(struct drm_crtc *crtc) · 161 unmodified lines
304302 MASK(1), 0);
305303 }
306304
307−static void drm_underflow_wq(struct work_struct *work)
308−{
309− struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
310− display_reset_wq);
311− struct drm_device *drm_dev = ctx->crtc->dev;
312− struct drm_atomic_state *state;
313−
314− state = drm_atomic_helper_suspend(drm_dev);
315− drm_atomic_helper_resume(drm_dev, state);
316−}
317−
318305 static irqreturn_t ade_irq_handler(int irq, void *data)
319306 {
320307 struct ade_hw_ctx *ctx = data;
@@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data) · 10 unmodified lines
331318 MASK(1), 1);
332319 drm_crtc_handle_vblank(crtc);
333320 }
334− if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
335− ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
336− MASK(1), 1);
337− DRM_ERROR("LDI underflow!");
338− schedule_work(&ctx->display_reset_wq);
339− }
340321
341322 return IRQ_HANDLED;
342323 }
@@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct platform_device *pdev, · 576 unmodified lines
919900 if (ret)
920901 return ERR_PTR(-EIO);
921902
922− INIT_WORK(&ctx->display_reset_wq, drm_underflow_wq);
923903 ctx->crtc = crtc;
924904
925905 return ctx;
drivers/gpu/drm/i915/Makefile+1−1
@@ -294,7 +294,7 @@ extra-$(CONFIG_DRM_I915_WERROR) += \ · 293 unmodified lines
294294 $(shell cd $(srctree)/$(src) && find * -name '*.h')))
295295
296296 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
297− cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
297+ cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
298298
299299 $(obj)/%.hdrtest: $(src)/%.h FORCE
300300 $(call if_changed_dep,hdrtest)
drivers/gpu/drm/i915/display/intel_display_power.c+24−5
@@ -4466,13 +4466,19 @@ static void icl_dbuf_disable(struct drm_i915_private *dev_priv) · 4465 unmodified lines
44664466
44674467 static void icl_mbus_init(struct drm_i915_private *dev_priv)
44684468 {
4469− u32 val;
4469+ u32 mask, val;
44704470
4471− val = MBUS_ABOX_BT_CREDIT_POOL1(16) |
4472− MBUS_ABOX_BT_CREDIT_POOL2(16) |
4473− MBUS_ABOX_B_CREDIT(1) |
4474− MBUS_ABOX_BW_CREDIT(1);
4471+ mask = MBUS_ABOX_BT_CREDIT_POOL1_MASK |
4472+ MBUS_ABOX_BT_CREDIT_POOL2_MASK |
4473+ MBUS_ABOX_B_CREDIT_MASK |
4474+ MBUS_ABOX_BW_CREDIT_MASK;
44754475
4476+ val = I915_READ(MBUS_ABOX_CTL);
4477+ val &= ~mask;
4478+ val |= MBUS_ABOX_BT_CREDIT_POOL1(16) |
4479+ MBUS_ABOX_BT_CREDIT_POOL2(16) |
4480+ MBUS_ABOX_B_CREDIT(1) |
4481+ MBUS_ABOX_BW_CREDIT(1);
44764482 I915_WRITE(MBUS_ABOX_CTL, val);
44774483 }
44784484
@@ -4968,8 +4974,21 @@ static void tgl_bw_buddy_init(struct drm_i915_private *dev_priv) · 489 unmodified lines
49684974 I915_WRITE(BW_BUDDY1_CTL, BW_BUDDY_DISABLE);
49694975 I915_WRITE(BW_BUDDY2_CTL, BW_BUDDY_DISABLE);
49704976 } else {
4977+ u32 val;
4978+
49714979 I915_WRITE(BW_BUDDY1_PAGE_MASK, table[i].page_mask);
49724980 I915_WRITE(BW_BUDDY2_PAGE_MASK, table[i].page_mask);
4981+
4982+ /* Wa_22010178259:tgl */
4983+ val = I915_READ(BW_BUDDY1_CTL);
4984+ val &= ~BW_BUDDY_TLB_REQ_TIMER_MASK;
4985+ val |= REG_FIELD_PREP(BW_BUDDY_TLB_REQ_TIMER_MASK, 0x8);
4986+ I915_WRITE(BW_BUDDY1_CTL, val);
4987+
4988+ val = I915_READ(BW_BUDDY2_CTL);
4989+ val &= ~BW_BUDDY_TLB_REQ_TIMER_MASK;
4990+ val |= REG_FIELD_PREP(BW_BUDDY_TLB_REQ_TIMER_MASK, 0x8);
4991+ I915_WRITE(BW_BUDDY2_CTL, val);
49734992 }
49744993 }
49754994
drivers/gpu/drm/i915/display/intel_psr.c+21−4
@@ -852,10 +852,12 @@ void intel_psr_enable(struct intel_dp *intel_dp, · 851 unmodified lines
852852 {
853853 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
854854
855− if (!crtc_state->has_psr)
855+ if (!CAN_PSR(dev_priv) || dev_priv->psr.dp != intel_dp)
856856 return;
857857
858− if (WARN_ON(!CAN_PSR(dev_priv)))
858+ dev_priv->psr.force_mode_changed = false;
859+
860+ if (!crtc_state->has_psr)
859861 return;
860862
861863 WARN_ON(dev_priv->drrs.dp);
@@ -1009,6 +1011,8 @@ void intel_psr_update(struct intel_dp *intel_dp, · 147 unmodified lines
10091011 if (!CAN_PSR(dev_priv) || READ_ONCE(psr->dp) != intel_dp)
10101012 return;
10111013
1014+ dev_priv->psr.force_mode_changed = false;
1015+
10121016 mutex_lock(&dev_priv->psr.lock);
10131017
10141018 enable = crtc_state->has_psr && psr_global_enabled(psr->debug);
@@ -1534,7 +1538,7 @@ void intel_psr_atomic_check(struct drm_connector *connector, · 519 unmodified lines
15341538 struct drm_crtc_state *crtc_state;
15351539
15361540 if (!CAN_PSR(dev_priv) || !new_state->crtc ||
1537− dev_priv->psr.initially_probed)
1541+ !dev_priv->psr.force_mode_changed)
15381542 return;
15391543
15401544 intel_connector = to_intel_connector(connector);
@@ -1545,5 +1549,18 @@ void intel_psr_atomic_check(struct drm_connector *connector, · 4 unmodified lines
15451549 crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
15461550 new_state->crtc);
15471551 crtc_state->mode_changed = true;
1548− dev_priv->psr.initially_probed = true;
1552+}
1553+
1554+void intel_psr_set_force_mode_changed(struct intel_dp *intel_dp)
1555+{
1556+ struct drm_i915_private *dev_priv;
1557+
1558+ if (!intel_dp)
1559+ return;
1560+
1561+ dev_priv = dp_to_i915(intel_dp);
1562+ if (!CAN_PSR(dev_priv) || intel_dp != dev_priv->psr.dp)
1563+ return;
1564+
1565+ dev_priv->psr.force_mode_changed = true;
15491566 }
drivers/gpu/drm/i915/display/intel_psr.h+1−0
@@ -40,5 +40,6 @@ bool intel_psr_enabled(struct intel_dp *intel_dp); · 39 unmodified lines
4040 void intel_psr_atomic_check(struct drm_connector *connector,
4141 struct drm_connector_state *old_state,
4242 struct drm_connector_state *new_state);
43+void intel_psr_set_force_mode_changed(struct intel_dp *intel_dp);
4344
4445 #endif /* __INTEL_PSR_H__ */
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+2−1
@@ -423,7 +423,8 @@ eb_validate_vma(struct i915_execbuffer *eb, · 422 unmodified lines
423423 if (unlikely(entry->flags & eb->invalid_flags))
424424 return -EINVAL;
425425
426− if (unlikely(entry->alignment && !is_power_of_2(entry->alignment)))
426+ if (unlikely(entry->alignment &&
427+ !is_power_of_2_u64(entry->alignment)))
427428 return -EINVAL;
428429
429430 /*
drivers/gpu/drm/i915/gem/i915_gem_object.c+1−0
@@ -225,6 +225,7 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915, · 224 unmodified lines
225225
226226 /* But keep the pointer alive for RCU-protected lookups */
227227 call_rcu(&obj->rcu, __i915_gem_free_object_rcu);
228+ cond_resched();
228229 }
229230 intel_runtime_pm_put(&i915->runtime_pm, wakeref);
230231 }
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c+1−3
@@ -256,8 +256,7 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *i915) · 255 unmodified lines
256256 with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
257257 freed = i915_gem_shrink(i915, -1UL, NULL,
258258 I915_SHRINK_BOUND |
259− I915_SHRINK_UNBOUND |
260− I915_SHRINK_ACTIVE);
259+ I915_SHRINK_UNBOUND);
261260 }
262261
263262 return freed;
@@ -336,7 +335,6 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr) · 72 unmodified lines
336335 freed_pages = 0;
337336 with_intel_runtime_pm(&i915->runtime_pm, wakeref)
338337 freed_pages += i915_gem_shrink(i915, -1UL, NULL,
339− I915_SHRINK_ACTIVE |
340338 I915_SHRINK_BOUND |
341339 I915_SHRINK_UNBOUND |
342340 I915_SHRINK_WRITEBACK);
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c+1−1
@@ -570,7 +570,7 @@ static bool assert_mmap_offset(struct drm_i915_private *i915, · 569 unmodified lines
570570
571571 obj = i915_gem_object_create_internal(i915, size);
572572 if (IS_ERR(obj))
573− return PTR_ERR(obj);
573+ return false;
574574
575575 mmo = mmap_offset_attach(obj, I915_MMAP_OFFSET_GTT, NULL);
576576 i915_gem_object_put(obj);
drivers/gpu/drm/i915/gt/intel_gt_requests.c+11−3
@@ -147,24 +147,32 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout) · 146 unmodified lines
147147
148148 fence = i915_active_fence_get(&tl->last_request);
149149 if (fence) {
150+ mutex_unlock(&tl->mutex);
151+
150152 timeout = dma_fence_wait_timeout(fence,
151153 interruptible,
152154 timeout);
153155 dma_fence_put(fence);
156+
157+ /* Retirement is best effort */
158+ if (!mutex_trylock(&tl->mutex)) {
159+ active_count++;
160+ goto out_active;
161+ }
154162 }
155163 }
156164
157165 if (!retire_requests(tl) || flush_submission(gt))
158166 active_count++;
167+ mutex_unlock(&tl->mutex);
159168
160− spin_lock(&timelines->lock);
169+out_active: spin_lock(&timelines->lock);
161170
162− /* Resume iteration after dropping lock */
171+ /* Resume list iteration after reacquiring spinlock */
163172 list_safe_reset_next(tl, tn, link);
164173 if (atomic_dec_and_test(&tl->active_count))
165174 list_del(&tl->link);
166175
167− mutex_unlock(&tl->mutex);
168176
169177 /* Defer the final release to after the spinlock */
170178 if (refcount_dec_and_test(&tl->kref.refcount)) {
drivers/gpu/drm/i915/gt/intel_lrc.c+30−51
@@ -1600,17 +1600,6 @@ static void virtual_xfer_breadcrumbs(struct virtual_engine *ve, · 1599 unmodified lines
16001600 spin_unlock(&old->breadcrumbs.irq_lock);
16011601 }
16021602
1603−static struct i915_request *
1604−last_active(const struct intel_engine_execlists *execlists)
1605−{
1606− struct i915_request * const *last = READ_ONCE(execlists->active);
1607−
1608− while (*last && i915_request_completed(*last))
1609− last++;
1610−
1611− return *last;
1612−}
1613−
16141603 #define for_each_waiter(p__, rq__) \
16151604 list_for_each_entry_lockless(p__, \
16161605 &(rq__)->sched.waiters_list, \
@@ -1679,11 +1668,9 @@ need_timeslice(struct intel_engine_cs *engine, const struct i915_request *rq) · 62 unmodified lines
16791668 if (!intel_engine_has_timeslices(engine))
16801669 return false;
16811670
1682− if (list_is_last(&rq->sched.link, &engine->active.requests))
1683− return false;
1684−
1685− hint = max(rq_prio(list_next_entry(rq, sched.link)),
1686− engine->execlists.queue_priority_hint);
1671+ hint = engine->execlists.queue_priority_hint;
1672+ if (!list_is_last(&rq->sched.link, &engine->active.requests))
1673+ hint = max(hint, rq_prio(list_next_entry(rq, sched.link)));
16871674
16881675 return hint >= effective_prio(rq);
16891676 }
@@ -1725,16 +1712,26 @@ static void set_timeslice(struct intel_engine_cs *engine) · 35 unmodified lines
17251712 set_timer_ms(&engine->execlists.timer, active_timeslice(engine));
17261713 }
17271714
1715+static void start_timeslice(struct intel_engine_cs *engine)
1716+{
1717+ struct intel_engine_execlists *execlists = &engine->execlists;
1718+
1719+ execlists->switch_priority_hint = execlists->queue_priority_hint;
1720+
1721+ if (timer_pending(&execlists->timer))
1722+ return;
1723+
1724+ set_timer_ms(&execlists->timer, timeslice(engine));
1725+}
1726+
17281727 static void record_preemption(struct intel_engine_execlists *execlists)
17291728 {
17301729 (void)I915_SELFTEST_ONLY(execlists->preempt_hang.count++);
17311730 }
17321731
1733−static unsigned long active_preempt_timeout(struct intel_engine_cs *engine)
1732+static unsigned long active_preempt_timeout(struct intel_engine_cs *engine,
1733+ const struct i915_request *rq)
17341734 {
1735− struct i915_request *rq;
1736−
1737− rq = last_active(&engine->execlists);
17381735 if (!rq)
17391736 return 0;
17401737
@@ -1745,13 +1742,14 @@ static unsigned long active_preempt_timeout(struct intel_engine_cs *engine) · 4 unmodified lines
17451742 return READ_ONCE(engine->props.preempt_timeout_ms);
17461743 }
17471744
1748−static void set_preempt_timeout(struct intel_engine_cs *engine)
1745+static void set_preempt_timeout(struct intel_engine_cs *engine,
1746+ const struct i915_request *rq)
17491747 {
17501748 if (!intel_engine_has_preempt_reset(engine))
17511749 return;
17521750
17531751 set_timer_ms(&engine->execlists.preempt,
1754− active_preempt_timeout(engine));
1752+ active_preempt_timeout(engine, rq));
17551753 }
17561754
17571755 static inline void clear_ports(struct i915_request **ports, int count)
@@ -1764,6 +1762,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 6 unmodified lines
17641762 struct intel_engine_execlists * const execlists = &engine->execlists;
17651763 struct i915_request **port = execlists->pending;
17661764 struct i915_request ** const last_port = port + execlists->port_mask;
1765+ struct i915_request * const *active;
17671766 struct i915_request *last;
17681767 struct rb_node *rb;
17691768 bool submit = false;
@@ -1818,7 +1817,10 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 48 unmodified lines
18181817 * i.e. we will retrigger preemption following the ack in case
18191818 * of trouble.
18201819 */
1821− last = last_active(execlists);
1820+ active = READ_ONCE(execlists->active);
1821+ while ((last = *active) && i915_request_completed(last))
1822+ active++;
1823+
18221824 if (last) {
18231825 if (need_preempt(engine, last, rb)) {
18241826 ENGINE_TRACE(engine,
@@ -1888,11 +1890,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 63 unmodified lines
18881890 * Even if ELSP[1] is occupied and not worthy
18891891 * of timeslices, our queue might be.
18901892 */
1891− if (!execlists->timer.expires &&
1892− need_timeslice(engine, last))
1893− set_timer_ms(&execlists->timer,
1894− timeslice(engine));
1895−
1893+ start_timeslice(engine);
18961894 return;
18971895 }
18981896 }
@@ -1927,7 +1925,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 28 unmodified lines
19271925
19281926 if (last && !can_merge_rq(last, rq)) {
19291927 spin_unlock(&ve->base.active.lock);
1930− return; /* leave this for another */
1928+ start_timeslice(engine);
1929+ return; /* leave this for another sibling */
19311930 }
19321931
19331932 ENGINE_TRACE(engine,
@@ -2103,7 +2102,7 @@ done: · 169 unmodified lines
21032102 * Skip if we ended up with exactly the same set of requests,
21042103 * e.g. trying to timeslice a pair of ordered contexts
21052104 */
2106− if (!memcmp(execlists->active, execlists->pending,
2105+ if (!memcmp(active, execlists->pending,
21072106 (port - execlists->pending + 1) * sizeof(*port))) {
21082107 do
21092108 execlists_schedule_out(fetch_and_zero(port));
@@ -2114,7 +2113,7 @@ done: · 4 unmodified lines
21142113 clear_ports(port + 1, last_port - port);
21152114
21162115 execlists_submit_ports(engine);
2117− set_preempt_timeout(engine);
2116+ set_preempt_timeout(engine, *active);
21182117 } else {
21192118 skip_submit:
21202119 ring_set_paused(engine, 0);
@@ -4001,26 +4000,6 @@ static int gen12_emit_flush_render(struct i915_request *request, · 1880 unmodified lines
40014000
40024001 *cs++ = preparser_disable(false);
40034002 intel_ring_advance(request, cs);
4004−
4005− /*
4006− * Wa_1604544889:tgl
4007− */
4008− if (IS_TGL_REVID(request->i915, TGL_REVID_A0, TGL_REVID_A0)) {
4009− flags = 0;
4010− flags |= PIPE_CONTROL_CS_STALL;
4011− flags |= PIPE_CONTROL_HDC_PIPELINE_FLUSH;
4012−
4013− flags |= PIPE_CONTROL_STORE_DATA_INDEX;
4014− flags |= PIPE_CONTROL_QW_WRITE;
4015−
4016− cs = intel_ring_begin(request, 6);
4017− if (IS_ERR(cs))
4018− return PTR_ERR(cs);
4019−
4020− cs = gen8_emit_pipe_control(cs, flags,
4021− LRC_PPHWSP_SCRATCH_ADDR);
4022− intel_ring_advance(request, cs);
4023− }
40244003 }
40254004
40264005 return 0;
drivers/gpu/drm/i915/gt/intel_timeline.c+6−2
@@ -192,11 +192,15 @@ static void cacheline_release(struct intel_timeline_cacheline *cl) · 191 unmodified lines
192192
193193 static void cacheline_free(struct intel_timeline_cacheline *cl)
194194 {
195+ if (!i915_active_acquire_if_busy(&cl->active)) {
196+ __idle_cacheline_free(cl);
197+ return;
198+ }
199+
195200 GEM_BUG_ON(ptr_test_bit(cl->vaddr, CACHELINE_FREE));
196201 cl->vaddr = ptr_set_bit(cl->vaddr, CACHELINE_FREE);
197202
198− if (i915_active_is_idle(&cl->active))
199− __idle_cacheline_free(cl);
203+ i915_active_release(&cl->active);
200204 }
201205
202206 int intel_timeline_init(struct intel_timeline *timeline,
drivers/gpu/drm/i915/gt/intel_workarounds.c+29−15
@@ -575,24 +575,19 @@ static void icl_ctx_workarounds_init(struct intel_engine_cs *engine, · 574 unmodified lines
575575 static void tgl_ctx_workarounds_init(struct intel_engine_cs *engine,
576576 struct i915_wa_list *wal)
577577 {
578− u32 val;
579−
580578 /* Wa_1409142259:tgl */
581579 WA_SET_BIT_MASKED(GEN11_COMMON_SLICE_CHICKEN3,
582580 GEN12_DISABLE_CPS_AWARE_COLOR_PIPE);
583581
584− /* Wa_1604555607:tgl */
585− val = intel_uncore_read(engine->uncore, FF_MODE2);
586− val &= ~FF_MODE2_TDS_TIMER_MASK;
587− val |= FF_MODE2_TDS_TIMER_128;
588582 /*
589− * FIXME: FF_MODE2 register is not readable till TGL B0. We can
590− * enable verification of WA from the later steppings, which enables
591− * the read of FF_MODE2.
583+ * Wa_1604555607:gen12 and Wa_1608008084:gen12
584+ * FF_MODE2 register will return the wrong value when read. The default
585+ * value for this register is zero for all fields and there are no bit
586+ * masks. So instead of doing a RMW we should just write the TDS timer
587+ * value for Wa_1604555607.
592588 */
593− wa_add(wal, FF_MODE2, FF_MODE2_TDS_TIMER_MASK, val,
594− IS_TGL_REVID(engine->i915, TGL_REVID_A0, TGL_REVID_A0) ? 0 :
595− FF_MODE2_TDS_TIMER_MASK);
589+ wa_add(wal, FF_MODE2, FF_MODE2_TDS_TIMER_MASK,
590+ FF_MODE2_TDS_TIMER_128, 0);
596591 }
597592
598593 static void
@@ -1534,15 +1529,34 @@ err_obj: · 935 unmodified lines
15341529 return ERR_PTR(err);
15351530 }
15361531
1532+static const struct {
1533+ u32 start;
1534+ u32 end;
1535+} mcr_ranges_gen8[] = {
1536+ { .start = 0x5500, .end = 0x55ff },
1537+ { .start = 0x7000, .end = 0x7fff },
1538+ { .start = 0x9400, .end = 0x97ff },
1539+ { .start = 0xb000, .end = 0xb3ff },
1540+ { .start = 0xe000, .end = 0xe7ff },
1541+ {},
1542+};
1543+
15371544 static bool mcr_range(struct drm_i915_private *i915, u32 offset)
15381545 {
1546+ int i;
1547+
1548+ if (INTEL_GEN(i915) < 8)
1549+ return false;
1550+
15391551 /*
1540− * Registers in this range are affected by the MCR selector
1552+ * Registers in these ranges are affected by the MCR selector
15411553 * which only controls CPU initiated MMIO. Routing does not
15421554 * work for CS access so we cannot verify them on this path.
15431555 */
1544− if (INTEL_GEN(i915) >= 8 && (offset >= 0xb000 && offset <= 0xb4ff))
1545− return true;
1556+ for (i = 0; mcr_ranges_gen8[i].start; i++)
1557+ if (offset >= mcr_ranges_gen8[i].start &&
1558+ offset <= mcr_ranges_gen8[i].end)
1559+ return true;
15461560
15471561 return false;
15481562 }
drivers/gpu/drm/i915/gvt/display.c+2−1
@@ -457,7 +457,8 @@ void intel_vgpu_emulate_hotplug(struct intel_vgpu *vgpu, bool connected) · 456 unmodified lines
457457 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
458458
459459 /* TODO: add more platforms support */
460− if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
460+ if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv) ||
461+ IS_COFFEELAKE(dev_priv)) {
461462 if (connected) {
462463 vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
463464 SFUSE_STRAP_DDID_DETECTED;
drivers/gpu/drm/i915/gvt/dmabuf.c+1−1
@@ -151,12 +151,12 @@ static void dmabuf_gem_object_free(struct kref *kref) · 150 unmodified lines
151151 dmabuf_obj = container_of(pos,
152152 struct intel_vgpu_dmabuf_obj, list);
153153 if (dmabuf_obj == obj) {
154+ list_del(pos);
154155 intel_gvt_hypervisor_put_vfio_device(vgpu);
155156 idr_remove(&vgpu->object_idr,
156157 dmabuf_obj->dmabuf_id);
157158 kfree(dmabuf_obj->info);
158159 kfree(dmabuf_obj);
159− list_del(pos);
160160 break;
161161 }
162162 }
drivers/gpu/drm/i915/gvt/opregion.c+2−3
@@ -147,15 +147,14 @@ static void virt_vbt_generation(struct vbt *v) · 146 unmodified lines
147147 /* there's features depending on version! */
148148 v->header.version = 155;
149149 v->header.header_size = sizeof(v->header);
150− v->header.vbt_size = sizeof(struct vbt) - sizeof(v->header);
150+ v->header.vbt_size = sizeof(struct vbt);
151151 v->header.bdb_offset = offsetof(struct vbt, bdb_header);
152152
153153 strcpy(&v->bdb_header.signature[0], "BIOS_DATA_BLOCK");
154154 v->bdb_header.version = 186; /* child_dev_size = 33 */
155155 v->bdb_header.header_size = sizeof(v->bdb_header);
156156
157− v->bdb_header.bdb_size = sizeof(struct vbt) - sizeof(struct vbt_header)
158− - sizeof(struct bdb_header);
157+ v->bdb_header.bdb_size = sizeof(struct vbt) - sizeof(struct vbt_header);
159158
160159 /* general features */
161160 v->general_features_header.id = BDB_GENERAL_FEATURES;
drivers/gpu/drm/i915/gvt/vgpu.c+10−4
@@ -272,10 +272,17 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu) · 271 unmodified lines
272272 {
273273 struct intel_gvt *gvt = vgpu->gvt;
274274
275− mutex_lock(&vgpu->vgpu_lock);
276−
277275 WARN(vgpu->active, "vGPU is still active!\n");
278276
277+ /*
278+ * remove idr first so later clean can judge if need to stop
279+ * service if no active vgpu.
280+ */
281+ mutex_lock(&gvt->lock);
282+ idr_remove(&gvt->vgpu_idr, vgpu->id);
283+ mutex_unlock(&gvt->lock);
284+
285+ mutex_lock(&vgpu->vgpu_lock);
279286 intel_gvt_debugfs_remove_vgpu(vgpu);
280287 intel_vgpu_clean_sched_policy(vgpu);
281288 intel_vgpu_clean_submission(vgpu);
@@ -290,7 +297,6 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu) · 8 unmodified lines
290297 mutex_unlock(&vgpu->vgpu_lock);
291298
292299 mutex_lock(&gvt->lock);
293− idr_remove(&gvt->vgpu_idr, vgpu->id);
294300 if (idr_is_empty(&gvt->vgpu_idr))
295301 intel_gvt_clean_irq(gvt);
296302 intel_gvt_update_vgpu_types(gvt);
@@ -560,9 +566,9 @@ void intel_gvt_reset_vgpu_locked(struct intel_vgpu *vgpu, bool dmlr, · 263 unmodified lines
560566
561567 intel_vgpu_reset_mmio(vgpu, dmlr);
562568 populate_pvinfo_page(vgpu);
563− intel_vgpu_reset_display(vgpu);
564569
565570 if (dmlr) {
571+ intel_vgpu_reset_display(vgpu);
566572 intel_vgpu_reset_cfg_space(vgpu);
567573 /* only reset the failsafe mode when dmlr reset */
568574 vgpu->failsafe = false;
drivers/gpu/drm/i915/i915_drv.c+3−0
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 #include "display/intel_hotplug.h"
5757 #include "display/intel_overlay.h"
5858 #include "display/intel_pipe_crc.h"
59+#include "display/intel_psr.h"
5960 #include "display/intel_sprite.h"
6061 #include "display/intel_vga.h"
6162
@@ -330,6 +331,8 @@ static int i915_driver_modeset_probe(struct drm_i915_private *i915) · 268 unmodified lines
330331
331332 intel_init_ipc(i915);
332333
334+ intel_psr_set_force_mode_changed(i915->psr.dp);
335+
333336 return 0;
334337
335338 cleanup_gem:
drivers/gpu/drm/i915/i915_drv.h+1−1
@@ -505,7 +505,7 @@ struct i915_psr { · 504 unmodified lines
505505 bool dc3co_enabled;
506506 u32 dc3co_exit_delay;
507507 struct delayed_work idle_work;
508− bool initially_probed;
508+ bool force_mode_changed;
509509 };
510510
511511 #define QUIRK_LVDS_SSC_DISABLE (1<<1)
drivers/gpu/drm/i915/i915_pci.c+2−2
@@ -437,7 +437,7 @@ static const struct intel_device_info snb_m_gt2_info = { · 436 unmodified lines
437437 .has_rc6 = 1, \
438438 .has_rc6p = 1, \
439439 .has_rps = true, \
440− .ppgtt_type = INTEL_PPGTT_FULL, \
440+ .ppgtt_type = INTEL_PPGTT_ALIASING, \
441441 .ppgtt_size = 31, \
442442 IVB_PIPE_OFFSETS, \
443443 IVB_CURSOR_OFFSETS, \
@@ -494,7 +494,7 @@ static const struct intel_device_info vlv_info = { · 50 unmodified lines
494494 .has_rps = true,
495495 .display.has_gmch = 1,
496496 .display.has_hotplug = 1,
497− .ppgtt_type = INTEL_PPGTT_FULL,
497+ .ppgtt_type = INTEL_PPGTT_ALIASING,
498498 .ppgtt_size = 31,
499499 .has_snoop = true,
500500 .has_coherent_ggtt = false,
drivers/gpu/drm/i915/i915_perf.c+41−17
@@ -1954,9 +1954,10 @@ out: · 1953 unmodified lines
19541954 return i915_vma_get(oa_bo->vma);
19551955 }
19561956
1957−static int emit_oa_config(struct i915_perf_stream *stream,
1958− struct i915_oa_config *oa_config,
1959− struct intel_context *ce)
1957+static struct i915_request *
1958+emit_oa_config(struct i915_perf_stream *stream,
1959+ struct i915_oa_config *oa_config,
1960+ struct intel_context *ce)
19601961 {
19611962 struct i915_request *rq;
19621963 struct i915_vma *vma;
@@ -1964,7 +1965,7 @@ static int emit_oa_config(struct i915_perf_stream *stream, · 1 unmodified line
19641965
19651966 vma = get_oa_vma(stream, oa_config);
19661967 if (IS_ERR(vma))
1967− return PTR_ERR(vma);
1968+ return ERR_CAST(vma);
19681969
19691970 err = i915_vma_pin(vma, 0, 0, PIN_GLOBAL | PIN_HIGH);
19701971 if (err)
@@ -1989,13 +1990,17 @@ static int emit_oa_config(struct i915_perf_stream *stream, · 18 unmodified lines
19891990 err = rq->engine->emit_bb_start(rq,
19901991 vma->node.start, 0,
19911992 I915_DISPATCH_SECURE);
1993+ if (err)
1994+ goto err_add_request;
1995+
1996+ i915_request_get(rq);
19921997 err_add_request:
19931998 i915_request_add(rq);
19941999 err_vma_unpin:
19952000 i915_vma_unpin(vma);
19962001 err_vma_put:
19972002 i915_vma_put(vma);
1998− return err;
2003+ return err ? ERR_PTR(err) : rq;
19992004 }
20002005
20012006 static struct intel_context *oa_context(struct i915_perf_stream *stream)
@@ -2003,7 +2008,8 @@ static struct intel_context *oa_context(struct i915_perf_stream *stream) · 1 unmodified line
20032008 return stream->pinned_ctx ?: stream->engine->kernel_context;
20042009 }
20052010
2006−static int hsw_enable_metric_set(struct i915_perf_stream *stream)
2011+static struct i915_request *
2012+hsw_enable_metric_set(struct i915_perf_stream *stream)
20072013 {
20082014 struct intel_uncore *uncore = stream->uncore;
20092015
@@ -2406,7 +2412,8 @@ static int lrc_configure_all_contexts(struct i915_perf_stream *stream, · 396 unmodified lines
24062412 return oa_configure_all_contexts(stream, regs, ARRAY_SIZE(regs));
24072413 }
24082414
2409−static int gen8_enable_metric_set(struct i915_perf_stream *stream)
2415+static struct i915_request *
2416+gen8_enable_metric_set(struct i915_perf_stream *stream)
24102417 {
24112418 struct intel_uncore *uncore = stream->uncore;
24122419 struct i915_oa_config *oa_config = stream->oa_config;
@@ -2448,7 +2455,7 @@ static int gen8_enable_metric_set(struct i915_perf_stream *stream) · 35 unmodified lines
24482455 */
24492456 ret = lrc_configure_all_contexts(stream, oa_config);
24502457 if (ret)
2451− return ret;
2458+ return ERR_PTR(ret);
24522459
24532460 return emit_oa_config(stream, oa_config, oa_context(stream));
24542461 }
@@ -2460,7 +2467,8 @@ static u32 oag_report_ctx_switches(const struct i915_perf_stream *stream) · 5 unmodified lines
24602467 0 : GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS);
24612468 }
24622469
2463−static int gen12_enable_metric_set(struct i915_perf_stream *stream)
2470+static struct i915_request *
2471+gen12_enable_metric_set(struct i915_perf_stream *stream)
24642472 {
24652473 struct intel_uncore *uncore = stream->uncore;
24662474 struct i915_oa_config *oa_config = stream->oa_config;
@@ -2491,7 +2499,7 @@ static int gen12_enable_metric_set(struct i915_perf_stream *stream) · 24 unmodified lines
24912499 */
24922500 ret = gen12_configure_all_contexts(stream, oa_config);
24932501 if (ret)
2494− return ret;
2502+ return ERR_PTR(ret);
24952503
24962504 /*
24972505 * For Gen12, performance counters are context
@@ -2501,7 +2509,7 @@ static int gen12_enable_metric_set(struct i915_perf_stream *stream) · 3 unmodified lines
25012509 if (stream->ctx) {
25022510 ret = gen12_configure_oar_context(stream, true);
25032511 if (ret)
2504− return ret;
2512+ return ERR_PTR(ret);
25052513 }
25062514
25072515 return emit_oa_config(stream, oa_config, oa_context(stream));
@@ -2696,6 +2704,20 @@ static const struct i915_perf_stream_ops i915_oa_stream_ops = { · 188 unmodified lines
26962704 .read = i915_oa_read,
26972705 };
26982706
2707+static int i915_perf_stream_enable_sync(struct i915_perf_stream *stream)
2708+{
2709+ struct i915_request *rq;
2710+
2711+ rq = stream->perf->ops.enable_metric_set(stream);
2712+ if (IS_ERR(rq))
2713+ return PTR_ERR(rq);
2714+
2715+ i915_request_wait(rq, 0, MAX_SCHEDULE_TIMEOUT);
2716+ i915_request_put(rq);
2717+
2718+ return 0;
2719+}
2720+
26992721 /**
27002722 * i915_oa_stream_init - validate combined props for OA stream and init
27012723 * @stream: An i915 perf stream
@@ -2829,7 +2851,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, · 127 unmodified lines
28292851 stream->ops = &i915_oa_stream_ops;
28302852 perf->exclusive_stream = stream;
28312853
2832− ret = perf->ops.enable_metric_set(stream);
2854+ ret = i915_perf_stream_enable_sync(stream);
28332855 if (ret) {
28342856 DRM_DEBUG("Unable to enable metric set\n");
28352857 goto err_enable;
@@ -3147,7 +3169,7 @@ static long i915_perf_config_locked(struct i915_perf_stream *stream, · 311 unmodified lines
31473169 return -EINVAL;
31483170
31493171 if (config != stream->oa_config) {
3150− int err;
3172+ struct i915_request *rq;
31513173
31523174 /*
31533175 * If OA is bound to a specific context, emit the
@@ -3158,11 +3180,13 @@ static long i915_perf_config_locked(struct i915_perf_stream *stream, · 4 unmodified lines
31583180 * When set globally, we use a low priority kernel context,
31593181 * so it will effectively take effect when idle.
31603182 */
3161− err = emit_oa_config(stream, config, oa_context(stream));
3162− if (err == 0)
3183+ rq = emit_oa_config(stream, config, oa_context(stream));
3184+ if (!IS_ERR(rq)) {
31633185 config = xchg(&stream->oa_config, config);
3164− else
3165− ret = err;
3186+ i915_request_put(rq);
3187+ } else {
3188+ ret = PTR_ERR(rq);
3189+ }
31663190 }
31673191
31683192 i915_oa_config_put(config);
drivers/gpu/drm/i915/i915_perf_types.h+2−1
@@ -339,7 +339,8 @@ struct i915_oa_ops { · 338 unmodified lines
339339 * counter reports being sampled. May apply system constraints such as
340340 * disabling EU clock gating as required.
341341 */
342− int (*enable_metric_set)(struct i915_perf_stream *stream);
342+ struct i915_request *
343+ (*enable_metric_set)(struct i915_perf_stream *stream);
343344
344345 /**
345346 * @disable_metric_set: Remove system constraints associated with using
drivers/gpu/drm/i915/i915_pmu.c+31−28
@@ -822,11 +822,6 @@ static ssize_t i915_pmu_event_show(struct device *dev, · 821 unmodified lines
822822 return sprintf(buf, "config=0x%lx\n", eattr->val);
823823 }
824824
825−static struct attribute_group i915_pmu_events_attr_group = {
826− .name = "events",
827− /* Patch in attrs at runtime. */
828−};
829−
830825 static ssize_t
831826 i915_pmu_get_attr_cpumask(struct device *dev,
832827 struct device_attribute *attr,
@@ -846,13 +841,6 @@ static const struct attribute_group i915_pmu_cpumask_attr_group = { · 13 unmodified lines
846841 .attrs = i915_cpumask_attrs,
847842 };
848843
849−static const struct attribute_group *i915_pmu_attr_groups[] = {
850− &i915_pmu_format_attr_group,
851− &i915_pmu_events_attr_group,
852− &i915_pmu_cpumask_attr_group,
853− NULL
854−};
855−
856844 #define __event(__config, __name, __unit) \
857845 { \
858846 .config = (__config), \
@@ -1026,23 +1014,23 @@ err_alloc: · 167 unmodified lines
10261014
10271015 static void free_event_attributes(struct i915_pmu *pmu)
10281016 {
1029− struct attribute **attr_iter = i915_pmu_events_attr_group.attrs;
1017+ struct attribute **attr_iter = pmu->events_attr_group.attrs;
10301018
10311019 for (; *attr_iter; attr_iter++)
10321020 kfree((*attr_iter)->name);
10331021
1034− kfree(i915_pmu_events_attr_group.attrs);
1022+ kfree(pmu->events_attr_group.attrs);
10351023 kfree(pmu->i915_attr);
10361024 kfree(pmu->pmu_attr);
10371025
1038− i915_pmu_events_attr_group.attrs = NULL;
1026+ pmu->events_attr_group.attrs = NULL;
10391027 pmu->i915_attr = NULL;
10401028 pmu->pmu_attr = NULL;
10411029 }
10421030
10431031 static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node)
10441032 {
1045− struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), node);
1033+ struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node);
10461034
10471035 GEM_BUG_ON(!pmu->base.event_init);
10481036
@@ -1055,7 +1043,7 @@ static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node) · 6 unmodified lines
10551043
10561044 static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node)
10571045 {
1058− struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), node);
1046+ struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node);
10591047 unsigned int target;
10601048
10611049 GEM_BUG_ON(!pmu->base.event_init);
@@ -1072,8 +1060,6 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) · 10 unmodified lines
10721060 return 0;
10731061 }
10741062
1075−static enum cpuhp_state cpuhp_slot = CPUHP_INVALID;
1076−
10771063 static int i915_pmu_register_cpuhp_state(struct i915_pmu *pmu)
10781064 {
10791065 enum cpuhp_state slot;
@@ -1087,21 +1073,22 @@ static int i915_pmu_register_cpuhp_state(struct i915_pmu *pmu) · 7 unmodified lines
10871073 return ret;
10881074
10891075 slot = ret;
1090− ret = cpuhp_state_add_instance(slot, &pmu->node);
1076+ ret = cpuhp_state_add_instance(slot, &pmu->cpuhp.node);
10911077 if (ret) {
10921078 cpuhp_remove_multi_state(slot);
10931079 return ret;
10941080 }
10951081
1096− cpuhp_slot = slot;
1082+ pmu->cpuhp.slot = slot;
10971083 return 0;
10981084 }
10991085
11001086 static void i915_pmu_unregister_cpuhp_state(struct i915_pmu *pmu)
11011087 {
1102− WARN_ON(cpuhp_slot == CPUHP_INVALID);
1103− WARN_ON(cpuhp_state_remove_instance(cpuhp_slot, &pmu->node));
1104− cpuhp_remove_multi_state(cpuhp_slot);
1088+ WARN_ON(pmu->cpuhp.slot == CPUHP_INVALID);
1089+ WARN_ON(cpuhp_state_remove_instance(pmu->cpuhp.slot, &pmu->cpuhp.node));
1090+ cpuhp_remove_multi_state(pmu->cpuhp.slot);
1091+ pmu->cpuhp.slot = CPUHP_INVALID;
11051092 }
11061093
11071094 static bool is_igp(struct drm_i915_private *i915)
@@ -1118,6 +1105,13 @@ static bool is_igp(struct drm_i915_private *i915) · 10 unmodified lines
11181105 void i915_pmu_register(struct drm_i915_private *i915)
11191106 {
11201107 struct i915_pmu *pmu = &i915->pmu;
1108+ const struct attribute_group *attr_groups[] = {
1109+ &i915_pmu_format_attr_group,
1110+ &pmu->events_attr_group,
1111+ &i915_pmu_cpumask_attr_group,
1112+ NULL
1113+ };
1114+
11211115 int ret = -ENOMEM;
11221116
11231117 if (INTEL_GEN(i915) <= 2) {
@@ -1128,6 +1122,7 @@ void i915_pmu_register(struct drm_i915_private *i915) · 4 unmodified lines
11281122 spin_lock_init(&pmu->lock);
11291123 hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
11301124 pmu->timer.function = i915_sample;
1125+ pmu->cpuhp.slot = CPUHP_INVALID;
11311126
11321127 if (!is_igp(i915)) {
11331128 pmu->name = kasprintf(GFP_KERNEL,
@@ -1143,11 +1138,16 @@ void i915_pmu_register(struct drm_i915_private *i915) · 9 unmodified lines
11431138 if (!pmu->name)
11441139 goto err;
11451140
1146− i915_pmu_events_attr_group.attrs = create_event_attributes(pmu);
1147− if (!i915_pmu_events_attr_group.attrs)
1141+ pmu->events_attr_group.name = "events";
1142+ pmu->events_attr_group.attrs = create_event_attributes(pmu);
1143+ if (!pmu->events_attr_group.attrs)
11481144 goto err_name;
11491145
1150− pmu->base.attr_groups = i915_pmu_attr_groups;
1146+ pmu->base.attr_groups = kmemdup(attr_groups, sizeof(attr_groups),
1147+ GFP_KERNEL);
1148+ if (!pmu->base.attr_groups)
1149+ goto err_attr;
1150+
11511151 pmu->base.task_ctx_nr = perf_invalid_context;
11521152 pmu->base.event_init = i915_pmu_event_init;
11531153 pmu->base.add = i915_pmu_event_add;
@@ -1159,7 +1159,7 @@ void i915_pmu_register(struct drm_i915_private *i915) · 5 unmodified lines
11591159
11601160 ret = perf_pmu_register(&pmu->base, pmu->name, -1);
11611161 if (ret)
1162− goto err_attr;
1162+ goto err_groups;
11631163
11641164 ret = i915_pmu_register_cpuhp_state(pmu);
11651165 if (ret)
@@ -1169,6 +1169,8 @@ void i915_pmu_register(struct drm_i915_private *i915) · 3 unmodified lines
11691169
11701170 err_unreg:
11711171 perf_pmu_unregister(&pmu->base);
1172+err_groups:
1173+ kfree(pmu->base.attr_groups);
11721174 err_attr:
11731175 pmu->base.event_init = NULL;
11741176 free_event_attributes(pmu);
@@ -1194,6 +1196,7 @@ void i915_pmu_unregister(struct drm_i915_private *i915) · 19 unmodified lines
11941196
11951197 perf_pmu_unregister(&pmu->base);
11961198 pmu->base.event_init = NULL;
1199+ kfree(pmu->base.attr_groups);
11971200 if (!is_igp(i915))
11981201 kfree(pmu->name);
11991202 free_event_attributes(pmu);
drivers/gpu/drm/i915/i915_pmu.h+9−2
@@ -39,9 +39,12 @@ struct i915_pmu_sample { · 38 unmodified lines
3939
4040 struct i915_pmu {
4141 /**
42− * @node: List node for CPU hotplug handling.
42+ * @cpuhp: Struct used for CPU hotplug handling.
4343 */
44− struct hlist_node node;
44+ struct {
45+ struct hlist_node node;
46+ enum cpuhp_state slot;
47+ } cpuhp;
4548 /**
4649 * @base: PMU base.
4750 */
@@ -104,6 +107,10 @@ struct i915_pmu { · 56 unmodified lines
104107 * @sleep_last: Last time GT parked for RC6 estimation.
105108 */
106109 ktime_t sleep_last;
110+ /**
111+ * @events_attr_group: Device events attribute group.
112+ */
113+ struct attribute_group events_attr_group;
107114 /**
108115 * @i915_attr: Memory block holding device attributes.
109116 */
drivers/gpu/drm/i915/i915_reg.h+1−0
@@ -7757,6 +7757,7 @@ enum { · 7756 unmodified lines
77577757 #define BW_BUDDY1_CTL _MMIO(0x45140)
77587758 #define BW_BUDDY2_CTL _MMIO(0x45150)
77597759 #define BW_BUDDY_DISABLE REG_BIT(31)
7760+#define BW_BUDDY_TLB_REQ_TIMER_MASK REG_GENMASK(21, 16)
77607761
77617762 #define BW_BUDDY1_PAGE_MASK _MMIO(0x45144)
77627763 #define BW_BUDDY2_PAGE_MASK _MMIO(0x45154)
drivers/gpu/drm/i915/i915_request.c+48−21
@@ -275,7 +275,7 @@ bool i915_request_retire(struct i915_request *rq) · 274 unmodified lines
275275 spin_unlock_irq(&rq->lock);
276276
277277 remove_from_client(rq);
278− list_del(&rq->link);
278+ list_del_rcu(&rq->link);
279279
280280 intel_context_exit(rq->context);
281281 intel_context_unpin(rq->context);
@@ -527,19 +527,31 @@ submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) · 245 unmodified lines
527527 return NOTIFY_DONE;
528528 }
529529
530+static void irq_semaphore_cb(struct irq_work *wrk)
531+{
532+ struct i915_request *rq =
533+ container_of(wrk, typeof(*rq), semaphore_work);
534+
535+ i915_schedule_bump_priority(rq, I915_PRIORITY_NOSEMAPHORE);
536+ i915_request_put(rq);
537+}
538+
530539 static int __i915_sw_fence_call
531540 semaphore_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
532541 {
533− struct i915_request *request =
534− container_of(fence, typeof(*request), semaphore);
542+ struct i915_request *rq = container_of(fence, typeof(*rq), semaphore);
535543
536544 switch (state) {
537545 case FENCE_COMPLETE:
538− i915_schedule_bump_priority(request, I915_PRIORITY_NOSEMAPHORE);
546+ if (!(READ_ONCE(rq->sched.attr.priority) & I915_PRIORITY_NOSEMAPHORE)) {
547+ i915_request_get(rq);
548+ init_irq_work(&rq->semaphore_work, irq_semaphore_cb);
549+ irq_work_queue(&rq->semaphore_work);
550+ }
539551 break;
540552
541553 case FENCE_FREE:
542− i915_request_put(request);
554+ i915_request_put(rq);
543555 break;
544556 }
545557
@@ -721,6 +733,8 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) · 175 unmodified lines
721733 rq->infix = rq->ring->emit; /* end of header; start of user payload */
722734
723735 intel_context_mark_active(ce);
736+ list_add_tail_rcu(&rq->link, &tl->requests);
737+
724738 return rq;
725739
726740 err_unwind:
@@ -774,16 +788,26 @@ i915_request_await_start(struct i915_request *rq, struct i915_request *signal) · 47 unmodified lines
774788 struct dma_fence *fence;
775789 int err;
776790
777− GEM_BUG_ON(i915_request_timeline(rq) ==
778− rcu_access_pointer(signal->timeline));
791+ if (i915_request_timeline(rq) == rcu_access_pointer(signal->timeline))
792+ return 0;
793+
794+ if (i915_request_started(signal))
795+ return 0;
779796
780797 fence = NULL;
781798 rcu_read_lock();
782799 spin_lock_irq(&signal->lock);
783− if (!i915_request_started(signal) &&
784− !list_is_first(&signal->link,
785− &rcu_dereference(signal->timeline)->requests)) {
786− struct i915_request *prev = list_prev_entry(signal, link);
800+ do {
801+ struct list_head *pos = READ_ONCE(signal->link.prev);
802+ struct i915_request *prev;
803+
804+ /* Confirm signal has not been retired, the link is valid */
805+ if (unlikely(i915_request_started(signal)))
806+ break;
807+
808+ /* Is signal the earliest request on its timeline? */
809+ if (pos == &rcu_dereference(signal->timeline)->requests)
810+ break;
787811
788812 /*
789813 * Peek at the request before us in the timeline. That
@@ -791,20 +815,25 @@ i915_request_await_start(struct i915_request *rq, struct i915_request *signal) · 1 unmodified line
791815 * after acquiring a reference to it, confirm that it is
792816 * still part of the signaler's timeline.
793817 */
794− if (i915_request_get_rcu(prev)) {
795− if (list_next_entry(prev, link) == signal)
796− fence = &prev->fence;
797− else
798− i915_request_put(prev);
818+ prev = list_entry(pos, typeof(*prev), link);
819+ if (!i915_request_get_rcu(prev))
820+ break;
821+
822+ /* After the strong barrier, confirm prev is still attached */
823+ if (unlikely(READ_ONCE(prev->link.next) != &signal->link)) {
824+ i915_request_put(prev);
825+ break;
799826 }
800− }
827+
828+ fence = &prev->fence;
829+ } while (0);
801830 spin_unlock_irq(&signal->lock);
802831 rcu_read_unlock();
803832 if (!fence)
804833 return 0;
805834
806835 err = 0;
807− if (intel_timeline_sync_is_later(i915_request_timeline(rq), fence))
836+ if (!intel_timeline_sync_is_later(i915_request_timeline(rq), fence))
808837 err = i915_sw_fence_await_dma_fence(&rq->submit,
809838 fence, 0,
810839 I915_FENCE_GFP);
@@ -1242,8 +1271,6 @@ __i915_request_add_to_timeline(struct i915_request *rq) · 431 unmodified lines
12421271 0);
12431272 }
12441273
1245− list_add_tail(&rq->link, &timeline->requests);
1246−
12471274 /*
12481275 * Make sure that no request gazumped us - if it was allocated after
12491276 * our i915_request_alloc() and called __i915_request_add() before
@@ -1303,9 +1330,9 @@ void __i915_request_queue(struct i915_request *rq, · 53 unmodified lines
13031330 * decide whether to preempt the entire chain so that it is ready to
13041331 * run at the earliest possible convenience.
13051332 */
1306− i915_sw_fence_commit(&rq->semaphore);
13071333 if (attr && rq->engine->schedule)
13081334 rq->engine->schedule(rq, attr);
1335+ i915_sw_fence_commit(&rq->semaphore);
13091336 i915_sw_fence_commit(&rq->submit);
13101337 }
13111338
drivers/gpu/drm/i915/i915_request.h+2−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #define I915_REQUEST_H
2727
2828 #include <linux/dma-fence.h>
29+#include <linux/irq_work.h>
2930 #include <linux/lockdep.h>
3031
3132 #include "gem/i915_gem_context_types.h"
@@ -208,6 +209,7 @@ struct i915_request { · 176 unmodified lines
208209 };
209210 struct list_head execute_cb;
210211 struct i915_sw_fence semaphore;
212+ struct irq_work semaphore_work;
211213
212214 /*
213215 * A list of everyone we wait upon, and everyone who waits upon us.
drivers/gpu/drm/i915/i915_utils.h+5−0
@@ -234,6 +234,11 @@ static inline u64 ptr_to_u64(const void *ptr) · 233 unmodified lines
234234 __idx; \
235235 })
236236
237+static inline bool is_power_of_2_u64(u64 n)
238+{
239+ return (n != 0 && ((n & (n - 1)) == 0));
240+}
241+
237242 static inline void __list_del_many(struct list_head *head,
238243 struct list_head *first)
239244 {
drivers/gpu/drm/mediatek/mtk_drm_crtc.c+20−10
@@ -486,6 +486,7 @@ static void mtk_drm_crtc_hw_config(struct mtk_drm_crtc *mtk_crtc) · 485 unmodified lines
486486 }
487487 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
488488 if (mtk_crtc->cmdq_client) {
489+ mbox_flush(mtk_crtc->cmdq_client->chan, 2000);
489490 cmdq_handle = cmdq_pkt_create(mtk_crtc->cmdq_client, PAGE_SIZE);
490491 cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
491492 cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event);
@@ -636,10 +637,18 @@ static const struct drm_crtc_helper_funcs mtk_crtc_helper_funcs = { · 144 unmodified lines
636637
637638 static int mtk_drm_crtc_init(struct drm_device *drm,
638639 struct mtk_drm_crtc *mtk_crtc,
639− struct drm_plane *primary,
640− struct drm_plane *cursor, unsigned int pipe)
640+ unsigned int pipe)
641641 {
642− int ret;
642+ struct drm_plane *primary = NULL;
643+ struct drm_plane *cursor = NULL;
644+ int i, ret;
645+
646+ for (i = 0; i < mtk_crtc->layer_nr; i++) {
647+ if (mtk_crtc->planes[i].type == DRM_PLANE_TYPE_PRIMARY)
648+ primary = &mtk_crtc->planes[i];
649+ else if (mtk_crtc->planes[i].type == DRM_PLANE_TYPE_CURSOR)
650+ cursor = &mtk_crtc->planes[i];
651+ }
643652
644653 ret = drm_crtc_init_with_planes(drm, &mtk_crtc->base, primary, cursor,
645654 &mtk_crtc_funcs, NULL);
@@ -689,11 +698,12 @@ static int mtk_drm_crtc_num_comp_planes(struct mtk_drm_crtc *mtk_crtc, · 43 unmodified lines
689698 }
690699
691700 static inline
692−enum drm_plane_type mtk_drm_crtc_plane_type(unsigned int plane_idx)
701+enum drm_plane_type mtk_drm_crtc_plane_type(unsigned int plane_idx,
702+ unsigned int num_planes)
693703 {
694704 if (plane_idx == 0)
695705 return DRM_PLANE_TYPE_PRIMARY;
696− else if (plane_idx == 1)
706+ else if (plane_idx == (num_planes - 1))
697707 return DRM_PLANE_TYPE_CURSOR;
698708 else
699709 return DRM_PLANE_TYPE_OVERLAY;
@@ -712,7 +722,8 @@ static int mtk_drm_crtc_init_comp_planes(struct drm_device *drm_dev, · 12 unmodified lines
712722 ret = mtk_plane_init(drm_dev,
713723 &mtk_crtc->planes[mtk_crtc->layer_nr],
714724 BIT(pipe),
715− mtk_drm_crtc_plane_type(mtk_crtc->layer_nr),
725+ mtk_drm_crtc_plane_type(mtk_crtc->layer_nr,
726+ num_planes),
716727 mtk_ddp_comp_supported_rotations(comp));
717728 if (ret)
718729 return ret;
@@ -807,9 +818,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, · 88 unmodified lines
807818 return ret;
808819 }
809820
810− ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, &mtk_crtc->planes[0],
811− mtk_crtc->layer_nr > 1 ? &mtk_crtc->planes[1] :
812− NULL, pipe);
821+ ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, pipe);
813822 if (ret < 0)
814823 return ret;
815824
@@ -828,7 +837,8 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, · 12 unmodified lines
828837 drm_crtc_index(&mtk_crtc->base));
829838 mtk_crtc->cmdq_client = NULL;
830839 }
831− ret = of_property_read_u32_index(dev->of_node, "mediatek,gce-events",
840+ ret = of_property_read_u32_index(priv->mutex_node,
841+ "mediatek,gce-events",
832842 drm_crtc_index(&mtk_crtc->base),
833843 &mtk_crtc->cmdq_event);
834844 if (ret)
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c+1−0
@@ -471,6 +471,7 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, · 470 unmodified lines
471471 /* Only DMA capable components need the LARB property */
472472 comp->larb_dev = NULL;
473473 if (type != MTK_DISP_OVL &&
474+ type != MTK_DISP_OVL_2L &&
474475 type != MTK_DISP_RDMA &&
475476 type != MTK_DISP_WDMA)
476477 return 0;
drivers/gpu/drm/mediatek/mtk_drm_plane.c+7−0
@@ -80,6 +80,7 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane, · 79 unmodified lines
8080 struct drm_plane_state *state)
8181 {
8282 struct drm_crtc_state *crtc_state;
83+ int ret;
8384
8485 if (plane != state->crtc->cursor)
8586 return -EINVAL;
@@ -90,6 +91,11 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane, · 4 unmodified lines
9091 if (!plane->state->fb)
9192 return -EINVAL;
9293
94+ ret = mtk_drm_crtc_plane_check(state->crtc, plane,
95+ to_mtk_plane_state(state));
96+ if (ret)
97+ return ret;
98+
9399 if (state->state)
94100 crtc_state = drm_atomic_get_existing_crtc_state(state->state,
95101 state->crtc);
@@ -115,6 +121,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane, · 19 unmodified lines
115121 plane->state->src_y = new_state->src_y;
116122 plane->state->src_h = new_state->src_h;
117123 plane->state->src_w = new_state->src_w;
124+ swap(plane->state->fb, new_state->fb);
118125 state->pending.async_dirty = true;
119126
120127 mtk_drm_crtc_async_update(new_state->crtc, plane, new_state);
drivers/gpu/drm/panfrost/panfrost_mmu.c+19−25
@@ -601,33 +601,27 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) · 600 unmodified lines
601601 source_id = (fault_status >> 16);
602602
603603 /* Page fault only */
604− if ((status & mask) == BIT(i)) {
605− WARN_ON(exception_type < 0xC1 || exception_type > 0xC4);
606−
604+ ret = -1;
605+ if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0)
607606 ret = panfrost_mmu_map_fault_addr(pfdev, i, addr);
608− if (!ret) {
609− mmu_write(pfdev, MMU_INT_CLEAR, BIT(i));
610− status &= ~mask;
611− continue;
612− }
613− }
614607
615− /* terminal fault, print info about the fault */
616− dev_err(pfdev->dev,
617− "Unhandled Page fault in AS%d at VA 0x%016llX\n"
618− "Reason: %s\n"
619− "raw fault status: 0x%X\n"
620− "decoded fault status: %s\n"
621− "exception type 0x%X: %s\n"
622− "access type 0x%X: %s\n"
623− "source id 0x%X\n",
624− i, addr,
625− "TODO",
626− fault_status,
627− (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"),
628− exception_type, panfrost_exception_name(pfdev, exception_type),
629− access_type, access_type_name(pfdev, fault_status),
630− source_id);
608+ if (ret)
609+ /* terminal fault, print info about the fault */
610+ dev_err(pfdev->dev,
611+ "Unhandled Page fault in AS%d at VA 0x%016llX\n"
612+ "Reason: %s\n"
613+ "raw fault status: 0x%X\n"
614+ "decoded fault status: %s\n"
615+ "exception type 0x%X: %s\n"
616+ "access type 0x%X: %s\n"
617+ "source id 0x%X\n",
618+ i, addr,
619+ "TODO",
620+ fault_status,
621+ (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"),
622+ exception_type, panfrost_exception_name(pfdev, exception_type),
623+ access_type, access_type_name(pfdev, fault_status),
624+ source_id);
631625
632626 mmu_write(pfdev, MMU_INT_CLEAR, mask);
633627
drivers/gpu/drm/radeon/radeon_drv.c+41−2
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <linux/vga_switcheroo.h>
3838 #include <linux/mmu_notifier.h>
3939
40+#include <drm/drm_agpsupport.h>
4041 #include <drm/drm_crtc_helper.h>
4142 #include <drm/drm_drv.h>
4243 #include <drm/drm_fb_helper.h>
@@ -325,6 +326,7 @@ static int radeon_pci_probe(struct pci_dev *pdev, · 282 unmodified lines
325326 const struct pci_device_id *ent)
326327 {
327328 unsigned long flags = 0;
329+ struct drm_device *dev;
328330 int ret;
329331
330332 if (!ent)
@@ -365,7 +367,44 @@ static int radeon_pci_probe(struct pci_dev *pdev, · 34 unmodified lines
365367 if (ret)
366368 return ret;
367369
368− return drm_get_pci_dev(pdev, ent, &kms_driver);
370+ dev = drm_dev_alloc(&kms_driver, &pdev->dev);
371+ if (IS_ERR(dev))
372+ return PTR_ERR(dev);
373+
374+ ret = pci_enable_device(pdev);
375+ if (ret)
376+ goto err_free;
377+
378+ dev->pdev = pdev;
379+#ifdef __alpha__
380+ dev->hose = pdev->sysdata;
381+#endif
382+
383+ pci_set_drvdata(pdev, dev);
384+
385+ if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
386+ dev->agp = drm_agp_init(dev);
387+ if (dev->agp) {
388+ dev->agp->agp_mtrr = arch_phys_wc_add(
389+ dev->agp->agp_info.aper_base,
390+ dev->agp->agp_info.aper_size *
391+ 1024 * 1024);
392+ }
393+
394+ ret = drm_dev_register(dev, ent->driver_data);
395+ if (ret)
396+ goto err_agp;
397+
398+ return 0;
399+
400+err_agp:
401+ if (dev->agp)
402+ arch_phys_wc_del(dev->agp->agp_mtrr);
403+ kfree(dev->agp);
404+ pci_disable_device(pdev);
405+err_free:
406+ drm_dev_put(dev);
407+ return ret;
369408 }
370409
371410 static void
@@ -575,7 +614,7 @@ radeon_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe, · 203 unmodified lines
575614
576615 static struct drm_driver kms_driver = {
577616 .driver_features =
578− DRIVER_USE_AGP | DRIVER_GEM | DRIVER_RENDER,
617+ DRIVER_GEM | DRIVER_RENDER,
579618 .load = radeon_driver_load_kms,
580619 .open = radeon_driver_open_kms,
581620 .postclose = radeon_driver_postclose_kms,
drivers/gpu/drm/radeon/radeon_kms.c+6−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/uaccess.h>
3333 #include <linux/vga_switcheroo.h>
3434
35+#include <drm/drm_agpsupport.h>
3536 #include <drm/drm_fb_helper.h>
3637 #include <drm/drm_file.h>
3738 #include <drm/drm_ioctl.h>
@@ -77,6 +78,11 @@ void radeon_driver_unload_kms(struct drm_device *dev) · 39 unmodified lines
7778 radeon_modeset_fini(rdev);
7879 radeon_device_fini(rdev);
7980
81+ if (dev->agp)
82+ arch_phys_wc_del(dev->agp->agp_mtrr);
83+ kfree(dev->agp);
84+ dev->agp = NULL;
85+
8086 done_free:
8187 kfree(rdev);
8288 dev->dev_private = NULL;
drivers/gpu/drm/sun4i/sun8i_mixer.c+92−12
@@ -106,48 +106,128 @@ static const struct de2_fmt_info de2_formats[] = { · 105 unmodified lines
106106 .rgb = true,
107107 .csc = SUN8I_CSC_MODE_OFF,
108108 },
109+ {
110+ /* for DE2 VI layer which ignores alpha */
111+ .drm_fmt = DRM_FORMAT_XRGB4444,
112+ .de2_fmt = SUN8I_MIXER_FBFMT_ARGB4444,
113+ .rgb = true,
114+ .csc = SUN8I_CSC_MODE_OFF,
115+ },
109116 {
110117 .drm_fmt = DRM_FORMAT_ABGR4444,
111118 .de2_fmt = SUN8I_MIXER_FBFMT_ABGR4444,
112119 .rgb = true,
113120 .csc = SUN8I_CSC_MODE_OFF,
114121 },
122+ {
123+ /* for DE2 VI layer which ignores alpha */
124+ .drm_fmt = DRM_FORMAT_XBGR4444,
125+ .de2_fmt = SUN8I_MIXER_FBFMT_ABGR4444,
126+ .rgb = true,
127+ .csc = SUN8I_CSC_MODE_OFF,
128+ },
115129 {
116130 .drm_fmt = DRM_FORMAT_RGBA4444,
117131 .de2_fmt = SUN8I_MIXER_FBFMT_RGBA4444,
118132 .rgb = true,
119133 .csc = SUN8I_CSC_MODE_OFF,
120134 },
135+ {
136+ /* for DE2 VI layer which ignores alpha */
137+ .drm_fmt = DRM_FORMAT_RGBX4444,
138+ .de2_fmt = SUN8I_MIXER_FBFMT_RGBA4444,
139+ .rgb = true,
140+ .csc = SUN8I_CSC_MODE_OFF,
141+ },
121142 {
122143 .drm_fmt = DRM_FORMAT_BGRA4444,
123144 .de2_fmt = SUN8I_MIXER_FBFMT_BGRA4444,
124145 .rgb = true,
125146 .csc = SUN8I_CSC_MODE_OFF,
126147 },
148+ {
149+ /* for DE2 VI layer which ignores alpha */
150+ .drm_fmt = DRM_FORMAT_BGRX4444,
151+ .de2_fmt = SUN8I_MIXER_FBFMT_BGRA4444,
152+ .rgb = true,
153+ .csc = SUN8I_CSC_MODE_OFF,
154+ },
127155 {
128156 .drm_fmt = DRM_FORMAT_ARGB1555,
129157 .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555,
130158 .rgb = true,
131159 .csc = SUN8I_CSC_MODE_OFF,
132160 },
161+ {
162+ /* for DE2 VI layer which ignores alpha */
163+ .drm_fmt = DRM_FORMAT_XRGB1555,
164+ .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555,
165+ .rgb = true,
166+ .csc = SUN8I_CSC_MODE_OFF,
167+ },
133168 {
134169 .drm_fmt = DRM_FORMAT_ABGR1555,
135170 .de2_fmt = SUN8I_MIXER_FBFMT_ABGR1555,
136171 .rgb = true,
137172 .csc = SUN8I_CSC_MODE_OFF,
138173 },
174+ {
175+ /* for DE2 VI layer which ignores alpha */
176+ .drm_fmt = DRM_FORMAT_XBGR1555,
177+ .de2_fmt = SUN8I_MIXER_FBFMT_ABGR1555,
178+ .rgb = true,
179+ .csc = SUN8I_CSC_MODE_OFF,
180+ },
139181 {
140182 .drm_fmt = DRM_FORMAT_RGBA5551,
141183 .de2_fmt = SUN8I_MIXER_FBFMT_RGBA5551,
142184 .rgb = true,
143185 .csc = SUN8I_CSC_MODE_OFF,
144186 },
187+ {
188+ /* for DE2 VI layer which ignores alpha */
189+ .drm_fmt = DRM_FORMAT_RGBX5551,
190+ .de2_fmt = SUN8I_MIXER_FBFMT_RGBA5551,
191+ .rgb = true,
192+ .csc = SUN8I_CSC_MODE_OFF,
193+ },
145194 {
146195 .drm_fmt = DRM_FORMAT_BGRA5551,
147196 .de2_fmt = SUN8I_MIXER_FBFMT_BGRA5551,
148197 .rgb = true,
149198 .csc = SUN8I_CSC_MODE_OFF,
150199 },
200+ {
201+ /* for DE2 VI layer which ignores alpha */
202+ .drm_fmt = DRM_FORMAT_BGRX5551,
203+ .de2_fmt = SUN8I_MIXER_FBFMT_BGRA5551,
204+ .rgb = true,
205+ .csc = SUN8I_CSC_MODE_OFF,
206+ },
207+ {
208+ .drm_fmt = DRM_FORMAT_ARGB2101010,
209+ .de2_fmt = SUN8I_MIXER_FBFMT_ARGB2101010,
210+ .rgb = true,
211+ .csc = SUN8I_CSC_MODE_OFF,
212+ },
213+ {
214+ .drm_fmt = DRM_FORMAT_ABGR2101010,
215+ .de2_fmt = SUN8I_MIXER_FBFMT_ABGR2101010,
216+ .rgb = true,
217+ .csc = SUN8I_CSC_MODE_OFF,
218+ },
219+ {
220+ .drm_fmt = DRM_FORMAT_RGBA1010102,
221+ .de2_fmt = SUN8I_MIXER_FBFMT_RGBA1010102,
222+ .rgb = true,
223+ .csc = SUN8I_CSC_MODE_OFF,
224+ },
225+ {
226+ .drm_fmt = DRM_FORMAT_BGRA1010102,
227+ .de2_fmt = SUN8I_MIXER_FBFMT_BGRA1010102,
228+ .rgb = true,
229+ .csc = SUN8I_CSC_MODE_OFF,
230+ },
151231 {
152232 .drm_fmt = DRM_FORMAT_UYVY,
153233 .de2_fmt = SUN8I_MIXER_FBFMT_UYVY,
@@ -196,12 +276,6 @@ static const struct de2_fmt_info de2_formats[] = { · 42 unmodified lines
196276 .rgb = false,
197277 .csc = SUN8I_CSC_MODE_YUV2RGB,
198278 },
199− {
200− .drm_fmt = DRM_FORMAT_YUV444,
201− .de2_fmt = SUN8I_MIXER_FBFMT_RGB888,
202− .rgb = true,
203− .csc = SUN8I_CSC_MODE_YUV2RGB,
204− },
205279 {
206280 .drm_fmt = DRM_FORMAT_YUV422,
207281 .de2_fmt = SUN8I_MIXER_FBFMT_YUV422,
@@ -220,12 +294,6 @@ static const struct de2_fmt_info de2_formats[] = { · 12 unmodified lines
220294 .rgb = false,
221295 .csc = SUN8I_CSC_MODE_YUV2RGB,
222296 },
223− {
224− .drm_fmt = DRM_FORMAT_YVU444,
225− .de2_fmt = SUN8I_MIXER_FBFMT_RGB888,
226− .rgb = true,
227− .csc = SUN8I_CSC_MODE_YVU2RGB,
228− },
229297 {
230298 .drm_fmt = DRM_FORMAT_YVU422,
231299 .de2_fmt = SUN8I_MIXER_FBFMT_YUV422,
@@ -244,6 +312,18 @@ static const struct de2_fmt_info de2_formats[] = { · 12 unmodified lines
244312 .rgb = false,
245313 .csc = SUN8I_CSC_MODE_YVU2RGB,
246314 },
315+ {
316+ .drm_fmt = DRM_FORMAT_P010,
317+ .de2_fmt = SUN8I_MIXER_FBFMT_P010_YUV,
318+ .rgb = false,
319+ .csc = SUN8I_CSC_MODE_YUV2RGB,
320+ },
321+ {
322+ .drm_fmt = DRM_FORMAT_P210,
323+ .de2_fmt = SUN8I_MIXER_FBFMT_P210_YUV,
324+ .rgb = false,
325+ .csc = SUN8I_CSC_MODE_YUV2RGB,
326+ },
247327 };
248328
249329 const struct de2_fmt_info *sun8i_mixer_format_info(u32 format)
drivers/gpu/drm/sun4i/sun8i_mixer.h+11−0
@@ -93,6 +93,10 @@ · 92 unmodified lines
9393 #define SUN8I_MIXER_FBFMT_ABGR1555 17
9494 #define SUN8I_MIXER_FBFMT_RGBA5551 18
9595 #define SUN8I_MIXER_FBFMT_BGRA5551 19
96+#define SUN8I_MIXER_FBFMT_ARGB2101010 20
97+#define SUN8I_MIXER_FBFMT_ABGR2101010 21
98+#define SUN8I_MIXER_FBFMT_RGBA1010102 22
99+#define SUN8I_MIXER_FBFMT_BGRA1010102 23
96100
97101 #define SUN8I_MIXER_FBFMT_YUYV 0
98102 #define SUN8I_MIXER_FBFMT_UYVY 1
@@ -109,6 +113,13 @@ · 10 unmodified lines
109113 /* format 12 is semi-planar YUV411 UVUV */
110114 /* format 13 is semi-planar YUV411 VUVU */
111115 #define SUN8I_MIXER_FBFMT_YUV411 14
116+/* format 15 doesn't exist */
117+/* format 16 is P010 YVU */
118+#define SUN8I_MIXER_FBFMT_P010_YUV 17
119+/* format 18 is P210 YVU */
120+#define SUN8I_MIXER_FBFMT_P210_YUV 19
121+/* format 20 is packed YVU444 10-bit */
122+/* format 21 is packed YUV444 10-bit */
112123
113124 /*
114125 * Sub-engines listed bellow are unused for now. The EN registers are here only
drivers/gpu/drm/sun4i/sun8i_vi_layer.c+58−8
@@ -398,24 +398,66 @@ static const struct drm_plane_funcs sun8i_vi_layer_funcs = { · 397 unmodified lines
398398 };
399399
400400 /*
401− * While all RGB formats are supported, VI planes don't support
402− * alpha blending, so there is no point having formats with alpha
403− * channel if their opaque analog exist.
401+ * While DE2 VI layer supports same RGB formats as UI layer, alpha
402+ * channel is ignored. This structure lists all unique variants
403+ * where alpha channel is replaced with "don't care" (X) channel.
404404 */
405405 static const u32 sun8i_vi_layer_formats[] = {
406+ DRM_FORMAT_BGR565,
407+ DRM_FORMAT_BGR888,
408+ DRM_FORMAT_BGRX4444,
409+ DRM_FORMAT_BGRX5551,
410+ DRM_FORMAT_BGRX8888,
411+ DRM_FORMAT_RGB565,
412+ DRM_FORMAT_RGB888,
413+ DRM_FORMAT_RGBX4444,
414+ DRM_FORMAT_RGBX5551,
415+ DRM_FORMAT_RGBX8888,
416+ DRM_FORMAT_XBGR1555,
417+ DRM_FORMAT_XBGR4444,
418+ DRM_FORMAT_XBGR8888,
419+ DRM_FORMAT_XRGB1555,
420+ DRM_FORMAT_XRGB4444,
421+ DRM_FORMAT_XRGB8888,
422+
423+ DRM_FORMAT_NV16,
424+ DRM_FORMAT_NV12,
425+ DRM_FORMAT_NV21,
426+ DRM_FORMAT_NV61,
427+ DRM_FORMAT_UYVY,
428+ DRM_FORMAT_VYUY,
429+ DRM_FORMAT_YUYV,
430+ DRM_FORMAT_YVYU,
431+ DRM_FORMAT_YUV411,
432+ DRM_FORMAT_YUV420,
433+ DRM_FORMAT_YUV422,
434+ DRM_FORMAT_YVU411,
435+ DRM_FORMAT_YVU420,
436+ DRM_FORMAT_YVU422,
437+};
438+
439+static const u32 sun8i_vi_layer_de3_formats[] = {
406440 DRM_FORMAT_ABGR1555,
441+ DRM_FORMAT_ABGR2101010,
407442 DRM_FORMAT_ABGR4444,
443+ DRM_FORMAT_ABGR8888,
408444 DRM_FORMAT_ARGB1555,
445+ DRM_FORMAT_ARGB2101010,
409446 DRM_FORMAT_ARGB4444,
447+ DRM_FORMAT_ARGB8888,
410448 DRM_FORMAT_BGR565,
411449 DRM_FORMAT_BGR888,
450+ DRM_FORMAT_BGRA1010102,
412451 DRM_FORMAT_BGRA5551,
413452 DRM_FORMAT_BGRA4444,
453+ DRM_FORMAT_BGRA8888,
414454 DRM_FORMAT_BGRX8888,
415455 DRM_FORMAT_RGB565,
416456 DRM_FORMAT_RGB888,
457+ DRM_FORMAT_RGBA1010102,
417458 DRM_FORMAT_RGBA4444,
418459 DRM_FORMAT_RGBA5551,
460+ DRM_FORMAT_RGBA8888,
419461 DRM_FORMAT_RGBX8888,
420462 DRM_FORMAT_XBGR8888,
421463 DRM_FORMAT_XRGB8888,
@@ -424,6 +466,8 @@ static const u32 sun8i_vi_layer_formats[] = { · 2 unmodified lines
424466 DRM_FORMAT_NV12,
425467 DRM_FORMAT_NV21,
426468 DRM_FORMAT_NV61,
469+ DRM_FORMAT_P010,
470+ DRM_FORMAT_P210,
427471 DRM_FORMAT_UYVY,
428472 DRM_FORMAT_VYUY,
429473 DRM_FORMAT_YUYV,
@@ -431,11 +475,9 @@ static const u32 sun8i_vi_layer_formats[] = { · 1 unmodified line
431475 DRM_FORMAT_YUV411,
432476 DRM_FORMAT_YUV420,
433477 DRM_FORMAT_YUV422,
434− DRM_FORMAT_YUV444,
435478 DRM_FORMAT_YVU411,
436479 DRM_FORMAT_YVU420,
437480 DRM_FORMAT_YVU422,
438− DRM_FORMAT_YVU444,
439481 };
440482
441483 struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
@@ -443,19 +485,27 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm, · 1 unmodified line
443485 int index)
444486 {
445487 u32 supported_encodings, supported_ranges;
488+ unsigned int plane_cnt, format_count;
446489 struct sun8i_vi_layer *layer;
447− unsigned int plane_cnt;
490+ const u32 *formats;
448491 int ret;
449492
450493 layer = devm_kzalloc(drm->dev, sizeof(*layer), GFP_KERNEL);
451494 if (!layer)
452495 return ERR_PTR(-ENOMEM);
453496
497+ if (mixer->cfg->is_de3) {
498+ formats = sun8i_vi_layer_de3_formats;
499+ format_count = ARRAY_SIZE(sun8i_vi_layer_de3_formats);
500+ } else {
501+ formats = sun8i_vi_layer_formats;
502+ format_count = ARRAY_SIZE(sun8i_vi_layer_formats);
503+ }
504+
454505 /* possible crtcs are set later */
455506 ret = drm_universal_plane_init(drm, &layer->plane, 0,
456507 &sun8i_vi_layer_funcs,
457− sun8i_vi_layer_formats,
458− ARRAY_SIZE(sun8i_vi_layer_formats),
508+ formats, format_count,
459509 NULL, DRM_PLANE_TYPE_OVERLAY, NULL);
460510 if (ret) {
461511 dev_err(drm->dev, "Couldn't initialize layer\n");
drivers/gpu/drm/ttm/ttm_bo_util.c+1−0
@@ -515,6 +515,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · 514 unmodified lines
515515 fbo->base.base.resv = &fbo->base.base._resv;
516516
517517 dma_resv_init(&fbo->base.base._resv);
518+ fbo->base.base.dev = NULL;
518519 ret = dma_resv_trylock(&fbo->base.base._resv);
519520 WARN_ON(!ret);
520521
drivers/gpu/drm/virtio/virtgpu_object.c+3−2
@@ -42,8 +42,8 @@ static int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, · 41 unmodified lines
4242 * "f91a9dd35715 Fix unlinking resources from hash
4343 * table." (Feb 2019) fixes the bug.
4444 */
45− static int handle;
46− handle++;
45+ static atomic_t seqno = ATOMIC_INIT(0);
46+ int handle = atomic_inc_return(&seqno);
4747 *resid = handle + 1;
4848 } else {
4949 int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL);
@@ -99,6 +99,7 @@ struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, · 49 unmodified lines
9999 return NULL;
100100
101101 bo->base.base.funcs = &virtio_gpu_gem_funcs;
102+ bo->base.map_cached = true;
102103 return &bo->base.base;
103104 }
104105
drivers/hid/hid-alps.c+1−1
@@ -730,7 +730,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) · 729 unmodified lines
730730 if (data->has_sp) {
731731 input2 = input_allocate_device();
732732 if (!input2) {
733− input_free_device(input2);
733+ ret = -ENOMEM;
734734 goto exit;
735735 }
736736
drivers/hid/hid-apple.c+2−1
@@ -340,7 +340,8 @@ static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 339 unmodified lines
340340 unsigned long **bit, int *max)
341341 {
342342 if (usage->hid == (HID_UP_CUSTOM | 0x0003) ||
343− usage->hid == (HID_UP_MSVENDOR | 0x0003)) {
343+ usage->hid == (HID_UP_MSVENDOR | 0x0003) ||
344+ usage->hid == (HID_UP_HPVENDOR2 | 0x0003)) {
344345 /* The fn key on Apple USB keyboards */
345346 set_bit(EV_REP, hi->input->evbit);
346347 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN);
drivers/hid/hid-bigbenff.c+24−7
@@ -174,6 +174,7 @@ static __u8 pid0902_rdesc_fixed[] = { · 173 unmodified lines
174174 struct bigben_device {
175175 struct hid_device *hid;
176176 struct hid_report *report;
177+ bool removed;
177178 u8 led_state; /* LED1 = 1 .. LED4 = 8 */
178179 u8 right_motor_on; /* right motor off/on 0/1 */
179180 u8 left_motor_force; /* left motor force 0-255 */
@@ -190,6 +191,9 @@ static void bigben_worker(struct work_struct *work) · 10 unmodified lines
190191 struct bigben_device, worker);
191192 struct hid_field *report_field = bigben->report->field[0];
192193
194+ if (bigben->removed)
195+ return;
196+
193197 if (bigben->work_led) {
194198 bigben->work_led = false;
195199 report_field->value[0] = 0x01; /* 1 = led message */
@@ -220,10 +224,16 @@ static void bigben_worker(struct work_struct *work) · 24 unmodified lines
220224 static int hid_bigben_play_effect(struct input_dev *dev, void *data,
221225 struct ff_effect *effect)
222226 {
223− struct bigben_device *bigben = data;
227+ struct hid_device *hid = input_get_drvdata(dev);
228+ struct bigben_device *bigben = hid_get_drvdata(hid);
224229 u8 right_motor_on;
225230 u8 left_motor_force;
226231
232+ if (!bigben) {
233+ hid_err(hid, "no device data\n");
234+ return 0;
235+ }
236+
227237 if (effect->type != FF_RUMBLE)
228238 return 0;
229239
@@ -298,8 +308,8 @@ static void bigben_remove(struct hid_device *hid) · 68 unmodified lines
298308 {
299309 struct bigben_device *bigben = hid_get_drvdata(hid);
300310
311+ bigben->removed = true;
301312 cancel_work_sync(&bigben->worker);
302− hid_hw_close(hid);
303313 hid_hw_stop(hid);
304314 }
305315
@@ -319,6 +329,7 @@ static int bigben_probe(struct hid_device *hid, · 13 unmodified lines
319329 return -ENOMEM;
320330 hid_set_drvdata(hid, bigben);
321331 bigben->hid = hid;
332+ bigben->removed = false;
322333
323334 error = hid_parse(hid);
324335 if (error) {
@@ -341,10 +352,10 @@ static int bigben_probe(struct hid_device *hid, · 16 unmodified lines
341352
342353 INIT_WORK(&bigben->worker, bigben_worker);
343354
344− error = input_ff_create_memless(hidinput->input, bigben,
355+ error = input_ff_create_memless(hidinput->input, NULL,
345356 hid_bigben_play_effect);
346357 if (error)
347− return error;
358+ goto error_hw_stop;
348359
349360 name_sz = strlen(dev_name(&hid->dev)) + strlen(":red:bigben#") + 1;
350361
@@ -354,8 +365,10 @@ static int bigben_probe(struct hid_device *hid, · 3 unmodified lines
354365 sizeof(struct led_classdev) + name_sz,
355366 GFP_KERNEL
356367 );
357− if (!led)
358− return -ENOMEM;
368+ if (!led) {
369+ error = -ENOMEM;
370+ goto error_hw_stop;
371+ }
359372 name = (void *)(&led[1]);
360373 snprintf(name, name_sz,
361374 "%s:red:bigben%d",
@@ -369,7 +382,7 @@ static int bigben_probe(struct hid_device *hid, · 7 unmodified lines
369382 bigben->leds[n] = led;
370383 error = devm_led_classdev_register(&hid->dev, led);
371384 if (error)
372− return error;
385+ goto error_hw_stop;
373386 }
374387
375388 /* initial state: LED1 is on, no rumble effect */
@@ -383,6 +396,10 @@ static int bigben_probe(struct hid_device *hid, · 7 unmodified lines
383396 hid_info(hid, "LED and force feedback support for BigBen gamepad\n");
384397
385398 return 0;
399+
400+error_hw_stop:
401+ hid_hw_stop(hid);
402+ return error;
386403 }
387404
388405 static __u8 *bigben_report_fixup(struct hid_device *hid, __u8 *rdesc,
drivers/hid/hid-core.c+3−1
@@ -1741,7 +1741,9 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, · 1740 unmodified lines
17411741
17421742 rsize = ((report->size - 1) >> 3) + 1;
17431743
1744− if (rsize > HID_MAX_BUFFER_SIZE)
1744+ if (report_enum->numbered && rsize >= HID_MAX_BUFFER_SIZE)
1745+ rsize = HID_MAX_BUFFER_SIZE - 1;
1746+ else if (rsize > HID_MAX_BUFFER_SIZE)
17451747 rsize = HID_MAX_BUFFER_SIZE;
17461748
17471749 if (csize < rsize) {
drivers/hid/hid-google-hammer.c+2−0
@@ -532,6 +532,8 @@ static const struct hid_device_id hammer_devices[] = { · 531 unmodified lines
532532 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MAGNEMITE) },
533533 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
534534 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MASTERBALL) },
535+ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
536+ USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MOONBALL) },
535537 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
536538 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) },
537539 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
drivers/hid/hid-hyperv.c+2−4
@@ -193,8 +193,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device, · 192 unmodified lines
193193 goto cleanup;
194194
195195 /* The pointer is not NULL when we resume from hibernation */
196− if (input_device->hid_desc != NULL)
197− kfree(input_device->hid_desc);
196+ kfree(input_device->hid_desc);
198197 input_device->hid_desc = kmemdup(desc, desc->bLength, GFP_ATOMIC);
199198
200199 if (!input_device->hid_desc)
@@ -207,8 +206,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device, · 6 unmodified lines
207206 }
208207
209208 /* The pointer is not NULL when we resume from hibernation */
210− if (input_device->report_desc != NULL)
211− kfree(input_device->report_desc);
209+ kfree(input_device->report_desc);
212210 input_device->report_desc = kzalloc(input_device->report_desc_size,
213211 GFP_ATOMIC);
214212
drivers/hid/hid-ids.h+2−0
@@ -478,6 +478,7 @@ · 477 unmodified lines
478478 #define USB_DEVICE_ID_GOOGLE_WHISKERS 0x5030
479479 #define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c
480480 #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d
481+#define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044
481482
482483 #define USB_VENDOR_ID_GOTOP 0x08f2
483484 #define USB_DEVICE_ID_SUPER_Q2 0x007f
@@ -726,6 +727,7 @@ · 242 unmodified lines
726727 #define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085
727728 #define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3
728729 #define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5
730+#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d
729731
730732 #define USB_VENDOR_ID_LG 0x1fd2
731733 #define USB_DEVICE_ID_LG_MULTITOUCH 0x0064
drivers/hid/hid-ite.c+3−2
@@ -41,8 +41,9 @@ static const struct hid_device_id ite_devices[] = { · 40 unmodified lines
4141 { HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) },
4242 { HID_USB_DEVICE(USB_VENDOR_ID_258A, USB_DEVICE_ID_258A_6A88) },
4343 /* ITE8595 USB kbd ctlr, with Synaptics touchpad connected to it. */
44− { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS,
45− USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) },
44+ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
45+ USB_VENDOR_ID_SYNAPTICS,
46+ USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) },
4647 { }
4748 };
4849 MODULE_DEVICE_TABLE(hid, ite_devices);
drivers/hid/hid-logitech-hidpp.c+21−22
@@ -1256,36 +1256,35 @@ static int hidpp20_battery_map_status_voltage(u8 data[3], int *voltage, · 1255 unmodified lines
12561256 {
12571257 int status;
12581258
1259− long charge_sts = (long)data[2];
1259+ long flags = (long) data[2];
12601260
1261− *level = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
1262− switch (data[2] & 0xe0) {
1263− case 0x00:
1264− status = POWER_SUPPLY_STATUS_CHARGING;
1265− break;
1266− case 0x20:
1267− status = POWER_SUPPLY_STATUS_FULL;
1268− *level = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
1269− break;
1270− case 0x40:
1261+ if (flags & 0x80)
1262+ switch (flags & 0x07) {
1263+ case 0:
1264+ status = POWER_SUPPLY_STATUS_CHARGING;
1265+ break;
1266+ case 1:
1267+ status = POWER_SUPPLY_STATUS_FULL;
1268+ *level = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
1269+ break;
1270+ case 2:
1271+ status = POWER_SUPPLY_STATUS_NOT_CHARGING;
1272+ break;
1273+ default:
1274+ status = POWER_SUPPLY_STATUS_UNKNOWN;
1275+ break;
1276+ }
1277+ else
12711278 status = POWER_SUPPLY_STATUS_DISCHARGING;
1272− break;
1273− case 0xe0:
1274− status = POWER_SUPPLY_STATUS_NOT_CHARGING;
1275− break;
1276− default:
1277− status = POWER_SUPPLY_STATUS_UNKNOWN;
1278− }
12791279
12801280 *charge_type = POWER_SUPPLY_CHARGE_TYPE_STANDARD;
1281− if (test_bit(3, &charge_sts)) {
1281+ if (test_bit(3, &flags)) {
12821282 *charge_type = POWER_SUPPLY_CHARGE_TYPE_FAST;
12831283 }
1284− if (test_bit(4, &charge_sts)) {
1284+ if (test_bit(4, &flags)) {
12851285 *charge_type = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
12861286 }
1287−
1288− if (test_bit(5, &charge_sts)) {
1287+ if (test_bit(5, &flags)) {
12891288 *level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
12901289 }
12911290
drivers/hid/hid-picolcd_fb.c+2−2
@@ -458,9 +458,9 @@ static ssize_t picolcd_fb_update_rate_show(struct device *dev, · 457 unmodified lines
458458 if (ret >= PAGE_SIZE)
459459 break;
460460 else if (i == fb_update_rate)
461− ret += snprintf(buf+ret, PAGE_SIZE-ret, "[%u] ", i);
461+ ret += scnprintf(buf+ret, PAGE_SIZE-ret, "[%u] ", i);
462462 else
463− ret += snprintf(buf+ret, PAGE_SIZE-ret, "%u ", i);
463+ ret += scnprintf(buf+ret, PAGE_SIZE-ret, "%u ", i);
464464 if (ret > 0)
465465 buf[min(ret, (size_t)PAGE_SIZE)-1] = '\n';
466466 return ret;
drivers/hid/hid-quirks.c+1−0
@@ -103,6 +103,7 @@ static const struct hid_device_id hid_quirks[] = { · 102 unmodified lines
103103 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912), HID_QUIRK_MULTI_INPUT },
104104 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M406XE), HID_QUIRK_MULTI_INPUT },
105105 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_PIXART_USB_OPTICAL_MOUSE_ID2), HID_QUIRK_ALWAYS_POLL },
106+ { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D), HID_QUIRK_ALWAYS_POLL },
106107 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C007), HID_QUIRK_ALWAYS_POLL },
107108 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C077), HID_QUIRK_ALWAYS_POLL },
108109 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KEYBOARD_G710_PLUS), HID_QUIRK_NOGET },
drivers/hid/hid-sensor-custom.c+3−3
@@ -313,7 +313,7 @@ static ssize_t show_value(struct device *dev, struct device_attribute *attr, · 312 unmodified lines
313313
314314 while (i < ret) {
315315 if (i + attribute->size > ret) {
316− len += snprintf(&buf[len],
316+ len += scnprintf(&buf[len],
317317 PAGE_SIZE - len,
318318 "%d ", values[i]);
319319 break;
@@ -336,10 +336,10 @@ static ssize_t show_value(struct device *dev, struct device_attribute *attr, · 16 unmodified lines
336336 ++i;
337337 break;
338338 }
339− len += snprintf(&buf[len], PAGE_SIZE - len,
339+ len += scnprintf(&buf[len], PAGE_SIZE - len,
340340 "%lld ", value);
341341 }
342− len += snprintf(&buf[len], PAGE_SIZE - len, "\n");
342+ len += scnprintf(&buf[len], PAGE_SIZE - len, "\n");
343343
344344 return len;
345345 } else if (input)
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c+8−0
@@ -341,6 +341,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { · 340 unmodified lines
341341 },
342342 .driver_data = (void *)&sipodev_desc
343343 },
344+ {
345+ .ident = "Trekstor SURFBOOK E11B",
346+ .matches = {
347+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
348+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SURFBOOK E11B"),
349+ },
350+ .driver_data = (void *)&sipodev_desc
351+ },
344352 {
345353 .ident = "Direkt-Tek DTLAPY116-2",
346354 .matches = {
drivers/hid/usbhid/hiddev.c+1−1
@@ -932,9 +932,9 @@ void hiddev_disconnect(struct hid_device *hid) · 931 unmodified lines
932932 hiddev->exist = 0;
933933
934934 if (hiddev->open) {
935− mutex_unlock(&hiddev->existancelock);
936935 hid_hw_close(hiddev->hid);
937936 wake_up_interruptible(&hiddev->wait);
937+ mutex_unlock(&hiddev->existancelock);
938938 } else {
939939 mutex_unlock(&hiddev->existancelock);
940940 kfree(hiddev);
drivers/hwmon/adt7462.c+1−1
@@ -413,7 +413,7 @@ static int ADT7462_REG_VOLT(struct adt7462_data *data, int which) · 412 unmodified lines
413413 return 0x95;
414414 break;
415415 }
416− return -ENODEV;
416+ return 0;
417417 }
418418
419419 /* Provide labels for sysfs */
drivers/hwmon/pmbus/xdpe12284.c+54−0
@@ -18,6 +18,59 @@ · 17 unmodified lines
1818 #define XDPE122_AMD_625MV 0x10 /* AMD mode 6.25mV */
1919 #define XDPE122_PAGE_NUM 2
2020
21+static int xdpe122_read_word_data(struct i2c_client *client, int page, int reg)
22+{
23+ const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
24+ long val;
25+ s16 exponent;
26+ s32 mantissa;
27+ int ret;
28+
29+ switch (reg) {
30+ case PMBUS_VOUT_OV_FAULT_LIMIT:
31+ case PMBUS_VOUT_UV_FAULT_LIMIT:
32+ ret = pmbus_read_word_data(client, page, reg);
33+ if (ret < 0)
34+ return ret;
35+
36+ /* Convert register value to LINEAR11 data. */
37+ exponent = ((s16)ret) >> 11;
38+ mantissa = ((s16)((ret & GENMASK(10, 0)) << 5)) >> 5;
39+ val = mantissa * 1000L;
40+ if (exponent >= 0)
41+ val <<= exponent;
42+ else
43+ val >>= -exponent;
44+
45+ /* Convert data to VID register. */
46+ switch (info->vrm_version[page]) {
47+ case vr13:
48+ if (val >= 500)
49+ return 1 + DIV_ROUND_CLOSEST(val - 500, 10);
50+ return 0;
51+ case vr12:
52+ if (val >= 250)
53+ return 1 + DIV_ROUND_CLOSEST(val - 250, 5);
54+ return 0;
55+ case imvp9:
56+ if (val >= 200)
57+ return 1 + DIV_ROUND_CLOSEST(val - 200, 10);
58+ return 0;
59+ case amd625mv:
60+ if (val >= 200 && val <= 1550)
61+ return DIV_ROUND_CLOSEST((1550 - val) * 100,
62+ 625);
63+ return 0;
64+ default:
65+ return -EINVAL;
66+ }
67+ default:
68+ return -ENODATA;
69+ }
70+
71+ return 0;
72+}
73+
2174 static int xdpe122_identify(struct i2c_client *client,
2275 struct pmbus_driver_info *info)
2376 {
@@ -70,6 +123,7 @@ static struct pmbus_driver_info xdpe122_info = { · 46 unmodified lines
70123 PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
71124 PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT,
72125 .identify = xdpe122_identify,
126+ .read_word_data = xdpe122_read_word_data,
73127 };
74128
75129 static int xdpe122_probe(struct i2c_client *client,
drivers/hwtracing/intel_th/msu.c+7−6
@@ -718,9 +718,6 @@ static int msc_win_set_lockout(struct msc_window *win, · 717 unmodified lines
718718
719719 if (old != expect) {
720720 ret = -EINVAL;
721− dev_warn_ratelimited(msc_dev(win->msc),
722− "expected lockout state %d, got %d\n",
723− expect, old);
724721 goto unlock;
725722 }
726723
@@ -741,6 +738,10 @@ unlock: · 14 unmodified lines
741738 /* from intel_th_msc_window_unlock(), don't warn if not locked */
742739 if (expect == WIN_LOCKED && old == new)
743740 return 0;
741+
742+ dev_warn_ratelimited(msc_dev(win->msc),
743+ "expected lockout state %d, got %d\n",
744+ expect, old);
744745 }
745746
746747 return ret;
@@ -760,7 +761,7 @@ static int msc_configure(struct msc *msc) · 13 unmodified lines
760761 lockdep_assert_held(&msc->buf_mutex);
761762
762763 if (msc->mode > MSC_MODE_MULTI)
763− return -ENOTSUPP;
764+ return -EINVAL;
764765
765766 if (msc->mode == MSC_MODE_MULTI) {
766767 if (msc_win_set_lockout(msc->cur_win, WIN_READY, WIN_INUSE))
@@ -1294,7 +1295,7 @@ static int msc_buffer_alloc(struct msc *msc, unsigned long *nr_pages, · 527 unmodified lines
12941295 } else if (msc->mode == MSC_MODE_MULTI) {
12951296 ret = msc_buffer_multi_alloc(msc, nr_pages, nr_wins);
12961297 } else {
1297− ret = -ENOTSUPP;
1298+ ret = -EINVAL;
12981299 }
12991300
13001301 if (!ret) {
@@ -1530,7 +1531,7 @@ static ssize_t intel_th_msc_read(struct file *file, char __user *buf, · 229 unmodified lines
15301531 if (ret >= 0)
15311532 *ppos = iter->offset;
15321533 } else {
1533− ret = -ENOTSUPP;
1534+ ret = -EINVAL;
15341535 }
15351536
15361537 put_count:
drivers/hwtracing/intel_th/pci.c+5−0
@@ -234,6 +234,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 233 unmodified lines
234234 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6),
235235 .driver_data = (kernel_ulong_t)&intel_th_2x,
236236 },
237+ {
238+ /* Elkhart Lake CPU */
239+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4529),
240+ .driver_data = (kernel_ulong_t)&intel_th_2x,
241+ },
237242 {
238243 /* Elkhart Lake */
239244 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26),
drivers/hwtracing/stm/p_sys-t.c+3−3
@@ -238,7 +238,7 @@ static struct configfs_attribute *sys_t_policy_attrs[] = { · 237 unmodified lines
238238 static inline bool sys_t_need_ts(struct sys_t_output *op)
239239 {
240240 if (op->node.ts_interval &&
241− time_after(op->ts_jiffies + op->node.ts_interval, jiffies)) {
241+ time_after(jiffies, op->ts_jiffies + op->node.ts_interval)) {
242242 op->ts_jiffies = jiffies;
243243
244244 return true;
@@ -250,8 +250,8 @@ static inline bool sys_t_need_ts(struct sys_t_output *op) · 5 unmodified lines
250250 static bool sys_t_need_clock_sync(struct sys_t_output *op)
251251 {
252252 if (op->node.clocksync_interval &&
253− time_after(op->clocksync_jiffies + op->node.clocksync_interval,
254− jiffies)) {
253+ time_after(jiffies,
254+ op->clocksync_jiffies + op->node.clocksync_interval)) {
255255 op->clocksync_jiffies = jiffies;
256256
257257 return true;
drivers/i2c/busses/i2c-altera.c+1−1
@@ -171,7 +171,7 @@ static void altr_i2c_init(struct altr_i2c_dev *idev) · 170 unmodified lines
171171 /* SCL Low Time */
172172 writel(t_low, idev->base + ALTR_I2C_SCL_LOW);
173173 /* SDA Hold Time, 300ns */
174− writel(div_u64(300 * clk_mhz, 1000), idev->base + ALTR_I2C_SDA_HOLD);
174+ writel(3 * clk_mhz / 10, idev->base + ALTR_I2C_SDA_HOLD);
175175
176176 /* Mask all master interrupt bits */
177177 altr_i2c_int_enable(idev, ALTR_I2C_ALL_IRQ, false);
drivers/i2c/busses/i2c-designware-pcidrv.c+1−0
@@ -313,6 +313,7 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev) · 312 unmodified lines
313313 pm_runtime_get_noresume(&pdev->dev);
314314
315315 i2c_del_adapter(&dev->adapter);
316+ devm_free_irq(&pdev->dev, dev->irq, dev);
316317 pci_free_irq_vectors(pdev);
317318 }
318319
drivers/i2c/busses/i2c-gpio.c+1−1
@@ -348,7 +348,7 @@ static struct gpio_desc *i2c_gpio_get_desc(struct device *dev, · 347 unmodified lines
348348 if (ret == -ENOENT)
349349 retdesc = ERR_PTR(-EPROBE_DEFER);
350350
351− if (ret != -EPROBE_DEFER)
351+ if (PTR_ERR(retdesc) != -EPROBE_DEFER)
352352 dev_err(dev, "error trying to get descriptor: %d\n", ret);
353353
354354 return retdesc;
drivers/i2c/busses/i2c-i801.c+12−33
@@ -132,11 +132,6 @@ · 131 unmodified lines
132132 #define TCOBASE 0x050
133133 #define TCOCTL 0x054
134134
135−#define ACPIBASE 0x040
136−#define ACPIBASE_SMI_OFF 0x030
137−#define ACPICTRL 0x044
138−#define ACPICTRL_EN 0x080
139−
140135 #define SBREG_BAR 0x10
141136 #define SBREG_SMBCTRL 0xc6000c
142137 #define SBREG_SMBCTRL_DNV 0xcf000c
@@ -1553,7 +1548,7 @@ i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, · 1410 unmodified lines
15531548 pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, hidden);
15541549 spin_unlock(&p2sb_spinlock);
15551550
1556− res = &tco_res[ICH_RES_MEM_OFF];
1551+ res = &tco_res[1];
15571552 if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS)
15581553 res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV;
15591554 else
@@ -1563,7 +1558,7 @@ i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, · 3 unmodified lines
15631558 res->flags = IORESOURCE_MEM;
15641559
15651560 return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1,
1566− tco_res, 3, &spt_tco_platform_data,
1561+ tco_res, 2, &spt_tco_platform_data,
15671562 sizeof(spt_tco_platform_data));
15681563 }
15691564
@@ -1576,17 +1571,16 @@ static struct platform_device * · 6 unmodified lines
15761571 i801_add_tco_cnl(struct i801_priv *priv, struct pci_dev *pci_dev,
15771572 struct resource *tco_res)
15781573 {
1579− return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1,
1580− tco_res, 2, &cnl_tco_platform_data,
1581− sizeof(cnl_tco_platform_data));
1574+ return platform_device_register_resndata(&pci_dev->dev,
1575+ "iTCO_wdt", -1, tco_res, 1, &cnl_tco_platform_data,
1576+ sizeof(cnl_tco_platform_data));
15821577 }
15831578
15841579 static void i801_add_tco(struct i801_priv *priv)
15851580 {
1586− u32 base_addr, tco_base, tco_ctl, ctrl_val;
15871581 struct pci_dev *pci_dev = priv->pci_dev;
1588− struct resource tco_res[3], *res;
1589− unsigned int devfn;
1582+ struct resource tco_res[2], *res;
1583+ u32 tco_base, tco_ctl;
15901584
15911585 /* If we have ACPI based watchdog use that instead */
15921586 if (acpi_has_watchdog())
@@ -1601,30 +1595,15 @@ static void i801_add_tco(struct i801_priv *priv) · 8 unmodified lines
16011595 return;
16021596
16031597 memset(tco_res, 0, sizeof(tco_res));
1604−
1605− res = &tco_res[ICH_RES_IO_TCO];
1606− res->start = tco_base & ~1;
1607− res->end = res->start + 32 - 1;
1608− res->flags = IORESOURCE_IO;
1609−
16101598 /*
1611− * Power Management registers.
1599+ * Always populate the main iTCO IO resource here. The second entry
1600+ * for NO_REBOOT MMIO is filled by the SPT specific function.
16121601 */
1613− devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 2);
1614− pci_bus_read_config_dword(pci_dev->bus, devfn, ACPIBASE, &base_addr);
1615−
1616− res = &tco_res[ICH_RES_IO_SMI];
1617− res->start = (base_addr & ~1) + ACPIBASE_SMI_OFF;
1618− res->end = res->start + 3;
1602+ res = &tco_res[0];
1603+ res->start = tco_base & ~1;
1604+ res->end = res->start + 32 - 1;
16191605 res->flags = IORESOURCE_IO;
16201606
1621− /*
1622− * Enable the ACPI I/O space.
1623− */
1624− pci_bus_read_config_dword(pci_dev->bus, devfn, ACPICTRL, &ctrl_val);
1625− ctrl_val |= ACPICTRL_EN;
1626− pci_bus_write_config_dword(pci_dev->bus, devfn, ACPICTRL, ctrl_val);
1627−
16281607 if (priv->features & FEATURE_TCO_CNL)
16291608 priv->tco_pdev = i801_add_tco_cnl(priv, pci_dev, tco_res);
16301609 else
drivers/i2c/busses/i2c-jz4780.c+2−34
@@ -78,25 +78,6 @@ · 77 unmodified lines
7878
7979 #define X1000_I2C_DC_STOP BIT(9)
8080
81−static const char * const jz4780_i2c_abrt_src[] = {
82− "ABRT_7B_ADDR_NOACK",
83− "ABRT_10ADDR1_NOACK",
84− "ABRT_10ADDR2_NOACK",
85− "ABRT_XDATA_NOACK",
86− "ABRT_GCALL_NOACK",
87− "ABRT_GCALL_READ",
88− "ABRT_HS_ACKD",
89− "SBYTE_ACKDET",
90− "ABRT_HS_NORSTRT",
91− "SBYTE_NORSTRT",
92− "ABRT_10B_RD_NORSTRT",
93− "ABRT_MASTER_DIS",
94− "ARB_LOST",
95− "SLVFLUSH_TXFIFO",
96− "SLV_ARBLOST",
97− "SLVRD_INTX",
98−};
99−
10081 #define JZ4780_I2C_INTST_IGC BIT(11)
10182 #define JZ4780_I2C_INTST_ISTT BIT(10)
10283 #define JZ4780_I2C_INTST_ISTP BIT(9)
@@ -576,21 +557,8 @@ done: · 473 unmodified lines
576557
577558 static void jz4780_i2c_txabrt(struct jz4780_i2c *i2c, int src)
578559 {
579− int i;
580−
581− dev_err(&i2c->adap.dev, "txabrt: 0x%08x\n", src);
582− dev_err(&i2c->adap.dev, "device addr=%x\n",
583− jz4780_i2c_readw(i2c, JZ4780_I2C_TAR));
584− dev_err(&i2c->adap.dev, "send cmd count:%d %d\n",
585− i2c->cmd, i2c->cmd_buf[i2c->cmd]);
586− dev_err(&i2c->adap.dev, "receive data count:%d %d\n",
587− i2c->cmd, i2c->data_buf[i2c->cmd]);
588−
589− for (i = 0; i < 16; i++) {
590− if (src & BIT(i))
591− dev_dbg(&i2c->adap.dev, "I2C TXABRT[%d]=%s\n",
592− i, jz4780_i2c_abrt_src[i]);
593− }
560+ dev_dbg(&i2c->adap.dev, "txabrt: 0x%08x, cmd: %d, send: %d, recv: %d\n",
561+ src, i2c->cmd, i2c->cmd_buf[i2c->cmd], i2c->data_buf[i2c->cmd]);
594562 }
595563
596564 static inline int jz4780_i2c_xfer_read(struct jz4780_i2c *i2c,
drivers/i2c/i2c-core-acpi.c+9−1
@@ -394,9 +394,17 @@ EXPORT_SYMBOL_GPL(i2c_acpi_find_adapter_by_handle); · 393 unmodified lines
394394 static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev)
395395 {
396396 struct device *dev;
397+ struct i2c_client *client;
397398
398399 dev = bus_find_device_by_acpi_dev(&i2c_bus_type, adev);
399− return dev ? i2c_verify_client(dev) : NULL;
400+ if (!dev)
401+ return NULL;
402+
403+ client = i2c_verify_client(dev);
404+ if (!client)
405+ put_device(dev);
406+
407+ return client;
400408 }
401409
402410 static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,
drivers/ide/ide-gd.c+1−1
@@ -361,7 +361,7 @@ static const struct block_device_operations ide_gd_ops = { · 360 unmodified lines
361361 .release = ide_gd_release,
362362 .ioctl = ide_gd_ioctl,
363363 #ifdef CONFIG_COMPAT
364− .ioctl = ide_gd_compat_ioctl,
364+ .compat_ioctl = ide_gd_compat_ioctl,
365365 #endif
366366 .getgeo = ide_gd_getgeo,
367367 .check_events = ide_gd_check_events,
drivers/iio/accel/adxl372.c+1−0
@@ -237,6 +237,7 @@ static const struct adxl372_axis_lookup adxl372_axis_lookup_table[] = { · 236 unmodified lines
237237 .realbits = 12, \
238238 .storagebits = 16, \
239239 .shift = 4, \
240+ .endianness = IIO_BE, \
240241 }, \
241242 }
242243
drivers/iio/accel/st_accel_i2c.c+1−1
@@ -110,7 +110,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match); · 109 unmodified lines
110110
111111 #ifdef CONFIG_ACPI
112112 static const struct acpi_device_id st_accel_acpi_match[] = {
113− {"SMO8840", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
113+ {"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME},
114114 {"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
115115 { },
116116 };
drivers/iio/adc/at91-sama5d2_adc.c+15−0
@@ -723,6 +723,7 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) · 722 unmodified lines
723723
724724 for_each_set_bit(bit, indio->active_scan_mask, indio->num_channels) {
725725 struct iio_chan_spec const *chan = at91_adc_chan_get(indio, bit);
726+ u32 cor;
726727
727728 if (!chan)
728729 continue;
@@ -731,6 +732,20 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) · 2 unmodified lines
731732 chan->type == IIO_PRESSURE)
732733 continue;
733734
735+ if (state) {
736+ cor = at91_adc_readl(st, AT91_SAMA5D2_COR);
737+
738+ if (chan->differential)
739+ cor |= (BIT(chan->channel) |
740+ BIT(chan->channel2)) <<
741+ AT91_SAMA5D2_COR_DIFF_OFFSET;
742+ else
743+ cor &= ~(BIT(chan->channel) <<
744+ AT91_SAMA5D2_COR_DIFF_OFFSET);
745+
746+ at91_adc_writel(st, AT91_SAMA5D2_COR, cor);
747+ }
748+
734749 if (state) {
735750 at91_adc_writel(st, AT91_SAMA5D2_CHER,
736751 BIT(chan->channel));
drivers/iio/adc/stm32-dfsdm-adc.c+10−33
@@ -842,31 +842,6 @@ static inline void stm32_dfsdm_process_data(struct stm32_dfsdm_adc *adc, · 841 unmodified lines
842842 }
843843 }
844844
845−static irqreturn_t stm32_dfsdm_adc_trigger_handler(int irq, void *p)
846−{
847− struct iio_poll_func *pf = p;
848− struct iio_dev *indio_dev = pf->indio_dev;
849− struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
850− int available = stm32_dfsdm_adc_dma_residue(adc);
851−
852− while (available >= indio_dev->scan_bytes) {
853− s32 *buffer = (s32 *)&adc->rx_buf[adc->bufi];
854−
855− stm32_dfsdm_process_data(adc, buffer);
856−
857− iio_push_to_buffers_with_timestamp(indio_dev, buffer,
858− pf->timestamp);
859− available -= indio_dev->scan_bytes;
860− adc->bufi += indio_dev->scan_bytes;
861− if (adc->bufi >= adc->buf_sz)
862− adc->bufi = 0;
863− }
864−
865− iio_trigger_notify_done(indio_dev->trig);
866−
867− return IRQ_HANDLED;
868−}
869−
870845 static void stm32_dfsdm_dma_buffer_done(void *data)
871846 {
872847 struct iio_dev *indio_dev = data;
@@ -874,11 +849,6 @@ static void stm32_dfsdm_dma_buffer_done(void *data) · 1 unmodified line
874849 int available = stm32_dfsdm_adc_dma_residue(adc);
875850 size_t old_pos;
876851
877− if (indio_dev->currentmode & INDIO_BUFFER_TRIGGERED) {
878− iio_trigger_poll_chained(indio_dev->trig);
879− return;
880− }
881−
882852 /*
883853 * FIXME: In Kernel interface does not support cyclic DMA buffer,and
884854 * offers only an interface to push data samples per samples.
@@ -906,7 +876,15 @@ static void stm32_dfsdm_dma_buffer_done(void *data) · 21 unmodified lines
906876 adc->bufi = 0;
907877 old_pos = 0;
908878 }
909− /* regular iio buffer without trigger */
879+ /*
880+ * In DMA mode the trigger services of IIO are not used
881+ * (e.g. no call to iio_trigger_poll).
882+ * Calling irq handler associated to the hardware trigger is not
883+ * relevant as the conversions have already been done. Data
884+ * transfers are performed directly in DMA callback instead.
885+ * This implementation avoids to call trigger irq handler that
886+ * may sleep, in an atomic context (DMA irq handler context).
887+ */
910888 if (adc->dev_data->type == DFSDM_IIO)
911889 iio_push_to_buffers(indio_dev, buffer);
912890 }
@@ -1536,8 +1514,7 @@ static int stm32_dfsdm_adc_init(struct iio_dev *indio_dev) · 623 unmodified lines
15361514 }
15371515
15381516 ret = iio_triggered_buffer_setup(indio_dev,
1539− &iio_pollfunc_store_time,
1540− &stm32_dfsdm_adc_trigger_handler,
1517+ &iio_pollfunc_store_time, NULL,
15411518 &stm32_dfsdm_buffer_setup_ops);
15421519 if (ret) {
15431520 stm32_dfsdm_dma_release(indio_dev);
drivers/iio/chemical/Kconfig+2−0
@@ -91,6 +91,8 @@ config SPS30 · 90 unmodified lines
9191 tristate "SPS30 particulate matter sensor"
9292 depends on I2C
9393 select CRC8
94+ select IIO_BUFFER
95+ select IIO_TRIGGERED_BUFFER
9496 help
9597 Say Y here to build support for the Sensirion SPS30 particulate
9698 matter sensor.
drivers/iio/light/vcnl4000.c+8−7
@@ -167,16 +167,17 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 166 unmodified lines
167167 data->vcnl4200_ps.reg = VCNL4200_PS_DATA;
168168 switch (id) {
169169 case VCNL4200_PROD_ID:
170− /* Integration time is 50ms, but the experiments */
171− /* show 54ms in total. */
172− data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);
173− data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);
170+ /* Default wait time is 50ms, add 20% tolerance. */
171+ data->vcnl4200_al.sampling_rate = ktime_set(0, 60000 * 1000);
172+ /* Default wait time is 4.8ms, add 20% tolerance. */
173+ data->vcnl4200_ps.sampling_rate = ktime_set(0, 5760 * 1000);
174174 data->al_scale = 24000;
175175 break;
176176 case VCNL4040_PROD_ID:
177− /* Integration time is 80ms, add 10ms. */
178− data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000);
179− data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000);
177+ /* Default wait time is 80ms, add 20% tolerance. */
178+ data->vcnl4200_al.sampling_rate = ktime_set(0, 96000 * 1000);
179+ /* Default wait time is 5ms, add 20% tolerance. */
180+ data->vcnl4200_ps.sampling_rate = ktime_set(0, 6000 * 1000);
180181 data->al_scale = 120000;
181182 break;
182183 }
drivers/iio/magnetometer/ak8974.c+1−1
@@ -564,7 +564,7 @@ static int ak8974_read_raw(struct iio_dev *indio_dev, · 563 unmodified lines
564564 * We read all axes and discard all but one, for optimized
565565 * reading, use the triggered buffer.
566566 */
567− *val = le16_to_cpu(hw_values[chan->address]);
567+ *val = (s16)le16_to_cpu(hw_values[chan->address]);
568568
569569 ret = IIO_VAL_INT;
570570 }
drivers/iio/proximity/ping.c+1−1
@@ -269,7 +269,7 @@ static const struct iio_chan_spec ping_chan_spec[] = { · 268 unmodified lines
269269
270270 static const struct of_device_id of_ping_match[] = {
271271 { .compatible = "parallax,ping", .data = &pa_ping_cfg},
272− { .compatible = "parallax,laserping", .data = &pa_ping_cfg},
272+ { .compatible = "parallax,laserping", .data = &pa_laser_ping_cfg},
273273 {},
274274 };
275275
drivers/iio/trigger/stm32-timer-trigger.c+9−2
@@ -161,7 +161,8 @@ static int stm32_timer_start(struct stm32_timer_trigger *priv, · 160 unmodified lines
161161 return 0;
162162 }
163163
164−static void stm32_timer_stop(struct stm32_timer_trigger *priv)
164+static void stm32_timer_stop(struct stm32_timer_trigger *priv,
165+ struct iio_trigger *trig)
165166 {
166167 u32 ccer, cr1;
167168
@@ -179,6 +180,12 @@ static void stm32_timer_stop(struct stm32_timer_trigger *priv) · 11 unmodified lines
179180 regmap_write(priv->regmap, TIM_PSC, 0);
180181 regmap_write(priv->regmap, TIM_ARR, 0);
181182
183+ /* Force disable master mode */
184+ if (stm32_timer_is_trgo2_name(trig->name))
185+ regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, 0);
186+ else
187+ regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS, 0);
188+
182189 /* Make sure that registers are updated */
183190 regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG);
184191 }
@@ -197,7 +204,7 @@ static ssize_t stm32_tt_store_frequency(struct device *dev, · 12 unmodified lines
197204 return ret;
198205
199206 if (freq == 0) {
200− stm32_timer_stop(priv);
207+ stm32_timer_stop(priv, trig);
201208 } else {
202209 ret = stm32_timer_start(priv, trig, freq);
203210 if (ret)
drivers/infiniband/core/cm.c+1−0
@@ -1191,6 +1191,7 @@ struct ib_cm_id *ib_cm_insert_listen(struct ib_device *device, · 1190 unmodified lines
11911191 /* Sharing an ib_cm_id with different handlers is not
11921192 * supported */
11931193 spin_unlock_irqrestore(&cm.lock, flags);
1194+ ib_destroy_cm_id(cm_id);
11941195 return ERR_PTR(-EINVAL);
11951196 }
11961197 refcount_inc(&cm_id_priv->refcount);
drivers/infiniband/core/cma.c+11−4
@@ -3212,19 +3212,26 @@ int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr, · 3211 unmodified lines
32123212 int ret;
32133213
32143214 id_priv = container_of(id, struct rdma_id_private, id);
3215+ memcpy(cma_dst_addr(id_priv), dst_addr, rdma_addr_size(dst_addr));
32153216 if (id_priv->state == RDMA_CM_IDLE) {
32163217 ret = cma_bind_addr(id, src_addr, dst_addr);
3217− if (ret)
3218+ if (ret) {
3219+ memset(cma_dst_addr(id_priv), 0,
3220+ rdma_addr_size(dst_addr));
32183221 return ret;
3222+ }
32193223 }
32203224
3221− if (cma_family(id_priv) != dst_addr->sa_family)
3225+ if (cma_family(id_priv) != dst_addr->sa_family) {
3226+ memset(cma_dst_addr(id_priv), 0, rdma_addr_size(dst_addr));
32223227 return -EINVAL;
3228+ }
32233229
3224− if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY))
3230+ if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY)) {
3231+ memset(cma_dst_addr(id_priv), 0, rdma_addr_size(dst_addr));
32253232 return -EINVAL;
3233+ }
32263234
3227− memcpy(cma_dst_addr(id_priv), dst_addr, rdma_addr_size(dst_addr));
32283235 if (cma_any_addr(dst_addr)) {
32293236 ret = cma_resolve_loopback(id_priv);
32303237 } else {
drivers/infiniband/core/core_priv.h+14−0
@@ -338,6 +338,20 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev, · 337 unmodified lines
338338 qp->pd = pd;
339339 qp->uobject = uobj;
340340 qp->real_qp = qp;
341+
342+ qp->qp_type = attr->qp_type;
343+ qp->rwq_ind_tbl = attr->rwq_ind_tbl;
344+ qp->send_cq = attr->send_cq;
345+ qp->recv_cq = attr->recv_cq;
346+ qp->srq = attr->srq;
347+ qp->rwq_ind_tbl = attr->rwq_ind_tbl;
348+ qp->event_handler = attr->event_handler;
349+
350+ atomic_set(&qp->usecnt, 0);
351+ spin_lock_init(&qp->mr_lock);
352+ INIT_LIST_HEAD(&qp->rdma_mrs);
353+ INIT_LIST_HEAD(&qp->sig_mrs);
354+
341355 /*
342356 * We don't track XRC QPs for now, because they don't have PD
343357 * and more importantly they are created internaly by driver,
drivers/infiniband/core/iwcm.c+3−1
@@ -159,8 +159,10 @@ static void dealloc_work_entries(struct iwcm_id_private *cm_id_priv) · 158 unmodified lines
159159 {
160160 struct list_head *e, *tmp;
161161
162− list_for_each_safe(e, tmp, &cm_id_priv->work_free_list)
162+ list_for_each_safe(e, tmp, &cm_id_priv->work_free_list) {
163+ list_del(e);
163164 kfree(list_entry(e, struct iwcm_work, free_list));
165+ }
164166 }
165167
166168 static int alloc_work_entries(struct iwcm_id_private *cm_id_priv, int count)
drivers/infiniband/core/nldev.c+2−0
@@ -1757,6 +1757,8 @@ static int nldev_stat_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh, · 1756 unmodified lines
17571757 if (ret)
17581758 goto err_msg;
17591759 } else {
1760+ if (!tb[RDMA_NLDEV_ATTR_RES_LQPN])
1761+ goto err_msg;
17601762 qpn = nla_get_u32(tb[RDMA_NLDEV_ATTR_RES_LQPN]);
17611763 if (tb[RDMA_NLDEV_ATTR_STAT_COUNTER_ID]) {
17621764 cntn = nla_get_u32(tb[RDMA_NLDEV_ATTR_STAT_COUNTER_ID]);
drivers/infiniband/core/rw.c+20−11
@@ -273,6 +273,23 @@ static int rdma_rw_init_single_wr(struct rdma_rw_ctx *ctx, struct ib_qp *qp, · 272 unmodified lines
273273 return 1;
274274 }
275275
276+static void rdma_rw_unmap_sg(struct ib_device *dev, struct scatterlist *sg,
277+ u32 sg_cnt, enum dma_data_direction dir)
278+{
279+ if (is_pci_p2pdma_page(sg_page(sg)))
280+ pci_p2pdma_unmap_sg(dev->dma_device, sg, sg_cnt, dir);
281+ else
282+ ib_dma_unmap_sg(dev, sg, sg_cnt, dir);
283+}
284+
285+static int rdma_rw_map_sg(struct ib_device *dev, struct scatterlist *sg,
286+ u32 sg_cnt, enum dma_data_direction dir)
287+{
288+ if (is_pci_p2pdma_page(sg_page(sg)))
289+ return pci_p2pdma_map_sg(dev->dma_device, sg, sg_cnt, dir);
290+ return ib_dma_map_sg(dev, sg, sg_cnt, dir);
291+}
292+
276293 /**
277294 * rdma_rw_ctx_init - initialize a RDMA READ/WRITE context
278295 * @ctx: context to initialize
@@ -295,11 +312,7 @@ int rdma_rw_ctx_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num, · 16 unmodified lines
295312 struct ib_device *dev = qp->pd->device;
296313 int ret;
297314
298− if (is_pci_p2pdma_page(sg_page(sg)))
299− ret = pci_p2pdma_map_sg(dev->dma_device, sg, sg_cnt, dir);
300− else
301− ret = ib_dma_map_sg(dev, sg, sg_cnt, dir);
302−
315+ ret = rdma_rw_map_sg(dev, sg, sg_cnt, dir);
303316 if (!ret)
304317 return -ENOMEM;
305318 sg_cnt = ret;
@@ -338,7 +351,7 @@ int rdma_rw_ctx_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num, · 32 unmodified lines
338351 return ret;
339352
340353 out_unmap_sg:
341− ib_dma_unmap_sg(dev, sg, sg_cnt, dir);
354+ rdma_rw_unmap_sg(dev, sg, sg_cnt, dir);
342355 return ret;
343356 }
344357 EXPORT_SYMBOL(rdma_rw_ctx_init);
@@ -588,11 +601,7 @@ void rdma_rw_ctx_destroy(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num, · 243 unmodified lines
588601 break;
589602 }
590603
591− if (is_pci_p2pdma_page(sg_page(sg)))
592− pci_p2pdma_unmap_sg(qp->pd->device->dma_device, sg,
593− sg_cnt, dir);
594− else
595− ib_dma_unmap_sg(qp->pd->device, sg, sg_cnt, dir);
604+ rdma_rw_unmap_sg(qp->pd->device, sg, sg_cnt, dir);
596605 }
597606 EXPORT_SYMBOL(rdma_rw_ctx_destroy);
598607
drivers/infiniband/core/security.c+9−5
@@ -340,15 +340,19 @@ static struct ib_ports_pkeys *get_new_pps(const struct ib_qp *qp, · 339 unmodified lines
340340 return NULL;
341341
342342 if (qp_attr_mask & IB_QP_PORT)
343− new_pps->main.port_num =
344− (qp_pps) ? qp_pps->main.port_num : qp_attr->port_num;
343+ new_pps->main.port_num = qp_attr->port_num;
344+ else if (qp_pps)
345+ new_pps->main.port_num = qp_pps->main.port_num;
346+
345347 if (qp_attr_mask & IB_QP_PKEY_INDEX)
346− new_pps->main.pkey_index = (qp_pps) ? qp_pps->main.pkey_index :
347− qp_attr->pkey_index;
348+ new_pps->main.pkey_index = qp_attr->pkey_index;
349+ else if (qp_pps)
350+ new_pps->main.pkey_index = qp_pps->main.pkey_index;
351+
348352 if ((qp_attr_mask & IB_QP_PKEY_INDEX) && (qp_attr_mask & IB_QP_PORT))
349353 new_pps->main.state = IB_PORT_PKEY_VALID;
350354
351− if (!(qp_attr_mask & (IB_QP_PKEY_INDEX || IB_QP_PORT)) && qp_pps) {
355+ if (!(qp_attr_mask & (IB_QP_PKEY_INDEX | IB_QP_PORT)) && qp_pps) {
352356 new_pps->main.port_num = qp_pps->main.port_num;
353357 new_pps->main.pkey_index = qp_pps->main.pkey_index;
354358 if (qp_pps->main.state != IB_PORT_PKEY_NOT_VALID)
drivers/infiniband/core/umem_odp.c+19−5
@@ -181,14 +181,28 @@ ib_umem_odp_alloc_child(struct ib_umem_odp *root, unsigned long addr, · 180 unmodified lines
181181 odp_data->page_shift = PAGE_SHIFT;
182182 odp_data->notifier.ops = ops;
183183
184+ /*
185+ * A mmget must be held when registering a notifier, the owming_mm only
186+ * has a mm_grab at this point.
187+ */
188+ if (!mmget_not_zero(umem->owning_mm)) {
189+ ret = -EFAULT;
190+ goto out_free;
191+ }
192+
184193 odp_data->tgid = get_pid(root->tgid);
185194 ret = ib_init_umem_odp(odp_data, ops);
186− if (ret) {
187− put_pid(odp_data->tgid);
188− kfree(odp_data);
189− return ERR_PTR(ret);
190− }
195+ if (ret)
196+ goto out_tgid;
197+ mmput(umem->owning_mm);
191198 return odp_data;
199+
200+out_tgid:
201+ put_pid(odp_data->tgid);
202+ mmput(umem->owning_mm);
203+out_free:
204+ kfree(odp_data);
205+ return ERR_PTR(ret);
192206 }
193207 EXPORT_SYMBOL(ib_umem_odp_alloc_child);
194208
drivers/infiniband/core/uverbs_cmd.c+0−9
@@ -1445,16 +1445,7 @@ static int create_qp(struct uverbs_attr_bundle *attrs, · 1444 unmodified lines
14451445 if (ret)
14461446 goto err_cb;
14471447
1448− qp->pd = pd;
1449− qp->send_cq = attr.send_cq;
1450− qp->recv_cq = attr.recv_cq;
1451− qp->srq = attr.srq;
1452− qp->rwq_ind_tbl = ind_tbl;
1453− qp->event_handler = attr.event_handler;
1454− qp->qp_type = attr.qp_type;
1455− atomic_set(&qp->usecnt, 0);
14561448 atomic_inc(&pd->usecnt);
1457− qp->port = 0;
14581449 if (attr.send_cq)
14591450 atomic_inc(&attr.send_cq->usecnt);
14601451 if (attr.recv_cq)
drivers/infiniband/core/verbs.c+0−10
@@ -1185,16 +1185,6 @@ struct ib_qp *ib_create_qp_user(struct ib_pd *pd, · 1184 unmodified lines
11851185 if (ret)
11861186 goto err;
11871187
1188− qp->qp_type = qp_init_attr->qp_type;
1189− qp->rwq_ind_tbl = qp_init_attr->rwq_ind_tbl;
1190−
1191− atomic_set(&qp->usecnt, 0);
1192− qp->mrs_used = 0;
1193− spin_lock_init(&qp->mr_lock);
1194− INIT_LIST_HEAD(&qp->rdma_mrs);
1195− INIT_LIST_HEAD(&qp->sig_mrs);
1196− qp->port = 0;
1197−
11981188 if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) {
11991189 struct ib_qp *xrc_qp =
12001190 create_xrc_qp_user(qp, qp_init_attr, udata);
drivers/infiniband/hw/hfi1/verbs.c+3−1
@@ -515,10 +515,11 @@ static inline void hfi1_handle_packet(struct hfi1_packet *packet, · 514 unmodified lines
515515 opa_get_lid(packet->dlid, 9B));
516516 if (!mcast)
517517 goto drop;
518+ rcu_read_lock();
518519 list_for_each_entry_rcu(p, &mcast->qp_list, list) {
519520 packet->qp = p->qp;
520521 if (hfi1_do_pkey_check(packet))
521− goto drop;
522+ goto unlock_drop;
522523 spin_lock_irqsave(&packet->qp->r_lock, flags);
523524 packet_handler = qp_ok(packet);
524525 if (likely(packet_handler))
@@ -527,6 +528,7 @@ static inline void hfi1_handle_packet(struct hfi1_packet *packet, · 2 unmodified lines
527528 ibp->rvp.n_pkt_drops++;
528529 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
529530 }
531+ rcu_read_unlock();
530532 /*
531533 * Notify rvt_multicast_detach() if it is waiting for us
532534 * to finish.
drivers/infiniband/hw/mlx5/mlx5_ib.h+1−0
@@ -636,6 +636,7 @@ struct mlx5_ib_mr { · 635 unmodified lines
636636
637637 /* For ODP and implicit */
638638 atomic_t num_deferred_work;
639+ wait_queue_head_t q_deferred_work;
639640 struct xarray implicit_children;
640641 union {
641642 struct rcu_head rcu;
drivers/infiniband/hw/mlx5/odp.c+7−10
@@ -235,7 +235,8 @@ static void free_implicit_child_mr(struct mlx5_ib_mr *mr, bool need_imr_xlt) · 234 unmodified lines
235235 mr->parent = NULL;
236236 mlx5_mr_cache_free(mr->dev, mr);
237237 ib_umem_odp_release(odp);
238− atomic_dec(&imr->num_deferred_work);
238+ if (atomic_dec_and_test(&imr->num_deferred_work))
239+ wake_up(&imr->q_deferred_work);
239240 }
240241
241242 static void free_implicit_child_mr_work(struct work_struct *work)
@@ -554,6 +555,7 @@ struct mlx5_ib_mr *mlx5_ib_alloc_implicit_mr(struct mlx5_ib_pd *pd, · 312 unmodified lines
554555 imr->umem = &umem_odp->umem;
555556 imr->is_odp_implicit = true;
556557 atomic_set(&imr->num_deferred_work, 0);
558+ init_waitqueue_head(&imr->q_deferred_work);
557559 xa_init(&imr->implicit_children);
558560
559561 err = mlx5_ib_update_xlt(imr, 0,
@@ -611,10 +613,7 @@ void mlx5_ib_free_implicit_mr(struct mlx5_ib_mr *imr) · 51 unmodified lines
611613 * under xa_lock while the child is in the xarray. Thus at this point
612614 * it is only decreasing, and all work holding it is now on the wq.
613615 */
614− if (atomic_read(&imr->num_deferred_work)) {
615− flush_workqueue(system_unbound_wq);
616− WARN_ON(atomic_read(&imr->num_deferred_work));
617− }
616+ wait_event(imr->q_deferred_work, !atomic_read(&imr->num_deferred_work));
618617
619618 /*
620619 * Fence the imr before we destroy the children. This allows us to
@@ -645,10 +644,7 @@ void mlx5_ib_fence_odp_mr(struct mlx5_ib_mr *mr) · 24 unmodified lines
645644 /* Wait for all running page-fault handlers to finish. */
646645 synchronize_srcu(&mr->dev->odp_srcu);
647646
648− if (atomic_read(&mr->num_deferred_work)) {
649− flush_workqueue(system_unbound_wq);
650− WARN_ON(atomic_read(&mr->num_deferred_work));
651− }
647+ wait_event(mr->q_deferred_work, !atomic_read(&mr->num_deferred_work));
652648
653649 dma_fence_odp_mr(mr);
654650 }
@@ -1720,7 +1716,8 @@ static void destroy_prefetch_work(struct prefetch_mr_work *work) · 1065 unmodified lines
17201716 u32 i;
17211717
17221718 for (i = 0; i < work->num_sge; ++i)
1723− atomic_dec(&work->frags[i].mr->num_deferred_work);
1719+ if (atomic_dec_and_test(&work->frags[i].mr->num_deferred_work))
1720+ wake_up(&work->frags[i].mr->q_deferred_work);
17241721 kvfree(work);
17251722 }
17261723
drivers/infiniband/hw/qib/qib_verbs.c+2−0
@@ -329,8 +329,10 @@ void qib_ib_rcv(struct qib_ctxtdata *rcd, void *rhdr, void *data, u32 tlen) · 328 unmodified lines
329329 if (mcast == NULL)
330330 goto drop;
331331 this_cpu_inc(ibp->pmastats->n_multicast_rcv);
332+ rcu_read_lock();
332333 list_for_each_entry_rcu(p, &mcast->qp_list, list)
333334 qib_qp_rcv(rcd, hdr, 1, data, tlen, p->qp);
335+ rcu_read_unlock();
334336 /*
335337 * Notify rvt_multicast_detach() if it is waiting for us
336338 * to finish.
drivers/infiniband/sw/siw/siw_main.c+3−3
@@ -388,6 +388,9 @@ static struct siw_device *siw_device_create(struct net_device *netdev) · 387 unmodified lines
388388 { .max_segment_size = SZ_2G };
389389 base_dev->num_comp_vectors = num_possible_cpus();
390390
391+ xa_init_flags(&sdev->qp_xa, XA_FLAGS_ALLOC1);
392+ xa_init_flags(&sdev->mem_xa, XA_FLAGS_ALLOC1);
393+
391394 ib_set_device_ops(base_dev, &siw_device_ops);
392395 rv = ib_device_set_netdev(base_dev, netdev, 1);
393396 if (rv)
@@ -415,9 +418,6 @@ static struct siw_device *siw_device_create(struct net_device *netdev) · 21 unmodified lines
415418 sdev->attrs.max_srq_wr = SIW_MAX_SRQ_WR;
416419 sdev->attrs.max_srq_sge = SIW_MAX_SGE;
417420
418− xa_init_flags(&sdev->qp_xa, XA_FLAGS_ALLOC1);
419− xa_init_flags(&sdev->mem_xa, XA_FLAGS_ALLOC1);
420−
421421 INIT_LIST_HEAD(&sdev->cep_list);
422422 INIT_LIST_HEAD(&sdev->qp_list);
423423
drivers/interconnect/core.c+9−0
@@ -445,6 +445,11 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) · 444 unmodified lines
445445 path->name = kasprintf(GFP_KERNEL, "%s-%s",
446446 src_node->name, dst_node->name);
447447
448+ if (!path->name) {
449+ kfree(path);
450+ return ERR_PTR(-ENOMEM);
451+ }
452+
448453 return path;
449454 }
450455 EXPORT_SYMBOL_GPL(of_icc_get);
@@ -579,6 +584,10 @@ struct icc_path *icc_get(struct device *dev, const int src_id, const int dst_id) · 128 unmodified lines
579584 }
580585
581586 path->name = kasprintf(GFP_KERNEL, "%s-%s", src->name, dst->name);
587+ if (!path->name) {
588+ kfree(path);
589+ path = ERR_PTR(-ENOMEM);
590+ }
582591 out:
583592 mutex_unlock(&icc_lock);
584593 return path;
drivers/iommu/amd_iommu.c+2−2
@@ -3826,7 +3826,7 @@ int amd_iommu_activate_guest_mode(void *data) · 3825 unmodified lines
38263826 entry->lo.fields_vapic.ga_tag = ir_data->ga_tag;
38273827
38283828 return modify_irte_ga(ir_data->irq_2_irte.devid,
3829− ir_data->irq_2_irte.index, entry, NULL);
3829+ ir_data->irq_2_irte.index, entry, ir_data);
38303830 }
38313831 EXPORT_SYMBOL(amd_iommu_activate_guest_mode);
38323832
@@ -3852,7 +3852,7 @@ int amd_iommu_deactivate_guest_mode(void *data) · 19 unmodified lines
38523852 APICID_TO_IRTE_DEST_HI(cfg->dest_apicid);
38533853
38543854 return modify_irte_ga(ir_data->irq_2_irte.devid,
3855− ir_data->irq_2_irte.index, entry, NULL);
3855+ ir_data->irq_2_irte.index, entry, ir_data);
38563856 }
38573857 EXPORT_SYMBOL(amd_iommu_deactivate_guest_mode);
38583858
drivers/iommu/dma-iommu.c+8−8
@@ -177,15 +177,15 @@ static int cookie_init_hw_msi_region(struct iommu_dma_cookie *cookie, · 176 unmodified lines
177177 start -= iova_offset(iovad, start);
178178 num_pages = iova_align(iovad, end - start) >> iova_shift(iovad);
179179
180− msi_page = kcalloc(num_pages, sizeof(*msi_page), GFP_KERNEL);
181− if (!msi_page)
182− return -ENOMEM;
183−
184180 for (i = 0; i < num_pages; i++) {
185− msi_page[i].phys = start;
186− msi_page[i].iova = start;
187− INIT_LIST_HEAD(&msi_page[i].list);
188− list_add(&msi_page[i].list, &cookie->msi_page_list);
181+ msi_page = kmalloc(sizeof(*msi_page), GFP_KERNEL);
182+ if (!msi_page)
183+ return -ENOMEM;
184+
185+ msi_page->phys = start;
186+ msi_page->iova = start;
187+ INIT_LIST_HEAD(&msi_page->list);
188+ list_add(&msi_page->list, &cookie->msi_page_list);
189189 start += iovad->granule;
190190 }
191191
drivers/iommu/dmar.c+17−7
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/slab.h>
2929 #include <linux/iommu.h>
3030 #include <linux/numa.h>
31+#include <linux/limits.h>
3132 #include <asm/irq_remapping.h>
3233 #include <asm/iommu_table.h>
3334
@@ -128,6 +129,13 @@ dmar_alloc_pci_notify_info(struct pci_dev *dev, unsigned long event) · 94 unmodified lines
128129
129130 BUG_ON(dev->is_virtfn);
130131
132+ /*
133+ * Ignore devices that have a domain number higher than what can
134+ * be looked up in DMAR, e.g. VMD subdevices with domain 0x10000
135+ */
136+ if (pci_domain_nr(dev->bus) > U16_MAX)
137+ return NULL;
138+
131139 /* Only generate path[] for device addition event */
132140 if (event == BUS_NOTIFY_ADD_DEVICE)
133141 for (tmp = dev; tmp; tmp = tmp->bus->self)
@@ -363,7 +371,8 @@ dmar_find_dmaru(struct acpi_dmar_hardware_unit *drhd) · 229 unmodified lines
363371 {
364372 struct dmar_drhd_unit *dmaru;
365373
366− list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list)
374+ list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list,
375+ dmar_rcu_check())
367376 if (dmaru->segment == drhd->segment &&
368377 dmaru->reg_base_addr == drhd->address)
369378 return dmaru;
@@ -440,12 +449,13 @@ static int __init dmar_parse_one_andd(struct acpi_dmar_header *header, · 70 unmodified lines
440449
441450 /* Check for NUL termination within the designated length */
442451 if (strnlen(andd->device_name, header->length - 8) == header->length - 8) {
443− WARN_TAINT(1, TAINT_FIRMWARE_WORKAROUND,
452+ pr_warn(FW_BUG
444453 "Your BIOS is broken; ANDD object name is not NUL-terminated\n"
445454 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
446455 dmi_get_system_info(DMI_BIOS_VENDOR),
447456 dmi_get_system_info(DMI_BIOS_VERSION),
448457 dmi_get_system_info(DMI_PRODUCT_VERSION));
458+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
449459 return -EINVAL;
450460 }
451461 pr_info("ANDD device: %x name: %s\n", andd->device_number,
@@ -471,14 +481,14 @@ static int dmar_parse_one_rhsa(struct acpi_dmar_header *header, void *arg) · 19 unmodified lines
471481 return 0;
472482 }
473483 }
474− WARN_TAINT(
475− 1, TAINT_FIRMWARE_WORKAROUND,
484+ pr_warn(FW_BUG
476485 "Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n"
477486 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
478− drhd->reg_base_addr,
487+ rhsa->base_address,
479488 dmi_get_system_info(DMI_BIOS_VENDOR),
480489 dmi_get_system_info(DMI_BIOS_VERSION),
481490 dmi_get_system_info(DMI_PRODUCT_VERSION));
491+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
482492
483493 return 0;
484494 }
@@ -827,14 +837,14 @@ int __init dmar_table_init(void) · 342 unmodified lines
827837
828838 static void warn_invalid_dmar(u64 addr, const char *message)
829839 {
830− WARN_TAINT_ONCE(
831− 1, TAINT_FIRMWARE_WORKAROUND,
840+ pr_warn_once(FW_BUG
832841 "Your BIOS is broken; DMAR reported at address %llx%s!\n"
833842 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
834843 addr, message,
835844 dmi_get_system_info(DMI_BIOS_VENDOR),
836845 dmi_get_system_info(DMI_BIOS_VERSION),
837846 dmi_get_system_info(DMI_PRODUCT_VERSION));
847+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
838848 }
839849
840850 static int __ref
drivers/iommu/intel-iommu-debugfs.c+35−16
@@ -33,38 +33,42 @@ struct iommu_regset { · 32 unmodified lines
3333
3434 #define IOMMU_REGSET_ENTRY(_reg_) \
3535 { DMAR_##_reg_##_REG, __stringify(_reg_) }
36−static const struct iommu_regset iommu_regs[] = {
36+
37+static const struct iommu_regset iommu_regs_32[] = {
3738 IOMMU_REGSET_ENTRY(VER),
38− IOMMU_REGSET_ENTRY(CAP),
39− IOMMU_REGSET_ENTRY(ECAP),
4039 IOMMU_REGSET_ENTRY(GCMD),
4140 IOMMU_REGSET_ENTRY(GSTS),
42− IOMMU_REGSET_ENTRY(RTADDR),
43− IOMMU_REGSET_ENTRY(CCMD),
4441 IOMMU_REGSET_ENTRY(FSTS),
4542 IOMMU_REGSET_ENTRY(FECTL),
4643 IOMMU_REGSET_ENTRY(FEDATA),
4744 IOMMU_REGSET_ENTRY(FEADDR),
4845 IOMMU_REGSET_ENTRY(FEUADDR),
49− IOMMU_REGSET_ENTRY(AFLOG),
5046 IOMMU_REGSET_ENTRY(PMEN),
5147 IOMMU_REGSET_ENTRY(PLMBASE),
5248 IOMMU_REGSET_ENTRY(PLMLIMIT),
49+ IOMMU_REGSET_ENTRY(ICS),
50+ IOMMU_REGSET_ENTRY(PRS),
51+ IOMMU_REGSET_ENTRY(PECTL),
52+ IOMMU_REGSET_ENTRY(PEDATA),
53+ IOMMU_REGSET_ENTRY(PEADDR),
54+ IOMMU_REGSET_ENTRY(PEUADDR),
55+};
56+
57+static const struct iommu_regset iommu_regs_64[] = {
58+ IOMMU_REGSET_ENTRY(CAP),
59+ IOMMU_REGSET_ENTRY(ECAP),
60+ IOMMU_REGSET_ENTRY(RTADDR),
61+ IOMMU_REGSET_ENTRY(CCMD),
62+ IOMMU_REGSET_ENTRY(AFLOG),
5363 IOMMU_REGSET_ENTRY(PHMBASE),
5464 IOMMU_REGSET_ENTRY(PHMLIMIT),
5565 IOMMU_REGSET_ENTRY(IQH),
5666 IOMMU_REGSET_ENTRY(IQT),
5767 IOMMU_REGSET_ENTRY(IQA),
58− IOMMU_REGSET_ENTRY(ICS),
5968 IOMMU_REGSET_ENTRY(IRTA),
6069 IOMMU_REGSET_ENTRY(PQH),
6170 IOMMU_REGSET_ENTRY(PQT),
6271 IOMMU_REGSET_ENTRY(PQA),
63− IOMMU_REGSET_ENTRY(PRS),
64− IOMMU_REGSET_ENTRY(PECTL),
65− IOMMU_REGSET_ENTRY(PEDATA),
66− IOMMU_REGSET_ENTRY(PEADDR),
67− IOMMU_REGSET_ENTRY(PEUADDR),
6872 IOMMU_REGSET_ENTRY(MTRRCAP),
6973 IOMMU_REGSET_ENTRY(MTRRDEF),
7074 IOMMU_REGSET_ENTRY(MTRR_FIX64K_00000),
@@ -127,10 +131,16 @@ static int iommu_regset_show(struct seq_file *m, void *unused) · 56 unmodified lines
127131 * by adding the offset to the pointer (virtual address).
128132 */
129133 raw_spin_lock_irqsave(&iommu->register_lock, flag);
130− for (i = 0 ; i < ARRAY_SIZE(iommu_regs); i++) {
131− value = dmar_readq(iommu->reg + iommu_regs[i].offset);
134+ for (i = 0 ; i < ARRAY_SIZE(iommu_regs_32); i++) {
135+ value = dmar_readl(iommu->reg + iommu_regs_32[i].offset);
136+ seq_printf(m, "%-16s\t0x%02x\t\t0x%016llx\n",
137+ iommu_regs_32[i].regs, iommu_regs_32[i].offset,
138+ value);
139+ }
140+ for (i = 0 ; i < ARRAY_SIZE(iommu_regs_64); i++) {
141+ value = dmar_readq(iommu->reg + iommu_regs_64[i].offset);
132142 seq_printf(m, "%-16s\t0x%02x\t\t0x%016llx\n",
133− iommu_regs[i].regs, iommu_regs[i].offset,
143+ iommu_regs_64[i].regs, iommu_regs_64[i].offset,
134144 value);
135145 }
136146 raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
@@ -272,9 +282,16 @@ static int dmar_translation_struct_show(struct seq_file *m, void *unused) · 135 unmodified lines
272282 {
273283 struct dmar_drhd_unit *drhd;
274284 struct intel_iommu *iommu;
285+ u32 sts;
275286
276287 rcu_read_lock();
277288 for_each_active_iommu(iommu, drhd) {
289+ sts = dmar_readl(iommu->reg + DMAR_GSTS_REG);
290+ if (!(sts & DMA_GSTS_TES)) {
291+ seq_printf(m, "DMA Remapping is not enabled on %s\n",
292+ iommu->name);
293+ continue;
294+ }
278295 root_tbl_walk(m, iommu);
279296 seq_putc(m, '\n');
280297 }
@@ -415,6 +432,7 @@ static int ir_translation_struct_show(struct seq_file *m, void *unused) · 134 unmodified lines
415432 struct dmar_drhd_unit *drhd;
416433 struct intel_iommu *iommu;
417434 u64 irta;
435+ u32 sts;
418436
419437 rcu_read_lock();
420438 for_each_active_iommu(iommu, drhd) {
@@ -424,7 +442,8 @@ static int ir_translation_struct_show(struct seq_file *m, void *unused) · 3 unmodified lines
424442 seq_printf(m, "Remapped Interrupt supported on IOMMU: %s\n",
425443 iommu->name);
426444
427− if (iommu->ir_table) {
445+ sts = dmar_readl(iommu->reg + DMAR_GSTS_REG);
446+ if (iommu->ir_table && (sts & DMA_GSTS_IRES)) {
428447 irta = virt_to_phys(iommu->ir_table->base);
429448 seq_printf(m, " IR table address:%llx\n", irta);
430449 ir_tbl_remap_entry_show(m, iommu);
drivers/iommu/intel-iommu.c+19−9
@@ -4261,10 +4261,11 @@ static void quirk_ioat_snb_local_iommu(struct pci_dev *pdev) · 4260 unmodified lines
42614261
42624262 /* we know that the this iommu should be at offset 0xa000 from vtbar */
42634263 drhd = dmar_find_matched_drhd_unit(pdev);
4264− if (WARN_TAINT_ONCE(!drhd || drhd->reg_base_addr - vtbar != 0xa000,
4265− TAINT_FIRMWARE_WORKAROUND,
4266− "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n"))
4264+ if (!drhd || drhd->reg_base_addr - vtbar != 0xa000) {
4265+ pr_warn_once(FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n");
4266+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
42674267 pdev->dev.archdata.iommu = DUMMY_DEVICE_DOMAIN_INFO;
4268+ }
42684269 }
42694270 DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SNB, quirk_ioat_snb_local_iommu);
42704271
@@ -4460,14 +4461,16 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) · 189 unmodified lines
44604461 struct dmar_rmrr_unit *rmrru;
44614462
44624463 rmrr = (struct acpi_dmar_reserved_memory *)header;
4463− if (rmrr_sanity_check(rmrr))
4464− WARN_TAINT(1, TAINT_FIRMWARE_WORKAROUND,
4464+ if (rmrr_sanity_check(rmrr)) {
4465+ pr_warn(FW_BUG
44654466 "Your BIOS is broken; bad RMRR [%#018Lx-%#018Lx]\n"
44664467 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
44674468 rmrr->base_address, rmrr->end_address,
44684469 dmi_get_system_info(DMI_BIOS_VENDOR),
44694470 dmi_get_system_info(DMI_BIOS_VERSION),
44704471 dmi_get_system_info(DMI_PRODUCT_VERSION));
4472+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
4473+ }
44714474
44724475 rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL);
44734476 if (!rmrru)
@@ -5130,6 +5133,9 @@ int __init intel_iommu_init(void) · 656 unmodified lines
51305133
51315134 down_write(&dmar_global_lock);
51325135
5136+ if (!no_iommu)
5137+ intel_iommu_debugfs_init();
5138+
51335139 if (no_iommu || dmar_disabled) {
51345140 /*
51355141 * We exit the function here to ensure IOMMU's remapping and
@@ -5193,6 +5199,7 @@ int __init intel_iommu_init(void) · 57 unmodified lines
51935199
51945200 init_iommu_pm_ops();
51955201
5202+ down_read(&dmar_global_lock);
51965203 for_each_active_iommu(iommu, drhd) {
51975204 iommu_device_sysfs_add(&iommu->iommu, NULL,
51985205 intel_iommu_groups,
@@ -5200,6 +5207,7 @@ int __init intel_iommu_init(void) · 1 unmodified line
52005207 iommu_device_set_ops(&iommu->iommu, &intel_iommu_ops);
52015208 iommu_device_register(&iommu->iommu);
52025209 }
5210+ up_read(&dmar_global_lock);
52035211
52045212 bus_set_iommu(&pci_bus_type, &intel_iommu_ops);
52055213 if (si_domain && !hw_pass_through)
@@ -5210,7 +5218,6 @@ int __init intel_iommu_init(void) · 4 unmodified lines
52105218 down_read(&dmar_global_lock);
52115219 if (probe_acpi_namespace_devices())
52125220 pr_warn("ACPI name space devices didn't probe correctly\n");
5213− up_read(&dmar_global_lock);
52145221
52155222 /* Finally, we enable the DMA remapping hardware. */
52165223 for_each_iommu(iommu, drhd) {
@@ -5219,10 +5226,11 @@ int __init intel_iommu_init(void) · 2 unmodified lines
52195226
52205227 iommu_disable_protect_mem_regions(iommu);
52215228 }
5229+ up_read(&dmar_global_lock);
5230+
52225231 pr_info("Intel(R) Virtualization Technology for Directed I/O\n");
52235232
52245233 intel_iommu_enabled = 1;
5225− intel_iommu_debugfs_init();
52265234
52275235 return 0;
52285236
@@ -5700,8 +5708,10 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain, · 471 unmodified lines
57005708 u64 phys = 0;
57015709
57025710 pte = pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level);
5703− if (pte)
5704− phys = dma_pte_addr(pte);
5711+ if (pte && dma_pte_present(pte))
5712+ phys = dma_pte_addr(pte) +
5713+ (iova & (BIT_MASK(level_to_offset_bits(level) +
5714+ VTD_PAGE_SHIFT) - 1));
57055715
57065716 return phys;
57075717 }
drivers/iommu/io-pgtable-arm.c+2−2
@@ -468,7 +468,7 @@ static int arm_lpae_map(struct io_pgtable_ops *ops, unsigned long iova, · 467 unmodified lines
468468 arm_lpae_iopte *ptep = data->pgd;
469469 int ret, lvl = data->start_level;
470470 arm_lpae_iopte prot;
471− long iaext = (long)iova >> cfg->ias;
471+ long iaext = (s64)iova >> cfg->ias;
472472
473473 /* If no access, then nothing to do */
474474 if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE)))
@@ -645,7 +645,7 @@ static size_t arm_lpae_unmap(struct io_pgtable_ops *ops, unsigned long iova, · 170 unmodified lines
645645 struct arm_lpae_io_pgtable *data = io_pgtable_ops_to_data(ops);
646646 struct io_pgtable_cfg *cfg = &data->iop.cfg;
647647 arm_lpae_iopte *ptep = data->pgd;
648− long iaext = (long)iova >> cfg->ias;
648+ long iaext = (s64)iova >> cfg->ias;
649649
650650 if (WARN_ON(!size || (size & cfg->pgsize_bitmap) != size))
651651 return 0;
drivers/irqchip/irq-gic-v3.c+29−1
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #define GICD_INT_NMI_PRI (GICD_INT_DEF_PRI & ~0x80)
3535
3636 #define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0)
37+#define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1)
3738
3839 struct redist_region {
3940 void __iomem *redist_base;
@@ -1464,6 +1465,15 @@ static bool gic_enable_quirk_msm8996(void *data) · 1424 unmodified lines
14641465 return true;
14651466 }
14661467
1468+static bool gic_enable_quirk_cavium_38539(void *data)
1469+{
1470+ struct gic_chip_data *d = data;
1471+
1472+ d->flags |= FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539;
1473+
1474+ return true;
1475+}
1476+
14671477 static bool gic_enable_quirk_hip06_07(void *data)
14681478 {
14691479 struct gic_chip_data *d = data;
@@ -1502,6 +1512,19 @@ static const struct gic_quirk gic_quirks[] = { · 32 unmodified lines
15021512 .mask = 0xffffffff,
15031513 .init = gic_enable_quirk_hip06_07,
15041514 },
1515+ {
1516+ /*
1517+ * Reserved register accesses generate a Synchronous
1518+ * External Abort. This erratum applies to:
1519+ * - ThunderX: CN88xx
1520+ * - OCTEON TX: CN83xx, CN81xx
1521+ * - OCTEON TX2: CN93xx, CN96xx, CN98xx, CNF95xx*
1522+ */
1523+ .desc = "GICv3: Cavium erratum 38539",
1524+ .iidr = 0xa000034c,
1525+ .mask = 0xe8f00fff,
1526+ .init = gic_enable_quirk_cavium_38539,
1527+ },
15051528 {
15061529 }
15071530 };
@@ -1577,7 +1600,12 @@ static int __init gic_init_bases(void __iomem *dist_base, · 69 unmodified lines
15771600 pr_info("%d SPIs implemented\n", GIC_LINE_NR - 32);
15781601 pr_info("%d Extended SPIs implemented\n", GIC_ESPI_NR);
15791602
1580− gic_data.rdists.gicd_typer2 = readl_relaxed(gic_data.dist_base + GICD_TYPER2);
1603+ /*
1604+ * ThunderX1 explodes on reading GICD_TYPER2, in violation of the
1605+ * architecture spec (which says that reserved registers are RES0).
1606+ */
1607+ if (!(gic_data.flags & FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539))
1608+ gic_data.rdists.gicd_typer2 = readl_relaxed(gic_data.dist_base + GICD_TYPER2);
15811609
15821610 gic_data.domain = irq_domain_create_tree(handle, &gic_irq_domain_ops,
15831611 &gic_data);
drivers/macintosh/therm_windtunnel.c+31−21
@@ -300,9 +300,11 @@ static int control_loop(void *dummy) · 299 unmodified lines
300300 /* i2c probing and setup */
301301 /************************************************************************/
302302
303−static int
304−do_attach( struct i2c_adapter *adapter )
303+static void do_attach(struct i2c_adapter *adapter)
305304 {
305+ struct i2c_board_info info = { };
306+ struct device_node *np;
307+
306308 /* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
307309 static const unsigned short scan_ds1775[] = {
308310 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
@@ -313,25 +315,24 @@ do_attach( struct i2c_adapter *adapter ) · 4 unmodified lines
313315 I2C_CLIENT_END
314316 };
315317
316− if( strncmp(adapter->name, "uni-n", 5) )
317− return 0;
318−
319− if( !x.running ) {
320− struct i2c_board_info info;
318+ if (x.running || strncmp(adapter->name, "uni-n", 5))
319+ return;
321320
322− memset(&info, 0, sizeof(struct i2c_board_info));
323− strlcpy(info.type, "therm_ds1775", I2C_NAME_SIZE);
321+ np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,ds1775");
322+ if (np) {
323+ of_node_put(np);
324+ } else {
325+ strlcpy(info.type, "MAC,ds1775", I2C_NAME_SIZE);
324326 i2c_new_probed_device(adapter, &info, scan_ds1775, NULL);
327+ }
325328
326− strlcpy(info.type, "therm_adm1030", I2C_NAME_SIZE);
329+ np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,adm1030");
330+ if (np) {
331+ of_node_put(np);
332+ } else {
333+ strlcpy(info.type, "MAC,adm1030", I2C_NAME_SIZE);
327334 i2c_new_probed_device(adapter, &info, scan_adm1030, NULL);
328−
329− if( x.thermostat && x.fan ) {
330− x.running = 1;
331− x.poll_task = kthread_run(control_loop, NULL, "g4fand");
332− }
333335 }
334− return 0;
335336 }
336337
337338 static int
@@ -404,8 +405,8 @@ out: · 66 unmodified lines
404405 enum chip { ds1775, adm1030 };
405406
406407 static const struct i2c_device_id therm_windtunnel_id[] = {
407− { "therm_ds1775", ds1775 },
408− { "therm_adm1030", adm1030 },
408+ { "MAC,ds1775", ds1775 },
409+ { "MAC,adm1030", adm1030 },
409410 { }
410411 };
411412 MODULE_DEVICE_TABLE(i2c, therm_windtunnel_id);
@@ -414,6 +415,7 @@ static int · 2 unmodified lines
414415 do_probe(struct i2c_client *cl, const struct i2c_device_id *id)
415416 {
416417 struct i2c_adapter *adapter = cl->adapter;
418+ int ret = 0;
417419
418420 if( !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA
419421 | I2C_FUNC_SMBUS_WRITE_BYTE) )
@@ -421,11 +423,19 @@ do_probe(struct i2c_client *cl, const struct i2c_device_id *id) · 1 unmodified line
421423
422424 switch (id->driver_data) {
423425 case adm1030:
424− return attach_fan( cl );
426+ ret = attach_fan(cl);
427+ break;
425428 case ds1775:
426− return attach_thermostat(cl);
429+ ret = attach_thermostat(cl);
430+ break;
427431 }
428− return 0;
432+
433+ if (!x.running && x.thermostat && x.fan) {
434+ x.running = 1;
435+ x.poll_task = kthread_run(control_loop, NULL, "g4fand");
436+ }
437+
438+ return ret;
429439 }
430440
431441 static struct i2c_driver g4fan_driver = {
drivers/macintosh/windfarm_ad7417_sensor.c+7−0
@@ -312,9 +312,16 @@ static const struct i2c_device_id wf_ad7417_id[] = { · 311 unmodified lines
312312 };
313313 MODULE_DEVICE_TABLE(i2c, wf_ad7417_id);
314314
315+static const struct of_device_id wf_ad7417_of_id[] = {
316+ { .compatible = "ad7417", },
317+ { }
318+};
319+MODULE_DEVICE_TABLE(of, wf_ad7417_of_id);
320+
315321 static struct i2c_driver wf_ad7417_driver = {
316322 .driver = {
317323 .name = "wf_ad7417",
324+ .of_match_table = wf_ad7417_of_id,
318325 },
319326 .probe = wf_ad7417_probe,
320327 .remove = wf_ad7417_remove,
drivers/macintosh/windfarm_fcu_controls.c+7−0
@@ -580,9 +580,16 @@ static const struct i2c_device_id wf_fcu_id[] = { · 579 unmodified lines
580580 };
581581 MODULE_DEVICE_TABLE(i2c, wf_fcu_id);
582582
583+static const struct of_device_id wf_fcu_of_id[] = {
584+ { .compatible = "fcu", },
585+ { }
586+};
587+MODULE_DEVICE_TABLE(of, wf_fcu_of_id);
588+
583589 static struct i2c_driver wf_fcu_driver = {
584590 .driver = {
585591 .name = "wf_fcu",
592+ .of_match_table = wf_fcu_of_id,
586593 },
587594 .probe = wf_fcu_probe,
588595 .remove = wf_fcu_remove,
drivers/macintosh/windfarm_lm75_sensor.c+15−1
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/init.h>
1515 #include <linux/wait.h>
1616 #include <linux/i2c.h>
17+#include <linux/of_device.h>
1718 #include <asm/prom.h>
1819 #include <asm/machdep.h>
1920 #include <asm/io.h>
@@ -91,9 +92,14 @@ static int wf_lm75_probe(struct i2c_client *client, · 71 unmodified lines
9192 const struct i2c_device_id *id)
9293 {
9394 struct wf_lm75_sensor *lm;
94− int rc, ds1775 = id->driver_data;
95+ int rc, ds1775;
9596 const char *name, *loc;
9697
98+ if (id)
99+ ds1775 = id->driver_data;
100+ else
101+ ds1775 = !!of_device_get_match_data(&client->dev);
102+
97103 DBG("wf_lm75: creating %s device at address 0x%02x\n",
98104 ds1775 ? "ds1775" : "lm75", client->addr);
99105
@@ -164,9 +170,17 @@ static const struct i2c_device_id wf_lm75_id[] = { · 64 unmodified lines
164170 };
165171 MODULE_DEVICE_TABLE(i2c, wf_lm75_id);
166172
173+static const struct of_device_id wf_lm75_of_id[] = {
174+ { .compatible = "lm75", .data = (void *)0},
175+ { .compatible = "ds1775", .data = (void *)1 },
176+ { }
177+};
178+MODULE_DEVICE_TABLE(of, wf_lm75_of_id);
179+
167180 static struct i2c_driver wf_lm75_driver = {
168181 .driver = {
169182 .name = "wf_lm75",
183+ .of_match_table = wf_lm75_of_id,
170184 },
171185 .probe = wf_lm75_probe,
172186 .remove = wf_lm75_remove,
drivers/macintosh/windfarm_lm87_sensor.c+7−0
@@ -166,9 +166,16 @@ static const struct i2c_device_id wf_lm87_id[] = { · 165 unmodified lines
166166 };
167167 MODULE_DEVICE_TABLE(i2c, wf_lm87_id);
168168
169+static const struct of_device_id wf_lm87_of_id[] = {
170+ { .compatible = "lm87cimt", },
171+ { }
172+};
173+MODULE_DEVICE_TABLE(of, wf_lm87_of_id);
174+
169175 static struct i2c_driver wf_lm87_driver = {
170176 .driver = {
171177 .name = "wf_lm87",
178+ .of_match_table = wf_lm87_of_id,
172179 },
173180 .probe = wf_lm87_probe,
174181 .remove = wf_lm87_remove,
drivers/macintosh/windfarm_max6690_sensor.c+7−0
@@ -120,9 +120,16 @@ static const struct i2c_device_id wf_max6690_id[] = { · 119 unmodified lines
120120 };
121121 MODULE_DEVICE_TABLE(i2c, wf_max6690_id);
122122
123+static const struct of_device_id wf_max6690_of_id[] = {
124+ { .compatible = "max6690", },
125+ { }
126+};
127+MODULE_DEVICE_TABLE(of, wf_max6690_of_id);
128+
123129 static struct i2c_driver wf_max6690_driver = {
124130 .driver = {
125131 .name = "wf_max6690",
132+ .of_match_table = wf_max6690_of_id,
126133 },
127134 .probe = wf_max6690_probe,
128135 .remove = wf_max6690_remove,
drivers/macintosh/windfarm_smu_sat.c+7−0
@@ -341,9 +341,16 @@ static const struct i2c_device_id wf_sat_id[] = { · 340 unmodified lines
341341 };
342342 MODULE_DEVICE_TABLE(i2c, wf_sat_id);
343343
344+static const struct of_device_id wf_sat_of_id[] = {
345+ { .compatible = "smu-sat", },
346+ { }
347+};
348+MODULE_DEVICE_TABLE(of, wf_sat_of_id);
349+
344350 static struct i2c_driver wf_sat_driver = {
345351 .driver = {
346352 .name = "wf_smu_sat",
353+ .of_match_table = wf_sat_of_id,
347354 },
348355 .probe = wf_sat_probe,
349356 .remove = wf_sat_remove,
drivers/md/bcache/alloc.c+2−16
@@ -67,7 +67,6 @@ · 66 unmodified lines
6767 #include <linux/blkdev.h>
6868 #include <linux/kthread.h>
6969 #include <linux/random.h>
70−#include <linux/sched/signal.h>
7170 #include <trace/events/bcache.h>
7271
7372 #define MAX_OPEN_BUCKETS 128
@@ -734,21 +733,8 @@ int bch_open_buckets_alloc(struct cache_set *c) · 660 unmodified lines
734733
735734 int bch_cache_allocator_start(struct cache *ca)
736735 {
737− struct task_struct *k;
738−
739− /*
740− * In case previous btree check operation occupies too many
741− * system memory for bcache btree node cache, and the
742− * registering process is selected by OOM killer. Here just
743− * ignore the SIGKILL sent by OOM killer if there is, to
744− * avoid kthread_run() being failed by pending signals. The
745− * bcache registering process will exit after the registration
746− * done.
747− */
748− if (signal_pending(current))
749− flush_signals(current);
750−
751− k = kthread_run(bch_allocator_thread, ca, "bcache_allocator");
736+ struct task_struct *k = kthread_run(bch_allocator_thread,
737+ ca, "bcache_allocator");
752738 if (IS_ERR(k))
753739 return PTR_ERR(k);
754740
drivers/md/bcache/btree.c+0−13
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434 #include <linux/random.h>
3535 #include <linux/rcupdate.h>
3636 #include <linux/sched/clock.h>
37−#include <linux/sched/signal.h>
3837 #include <linux/rculist.h>
3938 #include <linux/delay.h>
4039 #include <trace/events/bcache.h>
@@ -1914,18 +1913,6 @@ static int bch_gc_thread(void *arg) · 1873 unmodified lines
19141913
19151914 int bch_gc_thread_start(struct cache_set *c)
19161915 {
1917− /*
1918− * In case previous btree check operation occupies too many
1919− * system memory for bcache btree node cache, and the
1920− * registering process is selected by OOM killer. Here just
1921− * ignore the SIGKILL sent by OOM killer if there is, to
1922− * avoid kthread_run() being failed by pending signals. The
1923− * bcache registering process will exit after the registration
1924− * done.
1925− */
1926− if (signal_pending(current))
1927− flush_signals(current);
1928−
19291916 c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc");
19301917 return PTR_ERR_OR_ZERO(c->gc_thread);
19311918 }
drivers/md/dm-bio-record.h+15−0
@@ -20,8 +20,13 @@ · 19 unmodified lines
2020 struct dm_bio_details {
2121 struct gendisk *bi_disk;
2222 u8 bi_partno;
23+ int __bi_remaining;
2324 unsigned long bi_flags;
2425 struct bvec_iter bi_iter;
26+ bio_end_io_t *bi_end_io;
27+#if defined(CONFIG_BLK_DEV_INTEGRITY)
28+ struct bio_integrity_payload *bi_integrity;
29+#endif
2530 };
2631
2732 static inline void dm_bio_record(struct dm_bio_details *bd, struct bio *bio)
@@ -30,6 +35,11 @@ static inline void dm_bio_record(struct dm_bio_details *bd, struct bio *bio) · 2 unmodified lines
3035 bd->bi_partno = bio->bi_partno;
3136 bd->bi_flags = bio->bi_flags;
3237 bd->bi_iter = bio->bi_iter;
38+ bd->__bi_remaining = atomic_read(&bio->__bi_remaining);
39+ bd->bi_end_io = bio->bi_end_io;
40+#if defined(CONFIG_BLK_DEV_INTEGRITY)
41+ bd->bi_integrity = bio_integrity(bio);
42+#endif
3343 }
3444
3545 static inline void dm_bio_restore(struct dm_bio_details *bd, struct bio *bio)
@@ -38,6 +48,11 @@ static inline void dm_bio_restore(struct dm_bio_details *bd, struct bio *bio) · 2 unmodified lines
3848 bio->bi_partno = bd->bi_partno;
3949 bio->bi_flags = bd->bi_flags;
4050 bio->bi_iter = bd->bi_iter;
51+ atomic_set(&bio->__bi_remaining, bd->__bi_remaining);
52+ bio->bi_end_io = bd->bi_end_io;
53+#if defined(CONFIG_BLK_DEV_INTEGRITY)
54+ bio->bi_integrity = bd->bi_integrity;
55+#endif
4156 }
4257
4358 #endif
drivers/md/dm-cache-target.c+3−3
@@ -2846,8 +2846,8 @@ static void cache_postsuspend(struct dm_target *ti) · 2845 unmodified lines
28462846 prevent_background_work(cache);
28472847 BUG_ON(atomic_read(&cache->nr_io_migrations));
28482848
2849− cancel_delayed_work(&cache->waker);
2850− flush_workqueue(cache->wq);
2849+ cancel_delayed_work_sync(&cache->waker);
2850+ drain_workqueue(cache->wq);
28512851 WARN_ON(cache->tracker.in_flight);
28522852
28532853 /*
@@ -3492,7 +3492,7 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits) · 638 unmodified lines
34923492
34933493 static struct target_type cache_target = {
34943494 .name = "cache",
3495− .version = {2, 1, 0},
3495+ .version = {2, 2, 0},
34963496 .module = THIS_MODULE,
34973497 .ctr = cache_ctr,
34983498 .dtr = cache_dtr,
drivers/md/dm-integrity.c+43−41
@@ -6,6 +6,8 @@ · 5 unmodified lines
66 * This file is released under the GPL.
77 */
88
9+#include "dm-bio-record.h"
10+
911 #include <linux/compiler.h>
1012 #include <linux/module.h>
1113 #include <linux/device-mapper.h>
@@ -201,17 +203,19 @@ struct dm_integrity_c { · 189 unmodified lines
201203 __u8 log2_blocks_per_bitmap_bit;
202204
203205 unsigned char mode;
204− int suspending;
205206
206207 int failed;
207208
208209 struct crypto_shash *internal_hash;
209210
211+ struct dm_target *ti;
212+
210213 /* these variables are locked with endio_wait.lock */
211214 struct rb_root in_progress;
212215 struct list_head wait_list;
213216 wait_queue_head_t endio_wait;
214217 struct workqueue_struct *wait_wq;
218+ struct workqueue_struct *offload_wq;
215219
216220 unsigned char commit_seq;
217221 commit_id_t commit_ids[N_COMMIT_IDS];
@@ -293,11 +297,7 @@ struct dm_integrity_io { · 75 unmodified lines
293297
294298 struct completion *completion;
295299
296− struct gendisk *orig_bi_disk;
297− u8 orig_bi_partno;
298− bio_end_io_t *orig_bi_end_io;
299− struct bio_integrity_payload *orig_bi_integrity;
300− struct bvec_iter orig_bi_iter;
300+ struct dm_bio_details bio_details;
301301 };
302302
303303 struct journal_completion {
@@ -1439,7 +1439,7 @@ static void dec_in_flight(struct dm_integrity_io *dio) · 1135 unmodified lines
14391439 dio->range.logical_sector += dio->range.n_sectors;
14401440 bio_advance(bio, dio->range.n_sectors << SECTOR_SHIFT);
14411441 INIT_WORK(&dio->work, integrity_bio_wait);
1442− queue_work(ic->wait_wq, &dio->work);
1442+ queue_work(ic->offload_wq, &dio->work);
14431443 return;
14441444 }
14451445 do_endio_flush(ic, dio);
@@ -1450,14 +1450,9 @@ static void integrity_end_io(struct bio *bio) · 4 unmodified lines
14501450 {
14511451 struct dm_integrity_io *dio = dm_per_bio_data(bio, sizeof(struct dm_integrity_io));
14521452
1453− bio->bi_iter = dio->orig_bi_iter;
1454− bio->bi_disk = dio->orig_bi_disk;
1455− bio->bi_partno = dio->orig_bi_partno;
1456− if (dio->orig_bi_integrity) {
1457− bio->bi_integrity = dio->orig_bi_integrity;
1453+ dm_bio_restore(&dio->bio_details, bio);
1454+ if (bio->bi_integrity)
14581455 bio->bi_opf |= REQ_INTEGRITY;
1459− }
1460− bio->bi_end_io = dio->orig_bi_end_io;
14611456
14621457 if (dio->completion)
14631458 complete(dio->completion);
@@ -1542,7 +1537,7 @@ static void integrity_metadata(struct work_struct *w) · 78 unmodified lines
15421537 }
15431538 }
15441539
1545− __bio_for_each_segment(bv, bio, iter, dio->orig_bi_iter) {
1540+ __bio_for_each_segment(bv, bio, iter, dio->bio_details.bi_iter) {
15461541 unsigned pos;
15471542 char *mem, *checksums_ptr;
15481543
@@ -1586,7 +1581,7 @@ again: · 37 unmodified lines
15861581 if (likely(checksums != checksums_onstack))
15871582 kfree(checksums);
15881583 } else {
1589− struct bio_integrity_payload *bip = dio->orig_bi_integrity;
1584+ struct bio_integrity_payload *bip = dio->bio_details.bi_integrity;
15901585
15911586 if (bip) {
15921587 struct bio_vec biv;
@@ -1865,7 +1860,7 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_map · 272 unmodified lines
18651860
18661861 if (need_sync_io && from_map) {
18671862 INIT_WORK(&dio->work, integrity_bio_wait);
1868− queue_work(ic->metadata_wq, &dio->work);
1863+ queue_work(ic->offload_wq, &dio->work);
18691864 return;
18701865 }
18711866
@@ -2005,20 +2000,13 @@ offload_to_thread: · 133 unmodified lines
20052000 } else
20062001 dio->completion = NULL;
20072002
2008− dio->orig_bi_iter = bio->bi_iter;
2009−
2010− dio->orig_bi_disk = bio->bi_disk;
2011− dio->orig_bi_partno = bio->bi_partno;
2003+ dm_bio_record(&dio->bio_details, bio);
20122004 bio_set_dev(bio, ic->dev->bdev);
2013−
2014− dio->orig_bi_integrity = bio_integrity(bio);
20152005 bio->bi_integrity = NULL;
20162006 bio->bi_opf &= ~REQ_INTEGRITY;
2017−
2018− dio->orig_bi_end_io = bio->bi_end_io;
20192007 bio->bi_end_io = integrity_end_io;
2020−
20212008 bio->bi_iter.bi_size = dio->range.n_sectors << SECTOR_SHIFT;
2009+
20222010 generic_make_request(bio);
20232011
20242012 if (need_sync_io) {
@@ -2315,7 +2303,7 @@ static void integrity_writer(struct work_struct *w) · 290 unmodified lines
23152303 unsigned prev_free_sectors;
23162304
23172305 /* the following test is not needed, but it tests the replay code */
2318− if (READ_ONCE(ic->suspending) && !ic->meta_dev)
2306+ if (unlikely(dm_suspended(ic->ti)) && !ic->meta_dev)
23192307 return;
23202308
23212309 spin_lock_irq(&ic->endio_wait.lock);
@@ -2376,7 +2364,7 @@ static void integrity_recalc(struct work_struct *w) · 54 unmodified lines
23762364
23772365 next_chunk:
23782366
2379− if (unlikely(READ_ONCE(ic->suspending)))
2367+ if (unlikely(dm_suspended(ic->ti)))
23802368 goto unlock_ret;
23812369
23822370 range.logical_sector = le64_to_cpu(ic->sb->recalc_sector);
@@ -2501,7 +2489,7 @@ static void bitmap_block_work(struct work_struct *w) · 118 unmodified lines
25012489 dio->range.n_sectors, BITMAP_OP_TEST_ALL_SET)) {
25022490 remove_range(ic, &dio->range);
25032491 INIT_WORK(&dio->work, integrity_bio_wait);
2504− queue_work(ic->wait_wq, &dio->work);
2492+ queue_work(ic->offload_wq, &dio->work);
25052493 } else {
25062494 block_bitmap_op(ic, ic->journal, dio->range.logical_sector,
25072495 dio->range.n_sectors, BITMAP_OP_SET);
@@ -2524,7 +2512,7 @@ static void bitmap_block_work(struct work_struct *w) · 16 unmodified lines
25242512
25252513 remove_range(ic, &dio->range);
25262514 INIT_WORK(&dio->work, integrity_bio_wait);
2527− queue_work(ic->wait_wq, &dio->work);
2515+ queue_work(ic->offload_wq, &dio->work);
25282516 }
25292517
25302518 queue_delayed_work(ic->commit_wq, &ic->bitmap_flush_work, ic->bitmap_flush_interval);
@@ -2804,8 +2792,6 @@ static void dm_integrity_postsuspend(struct dm_target *ti) · 273 unmodified lines
28042792
28052793 del_timer_sync(&ic->autocommit_timer);
28062794
2807− WRITE_ONCE(ic->suspending, 1);
2808−
28092795 if (ic->recalc_wq)
28102796 drain_workqueue(ic->recalc_wq);
28112797
@@ -2834,8 +2820,6 @@ static void dm_integrity_postsuspend(struct dm_target *ti) · 22 unmodified lines
28342820 #endif
28352821 }
28362822
2837− WRITE_ONCE(ic->suspending, 0);
2838−
28392823 BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress));
28402824
28412825 ic->journal_uptodate = true;
@@ -2888,17 +2872,24 @@ static void dm_integrity_resume(struct dm_target *ti) · 46 unmodified lines
28882872 } else {
28892873 replay_journal(ic);
28902874 if (ic->mode == 'B') {
2891− int mode;
28922875 ic->sb->flags |= cpu_to_le32(SB_FLAG_DIRTY_BITMAP);
28932876 ic->sb->log2_blocks_per_bitmap_bit = ic->log2_blocks_per_bitmap_bit;
28942877 r = sync_rw_sb(ic, REQ_OP_WRITE, REQ_FUA);
28952878 if (unlikely(r))
28962879 dm_integrity_io_error(ic, "writing superblock", r);
28972880
2898− mode = ic->recalculate_flag ? BITMAP_OP_SET : BITMAP_OP_CLEAR;
2899− block_bitmap_op(ic, ic->journal, 0, ic->provided_data_sectors, mode);
2900− block_bitmap_op(ic, ic->recalc_bitmap, 0, ic->provided_data_sectors, mode);
2901− block_bitmap_op(ic, ic->may_write_bitmap, 0, ic->provided_data_sectors, mode);
2881+ block_bitmap_op(ic, ic->journal, 0, ic->provided_data_sectors, BITMAP_OP_CLEAR);
2882+ block_bitmap_op(ic, ic->recalc_bitmap, 0, ic->provided_data_sectors, BITMAP_OP_CLEAR);
2883+ block_bitmap_op(ic, ic->may_write_bitmap, 0, ic->provided_data_sectors, BITMAP_OP_CLEAR);
2884+ if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING) &&
2885+ le64_to_cpu(ic->sb->recalc_sector) < ic->provided_data_sectors) {
2886+ block_bitmap_op(ic, ic->journal, le64_to_cpu(ic->sb->recalc_sector),
2887+ ic->provided_data_sectors - le64_to_cpu(ic->sb->recalc_sector), BITMAP_OP_SET);
2888+ block_bitmap_op(ic, ic->recalc_bitmap, le64_to_cpu(ic->sb->recalc_sector),
2889+ ic->provided_data_sectors - le64_to_cpu(ic->sb->recalc_sector), BITMAP_OP_SET);
2890+ block_bitmap_op(ic, ic->may_write_bitmap, le64_to_cpu(ic->sb->recalc_sector),
2891+ ic->provided_data_sectors - le64_to_cpu(ic->sb->recalc_sector), BITMAP_OP_SET);
2892+ }
29022893 rw_journal_sectors(ic, REQ_OP_WRITE, REQ_FUA | REQ_SYNC, 0,
29032894 ic->n_bitmap_blocks * (BITMAP_BLOCK_SIZE >> SECTOR_SHIFT), NULL);
29042895 }
@@ -2967,7 +2958,7 @@ static void dm_integrity_status(struct dm_target *ti, status_type_t type, · 62 unmodified lines
29672958 DMEMIT(" meta_device:%s", ic->meta_dev->name);
29682959 if (ic->sectors_per_block != 1)
29692960 DMEMIT(" block_size:%u", ic->sectors_per_block << SECTOR_SHIFT);
2970− if (ic->recalculate_flag)
2961+ if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING))
29712962 DMEMIT(" recalculate");
29722963 DMEMIT(" journal_sectors:%u", ic->initial_sectors - SB_SECTORS);
29732964 DMEMIT(" interleave_sectors:%u", 1U << ic->sb->log2_interleave_sectors);
@@ -3623,6 +3614,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) · 649 unmodified lines
36233614 }
36243615 ti->private = ic;
36253616 ti->per_io_data_size = sizeof(struct dm_integrity_io);
3617+ ic->ti = ti;
36263618
36273619 ic->in_progress = RB_ROOT;
36283620 INIT_LIST_HEAD(&ic->wait_list);
@@ -3836,6 +3828,14 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) · 207 unmodified lines
38363828 goto bad;
38373829 }
38383830
3831+ ic->offload_wq = alloc_workqueue("dm-integrity-offload", WQ_MEM_RECLAIM,
3832+ METADATA_WORKQUEUE_MAX_ACTIVE);
3833+ if (!ic->offload_wq) {
3834+ ti->error = "Cannot allocate workqueue";
3835+ r = -ENOMEM;
3836+ goto bad;
3837+ }
3838+
38393839 ic->commit_wq = alloc_workqueue("dm-integrity-commit", WQ_MEM_RECLAIM, 1);
38403840 if (!ic->commit_wq) {
38413841 ti->error = "Cannot allocate workqueue";
@@ -4140,6 +4140,8 @@ static void dm_integrity_dtr(struct dm_target *ti) · 298 unmodified lines
41404140 destroy_workqueue(ic->metadata_wq);
41414141 if (ic->wait_wq)
41424142 destroy_workqueue(ic->wait_wq);
4143+ if (ic->offload_wq)
4144+ destroy_workqueue(ic->offload_wq);
41434145 if (ic->commit_wq)
41444146 destroy_workqueue(ic->commit_wq);
41454147 if (ic->writer_wq)
@@ -4200,7 +4202,7 @@ static void dm_integrity_dtr(struct dm_target *ti) · 54 unmodified lines
42004202
42014203 static struct target_type integrity_target = {
42024204 .name = "integrity",
4203− .version = {1, 4, 0},
4205+ .version = {1, 5, 0},
42044206 .module = THIS_MODULE,
42054207 .features = DM_TARGET_SINGLETON | DM_TARGET_INTEGRITY,
42064208 .ctr = dm_integrity_ctr,
drivers/md/dm-mpath.c+1−1
@@ -2053,7 +2053,7 @@ static int multipath_busy(struct dm_target *ti) · 2052 unmodified lines
20532053 *---------------------------------------------------------------*/
20542054 static struct target_type multipath_target = {
20552055 .name = "multipath",
2056− .version = {1, 13, 0},
2056+ .version = {1, 14, 0},
20572057 .features = DM_TARGET_SINGLETON | DM_TARGET_IMMUTABLE |
20582058 DM_TARGET_PASSES_INTEGRITY,
20592059 .module = THIS_MODULE,
drivers/md/dm-thin-metadata.c+1−1
@@ -960,9 +960,9 @@ int dm_pool_metadata_close(struct dm_pool_metadata *pmd) · 959 unmodified lines
960960 DMWARN("%s: __commit_transaction() failed, error = %d",
961961 __func__, r);
962962 }
963+ pmd_write_unlock(pmd);
963964 if (!pmd->fail_io)
964965 __destroy_persistent_data_objects(pmd);
965− pmd_write_unlock(pmd);
966966
967967 kfree(pmd);
968968 return 0;
drivers/md/dm-verity-target.c+1−1
@@ -1221,7 +1221,7 @@ bad: · 1220 unmodified lines
12211221
12221222 static struct target_type verity_target = {
12231223 .name = "verity",
1224− .version = {1, 5, 0},
1224+ .version = {1, 6, 0},
12251225 .module = THIS_MODULE,
12261226 .ctr = verity_ctr,
12271227 .dtr = verity_dtr,
drivers/md/dm-writecache.c+12−4
@@ -625,6 +625,12 @@ static void writecache_add_to_freelist(struct dm_writecache *wc, struct wc_entry · 624 unmodified lines
625625 wc->freelist_size++;
626626 }
627627
628+static inline void writecache_verify_watermark(struct dm_writecache *wc)
629+{
630+ if (unlikely(wc->freelist_size + wc->writeback_size <= wc->freelist_high_watermark))
631+ queue_work(wc->writeback_wq, &wc->writeback_work);
632+}
633+
628634 static struct wc_entry *writecache_pop_from_freelist(struct dm_writecache *wc, sector_t expected_sector)
629635 {
630636 struct wc_entry *e;
@@ -650,8 +656,8 @@ static struct wc_entry *writecache_pop_from_freelist(struct dm_writecache *wc, s · 19 unmodified lines
650656 list_del(&e->lru);
651657 }
652658 wc->freelist_size--;
653− if (unlikely(wc->freelist_size + wc->writeback_size <= wc->freelist_high_watermark))
654− queue_work(wc->writeback_wq, &wc->writeback_work);
659+
660+ writecache_verify_watermark(wc);
655661
656662 return e;
657663 }
@@ -842,7 +848,7 @@ static void writecache_suspend(struct dm_target *ti) · 184 unmodified lines
842848 }
843849 wc_unlock(wc);
844850
845− flush_workqueue(wc->writeback_wq);
851+ drain_workqueue(wc->writeback_wq);
846852
847853 wc_lock(wc);
848854 if (flush_on_suspend)
@@ -965,6 +971,8 @@ erase_this: · 116 unmodified lines
965971 writecache_commit_flushed(wc, false);
966972 }
967973
974+ writecache_verify_watermark(wc);
975+
968976 wc_unlock(wc);
969977 }
970978
@@ -2312,7 +2320,7 @@ static void writecache_status(struct dm_target *ti, status_type_t type, · 1341 unmodified lines
23122320
23132321 static struct target_type writecache_target = {
23142322 .name = "writecache",
2315− .version = {1, 1, 1},
2323+ .version = {1, 2, 0},
23162324 .module = THIS_MODULE,
23172325 .ctr = writecache_ctr,
23182326 .dtr = writecache_dtr,
drivers/md/dm-zoned-target.c+5−5
@@ -533,8 +533,9 @@ static int dmz_queue_chunk_work(struct dmz_target *dmz, struct bio *bio) · 532 unmodified lines
533533
534534 /* Get the BIO chunk work. If one is not active yet, create one */
535535 cw = radix_tree_lookup(&dmz->chunk_rxtree, chunk);
536− if (!cw) {
537−
536+ if (cw) {
537+ dmz_get_chunk_work(cw);
538+ } else {
538539 /* Create a new chunk work */
539540 cw = kmalloc(sizeof(struct dm_chunk_work), GFP_NOIO);
540541 if (unlikely(!cw)) {
@@ -543,7 +544,7 @@ static int dmz_queue_chunk_work(struct dmz_target *dmz, struct bio *bio) · 2 unmodified lines
543544 }
544545
545546 INIT_WORK(&cw->work, dmz_chunk_work);
546− refcount_set(&cw->refcount, 0);
547+ refcount_set(&cw->refcount, 1);
547548 cw->target = dmz;
548549 cw->chunk = chunk;
549550 bio_list_init(&cw->bio_list);
@@ -556,7 +557,6 @@ static int dmz_queue_chunk_work(struct dmz_target *dmz, struct bio *bio) · 6 unmodified lines
556557 }
557558
558559 bio_list_add(&cw->bio_list, bio);
559− dmz_get_chunk_work(cw);
560560
561561 dmz_reclaim_bio_acc(dmz->reclaim);
562562 if (queue_work(dmz->chunk_wq, &cw->work))
@@ -967,7 +967,7 @@ static int dmz_iterate_devices(struct dm_target *ti, · 404 unmodified lines
967967
968968 static struct target_type dmz_type = {
969969 .name = "zoned",
970− .version = {1, 0, 0},
970+ .version = {1, 1, 0},
971971 .features = DM_TARGET_SINGLETON | DM_TARGET_ZONED_HM,
972972 .module = THIS_MODULE,
973973 .ctr = dmz_ctr,
drivers/md/dm.c+11−11
@@ -1788,7 +1788,8 @@ static int dm_any_congested(void *congested_data, int bdi_bits) · 1787 unmodified lines
17881788 * With request-based DM we only need to check the
17891789 * top-level queue for congestion.
17901790 */
1791− r = md->queue->backing_dev_info->wb.state & bdi_bits;
1791+ struct backing_dev_info *bdi = md->queue->backing_dev_info;
1792+ r = bdi->wb.congested->state & bdi_bits;
17921793 } else {
17931794 map = dm_get_live_table_fast(md);
17941795 if (map)
@@ -1854,15 +1855,6 @@ static const struct dax_operations dm_dax_ops; · 59 unmodified lines
18541855
18551856 static void dm_wq_work(struct work_struct *work);
18561857
1857−static void dm_init_normal_md_queue(struct mapped_device *md)
1858−{
1859− /*
1860− * Initialize aspects of queue that aren't relevant for blk-mq
1861− */
1862− md->queue->backing_dev_info->congested_data = md;
1863− md->queue->backing_dev_info->congested_fn = dm_any_congested;
1864−}
1865−
18661858 static void cleanup_mapped_device(struct mapped_device *md)
18671859 {
18681860 if (md->wq)
@@ -2249,6 +2241,12 @@ struct queue_limits *dm_get_queue_limits(struct mapped_device *md) · 380 unmodified lines
22492241 }
22502242 EXPORT_SYMBOL_GPL(dm_get_queue_limits);
22512243
2244+static void dm_init_congested_fn(struct mapped_device *md)
2245+{
2246+ md->queue->backing_dev_info->congested_data = md;
2247+ md->queue->backing_dev_info->congested_fn = dm_any_congested;
2248+}
2249+
22522250 /*
22532251 * Setup the DM device's queue based on md's type
22542252 */
@@ -2265,11 +2263,12 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) · 10 unmodified lines
22652263 DMERR("Cannot initialize queue for request-based dm-mq mapped device");
22662264 return r;
22672265 }
2266+ dm_init_congested_fn(md);
22682267 break;
22692268 case DM_TYPE_BIO_BASED:
22702269 case DM_TYPE_DAX_BIO_BASED:
22712270 case DM_TYPE_NVME_BIO_BASED:
2272− dm_init_normal_md_queue(md);
2271+ dm_init_congested_fn(md);
22732272 break;
22742273 case DM_TYPE_NONE:
22752274 WARN_ON_ONCE(true);
@@ -2368,6 +2367,7 @@ static void __dm_destroy(struct mapped_device *md, bool wait) · 92 unmodified lines
23682367 map = dm_get_live_table(md, &srcu_idx);
23692368 if (!dm_suspended_md(md)) {
23702369 dm_table_presuspend_targets(map);
2370+ set_bit(DMF_SUSPENDED, &md->flags);
23712371 dm_table_postsuspend_targets(map);
23722372 }
23732373 /* dm_put_live_table must be before msleep, otherwise deadlock is possible */
drivers/media/mc/mc-entity.c+2−2
@@ -639,9 +639,9 @@ int media_get_pad_index(struct media_entity *entity, bool is_sink, · 638 unmodified lines
639639 return -EINVAL;
640640
641641 for (i = 0; i < entity->num_pads; i++) {
642− if (entity->pads[i].flags == MEDIA_PAD_FL_SINK)
642+ if (entity->pads[i].flags & MEDIA_PAD_FL_SINK)
643643 pad_is_sink = true;
644− else if (entity->pads[i].flags == MEDIA_PAD_FL_SOURCE)
644+ else if (entity->pads[i].flags & MEDIA_PAD_FL_SOURCE)
645645 pad_is_sink = false;
646646 else
647647 continue; /* This is an error! */
drivers/media/platform/vicodec/codec-v4l2-fwht.c+9−25
@@ -27,17 +27,17 @@ static const struct v4l2_fwht_pixfmt_info v4l2_fwht_pixfmts[] = { · 26 unmodified lines
2727 { V4L2_PIX_FMT_BGR24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
2828 { V4L2_PIX_FMT_RGB24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
2929 { V4L2_PIX_FMT_HSV24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_HSV},
30− { V4L2_PIX_FMT_BGR32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
31− { V4L2_PIX_FMT_XBGR32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
30+ { V4L2_PIX_FMT_BGR32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
31+ { V4L2_PIX_FMT_XBGR32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
3232 { V4L2_PIX_FMT_ABGR32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
33− { V4L2_PIX_FMT_RGB32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
34− { V4L2_PIX_FMT_XRGB32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
33+ { V4L2_PIX_FMT_RGB32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
34+ { V4L2_PIX_FMT_XRGB32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
3535 { V4L2_PIX_FMT_ARGB32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
36− { V4L2_PIX_FMT_BGRX32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
36+ { V4L2_PIX_FMT_BGRX32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
3737 { V4L2_PIX_FMT_BGRA32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
38− { V4L2_PIX_FMT_RGBX32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
38+ { V4L2_PIX_FMT_RGBX32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
3939 { V4L2_PIX_FMT_RGBA32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
40− { V4L2_PIX_FMT_HSV32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_HSV},
40+ { V4L2_PIX_FMT_HSV32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_HSV},
4141 { V4L2_PIX_FMT_GREY, 1, 1, 1, 1, 0, 1, 1, 1, 1, FWHT_FL_PIXENC_RGB},
4242 };
4343
@@ -175,22 +175,14 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf, · 131 unmodified lines
175175 case V4L2_PIX_FMT_RGB32:
176176 case V4L2_PIX_FMT_XRGB32:
177177 case V4L2_PIX_FMT_HSV32:
178− rf->cr = rf->luma + 1;
179− rf->cb = rf->cr + 2;
180− rf->luma += 2;
181− break;
182− case V4L2_PIX_FMT_BGR32:
183− case V4L2_PIX_FMT_XBGR32:
184− rf->cb = rf->luma;
185− rf->cr = rf->cb + 2;
186− rf->luma++;
187− break;
188178 case V4L2_PIX_FMT_ARGB32:
189179 rf->alpha = rf->luma;
190180 rf->cr = rf->luma + 1;
191181 rf->cb = rf->cr + 2;
192182 rf->luma += 2;
193183 break;
184+ case V4L2_PIX_FMT_BGR32:
185+ case V4L2_PIX_FMT_XBGR32:
194186 case V4L2_PIX_FMT_ABGR32:
195187 rf->cb = rf->luma;
196188 rf->cr = rf->cb + 2;
@@ -198,10 +190,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf, · 1 unmodified line
198190 rf->alpha = rf->cr + 1;
199191 break;
200192 case V4L2_PIX_FMT_BGRX32:
201− rf->cb = rf->luma + 1;
202− rf->cr = rf->cb + 2;
203− rf->luma += 2;
204− break;
205193 case V4L2_PIX_FMT_BGRA32:
206194 rf->alpha = rf->luma;
207195 rf->cb = rf->luma + 1;
@@ -209,10 +197,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf, · 1 unmodified line
209197 rf->luma += 2;
210198 break;
211199 case V4L2_PIX_FMT_RGBX32:
212− rf->cr = rf->luma;
213− rf->cb = rf->cr + 2;
214− rf->luma++;
215− break;
216200 case V4L2_PIX_FMT_RGBA32:
217201 rf->alpha = rf->luma + 3;
218202 rf->cr = rf->luma;
drivers/media/usb/pulse8-cec/pulse8-cec.c+7−5
@@ -635,8 +635,6 @@ static void pulse8_cec_adap_free(struct cec_adapter *adap) · 634 unmodified lines
635635 cancel_delayed_work_sync(&pulse8->ping_eeprom_work);
636636 cancel_work_sync(&pulse8->irq_work);
637637 cancel_work_sync(&pulse8->tx_work);
638− serio_close(pulse8->serio);
639− serio_set_drvdata(pulse8->serio, NULL);
640638 kfree(pulse8);
641639 }
642640
@@ -652,6 +650,9 @@ static void pulse8_disconnect(struct serio *serio) · 9 unmodified lines
652650 struct pulse8 *pulse8 = serio_get_drvdata(serio);
653651
654652 cec_unregister_adapter(pulse8->adap);
653+ pulse8->serio = NULL;
654+ serio_set_drvdata(serio, NULL);
655+ serio_close(serio);
655656 }
656657
657658 static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio,
@@ -840,6 +841,8 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv) · 182 unmodified lines
840841 serio_set_drvdata(serio, pulse8);
841842 INIT_WORK(&pulse8->irq_work, pulse8_irq_work_handler);
842843 INIT_WORK(&pulse8->tx_work, pulse8_tx_work_handler);
844+ INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
845+ pulse8_ping_eeprom_work_handler);
843846 mutex_init(&pulse8->lock);
844847 spin_lock_init(&pulse8->msg_lock);
845848 pulse8->config_pending = false;
@@ -865,17 +868,16 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv) · 19 unmodified lines
865868 pulse8->restoring_config = true;
866869 }
867870
868− INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
869− pulse8_ping_eeprom_work_handler);
870871 schedule_delayed_work(&pulse8->ping_eeprom_work, PING_PERIOD);
871872
872873 return 0;
873874
874875 close_serio:
876+ pulse8->serio = NULL;
877+ serio_set_drvdata(serio, NULL);
875878 serio_close(serio);
876879 delete_adap:
877880 cec_delete_adapter(pulse8->adap);
878− serio_set_drvdata(serio, NULL);
879881 free_device:
880882 kfree(pulse8);
881883 return err;
drivers/media/v4l2-core/v4l2-mem2mem.c+2−2
@@ -880,12 +880,12 @@ int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev *m2m_dev, · 879 unmodified lines
880880 goto err_rel_entity1;
881881
882882 /* Connect the three entities */
883− ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 1,
883+ ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 0,
884884 MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
885885 if (ret)
886886 goto err_rel_entity2;
887887
888− ret = media_create_pad_link(&m2m_dev->proc, 0, &m2m_dev->sink, 0,
888+ ret = media_create_pad_link(&m2m_dev->proc, 1, &m2m_dev->sink, 0,
889889 MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
890890 if (ret)
891891 goto err_rm_links0;
drivers/misc/altera-stapl/altera.c+6−6
@@ -2112,8 +2112,8 @@ exit_done: · 2111 unmodified lines
21122112 return status;
21132113 }
21142114
2115−static int altera_get_note(u8 *p, s32 program_size,
2116− s32 *offset, char *key, char *value, int length)
2115+static int altera_get_note(u8 *p, s32 program_size, s32 *offset,
2116+ char *key, char *value, int keylen, int vallen)
21172117 /*
21182118 * Gets key and value of NOTE fields in the JBC file.
21192119 * Can be called in two modes: if offset pointer is NULL,
@@ -2170,7 +2170,7 @@ static int altera_get_note(u8 *p, s32 program_size, · 50 unmodified lines
21702170 &p[note_table + (8 * i) + 4])];
21712171
21722172 if (value != NULL)
2173− strlcpy(value, value_ptr, length);
2173+ strlcpy(value, value_ptr, vallen);
21742174
21752175 }
21762176 }
@@ -2189,13 +2189,13 @@ static int altera_get_note(u8 *p, s32 program_size, · 12 unmodified lines
21892189 strlcpy(key, &p[note_strings +
21902190 get_unaligned_be32(
21912191 &p[note_table + (8 * i)])],
2192− length);
2192+ keylen);
21932193
21942194 if (value != NULL)
21952195 strlcpy(value, &p[note_strings +
21962196 get_unaligned_be32(
21972197 &p[note_table + (8 * i) + 4])],
2198− length);
2198+ vallen);
21992199
22002200 *offset = i + 1;
22012201 }
@@ -2449,7 +2449,7 @@ int altera_init(struct altera_config *config, const struct firmware *fw) · 247 unmodified lines
24492449 __func__, (format_version == 2) ? "Jam STAPL" :
24502450 "pre-standardized Jam 1.1");
24512451 while (altera_get_note((u8 *)fw->data, fw->size,
2452− &offset, key, value, 256) == 0)
2452+ &offset, key, value, 32, 256) == 0)
24532453 printk(KERN_INFO "%s: NOTE \"%s\" = \"%s\"\n",
24542454 __func__, key, value);
24552455 }
drivers/misc/cardreader/rts5227.c+1−1
@@ -394,7 +394,7 @@ static const struct pcr_ops rts522a_pcr_ops = { · 393 unmodified lines
394394 void rts522a_init_params(struct rtsx_pcr *pcr)
395395 {
396396 rts5227_init_params(pcr);
397−
397+ pcr->tx_initial_phase = SET_CLOCK_PHASE(20, 20, 11);
398398 pcr->reg_pm_ctrl3 = RTS522A_PM_CTRL3;
399399
400400 pcr->option.ocp_en = 1;
drivers/misc/cardreader/rts5249.c+2−0
@@ -618,6 +618,7 @@ static const struct pcr_ops rts524a_pcr_ops = { · 617 unmodified lines
618618 void rts524a_init_params(struct rtsx_pcr *pcr)
619619 {
620620 rts5249_init_params(pcr);
621+ pcr->tx_initial_phase = SET_CLOCK_PHASE(27, 29, 11);
621622 pcr->option.ltr_l1off_sspwrgate = LTR_L1OFF_SSPWRGATE_5250_DEF;
622623 pcr->option.ltr_l1off_snooze_sspwrgate =
623624 LTR_L1OFF_SNOOZE_SSPWRGATE_5250_DEF;
@@ -733,6 +734,7 @@ static const struct pcr_ops rts525a_pcr_ops = { · 109 unmodified lines
733734 void rts525a_init_params(struct rtsx_pcr *pcr)
734735 {
735736 rts5249_init_params(pcr);
737+ pcr->tx_initial_phase = SET_CLOCK_PHASE(25, 29, 11);
736738 pcr->option.ltr_l1off_sspwrgate = LTR_L1OFF_SSPWRGATE_5250_DEF;
737739 pcr->option.ltr_l1off_snooze_sspwrgate =
738740 LTR_L1OFF_SNOOZE_SSPWRGATE_5250_DEF;
drivers/misc/cardreader/rts5260.c+1−1
@@ -662,7 +662,7 @@ void rts5260_init_params(struct rtsx_pcr *pcr) · 661 unmodified lines
662662 pcr->sd30_drive_sel_1v8 = CFG_DRIVER_TYPE_B;
663663 pcr->sd30_drive_sel_3v3 = CFG_DRIVER_TYPE_B;
664664 pcr->aspm_en = ASPM_L1_EN;
665− pcr->tx_initial_phase = SET_CLOCK_PHASE(1, 29, 16);
665+ pcr->tx_initial_phase = SET_CLOCK_PHASE(27, 29, 11);
666666 pcr->rx_initial_phase = SET_CLOCK_PHASE(24, 6, 5);
667667
668668 pcr->ic_version = rts5260_get_ic_version(pcr);
drivers/misc/cardreader/rts5261.c+1−1
@@ -764,7 +764,7 @@ void rts5261_init_params(struct rtsx_pcr *pcr) · 763 unmodified lines
764764 pcr->sd30_drive_sel_1v8 = CFG_DRIVER_TYPE_B;
765765 pcr->sd30_drive_sel_3v3 = CFG_DRIVER_TYPE_B;
766766 pcr->aspm_en = ASPM_L1_EN;
767− pcr->tx_initial_phase = SET_CLOCK_PHASE(20, 27, 16);
767+ pcr->tx_initial_phase = SET_CLOCK_PHASE(27, 27, 11);
768768 pcr->rx_initial_phase = SET_CLOCK_PHASE(24, 6, 5);
769769
770770 pcr->ic_version = rts5261_get_ic_version(pcr);
drivers/misc/eeprom/at24.c+2−1
@@ -712,13 +712,14 @@ static int at24_probe(struct i2c_client *client) · 711 unmodified lines
712712 * chip is functional.
713713 */
714714 err = at24_read(at24, 0, &test_byte, 1);
715− pm_runtime_idle(dev);
716715 if (err) {
717716 pm_runtime_disable(dev);
718717 regulator_disable(at24->vcc_reg);
719718 return -ENODEV;
720719 }
721720
721+ pm_runtime_idle(dev);
722+
722723 if (writable)
723724 dev_info(dev, "%u byte %s EEPROM, writable, %u bytes/write\n",
724725 byte_len, client->name, at24->write_max);
drivers/mmc/core/core.c+4−1
@@ -1732,8 +1732,11 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from, · 1731 unmodified lines
17321732 * the erase operation does not exceed the max_busy_timeout, we should
17331733 * use R1B response. Or we need to prevent the host from doing hw busy
17341734 * detection, which is done by converting to a R1 response instead.
1735+ * Note, some hosts requires R1B, which also means they are on their own
1736+ * when it comes to deal with the busy timeout.
17351737 */
1736− if (card->host->max_busy_timeout &&
1738+ if (!(card->host->caps & MMC_CAP_NEED_RSP_BUSY) &&
1739+ card->host->max_busy_timeout &&
17371740 busy_timeout > card->host->max_busy_timeout) {
17381741 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
17391742 } else {
drivers/mmc/core/mmc.c+5−2
@@ -1910,9 +1910,12 @@ static int mmc_sleep(struct mmc_host *host) · 1909 unmodified lines
19101910 * If the max_busy_timeout of the host is specified, validate it against
19111911 * the sleep cmd timeout. A failure means we need to prevent the host
19121912 * from doing hw busy detection, which is done by converting to a R1
1913− * response instead of a R1B.
1913+ * response instead of a R1B. Note, some hosts requires R1B, which also
1914+ * means they are on their own when it comes to deal with the busy
1915+ * timeout.
19141916 */
1915− if (host->max_busy_timeout && (timeout_ms > host->max_busy_timeout)) {
1917+ if (!(host->caps & MMC_CAP_NEED_RSP_BUSY) && host->max_busy_timeout &&
1918+ (timeout_ms > host->max_busy_timeout)) {
19161919 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
19171920 } else {
19181921 cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
drivers/mmc/core/mmc_ops.c+4−2
@@ -542,9 +542,11 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, · 541 unmodified lines
542542 * If the max_busy_timeout of the host is specified, make sure it's
543543 * enough to fit the used timeout_ms. In case it's not, let's instruct
544544 * the host to avoid HW busy detection, by converting to a R1 response
545− * instead of a R1B.
545+ * instead of a R1B. Note, some hosts requires R1B, which also means
546+ * they are on their own when it comes to deal with the busy timeout.
546547 */
547− if (host->max_busy_timeout && (timeout_ms > host->max_busy_timeout))
548+ if (!(host->caps & MMC_CAP_NEED_RSP_BUSY) && host->max_busy_timeout &&
549+ (timeout_ms > host->max_busy_timeout))
548550 use_r1b_resp = false;
549551
550552 cmd.opcode = MMC_SWITCH;
drivers/mmc/host/rtsx_pci_sdmmc.c+8−5
@@ -606,19 +606,22 @@ static int sd_change_phase(struct realtek_pci_sdmmc *host, · 605 unmodified lines
606606 u8 sample_point, bool rx)
607607 {
608608 struct rtsx_pcr *pcr = host->pcr;
609−
609+ u16 SD_VP_CTL = 0;
610610 dev_dbg(sdmmc_dev(host), "%s(%s): sample_point = %d\n",
611611 __func__, rx ? "RX" : "TX", sample_point);
612612
613613 rtsx_pci_write_register(pcr, CLK_CTL, CHANGE_CLK, CHANGE_CLK);
614− if (rx)
614+ if (rx) {
615+ SD_VP_CTL = SD_VPRX_CTL;
615616 rtsx_pci_write_register(pcr, SD_VPRX_CTL,
616617 PHASE_SELECT_MASK, sample_point);
617− else
618+ } else {
619+ SD_VP_CTL = SD_VPTX_CTL;
618620 rtsx_pci_write_register(pcr, SD_VPTX_CTL,
619621 PHASE_SELECT_MASK, sample_point);
620− rtsx_pci_write_register(pcr, SD_VPCLK0_CTL, PHASE_NOT_RESET, 0);
621− rtsx_pci_write_register(pcr, SD_VPCLK0_CTL, PHASE_NOT_RESET,
622+ }
623+ rtsx_pci_write_register(pcr, SD_VP_CTL, PHASE_NOT_RESET, 0);
624+ rtsx_pci_write_register(pcr, SD_VP_CTL, PHASE_NOT_RESET,
622625 PHASE_NOT_RESET);
623626 rtsx_pci_write_register(pcr, CLK_CTL, CHANGE_CLK, 0);
624627 rtsx_pci_write_register(pcr, SD_CFG1, SD_ASYNC_FIFO_NOT_RST, 0);
drivers/mmc/host/sdhci-acpi.c+82−2
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/pm.h>
2424 #include <linux/pm_runtime.h>
2525 #include <linux/delay.h>
26+#include <linux/dmi.h>
2627
2728 #include <linux/mmc/host.h>
2829 #include <linux/mmc/pm.h>
@@ -72,9 +73,16 @@ struct sdhci_acpi_host { · 43 unmodified lines
7273 const struct sdhci_acpi_slot *slot;
7374 struct platform_device *pdev;
7475 bool use_runtime_pm;
76+ bool is_intel;
77+ bool reset_signal_volt_on_suspend;
7578 unsigned long private[0] ____cacheline_aligned;
7679 };
7780
81+enum {
82+ DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP = BIT(0),
83+ DMI_QUIRK_SD_NO_WRITE_PROTECT = BIT(1),
84+};
85+
7886 static inline void *sdhci_acpi_priv(struct sdhci_acpi_host *c)
7987 {
8088 return (void *)c->private;
@@ -391,6 +399,8 @@ static int intel_probe_slot(struct platform_device *pdev, struct acpi_device *ad · 310 unmodified lines
391399 host->mmc_host_ops.start_signal_voltage_switch =
392400 intel_start_signal_voltage_switch;
393401
402+ c->is_intel = true;
403+
394404 return 0;
395405 }
396406
@@ -647,6 +657,36 @@ static const struct acpi_device_id sdhci_acpi_ids[] = { · 250 unmodified lines
647657 };
648658 MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);
649659
660+static const struct dmi_system_id sdhci_acpi_quirks[] = {
661+ {
662+ /*
663+ * The Lenovo Miix 320-10ICR has a bug in the _PS0 method of
664+ * the SHC1 ACPI device, this bug causes it to reprogram the
665+ * wrong LDO (DLDO3) to 1.8V if 1.8V modes are used and the
666+ * card is (runtime) suspended + resumed. DLDO3 is used for
667+ * the LCD and setting it to 1.8V causes the LCD to go black.
668+ */
669+ .matches = {
670+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
671+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
672+ },
673+ .driver_data = (void *)DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP,
674+ },
675+ {
676+ /*
677+ * The Acer Aspire Switch 10 (SW5-012) microSD slot always
678+ * reports the card being write-protected even though microSD
679+ * cards do not have a write-protect switch at all.
680+ */
681+ .matches = {
682+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
683+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"),
684+ },
685+ .driver_data = (void *)DMI_QUIRK_SD_NO_WRITE_PROTECT,
686+ },
687+ {} /* Terminating entry */
688+};
689+
650690 static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(struct acpi_device *adev)
651691 {
652692 const struct sdhci_acpi_uid_slot *u;
@@ -663,17 +703,23 @@ static int sdhci_acpi_probe(struct platform_device *pdev) · 10 unmodified lines
663703 struct device *dev = &pdev->dev;
664704 const struct sdhci_acpi_slot *slot;
665705 struct acpi_device *device, *child;
706+ const struct dmi_system_id *id;
666707 struct sdhci_acpi_host *c;
667708 struct sdhci_host *host;
668709 struct resource *iomem;
669710 resource_size_t len;
670711 size_t priv_size;
712+ int quirks = 0;
671713 int err;
672714
673715 device = ACPI_COMPANION(dev);
674716 if (!device)
675717 return -ENODEV;
676718
719+ id = dmi_first_match(sdhci_acpi_quirks);
720+ if (id)
721+ quirks = (long)id->driver_data;
722+
677723 slot = sdhci_acpi_get_slot(device);
678724
679725 /* Power on the SDHCI controller and its children */
@@ -759,6 +805,12 @@ static int sdhci_acpi_probe(struct platform_device *pdev) · 79 unmodified lines
759805 dev_warn(dev, "failed to setup card detect gpio\n");
760806 c->use_runtime_pm = false;
761807 }
808+
809+ if (quirks & DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP)
810+ c->reset_signal_volt_on_suspend = true;
811+
812+ if (quirks & DMI_QUIRK_SD_NO_WRITE_PROTECT)
813+ host->mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
762814 }
763815
764816 err = sdhci_setup_host(host);
@@ -823,17 +875,39 @@ static int sdhci_acpi_remove(struct platform_device *pdev) · 58 unmodified lines
823875 return 0;
824876 }
825877
878+static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
879+ struct device *dev)
880+{
881+ struct sdhci_acpi_host *c = dev_get_drvdata(dev);
882+ struct sdhci_host *host = c->host;
883+
884+ if (c->is_intel && c->reset_signal_volt_on_suspend &&
885+ host->mmc->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_330) {
886+ struct intel_host *intel_host = sdhci_acpi_priv(c);
887+ unsigned int fn = INTEL_DSM_V33_SWITCH;
888+ u32 result = 0;
889+
890+ intel_dsm(intel_host, dev, fn, &result);
891+ }
892+}
893+
826894 #ifdef CONFIG_PM_SLEEP
827895
828896 static int sdhci_acpi_suspend(struct device *dev)
829897 {
830898 struct sdhci_acpi_host *c = dev_get_drvdata(dev);
831899 struct sdhci_host *host = c->host;
900+ int ret;
832901
833902 if (host->tuning_mode != SDHCI_TUNING_MODE_3)
834903 mmc_retune_needed(host->mmc);
835904
836− return sdhci_suspend_host(host);
905+ ret = sdhci_suspend_host(host);
906+ if (ret)
907+ return ret;
908+
909+ sdhci_acpi_reset_signal_voltage_if_needed(dev);
910+ return 0;
837911 }
838912
839913 static int sdhci_acpi_resume(struct device *dev)
@@ -853,11 +927,17 @@ static int sdhci_acpi_runtime_suspend(struct device *dev) · 13 unmodified lines
853927 {
854928 struct sdhci_acpi_host *c = dev_get_drvdata(dev);
855929 struct sdhci_host *host = c->host;
930+ int ret;
856931
857932 if (host->tuning_mode != SDHCI_TUNING_MODE_3)
858933 mmc_retune_needed(host->mmc);
859934
860− return sdhci_runtime_suspend_host(host);
935+ ret = sdhci_runtime_suspend_host(host);
936+ if (ret)
937+ return ret;
938+
939+ sdhci_acpi_reset_signal_voltage_if_needed(dev);
940+ return 0;
861941 }
862942
863943 static int sdhci_acpi_runtime_resume(struct device *dev)
drivers/mmc/host/sdhci-cadence.c+16−2
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/mmc/host.h>
1212 #include <linux/mmc/mmc.h>
1313 #include <linux/of.h>
14+#include <linux/of_device.h>
1415
1516 #include "sdhci-pltfm.h"
1617
@@ -235,6 +236,11 @@ static const struct sdhci_ops sdhci_cdns_ops = { · 218 unmodified lines
235236 .set_uhs_signaling = sdhci_cdns_set_uhs_signaling,
236237 };
237238
239+static const struct sdhci_pltfm_data sdhci_cdns_uniphier_pltfm_data = {
240+ .ops = &sdhci_cdns_ops,
241+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
242+};
243+
238244 static const struct sdhci_pltfm_data sdhci_cdns_pltfm_data = {
239245 .ops = &sdhci_cdns_ops,
240246 };
@@ -334,6 +340,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc, · 93 unmodified lines
334340 static int sdhci_cdns_probe(struct platform_device *pdev)
335341 {
336342 struct sdhci_host *host;
343+ const struct sdhci_pltfm_data *data;
337344 struct sdhci_pltfm_host *pltfm_host;
338345 struct sdhci_cdns_priv *priv;
339346 struct clk *clk;
@@ -350,8 +357,12 @@ static int sdhci_cdns_probe(struct platform_device *pdev) · 10 unmodified lines
350357 if (ret)
351358 return ret;
352359
360+ data = of_device_get_match_data(dev);
361+ if (!data)
362+ data = &sdhci_cdns_pltfm_data;
363+
353364 nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node);
354− host = sdhci_pltfm_init(pdev, &sdhci_cdns_pltfm_data,
365+ host = sdhci_pltfm_init(pdev, data,
355366 struct_size(priv, phy_params, nr_phy_params));
356367 if (IS_ERR(host)) {
357368 ret = PTR_ERR(host);
@@ -431,7 +442,10 @@ static const struct dev_pm_ops sdhci_cdns_pm_ops = { · 73 unmodified lines
431442 };
432443
433444 static const struct of_device_id sdhci_cdns_match[] = {
434− { .compatible = "socionext,uniphier-sd4hc" },
445+ {
446+ .compatible = "socionext,uniphier-sd4hc",
447+ .data = &sdhci_cdns_uniphier_pltfm_data,
448+ },
435449 { .compatible = "cdns,sd4hc" },
436450 { /* sentinel */ }
437451 };
drivers/mmc/host/sdhci-msm.c+1−1
@@ -1590,7 +1590,7 @@ static u32 sdhci_msm_cqe_irq(struct sdhci_host *host, u32 intmask) · 1589 unmodified lines
15901590 return 0;
15911591 }
15921592
1593−void sdhci_msm_cqe_disable(struct mmc_host *mmc, bool recovery)
1593+static void sdhci_msm_cqe_disable(struct mmc_host *mmc, bool recovery)
15941594 {
15951595 struct sdhci_host *host = mmc_priv(mmc);
15961596 unsigned long flags;
drivers/mmc/host/sdhci-of-at91.c+6−2
@@ -132,7 +132,8 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask) · 131 unmodified lines
132132
133133 sdhci_reset(host, mask);
134134
135− if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
135+ if ((host->mmc->caps & MMC_CAP_NONREMOVABLE)
136+ || mmc_gpio_get_cd(host->mmc) >= 0)
136137 sdhci_at91_set_force_card_detect(host);
137138
138139 if (priv->cal_always_on && (mask & SDHCI_RESET_ALL))
@@ -427,8 +428,11 @@ static int sdhci_at91_probe(struct platform_device *pdev) · 288 unmodified lines
427428 * detection procedure using the SDMCC_CD signal is bypassed.
428429 * This bit is reset when a software reset for all command is performed
429430 * so we need to implement our own reset function to set back this bit.
431+ *
432+ * WA: SAMA5D2 doesn't drive CMD if using CD GPIO line.
430433 */
431− if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
434+ if ((host->mmc->caps & MMC_CAP_NONREMOVABLE)
435+ || mmc_gpio_get_cd(host->mmc) >= 0)
432436 sdhci_at91_set_force_card_detect(host);
433437
434438 pm_runtime_put_autosuspend(&pdev->dev);
drivers/mmc/host/sdhci-omap.c+3−0
@@ -1192,6 +1192,9 @@ static int sdhci_omap_probe(struct platform_device *pdev) · 1191 unmodified lines
11921192 if (of_find_property(dev->of_node, "dmas", NULL))
11931193 sdhci_switch_external_dma(host, true);
11941194
1195+ /* R1B responses is required to properly manage HW busy detection. */
1196+ mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
1197+
11951198 ret = sdhci_setup_host(host);
11961199 if (ret)
11971200 goto err_put_sync;
drivers/mmc/host/sdhci-pci-gli.c+17−0
@@ -262,10 +262,26 @@ static int gl9750_execute_tuning(struct sdhci_host *host, u32 opcode) · 261 unmodified lines
262262 return 0;
263263 }
264264
265+static void gli_pcie_enable_msi(struct sdhci_pci_slot *slot)
266+{
267+ int ret;
268+
269+ ret = pci_alloc_irq_vectors(slot->chip->pdev, 1, 1,
270+ PCI_IRQ_MSI | PCI_IRQ_MSIX);
271+ if (ret < 0) {
272+ pr_warn("%s: enable PCI MSI failed, error=%d\n",
273+ mmc_hostname(slot->host->mmc), ret);
274+ return;
275+ }
276+
277+ slot->host->irq = pci_irq_vector(slot->chip->pdev, 0);
278+}
279+
265280 static int gli_probe_slot_gl9750(struct sdhci_pci_slot *slot)
266281 {
267282 struct sdhci_host *host = slot->host;
268283
284+ gli_pcie_enable_msi(slot);
269285 slot->host->mmc->caps2 |= MMC_CAP2_NO_SDIO;
270286 sdhci_enable_v4_mode(host);
271287
@@ -276,6 +292,7 @@ static int gli_probe_slot_gl9755(struct sdhci_pci_slot *slot) · 4 unmodified lines
276292 {
277293 struct sdhci_host *host = slot->host;
278294
295+ gli_pcie_enable_msi(slot);
279296 slot->host->mmc->caps2 |= MMC_CAP2_NO_SDIO;
280297 sdhci_enable_v4_mode(host);
281298
drivers/mmc/host/sdhci-tegra.c+3−0
@@ -1552,6 +1552,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev) · 1551 unmodified lines
15521552 if (tegra_host->soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
15531553 host->mmc->caps |= MMC_CAP_1_8V_DDR;
15541554
1555+ /* R1B responses is required to properly manage HW busy detection. */
1556+ host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
1557+
15551558 tegra_sdhci_parse_dt(host);
15561559
15571560 tegra_host->power_gpio = devm_gpiod_get_optional(&pdev->dev, "power",
drivers/net/bonding/bond_alb.c+10−10
@@ -50,11 +50,6 @@ struct arp_pkt { · 49 unmodified lines
5050 };
5151 #pragma pack()
5252
53−static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb)
54−{
55− return (struct arp_pkt *)skb_network_header(skb);
56−}
57−
5853 /* Forward declaration */
5954 static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[],
6055 bool strict_match);
@@ -553,10 +548,11 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) · 492 unmodified lines
553548 spin_unlock(&bond->mode_lock);
554549 }
555550
556−static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bond)
551+static struct slave *rlb_choose_channel(struct sk_buff *skb,
552+ struct bonding *bond,
553+ const struct arp_pkt *arp)
557554 {
558555 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
559− struct arp_pkt *arp = arp_pkt(skb);
560556 struct slave *assigned_slave, *curr_active_slave;
561557 struct rlb_client_info *client_info;
562558 u32 hash_index = 0;
@@ -653,8 +649,12 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 90 unmodified lines
653649 */
654650 static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
655651 {
656− struct arp_pkt *arp = arp_pkt(skb);
657652 struct slave *tx_slave = NULL;
653+ struct arp_pkt *arp;
654+
655+ if (!pskb_network_may_pull(skb, sizeof(*arp)))
656+ return NULL;
657+ arp = (struct arp_pkt *)skb_network_header(skb);
658658
659659 /* Don't modify or load balance ARPs that do not originate locally
660660 * (e.g.,arrive via a bridge).
@@ -664,7 +664,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) · 3 unmodified lines
664664
665665 if (arp->op_code == htons(ARPOP_REPLY)) {
666666 /* the arp must be sent on the selected rx channel */
667− tx_slave = rlb_choose_channel(skb, bond);
667+ tx_slave = rlb_choose_channel(skb, bond, arp);
668668 if (tx_slave)
669669 bond_hw_addr_copy(arp->mac_src, tx_slave->dev->dev_addr,
670670 tx_slave->dev->addr_len);
@@ -676,7 +676,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) · 5 unmodified lines
676676 * When the arp reply is received the entry will be updated
677677 * with the correct unicast address of the client.
678678 */
679− tx_slave = rlb_choose_channel(skb, bond);
679+ tx_slave = rlb_choose_channel(skb, bond, arp);
680680
681681 /* The ARP reply packets must be delayed so that
682682 * they can cancel out the influence of the ARP request.
drivers/net/can/dev.c+1−0
@@ -883,6 +883,7 @@ static const struct nla_policy can_policy[IFLA_CAN_MAX + 1] = { · 882 unmodified lines
883883 = { .len = sizeof(struct can_bittiming) },
884884 [IFLA_CAN_DATA_BITTIMING_CONST]
885885 = { .len = sizeof(struct can_bittiming_const) },
886+ [IFLA_CAN_TERMINATION] = { .type = NLA_U16 },
886887 };
887888
888889 static int can_validate(struct nlattr *tb[], struct nlattr *data[],
drivers/net/dsa/bcm_sf2.c+1−2
@@ -69,8 +69,7 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) · 68 unmodified lines
6969 /* Force link status for IMP port */
7070 reg = core_readl(priv, offset);
7171 reg |= (MII_SW_OR | LINK_STS);
72− if (priv->type == BCM7278_DEVICE_ID)
73− reg |= GMII_SPEED_UP_2G;
72+ reg &= ~GMII_SPEED_UP_2G;
7473 core_writel(priv, reg, offset);
7574
7675 /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
drivers/net/dsa/mv88e6xxx/chip.c+2−0
@@ -2769,6 +2769,8 @@ static u64 mv88e6xxx_devlink_atu_bin_get(struct mv88e6xxx_chip *chip, · 2768 unmodified lines
27692769 goto unlock;
27702770 }
27712771
2772+ occupancy &= MV88E6XXX_G2_ATU_STATS_MASK;
2773+
27722774 unlock:
27732775 mv88e6xxx_reg_unlock(chip);
27742776
drivers/net/dsa/mv88e6xxx/global1.c+2−2
@@ -278,13 +278,13 @@ int mv88e6095_g1_set_egress_port(struct mv88e6xxx_chip *chip, · 277 unmodified lines
278278 switch (direction) {
279279 case MV88E6XXX_EGRESS_DIR_INGRESS:
280280 dest_port_chip = &chip->ingress_dest_port;
281− reg &= MV88E6185_G1_MONITOR_CTL_INGRESS_DEST_MASK;
281+ reg &= ~MV88E6185_G1_MONITOR_CTL_INGRESS_DEST_MASK;
282282 reg |= port <<
283283 __bf_shf(MV88E6185_G1_MONITOR_CTL_INGRESS_DEST_MASK);
284284 break;
285285 case MV88E6XXX_EGRESS_DIR_EGRESS:
286286 dest_port_chip = &chip->egress_dest_port;
287− reg &= MV88E6185_G1_MONITOR_CTL_EGRESS_DEST_MASK;
287+ reg &= ~MV88E6185_G1_MONITOR_CTL_EGRESS_DEST_MASK;
288288 reg |= port <<
289289 __bf_shf(MV88E6185_G1_MONITOR_CTL_EGRESS_DEST_MASK);
290290 break;
drivers/net/dsa/mv88e6xxx/global2.c+7−1
@@ -1099,6 +1099,13 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip) · 1098 unmodified lines
10991099 {
11001100 int err, irq, virq;
11011101
1102+ chip->g2_irq.masked = ~0;
1103+ mv88e6xxx_reg_lock(chip);
1104+ err = mv88e6xxx_g2_int_mask(chip, ~chip->g2_irq.masked);
1105+ mv88e6xxx_reg_unlock(chip);
1106+ if (err)
1107+ return err;
1108+
11021109 chip->g2_irq.domain = irq_domain_add_simple(
11031110 chip->dev->of_node, 16, 0, &mv88e6xxx_g2_irq_domain_ops, chip);
11041111 if (!chip->g2_irq.domain)
@@ -1108,7 +1115,6 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip) · 3 unmodified lines
11081115 irq_create_mapping(chip->g2_irq.domain, irq);
11091116
11101117 chip->g2_irq.chip = mv88e6xxx_g2_irq_chip;
1111− chip->g2_irq.masked = ~0;
11121118
11131119 chip->device_irq = irq_find_mapping(chip->g1_irq.domain,
11141120 MV88E6XXX_G1_STS_IRQ_DEVICE);
drivers/net/dsa/sja1105/sja1105_main.c+2−1
@@ -1741,7 +1741,8 @@ static void sja1105_teardown(struct dsa_switch *ds) · 1740 unmodified lines
17411741 if (!dsa_is_user_port(ds, port))
17421742 continue;
17431743
1744− kthread_destroy_worker(sp->xmit_worker);
1744+ if (sp->xmit_worker)
1745+ kthread_destroy_worker(sp->xmit_worker);
17451746 }
17461747
17471748 sja1105_tas_teardown(ds);
drivers/net/ethernet/broadcom/bcmsysport.c+1−1
@@ -2135,7 +2135,7 @@ static int bcm_sysport_rule_set(struct bcm_sysport_priv *priv, · 2134 unmodified lines
21352135 return -ENOSPC;
21362136
21372137 index = find_first_zero_bit(priv->filters, RXCHK_BRCM_TAG_MAX);
2138− if (index > RXCHK_BRCM_TAG_MAX)
2138+ if (index >= RXCHK_BRCM_TAG_MAX)
21392139 return -ENOSPC;
21402140
21412141 /* Location is the classification ID, and index is the position
drivers/net/ethernet/broadcom/bnxt/bnxt.c+4−4
@@ -10982,13 +10982,13 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu) · 10981 unmodified lines
1098210982 struct bnxt *bp = netdev_priv(dev);
1098310983
1098410984 if (netif_running(dev))
10985− bnxt_close_nic(bp, false, false);
10985+ bnxt_close_nic(bp, true, false);
1098610986
1098710987 dev->mtu = new_mtu;
1098810988 bnxt_set_ring_params(bp);
1098910989
1099010990 if (netif_running(dev))
10991− return bnxt_open_nic(bp, false, false);
10991+ return bnxt_open_nic(bp, true, false);
1099210992
1099310993 return 0;
1099410994 }
@@ -11252,7 +11252,7 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp) · 257 unmodified lines
1125211252 }
1125311253 }
1125411254 if (test_and_clear_bit(BNXT_HWRM_PF_UNLOAD_SP_EVENT, &bp->sp_event))
11255− netdev_info(bp->dev, "Receive PF driver unload event!");
11255+ netdev_info(bp->dev, "Receive PF driver unload event!\n");
1125611256 }
1125711257
1125811258 #else
@@ -11759,7 +11759,7 @@ static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[]) · 500 unmodified lines
1175911759 u32 dw;
1176011760
1176111761 if (!pos) {
11762− netdev_info(bp->dev, "Unable do read adapter's DSN");
11762+ netdev_info(bp->dev, "Unable do read adapter's DSN\n");
1176311763 return -EOPNOTSUPP;
1176411764 }
1176511765
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c+5−5
@@ -641,14 +641,14 @@ static int bnxt_dl_params_register(struct bnxt *bp) · 640 unmodified lines
641641 rc = devlink_params_register(bp->dl, bnxt_dl_params,
642642 ARRAY_SIZE(bnxt_dl_params));
643643 if (rc) {
644− netdev_warn(bp->dev, "devlink_params_register failed. rc=%d",
644+ netdev_warn(bp->dev, "devlink_params_register failed. rc=%d\n",
645645 rc);
646646 return rc;
647647 }
648648 rc = devlink_port_params_register(&bp->dl_port, bnxt_dl_port_params,
649649 ARRAY_SIZE(bnxt_dl_port_params));
650650 if (rc) {
651− netdev_err(bp->dev, "devlink_port_params_register failed");
651+ netdev_err(bp->dev, "devlink_port_params_register failed\n");
652652 devlink_params_unregister(bp->dl, bnxt_dl_params,
653653 ARRAY_SIZE(bnxt_dl_params));
654654 return rc;
@@ -679,7 +679,7 @@ int bnxt_dl_register(struct bnxt *bp) · 24 unmodified lines
679679 else
680680 dl = devlink_alloc(&bnxt_vf_dl_ops, sizeof(struct bnxt_dl));
681681 if (!dl) {
682− netdev_warn(bp->dev, "devlink_alloc failed");
682+ netdev_warn(bp->dev, "devlink_alloc failed\n");
683683 return -ENOMEM;
684684 }
685685
@@ -692,7 +692,7 @@ int bnxt_dl_register(struct bnxt *bp) · 6 unmodified lines
692692
693693 rc = devlink_register(dl, &bp->pdev->dev);
694694 if (rc) {
695− netdev_warn(bp->dev, "devlink_register failed. rc=%d", rc);
695+ netdev_warn(bp->dev, "devlink_register failed. rc=%d\n", rc);
696696 goto err_dl_free;
697697 }
698698
@@ -704,7 +704,7 @@ int bnxt_dl_register(struct bnxt *bp) · 5 unmodified lines
704704 sizeof(bp->dsn));
705705 rc = devlink_port_register(dl, &bp->dl_port, bp->pf.port_id);
706706 if (rc) {
707− netdev_err(bp->dev, "devlink_port_register failed");
707+ netdev_err(bp->dev, "devlink_port_register failed\n");
708708 goto err_dl_unreg;
709709 }
710710
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+13−15
@@ -2007,8 +2007,8 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename, · 2006 unmodified lines
20072007 struct hwrm_nvm_install_update_output *resp = bp->hwrm_cmd_resp_addr;
20082008 struct hwrm_nvm_install_update_input install = {0};
20092009 const struct firmware *fw;
2010− int rc, hwrm_err = 0;
20112010 u32 item_len;
2011+ int rc = 0;
20122012 u16 index;
20132013
20142014 bnxt_hwrm_fw_set_time(bp);
@@ -2028,7 +2028,7 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename, · 13 unmodified lines
20282028 }
20292029
20302030 if (fw->size > item_len) {
2031− netdev_err(dev, "PKG insufficient update area in nvram: %lu",
2031+ netdev_err(dev, "PKG insufficient update area in nvram: %lu\n",
20322032 (unsigned long)fw->size);
20332033 rc = -EFBIG;
20342034 } else {
@@ -2052,15 +2052,14 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename, · 17 unmodified lines
20522052 memcpy(kmem, fw->data, fw->size);
20532053 modify.host_src_addr = cpu_to_le64(dma_handle);
20542054
2055− hwrm_err = hwrm_send_message(bp, &modify,
2056− sizeof(modify),
2057− FLASH_PACKAGE_TIMEOUT);
2055+ rc = hwrm_send_message(bp, &modify, sizeof(modify),
2056+ FLASH_PACKAGE_TIMEOUT);
20582057 dma_free_coherent(&bp->pdev->dev, fw->size, kmem,
20592058 dma_handle);
20602059 }
20612060 }
20622061 release_firmware(fw);
2063− if (rc || hwrm_err)
2062+ if (rc)
20642063 goto err_exit;
20652064
20662065 if ((install_type & 0xffff) == 0)
@@ -2069,20 +2068,19 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename, · 2 unmodified lines
20692068 install.install_type = cpu_to_le32(install_type);
20702069
20712070 mutex_lock(&bp->hwrm_cmd_lock);
2072− hwrm_err = _hwrm_send_message(bp, &install, sizeof(install),
2073− INSTALL_PACKAGE_TIMEOUT);
2074− if (hwrm_err) {
2071+ rc = _hwrm_send_message(bp, &install, sizeof(install),
2072+ INSTALL_PACKAGE_TIMEOUT);
2073+ if (rc) {
20752074 u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err;
20762075
20772076 if (resp->error_code && error_code ==
20782077 NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
20792078 install.flags |= cpu_to_le16(
20802079 NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
2081− hwrm_err = _hwrm_send_message(bp, &install,
2082− sizeof(install),
2083− INSTALL_PACKAGE_TIMEOUT);
2080+ rc = _hwrm_send_message(bp, &install, sizeof(install),
2081+ INSTALL_PACKAGE_TIMEOUT);
20842082 }
2085− if (hwrm_err)
2083+ if (rc)
20862084 goto flash_pkg_exit;
20872085 }
20882086
@@ -2094,7 +2092,7 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename, · 5 unmodified lines
20942092 flash_pkg_exit:
20952093 mutex_unlock(&bp->hwrm_cmd_lock);
20962094 err_exit:
2097− if (hwrm_err == -EACCES)
2095+ if (rc == -EACCES)
20982096 bnxt_print_admin_err(bp);
20992097 return rc;
21002098 }
@@ -3338,7 +3336,7 @@ err: · 1237 unmodified lines
33383336 kfree(coredump.data);
33393337 *dump_len += sizeof(struct bnxt_coredump_record);
33403338 if (rc == -ENOBUFS)
3341− netdev_err(bp->dev, "Firmware returned large coredump buffer");
3339+ netdev_err(bp->dev, "Firmware returned large coredump buffer\n");
33423340 return rc;
33433341 }
33443342
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c+24−24
@@ -50,7 +50,7 @@ static u16 bnxt_flow_get_dst_fid(struct bnxt *pf_bp, struct net_device *dev) · 49 unmodified lines
5050
5151 /* check if dev belongs to the same switch */
5252 if (!netdev_port_same_parent_id(pf_bp->dev, dev)) {
53− netdev_info(pf_bp->dev, "dev(ifindex=%d) not on same switch",
53+ netdev_info(pf_bp->dev, "dev(ifindex=%d) not on same switch\n",
5454 dev->ifindex);
5555 return BNXT_FID_INVALID;
5656 }
@@ -70,7 +70,7 @@ static int bnxt_tc_parse_redir(struct bnxt *bp, · 13 unmodified lines
7070 struct net_device *dev = act->dev;
7171
7272 if (!dev) {
73− netdev_info(bp->dev, "no dev in mirred action");
73+ netdev_info(bp->dev, "no dev in mirred action\n");
7474 return -EINVAL;
7575 }
7676
@@ -106,7 +106,7 @@ static int bnxt_tc_parse_tunnel_set(struct bnxt *bp, · 29 unmodified lines
106106 const struct ip_tunnel_key *tun_key = &tun_info->key;
107107
108108 if (ip_tunnel_info_af(tun_info) != AF_INET) {
109− netdev_info(bp->dev, "only IPv4 tunnel-encap is supported");
109+ netdev_info(bp->dev, "only IPv4 tunnel-encap is supported\n");
110110 return -EOPNOTSUPP;
111111 }
112112
@@ -295,7 +295,7 @@ static int bnxt_tc_parse_actions(struct bnxt *bp, · 182 unmodified lines
295295 int i, rc;
296296
297297 if (!flow_action_has_entries(flow_action)) {
298− netdev_info(bp->dev, "no actions");
298+ netdev_info(bp->dev, "no actions\n");
299299 return -EINVAL;
300300 }
301301
@@ -370,7 +370,7 @@ static int bnxt_tc_parse_flow(struct bnxt *bp, · 68 unmodified lines
370370 /* KEY_CONTROL and KEY_BASIC are needed for forming a meaningful key */
371371 if ((dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CONTROL)) == 0 ||
372372 (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_BASIC)) == 0) {
373− netdev_info(bp->dev, "cannot form TC key: used_keys = 0x%x",
373+ netdev_info(bp->dev, "cannot form TC key: used_keys = 0x%x\n",
374374 dissector->used_keys);
375375 return -EOPNOTSUPP;
376376 }
@@ -508,7 +508,7 @@ static int bnxt_hwrm_cfa_flow_free(struct bnxt *bp, · 131 unmodified lines
508508
509509 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
510510 if (rc)
511− netdev_info(bp->dev, "%s: Error rc=%d", __func__, rc);
511+ netdev_info(bp->dev, "%s: Error rc=%d\n", __func__, rc);
512512
513513 return rc;
514514 }
@@ -841,7 +841,7 @@ static int hwrm_cfa_decap_filter_alloc(struct bnxt *bp, · 326 unmodified lines
841841 resp = bnxt_get_hwrm_resp_addr(bp, &req);
842842 *decap_filter_handle = resp->decap_filter_id;
843843 } else {
844− netdev_info(bp->dev, "%s: Error rc=%d", __func__, rc);
844+ netdev_info(bp->dev, "%s: Error rc=%d\n", __func__, rc);
845845 }
846846 mutex_unlock(&bp->hwrm_cmd_lock);
847847
@@ -859,7 +859,7 @@ static int hwrm_cfa_decap_filter_free(struct bnxt *bp, · 11 unmodified lines
859859
860860 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
861861 if (rc)
862− netdev_info(bp->dev, "%s: Error rc=%d", __func__, rc);
862+ netdev_info(bp->dev, "%s: Error rc=%d\n", __func__, rc);
863863
864864 return rc;
865865 }
@@ -906,7 +906,7 @@ static int hwrm_cfa_encap_record_alloc(struct bnxt *bp, · 40 unmodified lines
906906 resp = bnxt_get_hwrm_resp_addr(bp, &req);
907907 *encap_record_handle = resp->encap_record_id;
908908 } else {
909− netdev_info(bp->dev, "%s: Error rc=%d", __func__, rc);
909+ netdev_info(bp->dev, "%s: Error rc=%d\n", __func__, rc);
910910 }
911911 mutex_unlock(&bp->hwrm_cmd_lock);
912912
@@ -924,7 +924,7 @@ static int hwrm_cfa_encap_record_free(struct bnxt *bp, · 11 unmodified lines
924924
925925 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
926926 if (rc)
927− netdev_info(bp->dev, "%s: Error rc=%d", __func__, rc);
927+ netdev_info(bp->dev, "%s: Error rc=%d\n", __func__, rc);
928928
929929 return rc;
930930 }
@@ -943,7 +943,7 @@ static int bnxt_tc_put_l2_node(struct bnxt *bp, · 12 unmodified lines
943943 tc_info->l2_ht_params);
944944 if (rc)
945945 netdev_err(bp->dev,
946− "Error: %s: rhashtable_remove_fast: %d",
946+ "Error: %s: rhashtable_remove_fast: %d\n",
947947 __func__, rc);
948948 kfree_rcu(l2_node, rcu);
949949 }
@@ -972,7 +972,7 @@ bnxt_tc_get_l2_node(struct bnxt *bp, struct rhashtable *l2_table, · 22 unmodified lines
972972 if (rc) {
973973 kfree_rcu(l2_node, rcu);
974974 netdev_err(bp->dev,
975− "Error: %s: rhashtable_insert_fast: %d",
975+ "Error: %s: rhashtable_insert_fast: %d\n",
976976 __func__, rc);
977977 return NULL;
978978 }
@@ -1031,7 +1031,7 @@ static bool bnxt_tc_can_offload(struct bnxt *bp, struct bnxt_tc_flow *flow) · 52 unmodified lines
10311031 if ((flow->flags & BNXT_TC_FLOW_FLAGS_PORTS) &&
10321032 (flow->l4_key.ip_proto != IPPROTO_TCP &&
10331033 flow->l4_key.ip_proto != IPPROTO_UDP)) {
1034− netdev_info(bp->dev, "Cannot offload non-TCP/UDP (%d) ports",
1034+ netdev_info(bp->dev, "Cannot offload non-TCP/UDP (%d) ports\n",
10351035 flow->l4_key.ip_proto);
10361036 return false;
10371037 }
@@ -1088,7 +1088,7 @@ static int bnxt_tc_put_tunnel_node(struct bnxt *bp, · 50 unmodified lines
10881088 rc = rhashtable_remove_fast(tunnel_table, &tunnel_node->node,
10891089 *ht_params);
10901090 if (rc) {
1091− netdev_err(bp->dev, "rhashtable_remove_fast rc=%d", rc);
1091+ netdev_err(bp->dev, "rhashtable_remove_fast rc=%d\n", rc);
10921092 rc = -1;
10931093 }
10941094 kfree_rcu(tunnel_node, rcu);
@@ -1129,7 +1129,7 @@ bnxt_tc_get_tunnel_node(struct bnxt *bp, struct rhashtable *tunnel_table, · 34 unmodified lines
11291129 tunnel_node->refcount++;
11301130 return tunnel_node;
11311131 err:
1132− netdev_info(bp->dev, "error rc=%d", rc);
1132+ netdev_info(bp->dev, "error rc=%d\n", rc);
11331133 return NULL;
11341134 }
11351135
@@ -1187,7 +1187,7 @@ static void bnxt_tc_put_decap_l2_node(struct bnxt *bp, · 51 unmodified lines
11871187 &decap_l2_node->node,
11881188 tc_info->decap_l2_ht_params);
11891189 if (rc)
1190− netdev_err(bp->dev, "rhashtable_remove_fast rc=%d", rc);
1190+ netdev_err(bp->dev, "rhashtable_remove_fast rc=%d\n", rc);
11911191 kfree_rcu(decap_l2_node, rcu);
11921192 }
11931193 }
@@ -1227,7 +1227,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · 33 unmodified lines
12271227
12281228 rt = ip_route_output_key(dev_net(real_dst_dev), &flow);
12291229 if (IS_ERR(rt)) {
1230− netdev_info(bp->dev, "no route to %pI4b", &flow.daddr);
1230+ netdev_info(bp->dev, "no route to %pI4b\n", &flow.daddr);
12311231 return -EOPNOTSUPP;
12321232 }
12331233
@@ -1241,7 +1241,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · 7 unmodified lines
12411241
12421242 if (vlan->real_dev != real_dst_dev) {
12431243 netdev_info(bp->dev,
1244− "dst_dev(%s) doesn't use PF-if(%s)",
1244+ "dst_dev(%s) doesn't use PF-if(%s)\n",
12451245 netdev_name(dst_dev),
12461246 netdev_name(real_dst_dev));
12471247 rc = -EOPNOTSUPP;
@@ -1253,7 +1253,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · 5 unmodified lines
12531253 #endif
12541254 } else if (dst_dev != real_dst_dev) {
12551255 netdev_info(bp->dev,
1256− "dst_dev(%s) for %pI4b is not PF-if(%s)",
1256+ "dst_dev(%s) for %pI4b is not PF-if(%s)\n",
12571257 netdev_name(dst_dev), &flow.daddr,
12581258 netdev_name(real_dst_dev));
12591259 rc = -EOPNOTSUPP;
@@ -1262,7 +1262,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · 2 unmodified lines
12621262
12631263 nbr = dst_neigh_lookup(&rt->dst, &flow.daddr);
12641264 if (!nbr) {
1265− netdev_info(bp->dev, "can't lookup neighbor for %pI4b",
1265+ netdev_info(bp->dev, "can't lookup neighbor for %pI4b\n",
12661266 &flow.daddr);
12671267 rc = -EOPNOTSUPP;
12681268 goto put_rt;
@@ -1472,7 +1472,7 @@ static int __bnxt_tc_del_flow(struct bnxt *bp, · 203 unmodified lines
14721472 rc = rhashtable_remove_fast(&tc_info->flow_table, &flow_node->node,
14731473 tc_info->flow_ht_params);
14741474 if (rc)
1475− netdev_err(bp->dev, "Error: %s: rhashtable_remove_fast rc=%d",
1475+ netdev_err(bp->dev, "Error: %s: rhashtable_remove_fast rc=%d\n",
14761476 __func__, rc);
14771477
14781478 kfree_rcu(flow_node, rcu);
@@ -1587,7 +1587,7 @@ unlock: · 108 unmodified lines
15871587 free_node:
15881588 kfree_rcu(new_node, rcu);
15891589 done:
1590− netdev_err(bp->dev, "Error: %s: cookie=0x%lx error=%d",
1590+ netdev_err(bp->dev, "Error: %s: cookie=0x%lx error=%d\n",
15911591 __func__, tc_flow_cmd->cookie, rc);
15921592 return rc;
15931593 }
@@ -1700,7 +1700,7 @@ bnxt_hwrm_cfa_flow_stats_get(struct bnxt *bp, int num_flows, · 106 unmodified lines
17001700 le64_to_cpu(resp_bytes[i]);
17011701 }
17021702 } else {
1703− netdev_info(bp->dev, "error rc=%d", rc);
1703+ netdev_info(bp->dev, "error rc=%d\n", rc);
17041704 }
17051705 mutex_unlock(&bp->hwrm_cmd_lock);
17061706
@@ -1970,7 +1970,7 @@ static int bnxt_tc_indr_block_event(struct notifier_block *nb, · 263 unmodified lines
19701970 bp);
19711971 if (rc)
19721972 netdev_info(bp->dev,
1973− "Failed to register indirect blk: dev: %s",
1973+ "Failed to register indirect blk: dev: %s\n",
19741974 netdev->name);
19751975 break;
19761976 case NETDEV_UNREGISTER:
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c+5−5
@@ -43,7 +43,7 @@ static int hwrm_cfa_vfr_alloc(struct bnxt *bp, u16 vf_idx, · 42 unmodified lines
4343 netdev_dbg(bp->dev, "tx_cfa_action=0x%x, rx_cfa_code=0x%x",
4444 *tx_cfa_action, *rx_cfa_code);
4545 } else {
46− netdev_info(bp->dev, "%s error rc=%d", __func__, rc);
46+ netdev_info(bp->dev, "%s error rc=%d\n", __func__, rc);
4747 }
4848
4949 mutex_unlock(&bp->hwrm_cmd_lock);
@@ -60,7 +60,7 @@ static int hwrm_cfa_vfr_free(struct bnxt *bp, u16 vf_idx) · 10 unmodified lines
6060
6161 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
6262 if (rc)
63− netdev_info(bp->dev, "%s error rc=%d", __func__, rc);
63+ netdev_info(bp->dev, "%s error rc=%d\n", __func__, rc);
6464 return rc;
6565 }
6666
@@ -465,7 +465,7 @@ static int bnxt_vf_reps_create(struct bnxt *bp) · 398 unmodified lines
465465 return 0;
466466
467467 err:
468− netdev_info(bp->dev, "%s error=%d", __func__, rc);
468+ netdev_info(bp->dev, "%s error=%d\n", __func__, rc);
469469 kfree(cfa_code_map);
470470 __bnxt_vf_reps_destroy(bp);
471471 return rc;
@@ -488,7 +488,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode, · 16 unmodified lines
488488
489489 mutex_lock(&bp->sriov_lock);
490490 if (bp->eswitch_mode == mode) {
491− netdev_info(bp->dev, "already in %s eswitch mode",
491+ netdev_info(bp->dev, "already in %s eswitch mode\n",
492492 mode == DEVLINK_ESWITCH_MODE_LEGACY ?
493493 "legacy" : "switchdev");
494494 rc = -EINVAL;
@@ -508,7 +508,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode, · 13 unmodified lines
508508 }
509509
510510 if (pci_num_vf(bp->pdev) == 0) {
511− netdev_info(bp->dev, "Enable VFs before setting switchdev mode");
511+ netdev_info(bp->dev, "Enable VFs before setting switchdev mode\n");
512512 rc = -EPERM;
513513 goto done;
514514 }
drivers/net/ethernet/broadcom/genet/bcmmii.c+1−0
@@ -294,6 +294,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) · 293 unmodified lines
294294 */
295295 if (priv->ext_phy) {
296296 reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
297+ reg &= ~ID_MODE_DIS;
297298 reg |= id_mode_dis;
298299 if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
299300 reg |= RGMII_MODE_EN_V123;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+27−22
@@ -5381,12 +5381,11 @@ static inline bool is_x_10g_port(const struct link_config *lc) · 5380 unmodified lines
53815381 static int cfg_queues(struct adapter *adap)
53825382 {
53835383 u32 avail_qsets, avail_eth_qsets, avail_uld_qsets;
5384+ u32 i, n10g = 0, qidx = 0, n1g = 0;
5385+ u32 ncpus = num_online_cpus();
53845386 u32 niqflint, neq, num_ulds;
53855387 struct sge *s = &adap->sge;
5386− u32 i, n10g = 0, qidx = 0;
5387−#ifndef CONFIG_CHELSIO_T4_DCB
5388− int q10g = 0;
5389−#endif
5388+ u32 q10g = 0, q1g;
53905389
53915390 /* Reduce memory usage in kdump environment, disable all offload. */
53925391 if (is_kdump_kernel() || (is_uld(adap) && t4_uld_mem_alloc(adap))) {
@@ -5424,44 +5423,50 @@ static int cfg_queues(struct adapter *adap) · 31 unmodified lines
54245423 n10g += is_x_10g_port(&adap2pinfo(adap, i)->link_cfg);
54255424
54265425 avail_eth_qsets = min_t(u32, avail_qsets, MAX_ETH_QSETS);
5426+
5427+ /* We default to 1 queue per non-10G port and up to # of cores queues
5428+ * per 10G port.
5429+ */
5430+ if (n10g)
5431+ q10g = (avail_eth_qsets - (adap->params.nports - n10g)) / n10g;
5432+
5433+ n1g = adap->params.nports - n10g;
54275434 #ifdef CONFIG_CHELSIO_T4_DCB
54285435 /* For Data Center Bridging support we need to be able to support up
54295436 * to 8 Traffic Priorities; each of which will be assigned to its
54305437 * own TX Queue in order to prevent Head-Of-Line Blocking.
54315438 */
5439+ q1g = 8;
54325440 if (adap->params.nports * 8 > avail_eth_qsets) {
54335441 dev_err(adap->pdev_dev, "DCB avail_eth_qsets=%d < %d!\n",
54345442 avail_eth_qsets, adap->params.nports * 8);
54355443 return -ENOMEM;
54365444 }
54375445
5438− for_each_port(adap, i) {
5439− struct port_info *pi = adap2pinfo(adap, i);
5446+ if (adap->params.nports * ncpus < avail_eth_qsets)
5447+ q10g = max(8U, ncpus);
5448+ else
5449+ q10g = max(8U, q10g);
54405450
5441− pi->first_qset = qidx;
5442− pi->nqsets = is_kdump_kernel() ? 1 : 8;
5443− qidx += pi->nqsets;
5444− }
5445−#else /* !CONFIG_CHELSIO_T4_DCB */
5446− /* We default to 1 queue per non-10G port and up to # of cores queues
5447− * per 10G port.
5448− */
5449− if (n10g)
5450− q10g = (avail_eth_qsets - (adap->params.nports - n10g)) / n10g;
5451− if (q10g > netif_get_num_default_rss_queues())
5452− q10g = netif_get_num_default_rss_queues();
5451+ while ((q10g * n10g) > (avail_eth_qsets - n1g * q1g))
5452+ q10g--;
54535453
5454− if (is_kdump_kernel())
5454+#else /* !CONFIG_CHELSIO_T4_DCB */
5455+ q1g = 1;
5456+ q10g = min(q10g, ncpus);
5457+#endif /* !CONFIG_CHELSIO_T4_DCB */
5458+ if (is_kdump_kernel()) {
54555459 q10g = 1;
5460+ q1g = 1;
5461+ }
54565462
54575463 for_each_port(adap, i) {
54585464 struct port_info *pi = adap2pinfo(adap, i);
54595465
54605466 pi->first_qset = qidx;
5461− pi->nqsets = is_x_10g_port(&pi->link_cfg) ? q10g : 1;
5467+ pi->nqsets = is_x_10g_port(&pi->link_cfg) ? q10g : q1g;
54625468 qidx += pi->nqsets;
54635469 }
5464−#endif /* !CONFIG_CHELSIO_T4_DCB */
54655470
54665471 s->ethqsets = qidx;
54675472 s->max_ethqsets = qidx; /* MSI-X may lower it later */
@@ -5473,7 +5478,7 @@ static int cfg_queues(struct adapter *adap) · 5 unmodified lines
54735478 * capped by the number of available cores.
54745479 */
54755480 num_ulds = adap->num_uld + adap->num_ofld_uld;
5476− i = min_t(u32, MAX_OFLD_QSETS, num_online_cpus());
5481+ i = min_t(u32, MAX_OFLD_QSETS, ncpus);
54775482 avail_uld_qsets = roundup(i, adap->params.nports);
54785483 if (avail_qsets < num_ulds * adap->params.nports) {
54795484 adap->params.offload = 0;
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+108−6
@@ -1,4 +1,5 @@
11 /* Copyright 2008 - 2016 Freescale Semiconductor Inc.
2+ * Copyright 2020 NXP
23 *
34 * Redistribution and use in source and binary forms, with or without
45 * modification, are permitted provided that the following conditions are met:
@@ -123,7 +124,22 @@ MODULE_PARM_DESC(tx_timeout, "The Tx timeout in ms"); · 118 unmodified lines
123124 #define FSL_QMAN_MAX_OAL 127
124125
125126 /* Default alignment for start of data in an Rx FD */
127+#ifdef CONFIG_DPAA_ERRATUM_A050385
128+/* aligning data start to 64 avoids DMA transaction splits, unless the buffer
129+ * is crossing a 4k page boundary
130+ */
131+#define DPAA_FD_DATA_ALIGNMENT (fman_has_errata_a050385() ? 64 : 16)
132+/* aligning to 256 avoids DMA transaction splits caused by 4k page boundary
133+ * crossings; also, all SG fragments except the last must have a size multiple
134+ * of 256 to avoid DMA transaction splits
135+ */
136+#define DPAA_A050385_ALIGN 256
137+#define DPAA_FD_RX_DATA_ALIGNMENT (fman_has_errata_a050385() ? \
138+ DPAA_A050385_ALIGN : 16)
139+#else
126140 #define DPAA_FD_DATA_ALIGNMENT 16
141+#define DPAA_FD_RX_DATA_ALIGNMENT DPAA_FD_DATA_ALIGNMENT
142+#endif
127143
128144 /* The DPAA requires 256 bytes reserved and mapped for the SGT */
129145 #define DPAA_SGT_SIZE 256
@@ -158,8 +174,13 @@ MODULE_PARM_DESC(tx_timeout, "The Tx timeout in ms"); · 28 unmodified lines
158174 #define DPAA_PARSE_RESULTS_SIZE sizeof(struct fman_prs_result)
159175 #define DPAA_TIME_STAMP_SIZE 8
160176 #define DPAA_HASH_RESULTS_SIZE 8
177+#ifdef CONFIG_DPAA_ERRATUM_A050385
178+#define DPAA_RX_PRIV_DATA_SIZE (DPAA_A050385_ALIGN - (DPAA_PARSE_RESULTS_SIZE\
179+ + DPAA_TIME_STAMP_SIZE + DPAA_HASH_RESULTS_SIZE))
180+#else
161181 #define DPAA_RX_PRIV_DATA_SIZE (u16)(DPAA_TX_PRIV_DATA_SIZE + \
162182 dpaa_rx_extra_headroom)
183+#endif
163184
164185 #define DPAA_ETH_PCD_RXQ_NUM 128
165186
@@ -180,7 +201,12 @@ static struct dpaa_bp *dpaa_bp_array[BM_MAX_NUM_OF_POOLS]; · 14 unmodified lines
180201
181202 #define DPAA_BP_RAW_SIZE 4096
182203
204+#ifdef CONFIG_DPAA_ERRATUM_A050385
205+#define dpaa_bp_size(raw_size) (SKB_WITH_OVERHEAD(raw_size) & \
206+ ~(DPAA_A050385_ALIGN - 1))
207+#else
183208 #define dpaa_bp_size(raw_size) SKB_WITH_OVERHEAD(raw_size)
209+#endif
184210
185211 static int dpaa_max_frm;
186212
@@ -1192,7 +1218,7 @@ static int dpaa_eth_init_rx_port(struct fman_port *port, struct dpaa_bp *bp, · 1005 unmodified lines
11921218 buf_prefix_content.pass_prs_result = true;
11931219 buf_prefix_content.pass_hash_result = true;
11941220 buf_prefix_content.pass_time_stamp = true;
1195− buf_prefix_content.data_align = DPAA_FD_DATA_ALIGNMENT;
1221+ buf_prefix_content.data_align = DPAA_FD_RX_DATA_ALIGNMENT;
11961222
11971223 rx_p = &params.specific_params.rx_params;
11981224 rx_p->err_fqid = errq->fqid;
@@ -1662,6 +1688,8 @@ static u8 rx_csum_offload(const struct dpaa_priv *priv, const struct qm_fd *fd) · 463 unmodified lines
16621688 return CHECKSUM_NONE;
16631689 }
16641690
1691+#define PTR_IS_ALIGNED(x, a) (IS_ALIGNED((unsigned long)(x), (a)))
1692+
16651693 /* Build a linear skb around the received buffer.
16661694 * We are guaranteed there is enough room at the end of the data buffer to
16671695 * accommodate the shared info area of the skb.
@@ -1733,8 +1761,7 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv, · 65 unmodified lines
17331761
17341762 sg_addr = qm_sg_addr(&sgt[i]);
17351763 sg_vaddr = phys_to_virt(sg_addr);
1736− WARN_ON(!IS_ALIGNED((unsigned long)sg_vaddr,
1737− SMP_CACHE_BYTES));
1764+ WARN_ON(!PTR_IS_ALIGNED(sg_vaddr, SMP_CACHE_BYTES));
17381765
17391766 dma_unmap_page(priv->rx_dma_dev, sg_addr,
17401767 DPAA_BP_RAW_SIZE, DMA_FROM_DEVICE);
@@ -2022,6 +2049,75 @@ static inline int dpaa_xmit(struct dpaa_priv *priv, · 281 unmodified lines
20222049 return 0;
20232050 }
20242051
2052+#ifdef CONFIG_DPAA_ERRATUM_A050385
2053+int dpaa_a050385_wa(struct net_device *net_dev, struct sk_buff **s)
2054+{
2055+ struct dpaa_priv *priv = netdev_priv(net_dev);
2056+ struct sk_buff *new_skb, *skb = *s;
2057+ unsigned char *start, i;
2058+
2059+ /* check linear buffer alignment */
2060+ if (!PTR_IS_ALIGNED(skb->data, DPAA_A050385_ALIGN))
2061+ goto workaround;
2062+
2063+ /* linear buffers just need to have an aligned start */
2064+ if (!skb_is_nonlinear(skb))
2065+ return 0;
2066+
2067+ /* linear data size for nonlinear skbs needs to be aligned */
2068+ if (!IS_ALIGNED(skb_headlen(skb), DPAA_A050385_ALIGN))
2069+ goto workaround;
2070+
2071+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2072+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2073+
2074+ /* all fragments need to have aligned start addresses */
2075+ if (!IS_ALIGNED(skb_frag_off(frag), DPAA_A050385_ALIGN))
2076+ goto workaround;
2077+
2078+ /* all but last fragment need to have aligned sizes */
2079+ if (!IS_ALIGNED(skb_frag_size(frag), DPAA_A050385_ALIGN) &&
2080+ (i < skb_shinfo(skb)->nr_frags - 1))
2081+ goto workaround;
2082+ }
2083+
2084+ return 0;
2085+
2086+workaround:
2087+ /* copy all the skb content into a new linear buffer */
2088+ new_skb = netdev_alloc_skb(net_dev, skb->len + DPAA_A050385_ALIGN - 1 +
2089+ priv->tx_headroom);
2090+ if (!new_skb)
2091+ return -ENOMEM;
2092+
2093+ /* NET_SKB_PAD bytes already reserved, adding up to tx_headroom */
2094+ skb_reserve(new_skb, priv->tx_headroom - NET_SKB_PAD);
2095+
2096+ /* Workaround for DPAA_A050385 requires data start to be aligned */
2097+ start = PTR_ALIGN(new_skb->data, DPAA_A050385_ALIGN);
2098+ if (start - new_skb->data != 0)
2099+ skb_reserve(new_skb, start - new_skb->data);
2100+
2101+ skb_put(new_skb, skb->len);
2102+ skb_copy_bits(skb, 0, new_skb->data, skb->len);
2103+ skb_copy_header(new_skb, skb);
2104+ new_skb->dev = skb->dev;
2105+
2106+ /* We move the headroom when we align it so we have to reset the
2107+ * network and transport header offsets relative to the new data
2108+ * pointer. The checksum offload relies on these offsets.
2109+ */
2110+ skb_set_network_header(new_skb, skb_network_offset(skb));
2111+ skb_set_transport_header(new_skb, skb_transport_offset(skb));
2112+
2113+ /* TODO: does timestamping need the result in the old skb? */
2114+ dev_kfree_skb(skb);
2115+ *s = new_skb;
2116+
2117+ return 0;
2118+}
2119+#endif
2120+
20252121 static netdev_tx_t
20262122 dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
20272123 {
@@ -2068,6 +2164,14 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) · 40 unmodified lines
20682164 nonlinear = skb_is_nonlinear(skb);
20692165 }
20702166
2167+#ifdef CONFIG_DPAA_ERRATUM_A050385
2168+ if (unlikely(fman_has_errata_a050385())) {
2169+ if (dpaa_a050385_wa(net_dev, &skb))
2170+ goto enomem;
2171+ nonlinear = skb_is_nonlinear(skb);
2172+ }
2173+#endif
2174+
20712175 if (nonlinear) {
20722176 /* Just create a S/G fd based on the skb */
20732177 err = skb_to_sg_fd(priv, skb, &fd);
@@ -2741,9 +2845,7 @@ static inline u16 dpaa_get_headroom(struct dpaa_buffer_layout *bl) · 667 unmodified lines
27412845 headroom = (u16)(bl->priv_data_size + DPAA_PARSE_RESULTS_SIZE +
27422846 DPAA_TIME_STAMP_SIZE + DPAA_HASH_RESULTS_SIZE);
27432847
2744− return DPAA_FD_DATA_ALIGNMENT ? ALIGN(headroom,
2745− DPAA_FD_DATA_ALIGNMENT) :
2746− headroom;
2848+ return ALIGN(headroom, DPAA_FD_DATA_ALIGNMENT);
27472849 }
27482850
27492851 static int dpaa_eth_probe(struct platform_device *pdev)
drivers/net/ethernet/freescale/fec_main.c+3−3
@@ -2529,15 +2529,15 @@ fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec) · 2528 unmodified lines
25292529 return -EINVAL;
25302530 }
25312531
2532− cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
2532+ cycle = fec_enet_us_to_itr_clock(ndev, ec->rx_coalesce_usecs);
25332533 if (cycle > 0xFFFF) {
25342534 dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
25352535 return -EINVAL;
25362536 }
25372537
2538− cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
2538+ cycle = fec_enet_us_to_itr_clock(ndev, ec->tx_coalesce_usecs);
25392539 if (cycle > 0xFFFF) {
2540− dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
2540+ dev_err(dev, "Tx coalesced usec exceed hardware limitation\n");
25412541 return -EINVAL;
25422542 }
25432543
drivers/net/ethernet/freescale/fman/Kconfig+28−0
@@ -8,3 +8,31 @@ config FSL_FMAN · 7 unmodified lines
88 help
99 Freescale Data-Path Acceleration Architecture Frame Manager
1010 (FMan) support
11+
12+config DPAA_ERRATUM_A050385
13+ bool
14+ depends on ARM64 && FSL_DPAA
15+ default y
16+ help
17+ DPAA FMan erratum A050385 software workaround implementation:
18+ align buffers, data start, SG fragment length to avoid FMan DMA
19+ splits.
20+ FMAN DMA read or writes under heavy traffic load may cause FMAN
21+ internal resource leak thus stopping further packet processing.
22+ The FMAN internal queue can overflow when FMAN splits single
23+ read or write transactions into multiple smaller transactions
24+ such that more than 17 AXI transactions are in flight from FMAN
25+ to interconnect. When the FMAN internal queue overflows, it can
26+ stall further packet processing. The issue can occur with any
27+ one of the following three conditions:
28+ 1. FMAN AXI transaction crosses 4K address boundary (Errata
29+ A010022)
30+ 2. FMAN DMA address for an AXI transaction is not 16 byte
31+ aligned, i.e. the last 4 bits of an address are non-zero
32+ 3. Scatter Gather (SG) frames have more than one SG buffer in
33+ the SG list and any one of the buffers, except the last
34+ buffer in the SG list has data size that is not a multiple
35+ of 16 bytes, i.e., other than 16, 32, 48, 64, etc.
36+ With any one of the above three conditions present, there is
37+ likelihood of stalled FMAN packet processing, especially under
38+ stress with multiple ports injecting line-rate traffic.
drivers/net/ethernet/freescale/fman/fman.c+18−0
@@ -1,5 +1,6 @@
11 /*
22 * Copyright 2008-2015 Freescale Semiconductor Inc.
3+ * Copyright 2020 NXP
34 *
45 * Redistribution and use in source and binary forms, with or without
56 * modification, are permitted provided that the following conditions are met:
@@ -566,6 +567,10 @@ struct fman_cfg { · 560 unmodified lines
566567 u32 qmi_def_tnums_thresh;
567568 };
568569
570+#ifdef CONFIG_DPAA_ERRATUM_A050385
571+static bool fman_has_err_a050385;
572+#endif
573+
569574 static irqreturn_t fman_exceptions(struct fman *fman,
570575 enum fman_exceptions exception)
571576 {
@@ -2518,6 +2523,14 @@ struct fman *fman_bind(struct device *fm_dev) · 1946 unmodified lines
25182523 }
25192524 EXPORT_SYMBOL(fman_bind);
25202525
2526+#ifdef CONFIG_DPAA_ERRATUM_A050385
2527+bool fman_has_errata_a050385(void)
2528+{
2529+ return fman_has_err_a050385;
2530+}
2531+EXPORT_SYMBOL(fman_has_errata_a050385);
2532+#endif
2533+
25212534 static irqreturn_t fman_err_irq(int irq, void *handle)
25222535 {
25232536 struct fman *fman = (struct fman *)handle;
@@ -2845,6 +2858,11 @@ static struct fman *read_dts_node(struct platform_device *of_dev) · 321 unmodified lines
28452858 goto fman_free;
28462859 }
28472860
2861+#ifdef CONFIG_DPAA_ERRATUM_A050385
2862+ fman_has_err_a050385 =
2863+ of_property_read_bool(fm_node, "fsl,erratum-a050385");
2864+#endif
2865+
28482866 return fman;
28492867
28502868 fman_node_put:
drivers/net/ethernet/freescale/fman/fman.h+5−0
@@ -1,5 +1,6 @@
11 /*
22 * Copyright 2008-2015 Freescale Semiconductor Inc.
3+ * Copyright 2020 NXP
34 *
45 * Redistribution and use in source and binary forms, with or without
56 * modification, are permitted provided that the following conditions are met:
@@ -398,6 +399,10 @@ u16 fman_get_max_frm(void); · 392 unmodified lines
398399
399400 int fman_get_rx_extra_headroom(void);
400401
402+#ifdef CONFIG_DPAA_ERRATUM_A050385
403+bool fman_has_errata_a050385(void);
404+#endif
405+
401406 struct fman *fman_bind(struct device *dev);
402407
403408 #endif /* __FM_H */
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h+1−0
@@ -46,6 +46,7 @@ enum HCLGE_MBX_OPCODE { · 45 unmodified lines
4646 HCLGE_MBX_PUSH_VLAN_INFO, /* (PF -> VF) push port base vlan */
4747 HCLGE_MBX_GET_MEDIA_TYPE, /* (VF -> PF) get media type */
4848 HCLGE_MBX_PUSH_PROMISC_INFO, /* (PF -> VF) push vf promisc info */
49+ HCLGE_MBX_VF_UNINIT, /* (VF -> PF) vf is unintializing */
4950
5051 HCLGE_MBX_GET_VF_FLR_STATUS = 200, /* (M7 -> PF) get vf flr status */
5152 HCLGE_MBX_PUSH_LINK_STATUS, /* (M7 -> PF) get port link status */
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+1−1
@@ -1711,7 +1711,7 @@ static int hns3_setup_tc(struct net_device *netdev, void *type_data) · 1710 unmodified lines
17111711 netif_dbg(h, drv, netdev, "setup tc: num_tc=%u\n", tc);
17121712
17131713 return (kinfo->dcb_ops && kinfo->dcb_ops->setup_tc) ?
1714− kinfo->dcb_ops->setup_tc(h, tc, prio_tc) : -EOPNOTSUPP;
1714+ kinfo->dcb_ops->setup_tc(h, tc ? tc : 1, prio_tc) : -EOPNOTSUPP;
17151715 }
17161716
17171717 static int hns3_nic_setup_tc(struct net_device *dev, enum tc_setup_type type,
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+42−5
@@ -2446,10 +2446,12 @@ static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed, · 2445 unmodified lines
24462446
24472447 int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex)
24482448 {
2449+ struct hclge_mac *mac = &hdev->hw.mac;
24492450 int ret;
24502451
24512452 duplex = hclge_check_speed_dup(duplex, speed);
2452− if (hdev->hw.mac.speed == speed && hdev->hw.mac.duplex == duplex)
2453+ if (!mac->support_autoneg && mac->speed == speed &&
2454+ mac->duplex == duplex)
24532455 return 0;
24542456
24552457 ret = hclge_cfg_mac_speed_dup_hw(hdev, speed, duplex);
@@ -7743,16 +7745,27 @@ static int hclge_set_vlan_filter_ctrl(struct hclge_dev *hdev, u8 vlan_type, · 5287 unmodified lines
77437745 struct hclge_desc desc;
77447746 int ret;
77457747
7746− hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_VLAN_FILTER_CTRL, false);
7747−
7748+ /* read current vlan filter parameter */
7749+ hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_VLAN_FILTER_CTRL, true);
77487750 req = (struct hclge_vlan_filter_ctrl_cmd *)desc.data;
77497751 req->vlan_type = vlan_type;
7750− req->vlan_fe = filter_en ? fe_type : 0;
77517752 req->vf_id = vf_id;
77527753
7754+ ret = hclge_cmd_send(&hdev->hw, &desc, 1);
7755+ if (ret) {
7756+ dev_err(&hdev->pdev->dev,
7757+ "failed to get vlan filter config, ret = %d.\n", ret);
7758+ return ret;
7759+ }
7760+
7761+ /* modify and write new config parameter */
7762+ hclge_cmd_reuse_desc(&desc, false);
7763+ req->vlan_fe = filter_en ?
7764+ (req->vlan_fe | fe_type) : (req->vlan_fe & ~fe_type);
7765+
77537766 ret = hclge_cmd_send(&hdev->hw, &desc, 1);
77547767 if (ret)
7755− dev_err(&hdev->pdev->dev, "set vlan filter fail, ret =%d.\n",
7768+ dev_err(&hdev->pdev->dev, "failed to set vlan filter, ret = %d.\n",
77567769 ret);
77577770
77587771 return ret;
@@ -8270,6 +8283,7 @@ void hclge_rm_vport_all_vlan_table(struct hclge_vport *vport, bool is_del_list) · 511 unmodified lines
82708283 kfree(vlan);
82718284 }
82728285 }
8286+ clear_bit(vport->vport_id, hdev->vf_vlan_full);
82738287 }
82748288
82758289 void hclge_uninit_vport_vlan_table(struct hclge_dev *hdev)
@@ -8486,6 +8500,28 @@ static int hclge_set_vf_vlan_filter(struct hnae3_handle *handle, int vfid, · 210 unmodified lines
84868500 }
84878501 }
84888502
8503+static void hclge_clear_vf_vlan(struct hclge_dev *hdev)
8504+{
8505+ struct hclge_vlan_info *vlan_info;
8506+ struct hclge_vport *vport;
8507+ int ret;
8508+ int vf;
8509+
8510+ /* clear port base vlan for all vf */
8511+ for (vf = HCLGE_VF_VPORT_START_NUM; vf < hdev->num_alloc_vport; vf++) {
8512+ vport = &hdev->vport[vf];
8513+ vlan_info = &vport->port_base_vlan_cfg.vlan_info;
8514+
8515+ ret = hclge_set_vlan_filter_hw(hdev, htons(ETH_P_8021Q),
8516+ vport->vport_id,
8517+ vlan_info->vlan_tag, true);
8518+ if (ret)
8519+ dev_err(&hdev->pdev->dev,
8520+ "failed to clear vf vlan for vf%d, ret = %d\n",
8521+ vf - HCLGE_VF_VPORT_START_NUM, ret);
8522+ }
8523+}
8524+
84898525 int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto,
84908526 u16 vlan_id, bool is_kill)
84918527 {
@@ -9895,6 +9931,7 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) · 1403 unmodified lines
98959931 struct hclge_mac *mac = &hdev->hw.mac;
98969932
98979933 hclge_reset_vf_rate(hdev);
9934+ hclge_clear_vf_vlan(hdev);
98989935 hclge_misc_affinity_teardown(hdev);
98999936 hclge_state_uninit(hdev);
99009937
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c+1−0
@@ -799,6 +799,7 @@ void hclge_mbx_handler(struct hclge_dev *hdev) · 798 unmodified lines
799799 hclge_get_link_mode(vport, req);
800800 break;
801801 case HCLGE_MBX_GET_VF_FLR_STATUS:
802+ case HCLGE_MBX_VF_UNINIT:
802803 hclge_rm_vport_all_mac_table(vport, true,
803804 HCLGE_MAC_ADDR_UC);
804805 hclge_rm_vport_all_mac_table(vport, true,
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+3−0
@@ -2803,6 +2803,9 @@ static void hclgevf_uninit_hdev(struct hclgevf_dev *hdev) · 2802 unmodified lines
28032803 {
28042804 hclgevf_state_uninit(hdev);
28052805
2806+ hclgevf_send_mbx_msg(hdev, HCLGE_MBX_VF_UNINIT, 0, NULL, 0,
2807+ false, NULL, 0);
2808+
28062809 if (test_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state)) {
28072810 hclgevf_misc_irq_uninit(hdev);
28082811 hclgevf_uninit_msi(hdev);
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c+1−0
@@ -297,6 +297,7 @@ static int set_hw_ioctxt(struct hinic_hwdev *hwdev, unsigned int rq_depth, · 296 unmodified lines
297297 }
298298
299299 hw_ioctxt.func_idx = HINIC_HWIF_FUNC_IDX(hwif);
300+ hw_ioctxt.ppf_idx = HINIC_HWIF_PPF_IDX(hwif);
300301
301302 hw_ioctxt.set_cmdq_depth = HW_IOCTXT_SET_CMDQ_DEPTH_DEFAULT;
302303 hw_ioctxt.cmdq_depth = 0;
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h+1−1
@@ -151,8 +151,8 @@ struct hinic_cmd_hw_ioctxt { · 150 unmodified lines
151151
152152 u8 lro_en;
153153 u8 rsvd3;
154+ u8 ppf_idx;
154155 u8 rsvd4;
155− u8 rsvd5;
156156
157157 u16 rq_depth;
158158 u16 rx_buf_sz_idx;
drivers/net/ethernet/huawei/hinic/hinic_hw_if.h+1−0
@@ -137,6 +137,7 @@ · 136 unmodified lines
137137 #define HINIC_HWIF_FUNC_IDX(hwif) ((hwif)->attr.func_idx)
138138 #define HINIC_HWIF_PCI_INTF(hwif) ((hwif)->attr.pci_intf_idx)
139139 #define HINIC_HWIF_PF_IDX(hwif) ((hwif)->attr.pf_idx)
140+#define HINIC_HWIF_PPF_IDX(hwif) ((hwif)->attr.ppf_idx)
140141
141142 #define HINIC_FUNC_TYPE(hwif) ((hwif)->attr.func_type)
142143 #define HINIC_IS_PF(hwif) (HINIC_FUNC_TYPE(hwif) == HINIC_PF)
drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h+1−0
@@ -94,6 +94,7 @@ struct hinic_rq { · 93 unmodified lines
9494
9595 struct hinic_wq *wq;
9696
97+ struct cpumask affinity_mask;
9798 u32 irq;
9899 u16 msix_entry;
99100
drivers/net/ethernet/huawei/hinic/hinic_main.c+2−1
@@ -356,7 +356,8 @@ static void hinic_enable_rss(struct hinic_dev *nic_dev) · 355 unmodified lines
356356 if (!num_cpus)
357357 num_cpus = num_online_cpus();
358358
359− nic_dev->num_qps = min_t(u16, nic_dev->max_qps, num_cpus);
359+ nic_dev->num_qps = hinic_hwdev_num_qps(hwdev);
360+ nic_dev->num_qps = min_t(u16, nic_dev->num_qps, num_cpus);
360361
361362 nic_dev->rss_limit = nic_dev->num_qps;
362363 nic_dev->num_rss = nic_dev->num_qps;
drivers/net/ethernet/huawei/hinic/hinic_rx.c+2−3
@@ -475,7 +475,6 @@ static int rx_request_irq(struct hinic_rxq *rxq) · 474 unmodified lines
475475 struct hinic_hwdev *hwdev = nic_dev->hwdev;
476476 struct hinic_rq *rq = rxq->rq;
477477 struct hinic_qp *qp;
478− struct cpumask mask;
479478 int err;
480479
481480 rx_add_napi(rxq);
@@ -492,8 +491,8 @@ static int rx_request_irq(struct hinic_rxq *rxq) · 10 unmodified lines
492491 }
493492
494493 qp = container_of(rq, struct hinic_qp, rq);
495− cpumask_set_cpu(qp->q_id % num_online_cpus(), &mask);
496− return irq_set_affinity_hint(rq->irq, &mask);
494+ cpumask_set_cpu(qp->q_id % num_online_cpus(), &rq->affinity_mask);
495+ return irq_set_affinity_hint(rq->irq, &rq->affinity_mask);
497496 }
498497
499498 static void rx_free_irq(struct hinic_rxq *rxq)
drivers/net/ethernet/ibm/ibmvnic.c+22−2
@@ -2142,6 +2142,8 @@ static void __ibmvnic_reset(struct work_struct *work) · 2141 unmodified lines
21422142 {
21432143 struct ibmvnic_rwi *rwi;
21442144 struct ibmvnic_adapter *adapter;
2145+ bool saved_state = false;
2146+ unsigned long flags;
21452147 u32 reset_state;
21462148 int rc = 0;
21472149
@@ -2153,17 +2155,25 @@ static void __ibmvnic_reset(struct work_struct *work) · 5 unmodified lines
21532155 return;
21542156 }
21552157
2156− reset_state = adapter->state;
2157−
21582158 rwi = get_next_rwi(adapter);
21592159 while (rwi) {
2160+ spin_lock_irqsave(&adapter->state_lock, flags);
2161+
21602162 if (adapter->state == VNIC_REMOVING ||
21612163 adapter->state == VNIC_REMOVED) {
2164+ spin_unlock_irqrestore(&adapter->state_lock, flags);
21622165 kfree(rwi);
21632166 rc = EBUSY;
21642167 break;
21652168 }
21662169
2170+ if (!saved_state) {
2171+ reset_state = adapter->state;
2172+ adapter->state = VNIC_RESETTING;
2173+ saved_state = true;
2174+ }
2175+ spin_unlock_irqrestore(&adapter->state_lock, flags);
2176+
21672177 if (rwi->reset_reason == VNIC_RESET_CHANGE_PARAM) {
21682178 /* CHANGE_PARAM requestor holds rtnl_lock */
21692179 rc = do_change_param_reset(adapter, rwi, reset_state);
@@ -5091,6 +5101,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) · 2921 unmodified lines
50915101 __ibmvnic_delayed_reset);
50925102 INIT_LIST_HEAD(&adapter->rwi_list);
50935103 spin_lock_init(&adapter->rwi_lock);
5104+ spin_lock_init(&adapter->state_lock);
50945105 mutex_init(&adapter->fw_lock);
50955106 init_completion(&adapter->init_done);
50965107 init_completion(&adapter->fw_done);
@@ -5163,8 +5174,17 @@ static int ibmvnic_remove(struct vio_dev *dev) · 66 unmodified lines
51635174 {
51645175 struct net_device *netdev = dev_get_drvdata(&dev->dev);
51655176 struct ibmvnic_adapter *adapter = netdev_priv(netdev);
5177+ unsigned long flags;
5178+
5179+ spin_lock_irqsave(&adapter->state_lock, flags);
5180+ if (adapter->state == VNIC_RESETTING) {
5181+ spin_unlock_irqrestore(&adapter->state_lock, flags);
5182+ return -EBUSY;
5183+ }
51665184
51675185 adapter->state = VNIC_REMOVING;
5186+ spin_unlock_irqrestore(&adapter->state_lock, flags);
5187+
51685188 rtnl_lock();
51695189 unregister_netdevice(netdev);
51705190
drivers/net/ethernet/ibm/ibmvnic.h+5−1
@@ -941,7 +941,8 @@ enum vnic_state {VNIC_PROBING = 1, · 940 unmodified lines
941941 VNIC_CLOSING,
942942 VNIC_CLOSED,
943943 VNIC_REMOVING,
944− VNIC_REMOVED};
944+ VNIC_REMOVED,
945+ VNIC_RESETTING};
945946
946947 enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1,
947948 VNIC_RESET_MOBILITY,
@@ -1090,4 +1091,7 @@ struct ibmvnic_adapter { · 142 unmodified lines
10901091
10911092 struct ibmvnic_tunables desired;
10921093 struct ibmvnic_tunables fallback;
1094+
1095+ /* Used for serializatin of state field */
1096+ spinlock_t state_lock;
10931097 };
drivers/net/ethernet/marvell/mvmdio.c+3−3
@@ -347,7 +347,7 @@ static int orion_mdio_probe(struct platform_device *pdev) · 346 unmodified lines
347347 }
348348
349349
350− dev->err_interrupt = platform_get_irq(pdev, 0);
350+ dev->err_interrupt = platform_get_irq_optional(pdev, 0);
351351 if (dev->err_interrupt > 0 &&
352352 resource_size(r) < MVMDIO_ERR_INT_MASK + 4) {
353353 dev_err(&pdev->dev,
@@ -364,8 +364,8 @@ static int orion_mdio_probe(struct platform_device *pdev) · 10 unmodified lines
364364 writel(MVMDIO_ERR_INT_SMI_DONE,
365365 dev->regs + MVMDIO_ERR_INT_MASK);
366366
367− } else if (dev->err_interrupt == -EPROBE_DEFER) {
368− ret = -EPROBE_DEFER;
367+ } else if (dev->err_interrupt < 0) {
368+ ret = dev->err_interrupt;
369369 goto out_mdio;
370370 }
371371
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+1−2
@@ -5147,7 +5147,6 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) · 5146 unmodified lines
51475147
51485148 static void mlx5e_nic_disable(struct mlx5e_priv *priv)
51495149 {
5150− struct net_device *netdev = priv->netdev;
51515150 struct mlx5_core_dev *mdev = priv->mdev;
51525151
51535152 #ifdef CONFIG_MLX5_CORE_EN_DCB
@@ -5168,7 +5167,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) · 14 unmodified lines
51685167 mlx5e_monitor_counter_cleanup(priv);
51695168
51705169 mlx5e_disable_async_events(priv);
5171− mlx5_lag_remove(mdev, netdev);
5170+ mlx5_lag_remove(mdev);
51725171 }
51735172
51745173 int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+1−2
@@ -1861,7 +1861,6 @@ static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv) · 1860 unmodified lines
18611861
18621862 static void mlx5e_uplink_rep_disable(struct mlx5e_priv *priv)
18631863 {
1864− struct net_device *netdev = priv->netdev;
18651864 struct mlx5_core_dev *mdev = priv->mdev;
18661865 struct mlx5e_rep_priv *rpriv = priv->ppriv;
18671866
@@ -1870,7 +1869,7 @@ static void mlx5e_uplink_rep_disable(struct mlx5e_priv *priv) · 2 unmodified lines
18701869 #endif
18711870 mlx5_notifier_unregister(mdev, &priv->events_nb);
18721871 cancel_work_sync(&rpriv->uplink_priv.reoffload_flows_work);
1873− mlx5_lag_remove(mdev, netdev);
1872+ mlx5_lag_remove(mdev);
18741873 }
18751874
18761875 static MLX5E_DEFINE_STATS_GRP(sw_rep, 0);
drivers/net/ethernet/mellanox/mlx5/core/lag.c+3−8
@@ -464,9 +464,6 @@ static int mlx5_lag_netdev_event(struct notifier_block *this, · 463 unmodified lines
464464 struct mlx5_lag *ldev;
465465 int changed = 0;
466466
467− if (!net_eq(dev_net(ndev), &init_net))
468− return NOTIFY_DONE;
469−
470467 if ((event != NETDEV_CHANGEUPPER) && (event != NETDEV_CHANGELOWERSTATE))
471468 return NOTIFY_DONE;
472469
@@ -586,8 +583,7 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev) · 113 unmodified lines
586583
587584 if (!ldev->nb.notifier_call) {
588585 ldev->nb.notifier_call = mlx5_lag_netdev_event;
589− if (register_netdevice_notifier_dev_net(netdev, &ldev->nb,
590− &ldev->nn)) {
586+ if (register_netdevice_notifier_net(&init_net, &ldev->nb)) {
591587 ldev->nb.notifier_call = NULL;
592588 mlx5_core_err(dev, "Failed to register LAG netdev notifier\n");
593589 }
@@ -600,7 +596,7 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev) · 6 unmodified lines
600596 }
601597
602598 /* Must be called with intf_mutex held */
603−void mlx5_lag_remove(struct mlx5_core_dev *dev, struct net_device *netdev)
599+void mlx5_lag_remove(struct mlx5_core_dev *dev)
604600 {
605601 struct mlx5_lag *ldev;
606602 int i;
@@ -620,8 +616,7 @@ void mlx5_lag_remove(struct mlx5_core_dev *dev, struct net_device *netdev) · 13 unmodified lines
620616
621617 if (i == MLX5_MAX_PORTS) {
622618 if (ldev->nb.notifier_call)
623− unregister_netdevice_notifier_dev_net(netdev, &ldev->nb,
624− &ldev->nn);
619+ unregister_netdevice_notifier_net(&init_net, &ldev->nb);
625620 mlx5_lag_mp_cleanup(ldev);
626621 cancel_delayed_work_sync(&ldev->bond_work);
627622 mlx5_lag_dev_free(ldev);
drivers/net/ethernet/mellanox/mlx5/core/lag.h+0−1
@@ -44,7 +44,6 @@ struct mlx5_lag { · 43 unmodified lines
4444 struct workqueue_struct *wq;
4545 struct delayed_work bond_work;
4646 struct notifier_block nb;
47− struct netdev_net_notifier nn;
4847 struct lag_mp lag_mp;
4948 };
5049
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+1−1
@@ -157,7 +157,7 @@ int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, · 156 unmodified lines
157157 u8 feature_group, u8 access_reg_group);
158158
159159 void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev);
160−void mlx5_lag_remove(struct mlx5_core_dev *dev, struct net_device *netdev);
160+void mlx5_lag_remove(struct mlx5_core_dev *dev);
161161
162162 int mlx5_irq_table_init(struct mlx5_core_dev *dev);
163163 void mlx5_irq_table_cleanup(struct mlx5_core_dev *dev);
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #define MLXSW_PCI_SW_RESET 0xF0010
2929 #define MLXSW_PCI_SW_RESET_RST_BIT BIT(0)
3030 #define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 900000
31−#define MLXSW_PCI_SW_RESET_WAIT_MSECS 100
31+#define MLXSW_PCI_SW_RESET_WAIT_MSECS 200
3232 #define MLXSW_PCI_FW_READY 0xA1844
3333 #define MLXSW_PCI_FW_READY_MASK 0xFFFF
3434 #define MLXSW_PCI_FW_READY_MAGIC 0x5E
drivers/net/ethernet/micrel/ks8851_mll.c+8−6
@@ -513,14 +513,17 @@ static irqreturn_t ks_irq(int irq, void *pw) · 512 unmodified lines
513513 {
514514 struct net_device *netdev = pw;
515515 struct ks_net *ks = netdev_priv(netdev);
516+ unsigned long flags;
516517 u16 status;
517518
519+ spin_lock_irqsave(&ks->statelock, flags);
518520 /*this should be the first in IRQ handler */
519521 ks_save_cmd_reg(ks);
520522
521523 status = ks_rdreg16(ks, KS_ISR);
522524 if (unlikely(!status)) {
523525 ks_restore_cmd_reg(ks);
526+ spin_unlock_irqrestore(&ks->statelock, flags);
524527 return IRQ_NONE;
525528 }
526529
@@ -546,6 +549,7 @@ static irqreturn_t ks_irq(int irq, void *pw) · 19 unmodified lines
546549 ks->netdev->stats.rx_over_errors++;
547550 /* this should be the last in IRQ handler*/
548551 ks_restore_cmd_reg(ks);
552+ spin_unlock_irqrestore(&ks->statelock, flags);
549553 return IRQ_HANDLED;
550554 }
551555
@@ -615,6 +619,7 @@ static int ks_net_stop(struct net_device *netdev) · 63 unmodified lines
615619
616620 /* shutdown RX/TX QMU */
617621 ks_disable_qmu(ks);
622+ ks_disable_int(ks);
618623
619624 /* set powermode to soft power down to save power */
620625 ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
@@ -671,10 +676,9 @@ static netdev_tx_t ks_start_xmit(struct sk_buff *skb, struct net_device *netdev) · 50 unmodified lines
671676 {
672677 netdev_tx_t retv = NETDEV_TX_OK;
673678 struct ks_net *ks = netdev_priv(netdev);
679+ unsigned long flags;
674680
675− disable_irq(netdev->irq);
676− ks_disable_int(ks);
677− spin_lock(&ks->statelock);
681+ spin_lock_irqsave(&ks->statelock, flags);
678682
679683 /* Extra space are required:
680684 * 4 byte for alignment, 4 for status/length, 4 for CRC
@@ -688,9 +692,7 @@ static netdev_tx_t ks_start_xmit(struct sk_buff *skb, struct net_device *netdev) · 7 unmodified lines
688692 dev_kfree_skb(skb);
689693 } else
690694 retv = NETDEV_TX_BUSY;
691− spin_unlock(&ks->statelock);
692− ks_enable_int(ks);
693− enable_irq(netdev->irq);
695+ spin_unlock_irqrestore(&ks->statelock, flags);
694696 return retv;
695697 }
696698
drivers/net/ethernet/mscc/ocelot.c+17−11
@@ -2176,24 +2176,29 @@ static int ocelot_init_timestamp(struct ocelot *ocelot) · 2175 unmodified lines
21762176 return 0;
21772177 }
21782178
2179−static void ocelot_port_set_mtu(struct ocelot *ocelot, int port, size_t mtu)
2179+/* Configure the maximum SDU (L2 payload) on RX to the value specified in @sdu.
2180+ * The length of VLAN tags is accounted for automatically via DEV_MAC_TAGS_CFG.
2181+ */
2182+static void ocelot_port_set_maxlen(struct ocelot *ocelot, int port, size_t sdu)
21802183 {
21812184 struct ocelot_port *ocelot_port = ocelot->ports[port];
2185+ int maxlen = sdu + ETH_HLEN + ETH_FCS_LEN;
21822186 int atop_wm;
21832187
2184− ocelot_port_writel(ocelot_port, mtu, DEV_MAC_MAXLEN_CFG);
2188+ ocelot_port_writel(ocelot_port, maxlen, DEV_MAC_MAXLEN_CFG);
21852189
21862190 /* Set Pause WM hysteresis
2187− * 152 = 6 * mtu / OCELOT_BUFFER_CELL_SZ
2188− * 101 = 4 * mtu / OCELOT_BUFFER_CELL_SZ
2191+ * 152 = 6 * maxlen / OCELOT_BUFFER_CELL_SZ
2192+ * 101 = 4 * maxlen / OCELOT_BUFFER_CELL_SZ
21892193 */
21902194 ocelot_write_rix(ocelot, SYS_PAUSE_CFG_PAUSE_ENA |
21912195 SYS_PAUSE_CFG_PAUSE_STOP(101) |
21922196 SYS_PAUSE_CFG_PAUSE_START(152), SYS_PAUSE_CFG, port);
21932197
21942198 /* Tail dropping watermark */
2195− atop_wm = (ocelot->shared_queue_sz - 9 * mtu) / OCELOT_BUFFER_CELL_SZ;
2196− ocelot_write_rix(ocelot, ocelot_wm_enc(9 * mtu),
2199+ atop_wm = (ocelot->shared_queue_sz - 9 * maxlen) /
2200+ OCELOT_BUFFER_CELL_SZ;
2201+ ocelot_write_rix(ocelot, ocelot_wm_enc(9 * maxlen),
21972202 SYS_ATOP, port);
21982203 ocelot_write(ocelot, ocelot_wm_enc(atop_wm), SYS_ATOP_TOT_CFG);
21992204 }
@@ -2222,9 +2227,10 @@ void ocelot_init_port(struct ocelot *ocelot, int port) · 22 unmodified lines
22222227 DEV_MAC_HDX_CFG);
22232228
22242229 /* Set Max Length and maximum tags allowed */
2225− ocelot_port_set_mtu(ocelot, port, VLAN_ETH_FRAME_LEN);
2230+ ocelot_port_set_maxlen(ocelot, port, ETH_DATA_LEN);
22262231 ocelot_port_writel(ocelot_port, DEV_MAC_TAGS_CFG_TAG_ID(ETH_P_8021AD) |
22272232 DEV_MAC_TAGS_CFG_VLAN_AWR_ENA |
2233+ DEV_MAC_TAGS_CFG_VLAN_DBL_AWR_ENA |
22282234 DEV_MAC_TAGS_CFG_VLAN_LEN_AWR_ENA,
22292235 DEV_MAC_TAGS_CFG);
22302236
@@ -2310,18 +2316,18 @@ void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu, · 79 unmodified lines
23102316 * Only one port can be an NPI at the same time.
23112317 */
23122318 if (cpu < ocelot->num_phys_ports) {
2313− int mtu = VLAN_ETH_FRAME_LEN + OCELOT_TAG_LEN;
2319+ int sdu = ETH_DATA_LEN + OCELOT_TAG_LEN;
23142320
23152321 ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M |
23162322 QSYS_EXT_CPU_CFG_EXT_CPU_PORT(cpu),
23172323 QSYS_EXT_CPU_CFG);
23182324
23192325 if (injection == OCELOT_TAG_PREFIX_SHORT)
2320− mtu += OCELOT_SHORT_PREFIX_LEN;
2326+ sdu += OCELOT_SHORT_PREFIX_LEN;
23212327 else if (injection == OCELOT_TAG_PREFIX_LONG)
2322− mtu += OCELOT_LONG_PREFIX_LEN;
2328+ sdu += OCELOT_LONG_PREFIX_LEN;
23232329
2324− ocelot_port_set_mtu(ocelot, cpu, mtu);
2330+ ocelot_port_set_maxlen(ocelot, cpu, sdu);
23252331 }
23262332
23272333 /* CPU port Injection/Extraction configuration */
drivers/net/ethernet/pensando/ionic/ionic_lif.c+4−4
@@ -1688,7 +1688,7 @@ static int ionic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) · 1687 unmodified lines
16881688 if (!(is_zero_ether_addr(mac) || is_valid_ether_addr(mac)))
16891689 return -EINVAL;
16901690
1691− down_read(&ionic->vf_op_lock);
1691+ down_write(&ionic->vf_op_lock);
16921692
16931693 if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) {
16941694 ret = -EINVAL;
@@ -1698,7 +1698,7 @@ static int ionic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) · 3 unmodified lines
16981698 ether_addr_copy(ionic->vfs[vf].macaddr, mac);
16991699 }
17001700
1701− up_read(&ionic->vf_op_lock);
1701+ up_write(&ionic->vf_op_lock);
17021702 return ret;
17031703 }
17041704
@@ -1719,7 +1719,7 @@ static int ionic_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, · 14 unmodified lines
17191719 if (proto != htons(ETH_P_8021Q))
17201720 return -EPROTONOSUPPORT;
17211721
1722− down_read(&ionic->vf_op_lock);
1722+ down_write(&ionic->vf_op_lock);
17231723
17241724 if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) {
17251725 ret = -EINVAL;
@@ -1730,7 +1730,7 @@ static int ionic_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, · 4 unmodified lines
17301730 ionic->vfs[vf].vlanid = vlan;
17311731 }
17321732
1733− up_read(&ionic->vf_op_lock);
1733+ up_write(&ionic->vf_op_lock);
17341734 return ret;
17351735 }
17361736
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c+91−95
@@ -13,25 +13,6 @@ · 12 unmodified lines
1313 #include "rmnet_vnd.h"
1414 #include "rmnet_private.h"
1515
16−/* Locking scheme -
17− * The shared resource which needs to be protected is realdev->rx_handler_data.
18− * For the writer path, this is using rtnl_lock(). The writer paths are
19− * rmnet_newlink(), rmnet_dellink() and rmnet_force_unassociate_device(). These
20− * paths are already called with rtnl_lock() acquired in. There is also an
21− * ASSERT_RTNL() to ensure that we are calling with rtnl acquired. For
22− * dereference here, we will need to use rtnl_dereference(). Dev list writing
23− * needs to happen with rtnl_lock() acquired for netdev_master_upper_dev_link().
24− * For the reader path, the real_dev->rx_handler_data is called in the TX / RX
25− * path. We only need rcu_read_lock() for these scenarios. In these cases,
26− * the rcu_read_lock() is held in __dev_queue_xmit() and
27− * netif_receive_skb_internal(), so readers need to use rcu_dereference_rtnl()
28− * to get the relevant information. For dev list reading, we again acquire
29− * rcu_read_lock() in rmnet_dellink() for netdev_master_upper_dev_get_rcu().
30− * We also use unregister_netdevice_many() to free all rmnet devices in
31− * rmnet_force_unassociate_device() so we dont lose the rtnl_lock() and free in
32− * same context.
33− */
34−
3516 /* Local Definitions and Declarations */
3617
3718 static const struct nla_policy rmnet_policy[IFLA_RMNET_MAX + 1] = {
@@ -51,9 +32,10 @@ rmnet_get_port_rtnl(const struct net_device *real_dev) · 13 unmodified lines
5132 return rtnl_dereference(real_dev->rx_handler_data);
5233 }
5334
54−static int rmnet_unregister_real_device(struct net_device *real_dev,
55− struct rmnet_port *port)
35+static int rmnet_unregister_real_device(struct net_device *real_dev)
5636 {
37+ struct rmnet_port *port = rmnet_get_port_rtnl(real_dev);
38+
5739 if (port->nr_rmnet_devs)
5840 return -EINVAL;
5941
@@ -61,9 +43,6 @@ static int rmnet_unregister_real_device(struct net_device *real_dev, · 1 unmodified line
6143
6244 kfree(port);
6345
64− /* release reference on real_dev */
65− dev_put(real_dev);
66−
6746 netdev_dbg(real_dev, "Removed from rmnet\n");
6847 return 0;
6948 }
@@ -89,9 +68,6 @@ static int rmnet_register_real_device(struct net_device *real_dev) · 19 unmodified lines
8968 return -EBUSY;
9069 }
9170
92− /* hold on to real dev for MAP data */
93− dev_hold(real_dev);
94−
9571 for (entry = 0; entry < RMNET_MAX_LOGICAL_EP; entry++)
9672 INIT_HLIST_HEAD(&port->muxed_ep[entry]);
9773
@@ -99,28 +75,33 @@ static int rmnet_register_real_device(struct net_device *real_dev) · 1 unmodified line
9975 return 0;
10076 }
10177
102−static void rmnet_unregister_bridge(struct net_device *dev,
103− struct rmnet_port *port)
78+static void rmnet_unregister_bridge(struct rmnet_port *port)
10479 {
105− struct rmnet_port *bridge_port;
106− struct net_device *bridge_dev;
80+ struct net_device *bridge_dev, *real_dev, *rmnet_dev;
81+ struct rmnet_port *real_port;
10782
10883 if (port->rmnet_mode != RMNET_EPMODE_BRIDGE)
10984 return;
11085
111− /* bridge slave handling */
86+ rmnet_dev = port->rmnet_dev;
11287 if (!port->nr_rmnet_devs) {
113− bridge_dev = port->bridge_ep;
88+ /* bridge device */
89+ real_dev = port->bridge_ep;
90+ bridge_dev = port->dev;
11491
115− bridge_port = rmnet_get_port_rtnl(bridge_dev);
116− bridge_port->bridge_ep = NULL;
117− bridge_port->rmnet_mode = RMNET_EPMODE_VND;
92+ real_port = rmnet_get_port_rtnl(real_dev);
93+ real_port->bridge_ep = NULL;
94+ real_port->rmnet_mode = RMNET_EPMODE_VND;
11895 } else {
96+ /* real device */
11997 bridge_dev = port->bridge_ep;
12098
121− bridge_port = rmnet_get_port_rtnl(bridge_dev);
122− rmnet_unregister_real_device(bridge_dev, bridge_port);
99+ port->bridge_ep = NULL;
100+ port->rmnet_mode = RMNET_EPMODE_VND;
123101 }
102+
103+ netdev_upper_dev_unlink(bridge_dev, rmnet_dev);
104+ rmnet_unregister_real_device(bridge_dev);
124105 }
125106
126107 static int rmnet_newlink(struct net *src_net, struct net_device *dev,
@@ -135,6 +116,11 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev, · 8 unmodified lines
135116 int err = 0;
136117 u16 mux_id;
137118
119+ if (!tb[IFLA_LINK]) {
120+ NL_SET_ERR_MSG_MOD(extack, "link not specified");
121+ return -EINVAL;
122+ }
123+
138124 real_dev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
139125 if (!real_dev || !dev)
140126 return -ENODEV;
@@ -157,7 +143,12 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev, · 16 unmodified lines
157143 if (err)
158144 goto err1;
159145
146+ err = netdev_upper_dev_link(real_dev, dev, extack);
147+ if (err < 0)
148+ goto err2;
149+
160150 port->rmnet_mode = mode;
151+ port->rmnet_dev = dev;
161152
162153 hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]);
163154
@@ -173,8 +164,11 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev, · 9 unmodified lines
173164
174165 return 0;
175166
167+err2:
168+ unregister_netdevice(dev);
169+ rmnet_vnd_dellink(mux_id, port, ep);
176170 err1:
177− rmnet_unregister_real_device(real_dev, port);
171+ rmnet_unregister_real_device(real_dev);
178172 err0:
179173 kfree(ep);
180174 return err;
@@ -183,77 +177,74 @@ err0: · 2 unmodified lines
183177 static void rmnet_dellink(struct net_device *dev, struct list_head *head)
184178 {
185179 struct rmnet_priv *priv = netdev_priv(dev);
186− struct net_device *real_dev;
180+ struct net_device *real_dev, *bridge_dev;
181+ struct rmnet_port *real_port, *bridge_port;
187182 struct rmnet_endpoint *ep;
188− struct rmnet_port *port;
189− u8 mux_id;
183+ u8 mux_id = priv->mux_id;
190184
191185 real_dev = priv->real_dev;
192186
193− if (!real_dev || !rmnet_is_real_dev_registered(real_dev))
187+ if (!rmnet_is_real_dev_registered(real_dev))
194188 return;
195189
196− port = rmnet_get_port_rtnl(real_dev);
197−
198− mux_id = rmnet_vnd_get_mux(dev);
190+ real_port = rmnet_get_port_rtnl(real_dev);
191+ bridge_dev = real_port->bridge_ep;
192+ if (bridge_dev) {
193+ bridge_port = rmnet_get_port_rtnl(bridge_dev);
194+ rmnet_unregister_bridge(bridge_port);
195+ }
199196
200− ep = rmnet_get_endpoint(port, mux_id);
197+ ep = rmnet_get_endpoint(real_port, mux_id);
201198 if (ep) {
202199 hlist_del_init_rcu(&ep->hlnode);
203− rmnet_unregister_bridge(dev, port);
204− rmnet_vnd_dellink(mux_id, port, ep);
200+ rmnet_vnd_dellink(mux_id, real_port, ep);
205201 kfree(ep);
206202 }
207− rmnet_unregister_real_device(real_dev, port);
208203
204+ netdev_upper_dev_unlink(real_dev, dev);
205+ rmnet_unregister_real_device(real_dev);
209206 unregister_netdevice_queue(dev, head);
210207 }
211208
212−static void rmnet_force_unassociate_device(struct net_device *dev)
209+static void rmnet_force_unassociate_device(struct net_device *real_dev)
213210 {
214− struct net_device *real_dev = dev;
215211 struct hlist_node *tmp_ep;
216212 struct rmnet_endpoint *ep;
217213 struct rmnet_port *port;
218214 unsigned long bkt_ep;
219215 LIST_HEAD(list);
220216
221− if (!rmnet_is_real_dev_registered(real_dev))
222− return;
223−
224− ASSERT_RTNL();
225−
226− port = rmnet_get_port_rtnl(dev);
227−
228− rcu_read_lock();
229− rmnet_unregister_bridge(dev, port);
230−
231− hash_for_each_safe(port->muxed_ep, bkt_ep, tmp_ep, ep, hlnode) {
232− unregister_netdevice_queue(ep->egress_dev, &list);
233− rmnet_vnd_dellink(ep->mux_id, port, ep);
217+ port = rmnet_get_port_rtnl(real_dev);
234218
235− hlist_del_init_rcu(&ep->hlnode);
236− kfree(ep);
219+ if (port->nr_rmnet_devs) {
220+ /* real device */
221+ rmnet_unregister_bridge(port);
222+ hash_for_each_safe(port->muxed_ep, bkt_ep, tmp_ep, ep, hlnode) {
223+ unregister_netdevice_queue(ep->egress_dev, &list);
224+ netdev_upper_dev_unlink(real_dev, ep->egress_dev);
225+ rmnet_vnd_dellink(ep->mux_id, port, ep);
226+ hlist_del_init_rcu(&ep->hlnode);
227+ kfree(ep);
228+ }
229+ rmnet_unregister_real_device(real_dev);
230+ unregister_netdevice_many(&list);
231+ } else {
232+ rmnet_unregister_bridge(port);
237233 }
238−
239− rcu_read_unlock();
240− unregister_netdevice_many(&list);
241−
242− rmnet_unregister_real_device(real_dev, port);
243234 }
244235
245236 static int rmnet_config_notify_cb(struct notifier_block *nb,
246237 unsigned long event, void *data)
247238 {
248− struct net_device *dev = netdev_notifier_info_to_dev(data);
239+ struct net_device *real_dev = netdev_notifier_info_to_dev(data);
249240
250− if (!dev)
241+ if (!rmnet_is_real_dev_registered(real_dev))
251242 return NOTIFY_DONE;
252243
253244 switch (event) {
254245 case NETDEV_UNREGISTER:
255− netdev_dbg(dev, "Kernel unregister\n");
256− rmnet_force_unassociate_device(dev);
246+ netdev_dbg(real_dev, "Kernel unregister\n");
247+ rmnet_force_unassociate_device(real_dev);
257248 break;
258249
259250 default:
@@ -295,16 +286,18 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[], · 35 unmodified lines
295286 if (!dev)
296287 return -ENODEV;
297288
298− real_dev = __dev_get_by_index(dev_net(dev),
299− nla_get_u32(tb[IFLA_LINK]));
300−
301− if (!real_dev || !rmnet_is_real_dev_registered(real_dev))
289+ real_dev = priv->real_dev;
290+ if (!rmnet_is_real_dev_registered(real_dev))
302291 return -ENODEV;
303292
304293 port = rmnet_get_port_rtnl(real_dev);
305294
306295 if (data[IFLA_RMNET_MUX_ID]) {
307296 mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
297+ if (rmnet_get_endpoint(port, mux_id)) {
298+ NL_SET_ERR_MSG_MOD(extack, "MUX ID already exists");
299+ return -EINVAL;
300+ }
308301 ep = rmnet_get_endpoint(port, priv->mux_id);
309302 if (!ep)
310303 return -ENODEV;
@@ -379,11 +372,10 @@ struct rtnl_link_ops rmnet_link_ops __read_mostly = { · 68 unmodified lines
379372 .fill_info = rmnet_fill_info,
380373 };
381374
382−/* Needs either rcu_read_lock() or rtnl lock */
383−struct rmnet_port *rmnet_get_port(struct net_device *real_dev)
375+struct rmnet_port *rmnet_get_port_rcu(struct net_device *real_dev)
384376 {
385377 if (rmnet_is_real_dev_registered(real_dev))
386− return rcu_dereference_rtnl(real_dev->rx_handler_data);
378+ return rcu_dereference_bh(real_dev->rx_handler_data);
387379 else
388380 return NULL;
389381 }
@@ -409,7 +401,7 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, · 19 unmodified lines
409401 struct rmnet_port *port, *slave_port;
410402 int err;
411403
412− port = rmnet_get_port(real_dev);
404+ port = rmnet_get_port_rtnl(real_dev);
413405
414406 /* If there is more than one rmnet dev attached, its probably being
415407 * used for muxing. Skip the briding in that case
@@ -417,6 +409,9 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, · 1 unmodified line
417409 if (port->nr_rmnet_devs > 1)
418410 return -EINVAL;
419411
412+ if (port->rmnet_mode != RMNET_EPMODE_VND)
413+ return -EINVAL;
414+
420415 if (rmnet_is_real_dev_registered(slave_dev))
421416 return -EBUSY;
422417
@@ -424,9 +419,17 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, · 1 unmodified line
424419 if (err)
425420 return -EBUSY;
426421
427− slave_port = rmnet_get_port(slave_dev);
422+ err = netdev_master_upper_dev_link(slave_dev, rmnet_dev, NULL, NULL,
423+ extack);
424+ if (err) {
425+ rmnet_unregister_real_device(slave_dev);
426+ return err;
427+ }
428+
429+ slave_port = rmnet_get_port_rtnl(slave_dev);
428430 slave_port->rmnet_mode = RMNET_EPMODE_BRIDGE;
429431 slave_port->bridge_ep = real_dev;
432+ slave_port->rmnet_dev = rmnet_dev;
430433
431434 port->rmnet_mode = RMNET_EPMODE_BRIDGE;
432435 port->bridge_ep = slave_dev;
@@ -438,16 +441,9 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, · 5 unmodified lines
438441 int rmnet_del_bridge(struct net_device *rmnet_dev,
439442 struct net_device *slave_dev)
440443 {
441− struct rmnet_priv *priv = netdev_priv(rmnet_dev);
442− struct net_device *real_dev = priv->real_dev;
443− struct rmnet_port *port, *slave_port;
444+ struct rmnet_port *port = rmnet_get_port_rtnl(slave_dev);
444445
445− port = rmnet_get_port(real_dev);
446− port->rmnet_mode = RMNET_EPMODE_VND;
447− port->bridge_ep = NULL;
448−
449− slave_port = rmnet_get_port(slave_dev);
450− rmnet_unregister_real_device(slave_dev, slave_port);
446+ rmnet_unregister_bridge(port);
451447
452448 netdev_dbg(slave_dev, "removed from rmnet as slave\n");
453449 return 0;
@@ -473,8 +469,8 @@ static int __init rmnet_init(void) · 19 unmodified lines
473469
474470 static void __exit rmnet_exit(void)
475471 {
476− unregister_netdevice_notifier(&rmnet_dev_notifier);
477472 rtnl_link_unregister(&rmnet_link_ops);
473+ unregister_netdevice_notifier(&rmnet_dev_notifier);
478474 }
479475
480476 module_init(rmnet_init)
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h+2−1
@@ -28,6 +28,7 @@ struct rmnet_port { · 27 unmodified lines
2828 u8 rmnet_mode;
2929 struct hlist_head muxed_ep[RMNET_MAX_LOGICAL_EP];
3030 struct net_device *bridge_ep;
31+ struct net_device *rmnet_dev;
3132 };
3233
3334 extern struct rtnl_link_ops rmnet_link_ops;
@@ -65,7 +66,7 @@ struct rmnet_priv { · 31 unmodified lines
6566 struct rmnet_priv_stats stats;
6667 };
6768
68−struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
69+struct rmnet_port *rmnet_get_port_rcu(struct net_device *real_dev);
6970 struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
7071 int rmnet_add_bridge(struct net_device *rmnet_dev,
7172 struct net_device *slave_dev,
drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c+5−2
@@ -159,6 +159,9 @@ static int rmnet_map_egress_handler(struct sk_buff *skb, · 158 unmodified lines
159159 static void
160160 rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev)
161161 {
162+ if (skb_mac_header_was_set(skb))
163+ skb_push(skb, skb->mac_len);
164+
162165 if (bridge_dev) {
163166 skb->dev = bridge_dev;
164167 dev_queue_xmit(skb);
@@ -184,7 +187,7 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb) · 19 unmodified lines
184187 return RX_HANDLER_PASS;
185188
186189 dev = skb->dev;
187− port = rmnet_get_port(dev);
190+ port = rmnet_get_port_rcu(dev);
188191
189192 switch (port->rmnet_mode) {
190193 case RMNET_EPMODE_VND:
@@ -217,7 +220,7 @@ void rmnet_egress_handler(struct sk_buff *skb) · 26 unmodified lines
217220 skb->dev = priv->real_dev;
218221 mux_id = priv->mux_id;
219222
220− port = rmnet_get_port(skb->dev);
223+ port = rmnet_get_port_rcu(skb->dev);
221224 if (!port)
222225 goto drop;
223226
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c+0−8
@@ -266,14 +266,6 @@ int rmnet_vnd_dellink(u8 id, struct rmnet_port *port, · 265 unmodified lines
266266 return 0;
267267 }
268268
269−u8 rmnet_vnd_get_mux(struct net_device *rmnet_dev)
270−{
271− struct rmnet_priv *priv;
272−
273− priv = netdev_priv(rmnet_dev);
274− return priv->mux_id;
275−}
276−
277269 int rmnet_vnd_do_flow_control(struct net_device *rmnet_dev, int enable)
278270 {
279271 netdev_dbg(rmnet_dev, "Setting VND TX queue state to %d\n", enable);
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.h+0−1
@@ -16,6 +16,5 @@ int rmnet_vnd_dellink(u8 id, struct rmnet_port *port, · 15 unmodified lines
1616 struct rmnet_endpoint *ep);
1717 void rmnet_vnd_rx_fixup(struct sk_buff *skb, struct net_device *dev);
1818 void rmnet_vnd_tx_fixup(struct sk_buff *skb, struct net_device *dev);
19−u8 rmnet_vnd_get_mux(struct net_device *rmnet_dev);
2019 void rmnet_vnd_setup(struct net_device *dev);
2120 #endif /* _RMNET_VND_H_ */
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c+1−1
@@ -2277,7 +2277,7 @@ static int __init sxgbe_cmdline_opt(char *str) · 2276 unmodified lines
22772277 if (!str || !*str)
22782278 return -EINVAL;
22792279 while ((opt = strsep(&str, ",")) != NULL) {
2280− if (!strncmp(opt, "eee_timer:", 6)) {
2280+ if (!strncmp(opt, "eee_timer:", 10)) {
22812281 if (kstrtoint(opt + 10, 0, &eee_timer))
22822282 goto err;
22832283 }
drivers/net/ethernet/sfc/ef10.c+17−15
@@ -2853,11 +2853,24 @@ efx_ef10_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) · 2852 unmodified lines
28532853 }
28542854
28552855 /* Transmit timestamps are only available for 8XXX series. They result
2856− * in three events per packet. These occur in order, and are:
2857− * - the normal completion event
2856+ * in up to three events per packet. These occur in order, and are:
2857+ * - the normal completion event (may be omitted)
28582858 * - the low part of the timestamp
28592859 * - the high part of the timestamp
28602860 *
2861+ * It's possible for multiple completion events to appear before the
2862+ * corresponding timestamps. So we can for example get:
2863+ * COMP N
2864+ * COMP N+1
2865+ * TS_LO N
2866+ * TS_HI N
2867+ * TS_LO N+1
2868+ * TS_HI N+1
2869+ *
2870+ * In addition it's also possible for the adjacent completions to be
2871+ * merged, so we may not see COMP N above. As such, the completion
2872+ * events are not very useful here.
2873+ *
28612874 * Each part of the timestamp is itself split across two 16 bit
28622875 * fields in the event.
28632876 */
@@ -2865,17 +2878,7 @@ efx_ef10_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) · 1 unmodified line
28652878
28662879 switch (tx_ev_type) {
28672880 case TX_TIMESTAMP_EVENT_TX_EV_COMPLETION:
2868− /* In case of Queue flush or FLR, we might have received
2869− * the previous TX completion event but not the Timestamp
2870− * events.
2871− */
2872− if (tx_queue->completed_desc_ptr != tx_queue->ptr_mask)
2873− efx_xmit_done(tx_queue, tx_queue->completed_desc_ptr);
2874−
2875− tx_ev_desc_ptr = EFX_QWORD_FIELD(*event,
2876− ESF_DZ_TX_DESCR_INDX);
2877− tx_queue->completed_desc_ptr =
2878− tx_ev_desc_ptr & tx_queue->ptr_mask;
2881+ /* Ignore this event - see above. */
28792882 break;
28802883
28812884 case TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_LO:
@@ -2887,8 +2890,7 @@ efx_ef10_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) · 5 unmodified lines
28872890 ts_part = efx_ef10_extract_event_ts(event);
28882891 tx_queue->completed_timestamp_major = ts_part;
28892892
2890− efx_xmit_done(tx_queue, tx_queue->completed_desc_ptr);
2891− tx_queue->completed_desc_ptr = tx_queue->ptr_mask;
2893+ efx_xmit_done_single(tx_queue);
28922894 break;
28932895
28942896 default:
drivers/net/ethernet/sfc/efx.h+1−0
@@ -20,6 +20,7 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, · 19 unmodified lines
2020 struct net_device *net_dev);
2121 netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
2222 void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
23+void efx_xmit_done_single(struct efx_tx_queue *tx_queue);
2324 int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
2425 void *type_data);
2526 extern unsigned int efx_piobuf_size;
drivers/net/ethernet/sfc/efx_channels.c+1−0
@@ -583,6 +583,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel) · 582 unmodified lines
583583 if (tx_queue->channel)
584584 tx_queue->channel = channel;
585585 tx_queue->buffer = NULL;
586+ tx_queue->cb_page = NULL;
586587 memset(&tx_queue->txd, 0, sizeof(tx_queue->txd));
587588 }
588589
drivers/net/ethernet/sfc/net_driver.h+0−3
@@ -208,8 +208,6 @@ struct efx_tx_buffer { · 207 unmodified lines
208208 * avoid cache-line ping-pong between the xmit path and the
209209 * completion path.
210210 * @merge_events: Number of TX merged completion events
211− * @completed_desc_ptr: Most recent completed pointer - only used with
212− * timestamping.
213211 * @completed_timestamp_major: Top part of the most recent tx timestamp.
214212 * @completed_timestamp_minor: Low part of the most recent tx timestamp.
215213 * @insert_count: Current insert pointer
@@ -269,7 +267,6 @@ struct efx_tx_queue { · 53 unmodified lines
269267 unsigned int merge_events;
270268 unsigned int bytes_compl;
271269 unsigned int pkts_compl;
272− unsigned int completed_desc_ptr;
273270 u32 completed_timestamp_major;
274271 u32 completed_timestamp_minor;
275272
drivers/net/ethernet/sfc/ptp.c+35−3
@@ -560,13 +560,45 @@ efx_ptp_mac_nic_to_ktime_correction(struct efx_nic *efx, · 559 unmodified lines
560560 u32 nic_major, u32 nic_minor,
561561 s32 correction)
562562 {
563+ u32 sync_timestamp;
563564 ktime_t kt = { 0 };
565+ s16 delta;
564566
565567 if (!(nic_major & 0x80000000)) {
566568 WARN_ON_ONCE(nic_major >> 16);
567− /* Use the top bits from the latest sync event. */
568− nic_major &= 0xffff;
569− nic_major |= (last_sync_timestamp_major(efx) & 0xffff0000);
569+
570+ /* Medford provides 48 bits of timestamp, so we must get the top
571+ * 16 bits from the timesync event state.
572+ *
573+ * We only have the lower 16 bits of the time now, but we do
574+ * have a full resolution timestamp at some point in past. As
575+ * long as the difference between the (real) now and the sync
576+ * is less than 2^15, then we can reconstruct the difference
577+ * between those two numbers using only the lower 16 bits of
578+ * each.
579+ *
580+ * Put another way
581+ *
582+ * a - b = ((a mod k) - b) mod k
583+ *
584+ * when -k/2 < (a-b) < k/2. In our case k is 2^16. We know
585+ * (a mod k) and b, so can calculate the delta, a - b.
586+ *
587+ */
588+ sync_timestamp = last_sync_timestamp_major(efx);
589+
590+ /* Because delta is s16 this does an implicit mask down to
591+ * 16 bits which is what we need, assuming
592+ * MEDFORD_TX_SECS_EVENT_BITS is 16. delta is signed so that
593+ * we can deal with the (unlikely) case of sync timestamps
594+ * arriving from the future.
595+ */
596+ delta = nic_major - sync_timestamp;
597+
598+ /* Recover the fully specified time now, by applying the offset
599+ * to the (fully specified) sync time.
600+ */
601+ nic_major = sync_timestamp + delta;
570602
571603 kt = ptp->nic_to_kernel_time(nic_major, nic_minor,
572604 correction);
drivers/net/ethernet/sfc/tx.c+38−0
@@ -535,6 +535,44 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, · 534 unmodified lines
535535 return efx_enqueue_skb(tx_queue, skb);
536536 }
537537
538+void efx_xmit_done_single(struct efx_tx_queue *tx_queue)
539+{
540+ unsigned int pkts_compl = 0, bytes_compl = 0;
541+ unsigned int read_ptr;
542+ bool finished = false;
543+
544+ read_ptr = tx_queue->read_count & tx_queue->ptr_mask;
545+
546+ while (!finished) {
547+ struct efx_tx_buffer *buffer = &tx_queue->buffer[read_ptr];
548+
549+ if (!efx_tx_buffer_in_use(buffer)) {
550+ struct efx_nic *efx = tx_queue->efx;
551+
552+ netif_err(efx, hw, efx->net_dev,
553+ "TX queue %d spurious single TX completion\n",
554+ tx_queue->queue);
555+ efx_schedule_reset(efx, RESET_TYPE_TX_SKIP);
556+ return;
557+ }
558+
559+ /* Need to check the flag before dequeueing. */
560+ if (buffer->flags & EFX_TX_BUF_SKB)
561+ finished = true;
562+ efx_dequeue_buffer(tx_queue, buffer, &pkts_compl, &bytes_compl);
563+
564+ ++tx_queue->read_count;
565+ read_ptr = tx_queue->read_count & tx_queue->ptr_mask;
566+ }
567+
568+ tx_queue->pkts_compl += pkts_compl;
569+ tx_queue->bytes_compl += bytes_compl;
570+
571+ EFX_WARN_ON_PARANOID(pkts_compl != 1);
572+
573+ efx_xmit_done_check_empty(tx_queue);
574+}
575+
538576 void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue)
539577 {
540578 struct efx_nic *efx = tx_queue->efx;
drivers/net/ethernet/sfc/tx_common.c+16−13
@@ -80,7 +80,6 @@ void efx_init_tx_queue(struct efx_tx_queue *tx_queue) · 79 unmodified lines
8080 tx_queue->xmit_more_available = false;
8181 tx_queue->timestamping = (efx_ptp_use_mac_tx_timestamps(efx) &&
8282 tx_queue->channel == efx_ptp_channel(efx));
83− tx_queue->completed_desc_ptr = tx_queue->ptr_mask;
8483 tx_queue->completed_timestamp_major = 0;
8584 tx_queue->completed_timestamp_minor = 0;
8685
@@ -210,10 +209,9 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, · 123 unmodified lines
210209 while (read_ptr != stop_index) {
211210 struct efx_tx_buffer *buffer = &tx_queue->buffer[read_ptr];
212211
213− if (!(buffer->flags & EFX_TX_BUF_OPTION) &&
214− unlikely(buffer->len == 0)) {
212+ if (!efx_tx_buffer_in_use(buffer)) {
215213 netif_err(efx, tx_err, efx->net_dev,
216− "TX queue %d spurious TX completion id %x\n",
214+ "TX queue %d spurious TX completion id %d\n",
217215 tx_queue->queue, read_ptr);
218216 efx_schedule_reset(efx, RESET_TYPE_TX_SKIP);
219217 return;
@@ -226,6 +224,19 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, · 6 unmodified lines
226224 }
227225 }
228226
227+void efx_xmit_done_check_empty(struct efx_tx_queue *tx_queue)
228+{
229+ if ((int)(tx_queue->read_count - tx_queue->old_write_count) >= 0) {
230+ tx_queue->old_write_count = READ_ONCE(tx_queue->write_count);
231+ if (tx_queue->read_count == tx_queue->old_write_count) {
232+ /* Ensure that read_count is flushed. */
233+ smp_mb();
234+ tx_queue->empty_read_count =
235+ tx_queue->read_count | EFX_EMPTY_COUNT_VALID;
236+ }
237+ }
238+}
239+
229240 void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
230241 {
231242 unsigned int fill_level, pkts_compl = 0, bytes_compl = 0;
@@ -256,15 +267,7 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) · 24 unmodified lines
256267 netif_tx_wake_queue(tx_queue->core_txq);
257268 }
258269
259− /* Check whether the hardware queue is now empty */
260− if ((int)(tx_queue->read_count - tx_queue->old_write_count) >= 0) {
261− tx_queue->old_write_count = READ_ONCE(tx_queue->write_count);
262− if (tx_queue->read_count == tx_queue->old_write_count) {
263− smp_mb();
264− tx_queue->empty_read_count =
265− tx_queue->read_count | EFX_EMPTY_COUNT_VALID;
266− }
267− }
270+ efx_xmit_done_check_empty(tx_queue);
268271 }
269272
270273 /* Remove buffers put into a tx_queue for the current packet.
drivers/net/ethernet/sfc/tx_common.h+6−0
@@ -21,6 +21,12 @@ void efx_dequeue_buffer(struct efx_tx_queue *tx_queue, · 20 unmodified lines
2121 unsigned int *pkts_compl,
2222 unsigned int *bytes_compl);
2323
24+static inline bool efx_tx_buffer_in_use(struct efx_tx_buffer *buffer)
25+{
26+ return buffer->len || (buffer->flags & EFX_TX_BUF_OPTION);
27+}
28+
29+void efx_xmit_done_check_empty(struct efx_tx_queue *tx_queue);
2430 void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
2531
2632 void efx_enqueue_unwind(struct efx_tx_queue *tx_queue,
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c+2−1
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 static void dwmac1000_core_init(struct mac_device_info *hw,
2525 struct net_device *dev)
2626 {
27+ struct stmmac_priv *priv = netdev_priv(dev);
2728 void __iomem *ioaddr = hw->pcsr;
2829 u32 value = readl(ioaddr + GMAC_CONTROL);
2930 int mtu = dev->mtu;
@@ -35,7 +36,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw, · 5 unmodified lines
3536 * Broadcom tags can look like invalid LLC/SNAP packets and cause the
3637 * hardware to truncate packets on reception.
3738 */
38− if (netdev_uses_dsa(dev))
39+ if (netdev_uses_dsa(dev) || !priv->plat->enh_desc)
3940 value &= ~GMAC_CONTROL_ACS;
4041
4142 if (mtu > 1500)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+8−5
@@ -4405,6 +4405,8 @@ static void stmmac_init_fs(struct net_device *dev) · 4404 unmodified lines
44054405 {
44064406 struct stmmac_priv *priv = netdev_priv(dev);
44074407
4408+ rtnl_lock();
4409+
44084410 /* Create per netdev entries */
44094411 priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir);
44104412
@@ -4416,14 +4418,13 @@ static void stmmac_init_fs(struct net_device *dev) · 5 unmodified lines
44164418 debugfs_create_file("dma_cap", 0444, priv->dbgfs_dir, dev,
44174419 &stmmac_dma_cap_fops);
44184420
4419− register_netdevice_notifier(&stmmac_notifier);
4421+ rtnl_unlock();
44204422 }
44214423
44224424 static void stmmac_exit_fs(struct net_device *dev)
44234425 {
44244426 struct stmmac_priv *priv = netdev_priv(dev);
44254427
4426− unregister_netdevice_notifier(&stmmac_notifier);
44274428 debugfs_remove_recursive(priv->dbgfs_dir);
44284429 }
44294430 #endif /* CONFIG_DEBUG_FS */
@@ -4940,14 +4941,14 @@ int stmmac_dvr_remove(struct device *dev) · 510 unmodified lines
49404941
49414942 netdev_info(priv->dev, "%s: removing driver", __func__);
49424943
4943−#ifdef CONFIG_DEBUG_FS
4944− stmmac_exit_fs(ndev);
4945−#endif
49464944 stmmac_stop_all_dma(priv);
49474945
49484946 stmmac_mac_set(priv, priv->ioaddr, false);
49494947 netif_carrier_off(ndev);
49504948 unregister_netdev(ndev);
4949+#ifdef CONFIG_DEBUG_FS
4950+ stmmac_exit_fs(ndev);
4951+#endif
49514952 phylink_destroy(priv->phylink);
49524953 if (priv->plat->stmmac_rst)
49534954 reset_control_assert(priv->plat->stmmac_rst);
@@ -5166,6 +5167,7 @@ static int __init stmmac_init(void) · 212 unmodified lines
51665167 /* Create debugfs main directory if it doesn't exist yet */
51675168 if (!stmmac_fs_dir)
51685169 stmmac_fs_dir = debugfs_create_dir(STMMAC_RESOURCE_NAME, NULL);
5170+ register_netdevice_notifier(&stmmac_notifier);
51695171 #endif
51705172
51715173 return 0;
@@ -5174,6 +5176,7 @@ static int __init stmmac_init(void) · 2 unmodified lines
51745176 static void __exit stmmac_exit(void)
51755177 {
51765178 #ifdef CONFIG_DEBUG_FS
5179+ unregister_netdevice_notifier(&stmmac_notifier);
51775180 debugfs_remove_recursive(stmmac_fs_dir);
51785181 #endif
51795182 }
drivers/net/ethernet/xilinx/ll_temac.h+4−0
@@ -375,10 +375,14 @@ struct temac_local { · 374 unmodified lines
375375 int tx_bd_next;
376376 int tx_bd_tail;
377377 int rx_bd_ci;
378+ int rx_bd_tail;
378379
379380 /* DMA channel control setup */
380381 u32 tx_chnl_ctrl;
381382 u32 rx_chnl_ctrl;
383+ u8 coalesce_count_rx;
384+
385+ struct delayed_work restart_work;
382386 };
383387
384388 /* Wrappers for temac_ior()/temac_iow() function pointers above */
drivers/net/ethernet/xilinx/ll_temac_main.c+171−38
@@ -51,6 +51,7 @@ · 50 unmodified lines
5151 #include <linux/ip.h>
5252 #include <linux/slab.h>
5353 #include <linux/interrupt.h>
54+#include <linux/workqueue.h>
5455 #include <linux/dma-mapping.h>
5556 #include <linux/processor.h>
5657 #include <linux/platform_data/xilinx-ll-temac.h>
@@ -367,6 +368,8 @@ static int temac_dma_bd_init(struct net_device *ndev) · 310 unmodified lines
367368 skb_dma_addr = dma_map_single(ndev->dev.parent, skb->data,
368369 XTE_MAX_JUMBO_FRAME_SIZE,
369370 DMA_FROM_DEVICE);
371+ if (dma_mapping_error(ndev->dev.parent, skb_dma_addr))
372+ goto out;
370373 lp->rx_bd_v[i].phys = cpu_to_be32(skb_dma_addr);
371374 lp->rx_bd_v[i].len = cpu_to_be32(XTE_MAX_JUMBO_FRAME_SIZE);
372375 lp->rx_bd_v[i].app0 = cpu_to_be32(STS_CTRL_APP0_IRQONEND);
@@ -387,12 +390,13 @@ static int temac_dma_bd_init(struct net_device *ndev) · 14 unmodified lines
387390 lp->tx_bd_next = 0;
388391 lp->tx_bd_tail = 0;
389392 lp->rx_bd_ci = 0;
393+ lp->rx_bd_tail = RX_BD_NUM - 1;
390394
391395 /* Enable RX DMA transfers */
392396 wmb();
393397 lp->dma_out(lp, RX_CURDESC_PTR, lp->rx_bd_p);
394398 lp->dma_out(lp, RX_TAILDESC_PTR,
395− lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
399+ lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * lp->rx_bd_tail));
396400
397401 /* Prepare for TX DMA transfer */
398402 lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p);
@@ -788,6 +792,9 @@ static void temac_start_xmit_done(struct net_device *ndev) · 389 unmodified lines
788792 stat = be32_to_cpu(cur_p->app0);
789793 }
790794
795+ /* Matches barrier in temac_start_xmit */
796+ smp_mb();
797+
791798 netif_wake_queue(ndev);
792799 }
793800
@@ -830,9 +837,19 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 36 unmodified lines
830837 cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
831838
832839 if (temac_check_tx_bd_space(lp, num_frag + 1)) {
833− if (!netif_queue_stopped(ndev))
834− netif_stop_queue(ndev);
835− return NETDEV_TX_BUSY;
840+ if (netif_queue_stopped(ndev))
841+ return NETDEV_TX_BUSY;
842+
843+ netif_stop_queue(ndev);
844+
845+ /* Matches barrier in temac_start_xmit_done */
846+ smp_mb();
847+
848+ /* Space might have just been freed - check again */
849+ if (temac_check_tx_bd_space(lp, num_frag))
850+ return NETDEV_TX_BUSY;
851+
852+ netif_wake_queue(ndev);
836853 }
837854
838855 cur_p->app0 = 0;
@@ -850,12 +867,16 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 11 unmodified lines
850867 skb_dma_addr = dma_map_single(ndev->dev.parent, skb->data,
851868 skb_headlen(skb), DMA_TO_DEVICE);
852869 cur_p->len = cpu_to_be32(skb_headlen(skb));
870+ if (WARN_ON_ONCE(dma_mapping_error(ndev->dev.parent, skb_dma_addr))) {
871+ dev_kfree_skb_any(skb);
872+ ndev->stats.tx_dropped++;
873+ return NETDEV_TX_OK;
874+ }
853875 cur_p->phys = cpu_to_be32(skb_dma_addr);
854876 ptr_to_txbd((void *)skb, cur_p);
855877
856878 for (ii = 0; ii < num_frag; ii++) {
857− lp->tx_bd_tail++;
858− if (lp->tx_bd_tail >= TX_BD_NUM)
879+ if (++lp->tx_bd_tail >= TX_BD_NUM)
859880 lp->tx_bd_tail = 0;
860881
861882 cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
@@ -863,6 +884,27 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 1 unmodified line
863884 skb_frag_address(frag),
864885 skb_frag_size(frag),
865886 DMA_TO_DEVICE);
887+ if (dma_mapping_error(ndev->dev.parent, skb_dma_addr)) {
888+ if (--lp->tx_bd_tail < 0)
889+ lp->tx_bd_tail = TX_BD_NUM - 1;
890+ cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
891+ while (--ii >= 0) {
892+ --frag;
893+ dma_unmap_single(ndev->dev.parent,
894+ be32_to_cpu(cur_p->phys),
895+ skb_frag_size(frag),
896+ DMA_TO_DEVICE);
897+ if (--lp->tx_bd_tail < 0)
898+ lp->tx_bd_tail = TX_BD_NUM - 1;
899+ cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
900+ }
901+ dma_unmap_single(ndev->dev.parent,
902+ be32_to_cpu(cur_p->phys),
903+ skb_headlen(skb), DMA_TO_DEVICE);
904+ dev_kfree_skb_any(skb);
905+ ndev->stats.tx_dropped++;
906+ return NETDEV_TX_OK;
907+ }
866908 cur_p->phys = cpu_to_be32(skb_dma_addr);
867909 cur_p->len = cpu_to_be32(skb_frag_size(frag));
868910 cur_p->app0 = 0;
@@ -884,31 +926,56 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 15 unmodified lines
884926 return NETDEV_TX_OK;
885927 }
886928
929+static int ll_temac_recv_buffers_available(struct temac_local *lp)
930+{
931+ int available;
932+
933+ if (!lp->rx_skb[lp->rx_bd_ci])
934+ return 0;
935+ available = 1 + lp->rx_bd_tail - lp->rx_bd_ci;
936+ if (available <= 0)
937+ available += RX_BD_NUM;
938+ return available;
939+}
887940
888941 static void ll_temac_recv(struct net_device *ndev)
889942 {
890943 struct temac_local *lp = netdev_priv(ndev);
891− struct sk_buff *skb, *new_skb;
892− unsigned int bdstat;
893− struct cdmac_bd *cur_p;
894− dma_addr_t tail_p, skb_dma_addr;
895− int length;
896944 unsigned long flags;
945+ int rx_bd;
946+ bool update_tail = false;
897947
898948 spin_lock_irqsave(&lp->rx_lock, flags);
899949
900− tail_p = lp->rx_bd_p + sizeof(*lp->rx_bd_v) * lp->rx_bd_ci;
901− cur_p = &lp->rx_bd_v[lp->rx_bd_ci];
902−
903− bdstat = be32_to_cpu(cur_p->app0);
904− while ((bdstat & STS_CTRL_APP0_CMPLT)) {
950+ /* Process all received buffers, passing them on network
951+ * stack. After this, the buffer descriptors will be in an
952+ * un-allocated stage, where no skb is allocated for it, and
953+ * they are therefore not available for TEMAC/DMA.
954+ */
955+ do {
956+ struct cdmac_bd *bd = &lp->rx_bd_v[lp->rx_bd_ci];
957+ struct sk_buff *skb = lp->rx_skb[lp->rx_bd_ci];
958+ unsigned int bdstat = be32_to_cpu(bd->app0);
959+ int length;
960+
961+ /* While this should not normally happen, we can end
962+ * here when GFP_ATOMIC allocations fail, and we
963+ * therefore have un-allocated buffers.
964+ */
965+ if (!skb)
966+ break;
905967
906− skb = lp->rx_skb[lp->rx_bd_ci];
907− length = be32_to_cpu(cur_p->app4) & 0x3FFF;
968+ /* Loop over all completed buffer descriptors */
969+ if (!(bdstat & STS_CTRL_APP0_CMPLT))
970+ break;
908971
909− dma_unmap_single(ndev->dev.parent, be32_to_cpu(cur_p->phys),
972+ dma_unmap_single(ndev->dev.parent, be32_to_cpu(bd->phys),
910973 XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
974+ /* The buffer is not valid for DMA anymore */
975+ bd->phys = 0;
976+ bd->len = 0;
911977
978+ length = be32_to_cpu(bd->app4) & 0x3FFF;
912979 skb_put(skb, length);
913980 skb->protocol = eth_type_trans(skb, ndev);
914981 skb_checksum_none_assert(skb);
@@ -923,43 +990,102 @@ static void ll_temac_recv(struct net_device *ndev) · 8 unmodified lines
923990 * (back) for proper IP checksum byte order
924991 * (be16).
925992 */
926− skb->csum = htons(be32_to_cpu(cur_p->app3) & 0xFFFF);
993+ skb->csum = htons(be32_to_cpu(bd->app3) & 0xFFFF);
927994 skb->ip_summed = CHECKSUM_COMPLETE;
928995 }
929996
930997 if (!skb_defer_rx_timestamp(skb))
931998 netif_rx(skb);
999+ /* The skb buffer is now owned by network stack above */
1000+ lp->rx_skb[lp->rx_bd_ci] = NULL;
9321001
9331002 ndev->stats.rx_packets++;
9341003 ndev->stats.rx_bytes += length;
9351004
936− new_skb = netdev_alloc_skb_ip_align(ndev,
937− XTE_MAX_JUMBO_FRAME_SIZE);
938− if (!new_skb) {
939− spin_unlock_irqrestore(&lp->rx_lock, flags);
940− return;
1005+ rx_bd = lp->rx_bd_ci;
1006+ if (++lp->rx_bd_ci >= RX_BD_NUM)
1007+ lp->rx_bd_ci = 0;
1008+ } while (rx_bd != lp->rx_bd_tail);
1009+
1010+ /* DMA operations will halt when the last buffer descriptor is
1011+ * processed (ie. the one pointed to by RX_TAILDESC_PTR).
1012+ * When that happens, no more interrupt events will be
1013+ * generated. No IRQ_COAL or IRQ_DLY, and not even an
1014+ * IRQ_ERR. To avoid stalling, we schedule a delayed work
1015+ * when there is a potential risk of that happening. The work
1016+ * will call this function, and thus re-schedule itself until
1017+ * enough buffers are available again.
1018+ */
1019+ if (ll_temac_recv_buffers_available(lp) < lp->coalesce_count_rx)
1020+ schedule_delayed_work(&lp->restart_work, HZ / 1000);
1021+
1022+ /* Allocate new buffers for those buffer descriptors that were
1023+ * passed to network stack. Note that GFP_ATOMIC allocations
1024+ * can fail (e.g. when a larger burst of GFP_ATOMIC
1025+ * allocations occurs), so while we try to allocate all
1026+ * buffers in the same interrupt where they were processed, we
1027+ * continue with what we could get in case of allocation
1028+ * failure. Allocation of remaining buffers will be retried
1029+ * in following calls.
1030+ */
1031+ while (1) {
1032+ struct sk_buff *skb;
1033+ struct cdmac_bd *bd;
1034+ dma_addr_t skb_dma_addr;
1035+
1036+ rx_bd = lp->rx_bd_tail + 1;
1037+ if (rx_bd >= RX_BD_NUM)
1038+ rx_bd = 0;
1039+ bd = &lp->rx_bd_v[rx_bd];
1040+
1041+ if (bd->phys)
1042+ break; /* All skb's allocated */
1043+
1044+ skb = netdev_alloc_skb_ip_align(ndev, XTE_MAX_JUMBO_FRAME_SIZE);
1045+ if (!skb) {
1046+ dev_warn(&ndev->dev, "skb alloc failed\n");
1047+ break;
9411048 }
9421049
943− cur_p->app0 = cpu_to_be32(STS_CTRL_APP0_IRQONEND);
944− skb_dma_addr = dma_map_single(ndev->dev.parent, new_skb->data,
1050+ skb_dma_addr = dma_map_single(ndev->dev.parent, skb->data,
9451051 XTE_MAX_JUMBO_FRAME_SIZE,
9461052 DMA_FROM_DEVICE);
947− cur_p->phys = cpu_to_be32(skb_dma_addr);
948− cur_p->len = cpu_to_be32(XTE_MAX_JUMBO_FRAME_SIZE);
949− lp->rx_skb[lp->rx_bd_ci] = new_skb;
1053+ if (WARN_ON_ONCE(dma_mapping_error(ndev->dev.parent,
1054+ skb_dma_addr))) {
1055+ dev_kfree_skb_any(skb);
1056+ break;
1057+ }
9501058
951− lp->rx_bd_ci++;
952− if (lp->rx_bd_ci >= RX_BD_NUM)
953− lp->rx_bd_ci = 0;
1059+ bd->phys = cpu_to_be32(skb_dma_addr);
1060+ bd->len = cpu_to_be32(XTE_MAX_JUMBO_FRAME_SIZE);
1061+ bd->app0 = cpu_to_be32(STS_CTRL_APP0_IRQONEND);
1062+ lp->rx_skb[rx_bd] = skb;
9541063
955− cur_p = &lp->rx_bd_v[lp->rx_bd_ci];
956− bdstat = be32_to_cpu(cur_p->app0);
1064+ lp->rx_bd_tail = rx_bd;
1065+ update_tail = true;
1066+ }
1067+
1068+ /* Move tail pointer when buffers have been allocated */
1069+ if (update_tail) {
1070+ lp->dma_out(lp, RX_TAILDESC_PTR,
1071+ lp->rx_bd_p + sizeof(*lp->rx_bd_v) * lp->rx_bd_tail);
9571072 }
958− lp->dma_out(lp, RX_TAILDESC_PTR, tail_p);
9591073
9601074 spin_unlock_irqrestore(&lp->rx_lock, flags);
9611075 }
9621076
1077+/* Function scheduled to ensure a restart in case of DMA halt
1078+ * condition caused by running out of buffer descriptors.
1079+ */
1080+static void ll_temac_restart_work_func(struct work_struct *work)
1081+{
1082+ struct temac_local *lp = container_of(work, struct temac_local,
1083+ restart_work.work);
1084+ struct net_device *ndev = lp->ndev;
1085+
1086+ ll_temac_recv(ndev);
1087+}
1088+
9631089 static irqreturn_t ll_temac_tx_irq(int irq, void *_ndev)
9641090 {
9651091 struct net_device *ndev = _ndev;
@@ -1052,6 +1178,8 @@ static int temac_stop(struct net_device *ndev) · 86 unmodified lines
10521178
10531179 dev_dbg(&ndev->dev, "temac_close()\n");
10541180
1181+ cancel_delayed_work_sync(&lp->restart_work);
1182+
10551183 free_irq(lp->tx_irq, ndev);
10561184 free_irq(lp->rx_irq, ndev);
10571185
@@ -1173,6 +1301,7 @@ static int temac_probe(struct platform_device *pdev) · 115 unmodified lines
11731301 lp->dev = &pdev->dev;
11741302 lp->options = XTE_OPTION_DEFAULTS;
11751303 spin_lock_init(&lp->rx_lock);
1304+ INIT_DELAYED_WORK(&lp->restart_work, ll_temac_restart_work_func);
11761305
11771306 /* Setup mutex for synchronization of indirect register access */
11781307 if (pdata) {
@@ -1279,6 +1408,7 @@ static int temac_probe(struct platform_device *pdev) · 100 unmodified lines
12791408 */
12801409 lp->tx_chnl_ctrl = 0x10220000;
12811410 lp->rx_chnl_ctrl = 0xff070000;
1411+ lp->coalesce_count_rx = 0x07;
12821412
12831413 /* Finished with the DMA node; drop the reference */
12841414 of_node_put(dma_np);
@@ -1310,11 +1440,14 @@ static int temac_probe(struct platform_device *pdev) · 25 unmodified lines
13101440 (pdata->tx_irq_count << 16);
13111441 else
13121442 lp->tx_chnl_ctrl = 0x10220000;
1313− if (pdata->rx_irq_timeout || pdata->rx_irq_count)
1443+ if (pdata->rx_irq_timeout || pdata->rx_irq_count) {
13141444 lp->rx_chnl_ctrl = (pdata->rx_irq_timeout << 24) |
13151445 (pdata->rx_irq_count << 16);
1316− else
1446+ lp->coalesce_count_rx = pdata->rx_irq_count;
1447+ } else {
13171448 lp->rx_chnl_ctrl = 0xff070000;
1449+ lp->coalesce_count_rx = 0x07;
1450+ }
13181451 }
13191452
13201453 /* Error handle returned DMA RX and TX interrupts */
drivers/net/hyperv/netvsc.c+1−1
@@ -99,7 +99,7 @@ static struct netvsc_device *alloc_net_device(void) · 98 unmodified lines
9999
100100 init_waitqueue_head(&net_device->wait_drain);
101101 net_device->destroy = false;
102− net_device->tx_disable = false;
102+ net_device->tx_disable = true;
103103
104104 net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT;
105105 net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT;
drivers/net/hyperv/netvsc_drv.c+3−0
@@ -1068,6 +1068,7 @@ static int netvsc_attach(struct net_device *ndev, · 1067 unmodified lines
10681068 }
10691069
10701070 /* In any case device is now ready */
1071+ nvdev->tx_disable = false;
10711072 netif_device_attach(ndev);
10721073
10731074 /* Note: enable and attach happen when sub-channels setup */
@@ -2476,6 +2477,8 @@ static int netvsc_probe(struct hv_device *dev, · 1402 unmodified lines
24762477 else
24772478 net->max_mtu = ETH_DATA_LEN;
24782479
2480+ nvdev->tx_disable = false;
2481+
24792482 ret = register_netdevice(net);
24802483 if (ret != 0) {
24812484 pr_err("Unable to register netdev.\n");
drivers/net/ipvlan/ipvlan_core.c+11−8
@@ -293,6 +293,7 @@ void ipvlan_process_multicast(struct work_struct *work) · 292 unmodified lines
293293 }
294294 if (dev)
295295 dev_put(dev);
296+ cond_resched();
296297 }
297298 }
298299
@@ -498,19 +499,21 @@ static int ipvlan_process_outbound(struct sk_buff *skb) · 199 unmodified lines
498499 struct ethhdr *ethh = eth_hdr(skb);
499500 int ret = NET_XMIT_DROP;
500501
501− /* In this mode we dont care about multicast and broadcast traffic */
502− if (is_multicast_ether_addr(ethh->h_dest)) {
503− pr_debug_ratelimited("Dropped {multi|broad}cast of type=[%x]\n",
504− ntohs(skb->protocol));
505− kfree_skb(skb);
506− goto out;
507− }
508−
509502 /* The ipvlan is a pseudo-L2 device, so the packets that we receive
510503 * will have L2; which need to discarded and processed further
511504 * in the net-ns of the main-device.
512505 */
513506 if (skb_mac_header_was_set(skb)) {
507+ /* In this mode we dont care about
508+ * multicast and broadcast traffic */
509+ if (is_multicast_ether_addr(ethh->h_dest)) {
510+ pr_debug_ratelimited(
511+ "Dropped {multi|broad}cast of type=[%x]\n",
512+ ntohs(skb->protocol));
513+ kfree_skb(skb);
514+ goto out;
515+ }
516+
514517 skb_pull(skb, sizeof(*ethh));
515518 skb->mac_header = (typeof(skb->mac_header))~0U;
516519 skb_reset_network_header(skb);
drivers/net/ipvlan/ipvlan_main.c+1−4
@@ -164,7 +164,6 @@ static void ipvlan_uninit(struct net_device *dev) · 163 unmodified lines
164164 static int ipvlan_open(struct net_device *dev)
165165 {
166166 struct ipvl_dev *ipvlan = netdev_priv(dev);
167− struct net_device *phy_dev = ipvlan->phy_dev;
168167 struct ipvl_addr *addr;
169168
170169 if (ipvlan->port->mode == IPVLAN_MODE_L3 ||
@@ -178,7 +177,7 @@ static int ipvlan_open(struct net_device *dev) · 7 unmodified lines
178177 ipvlan_ht_addr_add(ipvlan, addr);
179178 rcu_read_unlock();
180179
181− return dev_uc_add(phy_dev, phy_dev->dev_addr);
180+ return 0;
182181 }
183182
184183 static int ipvlan_stop(struct net_device *dev)
@@ -190,8 +189,6 @@ static int ipvlan_stop(struct net_device *dev) · 5 unmodified lines
190189 dev_uc_unsync(phy_dev, dev);
191190 dev_mc_unsync(phy_dev, dev);
192191
193− dev_uc_del(phy_dev, phy_dev->dev_addr);
194−
195192 rcu_read_lock();
196193 list_for_each_entry_rcu(addr, &ipvlan->addrs, anode)
197194 ipvlan_ht_addr_del(addr);
drivers/net/macsec.c+20−5
@@ -424,6 +424,11 @@ static struct macsec_eth_header *macsec_ethhdr(struct sk_buff *skb) · 423 unmodified lines
424424 return (struct macsec_eth_header *)skb_mac_header(skb);
425425 }
426426
427+static sci_t dev_to_sci(struct net_device *dev, __be16 port)
428+{
429+ return make_sci(dev->dev_addr, port);
430+}
431+
427432 static void __macsec_pn_wrapped(struct macsec_secy *secy,
428433 struct macsec_tx_sa *tx_sa)
429434 {
@@ -3268,6 +3273,20 @@ static int macsec_set_mac_address(struct net_device *dev, void *p) · 2838 unmodified lines
32683273
32693274 out:
32703275 ether_addr_copy(dev->dev_addr, addr->sa_data);
3276+ macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES);
3277+
3278+ /* If h/w offloading is available, propagate to the device */
3279+ if (macsec_is_offloaded(macsec)) {
3280+ const struct macsec_ops *ops;
3281+ struct macsec_context ctx;
3282+
3283+ ops = macsec_get_ops(macsec, &ctx);
3284+ if (ops) {
3285+ ctx.secy = &macsec->secy;
3286+ macsec_offload(ops->mdo_upd_secy, &ctx);
3287+ }
3288+ }
3289+
32713290 return 0;
32723291 }
32733292
@@ -3342,6 +3361,7 @@ static const struct device_type macsec_type = { · 68 unmodified lines
33423361
33433362 static const struct nla_policy macsec_rtnl_policy[IFLA_MACSEC_MAX + 1] = {
33443363 [IFLA_MACSEC_SCI] = { .type = NLA_U64 },
3364+ [IFLA_MACSEC_PORT] = { .type = NLA_U16 },
33453365 [IFLA_MACSEC_ICV_LEN] = { .type = NLA_U8 },
33463366 [IFLA_MACSEC_CIPHER_SUITE] = { .type = NLA_U64 },
33473367 [IFLA_MACSEC_WINDOW] = { .type = NLA_U32 },
@@ -3592,11 +3612,6 @@ static bool sci_exists(struct net_device *dev, sci_t sci) · 244 unmodified lines
35923612 return false;
35933613 }
35943614
3595−static sci_t dev_to_sci(struct net_device *dev, __be16 port)
3596−{
3597− return make_sci(dev->dev_addr, port);
3598−}
3599−
36003615 static int macsec_add_dev(struct net_device *dev, sci_t sci, u8 icv_len)
36013616 {
36023617 struct macsec_dev *macsec = macsec_priv(dev);
drivers/net/macvlan.c+2−0
@@ -334,6 +334,8 @@ static void macvlan_process_broadcast(struct work_struct *w) · 333 unmodified lines
334334 if (src)
335335 dev_put(src->dev);
336336 consume_skb(skb);
337+
338+ cond_resched();
337339 }
338340 }
339341
drivers/net/phy/bcm63xx.c+1−0
@@ -73,6 +73,7 @@ static struct phy_driver bcm63xx_driver[] = { · 72 unmodified lines
7373 /* same phy as above, with just a different OUI */
7474 .phy_id = 0x002bdc00,
7575 .phy_id_mask = 0xfffffc00,
76+ .name = "Broadcom BCM63XX (2)",
7677 /* PHY_BASIC_FEATURES */
7778 .flags = PHY_IS_INTERNAL,
7879 .config_init = bcm63xx_config_init,
drivers/net/phy/marvell.c+5−0
@@ -1306,6 +1306,9 @@ static int marvell_read_status_page_an(struct phy_device *phydev, · 1305 unmodified lines
13061306 }
13071307 }
13081308
1309+ if (!(status & MII_M1011_PHY_STATUS_RESOLVED))
1310+ return 0;
1311+
13091312 if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
13101313 phydev->duplex = DUPLEX_FULL;
13111314 else
@@ -1365,6 +1368,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page) · 53 unmodified lines
13651368 linkmode_zero(phydev->lp_advertising);
13661369 phydev->pause = 0;
13671370 phydev->asym_pause = 0;
1371+ phydev->speed = SPEED_UNKNOWN;
1372+ phydev->duplex = DUPLEX_UNKNOWN;
13681373
13691374 if (phydev->autoneg == AUTONEG_ENABLE)
13701375 err = marvell_read_status_page_an(phydev, fiber, status);
drivers/net/phy/mscc.c+2−2
@@ -345,11 +345,11 @@ enum macsec_bank { · 344 unmodified lines
345345 BIT(VSC8531_FORCE_LED_OFF) | \
346346 BIT(VSC8531_FORCE_LED_ON))
347347
348−#define MSCC_VSC8584_REVB_INT8051_FW "mscc_vsc8584_revb_int8051_fb48.bin"
348+#define MSCC_VSC8584_REVB_INT8051_FW "microchip/mscc_vsc8584_revb_int8051_fb48.bin"
349349 #define MSCC_VSC8584_REVB_INT8051_FW_START_ADDR 0xe800
350350 #define MSCC_VSC8584_REVB_INT8051_FW_CRC 0xfb48
351351
352−#define MSCC_VSC8574_REVB_INT8051_FW "mscc_vsc8574_revb_int8051_29e8.bin"
352+#define MSCC_VSC8574_REVB_INT8051_FW "microchip/mscc_vsc8574_revb_int8051_29e8.bin"
353353 #define MSCC_VSC8574_REVB_INT8051_FW_START_ADDR 0x4000
354354 #define MSCC_VSC8574_REVB_INT8051_FW_CRC 0x29e8
355355
drivers/net/phy/phy-c45.c+3−3
@@ -167,7 +167,7 @@ EXPORT_SYMBOL_GPL(genphy_c45_restart_aneg); · 166 unmodified lines
167167 */
168168 int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart)
169169 {
170− int ret = 0;
170+ int ret;
171171
172172 if (!restart) {
173173 /* Configure and restart aneg if it wasn't set before */
@@ -180,9 +180,9 @@ int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart) · 6 unmodified lines
180180 }
181181
182182 if (restart)
183− ret = genphy_c45_restart_aneg(phydev);
183+ return genphy_c45_restart_aneg(phydev);
184184
185− return ret;
185+ return 0;
186186 }
187187 EXPORT_SYMBOL_GPL(genphy_c45_check_and_restart_aneg);
188188
drivers/net/phy/phy.c+2−1
@@ -727,7 +727,8 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat) · 726 unmodified lines
727727 phy_trigger_machine(phydev);
728728 }
729729
730− if (phy_clear_interrupt(phydev))
730+ /* did_interrupt() may have cleared the interrupt already */
731+ if (!phydev->drv->did_interrupt && phy_clear_interrupt(phydev))
731732 goto phy_err;
732733 return IRQ_HANDLED;
733734
drivers/net/phy/phy_device.c+11−6
@@ -247,7 +247,7 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) · 246 unmodified lines
247247 * MDIO bus driver and clock gated at this point.
248248 */
249249 if (!netdev)
250− return !phydev->suspended;
250+ goto out;
251251
252252 if (netdev->wol_enabled)
253253 return false;
@@ -267,7 +267,8 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) · 13 unmodified lines
267267 if (device_may_wakeup(&netdev->dev))
268268 return false;
269269
270− return true;
270+out:
271+ return !phydev->suspended;
271272 }
272273
273274 static int mdio_bus_phy_suspend(struct device *dev)
@@ -285,6 +286,8 @@ static int mdio_bus_phy_suspend(struct device *dev) · 11 unmodified lines
285286 if (!mdio_bus_phy_may_suspend(phydev))
286287 return 0;
287288
289+ phydev->suspended_by_mdio_bus = 1;
290+
288291 return phy_suspend(phydev);
289292 }
290293
@@ -293,9 +296,11 @@ static int mdio_bus_phy_resume(struct device *dev) · 2 unmodified lines
293296 struct phy_device *phydev = to_phy_device(dev);
294297 int ret;
295298
296− if (!mdio_bus_phy_may_suspend(phydev))
299+ if (!phydev->suspended_by_mdio_bus)
297300 goto no_resume;
298301
302+ phydev->suspended_by_mdio_bus = 0;
303+
299304 ret = phy_resume(phydev);
300305 if (ret < 0)
301306 return ret;
@@ -1792,7 +1797,7 @@ EXPORT_SYMBOL(genphy_restart_aneg); · 1490 unmodified lines
17921797 */
17931798 int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart)
17941799 {
1795− int ret = 0;
1800+ int ret;
17961801
17971802 if (!restart) {
17981803 /* Advertisement hasn't changed, but maybe aneg was never on to
@@ -1807,9 +1812,9 @@ int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart) · 8 unmodified lines
18071812 }
18081813
18091814 if (restart)
1810− ret = genphy_restart_aneg(phydev);
1815+ return genphy_restart_aneg(phydev);
18111816
1812− return ret;
1817+ return 0;
18131818 }
18141819 EXPORT_SYMBOL(genphy_check_and_restart_aneg);
18151820
drivers/net/phy/phylink.c+7−1
@@ -761,8 +761,14 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, · 760 unmodified lines
761761 config.interface = interface;
762762
763763 ret = phylink_validate(pl, supported, &config);
764− if (ret)
764+ if (ret) {
765+ phylink_warn(pl, "validation of %s with support %*pb and advertisement %*pb failed: %d\n",
766+ phy_modes(config.interface),
767+ __ETHTOOL_LINK_MODE_MASK_NBITS, phy->supported,
768+ __ETHTOOL_LINK_MODE_MASK_NBITS, config.advertising,
769+ ret);
765770 return ret;
771+ }
766772
767773 phy->phylink = pl;
768774 phy->phy_link_change = phylink_phy_change;
drivers/net/slip/slhc.c+10−4
@@ -232,7 +232,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, · 231 unmodified lines
232232 struct cstate *cs = lcs->next;
233233 unsigned long deltaS, deltaA;
234234 short changes = 0;
235− int hlen;
235+ int nlen, hlen;
236236 unsigned char new_seq[16];
237237 unsigned char *cp = new_seq;
238238 struct iphdr *ip;
@@ -248,6 +248,8 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, · 9 unmodified lines
248248 return isize;
249249
250250 ip = (struct iphdr *) icp;
251+ if (ip->version != 4 || ip->ihl < 5)
252+ return isize;
251253
252254 /* Bail if this packet isn't TCP, or is an IP fragment */
253255 if (ip->protocol != IPPROTO_TCP || (ntohs(ip->frag_off) & 0x3fff)) {
@@ -258,10 +260,14 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, · 4 unmodified lines
258260 comp->sls_o_tcp++;
259261 return isize;
260262 }
261− /* Extract TCP header */
263+ nlen = ip->ihl * 4;
264+ if (isize < nlen + sizeof(*th))
265+ return isize;
262266
263− th = (struct tcphdr *)(((unsigned char *)ip) + ip->ihl*4);
264− hlen = ip->ihl*4 + th->doff*4;
267+ th = (struct tcphdr *)(icp + nlen);
268+ if (th->doff < sizeof(struct tcphdr) / 4)
269+ return isize;
270+ hlen = nlen + th->doff * 4;
265271
266272 /* Bail if the TCP packet isn't `compressible' (i.e., ACK isn't set or
267273 * some other control bit is set). Also uncompressible if
drivers/net/slip/slip.c+3−0
@@ -863,7 +863,10 @@ err_free_chan: · 862 unmodified lines
863863 tty->disc_data = NULL;
864864 clear_bit(SLF_INUSE, &sl->flags);
865865 sl_free_netdev(sl->dev);
866+ /* do not call free_netdev before rtnl_unlock */
867+ rtnl_unlock();
866868 free_netdev(sl->dev);
869+ return err;
867870
868871 err_exit:
869872 rtnl_unlock();
drivers/net/team/team.c+2−0
@@ -2240,6 +2240,8 @@ team_nl_option_policy[TEAM_ATTR_OPTION_MAX + 1] = { · 2239 unmodified lines
22402240 [TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG },
22412241 [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8 },
22422242 [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY },
2243+ [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32 },
2244+ [TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32 },
22432245 };
22442246
22452247 static int team_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
drivers/net/usb/qmi_wwan.c+3−0
@@ -337,6 +337,9 @@ static void qmi_wwan_netdev_setup(struct net_device *net) · 336 unmodified lines
337337 netdev_dbg(net, "mode: raw IP\n");
338338 } else if (!net->header_ops) { /* don't bother if already set */
339339 ether_setup(net);
340+ /* Restoring min/max mtu values set originally by usbnet */
341+ net->min_mtu = 0;
342+ net->max_mtu = ETH_MAX_MTU;
340343 clear_bit(EVENT_NO_IP_ALIGN, &dev->flags);
341344 netdev_dbg(net, "mode: Ethernet\n");
342345 }
drivers/net/usb/r8152.c+8−0
@@ -3221,6 +3221,8 @@ static u16 r8153_phy_status(struct r8152 *tp, u16 desired) · 3220 unmodified lines
32213221 }
32223222
32233223 msleep(20);
3224+ if (test_bit(RTL8152_UNPLUG, &tp->flags))
3225+ break;
32243226 }
32253227
32263228 return data;
@@ -5402,7 +5404,10 @@ static void r8153_init(struct r8152 *tp) · 2175 unmodified lines
54025404 if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
54035405 AUTOLOAD_DONE)
54045406 break;
5407+
54055408 msleep(20);
5409+ if (test_bit(RTL8152_UNPLUG, &tp->flags))
5410+ break;
54065411 }
54075412
54085413 data = r8153_phy_status(tp, 0);
@@ -5539,7 +5544,10 @@ static void r8153b_init(struct r8152 *tp) · 130 unmodified lines
55395544 if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
55405545 AUTOLOAD_DONE)
55415546 break;
5547+
55425548 msleep(20);
5549+ if (test_bit(RTL8152_UNPLUG, &tp->flags))
5550+ break;
55435551 }
55445552
55455553 data = r8153_phy_status(tp, 0);
drivers/net/veth.c+1−1
@@ -328,7 +328,7 @@ static void veth_get_stats64(struct net_device *dev, · 327 unmodified lines
328328 rcu_read_lock();
329329 peer = rcu_dereference(priv->peer);
330330 if (peer) {
331− tot->rx_dropped += veth_stats_tx(peer, &packets, &bytes);
331+ veth_stats_tx(peer, &packets, &bytes);
332332 tot->rx_bytes += bytes;
333333 tot->rx_packets += packets;
334334
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c+2−1
@@ -308,7 +308,8 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) · 307 unmodified lines
308308 }
309309
310310 /* PHY_SKU section is mandatory in B0 */
311− if (!mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
311+ if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT &&
312+ !mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
312313 IWL_ERR(mvm,
313314 "Can't parse phy_sku in B0, empty sections\n");
314315 return NULL;
drivers/net/wireless/mediatek/mt76/dma.c+6−3
@@ -447,10 +447,13 @@ mt76_add_fragment(struct mt76_dev *dev, struct mt76_queue *q, void *data, · 446 unmodified lines
447447 struct page *page = virt_to_head_page(data);
448448 int offset = data - page_address(page);
449449 struct sk_buff *skb = q->rx_head;
450+ struct skb_shared_info *shinfo = skb_shinfo(skb);
450451
451− offset += q->buf_offset;
452− skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, offset, len,
453− q->buf_size);
452+ if (shinfo->nr_frags < ARRAY_SIZE(shinfo->frags)) {
453+ offset += q->buf_offset;
454+ skb_add_rx_frag(skb, shinfo->nr_frags, page, offset, len,
455+ q->buf_size);
456+ }
454457
455458 if (more)
456459 return;
drivers/nvme/host/pci.c+1−1
@@ -1078,9 +1078,9 @@ static int nvme_poll(struct blk_mq_hw_ctx *hctx) · 1077 unmodified lines
10781078
10791079 spin_lock(&nvmeq->cq_poll_lock);
10801080 found = nvme_process_cq(nvmeq, &start, &end, -1);
1081+ nvme_complete_cqes(nvmeq, start, end);
10811082 spin_unlock(&nvmeq->cq_poll_lock);
10821083
1083− nvme_complete_cqes(nvmeq, start, end);
10841084 return found;
10851085 }
10861086
drivers/of/of_mdio.c+1−0
@@ -306,6 +306,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) · 305 unmodified lines
306306 rc = of_mdiobus_register_phy(mdio, child, addr);
307307 if (rc && rc != -ENODEV)
308308 goto unregister;
309+ break;
309310 }
310311 }
311312 }
drivers/pci/controller/pcie-brcmstb.c+1−1
@@ -670,7 +670,7 @@ static inline int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie, · 669 unmodified lines
670670 * outbound memory @ 3GB). So instead it will start at the 1x
671671 * multiple of its size
672672 */
673− if (!*rc_bar2_size || *rc_bar2_offset % *rc_bar2_size ||
673+ if (!*rc_bar2_size || (*rc_bar2_offset & (*rc_bar2_size - 1)) ||
674674 (*rc_bar2_offset < SZ_4G && *rc_bar2_offset > SZ_2G)) {
675675 dev_err(dev, "Invalid rc_bar2_offset/size: size 0x%llx, off 0x%llx\n",
676676 *rc_bar2_size, *rc_bar2_offset);
drivers/perf/arm_pmu_acpi.c+2−5
@@ -24,8 +24,6 @@ static int arm_pmu_acpi_register_irq(int cpu) · 23 unmodified lines
2424 int gsi, trigger;
2525
2626 gicc = acpi_cpu_get_madt_gicc(cpu);
27− if (WARN_ON(!gicc))
28− return -EINVAL;
2927
3028 gsi = gicc->performance_interrupt;
3129
@@ -64,11 +62,10 @@ static void arm_pmu_acpi_unregister_irq(int cpu) · 32 unmodified lines
6462 int gsi;
6563
6664 gicc = acpi_cpu_get_madt_gicc(cpu);
67− if (!gicc)
68− return;
6965
7066 gsi = gicc->performance_interrupt;
71− acpi_unregister_gsi(gsi);
67+ if (gsi)
68+ acpi_unregister_gsi(gsi);
7269 }
7370
7471 #if IS_ENABLED(CONFIG_ARM_SPE_PMU)
drivers/perf/fsl_imx8_ddr_perf.c+6−4
@@ -388,9 +388,10 @@ static void ddr_perf_counter_enable(struct ddr_pmu *pmu, int config, · 387 unmodified lines
388388
389389 if (enable) {
390390 /*
391− * must disable first, then enable again
392− * otherwise, cycle counter will not work
393− * if previous state is enabled.
391+ * cycle counter is special which should firstly write 0 then
392+ * write 1 into CLEAR bit to clear it. Other counters only
393+ * need write 0 into CLEAR bit and it turns out to be 1 by
394+ * hardware. Below enable flow is harmless for all counters.
394395 */
395396 writel(0, pmu->base + reg);
396397 val = CNTL_EN | CNTL_CLEAR;
@@ -398,7 +399,8 @@ static void ddr_perf_counter_enable(struct ddr_pmu *pmu, int config, · 1 unmodified line
398399 writel(val, pmu->base + reg);
399400 } else {
400401 /* Disable counter */
401− writel(0, pmu->base + reg);
402+ val = readl_relaxed(pmu->base + reg) & CNTL_EN_MASK;
403+ writel(val, pmu->base + reg);
402404 }
403405 }
404406
drivers/phy/allwinner/phy-sun50i-usb3.c+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949 #define SUNXI_LOS_BIAS(n) ((n) << 3)
5050 #define SUNXI_LOS_BIAS_MASK GENMASK(5, 3)
5151 #define SUNXI_TXVBOOSTLVL(n) ((n) << 0)
52−#define SUNXI_TXVBOOSTLVL_MASK GENMASK(0, 2)
52+#define SUNXI_TXVBOOSTLVL_MASK GENMASK(2, 0)
5353
5454 struct sun50i_usb3_phy {
5555 struct phy *phy;
drivers/phy/broadcom/phy-brcm-sata.c+65−83
@@ -186,29 +186,6 @@ enum sata_phy_ctrl_regs { · 185 unmodified lines
186186 PHY_CTRL_1_RESET = BIT(0),
187187 };
188188
189−static inline void __iomem *brcm_sata_pcb_base(struct brcm_sata_port *port)
190−{
191− struct brcm_sata_phy *priv = port->phy_priv;
192− u32 size = 0;
193−
194− switch (priv->version) {
195− case BRCM_SATA_PHY_STB_16NM:
196− case BRCM_SATA_PHY_STB_28NM:
197− case BRCM_SATA_PHY_IPROC_NS2:
198− case BRCM_SATA_PHY_DSL_28NM:
199− size = SATA_PCB_REG_28NM_SPACE_SIZE;
200− break;
201− case BRCM_SATA_PHY_STB_40NM:
202− size = SATA_PCB_REG_40NM_SPACE_SIZE;
203− break;
204− default:
205− dev_err(priv->dev, "invalid phy version\n");
206− break;
207− }
208−
209− return priv->phy_base + (port->portnum * size);
210−}
211−
212189 static inline void __iomem *brcm_sata_ctrl_base(struct brcm_sata_port *port)
213190 {
214191 struct brcm_sata_phy *priv = port->phy_priv;
@@ -226,19 +203,34 @@ static inline void __iomem *brcm_sata_ctrl_base(struct brcm_sata_port *port) · 11 unmodified lines
226203 return priv->ctrl_base + (port->portnum * size);
227204 }
228205
229−static void brcm_sata_phy_wr(void __iomem *pcb_base, u32 bank,
206+static void brcm_sata_phy_wr(struct brcm_sata_port *port, u32 bank,
230207 u32 ofs, u32 msk, u32 value)
231208 {
209+ struct brcm_sata_phy *priv = port->phy_priv;
210+ void __iomem *pcb_base = priv->phy_base;
232211 u32 tmp;
233212
213+ if (priv->version == BRCM_SATA_PHY_STB_40NM)
214+ bank += (port->portnum * SATA_PCB_REG_40NM_SPACE_SIZE);
215+ else
216+ pcb_base += (port->portnum * SATA_PCB_REG_28NM_SPACE_SIZE);
217+
234218 writel(bank, pcb_base + SATA_PCB_BANK_OFFSET);
235219 tmp = readl(pcb_base + SATA_PCB_REG_OFFSET(ofs));
236220 tmp = (tmp & msk) | value;
237221 writel(tmp, pcb_base + SATA_PCB_REG_OFFSET(ofs));
238222 }
239223
240−static u32 brcm_sata_phy_rd(void __iomem *pcb_base, u32 bank, u32 ofs)
224+static u32 brcm_sata_phy_rd(struct brcm_sata_port *port, u32 bank, u32 ofs)
241225 {
226+ struct brcm_sata_phy *priv = port->phy_priv;
227+ void __iomem *pcb_base = priv->phy_base;
228+
229+ if (priv->version == BRCM_SATA_PHY_STB_40NM)
230+ bank += (port->portnum * SATA_PCB_REG_40NM_SPACE_SIZE);
231+ else
232+ pcb_base += (port->portnum * SATA_PCB_REG_28NM_SPACE_SIZE);
233+
242234 writel(bank, pcb_base + SATA_PCB_BANK_OFFSET);
243235 return readl(pcb_base + SATA_PCB_REG_OFFSET(ofs));
244236 }
@@ -250,16 +242,15 @@ static u32 brcm_sata_phy_rd(void __iomem *pcb_base, u32 bank, u32 ofs) · 5 unmodified lines
250242
251243 static void brcm_stb_sata_ssc_init(struct brcm_sata_port *port)
252244 {
253− void __iomem *base = brcm_sata_pcb_base(port);
254245 struct brcm_sata_phy *priv = port->phy_priv;
255246 u32 tmp;
256247
257248 /* override the TX spread spectrum setting */
258249 tmp = TXPMD_CONTROL1_TX_SSC_EN_FRC_VAL | TXPMD_CONTROL1_TX_SSC_EN_FRC;
259− brcm_sata_phy_wr(base, TXPMD_REG_BANK, TXPMD_CONTROL1, ~tmp, tmp);
250+ brcm_sata_phy_wr(port, TXPMD_REG_BANK, TXPMD_CONTROL1, ~tmp, tmp);
260251
261252 /* set fixed min freq */
262− brcm_sata_phy_wr(base, TXPMD_REG_BANK, TXPMD_TX_FREQ_CTRL_CONTROL2,
253+ brcm_sata_phy_wr(port, TXPMD_REG_BANK, TXPMD_TX_FREQ_CTRL_CONTROL2,
263254 ~TXPMD_TX_FREQ_CTRL_CONTROL2_FMIN_MASK,
264255 STB_FMIN_VAL_DEFAULT);
265256
@@ -271,7 +262,7 @@ static void brcm_stb_sata_ssc_init(struct brcm_sata_port *port) · 5 unmodified lines
271262 tmp = STB_FMAX_VAL_DEFAULT;
272263 }
273264
274− brcm_sata_phy_wr(base, TXPMD_REG_BANK, TXPMD_TX_FREQ_CTRL_CONTROL3,
265+ brcm_sata_phy_wr(port, TXPMD_REG_BANK, TXPMD_TX_FREQ_CTRL_CONTROL3,
275266 ~TXPMD_TX_FREQ_CTRL_CONTROL3_FMAX_MASK, tmp);
276267 }
277268
@@ -280,7 +271,6 @@ static void brcm_stb_sata_ssc_init(struct brcm_sata_port *port) · 2 unmodified lines
280271
281272 static int brcm_stb_sata_rxaeq_init(struct brcm_sata_port *port)
282273 {
283− void __iomem *base = brcm_sata_pcb_base(port);
284274 u32 tmp = 0, reg = 0;
285275
286276 switch (port->rxaeq_mode) {
@@ -301,8 +291,8 @@ static int brcm_stb_sata_rxaeq_init(struct brcm_sata_port *port) · 14 unmodified lines
301291 break;
302292 }
303293
304− brcm_sata_phy_wr(base, AEQRX_REG_BANK_0, reg, ~tmp, tmp);
305− brcm_sata_phy_wr(base, AEQRX_REG_BANK_1, reg, ~tmp, tmp);
294+ brcm_sata_phy_wr(port, AEQRX_REG_BANK_0, reg, ~tmp, tmp);
295+ brcm_sata_phy_wr(port, AEQRX_REG_BANK_1, reg, ~tmp, tmp);
306296
307297 return 0;
308298 }
@@ -316,18 +306,17 @@ static int brcm_stb_sata_init(struct brcm_sata_port *port) · 7 unmodified lines
316306
317307 static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port)
318308 {
319− void __iomem *base = brcm_sata_pcb_base(port);
320309 u32 tmp, value;
321310
322311 /* Reduce CP tail current to 1/16th of its default value */
323− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL6, 0, 0x141);
312+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL6, 0, 0x141);
324313
325314 /* Turn off CP tail current boost */
326− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL8, 0, 0xc006);
315+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL8, 0, 0xc006);
327316
328317 /* Set a specific AEQ equalizer value */
329318 tmp = AEQ_FRC_EQ_FORCE_VAL | AEQ_FRC_EQ_FORCE;
330− brcm_sata_phy_wr(base, AEQRX_REG_BANK_0, AEQ_FRC_EQ,
319+ brcm_sata_phy_wr(port, AEQRX_REG_BANK_0, AEQ_FRC_EQ,
331320 ~(tmp | AEQ_RFZ_FRC_VAL |
332321 AEQ_FRC_EQ_VAL_MASK << AEQ_FRC_EQ_VAL_SHIFT),
333322 tmp | 32 << AEQ_FRC_EQ_VAL_SHIFT);
@@ -337,7 +326,7 @@ static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port) · 3 unmodified lines
337326 value = 0x52;
338327 else
339328 value = 0;
340− brcm_sata_phy_wr(base, RXPMD_REG_BANK, RXPMD_RX_CDR_CONTROL1,
329+ brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_CDR_CONTROL1,
341330 ~RXPMD_RX_PPM_VAL_MASK, value);
342331
343332 /* Set proportional loop bandwith Gen1/2/3 */
@@ -352,7 +341,7 @@ static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port) · 8 unmodified lines
352341 value = 1 << RXPMD_G1_CDR_PROP_BW_SHIFT |
353342 1 << RXPMD_G2_CDR_PROP_BW_SHIFT |
354343 1 << RXPMD_G3_CDR_PROB_BW_SHIFT;
355− brcm_sata_phy_wr(base, RXPMD_REG_BANK, RXPMD_RX_CDR_CDR_PROP_BW, ~tmp,
344+ brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_CDR_CDR_PROP_BW, ~tmp,
356345 value);
357346
358347 /* Set CDR integral loop acquisition bandwidth for Gen1/2/3 */
@@ -365,7 +354,7 @@ static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port) · 6 unmodified lines
365354 1 << RXPMD_G3_CDR_ACQ_INT_BW_SHIFT;
366355 else
367356 value = 0;
368− brcm_sata_phy_wr(base, RXPMD_REG_BANK, RXPMD_RX_CDR_CDR_ACQ_INTEG_BW,
357+ brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_CDR_CDR_ACQ_INTEG_BW,
369358 ~tmp, value);
370359
371360 /* Set CDR integral loop locking bandwidth to 1 for Gen 1/2/3 */
@@ -378,7 +367,7 @@ static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port) · 6 unmodified lines
378367 1 << RXPMD_G3_CDR_LOCK_INT_BW_SHIFT;
379368 else
380369 value = 0;
381− brcm_sata_phy_wr(base, RXPMD_REG_BANK, RXPMD_RX_CDR_CDR_LOCK_INTEG_BW,
370+ brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_CDR_CDR_LOCK_INTEG_BW,
382371 ~tmp, value);
383372
384373 /* Set no guard band and clamp CDR */
@@ -387,11 +376,11 @@ static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port) · 2 unmodified lines
387376 value = 0x51;
388377 else
389378 value = 0;
390− brcm_sata_phy_wr(base, RXPMD_REG_BANK, RXPMD_RX_FREQ_MON_CONTROL1,
379+ brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_FREQ_MON_CONTROL1,
391380 ~tmp, RXPMD_MON_CORRECT_EN | value);
392381
393382 /* Turn on/off SSC */
394− brcm_sata_phy_wr(base, TX_REG_BANK, TX_ACTRL5, ~TX_ACTRL5_SSC_EN,
383+ brcm_sata_phy_wr(port, TX_REG_BANK, TX_ACTRL5, ~TX_ACTRL5_SSC_EN,
395384 port->ssc_en ? TX_ACTRL5_SSC_EN : 0);
396385
397386 return 0;
@@ -411,7 +400,6 @@ static int brcm_ns2_sata_init(struct brcm_sata_port *port) · 13 unmodified lines
411400 {
412401 int try;
413402 unsigned int val;
414− void __iomem *base = brcm_sata_pcb_base(port);
415403 void __iomem *ctrl_base = brcm_sata_ctrl_base(port);
416404 struct device *dev = port->phy_priv->dev;
417405
@@ -421,24 +409,24 @@ static int brcm_ns2_sata_init(struct brcm_sata_port *port) · 3 unmodified lines
421409 val |= (0x4 << OOB_CTRL1_BURST_MIN_SHIFT);
422410 val |= (0x9 << OOB_CTRL1_WAKE_IDLE_MAX_SHIFT);
423411 val |= (0x3 << OOB_CTRL1_WAKE_IDLE_MIN_SHIFT);
424− brcm_sata_phy_wr(base, OOB_REG_BANK, OOB_CTRL1, 0x0, val);
412+ brcm_sata_phy_wr(port, OOB_REG_BANK, OOB_CTRL1, 0x0, val);
425413 val = 0x0;
426414 val |= (0x1b << OOB_CTRL2_RESET_IDLE_MAX_SHIFT);
427415 val |= (0x2 << OOB_CTRL2_BURST_CNT_SHIFT);
428416 val |= (0x9 << OOB_CTRL2_RESET_IDLE_MIN_SHIFT);
429− brcm_sata_phy_wr(base, OOB_REG_BANK, OOB_CTRL2, 0x0, val);
417+ brcm_sata_phy_wr(port, OOB_REG_BANK, OOB_CTRL2, 0x0, val);
430418
431419 /* Configure PHY PLL register bank 1 */
432420 val = NS2_PLL1_ACTRL2_MAGIC;
433− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL2, 0x0, val);
421+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL2, 0x0, val);
434422 val = NS2_PLL1_ACTRL3_MAGIC;
435− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL3, 0x0, val);
423+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL3, 0x0, val);
436424 val = NS2_PLL1_ACTRL4_MAGIC;
437− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL4, 0x0, val);
425+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL4, 0x0, val);
438426
439427 /* Configure PHY BLOCK0 register bank */
440428 /* Set oob_clk_sel to refclk/2 */
441− brcm_sata_phy_wr(base, BLOCK0_REG_BANK, BLOCK0_SPARE,
429+ brcm_sata_phy_wr(port, BLOCK0_REG_BANK, BLOCK0_SPARE,
442430 ~BLOCK0_SPARE_OOB_CLK_SEL_MASK,
443431 BLOCK0_SPARE_OOB_CLK_SEL_REFBY2);
444432
@@ -451,7 +439,7 @@ static int brcm_ns2_sata_init(struct brcm_sata_port *port) · 6 unmodified lines
451439 /* Wait for PHY PLL lock by polling pll_lock bit */
452440 try = 50;
453441 while (try) {
454− val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
442+ val = brcm_sata_phy_rd(port, BLOCK0_REG_BANK,
455443 BLOCK0_XGXSSTATUS);
456444 if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)
457445 break;
@@ -471,9 +459,7 @@ static int brcm_ns2_sata_init(struct brcm_sata_port *port) · 13 unmodified lines
471459
472460 static int brcm_nsp_sata_init(struct brcm_sata_port *port)
473461 {
474− struct brcm_sata_phy *priv = port->phy_priv;
475462 struct device *dev = port->phy_priv->dev;
476− void __iomem *base = priv->phy_base;
477463 unsigned int oob_bank;
478464 unsigned int val, try;
479465
@@ -490,36 +476,36 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port) · 10 unmodified lines
490476 val |= (0x06 << OOB_CTRL1_BURST_MIN_SHIFT);
491477 val |= (0x0f << OOB_CTRL1_WAKE_IDLE_MAX_SHIFT);
492478 val |= (0x06 << OOB_CTRL1_WAKE_IDLE_MIN_SHIFT);
493− brcm_sata_phy_wr(base, oob_bank, OOB_CTRL1, 0x0, val);
479+ brcm_sata_phy_wr(port, oob_bank, OOB_CTRL1, 0x0, val);
494480
495481 val = 0x0;
496482 val |= (0x2e << OOB_CTRL2_RESET_IDLE_MAX_SHIFT);
497483 val |= (0x02 << OOB_CTRL2_BURST_CNT_SHIFT);
498484 val |= (0x16 << OOB_CTRL2_RESET_IDLE_MIN_SHIFT);
499− brcm_sata_phy_wr(base, oob_bank, OOB_CTRL2, 0x0, val);
485+ brcm_sata_phy_wr(port, oob_bank, OOB_CTRL2, 0x0, val);
500486
501487
502− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_ACTRL2,
488+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_ACTRL2,
503489 ~(PLL_ACTRL2_SELDIV_MASK << PLL_ACTRL2_SELDIV_SHIFT),
504490 0x0c << PLL_ACTRL2_SELDIV_SHIFT);
505491
506− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_CAP_CONTROL,
492+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_CAP_CONTROL,
507493 0xff0, 0x4f0);
508494
509495 val = PLLCONTROL_0_FREQ_DET_RESTART | PLLCONTROL_0_FREQ_MONITOR;
510− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
496+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
511497 ~val, val);
512498 val = PLLCONTROL_0_SEQ_START;
513− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
499+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
514500 ~val, 0);
515501 mdelay(10);
516− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
502+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
517503 ~val, val);
518504
519505 /* Wait for pll_seq_done bit */
520506 try = 50;
521507 while (--try) {
522− val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
508+ val = brcm_sata_phy_rd(port, BLOCK0_REG_BANK,
523509 BLOCK0_XGXSSTATUS);
524510 if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)
525511 break;
@@ -546,27 +532,25 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port) · 20 unmodified lines
546532
547533 static int brcm_sr_sata_init(struct brcm_sata_port *port)
548534 {
549− struct brcm_sata_phy *priv = port->phy_priv;
550535 struct device *dev = port->phy_priv->dev;
551− void __iomem *base = priv->phy_base;
552536 unsigned int val, try;
553537
554538 /* Configure PHY PLL register bank 1 */
555539 val = SR_PLL1_ACTRL2_MAGIC;
556− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL2, 0x0, val);
540+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL2, 0x0, val);
557541 val = SR_PLL1_ACTRL3_MAGIC;
558− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL3, 0x0, val);
542+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL3, 0x0, val);
559543 val = SR_PLL1_ACTRL4_MAGIC;
560− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL4, 0x0, val);
544+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL4, 0x0, val);
561545
562546 /* Configure PHY PLL register bank 0 */
563547 val = SR_PLL0_ACTRL6_MAGIC;
564− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_ACTRL6, 0x0, val);
548+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_ACTRL6, 0x0, val);
565549
566550 /* Wait for PHY PLL lock by polling pll_lock bit */
567551 try = 50;
568552 do {
569− val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
553+ val = brcm_sata_phy_rd(port, BLOCK0_REG_BANK,
570554 BLOCK0_XGXSSTATUS);
571555 if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)
572556 break;
@@ -581,7 +565,7 @@ static int brcm_sr_sata_init(struct brcm_sata_port *port) · 8 unmodified lines
581565 }
582566
583567 /* Invert Tx polarity */
584− brcm_sata_phy_wr(base, TX_REG_BANK, TX_ACTRL0,
568+ brcm_sata_phy_wr(port, TX_REG_BANK, TX_ACTRL0,
585569 ~TX_ACTRL0_TXPOL_FLIP, TX_ACTRL0_TXPOL_FLIP);
586570
587571 /* Configure OOB control to handle 100MHz reference clock */
@@ -589,52 +573,51 @@ static int brcm_sr_sata_init(struct brcm_sata_port *port) · 1 unmodified line
589573 (0x4 << OOB_CTRL1_BURST_MIN_SHIFT) |
590574 (0x8 << OOB_CTRL1_WAKE_IDLE_MAX_SHIFT) |
591575 (0x3 << OOB_CTRL1_WAKE_IDLE_MIN_SHIFT));
592− brcm_sata_phy_wr(base, OOB_REG_BANK, OOB_CTRL1, 0x0, val);
576+ brcm_sata_phy_wr(port, OOB_REG_BANK, OOB_CTRL1, 0x0, val);
593577 val = ((0x1b << OOB_CTRL2_RESET_IDLE_MAX_SHIFT) |
594578 (0x2 << OOB_CTRL2_BURST_CNT_SHIFT) |
595579 (0x9 << OOB_CTRL2_RESET_IDLE_MIN_SHIFT));
596− brcm_sata_phy_wr(base, OOB_REG_BANK, OOB_CTRL2, 0x0, val);
580+ brcm_sata_phy_wr(port, OOB_REG_BANK, OOB_CTRL2, 0x0, val);
597581
598582 return 0;
599583 }
600584
601585 static int brcm_dsl_sata_init(struct brcm_sata_port *port)
602586 {
603− void __iomem *base = brcm_sata_pcb_base(port);
604587 struct device *dev = port->phy_priv->dev;
605588 unsigned int try;
606589 u32 tmp;
607590
608− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL7, 0, 0x873);
591+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL7, 0, 0x873);
609592
610− brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL6, 0, 0xc000);
593+ brcm_sata_phy_wr(port, PLL1_REG_BANK, PLL1_ACTRL6, 0, 0xc000);
611594
612− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
595+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
613596 0, 0x3089);
614597 usleep_range(1000, 2000);
615598
616− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
599+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_REG_BANK_0_PLLCONTROL_0,
617600 0, 0x3088);
618601 usleep_range(1000, 2000);
619602
620− brcm_sata_phy_wr(base, AEQRX_REG_BANK_1, AEQRX_SLCAL0_CTRL0,
603+ brcm_sata_phy_wr(port, AEQRX_REG_BANK_1, AEQRX_SLCAL0_CTRL0,
621604 0, 0x3000);
622605
623− brcm_sata_phy_wr(base, AEQRX_REG_BANK_1, AEQRX_SLCAL1_CTRL0,
606+ brcm_sata_phy_wr(port, AEQRX_REG_BANK_1, AEQRX_SLCAL1_CTRL0,
624607 0, 0x3000);
625608 usleep_range(1000, 2000);
626609
627− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_CAP_CHARGE_TIME, 0, 0x32);
610+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_CAP_CHARGE_TIME, 0, 0x32);
628611
629− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_VCO_CAL_THRESH, 0, 0xa);
612+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_VCO_CAL_THRESH, 0, 0xa);
630613
631− brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_FREQ_DET_TIME, 0, 0x64);
614+ brcm_sata_phy_wr(port, PLL_REG_BANK_0, PLL_FREQ_DET_TIME, 0, 0x64);
632615 usleep_range(1000, 2000);
633616
634617 /* Acquire PLL lock */
635618 try = 50;
636619 while (try) {
637− tmp = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
620+ tmp = brcm_sata_phy_rd(port, BLOCK0_REG_BANK,
638621 BLOCK0_XGXSSTATUS);
639622 if (tmp & BLOCK0_XGXSSTATUS_PLL_LOCK)
640623 break;
@@ -687,10 +670,9 @@ static int brcm_sata_phy_init(struct phy *phy) · 46 unmodified lines
687670
688671 static void brcm_stb_sata_calibrate(struct brcm_sata_port *port)
689672 {
690− void __iomem *base = brcm_sata_pcb_base(port);
691673 u32 tmp = BIT(8);
692674
693− brcm_sata_phy_wr(base, RXPMD_REG_BANK, RXPMD_RX_FREQ_MON_CONTROL1,
675+ brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_FREQ_MON_CONTROL1,
694676 ~tmp, tmp);
695677 }
696678
drivers/phy/motorola/phy-mapphone-mdm6600.c+24−3
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #define PHY_MDM6600_PHY_DELAY_MS 4000 /* PHY enable 2.2s to 3.5s */
2222 #define PHY_MDM6600_ENABLED_DELAY_MS 8000 /* 8s more total for MDM6600 */
23+#define PHY_MDM6600_WAKE_KICK_MS 600 /* time on after GPIO toggle */
2324 #define MDM6600_MODEM_IDLE_DELAY_MS 1000 /* modem after USB suspend */
2425 #define MDM6600_MODEM_WAKE_DELAY_MS 200 /* modem response after idle */
2526
@@ -243,10 +244,24 @@ static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data) · 217 unmodified lines
243244 {
244245 struct phy_mdm6600 *ddata = data;
245246 struct gpio_desc *mode_gpio1;
247+ int error, wakeup;
246248
247249 mode_gpio1 = ddata->mode_gpios->desc[PHY_MDM6600_MODE1];
248− dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n",
249− gpiod_get_value(mode_gpio1));
250+ wakeup = gpiod_get_value(mode_gpio1);
251+ if (!wakeup)
252+ return IRQ_NONE;
253+
254+ dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n", wakeup);
255+ error = pm_runtime_get_sync(ddata->dev);
256+ if (error < 0) {
257+ pm_runtime_put_noidle(ddata->dev);
258+
259+ return IRQ_NONE;
260+ }
261+
262+ /* Just wake-up and kick the autosuspend timer */
263+ pm_runtime_mark_last_busy(ddata->dev);
264+ pm_runtime_put_autosuspend(ddata->dev);
250265
251266 return IRQ_HANDLED;
252267 }
@@ -496,8 +511,14 @@ static void phy_mdm6600_modem_wake(struct work_struct *work) · 243 unmodified lines
496511
497512 ddata = container_of(work, struct phy_mdm6600, modem_wake_work.work);
498513 phy_mdm6600_wake_modem(ddata);
514+
515+ /*
516+ * The modem does not always stay awake 1.2 seconds after toggling
517+ * the wake GPIO, and sometimes it idles after about some 600 ms
518+ * making writes time out.
519+ */
499520 schedule_delayed_work(&ddata->modem_wake_work,
500− msecs_to_jiffies(MDM6600_MODEM_IDLE_DELAY_MS));
521+ msecs_to_jiffies(PHY_MDM6600_WAKE_KICK_MS));
501522 }
502523
503524 static int __maybe_unused phy_mdm6600_runtime_suspend(struct device *dev)
drivers/phy/phy-core.c+6−12
@@ -688,11 +688,9 @@ struct phy *phy_get(struct device *dev, const char *string) · 687 unmodified lines
688688 get_device(&phy->dev);
689689
690690 link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
691− if (!link) {
692− dev_err(dev, "failed to create device link to %s\n",
691+ if (!link)
692+ dev_dbg(dev, "failed to create device link to %s\n",
693693 dev_name(phy->dev.parent));
694− return ERR_PTR(-EINVAL);
695− }
696694
697695 return phy;
698696 }
@@ -803,11 +801,9 @@ struct phy *devm_of_phy_get(struct device *dev, struct device_node *np, · 104 unmodified lines
803801 }
804802
805803 link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
806− if (!link) {
807− dev_err(dev, "failed to create device link to %s\n",
804+ if (!link)
805+ dev_dbg(dev, "failed to create device link to %s\n",
808806 dev_name(phy->dev.parent));
809− return ERR_PTR(-EINVAL);
810− }
811807
812808 return phy;
813809 }
@@ -852,11 +848,9 @@ struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np, · 38 unmodified lines
852848 devres_add(dev, ptr);
853849
854850 link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
855− if (!link) {
856− dev_err(dev, "failed to create device link to %s\n",
851+ if (!link)
852+ dev_dbg(dev, "failed to create device link to %s\n",
857853 dev_name(phy->dev.parent));
858− return ERR_PTR(-EINVAL);
859− }
860854
861855 return phy;
862856 }
drivers/phy/ti/phy-gmii-sel.c+5−5
@@ -80,20 +80,20 @@ static int phy_gmii_sel_mode(struct phy *phy, enum phy_mode mode, int submode) · 79 unmodified lines
8080 break;
8181
8282 case PHY_INTERFACE_MODE_MII:
83− mode = AM33XX_GMII_SEL_MODE_MII;
83+ case PHY_INTERFACE_MODE_GMII:
84+ gmii_sel_mode = AM33XX_GMII_SEL_MODE_MII;
8485 break;
8586
8687 default:
87− dev_warn(dev,
88− "port%u: unsupported mode: \"%s\". Defaulting to MII.\n",
89− if_phy->id, phy_modes(rgmii_id));
88+ dev_warn(dev, "port%u: unsupported mode: \"%s\"\n",
89+ if_phy->id, phy_modes(submode));
9090 return -EINVAL;
9191 }
9292
9393 if_phy->phy_if_mode = submode;
9494
9595 dev_dbg(dev, "%s id:%u mode:%u rgmii_id:%d rmii_clk_ext:%d\n",
96− __func__, if_phy->id, mode, rgmii_id,
96+ __func__, if_phy->id, submode, rgmii_id,
9797 if_phy->rmii_clock_external);
9898
9999 regfield = if_phy->fields[PHY_GMII_SEL_PORT_MODE];
drivers/pinctrl/cirrus/pinctrl-madera-core.c+13−0
@@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev) · 1072 unmodified lines
10731073 return ret;
10741074 }
10751075
1076+ platform_set_drvdata(pdev, priv);
1077+
10761078 dev_dbg(priv->dev, "pinctrl probed ok\n");
10771079
10781080 return 0;
10791081 }
10801082
1083+static int madera_pin_remove(struct platform_device *pdev)
1084+{
1085+ struct madera_pin_private *priv = platform_get_drvdata(pdev);
1086+
1087+ if (priv->madera->pdata.gpio_configs)
1088+ pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
1089+
1090+ return 0;
1091+}
1092+
10811093 static struct platform_driver madera_pin_driver = {
10821094 .probe = madera_pin_probe,
1095+ .remove = madera_pin_remove,
10831096 .driver = {
10841097 .name = "madera-pinctrl",
10851098 },
drivers/pinctrl/core.c+0−1
@@ -2021,7 +2021,6 @@ static int pinctrl_claim_hogs(struct pinctrl_dev *pctldev) · 2020 unmodified lines
20212021 return PTR_ERR(pctldev->p);
20222022 }
20232023
2024− kref_get(&pctldev->p->users);
20252024 pctldev->hog_default =
20262025 pinctrl_lookup_state(pctldev->p, PINCTRL_STATE_DEFAULT);
20272026 if (IS_ERR(pctldev->hog_default)) {
drivers/pinctrl/freescale/pinctrl-scu.c+2−2
@@ -23,12 +23,12 @@ struct imx_sc_msg_req_pad_set { · 22 unmodified lines
2323 struct imx_sc_rpc_msg hdr;
2424 u32 val;
2525 u16 pad;
26−} __packed;
26+} __packed __aligned(4);
2727
2828 struct imx_sc_msg_req_pad_get {
2929 struct imx_sc_rpc_msg hdr;
3030 u16 pad;
31−} __packed;
31+} __packed __aligned(4);
3232
3333 struct imx_sc_msg_resp_pad_get {
3434 struct imx_sc_rpc_msg hdr;
drivers/pinctrl/meson/pinctrl-meson-gxl.c+2−2
@@ -147,8 +147,8 @@ static const unsigned int sdio_d0_pins[] = { GPIOX_0 }; · 146 unmodified lines
147147 static const unsigned int sdio_d1_pins[] = { GPIOX_1 };
148148 static const unsigned int sdio_d2_pins[] = { GPIOX_2 };
149149 static const unsigned int sdio_d3_pins[] = { GPIOX_3 };
150−static const unsigned int sdio_cmd_pins[] = { GPIOX_4 };
151−static const unsigned int sdio_clk_pins[] = { GPIOX_5 };
150+static const unsigned int sdio_clk_pins[] = { GPIOX_4 };
151+static const unsigned int sdio_cmd_pins[] = { GPIOX_5 };
152152 static const unsigned int sdio_irq_pins[] = { GPIOX_7 };
153153
154154 static const unsigned int nand_ce0_pins[] = { BOOT_8 };
drivers/pinctrl/pinctrl-falcon.c+1−1
@@ -451,7 +451,7 @@ static int pinctrl_falcon_probe(struct platform_device *pdev) · 450 unmodified lines
451451 falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL);
452452 if (IS_ERR(falcon_info.clk[*bank])) {
453453 dev_err(&ppdev->dev, "failed to get clock\n");
454− of_node_put(np)
454+ of_node_put(np);
455455 return PTR_ERR(falcon_info.clk[*bank]);
456456 }
457457 falcon_info.membase[*bank] = devm_ioremap_resource(&pdev->dev,
drivers/pinctrl/qcom/pinctrl-msm.c+1−2
@@ -1104,7 +1104,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) · 1103 unmodified lines
11041104 pctrl->irq_chip.irq_mask = msm_gpio_irq_mask;
11051105 pctrl->irq_chip.irq_unmask = msm_gpio_irq_unmask;
11061106 pctrl->irq_chip.irq_ack = msm_gpio_irq_ack;
1107− pctrl->irq_chip.irq_eoi = irq_chip_eoi_parent;
11081107 pctrl->irq_chip.irq_set_type = msm_gpio_irq_set_type;
11091108 pctrl->irq_chip.irq_set_wake = msm_gpio_irq_set_wake;
11101109 pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres;
@@ -1118,7 +1117,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) · 7 unmodified lines
11181117 if (!chip->irq.parent_domain)
11191118 return -EPROBE_DEFER;
11201119 chip->irq.child_to_parent_hwirq = msm_gpio_wakeirq;
1121−
1120+ pctrl->irq_chip.irq_eoi = irq_chip_eoi_parent;
11221121 /*
11231122 * Let's skip handling the GPIOs, if the parent irqchip
11241123 * is handling the direct connect IRQ of the GPIO.
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c+1−1
@@ -794,7 +794,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) · 793 unmodified lines
794794 girq->fwnode = of_node_to_fwnode(pctrl->dev->of_node);
795795 girq->parent_domain = parent_domain;
796796 girq->child_to_parent_hwirq = pm8xxx_child_to_parent_hwirq;
797− girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_fourcell;
797+ girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_twocell;
798798 girq->child_offset_to_irq = pm8xxx_child_offset_to_irq;
799799 girq->child_irq_domain_ops.translate = pm8xxx_domain_translate;
800800
drivers/platform/chrome/wilco_ec/properties.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55
66 #include <linux/platform_data/wilco-ec.h>
77 #include <linux/string.h>
8−#include <linux/unaligned/le_memmove.h>
8+#include <asm/unaligned.h>
99
1010 /* Operation code; what the EC should do with the property */
1111 enum ec_property_op {
drivers/regulator/stm32-vrefbuf.c+2−1
@@ -88,7 +88,7 @@ static int stm32_vrefbuf_disable(struct regulator_dev *rdev) · 87 unmodified lines
8888 }
8989
9090 val = readl_relaxed(priv->base + STM32_VREFBUF_CSR);
91− val = (val & ~STM32_ENVR) | STM32_HIZ;
91+ val &= ~STM32_ENVR;
9292 writel_relaxed(val, priv->base + STM32_VREFBUF_CSR);
9393
9494 pm_runtime_mark_last_busy(priv->dev);
@@ -175,6 +175,7 @@ static const struct regulator_desc stm32_vrefbuf_regu = { · 80 unmodified lines
175175 .volt_table = stm32_vrefbuf_voltages,
176176 .n_voltages = ARRAY_SIZE(stm32_vrefbuf_voltages),
177177 .ops = &stm32_vrefbuf_volt_ops,
178+ .off_on_delay = 1000,
178179 .type = REGULATOR_VOLTAGE,
179180 .owner = THIS_MODULE,
180181 };
drivers/reset/Kconfig+2−1
@@ -51,6 +51,7 @@ config RESET_BRCMSTB · 50 unmodified lines
5151
5252 config RESET_BRCMSTB_RESCAL
5353 bool "Broadcom STB RESCAL reset controller"
54+ depends on HAS_IOMEM
5455 default ARCH_BRCMSTB || COMPILE_TEST
5556 help
5657 This enables the RESCAL reset controller for SATA, PCIe0, or PCIe1 on
@@ -73,7 +74,7 @@ config RESET_IMX7 · 16 unmodified lines
7374
7475 config RESET_INTEL_GW
7576 bool "Intel Reset Controller Driver"
76− depends on OF
77+ depends on OF && HAS_IOMEM
7778 select REGMAP_MMIO
7879 help
7980 This enables the reset controller driver for Intel Gateway SoCs.
drivers/rtc/Kconfig+1−0
@@ -327,6 +327,7 @@ config RTC_DRV_MAX6900 · 326 unmodified lines
327327 config RTC_DRV_MAX8907
328328 tristate "Maxim MAX8907"
329329 depends on MFD_MAX8907 || COMPILE_TEST
330+ select REGMAP_IRQ
330331 help
331332 If you say yes here you will get support for the
332333 RTC of Maxim MAX8907 PMIC.
drivers/s390/block/dasd.c+24−3
@@ -178,6 +178,8 @@ struct dasd_block *dasd_alloc_block(void) · 177 unmodified lines
178178 (unsigned long) block);
179179 INIT_LIST_HEAD(&block->ccw_queue);
180180 spin_lock_init(&block->queue_lock);
181+ INIT_LIST_HEAD(&block->format_list);
182+ spin_lock_init(&block->format_lock);
181183 timer_setup(&block->timer, dasd_block_timeout, 0);
182184 spin_lock_init(&block->profile.lock);
183185
@@ -1779,20 +1781,26 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, · 1595 unmodified lines
17791781
17801782 if (dasd_ese_needs_format(cqr->block, irb)) {
17811783 if (rq_data_dir((struct request *)cqr->callback_data) == READ) {
1782− device->discipline->ese_read(cqr);
1784+ device->discipline->ese_read(cqr, irb);
17831785 cqr->status = DASD_CQR_SUCCESS;
17841786 cqr->stopclk = now;
17851787 dasd_device_clear_timer(device);
17861788 dasd_schedule_device_bh(device);
17871789 return;
17881790 }
1789− fcqr = device->discipline->ese_format(device, cqr);
1791+ fcqr = device->discipline->ese_format(device, cqr, irb);
17901792 if (IS_ERR(fcqr)) {
1793+ if (PTR_ERR(fcqr) == -EINVAL) {
1794+ cqr->status = DASD_CQR_ERROR;
1795+ return;
1796+ }
17911797 /*
17921798 * If we can't format now, let the request go
17931799 * one extra round. Maybe we can format later.
17941800 */
17951801 cqr->status = DASD_CQR_QUEUED;
1802+ dasd_schedule_device_bh(device);
1803+ return;
17961804 } else {
17971805 fcqr->status = DASD_CQR_QUEUED;
17981806 cqr->status = DASD_CQR_QUEUED;
@@ -2748,11 +2756,13 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) · 949 unmodified lines
27482756 {
27492757 struct request *req;
27502758 blk_status_t error = BLK_STS_OK;
2759+ unsigned int proc_bytes;
27512760 int status;
27522761
27532762 req = (struct request *) cqr->callback_data;
27542763 dasd_profile_end(cqr->block, cqr, req);
27552764
2765+ proc_bytes = cqr->proc_bytes;
27562766 status = cqr->block->base->discipline->free_cp(cqr, req);
27572767 if (status < 0)
27582768 error = errno_to_blk_status(status);
@@ -2783,7 +2793,18 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) · 24 unmodified lines
27832793 blk_mq_end_request(req, error);
27842794 blk_mq_run_hw_queues(req->q, true);
27852795 } else {
2786− blk_mq_complete_request(req);
2796+ /*
2797+ * Partial completed requests can happen with ESE devices.
2798+ * During read we might have gotten a NRF error and have to
2799+ * complete a request partially.
2800+ */
2801+ if (proc_bytes) {
2802+ blk_update_request(req, BLK_STS_OK,
2803+ blk_rq_bytes(req) - proc_bytes);
2804+ blk_mq_requeue_request(req, true);
2805+ } else {
2806+ blk_mq_complete_request(req);
2807+ }
27872808 }
27882809 }
27892810
drivers/s390/block/dasd_eckd.c+156−7
@@ -207,6 +207,45 @@ static void set_ch_t(struct ch_t *geo, __u32 cyl, __u8 head) · 206 unmodified lines
207207 geo->head |= head;
208208 }
209209
210+/*
211+ * calculate failing track from sense data depending if
212+ * it is an EAV device or not
213+ */
214+static int dasd_eckd_track_from_irb(struct irb *irb, struct dasd_device *device,
215+ sector_t *track)
216+{
217+ struct dasd_eckd_private *private = device->private;
218+ u8 *sense = NULL;
219+ u32 cyl;
220+ u8 head;
221+
222+ sense = dasd_get_sense(irb);
223+ if (!sense) {
224+ DBF_DEV_EVENT(DBF_WARNING, device, "%s",
225+ "ESE error no sense data\n");
226+ return -EINVAL;
227+ }
228+ if (!(sense[27] & DASD_SENSE_BIT_2)) {
229+ DBF_DEV_EVENT(DBF_WARNING, device, "%s",
230+ "ESE error no valid track data\n");
231+ return -EINVAL;
232+ }
233+
234+ if (sense[27] & DASD_SENSE_BIT_3) {
235+ /* enhanced addressing */
236+ cyl = sense[30] << 20;
237+ cyl |= (sense[31] & 0xF0) << 12;
238+ cyl |= sense[28] << 8;
239+ cyl |= sense[29];
240+ } else {
241+ cyl = sense[29] << 8;
242+ cyl |= sense[30];
243+ }
244+ head = sense[31] & 0x0F;
245+ *track = cyl * private->rdc_data.trk_per_cyl + head;
246+ return 0;
247+}
248+
210249 static int set_timestamp(struct ccw1 *ccw, struct DE_eckd_data *data,
211250 struct dasd_device *device)
212251 {
@@ -2986,6 +3025,37 @@ static int dasd_eckd_format_device(struct dasd_device *base, · 2773 unmodified lines
29863025 0, NULL);
29873026 }
29883027
3028+static bool test_and_set_format_track(struct dasd_format_entry *to_format,
3029+ struct dasd_block *block)
3030+{
3031+ struct dasd_format_entry *format;
3032+ unsigned long flags;
3033+ bool rc = false;
3034+
3035+ spin_lock_irqsave(&block->format_lock, flags);
3036+ list_for_each_entry(format, &block->format_list, list) {
3037+ if (format->track == to_format->track) {
3038+ rc = true;
3039+ goto out;
3040+ }
3041+ }
3042+ list_add_tail(&to_format->list, &block->format_list);
3043+
3044+out:
3045+ spin_unlock_irqrestore(&block->format_lock, flags);
3046+ return rc;
3047+}
3048+
3049+static void clear_format_track(struct dasd_format_entry *format,
3050+ struct dasd_block *block)
3051+{
3052+ unsigned long flags;
3053+
3054+ spin_lock_irqsave(&block->format_lock, flags);
3055+ list_del_init(&format->list);
3056+ spin_unlock_irqrestore(&block->format_lock, flags);
3057+}
3058+
29893059 /*
29903060 * Callback function to free ESE format requests.
29913061 */
@@ -2993,15 +3063,19 @@ static void dasd_eckd_ese_format_cb(struct dasd_ccw_req *cqr, void *data) · 1 unmodified line
29933063 {
29943064 struct dasd_device *device = cqr->startdev;
29953065 struct dasd_eckd_private *private = device->private;
3066+ struct dasd_format_entry *format = data;
29963067
3068+ clear_format_track(format, cqr->basedev->block);
29973069 private->count--;
29983070 dasd_ffree_request(cqr, device);
29993071 }
30003072
30013073 static struct dasd_ccw_req *
3002−dasd_eckd_ese_format(struct dasd_device *startdev, struct dasd_ccw_req *cqr)
3074+dasd_eckd_ese_format(struct dasd_device *startdev, struct dasd_ccw_req *cqr,
3075+ struct irb *irb)
30033076 {
30043077 struct dasd_eckd_private *private;
3078+ struct dasd_format_entry *format;
30053079 struct format_data_t fdata;
30063080 unsigned int recs_per_trk;
30073081 struct dasd_ccw_req *fcqr;
@@ -3011,23 +3085,39 @@ dasd_eckd_ese_format(struct dasd_device *startdev, struct dasd_ccw_req *cqr) · 3 unmodified lines
30113085 struct request *req;
30123086 sector_t first_trk;
30133087 sector_t last_trk;
3088+ sector_t curr_trk;
30143089 int rc;
30153090
30163091 req = cqr->callback_data;
3017− base = cqr->block->base;
3092+ block = cqr->block;
3093+ base = block->base;
30183094 private = base->private;
3019− block = base->block;
30203095 blksize = block->bp_block;
30213096 recs_per_trk = recs_per_track(&private->rdc_data, 0, blksize);
3097+ format = &startdev->format_entry;
30223098
30233099 first_trk = blk_rq_pos(req) >> block->s2b_shift;
30243100 sector_div(first_trk, recs_per_trk);
30253101 last_trk =
30263102 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
30273103 sector_div(last_trk, recs_per_trk);
3104+ rc = dasd_eckd_track_from_irb(irb, base, &curr_trk);
3105+ if (rc)
3106+ return ERR_PTR(rc);
30283107
3029− fdata.start_unit = first_trk;
3030− fdata.stop_unit = last_trk;
3108+ if (curr_trk < first_trk || curr_trk > last_trk) {
3109+ DBF_DEV_EVENT(DBF_WARNING, startdev,
3110+ "ESE error track %llu not within range %llu - %llu\n",
3111+ curr_trk, first_trk, last_trk);
3112+ return ERR_PTR(-EINVAL);
3113+ }
3114+ format->track = curr_trk;
3115+ /* test if track is already in formatting by another thread */
3116+ if (test_and_set_format_track(format, block))
3117+ return ERR_PTR(-EEXIST);
3118+
3119+ fdata.start_unit = curr_trk;
3120+ fdata.stop_unit = curr_trk;
30313121 fdata.blksize = blksize;
30323122 fdata.intensity = private->uses_cdl ? DASD_FMT_INT_COMPAT : 0;
30333123
@@ -3044,6 +3134,7 @@ dasd_eckd_ese_format(struct dasd_device *startdev, struct dasd_ccw_req *cqr) · 10 unmodified lines
30443134 return fcqr;
30453135
30463136 fcqr->callback = dasd_eckd_ese_format_cb;
3137+ fcqr->callback_data = (void *) format;
30473138
30483139 return fcqr;
30493140 }
@@ -3051,29 +3142,87 @@ dasd_eckd_ese_format(struct dasd_device *startdev, struct dasd_ccw_req *cqr) · 1 unmodified line
30513142 /*
30523143 * When data is read from an unformatted area of an ESE volume, this function
30533144 * returns zeroed data and thereby mimics a read of zero data.
3145+ *
3146+ * The first unformatted track is the one that got the NRF error, the address is
3147+ * encoded in the sense data.
3148+ *
3149+ * All tracks before have returned valid data and should not be touched.
3150+ * All tracks after the unformatted track might be formatted or not. This is
3151+ * currently not known, remember the processed data and return the remainder of
3152+ * the request to the blocklayer in __dasd_cleanup_cqr().
30543153 */
3055−static void dasd_eckd_ese_read(struct dasd_ccw_req *cqr)
3154+static int dasd_eckd_ese_read(struct dasd_ccw_req *cqr, struct irb *irb)
30563155 {
3156+ struct dasd_eckd_private *private;
3157+ sector_t first_trk, last_trk;
3158+ sector_t first_blk, last_blk;
30573159 unsigned int blksize, off;
3160+ unsigned int recs_per_trk;
30583161 struct dasd_device *base;
30593162 struct req_iterator iter;
3163+ struct dasd_block *block;
3164+ unsigned int skip_block;
3165+ unsigned int blk_count;
30603166 struct request *req;
30613167 struct bio_vec bv;
3168+ sector_t curr_trk;
3169+ sector_t end_blk;
30623170 char *dst;
3171+ int rc;
30633172
30643173 req = (struct request *) cqr->callback_data;
30653174 base = cqr->block->base;
30663175 blksize = base->block->bp_block;
3176+ block = cqr->block;
3177+ private = base->private;
3178+ skip_block = 0;
3179+ blk_count = 0;
3180+
3181+ recs_per_trk = recs_per_track(&private->rdc_data, 0, blksize);
3182+ first_trk = first_blk = blk_rq_pos(req) >> block->s2b_shift;
3183+ sector_div(first_trk, recs_per_trk);
3184+ last_trk = last_blk =
3185+ (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
3186+ sector_div(last_trk, recs_per_trk);
3187+ rc = dasd_eckd_track_from_irb(irb, base, &curr_trk);
3188+ if (rc)
3189+ return rc;
3190+
3191+ /* sanity check if the current track from sense data is valid */
3192+ if (curr_trk < first_trk || curr_trk > last_trk) {
3193+ DBF_DEV_EVENT(DBF_WARNING, base,
3194+ "ESE error track %llu not within range %llu - %llu\n",
3195+ curr_trk, first_trk, last_trk);
3196+ return -EINVAL;
3197+ }
3198+
3199+ /*
3200+ * if not the first track got the NRF error we have to skip over valid
3201+ * blocks
3202+ */
3203+ if (curr_trk != first_trk)
3204+ skip_block = curr_trk * recs_per_trk - first_blk;
3205+
3206+ /* we have no information beyond the current track */
3207+ end_blk = (curr_trk + 1) * recs_per_trk;
30673208
30683209 rq_for_each_segment(bv, req, iter) {
30693210 dst = page_address(bv.bv_page) + bv.bv_offset;
30703211 for (off = 0; off < bv.bv_len; off += blksize) {
3071− if (dst && rq_data_dir(req) == READ) {
3212+ if (first_blk + blk_count >= end_blk) {
3213+ cqr->proc_bytes = blk_count * blksize;
3214+ return 0;
3215+ }
3216+ if (dst && !skip_block) {
30723217 dst += off;
30733218 memset(dst, 0, blksize);
3219+ } else {
3220+ skip_block--;
30743221 }
3222+ blk_count++;
30753223 }
30763224 }
3225+ return 0;
30773226 }
30783227
30793228 /*
drivers/s390/block/dasd_int.h+13−2
@@ -187,6 +187,7 @@ struct dasd_ccw_req { · 186 unmodified lines
187187
188188 void (*callback)(struct dasd_ccw_req *, void *data);
189189 void *callback_data;
190+ unsigned int proc_bytes; /* bytes for partial completion */
190191 };
191192
192193 /*
@@ -387,8 +388,9 @@ struct dasd_discipline { · 194 unmodified lines
387388 int (*ext_pool_warn_thrshld)(struct dasd_device *);
388389 int (*ext_pool_oos)(struct dasd_device *);
389390 int (*ext_pool_exhaust)(struct dasd_device *, struct dasd_ccw_req *);
390− struct dasd_ccw_req *(*ese_format)(struct dasd_device *, struct dasd_ccw_req *);
391− void (*ese_read)(struct dasd_ccw_req *);
391+ struct dasd_ccw_req *(*ese_format)(struct dasd_device *,
392+ struct dasd_ccw_req *, struct irb *);
393+ int (*ese_read)(struct dasd_ccw_req *, struct irb *);
392394 };
393395
394396 extern struct dasd_discipline *dasd_diag_discipline_pointer;
@@ -474,6 +476,11 @@ struct dasd_profile { · 79 unmodified lines
474476 spinlock_t lock;
475477 };
476478
479+struct dasd_format_entry {
480+ struct list_head list;
481+ sector_t track;
482+};
483+
477484 struct dasd_device {
478485 /* Block device stuff. */
479486 struct dasd_block *block;
@@ -539,6 +546,7 @@ struct dasd_device { · 59 unmodified lines
539546 struct dentry *debugfs_dentry;
540547 struct dentry *hosts_dentry;
541548 struct dasd_profile profile;
549+ struct dasd_format_entry format_entry;
542550 };
543551
544552 struct dasd_block {
@@ -564,6 +572,9 @@ struct dasd_block { · 19 unmodified lines
564572
565573 struct dentry *debugfs_dentry;
566574 struct dasd_profile profile;
575+
576+ struct list_head format_list;
577+ spinlock_t format_lock;
567578 };
568579
569580 struct dasd_attention_data {
drivers/s390/net/qeth_core.h+2−2
@@ -369,7 +369,7 @@ enum qeth_qdio_info_states { · 368 unmodified lines
369369 struct qeth_buffer_pool_entry {
370370 struct list_head list;
371371 struct list_head init_list;
372− void *elements[QDIO_MAX_ELEMENTS_PER_BUFFER];
372+ struct page *elements[QDIO_MAX_ELEMENTS_PER_BUFFER];
373373 };
374374
375375 struct qeth_qdio_buffer_pool {
@@ -983,7 +983,7 @@ extern const struct attribute_group qeth_device_blkt_group; · 607 unmodified lines
983983 extern const struct device_type qeth_generic_devtype;
984984
985985 const char *qeth_get_cardname_short(struct qeth_card *);
986−int qeth_realloc_buffer_pool(struct qeth_card *, int);
986+int qeth_resize_buffer_pool(struct qeth_card *card, unsigned int count);
987987 int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id);
988988 void qeth_core_free_discipline(struct qeth_card *);
989989
drivers/s390/net/qeth_core_main.c+118−58
@@ -65,7 +65,6 @@ static struct lock_class_key qdio_out_skb_queue_key; · 64 unmodified lines
6565 static void qeth_issue_next_read_cb(struct qeth_card *card,
6666 struct qeth_cmd_buffer *iob,
6767 unsigned int data_length);
68−static void qeth_free_buffer_pool(struct qeth_card *);
6968 static int qeth_qdio_establish(struct qeth_card *);
7069 static void qeth_free_qdio_queues(struct qeth_card *card);
7170 static void qeth_notify_skbs(struct qeth_qdio_out_q *queue,
@@ -212,49 +211,121 @@ void qeth_clear_working_pool_list(struct qeth_card *card) · 140 unmodified lines
212211 }
213212 EXPORT_SYMBOL_GPL(qeth_clear_working_pool_list);
214213
214+static void qeth_free_pool_entry(struct qeth_buffer_pool_entry *entry)
215+{
216+ unsigned int i;
217+
218+ for (i = 0; i < ARRAY_SIZE(entry->elements); i++) {
219+ if (entry->elements[i])
220+ __free_page(entry->elements[i]);
221+ }
222+
223+ kfree(entry);
224+}
225+
226+static void qeth_free_buffer_pool(struct qeth_card *card)
227+{
228+ struct qeth_buffer_pool_entry *entry, *tmp;
229+
230+ list_for_each_entry_safe(entry, tmp, &card->qdio.init_pool.entry_list,
231+ init_list) {
232+ list_del(&entry->init_list);
233+ qeth_free_pool_entry(entry);
234+ }
235+}
236+
237+static struct qeth_buffer_pool_entry *qeth_alloc_pool_entry(unsigned int pages)
238+{
239+ struct qeth_buffer_pool_entry *entry;
240+ unsigned int i;
241+
242+ entry = kzalloc(sizeof(*entry), GFP_KERNEL);
243+ if (!entry)
244+ return NULL;
245+
246+ for (i = 0; i < pages; i++) {
247+ entry->elements[i] = alloc_page(GFP_KERNEL);
248+
249+ if (!entry->elements[i]) {
250+ qeth_free_pool_entry(entry);
251+ return NULL;
252+ }
253+ }
254+
255+ return entry;
256+}
257+
215258 static int qeth_alloc_buffer_pool(struct qeth_card *card)
216259 {
217− struct qeth_buffer_pool_entry *pool_entry;
218− void *ptr;
219− int i, j;
260+ unsigned int buf_elements = QETH_MAX_BUFFER_ELEMENTS(card);
261+ unsigned int i;
220262
221263 QETH_CARD_TEXT(card, 5, "alocpool");
222264 for (i = 0; i < card->qdio.init_pool.buf_count; ++i) {
223− pool_entry = kzalloc(sizeof(*pool_entry), GFP_KERNEL);
224− if (!pool_entry) {
265+ struct qeth_buffer_pool_entry *entry;
266+
267+ entry = qeth_alloc_pool_entry(buf_elements);
268+ if (!entry) {
225269 qeth_free_buffer_pool(card);
226270 return -ENOMEM;
227271 }
228− for (j = 0; j < QETH_MAX_BUFFER_ELEMENTS(card); ++j) {
229− ptr = (void *) __get_free_page(GFP_KERNEL);
230− if (!ptr) {
231− while (j > 0)
232− free_page((unsigned long)
233− pool_entry->elements[--j]);
234− kfree(pool_entry);
235− qeth_free_buffer_pool(card);
236− return -ENOMEM;
237− }
238− pool_entry->elements[j] = ptr;
239− }
240− list_add(&pool_entry->init_list,
241− &card->qdio.init_pool.entry_list);
272+
273+ list_add(&entry->init_list, &card->qdio.init_pool.entry_list);
242274 }
243275 return 0;
244276 }
245277
246−int qeth_realloc_buffer_pool(struct qeth_card *card, int bufcnt)
278+int qeth_resize_buffer_pool(struct qeth_card *card, unsigned int count)
247279 {
280+ unsigned int buf_elements = QETH_MAX_BUFFER_ELEMENTS(card);
281+ struct qeth_qdio_buffer_pool *pool = &card->qdio.init_pool;
282+ struct qeth_buffer_pool_entry *entry, *tmp;
283+ int delta = count - pool->buf_count;
284+ LIST_HEAD(entries);
285+
248286 QETH_CARD_TEXT(card, 2, "realcbp");
249287
250− /* TODO: steel/add buffers from/to a running card's buffer pool (?) */
251− qeth_clear_working_pool_list(card);
252− qeth_free_buffer_pool(card);
253− card->qdio.in_buf_pool.buf_count = bufcnt;
254− card->qdio.init_pool.buf_count = bufcnt;
255− return qeth_alloc_buffer_pool(card);
288+ /* Defer until queue is allocated: */
289+ if (!card->qdio.in_q)
290+ goto out;
291+
292+ /* Remove entries from the pool: */
293+ while (delta < 0) {
294+ entry = list_first_entry(&pool->entry_list,
295+ struct qeth_buffer_pool_entry,
296+ init_list);
297+ list_del(&entry->init_list);
298+ qeth_free_pool_entry(entry);
299+
300+ delta++;
301+ }
302+
303+ /* Allocate additional entries: */
304+ while (delta > 0) {
305+ entry = qeth_alloc_pool_entry(buf_elements);
306+ if (!entry) {
307+ list_for_each_entry_safe(entry, tmp, &entries,
308+ init_list) {
309+ list_del(&entry->init_list);
310+ qeth_free_pool_entry(entry);
311+ }
312+
313+ return -ENOMEM;
314+ }
315+
316+ list_add(&entry->init_list, &entries);
317+
318+ delta--;
319+ }
320+
321+ list_splice(&entries, &pool->entry_list);
322+
323+out:
324+ card->qdio.in_buf_pool.buf_count = count;
325+ pool->buf_count = count;
326+ return 0;
256327 }
257−EXPORT_SYMBOL_GPL(qeth_realloc_buffer_pool);
328+EXPORT_SYMBOL_GPL(qeth_resize_buffer_pool);
258329
259330 static void qeth_free_qdio_queue(struct qeth_qdio_q *q)
260331 {
@@ -1170,19 +1241,6 @@ void qeth_drain_output_queues(struct qeth_card *card) · 909 unmodified lines
11701241 }
11711242 EXPORT_SYMBOL_GPL(qeth_drain_output_queues);
11721243
1173−static void qeth_free_buffer_pool(struct qeth_card *card)
1174−{
1175− struct qeth_buffer_pool_entry *pool_entry, *tmp;
1176− int i = 0;
1177− list_for_each_entry_safe(pool_entry, tmp,
1178− &card->qdio.init_pool.entry_list, init_list){
1179− for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i)
1180− free_page((unsigned long)pool_entry->elements[i]);
1181− list_del(&pool_entry->init_list);
1182− kfree(pool_entry);
1183− }
1184−}
1185−
11861244 static int qeth_osa_set_output_queues(struct qeth_card *card, bool single)
11871245 {
11881246 unsigned int count = single ? 1 : card->dev->num_tx_queues;
@@ -1204,7 +1262,6 @@ static int qeth_osa_set_output_queues(struct qeth_card *card, bool single) · 15 unmodified lines
12041262 if (count == 1)
12051263 dev_info(&card->gdev->dev, "Priority Queueing not supported\n");
12061264
1207− card->qdio.default_out_queue = single ? 0 : QETH_DEFAULT_QUEUE;
12081265 card->qdio.no_out_queues = count;
12091266 return 0;
12101267 }
@@ -2393,7 +2450,6 @@ static void qeth_free_qdio_queues(struct qeth_card *card) · 1182 unmodified lines
23932450 return;
23942451
23952452 qeth_free_cq(card);
2396− cancel_delayed_work_sync(&card->buffer_reclaim_work);
23972453 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) {
23982454 if (card->qdio.in_q->bufs[j].rx_skb)
23992455 dev_kfree_skb_any(card->qdio.in_q->bufs[j].rx_skb);
@@ -2575,7 +2631,6 @@ static struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry( · 175 unmodified lines
25752631 struct list_head *plh;
25762632 struct qeth_buffer_pool_entry *entry;
25772633 int i, free;
2578− struct page *page;
25792634
25802635 if (list_empty(&card->qdio.in_buf_pool.entry_list))
25812636 return NULL;
@@ -2584,7 +2639,7 @@ static struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry( · 2 unmodified lines
25842639 entry = list_entry(plh, struct qeth_buffer_pool_entry, list);
25852640 free = 1;
25862641 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i) {
2587− if (page_count(virt_to_page(entry->elements[i])) > 1) {
2642+ if (page_count(entry->elements[i]) > 1) {
25882643 free = 0;
25892644 break;
25902645 }
@@ -2599,15 +2654,15 @@ static struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry( · 8 unmodified lines
25992654 entry = list_entry(card->qdio.in_buf_pool.entry_list.next,
26002655 struct qeth_buffer_pool_entry, list);
26012656 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i) {
2602− if (page_count(virt_to_page(entry->elements[i])) > 1) {
2603− page = alloc_page(GFP_ATOMIC);
2604− if (!page) {
2657+ if (page_count(entry->elements[i]) > 1) {
2658+ struct page *page = alloc_page(GFP_ATOMIC);
2659+
2660+ if (!page)
26052661 return NULL;
2606− } else {
2607− free_page((unsigned long)entry->elements[i]);
2608− entry->elements[i] = page_address(page);
2609− QETH_CARD_STAT_INC(card, rx_sg_alloc_page);
2610− }
2662+
2663+ __free_page(entry->elements[i]);
2664+ entry->elements[i] = page;
2665+ QETH_CARD_STAT_INC(card, rx_sg_alloc_page);
26112666 }
26122667 }
26132668 list_del_init(&entry->list);
@@ -2625,12 +2680,12 @@ static int qeth_init_input_buffer(struct qeth_card *card, · 11 unmodified lines
26252680 ETH_HLEN +
26262681 sizeof(struct ipv6hdr));
26272682 if (!buf->rx_skb)
2628− return 1;
2683+ return -ENOMEM;
26292684 }
26302685
26312686 pool_entry = qeth_find_free_buffer_pool_entry(card);
26322687 if (!pool_entry)
2633− return 1;
2688+ return -ENOBUFS;
26342689
26352690 /*
26362691 * since the buffer is accessed only from the input_tasklet
@@ -2643,7 +2698,7 @@ static int qeth_init_input_buffer(struct qeth_card *card, · 6 unmodified lines
26432698 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i) {
26442699 buf->buffer->element[i].length = PAGE_SIZE;
26452700 buf->buffer->element[i].addr =
2646− virt_to_phys(pool_entry->elements[i]);
2701+ page_to_phys(pool_entry->elements[i]);
26472702 if (i == QETH_MAX_BUFFER_ELEMENTS(card) - 1)
26482703 buf->buffer->element[i].eflags = SBAL_EFLAGS_LAST_ENTRY;
26492704 else
@@ -2675,10 +2730,15 @@ static int qeth_init_qdio_queues(struct qeth_card *card) · 25 unmodified lines
26752730 /* inbound queue */
26762731 qdio_reset_buffers(card->qdio.in_q->qdio_bufs, QDIO_MAX_BUFFERS_PER_Q);
26772732 memset(&card->rx, 0, sizeof(struct qeth_rx));
2733+
26782734 qeth_initialize_working_pool_list(card);
26792735 /*give only as many buffers to hardware as we have buffer pool entries*/
2680− for (i = 0; i < card->qdio.in_buf_pool.buf_count - 1; ++i)
2681− qeth_init_input_buffer(card, &card->qdio.in_q->bufs[i]);
2736+ for (i = 0; i < card->qdio.in_buf_pool.buf_count - 1; i++) {
2737+ rc = qeth_init_input_buffer(card, &card->qdio.in_q->bufs[i]);
2738+ if (rc)
2739+ return rc;
2740+ }
2741+
26822742 card->qdio.in_q->next_buf_to_init =
26832743 card->qdio.in_buf_pool.buf_count - 1;
26842744 rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, 0, 0,
drivers/s390/net/qeth_core_sys.c+4−5
@@ -247,8 +247,8 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev, · 246 unmodified lines
247247 struct device_attribute *attr, const char *buf, size_t count)
248248 {
249249 struct qeth_card *card = dev_get_drvdata(dev);
250+ unsigned int cnt;
250251 char *tmp;
251− int cnt, old_cnt;
252252 int rc = 0;
253253
254254 mutex_lock(&card->conf_mutex);
@@ -257,13 +257,12 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev, · 2 unmodified lines
257257 goto out;
258258 }
259259
260− old_cnt = card->qdio.in_buf_pool.buf_count;
261260 cnt = simple_strtoul(buf, &tmp, 10);
262261 cnt = (cnt < QETH_IN_BUF_COUNT_MIN) ? QETH_IN_BUF_COUNT_MIN :
263262 ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
264− if (old_cnt != cnt) {
265− rc = qeth_realloc_buffer_pool(card, cnt);
266− }
263+
264+ rc = qeth_resize_buffer_pool(card, cnt);
265+
267266 out:
268267 mutex_unlock(&card->conf_mutex);
269268 return rc ? rc : count;
drivers/s390/net/qeth_l2_main.c+1−0
@@ -284,6 +284,7 @@ static void qeth_l2_stop_card(struct qeth_card *card) · 283 unmodified lines
284284 if (card->state == CARD_STATE_SOFTSETUP) {
285285 qeth_clear_ipacmd_list(card);
286286 qeth_drain_output_queues(card);
287+ cancel_delayed_work_sync(&card->buffer_reclaim_work);
287288 card->state = CARD_STATE_DOWN;
288289 }
289290
drivers/s390/net/qeth_l3_main.c+1−0
@@ -1178,6 +1178,7 @@ static void qeth_l3_stop_card(struct qeth_card *card) · 1177 unmodified lines
11781178 qeth_l3_clear_ip_htable(card, 1);
11791179 qeth_clear_ipacmd_list(card);
11801180 qeth_drain_output_queues(card);
1181+ cancel_delayed_work_sync(&card->buffer_reclaim_work);
11811182 card->state = CARD_STATE_DOWN;
11821183 }
11831184
drivers/s390/net/qeth_l3_sys.c+4−5
@@ -206,12 +206,11 @@ static ssize_t qeth_l3_dev_sniffer_store(struct device *dev, · 205 unmodified lines
206206 qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd);
207207 if (card->ssqd.qdioac2 & CHSC_AC2_SNIFFER_AVAILABLE) {
208208 card->options.sniffer = i;
209− if (card->qdio.init_pool.buf_count !=
210− QETH_IN_BUF_COUNT_MAX)
211− qeth_realloc_buffer_pool(card,
212− QETH_IN_BUF_COUNT_MAX);
213− } else
209+ qeth_resize_buffer_pool(card, QETH_IN_BUF_COUNT_MAX);
210+ } else {
214211 rc = -EPERM;
212+ }
213+
215214 break;
216215 default:
217216 rc = -EINVAL;
drivers/s390/scsi/zfcp_fsf.h+1−1
@@ -410,7 +410,7 @@ struct fsf_qtcb_bottom_port { · 409 unmodified lines
410410 u8 cb_util;
411411 u8 a_util;
412412 u8 res2;
413− u16 temperature;
413+ s16 temperature;
414414 u16 vcc;
415415 u16 tx_bias;
416416 u16 tx_power;
drivers/s390/scsi/zfcp_sysfs.c+1−1
@@ -800,7 +800,7 @@ static ZFCP_DEV_ATTR(adapter_diag, b2b_credit, 0400, · 799 unmodified lines
800800 static ZFCP_DEV_ATTR(adapter_diag_sfp, _name, 0400, \
801801 zfcp_sysfs_adapter_diag_sfp_##_name##_show, NULL)
802802
803−ZFCP_DEFINE_DIAG_SFP_ATTR(temperature, temperature, 5, "%hu");
803+ZFCP_DEFINE_DIAG_SFP_ATTR(temperature, temperature, 6, "%hd");
804804 ZFCP_DEFINE_DIAG_SFP_ATTR(vcc, vcc, 5, "%hu");
805805 ZFCP_DEFINE_DIAG_SFP_ATTR(tx_bias, tx_bias, 5, "%hu");
806806 ZFCP_DEFINE_DIAG_SFP_ATTR(tx_power, tx_power, 5, "%hu");
drivers/scsi/ipr.c+2−1
@@ -9950,6 +9950,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, · 9949 unmodified lines
99509950 ioa_cfg->max_devs_supported = ipr_max_devs;
99519951
99529952 if (ioa_cfg->sis64) {
9953+ host->max_channel = IPR_MAX_SIS64_BUSES;
99539954 host->max_id = IPR_MAX_SIS64_TARGETS_PER_BUS;
99549955 host->max_lun = IPR_MAX_SIS64_LUNS_PER_TARGET;
99559956 if (ipr_max_devs > IPR_MAX_SIS64_DEVS)
@@ -9958,6 +9959,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, · 2 unmodified lines
99589959 + ((sizeof(struct ipr_config_table_entry64)
99599960 * ioa_cfg->max_devs_supported)));
99609961 } else {
9962+ host->max_channel = IPR_VSET_BUS;
99619963 host->max_id = IPR_MAX_NUM_TARGETS_PER_BUS;
99629964 host->max_lun = IPR_MAX_NUM_LUNS_PER_TARGET;
99639965 if (ipr_max_devs > IPR_MAX_PHYSICAL_DEVS)
@@ -9967,7 +9969,6 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, · 3 unmodified lines
99679969 * ioa_cfg->max_devs_supported)));
99689970 }
99699971
9970− host->max_channel = IPR_VSET_BUS;
99719972 host->unique_id = host->host_no;
99729973 host->max_cmd_len = IPR_MAX_CDB_LEN;
99739974 host->can_queue = ioa_cfg->max_cmds;
drivers/scsi/ipr.h+1−0
@@ -1300,6 +1300,7 @@ struct ipr_resource_entry { · 1299 unmodified lines
13001300 #define IPR_ARRAY_VIRTUAL_BUS 0x1
13011301 #define IPR_VSET_VIRTUAL_BUS 0x2
13021302 #define IPR_IOAFP_VIRTUAL_BUS 0x3
1303+#define IPR_MAX_SIS64_BUSES 0x4
13031304
13041305 #define IPR_GET_RES_PHYS_LOC(res) \
13051306 (((res)->bus << 24) | ((res)->target << 8) | (res)->lun)
drivers/scsi/libfc/fc_disc.c+2−0
@@ -628,6 +628,8 @@ redisc: · 627 unmodified lines
628628 }
629629 out:
630630 kref_put(&rdata->kref, fc_rport_destroy);
631+ if (!IS_ERR(fp))
632+ fc_frame_free(fp);
631633 }
632634
633635 /**
drivers/scsi/sd_zbc.c+6−1
@@ -161,6 +161,7 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector, · 160 unmodified lines
161161 unsigned int nr_zones, report_zones_cb cb, void *data)
162162 {
163163 struct scsi_disk *sdkp = scsi_disk(disk);
164+ sector_t capacity = logical_to_sectors(sdkp->device, sdkp->capacity);
164165 unsigned int nr, i;
165166 unsigned char *buf;
166167 size_t offset, buflen = 0;
@@ -171,11 +172,15 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector, · 4 unmodified lines
171172 /* Not a zoned device */
172173 return -EOPNOTSUPP;
173174
175+ if (!capacity)
176+ /* Device gone or invalid */
177+ return -ENODEV;
178+
174179 buf = sd_zbc_alloc_report_buffer(sdkp, nr_zones, &buflen);
175180 if (!buf)
176181 return -ENOMEM;
177182
178− while (zone_idx < nr_zones && sector < get_capacity(disk)) {
183+ while (zone_idx < nr_zones && sector < capacity) {
179184 ret = sd_zbc_do_report_zones(sdkp, buf, buflen,
180185 sectors_to_logical(sdkp->device, sector), true);
181186 if (ret)
drivers/scsi/sr.c+1−1
@@ -688,7 +688,7 @@ static const struct block_device_operations sr_bdops = · 687 unmodified lines
688688 .release = sr_block_release,
689689 .ioctl = sr_block_ioctl,
690690 #ifdef CONFIG_COMPAT
691− .ioctl = sr_block_compat_ioctl,
691+ .compat_ioctl = sr_block_compat_ioctl,
692692 #endif
693693 .check_events = sr_block_check_events,
694694 .revalidate_disk = sr_block_revalidate_disk,
drivers/scsi/ufs/ufshcd.c+14−7
@@ -3884,18 +3884,25 @@ EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit); · 3883 unmodified lines
38843884 void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
38853885 {
38863886 unsigned long flags;
3887+ bool update = false;
38873888
3888− if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT))
3889+ if (!ufshcd_is_auto_hibern8_supported(hba))
38893890 return;
38903891
38913892 spin_lock_irqsave(hba->host->host_lock, flags);
3892− if (hba->ahit == ahit)
3893− goto out_unlock;
3894− hba->ahit = ahit;
3895− if (!pm_runtime_suspended(hba->dev))
3896− ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
3897−out_unlock:
3893+ if (hba->ahit != ahit) {
3894+ hba->ahit = ahit;
3895+ update = true;
3896+ }
38983897 spin_unlock_irqrestore(hba->host->host_lock, flags);
3898+
3899+ if (update && !pm_runtime_suspended(hba->dev)) {
3900+ pm_runtime_get_sync(hba->dev);
3901+ ufshcd_hold(hba, false);
3902+ ufshcd_auto_hibern8_enable(hba);
3903+ ufshcd_release(hba);
3904+ pm_runtime_put(hba->dev);
3905+ }
38993906 }
39003907 EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);
39013908
drivers/slimbus/qcom-ngd-ctrl.c+3−0
@@ -1320,6 +1320,9 @@ static const struct of_device_id qcom_slim_ngd_dt_match[] = { · 1319 unmodified lines
13201320 {
13211321 .compatible = "qcom,slim-ngd-v1.5.0",
13221322 .data = &ngd_v1_5_offset_info,
1323+ },{
1324+ .compatible = "qcom,slim-ngd-v2.1.0",
1325+ .data = &ngd_v1_5_offset_info,
13231326 },
13241327 {}
13251328 };
drivers/soc/imx/soc-imx-scu.c+1−1
@@ -25,7 +25,7 @@ struct imx_sc_msg_misc_get_soc_id { · 24 unmodified lines
2525 u32 id;
2626 } resp;
2727 } data;
28−} __packed;
28+} __packed __aligned(4);
2929
3030 struct imx_sc_msg_misc_get_soc_uid {
3131 struct imx_sc_rpc_msg hdr;
drivers/spi/atmel-quadspi.c+11−0
@@ -149,6 +149,7 @@ struct atmel_qspi { · 148 unmodified lines
149149 struct clk *qspick;
150150 struct platform_device *pdev;
151151 const struct atmel_qspi_caps *caps;
152+ resource_size_t mmap_size;
152153 u32 pending;
153154 u32 mr;
154155 u32 scr;
@@ -329,6 +330,14 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) · 174 unmodified lines
329330 u32 sr, offset;
330331 int err;
331332
333+ /*
334+ * Check if the address exceeds the MMIO window size. An improvement
335+ * would be to add support for regular SPI mode and fall back to it
336+ * when the flash memories overrun the controller's memory space.
337+ */
338+ if (op->addr.val + op->data.nbytes > aq->mmap_size)
339+ return -ENOTSUPP;
340+
332341 err = atmel_qspi_set_cfg(aq, op, &offset);
333342 if (err)
334343 return err;
@@ -480,6 +489,8 @@ static int atmel_qspi_probe(struct platform_device *pdev) · 145 unmodified lines
480489 goto exit;
481490 }
482491
492+ aq->mmap_size = resource_size(res);
493+
483494 /* Get the peripheral clock */
484495 aq->pclk = devm_clk_get(&pdev->dev, "pclk");
485496 if (IS_ERR(aq->pclk))
drivers/spi/spi-bcm63xx-hsspi.c+0−1
@@ -366,7 +366,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) · 365 unmodified lines
366366 goto out_disable_clk;
367367
368368 rate = clk_get_rate(pll_clk);
369− clk_disable_unprepare(pll_clk);
370369 if (!rate) {
371370 ret = -EINVAL;
372371 goto out_disable_pll_clk;
drivers/spi/spi-omap2-mcspi.c+64−39
@@ -130,6 +130,7 @@ struct omap2_mcspi { · 129 unmodified lines
130130 int fifo_depth;
131131 bool slave_aborted;
132132 unsigned int pin_dir:1;
133+ size_t max_xfer_len;
133134 };
134135
135136 struct omap2_mcspi_cs {
@@ -974,20 +975,12 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi, · 838 unmodified lines
974975 * Note that we currently allow DMA only if we get a channel
975976 * for both rx and tx. Otherwise we'll do PIO for both rx and tx.
976977 */
977−static int omap2_mcspi_request_dma(struct spi_device *spi)
978+static int omap2_mcspi_request_dma(struct omap2_mcspi *mcspi,
979+ struct omap2_mcspi_dma *mcspi_dma)
978980 {
979− struct spi_master *master = spi->master;
980− struct omap2_mcspi *mcspi;
981− struct omap2_mcspi_dma *mcspi_dma;
982981 int ret = 0;
983982
984− mcspi = spi_master_get_devdata(master);
985− mcspi_dma = mcspi->dma_channels + spi->chip_select;
986−
987− init_completion(&mcspi_dma->dma_rx_completion);
988− init_completion(&mcspi_dma->dma_tx_completion);
989−
990− mcspi_dma->dma_rx = dma_request_chan(&master->dev,
983+ mcspi_dma->dma_rx = dma_request_chan(mcspi->dev,
991984 mcspi_dma->dma_rx_ch_name);
992985 if (IS_ERR(mcspi_dma->dma_rx)) {
993986 ret = PTR_ERR(mcspi_dma->dma_rx);
@@ -995,7 +988,7 @@ static int omap2_mcspi_request_dma(struct spi_device *spi) · 1 unmodified line
995988 goto no_dma;
996989 }
997990
998− mcspi_dma->dma_tx = dma_request_chan(&master->dev,
991+ mcspi_dma->dma_tx = dma_request_chan(mcspi->dev,
999992 mcspi_dma->dma_tx_ch_name);
1000993 if (IS_ERR(mcspi_dma->dma_tx)) {
1001994 ret = PTR_ERR(mcspi_dma->dma_tx);
@@ -1004,20 +997,40 @@ static int omap2_mcspi_request_dma(struct spi_device *spi) · 2 unmodified lines
1004997 mcspi_dma->dma_rx = NULL;
1005998 }
1006999
1000+ init_completion(&mcspi_dma->dma_rx_completion);
1001+ init_completion(&mcspi_dma->dma_tx_completion);
1002+
10071003 no_dma:
10081004 return ret;
10091005 }
10101006
1007+static void omap2_mcspi_release_dma(struct spi_master *master)
1008+{
1009+ struct omap2_mcspi *mcspi = spi_master_get_devdata(master);
1010+ struct omap2_mcspi_dma *mcspi_dma;
1011+ int i;
1012+
1013+ for (i = 0; i < master->num_chipselect; i++) {
1014+ mcspi_dma = &mcspi->dma_channels[i];
1015+
1016+ if (mcspi_dma->dma_rx) {
1017+ dma_release_channel(mcspi_dma->dma_rx);
1018+ mcspi_dma->dma_rx = NULL;
1019+ }
1020+ if (mcspi_dma->dma_tx) {
1021+ dma_release_channel(mcspi_dma->dma_tx);
1022+ mcspi_dma->dma_tx = NULL;
1023+ }
1024+ }
1025+}
1026+
10111027 static int omap2_mcspi_setup(struct spi_device *spi)
10121028 {
10131029 int ret;
10141030 struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master);
10151031 struct omap2_mcspi_regs *ctx = &mcspi->ctx;
1016− struct omap2_mcspi_dma *mcspi_dma;
10171032 struct omap2_mcspi_cs *cs = spi->controller_state;
10181033
1019− mcspi_dma = &mcspi->dma_channels[spi->chip_select];
1020−
10211034 if (!cs) {
10221035 cs = kzalloc(sizeof *cs, GFP_KERNEL);
10231036 if (!cs)
@@ -1042,13 +1055,6 @@ static int omap2_mcspi_setup(struct spi_device *spi) · 18 unmodified lines
10421055 }
10431056 }
10441057
1045− if (!mcspi_dma->dma_rx || !mcspi_dma->dma_tx) {
1046− ret = omap2_mcspi_request_dma(spi);
1047− if (ret)
1048− dev_warn(&spi->dev, "not using DMA for McSPI (%d)\n",
1049− ret);
1050− }
1051−
10521058 ret = pm_runtime_get_sync(mcspi->dev);
10531059 if (ret < 0) {
10541060 pm_runtime_put_noidle(mcspi->dev);
@@ -1065,12 +1071,8 @@ static int omap2_mcspi_setup(struct spi_device *spi) · 10 unmodified lines
10651071
10661072 static void omap2_mcspi_cleanup(struct spi_device *spi)
10671073 {
1068− struct omap2_mcspi *mcspi;
1069− struct omap2_mcspi_dma *mcspi_dma;
10701074 struct omap2_mcspi_cs *cs;
10711075
1072− mcspi = spi_master_get_devdata(spi->master);
1073−
10741076 if (spi->controller_state) {
10751077 /* Unlink controller state from context save list */
10761078 cs = spi->controller_state;
@@ -1079,19 +1081,6 @@ static void omap2_mcspi_cleanup(struct spi_device *spi) · 2 unmodified lines
10791081 kfree(cs);
10801082 }
10811083
1082− if (spi->chip_select < spi->master->num_chipselect) {
1083− mcspi_dma = &mcspi->dma_channels[spi->chip_select];
1084−
1085− if (mcspi_dma->dma_rx) {
1086− dma_release_channel(mcspi_dma->dma_rx);
1087− mcspi_dma->dma_rx = NULL;
1088− }
1089− if (mcspi_dma->dma_tx) {
1090− dma_release_channel(mcspi_dma->dma_tx);
1091− mcspi_dma->dma_tx = NULL;
1092− }
1093− }
1094−
10951084 if (gpio_is_valid(spi->cs_gpio))
10961085 gpio_free(spi->cs_gpio);
10971086 }
@@ -1302,9 +1291,24 @@ static bool omap2_mcspi_can_dma(struct spi_master *master, · 204 unmodified lines
13021291 if (spi_controller_is_slave(master))
13031292 return true;
13041293
1294+ master->dma_rx = mcspi_dma->dma_rx;
1295+ master->dma_tx = mcspi_dma->dma_tx;
1296+
13051297 return (xfer->len >= DMA_MIN_BYTES);
13061298 }
13071299
1300+static size_t omap2_mcspi_max_xfer_size(struct spi_device *spi)
1301+{
1302+ struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master);
1303+ struct omap2_mcspi_dma *mcspi_dma =
1304+ &mcspi->dma_channels[spi->chip_select];
1305+
1306+ if (mcspi->max_xfer_len && mcspi_dma->dma_rx)
1307+ return mcspi->max_xfer_len;
1308+
1309+ return SIZE_MAX;
1310+}
1311+
13081312 static int omap2_mcspi_controller_setup(struct omap2_mcspi *mcspi)
13091313 {
13101314 struct spi_master *master = mcspi->master;
@@ -1373,6 +1377,11 @@ static struct omap2_mcspi_platform_config omap4_pdata = { · 62 unmodified lines
13731377 .regs_offset = OMAP4_MCSPI_REG_OFFSET,
13741378 };
13751379
1380+static struct omap2_mcspi_platform_config am654_pdata = {
1381+ .regs_offset = OMAP4_MCSPI_REG_OFFSET,
1382+ .max_xfer_len = SZ_4K - 1,
1383+};
1384+
13761385 static const struct of_device_id omap_mcspi_of_match[] = {
13771386 {
13781387 .compatible = "ti,omap2-mcspi",
@@ -1382,6 +1391,10 @@ static const struct of_device_id omap_mcspi_of_match[] = { · 3 unmodified lines
13821391 .compatible = "ti,omap4-mcspi",
13831392 .data = &omap4_pdata,
13841393 },
1394+ {
1395+ .compatible = "ti,am654-mcspi",
1396+ .data = &am654_pdata,
1397+ },
13851398 { },
13861399 };
13871400 MODULE_DEVICE_TABLE(of, omap_mcspi_of_match);
@@ -1439,6 +1452,10 @@ static int omap2_mcspi_probe(struct platform_device *pdev) · 51 unmodified lines
14391452 mcspi->pin_dir = pdata->pin_dir;
14401453 }
14411454 regs_offset = pdata->regs_offset;
1455+ if (pdata->max_xfer_len) {
1456+ mcspi->max_xfer_len = pdata->max_xfer_len;
1457+ master->max_transfer_size = omap2_mcspi_max_xfer_size;
1458+ }
14421459
14431460 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
14441461 mcspi->base = devm_ioremap_resource(&pdev->dev, r);
@@ -1464,6 +1481,11 @@ static int omap2_mcspi_probe(struct platform_device *pdev) · 19 unmodified lines
14641481 for (i = 0; i < master->num_chipselect; i++) {
14651482 sprintf(mcspi->dma_channels[i].dma_rx_ch_name, "rx%d", i);
14661483 sprintf(mcspi->dma_channels[i].dma_tx_ch_name, "tx%d", i);
1484+
1485+ status = omap2_mcspi_request_dma(mcspi,
1486+ &mcspi->dma_channels[i]);
1487+ if (status == -EPROBE_DEFER)
1488+ goto free_master;
14671489 }
14681490
14691491 status = platform_get_irq(pdev, 0);
@@ -1501,6 +1523,7 @@ disable_pm: · 31 unmodified lines
15011523 pm_runtime_put_sync(&pdev->dev);
15021524 pm_runtime_disable(&pdev->dev);
15031525 free_master:
1526+ omap2_mcspi_release_dma(master);
15041527 spi_master_put(master);
15051528 return status;
15061529 }
@@ -1510,6 +1533,8 @@ static int omap2_mcspi_remove(struct platform_device *pdev) · 3 unmodified lines
15101533 struct spi_master *master = platform_get_drvdata(pdev);
15111534 struct omap2_mcspi *mcspi = spi_master_get_devdata(master);
15121535
1536+ omap2_mcspi_release_dma(master);
1537+
15131538 pm_runtime_dont_use_autosuspend(mcspi->dev);
15141539 pm_runtime_put_sync(mcspi->dev);
15151540 pm_runtime_disable(&pdev->dev);
drivers/spi/spi-pxa2xx.c+23−0
@@ -70,6 +70,10 @@ MODULE_ALIAS("platform:pxa2xx-spi"); · 69 unmodified lines
7070 #define LPSS_CAPS_CS_EN_SHIFT 9
7171 #define LPSS_CAPS_CS_EN_MASK (0xf << LPSS_CAPS_CS_EN_SHIFT)
7272
73+#define LPSS_PRIV_CLOCK_GATE 0x38
74+#define LPSS_PRIV_CLOCK_GATE_CLK_CTL_MASK 0x3
75+#define LPSS_PRIV_CLOCK_GATE_CLK_CTL_FORCE_ON 0x3
76+
7377 struct lpss_config {
7478 /* LPSS offset from drv_data->ioaddr */
7579 unsigned offset;
@@ -86,6 +90,8 @@ struct lpss_config { · 10 unmodified lines
8690 unsigned cs_sel_shift;
8791 unsigned cs_sel_mask;
8892 unsigned cs_num;
93+ /* Quirks */
94+ unsigned cs_clk_stays_gated : 1;
8995 };
9096
9197 /* Keep these sorted with enum pxa_ssp_type */
@@ -156,6 +162,7 @@ static const struct lpss_config lpss_platforms[] = { · 64 unmodified lines
156162 .tx_threshold_hi = 56,
157163 .cs_sel_shift = 8,
158164 .cs_sel_mask = 3 << 8,
165+ .cs_clk_stays_gated = true,
159166 },
160167 };
161168
@@ -383,6 +390,22 @@ static void lpss_ssp_cs_control(struct spi_device *spi, bool enable) · 221 unmodified lines
383390 else
384391 value |= LPSS_CS_CONTROL_CS_HIGH;
385392 __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value);
393+ if (config->cs_clk_stays_gated) {
394+ u32 clkgate;
395+
396+ /*
397+ * Changing CS alone when dynamic clock gating is on won't
398+ * actually flip CS at that time. This ruins SPI transfers
399+ * that specify delays, or have no data. Toggle the clock mode
400+ * to force on briefly to poke the CS pin to move.
401+ */
402+ clkgate = __lpss_ssp_read_priv(drv_data, LPSS_PRIV_CLOCK_GATE);
403+ value = (clkgate & ~LPSS_PRIV_CLOCK_GATE_CLK_CTL_MASK) |
404+ LPSS_PRIV_CLOCK_GATE_CLK_CTL_FORCE_ON;
405+
406+ __lpss_ssp_write_priv(drv_data, LPSS_PRIV_CLOCK_GATE, value);
407+ __lpss_ssp_write_priv(drv_data, LPSS_PRIV_CLOCK_GATE, clkgate);
408+ }
386409 }
387410
388411 static void cs_assert(struct spi_device *spi)
drivers/spi/spi-qup.c+7−4
@@ -1217,6 +1217,11 @@ static int spi_qup_suspend(struct device *device) · 1216 unmodified lines
12171217 struct spi_qup *controller = spi_master_get_devdata(master);
12181218 int ret;
12191219
1220+ if (pm_runtime_suspended(device)) {
1221+ ret = spi_qup_pm_resume_runtime(device);
1222+ if (ret)
1223+ return ret;
1224+ }
12201225 ret = spi_master_suspend(master);
12211226 if (ret)
12221227 return ret;
@@ -1225,10 +1230,8 @@ static int spi_qup_suspend(struct device *device) · 2 unmodified lines
12251230 if (ret)
12261231 return ret;
12271232
1228− if (!pm_runtime_suspended(device)) {
1229− clk_disable_unprepare(controller->cclk);
1230− clk_disable_unprepare(controller->iclk);
1231− }
1233+ clk_disable_unprepare(controller->cclk);
1234+ clk_disable_unprepare(controller->iclk);
12321235 return 0;
12331236 }
12341237
drivers/spi/spi-zynqmp-gqspi.c+0−3
@@ -401,9 +401,6 @@ static void zynqmp_qspi_chipselect(struct spi_device *qspi, bool is_high) · 400 unmodified lines
401401
402402 zynqmp_gqspi_write(xqspi, GQSPI_GEN_FIFO_OFST, genfifoentry);
403403
404− /* Dummy generic FIFO entry */
405− zynqmp_gqspi_write(xqspi, GQSPI_GEN_FIFO_OFST, 0x0);
406−
407404 /* Manually start the generic FIFO command */
408405 zynqmp_gqspi_write(xqspi, GQSPI_CONFIG_OFST,
409406 zynqmp_gqspi_read(xqspi, GQSPI_CONFIG_OFST) |
drivers/spi/spi.c+15−17
@@ -2639,7 +2639,7 @@ int spi_register_controller(struct spi_controller *ctlr) · 2638 unmodified lines
26392639 if (ctlr->use_gpio_descriptors) {
26402640 status = spi_get_gpio_descs(ctlr);
26412641 if (status)
2642− return status;
2642+ goto free_bus_id;
26432643 /*
26442644 * A controller using GPIO descriptors always
26452645 * supports SPI_CS_HIGH if need be.
@@ -2649,7 +2649,7 @@ int spi_register_controller(struct spi_controller *ctlr) · 3 unmodified lines
26492649 /* Legacy code path for GPIOs from DT */
26502650 status = of_spi_get_gpio_numbers(ctlr);
26512651 if (status)
2652− return status;
2652+ goto free_bus_id;
26532653 }
26542654 }
26552655
@@ -2657,17 +2657,14 @@ int spi_register_controller(struct spi_controller *ctlr) · 1 unmodified line
26572657 * Even if it's just one always-selected device, there must
26582658 * be at least one chipselect.
26592659 */
2660− if (!ctlr->num_chipselect)
2661− return -EINVAL;
2660+ if (!ctlr->num_chipselect) {
2661+ status = -EINVAL;
2662+ goto free_bus_id;
2663+ }
26622664
26632665 status = device_add(&ctlr->dev);
2664− if (status < 0) {
2665− /* free bus id */
2666− mutex_lock(&board_lock);
2667− idr_remove(&spi_master_idr, ctlr->bus_num);
2668− mutex_unlock(&board_lock);
2669− goto done;
2670− }
2666+ if (status < 0)
2667+ goto free_bus_id;
26712668 dev_dbg(dev, "registered %s %s\n",
26722669 spi_controller_is_slave(ctlr) ? "slave" : "master",
26732670 dev_name(&ctlr->dev));
@@ -2683,11 +2680,7 @@ int spi_register_controller(struct spi_controller *ctlr) · 9 unmodified lines
26832680 status = spi_controller_initialize_queue(ctlr);
26842681 if (status) {
26852682 device_del(&ctlr->dev);
2686− /* free bus id */
2687− mutex_lock(&board_lock);
2688− idr_remove(&spi_master_idr, ctlr->bus_num);
2689− mutex_unlock(&board_lock);
2690− goto done;
2683+ goto free_bus_id;
26912684 }
26922685 }
26932686 /* add statistics */
@@ -2702,7 +2695,12 @@ int spi_register_controller(struct spi_controller *ctlr) · 8 unmodified lines
27022695 /* Register devices from the device tree and ACPI */
27032696 of_register_spi_devices(ctlr);
27042697 acpi_register_spi_devices(ctlr);
2705−done:
2698+ return status;
2699+
2700+free_bus_id:
2701+ mutex_lock(&board_lock);
2702+ idr_remove(&spi_master_idr, ctlr->bus_num);
2703+ mutex_unlock(&board_lock);
27062704 return status;
27072705 }
27082706 EXPORT_SYMBOL_GPL(spi_register_controller);
drivers/spi/spidev.c+5−0
@@ -396,6 +396,7 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 395 unmodified lines
396396 else
397397 retval = get_user(tmp, (u32 __user *)arg);
398398 if (retval == 0) {
399+ struct spi_controller *ctlr = spi->controller;
399400 u32 save = spi->mode;
400401
401402 if (tmp & ~SPI_MODE_MASK) {
@@ -403,6 +404,10 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 1 unmodified line
403404 break;
404405 }
405406
407+ if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods &&
408+ ctlr->cs_gpiods[spi->chip_select])
409+ tmp |= SPI_CS_HIGH;
410+
406411 tmp |= spi->mode & ~SPI_MODE_MASK;
407412 spi->mode = (u16)tmp;
408413 retval = spi_setup(spi);
drivers/staging/greybus/tools/loopback_test.c+11−10
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <signal.h>
2020
2121 #define MAX_NUM_DEVICES 10
22+#define MAX_SYSFS_PREFIX 0x80
2223 #define MAX_SYSFS_PATH 0x200
2324 #define CSV_MAX_LINE 0x1000
2425 #define SYSFS_MAX_INT 0x20
@@ -67,7 +68,7 @@ struct loopback_results { · 42 unmodified lines
6768 };
6869
6970 struct loopback_device {
70− char name[MAX_SYSFS_PATH];
71+ char name[MAX_STR_LEN];
7172 char sysfs_entry[MAX_SYSFS_PATH];
7273 char debugfs_entry[MAX_SYSFS_PATH];
7374 struct loopback_results results;
@@ -93,8 +94,8 @@ struct loopback_test { · 19 unmodified lines
9394 int stop_all;
9495 int poll_count;
9596 char test_name[MAX_STR_LEN];
96− char sysfs_prefix[MAX_SYSFS_PATH];
97− char debugfs_prefix[MAX_SYSFS_PATH];
97+ char sysfs_prefix[MAX_SYSFS_PREFIX];
98+ char debugfs_prefix[MAX_SYSFS_PREFIX];
9899 struct timespec poll_timeout;
99100 struct loopback_device devices[MAX_NUM_DEVICES];
100101 struct loopback_results aggregate_results;
@@ -637,7 +638,7 @@ baddir: · 536 unmodified lines
637638 static int open_poll_files(struct loopback_test *t)
638639 {
639640 struct loopback_device *dev;
640− char buf[MAX_STR_LEN];
641+ char buf[MAX_SYSFS_PATH + MAX_STR_LEN];
641642 char dummy;
642643 int fds_idx = 0;
643644 int i;
@@ -655,7 +656,7 @@ static int open_poll_files(struct loopback_test *t) · 11 unmodified lines
655656 goto err;
656657 }
657658 read(t->fds[fds_idx].fd, &dummy, 1);
658− t->fds[fds_idx].events = EPOLLERR|EPOLLPRI;
659+ t->fds[fds_idx].events = POLLERR | POLLPRI;
659660 t->fds[fds_idx].revents = 0;
660661 fds_idx++;
661662 }
@@ -748,7 +749,7 @@ static int wait_for_complete(struct loopback_test *t) · 86 unmodified lines
748749 }
749750
750751 for (i = 0; i < t->poll_count; i++) {
751− if (t->fds[i].revents & EPOLLPRI) {
752+ if (t->fds[i].revents & POLLPRI) {
752753 /* Dummy read to clear the event */
753754 read(t->fds[i].fd, &dummy, 1);
754755 number_of_events++;
@@ -907,10 +908,10 @@ int main(int argc, char *argv[]) · 152 unmodified lines
907908 t.iteration_max = atoi(optarg);
908909 break;
909910 case 'S':
910− snprintf(t.sysfs_prefix, MAX_SYSFS_PATH, "%s", optarg);
911+ snprintf(t.sysfs_prefix, MAX_SYSFS_PREFIX, "%s", optarg);
911912 break;
912913 case 'D':
913− snprintf(t.debugfs_prefix, MAX_SYSFS_PATH, "%s", optarg);
914+ snprintf(t.debugfs_prefix, MAX_SYSFS_PREFIX, "%s", optarg);
914915 break;
915916 case 'm':
916917 t.mask = atol(optarg);
@@ -961,10 +962,10 @@ int main(int argc, char *argv[]) · 44 unmodified lines
961962 }
962963
963964 if (!strcmp(t.sysfs_prefix, ""))
964− snprintf(t.sysfs_prefix, MAX_SYSFS_PATH, "%s", sysfs_prefix);
965+ snprintf(t.sysfs_prefix, MAX_SYSFS_PREFIX, "%s", sysfs_prefix);
965966
966967 if (!strcmp(t.debugfs_prefix, ""))
967− snprintf(t.debugfs_prefix, MAX_SYSFS_PATH, "%s", debugfs_prefix);
968+ snprintf(t.debugfs_prefix, MAX_SYSFS_PREFIX, "%s", debugfs_prefix);
968969
969970 ret = find_loopback_devices(&t);
970971 if (ret)
drivers/staging/media/hantro/hantro_drv.c+2−2
@@ -558,13 +558,13 @@ static int hantro_attach_func(struct hantro_dev *vpu, · 557 unmodified lines
558558 goto err_rel_entity1;
559559
560560 /* Connect the three entities */
561− ret = media_create_pad_link(&func->vdev.entity, 0, &func->proc, 1,
561+ ret = media_create_pad_link(&func->vdev.entity, 0, &func->proc, 0,
562562 MEDIA_LNK_FL_IMMUTABLE |
563563 MEDIA_LNK_FL_ENABLED);
564564 if (ret)
565565 goto err_rel_entity2;
566566
567− ret = media_create_pad_link(&func->proc, 0, &func->sink, 0,
567+ ret = media_create_pad_link(&func->proc, 1, &func->sink, 0,
568568 MEDIA_LNK_FL_IMMUTABLE |
569569 MEDIA_LNK_FL_ENABLED);
570570 if (ret)
drivers/staging/rtl8188eu/os_dep/usb_intf.c+1−0
@@ -38,6 +38,7 @@ static const struct usb_device_id rtw_usb_id_tbl[] = { · 37 unmodified lines
3838 {USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
3939 {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
4040 {USB_DEVICE(0x2357, 0x0111)}, /* TP-Link TL-WN727N v5.21 */
41+ {USB_DEVICE(0x2C4E, 0x0102)}, /* MERCUSYS MW150US v2 */
4142 {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
4243 {USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
4344 {} /* Terminating entry */
drivers/staging/speakup/main.c+1−1
@@ -561,7 +561,7 @@ static u_long get_word(struct vc_data *vc) · 560 unmodified lines
561561 return 0;
562562 } else if (tmpx < vc->vc_cols - 2 &&
563563 (ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) &&
564− get_char(vc, (u_short *)&tmp_pos + 1, &temp) > SPACE) {
564+ get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE) {
565565 tmp_pos += 2;
566566 tmpx++;
567567 } else {
drivers/staging/speakup/selection.c+0−2
@@ -51,9 +51,7 @@ static void __speakup_set_selection(struct work_struct *work) · 50 unmodified lines
5151 goto unref;
5252 }
5353
54− console_lock();
5554 set_selection_kernel(&sel, tty);
56− console_unlock();
5755
5856 unref:
5957 tty_kref_put(tty);
drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt+1−1
@@ -93,5 +93,5 @@ Some properties are recognized either by SPI and SDIO versions: · 92 unmodified lines
9393 Must contains 64 hexadecimal digits. Not supported in current version.
9494
9595 WFx driver also supports `mac-address` and `local-mac-address` as described in
96−Documentation/devicetree/binding/net/ethernet.txt
96+Documentation/devicetree/bindings/net/ethernet.txt
9797
drivers/staging/wfx/hif_tx.c+8−7
@@ -140,6 +140,7 @@ int hif_shutdown(struct wfx_dev *wdev) · 139 unmodified lines
140140 else
141141 control_reg_write(wdev, 0);
142142 mutex_unlock(&wdev->hif_cmd.lock);
143+ mutex_unlock(&wdev->hif_cmd.key_renew_lock);
143144 kfree(hif);
144145 return ret;
145146 }
@@ -289,7 +290,7 @@ int hif_stop_scan(struct wfx_vif *wvif) · 143 unmodified lines
289290 }
290291
291292 int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
292− const struct ieee80211_channel *channel, const u8 *ssidie)
293+ struct ieee80211_channel *channel, const u8 *ssid, int ssidlen)
293294 {
294295 int ret;
295296 struct hif_msg *hif;
@@ -307,9 +308,9 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, · 11 unmodified lines
307308 body->basic_rate_set =
308309 cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));
309310 memcpy(body->bssid, conf->bssid, sizeof(body->bssid));
310− if (!conf->ibss_joined && ssidie) {
311− body->ssid_length = cpu_to_le32(ssidie[1]);
312− memcpy(body->ssid, &ssidie[2], ssidie[1]);
311+ if (!conf->ibss_joined && ssid) {
312+ body->ssid_length = cpu_to_le32(ssidlen);
313+ memcpy(body->ssid, ssid, ssidlen);
313314 }
314315 wfx_fill_header(hif, wvif->id, HIF_REQ_ID_JOIN, sizeof(*body));
315316 ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
@@ -427,9 +428,9 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, · 111 unmodified lines
427428 struct hif_msg *hif;
428429 struct hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif);
429430
430− body->dtim_period = conf->dtim_period,
431− body->short_preamble = conf->use_short_preamble,
432− body->channel_number = cpu_to_le16(channel->hw_value),
431+ body->dtim_period = conf->dtim_period;
432+ body->short_preamble = conf->use_short_preamble;
433+ body->channel_number = cpu_to_le16(channel->hw_value);
433434 body->beacon_interval = cpu_to_le32(conf->beacon_int);
434435 body->basic_rate_set =
435436 cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));
drivers/staging/wfx/hif_tx.h+1−1
@@ -46,7 +46,7 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211, · 45 unmodified lines
4646 int chan_start, int chan_num);
4747 int hif_stop_scan(struct wfx_vif *wvif);
4848 int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
49− const struct ieee80211_channel *channel, const u8 *ssidie);
49+ struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
5050 int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
5151 int hif_set_bss_params(struct wfx_vif *wvif,
5252 const struct hif_req_set_bss_params *arg);
drivers/staging/wfx/hif_tx_mib.h+10−5
@@ -191,10 +191,10 @@ static inline int hif_set_block_ack_policy(struct wfx_vif *wvif, · 190 unmodified lines
191191 }
192192
193193 static inline int hif_set_association_mode(struct wfx_vif *wvif,
194− struct ieee80211_bss_conf *info,
195− struct ieee80211_sta_ht_cap *ht_cap)
194+ struct ieee80211_bss_conf *info)
196195 {
197196 int basic_rates = wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates);
197+ struct ieee80211_sta *sta = NULL;
198198 struct hif_mib_set_association_mode val = {
199199 .preambtype_use = 1,
200200 .mode = 1,
@@ -204,12 +204,17 @@ static inline int hif_set_association_mode(struct wfx_vif *wvif, · 3 unmodified lines
204204 .basic_rate_set = cpu_to_le32(basic_rates)
205205 };
206206
207+ rcu_read_lock(); // protect sta
208+ if (info->bssid && !info->ibss_joined)
209+ sta = ieee80211_find_sta(wvif->vif, info->bssid);
210+
207211 // FIXME: it is strange to not retrieve all information from bss_info
208− if (ht_cap && ht_cap->ht_supported) {
209− val.mpdu_start_spacing = ht_cap->ampdu_density;
212+ if (sta && sta->ht_cap.ht_supported) {
213+ val.mpdu_start_spacing = sta->ht_cap.ampdu_density;
210214 if (!(info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT))
211− val.greenfield = !!(ht_cap->cap & IEEE80211_HT_CAP_GRN_FLD);
215+ val.greenfield = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
212216 }
217+ rcu_read_unlock();
213218
214219 return hif_write_mib(wvif->wdev, wvif->id,
215220 HIF_MIB_ID_SET_ASSOCIATION_MODE, &val, sizeof(val));
drivers/staging/wfx/sta.c+15−10
@@ -491,9 +491,11 @@ static void wfx_set_mfp(struct wfx_vif *wvif, · 490 unmodified lines
491491 static void wfx_do_join(struct wfx_vif *wvif)
492492 {
493493 int ret;
494− const u8 *ssidie;
495494 struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf;
496495 struct cfg80211_bss *bss = NULL;
496+ u8 ssid[IEEE80211_MAX_SSID_LEN];
497+ const u8 *ssidie = NULL;
498+ int ssidlen = 0;
497499
498500 wfx_tx_lock_flush(wvif->wdev);
499501
@@ -514,11 +516,14 @@ static void wfx_do_join(struct wfx_vif *wvif) · 14 unmodified lines
514516 if (!wvif->beacon_int)
515517 wvif->beacon_int = 1;
516518
517− rcu_read_lock();
519+ rcu_read_lock(); // protect ssidie
518520 if (!conf->ibss_joined)
519521 ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
520− else
521− ssidie = NULL;
522+ if (ssidie) {
523+ ssidlen = ssidie[1];
524+ memcpy(ssid, &ssidie[2], ssidie[1]);
525+ }
526+ rcu_read_unlock();
522527
523528 wfx_tx_flush(wvif->wdev);
524529
@@ -527,10 +532,8 @@ static void wfx_do_join(struct wfx_vif *wvif) · 2 unmodified lines
527532
528533 wfx_set_mfp(wvif, bss);
529534
530− /* Perform actual join */
531535 wvif->wdev->tx_burst_idx = -1;
532− ret = hif_join(wvif, conf, wvif->channel, ssidie);
533− rcu_read_unlock();
536+ ret = hif_join(wvif, conf, wvif->channel, ssid, ssidlen);
534537 if (ret) {
535538 ieee80211_connection_loss(wvif->vif);
536539 wvif->join_complete_status = -1;
@@ -605,7 +608,9 @@ int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, · 68 unmodified lines
605608 int i;
606609
607610 for (i = 0; i < ARRAY_SIZE(sta_priv->buffered); i++)
608− WARN(sta_priv->buffered[i], "release station while Tx is in progress");
611+ if (sta_priv->buffered[i])
612+ dev_warn(wvif->wdev->dev, "release station while %d pending frame on queue %d",
613+ sta_priv->buffered[i], i);
609614 // FIXME: see note in wfx_sta_add()
610615 if (vif->type == NL80211_IFTYPE_STATION)
611616 return 0;
@@ -689,6 +694,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, · 77 unmodified lines
689694 wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]);
690695 else
691696 wvif->bss_params.operational_rate_set = -1;
697+ rcu_read_unlock();
692698 if (sta &&
693699 info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
694700 hif_dual_cts_protection(wvif, true);
@@ -701,8 +707,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, · 6 unmodified lines
701707 wvif->bss_params.beacon_lost_count = 20;
702708 wvif->bss_params.aid = info->aid;
703709
704− hif_set_association_mode(wvif, info, sta ? &sta->ht_cap : NULL);
705− rcu_read_unlock();
710+ hif_set_association_mode(wvif, info);
706711
707712 if (!info->ibss_joined) {
708713 hif_keep_alive_period(wvif, 30 /* sec */);
drivers/tee/amdtee/Kconfig+1−1
@@ -3,6 +3,6 @@ · 2 unmodified lines
33 config AMDTEE
44 tristate "AMD-TEE"
55 default m
6− depends on CRYPTO_DEV_SP_PSP
6+ depends on CRYPTO_DEV_SP_PSP && CRYPTO_DEV_CCP_DD
77 help
88 This implements AMD's Trusted Execution Environment (TEE) driver.
drivers/tee/amdtee/core.c+24−24
@@ -212,6 +212,19 @@ unlock: · 211 unmodified lines
212212 return rc;
213213 }
214214
215+static void destroy_session(struct kref *ref)
216+{
217+ struct amdtee_session *sess = container_of(ref, struct amdtee_session,
218+ refcount);
219+
220+ /* Unload the TA from TEE */
221+ handle_unload_ta(sess->ta_handle);
222+ mutex_lock(&session_list_mutex);
223+ list_del(&sess->list_node);
224+ mutex_unlock(&session_list_mutex);
225+ kfree(sess);
226+}
227+
215228 int amdtee_open_session(struct tee_context *ctx,
216229 struct tee_ioctl_open_session_arg *arg,
217230 struct tee_param *param)
@@ -236,15 +249,13 @@ int amdtee_open_session(struct tee_context *ctx, · 18 unmodified lines
236249
237250 /* Load the TA binary into TEE environment */
238251 handle_load_ta(ta, ta_size, arg);
239− if (arg->ret == TEEC_SUCCESS) {
240− mutex_lock(&session_list_mutex);
241− sess = alloc_session(ctxdata, arg->session);
242− mutex_unlock(&session_list_mutex);
243− }
244−
245252 if (arg->ret != TEEC_SUCCESS)
246253 goto out;
247254
255+ mutex_lock(&session_list_mutex);
256+ sess = alloc_session(ctxdata, arg->session);
257+ mutex_unlock(&session_list_mutex);
258+
248259 if (!sess) {
249260 rc = -ENOMEM;
250261 goto out;
@@ -259,40 +270,29 @@ int amdtee_open_session(struct tee_context *ctx, · 8 unmodified lines
259270
260271 if (i >= TEE_NUM_SESSIONS) {
261272 pr_err("reached maximum session count %d\n", TEE_NUM_SESSIONS);
273+ kref_put(&sess->refcount, destroy_session);
262274 rc = -ENOMEM;
263275 goto out;
264276 }
265277
266278 /* Open session with loaded TA */
267279 handle_open_session(arg, &session_info, param);
268−
269− if (arg->ret == TEEC_SUCCESS) {
270− sess->session_info[i] = session_info;
271− set_session_id(sess->ta_handle, i, &arg->session);
272− } else {
280+ if (arg->ret != TEEC_SUCCESS) {
273281 pr_err("open_session failed %d\n", arg->ret);
274282 spin_lock(&sess->lock);
275283 clear_bit(i, sess->sess_mask);
276284 spin_unlock(&sess->lock);
285+ kref_put(&sess->refcount, destroy_session);
286+ goto out;
277287 }
288+
289+ sess->session_info[i] = session_info;
290+ set_session_id(sess->ta_handle, i, &arg->session);
278291 out:
279292 free_pages((u64)ta, get_order(ta_size));
280293 return rc;
281294 }
282295
283−static void destroy_session(struct kref *ref)
284−{
285− struct amdtee_session *sess = container_of(ref, struct amdtee_session,
286− refcount);
287−
288− /* Unload the TA from TEE */
289− handle_unload_ta(sess->ta_handle);
290− mutex_lock(&session_list_mutex);
291− list_del(&sess->list_node);
292− mutex_unlock(&session_list_mutex);
293− kfree(sess);
294−}
295−
296296 int amdtee_close_session(struct tee_context *ctx, u32 session)
297297 {
298298 struct amdtee_context_data *ctxdata = ctx->data;
drivers/thunderbolt/switch.c+1−1
@@ -954,7 +954,7 @@ static bool tb_port_is_width_supported(struct tb_port *port, int width) · 953 unmodified lines
954954 ret = tb_port_read(port, &phy, TB_CFG_PORT,
955955 port->cap_phy + LANE_ADP_CS_0, 1);
956956 if (ret)
957− return ret;
957+ return false;
958958
959959 widths = (phy & LANE_ADP_CS_0_SUPPORTED_WIDTH_MASK) >>
960960 LANE_ADP_CS_0_SUPPORTED_WIDTH_SHIFT;
drivers/tty/serdev/core.c+10−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/sched.h>
1919 #include <linux/serdev.h>
2020 #include <linux/slab.h>
21+#include <linux/platform_data/x86/apple.h>
2122
2223 static bool is_registered;
2324 static DEFINE_IDA(ctrl_ida);
@@ -631,6 +632,15 @@ static int acpi_serdev_check_resources(struct serdev_controller *ctrl, · 607 unmodified lines
631632 if (ret)
632633 return ret;
633634
635+ /*
636+ * Apple machines provide an empty resource template, so on those
637+ * machines just look for immediate children with a "baud" property
638+ * (from the _DSM method) instead.
639+ */
640+ if (!lookup.controller_handle && x86_apple_machine &&
641+ !acpi_dev_get_property(adev, "baud", ACPI_TYPE_BUFFER, NULL))
642+ acpi_get_parent(adev->handle, &lookup.controller_handle);
643+
634644 /* Make sure controller and ResourceSource handle match */
635645 if (ACPI_HANDLE(ctrl->dev.parent) != lookup.controller_handle)
636646 return -ENODEV;
drivers/tty/serial/8250/8250_exar.c+33−0
@@ -25,6 +25,14 @@ · 24 unmodified lines
2525
2626 #include "8250.h"
2727
28+#define PCI_DEVICE_ID_ACCES_COM_2S 0x1052
29+#define PCI_DEVICE_ID_ACCES_COM_4S 0x105d
30+#define PCI_DEVICE_ID_ACCES_COM_8S 0x106c
31+#define PCI_DEVICE_ID_ACCES_COM232_8 0x10a8
32+#define PCI_DEVICE_ID_ACCES_COM_2SM 0x10d2
33+#define PCI_DEVICE_ID_ACCES_COM_4SM 0x10db
34+#define PCI_DEVICE_ID_ACCES_COM_8SM 0x10ea
35+
2836 #define PCI_DEVICE_ID_COMMTECH_4224PCI335 0x0002
2937 #define PCI_DEVICE_ID_COMMTECH_4222PCI335 0x0004
3038 #define PCI_DEVICE_ID_COMMTECH_2324PCI335 0x000a
@@ -677,6 +685,22 @@ static int __maybe_unused exar_resume(struct device *dev) · 646 unmodified lines
677685
678686 static SIMPLE_DEV_PM_OPS(exar_pci_pm, exar_suspend, exar_resume);
679687
688+static const struct exar8250_board acces_com_2x = {
689+ .num_ports = 2,
690+ .setup = pci_xr17c154_setup,
691+};
692+
693+static const struct exar8250_board acces_com_4x = {
694+ .num_ports = 4,
695+ .setup = pci_xr17c154_setup,
696+};
697+
698+static const struct exar8250_board acces_com_8x = {
699+ .num_ports = 8,
700+ .setup = pci_xr17c154_setup,
701+};
702+
703+
680704 static const struct exar8250_board pbn_fastcom335_2 = {
681705 .num_ports = 2,
682706 .setup = pci_fastcom335_setup,
@@ -745,6 +769,15 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { · 62 unmodified lines
745769 }
746770
747771 static const struct pci_device_id exar_pci_tbl[] = {
772+ EXAR_DEVICE(ACCESSIO, ACCES_COM_2S, acces_com_2x),
773+ EXAR_DEVICE(ACCESSIO, ACCES_COM_4S, acces_com_4x),
774+ EXAR_DEVICE(ACCESSIO, ACCES_COM_8S, acces_com_8x),
775+ EXAR_DEVICE(ACCESSIO, ACCES_COM232_8, acces_com_8x),
776+ EXAR_DEVICE(ACCESSIO, ACCES_COM_2SM, acces_com_2x),
777+ EXAR_DEVICE(ACCESSIO, ACCES_COM_4SM, acces_com_4x),
778+ EXAR_DEVICE(ACCESSIO, ACCES_COM_8SM, acces_com_8x),
779+
780+
748781 CONNECT_DEVICE(XR17C152, UART_2_232, pbn_connect),
749782 CONNECT_DEVICE(XR17C154, UART_4_232, pbn_connect),
750783 CONNECT_DEVICE(XR17C158, UART_8_232, pbn_connect),
drivers/tty/serial/fsl_lpuart.c+26−15
@@ -264,6 +264,7 @@ struct lpuart_port { · 263 unmodified lines
264264 int rx_dma_rng_buf_len;
265265 unsigned int dma_tx_nents;
266266 wait_queue_head_t dma_wait;
267+ bool id_allocated;
267268 };
268269
269270 struct lpuart_soc_data {
@@ -2390,6 +2391,8 @@ static int __init lpuart32_imx_early_console_setup(struct earlycon_device *devic · 2120 unmodified lines
23902391 OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup);
23912392 OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup);
23922393 OF_EARLYCON_DECLARE(lpuart32, "fsl,imx7ulp-lpuart", lpuart32_imx_early_console_setup);
2394+EARLYCON_DECLARE(lpuart, lpuart_early_console_setup);
2395+EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup);
23932396
23942397 #define LPUART_CONSOLE (&lpuart_console)
23952398 #define LPUART32_CONSOLE (&lpuart32_console)
@@ -2420,19 +2423,6 @@ static int lpuart_probe(struct platform_device *pdev) · 24 unmodified lines
24202423 if (!sport)
24212424 return -ENOMEM;
24222425
2423− ret = of_alias_get_id(np, "serial");
2424− if (ret < 0) {
2425− ret = ida_simple_get(&fsl_lpuart_ida, 0, UART_NR, GFP_KERNEL);
2426− if (ret < 0) {
2427− dev_err(&pdev->dev, "port line is full, add device failed\n");
2428− return ret;
2429− }
2430− }
2431− if (ret >= ARRAY_SIZE(lpuart_ports)) {
2432− dev_err(&pdev->dev, "serial%d out of range\n", ret);
2433− return -EINVAL;
2434− }
2435− sport->port.line = ret;
24362426 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
24372427 sport->port.membase = devm_ioremap_resource(&pdev->dev, res);
24382428 if (IS_ERR(sport->port.membase))
@@ -2477,9 +2467,25 @@ static int lpuart_probe(struct platform_device *pdev) · 38 unmodified lines
24772467 }
24782468 }
24792469
2470+ ret = of_alias_get_id(np, "serial");
2471+ if (ret < 0) {
2472+ ret = ida_simple_get(&fsl_lpuart_ida, 0, UART_NR, GFP_KERNEL);
2473+ if (ret < 0) {
2474+ dev_err(&pdev->dev, "port line is full, add device failed\n");
2475+ return ret;
2476+ }
2477+ sport->id_allocated = true;
2478+ }
2479+ if (ret >= ARRAY_SIZE(lpuart_ports)) {
2480+ dev_err(&pdev->dev, "serial%d out of range\n", ret);
2481+ ret = -EINVAL;
2482+ goto failed_out_of_range;
2483+ }
2484+ sport->port.line = ret;
2485+
24802486 ret = lpuart_enable_clks(sport);
24812487 if (ret)
2482− return ret;
2488+ goto failed_clock_enable;
24832489 sport->port.uartclk = lpuart_get_baud_clk_rate(sport);
24842490
24852491 lpuart_ports[sport->port.line] = sport;
@@ -2529,6 +2535,10 @@ static int lpuart_probe(struct platform_device *pdev) · 43 unmodified lines
25292535 failed_attach_port:
25302536 failed_irq_request:
25312537 lpuart_disable_clks(sport);
2538+failed_clock_enable:
2539+failed_out_of_range:
2540+ if (sport->id_allocated)
2541+ ida_simple_remove(&fsl_lpuart_ida, sport->port.line);
25322542 return ret;
25332543 }
25342544
@@ -2538,7 +2548,8 @@ static int lpuart_remove(struct platform_device *pdev) · 3 unmodified lines
25382548
25392549 uart_remove_one_port(&lpuart_reg, &sport->port);
25402550
2541− ida_simple_remove(&fsl_lpuart_ida, sport->port.line);
2551+ if (sport->id_allocated)
2552+ ida_simple_remove(&fsl_lpuart_ida, sport->port.line);
25422553
25432554 lpuart_disable_clks(sport);
25442555
drivers/tty/serial/mvebu-uart.c+1−1
@@ -851,7 +851,7 @@ static int mvebu_uart_probe(struct platform_device *pdev) · 850 unmodified lines
851851
852852 port->membase = devm_ioremap_resource(&pdev->dev, reg);
853853 if (IS_ERR(port->membase))
854− return -PTR_ERR(port->membase);
854+ return PTR_ERR(port->membase);
855855
856856 mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart),
857857 GFP_KERNEL);
drivers/tty/tty_io.c+6−8
@@ -1589,9 +1589,7 @@ void tty_kclose(struct tty_struct *tty) · 1588 unmodified lines
15891589 tty_debug_hangup(tty, "freeing structure\n");
15901590 /*
15911591 * The release_tty function takes care of the details of clearing
1592− * the slots and preserving the termios structure. The tty_unlock_pair
1593− * should be safe as we keep a kref while the tty is locked (so the
1594− * unlock never unlocks a freed tty).
1592+ * the slots and preserving the termios structure.
15951593 */
15961594 mutex_lock(&tty_mutex);
15971595 tty_port_set_kopened(tty->port, 0);
@@ -1621,9 +1619,7 @@ void tty_release_struct(struct tty_struct *tty, int idx) · 23 unmodified lines
16211619 tty_debug_hangup(tty, "freeing structure\n");
16221620 /*
16231621 * The release_tty function takes care of the details of clearing
1624− * the slots and preserving the termios structure. The tty_unlock_pair
1625− * should be safe as we keep a kref while the tty is locked (so the
1626− * unlock never unlocks a freed tty).
1622+ * the slots and preserving the termios structure.
16271623 */
16281624 mutex_lock(&tty_mutex);
16291625 release_tty(tty, idx);
@@ -2734,9 +2730,11 @@ static int compat_tty_tiocgserial(struct tty_struct *tty, · 1104 unmodified lines
27342730 struct serial_struct32 v32;
27352731 struct serial_struct v;
27362732 int err;
2737− memset(&v, 0, sizeof(struct serial_struct));
27382733
2739− if (!tty->ops->set_serial)
2734+ memset(&v, 0, sizeof(v));
2735+ memset(&v32, 0, sizeof(v32));
2736+
2737+ if (!tty->ops->get_serial)
27402738 return -ENOTTY;
27412739 err = tty->ops->get_serial(tty, &v);
27422740 if (!err) {
drivers/tty/vt/selection.c+18−9
@@ -181,7 +181,7 @@ int set_selection_user(const struct tiocl_selection __user *sel, · 180 unmodified lines
181181 return set_selection_kernel(&v, tty);
182182 }
183183
184−int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty)
184+static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty)
185185 {
186186 struct vc_data *vc = vc_cons[fg_console].d;
187187 int new_sel_start, new_sel_end, spc;
@@ -214,7 +214,6 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 26 unmodified lines
214214 if (ps > pe) /* make sel_start <= sel_end */
215215 swap(ps, pe);
216216
217− mutex_lock(&sel_lock);
218217 if (sel_cons != vc_cons[fg_console].d) {
219218 clear_selection();
220219 sel_cons = vc_cons[fg_console].d;
@@ -260,10 +259,9 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 39 unmodified lines
260259 break;
261260 case TIOCL_SELPOINTER:
262261 highlight_pointer(pe);
263− goto unlock;
262+ return 0;
264263 default:
265− ret = -EINVAL;
266− goto unlock;
264+ return -EINVAL;
267265 }
268266
269267 /* remove the pointer */
@@ -285,7 +283,7 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 15 unmodified lines
285283 else if (new_sel_start == sel_start)
286284 {
287285 if (new_sel_end == sel_end) /* no action required */
288− goto unlock;
286+ return 0;
289287 else if (new_sel_end > sel_end) /* extend to right */
290288 highlight(sel_end + 2, new_sel_end);
291289 else /* contract from right */
@@ -313,8 +311,7 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 21 unmodified lines
313311 if (!bp) {
314312 printk(KERN_WARNING "selection: kmalloc() failed\n");
315313 clear_selection();
316− ret = -ENOMEM;
317− goto unlock;
314+ return -ENOMEM;
318315 }
319316 kfree(sel_buffer);
320317 sel_buffer = bp;
@@ -339,8 +336,20 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 18 unmodified lines
339336 }
340337 }
341338 sel_buffer_lth = bp - sel_buffer;
342−unlock:
339+
340+ return ret;
341+}
342+
343+int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty)
344+{
345+ int ret;
346+
347+ mutex_lock(&sel_lock);
348+ console_lock();
349+ ret = __set_selection_kernel(v, tty);
350+ console_unlock();
343351 mutex_unlock(&sel_lock);
352+
344353 return ret;
345354 }
346355 EXPORT_SYMBOL_GPL(set_selection_kernel);
drivers/tty/vt/vt.c+0−2
@@ -3046,10 +3046,8 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) · 3045 unmodified lines
30463046 switch (type)
30473047 {
30483048 case TIOCL_SETSEL:
3049− console_lock();
30503049 ret = set_selection_user((struct tiocl_selection
30513050 __user *)(p+1), tty);
3052− console_unlock();
30533051 break;
30543052 case TIOCL_PASTESEL:
30553053 ret = paste_selection(tty);
drivers/usb/cdns3/gadget.c+15−4
@@ -2550,7 +2550,7 @@ found: · 2549 unmodified lines
25502550 /* Update ring only if removed request is on pending_req_list list */
25512551 if (req_on_hw_ring) {
25522552 link_trb->buffer = TRB_BUFFER(priv_ep->trb_pool_dma +
2553− (priv_req->start_trb * TRB_SIZE));
2553+ ((priv_req->end_trb + 1) * TRB_SIZE));
25542554 link_trb->control = (link_trb->control & TRB_CYCLE) |
25552555 TRB_TYPE(TRB_LINK) | TRB_CHAIN;
25562556
@@ -2595,11 +2595,21 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep) · 38 unmodified lines
25952595 {
25962596 struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
25972597 struct usb_request *request;
2598+ struct cdns3_request *priv_req;
2599+ struct cdns3_trb *trb = NULL;
25982600 int ret;
25992601 int val;
26002602
26012603 trace_cdns3_halt(priv_ep, 0, 0);
26022604
2605+ request = cdns3_next_request(&priv_ep->pending_req_list);
2606+ if (request) {
2607+ priv_req = to_cdns3_request(request);
2608+ trb = priv_req->trb;
2609+ if (trb)
2610+ trb->control = trb->control ^ TRB_CYCLE;
2611+ }

19 more lines aren’t shown here.

drivers/usb/chipidea/udc.c+4−3

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

drivers/usb/class/cdc-acm.c+21−13

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

drivers/usb/core/hub.c+6−2

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

drivers/usb/core/port.c+8−2

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

drivers/usb/core/quirks.c+9−0

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

drivers/usb/dwc3/gadget.c+8−1

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

drivers/usb/host/xhci-pci.c+2−1

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

drivers/usb/host/xhci-plat.c+1−0

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

drivers/usb/host/xhci-trace.h+6−17

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

drivers/usb/misc/usb251xb.c+16−4

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

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

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

drivers/usb/serial/pl2303.c+1−0

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

drivers/usb/serial/pl2303.h+1−0

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

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

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

drivers/usb/typec/ucsi/displayport.c+11−1

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

drivers/vhost/net.c+1−9

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

drivers/video/backlight/Kconfig+7−0

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

drivers/video/backlight/Makefile+1−0

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

drivers/video/backlight/led_bl.c+260−0

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

drivers/video/console/vgacon.c+3−0

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

drivers/virtio/virtio_balloon.c+1−1

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

drivers/virtio/virtio_ring.c+2−2

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

drivers/watchdog/iTCO_vendor.h+2−0

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

drivers/watchdog/iTCO_vendor_support.c+9−7

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

drivers/watchdog/iTCO_wdt.c+16−12

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

drivers/watchdog/wdat_wdt.c+24−1

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

drivers/xen/xen-pciback/pciback.h+1−1

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

drivers/xen/xenbus/xenbus_comms.c+4−0

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

drivers/xen/xenbus/xenbus_probe.c+5−5

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

drivers/xen/xenbus/xenbus_probe_backend.c+3−2

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

drivers/xen/xenbus/xenbus_xs.c+6−3

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

fs/afs/addr_list.c+1−1

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

fs/afs/internal.h+1−1

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

fs/btrfs/inode.c+3−1

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

fs/cifs/cifs_dfs_ref.c+2−0

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

fs/cifs/cifsfs.c+2−0

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

fs/cifs/cifsglob.h+7−0

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

fs/cifs/cifsproto.h+3−2

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

fs/cifs/cifssmb.c+2−1

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

fs/cifs/dir.c+0−1

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

fs/cifs/file.c+14−8

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

fs/cifs/inode.c+11−7

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

fs/cifs/smb1ops.c+1−1

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

fs/cifs/smb2inode.c+2−2

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

fs/cifs/smb2ops.c+5−2

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

fs/cifs/smb2pdu.c+1−0

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

fs/crypto/keysetup.c+9−0

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

fs/debugfs/file.c+4−13

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

fs/ext4/super.c+3−3

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

fs/fat/inode.c+7−12

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

fs/fcntl.c+4−2

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

fs/fuse/dev.c+3−3

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

fs/fuse/fuse_i.h+2−0

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

fs/gfs2/inode.c+1−1

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

fs/inode.c+1−0

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

fs/io-wq.c+15−62

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

fs/io-wq.h+4−12

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

fs/io_uring.c+90−64

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

fs/jbd2/transaction.c+4−4

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

fs/locks.c+44−16

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

fs/nfs/client.c+1−0

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

fs/nfs/fs_context.c+9−0

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

fs/nfs/fscache.c+2−0

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

fs/nfs/namespace.c+1−1

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

fs/nfs/nfs4client.c+0−1

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

fs/open.c+0−3

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

fs/overlayfs/Kconfig+1−0

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

fs/overlayfs/file.c+6−0

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

fs/overlayfs/overlayfs.h+6−1

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

fs/overlayfs/super.c+8−1

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

fs/overlayfs/util.c+2−2

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

fs/zonefs/Kconfig+1−0

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

fs/zonefs/super.c+4−4

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

include/acpi/actypes.h+2−1

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

include/crypto/curve25519.h+4−2

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

include/drm/drm_dp_mst_helper.h+2−2

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

include/drm/drm_gem_shmem_helper.h+5−0

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

include/dt-bindings/clock/imx8mn-clock.h+2−2

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

include/linux/blkdev.h+1−2

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

include/linux/blktrace_api.h+13−5

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

include/linux/bootconfig.h+3−0

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

include/linux/cgroup.h+1−0

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

include/linux/debugfs.h+6−7

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

include/linux/device.h+11−0

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

include/linux/dmar.h+9−5

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

include/linux/fs.h+1−0

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

include/linux/futex.h+10−7

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

include/linux/genhd.h+1−12

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

include/linux/hid.h+1−1

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

include/linux/icmpv6.h+10−6

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

include/linux/inet_diag.h+12−6

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

include/linux/intel-iommu.h+2−0

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

include/linux/kvm_host.h+3−1

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

include/linux/mm.h+4−0

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

include/linux/mmc/host.h+1−0

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

include/linux/netfilter/ipset/ip_set.h+10−1

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

include/linux/of_clk.h+4−4

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

include/linux/phy.h+3−0

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

include/linux/platform_data/spi-omap2-mcspi.h+1−0

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

include/linux/platform_device.h+1−1

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

include/linux/rhashtable.h+1−1

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

include/linux/workqueue.h+16−0

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

include/net/fib_rules.h+1−0

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

include/soc/mscc/ocelot_dev.h+1−1

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

include/sound/soc.h+1−1

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

include/uapi/linux/dm-ioctl.h+2−2

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

include/uapi/linux/in.h+2−0

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

include/xen/interface/io/tpmif.h+1−1

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

include/xen/xenbus.h+2−1

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

init/Kconfig+3−5

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

init/main.c+22−16

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

kernel/audit.c+21−19

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

kernel/auditfilter.c+39−32

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

kernel/cgroup/cgroup-v1.c+2−1

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

kernel/cgroup/cgroup.c+30−13

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

kernel/exit.c+2−2

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

kernel/fork.c+1−1

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

kernel/futex.c+55−38

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

kernel/pid.c+10−0

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

kernel/power/snapshot.c+1−1

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

kernel/sched/fair.c+2−0

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

kernel/signal.c+14−9

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

kernel/sys.c+2−0

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

kernel/trace/Kconfig+2−2

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

kernel/trace/blktrace.c+86−31

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

kernel/trace/ftrace.c+2−0

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

kernel/trace/synth_event_gen_test.c+22−22

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

kernel/trace/trace.c+2−0

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

kernel/trace/trace_events_hist.c+101−11

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

kernel/workqueue.c+8−6

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

lib/bootconfig.c+27−9

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

lib/crypto/chacha20poly1305.c+3−0

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

mm/huge_memory.c+1−2

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

mm/memcontrol.c+2−12

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

mm/memory.c+27−8

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

mm/memory_hotplug.c+7−1

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

mm/mprotect.c+36−2

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

mm/shmem.c+0−2

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

mm/slub.c+13−2

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

mm/z3fold.c+0−1

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

net/batman-adv/bat_iv_ogm.c+4−0

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

net/bridge/br_device.c+2−4

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

net/caif/caif_dev.c+2−1

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

net/core/dev.c+2−0

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

net/core/devlink.c+44−27

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

net/core/netclassid_cgroup.c+37−10

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

net/core/sock.c+4−1

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

net/dsa/dsa_priv.h+2−0

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

net/dsa/port.c+35−9

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

net/dsa/slave.c+2−6

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

net/ethtool/bitset.c+2−1

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

net/ethtool/bitset.h+2−0

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

net/ieee802154/nl_policy.c+6−0

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

net/ipv4/cipso_ipv4.c+6−1

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

net/ipv4/gre_demux.c+10−2

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

net/ipv4/inet_connection_sock.c+20−0

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

net/ipv4/inet_diag.c+20−24

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

net/ipv4/raw_diag.c+3−2

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

net/ipv4/tcp_input.c+5−1

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

net/ipv4/udp_diag.c+3−2

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

net/ipv6/addrconf.c+40−11

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

net/ipv6/ipv6_sockglue.c+8−2

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

net/ipv6/seg6_iptunnel.c+1−1

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

net/ipv6/seg6_local.c+1−1

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

net/mac80211/mesh_hwmp.c+2−1

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

net/mac80211/mlme.c+1−5

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

net/mac80211/rx.c+1−1

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

net/mptcp/options.c+17−2

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

net/mptcp/protocol.c+6−0

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

net/netfilter/ipset/ip_set_core.c+24−10

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

net/netfilter/ipset/ip_set_hash_gen.h+440−195

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

net/netfilter/nf_conntrack_standalone.c+1−1

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

net/netfilter/nf_synproxy_core.c+1−1

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

net/netfilter/nf_tables_api.c+14−8

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

net/netfilter/nfnetlink_cthelper.c+2−0

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

net/netfilter/nft_chain_nat.c+1−0

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

net/netfilter/nft_payload.c+1−0

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

net/netfilter/nft_set_pipapo.c+4−2

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

net/netfilter/nft_tunnel.c+2−0

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

net/netfilter/x_tables.c+3−3

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

net/netfilter/xt_hashlimit.c+6−10

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

net/netfilter/xt_recent.c+1−1

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

net/netlink/af_netlink.c+1−1

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

net/netlink/genetlink.c+3−2

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

net/nfc/hci/core.c+16−3

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

net/nfc/netlink.c+4−0

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

net/openvswitch/datapath.c+1−0

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

net/packet/af_packet.c+7−6

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

net/sched/act_api.c+1−0

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

net/sched/sch_fq.c+1−0

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

net/sched/sch_taprio.c+10−3

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

net/sctp/diag.c+2−6

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

net/smc/af_smc.c+15−10

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

net/smc/smc_core.c+12−0

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

net/smc/smc_core.h+1−1

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

net/smc/smc_ib.c+3−0

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

net/tipc/netlink.c+1−0

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

net/unix/af_unix.c+4−0

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

net/vmw_vsock/af_vsock.c+12−8

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

net/vmw_vsock/hyperv_transport.c+0−3

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

net/vmw_vsock/virtio_transport_common.c+0−2

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

net/wireless/nl80211.c+8−2

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

net/wireless/reg.c+1−1

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

scripts/Kconfig.include+7−0

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

scripts/Makefile.extrawarn+1−0

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

scripts/Makefile.lib+3−3

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

scripts/export_report.pl+1−1

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

scripts/kallsyms.c+4−4

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

scripts/mod/modpost.c+14−13

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

scripts/parse-maintainers.pl+0−0

File mode changed from 100644 to 100755.

sound/core/oss/pcm_plugin.c+10−2

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

sound/core/seq/oss/seq_oss_midi.c+1−0

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

sound/core/seq/seq_virmidi.c+1−0

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

sound/mips/sgio2audio.c+0−6

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

sound/pci/hda/patch_realtek.c+52−4

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

sound/soc/codecs/Kconfig+1−1

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

sound/soc/codecs/pcm512x.c+5−3

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

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

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

sound/soc/codecs/tas2562.c+3−2

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

sound/soc/intel/skylake/skl-debug.c+17−15

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

sound/soc/intel/skylake/skl-ssp-clk.c+3−1

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

sound/soc/meson/g12a-tohdmitx.c+6−0

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

sound/soc/soc-component.c+1−1

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

sound/soc/soc-compress.c+1−1

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

sound/soc/soc-dapm.c+1−1

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

sound/soc/soc-pcm.c+9−9

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

sound/soc/soc-topology.c+10−7

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

sound/soc/sof/ipc.c+1−1

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

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

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

sound/usb/line6/driver.c+1−1

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

sound/usb/line6/midibuf.c+1−1

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

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

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

tools/arch/x86/include/uapi/asm/kvm.h+1−0

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

tools/bootconfig/include/linux/printk.h+1−4

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

tools/bootconfig/main.c+32−19

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

tools/bootconfig/samples/bad-mixed-kv1.bconf+3−0

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

tools/bootconfig/samples/bad-mixed-kv2.bconf+3−0

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

tools/bootconfig/samples/bad-samekey.bconf+6−0

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

tools/bootconfig/test-bootconfig.sh+15−3

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

tools/include/uapi/asm/errno.h+7−7

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

tools/perf/Documentation/perf-config.txt+73−1

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

tools/perf/arch/arm/util/cs-etm.c+2−16

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

tools/perf/arch/arm64/util/arm-spe.c+12−25

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

tools/perf/arch/arm64/util/perf_regs.c+1−1

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

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl+2−0

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

tools/perf/arch/powerpc/util/perf_regs.c+2−2

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

tools/perf/arch/x86/util/auxtrace.c+7−7

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

tools/perf/arch/x86/util/event.c+6−6

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

tools/perf/arch/x86/util/header.c+2−2

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

tools/perf/arch/x86/util/intel-bts.c+14−27

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

tools/perf/arch/x86/util/intel-pt.c+17−30

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

tools/perf/arch/x86/util/machine.c+3−3

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

tools/perf/arch/x86/util/perf_regs.c+4−4

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

tools/perf/arch/x86/util/pmu.c+3−3

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

tools/perf/bench/bench.h+4−0

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

tools/perf/bench/epoll-ctl.c+4−4

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

tools/perf/bench/epoll-wait.c+6−6

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

tools/perf/bench/futex-hash.c+7−6

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

tools/perf/bench/futex-lock-pi.c+6−6

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

tools/perf/bench/futex-requeue.c+1−0

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

tools/perf/bench/futex-wake-parallel.c+1−0

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

tools/perf/bench/futex-wake.c+3−2

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

tools/perf/builtin-annotate.c+2−2

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

tools/perf/builtin-diff.c+2−1

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

tools/perf/builtin-probe.c+4−2

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

tools/perf/builtin-report.c+1−1

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

tools/perf/builtin-top.c+5−3

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

tools/perf/include/bpf/pid_filter.h+1−1

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

tools/perf/include/bpf/stdio.h+1−1

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

tools/perf/include/bpf/unistd.h+1−1

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

tools/perf/pmu-events/jevents.c+9−6

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

tools/perf/tests/bp_account.c+1−1

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

tools/perf/tests/shell/lib/probe_vfs_getname.sh+1−1

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

tools/perf/ui/browsers/annotate.c+9−10

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

tools/perf/ui/gtk/annotate.c+1−1

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

tools/perf/util/annotate.c+75−119

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

tools/perf/util/annotate.h+3−6

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

tools/perf/util/auxtrace.c+21−1

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

tools/perf/util/auxtrace.h+6−0

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

tools/perf/util/block-info.c+2−1

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

tools/perf/util/config.c+12−0

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

tools/perf/util/config.h+1−0

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

tools/perf/util/env.c+2−2

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

tools/perf/util/map.c+1−1

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

tools/perf/util/parse-events.c+2−8

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

tools/perf/util/probe-file.c+24−4

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

tools/perf/util/symbol.c+6−7

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

tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c+1−1

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

tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c+1−1

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

tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c+2−0

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

tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h+1−1

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

tools/testing/ktest/ktest.pl+8−8

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

tools/testing/ktest/sample.conf+11−11

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

tools/testing/kunit/kunit.py+12−0

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

tools/testing/kunit/kunit_kernel.py+16−12

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

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

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

tools/testing/selftests/livepatch/Makefile+2−0

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

tools/testing/selftests/lkdtm/.gitignore+2−0

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

tools/testing/selftests/net/fib_tests.sh+31−3

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

tools/testing/selftests/net/mptcp/Makefile+2−0

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

tools/testing/selftests/netfilter/nft_concat_range.sh+45−10

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

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

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

tools/testing/selftests/rseq/Makefile+3−1

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

tools/testing/selftests/rtc/Makefile+2−0

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

tools/testing/selftests/tc-testing/config+1−0

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

usr/Kconfig+11−11

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

virt/kvm/arm/arm.c+0−2

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

virt/kvm/arm/trace.h+1−0

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